@itwin/itwinui-react 1.20.0 → 1.21.0

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 (296) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/cjs/core/Alert/Alert.d.ts +1 -1
  3. package/cjs/core/Alert/Alert.js +3 -4
  4. package/cjs/core/Badge/Badge.d.ts +1 -2
  5. package/cjs/core/Badge/Badge.js +4 -5
  6. package/cjs/core/Breadcrumbs/Breadcrumbs.d.ts +1 -1
  7. package/cjs/core/Breadcrumbs/Breadcrumbs.js +4 -6
  8. package/cjs/core/ButtonGroup/ButtonGroup.d.ts +1 -1
  9. package/cjs/core/ButtonGroup/ButtonGroup.js +3 -4
  10. package/cjs/core/Buttons/Button/Button.js +2 -2
  11. package/cjs/core/Buttons/DropdownButton/DropdownButton.js +3 -4
  12. package/cjs/core/Buttons/IconButton/IconButton.js +2 -2
  13. package/cjs/core/Buttons/IdeasButton/IdeasButton.js +2 -2
  14. package/cjs/core/Buttons/SplitButton/SplitButton.js +2 -2
  15. package/cjs/core/Checkbox/Checkbox.js +3 -4
  16. package/cjs/core/ComboBox/ComboBox.d.ts +51 -0
  17. package/cjs/core/ComboBox/ComboBox.js +268 -0
  18. package/cjs/core/ComboBox/index.d.ts +4 -0
  19. package/cjs/core/ComboBox/index.js +10 -0
  20. package/cjs/core/DatePicker/DatePicker.js +2 -2
  21. package/cjs/core/DropdownMenu/DropdownMenu.d.ts +1 -2
  22. package/cjs/core/DropdownMenu/DropdownMenu.js +4 -6
  23. package/cjs/core/ErrorPage/ErrorPage.js +2 -2
  24. package/cjs/core/ExpandableBlock/ExpandableBlock.d.ts +1 -1
  25. package/cjs/core/ExpandableBlock/ExpandableBlock.js +3 -4
  26. package/cjs/core/Fieldset/Fieldset.js +2 -2
  27. package/cjs/core/FileUpload/FileUpload.d.ts +2 -2
  28. package/cjs/core/FileUpload/FileUpload.js +3 -4
  29. package/cjs/core/FileUpload/FileUploadTemplate.js +2 -2
  30. package/cjs/core/Footer/Footer.d.ts +1 -1
  31. package/cjs/core/Footer/Footer.js +2 -2
  32. package/cjs/core/Header/Header.d.ts +1 -1
  33. package/cjs/core/Header/Header.js +2 -2
  34. package/cjs/core/Header/HeaderBreadcrumbs.js +2 -2
  35. package/cjs/core/Header/HeaderButton.js +2 -2
  36. package/cjs/core/Header/HeaderLogo.d.ts +1 -1
  37. package/cjs/core/Header/HeaderLogo.js +2 -2
  38. package/cjs/core/Input/Input.js +3 -4
  39. package/cjs/core/InputGroup/InputGroup.d.ts +1 -1
  40. package/cjs/core/InputGroup/InputGroup.js +4 -6
  41. package/cjs/core/LabeledInput/LabeledInput.js +4 -6
  42. package/cjs/core/LabeledSelect/LabeledSelect.js +4 -6
  43. package/cjs/core/LabeledTextarea/LabeledTextarea.js +4 -6
  44. package/cjs/core/Menu/Menu.d.ts +11 -1
  45. package/cjs/core/Menu/Menu.js +11 -11
  46. package/cjs/core/Menu/MenuDivider.js +2 -2
  47. package/cjs/core/Menu/MenuItem.d.ts +2 -2
  48. package/cjs/core/Menu/MenuItem.js +5 -7
  49. package/cjs/core/Modal/Modal.d.ts +1 -1
  50. package/cjs/core/Modal/Modal.js +5 -7
  51. package/cjs/core/Modal/ModalButtonBar.js +2 -2
  52. package/cjs/core/ProgressIndicators/ProgressLinear/ProgressLinear.d.ts +1 -1
  53. package/cjs/core/ProgressIndicators/ProgressLinear/ProgressLinear.js +2 -2
  54. package/cjs/core/ProgressIndicators/ProgressRadial/ProgressRadial.d.ts +1 -1
  55. package/cjs/core/ProgressIndicators/ProgressRadial/ProgressRadial.js +2 -2
  56. package/cjs/core/Radio/Radio.js +3 -4
  57. package/cjs/core/RadioTiles/RadioTile.js +3 -4
  58. package/cjs/core/RadioTiles/RadioTileGroup.js +2 -2
  59. package/cjs/core/Select/Select.d.ts +1 -2
  60. package/cjs/core/Select/Select.js +4 -4
  61. package/cjs/core/SideNavigation/SideNavigation.d.ts +1 -1
  62. package/cjs/core/SideNavigation/SideNavigation.js +2 -2
  63. package/cjs/core/SideNavigation/SidenavButton.js +2 -2
  64. package/cjs/core/Slider/Slider.d.ts +1 -1
  65. package/cjs/core/Slider/Slider.js +7 -9
  66. package/cjs/core/Table/Table.d.ts +1 -1
  67. package/cjs/core/Table/Table.js +4 -4
  68. package/cjs/core/Table/TableRowMemoized.js +3 -4
  69. package/cjs/core/Table/filters/BaseFilter.d.ts +1 -1
  70. package/cjs/core/Table/filters/BaseFilter.js +2 -2
  71. package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.js +2 -2
  72. package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.js +2 -2
  73. package/cjs/core/Table/filters/FilterButtonBar.d.ts +1 -1
  74. package/cjs/core/Table/filters/FilterButtonBar.js +2 -2
  75. package/cjs/core/Table/filters/FilterToggle.d.ts +1 -1
  76. package/cjs/core/Table/filters/FilterToggle.js +4 -6
  77. package/cjs/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +2 -2
  78. package/cjs/core/Table/filters/TextFilter/TextFilter.js +2 -2
  79. package/cjs/core/Tabs/Tab.js +2 -2
  80. package/cjs/core/Tabs/Tabs.js +6 -9
  81. package/cjs/core/Tag/Tag.d.ts +1 -1
  82. package/cjs/core/Tag/Tag.js +2 -2
  83. package/cjs/core/Tag/TagContainer.d.ts +1 -1
  84. package/cjs/core/Tag/TagContainer.js +2 -2
  85. package/cjs/core/Textarea/Textarea.js +3 -4
  86. package/cjs/core/ThemeProvider/ThemeProvider.d.ts +1 -1
  87. package/cjs/core/ThemeProvider/ThemeProvider.js +2 -2
  88. package/cjs/core/Tile/Tile.d.ts +2 -2
  89. package/cjs/core/Tile/Tile.js +4 -4
  90. package/cjs/core/TimePicker/TimePicker.d.ts +1 -1
  91. package/cjs/core/TimePicker/TimePicker.js +2 -2
  92. package/cjs/core/Toast/Toast.d.ts +1 -1
  93. package/cjs/core/Toast/Toast.js +5 -6
  94. package/cjs/core/Toast/Toaster.js +2 -2
  95. package/cjs/core/ToggleSwitch/ToggleSwitch.d.ts +1 -1
  96. package/cjs/core/ToggleSwitch/ToggleSwitch.js +3 -4
  97. package/cjs/core/Tooltip/Tooltip.d.ts +1 -2
  98. package/cjs/core/Tooltip/Tooltip.js +3 -4
  99. package/cjs/core/Typography/Blockquote/Blockquote.js +2 -2
  100. package/cjs/core/Typography/Body/Body.js +2 -2
  101. package/cjs/core/Typography/Code/Code.d.ts +1 -1
  102. package/cjs/core/Typography/Code/Code.js +2 -2
  103. package/cjs/core/Typography/Headline/Headline.js +2 -2
  104. package/cjs/core/Typography/Kbd/Kbd.d.ts +1 -1
  105. package/cjs/core/Typography/Kbd/Kbd.js +2 -2
  106. package/cjs/core/Typography/Leading/Leading.js +2 -2
  107. package/cjs/core/Typography/Small/Small.js +2 -2
  108. package/cjs/core/Typography/Subheading/Subheading.js +2 -2
  109. package/cjs/core/Typography/Text/Text.d.ts +1 -1
  110. package/cjs/core/Typography/Text/Text.js +2 -2
  111. package/cjs/core/Typography/Title/Title.js +2 -2
  112. package/cjs/core/UserIcon/UserIcon.d.ts +1 -1
  113. package/cjs/core/UserIcon/UserIcon.js +2 -2
  114. package/cjs/core/UserIconGroup/UserIconGroup.d.ts +1 -1
  115. package/cjs/core/UserIconGroup/UserIconGroup.js +2 -2
  116. package/cjs/core/Wizard/Step.d.ts +1 -1
  117. package/cjs/core/Wizard/Wizard.js +2 -2
  118. package/cjs/core/index.d.ts +4 -3
  119. package/cjs/core/index.js +7 -6
  120. package/cjs/core/utils/{FocusTrap.d.ts → components/FocusTrap.d.ts} +0 -0
  121. package/cjs/core/utils/{FocusTrap.js → components/FocusTrap.js} +3 -3
  122. package/cjs/core/utils/{InputContainer.d.ts → components/InputContainer.d.ts} +0 -0
  123. package/cjs/core/utils/{InputContainer.js → components/InputContainer.js} +25 -3
  124. package/cjs/core/utils/{Popover.d.ts → components/Popover.d.ts} +1 -1
  125. package/cjs/core/utils/{Popover.js → components/Popover.js} +1 -1
  126. package/cjs/core/utils/components/icons.d.ts +8 -0
  127. package/cjs/core/utils/components/icons.js +32 -0
  128. package/cjs/core/utils/components/index.d.ts +4 -0
  129. package/cjs/core/utils/components/index.js +20 -0
  130. package/cjs/core/utils/functions/colors.d.ts +20 -0
  131. package/cjs/core/utils/functions/colors.js +52 -0
  132. package/cjs/core/utils/functions/dom.d.ts +18 -0
  133. package/cjs/core/utils/functions/dom.js +42 -0
  134. package/cjs/core/utils/functions/focusable.d.ts +8 -0
  135. package/cjs/core/utils/functions/focusable.js +34 -0
  136. package/cjs/core/utils/functions/index.d.ts +4 -0
  137. package/cjs/core/utils/functions/index.js +20 -0
  138. package/cjs/core/utils/functions/numbers.d.ts +8 -0
  139. package/cjs/core/utils/functions/numbers.js +27 -0
  140. package/cjs/core/utils/hooks/index.d.ts +6 -0
  141. package/cjs/core/utils/hooks/index.js +22 -0
  142. package/cjs/core/utils/hooks/useIntersection.js +2 -2
  143. package/cjs/core/utils/hooks/useResizeObserver.js +2 -2
  144. package/cjs/core/utils/hooks/useTheme.js +3 -3
  145. package/cjs/core/utils/index.d.ts +4 -0
  146. package/cjs/core/utils/index.js +20 -0
  147. package/esm/core/Alert/Alert.d.ts +1 -1
  148. package/esm/core/Alert/Alert.js +1 -2
  149. package/esm/core/Badge/Badge.d.ts +1 -2
  150. package/esm/core/Badge/Badge.js +1 -2
  151. package/esm/core/Breadcrumbs/Breadcrumbs.d.ts +1 -1
  152. package/esm/core/Breadcrumbs/Breadcrumbs.js +1 -3
  153. package/esm/core/ButtonGroup/ButtonGroup.d.ts +1 -1
  154. package/esm/core/ButtonGroup/ButtonGroup.js +1 -2
  155. package/esm/core/Buttons/Button/Button.js +1 -1
  156. package/esm/core/Buttons/DropdownButton/DropdownButton.js +1 -2
  157. package/esm/core/Buttons/IconButton/IconButton.js +1 -1
  158. package/esm/core/Buttons/IdeasButton/IdeasButton.js +1 -1
  159. package/esm/core/Buttons/SplitButton/SplitButton.js +1 -1
  160. package/esm/core/Checkbox/Checkbox.js +1 -2
  161. package/esm/core/ComboBox/ComboBox.d.ts +51 -0
  162. package/esm/core/ComboBox/ComboBox.js +261 -0
  163. package/esm/core/ComboBox/index.d.ts +4 -0
  164. package/esm/core/ComboBox/index.js +6 -0
  165. package/esm/core/DatePicker/DatePicker.js +1 -1
  166. package/esm/core/DropdownMenu/DropdownMenu.d.ts +1 -2
  167. package/esm/core/DropdownMenu/DropdownMenu.js +1 -3
  168. package/esm/core/ErrorPage/ErrorPage.js +1 -1
  169. package/esm/core/ExpandableBlock/ExpandableBlock.d.ts +1 -1
  170. package/esm/core/ExpandableBlock/ExpandableBlock.js +1 -2
  171. package/esm/core/Fieldset/Fieldset.js +1 -1
  172. package/esm/core/FileUpload/FileUpload.d.ts +2 -2
  173. package/esm/core/FileUpload/FileUpload.js +1 -2
  174. package/esm/core/FileUpload/FileUploadTemplate.js +1 -1
  175. package/esm/core/Footer/Footer.d.ts +1 -1
  176. package/esm/core/Footer/Footer.js +1 -1
  177. package/esm/core/Header/Header.d.ts +1 -1
  178. package/esm/core/Header/Header.js +1 -1
  179. package/esm/core/Header/HeaderBreadcrumbs.js +1 -1
  180. package/esm/core/Header/HeaderButton.js +1 -1
  181. package/esm/core/Header/HeaderLogo.d.ts +1 -1
  182. package/esm/core/Header/HeaderLogo.js +1 -1
  183. package/esm/core/Input/Input.js +1 -2
  184. package/esm/core/InputGroup/InputGroup.d.ts +1 -1
  185. package/esm/core/InputGroup/InputGroup.js +1 -3
  186. package/esm/core/LabeledInput/LabeledInput.js +1 -3
  187. package/esm/core/LabeledSelect/LabeledSelect.js +1 -3
  188. package/esm/core/LabeledTextarea/LabeledTextarea.js +1 -3
  189. package/esm/core/Menu/Menu.d.ts +11 -1
  190. package/esm/core/Menu/Menu.js +7 -7
  191. package/esm/core/Menu/MenuDivider.js +1 -1
  192. package/esm/core/Menu/MenuItem.d.ts +2 -2
  193. package/esm/core/Menu/MenuItem.js +2 -4
  194. package/esm/core/Modal/Modal.d.ts +1 -1
  195. package/esm/core/Modal/Modal.js +1 -3
  196. package/esm/core/Modal/ModalButtonBar.js +1 -1
  197. package/esm/core/ProgressIndicators/ProgressLinear/ProgressLinear.d.ts +1 -1
  198. package/esm/core/ProgressIndicators/ProgressLinear/ProgressLinear.js +1 -1
  199. package/esm/core/ProgressIndicators/ProgressRadial/ProgressRadial.d.ts +1 -1
  200. package/esm/core/ProgressIndicators/ProgressRadial/ProgressRadial.js +1 -1
  201. package/esm/core/Radio/Radio.js +1 -2
  202. package/esm/core/RadioTiles/RadioTile.js +1 -2
  203. package/esm/core/RadioTiles/RadioTileGroup.js +1 -1
  204. package/esm/core/Select/Select.d.ts +1 -2
  205. package/esm/core/Select/Select.js +2 -2
  206. package/esm/core/SideNavigation/SideNavigation.d.ts +1 -1
  207. package/esm/core/SideNavigation/SideNavigation.js +1 -1
  208. package/esm/core/SideNavigation/SidenavButton.js +1 -1
  209. package/esm/core/Slider/Slider.d.ts +1 -1
  210. package/esm/core/Slider/Slider.js +1 -3
  211. package/esm/core/Table/Table.d.ts +1 -1
  212. package/esm/core/Table/Table.js +1 -1
  213. package/esm/core/Table/TableRowMemoized.js +1 -2
  214. package/esm/core/Table/filters/BaseFilter.d.ts +1 -1
  215. package/esm/core/Table/filters/BaseFilter.js +1 -1
  216. package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.js +1 -1
  217. package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.js +1 -1
  218. package/esm/core/Table/filters/FilterButtonBar.d.ts +1 -1
  219. package/esm/core/Table/filters/FilterButtonBar.js +1 -1
  220. package/esm/core/Table/filters/FilterToggle.d.ts +1 -1
  221. package/esm/core/Table/filters/FilterToggle.js +1 -3
  222. package/esm/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +1 -1
  223. package/esm/core/Table/filters/TextFilter/TextFilter.js +1 -1
  224. package/esm/core/Tabs/Tab.js +1 -1
  225. package/esm/core/Tabs/Tabs.js +1 -4
  226. package/esm/core/Tag/Tag.d.ts +1 -1
  227. package/esm/core/Tag/Tag.js +1 -1
  228. package/esm/core/Tag/TagContainer.d.ts +1 -1
  229. package/esm/core/Tag/TagContainer.js +1 -1
  230. package/esm/core/Textarea/Textarea.js +1 -2
  231. package/esm/core/ThemeProvider/ThemeProvider.d.ts +1 -1
  232. package/esm/core/ThemeProvider/ThemeProvider.js +1 -1
  233. package/esm/core/Tile/Tile.d.ts +2 -2
  234. package/esm/core/Tile/Tile.js +3 -3
  235. package/esm/core/TimePicker/TimePicker.d.ts +1 -1
  236. package/esm/core/TimePicker/TimePicker.js +1 -1
  237. package/esm/core/Toast/Toast.d.ts +1 -1
  238. package/esm/core/Toast/Toast.js +1 -2
  239. package/esm/core/Toast/Toaster.js +1 -1
  240. package/esm/core/ToggleSwitch/ToggleSwitch.d.ts +1 -1
  241. package/esm/core/ToggleSwitch/ToggleSwitch.js +1 -2
  242. package/esm/core/Tooltip/Tooltip.d.ts +1 -2
  243. package/esm/core/Tooltip/Tooltip.js +1 -2
  244. package/esm/core/Typography/Blockquote/Blockquote.js +1 -1
  245. package/esm/core/Typography/Body/Body.js +1 -1
  246. package/esm/core/Typography/Code/Code.d.ts +1 -1
  247. package/esm/core/Typography/Code/Code.js +1 -1
  248. package/esm/core/Typography/Headline/Headline.js +1 -1
  249. package/esm/core/Typography/Kbd/Kbd.d.ts +1 -1
  250. package/esm/core/Typography/Kbd/Kbd.js +1 -1
  251. package/esm/core/Typography/Leading/Leading.js +1 -1
  252. package/esm/core/Typography/Small/Small.js +1 -1
  253. package/esm/core/Typography/Subheading/Subheading.js +1 -1
  254. package/esm/core/Typography/Text/Text.d.ts +1 -1
  255. package/esm/core/Typography/Text/Text.js +1 -1
  256. package/esm/core/Typography/Title/Title.js +1 -1
  257. package/esm/core/UserIcon/UserIcon.d.ts +1 -1
  258. package/esm/core/UserIcon/UserIcon.js +1 -1
  259. package/esm/core/UserIconGroup/UserIconGroup.d.ts +1 -1
  260. package/esm/core/UserIconGroup/UserIconGroup.js +1 -1
  261. package/esm/core/Wizard/Step.d.ts +1 -1
  262. package/esm/core/Wizard/Wizard.js +1 -1
  263. package/esm/core/index.d.ts +4 -3
  264. package/esm/core/index.js +2 -2
  265. package/esm/core/utils/{FocusTrap.d.ts → components/FocusTrap.d.ts} +0 -0
  266. package/esm/core/utils/{FocusTrap.js → components/FocusTrap.js} +2 -2
  267. package/esm/core/utils/{InputContainer.d.ts → components/InputContainer.d.ts} +0 -0
  268. package/esm/core/utils/{InputContainer.js → components/InputContainer.js} +25 -3
  269. package/esm/core/utils/{Popover.d.ts → components/Popover.d.ts} +1 -1
  270. package/esm/core/utils/{Popover.js → components/Popover.js} +1 -1
  271. package/esm/core/utils/components/icons.d.ts +8 -0
  272. package/esm/core/utils/components/icons.js +26 -0
  273. package/esm/core/utils/components/index.d.ts +4 -0
  274. package/esm/core/utils/components/index.js +8 -0
  275. package/esm/core/utils/functions/colors.d.ts +20 -0
  276. package/esm/core/utils/functions/colors.js +47 -0
  277. package/esm/core/utils/functions/dom.d.ts +18 -0
  278. package/esm/core/utils/functions/dom.js +36 -0
  279. package/esm/core/utils/functions/focusable.d.ts +8 -0
  280. package/esm/core/utils/functions/focusable.js +29 -0
  281. package/esm/core/utils/functions/index.d.ts +4 -0
  282. package/esm/core/utils/functions/index.js +8 -0
  283. package/esm/core/utils/functions/numbers.d.ts +8 -0
  284. package/esm/core/utils/functions/numbers.js +22 -0
  285. package/esm/core/utils/hooks/index.d.ts +6 -0
  286. package/esm/core/utils/hooks/index.js +10 -0
  287. package/esm/core/utils/hooks/useIntersection.js +1 -1
  288. package/esm/core/utils/hooks/useResizeObserver.js +1 -1
  289. package/esm/core/utils/hooks/useTheme.js +1 -1
  290. package/esm/core/utils/index.d.ts +4 -0
  291. package/esm/core/utils/index.js +8 -0
  292. package/package.json +5 -3
  293. package/cjs/core/utils/common.d.ts +0 -58
  294. package/cjs/core/utils/common.js +0 -146
  295. package/esm/core/utils/common.d.ts +0 -58
  296. package/esm/core/utils/common.js +0 -132
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ /*---------------------------------------------------------------------------------------------
14
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
15
+ * See LICENSE.md in the project root for license terms and full copyright notice.
16
+ *--------------------------------------------------------------------------------------------*/
17
+ __exportStar(require("./functions"), exports);
18
+ __exportStar(require("./hooks"), exports);
19
+ __exportStar(require("./components"), exports);
20
+ __exportStar(require("./props"), exports);
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { CommonProps } from '../utils/props';
2
+ import { CommonProps } from '../utils';
3
3
  import '@itwin/itwinui-css/css/alert.css';
