@marigold/components 0.1.0 → 0.2.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 (112) hide show
  1. package/dist/ActionGroup/ActionGroup.d.ts +9 -0
  2. package/dist/ActionGroup/index.d.ts +1 -0
  3. package/dist/Alert/Alert.d.ts +16 -1
  4. package/dist/Box/Box.d.ts +2 -1
  5. package/dist/Button/Button.d.ts +4 -6
  6. package/dist/Card/Card.d.ts +9 -0
  7. package/dist/Card/index.d.ts +1 -0
  8. package/dist/Checkbox/Checkbox.d.ts +3 -0
  9. package/dist/Checkbox/CheckboxIcons.d.ts +9 -0
  10. package/dist/Column/Column.d.ts +3 -1
  11. package/dist/Dialog/Dialog.d.ts +8 -1
  12. package/dist/Dialog/ModalDialog.d.ts +5 -0
  13. package/dist/Field/Field.d.ts +4 -2
  14. package/dist/Label/Label.d.ts +2 -1
  15. package/dist/Provider/MarigoldProvider.d.ts +3 -0
  16. package/dist/Provider/index.d.ts +3 -0
  17. package/dist/Radio/Radio.d.ts +3 -0
  18. package/dist/Radio/RadioIcons.d.ts +9 -0
  19. package/dist/Select/ListBox.d.ts +8 -0
  20. package/dist/Select/ListBoxSection.d.ts +8 -0
  21. package/dist/Select/Option.d.ts +8 -0
  22. package/dist/Select/Popover.d.ts +9 -0
  23. package/dist/Select/Select.d.ts +11 -4
  24. package/dist/Stack/Stack.d.ts +1 -3
  25. package/dist/Textarea/Textarea.d.ts +2 -1
  26. package/dist/components.cjs.development.js +868 -357
  27. package/dist/components.cjs.development.js.map +1 -1
  28. package/dist/components.cjs.production.min.js +1 -1
  29. package/dist/components.cjs.production.min.js.map +1 -1
  30. package/dist/components.esm.js +837 -359
  31. package/dist/components.esm.js.map +1 -1
  32. package/dist/index.d.ts +4 -0
  33. package/package.json +18 -3
  34. package/src/ActionGroup/ActionGroup.stories.mdx +62 -0
  35. package/src/ActionGroup/ActionGroup.test.tsx +83 -0
  36. package/src/ActionGroup/ActionGroup.tsx +43 -0
  37. package/src/ActionGroup/index.ts +1 -0
  38. package/src/Alert/Alert.stories.mdx +28 -38
  39. package/src/Alert/Alert.test.tsx +1 -1
  40. package/src/Alert/Alert.tsx +11 -33
  41. package/src/Badge/Badge.stories.mdx +48 -34
  42. package/src/Badge/Badge.test.tsx +7 -15
  43. package/src/Badge/Badge.tsx +1 -2
  44. package/src/Box/Box.stories.mdx +322 -26
  45. package/src/Box/Box.tsx +58 -50
  46. package/src/Button/Button.stories.mdx +54 -166
  47. package/src/Button/Button.test.tsx +48 -8
  48. package/src/Button/Button.tsx +47 -18
  49. package/src/Card/Card.stories.mdx +49 -0
  50. package/src/Card/Card.test.tsx +66 -0
  51. package/src/Card/Card.tsx +36 -0
  52. package/src/Card/index.ts +1 -0
  53. package/src/Checkbox/Checkbox.stories.mdx +76 -71
  54. package/src/Checkbox/Checkbox.test.tsx +70 -24
  55. package/src/Checkbox/Checkbox.tsx +68 -49
  56. package/src/Checkbox/CheckboxIcons.tsx +49 -0
  57. package/src/Column/Column.stories.mdx +39 -64
  58. package/src/Column/Column.test.tsx +8 -0
  59. package/src/Column/Column.tsx +12 -2
  60. package/src/Columns/Columns.stories.mdx +58 -240
  61. package/src/Container/Container.stories.mdx +8 -25
  62. package/src/Dialog/Dialog.stories.mdx +65 -56
  63. package/src/Dialog/Dialog.test.tsx +64 -24
  64. package/src/Dialog/Dialog.tsx +64 -12
  65. package/src/Dialog/ModalDialog.tsx +47 -0
  66. package/src/Divider/Divider.stories.mdx +28 -34
  67. package/src/Field/Field.stories.mdx +88 -48
  68. package/src/Field/Field.test.tsx +31 -40
  69. package/src/Field/Field.tsx +26 -21
  70. package/src/Heading/Heading.stories.mdx +30 -82
  71. package/src/Hidden/Hidden.stories.mdx +29 -54
  72. package/src/Image/Image.stories.mdx +26 -30
  73. package/src/Input/Input.stories.mdx +52 -36
  74. package/src/Label/Label.stories.mdx +47 -29
  75. package/src/Label/Label.test.tsx +15 -1
  76. package/src/Label/Label.tsx +20 -7
  77. package/src/Link/Link.stories.mdx +36 -29
  78. package/src/Menu/Menu.stories.mdx +71 -39
  79. package/src/Menu/Menu.test.tsx +4 -4
  80. package/src/Menu/Menu.tsx +12 -14
  81. package/src/MenuItem/MenuItem.stories.mdx +32 -27
  82. package/src/MenuItem/MenuItem.test.tsx +15 -11
  83. package/src/MenuItem/MenuItem.tsx +7 -10
  84. package/src/Message/Message.stories.mdx +35 -35
  85. package/src/Message/Message.tsx +2 -10
  86. package/src/Provider/MarigoldProvider.test.tsx +126 -0
  87. package/src/Provider/MarigoldProvider.tsx +29 -0
  88. package/src/Provider/index.ts +3 -0
  89. package/src/Radio/Radio.stories.mdx +78 -92
  90. package/src/Radio/Radio.test.tsx +57 -15
  91. package/src/Radio/Radio.tsx +71 -51
  92. package/src/Radio/RadioIcons.tsx +39 -0
  93. package/src/Select/ListBox.tsx +39 -0
  94. package/src/Select/ListBoxSection.tsx +40 -0
  95. package/src/Select/Option.tsx +48 -0
  96. package/src/Select/Popover.tsx +50 -0
  97. package/src/Select/Select.stories.mdx +70 -36
  98. package/src/Select/Select.test.tsx +279 -35
  99. package/src/Select/Select.tsx +151 -18
  100. package/src/Slider/Slider.stories.mdx +22 -49
  101. package/src/Stack/Stack.stories.mdx +40 -94
  102. package/src/Stack/Stack.test.tsx +84 -65
  103. package/src/Stack/Stack.tsx +25 -41
  104. package/src/Text/Text.stories.mdx +52 -52
  105. package/src/Text/Text.tsx +13 -14
  106. package/src/Textarea/Textarea.stories.mdx +65 -56
  107. package/src/Textarea/Textarea.test.tsx +4 -5
  108. package/src/Textarea/Textarea.tsx +28 -37
  109. package/src/ValidationMessage/ValidationMessage.stories.mdx +26 -26
  110. package/src/ValidationMessage/ValidationMessage.test.tsx +4 -4
  111. package/src/ValidationMessage/ValidationMessage.tsx +11 -12
  112. package/src/index.ts +5 -0
