@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
@@ -12,6 +12,21 @@ const index_js_1 = require('../utils/index.js');
12
12
  const ExpandableBlockContext = React.createContext(undefined);
13
13
  ExpandableBlockContext.displayName = 'ExpandableBlockContext';
14
14
  const ExpandableBlockComponent = React.forwardRef((props, forwardedRef) => {
15
+ const { children, title, caption, endIcon, ...rest } = props;
16
+ return React.createElement(
17
+ exports.ExpandableBlock.Wrapper,
18
+ { ...rest, ref: forwardedRef },
19
+ React.createElement(exports.ExpandableBlock.Trigger, {
20
+ label: title,
21
+ caption: caption,
22
+ endIcon: endIcon,
23
+ }),
24
+ React.createElement(exports.ExpandableBlock.Content, null, children),
25
+ );
26
+ });
27
+ ExpandableBlockComponent.displayName = 'ExpandableBlock';
28
+ // ----------------------------------------------------------------------------
29
+ const ExpandableBlockWrapper = React.forwardRef((props, forwardedRef) => {
15
30
  const {
16
31
  children,
17
32
  className,
@@ -55,23 +70,23 @@ const ExpandableBlockComponent = React.forwardRef((props, forwardedRef) => {
55
70
  ),
56
71
  );
57
72
  });
58
- ExpandableBlockComponent.displayName = 'ExpandableBlock';
59
- const ExpandableBlockHeader = React.forwardRef((props, forwardedRef) => {
73
+ ExpandableBlockWrapper.displayName = 'ExpandableBlock.Wrapper';
74
+ const ExpandableBlockTrigger = React.forwardRef((props, forwardedRef) => {
60
75
  const {
61
76
  className,
62
77
  children,
63
78
  label,
79
+ caption,
64
80
  onClick: onClickProp,
65
81
  expandIcon,
82
+ endIcon,
66
83
  ...rest
67
84
  } = props;
68
- const { isExpanded, setExpanded, disabled, onToggle } = (0,
85
+ const { isExpanded, setExpanded, disabled, onToggle, status } = (0,
69
86
  index_js_1.useSafeContext)(ExpandableBlockContext);
70
87
  return React.createElement(
71
- index_js_1.Box,
88
+ index_js_1.ButtonBase,
72
89
  {
73
- as: 'button',
74
- type: 'button',
75
90
  className: (0, classnames_1.default)('iui-expandable-header', className),
76
91
  'aria-expanded': isExpanded,
77
92
  'aria-disabled': disabled,
@@ -95,11 +110,16 @@ const ExpandableBlockHeader = React.forwardRef((props, forwardedRef) => {
95
110
  exports.ExpandableBlock.LabelArea,
96
111
  null,
97
112
  React.createElement(exports.ExpandableBlock.Title, null, label),
113
+ caption &&
114
+ React.createElement(exports.ExpandableBlock.Caption, null, caption),
98
115
  ),
116
+ endIcon || status
117
+ ? React.createElement(exports.ExpandableBlock.EndIcon, null, endIcon)
118
+ : null,
99
119
  ),
100
120
  );
101
121
  });
102
- ExpandableBlockHeader.displayName = 'ExpandableBlock.Header';
122
+ ExpandableBlockTrigger.displayName = 'ExpandableBlock.Trigger';
103
123
  // ----------------------------------------------------------------------------
104
124
  // ExpandableBlock.ExpandIcon component
105
125
  const ExpandableBlockExpandIcon = React.forwardRef((props, forwardedRef) => {
@@ -178,29 +198,30 @@ ExpandableBlockContent.displayName = 'ExpandableBlock.Content';
178
198
  /**
179
199
  * Expandable block with customizable Title, Caption, Content and EndIcon subcomponents.
180
200
  * @example
181
- * <ExpandableBlock>
182
- * <ExpandableBlock.Header>
201
+ * <ExpandableBlock.Wrapper>
202
+ * <ExpandableBlock.Trigger>
183
203
  * <ExpandableBlock.ExpandIcon/>
184
204
  * <ExpandableBlock.LabelArea>
185
205
  * <ExpandableBlock.Title/>
186
206
  * <ExpandableBlock.Caption/>
187
207
  * </ExpandableBlock.LabelArea>
188
208
  * <ExpandableBlock.EndIcon/>
189
- * </ExpandableBlock.Header>
209
+ * </ExpandableBlock.Trigger>
190
210
  * <ExpandableBlock.Content/>
191
- * </ExpandableBlock>
211
+ * </ExpandableBlock.Wrapper>
192
212
  */
193
213
  exports.ExpandableBlock = Object.assign(ExpandableBlockComponent, {
214
+ Wrapper: ExpandableBlockWrapper,
194
215
  /**
195
216
  * `Header` container that contains `ExpandIcon`, `LabelArea` and `EndIcon` subcomponents
196
217
  * @example
197
- * <ExpandableBlock.Header>
218
+ * <ExpandableBlock.Trigger>
198
219
  * <ExpandableBlock.ExpandIcon/>
199
220
  * <ExpandableBlock.LabelArea/>
200
221
  * <ExpandableBlock.EndIcon/>
201
- * </ExpandableBlock.Header>
222
+ * </ExpandableBlock.Trigger>
202
223
  */
203
- Header: ExpandableBlockHeader,
224
+ Trigger: ExpandableBlockTrigger,
204
225
  /**
205
226
  * The expanding icon on the left of header
206
227
  */
@@ -226,17 +247,17 @@ exports.ExpandableBlock = Object.assign(ExpandableBlockComponent, {
226
247
  * Svg icon displayed at the end of the main text.
227
248
  * Will override status icon if specified. Used inside `Header` subcomponent.
228
249
  * @example
229
- * <ExpandableBlock.Header>
250
+ * <ExpandableBlock.Trigger>
230
251
  * <ExpandableBlock.EndIcon> <SvgIcon/> </ExpandableBlock.EndIcon>
231
- * <ExpandableBlock.Header/>
252
+ * <ExpandableBlock.Trigger/>
232
253
  */
233
254
  EndIcon: ExpandableBlockEndIcon,
234
255
  /**
235
256
  * Content shown in the block's body when fully expanded.
236
257
  * @example
237
- * <ExpandableBlock>
258
+ * <ExpandableBlock.Wrapper>
238
259
  * <ExpandableBlock.Content> Content </ExpandableBlock.Content>
239
- * </ExpandableBlock>
260
+ * </ExpandableBlock.Wrapper>
240
261
  */
241
262
  Content: ExpandableBlockContent,
242
263
  });
@@ -15,6 +15,10 @@ type FileUploadProps = {
15
15
  * Either pass `FileUploadCard` (for default state) or a different component to wrap.
16
16
  */
17
17
  children: React.ReactNode;
18
+ /**
19
+ * Allows for custom prop to be passed for content.
20
+ */
21
+ contentProps?: React.ComponentProps<'div'>;
18
22
  };
19
23
  /**
20
24
  * File upload component to be wrapped around `FileUploadCard` or any arbitrary component.
@@ -17,7 +17,14 @@ const index_js_1 = require('../utils/index.js');
17
17
  * <FileUpload dragContent='Drop file here' onFileDropped={console.log}><Textarea /></FileUpload>
18
18
  */
19
19
  exports.FileUpload = React.forwardRef((props, ref) => {
20
- const { dragContent, children, onFileDropped, className, ...rest } = props;
20
+ const {
21
+ dragContent,
22
+ children,
23
+ onFileDropped,
24
+ className,
25
+ contentProps,
26
+ ...rest
27
+ } = props;
21
28
  const [isDragActive, setIsDragActive] = React.useState(false);
22
29
  const fileUploadRef = React.useRef(null);
23
30
  const refs = (0, index_js_1.useMergedRefs)(fileUploadRef, ref);
@@ -68,13 +75,27 @@ exports.FileUpload = React.forwardRef((props, ref) => {
68
75
  ? children
69
76
  : React.createElement(
70
77
  index_js_1.Box,
71
- { className: 'iui-content' },
78
+ {
79
+ as: 'div',
80
+ ...contentProps,
81
+ className: (0, classnames_1.default)(
82
+ 'iui-content',
83
+ contentProps?.className,
84
+ ),
85
+ },
72
86
  children,
73
87
  ),
74
88
  dragContent &&
75
89
  React.createElement(
76
90
  index_js_1.Box,
77
- { className: 'iui-content' },
91
+ {
92
+ as: 'div',
93
+ ...contentProps,
94
+ className: (0, classnames_1.default)(
95
+ 'iui-content',
96
+ contentProps?.className,
97
+ ),
98
+ },
78
99
  dragContent,
79
100
  ),
80
101
  );
@@ -10,31 +10,18 @@ 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
12
  exports.HeaderBasicButton = React.forwardRef((props, ref) => {
13
- const {
14
- onClick,
15
- className,
16
- children,
17
- style,
18
- startIcon,
19
- endIcon,
20
- styleType,
21
- size,
22
- ...rest
23
- } = props;
13
+ const { className, children, startIcon, endIcon, styleType, size, ...rest } =
14
+ props;
24
15
  styleType; // To omit and prevent eslint error.
25
16
  size; // To omit and prevent eslint error.
26
17
  return React.createElement(
27
- index_js_1.Box,
18
+ index_js_1.ButtonBase,
28
19
  {
29
- as: 'button',
30
20
  className: (0, classnames_1.default)(
31
21
  'iui-header-breadcrumb-button',
32
22
  className,
33
23
  ),
34
- onClick: onClick,
35
24
  ref: ref,
36
- type: 'button',
37
- style: style,
38
25
  ...rest,
39
26
  },
40
27
  startIcon,
@@ -26,7 +26,7 @@ exports.HeaderDropdownButton = React.forwardRef((props, ref) => {
26
26
  index_js_1.DropdownMenu,
27
27
  {
28
28
  menuItems: menuItems,
29
- style: { minWidth: menuWidth },
29
+ style: { minInlineSize: menuWidth },
30
30
  onShow: () => setIsMenuOpen(true),
31
31
  onHide: () => setIsMenuOpen(false),
32
32
  },
@@ -47,15 +47,14 @@ exports.HeaderSplitButton = React.forwardRef((props, forwardedRef) => {
47
47
  {
48
48
  placement: menuPlacement,
49
49
  menuItems: menuItems,
50
- style: { minWidth: menuWidth },
50
+ style: { minInlineSize: menuWidth },
51
51
  onShow: React.useCallback(() => setIsMenuOpen(true), []),
52
52
  onHide: React.useCallback(() => setIsMenuOpen(false), []),
53
53
  },
54
54
  React.createElement(
55
- index_js_2.Box,
55
+ index_js_2.ButtonBase,
56
56
  {
57
- as: 'button',
58
- type: 'button',
57
+ 'aria-label': 'More',
59
58
  className:
60
59
  'iui-header-breadcrumb-button iui-header-breadcrumb-button-split',
61
60
  disabled: disabled,
@@ -4,6 +4,10 @@ export type InputProps = {
4
4
  * Modify size of the input.
5
5
  */
6
6
  size?: 'small' | 'large';
7
+ /**
8
+ * Status of input.
9
+ */
10
+ status?: 'positive' | 'warning' | 'negative';
7
11
  /**
8
12
  * Modify the native `size` attribute of the `<input>` element.
9
13
  * The `width` or `inline-size` property must be unset in order to use this prop.
@@ -17,13 +17,14 @@ const index_js_1 = require('../utils/index.js');
17
17
  * <Input size='small' />
18
18
  */
19
19
  exports.Input = React.forwardRef((props, ref) => {
20
- const { size, htmlSize, className, ...rest } = props;
20
+ const { size, htmlSize, status, className, ...rest } = props;
21
21
  const inputRef = React.useRef(null);
22
22
  const refs = (0, index_js_1.useMergedRefs)(inputRef, ref);
23
23
  return React.createElement(index_js_1.Box, {
24
24
  as: 'input',
25
25
  className: (0, classnames_1.default)('iui-input', className),
26
26
  'data-iui-size': size,
27
+ 'data-iui-status': status,
27
28
  size: htmlSize,
28
29
  ref: refs,
29
30
  ...rest,
@@ -0,0 +1,25 @@
1
+ import type { PolymorphicForwardRefComponent } from '../utils/index.js';
2
+ type InputGridOwnProps = {
3
+ /**
4
+ * Set display style of label.
5
+ * Supported values:
6
+ * - 'default' - label appears above input.
7
+ * - 'inline' - appears in the same line as input.
8
+ * @default 'default'
9
+ */
10
+ labelPlacement?: 'default' | 'inline';
11
+ };
12
+ /**
13
+ * InputGrid component is used to display inputs (input, textarea, select)
14
+ * with label and/or status message
15
+ *
16
+ * @usage
17
+ *
18
+ * <InputGrid>
19
+ * <Label htmlFor='input-1'>This is label</Label>
20
+ * <Input id='input-1'/>
21
+ * <StatusMessage>This is message</StatusMessage>
22
+ * </InputGrid>
23
+ */
24
+ export declare const InputGrid: PolymorphicForwardRefComponent<"div", InputGridOwnProps>;
25
+ export default InputGrid;
@@ -0,0 +1,39 @@
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
+ exports.InputGrid = void 0;
4
+ const tslib_1 = require('tslib');
5
+ /*---------------------------------------------------------------------------------------------
6
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
7
+ * See LICENSE.md in the project root for license terms and full copyright notice.
8
+ *--------------------------------------------------------------------------------------------*/
9
+ const React = tslib_1.__importStar(require('react'));
10
+ const index_js_1 = require('../utils/index.js');
11
+ const classnames_1 = tslib_1.__importDefault(require('classnames'));
12
+ //-------------------------------------------------------------------------------
13
+ /**
14
+ * InputGrid component is used to display inputs (input, textarea, select)
15
+ * with label and/or status message
16
+ *
17
+ * @usage
18
+ *
19
+ * <InputGrid>
20
+ * <Label htmlFor='input-1'>This is label</Label>
21
+ * <Input id='input-1'/>
22
+ * <StatusMessage>This is message</StatusMessage>
23
+ * </InputGrid>
24
+ */
25
+ exports.InputGrid = React.forwardRef((props, ref) => {
26
+ const { children, className, labelPlacement = undefined, ...rest } = props;
27
+ return React.createElement(
28
+ index_js_1.Box,
29
+ {
30
+ className: (0, classnames_1.default)('iui-input-grid', className),
31
+ 'data-iui-label-placement': labelPlacement,
32
+ ref: ref,
33
+ ...rest,
34
+ },
35
+ children,
36
+ );
37
+ });
38
+ //-------------------------------------------------------------------------------
39
+ exports.default = exports.InputGrid;
@@ -0,0 +1,3 @@
1
+ export { InputGrid } from './InputGrid.js';
2
+ declare const _default: "./InputGrid";
3
+ export default _default;
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
+ exports.InputGrid = void 0;
4
+ /*---------------------------------------------------------------------------------------------
5
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
+ * See LICENSE.md in the project root for license terms and full copyright notice.
7
+ *--------------------------------------------------------------------------------------------*/
8
+ var InputGrid_js_1 = require('./InputGrid.js');
9
+ Object.defineProperty(exports, 'InputGrid', {
10
+ enumerable: true,
11
+ get: function () {
12
+ return InputGrid_js_1.InputGrid;
13
+ },
14
+ });
15
+ exports.default = './InputGrid';
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import type { PolymorphicForwardRefComponent } from '../utils/index.js';
3
+ import { StatusMessage } from '../StatusMessage/index.js';
3
4
  type InputGroupProps = {
4
5
  /**
5
6
  * Label of the group.
@@ -36,6 +37,18 @@ type InputGroupProps = {
36
37
  * Child inputs inside group.
37
38
  */
38
39
  children: React.ReactNode;
40
+ /**
41
+ * Passes properties for label.
42
+ */
43
+ labelProps?: React.ComponentProps<'label'>;
44
+ /**
45
+ * Passes properties for message.
46
+ */
47
+ messageProps?: Pick<React.ComponentProps<typeof StatusMessage>, 'iconProps' | 'contentProps'>;
48
+ /**
49
+ * Passes properties for inner input group element.
50
+ */
51
+ innerProps?: React.ComponentProps<'div'>;
39
52
  };
40
53
  /**
41
54
  * Group Checkbox/Radio components together
@@ -7,7 +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 classnames_1 = tslib_1.__importDefault(require('classnames'));
10
11
  const index_js_1 = require('../utils/index.js');
12
+ const index_js_2 = require('../InputGrid/index.js');
13
+ const index_js_3 = require('../Label/index.js');
14
+ const index_js_4 = require('../StatusMessage/index.js');
11
15
  /**
12
16
  * Group Checkbox/Radio components together
13
17
  * @example
@@ -25,6 +29,7 @@ const index_js_1 = require('../utils/index.js');
25
29
  */
26
30
  exports.InputGroup = React.forwardRef((props, forwardedRef) => {
27
31
  const {
32
+ className,
28
33
  children,
29
34
  disabled = false,
30
35
  displayStyle = 'default',
@@ -33,6 +38,9 @@ exports.InputGroup = React.forwardRef((props, forwardedRef) => {
33
38
  status,
34
39
  svgIcon,
35
40
  required = false,
41
+ labelProps,
42
+ messageProps,
43
+ innerProps,
36
44
  ...rest
37
45
  } = props;
38
46
  const icon = () => {
@@ -47,23 +55,41 @@ exports.InputGroup = React.forwardRef((props, forwardedRef) => {
47
55
  return undefined;
48
56
  };
49
57
  return React.createElement(
50
- index_js_1.InputContainer,
58
+ index_js_2.InputGrid,
51
59
  {
52
- label: label,
53
- disabled: disabled,
54
- required: required,
55
- status: status,
56
- message: message,
57
- icon: icon(),
58
- isLabelInline: displayStyle === 'inline',
59
60
  ref: forwardedRef,
61
+ as: 'div',
62
+ labelPlacement: displayStyle,
63
+ className: (0, classnames_1.default)(
64
+ 'iui-input-group-wrapper',
65
+ className,
66
+ ),
60
67
  ...rest,
61
68
  },
69
+ label &&
70
+ React.createElement(
71
+ index_js_3.Label,
72
+ { as: 'label', required: required, disabled: disabled, ...labelProps },
73
+ label,
74
+ ),
62
75
  React.createElement(
63
76
  index_js_1.Box,
64
- { className: 'iui-input-group' },
77
+ {
78
+ as: 'div',
79
+ ...innerProps,
80
+ className: (0, classnames_1.default)(
81
+ 'iui-input-group',
82
+ innerProps?.className,
83
+ ),
84
+ },
65
85
  children,
66
86
  ),
87
+ (message || status || svgIcon) &&
88
+ React.createElement(
89
+ index_js_4.StatusMessage,
90
+ { startIcon: icon(), status: status, ...messageProps },
91
+ displayStyle !== 'inline' && message,
92
+ ),
67
93
  );
68
94
  });
69
95
  exports.default = exports.InputGroup;
@@ -0,0 +1,39 @@
1
+ import * as React from 'react';
2
+ import type { PolymorphicForwardRefComponent } from '../utils/index.js';
3
+ import type { InputProps } from '../Input/Input.js';
4
+ /**
5
+ * Input component with various additional decorations.
6
+ * You can add icons, buttons and other various subcomponents to it.
7
+ *
8
+ * If you are not using default InputWithDecorations.Icon and InputWithDecorations.Button, use borderless versions of other components.
9
+ *
10
+ * @usage
11
+ * <InputWithDecorations>
12
+ * <InputWithDecorations.Input />
13
+ * <InputWithDecorations.Icon>
14
+ * <SvgAdd />
15
+ * </InputWithDecorations.Icon>
16
+ * </InputWithDecorations>
17
+ */
18
+ export declare const InputWithDecorations: PolymorphicForwardRefComponent<"div", Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
19
+ ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
20
+ }, "as" | keyof import("../utils/index.js").InputFlexContainerProps> & import("../utils/index.js").InputFlexContainerProps & {
21
+ as?: "div" | undefined;
22
+ }> & {
23
+ /**
24
+ * Subcomponent to include input in your InputWithDecorations
25
+ */
26
+ Input: PolymorphicForwardRefComponent<"input", InputProps>;
27
+ /**
28
+ * Subcomponent to include button in your InputWithDecorations
29
+ */
30
+ Button: PolymorphicForwardRefComponent<"span", Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
31
+ ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
32
+ }, "label" | "as" | "size" | "htmlDisabled" | "styleType" | "isActive" | "iconProps"> & {
33
+ isActive?: boolean | undefined;
34
+ label?: React.ReactNode;
35
+ iconProps?: React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement> | undefined;
36
+ } & Omit<import("../Buttons/Button/Button.js").ButtonProps, "startIcon" | "endIcon" | "labelProps" | "startIconProps" | "endIconProps"> & {
37
+ as?: "button" | undefined;
38
+ }>;
39
+ };
@@ -0,0 +1,81 @@
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
+ exports.InputWithDecorations = void 0;
4
+ const tslib_1 = require('tslib');
5
+ /*---------------------------------------------------------------------------------------------
6
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
7
+ * See LICENSE.md in the project root for license terms and full copyright notice.
8
+ *--------------------------------------------------------------------------------------------*/
9
+ const React = tslib_1.__importStar(require('react'));
10
+ const index_js_1 = require('../utils/index.js');
11
+ const index_js_2 = require('../Buttons/index.js');
12
+ const InputWithDecorationsContext = React.createContext(undefined);
13
+ const InputWithDecorationsComponent = React.forwardRef((props, ref) => {
14
+ const { children, size, isDisabled, ...rest } = props;
15
+ return React.createElement(
16
+ InputWithDecorationsContext.Provider,
17
+ { value: { size, isDisabled } },
18
+ React.createElement(
19
+ index_js_1.InputFlexContainer,
20
+ { isDisabled: isDisabled, size: size, ref: ref, ...rest },
21
+ children,
22
+ ),
23
+ );
24
+ });
25
+ //-------------------------------------------------------------------------------
26
+ const InputWithDecorationsInput = React.forwardRef((props, ref) => {
27
+ const { id: idProp, size, disabled: localDisabled, ...rest } = props;
28
+ const { size: contextSize, isDisabled } = (0, index_js_1.useSafeContext)(
29
+ InputWithDecorationsContext,
30
+ );
31
+ return React.createElement(index_js_1.Box, {
32
+ as: 'input',
33
+ ref: ref,
34
+ 'data-iui-size': size ?? contextSize,
35
+ disabled: localDisabled ?? isDisabled,
36
+ id: idProp,
37
+ ...rest,
38
+ });
39
+ });
40
+ //-------------------------------------------------------------------------------
41
+ const InputWithDecorationsButton = React.forwardRef((props, ref) => {
42
+ const { children, size, disabled: localDisabled, ...rest } = props;
43
+ const { size: contextSize, isDisabled } = (0, index_js_1.useSafeContext)(
44
+ InputWithDecorationsContext,
45
+ );
46
+ return React.createElement(
47
+ index_js_2.IconButton,
48
+ {
49
+ ref: ref,
50
+ size: size ?? contextSize,
51
+ styleType: 'borderless',
52
+ disabled: localDisabled ?? isDisabled,
53
+ ...rest,
54
+ },
55
+ children,
56
+ );
57
+ });
58
+ /**
59
+ * Input component with various additional decorations.
60
+ * You can add icons, buttons and other various subcomponents to it.
61
+ *
62
+ * If you are not using default InputWithDecorations.Icon and InputWithDecorations.Button, use borderless versions of other components.
63
+ *
64
+ * @usage
65
+ * <InputWithDecorations>
66
+ * <InputWithDecorations.Input />
67
+ * <InputWithDecorations.Icon>
68
+ * <SvgAdd />
69
+ * </InputWithDecorations.Icon>
70
+ * </InputWithDecorations>
71
+ */
72
+ exports.InputWithDecorations = Object.assign(InputWithDecorationsComponent, {
73
+ /**
74
+ * Subcomponent to include input in your InputWithDecorations
75
+ */
76
+ Input: InputWithDecorationsInput,
77
+ /**
78
+ * Subcomponent to include button in your InputWithDecorations
79
+ */
80
+ Button: InputWithDecorationsButton,
81
+ });
@@ -0,0 +1,3 @@
1
+ export { InputWithDecorations } from './InputWithDecorations.js';
2
+ declare const _default: "./Input";
3
+ export default _default;
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
+ exports.InputWithDecorations = void 0;
4
+ /*---------------------------------------------------------------------------------------------
5
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
+ * See LICENSE.md in the project root for license terms and full copyright notice.
7
+ *--------------------------------------------------------------------------------------------*/
8
+ var InputWithDecorations_js_1 = require('./InputWithDecorations.js');
9
+ Object.defineProperty(exports, 'InputWithDecorations', {
10
+ enumerable: true,
11
+ get: function () {
12
+ return InputWithDecorations_js_1.InputWithDecorations;
13
+ },
14
+ });
15
+ exports.default = './Input';
@@ -12,6 +12,11 @@ type LabelOwnProps = {
12
12
  * This adds an asterisk next to the label text.
13
13
  */
14
14
  required?: boolean;
15
+ /**
16
+ * Adds disabled styling to a label.
17
+ * @default false
18
+ */
19
+ disabled?: boolean;
15
20
  };
16
21
  /**
17
22
  * A standalone label to be used with input components (using `htmlFor`).
@@ -20,6 +20,7 @@ exports.Label = React.forwardRef((props, forwardedRef) => {
20
20
  const {
21
21
  displayStyle = 'block',
22
22
  required,
23
+ disabled,
23
24
  className,
24
25
  children,
25
26
  ...rest
@@ -36,6 +37,7 @@ exports.Label = React.forwardRef((props, forwardedRef) => {
36
37
  },
37
38
  className,
38
39
  ),
40
+ 'data-iui-disabled': disabled ? true : undefined,
39
41
  ref: forwardedRef,
40
42
  ...rest,
41
43
  },