Skip to content

Commit

Permalink
Merge branch 'main' into 3420-component-form-footer
Browse files Browse the repository at this point in the history
  • Loading branch information
leagrdv authored Oct 9, 2024
2 parents 959ec60 + c9ad537 commit 4214910
Show file tree
Hide file tree
Showing 57 changed files with 1,209 additions and 582 deletions.
6 changes: 6 additions & 0 deletions .changeset/kind-buses-trade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@swisspost/design-system-documentation': minor
'@swisspost/design-system-styles': minor
---

Added styling support and documentation for the `<dialog>` element. The dialog will replace the current modal and notification overlay components coming from ng-bootstrap.
5 changes: 5 additions & 0 deletions .changeset/popular-games-rush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-styles': patch
---

Deprecated the ng-bootstrap components Modal and Notification overlay in favor of the new Dialog component. The styles for these ng-bootstrap components will be removed in a future major version.
16 changes: 15 additions & 1 deletion .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,33 @@
"@swisspost/design-system-tokens": "8.2.0"
},
"changesets": [
"big-frogs-admire",
"breezy-cups-add",
"clean-icons-complain",
"cold-baboons-appear",
"cold-panthers-vanish",
"cuddly-bears-check",
"eleven-keys-work",
"empty-islands-kneel",
"fair-actors-scream",
"friendly-insects-breathe",
"funny-shrimps-care",
"gorgeous-flowers-flow",
"great-humans-talk",
"heavy-rats-explode",
"kind-papayas-provide",
"lemon-clocks-clean",
"nervous-rocks-shop",
"ninety-nails-float",
"pink-weeks-relate",
"plenty-apricots-raise",
"proud-actors-knock",
"red-lies-lick",
"selfish-bats-run",
"sharp-crews-watch"
"sharp-crews-watch",
"six-spiders-smoke",
"tame-terms-push",
"tidy-dolls-walk",
"yellow-yaks-jog"
]
}
8 changes: 8 additions & 0 deletions packages/components-angular/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @swisspost/design-system-components-angular-workspace

## 1.1.10-next.1

### Patch Changes

- Updated dependencies:
- @swisspost/design-system-components@9.0.0-next.1
- @swisspost/design-system-styles@9.0.0-next.1

