@itwin/itwinui-react 3.0.0-dev.6 → 3.0.0-dev.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (283) hide show
  1. package/CHANGELOG.md +101 -0
  2. package/cjs/core/Alert/Alert.d.ts +20 -9
  3. package/cjs/core/Alert/Alert.js +48 -10
  4. package/cjs/core/Avatar/Avatar.d.ts +3 -2
  5. package/cjs/core/Avatar/Avatar.js +21 -19
  6. package/cjs/core/AvatarGroup/AvatarGroup.js +3 -8
  7. package/cjs/core/ButtonGroup/ButtonGroup.js +41 -36
  8. package/cjs/core/Buttons/Button/Button.d.ts +15 -2
  9. package/cjs/core/Buttons/Button/Button.js +23 -9
  10. package/cjs/core/Buttons/DropdownButton/DropdownButton.js +1 -1
  11. package/cjs/core/Buttons/IconButton/IconButton.d.ts +5 -1
  12. package/cjs/core/Buttons/IconButton/IconButton.js +27 -38
  13. package/cjs/core/Buttons/SplitButton/SplitButton.d.ts +9 -0
  14. package/cjs/core/Buttons/SplitButton/SplitButton.js +25 -13
  15. package/cjs/core/Carousel/Carousel.d.ts +6 -4
  16. package/cjs/core/Carousel/Carousel.js +2 -2
  17. package/cjs/core/Carousel/CarouselDot.js +1 -3
  18. package/cjs/core/Carousel/CarouselNavigation.d.ts +6 -4
  19. package/cjs/core/ColorPicker/ColorBuilder.js +2 -1
  20. package/cjs/core/ColorPicker/ColorInputPanel.js +172 -231
  21. package/cjs/core/ComboBox/ComboBox.js +3 -3
  22. package/cjs/core/ComboBox/ComboBoxDropdown.js +4 -9
  23. package/cjs/core/ComboBox/ComboBoxEndIcon.js +3 -22
  24. package/cjs/core/ComboBox/ComboBoxInput.js +1 -1
  25. package/cjs/core/ComboBox/ComboBoxMenu.d.ts +2 -2
  26. package/cjs/core/ComboBox/ComboBoxMenu.js +5 -5
  27. package/cjs/core/ComboBox/ComboBoxMenuItem.d.ts +1 -1
  28. package/cjs/core/ComboBox/ComboBoxMenuItem.js +8 -6
  29. package/cjs/core/ComboBox/helpers.d.ts +1 -2
  30. package/cjs/core/DatePicker/DatePicker.d.ts +30 -8
  31. package/cjs/core/DatePicker/DatePicker.js +47 -6
  32. package/cjs/core/Dialog/Dialog.js +10 -17
  33. package/cjs/core/Dialog/DialogContext.d.ts +3 -4
  34. package/cjs/core/Dialog/DialogMain.js +5 -5
  35. package/cjs/core/ExpandableBlock/ExpandableBlock.d.ts +20 -14
  36. package/cjs/core/ExpandableBlock/ExpandableBlock.js +39 -18
  37. package/cjs/core/FileUpload/FileUpload.d.ts +4 -0
  38. package/cjs/core/FileUpload/FileUpload.js +24 -3
  39. package/cjs/core/Header/HeaderBasicButton.js +3 -16
  40. package/cjs/core/Header/HeaderDropdownButton.js +1 -1
  41. package/cjs/core/Header/HeaderSplitButton.js +3 -4
  42. package/cjs/core/Input/Input.d.ts +4 -0
  43. package/cjs/core/Input/Input.js +2 -1
  44. package/cjs/core/InputGrid/InputGrid.d.ts +25 -0
  45. package/cjs/core/InputGrid/InputGrid.js +39 -0
  46. package/cjs/core/InputGrid/index.d.ts +3 -0
  47. package/cjs/core/InputGrid/index.js +15 -0
  48. package/cjs/core/InputGroup/InputGroup.d.ts +13 -0
  49. package/cjs/core/InputGroup/InputGroup.js +35 -9
  50. package/cjs/core/InputWithDecorations/InputWithDecorations.d.ts +39 -0
  51. package/cjs/core/InputWithDecorations/InputWithDecorations.js +81 -0
  52. package/cjs/core/InputWithDecorations/index.d.ts +3 -0
  53. package/cjs/core/InputWithDecorations/index.js +15 -0
  54. package/cjs/core/Label/Label.d.ts +5 -0
  55. package/cjs/core/Label/Label.js +2 -0
  56. package/cjs/core/LabeledInput/LabeledInput.d.ts +22 -16
  57. package/cjs/core/LabeledInput/LabeledInput.js +52 -29
  58. package/cjs/core/LabeledSelect/LabeledSelect.d.ts +17 -7
  59. package/cjs/core/LabeledSelect/LabeledSelect.js +36 -17
  60. package/cjs/core/LabeledTextarea/LabeledTextarea.d.ts +15 -5
  61. package/cjs/core/LabeledTextarea/LabeledTextarea.js +12 -45
  62. package/cjs/core/Menu/Menu.d.ts +1 -1
  63. package/cjs/core/Menu/Menu.js +1 -1
  64. package/cjs/core/Menu/MenuDivider.d.ts +2 -1
  65. package/cjs/core/Menu/MenuDivider.js +1 -1
  66. package/cjs/core/Menu/MenuItem.d.ts +1 -1
  67. package/cjs/core/Menu/MenuItem.js +1 -0
  68. package/cjs/core/Menu/MenuItemSkeleton.d.ts +1 -1
  69. package/cjs/core/Menu/MenuItemSkeleton.js +0 -1
  70. package/cjs/core/ProgressIndicators/ProgressLinear.d.ts +4 -0
  71. package/cjs/core/ProgressIndicators/ProgressLinear.js +9 -1
  72. package/cjs/core/SearchBox/SearchBox.js +1 -1
  73. package/cjs/core/Select/Select.d.ts +4 -0
  74. package/cjs/core/Select/Select.js +12 -11
  75. package/cjs/core/SideNavigation/SideNavigation.d.ts +16 -0
  76. package/cjs/core/SideNavigation/SideNavigation.js +42 -9
  77. package/cjs/core/Slider/Slider.d.ts +24 -0
  78. package/cjs/core/Slider/Slider.js +58 -10
  79. package/cjs/core/Slider/Thumb.js +3 -2
  80. package/cjs/core/Slider/Track.d.ts +1 -1
  81. package/cjs/core/Slider/Track.js +17 -6
  82. package/cjs/core/StatusMessage/StatusMessage.d.ts +12 -2
  83. package/cjs/core/StatusMessage/StatusMessage.js +23 -9
  84. package/cjs/core/Stepper/Stepper.d.ts +26 -1
  85. package/cjs/core/Stepper/Stepper.js +35 -6
  86. package/cjs/core/Stepper/StepperStep.d.ts +17 -0
  87. package/cjs/core/Stepper/StepperStep.js +33 -8
  88. package/cjs/core/Stepper/WorkflowDiagram.d.ts +11 -1
  89. package/cjs/core/Stepper/WorkflowDiagram.js +23 -10
  90. package/cjs/core/Stepper/WorkflowDiagramStep.d.ts +6 -1
  91. package/cjs/core/Stepper/WorkflowDiagramStep.js +9 -2
  92. package/cjs/core/Table/SubRowExpander.js +3 -1
  93. package/cjs/core/Table/Table.js +0 -1
  94. package/cjs/core/Table/TableCell.js +1 -1
  95. package/cjs/core/Table/TablePaginator.js +1 -3
  96. package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.d.ts +6 -1
  97. package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.js +46 -18
  98. package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.d.ts +2 -0
  99. package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.js +2 -0
  100. package/cjs/core/Tabs/Tab.js +1 -2
  101. package/cjs/core/Textarea/Textarea.d.ts +7 -1
  102. package/cjs/core/Textarea/Textarea.js +6 -11
  103. package/cjs/core/ThemeProvider/ThemeContext.d.ts +1 -1
  104. package/cjs/core/ThemeProvider/ThemeProvider.d.ts +23 -3
  105. package/cjs/core/ThemeProvider/ThemeProvider.js +56 -23
  106. package/cjs/core/Tile/Tile.d.ts +142 -17
  107. package/cjs/core/Tile/Tile.js +107 -16
  108. package/cjs/core/Toast/Toast.d.ts +12 -4
  109. package/cjs/core/Toast/Toast.js +24 -13
  110. package/cjs/core/Tooltip/Tooltip.d.ts +35 -28
  111. package/cjs/core/Tooltip/Tooltip.js +116 -118
  112. package/cjs/core/TransferList/TransferList.js +4 -12
  113. package/cjs/core/Tree/TreeNode.js +1 -1
  114. package/cjs/core/index.d.ts +2 -0
  115. package/cjs/core/index.js +20 -4
  116. package/cjs/core/utils/components/ButtonBase.d.ts +14 -0
  117. package/cjs/core/utils/components/ButtonBase.js +46 -0
  118. package/cjs/core/utils/components/Icon.d.ts +5 -0
  119. package/cjs/core/utils/components/Icon.js +8 -1
  120. package/cjs/core/utils/components/InputContainer.d.ts +0 -1
  121. package/cjs/core/utils/components/InputContainer.js +14 -34
  122. package/cjs/core/utils/components/InputFlexContainer.d.ts +1 -0
  123. package/cjs/core/utils/components/InputFlexContainer.js +3 -1
  124. package/cjs/core/utils/components/Popover.js +5 -3
  125. package/cjs/core/utils/components/Portal.d.ts +27 -0
  126. package/cjs/core/utils/components/Portal.js +43 -0
  127. package/cjs/core/utils/components/VirtualScroll.js +4 -4
  128. package/cjs/core/utils/components/index.d.ts +2 -0
  129. package/cjs/core/utils/components/index.js +2 -0
  130. package/cjs/core/utils/functions/colors.d.ts +1 -1
  131. package/cjs/core/utils/functions/colors.js +1 -13
  132. package/cjs/core/utils/functions/index.d.ts +1 -0
  133. package/cjs/core/utils/functions/index.js +1 -0
  134. package/cjs/core/utils/functions/react.d.ts +8 -0
  135. package/cjs/core/utils/functions/react.js +40 -0
  136. package/cjs/core/utils/hooks/index.d.ts +1 -0
  137. package/cjs/core/utils/hooks/index.js +1 -0
  138. package/cjs/core/utils/hooks/useControlledState.d.ts +13 -0
  139. package/cjs/core/utils/hooks/useControlledState.js +39 -0
  140. package/cjs/core/utils/hooks/useGlobals.d.ts +1 -1
  141. package/cjs/styles.js +11 -35
  142. package/esm/core/Alert/Alert.d.ts +20 -9
  143. package/esm/core/Alert/Alert.js +49 -10
  144. package/esm/core/Avatar/Avatar.d.ts +3 -2
  145. package/esm/core/Avatar/Avatar.js +21 -17
  146. package/esm/core/AvatarGroup/AvatarGroup.js +3 -8
  147. package/esm/core/ButtonGroup/ButtonGroup.js +41 -36
  148. package/esm/core/Buttons/Button/Button.d.ts +15 -2
  149. package/esm/core/Buttons/Button/Button.js +18 -10
  150. package/esm/core/Buttons/DropdownButton/DropdownButton.js +1 -1
  151. package/esm/core/Buttons/IconButton/IconButton.d.ts +5 -1
  152. package/esm/core/Buttons/IconButton/IconButton.js +25 -37
  153. package/esm/core/Buttons/SplitButton/SplitButton.d.ts +9 -0
  154. package/esm/core/Buttons/SplitButton/SplitButton.js +31 -14
  155. package/esm/core/Carousel/Carousel.d.ts +6 -4
  156. package/esm/core/Carousel/Carousel.js +8 -3
  157. package/esm/core/Carousel/CarouselDot.js +2 -4
  158. package/esm/core/Carousel/CarouselNavigation.d.ts +6 -4
  159. package/esm/core/ColorPicker/ColorBuilder.js +2 -1
  160. package/esm/core/ColorPicker/ColorInputPanel.js +173 -232
  161. package/esm/core/ComboBox/ComboBox.js +3 -3
  162. package/esm/core/ComboBox/ComboBoxDropdown.js +4 -9
  163. package/esm/core/ComboBox/ComboBoxEndIcon.js +4 -25
  164. package/esm/core/ComboBox/ComboBoxInput.js +1 -1
  165. package/esm/core/ComboBox/ComboBoxMenu.d.ts +2 -2
  166. package/esm/core/ComboBox/ComboBoxMenu.js +5 -5
  167. package/esm/core/ComboBox/ComboBoxMenuItem.d.ts +1 -1
  168. package/esm/core/ComboBox/ComboBoxMenuItem.js +9 -7
  169. package/esm/core/ComboBox/helpers.d.ts +1 -2
  170. package/esm/core/DatePicker/DatePicker.d.ts +30 -8
  171. package/esm/core/DatePicker/DatePicker.js +33 -6
  172. package/esm/core/Dialog/Dialog.js +11 -23
  173. package/esm/core/Dialog/DialogContext.d.ts +3 -4
  174. package/esm/core/Dialog/DialogMain.js +5 -5
  175. package/esm/core/ExpandableBlock/ExpandableBlock.d.ts +20 -14
  176. package/esm/core/ExpandableBlock/ExpandableBlock.js +41 -20
  177. package/esm/core/FileUpload/FileUpload.d.ts +4 -0
  178. package/esm/core/FileUpload/FileUpload.js +26 -3
  179. package/esm/core/Header/HeaderBasicButton.js +4 -17
  180. package/esm/core/Header/HeaderDropdownButton.js +1 -1
  181. package/esm/core/Header/HeaderSplitButton.js +9 -5
  182. package/esm/core/Input/Input.d.ts +4 -0
  183. package/esm/core/Input/Input.js +2 -1
  184. package/esm/core/InputGrid/InputGrid.d.ts +25 -0
  185. package/esm/core/InputGrid/InputGrid.js +35 -0
  186. package/esm/core/InputGrid/index.d.ts +3 -0
  187. package/esm/core/InputGrid/index.js +6 -0
  188. package/esm/core/InputGroup/InputGroup.d.ts +13 -0
  189. package/esm/core/InputGroup/InputGroup.js +34 -10
  190. package/esm/core/InputWithDecorations/InputWithDecorations.d.ts +39 -0
  191. package/esm/core/InputWithDecorations/InputWithDecorations.js +80 -0
  192. package/esm/core/InputWithDecorations/index.d.ts +3 -0
  193. package/esm/core/InputWithDecorations/index.js +6 -0
  194. package/esm/core/Label/Label.d.ts +5 -0
  195. package/esm/core/Label/Label.js +2 -0
  196. package/esm/core/LabeledInput/LabeledInput.d.ts +22 -16
  197. package/esm/core/LabeledInput/LabeledInput.js +53 -29
  198. package/esm/core/LabeledSelect/LabeledSelect.d.ts +17 -7
  199. package/esm/core/LabeledSelect/LabeledSelect.js +37 -18
  200. package/esm/core/LabeledTextarea/LabeledTextarea.d.ts +15 -5
  201. package/esm/core/LabeledTextarea/LabeledTextarea.js +14 -45
  202. package/esm/core/Menu/Menu.d.ts +1 -1
  203. package/esm/core/Menu/Menu.js +1 -1
  204. package/esm/core/Menu/MenuDivider.d.ts +2 -1
  205. package/esm/core/Menu/MenuDivider.js +1 -1
  206. package/esm/core/Menu/MenuItem.d.ts +1 -1
  207. package/esm/core/Menu/MenuItem.js +1 -0
  208. package/esm/core/Menu/MenuItemSkeleton.d.ts +1 -1
  209. package/esm/core/Menu/MenuItemSkeleton.js +0 -1
  210. package/esm/core/ProgressIndicators/ProgressLinear.d.ts +4 -0
  211. package/esm/core/ProgressIndicators/ProgressLinear.js +9 -1
  212. package/esm/core/SearchBox/SearchBox.js +1 -1
  213. package/esm/core/Select/Select.d.ts +4 -0
  214. package/esm/core/Select/Select.js +12 -11
  215. package/esm/core/SideNavigation/SideNavigation.d.ts +16 -0
  216. package/esm/core/SideNavigation/SideNavigation.js +33 -9
  217. package/esm/core/Slider/Slider.d.ts +24 -0
  218. package/esm/core/Slider/Slider.js +43 -10
  219. package/esm/core/Slider/Thumb.js +3 -2
  220. package/esm/core/Slider/Track.d.ts +1 -1
  221. package/esm/core/Slider/Track.js +14 -6
  222. package/esm/core/StatusMessage/StatusMessage.d.ts +12 -2
  223. package/esm/core/StatusMessage/StatusMessage.js +23 -16
  224. package/esm/core/Stepper/Stepper.d.ts +26 -1
  225. package/esm/core/Stepper/Stepper.js +32 -6
  226. package/esm/core/Stepper/StepperStep.d.ts +17 -0
  227. package/esm/core/Stepper/StepperStep.js +27 -8
  228. package/esm/core/Stepper/WorkflowDiagram.d.ts +11 -1
  229. package/esm/core/Stepper/WorkflowDiagram.js +10 -7
  230. package/esm/core/Stepper/WorkflowDiagramStep.d.ts +6 -1
  231. package/esm/core/Stepper/WorkflowDiagramStep.js +6 -2
  232. package/esm/core/Table/SubRowExpander.js +3 -1
  233. package/esm/core/Table/Table.js +0 -1
  234. package/esm/core/Table/TableCell.js +1 -1
  235. package/esm/core/Table/TablePaginator.js +2 -3
  236. package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.d.ts +6 -1
  237. package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.js +45 -17
  238. package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.d.ts +2 -0
  239. package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.js +2 -0
  240. package/esm/core/Tabs/Tab.js +2 -3
  241. package/esm/core/Textarea/Textarea.d.ts +7 -1
  242. package/esm/core/Textarea/Textarea.js +6 -11
  243. package/esm/core/ThemeProvider/ThemeContext.d.ts +1 -1
  244. package/esm/core/ThemeProvider/ThemeProvider.d.ts +23 -3
  245. package/esm/core/ThemeProvider/ThemeProvider.js +65 -24
  246. package/esm/core/Tile/Tile.d.ts +142 -17
  247. package/esm/core/Tile/Tile.js +107 -16
  248. package/esm/core/Toast/Toast.d.ts +12 -4
  249. package/esm/core/Toast/Toast.js +26 -13
  250. package/esm/core/Tooltip/Tooltip.d.ts +35 -28
  251. package/esm/core/Tooltip/Tooltip.js +119 -116
  252. package/esm/core/TransferList/TransferList.js +4 -9
  253. package/esm/core/Tree/TreeNode.js +1 -1
  254. package/esm/core/index.d.ts +2 -0
  255. package/esm/core/index.js +2 -0
  256. package/esm/core/utils/components/ButtonBase.d.ts +14 -0
  257. package/esm/core/utils/components/ButtonBase.js +42 -0
  258. package/esm/core/utils/components/Icon.d.ts +5 -0
  259. package/esm/core/utils/components/Icon.js +8 -1
  260. package/esm/core/utils/components/InputContainer.d.ts +0 -1
  261. package/esm/core/utils/components/InputContainer.js +14 -30
  262. package/esm/core/utils/components/InputFlexContainer.d.ts +1 -0
  263. package/esm/core/utils/components/InputFlexContainer.js +3 -1
  264. package/esm/core/utils/components/Popover.js +5 -3
  265. package/esm/core/utils/components/Portal.d.ts +27 -0
  266. package/esm/core/utils/components/Portal.js +36 -0
  267. package/esm/core/utils/components/VirtualScroll.js +4 -4
  268. package/esm/core/utils/components/index.d.ts +2 -0
  269. package/esm/core/utils/components/index.js +2 -0
  270. package/esm/core/utils/functions/colors.d.ts +1 -1
  271. package/esm/core/utils/functions/colors.js +1 -13
  272. package/esm/core/utils/functions/index.d.ts +1 -0
  273. package/esm/core/utils/functions/index.js +1 -0
  274. package/esm/core/utils/functions/react.d.ts +8 -0
  275. package/esm/core/utils/functions/react.js +35 -0
  276. package/esm/core/utils/hooks/index.d.ts +1 -0
  277. package/esm/core/utils/hooks/index.js +1 -0
  278. package/esm/core/utils/hooks/useControlledState.d.ts +13 -0
  279. package/esm/core/utils/hooks/useControlledState.js +34 -0
  280. package/esm/core/utils/hooks/useGlobals.d.ts +1 -1
  281. package/esm/styles.js +11 -35
  282. package/package.json +3 -3
  283. package/styles.css +49 -46