@@ -1,105 +1,51 @@
1
- import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks';
2
- import { Button } from '../Button';
1
+ import { ArgsTable, Canvas, Meta, Story } from '@storybook/addon-docs';
3
2
  import { Heading } from '../Heading';
4
3
  import { Stack } from './Stack';
5
4
  import { Text } from '../Text';
6
- import { Box } from '../Box';
7
- import { useStyles } from '@marigold/system';
8
5
 
9
- <Meta title="Components/Stack" />
6
+ <Meta
7
+ title="Components/Stack"
8
+ argTypes={{
9
+ space: {
10
+ control: {
11
+ type: 'text',
12
+ },
13
+ description: 'Responsive Style Value',
14
+ table: {
15
+ defaultValue: {
16
+ summary: '0',
17
+ },
18
+ },
19
+ },
20
+ align: {
21
+ control: {
22
+ type: 'select',
23
+ },
24
+ options: ['left', 'right', 'center'],
25
+ description: 'HTML element style',
26
+ table: {
27
+ defaultValue: {
28
+ summary: 'left',
29
+ },
30
+ },
31
+ },
32
+ }}
33
+ />
10
34
 
11
35
  # Stack
12
36
 
13
- ## Description
14
-
15
- Layout component to stack elements. This component uses the spaces from the given theme.
16
-
17
- ## Properties
18
-
19
- | Property | Type | Default |
20
- | :------- | :--------------------------------------------- | :------ |
21
- | `space` | `ResponsiveStyleValue<number `&#124;` string>` | `0` |
22
- | `align` | `left, right, center` | `left` |
23
-
24
- ## Import
25
-
26
- ```tsx
27
- import { Stack } from '@marigold/components';
28
- ```
29
-
30
- ## Usage
31
-
32
- ### Spacing
37
+ export const Template = args => (
38
+ <Stack {...args}>
39
+ <Heading>Heading</Heading>
40
+ <Text>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse
41
+ dignissim dapibus elit, vel egestas felis pharetra non. Cras
42
+ malesuada, massa nec ultricies efficitur, lectus ante consequat magna,
43
+ a porttitor massa ex ut quam.</Text>
44
+ </Stack>
45
+ );
33
46
 
