-
Notifications
You must be signed in to change notification settings - Fork 21
feat(component): add anchor navigation functionality to <post-tab> component
#6350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
alionazherdetska
wants to merge
137
commits into
main
Choose a base branch
from
feat/tabs-anchor-navigation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
137 commits
Select commit
Hold shift + click to select a range
71e02b0
feat(component): implement `anchor-navigation` for `<post-tabs>`
alionazherdetska fa1c06d
improved the render
alionazherdetska 20cc211
changed the logic for assigning aria current
alionazherdetska 0944082
small changes
alionazherdetska ba0fa35
changed the docs
alionazherdetska cc36657
fixed the `Enter` button
alionazherdetska a51883b
reverted some redundant changes
alionazherdetska 428f9bc
changed some PostTabHeader to PostTabItem
alionazherdetska ec120a5
some adjustments
alionazherdetska f279029
removed redundant code
alionazherdetska 10aa194
removed redundant code
alionazherdetska 0817546
removed comments
alionazherdetska 2d1daa3
removed comments
alionazherdetska d2e814d
changed the naming in the test files
alionazherdetska 2a468b0
added initial docs
alionazherdetska 8283f36
adjusted the docs
alionazherdetska 93ca97a
small changes
alionazherdetska 8435960
added e2e tests
alionazherdetska 8a80ffe
removed redundant test
alionazherdetska b0d7a46
changed the docs
alionazherdetska 8cb61d0
changed the docs
alionazherdetska 6fe0429
changed the name slots
alionazherdetska b50cef5
updated the docs
alionazherdetska 0aa648a
chnaged the docs
alionazherdetska c479813
changed the names of panels
alionazherdetska 6625782
removed redundant code
alionazherdetska 8724a4d
adjusted the tests
alionazherdetska d017089
adjusted the tabs
alionazherdetska 2bc088e
removed redundant code
alionazherdetska 0a9fad4
removed redundant code
alionazherdetska d3e2878
fixed e2e tests
alionazherdetska 56c570e
fixed linting
alionazherdetska 282820b
fixed the stories
alionazherdetska 900434e
code style editing
alionazherdetska 4c07f68
shifted the data-attribute assigning
alionazherdetska c2373ae
cleaned up animation
alionazherdetska bfe512f
implemednted the mutation observer
alionazherdetska 93014cf
fixed `e2e` tests
alionazherdetska e72df63
renamed all instances of post-tab-header to post-tab-item
alionazherdetska ef1dede
added angular e2e tests
alionazherdetska 17ca32c
removed redundant comments
alionazherdetska a4c0c65
reverted the changes to tabs.stories
alionazherdetska a096e7d
removed redundant code
alionazherdetska 7e3d4ef
fixed the tests
alionazherdetska d9e1540
added a changeset
alionazherdetska 2f8bdaf
added a changeset
alionazherdetska 1eac65d
fixed the changeset
alionazherdetska 863ea26
fixed the changeset
alionazherdetska 9c14124
Merge branch 'main' into feat/tabs-anchor-navigation
alionazherdetska 1210ef5
fixed linting
alionazherdetska d396888
removed unused var
alionazherdetska 970c0c2
fixed angular tests
alionazherdetska f82a15a
clean up
alionazherdetska 94de5d9
fixed tests
alionazherdetska b3a046b
chnaged the docs
alionazherdetska a90aa4e
removed duplicate code
alionazherdetska d149ff8
removed duplicate code
alionazherdetska e150898
fixed e2e tests for `post-tabs`
alionazherdetska 8e1d8ad
removed redundant tests
alionazherdetska a615a95
fixed the tests
alionazherdetska d18793a
reverted pnpm-lock.yaml
alionazherdetska a454af9
reverted pnpm-lock.yaml
alionazherdetska b196017
Merge branch 'main' into feat/tabs-anchor-navigation
alionazherdetska 20711db
fix
alionazherdetska e6369f5
fix
alionazherdetska 4fd4a3d
test fix
alionazherdetska 098e7e7
removed e2e files
alionazherdetska bd07d05
Merge branch 'main' into feat/tabs-anchor-navigation
alionazherdetska 109e9d0
clean up
alionazherdetska e16d55c
fixed the order
alionazherdetska 4709cb2
cleanup
alionazherdetska 86173c4
fixed the markup
alionazherdetska 8470400
Update packages/components/src/components/post-tab-item/post-tab-item…
alionazherdetska 9f47c55
added mutation observer to post-tab-item
alionazherdetska c76cafc
Merge branch 'feat/tabs-anchor-navigation' of https://github.com/swis…
alionazherdetska 965595d
autogenerated files
alionazherdetska 3c1a452
Merge branch 'main' into feat/tabs-anchor-navigation
alionazherdetska 3145567
Merge branch 'main' into feat/tabs-anchor-navigation
alionazherdetska a49862c
fixed the docs
alionazherdetska e989574
reverted redundant code
alionazherdetska d99c3f2
removed redundant code
alionazherdetska acf9120
reverted redundant changes
alionazherdetska 1891387
fixed the docs
alionazherdetska b91b992
fixed that tabs docs
alionazherdetska d752785
fixed that tabs docs
alionazherdetska d814f1f
fixed that tabs docs
alionazherdetska 480ec23
improved the docs
alionazherdetska dae3f00
improved the docs
alionazherdetska 6ca8015
added the label
alionazherdetska cb1196f
added aria-current
alionazherdetska 73a997f
Merge branch 'main' into feat/tabs-anchor-navigation
alionazherdetska ff13916
added missing labels for integration packages
alionazherdetska 231a399
refactored the e2e tests
alionazherdetska 9492161
fixed formatting
alionazherdetska e9ab30d
renamed tab header to tab item
alionazherdetska a64eea7
removed duplicate tests
alionazherdetska 127bdf2
fixed liting
alionazherdetska 07f9257
removed duplicate tests
alionazherdetska 5966df9
fixed aria-current
alionazherdetska 30a94cc
fixed linting
alionazherdetska 02892dc
Merge branch 'main' into feat/tabs-anchor-navigation
alionazherdetska 46f64e9
chore(components): added initial styles for `post-tabs` component in …
alionazherdetska 9d56ea8
fixed the tabs
alionazherdetska fdfc62b
updated the docs
alionazherdetska 07a6738
removed redundant code
alionazherdetska e81266b
fixed linting
alionazherdetska 4245dda
fixed code quality
alionazherdetska b9cbd9a
test files to prove aria-current is getting assigned
alionazherdetska c44a6ed
Daily discussion
alionazherdetska bcef2c9
refactored the tabs
alionazherdetska 5c20dda
removed redundant code
alionazherdetska 9981e4f
reset page
alionazherdetska ca25af8
chnages to tests
alionazherdetska 134e140
Merge branch 'main' into feat/tabs-anchor-navigation
alionazherdetska 3c071a5
added missing reflect
alionazherdetska 4c841d2
remove redundant code
alionazherdetska 12355b4
simplified render
alionazherdetska d986c45
removed the complexity
alionazherdetska 06bfc10
initial fix
alionazherdetska 89c4694
fix
alionazherdetska 15ff624
small fixes
alionazherdetska 0fc1d13
restored the story
alionazherdetska aa439a6
added missing comments
alionazherdetska 5ddf991
added the comments
alionazherdetska a4a3fb9
added the documentation
alionazherdetska 97745b9
Merge branch 'main' into feat/tabs-anchor-navigation
alionazherdetska a525762
autogenerated file
alionazherdetska 8b7a8e1
removed redundant files
alionazherdetska 6abd49d
refactored the changeset
alionazherdetska 7cdbf83
Update packages/nextjs-integration/src/app/ssr/page.tsx
alionazherdetska b4f5b78
added the migartion entry
alionazherdetska 4196d45
fixed the slots
alionazherdetska 451915c
small refactor to fix the bug
alionazherdetska abc01d5
small changes
alionazherdetska 8addf35
fixed the docs
alionazherdetska 21389cc
slight changes
alionazherdetska c669ac9
small changes
alionazherdetska File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| --- | ||
| "@swisspost/design-system-components": major | ||
| "@swisspost/design-system-components-react": major | ||
| "@swisspost/design-system-components-angular": major | ||
| --- | ||
|
|
||
| Refactored `<post-tabs>` component: | ||
| - Renamed `post-tab-header` component to `post-tab-item` | ||
| - Renamed `panel` property to `name` in `post-tab-item` component | ||
| - Renamed `name` property to `for` in `post-tab-panel` component | ||
| - Renamed `activePanel` property to `activeTab` in `post-tabs` component | ||
| - Changed slot structure: `post-tab-item` elements now use the default slot and `post-tab-panel` elements use the `panels` slot | ||
|
|
||
| BEFORE: | ||
|
|
||
| ```html | ||
| <post-tabs active-panel="first"> | ||
| <post-tab-header panel="first">First tab</post-tab-header> | ||
| <post-tab-header panel="second">Second tab</post-tab-header> | ||
| <post-tab-header panel="third">Third tab</post-tab-header> | ||
|
|
||
| <post-tab-panel name="first"> | ||
| This is the content of the first tab. | ||
| </post-tab-panel> | ||
| <post-tab-panel name="second"> | ||
| This is the content of the second tab. | ||
| </post-tab-panel> | ||
| <post-tab-panel name="third"> | ||
| This is the content of the third tab. | ||
| </post-tab-panel> | ||
| </post-tabs> | ||
| ``` | ||
|
|
||
| AFTER: | ||
|
|
||
| ```html | ||
| <post-tabs active-tab="first"> | ||
| <post-tab-item name="first">First tab</post-tab-item> | ||
| <post-tab-item name="second">Second tab</post-tab-item> | ||
| <post-tab-item name="third">Third tab</post-tab-item> | ||
|
|
||
| <post-tab-panel for="first" slot="panels"> | ||
| This is the content of the first tab. | ||
| </post-tab-panel> | ||
| <post-tab-panel for="second" slot="panels"> | ||
| This is the content of the second tab. | ||
| </post-tab-panel> | ||
| <post-tab-panel for="third" slot="panels"> | ||
| This is the content of the third tab. | ||
| </post-tab-panel> | ||
| </post-tabs> | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "@swisspost/design-system-components": minor | ||
| "@swisspost/design-system-documentation": minor | ||
| --- | ||
|
|
||
| Added navigation variant to the `post-tabs` component, enabling anchor-based navigation. The component now automatically detects whether `post-tab-item` elements contain anchor links and switches between panels and navigation variants accordingly. The `aria-current="page"` attribute must be manually added to the anchor element representing the current page to ensure proper styling and accessibility. |
2 changes: 1 addition & 1 deletion
2
packages/components-angular/projects/consumer-app/cypress/e2e/components.cy.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,4 +1,4 @@ | ||||||
| import * as Components from '@swisspost/design-system-components/dist'; | ||||||
| import * as Components from '@swisspost/design-system-components/loader'; | ||||||
|
||||||
| import * as Components from '@swisspost/design-system-components/loader'; | |
| import * as Components from '@swisspost/design-system-components/dist'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.