@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
@@ -71,7 +71,6 @@ const ComboBox = (props) => {
71
71
  // Refs get set in subcomponents
72
72
  const inputRef = React.useRef(null);
73
73
  const menuRef = React.useRef(null);
74
- const toggleButtonRef = React.useRef(null);
75
74
  const onChangeProp = (0, index_js_3.useLatestRef)(onChange);
76
75
  const optionsRef = (0, index_js_3.useLatestRef)(options);
77
76
  // Record to store all extra information (e.g. original indexes), where the key is the id of the option
@@ -368,7 +367,7 @@ const ComboBox = (props) => {
368
367
  );
369
368
  return React.createElement(
370
369
  helpers_js_1.ComboBoxRefsContext.Provider,
371
- { value: { inputRef, menuRef, toggleButtonRef, optionsExtraInfoRef } },
370
+ { value: { inputRef, menuRef, optionsExtraInfoRef } },
372
371
  React.createElement(
373
372
  helpers_js_1.ComboBoxActionContext.Provider,
374
373
  { value: dispatch },
@@ -389,12 +388,13 @@ const ComboBox = (props) => {
389
388
  },
390
389
  React.createElement(
391
390
  ComboBoxInputContainer_js_1.ComboBoxInputContainer,
392
- { disabled: inputProps?.disabled, ...rest },
391
+ { ...rest },
393
392
  React.createElement(
394
393
  React.Fragment,
395
394
  null,
396
395
  React.createElement(ComboBoxInput_js_1.ComboBoxInput, {
397
396
  value: inputValue,
397
+ disabled: inputProps?.disabled,
398
398
  ...inputProps,
399
399
  onChange: handleOnInput,
400
400
  selectTags: isMultipleEnabled(selected, multiple)
@@ -17,7 +17,7 @@ exports.ComboBoxDropdown = React.forwardRef((props, forwardedRef) => {
17
17
  const dispatch = (0, index_js_1.useSafeContext)(
18
18
  helpers_js_1.ComboBoxActionContext,
19
19
  );
20
- const { inputRef, toggleButtonRef } = (0, index_js_1.useSafeContext)(
20
+ const { inputRef } = (0, index_js_1.useSafeContext)(
21
21
  helpers_js_1.ComboBoxRefsContext,
22
22
  );
23
23
  // sync internal isOpen state with user's visible prop
@@ -29,14 +29,9 @@ exports.ComboBoxDropdown = React.forwardRef((props, forwardedRef) => {
29
29
  return React.createElement(index_js_1.Popover, {
30
30
  placement: 'bottom-start',
31
31
  visible: isOpen,
32
- onClickOutside: React.useCallback(
33
- (_, { target }) => {
34
- if (!toggleButtonRef.current?.contains(target)) {
35
- dispatch({ type: 'close' });
36
- }
37
- },
38
- [dispatch, toggleButtonRef],
39
- ),
32
+ onClickOutside: React.useCallback(() => {
33
+ dispatch({ type: 'close' });
34
+ }, [dispatch]),
40
35
  animation: 'shift-away',
41
36
  duration: 200,
42
37
  reference: inputRef,
@@ -9,40 +9,21 @@ const tslib_1 = require('tslib');
9
9
  const classnames_1 = tslib_1.__importDefault(require('classnames'));
10
10
  const React = tslib_1.__importStar(require('react'));
11
11
  const index_js_1 = require('../utils/index.js');
12
- const helpers_js_1 = require('./helpers.js');
13
12
  exports.ComboBoxEndIcon = React.forwardRef((props, forwardedRef) => {
14
- const {
15
- className,
16
- children,
17
- onClick: onClickProp,
18
- disabled,
19
- isOpen,
20
- ...rest
21
- } = props;
22
- const dispatch = (0, index_js_1.useSafeContext)(
23
- helpers_js_1.ComboBoxActionContext,
24
- );
25
- const { toggleButtonRef } = (0, index_js_1.useSafeContext)(
26
- helpers_js_1.ComboBoxRefsContext,
27
- );
28
- const refs = (0, index_js_1.useMergedRefs)(toggleButtonRef, forwardedRef);
13
+ const { className, children, disabled, isOpen, ...rest } = props;
29
14
  return React.createElement(
30
- index_js_1.Box,
15
+ index_js_1.Icon,
31
16
  {
32
17
  as: 'span',
33
- ref: refs,
18
+ ref: forwardedRef,
34
19
  className: (0, classnames_1.default)(
35
20
  'iui-end-icon',
36
21
  {
37
- 'iui-actionable': !disabled,
38
22
  'iui-disabled': disabled,
39
23
  'iui-open': isOpen,
40
24
  },
41
25
  className,
42
26
  ),
43
- onClick: (0, index_js_1.mergeEventHandlers)(onClickProp, () => {
44
- dispatch({ type: isOpen ? 'close' : 'open' });
45
- }),
46
27
  ...rest,
47
28
  },
48
29
  children ??
@@ -195,7 +195,7 @@ exports.ComboBoxInput = React.forwardRef((props, forwardedRef) => {
195
195
  spellCheck: false,
196
196
  autoCapitalize: 'none',
197
197
  autoCorrect: 'off',
198
- style: multiple ? { paddingLeft: tagContainerWidth + 18 } : {},
198
+ style: multiple ? { paddingInlineStart: tagContainerWidth + 18 } : {},
199
199
  'aria-describedby': multiple ? `${id}-selected-live` : undefined,
200
200
  ...rest,
201
201
  }),
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { Menu } from '../Menu/index.js';
3
3
  import type { PolymorphicForwardRefComponent } from '../utils/index.js';
4
- type ComboBoxMenuProps = Omit<React.ComponentPropsWithoutRef<typeof Menu>, 'onClick'> & React.ComponentPropsWithoutRef<'ul'>;
5
- export declare const ComboBoxMenu: PolymorphicForwardRefComponent<"ul", ComboBoxMenuProps>;
4
+ type ComboBoxMenuProps = Omit<React.ComponentPropsWithoutRef<typeof Menu>, 'onClick'> & React.ComponentPropsWithoutRef<'div'>;
5
+ export declare const ComboBoxMenu: PolymorphicForwardRefComponent<"div", ComboBoxMenuProps>;
6
6
  export {};
@@ -48,11 +48,11 @@ const VirtualizedComboBoxMenu = React.forwardRef(
48
48
  scrollToIndex: focusedVisibleIndex,
49
49
  });
50
50
  const surfaceStyles = {
51
- minWidth,
51
+ minInlineSize: minWidth,
52
52
  // set as constant because we don't want it shifting when items are unmounted
53
- maxWidth: minWidth,
53
+ maxInlineSize: minWidth,
54
54
  // max-height must be on the outermost element for virtual scroll
55
- maxHeight: 'calc((var(--iui-component-height) - 1px) * 8.5)',
55
+ maxBlockSize: 'calc((var(--iui-component-height) - 1px) * 8.5)',
56
56
  overflowY: isOverflowOverlaySupported() ? 'overlay' : 'auto',
57
57
  ...style,
58
58
  };
@@ -94,8 +94,8 @@ exports.ComboBoxMenu = React.forwardRef((props, forwardedRef) => {
94
94
  const refs = (0, index_js_3.useMergedRefs)(menuRef, forwardedRef);
95
95
  const styles = React.useMemo(
96
96
  () => ({
97
- minWidth,
98
- maxWidth: `min(${minWidth * 2}px, 90vw)`,
97
+ minInlineSize: minWidth,
98
+ maxInlineSize: `min(${minWidth * 2}px, 90vw)`,
99
99
  }),
100
100
  [minWidth],
101
101
  );
@@ -4,5 +4,5 @@ import type { PolymorphicForwardRefComponent } from '../utils/index.js';
4
4
  type ComboBoxMenuItemProps = MenuItemProps & {
5
5
  index: number;
6
6
  };
7
- export declare const ComboBoxMenuItem: React.MemoExoticComponent<PolymorphicForwardRefComponent<"li", ComboBoxMenuItemProps>>;
7
+ export declare const ComboBoxMenuItem: React.MemoExoticComponent<PolymorphicForwardRefComponent<"div", ComboBoxMenuItemProps>>;
8
8
  export {};
@@ -37,6 +37,7 @@ exports.ComboBoxMenuItem = React.memo(
37
37
  return React.createElement(
38
38
  ListItem_js_1.ListItem,
39
39
  {
40
+ as: 'div',
40
41
  actionable: true,
41
42
  size: size,
42
43
  active: isSelected,
@@ -68,12 +69,13 @@ exports.ComboBoxMenuItem = React.memo(
68
69
  sublabel,
69
70
  ),
70
71
  ),
71
- endIcon &&
72
- React.createElement(
73
- ListItem_js_1.ListItem.Icon,
74
- { as: 'span', 'aria-hidden': true },
75
- endIcon,
76
- ),
72
+ endIcon ||
73
+ (isSelected &&
74
+ React.createElement(
75
+ ListItem_js_1.ListItem.Icon,
76
+ { as: 'span', 'aria-hidden': true },
77
+ endIcon ?? React.createElement(index_js_1.SvgCheckmark, null),
78
+ )),
77
79
  );
78
80
  }),
79
81
  );
@@ -25,8 +25,7 @@ export declare const comboBoxReducer: (state: {
25
25
  };
26
26
  export declare const ComboBoxRefsContext: React.Context<{
27
27
  inputRef: React.RefObject<HTMLInputElement>;
28
- menuRef: React.RefObject<HTMLUListElement>;
29
- toggleButtonRef: React.RefObject<HTMLSpanElement>;
28
+ menuRef: React.RefObject<HTMLElement>;
30
29
  optionsExtraInfoRef: React.MutableRefObject<Record<string, {
31
30
  __originalIndex: number;
32
31
  }>>;
@@ -1,14 +1,14 @@
1
+ import * as React from 'react';
1
2
  import type { PolymorphicForwardRefComponent } from '../utils/index.js';
2
3
  import type { TimePickerProps } from '../TimePicker/TimePicker.js';
4
+ export type DatePickerLocalizedNames = {
5
+ [key in 'months' | 'shortDays' | 'days']: string[];
6
+ };
3
7
  /**
4
8
  * Generate localized months and days strings using `Intl.DateTimeFormat` for passed locale to use in DatePicker component.
5
9
  * If locale is not passed, browser locale will be used.
6
10
  */
7
- export declare const generateLocalizedStrings: (locale?: string) => {
8
- months: string[];
9
- shortDays: string[];
10
- days: string[];
11
- };
11
+ export declare const generateLocalizedStrings: (locale?: string) => DatePickerLocalizedNames;
12
12
  export type DateRangePickerProps = {
13
13
  /**
14
14
  * Enable date range support.
@@ -42,9 +42,7 @@ type DatePickerProps = {
42
42
  * Pass localized week days (start from sunday) and months.
43
43
  * Use helper function `generateLocalizedStrings` to generate strings using `Intl.DateTimeFormat`.
44
44
  */
45
- localizedNames?: {
46
- [key in 'months' | 'shortDays' | 'days']: string[];
47
- };
45
+ localizedNames?: DatePickerLocalizedNames;
48
46
  /**
49
47
  * Set focus on selected day or today.
50
48
  * @default false
@@ -60,6 +58,30 @@ type DatePickerProps = {
60
58
  * @default false
61
59
  */
62
60
  showYearSelection?: boolean;
61
+ /**
62
+ * Allows props to be passed for calendar month year, referring to the div that wraps around the month/year and the next/previous buttons.
63
+ */
64
+ monthYearProps?: React.ComponentProps<'div'>;
65
+ /**
66
+ * Allows props to be passed for only month, referring to span that wraps around the month title.
67
+ */
68
+ monthProps?: React.ComponentProps<'span'>;
69
+ /**
70
+ * Allows props to be passed for week days, referring to div that wraps around the week day title.
71
+ */
72
+ weekDayProps?: React.ComponentProps<'div'>;
73
+ /**
74
+ * Allows props to be passed for individual day , referring to div element the wraps around single day number.
75
+ */
76
+ dayProps?: React.ComponentProps<'div'>;
77
+ /**
78
+ * Allows props to be passed for calendar, referring to div that is used for listbox for wraping days and weeks.
79
+ */
80
+ calendarProps?: React.ComponentProps<'div'>;
81
+ /**
82
+ * Allows props to be passed for weeks, referring to div that wraps around weeks.
83
+ */
84
+ weekProps?: React.ComponentProps<'div'>;
63
85
  /**
64
86
  * Will disable dates for which this function returns true.
65
87
  * Disabled dates cannot be selected.
@@ -139,6 +139,12 @@ exports.DatePicker = React.forwardRef((props, forwardedRef) => {
139
139
  enableRangeSelect = false,
140
140
  startDate,
141
141
  endDate,
142
+ monthYearProps,
143
+ calendarProps,
144
+ monthProps,
145
+ weekDayProps,
146
+ dayProps,
147
+ weekProps,
142
148
  isDateDisabled,
143
149
  ...rest
144
150
  } = props;
@@ -407,6 +413,7 @@ exports.DatePicker = React.forwardRef((props, forwardedRef) => {
407
413
  }
408
414
  return dayClass;
409
415
  };
416
+ const dateTableId = (0, index_js_1.useId)();
410
417
  return React.createElement(
411
418
  index_js_1.Box,
412
419
  {
@@ -419,7 +426,14 @@ exports.DatePicker = React.forwardRef((props, forwardedRef) => {
419
426
  null,
420
427
  React.createElement(
421
428
  index_js_1.Box,
422
- { className: 'iui-calendar-month-year' },
429
+ {
430
+ as: 'div',
431
+ ...monthYearProps,
432
+ className: (0, classnames_1.default)(
433
+ 'iui-calendar-month-year',
434
+ monthYearProps?.className,
435
+ ),
436
+ },
423
437
  showYearSelection &&
424
438
  React.createElement(
425
439
  index_js_2.IconButton,
@@ -448,8 +462,13 @@ exports.DatePicker = React.forwardRef((props, forwardedRef) => {
448
462
  index_js_1.Box,
449
463
  {
450
464
  as: 'span',
451
- className: 'iui-calendar-month',
465
+ id: dateTableId,
452
466
  title: monthNames[displayedMonthIndex],
467
+ ...monthProps,
468
+ className: (0, classnames_1.default)(
469
+ 'iui-calendar-month',
470
+ monthProps?.className,
471
+ ),
453
472
  },
454
473
  monthNames[displayedMonthIndex],
455
474
  ),
@@ -480,20 +499,37 @@ exports.DatePicker = React.forwardRef((props, forwardedRef) => {
480
499
  ),
481
500
  React.createElement(
482
501
  index_js_1.Box,
483
- { className: 'iui-calendar-weekdays' },
502
+ {
503
+ as: 'div',
504
+ ...weekDayProps,
505
+ className: (0, classnames_1.default)(
506
+ 'iui-calendar-weekdays',
507
+ weekDayProps?.className,
508
+ ),
509
+ },
484
510
  shortDays.map((day, index) =>
485
511
  React.createElement('div', { key: day, title: longDays[index] }, day),
486
512
  ),
487
513
  ),
488
514
  React.createElement(
489
515
  'div',
490
- { onKeyDown: handleCalendarKeyDown, role: 'listbox' },
516
+ {
517
+ onKeyDown: handleCalendarKeyDown,
518
+ role: 'listbox',
519
+ 'aria-labelledby': dateTableId,
520
+ ...calendarProps,
521
+ },
491
522
  weeks.map((weekDays, weekIndex) => {
492
523
  return React.createElement(
493
524
  index_js_1.Box,
494
525
  {
526
+ as: 'div',
495
527
  key: `week-${displayedMonthIndex}-${weekIndex}`,
496
- className: 'iui-calendar-week',
528
+ ...weekProps,
529
+ className: (0, classnames_1.default)(
530
+ 'iui-calendar-week',
531
+ weekProps?.className,
532
+ ),
497
533
  },
498
534
  weekDays.map((weekDay, dayIndex) => {
499
535
  const dateValue = weekDay.getDate();
@@ -501,8 +537,8 @@ exports.DatePicker = React.forwardRef((props, forwardedRef) => {
501
537
  return React.createElement(
502
538
  index_js_1.Box,
503
539
  {
540
+ as: 'div',
504
541
  key: `day-${displayedMonthIndex}-${dayIndex}`,
505
- className: getDayClass(weekDay),
506
542
  onClick: () => !isDisabled && onDayClick(weekDay),
507
543
  role: 'option',
508
544
  tabIndex: isSameDay(weekDay, focusedDay) ? 0 : -1,
@@ -511,6 +547,11 @@ exports.DatePicker = React.forwardRef((props, forwardedRef) => {
511
547
  isSameDay(weekDay, focusedDay) &&
512
548
  needFocus.current &&
513
549
  element?.focus(),
550
+ ...dayProps,
551
+ className: (0, classnames_1.default)(
552
+ getDayClass(weekDay),
553
+ dayProps?.className,
554
+ ),
514
555
  },
515
556
  dateValue,
516
557
  );
@@ -7,7 +7,6 @@ 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 ReactDOM = tslib_1.__importStar(require('react-dom'));
11
10
  const classnames_1 = tslib_1.__importDefault(require('classnames'));
12
11
  const DialogTitleBar_js_1 = require('./DialogTitleBar.js');
13
12
  const DialogContent_js_1 = require('./DialogContent.js');
@@ -35,21 +34,6 @@ const DialogComponent = React.forwardRef((props, ref) => {
35
34
  ...rest
36
35
  } = props;
37
36
  const dialogRootRef = React.useRef(null);
38
- const context = (0, index_js_1.useGlobals)();
39
- const isClient = (0, index_js_1.useIsClient)();
40
- const portalTo =
41
- typeof portal !== 'boolean'
42
- ? portal.to
43
- : portal
44
- ? context?.portalContainerRef?.current ??
45
- (0, index_js_1.getDocument)()?.body
46
- : null;
47
- const dialog = React.createElement(index_js_1.Box, {
48
- className: (0, classnames_1.default)('iui-dialog-wrapper', className),
49
- 'data-iui-relative': relativeTo === 'container',
50
- ref: (0, index_js_1.useMergedRefs)(ref, dialogRootRef),
51
- ...rest,
52
- });
53
37
  return React.createElement(
54
38
  DialogContext_js_1.DialogContext.Provider,
55
39
  {
@@ -69,7 +53,16 @@ const DialogComponent = React.forwardRef((props, ref) => {
69
53
  placement,
70
54
  },
71
55
  },
72
- portalTo && isClient ? ReactDOM.createPortal(dialog, portalTo) : dialog,
56
+ React.createElement(
57
+ index_js_1.Portal,
58
+ { portal: portal },
59
+ React.createElement(index_js_1.Box, {
60
+ className: (0, classnames_1.default)('iui-dialog-wrapper', className),
61
+ 'data-iui-relative': relativeTo === 'container',
62
+ ref: (0, index_js_1.useMergedRefs)(ref, dialogRootRef),
63
+ ...rest,
64
+ }),
65
+ ),
73
66
  );
74
67
  });
75
68
  /**
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import type { PortalProps } from '../utils/index.js';
2
3
  export type DialogContextProps = {
3
4
  /**
4
5
  * Flag whether dialog should be shown.
@@ -67,11 +68,9 @@ export type DialogContextProps = {
67
68
  *
68
69
  * Can be set to an object with a `to` property to portal into a specific element.
69
70
  *
70
- * @default false
71
+ * Defaults to false if using `Dialog` and true if using `Modal`.
71
72
  */
72
- portal?: boolean | {
73
- to: HTMLElement;
74
- };
73
+ portal?: PortalProps['portal'];
75
74
  /**
76
75
  * Dialog root ref. For internal use.
77
76
  */
@@ -122,10 +122,10 @@ exports.DialogMain = React.forwardRef((props, ref) => {
122
122
  );
123
123
  setStyle((oldStyle) => ({
124
124
  ...oldStyle,
125
- width: rect?.width,
126
- height: rect?.height,
127
- left: dialogRef.current?.offsetLeft,
128
- top: dialogRef.current?.offsetTop,
125
+ inlineSize: rect?.width,
126
+ blockSize: rect?.height,
127
+ insetInlineStart: dialogRef.current?.offsetLeft,
128
+ insetBlockStart: dialogRef.current?.offsetTop,
129
129
  transform: `translate(${translateX}px,${translateY}px)`,
130
130
  }));
131
131
  }, [isDraggable, isOpen]);
@@ -167,7 +167,7 @@ exports.DialogMain = React.forwardRef((props, ref) => {
167
167
  onResizeStart: () => {
168
168
  if (!hasBeenResized.current) {
169
169
  hasBeenResized.current = true;
170
- setResizeStyle({ maxWidth: '100%' });
170
+ setResizeStyle({ maxInlineSize: '100%' });
171
171
  }
172
172
  },
173
173
  onResizeEnd: setResizeStyle,
@@ -36,9 +36,11 @@ type ExpandableBlockOwnProps = {
36
36
  */
37
37
  disabled?: boolean;
38
38
  };
39
- type ExpandableBlockHeaderOwnProps = {
39
+ type ExpandableBlockTriggerOwnProps = {
40
40
  label?: React.ReactNode;
41
+ caption?: React.ReactNode;
41
42
  expandIcon?: React.ReactNode;
43
+ endIcon?: React.ReactNode;
42
44
  };
43
45
  type ExpandableBlockContentOwnProps = {
44
46
  innerProps?: React.ComponentPropsWithoutRef<'div'>;
@@ -46,29 +48,32 @@ type ExpandableBlockContentOwnProps = {
46
48
  /**
47
49
  * Expandable block with customizable Title, Caption, Content and EndIcon subcomponents.
48
50
  * @example
49
- * <ExpandableBlock>
50
- * <ExpandableBlock.Header>
51
+ * <ExpandableBlock.Wrapper>
52
+ * <ExpandableBlock.Trigger>
51
53
  * <ExpandableBlock.ExpandIcon/>
52
54
  * <ExpandableBlock.LabelArea>
53
55
  * <ExpandableBlock.Title/>
54
56
  * <ExpandableBlock.Caption/>
55
57
  * </ExpandableBlock.LabelArea>
56
58
  * <ExpandableBlock.EndIcon/>
57
- * </ExpandableBlock.Header>
59
+ * </ExpandableBlock.Trigger>
58
60
  * <ExpandableBlock.Content/>
59
- * </ExpandableBlock>
61
+ * </ExpandableBlock.Wrapper>
60
62
  */
61
- export declare const ExpandableBlock: PolymorphicForwardRefComponent<"div", ExpandableBlockOwnProps> & {
63
+ export declare const ExpandableBlock: PolymorphicForwardRefComponent<"div", ExpandableBlockOwnProps & {
64
+ title?: React.ReactNode;
65
+ } & Pick<ExpandableBlockTriggerOwnProps, "caption" | "endIcon">> & {
66
+ Wrapper: PolymorphicForwardRefComponent<"div", ExpandableBlockOwnProps>;
62
67
  /**
63
68
  * `Header` container that contains `ExpandIcon`, `LabelArea` and `EndIcon` subcomponents
64
69
  * @example
65
- * <ExpandableBlock.Header>
70
+ * <ExpandableBlock.Trigger>
66
71
  * <ExpandableBlock.ExpandIcon/>
67
72
  * <ExpandableBlock.LabelArea/>
68
73
  * <ExpandableBlock.EndIcon/>
69
- * </ExpandableBlock.Header>
74
+ * </ExpandableBlock.Trigger>
70
75
  */
71
- Header: PolymorphicForwardRefComponent<"button", ExpandableBlockHeaderOwnProps>;
76
+ Trigger: PolymorphicForwardRefComponent<"button", ExpandableBlockTriggerOwnProps>;
72
77
  /**
73
78
  * The expanding icon on the left of header
74
79
  */
@@ -94,24 +99,25 @@ export declare const ExpandableBlock: PolymorphicForwardRefComponent<"div", Expa
94
99
  * Svg icon displayed at the end of the main text.
95
100
  * Will override status icon if specified. Used inside `Header` subcomponent.
96
101
  * @example
97
- * <ExpandableBlock.Header>
102
+ * <ExpandableBlock.Trigger>
98
103
  * <ExpandableBlock.EndIcon> <SvgIcon/> </ExpandableBlock.EndIcon>
99
- * <ExpandableBlock.Header/>
104
+ * <ExpandableBlock.Trigger/>
100
105
  */
101
106
  EndIcon: PolymorphicForwardRefComponent<"span", Omit<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
102
107
  ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
103
- }, "fill" | "as" | "key" | "size" | keyof React.HTMLAttributes<HTMLSpanElement>> & {
108
+ }, "fill" | "as" | "key" | "size" | keyof React.HTMLAttributes<HTMLSpanElement> | "padded"> & {
104
109
  size?: "small" | "large" | "auto" | "medium" | import("../utils/types.js").AnyString | undefined;
105
110
  fill?: "default" | "informational" | "negative" | "positive" | "warning" | import("../utils/types.js").AnyString | undefined;
111
+ padded?: boolean | undefined;
106
112
  } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
107
113
  as?: "span" | undefined;
108
114
  }, "ref">>;
109
115
  /**
110
116
  * Content shown in the block's body when fully expanded.
111
117
  * @example
112
- * <ExpandableBlock>
118
+ * <ExpandableBlock.Wrapper>
113
119
  * <ExpandableBlock.Content> Content </ExpandableBlock.Content>
114
- * </ExpandableBlock>
120
+ * </ExpandableBlock.Wrapper>
115
121
  */
116
122
  Content: PolymorphicForwardRefComponent<"div", ExpandableBlockContentOwnProps>;
117
123
  };