@carbon/react 1.27.0-rc.0 → 1.28.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 +1 -313
- package/es/components/Accordion/Accordion.Skeleton.js +28 -30
- package/es/components/Accordion/Accordion.js +18 -21
- package/es/components/Accordion/AccordionItem.js +37 -49
- package/es/components/AspectRatio/AspectRatio.js +10 -12
- package/es/components/Breadcrumb/Breadcrumb.Skeleton.js +10 -11
- package/es/components/Breadcrumb/Breadcrumb.js +14 -13
- package/es/components/Breadcrumb/BreadcrumbItem.js +24 -22
- package/es/components/Button/Button.Skeleton.js +25 -23
- package/es/components/Button/Button.js +77 -72
- package/es/components/ButtonSet/ButtonSet.js +12 -10
- package/es/components/Checkbox/Checkbox.Skeleton.js +10 -11
- package/es/components/Checkbox/Checkbox.js +55 -52
- package/es/components/CheckboxGroup/CheckboxGroup.js +33 -31
- package/es/components/ClassPrefix/index.js +4 -2
- package/es/components/CodeSnippet/CodeSnippet.Skeleton.js +15 -14
- package/es/components/CodeSnippet/CodeSnippet.js +199 -102
- package/es/components/ComboBox/ComboBox.js +349 -178
- package/es/components/ComboBox/tools/filter.js +6 -4
- package/es/components/ComboButton/index.js +38 -43
- package/es/components/ComposedModal/ComposedModal.js +187 -85
- package/es/components/ComposedModal/ModalFooter.js +54 -49
- package/es/components/ComposedModal/ModalHeader.js +39 -26
- package/es/components/ContainedList/ContainedList.js +18 -17
- package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +20 -18
- package/es/components/ContentSwitcher/ContentSwitcher.js +83 -98
- package/es/components/ContentSwitcher/index.js +1 -1
- package/es/components/ContextMenu/useContextMenu.js +12 -21
- package/es/components/Copy/Copy.js +24 -29
- package/es/components/CopyButton/CopyButton.js +10 -10
- package/es/components/DangerButton/DangerButton.js +3 -5
- package/es/components/DataTable/DataTable.js +334 -361
- package/es/components/DataTable/Table.js +29 -26
- package/es/components/DataTable/TableActionList.js +2 -4
- package/es/components/DataTable/TableBatchAction.js +2 -4
- package/es/components/DataTable/TableBatchActions.js +29 -30
- package/es/components/DataTable/TableBody.js +7 -8
- package/es/components/DataTable/TableCell.js +1 -1
- package/es/components/DataTable/TableContainer.js +23 -23
- package/es/components/DataTable/TableContext.js +1 -1
- package/es/components/DataTable/TableExpandHeader.js +19 -21
- package/es/components/DataTable/TableExpandRow.js +23 -23
- package/es/components/DataTable/TableExpandedRow.js +18 -23
- package/es/components/DataTable/TableHead.js +1 -1
- package/es/components/DataTable/TableHeader.js +45 -41
- package/es/components/DataTable/TableRow.js +7 -8
- package/es/components/DataTable/TableSelectAll.js +13 -11
- package/es/components/DataTable/TableSelectRow.js +29 -21
- package/es/components/DataTable/TableToolbar.js +19 -14
- package/es/components/DataTable/TableToolbarAction.js +6 -6
- package/es/components/DataTable/TableToolbarContent.js +2 -4
- package/es/components/DataTable/TableToolbarMenu.js +11 -12
- package/es/components/DataTable/TableToolbarSearch.js +52 -71
- package/es/components/DataTable/state/getDerivedStateFromProps.js +15 -15
- package/es/components/DataTable/state/sortStates.js +1 -1
- package/es/components/DataTable/state/sorting.js +28 -20
- package/es/components/DataTable/tools/cells.js +1 -3
- package/es/components/DataTable/tools/denormalize.js +4 -17
- package/es/components/DataTable/tools/filter.js +18 -16
- package/es/components/DataTable/tools/instanceId.js +2 -2
- package/es/components/DataTable/tools/normalize.js +28 -25
- package/es/components/DataTable/tools/sorting.js +28 -25
- package/es/components/DataTableSkeleton/DataTableSkeleton.js +36 -38
- package/es/components/DatePicker/DatePicker.Skeleton.js +17 -18
- package/es/components/DatePicker/DatePicker.js +206 -195
- package/es/components/DatePicker/plugins/appendToPlugin.js +45 -43
- package/es/components/DatePicker/plugins/fixEventsPlugin.js +117 -107
- package/es/components/DatePicker/plugins/rangePlugin.js +19 -11
- package/es/components/DatePickerInput/DatePickerInput.js +83 -74
- package/es/components/Dropdown/Dropdown.Skeleton.js +13 -12
- package/es/components/Dropdown/Dropdown.js +266 -109
- package/es/components/ErrorBoundary/ErrorBoundary.js +27 -48
- package/es/components/ErrorBoundary/ErrorBoundaryContext.js +3 -2
- package/es/components/ExpandableSearch/ExpandableSearch.d.ts +13 -0
- package/es/components/ExpandableSearch/ExpandableSearch.js +18 -25
- package/es/components/FeatureFlags/index.js +25 -43
- package/es/components/FileUploader/FileUploader.Skeleton.js +8 -9
- package/es/components/FileUploader/FileUploader.js +120 -147
- package/es/components/FileUploader/FileUploaderButton.js +36 -48
- package/es/components/FileUploader/FileUploaderDropContainer.js +49 -53
- package/es/components/FileUploader/FileUploaderItem.js +30 -30
- package/es/components/FileUploader/Filename.js +13 -14
- package/es/components/FluidComboBox/FluidComboBox.Skeleton.js +11 -12
- package/es/components/FluidComboBox/FluidComboBox.js +11 -9
- package/es/components/FluidDatePicker/FluidDatePicker.Skeleton.js +18 -18
- package/es/components/FluidDatePicker/FluidDatePicker.js +19 -16
- package/es/components/FluidDatePickerInput/FluidDatePickerInput.js +3 -3
- package/es/components/FluidDropdown/FluidDropdown.Skeleton.js +11 -12
- package/es/components/FluidDropdown/FluidDropdown.js +11 -9
- package/es/components/FluidForm/FluidForm.js +9 -10
- package/es/components/FluidForm/FormContext.js +1 -1
- package/es/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +11 -12
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +12 -10
- package/es/components/FluidSelect/FluidSelect.Skeleton.js +11 -12
- package/es/components/FluidSelect/FluidSelect.js +9 -9
- package/es/components/FluidTextArea/FluidTextArea.Skeleton.js +9 -10
- package/es/components/FluidTextArea/FluidTextArea.js +7 -8
- package/es/components/FluidTextInput/FluidTextInput.Skeleton.js +9 -10
- package/es/components/FluidTextInput/FluidTextInput.js +10 -9
- package/es/components/FluidTimePicker/FluidTimePicker.Skeleton.js +11 -10
- package/es/components/FluidTimePicker/FluidTimePicker.js +30 -26
- package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +7 -7
- package/es/components/Form/Form.js +9 -10
- package/es/components/FormGroup/FormGroup.js +16 -17
- package/es/components/FormItem/FormItem.js +8 -9
- package/es/components/FormLabel/FormLabel.js +11 -10
- package/es/components/Grid/CSSGrid.js +38 -39
- package/es/components/Grid/Column.js +86 -79
- package/es/components/Grid/ColumnHang.js +12 -14
- package/es/components/Grid/FlexGrid.js +19 -21
- package/es/components/Grid/Grid.js +2 -2
- package/es/components/Grid/GridContext.js +12 -11
- package/es/components/Grid/Row.js +16 -18
- package/es/components/Heading/index.js +11 -13
- package/es/components/Icon/Icon.Skeleton.js +10 -12
- package/es/components/IconButton/index.js +19 -22
- package/es/components/IdPrefix/index.js +4 -2
- package/es/components/InlineCheckbox/InlineCheckbox.js +89 -36
- package/es/components/InlineLoading/InlineLoading.js +23 -25
- package/es/components/Layer/LayerContext.js +1 -1
- package/es/components/Layer/index.js +17 -18
- package/es/components/Layout/LayoutDirection.js +8 -10
- package/es/components/Layout/LayoutDirectionContext.js +1 -1
- package/es/components/Link/Link.js +25 -25
- package/es/components/ListBox/ListBox.js +38 -31
- package/es/components/ListBox/ListBoxField.js +9 -10
- package/es/components/ListBox/ListBoxMenu.js +9 -10
- package/es/components/ListBox/ListBoxMenuIcon.js +16 -14
- package/es/components/ListBox/ListBoxMenuItem.js +23 -26
- package/es/components/ListBox/ListBoxPropTypes.js +4 -4
- package/es/components/ListBox/ListBoxSelection.js +30 -25
- package/es/components/ListBox/index.js +1 -1
- package/es/components/ListBox/next/ListBoxSelection.js +27 -24
- package/es/components/ListBox/next/ListBoxTrigger.js +20 -19
- package/es/components/ListItem/ListItem.js +9 -10
- package/es/components/Loading/Loading.js +24 -24
- package/es/components/Menu/Menu.js +67 -80
- package/es/components/Menu/MenuContext.js +9 -12
- package/es/components/Menu/MenuItem.js +104 -128
- package/es/components/MenuButton/index.js +37 -41
- package/es/components/Modal/Modal.js +281 -120
- package/es/components/ModalWrapper/ModalWrapper.js +72 -96
- package/es/components/MultiSelect/FilterableMultiSelect.js +299 -163
- package/es/components/MultiSelect/MultiSelect.js +162 -174
- package/es/components/MultiSelect/MultiSelectPropTypes.js +1 -1
- package/es/components/MultiSelect/tools/itemToString.js +3 -4
- package/es/components/MultiSelect/tools/sorting.js +15 -13
- package/es/components/Notification/Notification.js +436 -164
- package/es/components/NumberInput/NumberInput.Skeleton.js +10 -11
- package/es/components/NumberInput/NumberInput.js +140 -139
- package/es/components/OrderedList/OrderedList.js +17 -15
- package/es/components/OverflowMenu/OverflowMenu.js +359 -227
- package/es/components/OverflowMenu/index.js +1 -1
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +32 -37
- package/es/components/OverflowMenuV2/index.js +26 -28
- package/es/components/Pagination/Pagination.Skeleton.js +9 -10
- package/es/components/Pagination/Pagination.js +98 -140
- package/es/components/Pagination/experimental/PageSelector.js +16 -16
- package/es/components/Pagination/experimental/Pagination.js +73 -94
- package/es/components/PaginationNav/PaginationNav.js +98 -117
- package/es/components/Popover/index.js +74 -80
- package/es/components/PrimaryButton/PrimaryButton.js +3 -5
- package/es/components/ProgressBar/ProgressBar.js +39 -37
- package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.js +15 -14
- package/es/components/ProgressIndicator/ProgressIndicator.js +71 -71
- package/es/components/RadioButton/RadioButton.Skeleton.js +9 -10
- package/es/components/RadioButton/RadioButton.js +27 -27
- package/es/components/RadioButtonGroup/RadioButtonGroup.js +55 -65
- package/es/components/RadioTile/RadioTile.js +28 -26
- package/es/components/Search/Search.Skeleton.js +16 -16
- package/es/components/Search/Search.d.ts +83 -0
- package/es/components/Search/Search.js +65 -72
- package/es/components/Search/index.d.ts +11 -0
- package/es/components/SecondaryButton/SecondaryButton.js +3 -5
- package/es/components/Select/Select.Skeleton.js +12 -13
- package/es/components/Select/Select.js +79 -73
- package/es/components/SelectItem/SelectItem.js +17 -13
- package/es/components/SelectItemGroup/SelectItemGroup.js +11 -12
- package/es/components/SkeletonIcon/SkeletonIcon.js +11 -11
- package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +11 -11
- package/es/components/SkeletonText/SkeletonText.js +29 -29
- package/es/components/Slider/Slider.Skeleton.js +17 -18
- package/es/components/Slider/Slider.js +306 -329
- package/es/components/Slider/index.js +1 -1
- package/es/components/Stack/Stack.js +19 -20
- package/es/components/Stack/index.js +2 -2
- package/es/components/StructuredList/StructuredList.Skeleton.js +25 -24
- package/es/components/StructuredList/StructuredList.js +134 -106
- package/es/components/Switch/IconSwitch.js +48 -54
- package/es/components/Switch/Switch.js +33 -31
- package/es/components/Tab/Tab.js +77 -83
- package/es/components/Tab/index.js +1 -1
- package/es/components/TabContent/TabContent.js +16 -18
- package/es/components/Tabs/Tabs.Skeleton.js +14 -13
- package/es/components/Tabs/Tabs.js +211 -210
- package/es/components/Tabs/usePressable.js +27 -36
- package/es/components/Tag/Tag.Skeleton.js +10 -9
- package/es/components/Tag/Tag.js +34 -31
- package/es/components/Text/Text.js +20 -20
- package/es/components/Text/TextDirection.js +8 -7
- package/es/components/Text/TextDirectionContext.js +1 -1
- package/es/components/Text/index.js +1 -1
- package/es/components/TextArea/TextArea.Skeleton.js +11 -12
- package/es/components/TextArea/TextArea.js +89 -83
- package/es/components/TextInput/ControlledPasswordInput.js +79 -73
- package/es/components/TextInput/PasswordInput.js +101 -91
- package/es/components/TextInput/TextInput.Skeleton.js +11 -12
- package/es/components/TextInput/TextInput.js +104 -92
- package/es/components/TextInput/util.js +26 -28
- package/es/components/Theme/index.js +25 -20
- package/es/components/Tile/Tile.js +135 -176
- package/es/components/TileGroup/TileGroup.js +55 -70
- package/es/components/TileGroup/index.js +1 -1
- package/es/components/TimePicker/TimePicker.js +60 -67
- package/es/components/TimePickerSelect/TimePickerSelect.js +20 -18
- package/es/components/TimePickerSelect/index.js +1 -1
- package/es/components/Toggle/Toggle.Skeleton.js +63 -52
- package/es/components/Toggle/Toggle.js +44 -48
- package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +56 -50
- package/es/components/Toggletip/index.js +52 -48
- package/es/components/Tooltip/DefinitionTooltip.js +24 -31
- package/es/components/Tooltip/Tooltip.js +35 -50
- package/es/components/TreeView/TreeNode.js +94 -74
- package/es/components/TreeView/TreeView.js +72 -83
- package/es/components/UIShell/Content.js +12 -14
- package/es/components/UIShell/Header.js +16 -12
- package/es/components/UIShell/HeaderContainer.js +8 -14
- package/es/components/UIShell/HeaderGlobalAction.js +26 -19
- package/es/components/UIShell/HeaderGlobalBar.js +1 -3
- package/es/components/UIShell/HeaderMenu.js +114 -129
- package/es/components/UIShell/HeaderMenuButton.js +31 -22
- package/es/components/UIShell/HeaderMenuItem.js +28 -20
- package/es/components/UIShell/HeaderName.js +19 -14
- package/es/components/UIShell/HeaderNavigation.js +19 -15
- package/es/components/UIShell/HeaderPanel.js +23 -17
- package/es/components/UIShell/HeaderSideNavItems.js +11 -9
- package/es/components/UIShell/Link.js +11 -11
- package/es/components/UIShell/SideNav.js +66 -62
- package/es/components/UIShell/SideNavDetails.js +11 -12
- package/es/components/UIShell/SideNavDivider.js +5 -3
- package/es/components/UIShell/SideNavFooter.js +12 -12
- package/es/components/UIShell/SideNavHeader.js +8 -6
- package/es/components/UIShell/SideNavIcon.js +11 -8
- package/es/components/UIShell/SideNavItem.js +11 -9
- package/es/components/UIShell/SideNavItems.js +13 -11
- package/es/components/UIShell/SideNavLink.js +19 -17
- package/es/components/UIShell/SideNavLinkText.js +8 -9
- package/es/components/UIShell/SideNavMenu.js +28 -35
- package/es/components/UIShell/SideNavMenuItem.js +14 -14
- package/es/components/UIShell/SideNavSwitcher.js +19 -19
- package/es/components/UIShell/SkipToContent.js +10 -11
- package/es/components/UIShell/Switcher.js +20 -11
- package/es/components/UIShell/SwitcherDivider.js +10 -9
- package/es/components/UIShell/SwitcherItem.js +26 -19
- package/es/components/UIShell/_utils.js +1 -1
- package/es/components/UnorderedList/UnorderedList.js +14 -14
- package/es/index.js +5 -5
- package/es/internal/ClickListener.js +49 -65
- package/es/internal/FloatingMenu.js +193 -200
- package/es/internal/OptimizedResize.js +9 -8
- package/es/internal/Selection.js +92 -111
- package/es/internal/createClassWrapper.js +2 -2
- package/es/internal/deprecateFieldOnObject.js +5 -3
- package/es/internal/environment.js +1 -1
- package/es/internal/focus/index.js +1 -1
- package/es/internal/keyboard/keys.js +11 -11
- package/es/internal/keyboard/match.js +7 -6
- package/es/internal/keyboard/navigation.js +15 -5
- package/es/internal/useAnnouncer.js +2 -2
- package/es/internal/useAttachedMenu.js +12 -20
- package/es/internal/useControllableState.js +11 -16
- package/es/internal/useDelayedState.js +9 -18
- package/es/internal/useEffectOnce.js +4 -4
- package/es/internal/useEvent.js +4 -4
- package/es/internal/useId.js +15 -19
- package/es/internal/useIdPrefix.js +1 -1
- package/es/internal/useIsomorphicEffect.js +1 -1
- package/es/internal/useMergedRefs.js +3 -3
- package/es/internal/useNoInteractiveChildren.js +8 -19
- package/es/internal/useNormalizedInputProps.js +16 -14
- package/es/internal/usePrefix.js +1 -1
- package/es/internal/useSavedCallback.js +3 -3
- package/es/internal/warning.js +4 -4
- package/es/internal/wrapFocus.js +16 -21
- package/es/prop-types/AriaPropTypes.js +1 -1
- package/es/prop-types/deprecate.js +6 -5
- package/es/prop-types/isRequiredOneOf.js +12 -25
- package/es/prop-types/requiredIfGivenPropIsTruthy.js +2 -2
- package/es/prop-types/types.js +1 -1
- package/es/tools/array.js +1 -1
- package/es/tools/events.js +21 -14
- package/es/tools/mergeRefs.js +3 -3
- package/es/tools/setupGetInstanceId.js +1 -1
- package/es/tools/uniqueId.js +3 -3
- package/es/tools/wrapComponent.js +14 -13
- package/lib/_virtual/_rollupPluginBabelHelpers.js +0 -336
- package/lib/components/Accordion/Accordion.Skeleton.js +27 -29
- package/lib/components/Accordion/Accordion.js +17 -20
- package/lib/components/Accordion/AccordionItem.js +36 -48
- package/lib/components/AspectRatio/AspectRatio.js +9 -11
- package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +9 -10
- package/lib/components/Breadcrumb/Breadcrumb.js +13 -12
- package/lib/components/Breadcrumb/BreadcrumbItem.js +23 -21
- package/lib/components/Button/Button.Skeleton.js +24 -22
- package/lib/components/Button/Button.js +76 -71
- package/lib/components/ButtonSet/ButtonSet.js +11 -9
- package/lib/components/Checkbox/Checkbox.Skeleton.js +9 -10
- package/lib/components/Checkbox/Checkbox.js +54 -51
- package/lib/components/CheckboxGroup/CheckboxGroup.js +32 -30
- package/lib/components/ClassPrefix/index.js +4 -2
- package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +14 -13
- package/lib/components/CodeSnippet/CodeSnippet.js +198 -101
- package/lib/components/ComboBox/ComboBox.js +348 -177
- package/lib/components/ComboBox/tools/filter.js +6 -4
- package/lib/components/ComboButton/index.js +37 -42
- package/lib/components/ComposedModal/ComposedModal.js +187 -85
- package/lib/components/ComposedModal/ModalFooter.js +53 -48
- package/lib/components/ComposedModal/ModalHeader.js +38 -25
- package/lib/components/ContainedList/ContainedList.js +18 -17
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +20 -18
- package/lib/components/ContentSwitcher/ContentSwitcher.js +82 -97
- package/lib/components/ContentSwitcher/index.js +1 -1
- package/lib/components/ContextMenu/useContextMenu.js +12 -21
- package/lib/components/Copy/Copy.js +23 -28
- package/lib/components/CopyButton/CopyButton.js +9 -9
- package/lib/components/DangerButton/DangerButton.js +3 -5
- package/lib/components/DataTable/DataTable.js +332 -359
- package/lib/components/DataTable/Table.js +28 -25
- package/lib/components/DataTable/TableActionList.js +2 -4
- package/lib/components/DataTable/TableBatchAction.js +2 -4
- package/lib/components/DataTable/TableBatchActions.js +28 -29
- package/lib/components/DataTable/TableBody.js +6 -7
- package/lib/components/DataTable/TableCell.js +1 -1
- package/lib/components/DataTable/TableContainer.js +22 -22
- package/lib/components/DataTable/TableContext.js +1 -1
- package/lib/components/DataTable/TableExpandHeader.js +18 -20
- package/lib/components/DataTable/TableExpandRow.js +22 -22
- package/lib/components/DataTable/TableExpandedRow.js +17 -22
- package/lib/components/DataTable/TableHead.js +1 -1
- package/lib/components/DataTable/TableHeader.js +43 -39
- package/lib/components/DataTable/TableRow.js +7 -8
- package/lib/components/DataTable/TableSelectAll.js +13 -11
- package/lib/components/DataTable/TableSelectRow.js +28 -20
- package/lib/components/DataTable/TableToolbar.js +18 -13
- package/lib/components/DataTable/TableToolbarAction.js +5 -5
- package/lib/components/DataTable/TableToolbarContent.js +2 -4
- package/lib/components/DataTable/TableToolbarMenu.js +10 -11
- package/lib/components/DataTable/TableToolbarSearch.js +51 -70
- package/lib/components/DataTable/state/getDerivedStateFromProps.js +15 -15
- package/lib/components/DataTable/state/sortStates.js +1 -1
- package/lib/components/DataTable/state/sorting.js +28 -20
- package/lib/components/DataTable/tools/cells.js +1 -3
- package/lib/components/DataTable/tools/denormalize.js +4 -17
- package/lib/components/DataTable/tools/filter.js +18 -16
- package/lib/components/DataTable/tools/instanceId.js +2 -2
- package/lib/components/DataTable/tools/normalize.js +28 -25
- package/lib/components/DataTable/tools/sorting.js +27 -24
- package/lib/components/DataTableSkeleton/DataTableSkeleton.js +35 -37
- package/lib/components/DatePicker/DatePicker.Skeleton.js +16 -17
- package/lib/components/DatePicker/DatePicker.js +205 -194
- package/lib/components/DatePicker/plugins/appendToPlugin.js +45 -43
- package/lib/components/DatePicker/plugins/fixEventsPlugin.js +117 -107
- package/lib/components/DatePicker/plugins/rangePlugin.js +19 -11
- package/lib/components/DatePickerInput/DatePickerInput.js +83 -74
- package/lib/components/Dropdown/Dropdown.Skeleton.js +12 -11
- package/lib/components/Dropdown/Dropdown.js +265 -108
- package/lib/components/ErrorBoundary/ErrorBoundary.js +27 -48
- package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +3 -2
- package/lib/components/ExpandableSearch/ExpandableSearch.d.ts +13 -0
- package/lib/components/ExpandableSearch/ExpandableSearch.js +17 -24
- package/lib/components/FeatureFlags/index.js +25 -43
- package/lib/components/FileUploader/FileUploader.Skeleton.js +7 -8
- package/lib/components/FileUploader/FileUploader.js +119 -146
- package/lib/components/FileUploader/FileUploaderButton.js +35 -47
- package/lib/components/FileUploader/FileUploaderDropContainer.js +48 -52
- package/lib/components/FileUploader/FileUploaderItem.js +29 -29
- package/lib/components/FileUploader/Filename.js +12 -13
- package/lib/components/FluidComboBox/FluidComboBox.Skeleton.js +10 -11
- package/lib/components/FluidComboBox/FluidComboBox.js +10 -8
- package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.js +17 -17
- package/lib/components/FluidDatePicker/FluidDatePicker.js +18 -15
- package/lib/components/FluidDatePickerInput/FluidDatePickerInput.js +3 -3
- package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +10 -11
- package/lib/components/FluidDropdown/FluidDropdown.js +10 -8
- package/lib/components/FluidForm/FluidForm.js +8 -9
- package/lib/components/FluidForm/FormContext.js +1 -1
- package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +10 -11
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +11 -9
- package/lib/components/FluidSelect/FluidSelect.Skeleton.js +10 -11
- package/lib/components/FluidSelect/FluidSelect.js +8 -8
- package/lib/components/FluidTextArea/FluidTextArea.Skeleton.js +8 -9
- package/lib/components/FluidTextArea/FluidTextArea.js +6 -7
- package/lib/components/FluidTextInput/FluidTextInput.Skeleton.js +8 -9
- package/lib/components/FluidTextInput/FluidTextInput.js +9 -8
- package/lib/components/FluidTimePicker/FluidTimePicker.Skeleton.js +10 -9
- package/lib/components/FluidTimePicker/FluidTimePicker.js +30 -26
- package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +6 -6
- package/lib/components/Form/Form.js +8 -9
- package/lib/components/FormGroup/FormGroup.js +15 -16
- package/lib/components/FormItem/FormItem.js +7 -8
- package/lib/components/FormLabel/FormLabel.js +10 -9
- package/lib/components/Grid/CSSGrid.js +37 -38
- package/lib/components/Grid/Column.js +85 -78
- package/lib/components/Grid/ColumnHang.js +11 -13
- package/lib/components/Grid/FlexGrid.js +19 -21
- package/lib/components/Grid/Grid.js +2 -2
- package/lib/components/Grid/GridContext.js +12 -11
- package/lib/components/Grid/Row.js +16 -18
- package/lib/components/Heading/index.js +11 -13
- package/lib/components/Icon/Icon.Skeleton.js +9 -11
- package/lib/components/IconButton/index.js +18 -21
- package/lib/components/IdPrefix/index.js +4 -2
- package/lib/components/InlineCheckbox/InlineCheckbox.js +89 -36
- package/lib/components/InlineLoading/InlineLoading.js +22 -24
- package/lib/components/Layer/LayerContext.js +1 -1
- package/lib/components/Layer/index.js +16 -17
- package/lib/components/Layout/LayoutDirection.js +7 -9
- package/lib/components/Layout/LayoutDirectionContext.js +1 -1
- package/lib/components/Link/Link.js +24 -24
- package/lib/components/ListBox/ListBox.js +37 -30
- package/lib/components/ListBox/ListBoxField.js +8 -9
- package/lib/components/ListBox/ListBoxMenu.js +8 -9
- package/lib/components/ListBox/ListBoxMenuIcon.js +16 -14
- package/lib/components/ListBox/ListBoxMenuItem.js +22 -25
- package/lib/components/ListBox/ListBoxPropTypes.js +4 -4
- package/lib/components/ListBox/ListBoxSelection.js +30 -25
- package/lib/components/ListBox/index.js +1 -1
- package/lib/components/ListBox/next/ListBoxSelection.js +26 -23
- package/lib/components/ListBox/next/ListBoxTrigger.js +19 -18
- package/lib/components/ListItem/ListItem.js +8 -9
- package/lib/components/Loading/Loading.js +23 -23
- package/lib/components/Menu/Menu.js +66 -79
- package/lib/components/Menu/MenuContext.js +9 -12
- package/lib/components/Menu/MenuItem.js +103 -127
- package/lib/components/MenuButton/index.js +36 -40
- package/lib/components/Modal/Modal.js +280 -119
- package/lib/components/ModalWrapper/ModalWrapper.js +71 -95
- package/lib/components/MultiSelect/FilterableMultiSelect.js +298 -162
- package/lib/components/MultiSelect/MultiSelect.js +163 -175
- package/lib/components/MultiSelect/MultiSelectPropTypes.js +1 -1
- package/lib/components/MultiSelect/tools/itemToString.js +3 -4
- package/lib/components/MultiSelect/tools/sorting.js +15 -13
- package/lib/components/Notification/Notification.js +434 -162
- package/lib/components/NumberInput/NumberInput.Skeleton.js +9 -10
- package/lib/components/NumberInput/NumberInput.js +139 -138
- package/lib/components/OrderedList/OrderedList.js +16 -14
- package/lib/components/OverflowMenu/OverflowMenu.js +358 -226
- package/lib/components/OverflowMenu/index.js +1 -1
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +31 -36
- package/lib/components/OverflowMenuV2/index.js +25 -27
- package/lib/components/Pagination/Pagination.Skeleton.js +8 -9
- package/lib/components/Pagination/Pagination.js +97 -139
- package/lib/components/Pagination/experimental/PageSelector.js +17 -17
- package/lib/components/Pagination/experimental/Pagination.js +72 -93
- package/lib/components/PaginationNav/PaginationNav.js +97 -116
- package/lib/components/Popover/index.js +73 -79
- package/lib/components/PrimaryButton/PrimaryButton.js +3 -5
- package/lib/components/ProgressBar/ProgressBar.js +38 -36
- package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +14 -13
- package/lib/components/ProgressIndicator/ProgressIndicator.js +70 -70
- package/lib/components/RadioButton/RadioButton.Skeleton.js +8 -9
- package/lib/components/RadioButton/RadioButton.js +26 -26
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +54 -64
- package/lib/components/RadioTile/RadioTile.js +27 -25
- package/lib/components/Search/Search.Skeleton.js +15 -15
- package/lib/components/Search/Search.d.ts +83 -0
- package/lib/components/Search/Search.js +62 -69
- package/lib/components/Search/index.d.ts +11 -0
- package/lib/components/SecondaryButton/SecondaryButton.js +3 -5
- package/lib/components/Select/Select.Skeleton.js +11 -12
- package/lib/components/Select/Select.js +78 -72
- package/lib/components/SelectItem/SelectItem.js +16 -12
- package/lib/components/SelectItemGroup/SelectItemGroup.js +10 -11
- package/lib/components/SkeletonIcon/SkeletonIcon.js +10 -10
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +10 -10
- package/lib/components/SkeletonText/SkeletonText.js +28 -28
- package/lib/components/Slider/Slider.Skeleton.js +16 -17
- package/lib/components/Slider/Slider.js +305 -328
- package/lib/components/Slider/index.js +1 -1
- package/lib/components/Stack/Stack.js +18 -19
- package/lib/components/Stack/index.js +2 -2
- package/lib/components/StructuredList/StructuredList.Skeleton.js +24 -23
- package/lib/components/StructuredList/StructuredList.js +133 -105
- package/lib/components/Switch/IconSwitch.js +45 -51
- package/lib/components/Switch/Switch.js +33 -31
- package/lib/components/Tab/Tab.js +76 -82
- package/lib/components/Tab/index.js +1 -1
- package/lib/components/TabContent/TabContent.js +15 -17
- package/lib/components/Tabs/Tabs.Skeleton.js +13 -12
- package/lib/components/Tabs/Tabs.js +210 -209
- package/lib/components/Tabs/usePressable.js +27 -36
- package/lib/components/Tag/Tag.Skeleton.js +9 -8
- package/lib/components/Tag/Tag.js +33 -30
- package/lib/components/Text/Text.js +19 -19
- package/lib/components/Text/TextDirection.js +8 -7
- package/lib/components/Text/TextDirectionContext.js +1 -1
- package/lib/components/Text/index.js +1 -1
- package/lib/components/TextArea/TextArea.Skeleton.js +10 -11
- package/lib/components/TextArea/TextArea.js +88 -82
- package/lib/components/TextInput/ControlledPasswordInput.js +78 -72
- package/lib/components/TextInput/PasswordInput.js +100 -90
- package/lib/components/TextInput/TextInput.Skeleton.js +10 -11
- package/lib/components/TextInput/TextInput.js +104 -92
- package/lib/components/TextInput/util.js +28 -30
- package/lib/components/Theme/index.js +24 -19
- package/lib/components/Tile/Tile.js +134 -175
- package/lib/components/TileGroup/TileGroup.js +54 -69
- package/lib/components/TileGroup/index.js +1 -1
- package/lib/components/TimePicker/TimePicker.js +59 -66
- package/lib/components/TimePickerSelect/TimePickerSelect.js +19 -17
- package/lib/components/TimePickerSelect/index.js +1 -1
- package/lib/components/Toggle/Toggle.Skeleton.js +68 -57
- package/lib/components/Toggle/Toggle.js +43 -47
- package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +60 -54
- package/lib/components/Toggletip/index.js +51 -47
- package/lib/components/Tooltip/DefinitionTooltip.js +23 -30
- package/lib/components/Tooltip/Tooltip.js +34 -49
- package/lib/components/TreeView/TreeNode.js +93 -73
- package/lib/components/TreeView/TreeView.js +71 -82
- package/lib/components/UIShell/Content.js +12 -14
- package/lib/components/UIShell/Header.js +15 -11
- package/lib/components/UIShell/HeaderContainer.js +8 -14
- package/lib/components/UIShell/HeaderGlobalAction.js +25 -18
- package/lib/components/UIShell/HeaderGlobalBar.js +1 -3
- package/lib/components/UIShell/HeaderMenu.js +113 -128
- package/lib/components/UIShell/HeaderMenuButton.js +30 -21
- package/lib/components/UIShell/HeaderMenuItem.js +27 -19
- package/lib/components/UIShell/HeaderName.js +18 -13
- package/lib/components/UIShell/HeaderNavigation.js +18 -14
- package/lib/components/UIShell/HeaderPanel.js +22 -16
- package/lib/components/UIShell/HeaderSideNavItems.js +11 -9
- package/lib/components/UIShell/Link.js +11 -11
- package/lib/components/UIShell/SideNav.js +65 -61
- package/lib/components/UIShell/SideNavDetails.js +10 -11
- package/lib/components/UIShell/SideNavDivider.js +5 -3
- package/lib/components/UIShell/SideNavFooter.js +12 -12
- package/lib/components/UIShell/SideNavHeader.js +8 -6
- package/lib/components/UIShell/SideNavIcon.js +11 -8
- package/lib/components/UIShell/SideNavItem.js +11 -9
- package/lib/components/UIShell/SideNavItems.js +13 -11
- package/lib/components/UIShell/SideNavLink.js +18 -16
- package/lib/components/UIShell/SideNavLinkText.js +7 -8
- package/lib/components/UIShell/SideNavMenu.js +28 -35
- package/lib/components/UIShell/SideNavMenuItem.js +13 -13
- package/lib/components/UIShell/SideNavSwitcher.js +19 -19
- package/lib/components/UIShell/SkipToContent.js +9 -10
- package/lib/components/UIShell/Switcher.js +19 -10
- package/lib/components/UIShell/SwitcherDivider.js +9 -8
- package/lib/components/UIShell/SwitcherItem.js +25 -18
- package/lib/components/UIShell/_utils.js +1 -1
- package/lib/components/UnorderedList/UnorderedList.js +13 -13
- package/lib/index.js +10 -10
- package/lib/internal/ClickListener.js +49 -65
- package/lib/internal/FloatingMenu.js +192 -199
- package/lib/internal/OptimizedResize.js +9 -8
- package/lib/internal/Selection.js +91 -110
- package/lib/internal/createClassWrapper.js +2 -2
- package/lib/internal/deprecateFieldOnObject.js +5 -3
- package/lib/internal/environment.js +1 -1
- package/lib/internal/focus/index.js +1 -1
- package/lib/internal/keyboard/keys.js +11 -11
- package/lib/internal/keyboard/match.js +7 -6
- package/lib/internal/keyboard/navigation.js +15 -5
- package/lib/internal/useAnnouncer.js +2 -2
- package/lib/internal/useAttachedMenu.js +12 -20
- package/lib/internal/useControllableState.js +11 -16
- package/lib/internal/useDelayedState.js +9 -18
- package/lib/internal/useEffectOnce.js +4 -4
- package/lib/internal/useEvent.js +4 -4
- package/lib/internal/useId.js +14 -18
- package/lib/internal/useIdPrefix.js +1 -1
- package/lib/internal/useIsomorphicEffect.js +1 -1
- package/lib/internal/useMergedRefs.js +3 -3
- package/lib/internal/useNoInteractiveChildren.js +8 -19
- package/lib/internal/useNormalizedInputProps.js +16 -14
- package/lib/internal/usePrefix.js +1 -1
- package/lib/internal/useSavedCallback.js +3 -3
- package/lib/internal/warning.js +4 -4
- package/lib/internal/wrapFocus.js +16 -21
- package/lib/prop-types/AriaPropTypes.js +1 -1
- package/lib/prop-types/deprecate.js +6 -5
- package/lib/prop-types/isRequiredOneOf.js +15 -28
- package/lib/prop-types/requiredIfGivenPropIsTruthy.js +2 -2
- package/lib/prop-types/types.js +1 -1
- package/lib/tools/array.js +1 -1
- package/lib/tools/events.js +21 -14
- package/lib/tools/mergeRefs.js +3 -3
- package/lib/tools/setupGetInstanceId.js +1 -1
- package/lib/tools/uniqueId.js +3 -3
- package/lib/tools/wrapComponent.js +14 -13
- package/package.json +9 -9
|
@@ -5,21 +5,20 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import React__default from 'react';
|
|
11
11
|
import cx from 'classnames';
|
|
12
12
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var classNames = cx("".concat(prefix, "--form"), className);
|
|
14
|
+
const Form = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
className,
|
|
17
|
+
children,
|
|
18
|
+
...other
|
|
19
|
+
} = _ref;
|
|
20
|
+
const prefix = usePrefix();
|
|
21
|
+
const classNames = cx(`${prefix}--form`, className);
|
|
23
22
|
return /*#__PURE__*/React__default.createElement("form", _extends({
|
|
24
23
|
className: classNames
|
|
25
24
|
}, other), children);
|
|
@@ -5,26 +5,25 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import React__default from 'react';
|
|
11
11
|
import cx from 'classnames';
|
|
12
12
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
var classNamesFieldset = cx("".concat(prefix, "--fieldset"), className);
|
|
14
|
+
const FormGroup = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
legendId,
|
|
17
|
+
legendText,
|
|
18
|
+
invalid,
|
|
19
|
+
children,
|
|
20
|
+
className,
|
|
21
|
+
message,
|
|
22
|
+
messageText,
|
|
23
|
+
...rest
|
|
24
|
+
} = _ref;
|
|
25
|
+
const prefix = usePrefix();
|
|
26
|
+
const classNamesFieldset = cx(`${prefix}--fieldset`, className);
|
|
28
27
|
return /*#__PURE__*/React__default.createElement("fieldset", _extends({}, invalid && {
|
|
29
28
|
'data-invalid': ''
|
|
30
29
|
}, {
|
|
@@ -32,10 +31,10 @@ var FormGroup = function FormGroup(_ref) {
|
|
|
32
31
|
}, rest, {
|
|
33
32
|
"aria-labelledby": rest['aria-labelledby'] || legendId
|
|
34
33
|
}), /*#__PURE__*/React__default.createElement("legend", {
|
|
35
|
-
className:
|
|
34
|
+
className: `${prefix}--label`,
|
|
36
35
|
id: legendId || rest['aria-labelledby']
|
|
37
36
|
}, legendText), children, message ? /*#__PURE__*/React__default.createElement("div", {
|
|
38
|
-
className:
|
|
37
|
+
className: `${prefix}--form__requirements`
|
|
39
38
|
}, messageText) : null);
|
|
40
39
|
};
|
|
41
40
|
|
|
@@ -5,21 +5,20 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import React__default from 'react';
|
|
11
11
|
import cx from 'classnames';
|
|
12
12
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
13
|
|
|
14
|
-
var _excluded = ["className", "children"];
|
|
15
|
-
|
|
16
14
|
function FormItem(_ref) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
let {
|
|
16
|
+
className,
|
|
17
|
+
children,
|
|
18
|
+
...rest
|
|
19
|
+
} = _ref;
|
|
20
|
+
const prefix = usePrefix();
|
|
21
|
+
const classNames = cx(`${prefix}--form-item`, className);
|
|
23
22
|
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
24
23
|
className: classNames
|
|
25
24
|
}, rest), children);
|
|
@@ -5,23 +5,24 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import React__default from 'react';
|
|
11
11
|
import cx from 'classnames';
|
|
12
12
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
13
|
import * as FeatureFlags from '@carbon/feature-flags';
|
|
14
14
|
|
|
15
|
-
var _excluded = ["className", "children", "id"];
|
|
16
|
-
|
|
17
15
|
function FormLabel(_ref) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
let {
|
|
17
|
+
className: customClassName,
|
|
18
|
+
children,
|
|
19
|
+
id,
|
|
20
|
+
...rest
|
|
21
|
+
} = _ref;
|
|
22
|
+
const prefix = usePrefix();
|
|
23
|
+
const className = cx(`${prefix}--label`, {
|
|
24
|
+
[`${prefix}--label--no-margin`]: FeatureFlags.enabled('enable-v11-release')
|
|
25
|
+
}, customClassName);
|
|
25
26
|
return /*#__PURE__*/React__default.createElement("label", _extends({
|
|
26
27
|
htmlFor: id,
|
|
27
28
|
className: className
|
|
@@ -5,37 +5,28 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import cx from 'classnames';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import React__default from 'react';
|
|
12
12
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
13
|
import { useGridSettings, GridSettings } from './GridContext.js';
|
|
14
14
|
|
|
15
|
-
var _excluded = ["as", "children", "className", "condensed", "fullWidth", "narrow"],
|
|
16
|
-
_excluded2 = ["as", "className", "children", "mode"];
|
|
17
|
-
|
|
18
15
|
function CSSGrid(_ref) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
var prefix = usePrefix();
|
|
34
|
-
|
|
35
|
-
var _useGridSettings = useGridSettings(),
|
|
36
|
-
subgrid = _useGridSettings.subgrid;
|
|
37
|
-
|
|
38
|
-
var mode = 'wide';
|
|
16
|
+
let {
|
|
17
|
+
as: BaseComponent = 'div',
|
|
18
|
+
children,
|
|
19
|
+
className: customClassName,
|
|
20
|
+
condensed = false,
|
|
21
|
+
fullWidth = false,
|
|
22
|
+
narrow = false,
|
|
23
|
+
...rest
|
|
24
|
+
} = _ref;
|
|
25
|
+
const prefix = usePrefix();
|
|
26
|
+
const {
|
|
27
|
+
subgrid
|
|
28
|
+
} = useGridSettings();
|
|
29
|
+
let mode = 'wide';
|
|
39
30
|
|
|
40
31
|
if (narrow) {
|
|
41
32
|
mode = 'narrow';
|
|
@@ -54,9 +45,14 @@ function CSSGrid(_ref) {
|
|
|
54
45
|
}, rest), children));
|
|
55
46
|
}
|
|
56
47
|
|
|
57
|
-
|
|
48
|
+
const className = cx(customClassName, {
|
|
49
|
+
[`${prefix}--css-grid`]: true,
|
|
50
|
+
[`${prefix}--css-grid--condensed`]: mode === 'condensed',
|
|
51
|
+
[`${prefix}--css-grid--narrow`]: mode === 'narrow',
|
|
52
|
+
[`${prefix}--css-grid--full-width`]: fullWidth
|
|
53
|
+
}); // cast as any to let TypeScript allow passing in attributes to base component
|
|
58
54
|
|
|
59
|
-
|
|
55
|
+
const BaseComponentAsAny = BaseComponent;
|
|
60
56
|
return /*#__PURE__*/React__default.createElement(GridSettings, {
|
|
61
57
|
mode: "css-grid",
|
|
62
58
|
subgrid: true
|
|
@@ -99,18 +95,21 @@ CSSGrid.propTypes = {
|
|
|
99
95
|
narrow: PropTypes.bool
|
|
100
96
|
};
|
|
101
97
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
98
|
+
const Subgrid = _ref2 => {
|
|
99
|
+
let {
|
|
100
|
+
as: BaseComponent = 'div',
|
|
101
|
+
className: customClassName,
|
|
102
|
+
children,
|
|
103
|
+
mode,
|
|
104
|
+
...rest
|
|
105
|
+
} = _ref2;
|
|
106
|
+
const prefix = usePrefix();
|
|
107
|
+
const className = cx(customClassName, {
|
|
108
|
+
[`${prefix}--subgrid`]: true,
|
|
109
|
+
[`${prefix}--subgrid--condensed`]: mode === 'condensed',
|
|
110
|
+
[`${prefix}--subgrid--narrow`]: mode === 'narrow',
|
|
111
|
+
[`${prefix}--subgrid--wide`]: mode === 'wide'
|
|
112
|
+
});
|
|
114
113
|
return /*#__PURE__*/React__default.createElement(BaseComponent, _extends({}, rest, {
|
|
115
114
|
className: className
|
|
116
115
|
}), children);
|
|
@@ -137,6 +136,6 @@ Subgrid.propTypes = {
|
|
|
137
136
|
*/
|
|
138
137
|
mode: PropTypes.oneOf(['wide', 'narrow', 'condensed'])
|
|
139
138
|
};
|
|
140
|
-
|
|
139
|
+
const CSSGridComponent = CSSGrid;
|
|
141
140
|
|
|
142
141
|
export { CSSGridComponent as CSSGrid };
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import * as FeatureFlags from '@carbon/feature-flags';
|
|
10
10
|
import cx from 'classnames';
|
|
11
11
|
import PropTypes from 'prop-types';
|
|
@@ -13,25 +13,22 @@ import React__default from 'react';
|
|
|
13
13
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
14
14
|
import { useGridSettings } from './GridContext.js';
|
|
15
15
|
|
|
16
|
-
var _excluded = ["as", "children", "className", "sm", "md", "lg", "xlg", "max"],
|
|
17
|
-
_excluded2 = ["as", "children", "className", "sm", "md", "lg", "xlg", "max", "span"];
|
|
18
|
-
|
|
19
16
|
function Column(_ref) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
17
|
+
let {
|
|
18
|
+
as: BaseComponent = 'div',
|
|
19
|
+
children,
|
|
20
|
+
className: customClassName,
|
|
21
|
+
sm,
|
|
22
|
+
md,
|
|
23
|
+
lg,
|
|
24
|
+
xlg,
|
|
25
|
+
max,
|
|
26
|
+
...rest
|
|
27
|
+
} = _ref;
|
|
28
|
+
const {
|
|
29
|
+
mode
|
|
30
|
+
} = useGridSettings();
|
|
31
|
+
const prefix = usePrefix();
|
|
35
32
|
|
|
36
33
|
if (mode === 'css-grid') {
|
|
37
34
|
return /*#__PURE__*/React__default.createElement(CSSGridColumn, _extends({
|
|
@@ -45,17 +42,19 @@ function Column(_ref) {
|
|
|
45
42
|
}, rest), children);
|
|
46
43
|
}
|
|
47
44
|
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
const columnClassName = getClassNameForFlexGridBreakpoints([sm, md, lg, xlg, max], prefix);
|
|
46
|
+
const className = cx(customClassName, columnClassName, {
|
|
47
|
+
[`${prefix}--col`]: columnClassName.length === 0
|
|
48
|
+
}); // cast as any to let TypeScript allow passing in attributes to base component
|
|
50
49
|
|
|
51
|
-
|
|
50
|
+
const BaseComponentAsAny = BaseComponent;
|
|
52
51
|
return /*#__PURE__*/React__default.createElement(BaseComponentAsAny, _extends({
|
|
53
52
|
className: className
|
|
54
53
|
}, rest), children);
|
|
55
54
|
}
|
|
56
55
|
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
const percentSpanType = PropTypes.oneOf(['25%', '50%', '75%', '100%']);
|
|
57
|
+
const spanPropType = FeatureFlags.enabled('enable-css-grid') ? PropTypes.oneOfType([PropTypes.bool, PropTypes.number, PropTypes.shape({
|
|
59
58
|
span: PropTypes.oneOfType([PropTypes.number, percentSpanType]),
|
|
60
59
|
offset: PropTypes.number,
|
|
61
60
|
start: PropTypes.number,
|
|
@@ -122,22 +121,24 @@ Column.propTypes = {
|
|
|
122
121
|
};
|
|
123
122
|
|
|
124
123
|
function CSSGridColumn(_ref2) {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
124
|
+
let {
|
|
125
|
+
as: BaseComponent = 'div',
|
|
126
|
+
children,
|
|
127
|
+
className: containerClassName,
|
|
128
|
+
sm,
|
|
129
|
+
md,
|
|
130
|
+
lg,
|
|
131
|
+
xlg,
|
|
132
|
+
max,
|
|
133
|
+
span,
|
|
134
|
+
...rest
|
|
135
|
+
} = _ref2;
|
|
136
|
+
const prefix = usePrefix();
|
|
137
|
+
const breakpointClassName = getClassNameForBreakpoints([sm, md, lg, xlg, max], prefix);
|
|
138
|
+
const spanClassName = getClassNameForSpan(span, prefix);
|
|
139
|
+
const className = cx(containerClassName, breakpointClassName, spanClassName, {
|
|
140
|
+
[`${prefix}--css-grid-column`]: true
|
|
141
|
+
});
|
|
141
142
|
return /*#__PURE__*/React__default.createElement(BaseComponent, _extends({
|
|
142
143
|
className: className
|
|
143
144
|
}, rest), children);
|
|
@@ -209,7 +210,7 @@ CSSGridColumn.propTypes = {
|
|
|
209
210
|
*/
|
|
210
211
|
xlg: spanPropType
|
|
211
212
|
};
|
|
212
|
-
|
|
213
|
+
const breakpointNames = ['sm', 'md', 'lg', 'xlg', 'max'];
|
|
213
214
|
/**
|
|
214
215
|
* @typedef {object} Breakpoint
|
|
215
216
|
* @property {boolean|number} [span]
|
|
@@ -223,59 +224,61 @@ var breakpointNames = ['sm', 'md', 'lg', 'xlg', 'max'];
|
|
|
223
224
|
*/
|
|
224
225
|
|
|
225
226
|
function getClassNameForBreakpoints(breakpoints, prefix) {
|
|
226
|
-
|
|
227
|
+
const classNames = [];
|
|
227
228
|
|
|
228
|
-
for (
|
|
229
|
-
|
|
229
|
+
for (let i = 0; i < breakpoints.length; i++) {
|
|
230
|
+
const breakpoint = breakpoints[i];
|
|
230
231
|
|
|
231
232
|
if (breakpoint === undefined || breakpoint === null) {
|
|
232
233
|
continue;
|
|
233
234
|
}
|
|
234
235
|
|
|
235
|
-
|
|
236
|
+
const name = breakpointNames[i]; // If our breakpoint is a boolean, the user has specified that the column
|
|
236
237
|
// should be "auto" at this size
|
|
237
238
|
|
|
238
239
|
if (breakpoint === true) {
|
|
239
|
-
classNames.push(
|
|
240
|
+
classNames.push(`${prefix}--${name}:col-span-auto`);
|
|
240
241
|
continue;
|
|
241
242
|
} // If our breakpoint is a string, the user has specified a percent
|
|
242
243
|
// they'd like this column to span.
|
|
243
244
|
|
|
244
245
|
|
|
245
246
|
if (typeof breakpoint === 'string') {
|
|
246
|
-
classNames.push(
|
|
247
|
+
classNames.push(`${prefix}--${name}:col-span-${breakpoint.slice(0, -1)}`);
|
|
247
248
|
continue;
|
|
248
249
|
} // If our breakpoint is a number, the user has specified the number of
|
|
249
250
|
// columns they'd like this column to span
|
|
250
251
|
|
|
251
252
|
|
|
252
253
|
if (typeof breakpoint === 'number') {
|
|
253
|
-
classNames.push(
|
|
254
|
+
classNames.push(`${prefix}--${name}:col-span-${breakpoint}`);
|
|
254
255
|
continue;
|
|
255
256
|
}
|
|
256
257
|
|
|
257
|
-
if (
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
258
|
+
if (typeof breakpoint === 'object') {
|
|
259
|
+
const {
|
|
260
|
+
span,
|
|
261
|
+
offset,
|
|
262
|
+
start,
|
|
263
|
+
end
|
|
264
|
+
} = breakpoint;
|
|
262
265
|
|
|
263
266
|
if (typeof offset === 'number' && offset > 0) {
|
|
264
|
-
classNames.push(
|
|
267
|
+
classNames.push(`${prefix}--${name}:col-start-${offset + 1}`);
|
|
265
268
|
}
|
|
266
269
|
|
|
267
270
|
if (typeof start === 'number') {
|
|
268
|
-
classNames.push(
|
|
271
|
+
classNames.push(`${prefix}--${name}:col-start-${start}`);
|
|
269
272
|
}
|
|
270
273
|
|
|
271
274
|
if (typeof end === 'number') {
|
|
272
|
-
classNames.push(
|
|
275
|
+
classNames.push(`${prefix}--${name}:col-end-${end}`);
|
|
273
276
|
}
|
|
274
277
|
|
|
275
278
|
if (typeof span === 'number') {
|
|
276
|
-
classNames.push(
|
|
279
|
+
classNames.push(`${prefix}--${name}:col-span-${span}`);
|
|
277
280
|
} else if (typeof span === 'string') {
|
|
278
|
-
classNames.push(
|
|
281
|
+
classNames.push(`${prefix}--${name}:col-span-${span.slice(0, -1)}`);
|
|
279
282
|
continue;
|
|
280
283
|
}
|
|
281
284
|
}
|
|
@@ -291,44 +294,46 @@ function getClassNameForBreakpoints(breakpoints, prefix) {
|
|
|
291
294
|
|
|
292
295
|
|
|
293
296
|
function getClassNameForFlexGridBreakpoints(breakpoints, prefix) {
|
|
294
|
-
|
|
297
|
+
const classNames = [];
|
|
295
298
|
|
|
296
|
-
for (
|
|
297
|
-
|
|
299
|
+
for (let i = 0; i < breakpoints.length; i++) {
|
|
300
|
+
const breakpoint = breakpoints[i];
|
|
298
301
|
|
|
299
302
|
if (breakpoint === undefined || breakpoint === null) {
|
|
300
303
|
continue;
|
|
301
304
|
}
|
|
302
305
|
|
|
303
|
-
|
|
306
|
+
const name = breakpointNames[i]; // If our breakpoint is a boolean, the user has specified that the column
|
|
304
307
|
// should be "auto" at this size
|
|
305
308
|
|
|
306
309
|
if (breakpoint === true) {
|
|
307
|
-
classNames.push(
|
|
310
|
+
classNames.push(`${prefix}--col-${name}`);
|
|
308
311
|
continue;
|
|
309
312
|
} // If our breakpoint is a number, the user has specified the number of
|
|
310
313
|
// columns they'd like this column to span
|
|
311
314
|
|
|
312
315
|
|
|
313
316
|
if (typeof breakpoint === 'number') {
|
|
314
|
-
classNames.push(
|
|
317
|
+
classNames.push(`${prefix}--col-${name}-${breakpoint}`);
|
|
315
318
|
continue;
|
|
316
319
|
}
|
|
317
320
|
|
|
318
|
-
if (
|
|
319
|
-
|
|
320
|
-
|
|
321
|
+
if (typeof breakpoint === 'object') {
|
|
322
|
+
const {
|
|
323
|
+
span,
|
|
324
|
+
offset
|
|
325
|
+
} = breakpoint;
|
|
321
326
|
|
|
322
327
|
if (typeof span === 'number') {
|
|
323
|
-
classNames.push(
|
|
328
|
+
classNames.push(`${prefix}--col-${name}-${span}`);
|
|
324
329
|
}
|
|
325
330
|
|
|
326
331
|
if (span === true) {
|
|
327
|
-
classNames.push(
|
|
332
|
+
classNames.push(`${prefix}--col-${name}`);
|
|
328
333
|
}
|
|
329
334
|
|
|
330
335
|
if (typeof offset === 'number') {
|
|
331
|
-
classNames.push(
|
|
336
|
+
classNames.push(`${prefix}--offset-${name}-${offset}`);
|
|
332
337
|
}
|
|
333
338
|
}
|
|
334
339
|
}
|
|
@@ -341,25 +346,27 @@ function getClassNameForFlexGridBreakpoints(breakpoints, prefix) {
|
|
|
341
346
|
|
|
342
347
|
|
|
343
348
|
function getClassNameForSpan(value, prefix) {
|
|
344
|
-
|
|
349
|
+
const classNames = [];
|
|
345
350
|
|
|
346
351
|
if (typeof value === 'number' || typeof value === 'string') {
|
|
347
|
-
classNames.push(
|
|
348
|
-
} else if (
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
+
classNames.push(`${prefix}--col-span-${value}`);
|
|
353
|
+
} else if (typeof value === 'object') {
|
|
354
|
+
const {
|
|
355
|
+
span,
|
|
356
|
+
start,
|
|
357
|
+
end
|
|
358
|
+
} = value;
|
|
352
359
|
|
|
353
360
|
if (span !== undefined && span !== null) {
|
|
354
|
-
classNames.push(
|
|
361
|
+
classNames.push(`${prefix}--col-span-${span}`);
|
|
355
362
|
}
|
|
356
363
|
|
|
357
364
|
if (start !== undefined && start !== null) {
|
|
358
|
-
classNames.push(
|
|
365
|
+
classNames.push(`${prefix}--col-start-${start}`);
|
|
359
366
|
}
|
|
360
367
|
|
|
361
368
|
if (end !== undefined && end !== null) {
|
|
362
|
-
classNames.push(
|
|
369
|
+
classNames.push(`${prefix}--col-end-${end}`);
|
|
363
370
|
}
|
|
364
371
|
}
|
|
365
372
|
|
|
@@ -5,29 +5,27 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import cx from 'classnames';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import React__default from 'react';
|
|
12
12
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
13
|
|
|
14
|
-
var _excluded = ["as", "className", "children"];
|
|
15
|
-
|
|
16
14
|
/**
|
|
17
15
|
* Helper component for rendering content that hangs on the column. Useful when
|
|
18
16
|
* trying to align content across different grid modes
|
|
19
17
|
*/
|
|
20
18
|
function ColumnHang(_ref) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
19
|
+
let {
|
|
20
|
+
as: BaseComponent = 'div',
|
|
21
|
+
className: customClassName,
|
|
22
|
+
children,
|
|
23
|
+
...rest
|
|
24
|
+
} = _ref;
|
|
25
|
+
const prefix = usePrefix();
|
|
26
|
+
const className = cx(customClassName, `${prefix}--grid-column-hang`); // cast as any to let TypeScript allow passing in attributes to base component
|
|
27
|
+
|
|
28
|
+
const BaseComponentAsAny = BaseComponent;
|
|
31
29
|
return /*#__PURE__*/React__default.createElement(BaseComponentAsAny, _extends({}, rest, {
|
|
32
30
|
className: className
|
|
33
31
|
}), children);
|
|
@@ -49,6 +47,6 @@ ColumnHang.propTypes = {
|
|
|
49
47
|
*/
|
|
50
48
|
className: PropTypes.string
|
|
51
49
|
};
|
|
52
|
-
|
|
50
|
+
const ColumnHangComponent = ColumnHang;
|
|
53
51
|
|
|
54
52
|
export { ColumnHangComponent as ColumnHang };
|