@@ -1,6 +1,9 @@
1
1
  import * as React from 'react';
2
- import type { InputProps } from '../Input/Input.js';
2
+ import { Input } from '../Input/Input.js';
3
+ import { Icon } from '../utils/index.js';
3
4
  import type { PolymorphicForwardRefComponent } from '../utils/index.js';
5
+ import { InputGrid } from '../InputGrid/index.js';
6
+ import { InputWithDecorations } from '../InputWithDecorations/index.js';
4
7
  export type LabeledInputProps = {
5
8
  /**
6
9
  * Label of the input.
@@ -17,15 +20,11 @@ export type LabeledInputProps = {
17
20
  /**
18
21
  * Custom svg icon. Will override status icon if specified.
19
22
  */
20
- svgIcon?: JSX.Element;
23
+ svgIcon?: JSX.Element | null;
21
24
  /**
22
- * Custom CSS class name for the input element.
25
+ * Pass props to wrapper element.
23
26
  */
24
- inputClassName?: string;
25
- /**
26
- * Custom CSS Style for the input element.
27
- */
28
- inputStyle?: React.CSSProperties;
27
+ wrapperProps?: React.ComponentProps<typeof InputGrid>;
29
28
  /**
30
29
  * Set display style of label.
31
30
  * Supported values:
@@ -35,15 +34,22 @@ export type LabeledInputProps = {
35
34
  */
36
35
  displayStyle?: 'default' | 'inline';
37
36
  /**
38
- * Set display style of icon.
39
- * Supported values:
40
- * - 'block' - icon appears below input.
41
- * - 'inline' - icon appears inside input (at the end).
42
- *
43
- * Defaults to 'block' if `displayStyle` is `default`, else 'inline'.
37
+ * Passes properties for message content.
38
+ */
39
+ messageContentProps?: React.ComponentPropsWithRef<'div'>;
40
+ /**
41
+ * Passes properties for icon.
42
+ */
43
+ iconProps?: React.ComponentProps<typeof Icon>;
44
+ /**
45
+ * Passes properties for label.
46
+ */
47
+ labelProps?: React.ComponentProps<'label'>;
48
+ /**
49
+ * Passes properties for input wrapper.
44
50
  */
45
- iconDisplayStyle?: 'block' | 'inline';
46
- } & InputProps;
51
+ inputWrapperProps?: React.ComponentProps<typeof InputWithDecorations>;
52
+ } & React.ComponentProps<typeof Input>;
47
53
  /**
48
54
  * Basic labeled input component
49
55
  * @example
@@ -7,8 +7,11 @@ const tslib_1 = require('tslib');
7
7
  * See LICENSE.md in the project root for license terms and full copyright notice.
8
8
  *--------------------------------------------------------------------------------------------*/
