@marigold/components 0.0.3 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +174 -0
- package/dist/ActionGroup/ActionGroup.d.ts +8 -0
- package/dist/ActionGroup/ActionGroup.stories.d.ts +5 -0
- package/dist/ActionGroup/index.d.ts +1 -0
- package/dist/Alert/Alert.d.ts +22 -1
- package/dist/Alert/Alert.stories.d.ts +5 -0
- package/dist/Badge/Badge.d.ts +5 -0
- package/dist/Badge/Badge.stories.d.ts +5 -0
- package/dist/Box.d.ts +2 -0
- package/dist/Button/Button.d.ts +9 -6
- package/dist/Button/Button.stories.d.ts +5 -0
- package/dist/Card/Card.d.ts +14 -0
- package/dist/Card/Card.stories.d.ts +5 -0
- package/dist/Card/index.d.ts +1 -0
- package/dist/Checkbox/Checkbox.d.ts +15 -3
- package/dist/Checkbox/Checkbox.stories.d.ts +5 -0
- package/dist/Checkbox/CheckboxIcons.d.ts +9 -0
- package/dist/Column/Column.d.ts +3 -1
- package/dist/Column/Column.stories.d.ts +5 -0
- package/dist/Columns/Columns.d.ts +2 -2
- package/dist/Columns/Columns.stories.d.ts +5 -0
- package/dist/Container/Container.stories.d.ts +5 -0
- package/dist/Dialog/Dialog.d.ts +12 -2
- package/dist/Dialog/Dialog.stories.d.ts +5 -0
- package/dist/Dialog/ModalDialog.d.ts +8 -0
- package/dist/Divider/Divider.d.ts +5 -0
- package/dist/Divider/Divider.stories.d.ts +5 -0
- package/dist/Field/Field.d.ts +5 -1
- package/dist/Field/Field.stories.d.ts +5 -0
- package/dist/Image/Image.d.ts +5 -0
- package/dist/Image/Image.stories.d.ts +5 -0
- package/dist/Inline/Inline.d.ts +7 -0
- package/dist/Inline/Inline.stories.d.ts +5 -0
- package/dist/Inline/index.d.ts +1 -0
- package/dist/Input/Input.d.ts +5 -0
- package/dist/Input/Input.stories.d.ts +5 -0
- package/dist/Label/Label.d.ts +14 -2
- package/dist/Label/Label.stories.d.ts +5 -0
- package/dist/Link/Link.d.ts +10 -6
- package/dist/Link/Link.stories.d.ts +5 -0
- package/dist/Menu/Menu.d.ts +3 -0
- package/dist/Menu/Menu.stories.d.ts +5 -0
- package/dist/MenuItem/MenuItem.d.ts +5 -0
- package/dist/MenuItem/MenuItem.stories.d.ts +5 -0
- package/dist/Message/Message.d.ts +5 -0
- package/dist/Message/Message.stories.d.ts +5 -0
- package/dist/Provider/MarigoldProvider.d.ts +11 -0
- package/dist/Provider/index.d.ts +3 -0
- package/dist/Radio/Radio.d.ts +11 -4
- package/dist/Radio/Radio.stories.d.ts +5 -0
- package/dist/Radio/RadioIcon.d.ts +9 -0
- package/dist/Select/ListBox.d.ts +9 -0
- package/dist/Select/ListBoxSection.d.ts +9 -0
- package/dist/Select/Option.d.ts +9 -0
- package/dist/Select/Popover.d.ts +9 -0
- package/dist/Select/Select.d.ts +25 -4
- package/dist/Select/Select.stories.d.ts +5 -0
- package/dist/Slider/Slider.d.ts +5 -0
- package/dist/Slider/Slider.stories.d.ts +5 -0
- package/dist/Stack/Stack.d.ts +1 -3
- package/dist/Stack/Stack.stories.d.ts +5 -0
- package/dist/Text/Text.d.ts +17 -10
- package/dist/Text/Text.stories.d.ts +5 -0
- package/dist/Textarea/Textarea.d.ts +7 -1
- package/dist/Textarea/Textarea.stories.d.ts +5 -0
- package/dist/ValidationMessage/ValidationMessage.d.ts +5 -0
- package/dist/ValidationMessage/ValidationMessage.stories.d.ts +5 -0
- package/dist/VisuallyHidden/VisuallyHidden.d.ts +1 -0
- package/dist/VisuallyHidden/VisuallyHidden.stories.d.ts +5 -0
- package/dist/VisuallyHidden/index.d.ts +1 -0
- package/dist/components.cjs.development.js +1075 -562
- package/dist/components.cjs.development.js.map +1 -1
- package/dist/components.cjs.production.min.js +1 -1
- package/dist/components.cjs.production.min.js.map +1 -1
- package/dist/components.esm.js +1012 -542
- package/dist/components.esm.js.map +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/theme.d.ts +23 -48
- package/package.json +21 -2
- package/src/ActionGroup/ActionGroup.stories.tsx +47 -0
- package/src/ActionGroup/ActionGroup.test.tsx +83 -0
- package/src/ActionGroup/ActionGroup.tsx +32 -0
- package/src/ActionGroup/index.ts +1 -0
- package/src/Alert/Alert.stories.tsx +32 -0
- package/src/Alert/Alert.test.tsx +5 -2
- package/src/Alert/Alert.tsx +27 -34
- package/src/Badge/Badge.stories.tsx +38 -0
- package/src/Badge/Badge.test.tsx +12 -16
- package/src/Badge/Badge.tsx +14 -3
- package/src/Box.ts +2 -0
- package/src/Button/Button.stories.tsx +57 -0
- package/src/Button/Button.test.tsx +76 -13
- package/src/Button/Button.tsx +61 -18
- package/src/Card/Card.stories.tsx +41 -0
- package/src/Card/Card.test.tsx +71 -0
- package/src/Card/Card.tsx +48 -0
- package/src/Card/index.ts +1 -0
- package/src/Checkbox/Checkbox.stories.tsx +78 -0
- package/src/Checkbox/Checkbox.test.tsx +138 -23
- package/src/Checkbox/Checkbox.tsx +81 -52
- package/src/Checkbox/CheckboxIcons.tsx +59 -0
- package/src/Column/Column.stories.tsx +33 -0
- package/src/Column/Column.test.tsx +8 -0
- package/src/Column/Column.tsx +12 -2
- package/src/Columns/Columns.stories.tsx +75 -0
- package/src/Columns/Columns.test.tsx +34 -23
- package/src/Columns/Columns.tsx +30 -30
- package/src/Container/Container.stories.tsx +14 -0
- package/src/Dialog/Dialog.stories.tsx +88 -0
- package/src/Dialog/Dialog.test.tsx +129 -18
- package/src/Dialog/Dialog.tsx +113 -15
- package/src/Dialog/ModalDialog.tsx +76 -0
- package/src/Divider/Divider.stories.tsx +30 -0
- package/src/Divider/Divider.test.tsx +13 -5
- package/src/Divider/Divider.tsx +12 -0
- package/src/Field/Field.stories.tsx +110 -0
- package/src/Field/Field.test.tsx +74 -33
- package/src/Field/Field.tsx +27 -20
- package/src/Image/Image.stories.tsx +34 -0
- package/src/Image/Image.test.tsx +4 -1
- package/src/Image/Image.tsx +13 -1
- package/src/Inline/Inline.stories.tsx +39 -0
- package/src/Inline/Inline.test.tsx +99 -0
- package/src/Inline/Inline.tsx +38 -0
- package/src/Inline/index.ts +1 -0
- package/src/Input/Input.stories.tsx +54 -0
- package/src/Input/Input.test.tsx +7 -3
- package/src/Input/Input.tsx +13 -1
- package/src/Label/Label.stories.tsx +41 -0
- package/src/Label/Label.test.tsx +40 -5
- package/src/Label/Label.tsx +54 -8
- package/src/Link/Link.stories.tsx +35 -0
- package/src/Link/Link.test.tsx +51 -21
- package/src/Link/Link.tsx +39 -13
- package/src/Menu/Menu.stories.tsx +62 -0
- package/src/Menu/Menu.test.tsx +11 -6
- package/src/Menu/Menu.tsx +22 -14
- package/src/MenuItem/MenuItem.stories.tsx +30 -0
- package/src/MenuItem/MenuItem.test.tsx +22 -13
- package/src/MenuItem/MenuItem.tsx +19 -10
- package/src/Message/Message.stories.tsx +30 -0
- package/src/Message/Message.test.tsx +4 -1
- package/src/Message/Message.tsx +18 -14
- package/src/Provider/MarigoldProvider.test.tsx +136 -0
- package/src/Provider/MarigoldProvider.tsx +47 -0
- package/src/Provider/index.ts +4 -0
- package/src/Radio/Radio.stories.tsx +78 -0
- package/src/Radio/Radio.test.tsx +129 -18
- package/src/Radio/Radio.tsx +62 -71
- package/src/Radio/RadioIcon.tsx +49 -0
- package/src/Select/ListBox.tsx +40 -0
- package/src/Select/ListBoxSection.tsx +40 -0
- package/src/Select/Option.tsx +48 -0
- package/src/Select/Popover.tsx +50 -0
- package/src/Select/Select.stories.tsx +81 -0
- package/src/Select/Select.test.tsx +317 -35
- package/src/Select/Select.tsx +162 -18
- package/src/Slider/Slider.stories.tsx +24 -0
- package/src/Slider/Slider.test.tsx +10 -6
- package/src/Slider/Slider.tsx +25 -13
- package/src/Stack/Stack.stories.tsx +57 -0
- package/src/Stack/Stack.test.tsx +93 -65
- package/src/Stack/Stack.tsx +27 -32
- package/src/Text/Text.stories.tsx +61 -0
- package/src/Text/Text.test.tsx +41 -36
- package/src/Text/Text.tsx +56 -31
- package/src/Textarea/Textarea.stories.tsx +64 -0
- package/src/Textarea/Textarea.test.tsx +11 -8
- package/src/Textarea/Textarea.tsx +41 -38
- package/src/ValidationMessage/ValidationMessage.stories.tsx +27 -0
- package/src/ValidationMessage/ValidationMessage.test.tsx +9 -4
- package/src/ValidationMessage/ValidationMessage.tsx +23 -12
- package/src/VisuallyHidden/VisuallyHidden.stories.tsx +19 -0
- package/src/VisuallyHidden/VisuallyHidden.test.tsx +10 -0
- package/src/VisuallyHidden/VisuallyHidden.tsx +1 -0
- package/src/VisuallyHidden/index.ts +1 -0
- package/src/index.ts +7 -2
- package/src/theme.ts +49 -48
- package/dist/Box/Box.d.ts +0 -45
- package/dist/Box/index.d.ts +0 -1
- package/dist/Heading/Heading.d.ts +0 -7
- package/dist/Heading/index.d.ts +0 -1
- package/dist/Hidden/Hidden.d.ts +0 -5
- package/dist/Hidden/index.d.ts +0 -1
- package/src/Alert/Alert.stories.mdx +0 -45
- package/src/Badge/Badge.stories.mdx +0 -43
- package/src/Box/Box.stories.mdx +0 -38
- package/src/Box/Box.test.tsx +0 -133
- package/src/Box/Box.tsx +0 -152
- package/src/Box/index.ts +0 -1
- package/src/Button/Button.stories.mdx +0 -176
- package/src/Checkbox/Checkbox.stories.mdx +0 -119
- package/src/Column/Column.stories.mdx +0 -74
- package/src/Columns/Columns.stories.mdx +0 -247
- package/src/Container/Container.stories.mdx +0 -36
- package/src/Dialog/Dialog.stories.mdx +0 -64
- package/src/Divider/Divider.stories.mdx +0 -43
- package/src/Field/Field.stories.mdx +0 -57
- package/src/Heading/Heading.stories.mdx +0 -91
- package/src/Heading/Heading.test.tsx +0 -77
- package/src/Heading/Heading.tsx +0 -19
- package/src/Heading/index.ts +0 -1
- package/src/Hidden/Hidden.stories.mdx +0 -64
- package/src/Hidden/Hidden.test.tsx +0 -24
- package/src/Hidden/Hidden.tsx +0 -16
- package/src/Hidden/index.ts +0 -1
- package/src/Image/Image.stories.mdx +0 -40
- package/src/Input/Input.stories.mdx +0 -45
- package/src/Label/Label.stories.mdx +0 -34
- package/src/Link/Link.stories.mdx +0 -38
- package/src/Menu/Menu.stories.mdx +0 -49
- package/src/MenuItem/MenuItem.stories.mdx +0 -32
- package/src/Message/Message.stories.mdx +0 -44
- package/src/Radio/Radio.stories.mdx +0 -100
- package/src/Select/Select.stories.mdx +0 -44
- package/src/Slider/Slider.stories.mdx +0 -58
- package/src/Stack/Stack.stories.mdx +0 -105
- package/src/Text/Text.stories.mdx +0 -60
- package/src/Textarea/Textarea.stories.mdx +0 -65
- package/src/ValidationMessage/ValidationMessage.stories.mdx +0 -36
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks';
|
|
2
|
-
import { Button } from '../Button';
|
|
3
|
-
import { Heading } from '../Heading';
|
|
4
|
-
import { Stack } from './Stack';
|
|
5
|
-
import { Text } from '../Text';
|
|
6
|
-
import { Box } from '../Box';
|
|
7
|
-
import { useStyles } from '@marigold/system';
|
|
8
|
-
|
|
9
|
-
<Meta title="Components/Stack" />
|
|
10
|
-
|
|
11
|
-
# Stack
|
|
12
|
-
|
|
13
|
-
## Description
|
|
14
|
-
|
|
15
|
-
Layout component to stack elements. This component uses the spaces from the given theme.
|
|
16
|
-
|
|
17
|
-
## Properties
|
|
18
|
-
|
|
19
|
-
| Property | Type | Default |
|
|
20
|
-
| :------- | :--------------------------------------------- | :------ |
|
|
21
|
-
| `space` | `ResponsiveStyleValue<number `|` string>` | `0` |
|
|
22
|
-
| `align` | `left, right, center` | `left` |
|
|
23
|
-
|
|
24
|
-
## Import
|
|
25
|
-
|
|
26
|
-
```tsx
|
|
27
|
-
import { Stack } from '@marigold/components';
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Usage
|
|
31
|
-
|
|
32
|
-
### Spacing
|
|
33
|
-
|
|
34
|
-
<Canvas>
|
|
35
|
-
<Story name="Example 1">
|
|
36
|
-
<Stack space={4} className={useStyles({ bg: '#f3f3f3' })}>
|
|
37
|
-
<Heading>Header</Heading>
|
|
38
|
-
<Text>
|
|
39
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse
|
|
40
|
-
dignissim dapibus elit, vel egestas felis pharetra non. Cras malesuada,
|
|
41
|
-
massa nec ultricies efficitur, lectus ante consequat magna, a porttitor
|
|
42
|
-
massa ex ut quam.
|
|
43
|
-
</Text>
|
|
44
|
-
<Text>
|
|
45
|
-
Phasellus ipsum tortor, aliquet dapibus fermentum in, mollis vel metus.
|
|
46
|
-
Vestibulum malesuada ante eu velit malesuada, nec ultricies sapien
|
|
47
|
-
finibus. Aenean rutrum in sem a ullamcorper. Integer ut euismod urna.
|
|
48
|
-
Interdum et malesuada fames ac ante ipsum primis in faucibus.
|
|
49
|
-
</Text>
|
|
50
|
-
</Stack>
|
|
51
|
-
</Story>
|
|
52
|
-
</Canvas>
|
|
53
|
-
|
|
54
|
-
### Alignment
|
|
55
|
-
|
|
56
|
-
<Canvas>
|
|
57
|
-
<Story name="Example 2">
|
|
58
|
-
<Stack space={2}>
|
|
59
|
-
<Text
|
|
60
|
-
className={useStyles({ width: '100px', border: '1px solid', p: 2 })}
|
|
61
|
-
>
|
|
62
|
-
Left
|
|
63
|
-
</Text>
|
|
64
|
-
</Stack>
|
|
65
|
-
<Stack space={2} align="center">
|
|
66
|
-
<Text
|
|
67
|
-
className={useStyles({ width: '100px', border: '1px solid', p: 2 })}
|
|
68
|
-
>
|
|
69
|
-
Center
|
|
70
|
-
</Text>
|
|
71
|
-
</Stack>
|
|
72
|
-
<Stack space={2} align="right">
|
|
73
|
-
<Text
|
|
74
|
-
className={useStyles({ width: '100px', border: '1px solid', p: 2 })}
|
|
75
|
-
>
|
|
76
|
-
Right
|
|
77
|
-
</Text>
|
|
78
|
-
</Stack>
|
|
79
|
-
</Story>
|
|
80
|
-
</Canvas>
|
|
81
|
-
|
|
82
|
-
### Nested
|
|
83
|
-
|
|
84
|
-
<Canvas>
|
|
85
|
-
<Story name="Example 3">
|
|
86
|
-
<Stack space={6}>
|
|
87
|
-
<Stack>
|
|
88
|
-
<Heading>Stack Content #1</Heading>
|
|
89
|
-
<Text>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</Text>
|
|
90
|
-
<Text>
|
|
91
|
-
Phasellus ipsum tortor, aliquet dapibus fermentum in, mollis vel
|
|
92
|
-
metus.
|
|
93
|
-
</Text>
|
|
94
|
-
</Stack>
|
|
95
|
-
<Stack>
|
|
96
|
-
<Heading>Stack Content #2</Heading>
|
|
97
|
-
<Text>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</Text>
|
|
98
|
-
<Text>
|
|
99
|
-
Phasellus ipsum tortor, aliquet dapibus fermentum in, mollis vel
|
|
100
|
-
metus.
|
|
101
|
-
</Text>
|
|
102
|
-
</Stack>
|
|
103
|
-
</Stack>
|
|
104
|
-
</Story>
|
|
105
|
-
</Canvas>
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks';
|
|
2
|
-
import { Text } from './Text';
|
|
3
|
-
import { useStyles } from '@marigold/system';
|
|
4
|
-
|
|
5
|
-
<Meta title="Components/Text" />
|
|
6
|
-
|
|
7
|
-
# Text
|
|
8
|
-
|
|
9
|
-
## Description
|
|
10
|
-
|
|
11
|
-
With the Text component you can easily add different body text HTML elements. As a default, a `span` element is rendered.
|
|
12
|
-
By adding the `as` prop you can alternatively render a `p` element.
|
|
13
|
-
|
|
14
|
-
## Properties
|
|
15
|
-
|
|
16
|
-
| Property | Type | Default |
|
|
17
|
-
| :--------------------- | :---------------- | :-------- |
|
|
18
|
-
| `as` (optional) | `span`, `p` | `span` |
|
|
19
|
-
| `variant` (optional) | `body`, `heading` | `body` |
|
|
20
|
-
| `textColor` (optional) | string | `inherit` |
|
|
21
|
-
|
|
22
|
-
## Import
|
|
23
|
-
|
|
24
|
-
```tsx
|
|
25
|
-
import { Text } from '@marigold/components';
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Usage
|
|
29
|
-
|
|
30
|
-
<Canvas>
|
|
31
|
-
<Story name="body">
|
|
32
|
-
<Text className={useStyles({ bg: '#f3f3f3' })}>
|
|
33
|
-
SPAN: Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
|
|
34
|
-
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed
|
|
35
|
-
diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
|
|
36
|
-
Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor
|
|
37
|
-
sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed
|
|
38
|
-
diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
|
|
39
|
-
erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea
|
|
40
|
-
rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum
|
|
41
|
-
dolor sit amet.
|
|
42
|
-
</Text>
|
|
43
|
-
</Story>
|
|
44
|
-
<Story name="heading">
|
|
45
|
-
<Text as="p" variant="heading">
|
|
46
|
-
P: Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
|
|
47
|
-
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed
|
|
48
|
-
diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
|
|
49
|
-
Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor
|
|
50
|
-
sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed
|
|
51
|
-
diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
|
|
52
|
-
erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea
|
|
53
|
-
rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum
|
|
54
|
-
dolor sit amet.
|
|
55
|
-
</Text>
|
|
56
|
-
</Story>
|
|
57
|
-
<Story name="with textColor">
|
|
58
|
-
<Text textColor="hotpink">Hello pinkie ;)</Text>
|
|
59
|
-
</Story>
|
|
60
|
-
</Canvas>
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks';
|
|
2
|
-
import { Textarea } from '../Textarea';
|
|
3
|
-
|
|
4
|
-
<Meta title="Components/Textarea" />
|
|
5
|
-
|
|
6
|
-
# Textarea
|
|
7
|
-
|
|
8
|
-
## Description
|
|
9
|
-
|
|
10
|
-
With the Textarea component you can add a HTML `<textarea>` element for larger text input to your form.
|
|
11
|
-
The element uses always the themeSection with the name: `textarea` in your given theme. The variant in your section can be added with the variant prop. The default variant is `default`.
|
|
12
|
-
If you use the label prop you have to add htmlFor. Optionally you can pass an errorMessage or the required prop.
|
|
13
|
-
|
|
14
|
-
## Properties
|
|
15
|
-
|
|
16
|
-
| Property | Type | Default |
|
|
17
|
-
| :------------------------ | :-------- | :--------- |
|
|
18
|
-
| `variant` (optional) | `string` | `default` |
|
|
19
|
-
| `label` (optional) | `string` | |
|
|
20
|
-
| `htmlFor` (optional) | `string` | `textarea` |
|
|
21
|
-
| `errorMessage` (optional) | `string` | |
|
|
22
|
-
| `required` (optional) | `boolean` | |
|
|
23
|
-
|
|
24
|
-
## Import
|
|
25
|
-
|
|
26
|
-
```tsx
|
|
27
|
-
import { Textarea } from '@marigold/components';
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Usage
|
|
31
|
-
|
|
32
|
-
### basic & disabled
|
|
33
|
-
|
|
34
|
-
<Canvas>
|
|
35
|
-
<Story name="Textarea">
|
|
36
|
-
<Textarea placeholder="Placeholder" />
|
|
37
|
-
</Story>
|
|
38
|
-
<Story name="Textarea disabled">
|
|
39
|
-
<Textarea placeholder="Placeholder disabled" disabled />
|
|
40
|
-
</Story>
|
|
41
|
-
</Canvas>
|
|
42
|
-
|
|
43
|
-
### labeled & required
|
|
44
|
-
|
|
45
|
-
<Canvas>
|
|
46
|
-
<Story name="Textarea label">
|
|
47
|
-
<Textarea label="Labeled" htmlFor="label" />
|
|
48
|
-
</Story>
|
|
49
|
-
<Story name="Textarea required">
|
|
50
|
-
<Textarea label="Required" htmlFor="required" required />
|
|
51
|
-
</Story>
|
|
52
|
-
</Canvas>
|
|
53
|
-
|
|
54
|
-
### with error
|
|
55
|
-
|
|
56
|
-
<Canvas>
|
|
57
|
-
<Story name="Textarea error">
|
|
58
|
-
<Textarea
|
|
59
|
-
label="Required with error"
|
|
60
|
-
htmlFor="error"
|
|
61
|
-
required
|
|
62
|
-
errorMessage="Oh no, we have an error!"
|
|
63
|
-
/>
|
|
64
|
-
</Story>
|
|
65
|
-
</Canvas>
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks';
|
|
2
|
-
import { ValidationMessage } from './ValidationMessage';
|
|
3
|
-
import { Exclamation } from '@marigold/icons';
|
|
4
|
-
|
|
5
|
-
<Meta title="Components/ValidationMessage" />
|
|
6
|
-
|
|
7
|
-
# ValidationMessage
|
|
8
|
-
|
|
9
|
-
## Description
|
|
10
|
-
|
|
11
|
-
Simple colored element to display a validation message as a reaction to an event.
|
|
12
|
-
|
|
13
|
-
## Properties
|
|
14
|
-
|
|
15
|
-
| Property | Type | Default |
|
|
16
|
-
| :------------------- | :------- | :--------- |
|
|
17
|
-
| `variant` (optional) | `string` | `error` |
|
|
18
|
-
|
|
19
|
-
## Import
|
|
20
|
-
|
|
21
|
-
```tsx
|
|
22
|
-
import { ValidationMessage } from '@marigold/components';
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Usage
|
|
26
|
-
|
|
27
|
-
<Canvas>
|
|
28
|
-
<Story name="ValidationMessage">
|
|
29
|
-
<div>
|
|
30
|
-
<ValidationMessage>
|
|
31
|
-
<Exclamation />
|
|
32
|
-
Validation message
|
|
33
|
-
</ValidationMessage>
|
|
34
|
-
</div>
|
|
35
|
-
</Story>
|
|
36
|
-
</Canvas>
|