@qualtrics/ui-react 2.79.0 → 2.80.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/dist/__node_modules/@radix-ui/primitive/dist/index.js +5 -6
- package/dist/__node_modules/@radix-ui/react-arrow/dist/index.js +8 -7
- package/dist/__node_modules/@radix-ui/react-collection/dist/index.js +71 -63
- package/dist/__node_modules/@radix-ui/react-context/dist/index.js +10 -14
- package/dist/__node_modules/@radix-ui/react-direction/dist/index.js +2 -4
- package/dist/__node_modules/@radix-ui/react-dismissable-layer/dist/index.js +22 -15
- package/dist/__node_modules/@radix-ui/react-dropdown-menu/dist/index.js +89 -89
- package/dist/__node_modules/@radix-ui/react-focus-scope/dist/index.js +26 -19
- package/dist/__node_modules/@radix-ui/react-id/dist/index.js +5 -2
- package/dist/__node_modules/@radix-ui/react-menu/dist/index.js +165 -129
- package/dist/__node_modules/@radix-ui/react-popper/dist/index.js +139 -106
- package/dist/__node_modules/@radix-ui/react-portal/dist/index.js +9 -5
- package/dist/__node_modules/@radix-ui/react-presence/dist/index.js +27 -20
- package/dist/__node_modules/@radix-ui/react-primitive/dist/index.js +4 -5
- package/dist/__node_modules/@radix-ui/react-roving-focus/dist/index.js +61 -38
- package/dist/__node_modules/@radix-ui/react-slot/dist/index.js +8 -12
- package/dist/__node_modules/@radix-ui/react-use-controllable-state/dist/index.js +40 -35
- package/dist/__node_modules/@radix-ui/react-use-size/dist/index.js +5 -2
- package/dist/__shared/cjs/{index-7181e053.js → index-807921ca.js} +2830 -2635
- package/dist/__shared/cjs/{index-b77d5870.js → index-8c77a9ef.js} +15 -9
- package/dist/components/Accordion/Accordion.js +27 -21
- package/dist/components/Accordion/Accordion2.js +3 -3
- package/dist/components/Accordion/AccordionContext.js +6 -8
- package/dist/components/Accordion/AccordionHeader.js +13 -17
- package/dist/components/Accordion/AccordionPanel.js +7 -11
- package/dist/components/Accordion/AccordionSection.js +14 -11
- package/dist/components/Banner/Banner.js +10 -11
- package/dist/components/Banner/BannerBody.js +1 -3
- package/dist/components/Banner/BannerFooter.js +1 -3
- package/dist/components/Banner/BannerTitle.js +1 -3
- package/dist/components/BreakpointSwitch/Breakpoint.js +2 -5
- package/dist/components/BreakpointSwitch/BreakpointContext.js +3 -4
- package/dist/components/BreakpointSwitch/BreakpointSwitch.js +1 -3
- package/dist/components/Button/Button.js +3 -3
- package/dist/components/Button/Button2.js +19 -13
- package/dist/components/ButtonGroup/ButtonGroup.js +7 -7
- package/dist/components/ButtonGroup/ButtonGroup2.js +3 -3
- package/dist/components/Checkbox/Check.js +8 -6
- package/dist/components/Checkbox/Checkbox.js +31 -28
- package/dist/components/Checkbox/Checkbox2.js +3 -3
- package/dist/components/Checkbox/CheckboxField.js +14 -13
- package/dist/components/ColorPicker/Alpha.js +8 -12
- package/dist/components/ColorPicker/ColorPicker.js +67 -48
- package/dist/components/ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/ColorPicker/ColorPickerFlyout.js +23 -24
- package/dist/components/ColorPicker/ColorPickerFlyoutInputs.js +27 -22
- package/dist/components/ColorPicker/ColorPickerWIthNoColor.js +11 -7
- package/dist/components/ColorPicker/Hue.js +9 -13
- package/dist/components/ColorPicker/Palette.js +23 -21
- package/dist/components/ColorPicker/Saturation.js +11 -15
- package/dist/components/ColorPicker/utils/hexToHsv.js +4 -5
- package/dist/components/ColorPicker/utils/hsvToHex.js +3 -5
- package/dist/components/ColorPicker/utils/rgbToHex.js +3 -5
- package/dist/components/Combobox/Combobox.js +166 -133
- package/dist/components/Combobox/Combobox2.js +3 -3
- package/dist/components/Combobox/ComboboxContext.js +3 -4
- package/dist/components/Combobox/ComboboxHeader.js +6 -6
- package/dist/components/Combobox/ComboboxIcon.js +14 -14
- package/dist/components/Combobox/ComboboxInput.js +41 -43
- package/dist/components/Combobox/ComboboxList.js +20 -20
- package/dist/components/Combobox/ComboboxOption.js +9 -10
- package/dist/components/ConfigPane/ConfigPane.js +53 -37
- package/dist/components/ConfigPane/ConfigPane2.js +3 -3
- package/dist/components/Divider/Divider.js +4 -4
- package/dist/components/Divider/Divider2.js +3 -3
- package/dist/components/Dropdown/ChildIndexContext/index.js +7 -9
- package/dist/components/Dropdown/ChildIndexContext/reach-descendants.js +18 -21
- package/dist/components/Dropdown/Dropdown.js +68 -43
- package/dist/components/Dropdown/Dropdown2.js +3 -3
- package/dist/components/Dropdown/DropdownButton.js +53 -47
- package/dist/components/Dropdown/DropdownContext.js +3 -4
- package/dist/components/Dropdown/DropdownHeader.js +12 -9
- package/dist/components/Dropdown/DropdownHeaderContext.js +3 -4
- package/dist/components/Dropdown/DropdownList.js +32 -32
- package/dist/components/Dropdown/DropdownOption.js +32 -30
- package/dist/components/Dropdown/DropdownSearch.js +12 -14
- package/dist/components/FilePicker/FilePicker.js +30 -25
- package/dist/components/FilePicker/FilePicker2.js +3 -3
- package/dist/components/FormField/Caption.js +3 -3
- package/dist/components/FormField/ErrorText.js +5 -5
- package/dist/components/FormField/FormField.js +27 -14
- package/dist/components/FormField/FormField2.js +3 -3
- package/dist/components/FormField/FormFieldContext.js +6 -13
- package/dist/components/FormField/HelperText.js +5 -5
- package/dist/components/FormField/ReadOnlyText.js +4 -6
- package/dist/components/FullScreenTakeover/FullScreenTakeover.js +22 -15
- package/dist/components/FullScreenTakeover/FullScreenTakeover2.js +3 -3
- package/dist/components/Icon/Icon.js +6 -5
- package/dist/components/Icon/IconTypes.js +1 -0
- package/dist/components/IconButton/IconButton.js +25 -16
- package/dist/components/IconButton/IconButton2.js +3 -3
- package/dist/components/InlineInput/InlineInput.js +25 -14
- package/dist/components/InlineInput/InlineInput2.js +3 -3
- package/dist/components/Input/Input.js +42 -29
- package/dist/components/Input/Input2.js +3 -3
- package/dist/components/Input/InputField.js +26 -21
- package/dist/components/InputGroup/InputGroup.js +7 -7
- package/dist/components/InputGroup/InputGroup2.js +3 -3
- package/dist/components/InputGroup/InputGroupAddon.js +7 -6
- package/dist/components/InputGroup/InputGroupProvider.js +5 -8
- package/dist/components/Label/Label.js +8 -9
- package/dist/components/Label/Label2.js +3 -3
- package/dist/components/Link/Link.js +9 -7
- package/dist/components/Link/Link2.js +3 -3
- package/dist/components/LoadingSpinner/LoadingSpinner.js +22 -17
- package/dist/components/LoadingSpinner/LoadingSpinner2.js +3 -3
- package/dist/components/LogicEditor/ConditionContainer.js +8 -10
- package/dist/components/LogicEditor/ConditionSet.js +16 -21
- package/dist/components/LogicEditor/Controls.js +17 -20
- package/dist/components/LogicEditor/LogicEditor.js +33 -24
- package/dist/components/LogicEditor/LogicEditor2.js +3 -3
- package/dist/components/LogicEditor/LogicEditorContext.js +3 -4
- package/dist/components/LogicEditor/utils.js +5 -9
- package/dist/components/Modal/Modal.js +63 -49
- package/dist/components/Modal/Modal2.js +3 -3
- package/dist/components/Modal/ModalBody.js +5 -5
- package/dist/components/Modal/ModalContext.js +3 -4
- package/dist/components/Modal/ModalFooter.js +5 -5
- package/dist/components/Modal/ModalHeader.js +10 -12
- package/dist/components/NewMenu/BaseMenu.js +83 -54
- package/dist/components/NewMenu/Menu/Menu.js +10 -12
- package/dist/components/NewMenu/NewMenu.js +3 -3
- package/dist/components/NewMenu/SelectMenu/SelectMenu.js +6 -7
- package/dist/components/NewMenu/parts/ArrowNav/ArrowNav.js +35 -30
- package/dist/components/NewMenu/parts/MenuAnchor.js +15 -16
- package/dist/components/NewMenu/parts/MenuContext.js +3 -4
- package/dist/components/NewMenu/parts/MenuItem.js +23 -17
- package/dist/components/NewMenu/parts/MenuSearchBox.js +4 -6
- package/dist/components/NewMenu/parts/SubmenuAnchor.js +5 -5
- package/dist/components/NumberStepper/NumberStepper.js +42 -37
- package/dist/components/NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/NumberStepper/NumberStepperContext.js +3 -4
- package/dist/components/NumberStepper/NumberStepperDecrement.js +13 -15
- package/dist/components/NumberStepper/NumberStepperIncrement.js +13 -15
- package/dist/components/NumberStepper/NumberStepperInput.js +28 -30
- package/dist/components/PageLayout/MainContent.js +4 -4
- package/dist/components/PageLayout/PageContainer.js +4 -4
- package/dist/components/PageLayout/PageHeader.js +4 -4
- package/dist/components/PageLayout/PageLayout.js +3 -3
- package/dist/components/Pagination/Pagination.js +20 -16
- package/dist/components/Pagination/Pagination2.js +3 -3
- package/dist/components/Pagination/PaginationContext.js +3 -4
- package/dist/components/Pagination/PaginationNextButton.js +15 -17
- package/dist/components/Pagination/PaginationPageInput.js +24 -24
- package/dist/components/Pagination/PaginationPreviousButton.js +14 -16
- package/dist/components/Popover/Popover.js +27 -18
- package/dist/components/Popover/Popover2.js +3 -3
- package/dist/components/QuickSearch/QuickSearch.js +23 -16
- package/dist/components/QuickSearch/QuickSearch2.js +3 -3
- package/dist/components/QuickSearch/QuickSearchInput.js +33 -23
- package/dist/components/Radio/Radio.js +26 -28
- package/dist/components/Radio/Radio2.js +3 -3
- package/dist/components/Radio/RadioGroup.js +15 -16
- package/dist/components/Radio/RadioGroupContext.js +3 -4
- package/dist/components/Radio/RadioOption.js +11 -10
- package/dist/components/SearchInput/SearchInput.js +32 -25
- package/dist/components/SearchInput/SearchInput2.js +3 -3
- package/dist/components/SidebarNav/ExpandCollapseButton.js +4 -6
- package/dist/components/SidebarNav/SidebarNav.js +19 -13
- package/dist/components/SidebarNav/SidebarNav2.js +3 -3
- package/dist/components/SidebarNav/SidebarNavContext.js +3 -4
- package/dist/components/SidebarNav/SidebarNavLink.js +7 -10
- package/dist/components/Slider/RangeSlider.js +36 -24
- package/dist/components/Slider/Slider.js +29 -20
- package/dist/components/Slider/Slider2.js +3 -3
- package/dist/components/Slider/SliderButton.js +26 -17
- package/dist/components/Switch/Switch.js +19 -19
- package/dist/components/Switch/Switch2.js +3 -3
- package/dist/components/Switch/SwitchField.js +13 -13
- package/dist/components/Table/Table.js +5 -5
- package/dist/components/Table/Table2.js +3 -3
- package/dist/components/Table/TableBody.js +5 -5
- package/dist/components/Table/TableCell.js +5 -5
- package/dist/components/Table/TableHead.js +5 -5
- package/dist/components/Table/TableHeaderCell.js +5 -5
- package/dist/components/Table/TableRow.js +5 -5
- package/dist/components/Tabs/Tab.js +12 -13
- package/dist/components/Tabs/TabContextProvider.js +10 -13
- package/dist/components/Tabs/TabList.js +17 -13
- package/dist/components/Tabs/TabPanel.js +10 -11
- package/dist/components/Tabs/TabPanels.js +1 -3
- package/dist/components/Tabs/Tabs.js +20 -12
- package/dist/components/Tabs/Tabs2.js +3 -3
- package/dist/components/Tooltip/Tooltip.js +51 -29
- package/dist/components/Tooltip/Tooltip2.js +3 -3
- package/dist/components/UIProvider/A11yHelpersContext.js +3 -9
- package/dist/components/UIProvider/PortalTargetContext.js +6 -8
- package/dist/components/UIProvider/UIProvider.js +4 -5
- package/dist/components/deprecated_ColorPicker/Alpha.js +7 -7
- package/dist/components/deprecated_ColorPicker/ColorPicker.js +24 -13
- package/dist/components/deprecated_ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/deprecated_ColorPicker/HexInput.js +16 -9
- package/dist/components/deprecated_ColorPicker/Hue.js +6 -6
- package/dist/components/deprecated_ColorPicker/Saturation.js +14 -16
- package/dist/components/deprecated_ColorPicker/Swatch.js +7 -6
- package/dist/components/deprecated_ColorPicker/useMouseDrag.js +5 -1
- package/dist/components/deprecated_NumberStepper/NumberStepper.js +34 -25
- package/dist/components/deprecated_NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/deprecated_NumberStepper/NumberStepperContext.js +3 -4
- package/dist/components/deprecated_NumberStepper/NumberStepperDecrement.js +14 -16
- package/dist/components/deprecated_NumberStepper/NumberStepperIncrement.js +14 -16
- package/dist/components/deprecated_NumberStepper/NumberStepperInput.js +32 -34
- package/dist/components/deprecated_Tabs/Tab.js +8 -9
- package/dist/components/deprecated_Tabs/TabContextProvider.js +3 -4
- package/dist/components/deprecated_Tabs/Tabs.js +13 -9
- package/dist/components/deprecated_Tabs/Tabs2.js +3 -3
- package/dist/components/deprecated_Toolbar/IconButtonWithLabel.js +6 -6
- package/dist/components/deprecated_Toolbar/Toolbar.js +16 -11
- package/dist/components/deprecated_Toolbar/Toolbar2.js +3 -3
- package/dist/components/deprecated_Toolbar/ToolbarContext.js +3 -4
- package/dist/components/deprecated_Toolbar/ToolbarPanel.js +16 -16
- package/dist/components/deprecated_Toolbar/ToolbarPanels.js +44 -29
- package/dist/components/deprecated_Toolbar/ToolbarTab.js +19 -20
- package/dist/components/deprecated_Toolbar/ToolbarTabs.js +34 -24
- package/dist/design-tokens/less/typography.js +3 -3
- package/dist/hooks/useBreakpoints/useBreakpoints.js +12 -4
- package/dist/hooks/useClickOutside/useClickOutside.js +1 -3
- package/dist/hooks/useClickOutsidePortals/useClickOutsidePortals.js +3 -3
- package/dist/hooks/useControllableState/useControllableState.js +5 -2
- package/dist/hooks/useEventListener/useEventListener.js +6 -5
- package/dist/hooks/useFocusSequence/useFocusSequence.js +12 -12
- package/dist/hooks/useId/useId.js +4 -1
- package/dist/hooks/useIsFocused/useIsFocused.js +5 -1
- package/dist/hooks/useIsHovered/useIsHovered.js +5 -1
- package/dist/hooks/useIsTruncated/useIsTruncated.js +11 -16
- package/dist/hooks/useMouseDrag/useMouseDrag.js +5 -1
- package/dist/hooks/useOverlay/useOverlay.js +10 -10
- package/dist/hooks/useOverlay/useOverlay2.js +3 -3
- package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement.js +9 -2
- package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement2.js +3 -3
- package/dist/icons/Icon.js +3 -3
- package/dist/icons/components/FrontlineEmployeeVoiceIcon.js +6 -0
- package/dist/icons/createIconComponent.js +7 -6
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/index.es.js +1 -0
- package/dist/icons/index.js +3 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +1 -1
- package/dist/index.js +7 -3
- package/dist/next/AdvancedTable/AdvancedTable.js +192 -173
- package/dist/next/AdvancedTable/AdvancedTable2.js +3 -3
- package/dist/next/AdvancedTable/AdvancedTableCell.js +30 -25
- package/dist/next/AdvancedTable/AdvancedTableCheckbox.js +12 -15
- package/dist/next/AdvancedTable/AdvancedTableColumnHeader.js +83 -65
- package/dist/next/AdvancedTable/AdvancedTableColumnHeaderMenu.js +25 -30
- package/dist/next/AdvancedTable/AdvancedTableColumnHeaders.js +10 -9
- package/dist/next/AdvancedTable/AdvancedTableDnDContext.js +12 -10
- package/dist/next/AdvancedTable/AdvancedTableDragPreview.js +4 -7
- package/dist/next/AdvancedTable/AdvancedTableHiddenDescription.js +4 -7
- package/dist/next/AdvancedTable/AdvancedTablePagination.js +9 -13
- package/dist/next/AdvancedTable/AdvancedTableRow.js +16 -16
- package/dist/next/AdvancedTable/AdvancedTableRowExpandButton.js +7 -11
- package/dist/next/AdvancedTable/useAdvancedTableDragAndDrop.js +32 -36
- package/dist/next/AdvancedTable/useDragAndDropConfig.js +44 -53
- package/dist/next/Chat/Chat.js +5 -6
- package/dist/next/Chat/ChatContext.js +3 -4
- package/dist/next/Chat/ChatInput.js +24 -20
- package/dist/next/Chat/ChatMessage.js +16 -20
- package/dist/next/Chat/ChatMessageList.js +11 -10
- package/dist/next/Chat/ChatMessageText.js +1 -3
- package/dist/next/Chat/Loader.js +6 -9
- package/dist/next/Chat/MessageContext.js +3 -4
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInput.js +28 -18
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInput2.js +3 -3
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInputIconButton.js +8 -8
- package/dist/next/CollectionGrid/CollectionGrid.js +14 -12
- package/dist/next/CollectionGrid/CollectionGridItem.js +4 -5
- package/dist/next/Combobox/Combobox.js +48 -37
- package/dist/next/Combobox/Combobox2.js +3 -3
- package/dist/next/Combobox/ComboboxContext.js +3 -4
- package/dist/next/Combobox/ComboboxFlyout.js +12 -15
- package/dist/next/Combobox/ComboboxGroup.js +10 -14
- package/dist/next/Combobox/ComboboxGroupContext.js +9 -10
- package/dist/next/Combobox/ComboboxInput.js +37 -39
- package/dist/next/Combobox/ComboboxOption.js +15 -19
- package/dist/next/Combobox/hooks/useComboboxFocusSequence/useComboboxFocusSequence.js +9 -4
- package/dist/next/Combobox/hooks/useComboboxLoadingState/useComboboxLoadingState.js +2 -3
- package/dist/next/Combobox/hooks/useComboboxValue/useComboboxValue.js +10 -5
- package/dist/next/Combobox/hooks/useListboxFlyoutDimensions/useListboxFlyoutDimensions.js +12 -5
- package/dist/next/Combobox/hooks/useShouldRenderGroupHeader/useShouldRenderGroupHeader.js +5 -1
- package/dist/next/Drawer/Drawer.js +38 -23
- package/dist/next/Drawer/Drawer2.js +3 -3
- package/dist/next/FilterAnchor/FilterAnchor.js +21 -19
- package/dist/next/FilterAnchor/FilterAnchor2.js +3 -3
- package/dist/next/Form/FormFields/FormFieldWrapper.js +11 -11
- package/dist/next/Form/FormFields/InputField.js +3 -3
- package/dist/next/Form/useForm.js +25 -30
- package/dist/next/Form/useFormField.js +3 -4
- package/dist/next/Form/utils/createFormInstance.js +7 -9
- package/dist/next/Form/utils/useFormContext.js +3 -4
- package/dist/next/Indicator/Indicator.js +12 -8
- package/dist/next/Indicator/Indicator2.js +3 -3
- package/dist/next/Input/Input.js +49 -35
- package/dist/next/Input/Input2.js +3 -3
- package/dist/next/LayoutGrid/LayoutGrid.js +11 -12
- package/dist/next/LayoutGrid/LayoutGridItem.js +5 -6
- package/dist/next/LoadingSpinner/LoadingSpinner.js +22 -17
- package/dist/next/LoadingSpinner/LoadingSpinner2.js +3 -3
- package/dist/next/Menu/Hooks/useFocusVirtualBoundary.js +7 -4
- package/dist/next/Menu/Hooks/useMaskDimensions.js +6 -7
- package/dist/next/Menu/Hooks/usePaneSearch.js +50 -39
- package/dist/next/Menu/Menu.js +28 -15
- package/dist/next/Menu/Menu2.js +3 -3
- package/dist/next/Menu/MenuButton.js +17 -18
- package/dist/next/Menu/MenuContext.js +13 -18
- package/dist/next/Menu/MenuItem.js +28 -29
- package/dist/next/Menu/MenuPane.js +74 -61
- package/dist/next/Menu/MenuSearch.js +10 -10
- package/dist/next/Menu/PaneChildren.js +10 -15
- package/dist/next/Menu/SubMenu.js +91 -76
- package/dist/next/Pagination/Pagination.js +40 -31
- package/dist/next/Pagination/RowDisplayCount.js +6 -7
- package/dist/next/PhoneNumberInput/PhoneNumberInput.js +49 -47
- package/dist/next/PhoneNumberInput/PhoneNumberInput2.js +3 -3
- package/dist/next/Select/Select.js +27 -30
- package/dist/next/Select/Select2.js +3 -3
- package/dist/next/Select/SelectButton.js +16 -15
- package/dist/next/Select/SelectContext.js +3 -4
- package/dist/next/Select/SelectItem.js +12 -13
- package/dist/next/Select/SelectPane.js +13 -14
- package/dist/next/Select/SelectedItems.js +16 -10
- package/dist/next/Select/SubSelect.js +21 -18
- package/dist/next/SplitButton/SplitButton.js +28 -21
- package/dist/next/SplitButton/SplitButton2.js +3 -3
- package/dist/next/SplitButton/SplitButtonOption.js +3 -5
- package/dist/next/Stack/Stack.js +26 -26
- package/dist/next/Stack/StackItem.js +12 -14
- package/dist/next/TimePicker/TimeDropdown.js +18 -18
- package/dist/next/TimePicker/TimeInput.js +38 -42
- package/dist/next/TimePicker/TimePicker.js +46 -25
- package/dist/next/TimePicker/TimePicker2.js +3 -3
- package/dist/next/TimePicker/TimePickerIcon.js +5 -7
- package/dist/next/TimePicker/utils.js +34 -13
- package/dist/next/ToggleButton/ToggleButton.js +14 -13
- package/dist/next/ToggleButton/ToggleButtonGroup.js +8 -10
- package/dist/next/ToggleButton/ToggleButtonGroupContext.js +3 -4
- package/dist/next/ToggleButton/styles.js +3 -3
- package/dist/next/Tooltip/Tooltip.js +5 -4
- package/dist/next/Typography/Typography.js +8 -7
- package/dist/next/index.js +2377 -2193
- package/dist/utils/Flyout/Flyout.js +14 -13
- package/dist/utils/Flyout/Flyout2.js +3 -3
- package/dist/utils/Flyout/FlyoutHeader.js +6 -6
- package/dist/utils/Flyout/FlyoutOption.js +11 -8
- package/dist/utils/GridChildrenWrapper/GridChildrenWrapper.js +4 -6
- package/dist/utils/Popper/Popper.js +71 -61
- package/dist/utils/Popper/PopperContext.js +5 -6
- package/dist/utils/Portal/Portal.js +7 -5
- package/dist/utils/Text/Text.js +10 -8
- package/dist/utils/TextOverflowTooltip/TextOverflowTooltip.js +10 -6
- package/dist/utils/Translation/Translate.js +4 -7
- package/dist/utils/Translation/TranslationProvider.js +10 -14
- package/dist/utils/Translation/containsComponentOrElement.js +3 -1
- package/dist/utils/Translation/useTranslation.js +2 -3
- package/dist/utils/VirtuosoTestWrapper/VirtuosoTestWrapper.js +1 -3
- package/dist/utils/filterChildren/filterChildren.js +4 -4
- package/icons/package.json +1 -1
- package/next/package.json +2 -2
- package/package.json +4 -4
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
1
2
|
import { useState } from 'react';
|
|
2
3
|
import { useSensors, useSensor, MouseSensor, pointerWithin, getClientRect, MeasuringStrategy, MeasuringFrequency } from '@dnd-kit/core';
|
|
3
4
|
import { restrictToWindowEdges } from '@dnd-kit/modifiers';
|
|
@@ -6,17 +7,19 @@ import useLatest from '../../hooks/useLatest/useLatest.js';
|
|
|
6
7
|
|
|
7
8
|
const useDragAndDropConfig = (setDragSource, setDropTarget, setDropTargetSide, setPinnedColumns, setColumnOrder, setIsDragging, dropTargetSide) => {
|
|
8
9
|
const dropTargetSideRef = useLatest(dropTargetSide);
|
|
9
|
-
const
|
|
10
|
+
const _useState = useState(0),
|
|
11
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
12
|
+
initSourcePos = _useState2[0],
|
|
13
|
+
setInitSourcePos = _useState2[1];
|
|
10
14
|
const dragAndDropMonitorConfig = {
|
|
11
15
|
onDragStart: event => {
|
|
12
16
|
var _event$active$data$cu, _event$active;
|
|
13
17
|
setDragSource((_event$active$data$cu = event.active.data.current) === null || _event$active$data$cu === void 0 ? void 0 : _event$active$data$cu.id);
|
|
14
18
|
setIsDragging(true);
|
|
15
|
-
const {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
x
|
|
19
|
-
};
|
|
19
|
+
const _ref = ((_event$active = event.active) === null || _event$active === void 0 || (_event$active = _event$active.data.current) === null || _event$active === void 0 || (_event$active = _event$active.columnHeaderRef) === null || _event$active === void 0 || (_event$active = _event$active.current) === null || _event$active === void 0 ? void 0 : _event$active.getBoundingClientRect()) || {
|
|
20
|
+
x: 0
|
|
21
|
+
},
|
|
22
|
+
x = _ref.x;
|
|
20
23
|
setInitSourcePos(x);
|
|
21
24
|
},
|
|
22
25
|
onDragCancel: () => {
|
|
@@ -30,21 +33,17 @@ const useDragAndDropConfig = (setDragSource, setDropTarget, setDropTargetSide, s
|
|
|
30
33
|
setDropTarget('');
|
|
31
34
|
setDropTargetSide(undefined);
|
|
32
35
|
setIsDragging(false);
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
over
|
|
36
|
-
} = event;
|
|
36
|
+
const active = event.active,
|
|
37
|
+
over = event.over;
|
|
37
38
|
if (!over) return;
|
|
38
|
-
const
|
|
39
|
-
id
|
|
40
|
-
columnIndex
|
|
41
|
-
isPinned
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
isPinned
|
|
47
|
-
} = over.data.current;
|
|
39
|
+
const _ref2 = active.data.current,
|
|
40
|
+
dragSourceId = _ref2.id,
|
|
41
|
+
dragSourceColumnIndex = _ref2.columnIndex,
|
|
42
|
+
dragSourceIsPinned = _ref2.isPinned;
|
|
43
|
+
const _ref3 = over.data.current,
|
|
44
|
+
id = _ref3.id,
|
|
45
|
+
columnIndex = _ref3.columnIndex,
|
|
46
|
+
isPinned = _ref3.isPinned;
|
|
48
47
|
if (id === dragSourceId || dropTargetSideRef.current === undefined) {
|
|
49
48
|
return;
|
|
50
49
|
}
|
|
@@ -96,25 +95,21 @@ const useDragAndDropConfig = (setDragSource, setDropTarget, setDropTargetSide, s
|
|
|
96
95
|
},
|
|
97
96
|
onDragMove: event => {
|
|
98
97
|
var _columnHeaderRef$curr, _DragSourceRef$curren;
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
delta
|
|
104
|
-
} = event;
|
|
98
|
+
const active = event.active,
|
|
99
|
+
over = event.over,
|
|
100
|
+
activatorEvent = event.activatorEvent,
|
|
101
|
+
delta = event.delta;
|
|
105
102
|
if (!over) return;
|
|
106
|
-
const
|
|
107
|
-
id
|
|
108
|
-
columnIndex
|
|
109
|
-
isPinned
|
|
110
|
-
columnHeaderRef
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
columnHeaderRef
|
|
117
|
-
} = over.data.current;
|
|
103
|
+
const _ref4 = active.data.current,
|
|
104
|
+
dragSourceId = _ref4.id,
|
|
105
|
+
dragSourceColumnIndex = _ref4.columnIndex,
|
|
106
|
+
dragSourceIsPinned = _ref4.isPinned,
|
|
107
|
+
DragSourceRef = _ref4.columnHeaderRef;
|
|
108
|
+
const _ref5 = over.data.current,
|
|
109
|
+
id = _ref5.id,
|
|
110
|
+
columnIndex = _ref5.columnIndex,
|
|
111
|
+
isPinned = _ref5.isPinned,
|
|
112
|
+
columnHeaderRef = _ref5.columnHeaderRef;
|
|
118
113
|
setDropTarget(id);
|
|
119
114
|
if (id === dragSourceId) {
|
|
120
115
|
setDropTargetSide(undefined);
|
|
@@ -122,24 +117,20 @@ const useDragAndDropConfig = (setDragSource, setDropTarget, setDropTargetSide, s
|
|
|
122
117
|
}
|
|
123
118
|
|
|
124
119
|
// Calculate which column line is closest
|
|
125
|
-
const {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
x
|
|
130
|
-
width
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
x: 0
|
|
136
|
-
};
|
|
120
|
+
const _ref6 = (columnHeaderRef === null || columnHeaderRef === void 0 || (_columnHeaderRef$curr = columnHeaderRef.current) === null || _columnHeaderRef$curr === void 0 ? void 0 : _columnHeaderRef$curr.getBoundingClientRect()) || {
|
|
121
|
+
x: 0,
|
|
122
|
+
width: 0
|
|
123
|
+
},
|
|
124
|
+
targetX = _ref6.x,
|
|
125
|
+
targetWidth = _ref6.width;
|
|
126
|
+
const _ref7 = (DragSourceRef === null || DragSourceRef === void 0 || (_DragSourceRef$curren = DragSourceRef.current) === null || _DragSourceRef$curren === void 0 ? void 0 : _DragSourceRef$curren.getBoundingClientRect()) || {
|
|
127
|
+
x: 0
|
|
128
|
+
},
|
|
129
|
+
sourceX = _ref7.x;
|
|
137
130
|
|
|
138
131
|
// Getting scroll position based on initial and current position
|
|
139
132
|
const scrollOffset = sourceX - initSourcePos;
|
|
140
|
-
const
|
|
141
|
-
clientX: startPosition
|
|
142
|
-
} = activatorEvent;
|
|
133
|
+
const startPosition = activatorEvent.clientX;
|
|
143
134
|
const dropX = startPosition + delta.x;
|
|
144
135
|
const diffLeft = Math.abs(dropX - targetX + scrollOffset) || 0;
|
|
145
136
|
const diffRight = Math.abs(dropX - (targetX + targetWidth) + scrollOffset) || 0;
|
package/dist/next/Chat/Chat.js
CHANGED
|
@@ -3,12 +3,11 @@ import __default__ from './Chat.css.js';
|
|
|
3
3
|
import { ChatProvider } from './ChatContext.js';
|
|
4
4
|
|
|
5
5
|
const Chat = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
6
|
-
let
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
isLoading = false,
|
|
10
|
-
'data-testid'
|
|
11
|
-
} = _ref;
|
|
6
|
+
let children = _ref.children,
|
|
7
|
+
externalOnMessageCancel = _ref.onMessageCancel,
|
|
8
|
+
_ref$isLoading = _ref.isLoading,
|
|
9
|
+
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
10
|
+
dataTestId = _ref['data-testid'];
|
|
12
11
|
const chatInputRef = useRef(null);
|
|
13
12
|
const onMessageCancel = () => {
|
|
14
13
|
var _chatInputRef$current;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import '../../utils/index.js';
|
|
2
2
|
import createContextUtilities from '../../utils/createContextUtilities/createContextUtilities.js';
|
|
3
3
|
|
|
4
|
-
const
|
|
5
|
-
Provider
|
|
6
|
-
useContext
|
|
7
|
-
} = createContextUtilities();
|
|
4
|
+
const _createContextUtiliti = createContextUtilities(),
|
|
5
|
+
ChatProvider = _createContextUtiliti.Provider,
|
|
6
|
+
useChatContext = _createContextUtiliti.useContext;
|
|
8
7
|
|
|
9
8
|
export { ChatProvider, useChatContext };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
1
2
|
import React__default, { forwardRef, useState, useMemo } from 'react';
|
|
2
3
|
import '../../components/index.js';
|
|
3
4
|
import '../../icons/index.es.js';
|
|
@@ -19,22 +20,26 @@ import ErrorText from '../../components/FormField/ErrorText.js';
|
|
|
19
20
|
import HelperText from '../../components/FormField/HelperText.js';
|
|
20
21
|
|
|
21
22
|
const ChatInput = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
22
|
-
let
|
|
23
|
-
|
|
24
|
-
isDisabled = false,
|
|
25
|
-
value
|
|
26
|
-
onChange
|
|
27
|
-
'data-testid'
|
|
28
|
-
placeholderText,
|
|
29
|
-
id,
|
|
30
|
-
characterLimit
|
|
31
|
-
helperText
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
23
|
+
let onMessageSend = _ref.onMessageSend,
|
|
24
|
+
_ref$isDisabled = _ref.isDisabled,
|
|
25
|
+
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
26
|
+
externalValue = _ref.value,
|
|
27
|
+
externalOnChange = _ref.onChange,
|
|
28
|
+
dataTestId = _ref['data-testid'],
|
|
29
|
+
placeholderText = _ref.placeholderText,
|
|
30
|
+
id = _ref.id,
|
|
31
|
+
externalCharacterLimit = _ref.characterLimit,
|
|
32
|
+
helperText = _ref.helperText;
|
|
33
|
+
const _useState = useState(false),
|
|
34
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
35
|
+
isMaxCharactersExceeded = _useState2[0],
|
|
36
|
+
setIsMaxCharactersExceeded = _useState2[1];
|
|
37
|
+
const _useTranslation = useTranslation(),
|
|
38
|
+
translate = _useTranslation.translate;
|
|
39
|
+
const _useControllableState = useControllableState('', externalOnChange, externalValue),
|
|
40
|
+
_useControllableState2 = _slicedToArray(_useControllableState, 2),
|
|
41
|
+
value = _useControllableState2[0],
|
|
42
|
+
setValue = _useControllableState2[1];
|
|
38
43
|
const characterLimit = useMemo(() => {
|
|
39
44
|
if (externalCharacterLimit && externalCharacterLimit > 0) {
|
|
40
45
|
return externalCharacterLimit;
|
|
@@ -48,10 +53,9 @@ const ChatInput = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
48
53
|
const newValue = e.target.value;
|
|
49
54
|
setValue(newValue);
|
|
50
55
|
});
|
|
51
|
-
const
|
|
52
|
-
isLoading,
|
|
53
|
-
chatInputRef
|
|
54
|
-
} = useChatContext();
|
|
56
|
+
const _useChatContext = useChatContext(),
|
|
57
|
+
isLoading = _useChatContext.isLoading,
|
|
58
|
+
chatInputRef = _useChatContext.chatInputRef;
|
|
55
59
|
const chatInputID = useId(id);
|
|
56
60
|
const sendMessageAndClearInput = () => {
|
|
57
61
|
if (!value || isDisabled || isLoading || isMaxCharactersExceeded) return;
|
|
@@ -22,17 +22,15 @@ const StyledErrorIcon = () => /*#__PURE__*/React__default.createElement(ErrorIco
|
|
|
22
22
|
});
|
|
23
23
|
const ChatMessage = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
24
24
|
var _messageContentRef$cu;
|
|
25
|
-
let
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
messageLevel
|
|
29
|
-
'data-testid'
|
|
30
|
-
accessibleText,
|
|
31
|
-
accessibleHeader
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
translate
|
|
35
|
-
} = useTranslation();
|
|
25
|
+
let children = _ref.children,
|
|
26
|
+
variant = _ref.variant,
|
|
27
|
+
_ref$messageLevel = _ref.messageLevel,
|
|
28
|
+
messageLevel$1 = _ref$messageLevel === void 0 ? 'default' : _ref$messageLevel,
|
|
29
|
+
dataTestId = _ref['data-testid'],
|
|
30
|
+
accessibleText = _ref.accessibleText,
|
|
31
|
+
accessibleHeader = _ref.accessibleHeader;
|
|
32
|
+
const _useTranslation = useTranslation(),
|
|
33
|
+
translate = _useTranslation.translate;
|
|
36
34
|
const getMessageComponents = () => {
|
|
37
35
|
const messageComponentsMap = {
|
|
38
36
|
bot: {
|
|
@@ -67,15 +65,13 @@ const ChatMessage = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
67
65
|
return messageComponentsMap[variant][messageLevel$1];
|
|
68
66
|
};
|
|
69
67
|
const messageContentRef = useRef(null);
|
|
70
|
-
const
|
|
71
|
-
isFocusVisible
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
handleKeyDown
|
|
78
|
-
} = useMessageContext();
|
|
68
|
+
const _useIsFocusVisible = useIsFocusVisible(),
|
|
69
|
+
isFocusVisible = _useIsFocusVisible.isFocusVisible;
|
|
70
|
+
const _useMessageContext = useMessageContext(),
|
|
71
|
+
messagesRef = _useMessageContext.messagesRef,
|
|
72
|
+
messageIndex = _useMessageContext.messageIndex,
|
|
73
|
+
isFocused = _useMessageContext.isFocused,
|
|
74
|
+
handleKeyDown = _useMessageContext.handleKeyDown;
|
|
79
75
|
const registerMessage = node => {
|
|
80
76
|
messagesRef.current[messageIndex] = node;
|
|
81
77
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
1
2
|
import React__default, { forwardRef, useRef, Children } from 'react';
|
|
2
3
|
import { wrapper, scrollableRegion, messageList } from './ChatMessageList.css.js';
|
|
3
4
|
import { MessageProvider } from './MessageContext.js';
|
|
@@ -9,20 +10,20 @@ import { useDidUpdate } from '../../hooks/useDidUpdate/useDidUpdate.js';
|
|
|
9
10
|
|
|
10
11
|
const ChatMessageList = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
11
12
|
var _messagesRef$current;
|
|
12
|
-
let
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
let children = _ref.children,
|
|
14
|
+
externalFocusedMessageIndex = _ref.focusedMessageIndex,
|
|
15
|
+
onFocusedMessageIndexChange = _ref.onFocusedMessageIndexChange,
|
|
16
|
+
dataTestId = _ref['data-testid'];
|
|
17
|
+
const _useControllableState = useControllableState(0, onFocusedMessageIndexChange, externalFocusedMessageIndex),
|
|
18
|
+
_useControllableState2 = _slicedToArray(_useControllableState, 2),
|
|
19
|
+
focusedMessageIndex = _useControllableState2[0],
|
|
20
|
+
setFocusedMessageIndex = _useControllableState2[1];
|
|
19
21
|
const scrollableRegionRef = useRef(null);
|
|
20
22
|
// Using an object instead of array because an array would need to be resized whenever messages are added
|
|
21
23
|
const messagesRef = useRef({});
|
|
22
24
|
const loaderRef = useRef(null);
|
|
23
|
-
const
|
|
24
|
-
isLoading
|
|
25
|
-
} = useChatContext();
|
|
25
|
+
const _useChatContext = useChatContext(),
|
|
26
|
+
isLoading = _useChatContext.isLoading;
|
|
26
27
|
const currentNumMessages = React__default.Children.count(children);
|
|
27
28
|
const prevNumMessages = Object.keys((_messagesRef$current = messagesRef.current) !== null && _messagesRef$current !== void 0 ? _messagesRef$current : {}).length;
|
|
28
29
|
const prevLastElement = prevNumMessages > 0 ? messagesRef.current[prevNumMessages - 1] : null;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React__default, { forwardRef, Fragment } from 'react';
|
|
2
2
|
|
|
3
3
|
const ChatMessageText = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
4
|
-
let
|
|
5
|
-
text
|
|
6
|
-
} = _ref;
|
|
4
|
+
let text = _ref.text;
|
|
7
5
|
/* eslint-disable react/no-array-index-key */
|
|
8
6
|
const formattedText = text.split('\n').map((line, index) => /*#__PURE__*/React__default.createElement(Fragment, {
|
|
9
7
|
key: index
|
package/dist/next/Chat/Loader.js
CHANGED
|
@@ -37,9 +37,8 @@ const FullPulsingSpinner = () => /*#__PURE__*/React__default.createElement(AIEnt
|
|
|
37
37
|
className: fullPulsingSpinner
|
|
38
38
|
});
|
|
39
39
|
const CombinedSpinner = () => {
|
|
40
|
-
const
|
|
41
|
-
translate
|
|
42
|
-
} = useTranslation();
|
|
40
|
+
const _useTranslation = useTranslation(),
|
|
41
|
+
translate = _useTranslation.translate;
|
|
43
42
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
44
43
|
className: combinedSpinner,
|
|
45
44
|
"aria-label": translate('chat.loaderLabel'),
|
|
@@ -47,12 +46,10 @@ const CombinedSpinner = () => {
|
|
|
47
46
|
}, /*#__PURE__*/React__default.createElement(InnerSpinner, null), /*#__PURE__*/React__default.createElement(FullPulsingSpinner, null));
|
|
48
47
|
};
|
|
49
48
|
const Loader = /*#__PURE__*/forwardRef((_, ref) => {
|
|
50
|
-
const
|
|
51
|
-
onMessageCancel
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
translate
|
|
55
|
-
} = useTranslation();
|
|
49
|
+
const _useChatContext = useChatContext(),
|
|
50
|
+
onMessageCancel = _useChatContext.onMessageCancel;
|
|
51
|
+
const _useTranslation2 = useTranslation(),
|
|
52
|
+
translate = _useTranslation2.translate;
|
|
56
53
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
57
54
|
ref: ref,
|
|
58
55
|
className: container
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import '../../utils/index.js';
|
|
2
2
|
import createContextUtilities from '../../utils/createContextUtilities/createContextUtilities.js';
|
|
3
3
|
|
|
4
|
-
const
|
|
5
|
-
Provider
|
|
6
|
-
useContext
|
|
7
|
-
} = createContextUtilities();
|
|
4
|
+
const _createContextUtiliti = createContextUtilities(),
|
|
5
|
+
MessageProvider = _createContextUtiliti.Provider,
|
|
6
|
+
useMessageContext = _createContextUtiliti.useContext;
|
|
8
7
|
|
|
9
8
|
export { MessageProvider, useMessageContext };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
1
2
|
import React__default, { forwardRef, useState, useRef, useEffect } from 'react';
|
|
2
3
|
import classNames from 'classnames';
|
|
3
4
|
import styles from './CollapsibleSearchInput2.js';
|
|
@@ -11,7 +12,6 @@ import mergeRefs from '../../utils/mergeRefs/mergeRefs.js';
|
|
|
11
12
|
import SearchInput from '../../components/SearchInput/SearchInput.js';
|
|
12
13
|
import getSubDataTestId from '../../utils/getSubDataTestId/getSubDataTestId.js';
|
|
13
14
|
|
|
14
|
-
/* eslint-disable camelcase */
|
|
15
15
|
const expandedStates = {
|
|
16
16
|
EXPANDED: 'expanded',
|
|
17
17
|
COLLAPSED: 'collapsed',
|
|
@@ -19,25 +19,35 @@ const expandedStates = {
|
|
|
19
19
|
COLLAPSING: 'collapsing'
|
|
20
20
|
};
|
|
21
21
|
const CollapsibleSearchInput = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
22
|
-
let
|
|
23
|
-
defaultValue = '',
|
|
24
|
-
value,
|
|
25
|
-
onValueChange,
|
|
26
|
-
placeholder,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const
|
|
22
|
+
let _ref$defaultValue = _ref.defaultValue,
|
|
23
|
+
defaultValue = _ref$defaultValue === void 0 ? '' : _ref$defaultValue,
|
|
24
|
+
value = _ref.value,
|
|
25
|
+
onValueChange = _ref.onValueChange,
|
|
26
|
+
placeholder = _ref.placeholder,
|
|
27
|
+
_ref$defaultIsExpande = _ref.defaultIsExpanded,
|
|
28
|
+
defaultIsExpanded = _ref$defaultIsExpande === void 0 ? false : _ref$defaultIsExpande,
|
|
29
|
+
isExpanded = _ref.isExpanded,
|
|
30
|
+
onIsExpandedChange = _ref.onIsExpandedChange,
|
|
31
|
+
_ref$widthWhenExpande = _ref.widthWhenExpanded,
|
|
32
|
+
widthWhenExpanded = _ref$widthWhenExpande === void 0 ? '100%' : _ref$widthWhenExpande,
|
|
33
|
+
searchInputAriaLabel = _ref.searchInputAriaLabel,
|
|
34
|
+
searchInputAriaLabelledBy = _ref.searchInputAriaLabelledBy,
|
|
35
|
+
searchInputAriaDescribedBy = _ref.searchInputAriaDescribedBy,
|
|
36
|
+
dataTestId = _ref['data-testid'];
|
|
37
|
+
const _useControllableState = useControllableState(defaultIsExpanded, onIsExpandedChange, isExpanded),
|
|
38
|
+
_useControllableState2 = _slicedToArray(_useControllableState, 2),
|
|
39
|
+
externalIsExpanded = _useControllableState2[0],
|
|
40
|
+
setExternalIsExpanded = _useControllableState2[1];
|
|
41
|
+
const _useState = useState(externalIsExpanded ? expandedStates.EXPANDED : expandedStates.COLLAPSED),
|
|
42
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
43
|
+
internalExpandedState = _useState2[0],
|
|
44
|
+
setInternalExpandedState = _useState2[1];
|
|
38
45
|
|
|
39
46
|
// Set to true when either the `SearchInput` or the `IconButton` has focus
|
|
40
|
-
const
|
|
47
|
+
const _useState3 = useState(false),
|
|
48
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
49
|
+
isComponentFocused = _useState4[0],
|
|
50
|
+
setIsComponentFocused = _useState4[1];
|
|
41
51
|
const containerRef = useRef(null);
|
|
42
52
|
const iconButtonRef = useRef(null);
|
|
43
53
|
const searchInputRef = useRef(null);
|
|
@@ -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 = {"collapsibleSearchInput":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._nf9h-{display:inline-block;width:36px;transition:width .25s ease-out}._2p1gg{width:100%}._cFG9K>input{padding-right:0!important}._jJq6Z>svg{fill:#515559}";
|
|
4
|
+
var styles = {"collapsibleSearchInput":"_nf9h-","searchInput":"_2p1gg","searchInputCollapsed":"_cFG9K","iconButton":"_jJq6Z"};
|
|
5
|
+
var stylesheet="._nf9h-{display:inline-block;width:36px;transition:width .25s ease-out}._2p1gg{width:100%}._cFG9K>input{padding-right:0!important}._jJq6Z>svg{fill:#515559}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
2
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
2
3
|
import React__default, { forwardRef } from 'react';
|
|
3
4
|
import '../../components/IconButton/index.js';
|
|
4
5
|
import '../../icons/index.es.js';
|
|
@@ -8,15 +9,14 @@ import useTranslation from '../../utils/Translation/useTranslation.js';
|
|
|
8
9
|
import IconButton from '../../components/IconButton/IconButton.js';
|
|
9
10
|
import SearchIcon from '../../icons/components/SearchIcon.js';
|
|
10
11
|
|
|
12
|
+
const _excluded = ["tooltipContent", "tooltipPlacement"];
|
|
11
13
|
const CollapsibleSearchInputIconButton = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
12
|
-
let
|
|
13
|
-
|
|
14
|
-
tooltipPlacement = 'bottom',
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
translate
|
|
19
|
-
} = useTranslation();
|
|
14
|
+
let tooltipContent = _ref.tooltipContent,
|
|
15
|
+
_ref$tooltipPlacement = _ref.tooltipPlacement,
|
|
16
|
+
tooltipPlacement = _ref$tooltipPlacement === void 0 ? 'bottom' : _ref$tooltipPlacement,
|
|
17
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
18
|
+
const _useTranslation = useTranslation(),
|
|
19
|
+
translate = _useTranslation.translate;
|
|
20
20
|
const label = translate('collapsibleSearchInput.openSearchField');
|
|
21
21
|
return /*#__PURE__*/React__default.createElement(IconButton, _extends({}, rest, {
|
|
22
22
|
className: styles.iconButton,
|
|
@@ -3,18 +3,20 @@ import '../../utils/GridChildrenWrapper/index.js';
|
|
|
3
3
|
import { GridChildrenWrapper } from '../../utils/GridChildrenWrapper/GridChildrenWrapper.js';
|
|
4
4
|
|
|
5
5
|
const CollectionGrid = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
6
|
-
let
|
|
7
|
-
minColumnWidth = '0px',
|
|
8
|
-
maxColumnWidth =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
let _ref$minColumnWidth = _ref.minColumnWidth,
|
|
7
|
+
minColumnWidth = _ref$minColumnWidth === void 0 ? '0px' : _ref$minColumnWidth,
|
|
8
|
+
_ref$maxColumnWidth = _ref.maxColumnWidth,
|
|
9
|
+
maxColumnWidth = _ref$maxColumnWidth === void 0 ? '1fr' : _ref$maxColumnWidth,
|
|
10
|
+
_ref$numColumns = _ref.numColumns,
|
|
11
|
+
numColumns = _ref$numColumns === void 0 ? 'auto-fit' : _ref$numColumns,
|
|
12
|
+
columnGap = _ref.columnGap,
|
|
13
|
+
rowGap = _ref.rowGap,
|
|
14
|
+
gap = _ref.gap,
|
|
15
|
+
rowHeight = _ref.rowHeight,
|
|
16
|
+
_ref$asChild = _ref.asChild,
|
|
17
|
+
asChild = _ref$asChild === void 0 ? false : _ref$asChild,
|
|
18
|
+
dataTestId = _ref['data-testid'],
|
|
19
|
+
children = _ref.children;
|
|
18
20
|
const calculatedStyle = {
|
|
19
21
|
display: 'grid',
|
|
20
22
|
gridTemplateColumns: "repeat(".concat(numColumns, ", minmax(").concat(minColumnWidth, ", ").concat(maxColumnWidth, "))"),
|
|
@@ -3,11 +3,10 @@ import '../../utils/GridChildrenWrapper/index.js';
|
|
|
3
3
|
import { GridChildrenWrapper } from '../../utils/GridChildrenWrapper/GridChildrenWrapper.js';
|
|
4
4
|
|
|
5
5
|
const CollectionGridItem = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
6
|
-
let
|
|
7
|
-
asChild = false,
|
|
8
|
-
'data-testid'
|
|
9
|
-
children
|
|
10
|
-
} = _ref;
|
|
6
|
+
let _ref$asChild = _ref.asChild,
|
|
7
|
+
asChild = _ref$asChild === void 0 ? false : _ref$asChild,
|
|
8
|
+
dataTestId = _ref['data-testid'],
|
|
9
|
+
children = _ref.children;
|
|
11
10
|
return /*#__PURE__*/React__default.createElement(GridChildrenWrapper, {
|
|
12
11
|
asChild: asChild,
|
|
13
12
|
"data-testid": dataTestId,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
1
2
|
import React__default, { useRef, useState } from 'react';
|
|
2
3
|
import { ComboboxContextProvider } from './ComboboxContext.js';
|
|
3
4
|
import './hooks/index.js';
|
|
@@ -12,46 +13,56 @@ import useSelectedOptionScroll from './hooks/useSelectedOptionScroll/useSelected
|
|
|
12
13
|
import useComboboxLoadingState from './hooks/useComboboxLoadingState/useComboboxLoadingState.js';
|
|
13
14
|
|
|
14
15
|
function Combobox(_ref) {
|
|
15
|
-
let
|
|
16
|
-
initialValue = '',
|
|
17
|
-
value,
|
|
18
|
-
onChange,
|
|
19
|
-
onSubmit,
|
|
20
|
-
isDisabled,
|
|
21
|
-
isInvalid,
|
|
22
|
-
isRequired,
|
|
23
|
-
isLoading =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
'aria-
|
|
28
|
-
'
|
|
29
|
-
|
|
30
|
-
|
|
16
|
+
let _ref$initialValue = _ref.initialValue,
|
|
17
|
+
initialValue = _ref$initialValue === void 0 ? '' : _ref$initialValue,
|
|
18
|
+
value = _ref.value,
|
|
19
|
+
onChange = _ref.onChange,
|
|
20
|
+
onSubmit = _ref.onSubmit,
|
|
21
|
+
isDisabled = _ref.isDisabled,
|
|
22
|
+
isInvalid = _ref.isInvalid,
|
|
23
|
+
isRequired = _ref.isRequired,
|
|
24
|
+
_ref$isLoading = _ref.isLoading,
|
|
25
|
+
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
26
|
+
externalIsOpen = _ref.isOpen,
|
|
27
|
+
externalOnIsOpenChange = _ref.onIsOpenChange,
|
|
28
|
+
ariaLabel = _ref['aria-label'],
|
|
29
|
+
ariaLabelledBy = _ref['aria-labelledby'],
|
|
30
|
+
dataTestId = _ref['data-testid'],
|
|
31
|
+
children = _ref.children;
|
|
31
32
|
const inputRef = useRef(null);
|
|
32
33
|
const flyoutRef = useRef(null);
|
|
33
34
|
const flyoutId = useId();
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
35
|
+
const _useControllableState = useControllableState(externalIsOpen !== null && externalIsOpen !== void 0 ? externalIsOpen : false, externalOnIsOpenChange, externalIsOpen),
|
|
36
|
+
_useControllableState2 = _slicedToArray(_useControllableState, 2),
|
|
37
|
+
isOpen = _useControllableState2[0],
|
|
38
|
+
setIsOpen = _useControllableState2[1];
|
|
39
|
+
const _useState = useState(null),
|
|
40
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
41
|
+
hoveredOption = _useState2[0],
|
|
42
|
+
setHoveredOption = _useState2[1];
|
|
43
|
+
const _useState3 = useState(false),
|
|
44
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
45
|
+
isSearchFilteringDisabled = _useState4[0],
|
|
46
|
+
setIsSearchFilteringDisabled = _useState4[1];
|
|
47
|
+
const _useIsFocused = useIsFocused(),
|
|
48
|
+
_useIsFocused2 = _slicedToArray(_useIsFocused, 2),
|
|
49
|
+
inputFocusRef = _useIsFocused2[0],
|
|
50
|
+
isComponentFocused = _useIsFocused2[1];
|
|
51
|
+
const _useComboboxValue = useComboboxValue(initialValue, value, onChange),
|
|
52
|
+
rawInputValue = _useComboboxValue.rawInputValue,
|
|
53
|
+
setRawInputValue = _useComboboxValue.setRawInputValue,
|
|
54
|
+
committedInputValue = _useComboboxValue.committedInputValue,
|
|
55
|
+
setCommittedInputValue = _useComboboxValue.setCommittedInputValue;
|
|
56
|
+
const _useComboboxFocusSequ = useComboboxFocusSequence(isOpen, setIsOpen, inputRef, isLoading, committedInputValue, isDisabled),
|
|
57
|
+
registerOption = _useComboboxFocusSequ.registerOption,
|
|
58
|
+
deregisterOption = _useComboboxFocusSequ.deregisterOption,
|
|
59
|
+
focusInput = _useComboboxFocusSequ.focusInput,
|
|
60
|
+
focusFirst = _useComboboxFocusSequ.focusFirst,
|
|
61
|
+
focusLast = _useComboboxFocusSequ.focusLast,
|
|
62
|
+
focusNext = _useComboboxFocusSequ.focusNext,
|
|
63
|
+
focusPrevious = _useComboboxFocusSequ.focusPrevious,
|
|
64
|
+
activeDescendantElement = _useComboboxFocusSequ.activeDescendantElement,
|
|
65
|
+
filteredOptionsRef = _useComboboxFocusSequ.filteredOptionsRef;
|
|
55
66
|
useSelectedOptionScroll(isOpen, activeDescendantElement, filteredOptionsRef, flyoutRef);
|
|
56
67
|
useComboboxLoadingState(isLoading, isComponentFocused, activeDescendantElement, rawInputValue, setCommittedInputValue);
|
|
57
68
|
return /*#__PURE__*/React__default.createElement(ComboboxContextProvider, {
|