@carbon/react 1.29.1 → 1.30.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 +153 -175
- 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 +5 -12
- package/es/components/FileUploader/Filename.js +6 -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 +1 -46
- 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 +153 -175
- 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 +5 -31
- package/lib/components/FileUploader/Filename.js +6 -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 +1 -46
- 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
|
@@ -9,18 +9,17 @@ import { useEffect } from 'react';
|
|
|
9
9
|
|
|
10
10
|
function useNoInteractiveChildren(ref) {
|
|
11
11
|
let message = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'component should have no interactive child nodes';
|
|
12
|
-
|
|
13
12
|
if (process.env.NODE_ENV !== "production") {
|
|
14
13
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
15
14
|
useEffect(() => {
|
|
16
15
|
const node = ref.current ? getInteractiveContent(ref.current) : false;
|
|
17
|
-
|
|
18
16
|
if (node) {
|
|
19
17
|
throw new Error(`Error: ${message}.\n\nInstead found: ${node.outerHTML}`);
|
|
20
18
|
}
|
|
21
19
|
});
|
|
22
20
|
}
|
|
23
21
|
}
|
|
22
|
+
|
|
24
23
|
/**
|
|
25
24
|
* Determines if a given DOM node has interactive content, or is itself
|
|
26
25
|
* interactive. It returns the interactive node if one is found
|
|
@@ -28,26 +27,22 @@ function useNoInteractiveChildren(ref) {
|
|
|
28
27
|
* @param {HTMLElement} node
|
|
29
28
|
* @returns {HTMLElement}
|
|
30
29
|
*/
|
|
31
|
-
|
|
32
30
|
function getInteractiveContent(node) {
|
|
33
31
|
if (!node || !node.childNodes) {
|
|
34
32
|
return null;
|
|
35
33
|
}
|
|
36
|
-
|
|
37
34
|
if (isFocusable(node)) {
|
|
38
35
|
return node;
|
|
39
36
|
}
|
|
40
|
-
|
|
41
37
|
for (const childNode of node.childNodes) {
|
|
42
38
|
const interactiveNode = getInteractiveContent(childNode);
|
|
43
|
-
|
|
44
39
|
if (interactiveNode) {
|
|
45
40
|
return interactiveNode;
|
|
46
41
|
}
|
|
47
42
|
}
|
|
48
|
-
|
|
49
43
|
return null;
|
|
50
44
|
}
|
|
45
|
+
|
|
51
46
|
/**
|
|
52
47
|
* Determines if the given element is focusable, or not
|
|
53
48
|
*
|
|
@@ -55,28 +50,22 @@ function getInteractiveContent(node) {
|
|
|
55
50
|
* @returns {boolean}
|
|
56
51
|
* @see https://github.com/w3c/aria-practices/blob/0553bb51588ffa517506e2a1b2ca1422ed438c5f/examples/js/utils.js#L68
|
|
57
52
|
*/
|
|
58
|
-
|
|
59
53
|
function isFocusable(element) {
|
|
60
54
|
if (element.tabIndex < 0) {
|
|
61
55
|
return false;
|
|
62
56
|
}
|
|
63
|
-
|
|
64
57
|
if (element.disabled) {
|
|
65
58
|
return false;
|
|
66
59
|
}
|
|
67
|
-
|
|
68
60
|
switch (element.nodeName) {
|
|
69
61
|
case 'A':
|
|
70
62
|
return !!element.href && element.rel !== 'ignore';
|
|
71
|
-
|
|
72
63
|
case 'INPUT':
|
|
73
64
|
return element.type !== 'hidden';
|
|
74
|
-
|
|
75
65
|
case 'BUTTON':
|
|
76
66
|
case 'SELECT':
|
|
77
67
|
case 'TEXTAREA':
|
|
78
68
|
return true;
|
|
79
|
-
|
|
80
69
|
default:
|
|
81
70
|
return false;
|
|
82
71
|
}
|
|
@@ -45,7 +45,6 @@ import { usePrefix } from './usePrefix.js';
|
|
|
45
45
|
* @param {InputProps} props - The props passed to the component
|
|
46
46
|
* @returns {NormalizedInputProps}
|
|
47
47
|
*/
|
|
48
|
-
|
|
49
48
|
function useNormalizedInputProps(_ref) {
|
|
50
49
|
let {
|
|
51
50
|
id,
|
|
@@ -67,7 +66,6 @@ function useNormalizedInputProps(_ref) {
|
|
|
67
66
|
icon: null,
|
|
68
67
|
helperId: `${id}-helper-text`
|
|
69
68
|
};
|
|
70
|
-
|
|
71
69
|
if (normalizedProps.invalid) {
|
|
72
70
|
normalizedProps.icon = WarningFilled;
|
|
73
71
|
normalizedProps.validation = /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -81,7 +79,6 @@ function useNormalizedInputProps(_ref) {
|
|
|
81
79
|
id: normalizedProps.warnId
|
|
82
80
|
}, warnText);
|
|
83
81
|
}
|
|
84
|
-
|
|
85
82
|
return normalizedProps;
|
|
86
83
|
}
|
|
87
84
|
|
package/es/internal/warning.js
CHANGED
|
@@ -6,16 +6,13 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
const emptyFunction = function () {};
|
|
9
|
-
|
|
10
9
|
const warning = process.env.NODE_ENV !== "production" ? function warning(condition, format) {
|
|
11
10
|
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
12
11
|
args[_key - 2] = arguments[_key];
|
|
13
12
|
}
|
|
14
|
-
|
|
15
13
|
if (format === undefined) {
|
|
16
14
|
throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'format argument');
|
|
17
15
|
}
|
|
18
|
-
|
|
19
16
|
if (!condition) {
|
|
20
17
|
let index = 0;
|
|
21
18
|
const message = format.replace(/%s/g, () => {
|
package/es/internal/wrapFocus.js
CHANGED
|
@@ -13,15 +13,14 @@ import { DOCUMENT_POSITION_BROAD_PRECEDING, selectorTabbable, DOCUMENT_POSITION_
|
|
|
13
13
|
* @param {string[]} selectorsFloatingMenus The CSS selectors that matches floating menus.
|
|
14
14
|
* @returns {boolean} `true` of the given `node` is in a floating menu.
|
|
15
15
|
*/
|
|
16
|
-
|
|
17
16
|
function elementOrParentIsFloatingMenu(node) {
|
|
18
17
|
let selectorsFloatingMenus = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
19
|
-
|
|
20
18
|
if (node && typeof node.closest === 'function') {
|
|
21
19
|
const allSelectorsFloatingMenus = [`.cds--overflow-menu-options`, `.cds--tooltip`, '.flatpickr-calendar', ...selectorsFloatingMenus];
|
|
22
20
|
return allSelectorsFloatingMenus.some(selector => node.closest(selector));
|
|
23
21
|
}
|
|
24
22
|
}
|
|
23
|
+
|
|
25
24
|
/**
|
|
26
25
|
* Ensures the focus is kept in the given `modalNode`, implementing "focus-wrap" behavior.
|
|
27
26
|
* @param {object} options The options.
|
|
@@ -32,8 +31,6 @@ function elementOrParentIsFloatingMenu(node) {
|
|
|
32
31
|
* @param {Node} options.oldActiveNode The DOM node that previously had focus.
|
|
33
32
|
* @param {Node} [options.selectorsFloatingMenus] The CSS selectors that matches floating menus.
|
|
34
33
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
34
|
function wrapFocus(_ref) {
|
|
38
35
|
let {
|
|
39
36
|
bodyNode,
|
|
@@ -43,13 +40,10 @@ function wrapFocus(_ref) {
|
|
|
43
40
|
oldActiveNode,
|
|
44
41
|
selectorsFloatingMenus
|
|
45
42
|
} = _ref;
|
|
46
|
-
|
|
47
43
|
if (bodyNode && currentActiveNode && oldActiveNode && !bodyNode.contains(currentActiveNode) && !elementOrParentIsFloatingMenu(currentActiveNode, selectorsFloatingMenus)) {
|
|
48
44
|
const comparisonResult = oldActiveNode.compareDocumentPosition(currentActiveNode);
|
|
49
|
-
|
|
50
45
|
if (currentActiveNode === startTrapNode || comparisonResult & DOCUMENT_POSITION_BROAD_PRECEDING) {
|
|
51
46
|
const tabbable = findLast(bodyNode.querySelectorAll(selectorTabbable), elem => Boolean(elem.offsetParent));
|
|
52
|
-
|
|
53
47
|
if (tabbable) {
|
|
54
48
|
tabbable.focus();
|
|
55
49
|
} else if (bodyNode !== oldActiveNode) {
|
|
@@ -57,7 +51,6 @@ function wrapFocus(_ref) {
|
|
|
57
51
|
}
|
|
58
52
|
} else if (currentActiveNode === endTrapNode || comparisonResult & DOCUMENT_POSITION_BROAD_FOLLOWING) {
|
|
59
53
|
const tabbable = Array.prototype.find.call(bodyNode.querySelectorAll(selectorTabbable), elem => Boolean(elem.offsetParent));
|
|
60
|
-
|
|
61
54
|
if (tabbable) {
|
|
62
55
|
tabbable.focus();
|
|
63
56
|
} else if (bodyNode !== oldActiveNode) {
|
|
@@ -13,21 +13,18 @@ function deprecate(propType, message) {
|
|
|
13
13
|
if (props[propName] === undefined) {
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
|
-
|
|
17
16
|
if (!didWarnAboutDeprecation[componentName] || !didWarnAboutDeprecation[componentName][propName]) {
|
|
18
|
-
didWarnAboutDeprecation[componentName] = {
|
|
17
|
+
didWarnAboutDeprecation[componentName] = {
|
|
18
|
+
...didWarnAboutDeprecation[componentName],
|
|
19
19
|
[propName]: true
|
|
20
20
|
};
|
|
21
21
|
process.env.NODE_ENV !== "production" ? warning(false, message || `The prop \`${propName}\` has been deprecated for the ` + `${componentName} component. It will be removed in the next major ` + `release`) : void 0;
|
|
22
22
|
}
|
|
23
|
-
|
|
24
23
|
for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
|
|
25
24
|
rest[_key - 3] = arguments[_key];
|
|
26
25
|
}
|
|
27
|
-
|
|
28
26
|
return propType(props, propName, componentName, ...rest);
|
|
29
27
|
}
|
|
30
|
-
|
|
31
28
|
return checker;
|
|
32
29
|
}
|
|
33
30
|
|
|
@@ -13,20 +13,17 @@
|
|
|
13
13
|
*/
|
|
14
14
|
function isRequiredOneOf(propTypes) {
|
|
15
15
|
const names = Object.keys(propTypes);
|
|
16
|
-
|
|
17
16
|
const checker = propType => function (props, propName, componentName) {
|
|
18
17
|
if (process.env.NODE_ENV !== "production" && names.every(name => typeof props[name] === 'undefined')) {
|
|
19
18
|
return new Error(`${componentName} requires one of the following props: ${names.join(', ')}`);
|
|
20
19
|
}
|
|
21
|
-
|
|
22
20
|
for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
|
|
23
21
|
rest[_key - 3] = arguments[_key];
|
|
24
22
|
}
|
|
25
|
-
|
|
26
23
|
return propType(props, propName, componentName, ...rest);
|
|
27
24
|
};
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
return names.reduce((o, name) => ({
|
|
26
|
+
...o,
|
|
30
27
|
[name]: checker(propTypes[name])
|
|
31
28
|
}), {});
|
|
32
29
|
}
|
|
@@ -17,11 +17,9 @@ function requiredIfGivenPropIsTruthy(name, propType) {
|
|
|
17
17
|
if (process.env.NODE_ENV !== "production" && props[name] == true && props[propName] == null) {
|
|
18
18
|
return new Error(`You must provide a value for \`${propName}\` in \`${componentName}\` if \`${name}\` exists.`);
|
|
19
19
|
}
|
|
20
|
-
|
|
21
20
|
for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
|
|
22
21
|
rest[_key - 3] = arguments[_key];
|
|
23
22
|
}
|
|
24
|
-
|
|
25
23
|
return propType(props, propName, componentName, ...rest);
|
|
26
24
|
};
|
|
27
25
|
}
|
package/es/tools/array.js
CHANGED
|
@@ -15,17 +15,14 @@ function equals(arr1, arr2) {
|
|
|
15
15
|
if (!Array.isArray(arr1) || !Array.isArray(arr2) || arr1.length !== arr2.length) {
|
|
16
16
|
return false;
|
|
17
17
|
}
|
|
18
|
-
|
|
19
18
|
if (arr1 === arr2) {
|
|
20
19
|
return true;
|
|
21
20
|
}
|
|
22
|
-
|
|
23
21
|
for (let i = 0; i < arr1.length; i++) {
|
|
24
22
|
if (arr1[i] !== arr2[i]) {
|
|
25
23
|
return false;
|
|
26
24
|
}
|
|
27
25
|
}
|
|
28
|
-
|
|
29
26
|
return true;
|
|
30
27
|
}
|
|
31
28
|
|
package/es/tools/events.js
CHANGED
|
@@ -25,14 +25,11 @@ const composeEventHandlers = fns => function (event) {
|
|
|
25
25
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
26
26
|
args[_key - 1] = arguments[_key];
|
|
27
27
|
}
|
|
28
|
-
|
|
29
28
|
for (let i = 0; i < fns.length; i++) {
|
|
30
29
|
if (event.defaultPrevented) {
|
|
31
30
|
break;
|
|
32
31
|
}
|
|
33
|
-
|
|
34
32
|
const fn = fns[i];
|
|
35
|
-
|
|
36
33
|
if (typeof fn === 'function') {
|
|
37
34
|
fn(event, ...args);
|
|
38
35
|
}
|
package/es/tools/mergeRefs.js
CHANGED
|
@@ -13,7 +13,6 @@ const mergeRefs = function () {
|
|
|
13
13
|
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
14
14
|
refs[_key] = arguments[_key];
|
|
15
15
|
}
|
|
16
|
-
|
|
17
16
|
return el => {
|
|
18
17
|
refs.forEach(ref => {
|
|
19
18
|
// https://github.com/facebook/react/issues/13029#issuecomment-410002316
|
|
@@ -25,7 +24,6 @@ const mergeRefs = function () {
|
|
|
25
24
|
});
|
|
26
25
|
};
|
|
27
26
|
};
|
|
28
|
-
|
|
29
27
|
var mergeRefs$1 = mergeRefs;
|
|
30
28
|
|
|
31
29
|
export { mergeRefs$1 as default };
|
|
@@ -14,14 +14,12 @@ import { usePrefix } from '../internal/usePrefix.js';
|
|
|
14
14
|
* @param {{ name: string, type: string, className?: string | (prefix: string) => string }} props
|
|
15
15
|
* @returns
|
|
16
16
|
*/
|
|
17
|
-
|
|
18
17
|
const wrapComponent = _ref => {
|
|
19
18
|
let {
|
|
20
19
|
name,
|
|
21
20
|
className: getClassName,
|
|
22
21
|
type
|
|
23
22
|
} = _ref;
|
|
24
|
-
|
|
25
23
|
/**
|
|
26
24
|
*
|
|
27
25
|
* @param {{ className?: string, [x: string]: any}} param0
|
|
@@ -34,21 +32,20 @@ const wrapComponent = _ref => {
|
|
|
34
32
|
} = _ref2;
|
|
35
33
|
const prefix = usePrefix();
|
|
36
34
|
const componentClass = cx(typeof getClassName === 'function' ? getClassName(prefix) : getClassName, baseClassName);
|
|
37
|
-
return /*#__PURE__*/React__default.createElement(type, {
|
|
35
|
+
return /*#__PURE__*/React__default.createElement(type, {
|
|
36
|
+
...other,
|
|
38
37
|
// Prevent Weird quirk where `cx` will evaluate to an empty string, '',
|
|
39
38
|
// and so we have empty `class` attributes in the resulting markup
|
|
40
39
|
// eslint-disable-next-line no-extra-boolean-cast
|
|
41
40
|
className: !!componentClass ? componentClass : undefined
|
|
42
41
|
});
|
|
43
42
|
}
|
|
44
|
-
|
|
45
43
|
Component.displayName = name;
|
|
46
44
|
Component.propTypes = {
|
|
47
45
|
className: PropTypes.string
|
|
48
46
|
};
|
|
49
47
|
return Component;
|
|
50
48
|
};
|
|
51
|
-
|
|
52
49
|
var wrapComponent$1 = wrapComponent;
|
|
53
50
|
|
|
54
51
|
export { wrapComponent$1 as default };
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
11
|
|
|
12
12
|
function _defineProperty(obj, key, value) {
|
|
13
|
+
key = _toPropertyKey(key);
|
|
13
14
|
if (key in obj) {
|
|
14
15
|
Object.defineProperty(obj, key, {
|
|
15
16
|
value: value,
|
|
@@ -20,26 +21,38 @@ function _defineProperty(obj, key, value) {
|
|
|
20
21
|
} else {
|
|
21
22
|
obj[key] = value;
|
|
22
23
|
}
|
|
23
|
-
|
|
24
24
|
return obj;
|
|
25
25
|
}
|
|
26
|
-
|
|
27
26
|
function _extends() {
|
|
28
27
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
29
28
|
for (var i = 1; i < arguments.length; i++) {
|
|
30
29
|
var source = arguments[i];
|
|
31
|
-
|
|
32
30
|
for (var key in source) {
|
|
33
31
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
34
32
|
target[key] = source[key];
|
|
35
33
|
}
|
|
36
34
|
}
|
|
37
35
|
}
|
|
38
|
-
|
|
39
36
|
return target;
|
|
40
37
|
};
|
|
41
38
|
return _extends.apply(this, arguments);
|
|
42
39
|
}
|
|
40
|
+
function _toPrimitive(input, hint) {
|
|
41
|
+
if (typeof input !== "object" || input === null) return input;
|
|
42
|
+
var prim = input[Symbol.toPrimitive];
|
|
43
|
+
if (prim !== undefined) {
|
|
44
|
+
var res = prim.call(input, hint || "default");
|
|
45
|
+
if (typeof res !== "object") return res;
|
|
46
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
47
|
+
}
|
|
48
|
+
return (hint === "string" ? String : Number)(input);
|
|
49
|
+
}
|
|
50
|
+
function _toPropertyKey(arg) {
|
|
51
|
+
var key = _toPrimitive(arg, "string");
|
|
52
|
+
return typeof key === "symbol" ? key : String(key);
|
|
53
|
+
}
|
|
43
54
|
|
|
44
55
|
exports.defineProperty = _defineProperty;
|
|
45
56
|
exports["extends"] = _extends;
|
|
57
|
+
exports.toPrimitive = _toPrimitive;
|
|
58
|
+
exports.toPropertyKey = _toPropertyKey;
|
|
@@ -24,7 +24,6 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
24
24
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
25
25
|
|
|
26
26
|
var _SkeletonText, _SkeletonText2, _SkeletonText3;
|
|
27
|
-
|
|
28
27
|
function AccordionSkeleton(_ref) {
|
|
29
28
|
let {
|
|
30
29
|
align,
|
|
@@ -64,28 +63,23 @@ function AccordionSkeleton(_ref) {
|
|
|
64
63
|
key: i
|
|
65
64
|
})));
|
|
66
65
|
}
|
|
67
|
-
|
|
68
66
|
AccordionSkeleton.propTypes = {
|
|
69
67
|
/**
|
|
70
68
|
* Specify the alignment of the accordion heading title and chevron.
|
|
71
69
|
*/
|
|
72
70
|
align: PropTypes__default["default"].oneOf(['start', 'end']),
|
|
73
|
-
|
|
74
71
|
/**
|
|
75
72
|
* Specify an optional className to add.
|
|
76
73
|
*/
|
|
77
74
|
className: PropTypes__default["default"].string,
|
|
78
|
-
|
|
79
75
|
/**
|
|
80
76
|
* Set number of items to render
|
|
81
77
|
*/
|
|
82
78
|
count: PropTypes__default["default"].number,
|
|
83
|
-
|
|
84
79
|
/**
|
|
85
80
|
* Specify whether an individual AccordionItem should be flush, default is false
|
|
86
81
|
*/
|
|
87
82
|
isFlush: PropTypes__default["default"].bool,
|
|
88
|
-
|
|
89
83
|
/**
|
|
90
84
|
* `false` to not display the first item opened
|
|
91
85
|
*/
|
|
@@ -96,7 +90,6 @@ AccordionSkeleton.defaultProps = {
|
|
|
96
90
|
count: 4,
|
|
97
91
|
align: 'end'
|
|
98
92
|
};
|
|
99
|
-
|
|
100
93
|
function AccordionSkeletonItem() {
|
|
101
94
|
const prefix = usePrefix.usePrefix();
|
|
102
95
|
return /*#__PURE__*/React__default["default"].createElement("li", {
|
|
@@ -14,32 +14,12 @@ var cx = require('classnames');
|
|
|
14
14
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
15
15
|
var PropTypes = require('prop-types');
|
|
16
16
|
var React = require('react');
|
|
17
|
-
var FeatureFlags = require('@carbon/feature-flags');
|
|
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 cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
40
21
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
41
22
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
42
|
-
var FeatureFlags__namespace = /*#__PURE__*/_interopNamespace(FeatureFlags);
|
|
43
23
|
|
|
44
24
|
function Accordion(_ref) {
|
|
45
25
|
let {
|
|
@@ -65,37 +45,31 @@ function Accordion(_ref) {
|
|
|
65
45
|
});
|
|
66
46
|
}) : children);
|
|
67
47
|
}
|
|
68
|
-
|
|
69
48
|
Accordion.propTypes = {
|
|
70
49
|
/**
|
|
71
50
|
* Specify the alignment of the accordion heading title and chevron.
|
|
72
51
|
*/
|
|
73
52
|
align: PropTypes__default["default"].oneOf(['start', 'end']),
|
|
74
|
-
|
|
75
53
|
/**
|
|
76
54
|
* Pass in the children that will be rendered within the Accordion
|
|
77
55
|
*/
|
|
78
56
|
children: PropTypes__default["default"].node,
|
|
79
|
-
|
|
80
57
|
/**
|
|
81
58
|
* Specify an optional className to be applied to the container node
|
|
82
59
|
*/
|
|
83
60
|
className: PropTypes__default["default"].string,
|
|
84
|
-
|
|
85
61
|
/**
|
|
86
62
|
* Specify whether an individual AccordionItem should be disabled
|
|
87
63
|
*/
|
|
88
64
|
disabled: PropTypes__default["default"].bool,
|
|
89
|
-
|
|
90
65
|
/**
|
|
91
66
|
* Specify whether Accordion text should be flush, default is false, does not work with align="start"
|
|
92
67
|
*/
|
|
93
68
|
isFlush: PropTypes__default["default"].bool,
|
|
94
|
-
|
|
95
69
|
/**
|
|
96
70
|
* Specify the size of the Accordion. Currently supports the following:
|
|
97
71
|
*/
|
|
98
|
-
size:
|
|
72
|
+
size: PropTypes__default["default"].oneOf(['sm', 'md', 'lg'])
|
|
99
73
|
};
|
|
100
74
|
|
|
101
75
|
exports["default"] = Accordion;
|
|
@@ -31,7 +31,6 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
31
31
|
const defaultRenderToggle = props => /*#__PURE__*/React__default["default"].createElement("button", _rollupPluginBabelHelpers["extends"]({
|
|
32
32
|
type: "button"
|
|
33
33
|
}, props));
|
|
34
|
-
|
|
35
34
|
function AccordionItem(_ref) {
|
|
36
35
|
let {
|
|
37
36
|
children,
|
|
@@ -65,15 +64,14 @@ function AccordionItem(_ref) {
|
|
|
65
64
|
setAnimation(isOpen ? 'collapsing' : 'expanding');
|
|
66
65
|
setIsOpen(open);
|
|
67
66
|
setPrevIsOpen(open);
|
|
68
|
-
}
|
|
69
|
-
// panel
|
|
70
|
-
|
|
67
|
+
}
|
|
71
68
|
|
|
69
|
+
// When the AccordionItem heading is clicked, toggle the open state of the
|
|
70
|
+
// panel
|
|
72
71
|
function onClick(event) {
|
|
73
72
|
const nextValue = !isOpen;
|
|
74
73
|
setAnimation(isOpen ? 'collapsing' : 'expanding');
|
|
75
74
|
setIsOpen(nextValue);
|
|
76
|
-
|
|
77
75
|
if (onHeadingClick) {
|
|
78
76
|
// TODO: normalize signature, potentially:
|
|
79
77
|
// onHeadingClick :: (event: Event, state: { isOpen: Boolean }) => any
|
|
@@ -82,23 +80,20 @@ function AccordionItem(_ref) {
|
|
|
82
80
|
event
|
|
83
81
|
});
|
|
84
82
|
}
|
|
85
|
-
}
|
|
86
|
-
|
|
83
|
+
}
|
|
87
84
|
|
|
85
|
+
// If the AccordionItem is open, and the user hits the ESC key, then close it
|
|
88
86
|
function onKeyDown(event) {
|
|
89
87
|
if (isOpen && match.match(event, keys.Escape)) {
|
|
90
88
|
setIsOpen(false);
|
|
91
89
|
}
|
|
92
90
|
}
|
|
93
|
-
|
|
94
91
|
function handleAnimationEnd(event) {
|
|
95
92
|
if (rest.handleAnimationEnd) {
|
|
96
93
|
rest.handleAnimationEnd(event);
|
|
97
94
|
}
|
|
98
|
-
|
|
99
95
|
setAnimation('');
|
|
100
96
|
}
|
|
101
|
-
|
|
102
97
|
return /*#__PURE__*/React__default["default"].createElement("li", _rollupPluginBabelHelpers["extends"]({
|
|
103
98
|
className: className
|
|
104
99
|
}, rest, {
|
|
@@ -121,50 +116,41 @@ function AccordionItem(_ref) {
|
|
|
121
116
|
className: `${prefix}--accordion__content`
|
|
122
117
|
}, children));
|
|
123
118
|
}
|
|
124
|
-
|
|
125
119
|
AccordionItem.propTypes = {
|
|
126
120
|
/**
|
|
127
121
|
* Provide the contents of your AccordionItem
|
|
128
122
|
*/
|
|
129
123
|
children: PropTypes__default["default"].node,
|
|
130
|
-
|
|
131
124
|
/**
|
|
132
125
|
* Specify an optional className to be applied to the container node
|
|
133
126
|
*/
|
|
134
127
|
className: PropTypes__default["default"].string,
|
|
135
|
-
|
|
136
128
|
/**
|
|
137
129
|
* Specify whether an individual AccordionItem should be disabled
|
|
138
130
|
*/
|
|
139
131
|
disabled: PropTypes__default["default"].bool,
|
|
140
|
-
|
|
141
132
|
/**
|
|
142
133
|
* The handler of the massaged `click` event.
|
|
143
134
|
*/
|
|
144
135
|
onClick: PropTypes__default["default"].func,
|
|
145
|
-
|
|
146
136
|
/**
|
|
147
137
|
* The handler of the massaged `click` event on the heading.
|
|
148
138
|
*/
|
|
149
139
|
onHeadingClick: PropTypes__default["default"].func,
|
|
150
|
-
|
|
151
140
|
/**
|
|
152
141
|
* `true` to open the expand.
|
|
153
142
|
*/
|
|
154
143
|
open: PropTypes__default["default"].bool,
|
|
155
|
-
|
|
156
144
|
/**
|
|
157
145
|
* The callback function to render the expand button.
|
|
158
146
|
* Can be a React component class.
|
|
159
147
|
*/
|
|
160
148
|
renderExpando: deprecate["default"](PropTypes__default["default"].func, 'The `renderExpando` prop has been deprecated and will be removed in the next major release of Carbon. Use the `renderToggle` prop instead.'),
|
|
161
|
-
|
|
162
149
|
/**
|
|
163
150
|
* The callback function to render the expand button.
|
|
164
151
|
* Can be a React component class.
|
|
165
152
|
*/
|
|
166
153
|
renderToggle: PropTypes__default["default"].func,
|
|
167
|
-
|
|
168
154
|
/**
|
|
169
155
|
* The accordion title.
|
|
170
156
|
*/
|
|
@@ -27,7 +27,6 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
27
27
|
* This is often useful alongside our grid components, or for media assets like
|
|
28
28
|
* images or videos.
|
|
29
29
|
*/
|
|
30
|
-
|
|
31
30
|
function AspectRatio(_ref) {
|
|
32
31
|
let {
|
|
33
32
|
as: BaseComponent = 'div',
|
|
@@ -42,7 +41,6 @@ function AspectRatio(_ref) {
|
|
|
42
41
|
className: className
|
|
43
42
|
}, rest), children);
|
|
44
43
|
}
|
|
45
|
-
|
|
46
44
|
AspectRatio.propTypes = {
|
|
47
45
|
/**
|
|
48
46
|
* Provide a custom component or string to be rendered as the outermost node
|
|
@@ -54,17 +52,14 @@ AspectRatio.propTypes = {
|
|
|
54
52
|
* ```
|
|
55
53
|
*/
|
|
56
54
|
as: PropTypes__default["default"].elementType,
|
|
57
|
-
|
|
58
55
|
/**
|
|
59
56
|
* Specify the content that will be placed in the aspect ratio
|
|
60
57
|
*/
|
|
61
58
|
children: PropTypes__default["default"].node,
|
|
62
|
-
|
|
63
59
|
/**
|
|
64
60
|
* Specify a class name for the outermost node of the component
|
|
65
61
|
*/
|
|
66
62
|
className: PropTypes__default["default"].string,
|
|
67
|
-
|
|
68
63
|
/**
|
|
69
64
|
* Specify the ratio to be used by the aspect ratio container. This will
|
|
70
65
|
* determine what aspect ratio your content will be displayed in.
|
|
@@ -22,7 +22,6 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
22
22
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
23
23
|
|
|
24
24
|
var _Item, _Item2, _Item3;
|
|
25
|
-
|
|
26
25
|
function Item() {
|
|
27
26
|
const prefix = usePrefix.usePrefix();
|
|
28
27
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -31,7 +30,6 @@ function Item() {
|
|
|
31
30
|
className: `${prefix}--link`
|
|
32
31
|
}, "\xA0"));
|
|
33
32
|
}
|
|
34
|
-
|
|
35
33
|
function BreadcrumbSkeleton(_ref) {
|
|
36
34
|
let {
|
|
37
35
|
className,
|
|
@@ -43,7 +41,6 @@ function BreadcrumbSkeleton(_ref) {
|
|
|
43
41
|
className: classes
|
|
44
42
|
}, rest), _Item || (_Item = /*#__PURE__*/React__default["default"].createElement(Item, null)), _Item2 || (_Item2 = /*#__PURE__*/React__default["default"].createElement(Item, null)), _Item3 || (_Item3 = /*#__PURE__*/React__default["default"].createElement(Item, null)));
|
|
45
43
|
}
|
|
46
|
-
|
|
47
44
|
BreadcrumbSkeleton.propTypes = {
|
|
48
45
|
/**
|
|
49
46
|
* Specify an optional className to add.
|
|
@@ -48,17 +48,14 @@ Breadcrumb.propTypes = {
|
|
|
48
48
|
* Specify the label for the breadcrumb container
|
|
49
49
|
*/
|
|
50
50
|
'aria-label': PropTypes__default["default"].string,
|
|
51
|
-
|
|
52
51
|
/**
|
|
53
52
|
* Pass in the BreadcrumbItem's for your Breadcrumb
|
|
54
53
|
*/
|
|
55
54
|
children: PropTypes__default["default"].node,
|
|
56
|
-
|
|
57
55
|
/**
|
|
58
56
|
* Specify an optional className to be applied to the container node
|
|
59
57
|
*/
|
|
60
58
|
className: PropTypes__default["default"].string,
|
|
61
|
-
|
|
62
59
|
/**
|
|
63
60
|
* Optional prop to omit the trailing slash for the breadcrumbs
|
|
64
61
|
*/
|