@carbon/react 1.86.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 +871 -871
- package/es/_virtual/_rollupPluginBabelHelpers.js +4 -4
- package/es/components/Button/Button.Skeleton.js +2 -1
- package/es/components/Button/Button.d.ts +1 -1
- package/es/components/Button/Button.js +3 -3
- package/es/components/Button/ButtonBase.js +2 -0
- 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/CodeSnippet/CodeSnippet.js +1 -0
- package/es/components/ComboBox/ComboBox.d.ts +7 -0
- package/es/components/ComboBox/ComboBox.js +11 -2
- package/es/components/ComboBox/index.js +4 -1
- package/es/components/ComposedModal/ComposedModal.js +18 -8
- package/es/components/ContainedList/ContainedList.d.ts +1 -1
- package/es/components/ContainedList/ContainedList.js +3 -3
- 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.Skeleton.js +4 -4
- 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/FluidNumberInput/FluidNumberInput.d.ts +3 -2
- package/es/components/FluidNumberInput/FluidNumberInput.js +3 -2
- package/es/components/FluidSelect/index.js +4 -1
- package/es/components/FluidTextInput/index.js +4 -1
- package/es/components/IconButton/index.d.ts +1 -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.d.ts +7 -0
- package/es/components/MultiSelect/FilterableMultiSelect.js +20 -10
- 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.d.ts +3 -2
- package/es/components/NumberInput/NumberInput.js +5 -4
- 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 +26 -8
- 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.d.ts +1 -1
- package/es/components/Toggletip/index.js +3 -3
- 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/useEvent.d.ts +2 -2
- package/es/internal/useEvent.js +4 -3
- 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 +9 -14
- package/lib/components/Button/Button.d.ts +1 -1
- package/lib/components/Button/Button.js +32 -37
- package/lib/components/Button/ButtonBase.js +8 -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 +40 -46
- package/lib/components/ComboBox/ComboBox.d.ts +7 -0
- package/lib/components/ComboBox/ComboBox.js +65 -63
- 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.d.ts +1 -1
- package/lib/components/ContainedList/ContainedList.js +19 -25
- 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 +10 -16
- 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.d.ts +3 -2
- package/lib/components/FluidNumberInput/FluidNumberInput.js +33 -38
- 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.d.ts +1 -1
- 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.d.ts +7 -0
- package/lib/components/MultiSelect/FilterableMultiSelect.js +71 -71
- 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.d.ts +3 -2
- package/lib/components/NumberInput/NumberInput.js +70 -77
- 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 +60 -50
- 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.d.ts +1 -1
- package/lib/components/Toggletip/index.js +33 -41
- 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.d.ts +2 -2
- package/lib/internal/useEvent.js +4 -5
- 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 +12 -12
- package/telemetry.yml +1 -0
- /package/es/node_modules/es-toolkit/dist/function/{debounce.mjs.js → debounce.js} +0 -0
|
@@ -25,13 +25,7 @@ var index = require('../AILabel/index.js');
|
|
|
25
25
|
var utils = require('../../internal/utils.js');
|
|
26
26
|
var Text = require('../Text/Text.js');
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
31
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
32
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
33
|
-
|
|
34
|
-
const TextInput = /*#__PURE__*/React__default["default"].forwardRef(function TextInput({
|
|
28
|
+
const TextInput = /*#__PURE__*/React.forwardRef(function TextInput({
|
|
35
29
|
className,
|
|
36
30
|
decorator,
|
|
37
31
|
disabled = false,
|
|
@@ -80,7 +74,7 @@ const TextInput = /*#__PURE__*/React__default["default"].forwardRef(function Tex
|
|
|
80
74
|
warn,
|
|
81
75
|
warnText
|
|
82
76
|
});
|
|
83
|
-
const textInputClasses =
|
|
77
|
+
const textInputClasses = cx(`${prefix}--text-input`, {
|
|
84
78
|
[`${prefix}--text-input--light`]: light,
|
|
85
79
|
[`${prefix}--text-input--invalid`]: normalizedProps.invalid,
|
|
86
80
|
[`${prefix}--text-input--warning`]: normalizedProps.warn,
|
|
@@ -114,56 +108,56 @@ const TextInput = /*#__PURE__*/React__default["default"].forwardRef(function Tex
|
|
|
114
108
|
if (enableCounter) {
|
|
115
109
|
sharedTextInputProps.maxLength = maxCount;
|
|
116
110
|
}
|
|
117
|
-
const inputWrapperClasses =
|
|
111
|
+
const inputWrapperClasses = cx([cx(`${prefix}--form-item`, className)], `${prefix}--text-input-wrapper`, {
|
|
118
112
|
[`${prefix}--text-input-wrapper--readonly`]: readOnly,
|
|
119
113
|
[`${prefix}--text-input-wrapper--light`]: light,
|
|
120
114
|
[`${prefix}--text-input-wrapper--inline`]: inline,
|
|
121
115
|
[`${prefix}--text-input-wrapper--inline--invalid`]: inline && normalizedProps.invalid
|
|
122
116
|
});
|
|
123
|
-
const labelClasses =
|
|
117
|
+
const labelClasses = cx(`${prefix}--label`, {
|
|
124
118
|
[`${prefix}--visually-hidden`]: hideLabel,
|
|
125
119
|
[`${prefix}--label--disabled`]: normalizedProps.disabled,
|
|
126
120
|
[`${prefix}--label--inline`]: inline,
|
|
127
121
|
[`${prefix}--label--inline--${size}`]: inline && !!size
|
|
128
122
|
});
|
|
129
|
-
const helperTextClasses =
|
|
123
|
+
const helperTextClasses = cx(`${prefix}--form__helper-text`, {
|
|
130
124
|
[`${prefix}--form__helper-text--disabled`]: normalizedProps.disabled,
|
|
131
125
|
[`${prefix}--form__helper-text--inline`]: inline
|
|
132
126
|
});
|
|
133
|
-
const fieldOuterWrapperClasses =
|
|
127
|
+
const fieldOuterWrapperClasses = cx(`${prefix}--text-input__field-outer-wrapper`, {
|
|
134
128
|
[`${prefix}--text-input__field-outer-wrapper--inline`]: inline
|
|
135
129
|
});
|
|
136
|
-
const fieldWrapperClasses =
|
|
130
|
+
const fieldWrapperClasses = cx(`${prefix}--text-input__field-wrapper`, {
|
|
137
131
|
[`${prefix}--text-input__field-wrapper--warning`]: normalizedProps.warn,
|
|
138
132
|
[`${prefix}--text-input__field-wrapper--slug`]: slug,
|
|
139
133
|
[`${prefix}--text-input__field-wrapper--decorator`]: decorator
|
|
140
134
|
});
|
|
141
|
-
const iconClasses =
|
|
135
|
+
const iconClasses = cx({
|
|
142
136
|
[`${prefix}--text-input__invalid-icon`]: normalizedProps.invalid || normalizedProps.warn,
|
|
143
137
|
[`${prefix}--text-input__invalid-icon--warning`]: normalizedProps.warn
|
|
144
138
|
});
|
|
145
|
-
const counterClasses =
|
|
139
|
+
const counterClasses = cx(`${prefix}--label`, {
|
|
146
140
|
[`${prefix}--label--disabled`]: disabled,
|
|
147
141
|
[`${prefix}--text-input__label-counter`]: true
|
|
148
142
|
});
|
|
149
|
-
const counter = enableCounter && maxCount ? /*#__PURE__*/
|
|
143
|
+
const counter = enableCounter && maxCount ? /*#__PURE__*/React.createElement(Text.Text, {
|
|
150
144
|
as: "div",
|
|
151
145
|
className: counterClasses
|
|
152
146
|
}, `${textCount}/${maxCount}`) : null;
|
|
153
|
-
const label = labelText ? /*#__PURE__*/
|
|
147
|
+
const label = labelText ? /*#__PURE__*/React.createElement(Text.Text, {
|
|
154
148
|
as: "label",
|
|
155
149
|
htmlFor: id,
|
|
156
150
|
className: labelClasses
|
|
157
151
|
}, labelText) : null;
|
|
158
|
-
const labelWrapper = /*#__PURE__*/
|
|
152
|
+
const labelWrapper = /*#__PURE__*/React.createElement("div", {
|
|
159
153
|
className: `${prefix}--text-input__label-wrapper`
|
|
160
154
|
}, label, counter);
|
|
161
|
-
const helper = helperText ? /*#__PURE__*/
|
|
155
|
+
const helper = helperText ? /*#__PURE__*/React.createElement(Text.Text, {
|
|
162
156
|
as: "div",
|
|
163
157
|
id: normalizedProps.helperId,
|
|
164
158
|
className: helperTextClasses
|
|
165
159
|
}, helperText) : null;
|
|
166
|
-
const input = /*#__PURE__*/
|
|
160
|
+
const input = /*#__PURE__*/React.createElement("input", util.textInputProps({
|
|
167
161
|
sharedTextInputProps,
|
|
168
162
|
invalid: normalizedProps.invalid,
|
|
169
163
|
invalidId: normalizedProps.invalidId,
|
|
@@ -206,26 +200,26 @@ const TextInput = /*#__PURE__*/React__default["default"].forwardRef(function Tex
|
|
|
206
200
|
const normalizedDecorator = candidateIsAILabel ? /*#__PURE__*/React.cloneElement(candidate, {
|
|
207
201
|
size: 'mini'
|
|
208
202
|
}) : null;
|
|
209
|
-
return /*#__PURE__*/
|
|
203
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
210
204
|
className: inputWrapperClasses
|
|
211
|
-
}, !inline ? labelWrapper : /*#__PURE__*/
|
|
205
|
+
}, !inline ? labelWrapper : /*#__PURE__*/React.createElement("div", {
|
|
212
206
|
className: `${prefix}--text-input__label-helper-wrapper`
|
|
213
|
-
}, labelWrapper, !isFluid && (normalizedProps.validation || helper)), /*#__PURE__*/
|
|
207
|
+
}, labelWrapper, !isFluid && (normalizedProps.validation || helper)), /*#__PURE__*/React.createElement("div", {
|
|
214
208
|
className: fieldOuterWrapperClasses
|
|
215
|
-
}, /*#__PURE__*/
|
|
209
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
216
210
|
className: fieldWrapperClasses,
|
|
217
211
|
"data-invalid": normalizedProps.invalid || null
|
|
218
|
-
}, Icon && /*#__PURE__*/
|
|
212
|
+
}, Icon && /*#__PURE__*/React.createElement(Icon, {
|
|
219
213
|
className: iconClasses
|
|
220
|
-
}), input, slug ? normalizedDecorator : decorator ? /*#__PURE__*/
|
|
214
|
+
}), input, slug ? normalizedDecorator : decorator ? /*#__PURE__*/React.createElement("div", {
|
|
221
215
|
className: `${prefix}--text-input__field-inner-wrapper--decorator`
|
|
222
|
-
}, normalizedDecorator) : '', /*#__PURE__*/
|
|
216
|
+
}, normalizedDecorator) : '', /*#__PURE__*/React.createElement("span", {
|
|
223
217
|
className: `${prefix}--text-input__counter-alert`,
|
|
224
218
|
role: "alert",
|
|
225
219
|
"aria-live": "assertive",
|
|
226
220
|
"aria-atomic": "true",
|
|
227
221
|
ref: announcerRef
|
|
228
|
-
}, ariaAnnouncement), isFluid && /*#__PURE__*/
|
|
222
|
+
}, ariaAnnouncement), isFluid && /*#__PURE__*/React.createElement("hr", {
|
|
229
223
|
className: `${prefix}--text-input__divider`
|
|
230
224
|
}), isFluid && !inline && normalizedProps.validation), !isFluid && !inline && (normalizedProps.validation || helper)));
|
|
231
225
|
});
|
|
@@ -234,103 +228,103 @@ TextInput.propTypes = {
|
|
|
234
228
|
/**
|
|
235
229
|
* Specify an optional className to be applied to the `<input>` node
|
|
236
230
|
*/
|
|
237
|
-
className:
|
|
231
|
+
className: PropTypes.string,
|
|
238
232
|
/**
|
|
239
233
|
* **Experimental**: Provide a `decorator` component to be rendered inside the `TextInput` component
|
|
240
234
|
*/
|
|
241
|
-
decorator:
|
|
235
|
+
decorator: PropTypes.node,
|
|
242
236
|
/**
|
|
243
237
|
* Optionally provide the default value of the `<input>`
|
|
244
238
|
*/
|
|
245
|
-
defaultValue:
|
|
239
|
+
defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
246
240
|
/**
|
|
247
241
|
* Specify whether the `<input>` should be disabled
|
|
248
242
|
*/
|
|
249
|
-
disabled:
|
|
243
|
+
disabled: PropTypes.bool,
|
|
250
244
|
/**
|
|
251
245
|
* Specify whether to display the character counter
|
|
252
246
|
*/
|
|
253
|
-
enableCounter:
|
|
247
|
+
enableCounter: PropTypes.bool,
|
|
254
248
|
/**
|
|
255
249
|
* Provide text that is used alongside the control label for additional help
|
|
256
250
|
*/
|
|
257
|
-
helperText:
|
|
251
|
+
helperText: PropTypes.node,
|
|
258
252
|
/**
|
|
259
253
|
* Specify whether you want the underlying label to be visually hidden
|
|
260
254
|
*/
|
|
261
|
-
hideLabel:
|
|
255
|
+
hideLabel: PropTypes.bool,
|
|
262
256
|
/**
|
|
263
257
|
* Specify a custom `id` for the `<input>`
|
|
264
258
|
*/
|
|
265
|
-
id:
|
|
259
|
+
id: PropTypes.string.isRequired,
|
|
266
260
|
/**
|
|
267
261
|
* `true` to use the inline version.
|
|
268
262
|
*/
|
|
269
|
-
inline:
|
|
263
|
+
inline: PropTypes.bool,
|
|
270
264
|
/**
|
|
271
265
|
* Specify whether the control is currently invalid
|
|
272
266
|
*/
|
|
273
|
-
invalid:
|
|
267
|
+
invalid: PropTypes.bool,
|
|
274
268
|
/**
|
|
275
269
|
* Provide the text that is displayed when the control is in an invalid state
|
|
276
270
|
*/
|
|
277
|
-
invalidText:
|
|
271
|
+
invalidText: PropTypes.node,
|
|
278
272
|
/**
|
|
279
273
|
* Provide the text that will be read by a screen reader when visiting this
|
|
280
274
|
* control
|
|
281
275
|
*/
|
|
282
|
-
labelText:
|
|
276
|
+
labelText: PropTypes.node.isRequired,
|
|
283
277
|
/**
|
|
284
278
|
* `true` to use the light version. For use on $ui-01 backgrounds only.
|
|
285
279
|
* Don't use this to make tile background color same as container background color.
|
|
286
280
|
*/
|
|
287
|
-
light: deprecate.deprecate(
|
|
281
|
+
light: deprecate.deprecate(PropTypes.bool, 'The `light` prop for `TextInput` has ' + 'been deprecated in favor of the new `Layer` component. It will be removed in the next major release.'),
|
|
288
282
|
/**
|
|
289
283
|
* Max character count allowed for the input. This is needed in order for enableCounter to display
|
|
290
284
|
*/
|
|
291
|
-
maxCount:
|
|
285
|
+
maxCount: PropTypes.number,
|
|
292
286
|
/**
|
|
293
287
|
* Optionally provide an `onChange` handler that is called whenever `<input>`
|
|
294
288
|
* is updated
|
|
295
289
|
*/
|
|
296
|
-
onChange:
|
|
290
|
+
onChange: PropTypes.func,
|
|
297
291
|
/**
|
|
298
292
|
* Optionally provide an `onClick` handler that is called whenever the
|
|
299
293
|
* `<input>` is clicked
|
|
300
294
|
*/
|
|
301
|
-
onClick:
|
|
295
|
+
onClick: PropTypes.func,
|
|
302
296
|
/**
|
|
303
297
|
* Specify the placeholder attribute for the `<input>`
|
|
304
298
|
*/
|
|
305
|
-
placeholder:
|
|
299
|
+
placeholder: PropTypes.string,
|
|
306
300
|
/**
|
|
307
301
|
* Whether the input should be read-only
|
|
308
302
|
*/
|
|
309
|
-
readOnly:
|
|
303
|
+
readOnly: PropTypes.bool,
|
|
310
304
|
/**
|
|
311
305
|
* Specify the size of the Text Input. Currently supports the following:
|
|
312
306
|
*/
|
|
313
|
-
size:
|
|
307
|
+
size: PropTypes.oneOf(['sm', 'md', 'lg']),
|
|
314
308
|
/**
|
|
315
309
|
* **Experimental**: Provide a `Slug` component to be rendered inside the `TextInput` component
|
|
316
310
|
*/
|
|
317
|
-
slug: deprecate.deprecate(
|
|
311
|
+
slug: deprecate.deprecate(PropTypes.node, 'The `slug` prop for `TextInput` has ' + 'been deprecated in favor of the new `decorator` prop. It will be removed in the next major release.'),
|
|
318
312
|
/**
|
|
319
313
|
* Specify the type of the `<input>`
|
|
320
314
|
*/
|
|
321
|
-
type:
|
|
315
|
+
type: PropTypes.string,
|
|
322
316
|
/**
|
|
323
317
|
* Specify the value of the `<input>`
|
|
324
318
|
*/
|
|
325
|
-
value:
|
|
319
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
326
320
|
/**
|
|
327
321
|
* Specify whether the control is currently in warning state
|
|
328
322
|
*/
|
|
329
|
-
warn:
|
|
323
|
+
warn: PropTypes.bool,
|
|
330
324
|
/**
|
|
331
325
|
* Provide the text that is displayed when the control is in warning state
|
|
332
326
|
*/
|
|
333
|
-
warnText:
|
|
327
|
+
warnText: PropTypes.node
|
|
334
328
|
};
|
|
335
329
|
|
|
336
|
-
exports
|
|
330
|
+
exports.default = TextInput;
|
|
@@ -14,6 +14,6 @@ var TextInput_Skeleton = require('./TextInput.Skeleton.js');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.TextInput = TextInput
|
|
18
|
-
exports
|
|
19
|
-
exports.TextInputSkeleton = TextInput_Skeleton
|
|
17
|
+
exports.TextInput = TextInput.default;
|
|
18
|
+
exports.default = TextInput.default;
|
|
19
|
+
exports.TextInputSkeleton = TextInput_Skeleton.default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function textInputProps({ sharedTextInputProps, invalid, invalidId, warn, warnId, hasHelper, helperId, }: {
|
|
2
|
+
sharedTextInputProps: object;
|
|
3
|
+
invalid?: boolean;
|
|
4
|
+
invalidId?: string;
|
|
5
|
+
warn?: boolean;
|
|
6
|
+
warnId?: string;
|
|
7
|
+
hasHelper?: boolean;
|
|
8
|
+
helperId?: string;
|
|
9
|
+
}): object;
|
|
@@ -7,8 +7,6 @@
|
|
|
7
7
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
-
|
|
12
10
|
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
|
13
11
|
var cx = require('classnames');
|
|
14
12
|
var PropTypes = require('prop-types');
|
|
@@ -17,16 +15,10 @@ var usePrefix = require('../../internal/usePrefix.js');
|
|
|
17
15
|
var LayerContext = require('../Layer/LayerContext.js');
|
|
18
16
|
var useMatchMedia = require('../../internal/useMatchMedia.js');
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
23
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
24
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
25
|
-
|
|
26
|
-
const ThemeContext = /*#__PURE__*/React__default["default"].createContext({
|
|
18
|
+
const ThemeContext = /*#__PURE__*/React.createContext({
|
|
27
19
|
theme: 'white'
|
|
28
20
|
});
|
|
29
|
-
const GlobalTheme = /*#__PURE__*/
|
|
21
|
+
const GlobalTheme = /*#__PURE__*/React.forwardRef(function GlobalTheme({
|
|
30
22
|
children,
|
|
31
23
|
theme
|
|
32
24
|
}, ref) {
|
|
@@ -35,10 +27,10 @@ const GlobalTheme = /*#__PURE__*/React__default["default"].forwardRef(function G
|
|
|
35
27
|
theme
|
|
36
28
|
};
|
|
37
29
|
}, [theme]);
|
|
38
|
-
const childrenWithProps = /*#__PURE__*/
|
|
30
|
+
const childrenWithProps = /*#__PURE__*/React.cloneElement(children, {
|
|
39
31
|
ref: ref
|
|
40
32
|
});
|
|
41
|
-
return /*#__PURE__*/
|
|
33
|
+
return /*#__PURE__*/React.createElement(ThemeContext.Provider, {
|
|
42
34
|
value: value
|
|
43
35
|
}, childrenWithProps);
|
|
44
36
|
});
|
|
@@ -47,11 +39,11 @@ GlobalTheme.propTypes = {
|
|
|
47
39
|
* Provide child elements to be rendered inside of `GlobalTheme`, this is
|
|
48
40
|
* typically the root of your app
|
|
49
41
|
*/
|
|
50
|
-
children:
|
|
42
|
+
children: PropTypes.node,
|
|
51
43
|
/**
|
|
52
44
|
* Specify the global theme for your app
|
|
53
45
|
*/
|
|
54
|
-
theme:
|
|
46
|
+
theme: PropTypes.oneOf(['white', 'g10', 'g90', 'g100'])
|
|
55
47
|
};
|
|
56
48
|
/**
|
|
57
49
|
* Specify the theme to be applied to a page, or a region in a page
|
|
@@ -63,14 +55,14 @@ function Theme({
|
|
|
63
55
|
...rest
|
|
64
56
|
}) {
|
|
65
57
|
const prefix = usePrefix.usePrefix();
|
|
66
|
-
const className =
|
|
58
|
+
const className = cx(customClassName, {
|
|
67
59
|
[`${prefix}--white`]: theme === 'white',
|
|
68
60
|
[`${prefix}--g10`]: theme === 'g10',
|
|
69
61
|
[`${prefix}--g90`]: theme === 'g90',
|
|
70
62
|
[`${prefix}--g100`]: theme === 'g100',
|
|
71
63
|
[`${prefix}--layer-one`]: true
|
|
72
64
|
});
|
|
73
|
-
const value =
|
|
65
|
+
const value = React.useMemo(() => {
|
|
74
66
|
const isDark = theme && ['g90', 'g100'].includes(theme);
|
|
75
67
|
return {
|
|
76
68
|
theme,
|
|
@@ -78,11 +70,11 @@ function Theme({
|
|
|
78
70
|
};
|
|
79
71
|
}, [theme]);
|
|
80
72
|
const BaseComponentAsAny = BaseComponent;
|
|
81
|
-
return /*#__PURE__*/
|
|
73
|
+
return /*#__PURE__*/React.createElement(ThemeContext.Provider, {
|
|
82
74
|
value: value
|
|
83
|
-
}, /*#__PURE__*/
|
|
75
|
+
}, /*#__PURE__*/React.createElement(LayerContext.LayerContext.Provider, {
|
|
84
76
|
value: 1
|
|
85
|
-
}, /*#__PURE__*/
|
|
77
|
+
}, /*#__PURE__*/React.createElement(BaseComponentAsAny, _rollupPluginBabelHelpers.extends({}, rest, {
|
|
86
78
|
className: className
|
|
87
79
|
}))));
|
|
88
80
|
}
|
|
@@ -91,27 +83,27 @@ Theme.propTypes = {
|
|
|
91
83
|
* Specify a custom component or element to be rendered as the top-level
|
|
92
84
|
* element in the component
|
|
93
85
|
*/
|
|
94
|
-
as:
|
|
86
|
+
as: PropTypes.oneOfType([PropTypes.func, PropTypes.string, PropTypes.elementType]),
|
|
95
87
|
/**
|
|
96
88
|
* Provide child elements to be rendered inside of `Theme`
|
|
97
89
|
*/
|
|
98
|
-
children:
|
|
90
|
+
children: PropTypes.node,
|
|
99
91
|
/**
|
|
100
92
|
* Provide a custom class name to be used on the outermost element rendered by
|
|
101
93
|
* the component
|
|
102
94
|
*/
|
|
103
|
-
className:
|
|
95
|
+
className: PropTypes.string,
|
|
104
96
|
/**
|
|
105
97
|
* Specify the theme
|
|
106
98
|
*/
|
|
107
|
-
theme:
|
|
99
|
+
theme: PropTypes.oneOf(['white', 'g10', 'g90', 'g100'])
|
|
108
100
|
};
|
|
109
101
|
|
|
110
102
|
/**
|
|
111
103
|
* Get access to the current theme
|
|
112
104
|
*/
|
|
113
105
|
function useTheme() {
|
|
114
|
-
return
|
|
106
|
+
return React.useContext(ThemeContext);
|
|
115
107
|
}
|
|
116
108
|
function usePrefersDarkScheme() {
|
|
117
109
|
return useMatchMedia.useMatchMedia('(prefers-color-scheme: dark)');
|