Skip to content

Commit

Permalink
Merge branch 'main' into feat/1929-Create_checkbox-_and_radio-Cards_w…
Browse files Browse the repository at this point in the history
…eb_components

# Conflicts:
#	packages/components-angular/projects/consumer-app/src/app/app.component.html
#	packages/components/package.json
#	pnpm-lock.yaml
  • Loading branch information
oliverschuerch committed Mar 19, 2024
2 parents a480f5a + 2e81b03 commit 1f5cdd8
Show file tree
Hide file tree
Showing 83 changed files with 3,526 additions and 2,799 deletions.
5 changes: 5 additions & 0 deletions .changeset/beige-pans-kiss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-styles': patch
---

Adjusted focus styles with new color for button, checkbox, radio, switch, rating elements.
7 changes: 7 additions & 0 deletions .changeset/brave-gifts-talk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@swisspost/design-system-documentation': patch
'@swisspost/design-system-migrations': patch
'@swisspost/design-system-demo': patch
---

Updated instructions to run the automated migrations from the migration package.
6 changes: 6 additions & 0 deletions .changeset/polite-eggs-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@swisspost/design-system-documentation': patch
'@swisspost/design-system-demo': patch
---

Changed references from https://next.design-system.post.ch to https://design-system.post.ch after the migration of Storybook, which is now our main documentation
7 changes: 7 additions & 0 deletions .changeset/seven-toes-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@swisspost/design-system-documentation': minor
'@swisspost/design-system-components': minor
'@swisspost/design-system-styles': minor
---

Added a new `tag` component. This component is available in standard HTML or as webcomponent.
5 changes: 5 additions & 0 deletions .changeset/shiny-books-refuse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-styles': patch
---

Replace all parts that used the old success color with the new success-green color.
5 changes: 5 additions & 0 deletions .changeset/silver-jars-sparkle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-documentation': patch
---

Renamed input range to slider.
5 changes: 5 additions & 0 deletions .changeset/sweet-spies-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/internet-header': patch
---

Fixed an issue with invisible focus rings when not using the Design System Styles along with the Swisspost Internet Header. Focus rings are now displayed as expected.
8 changes: 7 additions & 1 deletion .github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,20 @@ jobs:
- name: Install & build dependencies
run: pnpm bootstrap

- name: Prepare Cypress – Spawn Xvfb server
run: Xvfb :99 &

- name: Prepare Cypress – Share Xvfb server as environment variable
run: export DISPLAY=:99

- name: Cypress info
run: pnpm --filter design-system-documentation exec cypress info

- name: Run tests
run: pnpm e2e:ci

- name: Upload screenshots
uses: actions/[email protected].0
uses: actions/[email protected].1
if: failure()
with:
name: cypress-snapshots
Expand Down
18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,21 @@ The Swiss Post Design System pattern library for a unified and accessible user e

## Documentation

