@marigold/components 0.3.0 → 0.4.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 (232) hide show
  1. package/CHANGELOG.md +66 -161
  2. package/dist/index.d.ts +364 -32
  3. package/dist/index.js +1421 -5
  4. package/dist/index.mjs +1369 -0
  5. package/package.json +31 -11
  6. package/dist/ActionGroup/ActionGroup.d.ts +0 -8
  7. package/dist/ActionGroup/ActionGroup.stories.d.ts +0 -5
  8. package/dist/ActionGroup/index.d.ts +0 -1
  9. package/dist/Alert/Alert.d.ts +0 -18
  10. package/dist/Alert/Alert.stories.d.ts +0 -5
  11. package/dist/Alert/index.d.ts +0 -1
  12. package/dist/Badge/Badge.d.ts +0 -13
  13. package/dist/Badge/Badge.stories.d.ts +0 -5
  14. package/dist/Badge/index.d.ts +0 -1
  15. package/dist/Box.d.ts +0 -2
  16. package/dist/Button/Button.d.ts +0 -9
  17. package/dist/Button/Button.stories.d.ts +0 -5
  18. package/dist/Button/index.d.ts +0 -1
  19. package/dist/Card/Card.d.ts +0 -14
  20. package/dist/Card/Card.stories.d.ts +0 -5
  21. package/dist/Card/index.d.ts +0 -1
  22. package/dist/Checkbox/Checkbox.d.ts +0 -20
  23. package/dist/Checkbox/Checkbox.stories.d.ts +0 -5
  24. package/dist/Checkbox/CheckboxIcons.d.ts +0 -9
  25. package/dist/Checkbox/index.d.ts +0 -1
  26. package/dist/Column/Column.d.ts +0 -8
  27. package/dist/Column/Column.stories.d.ts +0 -5
  28. package/dist/Column/index.d.ts +0 -1
  29. package/dist/Columns/Columns.d.ts +0 -10
  30. package/dist/Columns/Columns.stories.d.ts +0 -5
  31. package/dist/Columns/index.d.ts +0 -1
  32. package/dist/Container/Container.d.ts +0 -6
  33. package/dist/Container/Container.stories.d.ts +0 -5
  34. package/dist/Container/index.d.ts +0 -1
  35. package/dist/Dialog/Dialog.d.ts +0 -17
  36. package/dist/Dialog/Dialog.stories.d.ts +0 -5
  37. package/dist/Dialog/ModalDialog.d.ts +0 -8
  38. package/dist/Dialog/index.d.ts +0 -1
  39. package/dist/Divider/Divider.d.ts +0 -12
  40. package/dist/Divider/Divider.stories.d.ts +0 -5
  41. package/dist/Divider/index.d.ts +0 -1
  42. package/dist/Field/Field.d.ts +0 -13
  43. package/dist/Field/Field.stories.d.ts +0 -5
  44. package/dist/Field/index.d.ts +0 -1
  45. package/dist/Image/Image.d.ts +0 -12
  46. package/dist/Image/Image.stories.d.ts +0 -5
  47. package/dist/Image/index.d.ts +0 -1
  48. package/dist/Inline/Inline.d.ts +0 -7
  49. package/dist/Inline/Inline.stories.d.ts +0 -5
  50. package/dist/Inline/index.d.ts +0 -1
  51. package/dist/Input/Input.d.ts +0 -11
  52. package/dist/Input/Input.stories.d.ts +0 -5
  53. package/dist/Input/index.d.ts +0 -1
  54. package/dist/Label/Label.d.ts +0 -19
  55. package/dist/Label/Label.stories.d.ts +0 -5
  56. package/dist/Label/index.d.ts +0 -1
  57. package/dist/Link/Link.d.ts +0 -10
  58. package/dist/Link/Link.stories.d.ts +0 -5
  59. package/dist/Link/index.d.ts +0 -1
  60. package/dist/Menu/Menu.d.ts +0 -15
  61. package/dist/Menu/Menu.stories.d.ts +0 -5
  62. package/dist/Menu/index.d.ts +0 -1
  63. package/dist/MenuItem/MenuItem.d.ts +0 -12
  64. package/dist/MenuItem/MenuItem.stories.d.ts +0 -5
  65. package/dist/MenuItem/index.d.ts +0 -1
  66. package/dist/Message/Message.d.ts +0 -12
  67. package/dist/Message/Message.stories.d.ts +0 -5
  68. package/dist/Message/index.d.ts +0 -1
  69. package/dist/Provider/MarigoldProvider.d.ts +0 -11
  70. package/dist/Provider/index.d.ts +0 -3
  71. package/dist/Radio/Radio.d.ts +0 -21
  72. package/dist/Radio/RadioIcons.d.ts +0 -10
  73. package/dist/Radio/index.d.ts +0 -1
  74. package/dist/Select/ListBox.d.ts +0 -9
  75. package/dist/Select/ListBoxSection.d.ts +0 -9
  76. package/dist/Select/Option.d.ts +0 -9
  77. package/dist/Select/Popover.d.ts +0 -9
  78. package/dist/Select/Select.d.ts +0 -27
  79. package/dist/Select/Select.stories.d.ts +0 -5
  80. package/dist/Select/index.d.ts +0 -1
  81. package/dist/Slider/Slider.d.ts +0 -11
  82. package/dist/Slider/Slider.stories.d.ts +0 -5
  83. package/dist/Slider/index.d.ts +0 -1
  84. package/dist/Stack/Stack.d.ts +0 -7
  85. package/dist/Stack/Stack.stories.d.ts +0 -5
  86. package/dist/Stack/index.d.ts +0 -1
  87. package/dist/Text/Text.d.ts +0 -17
  88. package/dist/Text/Text.stories.d.ts +0 -5
  89. package/dist/Text/index.d.ts +0 -1
  90. package/dist/Textarea/Textarea.d.ts +0 -16
  91. package/dist/Textarea/Textarea.stories.d.ts +0 -5
  92. package/dist/Textarea/index.d.ts +0 -1
  93. package/dist/ValidationMessage/ValidationMessage.d.ts +0 -11
  94. package/dist/ValidationMessage/ValidationMessage.stories.d.ts +0 -5
  95. package/dist/ValidationMessage/index.d.ts +0 -1
  96. package/dist/VisuallyHidden/VisuallyHidden.d.ts +0 -1
  97. package/dist/VisuallyHidden/VisuallyHidden.stories.d.ts +0 -5
  98. package/dist/VisuallyHidden/index.d.ts +0 -1
  99. package/dist/components.cjs.development.js +0 -1422
  100. package/dist/components.cjs.development.js.map +0 -1
  101. package/dist/components.cjs.production.min.js +0 -2
  102. package/dist/components.cjs.production.min.js.map +0 -1
  103. package/dist/components.esm.js +0 -1348
  104. package/dist/components.esm.js.map +0 -1
  105. package/dist/theme.d.ts +0 -23
  106. package/src/ActionGroup/ActionGroup.stories.tsx +0 -47
  107. package/src/ActionGroup/ActionGroup.test.tsx +0 -83
  108. package/src/ActionGroup/ActionGroup.tsx +0 -32
  109. package/src/ActionGroup/index.ts +0 -1
  110. package/src/Alert/Alert.stories.tsx +0 -32
  111. package/src/Alert/Alert.test.tsx +0 -82
  112. package/src/Alert/Alert.tsx +0 -52
  113. package/src/Alert/index.ts +0 -1
  114. package/src/Badge/Badge.stories.tsx +0 -38
  115. package/src/Badge/Badge.test.tsx +0 -65
  116. package/src/Badge/Badge.tsx +0 -37
  117. package/src/Badge/index.ts +0 -1
  118. package/src/Box.ts +0 -2
  119. package/src/Button/Button.stories.tsx +0 -57
  120. package/src/Button/Button.test.tsx +0 -149
  121. package/src/Button/Button.tsx +0 -64
  122. package/src/Button/index.ts +0 -1
  123. package/src/Card/Card.stories.tsx +0 -41
  124. package/src/Card/Card.test.tsx +0 -71
  125. package/src/Card/Card.tsx +0 -48
  126. package/src/Card/index.ts +0 -1
  127. package/src/Checkbox/Checkbox.stories.mdx +0 -97
  128. package/src/Checkbox/Checkbox.stories.tsx +0 -78
  129. package/src/Checkbox/Checkbox.test.tsx +0 -166
  130. package/src/Checkbox/Checkbox.tsx +0 -101
  131. package/src/Checkbox/CheckboxIcons.tsx +0 -59
  132. package/src/Checkbox/index.ts +0 -1
  133. package/src/Column/Column.stories.tsx +0 -33
  134. package/src/Column/Column.test.tsx +0 -32
  135. package/src/Column/Column.tsx +0 -27
  136. package/src/Column/index.ts +0 -1
  137. package/src/Columns/Columns.stories.tsx +0 -75
  138. package/src/Columns/Columns.test.tsx +0 -113
  139. package/src/Columns/Columns.tsx +0 -69
  140. package/src/Columns/index.ts +0 -1
  141. package/src/Container/Container.stories.tsx +0 -14
  142. package/src/Container/Container.test.tsx +0 -26
  143. package/src/Container/Container.tsx +0 -13
  144. package/src/Container/index.ts +0 -1
  145. package/src/Dialog/Dialog.stories.tsx +0 -88
  146. package/src/Dialog/Dialog.test.tsx +0 -158
  147. package/src/Dialog/Dialog.tsx +0 -130
  148. package/src/Dialog/ModalDialog.tsx +0 -76
  149. package/src/Dialog/index.ts +0 -1
  150. package/src/Divider/Divider.stories.tsx +0 -30
  151. package/src/Divider/Divider.test.tsx +0 -71
  152. package/src/Divider/Divider.tsx +0 -25
  153. package/src/Divider/index.ts +0 -1
  154. package/src/Field/Field.stories.tsx +0 -110
  155. package/src/Field/Field.test.tsx +0 -130
  156. package/src/Field/Field.tsx +0 -56
  157. package/src/Field/index.ts +0 -1
  158. package/src/Image/Image.stories.tsx +0 -34
  159. package/src/Image/Image.test.tsx +0 -73
  160. package/src/Image/Image.tsx +0 -25
  161. package/src/Image/index.ts +0 -1
  162. package/src/Inline/Inline.stories.tsx +0 -39
  163. package/src/Inline/Inline.test.tsx +0 -99
  164. package/src/Inline/Inline.tsx +0 -38
  165. package/src/Inline/index.ts +0 -1
  166. package/src/Input/Input.stories.tsx +0 -54
  167. package/src/Input/Input.test.tsx +0 -74
  168. package/src/Input/Input.tsx +0 -25
  169. package/src/Input/index.ts +0 -1
  170. package/src/Label/Label.stories.tsx +0 -41
  171. package/src/Label/Label.test.tsx +0 -109
  172. package/src/Label/Label.tsx +0 -64
  173. package/src/Label/index.ts +0 -1
  174. package/src/Link/Link.stories.tsx +0 -35
  175. package/src/Link/Link.test.tsx +0 -97
  176. package/src/Link/Link.tsx +0 -42
  177. package/src/Link/index.ts +0 -1
  178. package/src/Menu/Menu.stories.tsx +0 -62
  179. package/src/Menu/Menu.test.tsx +0 -84
  180. package/src/Menu/Menu.tsx +0 -51
  181. package/src/Menu/index.ts +0 -1
  182. package/src/MenuItem/MenuItem.stories.tsx +0 -30
  183. package/src/MenuItem/MenuItem.test.tsx +0 -68
  184. package/src/MenuItem/MenuItem.tsx +0 -35
  185. package/src/MenuItem/index.ts +0 -1
  186. package/src/Message/Message.stories.tsx +0 -30
  187. package/src/Message/Message.test.tsx +0 -90
  188. package/src/Message/Message.tsx +0 -55
  189. package/src/Message/index.ts +0 -1
  190. package/src/Provider/MarigoldProvider.test.tsx +0 -136
  191. package/src/Provider/MarigoldProvider.tsx +0 -47
  192. package/src/Provider/index.ts +0 -4
  193. package/src/Radio/Radio.stories.mdx +0 -97
  194. package/src/Radio/Radio.test.tsx +0 -119
  195. package/src/Radio/Radio.tsx +0 -128
  196. package/src/Radio/RadioIcons.tsx +0 -39
  197. package/src/Radio/index.ts +0 -1
  198. package/src/Select/ListBox.tsx +0 -40
  199. package/src/Select/ListBoxSection.tsx +0 -40
  200. package/src/Select/Option.tsx +0 -48
  201. package/src/Select/Popover.tsx +0 -50
  202. package/src/Select/Select.stories.tsx +0 -81
  203. package/src/Select/Select.test.tsx +0 -349
  204. package/src/Select/Select.tsx +0 -174
  205. package/src/Select/index.ts +0 -1
  206. package/src/Slider/Slider.stories.tsx +0 -24
  207. package/src/Slider/Slider.test.tsx +0 -63
  208. package/src/Slider/Slider.tsx +0 -35
  209. package/src/Slider/index.ts +0 -1
  210. package/src/Stack/Stack.stories.tsx +0 -57
  211. package/src/Stack/Stack.test.tsx +0 -138
  212. package/src/Stack/Stack.tsx +0 -39
  213. package/src/Stack/index.ts +0 -1
  214. package/src/Text/Text.stories.tsx +0 -61
  215. package/src/Text/Text.test.tsx +0 -99
  216. package/src/Text/Text.tsx +0 -60
  217. package/src/Text/index.ts +0 -1
  218. package/src/Textarea/Textarea.stories.tsx +0 -64
  219. package/src/Textarea/Textarea.test.tsx +0 -95
  220. package/src/Textarea/Textarea.tsx +0 -62
  221. package/src/Textarea/index.ts +0 -1
  222. package/src/ValidationMessage/ValidationMessage.stories.tsx +0 -27
  223. package/src/ValidationMessage/ValidationMessage.test.tsx +0 -68
  224. package/src/ValidationMessage/ValidationMessage.tsx +0 -40
  225. package/src/ValidationMessage/index.ts +0 -1
  226. package/src/VisuallyHidden/VisuallyHidden.stories.tsx +0 -19
  227. package/src/VisuallyHidden/VisuallyHidden.test.tsx +0 -10
  228. package/src/VisuallyHidden/VisuallyHidden.tsx +0 -1
  229. package/src/VisuallyHidden/index.ts +0 -1
  230. package/src/index.ts +0 -34
  231. package/src/theme.ts +0 -50
  232. package/tsconfig.build.json +0 -3
