@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.
Files changed (224) hide show
  1. package/CHANGELOG.md +294 -0
  2. package/dist/ActionGroup/ActionGroup.d.ts +8 -0
  3. package/dist/ActionGroup/ActionGroup.stories.d.ts +5 -0
  4. package/dist/ActionGroup/index.d.ts +1 -0
  5. package/dist/Alert/Alert.d.ts +16 -3
  6. package/dist/Alert/Alert.stories.d.ts +5 -0
  7. package/dist/Badge/Badge.d.ts +11 -5
  8. package/dist/Badge/Badge.stories.d.ts +5 -0
  9. package/dist/Box.d.ts +2 -0
  10. package/dist/Button/Button.d.ts +9 -5
  11. package/dist/Button/Button.stories.d.ts +5 -0
  12. package/dist/Card/Card.d.ts +14 -0
  13. package/dist/Card/Card.stories.d.ts +5 -0
  14. package/dist/Card/index.d.ts +1 -0
  15. package/dist/Checkbox/Checkbox.d.ts +17 -5
  16. package/dist/Checkbox/Checkbox.stories.d.ts +5 -0
  17. package/dist/Checkbox/CheckboxIcons.d.ts +9 -0
  18. package/dist/Column/Column.d.ts +6 -4
  19. package/dist/Column/Column.stories.d.ts +5 -0
  20. package/dist/Columns/Columns.d.ts +10 -0
  21. package/dist/Columns/Columns.stories.d.ts +5 -0
  22. package/dist/Columns/index.d.ts +1 -0
  23. package/dist/Container/Container.d.ts +5 -4
  24. package/dist/Container/Container.stories.d.ts +5 -0
  25. package/dist/Dialog/Dialog.d.ts +17 -0
  26. package/dist/Dialog/Dialog.stories.d.ts +5 -0
  27. package/dist/Dialog/ModalDialog.d.ts +8 -0
  28. package/dist/Dialog/index.d.ts +1 -0
  29. package/dist/Divider/Divider.d.ts +10 -3
  30. package/dist/Divider/Divider.stories.d.ts +5 -0
  31. package/dist/Field/Field.d.ts +10 -5
  32. package/dist/Field/Field.stories.d.ts +5 -0
  33. package/dist/Image/Image.d.ts +11 -5
  34. package/dist/Image/Image.stories.d.ts +5 -0
  35. package/dist/Inline/Inline.d.ts +7 -0
  36. package/dist/Inline/Inline.stories.d.ts +5 -0
  37. package/dist/Inline/index.d.ts +1 -0
  38. package/dist/Input/Input.d.ts +10 -4
  39. package/dist/Input/Input.stories.d.ts +5 -0
  40. package/dist/Label/Label.d.ts +18 -5
  41. package/dist/Label/Label.stories.d.ts +5 -0
  42. package/dist/Link/Link.d.ts +10 -5
  43. package/dist/Link/Link.stories.d.ts +5 -0
  44. package/dist/Menu/Menu.d.ts +11 -4
  45. package/dist/Menu/Menu.stories.d.ts +5 -0
  46. package/dist/MenuItem/MenuItem.d.ts +11 -4
  47. package/dist/MenuItem/MenuItem.stories.d.ts +5 -0
  48. package/dist/Message/Message.d.ts +10 -4
  49. package/dist/Message/Message.stories.d.ts +5 -0
  50. package/dist/Provider/MarigoldProvider.d.ts +11 -0
  51. package/dist/Provider/index.d.ts +3 -0
  52. package/dist/Radio/Radio.d.ts +17 -4
  53. package/dist/Radio/RadioIcons.d.ts +10 -0
  54. package/dist/Select/ListBox.d.ts +9 -0
  55. package/dist/Select/ListBoxSection.d.ts +9 -0
  56. package/dist/Select/Option.d.ts +9 -0
  57. package/dist/Select/Popover.d.ts +9 -0
  58. package/dist/Select/Select.d.ts +27 -3
  59. package/dist/Select/Select.stories.d.ts +5 -0
  60. package/dist/Slider/Slider.d.ts +10 -4
  61. package/dist/Slider/Slider.stories.d.ts +5 -0
  62. package/dist/Stack/Stack.d.ts +7 -0
  63. package/dist/Stack/Stack.stories.d.ts +5 -0
  64. package/dist/Stack/index.d.ts +1 -0
  65. package/dist/Text/Text.d.ts +17 -7
  66. package/dist/Text/Text.stories.d.ts +5 -0
  67. package/dist/Textarea/Textarea.d.ts +15 -4
  68. package/dist/Textarea/Textarea.stories.d.ts +5 -0
  69. package/dist/ValidationMessage/ValidationMessage.d.ts +10 -4
  70. package/dist/ValidationMessage/ValidationMessage.stories.d.ts +5 -0
  71. package/dist/VisuallyHidden/VisuallyHidden.d.ts +1 -0
  72. package/dist/VisuallyHidden/VisuallyHidden.stories.d.ts +5 -0
  73. package/dist/VisuallyHidden/index.d.ts +1 -0
  74. package/dist/components.cjs.development.js +1276 -461
  75. package/dist/components.cjs.development.js.map +1 -1
  76. package/dist/components.cjs.production.min.js +1 -1
  77. package/dist/components.cjs.production.min.js.map +1 -1
  78. package/dist/components.esm.js +1229 -461
  79. package/dist/components.esm.js.map +1 -1
  80. package/dist/index.d.ts +10 -3
  81. package/dist/theme.d.ts +23 -28
  82. package/package.json +27 -4
  83. package/src/ActionGroup/ActionGroup.stories.tsx +47 -0
  84. package/src/ActionGroup/ActionGroup.test.tsx +83 -0
  85. package/src/ActionGroup/ActionGroup.tsx +32 -0
  86. package/src/ActionGroup/index.ts +1 -0
  87. package/src/Alert/Alert.stories.tsx +32 -0
  88. package/src/Alert/Alert.test.tsx +34 -23
  89. package/src/Alert/Alert.tsx +48 -24
  90. package/src/Badge/Badge.stories.tsx +38 -0
  91. package/src/Badge/Badge.test.tsx +14 -40
  92. package/src/Badge/Badge.tsx +31 -28
  93. package/src/Box.ts +2 -0
  94. package/src/Button/Button.stories.tsx +57 -0
  95. package/src/Button/Button.test.tsx +76 -13
  96. package/src/Button/Button.tsx +58 -23
  97. package/src/Card/Card.stories.tsx +41 -0
  98. package/src/Card/Card.test.tsx +71 -0
  99. package/src/Card/Card.tsx +48 -0
  100. package/src/Card/index.ts +1 -0
  101. package/src/Checkbox/Checkbox.stories.mdx +90 -112
  102. package/src/Checkbox/Checkbox.stories.tsx +78 -0
  103. package/src/Checkbox/Checkbox.test.tsx +139 -24
  104. package/src/Checkbox/Checkbox.tsx +95 -58
  105. package/src/Checkbox/CheckboxIcons.tsx +59 -0
  106. package/src/Column/Column.stories.tsx +33 -0
  107. package/src/Column/Column.test.tsx +15 -59
  108. package/src/Column/Column.tsx +21 -19
  109. package/src/Columns/Columns.stories.tsx +75 -0
  110. package/src/Columns/Columns.test.tsx +113 -0
  111. package/src/Columns/Columns.tsx +69 -0
  112. package/src/Columns/index.ts +1 -0
  113. package/src/Container/Container.stories.tsx +14 -0
  114. package/src/Container/Container.test.tsx +8 -49
  115. package/src/Container/Container.tsx +8 -19
  116. package/src/Dialog/Dialog.stories.tsx +88 -0
  117. package/src/Dialog/Dialog.test.tsx +158 -0
  118. package/src/Dialog/Dialog.tsx +130 -0
  119. package/src/Dialog/ModalDialog.tsx +76 -0
  120. package/src/Dialog/index.ts +1 -0
  121. package/src/Divider/Divider.stories.tsx +30 -0
  122. package/src/Divider/Divider.test.tsx +14 -6
  123. package/src/Divider/Divider.tsx +20 -13
  124. package/src/Field/Field.stories.tsx +110 -0
  125. package/src/Field/Field.test.tsx +75 -34
  126. package/src/Field/Field.tsx +50 -43
  127. package/src/Image/Image.stories.tsx +34 -0
  128. package/src/Image/Image.test.tsx +6 -3
  129. package/src/Image/Image.tsx +21 -15
  130. package/src/Inline/Inline.stories.tsx +39 -0
  131. package/src/Inline/Inline.test.tsx +99 -0
  132. package/src/Inline/Inline.tsx +38 -0
  133. package/src/Inline/index.ts +1 -0
  134. package/src/Input/Input.stories.tsx +54 -0
  135. package/src/Input/Input.test.tsx +9 -5
  136. package/src/Input/Input.tsx +21 -16
  137. package/src/Label/Label.stories.tsx +41 -0
  138. package/src/Label/Label.test.tsx +41 -6
  139. package/src/Label/Label.tsx +59 -18
  140. package/src/Link/Link.stories.tsx +35 -0
  141. package/src/Link/Link.test.tsx +52 -22
  142. package/src/Link/Link.tsx +40 -20
  143. package/src/Menu/Menu.stories.tsx +62 -0
  144. package/src/Menu/Menu.test.tsx +13 -7
  145. package/src/Menu/Menu.tsx +44 -38
  146. package/src/MenuItem/MenuItem.stories.tsx +30 -0
  147. package/src/MenuItem/MenuItem.test.tsx +23 -14
  148. package/src/MenuItem/MenuItem.tsx +29 -18
  149. package/src/Message/Message.stories.tsx +30 -0
  150. package/src/Message/Message.test.tsx +5 -2
  151. package/src/Message/Message.tsx +48 -40
  152. package/src/Provider/MarigoldProvider.test.tsx +136 -0
  153. package/src/Provider/MarigoldProvider.tsx +47 -0
  154. package/src/Provider/index.ts +4 -0
  155. package/src/Radio/Radio.stories.mdx +91 -94
  156. package/src/Radio/Radio.test.tsx +92 -16
  157. package/src/Radio/Radio.tsx +114 -50
  158. package/src/Radio/RadioIcons.tsx +39 -0
  159. package/src/Select/ListBox.tsx +40 -0
  160. package/src/Select/ListBoxSection.tsx +40 -0
  161. package/src/Select/Option.tsx +48 -0
  162. package/src/Select/Popover.tsx +50 -0
  163. package/src/Select/Select.stories.tsx +81 -0
  164. package/src/Select/Select.test.tsx +311 -43
  165. package/src/Select/Select.tsx +174 -28
  166. package/src/Slider/Slider.stories.tsx +24 -0
  167. package/src/Slider/Slider.test.tsx +11 -7
  168. package/src/Slider/Slider.tsx +30 -15
  169. package/src/Stack/Stack.stories.tsx +57 -0
  170. package/src/Stack/Stack.test.tsx +138 -0
  171. package/src/Stack/Stack.tsx +39 -0
  172. package/src/Stack/index.ts +1 -0
  173. package/src/Text/Text.stories.tsx +61 -0
  174. package/src/Text/Text.test.tsx +41 -36
  175. package/src/Text/Text.tsx +55 -29
  176. package/src/Textarea/Textarea.stories.tsx +64 -0
  177. package/src/Textarea/Textarea.test.tsx +41 -5
  178. package/src/Textarea/Textarea.tsx +57 -17
  179. package/src/ValidationMessage/ValidationMessage.stories.tsx +27 -0
  180. package/src/ValidationMessage/ValidationMessage.test.tsx +19 -14
  181. package/src/ValidationMessage/ValidationMessage.tsx +36 -21
  182. package/src/VisuallyHidden/VisuallyHidden.stories.tsx +19 -0
  183. package/src/VisuallyHidden/VisuallyHidden.test.tsx +10 -0
  184. package/src/VisuallyHidden/VisuallyHidden.tsx +1 -0
  185. package/src/VisuallyHidden/index.ts +1 -0
  186. package/src/index.ts +11 -3
  187. package/src/theme.ts +49 -28
  188. package/dist/Heading/Heading.d.ts +0 -5
  189. package/dist/Heading/index.d.ts +0 -1
  190. package/dist/Hidden/Hidden.d.ts +0 -6
  191. package/dist/Hidden/index.d.ts +0 -1
  192. package/dist/Svg/Svg.d.ts +0 -6
  193. package/dist/Svg/index.d.ts +0 -1
  194. package/src/Alert/Alert.stories.mdx +0 -49
  195. package/src/Badge/Badge.stories.mdx +0 -41
  196. package/src/Button/Button.stories.mdx +0 -155
  197. package/src/Column/Column.stories.mdx +0 -76
  198. package/src/Container/Container.stories.mdx +0 -42
  199. package/src/Divider/Divider.stories.mdx +0 -42
  200. package/src/Field/Field.stories.mdx +0 -57
  201. package/src/Heading/Heading.stories.mdx +0 -79
  202. package/src/Heading/Heading.test.tsx +0 -63
  203. package/src/Heading/Heading.tsx +0 -22
  204. package/src/Heading/index.ts +0 -1
  205. package/src/Hidden/Hidden.stories.mdx +0 -64
  206. package/src/Hidden/Hidden.test.tsx +0 -87
  207. package/src/Hidden/Hidden.tsx +0 -25
  208. package/src/Hidden/index.ts +0 -1
  209. package/src/Image/Image.stories.mdx +0 -40
  210. package/src/Input/Input.stories.mdx +0 -44
  211. package/src/Label/Label.stories.mdx +0 -34
  212. package/src/Link/Link.stories.mdx +0 -37
  213. package/src/Menu/Menu.stories.mdx +0 -47
  214. package/src/MenuItem/MenuItem.stories.mdx +0 -32
  215. package/src/Message/Message.stories.mdx +0 -43
  216. package/src/Select/Select.stories.mdx +0 -43
  217. package/src/Slider/Slider.stories.mdx +0 -57
  218. package/src/Svg/Svg.stories.mdx +0 -47
  219. package/src/Svg/Svg.test.tsx +0 -76
  220. package/src/Svg/Svg.tsx +0 -31
  221. package/src/Svg/index.ts +0 -1
  222. package/src/Text/Text.stories.mdx +0 -60
  223. package/src/Textarea/Textarea.stories.mdx +0 -34
  224. package/src/ValidationMessage/ValidationMessage.stories.mdx +0 -36
