@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
|
@@ -14,26 +14,22 @@ import getSubDataTestId from '../../utils/getSubDataTestId/getSubDataTestId.js';
|
|
|
14
14
|
|
|
15
15
|
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
16
16
|
function Hue(_ref) {
|
|
17
|
-
let
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
dataTestId
|
|
22
|
-
} = _ref;
|
|
17
|
+
let hue = _ref.hue,
|
|
18
|
+
onHueChange = _ref.onHueChange,
|
|
19
|
+
isAlphaEnabled = _ref.isAlphaEnabled,
|
|
20
|
+
dataTestId = _ref.dataTestId;
|
|
23
21
|
const railRef = useRef(null);
|
|
24
22
|
const thumbRef = useRef(null);
|
|
25
|
-
const
|
|
26
|
-
translate
|
|
27
|
-
} = useTranslation();
|
|
23
|
+
const _useTranslation = useTranslation(),
|
|
24
|
+
translate = _useTranslation.translate;
|
|
28
25
|
const hueAriaLabel = translate('hue');
|
|
29
26
|
const hueAriaText = translate('degrees', {
|
|
30
27
|
hue
|
|
31
28
|
});
|
|
32
29
|
const handleChange = useEventCallback(e => {
|
|
33
|
-
const
|
|
34
|
-
left,
|
|
35
|
-
containerWidth
|
|
36
|
-
} = getMousePosition(e, railRef);
|
|
30
|
+
const _getMousePosition = getMousePosition(e, railRef),
|
|
31
|
+
left = _getMousePosition.left,
|
|
32
|
+
containerWidth = _getMousePosition.containerWidth;
|
|
37
33
|
const borderWidth = 4;
|
|
38
34
|
const newHue = Math.max(Math.min((left - borderWidth) / (containerWidth - 2 * borderWidth) * 359, 359), 0);
|
|
39
35
|
onHueChange(newHue);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
1
2
|
import React__default, { useState, useRef, useEffect } from 'react';
|
|
2
3
|
import classNames from 'classnames';
|
|
3
4
|
import styles from './ColorPicker2.js';
|
|
@@ -10,15 +11,13 @@ import calculateTargetId from './utils/calculateTargetId.js';
|
|
|
10
11
|
|
|
11
12
|
const Swatch = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
12
13
|
var _color$name;
|
|
13
|
-
let
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
dataTestId
|
|
21
|
-
} = _ref;
|
|
14
|
+
let color = _ref.color,
|
|
15
|
+
onColorSwatchClick = _ref.onColorSwatchClick,
|
|
16
|
+
focusedSwatchIndex = _ref.focusedSwatchIndex,
|
|
17
|
+
setFocusedSwatchIndex = _ref.setFocusedSwatchIndex,
|
|
18
|
+
cellIndex = _ref.cellIndex,
|
|
19
|
+
ariaDescribedBy = _ref['aria-describedby'],
|
|
20
|
+
dataTestId = _ref.dataTestId;
|
|
22
21
|
function handleClick() {
|
|
23
22
|
setFocusedSwatchIndex(cellIndex);
|
|
24
23
|
onColorSwatchClick(color);
|
|
@@ -41,24 +40,27 @@ const Swatch = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
41
40
|
});
|
|
42
41
|
Swatch.displayName = 'Swatch';
|
|
43
42
|
function Palette(_ref2) {
|
|
44
|
-
let
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
43
|
+
let onColorSwatchClick = _ref2.onColorSwatchClick,
|
|
44
|
+
palette = _ref2.palette,
|
|
45
|
+
containerId = _ref2.containerId,
|
|
46
|
+
dataTestId = _ref2.dataTestId,
|
|
47
|
+
removeUpperMargin = _ref2.removeUpperMargin;
|
|
48
|
+
const _useState = useState(0),
|
|
49
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
50
|
+
focusedSwatchIndex = _useState2[0],
|
|
51
|
+
setFocusedSwatchIndex = _useState2[1];
|
|
52
|
+
const _useTranslation = useTranslation(),
|
|
53
|
+
translate = _useTranslation.translate;
|
|
55
54
|
const paletteAriaLabel = translate('palette');
|
|
56
55
|
const swatchAriaDesc = translate('selectColor');
|
|
57
56
|
const swatchDescriptionId = "".concat(containerId, "-swatch-desc");
|
|
58
57
|
const swatchRefs = useRef({});
|
|
59
58
|
|
|
60
59
|
// split palette into rows for grid aria role semantics
|
|
61
|
-
const
|
|
60
|
+
const _useState3 = useState([]),
|
|
61
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
62
|
+
paletteRows = _useState4[0],
|
|
63
|
+
setPaletteRows = _useState4[1];
|
|
62
64
|
const rowLength = 9;
|
|
63
65
|
const maxRows = 4;
|
|
64
66
|
useEffect(() => {
|
|
@@ -14,18 +14,15 @@ import getSubDataTestId from '../../utils/getSubDataTestId/getSubDataTestId.js';
|
|
|
14
14
|
|
|
15
15
|
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
16
16
|
function Saturation(_ref) {
|
|
17
|
-
let
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
dataTestId
|
|
22
|
-
} = _ref;
|
|
17
|
+
let hsv = _ref.hsv,
|
|
18
|
+
onSaturationChange = _ref.onSaturationChange,
|
|
19
|
+
containerId = _ref.containerId,
|
|
20
|
+
dataTestId = _ref.dataTestId;
|
|
23
21
|
const gridRef = useRef(null);
|
|
24
22
|
const loopRef = useRef(null);
|
|
25
23
|
const saturationId = "".concat(containerId, "-saturation");
|
|
26
|
-
const
|
|
27
|
-
translate
|
|
28
|
-
} = useTranslation();
|
|
24
|
+
const _useTranslation = useTranslation(),
|
|
25
|
+
translate = _useTranslation.translate;
|
|
29
26
|
const sliderAriaLabel = translate('saturation');
|
|
30
27
|
const saturationAriaDesc = translate('slider2D');
|
|
31
28
|
const sliderDescriptionId = "".concat(saturationId, "-saturation-desc");
|
|
@@ -43,12 +40,11 @@ function Saturation(_ref) {
|
|
|
43
40
|
const STEP = 0.01;
|
|
44
41
|
const LARGE_STEP = 0.1;
|
|
45
42
|
const handleChange = useEventCallback(e => {
|
|
46
|
-
const
|
|
47
|
-
left,
|
|
48
|
-
bottom,
|
|
49
|
-
containerWidth,
|
|
50
|
-
containerHeight
|
|
51
|
-
} = getMousePosition(e, gridRef);
|
|
43
|
+
const _getMousePosition = getMousePosition(e, gridRef),
|
|
44
|
+
left = _getMousePosition.left,
|
|
45
|
+
bottom = _getMousePosition.bottom,
|
|
46
|
+
containerWidth = _getMousePosition.containerWidth,
|
|
47
|
+
containerHeight = _getMousePosition.containerHeight;
|
|
52
48
|
const newSaturation = Math.max(Math.min((left - 6) / (containerWidth - 12), 1), 0);
|
|
53
49
|
const newValue = Math.max(Math.min((bottom - 6) / (containerHeight - 12), 1), 0);
|
|
54
50
|
onSaturationChange(newSaturation, newValue);
|
|
@@ -2,11 +2,10 @@ import hexToRgb from './hexToRgb.js';
|
|
|
2
2
|
|
|
3
3
|
// formula from https://www.rapidtables.com/convert/color/rgb-to-hsv.html
|
|
4
4
|
function hexToHsv(hex) {
|
|
5
|
-
const
|
|
6
|
-
r,
|
|
7
|
-
g,
|
|
8
|
-
b
|
|
9
|
-
} = hexToRgb(hex);
|
|
5
|
+
const _hexToRgb = hexToRgb(hex),
|
|
6
|
+
r = _hexToRgb.r,
|
|
7
|
+
g = _hexToRgb.g,
|
|
8
|
+
b = _hexToRgb.b;
|
|
10
9
|
const rDecimal = r / 255;
|
|
11
10
|
const gDecimal = g / 255;
|
|
12
11
|
const bDecimal = b / 255;
|
|
@@ -2,11 +2,9 @@ import rgbToHex from './rgbToHex.js';
|
|
|
2
2
|
|
|
3
3
|
// formula from https://www.rapidtables.com/convert/color/hsv-to-rgb.html
|
|
4
4
|
function hsvToHex(hsv) {
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
v
|
|
9
|
-
} = hsv;
|
|
5
|
+
const h = hsv.h,
|
|
6
|
+
s = hsv.s,
|
|
7
|
+
v = hsv.v;
|
|
10
8
|
const c = s * v;
|
|
11
9
|
const x = c * (1 - Math.abs(h / 60 % 2 - 1));
|
|
12
10
|
const m = v - c;
|
|
@@ -1,4 +1,7 @@
|
|
|
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';
|
|
4
|
+
import _includesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
2
5
|
import React__default, { forwardRef, useMemo, useRef, useState, useCallback, useEffect, cloneElement } from 'react';
|
|
3
6
|
import classNames from 'classnames';
|
|
4
7
|
import styles from './Combobox2.js';
|
|
@@ -18,6 +21,7 @@ import useControllableState from '../../hooks/useControllableState/useControllab
|
|
|
18
21
|
import useClickOutside from '../../hooks/useClickOutside/useClickOutside.js';
|
|
19
22
|
import wrapEvent from '../../utils/wrapEvent/wrapEvent.js';
|
|
20
23
|
|
|
24
|
+
const _excluded = ["children", "className", "defaultValue", "disabled", "unstable_autoSelect", "isInvalid", "unstable_freeForm", "unstable_isLoading", "isOpen", "onIsOpenChange", "onChange", "value", "unstable_isOptionSelectedOnKeyboardHighlight", "isFilteringDisabled", "aria-label", "aria-labelledby"];
|
|
21
25
|
const getOptionLabel = option => {
|
|
22
26
|
var _option$props;
|
|
23
27
|
return option === null || option === void 0 || (_option$props = option.props) === null || _option$props === void 0 ? void 0 : _option$props.label;
|
|
@@ -27,6 +31,7 @@ const getOptionValue = option => {
|
|
|
27
31
|
return option === null || option === void 0 || (_option$props2 = option.props) === null || _option$props2 === void 0 ? void 0 : _option$props2.value;
|
|
28
32
|
};
|
|
29
33
|
const doesOptionMatchFilter = (option, header, inputValue) => {
|
|
34
|
+
var _context, _context2;
|
|
30
35
|
const label = getOptionLabel(option);
|
|
31
36
|
|
|
32
37
|
// Filtering is turned off if the input value is empty or not a string, so the given option will be included in the filtered list, thus returns true
|
|
@@ -35,36 +40,38 @@ const doesOptionMatchFilter = (option, header, inputValue) => {
|
|
|
35
40
|
}
|
|
36
41
|
|
|
37
42
|
// Returns true if the given option's label or the given header includes the input value (the label and header must be strings in order to do the comparison)
|
|
38
|
-
return typeof label === 'string' && label.toLowerCase().
|
|
43
|
+
return typeof label === 'string' && _includesInstanceProperty(_context = label.toLowerCase()).call(_context, inputValue.toLowerCase()) || typeof header === 'string' && _includesInstanceProperty(_context2 = header.toLowerCase()).call(_context2, inputValue.toLowerCase());
|
|
39
44
|
};
|
|
40
45
|
const Combobox = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
41
|
-
let
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
disabled,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
46
|
+
let children = _ref.children,
|
|
47
|
+
className = _ref.className,
|
|
48
|
+
_ref$defaultValue = _ref.defaultValue,
|
|
49
|
+
defaultSelectedOptionValue = _ref$defaultValue === void 0 ? '' : _ref$defaultValue,
|
|
50
|
+
disabled = _ref.disabled,
|
|
51
|
+
_ref$unstable_autoSel = _ref.unstable_autoSelect,
|
|
52
|
+
unstable_autoSelect = _ref$unstable_autoSel === void 0 ? true : _ref$unstable_autoSel,
|
|
53
|
+
_ref$isInvalid = _ref.isInvalid,
|
|
54
|
+
isInvalid = _ref$isInvalid === void 0 ? false : _ref$isInvalid,
|
|
55
|
+
_ref$unstable_freeFor = _ref.unstable_freeForm,
|
|
56
|
+
unstable_freeForm = _ref$unstable_freeFor === void 0 ? false : _ref$unstable_freeFor,
|
|
57
|
+
_ref$unstable_isLoadi = _ref.unstable_isLoading,
|
|
58
|
+
unstable_isLoading = _ref$unstable_isLoadi === void 0 ? false : _ref$unstable_isLoadi,
|
|
59
|
+
externalIsOpen = _ref.isOpen,
|
|
60
|
+
onIsOpenChange = _ref.onIsOpenChange,
|
|
61
|
+
onChange = _ref.onChange,
|
|
62
|
+
externalSelectedOptionValue = _ref.value,
|
|
63
|
+
unstable_isOptionSelectedOnKeyboardHighlight = _ref.unstable_isOptionSelectedOnKeyboardHighlight,
|
|
64
|
+
_ref$isFilteringDisab = _ref.isFilteringDisabled,
|
|
65
|
+
externalIsFilteringDisabled = _ref$isFilteringDisab === void 0 ? false : _ref$isFilteringDisab,
|
|
66
|
+
ariaLabel = _ref['aria-label'],
|
|
67
|
+
ariaLabelledby = _ref['aria-labelledby'],
|
|
68
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
69
|
+
const _useTranslation = useTranslation(),
|
|
70
|
+
translate = _useTranslation.translate;
|
|
63
71
|
const isOptionSelectedOnKeyboardHighlight = unstable_isOptionSelectedOnKeyboardHighlight;
|
|
64
72
|
const isFilteringDisabled = isOptionSelectedOnKeyboardHighlight || externalIsFilteringDisabled;
|
|
65
|
-
const
|
|
66
|
-
isFocusVisible
|
|
67
|
-
} = useIsFocusVisible(true);
|
|
73
|
+
const _useIsFocusVisible = useIsFocusVisible(true),
|
|
74
|
+
isFocusVisible = _useIsFocusVisible.isFocusVisible;
|
|
68
75
|
let comboboxInput = /*#__PURE__*/React__default.createElement(ComboboxInput, null);
|
|
69
76
|
let comboboxList = /*#__PURE__*/React__default.createElement(ComboboxList, null);
|
|
70
77
|
|
|
@@ -82,35 +89,52 @@ const Combobox = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
82
89
|
const noMatchesFoundContainerId = "".concat(listContainerId, "-no-matches-found");
|
|
83
90
|
|
|
84
91
|
// Extracts all ComboboxOptions
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
const _useMemo = useMemo(() => {
|
|
93
|
+
var _comboboxList;
|
|
94
|
+
return filterChildren((_comboboxList = comboboxList) === null || _comboboxList === void 0 || (_comboboxList = _comboboxList.props) === null || _comboboxList === void 0 ? void 0 : _comboboxList.children, [{
|
|
95
|
+
matcher: child => (child === null || child === void 0 ? void 0 : child.type) === ComboboxOption
|
|
96
|
+
}]);
|
|
97
|
+
}, [comboboxList]),
|
|
98
|
+
_useMemo2 = _slicedToArray(_useMemo, 2),
|
|
99
|
+
_useMemo2$ = _slicedToArray(_useMemo2[1], 1),
|
|
100
|
+
allOptions = _useMemo2$[0];
|
|
101
|
+
const _comboboxInput$props = comboboxInput.props,
|
|
102
|
+
defaultInputValue = _comboboxInput$props.defaultValue,
|
|
103
|
+
onInputChange = _comboboxInput$props.onChange,
|
|
104
|
+
externalInputValue = _comboboxInput$props.value;
|
|
96
105
|
const optionRefs = useRef({});
|
|
97
106
|
const listRef = useRef(null);
|
|
98
107
|
const inputRef = useRef(null);
|
|
99
108
|
const iconRef = useRef(null);
|
|
100
|
-
const
|
|
109
|
+
const _useControllableState = useControllableState(false, onIsOpenChange, externalIsOpen),
|
|
110
|
+
_useControllableState2 = _slicedToArray(_useControllableState, 2),
|
|
111
|
+
isFlyoutOpen = _useControllableState2[0],
|
|
112
|
+
setIsFlyoutOpen = _useControllableState2[1];
|
|
101
113
|
|
|
102
114
|
// Highlighted index is only used when isOptionSelectedOnKeyboardHighlight is set to false
|
|
103
|
-
const
|
|
115
|
+
const _useState = useState(-1),
|
|
116
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
117
|
+
highlightedIndex = _useState2[0],
|
|
118
|
+
setHighlightedIndex = _useState2[1];
|
|
104
119
|
|
|
105
120
|
// This option value is the "computer readable" value. The option value is not used to set the input value.
|
|
106
|
-
const
|
|
121
|
+
const _useControllableState3 = useControllableState(defaultSelectedOptionValue, onChange, externalSelectedOptionValue),
|
|
122
|
+
_useControllableState4 = _slicedToArray(_useControllableState3, 2),
|
|
123
|
+
selectedOptionValue = _useControllableState4[0],
|
|
124
|
+
setSelectedOptionValue = _useControllableState4[1];
|
|
107
125
|
const getLabelForValue = useCallback(value => getOptionLabel(allOptions.find(option => getOptionValue(option) === value)), [allOptions]);
|
|
108
126
|
|
|
109
127
|
// The option label is the "human readable" value. The option label is used to set the input value.
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
128
|
+
const _useState3 = useState(() => getLabelForValue(selectedOptionValue) || externalInputValue || defaultInputValue || ''),
|
|
129
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
130
|
+
selectedOptionLabel = _useState4[0],
|
|
131
|
+
setSelectedOptionLabel = _useState4[1];
|
|
132
|
+
const _useControllableState5 = useControllableState(selectedOptionLabel,
|
|
133
|
+
// `e &&` prevents `ComboboxInput` from calling consumer-passed `onChange` for consumer-controlled `Combobox` value updates.
|
|
134
|
+
(_, e) => e && (onInputChange === null || onInputChange === void 0 ? void 0 : onInputChange(e)), externalInputValue),
|
|
135
|
+
_useControllableState6 = _slicedToArray(_useControllableState5, 2),
|
|
136
|
+
inputValue = _useControllableState6[0],
|
|
137
|
+
setInputValue = _useControllableState6[1];
|
|
114
138
|
|
|
115
139
|
// listen for updates from controlled value
|
|
116
140
|
useEffect(() => {
|
|
@@ -120,110 +144,119 @@ const Combobox = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
120
144
|
}, [selectedOptionValue, setInputValue, getLabelForValue]);
|
|
121
145
|
|
|
122
146
|
// Selected index is only used when isOptionSelectedOnKeyboardHighlight is set to true
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
147
|
+
const _useState5 = useState(() => {
|
|
148
|
+
if (isOptionSelectedOnKeyboardHighlight) {
|
|
149
|
+
for (let i = 0; i < allOptions.length; i += 1) {
|
|
150
|
+
const option = allOptions[i];
|
|
151
|
+
if (getOptionValue(option) === selectedOptionValue) {
|
|
152
|
+
return i;
|
|
153
|
+
}
|
|
129
154
|
}
|
|
130
155
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
156
|
+
return -1;
|
|
157
|
+
}),
|
|
158
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
159
|
+
selectedIndex = _useState6[0],
|
|
160
|
+
setSelectedIndex = _useState6[1];
|
|
134
161
|
useClickOutside([listRef, inputRef, iconRef], () => isFlyoutOpen && setIsFlyoutOpen(false));
|
|
135
162
|
|
|
136
163
|
// The number of options that match the filter for each header
|
|
137
164
|
const headerCounts = {};
|
|
138
165
|
|
|
139
166
|
// Gets the filtered options based on the current input value (only if isFilteringDisabled is false)
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
167
|
+
const _useMemo3 = useMemo(() => {
|
|
168
|
+
var _comboboxList2;
|
|
169
|
+
let currentHeaderTitle;
|
|
170
|
+
const handleSelect = option => {
|
|
171
|
+
const newOptionValue = getOptionValue(option);
|
|
172
|
+
const newInputValue = getOptionLabel(option);
|
|
173
|
+
setSelectedOptionValue(newOptionValue);
|
|
174
|
+
setInputValue(newInputValue, {
|
|
175
|
+
target: {
|
|
176
|
+
value: newInputValue
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
};
|
|
180
|
+
return filterChildren((_comboboxList2 = comboboxList) === null || _comboboxList2 === void 0 || (_comboboxList2 = _comboboxList2.props) === null || _comboboxList2 === void 0 ? void 0 : _comboboxList2.children, [
|
|
181
|
+
/*
|
|
182
|
+
* For each header, adds a key value pair to the headerCounts object where the key is the header title and the value is 0.
|
|
183
|
+
* The value will be updated in the matcher/modifier below this matcher/modifier.
|
|
184
|
+
*/
|
|
185
|
+
{
|
|
186
|
+
matcher: child => (child === null || child === void 0 ? void 0 : child.type) === ComboboxHeader,
|
|
187
|
+
modifier: child => {
|
|
188
|
+
var _props;
|
|
189
|
+
currentHeaderTitle = (_props = child.props) === null || _props === void 0 ? void 0 : _props.title;
|
|
190
|
+
headerCounts[currentHeaderTitle] = 0;
|
|
191
|
+
return child;
|
|
150
192
|
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
/*
|
|
168
|
-
* Increments the given option's header count and returns a cloned option component if the option is included in the filtered list.
|
|
169
|
-
* Otherwise, returns null.
|
|
170
|
-
*/
|
|
171
|
-
{
|
|
172
|
-
matcher: child => (child === null || child === void 0 ? void 0 : child.type) === ComboboxOption,
|
|
173
|
-
modifier: (child, index) => {
|
|
174
|
-
if (inputValue === selectedOptionLabel || isFilteringDisabled || doesOptionMatchFilter(child, currentHeaderTitle, inputValue)) {
|
|
175
|
-
var _optionElement$props$2;
|
|
176
|
-
headerCounts[currentHeaderTitle] += 1;
|
|
177
|
-
const optionElement = child;
|
|
178
|
-
return /*#__PURE__*/cloneElement(child, {
|
|
179
|
-
onSelect: e => {
|
|
180
|
-
var _optionElement$props, _optionElement$props$;
|
|
181
|
-
(_optionElement$props = optionElement.props) === null || _optionElement$props === void 0 || (_optionElement$props$ = _optionElement$props.onSelect) === null || _optionElement$props$ === void 0 || _optionElement$props$.call(_optionElement$props, e);
|
|
193
|
+
},
|
|
194
|
+
/*
|
|
195
|
+
* Increments the given option's header count and returns a cloned option component if the option is included in the filtered list.
|
|
196
|
+
* Otherwise, returns null.
|
|
197
|
+
*/
|
|
198
|
+
{
|
|
199
|
+
matcher: child => (child === null || child === void 0 ? void 0 : child.type) === ComboboxOption,
|
|
200
|
+
modifier: (child, index) => {
|
|
201
|
+
if (inputValue === selectedOptionLabel || isFilteringDisabled || doesOptionMatchFilter(child, currentHeaderTitle, inputValue)) {
|
|
202
|
+
var _optionElement$props$2;
|
|
203
|
+
headerCounts[currentHeaderTitle] += 1;
|
|
204
|
+
const optionElement = child;
|
|
205
|
+
return /*#__PURE__*/cloneElement(child, {
|
|
206
|
+
onSelect: e => {
|
|
207
|
+
var _optionElement$props, _optionElement$props$;
|
|
208
|
+
(_optionElement$props = optionElement.props) === null || _optionElement$props === void 0 || (_optionElement$props$ = _optionElement$props.onSelect) === null || _optionElement$props$ === void 0 || _optionElement$props$.call(_optionElement$props, e);
|
|
182
209
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
210
|
+
// Prevents form submission
|
|
211
|
+
if ((e === null || e === void 0 ? void 0 : e.key) === 'Enter') {
|
|
212
|
+
e.preventDefault();
|
|
213
|
+
}
|
|
214
|
+
if (!e.key) {
|
|
215
|
+
setIsFlyoutOpen(false);
|
|
216
|
+
}
|
|
217
|
+
handleSelect(child);
|
|
218
|
+
},
|
|
219
|
+
onMouseEnter: wrapEvent(optionElement.props.onMouseEnter, () => {
|
|
220
|
+
if (!isOptionSelectedOnKeyboardHighlight) {
|
|
221
|
+
setHighlightedIndex(index);
|
|
222
|
+
}
|
|
223
|
+
}),
|
|
224
|
+
onMouseLeave: wrapEvent(optionElement.props.onMouseLeave, () => {
|
|
225
|
+
if (!isOptionSelectedOnKeyboardHighlight) {
|
|
226
|
+
setHighlightedIndex(-1);
|
|
227
|
+
}
|
|
228
|
+
}),
|
|
229
|
+
isHighlightedOnHover: isOptionSelectedOnKeyboardHighlight,
|
|
230
|
+
isHighlighted: isOptionSelectedOnKeyboardHighlight ? false : index === highlightedIndex,
|
|
231
|
+
isSelected: isOptionSelectedOnKeyboardHighlight ? index === selectedIndex : selectedOptionValue === getOptionValue(child),
|
|
232
|
+
id: (_optionElement$props$2 = optionElement.props.id) !== null && _optionElement$props$2 !== void 0 ? _optionElement$props$2 : "".concat(listContainerId, "-option-").concat(index),
|
|
233
|
+
ref: node => {
|
|
234
|
+
optionRefs.current[Number(index)] = node;
|
|
195
235
|
}
|
|
196
|
-
})
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
setHighlightedIndex(-1);
|
|
200
|
-
}
|
|
201
|
-
}),
|
|
202
|
-
isHighlightedOnHover: isOptionSelectedOnKeyboardHighlight,
|
|
203
|
-
isHighlighted: isOptionSelectedOnKeyboardHighlight ? false : index === highlightedIndex,
|
|
204
|
-
isSelected: isOptionSelectedOnKeyboardHighlight ? index === selectedIndex : selectedOptionValue === getOptionValue(child),
|
|
205
|
-
id: (_optionElement$props$2 = optionElement.props.id) !== null && _optionElement$props$2 !== void 0 ? _optionElement$props$2 : "".concat(listContainerId, "-option-").concat(index),
|
|
206
|
-
ref: node => {
|
|
207
|
-
optionRefs.current[Number(index)] = node;
|
|
208
|
-
}
|
|
209
|
-
});
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
return null;
|
|
210
239
|
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
240
|
+
}]);
|
|
241
|
+
}, [comboboxList, headerCounts, highlightedIndex, inputValue, isFilteringDisabled, selectedOptionLabel, selectedOptionValue, setInputValue, setIsFlyoutOpen, setSelectedOptionValue, isOptionSelectedOnKeyboardHighlight, selectedIndex, listContainerId]),
|
|
242
|
+
_useMemo4 = _slicedToArray(_useMemo3, 2),
|
|
243
|
+
listChildrenFilteredOptions = _useMemo4[0],
|
|
244
|
+
_useMemo4$ = _slicedToArray(_useMemo4[1], 2),
|
|
245
|
+
filteredOptions = _useMemo4$[1];
|
|
215
246
|
const isAriaExpanded = useMemo(() => isFlyoutOpen && (unstable_isLoading || filteredOptions.length > 0), [isFlyoutOpen, filteredOptions, unstable_isLoading]);
|
|
216
247
|
|
|
217
248
|
// Gets all filtered options, as well as headers that have at least one filtered option
|
|
218
|
-
const
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
249
|
+
const _useMemo5 = useMemo(() => filterChildren(listChildrenFilteredOptions, [{
|
|
250
|
+
matcher: child => (child === null || child === void 0 ? void 0 : child.type) === ComboboxOption
|
|
251
|
+
}, {
|
|
252
|
+
matcher: child => (child === null || child === void 0 ? void 0 : child.type) === ComboboxHeader,
|
|
253
|
+
modifier: child => {
|
|
254
|
+
var _props2;
|
|
255
|
+
return headerCounts[(_props2 = child.props) === null || _props2 === void 0 ? void 0 : _props2.title] ? child : null;
|
|
256
|
+
}
|
|
257
|
+
}]), [headerCounts, listChildrenFilteredOptions]),
|
|
258
|
+
_useMemo6 = _slicedToArray(_useMemo5, 1),
|
|
259
|
+
listChildrenFilteredOptionsAndHeaders = _useMemo6[0];
|
|
227
260
|
const keyboardHighlightOrSelectOption = (index, e) => {
|
|
228
261
|
if (isOptionSelectedOnKeyboardHighlight) {
|
|
229
262
|
var _filteredOptions$inde, _filteredOptions$inde2;
|
|
@@ -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 = {"combobox":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._y7yAu{position:relative;display:inline-block}._z3r9e{padding-right:36px}._z3r9e._u1fTJ{box-shadow:none!important;border:1px solid #898989!important}._WcHyu{margin-top:4px}._lTvwA{position:absolute;right:4px;bottom:4px;height:28px;width:28px;border-radius:4px;fill:#515559;cursor:pointer}._lTvwA:hover{background-color:rgba(50,54,58,.08)}._lTvwA:active{background-color:rgba(50,54,58,.11)}._lTvwA._hhr4L{transform:rotate(-180deg)}._lTvwA._q-NYC{opacity:.4}._E6fUe{min-height:40px;padding:10px 12px;display:flex;flex-direction:row;align-items:center;background-color:#fff;font-size:14px;color:#32363a;word-break:break-word}._q-NYC{cursor:not-allowed}._q-NYC:hover{background-color:transparent}";
|
|
4
|
+
var styles = {"combobox":"_y7yAu","comboboxInput":"_z3r9e","ignoreFocusStyle":"_u1fTJ","labelledInput":"_WcHyu","comboboxIcon":"_lTvwA","open":"_hhr4L","disabled":"_q-NYC","comboboxEmpty":"_E6fUe"};
|
|
5
|
+
var stylesheet="._y7yAu{position:relative;display:inline-block}._z3r9e{padding-right:36px}._z3r9e._u1fTJ{box-shadow:none!important;border:1px solid #898989!important}._WcHyu{margin-top:4px}._lTvwA{position:absolute;right:4px;bottom:4px;height:28px;width:28px;border-radius:4px;fill:#515559;cursor:pointer}._lTvwA:hover{background-color:rgba(50,54,58,.08)}._lTvwA:active{background-color:rgba(50,54,58,.11)}._lTvwA._hhr4L{transform:rotate(-180deg)}._lTvwA._q-NYC{opacity:.4}._E6fUe{min-height:40px;padding:10px 12px;display:flex;flex-direction:row;align-items:center;background-color:#fff;font-size:14px;color:#32363a;word-break:break-word}._q-NYC{cursor:not-allowed}._q-NYC:hover{background-color:transparent}";
|
|
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
|
+
useComboboxContext = _createContextUtiliti.useContext,
|
|
6
|
+
ComboboxContextProvider = _createContextUtiliti.Provider;
|
|
8
7
|
|
|
9
8
|
export { ComboboxContextProvider, useComboboxContext };
|
|
@@ -1,16 +1,16 @@
|
|
|
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 '../../utils/index.js';
|
|
4
5
|
import { FlyoutHeader } from '../../utils/Flyout/FlyoutHeader.js';
|
|
5
6
|
import wrapEvent from '../../utils/wrapEvent/wrapEvent.js';
|
|
6
7
|
|
|
8
|
+
const _excluded = ["title", "children", "onMouseDown"];
|
|
7
9
|
const ComboboxHeader = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
8
|
-
let
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
...rest
|
|
13
|
-
} = _ref;
|
|
10
|
+
let title = _ref.title,
|
|
11
|
+
children = _ref.children,
|
|
12
|
+
onMouseDown = _ref.onMouseDown,
|
|
13
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
14
14
|
return /*#__PURE__*/React__default.createElement(FlyoutHeader, _extends({}, rest, {
|
|
15
15
|
title: title,
|
|
16
16
|
onMouseDown: wrapEvent(onMouseDown, e => e === null || e === void 0 ? void 0 : e.preventDefault()),
|