@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.
Files changed (224) hide show
  1. package/dist/build-manifest.json +3311 -1978
  2. package/dist/{chunk-DGP64SMQ.mjs → chunk-5EXQ5OSW.mjs} +1 -1
  3. package/dist/{chunk-HIODYNPY.mjs → chunk-CGKVSHV7.mjs} +0 -1
  4. package/dist/{chunk-VXRFKQMB.mjs → chunk-CJ5OBPQ7.mjs} +1 -0
  5. package/dist/{chunk-D62WZ7PJ.mjs → chunk-DLVBLJS5.mjs} +1 -1
  6. package/dist/{chunk-3AD3E4FY.mjs → chunk-GJTMCP2V.mjs} +1 -4
  7. package/dist/{chunk-HOWN3CZF.mjs → chunk-GWMUTYRW.mjs} +1 -1
  8. package/dist/{chunk-DB7I3V3C.mjs → chunk-P6ITY5TK.mjs} +0 -1
  9. package/dist/{chunk-HG3TXGUV.mjs → chunk-WBE75WTG.mjs} +1 -2
  10. package/dist/{chunk-P6A62GCQ.mjs → chunk-WV2TDE35.mjs} +1 -4
  11. package/dist/{chunk-IU6IODBX.mjs → chunk-YKUJ2KUN.mjs} +1 -1
  12. package/dist/{chunk-KVXPG4QT.mjs → chunk-ZT5III36.mjs} +0 -1
  13. package/dist/components/Accordion/Accordion.mjs +3 -1
  14. package/dist/components/Accordion/Accordion.types.mjs +0 -0
  15. package/dist/components/Accordion/index.mjs +4 -2
  16. package/dist/components/Alert/Alert.types.mjs +0 -0
  17. package/dist/components/AspectRatio/AspectRatio.types.mjs +0 -0
  18. package/dist/components/Avatar/Avatar.types.mjs +0 -0
  19. package/dist/components/Badge/Badge.mjs +1 -1
  20. package/dist/components/Badge/Badge.types.mjs +0 -0
  21. package/dist/components/Badge/index.mjs +1 -1
  22. package/dist/components/Box/Box.types.mjs +0 -0
  23. package/dist/components/Breadcrumb/Breadcrumb.mjs +1 -1
  24. package/dist/components/Breadcrumb/Breadcrumb.types.mjs +0 -0
  25. package/dist/components/Breadcrumb/index.mjs +1 -1
  26. package/dist/components/Button/Button.types.mjs +0 -0
  27. package/dist/components/Card/Card.types.mjs +0 -0
  28. package/dist/components/Checkbox/Checkbox.types.mjs +0 -0
  29. package/dist/components/Collapse/Collapse.mjs +1 -1
  30. package/dist/components/Collapse/Collapse.types.mjs +0 -0
  31. package/dist/components/Collapse/index.mjs +1 -1
  32. package/dist/components/Combobox/Combobox.mjs +1 -1
  33. package/dist/components/Combobox/Combobox.types.mjs +0 -0
  34. package/dist/components/Combobox/index.mjs +1 -1
  35. package/dist/components/Container/Container.types.mjs +0 -0
  36. package/dist/components/Divider/Divider.mjs +1 -1
  37. package/dist/components/Divider/Divider.types.mjs +0 -0
  38. package/dist/components/Divider/index.mjs +1 -1
  39. package/dist/components/Drawer/Drawer.types.mjs +0 -0
  40. package/dist/components/DropdownMenu/DropdownMenu.types.mjs +0 -0
  41. package/dist/components/EmptyState/EmptyState.types.mjs +0 -0
  42. package/dist/components/FileUpload/FileUpload.mjs +1 -1
  43. package/dist/components/FileUpload/FileUpload.types.mjs +0 -0
  44. package/dist/components/FileUpload/index.mjs +1 -1
  45. package/dist/components/Form/Form.types.mjs +0 -0
  46. package/dist/components/Form/FormInput.mjs +38 -38
  47. package/dist/components/Form/FormInput.types.mjs +0 -0
  48. package/dist/components/Form/index.mjs +38 -38
  49. package/dist/components/Grid/Grid.types.mjs +0 -0
  50. package/dist/components/Icon/Icon.types.mjs +0 -0
  51. package/dist/components/Input/Input.types.mjs +0 -0
  52. package/dist/components/Kbd/Kbd.types.mjs +0 -0
  53. package/dist/components/List/List.mjs +1 -1
  54. package/dist/components/List/List.types.mjs +0 -0
  55. package/dist/components/List/ListItem.mjs +1 -1
  56. package/dist/components/List/ListItem.types.mjs +0 -0
  57. package/dist/components/List/index.mjs +2 -2
  58. package/dist/components/Modal/Modal.types.mjs +0 -0
  59. package/dist/components/Navbar/Navbar.types.mjs +0 -0
  60. package/dist/components/Navbar/NavbarItem.types.mjs +0 -0
  61. package/dist/components/Navbar/index.mjs +3 -3
  62. package/dist/components/NumberInput/NumberInput.types.mjs +0 -0
  63. package/dist/components/Pagination/Pagination.types.mjs +0 -0
  64. package/dist/components/Popover/Popover.types.mjs +0 -0
  65. package/dist/components/Progress/Progress.types.mjs +0 -0
  66. package/dist/components/Radio/Radio.types.mjs +0 -0
  67. package/dist/components/ScrollArea/ScrollArea.types.mjs +0 -0
  68. package/dist/components/Select/Select.mjs +1 -1
  69. package/dist/components/Select/Select.types.mjs +0 -0
  70. package/dist/components/Select/index.mjs +1 -1
  71. package/dist/components/Separator/Separator.types.mjs +0 -0
  72. package/dist/components/Skeleton/Skeleton.types.mjs +0 -0
  73. package/dist/components/Spinner/Spinner.types.mjs +0 -0
  74. package/dist/components/Stack/Stack.types.mjs +0 -0
  75. package/dist/components/Stepper/Stepper.types.mjs +0 -0
  76. package/dist/components/Table/Table.types.mjs +0 -0
  77. package/dist/components/Tabs/Tabs.types.mjs +0 -0
  78. package/dist/components/Tag/Tag.types.mjs +0 -0
  79. package/dist/components/Text/Text.types.mjs +0 -0
  80. package/dist/components/TextArea/TextArea.types.mjs +0 -0
  81. package/dist/components/Toast/Toast.mjs +1 -1
  82. package/dist/components/Toast/Toast.types.mjs +0 -0
  83. package/dist/components/Toast/index.mjs +1 -1
  84. package/dist/components/Toggle/Toggle.types.mjs +0 -0
  85. package/dist/components/Tooltip/Tooltip.types.mjs +0 -0
  86. package/dist/components/VisuallyHidden/VisuallyHidden.types.mjs +0 -0
  87. package/dist/components/index.mjs +65 -65
  88. package/dist/index.core.mjs +65 -65
  89. package/package.json +1 -1
  90. package/src/components/Accordion/Accordion.tsx +7 -22
  91. package/src/components/Accordion/Accordion.types.ts +21 -0
  92. package/src/components/Accordion/index.ts +2 -1
  93. package/src/components/Alert/Alert.tsx +1 -9
  94. package/src/components/Alert/Alert.types.ts +12 -0
  95. package/src/components/AspectRatio/AspectRatio.tsx +2 -8
  96. package/src/components/AspectRatio/AspectRatio.types.ts +9 -0
  97. package/src/components/Avatar/Avatar.tsx +1 -10
  98. package/src/components/Avatar/Avatar.types.ts +13 -0
  99. package/src/components/Badge/Badge.tsx +1 -13
  100. package/src/components/Badge/Badge.types.ts +13 -0
  101. package/src/components/Box/Box.tsx +2 -8
  102. package/src/components/Box/Box.types.ts +9 -0
  103. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +0 -2
  104. package/src/components/Breadcrumb/Breadcrumb.tsx +1 -14
  105. package/src/components/Breadcrumb/Breadcrumb.types.ts +14 -0
  106. package/src/components/Button/Button.tsx +1 -9
  107. package/src/components/Button/Button.types.ts +12 -0
  108. package/src/components/Card/Card.tsx +1 -8
  109. package/src/components/Card/Card.types.ts +12 -0
  110. package/src/components/Checkbox/Checkbox.tsx +1 -7
  111. package/src/components/Checkbox/Checkbox.types.ts +8 -0
  112. package/src/components/Collapse/Collapse.stories.tsx +0 -2
  113. package/src/components/Collapse/Collapse.tsx +2 -14
  114. package/src/components/Collapse/Collapse.types.ts +13 -0
  115. package/src/components/Collapse/styles.css.ts +1 -2
  116. package/src/components/Combobox/Combobox.stories.tsx +1 -1
  117. package/src/components/Combobox/Combobox.tsx +2 -28
  118. package/src/components/Combobox/Combobox.types.ts +28 -0
  119. package/src/components/Combobox/styles.css.ts +1 -1
  120. package/src/components/Container/Container.tsx +1 -11
  121. package/src/components/Container/Container.types.ts +12 -0
  122. package/src/components/Divider/Divider.tsx +1 -11
  123. package/src/components/Divider/Divider.types.ts +11 -0
  124. package/src/components/Drawer/Drawer.tsx +1 -18
  125. package/src/components/Drawer/Drawer.types.ts +19 -0
  126. package/src/components/Drawer/styles.css.ts +1 -1
  127. package/src/components/DropdownMenu/DropdownMenu.tsx +5 -30
  128. package/src/components/DropdownMenu/DropdownMenu.types.ts +31 -0
  129. package/src/components/DropdownMenu/styles.css.ts +1 -1
  130. package/src/components/EmptyState/EmptyState.tsx +1 -9
  131. package/src/components/EmptyState/EmptyState.types.ts +10 -0
  132. package/src/components/EmptyState/styles.css.ts +1 -1
  133. package/src/components/FileUpload/FileUpload.stories.tsx +1 -1
  134. package/src/components/FileUpload/FileUpload.tsx +2 -30
  135. package/src/components/FileUpload/FileUpload.types.ts +31 -0
  136. package/src/components/FileUpload/styles.css.ts +1 -1
  137. package/src/components/Form/Form.stories.tsx +0 -4
  138. package/src/components/Form/Form.tsx +1 -6
  139. package/src/components/Form/Form.types.ts +7 -0
  140. package/src/components/Form/FormInput.tsx +1 -3
  141. package/src/components/Form/FormInput.types.ts +4 -0
  142. package/src/components/Grid/Grid.tsx +1 -12
  143. package/src/components/Grid/Grid.types.ts +13 -0
  144. package/src/components/Icon/Icon.tsx +1 -8
  145. package/src/components/Icon/Icon.types.ts +9 -0
  146. package/src/components/Icon/styles.css.ts +1 -1
  147. package/src/components/Input/Input.stories.tsx +0 -3
  148. package/src/components/Input/Input.tsx +1 -7
  149. package/src/components/Input/Input.types.ts +8 -0
  150. package/src/components/Input/index.ts +1 -0
  151. package/src/components/Kbd/Kbd.tsx +1 -6
  152. package/src/components/Kbd/Kbd.types.ts +7 -0
  153. package/src/components/Kbd/styles.css.ts +1 -1
  154. package/src/components/List/List.tsx +2 -5
  155. package/src/components/List/List.types.ts +6 -0
  156. package/src/components/List/ListItem.tsx +2 -5
  157. package/src/components/List/ListItem.types.ts +6 -0
  158. package/src/components/Modal/Modal.tsx +1 -15
  159. package/src/components/Modal/Modal.types.ts +16 -0
  160. package/src/components/Navbar/Navbar.stories.tsx +0 -3
  161. package/src/components/Navbar/Navbar.tsx +1 -5
  162. package/src/components/Navbar/Navbar.types.ts +6 -0
  163. package/src/components/Navbar/NavbarItem.tsx +1 -5
  164. package/src/components/Navbar/NavbarItem.types.ts +6 -0
  165. package/src/components/NumberInput/NumberInput.stories.tsx +1 -1
  166. package/src/components/NumberInput/NumberInput.tsx +1 -24
  167. package/src/components/NumberInput/NumberInput.types.ts +25 -0
  168. package/src/components/NumberInput/styles.css.ts +1 -1
  169. package/src/components/Pagination/Pagination.stories.tsx +0 -2
  170. package/src/components/Pagination/Pagination.tsx +1 -11
  171. package/src/components/Pagination/Pagination.types.ts +12 -0
  172. package/src/components/Popover/Popover.stories.tsx +0 -2
  173. package/src/components/Popover/Popover.tsx +1 -27
  174. package/src/components/Popover/Popover.types.ts +28 -0
  175. package/src/components/Popover/styles.css.ts +1 -1
  176. package/src/components/Progress/Progress.stories.tsx +0 -2
  177. package/src/components/Progress/Progress.tsx +1 -10
  178. package/src/components/Progress/Progress.types.ts +13 -0
  179. package/src/components/Radio/Radio.tsx +5 -25
  180. package/src/components/Radio/Radio.types.ts +28 -0
  181. package/src/components/ScrollArea/ScrollArea.tsx +1 -11
  182. package/src/components/ScrollArea/ScrollArea.types.ts +12 -0
  183. package/src/components/ScrollArea/styles.css.ts +1 -1
  184. package/src/components/Select/Select.stories.tsx +0 -2
  185. package/src/components/Select/Select.tsx +2 -16
  186. package/src/components/Select/Select.types.ts +16 -0
  187. package/src/components/Select/styles.css.ts +1 -1
  188. package/src/components/Separator/Separator.tsx +1 -9
  189. package/src/components/Separator/Separator.types.ts +10 -0
  190. package/src/components/Separator/styles.css.ts +1 -1
  191. package/src/components/Skeleton/Skeleton.tsx +1 -15
  192. package/src/components/Skeleton/Skeleton.types.ts +16 -0
  193. package/src/components/Skeleton/styles.css.ts +1 -1
  194. package/src/components/Spinner/Spinner.tsx +1 -17
  195. package/src/components/Spinner/Spinner.types.ts +18 -0
  196. package/src/components/Stack/Stack.tsx +1 -21
  197. package/src/components/Stack/Stack.types.ts +23 -0
  198. package/src/components/Stepper/Stepper.stories.tsx +1 -1
  199. package/src/components/Stepper/Stepper.tsx +1 -20
  200. package/src/components/Stepper/Stepper.types.ts +21 -0
  201. package/src/components/Stepper/styles.css.ts +1 -1
  202. package/src/components/Table/Table.tsx +9 -40
  203. package/src/components/Table/Table.types.ts +40 -0
  204. package/src/components/Tabs/Tabs.tsx +7 -33
  205. package/src/components/Tabs/Tabs.types.ts +36 -0
  206. package/src/components/Tag/Tag.tsx +1 -14
  207. package/src/components/Tag/Tag.types.ts +17 -0
  208. package/src/components/Text/Header.tsx +1 -7
  209. package/src/components/Text/P.stories.tsx +0 -2
  210. package/src/components/Text/P.tsx +1 -6
  211. package/src/components/Text/Text.types.ts +15 -0
  212. package/src/components/TextArea/TextArea.stories.tsx +0 -2
  213. package/src/components/TextArea/TextArea.tsx +1 -7
  214. package/src/components/TextArea/TextArea.types.ts +8 -0
  215. package/src/components/Toast/Toast.tsx +13 -59
  216. package/src/components/Toast/Toast.types.ts +58 -0
  217. package/src/components/Toggle/Toggle.tsx +1 -14
  218. package/src/components/Toggle/Toggle.types.ts +15 -0
  219. package/src/components/Tooltip/Tooltip.tsx +1 -11
  220. package/src/components/Tooltip/Tooltip.types.ts +12 -0
  221. package/src/components/VisuallyHidden/VisuallyHidden.tsx +1 -6
  222. package/src/components/VisuallyHidden/VisuallyHidden.types.ts +7 -0
  223. package/src/components/VisuallyHidden/styles.css.ts +1 -1
  224. package/src/components/index.ts +96 -21
