@carbon/react 1.29.1 → 1.30.0-rc.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/es/_virtual/_rollupPluginBabelHelpers.js +16 -5
- package/es/components/Accordion/Accordion.Skeleton.js +0 -7
- package/es/components/Accordion/Accordion.js +1 -8
- package/es/components/Accordion/AccordionItem.js +5 -19
- package/es/components/AspectRatio/AspectRatio.js +0 -5
- package/es/components/Breadcrumb/Breadcrumb.Skeleton.js +0 -3
- package/es/components/Breadcrumb/Breadcrumb.js +0 -3
- package/es/components/Breadcrumb/BreadcrumbItem.js +0 -7
- package/es/components/Button/Button.Skeleton.js +2 -7
- package/es/components/Button/Button.js +2 -36
- package/es/components/ButtonSet/ButtonSet.js +0 -2
- package/es/components/Checkbox/Checkbox.Skeleton.js +0 -1
- package/es/components/Checkbox/Checkbox.js +4 -20
- package/es/components/CheckboxGroup/CheckboxGroup.js +0 -11
- package/es/components/ClassPrefix/index.d.ts +26 -0
- package/es/components/ClassPrefix/index.js +0 -2
- package/es/components/CodeSnippet/CodeSnippet.Skeleton.js +0 -5
- package/es/components/CodeSnippet/CodeSnippet.js +6 -45
- package/es/components/ComboBox/ComboBox.js +12 -79
- package/es/components/ComboBox/tools/filter.js +0 -1
- package/es/components/ComboButton/index.js +0 -14
- package/es/components/ComposedModal/ComposedModal.js +2 -32
- package/es/components/ComposedModal/ModalFooter.js +0 -21
- package/es/components/ComposedModal/ModalHeader.js +0 -12
- package/es/components/ContainedList/ContainedList.js +5 -32
- package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +0 -6
- package/es/components/ContentSwitcher/ContentSwitcher.js +11 -23
- package/es/components/ContextMenu/useContextMenu.js +1 -6
- package/es/components/Copy/Copy.js +8 -31
- package/es/components/CopyButton/CopyButton.js +0 -4
- package/es/components/DangerButton/DangerButton.js +0 -1
- package/es/components/DataTable/DataTable.js +171 -91
- package/es/components/DataTable/Table.js +0 -6
- package/es/components/DataTable/TableBatchAction.js +0 -4
- package/es/components/DataTable/TableBatchActions.js +0 -8
- package/es/components/DataTable/TableBody.js +0 -1
- package/es/components/DataTable/TableContainer.js +0 -5
- package/es/components/DataTable/TableExpandHeader.js +0 -7
- package/es/components/DataTable/TableExpandRow.js +0 -6
- package/es/components/DataTable/TableExpandedRow.js +0 -6
- package/es/components/DataTable/TableHeader.d.ts +1 -1
- package/es/components/DataTable/TableHeader.js +3 -19
- package/es/components/DataTable/TableRow.js +4 -5
- package/es/components/DataTable/TableSelectAll.js +0 -8
- package/es/components/DataTable/TableSelectRow.js +2 -10
- package/es/components/DataTable/TableToolbar.js +0 -3
- package/es/components/DataTable/TableToolbarMenu.d.ts +1 -1
- package/es/components/DataTable/TableToolbarMenu.js +3 -6
- package/es/components/DataTable/TableToolbarSearch.js +2 -30
- package/es/components/DataTable/state/getDerivedStateFromProps.js +0 -4
- package/es/components/DataTable/state/sorting.js +5 -8
- package/es/components/DataTable/tools/denormalize.js +2 -2
- package/es/components/DataTable/tools/filter.js +0 -2
- package/es/components/DataTable/tools/instanceId.js +0 -1
- package/es/components/DataTable/tools/normalize.js +10 -10
- package/es/components/DataTable/tools/sorting.js +5 -13
- package/es/components/DataTableSkeleton/DataTableSkeleton.js +5 -20
- package/es/components/DatePicker/DatePicker.Skeleton.js +0 -6
- package/es/components/DatePicker/DatePicker.js +152 -174
- package/es/components/DatePicker/plugins/appendToPlugin.js +3 -7
- package/es/components/DatePicker/plugins/fixEventsPlugin.js +14 -25
- package/es/components/DatePicker/plugins/rangePlugin.js +2 -7
- package/es/components/DatePickerInput/DatePickerInput.js +2 -28
- package/es/components/Dropdown/Dropdown.Skeleton.js +0 -2
- package/es/components/Dropdown/Dropdown.js +43 -52
- package/es/components/ErrorBoundary/ErrorBoundary.js +0 -10
- package/es/components/ErrorBoundary/ErrorBoundaryContext.js +0 -1
- package/es/components/ExpandableSearch/ExpandableSearch.js +1 -10
- package/es/components/FeatureFlags/index.js +8 -20
- package/es/components/FileUploader/FileUploader.Skeleton.js +0 -2
- package/es/components/FileUploader/FileUploader.js +3 -38
- package/es/components/FileUploader/FileUploaderButton.js +3 -24
- package/es/components/FileUploader/FileUploaderDropContainer.js +1 -28
- package/es/components/FileUploader/FileUploaderItem.js +1 -11
- package/es/components/FileUploader/Filename.js +0 -10
- package/es/components/FluidComboBox/FluidComboBox.Skeleton.js +0 -1
- package/es/components/FluidComboBox/FluidComboBox.js +0 -18
- package/es/components/FluidDatePicker/FluidDatePicker.Skeleton.js +0 -2
- package/es/components/FluidDatePicker/FluidDatePicker.js +0 -6
- package/es/components/FluidDatePickerInput/FluidDatePickerInput.js +2 -1
- package/es/components/FluidDropdown/FluidDropdown.Skeleton.js +0 -1
- package/es/components/FluidDropdown/FluidDropdown.js +0 -18
- package/es/components/FluidForm/FluidForm.js +0 -2
- package/es/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +0 -1
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +0 -19
- package/es/components/FluidSelect/FluidSelect.Skeleton.js +0 -1
- package/es/components/FluidSelect/FluidSelect.js +0 -10
- package/es/components/FluidTextArea/FluidTextArea.Skeleton.js +0 -1
- package/es/components/FluidTextArea/FluidTextArea.js +0 -20
- package/es/components/FluidTextInput/FluidTextInput.Skeleton.js +0 -1
- package/es/components/FluidTextInput/FluidTextInput.js +0 -14
- package/es/components/FluidTimePicker/FluidTimePicker.Skeleton.js +0 -3
- package/es/components/FluidTimePicker/FluidTimePicker.js +1 -11
- package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +0 -6
- package/es/components/Form/Form.d.ts +23 -0
- package/es/components/Form/Form.js +3 -6
- package/es/components/Form/index.d.ts +7 -0
- package/es/components/FormGroup/FormGroup.js +0 -7
- package/es/components/FormItem/FormItem.js +0 -2
- package/es/components/FormLabel/FormLabel.js +1 -7
- package/es/components/Grid/CSSGrid.js +2 -15
- package/es/components/Grid/Column.js +18 -59
- package/es/components/Grid/ColumnHang.js +2 -5
- package/es/components/Grid/FlexGrid.js +2 -8
- package/es/components/Grid/Grid.js +0 -8
- package/es/components/Grid/GridContext.js +1 -3
- package/es/components/Grid/Row.js +2 -7
- package/es/components/Heading/index.js +0 -4
- package/es/components/Icon/Icon.Skeleton.js +2 -2
- package/es/components/IconButton/index.js +0 -10
- package/es/components/IdPrefix/index.js +0 -2
- package/es/components/InlineCheckbox/InlineCheckbox.js +0 -14
- package/es/components/InlineLoading/InlineLoading.js +0 -12
- package/es/components/Layer/index.js +3 -6
- package/es/components/Layout/LayoutDirection.js +0 -3
- package/es/components/Layout/useLayoutDirection.js +0 -1
- package/es/components/Link/Link.js +3 -10
- package/es/components/ListBox/ListBox.js +2 -13
- package/es/components/ListBox/ListBoxField.js +0 -5
- package/es/components/ListBox/ListBoxMenuIcon.js +0 -4
- package/es/components/ListBox/ListBoxMenuItem.js +2 -6
- package/es/components/ListBox/ListBoxPropTypes.d.ts +2 -2
- package/es/components/ListBox/ListBoxSelection.js +1 -13
- package/es/components/ListBox/next/ListBoxSelection.js +1 -14
- package/es/components/ListBox/next/ListBoxTrigger.js +1 -3
- package/es/components/ListItem/ListItem.d.ts +23 -0
- package/es/components/ListItem/ListItem.js +4 -8
- package/es/components/ListItem/index.d.ts +7 -0
- package/es/components/Loading/Loading.js +0 -6
- package/es/components/Menu/Menu.js +22 -40
- package/es/components/Menu/MenuContext.js +4 -5
- package/es/components/Menu/MenuItem.js +5 -39
- package/es/components/MenuButton/index.js +0 -9
- package/es/components/Modal/Modal.js +0 -43
- package/es/components/ModalWrapper/ModalWrapper.js +2 -15
- package/es/components/MultiSelect/FilterableMultiSelect.js +2 -60
- package/es/components/MultiSelect/MultiSelect.js +22 -70
- package/es/components/MultiSelect/MultiSelectPropTypes.js +0 -1
- package/es/components/MultiSelect/index.js +0 -1
- package/es/components/MultiSelect/tools/itemToString.js +0 -2
- package/es/components/MultiSelect/tools/sorting.js +3 -4
- package/es/components/Notification/Notification.js +0 -78
- package/es/components/NumberInput/NumberInput.Skeleton.js +0 -2
- package/es/components/NumberInput/NumberInput.js +3 -60
- package/es/components/OrderedList/OrderedList.d.ts +39 -0
- package/es/components/OrderedList/OrderedList.js +7 -19
- package/es/components/{Form/index.js → OrderedList/index.d.ts} +1 -3
- package/es/components/OverflowMenu/OverflowMenu.js +65 -86
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +6 -23
- package/es/components/OverflowMenuV2/index.js +0 -5
- package/es/components/Pagination/Pagination.Skeleton.js +0 -2
- package/es/components/Pagination/Pagination.js +11 -47
- package/es/components/Pagination/experimental/PageSelector.js +0 -10
- package/es/components/Pagination/experimental/Pagination.js +2 -48
- package/es/components/PaginationNav/PaginationNav.js +15 -59
- package/es/components/Popover/index.d.ts +14 -8
- package/es/components/Popover/index.js +44 -48
- package/es/components/PrimaryButton/PrimaryButton.js +0 -1
- package/es/components/ProgressBar/ProgressBar.js +0 -15
- package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.js +0 -4
- package/es/components/ProgressIndicator/ProgressIndicator.js +2 -40
- package/es/components/RadioButton/RadioButton.Skeleton.js +0 -1
- package/es/components/RadioButton/RadioButton.js +0 -13
- package/es/components/RadioButtonGroup/RadioButtonGroup.js +3 -23
- package/es/components/RadioTile/RadioTile.js +0 -12
- package/es/components/Search/Search.Skeleton.js +0 -2
- package/es/components/Search/Search.js +1 -28
- package/es/components/SecondaryButton/SecondaryButton.js +0 -1
- package/es/components/Select/Select.Skeleton.js +0 -2
- package/es/components/Select/Select.d.ts +1 -1
- package/es/components/Select/Select.js +6 -33
- package/es/components/SelectItem/SelectItem.js +0 -5
- package/es/components/SelectItemGroup/SelectItemGroup.d.ts +0 -1
- package/es/components/SelectItemGroup/SelectItemGroup.js +1 -7
- package/es/components/SkeletonIcon/SkeletonIcon.js +0 -2
- package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +0 -1
- package/es/components/SkeletonText/SkeletonText.js +0 -12
- package/es/components/Slider/Slider.Skeleton.js +0 -2
- package/es/components/Slider/Slider.d.ts +0 -1
- package/es/components/Slider/Slider.js +112 -135
- package/es/components/Stack/Stack.js +1 -8
- package/es/components/StructuredList/StructuredList.Skeleton.js +0 -5
- package/es/components/StructuredList/StructuredList.js +1 -25
- package/es/components/Switch/IconSwitch.js +0 -18
- package/es/components/Switch/Switch.js +0 -11
- package/es/components/TabContent/TabContent.js +2 -6
- package/es/components/Tabs/Tabs.Skeleton.js +0 -4
- package/es/components/Tabs/Tabs.js +135 -104
- package/es/components/Tabs/usePressable.js +18 -31
- package/es/components/Tag/Tag.Skeleton.js +0 -2
- package/es/components/Tag/Tag.js +0 -15
- package/es/components/Text/Text.js +5 -18
- package/es/components/Text/TextDirection.js +0 -3
- package/es/components/Text/TextDirectionContext.js +0 -1
- package/es/components/Text/createTextComponent.js +0 -3
- package/es/components/TextArea/TextArea.Skeleton.js +0 -2
- package/es/components/TextArea/TextArea.js +11 -33
- package/es/components/TextInput/ControlledPasswordInput.js +0 -20
- package/es/components/TextInput/PasswordInput.js +0 -25
- package/es/components/TextInput/TextInput.Skeleton.js +0 -2
- package/es/components/TextInput/TextInput.d.ts +1 -1
- package/es/components/TextInput/TextInput.js +5 -33
- package/es/components/TextInput/util.js +3 -5
- package/es/components/Theme/index.js +1 -6
- package/es/components/Tile/Tile.js +32 -59
- package/es/components/TileGroup/TileGroup.js +1 -22
- package/es/components/TimePicker/TimePicker.js +6 -32
- package/es/components/TimePickerSelect/TimePickerSelect.js +2 -5
- package/es/components/Toggle/Toggle.Skeleton.js +0 -8
- package/es/components/Toggle/Toggle.js +0 -16
- package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +0 -7
- package/es/components/Toggletip/index.d.ts +148 -0
- package/es/components/Toggletip/index.js +20 -44
- package/es/components/Tooltip/DefinitionTooltip.js +0 -11
- package/es/components/Tooltip/Tooltip.d.ts +1 -1
- package/es/components/Tooltip/Tooltip.js +4 -21
- package/es/components/TreeView/TreeNode.js +21 -66
- package/es/components/TreeView/TreeView.js +11 -67
- package/es/components/UIShell/Content.js +2 -4
- package/es/components/UIShell/Header.js +0 -2
- package/es/components/UIShell/HeaderContainer.d.ts +33 -0
- package/es/components/UIShell/HeaderContainer.js +13 -11
- package/es/components/UIShell/HeaderGlobalAction.js +0 -6
- package/es/components/UIShell/HeaderGlobalBar.js +0 -1
- package/es/components/UIShell/HeaderMenu.js +32 -31
- package/es/components/UIShell/HeaderMenuButton.js +2 -4
- package/es/components/UIShell/HeaderMenuItem.js +0 -8
- package/es/components/UIShell/HeaderName.js +0 -5
- package/es/components/UIShell/HeaderNavigation.js +0 -2
- package/es/components/UIShell/HeaderPanel.js +0 -2
- package/es/components/UIShell/HeaderSideNavItems.js +0 -2
- package/es/components/UIShell/Link.js +2 -3
- package/es/components/UIShell/SideNav.d.ts +3 -1
- package/es/components/UIShell/SideNav.js +44 -36
- package/es/components/UIShell/SideNavDetails.js +0 -3
- package/es/components/UIShell/SideNavDivider.js +0 -1
- package/es/components/UIShell/SideNavFooter.js +1 -4
- package/es/components/UIShell/SideNavHeader.js +0 -4
- package/es/components/UIShell/SideNavIcon.js +0 -3
- package/es/components/UIShell/SideNavItem.js +0 -3
- package/es/components/UIShell/SideNavItems.js +2 -6
- package/es/components/UIShell/SideNavLink.js +3 -7
- package/es/components/UIShell/SideNavLinkText.js +0 -2
- package/es/components/UIShell/SideNavMenu.js +0 -16
- package/es/components/UIShell/SideNavMenuItem.js +0 -2
- package/es/components/UIShell/SideNavSwitcher.js +2 -5
- package/es/components/UIShell/SkipToContent.d.ts +32 -0
- package/es/components/UIShell/SkipToContent.js +8 -15
- package/es/components/UIShell/Switcher.js +0 -2
- package/es/components/UIShell/SwitcherDivider.js +0 -1
- package/es/components/UIShell/SwitcherItem.js +0 -3
- package/es/components/UnorderedList/UnorderedList.d.ts +34 -0
- package/es/components/UnorderedList/UnorderedList.js +6 -16
- package/es/components/UnorderedList/index.d.ts +7 -0
- package/es/index.js +7 -8
- package/es/internal/ClickListener.js +3 -13
- package/es/internal/FloatingMenu.js +57 -63
- package/es/internal/OptimizedResize.js +6 -12
- package/es/internal/Selection.js +2 -25
- package/es/internal/createClassWrapper.js +0 -2
- package/es/internal/deprecateFieldOnObject.js +0 -4
- package/es/internal/focus/index.js +0 -1
- package/es/internal/keyboard/keys.js +2 -1
- package/es/internal/keyboard/match.js +1 -6
- package/es/internal/keyboard/navigation.js +8 -7
- package/es/internal/useAnnouncer.js +0 -1
- package/es/internal/useAttachedMenu.js +1 -9
- package/es/internal/useControllableState.js +6 -13
- package/es/internal/useDelayedState.js +2 -4
- package/es/internal/useEffectOnce.js +0 -1
- package/es/internal/useEvent.js +61 -3
- package/es/internal/useId.js +2 -5
- package/es/internal/useIsomorphicEffect.js +1 -0
- package/es/internal/useMergedRefs.js +2 -2
- package/es/internal/useNoInteractiveChildren.js +2 -13
- package/es/internal/useNormalizedInputProps.js +0 -3
- package/es/internal/useSavedCallback.js +0 -1
- package/es/internal/warning.js +0 -3
- package/es/internal/wrapFocus.js +1 -8
- package/es/prop-types/deprecate.js +2 -5
- package/es/prop-types/isRequiredOneOf.js +2 -5
- package/es/prop-types/requiredIfGivenPropIsTruthy.js +0 -2
- package/es/tools/array.js +0 -3
- package/es/tools/events.js +0 -3
- package/es/tools/mergeRefs.js +0 -2
- package/es/tools/wrapComponent.js +2 -5
- package/lib/_virtual/_rollupPluginBabelHelpers.js +17 -4
- package/lib/components/Accordion/Accordion.Skeleton.js +0 -7
- package/lib/components/Accordion/Accordion.js +1 -27
- package/lib/components/Accordion/AccordionItem.js +5 -19
- package/lib/components/AspectRatio/AspectRatio.js +0 -5
- package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +0 -3
- package/lib/components/Breadcrumb/Breadcrumb.js +0 -3
- package/lib/components/Breadcrumb/BreadcrumbItem.js +0 -7
- package/lib/components/Button/Button.Skeleton.js +2 -26
- package/lib/components/Button/Button.js +2 -36
- package/lib/components/ButtonSet/ButtonSet.js +0 -2
- package/lib/components/Checkbox/Checkbox.Skeleton.js +0 -1
- package/lib/components/Checkbox/Checkbox.js +4 -20
- package/lib/components/CheckboxGroup/CheckboxGroup.js +0 -11
- package/lib/components/ClassPrefix/index.d.ts +26 -0
- package/lib/components/ClassPrefix/index.js +0 -2
- package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +0 -5
- package/lib/components/CodeSnippet/CodeSnippet.js +6 -45
- package/lib/components/ComboBox/ComboBox.js +19 -86
- package/lib/components/ComboBox/tools/filter.js +0 -1
- package/lib/components/ComboButton/index.js +0 -14
- package/lib/components/ComposedModal/ComposedModal.js +2 -32
- package/lib/components/ComposedModal/ModalFooter.js +0 -21
- package/lib/components/ComposedModal/ModalHeader.js +0 -12
- package/lib/components/ContainedList/ContainedList.js +5 -32
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +0 -6
- package/lib/components/ContentSwitcher/ContentSwitcher.js +11 -23
- package/lib/components/ContextMenu/useContextMenu.js +1 -6
- package/lib/components/Copy/Copy.js +8 -50
- package/lib/components/CopyButton/CopyButton.js +0 -4
- package/lib/components/DangerButton/DangerButton.js +0 -1
- package/lib/components/DataTable/DataTable.js +171 -91
- package/lib/components/DataTable/Table.js +0 -6
- package/lib/components/DataTable/TableBatchAction.js +0 -4
- package/lib/components/DataTable/TableBatchActions.js +0 -8
- package/lib/components/DataTable/TableBody.js +0 -1
- package/lib/components/DataTable/TableContainer.js +0 -5
- package/lib/components/DataTable/TableExpandHeader.js +0 -7
- package/lib/components/DataTable/TableExpandRow.js +0 -6
- package/lib/components/DataTable/TableExpandedRow.js +0 -6
- package/lib/components/DataTable/TableHeader.d.ts +1 -1
- package/lib/components/DataTable/TableHeader.js +3 -19
- package/lib/components/DataTable/TableRow.js +4 -5
- package/lib/components/DataTable/TableSelectAll.js +0 -8
- package/lib/components/DataTable/TableSelectRow.js +2 -10
- package/lib/components/DataTable/TableToolbar.js +0 -3
- package/lib/components/DataTable/TableToolbarMenu.d.ts +1 -1
- package/lib/components/DataTable/TableToolbarMenu.js +3 -6
- package/lib/components/DataTable/TableToolbarSearch.js +2 -30
- package/lib/components/DataTable/state/getDerivedStateFromProps.js +0 -4
- package/lib/components/DataTable/state/sorting.js +5 -8
- package/lib/components/DataTable/tools/denormalize.js +2 -2
- package/lib/components/DataTable/tools/filter.js +0 -2
- package/lib/components/DataTable/tools/instanceId.js +0 -1
- package/lib/components/DataTable/tools/normalize.js +10 -10
- package/lib/components/DataTable/tools/sorting.js +5 -13
- package/lib/components/DataTableSkeleton/DataTableSkeleton.js +5 -20
- package/lib/components/DatePicker/DatePicker.Skeleton.js +0 -6
- package/lib/components/DatePicker/DatePicker.js +152 -174
- package/lib/components/DatePicker/plugins/appendToPlugin.js +3 -7
- package/lib/components/DatePicker/plugins/fixEventsPlugin.js +14 -25
- package/lib/components/DatePicker/plugins/rangePlugin.js +2 -7
- package/lib/components/DatePickerInput/DatePickerInput.js +2 -28
- package/lib/components/Dropdown/Dropdown.Skeleton.js +0 -2
- package/lib/components/Dropdown/Dropdown.js +50 -59
- package/lib/components/ErrorBoundary/ErrorBoundary.js +0 -10
- package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +0 -1
- package/lib/components/ExpandableSearch/ExpandableSearch.js +1 -10
- package/lib/components/FeatureFlags/index.js +8 -20
- package/lib/components/FileUploader/FileUploader.Skeleton.js +0 -2
- package/lib/components/FileUploader/FileUploader.js +3 -57
- package/lib/components/FileUploader/FileUploaderButton.js +3 -43
- package/lib/components/FileUploader/FileUploaderDropContainer.js +1 -28
- package/lib/components/FileUploader/FileUploaderItem.js +1 -30
- package/lib/components/FileUploader/Filename.js +0 -10
- package/lib/components/FluidComboBox/FluidComboBox.Skeleton.js +0 -1
- package/lib/components/FluidComboBox/FluidComboBox.js +0 -18
- package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.js +0 -2
- package/lib/components/FluidDatePicker/FluidDatePicker.js +0 -6
- package/lib/components/FluidDatePickerInput/FluidDatePickerInput.js +2 -1
- package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +0 -1
- package/lib/components/FluidDropdown/FluidDropdown.js +0 -18
- package/lib/components/FluidForm/FluidForm.js +0 -2
- package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +0 -1
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +0 -19
- package/lib/components/FluidSelect/FluidSelect.Skeleton.js +0 -1
- package/lib/components/FluidSelect/FluidSelect.js +0 -10
- package/lib/components/FluidTextArea/FluidTextArea.Skeleton.js +0 -1
- package/lib/components/FluidTextArea/FluidTextArea.js +0 -20
- package/lib/components/FluidTextInput/FluidTextInput.Skeleton.js +0 -1
- package/lib/components/FluidTextInput/FluidTextInput.js +0 -14
- package/lib/components/FluidTimePicker/FluidTimePicker.Skeleton.js +0 -3
- package/lib/components/FluidTimePicker/FluidTimePicker.js +1 -11
- package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +0 -6
- package/lib/components/Form/Form.d.ts +23 -0
- package/lib/components/Form/Form.js +3 -6
- package/lib/components/Form/index.d.ts +7 -0
- package/lib/components/FormGroup/FormGroup.js +0 -7
- package/lib/components/FormItem/FormItem.js +0 -2
- package/lib/components/FormLabel/FormLabel.js +1 -26
- package/lib/components/Grid/CSSGrid.js +2 -15
- package/lib/components/Grid/Column.js +18 -59
- package/lib/components/Grid/ColumnHang.js +2 -5
- package/lib/components/Grid/FlexGrid.js +2 -8
- package/lib/components/Grid/Grid.js +0 -8
- package/lib/components/Grid/GridContext.js +1 -3
- package/lib/components/Grid/Row.js +2 -7
- package/lib/components/Heading/index.js +0 -4
- package/lib/components/Icon/Icon.Skeleton.js +2 -2
- package/lib/components/IconButton/index.js +0 -10
- package/lib/components/IdPrefix/index.js +0 -2
- package/lib/components/InlineCheckbox/InlineCheckbox.js +0 -14
- package/lib/components/InlineLoading/InlineLoading.js +0 -12
- package/lib/components/Layer/index.js +3 -6
- package/lib/components/Layout/LayoutDirection.js +0 -3
- package/lib/components/Layout/useLayoutDirection.js +0 -1
- package/lib/components/Link/Link.js +3 -10
- package/lib/components/ListBox/ListBox.js +2 -13
- package/lib/components/ListBox/ListBoxField.js +0 -5
- package/lib/components/ListBox/ListBoxMenuIcon.js +0 -4
- package/lib/components/ListBox/ListBoxMenuItem.js +2 -6
- package/lib/components/ListBox/ListBoxPropTypes.d.ts +2 -2
- package/lib/components/ListBox/ListBoxSelection.js +1 -13
- package/lib/components/ListBox/next/ListBoxSelection.js +1 -14
- package/lib/components/ListBox/next/ListBoxTrigger.js +1 -3
- package/lib/components/ListItem/ListItem.d.ts +23 -0
- package/lib/components/ListItem/ListItem.js +4 -8
- package/lib/components/ListItem/index.d.ts +7 -0
- package/lib/components/Loading/Loading.js +0 -6
- package/lib/components/Menu/Menu.js +22 -40
- package/lib/components/Menu/MenuContext.js +4 -5
- package/lib/components/Menu/MenuItem.js +5 -39
- package/lib/components/MenuButton/index.js +0 -9
- package/lib/components/Modal/Modal.js +0 -43
- package/lib/components/ModalWrapper/ModalWrapper.js +2 -15
- package/lib/components/MultiSelect/FilterableMultiSelect.js +8 -66
- package/lib/components/MultiSelect/MultiSelect.js +30 -78
- package/lib/components/MultiSelect/MultiSelectPropTypes.js +0 -1
- package/lib/components/MultiSelect/index.js +0 -1
- package/lib/components/MultiSelect/tools/itemToString.js +0 -2
- package/lib/components/MultiSelect/tools/sorting.js +3 -4
- package/lib/components/Notification/Notification.js +0 -78
- package/lib/components/NumberInput/NumberInput.Skeleton.js +0 -2
- package/lib/components/NumberInput/NumberInput.js +3 -60
- package/lib/components/OrderedList/OrderedList.d.ts +39 -0
- package/lib/components/OrderedList/OrderedList.js +7 -19
- package/lib/components/OrderedList/index.d.ts +7 -0
- package/lib/components/OverflowMenu/OverflowMenu.js +65 -86
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +6 -23
- package/lib/components/OverflowMenuV2/index.js +0 -5
- package/lib/components/Pagination/Pagination.Skeleton.js +0 -2
- package/lib/components/Pagination/Pagination.js +11 -47
- package/lib/components/Pagination/experimental/PageSelector.js +0 -10
- package/lib/components/Pagination/experimental/Pagination.js +2 -67
- package/lib/components/PaginationNav/PaginationNav.js +15 -78
- package/lib/components/Popover/index.d.ts +14 -8
- package/lib/components/Popover/index.js +44 -48
- package/lib/components/PrimaryButton/PrimaryButton.js +0 -1
- package/lib/components/ProgressBar/ProgressBar.js +0 -15
- package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +0 -4
- package/lib/components/ProgressIndicator/ProgressIndicator.js +2 -40
- package/lib/components/RadioButton/RadioButton.Skeleton.js +0 -1
- package/lib/components/RadioButton/RadioButton.js +0 -13
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +3 -23
- package/lib/components/RadioTile/RadioTile.js +0 -12
- package/lib/components/Search/Search.Skeleton.js +0 -2
- package/lib/components/Search/Search.js +1 -28
- package/lib/components/SecondaryButton/SecondaryButton.js +0 -1
- package/lib/components/Select/Select.Skeleton.js +0 -2
- package/lib/components/Select/Select.d.ts +1 -1
- package/lib/components/Select/Select.js +6 -33
- package/lib/components/SelectItem/SelectItem.js +0 -5
- package/lib/components/SelectItemGroup/SelectItemGroup.d.ts +0 -1
- package/lib/components/SelectItemGroup/SelectItemGroup.js +1 -26
- package/lib/components/SkeletonIcon/SkeletonIcon.js +0 -2
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +0 -1
- package/lib/components/SkeletonText/SkeletonText.js +0 -12
- package/lib/components/Slider/Slider.Skeleton.js +0 -2
- package/lib/components/Slider/Slider.d.ts +0 -1
- package/lib/components/Slider/Slider.js +112 -154
- package/lib/components/Stack/Stack.js +1 -8
- package/lib/components/StructuredList/StructuredList.Skeleton.js +0 -5
- package/lib/components/StructuredList/StructuredList.js +1 -25
- package/lib/components/Switch/IconSwitch.js +0 -18
- package/lib/components/Switch/Switch.js +0 -11
- package/lib/components/TabContent/TabContent.js +2 -6
- package/lib/components/Tabs/Tabs.Skeleton.js +0 -4
- package/lib/components/Tabs/Tabs.js +133 -102
- package/lib/components/Tabs/usePressable.js +18 -31
- package/lib/components/Tag/Tag.Skeleton.js +0 -2
- package/lib/components/Tag/Tag.js +0 -15
- package/lib/components/Text/Text.js +5 -18
- package/lib/components/Text/TextDirection.js +0 -3
- package/lib/components/Text/TextDirectionContext.js +0 -1
- package/lib/components/Text/createTextComponent.js +0 -3
- package/lib/components/TextArea/TextArea.Skeleton.js +0 -2
- package/lib/components/TextArea/TextArea.js +10 -32
- package/lib/components/TextInput/ControlledPasswordInput.js +0 -20
- package/lib/components/TextInput/PasswordInput.js +0 -25
- package/lib/components/TextInput/TextInput.Skeleton.js +0 -2
- package/lib/components/TextInput/TextInput.d.ts +1 -1
- package/lib/components/TextInput/TextInput.js +5 -52
- package/lib/components/TextInput/util.js +3 -5
- package/lib/components/Theme/index.js +1 -6
- package/lib/components/Tile/Tile.js +31 -58
- package/lib/components/TileGroup/TileGroup.js +1 -22
- package/lib/components/TimePicker/TimePicker.js +6 -32
- package/lib/components/TimePickerSelect/TimePickerSelect.js +2 -5
- package/lib/components/Toggle/Toggle.Skeleton.js +0 -8
- package/lib/components/Toggle/Toggle.js +0 -16
- package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +0 -7
- package/lib/components/Toggletip/index.d.ts +148 -0
- package/lib/components/Toggletip/index.js +20 -44
- package/lib/components/Tooltip/DefinitionTooltip.js +0 -11
- package/lib/components/Tooltip/Tooltip.d.ts +1 -1
- package/lib/components/Tooltip/Tooltip.js +4 -21
- package/lib/components/TreeView/TreeNode.js +21 -66
- package/lib/components/TreeView/TreeView.js +11 -67
- package/lib/components/UIShell/Content.js +2 -4
- package/lib/components/UIShell/Header.js +0 -2
- package/lib/components/UIShell/HeaderContainer.d.ts +33 -0
- package/lib/components/UIShell/HeaderContainer.js +13 -11
- package/lib/components/UIShell/HeaderGlobalAction.js +0 -6
- package/lib/components/UIShell/HeaderGlobalBar.js +0 -1
- package/lib/components/UIShell/HeaderMenu.js +32 -31
- package/lib/components/UIShell/HeaderMenuButton.js +2 -4
- package/lib/components/UIShell/HeaderMenuItem.js +0 -8
- package/lib/components/UIShell/HeaderName.js +0 -5
- package/lib/components/UIShell/HeaderNavigation.js +0 -2
- package/lib/components/UIShell/HeaderPanel.js +0 -2
- package/lib/components/UIShell/HeaderSideNavItems.js +0 -2
- package/lib/components/UIShell/Link.js +2 -3
- package/lib/components/UIShell/SideNav.d.ts +3 -1
- package/lib/components/UIShell/SideNav.js +43 -35
- package/lib/components/UIShell/SideNavDetails.js +0 -3
- package/lib/components/UIShell/SideNavDivider.js +0 -1
- package/lib/components/UIShell/SideNavFooter.js +1 -4
- package/lib/components/UIShell/SideNavHeader.js +0 -4
- package/lib/components/UIShell/SideNavIcon.js +0 -3
- package/lib/components/UIShell/SideNavItem.js +0 -3
- package/lib/components/UIShell/SideNavItems.js +2 -6
- package/lib/components/UIShell/SideNavLink.js +3 -7
- package/lib/components/UIShell/SideNavLinkText.js +0 -2
- package/lib/components/UIShell/SideNavMenu.js +0 -16
- package/lib/components/UIShell/SideNavMenuItem.js +0 -2
- package/lib/components/UIShell/SideNavSwitcher.js +2 -5
- package/lib/components/UIShell/SkipToContent.d.ts +32 -0
- package/lib/components/UIShell/SkipToContent.js +8 -15
- package/lib/components/UIShell/Switcher.js +0 -2
- package/lib/components/UIShell/SwitcherDivider.js +0 -1
- package/lib/components/UIShell/SwitcherItem.js +0 -3
- package/lib/components/UnorderedList/UnorderedList.d.ts +34 -0
- package/lib/components/UnorderedList/UnorderedList.js +6 -16
- package/lib/components/UnorderedList/index.d.ts +7 -0
- package/lib/index.js +42 -43
- package/lib/internal/ClickListener.js +3 -13
- package/lib/internal/FloatingMenu.js +57 -63
- package/lib/internal/OptimizedResize.js +6 -12
- package/lib/internal/Selection.js +2 -25
- package/lib/internal/createClassWrapper.js +0 -2
- package/lib/internal/deprecateFieldOnObject.js +0 -4
- package/lib/internal/focus/index.js +0 -1
- package/lib/internal/keyboard/keys.js +2 -1
- package/lib/internal/keyboard/match.js +1 -6
- package/lib/internal/keyboard/navigation.js +8 -7
- package/lib/internal/useAnnouncer.js +0 -1
- package/lib/internal/useAttachedMenu.js +1 -9
- package/lib/internal/useControllableState.js +6 -13
- package/lib/internal/useDelayedState.js +2 -4
- package/lib/internal/useEffectOnce.js +0 -1
- package/lib/internal/useEvent.js +61 -2
- package/lib/internal/useId.js +2 -5
- package/lib/internal/useIsomorphicEffect.js +1 -0
- package/lib/internal/useMergedRefs.js +2 -2
- package/lib/internal/useNoInteractiveChildren.js +2 -13
- package/lib/internal/useNormalizedInputProps.js +0 -3
- package/lib/internal/useSavedCallback.js +0 -1
- package/lib/internal/warning.js +0 -3
- package/lib/internal/wrapFocus.js +1 -8
- package/lib/prop-types/deprecate.js +2 -5
- package/lib/prop-types/isRequiredOneOf.js +2 -5
- package/lib/prop-types/requiredIfGivenPropIsTruthy.js +0 -2
- package/lib/tools/array.js +0 -3
- package/lib/tools/events.js +0 -3
- package/lib/tools/mergeRefs.js +0 -2
- package/lib/tools/wrapComponent.js +2 -5
- package/package.json +9 -9
- package/es/components/Tab/Tab.js +0 -185
- package/es/components/Tab/index.js +0 -14
- package/es/components/TimePickerSelect/index.js +0 -13
- package/lib/components/Form/index.js +0 -17
- package/lib/components/Tab/Tab.js +0 -214
- package/lib/components/Tab/index.js +0 -39
- package/lib/components/TimePickerSelect/index.js +0 -38
|
@@ -79,17 +79,14 @@ const Search = /*#__PURE__*/React__default["default"].forwardRef(function Search
|
|
|
79
79
|
[`${prefix}--search-close`]: true,
|
|
80
80
|
[`${prefix}--search-close--hidden`]: !hasContent
|
|
81
81
|
});
|
|
82
|
-
|
|
83
82
|
if (value !== prevValue) {
|
|
84
83
|
setHasContent(!!value);
|
|
85
84
|
setPrevValue(value);
|
|
86
85
|
}
|
|
87
|
-
|
|
88
86
|
function clearInput() {
|
|
89
87
|
if (!value && inputRef.current) {
|
|
90
88
|
inputRef.current.value = '';
|
|
91
89
|
}
|
|
92
|
-
|
|
93
90
|
const inputTarget = Object.assign({}, inputRef.current, {
|
|
94
91
|
value: ''
|
|
95
92
|
});
|
|
@@ -102,24 +99,21 @@ const Search = /*#__PURE__*/React__default["default"].forwardRef(function Search
|
|
|
102
99
|
setHasContent(false);
|
|
103
100
|
index.focus(inputRef);
|
|
104
101
|
}
|
|
105
|
-
|
|
106
102
|
function handleChange(event) {
|
|
107
103
|
setHasContent(event.target.value !== '');
|
|
108
104
|
}
|
|
109
|
-
|
|
110
105
|
function handleKeyDown(event) {
|
|
111
106
|
if (match.match(event, keys.Escape)) {
|
|
112
107
|
event.stopPropagation();
|
|
113
108
|
clearInput();
|
|
114
109
|
}
|
|
115
110
|
}
|
|
116
|
-
|
|
117
111
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
118
112
|
role: "search",
|
|
119
113
|
"aria-label": placeholder,
|
|
120
114
|
className: searchClasses
|
|
121
115
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
122
|
-
"aria-labelledby": uniqueId,
|
|
116
|
+
"aria-labelledby": onExpand ? uniqueId : undefined,
|
|
123
117
|
role: onExpand ? 'button' : undefined,
|
|
124
118
|
className: `${prefix}--search-magnifier`,
|
|
125
119
|
onClick: onExpand
|
|
@@ -158,114 +152,93 @@ Search.propTypes = {
|
|
|
158
152
|
* `<input>`, defaults to "off"
|
|
159
153
|
*/
|
|
160
154
|
autoComplete: PropTypes__default["default"].string,
|
|
161
|
-
|
|
162
155
|
/**
|
|
163
156
|
* Specify an optional className to be applied to the container node
|
|
164
157
|
*/
|
|
165
158
|
className: PropTypes__default["default"].string,
|
|
166
|
-
|
|
167
159
|
/**
|
|
168
160
|
* Specify a label to be read by screen readers on the "close" button
|
|
169
161
|
*/
|
|
170
162
|
closeButtonLabelText: PropTypes__default["default"].string,
|
|
171
|
-
|
|
172
163
|
/**
|
|
173
164
|
* Optionally provide the default value of the `<input>`
|
|
174
165
|
*/
|
|
175
166
|
defaultValue: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].number]),
|
|
176
|
-
|
|
177
167
|
/**
|
|
178
168
|
* Specify whether the `<input>` should be disabled
|
|
179
169
|
*/
|
|
180
170
|
disabled: PropTypes__default["default"].bool,
|
|
181
|
-
|
|
182
171
|
/**
|
|
183
172
|
* Specify a custom `id` for the input
|
|
184
173
|
*/
|
|
185
174
|
id: PropTypes__default["default"].string,
|
|
186
|
-
|
|
187
175
|
/**
|
|
188
176
|
* Provide the label text for the Search icon
|
|
189
177
|
*/
|
|
190
178
|
labelText: PropTypes__default["default"].node.isRequired,
|
|
191
|
-
|
|
192
179
|
/**
|
|
193
180
|
* Specify light version or default version of this control
|
|
194
181
|
*/
|
|
195
182
|
light: deprecate["default"](PropTypes__default["default"].bool, 'The `light` prop for `Search` is no longer needed and has ' + 'been deprecated in v11 in favor of the new `Layer` component. It will be moved in the next major release.'),
|
|
196
|
-
|
|
197
183
|
/**
|
|
198
184
|
* Optional callback called when the search value changes.
|
|
199
185
|
*/
|
|
200
186
|
onChange: PropTypes__default["default"].func,
|
|
201
|
-
|
|
202
187
|
/**
|
|
203
188
|
* Optional callback called when the search value is cleared.
|
|
204
189
|
*/
|
|
205
190
|
onClear: PropTypes__default["default"].func,
|
|
206
|
-
|
|
207
191
|
/**
|
|
208
192
|
* Optional callback called when the magnifier icon is clicked in ExpandableSearch.
|
|
209
193
|
*/
|
|
210
194
|
onExpand: PropTypes__default["default"].func,
|
|
211
|
-
|
|
212
195
|
/**
|
|
213
196
|
* Provide a handler that is invoked on the key down event for the input
|
|
214
197
|
*/
|
|
215
198
|
onKeyDown: PropTypes__default["default"].func,
|
|
216
|
-
|
|
217
199
|
/**
|
|
218
200
|
* Provide an optional placeholder text for the Search.
|
|
219
201
|
* Note: if the label and placeholder differ,
|
|
220
202
|
* VoiceOver on Mac will read both
|
|
221
203
|
*/
|
|
222
204
|
placeholder: PropTypes__default["default"].string,
|
|
223
|
-
|
|
224
205
|
/**
|
|
225
206
|
* Rendered icon for the Search.
|
|
226
207
|
* Can be a React component class
|
|
227
208
|
*/
|
|
228
209
|
// @ts-expect-error: PropTypes are not expressive enough to cover this case
|
|
229
210
|
renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object]),
|
|
230
|
-
|
|
231
211
|
/**
|
|
232
212
|
* Specify the role for the underlying `<input>`, defaults to `searchbox`
|
|
233
213
|
*/
|
|
234
214
|
role: PropTypes__default["default"].string,
|
|
235
|
-
|
|
236
215
|
/**
|
|
237
216
|
* Specify the size of the Search
|
|
238
217
|
*/
|
|
239
218
|
size: PropTypes__default["default"].oneOf(['sm', 'md', 'lg']),
|
|
240
|
-
|
|
241
219
|
/**
|
|
242
220
|
* Optional prop to specify the type of the `<input>`
|
|
243
221
|
*/
|
|
244
222
|
type: PropTypes__default["default"].string,
|
|
245
|
-
|
|
246
223
|
/**
|
|
247
224
|
* Specify the value of the `<input>`
|
|
248
225
|
*/
|
|
249
226
|
value: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].number])
|
|
250
227
|
};
|
|
251
|
-
|
|
252
228
|
function CustomSearchIcon(_ref2) {
|
|
253
229
|
let {
|
|
254
230
|
icon: Icon
|
|
255
231
|
} = _ref2;
|
|
256
232
|
const prefix = usePrefix.usePrefix();
|
|
257
|
-
|
|
258
233
|
if (Icon) {
|
|
259
234
|
return /*#__PURE__*/React__default["default"].createElement(Icon, {
|
|
260
235
|
className: `${prefix}--search-magnifier-icon`
|
|
261
236
|
});
|
|
262
237
|
}
|
|
263
|
-
|
|
264
238
|
return /*#__PURE__*/React__default["default"].createElement(iconsReact.Search, {
|
|
265
239
|
className: `${prefix}--search-magnifier-icon`
|
|
266
240
|
});
|
|
267
241
|
}
|
|
268
|
-
|
|
269
242
|
CustomSearchIcon.propTypes = {
|
|
270
243
|
/**
|
|
271
244
|
* Rendered icon for the Search. Can be a React component class
|
|
@@ -20,7 +20,6 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
20
20
|
const SecondaryButton = props => /*#__PURE__*/React__default["default"].createElement(Button["default"], _rollupPluginBabelHelpers["extends"]({
|
|
21
21
|
kind: "secondary"
|
|
22
22
|
}, props));
|
|
23
|
-
|
|
24
23
|
var SecondaryButton$1 = SecondaryButton;
|
|
25
24
|
|
|
26
25
|
exports["default"] = SecondaryButton$1;
|
|
@@ -38,13 +38,11 @@ const SelectSkeleton = _ref => {
|
|
|
38
38
|
className: `${prefix}--select-input`
|
|
39
39
|
})));
|
|
40
40
|
};
|
|
41
|
-
|
|
42
41
|
SelectSkeleton.propTypes = {
|
|
43
42
|
/**
|
|
44
43
|
* Specify an optional className to add to the form item wrapper.
|
|
45
44
|
*/
|
|
46
45
|
className: PropTypes__default["default"].string,
|
|
47
|
-
|
|
48
46
|
/**
|
|
49
47
|
* Specify whether the label should be hidden, or not
|
|
50
48
|
*/
|
|
@@ -85,5 +85,5 @@ interface SelectProps extends Omit<ComponentPropsWithRef<'select'>, ExcludedAttr
|
|
|
85
85
|
*/
|
|
86
86
|
warnText?: ReactNode;
|
|
87
87
|
}
|
|
88
|
-
declare const Select: React.ForwardRefExoticComponent<Pick<SelectProps, "value" | "children" | "className" | "disabled" | "size" | "form" | "slot" | "style" | "title" | "dir" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "autoComplete" | "multiple" | "key" | "id" | "onAnimationEnd" | "aria-controls" | "aria-expanded" | "onClick" | "onKeyDown" | "contentEditable" | "contextMenu" | "draggable" | "hidden" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "inline" | "name" | "readOnly" | "required" | "labelText" | "helperText" | "
|
|
88
|
+
declare const Select: React.ForwardRefExoticComponent<Pick<SelectProps, "value" | "children" | "className" | "disabled" | "size" | "form" | "slot" | "style" | "title" | "dir" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "autoComplete" | "multiple" | "key" | "id" | "onAnimationEnd" | "aria-controls" | "aria-expanded" | "onClick" | "onKeyDown" | "contentEditable" | "contextMenu" | "draggable" | "hidden" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "inline" | "invalid" | "name" | "readOnly" | "required" | "labelText" | "helperText" | "invalidText" | "hideLabel" | "warn" | "warnText" | "light" | "noLabel"> & React.RefAttributes<HTMLSelectElement>>;
|
|
89
89
|
export default Select;
|
|
@@ -15,7 +15,6 @@ var React = require('react');
|
|
|
15
15
|
var cx = require('classnames');
|
|
16
16
|
var iconsReact = require('@carbon/icons-react');
|
|
17
17
|
var deprecate = require('../../prop-types/deprecate.js');
|
|
18
|
-
var index = require('../FeatureFlags/index.js');
|
|
19
18
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
20
19
|
require('../FluidForm/FluidForm.js');
|
|
21
20
|
var FormContext = require('../FluidForm/FormContext.js');
|
|
@@ -51,7 +50,6 @@ const Select = /*#__PURE__*/React__default["default"].forwardRef(function Select
|
|
|
51
50
|
...other
|
|
52
51
|
} = _ref;
|
|
53
52
|
const prefix = usePrefix.usePrefix();
|
|
54
|
-
const enabled = index.useFeatureFlag('enable-v11-release');
|
|
55
53
|
const {
|
|
56
54
|
isFluid
|
|
57
55
|
} = React.useContext(FormContext.FormContext);
|
|
@@ -69,7 +67,7 @@ const Select = /*#__PURE__*/React__default["default"].forwardRef(function Select
|
|
|
69
67
|
[`${prefix}--select--warning`]: warn,
|
|
70
68
|
[`${prefix}--select--fluid--invalid`]: isFluid && invalid,
|
|
71
69
|
[`${prefix}--select--fluid--focus`]: isFluid && isFocused
|
|
72
|
-
}
|
|
70
|
+
});
|
|
73
71
|
const labelClasses = cx__default["default"](`${prefix}--label`, {
|
|
74
72
|
[`${prefix}--visually-hidden`]: hideLabel,
|
|
75
73
|
[`${prefix}--label--disabled`]: disabled
|
|
@@ -79,17 +77,14 @@ const Select = /*#__PURE__*/React__default["default"].forwardRef(function Select
|
|
|
79
77
|
[`${prefix}--select-input--${size}`]: size
|
|
80
78
|
});
|
|
81
79
|
const errorId = `${id}-error-msg`;
|
|
82
|
-
|
|
83
80
|
const errorText = (() => {
|
|
84
81
|
if (invalid) {
|
|
85
82
|
return invalidText;
|
|
86
83
|
}
|
|
87
|
-
|
|
88
84
|
if (warn) {
|
|
89
85
|
return warnText;
|
|
90
86
|
}
|
|
91
87
|
})();
|
|
92
|
-
|
|
93
88
|
const error = invalid || warn ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
94
89
|
className: `${prefix}--form-requirement`,
|
|
95
90
|
id: errorId
|
|
@@ -103,35 +98,31 @@ const Select = /*#__PURE__*/React__default["default"].forwardRef(function Select
|
|
|
103
98
|
className: helperTextClasses
|
|
104
99
|
}, helperText) : null;
|
|
105
100
|
const ariaProps = {};
|
|
106
|
-
|
|
107
101
|
if (invalid) {
|
|
108
102
|
ariaProps['aria-describedby'] = errorId;
|
|
109
103
|
} else if (!inline && !isFluid) {
|
|
110
104
|
ariaProps['aria-describedby'] = helper ? helperId : undefined;
|
|
111
105
|
}
|
|
112
|
-
|
|
113
106
|
const handleFocus = evt => {
|
|
114
107
|
setIsFocused(evt.type === 'focus' ? true : false);
|
|
115
108
|
};
|
|
116
|
-
|
|
117
109
|
const readOnlyEventHandlers = {
|
|
118
110
|
onMouseDown: evt => {
|
|
119
111
|
// NOTE: does not prevent click
|
|
120
112
|
if (readOnly) {
|
|
121
|
-
evt.preventDefault();
|
|
122
|
-
|
|
113
|
+
evt.preventDefault();
|
|
114
|
+
// focus on the element as per readonly input behavior
|
|
123
115
|
evt.target.focus();
|
|
124
116
|
}
|
|
125
117
|
},
|
|
126
118
|
onKeyDown: evt => {
|
|
127
|
-
const selectAccessKeys = ['ArrowDown', 'ArrowUp', ' '];
|
|
128
|
-
|
|
119
|
+
const selectAccessKeys = ['ArrowDown', 'ArrowUp', ' '];
|
|
120
|
+
// This prevents the select from opening for the above keys
|
|
129
121
|
if (readOnly && selectAccessKeys.includes(evt.key)) {
|
|
130
122
|
evt.preventDefault();
|
|
131
123
|
}
|
|
132
124
|
}
|
|
133
125
|
};
|
|
134
|
-
|
|
135
126
|
const input = (() => {
|
|
136
127
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("select", _rollupPluginBabelHelpers["extends"]({}, other, ariaProps, {
|
|
137
128
|
id: id,
|
|
@@ -149,9 +140,8 @@ const Select = /*#__PURE__*/React__default["default"].forwardRef(function Select
|
|
|
149
140
|
className: `${prefix}--select__invalid-icon ${prefix}--select__invalid-icon--warning`
|
|
150
141
|
}));
|
|
151
142
|
})();
|
|
152
|
-
|
|
153
143
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
154
|
-
className:
|
|
144
|
+
className: cx__default["default"](`${prefix}--form-item`, className)
|
|
155
145
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
156
146
|
className: selectClasses
|
|
157
147
|
}, !noLabel && /*#__PURE__*/React__default["default"].createElement("label", {
|
|
@@ -177,91 +167,74 @@ Select.propTypes = {
|
|
|
177
167
|
* Provide the contents of your Select
|
|
178
168
|
*/
|
|
179
169
|
children: PropTypes__default["default"].node,
|
|
180
|
-
|
|
181
170
|
/**
|
|
182
171
|
* Specify an optional className to be applied to the node containing the label and the select box
|
|
183
172
|
*/
|
|
184
173
|
className: PropTypes__default["default"].string,
|
|
185
|
-
|
|
186
174
|
/**
|
|
187
175
|
* Optionally provide the default value of the `<select>`
|
|
188
176
|
*/
|
|
189
177
|
defaultValue: PropTypes__default["default"].any,
|
|
190
|
-
|
|
191
178
|
/**
|
|
192
179
|
* Specify whether the control is disabled
|
|
193
180
|
*/
|
|
194
181
|
disabled: PropTypes__default["default"].bool,
|
|
195
|
-
|
|
196
182
|
/**
|
|
197
183
|
* Provide text that is used alongside the control label for additional help
|
|
198
184
|
*/
|
|
199
185
|
helperText: PropTypes__default["default"].node,
|
|
200
|
-
|
|
201
186
|
/**
|
|
202
187
|
* Specify whether the label should be hidden, or not
|
|
203
188
|
*/
|
|
204
189
|
hideLabel: PropTypes__default["default"].bool,
|
|
205
|
-
|
|
206
190
|
/**
|
|
207
191
|
* Specify a custom `id` for the `<select>`
|
|
208
192
|
*/
|
|
209
193
|
id: PropTypes__default["default"].string.isRequired,
|
|
210
|
-
|
|
211
194
|
/**
|
|
212
195
|
* Specify whether you want the inline version of this control
|
|
213
196
|
*/
|
|
214
197
|
inline: PropTypes__default["default"].bool,
|
|
215
|
-
|
|
216
198
|
/**
|
|
217
199
|
* Specify if the currently value is invalid.
|
|
218
200
|
*/
|
|
219
201
|
invalid: PropTypes__default["default"].bool,
|
|
220
|
-
|
|
221
202
|
/**
|
|
222
203
|
* Message which is displayed if the value is invalid.
|
|
223
204
|
*/
|
|
224
205
|
invalidText: PropTypes__default["default"].node,
|
|
225
|
-
|
|
226
206
|
/**
|
|
227
207
|
* Provide label text to be read by screen readers when interacting with the
|
|
228
208
|
* control
|
|
229
209
|
*/
|
|
230
210
|
labelText: PropTypes__default["default"].node,
|
|
231
|
-
|
|
232
211
|
/**
|
|
233
212
|
* `true` to use the light version. For use on $ui-01 backgrounds only.
|
|
234
213
|
* Don't use this to make tile background color same as container background color.
|
|
235
214
|
*/
|
|
236
215
|
light: deprecate["default"](PropTypes__default["default"].bool, 'The `light` prop for `Select` is no longer needed and has ' + 'been deprecated in v11 in favor of the new `Layer` component. It will be moved in the next major release.'),
|
|
237
|
-
|
|
238
216
|
/**
|
|
239
217
|
* Reserved for use with <Pagination> component. Will not render a label for the
|
|
240
218
|
* select since Pagination renders one for us.
|
|
241
219
|
*/
|
|
242
220
|
noLabel: PropTypes__default["default"].bool,
|
|
243
|
-
|
|
244
221
|
/**
|
|
245
222
|
* Provide an optional `onChange` hook that is called each time the value of
|
|
246
223
|
* the underlying `<input>` changes
|
|
247
224
|
*/
|
|
248
225
|
onChange: PropTypes__default["default"].func,
|
|
249
|
-
|
|
250
226
|
/**
|
|
251
227
|
* Whether the select should be read-only
|
|
252
228
|
*/
|
|
253
229
|
readOnly: PropTypes__default["default"].bool,
|
|
254
|
-
|
|
255
230
|
/**
|
|
256
231
|
* Specify the size of the Select Input.
|
|
257
232
|
*/
|
|
258
233
|
size: PropTypes__default["default"].oneOf(['sm', 'md', 'lg']),
|
|
259
|
-
|
|
260
234
|
/**
|
|
261
235
|
* Specify whether the control is currently in warning state
|
|
262
236
|
*/
|
|
263
237
|
warn: PropTypes__default["default"].bool,
|
|
264
|
-
|
|
265
238
|
/**
|
|
266
239
|
* Provide the text that is displayed when the control is in warning state
|
|
267
240
|
*/
|
|
@@ -44,28 +44,23 @@ const SelectItem = _ref => {
|
|
|
44
44
|
hidden: hidden
|
|
45
45
|
}), text);
|
|
46
46
|
};
|
|
47
|
-
|
|
48
47
|
SelectItem.propTypes = {
|
|
49
48
|
/**
|
|
50
49
|
* Specify an optional className to be applied to the node
|
|
51
50
|
*/
|
|
52
51
|
className: PropTypes__default["default"].string,
|
|
53
|
-
|
|
54
52
|
/**
|
|
55
53
|
* Specify whether the <SelectItem> should be disabled
|
|
56
54
|
*/
|
|
57
55
|
disabled: PropTypes__default["default"].bool,
|
|
58
|
-
|
|
59
56
|
/**
|
|
60
57
|
* Specify whether the <SelectItem> is hidden
|
|
61
58
|
*/
|
|
62
59
|
hidden: PropTypes__default["default"].bool,
|
|
63
|
-
|
|
64
60
|
/**
|
|
65
61
|
* Provide the contents of your <SelectItem>
|
|
66
62
|
*/
|
|
67
63
|
text: PropTypes__default["default"].string.isRequired,
|
|
68
|
-
|
|
69
64
|
/**
|
|
70
65
|
* Specify the value of the <SelectItem>
|
|
71
66
|
*/
|
|
@@ -13,33 +13,13 @@ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelper
|
|
|
13
13
|
var PropTypes = require('prop-types');
|
|
14
14
|
var React = require('react');
|
|
15
15
|
var cx = require('classnames');
|
|
16
|
-
var FeatureFlags = require('@carbon/feature-flags');
|
|
17
16
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
18
17
|
|
|
19
18
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
20
19
|
|
|
21
|
-
function _interopNamespace(e) {
|
|
22
|
-
if (e && e.__esModule) return e;
|
|
23
|
-
var n = Object.create(null);
|
|
24
|
-
if (e) {
|
|
25
|
-
Object.keys(e).forEach(function (k) {
|
|
26
|
-
if (k !== 'default') {
|
|
27
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
28
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
29
|
-
enumerable: true,
|
|
30
|
-
get: function () { return e[k]; }
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
n["default"] = e;
|
|
36
|
-
return Object.freeze(n);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
20
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
40
21
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
41
22
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
42
|
-
var FeatureFlags__namespace = /*#__PURE__*/_interopNamespace(FeatureFlags);
|
|
43
23
|
|
|
44
24
|
const SelectItemGroup = _ref => {
|
|
45
25
|
let {
|
|
@@ -57,31 +37,26 @@ const SelectItemGroup = _ref => {
|
|
|
57
37
|
disabled: disabled
|
|
58
38
|
}, other), children);
|
|
59
39
|
};
|
|
60
|
-
|
|
61
40
|
SelectItemGroup.propTypes = {
|
|
62
41
|
/**
|
|
63
42
|
* Provide the contents of your <SelectItemGroup>
|
|
64
43
|
*/
|
|
65
44
|
children: PropTypes__default["default"].node,
|
|
66
|
-
|
|
67
45
|
/**
|
|
68
46
|
* Specify an optional className to be applied to the node
|
|
69
47
|
*/
|
|
70
48
|
className: PropTypes__default["default"].string,
|
|
71
|
-
|
|
72
49
|
/**
|
|
73
50
|
* Specify whether the <SelectItemGroup> should be disabled
|
|
74
51
|
*/
|
|
75
52
|
disabled: PropTypes__default["default"].bool,
|
|
76
|
-
|
|
77
53
|
/**
|
|
78
54
|
* Specify the label to be displayed
|
|
79
55
|
*/
|
|
80
56
|
label: PropTypes__default["default"].string.isRequired
|
|
81
57
|
};
|
|
82
58
|
SelectItemGroup.defaultProps = {
|
|
83
|
-
disabled: false
|
|
84
|
-
label: FeatureFlags__namespace.enabled('enable-v11-release') ? undefined : 'Provide label'
|
|
59
|
+
disabled: false
|
|
85
60
|
};
|
|
86
61
|
var SelectItemGroup$1 = SelectItemGroup;
|
|
87
62
|
|
|
@@ -35,13 +35,11 @@ const SkeletonIcon = _ref => {
|
|
|
35
35
|
className: skeletonIconClasses
|
|
36
36
|
}, other));
|
|
37
37
|
};
|
|
38
|
-
|
|
39
38
|
SkeletonIcon.propTypes = {
|
|
40
39
|
/**
|
|
41
40
|
* Specify an optional className to add.
|
|
42
41
|
*/
|
|
43
42
|
className: PropTypes__default["default"].string,
|
|
44
|
-
|
|
45
43
|
/**
|
|
46
44
|
* The CSS styles.
|
|
47
45
|
*/
|
|
@@ -23,11 +23,9 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
23
23
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
24
24
|
|
|
25
25
|
const randoms = [0.973051493507435, 0.15334737213558558, 0.5671034553053769];
|
|
26
|
-
|
|
27
26
|
function getRandomInt(min, max, n) {
|
|
28
27
|
return Math.floor(randoms[n % 3] * (max - min + 1)) + min;
|
|
29
28
|
}
|
|
30
|
-
|
|
31
29
|
const SkeletonText = _ref => {
|
|
32
30
|
let {
|
|
33
31
|
paragraph,
|
|
@@ -47,19 +45,16 @@ const SkeletonText = _ref => {
|
|
|
47
45
|
const widthPx = width.includes('px');
|
|
48
46
|
const widthPercent = width.includes('%');
|
|
49
47
|
let lineCountNumber;
|
|
50
|
-
|
|
51
48
|
if (!paragraph) {
|
|
52
49
|
lineCountNumber = '1';
|
|
53
50
|
} else {
|
|
54
51
|
lineCountNumber = lineCount;
|
|
55
52
|
}
|
|
56
|
-
|
|
57
53
|
const refs = React.useRef([]);
|
|
58
54
|
useIsomorphicEffect["default"](() => {
|
|
59
55
|
refs.current.map((item, j) => {
|
|
60
56
|
const randomPercentWidth = getRandomInt(0, 75, j) + 'px';
|
|
61
57
|
const randomPxWidth = getRandomInt(Math.max(widthNum - 75, 0), widthNum, j) + 'px';
|
|
62
|
-
|
|
63
58
|
if (item) {
|
|
64
59
|
if (widthPercent && paragraph) {
|
|
65
60
|
item.style.width = `calc(${width} - ${randomPercentWidth})`;
|
|
@@ -72,7 +67,6 @@ const SkeletonText = _ref => {
|
|
|
72
67
|
});
|
|
73
68
|
}, [lineCountNumber, paragraph, refs, width, widthNum, widthPercent, widthPx]);
|
|
74
69
|
const lines = [];
|
|
75
|
-
|
|
76
70
|
for (var i = 0; i < lineCountNumber; i++) {
|
|
77
71
|
lines.push( /*#__PURE__*/React__default["default"].createElement("p", _rollupPluginBabelHelpers["extends"]({
|
|
78
72
|
className: skeletonTextClasses,
|
|
@@ -80,35 +74,29 @@ const SkeletonText = _ref => {
|
|
|
80
74
|
ref: el => refs.current = [...refs.current, el]
|
|
81
75
|
}, other)));
|
|
82
76
|
}
|
|
83
|
-
|
|
84
77
|
if (lineCountNumber !== '1') {
|
|
85
78
|
return /*#__PURE__*/React__default["default"].createElement("div", null, lines);
|
|
86
79
|
} else {
|
|
87
80
|
return lines;
|
|
88
81
|
}
|
|
89
82
|
};
|
|
90
|
-
|
|
91
83
|
SkeletonText.propTypes = {
|
|
92
84
|
/**
|
|
93
85
|
* Specify an optional className to be applied to the container node
|
|
94
86
|
*/
|
|
95
87
|
className: PropTypes__default["default"].string,
|
|
96
|
-
|
|
97
88
|
/**
|
|
98
89
|
* generates skeleton text at a larger size
|
|
99
90
|
*/
|
|
100
91
|
heading: PropTypes__default["default"].bool,
|
|
101
|
-
|
|
102
92
|
/**
|
|
103
93
|
* the number of lines shown if paragraph is true
|
|
104
94
|
*/
|
|
105
95
|
lineCount: PropTypes__default["default"].number,
|
|
106
|
-
|
|
107
96
|
/**
|
|
108
97
|
* will generate multiple lines of text
|
|
109
98
|
*/
|
|
110
99
|
paragraph: PropTypes__default["default"].bool,
|
|
111
|
-
|
|
112
100
|
/**
|
|
113
101
|
* width (in px or %) of single line of text or max-width of paragraph lines
|
|
114
102
|
*/
|
|
@@ -48,13 +48,11 @@ const SliderSkeleton = _ref => {
|
|
|
48
48
|
className: `${prefix}--slider__range-label`
|
|
49
49
|
})));
|
|
50
50
|
};
|
|
51
|
-
|
|
52
51
|
SliderSkeleton.propTypes = {
|
|
53
52
|
/**
|
|
54
53
|
* Specify an optional className to add to the form item wrapper.
|
|
55
54
|
*/
|
|
56
55
|
className: PropTypes__default["default"].string,
|
|
57
|
-
|
|
58
56
|
/**
|
|
59
57
|
* Specify whether the label should be hidden, or not
|
|
60
58
|
*/
|