@carbon/react 1.87.0-rc.0 → 1.87.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 +853 -853
- 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
|
@@ -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
|
var _span, _span2;
|
|
25
19
|
const DataTableSkeleton = ({
|
|
26
20
|
headers,
|
|
@@ -34,7 +28,7 @@ const DataTableSkeleton = ({
|
|
|
34
28
|
...rest
|
|
35
29
|
}) => {
|
|
36
30
|
const prefix = usePrefix.usePrefix();
|
|
37
|
-
const dataTableSkeletonClasses =
|
|
31
|
+
const dataTableSkeletonClasses = cx(className, {
|
|
38
32
|
[`${prefix}--skeleton`]: true,
|
|
39
33
|
[`${prefix}--data-table`]: true,
|
|
40
34
|
[`${prefix}--data-table--zebra`]: zebra,
|
|
@@ -46,71 +40,71 @@ const DataTableSkeleton = ({
|
|
|
46
40
|
length: columnCount
|
|
47
41
|
}, (_, index) => index);
|
|
48
42
|
for (let i = 0; i < rowRepeat; i++) {
|
|
49
|
-
rows[i] = /*#__PURE__*/
|
|
43
|
+
rows[i] = /*#__PURE__*/React.createElement("tr", {
|
|
50
44
|
key: i
|
|
51
|
-
}, columnsArray.map(j => /*#__PURE__*/
|
|
45
|
+
}, columnsArray.map(j => /*#__PURE__*/React.createElement("td", {
|
|
52
46
|
key: j
|
|
53
|
-
}, _span || (_span = /*#__PURE__*/
|
|
47
|
+
}, _span || (_span = /*#__PURE__*/React.createElement("span", null)))));
|
|
54
48
|
}
|
|
55
|
-
return /*#__PURE__*/
|
|
49
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
56
50
|
className: `${prefix}--skeleton ${prefix}--data-table-container`
|
|
57
|
-
}, showHeader ? /*#__PURE__*/
|
|
51
|
+
}, showHeader ? /*#__PURE__*/React.createElement("div", {
|
|
58
52
|
className: `${prefix}--data-table-header`
|
|
59
|
-
}, /*#__PURE__*/
|
|
53
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
60
54
|
className: `${prefix}--data-table-header__title`
|
|
61
|
-
}), /*#__PURE__*/
|
|
55
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
62
56
|
className: `${prefix}--data-table-header__description`
|
|
63
|
-
})) : null, showToolbar ? /*#__PURE__*/
|
|
57
|
+
})) : null, showToolbar ? /*#__PURE__*/React.createElement("section", {
|
|
64
58
|
"aria-label": "data table toolbar",
|
|
65
59
|
className: `${prefix}--table-toolbar`
|
|
66
|
-
}, /*#__PURE__*/
|
|
60
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
67
61
|
className: `${prefix}--toolbar-content`
|
|
68
|
-
}, /*#__PURE__*/
|
|
62
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
69
63
|
className: `${prefix}--skeleton ${prefix}--btn ${prefix}--btn--sm`
|
|
70
|
-
}))) : null, /*#__PURE__*/
|
|
64
|
+
}))) : null, /*#__PURE__*/React.createElement("table", _rollupPluginBabelHelpers.extends({
|
|
71
65
|
className: dataTableSkeletonClasses
|
|
72
|
-
}, rest), /*#__PURE__*/
|
|
66
|
+
}, rest), /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", null, columnsArray.map(i => /*#__PURE__*/React.createElement("th", {
|
|
73
67
|
key: i
|
|
74
|
-
}, headers ? /*#__PURE__*/
|
|
68
|
+
}, headers ? /*#__PURE__*/React.createElement("div", {
|
|
75
69
|
className: "cds--table-header-label"
|
|
76
|
-
}, headers[i]?.header) : _span2 || (_span2 = /*#__PURE__*/
|
|
70
|
+
}, headers[i]?.header) : _span2 || (_span2 = /*#__PURE__*/React.createElement("span", null)))))), /*#__PURE__*/React.createElement("tbody", null, rows)));
|
|
77
71
|
};
|
|
78
72
|
DataTableSkeleton.propTypes = {
|
|
79
73
|
/**
|
|
80
74
|
* Specify an optional className to add.
|
|
81
75
|
*/
|
|
82
|
-
className:
|
|
76
|
+
className: PropTypes.string,
|
|
83
77
|
/**
|
|
84
78
|
* Specify the number of columns that you want to render in the skeleton state
|
|
85
79
|
*/
|
|
86
|
-
columnCount:
|
|
80
|
+
columnCount: PropTypes.number,
|
|
87
81
|
/**
|
|
88
82
|
* Optionally specify whether you want the Skeleton to be rendered as a
|
|
89
83
|
* compact DataTable
|
|
90
84
|
*/
|
|
91
|
-
compact:
|
|
85
|
+
compact: PropTypes.bool,
|
|
92
86
|
/**
|
|
93
87
|
* Optionally specify the displayed headers
|
|
94
88
|
*/
|
|
95
|
-
headers:
|
|
96
|
-
header:
|
|
89
|
+
headers: PropTypes.arrayOf(PropTypes.shape({
|
|
90
|
+
header: PropTypes.node.isRequired
|
|
97
91
|
}).isRequired),
|
|
98
92
|
/**
|
|
99
93
|
* Specify the number of rows that you want to render in the skeleton state
|
|
100
94
|
*/
|
|
101
|
-
rowCount:
|
|
95
|
+
rowCount: PropTypes.number,
|
|
102
96
|
/**
|
|
103
97
|
* Specify if the table header should be rendered as part of the skeleton.
|
|
104
98
|
*/
|
|
105
|
-
showHeader:
|
|
99
|
+
showHeader: PropTypes.bool,
|
|
106
100
|
/**
|
|
107
101
|
* Specify if the table toolbar should be rendered as part of the skeleton.
|
|
108
102
|
*/
|
|
109
|
-
showToolbar:
|
|
103
|
+
showToolbar: PropTypes.bool,
|
|
110
104
|
/**
|
|
111
105
|
* Optionally specify whether you want the DataTable to be zebra striped
|
|
112
106
|
*/
|
|
113
|
-
zebra:
|
|
107
|
+
zebra: PropTypes.bool
|
|
114
108
|
};
|
|
115
109
|
|
|
116
|
-
exports
|
|
110
|
+
exports.default = DataTableSkeleton;
|
|
@@ -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
|
const DatePickerSkeleton = ({
|
|
25
19
|
range,
|
|
26
20
|
id,
|
|
@@ -29,45 +23,45 @@ const DatePickerSkeleton = ({
|
|
|
29
23
|
...rest
|
|
30
24
|
}) => {
|
|
31
25
|
const prefix = usePrefix.usePrefix();
|
|
32
|
-
const dateInput = /*#__PURE__*/
|
|
26
|
+
const dateInput = /*#__PURE__*/React.createElement("div", {
|
|
33
27
|
className: `${prefix}--date-picker-container`
|
|
34
|
-
}, !hideLabel && /*#__PURE__*/
|
|
28
|
+
}, !hideLabel && /*#__PURE__*/React.createElement("span", {
|
|
35
29
|
className: `${prefix}--label`,
|
|
36
30
|
id: id
|
|
37
|
-
}), /*#__PURE__*/
|
|
31
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
38
32
|
className: `${prefix}--date-picker__input ${prefix}--skeleton`
|
|
39
33
|
}));
|
|
40
34
|
if (range) {
|
|
41
|
-
return /*#__PURE__*/
|
|
35
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
42
36
|
className: `${prefix}--form-item`
|
|
43
|
-
}, /*#__PURE__*/
|
|
44
|
-
className:
|
|
37
|
+
}, /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({
|
|
38
|
+
className: cx(`${prefix}--date-picker`, `${prefix}--date-picker--range`, `${prefix}--skeleton`, className)
|
|
45
39
|
}, rest), dateInput, dateInput));
|
|
46
40
|
}
|
|
47
|
-
return /*#__PURE__*/
|
|
41
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
48
42
|
className: `${prefix}--form-item`
|
|
49
|
-
}, /*#__PURE__*/
|
|
50
|
-
className:
|
|
43
|
+
}, /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({
|
|
44
|
+
className: cx(`${prefix}--date-picker`, `${prefix}--date-picker--short`, `${prefix}--date-picker--simple`, `${prefix}--skeleton`, className)
|
|
51
45
|
}, rest), dateInput));
|
|
52
46
|
};
|
|
53
47
|
DatePickerSkeleton.propTypes = {
|
|
54
48
|
/**
|
|
55
49
|
* Specify an optional className to add.
|
|
56
50
|
*/
|
|
57
|
-
className:
|
|
51
|
+
className: PropTypes.string,
|
|
58
52
|
/**
|
|
59
53
|
* Specify whether the label should be hidden, or not
|
|
60
54
|
*/
|
|
61
|
-
hideLabel:
|
|
55
|
+
hideLabel: PropTypes.bool,
|
|
62
56
|
/**
|
|
63
57
|
* Specify the id to add.
|
|
64
58
|
*/
|
|
65
|
-
id:
|
|
59
|
+
id: PropTypes.string,
|
|
66
60
|
/**
|
|
67
61
|
* Specify whether the skeleton should be of range date picker.
|
|
68
62
|
*/
|
|
69
|
-
range:
|
|
63
|
+
range: PropTypes.bool
|
|
70
64
|
};
|
|
71
65
|
|
|
72
66
|
exports.DatePickerSkeleton = DatePickerSkeleton;
|
|
73
|
-
exports
|
|
67
|
+
exports.default = DatePickerSkeleton;
|
|
@@ -28,23 +28,20 @@ require('../FluidForm/FluidForm.js');
|
|
|
28
28
|
var FormContext = require('../FluidForm/FormContext.js');
|
|
29
29
|
var iconsReact = require('@carbon/icons-react');
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
currentDay[index] = 'Th';
|
|
44
|
-
} else {
|
|
45
|
-
currentDay[index] = currentDay[index].charAt(0);
|
|
31
|
+
// Weekdays shorthand for English locale
|
|
32
|
+
// Ensure localization exists before trying to access it
|
|
33
|
+
function initializeWeekdayShorthand() {
|
|
34
|
+
if (l10n?.en?.weekdays?.shorthand) {
|
|
35
|
+
l10n.en.weekdays.shorthand.forEach((_day, index) => {
|
|
36
|
+
const currentDay = l10n.en.weekdays.shorthand;
|
|
37
|
+
if (currentDay[index] === 'Thu' || currentDay[index] === 'Th') {
|
|
38
|
+
currentDay[index] = 'Th';
|
|
39
|
+
} else {
|
|
40
|
+
currentDay[index] = currentDay[index].charAt(0);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
46
43
|
}
|
|
47
|
-
}
|
|
44
|
+
}
|
|
48
45
|
const forEach = Array.prototype.forEach;
|
|
49
46
|
|
|
50
47
|
/**
|
|
@@ -144,7 +141,7 @@ function updateClassNames(calendar, prefix) {
|
|
|
144
141
|
});
|
|
145
142
|
}
|
|
146
143
|
}
|
|
147
|
-
const DatePicker = /*#__PURE__*/
|
|
144
|
+
const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
|
|
148
145
|
allowInput,
|
|
149
146
|
appendTo,
|
|
150
147
|
children,
|
|
@@ -222,7 +219,7 @@ const DatePicker = /*#__PURE__*/React__default["default"].forwardRef(function Da
|
|
|
222
219
|
const lastFocusedField = React.useRef(null);
|
|
223
220
|
const savedOnChange = useSavedCallback.useSavedCallback(onChange);
|
|
224
221
|
const savedOnOpen = useSavedCallback.useSavedCallback(onOpen);
|
|
225
|
-
const datePickerClasses =
|
|
222
|
+
const datePickerClasses = cx(`${prefix}--date-picker`, {
|
|
226
223
|
[`${prefix}--date-picker--short`]: short,
|
|
227
224
|
[`${prefix}--date-picker--light`]: light,
|
|
228
225
|
[`${prefix}--date-picker--simple`]: datePickerType === 'simple',
|
|
@@ -230,37 +227,40 @@ const DatePicker = /*#__PURE__*/React__default["default"].forwardRef(function Da
|
|
|
230
227
|
[`${prefix}--date-picker--range`]: datePickerType === 'range',
|
|
231
228
|
[`${prefix}--date-picker--nolabel`]: datePickerType === 'range' && isLabelTextEmpty(children)
|
|
232
229
|
});
|
|
233
|
-
const wrapperClasses =
|
|
230
|
+
const wrapperClasses = cx(`${prefix}--form-item`, {
|
|
234
231
|
[String(className)]: className
|
|
235
232
|
});
|
|
236
|
-
const childrenWithProps =
|
|
237
|
-
if (index === 0 && child.type ===
|
|
238
|
-
return /*#__PURE__*/
|
|
233
|
+
const childrenWithProps = React.Children.toArray(children).map((child, index) => {
|
|
234
|
+
if (index === 0 && child.type === /*#__PURE__*/React.createElement(DatePickerInput.default, child.props).type) {
|
|
235
|
+
return /*#__PURE__*/React.cloneElement(child, {
|
|
239
236
|
datePickerType,
|
|
240
237
|
ref: startInputField,
|
|
241
238
|
readOnly
|
|
242
239
|
});
|
|
243
240
|
}
|
|
244
|
-
if (index === 1 && child.type ===
|
|
245
|
-
return /*#__PURE__*/
|
|
241
|
+
if (index === 1 && child.type === /*#__PURE__*/React.createElement(DatePickerInput.default, child.props).type) {
|
|
242
|
+
return /*#__PURE__*/React.cloneElement(child, {
|
|
246
243
|
datePickerType,
|
|
247
244
|
ref: endInputField,
|
|
248
245
|
readOnly
|
|
249
246
|
});
|
|
250
247
|
}
|
|
251
248
|
if (index === 0) {
|
|
252
|
-
return /*#__PURE__*/
|
|
249
|
+
return /*#__PURE__*/React.cloneElement(child, {
|
|
253
250
|
ref: startInputField,
|
|
254
251
|
readOnly
|
|
255
252
|
});
|
|
256
253
|
}
|
|
257
254
|
if (index === 1) {
|
|
258
|
-
return /*#__PURE__*/
|
|
255
|
+
return /*#__PURE__*/React.cloneElement(child, {
|
|
259
256
|
ref: endInputField,
|
|
260
257
|
readOnly
|
|
261
258
|
});
|
|
262
259
|
}
|
|
263
260
|
});
|
|
261
|
+
React.useEffect(() => {
|
|
262
|
+
initializeWeekdayShorthand();
|
|
263
|
+
}, []);
|
|
264
264
|
React.useEffect(() => {
|
|
265
265
|
if (datePickerType !== 'single' && datePickerType !== 'range') {
|
|
266
266
|
return;
|
|
@@ -293,11 +293,11 @@ const DatePicker = /*#__PURE__*/React__default["default"].forwardRef(function Da
|
|
|
293
293
|
if (typeof locale === 'object') {
|
|
294
294
|
const location = locale.locale ? locale.locale : 'en';
|
|
295
295
|
localeData = {
|
|
296
|
-
...
|
|
296
|
+
...l10n[location],
|
|
297
297
|
...locale
|
|
298
298
|
};
|
|
299
299
|
} else {
|
|
300
|
-
localeData =
|
|
300
|
+
localeData = l10n[locale];
|
|
301
301
|
}
|
|
302
302
|
|
|
303
303
|
/**
|
|
@@ -350,16 +350,15 @@ const DatePicker = /*#__PURE__*/React__default["default"].forwardRef(function Da
|
|
|
350
350
|
minDate: minDate,
|
|
351
351
|
maxDate: maxDate,
|
|
352
352
|
parseDate: parseDate,
|
|
353
|
-
plugins: [datePickerType === 'range' ? rangePlugin
|
|
353
|
+
plugins: [datePickerType === 'range' ? rangePlugin.default({
|
|
354
354
|
input: endInputField.current
|
|
355
355
|
}) : () => {}, appendTo ? appendToPlugin.appendToPlugin({
|
|
356
356
|
appendTo
|
|
357
357
|
}) : () => {}, carbonFlatpickrMonthSelectPlugin({
|
|
358
358
|
selectorFlatpickrMonthYearContainer: '.flatpickr-current-month',
|
|
359
359
|
selectorFlatpickrYearContainer: '.numInputWrapper',
|
|
360
|
-
selectorFlatpickrCurrentMonth: '.cur-month',
|
|
361
360
|
classFlatpickrCurrentMonth: 'cur-month'
|
|
362
|
-
}), fixEventsPlugin
|
|
361
|
+
}), fixEventsPlugin.default({
|
|
363
362
|
inputFrom: startInputField.current,
|
|
364
363
|
inputTo: endInputField.current,
|
|
365
364
|
lastStartValue
|
|
@@ -382,7 +381,7 @@ const DatePicker = /*#__PURE__*/React__default["default"].forwardRef(function Da
|
|
|
382
381
|
},
|
|
383
382
|
onValueUpdate: onHook
|
|
384
383
|
};
|
|
385
|
-
const calendar =
|
|
384
|
+
const calendar = flatpickr(start, flatpickerConfig);
|
|
386
385
|
calendarRef.current = calendar;
|
|
387
386
|
const handleInputFieldKeyDown = event => {
|
|
388
387
|
const {
|
|
@@ -603,28 +602,28 @@ const DatePicker = /*#__PURE__*/React__default["default"].forwardRef(function Da
|
|
|
603
602
|
let fluidError;
|
|
604
603
|
if (isFluid) {
|
|
605
604
|
if (invalid) {
|
|
606
|
-
fluidError = /*#__PURE__*/
|
|
605
|
+
fluidError = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(iconsReact.WarningFilled, {
|
|
607
606
|
className: `${prefix}--date-picker__icon ${prefix}--date-picker__icon--invalid`
|
|
608
|
-
}), /*#__PURE__*/
|
|
607
|
+
}), /*#__PURE__*/React.createElement("hr", {
|
|
609
608
|
className: `${prefix}--date-picker__divider`
|
|
610
|
-
}), /*#__PURE__*/
|
|
609
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
611
610
|
className: `${prefix}--form-requirement`
|
|
612
611
|
}, invalidText));
|
|
613
612
|
}
|
|
614
613
|
if (warn && !invalid) {
|
|
615
|
-
fluidError = /*#__PURE__*/
|
|
614
|
+
fluidError = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(iconsReact.WarningAltFilled, {
|
|
616
615
|
className: `${prefix}--date-picker__icon ${prefix}--date-picker__icon--warn`
|
|
617
|
-
}), /*#__PURE__*/
|
|
616
|
+
}), /*#__PURE__*/React.createElement("hr", {
|
|
618
617
|
className: `${prefix}--date-picker__divider`
|
|
619
|
-
}), /*#__PURE__*/
|
|
618
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
620
619
|
className: `${prefix}--form-requirement`
|
|
621
620
|
}, warnText));
|
|
622
621
|
}
|
|
623
622
|
}
|
|
624
|
-
return /*#__PURE__*/
|
|
623
|
+
return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({
|
|
625
624
|
className: wrapperClasses,
|
|
626
625
|
ref: ref
|
|
627
|
-
}, rest), /*#__PURE__*/
|
|
626
|
+
}, rest), /*#__PURE__*/React.createElement("div", {
|
|
628
627
|
className: datePickerClasses
|
|
629
628
|
}, childrenWithProps), fluidError);
|
|
630
629
|
});
|
|
@@ -633,27 +632,27 @@ DatePicker.propTypes = {
|
|
|
633
632
|
* Flatpickr prop passthrough enables direct date input, and when set to false,
|
|
634
633
|
* we must clear dates manually by resetting the value prop to a falsy value (such as `""`, `null`, or `undefined`) or an array of all falsy values, making it a controlled input.
|
|
635
634
|
*/
|
|
636
|
-
allowInput:
|
|
635
|
+
allowInput: PropTypes.bool,
|
|
637
636
|
/**
|
|
638
637
|
* The DOM element the Flatpicker should be inserted into. `<body>` by default.
|
|
639
638
|
*/
|
|
640
|
-
appendTo:
|
|
639
|
+
appendTo: PropTypes.object,
|
|
641
640
|
/**
|
|
642
641
|
* The child nodes.
|
|
643
642
|
*/
|
|
644
|
-
children:
|
|
643
|
+
children: PropTypes.node,
|
|
645
644
|
/**
|
|
646
645
|
* The CSS class names.
|
|
647
646
|
*/
|
|
648
|
-
className:
|
|
647
|
+
className: PropTypes.string,
|
|
649
648
|
/**
|
|
650
649
|
* flatpickr prop passthrough. Controls whether the calendar dropdown closes upon selection.
|
|
651
650
|
*/
|
|
652
|
-
closeOnSelect:
|
|
651
|
+
closeOnSelect: PropTypes.bool,
|
|
653
652
|
/**
|
|
654
653
|
* The date format.
|
|
655
654
|
*/
|
|
656
|
-
dateFormat:
|
|
655
|
+
dateFormat: PropTypes.string,
|
|
657
656
|
/**
|
|
658
657
|
* The type of the date picker:
|
|
659
658
|
*
|
|
@@ -661,35 +660,35 @@ DatePicker.propTypes = {
|
|
|
661
660
|
* * `single` - With calendar dropdown and single date.
|
|
662
661
|
* * `range` - With calendar dropdown and a date range.
|
|
663
662
|
*/
|
|
664
|
-
datePickerType:
|
|
663
|
+
datePickerType: PropTypes.oneOf(['simple', 'single', 'range']),
|
|
665
664
|
/**
|
|
666
665
|
* The flatpickr `disable` option that allows a user to disable certain dates.
|
|
667
666
|
*/
|
|
668
|
-
disable:
|
|
667
|
+
disable: PropTypes.array,
|
|
669
668
|
/**
|
|
670
669
|
* The flatpickr `enable` option that allows a user to enable certain dates.
|
|
671
670
|
*/
|
|
672
|
-
enable:
|
|
671
|
+
enable: PropTypes.array,
|
|
673
672
|
/**
|
|
674
673
|
* The flatpickr `inline` option.
|
|
675
674
|
*/
|
|
676
|
-
inline:
|
|
675
|
+
inline: PropTypes.bool,
|
|
677
676
|
/**
|
|
678
677
|
* Specify whether or not the control is invalid (Fluid only)
|
|
679
678
|
*/
|
|
680
|
-
invalid:
|
|
679
|
+
invalid: PropTypes.bool,
|
|
681
680
|
/**
|
|
682
681
|
* Provide the text that is displayed when the control is in error state (Fluid Only)
|
|
683
682
|
*/
|
|
684
|
-
invalidText:
|
|
683
|
+
invalidText: PropTypes.node,
|
|
685
684
|
/**
|
|
686
685
|
* `true` to use the light version.
|
|
687
686
|
*/
|
|
688
|
-
light: deprecate.deprecate(
|
|
687
|
+
light: deprecate.deprecate(PropTypes.bool, 'The `light` prop for `DatePicker` has ' + 'been deprecated in favor of the new `Layer` component. It will be removed in the next major release.'),
|
|
689
688
|
/**
|
|
690
689
|
* The language locale used to format the days of the week, months, and numbers. The full list of supported locales can be found here https://github.com/flatpickr/flatpickr/tree/master/src/l10n
|
|
691
690
|
*/
|
|
692
|
-
locale:
|
|
691
|
+
locale: PropTypes.oneOfType([PropTypes.object, PropTypes.oneOf(['ar',
|
|
693
692
|
// Arabic
|
|
694
693
|
'at',
|
|
695
694
|
// Austria
|
|
@@ -814,53 +813,53 @@ DatePicker.propTypes = {
|
|
|
814
813
|
/**
|
|
815
814
|
* The maximum date that a user can pick to.
|
|
816
815
|
*/
|
|
817
|
-
maxDate:
|
|
816
|
+
maxDate: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
818
817
|
/**
|
|
819
818
|
* The minimum date that a user can start picking from.
|
|
820
819
|
*/
|
|
821
|
-
minDate:
|
|
820
|
+
minDate: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
822
821
|
/**
|
|
823
822
|
* The `change` event handler.
|
|
824
823
|
* `(dates: Date[], dStr: string, fp: Instance, data?: any):void;`
|
|
825
824
|
*/
|
|
826
|
-
onChange:
|
|
825
|
+
onChange: PropTypes.func,
|
|
827
826
|
/**
|
|
828
827
|
* The `close` event handler.
|
|
829
828
|
* `(dates: Date[], dStr: string, fp: Instance, data?: any):void;`
|
|
830
829
|
*/
|
|
831
|
-
onClose:
|
|
830
|
+
onClose: PropTypes.func,
|
|
832
831
|
/**
|
|
833
832
|
* The `open` event handler.
|
|
834
833
|
* `(dates: Date[], dStr: string, fp: Instance, data?: any):void;`
|
|
835
834
|
*/
|
|
836
|
-
onOpen:
|
|
835
|
+
onOpen: PropTypes.func,
|
|
837
836
|
/**
|
|
838
837
|
* flatpickr prop passthrough. Controls how dates are parsed.
|
|
839
838
|
*/
|
|
840
|
-
parseDate:
|
|
839
|
+
parseDate: PropTypes.func,
|
|
841
840
|
/**
|
|
842
841
|
* whether the DatePicker is to be readOnly
|
|
843
842
|
* if boolean applies to all inputs
|
|
844
843
|
* if array applies to each input in order
|
|
845
844
|
*/
|
|
846
|
-
readOnly:
|
|
845
|
+
readOnly: PropTypes.oneOfType([PropTypes.bool, PropTypes.array]),
|
|
847
846
|
/**
|
|
848
847
|
* `true` to use the short version.
|
|
849
848
|
*/
|
|
850
|
-
short:
|
|
849
|
+
short: PropTypes.bool,
|
|
851
850
|
/**
|
|
852
851
|
* The value of the date value provided to flatpickr, could
|
|
853
852
|
* be a date, a date number, a date string, an array of dates.
|
|
854
853
|
*/
|
|
855
|
-
value:
|
|
854
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object])), PropTypes.object, PropTypes.number]),
|
|
856
855
|
/**
|
|
857
856
|
* Specify whether the control is currently in warning state (Fluid only)
|
|
858
857
|
*/
|
|
859
|
-
warn:
|
|
858
|
+
warn: PropTypes.bool,
|
|
860
859
|
/**
|
|
861
860
|
* Provide the text that is displayed when the control is in warning state (Fluid only)
|
|
862
861
|
*/
|
|
863
|
-
warnText:
|
|
862
|
+
warnText: PropTypes.node
|
|
864
863
|
};
|
|
865
864
|
|
|
866
|
-
exports
|
|
865
|
+
exports.default = DatePicker;
|
|
@@ -14,6 +14,6 @@ var DatePicker_Skeleton = require('./DatePicker.Skeleton.js');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.DatePicker = DatePicker
|
|
18
|
-
exports
|
|
19
|
-
exports.DatePickerSkeleton = DatePicker_Skeleton
|
|
17
|
+
exports.DatePicker = DatePicker.default;
|
|
18
|
+
exports.default = DatePicker.default;
|
|
19
|
+
exports.DatePickerSkeleton = DatePicker_Skeleton.default;
|
|
@@ -11,10 +11,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
11
11
|
|
|
12
12
|
var rangePlugin = require('flatpickr/dist/plugins/rangePlugin');
|
|
13
13
|
|
|
14
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
|
-
|
|
16
|
-
var rangePlugin__default = /*#__PURE__*/_interopDefaultLegacy(rangePlugin);
|
|
17
|
-
|
|
18
14
|
/**
|
|
19
15
|
* @param {object} config Plugin configuration.
|
|
20
16
|
* @returns {Plugin} An extension of Flatpickr `rangePlugin` that does the following:
|
|
@@ -23,7 +19,7 @@ var rangePlugin__default = /*#__PURE__*/_interopDefaultLegacy(rangePlugin);
|
|
|
23
19
|
* * A logic to ensure `fp.setDate()` call won't end up with "startDate to endDate" set to the first `<input>`
|
|
24
20
|
*/
|
|
25
21
|
var carbonFlatpickrRangePlugin = config => {
|
|
26
|
-
const factory =
|
|
22
|
+
const factory = rangePlugin(Object.assign({
|
|
27
23
|
position: 'left'
|
|
28
24
|
}, config));
|
|
29
25
|
return fp => {
|
|
@@ -59,4 +55,4 @@ var carbonFlatpickrRangePlugin = config => {
|
|
|
59
55
|
};
|
|
60
56
|
};
|
|
61
57
|
|
|
62
|
-
exports
|
|
58
|
+
exports.default = carbonFlatpickrRangePlugin;
|