@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,64 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks';
|
|
2
|
-
import { Button } from '../Button';
|
|
3
|
-
import { Hidden } from './Hidden';
|
|
4
|
-
import { Text } from '../Text';
|
|
5
|
-
import { useState } from 'react';
|
|
6
|
-
|
|
7
|
-
<Meta title="Components/Hidden" />
|
|
8
|
-
|
|
9
|
-
# Hidden
|
|
10
|
-
|
|
11
|
-
## Description
|
|
12
|
-
|
|
13
|
-
With the Hidden component you can hide elements or components. E.g. to hide some text in specific cases, for groups or platforms.
|
|
14
|
-
|
|
15
|
-
## Properties
|
|
16
|
-
|
|
17
|
-
| Property | Type | Default |
|
|
18
|
-
| :---------------- | :-------- | :------ |
|
|
19
|
-
| `show` (optional) | `boolean` | `false` |
|
|
20
|
-
|
|
21
|
-
## Import
|
|
22
|
-
|
|
23
|
-
```tsx
|
|
24
|
-
import { Hidden } from '@marigold/components';
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Usage
|
|
28
|
-
|
|
29
|
-
<Canvas>
|
|
30
|
-
<Story name="HiddenText">
|
|
31
|
-
<div>
|
|
32
|
-
<Text>Hello, I am visible</Text>
|
|
33
|
-
<Hidden>
|
|
34
|
-
<Text>Hello, I am invisible</Text>
|
|
35
|
-
</Hidden>
|
|
36
|
-
</div>
|
|
37
|
-
</Story>
|
|
38
|
-
</Canvas>
|
|
39
|
-
|
|
40
|
-
<Canvas>
|
|
41
|
-
<Story name="HiddenButton">
|
|
42
|
-
{() => {
|
|
43
|
-
const [state, setState] = React.useState({
|
|
44
|
-
showButton: false,
|
|
45
|
-
});
|
|
46
|
-
const handleToggleClick = () => {
|
|
47
|
-
setState(prevState => ({
|
|
48
|
-
showButton: !prevState.showButton,
|
|
49
|
-
}));
|
|
50
|
-
};
|
|
51
|
-
return (
|
|
52
|
-
<div>
|
|
53
|
-
<Button variant="primary.small" onClick={handleToggleClick}>
|
|
54
|
-
{state.showButton ? 'Hide Text' : 'Show Text'}
|
|
55
|
-
</Button>
|
|
56
|
-
<Hidden show={state.showButton}>
|
|
57
|
-
<br />
|
|
58
|
-
<Text>Hello, now I am visible</Text>
|
|
59
|
-
</Hidden>
|
|
60
|
-
</div>
|
|
61
|
-
);
|
|
62
|
-
}}
|
|
63
|
-
</Story>
|
|
64
|
-
</Canvas>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render, screen } from '@testing-library/react';
|
|
3
|
-
import { Hidden } from './Hidden';
|
|
4
|
-
|
|
5
|
-
test('text is not visible, show prop = false', () => {
|
|
6
|
-
render(<Hidden>Default</Hidden>);
|
|
7
|
-
const hidden = screen.getByText('Default');
|
|
8
|
-
|
|
9
|
-
expect(hidden).not.toBeVisible();
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
test('support show prop = true', () => {
|
|
13
|
-
render(<Hidden show={true}>Default</Hidden>);
|
|
14
|
-
const hidden = screen.getByText('Default');
|
|
15
|
-
|
|
16
|
-
expect(hidden).toBeVisible();
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
test('renders correct HTML element', () => {
|
|
20
|
-
render(<Hidden>Default</Hidden>);
|
|
21
|
-
const hidden = screen.getByText('Default');
|
|
22
|
-
|
|
23
|
-
expect(hidden instanceof HTMLSpanElement).toBeTruthy();
|
|
24
|
-
});
|
package/src/Hidden/Hidden.tsx
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Box } from '../Box';
|
|
3
|
-
|
|
4
|
-
export type HiddenProps = {
|
|
5
|
-
show?: boolean;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export const Hidden: React.FC<HiddenProps> = ({
|
|
9
|
-
show = false,
|
|
10
|
-
children,
|
|
11
|
-
...props
|
|
12
|
-
}) => (
|
|
13
|
-
<Box {...props} as="span" display={show ? 'display' : 'none'}>
|
|
14
|
-
{children}
|
|
15
|
-
</Box>
|
|
16
|
-
);
|
package/src/Hidden/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Hidden';
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks';
|
|
2
|
-
import { Image } from './Image';
|
|
3
|
-
import image1 from '../../../images/src/type_logo.png';
|
|
4
|
-
import image2 from '../../../images/src/Marigold_Logo_Hotelstyle.png';
|
|
5
|
-
|
|
6
|
-
<Meta title="Components/Image" />
|
|
7
|
-
|
|
8
|
-
# Image
|
|
9
|
-
|
|
10
|
-
## Description
|
|
11
|
-
|
|
12
|
-
With the Image component you can render an `img` element.
|
|
13
|
-
The themeSection is `images` and the variant can be added with the variant prop which is `fullWidth` per default.
|
|
14
|
-
|
|
15
|
-
## Properties
|
|
16
|
-
|
|
17
|
-
| Property | Type | Default |
|
|
18
|
-
| :------------------- | :------- | :---------- |
|
|
19
|
-
| `variant` (optional) | `string` | `fullWidth` |
|
|
20
|
-
| `alt` (optional) | `string` | `` |
|
|
21
|
-
|
|
22
|
-
## Import
|
|
23
|
-
|
|
24
|
-
```tsx
|
|
25
|
-
import { Image } from '@marigold/components';
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Usage
|
|
29
|
-
|
|
30
|
-
<Canvas>
|
|
31
|
-
<Story name="firstImage">
|
|
32
|
-
<Image src={image1} alt="marigold_logo" />
|
|
33
|
-
</Story>
|
|
34
|
-
</Canvas>
|
|
35
|
-
|
|
36
|
-
<Canvas>
|
|
37
|
-
<Story name="secondImage">
|
|
38
|
-
<Image src={image2} width="500" height="300" />
|
|
39
|
-
</Story>
|
|
40
|
-
</Canvas>
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks';
|
|
2
|
-
import { Input } from './Input';
|
|
3
|
-
import { Label } from '../Label';
|
|
4
|
-
|
|
5
|
-
<Meta title="Components/Input" />
|
|
6
|
-
|
|
7
|
-
# Input
|
|
8
|
-
|
|
9
|
-
## Description
|
|
10
|
-
|
|
11
|
-
With the Input component you can add a HTML `<input>` field for different types of text to your form.
|
|
12
|
-
The element uses always the themeSection with the name: `input` in your given theme. The variant in your section can be added with the variant prop. The default variant is `default`.
|
|
13
|
-
|
|
14
|
-
## Properties
|
|
15
|
-
|
|
16
|
-
| Property | Type | Default |
|
|
17
|
-
| :------------------- | :------- | :-------- |
|
|
18
|
-
| `variant` (optional) | `string` | `default` |
|
|
19
|
-
|
|
20
|
-
## Import
|
|
21
|
-
|
|
22
|
-
```tsx
|
|
23
|
-
import { Input } from '@marigold/components';
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Usage
|
|
27
|
-
|
|
28
|
-
<Canvas>
|
|
29
|
-
<Story name="Input">
|
|
30
|
-
<div>
|
|
31
|
-
<Label htmlFor="input">
|
|
32
|
-
Label
|
|
33
|
-
<Input id="input" placeholder="Placeholder" />
|
|
34
|
-
</Label>
|
|
35
|
-
<Label htmlFor="input2">
|
|
36
|
-
Label
|
|
37
|
-
<Input id="input2" placeholder="Disabled" disabled />
|
|
38
|
-
</Label>
|
|
39
|
-
<Label htmlFor="input3">
|
|
40
|
-
Label
|
|
41
|
-
<Input id="input2" type="submit" />
|
|
42
|
-
</Label>
|
|
43
|
-
</div>
|
|
44
|
-
</Story>
|
|
45
|
-
</Canvas>
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks';
|
|
2
|
-
import { Label } from './Label';
|
|
3
|
-
|
|
4
|
-
<Meta title="Components/Label" />
|
|
5
|
-
|
|
6
|
-
# Label-Component
|
|
7
|
-
|
|
8
|
-
## Description
|
|
9
|
-
|
|
10
|
-
With the Label component you can add a HTML `<Label>` element to your form.
|
|
11
|
-
The element uses always the themeSection with the name: `label` in your given theme. The variant in your section can be added with the variant prop. The default variant is `default`.
|
|
12
|
-
|
|
13
|
-
## Properties
|
|
14
|
-
|
|
15
|
-
| Property | Type | Default |
|
|
16
|
-
| :------------------- | :------- | :-------- |
|
|
17
|
-
| `variant` (optional) | `string` | `default` |
|
|
18
|
-
| `htmlFor` | `string` | |
|
|
19
|
-
|
|
20
|
-
## Import
|
|
21
|
-
|
|
22
|
-
```tsx
|
|
23
|
-
import { Label } from '@marigold/components';
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Usage
|
|
27
|
-
|
|
28
|
-
<Canvas>
|
|
29
|
-
<Story name="label">
|
|
30
|
-
<Label variant="label" htmlFor="labelId">
|
|
31
|
-
I am a Label!
|
|
32
|
-
</Label>
|
|
33
|
-
</Story>
|
|
34
|
-
</Canvas>
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks';
|
|
2
|
-
import { Link } from './Link';
|
|
3
|
-
import { Text } from '../Text';
|
|
4
|
-
|
|
5
|
-
<Meta title="Components/Link" />
|
|
6
|
-
|
|
7
|
-
# Link
|
|
8
|
-
|
|
9
|
-
## Description
|
|
10
|
-
|
|
11
|
-
Element to style links.
|
|
12
|
-
|
|
13
|
-
## Properties
|
|
14
|
-
|
|
15
|
-
| Property | Type | Default |
|
|
16
|
-
| :------------------- | :------- | :------ |
|
|
17
|
-
| `variant` (optional) | `string` | `link` |
|
|
18
|
-
| `href` | `string` | |
|
|
19
|
-
|
|
20
|
-
## Import
|
|
21
|
-
|
|
22
|
-
```tsx
|
|
23
|
-
import { Link } from '@marigold/components';
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Usage
|
|
27
|
-
|
|
28
|
-
<Canvas>
|
|
29
|
-
<Story name="Link">
|
|
30
|
-
<Text>
|
|
31
|
-
Link something nice like{' '}
|
|
32
|
-
<Link href="#!" target="_blank">
|
|
33
|
-
Marigold
|
|
34
|
-
</Link>{' '}
|
|
35
|
-
in text.
|
|
36
|
-
</Text>
|
|
37
|
-
</Story>
|
|
38
|
-
</Canvas>
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks';
|
|
2
|
-
import { Divider } from '../Divider';
|
|
3
|
-
import { Menu } from './Menu';
|
|
4
|
-
import { MenuItem } from '../MenuItem';
|
|
5
|
-
import { BurgerMenu } from '@marigold/icons';
|
|
6
|
-
|
|
7
|
-
<Meta title="Components/Menu" />
|
|
8
|
-
|
|
9
|
-
# Menu
|
|
10
|
-
|
|
11
|
-
## Description
|
|
12
|
-
|
|
13
|
-
With the Menu component you can add a Menu Button with Text or Icon as Label and as children some MenuItem components.
|
|
14
|
-
The element uses always the themeSection with the name: `content` in your given theme. The variant in your section can be added with the variant prop. The default variant is `menu`.
|
|
15
|
-
|
|
16
|
-
## Properties
|
|
17
|
-
|
|
18
|
-
| Property | Type | Default |
|
|
19
|
-
| :------------------- | :--------- | :------ |
|
|
20
|
-
| `variant` (optional) | `string` | `menu` |
|
|
21
|
-
| `label` (optional) | `string` | `Menu` |
|
|
22
|
-
| `onClick` | `function` | |
|
|
23
|
-
| `show` (optional) | `boolean` | `false` |
|
|
24
|
-
|
|
25
|
-
## Import
|
|
26
|
-
|
|
27
|
-
```tsx
|
|
28
|
-
import { Menu } from '@marigold/components';
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## Usage
|
|
32
|
-
|
|
33
|
-
<Canvas>
|
|
34
|
-
<Story name="menu">
|
|
35
|
-
{() => {
|
|
36
|
-
const [showMenu, setShowMenu] = React.useState(false);
|
|
37
|
-
const toggle = () => {
|
|
38
|
-
setShowMenu(!showMenu);
|
|
39
|
-
};
|
|
40
|
-
return (
|
|
41
|
-
<Menu onClick={toggle} show={showMenu} label={<BurgerMenu />}>
|
|
42
|
-
<MenuItem href="#">Home</MenuItem>
|
|
43
|
-
<MenuItem href="#">Tickets</MenuItem>
|
|
44
|
-
<MenuItem href="#">Kundenkonto</MenuItem>
|
|
45
|
-
</Menu>
|
|
46
|
-
);
|
|
47
|
-
}}
|
|
48
|
-
</Story>
|
|
49
|
-
</Canvas>
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks';
|
|
2
|
-
import { MenuItem } from './MenuItem';
|
|
3
|
-
|
|
4
|
-
<Meta title="Components/MenuItem" />
|
|
5
|
-
|
|
6
|
-
# Menu
|
|
7
|
-
|
|
8
|
-
## Description
|
|
9
|
-
|
|
10
|
-
With the MenuItem component you can add a MenuItem which renders a link component to a Menu component.
|
|
11
|
-
The element uses always the themeSection with the name: `menu` in your given theme. The variant in your section can be added with the variant prop. The default variant is `menuItem`.
|
|
12
|
-
The Link component in the MenuItem uses the variant `menu`.
|
|
13
|
-
|
|
14
|
-
## Properties
|
|
15
|
-
|
|
16
|
-
| Property | Type | Default |
|
|
17
|
-
| :------------------- | :------- | :--------- |
|
|
18
|
-
| `variant` (optional) | `string` | `menuItem` |
|
|
19
|
-
|
|
20
|
-
## Import
|
|
21
|
-
|
|
22
|
-
```tsx
|
|
23
|
-
import { MenuItem } from '@marigold/components';
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Usage
|
|
27
|
-
|
|
28
|
-
<Canvas>
|
|
29
|
-
<Story name="MenuItem">
|
|
30
|
-
<MenuItem href="#">Menu Item</MenuItem>
|
|
31
|
-
</Story>
|
|
32
|
-
</Canvas>
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks';
|
|
2
|
-
import { Message } from './Message';
|
|
3
|
-
import { Text } from '../Text';
|
|
4
|
-
|
|
5
|
-
<Meta title="Components/Message" />
|
|
6
|
-
|
|
7
|
-
# Message
|
|
8
|
-
|
|
9
|
-
## Description
|
|
10
|
-
|
|
11
|
-
Simple component to display a message with a title and icon based on a `div` element and styled with a theme.
|
|
12
|
-
|
|
13
|
-
## Properties
|
|
14
|
-
|
|
15
|
-
| Property | Type | Default |
|
|
16
|
-
| :------------------- | :------- | :------ |
|
|
17
|
-
| `messageTitle` | `string` | |
|
|
18
|
-
| `variant` (optional) | `string` | `info` |
|
|
19
|
-
|
|
20
|
-
## Import
|
|
21
|
-
|
|
22
|
-
```tsx
|
|
23
|
-
import { Message } from '@marigold/components';
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Usage
|
|
27
|
-
|
|
28
|
-
<Canvas>
|
|
29
|
-
<Story name="Message">
|
|
30
|
-
<Message variant="warning" messageTitle="Danger Zone!">
|
|
31
|
-
<Text>Hello, I am a simple warning message.</Text>
|
|
32
|
-
</Message>
|
|
33
|
-
<br />
|
|
34
|
-
<br />
|
|
35
|
-
<Message variant="error" messageTitle="Wrong here.">
|
|
36
|
-
<Text>Hello, I am a simple error message.</Text>
|
|
37
|
-
</Message>
|
|
38
|
-
<br />
|
|
39
|
-
<br />
|
|
40
|
-
<Message messageTitle="There is an update available.">
|
|
41
|
-
<Text>Hello, I am a simple info message.</Text>
|
|
42
|
-
</Message>
|
|
43
|
-
</Story>
|
|
44
|
-
</Canvas>
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks';
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { Radio } from './Radio';
|
|
4
|
-
|
|
5
|
-
<Meta title="Components/Radio" />
|
|
6
|
-
|
|
7
|
-
# Radio Button
|
|
8
|
-
|
|
9
|
-
## Description
|
|
10
|
-
|
|
11
|
-
With the Radio Button component you can add a HTML `<input>` element with `type="radio"` to your form.
|
|
12
|
-
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 `radio`.
|
|
13
|
-
|
|
14
|
-
## Properties
|
|
15
|
-
|
|
16
|
-
| Property | Type | Default |
|
|
17
|
-
| :-------------------- | :-------- | :------ |
|
|
18
|
-
| `id` | `string` | |
|
|
19
|
-
| `variant` (optional) | `string` | `radio` |
|
|
20
|
-
| `label` (optional) | `string` | |
|
|
21
|
-
| `required` (optional) | `boolean` | |
|
|
22
|
-
|
|
23
|
-
## Import
|
|
24
|
-
|
|
25
|
-
```tsx
|
|
26
|
-
import { Radio } from '@marigold/components';
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## Usage
|
|
30
|
-
|
|
31
|
-
### Radio standard labeled
|
|
32
|
-
|
|
33
|
-
<Canvas>
|
|
34
|
-
<Story name="RadioOne">
|
|
35
|
-
{() => {
|
|
36
|
-
const [state, setState] = React.useState('Mastercard');
|
|
37
|
-
const onChange = changeEvent => {
|
|
38
|
-
setState(changeEvent.currentTarget.value);
|
|
39
|
-
};
|
|
40
|
-
return (
|
|
41
|
-
<div>
|
|
42
|
-
<Radio
|
|
43
|
-
id="mc"
|
|
44
|
-
name="payment"
|
|
45
|
-
onChange={onChange}
|
|
46
|
-
checked={state === 'Mastercard'}
|
|
47
|
-
value="Mastercard"
|
|
48
|
-
label="Mastercard"
|
|
49
|
-
/>
|
|
50
|
-
<br />
|
|
51
|
-
<Radio
|
|
52
|
-
id="vi"
|
|
53
|
-
name="payment"
|
|
54
|
-
onChange={onChange}
|
|
55
|
-
checked={state === 'Visa'}
|
|
56
|
-
value="Visa"
|
|
57
|
-
label="Visa"
|
|
58
|
-
/>
|
|
59
|
-
<br />
|
|
60
|
-
<Radio
|
|
61
|
-
id="ae"
|
|
62
|
-
name="payment"
|
|
63
|
-
onChange={onChange}
|
|
64
|
-
checked={state === 'AmericanExpress'}
|
|
65
|
-
value="AmericanExpress"
|
|
66
|
-
label="AmericanExpress"
|
|
67
|
-
/>
|
|
68
|
-
</div>
|
|
69
|
-
);
|
|
70
|
-
}}
|
|
71
|
-
</Story>
|
|
72
|
-
</Canvas>
|
|
73
|
-
|
|
74
|
-
### Radio checked and disabled
|
|
75
|
-
|
|
76
|
-
<Canvas>
|
|
77
|
-
<Story name="RadioTwo">
|
|
78
|
-
<div>
|
|
79
|
-
<Radio id="radio" checked />
|
|
80
|
-
<Radio id="radio" disabled />
|
|
81
|
-
<Radio id="radio" checked disabled />
|
|
82
|
-
</div>
|
|
83
|
-
</Story>
|
|
84
|
-
</Canvas>
|
|
85
|
-
|
|
86
|
-
### Radio with required label
|
|
87
|
-
|
|
88
|
-
<Canvas>
|
|
89
|
-
<Story name="RadioThree">
|
|
90
|
-
<div>
|
|
91
|
-
<Radio
|
|
92
|
-
checked
|
|
93
|
-
id="required"
|
|
94
|
-
value="required"
|
|
95
|
-
required
|
|
96
|
-
label="This label is required"
|
|
97
|
-
/>
|
|
98
|
-
</div>
|
|
99
|
-
</Story>
|
|
100
|
-
</Canvas>
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks';
|
|
2
|
-
import { Label } from '../Label';
|
|
3
|
-
import { Select } from './Select';
|
|
4
|
-
|
|
5
|
-
<Meta title="Components/Select" />
|
|
6
|
-
|
|
7
|
-
# Select
|
|
8
|
-
|
|
9
|
-
## Description
|
|
10
|
-
|
|
11
|
-
Dropdown for selecting a value among different options.
|
|
12
|
-
|
|
13
|
-
## Import
|
|
14
|
-
|
|
15
|
-
```tsx
|
|
16
|
-
import { Select } from '@marigold/components';
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Usage
|
|
20
|
-
|
|
21
|
-
<Canvas>
|
|
22
|
-
<Story name="Select">
|
|
23
|
-
<Label htmlFor="select">
|
|
24
|
-
Dropdown
|
|
25
|
-
<Select id="select">
|
|
26
|
-
<option selected>Choose here</option>
|
|
27
|
-
<option>Hi</option>
|
|
28
|
-
<option>Hey</option>
|
|
29
|
-
<option>Blubb</option>
|
|
30
|
-
</Select>
|
|
31
|
-
</Label>
|
|
32
|
-
</Story>
|
|
33
|
-
<Story name="Select disabled">
|
|
34
|
-
<Label htmlFor="select2">
|
|
35
|
-
Dropdown disabled
|
|
36
|
-
<Select disabled>
|
|
37
|
-
<option selected>Can't choose here</option>
|
|
38
|
-
<option>Hi</option>
|
|
39
|
-
<option>Hey</option>
|
|
40
|
-
<option>Blubb</option>
|
|
41
|
-
</Select>
|
|
42
|
-
</Label>
|
|
43
|
-
</Story>
|
|
44
|
-
</Canvas>
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks';
|
|
2
|
-
import { Label } from '../Label';
|
|
3
|
-
import { Slider } from './Slider';
|
|
4
|
-
|
|
5
|
-
<Meta title="Components/Slider" />
|
|
6
|
-
|
|
7
|
-
# Slider
|
|
8
|
-
|
|
9
|
-
## Description
|
|
10
|
-
|
|
11
|
-
With the Slider component you can add a HTML `<input>` element with `type="range"` to your form.
|
|
12
|
-
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 `slider`.
|
|
13
|
-
|
|
14
|
-
## Properties
|
|
15
|
-
|
|
16
|
-
| Property | Type | Default |
|
|
17
|
-
| :------------------- | :------- | :------- |
|
|
18
|
-
| `variant` (optional) | `string` | `slider` |
|
|
19
|
-
|
|
20
|
-
## Import
|
|
21
|
-
|
|
22
|
-
```tsx
|
|
23
|
-
import { Slider } from '@marigold/components';
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Usage
|
|
27
|
-
|
|
28
|
-
### Slider with default range and fix value
|
|
29
|
-
|
|
30
|
-
<Canvas>
|
|
31
|
-
<Story name="SliderOne">
|
|
32
|
-
<div>
|
|
33
|
-
<Label htmlFor="vol">
|
|
34
|
-
Volume:
|
|
35
|
-
<br />
|
|
36
|
-
<Slider id="vol" name="vol" min="0" max="50" />
|
|
37
|
-
<br />
|
|
38
|
-
<Slider id="vol" name="vol" min="0" max="50" value="25" />
|
|
39
|
-
</Label>
|
|
40
|
-
</div>
|
|
41
|
-
</Story>
|
|
42
|
-
</Canvas>
|
|
43
|
-
|
|
44
|
-
### Slider with steps
|
|
45
|
-
|
|
46
|
-
<Canvas>
|
|
47
|
-
<Story name="SliderTwo">
|
|
48
|
-
<div>
|
|
49
|
-
<Label htmlFor="vol">
|
|
50
|
-
Volume:
|
|
51
|
-
<br />
|
|
52
|
-
<Slider id="vol" name="vol" min="0" max="100" step="10"></Slider>
|
|
53
|
-
<br />
|
|
54
|
-
<Slider id="vol" name="vol" min="20" max="80" step="5"></Slider>
|
|
55
|
-
</Label>
|
|
56
|
-
</div>
|
|
57
|
-
</Story>
|
|
58
|
-
</Canvas>
|