-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 3420-component-form-footer
- Loading branch information
Showing
12 changed files
with
324 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 Text Highlighted component. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 lead text component for introductory paragraphs. |
20 changes: 20 additions & 0 deletions
20
packages/documentation/src/stories/components/lead/lead.docs.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Meta, Canvas } from '@storybook/blocks'; | ||
import * as LeadStories from './lead.stories'; | ||
import StylesPackageImport from '@/shared/styles-package-import.mdx'; | ||
|
||
<Meta of={LeadStories} /> | ||
|
||
<div className="docs-title"> | ||
# Lead | ||
<nav> | ||
<link-design of={JSON.stringify(LeadStories)}></link-design> | ||
</nav> | ||
</div> | ||
|
||
<div> | ||
A lead provides the reader with a summary of the most important information about the subsequent | ||
paragraph or content. A paragraph is a group of sentences which belong to the same context. | ||
</div> | ||
|
||
<Canvas of={LeadStories.Default} sourceState="shown" /> | ||
<StylesPackageImport components={['lead']} /> |
29 changes: 29 additions & 0 deletions
29
packages/documentation/src/stories/components/lead/lead.stories.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import type { StoryObj } from '@storybook/web-components'; | ||
import { html } from 'lit'; | ||
import { MetaExtended } from '@root/types'; | ||
|
||
const meta: MetaExtended = { | ||
id: 'b2b49569-42b8-40bb-93b3-a874415f625d', | ||
title: 'Components/Lead text', | ||
parameters: { | ||
badges: [], | ||
design: { | ||
type: 'figma', | ||
url: 'https://www.figma.com/design/JIT5AdGYqv6bDRpfBPV8XR/Foundations-%26-Components-Next-Level?node-id=178-6713&node-type=frame&t=X3tyO53unPAPaH3B-0', | ||
}, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj; | ||
|
||
export const Default: Story = { | ||
render: () => html` | ||
<p class="lead"> | ||
Lead text nullam quis risus eget urna mollis ornare veleu leo. Cum sociis natoque penatibus et | ||
magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies | ||
vehicula. | ||
</p> | ||
`, | ||
}; |
20 changes: 20 additions & 0 deletions
20
...documentation/src/stories/components/text-highlighted/text-highlighted.docs.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Meta, Canvas } from '@storybook/blocks'; | ||
import * as TextHighlighedtStories from './text-highlighted.stories'; | ||
import StylesPackageImport from '@/shared/styles-package-import.mdx'; | ||
|
||
<Meta of={TextHighlighedtStories} /> | ||
|
||
<div className="docs-title"> | ||
# Text Highlighted | ||
<nav> | ||
<link-design of={JSON.stringify(TextHighlighedtStories)}></link-design> | ||
</nav> | ||
</div> | ||
|
||
<div> | ||
The Text Highlighted can be used when a certain paragraph needs a higher attention than the other | ||
paragraphs. | ||
</div> | ||
|
||
<Canvas of={TextHighlighedtStories.Default} sourceState="shown" /> | ||
<StylesPackageImport components={['text-highlighted']} /> |
31 changes: 31 additions & 0 deletions
31
packages/documentation/src/stories/components/text-highlighted/text-highlighted.stories.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import type { StoryObj } from '@storybook/web-components'; | ||
import { html } from 'lit'; | ||
import { MetaComponent } from '@root/types'; | ||
|
||
const meta: MetaComponent = { | ||
id: '88318ccf-be8d-4bdf-b8dc-06b0b78e5e3d', | ||
title: 'Components/Text Highlighted', | ||
tags: ['package:WebComponents'], | ||
component: 'post-text-highlighted', | ||
parameters: { | ||
badges: [], | ||
design: { | ||
type: 'figma', | ||
url: 'https://www.figma.com/design/JIT5AdGYqv6bDRpfBPV8XR/Foundations-%26-Components-Next-Level?node-id=1481-12917', | ||
}, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj; | ||
|
||
export const Default: Story = { | ||
render: () => html` | ||
<p class="text-highlighted"> | ||
Lead text nullam quis risus eget urna mollis ornare veleu leo. Cum sociis natoque penatibus et | ||
magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies | ||
vehicula. | ||
</p> | ||
`, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@use 'sass:map'; | ||
@use '../functions/tokens'; | ||
@use '../tokens/components'; | ||
|
||
tokens.$default-map: components.$post-lead; | ||
|
||
.lead { | ||
font-size: tokens.get('post-lead', 'font-size'); | ||
font-weight: tokens.get('post-lead', 'font-weight'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
@use 'sass:map'; | ||
@use '../functions/tokens'; | ||
@use '../tokens/components'; | ||
|
||
tokens.$default-map: components.$post-text-highlighted; | ||
|
||
.text-highlighted { | ||
background-color: tokens.get('post-text', 'highlighted-bg'); | ||
color: tokens.get('post-text', 'highlighted-fg'); | ||
padding: tokens.get('post-text', 'highlighted-padding-text'); | ||
margin-block-start: tokens.get('post-text', 'highlighted-height-space-bottom'); | ||
margin-block-end: tokens.get('post-text', 'highlighted-height-space-bottom'); | ||
border-radius: tokens.get('post-text', 'highlighted-border-radius'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.