@hyphen/hyphen-components 7.3.1 → 7.3.3

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 (220) 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 +5718 -5018
  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 +5619 -4843
  8. package/dist/hyphen-components.esm.js.map +1 -1
  9. package/dist/index.d.ts +2693 -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 +21 -12
  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/lib/getColumnKeys.ts +3 -3
  60. package/src/lib/mergeRefs.ts +1 -1
  61. package/src/lib/tokens.ts +4 -4
  62. package/dist/components/Alert/Alert.constants.d.ts +0 -8
  63. package/dist/components/Alert/Alert.d.ts +0 -42
  64. package/dist/components/Alert/Alert.stories.d.ts +0 -12
  65. package/dist/components/Alert/Alert.types.d.ts +0 -7
  66. package/dist/components/AspectRatio/AspectRatio.d.ts +0 -3
  67. package/dist/components/AspectRatio/AspectRatio.stories.d.ts +0 -6
  68. package/dist/components/Badge/Badge.d.ts +0 -24
  69. package/dist/components/Badge/Badge.stories.d.ts +0 -8
  70. package/dist/components/Box/Box.d.ts +0 -247
  71. package/dist/components/Box/Box.stories.d.ts +0 -46
  72. package/dist/components/Button/Button.constants.d.ts +0 -3
  73. package/dist/components/Button/Button.d.ts +0 -53
  74. package/dist/components/Button/Button.stories.d.ts +0 -16
  75. package/dist/components/Calendar/Calendar.d.ts +0 -7
  76. package/dist/components/Calendar/Calendar.stories.d.ts +0 -12
  77. package/dist/components/Card/Card.d.ts +0 -17
  78. package/dist/components/Card/Card.stories.d.ts +0 -8
  79. package/dist/components/Card/components/CardFooter/CardFooter.d.ts +0 -13
  80. package/dist/components/Card/components/CardHeader/CardHeader.d.ts +0 -13
  81. package/dist/components/Card/components/CardSection/CardSection.d.ts +0 -46
  82. package/dist/components/Card/components/index.d.ts +0 -3
  83. package/dist/components/CheckboxInput/CheckboxInput.d.ts +0 -72
  84. package/dist/components/CheckboxInput/CheckboxInput.stories.d.ts +0 -18
  85. package/dist/components/CheckboxInput/components/Checkbox.d.ts +0 -71
  86. package/dist/components/CheckboxInput/components/CheckboxIcon.d.ts +0 -27
  87. package/dist/components/Collapsible/Collapsible.d.ts +0 -5
  88. package/dist/components/Collapsible/Collapsible.stories.d.ts +0 -9
  89. package/dist/components/Details/Details.d.ts +0 -15
  90. package/dist/components/Details/Details.stories.d.ts +0 -6
  91. package/dist/components/Details/DetailsSummary.d.ts +0 -7
  92. package/dist/components/Drawer/Drawer.d.ts +0 -105
  93. package/dist/components/Drawer/Drawer.stories.d.ts +0 -62
  94. package/dist/components/DropdownMenu/DropdownMenu.d.ts +0 -25
  95. package/dist/components/DropdownMenu/DropdownMenu.stories.d.ts +0 -9
  96. package/dist/components/FormControl/FormControl.d.ts +0 -38
  97. package/dist/components/FormLabel/FormLabel.d.ts +0 -41
  98. package/dist/components/FormLabel/FormLabel.stories.d.ts +0 -6
  99. package/dist/components/Formik/Formik.stories.d.ts +0 -18
  100. package/dist/components/Formik/FormikCheckboxInput/FormikCheckboxInput.d.ts +0 -12
  101. package/dist/components/Formik/FormikRadioGroup/FormikRadioGroup.d.ts +0 -12
  102. package/dist/components/Formik/FormikSelectInput/FormikSelectInput.d.ts +0 -13
  103. package/dist/components/Formik/FormikSelectInputInset/FormikSelectInputInset.d.ts +0 -12
  104. package/dist/components/Formik/FormikSelectInputNative/FormikSelectInputNative.d.ts +0 -12
  105. package/dist/components/Formik/FormikSwitch/FormikSwitch.d.ts +0 -12
  106. package/dist/components/Formik/FormikTextInput/FormikTextInput.d.ts +0 -12
  107. package/dist/components/Formik/FormikTextInputInset/FormikTextInputInset.d.ts +0 -12
  108. package/dist/components/Formik/FormikTextareaInput/FormikTextareaInput.d.ts +0 -12
  109. package/dist/components/Formik/FormikTextareaInputInset/FormikTextareaInputInset.d.ts +0 -12
  110. package/dist/components/Formik/FormikTimePicker/FormikTimePicker.d.ts +0 -12
  111. package/dist/components/Formik/FormikTimePickerNative/FormikTimePickerNative.d.ts +0 -12
  112. package/dist/components/Formik/FormikToggleGroup/FormikToggleGroup.d.ts +0 -20
  113. package/dist/components/Formik/FormikToggleGroupMulti/FormikToggleGroupMulti.d.ts +0 -18
  114. package/dist/components/Heading/Heading.constants.d.ts +0 -10
  115. package/dist/components/Heading/Heading.d.ts +0 -35
  116. package/dist/components/Heading/Heading.stories.d.ts +0 -9
  117. package/dist/components/HelpText/HelpText.d.ts +0 -12
  118. package/dist/components/Icon/Icon.d.ts +0 -22
  119. package/dist/components/Icon/Icon.stories.d.ts +0 -10
  120. package/dist/components/InputValidationMessage/InputValidationMessage.d.ts +0 -9
  121. package/dist/components/Modal/Modal.d.ts +0 -83
  122. package/dist/components/Modal/Modal.stories.d.ts +0 -13
  123. package/dist/components/Modal/components/ModalBody/ModalBody.d.ts +0 -4
  124. package/dist/components/Modal/components/ModalFooter/ModalFooter.d.ts +0 -4
  125. package/dist/components/Modal/components/ModalHeader/ModalHeader.d.ts +0 -21
  126. package/dist/components/Modal/components/index.d.ts +0 -4
  127. package/dist/components/Pagination/Pagination.d.ts +0 -51
  128. package/dist/components/Pagination/Pagination.stories.d.ts +0 -8
  129. package/dist/components/Pagination/Pagination.utilities.d.ts +0 -10
  130. package/dist/components/Popover/Popover.d.ts +0 -8
  131. package/dist/components/Popover/Popover.stories.d.ts +0 -7
  132. package/dist/components/RadioGroup/RadioGroup.d.ts +0 -75
  133. package/dist/components/RadioGroup/RadioGroup.stories.d.ts +0 -16
  134. package/dist/components/RadioGroup/RadioInput/RadioInput.d.ts +0 -57
  135. package/dist/components/RadioGroup/RadioInput/RadioInputIcon.d.ts +0 -27
  136. package/dist/components/RangeInput/RangeInput.d.ts +0 -29
  137. package/dist/components/RangeInput/RangeInput.stories.d.ts +0 -7
  138. package/dist/components/ResponsiveProvider/ResponsiveProvider.d.ts +0 -17
  139. package/dist/components/ResponsiveProvider/ResponsiveProvider.stories.d.ts +0 -7
  140. package/dist/components/SelectInput/SelectInput.d.ts +0 -148
  141. package/dist/components/SelectInput/SelectInput.stories.d.ts +0 -24
  142. package/dist/components/SelectInputInset/SelectInputInset.d.ts +0 -92
  143. package/dist/components/SelectInputInset/SelectInputInset.stories.d.ts +0 -12
  144. package/dist/components/SelectInputNative/SelectInputNative.d.ts +0 -45
  145. package/dist/components/SelectInputNative/SelectInputNative.stories.d.ts +0 -19
  146. package/dist/components/Sidebar/Sidebar.d.ts +0 -57
  147. package/dist/components/Sidebar/Sidebar.stories.d.ts +0 -9
  148. package/dist/components/Spinner/Spinner.d.ts +0 -12
  149. package/dist/components/Spinner/Spinner.stories.d.ts +0 -8
  150. package/dist/components/Switch/Switch.d.ts +0 -64
  151. package/dist/components/Switch/Switch.stories.d.ts +0 -12
  152. package/dist/components/Table/Table.d.ts +0 -86
  153. package/dist/components/Table/Table.stories.d.ts +0 -31
  154. package/dist/components/Table/TableBody/TableBody.d.ts +0 -52
  155. package/dist/components/Table/TableBody/TableBodyCell/TableBodyCell.d.ts +0 -45
  156. package/dist/components/Table/TableHead/TableHead.d.ts +0 -46
  157. package/dist/components/Table/TableHead/TableHeaderCell/TableHeaderCell.d.ts +0 -65
  158. package/dist/components/Table/common/TableRow/TableRow.d.ts +0 -67
  159. package/dist/components/TextInput/TextInput.d.ts +0 -106
  160. package/dist/components/TextInput/TextInput.stories.d.ts +0 -19
  161. package/dist/components/TextInputInset/TextInputInset.d.ts +0 -102
  162. package/dist/components/TextInputInset/TextInputInset.stories.d.ts +0 -13
  163. package/dist/components/TextareaInput/TextareaInput.d.ts +0 -97
  164. package/dist/components/TextareaInput/TextareaInput.stories.d.ts +0 -23
  165. package/dist/components/TextareaInputInset/TextareaInputInset.d.ts +0 -105
  166. package/dist/components/TextareaInputInset/TextareaInputInset.stories.d.ts +0 -12
  167. package/dist/components/ThemeProvider/ThemeProvider.d.ts +0 -15
  168. package/dist/components/ThemeProvider/ThemeProvider.stories.d.ts +0 -6
  169. package/dist/components/TimePicker/TimePicker.d.ts +0 -35
  170. package/dist/components/TimePicker/TimePicker.stories.d.ts +0 -12
  171. package/dist/components/TimePickerNative/TimePickerNative.d.ts +0 -39
  172. package/dist/components/TimePickerNative/TimePickerNative.stories.d.ts +0 -11
  173. package/dist/components/Toast/Toast.store.d.ts +0 -36
  174. package/dist/components/Toast/Toast.stories.d.ts +0 -14
  175. package/dist/components/Toast/Toast.types.d.ts +0 -75
  176. package/dist/components/Toast/ToastContainer.d.ts +0 -43
  177. package/dist/components/Toast/ToastNotification.d.ts +0 -28
  178. package/dist/components/Toast/index.d.ts +0 -4
  179. package/dist/components/Toast/toast.d.ts +0 -20
  180. package/dist/components/Toast/useToasts.d.ts +0 -14
  181. package/dist/components/Toggle/Toggle.d.ts +0 -7
  182. package/dist/components/Toggle/Toggle.stories.d.ts +0 -11
  183. package/dist/components/ToggleGroup/ToggleGroup.d.ts +0 -19
  184. package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts +0 -12
  185. package/dist/components/Tooltip/Tooltip.d.ts +0 -8
  186. package/dist/components/Tooltip/Tooltip.stories.d.ts +0 -8
  187. package/dist/constants/keyCodes.d.ts +0 -2
  188. package/dist/css/index.css +0 -36
  189. package/dist/hooks/index.d.ts +0 -6
  190. package/dist/hooks/useBreakpoint/useBreakpoint.d.ts +0 -9
  191. package/dist/hooks/useBreakpoint/useBreakpoint.stories.d.ts +0 -6
  192. package/dist/hooks/useIsMobile/useIsMobile.d.ts +0 -1
  193. package/dist/hooks/useIsMobile/useIsMobile.stories.d.ts +0 -6
  194. package/dist/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.d.ts +0 -2
  195. package/dist/hooks/useOpenClose/useOpenClose.d.ts +0 -39
  196. package/dist/hooks/useOpenClose/useOpenClose.stories.d.ts +0 -6
  197. package/dist/hooks/useTheme/useTheme.d.ts +0 -5
  198. package/dist/hooks/useTheme/useTheme.stories.d.ts +0 -6
  199. package/dist/hooks/useWindowSize/useWindowSize.d.ts +0 -7
  200. package/dist/hooks/useWindowSize/useWindowSize.stories.d.ts +0 -6
  201. package/dist/lib/cssShorthandToClasses.d.ts +0 -4
  202. package/dist/lib/doesStringIncludeCssUnit.d.ts +0 -1
  203. package/dist/lib/generateResponsiveClasses.d.ts +0 -2
  204. package/dist/lib/getAutoCompleteValue.d.ts +0 -1
  205. package/dist/lib/getColumnKeys.d.ts +0 -3
  206. package/dist/lib/getDimensionCss.d.ts +0 -12
  207. package/dist/lib/getElementType.d.ts +0 -14
  208. package/dist/lib/getFlexCss.d.ts +0 -9
  209. package/dist/lib/index.d.ts +0 -15
  210. package/dist/lib/isFunction.d.ts +0 -3
  211. package/dist/lib/mergeRefs.d.ts +0 -2
  212. package/dist/lib/prefersReducedMotion.d.ts +0 -1
  213. package/dist/lib/react-children-utilities/filter.d.ts +0 -3
  214. package/dist/lib/react-children-utilities/index.d.ts +0 -1
  215. package/dist/lib/reactRouterClickHandler.d.ts +0 -12
  216. package/dist/lib/resolveValue.d.ts +0 -3
  217. package/dist/lib/tokens.d.ts +0 -22
  218. package/dist/modes.d.ts +0 -8
  219. package/dist/types/index.d.ts +0 -103
  220. package/dist/types/lib.types.d.ts +0 -3