@@ -1,27 +0,0 @@
1
- import React from 'react';
2
- import type { Meta, ComponentStory } from '@storybook/react';
3
- import { ValidationMessage } from './ValidationMessage';
4
- import { Exclamation } from '@marigold/icons';
5
-
6
- export default {
7
- title: 'Components/ValidationMessage',
8
- argTypes: {
9
- variant: {
10
- control: {
11
- type: 'text',
12
- },
13
- table: {
14
- defaultValue: {
15
- summary: 'error',
16
- },
17
- },
18
- },
19
- },
20
- } as Meta;
21
-
22
- export const Basic: ComponentStory<typeof ValidationMessage> = args => (
23
- <ValidationMessage {...args}>
24
- <Exclamation />
25
- Validation message
26
- </ValidationMessage>
27
- );
@@ -1,68 +0,0 @@
1
- import React from 'react';
2
- import { render, screen } from '@testing-library/react';
3
- import { ThemeProvider } from '@marigold/system';
4
- import { ValidationMessage } from './ValidationMessage';
5
-
6
- const theme = {
7
- space: {
8
- none: 0,
9
- small: 4,
10
- medium: 8,
11
- },
12
- validation: {
13
- error: {
14
- p: 'medium',
15
- },
16
- warning: {
17
- p: 'small',
18
- },
19
- },
20
- };
21
-
22
- test('supports default variant and themeSection', () => {
23
- render(
24
- <ThemeProvider theme={theme}>
25
- <ValidationMessage title="error">error</ValidationMessage>
26
- </ThemeProvider>
27
- );
28
- const validation = screen.getByTitle(/error/);
29
-
30
- expect(validation).toHaveStyle(`padding: 8px`);
31
- });
32
-
33
- test('accepts other variant than default', () => {
34
- render(
35
- <ThemeProvider theme={theme}>
36
- <ValidationMessage title="warning" variant="warning">
37
- warning
38
- </ValidationMessage>
39
- </ThemeProvider>
40
- );
41
- const validation = screen.getByTitle(/warning/);
42
-
43
- expect(validation).toHaveStyle(`padding: 4px`);
44
- });
45
-
46
- test('renders correct HTML element', () => {
47
- render(
48
- <ThemeProvider theme={theme}>
49
- <ValidationMessage title="error">error</ValidationMessage>
50
- </ThemeProvider>
51
- );
52
- const validation = screen.getByTitle(/error/);
53
-
54
- expect(validation instanceof HTMLSpanElement).toBeTruthy();
55
- });
56
-
57
- test('accepts custom styles prop className', () => {
58
- render(
59
- <ThemeProvider theme={theme}>
60
- <ValidationMessage className="custom-class-name" title="validation">
61
- validation
62
- </ValidationMessage>
63
- </ThemeProvider>
64
- );
65
- const validation = screen.getByTitle(/validation/);
66
-
67
- expect(validation.className).toMatch('custom-class-name');
68
- });
@@ -1,40 +0,0 @@
1
- import React from 'react';
2
- import { ComponentProps } from '@marigold/types';
3
-
4
- import { Box } from '../Box';
5
-
6
- // Theme Extension
7
- // ---------------
8
- export interface ValidationMessageThemeExtension<Value> {
9
- validation?: {
10
- [key: string]: Value;
11
- };
12
- }
13
-
14
- // Props
15
- // ---------------
16
- export type ValidationMessageProps = {
17
- variant?: string;
18
- } & ComponentProps<'span'>;
19
-
20
- // Component
21
- // ---------------
22
- export const ValidationMessage: React.FC<ValidationMessageProps> = ({
23
- variant = 'error',
24
- children,
25
- className,
26
- ...props
27
- }) => {
28
- return (
29
- <Box
30
- as="span"
31
- display="flex"
32
- alignItems="center"
33
- variant={`validation.${variant}`}
34
- className={className}
35
- {...props}
36
- >
37
- {children}
38
- </Box>
39
- );
40
- };
@@ -1 +0,0 @@
1
- export * from './ValidationMessage';
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
- import type { Meta, ComponentStory } from '@storybook/react';
3
-
4
- import { VisuallyHidden } from './VisuallyHidden';
5
- import { Text } from '../Text';
6
-
7
- export default {
8
- title: 'Components/Hidden',
9
- } as Meta;
10
-
11
- export const Basic: ComponentStory<typeof VisuallyHidden> = ({
12
- children,
13
- ...args
14
- }) => (
15
- <>
16
- <Text>The Text below is visually hidden</Text>
17
- <VisuallyHidden {...args}>Invisible!</VisuallyHidden>
18
- </>
19
- );
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { render, screen } from '@testing-library/react';
3
- import { VisuallyHidden } from './VisuallyHidden';
4
-
5
- test('is visually hidden', () => {
6
- render(<VisuallyHidden>Default</VisuallyHidden>);
7
- const hidden = screen.getByText('Default');
8
-
9
- expect(hidden).toHaveStyle(`overflow: hidden`);
10
- });
@@ -1 +0,0 @@
1
- export { VisuallyHidden } from '@react-aria/visually-hidden';
@@ -1 +0,0 @@
1
- export * from './VisuallyHidden';
package/src/index.ts DELETED
@@ -1,34 +0,0 @@
1
- export * from './theme';
2
-
3
- export * from './ActionGroup';
4
- export * from './Alert';
5
- export * from './Badge';
6
- export * from './Box';
7
- export * from './Button';
8
- export * from './Card';
9
- export * from './Checkbox';
10
- export * from './Column';
11
- export * from './Columns';
12
- export * from './Dialog';
13
- export * from './Divider';
14
- export * from './Field';
15
- export * from './VisuallyHidden';
16
- export * from './Image';
17
- export * from './Inline';
18
- export * from './Label';
19
- export * from './Link';
20
- export * from './Menu';
21
- export * from './MenuItem';
22
- export * from './Message';
23
- export * from './Provider';
24
- export * from './Radio';
25
- export * from './Slider';
26
- export * from './Select';
27
- export * from './Stack';
28
- export * from './Text';
29
- export * from './Textarea';
30
- export * from './Input';
31
- export * from './Container';
32
- export * from './ValidationMessage';
33
-
34
- export { Item, Section } from '@react-stately/collections';
package/src/theme.ts DELETED
@@ -1,50 +0,0 @@
1
- import { type CSSObject, type Theme as Scales } from '@marigold/system';
2
-
3
- // Provider
4
- // ---------------
5
- import { type RootThemeExtension } from './Provider';
6
-
7
- // Components
8
- // ---------------
9
- import { type AlertThemeExtension } from './Alert';
10
- import { type BadgeThemeExtension } from './Badge';
11
- import { type ButtonThemeExtension } from './Button';
12
- import { type CardThemeExtension } from './Card';
13
- import { type CheckboxThemeExtension } from './Checkbox';
14
- import { type DividerThemeExtension } from './Divider';
15
- import { type ImageThemeExtension } from './Image';
16
- import { type InputThemeExtension } from './Input';
17
- import { type LabelThemeExtension } from './Label';
18
- import { type LinkThemeExtension } from './Link';
19
- import { type MenuThemeExtension } from './Menu';
20
- import { type MenuItemThemeExtension } from './MenuItem';
21
- import { type MessageThemeExtension } from './Message';
22
- import { type RadioThemeExtension } from './Radio';
23
- import { type SelectThemeExtension } from './Select';
24
- import { type SliderThemeExtension } from './Slider';
25
- import { type TextThemeExtension } from './Text';
26
- import { type TextareaThemeExtension } from './Textarea';
27
- import { type ValidationMessageThemeExtension } from './ValidationMessage';
28
-
29
- export interface Theme
30
- extends Scales,
31
- RootThemeExtension<CSSObject>,
32
- AlertThemeExtension<CSSObject>,
33
- BadgeThemeExtension<CSSObject>,
34
- ButtonThemeExtension<CSSObject>,
35
- CardThemeExtension<CSSObject>,
36
- CheckboxThemeExtension<CSSObject>,
37
- DividerThemeExtension<CSSObject>,
38
- ImageThemeExtension<CSSObject>,
39
- InputThemeExtension<CSSObject>,
40
- LabelThemeExtension<CSSObject>,
41
- LinkThemeExtension<CSSObject>,
42
- MenuThemeExtension<CSSObject>,
43
- MenuItemThemeExtension<CSSObject>,
44
- MessageThemeExtension<CSSObject>,
45
- RadioThemeExtension<CSSObject>,
46
- SelectThemeExtension<CSSObject>,
47
- SliderThemeExtension<CSSObject>,
48
- TextThemeExtension<CSSObject>,
49
- TextareaThemeExtension<CSSObject>,
50
- ValidationMessageThemeExtension<CSSObject> {}
@@ -1,3 +0,0 @@
1
- {
2
- "extends": "@marigold/tsconfig"
3
- }