@@ -14,33 +14,7 @@ import {
14
14
  popoverFooter,
15
15
  } from './styles.css';
16
16
  import Box from '../Box';
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';
28
- export type PopoverTriggerType = 'click' | 'hover';
29
-
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
- };
17
+ import { type PopoverProps } from './Popover.types';
44
18
 
45
19
  const Popover = ({
46
20
  trigger,
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import { Sprinkles } from '../../styles/sprinkles.css';
3
+
4
+ export type PopoverPosition =
5
+ | 'top'
6
+ | 'bottom'
7
+ | 'left'
8
+ | 'right'
9
+ | 'topLeft'
10
+ | 'topRight'
11
+ | 'bottomLeft'
12
+ | 'bottomRight';
13
+ export type PopoverTriggerType = 'click' | 'hover';
14
+
15
+ export type PopoverProps = React.HTMLAttributes<HTMLDivElement> &
16
+ Sprinkles & {
17
+ trigger: React.ReactNode;
18
+ children: React.ReactNode;
19
+ position?: PopoverPosition;
20
+ title?: string;
21
+ footer?: React.ReactNode;
22
+ showArrow?: boolean;
23
+ triggerType?: PopoverTriggerType;
24
+ closeOnClickOutside?: boolean;
25
+ closeOnEscape?: boolean;
26
+ defaultOpen?: boolean;
27
+ onOpenChange?: (isOpen: boolean) => void;
28
+ };
@@ -1,4 +1,4 @@
1
- import { style, styleVariants, keyframes } from '@vanilla-extract/css';
1
+ import { styleVariants, keyframes } from '@vanilla-extract/css';
2
2
  import { vars } from '../../styles/theme.css';
3
3
  import { styleWithLayer } from '../../styles/utils';
4
4
 
@@ -1,8 +1,6 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-webpack5';
2
2
 
3
3
  import { Progress } from '.';
4
- import React from 'react';
5
-
6
4
  const meta = {
7
5
  title: 'Components/Progress',
8
6
  component: Progress,
@@ -7,16 +7,7 @@ import {
7
7
  progressLabel,
8
8
  } from './styles.css';
9
9
  import Box from '../Box';
10
- import { Sprinkles } from '../../styles/sprinkles.css';
11
-
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
- };
10
+ import { type ProgressProps } from './Progress.types';
20
11
 
21
12
  const Progress = ({
22
13
  value,
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { Sprinkles } from '../../styles/sprinkles.css';
3
+
4
+ export type ProgressVariant = 'default' | 'success' | 'warning' | 'error';
5
+
6
+ export type ProgressProps = React.HTMLAttributes<HTMLDivElement> &
7
+ Sprinkles & {
8
+ value: number;
9
+ max?: number;
10
+ label?: string;
11
+ showPercentage?: boolean;
12
+ variant?: ProgressVariant;
13
+ };
@@ -8,25 +8,14 @@ import {
8
8
  radioGroupHorizontal,
9
9
  } from './styles.css';
10
10
  import Box from '../Box';
11
- import { Sprinkles } from '../../styles/sprinkles.css';
12
-
13
- type RadioContextType = {
14
- name?: string;
15
- value?: string;
16
- onChange?: (value: string) => void;
17
- };
11
+ import {
12
+ type RadioProps,
13
+ type RadioGroupProps,
14
+ type RadioContextType,
15
+ } from './Radio.types';
18
16
 
19
17
  const RadioContext = createContext<RadioContextType>({});
20
18
 
21
- type RadioProps = Omit<
22
- React.InputHTMLAttributes<HTMLInputElement>,
23
- 'type' | 'value' | 'onChange'
24
- > &
25
- Sprinkles & {
26
- label?: string;
27
- value: string;
28
- };
29
-
30
19
  const Radio = forwardRef<HTMLInputElement, RadioProps>(
31
20
  ({ label, className, value, ...props }, ref) => {
32
21
  const context = useContext(RadioContext);
@@ -72,15 +61,6 @@ const Radio = forwardRef<HTMLInputElement, RadioProps>(
72
61
 
73
62
  Radio.displayName = 'Radio';
74
63
 
75
- type RadioGroupProps = {
76
- children: React.ReactNode;
77
- name: string;
78
- value?: string;
79
- onChange?: (value: string) => void;
80
- layout?: 'vertical' | 'horizontal';
81
- className?: string;
82
- };
83
-
84
64
  const RadioGroup = ({
85
65
  children,
86
66
  name,
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import { Sprinkles } from '../../styles/sprinkles.css';
3
+
4
+ export type RadioLayout = 'vertical' | 'horizontal';
5
+
6
+ export type RadioContextType = {
7
+ name?: string;
8
+ value?: string;
9
+ onChange?: (value: string) => void;
10
+ };
11
+
12
+ export type RadioProps = Omit<
13
+ React.InputHTMLAttributes<HTMLInputElement>,
14
+ 'type' | 'value' | 'onChange'
15
+ > &
16
+ Sprinkles & {
17
+ label?: string;
18
+ value: string;
19
+ };
20
+
21
+ export type RadioGroupProps = {
22
+ children: React.ReactNode;
23
+ name: string;
24
+ value?: string;
25
+ onChange?: (value: string) => void;
26
+ layout?: RadioLayout;
27
+ className?: string;
28
+ };
@@ -6,17 +6,7 @@ import {
6
6
  scrollAreaViewport,
7
7
  } from './styles.css';
8
8
  import Box from '../Box';
9
- import { Sprinkles } from '../../styles/sprinkles.css';
10
-
11
- export type ScrollAreaOrientation = 'vertical' | 'horizontal' | 'both';
12
-
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
- };
9
+ import { type ScrollAreaProps } from './ScrollArea.types';
20
10
 
21
11
  const ScrollArea = ({
22
12
  children,
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { Sprinkles } from '../../styles/sprinkles.css';
3
+
4
+ export type ScrollAreaOrientation = 'vertical' | 'horizontal' | 'both';
5
+
6
+ export type ScrollAreaProps = React.HTMLAttributes<HTMLDivElement> &
7
+ Sprinkles & {
8
+ children: React.ReactNode;
9
+ orientation?: ScrollAreaOrientation;
10
+ maxHeight?: string | number;
11
+ maxWidth?: string | number;
12
+ };
@@ -1,4 +1,4 @@
1
- import { style, styleVariants } from '@vanilla-extract/css';
1
+ import { styleVariants } from '@vanilla-extract/css';
2
2
  import { vars } from '../../styles/theme.css';
3
3
  import { styleWithLayer } from '../../styles/utils';
4
4
 
@@ -2,8 +2,6 @@ import type { Meta, StoryObj } from '@storybook/react-webpack5';
2
2
  import { fn } from 'storybook/test';
3
3
 
4
4
  import { Select } from '.';
5
- import React from 'react';
6
-
7
5
  const meta = {
8
6
  title: 'Components/Select',
9
7
  component: Select,
@@ -1,22 +1,8 @@
1
1
  import clsx from 'clsx';
2
- import React, { forwardRef } from 'react';
2
+ import { 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';
6
-
7
- type SelectOption = {
8
- value: string;
9
- label: string;
10
- disabled?: boolean;
11
- };
12
-
13
- type SelectProps = Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size'> &
14
- Sprinkles & {
15
- label?: string;
16
- options: SelectOption[];
17
- error?: boolean;
18
- fullWidth?: boolean;
19
- };
5
+ import { type SelectProps } from './Select.types';
20
6
 
21
7
  const Select = forwardRef<HTMLSelectElement, SelectProps>(
22
8
  (
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { Sprinkles } from '../../styles/sprinkles.css';
3
+
4
+ export type SelectOption = {
5
+ value: string;
6
+ label: string;
7
+ disabled?: boolean;
8
+ };
9
+
10
+ export type SelectProps = Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size'> &
11
+ Sprinkles & {
12
+ label?: string;
13
+ options: SelectOption[];
14
+ error?: boolean;
15
+ fullWidth?: boolean;
16
+ };
@@ -1,4 +1,4 @@
1
- import { style, styleVariants } from '@vanilla-extract/css';
1
+ import { styleVariants } from '@vanilla-extract/css';
2
2
  import { vars } from '../../styles/theme.css';
3
3
  import { styleWithLayer } from '../../styles/utils';
4
4
 
@@ -2,15 +2,7 @@ import clsx from 'clsx';
2
2
  import React from 'react';
3
3
  import { separator, separatorOrientation } from './styles.css';
4
4
  import Box from '../Box';
5
- import { Sprinkles } from '../../styles/sprinkles.css';
6
-
7
- export type SeparatorOrientation = 'horizontal' | 'vertical';
8
-
9
- export type SeparatorProps = React.HTMLAttributes<HTMLHRElement> &
10
- Sprinkles & {
11
- orientation?: SeparatorOrientation;
12
- decorative?: boolean;
13
- };
5
+ import { type SeparatorProps } from './Separator.types';
14
6
 
15
7
  const Separator = ({
16
8
  orientation = 'horizontal',
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { Sprinkles } from '../../styles/sprinkles.css';
3
+
4
+ export type SeparatorOrientation = 'horizontal' | 'vertical';
5
+
6
+ export type SeparatorProps = React.HTMLAttributes<HTMLHRElement> &
7
+ Sprinkles & {
8
+ orientation?: SeparatorOrientation;
9
+ decorative?: boolean;
10
+ };
@@ -1,4 +1,4 @@
1
- import { style, styleVariants } from '@vanilla-extract/css';
1
+ import { styleVariants } from '@vanilla-extract/css';
2
2
  import { vars } from '../../styles/theme.css';
3
3
  import { styleWithLayer } from '../../styles/utils';
4
4
 
@@ -7,21 +7,7 @@ import {
7
7
  skeletonAnimation,
8
8
  } from './styles.css';
9
9
  import Box from '../Box';
10
- import { Sprinkles } from '../../styles/sprinkles.css';
11
-
12
- export type SkeletonVariant = 'text' | 'circle' | 'rectangle';
13
- export type SkeletonSize = 'small' | 'medium' | 'large';
14
- export type SkeletonAnimation = 'shimmer' | 'pulse' | 'none';
15
-
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
- };
10
+ import { type SkeletonProps } from './Skeleton.types';
25
11
 
26
12
  const Skeleton = ({
27
13
  variant = 'text',
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { Sprinkles } from '../../styles/sprinkles.css';
3
+
4
+ export type SkeletonVariant = 'text' | 'circle' | 'rectangle';
5
+ export type SkeletonSize = 'small' | 'medium' | 'large';
6
+ export type SkeletonAnimation = 'shimmer' | 'pulse' | 'none';
7
+
8
+ export type SkeletonProps = React.HTMLAttributes<HTMLDivElement> &
9
+ Sprinkles & {
10
+ variant?: SkeletonVariant;
11
+ size?: SkeletonSize;
12
+ animation?: SkeletonAnimation;
13
+ width?: string | number;
14
+ height?: string | number;
15
+ count?: number;
16
+ };
@@ -1,4 +1,4 @@
1
- import { style, styleVariants, keyframes } from '@vanilla-extract/css';
1
+ import { styleVariants, keyframes } from '@vanilla-extract/css';
2
2
  import { vars } from '../../styles/theme.css';
3
3
  import { styleWithLayer } from '../../styles/utils';
4
4
 
@@ -2,23 +2,7 @@ import clsx from 'clsx';
2
2
  import { spinner, spinnerColors, spinnerSizes } from './styles.css';
3
3
  import React from 'react';
4
4
  import Box from '../Box';
5
- import { Sprinkles } from '../../styles/sprinkles.css';
6
-
7
- export type SpinnerColor =
8
- | 'primary'
9
- | 'secondary'
10
- | 'success'
11
- | 'warning'
12
- | 'error'
13
- | 'info';
14
- export type SpinnerSize = 'small' | 'medium' | 'large';
15
-
16
- export type SpinnerProps = React.HTMLAttributes<HTMLDivElement> &
17
- Sprinkles & {
18
- color?: SpinnerColor;
19
- size?: SpinnerSize;
20
- role?: string;
21
- };
5
+ import { type SpinnerProps } from './Spinner.types';
22
6
 
23
7
  const Spinner = ({
24
8
  color = 'primary',
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { Sprinkles } from '../../styles/sprinkles.css';
3
+
4
+ export type SpinnerColor =
5
+ | 'primary'
6
+ | 'secondary'
7
+ | 'success'
8
+ | 'warning'
9
+ | 'error'
10
+ | 'info';
11
+ export type SpinnerSize = 'small' | 'medium' | 'large';
12
+
13
+ export type SpinnerProps = React.HTMLAttributes<HTMLDivElement> &
14
+ Sprinkles & {
15
+ color?: SpinnerColor;
16
+ size?: SpinnerSize;
17
+ role?: string;
18
+ };
@@ -1,26 +1,6 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import Box from '../Box';
3
- import { Sprinkles } from '../../styles/sprinkles.css';
4
-
5
- export type StackDirection = 'row' | 'column';
6
- export type StackAlign = 'start' | 'center' | 'end' | 'stretch';
7
- export type StackJustify =
8
- | 'start'
9
- | 'center'
10
- | 'end'
11
- | 'between'
12
- | 'around'
13
- | 'evenly';
14
-
15
- export type StackProps = React.HTMLAttributes<HTMLDivElement> &
16
- Sprinkles & {
17
- direction?: StackDirection;
18
- align?: StackAlign;
19
- justify?: StackJustify;
20
- gap?: 'none' | 'small' | 'medium' | 'large';
21
- wrap?: boolean;
22
- children?: React.ReactNode;
23
- };
3
+ import { type StackProps, type StackAlign, type StackJustify } from './Stack.types';
24
4
 
25
5
  const alignMap: Record<StackAlign, string> = {
26
6
  start: 'flex-start',
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import { Sprinkles } from '../../styles/sprinkles.css';
3
+
4
+ export type StackDirection = 'row' | 'column';
5
+ export type StackAlign = 'start' | 'center' | 'end' | 'stretch';
6
+ export type StackJustify =
7
+ | 'start'
8
+ | 'center'
9
+ | 'end'
10
+ | 'between'
11
+ | 'around'
12
+ | 'evenly';
13
+ export type StackGap = 'none' | 'small' | 'medium' | 'large';
14
+
15
+ export type StackProps = React.HTMLAttributes<HTMLDivElement> &
16
+ Sprinkles & {
17
+ direction?: StackDirection;
18
+ align?: StackAlign;
19
+ justify?: StackJustify;
20
+ gap?: StackGap;
21
+ wrap?: boolean;
22
+ children?: React.ReactNode;
23
+ };
@@ -1,6 +1,6 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-webpack5';
2
2
  import { fn } from 'storybook/test';
3
- import React from 'react';
3
+
4
4
  import { Stepper } from '.';
5
5
 
6
6
  const meta = {
@@ -17,26 +17,7 @@ import {
17
17
  stepConnectorVertical,
18
18
  } from './styles.css';
19
19
  import Box from '../Box';
20
- import { Sprinkles } from '../../styles/sprinkles.css';
21
-
22
- export type StepperOrientation = 'horizontal' | 'vertical';
23
- export type StepStatus = 'pending' | 'current' | 'completed';
24
-
25
- export interface Step {
26
- title: string;
27
- description?: string;
28
- status?: StepStatus;
29
- }
30
-
31
- export type StepperProps = React.HTMLAttributes<HTMLDivElement> &
32
- Sprinkles & {
33
- steps: Step[];
34
- currentStep?: number;
35
- orientation?: StepperOrientation;
36
- showConnectors?: boolean;
37
- onStepClick?: (stepIndex: number) => void;
38
- clickable?: boolean;
39
- };
20
+ import { type StepperProps, type StepStatus } from './Stepper.types';
40
21
 
41
22
  const Stepper = ({
42
23
  steps,
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { Sprinkles } from '../../styles/sprinkles.css';
3
+
4
+ export type StepperOrientation = 'horizontal' | 'vertical';
5
+ export type StepStatus = 'pending' | 'current' | 'completed';
6
+
7
+ export interface Step {
8
+ title: string;
9
+ description?: string;
10
+ status?: StepStatus;
11
+ }
12
+
13
+ export type StepperProps = React.HTMLAttributes<HTMLDivElement> &
14
+ Sprinkles & {
15
+ steps: Step[];
16
+ currentStep?: number;
17
+ orientation?: StepperOrientation;
18
+ showConnectors?: boolean;
19
+ onStepClick?: (stepIndex: number) => void;
20
+ clickable?: boolean;
21
+ };
@@ -1,4 +1,4 @@
1
- import { style, styleVariants } from '@vanilla-extract/css';
1
+ import { styleVariants } from '@vanilla-extract/css';
2
2
  import { vars } from '../../styles/theme.css';
3
3
  import { styleWithLayer } from '../../styles/utils';
4
4
 
@@ -11,17 +11,18 @@ import {
11
11
  tableContainer,
12
12
  } from './styles.css';
13
13
  import Box from '../Box';
14
- import { Sprinkles } from '../../styles/sprinkles.css';
14
+ import {
15
+ type TableProps,
16
+ type TheadProps,
17
+ type TbodyProps,
18
+ type TfootProps,
19
+ type TrProps,
20
+ type ThProps,
21
+ type TdProps,
22
+ } from './Table.types';
15
23
 
16
- // Context to pass striping info to rows
17
24
  const TableContext = createContext<{ striped?: boolean }>({});
18
25
 
19
- type TableProps = React.HTMLAttributes<HTMLTableElement> &
20
- Sprinkles & {
21
- children: React.ReactNode;
22
- striped?: boolean;
23
- };
24
-
25
26
  const TableComponent = ({
26
27
  children,
27
28
  striped = false,
@@ -39,11 +40,6 @@ const TableComponent = ({
39
40
  );
40
41
  };
41
42
 
42
- type TheadProps = {
43
- children: React.ReactNode;
44
- className?: string;
45
- };
46
-
47
43
  const Thead = ({ children, className }: TheadProps) => {
48
44
  return (
49
45
  <Box as="thead" className={clsx(thead, className)}>
@@ -52,11 +48,6 @@ const Thead = ({ children, className }: TheadProps) => {
52
48
  );
53
49
  };
54
50
 
55
- type TbodyProps = {
56
- children: React.ReactNode;
57
- className?: string;
58
- };
59
-
60
51
  const Tbody = ({ children, className }: TbodyProps) => {
61
52
  return (
62
53
  <Box as="tbody" className={clsx(tbody, className)}>
@@ -65,11 +56,6 @@ const Tbody = ({ children, className }: TbodyProps) => {
65
56
  );
66
57
  };
67
58
 
68
- type TfootProps = {
69
- children: React.ReactNode;
70
- className?: string;
71
- };
72
-
73
59
  const Tfoot = ({ children, className }: TfootProps) => {
74
60
  return (
75
61
  <Box as="tfoot" className={clsx(tfoot, className)}>
@@ -78,11 +64,6 @@ const Tfoot = ({ children, className }: TfootProps) => {
78
64
  );
79
65
  };
80
66
 
81
- type TrProps = {
82
- children: React.ReactNode;
83
- className?: string;
84
- };
85
-
86
67
  const Tr = ({ children, className }: TrProps) => {
87
68
  const { striped } = useContext(TableContext);
88
69
  return (
@@ -95,11 +76,6 @@ const Tr = ({ children, className }: TrProps) => {
95
76
  );
96
77
  };
97
78
 
98
- type ThProps = {
99
- children?: React.ReactNode;
100
- className?: string;
101
- };
102
-
103
79
  const Th = ({ children, className }: ThProps) => {
104
80
  return (
105
81
  <Box as="th" className={clsx(th, className)}>
@@ -108,13 +84,6 @@ const Th = ({ children, className }: ThProps) => {
108
84
  );
109
85
  };
110
86
 
111
- type TdProps = {
112
- children?: React.ReactNode;
113
- className?: string;
114
- colSpan?: number;
115
- rowSpan?: number;
116
- };
117
-
118
87
  const Td = ({ children, className, colSpan, rowSpan }: TdProps) => {
119
88
  return (
120
89
  <Box