@itwin/itwinui-react 3.0.0-dev.4 → 3.0.0-dev.5

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 (929) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/cjs/core/Alert/Alert.d.ts +5 -5
  3. package/cjs/core/Alert/Alert.js +72 -59
  4. package/cjs/core/Alert/index.js +9 -4
  5. package/cjs/core/Avatar/Avatar.d.ts +3 -3
  6. package/cjs/core/Avatar/Avatar.js +60 -44
  7. package/cjs/core/Avatar/index.js +9 -4
  8. package/cjs/core/AvatarGroup/AvatarGroup.d.ts +1 -1
  9. package/cjs/core/AvatarGroup/AvatarGroup.js +69 -53
  10. package/cjs/core/AvatarGroup/index.js +9 -4
  11. package/cjs/core/Backdrop/Backdrop.d.ts +1 -1
  12. package/cjs/core/Backdrop/Backdrop.js +16 -33
  13. package/cjs/core/Backdrop/index.js +9 -4
  14. package/cjs/core/Badge/Badge.d.ts +1 -1
  15. package/cjs/core/Badge/Badge.js +39 -47
  16. package/cjs/core/Badge/index.js +9 -4
  17. package/cjs/core/Breadcrumbs/Breadcrumbs.d.ts +16 -24
  18. package/cjs/core/Breadcrumbs/Breadcrumbs.js +131 -61
  19. package/cjs/core/Breadcrumbs/index.js +9 -4
  20. package/cjs/core/ButtonGroup/ButtonGroup.d.ts +1 -1
  21. package/cjs/core/ButtonGroup/ButtonGroup.js +65 -53
  22. package/cjs/core/ButtonGroup/index.js +9 -4
  23. package/cjs/core/Buttons/Button/Button.d.ts +1 -1
  24. package/cjs/core/Buttons/Button/Button.js +43 -36
  25. package/cjs/core/Buttons/Button/index.js +9 -4
  26. package/cjs/core/Buttons/DropdownButton/DropdownButton.d.ts +1 -1
  27. package/cjs/core/Buttons/DropdownButton/DropdownButton.js +61 -51
  28. package/cjs/core/Buttons/DropdownButton/index.js +9 -4
  29. package/cjs/core/Buttons/IconButton/IconButton.d.ts +1 -1
  30. package/cjs/core/Buttons/IconButton/IconButton.js +59 -38
  31. package/cjs/core/Buttons/IconButton/index.js +9 -4
  32. package/cjs/core/Buttons/IdeasButton/IdeasButton.d.ts +1 -1
  33. package/cjs/core/Buttons/IdeasButton/IdeasButton.js +20 -30
  34. package/cjs/core/Buttons/IdeasButton/index.js +9 -4
  35. package/cjs/core/Buttons/SplitButton/SplitButton.d.ts +1 -1
  36. package/cjs/core/Buttons/SplitButton/SplitButton.js +68 -49
  37. package/cjs/core/Buttons/SplitButton/index.js +9 -4
  38. package/cjs/core/Buttons/index.js +43 -13
  39. package/cjs/core/Carousel/Carousel.d.ts +3 -3
  40. package/cjs/core/Carousel/Carousel.js +109 -107
  41. package/cjs/core/Carousel/CarouselContext.js +4 -26
  42. package/cjs/core/Carousel/CarouselDot.d.ts +1 -1
  43. package/cjs/core/Carousel/CarouselDot.js +25 -37
  44. package/cjs/core/Carousel/CarouselDotsList.d.ts +1 -1
  45. package/cjs/core/Carousel/CarouselDotsList.js +129 -95
  46. package/cjs/core/Carousel/CarouselNavigation.d.ts +2 -2
  47. package/cjs/core/Carousel/CarouselNavigation.js +97 -66
  48. package/cjs/core/Carousel/CarouselSlide.d.ts +1 -1
  49. package/cjs/core/Carousel/CarouselSlide.js +39 -46
  50. package/cjs/core/Carousel/CarouselSlider.js +66 -71
  51. package/cjs/core/Carousel/index.js +9 -4
  52. package/cjs/core/Checkbox/Checkbox.d.ts +9 -5
  53. package/cjs/core/Checkbox/Checkbox.js +88 -60
  54. package/cjs/core/Checkbox/index.js +9 -4
  55. package/cjs/core/ColorPicker/ColorBuilder.js +289 -198
  56. package/cjs/core/ColorPicker/ColorInputPanel.d.ts +1 -1
  57. package/cjs/core/ColorPicker/ColorInputPanel.js +453 -282
  58. package/cjs/core/ColorPicker/ColorPalette.d.ts +1 -1
  59. package/cjs/core/ColorPicker/ColorPalette.js +124 -113
  60. package/cjs/core/ColorPicker/ColorPicker.d.ts +1 -6
  61. package/cjs/core/ColorPicker/ColorPicker.js +82 -85
  62. package/cjs/core/ColorPicker/ColorPickerContext.js +11 -31
  63. package/cjs/core/ColorPicker/ColorSwatch.d.ts +1 -1
  64. package/cjs/core/ColorPicker/ColorSwatch.js +30 -39
  65. package/cjs/core/ColorPicker/index.js +43 -13
  66. package/cjs/core/ComboBox/ComboBox.d.ts +6 -6
  67. package/cjs/core/ComboBox/ComboBox.js +393 -294
  68. package/cjs/core/ComboBox/ComboBoxDropdown.d.ts +1 -1
  69. package/cjs/core/ComboBox/ComboBoxDropdown.js +39 -42
  70. package/cjs/core/ComboBox/ComboBoxEndIcon.d.ts +1 -1
  71. package/cjs/core/ComboBox/ComboBoxEndIcon.js +46 -43
  72. package/cjs/core/ComboBox/ComboBoxInput.d.ts +2 -2
  73. package/cjs/core/ComboBox/ComboBoxInput.js +200 -152
  74. package/cjs/core/ComboBox/ComboBoxInputContainer.d.ts +1 -1
  75. package/cjs/core/ComboBox/ComboBoxInputContainer.js +35 -34
  76. package/cjs/core/ComboBox/ComboBoxMenu.d.ts +1 -1
  77. package/cjs/core/ComboBox/ComboBoxMenu.js +108 -73
  78. package/cjs/core/ComboBox/ComboBoxMenuItem.d.ts +1 -1
  79. package/cjs/core/ComboBox/ComboBoxMenuItem.js +71 -42
  80. package/cjs/core/ComboBox/ComboBoxMultipleContainer.d.ts +1 -1
  81. package/cjs/core/ComboBox/ComboBoxMultipleContainer.js +13 -32
  82. package/cjs/core/ComboBox/helpers.d.ts +2 -2
  83. package/cjs/core/ComboBox/helpers.js +47 -65
  84. package/cjs/core/ComboBox/index.js +9 -4
  85. package/cjs/core/DatePicker/DatePicker.d.ts +2 -2
  86. package/cjs/core/DatePicker/DatePicker.js +523 -357
  87. package/cjs/core/DatePicker/index.js +15 -5
  88. package/cjs/core/Dialog/Dialog.d.ts +1 -1
  89. package/cjs/core/Dialog/Dialog.js +72 -68
  90. package/cjs/core/Dialog/DialogBackdrop.d.ts +1 -1
  91. package/cjs/core/Dialog/DialogBackdrop.js +47 -52
  92. package/cjs/core/Dialog/DialogButtonBar.js +3 -3
  93. package/cjs/core/Dialog/DialogContent.js +3 -3
  94. package/cjs/core/Dialog/DialogContext.d.ts +1 -1
  95. package/cjs/core/Dialog/DialogContext.js +5 -27
  96. package/cjs/core/Dialog/DialogDragContext.d.ts +1 -1
  97. package/cjs/core/Dialog/DialogDragContext.js +8 -30
  98. package/cjs/core/Dialog/DialogMain.d.ts +1 -1
  99. package/cjs/core/Dialog/DialogMain.js +184 -142
  100. package/cjs/core/Dialog/DialogTitleBar.d.ts +1 -1
  101. package/cjs/core/Dialog/DialogTitleBar.js +67 -45
  102. package/cjs/core/Dialog/DialogTitleBarTitle.js +3 -3
  103. package/cjs/core/Dialog/index.js +9 -4
  104. package/cjs/core/DropdownMenu/DropdownMenu.d.ts +4 -4
  105. package/cjs/core/DropdownMenu/DropdownMenu.js +72 -50
  106. package/cjs/core/DropdownMenu/index.js +9 -4
  107. package/cjs/core/ExpandableBlock/ExpandableBlock.d.ts +77 -21
  108. package/cjs/core/ExpandableBlock/ExpandableBlock.js +233 -76
  109. package/cjs/core/ExpandableBlock/index.js +9 -4
  110. package/cjs/core/Fieldset/Fieldset.d.ts +1 -1
  111. package/cjs/core/Fieldset/Fieldset.js +25 -39
  112. package/cjs/core/Fieldset/index.js +9 -4
  113. package/cjs/core/FileUpload/FileEmptyCard.js +43 -42
  114. package/cjs/core/FileUpload/FileUpload.d.ts +1 -1
  115. package/cjs/core/FileUpload/FileUpload.js +67 -67
  116. package/cjs/core/FileUpload/FileUploadCard.d.ts +1 -1
  117. package/cjs/core/FileUpload/FileUploadCard.js +168 -108
  118. package/cjs/core/FileUpload/FileUploadTemplate.d.ts +1 -1
  119. package/cjs/core/FileUpload/FileUploadTemplate.js +51 -41
  120. package/cjs/core/FileUpload/index.js +35 -11
  121. package/cjs/core/Footer/Footer.d.ts +4 -4
  122. package/cjs/core/Footer/Footer.js +103 -89
  123. package/cjs/core/Footer/FooterItem.js +3 -3
  124. package/cjs/core/Footer/FooterList.js +3 -3
  125. package/cjs/core/Footer/FooterSeparator.js +8 -5
  126. package/cjs/core/Footer/index.js +15 -5
  127. package/cjs/core/Header/Header.d.ts +2 -2
  128. package/cjs/core/Header/Header.js +67 -47
  129. package/cjs/core/Header/HeaderBasicButton.js +37 -38
  130. package/cjs/core/Header/HeaderBreadcrumbs.d.ts +1 -1
  131. package/cjs/core/Header/HeaderBreadcrumbs.js +38 -39
  132. package/cjs/core/Header/HeaderButton.d.ts +1 -1
  133. package/cjs/core/Header/HeaderButton.js +74 -43
  134. package/cjs/core/Header/HeaderDropdownButton.js +49 -45
  135. package/cjs/core/Header/HeaderLogo.d.ts +1 -1
  136. package/cjs/core/Header/HeaderLogo.js +42 -36
  137. package/cjs/core/Header/HeaderSplitButton.js +68 -46
  138. package/cjs/core/Header/index.js +35 -11
  139. package/cjs/core/InformationPanel/InformationPanel.d.ts +1 -1
  140. package/cjs/core/InformationPanel/InformationPanel.js +77 -67
  141. package/cjs/core/InformationPanel/InformationPanelBody.js +6 -4
  142. package/cjs/core/InformationPanel/InformationPanelContent.d.ts +1 -1
  143. package/cjs/core/InformationPanel/InformationPanelContent.js +20 -33
  144. package/cjs/core/InformationPanel/InformationPanelHeader.d.ts +1 -1
  145. package/cjs/core/InformationPanel/InformationPanelHeader.js +34 -39
  146. package/cjs/core/InformationPanel/InformationPanelWrapper.js +6 -4
  147. package/cjs/core/InformationPanel/index.js +43 -13
  148. package/cjs/core/Input/Input.d.ts +1 -6
  149. package/cjs/core/Input/Input.js +16 -40
  150. package/cjs/core/Input/index.js +9 -4
  151. package/cjs/core/InputGroup/InputGroup.d.ts +1 -1
  152. package/cjs/core/InputGroup/InputGroup.js +46 -41
  153. package/cjs/core/InputGroup/index.js +9 -4
  154. package/cjs/core/Label/Label.d.ts +1 -1
  155. package/cjs/core/Label/Label.js +30 -36
  156. package/cjs/core/Label/index.js +9 -4
  157. package/cjs/core/LabeledInput/LabeledInput.d.ts +1 -1
  158. package/cjs/core/LabeledInput/LabeledInput.js +49 -33
  159. package/cjs/core/LabeledInput/index.js +9 -4
  160. package/cjs/core/LabeledSelect/LabeledSelect.d.ts +1 -1
  161. package/cjs/core/LabeledSelect/LabeledSelect.js +56 -44
  162. package/cjs/core/LabeledSelect/index.js +9 -4
  163. package/cjs/core/LabeledTextarea/LabeledTextarea.d.ts +2 -3
  164. package/cjs/core/LabeledTextarea/LabeledTextarea.js +49 -33
  165. package/cjs/core/LabeledTextarea/index.js +9 -4
  166. package/cjs/core/List/List.js +3 -3
  167. package/cjs/core/List/ListItem.d.ts +4 -4
  168. package/cjs/core/List/ListItem.js +55 -60
  169. package/cjs/core/List/index.js +16 -6
  170. package/cjs/core/Menu/Menu.d.ts +1 -1
  171. package/cjs/core/Menu/Menu.js +66 -78
  172. package/cjs/core/Menu/MenuDivider.js +4 -4
  173. package/cjs/core/Menu/MenuExtraContent.js +4 -4
  174. package/cjs/core/Menu/MenuItem.d.ts +1 -1
  175. package/cjs/core/Menu/MenuItem.js +143 -86
  176. package/cjs/core/Menu/MenuItemSkeleton.d.ts +1 -1
  177. package/cjs/core/Menu/MenuItemSkeleton.js +54 -43
  178. package/cjs/core/Menu/index.js +43 -13
  179. package/cjs/core/Modal/Modal.d.ts +1 -1
  180. package/cjs/core/Modal/Modal.js +38 -33
  181. package/cjs/core/Modal/ModalButtonBar.js +7 -4
  182. package/cjs/core/Modal/ModalContent.js +3 -3
  183. package/cjs/core/Modal/index.js +23 -8
  184. package/cjs/core/NonIdealState/ErrorPage.d.ts +6 -7
  185. package/cjs/core/NonIdealState/ErrorPage.js +187 -146
  186. package/cjs/core/NonIdealState/NonIdealState.d.ts +17 -1
  187. package/cjs/core/NonIdealState/NonIdealState.js +77 -37
  188. package/cjs/core/NonIdealState/index.js +16 -6
  189. package/cjs/core/NotificationMarker/NotificationMarker.d.ts +1 -1
  190. package/cjs/core/NotificationMarker/NotificationMarker.js +29 -33
  191. package/cjs/core/NotificationMarker/index.js +9 -4
  192. package/cjs/core/Overlay/Overlay.d.ts +57 -0
  193. package/cjs/core/Overlay/Overlay.js +96 -0
  194. package/cjs/core/Overlay/index.d.ts +1 -0
  195. package/{esm/core/ProgressIndicators/ProgressRadial → cjs/core/Overlay}/index.js +10 -2
  196. package/cjs/core/ProgressIndicators/{ProgressLinear/ProgressLinear.d.ts → ProgressLinear.d.ts} +6 -6
  197. package/cjs/core/ProgressIndicators/ProgressLinear.js +64 -0
  198. package/cjs/core/ProgressIndicators/{ProgressRadial/ProgressRadial.d.ts → ProgressRadial.d.ts} +2 -2
  199. package/cjs/core/ProgressIndicators/ProgressRadial.js +74 -0
  200. package/cjs/core/ProgressIndicators/index.d.ts +2 -2
  201. package/cjs/core/ProgressIndicators/index.js +16 -6
  202. package/cjs/core/Radio/Radio.d.ts +1 -6
  203. package/cjs/core/Radio/Radio.js +41 -42
  204. package/cjs/core/Radio/index.js +9 -4
  205. package/cjs/core/RadioTiles/RadioTile.d.ts +1 -6
  206. package/cjs/core/RadioTiles/RadioTile.js +46 -45
  207. package/cjs/core/RadioTiles/RadioTileGroup.d.ts +1 -1
  208. package/cjs/core/RadioTiles/RadioTileGroup.js +16 -31
  209. package/cjs/core/RadioTiles/index.js +16 -6
  210. package/cjs/core/SearchBox/SearchBox.d.ts +3 -3
  211. package/cjs/core/SearchBox/SearchBox.js +220 -128
  212. package/cjs/core/SearchBox/index.js +9 -4
  213. package/cjs/core/Select/Select.d.ts +5 -10
  214. package/cjs/core/Select/Select.js +291 -181
  215. package/cjs/core/Select/SelectTag.d.ts +1 -1
  216. package/cjs/core/Select/SelectTag.js +21 -34
  217. package/cjs/core/Select/SelectTagContainer.d.ts +1 -1
  218. package/cjs/core/Select/SelectTagContainer.js +30 -39
  219. package/cjs/core/Select/index.js +9 -4
  220. package/cjs/core/SideNavigation/SideNavigation.d.ts +1 -1
  221. package/cjs/core/SideNavigation/SideNavigation.js +105 -54
  222. package/cjs/core/SideNavigation/SidenavButton.d.ts +1 -1
  223. package/cjs/core/SideNavigation/SidenavButton.js +30 -33
  224. package/cjs/core/SideNavigation/SidenavSubmenu.js +23 -34
  225. package/cjs/core/SideNavigation/SidenavSubmenuHeader.d.ts +1 -1
  226. package/cjs/core/SideNavigation/SidenavSubmenuHeader.js +29 -35
  227. package/cjs/core/SideNavigation/index.js +35 -11
  228. package/cjs/core/SkipToContentLink/SkipToContentLink.d.ts +1 -1
  229. package/cjs/core/SkipToContentLink/SkipToContentLink.js +20 -33
  230. package/cjs/core/SkipToContentLink/index.js +9 -4
  231. package/cjs/core/Slider/Slider.d.ts +4 -9
  232. package/cjs/core/Slider/Slider.js +343 -227
  233. package/cjs/core/Slider/Thumb.d.ts +2 -2
  234. package/cjs/core/Slider/Thumb.js +111 -84
  235. package/cjs/core/Slider/Track.d.ts +3 -3
  236. package/cjs/core/Slider/Track.js +72 -76
  237. package/cjs/core/Slider/index.js +9 -4
  238. package/cjs/core/StatusMessage/StatusMessage.d.ts +2 -2
  239. package/cjs/core/StatusMessage/StatusMessage.js +19 -32
  240. package/cjs/core/StatusMessage/index.js +9 -4
  241. package/cjs/core/Stepper/Stepper.d.ts +3 -3
  242. package/cjs/core/Stepper/Stepper.js +51 -36
  243. package/cjs/core/Stepper/StepperStep.d.ts +1 -1
  244. package/cjs/core/Stepper/StepperStep.js +84 -63
  245. package/cjs/core/Stepper/WorkflowDiagram.d.ts +1 -1
  246. package/cjs/core/Stepper/WorkflowDiagram.js +25 -33
  247. package/cjs/core/Stepper/WorkflowDiagramStep.d.ts +3 -3
  248. package/cjs/core/Stepper/WorkflowDiagramStep.js +32 -36
  249. package/cjs/core/Stepper/index.js +16 -6
  250. package/cjs/core/Surface/Surface.d.ts +2 -2
  251. package/cjs/core/Surface/Surface.js +78 -70
  252. package/cjs/core/Surface/index.js +9 -4
  253. package/cjs/core/Table/SubRowExpander.d.ts +2 -2
  254. package/cjs/core/Table/SubRowExpander.js +35 -37
  255. package/cjs/core/Table/Table.d.ts +2 -2
  256. package/cjs/core/Table/Table.js +725 -448
  257. package/cjs/core/Table/TableCell.d.ts +2 -2
  258. package/cjs/core/Table/TableCell.js +113 -88
  259. package/cjs/core/Table/TablePaginator.d.ts +3 -3
  260. package/cjs/core/Table/TablePaginator.js +312 -159
  261. package/cjs/core/Table/TableRowMemoized.d.ts +4 -4
  262. package/cjs/core/Table/TableRowMemoized.js +137 -89
  263. package/cjs/core/Table/actionHandlers/expandHandler.js +12 -12
  264. package/cjs/core/Table/actionHandlers/filterHandler.js +25 -17
  265. package/cjs/core/Table/actionHandlers/index.js +56 -14
  266. package/cjs/core/Table/actionHandlers/resizeHandler.js +13 -13
  267. package/cjs/core/Table/actionHandlers/selectHandler.js +123 -96
  268. package/cjs/core/Table/cells/DefaultCell.d.ts +2 -2
  269. package/cjs/core/Table/cells/DefaultCell.js +48 -38
  270. package/cjs/core/Table/cells/EditableCell.d.ts +2 -2
  271. package/cjs/core/Table/cells/EditableCell.js +75 -68
  272. package/cjs/core/Table/cells/index.js +16 -6
  273. package/cjs/core/Table/columns/actionColumn.d.ts +3 -3
  274. package/cjs/core/Table/columns/actionColumn.js +106 -96
  275. package/cjs/core/Table/columns/expanderColumn.d.ts +2 -2
  276. package/cjs/core/Table/columns/expanderColumn.js +45 -54
  277. package/cjs/core/Table/columns/index.js +41 -11
  278. package/cjs/core/Table/columns/selectionColumn.d.ts +4 -4
  279. package/cjs/core/Table/columns/selectionColumn.js +57 -51
  280. package/cjs/core/Table/filters/BaseFilter.d.ts +2 -2
  281. package/cjs/core/Table/filters/BaseFilter.js +24 -38
  282. package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.d.ts +3 -2
  283. package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.js +92 -72
  284. package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.d.ts +4 -4
  285. package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.js +118 -79
  286. package/cjs/core/Table/filters/FilterButtonBar.d.ts +3 -3
  287. package/cjs/core/Table/filters/FilterButtonBar.js +39 -41
  288. package/cjs/core/Table/filters/FilterToggle.d.ts +3 -3
  289. package/cjs/core/Table/filters/FilterToggle.js +59 -51
  290. package/cjs/core/Table/filters/NumberRangeFilter/NumberRangeFilter.d.ts +4 -4
  291. package/cjs/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +58 -52
  292. package/cjs/core/Table/filters/TextFilter/TextFilter.d.ts +3 -3
  293. package/cjs/core/Table/filters/TextFilter/TextFilter.js +40 -44
  294. package/cjs/core/Table/filters/customFilterFunctions.js +16 -14
  295. package/cjs/core/Table/filters/defaultFilterFunctions.js +86 -81
  296. package/cjs/core/Table/filters/index.js +35 -11
  297. package/cjs/core/Table/filters/tableFilters.d.ts +5 -5
  298. package/cjs/core/Table/filters/tableFilters.js +44 -54
  299. package/cjs/core/Table/filters/types.d.ts +1 -1
  300. package/cjs/core/Table/filters/types.js +2 -2
  301. package/cjs/core/Table/hooks/index.js +67 -19
  302. package/cjs/core/Table/hooks/useColumnDragAndDrop.js +101 -88
  303. package/cjs/core/Table/hooks/useExpanderCell.d.ts +1 -1
  304. package/cjs/core/Table/hooks/useExpanderCell.js +33 -47
  305. package/cjs/core/Table/hooks/useResizeColumns.js +362 -290
  306. package/cjs/core/Table/hooks/useScrollToRow.d.ts +2 -2
  307. package/cjs/core/Table/hooks/useScrollToRow.js +46 -60
  308. package/cjs/core/Table/hooks/useSelectionCell.js +17 -10
  309. package/cjs/core/Table/hooks/useStickyColumns.js +64 -62
  310. package/cjs/core/Table/hooks/useSubRowFiltering.js +95 -110
  311. package/cjs/core/Table/hooks/useSubRowSelection.js +32 -53
  312. package/cjs/core/Table/index.js +78 -18
  313. package/cjs/core/Table/utils.js +42 -40
  314. package/cjs/core/Tabs/Tab.d.ts +2 -2
  315. package/cjs/core/Tabs/Tab.js +51 -38
  316. package/cjs/core/Tabs/Tabs.d.ts +6 -6
  317. package/cjs/core/Tabs/Tabs.js +407 -335
  318. package/cjs/core/Tabs/index.js +16 -6
  319. package/cjs/core/Tag/Tag.d.ts +1 -1
  320. package/cjs/core/Tag/Tag.js +42 -40
  321. package/cjs/core/Tag/TagContainer.d.ts +1 -1
  322. package/cjs/core/Tag/TagContainer.js +23 -36
  323. package/cjs/core/Tag/index.js +16 -6
  324. package/cjs/core/Textarea/Textarea.d.ts +2 -9
  325. package/cjs/core/Textarea/Textarea.js +17 -41
  326. package/cjs/core/Textarea/index.js +9 -4
  327. package/cjs/core/ThemeProvider/ThemeContext.js +4 -26
  328. package/cjs/core/ThemeProvider/ThemeProvider.d.ts +4 -4
  329. package/cjs/core/ThemeProvider/ThemeProvider.js +77 -54
  330. package/cjs/core/ThemeProvider/index.js +9 -4
  331. package/cjs/core/Tile/Tile.d.ts +14 -14
  332. package/cjs/core/Tile/Tile.js +334 -234
  333. package/cjs/core/Tile/index.js +9 -4
  334. package/cjs/core/TimePicker/TimePicker.d.ts +3 -3
  335. package/cjs/core/TimePicker/TimePicker.js +458 -259
  336. package/cjs/core/TimePicker/index.js +9 -4
  337. package/cjs/core/Toast/Toast.d.ts +5 -5
  338. package/cjs/core/Toast/Toast.js +192 -132
  339. package/cjs/core/Toast/Toaster.d.ts +5 -5
  340. package/cjs/core/Toast/Toaster.js +103 -100
  341. package/cjs/core/Toast/index.js +9 -4
  342. package/cjs/core/ToggleSwitch/ToggleSwitch.d.ts +1 -6
  343. package/cjs/core/ToggleSwitch/ToggleSwitch.js +66 -53
  344. package/cjs/core/ToggleSwitch/index.js +9 -4
  345. package/cjs/core/Tooltip/Tooltip.d.ts +2 -2
  346. package/cjs/core/Tooltip/Tooltip.js +146 -121
  347. package/cjs/core/Tooltip/index.js +9 -4
  348. package/cjs/core/TransferList/TransferList.d.ts +6 -6
  349. package/cjs/core/TransferList/TransferList.js +184 -103
  350. package/cjs/core/TransferList/index.js +9 -4
  351. package/cjs/core/Tree/Tree.d.ts +5 -5
  352. package/cjs/core/Tree/Tree.js +205 -157
  353. package/cjs/core/Tree/TreeContext.d.ts +1 -1
  354. package/cjs/core/Tree/TreeContext.js +9 -31
  355. package/cjs/core/Tree/TreeNode.d.ts +2 -2
  356. package/cjs/core/Tree/TreeNode.js +207 -129
  357. package/cjs/core/Tree/TreeNodeExpander.d.ts +1 -1
  358. package/cjs/core/Tree/TreeNodeExpander.js +26 -37
  359. package/cjs/core/Tree/index.js +23 -8
  360. package/cjs/core/Typography/Anchor/Anchor.js +3 -3
  361. package/cjs/core/Typography/Anchor/index.js +9 -4
  362. package/cjs/core/Typography/Blockquote/Blockquote.d.ts +1 -1
  363. package/cjs/core/Typography/Blockquote/Blockquote.js +18 -35
  364. package/cjs/core/Typography/Blockquote/index.js +9 -4
  365. package/cjs/core/Typography/Code/Code.js +3 -3
  366. package/cjs/core/Typography/Code/index.js +9 -4
  367. package/cjs/core/Typography/Kbd/Kbd.d.ts +1 -1
  368. package/cjs/core/Typography/Kbd/Kbd.js +30 -46
  369. package/cjs/core/Typography/Kbd/index.js +15 -5
  370. package/cjs/core/Typography/Text/Text.d.ts +1 -1
  371. package/cjs/core/Typography/Text/Text.js +26 -38
  372. package/cjs/core/Typography/Text/index.js +9 -4
  373. package/cjs/core/Typography/index.js +50 -14
  374. package/cjs/core/index.d.ts +1 -0
  375. package/cjs/core/index.js +889 -179
  376. package/cjs/core/utils/color/ColorValue.d.ts +4 -4
  377. package/cjs/core/utils/color/ColorValue.js +535 -453
  378. package/cjs/core/utils/color/index.js +4 -17
  379. package/cjs/core/utils/components/AutoclearingHiddenLiveRegion.d.ts +2 -2
  380. package/cjs/core/utils/components/AutoclearingHiddenLiveRegion.js +20 -35
  381. package/cjs/core/utils/components/Box.js +3 -3
  382. package/cjs/core/utils/components/Divider.d.ts +1 -1
  383. package/cjs/core/utils/components/Divider.js +14 -33
  384. package/cjs/core/utils/components/Flex.d.ts +4 -4
  385. package/cjs/core/utils/components/Flex.js +93 -102
  386. package/cjs/core/utils/components/FocusTrap.d.ts +3 -3
  387. package/cjs/core/utils/components/FocusTrap.js +47 -60
  388. package/cjs/core/utils/components/Icon.d.ts +1 -1
  389. package/cjs/core/utils/components/Icon.js +25 -43
  390. package/cjs/core/utils/components/InputContainer.d.ts +2 -2
  391. package/cjs/core/utils/components/InputContainer.js +75 -46
  392. package/cjs/core/utils/components/InputFlexContainer.d.ts +1 -1
  393. package/cjs/core/utils/components/InputFlexContainer.js +22 -10
  394. package/cjs/core/utils/components/LinkAction.js +3 -3
  395. package/cjs/core/utils/components/MiddleTextTruncation.d.ts +2 -2
  396. package/cjs/core/utils/components/MiddleTextTruncation.js +32 -44
  397. package/cjs/core/utils/components/Popover.d.ts +3 -3
  398. package/cjs/core/utils/components/Popover.js +111 -135
  399. package/cjs/core/utils/components/Resizer.d.ts +2 -2
  400. package/cjs/core/utils/components/Resizer.js +246 -211
  401. package/cjs/core/utils/components/VirtualScroll.d.ts +2 -2
  402. package/cjs/core/utils/components/VirtualScroll.js +304 -245
  403. package/cjs/core/utils/components/VisuallyHidden.d.ts +1 -1
  404. package/cjs/core/utils/components/VisuallyHidden.js +14 -33
  405. package/cjs/core/utils/components/WithCSSTransition.d.ts +2 -2
  406. package/cjs/core/utils/components/WithCSSTransition.js +43 -48
  407. package/cjs/core/utils/components/index.js +18 -31
  408. package/cjs/core/utils/functions/colors.js +36 -33
  409. package/cjs/core/utils/functions/date.js +10 -10
  410. package/cjs/core/utils/functions/dom.js +24 -17
  411. package/cjs/core/utils/functions/focusable.js +26 -17
  412. package/cjs/core/utils/functions/import.d.ts +6 -0
  413. package/cjs/core/utils/functions/import.js +61 -0
  414. package/cjs/core/utils/functions/index.d.ts +1 -0
  415. package/cjs/core/utils/functions/index.js +11 -23
  416. package/cjs/core/utils/functions/numbers.js +9 -9
  417. package/cjs/core/utils/functions/polymorphic.d.ts +5 -3
  418. package/cjs/core/utils/functions/polymorphic.js +43 -55
  419. package/cjs/core/utils/functions/supports.js +5 -4
  420. package/cjs/core/utils/hooks/index.js +16 -29
  421. package/cjs/core/utils/hooks/useContainerWidth.js +26 -41
  422. package/cjs/core/utils/hooks/useDragAndDrop.js +110 -109
  423. package/cjs/core/utils/hooks/useEventListener.js +22 -44
  424. package/cjs/core/utils/hooks/useGlobals.js +34 -51
  425. package/cjs/core/utils/hooks/useId.js +9 -30
  426. package/cjs/core/utils/hooks/useIntersection.js +30 -46
  427. package/cjs/core/utils/hooks/useIsClient.js +9 -31
  428. package/cjs/core/utils/hooks/useIsomorphicLayoutEffect.js +6 -27
  429. package/cjs/core/utils/hooks/useLatestRef.js +9 -31
  430. package/cjs/core/utils/hooks/useMediaQuery.js +31 -53
  431. package/cjs/core/utils/hooks/useMergedRefs.js +15 -38
  432. package/cjs/core/utils/hooks/useOverflow.js +69 -78
  433. package/cjs/core/utils/hooks/useResizeObserver.js +22 -39
  434. package/cjs/core/utils/hooks/useSafeContext.js +9 -31
  435. package/cjs/core/utils/icons/StatusIconMap.d.ts +5 -5
  436. package/cjs/core/utils/icons/StatusIconMap.js +28 -34
  437. package/cjs/core/utils/icons/Svg.js +3 -3
  438. package/cjs/core/utils/icons/SvgCalendar.d.ts +1 -1
  439. package/cjs/core/utils/icons/SvgCalendar.js +12 -29
  440. package/cjs/core/utils/icons/SvgCaretDownSmall.d.ts +1 -1
  441. package/cjs/core/utils/icons/SvgCaretDownSmall.js +12 -29
  442. package/cjs/core/utils/icons/SvgCaretRightSmall.d.ts +1 -1
  443. package/cjs/core/utils/icons/SvgCaretRightSmall.js +12 -29
  444. package/cjs/core/utils/icons/SvgCaretUpSmall.d.ts +1 -1
  445. package/cjs/core/utils/icons/SvgCaretUpSmall.js +12 -29
  446. package/cjs/core/utils/icons/SvgCheckmark.d.ts +1 -1
  447. package/cjs/core/utils/icons/SvgCheckmark.js +10 -29
  448. package/cjs/core/utils/icons/SvgCheckmarkSmall.d.ts +1 -1
  449. package/cjs/core/utils/icons/SvgCheckmarkSmall.js +12 -29
  450. package/cjs/core/utils/icons/SvgChevronLeft.d.ts +1 -1
  451. package/cjs/core/utils/icons/SvgChevronLeft.js +12 -29
  452. package/cjs/core/utils/icons/SvgChevronLeftDouble.d.ts +1 -1
  453. package/cjs/core/utils/icons/SvgChevronLeftDouble.js +12 -29
  454. package/cjs/core/utils/icons/SvgChevronRight.d.ts +1 -1
  455. package/cjs/core/utils/icons/SvgChevronRight.js +12 -29
  456. package/cjs/core/utils/icons/SvgChevronRightDouble.d.ts +1 -1
  457. package/cjs/core/utils/icons/SvgChevronRightDouble.js +12 -29
  458. package/cjs/core/utils/icons/SvgClose.d.ts +1 -1
  459. package/cjs/core/utils/icons/SvgClose.js +12 -29
  460. package/cjs/core/utils/icons/SvgCloseSmall.d.ts +1 -1
  461. package/cjs/core/utils/icons/SvgCloseSmall.js +12 -29
  462. package/cjs/core/utils/icons/SvgColumnManager.d.ts +1 -1
  463. package/cjs/core/utils/icons/SvgColumnManager.js +12 -29
  464. package/cjs/core/utils/icons/SvgDocument.d.ts +1 -1
  465. package/cjs/core/utils/icons/SvgDocument.js +10 -29
  466. package/cjs/core/utils/icons/SvgFilter.d.ts +1 -1
  467. package/cjs/core/utils/icons/SvgFilter.js +10 -29
  468. package/cjs/core/utils/icons/SvgFilterHollow.d.ts +1 -1
  469. package/cjs/core/utils/icons/SvgFilterHollow.js +12 -29
  470. package/cjs/core/utils/icons/SvgImportantSmall.d.ts +1 -1
  471. package/cjs/core/utils/icons/SvgImportantSmall.js +12 -29
  472. package/cjs/core/utils/icons/SvgInfoCircular.d.ts +1 -1
  473. package/cjs/core/utils/icons/SvgInfoCircular.js +12 -29
  474. package/cjs/core/utils/icons/SvgMore.d.ts +1 -1
  475. package/cjs/core/utils/icons/SvgMore.js +12 -29
  476. package/cjs/core/utils/icons/SvgMoreVertical.d.ts +1 -1
  477. package/cjs/core/utils/icons/SvgMoreVertical.js +12 -29
  478. package/cjs/core/utils/icons/SvgNew.d.ts +1 -1
  479. package/cjs/core/utils/icons/SvgNew.js +12 -29
  480. package/cjs/core/utils/icons/SvgSearch.d.ts +1 -1
  481. package/cjs/core/utils/icons/SvgSearch.js +12 -29
  482. package/cjs/core/utils/icons/SvgSmileyHappy.d.ts +1 -1
  483. package/cjs/core/utils/icons/SvgSmileyHappy.js +12 -29
  484. package/cjs/core/utils/icons/SvgSortDown.d.ts +1 -1
  485. package/cjs/core/utils/icons/SvgSortDown.js +12 -29
  486. package/cjs/core/utils/icons/SvgSortUp.d.ts +1 -1
  487. package/cjs/core/utils/icons/SvgSortUp.js +12 -29
  488. package/cjs/core/utils/icons/SvgStatusError.d.ts +1 -1
  489. package/cjs/core/utils/icons/SvgStatusError.js +12 -29
  490. package/cjs/core/utils/icons/SvgStatusSuccess.d.ts +1 -1
  491. package/cjs/core/utils/icons/SvgStatusSuccess.js +12 -29
  492. package/cjs/core/utils/icons/SvgStatusWarning.d.ts +1 -1
  493. package/cjs/core/utils/icons/SvgStatusWarning.js +12 -29
  494. package/cjs/core/utils/icons/SvgSwap.d.ts +1 -1
  495. package/cjs/core/utils/icons/SvgSwap.js +12 -29
  496. package/cjs/core/utils/icons/SvgUpload.d.ts +1 -1
  497. package/cjs/core/utils/icons/SvgUpload.js +12 -29
  498. package/cjs/core/utils/icons/index.js +34 -47
  499. package/cjs/core/utils/index.js +10 -23
  500. package/cjs/core/utils/props.d.ts +2 -2
  501. package/cjs/core/utils/props.js +2 -2
  502. package/cjs/core/utils/types.d.ts +1 -1
  503. package/cjs/core/utils/types.js +2 -2
  504. package/cjs/index.js +5 -18
  505. package/cjs/package.json +1 -0
  506. package/cjs/styles.js +453 -441
  507. package/cjs/types/react-table-config.js +2 -2
  508. package/esm/core/Alert/Alert.d.ts +5 -5
  509. package/esm/core/Alert/Alert.js +73 -28
  510. package/esm/core/Avatar/Avatar.d.ts +3 -3
  511. package/esm/core/Avatar/Avatar.js +48 -13
  512. package/esm/core/AvatarGroup/AvatarGroup.d.ts +1 -1
  513. package/esm/core/AvatarGroup/AvatarGroup.js +63 -22
  514. package/esm/core/Backdrop/Backdrop.d.ts +1 -1
  515. package/esm/core/Backdrop/Backdrop.js +10 -2
  516. package/esm/core/Badge/Badge.d.ts +1 -1
  517. package/esm/core/Badge/Badge.js +31 -16
  518. package/esm/core/Breadcrumbs/Breadcrumbs.d.ts +16 -24
  519. package/esm/core/Breadcrumbs/Breadcrumbs.js +128 -31
  520. package/esm/core/ButtonGroup/ButtonGroup.d.ts +1 -1
  521. package/esm/core/ButtonGroup/ButtonGroup.js +59 -22
  522. package/esm/core/Buttons/Button/Button.d.ts +1 -1
  523. package/esm/core/Buttons/Button/Button.js +37 -5
  524. package/esm/core/Buttons/DropdownButton/DropdownButton.d.ts +1 -1
  525. package/esm/core/Buttons/DropdownButton/DropdownButton.js +54 -19
  526. package/esm/core/Buttons/IconButton/IconButton.d.ts +1 -1
  527. package/esm/core/Buttons/IconButton/IconButton.js +51 -7
  528. package/esm/core/Buttons/IdeasButton/IdeasButton.d.ts +1 -1
  529. package/esm/core/Buttons/IdeasButton/IdeasButton.js +12 -2
  530. package/esm/core/Buttons/SplitButton/SplitButton.d.ts +1 -1
  531. package/esm/core/Buttons/SplitButton/SplitButton.js +59 -15
  532. package/esm/core/Carousel/Carousel.d.ts +3 -3
  533. package/esm/core/Carousel/Carousel.js +97 -70
  534. package/esm/core/Carousel/CarouselDot.d.ts +1 -1
  535. package/esm/core/Carousel/CarouselDot.js +19 -6
  536. package/esm/core/Carousel/CarouselDotsList.d.ts +1 -1
  537. package/esm/core/Carousel/CarouselDotsList.js +123 -63
  538. package/esm/core/Carousel/CarouselNavigation.d.ts +2 -2
  539. package/esm/core/Carousel/CarouselNavigation.js +85 -32
  540. package/esm/core/Carousel/CarouselSlide.d.ts +1 -1
  541. package/esm/core/Carousel/CarouselSlide.js +29 -14
  542. package/esm/core/Carousel/CarouselSlider.js +65 -40
  543. package/esm/core/Checkbox/Checkbox.d.ts +9 -5
  544. package/esm/core/Checkbox/Checkbox.js +78 -28
  545. package/esm/core/ColorPicker/ColorBuilder.js +277 -166
  546. package/esm/core/ColorPicker/ColorInputPanel.d.ts +1 -1
  547. package/esm/core/ColorPicker/ColorInputPanel.js +437 -248
  548. package/esm/core/ColorPicker/ColorPalette.d.ts +1 -1
  549. package/esm/core/ColorPicker/ColorPalette.js +115 -80
  550. package/esm/core/ColorPicker/ColorPicker.d.ts +1 -6
  551. package/esm/core/ColorPicker/ColorPicker.js +75 -54
  552. package/esm/core/ColorPicker/ColorPickerContext.js +7 -5
  553. package/esm/core/ColorPicker/ColorSwatch.d.ts +1 -1
  554. package/esm/core/ColorPicker/ColorSwatch.js +19 -7
  555. package/esm/core/ComboBox/ComboBox.d.ts +6 -6
  556. package/esm/core/ComboBox/ComboBox.js +385 -256
  557. package/esm/core/ComboBox/ComboBoxDropdown.d.ts +1 -1
  558. package/esm/core/ComboBox/ComboBoxDropdown.js +32 -15
  559. package/esm/core/ComboBox/ComboBoxEndIcon.d.ts +1 -1
  560. package/esm/core/ComboBox/ComboBoxEndIcon.js +39 -12
  561. package/esm/core/ComboBox/ComboBoxInput.d.ts +2 -2
  562. package/esm/core/ComboBox/ComboBoxInput.js +197 -124
  563. package/esm/core/ComboBox/ComboBoxInputContainer.d.ts +1 -1
  564. package/esm/core/ComboBox/ComboBoxInputContainer.js +20 -5
  565. package/esm/core/ComboBox/ComboBoxMenu.d.ts +1 -1
  566. package/esm/core/ComboBox/ComboBoxMenu.js +94 -38
  567. package/esm/core/ComboBox/ComboBoxMenuItem.d.ts +1 -1
  568. package/esm/core/ComboBox/ComboBoxMenuItem.js +59 -13
  569. package/esm/core/ComboBox/ComboBoxMultipleContainer.d.ts +1 -1
  570. package/esm/core/ComboBox/ComboBoxMultipleContainer.js +6 -2
  571. package/esm/core/ComboBox/helpers.d.ts +2 -2
  572. package/esm/core/ComboBox/helpers.js +38 -38
  573. package/esm/core/DatePicker/DatePicker.d.ts +2 -2
  574. package/esm/core/DatePicker/DatePicker.js +519 -325
  575. package/esm/core/Dialog/Dialog.d.ts +1 -1
  576. package/esm/core/Dialog/Dialog.js +65 -31
  577. package/esm/core/Dialog/DialogBackdrop.d.ts +1 -1
  578. package/esm/core/Dialog/DialogBackdrop.js +39 -19
  579. package/esm/core/Dialog/DialogContext.d.ts +1 -1
  580. package/esm/core/Dialog/DialogContext.js +1 -1
  581. package/esm/core/Dialog/DialogDragContext.d.ts +1 -1
  582. package/esm/core/Dialog/DialogDragContext.js +4 -4
  583. package/esm/core/Dialog/DialogMain.d.ts +1 -1
  584. package/esm/core/Dialog/DialogMain.js +178 -108
  585. package/esm/core/Dialog/DialogTitleBar.d.ts +1 -1
  586. package/esm/core/Dialog/DialogTitleBar.js +45 -10
  587. package/esm/core/DropdownMenu/DropdownMenu.d.ts +4 -4
  588. package/esm/core/DropdownMenu/DropdownMenu.js +66 -22
  589. package/esm/core/ExpandableBlock/ExpandableBlock.d.ts +77 -21
  590. package/esm/core/ExpandableBlock/ExpandableBlock.js +225 -46
  591. package/esm/core/Fieldset/Fieldset.d.ts +1 -1
  592. package/esm/core/Fieldset/Fieldset.js +19 -8
  593. package/esm/core/FileUpload/FileEmptyCard.js +19 -8
  594. package/esm/core/FileUpload/FileUpload.d.ts +1 -1
  595. package/esm/core/FileUpload/FileUpload.js +49 -36
  596. package/esm/core/FileUpload/FileUploadCard.d.ts +1 -1
  597. package/esm/core/FileUpload/FileUploadCard.js +154 -76
  598. package/esm/core/FileUpload/FileUploadTemplate.d.ts +1 -1
  599. package/esm/core/FileUpload/FileUploadTemplate.js +37 -9
  600. package/esm/core/Footer/Footer.d.ts +4 -4
  601. package/esm/core/Footer/Footer.js +86 -55
  602. package/esm/core/Footer/FooterSeparator.js +1 -1
  603. package/esm/core/Header/Header.d.ts +2 -2
  604. package/esm/core/Header/Header.js +55 -14
  605. package/esm/core/Header/HeaderBasicButton.js +28 -7
  606. package/esm/core/Header/HeaderBreadcrumbs.d.ts +1 -1
  607. package/esm/core/Header/HeaderBreadcrumbs.js +32 -8
  608. package/esm/core/Header/HeaderButton.d.ts +1 -1
  609. package/esm/core/Header/HeaderButton.js +60 -13
  610. package/esm/core/Header/HeaderDropdownButton.js +43 -13
  611. package/esm/core/Header/HeaderLogo.d.ts +1 -1
  612. package/esm/core/Header/HeaderLogo.js +36 -5
  613. package/esm/core/Header/HeaderSplitButton.js +57 -13
  614. package/esm/core/InformationPanel/InformationPanel.d.ts +1 -1
  615. package/esm/core/InformationPanel/InformationPanel.js +71 -36
  616. package/esm/core/InformationPanel/InformationPanelContent.d.ts +1 -1
  617. package/esm/core/InformationPanel/InformationPanelContent.js +17 -3
  618. package/esm/core/InformationPanel/InformationPanelHeader.d.ts +1 -1
  619. package/esm/core/InformationPanel/InformationPanelHeader.js +32 -8
  620. package/esm/core/InformationPanel/InformationPanelWrapper.js +3 -1
  621. package/esm/core/Input/Input.d.ts +1 -6
  622. package/esm/core/Input/Input.js +10 -9
  623. package/esm/core/InputGroup/InputGroup.d.ts +1 -1
  624. package/esm/core/InputGroup/InputGroup.js +37 -14
  625. package/esm/core/Label/Label.d.ts +1 -1
  626. package/esm/core/Label/Label.js +24 -5
  627. package/esm/core/LabeledInput/LabeledInput.d.ts +1 -1
  628. package/esm/core/LabeledInput/LabeledInput.js +43 -5
  629. package/esm/core/LabeledSelect/LabeledSelect.d.ts +1 -1
  630. package/esm/core/LabeledSelect/LabeledSelect.js +50 -16
  631. package/esm/core/LabeledTextarea/LabeledTextarea.d.ts +2 -3
  632. package/esm/core/LabeledTextarea/LabeledTextarea.js +43 -5
  633. package/esm/core/List/ListItem.d.ts +4 -4
  634. package/esm/core/List/ListItem.js +46 -28
  635. package/esm/core/Menu/Menu.d.ts +1 -1
  636. package/esm/core/Menu/Menu.js +58 -47
  637. package/esm/core/Menu/MenuDivider.js +1 -1
  638. package/esm/core/Menu/MenuExtraContent.js +1 -1
  639. package/esm/core/Menu/MenuItem.d.ts +1 -1
  640. package/esm/core/Menu/MenuItem.js +131 -57
  641. package/esm/core/Menu/MenuItemSkeleton.d.ts +1 -1
  642. package/esm/core/Menu/MenuItemSkeleton.js +44 -12
  643. package/esm/core/Modal/Modal.d.ts +1 -1
  644. package/esm/core/Modal/Modal.js +33 -6
  645. package/esm/core/NonIdealState/ErrorPage.d.ts +6 -7
  646. package/esm/core/NonIdealState/ErrorPage.js +177 -117
  647. package/esm/core/NonIdealState/NonIdealState.d.ts +17 -1
  648. package/esm/core/NonIdealState/NonIdealState.js +65 -6
  649. package/esm/core/NotificationMarker/NotificationMarker.d.ts +1 -1
  650. package/esm/core/NotificationMarker/NotificationMarker.js +20 -2
  651. package/esm/core/Overlay/Overlay.d.ts +57 -0
  652. package/esm/core/Overlay/Overlay.js +88 -0
  653. package/esm/core/Overlay/index.d.ts +1 -0
  654. package/esm/core/{ProgressIndicators/ProgressLinear → Overlay}/index.js +1 -2
  655. package/esm/core/ProgressIndicators/{ProgressLinear/ProgressLinear.d.ts → ProgressLinear.d.ts} +6 -6
  656. package/esm/core/ProgressIndicators/{ProgressLinear/ProgressLinear.js → ProgressLinear.js} +33 -12
  657. package/esm/core/ProgressIndicators/{ProgressRadial/ProgressRadial.d.ts → ProgressRadial.d.ts} +2 -2
  658. package/esm/core/ProgressIndicators/ProgressRadial.js +64 -0
  659. package/esm/core/ProgressIndicators/index.d.ts +2 -2
  660. package/esm/core/ProgressIndicators/index.js +2 -2
  661. package/esm/core/Radio/Radio.d.ts +1 -6
  662. package/esm/core/Radio/Radio.js +32 -11
  663. package/esm/core/RadioTiles/RadioTile.d.ts +1 -6
  664. package/esm/core/RadioTiles/RadioTile.js +32 -14
  665. package/esm/core/RadioTiles/RadioTileGroup.d.ts +1 -1
  666. package/esm/core/RadioTiles/RadioTileGroup.js +10 -3
  667. package/esm/core/SearchBox/SearchBox.d.ts +3 -3
  668. package/esm/core/SearchBox/SearchBox.js +215 -97
  669. package/esm/core/Select/Select.d.ts +5 -10
  670. package/esm/core/Select/Select.js +283 -148
  671. package/esm/core/Select/SelectTag.d.ts +1 -1
  672. package/esm/core/Select/SelectTag.js +15 -3
  673. package/esm/core/Select/SelectTagContainer.d.ts +1 -1
  674. package/esm/core/Select/SelectTagContainer.js +20 -7
  675. package/esm/core/SideNavigation/SideNavigation.d.ts +1 -1
  676. package/esm/core/SideNavigation/SideNavigation.js +94 -21
  677. package/esm/core/SideNavigation/SidenavButton.d.ts +1 -1
  678. package/esm/core/SideNavigation/SidenavButton.js +24 -2
  679. package/esm/core/SideNavigation/SidenavSubmenu.js +14 -3
  680. package/esm/core/SideNavigation/SidenavSubmenuHeader.d.ts +1 -1
  681. package/esm/core/SideNavigation/SidenavSubmenuHeader.js +20 -4
  682. package/esm/core/SkipToContentLink/SkipToContentLink.d.ts +1 -1
  683. package/esm/core/SkipToContentLink/SkipToContentLink.js +11 -2
  684. package/esm/core/Slider/Slider.d.ts +4 -9
  685. package/esm/core/Slider/Slider.js +319 -194
  686. package/esm/core/Slider/Thumb.d.ts +2 -2
  687. package/esm/core/Slider/Thumb.js +100 -52
  688. package/esm/core/Slider/Track.d.ts +3 -3
  689. package/esm/core/Slider/Track.js +67 -49
  690. package/esm/core/StatusMessage/StatusMessage.d.ts +2 -2
  691. package/esm/core/StatusMessage/StatusMessage.js +18 -5
  692. package/esm/core/Stepper/Stepper.d.ts +3 -3
  693. package/esm/core/Stepper/Stepper.js +45 -8
  694. package/esm/core/Stepper/StepperStep.d.ts +1 -1
  695. package/esm/core/Stepper/StepperStep.js +73 -31
  696. package/esm/core/Stepper/WorkflowDiagram.d.ts +1 -1
  697. package/esm/core/Stepper/WorkflowDiagram.js +19 -5
  698. package/esm/core/Stepper/WorkflowDiagramStep.d.ts +3 -3
  699. package/esm/core/Stepper/WorkflowDiagramStep.js +18 -4
  700. package/esm/core/Surface/Surface.d.ts +2 -2
  701. package/esm/core/Surface/Surface.js +68 -39
  702. package/esm/core/Table/SubRowExpander.d.ts +2 -2
  703. package/esm/core/Table/SubRowExpander.js +29 -9
  704. package/esm/core/Table/Table.d.ts +2 -2
  705. package/esm/core/Table/Table.js +726 -411
  706. package/esm/core/Table/TableCell.d.ts +2 -2
  707. package/esm/core/Table/TableCell.js +87 -53
  708. package/esm/core/Table/TablePaginator.d.ts +3 -3
  709. package/esm/core/Table/TablePaginator.js +307 -125
  710. package/esm/core/Table/TableRowMemoized.d.ts +4 -4
  711. package/esm/core/Table/TableRowMemoized.js +129 -58
  712. package/esm/core/Table/actionHandlers/expandHandler.js +10 -10
  713. package/esm/core/Table/actionHandlers/filterHandler.js +23 -15
  714. package/esm/core/Table/actionHandlers/index.js +5 -1
  715. package/esm/core/Table/actionHandlers/resizeHandler.js +11 -11
  716. package/esm/core/Table/actionHandlers/selectHandler.js +117 -93
  717. package/esm/core/Table/cells/DefaultCell.d.ts +2 -2
  718. package/esm/core/Table/cells/DefaultCell.js +42 -7
  719. package/esm/core/Table/cells/EditableCell.d.ts +2 -2
  720. package/esm/core/Table/cells/EditableCell.js +70 -41
  721. package/esm/core/Table/columns/actionColumn.d.ts +3 -3
  722. package/esm/core/Table/columns/actionColumn.js +90 -58
  723. package/esm/core/Table/columns/expanderColumn.d.ts +2 -2
  724. package/esm/core/Table/columns/expanderColumn.js +38 -25
  725. package/esm/core/Table/columns/selectionColumn.d.ts +4 -4
  726. package/esm/core/Table/columns/selectionColumn.js +51 -23
  727. package/esm/core/Table/filters/BaseFilter.d.ts +2 -2
  728. package/esm/core/Table/filters/BaseFilter.js +15 -7
  729. package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.d.ts +3 -2
  730. package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.js +84 -42
  731. package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.d.ts +4 -4
  732. package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.js +108 -46
  733. package/esm/core/Table/filters/FilterButtonBar.d.ts +3 -3
  734. package/esm/core/Table/filters/FilterButtonBar.js +28 -9
  735. package/esm/core/Table/filters/FilterToggle.d.ts +3 -3
  736. package/esm/core/Table/filters/FilterToggle.js +55 -20
  737. package/esm/core/Table/filters/NumberRangeFilter/NumberRangeFilter.d.ts +4 -4
  738. package/esm/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +50 -22
  739. package/esm/core/Table/filters/TextFilter/TextFilter.d.ts +3 -3
  740. package/esm/core/Table/filters/TextFilter/TextFilter.js +32 -14
  741. package/esm/core/Table/filters/customFilterFunctions.js +14 -12
  742. package/esm/core/Table/filters/defaultFilterFunctions.js +84 -79
  743. package/esm/core/Table/filters/tableFilters.d.ts +5 -5
  744. package/esm/core/Table/filters/tableFilters.js +34 -25
  745. package/esm/core/Table/filters/types.d.ts +1 -1
  746. package/esm/core/Table/hooks/useColumnDragAndDrop.js +88 -81
  747. package/esm/core/Table/hooks/useExpanderCell.d.ts +1 -1
  748. package/esm/core/Table/hooks/useExpanderCell.js +26 -20
  749. package/esm/core/Table/hooks/useResizeColumns.js +353 -287
  750. package/esm/core/Table/hooks/useScrollToRow.d.ts +2 -2
  751. package/esm/core/Table/hooks/useScrollToRow.js +42 -34
  752. package/esm/core/Table/hooks/useSelectionCell.js +10 -6
  753. package/esm/core/Table/hooks/useStickyColumns.js +61 -59
  754. package/esm/core/Table/hooks/useSubRowFiltering.js +90 -83
  755. package/esm/core/Table/hooks/useSubRowSelection.js +28 -27
  756. package/esm/core/Table/index.js +5 -1
  757. package/esm/core/Table/utils.js +40 -38
  758. package/esm/core/Tabs/Tab.d.ts +2 -2
  759. package/esm/core/Tabs/Tab.js +41 -7
  760. package/esm/core/Tabs/Tabs.d.ts +6 -6
  761. package/esm/core/Tabs/Tabs.js +391 -303
  762. package/esm/core/Tag/Tag.d.ts +1 -1
  763. package/esm/core/Tag/Tag.js +35 -8
  764. package/esm/core/Tag/TagContainer.d.ts +1 -1
  765. package/esm/core/Tag/TagContainer.js +17 -5
  766. package/esm/core/Textarea/Textarea.d.ts +2 -9
  767. package/esm/core/Textarea/Textarea.js +11 -10
  768. package/esm/core/ThemeProvider/ThemeProvider.d.ts +4 -4
  769. package/esm/core/ThemeProvider/ThemeProvider.js +65 -21
  770. package/esm/core/Tile/Tile.d.ts +14 -14
  771. package/esm/core/Tile/Tile.js +312 -198
  772. package/esm/core/TimePicker/TimePicker.d.ts +3 -3
  773. package/esm/core/TimePicker/TimePicker.js +448 -228
  774. package/esm/core/Toast/Toast.d.ts +5 -5
  775. package/esm/core/Toast/Toast.js +180 -99
  776. package/esm/core/Toast/Toaster.d.ts +5 -5
  777. package/esm/core/Toast/Toaster.js +83 -67
  778. package/esm/core/ToggleSwitch/ToggleSwitch.d.ts +1 -6
  779. package/esm/core/ToggleSwitch/ToggleSwitch.js +60 -22
  780. package/esm/core/Tooltip/Tooltip.d.ts +2 -2
  781. package/esm/core/Tooltip/Tooltip.js +154 -90
  782. package/esm/core/TransferList/TransferList.d.ts +6 -6
  783. package/esm/core/TransferList/TransferList.js +163 -93
  784. package/esm/core/Tree/Tree.d.ts +5 -5
  785. package/esm/core/Tree/Tree.js +197 -125
  786. package/esm/core/Tree/TreeContext.d.ts +1 -1
  787. package/esm/core/Tree/TreeContext.js +5 -5
  788. package/esm/core/Tree/TreeNode.d.ts +2 -2
  789. package/esm/core/Tree/TreeNode.js +195 -96
  790. package/esm/core/Tree/TreeNodeExpander.d.ts +1 -1
  791. package/esm/core/Tree/TreeNodeExpander.js +16 -5
  792. package/esm/core/Typography/Blockquote/Blockquote.d.ts +1 -1
  793. package/esm/core/Typography/Blockquote/Blockquote.js +12 -4
  794. package/esm/core/Typography/Kbd/Kbd.d.ts +1 -1
  795. package/esm/core/Typography/Kbd/Kbd.js +24 -15
  796. package/esm/core/Typography/Text/Text.d.ts +1 -1
  797. package/esm/core/Typography/Text/Text.js +20 -7
  798. package/esm/core/index.d.ts +1 -0
  799. package/esm/core/index.js +78 -10
  800. package/esm/core/utils/color/ColorValue.d.ts +4 -4
  801. package/esm/core/utils/color/ColorValue.js +524 -449
  802. package/esm/core/utils/components/AutoclearingHiddenLiveRegion.d.ts +2 -2
  803. package/esm/core/utils/components/AutoclearingHiddenLiveRegion.js +11 -7
  804. package/esm/core/utils/components/Divider.d.ts +1 -1
  805. package/esm/core/utils/components/Divider.js +8 -2
  806. package/esm/core/utils/components/Flex.d.ts +4 -4
  807. package/esm/core/utils/components/Flex.js +87 -71
  808. package/esm/core/utils/components/FocusTrap.d.ts +3 -3
  809. package/esm/core/utils/components/FocusTrap.js +41 -32
  810. package/esm/core/utils/components/Icon.d.ts +1 -1
  811. package/esm/core/utils/components/Icon.js +19 -12
  812. package/esm/core/utils/components/InputContainer.d.ts +2 -2
  813. package/esm/core/utils/components/InputContainer.js +65 -15
  814. package/esm/core/utils/components/InputFlexContainer.d.ts +1 -1
  815. package/esm/core/utils/components/InputFlexContainer.js +13 -2
  816. package/esm/core/utils/components/MiddleTextTruncation.d.ts +2 -2
  817. package/esm/core/utils/components/MiddleTextTruncation.js +27 -17
  818. package/esm/core/utils/components/Popover.d.ts +3 -3
  819. package/esm/core/utils/components/Popover.js +103 -102
  820. package/esm/core/utils/components/Resizer.d.ts +2 -2
  821. package/esm/core/utils/components/Resizer.js +242 -184
  822. package/esm/core/utils/components/VirtualScroll.d.ts +2 -2
  823. package/esm/core/utils/components/VirtualScroll.js +297 -218
  824. package/esm/core/utils/components/VisuallyHidden.d.ts +1 -1
  825. package/esm/core/utils/components/VisuallyHidden.js +8 -2
  826. package/esm/core/utils/components/WithCSSTransition.d.ts +2 -2
  827. package/esm/core/utils/components/WithCSSTransition.js +38 -21
  828. package/esm/core/utils/functions/colors.js +30 -30
  829. package/esm/core/utils/functions/date.js +8 -8
  830. package/esm/core/utils/functions/dom.js +17 -14
  831. package/esm/core/utils/functions/focusable.js +24 -15
  832. package/esm/core/utils/functions/import.d.ts +6 -0
  833. package/esm/core/utils/functions/import.js +13 -0
  834. package/esm/core/utils/functions/index.d.ts +1 -0
  835. package/esm/core/utils/functions/index.js +1 -0
  836. package/esm/core/utils/functions/numbers.js +7 -7
  837. package/esm/core/utils/functions/polymorphic.d.ts +5 -3
  838. package/esm/core/utils/functions/polymorphic.js +32 -23
  839. package/esm/core/utils/functions/supports.js +2 -1
  840. package/esm/core/utils/hooks/useContainerWidth.js +16 -13
  841. package/esm/core/utils/hooks/useDragAndDrop.js +99 -80
  842. package/esm/core/utils/hooks/useEventListener.js +18 -18
  843. package/esm/core/utils/hooks/useGlobals.js +29 -24
  844. package/esm/core/utils/hooks/useId.js +2 -2
  845. package/esm/core/utils/hooks/useIntersection.js +25 -19
  846. package/esm/core/utils/hooks/useIsClient.js +5 -5
  847. package/esm/core/utils/hooks/useIsomorphicLayoutEffect.js +2 -1
  848. package/esm/core/utils/hooks/useLatestRef.js +5 -5
  849. package/esm/core/utils/hooks/useMediaQuery.js +23 -25
  850. package/esm/core/utils/hooks/useMergedRefs.js +11 -12
  851. package/esm/core/utils/hooks/useOverflow.js +62 -50
  852. package/esm/core/utils/hooks/useResizeObserver.js +17 -12
  853. package/esm/core/utils/hooks/useSafeContext.js +5 -5
  854. package/esm/core/utils/icons/StatusIconMap.d.ts +5 -5
  855. package/esm/core/utils/icons/StatusIconMap.js +8 -4
  856. package/esm/core/utils/icons/SvgCalendar.d.ts +1 -1
  857. package/esm/core/utils/icons/SvgCalendar.js +7 -2
  858. package/esm/core/utils/icons/SvgCaretDownSmall.d.ts +1 -1
  859. package/esm/core/utils/icons/SvgCaretDownSmall.js +7 -2
  860. package/esm/core/utils/icons/SvgCaretRightSmall.d.ts +1 -1
  861. package/esm/core/utils/icons/SvgCaretRightSmall.js +7 -2
  862. package/esm/core/utils/icons/SvgCaretUpSmall.d.ts +1 -1
  863. package/esm/core/utils/icons/SvgCaretUpSmall.js +7 -2
  864. package/esm/core/utils/icons/SvgCheckmark.d.ts +1 -1
  865. package/esm/core/utils/icons/SvgCheckmark.js +5 -2
  866. package/esm/core/utils/icons/SvgCheckmarkSmall.d.ts +1 -1
  867. package/esm/core/utils/icons/SvgCheckmarkSmall.js +7 -2
  868. package/esm/core/utils/icons/SvgChevronLeft.d.ts +1 -1
  869. package/esm/core/utils/icons/SvgChevronLeft.js +7 -2
  870. package/esm/core/utils/icons/SvgChevronLeftDouble.d.ts +1 -1
  871. package/esm/core/utils/icons/SvgChevronLeftDouble.js +7 -2
  872. package/esm/core/utils/icons/SvgChevronRight.d.ts +1 -1
  873. package/esm/core/utils/icons/SvgChevronRight.js +7 -2
  874. package/esm/core/utils/icons/SvgChevronRightDouble.d.ts +1 -1
  875. package/esm/core/utils/icons/SvgChevronRightDouble.js +7 -2
  876. package/esm/core/utils/icons/SvgClose.d.ts +1 -1
  877. package/esm/core/utils/icons/SvgClose.js +7 -2
  878. package/esm/core/utils/icons/SvgCloseSmall.d.ts +1 -1
  879. package/esm/core/utils/icons/SvgCloseSmall.js +7 -2
  880. package/esm/core/utils/icons/SvgColumnManager.d.ts +1 -1
  881. package/esm/core/utils/icons/SvgColumnManager.js +7 -2
  882. package/esm/core/utils/icons/SvgDocument.d.ts +1 -1
  883. package/esm/core/utils/icons/SvgDocument.js +5 -2
  884. package/esm/core/utils/icons/SvgFilter.d.ts +1 -1
  885. package/esm/core/utils/icons/SvgFilter.js +5 -2
  886. package/esm/core/utils/icons/SvgFilterHollow.d.ts +1 -1
  887. package/esm/core/utils/icons/SvgFilterHollow.js +7 -2
  888. package/esm/core/utils/icons/SvgImportantSmall.d.ts +1 -1
  889. package/esm/core/utils/icons/SvgImportantSmall.js +7 -2
  890. package/esm/core/utils/icons/SvgInfoCircular.d.ts +1 -1
  891. package/esm/core/utils/icons/SvgInfoCircular.js +7 -2
  892. package/esm/core/utils/icons/SvgMore.d.ts +1 -1
  893. package/esm/core/utils/icons/SvgMore.js +7 -2
  894. package/esm/core/utils/icons/SvgMoreVertical.d.ts +1 -1
  895. package/esm/core/utils/icons/SvgMoreVertical.js +7 -2
  896. package/esm/core/utils/icons/SvgNew.d.ts +1 -1
  897. package/esm/core/utils/icons/SvgNew.js +7 -2
  898. package/esm/core/utils/icons/SvgSearch.d.ts +1 -1
  899. package/esm/core/utils/icons/SvgSearch.js +7 -2
  900. package/esm/core/utils/icons/SvgSmileyHappy.d.ts +1 -1
  901. package/esm/core/utils/icons/SvgSmileyHappy.js +7 -2
  902. package/esm/core/utils/icons/SvgSortDown.d.ts +1 -1
  903. package/esm/core/utils/icons/SvgSortDown.js +7 -2
  904. package/esm/core/utils/icons/SvgSortUp.d.ts +1 -1
  905. package/esm/core/utils/icons/SvgSortUp.js +7 -2
  906. package/esm/core/utils/icons/SvgStatusError.d.ts +1 -1
  907. package/esm/core/utils/icons/SvgStatusError.js +7 -2
  908. package/esm/core/utils/icons/SvgStatusSuccess.d.ts +1 -1
  909. package/esm/core/utils/icons/SvgStatusSuccess.js +7 -2
  910. package/esm/core/utils/icons/SvgStatusWarning.d.ts +1 -1
  911. package/esm/core/utils/icons/SvgStatusWarning.js +7 -2
  912. package/esm/core/utils/icons/SvgSwap.d.ts +1 -1
  913. package/esm/core/utils/icons/SvgSwap.js +7 -2
  914. package/esm/core/utils/icons/SvgUpload.d.ts +1 -1
  915. package/esm/core/utils/icons/SvgUpload.js +7 -2
  916. package/esm/core/utils/props.d.ts +2 -2
  917. package/esm/core/utils/types.d.ts +1 -1
  918. package/esm/styles.js +453 -443
  919. package/package.json +33 -30
  920. package/styles.css +537 -562
  921. package/cjs/core/ProgressIndicators/ProgressLinear/ProgressLinear.js +0 -65
  922. package/cjs/core/ProgressIndicators/ProgressLinear/index.d.ts +0 -3
  923. package/cjs/core/ProgressIndicators/ProgressLinear/index.js +0 -10
  924. package/cjs/core/ProgressIndicators/ProgressRadial/ProgressRadial.js +0 -70
  925. package/cjs/core/ProgressIndicators/ProgressRadial/index.d.ts +0 -3
  926. package/cjs/core/ProgressIndicators/ProgressRadial/index.js +0 -10
  927. package/esm/core/ProgressIndicators/ProgressLinear/index.d.ts +0 -3
  928. package/esm/core/ProgressIndicators/ProgressRadial/ProgressRadial.js +0 -41
  929. package/esm/core/ProgressIndicators/ProgressRadial/index.d.ts +0 -3
