@itwin/itwinui-react 3.13.4 → 3.14.1

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 (631) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/DEV-cjs/core/Alert/Alert.js +125 -72
  3. package/DEV-cjs/core/Avatar/Avatar.js +70 -44
  4. package/DEV-cjs/core/AvatarGroup/AvatarGroup.js +71 -34
  5. package/DEV-cjs/core/Backdrop/Backdrop.js +26 -22
  6. package/DEV-cjs/core/Badge/Badge.js +49 -42
  7. package/DEV-cjs/core/Breadcrumbs/Breadcrumbs.js +165 -86
  8. package/DEV-cjs/core/ButtonGroup/ButtonGroup.js +141 -79
  9. package/DEV-cjs/core/Buttons/Button.js +95 -49
  10. package/DEV-cjs/core/Buttons/DropdownButton.js +53 -35
  11. package/DEV-cjs/core/Buttons/IconButton.js +77 -41
  12. package/DEV-cjs/core/Buttons/IdeasButton.js +30 -26
  13. package/DEV-cjs/core/Buttons/SplitButton.js +90 -56
  14. package/DEV-cjs/core/Carousel/Carousel.js +77 -67
  15. package/DEV-cjs/core/Carousel/CarouselContext.js +10 -10
  16. package/DEV-cjs/core/Carousel/CarouselDot.js +31 -27
  17. package/DEV-cjs/core/Carousel/CarouselDotsList.js +148 -113
  18. package/DEV-cjs/core/Carousel/CarouselNavigation.js +98 -69
  19. package/DEV-cjs/core/Carousel/CarouselSlide.js +51 -42
  20. package/DEV-cjs/core/Carousel/CarouselSlider.js +68 -61
  21. package/DEV-cjs/core/Checkbox/Checkbox.js +96 -54
  22. package/DEV-cjs/core/ColorPicker/ColorBuilder.js +274 -228
  23. package/DEV-cjs/core/ColorPicker/ColorInputPanel.js +398 -366
  24. package/DEV-cjs/core/ColorPicker/ColorPalette.js +56 -36
  25. package/DEV-cjs/core/ColorPicker/ColorPicker.js +88 -69
  26. package/DEV-cjs/core/ColorPicker/ColorPickerContext.js +22 -18
  27. package/DEV-cjs/core/ColorPicker/ColorSwatch.js +50 -33
  28. package/DEV-cjs/core/ComboBox/ComboBox.js +395 -294
  29. package/DEV-cjs/core/ComboBox/ComboBox.types-test.js +87 -80
  30. package/DEV-cjs/core/ComboBox/ComboBoxEndIcon.js +36 -27
  31. package/DEV-cjs/core/ComboBox/ComboBoxInput.js +190 -128
  32. package/DEV-cjs/core/ComboBox/ComboBoxInputContainer.js +40 -28
  33. package/DEV-cjs/core/ComboBox/ComboBoxMenu.js +132 -93
  34. package/DEV-cjs/core/ComboBox/ComboBoxMenuItem.js +75 -34
  35. package/DEV-cjs/core/ComboBox/ComboBoxMultipleContainer.js +18 -18
  36. package/DEV-cjs/core/ComboBox/helpers.js +15 -14
  37. package/DEV-cjs/core/DatePicker/DatePicker.js +556 -353
  38. package/DEV-cjs/core/Dialog/Dialog.js +86 -58
  39. package/DEV-cjs/core/Dialog/DialogBackdrop.js +52 -39
  40. package/DEV-cjs/core/Dialog/DialogButtonBar.js +9 -9
  41. package/DEV-cjs/core/Dialog/DialogContent.js +9 -9
  42. package/DEV-cjs/core/Dialog/DialogContext.js +16 -15
  43. package/DEV-cjs/core/Dialog/DialogDragContext.js +20 -19
  44. package/DEV-cjs/core/Dialog/DialogMain.js +174 -122
  45. package/DEV-cjs/core/Dialog/DialogTitleBar.js +68 -33
  46. package/DEV-cjs/core/Dialog/DialogTitleBarTitle.js +9 -9
  47. package/DEV-cjs/core/Divider/Divider.js +22 -22
  48. package/DEV-cjs/core/DropdownMenu/DropdownMenu.js +63 -37
  49. package/DEV-cjs/core/ExpandableBlock/ExpandableBlock.js +195 -125
  50. package/DEV-cjs/core/Fieldset/Fieldset.js +34 -23
  51. package/DEV-cjs/core/FileUpload/FileEmptyCard.js +43 -24
  52. package/DEV-cjs/core/FileUpload/FileUpload.js +94 -57
  53. package/DEV-cjs/core/FileUpload/FileUploadCard.js +181 -124
  54. package/DEV-cjs/core/FileUpload/FileUploadTemplate.js +63 -35
  55. package/DEV-cjs/core/Flex/Flex.js +78 -77
  56. package/DEV-cjs/core/Footer/Footer.js +119 -85
  57. package/DEV-cjs/core/Footer/FooterItem.js +9 -9
  58. package/DEV-cjs/core/Footer/FooterList.js +9 -9
  59. package/DEV-cjs/core/Footer/FooterSeparator.js +10 -10
  60. package/DEV-cjs/core/Header/Header.js +86 -44
  61. package/DEV-cjs/core/Header/HeaderBasicButton.js +30 -20
  62. package/DEV-cjs/core/Header/HeaderBreadcrumbs.js +59 -36
  63. package/DEV-cjs/core/Header/HeaderButton.js +90 -46
  64. package/DEV-cjs/core/Header/HeaderDropdownButton.js +55 -44
  65. package/DEV-cjs/core/Header/HeaderLogo.js +53 -30
  66. package/DEV-cjs/core/Header/HeaderSplitButton.js +72 -44
  67. package/DEV-cjs/core/Icon/Icon.js +41 -35
  68. package/DEV-cjs/core/InformationPanel/InformationPanel.js +97 -62
  69. package/DEV-cjs/core/InformationPanel/InformationPanelBody.js +9 -9
  70. package/DEV-cjs/core/InformationPanel/InformationPanelContent.js +30 -22
  71. package/DEV-cjs/core/InformationPanel/InformationPanelHeader.js +51 -32
  72. package/DEV-cjs/core/InformationPanel/InformationPanelWrapper.js +12 -10
  73. package/DEV-cjs/core/Input/Input.js +26 -26
  74. package/DEV-cjs/core/InputGrid/InputGrid.js +151 -117
  75. package/DEV-cjs/core/InputGroup/InputGroup.js +85 -48
  76. package/DEV-cjs/core/InputWithDecorations/InputWithDecorations.js +60 -44
  77. package/DEV-cjs/core/Label/Label.js +40 -25
  78. package/DEV-cjs/core/LabeledInput/LabeledInput.js +86 -42
  79. package/DEV-cjs/core/LabeledSelect/LabeledSelect.js +71 -39
  80. package/DEV-cjs/core/LabeledSelect/LabeledSelect.types-test.js +100 -81
  81. package/DEV-cjs/core/LabeledTextarea/LabeledTextarea.js +19 -17
  82. package/DEV-cjs/core/LinkAction/LinkAction.js +27 -26
  83. package/DEV-cjs/core/List/List.js +11 -11
  84. package/DEV-cjs/core/List/ListItem.js +42 -34
  85. package/DEV-cjs/core/Menu/Menu.js +213 -127
  86. package/DEV-cjs/core/Menu/MenuDivider.js +11 -11
  87. package/DEV-cjs/core/Menu/MenuExtraContent.js +10 -10
  88. package/DEV-cjs/core/Menu/MenuItem.js +140 -77
  89. package/DEV-cjs/core/Menu/MenuItemSkeleton.js +65 -40
  90. package/DEV-cjs/core/Modal/Modal.js +54 -31
  91. package/DEV-cjs/core/Modal/ModalButtonBar.js +9 -9
  92. package/DEV-cjs/core/Modal/ModalContent.js +9 -9
  93. package/DEV-cjs/core/NonIdealState/ErrorPage.js +208 -127
  94. package/DEV-cjs/core/NonIdealState/NonIdealState.js +84 -35
  95. package/DEV-cjs/core/NotificationMarker/NotificationMarker.js +39 -25
  96. package/DEV-cjs/core/Overlay/Overlay.js +55 -41
  97. package/DEV-cjs/core/Popover/Popover.js +292 -193
  98. package/DEV-cjs/core/ProgressIndicators/ProgressLinear.js +70 -33
  99. package/DEV-cjs/core/ProgressIndicators/ProgressRadial.js +67 -40
  100. package/DEV-cjs/core/Radio/Radio.js +66 -38
  101. package/DEV-cjs/core/RadioTiles/RadioTile.js +88 -43
  102. package/DEV-cjs/core/RadioTiles/RadioTileGroup.js +29 -21
  103. package/DEV-cjs/core/SearchBox/SearchBox.js +203 -130
  104. package/DEV-cjs/core/Select/Select.js +457 -274
  105. package/DEV-cjs/core/Select/Select.types-test.js +112 -87
  106. package/DEV-cjs/core/Select/SelectTag.js +32 -24
  107. package/DEV-cjs/core/Select/SelectTagContainer.js +38 -25
  108. package/DEV-cjs/core/SideNavigation/SideNavigation.js +132 -64
  109. package/DEV-cjs/core/SideNavigation/SidenavButton.js +55 -33
  110. package/DEV-cjs/core/SideNavigation/SidenavSubmenu.js +33 -22
  111. package/DEV-cjs/core/SideNavigation/SidenavSubmenuHeader.js +41 -24
  112. package/DEV-cjs/core/SkipToContentLink/SkipToContentLink.js +28 -21
  113. package/DEV-cjs/core/Slider/Slider.js +352 -259
  114. package/DEV-cjs/core/Slider/Thumb.js +111 -98
  115. package/DEV-cjs/core/Slider/Track.js +93 -61
  116. package/DEV-cjs/core/StatusMessage/StatusMessage.js +46 -27
  117. package/DEV-cjs/core/Stepper/Stepper.js +86 -44
  118. package/DEV-cjs/core/Stepper/StepperStep.js +113 -59
  119. package/DEV-cjs/core/Stepper/WorkflowDiagram.js +37 -29
  120. package/DEV-cjs/core/Stepper/WorkflowDiagramStep.js +48 -28
  121. package/DEV-cjs/core/Surface/Surface.js +98 -76
  122. package/DEV-cjs/core/Table/ColumnHeader.js +194 -0
  123. package/DEV-cjs/core/Table/SubRowExpander.js +45 -34
  124. package/DEV-cjs/core/Table/Table.js +688 -511
  125. package/DEV-cjs/core/Table/TableCell.js +104 -61
  126. package/DEV-cjs/core/Table/TablePaginator.js +314 -178
  127. package/DEV-cjs/core/Table/TableRowMemoized.js +183 -90
  128. package/DEV-cjs/core/Table/actionHandlers/expandHandler.js +18 -18
  129. package/DEV-cjs/core/Table/actionHandlers/filterHandler.js +31 -23
  130. package/DEV-cjs/core/Table/actionHandlers/index.js +32 -31
  131. package/DEV-cjs/core/Table/actionHandlers/resizeHandler.js +26 -25
  132. package/DEV-cjs/core/Table/actionHandlers/selectHandler.js +124 -88
  133. package/DEV-cjs/core/Table/cells/DefaultCell.js +93 -44
  134. package/DEV-cjs/core/Table/cells/EditableCell.js +85 -63
  135. package/DEV-cjs/core/Table/cells/index.js +15 -14
  136. package/DEV-cjs/core/Table/columns/actionColumn.js +100 -78
  137. package/DEV-cjs/core/Table/columns/expanderColumn.js +56 -49
  138. package/DEV-cjs/core/Table/columns/index.js +25 -24
  139. package/DEV-cjs/core/Table/columns/selectionColumn.js +79 -58
  140. package/DEV-cjs/core/Table/filters/BaseFilter.js +31 -25
  141. package/DEV-cjs/core/Table/filters/DateRangeFilter/DatePickerInput.js +108 -72
  142. package/DEV-cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.js +115 -91
  143. package/DEV-cjs/core/Table/filters/FilterButtonBar.js +56 -33
  144. package/DEV-cjs/core/Table/filters/FilterToggle.js +71 -54
  145. package/DEV-cjs/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +56 -60
  146. package/DEV-cjs/core/Table/filters/TextFilter/TextFilter.js +38 -36
  147. package/DEV-cjs/core/Table/filters/customFilterFunctions.js +26 -20
  148. package/DEV-cjs/core/Table/filters/defaultFilterFunctions.js +119 -77
  149. package/DEV-cjs/core/Table/filters/index.js +23 -22
  150. package/DEV-cjs/core/Table/filters/tableFilters.js +28 -25
  151. package/DEV-cjs/core/Table/filters/types.js +3 -3
  152. package/DEV-cjs/core/Table/hooks/index.js +39 -38
  153. package/DEV-cjs/core/Table/hooks/useColumnDragAndDrop.js +118 -101
  154. package/DEV-cjs/core/Table/hooks/useExpanderCell.js +39 -29
  155. package/DEV-cjs/core/Table/hooks/useResizeColumns.js +346 -248
  156. package/DEV-cjs/core/Table/hooks/useScrollToRow.js +42 -38
  157. package/DEV-cjs/core/Table/hooks/useSelectionCell.js +26 -19
  158. package/DEV-cjs/core/Table/hooks/useStickyColumns.js +55 -47
  159. package/DEV-cjs/core/Table/hooks/useSubRowFiltering.js +89 -86
  160. package/DEV-cjs/core/Table/hooks/useSubRowSelection.js +39 -39
  161. package/DEV-cjs/core/Table/index.js +42 -41
  162. package/DEV-cjs/core/Table/utils.js +66 -64
  163. package/DEV-cjs/core/Tabs/Tabs.js +388 -260
  164. package/DEV-cjs/core/Tag/Tag.js +80 -42
  165. package/DEV-cjs/core/Tag/TagContainer.js +31 -23
  166. package/DEV-cjs/core/Textarea/Textarea.js +19 -17
  167. package/DEV-cjs/core/ThemeProvider/ThemeContext.js +10 -10
  168. package/DEV-cjs/core/ThemeProvider/ThemeProvider.js +276 -172
  169. package/DEV-cjs/core/Tile/Tile.js +310 -173
  170. package/DEV-cjs/core/TimePicker/TimePicker.js +451 -263
  171. package/DEV-cjs/core/Toast/Toast.js +226 -157
  172. package/DEV-cjs/core/Toast/Toaster.js +142 -118
  173. package/DEV-cjs/core/ToggleSwitch/ToggleSwitch.js +76 -42
  174. package/DEV-cjs/core/Tooltip/Tooltip.js +221 -170
  175. package/DEV-cjs/core/TransferList/TransferList.js +171 -132
  176. package/DEV-cjs/core/Tree/Tree.js +226 -180
  177. package/DEV-cjs/core/Tree/TreeContext.js +20 -18
  178. package/DEV-cjs/core/Tree/TreeNode.js +254 -143
  179. package/DEV-cjs/core/Tree/TreeNodeExpander.js +40 -31
  180. package/DEV-cjs/core/Typography/Anchor.js +41 -27
  181. package/DEV-cjs/core/Typography/Blockquote.js +26 -21
  182. package/DEV-cjs/core/Typography/Code.js +9 -9
  183. package/DEV-cjs/core/Typography/Kbd.js +43 -38
  184. package/DEV-cjs/core/Typography/Text.js +45 -31
  185. package/DEV-cjs/core/VisuallyHidden/VisuallyHidden.js +47 -30
  186. package/DEV-cjs/index.js +475 -474
  187. package/DEV-cjs/package.json +1 -0
  188. package/DEV-cjs/react-table/react-table.js +3 -3
  189. package/DEV-cjs/react-table/react-table.types-test.js +628 -476
  190. package/DEV-cjs/styles.js +17 -1
  191. package/DEV-cjs/utils/color/ColorValue.js +429 -323
  192. package/DEV-cjs/utils/color/index.js +5 -5
  193. package/DEV-cjs/utils/components/AutoclearingHiddenLiveRegion.js +31 -26
  194. package/DEV-cjs/utils/components/Box.js +9 -9
  195. package/DEV-cjs/utils/components/ButtonBase.js +41 -35
  196. package/DEV-cjs/utils/components/FieldsetBase.js +9 -9
  197. package/DEV-cjs/utils/components/FocusTrap.js +48 -45
  198. package/DEV-cjs/utils/components/InputContainer.js +67 -34
  199. package/DEV-cjs/utils/components/InputFlexContainer.js +63 -49
  200. package/DEV-cjs/utils/components/InputWithIcon.js +9 -9
  201. package/DEV-cjs/utils/components/LineClamp.js +33 -24
  202. package/DEV-cjs/utils/components/MiddleTextTruncation.js +37 -33
  203. package/DEV-cjs/utils/components/Portal.js +35 -32
  204. package/DEV-cjs/utils/components/Resizer.js +221 -185
  205. package/DEV-cjs/utils/components/ShadowRoot.js +85 -69
  206. package/DEV-cjs/utils/components/WithCSSTransition.js +57 -50
  207. package/DEV-cjs/utils/components/index.js +18 -18
  208. package/DEV-cjs/utils/functions/colors.js +37 -35
  209. package/DEV-cjs/utils/functions/date.js +15 -15
  210. package/DEV-cjs/utils/functions/dev.js +12 -26
  211. package/DEV-cjs/utils/functions/dom.js +39 -39
  212. package/DEV-cjs/utils/functions/focusable.js +81 -63
  213. package/DEV-cjs/utils/functions/import.js +28 -22
  214. package/DEV-cjs/utils/functions/index.js +14 -14
  215. package/DEV-cjs/utils/functions/numbers.js +26 -24
  216. package/DEV-cjs/utils/functions/polymorphic.js +56 -43
  217. package/DEV-cjs/utils/functions/react.js +25 -23
  218. package/DEV-cjs/utils/functions/supports.js +11 -10
  219. package/DEV-cjs/utils/hooks/index.js +21 -20
  220. package/DEV-cjs/utils/hooks/useContainerWidth.js +31 -26
  221. package/DEV-cjs/utils/hooks/useControlledState.js +28 -27
  222. package/DEV-cjs/utils/hooks/useDragAndDrop.js +112 -88
  223. package/DEV-cjs/utils/hooks/useEventListener.js +23 -28
  224. package/DEV-cjs/utils/hooks/useGlobals.js +46 -40
  225. package/DEV-cjs/utils/hooks/useId.js +17 -17
  226. package/DEV-cjs/utils/hooks/useIntersection.js +38 -38
  227. package/DEV-cjs/utils/hooks/useIsClient.js +16 -16
  228. package/DEV-cjs/utils/hooks/useIsomorphicLayoutEffect.js +12 -11
  229. package/DEV-cjs/utils/hooks/useLatestRef.js +16 -18
  230. package/DEV-cjs/utils/hooks/useMediaQuery.js +32 -23
  231. package/DEV-cjs/utils/hooks/useMergedRefs.js +25 -23
  232. package/DEV-cjs/utils/hooks/useOverflow.js +68 -72
  233. package/DEV-cjs/utils/hooks/useResizeObserver.js +31 -33
  234. package/DEV-cjs/utils/hooks/useSafeContext.js +15 -14
  235. package/DEV-cjs/utils/hooks/useSyncExternalStore.js +37 -40
  236. package/DEV-cjs/utils/hooks/useVirtualScroll.js +42 -40
  237. package/DEV-cjs/utils/hooks/useWarningLogger.js +43 -0
  238. package/DEV-cjs/utils/icons/StatusIconMap.js +34 -30
  239. package/DEV-cjs/utils/icons/Svg.js +12 -12
  240. package/DEV-cjs/utils/icons/SvgCalendar.js +19 -14
  241. package/DEV-cjs/utils/icons/SvgCaretDownSmall.js +19 -14
  242. package/DEV-cjs/utils/icons/SvgCaretRightSmall.js +19 -14
  243. package/DEV-cjs/utils/icons/SvgCaretUpSmall.js +19 -14
  244. package/DEV-cjs/utils/icons/SvgCheckmark.js +19 -14
  245. package/DEV-cjs/utils/icons/SvgCheckmarkSmall.js +19 -14
  246. package/DEV-cjs/utils/icons/SvgChevronLeft.js +19 -14
  247. package/DEV-cjs/utils/icons/SvgChevronLeftDouble.js +19 -14
  248. package/DEV-cjs/utils/icons/SvgChevronRight.js +19 -14
  249. package/DEV-cjs/utils/icons/SvgChevronRightDouble.js +19 -14
  250. package/DEV-cjs/utils/icons/SvgChevronRightSmall.js +19 -14
  251. package/DEV-cjs/utils/icons/SvgClose.js +19 -14
  252. package/DEV-cjs/utils/icons/SvgCloseSmall.js +19 -14
  253. package/DEV-cjs/utils/icons/SvgColumnManager.js +19 -14
  254. package/DEV-cjs/utils/icons/SvgDocument.js +19 -14
  255. package/DEV-cjs/utils/icons/SvgFilter.js +19 -14
  256. package/DEV-cjs/utils/icons/SvgFilterHollow.js +19 -14
  257. package/DEV-cjs/utils/icons/SvgImportantSmall.js +19 -14
  258. package/DEV-cjs/utils/icons/SvgInfoCircular.js +19 -14
  259. package/DEV-cjs/utils/icons/SvgMore.js +19 -14
  260. package/DEV-cjs/utils/icons/SvgMoreVertical.js +19 -14
  261. package/DEV-cjs/utils/icons/SvgNew.js +19 -14
  262. package/DEV-cjs/utils/icons/SvgSearch.js +19 -14
  263. package/DEV-cjs/utils/icons/SvgSmileyHappy.js +19 -14
  264. package/DEV-cjs/utils/icons/SvgSortDown.js +19 -14
  265. package/DEV-cjs/utils/icons/SvgSortUp.js +19 -14
  266. package/DEV-cjs/utils/icons/SvgStatusError.js +19 -14
  267. package/DEV-cjs/utils/icons/SvgStatusSuccess.js +19 -14
  268. package/DEV-cjs/utils/icons/SvgStatusWarning.js +19 -14
  269. package/DEV-cjs/utils/icons/SvgSwap.js +19 -14
  270. package/DEV-cjs/utils/icons/SvgUpload.js +19 -14
  271. package/DEV-cjs/utils/icons/index.js +36 -36
  272. package/DEV-cjs/utils/index.js +12 -12
  273. package/DEV-cjs/utils/meta.js +11 -11
  274. package/DEV-cjs/utils/props.js +3 -3
  275. package/DEV-cjs/utils/providers/HydrationProvider.js +47 -35
  276. package/DEV-cjs/utils/providers/ScopeProvider.js +55 -53
  277. package/DEV-cjs/utils/providers/index.js +6 -6
  278. package/DEV-cjs/utils/types.js +3 -3
  279. package/DEV-esm/core/Alert/Alert.js +112 -57
  280. package/DEV-esm/core/Avatar/Avatar.js +45 -26
  281. package/DEV-esm/core/AvatarGroup/AvatarGroup.js +58 -21
  282. package/DEV-esm/core/Backdrop/Backdrop.js +13 -9
  283. package/DEV-esm/core/Badge/Badge.js +34 -29
  284. package/DEV-esm/core/Breadcrumbs/Breadcrumbs.js +151 -72
  285. package/DEV-esm/core/ButtonGroup/ButtonGroup.js +127 -62
  286. package/DEV-esm/core/Buttons/Button.js +71 -34
  287. package/DEV-esm/core/Buttons/DropdownButton.js +38 -20
  288. package/DEV-esm/core/Buttons/IconButton.js +54 -25
  289. package/DEV-esm/core/Buttons/IdeasButton.js +16 -12
  290. package/DEV-esm/core/Buttons/SplitButton.js +80 -41
  291. package/DEV-esm/core/Carousel/Carousel.js +58 -48
  292. package/DEV-esm/core/Carousel/CarouselDot.js +18 -14
  293. package/DEV-esm/core/Carousel/CarouselDotsList.js +134 -98
  294. package/DEV-esm/core/Carousel/CarouselNavigation.js +82 -53
  295. package/DEV-esm/core/Carousel/CarouselSlide.js +40 -29
  296. package/DEV-esm/core/Carousel/CarouselSlider.js +59 -48
  297. package/DEV-esm/core/Checkbox/Checkbox.js +79 -40
  298. package/DEV-esm/core/ColorPicker/ColorBuilder.js +263 -214
  299. package/DEV-esm/core/ColorPicker/ColorInputPanel.js +382 -350
  300. package/DEV-esm/core/ColorPicker/ColorPalette.js +37 -20
  301. package/DEV-esm/core/ColorPicker/ColorPicker.js +69 -51
  302. package/DEV-esm/core/ColorPicker/ColorPickerContext.js +7 -4
  303. package/DEV-esm/core/ColorPicker/ColorSwatch.js +29 -18
  304. package/DEV-esm/core/ComboBox/ComboBox.js +382 -274
  305. package/DEV-esm/core/ComboBox/ComboBox.types-test.js +82 -75
  306. package/DEV-esm/core/ComboBox/ComboBoxEndIcon.js +22 -13
  307. package/DEV-esm/core/ComboBox/ComboBoxInput.js +170 -114
  308. package/DEV-esm/core/ComboBox/ComboBoxInputContainer.js +29 -11
  309. package/DEV-esm/core/ComboBox/ComboBoxMenu.js +121 -79
  310. package/DEV-esm/core/ComboBox/ComboBoxMenuItem.js +65 -22
  311. package/DEV-esm/core/ComboBox/ComboBoxMultipleContainer.js +7 -7
  312. package/DEV-esm/core/DatePicker/DatePicker.js +527 -335
  313. package/DEV-esm/core/Dialog/Dialog.js +66 -38
  314. package/DEV-esm/core/Dialog/DialogBackdrop.js +37 -24
  315. package/DEV-esm/core/Dialog/DialogContext.js +1 -1
  316. package/DEV-esm/core/Dialog/DialogDragContext.js +5 -5
  317. package/DEV-esm/core/Dialog/DialogMain.js +166 -106
  318. package/DEV-esm/core/Dialog/DialogTitleBar.js +43 -15
  319. package/DEV-esm/core/Divider/Divider.js +9 -9
  320. package/DEV-esm/core/DropdownMenu/DropdownMenu.js +50 -24
  321. package/DEV-esm/core/ExpandableBlock/ExpandableBlock.js +177 -110
  322. package/DEV-esm/core/Fieldset/Fieldset.js +21 -10
  323. package/DEV-esm/core/FileUpload/FileEmptyCard.js +25 -10
  324. package/DEV-esm/core/FileUpload/FileUpload.js +66 -44
  325. package/DEV-esm/core/FileUpload/FileUploadCard.js +163 -105
  326. package/DEV-esm/core/FileUpload/FileUploadTemplate.js +46 -21
  327. package/DEV-esm/core/Flex/Flex.js +65 -64
  328. package/DEV-esm/core/Footer/Footer.js +96 -64
  329. package/DEV-esm/core/Footer/FooterSeparator.js +1 -1
  330. package/DEV-esm/core/Header/Header.js +71 -29
  331. package/DEV-esm/core/Header/HeaderBasicButton.js +14 -7
  332. package/DEV-esm/core/Header/HeaderBreadcrumbs.js +39 -23
  333. package/DEV-esm/core/Header/HeaderButton.js +70 -32
  334. package/DEV-esm/core/Header/HeaderDropdownButton.js +41 -29
  335. package/DEV-esm/core/Header/HeaderLogo.js +40 -17
  336. package/DEV-esm/core/Header/HeaderSplitButton.js +60 -30
  337. package/DEV-esm/core/Icon/Icon.js +28 -22
  338. package/DEV-esm/core/InformationPanel/InformationPanel.js +84 -49
  339. package/DEV-esm/core/InformationPanel/InformationPanelContent.js +18 -8
  340. package/DEV-esm/core/InformationPanel/InformationPanelHeader.js +37 -16
  341. package/DEV-esm/core/InformationPanel/InformationPanelWrapper.js +3 -1
  342. package/DEV-esm/core/Input/Input.js +13 -13
  343. package/DEV-esm/core/InputGrid/InputGrid.js +128 -98
  344. package/DEV-esm/core/InputGroup/InputGroup.js +66 -32
  345. package/DEV-esm/core/InputWithDecorations/InputWithDecorations.js +59 -34
  346. package/DEV-esm/core/Label/Label.js +27 -12
  347. package/DEV-esm/core/LabeledInput/LabeledInput.js +65 -24
  348. package/DEV-esm/core/LabeledSelect/LabeledSelect.js +57 -25
  349. package/DEV-esm/core/LabeledSelect/LabeledSelect.types-test.js +95 -76
  350. package/DEV-esm/core/LabeledTextarea/LabeledTextarea.js +8 -6
  351. package/DEV-esm/core/LinkAction/LinkAction.js +8 -8
  352. package/DEV-esm/core/List/List.js +2 -2
  353. package/DEV-esm/core/List/ListItem.js +28 -20
  354. package/DEV-esm/core/Menu/Menu.js +207 -111
  355. package/DEV-esm/core/Menu/MenuDivider.js +2 -2
  356. package/DEV-esm/core/Menu/MenuExtraContent.js +1 -1
  357. package/DEV-esm/core/Menu/MenuItem.js +130 -63
  358. package/DEV-esm/core/Menu/MenuItemSkeleton.js +47 -26
  359. package/DEV-esm/core/Modal/Modal.js +43 -20
  360. package/DEV-esm/core/NonIdealState/ErrorPage.js +159 -114
  361. package/DEV-esm/core/NonIdealState/NonIdealState.js +65 -22
  362. package/DEV-esm/core/NotificationMarker/NotificationMarker.js +26 -12
  363. package/DEV-esm/core/Overlay/Overlay.js +44 -30
  364. package/DEV-esm/core/Popover/Popover.js +294 -173
  365. package/DEV-esm/core/ProgressIndicators/ProgressLinear.js +52 -19
  366. package/DEV-esm/core/ProgressIndicators/ProgressRadial.js +52 -27
  367. package/DEV-esm/core/Radio/Radio.js +50 -25
  368. package/DEV-esm/core/RadioTiles/RadioTile.js +63 -30
  369. package/DEV-esm/core/RadioTiles/RadioTileGroup.js +17 -9
  370. package/DEV-esm/core/SearchBox/SearchBox.js +200 -118
  371. package/DEV-esm/core/Select/Select.js +434 -256
  372. package/DEV-esm/core/Select/Select.types-test.js +107 -82
  373. package/DEV-esm/core/Select/SelectTag.js +19 -11
  374. package/DEV-esm/core/Select/SelectTagContainer.js +21 -11
  375. package/DEV-esm/core/SideNavigation/SideNavigation.js +103 -46
  376. package/DEV-esm/core/SideNavigation/SidenavButton.js +39 -18
  377. package/DEV-esm/core/SideNavigation/SidenavSubmenu.js +17 -9
  378. package/DEV-esm/core/SideNavigation/SidenavSubmenuHeader.js +25 -11
  379. package/DEV-esm/core/SkipToContentLink/SkipToContentLink.js +12 -8
  380. package/DEV-esm/core/Slider/Slider.js +317 -244
  381. package/DEV-esm/core/Slider/Thumb.js +97 -84
  382. package/DEV-esm/core/Slider/Track.js +77 -48
  383. package/DEV-esm/core/StatusMessage/StatusMessage.js +32 -13
  384. package/DEV-esm/core/Stepper/Stepper.js +69 -30
  385. package/DEV-esm/core/Stepper/StepperStep.js +93 -45
  386. package/DEV-esm/core/Stepper/WorkflowDiagram.js +23 -15
  387. package/DEV-esm/core/Stepper/WorkflowDiagramStep.js +28 -14
  388. package/DEV-esm/core/Surface/Surface.js +85 -63
  389. package/DEV-esm/core/Table/ColumnHeader.js +188 -0
  390. package/DEV-esm/core/Table/SubRowExpander.js +33 -22
  391. package/DEV-esm/core/Table/Table.js +695 -491
  392. package/DEV-esm/core/Table/TableCell.js +80 -44
  393. package/DEV-esm/core/Table/TablePaginator.js +305 -161
  394. package/DEV-esm/core/Table/TableRowMemoized.js +167 -73
  395. package/DEV-esm/core/Table/actionHandlers/expandHandler.js +10 -10
  396. package/DEV-esm/core/Table/actionHandlers/filterHandler.js +23 -15
  397. package/DEV-esm/core/Table/actionHandlers/index.js +5 -1
  398. package/DEV-esm/core/Table/actionHandlers/resizeHandler.js +14 -14
  399. package/DEV-esm/core/Table/actionHandlers/selectHandler.js +108 -73
  400. package/DEV-esm/core/Table/cells/DefaultCell.js +79 -30
  401. package/DEV-esm/core/Table/cells/EditableCell.js +70 -50
  402. package/DEV-esm/core/Table/columns/actionColumn.js +81 -59
  403. package/DEV-esm/core/Table/columns/expanderColumn.js +38 -32
  404. package/DEV-esm/core/Table/columns/selectionColumn.js +62 -42
  405. package/DEV-esm/core/Table/filters/BaseFilter.js +16 -13
  406. package/DEV-esm/core/Table/filters/DateRangeFilter/DatePickerInput.js +92 -56
  407. package/DEV-esm/core/Table/filters/DateRangeFilter/DateRangeFilter.js +101 -77
  408. package/DEV-esm/core/Table/filters/FilterButtonBar.js +42 -19
  409. package/DEV-esm/core/Table/filters/FilterToggle.js +58 -40
  410. package/DEV-esm/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +42 -46
  411. package/DEV-esm/core/Table/filters/TextFilter/TextFilter.js +24 -22
  412. package/DEV-esm/core/Table/filters/customFilterFunctions.js +18 -12
  413. package/DEV-esm/core/Table/filters/defaultFilterFunctions.js +111 -69
  414. package/DEV-esm/core/Table/filters/tableFilters.js +15 -12
  415. package/DEV-esm/core/Table/filters/types.js +1 -1
  416. package/DEV-esm/core/Table/hooks/useColumnDragAndDrop.js +100 -91
  417. package/DEV-esm/core/Table/hooks/useExpanderCell.js +26 -18
  418. package/DEV-esm/core/Table/hooks/useResizeColumns.js +333 -238
  419. package/DEV-esm/core/Table/hooks/useScrollToRow.js +32 -28
  420. package/DEV-esm/core/Table/hooks/useSelectionCell.js +17 -10
  421. package/DEV-esm/core/Table/hooks/useStickyColumns.js +46 -38
  422. package/DEV-esm/core/Table/hooks/useSubRowFiltering.js +78 -75
  423. package/DEV-esm/core/Table/hooks/useSubRowSelection.js +29 -29
  424. package/DEV-esm/core/Table/index.js +5 -1
  425. package/DEV-esm/core/Table/utils.js +45 -44
  426. package/DEV-esm/core/Tabs/Tabs.js +372 -243
  427. package/DEV-esm/core/Tag/Tag.js +55 -27
  428. package/DEV-esm/core/Tag/TagContainer.js +18 -10
  429. package/DEV-esm/core/Textarea/Textarea.js +8 -6
  430. package/DEV-esm/core/ThemeProvider/ThemeProvider.js +258 -155
  431. package/DEV-esm/core/Tile/Tile.js +286 -157
  432. package/DEV-esm/core/TimePicker/TimePicker.js +438 -250
  433. package/DEV-esm/core/Toast/Toast.js +199 -138
  434. package/DEV-esm/core/Toast/Toaster.js +114 -94
  435. package/DEV-esm/core/ToggleSwitch/ToggleSwitch.js +60 -29
  436. package/DEV-esm/core/Tooltip/Tooltip.js +229 -159
  437. package/DEV-esm/core/TransferList/TransferList.js +146 -112
  438. package/DEV-esm/core/Tree/Tree.js +226 -175
  439. package/DEV-esm/core/Tree/TreeContext.js +5 -4
  440. package/DEV-esm/core/Tree/TreeNode.js +226 -129
  441. package/DEV-esm/core/Tree/TreeNodeExpander.js +24 -16
  442. package/DEV-esm/core/Typography/Anchor.js +22 -12
  443. package/DEV-esm/core/Typography/Blockquote.js +13 -8
  444. package/DEV-esm/core/Typography/Kbd.js +25 -21
  445. package/DEV-esm/core/Typography/Text.js +27 -14
  446. package/DEV-esm/core/VisuallyHidden/VisuallyHidden.js +34 -17
  447. package/DEV-esm/index.js +21 -3
  448. package/DEV-esm/react-table/react-table.js +1 -1
  449. package/DEV-esm/react-table/react-table.types-test.js +635 -471
  450. package/DEV-esm/styles.js +7 -10
  451. package/DEV-esm/utils/color/ColorValue.js +406 -304
  452. package/DEV-esm/utils/components/AutoclearingHiddenLiveRegion.js +16 -14
  453. package/DEV-esm/utils/components/ButtonBase.js +27 -21
  454. package/DEV-esm/utils/components/FocusTrap.js +36 -33
  455. package/DEV-esm/utils/components/InputContainer.js +52 -19
  456. package/DEV-esm/utils/components/InputFlexContainer.js +31 -27
  457. package/DEV-esm/utils/components/LineClamp.js +21 -12
  458. package/DEV-esm/utils/components/MiddleTextTruncation.js +26 -22
  459. package/DEV-esm/utils/components/Portal.js +11 -11
  460. package/DEV-esm/utils/components/Resizer.js +215 -175
  461. package/DEV-esm/utils/components/ShadowRoot.js +72 -56
  462. package/DEV-esm/utils/components/WithCSSTransition.js +45 -38
  463. package/DEV-esm/utils/functions/colors.js +21 -20
  464. package/DEV-esm/utils/functions/date.js +7 -7
  465. package/DEV-esm/utils/functions/dev.js +5 -11
  466. package/DEV-esm/utils/functions/dom.js +18 -18
  467. package/DEV-esm/utils/functions/focusable.js +62 -45
  468. package/DEV-esm/utils/functions/import.js +20 -14
  469. package/DEV-esm/utils/functions/numbers.js +11 -9
  470. package/DEV-esm/utils/functions/polymorphic.js +42 -29
  471. package/DEV-esm/utils/functions/react.js +14 -12
  472. package/DEV-esm/utils/functions/supports.js +2 -1
  473. package/DEV-esm/utils/hooks/index.js +1 -0
  474. package/DEV-esm/utils/hooks/useContainerWidth.js +14 -14
  475. package/DEV-esm/utils/hooks/useControlledState.js +18 -17
  476. package/DEV-esm/utils/hooks/useDragAndDrop.js +100 -76
  477. package/DEV-esm/utils/hooks/useEventListener.js +13 -18
  478. package/DEV-esm/utils/hooks/useGlobals.js +29 -24
  479. package/DEV-esm/utils/hooks/useId.js +5 -6
  480. package/DEV-esm/utils/hooks/useIntersection.js +27 -27
  481. package/DEV-esm/utils/hooks/useIsClient.js +6 -6
  482. package/DEV-esm/utils/hooks/useIsomorphicLayoutEffect.js +2 -1
  483. package/DEV-esm/utils/hooks/useLatestRef.js +6 -8
  484. package/DEV-esm/utils/hooks/useMediaQuery.js +17 -12
  485. package/DEV-esm/utils/hooks/useMergedRefs.js +10 -9
  486. package/DEV-esm/utils/hooks/useOverflow.js +57 -59
  487. package/DEV-esm/utils/hooks/useResizeObserver.js +20 -22
  488. package/DEV-esm/utils/hooks/useSafeContext.js +5 -4
  489. package/DEV-esm/utils/hooks/useSyncExternalStore.js +27 -30
  490. package/DEV-esm/utils/hooks/useVirtualScroll.js +31 -29
  491. package/DEV-esm/utils/hooks/useWarningLogger.js +31 -0
  492. package/DEV-esm/utils/icons/StatusIconMap.js +20 -16
  493. package/DEV-esm/utils/icons/Svg.js +3 -3
  494. package/DEV-esm/utils/icons/SvgCalendar.js +8 -3
  495. package/DEV-esm/utils/icons/SvgCaretDownSmall.js +8 -3
  496. package/DEV-esm/utils/icons/SvgCaretRightSmall.js +8 -3
  497. package/DEV-esm/utils/icons/SvgCaretUpSmall.js +8 -3
  498. package/DEV-esm/utils/icons/SvgCheckmark.js +8 -3
  499. package/DEV-esm/utils/icons/SvgCheckmarkSmall.js +8 -3
  500. package/DEV-esm/utils/icons/SvgChevronLeft.js +8 -3
  501. package/DEV-esm/utils/icons/SvgChevronLeftDouble.js +8 -3
  502. package/DEV-esm/utils/icons/SvgChevronRight.js +8 -3
  503. package/DEV-esm/utils/icons/SvgChevronRightDouble.js +8 -3
  504. package/DEV-esm/utils/icons/SvgChevronRightSmall.js +8 -3
  505. package/DEV-esm/utils/icons/SvgClose.js +8 -3
  506. package/DEV-esm/utils/icons/SvgCloseSmall.js +8 -3
  507. package/DEV-esm/utils/icons/SvgColumnManager.js +8 -3
  508. package/DEV-esm/utils/icons/SvgDocument.js +8 -3
  509. package/DEV-esm/utils/icons/SvgFilter.js +8 -3
  510. package/DEV-esm/utils/icons/SvgFilterHollow.js +8 -3
  511. package/DEV-esm/utils/icons/SvgImportantSmall.js +8 -3
  512. package/DEV-esm/utils/icons/SvgInfoCircular.js +8 -3
  513. package/DEV-esm/utils/icons/SvgMore.js +8 -3
  514. package/DEV-esm/utils/icons/SvgMoreVertical.js +8 -3
  515. package/DEV-esm/utils/icons/SvgNew.js +8 -3
  516. package/DEV-esm/utils/icons/SvgSearch.js +8 -3
  517. package/DEV-esm/utils/icons/SvgSmileyHappy.js +8 -3
  518. package/DEV-esm/utils/icons/SvgSortDown.js +8 -3
  519. package/DEV-esm/utils/icons/SvgSortUp.js +8 -3
  520. package/DEV-esm/utils/icons/SvgStatusError.js +8 -3
  521. package/DEV-esm/utils/icons/SvgStatusSuccess.js +8 -3
  522. package/DEV-esm/utils/icons/SvgStatusWarning.js +8 -3
  523. package/DEV-esm/utils/icons/SvgSwap.js +8 -3
  524. package/DEV-esm/utils/icons/SvgUpload.js +8 -3
  525. package/DEV-esm/utils/meta.js +2 -2
  526. package/DEV-esm/utils/props.js +1 -1
  527. package/DEV-esm/utils/providers/HydrationProvider.js +31 -20
  528. package/DEV-esm/utils/providers/ScopeProvider.js +36 -35
  529. package/DEV-esm/utils/types.js +1 -1
  530. package/cjs/core/Breadcrumbs/Breadcrumbs.js +1 -1
  531. package/cjs/core/Buttons/IconButton.d.ts +4 -0
  532. package/cjs/core/Buttons/IconButton.js +3 -1
  533. package/cjs/core/Carousel/Carousel.d.ts +4 -2
  534. package/cjs/core/Carousel/CarouselNavigation.d.ts +4 -2
  535. package/cjs/core/ComboBox/ComboBox.js +5 -0
  536. package/cjs/core/InputWithDecorations/InputWithDecorations.d.ts +1 -1
  537. package/cjs/core/List/List.d.ts +1 -1
  538. package/cjs/core/List/List.js +1 -1
  539. package/cjs/core/List/ListItem.d.ts +4 -4
  540. package/cjs/core/List/ListItem.js +4 -6
  541. package/cjs/core/Menu/Menu.js +6 -0
  542. package/cjs/core/Menu/MenuDivider.d.ts +1 -1
  543. package/cjs/core/Menu/MenuDivider.js +1 -1
  544. package/cjs/core/Menu/MenuItem.js +1 -1
  545. package/cjs/core/Overlay/Overlay.d.ts +2 -2
  546. package/cjs/core/Overlay/Overlay.js +2 -2
  547. package/cjs/core/Popover/Popover.d.ts +8 -1
  548. package/cjs/core/Popover/Popover.js +56 -35
  549. package/cjs/core/Select/Select.js +5 -0
  550. package/cjs/core/Table/ColumnHeader.d.ts +19 -0
  551. package/cjs/core/Table/ColumnHeader.js +194 -0
  552. package/cjs/core/Table/Table.js +38 -191
  553. package/cjs/core/Table/filters/BaseFilter.d.ts +2 -9
  554. package/cjs/core/Table/filters/BaseFilter.js +17 -15
  555. package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.js +3 -8
  556. package/cjs/core/Table/filters/FilterButtonBar.d.ts +4 -2
  557. package/cjs/core/Table/filters/FilterButtonBar.js +1 -0
  558. package/cjs/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +3 -9
  559. package/cjs/core/Table/filters/TextFilter/TextFilter.js +4 -7
  560. package/cjs/core/Table/filters/index.d.ts +0 -1
  561. package/cjs/core/Table/index.d.ts +1 -1
  562. package/cjs/core/ThemeProvider/ThemeProvider.d.ts +0 -4
  563. package/cjs/core/ThemeProvider/ThemeProvider.js +66 -49
  564. package/cjs/core/Tile/Tile.d.ts +10 -9
  565. package/cjs/core/Tile/Tile.js +8 -8
  566. package/cjs/core/Toast/Toaster.d.ts +3 -2
  567. package/cjs/core/Toast/Toaster.js +2 -1
  568. package/cjs/core/Tooltip/Tooltip.js +22 -7
  569. package/cjs/core/TransferList/TransferList.d.ts +5 -5
  570. package/cjs/core/TransferList/TransferList.js +2 -2
  571. package/cjs/styles.js +1 -1
  572. package/cjs/utils/functions/dev.d.ts +1 -16
  573. package/cjs/utils/functions/dev.js +3 -13
  574. package/cjs/utils/functions/polymorphic.d.ts +3 -7
  575. package/cjs/utils/functions/polymorphic.js +8 -5
  576. package/cjs/utils/hooks/index.d.ts +1 -0
  577. package/cjs/utils/hooks/index.js +1 -0
  578. package/cjs/utils/hooks/useWarningLogger.d.ts +15 -0
  579. package/cjs/utils/hooks/useWarningLogger.js +17 -0
  580. package/esm/core/Breadcrumbs/Breadcrumbs.js +2 -2
  581. package/esm/core/Buttons/IconButton.d.ts +4 -0
  582. package/esm/core/Buttons/IconButton.js +4 -2
  583. package/esm/core/Carousel/Carousel.d.ts +4 -2
  584. package/esm/core/Carousel/CarouselNavigation.d.ts +4 -2
  585. package/esm/core/ComboBox/ComboBox.js +5 -0
  586. package/esm/core/InputWithDecorations/InputWithDecorations.d.ts +1 -1
  587. package/esm/core/List/List.d.ts +1 -1
  588. package/esm/core/List/List.js +1 -1
  589. package/esm/core/List/ListItem.d.ts +4 -4
  590. package/esm/core/List/ListItem.js +4 -4
  591. package/esm/core/Menu/Menu.js +6 -0
  592. package/esm/core/Menu/MenuDivider.d.ts +1 -1
  593. package/esm/core/Menu/MenuDivider.js +1 -1
  594. package/esm/core/Menu/MenuItem.js +2 -2
  595. package/esm/core/Overlay/Overlay.d.ts +2 -2
  596. package/esm/core/Overlay/Overlay.js +2 -2
  597. package/esm/core/Popover/Popover.d.ts +8 -1
  598. package/esm/core/Popover/Popover.js +57 -39
  599. package/esm/core/Select/Select.js +5 -0
  600. package/esm/core/Table/ColumnHeader.d.ts +19 -0
  601. package/esm/core/Table/ColumnHeader.js +188 -0
  602. package/esm/core/Table/Table.js +21 -179
  603. package/esm/core/Table/filters/BaseFilter.d.ts +2 -9
  604. package/esm/core/Table/filters/BaseFilter.js +15 -16
  605. package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.js +3 -8
  606. package/esm/core/Table/filters/FilterButtonBar.d.ts +4 -2
  607. package/esm/core/Table/filters/FilterButtonBar.js +1 -0
  608. package/esm/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +3 -9
  609. package/esm/core/Table/filters/TextFilter/TextFilter.js +4 -7
  610. package/esm/core/Table/filters/index.d.ts +0 -1
  611. package/esm/core/Table/index.d.ts +1 -1
  612. package/esm/core/ThemeProvider/ThemeProvider.d.ts +0 -4
  613. package/esm/core/ThemeProvider/ThemeProvider.js +65 -44
  614. package/esm/core/Tile/Tile.d.ts +10 -9
  615. package/esm/core/Tile/Tile.js +8 -8
  616. package/esm/core/Toast/Toaster.d.ts +3 -2
  617. package/esm/core/Toast/Toaster.js +2 -1
  618. package/esm/core/Tooltip/Tooltip.js +22 -8
  619. package/esm/core/TransferList/TransferList.d.ts +5 -5
  620. package/esm/core/TransferList/TransferList.js +2 -2
  621. package/esm/styles.js +1 -1
  622. package/esm/utils/functions/dev.d.ts +1 -16
  623. package/esm/utils/functions/dev.js +1 -2
  624. package/esm/utils/functions/polymorphic.d.ts +3 -7
  625. package/esm/utils/functions/polymorphic.js +8 -5
  626. package/esm/utils/hooks/index.d.ts +1 -0
  627. package/esm/utils/hooks/index.js +1 -0
  628. package/esm/utils/hooks/useWarningLogger.d.ts +15 -0
  629. package/esm/utils/hooks/useWarningLogger.js +5 -0
  630. package/package.json +3 -3
  631. package/styles.css +22 -14
