Skip to content

Commit

Permalink
Merge branch 'main' into 3433-component-sizing-utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
myrta2302 authored Dec 13, 2024
2 parents a00b695 + a3ce33d commit aabde77
Show file tree
Hide file tree
Showing 99 changed files with 2,365 additions and 348 deletions.
6 changes: 6 additions & 0 deletions .changeset/calm-rabbits-pull.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@swisspost/design-system-components': minor
'@swisspost/design-system-styles': minor
---

Added composable footer component.
5 changes: 5 additions & 0 deletions .changeset/gold-news-repair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-components': minor
---

Added the `post-megadropdown` component.
5 changes: 5 additions & 0 deletions .changeset/gorgeous-needles-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-components': patch
---

Added a fixed slot `post-list-item` on the `post-list-item` host element, so it is no longer necessary to add it manually.
5 changes: 5 additions & 0 deletions .changeset/heavy-eyes-live.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-components': patch
---

Fixed the used `headingLevel` in the `post-accorddion-item` component. The component now uses the value from its closest `post-accorddion` parent component, if this is specified and falls back to `h2` if not specified.
5 changes: 5 additions & 0 deletions .changeset/hungry-penguins-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-styles': patch
---

Fixed the `btn-icon` styles, so icons within can no longer be rendered too small, because of the inline-padding on the button.
5 changes: 5 additions & 0 deletions .changeset/nervous-lizards-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-styles': minor
---

Removed outdated portal-specific styles, including subnavigation-related rules.
5 changes: 5 additions & 0 deletions .changeset/new-cougars-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-components': minor
---

Added the parts `button` and `body` in the `post-accordion-item` component, so one can override styles from the outside.
5 changes: 5 additions & 0 deletions .changeset/nice-cycles-provide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-components': patch
---

Updated the `post-togglebutton` to function like a real button, including support for keyboard navigation and proper focus styles.
5 changes: 5 additions & 0 deletions .changeset/nine-baboons-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-styles': patch
---

Fixed the appstore-badge styles to get rid of the inline gap below.
5 changes: 5 additions & 0 deletions .changeset/old-spiders-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-styles': minor
---

Added the possibility to define a `$child-selector` parameter with our list mixins, so they can be used also with custom elements.
6 changes: 6 additions & 0 deletions .changeset/real-gorillas-behave.md
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-breadcrumb` component to provide a standalone breadcrumb navigation solution.
6 changes: 6 additions & 0 deletions .changeset/tender-laws-confess.md
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 css parts `button` and `body` in the `post-accorddion-item` component.
54 changes: 54 additions & 0 deletions packages/components/cypress/e2e/footer.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
const FOOTER_ID = 'd97528b3-a9ef-4201-bf28-9caf6e8997dc';

describe('Footer', () => {
describe('Structure & Props', () => {
beforeEach(() => {
cy.getComponent('footer', FOOTER_ID);
cy.get('@footer').find('> footer h2.visually-hidden').as('label');
});

it('should render', () => {
cy.get('@footer').should('exist');
});

it('should set label text according to "label" prop', () => {
cy.get('@label').should('have.text', 'Footer label');
});

it('should render the post-accorddion on mobile', () => {
cy.viewport('iphone-3');
cy.get('@footer').find('post-accorddion').as('accorddion');

cy.get('@accorddion').should('exist');
});

it('should have accorddion-items with slotted elements on mobile', () => {
cy.viewport('iphone-3');
cy.get('@footer').find('post-accorddion').as('accorddion');
cy.get('@accorddion').find('post-accordion-item').as('accordionItems');

cy.get('@accordionItems').should('have.length', 4);
cy.get('@accordionItems')
.find('slot[name="header"]')
.each($slot => {
const headerSlot = $slot.get(0) as HTMLSlotElement;

expect(headerSlot.assignedElements().length).to.be.greaterThan(0);
});
cy.get('@accordionItems')
.find('slot:not([name])')
.each($slot => {
const slotDefault = $slot.get(0) as HTMLSlotElement;

expect(slotDefault.assignedElements().length).to.be.greaterThan(0);
});
});
});

describe('Accessibility', () => {
it('Has no detectable a11y violations', () => {
cy.getSnapshots('footer');
cy.checkA11y('#root-inner');
});
});
});
8 changes: 4 additions & 4 deletions packages/components/src/animations/slide.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ const easing: string = 'ease';
const duration: number = 500;
const fill: FillMode = 'forwards';

export const slideUp = (el: HTMLElement, translateSize: string = '8rem'): Animation => {
export const slideUp = (el: HTMLElement, translateSize: string = '100%'): Animation => {
return el.animate(
[
{ transform: `translateY(-${translateSize})` }, // Starting position (no translation)
{ transform: `translateY(${translateSize})` }, // Starting position (no translation)
{ transform: 'translateY(0)' }, // End position
],
{
Expand All @@ -16,11 +16,11 @@ export const slideUp = (el: HTMLElement, translateSize: string = '8rem'): Animat
);
};

export const slideDown = (el: HTMLElement, translateSize: string = '8rem'): Animation => {
export const slideDown = (el: HTMLElement, translateSize: string = '100%'): Animation => {
return el.animate(
[
{ transform: 'translateY(0)' }, // Starting position (no translation)
{ transform: `translateY(-${translateSize})` }, // End position
{ transform: `translateY(${translateSize})` }, // End position
],
{
duration: duration,
Expand Down
Loading

0 comments on commit aabde77

Please sign in to comment.