@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
@@ -170,6 +170,8 @@ export const ModalBaseComponent: React.FC<ModalProps> = forwardRef<
170
170
  }
171
171
  );
172
172
 
173
+ ModalBaseComponent.displayName = 'Modal';
174
+
173
175
  export interface ModalStatic {
174
176
  Body: typeof ModalBody;
175
177
  Header: typeof ModalHeader;
@@ -59,10 +59,10 @@ describe('ModalFooter', () => {
59
59
  });
60
60
 
61
61
  test('applies custom styles', () => {
62
- const customStyle = { backgroundColor: 'red' };
62
+ const customStyle = { backgroundColor: '#cacaca' };
63
63
  const { container } = render(
64
64
  <ModalFooter style={customStyle}>test modal</ModalFooter>
65
65
  );
66
- expect(container.firstChild).toHaveStyle('background-color: red');
66
+ expect(container.firstChild).toHaveStyle('background-color: #cacaca');
67
67
  });
68
68
  });
@@ -26,6 +26,8 @@ const PopoverContent = forwardRef<
26
26
  );
27
27
  });
28
28
 
29
+ PopoverContent.displayName = 'PopoverContent';
30
+
29
31
  export {
30
32
  Popover,
31
33
  PopoverTrigger,
@@ -146,3 +146,5 @@ export const RadioInput = React.forwardRef<HTMLDivElement, RadioInputProps>(
146
146
  );
147
147
  }
148
148
  );
