diff --git a/.changeset/clean-dancers-film.md b/.changeset/clean-dancers-film.md deleted file mode 100644 index 85f8e31cfe..0000000000 --- a/.changeset/clean-dancers-film.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@swisspost/design-system-documentation': patch -'@swisspost/design-system-styles': patch ---- - -Added official way to use label in a floating-label select as a placeholder. diff --git a/.changeset/fuzzy-forks-type.md b/.changeset/fuzzy-forks-type.md deleted file mode 100644 index b690b5c7f9..0000000000 --- a/.changeset/fuzzy-forks-type.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@swisspost/design-system-styles': patch ---- - -Fixed display of button-group input when using checkbox or radio variant. diff --git a/.changeset/mighty-crews-thank.md b/.changeset/mighty-crews-thank.md deleted file mode 100644 index 081e197f87..0000000000 --- a/.changeset/mighty-crews-thank.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@swisspost/internet-header': minor ---- - -Replaced the old twitter logo with the new X logo. diff --git a/.changeset/tricky-tables-warn.md b/.changeset/tricky-tables-warn.md new file mode 100644 index 0000000000..ec7e2b0d9d --- /dev/null +++ b/.changeset/tricky-tables-warn.md @@ -0,0 +1,5 @@ +--- +'@swisspost/design-system-documentation': minor +--- + +Added a documentation page for the `.container` and `.container-fluid` classes. diff --git a/.changeset/wet-lions-fly.md b/.changeset/wet-lions-fly.md deleted file mode 100644 index b5c529adae..0000000000 --- a/.changeset/wet-lions-fly.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@swisspost/design-system-intranet-header': patch ---- - -Added a descriptive text to the Post logo home link. diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..6313b56c57 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index 03d9549ea8..7c4836fbe3 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -2,5 +2,6 @@ \ No newline at end of file diff --git a/.idea/prettier.xml b/.idea/prettier.xml index 459e2b9a5b..aa6e1c8b9a 100644 --- a/.idea/prettier.xml +++ b/.idea/prettier.xml @@ -3,7 +3,6 @@ - + \ No newline at end of file diff --git a/packages/components-react/CHANGELOG.md b/packages/components-react/CHANGELOG.md index 99b1fd4e5d..ca9cec24b5 100644 --- a/packages/components-react/CHANGELOG.md +++ b/packages/components-react/CHANGELOG.md @@ -1,5 +1,12 @@ # @swisspost/design-system-components-react +## 1.0.22 + +### Patch Changes + +- Updated dependencies: + - @swisspost/design-system-components@1.6.2 + ## 1.0.21 ### Patch Changes diff --git a/packages/components-react/package.json b/packages/components-react/package.json index b333a265c5..62af440c1b 100644 --- a/packages/components-react/package.json +++ b/packages/components-react/package.json @@ -1,6 +1,6 @@ { "name": "@swisspost/design-system-components-react", - "version": "1.0.21", + "version": "1.0.22", "license": "Apache-2.0", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -19,7 +19,7 @@ "tsc": "tsc -p ." }, "dependencies": { - "@swisspost/design-system-components": "workspace:1.6.1" + "@swisspost/design-system-components": "workspace:1.6.2" }, "devDependencies": { "@types/node": "18.18.8", diff --git a/packages/components/.eslintrc.js b/packages/components/.eslintrc.js index 04758f327b..11f03ada2b 100644 --- a/packages/components/.eslintrc.js +++ b/packages/components/.eslintrc.js @@ -11,6 +11,7 @@ module.exports = { ], overrides: [], parser: '@typescript-eslint/parser', + ignorePatterns: ['.eslintrc.js'], parserOptions: { ecmaVersion: 'latest', sourceType: 'module', diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index 2f3149d0b4..b2483d159f 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -1,5 +1,12 @@ # @swisspost/design-system-components +## 1.6.2 + +### Patch Changes + +- Updated dependencies: + - @swisspost/design-system-styles@6.4.4 + ## 1.6.1 ### Patch Changes diff --git a/packages/components/package.json b/packages/components/package.json index a4e6c02e3f..df1a5c5ac6 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,12 +1,12 @@ { "name": "@swisspost/design-system-components", - "version": "1.6.1", + "version": "1.6.2", "description": "A collection of web components built with Stencil JS for the Swiss Post Design System.", "license": "Apache-2.0", "main": "loader/index.cjs.js", "module": "loader/index.js", "es2017": "loader/index.2017.js", - "types": "dist/types/components.d.ts", + "types": "loader/index.d.ts", "collection": "dist/collection/collection-manifest.json", "collection:main": "dist/collection/index.js", "unpkg": "dist/post-components/post-components.esm.js", @@ -40,7 +40,7 @@ "@floating-ui/dom": "1.5.3", "@oddbird/popover-polyfill": "0.3.1", "@stencil/core": "4.7.0", - "@swisspost/design-system-styles": "workspace:6.4.3", + "@swisspost/design-system-styles": "workspace:6.4.4", "ally.js": "1.4.1", "long-press-event": "2.4.6" }, diff --git a/packages/components/src/index.ts b/packages/components/src/index.ts index 7531c10b86..7769c7c985 100644 --- a/packages/components/src/index.ts +++ b/packages/components/src/index.ts @@ -1 +1,10 @@ export { Components, JSX } from './components'; + +// Export every single component so it gets included in the dist output +export { PostAlert } from './components/post-alert/post-alert'; +export { PostCollapsible } from './components/post-collapsible/post-collapsible'; +export { PostIcon } from './components/post-icon/post-icon'; +export { PostTabs } from './components/post-tabs/post-tabs'; +export { PostTabHeader } from './components/post-tab-header/post-tab-header'; +export { PostTabPanel } from './components/post-tab-panel/post-tab-panel'; +export { PostTooltip } from './components/post-tooltip/post-tooltip'; diff --git a/packages/components/stencil.config.ts b/packages/components/stencil.config.ts index 457c40b937..188ebab793 100644 --- a/packages/components/stencil.config.ts +++ b/packages/components/stencil.config.ts @@ -18,11 +18,11 @@ export const config: Config = { type: 'dist-custom-elements', }, { - type: 'docs-readme', + type: 'www', + serviceWorker: null, // disable service workers, }, { - type: 'www', - serviceWorker: null, // disable service workers + type: 'docs-readme', }, { type: 'docs-json', diff --git a/packages/demo/CHANGELOG.md b/packages/demo/CHANGELOG.md index ea47c968d2..277a6ef875 100644 --- a/packages/demo/CHANGELOG.md +++ b/packages/demo/CHANGELOG.md @@ -1,5 +1,13 @@ # @swisspost/design-system-demo +## 7.0.4 + +### Patch Changes + +- Updated dependencies: + - @swisspost/design-system-styles@6.4.4 + - @swisspost/design-system-intranet-header@5.0.4 + ## 7.0.3 ### Patch Changes diff --git a/packages/demo/package.json b/packages/demo/package.json index e9e164fa00..dea2928ad8 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -1,6 +1,6 @@ { "name": "@swisspost/design-system-demo", - "version": "7.0.3", + "version": "7.0.4", "description": "Pattern documentation, code snippets and implementation guidelines for the Design System Styles.", "author": "Swiss Post ", "license": "Apache-2.0", @@ -25,8 +25,8 @@ "@ng-bootstrap/ng-bootstrap": "15.1.2", "@popperjs/core": "2.11.8", "@swimlane/ngx-datatable": "20.1.0", - "@swisspost/design-system-intranet-header": "workspace:5.0.3", - "@swisspost/design-system-styles": "workspace:6.4.3", + "@swisspost/design-system-intranet-header": "workspace:5.0.4", + "@swisspost/design-system-styles": "workspace:6.4.4", "bootstrap": "5.3.2", "core-js": "3.33.2", "highlight.js": "11.9.0", diff --git a/packages/demo/src/app/home/home.component.html b/packages/demo/src/app/home/home.component.html index 806120afe6..eb5a2e83ee 100644 --- a/packages/demo/src/app/home/home.component.html +++ b/packages/demo/src/app/home/home.component.html @@ -60,14 +60,81 @@

The Swiss Post Design System is now compatible with An rel="noopener" target="_blank" > - Support chanel + Support channel in Teams.

+
+

Compatibility

-
-
+

List of compatible version numbers with external dependencies.

+ +
+
+

Styles

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Package @swisspost/design-system-styles
VersionBootstrapAngularNg-Bootstrap
5.x5.014.x13.x
6.25.215.x14.x
6.45.316.x15.x
+
+
+

Common Web Frontend

+ + + + + + + + + + + + + + + + + + + +
Package @ch-post-common/common-web-frontend
VersionBootstrapAngularNg-Bootstrap
4.x4.612.x9.x
+
+
+
+ +
+

Setup for migration instructions

+
What environment is your application for? diff --git a/packages/demo/src/app/intranet-layout/intranet-layout.component.html b/packages/demo/src/app/intranet-layout/intranet-layout.component.html index ccf9660a86..fb924e1d43 100644 --- a/packages/demo/src/app/intranet-layout/intranet-layout.component.html +++ b/packages/demo/src/app/intranet-layout/intranet-layout.component.html @@ -9,25 +9,40 @@

Installation

Angular component and as such, only works with Angular projects.

-

The supported Angular versions are:

- - - - - - - - - - - - - - - - - -
Intranet HeaderAngular
4.x15.x
5.x16.x
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
List of compatible version numbers with external dependencies.
Intranet-headerBootstrapAngularNg-Bootstrap
3.x4.x14.x13.x
4.x5.215.x14.x
5.x5.216.x15.x
+

Install the latest version of the Intranet Header with:

( -
-
-
-

Support

+const BASEURL = 'https://github.com/swisspost/design-system/tree/main/packages/documentation'; -
- {DEVELOPERS.sort(() => (Math.random() > 0.5 ? 1 : -1)).map((developer, index) => ( -
- {`Profile -
-

- {developer.name} -

-

{developer.title}

-
-
- ))} -
+function getGitHubUrl(path: String) { + return `${BASEURL}${path.replace(/^\./, '').replace(/\.stories\.ts$/, '.docs.mdx')}`; +} -
-
- - Submit an issue - +export default (params: { pathToStoryFile: String }) => ( + <> + +
+
+
+

Support

+ +
+ {DEVELOPERS.sort(() => (Math.random() > 0.5 ? 1 : -1)).map((developer, index) => ( +
+ {`Profile +
+

+ {developer.name} +

+

{developer.title}

+
+
+ ))} +
+ +
-
-
- © 2022 Swiss Post Ltd. - -
+ + ); diff --git a/packages/documentation/.storybook/blocks/layout.tsx b/packages/documentation/.storybook/blocks/layout.tsx index 7f3813c8b3..f6708bedfe 100644 --- a/packages/documentation/.storybook/blocks/layout.tsx +++ b/packages/documentation/.storybook/blocks/layout.tsx @@ -18,12 +18,13 @@ export default (props: PropsWithChildren) => { context.channel.data.docsPrepared[0].parameters.layout === 'fullscreen' ? 'container-fluid' : 'container'; + const pathToStoryFile = context.storyIdToCSFFile.values().next().value.meta.parameters.fileName; return ( {shouldShowHeader() &&
}
{children}
- {shouldShowFooter() &&
} + {shouldShowFooter() &&
} ); diff --git a/packages/documentation/.storybook/preview.ts b/packages/documentation/.storybook/preview.ts index 73f305ef7c..288dc1bef3 100644 --- a/packages/documentation/.storybook/preview.ts +++ b/packages/documentation/.storybook/preview.ts @@ -22,13 +22,13 @@ const preview: Preview = { order: [ 'Home', 'Getting Started', - ['Styles', 'Components'], + ['Styles', 'Components', 'Compatibility'], 'Foundations', [ 'Typography', 'Color', 'Layout', - ['Breakpoints', 'Grid', 'TODOS'], + ['Breakpoints', 'Containers', 'Grid', 'TODOS'], 'Elevation', 'Accessibility', ], diff --git a/packages/documentation/CHANGELOG.md b/packages/documentation/CHANGELOG.md index f22e5bdd97..3b0668857a 100644 --- a/packages/documentation/CHANGELOG.md +++ b/packages/documentation/CHANGELOG.md @@ -1,5 +1,22 @@ # @swisspost/design-system-documentation +## 2.4.0 + +### Minor Changes + +- Added docs page on how to use columns. (by [@davidritter-dotcom](https://github.com/davidritter-dotcom) with [#2062](https://github.com/swisspost/design-system/pull/2062)) + +### Patch Changes + +- Added official way to use label in a floating-label select as a placeholder. (by [@imagoiq](https://github.com/imagoiq) with [#2200](https://github.com/swisspost/design-system/pull/2200)) + +- Extended the `@swisspost/design-system-components` package getting-started docs page to show multiple ways how it can be used/imported in different project setups. (by [@oliverschuerch](https://github.com/oliverschuerch) with [#2214](https://github.com/swisspost/design-system/pull/2214)) +- Updated dependencies: + - @swisspost/internet-header@1.13.0 + - @swisspost/design-system-styles@6.4.4 + - @swisspost/design-system-components@1.6.2 + - @swisspost/design-system-components-react@1.0.22 + ## 2.3.1 ### Patch Changes diff --git a/packages/documentation/cypress/snapshots/components/select.snapshot.ts b/packages/documentation/cypress/snapshots/components/select.snapshot.ts index 107354d6e7..f0995c7ce2 100644 --- a/packages/documentation/cypress/snapshots/components/select.snapshot.ts +++ b/packages/documentation/cypress/snapshots/components/select.snapshot.ts @@ -1,7 +1,14 @@ +const SELECTBASEURL = '/iframe.html?id=snapshots--select'; +const multiple = ['default', 'multiple']; + describe('Select', () => { - it('default', () => { - cy.visit('/iframe.html?id=snapshots--select'); - cy.get('.form-select', { timeout: 30000 }).should('be.visible'); - cy.percySnapshot('Selects', { widths: [400] }); + describe('multiple', () => { + multiple.forEach(multiple => { + it(multiple, () => { + cy.visit(`${SELECTBASEURL}${multiple}`); + cy.get('.form-select', { timeout: 30000 }).should('be.visible'); + cy.percySnapshot(`Selects-${multiple}`, { widths: [400] }); + }); + }); }); }); diff --git a/packages/documentation/cypress/snapshots/components/textarea.snapshot.ts b/packages/documentation/cypress/snapshots/components/textarea.snapshot.ts new file mode 100644 index 0000000000..bf29cb92f0 --- /dev/null +++ b/packages/documentation/cypress/snapshots/components/textarea.snapshot.ts @@ -0,0 +1,7 @@ +describe('Textarea', () => { + it('default', () => { + cy.visit('./iframe.html?id=snapshots--textarea'); + cy.percySnapshot('Textareas', { widths: [400] }); + }); + }); + \ No newline at end of file diff --git a/packages/documentation/package.json b/packages/documentation/package.json index 0c3b7f05a6..3a3e174eb8 100644 --- a/packages/documentation/package.json +++ b/packages/documentation/package.json @@ -1,6 +1,6 @@ { "name": "@swisspost/design-system-documentation", - "version": "2.3.1", + "version": "2.4.0", "description": "Swiss Post Design System Documentation.", "author": "Swiss Post ", "license": "Apache-2.0", @@ -25,11 +25,11 @@ "snapshots": "percy exec -- cypress run --config-file ./cypress.snapshot.config.js --record --key 0995e768-43ec-42bd-a127-ff944a2ad8c9" }, "dependencies": { - "@swisspost/design-system-components": "workspace:1.6.1", - "@swisspost/design-system-components-react": "workspace:1.0.21", + "@swisspost/design-system-components": "workspace:1.6.2", + "@swisspost/design-system-components-react": "workspace:1.0.22", "@swisspost/design-system-icons": "workspace:1.0.14", - "@swisspost/design-system-styles": "workspace:6.4.3", - "@swisspost/internet-header": "workspace:1.12.1", + "@swisspost/design-system-styles": "workspace:6.4.4", + "@swisspost/internet-header": "workspace:1.13.0", "bootstrap": "5.3.2" }, "devDependencies": { diff --git a/packages/documentation/src/stories/components/radio/radio.snapshot.stories.ts b/packages/documentation/src/stories/components/radio/radio.snapshot.stories.ts index 96f084e177..7a9a13a3ea 100644 --- a/packages/documentation/src/stories/components/radio/radio.snapshot.stories.ts +++ b/packages/documentation/src/stories/components/radio/radio.snapshot.stories.ts @@ -1,5 +1,5 @@ import type { Args, StoryContext, StoryObj } from '@storybook/web-components'; -import meta from './radio.stories'; +import meta, { renderInline } from './radio.stories'; import { html } from 'lit'; import { bombArgs } from '../../../utils/bombArgs'; @@ -40,6 +40,12 @@ export const Radio: Story = {
`, )} + + + ${renderInline({ checkedRadio: 2, label: 'Not a unique label' }, { + viewMode: 'snapshot' as StoryContext['ViewMode'], + name: 'Inline', + } as Partial)}
`; }, diff --git a/packages/documentation/src/stories/components/radio/radio.stories.ts b/packages/documentation/src/stories/components/radio/radio.stories.ts index 0dbade84e6..44856c7b3c 100644 --- a/packages/documentation/src/stories/components/radio/radio.stories.ts +++ b/packages/documentation/src/stories/components/radio/radio.stories.ts @@ -166,7 +166,7 @@ type Story = StoryObj; export const Default: Story = {}; -function renderInline(args: Args, context: StoryContext) { +export function renderInline(args: Args, context: Partial) { const [_, updateArgs] = useArgs(); const baseId = `${context.viewMode}_${context.name.replace(/\s/g, '-')}_ExampleRadio`; const id1 = baseId + '1'; diff --git a/packages/documentation/src/stories/components/select/select.snapshot.stories.ts b/packages/documentation/src/stories/components/select/select.snapshot.stories.ts index e3c3abc527..e8f002e208 100644 --- a/packages/documentation/src/stories/components/select/select.snapshot.stories.ts +++ b/packages/documentation/src/stories/components/select/select.snapshot.stories.ts @@ -1,128 +1,91 @@ import type { Args, StoryContext, StoryObj } from '@storybook/web-components'; import meta, { Default, FloatingLabel, FloatingLabelPlaceholder } from './select.stories'; import { html } from 'lit'; -import { bombArgs } from '../../../utils/bombArgs'; +import { getCombinations, COMBINATIONS } from '../../../utils/inputComponentsGetCombinations'; export default { ...meta, title: 'Snapshots', + render: renderSelectSnapshot, }; -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')); +function renderSelectSnapshot(_args: Args, context: StoryContext) { + const combinations = [ + ...COMBINATIONS, + { + label: `Label - small multipleSize`, + multipleSize: 2, + }, + { + label: `Label - large multipleSize`, + multipleSize: 6, + }, + { + label: `Label - With option selected`, + selectedOption: 2, + }, + { + label: `Label - Floating Label with placeholder`, + floatingLabelPlaceholder: true, + }, + ]; + return html` +
+ ${['bg-white', 'bg-dark'].map( + bg => html` +
+

Sizes

+ ${getCombinations('size', context.argTypes.size.options, combinations) + .filter( + (args: Args) => + (!args.multipleSize || (args.multipleSize && context.args.multiple === true)) && + !args.floatingLabelPlaceholder, + ) + .map( + (args: Args) => + html` +
+ ${args.title !== undefined && args.title + ? html` +

+ ${Object.entries(context.argTypes.size.control.labels) + .filter(([key, value]) => key === args.size) + .map(s => s[1])} +

+ ` + : ''} +
${Default.render?.({ ...context.args, ...args }, context)}
+
+ `, + )} +

Floating Label

+ ${getCombinations('floatingLabel', [true], combinations) + .filter( + (args: Args) => + !args.multipleSize || (args.multipleSize && context.args.multiple === true), + ) + .map( + (args: Args) => + html` +
${FloatingLabel.render?.({ ...context.args, ...args }, context)}
+ `, + )} +
+ `, + )} +
+ `; +} - //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')); +type Story = StoryObj; - 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, - )} -
- `, - )} -

Floating Label - with placeholder

- ${bombArgsGeneratedDefault.map( - (args: Args) => - html` -
- ${FloatingLabelPlaceholder.render?.( - { ...context.args, ...FloatingLabelPlaceholder.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, - )} -
- `, - )} -
- `, - )} -
- `; +export const Selectdefault: Story = { + args: { + multiple: false, + }, +}; +export const Selectmultiple: Story = { + args: { + multiple: true, }, }; diff --git a/packages/documentation/src/stories/components/select/select.stories.ts b/packages/documentation/src/stories/components/select/select.stories.ts index 8281b8aa49..4e16df4135 100644 --- a/packages/documentation/src/stories/components/select/select.stories.ts +++ b/packages/documentation/src/stories/components/select/select.stories.ts @@ -243,7 +243,16 @@ const Template: Story = { updateArgs({ value: (e.target as HTMLSelectElement).value }); }}" > - ${options} + ${[ + options[0], + options.slice(1).map( + (option, index) => html` + + `, + ), + ]} `; diff --git a/packages/documentation/src/stories/components/textarea/textarea.snapshot.stories.ts b/packages/documentation/src/stories/components/textarea/textarea.snapshot.stories.ts new file mode 100644 index 0000000000..927c5f271b --- /dev/null +++ b/packages/documentation/src/stories/components/textarea/textarea.snapshot.stories.ts @@ -0,0 +1,71 @@ +import type { Args, StoryContext, StoryObj } from '@storybook/web-components'; +import meta from './textarea.stories'; +import { html } from 'lit'; +import { getCombinations, COMBINATIONS } from '../../../utils/inputComponentsGetCombinations'; + +export default { + ...meta, + title: 'Snapshots', +}; + +type Story = StoryObj; + +export const Textarea: Story = { + render: (_args: Args, context: StoryContext) => { + const combinations = [ + ...COMBINATIONS, + { + label: `Label - small rows`, + rows: 3, + }, + { + label: `Label - large rows`, + rows: 8, + }, + { + label: `Label - Text inside the Textarea`, + textInside: + 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.', + },{ + label: `Label - Not resizable`, + resize: 'resize: none' + } + ]; + + return html` +
+ ${['bg-white', 'bg-dark'].map( + bg => html` +
+

Sizes

+ ${getCombinations('size', context.argTypes.size.options, combinations).map( + (args: Args) => + html` +
+ ${args.title !== undefined && args.title + ? html` +

+ ${Object.entries(context.argTypes.size.control.labels) + .filter(([key, value]) => key === args.size) + .map(s => s[1])} +

+ ` + : ''} +
${meta.render?.({ ...context.args, ...args }, context)}
+
+ `, + )} +

Floating Label

+ ${getCombinations('floatingLabel', [true], combinations).map( + (args: Args) => + html` +
${meta.render?.({ ...context.args, ...args }, context)}
+ `, + )} +
+ `, + )} +
+ `; + }, +}; diff --git a/packages/documentation/src/stories/components/textarea/textarea.stories.ts b/packages/documentation/src/stories/components/textarea/textarea.stories.ts index 63fe82ba98..367f243cc3 100644 --- a/packages/documentation/src/stories/components/textarea/textarea.stories.ts +++ b/packages/documentation/src/stories/components/textarea/textarea.stories.ts @@ -199,7 +199,8 @@ function renderTextarea(args: Args, context: StoryContext) { ?disabled=${args.disabled} aria-label=${useAriaLabel ? args.label : nothing} aria-invalid=${VALIDATION_STATE_MAP[args.validation] ?? nothing} - > + style=${args.resize ?? nothing} + >${args.textInside ?? nothing} `; if (args.floatingLabel) { return html` diff --git a/packages/documentation/src/stories/components/topic-teaser/topic-teaser.docs.mdx b/packages/documentation/src/stories/components/topic-teaser/topic-teaser.docs.mdx index a8ab51994f..9ada585596 100644 --- a/packages/documentation/src/stories/components/topic-teaser/topic-teaser.docs.mdx +++ b/packages/documentation/src/stories/components/topic-teaser/topic-teaser.docs.mdx @@ -1,9 +1,12 @@ import { Canvas, Controls, Meta } from '@storybook/blocks'; import * as TopicTeaserStories from './topic-teaser.stories'; import StylesPackageImport from '../../../shared/styles-package-import.mdx'; +import './topic-teaser.styles.scss'; +
+ # Topic Teaser
@@ -13,9 +16,14 @@ import StylesPackageImport from '../../../shared/styles-package-import.mdx'; If you use multiple topic teasers on one page, each topic teaser must have a different background. - -
+
+ + + +
- +
+ +
diff --git a/packages/documentation/src/stories/components/topic-teaser/topic-teaser.stories.ts b/packages/documentation/src/stories/components/topic-teaser/topic-teaser.stories.ts index 127280968d..8b69ba1dc0 100644 --- a/packages/documentation/src/stories/components/topic-teaser/topic-teaser.stories.ts +++ b/packages/documentation/src/stories/components/topic-teaser/topic-teaser.stories.ts @@ -7,6 +7,7 @@ const meta: Meta = { title: 'Components/Topic Teaser', parameters: { badges: [BADGE.NEEDS_REVISION], + layout: 'fullscreen', }, args: { title: 'Loremipsum', diff --git a/packages/documentation/src/stories/components/topic-teaser/topic-teaser.styles.scss b/packages/documentation/src/stories/components/topic-teaser/topic-teaser.styles.scss new file mode 100644 index 0000000000..aeeee57ac2 --- /dev/null +++ b/packages/documentation/src/stories/components/topic-teaser/topic-teaser.styles.scss @@ -0,0 +1,6 @@ +@use '@swisspost/design-system-styles/core' as post; + +.topic-teaser-full-width-storybook > div > div:first-child { + overflow: hidden; + @include post.responsive-size('huge', 'padding-bottom', 'calc($value + 2rem)'); +} diff --git a/packages/documentation/src/stories/foundation/layout/Columns/columns.docs.mdx b/packages/documentation/src/stories/foundation/layout/Columns/columns.docs.mdx new file mode 100644 index 0000000000..d5d154b512 --- /dev/null +++ b/packages/documentation/src/stories/foundation/layout/Columns/columns.docs.mdx @@ -0,0 +1,87 @@ +import { Meta, Canvas, Source, Controls } from '@storybook/blocks'; +import * as ColumnStories from './columns.stories'; +import './columns.styles.scss'; + + + +# Columns + +{/* prettier-ignore */} +
    +
  • Columns build on the grid’s flexbox architecture which is based on [Bootstrap](https://getbootstrap.com/docs/4.0/layout/grid/). Flexbox means we have options for changing individual columns and modifying groups of columns at the row level. You choose how columns grow, shrink, or otherwise change.
  • +
  • When building grid layouts, all content goes in columns. The hierarchy of our grid goes from container to row to column to your content.
  • +
+ +### Alignment + +Use flexbox alignment utilities to vertically and horizontally align columns. + +#### Vertical alignment + +Change the vertical alignment with any of the responsive align-items-\* classes. + +Or, change the alignment of each column individually with any of the responsive align-self-\* classes. + + +
+ +
+ +#### Horizontal alignment + +Change the horizontal alignment with any of the responsive justify-content-\* classes. + + +
+ +
+ +#### Column wrapping + +If more than 12 columns are placed within a single row, each group of extra columns will, as one unit, wrap onto a new line. + + +
+ +
+ +#### Column breaks + +Breaking columns to a new line in flexbox requires a small hack: add an element with width: 100% wherever you want to wrap your columns to a new line. Normally this is accomplished with multiple .rows, but not every implementation method can account for this. + + +
+ +
+ +### Reorderning + +#### Order classes + +Use .order- classes for controlling the visual order of your content. These classes are responsive, so you can set the order by breakpoint (e.g. .order-1.order-md-2). Includes support for 1 through 5 across all seven grid tiers. If you need more .order-\* classes. + + +
+ +
+ +There are also responsive .order-first and .order-last classes that change the order of an element by applying order: -1 and order: 6, respectively. These classes can also be intermixed with the numbered .order-\* classes as needed. + + + +### Offsetting columns + +You can offset grid columns in two ways: our responsive .offset- grid classes and our margin utilities. Grid classes are sized to match columns while margins are more useful for quick layouts where the width of the offset is variable. + +#### Offset classes + +Move columns to the right using .offset-\* classes. These classes increase the left margin of a column by \* columns. For example, .offset-4 moves .col-1 over four columns. You can also apply the offset above a certain breakpoint with the breakpoint infixes e.g. offset-md-4. + + +
+ +
+ +In addition to column clearing at responsive breakpoints, you may need to reset offsets. + + diff --git a/packages/documentation/src/stories/foundation/layout/Columns/columns.stories.ts b/packages/documentation/src/stories/foundation/layout/Columns/columns.stories.ts new file mode 100644 index 0000000000..47c79c8c94 --- /dev/null +++ b/packages/documentation/src/stories/foundation/layout/Columns/columns.stories.ts @@ -0,0 +1,284 @@ +import type { Args, Meta, StoryFn, StoryObj, StoryContext } from '@storybook/web-components'; +import { BADGE } from '../../../../../.storybook/constants'; +import { html, nothing } from 'lit'; + +const meta: Meta = { + title: 'Foundations/Layout/Columns', + parameters: { + badges: [BADGE.NEEDS_REVISION], + }, + decorators: [ + (story: StoryFn, { args, context }: StoryContext) => html` +
${story(args, context)}
+ `, + ], + args: { + alignItems: 'align-items-start', + alignSelf: 'no self alignment', + justifyContent: 'justify-content-start', + offsetItem: 'offset-1', + renderBreakingElement: true, + ColumnOneOrder: 'no order', + ColumnTwoOrder: 'order-5', + ColumnThreeOrder: 'order-1', + ColumnWidth: 'col-4', + }, + argTypes: { + alignItems: { + name: 'Align Items', + description: 'Aligns the whole row vertically.', + control: { + type: 'select', + }, + options: ['align-items-start', 'align-items-center', 'align-items-end'], + }, + alignSelf: { + name: 'Align Item 1', + description: 'Aligns the Item 1 vertically.', + control: { + type: 'select', + }, + options: ['no self alignment', 'align-self-start', 'align-self-center', 'align-self-end'], + }, + justifyContent: { + name: 'Horizontal Alignement', + description: 'Aligns the Items horizontally.', + control: { + type: 'select', + }, + options: [ + 'justify-content-start', + 'justify-content-center', + 'justify-content-end', + 'justify-content-around', + 'justify-content-between', + 'justify-content-evenly', + ], + }, + offsetItem: { + name: 'Offset classes', + description: 'Increases the left margin of a column', + control: { + type: 'select', + }, + options: [ + 'offset-1', + 'offset-2', + 'offset-3', + 'offset-4', + 'offset-5', + 'offset-6', + 'offset-7', + 'offset-8', + 'offset-9', + 'offset-10', + 'offset-11', + ], + }, + renderBreakingElement: { + name: 'Render breaking element', + description: 'Toggle rendering of breaking element', + control: { + type: 'boolean', + }, + }, + ColumnOneOrder: { + name: 'Order first column', + description: 'Set order-class for first element', + control: { + type: 'select', + }, + options: ['no order class', 'order-0', 'order-1', 'order-2', 'order-3', 'order-4', 'order-5'], + }, + ColumnTwoOrder: { + name: 'Order second column', + description: 'Set order-class for second element', + control: { + type: 'select', + }, + options: ['no order class', 'order-0', 'order-1', 'order-2', 'order-3', 'order-4', 'order-5'], + }, + ColumnThreeOrder: { + name: 'Order third column', + description: 'Set order-class for third element', + control: { + type: 'select', + }, + options: ['no order class', 'order-0', 'order-1', 'order-2', 'order-3', 'order-4', 'order-5'], + }, + ColumnWidth: { + name: 'Width of second Column', + description: 'Set width for second column to see line breaking', + control: { + type: 'select', + }, + options: [ + 'col-1', + 'col-2', + 'col-3', + 'col-4', + 'col-5', + 'col-6', + 'col-7', + 'col-8', + 'col-9', + 'col-10', + 'col-11', + 'col-12', + ], + }, + }, +}; + +export default meta; + +type Story = StoryObj; + +export const VerticalExample: Story = { + parameters: { + controls: { + include: ['Align Items', 'Align Item 1'], + }, + }, + render: (args: Args) => html` +
+
+
+ Item 1 +
+
Item 2
+
Item 3
+
+
+ `, +}; + +export const HorizontalExample: Story = { + parameters: { + controls: { + include: ['Horizontal Alignement'], + }, + }, + render: (args: Args) => html` +
+
+
Item 1
+
Item 2
+
+
+ `, +}; + +export const OrderExample: Story = { + parameters: { + controls: { + include: ['Order first column', 'Order second column', 'Order third column'], + }, + }, + render: (args: Args) => html` +
+
+
+ First in DOM +
+
+ Second in DOM +
+
+ Third in DOM +
+
+
+ `, +}; + +export const OrderMaxExample: Story = { + render: () => html` +
+
+
First in DOM, ordered last
+
Second in DOM, unordered
+
Third in DOM, ordered first
+
+
+ `, +}; + +export const OffsetExample: Story = { + parameters: { + controls: { + include: ['Offset classes'], + }, + }, + render: (args: Args) => html` +
+
.${args.offsetItem}
+
+ `, +}; + +export const ColumnBreakExample: Story = { + parameters: { + controls: { + include: ['Render breaking element'], + }, + }, + render: (args: Args) => html` +
+
.col-3
+
.col-3
+ ${args.renderBreakingElement + ? html` + +
+ ` + : nothing} +
.col-3
+
.col-3
+
+ `, +}; + +export const ResetOffsetExample: Story = { + decorators: [ + (story: StoryFn, { args, context }: StoryContext) => html` + ${story(args, context)} +

Resize the browser window to see changes.

+ `, + ], + render: () => html` +
+
.col-sm-5 .col-md-6
+
+ .col-sm-5 .offset-sm-2 .col-md-6 .offset-md-0 +
+
+ `, +}; + +export const ColumnWrapping: Story = { + parameters: { + controls: { + include: ['Width of second Column'], + }, + }, + render: (args: Args) => html` +
+
.col-9
+
${args.ColumnWidth}
+
+ .col-6 +
+ Subsequent columns continue along the new line. +
+
+ `, +}; diff --git a/packages/documentation/src/stories/foundation/layout/Columns/columns.styles.scss b/packages/documentation/src/stories/foundation/layout/Columns/columns.styles.scss new file mode 100644 index 0000000000..6946909b68 --- /dev/null +++ b/packages/documentation/src/stories/foundation/layout/Columns/columns.styles.scss @@ -0,0 +1,25 @@ +@use '@swisspost/design-system-styles/core' as post; + +.column-example { + font-size: post.$font-size-sm; + + .row > *:not(.w-100) { + padding-block: 0.75rem; + background-color: lighten(post.$nightblue-bright, 55%); + border: 1px solid lighten(post.$nightblue-dark, 45%); + } + + .row { + background-color: lighten(post.$nightblue-bright, 61.5%); + } + + .row-height { + min-height: 10rem; + } + + .standalone-columns > *:not(p){ + padding-block: 0.75rem; + background-color: lighten(post.$nightblue-bright, 55%); + border: 1px solid lighten(post.$nightblue-dark, 45%); + } +} \ No newline at end of file diff --git a/packages/documentation/src/stories/foundation/layout/breakpoints/breakpoints-available.sample.scss b/packages/documentation/src/stories/foundation/layout/breakpoints/breakpoints-available.sample.scss deleted file mode 100644 index 98df3dfd65..0000000000 --- a/packages/documentation/src/stories/foundation/layout/breakpoints/breakpoints-available.sample.scss +++ /dev/null @@ -1,5 +0,0 @@ -@use '@swisspost/design-system-styles/core' as post; - -@each $key, $value in post.$grid-breakpoints { - ... -} diff --git a/packages/documentation/src/stories/foundation/layout/breakpoints/breakpoints-between.sample.scss b/packages/documentation/src/stories/foundation/layout/breakpoints/breakpoints-between.sample.scss index 19b499f360..f1d8a8c71a 100644 --- a/packages/documentation/src/stories/foundation/layout/breakpoints/breakpoints-between.sample.scss +++ b/packages/documentation/src/stories/foundation/layout/breakpoints/breakpoints-between.sample.scss @@ -1,3 +1,5 @@ +@use '@swisspost/design-system-styles/core' as post; + @include post.media-breakpoint-between(sm, lg) { .custom-class { display: block; diff --git a/packages/documentation/src/stories/foundation/layout/breakpoints/breakpoints-max-width.sample.scss b/packages/documentation/src/stories/foundation/layout/breakpoints/breakpoints-max-width.sample.scss index febe98b129..5db268f38a 100644 --- a/packages/documentation/src/stories/foundation/layout/breakpoints/breakpoints-max-width.sample.scss +++ b/packages/documentation/src/stories/foundation/layout/breakpoints/breakpoints-max-width.sample.scss @@ -1,3 +1,5 @@ +@use '@swisspost/design-system-styles/core' as post; + // No media query necessary for xs breakpoint as it's effectively @media (max-width: 0) { ... } @include post.media-breakpoint-down(lg) { .custom-class { diff --git a/packages/documentation/src/stories/foundation/layout/breakpoints/breakpoints-min-width.sample.scss b/packages/documentation/src/stories/foundation/layout/breakpoints/breakpoints-min-width.sample.scss index 1f7ab6b26c..20603a62c9 100644 --- a/packages/documentation/src/stories/foundation/layout/breakpoints/breakpoints-min-width.sample.scss +++ b/packages/documentation/src/stories/foundation/layout/breakpoints/breakpoints-min-width.sample.scss @@ -1,3 +1,5 @@ +@use '@swisspost/design-system-styles/core' as post; + // No media query necessary for xs breakpoint as it's effectively @media (min-width: 0) { ... } .custom-class { display: none; diff --git a/packages/documentation/src/stories/foundation/layout/breakpoints/breakpoints-single.sample.scss b/packages/documentation/src/stories/foundation/layout/breakpoints/breakpoints-single.sample.scss index 149edc020c..6cce81517c 100644 --- a/packages/documentation/src/stories/foundation/layout/breakpoints/breakpoints-single.sample.scss +++ b/packages/documentation/src/stories/foundation/layout/breakpoints/breakpoints-single.sample.scss @@ -1,3 +1,5 @@ +@use '@swisspost/design-system-styles/core' as post; + @include post.media-breakpoint-only(xs) { .custom-class { display: block; diff --git a/packages/documentation/src/stories/foundation/layout/breakpoints/breakpoints.blocks.tsx b/packages/documentation/src/stories/foundation/layout/breakpoints/breakpoints.blocks.tsx index 171d3426bb..1b7135f6b0 100644 --- a/packages/documentation/src/stories/foundation/layout/breakpoints/breakpoints.blocks.tsx +++ b/packages/documentation/src/stories/foundation/layout/breakpoints/breakpoints.blocks.tsx @@ -1,33 +1,36 @@ import { forEach } from '../../../../utils/react'; import { parse } from '../../../../utils/sass-export'; +import { SpecTable } from '../shared.blocks'; import scss from './breakpoints.module.scss'; export const SCSS_VARIABLES = parse(scss); export const BreakpointTable = () => ( -
- - - - - - - - - - {forEach( - SCSS_VARIABLES.breakpoint, - (data: { key: number; value: { name: string; infix: any; dimensions: string } }) => { - return ( - - - - - - ); - }, - )} - -
Class infixDimensions
{data.value.name}{data.value.dimensions}
-
+ + + Name + {forEach(SCSS_VARIABLES.breakpoint, (data: { key: string; value: { name: string } }) => ( + + {data.value.name} + + ))} + + + + Code name + {forEach(SCSS_VARIABLES.breakpoint, (data: { key: string }) => ( + + {data.key} + + ))} + + + Class infix + {forEach(SCSS_VARIABLES.breakpoint, (data: { key: string; value: { infix: string } }) => ( + + {data.value.infix === 'none' ? 'none' : -{data.value.infix}-} + + ))} + + ); diff --git a/packages/documentation/src/stories/foundation/layout/breakpoints/breakpoints.docs.mdx b/packages/documentation/src/stories/foundation/layout/breakpoints/breakpoints.docs.mdx index 01c0ff390f..bd479ccdda 100644 --- a/packages/documentation/src/stories/foundation/layout/breakpoints/breakpoints.docs.mdx +++ b/packages/documentation/src/stories/foundation/layout/breakpoints/breakpoints.docs.mdx @@ -1,7 +1,7 @@ import { Meta, Source } from '@storybook/blocks'; +import { formatAsMap } from '../../../../utils/sass-export'; import { BreakpointTable, SCSS_VARIABLES } from './breakpoints.blocks'; import * as BreakpointStories from './breakpoints.stories'; -import SampleAvailable from './breakpoints-available.sample.scss?raw'; import SampleMinWidth from './breakpoints-min-width.sample.scss?raw'; import SampleMaxWidth from './breakpoints-max-width.sample.scss?raw'; import SampleSingle from './breakpoints-single.sample.scss?raw'; @@ -24,18 +24,25 @@ breakpoints, sometimes referred to as grid tiers, for building responsively. The -You’ll find these breakpoints in a Sass map in our styles core. +## CSS + +When using our source Sass files, you have the option of using Sass variables to change the breakpoints (not recommended). + +### Sass variables + dark + code={Object.entries(SCSS_VARIABLES.variables) + .map(([key, value]) => `$${key}: ${formatAsMap(value)};`) + .join('\n')} +> -## Mixins +### Sass mixins There are several mixins available to use in your own Sass to help with building responsive layouts. -### Min-width +#### Min-width We primarily use the following media query ranges—or breakpoints—in our source Sass files for our layout, grid system, and components. @@ -44,7 +51,7 @@ We primarily use the following media query ranges—or breakpoints—in our sour language="scss" /> -### Max-width +#### Max-width We occasionally use media queries that go in the other direction. @@ -53,7 +60,7 @@ We occasionally use media queries that go in the other direction. language="scss" /> -### Single breakpoint +#### Single breakpoint There are also media queries and mixins for targeting a single segment of screen sizes using the minimum and maximum breakpoint widths. @@ -62,7 +69,7 @@ There are also media queries and mixins for targeting a single segment of screen language="scss" /> -### Between breakpoints +#### Between breakpoints Similarly, media queries may span multiple breakpoint widths. diff --git a/packages/documentation/src/stories/foundation/layout/breakpoints/breakpoints.module.scss b/packages/documentation/src/stories/foundation/layout/breakpoints/breakpoints.module.scss index 27545bd139..4eca9d885c 100644 --- a/packages/documentation/src/stories/foundation/layout/breakpoints/breakpoints.module.scss +++ b/packages/documentation/src/stories/foundation/layout/breakpoints/breakpoints.module.scss @@ -1,24 +1,11 @@ -@use 'sass:list'; -@use 'sass:map'; @use '@swisspost/design-system-styles/core' as post; -@use '../layout.shared' as shared; +@use '../shared.module' as shared; :export { - @each $breakpoint, $value in post.$grid-breakpoints { - $i: list.index(post.$grid-breakpoints, $breakpoint $value); - $name: map.get(shared.$breakpointNames, $breakpoint) or $breakpoint; - - breakpoint_#{$breakpoint}_name: $name; + // Variables used in the spec table (some variables used on the page are defined in the shared module) - @if $i == 1 { - $keys: map.keys(post.$grid-breakpoints); - $nextValue: map.get(post.$grid-breakpoints, list.nth($keys, $i + 1)); - - breakpoint_#{$breakpoint}_infix: none; - breakpoint_#{$breakpoint}_dimensions: #{'<' + $nextValue}; - } @else { - breakpoint_#{$breakpoint}_infix: #{'' + $breakpoint + ''}; - breakpoint_#{$breakpoint}_dimensions: #{'≥' + $value}; - } + // Variables to expose under sass variables section + @each $breakpoint, $value in post.$grid-breakpoints { + variables_grid-breakpoints_#{$breakpoint}: $value; } } diff --git a/packages/documentation/src/stories/foundation/layout/containers/containers.blocks.tsx b/packages/documentation/src/stories/foundation/layout/containers/containers.blocks.tsx new file mode 100644 index 0000000000..111bbe27c3 --- /dev/null +++ b/packages/documentation/src/stories/foundation/layout/containers/containers.blocks.tsx @@ -0,0 +1,42 @@ +import { parse } from '../../../../utils/sass-export'; +import { forEach } from '../../../../utils/react'; +import { SpecTable } from '../shared.blocks'; +import scss from './containers.module.scss'; + +export const SCSS_VARIABLES = parse(scss); + +export const ContainersTable = () => ( + + + + Container max-width + + {forEach( + SCSS_VARIABLES.container, + (data: { key: string; value: { ['max-width']: string } }) => ( + {data.value['max-width']} + ), + )} + + + + Container padding + + {forEach(SCSS_VARIABLES.container, (data: { key: string; value: { padding: string } }) => ( + {data.value.padding} + ))} + + + + + Container-Fluid padding + + {forEach( + SCSS_VARIABLES.container, + (data: { key: string; value: { fluid: { padding: string } } }) => ( + {data.value.fluid.padding} + ), + )} + + +); diff --git a/packages/documentation/src/stories/foundation/layout/containers/containers.docs.mdx b/packages/documentation/src/stories/foundation/layout/containers/containers.docs.mdx new file mode 100644 index 0000000000..1efc2ac81a --- /dev/null +++ b/packages/documentation/src/stories/foundation/layout/containers/containers.docs.mdx @@ -0,0 +1,47 @@ +import { Meta, Source } from '@storybook/blocks'; +import { formatAsMap } from '../../../../utils/sass-export'; +import { ContainersTable, SCSS_VARIABLES } from './containers.blocks'; +import * as ContainerStories from './containers.stories'; + + + +# Containers + +

Containers are a fundamental building block of our Design-System that contain, pad, and align your content within a given device or viewport. They are required, when using our grid-system. While containers can be nested, most layouts do not require a nested container.

+ +We can distinguish between two different container types: + +- .container, which defines a max-width on some breakpoints. +- .container-fluid, which is width: 100% at all breakpoints. + + + +## Default container + +Our default `.container` class is a responsive, fixed-width container. + + + +
`} language="scss"/> + +## Fluid containers + +Use `.container-fluid` for a full width container, spanning the entire width of the viewport on every breakpoint. + + + +
`} language="scss"/> + +## CSS + +When using our source Sass files, you have the option of using Sass variables for customization (not recommended). + +### Sass variables + + `$${key}: ${formatAsMap(value)};`) + .join('\n')} +> diff --git a/packages/documentation/src/stories/foundation/layout/containers/containers.module.scss b/packages/documentation/src/stories/foundation/layout/containers/containers.module.scss new file mode 100644 index 0000000000..4c578c2f7f --- /dev/null +++ b/packages/documentation/src/stories/foundation/layout/containers/containers.module.scss @@ -0,0 +1,30 @@ +@use 'sass:map'; +@use '@swisspost/design-system-styles/core' as post; +@use '../shared.module' as shared; + +:export { + // Variables used in the spec table (some variables used on the page are defined in the shared module) + @each $breakpoint, $value in post.$grid-breakpoints { + container_#{$breakpoint}_max-width: map.get(post.$container-max-widths, $breakpoint) or none; + container_#{$breakpoint}_padding: map.get(post.$grid-container-padding, $breakpoint); + container_#{$breakpoint}_fluid_padding: map.get( + post.$grid-container-fluid-padding, + $breakpoint + ); + } + + // Variables to expose under sass variables section + @each $breakpoint, $value in post.$grid-breakpoints { + variables_container-max-widths_#{$breakpoint}: map.get(post.$container-max-widths, $breakpoint); + variables_grid-container-padding_#{$breakpoint}: map.get( + post.$grid-container-padding, + $breakpoint + ) or + none; + variables_grid-container-fluid-padding_#{$breakpoint}: map.get( + post.$grid-container-fluid-padding, + $breakpoint + ) or + none; + } +} diff --git a/packages/documentation/src/stories/foundation/layout/containers/containers.stories.ts b/packages/documentation/src/stories/foundation/layout/containers/containers.stories.ts new file mode 100644 index 0000000000..0544acac1f --- /dev/null +++ b/packages/documentation/src/stories/foundation/layout/containers/containers.stories.ts @@ -0,0 +1,15 @@ +import type { Meta, StoryObj } from '@storybook/web-components'; +import { BADGE } from '../../../../../.storybook/constants'; + +const meta: Meta = { + title: 'Foundations/Layout/Containers', + parameters: { + badges: [BADGE.NEEDS_REVISION], + }, +}; + +export default meta; + +type Story = StoryObj; + +export const Default: Story = {}; diff --git a/packages/documentation/src/stories/foundation/layout/grid/grid-scss-mixins.sample.scss b/packages/documentation/src/stories/foundation/layout/grid/grid-scss-mixins.sample.scss index 03f905f5a0..947e459731 100644 --- a/packages/documentation/src/stories/foundation/layout/grid/grid-scss-mixins.sample.scss +++ b/packages/documentation/src/stories/foundation/layout/grid/grid-scss-mixins.sample.scss @@ -1,12 +1,14 @@ +@use '@swisspost/design-system-styles/core' as post; + // Creates a wrapper for a series of columns -@include make-row(); +@include post.make-row(); // Make the column element grid-ready (applying everything but the width) -@include make-col-ready(); +@include post.make-col-ready(); // Without optional size values, the mixin will create equal columns (similar to using .col) -@include make-col(); -@include make-col($size, $columns: $grid-columns); +@include post.make-col(); +@include post.make-col($size, $columns: post.$grid-columns); // Offset with margins -@include make-col-offset($size, $columns: $grid-columns); +@include post.make-col-offset($size, $columns: post.$grid-columns); diff --git a/packages/documentation/src/stories/foundation/layout/grid/grid.blocks.tsx b/packages/documentation/src/stories/foundation/layout/grid/grid.blocks.tsx index 62bf8a5cae..44d28a59cd 100644 --- a/packages/documentation/src/stories/foundation/layout/grid/grid.blocks.tsx +++ b/packages/documentation/src/stories/foundation/layout/grid/grid.blocks.tsx @@ -1,122 +1,60 @@ import LinkTo from '@storybook/addon-links/react'; import { parse } from '../../../../utils/sass-export'; import { forEach } from '../../../../utils/react'; +import { SpecTable } from '../shared.blocks'; import scss from './grid.module.scss'; export const SCSS_VARIABLES = parse(scss); -export const GridBreakpoints = () => ( -
- - - - - {forEach( - SCSS_VARIABLES.breakpoint, - (data: { key: string; value: { dimensions: string } }) => ( - - ), - )} - - - - - - {forEach(SCSS_VARIABLES.breakpoint, (data: { key: string; value: { name: string } }) => ( - - ))} - - - - - {forEach(SCSS_VARIABLES.breakpoint, (data: { key: string; value: { infix: string } }) => ( - - ))} - - - - - {forEach( - SCSS_VARIABLES.container, - (data: { key: string; value: { ['max-width']: string } }) => ( - - ), - )} - - - - {forEach( - SCSS_VARIABLES.container, - (data: { key: string; value: { padding: string } }) => ( - - ), - )} - - - - - {forEach( - SCSS_VARIABLES.container, - (data: { key: string; value: { fluid: { padding: string } } }) => ( - - ), - )} - - - - - {forEach( - SCSS_VARIABLES.grid, - (data: { key: string; value: { ['gutter-width']: string } }) => ( - - ), - )} - - - - - - - - - - - - - - - - - - - - -
- {data.key} -
- {data.value.dimensions} -
Name - {data.value.name} -
Class infixes - {data.value.infix === 'none' ? 'none' : {`-${data.key}-`}} -
- Container max-width - {data.value['max-width']}
- Container padding - {data.value.padding}
- Container-Fluid padding - {data.value.fluid.padding}
Gutter width{data.value['gutter-width']}
Amount of columns{SCSS_VARIABLES['grid-columns']}
Custom gutters - - yes - -
Nestable - - yes - -
Column ordering - - yes - -
-
+export const GridTable = () => ( + + + Class prefix + {forEach(SCSS_VARIABLES.breakpoint, (data: { key: string; value: { infix: string } }) => ( + + .col-{data.value.infix === 'none' ? '' : `${data.value.infix}-`} + + ))} + + + + Gutter width + {forEach( + SCSS_VARIABLES.grid, + (data: { key: string; value: { ['gutter-width']: string } }) => ( + {data.value['gutter-width']} + ), + )} + + + + Amount of columns + {SCSS_VARIABLES['grid-columns']} + + + + Custom gutters + + + yes + + + + + Nestable + + + yes + + + + + Column ordering + + + yes + + + + ); diff --git a/packages/documentation/src/stories/foundation/layout/grid/grid.docs.mdx b/packages/documentation/src/stories/foundation/layout/grid/grid.docs.mdx index a3a2e245af..b160898b1f 100644 --- a/packages/documentation/src/stories/foundation/layout/grid/grid.docs.mdx +++ b/packages/documentation/src/stories/foundation/layout/grid/grid.docs.mdx @@ -1,6 +1,6 @@ import { Meta, Canvas, Source } from '@storybook/blocks'; import { formatAsMap } from '../../../../utils/sass-export'; -import { GridBreakpoints, SCSS_VARIABLES } from './grid.blocks'; +import { GridTable, SCSS_VARIABLES } from './grid.blocks'; import * as GridStories from './grid.stories'; import './grid.styles.scss'; import SampleContainer from './grid-container.sample.html?raw'; @@ -8,7 +8,7 @@ import SampleScssMixins from './grid-scss-mixins.sample.scss?raw'; -# Grid +# Grid system
Use our powerful mobile-first flexbox grid to build layouts of all shapes and sizes thanks to a @@ -48,7 +48,8 @@ Breaking it down, here’s how the grid system comes together: Our grid system can adapt across all {Object.keys(SCSS_VARIABLES.breakpoint).length} breakpoints. Each of these breakpoints have their own specifications, a unique class prefix, and some modifiers. - + + ## Auto-layout columns diff --git a/packages/documentation/src/stories/foundation/layout/grid/grid.module.scss b/packages/documentation/src/stories/foundation/layout/grid/grid.module.scss index 524ffb401d..cd9c6968b0 100644 --- a/packages/documentation/src/stories/foundation/layout/grid/grid.module.scss +++ b/packages/documentation/src/stories/foundation/layout/grid/grid.module.scss @@ -1,48 +1,21 @@ @use 'sass:list'; @use 'sass:map'; @use '@swisspost/design-system-styles/core' as post; -@use '../layout.shared' as shared; +@use '../shared.module' as shared; :export { - // Variables to build the grid options table - breakpoint-count: length(post.$grid-breakpoints); + // Variables used in the spec table (some variables used on the page are defined in the shared module) grid-columns: post.$grid-columns; @each $breakpoint, $value in post.$grid-breakpoints { - $i: list.index(post.$grid-breakpoints, $breakpoint $value); - - breakpoint_#{$breakpoint}_name: map.get(shared.$breakpointNames, $breakpoint) or $breakpoint; - breakpoint_#{$breakpoint}_dimensions: if( - $i == 1, - #{'<' + map.get(post.$grid-breakpoints, list.nth(map.keys(post.$grid-breakpoints), $i + 1))}, - #{'≥' + $value} - ); - breakpoint_#{$breakpoint}_infix: if($i == 1, none, $breakpoint); - - container_#{$breakpoint}_max-width: map.get(post.$container-max-widths, $breakpoint) or none; - container_#{$breakpoint}_padding: map.get(post.$grid-container-padding, $breakpoint); - container_#{$breakpoint}_fluid_padding: map.get( - post.$grid-container-fluid-padding, - $breakpoint - ); - grid_#{$breakpoint}_gutter-width: map.get(post.$grid-gutter-x, $breakpoint); } // Variables to expose under sass variables section variables_grid-columns: post.$grid-columns; - variables_grid-gutter-width: post.$grid-gutter-width; variables_grid-row-columns: post.$grid-row-columns; @each $breakpoint, $value in post.$grid-breakpoints { - variables_grid-breakpoints_#{$breakpoint}: $value; - variables_grid-container-max-width_#{$breakpoint}: map.get( - post.$container-max-widths, - $breakpoint - ); - variables_grid-container-padding_#{$breakpoint}: map.get( - post.$grid-container-padding, - $breakpoint - ); + variables_grid-gutter-x_#{$breakpoint}: map.get(post.$grid-gutter-x, $breakpoint); } } diff --git a/packages/documentation/src/stories/foundation/layout/layout.docs.mdx b/packages/documentation/src/stories/foundation/layout/layout.docs.mdx index 3971298eea..d41e0e90e8 100644 --- a/packages/documentation/src/stories/foundation/layout/layout.docs.mdx +++ b/packages/documentation/src/stories/foundation/layout/layout.docs.mdx @@ -8,7 +8,7 @@ import * as LayoutStories from './layout.stories';

TODO:

-Breakpoints, Containers, +Breakpoints, Containers, Grid , Columns, Gutters diff --git a/packages/documentation/src/stories/foundation/layout/layout.shared.scss b/packages/documentation/src/stories/foundation/layout/layout.shared.scss deleted file mode 100644 index 7d29f39964..0000000000 --- a/packages/documentation/src/stories/foundation/layout/layout.shared.scss +++ /dev/null @@ -1,9 +0,0 @@ -$breakpointNames: ( - xs: Extra small, - sm: Small, - rg: Regular, - md: Medium, - lg: Large, - xl: Extra large, - xxl: Extra extra large, -); diff --git a/packages/documentation/src/stories/foundation/layout/shared.blocks.tsx b/packages/documentation/src/stories/foundation/layout/shared.blocks.tsx new file mode 100644 index 0000000000..1225a1e01e --- /dev/null +++ b/packages/documentation/src/stories/foundation/layout/shared.blocks.tsx @@ -0,0 +1,28 @@ +import { parse } from '../../../utils/sass-export'; +import { forEach } from '../../../utils/react'; +import scss from './shared.module.scss'; + +export const SCSS_VARIABLES = parse(scss); + +export const SpecTable = (props: { children: string | JSX.Element | JSX.Element[] }) => ( +
+ + + + + {forEach( + SCSS_VARIABLES.breakpoint, + (data: { key: string; value: { dimensions: string } }) => ( + + ), + )} + + + {props.children} +
+ {data.key} +
+ {data.value.dimensions} +
+
+); diff --git a/packages/documentation/src/stories/foundation/layout/shared.module.scss b/packages/documentation/src/stories/foundation/layout/shared.module.scss new file mode 100644 index 0000000000..2bb151d2fe --- /dev/null +++ b/packages/documentation/src/stories/foundation/layout/shared.module.scss @@ -0,0 +1,29 @@ +@use 'sass:list'; +@use 'sass:map'; +@use '@swisspost/design-system-styles/core' as post; + +$breakpointNames: ( + xs: Extra small, + sm: Small, + rg: Regular, + md: Medium, + lg: Large, + xl: Extra large, + xxl: Extra extra large, +); + +:export { + breakpoint-count: length(post.$grid-breakpoints); + + @each $breakpoint, $value in post.$grid-breakpoints { + $i: list.index(post.$grid-breakpoints, $breakpoint $value); + + breakpoint_#{$breakpoint}_name: map.get($breakpointNames, $breakpoint) or $breakpoint; + breakpoint_#{$breakpoint}_dimensions: if( + $i == 1, + #{'<' + map.get(post.$grid-breakpoints, list.nth(map.keys(post.$grid-breakpoints), $i + 1))}, + #{'≥' + $value} + ); + breakpoint_#{$breakpoint}_infix: if($i == 1, none, $breakpoint); + } +} diff --git a/packages/documentation/src/stories/getting-started/compatibility/compatibility.docs.mdx b/packages/documentation/src/stories/getting-started/compatibility/compatibility.docs.mdx new file mode 100644 index 0000000000..c5b668ac6d --- /dev/null +++ b/packages/documentation/src/stories/getting-started/compatibility/compatibility.docs.mdx @@ -0,0 +1,107 @@ +import { Meta } from '@storybook/blocks'; +import * as GettingStartedStories from './compatibility.stories'; + + + +# Compatibility + +

List of compatible version numbers with external dependencies.

+ +## Intranet-header + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Package @swisspost/design-system-intranet-header
VersionBootstrapAngularNg-Bootstrap
3.x4.x14.x13.x
4.x5.215.x14.x
5.x5.216.x15.x
+
+ +## Styles + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Package @swisspost/design-system-styles
VersionBootstrapAngularNg-Bootstrap
5.x5.014.x13.x
6.25.215.x14.x
6.45.316.x15.x
+
+ +## Common Web Frontend + +
+ + + + + + + + + + + + + + + + + + + +
Package @.../common-web-frontend
VersionBootstrapAngularNg-Bootstrap
4.x4.612.x9.x
+
diff --git a/packages/documentation/src/stories/getting-started/compatibility/compatibility.stories.ts b/packages/documentation/src/stories/getting-started/compatibility/compatibility.stories.ts new file mode 100644 index 0000000000..63e2462935 --- /dev/null +++ b/packages/documentation/src/stories/getting-started/compatibility/compatibility.stories.ts @@ -0,0 +1,15 @@ +import { Meta, StoryObj } from '@storybook/web-components'; +import { BADGE } from '../../../../.storybook/constants'; + +const meta: Meta = { + title: 'Getting Started/Compatibility', + parameters: { + badges: [BADGE.NEEDS_REVISION], + }, +}; + +export default meta; + +type Story = StoryObj; + +export const Default: Story = {}; diff --git a/packages/documentation/src/stories/getting-started/components/components-cdn-all.sample.html b/packages/documentation/src/stories/getting-started/components/components-cdn-all.sample.html new file mode 100644 index 0000000000..daf742e53b --- /dev/null +++ b/packages/documentation/src/stories/getting-started/components/components-cdn-all.sample.html @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/packages/documentation/src/stories/getting-started/components/components-cdn-esm-all.sample.html b/packages/documentation/src/stories/getting-started/components/components-cdn-esm-all.sample.html new file mode 100644 index 0000000000..d28960ddbd --- /dev/null +++ b/packages/documentation/src/stories/getting-started/components/components-cdn-esm-all.sample.html @@ -0,0 +1,11 @@ + + + + + + + + diff --git a/packages/documentation/src/stories/getting-started/components/components-cdn-esm-specific.sample.html b/packages/documentation/src/stories/getting-started/components/components-cdn-esm-specific.sample.html new file mode 100644 index 0000000000..059440986b --- /dev/null +++ b/packages/documentation/src/stories/getting-started/components/components-cdn-esm-specific.sample.html @@ -0,0 +1,11 @@ + + + + + + + + diff --git a/packages/documentation/src/stories/getting-started/components/components-js-all.sample.js b/packages/documentation/src/stories/getting-started/components/components-js-all.sample.js new file mode 100644 index 0000000000..60802372f6 --- /dev/null +++ b/packages/documentation/src/stories/getting-started/components/components-js-all.sample.js @@ -0,0 +1,2 @@ +import { defineCustomElements as definePostComponents } from '@swisspost/design-system-components/loader'; +definePostComponents(); diff --git a/packages/documentation/src/stories/getting-started/components/components-use-specific.sample.js b/packages/documentation/src/stories/getting-started/components/components-js-specific.sample.js similarity index 99% rename from packages/documentation/src/stories/getting-started/components/components-use-specific.sample.js rename to packages/documentation/src/stories/getting-started/components/components-js-specific.sample.js index af0695700d..3a26dfd05b 100644 --- a/packages/documentation/src/stories/getting-started/components/components-use-specific.sample.js +++ b/packages/documentation/src/stories/getting-started/components/components-js-specific.sample.js @@ -1,3 +1,2 @@ import { defineCustomElement as definePostIcon } from '@swisspost/design-system-components/dist/components/post-icon'; - definePostIcon(); diff --git a/packages/documentation/src/stories/getting-started/components/components-use-all.sample.js b/packages/documentation/src/stories/getting-started/components/components-use-all.sample.js deleted file mode 100644 index b2f7ad565e..0000000000 --- a/packages/documentation/src/stories/getting-started/components/components-use-all.sample.js +++ /dev/null @@ -1,3 +0,0 @@ -import { defineCustomElements } from '@swisspost/design-system-components/loader'; - -defineCustomElements(); diff --git a/packages/documentation/src/stories/getting-started/components/components.docs.mdx b/packages/documentation/src/stories/getting-started/components/components.docs.mdx index 0633cb8805..7884c35ccf 100644 --- a/packages/documentation/src/stories/getting-started/components/components.docs.mdx +++ b/packages/documentation/src/stories/getting-started/components/components.docs.mdx @@ -1,7 +1,10 @@ import { Meta, Source } from '@storybook/blocks'; import * as GettingStartedStories from './components.stories'; -import SampleUseAll from './components-use-all.sample?raw'; -import SampleUseSpecific from './components-use-specific.sample?raw'; +import SampleCdnAll from './components-cdn-all.sample.html?raw'; +import SampleCdnEsmAll from './components-cdn-esm-all.sample.html?raw'; +import SampleCdnEsmSpecific from './components-cdn-esm-specific.sample.html?raw'; +import SampleJsAll from './components-js-all.sample?raw'; +import SampleJsSpecific from './components-js-specific.sample?raw'; @@ -10,40 +13,35 @@ import SampleUseSpecific from './components-use-specific.sample?raw'; [![npm version](https://badge.fury.io/js/@swisspost%2Fdesign-system-components.svg)](https://badge.fury.io/js/@swisspost%2Fdesign-system-components) A set of standard web components for easy integration with every framework or no framework at all. +Depending on your project setup, there are different ways available to integrate our components. - +## Components without a framework -## Installation +If you're using a simple HTML page, you can add our components via a script tag. -{/* https://stenciljs.com/docs/custom-elements#consuming-custom-elements */} + + +Alternatively, if you wanted to take advantage of ES Modules, you could include the components using an import statement. + + - +This way, you can also include only specific components... -## Usage + -Import all the available components into your project (for example into your `/src/main.ts` or `/src/index.js` file) and make them work: +## Components with JavaScript bundler - +If you're using a project setup which handels the bundling for you. You can simply import our components to your project. + +### Installation + +{/* https://stenciljs.com/docs/custom-elements#consuming-custom-elements */} -Import specific components: + - +### Usage -Use the imported components in your html: +Import all or only specific components into your entry (e.g. `main.js`, `app.js`, ...) file. -`} - language="html" -/> + + diff --git a/packages/documentation/src/stories/icons/getting-started.docs.mdx b/packages/documentation/src/stories/icons/getting-started.docs.mdx index 4d3412fbb7..d31c7a3e31 100644 --- a/packages/documentation/src/stories/icons/getting-started.docs.mdx +++ b/packages/documentation/src/stories/icons/getting-started.docs.mdx @@ -18,19 +18,13 @@ The comprehensive collection of Swiss Post icons. diff --git a/packages/internet-header/CHANGELOG.md b/packages/internet-header/CHANGELOG.md index e9671fb68e..a3a1274f0a 100644 --- a/packages/internet-header/CHANGELOG.md +++ b/packages/internet-header/CHANGELOG.md @@ -1,5 +1,17 @@ # @swisspost/internet-header +## 1.13.0 + +### Minor Changes + +- Added a link to settings in the user drop-down menu for business users. (by [@alizedebray](https://github.com/alizedebray) with [#2234](https://github.com/swisspost/design-system/pull/2234)) + +### Patch Changes + +- Replaced the old twitter logo with the new X logo. (by [@b1aserlu](https://github.com/b1aserlu) with [#2176](https://github.com/swisspost/design-system/pull/2176)) +- Updated dependencies: + - @swisspost/design-system-styles@6.4.4 + ## 1.12.1 ### Patch Changes diff --git a/packages/internet-header/package.json b/packages/internet-header/package.json index 58f9640bab..a8e0cc6a59 100644 --- a/packages/internet-header/package.json +++ b/packages/internet-header/package.json @@ -1,6 +1,6 @@ { "name": "@swisspost/internet-header", - "version": "1.12.1", + "version": "1.13.0", "description": "The header for client facing applications.", "author": "Swiss Post ", "license": "Apache-2.0", @@ -14,13 +14,11 @@ }, "main": "loader/index.cjs.js", "module": "loader/index.js", - "es2015": "loader/index.es2017.js", "es2017": "loader/index.es2017.js", - "jsnext:main": "loader/index.es2017.js", "types": "loader/index.d.ts", "collection": "dist/collection/collection-manifest.json", "collection:main": "dist/collection/index.js", - "unpkg": "loader/cdn.js", + "unpkg": "dist/swisspost-internet-header/swisspost-internet-header.esm.js", "publishConfig": { "access": "public" }, @@ -45,7 +43,7 @@ "dependencies": { "@stencil/core": "4.7.0", "@stencil/store": "2.0.11", - "@swisspost/design-system-styles": "workspace:6.4.3", + "@swisspost/design-system-styles": "workspace:6.4.4", "body-scroll-lock": "4.0.0-beta.0", "iframe-resizer": "4.3.7", "jquery": "3.7.1", @@ -71,7 +69,7 @@ "cypress-each": "1.13.3", "cypress-storybook": "0.5.1", "eslint-plugin-react": "7.33.2", - "globby": "13.2.2", + "globby": "14.0.0", "jest": "27.5.1", "rimraf": "5.0.5", "rollup-plugin-node-polyfills": "0.2.1", diff --git a/packages/internet-header/src/assets/js/klp-login-widget.js b/packages/internet-header/src/assets/js/klp-login-widget.js index f86caff57e..1417b6e537 100644 --- a/packages/internet-header/src/assets/js/klp-login-widget.js +++ b/packages/internet-header/src/assets/js/klp-login-widget.js @@ -1190,19 +1190,18 @@ const vertx = window.vertx || {}; ''; } - if (sessionData.userType === 'B2C') { - const settingEnvLinks = { - dev01: 'https://serviceint1.post.ch/kvm/app/ui', - dev02: 'https://serviceint1.post.ch/kvm/app/ui', - devs1: 'https://serviceint1.post.ch/kvm/app/ui', - test: 'https://serviceint1.post.ch/kvm/app/ui', - int01: 'https://serviceint1.post.ch/kvm/app/ui', - int02: 'https://serviceint2.post.ch/kvm/app/ui', - prod: 'https://service.post.ch/kvm/app/ui', - }; - const settingsLink = `${settingEnvLinks[environment]}/settings`; + const settingEnvLinks = { + dev01: 'https://serviceint1.post.ch/kvm/app/ui', + dev02: 'https://serviceint1.post.ch/kvm/app/ui', + devs1: 'https://serviceint1.post.ch/kvm/app/ui', + test: 'https://serviceint1.post.ch/kvm/app/ui', + int01: 'https://serviceint1.post.ch/kvm/app/ui', + int02: 'https://serviceint2.post.ch/kvm/app/ui', + prod: 'https://service.post.ch/kvm/app/ui', + }; + const settingsLink = `${settingEnvLinks[environment]}/settings?lang=${currentLang}`; - menuList += ` + menuList += `
  • @@ -1212,7 +1211,6 @@ const vertx = window.vertx || {};
  • `; - } let changeCompanyEntry = ''; if (isOldChangeCompany()) { diff --git a/packages/internet-header/src/index.ts b/packages/internet-header/src/index.ts index 7531c10b86..ba5a36d100 100644 --- a/packages/internet-header/src/index.ts +++ b/packages/internet-header/src/index.ts @@ -1 +1,14 @@ export { Components, JSX } from './components'; + +// Export every single component so it gets included in the dist output +export { PostInternetHeader } from './components/post-internet-header/post-internet-header'; +export { PostInternetBreadcrumbs } from './components/post-internet-breadcrumbs/post-internet-breadcrumbs'; +export { PostInternetFooter } from './components/post-internet-footer/post-internet-footer'; + +export { PostSkiplinks } from './components/post-skiplinks/post-skiplinks'; +export { PostMetaNavigation } from './components/post-meta-navigation/post-meta-navigation'; +export { PostLanguageSwitch } from './components/post-language-switch/post-language-switch'; +export { PostLogo } from './components/post-logo/post-logo'; +export { PostMainNavigation } from './components/post-main-navigation/post-main-navigation'; +export { PostSearch } from './components/post-search/post-search'; +export { PostKlpLoginWidget } from './components/post-klp-login-widget/post-klp-login-widget'; diff --git a/packages/internet-header/stencil.config.ts b/packages/internet-header/stencil.config.ts index 35a5991e77..6b8bb1d64f 100644 --- a/packages/internet-header/stencil.config.ts +++ b/packages/internet-header/stencil.config.ts @@ -26,13 +26,13 @@ export const config: Config = { type: 'dist-custom-elements', customElementsExportBehavior: 'bundle', }, - { - type: 'docs-readme', - }, { type: 'www', serviceWorker: null, // disable service workers, }, + { + type: 'docs-readme', + }, { type: 'docs-json', file: 'dist/docs.json', diff --git a/packages/intranet-header-workspace/CHANGELOG.md b/packages/intranet-header-workspace/CHANGELOG.md index ec34c6bef5..66e4f1d2df 100644 --- a/packages/intranet-header-workspace/CHANGELOG.md +++ b/packages/intranet-header-workspace/CHANGELOG.md @@ -1,5 +1,12 @@ # @swisspost/design-system-intranet-header-workspace +## 3.0.4 + +### Patch Changes + +- Updated dependencies: + - @swisspost/design-system-styles@6.4.4 + ## 3.0.3 ### Patch Changes diff --git a/packages/intranet-header-workspace/package.json b/packages/intranet-header-workspace/package.json index 97546a8677..bdc3f015dd 100644 --- a/packages/intranet-header-workspace/package.json +++ b/packages/intranet-header-workspace/package.json @@ -1,6 +1,6 @@ { "name": "@swisspost/design-system-intranet-header-workspace", - "version": "3.0.3", + "version": "3.0.4", "license": "Apache-2.0", "private": true, "scripts": { @@ -21,7 +21,7 @@ "@angular/router": "16.2.12", "@ng-bootstrap/ng-bootstrap": "15.1.2", "@popperjs/core": "2.11.8", - "@swisspost/design-system-styles": "workspace:6.4.3", + "@swisspost/design-system-styles": "workspace:6.4.4", "rxjs": "7.8.1", "tslib": "2.6.2", "watch": "1.0.2", diff --git a/packages/intranet-header-workspace/projects/intranet-header/CHANGELOG.md b/packages/intranet-header-workspace/projects/intranet-header/CHANGELOG.md index ff9e834458..0538db0cf8 100644 --- a/packages/intranet-header-workspace/projects/intranet-header/CHANGELOG.md +++ b/packages/intranet-header-workspace/projects/intranet-header/CHANGELOG.md @@ -1,5 +1,13 @@ # @swisspost/design-system-intranet-header +## 5.0.4 + +### Patch Changes + +- Added a descriptive text to the Post logo home link. (by [@b1aserlu](https://github.com/b1aserlu) with [#2101](https://github.com/swisspost/design-system/pull/2101)) +- Updated dependencies: + - @swisspost/design-system-styles@6.4.4 + ## 5.0.3 ### Patch Changes diff --git a/packages/intranet-header-workspace/projects/intranet-header/package.json b/packages/intranet-header-workspace/projects/intranet-header/package.json index af9fde90a8..9cce6af275 100644 --- a/packages/intranet-header-workspace/projects/intranet-header/package.json +++ b/packages/intranet-header-workspace/projects/intranet-header/package.json @@ -1,6 +1,6 @@ { "name": "@swisspost/design-system-intranet-header", - "version": "5.0.3", + "version": "5.0.4", "description": "Intranet header for internal Swiss Post applications as an Angular component.", "author": "Swiss Post ", "license": "Apache-2.0", @@ -18,10 +18,10 @@ "linkDirectory": true }, "dependencies": { - "@swisspost/design-system-styles": "workspace:6.4.3", + "@swisspost/design-system-styles": "workspace:6.4.4", "tslib": "2.6.2" }, "devDependencies": { - "@swisspost/design-system-intranet-header-workspace": "workspace:3.0.3" + "@swisspost/design-system-intranet-header-workspace": "workspace:3.0.4" } } diff --git a/packages/styles/CHANGELOG.md b/packages/styles/CHANGELOG.md index c5af7aa38a..f8f4c66708 100644 --- a/packages/styles/CHANGELOG.md +++ b/packages/styles/CHANGELOG.md @@ -1,5 +1,19 @@ # @swisspost/design-system-styles +## 6.4.4 + +### Patch Changes + +- Added official way to use label in a floating-label select as a placeholder. (by [@imagoiq](https://github.com/imagoiq) with [#2200](https://github.com/swisspost/design-system/pull/2200)) + +- Fixed display of button-group input when using checkbox or radio variant. (by [@imagoiq](https://github.com/imagoiq) with [#2133](https://github.com/swisspost/design-system/pull/2133)) + +- Fixed offset of radio button when checked and in inline layout. (by [@imagoiq](https://github.com/imagoiq) with [#2065](https://github.com/swisspost/design-system/pull/2065)) + +- The following placeholders from the `\_text.scss` file are depreacted an will be removed in a future version: `%list-adjustment`, `%module-container`, `%default-module-spacer`, `%text-container`. (by [@b1aserlu](https://github.com/b1aserlu) with [#2171](https://github.com/swisspost/design-system/pull/2171)) + +- Fixed default icon flashing when using a `post-icon` on alerts. (by [@imagoiq](https://github.com/imagoiq) with [#2244](https://github.com/swisspost/design-system/pull/2244)) + ## 6.4.3 ### Patch Changes diff --git a/packages/styles/package.json b/packages/styles/package.json index ac586c8953..fbcf777e5f 100644 --- a/packages/styles/package.json +++ b/packages/styles/package.json @@ -1,6 +1,6 @@ { "name": "@swisspost/design-system-styles", - "version": "6.4.3", + "version": "6.4.4", "description": "Design System Styles for the Swiss Post web platform.", "author": "Swiss Post ", "license": "Apache-2.0", diff --git a/packages/styles/src/components/dropdown.scss b/packages/styles/src/components/dropdown.scss index 716a995845..00b2e53eb9 100644 --- a/packages/styles/src/components/dropdown.scss +++ b/packages/styles/src/components/dropdown.scss @@ -3,7 +3,6 @@ @use './../lic/bootstrap-license'; @use './../themes/bootstrap/dropdown' as bd; -@use './../placeholders/close'; @use './../variables/color'; @use './../variables/commons'; @use './../variables/icons'; diff --git a/packages/styles/src/components/form-check.scss b/packages/styles/src/components/form-check.scss index e5847a78b0..289dfe9093 100644 --- a/packages/styles/src/components/form-check.scss +++ b/packages/styles/src/components/form-check.scss @@ -83,9 +83,10 @@ border-radius: 50%; &:checked::after { - border: spacing.$size-micro solid color.$white; + border: spacing.$size-micro solid transparent; background-color: currentColor; border-radius: inherit; + background-clip: padding-box; } } diff --git a/packages/styles/src/mixins/_button.scss b/packages/styles/src/mixins/_button.scss index ddfdc444ef..45dedb5689 100644 --- a/packages/styles/src/mixins/_button.scss +++ b/packages/styles/src/mixins/_button.scss @@ -4,7 +4,6 @@ @use './../variables/components/button'; @use './../variables/type'; @use './../variables/color' as color-var; -@use './../placeholders/color' as color-ph; @use './../functions/contrast' as contrast-fn; @use 'utilities'; diff --git a/packages/styles/src/mixins/_notification.scss b/packages/styles/src/mixins/_notification.scss index 278b32d2a1..a19c69ffc0 100644 --- a/packages/styles/src/mixins/_notification.scss +++ b/packages/styles/src/mixins/_notification.scss @@ -111,7 +111,12 @@ @include icons-mx.icon($icon); } - // icon override (post-icon) + // Prevent flashing when using post-icon + &:has(> post-icon)::before { + content: none; + } + + // icon override (post-icon), needed when :has is not supported > post-icon { background-color: $color; } diff --git a/packages/styles/src/placeholders/badge.scss b/packages/styles/src/placeholders/_badge.scss similarity index 100% rename from packages/styles/src/placeholders/badge.scss rename to packages/styles/src/placeholders/_badge.scss diff --git a/packages/styles/src/placeholders/_index.scss b/packages/styles/src/placeholders/_index.scss index 8c24290e7f..639bb6ad75 100644 --- a/packages/styles/src/placeholders/_index.scss +++ b/packages/styles/src/placeholders/_index.scss @@ -1,2 +1,6 @@ +@use './badge'; +@use './button'; +@use './close'; +@use './color'; @use './dropdown'; @use './text'; diff --git a/packages/styles/src/variables/_grid.scss b/packages/styles/src/variables/_grid.scss index f7ca5b9e27..3be0a4b33a 100644 --- a/packages/styles/src/variables/_grid.scss +++ b/packages/styles/src/variables/_grid.scss @@ -5,33 +5,11 @@ $grid-breakpoints-list: xs sm rg md lg xl xxl; // Grid containers -// -// Define the maximum width of `.container` for different screen sizes. $container-max-widths: ( xl: 1280px, xxl: 1440px, ) !default; -// Grid columns -// -// Set the number of columns and specify the width of the gutters. - -$grid-columns: 12 !default; - -/* Deprecated: $grid-gutter-width */ -$grid-gutter-width: 30px !default; - -/* Deprecated: "rg" breakpoint */ -$grid-gutter-x: ( - xs: 12px, - sm: 16px, - rg: 16px, - md: 16px, - lg: 16px, - xl: 16px, - xxl: 16px, -) !default; - /* Deprecated: "rg" breakpoint */ $grid-container-padding: ( xs: 12px, @@ -53,3 +31,20 @@ $grid-container-fluid-padding: ( xl: map.get($grid-container-padding, lg), xxl: map.get($grid-container-padding, lg), ) !default; + +// Grid columns +$grid-columns: 12 !default; + +/* Deprecated: $grid-gutter-width */ +$grid-gutter-width: 30px !default; + +/* Deprecated: "rg" breakpoint */ +$grid-gutter-x: ( + xs: 12px, + sm: 16px, + rg: 16px, + md: 16px, + lg: 16px, + xl: 16px, + xxl: 16px, +) !default; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index be18d212ac..891273e364 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -67,7 +67,7 @@ importers: specifier: 4.7.0 version: 4.7.0 '@swisspost/design-system-styles': - specifier: workspace:6.4.3 + specifier: workspace:6.4.4 version: link:../styles/dist ally.js: specifier: 1.4.1 @@ -137,7 +137,7 @@ importers: packages/components-react: dependencies: '@swisspost/design-system-components': - specifier: workspace:1.6.1 + specifier: workspace:1.6.2 version: link:../components devDependencies: '@types/node': @@ -228,10 +228,10 @@ importers: specifier: 20.1.0 version: 20.1.0(@angular/common@16.2.12)(@angular/core@16.2.12)(@angular/platform-browser@16.2.12)(rxjs@7.8.1) '@swisspost/design-system-intranet-header': - specifier: workspace:5.0.3 + specifier: workspace:5.0.4 version: link:../intranet-header-workspace/dist/intranet-header '@swisspost/design-system-styles': - specifier: workspace:6.4.3 + specifier: workspace:6.4.4 version: link:../styles/dist bootstrap: specifier: 5.3.2 @@ -361,19 +361,19 @@ importers: packages/documentation: dependencies: '@swisspost/design-system-components': - specifier: workspace:1.6.1 + specifier: workspace:1.6.2 version: link:../components '@swisspost/design-system-components-react': - specifier: workspace:1.0.21 + specifier: workspace:1.0.22 version: link:../components-react '@swisspost/design-system-icons': specifier: workspace:1.0.14 version: link:../icons '@swisspost/design-system-styles': - specifier: workspace:6.4.3 + specifier: workspace:6.4.4 version: link:../styles/dist '@swisspost/internet-header': - specifier: workspace:1.12.1 + specifier: workspace:1.13.0 version: link:../internet-header bootstrap: specifier: 5.3.2 @@ -536,7 +536,7 @@ importers: specifier: 2.0.11 version: 2.0.11(@stencil/core@4.7.0) '@swisspost/design-system-styles': - specifier: workspace:6.4.3 + specifier: workspace:6.4.4 version: link:../styles/dist body-scroll-lock: specifier: 4.0.0-beta.0 @@ -609,8 +609,8 @@ importers: specifier: 7.33.2 version: 7.33.2(eslint@8.53.0) globby: - specifier: 13.2.2 - version: 13.2.2 + specifier: 14.0.0 + version: 14.0.0 jest: specifier: 27.5.1 version: 27.5.1 @@ -675,7 +675,7 @@ importers: specifier: 2.11.8 version: 2.11.8 '@swisspost/design-system-styles': - specifier: workspace:6.4.3 + specifier: workspace:6.4.4 version: link:../styles/dist rxjs: specifier: 7.8.1 @@ -760,14 +760,14 @@ importers: packages/intranet-header-workspace/projects/intranet-header: dependencies: '@swisspost/design-system-styles': - specifier: workspace:6.4.3 + specifier: workspace:6.4.4 version: link:../../../styles/dist tslib: specifier: 2.6.2 version: 2.6.2 devDependencies: '@swisspost/design-system-intranet-header-workspace': - specifier: workspace:3.0.3 + specifier: workspace:3.0.4 version: link:../.. publishDirectory: ../../dist/intranet-header @@ -6522,6 +6522,11 @@ packages: resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} dev: true + /@sindresorhus/merge-streams@1.0.0: + resolution: {integrity: sha512-rUV5WyJrJLoloD4NDN1V1+LDMDWOa4OTsT4yYJwQNpTU6FWxkxHpL7eu4w+DmiH8x/EAM1otkPE1+LaspIbplw==} + engines: {node: '>=18'} + dev: true + /@sinonjs/commons@1.8.6: resolution: {integrity: sha512-Ky+XkAkqPZSm3NLBeUng77EBQl3cmeJhITaGHdYH8kjVB+aun3S4XBRti2zt17mtt0mIUDiNxYeoJm6drVvBJQ==} dependencies: @@ -12399,6 +12404,17 @@ packages: micromatch: 4.0.5 dev: true + /fast-glob@3.3.2: + resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} + engines: {node: '>=8.6.0'} + dependencies: + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.5 + dev: true + /fast-json-stable-stringify@2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} dev: true @@ -13185,12 +13201,24 @@ packages: engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: dir-glob: 3.0.1 - fast-glob: 3.3.0 + fast-glob: 3.3.1 ignore: 5.2.4 merge2: 1.4.1 slash: 4.0.0 dev: true + /globby@14.0.0: + resolution: {integrity: sha512-/1WM/LNHRAOH9lZta77uGbq0dAEQM+XjNesWwhlERDVenqothRbnzTrL3/LrIoEPPjeUHC3vrS6TwoyxeHs7MQ==} + engines: {node: '>=18'} + dependencies: + '@sindresorhus/merge-streams': 1.0.0 + fast-glob: 3.3.2 + ignore: 5.2.4 + path-type: 5.0.0 + slash: 5.1.0 + unicorn-magic: 0.1.0 + dev: true + /globjoin@0.1.4: resolution: {integrity: sha512-xYfnw62CKG8nLkZBfWbhWwDw02CHty86jfPcc2cr3ZfeuK9ysoVPPEUxf21bAD/rWAgk52SuBrLJlefNy8mvFg==} dev: true @@ -17777,6 +17805,11 @@ packages: engines: {node: '>=8'} dev: true + /path-type@5.0.0: + resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} + engines: {node: '>=12'} + dev: true + /pathe@1.1.1: resolution: {integrity: sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==} dev: true @@ -19418,6 +19451,11 @@ packages: engines: {node: '>=12'} dev: true + /slash@5.1.0: + resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} + engines: {node: '>=14.16'} + dev: true + /slice-ansi@3.0.0: resolution: {integrity: sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==} engines: {node: '>=8'} @@ -20989,6 +21027,11 @@ packages: engines: {node: '>=4'} dev: true + /unicorn-magic@0.1.0: + resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} + engines: {node: '>=18'} + dev: true + /union-value@1.0.1: resolution: {integrity: sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==} engines: {node: '>=0.10.0'}