@itwin/itwinui-react 3.13.3 → 3.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +54 -0
- package/DEV-cjs/core/Alert/Alert.js +125 -72
- package/DEV-cjs/core/Avatar/Avatar.js +70 -44
- package/DEV-cjs/core/AvatarGroup/AvatarGroup.js +71 -34
- package/DEV-cjs/core/Backdrop/Backdrop.js +26 -22
- package/DEV-cjs/core/Badge/Badge.js +49 -42
- package/DEV-cjs/core/Breadcrumbs/Breadcrumbs.js +164 -85
- package/DEV-cjs/core/ButtonGroup/ButtonGroup.js +141 -79
- package/DEV-cjs/core/Buttons/Button.js +95 -49
- package/DEV-cjs/core/Buttons/DropdownButton.js +53 -35
- package/DEV-cjs/core/Buttons/IconButton.js +77 -41
- package/DEV-cjs/core/Buttons/IdeasButton.js +30 -26
- package/DEV-cjs/core/Buttons/SplitButton.js +90 -56
- package/DEV-cjs/core/Carousel/Carousel.js +77 -67
- package/DEV-cjs/core/Carousel/CarouselContext.js +10 -10
- package/DEV-cjs/core/Carousel/CarouselDot.js +31 -27
- package/DEV-cjs/core/Carousel/CarouselDotsList.js +148 -113
- package/DEV-cjs/core/Carousel/CarouselNavigation.js +98 -69
- package/DEV-cjs/core/Carousel/CarouselSlide.js +51 -42
- package/DEV-cjs/core/Carousel/CarouselSlider.js +68 -61
- package/DEV-cjs/core/Checkbox/Checkbox.js +96 -54
- package/DEV-cjs/core/ColorPicker/ColorBuilder.js +274 -228
- package/DEV-cjs/core/ColorPicker/ColorInputPanel.js +398 -366
- package/DEV-cjs/core/ColorPicker/ColorPalette.js +56 -36
- package/DEV-cjs/core/ColorPicker/ColorPicker.js +88 -69
- package/DEV-cjs/core/ColorPicker/ColorPickerContext.js +22 -18
- package/DEV-cjs/core/ColorPicker/ColorSwatch.js +50 -33
- package/DEV-cjs/core/ComboBox/ComboBox.js +395 -294
- package/DEV-cjs/core/ComboBox/ComboBox.types-test.js +87 -80
- package/DEV-cjs/core/ComboBox/ComboBoxEndIcon.js +36 -27
- package/DEV-cjs/core/ComboBox/ComboBoxInput.js +190 -128
- package/DEV-cjs/core/ComboBox/ComboBoxInputContainer.js +40 -28
- package/DEV-cjs/core/ComboBox/ComboBoxMenu.js +132 -93
- package/DEV-cjs/core/ComboBox/ComboBoxMenuItem.js +75 -34
- package/DEV-cjs/core/ComboBox/ComboBoxMultipleContainer.js +18 -18
- package/DEV-cjs/core/ComboBox/helpers.js +15 -14
- package/DEV-cjs/core/DatePicker/DatePicker.js +556 -353
- package/DEV-cjs/core/Dialog/Dialog.js +86 -58
- package/DEV-cjs/core/Dialog/DialogBackdrop.js +52 -39
- package/DEV-cjs/core/Dialog/DialogButtonBar.js +9 -9
- package/DEV-cjs/core/Dialog/DialogContent.js +9 -9
- package/DEV-cjs/core/Dialog/DialogContext.js +16 -15
- package/DEV-cjs/core/Dialog/DialogDragContext.js +20 -19
- package/DEV-cjs/core/Dialog/DialogMain.js +174 -122
- package/DEV-cjs/core/Dialog/DialogTitleBar.js +68 -33
- package/DEV-cjs/core/Dialog/DialogTitleBarTitle.js +9 -9
- package/DEV-cjs/core/Divider/Divider.js +22 -22
- package/DEV-cjs/core/DropdownMenu/DropdownMenu.js +63 -37
- package/DEV-cjs/core/ExpandableBlock/ExpandableBlock.js +195 -125
- package/DEV-cjs/core/Fieldset/Fieldset.js +34 -23
- package/DEV-cjs/core/FileUpload/FileEmptyCard.js +43 -24
- package/DEV-cjs/core/FileUpload/FileUpload.js +94 -57
- package/DEV-cjs/core/FileUpload/FileUploadCard.js +181 -124
- package/DEV-cjs/core/FileUpload/FileUploadTemplate.js +63 -35
- package/DEV-cjs/core/Flex/Flex.js +78 -77
- package/DEV-cjs/core/Footer/Footer.js +119 -85
- package/DEV-cjs/core/Footer/FooterItem.js +9 -9
- package/DEV-cjs/core/Footer/FooterList.js +9 -9
- package/DEV-cjs/core/Footer/FooterSeparator.js +10 -10
- package/DEV-cjs/core/Header/Header.js +86 -44
- package/DEV-cjs/core/Header/HeaderBasicButton.js +30 -20
- package/DEV-cjs/core/Header/HeaderBreadcrumbs.js +59 -36
- package/DEV-cjs/core/Header/HeaderButton.js +90 -46
- package/DEV-cjs/core/Header/HeaderDropdownButton.js +55 -44
- package/DEV-cjs/core/Header/HeaderLogo.js +53 -30
- package/DEV-cjs/core/Header/HeaderSplitButton.js +72 -44
- package/DEV-cjs/core/Icon/Icon.js +41 -35
- package/DEV-cjs/core/InformationPanel/InformationPanel.js +97 -62
- package/DEV-cjs/core/InformationPanel/InformationPanelBody.js +9 -9
- package/DEV-cjs/core/InformationPanel/InformationPanelContent.js +30 -22
- package/DEV-cjs/core/InformationPanel/InformationPanelHeader.js +51 -32
- package/DEV-cjs/core/InformationPanel/InformationPanelWrapper.js +12 -10
- package/DEV-cjs/core/Input/Input.js +26 -26
- package/DEV-cjs/core/InputGrid/InputGrid.js +151 -117
- package/DEV-cjs/core/InputGroup/InputGroup.js +85 -48
- package/DEV-cjs/core/InputWithDecorations/InputWithDecorations.js +60 -44
- package/DEV-cjs/core/Label/Label.js +40 -25
- package/DEV-cjs/core/LabeledInput/LabeledInput.js +86 -42
- package/DEV-cjs/core/LabeledSelect/LabeledSelect.js +71 -39
- package/DEV-cjs/core/LabeledSelect/LabeledSelect.types-test.js +100 -81
- package/DEV-cjs/core/LabeledTextarea/LabeledTextarea.js +19 -17
- package/DEV-cjs/core/LinkAction/LinkAction.js +27 -26
- package/DEV-cjs/core/List/List.js +11 -11
- package/DEV-cjs/core/List/ListItem.js +42 -34
- package/DEV-cjs/core/Menu/Menu.js +213 -127
- package/DEV-cjs/core/Menu/MenuDivider.js +11 -11
- package/DEV-cjs/core/Menu/MenuExtraContent.js +10 -10
- package/DEV-cjs/core/Menu/MenuItem.js +139 -76
- package/DEV-cjs/core/Menu/MenuItemSkeleton.js +65 -40
- package/DEV-cjs/core/Modal/Modal.js +54 -31
- package/DEV-cjs/core/Modal/ModalButtonBar.js +9 -9
- package/DEV-cjs/core/Modal/ModalContent.js +9 -9
- package/DEV-cjs/core/NonIdealState/ErrorPage.js +208 -127
- package/DEV-cjs/core/NonIdealState/NonIdealState.js +84 -35
- package/DEV-cjs/core/NotificationMarker/NotificationMarker.js +39 -25
- package/DEV-cjs/core/Overlay/Overlay.js +55 -41
- package/DEV-cjs/core/Popover/Popover.js +302 -193
- package/DEV-cjs/core/ProgressIndicators/ProgressLinear.js +70 -33
- package/DEV-cjs/core/ProgressIndicators/ProgressRadial.js +67 -40
- package/DEV-cjs/core/Radio/Radio.js +66 -38
- package/DEV-cjs/core/RadioTiles/RadioTile.js +88 -43
- package/DEV-cjs/core/RadioTiles/RadioTileGroup.js +29 -21
- package/DEV-cjs/core/SearchBox/SearchBox.js +203 -130
- package/DEV-cjs/core/Select/Select.js +457 -274
- package/DEV-cjs/core/Select/Select.types-test.js +112 -87
- package/DEV-cjs/core/Select/SelectTag.js +32 -24
- package/DEV-cjs/core/Select/SelectTagContainer.js +38 -25
- package/DEV-cjs/core/SideNavigation/SideNavigation.js +132 -64
- package/DEV-cjs/core/SideNavigation/SidenavButton.js +55 -33
- package/DEV-cjs/core/SideNavigation/SidenavSubmenu.js +33 -22
- package/DEV-cjs/core/SideNavigation/SidenavSubmenuHeader.js +41 -24
- package/DEV-cjs/core/SkipToContentLink/SkipToContentLink.js +28 -21
- package/DEV-cjs/core/Slider/Slider.js +352 -259
- package/DEV-cjs/core/Slider/Thumb.js +111 -98
- package/DEV-cjs/core/Slider/Track.js +93 -61
- package/DEV-cjs/core/StatusMessage/StatusMessage.js +46 -27
- package/DEV-cjs/core/Stepper/Stepper.js +86 -44
- package/DEV-cjs/core/Stepper/StepperStep.js +113 -59
- package/DEV-cjs/core/Stepper/WorkflowDiagram.js +37 -29
- package/DEV-cjs/core/Stepper/WorkflowDiagramStep.js +48 -28
- package/DEV-cjs/core/Surface/Surface.js +98 -76
- package/DEV-cjs/core/Table/ColumnHeader.js +194 -0
- package/DEV-cjs/core/Table/SubRowExpander.js +45 -34
- package/DEV-cjs/core/Table/Table.js +687 -506
- package/DEV-cjs/core/Table/TableCell.js +104 -61
- package/DEV-cjs/core/Table/TablePaginator.js +314 -178
- package/DEV-cjs/core/Table/TableRowMemoized.js +183 -90
- package/DEV-cjs/core/Table/actionHandlers/expandHandler.js +18 -18
- package/DEV-cjs/core/Table/actionHandlers/filterHandler.js +31 -23
- package/DEV-cjs/core/Table/actionHandlers/index.js +32 -31
- package/DEV-cjs/core/Table/actionHandlers/resizeHandler.js +26 -25
- package/DEV-cjs/core/Table/actionHandlers/selectHandler.js +124 -88
- package/DEV-cjs/core/Table/cells/DefaultCell.js +93 -44
- package/DEV-cjs/core/Table/cells/EditableCell.js +85 -63
- package/DEV-cjs/core/Table/cells/index.js +15 -14
- package/DEV-cjs/core/Table/columns/actionColumn.js +100 -78
- package/DEV-cjs/core/Table/columns/expanderColumn.js +56 -49
- package/DEV-cjs/core/Table/columns/index.js +25 -24
- package/DEV-cjs/core/Table/columns/selectionColumn.js +79 -58
- package/DEV-cjs/core/Table/filters/BaseFilter.js +31 -25
- package/DEV-cjs/core/Table/filters/DateRangeFilter/DatePickerInput.js +108 -72
- package/DEV-cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.js +115 -91
- package/DEV-cjs/core/Table/filters/FilterButtonBar.js +56 -33
- package/DEV-cjs/core/Table/filters/FilterToggle.js +71 -54
- package/DEV-cjs/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +56 -60
- package/DEV-cjs/core/Table/filters/TextFilter/TextFilter.js +38 -36
- package/DEV-cjs/core/Table/filters/customFilterFunctions.js +26 -20
- package/DEV-cjs/core/Table/filters/defaultFilterFunctions.js +119 -77
- package/DEV-cjs/core/Table/filters/index.js +23 -22
- package/DEV-cjs/core/Table/filters/tableFilters.js +28 -25
- package/DEV-cjs/core/Table/filters/types.js +3 -3
- package/DEV-cjs/core/Table/hooks/index.js +39 -38
- package/DEV-cjs/core/Table/hooks/useColumnDragAndDrop.js +118 -101
- package/DEV-cjs/core/Table/hooks/useExpanderCell.js +39 -29
- package/DEV-cjs/core/Table/hooks/useResizeColumns.js +346 -248
- package/DEV-cjs/core/Table/hooks/useScrollToRow.js +42 -38
- package/DEV-cjs/core/Table/hooks/useSelectionCell.js +26 -19
- package/DEV-cjs/core/Table/hooks/useStickyColumns.js +55 -47
- package/DEV-cjs/core/Table/hooks/useSubRowFiltering.js +89 -86
- package/DEV-cjs/core/Table/hooks/useSubRowSelection.js +39 -39
- package/DEV-cjs/core/Table/index.js +42 -41
- package/DEV-cjs/core/Table/utils.js +66 -64
- package/DEV-cjs/core/Tabs/Tabs.js +388 -260
- package/DEV-cjs/core/Tag/Tag.js +80 -42
- package/DEV-cjs/core/Tag/TagContainer.js +31 -23
- package/DEV-cjs/core/Textarea/Textarea.js +19 -17
- package/DEV-cjs/core/ThemeProvider/ThemeContext.js +10 -10
- package/DEV-cjs/core/ThemeProvider/ThemeProvider.js +276 -172
- package/DEV-cjs/core/Tile/Tile.js +310 -173
- package/DEV-cjs/core/TimePicker/TimePicker.js +451 -263
- package/DEV-cjs/core/Toast/Toast.js +226 -157
- package/DEV-cjs/core/Toast/Toaster.js +142 -118
- package/DEV-cjs/core/ToggleSwitch/ToggleSwitch.js +76 -42
- package/DEV-cjs/core/Tooltip/Tooltip.js +221 -170
- package/DEV-cjs/core/TransferList/TransferList.js +171 -132
- package/DEV-cjs/core/Tree/Tree.js +226 -179
- package/DEV-cjs/core/Tree/TreeContext.js +20 -18
- package/DEV-cjs/core/Tree/TreeNode.js +254 -143
- package/DEV-cjs/core/Tree/TreeNodeExpander.js +40 -31
- package/DEV-cjs/core/Typography/Anchor.js +41 -27
- package/DEV-cjs/core/Typography/Blockquote.js +26 -21
- package/DEV-cjs/core/Typography/Code.js +9 -9
- package/DEV-cjs/core/Typography/Kbd.js +43 -38
- package/DEV-cjs/core/Typography/Text.js +45 -31
- package/DEV-cjs/core/VisuallyHidden/VisuallyHidden.js +47 -30
- package/DEV-cjs/index.js +475 -474
- package/DEV-cjs/package.json +1 -0
- package/DEV-cjs/react-table/react-table.js +3 -3
- package/DEV-cjs/react-table/react-table.types-test.js +628 -476
- package/DEV-cjs/styles.js +17 -1
- package/DEV-cjs/utils/color/ColorValue.js +429 -323
- package/DEV-cjs/utils/color/index.js +5 -5
- package/DEV-cjs/utils/components/AutoclearingHiddenLiveRegion.js +31 -26
- package/DEV-cjs/utils/components/Box.js +9 -9
- package/DEV-cjs/utils/components/ButtonBase.js +41 -35
- package/DEV-cjs/utils/components/FieldsetBase.js +9 -9
- package/DEV-cjs/utils/components/FocusTrap.js +48 -45
- package/DEV-cjs/utils/components/InputContainer.js +67 -34
- package/DEV-cjs/utils/components/InputFlexContainer.js +63 -49
- package/DEV-cjs/utils/components/InputWithIcon.js +9 -9
- package/DEV-cjs/utils/components/LineClamp.js +33 -24
- package/DEV-cjs/utils/components/MiddleTextTruncation.js +37 -33
- package/DEV-cjs/utils/components/Portal.js +35 -32
- package/DEV-cjs/utils/components/Resizer.js +221 -185
- package/DEV-cjs/utils/components/ShadowRoot.js +85 -69
- package/DEV-cjs/utils/components/WithCSSTransition.js +57 -50
- package/DEV-cjs/utils/components/index.js +18 -18
- package/DEV-cjs/utils/functions/colors.js +37 -35
- package/DEV-cjs/utils/functions/date.js +15 -15
- package/DEV-cjs/utils/functions/dev.js +25 -19
- package/DEV-cjs/utils/functions/dom.js +39 -39
- package/DEV-cjs/utils/functions/focusable.js +81 -63
- package/DEV-cjs/utils/functions/import.js +28 -22
- package/DEV-cjs/utils/functions/index.js +14 -14
- package/DEV-cjs/utils/functions/numbers.js +26 -24
- package/DEV-cjs/utils/functions/polymorphic.js +56 -43
- package/DEV-cjs/utils/functions/react.js +25 -23
- package/DEV-cjs/utils/functions/supports.js +11 -10
- package/DEV-cjs/utils/hooks/index.js +20 -20
- package/DEV-cjs/utils/hooks/useContainerWidth.js +31 -26
- package/DEV-cjs/utils/hooks/useControlledState.js +28 -27
- package/DEV-cjs/utils/hooks/useDragAndDrop.js +112 -88
- package/DEV-cjs/utils/hooks/useEventListener.js +23 -28
- package/DEV-cjs/utils/hooks/useGlobals.js +46 -40
- package/DEV-cjs/utils/hooks/useId.js +17 -17
- package/DEV-cjs/utils/hooks/useIntersection.js +38 -38
- package/DEV-cjs/utils/hooks/useIsClient.js +16 -16
- package/DEV-cjs/utils/hooks/useIsomorphicLayoutEffect.js +12 -11
- package/DEV-cjs/utils/hooks/useLatestRef.js +16 -18
- package/DEV-cjs/utils/hooks/useMediaQuery.js +32 -23
- package/DEV-cjs/utils/hooks/useMergedRefs.js +25 -23
- package/DEV-cjs/utils/hooks/useOverflow.js +68 -72
- package/DEV-cjs/utils/hooks/useResizeObserver.js +31 -33
- package/DEV-cjs/utils/hooks/useSafeContext.js +15 -14
- package/DEV-cjs/utils/hooks/useSyncExternalStore.js +37 -40
- package/DEV-cjs/utils/hooks/useVirtualScroll.js +42 -40
- package/DEV-cjs/utils/icons/StatusIconMap.js +34 -30
- package/DEV-cjs/utils/icons/Svg.js +12 -12
- package/DEV-cjs/utils/icons/SvgCalendar.js +19 -14
- package/DEV-cjs/utils/icons/SvgCaretDownSmall.js +19 -14
- package/DEV-cjs/utils/icons/SvgCaretRightSmall.js +19 -14
- package/DEV-cjs/utils/icons/SvgCaretUpSmall.js +19 -14
- package/DEV-cjs/utils/icons/SvgCheckmark.js +19 -14
- package/DEV-cjs/utils/icons/SvgCheckmarkSmall.js +19 -14
- package/DEV-cjs/utils/icons/SvgChevronLeft.js +19 -14
- package/DEV-cjs/utils/icons/SvgChevronLeftDouble.js +19 -14
- package/DEV-cjs/utils/icons/SvgChevronRight.js +19 -14
- package/DEV-cjs/utils/icons/SvgChevronRightDouble.js +19 -14
- package/DEV-cjs/utils/icons/SvgChevronRightSmall.js +19 -14
- package/DEV-cjs/utils/icons/SvgClose.js +19 -14
- package/DEV-cjs/utils/icons/SvgCloseSmall.js +19 -14
- package/DEV-cjs/utils/icons/SvgColumnManager.js +19 -14
- package/DEV-cjs/utils/icons/SvgDocument.js +19 -14
- package/DEV-cjs/utils/icons/SvgFilter.js +19 -14
- package/DEV-cjs/utils/icons/SvgFilterHollow.js +19 -14
- package/DEV-cjs/utils/icons/SvgImportantSmall.js +19 -14
- package/DEV-cjs/utils/icons/SvgInfoCircular.js +19 -14
- package/DEV-cjs/utils/icons/SvgMore.js +19 -14
- package/DEV-cjs/utils/icons/SvgMoreVertical.js +19 -14
- package/DEV-cjs/utils/icons/SvgNew.js +19 -14
- package/DEV-cjs/utils/icons/SvgSearch.js +19 -14
- package/DEV-cjs/utils/icons/SvgSmileyHappy.js +19 -14
- package/DEV-cjs/utils/icons/SvgSortDown.js +19 -14
- package/DEV-cjs/utils/icons/SvgSortUp.js +19 -14
- package/DEV-cjs/utils/icons/SvgStatusError.js +19 -14
- package/DEV-cjs/utils/icons/SvgStatusSuccess.js +19 -14
- package/DEV-cjs/utils/icons/SvgStatusWarning.js +19 -14
- package/DEV-cjs/utils/icons/SvgSwap.js +19 -14
- package/DEV-cjs/utils/icons/SvgUpload.js +19 -14
- package/DEV-cjs/utils/icons/index.js +36 -36
- package/DEV-cjs/utils/index.js +12 -12
- package/DEV-cjs/utils/meta.js +11 -11
- package/DEV-cjs/utils/props.js +3 -3
- package/DEV-cjs/utils/providers/HydrationProvider.js +47 -35
- package/DEV-cjs/utils/providers/ScopeProvider.js +55 -53
- package/DEV-cjs/utils/providers/index.js +6 -6
- package/DEV-cjs/utils/types.js +3 -3
- package/DEV-esm/core/Alert/Alert.js +112 -57
- package/DEV-esm/core/Avatar/Avatar.js +45 -26
- package/DEV-esm/core/AvatarGroup/AvatarGroup.js +58 -21
- package/DEV-esm/core/Backdrop/Backdrop.js +13 -9
- package/DEV-esm/core/Badge/Badge.js +34 -29
- package/DEV-esm/core/Breadcrumbs/Breadcrumbs.js +150 -71
- package/DEV-esm/core/ButtonGroup/ButtonGroup.js +127 -62
- package/DEV-esm/core/Buttons/Button.js +71 -34
- package/DEV-esm/core/Buttons/DropdownButton.js +38 -20
- package/DEV-esm/core/Buttons/IconButton.js +54 -25
- package/DEV-esm/core/Buttons/IdeasButton.js +16 -12
- package/DEV-esm/core/Buttons/SplitButton.js +80 -41
- package/DEV-esm/core/Carousel/Carousel.js +58 -48
- package/DEV-esm/core/Carousel/CarouselDot.js +18 -14
- package/DEV-esm/core/Carousel/CarouselDotsList.js +134 -98
- package/DEV-esm/core/Carousel/CarouselNavigation.js +82 -53
- package/DEV-esm/core/Carousel/CarouselSlide.js +40 -29
- package/DEV-esm/core/Carousel/CarouselSlider.js +59 -48
- package/DEV-esm/core/Checkbox/Checkbox.js +79 -40
- package/DEV-esm/core/ColorPicker/ColorBuilder.js +263 -214
- package/DEV-esm/core/ColorPicker/ColorInputPanel.js +382 -350
- package/DEV-esm/core/ColorPicker/ColorPalette.js +37 -20
- package/DEV-esm/core/ColorPicker/ColorPicker.js +69 -51
- package/DEV-esm/core/ColorPicker/ColorPickerContext.js +7 -4
- package/DEV-esm/core/ColorPicker/ColorSwatch.js +29 -18
- package/DEV-esm/core/ComboBox/ComboBox.js +382 -274
- package/DEV-esm/core/ComboBox/ComboBox.types-test.js +82 -75
- package/DEV-esm/core/ComboBox/ComboBoxEndIcon.js +22 -13
- package/DEV-esm/core/ComboBox/ComboBoxInput.js +170 -114
- package/DEV-esm/core/ComboBox/ComboBoxInputContainer.js +29 -11
- package/DEV-esm/core/ComboBox/ComboBoxMenu.js +121 -79
- package/DEV-esm/core/ComboBox/ComboBoxMenuItem.js +65 -22
- package/DEV-esm/core/ComboBox/ComboBoxMultipleContainer.js +7 -7
- package/DEV-esm/core/DatePicker/DatePicker.js +527 -335
- package/DEV-esm/core/Dialog/Dialog.js +66 -38
- package/DEV-esm/core/Dialog/DialogBackdrop.js +37 -24
- package/DEV-esm/core/Dialog/DialogContext.js +1 -1
- package/DEV-esm/core/Dialog/DialogDragContext.js +5 -5
- package/DEV-esm/core/Dialog/DialogMain.js +166 -106
- package/DEV-esm/core/Dialog/DialogTitleBar.js +43 -15
- package/DEV-esm/core/Divider/Divider.js +9 -9
- package/DEV-esm/core/DropdownMenu/DropdownMenu.js +50 -24
- package/DEV-esm/core/ExpandableBlock/ExpandableBlock.js +177 -110
- package/DEV-esm/core/Fieldset/Fieldset.js +21 -10
- package/DEV-esm/core/FileUpload/FileEmptyCard.js +25 -10
- package/DEV-esm/core/FileUpload/FileUpload.js +66 -44
- package/DEV-esm/core/FileUpload/FileUploadCard.js +163 -105
- package/DEV-esm/core/FileUpload/FileUploadTemplate.js +46 -21
- package/DEV-esm/core/Flex/Flex.js +65 -64
- package/DEV-esm/core/Footer/Footer.js +96 -64
- package/DEV-esm/core/Footer/FooterSeparator.js +1 -1
- package/DEV-esm/core/Header/Header.js +71 -29
- package/DEV-esm/core/Header/HeaderBasicButton.js +14 -7
- package/DEV-esm/core/Header/HeaderBreadcrumbs.js +39 -23
- package/DEV-esm/core/Header/HeaderButton.js +70 -32
- package/DEV-esm/core/Header/HeaderDropdownButton.js +41 -29
- package/DEV-esm/core/Header/HeaderLogo.js +40 -17
- package/DEV-esm/core/Header/HeaderSplitButton.js +60 -30
- package/DEV-esm/core/Icon/Icon.js +28 -22
- package/DEV-esm/core/InformationPanel/InformationPanel.js +84 -49
- package/DEV-esm/core/InformationPanel/InformationPanelContent.js +18 -8
- package/DEV-esm/core/InformationPanel/InformationPanelHeader.js +37 -16
- package/DEV-esm/core/InformationPanel/InformationPanelWrapper.js +3 -1
- package/DEV-esm/core/Input/Input.js +13 -13
- package/DEV-esm/core/InputGrid/InputGrid.js +128 -98
- package/DEV-esm/core/InputGroup/InputGroup.js +66 -32
- package/DEV-esm/core/InputWithDecorations/InputWithDecorations.js +59 -34
- package/DEV-esm/core/Label/Label.js +27 -12
- package/DEV-esm/core/LabeledInput/LabeledInput.js +65 -24
- package/DEV-esm/core/LabeledSelect/LabeledSelect.js +57 -25
- package/DEV-esm/core/LabeledSelect/LabeledSelect.types-test.js +95 -76
- package/DEV-esm/core/LabeledTextarea/LabeledTextarea.js +8 -6
- package/DEV-esm/core/LinkAction/LinkAction.js +8 -8
- package/DEV-esm/core/List/List.js +2 -2
- package/DEV-esm/core/List/ListItem.js +28 -20
- package/DEV-esm/core/Menu/Menu.js +207 -111
- package/DEV-esm/core/Menu/MenuDivider.js +2 -2
- package/DEV-esm/core/Menu/MenuExtraContent.js +1 -1
- package/DEV-esm/core/Menu/MenuItem.js +129 -62
- package/DEV-esm/core/Menu/MenuItemSkeleton.js +47 -26
- package/DEV-esm/core/Modal/Modal.js +43 -20
- package/DEV-esm/core/NonIdealState/ErrorPage.js +159 -114
- package/DEV-esm/core/NonIdealState/NonIdealState.js +65 -22
- package/DEV-esm/core/NotificationMarker/NotificationMarker.js +26 -12
- package/DEV-esm/core/Overlay/Overlay.js +44 -30
- package/DEV-esm/core/Popover/Popover.js +306 -172
- package/DEV-esm/core/ProgressIndicators/ProgressLinear.js +52 -19
- package/DEV-esm/core/ProgressIndicators/ProgressRadial.js +52 -27
- package/DEV-esm/core/Radio/Radio.js +50 -25
- package/DEV-esm/core/RadioTiles/RadioTile.js +63 -30
- package/DEV-esm/core/RadioTiles/RadioTileGroup.js +17 -9
- package/DEV-esm/core/SearchBox/SearchBox.js +200 -118
- package/DEV-esm/core/Select/Select.js +434 -256
- package/DEV-esm/core/Select/Select.types-test.js +107 -82
- package/DEV-esm/core/Select/SelectTag.js +19 -11
- package/DEV-esm/core/Select/SelectTagContainer.js +21 -11
- package/DEV-esm/core/SideNavigation/SideNavigation.js +103 -46
- package/DEV-esm/core/SideNavigation/SidenavButton.js +39 -18
- package/DEV-esm/core/SideNavigation/SidenavSubmenu.js +17 -9
- package/DEV-esm/core/SideNavigation/SidenavSubmenuHeader.js +25 -11
- package/DEV-esm/core/SkipToContentLink/SkipToContentLink.js +12 -8
- package/DEV-esm/core/Slider/Slider.js +317 -244
- package/DEV-esm/core/Slider/Thumb.js +97 -84
- package/DEV-esm/core/Slider/Track.js +77 -48
- package/DEV-esm/core/StatusMessage/StatusMessage.js +32 -13
- package/DEV-esm/core/Stepper/Stepper.js +69 -30
- package/DEV-esm/core/Stepper/StepperStep.js +93 -45
- package/DEV-esm/core/Stepper/WorkflowDiagram.js +23 -15
- package/DEV-esm/core/Stepper/WorkflowDiagramStep.js +28 -14
- package/DEV-esm/core/Surface/Surface.js +85 -63
- package/DEV-esm/core/Table/ColumnHeader.js +188 -0
- package/DEV-esm/core/Table/SubRowExpander.js +33 -22
- package/DEV-esm/core/Table/Table.js +694 -486
- package/DEV-esm/core/Table/TableCell.js +80 -44
- package/DEV-esm/core/Table/TablePaginator.js +305 -161
- package/DEV-esm/core/Table/TableRowMemoized.js +167 -73
- package/DEV-esm/core/Table/actionHandlers/expandHandler.js +10 -10
- package/DEV-esm/core/Table/actionHandlers/filterHandler.js +23 -15
- package/DEV-esm/core/Table/actionHandlers/index.js +5 -1
- package/DEV-esm/core/Table/actionHandlers/resizeHandler.js +14 -14
- package/DEV-esm/core/Table/actionHandlers/selectHandler.js +108 -73
- package/DEV-esm/core/Table/cells/DefaultCell.js +79 -30
- package/DEV-esm/core/Table/cells/EditableCell.js +70 -50
- package/DEV-esm/core/Table/columns/actionColumn.js +81 -59
- package/DEV-esm/core/Table/columns/expanderColumn.js +38 -32
- package/DEV-esm/core/Table/columns/selectionColumn.js +62 -42
- package/DEV-esm/core/Table/filters/BaseFilter.js +16 -13
- package/DEV-esm/core/Table/filters/DateRangeFilter/DatePickerInput.js +92 -56
- package/DEV-esm/core/Table/filters/DateRangeFilter/DateRangeFilter.js +101 -77
- package/DEV-esm/core/Table/filters/FilterButtonBar.js +42 -19
- package/DEV-esm/core/Table/filters/FilterToggle.js +58 -40
- package/DEV-esm/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +42 -46
- package/DEV-esm/core/Table/filters/TextFilter/TextFilter.js +24 -22
- package/DEV-esm/core/Table/filters/customFilterFunctions.js +18 -12
- package/DEV-esm/core/Table/filters/defaultFilterFunctions.js +111 -69
- package/DEV-esm/core/Table/filters/tableFilters.js +15 -12
- package/DEV-esm/core/Table/filters/types.js +1 -1
- package/DEV-esm/core/Table/hooks/useColumnDragAndDrop.js +100 -91
- package/DEV-esm/core/Table/hooks/useExpanderCell.js +26 -18
- package/DEV-esm/core/Table/hooks/useResizeColumns.js +333 -238
- package/DEV-esm/core/Table/hooks/useScrollToRow.js +32 -28
- package/DEV-esm/core/Table/hooks/useSelectionCell.js +17 -10
- package/DEV-esm/core/Table/hooks/useStickyColumns.js +46 -38
- package/DEV-esm/core/Table/hooks/useSubRowFiltering.js +78 -75
- package/DEV-esm/core/Table/hooks/useSubRowSelection.js +29 -29
- package/DEV-esm/core/Table/index.js +5 -1
- package/DEV-esm/core/Table/utils.js +45 -44
- package/DEV-esm/core/Tabs/Tabs.js +372 -243
- package/DEV-esm/core/Tag/Tag.js +55 -27
- package/DEV-esm/core/Tag/TagContainer.js +18 -10
- package/DEV-esm/core/Textarea/Textarea.js +8 -6
- package/DEV-esm/core/ThemeProvider/ThemeProvider.js +258 -155
- package/DEV-esm/core/Tile/Tile.js +286 -157
- package/DEV-esm/core/TimePicker/TimePicker.js +438 -250
- package/DEV-esm/core/Toast/Toast.js +199 -138
- package/DEV-esm/core/Toast/Toaster.js +114 -94
- package/DEV-esm/core/ToggleSwitch/ToggleSwitch.js +60 -29
- package/DEV-esm/core/Tooltip/Tooltip.js +229 -159
- package/DEV-esm/core/TransferList/TransferList.js +146 -112
- package/DEV-esm/core/Tree/Tree.js +226 -174
- package/DEV-esm/core/Tree/TreeContext.js +5 -4
- package/DEV-esm/core/Tree/TreeNode.js +226 -129
- package/DEV-esm/core/Tree/TreeNodeExpander.js +24 -16
- package/DEV-esm/core/Typography/Anchor.js +22 -12
- package/DEV-esm/core/Typography/Blockquote.js +13 -8
- package/DEV-esm/core/Typography/Kbd.js +25 -21
- package/DEV-esm/core/Typography/Text.js +27 -14
- package/DEV-esm/core/VisuallyHidden/VisuallyHidden.js +34 -17
- package/DEV-esm/index.js +21 -3
- package/DEV-esm/react-table/react-table.js +1 -1
- package/DEV-esm/react-table/react-table.types-test.js +635 -471
- package/DEV-esm/styles.js +7 -10
- package/DEV-esm/utils/color/ColorValue.js +406 -304
- package/DEV-esm/utils/components/AutoclearingHiddenLiveRegion.js +16 -14
- package/DEV-esm/utils/components/ButtonBase.js +27 -21
- package/DEV-esm/utils/components/FocusTrap.js +36 -33
- package/DEV-esm/utils/components/InputContainer.js +52 -19
- package/DEV-esm/utils/components/InputFlexContainer.js +31 -27
- package/DEV-esm/utils/components/LineClamp.js +21 -12
- package/DEV-esm/utils/components/MiddleTextTruncation.js +26 -22
- package/DEV-esm/utils/components/Portal.js +11 -11
- package/DEV-esm/utils/components/Resizer.js +215 -175
- package/DEV-esm/utils/components/ShadowRoot.js +72 -56
- package/DEV-esm/utils/components/WithCSSTransition.js +45 -38
- package/DEV-esm/utils/functions/colors.js +21 -20
- package/DEV-esm/utils/functions/date.js +7 -7
- package/DEV-esm/utils/functions/dev.js +12 -7
- package/DEV-esm/utils/functions/dom.js +18 -18
- package/DEV-esm/utils/functions/focusable.js +62 -45
- package/DEV-esm/utils/functions/import.js +20 -14
- package/DEV-esm/utils/functions/numbers.js +11 -9
- package/DEV-esm/utils/functions/polymorphic.js +42 -29
- package/DEV-esm/utils/functions/react.js +14 -12
- package/DEV-esm/utils/functions/supports.js +2 -1
- package/DEV-esm/utils/hooks/useContainerWidth.js +14 -14
- package/DEV-esm/utils/hooks/useControlledState.js +18 -17
- package/DEV-esm/utils/hooks/useDragAndDrop.js +100 -76
- package/DEV-esm/utils/hooks/useEventListener.js +13 -18
- package/DEV-esm/utils/hooks/useGlobals.js +29 -24
- package/DEV-esm/utils/hooks/useId.js +5 -6
- package/DEV-esm/utils/hooks/useIntersection.js +27 -27
- package/DEV-esm/utils/hooks/useIsClient.js +6 -6
- package/DEV-esm/utils/hooks/useIsomorphicLayoutEffect.js +2 -1
- package/DEV-esm/utils/hooks/useLatestRef.js +6 -8
- package/DEV-esm/utils/hooks/useMediaQuery.js +17 -12
- package/DEV-esm/utils/hooks/useMergedRefs.js +10 -9
- package/DEV-esm/utils/hooks/useOverflow.js +57 -59
- package/DEV-esm/utils/hooks/useResizeObserver.js +20 -22
- package/DEV-esm/utils/hooks/useSafeContext.js +5 -4
- package/DEV-esm/utils/hooks/useSyncExternalStore.js +27 -30
- package/DEV-esm/utils/hooks/useVirtualScroll.js +31 -29
- package/DEV-esm/utils/icons/StatusIconMap.js +20 -16
- package/DEV-esm/utils/icons/Svg.js +3 -3
- package/DEV-esm/utils/icons/SvgCalendar.js +8 -3
- package/DEV-esm/utils/icons/SvgCaretDownSmall.js +8 -3
- package/DEV-esm/utils/icons/SvgCaretRightSmall.js +8 -3
- package/DEV-esm/utils/icons/SvgCaretUpSmall.js +8 -3
- package/DEV-esm/utils/icons/SvgCheckmark.js +8 -3
- package/DEV-esm/utils/icons/SvgCheckmarkSmall.js +8 -3
- package/DEV-esm/utils/icons/SvgChevronLeft.js +8 -3
- package/DEV-esm/utils/icons/SvgChevronLeftDouble.js +8 -3
- package/DEV-esm/utils/icons/SvgChevronRight.js +8 -3
- package/DEV-esm/utils/icons/SvgChevronRightDouble.js +8 -3
- package/DEV-esm/utils/icons/SvgChevronRightSmall.js +8 -3
- package/DEV-esm/utils/icons/SvgClose.js +8 -3
- package/DEV-esm/utils/icons/SvgCloseSmall.js +8 -3
- package/DEV-esm/utils/icons/SvgColumnManager.js +8 -3
- package/DEV-esm/utils/icons/SvgDocument.js +8 -3
- package/DEV-esm/utils/icons/SvgFilter.js +8 -3
- package/DEV-esm/utils/icons/SvgFilterHollow.js +8 -3
- package/DEV-esm/utils/icons/SvgImportantSmall.js +8 -3
- package/DEV-esm/utils/icons/SvgInfoCircular.js +8 -3
- package/DEV-esm/utils/icons/SvgMore.js +8 -3
- package/DEV-esm/utils/icons/SvgMoreVertical.js +8 -3
- package/DEV-esm/utils/icons/SvgNew.js +8 -3
- package/DEV-esm/utils/icons/SvgSearch.js +8 -3
- package/DEV-esm/utils/icons/SvgSmileyHappy.js +8 -3
- package/DEV-esm/utils/icons/SvgSortDown.js +8 -3
- package/DEV-esm/utils/icons/SvgSortUp.js +8 -3
- package/DEV-esm/utils/icons/SvgStatusError.js +8 -3
- package/DEV-esm/utils/icons/SvgStatusSuccess.js +8 -3
- package/DEV-esm/utils/icons/SvgStatusWarning.js +8 -3
- package/DEV-esm/utils/icons/SvgSwap.js +8 -3
- package/DEV-esm/utils/icons/SvgUpload.js +8 -3
- package/DEV-esm/utils/meta.js +2 -2
- package/DEV-esm/utils/props.js +1 -1
- package/DEV-esm/utils/providers/HydrationProvider.js +31 -20
- package/DEV-esm/utils/providers/ScopeProvider.js +36 -35
- package/DEV-esm/utils/types.js +1 -1
- package/cjs/core/Buttons/IconButton.d.ts +4 -0
- package/cjs/core/Buttons/IconButton.js +3 -1
- package/cjs/core/Carousel/Carousel.d.ts +4 -2
- package/cjs/core/Carousel/CarouselNavigation.d.ts +4 -2
- package/cjs/core/ComboBox/ComboBox.js +5 -0
- package/cjs/core/InputWithDecorations/InputWithDecorations.d.ts +1 -1
- package/cjs/core/List/List.d.ts +1 -1
- package/cjs/core/List/List.js +1 -1
- package/cjs/core/List/ListItem.d.ts +4 -4
- package/cjs/core/List/ListItem.js +4 -6
- package/cjs/core/Menu/Menu.js +6 -0
- package/cjs/core/Menu/MenuDivider.d.ts +1 -1
- package/cjs/core/Menu/MenuDivider.js +1 -1
- package/cjs/core/Overlay/Overlay.d.ts +2 -2
- package/cjs/core/Overlay/Overlay.js +2 -2
- package/cjs/core/Popover/Popover.d.ts +8 -1
- package/cjs/core/Popover/Popover.js +40 -9
- package/cjs/core/Select/Select.js +5 -0
- package/cjs/core/Table/ColumnHeader.d.ts +19 -0
- package/cjs/core/Table/ColumnHeader.js +194 -0
- package/cjs/core/Table/Table.js +38 -184
- package/cjs/core/Table/filters/BaseFilter.d.ts +2 -9
- package/cjs/core/Table/filters/BaseFilter.js +17 -15
- package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.js +3 -8
- package/cjs/core/Table/filters/FilterButtonBar.d.ts +4 -2
- package/cjs/core/Table/filters/FilterButtonBar.js +1 -0
- package/cjs/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +3 -9
- package/cjs/core/Table/filters/TextFilter/TextFilter.js +4 -7
- package/cjs/core/Table/filters/index.d.ts +0 -1
- package/cjs/core/Table/index.d.ts +1 -1
- package/cjs/core/ThemeProvider/ThemeProvider.d.ts +0 -4
- package/cjs/core/ThemeProvider/ThemeProvider.js +66 -49
- package/cjs/core/Tile/Tile.d.ts +10 -9
- package/cjs/core/Tile/Tile.js +8 -8
- package/cjs/core/Toast/Toaster.d.ts +3 -2
- package/cjs/core/Toast/Toaster.js +2 -1
- package/cjs/core/Tooltip/Tooltip.js +22 -7
- package/cjs/core/TransferList/TransferList.d.ts +5 -5
- package/cjs/core/TransferList/TransferList.js +2 -2
- package/cjs/core/Tree/Tree.js +2 -1
- package/cjs/styles.js +1 -1
- package/cjs/utils/functions/polymorphic.d.ts +3 -7
- package/cjs/utils/functions/polymorphic.js +8 -5
- package/esm/core/Buttons/IconButton.d.ts +4 -0
- package/esm/core/Buttons/IconButton.js +4 -2
- package/esm/core/Carousel/Carousel.d.ts +4 -2
- package/esm/core/Carousel/CarouselNavigation.d.ts +4 -2
- package/esm/core/ComboBox/ComboBox.js +5 -0
- package/esm/core/InputWithDecorations/InputWithDecorations.d.ts +1 -1
- package/esm/core/List/List.d.ts +1 -1
- package/esm/core/List/List.js +1 -1
- package/esm/core/List/ListItem.d.ts +4 -4
- package/esm/core/List/ListItem.js +4 -4
- package/esm/core/Menu/Menu.js +6 -0
- package/esm/core/Menu/MenuDivider.d.ts +1 -1
- package/esm/core/Menu/MenuDivider.js +1 -1
- package/esm/core/Overlay/Overlay.d.ts +2 -2
- package/esm/core/Overlay/Overlay.js +2 -2
- package/esm/core/Popover/Popover.d.ts +8 -1
- package/esm/core/Popover/Popover.js +40 -9
- package/esm/core/Select/Select.js +5 -0
- package/esm/core/Table/ColumnHeader.d.ts +19 -0
- package/esm/core/Table/ColumnHeader.js +188 -0
- package/esm/core/Table/Table.js +20 -171
- package/esm/core/Table/filters/BaseFilter.d.ts +2 -9
- package/esm/core/Table/filters/BaseFilter.js +15 -16
- package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.js +3 -8
- package/esm/core/Table/filters/FilterButtonBar.d.ts +4 -2
- package/esm/core/Table/filters/FilterButtonBar.js +1 -0
- package/esm/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +3 -9
- package/esm/core/Table/filters/TextFilter/TextFilter.js +4 -7
- package/esm/core/Table/filters/index.d.ts +0 -1
- package/esm/core/Table/index.d.ts +1 -1
- package/esm/core/ThemeProvider/ThemeProvider.d.ts +0 -4
- package/esm/core/ThemeProvider/ThemeProvider.js +65 -44
- package/esm/core/Tile/Tile.d.ts +10 -9
- package/esm/core/Tile/Tile.js +8 -8
- package/esm/core/Toast/Toaster.d.ts +3 -2
- package/esm/core/Toast/Toaster.js +2 -1
- package/esm/core/Tooltip/Tooltip.js +22 -8
- package/esm/core/TransferList/TransferList.d.ts +5 -5
- package/esm/core/TransferList/TransferList.js +2 -2
- package/esm/core/Tree/Tree.js +2 -1
- package/esm/styles.js +1 -1
- package/esm/utils/functions/polymorphic.d.ts +3 -7
- package/esm/utils/functions/polymorphic.js +8 -5
- package/package.json +3 -3
- package/styles.css +22 -14
|
@@ -1,384 +1,416 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', {
|
|
3
|
+
value: true,
|
|
4
4
|
});
|
|
5
|
-
Object.defineProperty(exports,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
Object.defineProperty(exports, 'ColorInputPanel', {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function () {
|
|
8
|
+
return ColorInputPanel;
|
|
9
|
+
},
|
|
10
10
|
});
|
|
11
|
-
const _interop_require_default = require(
|
|
12
|
-
const _interop_require_wildcard = require(
|
|
13
|
-
const _react = _interop_require_wildcard._(require(
|
|
14
|
-
const _classnames = _interop_require_default._(require(
|
|
15
|
-
const _IconButton = require(
|
|
16
|
-
const _Input = require(
|
|
17
|
-
const _index = require(
|
|
18
|
-
const _ColorPickerContext = require(
|
|
19
|
-
const ColorInputPanel = _react.forwardRef((props, ref)=>{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
11
|
+
const _interop_require_default = require('@swc/helpers/_/_interop_require_default');
|
|
12
|
+
const _interop_require_wildcard = require('@swc/helpers/_/_interop_require_wildcard');
|
|
13
|
+
const _react = _interop_require_wildcard._(require('react'));
|
|
14
|
+
const _classnames = _interop_require_default._(require('classnames'));
|
|
15
|
+
const _IconButton = require('../Buttons/IconButton.js');
|
|
16
|
+
const _Input = require('../Input/Input.js');
|
|
17
|
+
const _index = require('../../utils/index.js');
|
|
18
|
+
const _ColorPickerContext = require('./ColorPickerContext.js');
|
|
19
|
+
const ColorInputPanel = _react.forwardRef((props, ref) => {
|
|
20
|
+
let {
|
|
21
|
+
defaultColorFormat,
|
|
22
|
+
allowedColorFormats = ['hsl', 'rgb', 'hex'],
|
|
23
|
+
className,
|
|
24
|
+
...rest
|
|
25
|
+
} = props;
|
|
26
|
+
let inputsContainerRef = _react.useRef(null);
|
|
27
|
+
let { activeColor, applyHsvColorChange, hsvColor, showAlpha } = (0,
|
|
28
|
+
_ColorPickerContext.useColorPickerContext)();
|
|
29
|
+
let [currentFormat, setCurrentFormat] = _react.useState(defaultColorFormat);
|
|
30
|
+
_react.useEffect(() => {
|
|
31
|
+
setCurrentFormat(defaultColorFormat);
|
|
32
|
+
}, [defaultColorFormat]);
|
|
33
|
+
let [input, setInput] = _react.useState(['', '', '', '']);
|
|
34
|
+
_react.useEffect(() => {
|
|
35
|
+
if ('hsl' === currentFormat) {
|
|
36
|
+
let hsl = activeColor.toHslColor();
|
|
37
|
+
setInput([
|
|
38
|
+
_index.ColorValue.getFormattedColorNumber(hsvColor.h),
|
|
39
|
+
_index.ColorValue.getFormattedColorNumber(hsl.s),
|
|
40
|
+
_index.ColorValue.getFormattedColorNumber(hsl.l),
|
|
41
|
+
_index.ColorValue.getFormattedColorNumber(
|
|
42
|
+
hsl.a ?? activeColor.getAlpha() / 255,
|
|
43
|
+
2,
|
|
44
|
+
),
|
|
45
|
+
]);
|
|
46
|
+
} else if ('rgb' === currentFormat) {
|
|
47
|
+
let rgb = activeColor.toRgbColor();
|
|
48
|
+
setInput([
|
|
49
|
+
rgb.r.toString(),
|
|
50
|
+
rgb.g.toString(),
|
|
51
|
+
rgb.b.toString(),
|
|
52
|
+
_index.ColorValue.getFormattedColorNumber(
|
|
53
|
+
rgb.a ?? activeColor.getAlpha() / 255,
|
|
54
|
+
2,
|
|
55
|
+
),
|
|
56
|
+
]);
|
|
57
|
+
} else {
|
|
58
|
+
setInput([activeColor.toHexString(showAlpha)]);
|
|
59
|
+
setValidHexInput(true);
|
|
60
|
+
}
|
|
61
|
+
}, [activeColor, hsvColor.h, currentFormat, showAlpha]);
|
|
62
|
+
let [validHexInput, setValidHexInput] = _react.useState(true);
|
|
63
|
+
let swapColorFormat = _react.useCallback(() => {
|
|
64
|
+
let newFormat =
|
|
65
|
+
allowedColorFormats[
|
|
66
|
+
(allowedColorFormats.indexOf(currentFormat) + 1) %
|
|
67
|
+
allowedColorFormats.length
|
|
68
|
+
] ?? allowedColorFormats[0];
|
|
69
|
+
setCurrentFormat(newFormat);
|
|
70
|
+
}, [currentFormat, allowedColorFormats]);
|
|
71
|
+
let isFocusInside = (focused) =>
|
|
72
|
+
!!(
|
|
73
|
+
focused &&
|
|
74
|
+
inputsContainerRef.current &&
|
|
75
|
+
inputsContainerRef.current.contains(focused)
|
|
76
|
+
);
|
|
77
|
+
let handleColorInputChange = () => {
|
|
78
|
+
let color;
|
|
79
|
+
if ('hex' === currentFormat)
|
|
80
|
+
try {
|
|
81
|
+
let value = input[0].replace(/ /g, '').toLowerCase();
|
|
82
|
+
color = _index.ColorValue.create(value);
|
|
83
|
+
setValidHexInput(true);
|
|
84
|
+
if (activeColor.toHexString(showAlpha).toLowerCase() === value) return;
|
|
85
|
+
} catch (_e) {
|
|
86
|
+
setValidHexInput(false);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if ('hsl' === currentFormat) {
|
|
90
|
+
let [h, s, l, a] = input.map(Number);
|
|
91
|
+
if (
|
|
92
|
+
h < 0 ||
|
|
93
|
+
h > 360 ||
|
|
94
|
+
s < 0 ||
|
|
95
|
+
s > 100 ||
|
|
96
|
+
l < 0 ||
|
|
97
|
+
l > 100 ||
|
|
98
|
+
a < 0 ||
|
|
99
|
+
a > 1
|
|
100
|
+
)
|
|
101
|
+
return;
|
|
102
|
+
let hsl = activeColor.toHslColor();
|
|
103
|
+
if (hsl.h === h && hsl.s === s && hsl.l === l && hsl.a === a) return;
|
|
104
|
+
color = _index.ColorValue.create({
|
|
105
|
+
h,
|
|
106
|
+
s,
|
|
107
|
+
l,
|
|
108
|
+
a,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
if ('rgb' === currentFormat) {
|
|
112
|
+
let [r, g, b, a] = input.map(Number);
|
|
113
|
+
if (
|
|
114
|
+
r < 0 ||
|
|
115
|
+
r > 255 ||
|
|
116
|
+
g < 0 ||
|
|
117
|
+
g > 255 ||
|
|
118
|
+
b < 0 ||
|
|
119
|
+
b > 255 ||
|
|
120
|
+
a < 0 ||
|
|
121
|
+
a > 1
|
|
122
|
+
)
|
|
123
|
+
return;
|
|
124
|
+
let rgb = activeColor.toRgbColor();
|
|
125
|
+
if (rgb.r === r && rgb.g === g && rgb.b === b && rgb.a === a) return;
|
|
126
|
+
color = _index.ColorValue.create({
|
|
127
|
+
r,
|
|
128
|
+
g,
|
|
129
|
+
b,
|
|
130
|
+
a,
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
if (color) applyHsvColorChange(color.toHsvColor(), true, color);
|
|
134
|
+
};
|
|
135
|
+
let hexInputField = _react.createElement(_Input.Input, {
|
|
136
|
+
size: 'small',
|
|
137
|
+
maxLength: showAlpha ? 9 : 7,
|
|
138
|
+
minLength: 1,
|
|
139
|
+
placeholder: 'HEX',
|
|
140
|
+
'aria-label': 'Hex',
|
|
141
|
+
value: input[0],
|
|
142
|
+
onChange: (event) => {
|
|
143
|
+
let value = event.target.value.startsWith('#')
|
|
144
|
+
? event.target.value
|
|
145
|
+
: `#${event.target.value}`;
|
|
146
|
+
setInput([value]);
|
|
147
|
+
},
|
|
148
|
+
onKeyDown: (event) => {
|
|
149
|
+
if ('Enter' === event.key) {
|
|
150
|
+
event.preventDefault();
|
|
151
|
+
handleColorInputChange();
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
onBlur: (event) => {
|
|
155
|
+
event.preventDefault();
|
|
156
|
+
handleColorInputChange();
|
|
157
|
+
},
|
|
158
|
+
status: validHexInput ? void 0 : 'negative',
|
|
159
|
+
});
|
|
160
|
+
let hslInputs = _react.createElement(
|
|
161
|
+
_react.Fragment,
|
|
162
|
+
null,
|
|
163
|
+
_react.createElement(_Input.Input, {
|
|
164
|
+
size: 'small',
|
|
165
|
+
type: 'number',
|
|
166
|
+
min: '0',
|
|
167
|
+
max: '359',
|
|
168
|
+
step: '.1',
|
|
169
|
+
placeholder: 'H',
|
|
170
|
+
'aria-label': 'Hue',
|
|
171
|
+
value: input[0] ?? '',
|
|
172
|
+
onChange: (event) => {
|
|
173
|
+
setInput([event.target.value, input[1], input[2], input[3]]);
|
|
174
|
+
},
|
|
175
|
+
onKeyDown: (event) => {
|
|
176
|
+
if ('Enter' === event.key) {
|
|
177
|
+
event.preventDefault();
|
|
178
|
+
handleColorInputChange();
|
|
87
179
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
180
|
+
},
|
|
181
|
+
onBlur: (event) => {
|
|
182
|
+
event.preventDefault();
|
|
183
|
+
if (!isFocusInside(event.relatedTarget)) handleColorInputChange();
|
|
184
|
+
},
|
|
185
|
+
status:
|
|
186
|
+
Number(input[0]) < 0 || Number(input[0]) > 360 ? 'negative' : void 0,
|
|
187
|
+
}),
|
|
188
|
+
_react.createElement(_Input.Input, {
|
|
189
|
+
size: 'small',
|
|
190
|
+
type: 'number',
|
|
191
|
+
min: '0',
|
|
192
|
+
max: '100',
|
|
193
|
+
step: '.1',
|
|
194
|
+
placeholder: 'S',
|
|
195
|
+
'aria-label': 'Saturation',
|
|
196
|
+
value: input[1] ?? '',
|
|
197
|
+
onChange: (event) => {
|
|
198
|
+
setInput([input[0], event.target.value, input[2], input[3]]);
|
|
199
|
+
},
|
|
200
|
+
onKeyDown: (event) => {
|
|
201
|
+
if ('Enter' === event.key) {
|
|
202
|
+
event.preventDefault();
|
|
203
|
+
handleColorInputChange();
|
|
99
204
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
205
|
+
},
|
|
206
|
+
onBlur: (event) => {
|
|
207
|
+
event.preventDefault();
|
|
208
|
+
if (!isFocusInside(event.relatedTarget)) handleColorInputChange();
|
|
209
|
+
},
|
|
210
|
+
status:
|
|
211
|
+
Number(input[1]) < 0 || Number(input[1]) > 100 ? 'negative' : void 0,
|
|
212
|
+
}),
|
|
213
|
+
_react.createElement(_Input.Input, {
|
|
214
|
+
size: 'small',
|
|
215
|
+
type: 'number',
|
|
216
|
+
min: '0',
|
|
217
|
+
max: '100',
|
|
218
|
+
step: '.1',
|
|
219
|
+
placeholder: 'L',
|
|
220
|
+
'aria-label': 'Lightness',
|
|
221
|
+
value: input[2] ?? '',
|
|
222
|
+
onChange: (event) => {
|
|
223
|
+
setInput([input[0], input[1], event.target.value, input[3]]);
|
|
224
|
+
},
|
|
225
|
+
onKeyDown: (event) => {
|
|
226
|
+
if ('Enter' === event.key) {
|
|
227
|
+
event.preventDefault();
|
|
228
|
+
handleColorInputChange();
|
|
111
229
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
230
|
+
},
|
|
231
|
+
onBlur: (event) => {
|
|
232
|
+
event.preventDefault();
|
|
233
|
+
if (!isFocusInside(event.relatedTarget)) handleColorInputChange();
|
|
234
|
+
},
|
|
235
|
+
status:
|
|
236
|
+
Number(input[2]) < 0 || Number(input[2]) > 100 ? 'negative' : void 0,
|
|
237
|
+
}),
|
|
238
|
+
showAlpha &&
|
|
239
|
+
_react.createElement(_Input.Input, {
|
|
240
|
+
size: 'small',
|
|
241
|
+
type: 'number',
|
|
242
|
+
min: '0',
|
|
243
|
+
max: '1',
|
|
244
|
+
step: '.01',
|
|
245
|
+
placeholder: 'A',
|
|
246
|
+
'aria-label': 'Alpha',
|
|
247
|
+
value: input[3] ?? '',
|
|
248
|
+
onChange: (event) => {
|
|
249
|
+
setInput([input[0], input[1], input[2], event.target.value]);
|
|
132
250
|
},
|
|
133
|
-
|
|
251
|
+
onKeyDown: (event) => {
|
|
252
|
+
if ('Enter' === event.key) {
|
|
134
253
|
event.preventDefault();
|
|
135
254
|
handleColorInputChange();
|
|
255
|
+
}
|
|
136
256
|
},
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
size: "small",
|
|
141
|
-
type: "number",
|
|
142
|
-
min: "0",
|
|
143
|
-
max: "359",
|
|
144
|
-
step: ".1",
|
|
145
|
-
placeholder: "H",
|
|
146
|
-
"aria-label": "Hue",
|
|
147
|
-
value: input[0] ?? '',
|
|
148
|
-
onChange: (event)=>{
|
|
149
|
-
setInput([
|
|
150
|
-
event.target.value,
|
|
151
|
-
input[1],
|
|
152
|
-
input[2],
|
|
153
|
-
input[3]
|
|
154
|
-
]);
|
|
155
|
-
},
|
|
156
|
-
onKeyDown: (event)=>{
|
|
157
|
-
if ('Enter' === event.key) {
|
|
158
|
-
event.preventDefault();
|
|
159
|
-
handleColorInputChange();
|
|
160
|
-
}
|
|
161
|
-
},
|
|
162
|
-
onBlur: (event)=>{
|
|
163
|
-
event.preventDefault();
|
|
164
|
-
if (!isFocusInside(event.relatedTarget)) handleColorInputChange();
|
|
257
|
+
onBlur: (event) => {
|
|
258
|
+
event.preventDefault();
|
|
259
|
+
if (!isFocusInside(event.relatedTarget)) handleColorInputChange();
|
|
165
260
|
},
|
|
166
|
-
status:
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
261
|
+
status:
|
|
262
|
+
Number(input[3]) < 0 || Number(input[3]) > 1 ? 'negative' : void 0,
|
|
263
|
+
}),
|
|
264
|
+
);
|
|
265
|
+
let rgbInputs = _react.createElement(
|
|
266
|
+
_react.Fragment,
|
|
267
|
+
null,
|
|
268
|
+
_react.createElement(_Input.Input, {
|
|
269
|
+
size: 'small',
|
|
270
|
+
type: 'number',
|
|
271
|
+
min: '0',
|
|
272
|
+
max: '255',
|
|
273
|
+
placeholder: 'R',
|
|
274
|
+
'aria-label': 'Red',
|
|
275
|
+
value: input[0] ?? '',
|
|
276
|
+
onChange: (event) => {
|
|
277
|
+
setInput([event.target.value, input[1], input[2], input[3]]);
|
|
278
|
+
},
|
|
279
|
+
onKeyDown: (event) => {
|
|
280
|
+
if ('Enter' === event.key) {
|
|
281
|
+
event.preventDefault();
|
|
282
|
+
handleColorInputChange();
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
onBlur: (event) => {
|
|
286
|
+
event.preventDefault();
|
|
287
|
+
if (!isFocusInside(event.relatedTarget)) handleColorInputChange();
|
|
288
|
+
},
|
|
289
|
+
status:
|
|
290
|
+
Number(input[0]) < 0 || Number(input[0]) > 255 ? 'negative' : void 0,
|
|
291
|
+
}),
|
|
292
|
+
_react.createElement(_Input.Input, {
|
|
293
|
+
size: 'small',
|
|
294
|
+
type: 'number',
|
|
295
|
+
min: '0',
|
|
296
|
+
max: '255',
|
|
297
|
+
placeholder: 'G',
|
|
298
|
+
'aria-label': 'Green',
|
|
299
|
+
value: input[1] ?? '',
|
|
300
|
+
onChange: (event) => {
|
|
301
|
+
setInput([input[0], event.target.value, input[2], input[3]]);
|
|
302
|
+
},
|
|
303
|
+
onKeyDown: (event) => {
|
|
304
|
+
if ('Enter' === event.key) {
|
|
305
|
+
event.preventDefault();
|
|
306
|
+
handleColorInputChange();
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
onBlur: (event) => {
|
|
310
|
+
event.preventDefault();
|
|
311
|
+
if (!isFocusInside(event.relatedTarget)) handleColorInputChange();
|
|
312
|
+
},
|
|
313
|
+
status:
|
|
314
|
+
Number(input[1]) < 0 || Number(input[1]) > 255 ? 'negative' : void 0,
|
|
315
|
+
}),
|
|
316
|
+
_react.createElement(_Input.Input, {
|
|
317
|
+
size: 'small',
|
|
318
|
+
type: 'number',
|
|
319
|
+
min: '0',
|
|
320
|
+
max: '255',
|
|
321
|
+
placeholder: 'B',
|
|
322
|
+
'aria-label': 'Blue',
|
|
323
|
+
value: input[2] ?? '',
|
|
324
|
+
onChange: (event) => {
|
|
325
|
+
setInput([input[0], input[1], event.target.value, input[3]]);
|
|
326
|
+
},
|
|
327
|
+
onKeyDown: (event) => {
|
|
328
|
+
if ('Enter' === event.key) {
|
|
329
|
+
event.preventDefault();
|
|
330
|
+
handleColorInputChange();
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
onBlur: (event) => {
|
|
334
|
+
event.preventDefault();
|
|
335
|
+
if (!isFocusInside(event.relatedTarget)) handleColorInputChange();
|
|
336
|
+
},
|
|
337
|
+
status:
|
|
338
|
+
Number(input[2]) < 0 || Number(input[2]) > 255 ? 'negative' : void 0,
|
|
339
|
+
}),
|
|
340
|
+
showAlpha &&
|
|
341
|
+
_react.createElement(_Input.Input, {
|
|
342
|
+
size: 'small',
|
|
343
|
+
type: 'number',
|
|
344
|
+
min: '0',
|
|
345
|
+
max: '1',
|
|
346
|
+
step: '.01',
|
|
347
|
+
placeholder: 'A',
|
|
348
|
+
'aria-label': 'Alpha',
|
|
231
349
|
value: input[3] ?? '',
|
|
232
|
-
onChange: (event)=>{
|
|
233
|
-
|
|
234
|
-
input[0],
|
|
235
|
-
input[1],
|
|
236
|
-
input[2],
|
|
237
|
-
event.target.value
|
|
238
|
-
]);
|
|
239
|
-
},
|
|
240
|
-
onKeyDown: (event)=>{
|
|
241
|
-
if ('Enter' === event.key) {
|
|
242
|
-
event.preventDefault();
|
|
243
|
-
handleColorInputChange();
|
|
244
|
-
}
|
|
245
|
-
},
|
|
246
|
-
onBlur: (event)=>{
|
|
247
|
-
event.preventDefault();
|
|
248
|
-
if (!isFocusInside(event.relatedTarget)) handleColorInputChange();
|
|
350
|
+
onChange: (event) => {
|
|
351
|
+
setInput([input[0], input[1], input[2], event.target.value]);
|
|
249
352
|
},
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
let rgbInputs = _react.createElement(_react.Fragment, null, _react.createElement(_Input.Input, {
|
|
253
|
-
size: "small",
|
|
254
|
-
type: "number",
|
|
255
|
-
min: "0",
|
|
256
|
-
max: "255",
|
|
257
|
-
placeholder: "R",
|
|
258
|
-
"aria-label": "Red",
|
|
259
|
-
value: input[0] ?? '',
|
|
260
|
-
onChange: (event)=>{
|
|
261
|
-
setInput([
|
|
262
|
-
event.target.value,
|
|
263
|
-
input[1],
|
|
264
|
-
input[2],
|
|
265
|
-
input[3]
|
|
266
|
-
]);
|
|
267
|
-
},
|
|
268
|
-
onKeyDown: (event)=>{
|
|
269
|
-
if ('Enter' === event.key) {
|
|
270
|
-
event.preventDefault();
|
|
271
|
-
handleColorInputChange();
|
|
272
|
-
}
|
|
273
|
-
},
|
|
274
|
-
onBlur: (event)=>{
|
|
353
|
+
onKeyDown: (event) => {
|
|
354
|
+
if ('Enter' === event.key) {
|
|
275
355
|
event.preventDefault();
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
status: Number(input[0]) < 0 || Number(input[0]) > 255 ? 'negative' : void 0
|
|
279
|
-
}), _react.createElement(_Input.Input, {
|
|
280
|
-
size: "small",
|
|
281
|
-
type: "number",
|
|
282
|
-
min: "0",
|
|
283
|
-
max: "255",
|
|
284
|
-
placeholder: "G",
|
|
285
|
-
"aria-label": "Green",
|
|
286
|
-
value: input[1] ?? '',
|
|
287
|
-
onChange: (event)=>{
|
|
288
|
-
setInput([
|
|
289
|
-
input[0],
|
|
290
|
-
event.target.value,
|
|
291
|
-
input[2],
|
|
292
|
-
input[3]
|
|
293
|
-
]);
|
|
294
|
-
},
|
|
295
|
-
onKeyDown: (event)=>{
|
|
296
|
-
if ('Enter' === event.key) {
|
|
297
|
-
event.preventDefault();
|
|
298
|
-
handleColorInputChange();
|
|
299
|
-
}
|
|
300
|
-
},
|
|
301
|
-
onBlur: (event)=>{
|
|
302
|
-
event.preventDefault();
|
|
303
|
-
if (!isFocusInside(event.relatedTarget)) handleColorInputChange();
|
|
304
|
-
},
|
|
305
|
-
status: Number(input[1]) < 0 || Number(input[1]) > 255 ? 'negative' : void 0
|
|
306
|
-
}), _react.createElement(_Input.Input, {
|
|
307
|
-
size: "small",
|
|
308
|
-
type: "number",
|
|
309
|
-
min: "0",
|
|
310
|
-
max: "255",
|
|
311
|
-
placeholder: 'B',
|
|
312
|
-
"aria-label": "Blue",
|
|
313
|
-
value: input[2] ?? '',
|
|
314
|
-
onChange: (event)=>{
|
|
315
|
-
setInput([
|
|
316
|
-
input[0],
|
|
317
|
-
input[1],
|
|
318
|
-
event.target.value,
|
|
319
|
-
input[3]
|
|
320
|
-
]);
|
|
321
|
-
},
|
|
322
|
-
onKeyDown: (event)=>{
|
|
323
|
-
if ('Enter' === event.key) {
|
|
324
|
-
event.preventDefault();
|
|
325
|
-
handleColorInputChange();
|
|
326
|
-
}
|
|
327
|
-
},
|
|
328
|
-
onBlur: (event)=>{
|
|
329
|
-
event.preventDefault();
|
|
330
|
-
if (!isFocusInside(event.relatedTarget)) handleColorInputChange();
|
|
331
|
-
},
|
|
332
|
-
status: Number(input[2]) < 0 || Number(input[2]) > 255 ? 'negative' : void 0
|
|
333
|
-
}), showAlpha && _react.createElement(_Input.Input, {
|
|
334
|
-
size: "small",
|
|
335
|
-
type: "number",
|
|
336
|
-
min: "0",
|
|
337
|
-
max: "1",
|
|
338
|
-
step: ".01",
|
|
339
|
-
placeholder: "A",
|
|
340
|
-
"aria-label": "Alpha",
|
|
341
|
-
value: input[3] ?? '',
|
|
342
|
-
onChange: (event)=>{
|
|
343
|
-
setInput([
|
|
344
|
-
input[0],
|
|
345
|
-
input[1],
|
|
346
|
-
input[2],
|
|
347
|
-
event.target.value
|
|
348
|
-
]);
|
|
356
|
+
handleColorInputChange();
|
|
357
|
+
}
|
|
349
358
|
},
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
handleColorInputChange();
|
|
354
|
-
}
|
|
359
|
+
onBlur: (event) => {
|
|
360
|
+
event.preventDefault();
|
|
361
|
+
if (!isFocusInside(event.relatedTarget)) handleColorInputChange();
|
|
355
362
|
},
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
363
|
+
status:
|
|
364
|
+
Number(input[3]) < 0 || Number(input[3]) > 1 ? 'negative' : void 0,
|
|
365
|
+
}),
|
|
366
|
+
);
|
|
367
|
+
let labelId = (0, _index.useId)();
|
|
368
|
+
return _react.createElement(
|
|
369
|
+
_index.Box,
|
|
370
|
+
{
|
|
371
|
+
className: (0, _classnames.default)('iui-color-input-wrapper', className),
|
|
372
|
+
ref: ref,
|
|
373
|
+
...rest,
|
|
374
|
+
},
|
|
375
|
+
_react.createElement(
|
|
376
|
+
_index.Box,
|
|
377
|
+
{
|
|
378
|
+
className: 'iui-color-picker-section-label',
|
|
379
|
+
id: labelId,
|
|
380
|
+
},
|
|
381
|
+
showAlpha && 'hex' !== currentFormat
|
|
382
|
+
? currentFormat.toUpperCase() + 'A'
|
|
383
|
+
: currentFormat.toUpperCase(),
|
|
384
|
+
),
|
|
385
|
+
_react.createElement(
|
|
386
|
+
_index.Box,
|
|
387
|
+
{
|
|
388
|
+
className: 'iui-color-input',
|
|
389
|
+
},
|
|
390
|
+
allowedColorFormats.length > 1 &&
|
|
391
|
+
_react.createElement(
|
|
392
|
+
_IconButton.IconButton,
|
|
393
|
+
{
|
|
394
|
+
styleType: 'borderless',
|
|
395
|
+
onClick: swapColorFormat,
|
|
396
|
+
size: 'small',
|
|
397
|
+
label: 'Switch format',
|
|
398
|
+
},
|
|
399
|
+
_react.createElement(_index.SvgSwap, null),
|
|
400
|
+
),
|
|
401
|
+
_react.createElement(
|
|
402
|
+
_index.Box,
|
|
403
|
+
{
|
|
404
|
+
ref: inputsContainerRef,
|
|
405
|
+
className: 'iui-color-input-fields',
|
|
406
|
+
role: 'hex' !== currentFormat ? 'group' : void 0,
|
|
407
|
+
'aria-labelledby': 'hex' !== currentFormat ? labelId : void 0,
|
|
359
408
|
},
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
...rest
|
|
367
|
-
}, _react.createElement(_index.Box, {
|
|
368
|
-
className: "iui-color-picker-section-label",
|
|
369
|
-
id: labelId
|
|
370
|
-
}, showAlpha && 'hex' !== currentFormat ? currentFormat.toUpperCase() + 'A' : currentFormat.toUpperCase()), _react.createElement(_index.Box, {
|
|
371
|
-
className: "iui-color-input"
|
|
372
|
-
}, allowedColorFormats.length > 1 && _react.createElement(_IconButton.IconButton, {
|
|
373
|
-
styleType: "borderless",
|
|
374
|
-
onClick: swapColorFormat,
|
|
375
|
-
size: "small",
|
|
376
|
-
label: "Switch format"
|
|
377
|
-
}, _react.createElement(_index.SvgSwap, null)), _react.createElement(_index.Box, {
|
|
378
|
-
ref: inputsContainerRef,
|
|
379
|
-
className: "iui-color-input-fields",
|
|
380
|
-
role: 'hex' !== currentFormat ? 'group' : void 0,
|
|
381
|
-
"aria-labelledby": 'hex' !== currentFormat ? labelId : void 0
|
|
382
|
-
}, 'hex' === currentFormat && hexInputField, 'rgb' === currentFormat && rgbInputs, 'hsl' === currentFormat && hslInputs)));
|
|
409
|
+
'hex' === currentFormat && hexInputField,
|
|
410
|
+
'rgb' === currentFormat && rgbInputs,
|
|
411
|
+
'hsl' === currentFormat && hslInputs,
|
|
412
|
+
),
|
|
413
|
+
),
|
|
414
|
+
);
|
|
383
415
|
});
|
|
384
416
|
ColorInputPanel.displayName = 'ColorInputPanel';
|