@marigold/components 0.0.2 → 0.3.0
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 +294 -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 +16 -3
- package/dist/Alert/Alert.stories.d.ts +5 -0
- package/dist/Badge/Badge.d.ts +11 -5
- package/dist/Badge/Badge.stories.d.ts +5 -0
- package/dist/Box.d.ts +2 -0
- package/dist/Button/Button.d.ts +9 -5
- 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 +17 -5
- package/dist/Checkbox/Checkbox.stories.d.ts +5 -0
- package/dist/Checkbox/CheckboxIcons.d.ts +9 -0
- package/dist/Column/Column.d.ts +6 -4
- package/dist/Column/Column.stories.d.ts +5 -0
- package/dist/Columns/Columns.d.ts +10 -0
- package/dist/Columns/Columns.stories.d.ts +5 -0
- package/dist/Columns/index.d.ts +1 -0
- package/dist/Container/Container.d.ts +5 -4
- package/dist/Container/Container.stories.d.ts +5 -0
- package/dist/Dialog/Dialog.d.ts +17 -0
- package/dist/Dialog/Dialog.stories.d.ts +5 -0
- package/dist/Dialog/ModalDialog.d.ts +8 -0
- package/dist/Dialog/index.d.ts +1 -0
- package/dist/Divider/Divider.d.ts +10 -3
- package/dist/Divider/Divider.stories.d.ts +5 -0
- package/dist/Field/Field.d.ts +10 -5
- package/dist/Field/Field.stories.d.ts +5 -0
- package/dist/Image/Image.d.ts +11 -5
- 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 +10 -4
- package/dist/Input/Input.stories.d.ts +5 -0
- package/dist/Label/Label.d.ts +18 -5
- package/dist/Label/Label.stories.d.ts +5 -0
- package/dist/Link/Link.d.ts +10 -5
- package/dist/Link/Link.stories.d.ts +5 -0
- package/dist/Menu/Menu.d.ts +11 -4
- package/dist/Menu/Menu.stories.d.ts +5 -0
- package/dist/MenuItem/MenuItem.d.ts +11 -4
- package/dist/MenuItem/MenuItem.stories.d.ts +5 -0
- package/dist/Message/Message.d.ts +10 -4
- 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 +17 -4
- package/dist/Radio/RadioIcons.d.ts +10 -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 +27 -3
- package/dist/Select/Select.stories.d.ts +5 -0
- package/dist/Slider/Slider.d.ts +10 -4
- package/dist/Slider/Slider.stories.d.ts +5 -0
- package/dist/Stack/Stack.d.ts +7 -0
- package/dist/Stack/Stack.stories.d.ts +5 -0
- package/dist/Stack/index.d.ts +1 -0
- package/dist/Text/Text.d.ts +17 -7
- package/dist/Text/Text.stories.d.ts +5 -0
- package/dist/Textarea/Textarea.d.ts +15 -4
- package/dist/Textarea/Textarea.stories.d.ts +5 -0
- package/dist/ValidationMessage/ValidationMessage.d.ts +10 -4
- 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 +1276 -461
- 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 +1229 -461
- package/dist/components.esm.js.map +1 -1
- package/dist/index.d.ts +10 -3
- package/dist/theme.d.ts +23 -28
- package/package.json +27 -4
- 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 +34 -23
- package/src/Alert/Alert.tsx +48 -24
- package/src/Badge/Badge.stories.tsx +38 -0
- package/src/Badge/Badge.test.tsx +14 -40
- package/src/Badge/Badge.tsx +31 -28
- 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 +58 -23
- 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.mdx +90 -112
- package/src/Checkbox/Checkbox.stories.tsx +78 -0
- package/src/Checkbox/Checkbox.test.tsx +139 -24
- package/src/Checkbox/Checkbox.tsx +95 -58
- package/src/Checkbox/CheckboxIcons.tsx +59 -0
- package/src/Column/Column.stories.tsx +33 -0
- package/src/Column/Column.test.tsx +15 -59
- package/src/Column/Column.tsx +21 -19
- package/src/Columns/Columns.stories.tsx +75 -0
- package/src/Columns/Columns.test.tsx +113 -0
- package/src/Columns/Columns.tsx +69 -0
- package/src/Columns/index.ts +1 -0
- package/src/Container/Container.stories.tsx +14 -0
- package/src/Container/Container.test.tsx +8 -49
- package/src/Container/Container.tsx +8 -19
- package/src/Dialog/Dialog.stories.tsx +88 -0
- package/src/Dialog/Dialog.test.tsx +158 -0
- package/src/Dialog/Dialog.tsx +130 -0
- package/src/Dialog/ModalDialog.tsx +76 -0
- package/src/Dialog/index.ts +1 -0
- package/src/Divider/Divider.stories.tsx +30 -0
- package/src/Divider/Divider.test.tsx +14 -6
- package/src/Divider/Divider.tsx +20 -13
- package/src/Field/Field.stories.tsx +110 -0
- package/src/Field/Field.test.tsx +75 -34
- package/src/Field/Field.tsx +50 -43
- package/src/Image/Image.stories.tsx +34 -0
- package/src/Image/Image.test.tsx +6 -3
- package/src/Image/Image.tsx +21 -15
- 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 +9 -5
- package/src/Input/Input.tsx +21 -16
- package/src/Label/Label.stories.tsx +41 -0
- package/src/Label/Label.test.tsx +41 -6
- package/src/Label/Label.tsx +59 -18
- package/src/Link/Link.stories.tsx +35 -0
- package/src/Link/Link.test.tsx +52 -22
- package/src/Link/Link.tsx +40 -20
- package/src/Menu/Menu.stories.tsx +62 -0
- package/src/Menu/Menu.test.tsx +13 -7
- package/src/Menu/Menu.tsx +44 -38
- package/src/MenuItem/MenuItem.stories.tsx +30 -0
- package/src/MenuItem/MenuItem.test.tsx +23 -14
- package/src/MenuItem/MenuItem.tsx +29 -18
- package/src/Message/Message.stories.tsx +30 -0
- package/src/Message/Message.test.tsx +5 -2
- package/src/Message/Message.tsx +48 -40
- 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.mdx +91 -94
- package/src/Radio/Radio.test.tsx +92 -16
- package/src/Radio/Radio.tsx +114 -50
- package/src/Radio/RadioIcons.tsx +39 -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 +311 -43
- package/src/Select/Select.tsx +174 -28
- package/src/Slider/Slider.stories.tsx +24 -0
- package/src/Slider/Slider.test.tsx +11 -7
- package/src/Slider/Slider.tsx +30 -15
- package/src/Stack/Stack.stories.tsx +57 -0
- package/src/Stack/Stack.test.tsx +138 -0
- package/src/Stack/Stack.tsx +39 -0
- package/src/Stack/index.ts +1 -0
- package/src/Text/Text.stories.tsx +61 -0
- package/src/Text/Text.test.tsx +41 -36
- package/src/Text/Text.tsx +55 -29
- package/src/Textarea/Textarea.stories.tsx +64 -0
- package/src/Textarea/Textarea.test.tsx +41 -5
- package/src/Textarea/Textarea.tsx +57 -17
- package/src/ValidationMessage/ValidationMessage.stories.tsx +27 -0
- package/src/ValidationMessage/ValidationMessage.test.tsx +19 -14
- package/src/ValidationMessage/ValidationMessage.tsx +36 -21
- 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 +11 -3
- package/src/theme.ts +49 -28
- package/dist/Heading/Heading.d.ts +0 -5
- package/dist/Heading/index.d.ts +0 -1
- package/dist/Hidden/Hidden.d.ts +0 -6
- package/dist/Hidden/index.d.ts +0 -1
- package/dist/Svg/Svg.d.ts +0 -6
- package/dist/Svg/index.d.ts +0 -1
- package/src/Alert/Alert.stories.mdx +0 -49
- package/src/Badge/Badge.stories.mdx +0 -41
- package/src/Button/Button.stories.mdx +0 -155
- package/src/Column/Column.stories.mdx +0 -76
- package/src/Container/Container.stories.mdx +0 -42
- package/src/Divider/Divider.stories.mdx +0 -42
- package/src/Field/Field.stories.mdx +0 -57
- package/src/Heading/Heading.stories.mdx +0 -79
- package/src/Heading/Heading.test.tsx +0 -63
- package/src/Heading/Heading.tsx +0 -22
- package/src/Heading/index.ts +0 -1
- package/src/Hidden/Hidden.stories.mdx +0 -64
- package/src/Hidden/Hidden.test.tsx +0 -87
- package/src/Hidden/Hidden.tsx +0 -25
- package/src/Hidden/index.ts +0 -1
- package/src/Image/Image.stories.mdx +0 -40
- package/src/Input/Input.stories.mdx +0 -44
- package/src/Label/Label.stories.mdx +0 -34
- package/src/Link/Link.stories.mdx +0 -37
- package/src/Menu/Menu.stories.mdx +0 -47
- package/src/MenuItem/MenuItem.stories.mdx +0 -32
- package/src/Message/Message.stories.mdx +0 -43
- package/src/Select/Select.stories.mdx +0 -43
- package/src/Slider/Slider.stories.mdx +0 -57
- package/src/Svg/Svg.stories.mdx +0 -47
- package/src/Svg/Svg.test.tsx +0 -76
- package/src/Svg/Svg.tsx +0 -31
- package/src/Svg/index.ts +0 -1
- package/src/Text/Text.stories.mdx +0 -60
- package/src/Textarea/Textarea.stories.mdx +0 -34
- package/src/ValidationMessage/ValidationMessage.stories.mdx +0 -36
package/src/Svg/Svg.stories.mdx
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, Preview } from '@storybook/addon-docs/blocks';
|
|
2
|
-
import { Feedback } from '@marigold/icons';
|
|
3
|
-
import { Svg } from './Svg';
|
|
4
|
-
|
|
5
|
-
<Meta title="Components/Iconography/Svg" />
|
|
6
|
-
|
|
7
|
-
# SVG-Component
|
|
8
|
-
|
|
9
|
-
## Description
|
|
10
|
-
|
|
11
|
-
With the SVG component you can render a `svg` element.
|
|
12
|
-
By adding the `size` prop you can change to another size. `24` is the default size.
|
|
13
|
-
The `fill` prop is the second attribute and per default `currentcolor`.
|
|
14
|
-
|
|
15
|
-
## Properties
|
|
16
|
-
|
|
17
|
-
| Property | Type | Default |
|
|
18
|
-
| :------------------- | :------- | :--------------- |
|
|
19
|
-
| `variant (optional)` | `string` | `'icon'` |
|
|
20
|
-
| `size (optional)` | `number` | `24` |
|
|
21
|
-
| `fill` | `string` | `'currentcolor'` |
|
|
22
|
-
|
|
23
|
-
## Import
|
|
24
|
-
|
|
25
|
-
```tsx
|
|
26
|
-
import { Svg } from '@marigold/components';
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## Usage
|
|
30
|
-
|
|
31
|
-
<Preview>
|
|
32
|
-
<Story name="example1-svg">
|
|
33
|
-
<Svg>
|
|
34
|
-
<path d="M11.9634 17.6396C12.8179 17.6396 13.5991 17.4321 14.3071 17.0171C15.0151 16.602 15.5828 16.0344 16.01 15.3142C16.4373 14.594 16.6509 13.8127 16.6509 12.9705C16.6509 12.1282 16.4373 11.3469 16.01 10.6267C15.5828 9.90649 15.0151 9.33887 14.3071 8.92383C13.5991 8.50879 12.8179 8.30127 11.9634 8.30127C11.1089 8.30127 10.3276 8.50879 9.61963 8.92383C8.91162 9.33887 8.3501 9.90649 7.93506 10.6267C7.52002 11.3469 7.3125 12.1282 7.3125 12.9705C7.3125 13.8127 7.52002 14.594 7.93506 15.3142C8.3501 16.0344 8.91162 16.602 9.61963 17.0171C10.3276 17.4321 11.1089 17.6396 11.9634 17.6396ZM19.4341 5.48145C19.9468 5.48145 20.3862 5.66455 20.7524 6.03076C21.1187 6.39697 21.3018 6.83642 21.3018 7.34912V18.5552C21.3018 19.0679 21.1187 19.5073 20.7524 19.8735C20.3862 20.2397 19.9468 20.4229 19.4341 20.4229H4.49268C3.97998 20.4229 3.54053 20.2397 3.17432 19.8735C2.8081 19.5073 2.625 19.0679 2.625 18.5552V7.34912C2.625 6.83642 2.8081 6.39697 3.17432 6.03076C3.54053 5.66455 3.97998 5.48145 4.49268 5.48145H7.45898L9.18018 3.61377H14.7832L16.4678 5.48145H19.4341ZM11.9634 9.98584C12.7935 9.98584 13.5015 10.2788 14.0874 10.8647C14.6733 11.4507 14.9663 12.1526 14.9663 12.9705C14.9663 13.7883 14.6733 14.4902 14.0874 15.0762C13.5015 15.6621 12.7935 15.9551 11.9634 15.9551C11.1333 15.9551 10.4253 15.6621 9.83936 15.0762C9.25342 14.4902 8.96045 13.7883 8.96045 12.9705C8.96045 12.1526 9.25342 11.4507 9.83936 10.8647C10.4253 10.2788 11.1333 9.98584 11.9634 9.98584Z" />
|
|
35
|
-
</Svg>
|
|
36
|
-
</Story>
|
|
37
|
-
<Story name="example2-svg">
|
|
38
|
-
<Svg size={64}>
|
|
39
|
-
<path d="M15.2617 3H8.69638C7.33407 3 6.23438 4.09636 6.23438 5.45455V18.5455C6.23438 19.9036 7.33407 21 8.69638 21H15.2617C16.624 21 17.7237 19.9036 17.7237 18.5455V5.45455C17.7237 4.09636 16.624 3 15.2617 3V3ZM13.6204 19.3637H10.3377V18.5455H13.6204V19.3637V19.3637ZM16.2876 16.909H7.67054V5.4545H16.2876V16.909V16.909Z" />
|
|
40
|
-
</Svg>
|
|
41
|
-
</Story>
|
|
42
|
-
<Story name="example3-svg">
|
|
43
|
-
<Svg size={32} fill="orange">
|
|
44
|
-
<path d="M9.9 20.113V13.8415H14.1V20.113H19.35V11.751H22.5L12 2.34375L1.5 11.751H4.65V20.113H9.9Z" />
|
|
45
|
-
</Svg>
|
|
46
|
-
</Story>
|
|
47
|
-
</Preview>
|
package/src/Svg/Svg.test.tsx
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render, screen } from '@testing-library/react';
|
|
3
|
-
import { Svg } from './Svg';
|
|
4
|
-
import { useStyles } from '@marigold/system';
|
|
5
|
-
|
|
6
|
-
test('supports default fill color', () => {
|
|
7
|
-
render(
|
|
8
|
-
<Svg title="svg">
|
|
9
|
-
<path d="M9.9 20.113V13.8415H14" />
|
|
10
|
-
</Svg>
|
|
11
|
-
);
|
|
12
|
-
const svg = screen.getByTitle(/svg/);
|
|
13
|
-
|
|
14
|
-
expect(svg.getAttribute('fill')).toEqual('currentcolor');
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
test('supports default size', () => {
|
|
18
|
-
render(
|
|
19
|
-
<Svg title="svg">
|
|
20
|
-
<path d="M9.9 20.113V13.8415H14" />
|
|
21
|
-
</Svg>
|
|
22
|
-
);
|
|
23
|
-
const svg = screen.getByTitle(/svg/);
|
|
24
|
-
|
|
25
|
-
expect(svg.getAttribute('width')).toEqual('24');
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
test('supports size prop', () => {
|
|
29
|
-
render(
|
|
30
|
-
<Svg title="svg" size={30}>
|
|
31
|
-
<path d="M9.9 20.113V13.8415H14" />
|
|
32
|
-
</Svg>
|
|
33
|
-
);
|
|
34
|
-
const svg = screen.getByTitle(/svg/);
|
|
35
|
-
|
|
36
|
-
expect(svg.getAttribute('width')).toEqual('30');
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
test('supports fill prop', () => {
|
|
40
|
-
render(
|
|
41
|
-
<Svg title="svg" fill="#fafafa">
|
|
42
|
-
<path d="M9.9 20.113V13.8415H14" />
|
|
43
|
-
</Svg>
|
|
44
|
-
);
|
|
45
|
-
const svg = screen.getByTitle(/svg/);
|
|
46
|
-
|
|
47
|
-
expect(svg.getAttribute('fill')).toEqual('#fafafa');
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
test('accepts custom styles prop className', () => {
|
|
51
|
-
const TestComponent: React.FC = ({ children, ...props }) => {
|
|
52
|
-
const classNames = useStyles({ margin: '8px' });
|
|
53
|
-
return (
|
|
54
|
-
<Svg title="svg" className={classNames} {...props}>
|
|
55
|
-
<path d="M9.9 20.113V13.8415H14" />
|
|
56
|
-
</Svg>
|
|
57
|
-
);
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
const { getByTitle } = render(<TestComponent>text</TestComponent>);
|
|
61
|
-
const testelem = getByTitle('svg');
|
|
62
|
-
const text = getComputedStyle(testelem);
|
|
63
|
-
|
|
64
|
-
expect(text.margin).toEqual('8px');
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
test('renders <svg> element', () => {
|
|
68
|
-
render(
|
|
69
|
-
<Svg title="svg">
|
|
70
|
-
<path d="M9.9 20.113V13.8415H14" />
|
|
71
|
-
</Svg>
|
|
72
|
-
);
|
|
73
|
-
const svg = screen.getByTitle(/svg/);
|
|
74
|
-
|
|
75
|
-
expect(svg instanceof SVGElement).toBeTruthy();
|
|
76
|
-
});
|
package/src/Svg/Svg.tsx
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useStyles, system } from '@marigold/system';
|
|
3
|
-
|
|
4
|
-
type SvgProps = {
|
|
5
|
-
variant?: string;
|
|
6
|
-
size?: number;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export const Svg = system<SvgProps, 'svg'>(
|
|
10
|
-
({ variant = 'icon', size = 24, className = '', children, ...props }) => {
|
|
11
|
-
const classNames = useStyles(
|
|
12
|
-
{
|
|
13
|
-
variant: `icon.${variant}`,
|
|
14
|
-
},
|
|
15
|
-
className
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<svg
|
|
20
|
-
className={classNames}
|
|
21
|
-
width={size}
|
|
22
|
-
height={size}
|
|
23
|
-
viewBox="0 0 24 24"
|
|
24
|
-
fill="currentcolor"
|
|
25
|
-
{...props}
|
|
26
|
-
>
|
|
27
|
-
{children}
|
|
28
|
-
</svg>
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
);
|
package/src/Svg/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Svg';
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, Preview } from '@storybook/addon-docs/blocks';
|
|
2
|
-
import { Text } from './Text';
|
|
3
|
-
import { useStyles } from '@marigold/system';
|
|
4
|
-
|
|
5
|
-
<Meta title="Components/Typography/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
|
-
<Preview>
|
|
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
|
-
</Preview>
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, Preview } from '@storybook/addon-docs/blocks';
|
|
2
|
-
import { Textarea } from '@marigold/components';
|
|
3
|
-
|
|
4
|
-
<Meta title="Components/Form/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: `form` in your given theme. The variant in your section can be added with the variant prop. The default variant is `textarea`.
|
|
12
|
-
|
|
13
|
-
## Properties
|
|
14
|
-
|
|
15
|
-
| Property | Type | Default |
|
|
16
|
-
| :------------------- | :------- | :--------- |
|
|
17
|
-
| `variant` (optional) | `string` | `textarea` |
|
|
18
|
-
|
|
19
|
-
## Import
|
|
20
|
-
|
|
21
|
-
```tsx
|
|
22
|
-
import { Textarea } from '@marigold/components';
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Usage
|
|
26
|
-
|
|
27
|
-
<Preview>
|
|
28
|
-
<Story name="Textarea">
|
|
29
|
-
<Textarea placeholder="Placeholder" />
|
|
30
|
-
</Story>
|
|
31
|
-
<Story name="Textarea disabled">
|
|
32
|
-
<Textarea placeholder="Placeholder disabled" disabled />
|
|
33
|
-
</Story>
|
|
34
|
-
</Preview>
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, Preview } from '@storybook/addon-docs/blocks';
|
|
2
|
-
import { ValidationMessage } from '@marigold/components';
|
|
3
|
-
import { Exclamation } from '@marigold/icons';
|
|
4
|
-
|
|
5
|
-
<Meta title="Components/Content/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` | `negative` |
|
|
18
|
-
|
|
19
|
-
## Import
|
|
20
|
-
|
|
21
|
-
```tsx
|
|
22
|
-
import { ValidationMessage } from '@marigold/components';
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Usage
|
|
26
|
-
|
|
27
|
-
<Preview>
|
|
28
|
-
<Story name="ValidationMessage">
|
|
29
|
-
<div>
|
|
30
|
-
<ValidationMessage>
|
|
31
|
-
<Exclamation />
|
|
32
|
-
Validation message
|
|
33
|
-
</ValidationMessage>
|
|
34
|
-
</div>
|
|
35
|
-
</Story>
|
|
36
|
-
</Preview>
|