@jordan-mace/chaser-design-system 1.2.7 → 1.2.9
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/index.d.mts +1834 -0
- package/dist/index.mjs +4729 -0
- package/dist/styles/layers.css.d.mts +6 -0
- package/dist/styles/layers.css.mjs +7 -0
- package/dist/styles/reset.css.d.mts +1 -0
- package/dist/styles/reset.css.mjs +24 -0
- package/dist/styles/sprinkles.css.d.mts +246 -0
- package/dist/styles/sprinkles.css.mjs +200 -0
- package/dist/styles/theme.css.d.mts +41 -0
- package/dist/styles/theme.css.mjs +50 -0
- package/package.json +18 -9
- package/src/components/Accordion/Accordion.tsx +21 -16
- package/src/components/Alert/Alert.tsx +11 -7
- package/src/components/Avatar/Avatar.tsx +16 -14
- package/src/components/Badge/Badge.tsx +8 -6
- package/src/components/Box/reset.css.ts +2 -2
- package/src/components/Breadcrumb/Breadcrumb.tsx +7 -10
- package/src/components/Button/Button.tsx +9 -11
- package/src/components/Card/Card.tsx +8 -10
- package/src/components/Checkbox/Checkbox.tsx +11 -8
- package/src/components/Collapse/Collapse.tsx +12 -9
- package/src/components/Combobox/Combobox.tsx +60 -31
- package/src/components/Container/Container.tsx +4 -3
- package/src/components/Divider/Divider.tsx +9 -5
- package/src/components/Drawer/Drawer.tsx +20 -13
- package/src/components/DropdownMenu/DropdownMenu.tsx +37 -15
- package/src/components/EmptyState/EmptyState.tsx +9 -12
- package/src/components/FileUpload/FileUpload.tsx +61 -45
- package/src/components/Form/Form.tsx +6 -8
- package/src/components/Grid/Grid.tsx +18 -13
- package/src/components/Icon/Icon.tsx +7 -6
- package/src/components/Input/Input.tsx +7 -8
- package/src/components/Kbd/Kbd.tsx +5 -4
- package/src/components/List/List.tsx +6 -2
- package/src/components/List/ListItem.tsx +6 -2
- package/src/components/Modal/Modal.tsx +16 -5
- package/src/components/Navbar/Navbar.tsx +2 -1
- package/src/components/Navbar/NavbarItem.tsx +2 -1
- package/src/components/NumberInput/NumberInput.tsx +29 -22
- package/src/components/Pagination/Pagination.tsx +39 -28
- package/src/components/Popover/Popover.tsx +37 -21
- package/src/components/Progress/Progress.tsx +39 -38
- package/src/components/Radio/Radio.tsx +12 -6
- package/src/components/ScrollArea/ScrollArea.tsx +9 -10
- package/src/components/Select/Select.tsx +12 -7
- package/src/components/Separator/Separator.tsx +8 -14
- package/src/components/Skeleton/Skeleton.tsx +11 -13
- package/src/components/Spinner/Spinner.tsx +15 -11
- package/src/components/Stack/Stack.tsx +34 -15
- package/src/components/Stepper/Stepper.tsx +19 -17
- package/src/components/Table/Table.tsx +31 -21
- package/src/components/Tabs/Tabs.tsx +14 -10
- package/src/components/Tag/Tag.tsx +8 -7
- package/src/components/Text/Header.tsx +6 -5
- package/src/components/Text/P.tsx +5 -4
- package/src/components/TextArea/TextArea.tsx +7 -8
- package/src/components/Toggle/Toggle.tsx +16 -7
- package/src/components/Tooltip/Tooltip.tsx +16 -11
- package/src/components/VisuallyHidden/VisuallyHidden.tsx +7 -8
- package/src/index.ts +6 -1
- package/dist/components/Accordion/Accordion.d.ts +0 -16
- package/dist/components/Accordion/Accordion.js +0 -43
- package/dist/components/Accordion/index.d.ts +0 -1
- package/dist/components/Accordion/index.js +0 -1
- package/dist/components/Accordion/styles.css.d.ts +0 -7
- package/dist/components/Accordion/styles.css.js +0 -65
- package/dist/components/Alert/Alert.d.ts +0 -9
- package/dist/components/Alert/Alert.js +0 -8
- package/dist/components/Alert/index.d.ts +0 -1
- package/dist/components/Alert/index.js +0 -1
- package/dist/components/Alert/styles.css.d.ts +0 -4
- package/dist/components/Alert/styles.css.js +0 -54
- package/dist/components/AspectRatio/AspectRatio.d.ts +0 -9
- package/dist/components/AspectRatio/AspectRatio.js +0 -12
- package/dist/components/AspectRatio/index.d.ts +0 -2
- package/dist/components/AspectRatio/index.js +0 -1
- package/dist/components/Avatar/Avatar.d.ts +0 -11
- package/dist/components/Avatar/Avatar.js +0 -13
- package/dist/components/Avatar/index.d.ts +0 -1
- package/dist/components/Avatar/index.js +0 -1
- package/dist/components/Avatar/styles.css.d.ts +0 -4
- package/dist/components/Avatar/styles.css.js +0 -151
- package/dist/components/Badge/Badge.d.ts +0 -11
- package/dist/components/Badge/Badge.js +0 -8
- package/dist/components/Badge/index.d.ts +0 -2
- package/dist/components/Badge/index.js +0 -1
- package/dist/components/Badge/styles.css.d.ts +0 -5
- package/dist/components/Badge/styles.css.js +0 -77
- package/dist/components/Box/Box.d.ts +0 -11
- package/dist/components/Box/Box.js +0 -54
- package/dist/components/Box/index.d.ts +0 -2
- package/dist/components/Box/index.js +0 -1
- package/dist/components/Box/reset.css.d.ts +0 -1
- package/dist/components/Box/reset.css.js +0 -15
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +0 -12
- package/dist/components/Breadcrumb/Breadcrumb.js +0 -8
- package/dist/components/Breadcrumb/index.d.ts +0 -1
- package/dist/components/Breadcrumb/index.js +0 -1
- package/dist/components/Breadcrumb/styles.css.d.ts +0 -6
- package/dist/components/Breadcrumb/styles.css.js +0 -50
- package/dist/components/Button/Button.d.ts +0 -9
- package/dist/components/Button/Button.js +0 -8
- package/dist/components/Button/index.d.ts +0 -1
- package/dist/components/Button/index.js +0 -1
- package/dist/components/Button/styles.css.d.ts +0 -2
- package/dist/components/Button/styles.css.js +0 -30
- package/dist/components/Card/Card.d.ts +0 -8
- package/dist/components/Card/Card.js +0 -8
- package/dist/components/Card/index.d.ts +0 -1
- package/dist/components/Card/index.js +0 -1
- package/dist/components/Card/styles.css.d.ts +0 -2
- package/dist/components/Card/styles.css.js +0 -25
- package/dist/components/Checkbox/Checkbox.d.ts +0 -6
- package/dist/components/Checkbox/Checkbox.js +0 -25
- package/dist/components/Checkbox/index.d.ts +0 -1
- package/dist/components/Checkbox/index.js +0 -1
- package/dist/components/Checkbox/styles.css.d.ts +0 -3
- package/dist/components/Checkbox/styles.css.js +0 -31
- package/dist/components/Collapse/Collapse.d.ts +0 -12
- package/dist/components/Collapse/Collapse.js +0 -56
- package/dist/components/Collapse/index.d.ts +0 -2
- package/dist/components/Collapse/index.js +0 -1
- package/dist/components/Collapse/styles.css.d.ts +0 -3
- package/dist/components/Collapse/styles.css.js +0 -36
- package/dist/components/Combobox/Combobox.d.ts +0 -23
- package/dist/components/Combobox/Combobox.js +0 -104
- package/dist/components/Combobox/index.d.ts +0 -2
- package/dist/components/Combobox/index.js +0 -1
- package/dist/components/Combobox/styles.css.d.ts +0 -13
- package/dist/components/Combobox/styles.css.js +0 -142
- package/dist/components/Container/Container.d.ts +0 -11
- package/dist/components/Container/Container.js +0 -21
- package/dist/components/Container/index.d.ts +0 -2
- package/dist/components/Container/index.js +0 -1
- package/dist/components/Divider/Divider.d.ts +0 -9
- package/dist/components/Divider/Divider.js +0 -8
- package/dist/components/Divider/index.d.ts +0 -2
- package/dist/components/Divider/index.js +0 -1
- package/dist/components/Divider/styles.css.d.ts +0 -4
- package/dist/components/Divider/styles.css.js +0 -41
- package/dist/components/Drawer/Drawer.d.ts +0 -16
- package/dist/components/Drawer/Drawer.js +0 -65
- package/dist/components/Drawer/index.d.ts +0 -2
- package/dist/components/Drawer/index.js +0 -1
- package/dist/components/Drawer/styles.css.d.ts +0 -8
- package/dist/components/Drawer/styles.css.js +0 -125
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +0 -23
- package/dist/components/DropdownMenu/DropdownMenu.js +0 -43
- package/dist/components/DropdownMenu/index.d.ts +0 -2
- package/dist/components/DropdownMenu/index.js +0 -1
- package/dist/components/DropdownMenu/styles.css.d.ts +0 -9
- package/dist/components/DropdownMenu/styles.css.js +0 -93
- package/dist/components/EmptyState/EmptyState.d.ts +0 -10
- package/dist/components/EmptyState/EmptyState.js +0 -8
- package/dist/components/EmptyState/index.d.ts +0 -2
- package/dist/components/EmptyState/index.js +0 -1
- package/dist/components/EmptyState/styles.css.d.ts +0 -5
- package/dist/components/EmptyState/styles.css.js +0 -30
- package/dist/components/FileUpload/FileUpload.d.ts +0 -27
- package/dist/components/FileUpload/FileUpload.js +0 -102
- package/dist/components/FileUpload/index.d.ts +0 -2
- package/dist/components/FileUpload/index.js +0 -1
- package/dist/components/FileUpload/styles.css.d.ts +0 -19
- package/dist/components/FileUpload/styles.css.js +0 -145
- package/dist/components/Form/Form.d.ts +0 -7
- package/dist/components/Form/Form.js +0 -8
- package/dist/components/Form/FormInput.d.ts +0 -5
- package/dist/components/Form/FormInput.js +0 -9
- package/dist/components/Form/index.d.ts +0 -2
- package/dist/components/Form/index.js +0 -2
- package/dist/components/Form/styles.css.d.ts +0 -2
- package/dist/components/Form/styles.css.js +0 -11
- package/dist/components/Grid/Grid.d.ts +0 -13
- package/dist/components/Grid/Grid.js +0 -25
- package/dist/components/Grid/index.d.ts +0 -2
- package/dist/components/Grid/index.js +0 -1
- package/dist/components/Icon/Icon.d.ts +0 -12
- package/dist/components/Icon/Icon.js +0 -21
- package/dist/components/Icon/index.d.ts +0 -1
- package/dist/components/Icon/index.js +0 -1
- package/dist/components/Icon/styles.css.d.ts +0 -1
- package/dist/components/Icon/styles.css.js +0 -9
- package/dist/components/Input/Input.d.ts +0 -7
- package/dist/components/Input/Input.js +0 -9
- package/dist/components/Input/index.d.ts +0 -1
- package/dist/components/Input/index.js +0 -1
- package/dist/components/Input/styles.css.d.ts +0 -2
- package/dist/components/Input/styles.css.js +0 -8
- package/dist/components/Kbd/Kbd.d.ts +0 -7
- package/dist/components/Kbd/Kbd.js +0 -6
- package/dist/components/Kbd/index.d.ts +0 -2
- package/dist/components/Kbd/index.js +0 -1
- package/dist/components/Kbd/styles.css.d.ts +0 -1
- package/dist/components/Kbd/styles.css.js +0 -16
- package/dist/components/List/List.d.ts +0 -5
- package/dist/components/List/List.js +0 -7
- package/dist/components/List/ListItem.d.ts +0 -5
- package/dist/components/List/ListItem.js +0 -7
- package/dist/components/List/index.d.ts +0 -2
- package/dist/components/List/index.js +0 -2
- package/dist/components/List/styles.css.d.ts +0 -2
- package/dist/components/List/styles.css.js +0 -11
- package/dist/components/Modal/Modal.d.ts +0 -13
- package/dist/components/Modal/Modal.js +0 -35
- package/dist/components/Modal/index.d.ts +0 -2
- package/dist/components/Modal/index.js +0 -1
- package/dist/components/Modal/styles.css.d.ts +0 -7
- package/dist/components/Modal/styles.css.js +0 -92
- package/dist/components/Navbar/Navbar.d.ts +0 -6
- package/dist/components/Navbar/Navbar.js +0 -8
- package/dist/components/Navbar/NavbarItem.d.ts +0 -6
- package/dist/components/Navbar/NavbarItem.js +0 -8
- package/dist/components/Navbar/index.d.ts +0 -2
- package/dist/components/Navbar/index.js +0 -2
- package/dist/components/Navbar/styles.css.d.ts +0 -2
- package/dist/components/Navbar/styles.css.js +0 -3
- package/dist/components/NumberInput/NumberInput.d.ts +0 -20
- package/dist/components/NumberInput/NumberInput.js +0 -39
- package/dist/components/NumberInput/index.d.ts +0 -2
- package/dist/components/NumberInput/index.js +0 -1
- package/dist/components/NumberInput/styles.css.d.ts +0 -10
- package/dist/components/NumberInput/styles.css.js +0 -117
- package/dist/components/Pagination/Pagination.d.ts +0 -10
- package/dist/components/Pagination/Pagination.js +0 -47
- package/dist/components/Pagination/index.d.ts +0 -2
- package/dist/components/Pagination/index.js +0 -1
- package/dist/components/Pagination/styles.css.d.ts +0 -4
- package/dist/components/Pagination/styles.css.js +0 -44
- package/dist/components/Popover/Popover.d.ts +0 -18
- package/dist/components/Popover/Popover.js +0 -55
- package/dist/components/Popover/index.d.ts +0 -2
- package/dist/components/Popover/index.js +0 -1
- package/dist/components/Popover/styles.css.d.ts +0 -11
- package/dist/components/Popover/styles.css.js +0 -185
- package/dist/components/Progress/Progress.d.ts +0 -10
- package/dist/components/Progress/Progress.js +0 -9
- package/dist/components/Progress/index.d.ts +0 -1
- package/dist/components/Progress/index.js +0 -1
- package/dist/components/Progress/styles.css.d.ts +0 -4
- package/dist/components/Progress/styles.css.js +0 -71
- package/dist/components/Radio/Radio.d.ts +0 -16
- package/dist/components/Radio/Radio.js +0 -25
- package/dist/components/Radio/index.d.ts +0 -1
- package/dist/components/Radio/index.js +0 -1
- package/dist/components/Radio/styles.css.d.ts +0 -5
- package/dist/components/Radio/styles.css.js +0 -42
- package/dist/components/ScrollArea/ScrollArea.d.ts +0 -11
- package/dist/components/ScrollArea/ScrollArea.js +0 -12
- package/dist/components/ScrollArea/index.d.ts +0 -2
- package/dist/components/ScrollArea/index.js +0 -1
- package/dist/components/ScrollArea/styles.css.d.ts +0 -3
- package/dist/components/ScrollArea/styles.css.js +0 -25
- package/dist/components/Select/Select.d.ts +0 -13
- package/dist/components/Select/Select.js +0 -10
- package/dist/components/Select/index.d.ts +0 -1
- package/dist/components/Select/index.js +0 -1
- package/dist/components/Select/styles.css.d.ts +0 -4
- package/dist/components/Select/styles.css.js +0 -82
- package/dist/components/Separator/Separator.d.ts +0 -8
- package/dist/components/Separator/Separator.js +0 -8
- package/dist/components/Separator/index.d.ts +0 -2
- package/dist/components/Separator/index.js +0 -1
- package/dist/components/Separator/styles.css.d.ts +0 -4
- package/dist/components/Separator/styles.css.js +0 -28
- package/dist/components/Skeleton/Skeleton.d.ts +0 -14
- package/dist/components/Skeleton/Skeleton.js +0 -13
- package/dist/components/Skeleton/index.d.ts +0 -2
- package/dist/components/Skeleton/index.js +0 -1
- package/dist/components/Skeleton/styles.css.d.ts +0 -4
- package/dist/components/Skeleton/styles.css.js +0 -56
- package/dist/components/Spinner/Spinner.d.ts +0 -10
- package/dist/components/Spinner/Spinner.js +0 -8
- package/dist/components/Spinner/index.d.ts +0 -2
- package/dist/components/Spinner/index.js +0 -1
- package/dist/components/Spinner/styles.css.d.ts +0 -4
- package/dist/components/Spinner/styles.css.js +0 -55
- package/dist/components/Stack/Stack.d.ts +0 -16
- package/dist/components/Stack/Stack.js +0 -24
- package/dist/components/Stack/index.d.ts +0 -2
- package/dist/components/Stack/index.js +0 -1
- package/dist/components/Stepper/Stepper.d.ts +0 -18
- package/dist/components/Stepper/Stepper.js +0 -25
- package/dist/components/Stepper/index.d.ts +0 -2
- package/dist/components/Stepper/index.js +0 -1
- package/dist/components/Stepper/styles.css.d.ts +0 -14
- package/dist/components/Stepper/styles.css.js +0 -104
- package/dist/components/Table/Table.d.ts +0 -42
- package/dist/components/Table/Table.js +0 -39
- package/dist/components/Table/index.d.ts +0 -1
- package/dist/components/Table/index.js +0 -1
- package/dist/components/Table/styles.css.d.ts +0 -8
- package/dist/components/Table/styles.css.js +0 -49
- package/dist/components/Tabs/Tabs.d.ts +0 -29
- package/dist/components/Tabs/Tabs.js +0 -52
- package/dist/components/Tabs/index.d.ts +0 -1
- package/dist/components/Tabs/index.js +0 -1
- package/dist/components/Tabs/styles.css.d.ts +0 -6
- package/dist/components/Tabs/styles.css.js +0 -100
- package/dist/components/Tag/Tag.d.ts +0 -16
- package/dist/components/Tag/Tag.js +0 -18
- package/dist/components/Tag/index.d.ts +0 -1
- package/dist/components/Tag/index.js +0 -1
- package/dist/components/Tag/styles.css.d.ts +0 -3
- package/dist/components/Tag/styles.css.js +0 -93
- package/dist/components/Text/Header.d.ts +0 -8
- package/dist/components/Text/Header.js +0 -8
- package/dist/components/Text/P.d.ts +0 -7
- package/dist/components/Text/P.js +0 -8
- package/dist/components/Text/index.d.ts +0 -2
- package/dist/components/Text/index.js +0 -2
- package/dist/components/Text/styles.css.d.ts +0 -2
- package/dist/components/Text/styles.css.js +0 -13
- package/dist/components/TextArea/TextArea.d.ts +0 -7
- package/dist/components/TextArea/TextArea.js +0 -9
- package/dist/components/TextArea/index.d.ts +0 -2
- package/dist/components/TextArea/index.js +0 -1
- package/dist/components/TextArea/styles.css.d.ts +0 -2
- package/dist/components/TextArea/styles.css.js +0 -10
- package/dist/components/Toast/Toast.d.ts +0 -34
- package/dist/components/Toast/Toast.js +0 -177
- package/dist/components/Toast/index.d.ts +0 -1
- package/dist/components/Toast/index.js +0 -1
- package/dist/components/Toast/styles.css.d.ts +0 -21
- package/dist/components/Toast/styles.css.js +0 -192
- package/dist/components/Toggle/Toggle.d.ts +0 -10
- package/dist/components/Toggle/Toggle.js +0 -17
- package/dist/components/Toggle/index.d.ts +0 -2
- package/dist/components/Toggle/index.js +0 -1
- package/dist/components/Toggle/styles.css.d.ts +0 -12
- package/dist/components/Toggle/styles.css.js +0 -118
- package/dist/components/Tooltip/Tooltip.d.ts +0 -10
- package/dist/components/Tooltip/Tooltip.js +0 -16
- package/dist/components/Tooltip/index.d.ts +0 -2
- package/dist/components/Tooltip/index.js +0 -1
- package/dist/components/Tooltip/styles.css.d.ts +0 -8
- package/dist/components/Tooltip/styles.css.js +0 -86
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +0 -8
- package/dist/components/VisuallyHidden/VisuallyHidden.js +0 -9
- package/dist/components/VisuallyHidden/index.d.ts +0 -2
- package/dist/components/VisuallyHidden/index.js +0 -1
- package/dist/components/VisuallyHidden/styles.css.d.ts +0 -1
- package/dist/components/VisuallyHidden/styles.css.js +0 -12
- package/dist/components/index.d.ts +0 -68
- package/dist/components/index.js +0 -47
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/styles/layers.css.d.ts +0 -3
- package/dist/styles/layers.css.js +0 -3
- package/dist/styles/sprinkles.css.d.ts +0 -241
- package/dist/styles/sprinkles.css.js +0 -165
- package/dist/styles/theme.css.d.ts +0 -38
- package/dist/styles/theme.css.js +0 -51
- package/dist/styles/utils.d.ts +0 -2
- package/dist/styles/utils.js +0 -7
|
@@ -13,25 +13,30 @@ import {
|
|
|
13
13
|
numberInputErrorMessage,
|
|
14
14
|
} from './styles.css';
|
|
15
15
|
import Box from '../Box';
|
|
16
|
+
import { Sprinkles } from '../../styles/sprinkles.css';
|
|
16
17
|
|
|
17
18
|
export type NumberInputPosition = 'right' | 'left';
|
|
18
19
|
|
|
19
|
-
export
|
|
20
|
-
|
|
21
|
-
value
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
20
|
+
export type NumberInputProps = Omit<
|
|
21
|
+
React.InputHTMLAttributes<HTMLInputElement>,
|
|
22
|
+
'onChange' | 'value' | 'min' | 'max'
|
|
23
|
+
> &
|
|
24
|
+
Sprinkles & {
|
|
25
|
+
label?: string;
|
|
26
|
+
value?: number | '';
|
|
27
|
+
onChange?: (value: number | '') => void;
|
|
28
|
+
min?: number;
|
|
29
|
+
max?: number;
|
|
30
|
+
step?: number;
|
|
31
|
+
stepperPosition?: NumberInputPosition;
|
|
32
|
+
placeholder?: string;
|
|
33
|
+
hint?: string;
|
|
34
|
+
error?: boolean;
|
|
35
|
+
errorMessage?: string;
|
|
36
|
+
fullWidth?: boolean;
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
allowEmpty?: boolean;
|
|
39
|
+
};
|
|
35
40
|
|
|
36
41
|
const NumberInput = ({
|
|
37
42
|
label,
|
|
@@ -53,7 +58,7 @@ const NumberInput = ({
|
|
|
53
58
|
}: NumberInputProps) => {
|
|
54
59
|
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
55
60
|
const inputValue = e.target.value;
|
|
56
|
-
|
|
61
|
+
|
|
57
62
|
if (inputValue === '') {
|
|
58
63
|
if (allowEmpty) {
|
|
59
64
|
onChange?.('');
|
|
@@ -62,7 +67,7 @@ const NumberInput = ({
|
|
|
62
67
|
}
|
|
63
68
|
return;
|
|
64
69
|
}
|
|
65
|
-
|
|
70
|
+
|
|
66
71
|
const numValue = parseFloat(inputValue);
|
|
67
72
|
if (!isNaN(numValue)) {
|
|
68
73
|
const clampedValue = Math.min(Math.max(numValue, min), max);
|
|
@@ -82,8 +87,10 @@ const NumberInput = ({
|
|
|
82
87
|
onChange?.(newValue);
|
|
83
88
|
}, [value, step, min, onChange]);
|
|
84
89
|
|
|
85
|
-
const isIncrementDisabled =
|
|
86
|
-
|
|
90
|
+
const isIncrementDisabled =
|
|
91
|
+
disabled || (typeof value === 'number' && value >= max);
|
|
92
|
+
const isDecrementDisabled =
|
|
93
|
+
disabled || (typeof value === 'number' && value <= min);
|
|
87
94
|
|
|
88
95
|
const displayValue = value === '' ? '' : value;
|
|
89
96
|
|
|
@@ -94,7 +101,7 @@ const NumberInput = ({
|
|
|
94
101
|
{label}
|
|
95
102
|
</Box>
|
|
96
103
|
)}
|
|
97
|
-
|
|
104
|
+
|
|
98
105
|
<Box className={numberInputContainer}>
|
|
99
106
|
<Box
|
|
100
107
|
as="input"
|
|
@@ -113,7 +120,7 @@ const NumberInput = ({
|
|
|
113
120
|
)}
|
|
114
121
|
{...props}
|
|
115
122
|
/>
|
|
116
|
-
|
|
123
|
+
|
|
117
124
|
<Box
|
|
118
125
|
className={clsx(
|
|
119
126
|
numberInputStepper,
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
paginationContainer,
|
|
5
|
+
pageButton,
|
|
6
|
+
pageButtonVariants,
|
|
7
|
+
ellipsis,
|
|
8
|
+
} from './styles.css';
|
|
4
9
|
import Box from '../Box';
|
|
10
|
+
import { Sprinkles } from '../../styles/sprinkles.css';
|
|
5
11
|
|
|
6
|
-
export type PaginationProps =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
export type PaginationProps = React.HTMLAttributes<HTMLDivElement> &
|
|
13
|
+
Sprinkles & {
|
|
14
|
+
currentPage: number;
|
|
15
|
+
totalPages: number;
|
|
16
|
+
onPageChange: (page: number) => void;
|
|
17
|
+
siblingCount?: number;
|
|
18
|
+
showFirstLast?: boolean;
|
|
19
|
+
showPrevNext?: boolean;
|
|
20
|
+
};
|
|
14
21
|
|
|
15
22
|
const Pagination = ({
|
|
16
23
|
currentPage,
|
|
@@ -19,23 +26,24 @@ const Pagination = ({
|
|
|
19
26
|
siblingCount = 1,
|
|
20
27
|
showFirstLast = true,
|
|
21
28
|
showPrevNext = true,
|
|
29
|
+
...props
|
|
22
30
|
}: PaginationProps) => {
|
|
23
31
|
const generatePageNumbers = () => {
|
|
24
32
|
const pages: (number | string)[] = [];
|
|
25
|
-
|
|
33
|
+
|
|
26
34
|
const leftSiblingIndex = Math.max(currentPage - siblingCount, 1);
|
|
27
35
|
const rightSiblingIndex = Math.min(currentPage + siblingCount, totalPages);
|
|
28
|
-
|
|
36
|
+
|
|
29
37
|
const shouldShowLeftEllipsis = leftSiblingIndex > 2;
|
|
30
38
|
const shouldShowRightEllipsis = rightSiblingIndex < totalPages - 1;
|
|
31
|
-
|
|
39
|
+
|
|
32
40
|
if (totalPages <= 7) {
|
|
33
41
|
for (let i = 1; i <= totalPages; i++) {
|
|
34
42
|
pages.push(i);
|
|
35
43
|
}
|
|
36
44
|
} else {
|
|
37
45
|
pages.push(1);
|
|
38
|
-
|
|
46
|
+
|
|
39
47
|
if (shouldShowLeftEllipsis) {
|
|
40
48
|
pages.push('left-ellipsis');
|
|
41
49
|
} else if (currentPage > 3) {
|
|
@@ -43,13 +51,13 @@ const Pagination = ({
|
|
|
43
51
|
pages.push(i);
|
|
44
52
|
}
|
|
45
53
|
}
|
|
46
|
-
|
|
54
|
+
|
|
47
55
|
for (let i = leftSiblingIndex; i <= rightSiblingIndex; i++) {
|
|
48
56
|
if (i !== 1 && i !== totalPages) {
|
|
49
57
|
pages.push(i);
|
|
50
58
|
}
|
|
51
59
|
}
|
|
52
|
-
|
|
60
|
+
|
|
53
61
|
if (shouldShowRightEllipsis) {
|
|
54
62
|
pages.push('right-ellipsis');
|
|
55
63
|
} else if (currentPage < totalPages - 2) {
|
|
@@ -57,17 +65,18 @@ const Pagination = ({
|
|
|
57
65
|
pages.push(i);
|
|
58
66
|
}
|
|
59
67
|
}
|
|
60
|
-
|
|
68
|
+
|
|
61
69
|
pages.push(totalPages);
|
|
62
70
|
}
|
|
63
|
-
|
|
71
|
+
|
|
64
72
|
return pages;
|
|
65
73
|
};
|
|
66
|
-
|
|
74
|
+
|
|
67
75
|
const pages = generatePageNumbers();
|
|
68
|
-
|
|
76
|
+
const { className, ...restProps } = props;
|
|
77
|
+
|
|
69
78
|
return (
|
|
70
|
-
<Box className={paginationContainer}>
|
|
79
|
+
<Box className={clsx(paginationContainer, className)} {...restProps}>
|
|
71
80
|
{showFirstLast && (
|
|
72
81
|
<Box
|
|
73
82
|
as="button"
|
|
@@ -78,7 +87,7 @@ const Pagination = ({
|
|
|
78
87
|
{'<<'}
|
|
79
88
|
</Box>
|
|
80
89
|
)}
|
|
81
|
-
|
|
90
|
+
|
|
82
91
|
{showPrevNext && (
|
|
83
92
|
<Box
|
|
84
93
|
as="button"
|
|
@@ -89,15 +98,17 @@ const Pagination = ({
|
|
|
89
98
|
{'<'}
|
|
90
99
|
</Box>
|
|
91
100
|
)}
|
|
92
|
-
|
|
93
|
-
{pages.map((page, index) =>
|
|
101
|
+
|
|
102
|
+
{pages.map((page, index) =>
|
|
94
103
|
typeof page === 'number' ? (
|
|
95
104
|
<Box
|
|
96
105
|
key={`page-${page}`}
|
|
97
106
|
as="button"
|
|
98
107
|
className={clsx(
|
|
99
108
|
pageButton,
|
|
100
|
-
page === currentPage
|
|
109
|
+
page === currentPage
|
|
110
|
+
? pageButtonVariants.active
|
|
111
|
+
: pageButtonVariants.default,
|
|
101
112
|
)}
|
|
102
113
|
onClick={() => onPageChange(page)}
|
|
103
114
|
>
|
|
@@ -107,9 +118,9 @@ const Pagination = ({
|
|
|
107
118
|
<Box key={`${page}-${index}`} className={ellipsis}>
|
|
108
119
|
...
|
|
109
120
|
</Box>
|
|
110
|
-
)
|
|
111
|
-
)
|
|
112
|
-
|
|
121
|
+
),
|
|
122
|
+
)}
|
|
123
|
+
|
|
113
124
|
{showPrevNext && (
|
|
114
125
|
<Box
|
|
115
126
|
as="button"
|
|
@@ -120,7 +131,7 @@ const Pagination = ({
|
|
|
120
131
|
{'>'}
|
|
121
132
|
</Box>
|
|
122
133
|
)}
|
|
123
|
-
|
|
134
|
+
|
|
124
135
|
{showFirstLast && (
|
|
125
136
|
<Box
|
|
126
137
|
as="button"
|
|
@@ -14,23 +14,33 @@ import {
|
|
|
14
14
|
popoverFooter,
|
|
15
15
|
} from './styles.css';
|
|
16
16
|
import Box from '../Box';
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
import { Sprinkles } from '../../styles/sprinkles.css';
|
|
18
|
+
|
|
19
|
+
export type PopoverPosition =
|
|
20
|
+
| 'top'
|
|
21
|
+
| 'bottom'
|
|
22
|
+
| 'left'
|
|
23
|
+
| 'right'
|
|
24
|
+
| 'topLeft'
|
|
25
|
+
| 'topRight'
|
|
26
|
+
| 'bottomLeft'
|
|
27
|
+
| 'bottomRight';
|
|
19
28
|
export type PopoverTriggerType = 'click' | 'hover';
|
|
20
29
|
|
|
21
|
-
export
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
export type PopoverProps = React.HTMLAttributes<HTMLDivElement> &
|
|
31
|
+
Sprinkles & {
|
|
32
|
+
trigger: React.ReactNode;
|
|
33
|
+
children: React.ReactNode;
|
|
34
|
+
position?: PopoverPosition;
|
|
35
|
+
title?: string;
|
|
36
|
+
footer?: React.ReactNode;
|
|
37
|
+
showArrow?: boolean;
|
|
38
|
+
triggerType?: PopoverTriggerType;
|
|
39
|
+
closeOnClickOutside?: boolean;
|
|
40
|
+
closeOnEscape?: boolean;
|
|
41
|
+
defaultOpen?: boolean;
|
|
42
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
43
|
+
};
|
|
34
44
|
|
|
35
45
|
const Popover = ({
|
|
36
46
|
trigger,
|
|
@@ -58,7 +68,10 @@ const Popover = ({
|
|
|
58
68
|
if (!closeOnClickOutside) return;
|
|
59
69
|
|
|
60
70
|
const handleClickOutside = (event: MouseEvent) => {
|
|
61
|
-
if (
|
|
71
|
+
if (
|
|
72
|
+
containerRef.current &&
|
|
73
|
+
!containerRef.current.contains(event.target as Node)
|
|
74
|
+
) {
|
|
62
75
|
setIsOpen(false);
|
|
63
76
|
}
|
|
64
77
|
};
|
|
@@ -118,7 +131,7 @@ const Popover = ({
|
|
|
118
131
|
>
|
|
119
132
|
{trigger}
|
|
120
133
|
</Box>
|
|
121
|
-
|
|
134
|
+
|
|
122
135
|
{isOpen && (
|
|
123
136
|
<Box
|
|
124
137
|
className={clsx(popoverContent, popoverPositionVariants[position])}
|
|
@@ -128,10 +141,13 @@ const Popover = ({
|
|
|
128
141
|
{showArrow && (
|
|
129
142
|
<Box
|
|
130
143
|
as="span"
|
|
131
|
-
className={clsx(
|
|
144
|
+
className={clsx(
|
|
145
|
+
popoverArrow,
|
|
146
|
+
popoverArrowPositionVariants[position],
|
|
147
|
+
)}
|
|
132
148
|
/>
|
|
133
149
|
)}
|
|
134
|
-
|
|
150
|
+
|
|
135
151
|
{(title || triggerType === 'click') && (
|
|
136
152
|
<Box as="div" className={popoverHeader}>
|
|
137
153
|
{title && (
|
|
@@ -152,11 +168,11 @@ const Popover = ({
|
|
|
152
168
|
)}
|
|
153
169
|
</Box>
|
|
154
170
|
)}
|
|
155
|
-
|
|
171
|
+
|
|
156
172
|
<Box as="div" className={popoverBody}>
|
|
157
173
|
{children}
|
|
158
174
|
</Box>
|
|
159
|
-
|
|
175
|
+
|
|
160
176
|
{footer && (
|
|
161
177
|
<Box as="div" className={popoverFooter}>
|
|
162
178
|
{footer}
|
|
@@ -7,15 +7,16 @@ import {
|
|
|
7
7
|
progressLabel,
|
|
8
8
|
} from './styles.css';
|
|
9
9
|
import Box from '../Box';
|
|
10
|
+
import { Sprinkles } from '../../styles/sprinkles.css';
|
|
10
11
|
|
|
11
|
-
type ProgressProps =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
12
|
+
type ProgressProps = React.HTMLAttributes<HTMLDivElement> &
|
|
13
|
+
Sprinkles & {
|
|
14
|
+
value: number;
|
|
15
|
+
max?: number;
|
|
16
|
+
label?: string;
|
|
17
|
+
showPercentage?: boolean;
|
|
18
|
+
variant?: 'default' | 'success' | 'warning' | 'error';
|
|
19
|
+
};
|
|
19
20
|
|
|
20
21
|
const Progress = ({
|
|
21
22
|
value,
|
|
@@ -26,41 +27,41 @@ const Progress = ({
|
|
|
26
27
|
className,
|
|
27
28
|
}: ProgressProps) => {
|
|
28
29
|
const percentage = Math.min(Math.max((value / max) * 100, 0), 100);
|
|
29
|
-
|
|
30
|
+
|
|
30
31
|
return (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<Box
|
|
34
|
-
className={progressLabel}
|
|
35
|
-
display="flex"
|
|
36
|
-
justifyContent="space-between"
|
|
37
|
-
fontSize="12px"
|
|
38
|
-
fontWeight="500"
|
|
39
|
-
color="c5-600"
|
|
40
|
-
marginBottom="small"
|
|
41
|
-
fontFamily="body"
|
|
42
|
-
>
|
|
43
|
-
{label && <Box as="span">{label}</Box>}
|
|
44
|
-
{showPercentage && <Box as="span">{percentage}%</Box>}
|
|
45
|
-
</Box>
|
|
46
|
-
)}
|
|
32
|
+
<Box className={clsx(progress, className)} width="100%">
|
|
33
|
+
{(label || showPercentage) && (
|
|
47
34
|
<Box
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
35
|
+
className={progressLabel}
|
|
36
|
+
display="flex"
|
|
37
|
+
justifyContent="space-between"
|
|
38
|
+
fontSize="12px"
|
|
39
|
+
fontWeight="500"
|
|
40
|
+
color="c5-600"
|
|
41
|
+
marginBottom="small"
|
|
42
|
+
fontFamily="body"
|
|
54
43
|
>
|
|
55
|
-
<Box
|
|
56
|
-
|
|
57
|
-
className={progressFill[variant]}
|
|
58
|
-
style={{ width: `${percentage}%` }}
|
|
59
|
-
role="presentation"
|
|
60
|
-
/>
|
|
44
|
+
{label && <Box as="span">{label}</Box>}
|
|
45
|
+
{showPercentage && <Box as="span">{percentage}%</Box>}
|
|
61
46
|
</Box>
|
|
47
|
+
)}
|
|
48
|
+
<Box
|
|
49
|
+
as="div"
|
|
50
|
+
className={progressBar[variant]}
|
|
51
|
+
role="progressbar"
|
|
52
|
+
aria-valuenow={value}
|
|
53
|
+
aria-valuemin={0}
|
|
54
|
+
aria-valuemax={max}
|
|
55
|
+
>
|
|
56
|
+
<Box
|
|
57
|
+
as="div"
|
|
58
|
+
className={progressFill[variant]}
|
|
59
|
+
style={{ width: `${percentage}%` }}
|
|
60
|
+
role="presentation"
|
|
61
|
+
/>
|
|
62
62
|
</Box>
|
|
63
|
-
|
|
63
|
+
</Box>
|
|
64
|
+
);
|
|
64
65
|
};
|
|
65
66
|
|
|
66
67
|
export default Progress;
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
radioGroupHorizontal,
|
|
9
9
|
} from './styles.css';
|
|
10
10
|
import Box from '../Box';
|
|
11
|
+
import { Sprinkles } from '../../styles/sprinkles.css';
|
|
11
12
|
|
|
12
13
|
type RadioContextType = {
|
|
13
14
|
name?: string;
|
|
@@ -20,17 +21,18 @@ const RadioContext = createContext<RadioContextType>({});
|
|
|
20
21
|
type RadioProps = Omit<
|
|
21
22
|
React.InputHTMLAttributes<HTMLInputElement>,
|
|
22
23
|
'type' | 'value' | 'onChange'
|
|
23
|
-
> &
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
> &
|
|
25
|
+
Sprinkles & {
|
|
26
|
+
label?: string;
|
|
27
|
+
value: string;
|
|
28
|
+
};
|
|
27
29
|
|
|
28
30
|
const Radio = forwardRef<HTMLInputElement, RadioProps>(
|
|
29
31
|
({ label, className, value, ...props }, ref) => {
|
|
30
32
|
const context = useContext(RadioContext);
|
|
31
33
|
const name = context.name || props.name;
|
|
32
34
|
const isChecked = context.value === value;
|
|
33
|
-
|
|
35
|
+
|
|
34
36
|
const handleChange = () => {
|
|
35
37
|
if (context.onChange) {
|
|
36
38
|
context.onChange(value);
|
|
@@ -58,7 +60,11 @@ const Radio = forwardRef<HTMLInputElement, RadioProps>(
|
|
|
58
60
|
className={radioInput}
|
|
59
61
|
{...props}
|
|
60
62
|
/>
|
|
61
|
-
{label &&
|
|
63
|
+
{label && (
|
|
64
|
+
<Box as="span" className={radioLabel}>
|
|
65
|
+
{label}
|
|
66
|
+
</Box>
|
|
67
|
+
)}
|
|
62
68
|
</Box>
|
|
63
69
|
);
|
|
64
70
|
},
|
|
@@ -6,16 +6,17 @@ import {
|
|
|
6
6
|
scrollAreaViewport,
|
|
7
7
|
} from './styles.css';
|
|
8
8
|
import Box from '../Box';
|
|
9
|
+
import { Sprinkles } from '../../styles/sprinkles.css';
|
|
9
10
|
|
|
10
11
|
export type ScrollAreaOrientation = 'vertical' | 'horizontal' | 'both';
|
|
11
12
|
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
13
|
+
export type ScrollAreaProps = React.HTMLAttributes<HTMLDivElement> &
|
|
14
|
+
Sprinkles & {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
orientation?: ScrollAreaOrientation;
|
|
17
|
+
maxHeight?: string | number;
|
|
18
|
+
maxWidth?: string | number;
|
|
19
|
+
};
|
|
19
20
|
|
|
20
21
|
const ScrollArea = ({
|
|
21
22
|
children,
|
|
@@ -40,9 +41,7 @@ const ScrollArea = ({
|
|
|
40
41
|
style={style}
|
|
41
42
|
{...props}
|
|
42
43
|
>
|
|
43
|
-
<Box className={scrollAreaViewport}>
|
|
44
|
-
{children}
|
|
45
|
-
</Box>
|
|
44
|
+
<Box className={scrollAreaViewport}>{children}</Box>
|
|
46
45
|
</Box>
|
|
47
46
|
);
|
|
48
47
|
};
|
|
@@ -2,6 +2,7 @@ import clsx from 'clsx';
|
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
3
|
import { select, selectLabel, selectWrapper } from './styles.css';
|
|
4
4
|
import Box from '../Box';
|
|
5
|
+
import { Sprinkles } from '../../styles/sprinkles.css';
|
|
5
6
|
|
|
6
7
|
type SelectOption = {
|
|
7
8
|
value: string;
|
|
@@ -9,15 +10,19 @@ type SelectOption = {
|
|
|
9
10
|
disabled?: boolean;
|
|
10
11
|
};
|
|
11
12
|
|
|
12
|
-
type SelectProps = Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size'> &
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
type SelectProps = Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size'> &
|
|
14
|
+
Sprinkles & {
|
|
15
|
+
label?: string;
|
|
16
|
+
options: SelectOption[];
|
|
17
|
+
error?: boolean;
|
|
18
|
+
fullWidth?: boolean;
|
|
19
|
+
};
|
|
18
20
|
|
|
19
21
|
const Select = forwardRef<HTMLSelectElement, SelectProps>(
|
|
20
|
-
(
|
|
22
|
+
(
|
|
23
|
+
{ label, options, error = false, fullWidth = true, className, ...props },
|
|
24
|
+
ref,
|
|
25
|
+
) => {
|
|
21
26
|
return (
|
|
22
27
|
<Box className={selectWrapper} width="100%">
|
|
23
28
|
{label && (
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
separator,
|
|
5
|
-
separatorOrientation,
|
|
6
|
-
} from './styles.css';
|
|
3
|
+
import { separator, separatorOrientation } from './styles.css';
|
|
7
4
|
import Box from '../Box';
|
|
5
|
+
import { Sprinkles } from '../../styles/sprinkles.css';
|
|
8
6
|
|
|
9
7
|
export type SeparatorOrientation = 'horizontal' | 'vertical';
|
|
10
8
|
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
9
|
+
export type SeparatorProps = React.HTMLAttributes<HTMLHRElement> &
|
|
10
|
+
Sprinkles & {
|
|
11
|
+
orientation?: SeparatorOrientation;
|
|
12
|
+
decorative?: boolean;
|
|
13
|
+
};
|
|
16
14
|
|
|
17
15
|
const Separator = ({
|
|
18
16
|
orientation = 'horizontal',
|
|
@@ -23,11 +21,7 @@ const Separator = ({
|
|
|
23
21
|
return (
|
|
24
22
|
<Box
|
|
25
23
|
as="hr"
|
|
26
|
-
className={clsx(
|
|
27
|
-
separator,
|
|
28
|
-
separatorOrientation[orientation],
|
|
29
|
-
className,
|
|
30
|
-
)}
|
|
24
|
+
className={clsx(separator, separatorOrientation[orientation], className)}
|
|
31
25
|
aria-hidden={decorative}
|
|
32
26
|
{...props}
|
|
33
27
|
/>
|
|
@@ -7,19 +7,21 @@ import {
|
|
|
7
7
|
skeletonAnimation,
|
|
8
8
|
} from './styles.css';
|
|
9
9
|
import Box from '../Box';
|
|
10
|
+
import { Sprinkles } from '../../styles/sprinkles.css';
|
|
10
11
|
|
|
11
12
|
export type SkeletonVariant = 'text' | 'circle' | 'rectangle';
|
|
12
13
|
export type SkeletonSize = 'small' | 'medium' | 'large';
|
|
13
14
|
export type SkeletonAnimation = 'shimmer' | 'pulse' | 'none';
|
|
14
15
|
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
export type SkeletonProps = React.HTMLAttributes<HTMLDivElement> &
|
|
17
|
+
Sprinkles & {
|
|
18
|
+
variant?: SkeletonVariant;
|
|
19
|
+
size?: SkeletonSize;
|
|
20
|
+
animation?: SkeletonAnimation;
|
|
21
|
+
width?: string | number;
|
|
22
|
+
height?: string | number;
|
|
23
|
+
count?: number;
|
|
24
|
+
};
|
|
23
25
|
|
|
24
26
|
const Skeleton = ({
|
|
25
27
|
variant = 'text',
|
|
@@ -54,11 +56,7 @@ const Skeleton = ({
|
|
|
54
56
|
));
|
|
55
57
|
|
|
56
58
|
return (
|
|
57
|
-
<Box
|
|
58
|
-
display="flex"
|
|
59
|
-
flexDirection="column"
|
|
60
|
-
gap="small"
|
|
61
|
-
>
|
|
59
|
+
<Box display="flex" flexDirection="column" gap="small">
|
|
62
60
|
{skeletons}
|
|
63
61
|
</Box>
|
|
64
62
|
);
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
|
-
import {
|
|
3
|
-
spinner,
|
|
4
|
-
spinnerColors,
|
|
5
|
-
spinnerSizes,
|
|
6
|
-
} from './styles.css';
|
|
2
|
+
import { spinner, spinnerColors, spinnerSizes } from './styles.css';
|
|
7
3
|
import React from 'react';
|
|
8
4
|
import Box from '../Box';
|
|
5
|
+
import { Sprinkles } from '../../styles/sprinkles.css';
|
|
9
6
|
|
|
10
|
-
export type SpinnerColor =
|
|
7
|
+
export type SpinnerColor =
|
|
8
|
+
| 'primary'
|
|
9
|
+
| 'secondary'
|
|
10
|
+
| 'success'
|
|
11
|
+
| 'warning'
|
|
12
|
+
| 'error'
|
|
13
|
+
| 'info';
|
|
11
14
|
export type SpinnerSize = 'small' | 'medium' | 'large';
|
|
12
15
|
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
export type SpinnerProps = React.HTMLAttributes<HTMLDivElement> &
|
|
17
|
+
Sprinkles & {
|
|
18
|
+
color?: SpinnerColor;
|
|
19
|
+
size?: SpinnerSize;
|
|
20
|
+
role?: string;
|
|
21
|
+
};
|
|
18
22
|
|
|
19
23
|
const Spinner = ({
|
|
20
24
|
color = 'primary',
|