@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,6 @@
|
|
|
1
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
2
|
+
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
3
|
+
import _includesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
1
4
|
import * as React from 'react';
|
|
2
5
|
import { composeEventHandlers } from '../../primitive/dist/index.js';
|
|
3
6
|
import { composeRefs } from '../../react-compose-refs/dist/index.js';
|
|
@@ -8,28 +11,50 @@ import { createMenuScope, Root as Root3, Anchor as Anchor2, Portal, Content as C
|
|
|
8
11
|
import { useId } from '../../react-id/dist/index.js';
|
|
9
12
|
|
|
10
13
|
"use client";
|
|
14
|
+
const _excluded = ["__scopeDropdownMenu", "disabled"],
|
|
15
|
+
_excluded2 = ["__scopeDropdownMenu"],
|
|
16
|
+
_excluded3 = ["__scopeDropdownMenu"],
|
|
17
|
+
_excluded4 = ["__scopeDropdownMenu"],
|
|
18
|
+
_excluded5 = ["__scopeDropdownMenu"],
|
|
19
|
+
_excluded6 = ["__scopeDropdownMenu"],
|
|
20
|
+
_excluded7 = ["__scopeDropdownMenu"],
|
|
21
|
+
_excluded8 = ["__scopeDropdownMenu"],
|
|
22
|
+
_excluded9 = ["__scopeDropdownMenu"],
|
|
23
|
+
_excluded0 = ["__scopeDropdownMenu"],
|
|
24
|
+
_excluded1 = ["__scopeDropdownMenu"],
|
|
25
|
+
_excluded10 = ["__scopeDropdownMenu"],
|
|
26
|
+
_excluded11 = ["__scopeDropdownMenu"],
|
|
27
|
+
_excluded12 = ["__scopeDropdownMenu"];
|
|
11
28
|
var DROPDOWN_MENU_NAME = "DropdownMenu";
|
|
12
|
-
var
|
|
29
|
+
var _createContextScope = createContextScope(DROPDOWN_MENU_NAME, [createMenuScope]),
|
|
30
|
+
_createContextScope2 = _slicedToArray(_createContextScope, 2),
|
|
31
|
+
createDropdownMenuContext = _createContextScope2[0],
|
|
32
|
+
createDropdownMenuScope = _createContextScope2[1];
|
|
13
33
|
var useMenuScope = createMenuScope();
|
|
14
|
-
var
|
|
34
|
+
var _createDropdownMenuCo = createDropdownMenuContext(DROPDOWN_MENU_NAME),
|
|
35
|
+
_createDropdownMenuCo2 = _slicedToArray(_createDropdownMenuCo, 2),
|
|
36
|
+
DropdownMenuProvider = _createDropdownMenuCo2[0],
|
|
37
|
+
useDropdownMenuContext = _createDropdownMenuCo2[1];
|
|
15
38
|
var DropdownMenu = props => {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
modal = true
|
|
24
|
-
} = props;
|
|
39
|
+
const __scopeDropdownMenu = props.__scopeDropdownMenu,
|
|
40
|
+
children = props.children,
|
|
41
|
+
dir = props.dir,
|
|
42
|
+
openProp = props.open,
|
|
43
|
+
defaultOpen = props.defaultOpen,
|
|
44
|
+
onOpenChange = props.onOpenChange,
|
|
45
|
+
_props$modal = props.modal,
|
|
46
|
+
modal = _props$modal === void 0 ? true : _props$modal;
|
|
25
47
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
26
48
|
const triggerRef = React.useRef(null);
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
49
|
+
const _useControllableState = useControllableState({
|
|
50
|
+
prop: openProp,
|
|
51
|
+
defaultProp: defaultOpen !== null && defaultOpen !== void 0 ? defaultOpen : false,
|
|
52
|
+
onChange: onOpenChange,
|
|
53
|
+
caller: DROPDOWN_MENU_NAME
|
|
54
|
+
}),
|
|
55
|
+
_useControllableState2 = _slicedToArray(_useControllableState, 2),
|
|
56
|
+
open = _useControllableState2[0],
|
|
57
|
+
setOpen = _useControllableState2[1];
|
|
33
58
|
return /* @__PURE__ */React.createElement(DropdownMenuProvider, {
|
|
34
59
|
scope: __scopeDropdownMenu,
|
|
35
60
|
triggerId: useId(),
|
|
@@ -52,11 +77,10 @@ var DropdownMenu = props => {
|
|
|
52
77
|
DropdownMenu.displayName = DROPDOWN_MENU_NAME;
|
|
53
78
|
var TRIGGER_NAME = "DropdownMenuTrigger";
|
|
54
79
|
var DropdownMenuTrigger = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
disabled = false,
|
|
58
|
-
|
|
59
|
-
} = props;
|
|
80
|
+
const __scopeDropdownMenu = props.__scopeDropdownMenu,
|
|
81
|
+
_props$disabled = props.disabled,
|
|
82
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
83
|
+
triggerProps = _objectWithoutProperties(props, _excluded);
|
|
60
84
|
const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);
|
|
61
85
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
62
86
|
return /* @__PURE__ */React.createElement(Anchor2, {
|
|
@@ -80,10 +104,11 @@ var DropdownMenuTrigger = /*#__PURE__*/React.forwardRef((props, forwardedRef) =>
|
|
|
80
104
|
}
|
|
81
105
|
}),
|
|
82
106
|
onKeyDown: composeEventHandlers(props.onKeyDown, event => {
|
|
107
|
+
var _context, _context2;
|
|
83
108
|
if (disabled) return;
|
|
84
|
-
if (["Enter", " "].
|
|
109
|
+
if (_includesInstanceProperty(_context = ["Enter", " "]).call(_context, event.key)) context.onOpenToggle();
|
|
85
110
|
if (event.key === "ArrowDown") context.onOpenChange(true);
|
|
86
|
-
if (["Enter", " ", "ArrowDown"].
|
|
111
|
+
if (_includesInstanceProperty(_context2 = ["Enter", " ", "ArrowDown"]).call(_context2, event.key)) event.preventDefault();
|
|
87
112
|
})
|
|
88
113
|
})
|
|
89
114
|
});
|
|
@@ -91,10 +116,8 @@ var DropdownMenuTrigger = /*#__PURE__*/React.forwardRef((props, forwardedRef) =>
|
|
|
91
116
|
DropdownMenuTrigger.displayName = TRIGGER_NAME;
|
|
92
117
|
var PORTAL_NAME = "DropdownMenuPortal";
|
|
93
118
|
var DropdownMenuPortal = props => {
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
...portalProps
|
|
97
|
-
} = props;
|
|
119
|
+
const __scopeDropdownMenu = props.__scopeDropdownMenu,
|
|
120
|
+
portalProps = _objectWithoutProperties(props, _excluded2);
|
|
98
121
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
99
122
|
return /* @__PURE__ */React.createElement(Portal, {
|
|
100
123
|
...menuScope,
|
|
@@ -104,10 +127,8 @@ var DropdownMenuPortal = props => {
|
|
|
104
127
|
DropdownMenuPortal.displayName = PORTAL_NAME;
|
|
105
128
|
var CONTENT_NAME = "DropdownMenuContent";
|
|
106
129
|
var DropdownMenuContent = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
...contentProps
|
|
110
|
-
} = props;
|
|
130
|
+
const __scopeDropdownMenu = props.__scopeDropdownMenu,
|
|
131
|
+
contentProps = _objectWithoutProperties(props, _excluded3);
|
|
111
132
|
const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);
|
|
112
133
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
113
134
|
const hasInteractedOutsideRef = React.useRef(false);
|
|
@@ -145,10 +166,8 @@ var DropdownMenuContent = /*#__PURE__*/React.forwardRef((props, forwardedRef) =>
|
|
|
145
166
|
DropdownMenuContent.displayName = CONTENT_NAME;
|
|
146
167
|
var GROUP_NAME = "DropdownMenuGroup";
|
|
147
168
|
var DropdownMenuGroup = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
148
|
-
const
|
|
149
|
-
|
|
150
|
-
...groupProps
|
|
151
|
-
} = props;
|
|
169
|
+
const __scopeDropdownMenu = props.__scopeDropdownMenu,
|
|
170
|
+
groupProps = _objectWithoutProperties(props, _excluded4);
|
|
152
171
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
153
172
|
return /* @__PURE__ */React.createElement(Group, {
|
|
154
173
|
...menuScope,
|
|
@@ -159,10 +178,8 @@ var DropdownMenuGroup = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
159
178
|
DropdownMenuGroup.displayName = GROUP_NAME;
|
|
160
179
|
var LABEL_NAME = "DropdownMenuLabel";
|
|
161
180
|
var DropdownMenuLabel = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
...labelProps
|
|
165
|
-
} = props;
|
|
181
|
+
const __scopeDropdownMenu = props.__scopeDropdownMenu,
|
|
182
|
+
labelProps = _objectWithoutProperties(props, _excluded5);
|
|
166
183
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
167
184
|
return /* @__PURE__ */React.createElement(Label, {
|
|
168
185
|
...menuScope,
|
|
@@ -173,10 +190,8 @@ var DropdownMenuLabel = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
173
190
|
DropdownMenuLabel.displayName = LABEL_NAME;
|
|
174
191
|
var ITEM_NAME = "DropdownMenuItem";
|
|
175
192
|
var DropdownMenuItem = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
176
|
-
const
|
|
177
|
-
|
|
178
|
-
...itemProps
|
|
179
|
-
} = props;
|
|
193
|
+
const __scopeDropdownMenu = props.__scopeDropdownMenu,
|
|
194
|
+
itemProps = _objectWithoutProperties(props, _excluded6);
|
|
180
195
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
181
196
|
return /* @__PURE__ */React.createElement(Item2$1, {
|
|
182
197
|
...menuScope,
|
|
@@ -187,10 +202,8 @@ var DropdownMenuItem = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
187
202
|
DropdownMenuItem.displayName = ITEM_NAME;
|
|
188
203
|
var CHECKBOX_ITEM_NAME = "DropdownMenuCheckboxItem";
|
|
189
204
|
var DropdownMenuCheckboxItem = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
190
|
-
const
|
|
191
|
-
|
|
192
|
-
...checkboxItemProps
|
|
193
|
-
} = props;
|
|
205
|
+
const __scopeDropdownMenu = props.__scopeDropdownMenu,
|
|
206
|
+
checkboxItemProps = _objectWithoutProperties(props, _excluded7);
|
|
194
207
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
195
208
|
return /* @__PURE__ */React.createElement(CheckboxItem, {
|
|
196
209
|
...menuScope,
|
|
@@ -201,10 +214,8 @@ var DropdownMenuCheckboxItem = /*#__PURE__*/React.forwardRef((props, forwardedRe
|
|
|
201
214
|
DropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;
|
|
202
215
|
var RADIO_GROUP_NAME = "DropdownMenuRadioGroup";
|
|
203
216
|
var DropdownMenuRadioGroup = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
...radioGroupProps
|
|
207
|
-
} = props;
|
|
217
|
+
const __scopeDropdownMenu = props.__scopeDropdownMenu,
|
|
218
|
+
radioGroupProps = _objectWithoutProperties(props, _excluded8);
|
|
208
219
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
209
220
|
return /* @__PURE__ */React.createElement(RadioGroup, {
|
|
210
221
|
...menuScope,
|
|
@@ -215,10 +226,8 @@ var DropdownMenuRadioGroup = /*#__PURE__*/React.forwardRef((props, forwardedRef)
|
|
|
215
226
|
DropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME;
|
|
216
227
|
var RADIO_ITEM_NAME = "DropdownMenuRadioItem";
|
|
217
228
|
var DropdownMenuRadioItem = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
218
|
-
const
|
|
219
|
-
|
|
220
|
-
...radioItemProps
|
|
221
|
-
} = props;
|
|
229
|
+
const __scopeDropdownMenu = props.__scopeDropdownMenu,
|
|
230
|
+
radioItemProps = _objectWithoutProperties(props, _excluded9);
|
|
222
231
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
223
232
|
return /* @__PURE__ */React.createElement(RadioItem, {
|
|
224
233
|
...menuScope,
|
|
@@ -229,10 +238,8 @@ var DropdownMenuRadioItem = /*#__PURE__*/React.forwardRef((props, forwardedRef)
|
|
|
229
238
|
DropdownMenuRadioItem.displayName = RADIO_ITEM_NAME;
|
|
230
239
|
var INDICATOR_NAME = "DropdownMenuItemIndicator";
|
|
231
240
|
var DropdownMenuItemIndicator = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
232
|
-
const
|
|
233
|
-
|
|
234
|
-
...itemIndicatorProps
|
|
235
|
-
} = props;
|
|
241
|
+
const __scopeDropdownMenu = props.__scopeDropdownMenu,
|
|
242
|
+
itemIndicatorProps = _objectWithoutProperties(props, _excluded0);
|
|
236
243
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
237
244
|
return /* @__PURE__ */React.createElement(ItemIndicator, {
|
|
238
245
|
...menuScope,
|
|
@@ -243,10 +250,8 @@ var DropdownMenuItemIndicator = /*#__PURE__*/React.forwardRef((props, forwardedR
|
|
|
243
250
|
DropdownMenuItemIndicator.displayName = INDICATOR_NAME;
|
|
244
251
|
var SEPARATOR_NAME = "DropdownMenuSeparator";
|
|
245
252
|
var DropdownMenuSeparator = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
246
|
-
const
|
|
247
|
-
|
|
248
|
-
...separatorProps
|
|
249
|
-
} = props;
|
|
253
|
+
const __scopeDropdownMenu = props.__scopeDropdownMenu,
|
|
254
|
+
separatorProps = _objectWithoutProperties(props, _excluded1);
|
|
250
255
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
251
256
|
return /* @__PURE__ */React.createElement(Separator, {
|
|
252
257
|
...menuScope,
|
|
@@ -257,10 +262,8 @@ var DropdownMenuSeparator = /*#__PURE__*/React.forwardRef((props, forwardedRef)
|
|
|
257
262
|
DropdownMenuSeparator.displayName = SEPARATOR_NAME;
|
|
258
263
|
var ARROW_NAME = "DropdownMenuArrow";
|
|
259
264
|
var DropdownMenuArrow = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
260
|
-
const
|
|
261
|
-
|
|
262
|
-
...arrowProps
|
|
263
|
-
} = props;
|
|
265
|
+
const __scopeDropdownMenu = props.__scopeDropdownMenu,
|
|
266
|
+
arrowProps = _objectWithoutProperties(props, _excluded10);
|
|
264
267
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
265
268
|
return /* @__PURE__ */React.createElement(Arrow2$1, {
|
|
266
269
|
...menuScope,
|
|
@@ -270,20 +273,21 @@ var DropdownMenuArrow = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
270
273
|
});
|
|
271
274
|
DropdownMenuArrow.displayName = ARROW_NAME;
|
|
272
275
|
var DropdownMenuSub = props => {
|
|
273
|
-
const
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
defaultOpen
|
|
279
|
-
} = props;
|
|
276
|
+
const __scopeDropdownMenu = props.__scopeDropdownMenu,
|
|
277
|
+
children = props.children,
|
|
278
|
+
openProp = props.open,
|
|
279
|
+
onOpenChange = props.onOpenChange,
|
|
280
|
+
defaultOpen = props.defaultOpen;
|
|
280
281
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
281
|
-
const
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
282
|
+
const _useControllableState3 = useControllableState({
|
|
283
|
+
prop: openProp,
|
|
284
|
+
defaultProp: defaultOpen !== null && defaultOpen !== void 0 ? defaultOpen : false,
|
|
285
|
+
onChange: onOpenChange,
|
|
286
|
+
caller: "DropdownMenuSub"
|
|
287
|
+
}),
|
|
288
|
+
_useControllableState4 = _slicedToArray(_useControllableState3, 2),
|
|
289
|
+
open = _useControllableState4[0],
|
|
290
|
+
setOpen = _useControllableState4[1];
|
|
287
291
|
return /* @__PURE__ */React.createElement(Sub, {
|
|
288
292
|
...menuScope,
|
|
289
293
|
open,
|
|
@@ -293,10 +297,8 @@ var DropdownMenuSub = props => {
|
|
|
293
297
|
};
|
|
294
298
|
var SUB_TRIGGER_NAME = "DropdownMenuSubTrigger";
|
|
295
299
|
var DropdownMenuSubTrigger = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
296
|
-
const
|
|
297
|
-
|
|
298
|
-
...subTriggerProps
|
|
299
|
-
} = props;
|
|
300
|
+
const __scopeDropdownMenu = props.__scopeDropdownMenu,
|
|
301
|
+
subTriggerProps = _objectWithoutProperties(props, _excluded11);
|
|
300
302
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
301
303
|
return /* @__PURE__ */React.createElement(SubTrigger, {
|
|
302
304
|
...menuScope,
|
|
@@ -307,10 +309,8 @@ var DropdownMenuSubTrigger = /*#__PURE__*/React.forwardRef((props, forwardedRef)
|
|
|
307
309
|
DropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME;
|
|
308
310
|
var SUB_CONTENT_NAME = "DropdownMenuSubContent";
|
|
309
311
|
var DropdownMenuSubContent = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
310
|
-
const
|
|
311
|
-
|
|
312
|
-
...subContentProps
|
|
313
|
-
} = props;
|
|
312
|
+
const __scopeDropdownMenu = props.__scopeDropdownMenu,
|
|
313
|
+
subContentProps = _objectWithoutProperties(props, _excluded12);
|
|
314
314
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
315
315
|
return /* @__PURE__ */React.createElement(SubContent, {
|
|
316
316
|
...menuScope,
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
2
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
1
3
|
import * as React from 'react';
|
|
2
4
|
import { useComposedRefs } from '../../react-compose-refs/dist/index.js';
|
|
3
5
|
import { Primitive } from '../../react-primitive/dist/index.js';
|
|
4
6
|
import { useCallbackRef } from '../../react-use-callback-ref/dist/index.js';
|
|
5
7
|
|
|
6
8
|
"use client";
|
|
9
|
+
const _excluded = ["loop", "trapped", "onMountAutoFocus", "onUnmountAutoFocus"];
|
|
7
10
|
var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
8
11
|
var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
9
12
|
var EVENT_OPTIONS = {
|
|
@@ -12,14 +15,17 @@ var EVENT_OPTIONS = {
|
|
|
12
15
|
};
|
|
13
16
|
var FOCUS_SCOPE_NAME = "FocusScope";
|
|
14
17
|
var FocusScope = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
15
|
-
const
|
|
16
|
-
loop = false,
|
|
17
|
-
trapped =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const
|
|
18
|
+
const _props$loop = props.loop,
|
|
19
|
+
loop = _props$loop === void 0 ? false : _props$loop,
|
|
20
|
+
_props$trapped = props.trapped,
|
|
21
|
+
trapped = _props$trapped === void 0 ? false : _props$trapped,
|
|
22
|
+
onMountAutoFocusProp = props.onMountAutoFocus,
|
|
23
|
+
onUnmountAutoFocusProp = props.onUnmountAutoFocus,
|
|
24
|
+
scopeProps = _objectWithoutProperties(props, _excluded);
|
|
25
|
+
const _React$useState = React.useState(null),
|
|
26
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
27
|
+
container = _React$useState2[0],
|
|
28
|
+
setContainer = _React$useState2[1];
|
|
23
29
|
const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
|
|
24
30
|
const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
|
|
25
31
|
const lastFocusedElementRef = React.useRef(null);
|
|
@@ -122,7 +128,10 @@ var FocusScope = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
122
128
|
const focusedElement = document.activeElement;
|
|
123
129
|
if (isTabKey && focusedElement) {
|
|
124
130
|
const container2 = event.currentTarget;
|
|
125
|
-
const
|
|
131
|
+
const _getTabbableEdges = getTabbableEdges(container2),
|
|
132
|
+
_getTabbableEdges2 = _slicedToArray(_getTabbableEdges, 2),
|
|
133
|
+
first = _getTabbableEdges2[0],
|
|
134
|
+
last = _getTabbableEdges2[1];
|
|
126
135
|
const hasTabbableElementsInside = first && last;
|
|
127
136
|
if (!hasTabbableElementsInside) {
|
|
128
137
|
if (focusedElement === container2) event.preventDefault();
|
|
@@ -150,9 +159,9 @@ var FocusScope = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
150
159
|
});
|
|
151
160
|
FocusScope.displayName = FOCUS_SCOPE_NAME;
|
|
152
161
|
function focusFirst(candidates) {
|
|
153
|
-
let {
|
|
154
|
-
select =
|
|
155
|
-
|
|
162
|
+
let _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
163
|
+
_ref$select = _ref.select,
|
|
164
|
+
select = _ref$select === void 0 ? false : _ref$select;
|
|
156
165
|
const previouslyFocusedElement = document.activeElement;
|
|
157
166
|
for (const candidate of candidates) {
|
|
158
167
|
focus(candidate, {
|
|
@@ -186,10 +195,8 @@ function findVisible(elements, container) {
|
|
|
186
195
|
})) return element;
|
|
187
196
|
}
|
|
188
197
|
}
|
|
189
|
-
function isHidden(node,
|
|
190
|
-
let
|
|
191
|
-
upTo
|
|
192
|
-
} = _ref;
|
|
198
|
+
function isHidden(node, _ref2) {
|
|
199
|
+
let upTo = _ref2.upTo;
|
|
193
200
|
if (getComputedStyle(node).visibility === "hidden") return true;
|
|
194
201
|
while (node) {
|
|
195
202
|
if (upTo !== void 0 && node === upTo) return false;
|
|
@@ -202,9 +209,9 @@ function isSelectableInput(element) {
|
|
|
202
209
|
return element instanceof HTMLInputElement && "select" in element;
|
|
203
210
|
}
|
|
204
211
|
function focus(element) {
|
|
205
|
-
let {
|
|
206
|
-
select =
|
|
207
|
-
|
|
212
|
+
let _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
213
|
+
_ref3$select = _ref3.select,
|
|
214
|
+
select = _ref3$select === void 0 ? false : _ref3$select;
|
|
208
215
|
if (element && element.focus) {
|
|
209
216
|
const previouslyFocusedElement = document.activeElement;
|
|
210
217
|
element.focus({
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { useLayoutEffect as useLayoutEffect2 } from '../../react-use-layout-effect/dist/index.js';
|
|
3
4
|
|
|
4
|
-
// packages/react/id/src/id.tsx
|
|
5
5
|
var useReactId = React[" useId ".trim().toString()] || (() => void 0);
|
|
6
6
|
var count = 0;
|
|
7
7
|
function useId(deterministicId) {
|
|
8
|
-
const
|
|
8
|
+
const _React$useState = React.useState(useReactId()),
|
|
9
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
10
|
+
id = _React$useState2[0],
|
|
11
|
+
setId = _React$useState2[1];
|
|
9
12
|
useLayoutEffect2(() => {
|
|
10
13
|
if (!deterministicId) setId(reactId => reactId !== null && reactId !== void 0 ? reactId : String(count++));
|
|
11
14
|
}, [deterministicId]);
|