From 238597b51b6dcb9ba435d668ec512adb65be317c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20F=C3=BCrhoff?= <12294151+imagoiq@users.noreply.github.com> Date: Mon, 11 Mar 2024 11:32:48 +0100 Subject: [PATCH] chore(documentation): Rework getting started section and add Angular CUSTOM_ELEMENTS_SCHEMA info (#2722) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add a getting started page in the getting started section with a table to better understand the different packages * Move docs page about packages into a packages folder. This include the page that you can find in specific components like `icon`, `internet-header`, `intranet-header` * Remove list of components inside `preview.ts` as with the previous changes folders are not required, and we can let (for the moment at least) Storybook manage order * Move list of icons into foundations * Add new page about Angular * Add `Components-Angular` into compatibility page * Move migration-guide for the internet-header package into the package page. * Fixes * Change some typos like "swiss" to "Swiss" * Fixes some links that were not using the right prefix "href="?path" to "href="/?path" * Fix "Notification overlay" story which is missing an id ### Todo/discuss * We should perhaps merge the stories of the internet-header to match other components structure. --------- Co-authored-by: Alizé Debray <33580481+alizedebray@users.noreply.github.com> Co-authored-by: Oliver Schürch --- .changeset/old-pumas-sit.md | 5 + .../complex-card-demo.component.html | 2 +- packages/documentation/.storybook/preview.ts | 39 +--- .../.storybook/styles/preview.scss | 6 +- packages/documentation/package.json | 1 + packages/documentation/src/noop.txt | 1 - .../documentation/src/shared/packages.data.ts | 152 ++++++++++++++ .../src/shared/tile/tile.component.scss | 100 ++++++++++ .../src/shared/tile/tile.component.ts | 31 +++ .../components/accordion/accordion.stories.ts | 6 +- .../alert/standard-html/alert.stories.ts | 8 +- .../alert/web-component/post-alert.stories.ts | 8 +- .../stories/components/badge/badge.stories.ts | 6 +- .../blockquote/blockquote.stories.ts | 6 +- .../button-group/button-group.stories.ts | 6 +- .../components/button/button.stories.ts | 8 +- .../cards/card-button/card-button.stories.ts | 9 +- .../components/cards/card/card.stories.ts | 6 +- .../product-card/product-card.stories.ts | 6 +- .../components/carousel/carousel.stories.ts | 6 +- .../collapsible/collapsible.stories.ts | 6 +- .../datepicker/datepicker.stories.ts | 6 +- .../components/dropdown/dropdown.stories.ts | 5 +- .../forms/checkbox/checkbox.stories.ts | 6 +- .../choice-card/checkbox-card.stories.ts | 6 +- .../forms/choice-card/choice-card.ts | 5 +- .../choice-card/radiobutton-card.stories.ts | 8 +- .../custom-select/custom-select.stories.ts | 6 +- .../components/forms/input/input.stories.ts | 6 +- .../components/forms/radio/radio.stories.ts | 8 +- .../components/forms/range/range.stories.ts | 6 +- .../components/forms/select/select.stories.ts | 6 +- .../components/forms/switch/switch.stories.ts | 6 +- .../forms/textarea/textarea.stories.ts | 6 +- .../components/heading/heading.stories.ts | 6 +- .../icons/getting-started.stories.ts | 15 -- .../icons/{components => }/icon.docs.mdx | 0 .../icons/{components => }/icon.stories.ts | 12 +- .../search-icons/search-icons.stories.ts | 12 -- .../breadcrumbs/breadcrumbs.docs.mdx | 0 .../breadcrumbs/breadcrumbs.stories.ts | 8 +- .../overrides/breadcrumbs-config.docs.mdx | 0 .../overrides/breadcrumbs-config.stories.ts | 0 .../breadcrumbs/overrides/custom-items.ts | 0 .../custom-config/custom-footer-config.ts | 0 .../custom-config/footer-config.docs.mdx | 0 .../custom-config/footer-config.stories.ts | 0 .../{components => }/footer/footer.docs.mdx | 0 .../{components => }/footer/footer.stories.ts | 6 +- .../internet-header/getting-started.docs.mdx | 100 ---------- .../getting-started.stories.ts | 15 -- .../header/config/custom-config.ts | 0 .../config/language-switch-overrides.ts | 0 .../header/config/os-flyout-overrides.ts | 0 .../{components => }/header/header.docs.mdx | 0 .../{components => }/header/header.scss | 0 .../{components => }/header/header.stories.ts | 8 +- .../header-custom-config.docs.mdx | 0 .../header-custom-config.stories.ts | 0 .../header-custom-content.docs.mdx | 0 .../header-custom-content.stories.ts | 0 .../header-language-switch-overrides.docs.mdx | 0 ...eader-language-switch-overrides.stories.ts | 0 .../header-os-flyout-overrides.docs.mdx | 0 .../header-os-flyout-overrides.stories.ts | 0 .../internet-header/migration-guide.docs.mdx | 91 --------- .../migration-guide.stories.ts | 15 -- .../intranet-header/intranet-header.docs.mdx | 6 +- .../intranet-header.stories.ts | 5 +- .../stories/components/modal/modal.stories.ts | 6 +- .../notification-overlay.stories.ts | 9 +- .../pagination/pagination.stories.ts | 6 +- .../components/popover/popover.stories.ts | 6 +- .../progressbar/progressbar.stories.ts | 6 +- .../components/rating/post-rating.stories.ts | 6 +- .../spinner/spinner.snapshot.stories.ts | 4 +- .../components/spinner/spinner.stories.ts | 7 +- .../components/stepper/stepper.stories.ts | 6 +- .../subnavigation/subnavigation.stories.ts | 7 +- .../stories/components/table/table.stories.ts | 6 +- .../stories/components/tabs/tabs.stories.ts | 6 +- .../timepicker/timepicker.stories.ts | 6 +- .../stories/components/toast/toast.stories.ts | 8 +- .../components/tooltip/tooltip.stories.ts | 6 +- .../topic-teaser/topic-teaser.stories.ts | 6 +- .../components/typeahead/typeahead.stories.ts | 6 +- .../accessibility/accessibility.stories.ts | 5 +- .../stories/foundation/color/color.stories.ts | 5 +- .../foundation/elevation/elevation.stories.ts | 5 +- .../icons}/search-icons.blocks.tsx | 0 .../icons}/search-icons.docs.mdx | 2 +- .../foundation/icons/search-icons.stories.ts | 13 ++ .../icons}/search-icons.styles.scss | 0 .../layout/breakpoints/breakpoints.stories.ts | 5 +- .../layout/columns/columns.stories.ts | 5 +- .../layout/containers/containers.stories.ts | 5 +- .../foundation/layout/grid/grid.stories.ts | 5 +- .../typography/typography.stories.ts | 5 +- .../getting-started/angular/angular.docs.mdx | 89 +++++++++ .../angular/angular.stories.ts | 16 ++ .../angular/angular.styles.scss | 13 ++ .../angular/sample-icons-config.sample.json} | 0 ...b-components-angular-manually.component.ts | 6 + .../compatibility/compatibility.docs.mdx | 49 ++++- .../compatibility/compatibility.stories.ts | 5 +- .../components-angular/angular.stories.ts | 15 -- .../components/components.stories.ts | 15 -- .../getting-started/introduction.docs.mdx | 121 ++++++++++++ .../getting-started/introduction.stories.ts | 16 ++ .../stories/getting-started/list-component.ts | 98 +++++++++ .../angular-app-component.sample.html | 0 .../angular-app-module.sample.ts | 0 .../components-angular.docs.mdx} | 2 +- .../components-angular.stories.ts | 16 ++ ...ponents-cdn-bare-component-all.sample.html | 0 ...components-cdn-lazy-loaded-all.sample.html | 0 ...nents-cdn-lazy-loaded-specific.sample.html | 0 .../components/components-js-all.sample.js | 0 .../components-js-specific.sample.js | 0 .../components/components.docs.mdx | 0 .../packages/components/components.stories.ts | 16 ++ .../package-icons-icon-meta.sample.html} | 0 .../package-icons-node-16.7.0.sample.json} | 0 .../icons/package-icons-node-old.sample.js} | 0 .../icons/package-icons-node-old.sample.json} | 0 .../packages/icons/package-icons.mdx} | 24 +-- .../packages/icons/package-icons.stories.ts | 16 ++ .../internet-header-bare-component.sample.js | 0 ...rnet-header-cdn-bare-component.sample.html | 0 ...nternet-header-cdn-lazy-loaded.sample.html | 0 ...internet-header-fix-app-styles.sample.html | 0 .../internet-header-frameworks.sample.html | 0 .../internet-header-install.sample.html | 0 .../internet-header-lazy-loaded.sample.js | 0 .../internet-header-old.sample.html | 0 .../internet-header-reference.sample.ts | 0 .../internet-header/internet-header.docs.mdx | 187 ++++++++++++++++++ .../internet-header.stories.ts | 16 ++ .../intranet-header/intranet-header.docs.mdx | 32 +++ .../intranet-header.stories.ts | 16 ++ .../styles/styles-variable.sample.scss | 2 +- .../{ => packages}/styles/styles.docs.mdx | 4 +- .../packages/styles/styles.stories.ts | 16 ++ .../getting-started/styles/styles.stories.ts | 15 -- .../documentation/src/stories/home.blocks.tsx | 19 -- .../documentation/src/stories/home.data.ts | 69 +------ .../documentation/src/stories/home.docs.mdx | 26 +-- .../documentation/src/stories/home.stories.ts | 5 +- .../src/stories/home.styles.scss | 96 +-------- .../misc/changelog/changelog.stories.ts | 5 +- .../migration-guide.stories.ts | 5 +- .../stories/misc/versions/versions.stories.ts | 5 +- .../stories/patterns/forms/forms.stories.ts | 5 +- .../patterns/metadata/metadata.stories.ts | 5 +- .../background/background.stories.ts | 5 +- .../stories/utilities/list/list.stories.ts | 5 +- .../utilities/sizing/sizing.stories.ts | 5 +- .../utilities/spacing/spacing.stories.ts | 5 +- .../stories/utilities/text/text.stories.ts | 5 +- packages/documentation/types/index.ts | 2 + packages/documentation/types/package.ts | 9 + packages/documentation/types/storybook.ts | 13 ++ pnpm-lock.yaml | 11 +- 163 files changed, 1368 insertions(+), 696 deletions(-) create mode 100644 .changeset/old-pumas-sit.md delete mode 100644 packages/documentation/src/noop.txt create mode 100644 packages/documentation/src/shared/packages.data.ts create mode 100644 packages/documentation/src/shared/tile/tile.component.scss create mode 100644 packages/documentation/src/shared/tile/tile.component.ts delete mode 100644 packages/documentation/src/stories/components/icons/getting-started.stories.ts rename packages/documentation/src/stories/components/icons/{components => }/icon.docs.mdx (100%) rename packages/documentation/src/stories/components/icons/{components => }/icon.stories.ts (94%) delete mode 100644 packages/documentation/src/stories/components/icons/search-icons/search-icons.stories.ts rename packages/documentation/src/stories/components/internet-header/{components => }/breadcrumbs/breadcrumbs.docs.mdx (100%) rename packages/documentation/src/stories/components/internet-header/{components => }/breadcrumbs/breadcrumbs.stories.ts (84%) rename packages/documentation/src/stories/components/internet-header/{components => }/breadcrumbs/overrides/breadcrumbs-config.docs.mdx (100%) rename packages/documentation/src/stories/components/internet-header/{components => }/breadcrumbs/overrides/breadcrumbs-config.stories.ts (100%) rename packages/documentation/src/stories/components/internet-header/{components => }/breadcrumbs/overrides/custom-items.ts (100%) rename packages/documentation/src/stories/components/internet-header/{components => }/footer/custom-config/custom-footer-config.ts (100%) rename packages/documentation/src/stories/components/internet-header/{components => }/footer/custom-config/footer-config.docs.mdx (100%) rename packages/documentation/src/stories/components/internet-header/{components => }/footer/custom-config/footer-config.stories.ts (100%) rename packages/documentation/src/stories/components/internet-header/{components => }/footer/footer.docs.mdx (100%) rename packages/documentation/src/stories/components/internet-header/{components => }/footer/footer.stories.ts (87%) delete mode 100644 packages/documentation/src/stories/components/internet-header/getting-started.docs.mdx delete mode 100644 packages/documentation/src/stories/components/internet-header/getting-started.stories.ts rename packages/documentation/src/stories/components/internet-header/{components => }/header/config/custom-config.ts (100%) rename packages/documentation/src/stories/components/internet-header/{components => }/header/config/language-switch-overrides.ts (100%) rename packages/documentation/src/stories/components/internet-header/{components => }/header/config/os-flyout-overrides.ts (100%) rename packages/documentation/src/stories/components/internet-header/{components => }/header/header.docs.mdx (100%) rename packages/documentation/src/stories/components/internet-header/{components => }/header/header.scss (100%) rename packages/documentation/src/stories/components/internet-header/{components => }/header/header.stories.ts (95%) rename packages/documentation/src/stories/components/internet-header/{components => }/header/overrides-stories/header-custom-config.docs.mdx (100%) rename packages/documentation/src/stories/components/internet-header/{components => }/header/overrides-stories/header-custom-config.stories.ts (100%) rename packages/documentation/src/stories/components/internet-header/{components => }/header/overrides-stories/header-custom-content.docs.mdx (100%) rename packages/documentation/src/stories/components/internet-header/{components => }/header/overrides-stories/header-custom-content.stories.ts (100%) rename packages/documentation/src/stories/components/internet-header/{components => }/header/overrides-stories/header-language-switch-overrides.docs.mdx (100%) rename packages/documentation/src/stories/components/internet-header/{components => }/header/overrides-stories/header-language-switch-overrides.stories.ts (100%) rename packages/documentation/src/stories/components/internet-header/{components => }/header/overrides-stories/header-os-flyout-overrides.docs.mdx (100%) rename packages/documentation/src/stories/components/internet-header/{components => }/header/overrides-stories/header-os-flyout-overrides.stories.ts (100%) delete mode 100644 packages/documentation/src/stories/components/internet-header/migration-guide.docs.mdx delete mode 100644 packages/documentation/src/stories/components/internet-header/migration-guide.stories.ts rename packages/documentation/src/stories/{components/icons/search-icons => foundation/icons}/search-icons.blocks.tsx (100%) rename packages/documentation/src/stories/{components/icons/search-icons => foundation/icons}/search-icons.docs.mdx (96%) create mode 100644 packages/documentation/src/stories/foundation/icons/search-icons.stories.ts rename packages/documentation/src/stories/{components/icons/search-icons => foundation/icons}/search-icons.styles.scss (100%) create mode 100644 packages/documentation/src/stories/getting-started/angular/angular.docs.mdx create mode 100644 packages/documentation/src/stories/getting-started/angular/angular.stories.ts create mode 100644 packages/documentation/src/stories/getting-started/angular/angular.styles.scss rename packages/documentation/src/stories/{components/icons/getting-started-angular-config.sample.json => getting-started/angular/sample-icons-config.sample.json} (100%) create mode 100644 packages/documentation/src/stories/getting-started/angular/sample-web-components-angular-manually.component.ts delete mode 100644 packages/documentation/src/stories/getting-started/components-angular/angular.stories.ts delete mode 100644 packages/documentation/src/stories/getting-started/components/components.stories.ts create mode 100644 packages/documentation/src/stories/getting-started/introduction.docs.mdx create mode 100644 packages/documentation/src/stories/getting-started/introduction.stories.ts create mode 100644 packages/documentation/src/stories/getting-started/list-component.ts rename packages/documentation/src/stories/getting-started/{ => packages}/components-angular/angular-app-component.sample.html (100%) rename packages/documentation/src/stories/getting-started/{ => packages}/components-angular/angular-app-module.sample.ts (100%) rename packages/documentation/src/stories/getting-started/{components-angular/angular.docs.mdx => packages/components-angular/components-angular.docs.mdx} (92%) create mode 100644 packages/documentation/src/stories/getting-started/packages/components-angular/components-angular.stories.ts rename packages/documentation/src/stories/getting-started/{ => packages}/components/components-cdn-bare-component-all.sample.html (100%) rename packages/documentation/src/stories/getting-started/{ => packages}/components/components-cdn-lazy-loaded-all.sample.html (100%) rename packages/documentation/src/stories/getting-started/{ => packages}/components/components-cdn-lazy-loaded-specific.sample.html (100%) rename packages/documentation/src/stories/getting-started/{ => packages}/components/components-js-all.sample.js (100%) rename packages/documentation/src/stories/getting-started/{ => packages}/components/components-js-specific.sample.js (100%) rename packages/documentation/src/stories/getting-started/{ => packages}/components/components.docs.mdx (100%) create mode 100644 packages/documentation/src/stories/getting-started/packages/components/components.stories.ts rename packages/documentation/src/stories/{components/icons/getting-started-icon-meta.sample.html => getting-started/packages/icons/package-icons-icon-meta.sample.html} (100%) rename packages/documentation/src/stories/{components/icons/getting-started-node-16.7.0.sample.json => getting-started/packages/icons/package-icons-node-16.7.0.sample.json} (100%) rename packages/documentation/src/stories/{components/icons/getting-started-node-old.sample.js => getting-started/packages/icons/package-icons-node-old.sample.js} (100%) rename packages/documentation/src/stories/{components/icons/getting-started-node-old.sample.json => getting-started/packages/icons/package-icons-node-old.sample.json} (100%) rename packages/documentation/src/stories/{components/icons/getting-started.docs.mdx => getting-started/packages/icons/package-icons.mdx} (78%) create mode 100644 packages/documentation/src/stories/getting-started/packages/icons/package-icons.stories.ts rename packages/documentation/src/stories/{components => getting-started/packages}/internet-header/internet-header-bare-component.sample.js (100%) rename packages/documentation/src/stories/{components => getting-started/packages}/internet-header/internet-header-cdn-bare-component.sample.html (100%) rename packages/documentation/src/stories/{components => getting-started/packages}/internet-header/internet-header-cdn-lazy-loaded.sample.html (100%) rename packages/documentation/src/stories/{components => getting-started/packages}/internet-header/internet-header-fix-app-styles.sample.html (100%) rename packages/documentation/src/stories/{components => getting-started/packages}/internet-header/internet-header-frameworks.sample.html (100%) rename packages/documentation/src/stories/{components => getting-started/packages}/internet-header/internet-header-install.sample.html (100%) rename packages/documentation/src/stories/{components => getting-started/packages}/internet-header/internet-header-lazy-loaded.sample.js (100%) rename packages/documentation/src/stories/{components => getting-started/packages}/internet-header/internet-header-old.sample.html (100%) rename packages/documentation/src/stories/{components => getting-started/packages}/internet-header/internet-header-reference.sample.ts (100%) create mode 100644 packages/documentation/src/stories/getting-started/packages/internet-header/internet-header.docs.mdx create mode 100644 packages/documentation/src/stories/getting-started/packages/internet-header/internet-header.stories.ts create mode 100644 packages/documentation/src/stories/getting-started/packages/intranet-header/intranet-header.docs.mdx create mode 100644 packages/documentation/src/stories/getting-started/packages/intranet-header/intranet-header.stories.ts rename packages/documentation/src/stories/getting-started/{ => packages}/styles/styles-variable.sample.scss (52%) rename packages/documentation/src/stories/getting-started/{ => packages}/styles/styles.docs.mdx (97%) create mode 100644 packages/documentation/src/stories/getting-started/packages/styles/styles.stories.ts delete mode 100644 packages/documentation/src/stories/getting-started/styles/styles.stories.ts create mode 100644 packages/documentation/types/index.ts create mode 100644 packages/documentation/types/package.ts create mode 100644 packages/documentation/types/storybook.ts diff --git a/.changeset/old-pumas-sit.md b/.changeset/old-pumas-sit.md new file mode 100644 index 0000000000..70474d5cc4 --- /dev/null +++ b/.changeset/old-pumas-sit.md @@ -0,0 +1,5 @@ +--- +'@swisspost/design-system-documentation': patch +--- + +Reworked the getting-started section to better understand the different packages and add more info about Angular. diff --git a/packages/demo/src/app/bootstrap/components/card/complex-card-demo/complex-card-demo.component.html b/packages/demo/src/app/bootstrap/components/card/complex-card-demo/complex-card-demo.component.html index 2c48d5536a..4f296d919d 100644 --- a/packages/demo/src/app/bootstrap/components/card/complex-card-demo/complex-card-demo.component.html +++ b/packages/demo/src/app/bootstrap/components/card/complex-card-demo/complex-card-demo.component.html @@ -140,7 +140,7 @@
Card title

Card columns

-

Card columns can be checked out in the swiss post example below.

+

Card columns can be checked out in the Swiss Post example below.

Default diff --git a/packages/documentation/.storybook/preview.ts b/packages/documentation/.storybook/preview.ts index 7b9ca96654..065d375f71 100644 --- a/packages/documentation/.storybook/preview.ts +++ b/packages/documentation/.storybook/preview.ts @@ -25,13 +25,14 @@ const preview: Preview = { // Category - Getting Started 'Getting Started', - ['Styles', 'Components', 'Components-Angular', 'Compatibility'], + ['Introduction', 'Angular', 'Compatibility', 'Packages'], // Category - Foundations 'Foundations', [ 'Typography', 'Color', + 'Search for Icons', 'Layout', ['Breakpoints', 'Containers', 'Grid', 'Columns', 'TODOS'], 'Elevation', @@ -40,42 +41,6 @@ const preview: Preview = { // Category - Components 'Components', - [ - 'Accordion', - 'Alert', - 'Badge', - 'Blockquote', - 'Button', - 'Button Group', - 'Cards', - 'Carousel', - 'Collapsible', - 'Datepicker', - 'Dropdown', - 'Forms', - 'Heading', - 'Icons', - ['Getting Started'], - 'Internet Header', - ['Getting Started', 'Header'], - 'Intranet Header', - 'Modal', - 'Notification overlay', - 'Pagination', - 'Popover', - 'Progressbar', - 'Rating', - 'Spinner', - 'Stepper', - 'Subnavigation', - 'Table', - 'Tabs', - 'Timepicker', - 'Toast', - 'Tooltip', - 'Topic Teaser', - 'Typeahead', - ], // Category - Patterns 'Patterns', diff --git a/packages/documentation/.storybook/styles/preview.scss b/packages/documentation/.storybook/styles/preview.scss index 46df37ba38..0ff2ed3fe7 100644 --- a/packages/documentation/.storybook/styles/preview.scss +++ b/packages/documentation/.storybook/styles/preview.scss @@ -5,8 +5,6 @@ #storybook-root, #storybook-docs { - overflow: hidden; - .sbdocs-content .container >, .sbdocs-content .container > post-tabs > post-tab-panel >, .sbdocs-content .container > migration-global-state { @@ -38,6 +36,10 @@ h6 { margin-block: 1rem; } + .table, + .table-responsive { + margin-block: 1.5rem 1rem; + } } .sbdocs-content .container { diff --git a/packages/documentation/package.json b/packages/documentation/package.json index 731ad4ba9e..b98d319a1a 100644 --- a/packages/documentation/package.json +++ b/packages/documentation/package.json @@ -35,6 +35,7 @@ }, "devDependencies": { "@geometricpanda/storybook-addon-badges": "2.0.1", + "@lit/task": "1.0.0", "@open-wc/lit-helpers": "0.6.0", "@percy/cli": "1.27.7", "@percy/cypress": "3.1.2", diff --git a/packages/documentation/src/noop.txt b/packages/documentation/src/noop.txt deleted file mode 100644 index 07c5fa89e0..0000000000 --- a/packages/documentation/src/noop.txt +++ /dev/null @@ -1 +0,0 @@ -triggering a doc build, nothing to see here \ No newline at end of file diff --git a/packages/documentation/src/shared/packages.data.ts b/packages/documentation/src/shared/packages.data.ts new file mode 100644 index 0000000000..a22560e36e --- /dev/null +++ b/packages/documentation/src/shared/packages.data.ts @@ -0,0 +1,152 @@ +import { DEPENDENCIES, getVersion } from '../utils/version'; +import metaStyles from '../stories/getting-started/packages/styles/styles.stories'; +import metaComponents from '../stories/getting-started/packages/components/components.stories'; +import metaComponentsAngular from '../stories/getting-started/packages/components-angular/components-angular.stories'; +import metaInternetHeader from '../stories/getting-started/packages/internet-header/internet-header.stories'; +import metaIntranetHeader from '../stories/getting-started/packages/intranet-header/intranet-header.stories'; +import metaIcons from '../stories/getting-started/packages/icons/package-icons.stories'; +import { PackageType } from '../../types'; + +interface IPackage { + name: string; + docsStoryId: string; + type: PackageType; + link: { + [key: string]: { + href: string; + ariaLabel: string; + }; + }; + img: { + src: string; + alt: string; + }; + version: string; +} + +export const packages: IPackage[] = [ + { + name: 'Styles', + docsStoryId: metaStyles.id, + type: PackageType.Html, + link: { + github: { + href: 'https://github.com/swisspost/design-system/tree/main/packages/styles', + ariaLabel: 'Source of Styles package', + }, + docs: { + href: generateDocsRelativeLink(metaStyles.id), + ariaLabel: 'Getting started with Styles package', + }, + }, + img: { + src: '/assets/images/packages/styles.svg', + alt: '', + }, + version: `v${getVersion(DEPENDENCIES['@swisspost/design-system-styles'])}`, + }, + { + name: 'Components', + docsStoryId: metaComponents.id, + type: PackageType.Wc, + link: { + github: { + href: 'https://github.com/swisspost/design-system/tree/main/packages/components', + ariaLabel: 'Source of Components package', + }, + docs: { + href: generateDocsRelativeLink(metaComponents.id), + ariaLabel: 'Getting started with Components package', + }, + }, + img: { + src: '/assets/images/packages/components.svg', + alt: '', + }, + version: `v${getVersion(DEPENDENCIES['@swisspost/design-system-components'])}`, + }, + { + name: 'Components for Angular', + docsStoryId: metaComponentsAngular.id, + type: PackageType.Angular, + link: { + github: { + href: 'https://github.com/swisspost/design-system/tree/main/packages/components-angular', + ariaLabel: 'Source of Components for Angular package', + }, + docs: { + href: generateDocsRelativeLink(metaComponentsAngular.id), + ariaLabel: 'Getting started with Components for Angular package', + }, + }, + img: { + src: '/assets/images/packages/components-angular.svg', + alt: '', + }, + version: `v${getVersion(DEPENDENCIES['@swisspost/design-system-components-angular'])}`, + }, + { + name: 'Internet-Header', + docsStoryId: metaInternetHeader.id, + type: PackageType.Wc, + link: { + github: { + href: 'https://github.com/swisspost/design-system/tree/main/packages/internet-header', + ariaLabel: 'Source of Internet-Header package', + }, + docs: { + href: generateDocsRelativeLink(metaInternetHeader.id), + ariaLabel: 'Getting started with Internet-Header package', + }, + }, + img: { + src: '/assets/images/packages/internet-header.svg', + alt: '', + }, + version: `v${getVersion(DEPENDENCIES['@swisspost/internet-header'])}`, + }, + { + name: 'Intranet-Header', + docsStoryId: metaIntranetHeader.id, + type: PackageType.Angular, + link: { + github: { + href: 'https://github.com/swisspost/design-system/tree/main/packages/intranet-header-workspace/projects/intranet-header', + ariaLabel: 'Source of Intranet-Header package', + }, + docs: { + href: generateDocsRelativeLink(metaIntranetHeader.id), + ariaLabel: 'Getting started with Intranet-Header package', + }, + }, + img: { + src: '/assets/images/packages/intranet-header.svg', + alt: '', + }, + version: `v${getVersion(DEPENDENCIES['@swisspost/design-system-intranet-header'])}`, + }, + { + name: 'Icons', + docsStoryId: metaIcons.id, + type: PackageType.Assets, + link: { + github: { + href: 'https://github.com/swisspost/design-system/tree/main/packages/icons', + ariaLabel: 'Source of Icons package', + }, + docs: { + href: generateDocsRelativeLink(metaIcons.id), + ariaLabel: 'Getting started with Icons package', + }, + }, + img: { + src: '/assets/images/packages/icons.svg', + alt: '', + }, + version: `v${getVersion(DEPENDENCIES['@swisspost/design-system-icons'])}`, + }, +]; + +function generateDocsRelativeLink(storyId: string) { + return `/?path=/docs/${storyId}--docs`; +} diff --git a/packages/documentation/src/shared/tile/tile.component.scss b/packages/documentation/src/shared/tile/tile.component.scss new file mode 100644 index 0000000000..4a3a1406f5 --- /dev/null +++ b/packages/documentation/src/shared/tile/tile.component.scss @@ -0,0 +1,100 @@ +@use 'sass:map'; +@use '@swisspost/design-system-styles/core.scss' as post; +@use '@swisspost/design-system-styles/mixins/utilities'; + +$tile-size: var(--post-docs-tile-size, 120px); +$tile-rg-size: var(--post-docs-tile-rg-size, calc($tile-size / 1.2)); + +:host{ + .tile { + display: flex; + flex-direction: column; + width: $tile-size; + height: $tile-size; + background-color: post.$white; + border-radius: post.$size-regular; + box-shadow: 0 2px 5px 0 rgba(post.$aubergine-dark, 0.3); + text-decoration: none; + text-align: center; + + @include utilities.high-contrast-mode() { + border: 2px solid transparent; + } + + .tile--title { + display: flex; + justify-content: center; + align-items: center; + flex: 0 0 auto; + padding: 0 post.$size-micro; + height: calc(#{post.$size-mini * 2} + 2.2em); + background-color: post.$yellow; + border-top-left-radius: inherit; + border-top-right-radius: inherit; + font-size: max(12px, calc($tile-size * 0.1)); + font-weight: post.$font-weight-bold; + color: post.$black; + z-index: 1; + line-height: 1.1; + box-shadow: 0 2px 0 1px rgba(post.$yellow, 0.5); + + ~ .tile--icon { + img { + max-height: 50px; + } + } + } + + .tile--icon { + flex: 0 1 100%; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + gap: post.$size-micro; + border-bottom-left-radius: inherit; + border-bottom-right-radius: inherit; + + ::slotted(img) { + height: 0; + min-height: min(100%, calc($tile-size * 0.4)); + } + + ::slotted(span) { + font-size: 0.6875em; + color: post.$gray-600; + } + } + + &[href] { + transition: transform 150ms ease-out; + + &:hover { + transform: scale(1.1); + } + } + + @include post.media-breakpoint-down(rg) { + width: $tile-rg-size; + height: $tile-rg-size; + + .tile--title { + height: calc(#{post.$size-mini * 1.5} + 2.2em); + + ~ .tile--icon { + ::slotted(img) { + min-height: calc($tile-size * 0.3); + } + } + } + + .tile--icon { + ::slotted(img) { + min-height: calc($tile-size * 0.4); + } + } + } + } +} + + diff --git a/packages/documentation/src/shared/tile/tile.component.ts b/packages/documentation/src/shared/tile/tile.component.ts new file mode 100644 index 0000000000..fa089a52cc --- /dev/null +++ b/packages/documentation/src/shared/tile/tile.component.ts @@ -0,0 +1,31 @@ +import { css, LitElement, nothing, unsafeCSS } from 'lit'; +import { html, unsafeStatic } from 'lit/static-html.js'; +import { customElement, property } from 'lit/decorators.js'; +import { spread } from '@open-wc/lit-helpers'; +import Styles from './tile.component.scss?inline'; + +@customElement('ti-le') +export class TileComponent extends LitElement { + @property({ type: String }) title: string = ''; + @property({ type: String }) ariaLabel: string | null = null; + @property({ type: String }) href: string | null = null; + + static get styles() { + return css` + ${unsafeCSS(Styles)} + `; + } + + render() { + const isLink = this.href !== null; + const tag = isLink ? 'a' : 'div'; + const attributes = isLink ? { href: this.href, target: '_blank' } : {}; + + return html` <${unsafeStatic(tag)} class="tile" ${spread(attributes)} aria-label="${ + this.ariaLabel ?? nothing + }"> + ${this.title ? html`${this.title}` : nothing} + + `; + } +} diff --git a/packages/documentation/src/stories/components/accordion/accordion.stories.ts b/packages/documentation/src/stories/components/accordion/accordion.stories.ts index f5aa458f25..04a73e63e3 100644 --- a/packages/documentation/src/stories/components/accordion/accordion.stories.ts +++ b/packages/documentation/src/stories/components/accordion/accordion.stories.ts @@ -1,10 +1,12 @@ -import type { Meta, StoryObj } from '@storybook/web-components'; +import type { StoryObj } from '@storybook/web-components'; import { html } from 'lit'; import { ifDefined } from 'lit/directives/if-defined.js'; +import { MetaComponent } from '../../../../types'; -const meta: Meta = { +const meta: MetaComponent = { id: '4d1b4185-e04d-494a-ab38-2b56c1778b0b', title: 'Components/Accordion', + tags: ['package:WebComponents'], component: 'post-accordion', parameters: { badges: [], diff --git a/packages/documentation/src/stories/components/alert/standard-html/alert.stories.ts b/packages/documentation/src/stories/components/alert/standard-html/alert.stories.ts index 52ebbeb0b3..d06ec8ae3e 100644 --- a/packages/documentation/src/stories/components/alert/standard-html/alert.stories.ts +++ b/packages/documentation/src/stories/components/alert/standard-html/alert.stories.ts @@ -1,13 +1,15 @@ // @ts-ignore import { useArgs } from '@storybook/preview-api'; -import { Args, Meta, StoryContext, StoryFn, StoryObj } from '@storybook/web-components'; +import { Args, StoryContext, StoryFn, StoryObj } from '@storybook/web-components'; import { html, nothing } from 'lit'; import { unsafeHTML } from 'lit/directives/unsafe-html.js'; import { getAlertClasses } from './getAlertClasses'; +import { MetaComponent } from '../../../../../types'; -const meta: Meta = { +const meta: MetaComponent = { id: '105e67d8-31e9-4d0b-87ff-685aba31fd4c', title: 'Components/Alert', + tags: ['package:HTML'], render: renderAlert, decorators: [externalControl], parameters: { @@ -63,7 +65,7 @@ const meta: Meta = { 'The icon to display in the alert. By default, the icon depends on the alert type.' + '' + 'To use a custom icon, you must first ' + - 'set up the icons in your project' + + 'set up the icons in your project' + '.', if: { arg: 'noIcon', diff --git a/packages/documentation/src/stories/components/alert/web-component/post-alert.stories.ts b/packages/documentation/src/stories/components/alert/web-component/post-alert.stories.ts index 702baaed1e..9968d8f551 100644 --- a/packages/documentation/src/stories/components/alert/web-component/post-alert.stories.ts +++ b/packages/documentation/src/stories/components/alert/web-component/post-alert.stories.ts @@ -1,10 +1,12 @@ -import { Meta, StoryContext, StoryFn, StoryObj } from '@storybook/web-components'; +import { StoryContext, StoryFn, StoryObj } from '@storybook/web-components'; import { html } from 'lit'; import { spreadArgs } from '../../../../utils'; +import { MetaComponent } from '../../../../../types'; -const meta: Meta = { +const meta: MetaComponent = { id: '8fd36823-966e-46a8-8432-a4439f6e208f', - title: 'Components/Post Alert', + title: 'Components/Alert', + tags: ['package:WebComponents', 'redirect:105e67d8-31e9-4d0b-87ff-685aba31fd4c'], component: 'post-alert', render: renderAlert, decorators: [externalControl], diff --git a/packages/documentation/src/stories/components/badge/badge.stories.ts b/packages/documentation/src/stories/components/badge/badge.stories.ts index 2fefed13d3..2be92512ef 100644 --- a/packages/documentation/src/stories/components/badge/badge.stories.ts +++ b/packages/documentation/src/stories/components/badge/badge.stories.ts @@ -1,11 +1,13 @@ import { useArgs } from '@storybook/preview-api'; -import type { Args, Meta, StoryContext, StoryObj } from '@storybook/web-components'; +import type { Args, StoryContext, StoryObj } from '@storybook/web-components'; import { html, nothing } from 'lit'; import { mapClasses } from '../../../utils'; +import { MetaComponent } from '../../../../types'; -const meta: Meta = { +const meta: MetaComponent = { id: 'bec68e8b-445e-4760-8bd7-1b9970206d8d', title: 'Components/Badge', + tags: ['package:HTML'], render: renderBadge, decorators: [externalControl], parameters: { diff --git a/packages/documentation/src/stories/components/blockquote/blockquote.stories.ts b/packages/documentation/src/stories/components/blockquote/blockquote.stories.ts index 2fc841ef28..9d9aa5f973 100644 --- a/packages/documentation/src/stories/components/blockquote/blockquote.stories.ts +++ b/packages/documentation/src/stories/components/blockquote/blockquote.stories.ts @@ -1,9 +1,11 @@ -import type { Args, Meta, StoryObj } from '@storybook/web-components'; +import type { Args, StoryObj } from '@storybook/web-components'; import { html, unsafeStatic } from 'lit/static-html.js'; +import { MetaComponent } from '../../../../types'; -const meta: Meta = { +const meta: MetaComponent = { id: 'a4c7d5fa-9f8d-4a95-820b-ae4ce9ab4f03', title: 'Components/Blockquote', + tags: ['package:HTML'], render: renderBlockquote, parameters: { badges: [], diff --git a/packages/documentation/src/stories/components/button-group/button-group.stories.ts b/packages/documentation/src/stories/components/button-group/button-group.stories.ts index a3ff2813b0..b77cb83280 100644 --- a/packages/documentation/src/stories/components/button-group/button-group.stories.ts +++ b/packages/documentation/src/stories/components/button-group/button-group.stories.ts @@ -1,10 +1,12 @@ -import type { Args, Meta, StoryContext, StoryObj } from '@storybook/web-components'; +import type { Args, StoryContext, StoryObj } from '@storybook/web-components'; import { html } from 'lit'; import { useArgs } from '@storybook/preview-api'; +import { MetaComponent } from '../../../../types'; -const meta: Meta = { +const meta: MetaComponent = { id: '021d61aa-e039-4858-b4b9-b86a3e772811', title: 'Components/Button Group', + tags: ['package:HTML'], render: renderButtonGroup, parameters: { badges: [], diff --git a/packages/documentation/src/stories/components/button/button.stories.ts b/packages/documentation/src/stories/components/button/button.stories.ts index f21c2f8a08..2b593de613 100644 --- a/packages/documentation/src/stories/components/button/button.stories.ts +++ b/packages/documentation/src/stories/components/button/button.stories.ts @@ -1,11 +1,13 @@ -import type { Args, Meta, StoryObj } from '@storybook/web-components'; +import type { Args, StoryObj } from '@storybook/web-components'; import { html, unsafeStatic } from 'lit/static-html.js'; import { spread } from '@open-wc/lit-helpers'; import { repeat } from 'lit/directives/repeat.js'; +import { MetaComponent } from '../../../../types'; -const meta: Meta = { +const meta: MetaComponent = { id: 'eb78afcb-ce92-4990-94b6-6536d5ec6af4', title: 'Components/Button', + tags: ['package:HTML'], parameters: { badges: [], design: { @@ -137,7 +139,7 @@ const meta: Meta = { 'Defines a custom icon.' + '' + 'To use a custom icon, you must first ' + - 'set up the icons in your project' + + 'set up the icons in your project' + '.', if: { arg: 'tag', diff --git a/packages/documentation/src/stories/components/cards/card-button/card-button.stories.ts b/packages/documentation/src/stories/components/cards/card-button/card-button.stories.ts index 88ea7e32cf..9b9757a4e9 100644 --- a/packages/documentation/src/stories/components/cards/card-button/card-button.stories.ts +++ b/packages/documentation/src/stories/components/cards/card-button/card-button.stories.ts @@ -1,10 +1,13 @@ -import { Meta, StoryObj, Args } from '@storybook/web-components'; +import { Args, StoryObj } from '@storybook/web-components'; import { html } from 'lit'; import { useArgs } from '@storybook/preview-api'; import scss from './card-button.module.scss'; +import { MetaComponent } from '../../../../../types'; -const meta: Meta = { - title: 'Components/Cards/Card-Button', +const meta: MetaComponent = { + id: '6f8f76ec-a2b5-4eb0-87f7-4021e1a5b8d0', + title: 'Components/Cards/Card Button', + tags: ['package:HTML'], parameters: { badges: [], }, diff --git a/packages/documentation/src/stories/components/cards/card/card.stories.ts b/packages/documentation/src/stories/components/cards/card/card.stories.ts index 1e4abc3b7f..5a96d67f62 100644 --- a/packages/documentation/src/stories/components/cards/card/card.stories.ts +++ b/packages/documentation/src/stories/components/cards/card/card.stories.ts @@ -1,11 +1,13 @@ -import type { Args, Meta, StoryObj } from '@storybook/web-components'; +import type { Args, StoryObj } from '@storybook/web-components'; import { html, nothing } from 'lit'; import { choose } from 'lit/directives/choose.js'; import { unsafeHTML } from 'lit/directives/unsafe-html.js'; +import { MetaComponent } from '../../../../../types'; -const meta: Meta = { +const meta: MetaComponent = { id: '605c788d-3f75-4e6c-8498-be3d546843c2', title: 'Components/Cards/Card', + tags: ['package:HTML'], decorators: [clickBlocker, paddedContainer], parameters: { badges: [], diff --git a/packages/documentation/src/stories/components/cards/product-card/product-card.stories.ts b/packages/documentation/src/stories/components/cards/product-card/product-card.stories.ts index ddffbb7434..99f51dd051 100644 --- a/packages/documentation/src/stories/components/cards/product-card/product-card.stories.ts +++ b/packages/documentation/src/stories/components/cards/product-card/product-card.stories.ts @@ -1,10 +1,12 @@ -import type { Args, Meta, StoryObj } from '@storybook/web-components'; +import type { Args, StoryObj } from '@storybook/web-components'; import { html, unsafeStatic } from 'lit/static-html.js'; import { nothing } from 'lit'; +import { MetaComponent } from '../../../../../types'; -const meta: Meta = { +const meta: MetaComponent = { id: 'b4800d9e-4837-4476-a327-bb4586eb7e97', title: 'Components/Cards/Product Card', + tags: ['package:HTML'], decorators: [paddedContainer, clickBlocker], parameters: { badges: [], diff --git a/packages/documentation/src/stories/components/carousel/carousel.stories.ts b/packages/documentation/src/stories/components/carousel/carousel.stories.ts index 23d1ae1d5a..367d7ec546 100644 --- a/packages/documentation/src/stories/components/carousel/carousel.stories.ts +++ b/packages/documentation/src/stories/components/carousel/carousel.stories.ts @@ -1,8 +1,10 @@ -import { Meta, StoryObj } from '@storybook/web-components'; +import { StoryObj } from '@storybook/web-components'; +import { MetaComponent } from '../../../../types'; -const meta: Meta = { +const meta: MetaComponent = { id: 'cb3ba4a2-1265-4a20-b184-b85443146efa', title: 'Components/Carousel', + tags: ['package:Angular'], parameters: { badges: [], }, diff --git a/packages/documentation/src/stories/components/collapsible/collapsible.stories.ts b/packages/documentation/src/stories/components/collapsible/collapsible.stories.ts index 9572c3507b..65f225d4d9 100644 --- a/packages/documentation/src/stories/components/collapsible/collapsible.stories.ts +++ b/packages/documentation/src/stories/components/collapsible/collapsible.stories.ts @@ -1,10 +1,12 @@ -import { Meta, StoryContext, StoryFn, StoryObj } from '@storybook/web-components'; +import { StoryContext, StoryFn, StoryObj } from '@storybook/web-components'; import { html } from 'lit'; import { spreadArgs } from '../../../utils'; +import { MetaComponent } from '../../../../types'; -const meta: Meta = { +const meta: MetaComponent = { id: '6a91848c-16ec-4a23-bc45-51c797b5b2c3', title: 'Components/Collapsible', + tags: ['package:WebComponents'], component: 'post-collapsible', render: renderCollapsible, decorators: [externalControls], diff --git a/packages/documentation/src/stories/components/datepicker/datepicker.stories.ts b/packages/documentation/src/stories/components/datepicker/datepicker.stories.ts index 2b2e0edf64..e8dac20710 100644 --- a/packages/documentation/src/stories/components/datepicker/datepicker.stories.ts +++ b/packages/documentation/src/stories/components/datepicker/datepicker.stories.ts @@ -1,9 +1,11 @@ -import type { Meta, StoryObj } from '@storybook/web-components'; +import type { StoryObj } from '@storybook/web-components'; import { html } from 'lit'; +import { MetaComponent } from '../../../../types'; -const meta: Meta = { +const meta: MetaComponent = { id: '6561b345-9d64-4f95-8ea6-2389586410bd', title: 'Components/Datepicker', + tags: ['package:Angular'], parameters: { badges: [], }, diff --git a/packages/documentation/src/stories/components/dropdown/dropdown.stories.ts b/packages/documentation/src/stories/components/dropdown/dropdown.stories.ts index de74d63592..d8ed29741d 100644 --- a/packages/documentation/src/stories/components/dropdown/dropdown.stories.ts +++ b/packages/documentation/src/stories/components/dropdown/dropdown.stories.ts @@ -1,8 +1,9 @@ -import { Meta } from '@storybook/web-components'; +import { MetaComponent } from '../../../../types'; -const meta: Meta = { +const meta: MetaComponent = { id: '63113d0a-6ceb-472c-ac6a-729404e862ca', title: 'Components/Dropdown', + tags: ['package:Angular'], parameters: { badges: [], }, diff --git a/packages/documentation/src/stories/components/forms/checkbox/checkbox.stories.ts b/packages/documentation/src/stories/components/forms/checkbox/checkbox.stories.ts index 576be69f21..cc0373ac27 100644 --- a/packages/documentation/src/stories/components/forms/checkbox/checkbox.stories.ts +++ b/packages/documentation/src/stories/components/forms/checkbox/checkbox.stories.ts @@ -1,12 +1,14 @@ import { useArgs } from '@storybook/preview-api'; -import type { Args, Meta, StoryContext, StoryObj } from '@storybook/web-components'; +import type { Args, StoryContext, StoryObj } from '@storybook/web-components'; import { html, nothing } from 'lit'; import { ifDefined } from 'lit/directives/if-defined.js'; import { mapClasses } from '../../../../utils'; +import { MetaComponent } from '../../../../../types'; -const meta: Meta = { +const meta: MetaComponent = { id: 'e6ecc86f-d148-413b-b796-614a89da54be', title: 'Components/Forms/Checkbox', + tags: ['package:HTML'], render: renderCheckbox, parameters: { badges: [], diff --git a/packages/documentation/src/stories/components/forms/choice-card/checkbox-card.stories.ts b/packages/documentation/src/stories/components/forms/choice-card/checkbox-card.stories.ts index 7bf6c9b04c..056e213873 100644 --- a/packages/documentation/src/stories/components/forms/choice-card/checkbox-card.stories.ts +++ b/packages/documentation/src/stories/components/forms/choice-card/checkbox-card.stories.ts @@ -1,14 +1,18 @@ import { choiceCardDefault, choiceCardGroup, choiceCardMeta } from './choice-card'; +import { MetaComponent } from '../../../../../types'; -export default { +const meta: MetaComponent = { ...choiceCardMeta, id: '9637bbae-0533-4522-89d4-c2732431c69b', title: 'Components/Forms/Checkbox Card', + tags: ['package:HTML'], parameters: { badges: [], }, }; +export default meta; + export const Default = { render: choiceCardDefault, args: { ...choiceCardMeta.args, type: 'checkbox' }, diff --git a/packages/documentation/src/stories/components/forms/choice-card/choice-card.ts b/packages/documentation/src/stories/components/forms/choice-card/choice-card.ts index f5bc3b6392..29942999c9 100644 --- a/packages/documentation/src/stories/components/forms/choice-card/choice-card.ts +++ b/packages/documentation/src/stories/components/forms/choice-card/choice-card.ts @@ -1,11 +1,12 @@ -import type { Args, Meta } from '@storybook/web-components'; +import type { Args } 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'; +import { MetaExtended } from '../../../../../types'; -export const choiceCardMeta: Meta = { +export const choiceCardMeta: MetaExtended = { parameters: { badges: [BADGE.NEEDS_REVISION], controls: { diff --git a/packages/documentation/src/stories/components/forms/choice-card/radiobutton-card.stories.ts b/packages/documentation/src/stories/components/forms/choice-card/radiobutton-card.stories.ts index fcdcd2d876..277eec8845 100644 --- a/packages/documentation/src/stories/components/forms/choice-card/radiobutton-card.stories.ts +++ b/packages/documentation/src/stories/components/forms/choice-card/radiobutton-card.stories.ts @@ -1,13 +1,17 @@ -import { choiceCardMeta, choiceCardDefault, choiceCardGroup } from './choice-card'; +import { choiceCardDefault, choiceCardGroup, choiceCardMeta } from './choice-card'; +import { MetaComponent } from '../../../../../types'; -export default { +const meta: MetaComponent = { ...choiceCardMeta, title: 'Components/Forms/Radio Button Card', + tags: ['package:HTML'], parameters: { badges: [], }, }; +export default meta; + export const Default = { render: choiceCardDefault, args: { ...choiceCardMeta.args, type: 'radio' }, diff --git a/packages/documentation/src/stories/components/forms/custom-select/custom-select.stories.ts b/packages/documentation/src/stories/components/forms/custom-select/custom-select.stories.ts index d8cdab660f..2a172da500 100644 --- a/packages/documentation/src/stories/components/forms/custom-select/custom-select.stories.ts +++ b/packages/documentation/src/stories/components/forms/custom-select/custom-select.stories.ts @@ -1,8 +1,10 @@ -import { Meta, StoryObj } from '@storybook/web-components'; +import { StoryObj } from '@storybook/web-components'; +import { MetaComponent } from '../../../../../types'; -const meta: Meta = { +const meta: MetaComponent = { id: 'e5a39d4f-4448-4398-9380-7c9fcae4a514', title: 'Components/Forms/Custom Select', + tags: ['package:Angular'], parameters: { badges: [], }, diff --git a/packages/documentation/src/stories/components/forms/input/input.stories.ts b/packages/documentation/src/stories/components/forms/input/input.stories.ts index 316c1692ef..afd429caed 100644 --- a/packages/documentation/src/stories/components/forms/input/input.stories.ts +++ b/packages/documentation/src/stories/components/forms/input/input.stories.ts @@ -1,5 +1,6 @@ -import { Args, Meta, StoryContext, StoryObj } from '@storybook/web-components'; +import { Args, StoryContext, StoryObj } from '@storybook/web-components'; import { html, nothing, TemplateResult } from 'lit'; +import { MetaComponent } from '../../../../../types'; const VALIDATION_STATE_MAP: Record = { 'null': undefined, @@ -7,9 +8,10 @@ const VALIDATION_STATE_MAP: Record = { 'is-invalid': true, }; -const meta: Meta = { +const meta: MetaComponent = { id: '2df77c32-5e33-402e-bd2e-54d54271ce19', title: 'Components/Forms/Input', + tags: ['package:HTML'], render: render, parameters: { badges: [], diff --git a/packages/documentation/src/stories/components/forms/radio/radio.stories.ts b/packages/documentation/src/stories/components/forms/radio/radio.stories.ts index 680667ca08..d3e594e2bc 100644 --- a/packages/documentation/src/stories/components/forms/radio/radio.stories.ts +++ b/packages/documentation/src/stories/components/forms/radio/radio.stories.ts @@ -1,6 +1,7 @@ -import { Args, Meta, StoryContext, StoryObj } from '@storybook/web-components'; +import { Args, StoryContext, StoryObj } from '@storybook/web-components'; import { useArgs } from '@storybook/preview-api'; import { html, nothing, TemplateResult } from 'lit'; +import { MetaComponent } from '../../../../../types'; const VALIDATION_STATE_MAP: Record = { 'null': undefined, @@ -8,9 +9,10 @@ const VALIDATION_STATE_MAP: Record = { 'is-invalid': true, }; -const meta: Meta = { +const meta: MetaComponent = { id: '151242aa-a074-4a55-a81c-db597c83cdad', - title: 'Components/Forms/Radio button', + title: 'Components/Forms/Radio Button', + tags: ['package:HTML'], parameters: { controls: { exclude: ['Hidden Legend'], diff --git a/packages/documentation/src/stories/components/forms/range/range.stories.ts b/packages/documentation/src/stories/components/forms/range/range.stories.ts index 72b73139d0..63a2215d5e 100644 --- a/packages/documentation/src/stories/components/forms/range/range.stories.ts +++ b/packages/documentation/src/stories/components/forms/range/range.stories.ts @@ -1,6 +1,7 @@ -import { Args, Meta, StoryContext, StoryObj } from '@storybook/web-components'; +import { Args, StoryContext, StoryObj } from '@storybook/web-components'; import { useArgs } from '@storybook/preview-api'; import { html, nothing, TemplateResult } from 'lit'; +import { MetaComponent } from '../../../../../types'; const VALIDATION_STATE_MAP: Record = { 'null': undefined, @@ -10,9 +11,10 @@ const VALIDATION_STATE_MAP: Record = { const ARROW_KEYS = ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight']; -const meta: Meta = { +const meta: MetaComponent = { id: '4c5a4537-d663-4d2b-9c49-17af95443696', title: 'Components/Forms/Range', + tags: ['package:HTML'], render: render, parameters: { badges: [], diff --git a/packages/documentation/src/stories/components/forms/select/select.stories.ts b/packages/documentation/src/stories/components/forms/select/select.stories.ts index 5b159c06bd..cf7b20c9d8 100644 --- a/packages/documentation/src/stories/components/forms/select/select.stories.ts +++ b/packages/documentation/src/stories/components/forms/select/select.stories.ts @@ -1,7 +1,8 @@ -import type { Args, Meta, StoryContext, StoryObj } from '@storybook/web-components'; +import type { Args, StoryContext, StoryObj } from '@storybook/web-components'; import { html, nothing } from 'lit'; import { useArgs } from '@storybook/preview-api'; import { ifDefined } from 'lit/directives/if-defined.js'; +import { MetaComponent } from '../../../../../types'; const VALIDATION_STATE_MAP: Record = { 'null': undefined, @@ -9,9 +10,10 @@ const VALIDATION_STATE_MAP: Record = { 'is-invalid': true, }; -const meta: Meta = { +const meta: MetaComponent = { id: 'bc251cd0-5173-463b-8729-586bb1bf1e1a', title: 'Components/Forms/Select', + tags: ['package:HTML'], parameters: { badges: [], }, diff --git a/packages/documentation/src/stories/components/forms/switch/switch.stories.ts b/packages/documentation/src/stories/components/forms/switch/switch.stories.ts index da2828c214..f7b6ba1006 100644 --- a/packages/documentation/src/stories/components/forms/switch/switch.stories.ts +++ b/packages/documentation/src/stories/components/forms/switch/switch.stories.ts @@ -1,12 +1,14 @@ import { useArgs } from '@storybook/preview-api'; -import type { Args, Meta, StoryContext, StoryObj } from '@storybook/web-components'; +import type { Args, StoryContext, StoryObj } from '@storybook/web-components'; import { html, nothing } from 'lit'; import { ifDefined } from 'lit/directives/if-defined.js'; import { mapClasses } from '../../../../utils'; +import { MetaComponent } from '../../../../../types'; -const meta: Meta = { +const meta: MetaComponent = { id: '7fb639f8-86f6-4937-999c-4ee15f81643b', title: 'Components/Forms/Switch', + tags: ['package:HTML'], render: renderSwitch, parameters: { badges: [], diff --git a/packages/documentation/src/stories/components/forms/textarea/textarea.stories.ts b/packages/documentation/src/stories/components/forms/textarea/textarea.stories.ts index 43069b017c..d3d1d02f35 100644 --- a/packages/documentation/src/stories/components/forms/textarea/textarea.stories.ts +++ b/packages/documentation/src/stories/components/forms/textarea/textarea.stories.ts @@ -1,6 +1,7 @@ -import type { Args, Meta, StoryContext, StoryObj } from '@storybook/web-components'; +import type { Args, StoryContext, StoryObj } from '@storybook/web-components'; import { html, nothing } from 'lit'; import { mapClasses } from '../../../../utils'; +import { MetaComponent } from '../../../../../types'; const VALIDATION_STATE_MAP: Record = { 'null': undefined, @@ -8,9 +9,10 @@ const VALIDATION_STATE_MAP: Record = { 'is-invalid': true, }; -const meta: Meta = { +const meta: MetaComponent = { id: '152b7268-cce0-43d7-b931-41a57370f9a0', title: 'Components/Forms/Textarea', + tags: ['package:HTML'], render: renderTextarea, parameters: { badges: [], diff --git a/packages/documentation/src/stories/components/heading/heading.stories.ts b/packages/documentation/src/stories/components/heading/heading.stories.ts index fdcd005a1d..52b086a186 100644 --- a/packages/documentation/src/stories/components/heading/heading.stories.ts +++ b/packages/documentation/src/stories/components/heading/heading.stories.ts @@ -1,9 +1,11 @@ -import type { Args, Meta, StoryObj } from '@storybook/web-components'; +import type { Args, StoryObj } from '@storybook/web-components'; import { html, unsafeStatic } from 'lit/static-html.js'; +import { MetaComponent } from '../../../../types'; -const meta: Meta = { +const meta: MetaComponent = { id: '7ecd87f1-de96-4e39-a057-ba1798eb6959', title: 'Components/Heading', + tags: ['package:HTML'], parameters: { badges: [], design: { diff --git a/packages/documentation/src/stories/components/icons/getting-started.stories.ts b/packages/documentation/src/stories/components/icons/getting-started.stories.ts deleted file mode 100644 index 88022e4f56..0000000000 --- a/packages/documentation/src/stories/components/icons/getting-started.stories.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Meta, StoryObj } from '@storybook/web-components'; - -const meta: Meta = { - id: '40ed323b-9c1a-42ab-91ed-15f97f214608', - title: 'Components/Icons/Getting Started', - parameters: { - badges: [], - }, -}; - -export default meta; - -type Story = StoryObj; - -export const Default: Story = {}; diff --git a/packages/documentation/src/stories/components/icons/components/icon.docs.mdx b/packages/documentation/src/stories/components/icons/icon.docs.mdx similarity index 100% rename from packages/documentation/src/stories/components/icons/components/icon.docs.mdx rename to packages/documentation/src/stories/components/icons/icon.docs.mdx diff --git a/packages/documentation/src/stories/components/icons/components/icon.stories.ts b/packages/documentation/src/stories/components/icons/icon.stories.ts similarity index 94% rename from packages/documentation/src/stories/components/icons/components/icon.stories.ts rename to packages/documentation/src/stories/components/icons/icon.stories.ts index 00b704a093..49e5721662 100644 --- a/packages/documentation/src/stories/components/icons/components/icon.stories.ts +++ b/packages/documentation/src/stories/components/icons/icon.stories.ts @@ -1,13 +1,15 @@ import { spread } from '@open-wc/lit-helpers'; -import { Args, Meta, StoryObj } from '@storybook/web-components'; -import { Components } from '@swisspost/design-system-components'; +import { Args, StoryObj } from '@storybook/web-components'; import { html } from 'lit'; import { ifDefined } from 'lit/directives/if-defined.js'; -import { spreadArgs } from '../../../../utils'; +import { spreadArgs } from '../../../utils'; +import { Components } from '@swisspost/design-system-components/src'; +import { MetaComponent } from '../../../../types'; -const meta: Meta = { +const meta: MetaComponent = { id: '0dcfe3c0-bfc0-4107-b43b-7e9d825b805f', - title: 'Components/Icons/Icon Component', + title: 'Components/Icon', + tags: ['package:WebComponents'], component: 'post-icon', parameters: { badges: [], diff --git a/packages/documentation/src/stories/components/icons/search-icons/search-icons.stories.ts b/packages/documentation/src/stories/components/icons/search-icons/search-icons.stories.ts deleted file mode 100644 index be179e6e5c..0000000000 --- a/packages/documentation/src/stories/components/icons/search-icons/search-icons.stories.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Meta, StoryObj } from '@storybook/web-components'; - -const meta: Meta = { - id: '5704bdc4-c5b5-45e6-b123-c54d01fce2f1', - title: 'Components/Icons/Search for Icons', -}; - -export default meta; - -type Story = StoryObj; - -export const Default: Story = {}; diff --git a/packages/documentation/src/stories/components/internet-header/components/breadcrumbs/breadcrumbs.docs.mdx b/packages/documentation/src/stories/components/internet-header/breadcrumbs/breadcrumbs.docs.mdx similarity index 100% rename from packages/documentation/src/stories/components/internet-header/components/breadcrumbs/breadcrumbs.docs.mdx rename to packages/documentation/src/stories/components/internet-header/breadcrumbs/breadcrumbs.docs.mdx diff --git a/packages/documentation/src/stories/components/internet-header/components/breadcrumbs/breadcrumbs.stories.ts b/packages/documentation/src/stories/components/internet-header/breadcrumbs/breadcrumbs.stories.ts similarity index 84% rename from packages/documentation/src/stories/components/internet-header/components/breadcrumbs/breadcrumbs.stories.ts rename to packages/documentation/src/stories/components/internet-header/breadcrumbs/breadcrumbs.stories.ts index 13147787bd..ae7cc4f055 100644 --- a/packages/documentation/src/stories/components/internet-header/components/breadcrumbs/breadcrumbs.stories.ts +++ b/packages/documentation/src/stories/components/internet-header/breadcrumbs/breadcrumbs.stories.ts @@ -1,13 +1,15 @@ -import { Meta, StoryObj } from '@storybook/web-components'; +import { StoryObj } from '@storybook/web-components'; import { html } from 'lit'; import { spread } from '@open-wc/lit-helpers'; -import { getAttributes } from '../../../../../utils'; +import { getAttributes } from '../../../../utils'; import customItems from './overrides/custom-items'; +import { MetaComponent } from '../../../../../types'; -const meta: Meta = { +const meta: MetaComponent = { id: '4347e5bf-8bf2-4f44-9075-9faaa53591ed', title: 'Components/Internet Header/Breadcrumbs', component: 'swisspost-internet-breadcrumbs', + tags: ['package:InternetHeader'], render: renderInternetBreadcrumbs, decorators: [hiddenHeader], parameters: { diff --git a/packages/documentation/src/stories/components/internet-header/components/breadcrumbs/overrides/breadcrumbs-config.docs.mdx b/packages/documentation/src/stories/components/internet-header/breadcrumbs/overrides/breadcrumbs-config.docs.mdx similarity index 100% rename from packages/documentation/src/stories/components/internet-header/components/breadcrumbs/overrides/breadcrumbs-config.docs.mdx rename to packages/documentation/src/stories/components/internet-header/breadcrumbs/overrides/breadcrumbs-config.docs.mdx diff --git a/packages/documentation/src/stories/components/internet-header/components/breadcrumbs/overrides/breadcrumbs-config.stories.ts b/packages/documentation/src/stories/components/internet-header/breadcrumbs/overrides/breadcrumbs-config.stories.ts similarity index 100% rename from packages/documentation/src/stories/components/internet-header/components/breadcrumbs/overrides/breadcrumbs-config.stories.ts rename to packages/documentation/src/stories/components/internet-header/breadcrumbs/overrides/breadcrumbs-config.stories.ts diff --git a/packages/documentation/src/stories/components/internet-header/components/breadcrumbs/overrides/custom-items.ts b/packages/documentation/src/stories/components/internet-header/breadcrumbs/overrides/custom-items.ts similarity index 100% rename from packages/documentation/src/stories/components/internet-header/components/breadcrumbs/overrides/custom-items.ts rename to packages/documentation/src/stories/components/internet-header/breadcrumbs/overrides/custom-items.ts diff --git a/packages/documentation/src/stories/components/internet-header/components/footer/custom-config/custom-footer-config.ts b/packages/documentation/src/stories/components/internet-header/footer/custom-config/custom-footer-config.ts similarity index 100% rename from packages/documentation/src/stories/components/internet-header/components/footer/custom-config/custom-footer-config.ts rename to packages/documentation/src/stories/components/internet-header/footer/custom-config/custom-footer-config.ts diff --git a/packages/documentation/src/stories/components/internet-header/components/footer/custom-config/footer-config.docs.mdx b/packages/documentation/src/stories/components/internet-header/footer/custom-config/footer-config.docs.mdx similarity index 100% rename from packages/documentation/src/stories/components/internet-header/components/footer/custom-config/footer-config.docs.mdx rename to packages/documentation/src/stories/components/internet-header/footer/custom-config/footer-config.docs.mdx diff --git a/packages/documentation/src/stories/components/internet-header/components/footer/custom-config/footer-config.stories.ts b/packages/documentation/src/stories/components/internet-header/footer/custom-config/footer-config.stories.ts similarity index 100% rename from packages/documentation/src/stories/components/internet-header/components/footer/custom-config/footer-config.stories.ts rename to packages/documentation/src/stories/components/internet-header/footer/custom-config/footer-config.stories.ts diff --git a/packages/documentation/src/stories/components/internet-header/components/footer/footer.docs.mdx b/packages/documentation/src/stories/components/internet-header/footer/footer.docs.mdx similarity index 100% rename from packages/documentation/src/stories/components/internet-header/components/footer/footer.docs.mdx rename to packages/documentation/src/stories/components/internet-header/footer/footer.docs.mdx diff --git a/packages/documentation/src/stories/components/internet-header/components/footer/footer.stories.ts b/packages/documentation/src/stories/components/internet-header/footer/footer.stories.ts similarity index 87% rename from packages/documentation/src/stories/components/internet-header/components/footer/footer.stories.ts rename to packages/documentation/src/stories/components/internet-header/footer/footer.stories.ts index 4000c4dcd3..7e14f224bd 100644 --- a/packages/documentation/src/stories/components/internet-header/components/footer/footer.stories.ts +++ b/packages/documentation/src/stories/components/internet-header/footer/footer.stories.ts @@ -1,12 +1,14 @@ -import { Args, Meta, StoryContext, StoryObj } from '@storybook/web-components'; +import { Args, StoryContext, StoryObj } from '@storybook/web-components'; import { html } from 'lit'; import customFooterConfig from './custom-config/custom-footer-config'; import { spread } from '@open-wc/lit-helpers'; +import { MetaComponent } from '../../../../../types'; -const meta: Meta = { +const meta: MetaComponent = { id: '27fc009d-3eec-43a9-b3a2-55531e721817', title: 'Components/Internet Header/Footer', component: 'swisspost-internet-footer', + tags: ['package:InternetHeader'], render: renderInternetFooter, decorators: [hiddenHeader], parameters: { diff --git a/packages/documentation/src/stories/components/internet-header/getting-started.docs.mdx b/packages/documentation/src/stories/components/internet-header/getting-started.docs.mdx deleted file mode 100644 index df41f3f0b8..0000000000 --- a/packages/documentation/src/stories/components/internet-header/getting-started.docs.mdx +++ /dev/null @@ -1,100 +0,0 @@ -import { Meta, Source } from '@storybook/blocks'; -import { PostTabs, PostTabHeader, PostTabPanel } from '@swisspost/design-system-components-react'; -import SampleFrameworks from './internet-header-frameworks.sample.html?raw'; -import SampleLazyLoaded from './internet-header-lazy-loaded.sample.js?raw'; -import SampleBareComponent from './internet-header-bare-component.sample.js?raw'; -import SampleCDNLazyLoaded from './internet-header-cdn-lazy-loaded.sample.html?raw'; -import SampleCDNBareComponent from './internet-header-cdn-bare-component.sample.html?raw'; -import { SourceDarkMode } from '../../../../.storybook/preview'; -import * as GettingStartedStories from './getting-started.stories'; - - - -# @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 - -### Choosing between lazy-loaded or bare component version - -Internet-header package provide two versions: - -- Lazy-loaded (default): it allows better performance by dynamically load the component when used, so it reduces bundle size, startup time and first paint. -- Bare component: if you already manage the lazy-loading or don't need it for any reason, you can use the component without any overhead. - -### 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. - - - - - - - Lazy-Loaded - - - - - Bare Component - - - - - -### Include from a CDN - -If you are not using any bundler 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).
-Make sure to replace `{version}` with the version you want to use or remove `@{version}` to use the latest version. - -Available CDNs: - -- [jsDelivr](https://www.jsdelivr.com/): replace `{cdnURL}` with [https://cdn.jsdelivr.net/npm/@swisspost/internet-header](https://cdn.jsdelivr.net/npm/@swisspost/internet-header). -- [unpkg](https://unpkg.com/): replace `{cdnURL}` with [https://unpkg.com/@swisspost/internet-header](https://unpkg.com/@swisspost/internet-header). - - - Lazy-Loaded - - - - - Bare Component - - - - -## 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/src/stories/components/internet-header/getting-started.stories.ts b/packages/documentation/src/stories/components/internet-header/getting-started.stories.ts deleted file mode 100644 index 8cbd69efc5..0000000000 --- a/packages/documentation/src/stories/components/internet-header/getting-started.stories.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Meta, StoryObj } from '@storybook/web-components'; - -const meta: Meta = { - id: '9b02bcb2-3b6a-4271-b550-675a62ff3890', - title: 'Components/Internet Header/Getting Started', - parameters: { - badges: [], - }, -}; - -export default meta; - -type Story = StoryObj; - -export const Default: Story = {}; diff --git a/packages/documentation/src/stories/components/internet-header/components/header/config/custom-config.ts b/packages/documentation/src/stories/components/internet-header/header/config/custom-config.ts similarity index 100% rename from packages/documentation/src/stories/components/internet-header/components/header/config/custom-config.ts rename to packages/documentation/src/stories/components/internet-header/header/config/custom-config.ts diff --git a/packages/documentation/src/stories/components/internet-header/components/header/config/language-switch-overrides.ts b/packages/documentation/src/stories/components/internet-header/header/config/language-switch-overrides.ts similarity index 100% rename from packages/documentation/src/stories/components/internet-header/components/header/config/language-switch-overrides.ts rename to packages/documentation/src/stories/components/internet-header/header/config/language-switch-overrides.ts diff --git a/packages/documentation/src/stories/components/internet-header/components/header/config/os-flyout-overrides.ts b/packages/documentation/src/stories/components/internet-header/header/config/os-flyout-overrides.ts similarity index 100% rename from packages/documentation/src/stories/components/internet-header/components/header/config/os-flyout-overrides.ts rename to packages/documentation/src/stories/components/internet-header/header/config/os-flyout-overrides.ts diff --git a/packages/documentation/src/stories/components/internet-header/components/header/header.docs.mdx b/packages/documentation/src/stories/components/internet-header/header/header.docs.mdx similarity index 100% rename from packages/documentation/src/stories/components/internet-header/components/header/header.docs.mdx rename to packages/documentation/src/stories/components/internet-header/header/header.docs.mdx diff --git a/packages/documentation/src/stories/components/internet-header/components/header/header.scss b/packages/documentation/src/stories/components/internet-header/header/header.scss similarity index 100% rename from packages/documentation/src/stories/components/internet-header/components/header/header.scss rename to packages/documentation/src/stories/components/internet-header/header/header.scss diff --git a/packages/documentation/src/stories/components/internet-header/components/header/header.stories.ts b/packages/documentation/src/stories/components/internet-header/header/header.stories.ts similarity index 95% rename from packages/documentation/src/stories/components/internet-header/components/header/header.stories.ts rename to packages/documentation/src/stories/components/internet-header/header/header.stories.ts index 04ddacd5cf..08d177bf5d 100644 --- a/packages/documentation/src/stories/components/internet-header/components/header/header.stories.ts +++ b/packages/documentation/src/stories/components/internet-header/header/header.stories.ts @@ -1,13 +1,15 @@ -import { Args, Meta, StoryObj } from '@storybook/web-components'; +import { Args, StoryObj } from '@storybook/web-components'; import { html } from 'lit'; -import { spreadArgs } from '../../../../../utils'; +import { spreadArgs } from '../../../../utils'; import customConfig from './config/custom-config'; import osFlyoutOverrides from './config/os-flyout-overrides'; import languageSwitchOverrides from './config/language-switch-overrides'; +import { MetaComponent } from '../../../../../types'; -const meta: Meta = { +const meta: MetaComponent = { id: 'ebb11274-091b-4cb7-9a3f-3e0451c9a865', title: 'Components/Internet Header/Header', + tags: ['package:InternetHeader'], component: 'swisspost-internet-header', parameters: { badges: [], diff --git a/packages/documentation/src/stories/components/internet-header/components/header/overrides-stories/header-custom-config.docs.mdx b/packages/documentation/src/stories/components/internet-header/header/overrides-stories/header-custom-config.docs.mdx similarity index 100% rename from packages/documentation/src/stories/components/internet-header/components/header/overrides-stories/header-custom-config.docs.mdx rename to packages/documentation/src/stories/components/internet-header/header/overrides-stories/header-custom-config.docs.mdx diff --git a/packages/documentation/src/stories/components/internet-header/components/header/overrides-stories/header-custom-config.stories.ts b/packages/documentation/src/stories/components/internet-header/header/overrides-stories/header-custom-config.stories.ts similarity index 100% rename from packages/documentation/src/stories/components/internet-header/components/header/overrides-stories/header-custom-config.stories.ts rename to packages/documentation/src/stories/components/internet-header/header/overrides-stories/header-custom-config.stories.ts diff --git a/packages/documentation/src/stories/components/internet-header/components/header/overrides-stories/header-custom-content.docs.mdx b/packages/documentation/src/stories/components/internet-header/header/overrides-stories/header-custom-content.docs.mdx similarity index 100% rename from packages/documentation/src/stories/components/internet-header/components/header/overrides-stories/header-custom-content.docs.mdx rename to packages/documentation/src/stories/components/internet-header/header/overrides-stories/header-custom-content.docs.mdx diff --git a/packages/documentation/src/stories/components/internet-header/components/header/overrides-stories/header-custom-content.stories.ts b/packages/documentation/src/stories/components/internet-header/header/overrides-stories/header-custom-content.stories.ts similarity index 100% rename from packages/documentation/src/stories/components/internet-header/components/header/overrides-stories/header-custom-content.stories.ts rename to packages/documentation/src/stories/components/internet-header/header/overrides-stories/header-custom-content.stories.ts diff --git a/packages/documentation/src/stories/components/internet-header/components/header/overrides-stories/header-language-switch-overrides.docs.mdx b/packages/documentation/src/stories/components/internet-header/header/overrides-stories/header-language-switch-overrides.docs.mdx similarity index 100% rename from packages/documentation/src/stories/components/internet-header/components/header/overrides-stories/header-language-switch-overrides.docs.mdx rename to packages/documentation/src/stories/components/internet-header/header/overrides-stories/header-language-switch-overrides.docs.mdx diff --git a/packages/documentation/src/stories/components/internet-header/components/header/overrides-stories/header-language-switch-overrides.stories.ts b/packages/documentation/src/stories/components/internet-header/header/overrides-stories/header-language-switch-overrides.stories.ts similarity index 100% rename from packages/documentation/src/stories/components/internet-header/components/header/overrides-stories/header-language-switch-overrides.stories.ts rename to packages/documentation/src/stories/components/internet-header/header/overrides-stories/header-language-switch-overrides.stories.ts diff --git a/packages/documentation/src/stories/components/internet-header/components/header/overrides-stories/header-os-flyout-overrides.docs.mdx b/packages/documentation/src/stories/components/internet-header/header/overrides-stories/header-os-flyout-overrides.docs.mdx similarity index 100% rename from packages/documentation/src/stories/components/internet-header/components/header/overrides-stories/header-os-flyout-overrides.docs.mdx rename to packages/documentation/src/stories/components/internet-header/header/overrides-stories/header-os-flyout-overrides.docs.mdx diff --git a/packages/documentation/src/stories/components/internet-header/components/header/overrides-stories/header-os-flyout-overrides.stories.ts b/packages/documentation/src/stories/components/internet-header/header/overrides-stories/header-os-flyout-overrides.stories.ts similarity index 100% rename from packages/documentation/src/stories/components/internet-header/components/header/overrides-stories/header-os-flyout-overrides.stories.ts rename to packages/documentation/src/stories/components/internet-header/header/overrides-stories/header-os-flyout-overrides.stories.ts diff --git a/packages/documentation/src/stories/components/internet-header/migration-guide.docs.mdx b/packages/documentation/src/stories/components/internet-header/migration-guide.docs.mdx deleted file mode 100644 index a1f9857575..0000000000 --- a/packages/documentation/src/stories/components/internet-header/migration-guide.docs.mdx +++ /dev/null @@ -1,91 +0,0 @@ -import { Meta, Source } from '@storybook/blocks'; -import SampleReference from './internet-header-reference.sample.ts?raw'; -import SampleInstall from './internet-header-install.sample.html?raw'; -import SampleFixAppStyles from './internet-header-fix-app-styles.sample.html?raw'; -import SampleOld from './internet-header-old.sample.html?raw'; -import { SourceDarkMode } from '../../../../.storybook/preview'; -import * as MigrationGuideStories from './migration-guide.stories'; - - - -# 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 - - - -## 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: - - - -- 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](/?path=/docs/9b02bcb2-3b6a-4271-b550-675a62ff3890--docs) for an installation guide. - -After installation, you're ready to add the new tags to your markup: - - - -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 `