@qualtrics/ui-react 2.79.1 → 2.81.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 +25 -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-91d2f6f8.js → index-2272eaad.js} +15 -9
- package/dist/__shared/cjs/{index-d4ec6b6f.js → index-7fd3ddfe.js} +2829 -2634
- 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 +52 -36
- 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 +52 -27
- 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 +30 -22
- package/dist/next/SplitButton/SplitButton2.js +3 -3
- package/dist/next/SplitButton/SplitButtonOption.js +6 -6
- 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.d.ts +12 -2
- package/dist/next/index.js +2395 -2199
- 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
|
@@ -7,16 +7,16 @@ import Input from '../Input/Input.js';
|
|
|
7
7
|
import SearchIcon from '../../icons/components/SearchIcon.js';
|
|
8
8
|
|
|
9
9
|
const MenuSearch = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
searchValue = '',
|
|
16
|
-
isInteractive =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
let setSearchValue = _ref.setSearchValue,
|
|
11
|
+
animatedLeft = _ref.animatedLeft,
|
|
12
|
+
animatedRight = _ref.animatedRight,
|
|
13
|
+
dataTestId = _ref.dataTestId,
|
|
14
|
+
_ref$searchValue = _ref.searchValue,
|
|
15
|
+
searchValue = _ref$searchValue === void 0 ? '' : _ref$searchValue,
|
|
16
|
+
_ref$isInteractive = _ref.isInteractive,
|
|
17
|
+
isInteractive = _ref$isInteractive === void 0 ? false : _ref$isInteractive,
|
|
18
|
+
searchPlaceholder = _ref.searchPlaceholder,
|
|
19
|
+
inputRef = _ref.inputRef;
|
|
20
20
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
21
21
|
className: classNames(styles.searchBox, {
|
|
22
22
|
[styles.unresponsive]: !isInteractive,
|
|
@@ -8,21 +8,16 @@ import { VIRTUOSO_PROPS } from './constants.js';
|
|
|
8
8
|
|
|
9
9
|
const PaneChildren = _ref => {
|
|
10
10
|
var _useSelectContext, _containerRef$current, _containerRef$current2;
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const {
|
|
22
|
-
closeSubmenu: containedWithinSubpane,
|
|
23
|
-
setIsVirtualizationReady,
|
|
24
|
-
isVirtualized
|
|
25
|
-
} = usePaneContext();
|
|
11
|
+
let children = _ref.children;
|
|
12
|
+
const _useMenuContext = useMenuContext(),
|
|
13
|
+
virtuoso = _useMenuContext.virtuoso;
|
|
14
|
+
const _ref2 = (_useSelectContext = useSelectContext(true)) !== null && _useSelectContext !== void 0 ? _useSelectContext : {},
|
|
15
|
+
multiselect = _ref2.multiselect,
|
|
16
|
+
showSelectedItemsPane = _ref2.showSelectedItemsPane;
|
|
17
|
+
const _usePaneContext = usePaneContext(),
|
|
18
|
+
containedWithinSubpane = _usePaneContext.closeSubmenu,
|
|
19
|
+
setIsVirtualizationReady = _usePaneContext.setIsVirtualizationReady,
|
|
20
|
+
isVirtualized = _usePaneContext.isVirtualized;
|
|
26
21
|
const containerRef = useRef(null);
|
|
27
22
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
28
23
|
ref: containerRef,
|
|
@@ -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, { useState, useRef, useCallback, useMemo, useEffect } from 'react';
|
|
3
6
|
import { Sub as Sub2, SubTrigger as SubTrigger2, SubContent as SubContent2, Item as Item2 } from './../../__node_modules/@radix-ui/react-dropdown-menu/dist/index.js';
|
|
4
7
|
import classNames from 'classnames';
|
|
@@ -25,66 +28,77 @@ import ChevronRightIcon from '../../icons/components/ChevronRightIcon.js';
|
|
|
25
28
|
import mergeRefs from '../../utils/mergeRefs/mergeRefs.js';
|
|
26
29
|
import ArrowLeftIcon from '../../icons/components/ArrowLeftIcon.js';
|
|
27
30
|
|
|
31
|
+
const _excluded = ["children", "label", "isDisabled", "isSearchable", "searchValue", "onSearchValueChange", "isSearchFilteringDisabled", "className", "style", "onIsOpenChange"];
|
|
28
32
|
const SubMenu = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
29
33
|
var _submenuDepths$intern;
|
|
30
|
-
let
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
className,
|
|
39
|
-
style,
|
|
40
|
-
onIsOpenChange,
|
|
41
|
-
|
|
42
|
-
} = _ref;
|
|
34
|
+
let children = _ref.children,
|
|
35
|
+
label = _ref.label,
|
|
36
|
+
isDisabled = _ref.isDisabled,
|
|
37
|
+
isSearchable = _ref.isSearchable,
|
|
38
|
+
externalSearchValue = _ref.searchValue,
|
|
39
|
+
onSearchValueChange = _ref.onSearchValueChange,
|
|
40
|
+
_ref$isSearchFilterin = _ref.isSearchFilteringDisabled,
|
|
41
|
+
isSearchFilteringDisabledForChildren = _ref$isSearchFilterin === void 0 ? false : _ref$isSearchFilterin,
|
|
42
|
+
className = _ref.className,
|
|
43
|
+
style = _ref.style,
|
|
44
|
+
onIsOpenChange = _ref.onIsOpenChange,
|
|
45
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
43
46
|
const selectContext = useSelectContext(true);
|
|
44
47
|
const withinSelect = selectContext !== null;
|
|
45
|
-
const {
|
|
46
|
-
subSelectTriggerProps,
|
|
47
|
-
multiselect,
|
|
48
|
-
subSelectPaneProps,
|
|
49
|
-
isSelectedItems,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
virtualIndex
|
|
55
|
-
|
|
56
|
-
|
|
48
|
+
const _ref2 = selectContext !== null && selectContext !== void 0 ? selectContext : {},
|
|
49
|
+
subSelectTriggerProps = _ref2.subSelectTriggerProps,
|
|
50
|
+
multiselect = _ref2.multiselect,
|
|
51
|
+
subSelectPaneProps = _ref2.subSelectPaneProps,
|
|
52
|
+
isSelectedItems = _ref2.isSelectedItems,
|
|
53
|
+
_ref2$triggerCheckedS = _ref2.triggerCheckedState,
|
|
54
|
+
triggerCheckedState = _ref2$triggerCheckedS === void 0 ? false : _ref2$triggerCheckedS,
|
|
55
|
+
onTriggerCheckboxSelect = _ref2.onTriggerCheckboxSelect;
|
|
56
|
+
const _useItemContext = useItemContext(),
|
|
57
|
+
virtualIndex = _useItemContext.virtualIndex;
|
|
58
|
+
const _useState = useState([]),
|
|
59
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
60
|
+
items = _useState2[0],
|
|
61
|
+
setItems = _useState2[1];
|
|
57
62
|
const internalId = useId();
|
|
58
63
|
const triggerRef = useRef(null);
|
|
59
|
-
const
|
|
64
|
+
const _useState3 = useState(null),
|
|
65
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
66
|
+
flyoutNode = _useState4[0],
|
|
67
|
+
setFlyoutNode = _useState4[1];
|
|
60
68
|
const onRefChange = useCallback(node => setFlyoutNode(node), []);
|
|
61
69
|
const stickyBoxRef = useRef(null);
|
|
62
70
|
const backButtonRef = useRef(null);
|
|
63
|
-
const
|
|
64
|
-
dataTestId
|
|
65
|
-
childIndex,
|
|
66
|
-
isInteractive
|
|
67
|
-
closeSubmenu
|
|
68
|
-
zIndex
|
|
69
|
-
focusVirtualBoundary
|
|
70
|
-
isVirtualized
|
|
71
|
-
internalId
|
|
72
|
-
} = usePaneContext(triggerRef);
|
|
71
|
+
const _usePaneContext = usePaneContext(triggerRef),
|
|
72
|
+
paneContainingTriggerDataTestId = _usePaneContext.dataTestId,
|
|
73
|
+
childIndex = _usePaneContext.childIndex,
|
|
74
|
+
paneContainingTriggerIsInteractive = _usePaneContext.isInteractive,
|
|
75
|
+
closeSubmenuContainingTrigger = _usePaneContext.closeSubmenu,
|
|
76
|
+
paneContainingTriggerZIndex = _usePaneContext.zIndex,
|
|
77
|
+
focusVirtualBoundaryWithinPaneContainingTrigger = _usePaneContext.focusVirtualBoundary,
|
|
78
|
+
paneContainingTriggerIsVirtualized = _usePaneContext.isVirtualized,
|
|
79
|
+
parentId = _usePaneContext.internalId;
|
|
73
80
|
const triggerIndex = useMemo(() => virtualIndex !== null && virtualIndex !== void 0 ? virtualIndex : childIndex, [childIndex, virtualIndex]);
|
|
74
|
-
const
|
|
75
|
-
openPaneDepth
|
|
76
|
-
registerSubmenu,
|
|
77
|
-
isVirtualizationDisabled,
|
|
78
|
-
submenuDepths
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
isFocusVisible
|
|
82
|
-
} = useIsFocusVisible();
|
|
81
|
+
const _useMenuContext = useMenuContext(),
|
|
82
|
+
totalOpenPaneDepth = _useMenuContext.openPaneDepth,
|
|
83
|
+
registerSubmenu = _useMenuContext.registerSubmenu,
|
|
84
|
+
isVirtualizationDisabled = _useMenuContext.isVirtualizationDisabled,
|
|
85
|
+
submenuDepths = _useMenuContext.submenuDepths;
|
|
86
|
+
const _useIsFocusVisible = useIsFocusVisible(),
|
|
87
|
+
isFocusVisible = _useIsFocusVisible.isFocusVisible;
|
|
83
88
|
const zIndex = useMemo(() => paneContainingTriggerZIndex + 1, [paneContainingTriggerZIndex]);
|
|
84
89
|
const thisPanesDepth = (_submenuDepths$intern = submenuDepths[internalId]) !== null && _submenuDepths$intern !== void 0 ? _submenuDepths$intern : Number.MAX_SAFE_INTEGER;
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
90
|
+
const _useState5 = useState(false),
|
|
91
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
92
|
+
isPaneInDOM = _useState6[0],
|
|
93
|
+
setIsPaneInDOM = _useState6[1];
|
|
94
|
+
const _useState7 = useState(false),
|
|
95
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
96
|
+
isFrameAfterPaneAddedToDOM = _useState8[0],
|
|
97
|
+
setIsFrameAfterPaneAddedToDOM = _useState8[1];
|
|
98
|
+
const _useState9 = useState(false),
|
|
99
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
100
|
+
isTransitioningFromRight = _useState0[0],
|
|
101
|
+
setIsTransitioningFromRight = _useState0[1];
|
|
88
102
|
const animatedLeft = useMemo(() => thisPanesDepth < totalOpenPaneDepth, [totalOpenPaneDepth, thisPanesDepth]);
|
|
89
103
|
const animatedRight = useMemo(() => thisPanesDepth > totalOpenPaneDepth || thisPanesDepth === totalOpenPaneDepth && !isPaneInDOM || isFrameAfterPaneAddedToDOM, [totalOpenPaneDepth, isFrameAfterPaneAddedToDOM, thisPanesDepth, isPaneInDOM]);
|
|
90
104
|
const paneDataTestId = getSubDataTestId(paneContainingTriggerDataTestId, String(triggerIndex));
|
|
@@ -94,26 +108,25 @@ const SubMenu = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
94
108
|
registerSubmenu(internalId, false, parentId);
|
|
95
109
|
};
|
|
96
110
|
const isVirtualized = useIsVirtualized(children, isVirtualizationDisabled);
|
|
97
|
-
const {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
});
|
|
111
|
+
const _usePaneSearch = usePaneSearch({
|
|
112
|
+
isSearchable,
|
|
113
|
+
externalSearchValue,
|
|
114
|
+
onSearchValueChange,
|
|
115
|
+
items,
|
|
116
|
+
animatedLeft,
|
|
117
|
+
animatedRight,
|
|
118
|
+
menuParentDataTestId: paneDataTestId,
|
|
119
|
+
id: internalId,
|
|
120
|
+
flyoutNode,
|
|
121
|
+
children,
|
|
122
|
+
isSearchFilteringDisabled: isSearchFilteringDisabledForChildren,
|
|
123
|
+
backButtonRef,
|
|
124
|
+
closeSubmenu: closeThisSubmenu,
|
|
125
|
+
isVirtualized
|
|
126
|
+
}),
|
|
127
|
+
noSearchResultsNode = _usePaneSearch.noSearchResultsNode,
|
|
128
|
+
onInteractOutside = _usePaneSearch.onInteractOutside,
|
|
129
|
+
filteredChildren = _usePaneSearch.filteredChildren;
|
|
117
130
|
const focusVirtualBoundaryInPane = useFocusVirtualBoundary(items, backButtonRef);
|
|
118
131
|
const backButtonDataTestId = paneDataTestId === null || paneDataTestId === void 0 ? void 0 : paneDataTestId.replace(withinSelect ? DATA_TESTID_SUFFIXES.SELECT_PANE : DATA_TESTID_SUFFIXES$1.MENU_PANE, withinSelect ? DATA_TESTID_SUFFIXES.SELECT_BACK : DATA_TESTID_SUFFIXES$1.MENU_BACK);
|
|
119
132
|
const triggerDataTestId = paneDataTestId === null || paneDataTestId === void 0 ? void 0 : paneDataTestId.replace(withinSelect ? DATA_TESTID_SUFFIXES.SELECT_PANE : DATA_TESTID_SUFFIXES$1.MENU_PANE, withinSelect ? DATA_TESTID_SUFFIXES.SELECT_ITEM : DATA_TESTID_SUFFIXES$1.MENU_ITEM);
|
|
@@ -168,22 +181,23 @@ const SubMenu = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
168
181
|
ref: triggerRef,
|
|
169
182
|
onClick: () => !isDisabled && setIsPaneInDOM(true),
|
|
170
183
|
onKeyDown: e => {
|
|
184
|
+
var _context, _context2, _context3, _context4, _context5;
|
|
171
185
|
if (!paneContainingTriggerIsInteractive) {
|
|
172
186
|
e.preventDefault();
|
|
173
187
|
return;
|
|
174
188
|
}
|
|
175
|
-
if (multiselect && !isSelectedItems && KEYS.CHECK_PARENT.
|
|
189
|
+
if (multiselect && !isSelectedItems && _includesInstanceProperty(_context = KEYS.CHECK_PARENT).call(_context, e.key)) {
|
|
176
190
|
onTriggerCheckboxSelect === null || onTriggerCheckboxSelect === void 0 || onTriggerCheckboxSelect();
|
|
177
191
|
return;
|
|
178
192
|
}
|
|
179
|
-
if (!isDisabled && KEYS$1.OPEN_SUBMENU.
|
|
193
|
+
if (!isDisabled && _includesInstanceProperty(_context2 = KEYS$1.OPEN_SUBMENU).call(_context2, e.key)) {
|
|
180
194
|
setIsPaneInDOM(true);
|
|
181
|
-
} else if (KEYS$1.CLOSE_SUBMENU.
|
|
195
|
+
} else if (_includesInstanceProperty(_context3 = KEYS$1.CLOSE_SUBMENU).call(_context3, e.key)) {
|
|
182
196
|
closeSubmenuContainingTrigger === null || closeSubmenuContainingTrigger === void 0 || closeSubmenuContainingTrigger(e);
|
|
183
|
-
} else if (paneContainingTriggerIsVirtualized && KEYS$1.NAVIGATE_TOP.
|
|
197
|
+
} else if (paneContainingTriggerIsVirtualized && _includesInstanceProperty(_context4 = KEYS$1.NAVIGATE_TOP).call(_context4, e.key)) {
|
|
184
198
|
e.preventDefault();
|
|
185
199
|
focusVirtualBoundaryWithinPaneContainingTrigger('top');
|
|
186
|
-
} else if (paneContainingTriggerIsVirtualized && KEYS$1.NAVIIGATE_BOTTOM.
|
|
200
|
+
} else if (paneContainingTriggerIsVirtualized && _includesInstanceProperty(_context5 = KEYS$1.NAVIIGATE_BOTTOM).call(_context5, e.key)) {
|
|
187
201
|
e.preventDefault();
|
|
188
202
|
focusVirtualBoundaryWithinPaneContainingTrigger('bottom');
|
|
189
203
|
}
|
|
@@ -241,12 +255,13 @@ const SubMenu = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
241
255
|
onSelect: closeThisSubmenu,
|
|
242
256
|
ref: backButtonRef,
|
|
243
257
|
onKeyDown: e => {
|
|
244
|
-
|
|
258
|
+
var _context6, _context7, _context8;
|
|
259
|
+
if (_includesInstanceProperty(_context6 = KEYS$1.CLOSE_SUBMENU).call(_context6, e.key)) {
|
|
245
260
|
closeThisSubmenu(e);
|
|
246
|
-
} else if (isVirtualized && KEYS$1.NAVIGATE_TOP.
|
|
261
|
+
} else if (isVirtualized && _includesInstanceProperty(_context7 = KEYS$1.NAVIGATE_TOP).call(_context7, e.key)) {
|
|
247
262
|
e.preventDefault();
|
|
248
263
|
focusVirtualBoundaryInPane('top');
|
|
249
|
-
} else if (isVirtualized && KEYS$1.NAVIIGATE_BOTTOM.
|
|
264
|
+
} else if (isVirtualized && _includesInstanceProperty(_context8 = KEYS$1.NAVIIGATE_BOTTOM).call(_context8, e.key)) {
|
|
250
265
|
e.preventDefault();
|
|
251
266
|
focusVirtualBoundaryInPane('bottom');
|
|
252
267
|
}
|
|
@@ -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, { useState, useRef } from 'react';
|
|
3
6
|
import { growingInput, hidden, pageNumber, pagination } from './Pagination.css.js';
|
|
4
7
|
import '../../components/index.js';
|
|
@@ -19,19 +22,27 @@ import ChevronLeftIcon from '../../icons/components/ChevronLeftIcon.js';
|
|
|
19
22
|
import ChevronRightIcon from '../../icons/components/ChevronRightIcon.js';
|
|
20
23
|
import ChevronSkipForwardIcon from '../../icons/components/ChevronSkipForwardIcon.js';
|
|
21
24
|
|
|
25
|
+
const _excluded = ["value", "onChangeInput", "max", "min"];
|
|
22
26
|
const INVALID_INTEGER_INPUT_CHARS = ['-', '+', 'e', '.'];
|
|
23
27
|
const coalesceIntegerToRange = (value, min, max) => Math.min(Math.max(Math.round(value), min), max);
|
|
24
28
|
const GrowingIntegerInput = _ref => {
|
|
25
|
-
let
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const
|
|
29
|
+
let value = _ref.value,
|
|
30
|
+
onChangeInput = _ref.onChangeInput,
|
|
31
|
+
max = _ref.max,
|
|
32
|
+
min = _ref.min,
|
|
33
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
34
|
+
const _useState = useState(0),
|
|
35
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
36
|
+
width = _useState2[0],
|
|
37
|
+
setWidth = _useState2[1];
|
|
38
|
+
const _useState3 = useState(value),
|
|
39
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
40
|
+
internalValue = _useState4[0],
|
|
41
|
+
setInternalValue = _useState4[1];
|
|
42
|
+
const _useState5 = useState(value),
|
|
43
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
44
|
+
previousExternalValue = _useState6[0],
|
|
45
|
+
setPreviousExternalValue = _useState6[1];
|
|
35
46
|
const span = useRef(null);
|
|
36
47
|
if (value !== previousExternalValue) {
|
|
37
48
|
setPreviousExternalValue(value);
|
|
@@ -54,7 +65,7 @@ const GrowingIntegerInput = _ref => {
|
|
|
54
65
|
const onKeyDownHandler = e => {
|
|
55
66
|
if (e.key === 'Enter') {
|
|
56
67
|
triggerExternalChange(e);
|
|
57
|
-
} else if (INVALID_INTEGER_INPUT_CHARS.
|
|
68
|
+
} else if (_includesInstanceProperty(INVALID_INTEGER_INPUT_CHARS).call(INVALID_INTEGER_INPUT_CHARS, e.key)) {
|
|
58
69
|
e.preventDefault();
|
|
59
70
|
}
|
|
60
71
|
};
|
|
@@ -77,14 +88,12 @@ const GrowingIntegerInput = _ref => {
|
|
|
77
88
|
}, rest)));
|
|
78
89
|
};
|
|
79
90
|
const PageInput = _ref2 => {
|
|
80
|
-
let
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
'data-testid': dataTestId
|
|
87
|
-
} = _ref2;
|
|
91
|
+
let numPages = _ref2.numPages,
|
|
92
|
+
currentPage = _ref2.currentPage,
|
|
93
|
+
onChange = _ref2.onChange,
|
|
94
|
+
ariaLabel = _ref2['aria-label'],
|
|
95
|
+
disabled = _ref2.disabled,
|
|
96
|
+
dataTestId = _ref2['data-testid'];
|
|
88
97
|
const delegatedInput = /*#__PURE__*/React__default.createElement(GrowingIntegerInput, {
|
|
89
98
|
max: numPages !== null && numPages !== void 0 ? numPages : undefined,
|
|
90
99
|
min: 1,
|
|
@@ -106,18 +115,18 @@ const PageInput = _ref2 => {
|
|
|
106
115
|
}) : delegatedInput);
|
|
107
116
|
};
|
|
108
117
|
const Pagination = _ref3 => {
|
|
109
|
-
let
|
|
110
|
-
hidePageNumber = false,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
118
|
+
let _ref3$hidePageNumber = _ref3.hidePageNumber,
|
|
119
|
+
hidePageNumber = _ref3$hidePageNumber === void 0 ? false : _ref3$hidePageNumber,
|
|
120
|
+
_ref3$hideFirstAndLas = _ref3.hideFirstAndLastButtons,
|
|
121
|
+
hideFirstAndLastButtons = _ref3$hideFirstAndLas === void 0 ? false : _ref3$hideFirstAndLas,
|
|
122
|
+
numPages = _ref3.numPages,
|
|
123
|
+
currentPage = _ref3.currentPage,
|
|
124
|
+
onPageChange = _ref3.onPageChange,
|
|
125
|
+
_ref3$isDisabled = _ref3.isDisabled,
|
|
126
|
+
isDisabled = _ref3$isDisabled === void 0 ? false : _ref3$isDisabled,
|
|
127
|
+
dataTestId = _ref3['data-testid'];
|
|
128
|
+
const _useTranslation = useTranslation(),
|
|
129
|
+
translate = _useTranslation.translate;
|
|
121
130
|
const announceToScreenReader = useScreenReaderAnnouncement('polite');
|
|
122
131
|
useDidUpdate(() => {
|
|
123
132
|
let messageKey = 'currentPageNumber';
|
|
@@ -10,13 +10,12 @@ import SelectItem from '../Select/SelectItem.js';
|
|
|
10
10
|
import Translate from '../../utils/Translation/Translate.js';
|
|
11
11
|
|
|
12
12
|
const RowDisplayCount = _ref => {
|
|
13
|
-
let
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
isDisabled = false
|
|
19
|
-
} = _ref;
|
|
13
|
+
let dataTestId = _ref['data-testid'],
|
|
14
|
+
displayCount = _ref.displayCount,
|
|
15
|
+
displayCountOptions = _ref.displayCountOptions,
|
|
16
|
+
onDisplayCountChange = _ref.onDisplayCountChange,
|
|
17
|
+
_ref$isDisabled = _ref.isDisabled,
|
|
18
|
+
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled;
|
|
20
19
|
const displayCountSelect = /*#__PURE__*/React__default.createElement(Select, {
|
|
21
20
|
"data-testid": getSubDataTestId(dataTestId, 'select'),
|
|
22
21
|
isDisabled: isDisabled,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
1
2
|
import React__default, { forwardRef, useState, useRef, useCallback, useMemo, useEffect } from 'react';
|
|
2
3
|
import { Metadata, getCountryCallingCode, parsePhoneNumber, getCountries, isSupportedCountry } from 'libphonenumber-js';
|
|
3
4
|
import { IMask, useIMask } from 'react-imask';
|
|
@@ -14,28 +15,30 @@ import mergeRefs from '../../utils/mergeRefs/mergeRefs.js';
|
|
|
14
15
|
|
|
15
16
|
const removeNonNumericCharacters = value => (value === null || value === void 0 ? void 0 : value.replace(/\D/g, '')) || '';
|
|
16
17
|
const PhoneNumberInput = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
17
|
-
let
|
|
18
|
-
initialCountryCode = 'US',
|
|
19
|
-
countryCodes,
|
|
20
|
-
onChange,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
18
|
+
let _ref$initialCountryCo = _ref.initialCountryCode,
|
|
19
|
+
initialCountryCode = _ref$initialCountryCo === void 0 ? 'US' : _ref$initialCountryCo,
|
|
20
|
+
countryCodes = _ref.countryCodes,
|
|
21
|
+
onChange = _ref.onChange,
|
|
22
|
+
_ref$limitToValidLeng = _ref.limitToValidLength,
|
|
23
|
+
limitToValidLength = _ref$limitToValidLeng === void 0 ? false : _ref$limitToValidLeng,
|
|
24
|
+
isDisabled = _ref.isDisabled,
|
|
25
|
+
initialValue = _ref.initialValue,
|
|
26
|
+
buttonAriaLabel = _ref.buttonAriaLabel,
|
|
27
|
+
inputAriaLabel = _ref.inputAriaLabel,
|
|
28
|
+
buttonAriaLabelledBy = _ref.buttonAriaLabelledBy,
|
|
29
|
+
inputAriaLabelledBy = _ref.inputAriaLabelledBy,
|
|
30
|
+
dataTestId = _ref['data-testid'],
|
|
31
|
+
inputId = _ref.inputId;
|
|
32
|
+
const _useState = useState(initialCountryCode),
|
|
33
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
34
|
+
countryCode = _useState2[0],
|
|
35
|
+
setCountryCode = _useState2[1];
|
|
32
36
|
const unmaskedValueOnCountryChangeRef = useRef(null);
|
|
33
37
|
|
|
34
38
|
// As of the day of writing the longest number format is 15 numbers long. This is 5 places longer to be safe.
|
|
35
39
|
const genericMaxNumberLength = 20;
|
|
36
|
-
const
|
|
37
|
-
translate
|
|
38
|
-
} = useTranslation();
|
|
40
|
+
const _useTranslation = useTranslation(),
|
|
41
|
+
translate = _useTranslation.translate;
|
|
39
42
|
const getMinMaxLength = useCallback(() => {
|
|
40
43
|
var _metadata$numberingPl;
|
|
41
44
|
const metadata = new Metadata();
|
|
@@ -60,35 +63,34 @@ const PhoneNumberInput = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
60
63
|
mask: maskPattern
|
|
61
64
|
});
|
|
62
65
|
}, [shouldUseMask, initialNumeric, maskPattern]);
|
|
63
|
-
const {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
});
|
|
66
|
+
const _useIMask = useIMask({
|
|
67
|
+
mask: maskPattern,
|
|
68
|
+
lazy: !shouldUseMask,
|
|
69
|
+
placeholderChar: shouldUseMask ? '_' : ''
|
|
70
|
+
}, {
|
|
71
|
+
defaultUnmaskedValue: initialNumeric || undefined,
|
|
72
|
+
defaultValue: shouldUseMask && !initialNumeric ? emptyDisplayValue : undefined,
|
|
73
|
+
onAccept: !isDisabled ? () => {
|
|
74
|
+
var _maskRef$current$unma, _maskRef$current;
|
|
75
|
+
const unmaskedValue = (_maskRef$current$unma = (_maskRef$current = maskRef.current) === null || _maskRef$current === void 0 ? void 0 : _maskRef$current.unmaskedValue) !== null && _maskRef$current$unma !== void 0 ? _maskRef$current$unma : '';
|
|
76
|
+
if (!unmaskedValue) {
|
|
77
|
+
onChange === null || onChange === void 0 || onChange(null, false, countryCode, '');
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
let internationalNumber = null;
|
|
81
|
+
let isValidLength = false;
|
|
82
|
+
try {
|
|
83
|
+
const phoneNumber = parsePhoneNumber(unmaskedValue, countryCode);
|
|
84
|
+
internationalNumber = phoneNumber.number;
|
|
85
|
+
isValidLength = phoneNumber.isPossible();
|
|
86
|
+
} catch (_) {
|
|
87
|
+
// `parsePhoneNumber` throws an error if the inputs are invalid.
|
|
88
|
+
}
|
|
89
|
+
onChange === null || onChange === void 0 || onChange(internationalNumber, isValidLength, countryCode, unmaskedValue);
|
|
90
|
+
} : undefined
|
|
91
|
+
}),
|
|
92
|
+
imaskRef = _useIMask.ref,
|
|
93
|
+
maskRef = _useIMask.maskRef;
|
|
92
94
|
|
|
93
95
|
// Sync initialValue to mask when prop is set/updated (mask may not exist on first run)
|
|
94
96
|
useEffect(() => {
|
|
@@ -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 = {"input":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._PBQVu input{padding-left:76px!important}._OuZQ- input{background-color:#e5e5e5!important;color:#9d9fa1!important;cursor:not-allowed!important;-webkit-text-fill-color:#9d9fa1}._OuZQ- input::-moz-placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._OuZQ- input::placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._m1BZB{position:absolute!important;left:4px;right:4px;bottom:4px;z-index:100;width:67px;height:28px!important;border-radius:4px}._m1BZB,._m1BZB._OuZQ-:hover{background-color:transparent!important}._m1BZB:hover{background-color:rgba(50,54,58,.08)!important}._m1BZB:active{background-color:rgba(50,54,58,.11)!important}._m1BZB svg{top:2px!important}._jRoIZ{position:relative}._QEw-Q{position:absolute;top:18px;left:12px;line-height:0;font-size:14px;color:#32363a;z-index:101;pointer-events:none}";
|
|
4
|
+
var styles = {"input":"_PBQVu","disabled":"_OuZQ-","dropdown":"_m1BZB","container":"_jRoIZ","countryCode":"_QEw-Q"};
|
|
5
|
+
var stylesheet="._PBQVu input{padding-left:76px!important}._OuZQ- input{background-color:#e5e5e5!important;color:#9d9fa1!important;cursor:not-allowed!important;-webkit-text-fill-color:#9d9fa1}._OuZQ- input::-moz-placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._OuZQ- input::placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._m1BZB{position:absolute!important;left:4px;right:4px;bottom:4px;z-index:100;width:67px;height:28px!important;border-radius:4px}._m1BZB,._m1BZB._OuZQ-:hover{background-color:transparent!important}._m1BZB:hover{background-color:rgba(50,54,58,.08)!important}._m1BZB:active{background-color:rgba(50,54,58,.11)!important}._m1BZB svg{top:2px!important}._jRoIZ{position:relative}._QEw-Q{position:absolute;top:18px;left:12px;line-height:0;font-size:14px;color:#32363a;z-index:101;pointer-events:none}";
|
|
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,3 +1,5 @@
|
|
|
1
|
+
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
2
|
+
import _includesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
1
3
|
import React__default, { useMemo, useCallback } from 'react';
|
|
2
4
|
import '../Menu/index.js';
|
|
3
5
|
import { SelectContextProvider } from './SelectContext.js';
|
|
@@ -20,12 +22,12 @@ const GetSelectItemsFrom = function (startingChildren) {
|
|
|
20
22
|
return;
|
|
21
23
|
}
|
|
22
24
|
if (child.type === SelectItem) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const safeLabel = label !== null && label !== void 0 ? label : ['string', 'number'].
|
|
25
|
+
var _context;
|
|
26
|
+
const _child$props = child.props,
|
|
27
|
+
label = _child$props.label,
|
|
28
|
+
childValue = _child$props.value,
|
|
29
|
+
childChildren = _child$props.children;
|
|
30
|
+
const safeLabel = label !== null && label !== void 0 ? label : _includesInstanceProperty(_context = ['string', 'number']).call(_context, typeof childChildren) ? childChildren : undefined;
|
|
29
31
|
current.push([childValue, safeLabel]);
|
|
30
32
|
} else if (child.type === SubSelect) {
|
|
31
33
|
current.push(...GetSelectItemsFrom(child.props.children, filter));
|
|
@@ -34,20 +36,21 @@ const GetSelectItemsFrom = function (startingChildren) {
|
|
|
34
36
|
return current;
|
|
35
37
|
};
|
|
36
38
|
const Select = _ref => {
|
|
37
|
-
let
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
39
|
+
let multiselect = _ref.multiselect,
|
|
40
|
+
children = _ref.children,
|
|
41
|
+
isDisabled = _ref.isDisabled,
|
|
42
|
+
onChange = _ref.onChange,
|
|
43
|
+
isOpen = _ref.isOpen,
|
|
44
|
+
onIsOpenChange = _ref.onIsOpenChange,
|
|
45
|
+
value = _ref.value,
|
|
46
|
+
isInvalid = _ref.isInvalid,
|
|
47
|
+
dataTestId = _ref['data-testid'],
|
|
48
|
+
isVirtualizationDisabled = _ref.isVirtualizationDisabled,
|
|
49
|
+
elementRefToFocusOnClose = _ref.elementRefToFocusOnClose;
|
|
50
|
+
const _useControllableState = useControllableState(value, onChange, value),
|
|
51
|
+
_useControllableState2 = _slicedToArray(_useControllableState, 2),
|
|
52
|
+
selectedValues = _useControllableState2[0],
|
|
53
|
+
setSelectedValues = _useControllableState2[1];
|
|
51
54
|
const selectPaneChildren = useMemo(() => {
|
|
52
55
|
var _children$find;
|
|
53
56
|
return Array.isArray(children) ? (_children$find = children.find(child => child.type === SelectPane)) === null || _children$find === void 0 ? void 0 : _children$find.props.children : null;
|
|
@@ -55,23 +58,17 @@ const Select = _ref => {
|
|
|
55
58
|
const selectedSelectItems = useMemo(() => {
|
|
56
59
|
if (Array.isArray(selectedValues)) {
|
|
57
60
|
return new Map(GetSelectItemsFrom(selectPaneChildren, _ref2 => {
|
|
58
|
-
let
|
|
59
|
-
|
|
60
|
-
} = _ref2;
|
|
61
|
-
return _value == null || selectedValues.includes(_value);
|
|
61
|
+
let _value = _ref2.value;
|
|
62
|
+
return _value == null || _includesInstanceProperty(selectedValues).call(selectedValues, _value);
|
|
62
63
|
}));
|
|
63
64
|
}
|
|
64
65
|
return new Map(GetSelectItemsFrom(selectPaneChildren, _ref3 => {
|
|
65
|
-
let
|
|
66
|
-
value: _value
|
|
67
|
-
} = _ref3;
|
|
66
|
+
let _value = _ref3.value;
|
|
68
67
|
return _value == null || selectedValues === _value;
|
|
69
68
|
}));
|
|
70
69
|
}, [selectedValues, selectPaneChildren]);
|
|
71
70
|
const enabledSelectItems = useMemo(() => new Map(GetSelectItemsFrom(selectPaneChildren, _ref4 => {
|
|
72
|
-
let
|
|
73
|
-
isDisabled: _isDisabled
|
|
74
|
-
} = _ref4;
|
|
71
|
+
let _isDisabled = _ref4.isDisabled;
|
|
75
72
|
return !_isDisabled;
|
|
76
73
|
})), [selectPaneChildren]);
|
|
77
74
|
const onItemSelect = useCallback((_value, isSelected) => {
|