diff --git a/.changeset/wise-tomatoes-brake.md b/.changeset/wise-tomatoes-brake.md new file mode 100644 index 0000000000..99014097fc --- /dev/null +++ b/.changeset/wise-tomatoes-brake.md @@ -0,0 +1,5 @@ +--- +'@swisspost/design-system-styles': patch +--- + +Updated the styles of the form validation messages to match the new Post design. diff --git a/packages/documentation/cypress/e2e/components/validation.cy.ts b/packages/documentation/cypress/e2e/components/validation.cy.ts new file mode 100644 index 0000000000..2130453f9c --- /dev/null +++ b/packages/documentation/cypress/e2e/components/validation.cy.ts @@ -0,0 +1,13 @@ +describe('Validation', () => { + describe('Accessibility', () => { + beforeEach(() => { + cy.visit('/iframe.html?id=snapshots--validation'); + cy.get('.snapshot', { timeout: 30000 }).should('be.visible'); + cy.injectAxe(); + }); + + it('Has no detectable a11y violations on load for all variants', () => { + cy.checkA11y('#root-inner'); + }); + }); +}); diff --git a/packages/documentation/cypress/snapshots/components/validation.snapshot.ts b/packages/documentation/cypress/snapshots/components/validation.snapshot.ts new file mode 100644 index 0000000000..c99cbb4f5d --- /dev/null +++ b/packages/documentation/cypress/snapshots/components/validation.snapshot.ts @@ -0,0 +1,7 @@ +describe('Validation', () => { + it('default', () => { + cy.visit('/iframe.html?id=snapshots--validation'); + cy.get('.snapshot', { timeout: 30000 }).should('be.visible'); + cy.percySnapshot('Validation', { widths: [1440] }); + }); +}); diff --git a/packages/documentation/src/shared/styles-package-import-individual.sample.ts b/packages/documentation/src/shared/styles-package-import-individual.sample.ts index 036c1ed60a..4a6b33bc82 100644 --- a/packages/documentation/src/shared/styles-package-import-individual.sample.ts +++ b/packages/documentation/src/shared/styles-package-import-individual.sample.ts @@ -6,7 +6,7 @@ interface Props { const requiredLabels: { [key: string]: string } = { 'icons': 'required if you use icons', 'floating-label': 'required if you use floating-labels', - 'form-feedback': 'required if you use validation feedbacks', + 'validation': 'required if you use validation feedbacks', }; export function getComponentStyleImports(props: Props) { diff --git a/packages/documentation/src/shared/styles-package-import.mdx b/packages/documentation/src/shared/styles-package-import.mdx index 02671c8a21..ff87878edf 100644 --- a/packages/documentation/src/shared/styles-package-import.mdx +++ b/packages/documentation/src/shared/styles-package-import.mdx @@ -4,20 +4,17 @@ import { getComponentStyleImports } from './styles-package-import-individual.sam ## Style Imports
- *Make sure the `@swisspost/design-system-styles` package is already present in your project - or follow the [installation guidelines](http://localhost:9000/?path=/docs/e53e2de8-0bbf-4f70-babc-074c5466f700--docs).* + + *Make sure the `@swisspost/design-system-styles` package is already present in your project or + follow the [installation + guidelines](http://localhost:9000/?path=/docs/e53e2de8-0bbf-4f70-babc-074c5466f700--docs).* +
To import all Design System styles: - + To import only the styles required for this component: - + diff --git a/packages/documentation/src/stories/components/card-control/standard-html/card-control.stories.ts b/packages/documentation/src/stories/components/card-control/standard-html/card-control.stories.ts index 62cc57640c..d46664d63c 100644 --- a/packages/documentation/src/stories/components/card-control/standard-html/card-control.stories.ts +++ b/packages/documentation/src/stories/components/card-control/standard-html/card-control.stories.ts @@ -95,7 +95,8 @@ const meta: MetaComponent = { }, validation: { name: 'Validation', - description: "Controls the display of the component's validation state.", + description: + 'Defines the validation state of the card control and controls the display of the corresponding return message.Please read our validation guidelines here. ', control: { type: 'radio', labels: { diff --git a/packages/documentation/src/stories/components/checkbox/checkbox.docs.mdx b/packages/documentation/src/stories/components/checkbox/checkbox.docs.mdx index b41fd25faa..4c113c35d3 100644 --- a/packages/documentation/src/stories/components/checkbox/checkbox.docs.mdx +++ b/packages/documentation/src/stories/components/checkbox/checkbox.docs.mdx @@ -24,7 +24,7 @@ Our checkboxes use custom icons to indicate checked or indeterminate states.