@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,3 +1,4 @@
|
|
|
1
|
+
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
1
2
|
import React__default, { useRef, useCallback, useState, useMemo, useEffect } from 'react';
|
|
2
3
|
import classNames from 'classnames';
|
|
3
4
|
import NumberStepperIncrement from './NumberStepperIncrement.js';
|
|
@@ -9,32 +10,33 @@ import styles from './NumberStepper2.js';
|
|
|
9
10
|
import useScreenReaderAnnouncement from '../../hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement.js';
|
|
10
11
|
import useControllableState from '../../hooks/useControllableState/useControllableState.js';
|
|
11
12
|
|
|
12
|
-
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
13
13
|
/**
|
|
14
14
|
* Renders the NumberStepper component.
|
|
15
15
|
* This component is offered as a "default" (aka simple) component or an "advanced" (aka composite) component.
|
|
16
16
|
*/
|
|
17
17
|
const NumberStepper = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
initialValue = 0,
|
|
23
|
-
value
|
|
24
|
-
step =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
18
|
+
let isExternallyDisabled = _ref.isDisabled,
|
|
19
|
+
dataTestId = _ref['data-testid'],
|
|
20
|
+
inputId = _ref.inputId,
|
|
21
|
+
_ref$initialValue = _ref.initialValue,
|
|
22
|
+
initialValue = _ref$initialValue === void 0 ? 0 : _ref$initialValue,
|
|
23
|
+
externalValue = _ref.value,
|
|
24
|
+
_ref$step = _ref.step,
|
|
25
|
+
step = _ref$step === void 0 ? 1 : _ref$step,
|
|
26
|
+
min = _ref.min,
|
|
27
|
+
max = _ref.max,
|
|
28
|
+
_ref$decimalSeparator = _ref.decimalSeparator,
|
|
29
|
+
decimalSeparator = _ref$decimalSeparator === void 0 ? 'both' : _ref$decimalSeparator,
|
|
30
|
+
_ref$allowDecimalNumb = _ref.allowDecimalNumbers,
|
|
31
|
+
allowDecimalNumbers = _ref$allowDecimalNumb === void 0 ? true : _ref$allowDecimalNumb,
|
|
32
|
+
className = _ref.className,
|
|
33
|
+
ariaLabel = _ref['aria-label'],
|
|
34
|
+
ariaLabelledBy = _ref['aria-labelledby'],
|
|
35
|
+
ariaDescribedBy = _ref['aria-describedby'],
|
|
36
|
+
children = _ref.children,
|
|
37
|
+
onChange = _ref.onChange,
|
|
38
|
+
onFocus = _ref.onFocus,
|
|
39
|
+
onBlur = _ref.onBlur;
|
|
38
40
|
const latestDecimalSeparator = useRef(decimalSeparator === 'comma' ? ',' : '.');
|
|
39
41
|
const announceToScreenReader = useScreenReaderAnnouncement('assertive');
|
|
40
42
|
const componentHasFocus = useRef(false);
|
|
@@ -46,13 +48,22 @@ const NumberStepper = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
46
48
|
* (2) Internal state (if `externalValue` is undefined).
|
|
47
49
|
*/
|
|
48
50
|
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
const _useControllableState = useControllableState(clampMinMax(initialValue, {
|
|
52
|
+
min,
|
|
53
|
+
max
|
|
54
|
+
}), onChange, externalValue),
|
|
55
|
+
_useControllableState2 = _slicedToArray(_useControllableState, 2),
|
|
56
|
+
internalValue = _useControllableState2[0],
|
|
57
|
+
setInternalValue = _useControllableState2[1];
|
|
58
|
+
const _useState = useState(localizeNumber(internalValue, isSeparatedByComma(initialValue))),
|
|
59
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
60
|
+
inputValue = _useState2[0],
|
|
61
|
+
setInputValue = _useState2[1];
|
|
54
62
|
const componentIsControlled = useMemo(() => externalValue !== undefined && externalValue !== null, [externalValue]);
|
|
55
|
-
const
|
|
63
|
+
const _useState3 = useState(false),
|
|
64
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
65
|
+
forceInternalValueUpdate = _useState4[0],
|
|
66
|
+
setForceInternalValueUpdate = _useState4[1];
|
|
56
67
|
useEffect(() => {
|
|
57
68
|
['.', ','].forEach(separator => {
|
|
58
69
|
if (String(inputValue).indexOf(separator) !== -1) {
|
|
@@ -214,18 +225,14 @@ const NumberStepper = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
214
225
|
ref: ref,
|
|
215
226
|
className: classNames(styles.numberStepperContainer, className),
|
|
216
227
|
onFocus: e => {
|
|
217
|
-
const
|
|
218
|
-
currentTarget
|
|
219
|
-
} = e;
|
|
228
|
+
const currentTarget = e.currentTarget;
|
|
220
229
|
if (!componentHasFocus.current && currentTarget.contains(document.activeElement)) {
|
|
221
230
|
componentHasFocus.current = true;
|
|
222
231
|
onFocus === null || onFocus === void 0 || onFocus(e);
|
|
223
232
|
}
|
|
224
233
|
},
|
|
225
234
|
onBlur: e => {
|
|
226
|
-
const
|
|
227
|
-
currentTarget
|
|
228
|
-
} = e;
|
|
235
|
+
const currentTarget = e.currentTarget;
|
|
229
236
|
|
|
230
237
|
// Give browser time to focus the next element
|
|
231
238
|
requestAnimationFrame(() => {
|
|
@@ -269,10 +276,8 @@ function roundToTwoDecimalPlaces(value) {
|
|
|
269
276
|
* Compares the given `value` to min and/or max
|
|
270
277
|
*/
|
|
271
278
|
function clampMinMax(value, _ref2) {
|
|
272
|
-
let
|
|
273
|
-
|
|
274
|
-
max
|
|
275
|
-
} = _ref2;
|
|
279
|
+
let min = _ref2.min,
|
|
280
|
+
max = _ref2.max;
|
|
276
281
|
if (typeof max === 'number' && value > max) {
|
|
277
282
|
return max;
|
|
278
283
|
}
|
|
@@ -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 = {"numberStepperContainer":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._AJZQS{display:inline-flex;width:127px}._RPklw{color:#32363a;background:#fafafa;outline:none;text-align:center;padding:0 12px;min-width:55px;width:100%;font-size:14px;border:1px solid #898989;border-radius:0;-moz-appearance:textfield}._RPklw:hover:not(._hrc-Q){cursor:pointer;background:#f5f5f5}._RPklw._tSNCS{border:1px solid #da1c3d}._RPklw._tSNCS:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #900000}._RPklw._hrc-Q{cursor:not-allowed;fill:#74777a;color:#74777a;border-color:#e5e5e5}._RPklw._hrc-Q>svg{opacity:.4}._RPklw::-webkit-inner-spin-button,._RPklw::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}._RPklw:focus{z-index:0;border:none;border-radius:4px}._RPklw:focus:not(._tSNCS){box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._MeTr4,._RPklw:focus:not(._hrc-Q){background:#fafafa}._MeTr4{padding:0;display:flex;justify-content:center;align-items:center;flex-shrink:0;width:36px;height:36px;fill:#515559;outline:none;border-radius:4px 0 0 4px;border:1px solid #898989;border-right-width:0}._MeTr4:hover:not(._hrc-Q){cursor:pointer;background:#f5f5f5}._MeTr4:active:not(._hrc-Q){background:#e5e5e5}._MeTr4._hrc-Q{cursor:not-allowed;fill:#74777a;color:#74777a;border-color:#e5e5e5}._MeTr4._hrc-Q>svg{opacity:.4}._cDqdt{padding:0;display:flex;justify-content:center;align-items:center;flex-shrink:0;width:36px;height:36px;background:#fafafa;fill:#515559;outline:none;border-radius:0 4px 4px 0;border:1px solid #898989;border-left-width:0}._cDqdt:hover:not(._hrc-Q){cursor:pointer;background:#f5f5f5}._cDqdt:active:not(._hrc-Q){background:#e5e5e5}._cDqdt._hrc-Q{cursor:not-allowed;fill:#74777a;color:#74777a;border-color:#e5e5e5}._cDqdt._hrc-Q>svg{opacity:.4}";
|
|
4
|
+
var styles = {"numberStepperContainer":"_AJZQS","numberStepperInput":"_RPklw","disabled":"_hrc-Q","invalid":"_tSNCS","decrementBtn":"_MeTr4","incrementBtn":"_cDqdt"};
|
|
5
|
+
var stylesheet="._AJZQS{display:inline-flex;width:127px}._RPklw{color:#32363a;background:#fafafa;outline:none;text-align:center;padding:0 12px;min-width:55px;width:100%;font-size:14px;border:1px solid #898989;border-radius:0;-moz-appearance:textfield}._RPklw:hover:not(._hrc-Q){cursor:pointer;background:#f5f5f5}._RPklw._tSNCS{border:1px solid #da1c3d}._RPklw._tSNCS:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #900000}._RPklw._hrc-Q{cursor:not-allowed;fill:#74777a;color:#74777a;border-color:#e5e5e5}._RPklw._hrc-Q>svg{opacity:.4}._RPklw::-webkit-inner-spin-button,._RPklw::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}._RPklw:focus{z-index:0;border:none;border-radius:4px}._RPklw:focus:not(._tSNCS){box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._MeTr4,._RPklw:focus:not(._hrc-Q){background:#fafafa}._MeTr4{padding:0;display:flex;justify-content:center;align-items:center;flex-shrink:0;width:36px;height:36px;fill:#515559;outline:none;border-radius:4px 0 0 4px;border:1px solid #898989;border-right-width:0}._MeTr4:hover:not(._hrc-Q){cursor:pointer;background:#f5f5f5}._MeTr4:active:not(._hrc-Q){background:#e5e5e5}._MeTr4._hrc-Q{cursor:not-allowed;fill:#74777a;color:#74777a;border-color:#e5e5e5}._MeTr4._hrc-Q>svg{opacity:.4}._cDqdt{padding:0;display:flex;justify-content:center;align-items:center;flex-shrink:0;width:36px;height:36px;background:#fafafa;fill:#515559;outline:none;border-radius:0 4px 4px 0;border:1px solid #898989;border-left-width:0}._cDqdt:hover:not(._hrc-Q){cursor:pointer;background:#f5f5f5}._cDqdt:active:not(._hrc-Q){background:#e5e5e5}._cDqdt._hrc-Q{cursor:not-allowed;fill:#74777a;color:#74777a;border-color:#e5e5e5}._cDqdt._hrc-Q>svg{opacity:.4}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import '../../utils/index.js';
|
|
2
2
|
import createContextUtilities from '../../utils/createContextUtilities/createContextUtilities.js';
|
|
3
3
|
|
|
4
|
-
const
|
|
5
|
-
Provider
|
|
6
|
-
useContext
|
|
7
|
-
} = createContextUtilities();
|
|
4
|
+
const _createContextUtiliti = createContextUtilities(),
|
|
5
|
+
NumberStepperContextProvider = _createContextUtiliti.Provider,
|
|
6
|
+
useNumberStepperContext = _createContextUtiliti.useContext;
|
|
8
7
|
|
|
9
8
|
export { NumberStepperContextProvider, useNumberStepperContext };
|
|
@@ -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 from 'react';
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
import styles from './NumberStepper2.js';
|
|
@@ -9,28 +10,25 @@ import useTranslation from '../../utils/Translation/useTranslation.js';
|
|
|
9
10
|
import getSubDataTestId from '../../utils/getSubDataTestId/getSubDataTestId.js';
|
|
10
11
|
import SubtractIcon from '../../icons/components/SubtractIcon.js';
|
|
11
12
|
|
|
13
|
+
const _excluded = ["className", "onClick"];
|
|
12
14
|
/**
|
|
13
15
|
* Renders the NumberStepperDecrement component.
|
|
14
16
|
* Either `NumberStepper` renders this component automatically or the consumer renders this component explicitly.
|
|
15
17
|
*/
|
|
16
18
|
const NumberStepperDecrement = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
17
|
-
let
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const {
|
|
23
|
-
translate
|
|
24
|
-
} = useTranslation();
|
|
19
|
+
let className = _ref.className,
|
|
20
|
+
onClick = _ref.onClick,
|
|
21
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
22
|
+
const _useTranslation = useTranslation(),
|
|
23
|
+
translate = _useTranslation.translate;
|
|
25
24
|
|
|
26
25
|
// Context from NumberStepper
|
|
27
|
-
const
|
|
28
|
-
isExternallyDisabled,
|
|
29
|
-
dataTestId,
|
|
30
|
-
decrement,
|
|
31
|
-
internalValue,
|
|
32
|
-
min
|
|
33
|
-
} = useNumberStepperContext();
|
|
26
|
+
const _useNumberStepperCont = useNumberStepperContext(),
|
|
27
|
+
isExternallyDisabled = _useNumberStepperCont.isExternallyDisabled,
|
|
28
|
+
dataTestId = _useNumberStepperCont.dataTestId,
|
|
29
|
+
decrement = _useNumberStepperCont.decrement,
|
|
30
|
+
internalValue = _useNumberStepperCont.internalValue,
|
|
31
|
+
min = _useNumberStepperCont.min;
|
|
34
32
|
|
|
35
33
|
// Indicates if the button is disabled
|
|
36
34
|
const isDisabled = internalValue <= min || isExternallyDisabled;
|
|
@@ -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 from 'react';
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
import styles from './NumberStepper2.js';
|
|
@@ -9,28 +10,25 @@ import useTranslation from '../../utils/Translation/useTranslation.js';
|
|
|
9
10
|
import getSubDataTestId from '../../utils/getSubDataTestId/getSubDataTestId.js';
|
|
10
11
|
import AddIcon from '../../icons/components/AddIcon.js';
|
|
11
12
|
|
|
13
|
+
const _excluded = ["className", "onClick"];
|
|
12
14
|
/**
|
|
13
15
|
* Renders the NumberStepperIncrement component.
|
|
14
16
|
* Either `NumberStepper` renders this component automatically or the consumer renders this component explicitly.
|
|
15
17
|
*/
|
|
16
18
|
const NumberStepperIncrement = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
17
|
-
let
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const {
|
|
23
|
-
translate
|
|
24
|
-
} = useTranslation();
|
|
19
|
+
let className = _ref.className,
|
|
20
|
+
onClick = _ref.onClick,
|
|
21
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
22
|
+
const _useTranslation = useTranslation(),
|
|
23
|
+
translate = _useTranslation.translate;
|
|
25
24
|
|
|
26
25
|
// Context from NumberStepper
|
|
27
|
-
const
|
|
28
|
-
isExternallyDisabled,
|
|
29
|
-
dataTestId,
|
|
30
|
-
increment,
|
|
31
|
-
internalValue,
|
|
32
|
-
max
|
|
33
|
-
} = useNumberStepperContext();
|
|
26
|
+
const _useNumberStepperCont = useNumberStepperContext(),
|
|
27
|
+
isExternallyDisabled = _useNumberStepperCont.isExternallyDisabled,
|
|
28
|
+
dataTestId = _useNumberStepperCont.dataTestId,
|
|
29
|
+
increment = _useNumberStepperCont.increment,
|
|
30
|
+
internalValue = _useNumberStepperCont.internalValue,
|
|
31
|
+
max = _useNumberStepperCont.max;
|
|
34
32
|
|
|
35
33
|
// Indicates if the button is disabled
|
|
36
34
|
const isDisabled = internalValue >= max || isExternallyDisabled;
|
|
@@ -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 from 'react';
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
import styles from './NumberStepper2.js';
|
|
@@ -8,44 +9,41 @@ import { useFormFieldControl } from '../FormField/FormFieldContext.js';
|
|
|
8
9
|
import concatIds from '../../utils/concatIds/concatIds.js';
|
|
9
10
|
import getSubDataTestId from '../../utils/getSubDataTestId/getSubDataTestId.js';
|
|
10
11
|
|
|
12
|
+
const _excluded = ["className", "onKeyDown", "onFocus", "onBlur"];
|
|
11
13
|
/**
|
|
12
14
|
* Renders the NumberStepperInput component.
|
|
13
15
|
* Either `NumberStepper` renders this component automatically or the consumer renders this component explicitly.
|
|
14
16
|
*/
|
|
15
17
|
const NumberStepperInput = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
16
|
-
let
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
...rest
|
|
22
|
-
} = _ref;
|
|
18
|
+
let className = _ref.className,
|
|
19
|
+
onKeyDown = _ref.onKeyDown,
|
|
20
|
+
onFocus = _ref.onFocus,
|
|
21
|
+
onBlur = _ref.onBlur,
|
|
22
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
23
23
|
// Context from NumberStepper
|
|
24
|
-
const
|
|
25
|
-
isExternallyDisabled,
|
|
26
|
-
dataTestId,
|
|
27
|
-
inputId,
|
|
28
|
-
inputValue,
|
|
29
|
-
increment,
|
|
30
|
-
decrement,
|
|
31
|
-
increaseToMax,
|
|
32
|
-
decreaseToMin,
|
|
33
|
-
step
|
|
34
|
-
min
|
|
35
|
-
max
|
|
36
|
-
ariaLabel,
|
|
37
|
-
ariaLabelledBy,
|
|
38
|
-
ariaDescribedBy,
|
|
39
|
-
handleInputChange,
|
|
40
|
-
handleInputBlur,
|
|
41
|
-
internalValue
|
|
42
|
-
} = useNumberStepperContext();
|
|
24
|
+
const _useNumberStepperCont = useNumberStepperContext(),
|
|
25
|
+
isExternallyDisabled = _useNumberStepperCont.isExternallyDisabled,
|
|
26
|
+
dataTestId = _useNumberStepperCont.dataTestId,
|
|
27
|
+
inputId = _useNumberStepperCont.inputId,
|
|
28
|
+
inputValue = _useNumberStepperCont.inputValue,
|
|
29
|
+
increment = _useNumberStepperCont.increment,
|
|
30
|
+
decrement = _useNumberStepperCont.decrement,
|
|
31
|
+
increaseToMax = _useNumberStepperCont.increaseToMax,
|
|
32
|
+
decreaseToMin = _useNumberStepperCont.decreaseToMin,
|
|
33
|
+
inputStep = _useNumberStepperCont.step,
|
|
34
|
+
inputMin = _useNumberStepperCont.min,
|
|
35
|
+
inputMax = _useNumberStepperCont.max,
|
|
36
|
+
ariaLabel = _useNumberStepperCont.ariaLabel,
|
|
37
|
+
ariaLabelledBy = _useNumberStepperCont.ariaLabelledBy,
|
|
38
|
+
ariaDescribedBy = _useNumberStepperCont.ariaDescribedBy,
|
|
39
|
+
handleInputChange = _useNumberStepperCont.handleInputChange,
|
|
40
|
+
handleInputBlur = _useNumberStepperCont.handleInputBlur,
|
|
41
|
+
internalValue = _useNumberStepperCont.internalValue;
|
|
43
42
|
|
|
44
43
|
// TODO: Add proper styling for the form field label (this is a breaking change)
|
|
45
|
-
const
|
|
46
|
-
helperTextId
|
|
47
|
-
errorTextId
|
|
48
|
-
} = useFormFieldControl();
|
|
44
|
+
const _useFormFieldControl = useFormFieldControl(),
|
|
45
|
+
formFieldHelperTextId = _useFormFieldControl.helperTextId,
|
|
46
|
+
formFieldErrorTextId = _useFormFieldControl.errorTextId;
|
|
49
47
|
const internalAriaDescribedby = concatIds(ariaDescribedBy, formFieldHelperTextId, formFieldErrorTextId);
|
|
50
48
|
const isInvalid = internalValue > inputMax || internalValue < inputMin;
|
|
51
49
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
2
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
2
3
|
import React__default, { forwardRef } from 'react';
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
import styles from './PageLayout.js';
|
|
5
6
|
|
|
7
|
+
const _excluded = ["className"];
|
|
6
8
|
const MainContent = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
7
|
-
let
|
|
8
|
-
|
|
9
|
-
...rest
|
|
10
|
-
} = _ref;
|
|
9
|
+
let className = _ref.className,
|
|
10
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
11
11
|
return /*#__PURE__*/React__default.createElement("main", _extends({}, rest, {
|
|
12
12
|
className: classNames(styles.mainContent, className),
|
|
13
13
|
ref: ref
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
2
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
2
3
|
import React__default, { forwardRef } from 'react';
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
import styles from './PageLayout.js';
|
|
5
6
|
|
|
7
|
+
const _excluded = ["className"];
|
|
6
8
|
const PageContainer = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
7
|
-
let
|
|
8
|
-
|
|
9
|
-
...rest
|
|
10
|
-
} = _ref;
|
|
9
|
+
let className = _ref.className,
|
|
10
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
11
11
|
return /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
|
12
12
|
className: classNames(styles.pageContainer, className),
|
|
13
13
|
ref: ref
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
2
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
2
3
|
import React__default, { forwardRef } from 'react';
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
import styles from './PageLayout.js';
|
|
5
6
|
|
|
7
|
+
const _excluded = ["className"];
|
|
6
8
|
const PageHeader = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
7
|
-
let
|
|
8
|
-
|
|
9
|
-
...rest
|
|
10
|
-
} = _ref;
|
|
9
|
+
let className = _ref.className,
|
|
10
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
11
11
|
return /*#__PURE__*/React__default.createElement("header", _extends({}, rest, {
|
|
12
12
|
className: classNames(styles.pageHeader, className),
|
|
13
13
|
ref: ref
|
|
@@ -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 = {"pageContainer":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._uKUY5{height:100vh;width:100vw;display:grid;grid-template-rows:auto 1fr;grid-template-columns:auto auto 1fr;grid-template-areas:\"pageHeader pageHeader pageHeader\" \"sidebarNav configPane mainContent\"}._DIfLN{grid-area:pageHeader}._fTBrX{grid-area:mainContent;height:100%;overflow:auto}";
|
|
4
|
+
var styles = {"pageContainer":"_uKUY5","pageHeader":"_DIfLN","mainContent":"_fTBrX"};
|
|
5
|
+
var stylesheet="._uKUY5{height:100vh;width:100vw;display:grid;grid-template-rows:auto 1fr;grid-template-columns:auto auto 1fr;grid-template-areas:\"pageHeader pageHeader pageHeader\" \"sidebarNav configPane mainContent\"}._DIfLN{grid-area:pageHeader}._fTBrX{grid-area:mainContent;height:100%;overflow:auto}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -1,4 +1,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, useEffect, useCallback, useMemo } from 'react';
|
|
3
5
|
import classNames from 'classnames';
|
|
4
6
|
import styles from './Pagination2.js';
|
|
@@ -13,29 +15,31 @@ import useTranslation from '../../utils/Translation/useTranslation.js';
|
|
|
13
15
|
import useScreenReaderAnnouncement from '../../hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement.js';
|
|
14
16
|
import { useDidUpdate } from '../../hooks/useDidUpdate/useDidUpdate.js';
|
|
15
17
|
|
|
18
|
+
const _excluded = ["data-testid", "numPages", "currentPage", "onPageChange", "className", "children", "aria-label", "aria-labelledby", "aria-describedby"];
|
|
16
19
|
/**
|
|
17
20
|
* Renders the Pagination component.
|
|
18
21
|
* This component is offered as a "default" (aka simple) component or an "advanced" (aka composite) component.
|
|
19
22
|
*/
|
|
20
23
|
const Pagination = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
21
|
-
let
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
currentPage = 1,
|
|
25
|
-
onPageChange,
|
|
26
|
-
className,
|
|
27
|
-
children,
|
|
28
|
-
'aria-label'
|
|
29
|
-
'aria-labelledby'
|
|
30
|
-
'aria-describedby'
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
translate
|
|
35
|
-
} = useTranslation();
|
|
24
|
+
let dataTestId = _ref['data-testid'],
|
|
25
|
+
numPages = _ref.numPages,
|
|
26
|
+
_ref$currentPage = _ref.currentPage,
|
|
27
|
+
currentPage = _ref$currentPage === void 0 ? 1 : _ref$currentPage,
|
|
28
|
+
onPageChange = _ref.onPageChange,
|
|
29
|
+
className = _ref.className,
|
|
30
|
+
children = _ref.children,
|
|
31
|
+
ariaLabel = _ref['aria-label'],
|
|
32
|
+
ariaLabelledBy = _ref['aria-labelledby'],
|
|
33
|
+
ariaDescribedBy = _ref['aria-describedby'],
|
|
34
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
35
|
+
const _useTranslation = useTranslation(),
|
|
36
|
+
translate = _useTranslation.translate;
|
|
36
37
|
|
|
37
38
|
// The current page (the consumer holds a current page that might be different)
|
|
38
|
-
const
|
|
39
|
+
const _useState = useState(currentPage),
|
|
40
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
41
|
+
pageInputValue = _useState2[0],
|
|
42
|
+
setPageInputValue = _useState2[1];
|
|
39
43
|
const announceToScreenReader = useScreenReaderAnnouncement('assertive');
|
|
40
44
|
|
|
41
45
|
// Announces the new page info to the screen reader when the page info changes, but not when the component first mounts
|
|
@@ -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 = {"pagination":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._Hcrk8{display:flex;align-items:center;justify-content:center;font-size:14px;white-space:pre}._LOGZu{margin-right:8px}._G1NYn{margin-left:8px}._wxL6f{margin:-10px -15px}._UamFj{width:100%;text-align:center}";
|
|
4
|
+
var styles = {"pagination":"_Hcrk8","previousButton":"_LOGZu","nextButton":"_G1NYn","btnIcon":"_wxL6f","input":"_UamFj"};
|
|
5
|
+
var stylesheet="._Hcrk8{display:flex;align-items:center;justify-content:center;font-size:14px;white-space:pre}._LOGZu{margin-right:8px}._G1NYn{margin-left:8px}._wxL6f{margin:-10px -15px}._UamFj{width:100%;text-align:center}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import '../../utils/index.js';
|
|
2
2
|
import createContextUtilities from '../../utils/createContextUtilities/createContextUtilities.js';
|
|
3
3
|
|
|
4
|
-
const {
|
|
5
|
-
Provider
|
|
6
|
-
useContext
|
|
7
|
-
} = createContextUtilities({});
|
|
4
|
+
const _createContextUtiliti = createContextUtilities({}),
|
|
5
|
+
PaginationContextProvider = _createContextUtiliti.Provider,
|
|
6
|
+
usePaginationContext = _createContextUtiliti.useContext;
|
|
8
7
|
|
|
9
8
|
export { PaginationContextProvider, usePaginationContext as default };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
2
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
2
3
|
import React__default, { forwardRef } from 'react';
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
import styles from './Pagination2.js';
|
|
@@ -11,31 +12,28 @@ import { Button } from '../Button/Button2.js';
|
|
|
11
12
|
import getSubDataTestId from '../../utils/getSubDataTestId/getSubDataTestId.js';
|
|
12
13
|
import ChevronRightIcon from '../../icons/components/ChevronRightIcon.js';
|
|
13
14
|
|
|
15
|
+
const _excluded = ["data-testid", "disabled", "onClick", "className"];
|
|
14
16
|
/**
|
|
15
17
|
* Renders the PaginationNextButton.
|
|
16
18
|
* Either `Pagination` renders this component automatically or the consumer renders this component explicitly.
|
|
17
19
|
*/
|
|
18
20
|
const PaginationNextButton = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
19
|
-
let
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const {
|
|
27
|
-
translate
|
|
28
|
-
} = useTranslation();
|
|
21
|
+
let dataTestIdFromProps = _ref['data-testid'],
|
|
22
|
+
disabled = _ref.disabled,
|
|
23
|
+
onClick = _ref.onClick,
|
|
24
|
+
className = _ref.className,
|
|
25
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
26
|
+
const _useTranslation = useTranslation(),
|
|
27
|
+
translate = _useTranslation.translate;
|
|
29
28
|
const buttonLabel = translate('nextPage');
|
|
30
29
|
|
|
31
30
|
// Context for Pagination
|
|
32
|
-
const
|
|
33
|
-
numPages,
|
|
34
|
-
pageInputValue,
|
|
35
|
-
dataTestId,
|
|
36
|
-
handlePageChange,
|
|
37
|
-
setPageInputValue
|
|
38
|
-
} = usePaginationContext();
|
|
31
|
+
const _usePaginationContext = usePaginationContext(),
|
|
32
|
+
numPages = _usePaginationContext.numPages,
|
|
33
|
+
pageInputValue = _usePaginationContext.pageInputValue,
|
|
34
|
+
dataTestId = _usePaginationContext.dataTestId,
|
|
35
|
+
handlePageChange = _usePaginationContext.handlePageChange,
|
|
36
|
+
setPageInputValue = _usePaginationContext.setPageInputValue;
|
|
39
37
|
|
|
40
38
|
/**
|
|
41
39
|
* Increments the `pageInputValue`.
|
|
@@ -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, { forwardRef, useRef, useMemo } from 'react';
|
|
3
5
|
import classNames from 'classnames';
|
|
4
6
|
import styles from './Pagination2.js';
|
|
@@ -10,39 +12,37 @@ import Input from '../Input/Input.js';
|
|
|
10
12
|
import getSubDataTestId from '../../utils/getSubDataTestId/getSubDataTestId.js';
|
|
11
13
|
import mergeRefs from '../../utils/mergeRefs/mergeRefs.js';
|
|
12
14
|
|
|
15
|
+
const _excluded = ["data-testid", "aria-label", "aria-labelledby", "aria-describedby", "onChange", "onBlur", "onFocus", "className", "style"];
|
|
13
16
|
/**
|
|
14
17
|
* Renders the PaginationPageInput.
|
|
15
18
|
* Either `Pagination` renders this component automatically or the consumer renders this component explicitly.
|
|
16
19
|
*/
|
|
17
20
|
const PaginationPageInput = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
18
|
-
let
|
|
19
|
-
'
|
|
20
|
-
'aria-
|
|
21
|
-
'aria-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
...rest
|
|
29
|
-
} = _ref;
|
|
21
|
+
let dataTestIdFromProps = _ref['data-testid'],
|
|
22
|
+
ariaLabelFromProps = _ref['aria-label'],
|
|
23
|
+
ariaLabelledByFromProps = _ref['aria-labelledby'],
|
|
24
|
+
ariaDescribedByFromProps = _ref['aria-describedby'],
|
|
25
|
+
onChange = _ref.onChange,
|
|
26
|
+
onBlur = _ref.onBlur,
|
|
27
|
+
onFocus = _ref.onFocus,
|
|
28
|
+
className = _ref.className,
|
|
29
|
+
style = _ref.style,
|
|
30
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
30
31
|
// Element reference to the input
|
|
31
32
|
const inputRef = useRef(null);
|
|
32
33
|
const notChangingCharacters = ['', '0', '-'];
|
|
33
34
|
|
|
34
35
|
// Context for Pagination
|
|
35
|
-
const
|
|
36
|
-
numPages,
|
|
37
|
-
pageInputValue,
|
|
38
|
-
currentPage,
|
|
39
|
-
dataTestId,
|
|
40
|
-
ariaLabel,
|
|
41
|
-
ariaLabelledBy,
|
|
42
|
-
ariaDescribedBy,
|
|
43
|
-
handlePageChange,
|
|
44
|
-
setPageInputValue
|
|
45
|
-
} = usePaginationContext();
|
|
36
|
+
const _usePaginationContext = usePaginationContext(),
|
|
37
|
+
numPages = _usePaginationContext.numPages,
|
|
38
|
+
pageInputValue = _usePaginationContext.pageInputValue,
|
|
39
|
+
currentPage = _usePaginationContext.currentPage,
|
|
40
|
+
dataTestId = _usePaginationContext.dataTestId,
|
|
41
|
+
ariaLabel = _usePaginationContext.ariaLabel,
|
|
42
|
+
ariaLabelledBy = _usePaginationContext.ariaLabelledBy,
|
|
43
|
+
ariaDescribedBy = _usePaginationContext.ariaDescribedBy,
|
|
44
|
+
handlePageChange = _usePaginationContext.handlePageChange,
|
|
45
|
+
setPageInputValue = _usePaginationContext.setPageInputValue;
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* Computes the width of the input based on the number of characters entered
|
|
@@ -70,7 +70,7 @@ const PaginationPageInput = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
70
70
|
*/
|
|
71
71
|
const handleInputChange = newValue => {
|
|
72
72
|
setPageInputValue === null || setPageInputValue === void 0 || setPageInputValue(newValue);
|
|
73
|
-
if (!notChangingCharacters.
|
|
73
|
+
if (!_includesInstanceProperty(notChangingCharacters).call(notChangingCharacters, newValue)) {
|
|
74
74
|
const newPage = Math.min(Math.max(1, Number(newValue)), numPages || Number.MAX_SAFE_INTEGER);
|
|
75
75
|
handlePageChange === null || handlePageChange === void 0 || handlePageChange(newPage);
|
|
76
76
|
}
|