@jordan-mace/chaser-design-system 1.2.7 → 1.2.8

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 (118) hide show
  1. package/dist/components/Accordion/Accordion.d.ts +5 -6
  2. package/dist/components/Accordion/Accordion.js +4 -4
  3. package/dist/components/Alert/Alert.d.ts +2 -1
  4. package/dist/components/Avatar/Avatar.d.ts +2 -2
  5. package/dist/components/Avatar/Avatar.js +1 -1
  6. package/dist/components/Badge/Badge.d.ts +3 -2
  7. package/dist/components/Breadcrumb/Breadcrumb.d.ts +4 -3
  8. package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
  9. package/dist/components/Button/Button.d.ts +2 -1
  10. package/dist/components/Card/Card.d.ts +2 -1
  11. package/dist/components/Checkbox/Checkbox.d.ts +145 -0
  12. package/dist/components/Checkbox/Checkbox.js +1 -1
  13. package/dist/components/Collapse/Collapse.d.ts +3 -3
  14. package/dist/components/Combobox/Combobox.d.ts +3 -2
  15. package/dist/components/Combobox/Combobox.js +15 -8
  16. package/dist/components/Container/Container.d.ts +155 -3
  17. package/dist/components/Divider/Divider.d.ts +3 -2
  18. package/dist/components/Divider/Divider.js +3 -1
  19. package/dist/components/Drawer/Drawer.d.ts +4 -2
  20. package/dist/components/Drawer/Drawer.js +1 -1
  21. package/dist/components/DropdownMenu/DropdownMenu.d.ts +3 -2
  22. package/dist/components/DropdownMenu/DropdownMenu.js +6 -3
  23. package/dist/components/EmptyState/EmptyState.d.ts +3 -3
  24. package/dist/components/EmptyState/EmptyState.js +1 -1
  25. package/dist/components/FileUpload/FileUpload.d.ts +3 -2
  26. package/dist/components/FileUpload/FileUpload.js +8 -4
  27. package/dist/components/Form/Form.d.ts +2 -2
  28. package/dist/components/Grid/Grid.d.ts +154 -5
  29. package/dist/components/Grid/Grid.js +4 -4
  30. package/dist/components/Icon/Icon.d.ts +2 -2
  31. package/dist/components/Input/Input.d.ts +2 -1
  32. package/dist/components/Kbd/Kbd.d.ts +3 -3
  33. package/dist/components/List/List.d.ts +3 -2
  34. package/dist/components/List/List.js +2 -2
  35. package/dist/components/List/ListItem.d.ts +3 -2
  36. package/dist/components/List/ListItem.js +2 -2
  37. package/dist/components/Modal/Modal.d.ts +4 -2
  38. package/dist/components/Modal/Modal.js +1 -1
  39. package/dist/components/Navbar/Navbar.d.ts +2 -1
  40. package/dist/components/Navbar/NavbarItem.d.ts +2 -1
  41. package/dist/components/NumberInput/NumberInput.d.ts +3 -2
  42. package/dist/components/Pagination/Pagination.d.ts +4 -2
  43. package/dist/components/Pagination/Pagination.js +6 -3
  44. package/dist/components/Popover/Popover.d.ts +3 -2
  45. package/dist/components/Popover/Popover.js +2 -1
  46. package/dist/components/Progress/Progress.d.ts +3 -2
  47. package/dist/components/Radio/Radio.d.ts +145 -0
  48. package/dist/components/Radio/Radio.js +1 -1
  49. package/dist/components/ScrollArea/ScrollArea.d.ts +3 -3
  50. package/dist/components/Select/Select.d.ts +145 -0
  51. package/dist/components/Separator/Separator.d.ts +4 -3
  52. package/dist/components/Separator/Separator.js +1 -1
  53. package/dist/components/Skeleton/Skeleton.d.ts +3 -2
  54. package/dist/components/Spinner/Spinner.d.ts +3 -2
  55. package/dist/components/Spinner/Spinner.js +1 -1
  56. package/dist/components/Stack/Stack.d.ts +156 -5
  57. package/dist/components/Stepper/Stepper.d.ts +3 -2
  58. package/dist/components/Table/Table.d.ts +3 -4
  59. package/dist/components/Table/Table.js +6 -6
  60. package/dist/components/Tabs/Tabs.d.ts +3 -3
  61. package/dist/components/Tabs/Tabs.js +2 -2
  62. package/dist/components/Tag/Tag.d.ts +2 -2
  63. package/dist/components/Text/Header.d.ts +2 -2
  64. package/dist/components/Text/P.d.ts +2 -2
  65. package/dist/components/TextArea/TextArea.d.ts +2 -1
  66. package/dist/components/Toggle/Toggle.d.ts +3 -2
  67. package/dist/components/Toggle/Toggle.js +1 -1
  68. package/dist/components/Tooltip/Tooltip.d.ts +3 -2
  69. package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +4 -4
  70. package/dist/components/VisuallyHidden/VisuallyHidden.js +1 -1
  71. package/package.json +1 -1
  72. package/src/components/Accordion/Accordion.tsx +21 -16
  73. package/src/components/Alert/Alert.tsx +11 -7
  74. package/src/components/Avatar/Avatar.tsx +16 -14
  75. package/src/components/Badge/Badge.tsx +8 -6
  76. package/src/components/Breadcrumb/Breadcrumb.tsx +7 -10
  77. package/src/components/Button/Button.tsx +9 -11
  78. package/src/components/Card/Card.tsx +8 -10
  79. package/src/components/Checkbox/Checkbox.tsx +11 -8
  80. package/src/components/Collapse/Collapse.tsx +12 -9
  81. package/src/components/Combobox/Combobox.tsx +60 -31
  82. package/src/components/Container/Container.tsx +4 -3
  83. package/src/components/Divider/Divider.tsx +9 -5
  84. package/src/components/Drawer/Drawer.tsx +20 -13
  85. package/src/components/DropdownMenu/DropdownMenu.tsx +37 -15
  86. package/src/components/EmptyState/EmptyState.tsx +9 -12
  87. package/src/components/FileUpload/FileUpload.tsx +61 -45
  88. package/src/components/Form/Form.tsx +6 -8
  89. package/src/components/Grid/Grid.tsx +18 -13
  90. package/src/components/Icon/Icon.tsx +7 -6
  91. package/src/components/Input/Input.tsx +7 -8
  92. package/src/components/Kbd/Kbd.tsx +5 -4
  93. package/src/components/List/List.tsx +6 -2
  94. package/src/components/List/ListItem.tsx +6 -2
  95. package/src/components/Modal/Modal.tsx +16 -5
  96. package/src/components/Navbar/Navbar.tsx +2 -1
  97. package/src/components/Navbar/NavbarItem.tsx +2 -1
  98. package/src/components/NumberInput/NumberInput.tsx +29 -22
  99. package/src/components/Pagination/Pagination.tsx +39 -28
  100. package/src/components/Popover/Popover.tsx +37 -21
  101. package/src/components/Progress/Progress.tsx +39 -38
  102. package/src/components/Radio/Radio.tsx +12 -6
  103. package/src/components/ScrollArea/ScrollArea.tsx +9 -10
  104. package/src/components/Select/Select.tsx +12 -7
  105. package/src/components/Separator/Separator.tsx +8 -14
  106. package/src/components/Skeleton/Skeleton.tsx +11 -13
  107. package/src/components/Spinner/Spinner.tsx +15 -11
  108. package/src/components/Stack/Stack.tsx +34 -15
  109. package/src/components/Stepper/Stepper.tsx +19 -17
  110. package/src/components/Table/Table.tsx +31 -21
  111. package/src/components/Tabs/Tabs.tsx +14 -10
  112. package/src/components/Tag/Tag.tsx +8 -7
  113. package/src/components/Text/Header.tsx +6 -5
  114. package/src/components/Text/P.tsx +5 -4
  115. package/src/components/TextArea/TextArea.tsx +7 -8
  116. package/src/components/Toggle/Toggle.tsx +16 -7
  117. package/src/components/Tooltip/Tooltip.tsx +16 -11
  118. package/src/components/VisuallyHidden/VisuallyHidden.tsx +7 -8
