@carbon/react 1.87.0-rc.0 → 1.87.1-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/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +739 -739
- package/es/_virtual/_rollupPluginBabelHelpers.js +4 -4
- package/es/components/Button/Button.js +1 -1
- package/es/components/Button/index.js +5 -1
- package/es/components/ButtonSet/index.js +4 -1
- package/es/components/Checkbox/index.js +4 -1
- package/es/components/ComboBox/ComboBox.js +1 -1
- package/es/components/ComboBox/index.js +4 -1
- package/es/components/ComposedModal/ComposedModal.js +18 -8
- package/es/components/ContainedList/ContainedListItem/index.js +4 -1
- package/es/components/ContainedList/index.js +2 -2
- package/es/components/Copy/Copy.js +1 -1
- package/es/components/Copy/index.js +4 -1
- package/es/components/CopyButton/index.js +4 -1
- package/es/components/DataTable/Table.js +1 -1
- package/es/components/DataTable/state/getDerivedStateFromProps.d.ts +19 -0
- package/es/components/DataTable/state/getDerivedStateFromProps.js +1 -2
- package/es/components/DataTable/state/sorting.d.ts +15 -0
- package/es/components/DataTable/state/sorting.js +1 -2
- package/es/components/DataTable/tools/denormalize.d.ts +22 -0
- package/es/components/DataTable/tools/denormalize.js +1 -2
- package/es/components/DataTable/tools/normalize.d.ts +9 -0
- package/es/components/DataTable/tools/normalize.js +1 -2
- package/es/components/DatePicker/DatePicker.js +18 -11
- package/es/components/DatePicker/index.js +4 -1
- package/es/components/DatePicker/plugins/fixEventsPlugin.d.ts +2 -0
- package/es/components/DatePicker/plugins/rangePlugin.d.ts +2 -0
- package/es/components/DatePickerInput/DatePickerInput.js +6 -0
- package/es/components/DatePickerInput/index.js +4 -1
- package/es/components/Dialog/index.js +2 -2
- package/es/components/Dropdown/Dropdown.js +2 -2
- package/es/components/Dropdown/index.js +4 -1
- package/es/components/FeatureFlags/index.js +2 -2
- package/es/components/FluidSelect/index.js +4 -1
- package/es/components/FluidTextInput/index.js +4 -1
- package/es/components/IconIndicator/index.js +1 -1
- package/es/components/InlineCheckbox/index.js +4 -1
- package/es/components/InlineLoading/index.js +4 -1
- package/es/components/LayoutDirection/LayoutDirection.js +1 -2
- package/es/components/Link/index.js +4 -1
- package/es/components/ListBox/ListBox.js +1 -1
- package/es/components/Loading/index.js +4 -1
- package/es/components/Menu/Menu.d.ts +3 -1
- package/es/components/Menu/Menu.js +3 -1
- package/es/components/Menu/MenuItem.js +1 -1
- package/es/components/Modal/Modal.js +16 -5
- package/es/components/Modal/index.js +4 -1
- package/es/components/MultiSelect/FilterableMultiSelect.js +3 -3
- package/es/components/MultiSelect/MultiSelect.js +2 -2
- package/es/components/MultiSelect/filter.js +0 -4
- package/es/components/MultiSelect/tools/itemToString.d.ts +1 -0
- package/es/components/MultiSelect/tools/sorting.d.ts +9 -0
- package/es/components/Notification/Notification.js +2 -2
- package/es/components/NumberInput/NumberInput.js +1 -1
- package/es/components/OverflowMenu/next/index.js +1 -1
- package/es/components/OverflowMenuItem/index.js +4 -1
- package/es/components/OverflowMenuV2/index.d.ts +1 -0
- package/es/components/PageHeader/PageHeader.js +1 -1
- package/es/components/Pagination/experimental/PageSelector.d.ts +19 -0
- package/es/components/Pagination/experimental/Pagination.d.ts +43 -0
- package/es/components/Pagination/experimental/index.d.ts +3 -0
- package/es/components/Popover/index.js +21 -4
- package/es/components/RadioButton/index.js +4 -1
- package/es/components/RadioTile/index.js +4 -1
- package/es/components/Search/Search.js +1 -1
- package/es/components/Search/index.js +4 -1
- package/es/components/Select/index.js +4 -1
- package/es/components/SelectItem/index.js +4 -1
- package/es/components/ShapeIndicator/index.js +1 -1
- package/es/components/SkeletonText/index.js +4 -1
- package/es/components/Slider/Slider.js +1 -1
- package/es/components/Switch/IconSwitch.d.ts +3 -0
- package/es/components/Switch/IconSwitch.js +1 -2
- package/es/components/TabContent/TabContent.js +2 -22
- package/es/components/Tabs/Tabs.js +5 -5
- package/es/components/Tag/DismissibleTag.js +1 -1
- package/es/components/TextArea/TextArea.js +1 -1
- package/es/components/TextArea/index.js +4 -1
- package/es/components/TextInput/index.js +4 -1
- package/es/components/TextInput/util.d.ts +9 -0
- package/es/components/Toggletip/index.js +2 -2
- package/es/components/UIShell/HeaderMenu.js +2 -2
- package/es/components/UIShell/SideNav.js +1 -1
- package/es/components/UIShell/_utils.d.ts +7 -0
- package/es/feature-flags.d.ts +1 -0
- package/es/internal/FloatingMenu.js +1 -1
- package/es/internal/deprecateFieldOnObject.js +1 -1
- package/es/internal/useId.d.ts +21 -0
- package/es/internal/useId.js +27 -1
- package/es/internal/useOverflowItems.js +0 -6
- package/es/node_modules/es-toolkit/dist/compat/function/{debounce.mjs.js → debounce.js} +1 -1
- package/es/node_modules/es-toolkit/dist/compat/function/{throttle.mjs.js → throttle.js} +1 -1
- package/es/prop-types/deprecateComponent.d.ts +1 -0
- package/es/prop-types/deprecateComponent.js +1 -4
- package/es/prop-types/deprecateValuesWithin.d.ts +1 -0
- package/es/prop-types/requiredIfGivenPropIsTruthy.d.ts +14 -0
- package/es/tools/mergeRefs.d.ts +12 -0
- package/es/tools/mergeRefs.js +1 -2
- package/icons/index.js +1 -3
- package/lib/_virtual/_rollupPluginBabelHelpers.js +5 -7
- package/lib/components/AILabel/index.js +35 -43
- package/lib/components/AISkeleton/AISkeletonIcon.js +5 -11
- package/lib/components/AISkeleton/AISkeletonPlaceholder.js +4 -10
- package/lib/components/AISkeleton/AISkeletonText.js +8 -14
- package/lib/components/Accordion/Accordion.Skeleton.js +21 -27
- package/lib/components/Accordion/Accordion.js +11 -17
- package/lib/components/Accordion/AccordionItem.js +19 -25
- package/lib/components/Accordion/AccordionProvider.js +1 -7
- package/lib/components/AspectRatio/AspectRatio.js +7 -13
- package/lib/components/BadgeIndicator/index.js +7 -13
- package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +7 -13
- package/lib/components/Breadcrumb/Breadcrumb.js +9 -15
- package/lib/components/Breadcrumb/BreadcrumbItem.js +16 -22
- package/lib/components/Button/Button.Skeleton.js +8 -14
- package/lib/components/Button/Button.js +31 -36
- package/lib/components/Button/ButtonBase.js +6 -11
- package/lib/components/Button/index.js +3 -3
- package/lib/components/ButtonSet/ButtonSet.js +6 -12
- package/lib/components/ButtonSet/index.js +2 -2
- package/lib/components/ChatButton/ChatButton.Skeleton.js +5 -11
- package/lib/components/ChatButton/ChatButton.js +12 -18
- package/lib/components/Checkbox/Checkbox.Skeleton.js +6 -12
- package/lib/components/Checkbox/Checkbox.js +33 -39
- package/lib/components/Checkbox/index.js +3 -3
- package/lib/components/CheckboxGroup/CheckboxGroup.js +24 -30
- package/lib/components/ClassPrefix/index.js +3 -10
- package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +10 -16
- package/lib/components/CodeSnippet/CodeSnippet.js +39 -46
- package/lib/components/ComboBox/ComboBox.js +57 -64
- package/lib/components/ComboBox/index.js +2 -2
- package/lib/components/ComboButton/index.js +20 -28
- package/lib/components/ComposedModal/ComposedModal.js +61 -57
- package/lib/components/ComposedModal/ModalFooter.js +37 -45
- package/lib/components/ComposedModal/ModalHeader.js +23 -31
- package/lib/components/ContainedList/ContainedList.js +18 -24
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +14 -20
- package/lib/components/ContainedList/ContainedListItem/index.js +2 -2
- package/lib/components/ContainedList/index.js +5 -5
- package/lib/components/ContentSwitcher/ContentSwitcher.js +11 -19
- package/lib/components/ContextMenu/useContextMenu.js +1 -1
- package/lib/components/Copy/Copy.js +12 -18
- package/lib/components/Copy/index.js +2 -2
- package/lib/components/CopyButton/CopyButton.js +12 -18
- package/lib/components/CopyButton/index.js +2 -2
- package/lib/components/DangerButton/DangerButton.js +2 -6
- package/lib/components/DataTable/DataTable.js +48 -55
- package/lib/components/DataTable/Table.js +18 -24
- package/lib/components/DataTable/TableActionList.js +2 -2
- package/lib/components/DataTable/TableBatchAction.js +4 -9
- package/lib/components/DataTable/TableBatchActions.js +19 -25
- package/lib/components/DataTable/TableBody.js +5 -10
- package/lib/components/DataTable/TableCell.js +8 -14
- package/lib/components/DataTable/TableContainer.js +14 -20
- package/lib/components/DataTable/TableContext.js +0 -2
- package/lib/components/DataTable/TableDecoratorRow.js +5 -11
- package/lib/components/DataTable/TableExpandHeader.js +16 -22
- package/lib/components/DataTable/TableExpandRow.js +20 -26
- package/lib/components/DataTable/TableExpandedRow.js +8 -14
- package/lib/components/DataTable/TableHead.js +2 -2
- package/lib/components/DataTable/TableHeader.js +26 -32
- package/lib/components/DataTable/TableRow.js +8 -14
- package/lib/components/DataTable/TableSelectAll.js +13 -19
- package/lib/components/DataTable/TableSelectRow.js +15 -21
- package/lib/components/DataTable/TableSlugRow.js +7 -13
- package/lib/components/DataTable/TableToolbar.js +7 -13
- package/lib/components/DataTable/TableToolbarAction.js +5 -10
- package/lib/components/DataTable/TableToolbarContent.js +2 -2
- package/lib/components/DataTable/TableToolbarMenu.js +9 -15
- package/lib/components/DataTable/TableToolbarSearch.js +22 -28
- package/lib/components/DataTable/state/getDerivedStateFromProps.d.ts +19 -0
- package/lib/components/DataTable/state/getDerivedStateFromProps.js +2 -3
- package/lib/components/DataTable/state/sortStates.js +0 -2
- package/lib/components/DataTable/state/sorting.d.ts +15 -0
- package/lib/components/DataTable/state/sorting.js +0 -2
- package/lib/components/DataTable/tools/cells.js +0 -2
- package/lib/components/DataTable/tools/denormalize.d.ts +22 -0
- package/lib/components/DataTable/tools/denormalize.js +1 -2
- package/lib/components/DataTable/tools/filter.js +0 -2
- package/lib/components/DataTable/tools/normalize.d.ts +9 -0
- package/lib/components/DataTable/tools/normalize.js +1 -2
- package/lib/components/DataTable/tools/sorting.js +0 -2
- package/lib/components/DataTableSkeleton/DataTableSkeleton.js +25 -31
- package/lib/components/DatePicker/DatePicker.Skeleton.js +14 -20
- package/lib/components/DatePicker/DatePicker.js +65 -66
- package/lib/components/DatePicker/index.js +3 -3
- package/lib/components/DatePicker/plugins/appendToPlugin.js +0 -2
- package/lib/components/DatePicker/plugins/fixEventsPlugin.d.ts +2 -0
- package/lib/components/DatePicker/plugins/fixEventsPlugin.js +1 -1
- package/lib/components/DatePicker/plugins/rangePlugin.d.ts +2 -0
- package/lib/components/DatePicker/plugins/rangePlugin.js +2 -6
- package/lib/components/DatePickerInput/DatePickerInput.js +49 -49
- package/lib/components/DatePickerInput/index.js +2 -2
- package/lib/components/Dialog/index.js +72 -80
- package/lib/components/Dropdown/Dropdown.Skeleton.js +8 -14
- package/lib/components/Dropdown/Dropdown.js +49 -55
- package/lib/components/Dropdown/index.js +3 -3
- package/lib/components/ErrorBoundary/ErrorBoundary.js +4 -9
- package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +0 -2
- package/lib/components/ExpandableSearch/ExpandableSearch.js +6 -11
- package/lib/components/FeatureFlags/index.js +10 -17
- package/lib/components/FileUploader/FileUploader.Skeleton.js +7 -13
- package/lib/components/FileUploader/FileUploader.js +30 -36
- package/lib/components/FileUploader/FileUploaderButton.js +19 -25
- package/lib/components/FileUploader/FileUploaderDropContainer.js +18 -24
- package/lib/components/FileUploader/FileUploaderItem.js +23 -29
- package/lib/components/FileUploader/Filename.js +13 -18
- package/lib/components/FluidComboBox/FluidComboBox.Skeleton.js +7 -13
- package/lib/components/FluidComboBox/FluidComboBox.js +24 -30
- package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.js +14 -20
- package/lib/components/FluidDatePicker/FluidDatePicker.js +12 -18
- package/lib/components/FluidDatePickerInput/FluidDatePickerInput.js +4 -8
- package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +7 -13
- package/lib/components/FluidDropdown/FluidDropdown.js +24 -30
- package/lib/components/FluidForm/FluidForm.js +6 -12
- package/lib/components/FluidForm/FormContext.js +0 -2
- package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +7 -13
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +36 -42
- package/lib/components/FluidNumberInput/FluidNumberInput.Skeleton.js +7 -13
- package/lib/components/FluidNumberInput/FluidNumberInput.js +30 -36
- package/lib/components/FluidSearch/FluidSearch.Skeleton.js +7 -13
- package/lib/components/FluidSearch/FluidSearch.js +19 -25
- package/lib/components/FluidSelect/FluidSelect.Skeleton.js +7 -13
- package/lib/components/FluidSelect/FluidSelect.js +17 -23
- package/lib/components/FluidSelect/index.js +3 -3
- package/lib/components/FluidTextArea/FluidTextArea.Skeleton.js +7 -13
- package/lib/components/FluidTextArea/FluidTextArea.js +25 -31
- package/lib/components/FluidTextInput/FluidPasswordInput.js +18 -22
- package/lib/components/FluidTextInput/FluidTextInput.Skeleton.js +7 -13
- package/lib/components/FluidTextInput/FluidTextInput.js +23 -29
- package/lib/components/FluidTextInput/index.js +3 -3
- package/lib/components/FluidTimePicker/FluidTimePicker.Skeleton.js +6 -12
- package/lib/components/FluidTimePicker/FluidTimePicker.js +23 -29
- package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +10 -15
- package/lib/components/Form/Form.js +5 -11
- package/lib/components/FormGroup/FormGroup.js +13 -19
- package/lib/components/FormItem/FormItem.js +5 -11
- package/lib/components/FormLabel/FormLabel.js +6 -12
- package/lib/components/Grid/CSSGrid.js +20 -28
- package/lib/components/Grid/Column.js +31 -37
- package/lib/components/Grid/ColumnHang.js +5 -13
- package/lib/components/Grid/FlexGrid.js +10 -18
- package/lib/components/Grid/Grid.js +9 -16
- package/lib/components/Grid/GridContext.js +7 -14
- package/lib/components/Grid/Row.js +8 -14
- package/lib/components/Heading/index.js +14 -21
- package/lib/components/Icon/Icon.Skeleton.js +4 -10
- package/lib/components/IconButton/index.js +25 -33
- package/lib/components/IconIndicator/index.js +9 -15
- package/lib/components/IdPrefix/index.js +3 -10
- package/lib/components/InlineCheckbox/InlineCheckbox.js +17 -22
- package/lib/components/InlineCheckbox/index.js +2 -2
- package/lib/components/InlineLoading/InlineLoading.js +17 -23
- package/lib/components/InlineLoading/index.js +2 -2
- package/lib/components/Layer/LayerContext.js +1 -7
- package/lib/components/Layer/LayerLevel.js +0 -2
- package/lib/components/Layer/index.js +11 -19
- package/lib/components/Layout/index.js +22 -30
- package/lib/components/LayoutDirection/LayoutDirection.js +6 -13
- package/lib/components/LayoutDirection/LayoutDirectionContext.js +1 -7
- package/lib/components/LayoutDirection/useLayoutDirection.js +0 -2
- package/lib/components/Link/Link.js +15 -21
- package/lib/components/Link/index.js +2 -2
- package/lib/components/ListBox/ListBox.js +17 -23
- package/lib/components/ListBox/ListBoxField.js +7 -12
- package/lib/components/ListBox/ListBoxMenu.js +7 -12
- package/lib/components/ListBox/ListBoxMenuIcon.js +7 -13
- package/lib/components/ListBox/ListBoxMenuItem.js +9 -15
- package/lib/components/ListBox/ListBoxPropTypes.js +2 -8
- package/lib/components/ListBox/ListBoxSelection.js +14 -20
- package/lib/components/ListBox/index.js +7 -7
- package/lib/components/ListBox/next/ListBoxSelection.js +18 -24
- package/lib/components/ListBox/next/ListBoxTrigger.js +7 -13
- package/lib/components/ListItem/ListItem.js +5 -11
- package/lib/components/Loading/Loading.js +14 -20
- package/lib/components/Loading/index.js +2 -2
- package/lib/components/Menu/Menu.d.ts +3 -1
- package/lib/components/Menu/Menu.js +18 -24
- package/lib/components/Menu/MenuContext.js +0 -2
- package/lib/components/Menu/MenuItem.js +44 -52
- package/lib/components/MenuButton/index.js +16 -24
- package/lib/components/Modal/Modal.js +91 -86
- package/lib/components/Modal/index.js +2 -2
- package/lib/components/ModalWrapper/ModalWrapper.js +30 -35
- package/lib/components/MultiSelect/FilterableMultiSelect.js +57 -67
- package/lib/components/MultiSelect/MultiSelect.js +61 -70
- package/lib/components/MultiSelect/MultiSelectPropTypes.js +2 -8
- package/lib/components/MultiSelect/filter.js +0 -6
- package/lib/components/MultiSelect/tools/itemToString.d.ts +1 -0
- package/lib/components/MultiSelect/tools/itemToString.js +1 -7
- package/lib/components/MultiSelect/tools/sorting.d.ts +9 -0
- package/lib/components/MultiSelect/tools/sorting.js +0 -2
- package/lib/components/Notification/Notification.js +118 -126
- package/lib/components/NumberInput/NumberFormatPropTypes.js +21 -27
- package/lib/components/NumberInput/NumberInput.Skeleton.js +8 -14
- package/lib/components/NumberInput/NumberInput.js +66 -74
- package/lib/components/OrderedList/OrderedList.js +8 -14
- package/lib/components/OverflowMenu/OverflowMenu.js +42 -49
- package/lib/components/OverflowMenu/index.js +3 -7
- package/lib/components/OverflowMenu/next/index.js +18 -26
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +27 -33
- package/lib/components/OverflowMenuItem/index.js +2 -2
- package/lib/components/OverflowMenuV2/index.d.ts +1 -0
- package/lib/components/OverflowMenuV2/index.js +2 -8
- package/lib/components/PageHeader/PageHeader.js +70 -78
- package/lib/components/PageHeader/index.js +0 -2
- package/lib/components/Pagination/Pagination.Skeleton.js +10 -16
- package/lib/components/Pagination/Pagination.js +44 -51
- package/lib/components/Pagination/experimental/PageSelector.d.ts +19 -0
- package/lib/components/Pagination/experimental/PageSelector.js +9 -15
- package/lib/components/Pagination/experimental/Pagination.d.ts +43 -0
- package/lib/components/Pagination/experimental/Pagination.js +34 -40
- package/lib/components/Pagination/experimental/index.d.ts +3 -0
- package/lib/components/PaginationNav/PaginationNav.js +54 -60
- package/lib/components/Popover/index.js +56 -47
- package/lib/components/PrimaryButton/PrimaryButton.js +2 -6
- package/lib/components/ProgressBar/ProgressBar.js +25 -31
- package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +10 -16
- package/lib/components/ProgressIndicator/ProgressIndicator.js +41 -49
- package/lib/components/RadioButton/RadioButton.Skeleton.js +6 -12
- package/lib/components/RadioButton/RadioButton.js +26 -32
- package/lib/components/RadioButton/index.js +2 -2
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +37 -43
- package/lib/components/RadioTile/RadioTile.js +25 -31
- package/lib/components/RadioTile/index.js +2 -2
- package/lib/components/Search/Search.Skeleton.js +7 -13
- package/lib/components/Search/Search.js +33 -39
- package/lib/components/Search/index.js +3 -3
- package/lib/components/SecondaryButton/SecondaryButton.js +2 -6
- package/lib/components/Select/Select.Skeleton.js +8 -14
- package/lib/components/Select/Select.js +42 -48
- package/lib/components/Select/index.js +3 -3
- package/lib/components/SelectItem/SelectItem.js +8 -14
- package/lib/components/SelectItem/index.js +2 -2
- package/lib/components/SelectItemGroup/SelectItemGroup.js +7 -13
- package/lib/components/ShapeIndicator/index.js +12 -18
- package/lib/components/SkeletonIcon/SkeletonIcon.js +4 -10
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +4 -10
- package/lib/components/SkeletonText/SkeletonText.js +11 -17
- package/lib/components/SkeletonText/index.js +2 -2
- package/lib/components/Slider/Slider.Skeleton.js +29 -35
- package/lib/components/Slider/Slider.js +84 -90
- package/lib/components/Slider/SliderHandles.js +18 -24
- package/lib/components/Slider/index.js +3 -3
- package/lib/components/Stack/HStack.js +1 -7
- package/lib/components/Stack/Stack.js +7 -15
- package/lib/components/Stack/VStack.js +1 -7
- package/lib/components/StructuredList/StructuredList.Skeleton.js +15 -21
- package/lib/components/StructuredList/StructuredList.js +60 -68
- package/lib/components/Switch/IconSwitch.d.ts +3 -0
- package/lib/components/Switch/IconSwitch.js +18 -25
- package/lib/components/Switch/Switch.js +14 -20
- package/lib/components/TabContent/TabContent.js +7 -33
- package/lib/components/Tabs/Tabs.Skeleton.js +10 -16
- package/lib/components/Tabs/Tabs.js +121 -129
- package/lib/components/Tabs/usePressable.js +0 -2
- package/lib/components/Tag/DismissibleTag.js +24 -30
- package/lib/components/Tag/OperationalTag.js +16 -22
- package/lib/components/Tag/SelectableTag.js +19 -25
- package/lib/components/Tag/Tag.Skeleton.js +5 -11
- package/lib/components/Tag/Tag.js +28 -34
- package/lib/components/Tag/isEllipsisActive.js +0 -2
- package/lib/components/Text/Text.js +6 -13
- package/lib/components/Text/TextDirection.js +4 -11
- package/lib/components/Text/TextDirectionContext.js +0 -2
- package/lib/components/Text/createTextComponent.js +1 -7
- package/lib/components/Text/index.js +0 -2
- package/lib/components/TextArea/TextArea.Skeleton.js +7 -13
- package/lib/components/TextArea/TextArea.js +49 -55
- package/lib/components/TextArea/index.js +3 -3
- package/lib/components/TextInput/ControlledPasswordInput.js +36 -42
- package/lib/components/TextInput/PasswordInput.js +48 -54
- package/lib/components/TextInput/TextInput.Skeleton.js +7 -13
- package/lib/components/TextInput/TextInput.js +47 -53
- package/lib/components/TextInput/index.js +3 -3
- package/lib/components/TextInput/util.d.ts +9 -0
- package/lib/components/TextInput/util.js +0 -2
- package/lib/components/Theme/index.js +16 -24
- package/lib/components/Tile/Tile.js +92 -100
- package/lib/components/TileGroup/TileGroup.js +15 -22
- package/lib/components/TimePicker/TimePicker.js +39 -45
- package/lib/components/TimePickerSelect/TimePickerSelect.js +10 -16
- package/lib/components/Toggle/Toggle.Skeleton.js +7 -13
- package/lib/components/Toggle/Toggle.js +28 -34
- package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +12 -20
- package/lib/components/Toggletip/index.js +32 -40
- package/lib/components/Tooltip/DefinitionTooltip.js +14 -22
- package/lib/components/Tooltip/Tooltip.js +19 -27
- package/lib/components/TreeView/TreeContext.js +0 -2
- package/lib/components/TreeView/TreeNode.js +41 -47
- package/lib/components/TreeView/TreeView.js +17 -23
- package/lib/components/UIShell/Content.js +6 -12
- package/lib/components/UIShell/Header.js +4 -10
- package/lib/components/UIShell/HeaderContainer.js +4 -9
- package/lib/components/UIShell/HeaderGlobalAction.js +11 -17
- package/lib/components/UIShell/HeaderGlobalBar.js +2 -2
- package/lib/components/UIShell/HeaderMenu.js +17 -23
- package/lib/components/UIShell/HeaderMenuButton.js +9 -15
- package/lib/components/UIShell/HeaderMenuItem.js +11 -17
- package/lib/components/UIShell/HeaderName.js +8 -14
- package/lib/components/UIShell/HeaderNavigation.js +6 -12
- package/lib/components/UIShell/HeaderPanel.js +11 -17
- package/lib/components/UIShell/HeaderSideNavItems.js +6 -12
- package/lib/components/UIShell/Link.js +6 -11
- package/lib/components/UIShell/SideNav.js +23 -29
- package/lib/components/UIShell/SideNavDetails.js +7 -13
- package/lib/components/UIShell/SideNavDivider.js +5 -11
- package/lib/components/UIShell/SideNavFooter.js +12 -18
- package/lib/components/UIShell/SideNavHeader.js +8 -14
- package/lib/components/UIShell/SideNavIcon.js +6 -12
- package/lib/components/UIShell/SideNavItem.js +6 -12
- package/lib/components/UIShell/SideNavItems.js +9 -15
- package/lib/components/UIShell/SideNavLink.js +13 -19
- package/lib/components/UIShell/SideNavLinkText.js +5 -11
- package/lib/components/UIShell/SideNavMenu.js +20 -26
- package/lib/components/UIShell/SideNavMenuItem.js +13 -19
- package/lib/components/UIShell/SideNavSwitcher.js +13 -19
- package/lib/components/UIShell/SkipToContent.js +7 -13
- package/lib/components/UIShell/Switcher.js +9 -15
- package/lib/components/UIShell/SwitcherDivider.js +4 -10
- package/lib/components/UIShell/SwitcherItem.js +15 -21
- package/lib/components/UIShell/_utils.d.ts +7 -0
- package/lib/components/UIShell/_utils.js +0 -2
- package/lib/components/UnorderedList/UnorderedList.js +7 -13
- package/lib/feature-flags.d.ts +1 -0
- package/lib/feature-flags.js +3 -4
- package/lib/index.js +180 -182
- package/lib/internal/FloatingMenu.js +10 -18
- package/lib/internal/OptimizedResize.js +2 -8
- package/lib/internal/Selection.js +1 -7
- package/lib/internal/clamp.js +0 -2
- package/lib/internal/createClassWrapper.js +1 -7
- package/lib/internal/deprecateFieldOnObject.js +1 -3
- package/lib/internal/environment.js +0 -2
- package/lib/internal/getAnnouncement.js +0 -2
- package/lib/internal/keyboard/keys.js +0 -2
- package/lib/internal/keyboard/match.js +0 -2
- package/lib/internal/keyboard/navigation.js +0 -2
- package/lib/internal/noopFn.js +0 -2
- package/lib/internal/useAttachedMenu.js +0 -2
- package/lib/internal/useControllableState.js +0 -2
- package/lib/internal/useDelayedState.js +0 -2
- package/lib/internal/useEvent.js +0 -2
- package/lib/internal/useId.d.ts +21 -0
- package/lib/internal/useId.js +27 -7
- package/lib/internal/useIdPrefix.js +2 -8
- package/lib/internal/useIsomorphicEffect.js +1 -1
- package/lib/internal/useMatchMedia.js +0 -2
- package/lib/internal/useMergedRefs.js +0 -2
- package/lib/internal/useNoInteractiveChildren.js +0 -2
- package/lib/internal/useNormalizedInputProps.js +2 -8
- package/lib/internal/useOutsideClick.js +0 -2
- package/lib/internal/useOverflowItems.js +1 -7
- package/lib/internal/usePrefix.js +2 -8
- package/lib/internal/usePreviousValue.js +0 -2
- package/lib/internal/useResizeObserver.js +0 -2
- package/lib/internal/useSavedCallback.js +0 -2
- package/lib/internal/utils.js +0 -2
- package/lib/internal/warning.js +0 -2
- package/lib/internal/wrapFocus.js +0 -2
- package/lib/node_modules/es-toolkit/dist/compat/function/{debounce.mjs.js → debounce.js} +1 -3
- package/lib/node_modules/es-toolkit/dist/compat/function/{throttle.mjs.js → throttle.js} +1 -3
- package/lib/node_modules/es-toolkit/dist/function/{debounce.mjs.js → debounce.js} +0 -2
- package/lib/prop-types/AriaPropTypes.js +2 -8
- package/lib/prop-types/deprecate.js +0 -2
- package/lib/prop-types/deprecateComponent.d.ts +1 -0
- package/lib/prop-types/deprecateComponent.js +2 -5
- package/lib/prop-types/deprecateValuesWithin.d.ts +1 -0
- package/lib/prop-types/deprecateValuesWithin.js +1 -1
- package/lib/prop-types/isRequiredOneOf.js +0 -2
- package/lib/prop-types/requiredIfGivenPropIsTruthy.d.ts +14 -0
- package/lib/prop-types/requiredIfGivenPropIsTruthy.js +1 -1
- package/lib/tools/events.js +0 -2
- package/lib/tools/mapPopoverAlign.js +0 -2
- package/lib/tools/mergeRefs.d.ts +12 -0
- package/lib/tools/mergeRefs.js +1 -2
- package/lib/tools/setupGetInstanceId.js +0 -2
- package/lib/tools/toggleClass.js +0 -2
- package/lib/tools/wrapComponent.js +4 -10
- package/package.json +11 -11
- /package/es/node_modules/es-toolkit/dist/function/{debounce.mjs.js → debounce.js} +0 -0
|
@@ -19,14 +19,8 @@ var match = require('../../internal/keyboard/match.js');
|
|
|
19
19
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
20
20
|
var SideNav = require('./SideNav.js');
|
|
21
21
|
|
|
22
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
23
|
-
|
|
24
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
25
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
26
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
27
|
-
|
|
28
22
|
var _ChevronDown;
|
|
29
|
-
const SideNavMenu = /*#__PURE__*/
|
|
23
|
+
const SideNavMenu = /*#__PURE__*/React.forwardRef(function SideNavMenu({
|
|
30
24
|
className: customClassName,
|
|
31
25
|
children,
|
|
32
26
|
defaultExpanded = false,
|
|
@@ -43,7 +37,7 @@ const SideNavMenu = /*#__PURE__*/React__default["default"].forwardRef(function S
|
|
|
43
37
|
const prefix = usePrefix.usePrefix();
|
|
44
38
|
const [isExpanded, setIsExpanded] = React.useState(defaultExpanded);
|
|
45
39
|
const [prevExpanded, setPrevExpanded] = React.useState(defaultExpanded);
|
|
46
|
-
const className =
|
|
40
|
+
const className = cx({
|
|
47
41
|
[`${prefix}--side-nav__item`]: true,
|
|
48
42
|
[`${prefix}--side-nav__item--active`]: isActive || hasActiveDescendant(children) && !isExpanded,
|
|
49
43
|
[`${prefix}--side-nav__item--icon`]: IconElement,
|
|
@@ -60,14 +54,14 @@ const SideNavMenu = /*#__PURE__*/React__default["default"].forwardRef(function S
|
|
|
60
54
|
return (
|
|
61
55
|
/*#__PURE__*/
|
|
62
56
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
|
63
|
-
|
|
57
|
+
React.createElement("li", {
|
|
64
58
|
className: className,
|
|
65
59
|
onKeyDown: event => {
|
|
66
60
|
if (match.match(event, keys.Escape)) {
|
|
67
61
|
setIsExpanded(false);
|
|
68
62
|
}
|
|
69
63
|
}
|
|
70
|
-
}, /*#__PURE__*/
|
|
64
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
71
65
|
"aria-expanded": isExpanded,
|
|
72
66
|
className: `${prefix}--side-nav__submenu`,
|
|
73
67
|
onClick: () => {
|
|
@@ -76,14 +70,14 @@ const SideNavMenu = /*#__PURE__*/React__default["default"].forwardRef(function S
|
|
|
76
70
|
ref: ref,
|
|
77
71
|
type: "button",
|
|
78
72
|
tabIndex: tabIndex === undefined ? !isSideNavExpanded && !isRail ? -1 : 0 : tabIndex
|
|
79
|
-
}, IconElement && /*#__PURE__*/
|
|
73
|
+
}, IconElement && /*#__PURE__*/React.createElement(SideNavIcon.default, null, /*#__PURE__*/React.createElement(IconElement, null)), /*#__PURE__*/React.createElement("span", {
|
|
80
74
|
className: `${prefix}--side-nav__submenu-title`
|
|
81
|
-
}, title), /*#__PURE__*/
|
|
75
|
+
}, title), /*#__PURE__*/React.createElement(SideNavIcon.default, {
|
|
82
76
|
className: `${prefix}--side-nav__submenu-chevron`,
|
|
83
77
|
small: true
|
|
84
|
-
}, _ChevronDown || (_ChevronDown = /*#__PURE__*/
|
|
78
|
+
}, _ChevronDown || (_ChevronDown = /*#__PURE__*/React.createElement(iconsReact.ChevronDown, {
|
|
85
79
|
size: 20
|
|
86
|
-
})))), /*#__PURE__*/
|
|
80
|
+
})))), /*#__PURE__*/React.createElement("ul", {
|
|
87
81
|
className: `${prefix}--side-nav__menu`
|
|
88
82
|
}, children))
|
|
89
83
|
);
|
|
@@ -93,43 +87,43 @@ SideNavMenu.propTypes = {
|
|
|
93
87
|
/**
|
|
94
88
|
* Provide <SideNavMenuItem>'s inside of the `SideNavMenu`
|
|
95
89
|
*/
|
|
96
|
-
children:
|
|
90
|
+
children: PropTypes.node,
|
|
97
91
|
/**
|
|
98
92
|
* Provide an optional class to be applied to the containing node
|
|
99
93
|
*/
|
|
100
|
-
className:
|
|
94
|
+
className: PropTypes.string,
|
|
101
95
|
/**
|
|
102
96
|
* Specify whether the menu should default to expanded. By default, it will
|
|
103
97
|
* be closed.
|
|
104
98
|
*/
|
|
105
|
-
defaultExpanded:
|
|
99
|
+
defaultExpanded: PropTypes.bool,
|
|
106
100
|
/**
|
|
107
101
|
* Specify whether the `SideNavMenu` is "active". `SideNavMenu` should be
|
|
108
102
|
* considered active if one of its menu items are a link for the current
|
|
109
103
|
* page.
|
|
110
104
|
*/
|
|
111
|
-
isActive:
|
|
105
|
+
isActive: PropTypes.bool,
|
|
112
106
|
/**
|
|
113
107
|
* Property to indicate if the side nav container is open (or not). Use to
|
|
114
108
|
* keep local state and styling in step with the SideNav expansion state.
|
|
115
109
|
*/
|
|
116
|
-
isSideNavExpanded:
|
|
110
|
+
isSideNavExpanded: PropTypes.bool,
|
|
117
111
|
/**
|
|
118
112
|
* Specify if this is a large variation of the SideNavMenu
|
|
119
113
|
*/
|
|
120
|
-
large:
|
|
114
|
+
large: PropTypes.bool,
|
|
121
115
|
/**
|
|
122
116
|
* A component used to render an icon.
|
|
123
117
|
*/
|
|
124
|
-
renderIcon:
|
|
118
|
+
renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
125
119
|
/**
|
|
126
120
|
* Optional prop to specify the tabIndex of the button. If undefined, it will be applied default validation
|
|
127
121
|
*/
|
|
128
|
-
tabIndex:
|
|
122
|
+
tabIndex: PropTypes.number,
|
|
129
123
|
/**
|
|
130
124
|
* Provide the text for the overall menu name
|
|
131
125
|
*/
|
|
132
|
-
title:
|
|
126
|
+
title: PropTypes.string.isRequired
|
|
133
127
|
};
|
|
134
128
|
|
|
135
129
|
/**
|
|
@@ -139,7 +133,7 @@ a single element, an array of elements, or null or undefined.
|
|
|
139
133
|
function hasActiveDescendant(children) {
|
|
140
134
|
if (Array.isArray(children)) {
|
|
141
135
|
return children.some(child => {
|
|
142
|
-
if (! /*#__PURE__*/
|
|
136
|
+
if (! /*#__PURE__*/React.isValidElement(child)) {
|
|
143
137
|
return false;
|
|
144
138
|
}
|
|
145
139
|
|
|
@@ -156,7 +150,7 @@ function hasActiveDescendant(children) {
|
|
|
156
150
|
|
|
157
151
|
// We use React.isValidElement(child) to check if the child is a valid React element before accessing its props
|
|
158
152
|
|
|
159
|
-
if (/*#__PURE__*/
|
|
153
|
+
if (/*#__PURE__*/React.isValidElement(children)) {
|
|
160
154
|
const props = children.props;
|
|
161
155
|
if (props.isActive === true || props['aria-current']) {
|
|
162
156
|
return true;
|
|
@@ -166,4 +160,4 @@ function hasActiveDescendant(children) {
|
|
|
166
160
|
}
|
|
167
161
|
|
|
168
162
|
exports.SideNavMenu = SideNavMenu;
|
|
169
|
-
exports
|
|
163
|
+
exports.default = SideNavMenu;
|
|
@@ -17,57 +17,51 @@ var SideNavLinkText = require('./SideNavLinkText.js');
|
|
|
17
17
|
var Link = require('./Link.js');
|
|
18
18
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
23
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
24
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
25
|
-
|
|
26
|
-
const SideNavMenuItem = /*#__PURE__*/React__default["default"].forwardRef(function SideNavMenuItem(props, ref) {
|
|
20
|
+
const SideNavMenuItem = /*#__PURE__*/React.forwardRef(function SideNavMenuItem(props, ref) {
|
|
27
21
|
const prefix = usePrefix.usePrefix();
|
|
28
22
|
const {
|
|
29
23
|
children,
|
|
30
24
|
className: customClassName,
|
|
31
|
-
as: Component = Link
|
|
25
|
+
as: Component = Link.default,
|
|
32
26
|
isActive,
|
|
33
27
|
...rest
|
|
34
28
|
} = props;
|
|
35
|
-
const className =
|
|
36
|
-
const linkClassName =
|
|
29
|
+
const className = cx(`${prefix}--side-nav__menu-item`, customClassName);
|
|
30
|
+
const linkClassName = cx({
|
|
37
31
|
[`${prefix}--side-nav__link`]: true,
|
|
38
32
|
[`${prefix}--side-nav__link--current`]: isActive
|
|
39
33
|
});
|
|
40
|
-
return /*#__PURE__*/
|
|
34
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
41
35
|
className: className
|
|
42
|
-
}, /*#__PURE__*/
|
|
36
|
+
}, /*#__PURE__*/React.createElement(Component, _rollupPluginBabelHelpers.extends({}, rest, {
|
|
43
37
|
className: linkClassName,
|
|
44
38
|
ref: ref
|
|
45
|
-
}), /*#__PURE__*/
|
|
39
|
+
}), /*#__PURE__*/React.createElement(SideNavLinkText.default, null, children)));
|
|
46
40
|
});
|
|
47
41
|
SideNavMenuItem.displayName = 'SideNavMenuItem';
|
|
48
42
|
SideNavMenuItem.propTypes = {
|
|
49
43
|
/**
|
|
50
44
|
* Optional component to render instead of default Link
|
|
51
45
|
*/
|
|
52
|
-
as:
|
|
46
|
+
as: PropTypes.elementType,
|
|
53
47
|
/**
|
|
54
48
|
* Specify the children to be rendered inside of the `SideNavMenuItem`
|
|
55
49
|
*/
|
|
56
|
-
children:
|
|
50
|
+
children: PropTypes.node,
|
|
57
51
|
/**
|
|
58
52
|
* Provide an optional class to be applied to the containing node
|
|
59
53
|
*/
|
|
60
|
-
className:
|
|
54
|
+
className: PropTypes.string,
|
|
61
55
|
/**
|
|
62
56
|
* Optionally provide an href for the underlying li`
|
|
63
57
|
*/
|
|
64
|
-
href:
|
|
58
|
+
href: PropTypes.string,
|
|
65
59
|
/**
|
|
66
60
|
* Optionally specify whether the link is "active". An active link is one that
|
|
67
61
|
* has an href that is the same as the current page. Can also pass in
|
|
68
62
|
* `aria-current="page"`, as well.
|
|
69
63
|
*/
|
|
70
|
-
isActive:
|
|
64
|
+
isActive: PropTypes.bool
|
|
71
65
|
};
|
|
72
66
|
|
|
73
|
-
exports
|
|
67
|
+
exports.default = SideNavMenuItem;
|
|
@@ -16,12 +16,6 @@ var React = require('react');
|
|
|
16
16
|
var useId = require('../../internal/useId.js');
|
|
17
17
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
18
18
|
|
|
19
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
20
|
-
|
|
21
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
22
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
23
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
24
|
-
|
|
25
19
|
var _ChevronDown;
|
|
26
20
|
const SideNavSwitcher = /*#__PURE__*/React.forwardRef(function SideNavSwitcher(props, ref) {
|
|
27
21
|
const id = useId.useId('side-nav-switcher');
|
|
@@ -32,33 +26,33 @@ const SideNavSwitcher = /*#__PURE__*/React.forwardRef(function SideNavSwitcher(p
|
|
|
32
26
|
onChange,
|
|
33
27
|
options
|
|
34
28
|
} = props;
|
|
35
|
-
const className =
|
|
29
|
+
const className = cx(`${prefix}--side-nav__switcher`, customClassName);
|
|
36
30
|
|
|
37
31
|
// Note for usage around `onBlur`: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-onchange.md
|
|
38
|
-
return /*#__PURE__*/
|
|
32
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
39
33
|
className: className
|
|
40
|
-
}, /*#__PURE__*/
|
|
34
|
+
}, /*#__PURE__*/React.createElement("label", {
|
|
41
35
|
htmlFor: id,
|
|
42
36
|
className: `${prefix}--assistive-text`
|
|
43
|
-
}, labelText), /*#__PURE__*/
|
|
37
|
+
}, labelText), /*#__PURE__*/React.createElement("select", {
|
|
44
38
|
id: id,
|
|
45
39
|
className: `${prefix}--side-nav__select`,
|
|
46
40
|
defaultValue: "",
|
|
47
41
|
onBlur: onChange,
|
|
48
42
|
onChange: onChange,
|
|
49
43
|
ref: ref
|
|
50
|
-
}, /*#__PURE__*/
|
|
44
|
+
}, /*#__PURE__*/React.createElement("option", {
|
|
51
45
|
className: `${prefix}--side-nav__option`,
|
|
52
46
|
disabled: true,
|
|
53
47
|
hidden: true,
|
|
54
48
|
value: ""
|
|
55
|
-
}, labelText), options.map(option => /*#__PURE__*/
|
|
49
|
+
}, labelText), options.map(option => /*#__PURE__*/React.createElement("option", {
|
|
56
50
|
key: option,
|
|
57
51
|
className: `${prefix}--side-nav__option`,
|
|
58
52
|
value: option
|
|
59
|
-
}, option))), /*#__PURE__*/
|
|
53
|
+
}, option))), /*#__PURE__*/React.createElement("div", {
|
|
60
54
|
className: `${prefix}--side-nav__switcher-chevron`
|
|
61
|
-
}, _ChevronDown || (_ChevronDown = /*#__PURE__*/
|
|
55
|
+
}, _ChevronDown || (_ChevronDown = /*#__PURE__*/React.createElement(iconsReact.ChevronDown, {
|
|
62
56
|
size: 20
|
|
63
57
|
}))));
|
|
64
58
|
});
|
|
@@ -67,23 +61,23 @@ SideNavSwitcher.propTypes = {
|
|
|
67
61
|
/**
|
|
68
62
|
* Provide an optional class to be applied to the containing node
|
|
69
63
|
*/
|
|
70
|
-
className:
|
|
64
|
+
className: PropTypes.string,
|
|
71
65
|
/**
|
|
72
66
|
* Provide the label for the switcher. This will be the first visible option
|
|
73
67
|
* when someone views this control
|
|
74
68
|
*/
|
|
75
|
-
labelText:
|
|
69
|
+
labelText: PropTypes.string.isRequired,
|
|
76
70
|
/**
|
|
77
71
|
* Provide a callback function that is called whenever the switcher value is
|
|
78
72
|
* updated
|
|
79
73
|
*/
|
|
80
|
-
onChange:
|
|
74
|
+
onChange: PropTypes.func,
|
|
81
75
|
/**
|
|
82
76
|
* Provide an array of options to be rendered in the switcher as an
|
|
83
77
|
* `<option>`. The text value will be what is displayed to the user and is set
|
|
84
78
|
* as the `value` prop for each `<option>`.
|
|
85
79
|
*/
|
|
86
|
-
options:
|
|
80
|
+
options: PropTypes.arrayOf(PropTypes.string).isRequired
|
|
87
81
|
};
|
|
88
82
|
|
|
89
|
-
exports
|
|
83
|
+
exports.default = SideNavSwitcher;
|
|
@@ -15,12 +15,6 @@ var React = require('react');
|
|
|
15
15
|
var PropTypes = require('prop-types');
|
|
16
16
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
17
17
|
|
|
18
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
19
|
-
|
|
20
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
21
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
22
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
23
|
-
|
|
24
18
|
function SkipToContent({
|
|
25
19
|
children = 'Skip to main content',
|
|
26
20
|
className: customClassName,
|
|
@@ -29,8 +23,8 @@ function SkipToContent({
|
|
|
29
23
|
...rest
|
|
30
24
|
}) {
|
|
31
25
|
const prefix = usePrefix.usePrefix();
|
|
32
|
-
const className =
|
|
33
|
-
return /*#__PURE__*/
|
|
26
|
+
const className = cx(`${prefix}--skip-to-content`, customClassName);
|
|
27
|
+
return /*#__PURE__*/React.createElement("a", _rollupPluginBabelHelpers.extends({}, rest, {
|
|
34
28
|
className: className,
|
|
35
29
|
href: href,
|
|
36
30
|
tabIndex: tabIndex
|
|
@@ -41,17 +35,17 @@ SkipToContent.propTypes = {
|
|
|
41
35
|
* A ReactNode to display in the SkipToContent `a` tag.
|
|
42
36
|
* `'Skip to main content'` by default.
|
|
43
37
|
*/
|
|
44
|
-
children:
|
|
45
|
-
className:
|
|
38
|
+
children: PropTypes.string,
|
|
39
|
+
className: PropTypes.string,
|
|
46
40
|
/**
|
|
47
41
|
* Provide the `href` to the id of the element on your package that is the
|
|
48
42
|
* main content. `#main-content` by default.
|
|
49
43
|
*/
|
|
50
|
-
href:
|
|
44
|
+
href: PropTypes.string,
|
|
51
45
|
/**
|
|
52
46
|
* Optionally override the default tabindex of 0
|
|
53
47
|
*/
|
|
54
|
-
tabIndex:
|
|
48
|
+
tabIndex: PropTypes.string
|
|
55
49
|
};
|
|
56
50
|
|
|
57
|
-
exports
|
|
51
|
+
exports.default = SkipToContent;
|
|
@@ -45,12 +45,6 @@ require('./SideNavMenu.js');
|
|
|
45
45
|
require('./SideNavMenuItem.js');
|
|
46
46
|
require('./SideNavSwitcher.js');
|
|
47
47
|
|
|
48
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
49
|
-
|
|
50
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
51
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
52
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
53
|
-
|
|
54
48
|
const Switcher = /*#__PURE__*/React.forwardRef(function Switcher(props, forwardRef) {
|
|
55
49
|
const switcherRef = React.useRef(null);
|
|
56
50
|
const ref = useMergedRefs.useMergedRefs([switcherRef, forwardRef]);
|
|
@@ -66,7 +60,7 @@ const Switcher = /*#__PURE__*/React.forwardRef(function Switcher(props, forwardR
|
|
|
66
60
|
'aria-label': ariaLabel,
|
|
67
61
|
'aria-labelledby': ariaLabelledBy
|
|
68
62
|
};
|
|
69
|
-
const className =
|
|
63
|
+
const className = cx(`${prefix}--switcher`, {
|
|
70
64
|
[customClassName || '']: !!customClassName
|
|
71
65
|
});
|
|
72
66
|
const handleSwitcherItemFocus = ({
|
|
@@ -74,7 +68,7 @@ const Switcher = /*#__PURE__*/React.forwardRef(function Switcher(props, forwardR
|
|
|
74
68
|
direction
|
|
75
69
|
}) => {
|
|
76
70
|
const enabledIndices = React.Children.toArray(children).reduce((acc, child, i) => {
|
|
77
|
-
if (/*#__PURE__*/React.isValidElement(child) && child.type === SwitcherItem
|
|
71
|
+
if (/*#__PURE__*/React.isValidElement(child) && child.type === SwitcherItem.default && Object.keys(child.props).length) {
|
|
78
72
|
acc.push(i);
|
|
79
73
|
}
|
|
80
74
|
return acc;
|
|
@@ -101,7 +95,7 @@ const Switcher = /*#__PURE__*/React.forwardRef(function Switcher(props, forwardR
|
|
|
101
95
|
}
|
|
102
96
|
};
|
|
103
97
|
const childrenWithProps = React.Children.toArray(children).map((child, index) => {
|
|
104
|
-
if (/*#__PURE__*/React.isValidElement(child) && child.type === SwitcherItem
|
|
98
|
+
if (/*#__PURE__*/React.isValidElement(child) && child.type === SwitcherItem.default) {
|
|
105
99
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
106
100
|
handleSwitcherItemFocus,
|
|
107
101
|
index,
|
|
@@ -109,14 +103,14 @@ const Switcher = /*#__PURE__*/React.forwardRef(function Switcher(props, forwardR
|
|
|
109
103
|
expanded
|
|
110
104
|
});
|
|
111
105
|
}
|
|
112
|
-
if (/*#__PURE__*/React.isValidElement(child) && child.type === SwitcherDivider
|
|
106
|
+
if (/*#__PURE__*/React.isValidElement(child) && child.type === SwitcherDivider.default) {
|
|
113
107
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
114
108
|
key: index
|
|
115
109
|
});
|
|
116
110
|
}
|
|
117
111
|
return child;
|
|
118
112
|
});
|
|
119
|
-
return /*#__PURE__*/
|
|
113
|
+
return /*#__PURE__*/React.createElement("ul", _rollupPluginBabelHelpers.extends({
|
|
120
114
|
ref: ref,
|
|
121
115
|
className: className
|
|
122
116
|
}, accessibilityLabel), childrenWithProps);
|
|
@@ -130,15 +124,15 @@ Switcher.propTypes = {
|
|
|
130
124
|
/**
|
|
131
125
|
* expects to receive <SwitcherItem />
|
|
132
126
|
*/
|
|
133
|
-
children:
|
|
127
|
+
children: PropTypes.node.isRequired,
|
|
134
128
|
/**
|
|
135
129
|
* Optionally provide a custom class to apply to the underlying `<ul>` node
|
|
136
130
|
*/
|
|
137
|
-
className:
|
|
131
|
+
className: PropTypes.string,
|
|
138
132
|
/**
|
|
139
133
|
* Specify whether the panel is expanded
|
|
140
134
|
*/
|
|
141
|
-
expanded:
|
|
135
|
+
expanded: PropTypes.bool
|
|
142
136
|
};
|
|
143
137
|
|
|
144
|
-
exports
|
|
138
|
+
exports.default = Switcher;
|
|
@@ -15,21 +15,15 @@ var cx = require('classnames');
|
|
|
15
15
|
var PropTypes = require('prop-types');
|
|
16
16
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
17
17
|
|
|
18
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
19
|
-
|
|
20
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
21
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
22
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
23
|
-
|
|
24
18
|
const SwitcherDivider = ({
|
|
25
19
|
className: customClassName,
|
|
26
20
|
...other
|
|
27
21
|
}) => {
|
|
28
22
|
const prefix = usePrefix.usePrefix();
|
|
29
|
-
const classNames =
|
|
23
|
+
const classNames = cx(`${prefix}--switcher__item--divider`, {
|
|
30
24
|
[customClassName || '']: !!customClassName
|
|
31
25
|
});
|
|
32
|
-
return /*#__PURE__*/
|
|
26
|
+
return /*#__PURE__*/React.createElement("hr", _rollupPluginBabelHelpers.extends({}, other, {
|
|
33
27
|
className: classNames
|
|
34
28
|
}));
|
|
35
29
|
};
|
|
@@ -37,7 +31,7 @@ SwitcherDivider.propTypes = {
|
|
|
37
31
|
/**
|
|
38
32
|
* Optionally provide a custom class to apply to the underlying `<li>` node
|
|
39
33
|
*/
|
|
40
|
-
className:
|
|
34
|
+
className: PropTypes.string
|
|
41
35
|
};
|
|
42
36
|
|
|
43
|
-
exports
|
|
37
|
+
exports.default = SwitcherDivider;
|
|
@@ -19,12 +19,6 @@ var keys = require('../../internal/keyboard/keys.js');
|
|
|
19
19
|
var match = require('../../internal/keyboard/match.js');
|
|
20
20
|
var AriaPropTypes = require('../../prop-types/AriaPropTypes.js');
|
|
21
21
|
|
|
22
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
23
|
-
|
|
24
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
25
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
26
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
27
|
-
|
|
28
22
|
const SwitcherItem = /*#__PURE__*/React.forwardRef(function SwitcherItem(props, forwardRef) {
|
|
29
23
|
const {
|
|
30
24
|
'aria-label': ariaLabel,
|
|
@@ -43,14 +37,14 @@ const SwitcherItem = /*#__PURE__*/React.forwardRef(function SwitcherItem(props,
|
|
|
43
37
|
...rest
|
|
44
38
|
} = props;
|
|
45
39
|
const prefix = usePrefix.usePrefix();
|
|
46
|
-
const classNames =
|
|
40
|
+
const classNames = cx(`${prefix}--switcher__item`, {
|
|
47
41
|
[customClassName || '']: !!customClassName
|
|
48
42
|
});
|
|
49
43
|
const accessibilityLabel = {
|
|
50
44
|
'aria-label': ariaLabel,
|
|
51
45
|
'aria-labelledby': ariaLabelledBy
|
|
52
46
|
};
|
|
53
|
-
const linkClassName =
|
|
47
|
+
const linkClassName = cx(`${prefix}--switcher__item-link`, {
|
|
54
48
|
[`${prefix}--switcher__item-link--selected`]: isSelected
|
|
55
49
|
});
|
|
56
50
|
function setTabFocus(evt) {
|
|
@@ -69,9 +63,9 @@ const SwitcherItem = /*#__PURE__*/React.forwardRef(function SwitcherItem(props,
|
|
|
69
63
|
});
|
|
70
64
|
}
|
|
71
65
|
}
|
|
72
|
-
return /*#__PURE__*/
|
|
66
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
73
67
|
className: classNames
|
|
74
|
-
}, /*#__PURE__*/
|
|
68
|
+
}, /*#__PURE__*/React.createElement(Link.default, _rollupPluginBabelHelpers.extends({
|
|
75
69
|
onKeyDown: evt => {
|
|
76
70
|
setTabFocus(evt);
|
|
77
71
|
onKeyDown(evt);
|
|
@@ -91,43 +85,43 @@ SwitcherItem.propTypes = {
|
|
|
91
85
|
/**
|
|
92
86
|
* Specify the text content for the link
|
|
93
87
|
*/
|
|
94
|
-
children:
|
|
88
|
+
children: PropTypes.node.isRequired,
|
|
95
89
|
/**
|
|
96
90
|
* Optionally provide a custom class to apply to the underlying `<li>` node
|
|
97
91
|
*/
|
|
98
|
-
className:
|
|
92
|
+
className: PropTypes.string,
|
|
99
93
|
/**
|
|
100
94
|
* event handlers
|
|
101
95
|
*/
|
|
102
|
-
handleSwitcherItemFocus:
|
|
96
|
+
handleSwitcherItemFocus: PropTypes.func,
|
|
103
97
|
/**
|
|
104
98
|
* Optionally provide an href for the underlying li`
|
|
105
99
|
*/
|
|
106
|
-
href:
|
|
100
|
+
href: PropTypes.string,
|
|
107
101
|
/**
|
|
108
102
|
* Specify the index of the SwitcherItem
|
|
109
103
|
*/
|
|
110
|
-
index:
|
|
104
|
+
index: PropTypes.number,
|
|
111
105
|
/**
|
|
112
106
|
* event handlers
|
|
113
107
|
*/
|
|
114
|
-
onClick:
|
|
108
|
+
onClick: PropTypes.func,
|
|
115
109
|
/**
|
|
116
110
|
* event handlers
|
|
117
111
|
*/
|
|
118
|
-
onKeyDown:
|
|
112
|
+
onKeyDown: PropTypes.func,
|
|
119
113
|
/**
|
|
120
114
|
* Specify the tab index of the Link
|
|
121
115
|
*/
|
|
122
|
-
tabIndex:
|
|
116
|
+
tabIndex: PropTypes.number,
|
|
123
117
|
/**
|
|
124
118
|
* Specify where to open the link.
|
|
125
119
|
*/
|
|
126
|
-
target:
|
|
120
|
+
target: PropTypes.string,
|
|
127
121
|
/**
|
|
128
122
|
* The rel property for the link.
|
|
129
123
|
*/
|
|
130
|
-
rel:
|
|
124
|
+
rel: PropTypes.string
|
|
131
125
|
};
|
|
132
126
|
|
|
133
|
-
exports
|
|
127
|
+
exports.default = SwitcherItem;
|
|
@@ -15,12 +15,6 @@ var React = require('react');
|
|
|
15
15
|
var cx = require('classnames');
|
|
16
16
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
17
17
|
|
|
18
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
19
|
-
|
|
20
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
21
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
22
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
23
|
-
|
|
24
18
|
function UnorderedList({
|
|
25
19
|
className,
|
|
26
20
|
nested = false,
|
|
@@ -28,11 +22,11 @@ function UnorderedList({
|
|
|
28
22
|
...other
|
|
29
23
|
}) {
|
|
30
24
|
const prefix = usePrefix.usePrefix();
|
|
31
|
-
const classNames =
|
|
25
|
+
const classNames = cx(`${prefix}--list--unordered`, className, {
|
|
32
26
|
[`${prefix}--list--nested`]: nested,
|
|
33
27
|
[`${prefix}--list--expressive`]: isExpressive
|
|
34
28
|
});
|
|
35
|
-
return /*#__PURE__*/
|
|
29
|
+
return /*#__PURE__*/React.createElement("ul", _rollupPluginBabelHelpers.extends({
|
|
36
30
|
className: classNames
|
|
37
31
|
}, other));
|
|
38
32
|
}
|
|
@@ -40,19 +34,19 @@ UnorderedList.propTypes = {
|
|
|
40
34
|
/**
|
|
41
35
|
* Specify a collection of ListItem's to be rendered in the UnorderedList
|
|
42
36
|
*/
|
|
43
|
-
children:
|
|
37
|
+
children: PropTypes.node,
|
|
44
38
|
/**
|
|
45
39
|
* Specify an optional className to be applied to the underlying `<ul>` node
|
|
46
40
|
*/
|
|
47
|
-
className:
|
|
41
|
+
className: PropTypes.string,
|
|
48
42
|
/**
|
|
49
43
|
* Specify whether this ordered list expressive or not
|
|
50
44
|
*/
|
|
51
|
-
isExpressive:
|
|
45
|
+
isExpressive: PropTypes.bool,
|
|
52
46
|
/**
|
|
53
47
|
* Specify whether the list is nested, or not
|
|
54
48
|
*/
|
|
55
|
-
nested:
|
|
49
|
+
nested: PropTypes.bool
|
|
56
50
|
};
|
|
57
51
|
|
|
58
|
-
exports
|
|
52
|
+
exports.default = UnorderedList;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/feature-flags.js
CHANGED
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
var FeatureFlags = require('@carbon/feature-flags');
|
|
11
11
|
|
|
12
|
-
function
|
|
13
|
-
if (e && e.__esModule) return e;
|
|
12
|
+
function _interopNamespaceDefault(e) {
|
|
14
13
|
var n = Object.create(null);
|
|
15
14
|
if (e) {
|
|
16
15
|
Object.keys(e).forEach(function (k) {
|
|
@@ -23,11 +22,11 @@ function _interopNamespace(e) {
|
|
|
23
22
|
}
|
|
24
23
|
});
|
|
25
24
|
}
|
|
26
|
-
n
|
|
25
|
+
n.default = e;
|
|
27
26
|
return Object.freeze(n);
|
|
28
27
|
}
|
|
29
28
|
|
|
30
|
-
var FeatureFlags__namespace = /*#__PURE__*/
|
|
29
|
+
var FeatureFlags__namespace = /*#__PURE__*/_interopNamespaceDefault(FeatureFlags);
|
|
31
30
|
|
|
32
31
|
FeatureFlags__namespace.merge({
|
|
33
32
|
'enable-css-custom-properties': true,
|