@qualtrics/ui-react 2.79.0 → 2.80.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 +21 -0
- package/dist/__node_modules/@radix-ui/primitive/dist/index.js +5 -6
- package/dist/__node_modules/@radix-ui/react-arrow/dist/index.js +8 -7
- package/dist/__node_modules/@radix-ui/react-collection/dist/index.js +71 -63
- package/dist/__node_modules/@radix-ui/react-context/dist/index.js +10 -14
- package/dist/__node_modules/@radix-ui/react-direction/dist/index.js +2 -4
- package/dist/__node_modules/@radix-ui/react-dismissable-layer/dist/index.js +22 -15
- package/dist/__node_modules/@radix-ui/react-dropdown-menu/dist/index.js +89 -89
- package/dist/__node_modules/@radix-ui/react-focus-scope/dist/index.js +26 -19
- package/dist/__node_modules/@radix-ui/react-id/dist/index.js +5 -2
- package/dist/__node_modules/@radix-ui/react-menu/dist/index.js +165 -129
- package/dist/__node_modules/@radix-ui/react-popper/dist/index.js +139 -106
- package/dist/__node_modules/@radix-ui/react-portal/dist/index.js +9 -5
- package/dist/__node_modules/@radix-ui/react-presence/dist/index.js +27 -20
- package/dist/__node_modules/@radix-ui/react-primitive/dist/index.js +4 -5
- package/dist/__node_modules/@radix-ui/react-roving-focus/dist/index.js +61 -38
- package/dist/__node_modules/@radix-ui/react-slot/dist/index.js +8 -12
- package/dist/__node_modules/@radix-ui/react-use-controllable-state/dist/index.js +40 -35
- package/dist/__node_modules/@radix-ui/react-use-size/dist/index.js +5 -2
- package/dist/__shared/cjs/{index-7181e053.js → index-807921ca.js} +2830 -2635
- package/dist/__shared/cjs/{index-b77d5870.js → index-8c77a9ef.js} +15 -9
- package/dist/components/Accordion/Accordion.js +27 -21
- package/dist/components/Accordion/Accordion2.js +3 -3
- package/dist/components/Accordion/AccordionContext.js +6 -8
- package/dist/components/Accordion/AccordionHeader.js +13 -17
- package/dist/components/Accordion/AccordionPanel.js +7 -11
- package/dist/components/Accordion/AccordionSection.js +14 -11
- package/dist/components/Banner/Banner.js +10 -11
- package/dist/components/Banner/BannerBody.js +1 -3
- package/dist/components/Banner/BannerFooter.js +1 -3
- package/dist/components/Banner/BannerTitle.js +1 -3
- package/dist/components/BreakpointSwitch/Breakpoint.js +2 -5
- package/dist/components/BreakpointSwitch/BreakpointContext.js +3 -4
- package/dist/components/BreakpointSwitch/BreakpointSwitch.js +1 -3
- package/dist/components/Button/Button.js +3 -3
- package/dist/components/Button/Button2.js +19 -13
- package/dist/components/ButtonGroup/ButtonGroup.js +7 -7
- package/dist/components/ButtonGroup/ButtonGroup2.js +3 -3
- package/dist/components/Checkbox/Check.js +8 -6
- package/dist/components/Checkbox/Checkbox.js +31 -28
- package/dist/components/Checkbox/Checkbox2.js +3 -3
- package/dist/components/Checkbox/CheckboxField.js +14 -13
- package/dist/components/ColorPicker/Alpha.js +8 -12
- package/dist/components/ColorPicker/ColorPicker.js +67 -48
- package/dist/components/ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/ColorPicker/ColorPickerFlyout.js +23 -24
- package/dist/components/ColorPicker/ColorPickerFlyoutInputs.js +27 -22
- package/dist/components/ColorPicker/ColorPickerWIthNoColor.js +11 -7
- package/dist/components/ColorPicker/Hue.js +9 -13
- package/dist/components/ColorPicker/Palette.js +23 -21
- package/dist/components/ColorPicker/Saturation.js +11 -15
- package/dist/components/ColorPicker/utils/hexToHsv.js +4 -5
- package/dist/components/ColorPicker/utils/hsvToHex.js +3 -5
- package/dist/components/ColorPicker/utils/rgbToHex.js +3 -5
- package/dist/components/Combobox/Combobox.js +166 -133
- package/dist/components/Combobox/Combobox2.js +3 -3
- package/dist/components/Combobox/ComboboxContext.js +3 -4
- package/dist/components/Combobox/ComboboxHeader.js +6 -6
- package/dist/components/Combobox/ComboboxIcon.js +14 -14
- package/dist/components/Combobox/ComboboxInput.js +41 -43
- package/dist/components/Combobox/ComboboxList.js +20 -20
- package/dist/components/Combobox/ComboboxOption.js +9 -10
- package/dist/components/ConfigPane/ConfigPane.js +53 -37
- package/dist/components/ConfigPane/ConfigPane2.js +3 -3
- package/dist/components/Divider/Divider.js +4 -4
- package/dist/components/Divider/Divider2.js +3 -3
- package/dist/components/Dropdown/ChildIndexContext/index.js +7 -9
- package/dist/components/Dropdown/ChildIndexContext/reach-descendants.js +18 -21
- package/dist/components/Dropdown/Dropdown.js +68 -43
- package/dist/components/Dropdown/Dropdown2.js +3 -3
- package/dist/components/Dropdown/DropdownButton.js +53 -47
- package/dist/components/Dropdown/DropdownContext.js +3 -4
- package/dist/components/Dropdown/DropdownHeader.js +12 -9
- package/dist/components/Dropdown/DropdownHeaderContext.js +3 -4
- package/dist/components/Dropdown/DropdownList.js +32 -32
- package/dist/components/Dropdown/DropdownOption.js +32 -30
- package/dist/components/Dropdown/DropdownSearch.js +12 -14
- package/dist/components/FilePicker/FilePicker.js +30 -25
- package/dist/components/FilePicker/FilePicker2.js +3 -3
- package/dist/components/FormField/Caption.js +3 -3
- package/dist/components/FormField/ErrorText.js +5 -5
- package/dist/components/FormField/FormField.js +27 -14
- package/dist/components/FormField/FormField2.js +3 -3
- package/dist/components/FormField/FormFieldContext.js +6 -13
- package/dist/components/FormField/HelperText.js +5 -5
- package/dist/components/FormField/ReadOnlyText.js +4 -6
- package/dist/components/FullScreenTakeover/FullScreenTakeover.js +22 -15
- package/dist/components/FullScreenTakeover/FullScreenTakeover2.js +3 -3
- package/dist/components/Icon/Icon.js +6 -5
- package/dist/components/Icon/IconTypes.js +1 -0
- package/dist/components/IconButton/IconButton.js +25 -16
- package/dist/components/IconButton/IconButton2.js +3 -3
- package/dist/components/InlineInput/InlineInput.js +25 -14
- package/dist/components/InlineInput/InlineInput2.js +3 -3
- package/dist/components/Input/Input.js +42 -29
- package/dist/components/Input/Input2.js +3 -3
- package/dist/components/Input/InputField.js +26 -21
- package/dist/components/InputGroup/InputGroup.js +7 -7
- package/dist/components/InputGroup/InputGroup2.js +3 -3
- package/dist/components/InputGroup/InputGroupAddon.js +7 -6
- package/dist/components/InputGroup/InputGroupProvider.js +5 -8
- package/dist/components/Label/Label.js +8 -9
- package/dist/components/Label/Label2.js +3 -3
- package/dist/components/Link/Link.js +9 -7
- package/dist/components/Link/Link2.js +3 -3
- package/dist/components/LoadingSpinner/LoadingSpinner.js +22 -17
- package/dist/components/LoadingSpinner/LoadingSpinner2.js +3 -3
- package/dist/components/LogicEditor/ConditionContainer.js +8 -10
- package/dist/components/LogicEditor/ConditionSet.js +16 -21
- package/dist/components/LogicEditor/Controls.js +17 -20
- package/dist/components/LogicEditor/LogicEditor.js +33 -24
- package/dist/components/LogicEditor/LogicEditor2.js +3 -3
- package/dist/components/LogicEditor/LogicEditorContext.js +3 -4
- package/dist/components/LogicEditor/utils.js +5 -9
- package/dist/components/Modal/Modal.js +63 -49
- package/dist/components/Modal/Modal2.js +3 -3
- package/dist/components/Modal/ModalBody.js +5 -5
- package/dist/components/Modal/ModalContext.js +3 -4
- package/dist/components/Modal/ModalFooter.js +5 -5
- package/dist/components/Modal/ModalHeader.js +10 -12
- package/dist/components/NewMenu/BaseMenu.js +83 -54
- package/dist/components/NewMenu/Menu/Menu.js +10 -12
- package/dist/components/NewMenu/NewMenu.js +3 -3
- package/dist/components/NewMenu/SelectMenu/SelectMenu.js +6 -7
- package/dist/components/NewMenu/parts/ArrowNav/ArrowNav.js +35 -30
- package/dist/components/NewMenu/parts/MenuAnchor.js +15 -16
- package/dist/components/NewMenu/parts/MenuContext.js +3 -4
- package/dist/components/NewMenu/parts/MenuItem.js +23 -17
- package/dist/components/NewMenu/parts/MenuSearchBox.js +4 -6
- package/dist/components/NewMenu/parts/SubmenuAnchor.js +5 -5
- package/dist/components/NumberStepper/NumberStepper.js +42 -37
- package/dist/components/NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/NumberStepper/NumberStepperContext.js +3 -4
- package/dist/components/NumberStepper/NumberStepperDecrement.js +13 -15
- package/dist/components/NumberStepper/NumberStepperIncrement.js +13 -15
- package/dist/components/NumberStepper/NumberStepperInput.js +28 -30
- package/dist/components/PageLayout/MainContent.js +4 -4
- package/dist/components/PageLayout/PageContainer.js +4 -4
- package/dist/components/PageLayout/PageHeader.js +4 -4
- package/dist/components/PageLayout/PageLayout.js +3 -3
- package/dist/components/Pagination/Pagination.js +20 -16
- package/dist/components/Pagination/Pagination2.js +3 -3
- package/dist/components/Pagination/PaginationContext.js +3 -4
- package/dist/components/Pagination/PaginationNextButton.js +15 -17
- package/dist/components/Pagination/PaginationPageInput.js +24 -24
- package/dist/components/Pagination/PaginationPreviousButton.js +14 -16
- package/dist/components/Popover/Popover.js +27 -18
- package/dist/components/Popover/Popover2.js +3 -3
- package/dist/components/QuickSearch/QuickSearch.js +23 -16
- package/dist/components/QuickSearch/QuickSearch2.js +3 -3
- package/dist/components/QuickSearch/QuickSearchInput.js +33 -23
- package/dist/components/Radio/Radio.js +26 -28
- package/dist/components/Radio/Radio2.js +3 -3
- package/dist/components/Radio/RadioGroup.js +15 -16
- package/dist/components/Radio/RadioGroupContext.js +3 -4
- package/dist/components/Radio/RadioOption.js +11 -10
- package/dist/components/SearchInput/SearchInput.js +32 -25
- package/dist/components/SearchInput/SearchInput2.js +3 -3
- package/dist/components/SidebarNav/ExpandCollapseButton.js +4 -6
- package/dist/components/SidebarNav/SidebarNav.js +19 -13
- package/dist/components/SidebarNav/SidebarNav2.js +3 -3
- package/dist/components/SidebarNav/SidebarNavContext.js +3 -4
- package/dist/components/SidebarNav/SidebarNavLink.js +7 -10
- package/dist/components/Slider/RangeSlider.js +36 -24
- package/dist/components/Slider/Slider.js +29 -20
- package/dist/components/Slider/Slider2.js +3 -3
- package/dist/components/Slider/SliderButton.js +26 -17
- package/dist/components/Switch/Switch.js +19 -19
- package/dist/components/Switch/Switch2.js +3 -3
- package/dist/components/Switch/SwitchField.js +13 -13
- package/dist/components/Table/Table.js +5 -5
- package/dist/components/Table/Table2.js +3 -3
- package/dist/components/Table/TableBody.js +5 -5
- package/dist/components/Table/TableCell.js +5 -5
- package/dist/components/Table/TableHead.js +5 -5
- package/dist/components/Table/TableHeaderCell.js +5 -5
- package/dist/components/Table/TableRow.js +5 -5
- package/dist/components/Tabs/Tab.js +12 -13
- package/dist/components/Tabs/TabContextProvider.js +10 -13
- package/dist/components/Tabs/TabList.js +17 -13
- package/dist/components/Tabs/TabPanel.js +10 -11
- package/dist/components/Tabs/TabPanels.js +1 -3
- package/dist/components/Tabs/Tabs.js +20 -12
- package/dist/components/Tabs/Tabs2.js +3 -3
- package/dist/components/Tooltip/Tooltip.js +51 -29
- package/dist/components/Tooltip/Tooltip2.js +3 -3
- package/dist/components/UIProvider/A11yHelpersContext.js +3 -9
- package/dist/components/UIProvider/PortalTargetContext.js +6 -8
- package/dist/components/UIProvider/UIProvider.js +4 -5
- package/dist/components/deprecated_ColorPicker/Alpha.js +7 -7
- package/dist/components/deprecated_ColorPicker/ColorPicker.js +24 -13
- package/dist/components/deprecated_ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/deprecated_ColorPicker/HexInput.js +16 -9
- package/dist/components/deprecated_ColorPicker/Hue.js +6 -6
- package/dist/components/deprecated_ColorPicker/Saturation.js +14 -16
- package/dist/components/deprecated_ColorPicker/Swatch.js +7 -6
- package/dist/components/deprecated_ColorPicker/useMouseDrag.js +5 -1
- package/dist/components/deprecated_NumberStepper/NumberStepper.js +34 -25
- package/dist/components/deprecated_NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/deprecated_NumberStepper/NumberStepperContext.js +3 -4
- package/dist/components/deprecated_NumberStepper/NumberStepperDecrement.js +14 -16
- package/dist/components/deprecated_NumberStepper/NumberStepperIncrement.js +14 -16
- package/dist/components/deprecated_NumberStepper/NumberStepperInput.js +32 -34
- package/dist/components/deprecated_Tabs/Tab.js +8 -9
- package/dist/components/deprecated_Tabs/TabContextProvider.js +3 -4
- package/dist/components/deprecated_Tabs/Tabs.js +13 -9
- package/dist/components/deprecated_Tabs/Tabs2.js +3 -3
- package/dist/components/deprecated_Toolbar/IconButtonWithLabel.js +6 -6
- package/dist/components/deprecated_Toolbar/Toolbar.js +16 -11
- package/dist/components/deprecated_Toolbar/Toolbar2.js +3 -3
- package/dist/components/deprecated_Toolbar/ToolbarContext.js +3 -4
- package/dist/components/deprecated_Toolbar/ToolbarPanel.js +16 -16
- package/dist/components/deprecated_Toolbar/ToolbarPanels.js +44 -29
- package/dist/components/deprecated_Toolbar/ToolbarTab.js +19 -20
- package/dist/components/deprecated_Toolbar/ToolbarTabs.js +34 -24
- package/dist/design-tokens/less/typography.js +3 -3
- package/dist/hooks/useBreakpoints/useBreakpoints.js +12 -4
- package/dist/hooks/useClickOutside/useClickOutside.js +1 -3
- package/dist/hooks/useClickOutsidePortals/useClickOutsidePortals.js +3 -3
- package/dist/hooks/useControllableState/useControllableState.js +5 -2
- package/dist/hooks/useEventListener/useEventListener.js +6 -5
- package/dist/hooks/useFocusSequence/useFocusSequence.js +12 -12
- package/dist/hooks/useId/useId.js +4 -1
- package/dist/hooks/useIsFocused/useIsFocused.js +5 -1
- package/dist/hooks/useIsHovered/useIsHovered.js +5 -1
- package/dist/hooks/useIsTruncated/useIsTruncated.js +11 -16
- package/dist/hooks/useMouseDrag/useMouseDrag.js +5 -1
- package/dist/hooks/useOverlay/useOverlay.js +10 -10
- package/dist/hooks/useOverlay/useOverlay2.js +3 -3
- package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement.js +9 -2
- package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement2.js +3 -3
- package/dist/icons/Icon.js +3 -3
- package/dist/icons/components/FrontlineEmployeeVoiceIcon.js +6 -0
- package/dist/icons/createIconComponent.js +7 -6
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/index.es.js +1 -0
- package/dist/icons/index.js +3 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +1 -1
- package/dist/index.js +7 -3
- package/dist/next/AdvancedTable/AdvancedTable.js +192 -173
- package/dist/next/AdvancedTable/AdvancedTable2.js +3 -3
- package/dist/next/AdvancedTable/AdvancedTableCell.js +30 -25
- package/dist/next/AdvancedTable/AdvancedTableCheckbox.js +12 -15
- package/dist/next/AdvancedTable/AdvancedTableColumnHeader.js +83 -65
- package/dist/next/AdvancedTable/AdvancedTableColumnHeaderMenu.js +25 -30
- package/dist/next/AdvancedTable/AdvancedTableColumnHeaders.js +10 -9
- package/dist/next/AdvancedTable/AdvancedTableDnDContext.js +12 -10
- package/dist/next/AdvancedTable/AdvancedTableDragPreview.js +4 -7
- package/dist/next/AdvancedTable/AdvancedTableHiddenDescription.js +4 -7
- package/dist/next/AdvancedTable/AdvancedTablePagination.js +9 -13
- package/dist/next/AdvancedTable/AdvancedTableRow.js +16 -16
- package/dist/next/AdvancedTable/AdvancedTableRowExpandButton.js +7 -11
- package/dist/next/AdvancedTable/useAdvancedTableDragAndDrop.js +32 -36
- package/dist/next/AdvancedTable/useDragAndDropConfig.js +44 -53
- package/dist/next/Chat/Chat.js +5 -6
- package/dist/next/Chat/ChatContext.js +3 -4
- package/dist/next/Chat/ChatInput.js +24 -20
- package/dist/next/Chat/ChatMessage.js +16 -20
- package/dist/next/Chat/ChatMessageList.js +11 -10
- package/dist/next/Chat/ChatMessageText.js +1 -3
- package/dist/next/Chat/Loader.js +6 -9
- package/dist/next/Chat/MessageContext.js +3 -4
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInput.js +28 -18
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInput2.js +3 -3
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInputIconButton.js +8 -8
- package/dist/next/CollectionGrid/CollectionGrid.js +14 -12
- package/dist/next/CollectionGrid/CollectionGridItem.js +4 -5
- package/dist/next/Combobox/Combobox.js +48 -37
- package/dist/next/Combobox/Combobox2.js +3 -3
- package/dist/next/Combobox/ComboboxContext.js +3 -4
- package/dist/next/Combobox/ComboboxFlyout.js +12 -15
- package/dist/next/Combobox/ComboboxGroup.js +10 -14
- package/dist/next/Combobox/ComboboxGroupContext.js +9 -10
- package/dist/next/Combobox/ComboboxInput.js +37 -39
- package/dist/next/Combobox/ComboboxOption.js +15 -19
- package/dist/next/Combobox/hooks/useComboboxFocusSequence/useComboboxFocusSequence.js +9 -4
- package/dist/next/Combobox/hooks/useComboboxLoadingState/useComboboxLoadingState.js +2 -3
- package/dist/next/Combobox/hooks/useComboboxValue/useComboboxValue.js +10 -5
- package/dist/next/Combobox/hooks/useListboxFlyoutDimensions/useListboxFlyoutDimensions.js +12 -5
- package/dist/next/Combobox/hooks/useShouldRenderGroupHeader/useShouldRenderGroupHeader.js +5 -1
- package/dist/next/Drawer/Drawer.js +38 -23
- package/dist/next/Drawer/Drawer2.js +3 -3
- package/dist/next/FilterAnchor/FilterAnchor.js +21 -19
- package/dist/next/FilterAnchor/FilterAnchor2.js +3 -3
- package/dist/next/Form/FormFields/FormFieldWrapper.js +11 -11
- package/dist/next/Form/FormFields/InputField.js +3 -3
- package/dist/next/Form/useForm.js +25 -30
- package/dist/next/Form/useFormField.js +3 -4
- package/dist/next/Form/utils/createFormInstance.js +7 -9
- package/dist/next/Form/utils/useFormContext.js +3 -4
- package/dist/next/Indicator/Indicator.js +12 -8
- package/dist/next/Indicator/Indicator2.js +3 -3
- package/dist/next/Input/Input.js +49 -35
- package/dist/next/Input/Input2.js +3 -3
- package/dist/next/LayoutGrid/LayoutGrid.js +11 -12
- package/dist/next/LayoutGrid/LayoutGridItem.js +5 -6
- package/dist/next/LoadingSpinner/LoadingSpinner.js +22 -17
- package/dist/next/LoadingSpinner/LoadingSpinner2.js +3 -3
- package/dist/next/Menu/Hooks/useFocusVirtualBoundary.js +7 -4
- package/dist/next/Menu/Hooks/useMaskDimensions.js +6 -7
- package/dist/next/Menu/Hooks/usePaneSearch.js +50 -39
- package/dist/next/Menu/Menu.js +28 -15
- package/dist/next/Menu/Menu2.js +3 -3
- package/dist/next/Menu/MenuButton.js +17 -18
- package/dist/next/Menu/MenuContext.js +13 -18
- package/dist/next/Menu/MenuItem.js +28 -29
- package/dist/next/Menu/MenuPane.js +74 -61
- package/dist/next/Menu/MenuSearch.js +10 -10
- package/dist/next/Menu/PaneChildren.js +10 -15
- package/dist/next/Menu/SubMenu.js +91 -76
- package/dist/next/Pagination/Pagination.js +40 -31
- package/dist/next/Pagination/RowDisplayCount.js +6 -7
- package/dist/next/PhoneNumberInput/PhoneNumberInput.js +49 -47
- package/dist/next/PhoneNumberInput/PhoneNumberInput2.js +3 -3
- package/dist/next/Select/Select.js +27 -30
- package/dist/next/Select/Select2.js +3 -3
- package/dist/next/Select/SelectButton.js +16 -15
- package/dist/next/Select/SelectContext.js +3 -4
- package/dist/next/Select/SelectItem.js +12 -13
- package/dist/next/Select/SelectPane.js +13 -14
- package/dist/next/Select/SelectedItems.js +16 -10
- package/dist/next/Select/SubSelect.js +21 -18
- package/dist/next/SplitButton/SplitButton.js +28 -21
- package/dist/next/SplitButton/SplitButton2.js +3 -3
- package/dist/next/SplitButton/SplitButtonOption.js +3 -5
- package/dist/next/Stack/Stack.js +26 -26
- package/dist/next/Stack/StackItem.js +12 -14
- package/dist/next/TimePicker/TimeDropdown.js +18 -18
- package/dist/next/TimePicker/TimeInput.js +38 -42
- package/dist/next/TimePicker/TimePicker.js +46 -25
- package/dist/next/TimePicker/TimePicker2.js +3 -3
- package/dist/next/TimePicker/TimePickerIcon.js +5 -7
- package/dist/next/TimePicker/utils.js +34 -13
- package/dist/next/ToggleButton/ToggleButton.js +14 -13
- package/dist/next/ToggleButton/ToggleButtonGroup.js +8 -10
- package/dist/next/ToggleButton/ToggleButtonGroupContext.js +3 -4
- package/dist/next/ToggleButton/styles.js +3 -3
- package/dist/next/Tooltip/Tooltip.js +5 -4
- package/dist/next/Typography/Typography.js +8 -7
- package/dist/next/index.js +2377 -2193
- package/dist/utils/Flyout/Flyout.js +14 -13
- package/dist/utils/Flyout/Flyout2.js +3 -3
- package/dist/utils/Flyout/FlyoutHeader.js +6 -6
- package/dist/utils/Flyout/FlyoutOption.js +11 -8
- package/dist/utils/GridChildrenWrapper/GridChildrenWrapper.js +4 -6
- package/dist/utils/Popper/Popper.js +71 -61
- package/dist/utils/Popper/PopperContext.js +5 -6
- package/dist/utils/Portal/Portal.js +7 -5
- package/dist/utils/Text/Text.js +10 -8
- package/dist/utils/TextOverflowTooltip/TextOverflowTooltip.js +10 -6
- package/dist/utils/Translation/Translate.js +4 -7
- package/dist/utils/Translation/TranslationProvider.js +10 -14
- package/dist/utils/Translation/containsComponentOrElement.js +3 -1
- package/dist/utils/Translation/useTranslation.js +2 -3
- package/dist/utils/VirtuosoTestWrapper/VirtuosoTestWrapper.js +1 -3
- package/dist/utils/filterChildren/filterChildren.js +4 -4
- package/icons/package.json +1 -1
- package/next/package.json +2 -2
- package/package.json +4 -4
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
2
|
+
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
3
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
2
4
|
import React__default, { useMemo, useRef, useEffect } from 'react';
|
|
3
5
|
import classNames from 'classnames';
|
|
4
6
|
import styles from './Checkbox2.js';
|
|
@@ -17,31 +19,30 @@ import useEventCallback from '../../hooks/useEventCallback/useEventCallback.js';
|
|
|
17
19
|
import mergeRefs from '../../utils/mergeRefs/mergeRefs.js';
|
|
18
20
|
import getSubDataTestId from '../../utils/getSubDataTestId/getSubDataTestId.js';
|
|
19
21
|
|
|
22
|
+
const _excluded = ["id", "className", "checked", "defaultChecked", "disabled", "onChange", "value", "name", "label", "errorText", "helperText", "inputProps", "aria-label", "aria-labelledby", "aria-describedby", "data-testid"];
|
|
20
23
|
const Checkbox = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
21
24
|
var _ref2, _ref3;
|
|
22
|
-
let
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
onChange,
|
|
29
|
-
value,
|
|
30
|
-
name,
|
|
31
|
-
label,
|
|
32
|
-
errorText,
|
|
33
|
-
helperText,
|
|
34
|
-
inputProps,
|
|
35
|
-
'aria-label'
|
|
36
|
-
'aria-labelledby'
|
|
37
|
-
'aria-describedby'
|
|
38
|
-
'data-testid'
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
fieldErrors
|
|
44
|
-
} = useFormField();
|
|
25
|
+
let id = _ref.id,
|
|
26
|
+
className = _ref.className,
|
|
27
|
+
externalChecked = _ref.checked,
|
|
28
|
+
defaultChecked = _ref.defaultChecked,
|
|
29
|
+
_ref$disabled = _ref.disabled,
|
|
30
|
+
externalDisabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
31
|
+
onChange = _ref.onChange,
|
|
32
|
+
value = _ref.value,
|
|
33
|
+
name = _ref.name,
|
|
34
|
+
label = _ref.label,
|
|
35
|
+
errorText = _ref.errorText,
|
|
36
|
+
helperText = _ref.helperText,
|
|
37
|
+
inputProps = _ref.inputProps,
|
|
38
|
+
externalAriaLabel = _ref['aria-label'],
|
|
39
|
+
externalAriaLabelledBy = _ref['aria-labelledby'],
|
|
40
|
+
externalAriaDescribedBy = _ref['aria-describedby'],
|
|
41
|
+
dataTestId = _ref['data-testid'],
|
|
42
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
43
|
+
const _useFormField = useFormField(),
|
|
44
|
+
register = _useFormField.register,
|
|
45
|
+
fieldErrors = _useFormField.fieldErrors;
|
|
45
46
|
const inputId = useId(id !== null && id !== void 0 ? id : inputProps === null || inputProps === void 0 ? void 0 : inputProps.id);
|
|
46
47
|
const registerProps = name && register ? register(name, {
|
|
47
48
|
type: 'checkbox'
|
|
@@ -51,12 +52,14 @@ const Checkbox = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
51
52
|
registerProps === null || registerProps === void 0 || registerProps.onBlur(e);
|
|
52
53
|
inputProps === null || inputProps === void 0 || (_inputProps$onBlur = inputProps.onBlur) === null || _inputProps$onBlur === void 0 || _inputProps$onBlur.call(inputProps, e);
|
|
53
54
|
};
|
|
54
|
-
const
|
|
55
|
-
helperTextId
|
|
56
|
-
errorTextId
|
|
57
|
-
} = useFormFieldContext();
|
|
55
|
+
const _useFormFieldContext = useFormFieldContext(),
|
|
56
|
+
formFieldHelperTextId = _useFormFieldContext.helperTextId,
|
|
57
|
+
formFieldErrorTextId = _useFormFieldContext.errorTextId;
|
|
58
58
|
const internalAriaDescribedby = concatIds(externalAriaDescribedBy, formFieldHelperTextId, formFieldErrorTextId, inputProps === null || inputProps === void 0 ? void 0 : inputProps['aria-describedby']);
|
|
59
|
-
const
|
|
59
|
+
const _useControllableState = useControllableState(defaultChecked, () => {}, (_ref2 = externalChecked !== null && externalChecked !== void 0 ? externalChecked : inputProps === null || inputProps === void 0 ? void 0 : inputProps.checked) !== null && _ref2 !== void 0 ? _ref2 : registerProps === null || registerProps === void 0 ? void 0 : registerProps.checked),
|
|
60
|
+
_useControllableState2 = _slicedToArray(_useControllableState, 2),
|
|
61
|
+
checked = _useControllableState2[0],
|
|
62
|
+
setChecked = _useControllableState2[1];
|
|
60
63
|
const disabled = useMemo(() => externalDisabled !== null && externalDisabled !== void 0 ? externalDisabled : inputProps === null || inputProps === void 0 ? void 0 : inputProps.disabled, [externalDisabled, inputProps === null || inputProps === void 0 ? void 0 : inputProps.disabled]);
|
|
61
64
|
const onChangeHandler = useEventCallback(e => {
|
|
62
65
|
if (disabled) return;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"checkbox":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._Cl7ng{display:inline-flex;position:relative;margin-top:6px;margin-bottom:6px}._Cl7ng,._iSniF{cursor:pointer;height:16px;width:16px}._iSniF{position:absolute;opacity:0;z-index:10}._iSniF:disabled{cursor:not-allowed}._NTkzh{color:#32363a;display:flex;align-items:center;cursor:pointer}._eFtmj{cursor:auto;color:hsla(0,0%,53.7%,.4)}._TPG3Q{margin-right:12px;flex-shrink:0}._CQliG{position:absolute;top:0;left:0}._pbOmo{position:relative;display:flex;align-items:center;justify-content:center;height:16px;width:16px;background-color:#fff;border-radius:4px;border:1px solid #898989;z-index:0}._iSniF:hover ._pbOmo:not(._a6eSK)._FqItS,._pbOmo:not(._a6eSK):hover._FqItS{background-color:#085caf}._iSniF:hover ._pbOmo:not(._a6eSK):not(._FqItS),._pbOmo:not(._a6eSK):hover:not(._FqItS){border-color:#0b6ed0}._pbOmo ._BTndy{fill:#0b6ed0;fill-opacity:0}._pbOmo._FqItS ._BTndy{fill-opacity:1}._pbOmo._FqItS:not(._a6eSK){border-color:transparent;background-color:#0b6ed0}._pbOmo._FqItS:not(._a6eSK) ._BTndy{fill:#fff}._pbOmo._a6eSK{opacity:.4}._pbOmo ._8o0fI{position:absolute;height:10px;width:10px;border-radius:2px;background-color:#0b6ed0}._C4hYt{color:#32363a;margin-left:12px}._1W-mt{display:flex;align-items:center}._1W-mt:has(input:disabled) ._C4hYt{color:rgba(50,54,58,.4)}._1W-mt:not(:has(input:disabled)) ._C4hYt{cursor:pointer}._iSniF.focus-visible~._CQliG>._pbOmo,._iSniF:focus-visible~._CQliG>._pbOmo{border-color:#0b6ed0;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
4
|
+
var styles = {"checkbox":"_Cl7ng","input":"_iSniF","label":"_NTkzh","labelDisabled":"_eFtmj","wrappedInput":"_TPG3Q","visualCheck":"_CQliG","check":"_pbOmo","disabled":"_a6eSK","checked":"_FqItS","checkIcon":"_BTndy","mixed":"_8o0fI","checkboxLabel":"_C4hYt","checkboxField":"_1W-mt"};
|
|
5
|
+
var stylesheet="._Cl7ng{display:inline-flex;position:relative;margin-top:6px;margin-bottom:6px}._Cl7ng,._iSniF{cursor:pointer;height:16px;width:16px}._iSniF{position:absolute;opacity:0;z-index:10}._iSniF:disabled{cursor:not-allowed}._NTkzh{color:#32363a;display:flex;align-items:center;cursor:pointer}._eFtmj{cursor:auto;color:hsla(0,0%,53.7%,.4)}._TPG3Q{margin-right:12px;flex-shrink:0}._CQliG{position:absolute;top:0;left:0}._pbOmo{position:relative;display:flex;align-items:center;justify-content:center;height:16px;width:16px;background-color:#fff;border-radius:4px;border:1px solid #898989;z-index:0}._iSniF:hover ._pbOmo:not(._a6eSK)._FqItS,._pbOmo:not(._a6eSK):hover._FqItS{background-color:#085caf}._iSniF:hover ._pbOmo:not(._a6eSK):not(._FqItS),._pbOmo:not(._a6eSK):hover:not(._FqItS){border-color:#0b6ed0}._pbOmo ._BTndy{fill:#0b6ed0;fill-opacity:0}._pbOmo._FqItS ._BTndy{fill-opacity:1}._pbOmo._FqItS:not(._a6eSK){border-color:transparent;background-color:#0b6ed0}._pbOmo._FqItS:not(._a6eSK) ._BTndy{fill:#fff}._pbOmo._a6eSK{opacity:.4}._pbOmo ._8o0fI{position:absolute;height:10px;width:10px;border-radius:2px;background-color:#0b6ed0}._C4hYt{color:#32363a;margin-left:12px}._1W-mt{display:flex;align-items:center}._1W-mt:has(input:disabled) ._C4hYt{color:rgba(50,54,58,.4)}._1W-mt:not(:has(input:disabled)) ._C4hYt{cursor:pointer}._iSniF.focus-visible~._CQliG>._pbOmo,._iSniF:focus-visible~._CQliG>._pbOmo{border-color:#0b6ed0;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
2
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
2
3
|
import React__default from 'react';
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
import styles from './Checkbox2.js';
|
|
@@ -6,20 +7,20 @@ import Checkbox from './Checkbox.js';
|
|
|
6
7
|
import '../Label/index.js';
|
|
7
8
|
import Label from '../Label/Label.js';
|
|
8
9
|
|
|
10
|
+
const _excluded = ["id", "label", "checked", "defaultChecked", "onChange", "disabled", "value", "className", "inputProps", "aria-describedby"];
|
|
9
11
|
const CheckboxField = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
disabled = false,
|
|
17
|
-
value,
|
|
18
|
-
className,
|
|
19
|
-
inputProps,
|
|
20
|
-
'aria-describedby'
|
|
21
|
-
|
|
22
|
-
} = _ref;
|
|
12
|
+
let id = _ref.id,
|
|
13
|
+
label = _ref.label,
|
|
14
|
+
checked = _ref.checked,
|
|
15
|
+
defaultChecked = _ref.defaultChecked,
|
|
16
|
+
onChange = _ref.onChange,
|
|
17
|
+
_ref$disabled = _ref.disabled,
|
|
18
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
19
|
+
value = _ref.value,
|
|
20
|
+
className = _ref.className,
|
|
21
|
+
inputProps = _ref.inputProps,
|
|
22
|
+
ariaDescribedBy = _ref['aria-describedby'],
|
|
23
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
23
24
|
return /*#__PURE__*/React__default.createElement(Label, _extends({}, rest, {
|
|
24
25
|
ref: ref,
|
|
25
26
|
htmlFor: id,
|
|
@@ -13,24 +13,20 @@ import getSubDataTestId from '../../utils/getSubDataTestId/getSubDataTestId.js';
|
|
|
13
13
|
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
14
14
|
function Alpha(_ref) {
|
|
15
15
|
var _color$alpha5, _color$alpha6, _color$alpha7;
|
|
16
|
-
let
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
dataTestId
|
|
20
|
-
} = _ref;
|
|
16
|
+
let color = _ref.color,
|
|
17
|
+
onAlphaChange = _ref.onAlphaChange,
|
|
18
|
+
dataTestId = _ref.dataTestId;
|
|
21
19
|
const railRef = useRef(null);
|
|
22
20
|
const thumbRef = useRef(null);
|
|
23
|
-
const
|
|
24
|
-
translate
|
|
25
|
-
} = useTranslation();
|
|
21
|
+
const _useTranslation = useTranslation(),
|
|
22
|
+
translate = _useTranslation.translate;
|
|
26
23
|
const alphaAriaLabel = translate('alpha');
|
|
27
24
|
const MIN_ALPHA = 0;
|
|
28
25
|
const MAX_ALPHA = 100;
|
|
29
26
|
const handleChange = useEventCallback(e => {
|
|
30
|
-
const
|
|
31
|
-
left,
|
|
32
|
-
containerWidth
|
|
33
|
-
} = getMousePosition(e, railRef);
|
|
27
|
+
const _getMousePosition = getMousePosition(e, railRef),
|
|
28
|
+
left = _getMousePosition.left,
|
|
29
|
+
containerWidth = _getMousePosition.containerWidth;
|
|
34
30
|
const borderWidth = 4;
|
|
35
31
|
const newAlpha = Math.max(Math.min((containerWidth - left - borderWidth) / (containerWidth - 2 * borderWidth) * MAX_ALPHA, MAX_ALPHA), MIN_ALPHA);
|
|
36
32
|
onAlphaChange(newAlpha);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
2
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
3
|
+
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
2
4
|
import classNames from 'classnames';
|
|
3
5
|
import React__default, { useState, useEffect, useRef } from 'react';
|
|
4
6
|
import '../../hooks/useClickOutside/index.js';
|
|
@@ -29,38 +31,64 @@ import CaretDownIcon from '../../icons/components/CaretDownIcon.js';
|
|
|
29
31
|
import { offset } from '@floating-ui/react-dom';
|
|
30
32
|
import Input from '../Input/Input.js';
|
|
31
33
|
|
|
34
|
+
const _excluded = ["name", "hex"],
|
|
35
|
+
_excluded2 = ["name"],
|
|
36
|
+
_excluded3 = ["name"],
|
|
37
|
+
_excluded4 = ["name"];
|
|
32
38
|
function ColorPicker(_ref) {
|
|
33
39
|
var _color$name, _ref6;
|
|
34
|
-
let
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
palette = DEFAULT_COLOR_PALETTE,
|
|
38
|
-
isAlphaEnabled =
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
'
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
40
|
+
let externalColor = _ref.color,
|
|
41
|
+
onChange = _ref.onChange,
|
|
42
|
+
_ref$palette = _ref.palette,
|
|
43
|
+
palette = _ref$palette === void 0 ? DEFAULT_COLOR_PALETTE : _ref$palette,
|
|
44
|
+
_ref$isAlphaEnabled = _ref.isAlphaEnabled,
|
|
45
|
+
isAlphaEnabled = _ref$isAlphaEnabled === void 0 ? false : _ref$isAlphaEnabled,
|
|
46
|
+
_ref$hideHSVSelector = _ref.hideHSVSelector,
|
|
47
|
+
hideHSVSelector = _ref$hideHSVSelector === void 0 ? false : _ref$hideHSVSelector,
|
|
48
|
+
_ref$hideFlyoutInputs = _ref.hideFlyoutInputs,
|
|
49
|
+
hideFlyoutInputs = _ref$hideFlyoutInputs === void 0 ? false : _ref$hideFlyoutInputs,
|
|
50
|
+
_ref$isDisabled = _ref.isDisabled,
|
|
51
|
+
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
52
|
+
id = _ref.id,
|
|
53
|
+
externalButtonRef = _ref.buttonRef,
|
|
54
|
+
externalInputRef = _ref.inputRef,
|
|
55
|
+
elementRefToFocusOnClose = _ref.elementRefToFocusOnClose,
|
|
56
|
+
ariaLabel = _ref['aria-label'],
|
|
57
|
+
ariaLabelledBy = _ref['aria-labelledby'],
|
|
58
|
+
ariaDescribedBy = _ref['aria-describedby'],
|
|
59
|
+
_ref$zIndex = _ref.zIndex,
|
|
60
|
+
zIndex = _ref$zIndex === void 0 ? 1000 : _ref$zIndex,
|
|
61
|
+
dataTestId = _ref['data-testid'],
|
|
62
|
+
CustomAnchor = _ref.CustomAnchor,
|
|
63
|
+
_ref$hexInputHidden = _ref.hexInputHidden,
|
|
64
|
+
hexInputHidden = _ref$hexInputHidden === void 0 ? false : _ref$hexInputHidden,
|
|
65
|
+
_ref$hasSelection = _ref.hasSelection,
|
|
66
|
+
hasSelection = _ref$hasSelection === void 0 ? false : _ref$hasSelection,
|
|
67
|
+
noColorHandlers = _ref.noColorHandlers,
|
|
68
|
+
_ref$noColorSet = _ref.noColorSet,
|
|
69
|
+
noColorSet = _ref$noColorSet === void 0 ? false : _ref$noColorSet;
|
|
57
70
|
const containerId = useId(id);
|
|
58
71
|
const flyoutId = "".concat(containerId, "-flyout");
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const
|
|
72
|
+
const _useControllableState = useControllableState(externalColor, onChange, externalColor),
|
|
73
|
+
_useControllableState2 = _slicedToArray(_useControllableState, 2),
|
|
74
|
+
color = _useControllableState2[0],
|
|
75
|
+
setColor = _useControllableState2[1];
|
|
76
|
+
const _useState = useState(false),
|
|
77
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
78
|
+
isOpen = _useState2[0],
|
|
79
|
+
setIsOpen = _useState2[1];
|
|
80
|
+
const _useState3 = useState(hexToHsv(color.hex)),
|
|
81
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
82
|
+
hsv = _useState4[0],
|
|
83
|
+
setHsv = _useState4[1];
|
|
84
|
+
const _useState5 = useState(color.hex),
|
|
85
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
86
|
+
inputHex = _useState6[0],
|
|
87
|
+
setInputHex = _useState6[1];
|
|
88
|
+
const _useState7 = useState(0),
|
|
89
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
90
|
+
triggerHexUpdate = _useState8[0],
|
|
91
|
+
setTriggerHexUpdate = _useState8[1];
|
|
64
92
|
useEffect(() => {
|
|
65
93
|
var _color$alpha;
|
|
66
94
|
const alpha = isAlphaEnabled ? Math.round(((_color$alpha = color.alpha) !== null && _color$alpha !== void 0 ? _color$alpha : 100) / 100 * 255).toString(16).padStart(2, '0') : '';
|
|
@@ -76,9 +104,8 @@ function ColorPicker(_ref) {
|
|
|
76
104
|
elementRefToFocusOnClose === null || elementRefToFocusOnClose === void 0 || (_elementRefToFocusOnC = elementRefToFocusOnClose.current) === null || _elementRefToFocusOnC === void 0 || _elementRefToFocusOnC.focus();
|
|
77
105
|
}
|
|
78
106
|
}, [isOpen, elementRefToFocusOnClose]);
|
|
79
|
-
const
|
|
80
|
-
translate
|
|
81
|
-
} = useTranslation();
|
|
107
|
+
const _useTranslation = useTranslation(),
|
|
108
|
+
translate = _useTranslation.translate;
|
|
82
109
|
const anchorAriaDescription = translate('colorPickerAnchorDesc', {
|
|
83
110
|
colorName: (_color$name = color.name) !== null && _color$name !== void 0 ? _color$name : '',
|
|
84
111
|
colorHex: color.hex
|
|
@@ -101,11 +128,9 @@ function ColorPicker(_ref) {
|
|
|
101
128
|
// explicitly moved by users
|
|
102
129
|
useDidUpdate(() => {
|
|
103
130
|
setColor(_ref2 => {
|
|
104
|
-
let
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
...rest
|
|
108
|
-
} = _ref2;
|
|
131
|
+
let name = _ref2.name,
|
|
132
|
+
hex = _ref2.hex,
|
|
133
|
+
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
109
134
|
let newColor;
|
|
110
135
|
if (JSON.stringify(hsv) === JSON.stringify(hexToHsv(hex)) && name) {
|
|
111
136
|
newColor = {
|
|
@@ -137,10 +162,8 @@ function ColorPicker(_ref) {
|
|
|
137
162
|
const validatedHex = validateHex(color, e.target.value, isAlphaEnabled);
|
|
138
163
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
139
164
|
setColor(_ref3 => {
|
|
140
|
-
let
|
|
141
|
-
|
|
142
|
-
...rest
|
|
143
|
-
} = _ref3;
|
|
165
|
+
let name = _ref3.name,
|
|
166
|
+
rest = _objectWithoutProperties(_ref3, _excluded2);
|
|
144
167
|
const hex = "#".concat(validatedHex.substring(0, 6));
|
|
145
168
|
if (isAlphaEnabled) {
|
|
146
169
|
const alpha = Math.round(parseInt(validatedHex.substring(6, 8), 16) / 255 * 100);
|
|
@@ -158,10 +181,8 @@ function ColorPicker(_ref) {
|
|
|
158
181
|
function handleHexBlur(hex) {
|
|
159
182
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
160
183
|
setColor(_ref4 => {
|
|
161
|
-
let
|
|
162
|
-
|
|
163
|
-
...rest
|
|
164
|
-
} = _ref4;
|
|
184
|
+
let name = _ref4.name,
|
|
185
|
+
rest = _objectWithoutProperties(_ref4, _excluded3);
|
|
165
186
|
const newColor = {
|
|
166
187
|
...rest,
|
|
167
188
|
hex: "#".concat(hex)
|
|
@@ -205,10 +226,8 @@ function ColorPicker(_ref) {
|
|
|
205
226
|
function handleColorSwatchClick(swatchColor) {
|
|
206
227
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
207
228
|
setColor(_ref5 => {
|
|
208
|
-
let
|
|
209
|
-
|
|
210
|
-
...rest
|
|
211
|
-
} = _ref5;
|
|
229
|
+
let name = _ref5.name,
|
|
230
|
+
rest = _objectWithoutProperties(_ref5, _excluded4);
|
|
212
231
|
const newColor = {
|
|
213
232
|
...rest,
|
|
214
233
|
...swatchColor
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"colorPicker":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._5bAAp{display:flex;line-height:1.15}._5bAAp ._8LFxs{display:flex;align-items:center;background-color:#fafafa;border:0;border-radius:4px 0 0 4px;padding:0;cursor:pointer;outline:none}._5bAAp ._8LFxs:hover:not(._yxsJY){background-color:#f5f5f5}._5bAAp ._8LFxs._yxsJY{cursor:not-allowed;fill:rgba(81,85,89,.4)}._5bAAp ._8LFxs:active:not(._yxsJY){background-color:#eee}._5bAAp ._4pHQL{width:18px;height:36px;border-radius:4px 0 0 4px;border:1px solid #898989;border-right-width:0}._5bAAp ._4pHQL._yxsJY{border-color:#d9d9d9}._5bAAp ._aC1ZF{position:relative;background-image:linear-gradient(45deg,rgba(0,0,0,.1) 25%,transparent 0),linear-gradient(135deg,rgba(0,0,0,.1) 25%,transparent 0),linear-gradient(45deg,transparent 75%,rgba(0,0,0,.1) 0),linear-gradient(135deg,transparent 75%,rgba(0,0,0,.1) 0);background-color:#fff;background-size:18px 18px;background-position:0 0,9px 0,9px -9px,0 9px}._5bAAp ._CMMwi{width:36px;height:36px;border:1px solid #898989;border-right-width:0}._5bAAp ._CMMwi._yxsJY{border-color:#d9d9d9}._5bAAp ._XOFdm{height:36px;border:1px solid #898989;border-width:1px 0}._5bAAp ._XOFdm._yxsJY{border-color:#d9d9d9}._5bAAp ._atn7m{border-radius:0 4px 4px 0;width:115px;padding-left:21px}._5bAAp ._ibP9N{position:absolute;top:10px;left:13px;font-size:14px;color:#32363a;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._5bAAp ._ibP9N._nfmwg{color:#9d9fa1}._8LFxs.focus-visible,._8LFxs:focus-visible{background:#fafafa;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88;z-index:10}._tLAsQ{width:264px;padding:8px;background-color:#fff;border:1px solid #eee;border-radius:4px;box-shadow:0 8px 20px rgba(0,0,0,.1);line-height:1.15}._tLAsQ ._Ao3Tw{position:relative;width:246px;height:150px;border-radius:4px;border:1px solid rgba(0,0,0,.43);background:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,transparent);background-origin:border-box}._tLAsQ ._50Pj2{position:absolute;width:12px;height:12px;border-radius:50%;border:1px solid #fff;box-shadow:inset 0 0 0 1px rgba(0,0,0,.5);outline:none;cursor:pointer}._tLAsQ ._l-Sg2{display:flex;justify-content:space-between;margin:12px 0}._tLAsQ ._l-Sg2._65f8w{margin-bottom:0}._tLAsQ ._syVk7{display:flex}._tLAsQ ._gGZBw{width:19px;height:38px;border-radius:2px 0 0 2px;border:1px solid rgba(0,0,0,.43);border-right-width:0}._tLAsQ ._kUrXh{width:19px;height:38px;border-radius:0 2px 2px 0;border:1px solid rgba(0,0,0,.43);border-left-width:0}._tLAsQ ._JcXj5{background-image:linear-gradient(45deg,rgba(0,0,0,.1) 25%,transparent 0),linear-gradient(135deg,rgba(0,0,0,.1) 25%,transparent 0),linear-gradient(45deg,transparent 75%,rgba(0,0,0,.1) 0),linear-gradient(135deg,transparent 75%,rgba(0,0,0,.1) 0);background-color:#fff;background-size:19px 19px;background-position:0 0,9.5px 0,9.5px -9.5px,0 9.5px;border-radius:0 2px 2px 0}._tLAsQ ._BFp3K{width:202px;height:38px;padding:0 3px;border-radius:1px;border:1px solid rgba(0,0,0,.43);background:linear-gradient(90deg,red,red 2%,#ff0 18%,#0f0 34%,#0ff 50%,#00f 66%,#f0f 82%,red 98%,red)}._tLAsQ ._BFp3K._qAKBe{height:16px;margin-bottom:6px}._tLAsQ ._wALIj{position:relative;background-color:#fff;border:1px solid rgba(0,0,0,.25);border-radius:1px;background-clip:padding-box;width:8px;height:38px;outline:none;cursor:pointer;top:-1px}._tLAsQ ._wALIj._qAKBe{height:16px}._tLAsQ ._u94s8{position:relative;background-image:linear-gradient(45deg,rgba(0,0,0,.1) 25%,transparent 0),linear-gradient(135deg,rgba(0,0,0,.1) 25%,transparent 0),linear-gradient(45deg,transparent 75%,rgba(0,0,0,.1) 0),linear-gradient(135deg,transparent 75%,rgba(0,0,0,.1) 0);background-color:#fff;background-size:16px 16px;background-position:0 0,8px 0,8px -8px,0 8px;border-radius:1px}._tLAsQ ._Vxsm0{width:202px;height:16px;padding:0 3px;border-radius:1px;border:1px solid rgba(0,0,0,.43);background-origin:border-box!important}._tLAsQ ._Q4pBB{position:relative;background-color:#fff;border:1px solid rgba(0,0,0,.25);border-radius:1px;background-clip:padding-box;width:8px;height:16px;outline:none;cursor:pointer;top:-1px}._tLAsQ ._rtWql{display:flex;justify-content:space-between}._tLAsQ ._3dlUm{display:flex;flex-direction:column;align-items:center}._tLAsQ ._3dlUm._r61Et{margin-left:4px}._tLAsQ ._avjQy{position:absolute;top:3px;left:5px;font-size:14px;line-height:20px;color:#32363a;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._tLAsQ ._91z7I{padding:3px 4px 3px 13px!important;width:78px}._tLAsQ ._v3A4u{text-align:right;padding:3px 4px 3px 0!important;width:34px}._tLAsQ ._ZlQMt{text-align:right;padding:3px 16px 3px 0!important;width:46px}._tLAsQ ._Lbxp5{position:absolute;top:3px;right:4px;font-size:14px;line-height:20px;color:#32363a;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._tLAsQ ._kDr9A{line-height:22px}._tLAsQ ._71sET{display:flex}._tLAsQ ._sfUXs{display:flex;flex-wrap:wrap;margin:9px -3px -3px}._tLAsQ ._sfUXs._BTp58{margin-top:0}._tLAsQ ._rkPqG{width:22px;height:22px;margin:3px;border-radius:4px;border:1px solid rgba(0,0,0,.43);outline:none;cursor:pointer}._tLAsQ ._aeuY-,._tLAsQ ._tko9T{margin-top:12px}._r-Rtp{position:relative}._DheFw{display:none}._dJdVy{border:0;clip:rect(0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;width:1px;position:absolute}._50Pj2.focus-visible,._50Pj2:focus-visible{box-shadow:inset 0 0 0 1px rgba(0,0,0,.5),0 0 0 2px #fff,0 0 0 4px #0a3f88;background-color:#fff}._Q4pBB.focus-visible,._Q4pBB:focus-visible,._rkPqG.focus-visible,._rkPqG:focus-visible,._wALIj.focus-visible,._wALIj:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
4
|
+
var styles = {"colorPicker":"_5bAAp","colorPickerButton":"_8LFxs","disabledButton":"_yxsJY","colorPickerButtonPreview":"_4pHQL","alphaBackground":"_aC1ZF","colorPickerButtonAlphaPreview":"_CMMwi","caretIcon":"_XOFdm","colorPickerInput":"_atn7m","colorPickerInputDecoration":"_ibP9N","disabledDecoration":"_nfmwg","colorPickerFlyout":"_tLAsQ","saturationGrid":"_Ao3Tw","saturationLoop":"_50Pj2","sliderGroup":"_l-Sg2","removeBottomMargin":"_65f8w","sliderPreviewContainer":"_syVk7","sliderPreview":"_gGZBw","sliderPreviewAlpha":"_kUrXh","sliderPreviewAlphaBackground":"_JcXj5","hueSliderRail":"_BFp3K","alphaEnabled":"_qAKBe","hueSliderThumb":"_wALIj","alphaSliderRailBackground":"_u94s8","alphaSliderRail":"_Vxsm0","alphaSliderThumb":"_Q4pBB","hexInputGroup":"_rtWql","hexInputContainer":"_3dlUm","rgbInputContainer":"_r61Et","hexInputDecoration":"_avjQy","hexInput":"_91z7I","rgbInput":"_v3A4u","alphaInput":"_ZlQMt","alphaInputDecoration":"_Lbxp5","inputLabel":"_kDr9A","rgbContainer":"_71sET","palette":"_sfUXs","removeUpperMargin":"_BTp58","swatch":"_rkPqG","noColorButton":"_tko9T","clearSelectionButton":"_aeuY-","relativePositionContainer":"_r-Rtp","hidden":"_DheFw","hiddenLiveRegion":"_dJdVy"};
|
|
5
|
+
var stylesheet="._5bAAp{display:flex;line-height:1.15}._5bAAp ._8LFxs{display:flex;align-items:center;background-color:#fafafa;border:0;border-radius:4px 0 0 4px;padding:0;cursor:pointer;outline:none}._5bAAp ._8LFxs:hover:not(._yxsJY){background-color:#f5f5f5}._5bAAp ._8LFxs._yxsJY{cursor:not-allowed;fill:rgba(81,85,89,.4)}._5bAAp ._8LFxs:active:not(._yxsJY){background-color:#eee}._5bAAp ._4pHQL{width:18px;height:36px;border-radius:4px 0 0 4px;border:1px solid #898989;border-right-width:0}._5bAAp ._4pHQL._yxsJY{border-color:#d9d9d9}._5bAAp ._aC1ZF{position:relative;background-image:linear-gradient(45deg,rgba(0,0,0,.1) 25%,transparent 0),linear-gradient(135deg,rgba(0,0,0,.1) 25%,transparent 0),linear-gradient(45deg,transparent 75%,rgba(0,0,0,.1) 0),linear-gradient(135deg,transparent 75%,rgba(0,0,0,.1) 0);background-color:#fff;background-size:18px 18px;background-position:0 0,9px 0,9px -9px,0 9px}._5bAAp ._CMMwi{width:36px;height:36px;border:1px solid #898989;border-right-width:0}._5bAAp ._CMMwi._yxsJY{border-color:#d9d9d9}._5bAAp ._XOFdm{height:36px;border:1px solid #898989;border-width:1px 0}._5bAAp ._XOFdm._yxsJY{border-color:#d9d9d9}._5bAAp ._atn7m{border-radius:0 4px 4px 0;width:115px;padding-left:21px}._5bAAp ._ibP9N{position:absolute;top:10px;left:13px;font-size:14px;color:#32363a;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._5bAAp ._ibP9N._nfmwg{color:#9d9fa1}._8LFxs.focus-visible,._8LFxs:focus-visible{background:#fafafa;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88;z-index:10}._tLAsQ{width:264px;padding:8px;background-color:#fff;border:1px solid #eee;border-radius:4px;box-shadow:0 8px 20px rgba(0,0,0,.1);line-height:1.15}._tLAsQ ._Ao3Tw{position:relative;width:246px;height:150px;border-radius:4px;border:1px solid rgba(0,0,0,.43);background:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,transparent);background-origin:border-box}._tLAsQ ._50Pj2{position:absolute;width:12px;height:12px;border-radius:50%;border:1px solid #fff;box-shadow:inset 0 0 0 1px rgba(0,0,0,.5);outline:none;cursor:pointer}._tLAsQ ._l-Sg2{display:flex;justify-content:space-between;margin:12px 0}._tLAsQ ._l-Sg2._65f8w{margin-bottom:0}._tLAsQ ._syVk7{display:flex}._tLAsQ ._gGZBw{width:19px;height:38px;border-radius:2px 0 0 2px;border:1px solid rgba(0,0,0,.43);border-right-width:0}._tLAsQ ._kUrXh{width:19px;height:38px;border-radius:0 2px 2px 0;border:1px solid rgba(0,0,0,.43);border-left-width:0}._tLAsQ ._JcXj5{background-image:linear-gradient(45deg,rgba(0,0,0,.1) 25%,transparent 0),linear-gradient(135deg,rgba(0,0,0,.1) 25%,transparent 0),linear-gradient(45deg,transparent 75%,rgba(0,0,0,.1) 0),linear-gradient(135deg,transparent 75%,rgba(0,0,0,.1) 0);background-color:#fff;background-size:19px 19px;background-position:0 0,9.5px 0,9.5px -9.5px,0 9.5px;border-radius:0 2px 2px 0}._tLAsQ ._BFp3K{width:202px;height:38px;padding:0 3px;border-radius:1px;border:1px solid rgba(0,0,0,.43);background:linear-gradient(90deg,red,red 2%,#ff0 18%,#0f0 34%,#0ff 50%,#00f 66%,#f0f 82%,red 98%,red)}._tLAsQ ._BFp3K._qAKBe{height:16px;margin-bottom:6px}._tLAsQ ._wALIj{position:relative;background-color:#fff;border:1px solid rgba(0,0,0,.25);border-radius:1px;background-clip:padding-box;width:8px;height:38px;outline:none;cursor:pointer;top:-1px}._tLAsQ ._wALIj._qAKBe{height:16px}._tLAsQ ._u94s8{position:relative;background-image:linear-gradient(45deg,rgba(0,0,0,.1) 25%,transparent 0),linear-gradient(135deg,rgba(0,0,0,.1) 25%,transparent 0),linear-gradient(45deg,transparent 75%,rgba(0,0,0,.1) 0),linear-gradient(135deg,transparent 75%,rgba(0,0,0,.1) 0);background-color:#fff;background-size:16px 16px;background-position:0 0,8px 0,8px -8px,0 8px;border-radius:1px}._tLAsQ ._Vxsm0{width:202px;height:16px;padding:0 3px;border-radius:1px;border:1px solid rgba(0,0,0,.43);background-origin:border-box!important}._tLAsQ ._Q4pBB{position:relative;background-color:#fff;border:1px solid rgba(0,0,0,.25);border-radius:1px;background-clip:padding-box;width:8px;height:16px;outline:none;cursor:pointer;top:-1px}._tLAsQ ._rtWql{display:flex;justify-content:space-between}._tLAsQ ._3dlUm{display:flex;flex-direction:column;align-items:center}._tLAsQ ._3dlUm._r61Et{margin-left:4px}._tLAsQ ._avjQy{position:absolute;top:3px;left:5px;font-size:14px;line-height:20px;color:#32363a;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._tLAsQ ._91z7I{padding:3px 4px 3px 13px!important;width:78px}._tLAsQ ._v3A4u{text-align:right;padding:3px 4px 3px 0!important;width:34px}._tLAsQ ._ZlQMt{text-align:right;padding:3px 16px 3px 0!important;width:46px}._tLAsQ ._Lbxp5{position:absolute;top:3px;right:4px;font-size:14px;line-height:20px;color:#32363a;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._tLAsQ ._kDr9A{line-height:22px}._tLAsQ ._71sET{display:flex}._tLAsQ ._sfUXs{display:flex;flex-wrap:wrap;margin:9px -3px -3px}._tLAsQ ._sfUXs._BTp58{margin-top:0}._tLAsQ ._rkPqG{width:22px;height:22px;margin:3px;border-radius:4px;border:1px solid rgba(0,0,0,.43);outline:none;cursor:pointer}._tLAsQ ._aeuY-,._tLAsQ ._tko9T{margin-top:12px}._r-Rtp{position:relative}._DheFw{display:none}._dJdVy{border:0;clip:rect(0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;width:1px;position:absolute}._50Pj2.focus-visible,._50Pj2:focus-visible{box-shadow:inset 0 0 0 1px rgba(0,0,0,.5),0 0 0 2px #fff,0 0 0 4px #0a3f88;background-color:#fff}._Q4pBB.focus-visible,._Q4pBB:focus-visible,._rkPqG.focus-visible,._rkPqG:focus-visible,._wALIj.focus-visible,._wALIj:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
2
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
2
3
|
import React__default, { forwardRef } from 'react';
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
import Saturation from './Saturation.js';
|
|
@@ -16,31 +17,29 @@ import getSubDataTestId from '../../utils/getSubDataTestId/getSubDataTestId.js';
|
|
|
16
17
|
import hexToRgbaString from './utils/hexToRgbaString.js';
|
|
17
18
|
import { Button } from '../Button/Button2.js';
|
|
18
19
|
|
|
20
|
+
const _excluded = ["color", "hsv", "isAlphaEnabled", "className", "containerId", "palette", "onSaturationChange", "onHueChange", "onAlphaChange", "onHexBlur", "style", "onColorSwatchClick", "zIndex", "dataTestId", "hideHSVSelector", "hideFlyoutInputs", "hasSelection", "noColorHandlers"];
|
|
19
21
|
const ColorPickerFlyout = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
20
|
-
let
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const {
|
|
42
|
-
translate
|
|
43
|
-
} = useTranslation();
|
|
22
|
+
let color = _ref.color,
|
|
23
|
+
hsv = _ref.hsv,
|
|
24
|
+
isAlphaEnabled = _ref.isAlphaEnabled,
|
|
25
|
+
className = _ref.className,
|
|
26
|
+
containerId = _ref.containerId,
|
|
27
|
+
palette = _ref.palette,
|
|
28
|
+
onSaturationChange = _ref.onSaturationChange,
|
|
29
|
+
onHueChange = _ref.onHueChange,
|
|
30
|
+
onAlphaChange = _ref.onAlphaChange,
|
|
31
|
+
onHexBlur = _ref.onHexBlur,
|
|
32
|
+
style = _ref.style,
|
|
33
|
+
onColorSwatchClick = _ref.onColorSwatchClick,
|
|
34
|
+
zIndex = _ref.zIndex,
|
|
35
|
+
dataTestId = _ref.dataTestId,
|
|
36
|
+
hideHSVSelector = _ref.hideHSVSelector,
|
|
37
|
+
hideFlyoutInputs = _ref.hideFlyoutInputs,
|
|
38
|
+
hasSelection = _ref.hasSelection,
|
|
39
|
+
noColorHandlers = _ref.noColorHandlers,
|
|
40
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
41
|
+
const _useTranslation = useTranslation(),
|
|
42
|
+
translate = _useTranslation.translate;
|
|
44
43
|
const flyoutAriaLabel = translate('selectColor');
|
|
45
44
|
const noColorLabel = translate('colorPicker.noColor');
|
|
46
45
|
const clearSelectionLabel = translate('colorPicker.clearSelection');
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
1
2
|
import React__default, { useState, useEffect } from 'react';
|
|
2
3
|
import classNames from 'classnames';
|
|
3
4
|
import './utils/index.js';
|
|
@@ -15,16 +16,17 @@ import hexToRgb from './utils/hexToRgb.js';
|
|
|
15
16
|
import rgbToHex from './utils/rgbToHex.js';
|
|
16
17
|
|
|
17
18
|
function RGBInput(_ref) {
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
label,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
dataTestId
|
|
25
|
-
} = _ref;
|
|
19
|
+
let externalValue = _ref.value,
|
|
20
|
+
onBlur = _ref.onBlur,
|
|
21
|
+
label = _ref.label,
|
|
22
|
+
ariaLabel = _ref['aria-label'],
|
|
23
|
+
containerId = _ref.containerId,
|
|
24
|
+
dataTestId = _ref.dataTestId;
|
|
26
25
|
const inputId = "".concat(containerId, "-").concat(label, "-input");
|
|
27
|
-
const
|
|
26
|
+
const _useState = useState(externalValue),
|
|
27
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
28
|
+
internalValue = _useState2[0],
|
|
29
|
+
setInternalValue = _useState2[1];
|
|
28
30
|
useEffect(() => {
|
|
29
31
|
setInternalValue(externalValue);
|
|
30
32
|
}, [externalValue]);
|
|
@@ -49,25 +51,25 @@ function RGBInput(_ref) {
|
|
|
49
51
|
}
|
|
50
52
|
const ColorPickerFlyoutInputs = function HexInputGroup(_ref2) {
|
|
51
53
|
var _color$alpha;
|
|
52
|
-
let
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
dataTestId
|
|
59
|
-
} = _ref2;
|
|
54
|
+
let color = _ref2.color,
|
|
55
|
+
onHexBlur = _ref2.onHexBlur,
|
|
56
|
+
onAlphaBlur = _ref2.onAlphaBlur,
|
|
57
|
+
isAlphaEnabled = _ref2.isAlphaEnabled,
|
|
58
|
+
containerId = _ref2.containerId,
|
|
59
|
+
dataTestId = _ref2.dataTestId;
|
|
60
60
|
const hexInputId = "".concat(containerId, "-hex-input");
|
|
61
61
|
const alphaInputId = "".concat(containerId, "-alpha-input");
|
|
62
|
-
const
|
|
63
|
-
translate
|
|
64
|
-
} = useTranslation();
|
|
62
|
+
const _useTranslation = useTranslation(),
|
|
63
|
+
translate = _useTranslation.translate;
|
|
65
64
|
const hexInputAriaLabel = translate('hex');
|
|
66
65
|
const redInputAriaLabel = translate('redChannel');
|
|
67
66
|
const greenInputAriaLabel = translate('greenChannel');
|
|
68
67
|
const blueInputAriaLabel = translate('blueChannel');
|
|
69
68
|
const alphaInputAriaLabel = translate('alphaChannel');
|
|
70
|
-
const
|
|
69
|
+
const _useState3 = useState(color.hex),
|
|
70
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
71
|
+
internalHex = _useState4[0],
|
|
72
|
+
setInternalHex = _useState4[1];
|
|
71
73
|
useEffect(() => {
|
|
72
74
|
setInternalHex(color.hex.substring(1));
|
|
73
75
|
}, [color.hex]);
|
|
@@ -82,7 +84,10 @@ const ColorPickerFlyoutInputs = function HexInputGroup(_ref2) {
|
|
|
82
84
|
onHexBlur(validatedHex);
|
|
83
85
|
setInternalHex(validatedHex);
|
|
84
86
|
}
|
|
85
|
-
const
|
|
87
|
+
const _useState5 = useState((_color$alpha = color.alpha) !== null && _color$alpha !== void 0 ? _color$alpha : 100),
|
|
88
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
89
|
+
internalAlpha = _useState6[0],
|
|
90
|
+
setInternalAlpha = _useState6[1];
|
|
86
91
|
useEffect(() => {
|
|
87
92
|
var _color$alpha2;
|
|
88
93
|
setInternalAlpha((_color$alpha2 = color.alpha) !== null && _color$alpha2 !== void 0 ? _color$alpha2 : 100);
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
2
|
+
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
3
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
2
4
|
import React__default, { useState, useEffect } from 'react';
|
|
3
5
|
import './index.js';
|
|
4
6
|
import ColorPicker from './ColorPicker.js';
|
|
5
7
|
|
|
8
|
+
const _excluded = ["color", "onChange", "hasSelection"];
|
|
6
9
|
function ColorPickerWithNoColor(_ref) {
|
|
7
|
-
let
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
let externalColor = _ref.color,
|
|
11
|
+
externalOnChange = _ref.onChange,
|
|
12
|
+
hasSelection = _ref.hasSelection,
|
|
13
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
14
|
+
const _useState = useState(externalColor),
|
|
15
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
16
|
+
color = _useState2[0],
|
|
17
|
+
setColor = _useState2[1];
|
|
14
18
|
|
|
15
19
|
// Sync internal state with external color prop changes
|
|
16
20
|
useEffect(() => {
|