@qualtrics/ui-react 2.79.1 → 2.80.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -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-d4ec6b6f.js → index-807921ca.js} +2829 -2634
- package/dist/__shared/cjs/{index-91d2f6f8.js → index-8c77a9ef.js} +15 -9
- package/dist/components/Accordion/Accordion.js +27 -21
- package/dist/components/Accordion/Accordion2.js +3 -3
- package/dist/components/Accordion/AccordionContext.js +6 -8
- package/dist/components/Accordion/AccordionHeader.js +13 -17
- package/dist/components/Accordion/AccordionPanel.js +7 -11
- package/dist/components/Accordion/AccordionSection.js +14 -11
- package/dist/components/Banner/Banner.js +10 -11
- package/dist/components/Banner/BannerBody.js +1 -3
- package/dist/components/Banner/BannerFooter.js +1 -3
- package/dist/components/Banner/BannerTitle.js +1 -3
- package/dist/components/BreakpointSwitch/Breakpoint.js +2 -5
- package/dist/components/BreakpointSwitch/BreakpointContext.js +3 -4
- package/dist/components/BreakpointSwitch/BreakpointSwitch.js +1 -3
- package/dist/components/Button/Button.js +3 -3
- package/dist/components/Button/Button2.js +19 -13
- package/dist/components/ButtonGroup/ButtonGroup.js +7 -7
- package/dist/components/ButtonGroup/ButtonGroup2.js +3 -3
- package/dist/components/Checkbox/Check.js +8 -6
- package/dist/components/Checkbox/Checkbox.js +31 -28
- package/dist/components/Checkbox/Checkbox2.js +3 -3
- package/dist/components/Checkbox/CheckboxField.js +14 -13
- package/dist/components/ColorPicker/Alpha.js +8 -12
- package/dist/components/ColorPicker/ColorPicker.js +67 -48
- package/dist/components/ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/ColorPicker/ColorPickerFlyout.js +23 -24
- package/dist/components/ColorPicker/ColorPickerFlyoutInputs.js +27 -22
- package/dist/components/ColorPicker/ColorPickerWIthNoColor.js +11 -7
- package/dist/components/ColorPicker/Hue.js +9 -13
- package/dist/components/ColorPicker/Palette.js +23 -21
- package/dist/components/ColorPicker/Saturation.js +11 -15
- package/dist/components/ColorPicker/utils/hexToHsv.js +4 -5
- package/dist/components/ColorPicker/utils/hsvToHex.js +3 -5
- package/dist/components/ColorPicker/utils/rgbToHex.js +3 -5
- package/dist/components/Combobox/Combobox.js +166 -133
- package/dist/components/Combobox/Combobox2.js +3 -3
- package/dist/components/Combobox/ComboboxContext.js +3 -4
- package/dist/components/Combobox/ComboboxHeader.js +6 -6
- package/dist/components/Combobox/ComboboxIcon.js +14 -14
- package/dist/components/Combobox/ComboboxInput.js +41 -43
- package/dist/components/Combobox/ComboboxList.js +20 -20
- package/dist/components/Combobox/ComboboxOption.js +9 -10
- package/dist/components/ConfigPane/ConfigPane.js +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 +38 -23
- package/dist/next/Drawer/Drawer2.js +3 -3
- package/dist/next/FilterAnchor/FilterAnchor.js +21 -19
- package/dist/next/FilterAnchor/FilterAnchor2.js +3 -3
- package/dist/next/Form/FormFields/FormFieldWrapper.js +11 -11
- package/dist/next/Form/FormFields/InputField.js +3 -3
- package/dist/next/Form/useForm.js +25 -30
- package/dist/next/Form/useFormField.js +3 -4
- package/dist/next/Form/utils/createFormInstance.js +7 -9
- package/dist/next/Form/utils/useFormContext.js +3 -4
- package/dist/next/Indicator/Indicator.js +12 -8
- package/dist/next/Indicator/Indicator2.js +3 -3
- package/dist/next/Input/Input.js +49 -35
- package/dist/next/Input/Input2.js +3 -3
- package/dist/next/LayoutGrid/LayoutGrid.js +11 -12
- package/dist/next/LayoutGrid/LayoutGridItem.js +5 -6
- package/dist/next/LoadingSpinner/LoadingSpinner.js +22 -17
- package/dist/next/LoadingSpinner/LoadingSpinner2.js +3 -3
- package/dist/next/Menu/Hooks/useFocusVirtualBoundary.js +7 -4
- package/dist/next/Menu/Hooks/useMaskDimensions.js +6 -7
- package/dist/next/Menu/Hooks/usePaneSearch.js +50 -39
- package/dist/next/Menu/Menu.js +28 -15
- package/dist/next/Menu/Menu2.js +3 -3
- package/dist/next/Menu/MenuButton.js +17 -18
- package/dist/next/Menu/MenuContext.js +13 -18
- package/dist/next/Menu/MenuItem.js +28 -29
- package/dist/next/Menu/MenuPane.js +74 -61
- package/dist/next/Menu/MenuSearch.js +10 -10
- package/dist/next/Menu/PaneChildren.js +10 -15
- package/dist/next/Menu/SubMenu.js +91 -76
- package/dist/next/Pagination/Pagination.js +40 -31
- package/dist/next/Pagination/RowDisplayCount.js +6 -7
- package/dist/next/PhoneNumberInput/PhoneNumberInput.js +49 -47
- package/dist/next/PhoneNumberInput/PhoneNumberInput2.js +3 -3
- package/dist/next/Select/Select.js +27 -30
- package/dist/next/Select/Select2.js +3 -3
- package/dist/next/Select/SelectButton.js +16 -15
- package/dist/next/Select/SelectContext.js +3 -4
- package/dist/next/Select/SelectItem.js +12 -13
- package/dist/next/Select/SelectPane.js +13 -14
- package/dist/next/Select/SelectedItems.js +16 -10
- package/dist/next/Select/SubSelect.js +21 -18
- package/dist/next/SplitButton/SplitButton.js +28 -21
- package/dist/next/SplitButton/SplitButton2.js +3 -3
- package/dist/next/SplitButton/SplitButtonOption.js +3 -5
- package/dist/next/Stack/Stack.js +26 -26
- package/dist/next/Stack/StackItem.js +12 -14
- package/dist/next/TimePicker/TimeDropdown.js +18 -18
- package/dist/next/TimePicker/TimeInput.js +38 -42
- package/dist/next/TimePicker/TimePicker.js +46 -25
- package/dist/next/TimePicker/TimePicker2.js +3 -3
- package/dist/next/TimePicker/TimePickerIcon.js +5 -7
- package/dist/next/TimePicker/utils.js +34 -13
- package/dist/next/ToggleButton/ToggleButton.js +14 -13
- package/dist/next/ToggleButton/ToggleButtonGroup.js +8 -10
- package/dist/next/ToggleButton/ToggleButtonGroupContext.js +3 -4
- package/dist/next/ToggleButton/styles.js +3 -3
- package/dist/next/Tooltip/Tooltip.js +5 -4
- package/dist/next/Typography/Typography.js +8 -7
- package/dist/next/index.js +2377 -2193
- package/dist/utils/Flyout/Flyout.js +14 -13
- package/dist/utils/Flyout/Flyout2.js +3 -3
- package/dist/utils/Flyout/FlyoutHeader.js +6 -6
- package/dist/utils/Flyout/FlyoutOption.js +11 -8
- package/dist/utils/GridChildrenWrapper/GridChildrenWrapper.js +4 -6
- package/dist/utils/Popper/Popper.js +71 -61
- package/dist/utils/Popper/PopperContext.js +5 -6
- package/dist/utils/Portal/Portal.js +7 -5
- package/dist/utils/Text/Text.js +10 -8
- package/dist/utils/TextOverflowTooltip/TextOverflowTooltip.js +10 -6
- package/dist/utils/Translation/Translate.js +4 -7
- package/dist/utils/Translation/TranslationProvider.js +10 -14
- package/dist/utils/Translation/containsComponentOrElement.js +3 -1
- package/dist/utils/Translation/useTranslation.js +2 -3
- package/dist/utils/VirtuosoTestWrapper/VirtuosoTestWrapper.js +1 -3
- package/dist/utils/filterChildren/filterChildren.js +4 -4
- package/icons/package.json +1 -1
- package/next/package.json +2 -2
- package/package.json +4 -4
|
@@ -1,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 './Radio2.js';
|
|
@@ -6,23 +7,21 @@ import { RadioGroupContextProvider } from './RadioGroupContext.js';
|
|
|
6
7
|
import FormFieldWrapper from '../../next/Form/FormFields/FormFieldWrapper.js';
|
|
7
8
|
import useFormField from '../../next/Form/useFormField.js';
|
|
8
9
|
|
|
10
|
+
const _excluded = ["className", "label", "name", "defaultValue", "value", "onChange", "children", "helperText", "errorText", "data-testid"];
|
|
9
11
|
const RadioGroup = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const {
|
|
24
|
-
fieldErrors
|
|
25
|
-
} = useFormField();
|
|
12
|
+
let className = _ref.className,
|
|
13
|
+
label = _ref.label,
|
|
14
|
+
name = _ref.name,
|
|
15
|
+
defaultValue = _ref.defaultValue,
|
|
16
|
+
value = _ref.value,
|
|
17
|
+
onChange = _ref.onChange,
|
|
18
|
+
children = _ref.children,
|
|
19
|
+
helperText = _ref.helperText,
|
|
20
|
+
errorText = _ref.errorText,
|
|
21
|
+
dataTestId = _ref['data-testid'],
|
|
22
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
23
|
+
const _useFormField = useFormField(),
|
|
24
|
+
fieldErrors = _useFormField.fieldErrors;
|
|
26
25
|
const classes = classNames(className, styles.radioGroup);
|
|
27
26
|
return /*#__PURE__*/React__default.createElement(RadioGroupContextProvider, {
|
|
28
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
|
-
Provider
|
|
6
|
-
useContext
|
|
7
|
-
} = createContextUtilities({});
|
|
4
|
+
const _createContextUtiliti = createContextUtilities({}),
|
|
5
|
+
RadioGroupContextProvider = _createContextUtiliti.Provider,
|
|
6
|
+
useRadioGroupContext = _createContextUtiliti.useContext;
|
|
8
7
|
|
|
9
8
|
export { RadioGroupContextProvider, useRadioGroupContext };
|
|
@@ -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 './Radio2.js';
|
|
@@ -6,17 +7,17 @@ import Radio from './Radio.js';
|
|
|
6
7
|
import '../Label/index.js';
|
|
7
8
|
import Label from '../Label/Label.js';
|
|
8
9
|
|
|
10
|
+
const _excluded = ["value", "label", "id", "className", "disabled", "inputProps", "aria-describedby"];
|
|
9
11
|
const RadioOption = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
disabled = false,
|
|
16
|
-
inputProps,
|
|
17
|
-
'aria-describedby'
|
|
18
|
-
|
|
19
|
-
} = _ref;
|
|
12
|
+
let value = _ref.value,
|
|
13
|
+
label = _ref.label,
|
|
14
|
+
id = _ref.id,
|
|
15
|
+
className = _ref.className,
|
|
16
|
+
_ref$disabled = _ref.disabled,
|
|
17
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
18
|
+
inputProps = _ref.inputProps,
|
|
19
|
+
ariaDescribedBy = _ref['aria-describedby'],
|
|
20
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
20
21
|
return /*#__PURE__*/React__default.createElement(Label, _extends({}, rest, {
|
|
21
22
|
ref: ref,
|
|
22
23
|
htmlFor: id,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
1
2
|
import React__default, { forwardRef, useState, useRef, useEffect } from 'react';
|
|
2
3
|
import classNames from 'classnames';
|
|
3
4
|
import styles from './SearchInput2.js';
|
|
@@ -14,32 +15,38 @@ import SearchIcon from '../../icons/components/SearchIcon.js';
|
|
|
14
15
|
import CloseIcon from '../../icons/components/CloseIcon.js';
|
|
15
16
|
|
|
16
17
|
const SearchInput = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
17
|
-
let
|
|
18
|
-
defaultValue = '',
|
|
19
|
-
value,
|
|
20
|
-
onChange,
|
|
21
|
-
onKeyDown,
|
|
22
|
-
placeholder,
|
|
23
|
-
'aria-label'
|
|
24
|
-
'aria-labelledby'
|
|
25
|
-
'aria-describedby'
|
|
26
|
-
'aria-controls'
|
|
27
|
-
'aria-expanded'
|
|
28
|
-
isDisabled =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const
|
|
18
|
+
let _ref$defaultValue = _ref.defaultValue,
|
|
19
|
+
defaultValue = _ref$defaultValue === void 0 ? '' : _ref$defaultValue,
|
|
20
|
+
value = _ref.value,
|
|
21
|
+
onChange = _ref.onChange,
|
|
22
|
+
onKeyDown = _ref.onKeyDown,
|
|
23
|
+
placeholder = _ref.placeholder,
|
|
24
|
+
ariaLabel = _ref['aria-label'],
|
|
25
|
+
ariaLabelledby = _ref['aria-labelledby'],
|
|
26
|
+
ariaDescribedby = _ref['aria-describedby'],
|
|
27
|
+
ariaControls = _ref['aria-controls'],
|
|
28
|
+
ariaExpanded = _ref['aria-expanded'],
|
|
29
|
+
_ref$isDisabled = _ref.isDisabled,
|
|
30
|
+
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
31
|
+
onFocus = _ref.onFocus,
|
|
32
|
+
onBlur = _ref.onBlur,
|
|
33
|
+
className = _ref.className,
|
|
34
|
+
style = _ref.style,
|
|
35
|
+
id = _ref.id,
|
|
36
|
+
dataTestId = _ref['data-testid'],
|
|
37
|
+
_ref$role = _ref.role,
|
|
38
|
+
role = _ref$role === void 0 ? 'searchbox' : _ref$role;
|
|
39
|
+
const _useControllableState = useControllableState(defaultValue, onChange, value),
|
|
40
|
+
_useControllableState2 = _slicedToArray(_useControllableState, 2),
|
|
41
|
+
inputValue = _useControllableState2[0],
|
|
42
|
+
setInputValue = _useControllableState2[1];
|
|
43
|
+
const _useState = useState(false),
|
|
44
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
45
|
+
wasInputValueCleared = _useState2[0],
|
|
46
|
+
setWasInputValueCleared = _useState2[1];
|
|
39
47
|
const inputRef = useRef(null);
|
|
40
|
-
const
|
|
41
|
-
translate
|
|
42
|
-
} = useTranslation();
|
|
48
|
+
const _useTranslation = useTranslation(),
|
|
49
|
+
translate = _useTranslation.translate;
|
|
43
50
|
const clearButtonLabel = translate('clearSearchInput');
|
|
44
51
|
const isClearButtonHidden = !inputValue || isDisabled;
|
|
45
52
|
const usedWithinInputGroup = !!useInputGroupContext().className;
|
|
@@ -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 = {"searchInput":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._iIlJp{display:inline-block;position:relative}._g37-n._g37-n{padding-left:36px;padding-right:36px;width:100%}._g37-n._g37-n:disabled+._U7baw{fill-opacity:.6}._U7baw{position:absolute;top:50%;left:0;transform:translateY(-50%);margin-left:6px;fill:#515559;pointer-events:none}._U7baw._VuU7O{z-index:20}._FROha{position:absolute;top:0;right:0;width:36px;height:100%;background-color:transparent;line-height:0;border:none;border-radius:4px}._FROha:hover{cursor:pointer}._FROha:hover>._mxGoE{fill:#32363a}._FROha:focus{outline:none;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._mxGoE{fill:#515559}";
|
|
4
|
+
var styles = {"searchInput":"_iIlJp","searchInputInput":"_g37-n","searchInputSearchIcon":"_U7baw","usedWithinInputGroup":"_VuU7O","searchInputClearButton":"_FROha","searchInputClearButtonIcon":"_mxGoE"};
|
|
5
|
+
var stylesheet="._iIlJp{display:inline-block;position:relative}._g37-n._g37-n{padding-left:36px;padding-right:36px;width:100%}._g37-n._g37-n:disabled+._U7baw{fill-opacity:.6}._U7baw{position:absolute;top:50%;left:0;transform:translateY(-50%);margin-left:6px;fill:#515559;pointer-events:none}._U7baw._VuU7O{z-index:20}._FROha{position:absolute;top:0;right:0;width:36px;height:100%;background-color:transparent;line-height:0;border:none;border-radius:4px}._FROha:hover{cursor:pointer}._FROha:hover>._mxGoE{fill:#32363a}._FROha:focus{outline:none;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._mxGoE{fill:#515559}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -14,12 +14,10 @@ import ChevronRightIcon from '../../icons/components/ChevronRightIcon.js';
|
|
|
14
14
|
import ChevronLeftIcon from '../../icons/components/ChevronLeftIcon.js';
|
|
15
15
|
|
|
16
16
|
const ExpandCollapseButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
17
|
-
const
|
|
18
|
-
translate
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
isCollapsed
|
|
22
|
-
} = useSidebarNavContext();
|
|
17
|
+
const _useTranslation = useTranslation(),
|
|
18
|
+
translate = _useTranslation.translate;
|
|
19
|
+
const _useSidebarNavContext = useSidebarNavContext(),
|
|
20
|
+
isCollapsed = _useSidebarNavContext.isCollapsed;
|
|
23
21
|
if (isCollapsed) {
|
|
24
22
|
const expandSidebarLabel = translate('showLabels');
|
|
25
23
|
return /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
1
2
|
import React__default, { forwardRef, useRef, useState, useEffect } from 'react';
|
|
2
3
|
import classNames from 'classnames';
|
|
3
4
|
import styles from './SidebarNav2.js';
|
|
@@ -14,20 +15,25 @@ import getSubDataTestId from '../../utils/getSubDataTestId/getSubDataTestId.js';
|
|
|
14
15
|
// is the render function
|
|
15
16
|
|
|
16
17
|
const SidebarNav = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
17
|
-
let
|
|
18
|
-
isCollapsible = true,
|
|
19
|
-
isCollapsed
|
|
20
|
-
onIsCollapsedChange,
|
|
21
|
-
children,
|
|
22
|
-
NavLink,
|
|
23
|
-
'aria-label'
|
|
24
|
-
'aria-labelledby'
|
|
25
|
-
'aria-describedby'
|
|
26
|
-
'data-testid'
|
|
27
|
-
} = _ref;
|
|
18
|
+
let _ref$isCollapsible = _ref.isCollapsible,
|
|
19
|
+
isCollapsible = _ref$isCollapsible === void 0 ? true : _ref$isCollapsible,
|
|
20
|
+
externalIsCollapsed = _ref.isCollapsed,
|
|
21
|
+
onIsCollapsedChange = _ref.onIsCollapsedChange,
|
|
22
|
+
children = _ref.children,
|
|
23
|
+
NavLink = _ref.NavLink,
|
|
24
|
+
ariaLabel = _ref['aria-label'],
|
|
25
|
+
ariaLabelledBy = _ref['aria-labelledby'],
|
|
26
|
+
ariaDescribedBy = _ref['aria-describedby'],
|
|
27
|
+
dataTestId = _ref['data-testid'];
|
|
28
28
|
const expandCollapseButtonRef = useRef(null);
|
|
29
|
-
const
|
|
30
|
-
|
|
29
|
+
const _useState = useState(false),
|
|
30
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
+
isExpandCollapseButtonFocused = _useState2[0],
|
|
32
|
+
setIsExpandCollapseButtonFocused = _useState2[1];
|
|
33
|
+
const _useControllableState = useControllableState(false, isCollapsible ? onIsCollapsedChange : undefined, isCollapsible && externalIsCollapsed),
|
|
34
|
+
_useControllableState2 = _slicedToArray(_useControllableState, 2),
|
|
35
|
+
isCollapsed = _useControllableState2[0],
|
|
36
|
+
setIsCollapsed = _useControllableState2[1];
|
|
31
37
|
|
|
32
38
|
/*
|
|
33
39
|
* Focuses the new expand/collapse button when the tabs expand/collapse and the old expand/collapse button was focused.
|
|
@@ -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 = {"sideBarNav":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._-XRYQ{grid-area:sidebarNav;height:100%;display:flex;flex-direction:column;align-items:center;min-width:165px;max-width:240px;background-color:#fff;border-right:1px solid #eee;overflow:hidden}._-XRYQ._iTKMa{width:69px;min-width:auto;max-width:none}._Z-TJB{margin:12px 0 28px;width:100%;overflow:auto;padding:4px 16px 0}._aDBRb{margin-bottom:12px;background-color:transparent!important}._aDBRb:hover{background-color:#efefef!important}._aDBRb:hover ._Ar0pS{fill:#32363a}._aDBRb:hover ._dALJr{color:#32363a}._aDBRb:active{background-color:rgba(11,110,208,.12)!important}._aDBRb:active ._Ar0pS{fill:#0854a1}._aDBRb:active ._dALJr{color:#0854a1}._aDBRb._8FAT-{background-color:rgba(11,110,208,.08)!important}._aDBRb._8FAT- ._Ar0pS{fill:#0b6ed0}._aDBRb._8FAT- ._dALJr{color:#0b6ed0;font-family:\"72Duplex\",\"72\",\"Helvetica Neue\",Helvetica,Arial,sans-serif;font-weight:500}._aDBRb._8FAT-:hover{background-color:rgba(11,110,208,.15)!important}._aDBRb._8FAT-:hover ._Ar0pS{fill:#085caf}._aDBRb._8FAT-:hover ._dALJr{color:#085caf}._aDBRb._8FAT-:active{background-color:rgba(11,110,208,.12)!important}._aDBRb._8FAT-:active ._Ar0pS{fill:#0854a1}._aDBRb._8FAT-:active ._dALJr{color:#0854a1}._pKBVp{border-radius:6px}._pKBVp ._Ar0pS{display:block;fill:#515559}._aoVoF{width:100%;padding:0 16px;margin-top:auto;margin-bottom:0}._m4S-3,._tOMkO{width:100%;display:flex;align-items:start;border:1px solid transparent;border-radius:6px;outline:none;cursor:pointer;padding:5px 11px 5px 5px;text-decoration:none}._m4S-3 ._Ar0pS,._tOMkO ._Ar0pS{fill:#515559}._m4S-3 ._dALJr,._tOMkO ._dALJr{font-size:14px;line-height:19px;color:#515559;overflow:hidden;overflow-wrap:break-word;margin:2.5px 0 2.5px 6px}._aDBRb.focus-visible,._aDBRb:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
4
|
+
var styles = {"sideBarNav":"_-XRYQ","collapsed":"_iTKMa","navItems":"_Z-TJB","sidebarNavItem":"_aDBRb","icon":"_Ar0pS","label":"_dALJr","selected":"_8FAT-","sidebarNavItemIconButton":"_pKBVp","expandCollapseButtonContainer":"_aoVoF","navLink":"_tOMkO","iconButtonWithLabel":"_m4S-3"};
|
|
5
|
+
var stylesheet="._-XRYQ{grid-area:sidebarNav;height:100%;display:flex;flex-direction:column;align-items:center;min-width:165px;max-width:240px;background-color:#fff;border-right:1px solid #eee;overflow:hidden}._-XRYQ._iTKMa{width:69px;min-width:auto;max-width:none}._Z-TJB{margin:12px 0 28px;width:100%;overflow:auto;padding:4px 16px 0}._aDBRb{margin-bottom:12px;background-color:transparent!important}._aDBRb:hover{background-color:#efefef!important}._aDBRb:hover ._Ar0pS{fill:#32363a}._aDBRb:hover ._dALJr{color:#32363a}._aDBRb:active{background-color:rgba(11,110,208,.12)!important}._aDBRb:active ._Ar0pS{fill:#0854a1}._aDBRb:active ._dALJr{color:#0854a1}._aDBRb._8FAT-{background-color:rgba(11,110,208,.08)!important}._aDBRb._8FAT- ._Ar0pS{fill:#0b6ed0}._aDBRb._8FAT- ._dALJr{color:#0b6ed0;font-family:\"72Duplex\",\"72\",\"Helvetica Neue\",Helvetica,Arial,sans-serif;font-weight:500}._aDBRb._8FAT-:hover{background-color:rgba(11,110,208,.15)!important}._aDBRb._8FAT-:hover ._Ar0pS{fill:#085caf}._aDBRb._8FAT-:hover ._dALJr{color:#085caf}._aDBRb._8FAT-:active{background-color:rgba(11,110,208,.12)!important}._aDBRb._8FAT-:active ._Ar0pS{fill:#0854a1}._aDBRb._8FAT-:active ._dALJr{color:#0854a1}._pKBVp{border-radius:6px}._pKBVp ._Ar0pS{display:block;fill:#515559}._aoVoF{width:100%;padding:0 16px;margin-top:auto;margin-bottom:0}._m4S-3,._tOMkO{width:100%;display:flex;align-items:start;border:1px solid transparent;border-radius:6px;outline:none;cursor:pointer;padding:5px 11px 5px 5px;text-decoration:none}._m4S-3 ._Ar0pS,._tOMkO ._Ar0pS{fill:#515559}._m4S-3 ._dALJr,._tOMkO ._dALJr{font-size:14px;line-height:19px;color:#515559;overflow:hidden;overflow-wrap:break-word;margin:2.5px 0 2.5px 6px}._aDBRb.focus-visible,._aDBRb:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
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
|
+
SidebarNavContextProvider = _createContextUtiliti.Provider,
|
|
6
|
+
useSidebarNavContext = _createContextUtiliti.useContext;
|
|
8
7
|
|
|
9
8
|
export { SidebarNavContextProvider, useSidebarNavContext };
|
|
@@ -15,16 +15,13 @@ import Tooltip from '../Tooltip/Tooltip.js';
|
|
|
15
15
|
// v6 (props: { isActive: boolean }) => string
|
|
16
16
|
const resolveIsActiveValue = val => typeof val === 'boolean' ? val : val.isActive;
|
|
17
17
|
const SidebarNavLink = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
isCollapsed,
|
|
26
|
-
NavLink
|
|
27
|
-
} = useSidebarNavContext();
|
|
18
|
+
let icon = _ref.icon,
|
|
19
|
+
label = _ref.label,
|
|
20
|
+
to = _ref.to,
|
|
21
|
+
dataTestId = _ref['data-testid'];
|
|
22
|
+
const _useSidebarNavContext = useSidebarNavContext(),
|
|
23
|
+
isCollapsed = _useSidebarNavContext.isCollapsed,
|
|
24
|
+
NavLink = _useSidebarNavContext.NavLink;
|
|
28
25
|
const Icon = isCollapsed ? icon !== null && icon !== void 0 ? icon : ExcludeIcon : icon;
|
|
29
26
|
const link = /*#__PURE__*/React__default.createElement(NavLink, {
|
|
30
27
|
className: isActive => classNames(styles.sidebarNavItem, styles.navLink, {
|
|
@@ -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, { useRef, useState } from 'react';
|
|
3
5
|
import classNames from 'classnames';
|
|
4
6
|
import styles from './Slider2.js';
|
|
@@ -8,30 +10,38 @@ import '../../hooks/index.js';
|
|
|
8
10
|
import useControllableState from '../../hooks/useControllableState/useControllableState.js';
|
|
9
11
|
import useSSRLayoutEffect from '../../hooks/useSSRLayoutEffect/useSSRLayoutEffect.js';
|
|
10
12
|
|
|
13
|
+
const _excluded = ["className", "defaultValues", "formatter", "max", "min", "onChange", "step", "values", "minAriaLabel", "maxAriaLabel", "minAriaLabelledBy", "maxAriaLabelledBy", "minAriaDescribedBy", "maxAriaDescribedBy"];
|
|
11
14
|
const sortArrayOf2 = numbersToSort => [Math.min(...numbersToSort), Math.max(...numbersToSort)];
|
|
12
15
|
const isMinimalValue = (value, array) => value === Math.min(...array);
|
|
13
16
|
const isMaximalValue = (value, array) => value === Math.max(...array);
|
|
14
17
|
const RangeSlider = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
max = 100,
|
|
20
|
-
min =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
18
|
+
let className = _ref.className,
|
|
19
|
+
defaultValues = _ref.defaultValues,
|
|
20
|
+
formatter = _ref.formatter,
|
|
21
|
+
_ref$max = _ref.max,
|
|
22
|
+
max = _ref$max === void 0 ? 100 : _ref$max,
|
|
23
|
+
_ref$min = _ref.min,
|
|
24
|
+
min = _ref$min === void 0 ? 0 : _ref$min,
|
|
25
|
+
onChange = _ref.onChange,
|
|
26
|
+
_ref$step = _ref.step,
|
|
27
|
+
step = _ref$step === void 0 ? 1 : _ref$step,
|
|
28
|
+
externalValues = _ref.values,
|
|
29
|
+
minAriaLabel = _ref.minAriaLabel,
|
|
30
|
+
maxAriaLabel = _ref.maxAriaLabel,
|
|
31
|
+
minAriaLabelledBy = _ref.minAriaLabelledBy,
|
|
32
|
+
maxAriaLabelledBy = _ref.maxAriaLabelledBy,
|
|
33
|
+
minAriaDescribedBy = _ref.minAriaDescribedBy,
|
|
34
|
+
maxAriaDescribedBy = _ref.maxAriaDescribedBy,
|
|
35
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
32
36
|
const trackRef = useRef(null);
|
|
33
|
-
const
|
|
34
|
-
|
|
37
|
+
const _useControllableState = useControllableState(Array.isArray(defaultValues) && defaultValues.length === 2 ? defaultValues : [min, max], valuesToSort => onChange === null || onChange === void 0 ? void 0 : onChange(sortArrayOf2(valuesToSort)), externalValues),
|
|
38
|
+
_useControllableState2 = _slicedToArray(_useControllableState, 2),
|
|
39
|
+
values = _useControllableState2[0],
|
|
40
|
+
setValues = _useControllableState2[1];
|
|
41
|
+
const _React$useState = React__default.useState(values.map(value => valueToPercent(value, max, min))),
|
|
42
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
43
|
+
buttonPositions = _React$useState2[0],
|
|
44
|
+
setButtonPositions = _React$useState2[1];
|
|
35
45
|
const updateValue = (newValue, index) => {
|
|
36
46
|
const roundedValue = roundToStep(newValue, max, min, step);
|
|
37
47
|
if (values[index] !== roundedValue) {
|
|
@@ -42,10 +52,9 @@ const RangeSlider = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
42
52
|
};
|
|
43
53
|
const updateValueFromPoint = (point, index) => {
|
|
44
54
|
if (trackRef.current !== null) {
|
|
45
|
-
const
|
|
46
|
-
left
|
|
47
|
-
width
|
|
48
|
-
} = trackRef.current.getBoundingClientRect();
|
|
55
|
+
const _trackRef$current$get = trackRef.current.getBoundingClientRect(),
|
|
56
|
+
trackStart = _trackRef$current$get.left,
|
|
57
|
+
trackWidth = _trackRef$current$get.width;
|
|
49
58
|
const newPoint = Math.min(Math.max(0, point - trackStart), trackWidth);
|
|
50
59
|
const newValue = pointToValue(newPoint, max, min, trackWidth);
|
|
51
60
|
if (index === undefined) {
|
|
@@ -103,7 +112,10 @@ const RangeSlider = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
103
112
|
useSSRLayoutEffect(() => {
|
|
104
113
|
setButtonPositions(values.map(value => valueToPercent(value, max, min)));
|
|
105
114
|
}, [max, min, values]);
|
|
106
|
-
const
|
|
115
|
+
const _useState = useState(undefined),
|
|
116
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
117
|
+
draggedButtonIndex = _useState2[0],
|
|
118
|
+
setDraggedButtonIndex = _useState2[1];
|
|
107
119
|
const onButtonDragging = (buttonIndex, isDragging) => {
|
|
108
120
|
if (isDragging) {
|
|
109
121
|
setDraggedButtonIndex(buttonIndex);
|
|
@@ -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, { useRef } from 'react';
|
|
3
5
|
import classNames from 'classnames';
|
|
4
6
|
import styles from './Slider2.js';
|
|
@@ -7,6 +9,7 @@ import '../../hooks/index.js';
|
|
|
7
9
|
import useControllableState from '../../hooks/useControllableState/useControllableState.js';
|
|
8
10
|
import useSSRLayoutEffect from '../../hooks/useSSRLayoutEffect/useSSRLayoutEffect.js';
|
|
9
11
|
|
|
12
|
+
const _excluded = ["className", "defaultValue", "formatter", "max", "min", "onChange", "step", "value", "aria-label", "aria-labelledby", "aria-describedby"];
|
|
10
13
|
const clamp = (value, max, min) => Math.min(Math.max(value, min), max);
|
|
11
14
|
const countDecimals = value => {
|
|
12
15
|
if (value % 1 !== 0) {
|
|
@@ -30,23 +33,30 @@ const roundToStep = (value, max, min, step) => {
|
|
|
30
33
|
const valueToPercent = (value, max, min) => (value - min) * 100 / (max - min);
|
|
31
34
|
const pointToValue = (point, max, min, width) => point * (max - min) / width + min;
|
|
32
35
|
const Slider = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
33
|
-
let
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
max = 100,
|
|
38
|
-
min =
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
'aria-
|
|
45
|
-
|
|
46
|
-
|
|
36
|
+
let className = _ref.className,
|
|
37
|
+
defaultValue = _ref.defaultValue,
|
|
38
|
+
formatter = _ref.formatter,
|
|
39
|
+
_ref$max = _ref.max,
|
|
40
|
+
max = _ref$max === void 0 ? 100 : _ref$max,
|
|
41
|
+
_ref$min = _ref.min,
|
|
42
|
+
min = _ref$min === void 0 ? 0 : _ref$min,
|
|
43
|
+
onChange = _ref.onChange,
|
|
44
|
+
_ref$step = _ref.step,
|
|
45
|
+
step = _ref$step === void 0 ? 1 : _ref$step,
|
|
46
|
+
externalValue = _ref.value,
|
|
47
|
+
ariaLabel = _ref['aria-label'],
|
|
48
|
+
ariaLabelledBy = _ref['aria-labelledby'],
|
|
49
|
+
ariaDescribedBy = _ref['aria-describedby'],
|
|
50
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
47
51
|
const trackRef = useRef(null);
|
|
48
|
-
const
|
|
49
|
-
|
|
52
|
+
const _useControllableState = useControllableState(defaultValue !== undefined ? defaultValue : min, onChange, externalValue),
|
|
53
|
+
_useControllableState2 = _slicedToArray(_useControllableState, 2),
|
|
54
|
+
value = _useControllableState2[0],
|
|
55
|
+
setValue = _useControllableState2[1];
|
|
56
|
+
const _React$useState = React__default.useState(valueToPercent(value, max, min)),
|
|
57
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
58
|
+
buttonPosition = _React$useState2[0],
|
|
59
|
+
setButtonPosition = _React$useState2[1];
|
|
50
60
|
const updateValue = newValue => {
|
|
51
61
|
const roundedValue = roundToStep(newValue, max, min, step);
|
|
52
62
|
if (roundedValue !== value) {
|
|
@@ -55,10 +65,9 @@ const Slider = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
55
65
|
};
|
|
56
66
|
const updateValueFromPoint = point => {
|
|
57
67
|
if (trackRef.current !== null) {
|
|
58
|
-
const
|
|
59
|
-
left
|
|
60
|
-
width
|
|
61
|
-
} = trackRef.current.getBoundingClientRect();
|
|
68
|
+
const _trackRef$current$get = trackRef.current.getBoundingClientRect(),
|
|
69
|
+
trackStart = _trackRef$current$get.left,
|
|
70
|
+
trackWidth = _trackRef$current$get.width;
|
|
62
71
|
const newPoint = Math.min(Math.max(0, point - trackStart), trackWidth);
|
|
63
72
|
const newValue = pointToValue(newPoint, max, min, trackWidth);
|
|
64
73
|
updateValue(newValue);
|
|
@@ -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 = {"slider":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._uAssC{height:auto;width:200px;padding:5px 10px}._c5-lv{position:relative;height:10px;border:1px solid #898989;border-radius:5px;background:#fafafa}._ooAoN{top:-1px;bottom:-1px;background-color:#007ac0;border:1px solid #007ac0;border-radius:5px}._JS86F,._ooAoN{position:absolute}._JS86F{top:-5px;left:-10px;border:1px solid #007ac0;overflow:visible;width:18px;height:18px;padding:0;margin:0;border-radius:9px;cursor:pointer;display:inline-block;text-align:center;background:#fff;text-decoration:none;outline:none}._JS86F:before{content:\"\";position:absolute;top:4px;left:4px;background:#007ac0;width:8px;height:8px;border-radius:10px}._JS86F.focus-visible,._JS86F:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
4
|
+
var styles = {"slider":"_uAssC","track":"_c5-lv","fill":"_ooAoN","button":"_JS86F"};
|
|
5
|
+
var stylesheet="._uAssC{height:auto;width:200px;padding:5px 10px}._c5-lv{position:relative;height:10px;border:1px solid #898989;border-radius:5px;background:#fafafa}._ooAoN{top:-1px;bottom:-1px;background-color:#007ac0;border:1px solid #007ac0;border-radius:5px}._JS86F,._ooAoN{position:absolute}._JS86F{top:-5px;left:-10px;border:1px solid #007ac0;overflow:visible;width:18px;height:18px;padding:0;margin:0;border-radius:9px;cursor:pointer;display:inline-block;text-align:center;background:#fff;text-decoration:none;outline:none}._JS86F:before{content:\"\";position:absolute;top:4px;left:4px;background:#007ac0;width:8px;height:8px;border-radius:10px}._JS86F.focus-visible,._JS86F:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
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 } from 'react';
|
|
3
5
|
import styles from './Slider2.js';
|
|
4
6
|
import '../Tooltip/index.js';
|
|
@@ -7,25 +9,29 @@ import useMounted from '../../hooks/useMounted/useMounted.js';
|
|
|
7
9
|
import useEventListener from '../../hooks/useEventListener/useEventListener.js';
|
|
8
10
|
import Tooltip from '../Tooltip/Tooltip.js';
|
|
9
11
|
|
|
12
|
+
const _excluded = ["buttonPosition", "onMouseMove", "onKeyDown", "onIsDraggingChange", "blockTooltip", "value", "aria-label", "aria-labelledby", "aria-describedby", "aria-valuemin", "aria-valuemax", "aria-valuenow"];
|
|
10
13
|
const buttonOffset = -10;
|
|
11
14
|
const SliderButton = _ref => {
|
|
12
|
-
let
|
|
13
|
-
buttonPosition = 0,
|
|
14
|
-
onMouseMove,
|
|
15
|
-
onKeyDown,
|
|
16
|
-
onIsDraggingChange,
|
|
17
|
-
blockTooltip,
|
|
18
|
-
value =
|
|
19
|
-
'
|
|
20
|
-
'aria-
|
|
21
|
-
'aria-
|
|
22
|
-
'aria-
|
|
23
|
-
'aria-
|
|
24
|
-
'aria-
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
let _ref$buttonPosition = _ref.buttonPosition,
|
|
16
|
+
buttonPosition = _ref$buttonPosition === void 0 ? 0 : _ref$buttonPosition,
|
|
17
|
+
onMouseMove = _ref.onMouseMove,
|
|
18
|
+
onKeyDown = _ref.onKeyDown,
|
|
19
|
+
onIsDraggingChange = _ref.onIsDraggingChange,
|
|
20
|
+
blockTooltip = _ref.blockTooltip,
|
|
21
|
+
_ref$value = _ref.value,
|
|
22
|
+
value = _ref$value === void 0 ? '0' : _ref$value,
|
|
23
|
+
ariaLabel = _ref['aria-label'],
|
|
24
|
+
ariaLabelledBy = _ref['aria-labelledby'],
|
|
25
|
+
ariaDescribedBy = _ref['aria-describedby'],
|
|
26
|
+
ariaValueMin = _ref['aria-valuemin'],
|
|
27
|
+
ariaValueMax = _ref['aria-valuemax'],
|
|
28
|
+
ariaValueNow = _ref['aria-valuenow'],
|
|
29
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
27
30
|
const isMounted = useMounted();
|
|
28
|
-
const
|
|
31
|
+
const _useState = useState(false),
|
|
32
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
33
|
+
isDragging = _useState2[0],
|
|
34
|
+
setIsDragging = _useState2[1];
|
|
29
35
|
useEffect(() => {
|
|
30
36
|
onIsDraggingChange === null || onIsDraggingChange === void 0 || onIsDraggingChange(isDragging);
|
|
31
37
|
}, [isDragging]);
|
|
@@ -70,7 +76,10 @@ const SliderButton = _ref => {
|
|
|
70
76
|
role: "slider",
|
|
71
77
|
tabIndex: 0
|
|
72
78
|
}));
|
|
73
|
-
const
|
|
79
|
+
const _useState3 = useState(false),
|
|
80
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
81
|
+
showTooltip = _useState4[0],
|
|
82
|
+
setShowTooltip = _useState4[1];
|
|
74
83
|
return /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
75
84
|
show: showTooltip && !blockTooltip,
|
|
76
85
|
onShowChange: shouldShowTooltip => setShowTooltip((isDragging || shouldShowTooltip) && !blockTooltip)
|
|
@@ -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 './Switch2.js';
|
|
@@ -6,26 +7,25 @@ import { useFormFieldContext } from '../FormField/FormFieldContext.js';
|
|
|
6
7
|
import '../../utils/index.js';
|
|
7
8
|
import concatIds from '../../utils/concatIds/concatIds.js';
|
|
8
9
|
|
|
10
|
+
const _excluded = ["id", "className", "checked", "defaultChecked", "disabled", "onChange", "value", "inputProps", "aria-label", "aria-labelledby", "aria-describedby", "tabIndex"];
|
|
9
11
|
const Switch = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
disabled = false,
|
|
16
|
-
onChange,
|
|
17
|
-
value,
|
|
18
|
-
inputProps,
|
|
19
|
-
'aria-label'
|
|
20
|
-
'aria-labelledby'
|
|
21
|
-
'aria-describedby'
|
|
22
|
-
tabIndex,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
errorTextId: formFieldErrorTextId
|
|
28
|
-
} = useFormFieldContext();
|
|
12
|
+
let id = _ref.id,
|
|
13
|
+
className = _ref.className,
|
|
14
|
+
checked = _ref.checked,
|
|
15
|
+
defaultChecked = _ref.defaultChecked,
|
|
16
|
+
_ref$disabled = _ref.disabled,
|
|
17
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
18
|
+
onChange = _ref.onChange,
|
|
19
|
+
value = _ref.value,
|
|
20
|
+
inputProps = _ref.inputProps,
|
|
21
|
+
ariaLabel = _ref['aria-label'],
|
|
22
|
+
ariaLabelledBy = _ref['aria-labelledby'],
|
|
23
|
+
externalAriaDescribedBy = _ref['aria-describedby'],
|
|
24
|
+
tabIndex = _ref.tabIndex,
|
|
25
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
26
|
+
const _useFormFieldContext = useFormFieldContext(),
|
|
27
|
+
formFieldHelperTextId = _useFormFieldContext.helperTextId,
|
|
28
|
+
formFieldErrorTextId = _useFormFieldContext.errorTextId;
|
|
29
29
|
const internalAriaDescribedby = concatIds(externalAriaDescribedBy, formFieldHelperTextId, formFieldErrorTextId, inputProps === null || inputProps === void 0 ? void 0 : inputProps['aria-describedby']);
|
|
30
30
|
return /*#__PURE__*/React__default.createElement("span", _extends({}, rest, {
|
|
31
31
|
ref: ref,
|