@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
|
@@ -5,11 +5,10 @@ import { conditionalA11yHelpersWrapper } from './A11yHelpersContext.js';
|
|
|
5
5
|
import { TranslationProvider } from '../../utils/Translation/TranslationProvider.js';
|
|
6
6
|
|
|
7
7
|
const UIProviderInner = _ref => {
|
|
8
|
-
let
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
config = {}
|
|
12
|
-
} = _ref;
|
|
8
|
+
let children = _ref.children,
|
|
9
|
+
portalTarget = _ref.portalTarget,
|
|
10
|
+
_ref$config = _ref.config,
|
|
11
|
+
config = _ref$config === void 0 ? {} : _ref$config;
|
|
13
12
|
return /*#__PURE__*/React__default.createElement(TranslationProvider, {
|
|
14
13
|
localizedText: config === null || config === void 0 ? void 0 : config.localizedText
|
|
15
14
|
}, /*#__PURE__*/React__default.createElement(PortalTargetProvider, {
|
|
@@ -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 './ColorPicker2.js';
|
|
@@ -7,6 +8,7 @@ import useMouseDrag from './useMouseDrag.js';
|
|
|
7
8
|
import isMouseEvent from './isMouseEvent.js';
|
|
8
9
|
import useEventCallback from '../../hooks/useEventCallback/useEventCallback.js';
|
|
9
10
|
|
|
11
|
+
const _excluded = ["alpha", "hsl", "onChange", "className"];
|
|
10
12
|
const getMouseChange = (e, hsl, initialA, container) => {
|
|
11
13
|
const containerHeight = container.clientHeight;
|
|
12
14
|
const y = isMouseEvent(e) ? e.pageY : e.touches[0].pageY;
|
|
@@ -41,13 +43,11 @@ const getKeyChange = (e, hsl) => {
|
|
|
41
43
|
};
|
|
42
44
|
};
|
|
43
45
|
const Alpha = function Alpha(_ref) {
|
|
44
|
-
let
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
...rest
|
|
50
|
-
} = _ref;
|
|
46
|
+
let alpha = _ref.alpha,
|
|
47
|
+
hsl = _ref.hsl,
|
|
48
|
+
onChange = _ref.onChange,
|
|
49
|
+
className = _ref.className,
|
|
50
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
51
51
|
const containerRef = React__default.useRef(null);
|
|
52
52
|
const handleChange = useEventCallback(e => {
|
|
53
53
|
const change = getMouseChange(e, hsl, alpha, containerRef.current);
|
|
@@ -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, { useEffect, useRef, useMemo } from 'react';
|
|
3
5
|
import styles from './ColorPicker2.js';
|
|
4
6
|
import '../Button/index.js';
|
|
@@ -21,6 +23,7 @@ import { Button } from '../Button/Button2.js';
|
|
|
21
23
|
import mergeRefs from '../../utils/mergeRefs/mergeRefs.js';
|
|
22
24
|
import ChevronDownIcon from '../../icons/components/ChevronDownIcon.js';
|
|
23
25
|
|
|
26
|
+
const _excluded = ["data-testid", "defaultColor", "color", "className", "enableAlpha", "onChange", "swatches", "zIndex"];
|
|
24
27
|
/**
|
|
25
28
|
* @deprecated Instead, use:
|
|
26
29
|
* ```
|
|
@@ -28,19 +31,27 @@ import ChevronDownIcon from '../../icons/components/ChevronDownIcon.js';
|
|
|
28
31
|
* ```
|
|
29
32
|
*/
|
|
30
33
|
const ColorPicker = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
31
|
-
let
|
|
32
|
-
|
|
33
|
-
defaultColor = '#000000',
|
|
34
|
-
color
|
|
35
|
-
className,
|
|
36
|
-
enableAlpha =
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
let dataTestId = _ref['data-testid'],
|
|
35
|
+
_ref$defaultColor = _ref.defaultColor,
|
|
36
|
+
defaultColor = _ref$defaultColor === void 0 ? '#000000' : _ref$defaultColor,
|
|
37
|
+
externalColor = _ref.color,
|
|
38
|
+
className = _ref.className,
|
|
39
|
+
_ref$enableAlpha = _ref.enableAlpha,
|
|
40
|
+
enableAlpha = _ref$enableAlpha === void 0 ? false : _ref$enableAlpha,
|
|
41
|
+
onChange = _ref.onChange,
|
|
42
|
+
_ref$swatches = _ref.swatches,
|
|
43
|
+
swatches = _ref$swatches === void 0 ? DEFAULT_SWATCH_COLORS : _ref$swatches,
|
|
44
|
+
_ref$zIndex = _ref.zIndex,
|
|
45
|
+
zIndex = _ref$zIndex === void 0 ? 1000 : _ref$zIndex,
|
|
46
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
47
|
+
const _React$useState = React__default.useState(false),
|
|
48
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
49
|
+
show = _React$useState2[0],
|
|
50
|
+
setShow = _React$useState2[1];
|
|
51
|
+
const _React$useState3 = React__default.useState(new Color(externalColor !== null && externalColor !== void 0 ? externalColor : defaultColor)),
|
|
52
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
53
|
+
color = _React$useState4[0],
|
|
54
|
+
setColor = _React$useState4[1];
|
|
44
55
|
useEffect(() => {
|
|
45
56
|
if (externalColor) setColor(new Color(externalColor));
|
|
46
57
|
}, [externalColor]);
|
|
@@ -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 = {"colorPickerBtnColor":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._V-NnE{margin-left:-6px;height:16px;width:16px;border-radius:2px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15)}._MXNtB{margin-right:-12px;margin-left:4px}._12YtQ{background-color:#fff;border-radius:4px;box-shadow:0 4px 24px -4px rgba(0,0,0,.5);width:156px}._haes0{margin:8px 8px 0;display:flex}._0Lo3E,._rbOgW{margin-left:4px}._uI-bb{margin:8px 4px 0 8px;display:flex;flex-wrap:wrap}._w8Y8q{margin:0 4px 4px 0}._w8Y8q:hover{width:18px;height:18px;margin:-1px 3px 3px -1px}._H8495{margin:4px 8px 8px}._fRGCV{position:relative;width:96px;height:96px;outline:0}._fRGCV.focus-visible ._i82Lz,._fRGCV:focus-visible ._i82Lz{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._Sp-R4{background:linear-gradient(90deg,#fff,transparent)}._mhXUI,._Sp-R4{position:absolute;top:0;right:0;bottom:0;left:0}._mhXUI{background:linear-gradient(0deg,#000,transparent)}._i82Lz{position:absolute;border:2px solid #fff;border-radius:5px;height:8px;width:8px;margin:0 0 -4px -4px;box-shadow:0 0 1px 1px rgba(0,0,0,.4),inset 0 0 1px #000}._--g4F{position:relative;background:linear-gradient(0deg,red,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);width:16px;height:96px;outline:0}._--g4F.focus-visible ._CnUZz,._--g4F:focus-visible ._CnUZz{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._CnUZz{width:16px;height:4px;background:#fff;border-radius:50%;position:absolute;box-shadow:0 0 4px 1px rgba(0,0,0,.4);transform:translateY(2px)}._s43CB{position:relative;width:16px;height:96px}._18wVQ{width:16px;height:4px;background:#fff;border-radius:50%;box-shadow:0 0 4px 1px rgba(0,0,0,.4);transform:translateY(2px)}._18wVQ,._lg9-8{position:absolute}._lg9-8{top:0;right:0;bottom:0;left:0;outline:0}._lg9-8.focus-visible ._18wVQ,._lg9-8:focus-visible ._18wVQ{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._UyuuA{position:absolute;top:0;right:0;bottom:0;left:0;background-image:linear-gradient(45deg,#d9dadb 25%,transparent 0),linear-gradient(-45deg,#d9dadb 25%,transparent 0),linear-gradient(45deg,transparent 75%,#d9dadb 0),linear-gradient(-45deg,transparent 75%,#d9dadb 0);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0}._wpa6R{border-radius:2px;height:16px;width:16px;cursor:pointer;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15)}._wpa6R.focus-visible,._wpa6R:focus-visible{outline:none}._wpa6R.focus-visible,._wpa6R:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._YPRaw{display:flex}._YPRaw ._DBQje{position:relative;flex-shrink:0;width:26px;height:26px}._YPRaw ._N48UZ{position:absolute;top:0;right:0;bottom:0;left:0;border-top-left-radius:4px;border-bottom-left-radius:4px;border:1px solid #c6c6c6}._YPRaw ._Fe07s{flex-basis:100%;min-width:0;border-top-left-radius:0;border-bottom-left-radius:0}";
|
|
4
|
+
var styles = {"colorPickerBtnColor":"_V-NnE","colorPickerBtnIcon":"_MXNtB","colorPicker":"_12YtQ","colorPickerSliderContainer":"_haes0","colorPickerHue":"_rbOgW","colorPickerAlpha":"_0Lo3E","colorPickerSwatches":"_uI-bb","colorPickerSwatch":"_w8Y8q","colorPickerHex":"_H8495","saturation":"_fRGCV","saturationCircle":"_i82Lz","saturationWhite":"_Sp-R4","saturationBlack":"_mhXUI","hue":"_--g4F","hueSlider":"_CnUZz","alpha":"_s43CB","alphaSlider":"_18wVQ","alphaGradient":"_lg9-8","alphaCheckerboard":"_UyuuA","swatch":"_wpa6R","hex":"_YPRaw","hexSwatch":"_DBQje","hexSwatchColor":"_N48UZ","hexInput":"_Fe07s"};
|
|
5
|
+
var stylesheet="._V-NnE{margin-left:-6px;height:16px;width:16px;border-radius:2px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15)}._MXNtB{margin-right:-12px;margin-left:4px}._12YtQ{background-color:#fff;border-radius:4px;box-shadow:0 4px 24px -4px rgba(0,0,0,.5);width:156px}._haes0{margin:8px 8px 0;display:flex}._0Lo3E,._rbOgW{margin-left:4px}._uI-bb{margin:8px 4px 0 8px;display:flex;flex-wrap:wrap}._w8Y8q{margin:0 4px 4px 0}._w8Y8q:hover{width:18px;height:18px;margin:-1px 3px 3px -1px}._H8495{margin:4px 8px 8px}._fRGCV{position:relative;width:96px;height:96px;outline:0}._fRGCV.focus-visible ._i82Lz,._fRGCV:focus-visible ._i82Lz{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._Sp-R4{background:linear-gradient(90deg,#fff,transparent)}._mhXUI,._Sp-R4{position:absolute;top:0;right:0;bottom:0;left:0}._mhXUI{background:linear-gradient(0deg,#000,transparent)}._i82Lz{position:absolute;border:2px solid #fff;border-radius:5px;height:8px;width:8px;margin:0 0 -4px -4px;box-shadow:0 0 1px 1px rgba(0,0,0,.4),inset 0 0 1px #000}._--g4F{position:relative;background:linear-gradient(0deg,red,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);width:16px;height:96px;outline:0}._--g4F.focus-visible ._CnUZz,._--g4F:focus-visible ._CnUZz{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._CnUZz{width:16px;height:4px;background:#fff;border-radius:50%;position:absolute;box-shadow:0 0 4px 1px rgba(0,0,0,.4);transform:translateY(2px)}._s43CB{position:relative;width:16px;height:96px}._18wVQ{width:16px;height:4px;background:#fff;border-radius:50%;box-shadow:0 0 4px 1px rgba(0,0,0,.4);transform:translateY(2px)}._18wVQ,._lg9-8{position:absolute}._lg9-8{top:0;right:0;bottom:0;left:0;outline:0}._lg9-8.focus-visible ._18wVQ,._lg9-8:focus-visible ._18wVQ{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._UyuuA{position:absolute;top:0;right:0;bottom:0;left:0;background-image:linear-gradient(45deg,#d9dadb 25%,transparent 0),linear-gradient(-45deg,#d9dadb 25%,transparent 0),linear-gradient(45deg,transparent 75%,#d9dadb 0),linear-gradient(-45deg,transparent 75%,#d9dadb 0);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0}._wpa6R{border-radius:2px;height:16px;width:16px;cursor:pointer;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15)}._wpa6R.focus-visible,._wpa6R:focus-visible{outline:none}._wpa6R.focus-visible,._wpa6R:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._YPRaw{display:flex}._YPRaw ._DBQje{position:relative;flex-shrink:0;width:26px;height:26px}._YPRaw ._N48UZ{position:absolute;top:0;right:0;bottom:0;left:0;border-top-left-radius:4px;border-bottom-left-radius:4px;border:1px solid #c6c6c6}._YPRaw ._Fe07s{flex-basis:100%;min-width:0;border-top-left-radius:0;border-bottom-left-radius:0}";
|
|
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,21 +1,28 @@
|
|
|
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 from 'react';
|
|
3
5
|
import classNames from 'classnames';
|
|
4
6
|
import styles from './ColorPicker2.js';
|
|
5
7
|
import '../Input/index.js';
|
|
6
8
|
import Input from '../Input/Input.js';
|
|
7
9
|
|
|
10
|
+
const _excluded = ["hex", "swatchColor", "onChange", "className"];
|
|
8
11
|
const HEX_REGEX = /#?[a-fA-F0-9]{3,}/;
|
|
9
12
|
const HexInput = function HexInput(_ref) {
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
let hex = _ref.hex,
|
|
14
|
+
swatchColor = _ref.swatchColor,
|
|
15
|
+
onChange = _ref.onChange,
|
|
16
|
+
className = _ref.className,
|
|
17
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
18
|
+
const _React$useState = React__default.useState(hex),
|
|
19
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
20
|
+
value = _React$useState2[0],
|
|
21
|
+
setValue = _React$useState2[1];
|
|
22
|
+
const _React$useState3 = React__default.useState(hex),
|
|
23
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
24
|
+
blurValue = _React$useState4[0],
|
|
25
|
+
setBlurValue = _React$useState4[1];
|
|
19
26
|
const inputRef = React__default.useRef(null);
|
|
20
27
|
React__default.useEffect(() => {
|
|
21
28
|
if (hex !== value) {
|
|
@@ -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 './ColorPicker2.js';
|
|
@@ -7,6 +8,7 @@ import useMouseDrag from './useMouseDrag.js';
|
|
|
7
8
|
import isMouseEvent from './isMouseEvent.js';
|
|
8
9
|
import useEventCallback from '../../hooks/useEventCallback/useEventCallback.js';
|
|
9
10
|
|
|
11
|
+
const _excluded = ["hsb", "onChange", "className"];
|
|
10
12
|
const getMouseChange = (e, hsb, container) => {
|
|
11
13
|
const containerHeight = container.clientHeight;
|
|
12
14
|
const y = isMouseEvent(e) ? e.pageY : e.touches[0].pageY;
|
|
@@ -42,12 +44,10 @@ const getKeyChange = (e, hsb) => {
|
|
|
42
44
|
};
|
|
43
45
|
};
|
|
44
46
|
const Hue = function Hue(_ref) {
|
|
45
|
-
let
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
...rest
|
|
50
|
-
} = _ref;
|
|
47
|
+
let hsb = _ref.hsb,
|
|
48
|
+
onChange = _ref.onChange,
|
|
49
|
+
className = _ref.className,
|
|
50
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
51
51
|
const containerRef = React__default.useRef(null);
|
|
52
52
|
const handleChange = useEventCallback(e => {
|
|
53
53
|
const change = getMouseChange(e, hsb, containerRef.current);
|
|
@@ -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 './ColorPicker2.js';
|
|
@@ -7,13 +8,13 @@ import useMouseDrag from './useMouseDrag.js';
|
|
|
7
8
|
import isMouseEvent from './isMouseEvent.js';
|
|
8
9
|
import useEventCallback from '../../hooks/useEventCallback/useEventCallback.js';
|
|
9
10
|
|
|
11
|
+
const _excluded = ["hsb", "onChange", "className"];
|
|
10
12
|
const getMouseChange = (e, hsb, container) => {
|
|
11
|
-
const
|
|
12
|
-
width
|
|
13
|
-
height
|
|
14
|
-
left
|
|
15
|
-
bottom
|
|
16
|
-
} = container.getBoundingClientRect();
|
|
13
|
+
const _container$getBoundin = container.getBoundingClientRect(),
|
|
14
|
+
containerWidth = _container$getBoundin.width,
|
|
15
|
+
containerHeight = _container$getBoundin.height,
|
|
16
|
+
containerLeft = _container$getBoundin.left,
|
|
17
|
+
containerBottom = _container$getBoundin.bottom;
|
|
17
18
|
const x = isMouseEvent(e) ? e.pageX : e.touches[0].pageX;
|
|
18
19
|
const y = isMouseEvent(e) ? e.pageY : e.touches[0].pageY;
|
|
19
20
|
let left = x - (containerLeft + window.pageXOffset);
|
|
@@ -56,10 +57,9 @@ const KEY_CHANGES = {
|
|
|
56
57
|
}
|
|
57
58
|
};
|
|
58
59
|
const getKeyChange = (e, hsb) => {
|
|
59
|
-
const
|
|
60
|
-
s
|
|
61
|
-
b
|
|
62
|
-
} = KEY_CHANGES[e.key];
|
|
60
|
+
const _KEY_CHANGES$e$key = KEY_CHANGES[e.key],
|
|
61
|
+
saturationChange = _KEY_CHANGES$e$key.s,
|
|
62
|
+
brightnessChange = _KEY_CHANGES$e$key.b;
|
|
63
63
|
const s = Math.max(0, Math.min(1, hsb.s + saturationChange));
|
|
64
64
|
const b = Math.max(0, Math.min(1, hsb.b + brightnessChange));
|
|
65
65
|
return {
|
|
@@ -70,12 +70,10 @@ const getKeyChange = (e, hsb) => {
|
|
|
70
70
|
};
|
|
71
71
|
};
|
|
72
72
|
const Saturation = function Saturation(_ref) {
|
|
73
|
-
let
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
...rest
|
|
78
|
-
} = _ref;
|
|
73
|
+
let hsb = _ref.hsb,
|
|
74
|
+
onChange = _ref.onChange,
|
|
75
|
+
className = _ref.className,
|
|
76
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
79
77
|
const containerRef = React__default.useRef(null);
|
|
80
78
|
const handleChange = useEventCallback(e => {
|
|
81
79
|
onChange === null || onChange === void 0 || onChange(getMouseChange(e, hsb, containerRef.current), e);
|
|
@@ -1,16 +1,17 @@
|
|
|
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 './ColorPicker2.js';
|
|
5
6
|
|
|
7
|
+
const _excluded = ["color", "onClick", "className"];
|
|
6
8
|
const ENTER = 13;
|
|
7
9
|
const Swatch = function Swatch(_ref) {
|
|
8
|
-
let
|
|
9
|
-
color = '#000000',
|
|
10
|
-
onClick,
|
|
11
|
-
className,
|
|
12
|
-
|
|
13
|
-
} = _ref;
|
|
10
|
+
let _ref$color = _ref.color,
|
|
11
|
+
color = _ref$color === void 0 ? '#000000' : _ref$color,
|
|
12
|
+
onClick = _ref.onClick,
|
|
13
|
+
className = _ref.className,
|
|
14
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
14
15
|
function handleClick(e) {
|
|
15
16
|
onClick === null || onClick === void 0 || onClick(color, e);
|
|
16
17
|
}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
1
2
|
import React__default from 'react';
|
|
2
3
|
import '../../hooks/index.js';
|
|
3
4
|
import useEventListener from '../../hooks/useEventListener/useEventListener.js';
|
|
4
5
|
|
|
5
6
|
function useMouseDrag(handleChange) {
|
|
6
|
-
const
|
|
7
|
+
const _React$useState = React__default.useState(false),
|
|
8
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
9
|
+
isMouseDown = _React$useState2[0],
|
|
10
|
+
setIsMouseDown = _React$useState2[1];
|
|
7
11
|
function handleMouseDown(e) {
|
|
8
12
|
handleChange(e);
|
|
9
13
|
setIsMouseDown(true);
|
|
@@ -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, { useState, useCallback, useMemo } from 'react';
|
|
3
5
|
import classNames from 'classnames';
|
|
4
6
|
import styles from './NumberStepper2.js';
|
|
@@ -9,6 +11,7 @@ import { NumberStepperContextProvider } from './NumberStepperContext.js';
|
|
|
9
11
|
import '../../hooks/index.js';
|
|
10
12
|
import useControllableState from '../../hooks/useControllableState/useControllableState.js';
|
|
11
13
|
|
|
14
|
+
const _excluded = ["isDisabled", "data-testid", "inputId", "defaultValue", "value", "step", "min", "max", "width", "className", "aria-label", "aria-labelledby", "aria-describedby", "style", "children", "onChange"];
|
|
12
15
|
/**
|
|
13
16
|
* Renders the NumberStepper component.
|
|
14
17
|
* This component is offered as a "default" (aka simple) component or an "advanced" (aka composite) component.
|
|
@@ -19,32 +22,40 @@ import useControllableState from '../../hooks/useControllableState/useControllab
|
|
|
19
22
|
* ```
|
|
20
23
|
*/
|
|
21
24
|
const NumberStepper = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
22
|
-
let
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
defaultValue = 0,
|
|
27
|
-
value
|
|
28
|
-
step =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
'aria-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
25
|
+
let isExternallyDisabled = _ref.isDisabled,
|
|
26
|
+
dataTestId = _ref['data-testid'],
|
|
27
|
+
inputId = _ref.inputId,
|
|
28
|
+
_ref$defaultValue = _ref.defaultValue,
|
|
29
|
+
defaultValue = _ref$defaultValue === void 0 ? 0 : _ref$defaultValue,
|
|
30
|
+
externalValue = _ref.value,
|
|
31
|
+
_ref$step = _ref.step,
|
|
32
|
+
step = _ref$step === void 0 ? 1 : _ref$step,
|
|
33
|
+
min = _ref.min,
|
|
34
|
+
max = _ref.max,
|
|
35
|
+
_ref$width = _ref.width,
|
|
36
|
+
width = _ref$width === void 0 ? 127 : _ref$width,
|
|
37
|
+
className = _ref.className,
|
|
38
|
+
ariaLabel = _ref['aria-label'],
|
|
39
|
+
ariaLabelledBy = _ref['aria-labelledby'],
|
|
40
|
+
ariaDescribedBy = _ref['aria-describedby'],
|
|
41
|
+
_ref$style = _ref.style,
|
|
42
|
+
style = _ref$style === void 0 ? {} : _ref$style,
|
|
43
|
+
children = _ref.children,
|
|
44
|
+
onChange = _ref.onChange,
|
|
45
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
41
46
|
/*
|
|
42
47
|
* Input value that comes from:
|
|
43
48
|
* (1) The `externalValue` prop, or
|
|
44
49
|
* (2) Internal state (if `externalValue` is undefined).
|
|
45
50
|
*/
|
|
46
|
-
const
|
|
47
|
-
|
|
51
|
+
const _useControllableState = useControllableState(defaultValue, onChange, externalValue),
|
|
52
|
+
_useControllableState2 = _slicedToArray(_useControllableState, 2),
|
|
53
|
+
inputValue = _useControllableState2[0],
|
|
54
|
+
setInputValue = _useControllableState2[1];
|
|
55
|
+
const _useState = useState(false),
|
|
56
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
57
|
+
wasIncrementOrDecrementButtonPressed = _useState2[0],
|
|
58
|
+
setWasIncrementOrDecrementButtonPressed = _useState2[1];
|
|
48
59
|
|
|
49
60
|
/**
|
|
50
61
|
* Increments the `inputValue` by `step`.
|
|
@@ -180,10 +191,8 @@ function convertToNumber(value) {
|
|
|
180
191
|
* Compares the given `value` to min and/or max
|
|
181
192
|
*/
|
|
182
193
|
function clampMinMax(value, _ref2) {
|
|
183
|
-
let
|
|
184
|
-
|
|
185
|
-
max
|
|
186
|
-
} = _ref2;
|
|
194
|
+
let min = _ref2.min,
|
|
195
|
+
max = _ref2.max;
|
|
187
196
|
if (typeof max === 'number' && value > max) {
|
|
188
197
|
return max;
|
|
189
198
|
}
|
|
@@ -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 = {"numberStepperContainer":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._UH4qC{display:inline-flex}._XU3le{color:#32363a;background:#fafafa;outline:none;text-align:center;padding:0 12px;min-width:55px;width:100%;font-size:14px;border:1px solid #898989;border-radius:0;-moz-appearance:textfield}._XU3le:hover:not(._hgPlm){cursor:pointer;background:#f5f5f5}._XU3le._RplAg{box-shadow:0 0 0 2px #fff,0 0 0 4px #900000}._XU3le._hgPlm{cursor:not-allowed;fill:#74777a;color:#74777a;border-color:#e5e5e5}._XU3le._hgPlm>svg{opacity:.4}._XU3le::-webkit-inner-spin-button,._XU3le::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}._XU3le:focus{z-index:0;border:none;border-radius:4px}._XU3le:focus:not(._RplAg){box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._XU3le:focus:not(._hgPlm),._Y9t3-{background:#fafafa}._Y9t3-{padding:0;display:flex;justify-content:center;align-items:center;flex-shrink:0;width:36px;height:36px;fill:#515559;outline:none;border-radius:4px 0 0 4px;border:1px solid #898989;border-right-width:0}._Y9t3-:hover:not(._hgPlm){cursor:pointer;background:#f5f5f5}._Y9t3-:active:not(._hgPlm){background:#e5e5e5}._Y9t3-._hgPlm{cursor:not-allowed;fill:#74777a;color:#74777a;border-color:#e5e5e5}._Y9t3-._hgPlm>svg{opacity:.4}._jxtQp{padding:0;display:flex;justify-content:center;align-items:center;flex-shrink:0;width:36px;height:36px;background:#fafafa;fill:#515559;outline:none;border-radius:0 4px 4px 0;border:1px solid #898989;border-left-width:0}._jxtQp:hover:not(._hgPlm){cursor:pointer;background:#f5f5f5}._jxtQp:active:not(._hgPlm){background:#e5e5e5}._jxtQp._hgPlm{cursor:not-allowed;fill:#74777a;color:#74777a;border-color:#e5e5e5}._jxtQp._hgPlm>svg{opacity:.4}._9KbK6{position:absolute;top:0;left:0;width:0;height:0;margin:0;overflow:hidden}";
|
|
4
|
+
var styles = {"numberStepperContainer":"_UH4qC","numberStepperInput":"_XU3le","disabled":"_hgPlm","invalid":"_RplAg","decrementBtn":"_Y9t3-","incrementBtn":"_jxtQp","inputValueAlert":"_9KbK6"};
|
|
5
|
+
var stylesheet="._UH4qC{display:inline-flex}._XU3le{color:#32363a;background:#fafafa;outline:none;text-align:center;padding:0 12px;min-width:55px;width:100%;font-size:14px;border:1px solid #898989;border-radius:0;-moz-appearance:textfield}._XU3le:hover:not(._hgPlm){cursor:pointer;background:#f5f5f5}._XU3le._RplAg{box-shadow:0 0 0 2px #fff,0 0 0 4px #900000}._XU3le._hgPlm{cursor:not-allowed;fill:#74777a;color:#74777a;border-color:#e5e5e5}._XU3le._hgPlm>svg{opacity:.4}._XU3le::-webkit-inner-spin-button,._XU3le::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}._XU3le:focus{z-index:0;border:none;border-radius:4px}._XU3le:focus:not(._RplAg){box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._XU3le:focus:not(._hgPlm),._Y9t3-{background:#fafafa}._Y9t3-{padding:0;display:flex;justify-content:center;align-items:center;flex-shrink:0;width:36px;height:36px;fill:#515559;outline:none;border-radius:4px 0 0 4px;border:1px solid #898989;border-right-width:0}._Y9t3-:hover:not(._hgPlm){cursor:pointer;background:#f5f5f5}._Y9t3-:active:not(._hgPlm){background:#e5e5e5}._Y9t3-._hgPlm{cursor:not-allowed;fill:#74777a;color:#74777a;border-color:#e5e5e5}._Y9t3-._hgPlm>svg{opacity:.4}._jxtQp{padding:0;display:flex;justify-content:center;align-items:center;flex-shrink:0;width:36px;height:36px;background:#fafafa;fill:#515559;outline:none;border-radius:0 4px 4px 0;border:1px solid #898989;border-left-width:0}._jxtQp:hover:not(._hgPlm){cursor:pointer;background:#f5f5f5}._jxtQp:active:not(._hgPlm){background:#e5e5e5}._jxtQp._hgPlm{cursor:not-allowed;fill:#74777a;color:#74777a;border-color:#e5e5e5}._jxtQp._hgPlm>svg{opacity:.4}._9KbK6{position:absolute;top:0;left:0;width:0;height:0;margin:0;overflow:hidden}";
|
|
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,9 +1,8 @@
|
|
|
1
1
|
import '../../utils/index.js';
|
|
2
2
|
import createContextUtilities from '../../utils/createContextUtilities/createContextUtilities.js';
|
|
3
3
|
|
|
4
|
-
const
|
|
5
|
-
useContext
|
|
6
|
-
Provider
|
|
7
|
-
} = createContextUtilities();
|
|
4
|
+
const _createContextUtiliti = createContextUtilities(),
|
|
5
|
+
useNumberStepperContext = _createContextUtiliti.useContext,
|
|
6
|
+
NumberStepperContextProvider = _createContextUtiliti.Provider;
|
|
8
7
|
|
|
9
8
|
export { NumberStepperContextProvider, useNumberStepperContext };
|
|
@@ -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 './NumberStepper2.js';
|
|
@@ -9,6 +10,7 @@ import useTranslation from '../../utils/Translation/useTranslation.js';
|
|
|
9
10
|
import getSubDataTestId from '../../utils/getSubDataTestId/getSubDataTestId.js';
|
|
10
11
|
import SubtractIcon from '../../icons/components/SubtractIcon.js';
|
|
11
12
|
|
|
13
|
+
const _excluded = ["data-testid", "className", "onClick"];
|
|
12
14
|
/**
|
|
13
15
|
* Renders the NumberStepperDecrement component.
|
|
14
16
|
* Either `NumberStepper` renders this component automatically or the consumer renders this component explicitly.
|
|
@@ -19,24 +21,20 @@ import SubtractIcon from '../../icons/components/SubtractIcon.js';
|
|
|
19
21
|
* ```
|
|
20
22
|
*/
|
|
21
23
|
const NumberStepperDecrement = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
22
|
-
let
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const {
|
|
29
|
-
translate
|
|
30
|
-
} = useTranslation();
|
|
24
|
+
let dataTestIdFromProps = _ref['data-testid'],
|
|
25
|
+
className = _ref.className,
|
|
26
|
+
onClick = _ref.onClick,
|
|
27
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
28
|
+
const _useTranslation = useTranslation(),
|
|
29
|
+
translate = _useTranslation.translate;
|
|
31
30
|
|
|
32
31
|
// Context from NumberStepper
|
|
33
|
-
const
|
|
34
|
-
isExternallyDisabled,
|
|
35
|
-
dataTestId,
|
|
36
|
-
decrement,
|
|
37
|
-
inputValue,
|
|
38
|
-
min
|
|
39
|
-
} = useNumberStepperContext();
|
|
32
|
+
const _useNumberStepperCont = useNumberStepperContext(),
|
|
33
|
+
isExternallyDisabled = _useNumberStepperCont.isExternallyDisabled,
|
|
34
|
+
dataTestId = _useNumberStepperCont.dataTestId,
|
|
35
|
+
decrement = _useNumberStepperCont.decrement,
|
|
36
|
+
inputValue = _useNumberStepperCont.inputValue,
|
|
37
|
+
min = _useNumberStepperCont.min;
|
|
40
38
|
|
|
41
39
|
// Indicates if the button is disabled
|
|
42
40
|
const isDisabled = Number(inputValue) <= min || isExternallyDisabled;
|
|
@@ -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 './NumberStepper2.js';
|
|
@@ -9,6 +10,7 @@ import useTranslation from '../../utils/Translation/useTranslation.js';
|
|
|
9
10
|
import getSubDataTestId from '../../utils/getSubDataTestId/getSubDataTestId.js';
|
|
10
11
|
import AddIcon from '../../icons/components/AddIcon.js';
|
|
11
12
|
|
|
13
|
+
const _excluded = ["data-testid", "className", "onClick"];
|
|
12
14
|
/**
|
|
13
15
|
* Renders the NumberStepperIncrement component.
|
|
14
16
|
* Either `NumberStepper` renders this component automatically or the consumer renders this component explicitly.
|
|
@@ -19,24 +21,20 @@ import AddIcon from '../../icons/components/AddIcon.js';
|
|
|
19
21
|
* ```
|
|
20
22
|
*/
|
|
21
23
|
const NumberStepperIncrement = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
22
|
-
let
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const {
|
|
29
|
-
translate
|
|
30
|
-
} = useTranslation();
|
|
24
|
+
let dataTestIdFromProps = _ref['data-testid'],
|
|
25
|
+
className = _ref.className,
|
|
26
|
+
onClick = _ref.onClick,
|
|
27
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
28
|
+
const _useTranslation = useTranslation(),
|
|
29
|
+
translate = _useTranslation.translate;
|
|
31
30
|
|
|
32
31
|
// Context from NumberStepper
|
|
33
|
-
const
|
|
34
|
-
isExternallyDisabled,
|
|
35
|
-
dataTestId,
|
|
36
|
-
increment,
|
|
37
|
-
inputValue,
|
|
38
|
-
max
|
|
39
|
-
} = useNumberStepperContext();
|
|
32
|
+
const _useNumberStepperCont = useNumberStepperContext(),
|
|
33
|
+
isExternallyDisabled = _useNumberStepperCont.isExternallyDisabled,
|
|
34
|
+
dataTestId = _useNumberStepperCont.dataTestId,
|
|
35
|
+
increment = _useNumberStepperCont.increment,
|
|
36
|
+
inputValue = _useNumberStepperCont.inputValue,
|
|
37
|
+
max = _useNumberStepperCont.max;
|
|
40
38
|
|
|
41
39
|
// Indicates if the button is disabled
|
|
42
40
|
const isDisabled = Number(inputValue) >= max || isExternallyDisabled;
|