@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
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import clsx from 'clsx';
|
|
3
|
-
import { skeleton, skeletonVariants, skeletonSizes, skeletonAnimation, } from './styles.css';
|
|
4
|
-
import Box from '../Box';
|
|
5
|
-
const Skeleton = ({ variant = 'text', size = 'medium', animation = 'shimmer', width, height, count = 1, className, ...props }) => {
|
|
6
|
-
const style = {
|
|
7
|
-
width: width,
|
|
8
|
-
height: height,
|
|
9
|
-
};
|
|
10
|
-
const skeletons = Array.from({ length: count }, (_, index) => (_jsx(Box, { as: "span", className: clsx(skeleton, skeletonVariants[variant], skeletonSizes[size], skeletonAnimation[animation], className), style: style, "aria-hidden": "true", ...props }, index)));
|
|
11
|
-
return (_jsx(Box, { display: "flex", flexDirection: "column", gap: "small", children: skeletons }));
|
|
12
|
-
};
|
|
13
|
-
export default Skeleton;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Skeleton } from './Skeleton';
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const skeletonVariants: Record<"text" | "circle" | "rectangle", string>;
|
|
2
|
-
export declare const skeletonSizes: Record<"medium" | "large" | "small", string>;
|
|
3
|
-
export declare const skeletonAnimation: Record<"none" | "shimmer" | "pulse", string>;
|
|
4
|
-
export declare const skeleton: string;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { styleVariants, keyframes } from '@vanilla-extract/css';
|
|
2
|
-
import { vars } from '../../styles/theme.css';
|
|
3
|
-
import { styleWithLayer } from '../../styles/utils';
|
|
4
|
-
const shimmer = keyframes({
|
|
5
|
-
'0%': { backgroundPosition: '-200% 0' },
|
|
6
|
-
'100%': { backgroundPosition: '200% 0' },
|
|
7
|
-
});
|
|
8
|
-
const pulse = keyframes({
|
|
9
|
-
'0%, 100%': { opacity: 1 },
|
|
10
|
-
'50%': { opacity: 0.5 },
|
|
11
|
-
});
|
|
12
|
-
export const skeletonVariants = styleVariants({
|
|
13
|
-
text: {
|
|
14
|
-
borderRadius: '0.25rem',
|
|
15
|
-
},
|
|
16
|
-
circle: {
|
|
17
|
-
borderRadius: '50%',
|
|
18
|
-
},
|
|
19
|
-
rectangle: {
|
|
20
|
-
borderRadius: '0.5rem',
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
|
-
export const skeletonSizes = styleVariants({
|
|
24
|
-
small: {
|
|
25
|
-
height: '1rem',
|
|
26
|
-
},
|
|
27
|
-
medium: {
|
|
28
|
-
height: '1.5rem',
|
|
29
|
-
},
|
|
30
|
-
large: {
|
|
31
|
-
height: '2rem',
|
|
32
|
-
},
|
|
33
|
-
});
|
|
34
|
-
export const skeletonAnimation = styleVariants({
|
|
35
|
-
shimmer: {
|
|
36
|
-
background: `linear-gradient(
|
|
37
|
-
90deg,
|
|
38
|
-
${vars.colors.borderMuted} 25%,
|
|
39
|
-
${vars.colors.borderDefault} 50%,
|
|
40
|
-
${vars.colors.borderMuted} 75%
|
|
41
|
-
)`,
|
|
42
|
-
backgroundSize: '200% 100%',
|
|
43
|
-
animation: `${shimmer} 1.5s ease-in-out infinite`,
|
|
44
|
-
},
|
|
45
|
-
pulse: {
|
|
46
|
-
backgroundColor: vars.colors.borderMuted,
|
|
47
|
-
animation: `${pulse} 2s ease-in-out infinite`,
|
|
48
|
-
},
|
|
49
|
-
none: {
|
|
50
|
-
backgroundColor: vars.colors.borderMuted,
|
|
51
|
-
},
|
|
52
|
-
});
|
|
53
|
-
export const skeleton = styleWithLayer({
|
|
54
|
-
width: '100%',
|
|
55
|
-
display: 'inline-block',
|
|
56
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export type SpinnerColor = 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'info';
|
|
3
|
-
export type SpinnerSize = 'small' | 'medium' | 'large';
|
|
4
|
-
export interface SpinnerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
-
color?: SpinnerColor;
|
|
6
|
-
size?: SpinnerSize;
|
|
7
|
-
role?: string;
|
|
8
|
-
}
|
|
9
|
-
declare const Spinner: ({ color, size, role, ...props }: SpinnerProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export default Spinner;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import clsx from 'clsx';
|
|
3
|
-
import { spinner, spinnerColors, spinnerSizes, } from './styles.css';
|
|
4
|
-
import Box from '../Box';
|
|
5
|
-
const Spinner = ({ color = 'primary', size = 'medium', role = 'status', ...props }) => {
|
|
6
|
-
return (_jsx(Box, { as: "div", className: clsx(spinner, spinnerColors[color], spinnerSizes[size], props.className), role: role, "aria-label": "Loading", ...props }));
|
|
7
|
-
};
|
|
8
|
-
export default Spinner;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Spinner } from './Spinner';
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const spin: string;
|
|
2
|
-
export declare const spinnerColors: Record<"primary" | "secondary" | "success" | "warning" | "error" | "info", string>;
|
|
3
|
-
export declare const spinnerSizes: Record<"medium" | "large" | "small", string>;
|
|
4
|
-
export declare const spinner: string;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { style, styleVariants, keyframes } from '@vanilla-extract/css';
|
|
2
|
-
import { vars } from '../../styles/theme.css';
|
|
3
|
-
export const spin = keyframes({
|
|
4
|
-
'0%': { transform: 'rotate(0deg)' },
|
|
5
|
-
'100%': { transform: 'rotate(360deg)' },
|
|
6
|
-
});
|
|
7
|
-
export const spinnerColors = styleVariants({
|
|
8
|
-
primary: {
|
|
9
|
-
borderColor: vars.colors.borderDefault,
|
|
10
|
-
borderTopColor: vars.colors.buttonBackgroundPrimary,
|
|
11
|
-
},
|
|
12
|
-
secondary: {
|
|
13
|
-
borderColor: vars.colors.borderDefault,
|
|
14
|
-
borderTopColor: vars.colors.buttonBackgroundSecondary,
|
|
15
|
-
},
|
|
16
|
-
success: {
|
|
17
|
-
borderColor: vars.colors.borderDefault,
|
|
18
|
-
borderTopColor: vars.colors.alertSuccessBorder,
|
|
19
|
-
},
|
|
20
|
-
warning: {
|
|
21
|
-
borderColor: vars.colors.borderDefault,
|
|
22
|
-
borderTopColor: vars.colors.alertWarningBorder,
|
|
23
|
-
},
|
|
24
|
-
error: {
|
|
25
|
-
borderColor: vars.colors.borderDefault,
|
|
26
|
-
borderTopColor: vars.colors.alertErrorBorder,
|
|
27
|
-
},
|
|
28
|
-
info: {
|
|
29
|
-
borderColor: vars.colors.borderDefault,
|
|
30
|
-
borderTopColor: vars.colors.alertInfoBorder,
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
|
-
export const spinnerSizes = styleVariants({
|
|
34
|
-
small: {
|
|
35
|
-
width: '1rem',
|
|
36
|
-
height: '1rem',
|
|
37
|
-
borderWidth: '2px',
|
|
38
|
-
},
|
|
39
|
-
medium: {
|
|
40
|
-
width: '1.5rem',
|
|
41
|
-
height: '1.5rem',
|
|
42
|
-
borderWidth: '3px',
|
|
43
|
-
},
|
|
44
|
-
large: {
|
|
45
|
-
width: '2rem',
|
|
46
|
-
height: '2rem',
|
|
47
|
-
borderWidth: '4px',
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
export const spinner = style({
|
|
51
|
-
borderRadius: '50%',
|
|
52
|
-
borderStyle: 'solid',
|
|
53
|
-
animation: `${spin} 1s linear infinite`,
|
|
54
|
-
display: 'inline-block',
|
|
55
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export type StackDirection = 'row' | 'column';
|
|
3
|
-
export type StackAlign = 'start' | 'center' | 'end' | 'stretch';
|
|
4
|
-
export type StackJustify = 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly';
|
|
5
|
-
export interface StackProps {
|
|
6
|
-
direction?: StackDirection;
|
|
7
|
-
align?: StackAlign;
|
|
8
|
-
justify?: StackJustify;
|
|
9
|
-
gap?: 'none' | 'small' | 'medium' | 'large';
|
|
10
|
-
wrap?: boolean;
|
|
11
|
-
children?: React.ReactNode;
|
|
12
|
-
className?: string;
|
|
13
|
-
style?: React.CSSProperties;
|
|
14
|
-
}
|
|
15
|
-
declare const Stack: React.ForwardRefExoticComponent<StackProps & React.RefAttributes<HTMLElement>>;
|
|
16
|
-
export default Stack;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import Box from '../Box';
|
|
4
|
-
const alignMap = {
|
|
5
|
-
start: 'flex-start',
|
|
6
|
-
center: 'center',
|
|
7
|
-
end: 'flex-end',
|
|
8
|
-
stretch: 'stretch',
|
|
9
|
-
};
|
|
10
|
-
const justifyMap = {
|
|
11
|
-
start: 'flex-start',
|
|
12
|
-
center: 'center',
|
|
13
|
-
end: 'flex-end',
|
|
14
|
-
between: 'space-between',
|
|
15
|
-
around: 'space-around',
|
|
16
|
-
evenly: 'space-evenly',
|
|
17
|
-
};
|
|
18
|
-
const Stack = forwardRef(({ direction = 'column', align, justify, gap, wrap, children, className, style, ...rest }, ref) => {
|
|
19
|
-
const alignItems = align ? alignMap[align] : undefined;
|
|
20
|
-
const justifyContent = justify ? justifyMap[justify] : undefined;
|
|
21
|
-
return (_jsx(Box, { ref: ref, display: "flex", flexDirection: direction, alignItems: alignItems, justifyContent: justifyContent, gap: gap, className: className, style: { flexWrap: wrap ? 'wrap' : undefined, ...style }, ...rest, children: children }));
|
|
22
|
-
});
|
|
23
|
-
Stack.displayName = 'Stack';
|
|
24
|
-
export default Stack;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Stack } from './Stack';
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export type StepperOrientation = 'horizontal' | 'vertical';
|
|
3
|
-
export type StepStatus = 'pending' | 'current' | 'completed';
|
|
4
|
-
export interface Step {
|
|
5
|
-
title: string;
|
|
6
|
-
description?: string;
|
|
7
|
-
status?: StepStatus;
|
|
8
|
-
}
|
|
9
|
-
export interface StepperProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
10
|
-
steps: Step[];
|
|
11
|
-
currentStep?: number;
|
|
12
|
-
orientation?: StepperOrientation;
|
|
13
|
-
showConnectors?: boolean;
|
|
14
|
-
onStepClick?: (stepIndex: number) => void;
|
|
15
|
-
clickable?: boolean;
|
|
16
|
-
}
|
|
17
|
-
declare const Stepper: ({ steps, currentStep, orientation, showConnectors, onStepClick, clickable, className, ...props }: StepperProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
export default Stepper;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import clsx from 'clsx';
|
|
3
|
-
import { stepperContainer, stepperHorizontal, stepperVertical, step, stepVertical, stepIndicator, stepIndicatorVariants, stepContent, stepContentVertical, stepTitle, stepDescription, stepConnector, stepConnectorCompleted, stepConnectorVertical, } from './styles.css';
|
|
4
|
-
import Box from '../Box';
|
|
5
|
-
const Stepper = ({ steps, currentStep = 0, orientation = 'horizontal', showConnectors = true, onStepClick, clickable = false, className, ...props }) => {
|
|
6
|
-
const getStepStatus = (index) => {
|
|
7
|
-
if (index < currentStep)
|
|
8
|
-
return 'completed';
|
|
9
|
-
if (index === currentStep)
|
|
10
|
-
return 'current';
|
|
11
|
-
return 'pending';
|
|
12
|
-
};
|
|
13
|
-
const handleStepClick = (index) => {
|
|
14
|
-
if (clickable && onStepClick) {
|
|
15
|
-
onStepClick(index);
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
return (_jsx(Box, { className: clsx(stepperContainer, orientation === 'horizontal' ? stepperHorizontal : stepperVertical, className), role: "list", "aria-label": "Step progress", ...props, children: steps.map((stepItem, index) => {
|
|
19
|
-
const status = stepItem.status || getStepStatus(index);
|
|
20
|
-
const isLast = index === steps.length - 1;
|
|
21
|
-
const isCompleted = status === 'completed';
|
|
22
|
-
return (_jsxs(Box, { className: clsx(step, orientation === 'vertical' && stepVertical), role: "listitem", "aria-current": status === 'current' ? 'step' : undefined, children: [showConnectors && !isLast && orientation === 'horizontal' && (_jsx(Box, { className: clsx(stepConnector, isCompleted && stepConnectorCompleted), "aria-hidden": "true" })), showConnectors && !isLast && orientation === 'vertical' && (_jsx(Box, { className: stepConnectorVertical, style: { backgroundColor: isCompleted ? undefined : undefined }, "aria-hidden": "true" })), _jsx(Box, { className: clsx(stepIndicator, stepIndicatorVariants[status]), onClick: () => handleStepClick(index), style: { cursor: clickable ? 'pointer' : 'default' }, "aria-label": `Step ${index + 1}: ${stepItem.title}`, children: status === 'completed' ? '✓' : index + 1 }), _jsxs(Box, { className: clsx(stepContent, orientation === 'vertical' && stepContentVertical), children: [_jsx(Box, { as: "h4", className: stepTitle, children: stepItem.title }), stepItem.description && (_jsx(Box, { as: "p", className: stepDescription, children: stepItem.description }))] })] }, index));
|
|
23
|
-
}) }));
|
|
24
|
-
};
|
|
25
|
-
export default Stepper;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Stepper } from './Stepper';
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare const stepperContainer: string;
|
|
2
|
-
export declare const stepperHorizontal: string;
|
|
3
|
-
export declare const stepperVertical: string;
|
|
4
|
-
export declare const step: string;
|
|
5
|
-
export declare const stepVertical: string;
|
|
6
|
-
export declare const stepIndicator: string;
|
|
7
|
-
export declare const stepIndicatorVariants: Record<"current" | "pending" | "completed", string>;
|
|
8
|
-
export declare const stepContent: string;
|
|
9
|
-
export declare const stepContentVertical: string;
|
|
10
|
-
export declare const stepTitle: string;
|
|
11
|
-
export declare const stepDescription: string;
|
|
12
|
-
export declare const stepConnector: string;
|
|
13
|
-
export declare const stepConnectorCompleted: string;
|
|
14
|
-
export declare const stepConnectorVertical: string;
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { styleVariants } from '@vanilla-extract/css';
|
|
2
|
-
import { vars } from '../../styles/theme.css';
|
|
3
|
-
import { styleWithLayer } from '../../styles/utils';
|
|
4
|
-
export const stepperContainer = styleWithLayer({
|
|
5
|
-
display: 'flex',
|
|
6
|
-
alignItems: 'flex-start',
|
|
7
|
-
width: '100%',
|
|
8
|
-
});
|
|
9
|
-
export const stepperHorizontal = styleWithLayer({
|
|
10
|
-
flexDirection: 'row',
|
|
11
|
-
justifyContent: 'space-between',
|
|
12
|
-
});
|
|
13
|
-
export const stepperVertical = styleWithLayer({
|
|
14
|
-
flexDirection: 'column',
|
|
15
|
-
gap: '1rem',
|
|
16
|
-
});
|
|
17
|
-
export const step = styleWithLayer({
|
|
18
|
-
display: 'flex',
|
|
19
|
-
flexDirection: 'column',
|
|
20
|
-
alignItems: 'center',
|
|
21
|
-
position: 'relative',
|
|
22
|
-
flex: 1,
|
|
23
|
-
});
|
|
24
|
-
export const stepVertical = styleWithLayer({
|
|
25
|
-
flexDirection: 'row',
|
|
26
|
-
alignItems: 'flex-start',
|
|
27
|
-
gap: '1rem',
|
|
28
|
-
});
|
|
29
|
-
export const stepIndicator = styleWithLayer({
|
|
30
|
-
width: '2.5rem',
|
|
31
|
-
height: '2.5rem',
|
|
32
|
-
borderRadius: '50%',
|
|
33
|
-
display: 'flex',
|
|
34
|
-
alignItems: 'center',
|
|
35
|
-
justifyContent: 'center',
|
|
36
|
-
fontWeight: '600',
|
|
37
|
-
fontSize: '14px',
|
|
38
|
-
transition: 'all 0.3s ease',
|
|
39
|
-
zIndex: 1,
|
|
40
|
-
});
|
|
41
|
-
export const stepIndicatorVariants = styleVariants({
|
|
42
|
-
pending: {
|
|
43
|
-
backgroundColor: vars.colors.borderMuted,
|
|
44
|
-
color: vars.colors.textSecondary,
|
|
45
|
-
border: `2px solid ${vars.colors.borderMuted}`,
|
|
46
|
-
},
|
|
47
|
-
current: {
|
|
48
|
-
backgroundColor: vars.colors.buttonBackgroundPrimary,
|
|
49
|
-
color: vars.colors.buttonTextPrimary,
|
|
50
|
-
border: `2px solid ${vars.colors.buttonBackgroundPrimary}`,
|
|
51
|
-
boxShadow: `0 0 0 4px ${vars.colors.alertInfoBackground}`,
|
|
52
|
-
},
|
|
53
|
-
completed: {
|
|
54
|
-
backgroundColor: vars.colors.alertSuccessBorder,
|
|
55
|
-
color: vars.colors.buttonTextPrimary,
|
|
56
|
-
border: `2px solid ${vars.colors.alertSuccessBorder}`,
|
|
57
|
-
},
|
|
58
|
-
});
|
|
59
|
-
export const stepContent = styleWithLayer({
|
|
60
|
-
display: 'flex',
|
|
61
|
-
flexDirection: 'column',
|
|
62
|
-
alignItems: 'center',
|
|
63
|
-
marginTop: '0.5rem',
|
|
64
|
-
textAlign: 'center',
|
|
65
|
-
});
|
|
66
|
-
export const stepContentVertical = styleWithLayer({
|
|
67
|
-
alignItems: 'flex-start',
|
|
68
|
-
marginTop: 0,
|
|
69
|
-
textAlign: 'left',
|
|
70
|
-
});
|
|
71
|
-
export const stepTitle = styleWithLayer({
|
|
72
|
-
fontFamily: vars.fontFamily.heading,
|
|
73
|
-
fontSize: '14px',
|
|
74
|
-
fontWeight: '600',
|
|
75
|
-
color: vars.colors.textPrimary,
|
|
76
|
-
margin: 0,
|
|
77
|
-
});
|
|
78
|
-
export const stepDescription = styleWithLayer({
|
|
79
|
-
fontSize: '12px',
|
|
80
|
-
color: vars.colors.textSecondary,
|
|
81
|
-
marginTop: '0.25rem',
|
|
82
|
-
maxWidth: '200px',
|
|
83
|
-
});
|
|
84
|
-
export const stepConnector = styleWithLayer({
|
|
85
|
-
position: 'absolute',
|
|
86
|
-
top: '1.25rem',
|
|
87
|
-
left: 'calc(50% + 1.5rem)',
|
|
88
|
-
right: 'calc(-50% + 1.5rem)',
|
|
89
|
-
height: '2px',
|
|
90
|
-
backgroundColor: vars.colors.borderMuted,
|
|
91
|
-
zIndex: 0,
|
|
92
|
-
});
|
|
93
|
-
export const stepConnectorCompleted = styleWithLayer({
|
|
94
|
-
backgroundColor: vars.colors.alertSuccessBorder,
|
|
95
|
-
});
|
|
96
|
-
export const stepConnectorVertical = styleWithLayer({
|
|
97
|
-
position: 'absolute',
|
|
98
|
-
top: '2.5rem',
|
|
99
|
-
left: '1.25rem',
|
|
100
|
-
width: '2px',
|
|
101
|
-
height: 'calc(100% + 1rem)',
|
|
102
|
-
backgroundColor: vars.colors.borderMuted,
|
|
103
|
-
zIndex: 0,
|
|
104
|
-
});
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
type TableProps = {
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
className?: string;
|
|
5
|
-
striped?: boolean;
|
|
6
|
-
containerClassName?: string;
|
|
7
|
-
};
|
|
8
|
-
type TheadProps = {
|
|
9
|
-
children: React.ReactNode;
|
|
10
|
-
className?: string;
|
|
11
|
-
};
|
|
12
|
-
type TbodyProps = {
|
|
13
|
-
children: React.ReactNode;
|
|
14
|
-
className?: string;
|
|
15
|
-
};
|
|
16
|
-
type TfootProps = {
|
|
17
|
-
children: React.ReactNode;
|
|
18
|
-
className?: string;
|
|
19
|
-
};
|
|
20
|
-
type TrProps = {
|
|
21
|
-
children: React.ReactNode;
|
|
22
|
-
className?: string;
|
|
23
|
-
};
|
|
24
|
-
type ThProps = {
|
|
25
|
-
children?: React.ReactNode;
|
|
26
|
-
className?: string;
|
|
27
|
-
};
|
|
28
|
-
type TdProps = {
|
|
29
|
-
children?: React.ReactNode;
|
|
30
|
-
className?: string;
|
|
31
|
-
colSpan?: number;
|
|
32
|
-
rowSpan?: number;
|
|
33
|
-
};
|
|
34
|
-
declare const Table: (({ children, className, striped, containerClassName, }: TableProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
35
|
-
Thead: ({ children, className }: TheadProps) => import("react/jsx-runtime").JSX.Element;
|
|
36
|
-
Tbody: ({ children, className }: TbodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
37
|
-
Tfoot: ({ children, className }: TfootProps) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
-
Tr: ({ children, className }: TrProps) => import("react/jsx-runtime").JSX.Element;
|
|
39
|
-
Th: ({ children, className }: ThProps) => import("react/jsx-runtime").JSX.Element;
|
|
40
|
-
Td: ({ children, className, colSpan, rowSpan }: TdProps) => import("react/jsx-runtime").JSX.Element;
|
|
41
|
-
};
|
|
42
|
-
export default Table;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import clsx from 'clsx';
|
|
3
|
-
import { createContext, useContext } from 'react';
|
|
4
|
-
import { table, thead, tbody, tfoot, tr, th, td, tableContainer, } from './styles.css';
|
|
5
|
-
import Box from '../Box';
|
|
6
|
-
// Context to pass striping info to rows
|
|
7
|
-
const TableContext = createContext({});
|
|
8
|
-
const TableComponent = ({ children, className, striped = false, containerClassName, }) => {
|
|
9
|
-
return (_jsx(TableContext.Provider, { value: { striped }, children: _jsx(Box, { className: clsx(tableContainer, containerClassName), width: "100%", children: _jsx(Box, { as: "table", className: clsx(table, className), children: children }) }) }));
|
|
10
|
-
};
|
|
11
|
-
const Thead = ({ children, className }) => {
|
|
12
|
-
return _jsx(Box, { as: "thead", className: clsx(thead, className), children: children });
|
|
13
|
-
};
|
|
14
|
-
const Tbody = ({ children, className }) => {
|
|
15
|
-
return _jsx(Box, { as: "tbody", className: clsx(tbody, className), children: children });
|
|
16
|
-
};
|
|
17
|
-
const Tfoot = ({ children, className }) => {
|
|
18
|
-
return _jsx(Box, { as: "tfoot", className: clsx(tfoot, className), children: children });
|
|
19
|
-
};
|
|
20
|
-
const Tr = ({ children, className }) => {
|
|
21
|
-
const { striped } = useContext(TableContext);
|
|
22
|
-
return (_jsx(Box, { as: "tr", className: clsx(tr[striped ? 'striped' : 'default'], className), children: children }));
|
|
23
|
-
};
|
|
24
|
-
const Th = ({ children, className }) => {
|
|
25
|
-
return _jsx(Box, { as: "th", className: clsx(th, className), children: children });
|
|
26
|
-
};
|
|
27
|
-
const Td = ({ children, className, colSpan, rowSpan }) => {
|
|
28
|
-
return (_jsx(Box, { as: "td", className: clsx(td, className), colSpan: colSpan, rowSpan: rowSpan, children: children }));
|
|
29
|
-
};
|
|
30
|
-
// Attach sub-components
|
|
31
|
-
const Table = Object.assign(TableComponent, {
|
|
32
|
-
Thead,
|
|
33
|
-
Tbody,
|
|
34
|
-
Tfoot,
|
|
35
|
-
Tr,
|
|
36
|
-
Th,
|
|
37
|
-
Td,
|
|
38
|
-
});
|
|
39
|
-
export default Table;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Table } from './Table';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Table } from './Table';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare const table: string;
|
|
2
|
-
export declare const thead: string;
|
|
3
|
-
export declare const tbody: string;
|
|
4
|
-
export declare const tfoot: string;
|
|
5
|
-
export declare const tr: Record<"default" | "striped", string>;
|
|
6
|
-
export declare const th: string;
|
|
7
|
-
export declare const td: string;
|
|
8
|
-
export declare const tableContainer: string;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { styleVariants } from '@vanilla-extract/css';
|
|
2
|
-
import { vars } from '../../styles/theme.css';
|
|
3
|
-
import { styleWithLayer } from '../../styles/utils';
|
|
4
|
-
export const table = styleWithLayer({
|
|
5
|
-
width: '100%',
|
|
6
|
-
borderCollapse: 'collapse',
|
|
7
|
-
borderSpacing: 0,
|
|
8
|
-
fontFamily: vars.fontFamily.body,
|
|
9
|
-
});
|
|
10
|
-
export const thead = styleWithLayer({
|
|
11
|
-
backgroundColor: vars.colors.backgroundDefault,
|
|
12
|
-
borderBottom: `2px solid ${vars.colors.borderDefault}`,
|
|
13
|
-
});
|
|
14
|
-
export const tbody = styleWithLayer({
|
|
15
|
-
backgroundColor: 'transparent',
|
|
16
|
-
});
|
|
17
|
-
export const tfoot = styleWithLayer({
|
|
18
|
-
backgroundColor: vars.colors.backgroundMuted,
|
|
19
|
-
borderTop: `2px solid ${vars.colors.borderDefault}`,
|
|
20
|
-
fontWeight: 'bold',
|
|
21
|
-
});
|
|
22
|
-
export const tr = styleVariants({
|
|
23
|
-
default: {
|
|
24
|
-
borderBottom: `1px solid ${vars.colors.borderMuted}`,
|
|
25
|
-
':hover': {
|
|
26
|
-
backgroundColor: vars.colors.backgroundMuted,
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
striped: {
|
|
30
|
-
borderBottom: `1px solid ${vars.colors.borderMuted}`,
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
|
-
export const th = styleWithLayer({
|
|
34
|
-
padding: '12px 16px',
|
|
35
|
-
textAlign: 'left',
|
|
36
|
-
fontWeight: '600',
|
|
37
|
-
color: vars.colors.textPrimary,
|
|
38
|
-
whiteSpace: 'nowrap',
|
|
39
|
-
});
|
|
40
|
-
export const td = styleWithLayer({
|
|
41
|
-
padding: '12px 16px',
|
|
42
|
-
color: vars.colors.textPrimary,
|
|
43
|
-
borderBottom: `1px solid ${vars.colors.borderMuted}`,
|
|
44
|
-
});
|
|
45
|
-
export const tableContainer = styleWithLayer({
|
|
46
|
-
overflowX: 'auto',
|
|
47
|
-
border: `1px solid ${vars.colors.borderDefault}`,
|
|
48
|
-
borderRadius: '8px',
|
|
49
|
-
});
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
type TabsProps = {
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
defaultValue?: string;
|
|
5
|
-
orientation?: 'horizontal' | 'vertical';
|
|
6
|
-
className?: string;
|
|
7
|
-
onChange?: (value: string) => void;
|
|
8
|
-
};
|
|
9
|
-
type TabListProps = {
|
|
10
|
-
children: React.ReactNode;
|
|
11
|
-
className?: string;
|
|
12
|
-
};
|
|
13
|
-
type TabProps = {
|
|
14
|
-
value: string;
|
|
15
|
-
children: React.ReactNode;
|
|
16
|
-
disabled?: boolean;
|
|
17
|
-
className?: string;
|
|
18
|
-
};
|
|
19
|
-
type TabPanelProps = {
|
|
20
|
-
value: string;
|
|
21
|
-
children: React.ReactNode;
|
|
22
|
-
className?: string;
|
|
23
|
-
};
|
|
24
|
-
declare const TabsComponent: (({ children, defaultValue, orientation, className, onChange, }: TabsProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
25
|
-
List: ({ children, className }: TabListProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
Tab: ({ value, children, disabled, className }: TabProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
-
Panel: ({ value, children, className }: TabPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
-
};
|
|
29
|
-
export default TabsComponent;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import clsx from 'clsx';
|
|
3
|
-
import { createContext, useContext, useState } from 'react';
|
|
4
|
-
import { tabsContainer, tabsList, tabsListHorizontal, tabsListVertical, tabItem, tabContent, } from './styles.css';
|
|
5
|
-
import Box from '../Box';
|
|
6
|
-
const TabsContext = createContext({
|
|
7
|
-
activeTab: '',
|
|
8
|
-
setActiveTab: () => { },
|
|
9
|
-
});
|
|
10
|
-
const Tabs = ({ children, defaultValue = '', orientation = 'horizontal', className, onChange, }) => {
|
|
11
|
-
const [activeTab, setActiveTab] = useState(defaultValue);
|
|
12
|
-
const handleTabChange = (value) => {
|
|
13
|
-
setActiveTab(value);
|
|
14
|
-
if (onChange) {
|
|
15
|
-
onChange(value);
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
return (_jsx(TabsContext.Provider, { value: { activeTab, setActiveTab: handleTabChange, orientation }, children: _jsx(Box, { className: clsx(tabsContainer, className), width: "100%", children: children }) }));
|
|
19
|
-
};
|
|
20
|
-
const TabList = ({ children, className }) => {
|
|
21
|
-
const { orientation } = useContext(TabsContext);
|
|
22
|
-
return (_jsx(Box, { as: "div", role: "tablist", className: clsx(tabsList, orientation === 'vertical' ? tabsListVertical : tabsListHorizontal, className), children: children }));
|
|
23
|
-
};
|
|
24
|
-
const Tab = ({ value, children, disabled = false, className }) => {
|
|
25
|
-
const { activeTab, setActiveTab, orientation } = useContext(TabsContext);
|
|
26
|
-
const isActive = activeTab === value;
|
|
27
|
-
const handleClick = () => {
|
|
28
|
-
if (!disabled) {
|
|
29
|
-
setActiveTab(value);
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
return (_jsx(Box, { as: "button", role: "tab", "aria-selected": isActive, disabled: disabled, onClick: handleClick, className: clsx(tabItem[orientation === 'vertical'
|
|
33
|
-
? isActive
|
|
34
|
-
? 'verticalActive'
|
|
35
|
-
: 'base'
|
|
36
|
-
: isActive
|
|
37
|
-
? 'active'
|
|
38
|
-
: 'base'], className), children: children }));
|
|
39
|
-
};
|
|
40
|
-
const TabPanel = ({ value, children, className }) => {
|
|
41
|
-
const { activeTab } = useContext(TabsContext);
|
|
42
|
-
const isActive = activeTab === value;
|
|
43
|
-
if (!isActive)
|
|
44
|
-
return null;
|
|
45
|
-
return (_jsx(Box, { as: "div", role: "tabpanel", className: clsx(tabContent, className), children: children }));
|
|
46
|
-
};
|
|
47
|
-
const TabsComponent = Object.assign(Tabs, {
|
|
48
|
-
List: TabList,
|
|
49
|
-
Tab,
|
|
50
|
-
Panel: TabPanel,
|
|
51
|
-
});
|
|
52
|
-
export default TabsComponent;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Tabs } from './Tabs';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Tabs } from './Tabs';
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const tabsContainer: string;
|
|
2
|
-
export declare const tabsList: string;
|
|
3
|
-
export declare const tabsListHorizontal: string;
|
|
4
|
-
export declare const tabsListVertical: string;
|
|
5
|
-
export declare const tabItem: Record<"active" | "base" | "verticalActive", string>;
|
|
6
|
-
export declare const tabContent: string;
|