Skip to content

Commit

Permalink
Merge branch 'main' into 2894-fix-tag-stories
Browse files Browse the repository at this point in the history
  • Loading branch information
alizedebray committed Apr 10, 2024
2 parents 1156ba9 + bde5675 commit 44dfc10
Show file tree
Hide file tree
Showing 136 changed files with 1,494 additions and 349 deletions.
5 changes: 4 additions & 1 deletion .changeset/dry-wasps-film.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
'@swisspost/design-system-documentation': patch
---

Restricted the badge to showing counts only and updated the styles accordingly.
Restricted badges to showcase counts exclusively and adjusted the styles accordingly.

Use tags to display states, properties, or other metadata.
Opt for chips when presenting dismissible or selectable information.
2 changes: 1 addition & 1 deletion .changeset/fifty-rabbits-flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'@swisspost/design-system-intranet-header': major
---

Syncing versions of the following packages:
Synchronized the versions of the following packages:

- @swisspost/design-system-styles
- @swisspost/design-system-components
Expand Down
5 changes: 5 additions & 0 deletions .changeset/ninety-moons-cover.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-documentation': patch
---

Added link to figma for all components.
5 changes: 5 additions & 0 deletions .changeset/quiet-mugs-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-migrations': minor
---

Added migrations to turn badges into chips.
5 changes: 5 additions & 0 deletions .changeset/selfish-lions-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-documentation': major
---

Renamed badge into "chip" and improved related examples.
1 change: 1 addition & 0 deletions .changeset/shiny-zoos-accept.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
'@swisspost/design-system-demo': patch
---

Updated Sass color variables:
- Removed variables `$success-green`, `$error-red`, `$warning-orange`, `$success-text`, `$error-text`, `$danger` as well as the Sass map `$contextual-colors`.
Instead use the variables `$success`, `$error`, `$warning` and the Sass map `$signal-colors`.
- Updated the Sass map `$signal-colors` keys and added a new Sass map `$signal-background-colors`.
Expand Down
5 changes: 5 additions & 0 deletions .changeset/sweet-clouds-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-styles': major
---

Renamed the badge into "chip", added a disable state and updated its styles.
1 change: 1 addition & 0 deletions .github/workflows/build-demo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
name: Build Demo App
on:
pull_request:
types: [ opened, synchronize, edited, reopened ]
paths:
- 'packages/intranet-header-workspace/**'
- 'packages/demo/**'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
name: Build Documentation
on:
pull_request:
types: [opened, synchronize, edited, reopened]
paths:
- 'packages/**'

Expand Down
1 change: 1 addition & 0 deletions packages/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@popperjs/core": "2.11.8",
"@swimlane/ngx-datatable": "20.1.0",
"@swisspost/design-system-intranet-header": "workspace:5.0.11",
"@swisspost/design-system-migrations": "workspace:1.0.2",
"@swisspost/design-system-styles": "workspace:6.6.4",
"bootstrap": "5.3.2",
"core-js": "3.36.1",
Expand Down
11 changes: 10 additions & 1 deletion packages/documentation/.storybook/styles/preview.scss
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,20 @@
}

// Style buttons related to the current page next to the tile
.docs-title-nav {
.docs-title,
.docs-title nav {
display:flex;
flex-wrap: wrap;
align-items: center;
gap: post.$size-mini;
}
.docs-title {
margin-bottom: post.$size-mini;

:first-child {
margin-right:auto;
}
}
}

