-
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.
feat: lead text add styles for the lead text component (#3575)
Co-authored-by: karimim <[email protected]> Co-authored-by: Philipp Gfeller <[email protected]>
- Loading branch information
1 parent
05ea352
commit 65b8550
Showing
6 changed files
with
67 additions
and
7 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 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> | ||
`, | ||
}; |
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