## 1.1.10-next.0

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/components-angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@swisspost/design-system-components-angular-workspace",
"version": "1.1.10-next.0",
"version": "1.1.10-next.1",
"scripts": {
"start": "ng serve --port 9210",
"build": "ng build components",
Expand All @@ -18,8 +18,8 @@
"@angular/platform-browser": "18.1.3",
"@angular/platform-browser-dynamic": "18.1.3",
"@angular/router": "18.1.3",
"@swisspost/design-system-components": "workspace:9.0.0-next.0",
"@swisspost/design-system-styles": "workspace:9.0.0-next.0",
"@swisspost/design-system-components": "workspace:9.0.0-next.1",
"@swisspost/design-system-styles": "workspace:9.0.0-next.1",
"rxjs": "7.8.1",
"tslib": "2.6.3",
"zone.js": "0.14.8"
Expand Down
7 changes: 7 additions & 0 deletions packages/components-angular/projects/components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @swisspost/design-system-components-angular

## 9.0.0-next.1

### Patch Changes

- Updated dependencies:
- @swisspost/design-system-components@9.0.0-next.1

## 9.0.0-next.0

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/components-angular/projects/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@swisspost/design-system-components-angular",
"version": "9.0.0-next.0",
"version": "9.0.0-next.1",
"description": "Swiss Post Design System - Angular Wrapper Components",
"author": "Swiss Post <[email protected]>",
"license": "Apache-2.0",
Expand All @@ -19,7 +19,7 @@
},
"dependencies": {
"tslib": "2.6.3",
"@swisspost/design-system-components": "workspace:9.0.0-next.0"
"@swisspost/design-system-components": "workspace:9.0.0-next.1"
},
"peerDependencies": {
"@angular/common": "^16.0.0 || ^17.0.0 || ^18.0.0",
Expand Down
7 changes: 7 additions & 0 deletions packages/components-react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @swisspost/design-system-components-react

## 9.0.0-next.1

### Patch Changes

- Updated dependencies:
- @swisspost/design-system-components@9.0.0-next.1

## 9.0.0-next.0

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/components-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@swisspost/design-system-components-react",
"version": "9.0.0-next.0",
"version": "9.0.0-next.1",
"license": "Apache-2.0",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -20,7 +20,7 @@
"lint": "eslint src/**/*.ts"
},
"dependencies": {
"@swisspost/design-system-components": "workspace:9.0.0-next.0"
"@swisspost/design-system-components": "workspace:9.0.0-next.1"
},
"devDependencies": {
"@types/node": "20.14.14",
Expand Down
14 changes: 14 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# @swisspost/design-system-components

## 9.0.0-next.1

### Major Changes

- Made the heading-level property required for the accordion and removed it from the accordion-item docs. (by [@schaertim](https://github.com/schaertim) with [#3383](https://github.com/swisspost/design-system/pull/3383))

### Patch Changes

- Fixed a bug in nested accordions where closing a child item unintentionally closed all parent accordion elements. (by [@schaertim](https://github.com/schaertim) with [#3427](https://github.com/swisspost/design-system/pull/3427))

- Fixed an issue related to conflicting pointer and focus events hiding the tooltip unexpectedly in some situations. The tooltip now behaves as expected in this situation. (by [@alionazherdetska](https://github.com/alionazherdetska) with [#3592](https://github.com/swisspost/design-system/pull/3592))
- Updated dependencies:
- @swisspost/design-system-styles@9.0.0-next.1

## 9.0.0-next.0

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@swisspost/design-system-components",
"version": "9.0.0-next.0",
"version": "9.0.0-next.1",
"description": "A collection of web components built with Stencil JS for the Swiss Post Design System.",
"license": "Apache-2.0",
"main": "dist/index.cjs.js",
Expand Down Expand Up @@ -40,7 +40,7 @@
"dependencies": {
"@floating-ui/dom": "1.6.8",
"@oddbird/popover-polyfill": "0.3.7",
"@swisspost/design-system-styles": "workspace:9.0.0-next.0",
"@swisspost/design-system-styles": "workspace:9.0.0-next.1",
"ally.js": "1.4.1",
"long-press-event": "2.5.0"
},
Expand Down
32 changes: 32 additions & 0 deletions packages/documentation/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
# @swisspost/design-system-documentation

## 6.0.0-next.1

### Major Changes

- Made the heading-level property required for the accordion and removed it from the accordion-item docs. (by [@schaertim](https://github.com/schaertim) with [#3383](https://github.com/swisspost/design-system/pull/3383))

### Minor Changes

- Added a toolbar for switching the theme, channel, and mode of all stories. (by [@alizedebray](https://github.com/alizedebray) with [#3528](https://github.com/swisspost/design-system/pull/3528))

- Added documentation outlining the mission statement of the Design System. (by [@alionazherdetska](https://github.com/alionazherdetska) with [#3568](https://github.com/swisspost/design-system/pull/3568))

- Added Text Highlighted component. (by [@bashirkarimi](https://github.com/bashirkarimi) with [#3586](https://github.com/swisspost/design-system/pull/3586))

- Updated the margin, padding, and gap utility classes to use the pixel values (1, 2, ... , 112) instead of size names (hair, line, ..., bigger-giant). (by [@alizedebray](https://github.com/alizedebray) with [#3557](https://github.com/swisspost/design-system/pull/3557))

- Added documentation for design principles. (by [@alionazherdetska](https://github.com/alionazherdetska) with [#3565](https://github.com/swisspost/design-system/pull/3565))

- Added lead text component for introductory paragraphs. (by [@bashirkarimi](https://github.com/bashirkarimi) with [#3575](https://github.com/swisspost/design-system/pull/3575))

### Patch Changes

- Updated the style of headings (h1-h6). (by [@bashirkarimi](https://github.com/bashirkarimi) with [#3534](https://github.com/swisspost/design-system/pull/3534))

- Fixed typos in the Sass and HTML href paths. (by [@schaertim](https://github.com/schaertim) with [#3466](https://github.com/swisspost/design-system/pull/3466))
- Updated dependencies:
- @swisspost/design-system-components@9.0.0-next.1
- @swisspost/design-system-styles@9.0.0-next.1
- @swisspost/design-system-components-react@9.0.0-next.1
- @swisspost/internet-header@1.14.6-next.1
- @swisspost/design-system-icons@9.0.0-next.1

## 6.0.0-next.0

### Major Changes
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
describe('Dialog', () => {
it('default', () => {
cy.visit('/iframe.html?id=snapshots--dialog');
cy.get('dialog[open]', { timeout: 30000 }).should('be.visible');
cy.percySnapshot('Dialog', { widths: [1440] });
});
});
18 changes: 9 additions & 9 deletions packages/documentation/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@swisspost/design-system-documentation",
"version": "6.0.0-next.0",
"version": "6.0.0-next.1",
"description": "Swiss Post Design System Documentation.",
"author": "Swiss Post <[email protected]>",
"license": "Apache-2.0",
Expand All @@ -25,14 +25,14 @@
"e2e:watch": "cypress open",
"doctor": "storybook doctor",
"snapshots": "percy exec -- cypress run --config-file ./cypress.snapshot.config.js --record --key 0995e768-43ec-42bd-a127-ff944a2ad8c9",
"lint": "eslint **/*.{js,ts,tsx,mdx}"
"lint": "eslint **/*.{ts,tsx,mdx}"
},
"dependencies": {
"@swisspost/design-system-components": "workspace:9.0.0-next.0",
"@swisspost/design-system-components-react": "workspace:9.0.0-next.0",
"@swisspost/design-system-icons": "workspace:9.0.0-next.0",
"@swisspost/design-system-styles": "workspace:9.0.0-next.0",
"@swisspost/internet-header": "workspace:1.14.6-next.0",
"@swisspost/design-system-components": "workspace:9.0.0-next.1",
"@swisspost/design-system-components-react": "workspace:9.0.0-next.1",
"@swisspost/design-system-icons": "workspace:9.0.0-next.1",
"@swisspost/design-system-styles": "workspace:9.0.0-next.1",
"@swisspost/internet-header": "workspace:1.14.6-next.1",
"bootstrap": "5.3.3"
},
"devDependencies": {
Expand All @@ -53,8 +53,8 @@
"@storybook/types": "8.2.7",
"@storybook/web-components": "8.2.7",
"@storybook/web-components-vite": "8.2.7",
"@swisspost/design-system-components-angular": "workspace:9.0.0-next.0",
"@swisspost/design-system-intranet-header": "workspace:9.0.0-next.0",
"@swisspost/design-system-components-angular": "workspace:9.0.0-next.1",
"@swisspost/design-system-intranet-header": "workspace:9.0.0-next.1",
"@types/css-modules": "1.0.5",
"@types/mdx": "2.0.13",
"@types/react": "18.3.3",
Expand Down
1 change: 1 addition & 0 deletions packages/documentation/public/_redirects
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
/v6 https://design-system-version-6.netlify.app
/v7 https://design-system-version-7.netlify.app
/v8 https://design-system-version-8.netlify.app
/v9 https://swisspost-design-system-version-9.netlify.app
31 changes: 29 additions & 2 deletions packages/documentation/public/assets/versions.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,37 @@
[
{
"title": "Version 9",
"version": "9.0.0-next.0",
"version": "9.0.0-next.1",
"description": "Pattern documentation, code snippets and implementation guidelines for the Design System Styles.",
"url": "https://design-system.post.ch",
"dependencies": {
"@angular/core": "^18.0.0",
"@ng-bootstrap/ng-bootstrap": "^17.0.0",
"bootstrap": "~5.3.0",
"@swisspost/design-system-changelog-github": "1.0.2",
"@swisspost/design-system-components": "9.0.0-next.1",
"@swisspost/design-system-components-angular-workspace": "1.1.10-next.1",
"@swisspost/design-system-components-angular": "9.0.0-next.1",
"@swisspost/design-system-components-react": "9.0.0-next.1",
"@swisspost/design-system-documentation": "6.0.0-next.1",
"@swisspost/design-system-icons": "9.0.0-next.1",
"@swisspost/internet-header": "1.14.6-next.1",
"@swisspost/design-system-intranet-header-workspace": "3.0.22-next.1",
"@swisspost/design-system-intranet-header": "9.0.0-next.1",
"@swisspost/design-system-intranet-header-showcase": "1.0.10-next.1",
"@swisspost/design-system-migrations": "9.0.0-next.1",
"@swisspost/design-system-nextjs-integration": "0.1.14-next.1",
"@swisspost/design-system-styles": "9.0.0-next.1",
"@swisspost/design-system-styles-primeng-workspace": "1.0.6-next.1",
"@swisspost/design-system-styles-primeng": "9.0.0-next.1",
"@swisspost/design-system-tokens": "9.0.0-next.1"
}
},
{
"title": "Version 9",
"version": "9.0.0-next.0",
"description": "Pattern documentation, code snippets and implementation guidelines for the Design System Styles.",
"url": "https://swisspost-design-system-version-9.netlify.app",
"dependencies": {
"@angular/core": "^18.0.0",
"@ng-bootstrap/ng-bootstrap": "^17.0.0",
Expand All @@ -13,7 +41,6 @@
"@swisspost/design-system-components-angular-workspace": "1.1.10-next.0",
"@swisspost/design-system-components-angular": "9.0.0-next.0",
"@swisspost/design-system-components-react": "9.0.0-next.0",
"@swisspost/design-system-demo": "8.0.3-next.0",
"@swisspost/design-system-documentation": "6.0.0-next.0",
"@swisspost/design-system-icons": "9.0.0-next.0",
"@swisspost/internet-header": "1.14.6-next.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { Canvas, Controls, Meta, Source } from '@storybook/blocks';
import * as DialogStories from './dialog.stories';
import JSFormData from './samples/js-form-data?raw';
import StylesPackageImport from '@/shared/styles-package-import.mdx';

<Meta of={DialogStories} />

# Dialog

<p className="lead">Communicate crucial information and request user action.</p>

<Canvas sourceState="shown" of={DialogStories.Default} />
<div className="hide-col-default">
<Controls of={DialogStories.Default} />
</div>

<StylesPackageImport components={['dialog']} />

## Examples

### Form dialog
<Canvas sourceState="hidden" of={DialogStories.Form} />

#### Using form data

Register a `submit` event listener on the form. In the event handler, you have access to all the form field values inside the dialog. The dialog box closes when the form gets submitted.

<Source
code={JSFormData}
language="typescript"
/>

### Custom content dialog
The dialog can also contain arbitrary content.
<Canvas sourceState="hidden" of={DialogStories.Custom} />
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import meta, { Default } from './dialog.stories';
import { html } from 'lit';
import { bombArgs } from '@/utils';
import type { Args, StoryContext, StoryObj } from '@storybook/web-components';

const { id, ...metaWithoutId } = meta;

export default {
...metaWithoutId,
title: 'Snapshots',
};

type Story = StoryObj;

export const Dialog: Story = {
render: (_args: Args, context: StoryContext) => {
return html`
<style>
dialog {
position: static;
margin: 0;
transition: none !important;
}
</style>
<div class="d-flex flex-wrap align-items-start gap-regular p-regular">
${bombArgs({
backgroundColor: ['bg-white', 'bg-primary'],
size: context.argTypes.size.options,
icon: ['none', '1034'],
closeButton: [true, false],
content: [
'Content',
'Contentus momentus vero siteos et accusam iretea et justo. Contentus momentus vero siteos et accusam iretea et justo.',
],
open: [true],
}).map((args: Args) => Default.render?.({ ...context.args, ...args }, context))}
</div>
`;
},
};
Loading

0 comments on commit 4214910

Please sign in to comment.