9
9
  const React = tslib_1.__importStar(require('react'));
10
- const Input_js_1 = require('../Input/Input.js');
11
10
  const index_js_1 = require('../utils/index.js');
11
+ const index_js_2 = require('../InputGrid/index.js');
12
+ const index_js_3 = require('../InputWithDecorations/index.js');
13
+ const StatusMessage_js_1 = require('../StatusMessage/StatusMessage.js');
14
+ const Label_js_1 = require('../Label/Label.js');
12
15
  /**
13
16
  * Basic labeled input component
14
17
  * @example
@@ -20,46 +23,66 @@ const index_js_1 = require('../utils/index.js');
20
23
  exports.LabeledInput = React.forwardRef((props, ref) => {
21
24
  const uid = (0, index_js_1.useId)();
22
25
  const {
23
- className,
24
26
  disabled = false,
25
27
  label,
26
28
  message,
27
29
  status,
28
30
  svgIcon,
29
- style,
30
- inputClassName,
31
- inputStyle,
31
+ wrapperProps,
32
+ labelProps,
33
+ messageContentProps,
34
+ iconProps,
35
+ inputWrapperProps,
32
36
  displayStyle = 'default',
33
- iconDisplayStyle = displayStyle === 'default' ? 'block' : 'inline',
34
37
  required = false,
35
38
  id = uid,
36
39
  ...rest
37
40
  } = props;
38
41
  const icon = svgIcon ?? (status && index_js_1.StatusIconMap[status]());
42
+ const shouldShowIcon = svgIcon !== null && (svgIcon || (status && !message));
39
43
  return React.createElement(
40
- index_js_1.InputContainer,
41
- {
42
- label: label,
43
- disabled: disabled,
44
- required: required,
45
- status: status,
46
- message: message,
47
- icon: icon,
48
- isLabelInline: displayStyle === 'inline',
49
- isIconInline: iconDisplayStyle === 'inline',
50
- className: className,
51
- style: style,
52
- inputId: id,
53
- },
54
- React.createElement(Input_js_1.Input, {
55
- disabled: disabled,
56
- className: inputClassName,
57
- style: inputStyle,
58
- required: required,
59
- ref: ref,
60
- id: id,
61
- ...rest,
62
- }),
44
+ index_js_2.InputGrid,
45
+ { labelPlacement: displayStyle, ...wrapperProps },
46
+ label &&
47
+ React.createElement(
48
+ Label_js_1.Label,
49
+ {
50
+ as: 'label',
51
+ required: required,
52
+ disabled: disabled,
53
+ htmlFor: id,
54
+ ...labelProps,
55
+ },
56
+ label,
57
+ ),
58
+ React.createElement(
59
+ index_js_3.InputWithDecorations,
60
+ { status: status, isDisabled: disabled, ...inputWrapperProps },
61
+ React.createElement(index_js_3.InputWithDecorations.Input, {
62
+ disabled: disabled,
63
+ required: required,
64
+ id: id,
65
+ ref: ref,
66
+ ...rest,
67
+ }),
68
+ shouldShowIcon &&
69
+ React.createElement(
70
+ index_js_1.Icon,
71
+ { fill: !svgIcon ? status : undefined, padded: true, ...iconProps },
72
+ icon,
73
+ ),
74
+ ),
75
+ typeof message === 'string'
76
+ ? React.createElement(
77
+ StatusMessage_js_1.StatusMessage,
78
+ {
79
+ status: status,
80
+ iconProps: iconProps,
81
+ contentProps: messageContentProps,
82
+ },
83
+ message,
84
+ )
85
+ : message,
63
86
  );
64
87
  });
65
88
  exports.default = exports.LabeledInput;
@@ -1,6 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import type { SelectProps } from '../Select/Select.js';
3
+ import { Icon } from '../utils/index.js';
3
4
  import type { LabeledInputProps } from '../LabeledInput/LabeledInput.js';
5
+ import { InputGrid } from '../InputGrid/InputGrid.js';
4
6
  export type LabeledSelectProps<T> = {
5
7
  /**
6
8
  * Label of the select.
@@ -20,18 +22,26 @@ export type LabeledSelectProps<T> = {
20
22
  */