34
47
  <Canvas>
35
- <Story name="Example 1">
36
- <Stack space={4} className={useStyles({ bg: '#f3f3f3' })}>
37
- <Heading>Header</Heading>
38
- <Text>
39
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse
40
- dignissim dapibus elit, vel egestas felis pharetra non. Cras malesuada,
41
- massa nec ultricies efficitur, lectus ante consequat magna, a porttitor
42
- massa ex ut quam.
43
- </Text>
44
- <Text>
45
- Phasellus ipsum tortor, aliquet dapibus fermentum in, mollis vel metus.
46
- Vestibulum malesuada ante eu velit malesuada, nec ultricies sapien
47
- finibus. Aenean rutrum in sem a ullamcorper. Integer ut euismod urna.
48
- Interdum et malesuada fames ac ante ipsum primis in faucibus.
49
- </Text>
50
- </Stack>
51
- </Story>
48
+ <Story name="Default">{Template.bind({})}</Story>
52
49
  </Canvas>
53
50
 
54
- ### Alignment
55
-
56
- <Canvas>
57
- <Story name="Example 2">
58
- <Stack space={2}>
59
- <Text
60
- className={useStyles({ width: '100px', border: '1px solid', p: 2 })}
61
- >
62
- Left
63
- </Text>
64
- </Stack>
65
- <Stack space={2} align="center">
66
- <Text
67
- className={useStyles({ width: '100px', border: '1px solid', p: 2 })}
68
- >
69
- Center
70
- </Text>
71
- </Stack>
72
- <Stack space={2} align="right">
73
- <Text
74
- className={useStyles({ width: '100px', border: '1px solid', p: 2 })}
75
- >
76
- Right
77
- </Text>
78
- </Stack>
79
- </Story>
80
- </Canvas>
81
-
82
- ### Nested
83
-
84
- <Canvas>
85
- <Story name="Example 3">
86
- <Stack space={6}>
87
- <Stack>
88
- <Heading>Stack Content #1</Heading>
89
- <Text>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</Text>
90
- <Text>
91
- Phasellus ipsum tortor, aliquet dapibus fermentum in, mollis vel
92
- metus.
93
- </Text>
94
- </Stack>
95
- <Stack>
96
- <Heading>Stack Content #2</Heading>
97
- <Text>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</Text>
98
- <Text>
99
- Phasellus ipsum tortor, aliquet dapibus fermentum in, mollis vel
100
- metus.
101
- </Text>
102
- </Stack>
103
- </Stack>
104
- </Story>
105
- </Canvas>
51
+ <ArgsTable story="Default" />
@@ -1,110 +1,129 @@
1
1
  import React from 'react';
2
2
  import { render, screen } from '@testing-library/react';
3
+ import { ThemeProvider } from '@marigold/system';
4
+
3
5
  import { Stack } from './Stack';
4
6
  import { Text } from '../Text';
5
7
 