@@ -10,19 +10,25 @@ const scratchUInt32 = new Uint32Array(scratchBytes.buffer);
10
10
  * isRgbValue type guard.
11
11
  */
12
12
  export const isRgbColor = (value) => {
13
- return (typeof value !== 'string' && 'r' in value && 'g' in value && 'b' in value);
13
+ return (
14
+ typeof value !== 'string' && 'r' in value && 'g' in value && 'b' in value
15
+ );
14
16
  };
15
17
  /**
16
18
  * isHslValue type guard.
17
19
  */
18
20
  export const isHslColor = (value) => {
19
- return (typeof value !== 'string' && 'h' in value && 's' in value && 'l' in value);
21
+ return (
22
+ typeof value !== 'string' && 'h' in value && 's' in value && 'l' in value
23
+ );
20
24
  };
21
25
  /**
22
26
  * isHsvValue type guard.
23
27
  */
24
28
  export const isHsvColor = (value) => {
25
- return (typeof value !== 'string' && 'h' in value && 's' in value && 'v' in value);
29
+ return (
30
+ typeof value !== 'string' && 'h' in value && 's' in value && 'v' in value
31
+ );
26
32
  };
27
33
  /**
28
34
  * An immutable integer representation of a color.
@@ -36,474 +42,543 @@ export const isHsvColor = (value) => {
36
42
  * @public
37
43
  */