21
23
  svgIcon?: JSX.Element;
22
24
  /**
23
- * Custom CSS class name for the select element.
25
+ * If true, shows a red asterisk but does not prevent form submission.
26
+ * @default false
24
27
  */
25
- selectClassName?: string;
28
+ required?: boolean;
26
29
  /**
27
- * Custom CSS Style for the select element.
30
+ * Pass props to wrapper element.
28
31
  */
29
- selectStyle?: React.CSSProperties;
32
+ wrapperProps?: React.ComponentProps<typeof InputGrid>;
30
33
  /**
31
- * If true, shows a red asterisk but does not prevent form submission.
32
- * @default false
34
+ * Passes properties for label.
33
35
  */
34
- required?: boolean;
36
+ labelProps?: React.ComponentProps<'div'>;
37
+ /**
38
+ * Passes properties for message content.
39
+ */
40
+ messageContentProps?: React.ComponentPropsWithRef<'div'>;
41
+ /**
42
+ * Passes properties for message icon.
43
+ */
44
+ messageIconProps?: React.ComponentProps<typeof Icon>;
35
45
  } & Pick<LabeledInputProps, 'displayStyle'> & SelectProps<T>;
36
46
  /**
37
47
  * Labeled select component to select value from options.
@@ -9,6 +9,9 @@ const tslib_1 = require('tslib');
9
9
  const React = tslib_1.__importStar(require('react'));
10
10
  const index_js_1 = require('../Select/index.js');
11
11
  const index_js_2 = require('../utils/index.js');
12
+ const StatusMessage_js_1 = require('../StatusMessage/StatusMessage.js');
13
+ const InputGrid_js_1 = require('../InputGrid/InputGrid.js');
14
+ const Label_js_1 = require('../Label/Label.js');
12
15
  /**
13
16
  * Labeled select component to select value from options.
14
17
  * @example
@@ -52,16 +55,18 @@ const LabeledSelect = (props) => {
52
55
  svgIcon,
53
56
  displayStyle = 'default',
54
57
  style,
55
- selectClassName,
56
- selectStyle,
57
58
  required = false,
58
59
  triggerProps,
60
+ wrapperProps,
61
+ labelProps,
62
+ messageContentProps,
63
+ messageIconProps,
59
64
  ...rest
60
65
  } = props;
61
66
  const labelId = `${(0, index_js_2.useId)()}-label`;
62
67
  const icon = () => {
63
68
  if (svgIcon) {
64
- return React.cloneElement(svgIcon, { 'aria-hidden': true });
69
+ return React.createElement(index_js_2.Icon, null, svgIcon);
65
70
  }
66
71
  if (status && message) {
67
72
  return index_js_2.StatusIconMap[status]();
@@ -69,29 +74,43 @@ const LabeledSelect = (props) => {
69
74
  return undefined;
70
75
  };
71
76
  return React.createElement(
72
- index_js_2.InputContainer,
73
- {
74
- label: label,
77
+ InputGrid_js_1.InputGrid,
78
+ { labelPlacement: displayStyle, ...wrapperProps },
79
+ label &&
80
+ React.createElement(
81
+ Label_js_1.Label,
82
+ {
83
+ as: 'div',
84
+ required: required,
85
+ disabled: disabled,
86
+ id: labelId,
87
+ ...labelProps,
88
+ },
89
+ label,
90
+ ),
91
+ React.createElement(index_js_1.Select, {
75
92
  disabled: disabled,
76
- required: required,
77
- status: status,
78
- message: message,
79
- icon: displayStyle === 'default' ? icon() : undefined,
80
- isLabelInline: displayStyle === 'inline',
81
93
  className: className,
82
94
  style: style,
83
- labelId: labelId,
84
- },
85
- React.createElement(index_js_1.Select, {
86
- disabled: disabled,
87
- className: selectClassName,
88
- style: selectStyle,
95
+ status: status,
89
96
  ...rest,
90
97
  triggerProps: {
91
98
  'aria-labelledby': labelId,
92
99
  ...triggerProps,
93
100
  },
94
101
  }),
102
+ typeof message === 'string'
103
+ ? React.createElement(
104
+ StatusMessage_js_1.StatusMessage,
105
+ {
106
+ status: status,
107
+ startIcon: displayStyle === 'default' ? icon() : undefined,
108
+ iconProps: messageIconProps,
109
+ contentProps: messageContentProps,
110
+ },
111
+ message,
112
+ )
113
+ : message,
95
114
  );
96
115
  };
97
116
  exports.LabeledSelect = LabeledSelect;
@@ -1,6 +1,8 @@
1
1
  import * as React from 'react';
2
+ import { Icon } from '../utils/index.js';
2
3
  import type { PolymorphicForwardRefComponent } from '../utils/index.js';
3
4
  import type { LabeledInputProps } from '../LabeledInput/LabeledInput.js';
5
+ import { InputGrid } from '../InputGrid/InputGrid.js';
4
6
  type LabeledTextareaProps = {
5
7
  /**
6
8
  * Label for the textarea.
@@ -15,14 +17,22 @@ type LabeledTextareaProps = {
15
17
  */
