@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
|
@@ -23,13 +23,7 @@ require('../Text/index.js');
|
|
|
23
23
|
var useId = require('../../internal/useId.js');
|
|
24
24
|
var Text = require('../Text/Text.js');
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
29
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
30
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
31
|
-
|
|
32
|
-
const FileUploader = /*#__PURE__*/React__default["default"].forwardRef(({
|
|
26
|
+
const FileUploader = /*#__PURE__*/React.forwardRef(({
|
|
33
27
|
accept,
|
|
34
28
|
buttonKind,
|
|
35
29
|
buttonLabel,
|
|
@@ -87,28 +81,28 @@ const FileUploader = /*#__PURE__*/React__default["default"].forwardRef(({
|
|
|
87
81
|
});
|
|
88
82
|
}
|
|
89
83
|
}));
|
|
90
|
-
const uploaderButton = /*#__PURE__*/
|
|
91
|
-
const classes =
|
|
84
|
+
const uploaderButton = /*#__PURE__*/React.createRef();
|
|
85
|
+
const classes = cx({
|
|
92
86
|
[`${prefix}--form-item`]: true,
|
|
93
87
|
[className]: className
|
|
94
88
|
});
|
|
95
|
-
const getHelperLabelClasses = baseClass =>
|
|
89
|
+
const getHelperLabelClasses = baseClass => cx(baseClass, {
|
|
96
90
|
[`${prefix}--label-description--disabled`]: disabled
|
|
97
91
|
});
|
|
98
|
-
const selectedFileClasses =
|
|
92
|
+
const selectedFileClasses = cx(`${prefix}--file__selected-file`, {
|
|
99
93
|
[`${prefix}--file__selected-file--md`]: size === 'field' || size === 'md',
|
|
100
94
|
[`${prefix}--file__selected-file--sm`]: size === 'small' || size === 'sm'
|
|
101
95
|
});
|
|
102
|
-
return /*#__PURE__*/
|
|
96
|
+
return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({
|
|
103
97
|
className: classes
|
|
104
|
-
}, other), !labelTitle ? null : /*#__PURE__*/
|
|
98
|
+
}, other), !labelTitle ? null : /*#__PURE__*/React.createElement(Text.Text, {
|
|
105
99
|
as: "h3",
|
|
106
100
|
className: getHelperLabelClasses(`${prefix}--file--label`)
|
|
107
|
-
}, labelTitle), /*#__PURE__*/
|
|
101
|
+
}, labelTitle), /*#__PURE__*/React.createElement(Text.Text, {
|
|
108
102
|
as: "p",
|
|
109
103
|
className: getHelperLabelClasses(`${prefix}--label-description`),
|
|
110
104
|
id: fileUploaderInstanceId
|
|
111
|
-
}, labelDescription), /*#__PURE__*/
|
|
105
|
+
}, labelDescription), /*#__PURE__*/React.createElement(FileUploaderButton.default, {
|
|
112
106
|
innerRef: uploaderButton,
|
|
113
107
|
disabled: disabled,
|
|
114
108
|
labelText: buttonLabel,
|
|
@@ -120,21 +114,21 @@ const FileUploader = /*#__PURE__*/React__default["default"].forwardRef(({
|
|
|
120
114
|
name: name,
|
|
121
115
|
size: size,
|
|
122
116
|
"aria-describedby": fileUploaderInstanceId
|
|
123
|
-
}), /*#__PURE__*/
|
|
117
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
124
118
|
className: `${prefix}--file-container`
|
|
125
|
-
}, state.fileNames.length === 0 ? null : state.fileNames.map((name, index) => /*#__PURE__*/
|
|
119
|
+
}, state.fileNames.length === 0 ? null : state.fileNames.map((name, index) => /*#__PURE__*/React.createElement("span", _rollupPluginBabelHelpers.extends({
|
|
126
120
|
key: index,
|
|
127
121
|
className: selectedFileClasses,
|
|
128
122
|
ref: node => {
|
|
129
123
|
nodes[index] = node;
|
|
130
124
|
} // eslint-disable-line
|
|
131
|
-
}, other), /*#__PURE__*/
|
|
125
|
+
}, other), /*#__PURE__*/React.createElement(Text.Text, {
|
|
132
126
|
as: "p",
|
|
133
127
|
className: `${prefix}--file-filename`,
|
|
134
128
|
id: name
|
|
135
|
-
}, name), /*#__PURE__*/
|
|
129
|
+
}, name), /*#__PURE__*/React.createElement("span", {
|
|
136
130
|
className: `${prefix}--file__state-container`
|
|
137
|
-
}, /*#__PURE__*/
|
|
131
|
+
}, /*#__PURE__*/React.createElement(Filename.default, {
|
|
138
132
|
name: name,
|
|
139
133
|
iconDescription: iconDescription,
|
|
140
134
|
status: filenameStatus,
|
|
@@ -156,68 +150,68 @@ FileUploader.propTypes = {
|
|
|
156
150
|
/**
|
|
157
151
|
* Specify the types of files that this input should be able to receive
|
|
158
152
|
*/
|
|
159
|
-
accept:
|
|
153
|
+
accept: PropTypes.arrayOf(PropTypes.string),
|
|
160
154
|
/**
|
|
161
155
|
* Specify the type of the `<FileUploaderButton>`
|
|
162
156
|
*/
|
|
163
|
-
buttonKind:
|
|
157
|
+
buttonKind: PropTypes.oneOf(Button.ButtonKinds),
|
|
164
158
|
/**
|
|
165
159
|
* Provide the label text to be read by screen readers when interacting with
|
|
166
160
|
* the `<FileUploaderButton>`
|
|
167
161
|
*/
|
|
168
|
-
buttonLabel:
|
|
162
|
+
buttonLabel: PropTypes.string,
|
|
169
163
|
/**
|
|
170
164
|
* Provide a custom className to be applied to the container node
|
|
171
165
|
*/
|
|
172
|
-
className:
|
|
166
|
+
className: PropTypes.string,
|
|
173
167
|
/**
|
|
174
168
|
* Specify whether file input is disabled
|
|
175
169
|
*/
|
|
176
|
-
disabled:
|
|
170
|
+
disabled: PropTypes.bool,
|
|
177
171
|
/**
|
|
178
172
|
* Specify the status of the File Upload
|
|
179
173
|
*/
|
|
180
|
-
filenameStatus:
|
|
174
|
+
filenameStatus: PropTypes.oneOf(['edit', 'complete', 'uploading']).isRequired,
|
|
181
175
|
/**
|
|
182
176
|
* Provide a description for the complete/close icon that can be read by screen readers
|
|
183
177
|
*/
|
|
184
|
-
iconDescription:
|
|
178
|
+
iconDescription: PropTypes.string,
|
|
185
179
|
/**
|
|
186
180
|
* Specify the description text of this `<FileUploader>`
|
|
187
181
|
*/
|
|
188
|
-
labelDescription:
|
|
182
|
+
labelDescription: PropTypes.string,
|
|
189
183
|
/**
|
|
190
184
|
* Specify the title text of this `<FileUploader>`
|
|
191
185
|
*/
|
|
192
|
-
labelTitle:
|
|
186
|
+
labelTitle: PropTypes.string,
|
|
193
187
|
/**
|
|
194
188
|
* Specify if the component should accept multiple files to upload
|
|
195
189
|
*/
|
|
196
|
-
multiple:
|
|
190
|
+
multiple: PropTypes.bool,
|
|
197
191
|
/**
|
|
198
192
|
* Provide a name for the underlying `<input>` node
|
|
199
193
|
*/
|
|
200
|
-
name:
|
|
194
|
+
name: PropTypes.string,
|
|
201
195
|
/**
|
|
202
196
|
* Provide an optional `onChange` hook that is called each time the input is
|
|
203
197
|
* changed
|
|
204
198
|
*/
|
|
205
|
-
onChange:
|
|
199
|
+
onChange: PropTypes.func,
|
|
206
200
|
/**
|
|
207
201
|
* Provide an optional `onClick` hook that is called each time the
|
|
208
202
|
* FileUploader is clicked
|
|
209
203
|
*/
|
|
210
|
-
onClick:
|
|
204
|
+
onClick: PropTypes.func,
|
|
211
205
|
/**
|
|
212
206
|
* Provide an optional `onDelete` hook that is called when an uploaded item
|
|
213
207
|
* is removed
|
|
214
208
|
*/
|
|
215
|
-
onDelete:
|
|
209
|
+
onDelete: PropTypes.func,
|
|
216
210
|
/**
|
|
217
211
|
* Specify the size of the FileUploaderButton, from a list of available
|
|
218
212
|
* sizes.
|
|
219
213
|
*/
|
|
220
|
-
size:
|
|
214
|
+
size: PropTypes.oneOf(['sm', 'md', 'lg'])
|
|
221
215
|
};
|
|
222
216
|
|
|
223
|
-
exports
|
|
217
|
+
exports.default = FileUploader;
|
|
@@ -22,12 +22,6 @@ var noopFn = require('../../internal/noopFn.js');
|
|
|
22
22
|
var Button = require('../Button/Button.js');
|
|
23
23
|
require('../Button/Button.Skeleton.js');
|
|
24
24
|
|
|
25
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
26
|
-
|
|
27
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
28
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
29
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
30
|
-
|
|
31
25
|
function FileUploaderButton({
|
|
32
26
|
accept,
|
|
33
27
|
buttonKind = 'primary',
|
|
@@ -51,7 +45,7 @@ function FileUploaderButton({
|
|
|
51
45
|
current: inputId
|
|
52
46
|
} = React.useRef(id || useId.useId());
|
|
53
47
|
const inputNode = React.useRef(null);
|
|
54
|
-
const classes =
|
|
48
|
+
const classes = cx(`${prefix}--btn`, className, {
|
|
55
49
|
[`${prefix}--btn--${buttonKind}`]: buttonKind,
|
|
56
50
|
[`${prefix}--btn--disabled`]: disabled,
|
|
57
51
|
// V11: remove field, small
|
|
@@ -90,7 +84,7 @@ function FileUploaderButton({
|
|
|
90
84
|
}
|
|
91
85
|
onChange(event);
|
|
92
86
|
}
|
|
93
|
-
return /*#__PURE__*/
|
|
87
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("button", _rollupPluginBabelHelpers.extends({
|
|
94
88
|
type: "button",
|
|
95
89
|
disabled: disabled,
|
|
96
90
|
className: classes,
|
|
@@ -98,11 +92,11 @@ function FileUploaderButton({
|
|
|
98
92
|
onKeyDown: onKeyDown
|
|
99
93
|
}, other, {
|
|
100
94
|
tabIndex: other.tabIndex !== undefined ? parseInt(other.tabIndex) : undefined
|
|
101
|
-
}), labelText), /*#__PURE__*/
|
|
95
|
+
}), labelText), /*#__PURE__*/React.createElement("label", {
|
|
102
96
|
className: `${prefix}--visually-hidden`,
|
|
103
97
|
ref: innerRef,
|
|
104
98
|
htmlFor: inputId
|
|
105
|
-
}, /*#__PURE__*/
|
|
99
|
+
}, /*#__PURE__*/React.createElement("span", null, labelText)), /*#__PURE__*/React.createElement("input", {
|
|
106
100
|
className: `${prefix}--visually-hidden`,
|
|
107
101
|
ref: inputNode,
|
|
108
102
|
id: inputId,
|
|
@@ -119,64 +113,64 @@ FileUploaderButton.propTypes = {
|
|
|
119
113
|
/**
|
|
120
114
|
* Specify the types of files that this input should be able to receive
|
|
121
115
|
*/
|
|
122
|
-
accept:
|
|
116
|
+
accept: PropTypes.arrayOf(PropTypes.string),
|
|
123
117
|
/**
|
|
124
118
|
* Specify the type of underlying button
|
|
125
119
|
*/
|
|
126
|
-
buttonKind:
|
|
120
|
+
buttonKind: PropTypes.oneOf(Button.ButtonKinds),
|
|
127
121
|
/**
|
|
128
122
|
* Provide a custom className to be applied to the container node
|
|
129
123
|
*/
|
|
130
|
-
className:
|
|
124
|
+
className: PropTypes.string,
|
|
131
125
|
/**
|
|
132
126
|
* Specify whether you want to disable any updates to the FileUploaderButton
|
|
133
127
|
* label
|
|
134
128
|
*/
|
|
135
|
-
disableLabelChanges:
|
|
129
|
+
disableLabelChanges: PropTypes.bool,
|
|
136
130
|
/**
|
|
137
131
|
* Specify whether file input is disabled
|
|
138
132
|
*/
|
|
139
|
-
disabled:
|
|
133
|
+
disabled: PropTypes.bool,
|
|
140
134
|
/**
|
|
141
135
|
* Provide a unique id for the underlying `<input>` node
|
|
142
136
|
*/
|
|
143
|
-
id:
|
|
137
|
+
id: PropTypes.string,
|
|
144
138
|
/**
|
|
145
139
|
* Provide the label text to be read by screen readers when interacting with
|
|
146
140
|
* this control
|
|
147
141
|
*/
|
|
148
|
-
labelText:
|
|
142
|
+
labelText: PropTypes.node,
|
|
149
143
|
/**
|
|
150
144
|
* Specify if the component should accept multiple files to upload
|
|
151
145
|
*/
|
|
152
|
-
multiple:
|
|
146
|
+
multiple: PropTypes.bool,
|
|
153
147
|
/**
|
|
154
148
|
* Provide a name for the underlying `<input>` node
|
|
155
149
|
*/
|
|
156
|
-
name:
|
|
150
|
+
name: PropTypes.string,
|
|
157
151
|
/**
|
|
158
152
|
* Provide an optional `onChange` hook that is called each time the `<input>`
|
|
159
153
|
* value changes
|
|
160
154
|
*/
|
|
161
|
-
onChange:
|
|
155
|
+
onChange: PropTypes.func,
|
|
162
156
|
/**
|
|
163
157
|
* Provide an optional `onClick` hook that is called each time the button is
|
|
164
158
|
* clicked
|
|
165
159
|
*/
|
|
166
|
-
onClick:
|
|
160
|
+
onClick: PropTypes.func,
|
|
167
161
|
/**
|
|
168
162
|
* Provide an accessibility role for the `<FileUploaderButton>`
|
|
169
163
|
*/
|
|
170
|
-
role:
|
|
164
|
+
role: PropTypes.string,
|
|
171
165
|
/**
|
|
172
166
|
* Specify the size of the FileUploaderButton, from a list of available
|
|
173
167
|
* sizes.
|
|
174
168
|
*/
|
|
175
|
-
size:
|
|
169
|
+
size: PropTypes.oneOf(['sm', 'md', 'lg']),
|
|
176
170
|
/**
|
|
177
171
|
* Provide a custom tabIndex value for the `<FileUploaderButton>`
|
|
178
172
|
*/
|
|
179
|
-
tabIndex: deprecate.deprecate(
|
|
173
|
+
tabIndex: deprecate.deprecate(PropTypes.number, 'The `tabIndex` prop for `FileUploaderButton` has ' + 'been deprecated since it now renders a button element by default.')
|
|
180
174
|
};
|
|
181
175
|
|
|
182
|
-
exports
|
|
176
|
+
exports.default = FileUploaderButton;
|
|
@@ -21,12 +21,6 @@ var events = require('../../tools/events.js');
|
|
|
21
21
|
var deprecate = require('../../prop-types/deprecate.js');
|
|
22
22
|
var noopFn = require('../../internal/noopFn.js');
|
|
23
23
|
|
|
24
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
25
|
-
|
|
26
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
27
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
28
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
29
|
-
|
|
30
24
|
function FileUploaderDropContainer({
|
|
31
25
|
accept = [],
|
|
32
26
|
className,
|
|
@@ -48,7 +42,7 @@ function FileUploaderDropContainer({
|
|
|
48
42
|
current: uid
|
|
49
43
|
} = React.useRef(id || useId.useId());
|
|
50
44
|
const [isActive, setActive] = React.useState(false);
|
|
51
|
-
const dropareaClasses =
|
|
45
|
+
const dropareaClasses = cx(`${prefix}--file__drop-container`, `${prefix}--file-browse-btn`, {
|
|
52
46
|
[`${prefix}--file__drop-container--drag-over`]: isActive,
|
|
53
47
|
[`${prefix}--file-browse-btn--disabled`]: disabled
|
|
54
48
|
}, className);
|
|
@@ -99,7 +93,7 @@ function FileUploaderDropContainer({
|
|
|
99
93
|
inputRef.current?.click();
|
|
100
94
|
}
|
|
101
95
|
};
|
|
102
|
-
return /*#__PURE__*/
|
|
96
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
103
97
|
className: `${prefix}--file`,
|
|
104
98
|
onDragOver: evt => {
|
|
105
99
|
evt.stopPropagation();
|
|
@@ -128,7 +122,7 @@ function FileUploaderDropContainer({
|
|
|
128
122
|
setActive(false);
|
|
129
123
|
handleDrop(evt);
|
|
130
124
|
}
|
|
131
|
-
}, /*#__PURE__*/
|
|
125
|
+
}, /*#__PURE__*/React.createElement("button", _rollupPluginBabelHelpers.extends({
|
|
132
126
|
type: "button",
|
|
133
127
|
className: dropareaClasses,
|
|
134
128
|
ref: innerRef,
|
|
@@ -139,10 +133,10 @@ function FileUploaderDropContainer({
|
|
|
139
133
|
}
|
|
140
134
|
},
|
|
141
135
|
onClick: events.composeEventHandlers([onClick, handleClick])
|
|
142
|
-
}, rest), labelText), /*#__PURE__*/
|
|
136
|
+
}, rest), labelText), /*#__PURE__*/React.createElement("label", {
|
|
143
137
|
htmlFor: uid,
|
|
144
138
|
className: `${prefix}--visually-hidden`
|
|
145
|
-
}, labelText), /*#__PURE__*/
|
|
139
|
+
}, labelText), /*#__PURE__*/React.createElement("input", {
|
|
146
140
|
type: "file",
|
|
147
141
|
id: uid,
|
|
148
142
|
className: `${prefix}--file-input`,
|
|
@@ -162,54 +156,54 @@ FileUploaderDropContainer.propTypes = {
|
|
|
162
156
|
/**
|
|
163
157
|
* Specify the types of files that this input should be able to receive
|
|
164
158
|
*/
|
|
165
|
-
accept:
|
|
159
|
+
accept: PropTypes.arrayOf(PropTypes.string),
|
|
166
160
|
/**
|
|
167
161
|
* Provide a custom className to be applied to the container node
|
|
168
162
|
*/
|
|
169
|
-
className:
|
|
163
|
+
className: PropTypes.string,
|
|
170
164
|
/**
|
|
171
165
|
* Specify whether file input is disabled
|
|
172
166
|
*/
|
|
173
|
-
disabled:
|
|
167
|
+
disabled: PropTypes.bool,
|
|
174
168
|
/**
|
|
175
169
|
* Provide a unique id for the underlying `<input>` node
|
|
176
170
|
*/
|
|
177
|
-
id:
|
|
171
|
+
id: PropTypes.string,
|
|
178
172
|
/**
|
|
179
173
|
* Provide the label text to be read by screen readers when interacting with
|
|
180
174
|
* this control
|
|
181
175
|
*/
|
|
182
|
-
labelText:
|
|
176
|
+
labelText: PropTypes.string.isRequired,
|
|
183
177
|
/**
|
|
184
178
|
* Specify if the component should accept multiple files to upload
|
|
185
179
|
*/
|
|
186
|
-
multiple:
|
|
180
|
+
multiple: PropTypes.bool,
|
|
187
181
|
/**
|
|
188
182
|
* Provide a name for the underlying `<input>` node
|
|
189
183
|
*/
|
|
190
|
-
name:
|
|
184
|
+
name: PropTypes.string,
|
|
191
185
|
/**
|
|
192
186
|
* Event handler that is called after files are added to the uploader
|
|
193
187
|
* The event handler signature looks like `onAddFiles(evt, { addedFiles })`
|
|
194
188
|
*/
|
|
195
|
-
onAddFiles:
|
|
189
|
+
onAddFiles: PropTypes.func,
|
|
196
190
|
/**
|
|
197
191
|
* Provide an optional function to be called when the button element
|
|
198
192
|
* is clicked
|
|
199
193
|
*/
|
|
200
|
-
onClick:
|
|
194
|
+
onClick: PropTypes.func,
|
|
201
195
|
/**
|
|
202
196
|
* Provide a custom regex pattern for the acceptedTypes
|
|
203
197
|
*/
|
|
204
|
-
pattern:
|
|
198
|
+
pattern: PropTypes.string,
|
|
205
199
|
/**
|
|
206
200
|
* Provide an accessibility role for the `<FileUploaderButton>`
|
|
207
201
|
*/
|
|
208
|
-
role: deprecate.deprecate(
|
|
202
|
+
role: deprecate.deprecate(PropTypes.number, 'The `role` prop for `FileUploaderButton` has ' + 'been deprecated since it now renders a button element by default, and has an implicit role of button.'),
|
|
209
203
|
/**
|
|
210
204
|
* Provide a custom tabIndex value for the `<FileUploaderButton>`
|
|
211
205
|
*/
|
|
212
|
-
tabIndex: deprecate.deprecate(
|
|
206
|
+
tabIndex: deprecate.deprecate(PropTypes.number, 'The `tabIndex` prop for `FileUploaderButton` has ' + 'been deprecated since it now renders a button element by default.')
|
|
213
207
|
};
|
|
214
208
|
|
|
215
|
-
exports
|
|
209
|
+
exports.default = FileUploaderDropContainer;
|
|
@@ -24,12 +24,6 @@ require('../Tooltip/DefinitionTooltip.js');
|
|
|
24
24
|
var Tooltip = require('../Tooltip/Tooltip.js');
|
|
25
25
|
var Text = require('../Text/Text.js');
|
|
26
26
|
|
|
27
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
28
|
-
|
|
29
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
30
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
31
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
32
|
-
|
|
33
27
|
function FileUploaderItem({
|
|
34
28
|
uuid,
|
|
35
29
|
name,
|
|
@@ -49,7 +43,7 @@ function FileUploaderItem({
|
|
|
49
43
|
const {
|
|
50
44
|
current: id
|
|
51
45
|
} = React.useRef(uuid || useId.useId());
|
|
52
|
-
const classes =
|
|
46
|
+
const classes = cx(`${prefix}--file__selected-file`, className, {
|
|
53
47
|
[`${prefix}--file__selected-file--invalid`]: invalid,
|
|
54
48
|
[`${prefix}--file__selected-file--md`]: size === 'md',
|
|
55
49
|
[`${prefix}--file__selected-file--sm`]: size === 'sm'
|
|
@@ -65,34 +59,34 @@ function FileUploaderItem({
|
|
|
65
59
|
React.useLayoutEffect(() => {
|
|
66
60
|
isEllipsisActive(textRef.current);
|
|
67
61
|
}, [prefix, name]);
|
|
68
|
-
return /*#__PURE__*/
|
|
62
|
+
return /*#__PURE__*/React.createElement("span", _rollupPluginBabelHelpers.extends({
|
|
69
63
|
className: classes
|
|
70
|
-
}, other), isEllipsisApplied ? /*#__PURE__*/
|
|
64
|
+
}, other), isEllipsisApplied ? /*#__PURE__*/React.createElement("div", {
|
|
71
65
|
className: isInvalid
|
|
72
|
-
}, /*#__PURE__*/
|
|
66
|
+
}, /*#__PURE__*/React.createElement(Tooltip.Tooltip, {
|
|
73
67
|
label: name,
|
|
74
68
|
align: "bottom",
|
|
75
69
|
className: `${prefix}--file-filename-tooltip`
|
|
76
|
-
}, /*#__PURE__*/
|
|
70
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
77
71
|
className: `${prefix}--file-filename-button`,
|
|
78
72
|
type: "button"
|
|
79
|
-
}, /*#__PURE__*/
|
|
73
|
+
}, /*#__PURE__*/React.createElement(Text.Text, {
|
|
80
74
|
ref: textRef,
|
|
81
75
|
as: "p",
|
|
82
76
|
title: name,
|
|
83
77
|
className: `${prefix}--file-filename-button`,
|
|
84
78
|
id: filterSpaceName(name)
|
|
85
|
-
}, name)))) : /*#__PURE__*/
|
|
79
|
+
}, name)))) : /*#__PURE__*/React.createElement(Text.Text, {
|
|
86
80
|
ref: textRef,
|
|
87
81
|
as: "p",
|
|
88
82
|
title: name,
|
|
89
83
|
className: `${prefix}--file-filename`,
|
|
90
84
|
id: filterSpaceName(name)
|
|
91
|
-
}, name), /*#__PURE__*/
|
|
85
|
+
}, name), /*#__PURE__*/React.createElement("div", {
|
|
92
86
|
className: `${prefix}--file-container-item`
|
|
93
|
-
}, /*#__PURE__*/
|
|
87
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
94
88
|
className: `${prefix}--file__state-container`
|
|
95
|
-
}, /*#__PURE__*/
|
|
89
|
+
}, /*#__PURE__*/React.createElement(Filename.default, {
|
|
96
90
|
name: name,
|
|
97
91
|
iconDescription: iconDescription,
|
|
98
92
|
status: status,
|
|
@@ -115,14 +109,14 @@ function FileUploaderItem({
|
|
|
115
109
|
});
|
|
116
110
|
}
|
|
117
111
|
}
|
|
118
|
-
}))), invalid && errorSubject && /*#__PURE__*/
|
|
112
|
+
}))), invalid && errorSubject && /*#__PURE__*/React.createElement("div", {
|
|
119
113
|
className: `${prefix}--form-requirement`,
|
|
120
114
|
role: "alert",
|
|
121
115
|
id: `${filterSpaceName(name)}-id-error`
|
|
122
|
-
}, /*#__PURE__*/
|
|
116
|
+
}, /*#__PURE__*/React.createElement(Text.Text, {
|
|
123
117
|
as: "div",
|
|
124
118
|
className: `${prefix}--form-requirement__title`
|
|
125
|
-
}, errorSubject), errorBody && /*#__PURE__*/
|
|
119
|
+
}, errorSubject), errorBody && /*#__PURE__*/React.createElement(Text.Text, {
|
|
126
120
|
as: "p",
|
|
127
121
|
className: `${prefix}--form-requirement__supplement`
|
|
128
122
|
}, errorBody)));
|
|
@@ -131,41 +125,41 @@ FileUploaderItem.propTypes = {
|
|
|
131
125
|
/**
|
|
132
126
|
* Error message body for an invalid file upload
|
|
133
127
|
*/
|
|
134
|
-
errorBody:
|
|
128
|
+
errorBody: PropTypes.string,
|
|
135
129
|
/**
|
|
136
130
|
* Error message subject for an invalid file upload
|
|
137
131
|
*/
|
|
138
|
-
errorSubject:
|
|
132
|
+
errorSubject: PropTypes.string,
|
|
139
133
|
/**
|
|
140
134
|
* Description of status icon (displayed in native tooltip)
|
|
141
135
|
*/
|
|
142
|
-
iconDescription:
|
|
136
|
+
iconDescription: PropTypes.string,
|
|
143
137
|
/**
|
|
144
138
|
* Specify if the currently uploaded file is invalid
|
|
145
139
|
*/
|
|
146
|
-
invalid:
|
|
140
|
+
invalid: PropTypes.bool,
|
|
147
141
|
/**
|
|
148
142
|
* Name of the uploaded file
|
|
149
143
|
*/
|
|
150
|
-
name:
|
|
144
|
+
name: PropTypes.string,
|
|
151
145
|
/**
|
|
152
146
|
* Event handler that is called after removing a file from the file uploader
|
|
153
147
|
* The event handler signature looks like `onDelete(evt, { uuid })`
|
|
154
148
|
*/
|
|
155
|
-
onDelete:
|
|
149
|
+
onDelete: PropTypes.func,
|
|
156
150
|
/**
|
|
157
151
|
* Specify the size of the FileUploaderButton, from a list of available
|
|
158
152
|
* sizes.
|
|
159
153
|
*/
|
|
160
|
-
size:
|
|
154
|
+
size: PropTypes.oneOf(['sm', 'md', 'lg']),
|
|
161
155
|
/**
|
|
162
156
|
* Status of the file upload
|
|
163
157
|
*/
|
|
164
|
-
status:
|
|
158
|
+
status: PropTypes.oneOf(['uploading', 'edit', 'complete']),
|
|
165
159
|
/**
|
|
166
160
|
* Unique identifier for the file object
|
|
167
161
|
*/
|
|
168
|
-
uuid:
|
|
162
|
+
uuid: PropTypes.string
|
|
169
163
|
};
|
|
170
164
|
|
|
171
|
-
exports
|
|
165
|
+
exports.default = FileUploaderItem;
|
|
@@ -16,11 +16,6 @@ var React = require('react');
|
|
|
16
16
|
var Loading = require('../Loading/Loading.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 PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
22
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
23
|
-
|
|
24
19
|
var _Close;
|
|
25
20
|
function Filename({
|
|
26
21
|
iconDescription = 'Uploading file',
|
|
@@ -34,30 +29,30 @@ function Filename({
|
|
|
34
29
|
const prefix = usePrefix.usePrefix();
|
|
35
30
|
switch (status) {
|
|
36
31
|
case 'uploading':
|
|
37
|
-
return /*#__PURE__*/
|
|
32
|
+
return /*#__PURE__*/React.createElement(Loading.default, {
|
|
38
33
|
description: iconDescription,
|
|
39
34
|
small: true,
|
|
40
35
|
withOverlay: false,
|
|
41
36
|
className: `${prefix}--file-loading`
|
|
42
37
|
});
|
|
43
38
|
case 'edit':
|
|
44
|
-
return /*#__PURE__*/
|
|
39
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, invalid && /*#__PURE__*/React.createElement(iconsReact.WarningFilled, {
|
|
45
40
|
className: `${prefix}--file-invalid`
|
|
46
|
-
}), /*#__PURE__*/
|
|
41
|
+
}), /*#__PURE__*/React.createElement("button", _rollupPluginBabelHelpers.extends({
|
|
47
42
|
"aria-label": `${iconDescription} - ${name}`,
|
|
48
43
|
className: `${prefix}--file-close`,
|
|
49
44
|
type: "button",
|
|
50
45
|
tabIndex: tabIndex
|
|
51
46
|
}, rest, {
|
|
52
47
|
"aria-describedby": invalid ? ariaDescribedBy : undefined
|
|
53
|
-
}), _Close || (_Close = /*#__PURE__*/
|
|
48
|
+
}), _Close || (_Close = /*#__PURE__*/React.createElement(iconsReact.Close, null))));
|
|
54
49
|
case 'complete':
|
|
55
|
-
return /*#__PURE__*/
|
|
50
|
+
return /*#__PURE__*/React.createElement(iconsReact.CheckmarkFilled, _rollupPluginBabelHelpers.extends({
|
|
56
51
|
"aria-label": iconDescription,
|
|
57
52
|
className: `${prefix}--file-complete`
|
|
58
53
|
}, rest, {
|
|
59
54
|
tabIndex: -1
|
|
60
|
-
}), iconDescription && /*#__PURE__*/
|
|
55
|
+
}), iconDescription && /*#__PURE__*/React.createElement("title", null, iconDescription));
|
|
61
56
|
default:
|
|
62
57
|
return null;
|
|
63
58
|
}
|
|
@@ -66,27 +61,27 @@ Filename.propTypes = {
|
|
|
66
61
|
/**
|
|
67
62
|
* Specify an id that describes the error to be read by screen readers when the filename is invalid
|
|
68
63
|
*/
|
|
69
|
-
['aria-describedby']:
|
|
64
|
+
['aria-describedby']: PropTypes.string,
|
|
70
65
|
/**
|
|
71
66
|
* Provide a description of the SVG icon to denote file upload status
|
|
72
67
|
*/
|
|
73
|
-
iconDescription:
|
|
68
|
+
iconDescription: PropTypes.string,
|
|
74
69
|
/**
|
|
75
70
|
* Specify if the file is invalid
|
|
76
71
|
*/
|
|
77
|
-
invalid:
|
|
72
|
+
invalid: PropTypes.bool,
|
|
78
73
|
/**
|
|
79
74
|
* Name of the uploaded file
|
|
80
75
|
*/
|
|
81
|
-
name:
|
|
76
|
+
name: PropTypes.string,
|
|
82
77
|
/**
|
|
83
78
|
* Status of the file upload
|
|
84
79
|
*/
|
|
85
|
-
status:
|
|
80
|
+
status: PropTypes.oneOf(['edit', 'complete', 'uploading']),
|
|
86
81
|
/**
|
|
87
82
|
* Provide a custom tabIndex value for the `<Filename>`
|
|
88
83
|
*/
|
|
89
|
-
tabIndex:
|
|
84
|
+
tabIndex: PropTypes.number
|
|
90
85
|
};
|
|
91
86
|
|
|
92
|
-
exports
|
|
87
|
+
exports.default = Filename;
|