149
+
150
+ RadioInput.displayName = 'RadioInput';
@@ -25,7 +25,7 @@ export const Default = () => {
25
25
  <SelectInput
26
26
  id="singleSelectWithLabel"
27
27
  label="Label"
28
- // @ts-ignore - TS is not recognizing the value as a valid option
28
+ // @ts-expect-error - TS is not recognizing the value as a valid option
29
29
  onChange={(event) => setValue(event.target.value)}
30
30
  options={options}
31
31
  value={value}
@@ -46,7 +46,7 @@ export const PreSelected = () => {
46
46
  <SelectInput
47
47
  id="preSelected"
48
48
  label="Label"
49
- // @ts-ignore - TS is not recognizing the value as a valid option
49
+ // @ts-expect-error - TS is not recognizing the value as a valid option
50
50
  onChange={(event) => setValue(event.target.value)}
51
51
  options={options}
52
52
  value={value}
@@ -68,7 +68,7 @@ export const HelpText = () => {
68
68
  id="helpText"
69
69
  label="Flavor"
70
70
  helpText="Choose your favorite flavor"
71
- // @ts-ignore - TS is not recognizing the value as a valid option
71
+ // @ts-expect-error - TS is not recognizing the value as a valid option
72
72
  onChange={(event) => setValue(event.target.value)}
73
73
  options={options}
74
74
  value={value}
@@ -90,7 +90,7 @@ export const Placeholder = () => {
90
90
  <SelectInput
91
91
  id="customPlaceholder"
92
92
  label="Label"
93
- // @ts-ignore - TS is not recognizing the value as a valid option
93
+ // @ts-expect-error - TS is not recognizing the value as a valid option
94
94
  onChange={(event) => setValue(event.target.value)}
95
95
  options={options}
96
96
  value={value}
@@ -112,7 +112,7 @@ export const HiddenLabel = () => {
112
112
  <SelectInput
113
113
  id="labelHidden"
114
114
  label="My label is hidden"
115
- // @ts-ignore - TS is not recognizing the value as a valid option
115
+ // @ts-expect-error - TS is not recognizing the value as a valid option
116
116
  onChange={(event) => setValue(event.target.value)}
117
117
  options={options}
118
118
  value={value}
@@ -134,7 +134,7 @@ export const CreatableSelect = () => {
134
134
  id="creatableSelect"
135
135
  label="Label"
136
136
  value={value}
137
- // @ts-ignore - TS is not recognizing the value as a valid option
137
+ // @ts-expect-error - TS is not recognizing the value as a valid option
138
138
  onChange={(event) => setValue(event.target.value)}
139
139
  options={options}
140
140
  isCreatable
@@ -182,7 +182,7 @@ export const AsyncSelect = () => {
182
182
  id="asyncSelect"
183
183
  label="Label"
184
184
  value={value}
185
- // @ts-ignore - TS is not recognizing the value as a valid option
185
+ // @ts-expect-error - TS is not recognizing the value as a valid option
186
186
  onChange={(event) => setValue(event.target.value)}
187
187
  options={loadOptions}
188
188
  defaultOptions
@@ -233,7 +233,7 @@ export const AsyncCreatableSelect = () => {
233
233
  id="asyncCreateSelect"
234
234
  label="Label"
235
235
  value={value}
236
- // @ts-ignore - TS is not recognizing the value as a valid option
236
+ // @ts-expect-error - TS is not recognizing the value as a valid option
237
237
  onChange={(event) => setValue(event.target.value)}
238
238
  options={loadOptions}
239
239
  isCreatable
@@ -258,7 +258,7 @@ export const MultiSelect = () => {
258
258
  id="multiSelect"
259
259
  label="Label"
260
260
  value={value}
261
- // @ts-ignore - TS is not recognizing the value as a valid option
261
+ // @ts-expect-error - TS is not recognizing the value as a valid option
262
262
  onChange={(event) => setValue(event.target.value)}
263
263
  options={options}
264
264
  isMulti
@@ -280,7 +280,7 @@ export const MultiSelectAndPreSelected = () => {
280
280
  id="preSelectMultiSelect"
281
281
  label="Label"
282
282
  value={value}
283
- // @ts-ignore - TS is not recognizing the value as a valid option
283
+ // @ts-expect-error - TS is not recognizing the value as a valid option
284
284
  onChange={(event) => setValue(event.target.value)}
285
285
  options={options}
286
286
  isMulti
@@ -302,7 +302,7 @@ export const MultiSelectCreatable = () => {
302
302
  id="creatableMultiSelect"
303
303
  label="Label"
304
304
  value={value}
305
- // @ts-ignore - TS is not recognizing the value as a valid option
305
+ // @ts-expect-error - TS is not recognizing the value as a valid option
306
306
  onChange={(event) => setValue(event.target.value)}
307
307
  options={options}
308
308
  isMulti
@@ -325,7 +325,7 @@ export const Autofocus = () => {
325
325
  id="autoFocus"
326
326
  label="Label"
327
327
  value={value}
328
- // @ts-ignore - TS is not recognizing the value as a valid option
328
+ // @ts-expect-error - TS is not recognizing the value as a valid option
329
329
  onChange={(event) => setValue(event.target.value)}
330
330
  options={options}
331
331
  autoFocus
@@ -347,7 +347,7 @@ export const Required = () => {
347
347
  id="required"
348
348
  label="Label"
349
349
  value={value}
350
- // @ts-ignore - TS is not recognizing the value as a valid option
350
+ // @ts-expect-error - TS is not recognizing the value as a valid option
351
351
  onChange={(event) => setValue(event.target.value)}
352
352
  options={options}
353
353
  isRequired
@@ -369,7 +369,7 @@ export const Disabled = () => {
369
369
  id="disabled"
370
370
  label="Label"
371
371
  value={value}
372
- // @ts-ignore - TS is not recognizing the value as a valid option
372
+ // @ts-expect-error - TS is not recognizing the value as a valid option
373
373
  onChange={(event) => setValue(event.target.value)}
374
374
  options={options}
375
375
  isDisabled
@@ -392,7 +392,7 @@ export const Clearable = () => {
392
392
  label="Label"
393
393
  value={value}
394
394
  name="myClearableSelect"
395
- // @ts-ignore - TS is not recognizing the value as a valid option
395
+ // @ts-expect-error - TS is not recognizing the value as a valid option
396
396
  onChange={(event) => setValue(event.target.value)}
397
397
  options={options}
398
398
  isClearable
@@ -414,7 +414,7 @@ export const Error = () => {
414
414
  id="error"
415
415
  label="Label"
416
416
  value={value}
417
- // @ts-ignore - TS is not recognizing the value as a valid option
417
+ // @ts-expect-error - TS is not recognizing the value as a valid option
418
418
  onChange={(event) => setValue(event.target.value)}
419
419
  options={options}
420
420
  isRequired
@@ -439,7 +439,7 @@ export const Sizes = () => {
439
439
  <SelectInput
440
440
  id="smallSelect"
441
441
  label="Small"
442
- // @ts-ignore - TS is not recognizing the value as a valid option
442
+ // @ts-expect-error - TS is not recognizing the value as a valid option
443
443
  onChange={(event) => setValue(event.target.value)}
444
444
  options={options}
445
445
  value={value}
@@ -448,7 +448,7 @@ export const Sizes = () => {
448
448
  <SelectInput
449
449
  id="mediumSelect"
450
450
  label="Medium"
451
- // @ts-ignore - TS is not recognizing the value as a valid option
451
+ // @ts-expect-error - TS is not recognizing the value as a valid option
452
452
  onChange={(event) => setValue1(event.target.value)}
453
453
  options={options}
454
454
  value={value1}
@@ -457,7 +457,7 @@ export const Sizes = () => {
457
457
  <SelectInput
458
458
  id="largeSelect"
459
459
  label="Large"
460
- // @ts-ignore - TS is not recognizing the value as a valid option
460
+ // @ts-expect-error - TS is not recognizing the value as a valid option
461
461
  onChange={(event) => setValue2(event.target.value)}
462
462
  options={options}
463
463
  value={value2}
@@ -466,7 +466,7 @@ export const Sizes = () => {
466
466
  <SelectInput
467
467
  id="responsiveSelect"
468
468
  label="Responsive"
469
- // @ts-ignore - TS is not recognizing the value as a valid option
469
+ // @ts-expect-error - TS is not recognizing the value as a valid option
470
470
  onChange={(event) => setValue3(event.target.value)}
471
471
  options={options}
472
472
  value={value3}
@@ -488,7 +488,7 @@ export const WithPortal = () => {
488
488
  id="portal"
489
489
  label="Flavors"
490
490
  value={value}
491
- // @ts-ignore - TS is not recognizing the value as a valid option
491
+ // @ts-expect-error - TS is not recognizing the value as a valid option
492
492
  onChange={(event) => setValue(event.target.value)}
493
493
  options={options}
494
494
  menuPortalTarget={document.body}
@@ -509,7 +509,7 @@ export const CustomClasses = () => {
509
509
  id="customClasses"
510
510
  label="Label"
511
511
  value={value}
512
- // @ts-ignore - TS is not recognizing the value as a valid option
512
+ // @ts-expect-error - TS is not recognizing the value as a valid option
513
513
  onChange={(event) => setValue(event.target.value)}
514
514
  options={options}
515
515
  className="background-color-primary"
@@ -18,17 +18,21 @@ import { InputValidationMessage } from '../InputValidationMessage/InputValidatio
18
18
  import styles from './SelectInput.module.scss';
19
19
  import { GroupBase } from 'react-select/dist/declarations/src/types';
20
20
 
21
- type SelectOptions = any;
22
- type SelectGroupOptions = GroupBase<SelectOptions>;
21
+ type SelectOption = {
22
+ value: string;
23
+ label: ReactNode;
24
+ [key: string]: unknown;
25
+ };
26
+ type SelectGroupOptions = GroupBase<SelectOption>;
23
27
  export type SelectInputOptions = OptionsOrGroups<
24
- SelectOptions,
28
+ SelectOption,
25
29
  SelectGroupOptions
26
30
  >;
27
31
 
28
32
  export type SimulatedEventPayloadType = {
29
33
  target: {
30
34
  name: string;
31
- value: OnChangeValue<SelectInputOptions, boolean>;
35
+ value: OnChangeValue<SelectOption, boolean>;
32
36
  };
33
37
  };
34
38
 
@@ -141,7 +145,9 @@ export interface SelectInputProps {
141
145
  [x: string]: any; // eslint-disable-line
142
146
  }
143
147
 
144
- type AsyncOptions = (inputValue: string) => Promise<SelectInputOptions>;
148
+ type AsyncOptions = (
149
+ inputValue: string
150
+ ) => Promise<OptionsOrGroups<SelectOption, SelectGroupOptions>>;
145
151
  type AsyncSelectInputProps = SelectInputProps & {
146
152
  /**
147
153
  * Load the input asynchronously.
@@ -202,7 +208,7 @@ export function SelectInput(props: SelectInputProps): JSX.Element {
202
208
  ...restProps
203
209
  } = props;
204
210
 
205
- const handleChange = (values: OnChangeValue<SelectInputOptions, boolean>) => {
211
+ const handleChange = (values: OnChangeValue<SelectOption, boolean>) => {
206
212
  const simulatedEventPayloadType: SimulatedEventPayloadType = {
207
213
  target: {
208
214
  name,
@@ -245,9 +251,7 @@ export function SelectInput(props: SelectInputProps): JSX.Element {
245
251
  };
246
252
 
247
253
  const ClearIndicator = (
248
- props: ClearIndicatorProps<
249
- OptionsOrGroups<SelectOptions, SelectGroupOptions>
250
- >
254
+ props: ClearIndicatorProps<SelectOption, boolean, SelectGroupOptions>
251
255
  ) => (
252
256
  <components.ClearIndicator {...props}>
253
257
  <Icon name="remove" />
@@ -233,3 +233,5 @@ export const SelectInputInset: ForwardRefExoticComponent<SelectInputInsetProps>
233
233
  );
234
234
  }
235
235
  );
236
+
237
+ SelectInputInset.displayName = 'SelectInputInset';
@@ -4,6 +4,10 @@
4
4
  border-right: 2px solid transparent;
5
5
  }
6
6
 
7
+ .rail:focus:not(:focus-visible) {
8
+ outline: none;
9
+ }
10
+
7
11
  .rail:hover {
8
12
  border-right: 2px solid var(--color-border-sidebar-rail-hover);
9
13
  }
@@ -340,12 +340,16 @@ interface NavItem {
340
340
  }[];
341
341
  }
342
342
 
343
+ type Team = {
344
+ name: string;
345
+ };
346
+
343
347
  const NavHeader = ({
344
348
  activeTeam,
345
349
  setActiveTeam,
346
350
  }: {
347
- activeTeam: any;
348
- setActiveTeam: (team: any) => void;
351
+ activeTeam: Team;
352
+ setActiveTeam: (team: Team) => void;
349
353
  }) => {
350
354
  const { state, isMobile } = useSidebar();
351
355
 
@@ -645,8 +649,8 @@ const OrgSwitcher = ({
645
649
  activeTeam,
646
650
  setActiveTeam,
647
651
  }: {
648
- activeTeam: any;
649
- setActiveTeam: (team: any) => void;
652
+ activeTeam: Team;
653
+ setActiveTeam: (team: Team) => void;
650
654
  }) => {
651
655
  const { state } = useSidebar();
652
656
 
@@ -139,10 +139,13 @@ describe('Sidebar', () => {
139
139
  });
140
140
 
141
141
  test.each([
142
- ['input', <input aria-label="input-field" />],
143
- ['textarea', <textarea aria-label="textarea-field" />],
144
- ['select', <select aria-label="select-field" />],
145
- ['contenteditable', <div aria-label="editable-field" contentEditable />],
142
+ ['input', <input aria-label="input-field" key="input" />],
143
+ ['textarea', <textarea aria-label="textarea-field" key="textarea" />],
144
+ ['select', <select aria-label="select-field" key="select" />],
145
+ [
146
+ 'contenteditable',
147
+ <div aria-label="editable-field" contentEditable key="contenteditable" />,
148
+ ],
146
149
  ])('ignores keyboard shortcuts for %s elements', (label, field) => {
147
150
  render(
148
151
  <SidebarProvider>
@@ -22,6 +22,7 @@ import {
22
22
  } from '../Tooltip/Tooltip';
23
23
 
24
24
  const SIDEBAR_WIDTH = '16rem';
25
+ const SIDEBAR_RIGHT_WIDTH = '24rem';
25
26
  const SIDEBAR_WIDTH_ICON = '44px';
26
27
  const SIDEBAR_KEYBOARD_SHORTCUT_LEFT = '[';
27
28
  const SIDEBAR_KEYBOARD_SHORTCUT_RIGHT = ']';
@@ -197,8 +198,12 @@ const useSidebarSideState = ({
197
198
 
198
199
  const toggleSidebar = useCallback(() => {
199
200
  lastToggledSideRef.current = side;
200
- isMobile ? setOpenMobile((value) => !value) : setOpen((value) => !value);
201
- }, [isMobile, setOpen, side, lastToggledSideRef]);
201
+ if (isMobile) {
202
+ setOpenMobile((value) => !value);
203
+ } else {
204
+ setOpen((value) => !value);
205
+ }
206
+ }, [isMobile, setOpen, side, setOpenMobile, lastToggledSideRef]);
202
207
 
203
208
  const state = open ? 'expanded' : 'collapsed';
204
209
 
@@ -343,7 +348,7 @@ const SidebarProvider = forwardRef<
343
348
  } as React.CSSProperties
344
349
  }
345
350
  className={classNames(
346
- 'display-flex w-100 background-color-secondary',
351
+ 'display-flex w-100 background-color-secondary overflow-hidden',
347
352
  className
348
353
  )}
349
354
  ref={ref}
@@ -372,6 +377,7 @@ const Sidebar = React.forwardRef<
372
377
  ref
373
378
  ) => {
374
379
  const { isMobile, state, openMobile, setOpenMobile } = useSidebar(side);
380
+ const sidebarWidth = side === 'right' ? SIDEBAR_RIGHT_WIDTH : SIDEBAR_WIDTH;
375
381
 
376
382
  if (isMobile) {
377
383
  return (
@@ -397,9 +403,12 @@ const Sidebar = React.forwardRef<
397
403
  'group display-flex h-100 font-size-xs flex-direction-column background-color-secondary font-color-base',
398
404
  className
399
405
  )}
400
- style={{
401
- width: 'var(--sidebar-width)',
402
- }}
406
+ style={
407
+ {
408
+ '--sidebar-width': sidebarWidth,
409
+ width: 'var(--sidebar-width)',
410
+ } as React.CSSProperties
411
+ }
403
412
  ref={ref}
404
413
  {...props}
405
414
  >
@@ -419,9 +428,9 @@ const Sidebar = React.forwardRef<
419
428
  fontSize="sm"
420
429
  position="relative"
421
430
  style={
422
- side === 'right' && collapsible === 'offcanvas'
423
- ? { overflowX: 'hidden' }
424
- : undefined
431
+ {
432
+ '--sidebar-width': sidebarWidth,
433
+ } as React.CSSProperties
425
434
  }
426
435
  data-state={state}
427
436
  data-collapsible={collapsible}
@@ -635,12 +644,11 @@ const SidebarMenuButton = React.forwardRef<
635
644
  React.ComponentProps<'button'> & {
636
645
  asChild?: boolean;
637
646
  isActive?: boolean;
638
- icon?: IconName;
639
647
  tooltip?: string | React.ComponentProps<typeof TooltipContent>;
640
648
  }
641
649
  >(
642
650
  (
643
- { asChild = false, isActive = false, icon, tooltip, className, ...props },
651
+ { asChild = false, isActive = false, tooltip, className, ...props },
644
652
  ref
645
653
  ) => {
646
654
  const Comp = asChild ? Slot : 'button';
@@ -846,9 +854,10 @@ const SidebarRail = React.forwardRef<
846
854
  top: '20px',
847
855
  bottom: '20px',
848
856
  right: side === 'left' ? '-14px' : undefined,
849
- left: side === 'right' ? '-14px' : undefined,
857
+ left: side === 'right' ? '-18px' : undefined,
850
858
  width: '10px',
851
859
  }}
860
+ type="button"
852
861
  {...props}
853
862
  >
854
863
  <Box