@@ -1,319 +1,421 @@
1
- import { _ as _define_property } from "@swc/helpers/_/_define_property";
1
+ import { _ as _define_property } from '@swc/helpers/_/_define_property';
2
2
  import { getBoundedValue } from '../functions/numbers.js';
3
3
  let scratchBytes = new Uint8Array(4);
4
4
  let scratchUInt32 = new Uint32Array(scratchBytes.buffer);
5
- export const isRgbColor = (value)=>'string' != typeof value && 'r' in value && 'g' in value && 'b' in value;
6
- export const isHslColor = (value)=>'string' != typeof value && 'h' in value && 's' in value && 'l' in value;
7
- export const isHsvColor = (value)=>'string' != typeof value && 'h' in value && 's' in value && 'v' in value;
5
+ export const isRgbColor = (value) =>
6
+ 'string' != typeof value && 'r' in value && 'g' in value && 'b' in value;
7
+ export const isHslColor = (value) =>
8
+ 'string' != typeof value && 'h' in value && 's' in value && 'l' in value;
9
+ export const isHsvColor = (value) =>
10
+ 'string' != typeof value && 'h' in value && 's' in value && 'v' in value;
8
11
  export class ColorValue {
9
- static create(val) {
10
- if (!val) return ColorValue.fromTbgr(0);
11
- if (isRgbColor(val)) return ColorValue.fromRGB(val);
12
- if (isHslColor(val)) return ColorValue.fromHSL(val);
13
- if (isHsvColor(val)) return ColorValue.fromHSV(val);
14
- if ('string' == typeof val) return ColorValue.fromString(val, ColorValue.fromTbgr(0));
15
- return ColorValue.fromTbgr(0);
12
+ static create(val) {
13
+ if (!val) return ColorValue.fromTbgr(0);
14
+ if (isRgbColor(val)) return ColorValue.fromRGB(val);
15
+ if (isHslColor(val)) return ColorValue.fromHSL(val);
16
+ if (isHsvColor(val)) return ColorValue.fromHSV(val);
17
+ if ('string' == typeof val)
18
+ return ColorValue.fromString(val, ColorValue.fromTbgr(0));
19
+ return ColorValue.fromTbgr(0);
20
+ }
21
+ toTbgr() {
22
+ return this._tbgr;
23
+ }
24
+ static fromTbgr(tbgr) {
25
+ return new ColorValue(tbgr);
26
+ }
27
+ static fromRgbt(red, green, blue, transparency) {
28
+ return this.fromTbgr(
29
+ this.computeTbgrFromComponents(red, green, blue, transparency),
30
+ );
31
+ }
32
+ static computeTbgrFromComponents(red, green, blue, transparency) {
33
+ scratchBytes[0] = red;
34
+ scratchBytes[1] = green;
35
+ scratchBytes[2] = blue;
36
+ scratchBytes[3] = transparency || 0;
37
+ return scratchUInt32[0];
38
+ }
39
+ static fromString(val, defaultColorIfNotParsed) {
40
+ let [tbgr, hue] = this.computeTbgrFromString(
41
+ val,
42
+ defaultColorIfNotParsed?.toTbgr(),
43
+ );
44
+ return new ColorValue(tbgr, hue);
45
+ }
46
+ static fromHSL(hsl) {
47
+ let alpha = hsl.a ?? 1;
48
+ return new ColorValue(
49
+ this.computeTbgrFromHSL(
50
+ hsl.h / 360,
51
+ hsl.s / 100,
52
+ hsl.l / 100,
53
+ Math.round((1 - alpha) * 255),
54
+ ),
55
+ hsl.h,
56
+ );
57
+ }
58
+ static fromRGB(rgb) {
59
+ let alpha = rgb.a ?? 1;
60
+ return ColorValue.fromRgbt(
61
+ rgb.r,
62
+ rgb.g,
63
+ rgb.b,
64
+ Math.round((1 - alpha) * 255),
65
+ );
66
+ }
67
+ static fromHSV(hsv) {
68
+ let alpha = hsv.a ?? 1;
69
+ let transparency = Math.round((1 - alpha) * 255);
70
+ if (!hsv.s || -1 === hsv.h) {
71
+ let white = 0xff & Math.floor((255.0 * hsv.v) / 100.0 + 0.5 + 3.0e-14);
72
+ return ColorValue.fromRgbt(white, white, white, 0);
16
73
  }
17
- toTbgr() {
18
- return this._tbgr;
74
+ let dhue = hsv.h,
75
+ dsaturation = hsv.s,
76
+ dvalue = hsv.v;
77
+ if (360 === dhue) dhue = 0.0;
78
+ dhue /= 60;
79
+ let hueIntpart = Math.floor(dhue);
80
+ let hueFractpart = dhue - hueIntpart;
81
+ dvalue /= 100;
82
+ dsaturation /= 100;
83
+ let p = 0xff & Math.floor(dvalue * (1.0 - dsaturation) * 255.0 + 0.5);
84
+ let q =
85
+ 0xff &
86
+ Math.floor(dvalue * (1.0 - dsaturation * hueFractpart) * 255.0 + 0.5);
87
+ let t =
88
+ 0xff &
89
+ Math.floor(
90
+ dvalue * (1.0 - dsaturation * (1.0 - hueFractpart)) * 255.0 + 0.5,
91
+ );
92
+ let v = 0xff & Math.floor(255 * dvalue + 0.5);
93
+ let r = 0,
94
+ b = 0,
95
+ g = 0;
96
+ switch (hueIntpart) {
97
+ case 0:
98
+ r = v;
99
+ g = t;
100
+ b = p;
101
+ break;
102
+ case 1:
103
+ (r = q), (g = v);
104
+ b = p;
105
+ break;
106
+ case 2:
107
+ (r = p), (g = v);
108
+ b = t;
109
+ break;
110
+ case 3:
111
+ (r = p), (g = q);
112
+ b = v;
113
+ break;
114
+ case 4:
115
+ (r = t), (g = p);
116
+ b = v;
117
+ break;
118
+ case 5:
119
+ (r = v), (g = p);
120
+ b = q;
121
+ break;
19
122
  }
20
- static fromTbgr(tbgr) {
21
- return new ColorValue(tbgr);
22
- }
23
- static fromRgbt(red, green, blue, transparency) {
24
- return this.fromTbgr(this.computeTbgrFromComponents(red, green, blue, transparency));
25
- }
26
- static computeTbgrFromComponents(red, green, blue, transparency) {
27
- scratchBytes[0] = red;
28
- scratchBytes[1] = green;
29
- scratchBytes[2] = blue;
30
- scratchBytes[3] = transparency || 0;
31
- return scratchUInt32[0];
32
- }
33
- static fromString(val, defaultColorIfNotParsed) {
34
- let [tbgr, hue] = this.computeTbgrFromString(val, defaultColorIfNotParsed?.toTbgr());
35
- return new ColorValue(tbgr, hue);
36
- }
37
- static fromHSL(hsl) {
38
- let alpha = hsl.a ?? 1;
39
- return new ColorValue(this.computeTbgrFromHSL(hsl.h / 360, hsl.s / 100, hsl.l / 100, Math.round((1 - alpha) * 255)), hsl.h);
40
- }
41
- static fromRGB(rgb) {
42
- let alpha = rgb.a ?? 1;
43
- return ColorValue.fromRgbt(rgb.r, rgb.g, rgb.b, Math.round((1 - alpha) * 255));
44
- }
45
- static fromHSV(hsv) {
46
- let alpha = hsv.a ?? 1;
47
- let transparency = Math.round((1 - alpha) * 255);
48
- if (!hsv.s || -1 === hsv.h) {
49
- let white = 0xff & Math.floor(255.0 * hsv.v / 100.0 + 0.5 + 3.0e-14);
50
- return ColorValue.fromRgbt(white, white, white, 0);
51
- }
52
- let dhue = hsv.h, dsaturation = hsv.s, dvalue = hsv.v;
53
- if (360 === dhue) dhue = 0.0;
54
- dhue /= 60;
55
- let hueIntpart = Math.floor(dhue);
56
- let hueFractpart = dhue - hueIntpart;
57
- dvalue /= 100;
58
- dsaturation /= 100;
59
- let p = 0xff & Math.floor(dvalue * (1.0 - dsaturation) * 255.0 + 0.5);
60
- let q = 0xff & Math.floor(dvalue * (1.0 - dsaturation * hueFractpart) * 255.0 + 0.5);
61
- let t = 0xff & Math.floor(dvalue * (1.0 - dsaturation * (1.0 - hueFractpart)) * 255.0 + 0.5);
62
- let v = 0xff & Math.floor(255 * dvalue + 0.5);
63
- let r = 0, b = 0, g = 0;
64
- switch(hueIntpart){
65
- case 0:
66
- r = v;
67
- g = t;
68
- b = p;
69
- break;
70
- case 1:
71
- r = q, g = v;
72
- b = p;
73
- break;
74
- case 2:
75
- r = p, g = v;
76
- b = t;
77
- break;
78
- case 3:
79
- r = p, g = q;
80
- b = v;
81
- break;
82
- case 4:
83
- r = t, g = p;
84
- b = v;
85
- break;
86
- case 5:
87
- r = v, g = p;
88
- b = q;
89
- break;
90
- }
91
- return new ColorValue(ColorValue.computeTbgrFromComponents(r, g, b, transparency), hsv.h);
92
- }
93
- static computeTbgrFromString(val, defaultColorIfNotParsed) {
94
- val = val.toLowerCase();
95
- let m = /^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(val);
96
- if (m) {
97
- let color;
98
- let name = m[1];
99
- let components = m[2];
100
- let hasPercent = (str)=>'%' === str[str.length - 1];
101
- let floatOrPercent = (str)=>{
102
- let v = parseFloat(str);
103
- return 255 * getBoundedValue(hasPercent(str) ? v / 100 : v, 0, 1);
104
- };
105
- let intOrPercent = (str)=>{
106
- let v = hasPercent(str) ? parseFloat(str) / 100 * 255 : parseInt(str, 10);
107
- return getBoundedValue(v, 0, 255);
108
- };
109
- switch(name){
110
- case 'rgb':
111
- case 'rgba':
112
- color = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(components);
113
- if (color) return [
114
- this.computeTbgrFromComponents(intOrPercent(color[1]), intOrPercent(color[2]), intOrPercent(color[3]), 'string' == typeof color[4] ? 255 - floatOrPercent(color[4]) : 0),
115
- void 0
116
- ];
117
- break;
118
- case 'hsl':
119
- case 'hsla':
120
- color = /^(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(components);
121
- if (color) {
122
- let h = parseFloat(color[1]);
123
- let s = parseInt(color[2], 10) / 100;
124
- let l = parseInt(color[3], 10) / 100;
125
- let t = 'string' == typeof color[4] ? 255 - floatOrPercent(color[4]) : 0;
126
- return [
127
- this.computeTbgrFromHSL(h / 360, s, l, t),
128
- h
129
- ];
130
- }
131
- break;
132
- }
133
- } else if (m = /^\#([A-Fa-f\d]+)$/.exec(val)) {
134
- let hex = m[1];
135
- let size = hex.length;
136
- if (3 === size) return [
137
- 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),
138
- void 0
139
- ];
140
- if (6 === size) return [
141
- 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),
142
- void 0
143
- ];
144
- if (8 === size) return [
145
- 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)),
146
- void 0
123
+ return new ColorValue(
124
+ ColorValue.computeTbgrFromComponents(r, g, b, transparency),
125
+ hsv.h,
126
+ );
127
+ }
128
+ static computeTbgrFromString(val, defaultColorIfNotParsed) {
129
+ val = val.toLowerCase();
130
+ let m = /^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(val);
131
+ if (m) {
132
+ let color;
133
+ let name = m[1];
134
+ let components = m[2];
135
+ let hasPercent = (str) => '%' === str[str.length - 1];
136
+ let floatOrPercent = (str) => {
137
+ let v = parseFloat(str);
138
+ return 255 * getBoundedValue(hasPercent(str) ? v / 100 : v, 0, 1);
139
+ };
140
+ let intOrPercent = (str) => {
141
+ let v = hasPercent(str)
142
+ ? (parseFloat(str) / 100) * 255
143
+ : parseInt(str, 10);
144
+ return getBoundedValue(v, 0, 255);
145
+ };
146
+ switch (name) {
147
+ case 'rgb':
148
+ case 'rgba':
149
+ color =
150
+ /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(
151
+ components,
152
+ );
153
+ if (color)
154
+ return [
155
+ this.computeTbgrFromComponents(
156
+ intOrPercent(color[1]),
157
+ intOrPercent(color[2]),
158
+ intOrPercent(color[3]),
159
+ 'string' == typeof color[4]
160
+ ? 255 - floatOrPercent(color[4])
161
+ : 0,
162
+ ),
163
+ void 0,
147
164
  ];
148
- }
149
- if (defaultColorIfNotParsed) return [
150
- defaultColorIfNotParsed,
151
- void 0
165
+ break;
166
+ case 'hsl':
167
+ case 'hsla':
168
+ color =
169
+ /^(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(
170
+ components,
171
+ );
172
+ if (color) {
173
+ let h = parseFloat(color[1]);
174
+ let s = parseInt(color[2], 10) / 100;
175
+ let l = parseInt(color[3], 10) / 100;
176
+ let t =
177
+ 'string' == typeof color[4] ? 255 - floatOrPercent(color[4]) : 0;
178
+ return [this.computeTbgrFromHSL(h / 360, s, l, t), h];
179
+ }
180
+ break;
181
+ }
182
+ } else if ((m = /^\#([A-Fa-f\d]+)$/.exec(val))) {
183
+ let hex = m[1];
184
+ let size = hex.length;
185
+ if (3 === size)
186
+ return [
187
+ this.computeTbgrFromComponents(
188
+ parseInt(hex.charAt(0) + hex.charAt(0), 16),
189
+ parseInt(hex.charAt(1) + hex.charAt(1), 16),
190
+ parseInt(hex.charAt(2) + hex.charAt(2), 16),
191
+ 0,
192
+ ),
193
+ void 0,
194
+ ];
195
+ if (6 === size)
196
+ return [
197
+ this.computeTbgrFromComponents(
198
+ parseInt(hex.charAt(0) + hex.charAt(1), 16),
199
+ parseInt(hex.charAt(2) + hex.charAt(3), 16),
200
+ parseInt(hex.charAt(4) + hex.charAt(5), 16),
201
+ 0,
202
+ ),
203
+ void 0,
204
+ ];
205
+ if (8 === size)
206
+ return [
207
+ this.computeTbgrFromComponents(
208
+ parseInt(hex.charAt(0) + hex.charAt(1), 16),
209
+ parseInt(hex.charAt(2) + hex.charAt(3), 16),
210
+ parseInt(hex.charAt(4) + hex.charAt(5), 16),
211
+ 255 - parseInt(hex.charAt(6) + hex.charAt(7), 16),
212
+ ),
213
+ void 0,
152
214
  ];
153
- throw new Error('unable to parse string into ColorValue');
154
- }
155
- static getColors(tbgr) {
156
- scratchUInt32[0] = tbgr;
157
- return {
158
- b: scratchBytes[2],
159
- g: scratchBytes[1],
160
- r: scratchBytes[0],
161
- t: scratchBytes[3]
162
- };
163
- }
164
- getRgb(includeAlpha) {
165
- scratchUInt32[0] = this._tbgr;
166
- if (includeAlpha) return (scratchBytes[0] << 24) + (scratchBytes[1] << 16) + (scratchBytes[2] << 8) + (255 - scratchBytes[3]);
167
- return (scratchBytes[0] << 16) + (scratchBytes[1] << 8) + scratchBytes[2];
168
- }
169
- getAlpha() {
170
- return ColorValue.getAlpha(this._tbgr);
171
- }
172
- static getAlpha(tbgr) {
173
- scratchUInt32[0] = tbgr;
174
- return 255 - scratchBytes[3];
175
- }
176
- toHexString(includeAlpha) {
177
- if (includeAlpha) {
178
- let value = this.getRgb(includeAlpha);
179
- if (value < 0) value = 0xffffffff + value + 1;
180
- return `#${`00000000${value.toString(16)}`.slice(-8)}`;
181
- }
182
- return `#${`000000${this.getRgb().toString(16)}`.slice(-6)}`;
183
- }
184
- static computeTbgrFromHSL(h, s, l, transparency = 0) {
185
- let torgb = (p1, q1, t)=>{
186
- if (t < 0) t += 1;
187
- if (t > 1) t -= 1;
188
- if (t < 1 / 6) return p1 + (q1 - p1) * 6 * t;
189
- if (t < 0.5) return q1;
190
- if (t < 2 / 3) return p1 + (q1 - p1) * 6 * (2 / 3 - t);
191
- return p1;
192
- };
193
- let hue2rgb = (p1, q1, t)=>Math.round(255 * torgb(p1, q1, t));
194
- let modulo = (n, m)=>(n % m + m) % m;
195
- h = modulo(h, 1);
196
- s = getBoundedValue(s, 0, 1);
197
- l = getBoundedValue(l, 0, 1);
198
- if (0 === s) {
199
- l *= 255;
200
- return this.computeTbgrFromComponents(l, l, l, transparency);
201
- }
202
- let p = l <= 0.5 ? l * (1 + s) : l + s - l * s;
203
- let q = 2 * l - p;
204
- return this.computeTbgrFromComponents(hue2rgb(q, p, h + 1 / 3), hue2rgb(q, p, h), hue2rgb(q, p, h - 1 / 3), transparency);
205
- }
206
- toHslColor() {
207
- return {
208
- ...ColorValue.toHsl(this._tbgr),
209
- ...void 0 != this._hue && {
210
- h: this._hue
211
- }
212
- };
213
- }
214
- static toHsl(tbgr) {
215
- let { r, g, b } = ColorValue.getColors(tbgr);
216
- let red = r / 255;
217
- let green = g / 255;
218
- let blue = b / 255;
219
- let cMin = Math.min(red, green, blue);
220
- let cMax = Math.max(red, green, blue);
221
- let delta = cMax - cMin;
222
- let hue = 0;
223
- let saturation = 0;
224
- hue = 0 === delta ? 0 : red === cMax ? (green - blue) / delta % 6 : green === cMax ? (blue - red) / delta + 2 : (red - green) / delta + 4;
225
- hue = Math.round(60 * hue);
226
- if (hue < 0) hue += 360;
227
- let lightness = (cMax + cMin) / 2;
228
- saturation = 0 === delta ? 0 : delta / (1 - Math.abs(2 * lightness - 1));
229
- saturation = Number((100 * saturation).toFixed(1));
230
- lightness = Number((100 * lightness).toFixed(1));
231
- return {
232
- h: hue,
233
- s: saturation,
234
- l: lightness,
235
- a: this.getAlpha(tbgr) / 255
236
- };
237
- }
238
- toRgbColor() {
239
- let { r, g, b } = ColorValue.getColors(this._tbgr);
240
- return {
241
- r,
242
- g,
243
- b,
244
- a: this.getAlpha() / 255
245
- };
246
- }
247
- toHsvColor() {
248
- return {
249
- ...ColorValue.toHsv(this._tbgr),
250
- ...void 0 != this._hue && {
251
- h: this._hue
252
- }
253
- };
254
- }
255
- static toHsv(tbgr) {
256
- let { r, g, b } = ColorValue.getColors(tbgr);
257
- let red = r / 255;
258
- let green = g / 255;
259
- let blue = b / 255;
260
- let cMin = Math.min(red, green, blue);
261
- let cMax = Math.max(red, green, blue);
262
- let delta = cMax - cMin;
263
- let hue = 0;
264
- hue = 0 === delta ? 0 : red === cMax ? (green - blue) / delta % 6 : green === cMax ? (blue - red) / delta + 2 : (red - green) / delta + 4;
265
- hue = Math.round(60 * hue);
266
- if (hue < 0) hue += 360;
267
- let brightness = cMax;
268
- let saturation = 0 === cMax ? 0 : delta / cMax;
269
- saturation = Number((100 * saturation).toFixed(1));
270
- brightness = Number((100 * brightness).toFixed(1));
271
- return {
272
- h: hue,
273
- s: saturation,
274
- v: brightness,
275
- a: this.getAlpha(tbgr) / 255
276
- };
277
- }
278
- equals(other) {
279
- return this._tbgr === other._tbgr;
280
215
  }
281
- static getFormattedColorNumber(value, precision = 1) {
282
- if (0 === precision) Math.round(value).toString();
283
- return Number(value.toFixed(precision)).toString();
216
+ if (defaultColorIfNotParsed) return [defaultColorIfNotParsed, void 0];
217
+ throw new Error('unable to parse string into ColorValue');
218
+ }
219
+ static getColors(tbgr) {
220
+ scratchUInt32[0] = tbgr;
221
+ return {
222
+ b: scratchBytes[2],
223
+ g: scratchBytes[1],
224
+ r: scratchBytes[0],
225
+ t: scratchBytes[3],
226
+ };
227
+ }
228
+ getRgb(includeAlpha) {
229
+ scratchUInt32[0] = this._tbgr;
230
+ if (includeAlpha)
231
+ return (
232
+ (scratchBytes[0] << 24) +
233
+ (scratchBytes[1] << 16) +
234
+ (scratchBytes[2] << 8) +
235
+ (255 - scratchBytes[3])
236
+ );
237
+ return (scratchBytes[0] << 16) + (scratchBytes[1] << 8) + scratchBytes[2];
238
+ }
239
+ getAlpha() {
240
+ return ColorValue.getAlpha(this._tbgr);
241
+ }
242
+ static getAlpha(tbgr) {
243
+ scratchUInt32[0] = tbgr;
244
+ return 255 - scratchBytes[3];
245
+ }
246
+ toHexString(includeAlpha) {
247
+ if (includeAlpha) {
248
+ let value = this.getRgb(includeAlpha);
249
+ if (value < 0) value = 0xffffffff + value + 1;
250
+ return `#${`00000000${value.toString(16)}`.slice(-8)}`;
284
251
  }
285
- toRgbString(includeAlpha) {
286
- let rgb = this.toRgbColor();
287
- let rgbString = `${rgb.r}, ${rgb.g}, ${rgb.b}`;
288
- if (includeAlpha) {
289
- let alpha = rgb.a ?? 1;
290
- return `rgba(${rgbString}, ${ColorValue.getFormattedColorNumber(alpha, 2)})`;
291
- }
292
- return `rgb(${rgbString})`;
252
+ return `#${`000000${this.getRgb().toString(16)}`.slice(-6)}`;
253
+ }
254
+ static computeTbgrFromHSL(h, s, l, transparency = 0) {
255
+ let torgb = (p1, q1, t) => {
256
+ if (t < 0) t += 1;
257
+ if (t > 1) t -= 1;
258
+ if (t < 1 / 6) return p1 + (q1 - p1) * 6 * t;
259
+ if (t < 0.5) return q1;
260
+ if (t < 2 / 3) return p1 + (q1 - p1) * 6 * (2 / 3 - t);
261
+ return p1;
262
+ };
263
+ let hue2rgb = (p1, q1, t) => Math.round(255 * torgb(p1, q1, t));
264
+ let modulo = (n, m) => ((n % m) + m) % m;
265
+ h = modulo(h, 1);
266
+ s = getBoundedValue(s, 0, 1);
267
+ l = getBoundedValue(l, 0, 1);
268
+ if (0 === s) {
269
+ l *= 255;
270
+ return this.computeTbgrFromComponents(l, l, l, transparency);
293
271
  }
294
- toHslString(includeAlpha) {
295
- let hsl = this.toHslColor();
296
- let hslString = `${ColorValue.getFormattedColorNumber(this._hue ?? hsl.h)}, ${ColorValue.getFormattedColorNumber(hsl.s)}%, ${ColorValue.getFormattedColorNumber(hsl.l)}%`;
297
- if (includeAlpha) {
298
- let alpha = hsl.a ?? 1;
299
- return `hsla(${hslString}, ${ColorValue.getFormattedColorNumber(alpha, 2)})`;
300
- }
301
- return `hsl(${hslString})`;
272
+ let p = l <= 0.5 ? l * (1 + s) : l + s - l * s;
273
+ let q = 2 * l - p;
274
+ return this.computeTbgrFromComponents(
275
+ hue2rgb(q, p, h + 1 / 3),
276
+ hue2rgb(q, p, h),
277
+ hue2rgb(q, p, h - 1 / 3),
278
+ transparency,
279
+ );
280
+ }
281
+ toHslColor() {
282
+ return {
283
+ ...ColorValue.toHsl(this._tbgr),
284
+ ...(void 0 != this._hue && {
285
+ h: this._hue,
286
+ }),
287
+ };
288
+ }
289
+ static toHsl(tbgr) {
290
+ let { r, g, b } = ColorValue.getColors(tbgr);
291
+ let red = r / 255;
292
+ let green = g / 255;
293
+ let blue = b / 255;
294
+ let cMin = Math.min(red, green, blue);
295
+ let cMax = Math.max(red, green, blue);
296
+ let delta = cMax - cMin;
297
+ let hue = 0;
298
+ let saturation = 0;
299
+ hue =
300
+ 0 === delta
301
+ ? 0
302
+ : red === cMax
303
+ ? ((green - blue) / delta) % 6
304
+ : green === cMax
305
+ ? (blue - red) / delta + 2
306
+ : (red - green) / delta + 4;
307
+ hue = Math.round(60 * hue);
308
+ if (hue < 0) hue += 360;
309
+ let lightness = (cMax + cMin) / 2;
310
+ saturation = 0 === delta ? 0 : delta / (1 - Math.abs(2 * lightness - 1));
311
+ saturation = Number((100 * saturation).toFixed(1));
312
+ lightness = Number((100 * lightness).toFixed(1));
313
+ return {
314
+ h: hue,
315
+ s: saturation,
316
+ l: lightness,
317
+ a: this.getAlpha(tbgr) / 255,
318
+ };
319
+ }
320
+ toRgbColor() {
321
+ let { r, g, b } = ColorValue.getColors(this._tbgr);
322
+ return {
323
+ r,
324
+ g,
325
+ b,
326
+ a: this.getAlpha() / 255,
327
+ };
328
+ }
329
+ toHsvColor() {
330
+ return {
331
+ ...ColorValue.toHsv(this._tbgr),
332
+ ...(void 0 != this._hue && {
333
+ h: this._hue,
334
+ }),
335
+ };
336
+ }
337
+ static toHsv(tbgr) {
338
+ let { r, g, b } = ColorValue.getColors(tbgr);
339
+ let red = r / 255;
340
+ let green = g / 255;
341
+ let blue = b / 255;
342
+ let cMin = Math.min(red, green, blue);
343
+ let cMax = Math.max(red, green, blue);
344
+ let delta = cMax - cMin;
345
+ let hue = 0;
346
+ hue =
347
+ 0 === delta
348
+ ? 0
349
+ : red === cMax
350
+ ? ((green - blue) / delta) % 6
351
+ : green === cMax
352
+ ? (blue - red) / delta + 2
353
+ : (red - green) / delta + 4;
354
+ hue = Math.round(60 * hue);
355
+ if (hue < 0) hue += 360;
356
+ let brightness = cMax;
357
+ let saturation = 0 === cMax ? 0 : delta / cMax;
358
+ saturation = Number((100 * saturation).toFixed(1));
359
+ brightness = Number((100 * brightness).toFixed(1));
360
+ return {
361
+ h: hue,
362
+ s: saturation,
363
+ v: brightness,
364
+ a: this.getAlpha(tbgr) / 255,
365
+ };
366
+ }
367
+ equals(other) {
368
+ return this._tbgr === other._tbgr;
369
+ }
370
+ static getFormattedColorNumber(value, precision = 1) {
371
+ if (0 === precision) Math.round(value).toString();
372
+ return Number(value.toFixed(precision)).toString();
373
+ }
374
+ toRgbString(includeAlpha) {
375
+ let rgb = this.toRgbColor();
376
+ let rgbString = `${rgb.r}, ${rgb.g}, ${rgb.b}`;
377
+ if (includeAlpha) {
378
+ let alpha = rgb.a ?? 1;
379
+ return `rgba(${rgbString}, ${ColorValue.getFormattedColorNumber(
380
+ alpha,
381
+ 2,
382
+ )})`;
302
383
  }
303
- toHsvString(includeAlpha) {
304
- let hsv = this.toHsvColor();
305
- let hsvString = `${this._hue ?? hsv.h}, ${hsv.s}%, ${hsv.v}%`;
306
- if (includeAlpha) {
307
- let alpha = hsv.a ?? 1;
308
- return `hsva(${hsvString}, ${ColorValue.getFormattedColorNumber(alpha, 2)})`;
309
- }
310
- return `hsv(${hsvString})`;
384
+ return `rgb(${rgbString})`;
385
+ }
386
+ toHslString(includeAlpha) {
387
+ let hsl = this.toHslColor();
388
+ let hslString = `${ColorValue.getFormattedColorNumber(
389
+ this._hue ?? hsl.h,
390
+ )}, ${ColorValue.getFormattedColorNumber(
391
+ hsl.s,
392
+ )}%, ${ColorValue.getFormattedColorNumber(hsl.l)}%`;
393
+ if (includeAlpha) {
394
+ let alpha = hsl.a ?? 1;
395
+ return `hsla(${hslString}, ${ColorValue.getFormattedColorNumber(
396
+ alpha,
397
+ 2,
398
+ )})`;
311
399
  }
312
- constructor(tbgr, hue){
313
- _define_property(this, "_tbgr", void 0);
314
- _define_property(this, "_hue", void 0);
315
- scratchUInt32[0] = tbgr;
316
- this._tbgr = scratchUInt32[0];
317
- this._hue = hue;
400
+ return `hsl(${hslString})`;
401
+ }
402
+ toHsvString(includeAlpha) {
403
+ let hsv = this.toHsvColor();
404
+ let hsvString = `${this._hue ?? hsv.h}, ${hsv.s}%, ${hsv.v}%`;
405
+ if (includeAlpha) {
406
+ let alpha = hsv.a ?? 1;
407
+ return `hsva(${hsvString}, ${ColorValue.getFormattedColorNumber(
408
+ alpha,
409
+ 2,
410
+ )})`;
318
411
  }
412
+ return `hsv(${hsvString})`;
413
+ }
414
+ constructor(tbgr, hue) {
415
+ _define_property(this, '_tbgr', void 0);
416
+ _define_property(this, '_hue', void 0);
417
+ scratchUInt32[0] = tbgr;
418
+ this._tbgr = scratchUInt32[0];
419
+ this._hue = hue;
420
+ }
319
421
  }