@hyphen/hyphen-components 7.3.2 → 7.3.4

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 (221) hide show
  1. package/dist/css/utilities.css +1 -1
  2. package/dist/css/variables.css +18 -28
  3. package/dist/hyphen-components.cjs.development.js +5873 -5019
  4. package/dist/hyphen-components.cjs.development.js.map +1 -1
  5. package/dist/hyphen-components.cjs.production.min.js +18 -2
  6. package/dist/hyphen-components.cjs.production.min.js.map +1 -1
  7. package/dist/hyphen-components.esm.js +5731 -4844
  8. package/dist/hyphen-components.esm.js.map +1 -1
  9. package/dist/index.d.ts +2799 -57
  10. package/dist/index.js +0 -1
  11. package/package.json +18 -19
  12. package/src/components/Badge/Badge.module.scss +6 -0
  13. package/src/components/Badge/Badge.stories.tsx +1 -0
  14. package/src/components/Badge/Badge.test.tsx +3 -2
  15. package/src/components/Badge/Badge.tsx +5 -3
  16. package/src/components/Box/Box.tsx +5 -2
  17. package/src/components/Button/Button.module.scss +1 -1
  18. package/src/components/Button/Button.test.tsx +2 -2
  19. package/src/components/Calendar/Calendar.test.tsx +262 -0
  20. package/src/components/Card/Card.tsx +2 -0
  21. package/src/components/CheckboxInput/components/Checkbox.module.scss +1 -1
  22. package/src/components/CheckboxInput/components/Checkbox.tsx +2 -0
  23. package/src/components/Details/Details.module.scss +2 -2
  24. package/src/components/Details/Details.tsx +2 -0
  25. package/src/components/Drawer/Drawer.stories.tsx +1 -1
  26. package/src/components/Drawer/Drawer.test.tsx +494 -56
  27. package/src/components/Drawer/Drawer.tsx +7 -1
  28. package/src/components/DropdownMenu/DropdownMenu.test.tsx +532 -12
  29. package/src/components/FormControl/FormControl.tsx +2 -0
  30. package/src/components/Formik/Formik.stories.tsx +30 -7
  31. package/src/components/Formik/FormikSelectInput/FormikSelectInput.tsx +6 -5
  32. package/src/components/Formik/FormikToggleGroup/FormikToggleGroup.tsx +1 -1
  33. package/src/components/HelpText/HelpText.tsx +2 -0
  34. package/src/components/Icon/Icon.stories.tsx +1 -1
  35. package/src/components/Icon/Icon.tsx +2 -0
  36. package/src/components/Modal/Modal.test.tsx +630 -81
  37. package/src/components/Modal/Modal.tsx +2 -0
  38. package/src/components/Modal/components/ModalFooter/ModalFooter.test.tsx +2 -2
  39. package/src/components/Popover/Popover.tsx +2 -0
  40. package/src/components/RadioGroup/RadioInput/RadioInput.tsx +2 -0
  41. package/src/components/SelectInput/SelectInput.stories.tsx +22 -22
  42. package/src/components/SelectInput/SelectInput.tsx +13 -9
  43. package/src/components/SelectInputInset/SelectInputInset.tsx +2 -0
  44. package/src/components/Sidebar/Sidebar.module.scss +4 -0
  45. package/src/components/Sidebar/Sidebar.stories.tsx +8 -4
  46. package/src/components/Sidebar/Sidebar.test.tsx +7 -4
  47. package/src/components/Sidebar/Sidebar.tsx +7 -4
  48. package/src/components/Table/Table.stories.tsx +102 -52
  49. package/src/components/TextInput/TextInput.tsx +2 -0
  50. package/src/components/TextInputInset/TextInputInset.tsx +2 -0
  51. package/src/components/TextareaInputInset/TextareaInputInset.tsx +2 -0
  52. package/src/components/TimePickerNative/TimePickerNative.stories.tsx +0 -1
  53. package/src/components/Toast/Toast.store.ts +1 -1
  54. package/src/components/Toast/Toast.stories.tsx +3 -2
  55. package/src/components/Toast/Toast.test.tsx +8 -6
  56. package/src/components/Toggle/Toggle.tsx +2 -0
  57. package/src/components/ToggleGroup/ToggleGroup.tsx +2 -0
  58. package/src/docs/Colors.mdx +0 -13
  59. package/src/index.ts +2 -0
  60. package/src/lib/getColumnKeys.ts +3 -3
  61. package/src/lib/mergeRefs.ts +1 -1
  62. package/src/lib/tokens.ts +4 -4
  63. package/dist/components/Alert/Alert.constants.d.ts +0 -8
  64. package/dist/components/Alert/Alert.d.ts +0 -42
  65. package/dist/components/Alert/Alert.stories.d.ts +0 -12
  66. package/dist/components/Alert/Alert.types.d.ts +0 -7
  67. package/dist/components/AspectRatio/AspectRatio.d.ts +0 -3
  68. package/dist/components/AspectRatio/AspectRatio.stories.d.ts +0 -6
  69. package/dist/components/Badge/Badge.d.ts +0 -24
  70. package/dist/components/Badge/Badge.stories.d.ts +0 -8
  71. package/dist/components/Box/Box.d.ts +0 -247
  72. package/dist/components/Box/Box.stories.d.ts +0 -46
  73. package/dist/components/Button/Button.constants.d.ts +0 -3
  74. package/dist/components/Button/Button.d.ts +0 -53
  75. package/dist/components/Button/Button.stories.d.ts +0 -16
  76. package/dist/components/Calendar/Calendar.d.ts +0 -7
  77. package/dist/components/Calendar/Calendar.stories.d.ts +0 -12
  78. package/dist/components/Card/Card.d.ts +0 -17
  79. package/dist/components/Card/Card.stories.d.ts +0 -8
  80. package/dist/components/Card/components/CardFooter/CardFooter.d.ts +0 -13
  81. package/dist/components/Card/components/CardHeader/CardHeader.d.ts +0 -13
  82. package/dist/components/Card/components/CardSection/CardSection.d.ts +0 -46
  83. package/dist/components/Card/components/index.d.ts +0 -3
  84. package/dist/components/CheckboxInput/CheckboxInput.d.ts +0 -72
  85. package/dist/components/CheckboxInput/CheckboxInput.stories.d.ts +0 -18
  86. package/dist/components/CheckboxInput/components/Checkbox.d.ts +0 -71
  87. package/dist/components/CheckboxInput/components/CheckboxIcon.d.ts +0 -27
  88. package/dist/components/Collapsible/Collapsible.d.ts +0 -5
  89. package/dist/components/Collapsible/Collapsible.stories.d.ts +0 -9
  90. package/dist/components/Details/Details.d.ts +0 -15
  91. package/dist/components/Details/Details.stories.d.ts +0 -6
  92. package/dist/components/Details/DetailsSummary.d.ts +0 -7
  93. package/dist/components/Drawer/Drawer.d.ts +0 -105
  94. package/dist/components/Drawer/Drawer.stories.d.ts +0 -62
  95. package/dist/components/DropdownMenu/DropdownMenu.d.ts +0 -25
  96. package/dist/components/DropdownMenu/DropdownMenu.stories.d.ts +0 -9
  97. package/dist/components/FormControl/FormControl.d.ts +0 -38
  98. package/dist/components/FormLabel/FormLabel.d.ts +0 -41
  99. package/dist/components/FormLabel/FormLabel.stories.d.ts +0 -6
  100. package/dist/components/Formik/Formik.stories.d.ts +0 -18
  101. package/dist/components/Formik/FormikCheckboxInput/FormikCheckboxInput.d.ts +0 -12
  102. package/dist/components/Formik/FormikRadioGroup/FormikRadioGroup.d.ts +0 -12
  103. package/dist/components/Formik/FormikSelectInput/FormikSelectInput.d.ts +0 -13
  104. package/dist/components/Formik/FormikSelectInputInset/FormikSelectInputInset.d.ts +0 -12
  105. package/dist/components/Formik/FormikSelectInputNative/FormikSelectInputNative.d.ts +0 -12
  106. package/dist/components/Formik/FormikSwitch/FormikSwitch.d.ts +0 -12
  107. package/dist/components/Formik/FormikTextInput/FormikTextInput.d.ts +0 -12
  108. package/dist/components/Formik/FormikTextInputInset/FormikTextInputInset.d.ts +0 -12
  109. package/dist/components/Formik/FormikTextareaInput/FormikTextareaInput.d.ts +0 -12
  110. package/dist/components/Formik/FormikTextareaInputInset/FormikTextareaInputInset.d.ts +0 -12
  111. package/dist/components/Formik/FormikTimePicker/FormikTimePicker.d.ts +0 -12
  112. package/dist/components/Formik/FormikTimePickerNative/FormikTimePickerNative.d.ts +0 -12
  113. package/dist/components/Formik/FormikToggleGroup/FormikToggleGroup.d.ts +0 -20
  114. package/dist/components/Formik/FormikToggleGroupMulti/FormikToggleGroupMulti.d.ts +0 -18
  115. package/dist/components/Heading/Heading.constants.d.ts +0 -10
  116. package/dist/components/Heading/Heading.d.ts +0 -35
  117. package/dist/components/Heading/Heading.stories.d.ts +0 -9
  118. package/dist/components/HelpText/HelpText.d.ts +0 -12
  119. package/dist/components/Icon/Icon.d.ts +0 -22
  120. package/dist/components/Icon/Icon.stories.d.ts +0 -10
  121. package/dist/components/InputValidationMessage/InputValidationMessage.d.ts +0 -9
  122. package/dist/components/Modal/Modal.d.ts +0 -83
  123. package/dist/components/Modal/Modal.stories.d.ts +0 -13
  124. package/dist/components/Modal/components/ModalBody/ModalBody.d.ts +0 -4
  125. package/dist/components/Modal/components/ModalFooter/ModalFooter.d.ts +0 -4
  126. package/dist/components/Modal/components/ModalHeader/ModalHeader.d.ts +0 -21
  127. package/dist/components/Modal/components/index.d.ts +0 -4
  128. package/dist/components/Pagination/Pagination.d.ts +0 -51
  129. package/dist/components/Pagination/Pagination.stories.d.ts +0 -8
  130. package/dist/components/Pagination/Pagination.utilities.d.ts +0 -10
  131. package/dist/components/Popover/Popover.d.ts +0 -8
  132. package/dist/components/Popover/Popover.stories.d.ts +0 -7
  133. package/dist/components/RadioGroup/RadioGroup.d.ts +0 -75
  134. package/dist/components/RadioGroup/RadioGroup.stories.d.ts +0 -16
  135. package/dist/components/RadioGroup/RadioInput/RadioInput.d.ts +0 -57
  136. package/dist/components/RadioGroup/RadioInput/RadioInputIcon.d.ts +0 -27
  137. package/dist/components/RangeInput/RangeInput.d.ts +0 -29
  138. package/dist/components/RangeInput/RangeInput.stories.d.ts +0 -7
  139. package/dist/components/ResponsiveProvider/ResponsiveProvider.d.ts +0 -17
  140. package/dist/components/ResponsiveProvider/ResponsiveProvider.stories.d.ts +0 -7
  141. package/dist/components/SelectInput/SelectInput.d.ts +0 -148
  142. package/dist/components/SelectInput/SelectInput.stories.d.ts +0 -24
  143. package/dist/components/SelectInputInset/SelectInputInset.d.ts +0 -92
  144. package/dist/components/SelectInputInset/SelectInputInset.stories.d.ts +0 -12
  145. package/dist/components/SelectInputNative/SelectInputNative.d.ts +0 -45
  146. package/dist/components/SelectInputNative/SelectInputNative.stories.d.ts +0 -19
  147. package/dist/components/Sidebar/Sidebar.d.ts +0 -57
  148. package/dist/components/Sidebar/Sidebar.stories.d.ts +0 -9
  149. package/dist/components/Spinner/Spinner.d.ts +0 -12
  150. package/dist/components/Spinner/Spinner.stories.d.ts +0 -8
  151. package/dist/components/Switch/Switch.d.ts +0 -64
  152. package/dist/components/Switch/Switch.stories.d.ts +0 -12
  153. package/dist/components/Table/Table.d.ts +0 -86
  154. package/dist/components/Table/Table.stories.d.ts +0 -31
  155. package/dist/components/Table/TableBody/TableBody.d.ts +0 -52
  156. package/dist/components/Table/TableBody/TableBodyCell/TableBodyCell.d.ts +0 -45
  157. package/dist/components/Table/TableHead/TableHead.d.ts +0 -46
  158. package/dist/components/Table/TableHead/TableHeaderCell/TableHeaderCell.d.ts +0 -65
  159. package/dist/components/Table/common/TableRow/TableRow.d.ts +0 -67
  160. package/dist/components/TextInput/TextInput.d.ts +0 -106
  161. package/dist/components/TextInput/TextInput.stories.d.ts +0 -19
  162. package/dist/components/TextInputInset/TextInputInset.d.ts +0 -102
  163. package/dist/components/TextInputInset/TextInputInset.stories.d.ts +0 -13
  164. package/dist/components/TextareaInput/TextareaInput.d.ts +0 -97
  165. package/dist/components/TextareaInput/TextareaInput.stories.d.ts +0 -23
  166. package/dist/components/TextareaInputInset/TextareaInputInset.d.ts +0 -105
  167. package/dist/components/TextareaInputInset/TextareaInputInset.stories.d.ts +0 -12
  168. package/dist/components/ThemeProvider/ThemeProvider.d.ts +0 -15
  169. package/dist/components/ThemeProvider/ThemeProvider.stories.d.ts +0 -6
  170. package/dist/components/TimePicker/TimePicker.d.ts +0 -35
  171. package/dist/components/TimePicker/TimePicker.stories.d.ts +0 -12
  172. package/dist/components/TimePickerNative/TimePickerNative.d.ts +0 -39
  173. package/dist/components/TimePickerNative/TimePickerNative.stories.d.ts +0 -11
  174. package/dist/components/Toast/Toast.store.d.ts +0 -36
  175. package/dist/components/Toast/Toast.stories.d.ts +0 -14
  176. package/dist/components/Toast/Toast.types.d.ts +0 -75
  177. package/dist/components/Toast/ToastContainer.d.ts +0 -43
  178. package/dist/components/Toast/ToastNotification.d.ts +0 -28
  179. package/dist/components/Toast/index.d.ts +0 -4
  180. package/dist/components/Toast/toast.d.ts +0 -20
  181. package/dist/components/Toast/useToasts.d.ts +0 -14
  182. package/dist/components/Toggle/Toggle.d.ts +0 -7
  183. package/dist/components/Toggle/Toggle.stories.d.ts +0 -11
  184. package/dist/components/ToggleGroup/ToggleGroup.d.ts +0 -19
  185. package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts +0 -12
  186. package/dist/components/Tooltip/Tooltip.d.ts +0 -8
  187. package/dist/components/Tooltip/Tooltip.stories.d.ts +0 -8
  188. package/dist/constants/keyCodes.d.ts +0 -2
  189. package/dist/css/index.css +0 -36
  190. package/dist/hooks/index.d.ts +0 -6
  191. package/dist/hooks/useBreakpoint/useBreakpoint.d.ts +0 -9
  192. package/dist/hooks/useBreakpoint/useBreakpoint.stories.d.ts +0 -6
  193. package/dist/hooks/useIsMobile/useIsMobile.d.ts +0 -1
  194. package/dist/hooks/useIsMobile/useIsMobile.stories.d.ts +0 -6
  195. package/dist/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.d.ts +0 -2
  196. package/dist/hooks/useOpenClose/useOpenClose.d.ts +0 -39
  197. package/dist/hooks/useOpenClose/useOpenClose.stories.d.ts +0 -6
  198. package/dist/hooks/useTheme/useTheme.d.ts +0 -5
  199. package/dist/hooks/useTheme/useTheme.stories.d.ts +0 -6
  200. package/dist/hooks/useWindowSize/useWindowSize.d.ts +0 -7
  201. package/dist/hooks/useWindowSize/useWindowSize.stories.d.ts +0 -6
  202. package/dist/lib/cssShorthandToClasses.d.ts +0 -4
  203. package/dist/lib/doesStringIncludeCssUnit.d.ts +0 -1
  204. package/dist/lib/generateResponsiveClasses.d.ts +0 -2
  205. package/dist/lib/getAutoCompleteValue.d.ts +0 -1
  206. package/dist/lib/getColumnKeys.d.ts +0 -3
  207. package/dist/lib/getDimensionCss.d.ts +0 -12
  208. package/dist/lib/getElementType.d.ts +0 -14
  209. package/dist/lib/getFlexCss.d.ts +0 -9
  210. package/dist/lib/index.d.ts +0 -15
  211. package/dist/lib/isFunction.d.ts +0 -3
  212. package/dist/lib/mergeRefs.d.ts +0 -2
  213. package/dist/lib/prefersReducedMotion.d.ts +0 -1
  214. package/dist/lib/react-children-utilities/filter.d.ts +0 -3
  215. package/dist/lib/react-children-utilities/index.d.ts +0 -1
  216. package/dist/lib/reactRouterClickHandler.d.ts +0 -12
  217. package/dist/lib/resolveValue.d.ts +0 -3
  218. package/dist/lib/tokens.d.ts +0 -22
  219. package/dist/modes.d.ts +0 -8
  220. package/dist/types/index.d.ts +0 -103
  221. package/dist/types/lib.types.d.ts +0 -3
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import { Meta } from '@storybook/react-vite';
3
- import { Sidebar } from './Sidebar';
4
- declare const meta: Meta<typeof Sidebar>;
5
- export default meta;
6
- export declare const SidebarExample: () => React.JSX.Element;
7
- export declare const SidebarRightExample: () => React.JSX.Element;
8
- export declare const SidebarBothSides: () => React.JSX.Element;
9
- export declare const SidebarCollapsed: () => React.JSX.Element;
@@ -1,12 +0,0 @@
1
- import { FC } from 'react';
2
- export interface SpinnerProps {
3
- /**
4
- * Custom className to be applied to spinner container div element.
5
- */
6
- className?: string;
7
- /**
8
- * Size of the spinner.
9
- */
10
- size?: 'sm' | 'md' | 'lg' | 'xl';
11
- }
12
- export declare const Spinner: FC<SpinnerProps>;
@@ -1,8 +0,0 @@
1
- import type { Meta } from '@storybook/react-vite';
2
- import React from 'react';
3
- import { Spinner } from './Spinner';
4
- declare const meta: Meta<typeof Spinner>;
5
- export default meta;
6
- export declare const Default: () => React.JSX.Element;
7
- export declare const Color: () => React.JSX.Element;
8
- export declare const Sizes: () => React.JSX.Element;
@@ -1,64 +0,0 @@
1
- import React, { ChangeEvent, FC, FocusEvent, ReactNode } from 'react';
2
- import { ResponsiveProp } from '../../types';
3
- export type SwitchSize = 'sm' | 'md' | 'lg';
4
- export interface SwitchProps {
5
- /**
6
- * The id attribute of the input.
7
- */
8
- id: string;
9
- /**
10
- * The switch input "checked" attribute.
11
- */
12
- isChecked: boolean;
13
- /**
14
- * Custom content to be displayed to right of switch.
15
- */
16
- label: string;
17
- /**
18
- * Callback function when input is changed.
19
- */
20
- onChange: (event: ChangeEvent<HTMLInputElement>) => void;
21
- /**
22
- * Additional classes to add.
23
- */
24
- className?: string;
25
- /**
26
- * Mark the input field as invalid and display a validation message.
27
- * Pass a string or node to render a validation message below the input.
28
- */
29
- error?: ReactNode;
30
- /**
31
- * Additional clarifying text to help describe the input
32
- */
33
- helpText?: ReactNode;
34
- /**
35
- * Determines if the label is not shown for stylistic reasons.
36
- * Note the label is still a required prop and will be used as the aria-label for accessibility reasons.
37
- */
38
- hideLabel?: boolean;
39
- /**
40
- * If the input should be disabled and not focusable.
41
- */
42
- isDisabled?: boolean;
43
- /**
44
- * The required and aria-required attributes on the input
45
- */
46
- isRequired?: boolean;
47
- /**
48
- * Callback function when input is blurred.
49
- */
50
- onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
51
- /**
52
- * Callback function when input is focused.
53
- */
54
- onFocus?: (event: FocusEvent<HTMLInputElement>) => void;
55
- /**
56
- * Visual indicator that the field is required, that gets appended to the label
57
- */
58
- requiredIndicator?: React.ReactNode;
59
- /**
60
- * The size of the switch.
61
- */
62
- size?: SwitchSize | ResponsiveProp<SwitchSize>;
63
- }
64
- export declare const Switch: FC<SwitchProps>;
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- import type { Meta } from '@storybook/react-vite';
3
- import { Switch } from './Switch';
4
- declare const meta: Meta<typeof Switch>;
5
- export default meta;
6
- export declare const Overview: () => React.JSX.Element;
7
- export declare const Basic: () => React.JSX.Element;
8
- export declare const HelpText: () => React.JSX.Element;
9
- export declare const HiddenLabel: () => React.JSX.Element;
10
- export declare const Sizes: () => React.JSX.Element;
11
- export declare const Disabled: () => React.JSX.Element;
12
- export declare const Error: () => React.JSX.Element;
@@ -1,86 +0,0 @@
1
- import { FC } from 'react';
2
- import { Column, Row, EventWithColumnKey } from '../../types';
3
- export interface TableProps {
4
- /**
5
- * Columns for the table. See Column definition below for details.
6
- */
7
- columns: Column[];
8
- /**
9
- * The data rows to be displayed
10
- */
11
- rows: Row[];
12
- /**
13
- * Key that represents a unique value for a row. This is necessary in
14
- * order to supply React with a node key on each row.
15
- */
16
- rowKey: string;
17
- /**
18
- * Additional classes to add.
19
- */
20
- className?: string;
21
- /**
22
- * Text alignment for all table cells. Can be superseded by passing the same prop into the `Column` object
23
- * for a specific column.
24
- */
25
- align?: 'left' | 'right' | 'center';
26
- /**
27
- * Global placeholder for empty cells. Can be overwritten by setting the same attribute
28
- * in the `Column` config.
29
- */
30
- emptyCellPlaceholder?: string | number | undefined;
31
- /**
32
- * Enable a hover state on table rows.
33
- */
34
- hoverableRows?: boolean;
35
- /**
36
- * Remove borders around table, thead, tbody, td, etc.
37
- */
38
- isBorderless?: boolean;
39
- /**
40
- * Make Table more compact by cutting cell padding in half.
41
- */
42
- isCompact?: boolean;
43
- /**
44
- * If table scrolls vertically, header will remain stuck to the top of the table, and not scroll away.
45
- */
46
- hasStickyHeader?: boolean;
47
- /**
48
- * Set to true if data is loading.
49
- */
50
- isLoading?: boolean;
51
- /**
52
- * Set the maximum width and height and enable scrolling within the container when the table grows
53
- * past those values. Useful for when we want to render a large table but not force the parent container
54
- * to grow and instead make the user scroll. Set values to boolean `true` to enable `overflow: scroll` on the table
55
- * without specifying a width/height
56
- */
57
- isScrollable?: {
58
- x?: boolean;
59
- y?: boolean;
60
- };
61
- /**
62
- * Adds zebra-striping to any table row within the table body.
63
- */
64
- isStriped?: boolean;
65
- /**
66
- * Callback function to fire on sorting one of the table headers.
67
- */
68
- onSort?: (event: EventWithColumnKey) => void;
69
- /**
70
- * The key of the sorted column and its sort direction.
71
- */
72
- sortedColumn?: {
73
- dataKey: string | undefined;
74
- sortDirection: 'none' | 'ascending' | 'descending' | undefined;
75
- };
76
- /**
77
- * Control the `table-layout` css property for the table.
78
- */
79
- useFixedTableLayout?: boolean;
80
- /**
81
- * Truncate overflow inside column based on column width. Can be overwritten on specific columns,
82
- * by passing `truncateOverflow` value on a specific Column
83
- */
84
- truncateOverflow?: boolean;
85
- }
86
- export declare const Table: FC<TableProps>;
@@ -1,31 +0,0 @@
1
- import type { Meta } from '@storybook/react-vite';
2
- import React from 'react';
3
- import { Table } from './Table';
4
- declare const meta: Meta<typeof Table>;
5
- export default meta;
6
- export declare const Column: () => React.JSX.Element;
7
- export declare const CommonExample: () => React.JSX.Element;
8
- export declare const Loading: () => React.JSX.Element;
9
- export declare const Sortable: () => React.JSX.Element;
10
- export declare const SortablewithDefaultSortedColumn: () => React.JSX.Element;
11
- export declare const SortableAndLoading: () => React.JSX.Element;
12
- export declare const Scrollable: () => React.JSX.Element;
13
- export declare const ScrollablewithStickyHeader: () => React.JSX.Element;
14
- export declare const ScrollablewithFirstColumnStuckToLeft: () => React.JSX.Element;
15
- export declare const ScrollablewithStickyHeaderAndNthColumnStuckToLeft: () => React.JSX.Element;
16
- export declare const ScrollableWithLastColumnStuckToRight: () => React.JSX.Element;
17
- export declare const ScrollableWithStickyHeaderAndFirstColumnStuckToLeft: () => React.JSX.Element;
18
- export declare const ScrollableAndLoading: () => React.JSX.Element;
19
- export declare const FixedWidthColumns: () => React.JSX.Element;
20
- export declare const FixedTableLayout: () => React.JSX.Element;
21
- export declare const TruncateOverflow: () => React.JSX.Element;
22
- export declare const CustomActions: () => React.JSX.Element;
23
- export declare const EmptyCellPlaceholder: () => React.JSX.Element;
24
- export declare const Borderless: () => React.JSX.Element;
25
- export declare const Compact: () => React.JSX.Element;
26
- export declare const Striped: () => React.JSX.Element;
27
- export declare const Hoverable: () => React.JSX.Element;
28
- export declare const StripedAndHoverable: () => React.JSX.Element;
29
- export declare const AligningCellText: () => React.JSX.Element;
30
- export declare const GlobalAlign: () => React.JSX.Element;
31
- export declare const ComponentAsColumnHeader: () => React.JSX.Element;
@@ -1,52 +0,0 @@
1
- import { FC, Key } from 'react';
2
- import { Column, Row } from '../../../types';
3
- export interface TableBodyProps {
4
- /**
5
- * The table columns to be rendered
6
- */
7
- columns: Column[];
8
- /**
9
- * The unique key to identify a React node for each row.
10
- */
11
- rowKey: Key;
12
- /**
13
- * The table rows to be rendered
14
- */
15
- rows: Row[];
16
- /**
17
- * Text alignment for all table cells. Can be superseded by passing the same prop into the `Column` object
18
- * for a specific column.
19
- */
20
- align?: 'left' | 'right' | 'center';
21
- /**
22
- * A custom class to apply to the table body.
23
- */
24
- className?: string;
25
- /**
26
- * A global placeholder for empty cells. Note: can be overwriten by
27
- * the same attribute passed for an individual column config object.
28
- */
29
- emptyCellPlaceholder?: string | number | undefined;
30
- /**
31
- * Enable a hover state on table rows.
32
- */
33
- hoverableRows?: boolean;
34
- /**
35
- * Whether the table has borders or not.
36
- */
37
- isBorderless?: boolean;
38
- /**
39
- * Whether the table rows have smaller padding
40
- */
41
- isCompact?: boolean;
42
- /**
43
- * Whether the table rows have a striped pattern
44
- */
45
- isStriped?: boolean;
46
- /**
47
- * Truncate overflow inside column based on column width. Can be overwritten on specific columns,
48
- * by passing `truncateOverflow` value on a specific Column
49
- */
50
- truncateOverflow?: boolean;
51
- }
52
- export declare const TableBody: FC<TableBodyProps>;
@@ -1,45 +0,0 @@
1
- import { FC, ReactNode } from 'react';
2
- export interface TableBodyCellProps {
3
- /**
4
- * Text alignment for all table cells. Can be superseded by passing the same prop into the `Column` object
5
- * for a specific column.
6
- */
7
- align?: 'left' | 'right' | 'center';
8
- /**
9
- * Children node to be rendered.
10
- */
11
- children?: ReactNode;
12
- /**
13
- * Custom class to be applied to `<tr>` element.
14
- */
15
- className?: string;
16
- /**
17
- * Remove borders around td elements.
18
- */
19
- isBorderless?: boolean;
20
- /**
21
- * Reduces padding inside table cells.
22
- */
23
- isCompact?: boolean;
24
- /**
25
- * Will stick to either the left or right side of a table during horizontal scroll.
26
- */
27
- sticky?: 'left' | 'right';
28
- /**
29
- * Truncates the cell contents based on width established by `Column`
30
- * NOTE: Truncate only on cells with primitive data types.
31
- */
32
- truncateOverflow?: boolean;
33
- /**
34
- * Placeholder for an empty cell, will be rendered when content is `null` `undefined`
35
- * or `''`. Placeholders will not be rendered on values of `0`.
36
- */
37
- emptyCellPlaceholder?: ReactNode;
38
- /**
39
- * Fixed width for a particular cell.
40
- * Value should be taken from column config so it matches its parent.
41
- */
42
- width?: number;
43
- }
44
- declare const TableBodyCell: FC<TableBodyCellProps>;
45
- export default TableBodyCell;
@@ -1,46 +0,0 @@
1
- import { FC } from 'react';
2
- import { Column, EventWithColumnKey } from '../../../types';
3
- export interface TableHeadProps {
4
- /**
5
- * The table columns to be rendered
6
- */
7
- columns: Column[];
8
- /**
9
- * Text alignment for all table cells. Can be superseded by passing the same prop into the `Column` object
10
- * for a specific column.
11
- */
12
- align?: 'left' | 'right' | 'center';
13
- /**
14
- * Custom class to be applied to the `<thead>` element.
15
- */
16
- className?: string;
17
- /**
18
- * Whether the table has borders or not.
19
- */
20
- isBorderless?: boolean;
21
- /**
22
- * Whether the table rows have smaller padding
23
- */
24
- isCompact?: boolean;
25
- /**
26
- * If table scrolls vertically, header will remain stuck to the top of the table, and not scroll away.
27
- */
28
- hasStickyHeader?: boolean;
29
- /**
30
- * Callback function to fire on sorting one of the table headers.
31
- */
32
- onSort?: (event: EventWithColumnKey) => void;
33
- /**
34
- * The key of the sorted column and its sort direction.
35
- */
36
- sortedColumn?: {
37
- dataKey: string | undefined;
38
- sortDirection: 'none' | 'ascending' | 'descending' | undefined;
39
- };
40
- /**
41
- * Truncate overflow inside column based on column width. Can be overwritten on specific columns,
42
- * by passing `truncateOverflow` value on a specific Column
43
- */
44
- truncateOverflow?: boolean;
45
- }
46
- export declare const TableHead: FC<TableHeadProps>;
@@ -1,65 +0,0 @@
1
- import { FC, Key } from 'react';
2
- import { Column, EventWithColumnKey } from '../../../../types';
3
- export interface TableHeaderCellProps {
4
- /**
5
- * Title to display for the column.
6
- */
7
- column: Column;
8
- /**
9
- * Text alignment for all table cells. Can be superseded by passing the same prop into the `Column` object
10
- * for a specific column.
11
- */
12
- align?: 'left' | 'right' | 'center';
13
- /**
14
- * Custom class to apply to the `<th>` element.
15
- */
16
- className?: string;
17
- /**
18
- * Key of corresponding data value in the table.
19
- */
20
- dataKey?: Key;
21
- /**
22
- * Remove borders around th elements.
23
- */
24
- isBorderless?: boolean;
25
- /**
26
- * Determines if table header cells should render as compact (less padding);
27
- */
28
- isCompact?: boolean;
29
- /**
30
- * If table scrolls vertically, header will remain stuck to the top of the table, and not scroll away.
31
- */
32
- hasStickyHeader?: boolean;
33
- /**
34
- * Boolean to mark if a column is sortable. This will show the sorting icons. Use
35
- * in conjunction with the `sortDirection` prop to determine which icon is shown.
36
- */
37
- isSortable?: boolean;
38
- /**
39
- * Callback function to execute when a sortable column's header is clicked.
40
- * Column can be sorted without providing an onSort method, it means that the arrows
41
- * will not be clickable, but they will still represent the sort state
42
- * of a column as determined by the `sortDirection` prop.
43
- */
44
- onSort?: (event: EventWithColumnKey) => void;
45
- /**
46
- * The key of the sorted column and its sort direction.
47
- */
48
- sortedColumn?: {
49
- dataKey: string | undefined;
50
- sortDirection: 'none' | 'ascending' | 'descending' | undefined;
51
- };
52
- /**
53
- * Will stick to either the left or right side of a table during horizontal scroll.
54
- */
55
- sticky?: 'left' | 'right';
56
- /**
57
- * Whether the text should be cut off with ellipsis if it exceeds the width of the column.
58
- */
59
- truncateOverflow?: boolean;
60
- /**
61
- * Width of the column, if using the `useFixedWidthColumns` prop is set to true.
62
- */
63
- width?: number;
64
- }
65
- export declare const TableHeaderCell: FC<TableHeaderCellProps>;
@@ -1,67 +0,0 @@
1
- import { FC } from 'react';
2
- import { Column, EventWithColumnKey, Row } from '../../../../types';
3
- export interface TableRowProps {
4
- /**
5
- * The table columns to be rendered
6
- */
7
- columns: Column[];
8
- /**
9
- * Text alignment for all table cells. Can be superseded by passing the same prop into the `Column` object
10
- * for a specific column.
11
- */
12
- align?: 'left' | 'right' | 'center';
13
- /**
14
- * Custom class to be applied to `<tr>` element.
15
- */
16
- className?: string;
17
- /**
18
- * A global placeholder for empty cells. Note: can be overwriten by
19
- * the same attribute passed for an individual column config object.
20
- */
21
- emptyCellPlaceholder?: string | number | undefined;
22
- /**
23
- * Whether the table has borders or not.
24
- */
25
- isBorderless?: boolean;
26
- /**
27
- * Whether the table rows have smaller padding
28
- */
29
- isCompact?: boolean;
30
- /**
31
- * If table scrolls vertically, header will remain stuck to the top of the table, and not scroll away.
32
- */
33
- hasStickyHeader?: boolean;
34
- /**
35
- * Determine whether row is hoverable
36
- */
37
- isHoverable?: boolean;
38
- /**
39
- * Whether the row is inside the table head (thead).
40
- */
41
- isTableHead?: boolean;
42
- /**
43
- * Callback function to fire on sorting one of the table headers.
44
- */
45
- onSort?: (event: EventWithColumnKey) => void;
46
- /**
47
- * The specific row to be rendered.
48
- */
49
- row?: Row;
50
- /**
51
- * The unique key to identify a React node for each row.
52
- */
53
- rowIndex?: number;
54
- /**
55
- * The key of the sorted column and its sort direction.
56
- */
57
- sortedColumn?: {
58
- dataKey: string | undefined;
59
- sortDirection: 'none' | 'ascending' | 'descending' | undefined;
60
- };
61
- /**
62
- * Truncate overflow inside column based on column width. Can be overwritten on specific columns,
63
- * by passing `truncateOverflow` value on a specific Column
64
- */
65
- truncateOverflow?: boolean;
66
- }
67
- export declare const TableRow: FC<TableRowProps>;
@@ -1,106 +0,0 @@
1
- import { BoxProps } from '../Box/Box';
2
- import { ChangeEvent, FocusEvent, ForwardRefExoticComponent, HTMLProps, InputHTMLAttributes, KeyboardEvent, MouseEvent, ReactNode } from 'react';
3
- import { ResponsiveProp } from '../../types';
4
- export type TextInputSizeType = 'sm' | 'md' | 'lg';
5
- export interface TextInputProps {
6
- /**
7
- * The input's id attribute. Used to programmatically tie the input with its label.
8
- */
9
- id: string;
10
- /**
11
- * Custom content to be displayed above the input. If the label is hidden, will be used to set aria-label attribute.
12
- */
13
- label: string;
14
- /**
15
- * Callback function to call on change event.
16
- */
17
- onChange: (event: ChangeEvent<HTMLInputElement>) => void;
18
- /**
19
- * The text value of the input. Required since our Input is a controlled component.
20
- */
21
- value: InputHTMLAttributes<HTMLInputElement>['value'];
22
- /**
23
- * Automatically focus the input when the page is loaded.
24
- */
25
- autoFocus?: boolean;
26
- /**
27
- * Custom class to be added to standard input classes.
28
- */
29
- className?: string;
30
- /**
31
- * Mark the input field as invalid and display a validation message.
32
- * Pass a string or node to render a validation message below the input.
33
- */
34
- error?: ReactNode;
35
- /**
36
- * Visually hide the label.
37
- */
38
- hideLabel?: boolean;
39
- /**
40
- * Additional clarifying text to help describe the input
41
- */
42
- helpText?: ReactNode;
43
- /**
44
- * Props passed directly to the input element of the component
45
- */
46
- inputProps?: BoxProps & HTMLProps<HTMLInputElement>;
47
- /**
48
- * The input's disabled attribute
49
- */
50
- isDisabled?: boolean;
51
- /**
52
- * The required and aria-required attributes on the input
53
- */
54
- isRequired?: boolean;
55
- /**
56
- * The input's 'maxlength' attribute.
57
- * NOTE: initializing the input with a value longer than the desired maxlength will not trim this value.
58
- */
59
- maxLength?: number;
60
- /**
61
- * The input's 'name' attribute.
62
- */
63
- name?: string;
64
- /**
65
- * Callback function to call on blur event.
66
- */
67
- onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
68
- /**
69
- * Callback function to call when input us cleared. When this is passed,
70
- * the input will display an icon on the right side, for triggering this callback.
71
- */
72
- onClear?: (event: MouseEvent<HTMLButtonElement> | KeyboardEvent<HTMLButtonElement>) => void;
73
- /**
74
- * Callback function to call on focus event.
75
- */
76
- onFocus?: (event: FocusEvent<HTMLInputElement>) => void;
77
- /**
78
- * The input placeholder attribute.
79
- */
80
- placeholder?: string;
81
- /**
82
- * An input helper rendered before the input field value
83
- */
84
- prefix?: ReactNode;
85
- /**
86
- * Visual indicator that the field is required, that gets appended to the label
87
- */
88
- requiredIndicator?: ReactNode;
89
- /**
90
- * The size of the text input.
91
- */
92
- size?: TextInputSizeType | ResponsiveProp<TextInputSizeType>;
93
- /**
94
- * An input helper rendered after the input field value
95
- */
96
- suffix?: ReactNode;
97
- /**
98
- * The input 'type' value. Defaults to type 'text'.
99
- */
100
- type?: InputHTMLAttributes<HTMLInputElement>['type'];
101
- /**
102
- * Additional props to be spread to rendered element
103
- */
104
- [x: string]: any;
105
- }
106
- export declare const TextInput: ForwardRefExoticComponent<TextInputProps>;
@@ -1,19 +0,0 @@
1
- import type { Meta } from '@storybook/react-vite';
2
- import React from 'react';
3
- import { TextInput } from './TextInput';
4
- declare const meta: Meta<typeof TextInput>;
5
- export default meta;
6
- export declare const Basic: () => React.JSX.Element;
7
- export declare const Examples: () => React.JSX.Element;
8
- export declare const Required: () => React.JSX.Element;
9
- export declare const CustomRequiredIndicator: () => React.JSX.Element;
10
- export declare const WithHelpText: () => React.JSX.Element;
11
- export declare const Placeholder: () => React.JSX.Element;
12
- export declare const Autofocus: () => React.JSX.Element;
13
- export declare const HiddenLabel: () => React.JSX.Element;
14
- export declare const Disabled: () => React.JSX.Element;
15
- export declare const PrefixAndSuffix: () => React.JSX.Element;
16
- export declare const Clearable: () => React.JSX.Element;
17
- export declare const Sizes: () => React.JSX.Element;
18
- export declare const MaxLength: () => React.JSX.Element;
19
- export declare const ValidationError: () => React.JSX.Element;