@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
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
2
|
+
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
3
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
2
4
|
import React__default, { forwardRef, useRef, useState, useEffect } from 'react';
|
|
3
5
|
import classNames from 'classnames';
|
|
4
6
|
import styles from './Dropdown2.js';
|
|
@@ -14,56 +16,60 @@ import wrapEvent from '../../utils/wrapEvent/wrapEvent.js';
|
|
|
14
16
|
import getSubDataTestId from '../../utils/getSubDataTestId/getSubDataTestId.js';
|
|
15
17
|
import ChevronDownIcon from '../../icons/components/ChevronDownIcon.js';
|
|
16
18
|
|
|
19
|
+
const _excluded = ["children", "className", "disabled", "isInvalid", "defaultLabel", "label", "onLabelChange", "onKeyDown", "onClick", "onFocus", "onBlur", "aria-labelledby", "aria-label", "aria-describedby", "data-testid"];
|
|
17
20
|
const DropdownButton = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
18
21
|
var _ref2, _children$props$aria, _children$props3, _ref3, _children$props$aria2, _children$props4, _childProps$tabIndex, _childProps$role;
|
|
19
|
-
let
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
defaultLabel = '',
|
|
25
|
-
label
|
|
26
|
-
onLabelChange,
|
|
27
|
-
onKeyDown,
|
|
28
|
-
onClick,
|
|
29
|
-
onFocus,
|
|
30
|
-
onBlur,
|
|
31
|
-
'aria-labelledby'
|
|
32
|
-
'aria-label'
|
|
33
|
-
'aria-describedby'
|
|
34
|
-
'data-testid'
|
|
35
|
-
|
|
36
|
-
} = _ref;
|
|
22
|
+
let children = _ref.children,
|
|
23
|
+
className = _ref.className,
|
|
24
|
+
disabled = _ref.disabled,
|
|
25
|
+
isInvalidProp = _ref.isInvalid,
|
|
26
|
+
_ref$defaultLabel = _ref.defaultLabel,
|
|
27
|
+
defaultLabel = _ref$defaultLabel === void 0 ? '' : _ref$defaultLabel,
|
|
28
|
+
externalLabel = _ref.label,
|
|
29
|
+
onLabelChange = _ref.onLabelChange,
|
|
30
|
+
onKeyDown = _ref.onKeyDown,
|
|
31
|
+
onClick = _ref.onClick,
|
|
32
|
+
onFocus = _ref.onFocus,
|
|
33
|
+
onBlur = _ref.onBlur,
|
|
34
|
+
externalAriaLabelledBy = _ref['aria-labelledby'],
|
|
35
|
+
externalAriaLabel = _ref['aria-label'],
|
|
36
|
+
externalAriaDescribedBy = _ref['aria-describedby'],
|
|
37
|
+
dataTestId = _ref['data-testid'],
|
|
38
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
37
39
|
const buttonRef = useRef(null);
|
|
38
|
-
const
|
|
39
|
-
isOpen,
|
|
40
|
-
options,
|
|
41
|
-
setMinWidth,
|
|
42
|
-
setIsOpen,
|
|
43
|
-
disabled
|
|
44
|
-
isInvalid
|
|
45
|
-
buttonRef
|
|
46
|
-
onKeyDownButton,
|
|
47
|
-
selectedIndex,
|
|
48
|
-
setHighlightedIndex,
|
|
49
|
-
listboxId,
|
|
50
|
-
buttonId,
|
|
51
|
-
buttonLabelId,
|
|
52
|
-
isSearchable,
|
|
53
|
-
ariaLabelledBy
|
|
54
|
-
ariaLabel
|
|
55
|
-
ariaDescribedby
|
|
56
|
-
dataTestId
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
40
|
+
const _useDropdownContext = useDropdownContext(),
|
|
41
|
+
isOpen = _useDropdownContext.isOpen,
|
|
42
|
+
options = _useDropdownContext.options,
|
|
43
|
+
setMinWidth = _useDropdownContext.setMinWidth,
|
|
44
|
+
setIsOpen = _useDropdownContext.setIsOpen,
|
|
45
|
+
dropdownAriaDisabled = _useDropdownContext.disabled,
|
|
46
|
+
dropdownIsInvalid = _useDropdownContext.isInvalid,
|
|
47
|
+
dropdownButtonRef = _useDropdownContext.buttonRef,
|
|
48
|
+
onKeyDownButton = _useDropdownContext.onKeyDownButton,
|
|
49
|
+
selectedIndex = _useDropdownContext.selectedIndex,
|
|
50
|
+
setHighlightedIndex = _useDropdownContext.setHighlightedIndex,
|
|
51
|
+
listboxId = _useDropdownContext.listboxId,
|
|
52
|
+
buttonId = _useDropdownContext.buttonId,
|
|
53
|
+
buttonLabelId = _useDropdownContext.buttonLabelId,
|
|
54
|
+
isSearchable = _useDropdownContext.isSearchable,
|
|
55
|
+
dropdownAriaLabelledBy = _useDropdownContext.ariaLabelledBy,
|
|
56
|
+
dropdownAriaLabel = _useDropdownContext.ariaLabel,
|
|
57
|
+
dropdownAriaDescribedby = _useDropdownContext.ariaDescribedby,
|
|
58
|
+
contextDataTestId = _useDropdownContext.dataTestId;
|
|
59
|
+
const _useControllableState = useControllableState(defaultLabel,
|
|
60
|
+
// will get updated in effect
|
|
61
|
+
onLabelChange, externalLabel),
|
|
62
|
+
_useControllableState2 = _slicedToArray(_useControllableState, 2),
|
|
63
|
+
label = _useControllableState2[0],
|
|
64
|
+
setLabel = _useControllableState2[1];
|
|
65
|
+
const _useState = useState(false),
|
|
66
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
67
|
+
isOptionSelected = _useState2[0],
|
|
68
|
+
setIsOptionSelected = _useState2[1];
|
|
69
|
+
const _useFormFieldControl = useFormFieldControl(),
|
|
70
|
+
hasFormLabel = _useFormFieldControl.hasLabel,
|
|
71
|
+
formFieldHelperTextId = _useFormFieldControl.helperTextId,
|
|
72
|
+
formFieldErrorTextId = _useFormFieldControl.errorTextId;
|
|
67
73
|
const ariaLabelledBy = (_children$props => {
|
|
68
74
|
if (children !== null && children !== void 0 && (_children$props = children.props) !== null && _children$props !== void 0 && _children$props['aria-labelledby']) {
|
|
69
75
|
var _children$props2;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import '../../utils/index.js';
|
|
2
2
|
import createContextUtilities from '../../utils/createContextUtilities/createContextUtilities.js';
|
|
3
3
|
|
|
4
|
-
const {
|
|
5
|
-
useContext
|
|
6
|
-
Provider
|
|
7
|
-
} = createContextUtilities({});
|
|
4
|
+
const _createContextUtiliti = createContextUtilities({}),
|
|
5
|
+
useDropdownContext = _createContextUtiliti.useContext,
|
|
6
|
+
DropdownContextProvider = _createContextUtiliti.Provider;
|
|
8
7
|
|
|
9
8
|
export { DropdownContextProvider, useDropdownContext };
|
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
2
|
+
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
3
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
2
4
|
import React__default, { useState, useMemo } from 'react';
|
|
3
5
|
import '../../utils/index.js';
|
|
4
6
|
import { DropdownHeaderContextProvider } from './DropdownHeaderContext.js';
|
|
5
7
|
import { useDropdownContext } from './DropdownContext.js';
|
|
6
8
|
import { FlyoutHeader } from '../../utils/Flyout/FlyoutHeader.js';
|
|
7
9
|
|
|
10
|
+
const _excluded = ["title", "children"];
|
|
8
11
|
const DropdownHeader = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
9
|
-
let
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
...rest
|
|
13
|
-
} = _ref;
|
|
12
|
+
let title = _ref.title,
|
|
13
|
+
children = _ref.children,
|
|
14
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
14
15
|
const commonProps = {
|
|
15
16
|
...rest,
|
|
16
17
|
ref
|
|
17
18
|
};
|
|
18
|
-
const
|
|
19
|
-
searchValue
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
const _useDropdownContext = useDropdownContext(),
|
|
20
|
+
searchValue = _useDropdownContext.searchValue;
|
|
21
|
+
const _useState = useState(new Set()),
|
|
22
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
23
|
+
visibleChildIds = _useState2[0],
|
|
24
|
+
setVisibleChildIds = _useState2[1];
|
|
22
25
|
const isVisible = useMemo(() => !searchValue || searchValue && visibleChildIds.size > 0, [visibleChildIds, searchValue]);
|
|
23
26
|
return /*#__PURE__*/React__default.createElement(DropdownHeaderContextProvider, {
|
|
24
27
|
value: {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import '../../utils/index.js';
|
|
2
2
|
import createContextUtilities from '../../utils/createContextUtilities/createContextUtilities.js';
|
|
3
3
|
|
|
4
|
-
const {
|
|
5
|
-
useContext
|
|
6
|
-
Provider
|
|
7
|
-
} = createContextUtilities({});
|
|
4
|
+
const _createContextUtiliti = createContextUtilities({}),
|
|
5
|
+
useDropdownHeaderContext = _createContextUtiliti.useContext,
|
|
6
|
+
DropdownHeaderContextProvider = _createContextUtiliti.Provider;
|
|
8
7
|
|
|
9
8
|
export { DropdownHeaderContextProvider, useDropdownHeaderContext };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
2
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
2
3
|
import React__default, { useMemo } from 'react';
|
|
3
4
|
import '../../utils/index.js';
|
|
4
5
|
import { useDropdownContext } from './DropdownContext.js';
|
|
@@ -15,40 +16,39 @@ import { Flyout } from '../../utils/Flyout/Flyout.js';
|
|
|
15
16
|
import mergeRefs from '../../utils/mergeRefs/mergeRefs.js';
|
|
16
17
|
import getSubDataTestId from '../../utils/getSubDataTestId/getSubDataTestId.js';
|
|
17
18
|
|
|
19
|
+
const _excluded = ["children", "placement", "onKeyDown", "portalTarget", "private_offset", "style", "aria-label", "aria-labelledby", "data-testid"];
|
|
18
20
|
const DropdownList = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
19
21
|
var _ref2;
|
|
20
|
-
let
|
|
21
|
-
|
|
22
|
-
placement = 'bottom-start',
|
|
23
|
-
onKeyDown,
|
|
24
|
-
portalTarget,
|
|
25
|
-
private_offset
|
|
26
|
-
|
|
27
|
-
style =
|
|
28
|
-
|
|
29
|
-
'aria-
|
|
30
|
-
'
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
isOpen,
|
|
35
|
-
buttonRef,
|
|
36
|
-
buttonId,
|
|
37
|
-
minWidth,
|
|
38
|
-
listRef,
|
|
39
|
-
dialogId,
|
|
40
|
-
listboxId,
|
|
41
|
-
onKeyDownList,
|
|
42
|
-
isMultiSelect,
|
|
43
|
-
isSearchable,
|
|
44
|
-
options,
|
|
45
|
-
ariaLabel
|
|
46
|
-
ariaLabelledBy
|
|
47
|
-
dataTestId
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
translate
|
|
51
|
-
} = useTranslation();
|
|
22
|
+
let children = _ref.children,
|
|
23
|
+
_ref$placement = _ref.placement,
|
|
24
|
+
placement = _ref$placement === void 0 ? 'bottom-start' : _ref$placement,
|
|
25
|
+
onKeyDown = _ref.onKeyDown,
|
|
26
|
+
portalTarget = _ref.portalTarget,
|
|
27
|
+
_ref$private_offset = _ref.private_offset,
|
|
28
|
+
popperOffset = _ref$private_offset === void 0 ? FLYOUT_POPPER_OFFSET : _ref$private_offset,
|
|
29
|
+
_ref$style = _ref.style,
|
|
30
|
+
style = _ref$style === void 0 ? {} : _ref$style,
|
|
31
|
+
externalAriaLabel = _ref['aria-label'],
|
|
32
|
+
externalAriaLabelledBy = _ref['aria-labelledby'],
|
|
33
|
+
dataTestId = _ref['data-testid'],
|
|
34
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
35
|
+
const _useDropdownContext = useDropdownContext(),
|
|
36
|
+
isOpen = _useDropdownContext.isOpen,
|
|
37
|
+
buttonRef = _useDropdownContext.buttonRef,
|
|
38
|
+
buttonId = _useDropdownContext.buttonId,
|
|
39
|
+
minWidth = _useDropdownContext.minWidth,
|
|
40
|
+
listRef = _useDropdownContext.listRef,
|
|
41
|
+
dialogId = _useDropdownContext.dialogId,
|
|
42
|
+
listboxId = _useDropdownContext.listboxId,
|
|
43
|
+
onKeyDownList = _useDropdownContext.onKeyDownList,
|
|
44
|
+
isMultiSelect = _useDropdownContext.isMultiSelect,
|
|
45
|
+
isSearchable = _useDropdownContext.isSearchable,
|
|
46
|
+
options = _useDropdownContext.options,
|
|
47
|
+
ariaLabelFromContext = _useDropdownContext.ariaLabel,
|
|
48
|
+
ariaLabelledByFromContext = _useDropdownContext.ariaLabelledBy,
|
|
49
|
+
contextDataTestId = _useDropdownContext.dataTestId;
|
|
50
|
+
const _useTranslation = useTranslation(),
|
|
51
|
+
translate = _useTranslation.translate;
|
|
52
52
|
const noMatchesText = useMemo(() => isSearchable && translate('noMatchesFound'), [isSearchable, translate]);
|
|
53
53
|
const ariaLabelledby = (_ref2 = externalAriaLabelledBy !== null && externalAriaLabelledBy !== void 0 ? externalAriaLabelledBy : ariaLabelledByFromContext) !== null && _ref2 !== void 0 ? _ref2 : buttonId;
|
|
54
54
|
const ariaLabel = externalAriaLabel !== null && externalAriaLabel !== void 0 ? externalAriaLabel : ariaLabelFromContext;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
2
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
3
|
+
import _includesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
2
4
|
import React__default, { useRef, useMemo, useEffect, useCallback } from 'react';
|
|
3
5
|
import classNames from 'classnames';
|
|
4
6
|
import styles from './Dropdown2.js';
|
|
@@ -11,37 +13,37 @@ import wrapEvent from '../../utils/wrapEvent/wrapEvent.js';
|
|
|
11
13
|
import { FlyoutOption } from '../../utils/Flyout/FlyoutOption.js';
|
|
12
14
|
import mergeRefs from '../../utils/mergeRefs/mergeRefs.js';
|
|
13
15
|
|
|
16
|
+
const _excluded = ["children", "value", "label", "onSelect", "onMouseDown", "onMouseEnter", "onMouseLeave", "disabled", "className"];
|
|
14
17
|
const DropdownOption = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
...rest
|
|
26
|
-
} = _ref;
|
|
18
|
+
let children = _ref.children,
|
|
19
|
+
value = _ref.value,
|
|
20
|
+
label = _ref.label,
|
|
21
|
+
onSelect = _ref.onSelect,
|
|
22
|
+
onMouseDown = _ref.onMouseDown,
|
|
23
|
+
onMouseEnter = _ref.onMouseEnter,
|
|
24
|
+
onMouseLeave = _ref.onMouseLeave,
|
|
25
|
+
disabled = _ref.disabled,
|
|
26
|
+
className = _ref.className,
|
|
27
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
27
28
|
const internalRef = useRef(null);
|
|
28
|
-
const
|
|
29
|
-
isOpen,
|
|
30
|
-
isMultiSelect,
|
|
31
|
-
highlightedIndex,
|
|
32
|
-
value
|
|
33
|
-
onOptionSelected,
|
|
34
|
-
setHighlightedIndex,
|
|
35
|
-
listRef,
|
|
36
|
-
searchValue,
|
|
37
|
-
isSearchFilteringDisabled,
|
|
38
|
-
isSearchable,
|
|
39
|
-
searchHeight
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
29
|
+
const _useDropdownContext = useDropdownContext(),
|
|
30
|
+
isOpen = _useDropdownContext.isOpen,
|
|
31
|
+
isMultiSelect = _useDropdownContext.isMultiSelect,
|
|
32
|
+
highlightedIndex = _useDropdownContext.highlightedIndex,
|
|
33
|
+
selectedValue = _useDropdownContext.value,
|
|
34
|
+
onOptionSelected = _useDropdownContext.onOptionSelected,
|
|
35
|
+
setHighlightedIndex = _useDropdownContext.setHighlightedIndex,
|
|
36
|
+
listRef = _useDropdownContext.listRef,
|
|
37
|
+
searchValue = _useDropdownContext.searchValue,
|
|
38
|
+
isSearchFilteringDisabled = _useDropdownContext.isSearchFilteringDisabled,
|
|
39
|
+
isSearchable = _useDropdownContext.isSearchable,
|
|
40
|
+
searchHeight = _useDropdownContext.searchHeight;
|
|
41
|
+
const _useDropdownHeaderCon = useDropdownHeaderContext(),
|
|
42
|
+
setVisibleChildIds = _useDropdownHeaderCon.setVisibleChildIds;
|
|
43
|
+
const isVisible = useMemo(() => {
|
|
44
|
+
var _context;
|
|
45
|
+
return isSearchFilteringDisabled || !label || !searchValue || typeof label === 'string' && _includesInstanceProperty(_context = label.toLowerCase()).call(_context, searchValue.toLowerCase());
|
|
46
|
+
}, [isSearchFilteringDisabled, label, searchValue]);
|
|
45
47
|
useEffect(() => {
|
|
46
48
|
setVisibleChildIds === null || setVisibleChildIds === void 0 || setVisibleChildIds(visibleChildIds => {
|
|
47
49
|
const duplicateSet = new Set(visibleChildIds);
|
|
@@ -52,7 +54,7 @@ const DropdownOption = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
52
54
|
return duplicateSet;
|
|
53
55
|
});
|
|
54
56
|
}, [setVisibleChildIds, isVisible, value]);
|
|
55
|
-
const isSelected = Array.isArray(selectedValue) ? selectedValue.
|
|
57
|
+
const isSelected = Array.isArray(selectedValue) ? _includesInstanceProperty(selectedValue).call(selectedValue, value) : value === selectedValue;
|
|
56
58
|
const handleSelect = useCallback(e => {
|
|
57
59
|
if (!disabled) {
|
|
58
60
|
const handler = wrapEvent(onSelect, () => onOptionSelected(value));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _includesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
1
2
|
import React__default, { useRef, useMemo, useEffect } from 'react';
|
|
2
3
|
import styles from './Dropdown2.js';
|
|
3
4
|
import '../../utils/index.js';
|
|
@@ -11,23 +12,20 @@ import Input from '../../next/Input/Input.js';
|
|
|
11
12
|
import SearchIcon from '../../icons/components/SearchIcon.js';
|
|
12
13
|
import getSubDataTestId from '../../utils/getSubDataTestId/getSubDataTestId.js';
|
|
13
14
|
|
|
14
|
-
/* eslint-disable no-nested-ternary */
|
|
15
15
|
const DropdownSearch = /*#__PURE__*/React__default.forwardRef((_, ref) => {
|
|
16
|
-
const
|
|
17
|
-
translate
|
|
18
|
-
} = useTranslation();
|
|
16
|
+
const _useTranslation = useTranslation(),
|
|
17
|
+
translate = _useTranslation.translate;
|
|
19
18
|
const searchText = translate('searchText');
|
|
20
19
|
const internalRef = useRef(null);
|
|
21
20
|
const inputRef = useRef(null);
|
|
22
|
-
const
|
|
23
|
-
isOpen,
|
|
24
|
-
highlightedIndex,
|
|
25
|
-
setHighlightedIndex,
|
|
26
|
-
searchValue,
|
|
27
|
-
setSearchValue,
|
|
28
|
-
setSearchHeight,
|
|
29
|
-
dataTestId
|
|
30
|
-
} = useDropdownContext();
|
|
21
|
+
const _useDropdownContext = useDropdownContext(),
|
|
22
|
+
isOpen = _useDropdownContext.isOpen,
|
|
23
|
+
highlightedIndex = _useDropdownContext.highlightedIndex,
|
|
24
|
+
setHighlightedIndex = _useDropdownContext.setHighlightedIndex,
|
|
25
|
+
searchValue = _useDropdownContext.searchValue,
|
|
26
|
+
setSearchValue = _useDropdownContext.setSearchValue,
|
|
27
|
+
setSearchHeight = _useDropdownContext.setSearchHeight,
|
|
28
|
+
dataTestId = _useDropdownContext.dataTestId;
|
|
31
29
|
const handleSelect = () => {
|
|
32
30
|
var _inputRef$current;
|
|
33
31
|
return (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
@@ -61,7 +59,7 @@ const DropdownSearch = /*#__PURE__*/React__default.forwardRef((_, ref) => {
|
|
|
61
59
|
}, [isOpen, setSearchHeight]);
|
|
62
60
|
const handleKeyDown = e => {
|
|
63
61
|
const keysToAllow = ['ArrowDown', 'Escape', 'Tab', 'PageUp', 'Home', 'PageDown', 'End'];
|
|
64
|
-
if (!keysToAllow.
|
|
62
|
+
if (!_includesInstanceProperty(keysToAllow).call(keysToAllow, e.key)) {
|
|
65
63
|
// `Dropdown` component listens for keystrokes to highlight options with matching labels. We want the focus to remain in the search bar.
|
|
66
64
|
e.stopPropagation();
|
|
67
65
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
2
|
+
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
3
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
2
4
|
import React__default, { useState, useRef } from 'react';
|
|
3
5
|
import classNames from 'classnames';
|
|
4
6
|
import filePickerStyles from './FilePicker2.js';
|
|
@@ -14,11 +16,10 @@ import concatIds from '../../utils/concatIds/concatIds.js';
|
|
|
14
16
|
import { Button } from '../Button/Button2.js';
|
|
15
17
|
import mergeRefs from '../../utils/mergeRefs/mergeRefs.js';
|
|
16
18
|
|
|
19
|
+
const _excluded = ["className", "disabled", "files", "multiple", "onChange", "aria-label", "aria-labelledby", "aria-describedby", "id"];
|
|
17
20
|
const FileDetails = _ref => {
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
id
|
|
21
|
-
} = _ref;
|
|
21
|
+
let files = _ref.files,
|
|
22
|
+
id = _ref.id;
|
|
22
23
|
if (files) {
|
|
23
24
|
return /*#__PURE__*/React__default.createElement("span", {
|
|
24
25
|
className: filePickerStyles.fileDetails,
|
|
@@ -31,23 +32,28 @@ const FileDetails = _ref => {
|
|
|
31
32
|
return null;
|
|
32
33
|
};
|
|
33
34
|
const FilePicker = /*#__PURE__*/React__default.forwardRef((_ref2, ref) => {
|
|
34
|
-
let
|
|
35
|
-
|
|
36
|
-
disabled = false,
|
|
37
|
-
files
|
|
38
|
-
multiple =
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
'aria-
|
|
42
|
-
'aria-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
translate
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
35
|
+
let className = _ref2.className,
|
|
36
|
+
_ref2$disabled = _ref2.disabled,
|
|
37
|
+
disabled = _ref2$disabled === void 0 ? false : _ref2$disabled,
|
|
38
|
+
externalFiles = _ref2.files,
|
|
39
|
+
_ref2$multiple = _ref2.multiple,
|
|
40
|
+
multiple = _ref2$multiple === void 0 ? false : _ref2$multiple,
|
|
41
|
+
onChange = _ref2.onChange,
|
|
42
|
+
externalAriaLabel = _ref2['aria-label'],
|
|
43
|
+
externalAriaLabelledBy = _ref2['aria-labelledby'],
|
|
44
|
+
externalAriaDescribedBy = _ref2['aria-describedby'],
|
|
45
|
+
externalId = _ref2.id,
|
|
46
|
+
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
47
|
+
const _useTranslation = useTranslation(),
|
|
48
|
+
translate = _useTranslation.translate;
|
|
49
|
+
const _useState = useState(false),
|
|
50
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
51
|
+
filesChanged = _useState2[0],
|
|
52
|
+
setFilesChanged = _useState2[1];
|
|
53
|
+
const _useControllableState = useControllableState(undefined, undefined, externalFiles),
|
|
54
|
+
_useControllableState2 = _slicedToArray(_useControllableState, 2),
|
|
55
|
+
files = _useControllableState2[0],
|
|
56
|
+
setFiles = _useControllableState2[1];
|
|
51
57
|
const fileInputId = useId(externalId);
|
|
52
58
|
const fileDetailsId = "".concat(fileInputId, "-fileDetails");
|
|
53
59
|
const buttonId = "".concat(fileInputId, "-button");
|
|
@@ -55,10 +61,9 @@ const FilePicker = /*#__PURE__*/React__default.forwardRef((_ref2, ref) => {
|
|
|
55
61
|
const buttonRef = useRef(null);
|
|
56
62
|
|
|
57
63
|
// TODO: Replace this with `useFormFieldControl` and add proper styling (this is a breaking change)
|
|
58
|
-
const
|
|
59
|
-
helperTextId
|
|
60
|
-
errorTextId
|
|
61
|
-
} = useFormFieldContext();
|
|
64
|
+
const _useFormFieldContext = useFormFieldContext(),
|
|
65
|
+
formFieldHelperTextId = _useFormFieldContext.helperTextId,
|
|
66
|
+
formFieldErrorTextId = _useFormFieldContext.errorTextId;
|
|
62
67
|
|
|
63
68
|
// returns focus to input after closing system dialog
|
|
64
69
|
useDidUpdate(() => {
|
|
@@ -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 filePickerStyles = {"container":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._FMnN6{position:relative}._FMnN6[focus-within] button{outline:none;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._FMnN6:focus-within button{outline:none;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._fCIeB{opacity:0;position:absolute;height:36px;width:100%;left:0;z-index:-1}._uaeg2{margin-left:16px;font-size:14px;color:#32363a}._uaeg2 ._fpKtz{margin-right:16px}";
|
|
4
|
+
var filePickerStyles = {"container":"_FMnN6","fileInput":"_fCIeB","fileDetails":"_uaeg2","fileName":"_fpKtz"};
|
|
5
|
+
var stylesheet="._FMnN6{position:relative}._FMnN6[focus-within] button{outline:none;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._FMnN6:focus-within button{outline:none;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._fCIeB{opacity:0;position:absolute;height:36px;width:100%;left:0;z-index:-1}._uaeg2{margin-left:16px;font-size:14px;color:#32363a}._uaeg2 ._fpKtz{margin-right:16px}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { filePickerStyles as default, stylesheet };
|
|
@@ -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 = {"caption":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._tfvl7{display:flex;align-items:center;font-size:12px;line-height:16px;min-height:16px}._hhbQU{color:#6a6d70;fill:#6a6d70}._1d5TH{color:#b00;fill:#b00}._asfja,._gnLTr{margin-left:-2px;margin-right:3px}";
|
|
4
|
+
var styles = {"caption":"_tfvl7","helperText":"_hhbQU","errorText":"_1d5TH","errorIcon":"_gnLTr","readOnlyIcon":"_asfja"};
|
|
5
|
+
var stylesheet="._tfvl7{display:flex;align-items:center;font-size:12px;line-height:16px;min-height:16px}._hhbQU{color:#6a6d70;fill:#6a6d70}._1d5TH{color:#b00;fill:#b00}._asfja,._gnLTr{margin-left:-2px;margin-right:3px}";
|
|
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,16 +1,16 @@
|
|
|
1
1
|
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
2
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
2
3
|
import React__default from 'react';
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
import styles from './Caption.js';
|
|
5
6
|
import '../../icons/index.es.js';
|
|
6
7
|
import ErrorIcon from '../../icons/components/ErrorIcon.js';
|
|
7
8
|
|
|
9
|
+
const _excluded = ["children", "className"];
|
|
8
10
|
const ErrorText = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
9
|
-
let
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
...rest
|
|
13
|
-
} = _ref;
|
|
11
|
+
let children = _ref.children,
|
|
12
|
+
className = _ref.className,
|
|
13
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
14
14
|
const classes = classNames(className, styles.caption, styles.errorText);
|
|
15
15
|
return /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
|
16
16
|
ref: ref,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
2
|
+
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
3
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
2
4
|
import React__default, { useState } from 'react';
|
|
3
5
|
import classNames from 'classnames';
|
|
4
6
|
import styles from './FormField2.js';
|
|
@@ -13,21 +15,32 @@ import useId from '../../hooks/useId/useId.js';
|
|
|
13
15
|
import mergeRefs from '../../utils/mergeRefs/mergeRefs.js';
|
|
14
16
|
import getSubDataTestId from '../../utils/getSubDataTestId/getSubDataTestId.js';
|
|
15
17
|
|
|
18
|
+
const _excluded = ["children", "className", "errorText", "helperText", "isReadOnly", "id", "data-testid"];
|
|
16
19
|
const FormField = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
17
|
-
let
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
20
|
+
let children = _ref.children,
|
|
21
|
+
className = _ref.className,
|
|
22
|
+
errorText = _ref.errorText,
|
|
23
|
+
helperText = _ref.helperText,
|
|
24
|
+
isReadOnly = _ref.isReadOnly,
|
|
25
|
+
externalId = _ref.id,
|
|
26
|
+
rootDataTestId = _ref['data-testid'],
|
|
27
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
28
|
+
const _useIsFocused = useIsFocused(),
|
|
29
|
+
_useIsFocused2 = _slicedToArray(_useIsFocused, 2),
|
|
30
|
+
focusRef = _useIsFocused2[0],
|
|
31
|
+
isFocused = _useIsFocused2[1];
|
|
32
|
+
const _useState = useState(false),
|
|
33
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
34
|
+
hasControl = _useState2[0],
|
|
35
|
+
setHasControl = _useState2[1];
|
|
36
|
+
const _useState3 = useState(false),
|
|
37
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
38
|
+
hasLabel = _useState4[0],
|
|
39
|
+
setHasLabel = _useState4[1];
|
|
40
|
+
const _useState5 = useState(''),
|
|
41
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
42
|
+
formFieldType = _useState6[0],
|
|
43
|
+
setFormFieldType = _useState6[1];
|
|
31
44
|
const containerId = useId(externalId);
|
|
32
45
|
const helperTextId = helperText ? "".concat(containerId, "-helper-text") : undefined;
|
|
33
46
|
const errorTextId = errorText ? "".concat(containerId, "-error-text") : undefined;
|
|
@@ -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 = {"formField":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._RxdBO{display:flex;flex-direction:column;align-items:flex-start}._8-FQg{margin-top:6px;max-width:100%}._8-FQg *+*{margin-top:4px}";
|
|
4
|
+
var styles = {"formField":"_RxdBO","captionContainer":"_8-FQg"};
|
|
5
|
+
var stylesheet="._RxdBO{display:flex;flex-direction:column;align-items:flex-start}._8-FQg{margin-top:6px;max-width:100%}._8-FQg *+*{margin-top:4px}";
|
|
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 };
|
|
@@ -2,15 +2,12 @@ import { useEffect } from 'react';
|
|
|
2
2
|
import '../../utils/index.js';
|
|
3
3
|
import createContextUtilities from '../../utils/createContextUtilities/createContextUtilities.js';
|
|
4
4
|
|
|
5
|
-
const {
|
|
6
|
-
Provider
|
|
7
|
-
useContext
|
|
8
|
-
} = createContextUtilities({});
|
|
5
|
+
const _createContextUtiliti = createContextUtilities({}),
|
|
6
|
+
FormFieldProvider = _createContextUtiliti.Provider,
|
|
7
|
+
useFormFieldContext = _createContextUtiliti.useContext;
|
|
9
8
|
const useFormFieldControl = () => {
|
|
10
9
|
const context = useFormFieldContext();
|
|
11
|
-
const
|
|
12
|
-
setHasControl
|
|
13
|
-
} = context;
|
|
10
|
+
const setHasControl = context.setHasControl;
|
|
14
11
|
useEffect(() => {
|
|
15
12
|
setHasControl === null || setHasControl === void 0 || setHasControl(true);
|
|
16
13
|
}, [setHasControl]);
|
|
@@ -18,9 +15,7 @@ const useFormFieldControl = () => {
|
|
|
18
15
|
};
|
|
19
16
|
const useFormFieldLabel = () => {
|
|
20
17
|
const context = useFormFieldContext();
|
|
21
|
-
const
|
|
22
|
-
setHasLabel
|
|
23
|
-
} = context;
|
|
18
|
+
const setHasLabel = context.setHasLabel;
|
|
24
19
|
useEffect(() => {
|
|
25
20
|
setHasLabel === null || setHasLabel === void 0 || setHasLabel(true);
|
|
26
21
|
}, [setHasLabel]);
|
|
@@ -28,9 +23,7 @@ const useFormFieldLabel = () => {
|
|
|
28
23
|
};
|
|
29
24
|
const useFormFieldType = type => {
|
|
30
25
|
const context = useFormFieldContext();
|
|
31
|
-
const
|
|
32
|
-
setFormFieldType
|
|
33
|
-
} = context;
|
|
26
|
+
const setFormFieldType = context.setFormFieldType;
|
|
34
27
|
useEffect(() => {
|
|
35
28
|
setFormFieldType === null || setFormFieldType === void 0 || setFormFieldType(type);
|
|
36
29
|
}, [setFormFieldType, type]);
|