38
44
  export class ColorValue {
39
- constructor(tbgr, hue) {
40
- scratchUInt32[0] = tbgr; // Force to be a 32-bit unsigned integer
41
- this._tbgr = scratchUInt32[0];
42
- this._hue = hue;
45
+ constructor(tbgr, hue) {
46
+ scratchUInt32[0] = tbgr; // Force to be a 32-bit unsigned integer
47
+ this._tbgr = scratchUInt32[0];
48
+ this._hue = hue;
49
+ }
50
+ /**
51
+ * Create a new ColorValue.
52
+ * @param val value to use.
53
+ *
54
+ * If a string, must be in one of the following forms:
55
+ * *"rgb(255,0,0)"*
56
+ * *"rgba(255,0,0,.2)"*
57
+ * *"rgb(100%,0%,0%)"*
58
+ * *"hsl(120,50%,50%)"*
59
+ * *"#rrggbb"*
60
+ */
61
+ static create(val) {
62
+ if (!val) {
63
+ return ColorValue.fromTbgr(0);
43
64
  }
44
- /**
45
- * Create a new ColorValue.
46
- * @param val value to use.
47
- *
48
- * If a string, must be in one of the following forms:
49
- * *"rgb(255,0,0)"*
50
- * *"rgba(255,0,0,.2)"*
51
- * *"rgb(100%,0%,0%)"*
52
- * *"hsl(120,50%,50%)"*
53
- * *"#rrggbb"*
54
- */
55
- static create(val) {
56
- if (!val) {
57
- return ColorValue.fromTbgr(0);
58
- }
59
- if (isRgbColor(val)) {
60
- return ColorValue.fromRGB(val);
61
- }
62
- if (isHslColor(val)) {
63
- return ColorValue.fromHSL(val);
64
- }
65
- if (isHsvColor(val)) {
66
- return ColorValue.fromHSV(val);
67
- }
68
- if (typeof val === 'string') {
69
- return ColorValue.fromString(val, ColorValue.fromTbgr(0));
70
- }
71
- return ColorValue.fromTbgr(0);
65
+ if (isRgbColor(val)) {
66
+ return ColorValue.fromRGB(val);
72
67
  }
73
- /**
74
- * Convert this ColorValue to an unsigned 32 bit integer representing the 0xTTBBGGRR value
75
- */
76
- toTbgr() {
77
- return this._tbgr;
68
+ if (isHslColor(val)) {
69
+ return ColorValue.fromHSL(val);
78
70
  }
79
- /**
80
- * Create a ColorValue from its 0xTTBBGGRR representation.
81
- */
82
- static fromTbgr(tbgr) {
83
- return new ColorValue(tbgr);
71
+ if (isHsvColor(val)) {
72
+ return ColorValue.fromHSV(val);
84
73
  }
85
- /**
86
- * Create a ColorValue from Red, Green, Blue, Transparency values. All inputs should be integers between 0-255.
87
- */
88
- static fromRgbt(red, green, blue, transparency) {
89
- return this.fromTbgr(this.computeTbgrFromComponents(red, green, blue, transparency));
74
+ if (typeof val === 'string') {
75
+ return ColorValue.fromString(val, ColorValue.fromTbgr(0));
90
76
  }
91
- /**
92
- * Compute the 0xTTBBGGRR value corresponding to the specified Red, Green, Blue, Transparency components.
93
- * All inputs should be integers between 0-255.
94
- */
95
- static computeTbgrFromComponents(red, green, blue, transparency) {
96
- scratchBytes[0] = red;
97
- scratchBytes[1] = green;
98
- scratchBytes[2] = blue;
99
- scratchBytes[3] = transparency || 0;
100
- return scratchUInt32[0];
77
+ return ColorValue.fromTbgr(0);
78
+ }
79
+ /**
80
+ * Convert this ColorValue to an unsigned 32 bit integer representing the 0xTTBBGGRR value
81
+ */
82
+ toTbgr() {
83
+ return this._tbgr;
84
+ }
85
+ /**
86
+ * Create a ColorValue from its 0xTTBBGGRR representation.
87
+ */
88
+ static fromTbgr(tbgr) {
89
+ return new ColorValue(tbgr);
90
+ }
91
+ /**
92
+ * Create a ColorValue from Red, Green, Blue, Transparency values. All inputs should be integers between 0-255.
93
+ */
94
+ static fromRgbt(red, green, blue, transparency) {
95
+ return this.fromTbgr(
96
+ this.computeTbgrFromComponents(red, green, blue, transparency),
97
+ );
98
+ }
99
+ /**
100
+ * Compute the 0xTTBBGGRR value corresponding to the specified Red, Green, Blue, Transparency components.
101
+ * All inputs should be integers between 0-255.
102
+ */
103
+ static computeTbgrFromComponents(red, green, blue, transparency) {
104
+ scratchBytes[0] = red;
105
+ scratchBytes[1] = green;
106
+ scratchBytes[2] = blue;
107
+ scratchBytes[3] = transparency || 0;
108
+ return scratchUInt32[0];
109
+ }
110
+ /**
111
+ * Create a ColorValue from a string representation. The following representations are supported:
112
+ * *"rgb(255,0,0)"*
113
+ * *"rgba(255,0,0,.2)"*
114
+ * *"rgb(100%,0%,0%)"*
115
+ * *"hsl(120,50%,50%)"*
116
+ * *"#rrggbb"*
117
+ * NOTE: If defaultColorIfNotParsed is not defined and string is invalid then error is thrown.
118
+ * This allows component builders to know if they received bad input from user.
119
+ */
120
+ static fromString(val, defaultColorIfNotParsed) {
121
+ const [tbgr, hue] = this.computeTbgrFromString(
122
+ val,
123
+ defaultColorIfNotParsed?.toTbgr(),
124
+ );
125
+ return new ColorValue(tbgr, hue);
126
+ }
127
+ /** Create a ColorValue from hue, saturation, lightness values. */
128
+ static fromHSL(hsl) {
129
+ const alpha = hsl.a ?? 1;
130
+ return new ColorValue(
131
+ this.computeTbgrFromHSL(
132
+ hsl.h / 360,
133
+ hsl.s / 100,
134
+ hsl.l / 100,
135
+ Math.round((1 - alpha) * 255),
136
+ ),
137
+ hsl.h,
138
+ );
139
+ }
140
+ /** Create a ColorValue from an RgbColor */
141
+ static fromRGB(rgb) {
142
+ const alpha = rgb.a ?? 1;
143
+ return ColorValue.fromRgbt(
144
+ rgb.r,
145
+ rgb.g,
146
+ rgb.b,
147
+ Math.round((1 - alpha) * 255),
148
+ );
149
+ }
150
+ /**
151
+ * Create a ColorValue from an HsvColor
152
+ */
153
+ static fromHSV(hsv) {
154
+ const alpha = hsv.a ?? 1;
155
+ const transparency = Math.round((1 - alpha) * 255);
156
+ // Check for simple case first.
157
+ if (!hsv.s || hsv.h === -1) {
158
+ // hue must be undefined, have no color only white
159
+ const white = 0xff & Math.floor((255.0 * hsv.v) / 100.0 + 0.5 + 3.0e-14);
160
+ return ColorValue.fromRgbt(white, white, white, 0);
101
161
  }
102
- /**
103
- * Create a ColorValue from a string representation. The following representations are supported:
104
- * *"rgb(255,0,0)"*
105
- * *"rgba(255,0,0,.2)"*
106
- * *"rgb(100%,0%,0%)"*
107
- * *"hsl(120,50%,50%)"*
108
- * *"#rrggbb"*
109
- * NOTE: If defaultColorIfNotParsed is not defined and string is invalid then error is thrown.
110
- * This allows component builders to know if they received bad input from user.
111
- */
112
- static fromString(val, defaultColorIfNotParsed) {
113
- const [tbgr, hue] = this.computeTbgrFromString(val, defaultColorIfNotParsed?.toTbgr());
114
- return new ColorValue(tbgr, hue);
162
+ let dhue = hsv.h,
163
+ dsaturation = hsv.s,
164
+ dvalue = hsv.v;
165
+ if (dhue === 360) {
166
+ dhue = 0.0;
115
167
  }
116
- /** Create a ColorValue from hue, saturation, lightness values. */
117
- static fromHSL(hsl) {
118
- const alpha = hsl.a ?? 1;
119
- return new ColorValue(this.computeTbgrFromHSL(hsl.h / 360, hsl.s / 100, hsl.l / 100, Math.round((1 - alpha) * 255)), hsl.h);
168
+ dhue /= 60; // hue is now [0..6]
169
+ const hueIntpart = Math.floor(dhue); // convert double -> int
170
+ const hueFractpart = dhue - hueIntpart;
171
+ dvalue /= 100;
172
+ dsaturation /= 100;
173
+ const p = 0xff & Math.floor(dvalue * (1.0 - dsaturation) * 255.0 + 0.5);
174
+ const q =
175
+ 0xff &
176
+ Math.floor(dvalue * (1.0 - dsaturation * hueFractpart) * 255.0 + 0.5);
177
+ const t =
178
+ 0xff &
179
+ Math.floor(
180
+ dvalue * (1.0 - dsaturation * (1.0 - hueFractpart)) * 255.0 + 0.5,
181
+ );
182
+ const v = 0xff & Math.floor(dvalue * 255 + 0.5);
183
+ let r = 0,
184
+ b = 0,
185
+ g = 0;
186
+ switch (hueIntpart) {
187
+ case 0:
188
+ r = v;
189
+ g = t;
190
+ b = p;
191
+ break; // reddish
192
+ case 1:
193
+ (r = q), (g = v);
194
+ b = p;
195
+ break; // yellowish
196
+ case 2:
197
+ (r = p), (g = v);
198
+ b = t;
199
+ break; // greenish
200
+ case 3:
201
+ (r = p), (g = q);
202
+ b = v;
203
+ break; // cyanish
204
+ case 4:
205
+ (r = t), (g = p);
206
+ b = v;
207
+ break; // bluish
208
+ case 5:
209
+ (r = v), (g = p);
210
+ b = q;
211
+ break; // magenta-ish
120
212
  }
121
- /** Create a ColorValue from an RgbColor */
122
- static fromRGB(rgb) {
123
- const alpha = rgb.a ?? 1;
124
- return ColorValue.fromRgbt(rgb.r, rgb.g, rgb.b, Math.round((1 - alpha) * 255));
213
+ return new ColorValue(
214
+ ColorValue.computeTbgrFromComponents(r, g, b, transparency),
215
+ hsv.h,
216
+ );
217
+ }
218
+ /**
219
+ * Compute the 0xTTBBGGRR value corresponding to a string representation of a color. The following representations are supported:
220
+ * *"rgb(255,0,0)"*
221
+ * *"rgba(255,0,0,.2)"*
222
+ * *"rgb(100%,0%,0%)"*
223
+ * *"hsl(120,50%,50%)"*
224
+ * *"#rrggbb"*
225
+ */
226
+ static computeTbgrFromString(val, defaultColorIfNotParsed) {
227
+ val = val.toLowerCase();
228
+ let m = /^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(val);
229
+ if (m) {
230
+ // rgb / hsl
231
+ let color;
232
+ const name = m[1];
233
+ const components = m[2];
234
+ const hasPercent = (str) => str[str.length - 1] === '%';
235
+ const floatOrPercent = (str) => {
236
+ const v = parseFloat(str);
237
+ return 255 * getBoundedValue(hasPercent(str) ? v / 100 : v, 0, 1);
238
+ };
239
+ const intOrPercent = (str) => {
240
+ const v = hasPercent(str)
241
+ ? (parseFloat(str) / 100) * 255
242
+ : parseInt(str, 10);
243
+ return getBoundedValue(v, 0, 255);
244
+ };
245
+ switch (name) {
246
+ case 'rgb':
247
+ case 'rgba':
248
+ color =
249
+ /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(
250
+ components,
251
+ );
252
+ if (color) {
253
+ // rgb(255,0,0) rgba(255,0,0,0.5)
254
+ return [
255
+ this.computeTbgrFromComponents(
256
+ intOrPercent(color[1]),
257
+ intOrPercent(color[2]),
258
+ intOrPercent(color[3]),
259
+ typeof color[4] === 'string'
260
+ ? 255 - floatOrPercent(color[4])
261
+ : 0,
262
+ ),
263
+ undefined,
264
+ ];
265
+ }
266
+ break;
267
+ case 'hsl':
268
+ case 'hsla':
269
+ color =
270
+ /^(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(
271
+ components,
272
+ );
273
+ if (color) {
274
+ // hsl(120,50%,50%) hsla(120,50%,50%,0.5)
275
+ const h = parseFloat(color[1]);
276
+ const s = parseInt(color[2], 10) / 100;
277
+ const l = parseInt(color[3], 10) / 100;
278
+ const t =
279
+ typeof color[4] === 'string' ? 255 - floatOrPercent(color[4]) : 0;
280
+ return [this.computeTbgrFromHSL(h / 360, s, l, t), h];
281
+ }
282
+ break;
283
+ }
284
+ // eslint-disable-next-line no-cond-assign
285
+ } else if ((m = /^\#([A-Fa-f\d]+)$/.exec(val))) {
286
+ // hex color
287
+ const hex = m[1];
288
+ const size = hex.length;
289
+ if (size === 3) {
290
+ // #ff0
291
+ return [
292
+ this.computeTbgrFromComponents(
293
+ parseInt(hex.charAt(0) + hex.charAt(0), 16),
294
+ parseInt(hex.charAt(1) + hex.charAt(1), 16),
295
+ parseInt(hex.charAt(2) + hex.charAt(2), 16),
296
+ 0,
297
+ ),
298
+ undefined,
299
+ ];
300
+ }
301
+ if (size === 6) {
302
+ // #ff0000
303
+ return [
304
+ this.computeTbgrFromComponents(
305
+ parseInt(hex.charAt(0) + hex.charAt(1), 16),
306
+ parseInt(hex.charAt(2) + hex.charAt(3), 16),
307
+ parseInt(hex.charAt(4) + hex.charAt(5), 16),
308
+ 0,
309
+ ),
310
+ undefined,
311
+ ];
312
+ }
313
+ if (size === 8) {
314
+ // #ff0000ff
315
+ return [
316
+ this.computeTbgrFromComponents(
317
+ parseInt(hex.charAt(0) + hex.charAt(1), 16),
318
+ parseInt(hex.charAt(2) + hex.charAt(3), 16),
319
+ parseInt(hex.charAt(4) + hex.charAt(5), 16),
320
+ 255 - parseInt(hex.charAt(6) + hex.charAt(7), 16),
321
+ ),
322
+ undefined,
323
+ ];
324
+ }
125
325
  }
126
- /**
127
- * Create a ColorValue from an HsvColor
128
- */
129
- static fromHSV(hsv) {
130
- const alpha = hsv.a ?? 1;
131
- const transparency = Math.round((1 - alpha) * 255);
132
- // Check for simple case first.
133
- if (!hsv.s || hsv.h === -1) {
134
- // hue must be undefined, have no color only white
135
- const white = 0xff & Math.floor((255.0 * hsv.v) / 100.0 + 0.5 + 3.0e-14);
136
- return ColorValue.fromRgbt(white, white, white, 0);
137
- }
138
- let dhue = hsv.h, dsaturation = hsv.s, dvalue = hsv.v;
139
- if (dhue === 360) {
140
- dhue = 0.0;
141
- }
142
- dhue /= 60; // hue is now [0..6]
143
- const hueIntpart = Math.floor(dhue); // convert double -> int
144
- const hueFractpart = dhue - hueIntpart;
145
- dvalue /= 100;
146
- dsaturation /= 100;
147
- const p = 0xff & Math.floor(dvalue * (1.0 - dsaturation) * 255.0 + 0.5);
148
- const q = 0xff &
149
- Math.floor(dvalue * (1.0 - dsaturation * hueFractpart) * 255.0 + 0.5);
150
- const t = 0xff &
151
- Math.floor(dvalue * (1.0 - dsaturation * (1.0 - hueFractpart)) * 255.0 + 0.5);
152
- const v = 0xff & Math.floor(dvalue * 255 + 0.5);
153
- let r = 0, b = 0, g = 0;
154
- switch (hueIntpart) {
155
- case 0:
156
- r = v;
157
- g = t;
158
- b = p;
159
- break; // reddish
160
- case 1:
161
- (r = q), (g = v);
162
- b = p;
163
- break; // yellowish
164
- case 2:
165
- (r = p), (g = v);
166
- b = t;
167
- break; // greenish
168
- case 3:
169
- (r = p), (g = q);
170
- b = v;
171
- break; // cyanish
172
- case 4:
173
- (r = t), (g = p);
174
- b = v;
175
- break; // bluish
176
- case 5:
177
- (r = v), (g = p);
178
- b = q;
179
- break; // magenta-ish
180
- }
181
- return new ColorValue(ColorValue.computeTbgrFromComponents(r, g, b, transparency), hsv.h);
326
+ if (defaultColorIfNotParsed) {
327
+ return [defaultColorIfNotParsed, undefined];
182
328
  }
183
- /**
184
- * Compute the 0xTTBBGGRR value corresponding to a string representation of a color. The following representations are supported:
185
- * *"rgb(255,0,0)"*
186
- * *"rgba(255,0,0,.2)"*
187
- * *"rgb(100%,0%,0%)"*
188
- * *"hsl(120,50%,50%)"*
189
- * *"#rrggbb"*
190
- */
191
- static computeTbgrFromString(val, defaultColorIfNotParsed) {
192
- val = val.toLowerCase();
193
- let m = /^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(val);
194
- if (m) {
195
- // rgb / hsl
196
- let color;
197
- const name = m[1];
198
- const components = m[2];
199
- const hasPercent = (str) => str[str.length - 1] === '%';
200
- const floatOrPercent = (str) => {
201
- const v = parseFloat(str);
202
- return 255 * getBoundedValue(hasPercent(str) ? v / 100 : v, 0, 1);
203
- };
204
- const intOrPercent = (str) => {
205
- const v = hasPercent(str)
206
- ? (parseFloat(str) / 100) * 255
207
- : parseInt(str, 10);
208
- return getBoundedValue(v, 0, 255);
209
- };
210
- switch (name) {
211
- case 'rgb':
212
- case 'rgba':
213
- color =
214
- /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(components);
215
- if (color) {
216
- // rgb(255,0,0) rgba(255,0,0,0.5)
217
- return [
218
- this.computeTbgrFromComponents(intOrPercent(color[1]), intOrPercent(color[2]), intOrPercent(color[3]), typeof color[4] === 'string'
219
- ? 255 - floatOrPercent(color[4])
220
- : 0),
221
- undefined,
222
- ];
223
- }
224
- break;
225
- case 'hsl':
226
- case 'hsla':
227
- color =
228
- /^(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(components);
229
- if (color) {
230
- // hsl(120,50%,50%) hsla(120,50%,50%,0.5)
231
- const h = parseFloat(color[1]);
232
- const s = parseInt(color[2], 10) / 100;
233
- const l = parseInt(color[3], 10) / 100;
234
- const t = typeof color[4] === 'string' ? 255 - floatOrPercent(color[4]) : 0;
235
- return [this.computeTbgrFromHSL(h / 360, s, l, t), h];
236
- }
237
- break;
238
- }
239
- // eslint-disable-next-line no-cond-assign
240
- }
241
- else if ((m = /^\#([A-Fa-f\d]+)$/.exec(val))) {
242
- // hex color
243
- const hex = m[1];
244
- const size = hex.length;
245
- if (size === 3) {
246
- // #ff0
247
- return [
248
- this.computeTbgrFromComponents(parseInt(hex.charAt(0) + hex.charAt(0), 16), parseInt(hex.charAt(1) + hex.charAt(1), 16), parseInt(hex.charAt(2) + hex.charAt(2), 16), 0),
249
- undefined,
250
- ];
251
- }
252
- if (size === 6) {
253
- // #ff0000
254
- return [
255
- this.computeTbgrFromComponents(parseInt(hex.charAt(0) + hex.charAt(1), 16), parseInt(hex.charAt(2) + hex.charAt(3), 16), parseInt(hex.charAt(4) + hex.charAt(5), 16), 0),
256
- undefined,
257
- ];
258
- }
259
- if (size === 8) {
260
- // #ff0000ff
261
- return [
262
- this.computeTbgrFromComponents(parseInt(hex.charAt(0) + hex.charAt(1), 16), parseInt(hex.charAt(2) + hex.charAt(3), 16), parseInt(hex.charAt(4) + hex.charAt(5), 16), 255 - parseInt(hex.charAt(6) + hex.charAt(7), 16)),
263
- undefined,
264
- ];
265
- }
266
- }
267
- if (defaultColorIfNotParsed) {
268
- return [defaultColorIfNotParsed, undefined];
269
- }
270
- throw new Error('unable to parse string into ColorValue');
329
+ throw new Error('unable to parse string into ColorValue');
330
+ }
331
+ /**
332
+ * Get the r,g,b,t values encoded in an 0xTTBBGGRR value. Values will be integers between 0-255.
333
+ */
334
+ static getColors(tbgr) {
335
+ scratchUInt32[0] = tbgr;
336
+ return {
337
+ b: scratchBytes[2],
338
+ g: scratchBytes[1],
339
+ r: scratchBytes[0],
340
+ t: scratchBytes[3],
341
+ };
342
+ }
343
+ /**
344
+ * Get the RGB value of the 0xTTBBGGRR color as a number in 0xRRGGBB or 0xRRGGBBAA format
345
+ */
346
+ getRgb(includeAlpha) {
347
+ scratchUInt32[0] = this._tbgr;
348
+ if (includeAlpha) {
349
+ return (
350
+ (scratchBytes[0] << 24) +
351
+ (scratchBytes[1] << 16) +
352
+ (scratchBytes[2] << 8) +
353
+ (255 - scratchBytes[3])
354
+ );
271
355
  }
272
- /**
273
- * Get the r,g,b,t values encoded in an 0xTTBBGGRR value. Values will be integers between 0-255.
274
- */
275
- static getColors(tbgr) {
276
- scratchUInt32[0] = tbgr;
277
- return {
278
- b: scratchBytes[2],
279
- g: scratchBytes[1],
280
- r: scratchBytes[0],
281
- t: scratchBytes[3],
282
- };
356
+ return (scratchBytes[0] << 16) + (scratchBytes[1] << 8) + scratchBytes[2];
357
+ }
358
+ /**
359
+ * Get the alpha value for this ColorDef. Will be between 0-255
360
+ */
361
+ getAlpha() {
362
+ return ColorValue.getAlpha(this._tbgr);
363
+ }
364
+ /**
365
+ * Extract the alpha value from a 0xTTBBGGRR color.
366
+ */
367
+ static getAlpha(tbgr) {
368
+ scratchUInt32[0] = tbgr;
369
+ return 255 - scratchBytes[3];
370
+ }
371
+ /**
372
+ * Convert this ColorValue to a string in the form "#rrggbb" or "#rrggbbaa" where values are hex digits of the respective colors
373
+ */
374
+ toHexString(includeAlpha) {
375
+ if (includeAlpha) {
376
+ let value = this.getRgb(includeAlpha);
377
+ if (value < 0) {
378
+ value = 0xffffffff + value + 1;
379
+ }
380
+ return `#${`00000000${value.toString(16)}`.slice(-8)}`;
283
381
  }
284
- /**
285
- * Get the RGB value of the 0xTTBBGGRR color as a number in 0xRRGGBB or 0xRRGGBBAA format
286
- */
287
- getRgb(includeAlpha) {
288
- scratchUInt32[0] = this._tbgr;
289
- if (includeAlpha) {
290
- return ((scratchBytes[0] << 24) +
291
- (scratchBytes[1] << 16) +
292
- (scratchBytes[2] << 8) +
293
- (255 - scratchBytes[3]));
294
- }
295
- return (scratchBytes[0] << 16) + (scratchBytes[1] << 8) + scratchBytes[2];
296
- }
297
- /**
298
- * Get the alpha value for this ColorDef. Will be between 0-255
299
- */
300
- getAlpha() {
301
- return ColorValue.getAlpha(this._tbgr);
302
- }
303
- /**
304
- * Extract the alpha value from a 0xTTBBGGRR color.
305
- */
306
- static getAlpha(tbgr) {
307
- scratchUInt32[0] = tbgr;
308
- return 255 - scratchBytes[3];
309
- }
310
- /**
311
- * Convert this ColorValue to a string in the form "#rrggbb" or "#rrggbbaa" where values are hex digits of the respective colors
312
- */
313
- toHexString(includeAlpha) {
314
- if (includeAlpha) {
315
- let value = this.getRgb(includeAlpha);
316
- if (value < 0) {
317
- value = 0xffffffff + value + 1;
318
- }
319
- return `#${`00000000${value.toString(16)}`.slice(-8)}`;
320
- }
321
- return `#${`000000${this.getRgb().toString(16)}`.slice(-6)}`;
322
- }
323
- /**
324
- * Compute the 0xTTBBGGRR color corresponding to the specified hue, saturation, lightness values.
325
- */
326
- static computeTbgrFromHSL(
382
+ return `#${`000000${this.getRgb().toString(16)}`.slice(-6)}`;
383
+ }
384
+ /**
385
+ * Compute the 0xTTBBGGRR color corresponding to the specified hue, saturation, lightness values.
386
+ */
387
+ static computeTbgrFromHSL(
327
388
  /** 0-1 */
328
- h,
389
+ h,
329
390
  /** 0-1 */
330
- s,
391
+ s,
331
392
  /** 0-1 */
332
- l, transparency = 0) {
333
- const torgb = (p1, q1, t) => {
334
- if (t < 0) {
335
- t += 1;
336
- }
337
- if (t > 1) {
338
- t -= 1;
339
- }
340
- if (t < 1 / 6) {
341
- return p1 + (q1 - p1) * 6 * t;
342
- }
343
- if (t < 1 / 2) {
344
- return q1;
345
- }
346
- if (t < 2 / 3) {
347
- return p1 + (q1 - p1) * 6 * (2 / 3 - t);
348
- }
349
- return p1;
350
- };
351
- const hue2rgb = (p1, q1, t) => Math.round(torgb(p1, q1, t) * 255);
352
- const modulo = (n, m) => ((n % m) + m) % m;
353
- // h,s,l ranges are in 0.0 - 1.0
354
- h = modulo(h, 1);
355
- s = getBoundedValue(s, 0, 1);
356
- l = getBoundedValue(l, 0, 1);
357
- if (s === 0) {
358
- l *= 255;
359
- return this.computeTbgrFromComponents(l, l, l, transparency);
360
- }
361
- const p = l <= 0.5 ? l * (1 + s) : l + s - l * s;
362
- const q = 2 * l - p;
363
- return this.computeTbgrFromComponents(hue2rgb(q, p, h + 1 / 3), hue2rgb(q, p, h), hue2rgb(q, p, h - 1 / 3), transparency);
364
- }
365
- /**
366
- * Return HslColor from this ColorValue
367
- */
368
- toHslColor() {
369
- return {
370
- ...ColorValue.toHsl(this._tbgr),
371
- ...(this._hue != undefined && { h: this._hue }),
372
- };
373
- }
374
- /** Create an HslColor from this ColorValue */
375
- static toHsl(tbgr) {
376
- const { r, g, b } = ColorValue.getColors(tbgr);
377
- const red = r / 255;
378
- const green = g / 255;
379
- const blue = b / 255;
380
- const cMin = Math.min(red, green, blue);
381
- const cMax = Math.max(red, green, blue);
382
- const delta = cMax - cMin;
383
- let hue = 0;
384
- let saturation = 0;
385
- if (0 === delta) {
386
- hue = 0;
387
- }
388
- else if (red === cMax) {
389
- hue = ((green - blue) / delta) % 6;
390
- }
391
- else if (green === cMax) {
392
- hue = (blue - red) / delta + 2;
393
- }
394
- else {
395
- hue = (red - green) / delta + 4;
396
- }
397
- hue = Math.round(hue * 60);
398
- if (hue < 0) {
399
- hue += 360;
400
- }
401
- let lightness = (cMax + cMin) / 2;
402
- saturation = 0 === delta ? 0 : delta / (1 - Math.abs(2 * lightness - 1));
403
- // round values to 1 decimal place
404
- saturation = Number((saturation * 100).toFixed(1));
405
- lightness = Number((lightness * 100).toFixed(1));
406
- return {
407
- h: hue,
408
- s: saturation,
409
- l: lightness,
410
- a: this.getAlpha(tbgr) / 255,
411
- };
393
+ l,
394
+ transparency = 0,
395
+ ) {
396
+ const torgb = (p1, q1, t) => {
397
+ if (t < 0) {
398
+ t += 1;
399
+ }
400
+ if (t > 1) {
401
+ t -= 1;
402
+ }
403
+ if (t < 1 / 6) {
404
+ return p1 + (q1 - p1) * 6 * t;
405
+ }
406
+ if (t < 1 / 2) {
407
+ return q1;
408
+ }
409
+ if (t < 2 / 3) {
410
+ return p1 + (q1 - p1) * 6 * (2 / 3 - t);
411
+ }
412
+ return p1;
413
+ };
414
+ const hue2rgb = (p1, q1, t) => Math.round(torgb(p1, q1, t) * 255);
415
+ const modulo = (n, m) => ((n % m) + m) % m;
416
+ // h,s,l ranges are in 0.0 - 1.0
417
+ h = modulo(h, 1);
418
+ s = getBoundedValue(s, 0, 1);
419
+ l = getBoundedValue(l, 0, 1);
420
+ if (s === 0) {
421
+ l *= 255;
422
+ return this.computeTbgrFromComponents(l, l, l, transparency);
412
423
  }
413
- /**
414
- * Create an RgbColor from this ColorValue
415
- */
416
- toRgbColor() {
417
- const { r, g, b } = ColorValue.getColors(this._tbgr);
418
- return { r, g, b, a: this.getAlpha() / 255 };
424
+ const p = l <= 0.5 ? l * (1 + s) : l + s - l * s;
425
+ const q = 2 * l - p;
426
+ return this.computeTbgrFromComponents(
427
+ hue2rgb(q, p, h + 1 / 3),
428
+ hue2rgb(q, p, h),
429
+ hue2rgb(q, p, h - 1 / 3),
430
+ transparency,
431
+ );
432
+ }
433
+ /**
434
+ * Return HslColor from this ColorValue
435
+ */
436
+ toHslColor() {
437
+ return {
438
+ ...ColorValue.toHsl(this._tbgr),
439
+ ...(this._hue != undefined && { h: this._hue }),
440
+ };
441
+ }
442
+ /** Create an HslColor from this ColorValue */
443
+ static toHsl(tbgr) {
444
+ const { r, g, b } = ColorValue.getColors(tbgr);
445
+ const red = r / 255;
446
+ const green = g / 255;
447
+ const blue = b / 255;
448
+ const cMin = Math.min(red, green, blue);
449
+ const cMax = Math.max(red, green, blue);
450
+ const delta = cMax - cMin;
451
+ let hue = 0;
452
+ let saturation = 0;
453
+ if (0 === delta) {
454
+ hue = 0;
455
+ } else if (red === cMax) {
456
+ hue = ((green - blue) / delta) % 6;
457
+ } else if (green === cMax) {
458
+ hue = (blue - red) / delta + 2;
459
+ } else {
460
+ hue = (red - green) / delta + 4;
419
461
  }
420
- /**
421
- * Return HsvColor from this ColorValue
422
- */
423
- toHsvColor() {
424
- return {
425
- ...ColorValue.toHsv(this._tbgr),
426
- ...(this._hue != undefined && { h: this._hue }),
427
- };
462
+ hue = Math.round(hue * 60);
463
+ if (hue < 0) {
464
+ hue += 360;
428
465
  }
429
- /**
430
- * Create an HsvColor from this ColorValue
431
- */
432
- static toHsv(tbgr) {
433
- const { r, g, b } = ColorValue.getColors(tbgr);
434
- const red = r / 255;
435
- const green = g / 255;
436
- const blue = b / 255;
437
- const cMin = Math.min(red, green, blue);
438
- const cMax = Math.max(red, green, blue);
439
- const delta = cMax - cMin;
440
- let hue = 0;
441
- if (0 === delta) {
442
- hue = 0;
443
- }
444
- else if (red === cMax) {
445
- hue = ((green - blue) / delta) % 6;
446
- }
447
- else if (green === cMax) {
448
- hue = (blue - red) / delta + 2;
449
- }
450
- else {
451
- hue = (red - green) / delta + 4;
452
- }
453
- hue = Math.round(hue * 60);
454
- if (hue < 0) {
455
- hue += 360;
456
- }
457
- let brightness = cMax;
458
- let saturation = cMax === 0 ? 0 : delta / cMax;
459
- // round values to 1 decimal place
460
- saturation = Number((saturation * 100).toFixed(1));
461
- brightness = Number((brightness * 100).toFixed(1));
462
- return {
463
- h: hue,
464
- s: saturation,
465
- v: brightness,
466
- a: this.getAlpha(tbgr) / 255,
467
- };
466
+ let lightness = (cMax + cMin) / 2;
467
+ saturation = 0 === delta ? 0 : delta / (1 - Math.abs(2 * lightness - 1));
468
+ // round values to 1 decimal place
469
+ saturation = Number((saturation * 100).toFixed(1));
470
+ lightness = Number((lightness * 100).toFixed(1));
471
+ return {
472
+ h: hue,
473
+ s: saturation,
474
+ l: lightness,
475
+ a: this.getAlpha(tbgr) / 255,
476
+ };
477
+ }
478
+ /**
479
+ * Create an RgbColor from this ColorValue
480
+ */
481
+ toRgbColor() {
482
+ const { r, g, b } = ColorValue.getColors(this._tbgr);
483
+ return { r, g, b, a: this.getAlpha() / 255 };
484
+ }
485
+ /**
486
+ * Return HsvColor from this ColorValue
487
+ */
488
+ toHsvColor() {
489
+ return {
490
+ ...ColorValue.toHsv(this._tbgr),
491
+ ...(this._hue != undefined && { h: this._hue }),
492
+ };
493
+ }
494
+ /**
495
+ * Create an HsvColor from this ColorValue
496
+ */
497
+ static toHsv(tbgr) {
498
+ const { r, g, b } = ColorValue.getColors(tbgr);
499
+ const red = r / 255;
500
+ const green = g / 255;
501
+ const blue = b / 255;
502
+ const cMin = Math.min(red, green, blue);
503
+ const cMax = Math.max(red, green, blue);
504
+ const delta = cMax - cMin;
505
+ let hue = 0;
506
+ if (0 === delta) {
507
+ hue = 0;
508
+ } else if (red === cMax) {
509
+ hue = ((green - blue) / delta) % 6;
510
+ } else if (green === cMax) {
511
+ hue = (blue - red) / delta + 2;
512
+ } else {
513
+ hue = (red - green) / delta + 4;
468
514
  }
469
- /** True if the value of this ColorValue is the same as another ColorValue. */
470
- equals(other) {
471
- return this._tbgr === other._tbgr;
515
+ hue = Math.round(hue * 60);
516
+ if (hue < 0) {
517
+ hue += 360;
472
518
  }
473
- static getFormattedColorNumber(value, precision = 1) {
474
- if (0 === precision) {
475
- Math.round(value).toString();
476
- }
477
- return Number(value.toFixed(precision)).toString();
519
+ let brightness = cMax;
520
+ let saturation = cMax === 0 ? 0 : delta / cMax;
521
+ // round values to 1 decimal place
522
+ saturation = Number((saturation * 100).toFixed(1));
523
+ brightness = Number((brightness * 100).toFixed(1));
524
+ return {
525
+ h: hue,
526
+ s: saturation,
527
+ v: brightness,
528
+ a: this.getAlpha(tbgr) / 255,
529
+ };
530
+ }
531
+ /** True if the value of this ColorValue is the same as another ColorValue. */
532
+ equals(other) {
533
+ return this._tbgr === other._tbgr;
534
+ }
535
+ static getFormattedColorNumber(value, precision = 1) {
536
+ if (0 === precision) {
537
+ Math.round(value).toString();
478
538
  }
479
- /** Convert the 0xTTBBGGRR color to a string of the form "rgba(r,g,b,a)" where the color components are specified in decimal and the alpha component is a fraction. */
480
- toRgbString(includeAlpha) {
481
- const rgb = this.toRgbColor();
482
- const rgbString = `${rgb.r}, ${rgb.g}, ${rgb.b}`;
483
- if (includeAlpha) {
484
- const alpha = rgb.a ?? 1;
485
- return `rgba(${rgbString}, ${ColorValue.getFormattedColorNumber(alpha, 2)})`;
486
- }
487
- return `rgb(${rgbString})`;
539
+ return Number(value.toFixed(precision)).toString();
540
+ }
541
+ /** Convert the 0xTTBBGGRR color to a string of the form "rgba(r,g,b,a)" where the color components are specified in decimal and the alpha component is a fraction. */
542
+ toRgbString(includeAlpha) {
543
+ const rgb = this.toRgbColor();
544
+ const rgbString = `${rgb.r}, ${rgb.g}, ${rgb.b}`;
545
+ if (includeAlpha) {
546
+ const alpha = rgb.a ?? 1;
547
+ return `rgba(${rgbString}, ${ColorValue.getFormattedColorNumber(
548
+ alpha,
549
+ 2,
550
+ )})`;
488
551
  }
489
- /** Convert this ColorValue to a string in the form "hsl(h,s,l) or hsla(h,s,l,a)" - i.e hsl(120,50%,50%). */
490
- toHslString(includeAlpha) {
491
- const hsl = this.toHslColor();
492
- const hslString = `${ColorValue.getFormattedColorNumber(this._hue ?? hsl.h)}, ${ColorValue.getFormattedColorNumber(hsl.s)}%, ${ColorValue.getFormattedColorNumber(hsl.l)}%`;
493
- if (includeAlpha) {
494
- const alpha = hsl.a ?? 1;
495
- return `hsla(${hslString}, ${ColorValue.getFormattedColorNumber(alpha, 2)})`;
496
- }
497
- return `hsl(${hslString})`;
552
+ return `rgb(${rgbString})`;
553
+ }
554
+ /** Convert this ColorValue to a string in the form "hsl(h,s,l) or hsla(h,s,l,a)" - i.e hsl(120,50%,50%). */
555
+ toHslString(includeAlpha) {
556
+ const hsl = this.toHslColor();
557
+ const hslString = `${ColorValue.getFormattedColorNumber(
558
+ this._hue ?? hsl.h,
559
+ )}, ${ColorValue.getFormattedColorNumber(
560
+ hsl.s,
561
+ )}%, ${ColorValue.getFormattedColorNumber(hsl.l)}%`;
562
+ if (includeAlpha) {
563
+ const alpha = hsl.a ?? 1;
564
+ return `hsla(${hslString}, ${ColorValue.getFormattedColorNumber(
565
+ alpha,
566
+ 2,
567
+ )})`;
498
568
  }
499
- /** Convert this ColorValue to a string in the form "hsv(h,s,v) or hsva(h,s,v,a)" - i.e hsv(120,50%,50%). */
500
- toHsvString(includeAlpha) {
501
- const hsv = this.toHsvColor();
502
- const hsvString = `${this._hue ?? hsv.h}, ${hsv.s}%, ${hsv.v}%`;
503
- if (includeAlpha) {
504
- const alpha = hsv.a ?? 1;
505
- return `hsva(${hsvString}, ${ColorValue.getFormattedColorNumber(alpha, 2)})`;
506
- }
507
- return `hsv(${hsvString})`;
569
+ return `hsl(${hslString})`;
570
+ }
571
+ /** Convert this ColorValue to a string in the form "hsv(h,s,v) or hsva(h,s,v,a)" - i.e hsv(120,50%,50%). */
572
+ toHsvString(includeAlpha) {
573
+ const hsv = this.toHsvColor();
574
+ const hsvString = `${this._hue ?? hsv.h}, ${hsv.s}%, ${hsv.v}%`;
575
+ if (includeAlpha) {
576
+ const alpha = hsv.a ?? 1;
577
+ return `hsva(${hsvString}, ${ColorValue.getFormattedColorNumber(
578
+ alpha,
579
+ 2,
580
+ )})`;
508
581
  }
582
+ return `hsv(${hsvString})`;
583
+ }
509
584
  }