TODO:
diff --git a/packages/documentation-v7/src/stories/components/input-group/input-group.stories.ts b/packages/documentation-v7/src/stories/components/input-group/input-group.stories.ts
new file mode 100644
index 0000000000..b7d4b6dea9
--- /dev/null
+++ b/packages/documentation-v7/src/stories/components/input-group/input-group.stories.ts
@@ -0,0 +1,15 @@
+import { Meta, StoryObj } from '@storybook/web-components';
+import { BADGE } from '../../../../.storybook/constants';
+
+const meta: Meta = {
+ title: 'Components/Input Group',
+ parameters: {
+ badges: [BADGE.TODO],
+ },
+};
+
+export default meta;
+
+type Story = StoryObj;
+
+export const Default: Story = {};
diff --git a/packages/documentation-v7/src/stories/foundation/accessibility/accessibility.docs.mdx b/packages/documentation-v7/src/stories/foundation/accessibility/accessibility.docs.mdx
index b16a1af242..2c497d39fa 100644
--- a/packages/documentation-v7/src/stories/foundation/accessibility/accessibility.docs.mdx
+++ b/packages/documentation-v7/src/stories/foundation/accessibility/accessibility.docs.mdx
@@ -1,10 +1,7 @@
import { Meta } from '@storybook/blocks';
-import { BADGE } from '../../../../.storybook/constants';
+import * as AccessibilityStories from './accessibility.stories';
-
+
# Accessibility
diff --git a/packages/documentation-v7/src/stories/foundation/accessibility/accessibility.stories.ts b/packages/documentation-v7/src/stories/foundation/accessibility/accessibility.stories.ts
new file mode 100644
index 0000000000..edde30f568
--- /dev/null
+++ b/packages/documentation-v7/src/stories/foundation/accessibility/accessibility.stories.ts
@@ -0,0 +1,15 @@
+import { Meta, StoryObj } from '@storybook/web-components';
+import { BADGE } from '../../../../.storybook/constants';
+
+const meta: Meta = {
+ title: 'Foundations/Accessibility',
+ parameters: {
+ badges: [BADGE.TODO],
+ },
+};
+
+export default meta;
+
+type Story = StoryObj;
+
+export const Default: Story = {};
diff --git a/packages/documentation-v7/src/stories/foundation/color/color.docs.mdx b/packages/documentation-v7/src/stories/foundation/color/color.docs.mdx
index 6495c5a0a2..ba779620d9 100644
--- a/packages/documentation-v7/src/stories/foundation/color/color.docs.mdx
+++ b/packages/documentation-v7/src/stories/foundation/color/color.docs.mdx
@@ -1,11 +1,11 @@
import { Meta } from '@storybook/blocks';
import LinkTo from '@storybook/addon-links/react';
-import { BADGE } from '../../../../.storybook/constants';
import { forEach } from '../../../utils/react';
+import * as ColorStories from './color.stories';
import { ColorSwatch, SCSS_VARIABLES } from './color.blocks';
import './color.styles.scss';
-
+
# Color
diff --git a/packages/documentation-v7/src/stories/foundation/color/color.stories.ts b/packages/documentation-v7/src/stories/foundation/color/color.stories.ts
new file mode 100644
index 0000000000..a0a4cb44a6
--- /dev/null
+++ b/packages/documentation-v7/src/stories/foundation/color/color.stories.ts
@@ -0,0 +1,15 @@
+import { Meta, StoryObj } from '@storybook/web-components';
+import { BADGE } from '../../../../.storybook/constants';
+
+const meta: Meta = {
+ title: 'Foundations/Color',
+ parameters: {
+ badges: [BADGE.BETA, BADGE.NEEDS_REVISION],
+ },
+};
+
+export default meta;
+
+type Story = StoryObj;
+
+export const Default: Story = {};
diff --git a/packages/documentation-v7/src/stories/foundation/layout/breakpoints/breakpoints.docs.mdx b/packages/documentation-v7/src/stories/foundation/layout/breakpoints/breakpoints.docs.mdx
index 80f3f15657..305a31f393 100644
--- a/packages/documentation-v7/src/stories/foundation/layout/breakpoints/breakpoints.docs.mdx
+++ b/packages/documentation-v7/src/stories/foundation/layout/breakpoints/breakpoints.docs.mdx
@@ -1,8 +1,8 @@
-import { Meta, Story } from '@storybook/blocks';
-import { BADGE } from '../../../../../.storybook/constants';
+import { Meta } from '@storybook/blocks';
import { BreakpointTable, SCSS_VARIABLES } from './breakpoints.blocks';
+import * as BreakpointStories from './breakpoints.stories';
-
+
# Breakpoints
diff --git a/packages/documentation-v7/src/stories/foundation/layout/breakpoints/breakpoints.stories.ts b/packages/documentation-v7/src/stories/foundation/layout/breakpoints/breakpoints.stories.ts
new file mode 100644
index 0000000000..8aa74e4e5d
--- /dev/null
+++ b/packages/documentation-v7/src/stories/foundation/layout/breakpoints/breakpoints.stories.ts
@@ -0,0 +1,15 @@
+import { Meta, StoryObj } from '@storybook/web-components';
+import { BADGE } from '../../../../../.storybook/constants';
+
+const meta: Meta = {
+ title: 'Foundations/Layout/Breakpoints',
+ parameters: {
+ badges: [BADGE.NEEDS_REVISION],
+ },
+};
+
+export default meta;
+
+type Story = StoryObj;
+
+export const Default: Story = {};
diff --git a/packages/documentation-v7/src/stories/foundation/layout/layout.docs.mdx b/packages/documentation-v7/src/stories/foundation/layout/layout.docs.mdx
index 14772f6661..9b7fe06fa4 100644
--- a/packages/documentation-v7/src/stories/foundation/layout/layout.docs.mdx
+++ b/packages/documentation-v7/src/stories/foundation/layout/layout.docs.mdx
@@ -1,7 +1,7 @@
import { Meta } from '@storybook/blocks';
-import { BADGE } from '../../../../.storybook/constants';
+import * as LayoutStories from './layout.stories';
-
+
# Layout
diff --git a/packages/documentation-v7/src/stories/foundation/layout/layout.stories.ts b/packages/documentation-v7/src/stories/foundation/layout/layout.stories.ts
new file mode 100644
index 0000000000..9a2772e835
--- /dev/null
+++ b/packages/documentation-v7/src/stories/foundation/layout/layout.stories.ts
@@ -0,0 +1,15 @@
+import { Meta, StoryObj } from '@storybook/web-components';
+import { BADGE } from '../../../../.storybook/constants';
+
+const meta: Meta = {
+ title: 'Foundations/Layout/TODOS',
+ parameters: {
+ badges: [BADGE.TODO],
+ },
+};
+
+export default meta;
+
+type Story = StoryObj;
+
+export const Default: Story = {};
diff --git a/packages/documentation-v7/src/stories/foundation/typography/typography.docs.mdx b/packages/documentation-v7/src/stories/foundation/typography/typography.docs.mdx
index 8f5f218e4e..7a1b0ea272 100644
--- a/packages/documentation-v7/src/stories/foundation/typography/typography.docs.mdx
+++ b/packages/documentation-v7/src/stories/foundation/typography/typography.docs.mdx
@@ -1,6 +1,6 @@
import { Meta } from '@storybook/blocks';
import LinkTo from '@storybook/addon-links/react';
-import { BADGE } from '../../../../.storybook/constants';
+import * as TypographyStories from './typography.stories';
import {
FontFaceWrapper,
FontFace,
@@ -14,10 +14,7 @@ import {
} from './typography.blocks';
import './typography.styles.scss';
-
+
# Typography
diff --git a/packages/documentation-v7/src/stories/foundation/typography/typography.stories.ts b/packages/documentation-v7/src/stories/foundation/typography/typography.stories.ts
new file mode 100644
index 0000000000..9c9c77a13b
--- /dev/null
+++ b/packages/documentation-v7/src/stories/foundation/typography/typography.stories.ts
@@ -0,0 +1,15 @@
+import { Meta, StoryObj } from '@storybook/web-components';
+import { BADGE } from '../../../../.storybook/constants';
+
+const meta: Meta = {
+ title: 'Foundations/Typography',
+ parameters: {
+ badges: [BADGE.BETA, BADGE.NEEDS_REVISION],
+ },
+};
+
+export default meta;
+
+type Story = StoryObj;
+
+export const Default: Story = {};
diff --git a/packages/documentation-v7/src/stories/getting-started/components.docs.mdx b/packages/documentation-v7/src/stories/getting-started/components/components.docs.mdx
similarity index 88%
rename from packages/documentation-v7/src/stories/getting-started/components.docs.mdx
rename to packages/documentation-v7/src/stories/getting-started/components/components.docs.mdx
index 4656331e49..70ff0f8534 100644
--- a/packages/documentation-v7/src/stories/getting-started/components.docs.mdx
+++ b/packages/documentation-v7/src/stories/getting-started/components/components.docs.mdx
@@ -1,10 +1,7 @@
import { Meta } from '@storybook/blocks';
-import { BADGE } from '../../../.storybook/constants';
+import * as GettingStartedStories from './components.stories';
-
+
# @swisspost/design-system-components
diff --git a/packages/documentation-v7/src/stories/getting-started/components/components.stories.ts b/packages/documentation-v7/src/stories/getting-started/components/components.stories.ts
new file mode 100644
index 0000000000..cacee53bdd
--- /dev/null
+++ b/packages/documentation-v7/src/stories/getting-started/components/components.stories.ts
@@ -0,0 +1,15 @@
+import { Meta, StoryObj } from '@storybook/web-components';
+import { BADGE } from '../../../../.storybook/constants';
+
+const meta: Meta = {
+ title: 'Getting Started/Components',
+ parameters: {
+ badges: [BADGE.NEEDS_REVISION],
+ },
+};
+
+export default meta;
+
+type Story = StoryObj;
+
+export const Default: Story = {};
diff --git a/packages/documentation-v7/src/stories/getting-started/styles.docs.mdx b/packages/documentation-v7/src/stories/getting-started/styles/styles.docs.mdx
similarity index 92%
rename from packages/documentation-v7/src/stories/getting-started/styles.docs.mdx
rename to packages/documentation-v7/src/stories/getting-started/styles/styles.docs.mdx
index a3adcfe2c9..1d1e0c28f5 100644
--- a/packages/documentation-v7/src/stories/getting-started/styles.docs.mdx
+++ b/packages/documentation-v7/src/stories/getting-started/styles/styles.docs.mdx
@@ -1,10 +1,7 @@
import { Meta } from '@storybook/blocks';
-import { BADGE } from '../../../.storybook/constants';
+import * as GettingStartedStories from './styles.stories';
-
+
# @swisspost/design-system-styles
diff --git a/packages/documentation-v7/src/stories/getting-started/styles/styles.stories.ts b/packages/documentation-v7/src/stories/getting-started/styles/styles.stories.ts
new file mode 100644
index 0000000000..27b5d70775
--- /dev/null
+++ b/packages/documentation-v7/src/stories/getting-started/styles/styles.stories.ts
@@ -0,0 +1,15 @@
+import { Meta, StoryObj } from '@storybook/web-components';
+import { BADGE } from '../../../../.storybook/constants';
+
+const meta: Meta = {
+ title: 'Getting Started/Styles',
+ parameters: {
+ badges: [BADGE.NEEDS_REVISION],
+ },
+};
+
+export default meta;
+
+type Story = StoryObj;
+
+export const Default: Story = {};
diff --git a/packages/documentation-v7/src/stories/icons/getting-started.docs.mdx b/packages/documentation-v7/src/stories/icons/getting-started.docs.mdx
index c7edf79130..c9c1338311 100644
--- a/packages/documentation-v7/src/stories/icons/getting-started.docs.mdx
+++ b/packages/documentation-v7/src/stories/icons/getting-started.docs.mdx
@@ -1,8 +1,8 @@
import { Meta } from '@storybook/blocks';
import LinkTo from '@storybook/addon-links/react';
-import { BADGE } from '../../../.storybook/constants';
+import * as GettingStartedStories from './getting-started.stories';
-
+
# @swisspost/design-system-icons
diff --git a/packages/documentation-v7/src/stories/icons/getting-started.stories.ts b/packages/documentation-v7/src/stories/icons/getting-started.stories.ts
new file mode 100644
index 0000000000..fae506833f
--- /dev/null
+++ b/packages/documentation-v7/src/stories/icons/getting-started.stories.ts
@@ -0,0 +1,15 @@
+import { Meta, StoryObj } from '@storybook/web-components';
+import { BADGE } from '../../../.storybook/constants';
+
+const meta: Meta = {
+ title: 'Icons/Getting started',
+ parameters: {
+ badges: [BADGE.NEEDS_REVISION],
+ },
+};
+
+export default meta;
+
+type Story = StoryObj;
+
+export const Default: Story = {};
diff --git a/packages/documentation-v7/src/stories/misc/changelog.docs.mdx b/packages/documentation-v7/src/stories/misc/changelog/changelog.docs.mdx
similarity index 51%
rename from packages/documentation-v7/src/stories/misc/changelog.docs.mdx
rename to packages/documentation-v7/src/stories/misc/changelog/changelog.docs.mdx
index 1c35b4b1c9..f6a49b5ef8 100644
--- a/packages/documentation-v7/src/stories/misc/changelog.docs.mdx
+++ b/packages/documentation-v7/src/stories/misc/changelog/changelog.docs.mdx
@@ -1,8 +1,8 @@
import { Markdown, Meta } from '@storybook/blocks';
-import changelog from '../../../../styles/CHANGELOG.md?raw';
+import changelog from '../../../../../styles/CHANGELOG.md?raw';
{changelog}
diff --git a/packages/documentation-v7/src/stories/misc/migration-guide.docs.mdx b/packages/documentation-v7/src/stories/misc/migration-guide/migration-guide.docs.mdx
similarity index 69%
rename from packages/documentation-v7/src/stories/misc/migration-guide.docs.mdx
rename to packages/documentation-v7/src/stories/misc/migration-guide/migration-guide.docs.mdx
index 56c956f56c..efc1708f90 100644
--- a/packages/documentation-v7/src/stories/misc/migration-guide.docs.mdx
+++ b/packages/documentation-v7/src/stories/misc/migration-guide/migration-guide.docs.mdx
@@ -1,7 +1,7 @@
import { Meta } from '@storybook/blocks';
-import { BADGE } from '../../../.storybook/constants';
+import * as MigrationGuideStories from './migration-guide.stories';
-
+
+
# Versions
diff --git a/packages/documentation-v7/src/stories/misc/versions/versions.stories.ts b/packages/documentation-v7/src/stories/misc/versions/versions.stories.ts
new file mode 100644
index 0000000000..8c363ab619
--- /dev/null
+++ b/packages/documentation-v7/src/stories/misc/versions/versions.stories.ts
@@ -0,0 +1,15 @@
+import { Meta, StoryObj } from '@storybook/web-components';
+import { BADGE } from '../../../../.storybook/constants';
+
+const meta: Meta = {
+ title: 'Misc/Versions',
+ parameters: {
+ badges: [BADGE.NEEDS_REVISION],
+ },
+};
+
+export default meta;
+
+type Story = StoryObj;
+
+export const Default: Story = {};
diff --git a/packages/documentation-v7/src/stories/templates/forms/forms.docs.mdx b/packages/documentation-v7/src/stories/templates/forms/forms.docs.mdx
index 2b8555ec43..5d132bee99 100644
--- a/packages/documentation-v7/src/stories/templates/forms/forms.docs.mdx
+++ b/packages/documentation-v7/src/stories/templates/forms/forms.docs.mdx
@@ -1,7 +1,7 @@
import { Meta } from '@storybook/blocks';
-import { BADGE } from '../../../../.storybook/constants';
+import * as FormTemplateStories from './forms.stories';
-
+
# Forms
diff --git a/packages/documentation-v7/src/stories/templates/forms/forms.stories.ts b/packages/documentation-v7/src/stories/templates/forms/forms.stories.ts
new file mode 100644
index 0000000000..86b4cff338
--- /dev/null
+++ b/packages/documentation-v7/src/stories/templates/forms/forms.stories.ts
@@ -0,0 +1,15 @@
+import { Meta, StoryObj } from '@storybook/web-components';
+import { BADGE } from '../../../../.storybook/constants';
+
+const meta: Meta = {
+ title: 'Templates/Forms',
+ parameters: {
+ badges: [BADGE.TODO],
+ },
+};
+
+export default meta;
+
+type Story = StoryObj;
+
+export const Default: Story = {};
diff --git a/packages/documentation-v7/src/stories/utilities/common/common.docs.mdx b/packages/documentation-v7/src/stories/utilities/common/common.docs.mdx
index 9e61e9897e..4e2944fd25 100644
--- a/packages/documentation-v7/src/stories/utilities/common/common.docs.mdx
+++ b/packages/documentation-v7/src/stories/utilities/common/common.docs.mdx
@@ -1,10 +1,7 @@
import { Meta } from '@storybook/blocks';
-import { BADGE } from '../../../../.storybook/constants';
+import * as CommonStories from './common.stories';
-
+
# Common Utilities & Helper
diff --git a/packages/documentation-v7/src/stories/utilities/common/common.stories.ts b/packages/documentation-v7/src/stories/utilities/common/common.stories.ts
new file mode 100644
index 0000000000..921f593fff
--- /dev/null
+++ b/packages/documentation-v7/src/stories/utilities/common/common.stories.ts
@@ -0,0 +1,15 @@
+import { Meta, StoryObj } from '@storybook/web-components';
+import { BADGE } from '../../../../.storybook/constants';
+
+const meta: Meta = {
+ title: 'Utilities/Common',
+ parameters: {
+ badges: [BADGE.TODO],
+ },
+};
+
+export default meta;
+
+type Story = StoryObj;
+
+export const Default: Story = {};
diff --git a/packages/documentation-v7/src/stories/utilities/sizing/sizing.docs.mdx b/packages/documentation-v7/src/stories/utilities/sizing/sizing.docs.mdx
index b0521f78c1..e8d8957d2f 100644
--- a/packages/documentation-v7/src/stories/utilities/sizing/sizing.docs.mdx
+++ b/packages/documentation-v7/src/stories/utilities/sizing/sizing.docs.mdx
@@ -1,10 +1,7 @@
import { Meta } from '@storybook/blocks';
-import { BADGE } from '../../../../.storybook/constants';
+import * as SizingStories from './sizing.stories';
-
+
# Sizing
diff --git a/packages/documentation-v7/src/stories/utilities/sizing/sizing.stories.ts b/packages/documentation-v7/src/stories/utilities/sizing/sizing.stories.ts
new file mode 100644
index 0000000000..6042d3bb33
--- /dev/null
+++ b/packages/documentation-v7/src/stories/utilities/sizing/sizing.stories.ts
@@ -0,0 +1,15 @@
+import { Meta, StoryObj } from '@storybook/web-components';
+import { BADGE } from '../../../../.storybook/constants';
+
+const meta: Meta = {
+ title: 'Utilities/Sizing',
+ parameters: {
+ badges: [BADGE.TODO],
+ },
+};
+
+export default meta;
+
+type Story = StoryObj;
+
+export const Default: Story = {};
diff --git a/packages/documentation-v7/src/stories/utilities/spacing/spacing.docs.mdx b/packages/documentation-v7/src/stories/utilities/spacing/spacing.docs.mdx
index 1a954654ec..2a9a436b78 100644
--- a/packages/documentation-v7/src/stories/utilities/spacing/spacing.docs.mdx
+++ b/packages/documentation-v7/src/stories/utilities/spacing/spacing.docs.mdx
@@ -1,10 +1,7 @@
import { Meta } from '@storybook/blocks';
-import { BADGE } from '../../../../.storybook/constants';
+import * as SpacingStories from './spacing.stories';
-
+
# Spacing
diff --git a/packages/documentation-v7/src/stories/utilities/spacing/spacing.stories.ts b/packages/documentation-v7/src/stories/utilities/spacing/spacing.stories.ts
new file mode 100644
index 0000000000..aff9081581
--- /dev/null
+++ b/packages/documentation-v7/src/stories/utilities/spacing/spacing.stories.ts
@@ -0,0 +1,15 @@
+import { Meta, StoryObj } from '@storybook/web-components';
+import { BADGE } from '../../../../.storybook/constants';
+
+const meta: Meta = {
+ title: 'Utilities/Spacing',
+ parameters: {
+ badges: [BADGE.TODO],
+ },
+};
+
+export default meta;
+
+type Story = StoryObj;
+
+export const Default: Story = {};
From b21d78b778ecfbbdfe49e2f7011169dd9f087f65 Mon Sep 17 00:00:00 2001
From: Lukas Blaser <141234680+b1aserlu@users.noreply.github.com>
Date: Thu, 17 Aug 2023 09:07:04 +0200
Subject: [PATCH 08/16] feat(documentation-v7): migrate button-group component
(#1813)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Alizé Debray <33580481+alizedebray@users.noreply.github.com>
Co-authored-by: Loïc Fürhoff <12294151+imagoiq@users.noreply.github.com>
---
.../button-group/button-group.docs.mdx | 51 ++++
.../button-group/button-group.stories.ts | 247 ++++++++++++++++++
2 files changed, 298 insertions(+)
create mode 100644 packages/documentation-v7/src/stories/components/button-group/button-group.docs.mdx
create mode 100644 packages/documentation-v7/src/stories/components/button-group/button-group.stories.ts
diff --git a/packages/documentation-v7/src/stories/components/button-group/button-group.docs.mdx b/packages/documentation-v7/src/stories/components/button-group/button-group.docs.mdx
new file mode 100644
index 0000000000..fce158e002
--- /dev/null
+++ b/packages/documentation-v7/src/stories/components/button-group/button-group.docs.mdx
@@ -0,0 +1,51 @@
+import { Canvas, Controls, Meta } from '@storybook/blocks';
+import * as ButtonGroupStories from './button-group.stories';
+
+
+
+# Button Group
+
+
+ Group a series of buttons together on a single line.
+
+
+
+
+
+
+
+## SCSS Imports
+
+To import all styles from the design-system-styles package:
+
+```scss
+@use '@swisspost/design-system-styles/index.scss';
+```
+
+To import only the styles required for this component:
+
+```scss
+@use '@swisspost/design-system-styles/basics.scss';
+@use '@swisspost/design-system-styles/components/badge.scss';
+```
+
+## Concrete Examples of Application
+
+The following examples show the different characteristics of the component. These can differ in the type of visualization, the html structure, as well as when, how and why they are displayed.
+
+### Sizing
+
+You can change the size of buttons belonging to a group using button-sizing classes: `.btn-sm`, `.btn-rg` and `.btn-lg`.
+Just be sure to apply the same class to all buttons contained in the group.
+
+
+
+### Checkbox & Radio
+
+Any HTML element that can be styled as a button can potentially be used in a button group.
+It is also possible to use checkable inputs:
+
+- Checkboxes: this allows all buttons in the group to be selected or deselected individually,
+- Radio buttons: in this case all the buttons are linked and only one of them can be selected at a time.
+
+
diff --git a/packages/documentation-v7/src/stories/components/button-group/button-group.stories.ts b/packages/documentation-v7/src/stories/components/button-group/button-group.stories.ts
new file mode 100644
index 0000000000..6d46cefbcc
--- /dev/null
+++ b/packages/documentation-v7/src/stories/components/button-group/button-group.stories.ts
@@ -0,0 +1,247 @@
+import type { Args, Meta, StoryContext, StoryObj } from '@storybook/web-components';
+import { html } from 'lit';
+import { useArgs } from '@storybook/preview-api';
+import { BADGE } from '../../../../.storybook/constants';
+
+const meta: Meta = {
+ title: 'Components/Button Group',
+ render: renderButtonGroup,
+ parameters: {
+ badges: [BADGE.NEEDS_REVISION],
+ },
+ args: {
+ size: 'btn-md',
+ element: 'button',
+ label_1: 'Left',
+ label_2: 'Middle',
+ label_3: 'Right',
+ },
+ argTypes: {
+ size: {
+ name: 'Size',
+ description: 'Sets the size of the button group.',
+ control: {
+ type: 'select',
+ labels: {
+ ' btn-sm': 'Small',
+ ' btn-rg': 'Regular',
+ ' btn-md': 'Medium',
+ ' btn-lg': 'Large',
+ },
+ },
+ options: [' btn-sm', ' btn-rg', ' btn-md', ' btn-lg'],
+ table: {
+ category: 'General',
+ },
+ },
+ element: {
+ name: 'Variant',
+ description: 'Defined the semantic elements used as button within the group.',
+ control: {
+ type: 'radio',
+ labels: {
+ button: 'Buttons',
+ link: 'Links',
+ checkbox: 'Checkboxes',
+ radio: 'Radio Buttons',
+ },
+ },
+ options: ['button', 'link', 'checkbox', 'radio'],
+ table: {
+ category: 'General',
+ },
+ },
+ label_1: {
+ name: 'First Label',
+ description: 'Defines the label of the first button.',
+ control: {
+ type: 'text',
+ },
+ table: {
+ category: 'Content',
+ },
+ },
+ label_2: {
+ name: 'Second Label',
+ description: 'Defines the label of the second button.',
+ control: {
+ type: 'text',
+ },
+ table: {
+ category: 'Content',
+ },
+ },
+ label_3: {
+ name: 'Third Label',
+ description: 'Defines the label of the third button.',
+ control: {
+ type: 'text',
+ },
+ table: {
+ category: 'Content',
+ },
+ },
+ checked: {
+ name: 'Checked Button',
+ description: 'Defined which button is checked in a radio button group.',
+ if: {
+ arg: 'element',
+ eq: 'radio',
+ },
+ control: {
+ type: 'inline-radio',
+ labels: {
+ 1: 'First',
+ 2: 'Second',
+ 3: 'Third',
+ },
+ },
+ options: [1, 2, 3],
+ table: {
+ category: 'Value',
+ },
+ },
+ selected: {
+ name: 'Selected Button',
+ description: 'Defined which button is selected in a checkbox group.',
+ if: {
+ arg: 'element',
+ eq: 'checkbox',
+ },
+ control: {
+ type: 'inline-check',
+ labels: {
+ 1: 'First',
+ 2: 'Second',
+ 3: 'Third',
+ },
+ },
+ options: [1, 2, 3],
+ table: {
+ category: 'Value',
+ },
+ },
+ },
+ decorators: [
+ story =>
+ html`
+
{
+ const target = e.target as HTMLElement;
+ if (target.tagName === 'A' || target.tagName === 'BUTTON') e.preventDefault();
+ }}
+ >
+ ${story()}
+
+ `,
+ ],
+};
+
+export default meta;
+
+type Story = StoryObj;
+
+function createButtonTemplate(args: Args, context: StoryContext, index: number) {
+ const [_, updateArgs] = useArgs();
+ const position = index + 1;
+ const id = `btngroup${context.name}_${position}`;
+ const label = args[`label_${position}`];
+
+ switch (args.element) {
+ case 'checkbox': {
+ const isSelected = args.selected?.includes(position) ?? false;
+ return html`
+
{
+ let isChecked = [];
+ if ((e.target as HTMLInputElement).checked === true) {
+ if (args.selected) {
+ isChecked = Array.from(new Set(args.selected.concat(position)));
+ } else {
+ isChecked = [position];
+ }
+ } else {
+ isChecked = args.selected.filter((p: number) => p !== position);
+ }
+ updateArgs({ selected: isChecked });
+ }}
+ />
+
${label}
+ `;
+ }
+ case 'radio': {
+ const isChecked = position === args.checked;
+ return html`
+
{
+ updateArgs({ checked: position });
+ }}
+ />
+
${label}
+ `;
+ }
+ case 'link':
+ return html`
+
${label}
+ `;
+ case 'button':
+ default:
+ return html`
+
${label}
+ `;
+ }
+}
+
+function renderButtonGroup(args: Args, context: StoryContext) {
+ return html`
+
+ ${Array.from({ length: 3 }).map((_, i) => createButtonTemplate(args, context, i))}
+
+ `;
+}
+
+export const Default: Story = {};
+
+export const Sizing: Story = {
+ parameters: {
+ controls: {
+ exclude: [
+ 'Variant',
+ 'First Label',
+ 'Second Label',
+ 'Third Label',
+ 'Checked Button',
+ 'Selected Button',
+ ],
+ },
+ },
+ args: {
+ size: ' btn-sm',
+ },
+};
+
+export const Checks: Story = {
+ parameters: {
+ controls: {
+ exclude: ['Size', 'First Label', 'Second Label', 'Third Label'],
+ },
+ },
+ args: {
+ element: 'checkbox',
+ selected: [1, 3],
+ checked: 2,
+ },
+};
From 51fea651a4648d5c32fe625c273c5d11664b0fe9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Oliver=20Sch=C3=BCrch?=
Date: Thu, 17 Aug 2023 11:01:10 +0200
Subject: [PATCH 09/16] fix(documentation-v7): overwrite hcm styles for
.innerZoomElementWrapper border-color (#1810)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Loïc Fürhoff <12294151+imagoiq@users.noreply.github.com>
---
packages/documentation-v7/.storybook/styles/preview.scss | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/packages/documentation-v7/.storybook/styles/preview.scss b/packages/documentation-v7/.storybook/styles/preview.scss
index b9833d7170..812bbd111a 100644
--- a/packages/documentation-v7/.storybook/styles/preview.scss
+++ b/packages/documentation-v7/.storybook/styles/preview.scss
@@ -148,4 +148,12 @@
}
}
}
+
+ @include post.high-contrast-mode() {
+ .innerZoomElementWrapper {
+ > * {
+ border-color: Canvas !important;
+ }
+ }
+ }
}
From eef429a659839850298fc49ebfc121a8d4354703 Mon Sep 17 00:00:00 2001
From: David Ritter <141235163+davidritter-dotcom@users.noreply.github.com>
Date: Thu, 17 Aug 2023 11:01:32 +0200
Subject: [PATCH 10/16] feat(documentation-v7): migrate the switch component
(#1800)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Loïc Fürhoff <12294151+imagoiq@users.noreply.github.com>
Co-authored-by: Oliver Schürch
Co-authored-by: Philipp Gfeller <1659006+gfellerph@users.noreply.github.com>
---
.../stories/components/switch/switch.docs.mdx | 55 +++++
.../components/switch/switch.stories.ts | 227 ++++++++++++++++++
2 files changed, 282 insertions(+)
create mode 100644 packages/documentation-v7/src/stories/components/switch/switch.docs.mdx
create mode 100644 packages/documentation-v7/src/stories/components/switch/switch.stories.ts
diff --git a/packages/documentation-v7/src/stories/components/switch/switch.docs.mdx b/packages/documentation-v7/src/stories/components/switch/switch.docs.mdx
new file mode 100644
index 0000000000..da53f79512
--- /dev/null
+++ b/packages/documentation-v7/src/stories/components/switch/switch.docs.mdx
@@ -0,0 +1,55 @@
+import { Meta, Canvas, Controls } from '@storybook/blocks';
+import * as switchStories from './switch.stories';
+
+
+
+# Switch
+
+
+ A switch has the markup of a custom <input type="checkbox"/>
but uses the{' '}
+ .form-switch
class to render a toggle switch.
+
+
+Consider using `role="switch"` to more accurately convey the nature of the control to assistive technologies that support this role. In older assistive technologies, it will simply be announced as a regular `checkbox` as a fallback. Switches also support the `disabled` attribute.
+
+
+
+
+
+
+## SCSS Imports
+
+To import all styles from the design-system-styles package:
+
+```scss
+@use '@swisspost/design-system-styles/index.scss';
+```
+
+To import only the styles required for this component:
+
+```scss
+@use '@swisspost/design-system-styles/basics.scss';
+@use '@swisspost/design-system-styles/components/form-check.scss';
+
+// required if you use validation feedbacks
+@use '@swisspost/design-system-styles/components/form-feedback.scss';
+```
+
+## Concrete Examples of Application
+
+The following examples show the different characteristics of the component. These can differ in the type of visualization, the HTML structure, as well as when, how and why they are displayed.
+
+### Multiline Labels
+
+Long labels can be used seamlessly and are automatically wrapped at the end of the line.
+You can also include inline elements into the label, such as ``, ``, etc.
+However, make sure to always place multiline labels after the `checkbox`.
+
+
+
+### Validation
+
+Simply add the classes `.is-valid` or `.is-invalid` to the `switch` element to show it in the expected state.
+When the component has been validated, don't forget to add a `...
` or `...
` element after the `switch` element to explain what went wrong. This enables the user to correct the mistake.
+
+
diff --git a/packages/documentation-v7/src/stories/components/switch/switch.stories.ts b/packages/documentation-v7/src/stories/components/switch/switch.stories.ts
new file mode 100644
index 0000000000..b5ea58b469
--- /dev/null
+++ b/packages/documentation-v7/src/stories/components/switch/switch.stories.ts
@@ -0,0 +1,227 @@
+import { useArgs } from '@storybook/preview-api';
+import type { Args, Meta, StoryContext, StoryObj } from '@storybook/web-components';
+import { html, nothing } from 'lit';
+import { ifDefined } from 'lit/directives/if-defined.js';
+import { BADGE } from '../../../../.storybook/constants';
+import { mapClasses } from '../../../utils';
+
+const meta: Meta = {
+ title: 'Components/Switch',
+ render: renderSwitch,
+ parameters: {
+ badges: [BADGE.NEEDS_REVISION],
+ },
+ args: {
+ labelPosition: 'both',
+ labelBefore: 'Off',
+ labelAfter: 'On',
+ hiddenLabel: false,
+ checked: false,
+ disabled: false,
+ validation: 'null',
+ },
+ argTypes: {
+ labelPosition: {
+ name: 'Label Position',
+ description: 'The position of the component label.',
+ control: {
+ type: 'radio',
+ label: {
+ both: 'Both',
+ before: 'Before',
+ after: 'After',
+ },
+ },
+ options: ['both', 'before', 'after'],
+ table: {
+ category: 'General',
+ },
+ },
+ labelBefore: {
+ name: 'Label (before)',
+ description: 'Describes the content/topic of the component.',
+ if: {
+ arg: 'labelPosition',
+ neq: 'after',
+ },
+ control: {
+ type: 'text',
+ },
+ table: {
+ category: 'General',
+ },
+ },
+ labelAfter: {
+ name: 'Label (after)',
+ description: 'Describes the content/topic of the component.',
+ if: {
+ arg: 'labelPosition',
+ neq: 'before',
+ },
+ control: {
+ type: 'text',
+ },
+ table: {
+ category: 'General',
+ },
+ },
+ hiddenLabel: {
+ name: 'Hidden Label',
+ description:
+ 'Renders the component with or without a visible label.There are accessibility concerns with hidden labels. Please read our label accessibility guide . ',
+ control: {
+ type: 'boolean',
+ },
+ table: {
+ category: 'General',
+ },
+ },
+ checked: {
+ name: 'Checked',
+ description: 'When set to `true`, places the component in the checked state.',
+ control: {
+ type: 'boolean',
+ },
+ table: {
+ category: 'States',
+ },
+ },
+ disabled: {
+ name: 'Disabled',
+ description:
+ 'When set to `true`, disables the component\'s functionality and places it in a disabled state.There are accessibility concerns with the disabled state. Please read our disabled state accessibility guide . ',
+ control: {
+ type: 'boolean',
+ },
+ table: {
+ category: 'States',
+ },
+ },
+ validation: {
+ name: 'Validation',
+ description: "Controls the display of the component's validation state.",
+ control: {
+ type: 'radio',
+ labels: {
+ 'null': 'Default',
+ 'is-valid': 'Valid',
+ 'is-invalid': 'Invalid',
+ },
+ },
+ options: ['null', 'is-valid', 'is-invalid'],
+ table: {
+ category: 'States',
+ },
+ },
+ },
+ decorators: [
+ story =>
+ html`
+ ${story()}
+ `,
+ ],
+};
+
+export default meta;
+
+const VALIDATION_STATE_MAP: Record = {
+ 'null': undefined,
+ 'is-valid': false,
+ 'is-invalid': true,
+};
+
+function renderSwitch(args: Args, context: StoryContext) {
+ const [_, updateArgs] = useArgs();
+
+ const switchClasses = mapClasses({
+ 'form-check-input': true,
+ [args.validation]: args.validation !== 'null',
+ });
+
+ const useAriaLabel = args.hiddenLabel;
+ const ariaLabel = args.checked ? args.labelAfter : args.labelBefore;
+ const useLabelBefore = !useAriaLabel && ['before', 'both'].includes(args.labelPosition);
+ const useLabelAfter = !useAriaLabel && ['after', 'both'].includes(args.labelPosition);
+
+ const labelBefore = useLabelBefore
+ ? html`
+ ${args.labelBefore}
+ `
+ : null;
+
+ const labelAfter = useLabelAfter
+ ? html`
+ ${args.labelAfter}
+ `
+ : null;
+
+ const validationText = args.validation === 'is-valid' ? 'Ggranda sukceso!' : 'Eraro okazis!';
+ const validationFeedback =
+ args.validation !== 'null'
+ ? html`
+
+ ${validationText}
+
+ `
+ : null;
+
+ return html`
+
+ updateArgs({ checked: !args.checked })}
+ />
+ ${labelBefore} ${labelAfter} ${args.validation !== 'null' ? validationFeedback : nothing}
+
+ `;
+}
+
+type Story = StoryObj;
+
+export const Default: Story = {};
+
+export const MultilineLabels: Story = {
+ parameters: {
+ controls: {
+ exclude: [
+ 'Label Position',
+ 'Label (before)',
+ 'Hidden Label',
+ 'Checked',
+ 'Disabled',
+ 'Validation',
+ ],
+ },
+ },
+ args: {
+ labelPosition: 'after',
+ labelAfter:
+ 'Longa etikedo kiu plej versajne ne taugas sur unu linio kaj tial devas esti envolvita. Kaj nur por esti sur la sekura flanko, ni simple aldonu unu plian tre sencelan frazon ci tie. Vi neniam scias...',
+ },
+};
+
+export const Validation: Story = {
+ parameters: {
+ controls: {
+ exclude: [
+ 'Label Position',
+ 'Label (before)',
+ 'Label (after)',
+ 'Hidden Label',
+ 'Checked',
+ 'Disabled',
+ ],
+ },
+ },
+ args: {
+ validation: 'is-invalid',
+ },
+};
From 5218715391d9bb90053fb76907538f224a00b664 Mon Sep 17 00:00:00 2001
From: David Ritter <141235163+davidritter-dotcom@users.noreply.github.com>
Date: Thu, 17 Aug 2023 11:01:56 +0200
Subject: [PATCH 11/16] feat(documentation-v7): migrate topic-teaser (#1763)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Oliver Schürch
Co-authored-by: Alizé Debray <33580481+alizedebray@users.noreply.github.com>
---
.../topic-teaser/topic-teaser.docs.mdx | 33 +++
.../topic-teaser/topic-teaser.stories.ts | 189 ++++++++++++++++++
2 files changed, 222 insertions(+)
create mode 100644 packages/documentation-v7/src/stories/components/topic-teaser/topic-teaser.docs.mdx
create mode 100644 packages/documentation-v7/src/stories/components/topic-teaser/topic-teaser.stories.ts
diff --git a/packages/documentation-v7/src/stories/components/topic-teaser/topic-teaser.docs.mdx b/packages/documentation-v7/src/stories/components/topic-teaser/topic-teaser.docs.mdx
new file mode 100644
index 0000000000..f9bd1d79cb
--- /dev/null
+++ b/packages/documentation-v7/src/stories/components/topic-teaser/topic-teaser.docs.mdx
@@ -0,0 +1,33 @@
+import { Meta, Canvas, Controls } from '@storybook/blocks';
+import * as TopicTeaserStories from './topic-teaser.stories';
+
+
+
+# Topic Teaser
+
+
+ Topic Teaser provides a flexible and responsive content container with options to align the image,
+ adding topic content and links as well as contextual background colors.
+
+
+If you use multiple topic teasers on one page, each topic teaser must have a different background.
+
+
+
+
+
+
+## SCSS Imports
+
+To import all styles from the design-system-styles package:
+
+```scss
+@use '@swisspost/design-system-styles/index.scss';
+```
+
+To import only the styles required for this component:
+
+```scss
+@use '@swisspost/design-system-styles/basics.scss';
+@use '@swisspost/design-system-styles/components/topic-teaser.scss';
+```
diff --git a/packages/documentation-v7/src/stories/components/topic-teaser/topic-teaser.stories.ts b/packages/documentation-v7/src/stories/components/topic-teaser/topic-teaser.stories.ts
new file mode 100644
index 0000000000..127280968d
--- /dev/null
+++ b/packages/documentation-v7/src/stories/components/topic-teaser/topic-teaser.stories.ts
@@ -0,0 +1,189 @@
+import type { Args, Meta, StoryObj } from '@storybook/web-components';
+import { html, TemplateResult } from 'lit';
+import { BADGE } from '../../../../.storybook/constants';
+import { mapClasses } from '../../../utils';
+
+const meta: Meta = {
+ title: 'Components/Topic Teaser',
+ parameters: {
+ badges: [BADGE.NEEDS_REVISION],
+ },
+ args: {
+ title: 'Loremipsum',
+ subtitle: 'Vero siteos et accusam iretea et justo',
+ linkCount: 5,
+ alignment: 'null',
+ backgroundColor: 'bg-nightblue',
+ },
+ argTypes: {
+ title: {
+ name: 'Title',
+ description: 'The text to include in the component title.',
+ control: {
+ type: 'text',
+ },
+ table: {
+ category: 'General',
+ },
+ },
+ subtitle: {
+ name: 'Subtitle',
+ description: 'The text to include in the component subtitle.',
+ control: {
+ type: 'text',
+ },
+ table: {
+ category: 'General',
+ },
+ },
+ linkCount: {
+ name: 'Amount of links',
+ description: 'The amount of the renderd links.',
+ control: {
+ type: 'number',
+ min: 1,
+ max: 10,
+ },
+ table: {
+ category: 'General',
+ },
+ },
+ alignment: {
+ name: 'Image alignment',
+ description: 'The alignment of the image.',
+ control: {
+ type: 'radio',
+ labels: {
+ 'topic-teaser-reverse': 'Image left',
+ 'null': 'Image right',
+ },
+ },
+ options: ['topic-teaser-reverse', 'null'],
+ table: {
+ category: 'General',
+ },
+ },
+ backgroundColor: {
+ name: 'Background Color',
+ description: 'The color the component uses as background.',
+ control: {
+ type: 'select',
+ labels: {
+ 'bg-light': 'Light',
+ 'bg-dark': 'Dark',
+ 'bg-nightblue': 'Nightblue',
+ 'bg-nightblue-bright': 'Nightblue (bright)',
+ 'bg-petrol': 'Petrol',
+ 'bg-petrol-bright': 'Petrol (bright)',
+ 'bg-coral': 'Coral',
+ 'bg-coral-bright': 'Coral (bright)',
+ 'bg-olive': 'Olive',
+ 'bg-olive-bright': 'Olive (bright)',
+ 'bg-purple': 'Purple',
+ 'bg-purple-bright': 'Purple (bright)',
+ 'bg-aubergine': 'Aubergine',
+ 'bg-aubergine-bright': 'Aubergine (bright)',
+ },
+ },
+ options: [
+ 'bg-light',
+ 'bg-dark',
+ 'bg-nightblue',
+ 'bg-nightblue-bright',
+ 'bg-petrol',
+ 'bg-petrol-bright',
+ 'bg-coral',
+ 'bg-coral-bright',
+ 'bg-olive',
+ 'bg-olive-bright',
+ 'bg-purple',
+ 'bg-purple-bright',
+ 'bg-aubergine',
+ 'bg-aubergine-bright',
+ ],
+ table: {
+ category: 'General',
+ },
+ },
+ },
+};
+
+export default meta;
+
+type Story = StoryObj;
+
+const linkTexts: string[] = [
+ 'At vero eos et accusam et',
+ 'Dolores et ea rebum',
+ 'Stet clita kasd gubergren',
+ 'Sed diam nonumy eirmod',
+ 'Duo dolores et ea rebum',
+ 'Magna aliquyam erat',
+ 'Consetetur sadipscing elitr',
+ 'Justo duo dolores',
+ 'Takimata sanctus est',
+ 'Nonummy nibh euismod',
+];
+
+export const Default: Story = {
+ render: (args: Args) => {
+ const classes = mapClasses({
+ 'topic-teaser': true,
+ 'mb-huge-r': true,
+ [args.backgroundColor]: args.backgroundColor !== 'null',
+ [args.alignment]: args.alignment !== 'null',
+ });
+
+ const links: TemplateResult[] = linkTexts.slice(0, args.linkCount).map(
+ text => html`
+
+
+ ${text}
+
+
+ `,
+ );
+
+ const image = html`
+
+
+
+ `;
+
+ const content = html`
+
+
+ ${args.title}
+ ${args.subtitle}
+
+
+
+ `;
+
+ return html`
+
+
+
+
+ ${args.alignment === 'null'
+ ? html`
+ ${content}${image}
+ `
+ : html`
+ ${image}${content}
+ `}
+
+
+
+
+ `;
+ },
+};
From c1dee3be0187eee440d6556b07839ef584f5b3db Mon Sep 17 00:00:00 2001
From: Philipp Gfeller <1659006+gfellerph@users.noreply.github.com>
Date: Thu, 17 Aug 2023 13:56:15 +0200
Subject: [PATCH 12/16] feat(styles): add the radio/checkbox card component
(#1607)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Loïc Fürhoff <12294151+imagoiq@users.noreply.github.com>
Co-authored-by: Oliver Schürch
---
.changeset/honest-singers-laugh.md | 6 +
packages/components/.eslintrc.json | 33 +--
packages/documentation-v7/.storybook/main.ts | 10 +-
packages/documentation-v7/package.json | 1 +
.../choice-card/checkbox-card.docs.mdx | 60 +++++
.../choice-card/checkbox-card.stories.ts | 20 ++
.../choice-control.snapshot.stories.ts | 43 ++++
.../components/choice-card/choice-control.ts | 228 ++++++++++++++++++
.../choice-card/radiobutton-card.docs.mdx | 60 +++++
.../choice-card/radiobutton-card.stories.ts | 20 ++
packages/documentation/.storybook/preview.js | 1 +
.../snapshots/styles/choice-card.snapshot.ts | 6 +
.../checkbox-card.docs.mdx | 36 +++
.../checkbox-card.stories.tsx | 29 +++
.../choice-card-snapshot.stories.mdx | 27 +++
.../choice-control-card/choice-card.tsx | 177 ++++++++++++++
.../radio-button-card.docs.mdx | 36 +++
.../radio-button-card.stories.tsx | 28 +++
packages/styles/src/components/_index.scss | 1 +
.../src/components/choice-control-card.scss | 146 +++++++++++
packages/styles/src/variables/_type.scss | 1 +
pnpm-lock.yaml | 3 +
22 files changed, 940 insertions(+), 32 deletions(-)
create mode 100644 .changeset/honest-singers-laugh.md
create mode 100644 packages/documentation-v7/src/stories/components/choice-card/checkbox-card.docs.mdx
create mode 100644 packages/documentation-v7/src/stories/components/choice-card/checkbox-card.stories.ts
create mode 100644 packages/documentation-v7/src/stories/components/choice-card/choice-control.snapshot.stories.ts
create mode 100644 packages/documentation-v7/src/stories/components/choice-card/choice-control.ts
create mode 100644 packages/documentation-v7/src/stories/components/choice-card/radiobutton-card.docs.mdx
create mode 100644 packages/documentation-v7/src/stories/components/choice-card/radiobutton-card.stories.ts
create mode 100644 packages/documentation/cypress/snapshots/styles/choice-card.snapshot.ts
create mode 100644 packages/documentation/src/stories/components/choice-control-card/checkbox-card.docs.mdx
create mode 100644 packages/documentation/src/stories/components/choice-control-card/checkbox-card.stories.tsx
create mode 100644 packages/documentation/src/stories/components/choice-control-card/choice-card-snapshot.stories.mdx
create mode 100644 packages/documentation/src/stories/components/choice-control-card/choice-card.tsx
create mode 100644 packages/documentation/src/stories/components/choice-control-card/radio-button-card.docs.mdx
create mode 100644 packages/documentation/src/stories/components/choice-control-card/radio-button-card.stories.tsx
create mode 100644 packages/styles/src/components/choice-control-card.scss
diff --git a/.changeset/honest-singers-laugh.md b/.changeset/honest-singers-laugh.md
new file mode 100644
index 0000000000..0bdb822077
--- /dev/null
+++ b/.changeset/honest-singers-laugh.md
@@ -0,0 +1,6 @@
+---
+'@swisspost/design-system-documentation': minor
+'@swisspost/design-system-styles': minor
+---
+
+Added the checkbox and radio-button card pattern. These two components are now available in the styles package
diff --git a/packages/components/.eslintrc.json b/packages/components/.eslintrc.json
index 43e4496ebf..b3d873ca2d 100644
--- a/packages/components/.eslintrc.json
+++ b/packages/components/.eslintrc.json
@@ -8,17 +8,14 @@
"plugin:@typescript-eslint/recommended",
"plugin:@stencil-community/recommended"
],
- "overrides": [
- ],
+ "overrides": [],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"project": "./tsconfig.eslint.json"
},
- "plugins": [
- "@typescript-eslint"
- ],
+ "plugins": ["@typescript-eslint"],
"rules": {
"indent": [
"error",
@@ -27,14 +24,8 @@
"SwitchCase": 1
}
],
- "quotes": [
- "error",
- "single"
- ],
- "semi": [
- "error",
- "always"
- ],
+ "quotes": ["error", "single"],
+ "semi": ["error", "always"],
"@typescript-eslint/no-unused-vars": [
"error",
{
@@ -44,21 +35,9 @@
}
],
"@stencil-community/strict-boolean-conditions": "off",
- "@stencil-community/required-prefix": [
- "error",
- [
- "post"
- ]
- ],
+ "@stencil-community/required-prefix": ["error", ["post"]],
"@stencil-community/async-methods": "error",
- "@stencil-community/ban-prefix": [
- "error",
- [
- "stencil",
- "stnl",
- "st"
- ]
- ],
+ "@stencil-community/ban-prefix": ["error", ["stencil", "stnl", "st"]],
"@stencil-community/decorators-context": "error",
"@stencil-community/decorators-style": [
"error",
diff --git a/packages/documentation-v7/.storybook/main.ts b/packages/documentation-v7/.storybook/main.ts
index 997465a767..170f6eb849 100644
--- a/packages/documentation-v7/.storybook/main.ts
+++ b/packages/documentation-v7/.storybook/main.ts
@@ -11,11 +11,6 @@ const config: StorybookConfig = {
},
stories: ['../src/stories/**/*.mdx', '../src/stories/**/*.stories.@(ts|tsx)'],
addons: [
- '@storybook/addon-links',
- '@storybook/addon-designs',
- '@storybook/addon-a11y',
- '@geometricpanda/storybook-addon-badges',
- '@pxtrn/storybook-addon-docs-stencil',
{
name: '@storybook/addon-essentials',
options: {
@@ -26,6 +21,11 @@ const config: StorybookConfig = {
toolbars: false,
},
},
+ '@storybook/addon-links',
+ '@storybook/addon-designs',
+ '@storybook/addon-a11y',
+ '@geometricpanda/storybook-addon-badges',
+ '@pxtrn/storybook-addon-docs-stencil',
],
staticDirs: [
{
diff --git a/packages/documentation-v7/package.json b/packages/documentation-v7/package.json
index 91232a5ad9..97a51accf5 100644
--- a/packages/documentation-v7/package.json
+++ b/packages/documentation-v7/package.json
@@ -56,6 +56,7 @@
"@types/react-syntax-highlighter": "15.5.7",
"cypress": "12.17.3",
"lit": "2.8.0",
+ "lit-html": "2.8.0",
"prettier": "2.8.8",
"react": "18.2.0",
"react-dom": "18.2.0",
diff --git a/packages/documentation-v7/src/stories/components/choice-card/checkbox-card.docs.mdx b/packages/documentation-v7/src/stories/components/choice-card/checkbox-card.docs.mdx
new file mode 100644
index 0000000000..8ae601f273
--- /dev/null
+++ b/packages/documentation-v7/src/stories/components/choice-card/checkbox-card.docs.mdx
@@ -0,0 +1,60 @@
+import { Meta, Canvas, Controls } from '@storybook/blocks';
+import * as CheckboxCardStories from './checkbox-card.stories';
+
+
+
+# Checkbox card
+
+
+ A larger, more consumer oriented, touch friendly variant of the checkbox used for e.g. selecting
+ services.
+
+
+
+
Firefox fallback classes
+ Firefox currently does not support
+ the new CSS :has pseudo-selector
+ . As a fallback, the following states have to be mirrored on the top level element in the form
+ of classes:
+
+
+ checked
+
+
+ focused
+
+
+ disabled
+
+
+ is-invalid
+
+
+ Check
caniuse :has() to check if you still need the fallback.
+
+
+
+
+
+
+
+## Grouping
+
+Checkbox cards can be grouped together. Use a `fieldset`/`legend` combination to label the group. If there is an error, link the legend with the error message through the `aria-describedby` attribute on the `legend`, pointing to the `id` of the error message.
+
+
+
+## SCSS Imports
+
+To import all styles from the design-system-styles package:
+
+```scss
+@use '@swisspost/design-system-styles/index.scss';
+```
+
+To import only the styles required for this component:
+
+```scss
+@use '@swisspost/design-system-styles/basics.scss';
+@use '@swisspost/design-system-styles/components/choice-control-card.scss';
+```
diff --git a/packages/documentation-v7/src/stories/components/choice-card/checkbox-card.stories.ts b/packages/documentation-v7/src/stories/components/choice-card/checkbox-card.stories.ts
new file mode 100644
index 0000000000..5ec1e80157
--- /dev/null
+++ b/packages/documentation-v7/src/stories/components/choice-card/checkbox-card.stories.ts
@@ -0,0 +1,20 @@
+import { BADGE } from '../../../../.storybook/constants';
+import { choiceCardMeta, choiceCardDefault, choiceCardGroup } from './choice-control';
+
+export default {
+ ...choiceCardMeta,
+ title: 'Components/Checkbox Card',
+ parameters: {
+ badges: [BADGE.NEEDS_REVISION],
+ },
+};
+
+export const Default = {
+ render: choiceCardDefault,
+ args: { ...choiceCardMeta.args, type: 'checkbox' },
+};
+
+export const Group = {
+ render: choiceCardGroup,
+ args: { ...choiceCardMeta.args, type: 'checkbox' },
+};
diff --git a/packages/documentation-v7/src/stories/components/choice-card/choice-control.snapshot.stories.ts b/packages/documentation-v7/src/stories/components/choice-card/choice-control.snapshot.stories.ts
new file mode 100644
index 0000000000..672cbff0b6
--- /dev/null
+++ b/packages/documentation-v7/src/stories/components/choice-card/choice-control.snapshot.stories.ts
@@ -0,0 +1,43 @@
+import { bombArgs } from '../../../utils/bombArgs';
+import { choiceCardMeta, choiceCardDefault } from './choice-control';
+import { StoryObj } from '@storybook/web-components';
+import { html } from 'lit';
+
+export default {
+ ...choiceCardMeta,
+ title: 'Hidden/snapshots/components',
+};
+
+const bombedArgs = bombArgs({
+ type: choiceCardMeta.argTypes!.type!.options,
+ validation: choiceCardMeta.argTypes!.validation!.options,
+ checked: [false, true],
+ disabled: [false, true],
+ label: ['Card check text', 'Really long running choice card text that wraps to two lines'],
+ showDescription: [false, true],
+ description: ['A very long running description that is wrapping to two lines'],
+ showIcon: [false, true],
+})
+ // Filter out disabled and invalid combinations
+ .filter(args => !(args.disabled && args.validation === 'is-invalid'));
+
+export const CheckboxCard: StoryObj = {
+ render: () => {
+ return html`
+
+ ${['bg-white', 'bg-dark'].map(
+ bg => html`
+
+ ${bombedArgs.map(
+ args =>
+ html`
+
${choiceCardDefault(args)}
+ `,
+ )}
+
+ `,
+ )}
+
+ `;
+ },
+};
diff --git a/packages/documentation-v7/src/stories/components/choice-card/choice-control.ts b/packages/documentation-v7/src/stories/components/choice-card/choice-control.ts
new file mode 100644
index 0000000000..39f8b6ce19
--- /dev/null
+++ b/packages/documentation-v7/src/stories/components/choice-card/choice-control.ts
@@ -0,0 +1,228 @@
+import type { Args, Meta } from '@storybook/web-components';
+import { html } from 'lit/static-html.js';
+import { classMap } from 'lit/directives/class-map.js';
+import { BADGE } from '../../../../.storybook/constants';
+import { nothing } from 'lit';
+import { useArgs } from '@storybook/preview-api';
+
+export const choiceCardMeta: Meta = {
+ parameters: {
+ badges: [BADGE.NEEDS_REVISION],
+ controls: {
+ exclude: ['Type'],
+ },
+ },
+ args: {
+ label: 'Card check text',
+ type: 'radio',
+ checked: false,
+ disabled: false,
+ focused: false,
+ validation: 'null',
+ showDescription: false,
+ description: 'A small description',
+ icon: 1000,
+ showIcon: false,
+ },
+ argTypes: {
+ label: {
+ name: 'Label',
+ type: 'string',
+ description: 'The main label of the input',
+ table: {
+ category: 'General',
+ },
+ },
+ type: {
+ name: 'Type',
+ control: {
+ type: 'radio',
+ labels: {
+ radio: 'Radio button',
+ checkbox: 'Checkbox',
+ },
+ },
+ options: ['radio', 'checkbox'],
+ table: {
+ // Hide it in the controls because there are two pages
+ disable: true,
+ },
+ },
+ checked: {
+ name: 'Checked',
+ type: 'boolean',
+ description: 'When set to `true`, places the component in the checked state.',
+ table: {
+ category: 'States',
+ },
+ },
+ disabled: {
+ name: 'Disabled',
+ description:
+ 'When set to `true`, disables the component\'s functionality and places it in a disabled state.There are accessibility concerns with the disabled state. Please read our disabled state accessibility guide . ',
+ control: {
+ type: 'boolean',
+ },
+ table: {
+ category: 'States',
+ },
+ },
+ focused: {
+ name: 'Focused',
+ description: 'Render the component in a focused state',
+ control: { type: 'boolean' },
+ table: {
+ category: 'States',
+ },
+ },
+ validation: {
+ name: 'Validation',
+ description: "Controls the display of the component's validation state.",
+ control: {
+ type: 'radio',
+ labels: {
+ 'null': 'Default',
+ 'is-invalid': 'Invalid',
+ },
+ },
+ options: ['null', 'is-invalid'],
+ table: {
+ category: 'States',
+ },
+ },
+ showDescription: {
+ name: 'Show description',
+ type: 'boolean',
+ description: 'Toggles an additional description',
+ table: {
+ category: 'Description',
+ },
+ },
+ description: {
+ name: 'Description',
+ type: 'string',
+ description: 'A short additional description',
+ table: {
+ category: 'Description',
+ },
+ },
+ showIcon: {
+ name: 'Show icon',
+ type: 'boolean',
+ description: 'Show or hide icon',
+ table: {
+ category: 'Icon',
+ },
+ },
+ icon: {
+ name: 'Icon',
+ control: {
+ type: 'select',
+ },
+ options: [1000, 1001, 2000],
+ table: {
+ category: 'Icon',
+ },
+ },
+ },
+};
+
+let id_ct = 1;
+
+export const choiceCardDefault = (args: Args, name = 'control') => {
+ const [_, updateArgs] = useArgs();
+
+ // Conditional classes
+ const inputClasses = classMap({
+ 'form-check-input': true,
+ 'is-invalid': args.validation === 'is-invalid',
+ });
+ const cardClassMap = classMap({
+ 'checked': args.checked,
+ 'disabled': args.disabled,
+ 'is-invalid': args.validation === 'is-invalid',
+ 'checkbox-button-card': args.type === 'checkbox',
+ 'radio-button-card': args.type === 'radio',
+ });
+
+ // Child components
+ const id = `control-${id_ct++}`;
+ const description = html`
+
+ ${args.description}
+ `;
+ const icon = html`
+
+ `;
+
+ // Firefox fallback for the :has selector
+ const _handleInput = (e: InputEvent) => {
+ const target = e.target as HTMLInputElement;
+ updateArgs({ checked: target.checked });
+
+ // Fix input events not fired on "deselected" radio buttons
+ target
+ .closest('fieldset')
+ ?.querySelectorAll('.radio-button-card')
+ .forEach(e => e?.classList.remove('checked'));
+ target.parentElement?.classList.toggle('checked', target.checked);
+ };
+
+ // Firefox fallback for the :has selector
+ const _handleFocus = (e: InputEvent) => {
+ updateArgs({ focused: true });
+ (e.target as HTMLInputElement).parentElement?.classList.add('focused');
+ };
+
+ // Firefox fallback for the :has selector
+ const _handleBlur = (e: InputEvent) => {
+ updateArgs({ focused: false });
+ (e.target as HTMLInputElement).parentElement?.classList.remove('focused');
+ };
+
+ return html`
+
+
+
+ ${args.label}
+ ${args.showDescription ? description : nothing}
+
+ ${args.showIcon ? icon : nothing}
+
+ `;
+};
+
+export const choiceCardGroup = (args: Args) => {
+ const loop = ['One', 'Two', 'Three', 'Four', 'Five', 'Six'];
+
+ const col = (label: string) => html`
+
+ ${choiceCardDefault({ ...args, label, checked: false, focused: false }, 'group')}
+
+ `;
+
+ const error = html`
+ Invalid choice
+ `;
+
+ return html`
+
+
+ Legend
+
+ ${loop.map(n => col(n))}
+ ${args.validation === 'is-invalid' ? error : null}
+
+ `;
+};
diff --git a/packages/documentation-v7/src/stories/components/choice-card/radiobutton-card.docs.mdx b/packages/documentation-v7/src/stories/components/choice-card/radiobutton-card.docs.mdx
new file mode 100644
index 0000000000..4e31c53cd3
--- /dev/null
+++ b/packages/documentation-v7/src/stories/components/choice-card/radiobutton-card.docs.mdx
@@ -0,0 +1,60 @@
+import { Meta, Canvas, Controls } from '@storybook/blocks';
+import * as RadiobuttonCardStories from './radiobutton-card.stories';
+
+
+
+# Radio button card
+
+
+ A larger, more consumer oriented, touch friendly variant of the radio-button used for e.g. selecting
+ services.
+
+
+
+
Firefox fallback classes
+ Firefox currently does not support
+ the new CSS :has pseudo-selector
+ . As a fallback, the following states have to be mirrored on the top level element in the form
+ of classes:
+
+
+ checked
+
+
+ focused
+
+
+ disabled
+
+
+ is-invalid
+
+
+ Check
caniuse :has() to check if you still need the fallback.
+
+
+
+
+
+
+
+## Grouping
+
+Radiobutton cards can be grouped together. Use a `fieldset`/`legend` combination to label the group. If there is an error, link the legend with the error message through the `aria-describedby` attribute on the `legend`, pointing to the `id` of the error message.
+
+
+
+## SCSS Imports
+
+To import all styles from the design-system-styles package:
+
+```scss
+@use '@swisspost/design-system-styles/index.scss';
+```
+
+To import only the styles required for this component:
+
+```scss
+@use '@swisspost/design-system-styles/basics.scss';
+@use '@swisspost/design-system-styles/components/choice-control-card.scss';
+```
diff --git a/packages/documentation-v7/src/stories/components/choice-card/radiobutton-card.stories.ts b/packages/documentation-v7/src/stories/components/choice-card/radiobutton-card.stories.ts
new file mode 100644
index 0000000000..392ddf353c
--- /dev/null
+++ b/packages/documentation-v7/src/stories/components/choice-card/radiobutton-card.stories.ts
@@ -0,0 +1,20 @@
+import { BADGE } from '../../../../.storybook/constants';
+import { choiceCardMeta, choiceCardDefault, choiceCardGroup } from './choice-control';
+
+export default {
+ ...choiceCardMeta,
+ title: 'Components/Radio Button Card',
+ parameters: {
+ badges: [BADGE.NEEDS_REVISION],
+ },
+};
+
+export const Default = {
+ render: choiceCardDefault,
+ args: { ...choiceCardMeta.args, type: 'radio' },
+};
+
+export const Group = {
+ render: choiceCardGroup,
+ args: { ...choiceCardMeta.args, type: 'radio' },
+};
diff --git a/packages/documentation/.storybook/preview.js b/packages/documentation/.storybook/preview.js
index e273f272b3..bf5fa8787a 100644
--- a/packages/documentation/.storybook/preview.js
+++ b/packages/documentation/.storybook/preview.js
@@ -106,6 +106,7 @@ export const parameters = {
dt: null,
dd: null,
a: null,
+ div: null,
},
source: {
excludeDecorators: true,
diff --git a/packages/documentation/cypress/snapshots/styles/choice-card.snapshot.ts b/packages/documentation/cypress/snapshots/styles/choice-card.snapshot.ts
new file mode 100644
index 0000000000..929b4874f1
--- /dev/null
+++ b/packages/documentation/cypress/snapshots/styles/choice-card.snapshot.ts
@@ -0,0 +1,6 @@
+describe('Choice cards', () => {
+ it('default', () => {
+ cy.visit('/iframe.html?id=hidden-choice-card-snapshot-test--page');
+ cy.percySnapshot('Choice card', { widths: [320, 1024] });
+ });
+});
diff --git a/packages/documentation/src/stories/components/choice-control-card/checkbox-card.docs.mdx b/packages/documentation/src/stories/components/choice-control-card/checkbox-card.docs.mdx
new file mode 100644
index 0000000000..37533f54b8
--- /dev/null
+++ b/packages/documentation/src/stories/components/choice-control-card/checkbox-card.docs.mdx
@@ -0,0 +1,36 @@
+import { Meta, Canvas, Story, ArgsTable } from '@storybook/addon-docs';
+import LinkTo from '@storybook/addon-links/react';
+
+
+
+# Checkbox Card
+
+
+
+
+
+
+## Grouping checkboxes
+
+Checkbox cards can be grouped together by wrapping them in a `fieldset/legend` structure.
+
+
+
+
+
+## SCSS Imports
+
+To import all styles from the design-system-styles package:
+
+```css dark
+@use '@swisspost/design-system-styles/index.scss';
+```
+
+To import only the styles required for this component:
+
+```css dark
+@use '@swisspost/design-system-styles/basics.scss';
+@use '@swisspost/design-system-styles/components/choice-control-button.scss';
+```
diff --git a/packages/documentation/src/stories/components/choice-control-card/checkbox-card.stories.tsx b/packages/documentation/src/stories/components/choice-control-card/checkbox-card.stories.tsx
new file mode 100644
index 0000000000..67ae22324c
--- /dev/null
+++ b/packages/documentation/src/stories/components/choice-control-card/checkbox-card.stories.tsx
@@ -0,0 +1,29 @@
+import { Meta, Story } from '@storybook/react';
+import { choiceCardGroup, choiceCardMeta, ChoiceCardReactiveTemplate } from './choice-card';
+import docsPage from './checkbox-card.docs.mdx';
+
+export default Object.assign({}, choiceCardMeta, {
+ title: 'Components/Checkbox card',
+ parameters: { ...choiceCardMeta.parameters, docs: { page: docsPage } },
+ args: { ...choiceCardMeta.args, type: 'checkbox' },
+}) as Meta;
+
+export const Default: Story = ChoiceCardReactiveTemplate.bind({});
+Default.args = {
+ type: 'checkbox',
+};
+Default.parameters = {
+ controls: {
+ exclude: ['Type'],
+ },
+};
+
+export const Group: Story = choiceCardGroup.bind({});
+Group.args = {
+ type: 'checkbox',
+};
+Group.parameters = {
+ controls: {
+ exclude: ['Checked', 'Disabled', 'Type', 'Label'],
+ },
+};
diff --git a/packages/documentation/src/stories/components/choice-control-card/choice-card-snapshot.stories.mdx b/packages/documentation/src/stories/components/choice-control-card/choice-card-snapshot.stories.mdx
new file mode 100644
index 0000000000..eee9f6ad0d
--- /dev/null
+++ b/packages/documentation/src/stories/components/choice-control-card/choice-card-snapshot.stories.mdx
@@ -0,0 +1,27 @@
+import { Meta, Args, Story, Canvas } from '@storybook/addon-docs';
+import { bombArgs } from '../../utilities/bombArgs';
+import { choiceCardMeta, ChoiceCardTemplate } from './choice-card.tsx';
+
+
+
+
+ {['bg-white', 'bg-dark'].map(bg => (
+
+ {bombArgs({
+ type: choiceCardMeta.argTypes.type.options,
+ validation: choiceCardMeta.argTypes.validation.options,
+ checked: [false, true],
+ disabled: [false, true],
+ label: ['Card check text', 'Really long running choice card text that wraps to two lines'],
+ showDescription: [false, true],
+ description: ['A very long running description that is wrapping to two lines'],
+ showIcon: [false, true],
+ })
+ // Filter out disabled and invalid combinations
+ .filter(args => !(args.disabled && args.validation === 'is-invalid'))
+ .map(args => (
+
{ChoiceCardTemplate({ ...args, icon: 1000 })}
+ ))}
+
+ ))}
+
diff --git a/packages/documentation/src/stories/components/choice-control-card/choice-card.tsx b/packages/documentation/src/stories/components/choice-control-card/choice-card.tsx
new file mode 100644
index 0000000000..6af1294d8d
--- /dev/null
+++ b/packages/documentation/src/stories/components/choice-control-card/choice-card.tsx
@@ -0,0 +1,177 @@
+import { BADGE } from '@geometricpanda/storybook-addon-badges';
+import { Args, Meta } from '@storybook/react';
+
+import { useArgs } from '@storybook/client-api';
+
+export const choiceCardMeta = {
+ parameters: {
+ badges: [BADGE.NEEDS_REVISION],
+ },
+ args: {
+ label: 'Card check text',
+ type: 'radio',
+ checked: false,
+ disabled: false,
+ validation: 'null',
+ showDescription: false,
+ description: 'A small description',
+ icon: 1000,
+ showIcon: false,
+ },
+ argTypes: {
+ label: {
+ name: 'Label',
+ type: 'string',
+ description: 'The main label of the input',
+ table: {
+ category: 'General',
+ },
+ },
+ type: {
+ name: 'Type',
+ control: {
+ type: 'radio',
+ labels: {
+ radio: 'Radio button',
+ checkbox: 'Checkbox',
+ },
+ },
+ options: ['radio', 'checkbox'],
+ table: {
+ category: 'General',
+ },
+ },
+ checked: {
+ name: 'Checked',
+ type: 'boolean',
+ description: 'When set to `true`, places the component in the checked state.',
+ table: {
+ category: 'States',
+ },
+ },
+ disabled: {
+ name: 'Disabled',
+ description:
+ 'When set to `true`, disables the component\'s functionality and places it in a disabled state.There are accessibility concerns with the disabled state. Please read our disabled state accessibility guide . ',
+ control: {
+ type: 'boolean',
+ },
+ table: {
+ category: 'States',
+ },
+ },
+ validation: {
+ name: 'Validation',
+ description: "Controls the display of the component's validation state.",
+ control: {
+ type: 'radio',
+ labels: {
+ 'null': 'Default',
+ 'is-invalid': 'Invalid',
+ },
+ },
+ options: ['null', 'is-invalid'],
+ table: {
+ category: 'States',
+ },
+ },
+ showDescription: {
+ name: 'Show description',
+ type: 'boolean',
+ description: 'Toggles an additional description',
+ table: {
+ category: 'Description',
+ },
+ },
+ description: {
+ name: 'Description',
+ type: 'string',
+ description: 'A short additional description',
+ table: {
+ category: 'Description',
+ },
+ },
+ showIcon: {
+ name: 'Show icon',
+ type: 'boolean',
+ description: 'Show or hide icon',
+ table: {
+ category: 'Icon',
+ },
+ },
+ icon: {
+ name: 'Icon',
+ control: {
+ type: 'select',
+ },
+ options: [1000, 1001, 2000],
+ table: {
+ category: 'Icon',
+ },
+ },
+ },
+} as Meta;
+
+export const ChoiceCardTemplate = (args: Args, onChange?: () => void, id = 'choice-card') => {
+ const inputClasses = ['form-check-input', args.validation].filter(c => c !== 'null').join(' ');
+ return (
+
+ );
+};
+
+export const ChoiceCardReactiveTemplate = (args: Args) => {
+ const [_, updateArgs] = useArgs();
+ return ChoiceCardTemplate(args, () => updateArgs({ checked: !args.checked }));
+};
+
+export const choiceCardGroup = (args: Args) => {
+ const loop = ['One', 'Two', 'Three', 'Four', 'Five', 'Six'];
+ return (
+
+ Legend
+
+ {loop.map(n => (
+
+ {ChoiceCardTemplate({ ...args, label: n }, undefined, `choice-card-${n}`)}
+
+ ))}
+
+
+ {args.validation === 'is-invalid' && (
+
+ Invalid choice
+
+ )}
+
+ );
+};
diff --git a/packages/documentation/src/stories/components/choice-control-card/radio-button-card.docs.mdx b/packages/documentation/src/stories/components/choice-control-card/radio-button-card.docs.mdx
new file mode 100644
index 0000000000..45eab00c3c
--- /dev/null
+++ b/packages/documentation/src/stories/components/choice-control-card/radio-button-card.docs.mdx
@@ -0,0 +1,36 @@
+import { Meta, Canvas, Story, ArgsTable } from '@storybook/addon-docs';
+import LinkTo from '@storybook/addon-links/react';
+
+
+
+# Radio button card
+
+
+
+
+
+
+## Grouping radio buttons
+
+Radio button cards can be grouped by wrapping them in a `fieldset/legend` construct.
+
+
+
+
+
+## SCSS Imports
+
+To import all styles from the design-system-styles package:
+
+```css dark
+@use '@swisspost/design-system-styles/index.scss';
+```
+
+To import only the styles required for this component:
+
+```css dark
+@use '@swisspost/design-system-styles/basics.scss';
+@use '@swisspost/design-system-styles/components/choice-control-button.scss';
+```
diff --git a/packages/documentation/src/stories/components/choice-control-card/radio-button-card.stories.tsx b/packages/documentation/src/stories/components/choice-control-card/radio-button-card.stories.tsx
new file mode 100644
index 0000000000..5d32168074
--- /dev/null
+++ b/packages/documentation/src/stories/components/choice-control-card/radio-button-card.stories.tsx
@@ -0,0 +1,28 @@
+import { Story } from '@storybook/react';
+import { choiceCardGroup, choiceCardMeta, ChoiceCardReactiveTemplate } from './choice-card';
+import docsPage from './radio-button-card.docs.mdx';
+
+export default Object.assign({}, choiceCardMeta, {
+ title: 'Components/Radio Button Card',
+ parameters: { ...choiceCardMeta.parameters, docs: { page: docsPage } },
+});
+
+export const Default: Story = ChoiceCardReactiveTemplate.bind({});
+Default.args = {
+ type: 'radio',
+};
+Default.parameters = {
+ controls: {
+ exclude: ['Type'],
+ },
+};
+
+export const Group: Story = choiceCardGroup.bind({});
+Group.args = {
+ type: 'radio',
+};
+Group.parameters = {
+ controls: {
+ exclude: ['Checked', 'Disabled', 'Type', 'Label'],
+ },
+};
diff --git a/packages/styles/src/components/_index.scss b/packages/styles/src/components/_index.scss
index 623c73b462..cebd4c6353 100644
--- a/packages/styles/src/components/_index.scss
+++ b/packages/styles/src/components/_index.scss
@@ -9,6 +9,7 @@
@use 'button';
@use 'button-group';
@use 'card';
+@use 'choice-control-card';
@use 'carousel';
@use 'close';
@use 'elevation';
diff --git a/packages/styles/src/components/choice-control-card.scss b/packages/styles/src/components/choice-control-card.scss
new file mode 100644
index 0000000000..3b1ad7e518
--- /dev/null
+++ b/packages/styles/src/components/choice-control-card.scss
@@ -0,0 +1,146 @@
+@use '../variables/color';
+@use '../variables/commons';
+@use '../variables/spacing';
+@use '../mixins/utilities';
+
+.radio-button-card,
+.checkbox-button-card {
+ --post-card-select--hover-bg: #{color.$gray-10};
+
+ position: relative;
+ display: flex;
+ gap: 0 spacing.$size-mini;
+
+ width: 100%;
+
+ color: color.$gray-80;
+ background-color: color.$white;
+ border: 2px solid color.$gray-60;
+ border-radius: commons.$border-radius;
+ padding: spacing.$size-regular;
+ transition: color 100ms ease-in-out, background-color 100ms ease-in-out,
+ border-color 100ms ease-in-out;
+
+ // Checked
+ &:where(:has(input:checked), .checked) {
+ --post-card-select--hover-bg: #{color.$yellow};
+ background-color: color.$yellow;
+ border-color: color.$gray-60;
+
+ input {
+ background-color: color.$white !important;
+ }
+ }
+
+ // Focus
+ &:where(:has(input:focus-visible), .focused) {
+ background-color: var(--post-card-select--hover-bg);
+ outline: 2px solid color.$black;
+ outline-offset: 2px;
+ border-color: color.$black;
+
+ input {
+ border-color: color.$black;
+ }
+ }
+
+ // Hover
+ &:where(:hover:not(:has(input:disabled)), :hover:not(.disabled)) {
+ border-color: color.$black;
+ color: color.$black;
+ background-color: var(--post-card-select--hover-bg);
+
+ input {
+ border-color: color.$black;
+ }
+
+ @include utilities.high-contrast-mode() {
+ border-color: Highlight;
+ transition: none;
+ }
+ }
+
+ // Disabled
+ &:has(input:disabled),
+ &.disabled {
+ border-color: color.$gray-20;
+ color: color.$gray-40 !important;
+
+ > * {
+ cursor: default;
+ }
+ }
+
+ &:has(input:disabled:checked),
+ &.disabled.checked {
+ background-color: color.$gray-10;
+ }
+
+ // Error
+ &:has(input[aria-invalid]),
+ &:has(input.is-invalid),
+ &.is-invalid {
+ color: color.$error;
+ border-color: color.$error;
+
+ ~ .invalid-feedback {
+ display: block;
+ }
+ }
+
+ &:last-child {
+ margin-bottom: 0;
+ }
+
+ > * {
+ cursor: pointer;
+ }
+
+ post-icon {
+ width: 2em;
+ height: 2em;
+ margin-left: spacing.$size-mini;
+ pointer-events: none;
+ }
+
+ input {
+ border-color: color.$gray-80;
+ background-color: color.$white;
+ transition: border-color 100ms ease-in-out;
+ grid-column: 1 / 2;
+
+ &:focus {
+ box-shadow: none !important;
+ }
+ }
+
+ .form-check-label {
+ padding-left: 0;
+
+ &::before {
+ // This spans up the click area of the label to the whole
+ // card in order to make it clickable natively.
+ content: '';
+ position: absolute;
+ inset: -2px;
+ }
+
+ span {
+ // Lift spans above the before element to make them selectable
+ position: relative;
+ }
+ }
+
+ input,
+ .form-check-label {
+ margin-block: 0.25rem;
+ }
+
+ // Align input and label if there is an icon
+ &:has(post-icon) {
+ input,
+ .form-check-label {
+ margin-top: 0.25rem;
+ }
+ }
+}
diff --git a/packages/styles/src/variables/_type.scss b/packages/styles/src/variables/_type.scss
index 69842b1254..c7dd2c2015 100644
--- a/packages/styles/src/variables/_type.scss
+++ b/packages/styles/src/variables/_type.scss
@@ -77,6 +77,7 @@ $font-sizes: (
);
$font-size-map: (
+ 12: $font-size-12,
14: $font-size-14,
16: $font-size-16,
18: $font-size-18,
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 3f887fa648..c43d824215 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -687,6 +687,9 @@ importers:
lit:
specifier: 2.8.0
version: 2.8.0
+ lit-html:
+ specifier: 2.8.0
+ version: 2.8.0
prettier:
specifier: 2.8.8
version: 2.8.8
From ee91d416e8a611ef19bf96d45878f9bba8738ccb Mon Sep 17 00:00:00 2001
From: David Ritter <141235163+davidritter-dotcom@users.noreply.github.com>
Date: Thu, 17 Aug 2023 13:58:21 +0200
Subject: [PATCH 13/16] feat(documentation-v7): migrate snapshot test for
collapsible (#1823)
---
.../components/collapsible.snapshot.ts | 7 ++++
.../collapsible.snapshot.stories.tsx | 41 +++++++++++++++++++
2 files changed, 48 insertions(+)
create mode 100644 packages/documentation-v7/cypress/snapshots/components/collapsible.snapshot.ts
create mode 100644 packages/documentation-v7/src/stories/components/collapsible/collapsible.snapshot.stories.tsx
diff --git a/packages/documentation-v7/cypress/snapshots/components/collapsible.snapshot.ts b/packages/documentation-v7/cypress/snapshots/components/collapsible.snapshot.ts
new file mode 100644
index 0000000000..d72ea712f2
--- /dev/null
+++ b/packages/documentation-v7/cypress/snapshots/components/collapsible.snapshot.ts
@@ -0,0 +1,7 @@
+describe('Collapsible', () => {
+ it('default', () => {
+ cy.visit('/iframe.html?id=snapshots--collapsible');
+ cy.get('post-collapsible.hydrated').should('be.visible');
+ cy.percySnapshot('Collapsible');
+ });
+});
diff --git a/packages/documentation-v7/src/stories/components/collapsible/collapsible.snapshot.stories.tsx b/packages/documentation-v7/src/stories/components/collapsible/collapsible.snapshot.stories.tsx
new file mode 100644
index 0000000000..0a912aec93
--- /dev/null
+++ b/packages/documentation-v7/src/stories/components/collapsible/collapsible.snapshot.stories.tsx
@@ -0,0 +1,41 @@
+import { html } from 'lit';
+import type { Args, StoryContext, StoryObj } from '@storybook/web-components';
+import { bombArgs } from '../../../utils/bombArgs';
+
+import meta, { Default } from './collapsible.stories';
+
+export default {
+ ...meta,
+ title: 'Snapshots',
+};
+
+type Story = StoryObj;
+
+export const collapsible: Story = {
+ render: (_args: Args, context: StoryContext) => {
+ const templateVariants = bombArgs({
+ innerHTML: [
+ `Titulum Contentus momentus vero siteos et accusam iretea et justo.
`,
+ `Contentus momentus vero siteos et accusam iretea et justo.
`,
+ ],
+ collapsed: [false, true],
+ headingLevel: [1, 2, 3, 4, 5, 6],
+ }).map((args: Args) => {
+ return html`
+
+ ${meta.render?.({ ...context.args, ...Default.args, ...args }, context)}
+
+ `;
+ });
+
+ return html`
+
+ ${['white', 'dark'].map(
+ bg => html`
+
${templateVariants}
+ `,
+ )}
+
+ `;
+ },
+};
From e2f335797be3be8bbf78970c5d9ea101c84ce5ff Mon Sep 17 00:00:00 2001
From: Lukas Blaser <141234680+b1aserlu@users.noreply.github.com>
Date: Thu, 17 Aug 2023 16:02:22 +0200
Subject: [PATCH 14/16] feat(documentation-v7): add select snapshot test
(#1817)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Oliver Schürch
---
.../snapshots/components/select.snapshot.ts | 6 +
.../select/select.snapshot.stories.ts | 116 ++++++++++++++++++
2 files changed, 122 insertions(+)
create mode 100644 packages/documentation-v7/cypress/snapshots/components/select.snapshot.ts
create mode 100644 packages/documentation-v7/src/stories/components/select/select.snapshot.stories.ts
diff --git a/packages/documentation-v7/cypress/snapshots/components/select.snapshot.ts b/packages/documentation-v7/cypress/snapshots/components/select.snapshot.ts
new file mode 100644
index 0000000000..51939323b1
--- /dev/null
+++ b/packages/documentation-v7/cypress/snapshots/components/select.snapshot.ts
@@ -0,0 +1,6 @@
+describe('Select', () => {
+ it('default', () => {
+ cy.visit('./iframe.html?id=snapshots--select');
+ cy.percySnapshot('Selects', { widths: [400] });
+ });
+});
diff --git a/packages/documentation-v7/src/stories/components/select/select.snapshot.stories.ts b/packages/documentation-v7/src/stories/components/select/select.snapshot.stories.ts
new file mode 100644
index 0000000000..ba4d60022e
--- /dev/null
+++ b/packages/documentation-v7/src/stories/components/select/select.snapshot.stories.ts
@@ -0,0 +1,116 @@
+import type { Args, StoryContext, StoryObj } from '@storybook/web-components';
+import meta, { Default, FloatingLabel } from './select.stories';
+import { html } from 'lit';
+import { bombArgs } from '../../../utils/bombArgs';
+
+export default {
+ ...meta,
+ title: 'Snapshots',
+};
+
+type Story = StoryObj;
+
+export const Select: Story = {
+ render: (_args: Args, context: StoryContext) => {
+ //Arguments for Default Version
+ const bombArgsGeneratedDefault = [
+ ...bombArgs({
+ label: [
+ context.args.label,
+ 'Label - Lorem ipsum dolor sit amet consetetur sadipscing elitr sed diam nonumy eirmod tempor',
+ ],
+ hint: [''],
+ }),
+ ...bombArgs({
+ hiddenLabel: [true],
+ hint: ['Hintus textus', context.args.hint],
+ }),
+ ...bombArgs({
+ size: context.argTypes.size.options,
+ disabled: [false, true],
+ validation: context.argTypes.validation.options,
+ }),
+ ]
+ // remove disabled & validated examples
+ .filter((args: Args) => !(args.disabled && args.validation !== 'null'));
+
+ //Arguments for Multiple Version
+ const bombArgsGeneratedMultiple = [
+ ...bombArgs({
+ multiple: [true],
+ label: [
+ context.args.label,
+ 'Label - Lorem ipsum dolor sit amet consetetur sadipscing elitr sed diam nonumy eirmod tempor',
+ ],
+ hint: [''],
+ }),
+ ...bombArgs({
+ multiple: [true],
+ hiddenLabel: [true],
+ hint: ['', 'Hintus textus', context.args.hint],
+ }),
+ ...bombArgs({
+ multiple: [true],
+ size: context.argTypes.size.options,
+ disabled: [false, true],
+ validation: context.argTypes.validation.options,
+ }),
+ ]
+ // remove disabled & validated examples
+ .filter((args: Args) => !(args.disabled && args.validation !== 'null'));
+
+ return html`
+
+ ${['bg-white', 'bg-dark'].map(
+ bg =>
+ html`
+
+
Default
+ ${bombArgsGeneratedDefault.map(
+ (args: Args) =>
+ html`
+
+ ${Default.render?.({ ...context.args, ...Default.args, ...args }, context)}
+
+ `,
+ )}
+
Floating Label
+ ${bombArgsGeneratedDefault.map(
+ (args: Args) =>
+ html`
+
+ ${FloatingLabel.render?.(
+ { ...context.args, ...FloatingLabel.args, ...args },
+ context,
+ )}
+
+ `,
+ )}
+
Multiple - Default
+ ${bombArgsGeneratedMultiple.map(
+ (args: Args) =>
+ html`
+
+ ${Default.render?.({ ...context.args, ...Default.args, ...args }, context)}
+
+ `,
+ )}
+
Multiple - Floating Label
+ ${bombArgsGeneratedMultiple.map(
+ (args: Args) =>
+ html`
+
+ ${FloatingLabel.render?.(
+ { ...context.args, ...FloatingLabel.args, ...args },
+ context,
+ )}
+
+ `,
+ )}
+
+ `,
+ )}
+
+ `;
+ },
+};
From 442218663dea5523e32435757c4f8bbb6da89880 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aliz=C3=A9=20Debray?=
<33580481+alizedebray@users.noreply.github.com>
Date: Thu, 17 Aug 2023 16:25:50 +0200
Subject: [PATCH 15/16] chore(documentation-v7): migrate the internet header
component stories (#1822)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Philipp Gfeller <1659006+gfellerph@users.noreply.github.com>
Co-authored-by: Loïc Fürhoff <12294151+imagoiq@users.noreply.github.com>
---
.../helpers/register-web-components.ts | 30 ++-
.../documentation-v7/.storybook/preview.ts | 14 +-
.../components/internet-header.docs.mdx | 54 ++++
.../components/internet-header.stories.tsx | 241 ++++++++++++++++++
.../components/internet-header.styles.scss | 32 +++
.../internet-header/getting-started.docs.mdx | 113 ++++++++
.../internet-header/migration-guide.docs.mdx | 195 ++++++++++++++
.../post-klp-login-widget.tsx | 2 +-
packages/internet-header/stencil.config.ts | 7 +
pnpm-lock.yaml | 2 +-
10 files changed, 665 insertions(+), 25 deletions(-)
create mode 100644 packages/documentation-v7/src/stories/internet-header/components/internet-header.docs.mdx
create mode 100644 packages/documentation-v7/src/stories/internet-header/components/internet-header.stories.tsx
create mode 100644 packages/documentation-v7/src/stories/internet-header/components/internet-header.styles.scss
create mode 100644 packages/documentation-v7/src/stories/internet-header/getting-started.docs.mdx
create mode 100644 packages/documentation-v7/src/stories/internet-header/migration-guide.docs.mdx
diff --git a/packages/documentation-v7/.storybook/helpers/register-web-components.ts b/packages/documentation-v7/.storybook/helpers/register-web-components.ts
index a09a50def5..c5963a748c 100644
--- a/packages/documentation-v7/.storybook/helpers/register-web-components.ts
+++ b/packages/documentation-v7/.storybook/helpers/register-web-components.ts
@@ -1,14 +1,22 @@
-import { defineCustomElements, JSX as LocalJSX } from '@swisspost/design-system-components/loader';
-import { HTMLAttributes } from 'react';
+import { defineCustomElements as defineInternetHeader } from '@swisspost/internet-header/loader';
+import { defineCustomElements as definePostComponent } from '@swisspost/design-system-components/loader';
+import { setStencilDocJson } from '@pxtrn/storybook-addon-docs-stencil';
+import { StencilJsonDocs, StencilJsonDocsComponent } from '@pxtrn/storybook-addon-docs-stencil/dist/types';
+import postComponentsDocJson from '@swisspost/design-system-components/dist/docs.json';
+import internetHeaderDocJson from '@swisspost/internet-header/dist/docs.json';
-type StencilToReact = {
- [P in keyof T]?: T[P] & Omit, 'className'> & { class?: string };
-};
+defineInternetHeader(window);
+definePostComponent(window);
-declare global {
- export namespace JSX {
- interface IntrinsicElements extends StencilToReact {}
- }
-}
+if (postComponentsDocJson && internetHeaderDocJson) {
+ const jsonDocs: StencilJsonDocs = {
+ timestamp: postComponentsDocJson.timestamp,
+ compiler: postComponentsDocJson.compiler,
+ components: [
+ ...postComponentsDocJson.components,
+ ...internetHeaderDocJson.components
+ ] as StencilJsonDocsComponent[],
+ };
-defineCustomElements(window);
+ setStencilDocJson(jsonDocs);
+}
diff --git a/packages/documentation-v7/.storybook/preview.ts b/packages/documentation-v7/.storybook/preview.ts
index 9eb4868e07..8d05d53869 100644
--- a/packages/documentation-v7/.storybook/preview.ts
+++ b/packages/documentation-v7/.storybook/preview.ts
@@ -1,11 +1,6 @@
import type { Preview } from '@storybook/web-components';
-import {
- extractArgTypes,
- extractComponentDescription,
- setStencilDocJson,
-} from '@pxtrn/storybook-addon-docs-stencil';
-import { StencilJsonDocs } from '@pxtrn/storybook-addon-docs-stencil/dist/types';
+import { extractArgTypes, extractComponentDescription } from '@pxtrn/storybook-addon-docs-stencil';
import { format } from 'prettier';
import DocsLayout from './blocks/layout';
import { badgesConfig, prettierOptions, resetComponents } from './helpers';
@@ -18,10 +13,6 @@ import scss from 'react-syntax-highlighter/dist/esm/languages/prism/scss';
SyntaxHighlighter.registerLanguage('scss', scss);
-import docJson from '@swisspost/design-system-components/dist/docs.json';
-
-if (docJson) setStencilDocJson(docJson as StencilJsonDocs);
-
const preview: Preview = {
parameters: {
options: {
@@ -34,7 +25,7 @@ const preview: Preview = {
['Typography', 'Color', 'Layout', 'Elevation', 'Accessibility'],
'Components',
'Internet Header',
- ['Getting started', 'Migration Guide', 'Components', ['Header', 'Breadcrumbs', 'Footer']],
+ ['Getting started', 'Migration Guide', 'Header Component', 'Breadcrumbs Component', 'Footer Component'],
'Intranet Header',
['Getting started'],
'Icons',
@@ -55,7 +46,6 @@ const preview: Preview = {
},
components: resetComponents,
extractArgTypes,
- extractComponentDescription,
},
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
diff --git a/packages/documentation-v7/src/stories/internet-header/components/internet-header.docs.mdx b/packages/documentation-v7/src/stories/internet-header/components/internet-header.docs.mdx
new file mode 100644
index 0000000000..4be69ee0f9
--- /dev/null
+++ b/packages/documentation-v7/src/stories/internet-header/components/internet-header.docs.mdx
@@ -0,0 +1,54 @@
+import { Canvas, ArgTypes, Meta } from '@storybook/blocks';
+import * as InternetHeaderStories from './internet-header.stories';
+
+
+
+# Header
+
+
+ Customizable navigation header tailored for Swiss Post customer-facing applications,
+ ensuring complete accessibility and responsiveness.
+
+
+The `` element needs
+to be nested directly inside the `` for the sticky scrolling to work.
+
+If you want to render the header element with Angular,
+have a look at [portals](https://medium.com/angular-in-depth/how-do-cdk-portals-work-7c097c14a494).
+
+
+ Open Header in New Tab
+
+
+
+
+
+
+## Examples
+
+### Custom Navigation Item
+
+
+
+### Custom Online Service Flyout
+
+
+
+### Full Width
+
+By default, on viewports with a width greater than 1440px, header content is padded right and left.
+To make the header span the full width of the viewport, set the `full-width` property to `true`.
+
+
+ See Fullwidth Header
+
diff --git a/packages/documentation-v7/src/stories/internet-header/components/internet-header.stories.tsx b/packages/documentation-v7/src/stories/internet-header/components/internet-header.stories.tsx
new file mode 100644
index 0000000000..d2b80ec41b
--- /dev/null
+++ b/packages/documentation-v7/src/stories/internet-header/components/internet-header.stories.tsx
@@ -0,0 +1,241 @@
+import { Args, Meta, StoryObj } from '@storybook/web-components';
+import { html } from 'lit';
+import { spread } from '@open-wc/lit-helpers';
+import { BADGE } from '../../../../.storybook/constants';
+import './internet-header.styles.scss';
+
+const meta: Meta = {
+ title: 'Internet Header/Header Component',
+ component: 'swisspost-internet-header',
+ render: renderInternetHeader,
+ parameters: {
+ layout: 'fullscreen',
+ actions: {
+ handles: ['headerLoaded', 'languageChanged'],
+ },
+ badges: [BADGE.STABLE],
+ controls: {
+ exclude: ['config-proxy']
+ },
+ },
+ args: {
+ 'project': 'test'
+ },
+ argTypes: {
+ activeRoute: {
+ name: 'active-route',
+ control: 'text',
+ },
+ customConfig: {
+ name: 'custom-config',
+ control: 'object',
+ },
+ language: {
+ control: 'select',
+ options: ['de', 'fr', 'it', 'en'],
+ },
+ languageCookieKey: {
+ name: 'language-cookie-key',
+ control: 'text',
+ },
+ languageLocalStorageKey: {
+ name: 'language-local-storage-key',
+ control: 'text',
+ },
+ languageSwitchOverrides: {
+ name: 'language-switch-overrides',
+ control: 'object',
+ },
+ osFlyoutOverrides: {
+ name: 'os-flyout-overrides',
+ control: 'object',
+ },
+ stickyness: {
+ control: 'select',
+ },
+ },
+};
+
+export default meta;
+
+// DECORATORS
+function mockPage(story: any) {
+ return html`
+
+ ${story()}
+
+
+ Swiss Post Internet Header
+
+
+
+
+
+ `;
+}
+
+// RENDERER
+function renderInternetHeader(args: HTMLSwisspostInternetHeaderElement) {
+ const attributes = getAttributes(args, arg => arg !== null && arg !== undefined);
+ return html`
+
+ `;
+}
+
+// STORIES
+type Story = StoryObj;
+
+export const Default: Story = {
+ decorators: [ mockPage ],
+ parameters: {
+ docs: {
+ story: {
+ inline: false,
+ height: '40em',
+ },
+ },
+ },
+};
+
+export const FullWidth: Story = {
+ decorators: [ mockPage ],
+ args: {
+ fullWidth: true,
+ },
+};
+
+export const CustomNavigation: Story = {
+ args: {
+ customConfig: {
+ de: {
+ header: {
+ navMain: [
+ {
+ title: 'Meine Links (custom config)',
+ text: 'Meine Links',
+ url: '#',
+ flyout: [
+ {
+ title: 'Google',
+ linkList: [
+ { url: 'https://maps.google.com', title: 'Google Maps', target: '_blank' },
+ { url: 'https://translate.google.com', title: 'Google Translate' },
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ },
+ fr: {
+ header: {
+ navMain: [
+ {
+ title: 'Meine Links (custom config)',
+ text: 'Meine Links',
+ url: '#',
+ flyout: [
+ {
+ title: 'Google',
+ linkList: [
+ { url: 'https://maps.google.com', title: 'Google Maps', target: '_blank' },
+ { url: 'https://translate.google.com', title: 'Google Translate' },
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ },
+ it: {
+ header: {
+ navMain: [
+ {
+ title: 'Meine Links (custom config)',
+ text: 'Meine Links',
+ url: '#',
+ flyout: [
+ {
+ title: 'Google',
+ linkList: [
+ { url: 'https://maps.google.com', title: 'Google Maps', target: '_blank' },
+ { url: 'https://translate.google.com', title: 'Google Translate' },
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ },
+ en: {
+ header: {
+ navMain: [
+ {
+ title: 'Meine Links (custom config)',
+ text: 'Meine Links',
+ url: '#',
+ flyout: [
+ {
+ title: 'Google',
+ linkList: [
+ { url: 'https://maps.google.com', title: 'Google Maps', target: '_blank' },
+ { url: 'https://translate.google.com', title: 'Google Translate' },
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ },
+ },
+ },
+};
+
+export const CustomOnlineServiceFlyout: Story = {
+ args: {
+ osFlyoutOverrides: {
+ title: 'Custom OS Flyout',
+ text: 'Custom OS Flyout',
+ url: '#',
+ flyout: [
+ {
+ title: 'A title',
+ linkList: [
+ {
+ url: '#bla',
+ title: 'Another link',
+ },
+ ],
+ },
+ {
+ title: 'Another column',
+ linkList: [
+ {
+ url: '#foo',
+ title: 'Foo',
+ },
+ ],
+ },
+ ],
+ },
+ },
+};
+
+// TODO: move to utils
+const getAttributes = (args: Args, condition?: (arg: any) => boolean): Args => {
+ const attrs: { [key: string]: any } = {};
+
+ for (const key in args) {
+ if (args.hasOwnProperty(key) && condition && condition(args[key])) {
+ const attrKey = key.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
+
+ // Cast boolean false to string so it's displayed in the docs code block. False values are otherwise omitted
+ attrs[attrKey] = args[key] === false ? 'false' : args[key];
+ if (typeof args[key] === 'object') {
+ attrs[attrKey] = JSON.stringify(args[key]);
+ }
+ }
+ }
+
+ return attrs;
+};
diff --git a/packages/documentation-v7/src/stories/internet-header/components/internet-header.styles.scss b/packages/documentation-v7/src/stories/internet-header/components/internet-header.styles.scss
new file mode 100644
index 0000000000..9b64d999be
--- /dev/null
+++ b/packages/documentation-v7/src/stories/internet-header/components/internet-header.styles.scss
@@ -0,0 +1,32 @@
+.docs-story {
+ > div:first-child {
+ overflow: hidden;
+ }
+
+ > div:nth-child(2) {
+ z-index: 1000;
+ }
+}
+
+// Used for internet header stories
+.fake-content {
+ position: relative;
+ min-height: calc(1.6rem * 8);
+ background: repeating-linear-gradient(
+ rgb(230, 230, 230),
+ rgb(230, 230, 230) 1rem,
+ transparent 1rem,
+ transparent 1.6rem
+ );
+
+ &::after {
+ content: '';
+ background: white;
+ width: 33%;
+ height: 1.7rem;
+ display: block;
+ position: absolute;
+ bottom: 0;
+ right: 0;
+ }
+}
diff --git a/packages/documentation-v7/src/stories/internet-header/getting-started.docs.mdx b/packages/documentation-v7/src/stories/internet-header/getting-started.docs.mdx
new file mode 100644
index 0000000000..5da7c225be
--- /dev/null
+++ b/packages/documentation-v7/src/stories/internet-header/getting-started.docs.mdx
@@ -0,0 +1,113 @@
+import { Meta } from '@storybook/blocks';
+import { BADGE } from '../../../.storybook/constants';
+
+
+
+# @swisspost/internet-header
+
+[![npm version](https://badge.fury.io/js/@swisspost%2Finternet-header.svg)](https://badge.fury.io/js/@swisspost%2Finternet-header)
+
+The header for client-facing applications.
+
+- [Installation](#installation)
+- [Configuration](#configuration)
+- [Help](#help)
+
+## Installation
+
+### Angular, Vue JS, React (or any other bundler setup)
+
+All the popular frameworks come with some form of bundler.
+This makes it easy to use npm packages like the Internet Header as you can import,
+bundle and deliver the header with your own code.
+
+When working with Angular or any other framework, the easiest installation method is via npm.
+
+```shell
+npm install @swisspost/internet-header
+```
+
+```typescript
+// main.ts / index.js / ...
+import { defineCustomElements } from '@swisspost/internet-header';
+
+defineCustomElements();
+```
+
+```html
+
+
+
+ ...
+
+```
+
+### Include from a CDN
+
+If you are not using any loader or don't want to install from npm,
+you can load the `internet-header` from your favourite
+[CDN](https://en.wikipedia.org/wiki/Content_delivery_network).
+There are two options available.
+Make sure to replace `{version}` with the version you want to use.
+
+- [jsDelivr](https://www.jsdelivr.com/)
+- [unpkg](https://unpkg.com/)
+
+#### jsDelivr
+
+```html
+
+
+
+
+
+
+
+```
+
+```javascript
+// main.js | main.ts
+import { defineCustomElements } from 'https://cdn.jsdelivr.net/npm/@swisspost/internet-header@{version}/loader/index.min.js';
+
+defineCustomElements();
+```
+
+#### unpkg
+
+```javascript
+// main.js | main.ts
+import { defineCustomElements } from 'https://unpkg.com/@swisspost/internet-header@{version}/loader/index.min.js';
+
+defineCustomElements();
+```
+
+## Configuration
+
+The Internet Header is built to support the already existing Portal Configuration used for the old Internet Header.
+
+If you're working on a new project, you probably need a new configuration. Please click the button below.
+
+Contact Post Portal Team
+
+Not every Online Service has configurations for all environments.
+For example, "TOPOS" only has `int02` configured and cannot use `int01` as value for environment.
+If you are not sure what's configured for your project, please reach out to the post-portal team as well.
+
+For settings on the header itself, see the examples provided in the left menu bar.
+
+## Help
+
+If you noticed a bug or need assistance with migrating to the new Internet Header,
+please post your enquiry at the [Design System GitHub Discussions](https://github.com/swisspost/design-system/discussions/categories/q-a).
diff --git a/packages/documentation-v7/src/stories/internet-header/migration-guide.docs.mdx b/packages/documentation-v7/src/stories/internet-header/migration-guide.docs.mdx
new file mode 100644
index 0000000000..59819e4702
--- /dev/null
+++ b/packages/documentation-v7/src/stories/internet-header/migration-guide.docs.mdx
@@ -0,0 +1,195 @@
+import { Meta } from '@storybook/blocks';
+import { BADGE } from '../../../.storybook/constants';
+
+
+
+# Migration from the old header
+
+This guide aims to give a broad overview of how a migration can be performed.
+Different projects have different levels of integration with the header,
+and therefore require more steps to migrate.
+
+## Architecture
+
+The "new"
+Internet Header Web Component aims
+to encapsulate as much as possible whereas the old header had a big influence on the page —
+limiting design decisions and flexibility of the markup structure.
+The Web Component Header consists of one script and three standard Web Components that can be freely placed on the page.
+It's even possible to render those elements with Angular
+(or any other framework) to easier pass settings into the component.
+
+The new header is built
+to work with the existing Sitecore configuration
+already existing for your project to make the migration as smooth as possible.
+
+## Support
+
+If you need support during your migration,
+don't hesitate
+to contact the [Design System Team](https://github.com/swisspost/design-system/discussions/categories/general) on GitHub.
+
+## 1. Remove the old header
+
+In your index.html, you should find three scripts associated with the old header.
+One to load static assets, one to configure it and one to load it.
+
+- You can remove the configuration and the loader scripts, but remember your `serviceid`.
+- Try to remove the `staticassets` script to check if you still need it
+
+```html
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
+## 2. Fix your app styles
+
+The old header was responsible for wrapping your main code (here `#os_content`) with custom ``s.
+The new header does not provide those wrappers.
+Instead, every page has control over the main markup structure.
+A possible replacement of the above code could be:
+
+```html
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
+- Likely you'll need the class `container` around your main content to align it properly in the center.
+- For bonus points on semantic markup, use the [`
` tag](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/main) around the main page content
+- Check if you need the `staticasset` stylesheets linked in the header
+
+If you need to do any other changes,
+please make a post to the [Design System Teams Channel](https://teams.microsoft.com/l/channel/19%3ae7fa68fb13eb40b4bf4604edea5f4b3e%40thread.tacv2/%25F0%259F%259A%2591%2520Support?groupId=123c7c9e-052a-40e6-98d3-6cc6d46bad0a&tenantId=3ae7c479-0cf1-47f4-8f84-929f364eff67)
+in order to inform the devs to update this guide and provide useful information for other developers.
+
+## 3. jQuery
+
+The new Header does not ship jQuery anymore.
+While jQuery v3.6 is an internal dependency for the Login Widget,
+every project is now responsible for loading and updating jQuery individually.
+If you are depending on an older (<3.5) version of jQuery, please update.
+There is a long list of [known jQuery vulnerabilities](https://security.snyk.io/package/npm/jquery).
+
+## 4. Install the new header
+
+Please refer to the [Internet Header installation instructions](/story/getting-started--page) for an installation guide.
+
+After installation, you're ready to add the new tags to your markup:
+
+```html
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
+Place the new elements as described (and needed) as shown above.
+The breadcrumbs need a `container` wrapper to align themselves with the content of your page,
+the header and the footer already provide a container.
+If you don't have breadcrumbs, you can just delete the `` and the ``.
+
+## 5. Working with the new header
+
+If you need to change settings during runtime, you can get a reference to the header by querying:
+
+```ts
+const header = document.querySelector(
+ 'swisspost-internet-header',
+);
+
+// Toggle search
+header.search = false;
+
+// Set new custom config
+header.customConfig = {
+ /* ... */
+};
+```
+
+At the [Internet Header configuration page](/story/header-usage--page) you can find a list of possible options.
diff --git a/packages/internet-header/src/components/post-klp-login-widget/post-klp-login-widget.tsx b/packages/internet-header/src/components/post-klp-login-widget/post-klp-login-widget.tsx
index 4101e2e8ad..16a11d6cea 100644
--- a/packages/internet-header/src/components/post-klp-login-widget/post-klp-login-widget.tsx
+++ b/packages/internet-header/src/components/post-klp-login-widget/post-klp-login-widget.tsx
@@ -19,7 +19,7 @@ export class PostKlpLoginWidget implements IsFocusable {
!state.localizedConfig?.header?.loginWidgetOptions
)
return;
- const { initializeKLPLoginWidget } = await import('./klp-widget.controller');
+ const { initializeKLPLoginWidget } = await import('./klp-widget.controller.js');
initializeKLPLoginWidget('post-klp-login-widget', {
...state.localizedConfig.header.loginWidgetOptions,
environment: state.environment,
diff --git a/packages/internet-header/stencil.config.ts b/packages/internet-header/stencil.config.ts
index 27afc52250..580578252d 100644
--- a/packages/internet-header/stencil.config.ts
+++ b/packages/internet-header/stencil.config.ts
@@ -33,6 +33,10 @@ export const config: Config = {
type: 'www',
serviceWorker: null, // disable service workers,
},
+ {
+ type: 'docs-json',
+ file: 'dist/docs.json',
+ },
],
plugins: [
sass({
@@ -46,4 +50,7 @@ export const config: Config = {
}),
],
},
+ extras: {
+ enableImportInjection: true,
+ }
};
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index c43d824215..bbe9a8c334 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1,4 +1,4 @@
-lockfileVersion: '6.0'
+lockfileVersion: '6.1'
settings:
autoInstallPeers: true
From b39c0520405bcc046cb6c88bd2611d80f4cf9cbe Mon Sep 17 00:00:00 2001
From: Philipp Gfeller <1659006+gfellerph@users.noreply.github.com>
Date: Mon, 21 Aug 2023 08:12:05 +0200
Subject: [PATCH 16/16] docs: replace documentation package with documentation
v7 (#1831)
---
...on-v7.yaml => build-documentation-v6.yaml} | 18 +-
...n-v7.yaml => deploy-documentation-v6.yaml} | 8 +-
package.json | 14 +-
packages/documentation-v6/.gitignore | 2 +
.../.percy.yml | 0
.../.storybook/components/docs/footer.tsx | 0
.../.storybook/components/docs}/header.tsx | 0
.../.storybook/components/docs/layout.scss | 0
.../.storybook/components/docs/layout.tsx | 0
.../.storybook/main.js | 4 +-
.../.storybook/manager-head.html | 50 +-
.../.storybook/manager.js | 0
.../.storybook/manager.scss | 0
.../.storybook/post-themes.js | 0
.../.storybook/preview-head.html | 11 +
.../.storybook/preview.js | 0
.../.storybook/preview.scss | 0
.../CHANGELOG.md | 27 +-
.../CONTRIBUTING.md | 2 +-
.../LICENSE | 0
.../README.md | 7 +-
.../cypress.config.js | 0
.../cypress.snapshot.config.js | 0
.../components/collapsible.snapshot.ts | 2 +-
.../internet-header/breadcrumbs.snapshot.ts | 0
.../internet-header/footer.snapshot.ts | 0
.../internet-header/header.snapshot.ts | 0
.../snapshots/styles/alert.snapshot.ts | 0
.../snapshots/styles/blockquote.snapshot.ts | 0
.../snapshots/styles/button.snapshot.ts | 0
.../cypress/snapshots/styles/card.snapshot.ts | 0
.../snapshots/styles/choice-card.snapshot.ts | 0
.../snapshots/styles/headings.snapshot.ts | 0
.../cypress/support/commands.ts | 0
.../cypress/support/e2e.ts | 2 +
.../cypress/support/index.d.ts | 0
.../documentation-v6/cypress/tsconfig.json | 15 +
packages/documentation-v6/package.json | 67 ++
.../public/android-chrome-192x192.png | Bin
.../public/android-chrome-512x512.png | Bin
.../public/apple-touch-icon.png | Bin
.../assets/config/test-configuration.json | 8 +-
.../public/favicon.ico | Bin
.../public/favicon.svg | 0
.../public/images/header.png | Bin
.../public/images/logo-swisspost.svg | 0
.../public/images/packages/components.svg | 0
.../public/images/packages/icons.svg | 0
.../images/packages/internet-header.svg | 0
.../images/packages/intranet-header.svg | 0
.../public/images/packages/styles.svg | 0
.../images/technologies/logo-angular.svg | 0
.../images/technologies/logo-bootstrap.svg | 0
.../images/technologies/logo-changesets.png | Bin
.../images/technologies/logo-cypress.svg | 0
.../public/images/technologies/logo-figma.svg | 0
.../images/technologies/logo-github.svg | 0
.../public/images/technologies/logo-gulp.svg | 0
.../public/images/technologies/logo-jest.svg | 0
.../public/images/technologies/logo-percy.svg | 0
.../public/images/technologies/logo-pnpm.svg | 0
.../public/images/technologies/logo-react.svg | 0
.../public/images/technologies/logo-sass.svg | 0
.../images/technologies/logo-stencil.png | Bin
.../images/technologies/logo-storybook.svg | 0
.../public/images/technologies/logo-svgo.svg | 0
.../public/images/technologies/logo-vue.svg | 0
.../images/technologies/logo-webpack.svg | 0
.../public/netlify.toml | 0
.../public/site.webmanifest | 0
.../stories/Templates/forms/forms.stories.mdx | 0
.../alert/alert-snapshot.stories.mdx | 0
.../stories/components/alert/alert.docs.mdx | 49 +-
.../components/alert/alert.stories.tsx | 0
.../components/alert/getAlertClasses.tsx | 0
.../stories/components/badge/badge.docs.mdx | 52 +
.../components/badge/badge.stories.tsx | 0
.../components/blockquote/blockquote.docs.mdx | 30 +-
.../blockquote.snapshot.stories.mdx | 0
.../blockquote/blockquote.stories.tsx | 0
.../button-group/button-group.docs.mdx | 31 +-
.../button-group/button-group.stories.tsx | 0
.../button/button-snapshot.stories.mdx | 0
.../stories/components/button/button.docs.mdx | 35 +-
.../components/button/button.stories.tsx | 2 +-
.../src/stories/components/card/card.docs.mdx | 85 ++
.../components/card/card.snapshot.stories.mdx | 0
.../stories/components/card/card.stories.tsx | 0
.../components/checkbox/checkbox.docs.mdx | 82 ++
.../components/checkbox/checkbox.stories.tsx | 0
.../checkbox-card.docs.mdx | 0
.../checkbox-card.stories.tsx | 0
.../choice-card-snapshot.stories.mdx | 0
.../choice-control-card/choice-card.tsx | 0
.../radio-button-card.docs.mdx | 0
.../radio-button-card.stories.tsx | 0
.../collapsible/collapsible.docs.mdx | 31 +-
.../collapsible/collapsible.stories.tsx | 0
.../components/heading/heading.docs.mdx | 35 +
.../heading/heading.snapshot.stories.mdx | 0
.../components/heading/heading.stories.tsx | 0
.../input-group/input-group.docs.mdx | 8 +
.../input-group/input-group.stories.tsx | 0
.../stories/components/input/input.docs.mdx | 37 +-
.../components/input/input.stories.tsx | 0
.../stories/components/radio/radio.docs.mdx | 31 +-
.../components/radio/radio.stories.tsx | 0
.../stories/components/range/range.docs.mdx | 30 +-
.../components/range/range.stories.tsx | 0
.../stories/components/select/select.docs.mdx | 31 +-
.../components/select/select.stories.tsx | 0
.../stories/components/switch/switch.docs.mdx | 29 +-
.../components/switch/switch.stories.tsx | 0
.../stories/components/table/table.docs.mdx | 23 +-
.../components/table/table.stories.tsx | 0
.../components/textarea/textarea.docs.mdx | 35 +-
.../components/textarea/textarea.stories.tsx | 0
.../stories/components/toast/toast.docs.mdx | 30 +-
.../components/toast/toast.stories.tsx | 0
.../topic-teaser/topic-teaser.docs.mdx | 19 +-
.../topic-teaser/topic-teaser.stories.tsx | 0
.../foundation/accessibility.stories.mdx | 0
.../stories/foundation/color/color-swatch.tsx | 0
.../foundation/color/color.stories.mdx | 0
.../foundation/color/color.styles.scss | 32 +
.../foundation/elevation/elevation-tile.tsx | 0
.../elevation/elevation.stories.mdx | 0
.../elevation/elevation.styles.scss | 1 -
.../layout/breakpoints/breakpoints.blocks.tsx | 1 +
.../breakpoints/breakpoints.module.scss | 0
.../breakpoints/breakpoints.stories.mdx | 0
.../foundation/layout/layout.stories.mdx | 0
.../typography/typography.components.scss | 0
.../typography/typography.components.tsx | 0
.../typography/typography.stories.mdx | 0
.../getting-started/components.stories.mdx | 0
.../getting-started/styles.stories.mdx | 0
.../src/stories/home.components.tsx | 0
.../src/stories/home.stories.mdx | 0
.../src/stories/home.styles.scss | 0
.../stories/icons/components/icon.docs.mdx | 84 ++
.../stories/icons/components/icon.stories.tsx | 0
.../stories/icons/getting-started.stories.mdx | 0
.../search-icons/search-icons.components.tsx | 0
.../search-icons/search-icons.stories.mdx | 0
.../search-icons/search-icons.styles.scss | 0
.../breadcrumbs/internet-breadcrumbs.docs.mdx | 0
.../post-internet-breadcrumbs.stories.tsx | 0
.../footer/internet-footer.docs.mdx | 0
.../footer/post-internet-footer.stories.tsx | 0
.../header/internet-header.docs.mdx | 0
.../header/internet-header.styles.scss | 0
.../header/post-internet-header.stories.tsx | 0
.../getting-started.stories.mdx | 0
.../migration-guide.stories.mdx | 0
.../getting-started.stories.mdx | 0
.../src/stories/misc/changelog.stories.mdx | 0
.../stories/misc/migration-guide.stories.mdx | 0
.../src/stories/misc/versions.components.tsx | 0
.../src/stories/misc/versions.stories.mdx | 0
.../background/background.components.scss | 0
.../background/background.components.tsx | 0
.../background/background.stories.mdx | 0
.../src/stories/utilities}/bombArgs.ts | 0
.../utilities/common/common.stories.mdx | 0
.../src/stories/utilities/filterArgs.ts | 0
.../src/stories/utilities/heading.stories.mdx | 0
.../stories/utilities/list/list.stories.mdx | 0
.../utilities/sizing/sizing.stories.mdx | 0
.../utilities/spacing/spacing.stories.mdx | 0
.../utilities/text/text.components.tsx | 0
.../stories/utilities/text/text.export.scss | 0
.../stories/utilities/text/text.stories.mdx | 0
.../src/types/component.d.ts | 0
.../src/types/mdx.d.ts | 0
.../src/utils/component-properties.ts | 0
.../src/utils/index.ts | 1 -
.../src/utils/react.ts | 0
.../src/utils/sass-export.ts | 0
.../utils/tests/component-properties.spec.ts | 0
.../src/utils/units.ts | 0
.../src/utils/version.ts | 0
.../tsconfig.json | 13 +-
packages/documentation-v7/.gitignore | 5 -
.../.storybook/preview-head.html | 16 -
.../documentation-v7/cypress/e2e/home.cy.ts | 9 -
.../documentation-v7/cypress/tsconfig.json | 9 -
packages/documentation-v7/package.json | 69 --
.../stories/components/badge/badge.docs.mdx | 47 -
.../src/stories/components/card/card.docs.mdx | 66 --
.../components/checkbox/checkbox.docs.mdx | 82 --
.../components/heading/heading.docs.mdx | 35 -
.../input-group/input-group.docs.mdx | 11 -
.../stories/icons/components/icon.docs.mdx | 76 --
packages/documentation/.gitignore | 5 +-
.../.storybook/blocks/footer.tsx | 0
.../{components/docs => blocks}/header.tsx | 0
.../.storybook/blocks/layout.tsx | 0
.../.storybook/constants.ts | 0
.../.storybook/helpers/bages-config.ts | 0
.../.storybook/helpers/index.ts | 0
.../.storybook/helpers/prettier-options.ts | 0
.../helpers/register-web-components.ts | 0
.../helpers/reset-sb-styled-components.ts | 0
.../.storybook/main.ts | 0
.../.storybook/manager-head.html | 50 +-
.../.storybook/manager.ts | 0
.../.storybook/preview-head.html | 9 +-
.../.storybook/preview.ts | 0
.../.storybook/styles/layout.scss | 0
.../.storybook/styles/manager.scss | 0
.../.storybook/styles/preview.scss | 0
.../.storybook/styles/themes.ts | 0
packages/documentation/CHANGELOG.md | 27 +-
packages/documentation/CONTRIBUTING.md | 2 +-
packages/documentation/README.md | 7 +-
packages/documentation/cypress/e2e/home.cy.ts | 5 +-
.../snapshots/components/alert.snapshot.ts | 0
.../components/blockquote.snapshot.ts | 0
.../snapshots/components/button.snapshot.ts | 0
.../snapshots/components/card.snapshot.ts | 0
.../components/collapsible.snapshot.ts | 2 +-
.../snapshots/components/headings.snapshot.ts | 0
.../snapshots/components/select.snapshot.ts | 0
packages/documentation/cypress/support/e2e.ts | 2 -
packages/documentation/cypress/tsconfig.json | 8 +-
packages/documentation/package.json | 63 +-
.../assets/config/test-configuration.json | 8 +-
.../stories/components/alert/alert.docs.mdx | 49 +-
.../alert/alert.snapshot.stories.ts | 0
.../stories/components/alert/alert.stories.ts | 0
.../components/alert/getAlertClasses.ts | 0
.../stories/components/badge/badge.docs.mdx | 39 +-
.../stories/components/badge/badge.stories.ts | 0
.../components/blockquote/blockquote.docs.mdx | 30 +-
.../blockquote/blockquote.snapshot.stories.ts | 0
.../blockquote/blockquote.stories.ts | 0
.../button-group/button-group.docs.mdx | 31 +-
.../button-group/button-group.stories.ts | 0
.../stories/components/button/button.docs.mdx | 35 +-
.../button/button.snapshot.stories.ts | 0
.../components/button/button.stories.ts | 2 +-
.../src/stories/components/card/card.docs.mdx | 75 +-
.../components/card/card.snapshot.stories.ts | 0
.../stories/components/card/card.stories.ts | 0
.../components/checkbox/checkbox.docs.mdx | 74 +-
.../components/checkbox/checkbox.stories.ts | 0
.../choice-card/checkbox-card.docs.mdx | 0
.../choice-card/checkbox-card.stories.ts | 0
.../choice-control.snapshot.stories.ts | 0
.../components/choice-card/choice-control.ts | 0
.../choice-card/radiobutton-card.docs.mdx | 0
.../choice-card/radiobutton-card.stories.ts | 0
.../collapsible/collapsible.docs.mdx | 31 +-
.../collapsible.snapshot.stories.tsx | 0
.../collapsible/collapsible.stories.ts | 0
.../components/heading/heading.docs.mdx | 24 +-
.../heading/heading.snapshot.stories.ts | 0
.../components/heading/heading.stories.ts | 0
.../input-group/input-group.docs.mdx | 7 +-
.../input-group/input-group.stories.ts | 0
.../stories/components/input/input.docs.mdx | 37 +-
.../stories/components/input/input.stories.ts | 0
.../stories/components/radio/radio.docs.mdx | 31 +-
.../stories/components/radio/radio.stories.ts | 0
.../stories/components/range/range.docs.mdx | 30 +-
.../stories/components/range/range.stories.ts | 0
.../stories/components/select/select.docs.mdx | 31 +-
.../select/select.snapshot.stories.ts | 0
.../components/select/select.stories.ts | 0
.../stories/components/switch/switch.docs.mdx | 29 +-
.../components/switch/switch.stories.ts | 0
.../stories/components/table/table.docs.mdx | 23 +-
.../stories/components/table/table.stories.ts | 0
.../components/textarea/textarea.docs.mdx | 35 +-
.../components/textarea/textarea.stories.ts | 0
.../stories/components/toast/toast.docs.mdx | 30 +-
.../stories/components/toast/toast.stories.ts | 0
.../topic-teaser/topic-teaser.docs.mdx | 19 +-
.../topic-teaser/topic-teaser.stories.ts | 0
.../accessibility/accessibility.docs.mdx | 0
.../accessibility/accessibility.stories.ts | 0
.../stories/foundation/color/color.blocks.tsx | 0
.../stories/foundation/color/color.docs.mdx | 0
.../foundation/color/color.module.scss | 0
.../stories/foundation/color/color.stories.ts | 0
.../foundation/color/color.styles.scss | 32 -
.../foundation/elevation/elevation.blocks.tsx | 0
.../foundation/elevation/elevation.docs.mdx | 0
.../elevation/elevation.module.scss | 0
.../foundation/elevation/elevation.stories.ts | 0
.../elevation/elevation.styles.scss | 1 +
.../layout/breakpoints/breakpoints.blocks.tsx | 1 -
.../layout/breakpoints/breakpoints.docs.mdx | 0
.../layout/breakpoints/breakpoints.stories.ts | 0
.../stories/foundation/layout/layout.docs.mdx | 0
.../foundation/layout/layout.stories.ts | 0
.../typography/typography.blocks.tsx | 0
.../foundation/typography/typography.docs.mdx | 0
.../typography/typography.module.scss | 0
.../typography/typography.stories.ts | 0
.../typography/typography.styles.scss | 0
.../components/components.docs.mdx | 0
.../components/components.stories.ts | 0
.../getting-started/styles/styles.docs.mdx | 0
.../getting-started/styles/styles.stories.ts | 0
.../src/stories/home.blocks.tsx | 0
.../src/stories/home.docs.mdx | 0
.../stories/icons/components/icon.docs.mdx | 56 +-
.../stories/icons/components/icon.stories.ts | 0
.../stories/icons/getting-started.docs.mdx | 0
.../stories/icons/getting-started.stories.ts | 0
.../search-icons/search-icons.blocks.tsx | 0
.../icons/search-icons/search-icons.docs.mdx | 0
.../components/internet-header.docs.mdx | 0
.../components/internet-header.stories.tsx | 0
.../components/internet-header.styles.scss | 0
.../internet-header/getting-started.docs.mdx | 0
.../internet-header/migration-guide.docs.mdx | 0
.../intranet-header/intranet-header.docs.mdx | 0
.../intranet-header.stories.ts | 0
.../stories/misc/changelog/changelog.docs.mdx | 0
.../migration-guide/migration-guide.docs.mdx | 0
.../migration-guide.stories.ts | 0
.../stories/misc/versions/versions.blocks.tsx | 0
.../stories/misc/versions/versions.docs.mdx | 0
.../stories/misc/versions/versions.stories.ts | 0
.../stories/templates/forms/forms.docs.mdx | 0
.../stories/templates/forms/forms.stories.ts | 0
.../background/background.blocks.tsx | 0
.../utilities/background/background.docs.mdx | 0
.../background/background.module.scss | 0
.../background/background.stories.ts | 0
.../background/background.styles.scss | 0
.../src/stories/utilities/bombArgs.ts | 38 +-
.../stories/utilities/common/common.docs.mdx | 0
.../utilities/common/common.stories.ts | 0
.../utilities/heading/heading.docs.mdx | 0
.../utilities/heading/heading.stories.ts | 0
.../src/stories/utilities/list/list.docs.mdx | 0
.../stories/utilities/list/list.stories.ts | 0
.../stories/utilities/sizing/sizing.docs.mdx | 0
.../utilities/sizing/sizing.stories.ts | 0
.../utilities/spacing/spacing.docs.mdx | 0
.../utilities/spacing/spacing.stories.ts | 0
.../stories/utilities/text/text.blocks.tsx | 2 +-
.../src/stories/utilities/text/text.docs.mdx | 0
.../stories/utilities/text/text.module.scss | 0
.../stories/utilities/text/text.stories.ts | 0
.../src/utils}/bombArgs.ts | 38 +-
packages/documentation/src/utils/index.ts | 1 +
.../src/utils/map-classes.ts | 0
packages/documentation/src/utils/version.ts | 25 +-
packages/documentation/tsconfig.json | 13 +-
.../vite.config.js | 0
pnpm-lock.yaml | 975 +++++-------------
356 files changed, 1513 insertions(+), 2018 deletions(-)
rename .github/workflows/{build-documentation-v7.yaml => build-documentation-v6.yaml} (63%)
rename .github/workflows/{deploy-documentation-v7.yaml => deploy-documentation-v6.yaml} (86%)
create mode 100644 packages/documentation-v6/.gitignore
rename packages/{documentation => documentation-v6}/.percy.yml (100%)
rename packages/{documentation => documentation-v6}/.storybook/components/docs/footer.tsx (100%)
rename packages/{documentation-v7/.storybook/blocks => documentation-v6/.storybook/components/docs}/header.tsx (100%)
rename packages/{documentation => documentation-v6}/.storybook/components/docs/layout.scss (100%)
rename packages/{documentation => documentation-v6}/.storybook/components/docs/layout.tsx (100%)
rename packages/{documentation => documentation-v6}/.storybook/main.js (95%)
rename packages/{documentation-v7 => documentation-v6}/.storybook/manager-head.html (69%)
rename packages/{documentation => documentation-v6}/.storybook/manager.js (100%)
rename packages/{documentation => documentation-v6}/.storybook/manager.scss (100%)
rename packages/{documentation => documentation-v6}/.storybook/post-themes.js (100%)
create mode 100644 packages/documentation-v6/.storybook/preview-head.html
rename packages/{documentation => documentation-v6}/.storybook/preview.js (100%)
rename packages/{documentation => documentation-v6}/.storybook/preview.scss (100%)
rename packages/{documentation-v7 => documentation-v6}/CHANGELOG.md (96%)
rename packages/{documentation-v7 => documentation-v6}/CONTRIBUTING.md (97%)
rename packages/{documentation-v7 => documentation-v6}/LICENSE (100%)
rename packages/{documentation-v7 => documentation-v6}/README.md (79%)
rename packages/{documentation-v7 => documentation-v6}/cypress.config.js (100%)
rename packages/{documentation-v7 => documentation-v6}/cypress.snapshot.config.js (100%)
rename packages/{documentation-v7 => documentation-v6}/cypress/snapshots/components/collapsible.snapshot.ts (71%)
rename packages/{documentation => documentation-v6}/cypress/snapshots/internet-header/breadcrumbs.snapshot.ts (100%)
rename packages/{documentation => documentation-v6}/cypress/snapshots/internet-header/footer.snapshot.ts (100%)
rename packages/{documentation => documentation-v6}/cypress/snapshots/internet-header/header.snapshot.ts (100%)
rename packages/{documentation => documentation-v6}/cypress/snapshots/styles/alert.snapshot.ts (100%)
rename packages/{documentation => documentation-v6}/cypress/snapshots/styles/blockquote.snapshot.ts (100%)
rename packages/{documentation => documentation-v6}/cypress/snapshots/styles/button.snapshot.ts (100%)
rename packages/{documentation => documentation-v6}/cypress/snapshots/styles/card.snapshot.ts (100%)
rename packages/{documentation => documentation-v6}/cypress/snapshots/styles/choice-card.snapshot.ts (100%)
rename packages/{documentation => documentation-v6}/cypress/snapshots/styles/headings.snapshot.ts (100%)
rename packages/{documentation-v7 => documentation-v6}/cypress/support/commands.ts (100%)
rename packages/{documentation-v7 => documentation-v6}/cypress/support/e2e.ts (94%)
rename packages/{documentation-v7 => documentation-v6}/cypress/support/index.d.ts (100%)
create mode 100644 packages/documentation-v6/cypress/tsconfig.json
create mode 100644 packages/documentation-v6/package.json
rename packages/{documentation-v7 => documentation-v6}/public/android-chrome-192x192.png (100%)
rename packages/{documentation-v7 => documentation-v6}/public/android-chrome-512x512.png (100%)
rename packages/{documentation-v7 => documentation-v6}/public/apple-touch-icon.png (100%)
rename packages/{documentation-v7 => documentation-v6}/public/assets/config/test-configuration.json (99%)
rename packages/{documentation-v7 => documentation-v6}/public/favicon.ico (100%)
rename packages/{documentation-v7 => documentation-v6}/public/favicon.svg (100%)
rename packages/{documentation-v7 => documentation-v6}/public/images/header.png (100%)
rename packages/{documentation-v7 => documentation-v6}/public/images/logo-swisspost.svg (100%)
rename packages/{documentation-v7 => documentation-v6}/public/images/packages/components.svg (100%)
rename packages/{documentation-v7 => documentation-v6}/public/images/packages/icons.svg (100%)
rename packages/{documentation-v7 => documentation-v6}/public/images/packages/internet-header.svg (100%)
rename packages/{documentation-v7 => documentation-v6}/public/images/packages/intranet-header.svg (100%)
rename packages/{documentation-v7 => documentation-v6}/public/images/packages/styles.svg (100%)
rename packages/{documentation-v7 => documentation-v6}/public/images/technologies/logo-angular.svg (100%)
rename packages/{documentation-v7 => documentation-v6}/public/images/technologies/logo-bootstrap.svg (100%)
rename packages/{documentation-v7 => documentation-v6}/public/images/technologies/logo-changesets.png (100%)
rename packages/{documentation-v7 => documentation-v6}/public/images/technologies/logo-cypress.svg (100%)
rename packages/{documentation-v7 => documentation-v6}/public/images/technologies/logo-figma.svg (100%)
rename packages/{documentation-v7 => documentation-v6}/public/images/technologies/logo-github.svg (100%)
rename packages/{documentation-v7 => documentation-v6}/public/images/technologies/logo-gulp.svg (100%)
rename packages/{documentation-v7 => documentation-v6}/public/images/technologies/logo-jest.svg (100%)
rename packages/{documentation-v7 => documentation-v6}/public/images/technologies/logo-percy.svg (100%)
rename packages/{documentation-v7 => documentation-v6}/public/images/technologies/logo-pnpm.svg (100%)
rename packages/{documentation-v7 => documentation-v6}/public/images/technologies/logo-react.svg (100%)
rename packages/{documentation-v7 => documentation-v6}/public/images/technologies/logo-sass.svg (100%)
rename packages/{documentation-v7 => documentation-v6}/public/images/technologies/logo-stencil.png (100%)
rename packages/{documentation-v7 => documentation-v6}/public/images/technologies/logo-storybook.svg (100%)
rename packages/{documentation-v7 => documentation-v6}/public/images/technologies/logo-svgo.svg (100%)
rename packages/{documentation-v7 => documentation-v6}/public/images/technologies/logo-vue.svg (100%)
rename packages/{documentation-v7 => documentation-v6}/public/images/technologies/logo-webpack.svg (100%)
rename packages/{documentation-v7 => documentation-v6}/public/netlify.toml (100%)
rename packages/{documentation-v7 => documentation-v6}/public/site.webmanifest (100%)
rename packages/{documentation => documentation-v6}/src/stories/Templates/forms/forms.stories.mdx (100%)
rename packages/{documentation => documentation-v6}/src/stories/components/alert/alert-snapshot.stories.mdx (100%)
rename packages/{documentation-v7 => documentation-v6}/src/stories/components/alert/alert.docs.mdx (74%)
rename packages/{documentation => documentation-v6}/src/stories/components/alert/alert.stories.tsx (100%)
rename packages/{documentation => documentation-v6}/src/stories/components/alert/getAlertClasses.tsx (100%)
create mode 100644 packages/documentation-v6/src/stories/components/badge/badge.docs.mdx
rename packages/{documentation => documentation-v6}/src/stories/components/badge/badge.stories.tsx (100%)
rename packages/{documentation-v7 => documentation-v6}/src/stories/components/blockquote/blockquote.docs.mdx (65%)
rename packages/{documentation => documentation-v6}/src/stories/components/blockquote/blockquote.snapshot.stories.mdx (100%)
rename packages/{documentation => documentation-v6}/src/stories/components/blockquote/blockquote.stories.tsx (100%)
rename packages/{documentation-v7 => documentation-v6}/src/stories/components/button-group/button-group.docs.mdx (70%)
rename packages/{documentation => documentation-v6}/src/stories/components/button-group/button-group.stories.tsx (100%)
rename packages/{documentation => documentation-v6}/src/stories/components/button/button-snapshot.stories.mdx (100%)
rename packages/{documentation-v7 => documentation-v6}/src/stories/components/button/button.docs.mdx (64%)
rename packages/{documentation => documentation-v6}/src/stories/components/button/button.stories.tsx (99%)
create mode 100644 packages/documentation-v6/src/stories/components/card/card.docs.mdx
rename packages/{documentation => documentation-v6}/src/stories/components/card/card.snapshot.stories.mdx (100%)
rename packages/{documentation => documentation-v6}/src/stories/components/card/card.stories.tsx (100%)
create mode 100644 packages/documentation-v6/src/stories/components/checkbox/checkbox.docs.mdx
rename packages/{documentation => documentation-v6}/src/stories/components/checkbox/checkbox.stories.tsx (100%)
rename packages/{documentation => documentation-v6}/src/stories/components/choice-control-card/checkbox-card.docs.mdx (100%)
rename packages/{documentation => documentation-v6}/src/stories/components/choice-control-card/checkbox-card.stories.tsx (100%)
rename packages/{documentation => documentation-v6}/src/stories/components/choice-control-card/choice-card-snapshot.stories.mdx (100%)
rename packages/{documentation => documentation-v6}/src/stories/components/choice-control-card/choice-card.tsx (100%)
rename packages/{documentation => documentation-v6}/src/stories/components/choice-control-card/radio-button-card.docs.mdx (100%)
rename packages/{documentation => documentation-v6}/src/stories/components/choice-control-card/radio-button-card.stories.tsx (100%)
rename packages/{documentation-v7 => documentation-v6}/src/stories/components/collapsible/collapsible.docs.mdx (78%)
rename packages/{documentation => documentation-v6}/src/stories/components/collapsible/collapsible.stories.tsx (100%)
create mode 100644 packages/documentation-v6/src/stories/components/heading/heading.docs.mdx
rename packages/{documentation => documentation-v6}/src/stories/components/heading/heading.snapshot.stories.mdx (100%)
rename packages/{documentation => documentation-v6}/src/stories/components/heading/heading.stories.tsx (100%)
create mode 100644 packages/documentation-v6/src/stories/components/input-group/input-group.docs.mdx
rename packages/{documentation => documentation-v6}/src/stories/components/input-group/input-group.stories.tsx (100%)
rename packages/{documentation-v7 => documentation-v6}/src/stories/components/input/input.docs.mdx (74%)
rename packages/{documentation => documentation-v6}/src/stories/components/input/input.stories.tsx (100%)
rename packages/{documentation-v7 => documentation-v6}/src/stories/components/radio/radio.docs.mdx (76%)
rename packages/{documentation => documentation-v6}/src/stories/components/radio/radio.stories.tsx (100%)
rename packages/{documentation-v7 => documentation-v6}/src/stories/components/range/range.docs.mdx (71%)
rename packages/{documentation => documentation-v6}/src/stories/components/range/range.stories.tsx (100%)
rename packages/{documentation-v7 => documentation-v6}/src/stories/components/select/select.docs.mdx (83%)
rename packages/{documentation => documentation-v6}/src/stories/components/select/select.stories.tsx (100%)
rename packages/{documentation-v7 => documentation-v6}/src/stories/components/switch/switch.docs.mdx (80%)
rename packages/{documentation => documentation-v6}/src/stories/components/switch/switch.stories.tsx (100%)
rename packages/{documentation-v7 => documentation-v6}/src/stories/components/table/table.docs.mdx (69%)
rename packages/{documentation => documentation-v6}/src/stories/components/table/table.stories.tsx (100%)
rename packages/{documentation-v7 => documentation-v6}/src/stories/components/textarea/textarea.docs.mdx (81%)
rename packages/{documentation => documentation-v6}/src/stories/components/textarea/textarea.stories.tsx (100%)
rename packages/{documentation-v7 => documentation-v6}/src/stories/components/toast/toast.docs.mdx (86%)
rename packages/{documentation => documentation-v6}/src/stories/components/toast/toast.stories.tsx (100%)
rename packages/{documentation-v7 => documentation-v6}/src/stories/components/topic-teaser/topic-teaser.docs.mdx (69%)
rename packages/{documentation => documentation-v6}/src/stories/components/topic-teaser/topic-teaser.stories.tsx (100%)
rename packages/{documentation => documentation-v6}/src/stories/foundation/accessibility.stories.mdx (100%)
rename packages/{documentation => documentation-v6}/src/stories/foundation/color/color-swatch.tsx (100%)
rename packages/{documentation => documentation-v6}/src/stories/foundation/color/color.stories.mdx (100%)
rename packages/{documentation-v7 => documentation-v6}/src/stories/foundation/color/color.styles.scss (56%)
rename packages/{documentation => documentation-v6}/src/stories/foundation/elevation/elevation-tile.tsx (100%)
rename packages/{documentation => documentation-v6}/src/stories/foundation/elevation/elevation.stories.mdx (100%)
rename packages/{documentation-v7 => documentation-v6}/src/stories/foundation/elevation/elevation.styles.scss (90%)
rename packages/{documentation-v7 => documentation-v6}/src/stories/foundation/layout/breakpoints/breakpoints.blocks.tsx (89%)
rename packages/{documentation-v7 => documentation-v6}/src/stories/foundation/layout/breakpoints/breakpoints.module.scss (100%)
rename packages/{documentation => documentation-v6}/src/stories/foundation/layout/breakpoints/breakpoints.stories.mdx (100%)
rename packages/{documentation => documentation-v6}/src/stories/foundation/layout/layout.stories.mdx (100%)
rename packages/{documentation => documentation-v6}/src/stories/foundation/typography/typography.components.scss (100%)
rename packages/{documentation => documentation-v6}/src/stories/foundation/typography/typography.components.tsx (100%)
rename packages/{documentation => documentation-v6}/src/stories/foundation/typography/typography.stories.mdx (100%)
rename packages/{documentation => documentation-v6}/src/stories/getting-started/components.stories.mdx (100%)
rename packages/{documentation => documentation-v6}/src/stories/getting-started/styles.stories.mdx (100%)
rename packages/{documentation => documentation-v6}/src/stories/home.components.tsx (100%)
rename packages/{documentation => documentation-v6}/src/stories/home.stories.mdx (100%)
rename packages/{documentation-v7 => documentation-v6}/src/stories/home.styles.scss (100%)
create mode 100644 packages/documentation-v6/src/stories/icons/components/icon.docs.mdx
rename packages/{documentation => documentation-v6}/src/stories/icons/components/icon.stories.tsx (100%)
rename packages/{documentation => documentation-v6}/src/stories/icons/getting-started.stories.mdx (100%)
rename packages/{documentation => documentation-v6}/src/stories/icons/search-icons/search-icons.components.tsx (100%)
rename packages/{documentation => documentation-v6}/src/stories/icons/search-icons/search-icons.stories.mdx (100%)
rename packages/{documentation-v7 => documentation-v6}/src/stories/icons/search-icons/search-icons.styles.scss (100%)
rename packages/{documentation => documentation-v6}/src/stories/internet-header/components/breadcrumbs/internet-breadcrumbs.docs.mdx (100%)
rename packages/{documentation => documentation-v6}/src/stories/internet-header/components/breadcrumbs/post-internet-breadcrumbs.stories.tsx (100%)
rename packages/{documentation => documentation-v6}/src/stories/internet-header/components/footer/internet-footer.docs.mdx (100%)
rename packages/{documentation => documentation-v6}/src/stories/internet-header/components/footer/post-internet-footer.stories.tsx (100%)
rename packages/{documentation => documentation-v6}/src/stories/internet-header/components/header/internet-header.docs.mdx (100%)
rename packages/{documentation => documentation-v6}/src/stories/internet-header/components/header/internet-header.styles.scss (100%)
rename packages/{documentation => documentation-v6}/src/stories/internet-header/components/header/post-internet-header.stories.tsx (100%)
rename packages/{documentation => documentation-v6}/src/stories/internet-header/getting-started.stories.mdx (100%)
rename packages/{documentation => documentation-v6}/src/stories/internet-header/migration-guide.stories.mdx (100%)
rename packages/{documentation => documentation-v6}/src/stories/intranet-header/getting-started.stories.mdx (100%)
rename packages/{documentation => documentation-v6}/src/stories/misc/changelog.stories.mdx (100%)
rename packages/{documentation => documentation-v6}/src/stories/misc/migration-guide.stories.mdx (100%)
rename packages/{documentation => documentation-v6}/src/stories/misc/versions.components.tsx (100%)
rename packages/{documentation => documentation-v6}/src/stories/misc/versions.stories.mdx (100%)
rename packages/{documentation => documentation-v6}/src/stories/utilities/background/background.components.scss (100%)
rename packages/{documentation => documentation-v6}/src/stories/utilities/background/background.components.tsx (100%)
rename packages/{documentation => documentation-v6}/src/stories/utilities/background/background.stories.mdx (100%)
rename packages/{documentation-v7/src/utils => documentation-v6/src/stories/utilities}/bombArgs.ts (100%)
rename packages/{documentation => documentation-v6}/src/stories/utilities/common/common.stories.mdx (100%)
rename packages/{documentation => documentation-v6}/src/stories/utilities/filterArgs.ts (100%)
rename packages/{documentation => documentation-v6}/src/stories/utilities/heading.stories.mdx (100%)
rename packages/{documentation => documentation-v6}/src/stories/utilities/list/list.stories.mdx (100%)
rename packages/{documentation => documentation-v6}/src/stories/utilities/sizing/sizing.stories.mdx (100%)
rename packages/{documentation => documentation-v6}/src/stories/utilities/spacing/spacing.stories.mdx (100%)
rename packages/{documentation => documentation-v6}/src/stories/utilities/text/text.components.tsx (100%)
rename packages/{documentation => documentation-v6}/src/stories/utilities/text/text.export.scss (100%)
rename packages/{documentation => documentation-v6}/src/stories/utilities/text/text.stories.mdx (100%)
rename packages/{documentation => documentation-v6}/src/types/component.d.ts (100%)
rename packages/{documentation => documentation-v6}/src/types/mdx.d.ts (100%)
rename packages/{documentation-v7 => documentation-v6}/src/utils/component-properties.ts (100%)
rename packages/{documentation-v7 => documentation-v6}/src/utils/index.ts (56%)
rename packages/{documentation-v7 => documentation-v6}/src/utils/react.ts (100%)
rename packages/{documentation-v7 => documentation-v6}/src/utils/sass-export.ts (100%)
rename packages/{documentation => documentation-v6}/src/utils/tests/component-properties.spec.ts (100%)
rename packages/{documentation-v7 => documentation-v6}/src/utils/units.ts (100%)
rename packages/{documentation-v7 => documentation-v6}/src/utils/version.ts (100%)
rename packages/{documentation-v7 => documentation-v6}/tsconfig.json (72%)
delete mode 100644 packages/documentation-v7/.gitignore
delete mode 100644 packages/documentation-v7/.storybook/preview-head.html
delete mode 100644 packages/documentation-v7/cypress/e2e/home.cy.ts
delete mode 100644 packages/documentation-v7/cypress/tsconfig.json
delete mode 100644 packages/documentation-v7/package.json
delete mode 100644 packages/documentation-v7/src/stories/components/badge/badge.docs.mdx
delete mode 100644 packages/documentation-v7/src/stories/components/card/card.docs.mdx
delete mode 100644 packages/documentation-v7/src/stories/components/checkbox/checkbox.docs.mdx
delete mode 100644 packages/documentation-v7/src/stories/components/heading/heading.docs.mdx
delete mode 100644 packages/documentation-v7/src/stories/components/input-group/input-group.docs.mdx
delete mode 100644 packages/documentation-v7/src/stories/icons/components/icon.docs.mdx
rename packages/{documentation-v7 => documentation}/.storybook/blocks/footer.tsx (100%)
rename packages/documentation/.storybook/{components/docs => blocks}/header.tsx (100%)
rename packages/{documentation-v7 => documentation}/.storybook/blocks/layout.tsx (100%)
rename packages/{documentation-v7 => documentation}/.storybook/constants.ts (100%)
rename packages/{documentation-v7 => documentation}/.storybook/helpers/bages-config.ts (100%)
rename packages/{documentation-v7 => documentation}/.storybook/helpers/index.ts (100%)
rename packages/{documentation-v7 => documentation}/.storybook/helpers/prettier-options.ts (100%)
rename packages/{documentation-v7 => documentation}/.storybook/helpers/register-web-components.ts (100%)
rename packages/{documentation-v7 => documentation}/.storybook/helpers/reset-sb-styled-components.ts (100%)
rename packages/{documentation-v7 => documentation}/.storybook/main.ts (100%)
rename packages/{documentation-v7 => documentation}/.storybook/manager.ts (100%)
rename packages/{documentation-v7 => documentation}/.storybook/preview.ts (100%)
rename packages/{documentation-v7 => documentation}/.storybook/styles/layout.scss (100%)
rename packages/{documentation-v7 => documentation}/.storybook/styles/manager.scss (100%)
rename packages/{documentation-v7 => documentation}/.storybook/styles/preview.scss (100%)
rename packages/{documentation-v7 => documentation}/.storybook/styles/themes.ts (100%)
rename packages/{documentation-v7 => documentation}/cypress/snapshots/components/alert.snapshot.ts (100%)
rename packages/{documentation-v7 => documentation}/cypress/snapshots/components/blockquote.snapshot.ts (100%)
rename packages/{documentation-v7 => documentation}/cypress/snapshots/components/button.snapshot.ts (100%)
rename packages/{documentation-v7 => documentation}/cypress/snapshots/components/card.snapshot.ts (100%)
rename packages/{documentation-v7 => documentation}/cypress/snapshots/components/headings.snapshot.ts (100%)
rename packages/{documentation-v7 => documentation}/cypress/snapshots/components/select.snapshot.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/components/alert/alert.snapshot.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/components/alert/alert.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/components/alert/getAlertClasses.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/components/badge/badge.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/components/blockquote/blockquote.snapshot.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/components/blockquote/blockquote.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/components/button-group/button-group.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/components/button/button.snapshot.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/components/button/button.stories.ts (99%)
rename packages/{documentation-v7 => documentation}/src/stories/components/card/card.snapshot.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/components/card/card.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/components/checkbox/checkbox.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/components/choice-card/checkbox-card.docs.mdx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/components/choice-card/checkbox-card.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/components/choice-card/choice-control.snapshot.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/components/choice-card/choice-control.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/components/choice-card/radiobutton-card.docs.mdx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/components/choice-card/radiobutton-card.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/components/collapsible/collapsible.snapshot.stories.tsx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/components/collapsible/collapsible.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/components/heading/heading.snapshot.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/components/heading/heading.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/components/input-group/input-group.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/components/input/input.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/components/radio/radio.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/components/range/range.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/components/select/select.snapshot.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/components/select/select.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/components/switch/switch.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/components/table/table.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/components/textarea/textarea.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/components/toast/toast.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/components/topic-teaser/topic-teaser.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/foundation/accessibility/accessibility.docs.mdx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/foundation/accessibility/accessibility.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/foundation/color/color.blocks.tsx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/foundation/color/color.docs.mdx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/foundation/color/color.module.scss (100%)
rename packages/{documentation-v7 => documentation}/src/stories/foundation/color/color.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/foundation/elevation/elevation.blocks.tsx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/foundation/elevation/elevation.docs.mdx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/foundation/elevation/elevation.module.scss (100%)
rename packages/{documentation-v7 => documentation}/src/stories/foundation/elevation/elevation.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/foundation/layout/breakpoints/breakpoints.docs.mdx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/foundation/layout/breakpoints/breakpoints.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/foundation/layout/layout.docs.mdx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/foundation/layout/layout.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/foundation/typography/typography.blocks.tsx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/foundation/typography/typography.docs.mdx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/foundation/typography/typography.module.scss (100%)
rename packages/{documentation-v7 => documentation}/src/stories/foundation/typography/typography.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/foundation/typography/typography.styles.scss (100%)
rename packages/{documentation-v7 => documentation}/src/stories/getting-started/components/components.docs.mdx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/getting-started/components/components.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/getting-started/styles/styles.docs.mdx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/getting-started/styles/styles.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/home.blocks.tsx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/home.docs.mdx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/icons/components/icon.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/icons/getting-started.docs.mdx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/icons/getting-started.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/icons/search-icons/search-icons.blocks.tsx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/icons/search-icons/search-icons.docs.mdx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/internet-header/components/internet-header.docs.mdx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/internet-header/components/internet-header.stories.tsx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/internet-header/components/internet-header.styles.scss (100%)
rename packages/{documentation-v7 => documentation}/src/stories/internet-header/getting-started.docs.mdx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/internet-header/migration-guide.docs.mdx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/intranet-header/intranet-header.docs.mdx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/intranet-header/intranet-header.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/misc/changelog/changelog.docs.mdx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/misc/migration-guide/migration-guide.docs.mdx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/misc/migration-guide/migration-guide.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/misc/versions/versions.blocks.tsx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/misc/versions/versions.docs.mdx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/misc/versions/versions.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/templates/forms/forms.docs.mdx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/templates/forms/forms.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/utilities/background/background.blocks.tsx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/utilities/background/background.docs.mdx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/utilities/background/background.module.scss (100%)
rename packages/{documentation-v7 => documentation}/src/stories/utilities/background/background.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/utilities/background/background.styles.scss (100%)
rename packages/{documentation-v7 => documentation}/src/stories/utilities/common/common.docs.mdx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/utilities/common/common.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/utilities/heading/heading.docs.mdx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/utilities/heading/heading.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/utilities/list/list.docs.mdx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/utilities/list/list.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/utilities/sizing/sizing.docs.mdx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/utilities/sizing/sizing.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/utilities/spacing/spacing.docs.mdx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/utilities/spacing/spacing.stories.ts (100%)
rename packages/{documentation-v7 => documentation}/src/stories/utilities/text/text.blocks.tsx (93%)
rename packages/{documentation-v7 => documentation}/src/stories/utilities/text/text.docs.mdx (100%)
rename packages/{documentation-v7 => documentation}/src/stories/utilities/text/text.module.scss (100%)
rename packages/{documentation-v7 => documentation}/src/stories/utilities/text/text.stories.ts (100%)
rename packages/{documentation-v7/src/stories/utilities => documentation/src/utils}/bombArgs.ts (97%)
rename packages/{documentation-v7 => documentation}/src/utils/map-classes.ts (100%)
rename packages/{documentation-v7 => documentation}/vite.config.js (100%)
diff --git a/.github/workflows/build-documentation-v7.yaml b/.github/workflows/build-documentation-v6.yaml
similarity index 63%
rename from .github/workflows/build-documentation-v7.yaml
rename to .github/workflows/build-documentation-v6.yaml
index 19eb7ae90a..297341a574 100644
--- a/.github/workflows/build-documentation-v7.yaml
+++ b/.github/workflows/build-documentation-v6.yaml
@@ -10,11 +10,11 @@
#
###
-name: Build Documentation V7
+name: Build Documentation V6
on:
pull_request:
paths:
- - 'packages/documentation-v7/**'
+ - 'packages/documentation-v6/**'
- 'packages/styles/**'
- 'packages/components/**'
- 'packages/internet-header/**'
@@ -31,14 +31,14 @@ jobs:
- name: Setup
uses: swisspost/design-system/.github/actions/setup-pnpm@main
- - name: Install documentation-v7 & dependencies
- run: pnpm --filter design-system-documentation-v7... install
+ - name: Install documentation-v6 & dependencies
+ run: pnpm --filter design-system-documentation-v6... install
- - name: Build documentation-v7 & dependencies
- run: pnpm --filter design-system-documentation-v7... build
+ - name: Build documentation-v6 & dependencies
+ run: pnpm --filter design-system-documentation-v6... build
- - name: Upload documentation-v7
+ - name: Upload documentation-v6
uses: swisspost/design-system/.github/actions/artifact-upload@main
with:
- name: design-system-documentation-v7
- folder: packages/documentation-v7/storybook-static
+ name: design-system-documentation-v6
+ folder: packages/documentation-v6/storybook-static
diff --git a/.github/workflows/deploy-documentation-v7.yaml b/.github/workflows/deploy-documentation-v6.yaml
similarity index 86%
rename from .github/workflows/deploy-documentation-v7.yaml
rename to .github/workflows/deploy-documentation-v6.yaml
index fb964f4ca4..57d500222e 100644
--- a/.github/workflows/deploy-documentation-v7.yaml
+++ b/.github/workflows/deploy-documentation-v6.yaml
@@ -6,10 +6,10 @@
#
###
-name: Deploy Documentation V7 Preview to Netlify
+name: Deploy Documentation V6 Preview to Netlify
on:
workflow_run:
- workflows: ['Build Documentation V7']
+ workflows: ['Build Documentation V6']
types: [completed]
jobs:
@@ -28,10 +28,10 @@ jobs:
uses: swisspost/design-system/.github/actions/artifact-download@main
id: build
with:
- name: design-system-documentation-v7
+ name: design-system-documentation-v6
folder: build-output
- - name: Deploy documentation v7 to netlify
+ - name: Deploy documentation v6 to netlify
uses: swisspost/design-system/.github/actions/deploy-to-netlify@main
id: deploy
with:
diff --git a/package.json b/package.json
index 8c2d2a97d5..bb992606d7 100644
--- a/package.json
+++ b/package.json
@@ -25,13 +25,13 @@
"docs:test": "pnpm --filter design-system-documentation test",
"docs:e2e": "start-server-and-test docs:headless 9300 'pnpm --filter design-system-documentation e2e'",
"docs:e2e:watch": "start-server-and-test docs:headless 9300 'pnpm --filter design-system-documentation e2e:watch'",
- "docsv7": "pnpm --filter design-system-documentation-v7 start",
- "docsv7:start": "pnpm --filter design-system-documentation-v7... --parallel --stream start",
- "docsv7:build": "pnpm --filter design-system-documentation-v7 build",
- "docsv7:headless": "pnpm --filter design-system-documentation-v7 start:headless",
- "docsv7:e2e": "start-server-and-test docsv7:headless 9300 'pnpm --filter design-system-documentation-v7 e2e'",
- "docsv7:e2e:watch": "start-server-and-test docsv7:headless 9300 'pnpm --filter design-system-documentation-v7 e2e:watch'",
- "docsv7:snapshots": "start-server-and-test 'pnpm docsv7:headless' 9300 'pnpm --filter design-system-documentation-v7 snapshots'",
+ "docsv6": "pnpm --filter design-system-documentation-v6 start",
+ "docsv6:start": "pnpm --filter design-system-documentation-v6... --parallel --stream start",
+ "docsv6:build": "pnpm --filter design-system-documentation-v6 build",
+ "docsv6:headless": "pnpm --filter design-system-documentation-v6 start:headless",
+ "docsv6:e2e": "start-server-and-test docsv6:headless 9300 'pnpm --filter design-system-documentation-v6 e2e'",
+ "docsv6:e2e:watch": "start-server-and-test docsv6:headless 9300 'pnpm --filter design-system-documentation-v6 e2e:watch'",
+ "docsv6:snapshots": "start-server-and-test 'pnpm docsv6:headless' 9300 'pnpm --filter design-system-documentation-v6 snapshots'",
"styles:start": "pnpm --filter design-system-styles start",
"styles:build": "pnpm --filter design-system-styles build",
"styles:test": "pnpm --filter design-system-styles test",
diff --git a/packages/documentation-v6/.gitignore b/packages/documentation-v6/.gitignore
new file mode 100644
index 0000000000..1170adc2ad
--- /dev/null
+++ b/packages/documentation-v6/.gitignore
@@ -0,0 +1,2 @@
+# Storybook specific
+storybook-static
\ No newline at end of file
diff --git a/packages/documentation/.percy.yml b/packages/documentation-v6/.percy.yml
similarity index 100%
rename from packages/documentation/.percy.yml
rename to packages/documentation-v6/.percy.yml
diff --git a/packages/documentation/.storybook/components/docs/footer.tsx b/packages/documentation-v6/.storybook/components/docs/footer.tsx
similarity index 100%
rename from packages/documentation/.storybook/components/docs/footer.tsx
rename to packages/documentation-v6/.storybook/components/docs/footer.tsx
diff --git a/packages/documentation-v7/.storybook/blocks/header.tsx b/packages/documentation-v6/.storybook/components/docs/header.tsx
similarity index 100%
rename from packages/documentation-v7/.storybook/blocks/header.tsx
rename to packages/documentation-v6/.storybook/components/docs/header.tsx
diff --git a/packages/documentation/.storybook/components/docs/layout.scss b/packages/documentation-v6/.storybook/components/docs/layout.scss
similarity index 100%
rename from packages/documentation/.storybook/components/docs/layout.scss
rename to packages/documentation-v6/.storybook/components/docs/layout.scss
diff --git a/packages/documentation/.storybook/components/docs/layout.tsx b/packages/documentation-v6/.storybook/components/docs/layout.tsx
similarity index 100%
rename from packages/documentation/.storybook/components/docs/layout.tsx
rename to packages/documentation-v6/.storybook/components/docs/layout.tsx
diff --git a/packages/documentation/.storybook/main.js b/packages/documentation-v6/.storybook/main.js
similarity index 95%
rename from packages/documentation/.storybook/main.js
rename to packages/documentation-v6/.storybook/main.js
index d6f1c5fbca..fcd7f0dc39 100644
--- a/packages/documentation/.storybook/main.js
+++ b/packages/documentation-v6/.storybook/main.js
@@ -4,10 +4,10 @@ module.exports = {
addons: [
'@storybook/addon-docs',
'@storybook/addon-controls',
- '@storybook/addon-links',
+ // '@storybook/addon-links',
'@storybook/addon-measure',
'@storybook/addon-viewport',
- '@storybook/addon-a11y',
+ // '@storybook/addon-a11y',
'@pxtrn/storybook-addon-docs-stencil',
'storybook-dark-mode',
'@geometricpanda/storybook-addon-badges',
diff --git a/packages/documentation-v7/.storybook/manager-head.html b/packages/documentation-v6/.storybook/manager-head.html
similarity index 69%
rename from packages/documentation-v7/.storybook/manager-head.html
rename to packages/documentation-v6/.storybook/manager-head.html
index 4039470a3c..e32ede4869 100644
--- a/packages/documentation-v7/.storybook/manager-head.html
+++ b/packages/documentation-v6/.storybook/manager-head.html
@@ -9,26 +9,48 @@
-
-
-
-
+
-
+
-
-
+
+
-
+
-
+
-
\ No newline at end of file
+
diff --git a/packages/documentation/.storybook/manager.js b/packages/documentation-v6/.storybook/manager.js
similarity index 100%
rename from packages/documentation/.storybook/manager.js
rename to packages/documentation-v6/.storybook/manager.js
diff --git a/packages/documentation/.storybook/manager.scss b/packages/documentation-v6/.storybook/manager.scss
similarity index 100%
rename from packages/documentation/.storybook/manager.scss
rename to packages/documentation-v6/.storybook/manager.scss
diff --git a/packages/documentation/.storybook/post-themes.js b/packages/documentation-v6/.storybook/post-themes.js
similarity index 100%
rename from packages/documentation/.storybook/post-themes.js
rename to packages/documentation-v6/.storybook/post-themes.js
diff --git a/packages/documentation-v6/.storybook/preview-head.html b/packages/documentation-v6/.storybook/preview-head.html
new file mode 100644
index 0000000000..14cad7d838
--- /dev/null
+++ b/packages/documentation-v6/.storybook/preview-head.html
@@ -0,0 +1,11 @@
+
+
+
+
+
+
diff --git a/packages/documentation/.storybook/preview.js b/packages/documentation-v6/.storybook/preview.js
similarity index 100%
rename from packages/documentation/.storybook/preview.js
rename to packages/documentation-v6/.storybook/preview.js
diff --git a/packages/documentation/.storybook/preview.scss b/packages/documentation-v6/.storybook/preview.scss
similarity index 100%
rename from packages/documentation/.storybook/preview.scss
rename to packages/documentation-v6/.storybook/preview.scss
diff --git a/packages/documentation-v7/CHANGELOG.md b/packages/documentation-v6/CHANGELOG.md
similarity index 96%
rename from packages/documentation-v7/CHANGELOG.md
rename to packages/documentation-v6/CHANGELOG.md
index 75eb2ee7e5..4cb442fb83 100644
--- a/packages/documentation-v7/CHANGELOG.md
+++ b/packages/documentation-v6/CHANGELOG.md
@@ -1,6 +1,10 @@
-# @swisspost/design-system-documentation-v7
+# @swisspost/design-system-documentation
-## 1.1.2
+## 1.12.0
+
+### Minor Changes
+
+- Added a gray notification variant for cookie banners. (by [@alizedebray](https://github.com/alizedebray) with [#1350](https://github.com/swisspost/design-system/pull/1350))
### Patch Changes
@@ -11,18 +15,14 @@
- @swisspost/design-system-components@1.3.10
- @swisspost/design-system-components-react@1.0.16
-## 1.1.1
+## 1.11.3
### Patch Changes
- Updated dependencies:
- @swisspost/internet-header@1.8.3
-## 1.1.0
-
-### Minor Changes
-
-- Created a storybook v7 package, set up with vite and lit. (by [@oliverschuerch](https://github.com/oliverschuerch) with [#1613](https://github.com/swisspost/design-system/pull/1613))
+## 1.11.2
### Patch Changes
@@ -33,6 +33,17 @@
- @swisspost/design-system-components@1.3.9
- @swisspost/design-system-components-react@1.0.15
+## 1.11.1
+
+### Patch Changes
+
+- Updated dependencies:
+ - @swisspost/design-system-icons@1.0.8
+ - @swisspost/design-system-styles@6.2.5
+ - @swisspost/design-system-components@1.3.8
+ - @swisspost/internet-header@1.8.1
+ - @swisspost/design-system-components-react@1.0.14
+
## 1.11.0
### Minor Changes
diff --git a/packages/documentation-v7/CONTRIBUTING.md b/packages/documentation-v6/CONTRIBUTING.md
similarity index 97%
rename from packages/documentation-v7/CONTRIBUTING.md
rename to packages/documentation-v6/CONTRIBUTING.md
index 1942a3d4a0..0b8db9a6ae 100644
--- a/packages/documentation-v7/CONTRIBUTING.md
+++ b/packages/documentation-v6/CONTRIBUTING.md
@@ -1,4 +1,4 @@
-# Contributing to Design System Documentation-V7
+# Contributing to Design System Documentation
These contribution guidelines extend the [general contribution guidelines](../../CONTRIBUTING.md), where you can find instructions on how to set up the repository for contributing.
diff --git a/packages/documentation-v7/LICENSE b/packages/documentation-v6/LICENSE
similarity index 100%
rename from packages/documentation-v7/LICENSE
rename to packages/documentation-v6/LICENSE
diff --git a/packages/documentation-v7/README.md b/packages/documentation-v6/README.md
similarity index 79%
rename from packages/documentation-v7/README.md
rename to packages/documentation-v6/README.md
index 8629e89522..5cb3dd8ea0 100644
--- a/packages/documentation-v7/README.md
+++ b/packages/documentation-v6/README.md
@@ -1,14 +1,13 @@
-# Swiss Post Design System Documentation-V7
+# Swiss Post Design System Documentation
-![Swiss Post Design System splash screen](https://user-images.githubusercontent.com/1659006/187683368-d3aa2534-84be-4580-846e-2cad3796b573.png)
+![Swiss Post Design System splash screen](https://github.com/swisspost/design-system/assets/1659006/e84f1fea-e666-4853-8c85-726a6bf22e6c)
A Storybook Documentation for the Swiss Post Design System.
Includes stories for the following packages:
+
- [@swisspost/design-system-styles](https://www.npmjs.com/package/@swisspost/design-system-styles)
-- [@swisspost/internet-header](https://www.npmjs.com/package/@swisspost/internet-header)
- [@swisspost/design-system-components](https://www.npmjs.com/package/@swisspost/design-system-components)
-- [@swisspost/design-system-icons](https://www.npmjs.com/package/@swisspost/design-system-icons)
## Documentation
diff --git a/packages/documentation-v7/cypress.config.js b/packages/documentation-v6/cypress.config.js
similarity index 100%
rename from packages/documentation-v7/cypress.config.js
rename to packages/documentation-v6/cypress.config.js
diff --git a/packages/documentation-v7/cypress.snapshot.config.js b/packages/documentation-v6/cypress.snapshot.config.js
similarity index 100%
rename from packages/documentation-v7/cypress.snapshot.config.js
rename to packages/documentation-v6/cypress.snapshot.config.js
diff --git a/packages/documentation-v7/cypress/snapshots/components/collapsible.snapshot.ts b/packages/documentation-v6/cypress/snapshots/components/collapsible.snapshot.ts
similarity index 71%
rename from packages/documentation-v7/cypress/snapshots/components/collapsible.snapshot.ts
rename to packages/documentation-v6/cypress/snapshots/components/collapsible.snapshot.ts
index d72ea712f2..2e70ecdfba 100644
--- a/packages/documentation-v7/cypress/snapshots/components/collapsible.snapshot.ts
+++ b/packages/documentation-v6/cypress/snapshots/components/collapsible.snapshot.ts
@@ -1,6 +1,6 @@
describe('Collapsible', () => {
it('default', () => {
- cy.visit('/iframe.html?id=snapshots--collapsible');
+ cy.visit('/iframe.html?id=components-collapsible--default');
cy.get('post-collapsible.hydrated').should('be.visible');
cy.percySnapshot('Collapsible');
});
diff --git a/packages/documentation/cypress/snapshots/internet-header/breadcrumbs.snapshot.ts b/packages/documentation-v6/cypress/snapshots/internet-header/breadcrumbs.snapshot.ts
similarity index 100%
rename from packages/documentation/cypress/snapshots/internet-header/breadcrumbs.snapshot.ts
rename to packages/documentation-v6/cypress/snapshots/internet-header/breadcrumbs.snapshot.ts
diff --git a/packages/documentation/cypress/snapshots/internet-header/footer.snapshot.ts b/packages/documentation-v6/cypress/snapshots/internet-header/footer.snapshot.ts
similarity index 100%
rename from packages/documentation/cypress/snapshots/internet-header/footer.snapshot.ts
rename to packages/documentation-v6/cypress/snapshots/internet-header/footer.snapshot.ts
diff --git a/packages/documentation/cypress/snapshots/internet-header/header.snapshot.ts b/packages/documentation-v6/cypress/snapshots/internet-header/header.snapshot.ts
similarity index 100%
rename from packages/documentation/cypress/snapshots/internet-header/header.snapshot.ts
rename to packages/documentation-v6/cypress/snapshots/internet-header/header.snapshot.ts
diff --git a/packages/documentation/cypress/snapshots/styles/alert.snapshot.ts b/packages/documentation-v6/cypress/snapshots/styles/alert.snapshot.ts
similarity index 100%
rename from packages/documentation/cypress/snapshots/styles/alert.snapshot.ts
rename to packages/documentation-v6/cypress/snapshots/styles/alert.snapshot.ts
diff --git a/packages/documentation/cypress/snapshots/styles/blockquote.snapshot.ts b/packages/documentation-v6/cypress/snapshots/styles/blockquote.snapshot.ts
similarity index 100%
rename from packages/documentation/cypress/snapshots/styles/blockquote.snapshot.ts
rename to packages/documentation-v6/cypress/snapshots/styles/blockquote.snapshot.ts
diff --git a/packages/documentation/cypress/snapshots/styles/button.snapshot.ts b/packages/documentation-v6/cypress/snapshots/styles/button.snapshot.ts
similarity index 100%
rename from packages/documentation/cypress/snapshots/styles/button.snapshot.ts
rename to packages/documentation-v6/cypress/snapshots/styles/button.snapshot.ts
diff --git a/packages/documentation/cypress/snapshots/styles/card.snapshot.ts b/packages/documentation-v6/cypress/snapshots/styles/card.snapshot.ts
similarity index 100%
rename from packages/documentation/cypress/snapshots/styles/card.snapshot.ts
rename to packages/documentation-v6/cypress/snapshots/styles/card.snapshot.ts
diff --git a/packages/documentation/cypress/snapshots/styles/choice-card.snapshot.ts b/packages/documentation-v6/cypress/snapshots/styles/choice-card.snapshot.ts
similarity index 100%
rename from packages/documentation/cypress/snapshots/styles/choice-card.snapshot.ts
rename to packages/documentation-v6/cypress/snapshots/styles/choice-card.snapshot.ts
diff --git a/packages/documentation/cypress/snapshots/styles/headings.snapshot.ts b/packages/documentation-v6/cypress/snapshots/styles/headings.snapshot.ts
similarity index 100%
rename from packages/documentation/cypress/snapshots/styles/headings.snapshot.ts
rename to packages/documentation-v6/cypress/snapshots/styles/headings.snapshot.ts
diff --git a/packages/documentation-v7/cypress/support/commands.ts b/packages/documentation-v6/cypress/support/commands.ts
similarity index 100%
rename from packages/documentation-v7/cypress/support/commands.ts
rename to packages/documentation-v6/cypress/support/commands.ts
diff --git a/packages/documentation-v7/cypress/support/e2e.ts b/packages/documentation-v6/cypress/support/e2e.ts
similarity index 94%
rename from packages/documentation-v7/cypress/support/e2e.ts
rename to packages/documentation-v6/cypress/support/e2e.ts
index 0d0cd18178..c2b4b1647f 100644
--- a/packages/documentation-v7/cypress/support/e2e.ts
+++ b/packages/documentation-v6/cypress/support/e2e.ts
@@ -15,6 +15,8 @@
// Import commands.js using ES2015 syntax:
import '@percy/cypress';
+import 'cypress-storybook/cypress';
+import 'cypress-each';
import './commands';
// https://docs.cypress.io/api/events/catalog-of-events#Uncaught-Exceptions
diff --git a/packages/documentation-v7/cypress/support/index.d.ts b/packages/documentation-v6/cypress/support/index.d.ts
similarity index 100%
rename from packages/documentation-v7/cypress/support/index.d.ts
rename to packages/documentation-v6/cypress/support/index.d.ts
diff --git a/packages/documentation-v6/cypress/tsconfig.json b/packages/documentation-v6/cypress/tsconfig.json
new file mode 100644
index 0000000000..322238f7e6
--- /dev/null
+++ b/packages/documentation-v6/cypress/tsconfig.json
@@ -0,0 +1,15 @@
+{
+ "extends": "../tsconfig.json",
+ "compilerOptions": {
+ "noEmit": true,
+ "types": [
+ "cypress",
+ "cypress-each",
+ "@percy/cypress",
+ "@swisspost/internet-header",
+ "cypress-storybook/cypress"
+ ]
+ },
+ "include": ["./**/*.ts", "./**/*.tsx"],
+ "exclude": []
+}
diff --git a/packages/documentation-v6/package.json b/packages/documentation-v6/package.json
new file mode 100644
index 0000000000..2aa6eb35a4
--- /dev/null
+++ b/packages/documentation-v6/package.json
@@ -0,0 +1,67 @@
+{
+ "name": "@swisspost/design-system-documentation-v6",
+ "version": "1.12.0",
+ "description": "Swiss Post Design System Documentation.",
+ "author": "Swiss Post ",
+ "license": "Apache-2.0",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/swisspost/design-system.git"
+ },
+ "homepage": "https://swisspost-web-frontend.netlify.app",
+ "bugs": {
+ "url": "https://github.com/swisspost/design-system/issues"
+ },
+ "main": "index.js",
+ "private": true,
+ "scripts": {
+ "start": "start-storybook -p 9200 --quiet",
+ "start:headless": "start-storybook -p 9300 --quiet --no-open",
+ "build": "build-storybook --quiet"
+ },
+ "dependencies": {
+ "@swisspost/design-system-components": "workspace:1.3.10",
+ "@swisspost/design-system-components-react": "workspace:1.0.16",
+ "@swisspost/design-system-icons": "workspace:1.0.10",
+ "@swisspost/design-system-styles": "workspace:6.3.0",
+ "@swisspost/internet-header": "workspace:1.9.0",
+ "html-react-parser": "4.2.1",
+ "prettier": "2.8.8",
+ "react": "18.2.0",
+ "react-dom": "18.2.0",
+ "react-jsx-parser": "1.29.0"
+ },
+ "devDependencies": {
+ "@babel/core": "7.22.10",
+ "@geometricpanda/storybook-addon-badges": "1.1.1",
+ "@percy/cli": "1.26.3",
+ "@percy/cypress": "3.1.2",
+ "@pxtrn/storybook-addon-docs-stencil": "6.4.1",
+ "@storybook/addon-a11y": "6.5.16",
+ "@storybook/addon-docs": "6.5.16",
+ "@storybook/addon-essentials": "6.5.16",
+ "@storybook/addon-links": "6.5.16",
+ "@storybook/addons": "6.5.16",
+ "@storybook/client-api": "6.5.16",
+ "@storybook/preset-scss": "1.0.3",
+ "@storybook/react": "6.5.16",
+ "@storybook/testing-library": "0.2.0",
+ "@storybook/theming": "6.5.16",
+ "@types/mdx": "2.0.6",
+ "@types/react": "18.2.20",
+ "@types/react-dom": "18.2.7",
+ "babel-loader": "9.1.3",
+ "css-loader": "5.2.7",
+ "cypress": "12.17.3",
+ "cypress-each": "1.13.3",
+ "cypress-storybook": "0.5.1",
+ "react-markdown": "8.0.7",
+ "rehype-raw": "6.1.1",
+ "sass": "1.65.1",
+ "sass-loader": "10.4.1",
+ "start-server-and-test": "2.0.0",
+ "storybook-dark-mode": "3.0.1",
+ "style-loader": "2.0.0",
+ "typescript": "4.9.5"
+ }
+}
diff --git a/packages/documentation-v7/public/android-chrome-192x192.png b/packages/documentation-v6/public/android-chrome-192x192.png
similarity index 100%
rename from packages/documentation-v7/public/android-chrome-192x192.png
rename to packages/documentation-v6/public/android-chrome-192x192.png
diff --git a/packages/documentation-v7/public/android-chrome-512x512.png b/packages/documentation-v6/public/android-chrome-512x512.png
similarity index 100%
rename from packages/documentation-v7/public/android-chrome-512x512.png
rename to packages/documentation-v6/public/android-chrome-512x512.png
diff --git a/packages/documentation-v7/public/apple-touch-icon.png b/packages/documentation-v6/public/apple-touch-icon.png
similarity index 100%
rename from packages/documentation-v7/public/apple-touch-icon.png
rename to packages/documentation-v6/public/apple-touch-icon.png
diff --git a/packages/documentation-v7/public/assets/config/test-configuration.json b/packages/documentation-v6/public/assets/config/test-configuration.json
similarity index 99%
rename from packages/documentation-v7/public/assets/config/test-configuration.json
rename to packages/documentation-v6/public/assets/config/test-configuration.json
index fc32740863..3074106b97 100644
--- a/packages/documentation-v7/public/assets/config/test-configuration.json
+++ b/packages/documentation-v6/public/assets/config/test-configuration.json
@@ -1286,7 +1286,7 @@
"additionalAttributes": []
},
{
- "url": "http://www.youtube.com/swisspost",
+ "url": "https://www.youtube.com/swisspost",
"icon": "8002_youtube",
"name": "Folgen Sie uns auf Youtube",
"target": "_blank",
@@ -1889,7 +1889,7 @@
"additionalAttributes": []
},
{
- "url": "http://www.youtube.com/swisspost",
+ "url": "https://www.youtube.com/swisspost",
"icon": "8002_youtube",
"name": "Suivez-nous sur Youtube",
"target": "_blank",
@@ -2492,7 +2492,7 @@
"additionalAttributes": []
},
{
- "url": "http://www.youtube.com/swisspost",
+ "url": "https://www.youtube.com/swisspost",
"icon": "8002_youtube",
"name": "Seguici su Youtube",
"target": "_blank",
@@ -3095,7 +3095,7 @@
"additionalAttributes": []
},
{
- "url": "http://www.youtube.com/swisspost",
+ "url": "https://www.youtube.com/swisspost",
"icon": "8002_youtube",
"name": "Follow us on Youtube",
"target": "_blank",
diff --git a/packages/documentation-v7/public/favicon.ico b/packages/documentation-v6/public/favicon.ico
similarity index 100%
rename from packages/documentation-v7/public/favicon.ico
rename to packages/documentation-v6/public/favicon.ico
diff --git a/packages/documentation-v7/public/favicon.svg b/packages/documentation-v6/public/favicon.svg
similarity index 100%
rename from packages/documentation-v7/public/favicon.svg
rename to packages/documentation-v6/public/favicon.svg
diff --git a/packages/documentation-v7/public/images/header.png b/packages/documentation-v6/public/images/header.png
similarity index 100%
rename from packages/documentation-v7/public/images/header.png
rename to packages/documentation-v6/public/images/header.png
diff --git a/packages/documentation-v7/public/images/logo-swisspost.svg b/packages/documentation-v6/public/images/logo-swisspost.svg
similarity index 100%
rename from packages/documentation-v7/public/images/logo-swisspost.svg
rename to packages/documentation-v6/public/images/logo-swisspost.svg
diff --git a/packages/documentation-v7/public/images/packages/components.svg b/packages/documentation-v6/public/images/packages/components.svg
similarity index 100%
rename from packages/documentation-v7/public/images/packages/components.svg
rename to packages/documentation-v6/public/images/packages/components.svg
diff --git a/packages/documentation-v7/public/images/packages/icons.svg b/packages/documentation-v6/public/images/packages/icons.svg
similarity index 100%
rename from packages/documentation-v7/public/images/packages/icons.svg
rename to packages/documentation-v6/public/images/packages/icons.svg
diff --git a/packages/documentation-v7/public/images/packages/internet-header.svg b/packages/documentation-v6/public/images/packages/internet-header.svg
similarity index 100%
rename from packages/documentation-v7/public/images/packages/internet-header.svg
rename to packages/documentation-v6/public/images/packages/internet-header.svg
diff --git a/packages/documentation-v7/public/images/packages/intranet-header.svg b/packages/documentation-v6/public/images/packages/intranet-header.svg
similarity index 100%
rename from packages/documentation-v7/public/images/packages/intranet-header.svg
rename to packages/documentation-v6/public/images/packages/intranet-header.svg
diff --git a/packages/documentation-v7/public/images/packages/styles.svg b/packages/documentation-v6/public/images/packages/styles.svg
similarity index 100%
rename from packages/documentation-v7/public/images/packages/styles.svg
rename to packages/documentation-v6/public/images/packages/styles.svg
diff --git a/packages/documentation-v7/public/images/technologies/logo-angular.svg b/packages/documentation-v6/public/images/technologies/logo-angular.svg
similarity index 100%
rename from packages/documentation-v7/public/images/technologies/logo-angular.svg
rename to packages/documentation-v6/public/images/technologies/logo-angular.svg
diff --git a/packages/documentation-v7/public/images/technologies/logo-bootstrap.svg b/packages/documentation-v6/public/images/technologies/logo-bootstrap.svg
similarity index 100%
rename from packages/documentation-v7/public/images/technologies/logo-bootstrap.svg
rename to packages/documentation-v6/public/images/technologies/logo-bootstrap.svg
diff --git a/packages/documentation-v7/public/images/technologies/logo-changesets.png b/packages/documentation-v6/public/images/technologies/logo-changesets.png
similarity index 100%
rename from packages/documentation-v7/public/images/technologies/logo-changesets.png
rename to packages/documentation-v6/public/images/technologies/logo-changesets.png
diff --git a/packages/documentation-v7/public/images/technologies/logo-cypress.svg b/packages/documentation-v6/public/images/technologies/logo-cypress.svg
similarity index 100%
rename from packages/documentation-v7/public/images/technologies/logo-cypress.svg
rename to packages/documentation-v6/public/images/technologies/logo-cypress.svg
diff --git a/packages/documentation-v7/public/images/technologies/logo-figma.svg b/packages/documentation-v6/public/images/technologies/logo-figma.svg
similarity index 100%
rename from packages/documentation-v7/public/images/technologies/logo-figma.svg
rename to packages/documentation-v6/public/images/technologies/logo-figma.svg
diff --git a/packages/documentation-v7/public/images/technologies/logo-github.svg b/packages/documentation-v6/public/images/technologies/logo-github.svg
similarity index 100%
rename from packages/documentation-v7/public/images/technologies/logo-github.svg
rename to packages/documentation-v6/public/images/technologies/logo-github.svg
diff --git a/packages/documentation-v7/public/images/technologies/logo-gulp.svg b/packages/documentation-v6/public/images/technologies/logo-gulp.svg
similarity index 100%
rename from packages/documentation-v7/public/images/technologies/logo-gulp.svg
rename to packages/documentation-v6/public/images/technologies/logo-gulp.svg
diff --git a/packages/documentation-v7/public/images/technologies/logo-jest.svg b/packages/documentation-v6/public/images/technologies/logo-jest.svg
similarity index 100%
rename from packages/documentation-v7/public/images/technologies/logo-jest.svg
rename to packages/documentation-v6/public/images/technologies/logo-jest.svg
diff --git a/packages/documentation-v7/public/images/technologies/logo-percy.svg b/packages/documentation-v6/public/images/technologies/logo-percy.svg
similarity index 100%
rename from packages/documentation-v7/public/images/technologies/logo-percy.svg
rename to packages/documentation-v6/public/images/technologies/logo-percy.svg
diff --git a/packages/documentation-v7/public/images/technologies/logo-pnpm.svg b/packages/documentation-v6/public/images/technologies/logo-pnpm.svg
similarity index 100%
rename from packages/documentation-v7/public/images/technologies/logo-pnpm.svg
rename to packages/documentation-v6/public/images/technologies/logo-pnpm.svg
diff --git a/packages/documentation-v7/public/images/technologies/logo-react.svg b/packages/documentation-v6/public/images/technologies/logo-react.svg
similarity index 100%
rename from packages/documentation-v7/public/images/technologies/logo-react.svg
rename to packages/documentation-v6/public/images/technologies/logo-react.svg
diff --git a/packages/documentation-v7/public/images/technologies/logo-sass.svg b/packages/documentation-v6/public/images/technologies/logo-sass.svg
similarity index 100%
rename from packages/documentation-v7/public/images/technologies/logo-sass.svg
rename to packages/documentation-v6/public/images/technologies/logo-sass.svg
diff --git a/packages/documentation-v7/public/images/technologies/logo-stencil.png b/packages/documentation-v6/public/images/technologies/logo-stencil.png
similarity index 100%
rename from packages/documentation-v7/public/images/technologies/logo-stencil.png
rename to packages/documentation-v6/public/images/technologies/logo-stencil.png
diff --git a/packages/documentation-v7/public/images/technologies/logo-storybook.svg b/packages/documentation-v6/public/images/technologies/logo-storybook.svg
similarity index 100%
rename from packages/documentation-v7/public/images/technologies/logo-storybook.svg
rename to packages/documentation-v6/public/images/technologies/logo-storybook.svg
diff --git a/packages/documentation-v7/public/images/technologies/logo-svgo.svg b/packages/documentation-v6/public/images/technologies/logo-svgo.svg
similarity index 100%
rename from packages/documentation-v7/public/images/technologies/logo-svgo.svg
rename to packages/documentation-v6/public/images/technologies/logo-svgo.svg
diff --git a/packages/documentation-v7/public/images/technologies/logo-vue.svg b/packages/documentation-v6/public/images/technologies/logo-vue.svg
similarity index 100%
rename from packages/documentation-v7/public/images/technologies/logo-vue.svg
rename to packages/documentation-v6/public/images/technologies/logo-vue.svg
diff --git a/packages/documentation-v7/public/images/technologies/logo-webpack.svg b/packages/documentation-v6/public/images/technologies/logo-webpack.svg
similarity index 100%
rename from packages/documentation-v7/public/images/technologies/logo-webpack.svg
rename to packages/documentation-v6/public/images/technologies/logo-webpack.svg
diff --git a/packages/documentation-v7/public/netlify.toml b/packages/documentation-v6/public/netlify.toml
similarity index 100%
rename from packages/documentation-v7/public/netlify.toml
rename to packages/documentation-v6/public/netlify.toml
diff --git a/packages/documentation-v7/public/site.webmanifest b/packages/documentation-v6/public/site.webmanifest
similarity index 100%
rename from packages/documentation-v7/public/site.webmanifest
rename to packages/documentation-v6/public/site.webmanifest
diff --git a/packages/documentation/src/stories/Templates/forms/forms.stories.mdx b/packages/documentation-v6/src/stories/Templates/forms/forms.stories.mdx
similarity index 100%
rename from packages/documentation/src/stories/Templates/forms/forms.stories.mdx
rename to packages/documentation-v6/src/stories/Templates/forms/forms.stories.mdx
diff --git a/packages/documentation/src/stories/components/alert/alert-snapshot.stories.mdx b/packages/documentation-v6/src/stories/components/alert/alert-snapshot.stories.mdx
similarity index 100%
rename from packages/documentation/src/stories/components/alert/alert-snapshot.stories.mdx
rename to packages/documentation-v6/src/stories/components/alert/alert-snapshot.stories.mdx
diff --git a/packages/documentation-v7/src/stories/components/alert/alert.docs.mdx b/packages/documentation-v6/src/stories/components/alert/alert.docs.mdx
similarity index 74%
rename from packages/documentation-v7/src/stories/components/alert/alert.docs.mdx
rename to packages/documentation-v6/src/stories/components/alert/alert.docs.mdx
index e037c041aa..2cc50ba047 100644
--- a/packages/documentation-v7/src/stories/components/alert/alert.docs.mdx
+++ b/packages/documentation-v6/src/stories/components/alert/alert.docs.mdx
@@ -1,32 +1,31 @@
-import { Canvas, Controls, Meta } from '@storybook/blocks';
-import * as AlertStories from './alert.stories';
+import { Meta, Canvas, Story, Source, ArgsTable } from '@storybook/addon-docs';
-
+
# Alert
-
- Provide contextual feedback messages for typical user actions with the handful of available and flexible alert
- messages.
-
-
+Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages.
Alerts are available for any length of text, as well as an optional close button.
By default, alerts are rendered with a contextually appropriate icon.
-
-
+
+
+
+
## SCSS Imports
To import all styles from the design-system-styles package:
-```scss
+```css dark
@use '@swisspost/design-system-styles/index.scss';
```
To import only the styles required for this component:
-```scss
+```css dark
@use '@swisspost/design-system-styles/basics.scss';
@use '@swisspost/design-system-styles/components/alert.scss';
```
@@ -39,7 +38,9 @@ The following examples show some of the different characteristics of the compone
Alerts can also contain additional HTML elements like headings, paragraphs, lists, dividers, and more.
-
+
+
+
### Dismissible
@@ -49,13 +50,9 @@ In the end, it's just a button with an `onClick()` event. As this is a CSS-only
Dismiss buttons without text should always provide a `dismiss-label` prop, which defines the hidden text associated with the button.
-
-
-### Action Buttons
-
-To render an action alert with buttons, the alert element requires an additional class as well as additional HTML content. Thus, everything will be rendered as it should be.
-
-
+
+
+
### Fixed
@@ -63,4 +60,14 @@ A fixed alert (at the bottom of the viewport) is obtained by adding the class `.
As this is a CSS-only component, you have to define the logic to show/hide/toggle the alert yourself.
Such an alert is normally also dismissible, so please notice the information for a dismissible alert as well.
-
+
+
+
+
+### Action Buttons
+
+To render an action alert with buttons, the alert element requires an additional class as well as additional HTML content. Thus, everything will be rendered as it should be.
+
+
+
+
diff --git a/packages/documentation/src/stories/components/alert/alert.stories.tsx b/packages/documentation-v6/src/stories/components/alert/alert.stories.tsx
similarity index 100%
rename from packages/documentation/src/stories/components/alert/alert.stories.tsx
rename to packages/documentation-v6/src/stories/components/alert/alert.stories.tsx
diff --git a/packages/documentation/src/stories/components/alert/getAlertClasses.tsx b/packages/documentation-v6/src/stories/components/alert/getAlertClasses.tsx
similarity index 100%
rename from packages/documentation/src/stories/components/alert/getAlertClasses.tsx
rename to packages/documentation-v6/src/stories/components/alert/getAlertClasses.tsx
diff --git a/packages/documentation-v6/src/stories/components/badge/badge.docs.mdx b/packages/documentation-v6/src/stories/components/badge/badge.docs.mdx
new file mode 100644
index 0000000000..64412788de
--- /dev/null
+++ b/packages/documentation-v6/src/stories/components/badge/badge.docs.mdx
@@ -0,0 +1,52 @@
+import { Meta, Canvas, Story, Source, ArgsTable } from '@storybook/addon-docs';
+
+
+
+# Badge
+
+
+ Documentation and examples for badges, our small count and labeling component.
+
+
+
+
+
+
+
+## SCSS Imports
+
+To import all styles from the design-system-styles package:
+
+```css dark
+@use '@swisspost/design-system-styles/index.scss';
+```
+
+To import only the styles required for this component:
+
+```css dark
+@use '@swisspost/design-system-styles/basics.scss';
+@use '@swisspost/design-system-styles/components/badge.scss';
+```
+
+## Concrete Examples of Application
+
+The following examples show the different characteristics of the component. These can differ in the type of visualization, the html structure, as well as when, how and why they are displayed.
+
+### Checkable
+
+A checkable `.badge` is nothing else than a custom-checkbox. Therefore you can manipulate it like every default `checkbox` element.
+
+
+
+
+
+### Dismissible
+
+A dismissible `.badge` can be removed from the UI by the user, by clicking on the close button.
+Close buttons without text should always provide a `dismiss-label` prop, which defines the hidden text associated with the button.
+
+
+
+
diff --git a/packages/documentation/src/stories/components/badge/badge.stories.tsx b/packages/documentation-v6/src/stories/components/badge/badge.stories.tsx
similarity index 100%
rename from packages/documentation/src/stories/components/badge/badge.stories.tsx
rename to packages/documentation-v6/src/stories/components/badge/badge.stories.tsx
diff --git a/packages/documentation-v7/src/stories/components/blockquote/blockquote.docs.mdx b/packages/documentation-v6/src/stories/components/blockquote/blockquote.docs.mdx
similarity index 65%
rename from packages/documentation-v7/src/stories/components/blockquote/blockquote.docs.mdx
rename to packages/documentation-v6/src/stories/components/blockquote/blockquote.docs.mdx
index 7a32ef7d88..f0c165d1a6 100644
--- a/packages/documentation-v7/src/stories/components/blockquote/blockquote.docs.mdx
+++ b/packages/documentation-v6/src/stories/components/blockquote/blockquote.docs.mdx
@@ -1,32 +1,32 @@
-import { Meta, Canvas, Controls } from '@storybook/blocks';
-import * as BlockquoteStories from './blockquote.stories.ts';
+import { Meta, Canvas, Story, Source, ArgsTable } from '@storybook/addon-docs';
-
+
-# Blockquote
+# Badge
-
- For quoting blocks of content from another source within your document. Wrap `
` around any HTML as the quote.
-
-
-
+
+ For quoting blocks of content from another source within your document. Wrap <blockquote
+ class="blockquote"> around any HTML as the quote.
+
+
+
+
## SCSS Imports
To import all styles from the design-system-styles package:
-```scss
+```css dark
@use '@swisspost/design-system-styles/index.scss';
```
To import only the styles required for this component:
-```scss
+```css dark
@use '@swisspost/design-system-styles/basics.scss';
@use '@swisspost/design-system-styles/components/blockquote.scss';
```
@@ -39,4 +39,6 @@ The following examples show the different characteristics of the component. Thes
To add simple quote characters around any nested text within your blockquote, you can wrap it with a <q>
tag.
-
+
+
+
diff --git a/packages/documentation/src/stories/components/blockquote/blockquote.snapshot.stories.mdx b/packages/documentation-v6/src/stories/components/blockquote/blockquote.snapshot.stories.mdx
similarity index 100%
rename from packages/documentation/src/stories/components/blockquote/blockquote.snapshot.stories.mdx
rename to packages/documentation-v6/src/stories/components/blockquote/blockquote.snapshot.stories.mdx
diff --git a/packages/documentation/src/stories/components/blockquote/blockquote.stories.tsx b/packages/documentation-v6/src/stories/components/blockquote/blockquote.stories.tsx
similarity index 100%
rename from packages/documentation/src/stories/components/blockquote/blockquote.stories.tsx
rename to packages/documentation-v6/src/stories/components/blockquote/blockquote.stories.tsx
diff --git a/packages/documentation-v7/src/stories/components/button-group/button-group.docs.mdx b/packages/documentation-v6/src/stories/components/button-group/button-group.docs.mdx
similarity index 70%
rename from packages/documentation-v7/src/stories/components/button-group/button-group.docs.mdx
rename to packages/documentation-v6/src/stories/components/button-group/button-group.docs.mdx
index fce158e002..c430b0fc2b 100644
--- a/packages/documentation-v7/src/stories/components/button-group/button-group.docs.mdx
+++ b/packages/documentation-v6/src/stories/components/button-group/button-group.docs.mdx
@@ -1,30 +1,31 @@
-import { Canvas, Controls, Meta } from '@storybook/blocks';
-import * as ButtonGroupStories from './button-group.stories';
+import { Meta, Canvas, Story, ArgsTable } from '@storybook/addon-docs';
-
+
# Button Group
-
- Group a series of buttons together on a single line.
-
+
+ Group a series of buttons together on a single line or stack them in a vertical column.
+
-
+
+
+
## SCSS Imports
To import all styles from the design-system-styles package:
-```scss
+```css dark
@use '@swisspost/design-system-styles/index.scss';
```
To import only the styles required for this component:
-```scss
+```css dark
@use '@swisspost/design-system-styles/basics.scss';
@use '@swisspost/design-system-styles/components/badge.scss';
```
@@ -38,14 +39,16 @@ The following examples show the different characteristics of the component. Thes
You can change the size of buttons belonging to a group using button-sizing classes: `.btn-sm`, `.btn-rg` and `.btn-lg`.
Just be sure to apply the same class to all buttons contained in the group.
-
+
+
+
### Checkbox & Radio
-
Any HTML element that can be styled as a button can potentially be used in a button group.
It is also possible to use checkable inputs:
-
- Checkboxes: this allows all buttons in the group to be selected or deselected individually,
- Radio buttons: in this case all the buttons are linked and only one of them can be selected at a time.
-
+
+
+
diff --git a/packages/documentation/src/stories/components/button-group/button-group.stories.tsx b/packages/documentation-v6/src/stories/components/button-group/button-group.stories.tsx
similarity index 100%
rename from packages/documentation/src/stories/components/button-group/button-group.stories.tsx
rename to packages/documentation-v6/src/stories/components/button-group/button-group.stories.tsx
diff --git a/packages/documentation/src/stories/components/button/button-snapshot.stories.mdx b/packages/documentation-v6/src/stories/components/button/button-snapshot.stories.mdx
similarity index 100%
rename from packages/documentation/src/stories/components/button/button-snapshot.stories.mdx
rename to packages/documentation-v6/src/stories/components/button/button-snapshot.stories.mdx
diff --git a/packages/documentation-v7/src/stories/components/button/button.docs.mdx b/packages/documentation-v6/src/stories/components/button/button.docs.mdx
similarity index 64%
rename from packages/documentation-v7/src/stories/components/button/button.docs.mdx
rename to packages/documentation-v6/src/stories/components/button/button.docs.mdx
index 613d91d1ee..f32c4827c5 100644
--- a/packages/documentation-v7/src/stories/components/button/button.docs.mdx
+++ b/packages/documentation-v6/src/stories/components/button/button.docs.mdx
@@ -1,32 +1,33 @@
-import { Meta, Canvas, Controls } from '@storybook/blocks';
+import { Meta, Canvas, Story, ArgsTable } from '@storybook/addon-docs';
import LinkTo from '@storybook/addon-links/react';
-import * as ButtonStories from './button.stories';
-
+
# Button
-
+
Use our custom button styles for actions in forms, dialogs, and more with support for multiple
sizes, states, and more.
-
+
-
+
+
+
## SCSS Imports
To import all styles from the design-system-styles package:
-```scss
+```css dark
@use '@swisspost/design-system-styles/index.scss';
```
To import only the styles required for this component:
-```scss
+```css dark
@use '@swisspost/design-system-styles/basics.scss';
@use '@swisspost/design-system-styles/components/button.scss';
@@ -40,20 +41,26 @@ The following examples show the different characteristics of the component. Thes
### Inverted
-Inverted buttons don't need special classes anymore, just use any of the background classes to set the background and you're done for the day.
+Inverted buttons don't need special classes anymore, just use any of the background classes to set the background and you're done for the day.
-
+
+
+
### Accent colors
There are a number of accent colors that you can apply to buttons instead of the usual colors.
-
+
+
+
### Contextual colors
Besides the usual and the accent button variations, there are also contextual button colors.
-These are only allowed for intranet applications!
+These are only allowed for intranet applications!
-
+
+
+
diff --git a/packages/documentation/src/stories/components/button/button.stories.tsx b/packages/documentation-v6/src/stories/components/button/button.stories.tsx
similarity index 99%
rename from packages/documentation/src/stories/components/button/button.stories.tsx
rename to packages/documentation-v6/src/stories/components/button/button.stories.tsx
index 8201f9747b..1630fd1ffb 100644
--- a/packages/documentation/src/stories/components/button/button.stories.tsx
+++ b/packages/documentation-v6/src/stories/components/button/button.stories.tsx
@@ -202,7 +202,7 @@ export default {
const Template = (args: Args) => {
const props = {
key: args.key,
- href: args.tag === 'a' ? 'javascript:void' : undefined,
+ href: args.tag === 'a' ? '#' : undefined,
type: args.tag === 'input' ? args.type : undefined,
value: args.tag === 'input' ? args.text : undefined,
};
diff --git a/packages/documentation-v6/src/stories/components/card/card.docs.mdx b/packages/documentation-v6/src/stories/components/card/card.docs.mdx
new file mode 100644
index 0000000000..f2aff5a867
--- /dev/null
+++ b/packages/documentation-v6/src/stories/components/card/card.docs.mdx
@@ -0,0 +1,85 @@
+import { ArgsTable, Canvas, Meta, Story } from '@storybook/addon-docs';
+
+
+
+# Card
+
+
+ Cards provide a flexible and extensible content container with multiple variants and options.
+
+
+A card is a flexible and extensible content container.
+Built with flexbox, they offer easy alignment and mix well with other components.
+
+Cards have no fixed width to start, so they’ll naturally fill the full width of its parent element.
+Use our sizing examples to customize the size of a card.
+
+Last but not least, our card component is based on the bootstrap card component.
+Please also have a look at their documentation if you want to get more details or see even more examples.
+
+
+
+
+
+
+## SCSS Imports
+
+To import all styles from the design-system-styles package:
+
+```css dark
+@use '@swisspost/design-system-styles/index.scss';
+```
+
+To import only the styles required for this component:
+
+```css dark
+@use '@swisspost/design-system-styles/basics.scss';
+@use '@swisspost/design-system-styles/components/card.scss';
+```
+
+## Concrete Examples of Application
+
+The following examples show the different characteristics of the component. These can differ in the type of visualization, the html structure, as well as when, how and why they are displayed.
+
+### List Groups
+
+Create lists of content in a card with a flush list group.
+Simply replace or complement the `.card-body` with a `.list-group` element.
+
+
+
+
+
+### Custom Content
+
+Expect from the available space, there are no restrictions on what can be integrated into the `.card-header`, `.card-body`, `.list-group` and `.card-footer` elements.
+
+
+
+
+
+### Groups
+
+With the wrapper element `.card-group` you can group cards and adjust their height automatically line by line.
+
+
+
+
+
+### Image overlay
+
+
+
+
+
+
+
Bad Example
+
+ Don't do this at any time.
+
+ It's very difficult for content editors to always ensure that text is legible on an image for
+ every browser size and all different languages.
+
+
diff --git a/packages/documentation/src/stories/components/card/card.snapshot.stories.mdx b/packages/documentation-v6/src/stories/components/card/card.snapshot.stories.mdx
similarity index 100%
rename from packages/documentation/src/stories/components/card/card.snapshot.stories.mdx
rename to packages/documentation-v6/src/stories/components/card/card.snapshot.stories.mdx
diff --git a/packages/documentation/src/stories/components/card/card.stories.tsx b/packages/documentation-v6/src/stories/components/card/card.stories.tsx
similarity index 100%
rename from packages/documentation/src/stories/components/card/card.stories.tsx
rename to packages/documentation-v6/src/stories/components/card/card.stories.tsx
diff --git a/packages/documentation-v6/src/stories/components/checkbox/checkbox.docs.mdx b/packages/documentation-v6/src/stories/components/checkbox/checkbox.docs.mdx
new file mode 100644
index 0000000000..41bf4edd8a
--- /dev/null
+++ b/packages/documentation-v6/src/stories/components/checkbox/checkbox.docs.mdx
@@ -0,0 +1,82 @@
+import { Meta, Canvas, Story, Source, ArgsTable } from '@storybook/addon-docs';
+import LinkTo from '@storybook/addon-links/react';
+
+
+
+# Checkbox
+
+
+ Customize the native <input type="checkbox">
with CSS that changes the
+ element’s initial appearance. Consistent, cross-browser and cross-device.
+
+
+Our checks use custom icons to indicate checked or indeterminate states.
+
+
+
+
+
+
+## SCSS Imports
+
+To import all styles from the design-system-styles package:
+
+```css dark
+@use '@swisspost/design-system-styles/index.scss';
+```
+
+To import only the styles required for this component:
+
+```css dark
+@use '@swisspost/design-system-styles/basics.scss';
+@use '@swisspost/design-system-styles/components/form-check.scss';
+
+// required if you use validation feedbacks
+@use '@swisspost/design-system-styles/components/form-feedback.scss';
+```
+
+## Concrete Examples of Application
+
+The following examples show the different characteristics of the component. These can differ in the type of visualization, the html structure, as well as when, how and why they are displayed.
+
+### Indeterminate
+
+Normally a checkbox input can only have two states: `checked` or `unchecked`. They can have any value, but they either submit that value (checked) or don't (unchecked) with a form submission.
+
+Visually, there are three states a checkbox can be in: `checked`, `unchecked`, or `indeterminate`.
+The `indeterminate` state is visual only. The checkbox is still either **checked** or **unchecked** as a value. That means the visual `indeterminate` state masks the real value of the checkbox. A possible use case for this state could be a list of checkboxes with one to toggle them all as in a folder/subfolder tree and only a part of the subfolders are selected. For an example visit [Accessible Web Designs indeterminate checkbox](http://www.barrierefreies-webdesign.de/knowhow/checkbox/indeterminate.html).
+
+A native ` ` supports this `indeterminate` visual state which can only be set through JavaScript. It is then styled using the `:indeterminate` pseudo-class.
+
+```javascript dark
+document.querySelector('input[type="checkbox"]').indeterminate = true;
+```
+
+### Inline
+
+To render a checkbox inline, simply add the class `.form-check-inline` to the `.form-check` wrapper element.
+
+
+ Remember to wrap your checkbox group with a <fieldset>
including a{' '}
+ <legend>
tag. This is the group label.
+
+ You can read more about that topic at our{' '}
+ grouping accessibility guide .
+
+
+To visually hide the `` element, use the `.visually-hidden` class.
+
+
+
+
+
+### Validation
+
+Simply add the classes `.is-valid` or `.is-invalid` to the `checkbox` element to show it in the expected state.
+When the component has been validated, don't forget to add a `...
` or `...
` element after the checkbox element to explain what went wrong. This enables the user to correct the mistake.
+
+
+
+
diff --git a/packages/documentation/src/stories/components/checkbox/checkbox.stories.tsx b/packages/documentation-v6/src/stories/components/checkbox/checkbox.stories.tsx
similarity index 100%
rename from packages/documentation/src/stories/components/checkbox/checkbox.stories.tsx
rename to packages/documentation-v6/src/stories/components/checkbox/checkbox.stories.tsx
diff --git a/packages/documentation/src/stories/components/choice-control-card/checkbox-card.docs.mdx b/packages/documentation-v6/src/stories/components/choice-control-card/checkbox-card.docs.mdx
similarity index 100%
rename from packages/documentation/src/stories/components/choice-control-card/checkbox-card.docs.mdx
rename to packages/documentation-v6/src/stories/components/choice-control-card/checkbox-card.docs.mdx
diff --git a/packages/documentation/src/stories/components/choice-control-card/checkbox-card.stories.tsx b/packages/documentation-v6/src/stories/components/choice-control-card/checkbox-card.stories.tsx
similarity index 100%
rename from packages/documentation/src/stories/components/choice-control-card/checkbox-card.stories.tsx
rename to packages/documentation-v6/src/stories/components/choice-control-card/checkbox-card.stories.tsx
diff --git a/packages/documentation/src/stories/components/choice-control-card/choice-card-snapshot.stories.mdx b/packages/documentation-v6/src/stories/components/choice-control-card/choice-card-snapshot.stories.mdx
similarity index 100%
rename from packages/documentation/src/stories/components/choice-control-card/choice-card-snapshot.stories.mdx
rename to packages/documentation-v6/src/stories/components/choice-control-card/choice-card-snapshot.stories.mdx
diff --git a/packages/documentation/src/stories/components/choice-control-card/choice-card.tsx b/packages/documentation-v6/src/stories/components/choice-control-card/choice-card.tsx
similarity index 100%
rename from packages/documentation/src/stories/components/choice-control-card/choice-card.tsx
rename to packages/documentation-v6/src/stories/components/choice-control-card/choice-card.tsx
diff --git a/packages/documentation/src/stories/components/choice-control-card/radio-button-card.docs.mdx b/packages/documentation-v6/src/stories/components/choice-control-card/radio-button-card.docs.mdx
similarity index 100%
rename from packages/documentation/src/stories/components/choice-control-card/radio-button-card.docs.mdx
rename to packages/documentation-v6/src/stories/components/choice-control-card/radio-button-card.docs.mdx
diff --git a/packages/documentation/src/stories/components/choice-control-card/radio-button-card.stories.tsx b/packages/documentation-v6/src/stories/components/choice-control-card/radio-button-card.stories.tsx
similarity index 100%
rename from packages/documentation/src/stories/components/choice-control-card/radio-button-card.stories.tsx
rename to packages/documentation-v6/src/stories/components/choice-control-card/radio-button-card.stories.tsx
diff --git a/packages/documentation-v7/src/stories/components/collapsible/collapsible.docs.mdx b/packages/documentation-v6/src/stories/components/collapsible/collapsible.docs.mdx
similarity index 78%
rename from packages/documentation-v7/src/stories/components/collapsible/collapsible.docs.mdx
rename to packages/documentation-v6/src/stories/components/collapsible/collapsible.docs.mdx
index ee036ee7cb..6129004ef7 100644
--- a/packages/documentation-v7/src/stories/components/collapsible/collapsible.docs.mdx
+++ b/packages/documentation-v6/src/stories/components/collapsible/collapsible.docs.mdx
@@ -1,7 +1,6 @@
-import { Canvas, Controls, Meta } from '@storybook/blocks';
-import * as CollapsibleStories from './collapsible.stories';
+import { Meta, Canvas, Story, Source, ArgsTable } from '@storybook/addon-docs';
-
+
# Collapsible
@@ -10,8 +9,11 @@ import * as CollapsibleStories from './collapsible.stories';
The `` component is used to show and hide content.
Collapsing an element will animate the height from its current value to 0.
-
-
+
+
+
+
+
## Examples
@@ -21,13 +23,17 @@ The following examples show different use cases for the `` com
To make the collapsible content hidden by default, just use the `collapsible="true"` property.
-
+
+
+
### Heading Level
Use the `heading-level` property to define the hierarchical level of the collapsible header within the structure of a document.
-
+
+
+
### Intricate Content
@@ -36,7 +42,10 @@ to allow any HTML content to be used as part of its header and body.
By default, all children are appended to the component's body.
For a specific child to be displayed in the header, a `slot="header"` attribute must be added.
-
+
+
+
+
### Custom Trigger
@@ -44,7 +53,7 @@ The `` component exposes a `.toggle()` method that allows to t
This method is asynchronous and returns a promise that resolves with the current open state.
It optionally takes a boolean parameter that forces open when `true` or close when `false`.
-```typescript
+```typescript dark
const collapsible = document.querySelector('#collapsibleId') as HTMLPostCollapsibleElement;
collapsible.toggle(/* open: boolean */).then((/* isOpen: boolean */) => {});
```
@@ -57,4 +66,6 @@ Also make sure to add an `aria-expanded` attribute to the control element:
if the collapsible element is closed, the attribute on the control element must have a value of `aria-expanded="false"`
and `aria-expanded="true"` otherwise.
-
+
+
+
diff --git a/packages/documentation/src/stories/components/collapsible/collapsible.stories.tsx b/packages/documentation-v6/src/stories/components/collapsible/collapsible.stories.tsx
similarity index 100%
rename from packages/documentation/src/stories/components/collapsible/collapsible.stories.tsx
rename to packages/documentation-v6/src/stories/components/collapsible/collapsible.stories.tsx
diff --git a/packages/documentation-v6/src/stories/components/heading/heading.docs.mdx b/packages/documentation-v6/src/stories/components/heading/heading.docs.mdx
new file mode 100644
index 0000000000..8cfa665fa1
--- /dev/null
+++ b/packages/documentation-v6/src/stories/components/heading/heading.docs.mdx
@@ -0,0 +1,35 @@
+import { Meta, Canvas, Story, ArgsTable } from '@storybook/addon-docs';
+import LinkTo from '@storybook/addon-links/react';
+
+
+
+# Button
+
+
+ Use our custom heading styles to create to display semantically correct and appealing headings.
+
+
+All HTML headings, `h1` through `h6`, are available.
+If you only want to make content appear like headings without using a semantic element, you should pay attention to our heading utilities .
+
+
+
+
+
+
+## SCSS Imports
+
+To import all styles from the design-system-styles package:
+
+```css dark
+@use '@swisspost/design-system-styles/index.scss';
+```
+
+To import only the styles required for this component:
+
+```css dark
+@use '@swisspost/design-system-styles/basics.scss';
+@use '@swisspost/design-system-styles/components/type.scss';
+```
diff --git a/packages/documentation/src/stories/components/heading/heading.snapshot.stories.mdx b/packages/documentation-v6/src/stories/components/heading/heading.snapshot.stories.mdx
similarity index 100%
rename from packages/documentation/src/stories/components/heading/heading.snapshot.stories.mdx
rename to packages/documentation-v6/src/stories/components/heading/heading.snapshot.stories.mdx
diff --git a/packages/documentation/src/stories/components/heading/heading.stories.tsx b/packages/documentation-v6/src/stories/components/heading/heading.stories.tsx
similarity index 100%
rename from packages/documentation/src/stories/components/heading/heading.stories.tsx
rename to packages/documentation-v6/src/stories/components/heading/heading.stories.tsx
diff --git a/packages/documentation-v6/src/stories/components/input-group/input-group.docs.mdx b/packages/documentation-v6/src/stories/components/input-group/input-group.docs.mdx
new file mode 100644
index 0000000000..c2f74f5481
--- /dev/null
+++ b/packages/documentation-v6/src/stories/components/input-group/input-group.docs.mdx
@@ -0,0 +1,8 @@
+import { Canvas, Story, ArgsTable } from '@storybook/addon-docs';
+
+# Input-Group
+
+
+
TODO:
+
Make them work in styles and document it afterwards
+
diff --git a/packages/documentation/src/stories/components/input-group/input-group.stories.tsx b/packages/documentation-v6/src/stories/components/input-group/input-group.stories.tsx
similarity index 100%
rename from packages/documentation/src/stories/components/input-group/input-group.stories.tsx
rename to packages/documentation-v6/src/stories/components/input-group/input-group.stories.tsx
diff --git a/packages/documentation-v7/src/stories/components/input/input.docs.mdx b/packages/documentation-v6/src/stories/components/input/input.docs.mdx
similarity index 74%
rename from packages/documentation-v7/src/stories/components/input/input.docs.mdx
rename to packages/documentation-v6/src/stories/components/input/input.docs.mdx
index f16f22f279..48fb9a505a 100644
--- a/packages/documentation-v7/src/stories/components/input/input.docs.mdx
+++ b/packages/documentation-v6/src/stories/components/input/input.docs.mdx
@@ -1,33 +1,32 @@
-import { Canvas, Controls, Meta } from '@storybook/blocks';
-import * as InputStories from './input.stories';
-
-
+import { Canvas, Story, Source, ArgsTable } from '@storybook/addon-docs';
# Text input
-
+
Customize the native <input>
with CSS that changes the element’s initial
appearance.
-
+
Custom input elements need only the class `.form-control` to trigger the custom styles.
-
+
+
+
## SCSS Imports
To import all styles from the design-system-styles package:
-```scss
+```css dark
@use '@swisspost/design-system-styles/index.scss';
```
To import only the styles required for this component:
-```scss
+```css dark
@use '@swisspost/design-system-styles/basics.scss';
@use '@swisspost/design-system-styles/components/forms.scss';
@@ -47,7 +46,9 @@ The following examples show the different characteristics of the component. Thes
Wrap a pair of ` ` and `` elements in a `.form-floating` container to enable floating labels.
But note that the ` ` element must come first, so we can ensure the correct styles.
-
+
+
+
### Sizing
@@ -60,17 +61,21 @@ The size can be changed by simply adding one of four classes:
Do not apply size classes on floating-label elements
-
+
It is not intended to apply the size classes to input
elements that are nested in a{' '}
.form-floating
container.
-
+
-
+
+
+
### Validation
Simply add the classes `.is-valid` or `.is-invalid` to the ` ` element to show it in the expected state.
-When the component has been validated, don't forget to add a `...
` or `...
` element after the `input` element to explain what went wrong. This enables the user to correct the mistake.
+When the component has been validated, don't forget to add a `...
` or `...
` element after the `input` element to explain what went wrong. This enables the user to correct the mistake.
-
+
+
+
diff --git a/packages/documentation/src/stories/components/input/input.stories.tsx b/packages/documentation-v6/src/stories/components/input/input.stories.tsx
similarity index 100%
rename from packages/documentation/src/stories/components/input/input.stories.tsx
rename to packages/documentation-v6/src/stories/components/input/input.stories.tsx
diff --git a/packages/documentation-v7/src/stories/components/radio/radio.docs.mdx b/packages/documentation-v6/src/stories/components/radio/radio.docs.mdx
similarity index 76%
rename from packages/documentation-v7/src/stories/components/radio/radio.docs.mdx
rename to packages/documentation-v6/src/stories/components/radio/radio.docs.mdx
index 4bf20341dc..8e1028d853 100644
--- a/packages/documentation-v7/src/stories/components/radio/radio.docs.mdx
+++ b/packages/documentation-v6/src/stories/components/radio/radio.docs.mdx
@@ -1,34 +1,35 @@
-import { Canvas, Controls, Meta } from '@storybook/blocks';
+import { Meta, Canvas, Story, ArgsTable } from '@storybook/addon-docs';
+import LinkTo from '@storybook/addon-links/react';
-import * as RadioStories from './radio.stories';
-
-
+
# Radio
-
+
Customize the native <input type="radio">
with CSS that changes the element’s
initial appearance. Consistent, cross-browser and cross-device.
-
+
Our radios use custom icons to indicate checked states.
-
+
+
+
## SCSS Imports
To import all styles from the design-system-styles package:
-```scss
+```css dark
@use '@swisspost/design-system-styles/index.scss';
```
To import only the styles required for this component:
-```scss
+```css dark
@use '@swisspost/design-system-styles/basics.scss';
@use '@swisspost/design-system-styles/components/form-check.scss';
@@ -49,16 +50,20 @@ To render a radio inline, simply add the class `.form-check-inline` to the `.for
<legend>
tag. This provides a label for your radio group.
For more information, read our{' '}
- grouping accessibility guide .
+ grouping accessibility guide .
To visually hide the `` element, use the `.visually-hidden` class.
-
+
+
+
### Validation
Simply add the classes `.is-valid` or `.is-invalid` to the `radio` element to show it in the expected state.
When the component has been validated, don't forget to add a `...
` or `...
` element after the `radio` element to explain what went wrong. This enables the user to correct the mistake.
-
+
+
+
diff --git a/packages/documentation/src/stories/components/radio/radio.stories.tsx b/packages/documentation-v6/src/stories/components/radio/radio.stories.tsx
similarity index 100%
rename from packages/documentation/src/stories/components/radio/radio.stories.tsx
rename to packages/documentation-v6/src/stories/components/radio/radio.stories.tsx
diff --git a/packages/documentation-v7/src/stories/components/range/range.docs.mdx b/packages/documentation-v6/src/stories/components/range/range.docs.mdx
similarity index 71%
rename from packages/documentation-v7/src/stories/components/range/range.docs.mdx
rename to packages/documentation-v6/src/stories/components/range/range.docs.mdx
index 29ed32c1dd..ef571fd9d0 100644
--- a/packages/documentation-v7/src/stories/components/range/range.docs.mdx
+++ b/packages/documentation-v6/src/stories/components/range/range.docs.mdx
@@ -1,34 +1,34 @@
-import { Canvas, Controls, Meta } from '@storybook/blocks';
+import { Meta, Canvas, Story, ArgsTable } from '@storybook/addon-docs';
-import * as RangeStories from './range.stories';
-
-
+
# Range
-
+
Use our custom <input type="range" />
for consistent cross-browser styling and
built-in customization.
-
+
Create custom `range` controls with `.form-range`. The track (the background) and thumb (the value) are both styled to appear the same across browsers.
-
+
+
+
## SCSS Imports
To import all styles from the design-system-styles package:
-```scss
+```css dark
@use '@swisspost/design-system-styles/index.scss';
```
To import only the styles required for this component:
-```scss
+```css dark
@use '@swisspost/design-system-styles/basics.scss';
@use '@swisspost/design-system-styles/components/form-range.scss';
@@ -45,11 +45,15 @@ The following examples show the different characteristics of the component. Thes
Range inputs have implicit values for `min` and `max` (0 and 100 respectively), and snap to integer values by default.
You may specify new values for those using the `min`, `max` and `step` attributes.
-
+
+
+
### Validation
Simply add the classes `.is-valid` or `.is-invalid` to the `range` element to show it in the expected state.
-When the component has been validated, don't forget to add a `...
` or `...
` element after the `range` element to explain what went wrong. This enables the user to correct the mistake.
+When the component has been validated, don't forget to add a `...
` or `...
` element after the `range` element to explain what went wrong. This enables the user to correct the mistake.
-
+
+
+
diff --git a/packages/documentation/src/stories/components/range/range.stories.tsx b/packages/documentation-v6/src/stories/components/range/range.stories.tsx
similarity index 100%
rename from packages/documentation/src/stories/components/range/range.stories.tsx
rename to packages/documentation-v6/src/stories/components/range/range.stories.tsx
diff --git a/packages/documentation-v7/src/stories/components/select/select.docs.mdx b/packages/documentation-v6/src/stories/components/select/select.docs.mdx
similarity index 83%
rename from packages/documentation-v7/src/stories/components/select/select.docs.mdx
rename to packages/documentation-v6/src/stories/components/select/select.docs.mdx
index ee4602e1e2..d7ff11ae85 100644
--- a/packages/documentation-v7/src/stories/components/select/select.docs.mdx
+++ b/packages/documentation-v6/src/stories/components/select/select.docs.mdx
@@ -1,33 +1,34 @@
-import { Meta, Canvas, Controls } from '@storybook/blocks';
-import * as SelectStories from './select.stories';
+import { Meta, Canvas, Story, Source, ArgsTable } from '@storybook/addon-docs';
-
+
# Select
-
+
Customize the native <select>
with CSS that changes the element’s initial
appearance.
-
+
Custom `` menus need only the class `.form-select` to trigger the custom styles. Custom styles are limited to the ``’s initial appearance and cannot modify the `` elements due to browser limitations.
-
+
+
+
## SCSS Imports
To import all styles from the design-system-styles package:
-```scss
+```css dark
@use '@swisspost/design-system-styles/index.scss';
```
To import only the styles required for this component:
-```scss
+```css dark
@use '@swisspost/design-system-styles/basics.scss';
@use '@swisspost/design-system-styles/components/forms.scss';
@use '@swisspost/design-system-styles/components/form-select.scss';
@@ -48,7 +49,9 @@ The following examples show the different characteristics of the component. Thes
Wrap a pair of `` and `` elements in a `.form-floating` container to enable floating labels.
But note that the `` must come first, so we can ensure the correct styles.
-
+
+
+
### Sizing
@@ -64,11 +67,15 @@ The size can be adjusted, by simply adding one of the following four classes:
.form-floating
container.
-