16
18
  status?: 'positive' | 'warning' | 'negative';
17
19
  /**
18
- * Custom class name for textarea.
20
+ * Pass props to wrapper element.
19
21
  */
20
- textareaClassName?: string;
22
+ wrapperProps?: React.ComponentProps<typeof InputGrid>;
21
23
  /**
22
- * Custom style for textarea.
24
+ * Passes properties for label.
23
25
  */
24
- textareaStyle?: React.CSSProperties;
25
- } & Pick<LabeledInputProps, 'svgIcon' | 'displayStyle' | 'iconDisplayStyle'>;
26
+ labelProps?: React.ComponentProps<'label'>;
27
+ /**
28
+ * Passes properties for message content.
29
+ */
30
+ messageContentProps?: React.ComponentPropsWithRef<'div'>;
31
+ /**
32
+ * Passes properties for svgIcon.
33
+ */
34
+ iconProps?: React.ComponentProps<typeof Icon>;
35
+ } & Pick<LabeledInputProps, 'svgIcon' | 'displayStyle'>;
26
36
  /**
27
37
  * Textarea wrapper that allows for additional styling and labelling
28
38
  * @example
@@ -7,8 +7,7 @@ const tslib_1 = require('tslib');
7
7
  * See LICENSE.md in the project root for license terms and full copyright notice.
8
8
  *--------------------------------------------------------------------------------------------*/
