-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into update-tokens
- Loading branch information
Showing
93 changed files
with
3,104 additions
and
1,674 deletions.
There are no files selected for viewing
This file contains 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-icons': minor | ||
--- | ||
|
||
Added icon number 2633. | ||
|
This file contains 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-documentation': minor | ||
'@swisspost/design-system-components': minor | ||
--- | ||
|
||
Added the `post-togglebutton` component. |
This file contains 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,5 @@ | ||
--- | ||
'@swisspost/design-system-components': minor | ||
--- | ||
|
||
Added the capability to use a slotted img as a logo inside ´accordion-items´. |
This file contains 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,5 @@ | ||
--- | ||
'@swisspost/design-system-documentation': minor | ||
--- | ||
|
||
Added a ´post-accordion´ example showing logo usage. |
This file contains 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,5 @@ | ||
--- | ||
'@swisspost/design-system-styles': patch | ||
--- | ||
|
||
Updated the ´post-accordion´ styles to match the new Post design. |
This file contains 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 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,5 @@ | ||
--- | ||
'@swisspost/design-system-components': patch | ||
--- | ||
|
||
Made `post-icon` component use base tag href to define location of icons folder. |
This file contains 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 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 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 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 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,6 +1,6 @@ | ||
{ | ||
"name": "@swisspost/design-system-components-angular", | ||
"version": "9.0.0-next.6", | ||
"version": "9.0.0-next.7", | ||
"description": "Swiss Post Design System - Angular Wrapper Components", | ||
"author": "Swiss Post <[email protected]>", | ||
"license": "Apache-2.0", | ||
|
@@ -19,7 +19,7 @@ | |
}, | ||
"dependencies": { | ||
"tslib": "2.6.3", | ||
"@swisspost/design-system-components": "workspace:9.0.0-next.6" | ||
"@swisspost/design-system-components": "workspace:9.0.0-next.7" | ||
}, | ||
"peerDependencies": { | ||
"@angular/common": "^16.0.0 || ^17.0.0 || ^18.0.0", | ||
|
This file contains 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 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,6 +1,6 @@ | ||
{ | ||
"name": "@swisspost/design-system-components-react", | ||
"version": "9.0.0-next.6", | ||
"version": "9.0.0-next.7", | ||
"description": "Design System React Components for easy integration with the React ecosystem", | ||
"author": "Swiss Post <[email protected]>", | ||
"license": "Apache-2.0", | ||
|
@@ -29,7 +29,7 @@ | |
"lint": "eslint src/**/*.ts" | ||
}, | ||
"dependencies": { | ||
"@swisspost/design-system-components": "workspace:9.0.0-next.6" | ||
"@swisspost/design-system-components": "workspace:9.0.0-next.7" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "20.14.14", | ||
|
This file contains 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 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,114 @@ | ||
const TOGGLE_BUTTON_ID = '1a6f47c2-5e8a-45a0-b1c3-9f7e2b834c24'; | ||
|
||
describe('togglebutton', () => { | ||
beforeEach(() => { | ||
cy.visit('/iframe.html?id=snapshots--toggle-button'); | ||
cy.get('post-togglebutton', { timeout: 30000 }).should('be.visible'); | ||
}); | ||
|
||
describe('default behavior', () => { | ||
it('should toggle state when clicked', () => { | ||
cy.get('post-togglebutton') | ||
.first() | ||
.as('button') | ||
.shadow() | ||
.find('slot[name="untoggled"]') | ||
.should('exist'); | ||
|
||
cy.get('@button').click(); | ||
|
||
cy.get('@button').shadow().find('slot[name="toggled"]').should('exist'); | ||
}); | ||
|
||
it('should toggle state when pressing Enter key', () => { | ||
cy.get('post-togglebutton') | ||
.first() | ||
.as('button') | ||
.shadow() | ||
.find('slot[name="untoggled"]') | ||
.should('exist'); | ||
|
||
cy.get('@button').trigger('keydown', { key: 'Enter' }); | ||
|
||
cy.get('@button').shadow().find('slot[name="toggled"]').should('exist'); | ||
}); | ||
|
||
it('should have correct ARIA attributes', () => { | ||
cy.get('post-togglebutton') | ||
.first() | ||
.as('button') | ||
.should('have.attr', 'role', 'button') | ||
.and('have.attr', 'aria-pressed', 'false') | ||
.and('have.attr', 'tabindex', '0'); | ||
|
||
cy.get('@button').click(); | ||
|
||
cy.get('@button').should('have.attr', 'aria-pressed', 'true'); | ||
}); | ||
}); | ||
|
||
describe('initial state', () => { | ||
it('should respect initial toggled state', () => { | ||
cy.get('post-togglebutton[toggled]') | ||
.first() | ||
.as('toggledButton') | ||
.shadow() | ||
.find('slot[name="toggled"]') | ||
.should('exist'); | ||
|
||
cy.get('@toggledButton').should('have.attr', 'aria-pressed', 'true'); | ||
}); | ||
|
||
it('should respect untoggled state', () => { | ||
cy.get('post-togglebutton:not([toggled])') | ||
.first() | ||
.as('untoggledButton') | ||
.shadow() | ||
.find('slot[name="untoggled"]') | ||
.should('exist'); | ||
|
||
cy.get('@untoggledButton').should('have.attr', 'aria-pressed', 'false'); | ||
}); | ||
}); | ||
|
||
describe('slot content', () => { | ||
it('should display correct slot content based on toggle state', () => { | ||
cy.get('post-togglebutton').first().as('button'); | ||
|
||
cy.get('@button').shadow().find('slot[name="untoggled"]').should('exist'); | ||
|
||
cy.get('@button').click(); | ||
|
||
cy.get('@button').shadow().find('slot[name="toggled"]').should('exist'); | ||
|
||
cy.get('@button').click(); | ||
|
||
cy.get('@button').shadow().find('slot[name="untoggled"]').should('exist'); | ||
}); | ||
}); | ||
|
||
describe('version attribute', () => { | ||
it('should have the correct version data attribute', () => { | ||
cy.get('post-togglebutton').first().should('have.attr', 'data-version'); | ||
}); | ||
}); | ||
|
||
describe('Accessibility', () => { | ||
beforeEach(() => { | ||
cy.injectAxe(); | ||
}); | ||
|
||
it('Has no detectable a11y violations on load for all variants', () => { | ||
cy.checkA11y('#root-inner'); | ||
}); | ||
|
||
it('Should be keyboard navigable', () => { | ||
cy.get('post-togglebutton') | ||
.first() | ||
.focus() | ||
.should('have.focus') | ||
.trigger('keydown', { key: 'Enter' }) | ||
.should('have.attr', 'aria-pressed', 'true'); | ||
}); | ||
}); | ||
}); |
This file contains 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.