@jordan-mace/chaser-design-system 2.1.2 → 2.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.
- package/dist/build-manifest.json +3311 -1978
- package/dist/{chunk-DGP64SMQ.mjs → chunk-5EXQ5OSW.mjs} +1 -1
- package/dist/{chunk-HIODYNPY.mjs → chunk-CGKVSHV7.mjs} +0 -1
- package/dist/{chunk-VXRFKQMB.mjs → chunk-CJ5OBPQ7.mjs} +1 -0
- package/dist/{chunk-D62WZ7PJ.mjs → chunk-DLVBLJS5.mjs} +1 -1
- package/dist/{chunk-3AD3E4FY.mjs → chunk-GJTMCP2V.mjs} +1 -4
- package/dist/{chunk-HOWN3CZF.mjs → chunk-GWMUTYRW.mjs} +1 -1
- package/dist/{chunk-DB7I3V3C.mjs → chunk-P6ITY5TK.mjs} +0 -1
- package/dist/{chunk-HG3TXGUV.mjs → chunk-WBE75WTG.mjs} +1 -2
- package/dist/{chunk-P6A62GCQ.mjs → chunk-WV2TDE35.mjs} +1 -4
- package/dist/{chunk-IU6IODBX.mjs → chunk-YKUJ2KUN.mjs} +1 -1
- package/dist/{chunk-KVXPG4QT.mjs → chunk-ZT5III36.mjs} +0 -1
- package/dist/components/Accordion/Accordion.mjs +3 -1
- package/dist/components/Accordion/Accordion.types.mjs +0 -0
- package/dist/components/Accordion/index.mjs +4 -2
- package/dist/components/Alert/Alert.types.mjs +0 -0
- package/dist/components/AspectRatio/AspectRatio.types.mjs +0 -0
- package/dist/components/Avatar/Avatar.types.mjs +0 -0
- package/dist/components/Badge/Badge.mjs +1 -1
- package/dist/components/Badge/Badge.types.mjs +0 -0
- package/dist/components/Badge/index.mjs +1 -1
- package/dist/components/Box/Box.types.mjs +0 -0
- package/dist/components/Breadcrumb/Breadcrumb.mjs +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.types.mjs +0 -0
- package/dist/components/Breadcrumb/index.mjs +1 -1
- package/dist/components/Button/Button.types.mjs +0 -0
- package/dist/components/Card/Card.types.mjs +0 -0
- package/dist/components/Checkbox/Checkbox.types.mjs +0 -0
- package/dist/components/Collapse/Collapse.mjs +1 -1
- package/dist/components/Collapse/Collapse.types.mjs +0 -0
- package/dist/components/Collapse/index.mjs +1 -1
- package/dist/components/Combobox/Combobox.mjs +1 -1
- package/dist/components/Combobox/Combobox.types.mjs +0 -0
- package/dist/components/Combobox/index.mjs +1 -1
- package/dist/components/Container/Container.types.mjs +0 -0
- package/dist/components/Divider/Divider.mjs +1 -1
- package/dist/components/Divider/Divider.types.mjs +0 -0
- package/dist/components/Divider/index.mjs +1 -1
- package/dist/components/Drawer/Drawer.types.mjs +0 -0
- package/dist/components/DropdownMenu/DropdownMenu.types.mjs +0 -0
- package/dist/components/EmptyState/EmptyState.types.mjs +0 -0
- package/dist/components/FileUpload/FileUpload.mjs +1 -1
- package/dist/components/FileUpload/FileUpload.types.mjs +0 -0
- package/dist/components/FileUpload/index.mjs +1 -1
- package/dist/components/Form/Form.types.mjs +0 -0
- package/dist/components/Form/FormInput.mjs +38 -38
- package/dist/components/Form/FormInput.types.mjs +0 -0
- package/dist/components/Form/index.mjs +38 -38
- package/dist/components/Grid/Grid.types.mjs +0 -0
- package/dist/components/Icon/Icon.types.mjs +0 -0
- package/dist/components/Input/Input.types.mjs +0 -0
- package/dist/components/Kbd/Kbd.types.mjs +0 -0
- package/dist/components/List/List.mjs +1 -1
- package/dist/components/List/List.types.mjs +0 -0
- package/dist/components/List/ListItem.mjs +1 -1
- package/dist/components/List/ListItem.types.mjs +0 -0
- package/dist/components/List/index.mjs +2 -2
- package/dist/components/Modal/Modal.types.mjs +0 -0
- package/dist/components/Navbar/Navbar.types.mjs +0 -0
- package/dist/components/Navbar/NavbarItem.types.mjs +0 -0
- package/dist/components/Navbar/index.mjs +3 -3
- package/dist/components/NumberInput/NumberInput.types.mjs +0 -0
- package/dist/components/Pagination/Pagination.types.mjs +0 -0
- package/dist/components/Popover/Popover.types.mjs +0 -0
- package/dist/components/Progress/Progress.types.mjs +0 -0
- package/dist/components/Radio/Radio.types.mjs +0 -0
- package/dist/components/ScrollArea/ScrollArea.types.mjs +0 -0
- package/dist/components/Select/Select.mjs +1 -1
- package/dist/components/Select/Select.types.mjs +0 -0
- package/dist/components/Select/index.mjs +1 -1
- package/dist/components/Separator/Separator.types.mjs +0 -0
- package/dist/components/Skeleton/Skeleton.types.mjs +0 -0
- package/dist/components/Spinner/Spinner.types.mjs +0 -0
- package/dist/components/Stack/Stack.types.mjs +0 -0
- package/dist/components/Stepper/Stepper.types.mjs +0 -0
- package/dist/components/Table/Table.types.mjs +0 -0
- package/dist/components/Tabs/Tabs.types.mjs +0 -0
- package/dist/components/Tag/Tag.types.mjs +0 -0
- package/dist/components/Text/Text.types.mjs +0 -0
- package/dist/components/TextArea/TextArea.types.mjs +0 -0
- package/dist/components/Toast/Toast.mjs +1 -1
- package/dist/components/Toast/Toast.types.mjs +0 -0
- package/dist/components/Toast/index.mjs +1 -1
- package/dist/components/Toggle/Toggle.types.mjs +0 -0
- package/dist/components/Tooltip/Tooltip.types.mjs +0 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.types.mjs +0 -0
- package/dist/components/index.mjs +65 -65
- package/dist/index.core.mjs +65 -65
- package/package.json +1 -1
- package/src/components/Accordion/Accordion.tsx +7 -22
- package/src/components/Accordion/Accordion.types.ts +21 -0
- package/src/components/Accordion/index.ts +2 -1
- package/src/components/Alert/Alert.tsx +1 -9
- package/src/components/Alert/Alert.types.ts +12 -0
- package/src/components/AspectRatio/AspectRatio.tsx +2 -8
- package/src/components/AspectRatio/AspectRatio.types.ts +9 -0
- package/src/components/Avatar/Avatar.tsx +1 -10
- package/src/components/Avatar/Avatar.types.ts +13 -0
- package/src/components/Badge/Badge.tsx +1 -13
- package/src/components/Badge/Badge.types.ts +13 -0
- package/src/components/Box/Box.tsx +2 -8
- package/src/components/Box/Box.types.ts +9 -0
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +0 -2
- package/src/components/Breadcrumb/Breadcrumb.tsx +1 -14
- package/src/components/Breadcrumb/Breadcrumb.types.ts +14 -0
- package/src/components/Button/Button.tsx +1 -9
- package/src/components/Button/Button.types.ts +12 -0
- package/src/components/Card/Card.tsx +1 -8
- package/src/components/Card/Card.types.ts +12 -0
- package/src/components/Checkbox/Checkbox.tsx +1 -7
- package/src/components/Checkbox/Checkbox.types.ts +8 -0
- package/src/components/Collapse/Collapse.stories.tsx +0 -2
- package/src/components/Collapse/Collapse.tsx +2 -14
- package/src/components/Collapse/Collapse.types.ts +13 -0
- package/src/components/Collapse/styles.css.ts +1 -2
- package/src/components/Combobox/Combobox.stories.tsx +1 -1
- package/src/components/Combobox/Combobox.tsx +2 -28
- package/src/components/Combobox/Combobox.types.ts +28 -0
- package/src/components/Combobox/styles.css.ts +1 -1
- package/src/components/Container/Container.tsx +1 -11
- package/src/components/Container/Container.types.ts +12 -0
- package/src/components/Divider/Divider.tsx +1 -11
- package/src/components/Divider/Divider.types.ts +11 -0
- package/src/components/Drawer/Drawer.tsx +1 -18
- package/src/components/Drawer/Drawer.types.ts +19 -0
- package/src/components/Drawer/styles.css.ts +1 -1
- package/src/components/DropdownMenu/DropdownMenu.tsx +5 -30
- package/src/components/DropdownMenu/DropdownMenu.types.ts +31 -0
- package/src/components/DropdownMenu/styles.css.ts +1 -1
- package/src/components/EmptyState/EmptyState.tsx +1 -9
- package/src/components/EmptyState/EmptyState.types.ts +10 -0
- package/src/components/EmptyState/styles.css.ts +1 -1
- package/src/components/FileUpload/FileUpload.stories.tsx +1 -1
- package/src/components/FileUpload/FileUpload.tsx +2 -30
- package/src/components/FileUpload/FileUpload.types.ts +31 -0
- package/src/components/FileUpload/styles.css.ts +1 -1
- package/src/components/Form/Form.stories.tsx +0 -4
- package/src/components/Form/Form.tsx +1 -6
- package/src/components/Form/Form.types.ts +7 -0
- package/src/components/Form/FormInput.tsx +1 -3
- package/src/components/Form/FormInput.types.ts +4 -0
- package/src/components/Grid/Grid.tsx +1 -12
- package/src/components/Grid/Grid.types.ts +13 -0
- package/src/components/Icon/Icon.tsx +1 -8
- package/src/components/Icon/Icon.types.ts +9 -0
- package/src/components/Icon/styles.css.ts +1 -1
- package/src/components/Input/Input.stories.tsx +0 -3
- package/src/components/Input/Input.tsx +1 -7
- package/src/components/Input/Input.types.ts +8 -0
- package/src/components/Input/index.ts +1 -0
- package/src/components/Kbd/Kbd.tsx +1 -6
- package/src/components/Kbd/Kbd.types.ts +7 -0
- package/src/components/Kbd/styles.css.ts +1 -1
- package/src/components/List/List.tsx +2 -5
- package/src/components/List/List.types.ts +6 -0
- package/src/components/List/ListItem.tsx +2 -5
- package/src/components/List/ListItem.types.ts +6 -0
- package/src/components/Modal/Modal.tsx +1 -15
- package/src/components/Modal/Modal.types.ts +16 -0
- package/src/components/Navbar/Navbar.stories.tsx +0 -3
- package/src/components/Navbar/Navbar.tsx +1 -5
- package/src/components/Navbar/Navbar.types.ts +6 -0
- package/src/components/Navbar/NavbarItem.tsx +1 -5
- package/src/components/Navbar/NavbarItem.types.ts +6 -0
- package/src/components/NumberInput/NumberInput.stories.tsx +1 -1
- package/src/components/NumberInput/NumberInput.tsx +1 -24
- package/src/components/NumberInput/NumberInput.types.ts +25 -0
- package/src/components/NumberInput/styles.css.ts +1 -1
- package/src/components/Pagination/Pagination.stories.tsx +0 -2
- package/src/components/Pagination/Pagination.tsx +1 -11
- package/src/components/Pagination/Pagination.types.ts +12 -0
- package/src/components/Popover/Popover.stories.tsx +0 -2
- package/src/components/Popover/Popover.tsx +1 -27
- package/src/components/Popover/Popover.types.ts +28 -0
- package/src/components/Popover/styles.css.ts +1 -1
- package/src/components/Progress/Progress.stories.tsx +0 -2
- package/src/components/Progress/Progress.tsx +1 -10
- package/src/components/Progress/Progress.types.ts +13 -0
- package/src/components/Radio/Radio.tsx +5 -25
- package/src/components/Radio/Radio.types.ts +28 -0
- package/src/components/ScrollArea/ScrollArea.tsx +1 -11
- package/src/components/ScrollArea/ScrollArea.types.ts +12 -0
- package/src/components/ScrollArea/styles.css.ts +1 -1
- package/src/components/Select/Select.stories.tsx +0 -2
- package/src/components/Select/Select.tsx +2 -16
- package/src/components/Select/Select.types.ts +16 -0
- package/src/components/Select/styles.css.ts +1 -1
- package/src/components/Separator/Separator.tsx +1 -9
- package/src/components/Separator/Separator.types.ts +10 -0
- package/src/components/Separator/styles.css.ts +1 -1
- package/src/components/Skeleton/Skeleton.tsx +1 -15
- package/src/components/Skeleton/Skeleton.types.ts +16 -0
- package/src/components/Skeleton/styles.css.ts +1 -1
- package/src/components/Spinner/Spinner.tsx +1 -17
- package/src/components/Spinner/Spinner.types.ts +18 -0
- package/src/components/Stack/Stack.tsx +1 -21
- package/src/components/Stack/Stack.types.ts +23 -0
- package/src/components/Stepper/Stepper.stories.tsx +1 -1
- package/src/components/Stepper/Stepper.tsx +1 -20
- package/src/components/Stepper/Stepper.types.ts +21 -0
- package/src/components/Stepper/styles.css.ts +1 -1
- package/src/components/Table/Table.tsx +9 -40
- package/src/components/Table/Table.types.ts +40 -0
- package/src/components/Tabs/Tabs.tsx +7 -33
- package/src/components/Tabs/Tabs.types.ts +36 -0
- package/src/components/Tag/Tag.tsx +1 -14
- package/src/components/Tag/Tag.types.ts +17 -0
- package/src/components/Text/Header.tsx +1 -7
- package/src/components/Text/P.stories.tsx +0 -2
- package/src/components/Text/P.tsx +1 -6
- package/src/components/Text/Text.types.ts +15 -0
- package/src/components/TextArea/TextArea.stories.tsx +0 -2
- package/src/components/TextArea/TextArea.tsx +1 -7
- package/src/components/TextArea/TextArea.types.ts +8 -0
- package/src/components/Toast/Toast.tsx +13 -59
- package/src/components/Toast/Toast.types.ts +58 -0
- package/src/components/Toggle/Toggle.tsx +1 -14
- package/src/components/Toggle/Toggle.types.ts +15 -0
- package/src/components/Tooltip/Tooltip.tsx +1 -11
- package/src/components/Tooltip/Tooltip.types.ts +12 -0
- package/src/components/VisuallyHidden/VisuallyHidden.tsx +1 -6
- package/src/components/VisuallyHidden/VisuallyHidden.types.ts +7 -0
- package/src/components/VisuallyHidden/styles.css.ts +1 -1
- package/src/components/index.ts +96 -21
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Sprinkles } from '../../styles/sprinkles.css';
|
|
3
|
+
|
|
4
|
+
export type TableProps = React.HTMLAttributes<HTMLTableElement> &
|
|
5
|
+
Sprinkles & {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
striped?: boolean;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type TheadProps = {
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type TbodyProps = {
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
className?: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type TfootProps = {
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
className?: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export type TrProps = {
|
|
26
|
+
children: React.ReactNode;
|
|
27
|
+
className?: string;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export type ThProps = {
|
|
31
|
+
children?: React.ReactNode;
|
|
32
|
+
className?: string;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type TdProps = {
|
|
36
|
+
children?: React.ReactNode;
|
|
37
|
+
className?: string;
|
|
38
|
+
colSpan?: number;
|
|
39
|
+
rowSpan?: number;
|
|
40
|
+
};
|
|
@@ -9,27 +9,19 @@ import {
|
|
|
9
9
|
tabContent,
|
|
10
10
|
} from './styles.css';
|
|
11
11
|
import Box from '../Box';
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
type
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
12
|
+
import {
|
|
13
|
+
type TabsProps,
|
|
14
|
+
type TabListProps,
|
|
15
|
+
type TabProps,
|
|
16
|
+
type TabPanelProps,
|
|
17
|
+
type TabsContextType,
|
|
18
|
+
} from './Tabs.types';
|
|
19
19
|
|
|
20
20
|
const TabsContext = createContext<TabsContextType>({
|
|
21
21
|
activeTab: '',
|
|
22
22
|
setActiveTab: () => {},
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
-
type TabsProps = React.HTMLAttributes<HTMLDivElement> &
|
|
26
|
-
Sprinkles & {
|
|
27
|
-
children: React.ReactNode;
|
|
28
|
-
defaultValue?: string;
|
|
29
|
-
orientation?: 'horizontal' | 'vertical';
|
|
30
|
-
onChange?: (value: string) => void;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
25
|
const Tabs = ({
|
|
34
26
|
children,
|
|
35
27
|
defaultValue = '',
|
|
@@ -58,11 +50,6 @@ const Tabs = ({
|
|
|
58
50
|
);
|
|
59
51
|
};
|
|
60
52
|
|
|
61
|
-
type TabListProps = {
|
|
62
|
-
children: React.ReactNode;
|
|
63
|
-
className?: string;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
53
|
const TabList = ({ children, className }: TabListProps) => {
|
|
67
54
|
const { orientation } = useContext(TabsContext);
|
|
68
55
|
|
|
@@ -81,13 +68,6 @@ const TabList = ({ children, className }: TabListProps) => {
|
|
|
81
68
|
);
|
|
82
69
|
};
|
|
83
70
|
|
|
84
|
-
type TabProps = {
|
|
85
|
-
value: string;
|
|
86
|
-
children: React.ReactNode;
|
|
87
|
-
disabled?: boolean;
|
|
88
|
-
className?: string;
|
|
89
|
-
};
|
|
90
|
-
|
|
91
71
|
const Tab = ({ value, children, disabled = false, className }: TabProps) => {
|
|
92
72
|
const { activeTab, setActiveTab, orientation } = useContext(TabsContext);
|
|
93
73
|
const isActive = activeTab === value;
|
|
@@ -123,12 +103,6 @@ const Tab = ({ value, children, disabled = false, className }: TabProps) => {
|
|
|
123
103
|
);
|
|
124
104
|
};
|
|
125
105
|
|
|
126
|
-
type TabPanelProps = {
|
|
127
|
-
value: string;
|
|
128
|
-
children: React.ReactNode;
|
|
129
|
-
className?: string;
|
|
130
|
-
};
|
|
131
|
-
|
|
132
106
|
const TabPanel = ({ value, children, className }: TabPanelProps) => {
|
|
133
107
|
const { activeTab } = useContext(TabsContext);
|
|
134
108
|
const isActive = activeTab === value;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Sprinkles } from '../../styles/sprinkles.css';
|
|
3
|
+
|
|
4
|
+
export type TabsOrientation = 'horizontal' | 'vertical';
|
|
5
|
+
|
|
6
|
+
export type TabsContextType = {
|
|
7
|
+
activeTab: string;
|
|
8
|
+
setActiveTab: (value: string) => void;
|
|
9
|
+
orientation?: TabsOrientation;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type TabsProps = React.HTMLAttributes<HTMLDivElement> &
|
|
13
|
+
Sprinkles & {
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
defaultValue?: string;
|
|
16
|
+
orientation?: TabsOrientation;
|
|
17
|
+
onChange?: (value: string) => void;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type TabListProps = {
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
className?: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export type TabProps = {
|
|
26
|
+
value: string;
|
|
27
|
+
children: React.ReactNode;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
className?: string;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type TabPanelProps = {
|
|
33
|
+
value: string;
|
|
34
|
+
children: React.ReactNode;
|
|
35
|
+
className?: string;
|
|
36
|
+
};
|
|
@@ -2,15 +2,7 @@ import clsx from 'clsx';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { tag, removeButton, tagGroup } from './styles.css';
|
|
4
4
|
import Box from '../Box';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
type TagProps = React.HTMLAttributes<HTMLSpanElement> &
|
|
8
|
-
Sprinkles & {
|
|
9
|
-
children: React.ReactNode;
|
|
10
|
-
variant?: 'default' | 'primary' | 'success' | 'warning' | 'error';
|
|
11
|
-
onRemove?: () => void;
|
|
12
|
-
removable?: boolean;
|
|
13
|
-
};
|
|
5
|
+
import { type TagProps, type TagGroupProps } from './Tag.types';
|
|
14
6
|
|
|
15
7
|
const Tag = ({
|
|
16
8
|
children,
|
|
@@ -48,11 +40,6 @@ const Tag = ({
|
|
|
48
40
|
);
|
|
49
41
|
};
|
|
50
42
|
|
|
51
|
-
type TagGroupProps = {
|
|
52
|
-
children: React.ReactNode;
|
|
53
|
-
className?: string;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
43
|
const TagGroup = ({ children, className }: TagGroupProps) => {
|
|
57
44
|
return (
|
|
58
45
|
<Box
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Sprinkles } from '../../styles/sprinkles.css';
|
|
3
|
+
|
|
4
|
+
export type TagVariant = 'default' | 'primary' | 'success' | 'warning' | 'error';
|
|
5
|
+
|
|
6
|
+
export type TagProps = React.HTMLAttributes<HTMLSpanElement> &
|
|
7
|
+
Sprinkles & {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
variant?: TagVariant;
|
|
10
|
+
onRemove?: () => void;
|
|
11
|
+
removable?: boolean;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type TagGroupProps = {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
className?: string;
|
|
17
|
+
};
|
|
@@ -2,13 +2,7 @@ import clsx from 'clsx';
|
|
|
2
2
|
import { heading, text } from './styles.css';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import Box from '../Box';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
type HeaderProps = React.HTMLAttributes<HTMLHeadingElement> &
|
|
8
|
-
Sprinkles & {
|
|
9
|
-
variant: 'h1' | 'h2' | 'h3';
|
|
10
|
-
children?: React.ReactNode;
|
|
11
|
-
};
|
|
5
|
+
import { type HeaderProps } from './Text.types';
|
|
12
6
|
|
|
13
7
|
const Header = ({ variant, children, className }: HeaderProps) => {
|
|
14
8
|
return (
|
|
@@ -2,12 +2,7 @@ import clsx from 'clsx';
|
|
|
2
2
|
import { text } from './styles.css';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import Box from '../Box';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
type PProps = React.HTMLAttributes<HTMLParagraphElement> &
|
|
8
|
-
Sprinkles & {
|
|
9
|
-
children: React.ReactNode;
|
|
10
|
-
};
|
|
5
|
+
import { type PProps } from './Text.types';
|
|
11
6
|
|
|
12
7
|
const P = (props: PProps) => {
|
|
13
8
|
return (
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Sprinkles } from '../../styles/sprinkles.css';
|
|
3
|
+
|
|
4
|
+
export type HeaderVariant = 'h1' | 'h2' | 'h3';
|
|
5
|
+
|
|
6
|
+
export type HeaderProps = React.HTMLAttributes<HTMLHeadingElement> &
|
|
7
|
+
Sprinkles & {
|
|
8
|
+
variant: HeaderVariant;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type PProps = React.HTMLAttributes<HTMLParagraphElement> &
|
|
13
|
+
Sprinkles & {
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
};
|
|
@@ -3,13 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { textAreaStyle, label } from './styles.css';
|
|
4
4
|
import { text } from '../Text/styles.css';
|
|
5
5
|
import Box from '../Box';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
export type TextAreaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement> &
|
|
9
|
-
Sprinkles & {
|
|
10
|
-
label?: string;
|
|
11
|
-
fullWidth?: boolean;
|
|
12
|
-
};
|
|
6
|
+
import { type TextAreaProps } from './TextArea.types';
|
|
13
7
|
|
|
14
8
|
const TextArea = (props: TextAreaProps) => {
|
|
15
9
|
return (
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { createContext, useContext, useState, useEffect, useCallback, useRef
|
|
1
|
+
import React, { createContext, useContext, useState, useEffect, useCallback, useRef } from 'react';
|
|
2
2
|
import { createPortal } from 'react-dom';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import {
|
|
@@ -16,40 +16,16 @@ import {
|
|
|
16
16
|
slideInRight,
|
|
17
17
|
} from './styles.css';
|
|
18
18
|
import { Icon } from '../Icon';
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export type ToastOptions = {
|
|
31
|
-
duration?: number;
|
|
32
|
-
closable?: boolean;
|
|
33
|
-
position?: ToastPosition;
|
|
34
|
-
onClose?: () => void;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
type ToastItem = {
|
|
38
|
-
id: string;
|
|
39
|
-
message: string;
|
|
40
|
-
variant: ToastVariant;
|
|
41
|
-
options: ToastOptions;
|
|
42
|
-
startTime: number;
|
|
43
|
-
paused: boolean;
|
|
44
|
-
duration: number;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
type ToastContextType = {
|
|
48
|
-
addToast: (message: string, variant?: ToastVariant, options?: ToastOptions) => string;
|
|
49
|
-
removeToast: (id: string) => void;
|
|
50
|
-
handleDismissAll: () => void;
|
|
51
|
-
handleResumeAll: () => void;
|
|
52
|
-
};
|
|
19
|
+
import {
|
|
20
|
+
type ToastPosition,
|
|
21
|
+
type ToastVariant,
|
|
22
|
+
type ToastOptions,
|
|
23
|
+
type ToastItem,
|
|
24
|
+
type ToastContextType,
|
|
25
|
+
type ToastProviderProps,
|
|
26
|
+
type ToastContainerProps,
|
|
27
|
+
type ToastComponentProps,
|
|
28
|
+
} from './Toast.types';
|
|
53
29
|
|
|
54
30
|
const ToastContext = createContext<ToastContextType>({
|
|
55
31
|
addToast: () => '',
|
|
@@ -77,13 +53,6 @@ const positionToClassKey: Record<ToastPosition, keyof typeof toastWrapper> = {
|
|
|
77
53
|
'bottom-right': 'bottomRight',
|
|
78
54
|
};
|
|
79
55
|
|
|
80
|
-
type ToastProviderProps = {
|
|
81
|
-
children: ReactNode;
|
|
82
|
-
position?: ToastPosition;
|
|
83
|
-
maxVisible?: number;
|
|
84
|
-
stacking?: 'stack' | 'replace';
|
|
85
|
-
};
|
|
86
|
-
|
|
87
56
|
export const ToastProvider = ({
|
|
88
57
|
children,
|
|
89
58
|
position = 'top-right',
|
|
@@ -239,15 +208,6 @@ export const ToastProvider = ({
|
|
|
239
208
|
);
|
|
240
209
|
};
|
|
241
210
|
|
|
242
|
-
type ToastContainerProps = {
|
|
243
|
-
toasts: ToastItem[];
|
|
244
|
-
position: ToastPosition;
|
|
245
|
-
pauseId: string | null;
|
|
246
|
-
onDismiss: (id: string) => void;
|
|
247
|
-
onDismissAll: () => void;
|
|
248
|
-
onResumeAll: () => void;
|
|
249
|
-
};
|
|
250
|
-
|
|
251
211
|
const ToastContainer = ({
|
|
252
212
|
toasts,
|
|
253
213
|
position,
|
|
@@ -328,14 +288,8 @@ export const useToast = () => {
|
|
|
328
288
|
return context;
|
|
329
289
|
};
|
|
330
290
|
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
variant?: ToastVariant;
|
|
334
|
-
options?: ToastOptions;
|
|
335
|
-
className?: string;
|
|
336
|
-
};
|
|
337
|
-
|
|
338
|
-
export const Toast = ({ message, variant = 'info', options, className }: ToastComponentProps) => {
|
|
291
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
292
|
+
export const Toast = (_props: ToastComponentProps) => {
|
|
339
293
|
return null;
|
|
340
294
|
};
|
|
341
295
|
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export type ToastPosition =
|
|
4
|
+
| 'top-left'
|
|
5
|
+
| 'top-center'
|
|
6
|
+
| 'top-right'
|
|
7
|
+
| 'bottom-left'
|
|
8
|
+
| 'bottom-center'
|
|
9
|
+
| 'bottom-right';
|
|
10
|
+
|
|
11
|
+
export type ToastVariant = 'success' | 'error' | 'warning' | 'info';
|
|
12
|
+
|
|
13
|
+
export type ToastOptions = {
|
|
14
|
+
duration?: number;
|
|
15
|
+
closable?: boolean;
|
|
16
|
+
position?: ToastPosition;
|
|
17
|
+
onClose?: () => void;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type ToastItem = {
|
|
21
|
+
id: string;
|
|
22
|
+
message: string;
|
|
23
|
+
variant: ToastVariant;
|
|
24
|
+
options: ToastOptions;
|
|
25
|
+
startTime: number;
|
|
26
|
+
paused: boolean;
|
|
27
|
+
duration: number;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export type ToastContextType = {
|
|
31
|
+
addToast: (message: string, variant?: ToastVariant, options?: ToastOptions) => string;
|
|
32
|
+
removeToast: (id: string) => void;
|
|
33
|
+
handleDismissAll: () => void;
|
|
34
|
+
handleResumeAll: () => void;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type ToastProviderProps = {
|
|
38
|
+
children: ReactNode;
|
|
39
|
+
position?: ToastPosition;
|
|
40
|
+
maxVisible?: number;
|
|
41
|
+
stacking?: 'stack' | 'replace';
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type ToastContainerProps = {
|
|
45
|
+
toasts: ToastItem[];
|
|
46
|
+
position: ToastPosition;
|
|
47
|
+
pauseId: string | null;
|
|
48
|
+
onDismiss: (id: string) => void;
|
|
49
|
+
onDismissAll: () => void;
|
|
50
|
+
onResumeAll: () => void;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export type ToastComponentProps = {
|
|
54
|
+
message: string;
|
|
55
|
+
variant?: ToastVariant;
|
|
56
|
+
options?: ToastOptions;
|
|
57
|
+
className?: string;
|
|
58
|
+
};
|
|
@@ -15,20 +15,7 @@ import {
|
|
|
15
15
|
} from './styles.css';
|
|
16
16
|
import React, { useState, useId } from 'react';
|
|
17
17
|
import Box from '../Box';
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
export type ToggleSize = 'small' | 'medium' | 'large';
|
|
21
|
-
|
|
22
|
-
export type ToggleProps = Omit<
|
|
23
|
-
React.InputHTMLAttributes<HTMLInputElement>,
|
|
24
|
-
'size' | 'checked' | 'onChange'
|
|
25
|
-
> &
|
|
26
|
-
Sprinkles & {
|
|
27
|
-
checked?: boolean;
|
|
28
|
-
onChange?: (checked: boolean) => void;
|
|
29
|
-
size?: ToggleSize;
|
|
30
|
-
label?: string;
|
|
31
|
-
};
|
|
18
|
+
import { type ToggleProps } from './Toggle.types';
|
|
32
19
|
|
|
33
20
|
const Toggle = ({
|
|
34
21
|
checked = false,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Sprinkles } from '../../styles/sprinkles.css';
|
|
3
|
+
|
|
4
|
+
export type ToggleSize = 'small' | 'medium' | 'large';
|
|
5
|
+
|
|
6
|
+
export type ToggleProps = Omit<
|
|
7
|
+
React.InputHTMLAttributes<HTMLInputElement>,
|
|
8
|
+
'size' | 'checked' | 'onChange'
|
|
9
|
+
> &
|
|
10
|
+
Sprinkles & {
|
|
11
|
+
checked?: boolean;
|
|
12
|
+
onChange?: (checked: boolean) => void;
|
|
13
|
+
size?: ToggleSize;
|
|
14
|
+
label?: string;
|
|
15
|
+
};
|
|
@@ -11,17 +11,7 @@ import {
|
|
|
11
11
|
} from './styles.css';
|
|
12
12
|
import React, { useState } from 'react';
|
|
13
13
|
import Box from '../Box';
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
export type TooltipPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
17
|
-
|
|
18
|
-
export type TooltipProps = React.HTMLAttributes<HTMLDivElement> &
|
|
19
|
-
Sprinkles & {
|
|
20
|
-
content: string;
|
|
21
|
-
position?: TooltipPosition;
|
|
22
|
-
showArrow?: boolean;
|
|
23
|
-
children: React.ReactNode;
|
|
24
|
-
};
|
|
14
|
+
import { type TooltipProps } from './Tooltip.types';
|
|
25
15
|
|
|
26
16
|
const Tooltip = ({
|
|
27
17
|
content,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Sprinkles } from '../../styles/sprinkles.css';
|
|
3
|
+
|
|
4
|
+
export type TooltipPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
5
|
+
|
|
6
|
+
export type TooltipProps = React.HTMLAttributes<HTMLDivElement> &
|
|
7
|
+
Sprinkles & {
|
|
8
|
+
content: string;
|
|
9
|
+
position?: TooltipPosition;
|
|
10
|
+
showArrow?: boolean;
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
};
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { visuallyHidden } from './styles.css';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export type VisuallyHiddenProps = Sprinkles & {
|
|
6
|
-
children: React.ReactNode;
|
|
7
|
-
as?: React.ElementType;
|
|
8
|
-
};
|
|
3
|
+
import { type VisuallyHiddenProps } from './VisuallyHidden.types';
|
|
9
4
|
|
|
10
5
|
const VisuallyHidden = ({
|
|
11
6
|
children,
|