pre {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
describe('Chip', () => {
it('default', () => {
cy.visit('/iframe.html?id=snapshots--chip');
cy.get('.chip', { timeout: 30000 }).should('be.visible');
cy.percySnapshot('Chips', { widths: [1440] });
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { customElement, property } from 'lit/decorators.js';
import { getTitleFromPath } from '../../utils';
import { ModuleExport } from '@storybook/types';

interface DesignParameter {
export interface DesignParameter {
type: 'figma';
url: string;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ import SampleCustomTrigger from './accordion-custom-trigger.sample?raw';

<Meta of={accordionStories} />

# Accordion
<div className="docs-title">
# Accordion

<nav>
<link-design of={JSON.stringify(accordionStories)}></link-design>
</nav>
</div>

<p className="lead">Toggle the visibility of a set of related content in your project.</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ const meta: MetaComponent<HTMLPostAccordionElement & HTMLPostCollapsibleElementE
component: 'post-accordion',
parameters: {
badges: [],
design: {
type: 'figma',
url: 'https://www.figma.com/file/xZ0IW0MJO0vnFicmrHiKaY/Components-Post?type=design&node-id=17964-20698&mode=design&t=3lniLiZhl7q9Gqgn-4',
},
},
args: {
multiple: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import AlertDismissSample from './web-component/alert-dismiss.sample?raw';

<Meta of={AlertStories} />

<div className="d-flex align-items-center justify-content-between">
<div className="docs-title">
# Alert

<div className="docs-title-nav">
<nav>
<link-design of={JSON.stringify(AlertStories)}></link-design>
</div>
</nav>
</div>

<div className="lead">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { html, nothing } from 'lit';
import { unsafeHTML } from 'lit/directives/unsafe-html.js';
import { getAlertClasses } from './getAlertClasses';
import { MetaComponent } from '../../../../../types';
import { getComponentFigmaLink } from '../../../../utils';

const meta: MetaComponent = {
id: '105e67d8-31e9-4d0b-87ff-685aba31fd4c',
Expand All @@ -20,7 +19,7 @@ const meta: MetaComponent = {
},
design: {
type: 'figma',
url: getComponentFigmaLink('17001-2244'),
url: 'https://www.figma.com/file/xZ0IW0MJO0vnFicmrHiKaY/Components-Post?type=design&node-id=17001-2244&mode=design&t=3lniLiZhl7q9Gqgn-4',
},
},
args: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { StoryContext, StoryFn, StoryObj } from '@storybook/web-components';
import { html } from 'lit';
import { getComponentFigmaLink, spreadArgs } from '../../../../utils';
import { spreadArgs } from '../../../../utils';
import { MetaComponent } from '../../../../../types';

const meta: MetaComponent<HTMLPostAlertElement> = {
Expand All @@ -14,7 +14,7 @@ const meta: MetaComponent<HTMLPostAlertElement> = {
badges: [],
design: {
type: 'figma',
url: getComponentFigmaLink('17001-2244'),
url: 'https://www.figma.com/file/xZ0IW0MJO0vnFicmrHiKaY/Components-Post?type=design&node-id=17001-2244&mode=design&t=3lniLiZhl7q9Gqgn-4',
},
},
args: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ import StylesPackageImport from '../../../shared/styles-package-import.mdx';

<Meta of={badgeStories} />

# Badge
<div className="docs-title">
# Badge

<nav>
<link-design of={JSON.stringify(badgeStories)}></link-design>
</nav>
</div>

<div className="lead">
Highlight a numerical characteristic or mark an item with a status.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,21 @@ import { html, nothing } from 'lit';
import { MetaComponent } from '../../../../types';
import backgroundColors from '../../../shared/background-colors.module.scss';
import { coloredBackground } from '../../../shared/decorators/dark-background';
import chipMeta from '../chip/chip.stories';

const meta: MetaComponent = {
id: 'bec68e8b-445e-4760-8bd7-1b9970206d8d',
title: 'Components/Badge',
tags: ['package:HTML'],
render: renderBadge,
decorators: [adaptiveBackground],
parameters: {
badges: [],
design: {
type: 'figma',
url: 'https://www.figma.com/file/xZ0IW0MJO0vnFicmrHiKaY/Components-Post?type=design&node-id=18172-73431&mode=design&t=3lniLiZhl7q9Gqgn-4',
},
},
args: {
showNumber: true,
number: 1,
Expand Down Expand Up @@ -113,11 +121,8 @@ export const LargeNumber: Story = {
};

export const Position: Story = {
render: args => html`
<div class="chip">
Filter
<div class="badge bg-gray">1</div>
</div>
render: (_args, context) => html`
${chipMeta.render?.({ ...chipMeta.args, badge: true }, context)}
<div class="position-relative d-inline">
<post-icon name="2026" class="fs-large"></post-icon>
Expand All @@ -126,7 +131,7 @@ export const Position: Story = {
`,
decorators: [
(story: StoryFn, { args, context }: StoryContext) => html`
<div class="d-flex gap-large">${story(args, context)}</div>
<div class="d-flex gap-large align-items-center">${story(args, context)}</div>
`,
],
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ import StylesPackageImport from '../../../shared/styles-package-import.mdx';

<Meta of={BlockquoteStories} />

# Blockquote
<div className="docs-title">
# Blockquote

<nav>
<link-design of={JSON.stringify(BlockquoteStories)}></link-design>
</nav>
</div>

<div className="lead">
For quoting blocks of content from another source within your document. Wrap `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ const meta: MetaComponent = {
render: renderBlockquote,
parameters: {
badges: [],
design: {
type: 'figma',
url: 'https://www.figma.com/file/xZ0IW0MJO0vnFicmrHiKaY/Components-Post?type=design&node-id=20767-5527&mode=design&t=3lniLiZhl7q9Gqgn-4',
},
},
args: {
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ import StylesPackageImport from '../../../shared/styles-package-import.mdx';

<Meta of={ButtonGroupStories} />

# Button Group
<div className="docs-title">
# Button Group

<nav>
<link-design of={JSON.stringify(ButtonGroupStories)}></link-design>
</nav>
</div>

<div className="lead">
Group a series of buttons together on a single line.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ const meta: MetaComponent = {
render: renderButtonGroup,
parameters: {
badges: [],
design: {
type: 'figma',
url: 'https://www.figma.com/file/xZ0IW0MJO0vnFicmrHiKaY/Components-Post?type=design&node-id=22233-42010&mode=design&t=3lniLiZhl7q9Gqgn-4',
},
},
args: {
size: 'btn-md',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import StylesPackageImport from '../../../shared/styles-package-import.mdx';

<Meta of={ButtonStories} />

<div className="d-flex align-items-center justify-content-between">
<div className="docs-title">
# Button

<div className="docs-title-nav">
<nav>
<link-design of={JSON.stringify(ButtonStories)}></link-design>
</div>
</nav>
</div>

<div className="lead">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { html, unsafeStatic } from 'lit/static-html.js';
import { spread } from '@open-wc/lit-helpers';
import { repeat } from 'lit/directives/repeat.js';
import { MetaComponent } from '../../../../types';
import { getComponentFigmaLink } from '../../../utils';

const meta: MetaComponent = {
id: 'eb78afcb-ce92-4990-94b6-6536d5ec6af4',
Expand All @@ -13,7 +12,7 @@ const meta: MetaComponent = {
badges: [],
design: {
type: 'figma',
url: getComponentFigmaLink('16826-33449'),
url: 'https://www.figma.com/file/xZ0IW0MJO0vnFicmrHiKaY/Components-Post?type=design&node-id=16826-33449&mode=design&t=3lniLiZhl7q9Gqgn-4',
},
},
args: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { Canvas, Controls, Meta, Source } from '@storybook/blocks';
import { Canvas, Controls, Meta } from '@storybook/blocks';
import StylesPackageImport from '../../../../shared/styles-package-import.mdx';
import * as CardButtonStories from './card-button.stories';

<Meta of={CardButtonStories} />

<div className="docs-title">
# Card Button

# Card Button
<nav>
<link-design of={JSON.stringify(CardButtonStories)}></link-design>
</nav>
</div>

<p className="lead">A Card that can be used as a clickable link to other content</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ const meta: MetaComponent = {
tags: ['package:HTML'],
parameters: {
badges: [],
design: {
type: 'figma',
url: 'https://www.figma.com/file/xZ0IW0MJO0vnFicmrHiKaY/Components-Post?type=design&node-id=2452-66025&mode=design&t=jADNra0puVcBoQ9V-0',
},
},
args: {
focus: 'Focus',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ import StylesPackageImport from '../../../../shared/styles-package-import.mdx';

<Meta of={CardStories} />

# Card
<div className="docs-title">
# Card

<nav>
<link-design of={JSON.stringify(CardStories)}></link-design>
</nav>
</div>

<div className="lead">
Cards provide a flexible and extensible content container with multiple variants and options.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ const meta: MetaComponent = {
controls: {
exclude: ['Custom Header', 'Custom Body', 'Custom Footer'],
},
design: {
type: 'figma',
url: 'https://www.figma.com/file/xZ0IW0MJO0vnFicmrHiKaY/Components-Post?type=design&node-id=21462-3684&mode=design&t=3lniLiZhl7q9Gqgn-4',
},
},
args: {
showImage: true,
Expand Down
Loading

0 comments on commit 44dfc10

Please sign in to comment.