@@ -1,63 +0,0 @@
1
- import React from 'react';
2
- import { render, screen } from '@testing-library/react';
3
- import { ThemeProvider } from '@marigold/system';
4
- import { Heading } from '@marigold/components';
5
-
6
- const theme = {
7
- text: {
8
- h2: {
9
- fontFamily: 'Inter',
10
- },
11
- h3: {
12
- fontFamily: 'Roboto',
13
- },
14
- },
15
- };
16
-
17
- test('supports default variant and themeSection', () => {
18
- render(
19
- <ThemeProvider theme={theme}>
20
- <Heading title="default">Default</Heading>
21
- </ThemeProvider>
22
- );
23
- const heading = screen.getByTitle(/default/);
24
-
25
- expect(heading).toHaveStyle(`font-family: Inter`);
26
- });
27
-
28
- test('accepts other variant than default', () => {
29
- render(
30
- <ThemeProvider theme={theme}>
31
- <Heading title="default" variant="h3">
32
- Default
33
- </Heading>
34
- </ThemeProvider>
35
- );
36
- const heading = screen.getByTitle(/default/);
37
-
38
- expect(heading).toHaveStyle(`font-family: Roboto`);
39
- });
40
-
41
- test('renders correct HTML element', () => {
42
- render(
43
- <ThemeProvider theme={theme}>
44
- <Heading title="default">Default</Heading>
45
- </ThemeProvider>
46
- );
47
- const heading = screen.getByTitle(/default/);
48
-
49
- expect(heading instanceof HTMLHeadingElement).toBeTruthy();
50
- });
51
-
52
- test('accepts custom styles prop className', () => {
53
- render(
54
- <ThemeProvider theme={theme}>
55
- <Heading className="custom-class-name" title="heading">
56
- Default
57
- </Heading>
58
- </ThemeProvider>
59
- );
60
- const heading = screen.getByTitle(/heading/);
61
-
62
- expect(heading.className).toMatch('custom-class-name');
63
- });
@@ -1,22 +0,0 @@
1
- import React from 'react';
2
- import { useStyles, system } from '@marigold/system';
3
-
4
- type HeadingProps = {
5
- variant?: string;
6
- };
7
-
8
- export const Heading = system<HeadingProps, 'h2'>(
9
- ({ variant = 'h2', children, className, ...props }) => {
10
- const classNames = useStyles(
11
- {
12
- variant: `text.${variant}`,
13
- },
14
- className
15
- );
16
- return (
17
- <h2 className={classNames} {...props}>
18
- {children}
19
- </h2>
20
- );
21
- }
22
- );
@@ -1 +0,0 @@
1
- export * from './Heading';
@@ -1,64 +0,0 @@
1
- import { Meta, Story, Preview } from '@storybook/addon-docs/blocks';
2
- import { Button, Hidden, Text } from '@marigold/components';
3
- import { useState } from 'react';
4
-
5
- <Meta title="Components/Layout/Hidden" />
6
-
7
- # Hidden
8
-
9
- ## Description
10
-
11
- With the Hidden component you can hide elements or components. E.g. to hide some text in specific cases, for groups or platforms.
12
- The element uses always the themeSection with the name: `layout` in your given theme. The variant in your section can be added with the variant prop. The default variant is `hidden`.
13
-
14
- ## Properties
15
-
16
- | Property | Type | Default |
17
- | :------------------- | :-------- | :------- |
18
- | `variant` (optional) | `string` | `hidden` |
19
- | `show` (optional) | `boolean` | `false` |
20
-
21
- ## Import
22
-
23
- ```tsx
24
- import { Hidden } from '@marigold/components';
25
- ```
26
-
27
- ## Usage
28
-
29
- <Preview>
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
- </Preview>
39
-
40
- <Preview>
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
- </Preview>
@@ -1,87 +0,0 @@
1
- import React from 'react';
2
- import { render, screen } from '@testing-library/react';
3
- import { ThemeProvider } from '@marigold/system';
4
- import { Hidden } from '@marigold/components';
5
-
6
- const theme = {
7
- layout: {
8
- hidden: {
9
- alignItems: 'center',
10
- },
11
- invisible: {
12
- alignItems: 'right',
13
- },
14
- },
15
- };
16
-
17
- test('supports default variant and themeSection', () => {
18
- render(
19
- <ThemeProvider theme={theme}>
20
- <Hidden title="hidden">Default</Hidden>
21
- </ThemeProvider>
22
- );
23
- const hidden = screen.getByTitle(/hidden/);
24
-
25
- expect(hidden).toHaveStyle(`align-items: center`);
26
- });
27
-
28
- test('accepts other variant than default', () => {
29
- render(
30
- <ThemeProvider theme={theme}>
31
- <Hidden title="invisible" variant="invisible">
32
- Invisible
33
- </Hidden>
34
- </ThemeProvider>
35
- );
36
- const hidden = screen.getByTitle(/invisible/);
37
-
38
- expect(hidden).toHaveStyle(`align-items: right`);
39
- });
40
-
41
- test('text is not visible, show prop = false', () => {
42
- render(
43
- <ThemeProvider theme={theme}>
44
- <Hidden title="hidden">Hidden</Hidden>
45
- </ThemeProvider>
46
- );
47
- const hidden = screen.getByTitle(/hidden/);
48
-
49
- expect(hidden).not.toBeVisible();
50
- });
51
-
52
- test('support show prop = true', () => {
53
- render(
54
- <ThemeProvider theme={theme}>
55
- <Hidden title="hidden" show={true}>
56
- Default
57
- </Hidden>
58
- </ThemeProvider>
59
- );
60
- const hidden = screen.getByTitle(/hidden/);
61
-
62
- expect(hidden).toBeVisible();
63
- });
64
-
65
- test('renders correct HTML element', () => {
66
- render(
67
- <ThemeProvider theme={theme}>
68
- <Hidden title="hidden">Default</Hidden>
69
- </ThemeProvider>
70
- );
71
- const hidden = screen.getByTitle(/hidden/);
72
-
73
- expect(hidden instanceof HTMLSpanElement).toBeTruthy();
74
- });
75
-
76
- test('accepts custom styles prop className', () => {
77
- render(
78
- <ThemeProvider theme={theme}>
79
- <Hidden className="custom-class-name" title="hidden">
80
- text
81
- </Hidden>
82
- </ThemeProvider>
83
- );
84
- const hidden = screen.getByTitle(/hidden/);
85
-
86
- expect(hidden.className).toMatch('custom-class-name');
87
- });
@@ -1,25 +0,0 @@
1
- import React from 'react';
2
- import { useStyles, system } from '@marigold/system';
3
-
4
- type HiddenProps = {
5
- variant?: string;
6
- show?: boolean;
7
- };
8
-
9
- export const Hidden = system<HiddenProps, 'span'>(
10
- ({ variant = 'hidden', show = false, className, children, ...props }) => {
11
- const classNames = useStyles(
12
- {
13
- variant: `layout.${variant}`,
14
- display: show ? 'display' : 'none',
15
- },
16
- className
17
- );
18
-
19
- return (
20
- <span className={classNames} {...props}>
21
- {children}
22
- </span>
23
- );
24
- }
25
- );
@@ -1 +0,0 @@
1
- export * from './Hidden';
@@ -1,40 +0,0 @@
1
- import { Meta, Story, Preview } from '@storybook/addon-docs/blocks';
2
- import { Image } from '@marigold/components';
3
- import image1 from '../../../images/src/type_logo.png';
4
- import image2 from '../../../images/src/Marigold_Logo_Hotelstyle.png';
5
-
6
- <Meta title="Components/Content/Image" />
7
-
8
- # Image
9
-
10
- ## Description
11
-
12
- With the Image component you can render an `img` element.
13
- The themeSection is `content` and the variant can be added with the variant prop which is `images` per default.
14
-
15
- ## Properties
16
-
17
- | Property | Type | Default |
18
- | :------------------- | :------- | :------- |
19
- | `variant` (optional) | `string` | `images` |
20
- | `alt` (optional) | `string` | `` |
21
-
22
- ## Import
23
-
24
- ```tsx
25
- import { Image } from '@marigold/components';
26
- ```
27
-
28
- ## Usage
29
-
30
- <Preview>
31
- <Story name="firstImage">
32
- <Image src={image1} alt="marigold_logo" />
33
- </Story>
34
- </Preview>
35
-
36
- <Preview>
37
- <Story name="secondImage">
38
- <Image src={image2} width="500" height="300" />
39
- </Story>
40
- </Preview>
@@ -1,44 +0,0 @@
1
- import { Meta, Story, Preview } from '@storybook/addon-docs/blocks';
2
- import { Input, Label } from '@marigold/components';
3
-
4
- <Meta title="Components/Form/Input" />
5
-
6
- # Input
7
-
8
- ## Description
9
-
10
- With the Input component you can add a HTML `<input>` field for different types of text 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 `input`.
12
-
13
- ## Properties
14
-
15
- | Property | Type | Default |
16
- | :------------------- | :------- | :------ |
17
- | `variant` (optional) | `string` | `input` |
18
-
19
- ## Import
20
-
21
- ```tsx
22
- import { Input } from '@marigold/components';
23
- ```
24
-
25
- ## Usage
26
-
27
- <Preview>
28
- <Story name="Input">
29
- <div>
30
- <Label htmlFor="input">
31
- Label
32
- <Input id="input" placeholder="Placeholder" />
33
- </Label>
34
- <Label htmlFor="input2">
35
- Label
36
- <Input id="input2" placeholder="Disabled" disabled />
37
- </Label>
38
- <Label htmlFor="input3">
39
- Label
40
- <Input id="input2" type="submit" />
41
- </Label>
42
- </div>
43
- </Story>
44
- </Preview>
@@ -1,34 +0,0 @@
1
- import { Meta, Story, Preview } from '@storybook/addon-docs/blocks';
2
- import { Label } from './Label';
3
-
4
- <Meta title="Components/Form/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: `form` in your given theme. The variant in your section can be added with the variant prop. The default variant is `label`.
12
-
13
- ## Properties
14
-
15
- | Property | Type | Default |
16
- | :------------------- | :------- | :------ |
17
- | `variant` (optional) | `string` | `label` |
18
- | `htmlFor` | `string` | |
19
-
20
- ## Import
21
-
22
- ```tsx
23
- import { Label } from '@marigold/components';
24
- ```
25
-
26
- ## Usage
27
-
28
- <Preview>
29
- <Story name="label">
30
- <Label variant="label" htmlFor="labelId">
31
- I am a Label!
32
- </Label>
33
- </Story>
34
- </Preview>
@@ -1,37 +0,0 @@
1
- import { Meta, Story, Preview } from '@storybook/addon-docs/blocks';
2
- import { Link, Text } from '@marigold/components';
3
-
4
- <Meta title="Components/Typography/Link" />
5
-
6
- # Link
7
-
8
- ## Description
9
-
10
- Element to style links.
11
-
12
- ## Properties
13
-
14
- | Property | Type | Default |
15
- | :------------------- | :------- | :------ |
16
- | `variant` (optional) | `string` | `link` |
17
- | `href` | `string` | |
18
-
19
- ## Import
20
-
21
- ```tsx
22
- import { Link } from '@marigold/components';
23
- ```
24
-
25
- ## Usage
26
-
27
- <Preview>
28
- <Story name="Link">
29
- <Text>
30
- Link something nice like{' '}
31
- <Link href="#!" target="_blank">
32
- Marigold
33
- </Link>{' '}
34
- in text.
35
- </Text>
36
- </Story>
37
- </Preview>
@@ -1,47 +0,0 @@
1
- import { Meta, Story, Preview } from '@storybook/addon-docs/blocks';
2
- import { Menu, MenuItem, Divider } from '@marigold/components';
3
- import { BurgerMenu } from '@marigold/icons';
4
-
5
- <Meta title="Components/Content/Menu" />
6
-
7
- # Menu
8
-
9
- ## Description
10
-
11
- With the Menu component you can add a Menu Button with Text or Icon as Label and as children some MenuItem components.
12
- 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`.
13
-
14
- ## Properties
15
-
16
- | Property | Type | Default |
17
- | :------------------- | :--------- | :------ |
18
- | `variant` (optional) | `string` | `menu` |
19
- | `label` (optional) | `string` | `Menu` |
20
- | `onClick` | `function` | |
21
- | `show` (optional) | `boolean` | `false` |
22
-
23
- ## Import
24
-
25
- ```tsx
26
- import { Menu } from '@marigold/components';
27
- ```
28
-
29
- ## Usage
30
-
31
- <Preview>
32
- <Story name="menu">
33
- {() => {
34
- const [showMenu, setShowMenu] = React.useState(false);
35
- const toggle = () => {
36
- setShowMenu(!showMenu);
37
- };
38
- return (
39
- <Menu onClick={toggle} show={showMenu} label={<BurgerMenu />}>
40
- <MenuItem href="#">Home</MenuItem>
41
- <MenuItem href="#">Tickets</MenuItem>
42
- <MenuItem href="#">Kundenkonto</MenuItem>
43
- </Menu>
44
- );
45
- }}
46
- </Story>
47
- </Preview>
@@ -1,32 +0,0 @@
1
- import { Meta, Story, Preview } from '@storybook/addon-docs/blocks';
2
- import { MenuItem } from '@marigold/components';
3
-
4
- <Meta title="Components/Content/Menu/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: `content` 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
- <Preview>
29
- <Story name="MenuItem">
30
- <MenuItem href="#">Menu Item</MenuItem>
31
- </Story>
32
- </Preview>
@@ -1,43 +0,0 @@
1
- import { Meta, Story, Preview } from '@storybook/addon-docs/blocks';
2
- import { Message, Text } from '@marigold/components';
3
-
4
- <Meta title="Components/Content/Message" />
5
-
6
- # Message
7
-
8
- ## Description
9
-
10
- Simple component to display a message with a title and icon based on a `div` element and styled with a theme.
11
-
12
- ## Properties
13
-
14
- | Property | Type | Default |
15
- | :------------------- | :------- | :------ |
16
- | `messageTitle` | `string` | |
17
- | `variant` (optional) | `string` | `info` |
18
-
19
- ## Import
20
-
21
- ```tsx
22
- import { Message } from '@marigold/components';
23
- ```
24
-
25
- ## Usage
26
-
27
- <Preview>
28
- <Story name="Message">
29
- <Message variant="warning" messageTitle="Danger Zone!">
30
- <Text>Hello, I am a simple warning message.</Text>
31
- </Message>
32
- <br />
33
- <br />
34
- <Message variant="error" messageTitle="Wrong here.">
35
- <Text>Hello, I am a simple error message.</Text>
36
- </Message>
37
- <br />
38
- <br />
39
- <Message messageTitle="There is an update available.">
40
- <Text>Hello, I am a simple info message.</Text>
41
- </Message>
42
- </Story>
43
- </Preview>
@@ -1,43 +0,0 @@
1
- import { Meta, Story, Preview } from '@storybook/addon-docs/blocks';
2
- import { Label, Select } from '@marigold/components';
3
-
4
- <Meta title="Components/Form/Select" />
5
-
6
- # Select
7
-
8
- ## Description
9
-
10
- Dropdown for selecting a value among different options.
11
-
12
- ## Import
13
-
14
- ```tsx
15
- import { Select } from '@marigold/components';
16
- ```
17
-
18
- ## Usage
19
-
20
- <Preview>
21
- <Story name="Select">
22
- <Label htmlFor="select">
23
- Dropdown
24
- <Select id="select">
25
- <option selected>Choose here</option>
26
- <option>Hi</option>
27
- <option>Hey</option>
28
- <option>Blubb</option>
29
- </Select>
30
- </Label>
31
- </Story>
32
- <Story name="Select disabled">
33
- <Label htmlFor="select2">
34
- Dropdown disabled
35
- <Select disabled>
36
- <option selected>Can't choose here</option>
37
- <option>Hi</option>
38
- <option>Hey</option>
39
- <option>Blubb</option>
40
- </Select>
41
- </Label>
42
- </Story>
43
- </Preview>
@@ -1,57 +0,0 @@
1
- import { Meta, Story, Preview } from '@storybook/addon-docs/blocks';
2
- import { Label, Slider } from '@marigold/components';
3
-
4
- <Meta title="Components/Form/Slider" />
5
-
6
- # Slider
7
-
8
- ## Description
9
-
10
- With the Slider component you can add a HTML `<input>` element with `type="range"` 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 `slider`.
12
-
13
- ## Properties
14
-
15
- | Property | Type | Default |
16
- | :------------------- | :------- | :------- |
17
- | `variant` (optional) | `string` | `slider` |
18
-
19
- ## Import
20
-
21
- ```tsx
22
- import { Slider } from '@marigold/components';
23
- ```
24
-
25
- ## Usage
26
-
27
- ### Slider with default range and fix value
28
-
29
- <Preview>
30
- <Story name="SliderOne">
31
- <div>
32
- <Label htmlFor="vol">
33
- Volume:
34
- <br />
35
- <Slider id="vol" name="vol" min="0" max="50" />
36
- <br />
37
- <Slider id="vol" name="vol" min="0" max="50" value="25" />
38
- </Label>
39
- </div>
40
- </Story>
41
- </Preview>
42
-
43
- ### Slider with steps
44
-
45
- <Preview>
46
- <Story name="SliderTwo">
47
- <div>
48
- <Label htmlFor="vol">
49
- Volume:
50
- <br />
51
- <Slider id="vol" name="vol" min="0" max="100" step="10"></Slider>
52
- <br />
53
- <Slider id="vol" name="vol" min="20" max="80" step="5"></Slider>
54
- </Label>
55
- </div>
56
- </Story>
57
- </Preview>