@@ -7,14 +7,16 @@ import {
7
7
  } from './styles.css';
8
8
  import React from 'react';
9
9
  import Box from '../Box';
10
+ import { Sprinkles } from '../../styles/sprinkles.css';
10
11
 
11
12
  export type DividerOrientation = 'horizontal' | 'vertical';
12
13
  export type DividerSize = 'small' | 'medium' | 'large';
13
14
 
14
- export interface DividerProps extends React.HTMLAttributes<HTMLHRElement> {
15
- orientation?: DividerOrientation;
16
- size?: DividerSize;
17
- }
15
+ export type DividerProps = React.HTMLAttributes<HTMLHRElement> &
16
+ Sprinkles & {
17
+ orientation?: DividerOrientation;
18
+ size?: DividerSize;
19
+ };
18
20
 
19
21
  const Divider = ({
20
22
  orientation = 'horizontal',
@@ -27,7 +29,9 @@ const Divider = ({
27
29
  className={clsx(
28
30
  divider,
29
31
  dividerOrientations[orientation],
30
- orientation === 'vertical' ? dividerVerticalSizes[size] : dividerSizes[size],
32
+ orientation === 'vertical'
33
+ ? dividerVerticalSizes[size]
34
+ : dividerSizes[size],
31
35
  props.className,
32
36
  )}
33
37
  role="separator"
@@ -11,10 +11,25 @@ import {
11
11
  drawerFooter,
12
12
  } from './styles.css';
13
13
  import Box from '../Box';
14
+ import { Sprinkles } from '../../styles/sprinkles.css';
14
15
 
15
16
  export type DrawerPosition = 'left' | 'right' | 'top' | 'bottom';
16
17
  export type DrawerSize = 'small' | 'medium' | 'large' | 'full';
17
18
 
19
+ type DrawerPropsBase = React.HTMLAttributes<HTMLDivElement> & {
20
+ isOpen: boolean;
21
+ onClose: () => void;
22
+ title?: string;
23
+ position?: DrawerPosition;
24
+ size?: DrawerSize;
25
+ children?: React.ReactNode;
26
+ footer?: React.ReactNode;
27
+ showCloseButton?: boolean;
28
+ closeOnOverlayClick?: boolean;
29
+ };
30
+
31
+ export type DrawerProps = DrawerPropsBase & Sprinkles;
32
+
18
33
  const sizeMap: Record<DrawerPosition, Record<DrawerSize, string>> = {
19
34
  left: {
20
35
  small: '250px',
@@ -42,18 +57,6 @@ const sizeMap: Record<DrawerPosition, Record<DrawerSize, string>> = {
42
57
  },
43
58
  };
44
59
 
45
- export interface DrawerProps extends React.HTMLAttributes<HTMLDivElement> {
46
- isOpen: boolean;
47
- onClose: () => void;
48
- title?: string;
49
- position?: DrawerPosition;
50
- size?: DrawerSize;
51
- children?: React.ReactNode;
52
- footer?: React.ReactNode;
53
- showCloseButton?: boolean;
54
- closeOnOverlayClick?: boolean;
55
- }
56
-
57
60
  const Drawer = ({
58
61
  isOpen,
59
62
  onClose,
@@ -139,7 +142,11 @@ const Drawer = ({
139
142
  {children}
140
143
  </Box>
141
144
 
142
- {footer && <Box as="div" className={drawerFooter}>{footer}</Box>}
145
+ {footer && (
146
+ <Box as="div" className={drawerFooter}>
147
+ {footer}
148
+ </Box>
149
+ )}
143
150
  </Box>
144
151
  </>
145
152
  );
@@ -12,8 +12,13 @@ import {
12
12
  dropdownMenuLabel,
13
13
  } from './styles.css';
14
14
  import Box from '../Box';
15
+ import { Sprinkles } from '../../styles/sprinkles.css';
15
16
 
16
- export type DropdownMenuPosition = 'bottomLeft' | 'bottomRight' | 'topLeft' | 'topRight';
17
+ export type DropdownMenuPosition =
18
+ | 'bottomLeft'
19
+ | 'bottomRight'
20
+ | 'topLeft'
21
+ | 'topRight';
17
22
  export type DropdownMenuItemVariant = 'default' | 'destructive' | 'disabled';
18
23
 
19
24
  export interface DropdownMenuItemProps {
@@ -29,13 +34,14 @@ export interface DropdownMenuGroupProps {
29
34
  items: DropdownMenuItemProps[];
30
35
  }
31
36
 
32
- export interface DropdownMenuProps extends React.HTMLAttributes<HTMLDivElement> {
33
- trigger: React.ReactNode;
34
- items?: DropdownMenuItemProps[];
35
- groups?: DropdownMenuGroupProps[];
36
- position?: DropdownMenuPosition;
37
- closeOnItemClick?: boolean;
38
- }
37
+ export type DropdownMenuProps = React.HTMLAttributes<HTMLDivElement> &
38
+ Sprinkles & {
39
+ trigger: React.ReactNode;
40
+ items?: DropdownMenuItemProps[];
41
+ groups?: DropdownMenuGroupProps[];
42
+ position?: DropdownMenuPosition;
43
+ closeOnItemClick?: boolean;
44
+ };
39
45
 
40
46
  const DropdownMenu = ({
41
47
  trigger,
@@ -51,7 +57,10 @@ const DropdownMenu = ({
51
57
 
52
58
  useEffect(() => {
53
59
  const handleClickOutside = (event: MouseEvent) => {
54
- if (containerRef.current && !containerRef.current.contains(event.target as Node)) {
60
+ if (
61
+ containerRef.current &&
62
+ !containerRef.current.contains(event.target as Node)
63
+ ) {
55
64
  setIsOpen(false);
56
65
  }
57
66
  };
@@ -78,7 +87,7 @@ const DropdownMenu = ({
78
87
 
79
88
  const handleItemClick = (item: DropdownMenuItemProps) => {
80
89
  if (item.disabled || item.variant === 'disabled') return;
81
-
90
+
82
91
  item.onClick?.();
83
92
  if (closeOnItemClick) {
84
93
  setIsOpen(false);
@@ -91,7 +100,11 @@ const DropdownMenu = ({
91
100
  as="button"
92
101
  className={clsx(
93
102
  dropdownMenuItem,
94
- dropdownMenuItemVariants[item.disabled || item.variant === 'disabled' ? 'disabled' : item.variant || 'default'],
103
+ dropdownMenuItemVariants[
104
+ item.disabled || item.variant === 'disabled'
105
+ ? 'disabled'
106
+ : item.variant || 'default'
107
+ ],
95
108
  )}
96
109
  onClick={() => handleItemClick(item)}
97
110
  disabled={item.disabled || item.variant === 'disabled'}
@@ -128,10 +141,13 @@ const DropdownMenu = ({
128
141
  >
129
142
  {trigger}
130
143
  </Box>
131
-
144
+
132
145
  {isOpen && (
133
146
  <Box
134
- className={clsx(dropdownMenuContent, dropdownMenuPositionVariants[position])}
147
+ className={clsx(
148
+ dropdownMenuContent,
149
+ dropdownMenuPositionVariants[position],
150
+ )}
135
151
  role="menu"
136
152
  aria-orientation="vertical"
137
153
  >
@@ -140,10 +156,16 @@ const DropdownMenu = ({
140
156
  {items.map((item, index) => renderItem(item, index))}
141
157
  </Box>
142
158
  )}
143
-
159
+
144
160
  {groups.map((group, index) => (
145
161
  <React.Fragment key={index}>
146
- {index > 0 && <Box as="div" className={dropdownMenuSeparator} role="separator" />}
162
+ {index > 0 && (
163
+ <Box
164
+ as="div"
165
+ className={dropdownMenuSeparator}
166
+ role="separator"
167
+ />
168
+ )}
147
169
  {renderGroup(group, index)}
148
170
  </React.Fragment>
149
171
  ))}
@@ -8,14 +8,15 @@ import {
8
8
  emptyStateAction,
9
9
  } from './styles.css';
10
10
  import Box from '../Box';
11
+ import { Sprinkles } from '../../styles/sprinkles.css';
11
12
 
12
- export interface EmptyStateProps {
13
- icon?: React.ReactNode;
14
- title?: string;
15
- description?: string;
16
- action?: React.ReactNode;
17
- className?: string;
18
- }
13
+ export type EmptyStateProps = React.HTMLAttributes<HTMLDivElement> &
14
+ Sprinkles & {
15
+ icon?: React.ReactNode;
16
+ title?: string;
17
+ description?: string;
18
+ action?: React.ReactNode;
19
+ };
19
20
 
20
21
  const EmptyState = ({
21
22
  icon,
@@ -41,11 +42,7 @@ const EmptyState = ({
41
42
  {description}
42
43
  </Box>
43
44
  )}
44
- {action && (
45
- <Box className={emptyStateAction}>
46
- {action}
47
- </Box>
48
- )}
45
+ {action && <Box className={emptyStateAction}>{action}</Box>}
49
46
  </Box>
50
47
  );
51
48
  };
@@ -21,6 +21,7 @@ import {
21
21
  fileUploadProgressFillVariants,
22
22
  } from './styles.css';
23
23
  import Box from '../Box';
24
+ import { Sprinkles } from '../../styles/sprinkles.css';
24
25
 
25
26
  export interface FileUploadFile {
26
27
  id: string;
@@ -32,21 +33,22 @@ export interface FileUploadFile {
32
33
  errorMessage?: string;
33
34
  }
34
35
 
35
- export interface FileUploadProps extends React.HTMLAttributes<HTMLDivElement> {
36
- label?: string;
37
- files?: FileUploadFile[];
38
- onFilesChange?: (files: FileUploadFile[]) => void;
39
- onFileAdd?: (files: File[]) => void;
40
- onFileRemove?: (fileId: string) => void;
41
- accept?: string;
42
- multiple?: boolean;
43
- maxFileSize?: number;
44
- maxFiles?: number;
45
- disabled?: boolean;
46
- dropzoneText?: string;
47
- hint?: string;
48
- showProgress?: boolean;
49
- }
36
+ export type FileUploadProps = React.HTMLAttributes<HTMLDivElement> &
37
+ Sprinkles & {
38
+ label?: string;
39
+ files?: FileUploadFile[];
40
+ onFilesChange?: (files: FileUploadFile[]) => void;
41
+ onFileAdd?: (files: File[]) => void;
42
+ onFileRemove?: (fileId: string) => void;
43
+ accept?: string;
44
+ multiple?: boolean;
45
+ maxFileSize?: number;
46
+ maxFiles?: number;
47
+ disabled?: boolean;
48
+ dropzoneText?: string;
49
+ hint?: string;
50
+ showProgress?: boolean;
51
+ };
50
52
 
51
53
  const formatFileSize = (bytes: number): string => {
52
54
  if (bytes === 0) return '0 Bytes';
@@ -82,8 +84,8 @@ const FileUpload = ({
82
84
  return `File size exceeds ${formatFileSize(maxFileSize)}`;
83
85
  }
84
86
  if (accept) {
85
- const acceptedTypes = accept.split(',').map(type => type.trim());
86
- const isAccepted = acceptedTypes.some(type => {
87
+ const acceptedTypes = accept.split(',').map((type) => type.trim());
88
+ const isAccepted = acceptedTypes.some((type) => {
87
89
  if (type.includes('*')) {
88
90
  return file.type.startsWith(type.replace('/*', ''));
89
91
  }
@@ -96,36 +98,39 @@ const FileUpload = ({
96
98
  return null;
97
99
  };
98
100
 
99
- const handleFiles = useCallback((fileList: FileList | null) => {
100
- if (!fileList || disabled) return;
101
+ const handleFiles = useCallback(
102
+ (fileList: FileList | null) => {
103
+ if (!fileList || disabled) return;
101
104
 
102
- const newFiles: File[] = [];
103
- const errors: string[] = [];
105
+ const newFiles: File[] = [];
106
+ const errors: string[] = [];
104
107
 
105
- Array.from(fileList).forEach(file => {
106
- const validationError = validateFile(file);
107
- if (validationError) {
108
- errors.push(`${file.name}: ${validationError}`);
109
- } else {
110
- newFiles.push(file);
111
- }
112
- });
108
+ Array.from(fileList).forEach((file) => {
109
+ const validationError = validateFile(file);
110
+ if (validationError) {
111
+ errors.push(`${file.name}: ${validationError}`);
112
+ } else {
113
+ newFiles.push(file);
114
+ }
115
+ });
113
116
 
114
- if (maxFiles && files.length + newFiles.length > maxFiles) {
115
- errors.push(`Maximum ${maxFiles} files allowed`);
116
- newFiles.splice(maxFiles - files.length);
117
- }
117
+ if (maxFiles && files.length + newFiles.length > maxFiles) {
118
+ errors.push(`Maximum ${maxFiles} files allowed`);
119
+ newFiles.splice(maxFiles - files.length);
120
+ }
118
121
 
119
- if (errors.length > 0) {
120
- setError(errors.join(', '));
121
- } else {
122
- setError(null);
123
- }
122
+ if (errors.length > 0) {
123
+ setError(errors.join(', '));
124
+ } else {
125
+ setError(null);
126
+ }
124
127
 
125
- if (newFiles.length > 0) {
126
- onFileAdd?.(newFiles);
127
- }
128
- }, [disabled, files.length, maxFileSize, maxFiles, accept, onFileAdd]);
128
+ if (newFiles.length > 0) {
129
+ onFileAdd?.(newFiles);
130
+ }
131
+ },
132
+ [disabled, files.length, maxFileSize, maxFiles, accept, onFileAdd],
133
+ );
129
134
 
130
135
  const handleDragOver = (e: React.DragEvent) => {
131
136
  e.preventDefault();
@@ -190,7 +195,14 @@ const FileUpload = ({
190
195
  aria-disabled={disabled}
191
196
  >
192
197
  <Box className={fileUploadIcon} aria-hidden="true">
193
- <svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
198
+ <svg
199
+ width="48"
200
+ height="48"
201
+ viewBox="0 0 24 24"
202
+ fill="none"
203
+ stroke="currentColor"
204
+ strokeWidth="2"
205
+ >
194
206
  <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
195
207
  <polyline points="17,8 12,3 7,8" />
196
208
  <line x1="12" y1="3" x2="12" y2="15" />
@@ -233,9 +245,13 @@ const FileUpload = ({
233
245
  </Box>
234
246
  <Box as="p" className={fileUploadItemSize}>
235
247
  {formatFileSize(file.size)}
236
- {file.status === 'uploading' && showProgress && ' • Uploading...'}
248
+ {file.status === 'uploading' &&
249
+ showProgress &&
250
+ ' • Uploading...'}
237
251
  {file.status === 'success' && ' • Complete'}
238
- {file.status === 'error' && file.errorMessage && ` • ${file.errorMessage}`}
252
+ {file.status === 'error' &&
253
+ file.errorMessage &&
254
+ ` • ${file.errorMessage}`}
239
255
  </Box>
240
256
  {showProgress && file.status === 'uploading' && (
241
257
  <Box className={fileUploadProgressBar}>
@@ -2,11 +2,12 @@ import clsx from 'clsx';
2
2
  import React from 'react';
3
3
  import { formStyle } from './styles.css';
4
4
  import Box from '../Box';
5
+ import { Sprinkles } from '../../styles/sprinkles.css';
5
6
 
6
- type FormProps = React.FormHTMLAttributes<HTMLFormElement> & {
7
- className?: string;
8
- children?: React.ReactNode;
9
- };
7
+ type FormProps = React.FormHTMLAttributes<HTMLFormElement> &
8
+ Sprinkles & {
9
+ children?: React.ReactNode;
10
+ };
10
11
 
11
12
  const Form = (props: FormProps) => {
12
13
  return (
@@ -14,10 +15,7 @@ const Form = (props: FormProps) => {
14
15
  as="form"
15
16
  gap="medium"
16
17
  paddingX="large"
17
- className={clsx(
18
- formStyle,
19
- props.className,
20
- )}
18
+ className={clsx(formStyle, props.className)}
21
19
  {...props}
22
20
  >
23
21
  {props.children}
@@ -1,17 +1,17 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import Box from '../Box';
3
+ import { Sprinkles } from '../../styles/sprinkles.css';
3
4
 
4
5
  export type GridColumns = 1 | 2 | 3 | 4 | 5 | 6 | 12;
5
6
  export type GridGap = 'none' | 'small' | 'medium' | 'large';
6
7
 
7
- export interface GridProps {
8
- columns?: GridColumns;
9
- gap?: GridGap;
10
- minChildWidth?: string;
11
- children?: React.ReactNode;
12
- className?: string;
13
- style?: React.CSSProperties;
14
- }
8
+ export type GridProps = React.HTMLAttributes<HTMLDivElement> &
9
+ Sprinkles & {
10
+ columns?: GridColumns;
11
+ gap?: GridGap;
12
+ minChildWidth?: string;
13
+ children?: React.ReactNode;
14
+ };
15
15
 
16
16
  const gapMap: Record<GridGap, string> = {
17
17
  none: '0',
@@ -21,7 +21,7 @@ const gapMap: Record<GridGap, string> = {
21
21
  };
22
22
 
23
23
  const Grid = forwardRef<HTMLElement, GridProps>(
24
- ({ columns, gap = 'medium', minChildWidth, children, className, style }, ref) => {
24
+ ({ columns, gap = 'medium', minChildWidth, children, ...props }, ref) => {
25
25
  const gapValue: GridGap = gap;
26
26
 
27
27
  const gridStyle: React.CSSProperties = {
@@ -30,17 +30,22 @@ const Grid = forwardRef<HTMLElement, GridProps>(
30
30
  };
31
31
 
32
32
  if (minChildWidth) {
33
- gridStyle.gridTemplateColumns = `repeat(auto-fit, minmax(${minChildWidth}, 1fr))`;
33
+ gridStyle.gridTemplateColumns = `repeat(auto-fit, minmax(${minChildWidth},1fr))`;
34
34
  } else if (columns) {
35
- gridStyle.gridTemplateColumns = `repeat(${columns}, 1fr)`;
35
+ gridStyle.gridTemplateColumns = `repeat(${columns},1fr)`;
36
36
  }
37
37
 
38
38
  return (
39
- <Box ref={ref} className={className} style={{ ...gridStyle, ...style }}>
39
+ <Box
40
+ ref={ref}
41
+ className={props.className}
42
+ style={{ ...gridStyle, ...props.style }}
43
+ {...props}
44
+ >
40
45
  {children}
41
46
  </Box>
42
47
  );
43
- }
48
+ },
44
49
  );
45
50
 
46
51
  Grid.displayName = 'Grid';
@@ -2,13 +2,14 @@ import clsx from 'clsx';
2
2
  import React from 'react';
3
3
  import { icon } from './styles.css';
4
4
  import Box from '../Box';
5
+ import { Sprinkles } from '../../styles/sprinkles.css';
5
6
 
6
- type IconProps = {
7
- name?: string;
8
- children?: React.ReactNode;
9
- className?: string;
10
- color?: string;
11
- };
7
+ type IconProps = React.HTMLAttributes<HTMLSpanElement> &
8
+ Sprinkles & {
9
+ name?: string;
10
+ children?: React.ReactNode;
11
+ color?: string;
12
+ };
12
13
 
13
14
  const IconComponent = ({ name, children, className, color }: IconProps) => {
14
15
  const iconMap: Record<string, string> = {
@@ -3,11 +3,13 @@ import React from 'react';
3
3
  import { inputStyle, label } from './styles.css';
4
4
  import { text } from '../Text/styles.css';
5
5
  import Box from '../Box';
6
+ import { Sprinkles } from '../../styles/sprinkles.css';
6
7
 
7
- export type InputProps = React.InputHTMLAttributes<HTMLInputElement> & {
8
- label?: string;
9
- fullWidth?: boolean;
10
- };
8
+ export type InputProps = React.InputHTMLAttributes<HTMLInputElement> &
9
+ Sprinkles & {
10
+ label?: string;
11
+ fullWidth?: boolean;
12
+ };
11
13
 
12
14
  const Input = (props: InputProps) => {
13
15
  return (
@@ -19,10 +21,7 @@ const Input = (props: InputProps) => {
19
21
  {props.label && (
20
22
  <Box
21
23
  as="label"
22
- className={clsx(
23
- text,
24
- label,
25
- )}
24
+ className={clsx(text, label)}
26
25
  marginX={{ mobile: 'auto', tablet: 'none' }}
27
26
  marginY={{ mobile: 'none', tablet: 'auto' }}
28
27
  htmlFor={props.id}
@@ -1,10 +1,11 @@
1
1
  import React from 'react';
2
2
  import { kbd } from './styles.css';
3
+ import { Sprinkles } from '../../styles/sprinkles.css';
3
4
 
4
- export interface KbdProps {
5
- children: React.ReactNode;
6
- className?: string;
7
- }
5
+ export type KbdProps = React.HTMLAttributes<HTMLElement> &
6
+ Sprinkles & {
7
+ children: React.ReactNode;
8
+ };
8
9
 
9
10
  const Kbd = ({ children, className, ...props }: KbdProps) => {
10
11
  return (
@@ -1,10 +1,14 @@
1
1
  import React from 'react';
2
2
  import { list } from './styles.css';
3
3
  import Box from '../Box';
4
+ import { Sprinkles } from '../../styles/sprinkles.css';
4
5
 
5
- const List = ({ children }: { children: React.ReactNode }) => {
6
+ const List = ({
7
+ children,
8
+ ...props
9
+ }: { children: React.ReactNode } & Sprinkles) => {
6
10
  return (
7
- <Box as="ul" className={list}>
11
+ <Box as="ul" className={list} {...props}>
8
12
  {children}
9
13
  </Box>
10
14
  );
@@ -1,10 +1,14 @@
1
1
  import React from 'react';
2
2
  import { listItem } from './styles.css';
3
3
  import Box from '../Box';
4
+ import { Sprinkles } from '../../styles/sprinkles.css';
4
5
 
5
- const ListItem = ({ children }: { children: React.ReactNode }) => {
6
+ const ListItem = ({
7
+ children,
8
+ ...props
9
+ }: { children: React.ReactNode } & Sprinkles) => {
6
10
  return (
7
- <Box as="li" className={listItem}>
11
+ <Box as="li" className={listItem} {...props}>
8
12
  {children}
9
13
  </Box>
10
14
  );
@@ -10,10 +10,11 @@ import {
10
10
  } from './styles.css';
11
11
  import React, { useEffect, useRef } from 'react';
12
12
  import Box from '../Box';
13
+ import { Sprinkles } from '../../styles/sprinkles.css';
13
14
 
14
15
  export type ModalSize = 'small' | 'medium' | 'large' | 'full';
15
16
 
16
- export interface ModalProps extends React.HTMLAttributes<HTMLDialogElement> {
17
+ type ModalPropsType = React.HTMLAttributes<HTMLDialogElement> & {
17
18
  isOpen: boolean;
18
19
  onClose: () => void;
19
20
  title?: string;
@@ -21,7 +22,9 @@ export interface ModalProps extends React.HTMLAttributes<HTMLDialogElement> {
21
22
  children?: React.ReactNode;
22
23
  footer?: React.ReactNode;
23
24
  showCloseButton?: boolean;
24
- }
25
+ };
26
+
27
+ export type ModalProps = ModalPropsType & Sprinkles;
25
28
 
26
29
  interface DialogMethods {
27
30
  showModal: () => void;
@@ -84,7 +87,9 @@ const Modal = ({
84
87
  >
85
88
  {title && (
86
89
  <Box as="div" className={modalHeader}>
87
- <Box as="h2" className={modalTitle}>{title}</Box>
90
+ <Box as="h2" className={modalTitle}>
91
+ {title}
92
+ </Box>
88
93
  {showCloseButton && (
89
94
  <Box
90
95
  as="button"
@@ -99,9 +104,15 @@ const Modal = ({
99
104
  </Box>
100
105
  )}
101
106
 
102
- <Box as="div" className={modalBody}>{children}</Box>
107
+ <Box as="div" className={modalBody}>
108
+ {children}
109
+ </Box>
103
110
 
104
- {footer && <Box as="div" className={modalFooter}>{footer}</Box>}
111
+ {footer && (
112
+ <Box as="div" className={modalFooter}>
113
+ {footer}
114
+ </Box>
115
+ )}
105
116
  </Box>
106
117
  );
107
118
  };
@@ -2,8 +2,9 @@ import clsx from 'clsx';
2
2
  import React from 'react';
3
3
  import { navbarStyle } from './styles.css';
4
4
  import Box from '../Box';
5
+ import { Sprinkles } from '../../styles/sprinkles.css';
5
6
 
6
- type NavbarProps = React.HTMLAttributes<HTMLElement> & {
7
+ type NavbarProps = React.HTMLAttributes<HTMLElement> & Sprinkles & {
7
8
  children?: React.ReactNode;
8
9
  };
9
10
 
@@ -2,8 +2,9 @@ import clsx from 'clsx';
2
2
  import React from 'react';
3
3
  import { navbarItemStyle } from './styles.css';
4
4
  import Box from '../Box';
5
+ import { Sprinkles } from '../../styles/sprinkles.css';
5
6
 
6
- type NavbarItemProps = React.HTMLAttributes<HTMLDivElement> & {
7
+ type NavbarItemProps = React.HTMLAttributes<HTMLDivElement> & Sprinkles & {
7
8
  children?: React.ReactNode;
8
9
  };
9
10