9
9
  const React = tslib_1.__importStar(require('react'));
10
- const index_js_1 = require('../utils/index.js');
11
- const index_js_2 = require('../Textarea/index.js');
10
+ const index_js_1 = require('../LabeledInput/index.js');
12
11
  /**
13
12
  * Textarea wrapper that allows for additional styling and labelling
14
13
  * @example
@@ -30,49 +29,17 @@ const index_js_2 = require('../Textarea/index.js');
30
29
  * status='negative'
31
30
  * />
32
31
  */
33
- exports.LabeledTextarea = React.forwardRef((props, ref) => {
34
- const uid = (0, index_js_1.useId)();
35
- const {
36
- className,
37
- style,
38
- disabled = false,
39
- label,
40
- message,
41
- status,
42
- textareaClassName,
43
- textareaStyle,
44
- displayStyle = 'default',
45
- iconDisplayStyle = displayStyle === 'default' ? 'block' : 'inline',
46
- svgIcon,
47
- required = false,
48
- id = uid,
49
- ...textareaProps
50
- } = props;
51
- const icon = svgIcon ?? (status && index_js_1.StatusIconMap[status]());
52
- return React.createElement(
53
- index_js_1.InputContainer,
54
- {
55
- label: label,
56
- disabled: disabled,
57
- required: required,
58
- status: status,
59
- message: message,
60
- icon: icon,
61
- isLabelInline: displayStyle === 'inline',
62
- isIconInline: iconDisplayStyle === 'inline',
63
- className: className,
64
- style: style,
65
- inputId: id,
66
- },
67
- React.createElement(index_js_2.Textarea, {
68
- disabled: disabled,
69
- className: textareaClassName,
70
- style: textareaStyle,
71
- required: required,
72
- id: id,
73
- ...textareaProps,
74
- ref: ref,
75
- }),
32
+ exports.LabeledTextarea = React.forwardRef((props, forwardedRef) => {
33
+ return (
34
+ // ref types don't match but it's internal, so ts-ignore is ok here
35
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
36
+ // @ts-ignore
37
+ React.createElement(index_js_1.LabeledInput, {
38
+ as: 'textarea',
39
+ rows: 3,
40
+ ref: forwardedRef,
41
+ ...props,
42
+ })
76
43
  );
77
44
  });
78
45
  exports.default = exports.LabeledTextarea;
@@ -17,5 +17,5 @@ type MenuProps = {
17
17
  /**
18
18
  * Basic menu component. Can be used for select or dropdown components.
19
19
  */
20
- export declare const Menu: PolymorphicForwardRefComponent<"ul", MenuProps>;
20
+ export declare const Menu: PolymorphicForwardRefComponent<"div", MenuProps>;
21
21
  export default Menu;
@@ -66,7 +66,7 @@ exports.Menu = React.forwardRef((props, ref) => {
66
66
  }
67
67
  };
68
68
  return React.createElement(index_js_1.Box, {
69
- as: 'ul',
69
+ as: 'div',
70
70
  className: (0, classnames_1.default)('iui-menu', className),
71
71
  role: 'menu',
72
72
  onKeyDown: onKeyDown,
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  /**
2
3
  * Divider between menu items. Should be used inside `Menu`.
3
4
  * @example
@@ -13,5 +14,5 @@
13
14
  * ]}
14
15
  * </Menu>
15
16
  */
16
- export declare const MenuDivider: import("../utils/props.js").PolymorphicForwardRefComponent<"li", {}>;
17
+ export declare const MenuDivider: import("../utils/props.js").PolymorphicForwardRefComponent<NonNullable<keyof JSX.IntrinsicElements>, {}>;
17
18
  export default MenuDivider;
@@ -21,7 +21,7 @@ const index_js_1 = require('../utils/index.js');
21
21
  * ]}
22
22
  * </Menu>
23
23
  */
24
- exports.MenuDivider = index_js_1.polymorphic.li('iui-menu-divider', {
24
+ exports.MenuDivider = (0, index_js_1.polymorphic)('iui-menu-divider', {
25
25
  role: 'separator',
26
26
  });
27
27
  exports.default = exports.MenuDivider;
@@ -64,5 +64,5 @@ export type MenuItemProps = {
64
64
  /**
65
65
  * Basic menu item component. Should be used inside `Menu` component for each item.
66
66
  */
67
- export declare const MenuItem: PolymorphicForwardRefComponent<"li", MenuItemProps>;
67
+ export declare const MenuItem: PolymorphicForwardRefComponent<"div", MenuItemProps>;
68
68
  export default MenuItem;
@@ -74,6 +74,7 @@ exports.MenuItem = React.forwardRef((props, ref) => {
74
74
  const listItem = React.createElement(
75
75
  ListItem_js_1.ListItem,
76
76
  {
77
+ as: 'div',
77
78
  actionable: true,
78
79
  size: size,
79
80
  active: isSelected,
@@ -26,5 +26,5 @@ type MenuItemSkeletonProps = {
26
26
  /**
27
27
  * Menu item that uses skeletons to indicate loading state.
28
28
  */
29
- export declare const MenuItemSkeleton: PolymorphicForwardRefComponent<"li", MenuItemSkeletonProps>;
29
+ export declare const MenuItemSkeleton: PolymorphicForwardRefComponent<"div", MenuItemSkeletonProps>;
30
30
  export default MenuItemSkeleton;
@@ -25,7 +25,6 @@ exports.MenuItemSkeleton = React.forwardRef((props, forwardedRef) => {
25
25
  return React.createElement(
26
26
  index_js_1.Box,
27
27
  {
28
- as: 'li',
29
28
  className: (0, classnames_1.default)('iui-menu-item-skeleton', className),
30
29
  'data-iui-size': hasSublabel && 'large',
31
30
  style: {
@@ -24,6 +24,10 @@ type ProgressLinearProps = {
24
24
  * Status of progress.
25
25
  */
26
26
  status?: 'positive' | 'negative';
27
+ /**
28
+ * Pass props to ProgressLinear label group.
29
+ */
30
+ labelGroupProps?: React.ComponentProps<'div'>;
27
31
  };
28
32
  /**
29
33
  * Shows progress on a linear bar
@@ -32,6 +32,7 @@ exports.ProgressLinear = React.forwardRef((props, forwardedRef) => {
32
32
  isAnimated = false,
33
33
  status,
34
34
  className,
35
+ labelGroupProps,
35
36
  ...rest
36
37
  } = props;
37
38
  const boundedValue = (0, index_js_1.getBoundedValue)(value ?? 100, 0, 100);
@@ -54,7 +55,14 @@ exports.ProgressLinear = React.forwardRef((props, forwardedRef) => {
54
55
  labels.length > 0 &&
55
56
  React.createElement(
56
57
  index_js_1.Box,
57
- { className: 'iui-progress-indicator-linear-label' },
58
+ {
59
+ as: 'div',
60
+ ...labelGroupProps,
61
+ className: (0, classnames_1.default)(
62
+ 'iui-progress-indicator-linear-label',
63
+ labelGroupProps?.className,
64
+ ),
65
+ },
58
66
  labels.map((label, index) =>
59
67
  React.createElement('span', { key: index }, label),
60
68
  ),
@@ -65,7 +65,7 @@ const SearchBoxComponent = React.forwardRef((props, ref) => {
65
65
  { 'iui-expandable-searchbox': expandable },
66
66
  className,
67
67
  ),
68
- 'data-iui-size': size,
68
+ size: size,
69
69
  isDisabled: isDisabled,
70
70
  'data-iui-expanded': isExpanded,
71
71
  ...rest,
@@ -93,6 +93,10 @@ export type SelectProps<T> = {
93
93
  * Modify size of select.
94
94
  */
95
95
  size?: 'small' | 'large';
96
+ /**
97
+ * Status of select.
98
+ */
99
+ status?: 'positive' | 'warning' | 'negative';
96
100
  /**
97
101
  * Custom renderer for an item in the dropdown list. `MenuItem` item props are going to be populated if not provided.
98
102
  */
@@ -90,6 +90,7 @@ const Select = (props) => {
90
90
  popoverProps,
91
91
  multiple = false,
92
92
  triggerProps,
93
+ status,
93
94
  ...rest
94
95
  } = props;
95
96
  const [isOpenState, setIsOpen] = React.useState(false);
@@ -97,7 +98,6 @@ const Select = (props) => {
97
98
  const [minWidth, setMinWidth] = React.useState(0);
98
99
  const [liveRegionSelection, setLiveRegionSelection] = React.useState('');
99
100
  const selectRef = React.useRef(null);
100
- const toggleButtonRef = React.useRef(null);
101
101
  const onShowHandler = React.useCallback(
102
102
  (instance) => {
103
103
  setIsOpen(true);
@@ -148,6 +148,11 @@ const Select = (props) => {
148
148
  key: `${label}-${index}`,
149
149
  isSelected,
150
150
  startIcon: startIcon,
151
+ endIcon: isSelected
152
+ ? React.createElement(index_js_2.SvgCheckmark, {
153
+ 'aria-hidden': true,
154
+ })
155
+ : null,
151
156
  onClick: () => {
152
157
  if (option.disabled) {
153
158
  return;
@@ -214,8 +219,8 @@ const Select = (props) => {
214
219
  role: 'listbox',
215
220
  className: (0, classnames_1.default)('iui-scroll', menuClassName),
216
221
  style: {
217
- minWidth,
218
- maxWidth: `min(${minWidth * 2}px, 90vw)`,
222
+ minInlineSize: minWidth,
223
+ maxInlineSize: `min(${minWidth * 2}px, 90vw)`,
219
224
  ...menuStyle,
220
225
  },
221
226
  id: `${uid}-menu`,
@@ -229,10 +234,8 @@ const Select = (props) => {
229
234
  onHide: onHideHandler,
230
235
  ...popoverProps,
231
236
  visible: isOpen,
232
- onClickOutside: (_, { target }) => {
233
- if (!toggleButtonRef.current?.contains(target)) {
234
- setIsOpen(false);
235
- }
237
+ onClickOutside: () => {
238
+ setIsOpen(false);
236
239
  },
237
240
  },
238
241
  React.createElement(
@@ -242,6 +245,7 @@ const Select = (props) => {
242
245
  role: 'combobox',
243
246
  ref: selectRef,
244
247
  'data-iui-size': size,
248
+ 'data-iui-status': status,
245
249
  onClick: () => !disabled && setIsOpen((o) => !o),
246
250
  onKeyDown: (e) => !disabled && onKeyDown(e),
247
251
  'aria-disabled': disabled,
@@ -279,17 +283,14 @@ const Select = (props) => {
279
283
  ),
280
284
  ),
281
285
  React.createElement(
282
- index_js_2.Box,
286
+ index_js_2.Icon,
283
287
  {
284
288
  as: 'span',
285
289
  'aria-hidden': true,
286
- ref: toggleButtonRef,
287
290
  className: (0, classnames_1.default)('iui-end-icon', {
288
- 'iui-actionable': !disabled,
289
291
  'iui-disabled': disabled,
290
292
  'iui-open': isOpen,
291
293
  }),
292
- onClick: () => !disabled && setIsOpen((o) => !o),
293
294
  },
294
295
  React.createElement(index_js_2.SvgCaretDownSmall, null),
295
296
  ),
@@ -48,6 +48,22 @@ type SideNavigationProps = {
48
48
  * @default false
49
49
  */
50
50
  isSubmenuOpen?: boolean;
51
+ /**
52
+ * Passes props for SideNav wrapper.
53
+ */
54
+ wrapperProps?: React.ComponentProps<'div'>;
55
+ /**
56
+ * Passes props for SideNav content.
57
+ */
58
+ contentProps?: React.ComponentProps<'div'>;
59
+ /**
60
+ * Passes props for SideNav top.
61
+ */
62
+ topProps?: React.ComponentProps<'div'>;
63
+ /**
64
+ * Passes props for SideNav bottom.
65
+ */
66
+ bottomProps?: React.ComponentProps<'div'>;
51
67
  };
52
68
  /**
53
69
  * Left side navigation menu component.