@marigold/components 0.1.0 → 0.3.2
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 +180 -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 +12 -4
- 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 +7 -3
- 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 +3 -0
- 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 +5 -0
- 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 +1068 -601
- 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 +1003 -579
- 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 +22 -3
- 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 +67 -68
- 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 +32 -23
- package/src/Divider/Divider.tsx +27 -7
- 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 +6 -2
- package/src/Link/Link.tsx +12 -1
- 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 +25 -41
- package/src/Text/Text.stories.tsx +61 -0
- package/src/Text/Text.test.tsx +2 -2
- package/src/Text/Text.tsx +25 -14
- 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 -46
- 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 -157
- package/src/Box/index.ts +0 -1
- package/src/Button/Button.stories.mdx +0 -176
- package/src/Checkbox/Checkbox.stories.mdx +0 -81
- 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,59 +1,62 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { Exclamation, Required } from '@marigold/icons';
|
|
2
|
+
import { Exclamation } from '@marigold/icons';
|
|
4
3
|
import { ComponentProps } from '@marigold/types';
|
|
5
4
|
|
|
6
5
|
import { ValidationMessage } from '../ValidationMessage';
|
|
7
6
|
import { Label } from '../Label';
|
|
8
7
|
import { Box } from '../Box';
|
|
9
8
|
|
|
9
|
+
// Theme Extension
|
|
10
|
+
// ---------------
|
|
11
|
+
export interface TextareaThemeExtension<Value> {
|
|
12
|
+
textarea?: {
|
|
13
|
+
[key: string]: Value;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Props
|
|
18
|
+
// ---------------
|
|
10
19
|
export type TextareaProps = {
|
|
11
20
|
variant?: string;
|
|
12
21
|
label?: string;
|
|
13
22
|
htmlFor?: string;
|
|
14
|
-
errorMessage?: string;
|
|
15
23
|
required?: boolean;
|
|
24
|
+
error?: boolean;
|
|
25
|
+
errorMessage?: string;
|
|
16
26
|
} & ComponentProps<'textarea'>;
|
|
17
27
|
|
|
28
|
+
// Component
|
|
29
|
+
// ---------------
|
|
18
30
|
export const Textarea: React.FC<TextareaProps> = ({
|
|
19
|
-
variant = '
|
|
31
|
+
variant = '',
|
|
20
32
|
htmlFor = 'textarea',
|
|
21
33
|
label,
|
|
34
|
+
error,
|
|
22
35
|
errorMessage,
|
|
23
|
-
required
|
|
36
|
+
required,
|
|
24
37
|
className = '',
|
|
25
38
|
children,
|
|
26
39
|
...props
|
|
27
|
-
}) =>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
{
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
/>
|
|
51
|
-
{errorMessage && (
|
|
52
|
-
<ValidationMessage>
|
|
53
|
-
<Exclamation size={16} />
|
|
54
|
-
{errorMessage}
|
|
55
|
-
</ValidationMessage>
|
|
56
|
-
)}
|
|
57
|
-
</Box>
|
|
58
|
-
);
|
|
59
|
-
};
|
|
40
|
+
}) => (
|
|
41
|
+
<Box>
|
|
42
|
+
{label && (
|
|
43
|
+
<Label htmlFor={htmlFor} required={required}>
|
|
44
|
+
{label}
|
|
45
|
+
</Label>
|
|
46
|
+
)}
|
|
47
|
+
<Box
|
|
48
|
+
as="textarea"
|
|
49
|
+
{...props}
|
|
50
|
+
display="block"
|
|
51
|
+
variant={`textarea.${variant}`}
|
|
52
|
+
css={{ outlineColor: error && 'error' }}
|
|
53
|
+
className={className}
|
|
54
|
+
/>
|
|
55
|
+
{error && errorMessage && (
|
|
56
|
+
<ValidationMessage>
|
|
57
|
+
<Exclamation size={16} />
|
|
58
|
+
{errorMessage}
|
|
59
|
+
</ValidationMessage>
|
|
60
|
+
)}
|
|
61
|
+
</Box>
|
|
62
|
+
);
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
);
|
|
@@ -4,12 +4,17 @@ import { ThemeProvider } from '@marigold/system';
|
|
|
4
4
|
import { ValidationMessage } from './ValidationMessage';
|
|
5
5
|
|
|
6
6
|
const theme = {
|
|
7
|
+
space: {
|
|
8
|
+
none: 0,
|
|
9
|
+
small: 4,
|
|
10
|
+
medium: 8,
|
|
11
|
+
},
|
|
7
12
|
validation: {
|
|
8
13
|
error: {
|
|
9
|
-
|
|
14
|
+
p: 'medium',
|
|
10
15
|
},
|
|
11
16
|
warning: {
|
|
12
|
-
|
|
17
|
+
p: 'small',
|
|
13
18
|
},
|
|
14
19
|
},
|
|
15
20
|
};
|
|
@@ -22,7 +27,7 @@ test('supports default variant and themeSection', () => {
|
|
|
22
27
|
);
|
|
23
28
|
const validation = screen.getByTitle(/error/);
|
|
24
29
|
|
|
25
|
-
expect(validation).toHaveStyle(`
|
|
30
|
+
expect(validation).toHaveStyle(`padding: 8px`);
|
|
26
31
|
});
|
|
27
32
|
|
|
28
33
|
test('accepts other variant than default', () => {
|
|
@@ -35,7 +40,7 @@ test('accepts other variant than default', () => {
|
|
|
35
40
|
);
|
|
36
41
|
const validation = screen.getByTitle(/warning/);
|
|
37
42
|
|
|
38
|
-
expect(validation).toHaveStyle(`
|
|
43
|
+
expect(validation).toHaveStyle(`padding: 4px`);
|
|
39
44
|
});
|
|
40
45
|
|
|
41
46
|
test('renders correct HTML element', () => {
|
|
@@ -1,29 +1,40 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { useStyles } from '@marigold/system';
|
|
3
2
|
import { ComponentProps } from '@marigold/types';
|
|
4
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
|
+
// ---------------
|
|
5
16
|
export type ValidationMessageProps = {
|
|
6
17
|
variant?: string;
|
|
7
18
|
} & ComponentProps<'span'>;
|
|
8
19
|
|
|
20
|
+
// Component
|
|
21
|
+
// ---------------
|
|
9
22
|
export const ValidationMessage: React.FC<ValidationMessageProps> = ({
|
|
10
23
|
variant = 'error',
|
|
11
24
|
children,
|
|
12
25
|
className,
|
|
13
26
|
...props
|
|
14
27
|
}) => {
|
|
15
|
-
const classNames = useStyles({
|
|
16
|
-
variant: `validation.${variant}`,
|
|
17
|
-
css: {
|
|
18
|
-
display: 'flex',
|
|
19
|
-
alignItems: 'center',
|
|
20
|
-
},
|
|
21
|
-
className,
|
|
22
|
-
});
|
|
23
|
-
|
|
24
28
|
return (
|
|
25
|
-
<
|
|
29
|
+
<Box
|
|
30
|
+
as="span"
|
|
31
|
+
display="flex"
|
|
32
|
+
alignItems="center"
|
|
33
|
+
variant={`validation.${variant}`}
|
|
34
|
+
className={className}
|
|
35
|
+
{...props}
|
|
36
|
+
>
|
|
26
37
|
{children}
|
|
27
|
-
</
|
|
38
|
+
</Box>
|
|
28
39
|
);
|
|
29
40
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
);
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { VisuallyHidden } from '@react-aria/visually-hidden';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './VisuallyHidden';
|
package/src/index.ts
CHANGED
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
export * from './theme';
|
|
2
2
|
|
|
3
|
+
export * from './ActionGroup';
|
|
3
4
|
export * from './Alert';
|
|
4
5
|
export * from './Badge';
|
|
5
6
|
export * from './Box';
|
|
6
7
|
export * from './Button';
|
|
8
|
+
export * from './Card';
|
|
7
9
|
export * from './Checkbox';
|
|
8
10
|
export * from './Column';
|
|
9
11
|
export * from './Columns';
|
|
10
12
|
export * from './Dialog';
|
|
11
13
|
export * from './Divider';
|
|
12
14
|
export * from './Field';
|
|
13
|
-
export * from './
|
|
14
|
-
export * from './Hidden';
|
|
15
|
+
export * from './VisuallyHidden';
|
|
15
16
|
export * from './Image';
|
|
17
|
+
export * from './Inline';
|
|
16
18
|
export * from './Label';
|
|
17
19
|
export * from './Link';
|
|
18
20
|
export * from './Menu';
|
|
19
21
|
export * from './MenuItem';
|
|
20
22
|
export * from './Message';
|
|
23
|
+
export * from './Provider';
|
|
21
24
|
export * from './Radio';
|
|
22
25
|
export * from './Slider';
|
|
23
26
|
export * from './Select';
|
|
@@ -27,3 +30,5 @@ export * from './Textarea';
|
|
|
27
30
|
export * from './Input';
|
|
28
31
|
export * from './Container';
|
|
29
32
|
export * from './ValidationMessage';
|
|
33
|
+
|
|
34
|
+
export { Item, Section } from '@react-stately/collections';
|
package/src/theme.ts
CHANGED
|
@@ -1,49 +1,50 @@
|
|
|
1
|
-
|
|
1
|
+
import { type CSSObject, type Theme as Scales } from '@marigold/system';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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> {}
|
package/dist/Box/Box.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { ResponsiveStyleValue } from '@marigold/system';
|
|
2
|
-
import { PolymorphicPropsWithRef, PolymorphicComponentWithRef } from '@marigold/types';
|
|
3
|
-
export declare type BoxOwnProps = {
|
|
4
|
-
className?: string;
|
|
5
|
-
variant?: string | string[];
|
|
6
|
-
display?: ResponsiveStyleValue<string>;
|
|
7
|
-
height?: ResponsiveStyleValue<number | string>;
|
|
8
|
-
width?: ResponsiveStyleValue<number | string>;
|
|
9
|
-
minWidth?: ResponsiveStyleValue<number | string>;
|
|
10
|
-
maxWidth?: ResponsiveStyleValue<number | string>;
|
|
11
|
-
position?: ResponsiveStyleValue<string>;
|
|
12
|
-
top?: ResponsiveStyleValue<number | string>;
|
|
13
|
-
bottom?: ResponsiveStyleValue<number | string>;
|
|
14
|
-
right?: ResponsiveStyleValue<number | string>;
|
|
15
|
-
left?: ResponsiveStyleValue<number | string>;
|
|
16
|
-
zIndex?: ResponsiveStyleValue<number | string>;
|
|
17
|
-
p?: ResponsiveStyleValue<number | string>;
|
|
18
|
-
px?: ResponsiveStyleValue<number | string>;
|
|
19
|
-
py?: ResponsiveStyleValue<number | string>;
|
|
20
|
-
pt?: ResponsiveStyleValue<number | string>;
|
|
21
|
-
pb?: ResponsiveStyleValue<number | string>;
|
|
22
|
-
pl?: ResponsiveStyleValue<number | string>;
|
|
23
|
-
pr?: ResponsiveStyleValue<number | string>;
|
|
24
|
-
m?: ResponsiveStyleValue<number | string>;
|
|
25
|
-
mx?: ResponsiveStyleValue<number | string>;
|
|
26
|
-
my?: ResponsiveStyleValue<number | string>;
|
|
27
|
-
mt?: ResponsiveStyleValue<number | string>;
|
|
28
|
-
mb?: ResponsiveStyleValue<number | string>;
|
|
29
|
-
ml?: ResponsiveStyleValue<number | string>;
|
|
30
|
-
mr?: ResponsiveStyleValue<number | string>;
|
|
31
|
-
flexDirection?: ResponsiveStyleValue<string>;
|
|
32
|
-
flexWrap?: ResponsiveStyleValue<string>;
|
|
33
|
-
flexShrink?: ResponsiveStyleValue<number | string>;
|
|
34
|
-
flexGrow?: ResponsiveStyleValue<number | string>;
|
|
35
|
-
alignItems?: ResponsiveStyleValue<string>;
|
|
36
|
-
justifyContent?: ResponsiveStyleValue<string>;
|
|
37
|
-
bg?: ResponsiveStyleValue<number | string>;
|
|
38
|
-
border?: ResponsiveStyleValue<number | string>;
|
|
39
|
-
borderRadius?: ResponsiveStyleValue<number | string>;
|
|
40
|
-
boxShadow?: ResponsiveStyleValue<number | string>;
|
|
41
|
-
opacity?: ResponsiveStyleValue<number | string>;
|
|
42
|
-
overflow?: ResponsiveStyleValue<string>;
|
|
43
|
-
transition?: ResponsiveStyleValue<number | string>;
|
|
44
|
-
};
|
|
45
|
-
export declare type BoxProps = PolymorphicPropsWithRef<BoxOwnProps, 'div'>;
|
|
46
|
-
export declare const Box: PolymorphicComponentWithRef<BoxOwnProps, 'div'>;
|
package/dist/Box/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Box';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ComponentProps } from '@marigold/types';
|
|
3
|
-
export declare type HeadingProps = {
|
|
4
|
-
as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
5
|
-
variant?: string;
|
|
6
|
-
} & ComponentProps<'h1'>;
|
|
7
|
-
export declare const Heading: React.FC<HeadingProps>;
|
package/dist/Heading/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Heading';
|
package/dist/Hidden/Hidden.d.ts
DELETED
package/dist/Hidden/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Hidden';
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks';
|
|
2
|
-
import { useStyles } from '@marigold/system';
|
|
3
|
-
import { Alert } from './Alert';
|
|
4
|
-
import { Text } from '../Text/';
|
|
5
|
-
|
|
6
|
-
<Meta title="Components/Alert" />
|
|
7
|
-
|
|
8
|
-
# Alert
|
|
9
|
-
|
|
10
|
-
## Description
|
|
11
|
-
|
|
12
|
-
Simple colored element to display an alert message as a reaction to an event.
|
|
13
|
-
Predefined variants are info, success, danger and warning.
|
|
14
|
-
|
|
15
|
-
## Properties
|
|
16
|
-
|
|
17
|
-
| Property | Type | Default |
|
|
18
|
-
| :------------------- | :------------------------ | :-------- |
|
|
19
|
-
| `variant` (optional) | `success, error, warning` | `success` |
|
|
20
|
-
|
|
21
|
-
## Import
|
|
22
|
-
|
|
23
|
-
```tsx
|
|
24
|
-
import { Alert } from '@marigold/components';
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Usage
|
|
28
|
-
|
|
29
|
-
<Canvas>
|
|
30
|
-
<Story name="Success">
|
|
31
|
-
<Alert>
|
|
32
|
-
<Text>Success message</Text>
|
|
33
|
-
</Alert>
|
|
34
|
-
</Story>
|
|
35
|
-
<Story name="Error">
|
|
36
|
-
<Alert variant="error">
|
|
37
|
-
<Text>Error message</Text>
|
|
38
|
-
</Alert>
|
|
39
|
-
</Story>
|
|
40
|
-
<Story name="Warning">
|
|
41
|
-
<Alert variant="warning">
|
|
42
|
-
<Text>Warning message</Text>
|
|
43
|
-
</Alert>
|
|
44
|
-
</Story>
|
|
45
|
-
</Canvas>
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks';
|
|
2
|
-
import { Badge } from './Badge';
|
|
3
|
-
import { Text } from '../Text';
|
|
4
|
-
import { Check } from '@marigold/icons';
|
|
5
|
-
import { useStyles } from '@marigold/system';
|
|
6
|
-
|
|
7
|
-
<Meta title="Components/Badge" />
|
|
8
|
-
|
|
9
|
-
# Badge
|
|
10
|
-
|
|
11
|
-
## Description
|
|
12
|
-
|
|
13
|
-
A badge tags an element with a short note and color. The content of the badge can be anything but preferably a string and/or icon.
|
|
14
|
-
|
|
15
|
-
## Properties
|
|
16
|
-
|
|
17
|
-
| Property | Type | Default |
|
|
18
|
-
| :----------------------- | :------- | :------------ |
|
|
19
|
-
| `variant` (optional) | `string` | `default` |
|
|
20
|
-
| `borderColor` (optional) | `string` | `transparent` |
|
|
21
|
-
| `bgColor` (optional) | `string` | `inherit` |
|
|
22
|
-
|
|
23
|
-
## Import
|
|
24
|
-
|
|
25
|
-
```tsx
|
|
26
|
-
import { Badge } from '@marigold/components';
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## Usage
|
|
30
|
-
|
|
31
|
-
<Canvas>
|
|
32
|
-
<Story name="Colored Background">
|
|
33
|
-
<Badge borderColor="black" bgColor="orange">
|
|
34
|
-
<Text>New</Text>
|
|
35
|
-
</Badge>
|
|
36
|
-
</Story>
|
|
37
|
-
<Story name="Outlined">
|
|
38
|
-
<Badge borderColor="orange" className={useStyles({ display: 'flex' })}>
|
|
39
|
-
<Check size={18} />
|
|
40
|
-
cool
|
|
41
|
-
</Badge>
|
|
42
|
-
</Story>
|
|
43
|
-
</Canvas>
|
package/src/Box/Box.stories.mdx
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks';
|
|
2
|
-
import { Box } from './Box';
|
|
3
|
-
import { Button } from '../Button';
|
|
4
|
-
import { Label } from '../Label';
|
|
5
|
-
|
|
6
|
-
<Meta title="Components/Box" />
|
|
7
|
-
|
|
8
|
-
# Box-Component
|
|
9
|
-
|
|
10
|
-
## Import
|
|
11
|
-
|
|
12
|
-
```js
|
|
13
|
-
import { Box } from '@marigold/components';
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## Usage
|
|
17
|
-
|
|
18
|
-
<Canvas>
|
|
19
|
-
<Story name="div-box">
|
|
20
|
-
<Box>I am basic box!</Box>
|
|
21
|
-
</Story>
|
|
22
|
-
</Canvas>
|
|
23
|
-
|
|
24
|
-
<Canvas>
|
|
25
|
-
<Story name="button-box">
|
|
26
|
-
<Box as="button" bg="primary">
|
|
27
|
-
I am a button box!
|
|
28
|
-
</Box>
|
|
29
|
-
</Story>
|
|
30
|
-
</Canvas>
|
|
31
|
-
|
|
32
|
-
<Canvas>
|
|
33
|
-
<Story name="h1-box">
|
|
34
|
-
<Box as="h1" p="3">
|
|
35
|
-
I am a blue headline!
|
|
36
|
-
</Box>
|
|
37
|
-
</Story>
|
|
38
|
-
</Canvas>
|