Skip to content
Open
Show file tree
Hide file tree
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 Sep 30, 2025
fa1c06d
improved the render
alionazherdetska Sep 30, 2025
20cc211
changed the logic for assigning aria current
alionazherdetska Sep 30, 2025
0944082
small changes
alionazherdetska Sep 30, 2025
ba0fa35
changed the docs
alionazherdetska Sep 30, 2025
cc36657
fixed the `Enter` button
alionazherdetska Sep 30, 2025
a51883b
reverted some redundant changes
alionazherdetska Sep 30, 2025
428f9bc
changed some PostTabHeader to PostTabItem
alionazherdetska Sep 30, 2025
ec120a5
some adjustments
alionazherdetska Sep 30, 2025
f279029
removed redundant code
alionazherdetska Sep 30, 2025
10aa194
removed redundant code
alionazherdetska Sep 30, 2025
0817546
removed comments
alionazherdetska Sep 30, 2025
2d1daa3
removed comments
alionazherdetska Sep 30, 2025
d2e814d
changed the naming in the test files
alionazherdetska Sep 30, 2025
2a468b0
added initial docs
alionazherdetska Oct 1, 2025
8283f36
adjusted the docs
alionazherdetska Oct 1, 2025
93ca97a
small changes
alionazherdetska Oct 1, 2025
8435960
added e2e tests
alionazherdetska Oct 1, 2025
8a80ffe
removed redundant test
alionazherdetska Oct 1, 2025
b0d7a46
changed the docs
alionazherdetska Oct 1, 2025
8cb61d0
changed the docs
alionazherdetska Oct 1, 2025
6fe0429
changed the name slots
alionazherdetska Oct 1, 2025
b50cef5
updated the docs
alionazherdetska Oct 1, 2025
0aa648a
chnaged the docs
alionazherdetska Oct 1, 2025
c479813
changed the names of panels
alionazherdetska Oct 1, 2025
6625782
removed redundant code
alionazherdetska Oct 1, 2025
8724a4d
adjusted the tests
alionazherdetska Oct 1, 2025
d017089
adjusted the tabs
alionazherdetska Oct 1, 2025
2bc088e
removed redundant code
alionazherdetska Oct 1, 2025
0a9fad4
removed redundant code
alionazherdetska Oct 1, 2025
d3e2878
fixed e2e tests
alionazherdetska Oct 1, 2025
56c570e
fixed linting
alionazherdetska Oct 1, 2025
282820b
fixed the stories
alionazherdetska Oct 1, 2025
900434e
code style editing
alionazherdetska Oct 6, 2025
4c07f68
shifted the data-attribute assigning
alionazherdetska Oct 7, 2025
c2373ae
cleaned up animation
alionazherdetska Oct 7, 2025
bfe512f
implemednted the mutation observer
alionazherdetska Oct 7, 2025
93014cf
fixed `e2e` tests
alionazherdetska Oct 7, 2025
e72df63
renamed all instances of post-tab-header to post-tab-item
alionazherdetska Oct 7, 2025
ef1dede
added angular e2e tests
alionazherdetska Oct 7, 2025
17ca32c
removed redundant comments
alionazherdetska Oct 7, 2025
a4c0c65
reverted the changes to tabs.stories
alionazherdetska Oct 7, 2025
a096e7d
removed redundant code
alionazherdetska Oct 7, 2025
7e3d4ef
fixed the tests
alionazherdetska Oct 8, 2025
d9e1540
added a changeset
alionazherdetska Oct 8, 2025
2f8bdaf
added a changeset
alionazherdetska Oct 8, 2025
1eac65d
fixed the changeset
alionazherdetska Oct 8, 2025
863ea26
fixed the changeset
alionazherdetska Oct 8, 2025
9c14124
Merge branch 'main' into feat/tabs-anchor-navigation
alionazherdetska Oct 8, 2025
1210ef5
fixed linting
alionazherdetska Oct 8, 2025
d396888
removed unused var
alionazherdetska Oct 8, 2025
970c0c2
fixed angular tests
alionazherdetska Oct 8, 2025
f82a15a
clean up
alionazherdetska Oct 8, 2025
94de5d9
fixed tests
alionazherdetska Oct 8, 2025
b3a046b
chnaged the docs
alionazherdetska Oct 9, 2025
a90aa4e
removed duplicate code
alionazherdetska Oct 13, 2025
d149ff8
removed duplicate code
alionazherdetska Oct 13, 2025
e150898
fixed e2e tests for `post-tabs`
alionazherdetska Oct 15, 2025
8e1d8ad
removed redundant tests
alionazherdetska Oct 15, 2025
a615a95
fixed the tests
alionazherdetska Oct 15, 2025
d18793a
reverted pnpm-lock.yaml
alionazherdetska Oct 15, 2025
a454af9
reverted pnpm-lock.yaml
alionazherdetska Oct 15, 2025
b196017
Merge branch 'main' into feat/tabs-anchor-navigation
alionazherdetska Oct 15, 2025
20711db
fix
alionazherdetska Oct 15, 2025
e6369f5
fix
alionazherdetska Oct 15, 2025
4fd4a3d
test fix
alionazherdetska Oct 15, 2025
098e7e7
removed e2e files
alionazherdetska Oct 17, 2025
bd07d05
Merge branch 'main' into feat/tabs-anchor-navigation
alionazherdetska Oct 21, 2025
109e9d0
clean up
alionazherdetska Oct 22, 2025
e16d55c
fixed the order
alionazherdetska Oct 22, 2025
4709cb2
cleanup
alionazherdetska Oct 22, 2025
86173c4
fixed the markup
alionazherdetska Oct 22, 2025
8470400
Update packages/components/src/components/post-tab-item/post-tab-item…
alionazherdetska Oct 27, 2025
9f47c55
added mutation observer to post-tab-item
alionazherdetska Oct 28, 2025
c76cafc
Merge branch 'feat/tabs-anchor-navigation' of https://github.com/swis…
alionazherdetska Oct 28, 2025
965595d
autogenerated files
alionazherdetska Oct 28, 2025
3c1a452
Merge branch 'main' into feat/tabs-anchor-navigation
alionazherdetska Oct 28, 2025
3145567
Merge branch 'main' into feat/tabs-anchor-navigation
alionazherdetska Nov 3, 2025
a49862c
fixed the docs
alionazherdetska Nov 3, 2025
e989574
reverted redundant code
alionazherdetska Nov 3, 2025
d99c3f2
removed redundant code
alionazherdetska Nov 3, 2025
acf9120
reverted redundant changes
alionazherdetska Nov 3, 2025
1891387
fixed the docs
alionazherdetska Nov 3, 2025
b91b992
fixed that tabs docs
alionazherdetska Nov 3, 2025
d752785
fixed that tabs docs
alionazherdetska Nov 3, 2025
d814f1f
fixed that tabs docs
alionazherdetska Nov 3, 2025
480ec23
improved the docs
alionazherdetska Nov 3, 2025
dae3f00
improved the docs
alionazherdetska Nov 3, 2025
6ca8015
added the label
alionazherdetska Nov 3, 2025
cb1196f
added aria-current
alionazherdetska Nov 3, 2025
73a997f
Merge branch 'main' into feat/tabs-anchor-navigation
alionazherdetska Nov 4, 2025
ff13916
added missing labels for integration packages
alionazherdetska Nov 5, 2025
231a399
refactored the e2e tests
alionazherdetska Nov 5, 2025
9492161
fixed formatting
alionazherdetska Nov 5, 2025
e9ab30d
renamed tab header to tab item
alionazherdetska Nov 5, 2025
a64eea7
removed duplicate tests
alionazherdetska Nov 5, 2025
127bdf2
fixed liting
alionazherdetska Nov 5, 2025
07f9257
removed duplicate tests
alionazherdetska Nov 5, 2025
5966df9
fixed aria-current
alionazherdetska Nov 6, 2025
30a94cc
fixed linting
alionazherdetska Nov 6, 2025
02892dc
Merge branch 'main' into feat/tabs-anchor-navigation
alionazherdetska Nov 6, 2025
46f64e9
chore(components): added initial styles for `post-tabs` component in …
alionazherdetska Nov 6, 2025
9d56ea8
fixed the tabs
alionazherdetska Nov 7, 2025
fdfc62b
updated the docs
alionazherdetska Nov 7, 2025
07a6738
removed redundant code
alionazherdetska Nov 7, 2025
e81266b
fixed linting
alionazherdetska Nov 7, 2025
4245dda
fixed code quality
alionazherdetska Nov 7, 2025
b9cbd9a
test files to prove aria-current is getting assigned
alionazherdetska Nov 7, 2025
c44a6ed
Daily discussion
alionazherdetska Nov 12, 2025
bcef2c9
refactored the tabs
alionazherdetska Nov 12, 2025
5c20dda
removed redundant code
alionazherdetska Nov 12, 2025
9981e4f
reset page
alionazherdetska Nov 12, 2025
ca25af8
chnages to tests
alionazherdetska Nov 13, 2025
134e140
Merge branch 'main' into feat/tabs-anchor-navigation
alionazherdetska Nov 13, 2025
3c071a5
added missing reflect
alionazherdetska Nov 13, 2025
4c841d2
remove redundant code
alionazherdetska Nov 13, 2025
12355b4
simplified render
alionazherdetska Nov 13, 2025
d986c45
removed the complexity
alionazherdetska Nov 13, 2025
06bfc10
initial fix
alionazherdetska Nov 13, 2025
89c4694
fix
alionazherdetska Nov 13, 2025
15ff624
small fixes
alionazherdetska Nov 13, 2025
0fc1d13
restored the story
alionazherdetska Nov 13, 2025
aa439a6
added missing comments
alionazherdetska Nov 13, 2025
5ddf991
added the comments
alionazherdetska Nov 13, 2025
a4a3fb9
added the documentation
alionazherdetska Nov 13, 2025
97745b9
Merge branch 'main' into feat/tabs-anchor-navigation
alionazherdetska Nov 13, 2025
a525762
autogenerated file
alionazherdetska Nov 13, 2025
8b7a8e1
removed redundant files
alionazherdetska Nov 13, 2025
6abd49d
refactored the changeset
alionazherdetska Nov 13, 2025
7cdbf83
Update packages/nextjs-integration/src/app/ssr/page.tsx
alionazherdetska Nov 14, 2025
b4f5b78
added the migartion entry
alionazherdetska Nov 14, 2025
4196d45
fixed the slots
alionazherdetska Nov 14, 2025
451915c
small refactor to fix the bug
alionazherdetska Nov 18, 2025
abc01d5
small changes
alionazherdetska Nov 18, 2025
8addf35
fixed the docs
alionazherdetska Nov 18, 2025
21389cc
slight changes
alionazherdetska Nov 18, 2025
c669ac9
small changes
alionazherdetska Nov 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .changeset/tabs-anchor-navigation.md
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>
```
6 changes: 6 additions & 0 deletions .changeset/tabs-navigation-mode.md
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.
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';
Copy link

Copilot AI Nov 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import path changed from dist to loader. This appears to be an unrelated change to the tabs refactoring. Ensure this import path change is intentional and doesn't break the component loading mechanism.

Suggested change
import * as Components from '@swisspost/design-system-components/loader';
import * as Components from '@swisspost/design-system-components/dist';

Copilot uses AI. Check for mistakes.

const COMPONENT_TAG_NAMES = Object.keys(Components)
.filter(c => /^Post([A-Z][a-z]+)+$/.test(c))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,22 +111,35 @@ <h2>Post Rating</h2>
</div>

<div class="my-24">
<h2>Post Tabs</h2>
<h2>Post Tabs - Panel Variant</h2>
<post-tabs>
<post-tab-header panel="unua">Unua langeto</post-tab-header>
<post-tab-header panel="dua">Dua langeto</post-tab-header>
<post-tab-header panel="tria">Tria langeto</post-tab-header>
<post-tab-item name="unua">Unua langeto</post-tab-item>
<post-tab-item name="dua">Dua langeto</post-tab-item>
<post-tab-item name="tria">Tria langeto</post-tab-item>

<post-tab-panel name="unua">
<post-tab-panel for="unua">
Jen la enhavo de la unua langeto. Defaŭlte ĝi montriĝas komence.
</post-tab-panel>
<post-tab-panel name="dua">
<post-tab-panel for="dua">
Jen la enhavo de la dua langeto. Defaŭlte ĝi estas kaŝita komence.
</post-tab-panel>
<post-tab-panel name="tria">
<post-tab-panel for="tria">
Jen la enhavo de la tria langeto. Defaŭlte ĝi ankaŭ estas kaŝita komence.
</post-tab-panel>
</post-tabs>

<h2>Post Tabs - Navigation Variant</h2>
<post-tabs label="Tabs navigation">
<post-tab-item name="nav-first">
<a href="#first">First</a>
</post-tab-item>
<post-tab-item name="nav-second">
<a href="#second">Second</a>
</post-tab-item>
<post-tab-item name="nav-third">
<a href="#third">Third</a>
</post-tab-item>
</post-tabs>
</div>

<div class="my-24">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
PostPopovercontainer,
PostPopoverTrigger,
PostRating,
PostTabHeader,
PostTabItem,
PostTabPanel,
PostTabs,
PostTooltip,
Expand Down Expand Up @@ -46,7 +46,7 @@ import {
PostPopovercontainer,
PostPopoverTrigger,
PostRating,
PostTabHeader,
PostTabItem,
PostTabPanel,
PostTabs,
PostTooltip,
Expand Down
Loading
Loading