6
- test('supports default space prop', () => {
8
+ // Setup
9
+ // ---------------
10
+ const theme = {
11
+ space: {
12
+ none: 0,
13
+ small: 2,
14
+ medium: 4,
15
+ large: 8,
16
+ },
17
+ };
18
+
19
+ test('default space is "none"', () => {
7
20
  render(
8
- <Stack title="stack">
9
- <Text>stack</Text>
10
- </Stack>
21
+ <ThemeProvider theme={theme}>
22
+ <Stack>
23
+ <Text>first</Text>
24
+ <Text>second</Text>
25
+ </Stack>
26
+ </ThemeProvider>
11
27
  );
12
- const stack = screen.getByTitle(/stack/);
28
+ const first = screen.getByText(/first/);
29
+ const second = screen.getByText(/second/);
13
30
 
14
- expect(stack).toHaveStyle(`padding: 0px`);
31
+ expect(first).toHaveStyle(`padding-top: 0px`);
32
+ expect(second).toHaveStyle(`padding-top: 0px`);
15
33
  });
16
34
 
17
- test('supports custom space prop', () => {
35
+ test('accepts and uses spacing from theme', () => {
18
36
  render(
19
- <Stack space={2} title="stack">
20
- <Text>stack</Text>
21
- </Stack>
37
+ <ThemeProvider theme={theme}>
38
+ <Stack space="small">
39
+ <Text>first</Text>
40
+ <Text>second</Text>
41
+ </Stack>
42
+ </ThemeProvider>
22
43
  );
23
- const stack = screen.getByTitle(/stack/);
24
-
25
- expect(stack).toHaveStyle(`padding: 8px`);
26
- });
27
-
28
- test('supports default prop align: left', () => {
29
- render(<Stack title="stack">stack</Stack>);
30
- const stack = screen.getByText(/stack/);
44
+ const first = screen.getByText(/first/);
45
+ const second = screen.getByText(/second/);
31
46
 
32
- expect(stack).toHaveStyle(`align-items: flex-start`);
47
+ expect(first.parentElement).toHaveStyle(`padding-top: 0px`);
48
+ expect(second.parentElement).toHaveStyle(`padding-top: 2px`);
33
49
  });
34
50
 
35
- test('supports custom prop align: center', () => {
51
+ test('aligns children left by default', () => {
36
52
  render(
37
- <Stack align="center" title="stack">
38
- stack
53
+ <Stack data-testid="stack">
54
+ <Text>first</Text>
39
55
  </Stack>
40
56
  );
41
- const stack = screen.getByText(/stack/);
57
+ const stack = screen.getByTestId('stack');
42
58
 
43
- expect(stack).toHaveStyle(`align-items: center`);
59
+ expect(stack).toHaveStyle(`align-items: flex-start`);
44
60
  });
45
61
 
46
- test('supports custom prop align: right', () => {
62
+ test('allows to aligns children to the center', () => {
47
63
  render(
48
- <Stack align="right" title="stack">
49
- stack
64
+ <Stack align="center" data-testid="stack">
65
+ <Text>first</Text>
50
66
  </Stack>
51
67
  );
52
- const stack = screen.getByText(/stack/);
68
+ const stack = screen.getByTestId('stack');
53
69
 
54
- expect(stack).toHaveStyle(`align-items: flex-end`);
70
+ expect(stack).toHaveStyle(`align-items: center`);
55
71
  });
56
72
 
57
- test('supports two children', () => {
73
+ test('allows to aligns children to the right', () => {
58
74
  render(
59
- <Stack title="stack">
60
- <Text>stackText</Text>
61
- <Text>secondStackText</Text>
75
+ <Stack align="right" data-testid="stack">
76
+ <Text>first</Text>
62
77
  </Stack>
63
78
  );
64
- const stack = screen.getByTitle(/stack/);
65
- const stackText = screen.getByText(/stackText/);
66
- const secondStackText = screen.getByText(/secondStackText/);
79
+ const stack = screen.getByTestId('stack');
67
80
 
68
- expect(stack).toBeDefined();
69
- expect(stackText).toBeDefined();
70
- expect(secondStackText).toBeDefined();
81
+ expect(stack).toHaveStyle(`align-items: flex-end`);
71
82
  });
72
83
 
73
- test('supports nested children', () => {
84
+ test('supports nesting', () => {
74
85
  render(
75
- <Stack title="stack">
76
- <Stack title="nested">
77
- <Text>text</Text>
86
+ <ThemeProvider theme={theme}>
87
+ <Stack space="large">
88
+ <Stack space="small" data-testid="upperStack">
89
+ <Text>first</Text>
90
+ <Text>second</Text>
91
+ </Stack>
92
+ <Stack space="small" data-testid="lowerStack">
93
+ <Text>third</Text>
94
+ <Text>fourth</Text>
95
+ </Stack>
78
96
  </Stack>
79
- </Stack>
97
+ </ThemeProvider>
80
98
  );
81
- const stack = screen.getByTitle(/stack/);
82
- const nested = screen.getByTitle(/nested/);
83
- const text = screen.getByText(/text/);
99
+ const first = screen.getByText(/first/);
100
+ const second = screen.getByText(/second/);
101
+ const upperStack = screen.getByTestId('upperStack');
84
102
 
85
- expect(stack).toBeDefined();
86
- expect(nested).toBeDefined();
87
- expect(text).toBeDefined();
88
- });
103
+ const third = screen.getByText(/third/);
104
+ const fourth = screen.getByText(/fourth/);
105
+ const lowerStack = screen.getByTestId('lowerStack');
89
106
 
90
- test('renders correct HTML element', () => {
91
- render(
92
- <Stack title="stack">
93
- <Text>sdf</Text>
94
- </Stack>
95
- );
96
- const stack = screen.getByTitle(/stack/);
107
+ expect(upperStack.parentElement).toHaveStyle(`padding-top: 0px`);
108
+ expect(lowerStack.parentElement).toHaveStyle(`padding-top: 8px`);
97
109
 
98
- expect(stack instanceof HTMLDivElement).toBeTruthy();
110
+ expect(first.parentElement).toHaveStyle(`padding-top: 0px`);
111
+ expect(second.parentElement).toHaveStyle(`padding-top: 2px`);
112
+
113
+ expect(third.parentElement).toHaveStyle(`padding-top: 0px`);
114
+ expect(fourth.parentElement).toHaveStyle(`padding-top: 2px`);
99
115
  });
100
116
 
101
- test('accepts custom styles prop className', () => {
117
+ test('renders as div per default', () => {
102
118
  render(
103
- <Stack className="custom-class-name" title="stack">
104
- <Text>text</Text>
105
- </Stack>
119
+ <ThemeProvider theme={theme}>
120
+ <Stack data-testid="stack">
121
+ <Text>first</Text>
122
+ <Text>second</Text>
123
+ </Stack>
124
+ </ThemeProvider>
106
125
  );
107
- const stack = screen.getByTitle(/stack/);
108
126
 
109
- expect(stack.className).toMatch('custom-class-name');
127
+ const stack = screen.getByTestId('stack');
128
+ expect(stack instanceof HTMLDivElement).toBeTruthy();
110
129
  });
@@ -1,55 +1,39 @@
1
1
  import React, { Children } from 'react';
2
+ import flattenChildren from 'react-keyed-flatten-children';
3
+
2
4
  import { ResponsiveStyleValue } from '@marigold/system';
5
+
3
6
  import { Box } from '../Box';
4
- import flattenChildren from 'react-keyed-flatten-children';
5
7
 
6
8
  export type StackProps = {
7
- className?: string;
8
- space?: ResponsiveStyleValue<number | string>;
9
+ space?: ResponsiveStyleValue<string>;
9
10
  align?: 'left' | 'right' | 'center';
10
- title?: string; // For Testing
11
11
  };
12
12
 
13
- const ALIGN_STYLES = {
14
- left: {
15
- display: 'block',
16
- flexDirection: 'row',
17
- alignItems: 'flex-start',
18
- },
19
- center: {
20
- display: 'flex',
21
- flexDirection: 'column',
22
- alignItems: 'center',
23
- },
24
- right: {
25
- display: 'flex',
26
- flexDirection: 'column',
27
- alignItems: 'flex-end',
28
- },
13
+ const ALIGNMENT = {
14
+ left: 'flex-start',
15
+ center: 'center',
16
+ right: 'flex-end',
29
17
  };
30
18
 
31
19
  export const Stack: React.FC<StackProps> = ({
32
- space = 0,
20
+ space = 'none',
33
21
  align = 'left',
34
22
  children,
35
23
  ...props
36
- }) => {
37
- const stackItems = flattenChildren(children);
38
- const { display, flexDirection, alignItems } = ALIGN_STYLES[align];
39
-
40
- return (
41
- <Box p={space} display={display} flexDirection={flexDirection} {...props}>
42
- {Children.map(stackItems, (child, index) => (
43
- <Box
44
- display={display}
45
- flexDirection={flexDirection}
46
- alignItems={alignItems}
47
- pt={space}
48
- mt={index === 0 ? -space! : 0}
49
- >
50
- {child}
51
- </Box>
52
- ))}
53
- </Box>
54
- );
55
- };
24
+ }) => (
25
+ <Box
26
+ {...props}
27
+ display="flex"
28
+ flexDirection="column"
29
+ alignItems={ALIGNMENT[align]}
30
+ css={{ '> * + *': { pt: space } }}
31
+ >
32
+ {Children.map(
33
+ flattenChildren(children) as unknown as React.ReactElement,
34
+ (child: React.ReactElement) => (
35
+ <Box>{React.cloneElement(child, {}, child.props.children)}</Box>
36
+ )
37
+ )}
38
+ </Box>
39
+ );
@@ -1,60 +1,60 @@
1
- import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks';
1
+ import { ArgsTable, Canvas, Meta, Story } from '@storybook/addon-docs';
2
2
  import { Text } from './Text';
3
- import { useStyles } from '@marigold/system';
4
3
 
5
- <Meta title="Components/Text" />
4
+ <Meta
5
+ title="Components/Text"
6
+ argTypes={{
7
+ as: {
8
+ control: {
9
+ type: 'select',
10
+ },
11
+ options: ['span', 'p'],
12
+ description: 'Set inline',
13
+ table: {
14
+ defaultValue: {
15
+ summary: 'span',
16
+ },
17
+ },
18
+ },
19
+ variant: {
20
+ control: {
21
+ type: 'select',
22
+ },
23
+ options: ['body', 'heading'],
24
+ description: 'Doesnt matter',
25
+ table: {
26
+ defaultValue: {
27
+ summary: 'body',
28
+ },
29
+ },
30
+ },
31
+ color: {
32
+ control: {
33
+ type: 'text',
34
+ },
35
+ description: 'Text color',
36
+ table: {
37
+ defaultValue: {
38
+ summary: 'inherit',
39
+ },
40
+ },
41
+ },
42
+ }}
43
+ />
6
44
 
7
45
  # Text
8
46
 
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
- | `color` (optional) | string | `inherit` |
21
-
22
- ## Import
23
-
24
- ```tsx
25
- import { Text } from '@marigold/components';
26
- ```
27
-
28
- ## Usage
47
+ export const Template = args => (
48
+ <Text {...args}>
49
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse
50
+ dignissim dapibus elit, vel egestas felis pharetra non. Cras malesuada,
51
+ massa nec ultricies efficitur, lectus ante consequat magna, a porttitor
52
+ massa ex ut quam.
53
+ </Text>
54
+ );
29
55
 
30
56
  <Canvas>
31
- <Story name="body">
32
- <Text className={useStyles({ bg: '#f3f3f3' })}>
33
- SPAN: Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
34
- nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed
35
- diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
36
- Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor
37
- sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed
38
- diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
39
- erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea
40
- rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum
41
- dolor sit amet.
42
- </Text>
43
- </Story>
44
- <Story name="heading">
45
- <Text as="p" variant="heading">
46
- P: Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
47
- nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed
48
- diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
49
- Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor
50
- sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed
51
- diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
52
- erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea
53
- rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum
54
- dolor sit amet.
55
- </Text>
56
- </Story>
57
- <Story name="with text color">
58
- <Text color="hotpink">Hello pinkie ;)</Text>
59
- </Story>
57
+ <Story name="Default">{Template.bind({})}</Story>
60
58
  </Canvas>
59
+
60
+ <ArgsTable story="Default" />
package/src/Text/Text.tsx CHANGED
@@ -1,5 +1,5 @@
1
1
  import React, { forwardRef } from 'react';
2
- import { ResponsiveStyleValue, useStyles } from '@marigold/system';
2
+ import { ResponsiveStyleValue } from '@marigold/system';
3
3
  import {
4
4
  PolymorphicComponentWithRef,
5
5
  PolymorphicPropsWithRef,
@@ -33,17 +33,16 @@ export const Text: PolymorphicComponentWithRef<TextOwnProps, 'span'> =
33
33
  ...props
34
34
  },
35
35
  ref
36
- ) => {
37
- const cn = useStyles({
38
- className,
39
- variant: `text.${variant}`,
40
- css: { textAlign: align, color, cursor, outline, userSelect },
41
- });
42
-
43
- return (
44
- <Box {...props} as={as} className={cn} ref={ref}>
45
- {children}
46
- </Box>
47
- );
48
- }
36
+ ) => (
37
+ <Box
38
+ {...props}
39
+ as={as}
40
+ variant={`text.${variant}`}
41
+ css={{ textAlign: align, color, cursor, outline, userSelect }}
42
+ className={className}
43
+ ref={ref}
44
+ >
45
+ {children}
46
+ </Box>
47
+ )
49
48
  );