4
4
  export declare type AlertProps = {
5
5
  /**
@@ -27,10 +27,9 @@ var __rest = (this && this.__rest) || function (s, e) {
27
27
  import SvgCloseSmall from '@itwin/itwinui-icons-react/cjs/icons/CloseSmall';
28
28
  import cx from 'classnames';
29
29
  import React from 'react';
30
- import { useTheme } from '../utils/hooks/useTheme';
30
+ import { useTheme, StatusIconMap } from '../utils';
31
31
  import '@itwin/itwinui-css/css/alert.css';
32
32
  import { IconButton } from '../Buttons/IconButton';
33
- import { StatusIconMap } from '../utils/common';
34
33
  /**
35
34
  * A small box to quickly grab user attention and communicate a brief message
36
35
  * @example
@@ -1,7 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { CommonProps } from '../utils/props';
2
+ import { CommonProps, SoftBackgrounds } from '../utils';
3
3
  import '@itwin/itwinui-css/css/badge.css';
4
- import { SoftBackgrounds } from '../utils/common';
5
4
  export declare type BadgeProps = {
6
5
  /**
7
6
  * Background color of the badge.
@@ -26,9 +26,8 @@ var __rest = (this && this.__rest) || function (s, e) {
26
26
  *--------------------------------------------------------------------------------------------*/
27
27
  import React from 'react';
28
28
  import cx from 'classnames';
29
- import { useTheme } from '../utils/hooks/useTheme';
29
+ import { useTheme, getWindow, isSoftBackground, SoftBackgrounds, } from '../utils';
30
30
  import '@itwin/itwinui-css/css/badge.css';
31
- import { getWindow, isSoftBackground, SoftBackgrounds } from '../utils/common';
32
31
  /**
33
32
  * Helper function that returns one of the preset badge color values.
34
33
  */
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { CommonProps } from '../utils/props';
2
+ import { CommonProps } from '../utils';
3
3
  import '@itwin/itwinui-css/css/breadcrumbs.css';
4
4
  export declare type BreadcrumbsProps = {
5
5
  /**
@@ -26,11 +26,9 @@ var __rest = (this && this.__rest) || function (s, e) {
26
26
  *--------------------------------------------------------------------------------------------*/
27
27
  import React from 'react';
28
28
  import cx from 'classnames';
29
- import { useTheme } from '../utils/hooks/useTheme';
29
+ import { useTheme, useMergedRefs, useOverflow } from '../utils';
30
30
  import SvgChevronRight from '@itwin/itwinui-icons-react/cjs/icons/ChevronRight';
31
31
  import '@itwin/itwinui-css/css/breadcrumbs.css';
32
- import { useMergedRefs } from '../utils/hooks/useMergedRefs';
33
- import { useOverflow } from '../utils/hooks/useOverflow';
34
32
  /**
35
33
  * A breadcrumb trail is used as a navigational aid to help users keep track
36
34
  * of their place in the application. It is often placed before a page's main content.
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { CommonProps } from '../utils/props';
2
+ import { CommonProps } from '../utils';
3
3
  import '@itwin/itwinui-css/css/button.css';
4
4
  export declare type ButtonGroupProps = {
5
5
  /**
@@ -26,8 +26,7 @@ var __rest = (this && this.__rest) || function (s, e) {
26
26
  *--------------------------------------------------------------------------------------------*/
27
27
  import React from 'react';
28
28
  import cx from 'classnames';
29
- import { useTheme } from '../utils/hooks/useTheme';
30
- import { useOverflow } from '../utils/hooks/useOverflow';
29
+ import { useTheme, useOverflow } from '../utils';
31
30
  import '@itwin/itwinui-css/css/button.css';
32
31
  /**
33
32
  * Group buttons together for common actions.
@@ -26,7 +26,7 @@ var __rest = (this && this.__rest) || function (s, e) {
26
26
  *--------------------------------------------------------------------------------------------*/
27
27
  import cx from 'classnames';
28
28
  import React from 'react';
29
- import { useTheme } from '../../utils/hooks/useTheme';
29
+ import { useTheme } from '../../utils';
30
30
  import '@itwin/itwinui-css/css/button.css';
31
31
  /**
32
32
  * Generic button component
@@ -30,8 +30,7 @@ import { Button } from '../Button';
30
30
  import { DropdownMenu } from '../../DropdownMenu';
31
31
  import SvgCaretDownSmall from '@itwin/itwinui-icons-react/cjs/icons/CaretDownSmall';
32
32
  import SvgCaretUpSmall from '@itwin/itwinui-icons-react/cjs/icons/CaretUpSmall';
33
- import { useTheme } from '../../utils/hooks/useTheme';
34
- import { useMergedRefs } from '../../utils/hooks/useMergedRefs';
33
+ import { useTheme, useMergedRefs } from '../../utils';
35
34
  import '@itwin/itwinui-css/css/button.css';
36
35
  /**
37
36
  * Button that opens a DropdownMenu.
@@ -26,7 +26,7 @@ var __rest = (this && this.__rest) || function (s, e) {
26
26
  *--------------------------------------------------------------------------------------------*/
27
27
  import cx from 'classnames';
28
28
  import React from 'react';
29
- import { useTheme } from '../../utils/hooks/useTheme';
29
+ import { useTheme } from '../../utils';
30
30
  import '@itwin/itwinui-css/css/button.css';
31
31
  /**
32
32
  * Icon button
@@ -26,7 +26,7 @@ var __rest = (this && this.__rest) || function (s, e) {
26
26
  *--------------------------------------------------------------------------------------------*/
27
27
  import React from 'react';
28
28
  import SvgSmileyHappy from '@itwin/itwinui-icons-react/cjs/icons/SmileyHappy';
29
- import { useTheme } from '../../utils/hooks/useTheme';
29
+ import { useTheme } from '../../utils';
30
30
  import { Button } from '../Button';
31
31
  /**
32
32
  * Ideas button
@@ -31,7 +31,7 @@ import { IconButton } from '../IconButton';
31
31
  import { DropdownMenu } from '../../DropdownMenu';
32
32
  import SvgCaretDownSmall from '@itwin/itwinui-icons-react/cjs/icons/CaretDownSmall';
33
33
  import SvgCaretUpSmall from '@itwin/itwinui-icons-react/cjs/icons/CaretUpSmall';
34
- import { useTheme } from '../../utils/hooks/useTheme';
34
+ import { useTheme } from '../../utils';
35
35
  import '@itwin/itwinui-css/css/button.css';
36
36
  /**
37
37
  * Split button component with a DropdownMenu.
@@ -27,8 +27,7 @@ var __rest = (this && this.__rest) || function (s, e) {
27
27
  import cx from 'classnames';
28
28
  import React from 'react';
29
29
  import { ProgressRadial } from '../ProgressIndicators';
30
- import { useMergedRefs } from '../utils/hooks/useMergedRefs';
31
- import { useTheme } from '../utils/hooks/useTheme';
30
+ import { useMergedRefs, useTheme } from '../utils';
32
31
  import '@itwin/itwinui-css/css/inputs.css';
33
32
  /**
34
33
  * Simple input checkbox
@@ -0,0 +1,51 @@
1
+ /// <reference types="react" />
2
+ import { InputProps } from '../Input';
3
+ import { SelectOption } from '../Select';
4
+ import { PopoverProps, CommonProps } from '../utils';
5
+ import 'tippy.js/animations/shift-away.css';
6
+ export declare type ComboBoxProps<T> = {
7
+ /**
8
+ * Array of options that populate the dropdown list.
9
+ */
10
+ options: SelectOption<T>[];
11
+ /**
12
+ * Controlled value of ComboBox.
13
+ */
14
+ value?: T;
15
+ /**
16
+ * Callback fired when selected value changes.
17
+ */
18
+ onChange?: (value: T) => void;
19
+ /**
20
+ * Function to customize the default filtering logic.
21
+ */
22
+ filterFunction?: (options: SelectOption<T>[], inputValue: string) => SelectOption<T>[];
23
+ /**
24
+ * Native input element props.
25
+ */
26
+ inputProps?: Omit<InputProps, 'setFocus'>;
27
+ /**
28
+ * Props to customize dropdown menu behavior.
29
+ */
30
+ dropdownMenuProps?: PopoverProps;
31
+ /**
32
+ * Message shown when no options are available.
33
+ * @default 'No options found'
34
+ */
35
+ emptyStateMessage?: string;
36
+ } & Omit<CommonProps, 'title'>;
37
+ /**
38
+ * ComboBox component that allows typing a value to filter the options in dropdown list.
39
+ * Values can be selected either using mouse clicks or using the Enter key.
40
+ * @example
41
+ * <ComboBox
42
+ * options={[
43
+ * { label: 'Item 1', value: 1 },
44
+ * { label: 'Item 2', value: 2 },
45
+ * { label: 'Item 3', value: 3 },
46
+ * ]}
47
+ * onChange={() => {}}
48
+ * />
49
+ */
50
+ export declare const ComboBox: <T>(props: ComboBoxProps<T>) => JSX.Element;
51
+ export default ComboBox;
@@ -0,0 +1,261 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ /*---------------------------------------------------------------------------------------------
24
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
25
+ * See LICENSE.md in the project root for license terms and full copyright notice.
26
+ *--------------------------------------------------------------------------------------------*/
27
+ import React from 'react';
28
+ import cx from 'classnames';
29
+ import { Input } from '../Input';
30
+ import { Menu, MenuItem } from '../Menu';
31
+ import { Text } from '../Typography';
32
+ import { InputContainer, useTheme, Popover, getFocusableElements, getRandomValue, } from '../utils';
33
+ import SvgCaretDownSmall from '@itwin/itwinui-icons-react/cjs/icons/CaretDownSmall';
34
+ import 'tippy.js/animations/shift-away.css';
35
+ /**
36
+ * ComboBox component that allows typing a value to filter the options in dropdown list.
37
+ * Values can be selected either using mouse clicks or using the Enter key.
38
+ * @example
39
+ * <ComboBox
40
+ * options={[
41
+ * { label: 'Item 1', value: 1 },
42
+ * { label: 'Item 2', value: 2 },
43
+ * { label: 'Item 3', value: 3 },
44
+ * ]}
45
+ * onChange={() => {}}
46
+ * />
47
+ */
48
+ export var ComboBox = function (props) {
49
+ var options = props.options, value = props.value, onChange = props.onChange, filterFunction = props.filterFunction, className = props.className, inputProps = props.inputProps, dropdownMenuProps = props.dropdownMenuProps, _a = props.emptyStateMessage, emptyStateMessage = _a === void 0 ? 'No options found' : _a, rest = __rest(props, ["options", "value", "onChange", "filterFunction", "className", "inputProps", "dropdownMenuProps", "emptyStateMessage"]);
50
+ // Generate a stateful random id if not specified
51
+ var id = React.useState(function () { var _a, _b; return (_b = (_a = props.id) !== null && _a !== void 0 ? _a : (inputProps === null || inputProps === void 0 ? void 0 : inputProps.id) + "-cb") !== null && _b !== void 0 ? _b : "iui-cb-" + getRandomValue(10); })[0];
52
+ useTheme();
53
+ /** Generates a memoized id for an option, given the index from original list */
54
+ var getOptionId = React.useCallback(function (index) {
55
+ var _a;
56
+ return (_a = options[index].id) !== null && _a !== void 0 ? _a : id + "-option" + options.findIndex(function (_a) {
57
+ var value = _a.value;
58
+ return value === options[index].value;
59
+ });
60
+ }, [options, id]);
61
+ var memoizedItems = React.useMemo(function () {
62
+ return options.map(function (_a, index) {
63
+ var label = _a.label, value = _a.value, rest = __rest(_a, ["label", "value"]);
64
+ return (React.createElement(MenuItem, __assign({ id: getOptionId(index), key: getOptionId(index), value: value, role: 'option', onClick: function (value) {
65
+ setSelectedValue(value);
66
+ setIsOpen(false);
67
+ } }, rest), label));
68
+ });
69
+ }, [options, getOptionId]);
70
+ var inputRef = React.useRef(null);
71
+ var menuRef = React.useRef(null);
72
+ var toggleButtonRef = React.useRef(null);
73
+ var _b = React.useState(false), isOpen = _b[0], setIsOpen = _b[1];
74
+ // Set min-width of menu to be same as input
75
+ var _c = React.useState(0), minWidth = _c[0], setMinWidth = _c[1];
76
+ React.useEffect(function () {
77
+ if (inputRef.current) {
78
+ setMinWidth(inputRef.current.offsetWidth);
79
+ }
80
+ }, [isOpen]);
81
+ var _d = React.useState(options), filteredOptions = _d[0], setFilteredOptions = _d[1];
82
+ var _e = React.useState(function () {
83
+ return options.findIndex(function (option) { return value === option.value; });
84
+ }), focusedIndex = _e[0], setFocusedIndex = _e[1];
85
+ // Maintain internal selected value state synced with `value` prop
86
+ var _f = React.useState(), selectedValue = _f[0], setSelectedValue = _f[1];
87
+ React.useEffect(function () {
88
+ setSelectedValue(value);
89
+ }, [value]);
90
+ // Controlled input value
91
+ var _g = React.useState(''), inputValue = _g[0], setInputValue = _g[1];
92
+ var onInput = React.useCallback(function (event) {
93
+ var _a;
94
+ setInputValue(event.target.value);
95
+ (_a = inputProps === null || inputProps === void 0 ? void 0 : inputProps.onChange) === null || _a === void 0 ? void 0 : _a.call(inputProps, event);
96
+ }, [inputProps]);
97
+ // Fire onChange callback and update inputValue every time selected value changes
98
+ React.useEffect(function () {
99
+ var _a, _b;
100
+ if (selectedValue != undefined) {
101
+ onChange === null || onChange === void 0 ? void 0 : onChange(selectedValue);
102
+ setInputValue((_b = (_a = options.find(function (_a) {
103
+ var value = _a.value;
104
+ return value === selectedValue;
105
+ })) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : '');
106
+ }
107
+ }, [selectedValue, onChange, options]);
108
+ // Filter options and update focus when input value changes
109
+ React.useEffect(function () {
110
+ var _a;
111
+ if (!isOpen) {
112
+ return;
113
+ }
114
+ // if input is empty or same as selected value, show the whole list
115
+ var selectedOption = options.find(function (_a) {
116
+ var value = _a.value;
117
+ return value === selectedValue;
118
+ });
119
+ if (!inputValue || (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label) === inputValue) {
120
+ setFilteredOptions(options);
121
+ return;
122
+ }
123
+ var _filteredOptions = (_a = filterFunction === null || filterFunction === void 0 ? void 0 : filterFunction(options, inputValue)) !== null && _a !== void 0 ? _a : options.filter(function (option) {
124
+ return option.label.toLowerCase().includes(inputValue === null || inputValue === void 0 ? void 0 : inputValue.trim().toLowerCase());
125
+ });
126
+ setFilteredOptions(_filteredOptions);
127
+ setFocusedIndex(function (previouslyFocusedIndex) {
128
+ if (_filteredOptions.includes(options[previouslyFocusedIndex])) {
129
+ return previouslyFocusedIndex;
130
+ }
131
+ else if (_filteredOptions.find(function (_a) {
132
+ var value = _a.value;
133
+ return value === selectedValue;
134
+ })) {
135
+ return options.findIndex(function (_a) {
136
+ var value = _a.value;
137
+ return value === selectedValue;
138
+ });
139
+ }
140
+ else {
141
+ return -1; // reset focus if previously focused or selected value is not in filtered list
142
+ }
143
+ });
144
+ }, [inputValue, options, selectedValue, isOpen, filterFunction]);
145
+ var onKeyDown = React.useCallback(function (event) {
146
+ var focusableOptions = getFocusableElements(menuRef.current);
147
+ var focusedIndexInFilteredList = focusableOptions.findIndex(function (_a) {
148
+ var _b;
149
+ var id = _a.id;
150
+ return id === ((_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.getAttribute('aria-activedescendant'));
151
+ });
152
+ switch (event.key) {
153
+ case 'ArrowDown':
154
+ if (isOpen) {
155
+ var nextIndex_1 = Math.min(focusedIndexInFilteredList + 1, focusableOptions.length - 1);
156
+ setFocusedIndex(options.findIndex(function (_, index) {
157
+ return getOptionId(index) === focusableOptions[nextIndex_1].id;
158
+ }));
159
+ }
160
+ else {
161
+ setIsOpen(true); // reopen menu if closed when typing
162
+ }
163
+ event.preventDefault();
164
+ event.stopPropagation();
165
+ break;
166
+ case 'ArrowUp':
167
+ if (isOpen) {
168
+ var previousIndex_1 = Math.max(focusedIndexInFilteredList - 1, 0);
169
+ setFocusedIndex(options.findIndex(function (_, index) {
170
+ return getOptionId(index) === focusableOptions[previousIndex_1].id;
171
+ }));
172
+ }
173
+ event.preventDefault();
174
+ event.stopPropagation();
175
+ break;
176
+ case 'Enter':
177
+ if (isOpen) {
178
+ setSelectedValue(options[focusedIndex].value);
179
+ }
180
+ setIsOpen(function (open) { return !open; });
181
+ event.preventDefault();
182
+ event.stopPropagation();
183
+ break;
184
+ case 'Escape':
185
+ setIsOpen(false);
186
+ event.preventDefault();
187
+ event.stopPropagation();
188
+ break;
189
+ case 'Tab':
190
+ setIsOpen(false);
191
+ break;
192
+ default:
193
+ if (!isOpen) {
194
+ setIsOpen(true); // reopen menu if closed when typing
195
+ }
196
+ break;
197
+ }
198
+ }, [focusedIndex, isOpen, options, getOptionId]);
199
+ var menuItems = React.useMemo(function () {
200
+ if (filteredOptions.length === 0) {
201
+ return (React.createElement(MenuItem, { className: 'iui-menu-content', role: 'presentation' },
202
+ React.createElement(Text, { isMuted: true }, emptyStateMessage)));
203
+ }
204
+ return filteredOptions.map(function (option) {
205
+ var index = options.findIndex(function (_a) {
206
+ var value = _a.value;
207
+ return option.value === value;
208
+ });
209
+ return focusedIndex !== index && selectedValue !== option.value
210
+ ? memoizedItems[index]
211
+ : React.cloneElement(memoizedItems[index], {
212
+ className: cx({ 'iui-focused': focusedIndex === index }),
213
+ isSelected: selectedValue === option.value,
214
+ ref: function (el) {
215
+ return focusedIndex === index && (el === null || el === void 0 ? void 0 : el.scrollIntoView(false));
216
+ },
217
+ });
218
+ });
219
+ }, [
220
+ filteredOptions,
221
+ emptyStateMessage,
222
+ options,
223
+ focusedIndex,
224
+ selectedValue,
225
+ memoizedItems,
226
+ ]);
227
+ return (React.createElement(InputContainer, __assign({ className: className, isIconInline: true, icon: React.createElement("span", { ref: toggleButtonRef, className: cx('iui-actionable', { 'iui-open': isOpen }), onClick: function () {
228
+ var _a;
229
+ if (isOpen) {
230
+ setIsOpen(false);
231
+ }
232
+ else {
233
+ (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
234
+ }
235
+ } },
236
+ React.createElement(SvgCaretDownSmall, { "aria-hidden": true })) }, rest, { id: id }),
237
+ React.createElement(Popover, __assign({ placement: 'bottom-start', visible: isOpen, onClickOutside: function (_, _a) {
238
+ var _b;
239
+ var target = _a.target;
240
+ if (!((_b = toggleButtonRef.current) === null || _b === void 0 ? void 0 : _b.contains(target))) {
241
+ setIsOpen(false);
242
+ }
243
+ }, animation: 'shift-away', duration: 200 }, dropdownMenuProps, { content: React.createElement(Menu, { id: id + "-list", className: 'iui-scroll', style: {
244
+ minWidth: minWidth,
245
+ maxWidth: "min(" + minWidth * 2 + "px, 90vw)",
246
+ maxHeight: 300,
247
+ }, setFocus: false, role: 'listbox', ref: menuRef }, menuItems), onHide: function (instance) {
248
+ var _a;
249
+ var selectedIndex = options.findIndex(function (_a) {
250
+ var value = _a.value;
251
+ return value === selectedValue;
252
+ });
253
+ setFocusedIndex(selectedIndex);
254
+ if (selectedIndex > -1) {
255
+ setInputValue(options[selectedIndex].label); // update input value to be same as selected value
256
+ }
257
+ (_a = dropdownMenuProps === null || dropdownMenuProps === void 0 ? void 0 : dropdownMenuProps.onHide) === null || _a === void 0 ? void 0 : _a.call(dropdownMenuProps, instance);
258
+ } }),
259
+ React.createElement(Input, __assign({ ref: inputRef, onKeyDown: onKeyDown, onFocus: function () { return setIsOpen(true); }, onChange: onInput, value: inputValue, "aria-activedescendant": isOpen && focusedIndex > -1 ? getOptionId(focusedIndex) : undefined, role: 'combobox', "aria-controls": isOpen ? id + "-list" : undefined, "aria-autocomplete": 'list', spellCheck: false, autoCapitalize: 'none', autoCorrect: 'off' }, inputProps)))));
260
+ };
261
+ export default ComboBox;
@@ -0,0 +1,4 @@
1
+ export { ComboBox } from './ComboBox';
2
+ export type { ComboBoxProps } from './ComboBox';
3
+ declare const _default: "./ComboBox";
4
+ export default _default;
@@ -0,0 +1,6 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ export { ComboBox } from './ComboBox';
6
+ export default './ComboBox';
@@ -28,7 +28,7 @@ import SvgChevronLeft from '@itwin/itwinui-icons-react/cjs/icons/ChevronLeft';
28
28
  import SvgChevronRight from '@itwin/itwinui-icons-react/cjs/icons/ChevronRight';
29
29
  import cx from 'classnames';
30
30
  import React from 'react';
31
- import { useTheme } from '../utils/hooks/useTheme';
31
+ import { useTheme } from '../utils';
32
32
  import '@itwin/itwinui-css/css/date-picker.css';
33
33
  import { IconButton } from '../Buttons/IconButton';
34
34
  import { TimePicker } from '../TimePicker';
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
- import { CommonProps } from '../utils/props';
3
- import { PopoverProps } from '../utils/Popover';
2
+ import { CommonProps, PopoverProps } from '../utils';
4
3
  export declare type DropdownMenuProps = {
5
4
  /**
6
5
  * List of menu items. Recommended to use MenuItem component.
@@ -25,10 +25,8 @@ var __rest = (this && this.__rest) || function (s, e) {
25
25
  * See LICENSE.md in the project root for license terms and full copyright notice.
26
26
  *--------------------------------------------------------------------------------------------*/
27
27
  import React from 'react';
28
- import { useTheme } from '../utils/hooks/useTheme';
28
+ import { useTheme, Popover, mergeRefs, } from '../utils';
29
29
  import { Menu } from '../Menu';
30
- import { Popover } from '../utils/Popover';
31
- import { mergeRefs } from '../utils/hooks/useMergedRefs';
32
30
  /**
33
31
  * Dropdown menu component.
34
32
  * Uses the {@link Popover} component, which is a wrapper around [tippy.js](https://atomiks.github.io/tippyjs).
@@ -33,7 +33,7 @@ import Svg503 from '@itwin/itwinui-illustrations-react/cjs/illustrations/503';
33
33
  import SvgError from '@itwin/itwinui-illustrations-react/cjs/illustrations/Error';
34
34
  import React from 'react';
35
35
  import { Button } from '../Buttons/Button';
36
- import { useTheme } from '../utils/hooks/useTheme';
36
+ import { useTheme } from '../utils';
37
37
  import '@itwin/itwinui-css/css/non-ideal-state.css';
38
38
  /**
39
39
  * A stylized display to communicate common http errors.
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { CommonProps } from '../utils/props';
2
+ import { CommonProps } from '../utils';
3
3
  import '@itwin/itwinui-css/css/expandable-block.css';
4
4
  export declare type ExpandableBlockProps = {
5
5
  /**
@@ -28,9 +28,8 @@ import SvgChevronRight from '@itwin/itwinui-icons-react/cjs/icons/ChevronRight';
28
28
  import cx from 'classnames';
29
29
  import React from 'react';
30
30
  import { CSSTransition } from 'react-transition-group';
31
- import { useTheme } from '../utils/hooks/useTheme';
31
+ import { useTheme, StatusIconMap } from '../utils';
32
32
  import '@itwin/itwinui-css/css/expandable-block.css';
33
- import { StatusIconMap } from '../utils/common';
34
33
  /**
35
34
  * Container that allows content to be hidden behind a brief title and a caption.
36
35
  * @example
@@ -25,7 +25,7 @@ var __rest = (this && this.__rest) || function (s, e) {
25
25
  * See LICENSE.md in the project root for license terms and full copyright notice.
26
26
  *--------------------------------------------------------------------------------------------*/
27
27
  import React from 'react';
28
- import { useTheme } from '../utils/hooks/useTheme';
28
+ import { useTheme } from '../utils';
29
29
  import cx from 'classnames';
30
30
  import '@itwin/itwinui-css/css/fieldset.css';
31
31
  /**
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { CommonProps } from '../utils/props';
2
+ import { CommonProps } from '../utils';
3
3
  import '@itwin/itwinui-css/css/file-upload.css';
4
4
  export declare type FileUploadProps = {
5
5
  /**
@@ -46,5 +46,5 @@ export declare const FileUpload: React.ForwardRefExoticComponent<{
46
46
  id?: string | undefined;
47
47
  } & {
48
48
  style?: React.CSSProperties | undefined;
49
- } & import("../utils/props").ClassNameProps & React.RefAttributes<HTMLDivElement>>;
49
+ } & import("../utils").ClassNameProps & React.RefAttributes<HTMLDivElement>>;
50
50
  export default FileUpload;
@@ -26,8 +26,7 @@ var __rest = (this && this.__rest) || function (s, e) {
26
26
  *--------------------------------------------------------------------------------------------*/
27
27
  import React from 'react';
28
28
  import cx from 'classnames';
29
- import { useTheme } from '../utils/hooks/useTheme';
30
- import { useMergedRefs } from '../utils/hooks/useMergedRefs';
29
+ import { useTheme, useMergedRefs } from '../utils';
31
30
  import '@itwin/itwinui-css/css/file-upload.css';
32
31
  /**
33
32
  * File upload component to be wrapped around `FileUploadTemplate` or any arbitrary component.
@@ -3,7 +3,7 @@
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  import React from 'react';
6
- import { useTheme } from '../utils/hooks/useTheme';
6
+ import { useTheme } from '../utils';
7
7
  import '@itwin/itwinui-css/css/file-upload.css';
8
8
  import SvgUpload from '@itwin/itwinui-icons-react/cjs/icons/Upload';
9
9
  /**
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
+ import { StylingProps } from '../utils';
2
3
  import '@itwin/itwinui-css/css/footer.css';
3
- import { StylingProps } from '../utils/props';
4
4
  export declare type TitleTranslations = {
5
5
  termsOfService: string;
6
6
  privacy: string;
@@ -35,7 +35,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
35
35
  *--------------------------------------------------------------------------------------------*/
36
36
  import React from 'react';
37
37
  import cx from 'classnames';
38
- import { useTheme } from '../utils/hooks/useTheme';
38
+ import { useTheme } from '../utils';
39
39
  import '@itwin/itwinui-css/css/footer.css';
40
40
  var footerTranslations = {
41
41
  cookies: 'Cookies',
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
+ import { CommonProps } from '../utils';
2
3
  import '@itwin/itwinui-css/css/header.css';
3
- import { CommonProps } from '../utils/props';
4
4
  export declare type HeaderTranslations = {
5
5
  /**
6
6
  * 'More' menu button aria-label.