-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9c60123
commit 2409a2f
Showing
3 changed files
with
86 additions
and
10 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,77 @@ | ||
import { Meta, Canvas, ArgTypes } from '@storybook/blocks'; | ||
|
||
import * as Stories from './Badge.stories'; | ||
|
||
import { DocsHeader } from '../../storybook/DocsHeader'; | ||
|
||
<Meta title="Components / Badge" /> | ||
|
||
<DocsHeader | ||
componentName="Badge" | ||
figmaLink="https://www.figma.com/design/4FFYTLWJ2hQpj36JplQQUw/UW-Web-UI?node-id=904-9379" | ||
stories={Stories} | ||
/> | ||
|
||
<Canvas of={Stories.Workshop} sourceState="none" /> | ||
|
||
- [Variants](#variants) | ||
- [Color schemes](#color-schemes) | ||
- [Size](#size) | ||
- [Bottom radius](#bottom-radius) | ||
- [API](#api) | ||
|
||
## Variants | ||
|
||
The variant prop controls the visual appearance of the Badge. | ||
|
||
<Canvas of={Stories.Variants} /> | ||
|
||
```tsx | ||
<Badge variant="soft">Badge</Badge> | ||
<Badge variant="strong">Badge</Badge> | ||
<Badge variant="outline">Badge</Badge> | ||
``` | ||
|
||
## Color schemes | ||
|
||
The `colorScheme` prop will change the Badge colours. | ||
|
||
<Canvas of={Stories.ColorSchemes} /> | ||
|
||
## Size | ||
|
||
The small size is a more compact Badge. | ||
|
||
```tsx | ||
<Badge size="small">Small badge</Badge> | ||
<Badge size="medium">Medium badge</Badge> | ||
``` | ||
|
||
This prop is responsive, so you can set the value according to breakpoint values. | ||
|
||
```tsx | ||
<Badge size={{ mobile: 'small', desktop: 'medium' }}>Responsive badge size</Badge> | ||
``` | ||
|
||
<Canvas of={Stories.ResponsiveSize} /> | ||
|
||
## Bottom radius | ||
|
||
The `bottomRadiusZero` will remove the `border-bottom-right-radius` and `border-bottom-left-radius`, for use when the badge is positioned on top of another element. | ||
|
||
```tsx | ||
<Badge bottomRadiusZero>Multi SIM offer</Badge> | ||
``` | ||
|
||
<Canvas of={Stories.BottomRadiusZero} /> | ||
|
||
## API | ||
|
||
This component is based on the `a` element. | ||
|
||
| Prop | Type | Description | Default | | ||
| ------------------ | -------------------------------------------- | ------------------------------------------------------------------------------------ | -------- | | ||
| `variant` | `soft` \| `strong` \| `outline` | Sets the badges's visual variant. | `soft` | | ||
| `colorScheme` | `cyan` \|`green` \| `red` \|`gold` \| `grey` | Sets the colour scheme. | `cyan` | | ||
| `size` | `small` \|`medium` | Sets the size. | `medium` | | ||
| `bottomRadiusZero` | `boolean` | Removes the bottom radius, set when the Badge sits directly above another container. | `false` | |
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