[Current documentation](https://design-system.post.ch/#/home) - Migration guides, `bootstrap` & `ng-bootstrap` documentation

[Next documentation](https://next.design-system.post.ch/?path=/docs/home--docs) - styles, internet header and web components documentation
[Documentation](https://design-system.post.ch) - Technical implementation guidelines

[Figma design files](https://www.figma.com/file/xZ0IW0MJO0vnFicmrHiKaY/Components-Post?type=design&node-id=3209%3A72270&mode=design&t=jhmGcSqeWq2SgQXT-1) - Figma component library

🔒 [Experience Hub](https://www.experience-hub.ch/document/2803) - Pattern usage documentation ([request access](https://www.experience-hub.ch/request-access/))

## Packages

| Name | Description | Version | Changelog URL |
|:-------------------------------------------------------------------------------------------------------------| :------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| [Styles](https://next.design-system.post.ch/?path=/docs/e53e2de8-0bbf-4f70-babc-074c5466f700--docs) | The styling package, including theming for [Bootstrap](https://getbootstrap.com/) and [ng-bootstrap](https://ng-bootstrap.github.io/#/home) components. | [![Styles pacakge version shield for npm](https://img.shields.io/npm/v/%40swisspost%2Fdesign-system-styles?style=flat-square&logo=npm&label=%20&color=%23fc0)](https://www.npmjs.com/package/@swisspost/design-system-styles) | [Styles changelog](/packages/styles/CHANGELOG.md) |
| [Components](https://next.design-system.post.ch/?path=/docs/edfb619b-fda1-4570-bf25-20830303d483--docs) | A set of standard web components for easy integration with every framework or no framework at all. | [![Components package version shield for npm](https://img.shields.io/npm/v/%40swisspost%2Fdesign-system-components?style=flat-square&logo=npm&label=%20&color=%23fc0)](https://www.npmjs.com/package/@swisspost/design-system-components) | [Components changelog](/packages/components/CHANGELOG.md) |
| [Internet Header](https://next.design-system.post.ch/?path=/docs/9b02bcb2-3b6a-4271-b550-675a62ff3890--docs) | The header for client facing applications. | [![Internet Header package version shield for npm](https://img.shields.io/npm/v/%40swisspost%2Finternet-header?style=flat-square&logo=npm&label=%20&color=%23fc0)](https://www.npmjs.com/package/@swisspost/internet-header) | [Interet Header changelog](/packages/internet-header/CHANGELOG.md) |
| [Intranet Header](https://next.design-system.post.ch/?path=/docs/d59a459b-6f14-47c6-9f98-a36a3f79a6e3--docs) | The Angular component for internal usage. | [![Intranet Header package version shield for npm](https://img.shields.io/npm/v/%40swisspost%2Fdesign-system-intranet-header?style=flat-square&logo=npm&label=%20&color=%23fc0)](https://www.npmjs.com/package/@swisspost/design-system-intranet-header) | [Intranet Header changelog](/packages/intranet-header-workspace/CHANGELOG.md) |
| [Icons](https://next.design-system.post.ch/?path=/docs/40ed323b-9c1a-42ab-91ed-15f97f214608--docs) | A collection of Post icons in svg format. | [![Icons package version shield for npm](https://img.shields.io/npm/v/%40swisspost%2Fdesign-system-icons?style=flat-square&logo=npm&label=%20&color=%23fc0)](https://www.npmjs.com/package/@swisspost/design-system-icons) | [Icons changelog](/packages/icons/CHANGELOG.md) |
| Name | Description | Version | Changelog URL |
| :------------------------------------------------------------------------------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| [Styles](https://design-system.post.ch/?path=/docs/e53e2de8-0bbf-4f70-babc-074c5466f700--docs) | The styling package, including theming for [Bootstrap](https://getbootstrap.com/) and [ng-bootstrap](https://ng-bootstrap.github.io/#/home) components. | [![Styles pacakge version shield for npm](https://img.shields.io/npm/v/%40swisspost%2Fdesign-system-styles?style=flat-square&logo=npm&label=%20&color=%23fc0)](https://www.npmjs.com/package/@swisspost/design-system-styles) | [Styles changelog](/packages/styles/CHANGELOG.md) |
| [Components](https://design-system.post.ch/?path=/docs/edfb619b-fda1-4570-bf25-20830303d483--docs) | A set of standard web components for easy integration with every framework or no framework at all. | [![Components package version shield for npm](https://img.shields.io/npm/v/%40swisspost%2Fdesign-system-components?style=flat-square&logo=npm&label=%20&color=%23fc0)](https://www.npmjs.com/package/@swisspost/design-system-components) | [Components changelog](/packages/components/CHANGELOG.md) |
| [Internet Header](https://design-system.post.ch/?path=/docs/9b02bcb2-3b6a-4271-b550-675a62ff3890--docs) | The header for client facing applications. | [![Internet Header package version shield for npm](https://img.shields.io/npm/v/%40swisspost%2Finternet-header?style=flat-square&logo=npm&label=%20&color=%23fc0)](https://www.npmjs.com/package/@swisspost/internet-header) | [Interet Header changelog](/packages/internet-header/CHANGELOG.md) |
| [Intranet Header](https://design-system.post.ch/?path=/docs/d59a459b-6f14-47c6-9f98-a36a3f79a6e3--docs) | The Angular component for internal usage. | [![Intranet Header package version shield for npm](https://img.shields.io/npm/v/%40swisspost%2Fdesign-system-intranet-header?style=flat-square&logo=npm&label=%20&color=%23fc0)](https://www.npmjs.com/package/@swisspost/design-system-intranet-header) | [Intranet Header changelog](/packages/intranet-header-workspace/CHANGELOG.md) |
| [Icons](https://design-system.post.ch/?path=/docs/40ed323b-9c1a-42ab-91ed-15f97f214608--docs) | A collection of Post icons in svg format. | [![Icons package version shield for npm](https://img.shields.io/npm/v/%40swisspost%2Fdesign-system-icons?style=flat-square&logo=npm&label=%20&color=%23fc0)](https://www.npmjs.com/package/@swisspost/design-system-icons) | [Icons changelog](/packages/icons/CHANGELOG.md) |

## Contribute

Expand Down
2 changes: 1 addition & 1 deletion packages/changelog-github/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"dependencies": {
"@changesets/get-github-info": "0.6.0",
"@changesets/types": "6.0.0",
"dotenv": "16.4.1"
"dotenv": "16.4.5"
},
"devDependencies": {
"@changesets/parse": "*",
Expand Down
32 changes: 16 additions & 16 deletions packages/components-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,39 @@
},
"private": true,
"dependencies": {
"@angular/animations": "17.2.4",
"@angular/common": "17.2.4",
"@angular/compiler": "17.2.4",
"@angular/core": "17.2.4",
"@angular/forms": "17.2.4",
"@angular/platform-browser": "17.2.4",
"@angular/platform-browser-dynamic": "17.2.4",
"@angular/router": "17.2.4",
"@angular/animations": "17.3.0",
"@angular/common": "17.3.0",
"@angular/compiler": "17.3.0",
"@angular/core": "17.3.0",
"@angular/forms": "17.3.0",
"@angular/platform-browser": "17.3.0",
"@angular/platform-browser-dynamic": "17.3.0",
"@angular/router": "17.3.0",
"@swisspost/design-system-styles": "workspace:6.6.4",
"@swisspost/design-system-components": "workspace:2.1.0",
"rxjs": "7.8.1",
"tslib": "2.6.2",
"zone.js": "0.14.3"
"zone.js": "0.14.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "17.2.3",
"@angular-devkit/build-angular": "17.3.0",
"@angular-eslint/builder": "17.2.1",
"@angular-eslint/eslint-plugin": "17.2.1",
"@angular-eslint/eslint-plugin-template": "17.2.1",
"@angular-eslint/template-parser": "17.2.1",
"@angular/cli": "17.2.3",
"@angular/compiler-cli": "17.2.4",
"@angular/cli": "17.3.0",
"@angular/compiler-cli": "17.3.0",
"@cypress/schematic": "2.5.1",
"@typescript-eslint/eslint-plugin": "7.2.0",
"@typescript-eslint/parser": "7.2.0",
"cypress": "13.6.4",
"eslint": "8.56.0",
"karma": "6.4.2",
"cypress": "13.7.0",
"eslint": "8.57.0",
"karma": "6.4.3",
"karma-chrome-launcher": "3.2.0",
"karma-coverage": "2.2.1",
"karma-jasmine": "5.1.0",
"karma-jasmine-html-reporter": "2.1.0",
"ng-packagr": "17.2.0",
"ng-packagr": "17.3.0",
"typescript": "5.3.3"
}
}
2 changes: 1 addition & 1 deletion packages/components-angular/projects/components/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A collection of angular-components built with Stencil JS for the Swiss Post Desi

## Documentation

- Technical docs: [Swiss Post Design System](https://next.design-system.post.ch)
- Technical docs: [Swiss Post Design System](https://design-system.post.ch)

## Usage

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,28 @@ <h2>Post Alert</h2>
<post-alert><p>Contentus momentus vero siteos et accusam iretea et justo.</p></post-alert>
</div>

<div class="my-4">
<h2>Post Card-Control</h2>
<post-card-control type="checkbox" label="label"></post-card-control>
</div>

<div class="my-4">
<h2>Post Collapsible</h2>
<post-collapsible>
<p>Contentus momentus vero siteos et accusam iretea et justo.</p>
</post-collapsible>
</div>

<div class="my-4">
<h2>Post Icon</h2>
<post-icon name="1001"></post-icon>
</div>

<div class="my-4">
<h2>Post Rating</h2>
<post-rating></post-rating>
</div>

<div class="my-4">
<h2>Post Popover</h2>
<button class="btn btn-secondary btn-large" data-popover-target="popover-one">
Expand All @@ -51,16 +66,6 @@ <h2>Post Popovercontainer</h2>
<post-popovercontainer></post-popovercontainer>
</div>

<div class="my-4">
<h2>Post Rating</h2>
<post-rating></post-rating>
</div>

<div class="my-4">
<h2>Post Icon</h2>
<post-icon name="1001"></post-icon>
</div>

<div class="my-4">
<h2>Post Tabs</h2>
<post-tabs>
Expand All @@ -81,12 +86,12 @@ <h2>Post Tabs</h2>
</div>

<div class="my-4">
<h2>Post Tooltip</h2>
<button class="btn btn-secondary btn-large" data-tooltip-target="tooltip-one">Button</button>
<post-tooltip id="tooltip-one" placement="top">Hi there 👋</post-tooltip>
<h2>Post Tag</h2>
<post-tag>Tag</post-tag>
</div>

<div class="my-4">
<h2>Post Card-Control</h2>
<post-card-control type="checkbox" label="label"></post-card-control>
<h2>Post Tooltip</h2>
<button class="btn btn-secondary btn-large" data-tooltip-target="tooltip-one">Button</button>
<post-tooltip id="tooltip-one" placement="top">Hi there 👋</post-tooltip>
</div>
8 changes: 4 additions & 4 deletions packages/components-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@
},
"devDependencies": {
"@types/node": "18.19.14",
"@types/react": "18.2.53",
"@types/react-dom": "18.2.18",
"@types/react": "18.2.66",
"@types/react-dom": "18.2.22",
"@typescript-eslint/eslint-plugin": "5.62.0",
"@typescript-eslint/parser": "5.62.0",
"eslint": "8.56.0",
"eslint": "8.57.0",
"eslint-config-standard-with-typescript": "43.0.1",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-n": "16.6.2",
"eslint-plugin-promise": "6.1.1",
"eslint-plugin-react": "7.33.2",
"eslint-plugin-react": "7.34.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"rimraf": "5.0.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/components/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A collection of web components built with Stencil JS for the Swiss Post Design S

## Documentation

- Technical docs: [Swiss Post Design System](https://next.design-system.post.ch)
- Technical docs: [Swiss Post Design System](https://design-system.post.ch)
- Design docs: [Experience Hub](https://www.experience-hub.ch/document/2803)

## Installation
Expand Down
70 changes: 70 additions & 0 deletions packages/components/cypress/e2e/tag.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
const TAG_ID = '516917c9-ad12-484c-8bbd-e270e412f713';

describe('Tag', () => {
describe('Structure & Props', () => {
beforeEach(() => {
cy.getComponent('tag', TAG_ID);
cy.get('@tag').find('.tag').as('wrapper');
cy.get('@wrapper').find('.tag-text').as('text');
});

it('should render', () => {
cy.get('@tag').should('exist');
});

it('should use variant `gray` as default', () => {
const defaultClasses = ['tag', 'tag-gray'];

cy.get('@tag').should('not.have.attr', 'variant');
cy.get('@wrapper').should('satisfy', $el => {
const classList = Array.from($el[0].classList);
return defaultClasses.every(c => classList.includes(c));
});
});

it('should set the tags bg-color according to the prop `variant`', () => {
['gray', 'white', 'info', 'success', 'danger', 'warning', 'yellow'].forEach(bg => {
cy.get('@tag').invoke('attr', 'variant', bg).should('have.attr', 'variant', bg);
cy.get('@wrapper').should('have.class', `tag-${bg}`);
});
});

it('should set the tags size according to the prop `size`', () => {
cy.get('@tag').should('not.have.attr', 'size');
cy.get('@tag').invoke('attr', 'size', 'sm');
cy.get('@wrapper').should('have.class', 'tag-sm');
});

it('should set the tags icon according to the prop `icon`', () => {
cy.get('@tag').should('not.have.attr', 'icon');
cy.get('@tag').find('post-icon').should('not.exist');
cy.get('@tag').invoke('attr', 'icon', '1000');
cy.get('@tag').find('post-icon').as('icon');
cy.get('@icon').should('exist');
});

it('should use `default` slot for content', () => {
cy.get('@tag')
.invoke('append', '<img src="/favicon.svg" alt="favicon"/>')
.find('img[src="/favicon.svg"]')
.then($img => {
cy.get('@wrapper')
.find('slot')
.then($slot => {
const img = $img.get(0);
const slot = $slot.get(0);

expect(img.assignedSlot).to.equal(slot);
expect(slot.assignedElements()[0]).to.equal(img);
});
});
});
});

describe('Accessibility', () => {
it('Has no detectable a11y violations on load for all variants', () => {
cy.getSnapshots('post-tag');
cy.checkA11y('#root-inner');
});
});
});
18 changes: 9 additions & 9 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,33 +38,33 @@
"lint": "eslint src/**/*{.ts,.tsx}"
},
"dependencies": {
"@floating-ui/dom": "1.6.1",
"@floating-ui/dom": "1.6.3",
"@oddbird/popover-polyfill": "0.3.7",
"@swisspost/design-system-styles": "workspace:6.6.4",
"ally.js": "1.4.1",
"long-press-event": "2.4.6"
},
"devDependencies": {
"@percy/cli": "1.27.7",
"@percy/cli": "1.28.1",
"@percy/cypress": "3.1.2",
"@stencil-community/eslint-plugin": "0.7.1",
"@stencil-community/eslint-plugin": "0.7.2",
"@stencil/angular-output-target": "0.8.4",
"@stencil/core": "4.12.0",
"@stencil/core": "4.12.6",
"@stencil/react-output-target": "0.5.3",
"@stencil/sass": "3.0.9",
"@stencil/sass": "3.0.10",
"@types/jest": "29.5.12",
"@types/node": "20.11.16",
"@typescript-eslint/eslint-plugin": "5.62.0",
"@typescript-eslint/parser": "5.62.0",
"bootstrap": "5.3.2",
"cypress": "13.6.4",
"cypress": "13.7.0",
"cypress-axe": "1.5.0",
"cypress-storybook": "0.5.1",
"eslint": "8.56.0",
"eslint-plugin-react": "7.33.2",
"eslint": "8.57.0",
"eslint-plugin-react": "7.34.0",
"rimraf": "5.0.5",
"rollup-plugin-postcss": "4.0.2",
"sass": "1.70.0",
"sass": "1.72.0",
"ts-jest": "29.1.2",
"typescript": "4.9.5"
},
Expand Down
Loading

0 comments on commit 1f5cdd8

Please sign in to comment.