@@ -1,148 +0,0 @@
1
- import { FocusEvent, ReactNode } from 'react';
2
- import { OptionsOrGroups, OnChangeValue } from 'react-select';
3
- import { ResponsiveProp } from '../../types';
4
- import { GroupBase } from 'react-select/dist/declarations/src/types';
5
- type SelectOptions = any;
6
- type SelectGroupOptions = GroupBase<SelectOptions>;
7
- export type SelectInputOptions = OptionsOrGroups<SelectOptions, SelectGroupOptions>;
8
- export type SimulatedEventPayloadType = {
9
- target: {
10
- name: string;
11
- value: OnChangeValue<SelectInputOptions, boolean>;
12
- };
13
- };
14
- export type TextInputSize = 'sm' | 'md' | 'lg' | ResponsiveProp<'sm' | 'md' | 'lg'>;
15
- export interface SelectInputProps {
16
- /**
17
- * The id attribute of the input.
18
- */
19
- id: string;
20
- /**
21
- * Custom content to be displayed above the input. If the label is hidden, will be used to set aria-label attribute.
22
- */
23
- label: string;
24
- /**
25
- * Callback function to call on change event.
26
- */
27
- onChange: (event: SimulatedEventPayloadType) => void;
28
- /**
29
- * The value(s) of select.
30
- */
31
- value: any | any[];
32
- /**
33
- * Options for dropdown list.
34
- */
35
- options: SelectInputOptions | AsyncOptions;
36
- /**
37
- * Autofocus select input on render.
38
- */
39
- autoFocus?: boolean;
40
- /**
41
- * Additional classes to add.
42
- */
43
- className?: string;
44
- /**
45
- * Mark the input field as invalid and display a validation message.
46
- * Pass a string or node to render a validation message below the input.
47
- */
48
- error?: ReactNode;
49
- /**
50
- * Additional clarifying text to help describe the input
51
- */
52
- helpText?: ReactNode;
53
- /**
54
- * Visually hide the label.
55
- */
56
- hideLabel?: boolean;
57
- /**
58
- * Load the input asynchronously.
59
- */
60
- isAsync?: boolean;
61
- /**
62
- * If the input value is clearable programmatically.
63
- */
64
- isClearable?: boolean;
65
- /**
66
- * Include custom option in dropdown list.
67
- */
68
- isCreatable?: boolean;
69
- /**
70
- * If the input should be disabled and not focusable.
71
- */
72
- isDisabled?: boolean;
73
- /**
74
- * Is multi select enabled.
75
- */
76
- isMulti?: boolean;
77
- /**
78
- * The required and aria-required attributes on the input
79
- */
80
- isRequired?: boolean;
81
- /**
82
- * Select 'name' attribute.
83
- */
84
- name?: string;
85
- /**
86
- * A ref to portal the dropdown menu to. This is useful when the dropdown is located in a smaller container
87
- * and we want to avoid cutting off the menu.
88
- */
89
- menuPortalTarget?: HTMLElement;
90
- /**
91
- * Callback function to call on blur event.
92
- */
93
- onBlur?: (event: FocusEvent<HTMLElement>) => void;
94
- /**
95
- * Callback function to call on focus event.
96
- */
97
- onFocus?: (event: FocusEvent<HTMLElement>) => void;
98
- /**
99
- * Placeholder for input.
100
- */
101
- placeholder?: string;
102
- /**
103
- * Visual indicator that the field is required, that gets appended to the label
104
- */
105
- requiredIndicator?: ReactNode;
106
- /**
107
- * The size of the text input.
108
- */
109
- size?: TextInputSize;
110
- /**
111
- * Additional props to be spread. These will be applied specifically to
112
- * the `react-select` component that powers the select. For full docs on
113
- * react-select props, [Click Here](https://react-select.com/props)
114
- */
115
- [x: string]: any;
116
- }
117
- type AsyncOptions = (inputValue: string) => Promise<SelectInputOptions>;
118
- type AsyncSelectInputProps = SelectInputProps & {
119
- /**
120
- * Load the input asynchronously.
121
- */
122
- isAsync: true;
123
- /**
124
- * Load options asynchronously.
125
- */
126
- options: AsyncOptions;
127
- /**
128
- * If cacheOptions is passed, then the loaded data will be cached.
129
- */
130
- cacheOptions?: boolean;
131
- /**
132
- * The default set of options to show before the user starts searching.
133
- */
134
- defaultOptions?: boolean;
135
- };
136
- type SyncSelectInputProps = SelectInputProps & {
137
- /**
138
- * Load the input synchronously.
139
- */
140
- isAsync?: false;
141
- /**
142
- * Options for dropdown list.
143
- */
144
- options: SelectInputOptions;
145
- };
146
- export declare function SelectInput(props: AsyncSelectInputProps): JSX.Element;
147
- export declare function SelectInput(props: SyncSelectInputProps): JSX.Element;
148
- export {};
@@ -1,24 +0,0 @@
1
- import React from 'react';
2
- import { SelectInput } from './SelectInput';
3
- import type { Meta } from '@storybook/react-vite';
4
- declare const meta: Meta<typeof SelectInput>;
5
- export default meta;
6
- export declare const Default: () => React.JSX.Element;
7
- export declare const PreSelected: () => React.JSX.Element;
8
- export declare const HelpText: () => React.JSX.Element;
9
- export declare const Placeholder: () => React.JSX.Element;
10
- export declare const HiddenLabel: () => React.JSX.Element;
11
- export declare const CreatableSelect: () => React.JSX.Element;
12
- export declare const AsyncSelect: () => React.JSX.Element;
13
- export declare const AsyncCreatableSelect: () => React.JSX.Element;
14
- export declare const MultiSelect: () => React.JSX.Element;
15
- export declare const MultiSelectAndPreSelected: () => React.JSX.Element;
16
- export declare const MultiSelectCreatable: () => React.JSX.Element;
17
- export declare const Autofocus: () => React.JSX.Element;
18
- export declare const Required: () => React.JSX.Element;
19
- export declare const Disabled: () => React.JSX.Element;
20
- export declare const Clearable: () => React.JSX.Element;
21
- export declare const Error: () => React.JSX.Element;
22
- export declare const Sizes: () => React.JSX.Element;
23
- export declare const WithPortal: () => React.JSX.Element;
24
- export declare const CustomClasses: () => React.JSX.Element;
@@ -1,92 +0,0 @@
1
- import { ChangeEvent, MouseEvent, KeyboardEvent, FocusEvent, ForwardRefExoticComponent, ReactNode, HTMLProps } from 'react';
2
- import { ResponsiveProp } from '../../types';
3
- import { BoxProps } from '../Box/Box';
4
- export type SelectInputInsetSize = 'md' | 'lg';
5
- export interface SelectInputInsetProps {
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
- * List of options for the select input.
16
- */
17
- options: {
18
- value: string | number;
19
- label: string | number;
20
- }[];
21
- /**
22
- * Callback function to call on change event.
23
- */
24
- onChange: (event: ChangeEvent<HTMLInputElement>) => void;
25
- /**
26
- * Value of selected option. Should match the value key in the option object.
27
- */
28
- value: string | number | null;
29
- /**
30
- * Automatically focus the input when the page is loaded.
31
- */
32
- autoFocus?: boolean;
33
- /**
34
- * Custom class to be added to standard input classes.
35
- */
36
- className?: string;
37
- /**
38
- * Mark the input field as invalid and display a validation message.
39
- * Pass a string or node to render a validation message below the input.
40
- */
41
- error?: ReactNode;
42
- /**
43
- * Additional clarifying text to help describe the input
44
- */
45
- helpText?: ReactNode;
46
- /**
47
- * Props passed directly to the input element of the component
48
- */
49
- inputProps?: BoxProps & HTMLProps<HTMLInputElement>;
50
- /**
51
- * The input's disabled attribute
52
- */
53
- isDisabled?: boolean;
54
- /**
55
- * The required and aria-required attributes on the input
56
- */
57
- isRequired?: boolean;
58
- /**
59
- * The input's 'name' attribute.
60
- */
61
- name?: string;
62
- /**
63
- * Callback function to call on blur event.
64
- */
65
- onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
66
- /**
67
- * Callback function to call when input us cleared. When this is passed,
68
- * the input will display an icon on the right side, for triggering this callback.
69
- */
70
- onClear?: (event: MouseEvent<HTMLButtonElement> | KeyboardEvent<HTMLButtonElement>) => void;
71
- /**
72
- * Callback function to call on focus event.
73
- */
74
- onFocus?: (event: FocusEvent<HTMLInputElement>) => void;
75
- /**
76
- * The input placeholder attribute.
77
- */
78
- placeholder?: string;
79
- /**
80
- * Visual indicator that the field is required, that gets appended to the label
81
- */
82
- requiredIndicator?: ReactNode;
83
- /**
84
- * The size of the text input.
85
- */
86
- size?: SelectInputInsetSize | ResponsiveProp<SelectInputInsetSize>;
87
- /**
88
- * Additional props to be spread to rendered element
89
- */
90
- [x: string]: any;
91
- }
92
- export declare const SelectInputInset: ForwardRefExoticComponent<SelectInputInsetProps>;
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- import { SelectInputInset } from './SelectInputInset';
3
- import type { Meta } from '@storybook/react-vite';
4
- declare const meta: Meta<typeof SelectInputInset>;
5
- export default meta;
6
- export declare const Default: () => React.JSX.Element;
7
- export declare const Required: () => React.JSX.Element;
8
- export declare const HelpText: () => React.JSX.Element;
9
- export declare const ValidationError: () => React.JSX.Element;
10
- export declare const Disabled: () => React.JSX.Element;
11
- export declare const Clearable: () => React.JSX.Element;
12
- export declare const Sizes: () => React.JSX.Element;
@@ -1,45 +0,0 @@
1
- import React from 'react';
2
- import { ResponsiveProp } from '../../types';
3
- import { BoxProps } from '../Box/Box';
4
- import { FormControlProps } from '../FormControl/FormControl';
5
- export type SelectInputNativeSize = 'sm' | 'md' | 'lg';
6
- export interface SelectInputNativeOption {
7
- value: string | number;
8
- label: string | number;
9
- disabled?: boolean;
10
- }
11
- export interface SelectInputNativeProps extends BoxProps, FormControlProps {
12
- /**
13
- * List of options for the select input.
14
- */
15
- options: SelectInputNativeOption[];
16
- /**
17
- * onChange callback from select element.
18
- */
19
- onChange: (event: React.ChangeEvent<HTMLSelectElement>) => void;
20
- /**
21
- * Value of selected option. Should match the value key in the option object.
22
- */
23
- value: string | number | null;
24
- /**
25
- * The input's 'name' attribute.
26
- */
27
- name?: string;
28
- /**
29
- * Visual indicator that the field is required, that gets appended to the label
30
- */
31
- requiredIndicator?: React.ReactNode;
32
- /**
33
- * Size of the input. ('sm' | 'md' | 'lg')
34
- */
35
- size?: SelectInputNativeSize | ResponsiveProp<SelectInputNativeSize>;
36
- /**
37
- * Whether the input is autofocused on initial render.
38
- */
39
- autoFocus?: HTMLSelectElement['autofocus'];
40
- /**
41
- * Additional props to be spread.
42
- */
43
- [x: string]: any;
44
- }
45
- export declare const SelectInputNative: React.FC<SelectInputNativeProps>;
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
- import { SelectInputNative } from './SelectInputNative';
3
- import type { Meta, StoryObj } from '@storybook/react-vite';
4
- declare const meta: Meta<typeof SelectInputNative>;
5
- export default meta;
6
- export declare const Default: () => React.JSX.Element;
7
- export declare const PreSelected: () => React.JSX.Element;
8
- export declare const HelpText: () => React.JSX.Element;
9
- export declare const Placeholder: () => React.JSX.Element;
10
- export declare const HiddenLabel: () => React.JSX.Element;
11
- export declare const Autofocus: () => React.JSX.Element;
12
- export declare const Required: () => React.JSX.Element;
13
- export declare const CustomRequiredIndicator: () => React.JSX.Element;
14
- export declare const Disabled: () => React.JSX.Element;
15
- export declare const Error: () => React.JSX.Element;
16
- export declare const Sizes: () => React.JSX.Element;
17
- export declare const InteractionTest: StoryObj<typeof SelectInputNative>;
18
- export declare const InteractionDisabled: StoryObj<typeof SelectInputNative>;
19
- export declare const InteractionChangePreSelected: StoryObj<typeof SelectInputNative>;
@@ -1,57 +0,0 @@
1
- import React from 'react';
2
- import { IconName } from 'src/types';
3
- import { TooltipContent } from '../Tooltip/Tooltip';
4
- type SidebarSide = 'left' | 'right';
5
- type SidebarOpenState = Record<SidebarSide, boolean>;
6
- type SidebarOpenValue = boolean | Partial<SidebarOpenState>;
7
- type SidebarStorageKey = string | Partial<Record<SidebarSide, string>>;
8
- declare function useSidebar(sideOverride?: SidebarSide): {
9
- isMobile: boolean;
10
- side: SidebarSide;
11
- state: "expanded" | "collapsed";
12
- open: boolean;
13
- setOpen: (open: boolean | ((open: boolean) => boolean)) => void;
14
- openMobile: boolean;
15
- setOpenMobile: (open: boolean | ((open: boolean) => boolean)) => void;
16
- toggleSidebar: () => void;
17
- };
18
- declare const SidebarProvider: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
19
- defaultOpen?: SidebarOpenValue;
20
- open?: SidebarOpenValue;
21
- storageKey?: SidebarStorageKey;
22
- onOpenChange?: (open: boolean, side?: SidebarSide) => void;
23
- }, "ref"> & React.RefAttributes<HTMLDivElement>>;
24
- declare const Sidebar: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
25
- side?: "left" | "right";
26
- collapsible?: "offcanvas" | "icon" | "none";
27
- }, "ref"> & React.RefAttributes<HTMLDivElement>>;
28
- declare const SidebarTrigger: React.ForwardRefExoticComponent<Omit<import("../Button/Button").BaseButtonProps & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement> & {
29
- side?: SidebarSide;
30
- iconName?: IconName;
31
- }, "ref"> & React.RefAttributes<HTMLButtonElement>>;
32
- declare const SidebarInset: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
33
- declare const SidebarHeader: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
34
- declare const SidebarFooter: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
35
- declare const SidebarContent: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
36
- declare const SidebarMenu: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & React.RefAttributes<HTMLUListElement>>;
37
- declare const SidebarMenuItem: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
38
- declare const SidebarMenuButton: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & {
39
- asChild?: boolean;
40
- isActive?: boolean;
41
- icon?: IconName;
42
- tooltip?: string | React.ComponentProps<typeof TooltipContent>;
43
- }, "ref"> & React.RefAttributes<HTMLButtonElement>>;
44
- declare const SidebarGroup: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
45
- declare const SidebarGroupLabel: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
46
- declare const SidebarMenuSub: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & React.RefAttributes<HTMLUListElement>>;
47
- declare const SidebarMenuSubItem: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
48
- declare const SidebarMenuSubButton: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLAnchorElement> & React.AnchorHTMLAttributes<HTMLAnchorElement> & {
49
- asChild?: boolean;
50
- isActive?: boolean;
51
- }, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
52
- declare const SidebarMenuAction: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & {
53
- asChild?: boolean;
54
- }, "ref"> & React.RefAttributes<HTMLButtonElement>>;
55
- declare const SidebarRail: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
56
- declare const SidebarMenuBadge: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
57
- export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarTrigger, useSidebar, };
@@ -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;