@carbon/react 1.29.0 → 1.30.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/_virtual/_rollupPluginBabelHelpers.js +16 -5
- package/es/components/Accordion/Accordion.Skeleton.js +0 -7
- package/es/components/Accordion/Accordion.js +1 -8
- package/es/components/Accordion/AccordionItem.js +5 -19
- package/es/components/AspectRatio/AspectRatio.js +0 -5
- package/es/components/Breadcrumb/Breadcrumb.Skeleton.js +0 -3
- package/es/components/Breadcrumb/Breadcrumb.js +0 -3
- package/es/components/Breadcrumb/BreadcrumbItem.js +0 -7
- package/es/components/Button/Button.Skeleton.js +2 -7
- package/es/components/Button/Button.js +2 -36
- package/es/components/ButtonSet/ButtonSet.js +0 -2
- package/es/components/Checkbox/Checkbox.Skeleton.js +0 -1
- package/es/components/Checkbox/Checkbox.js +4 -20
- package/es/components/CheckboxGroup/CheckboxGroup.js +0 -11
- package/es/components/ClassPrefix/index.d.ts +26 -0
- package/es/components/ClassPrefix/index.js +0 -2
- package/es/components/CodeSnippet/CodeSnippet.Skeleton.js +0 -5
- package/es/components/CodeSnippet/CodeSnippet.js +6 -45
- package/es/components/ComboBox/ComboBox.js +12 -79
- package/es/components/ComboBox/tools/filter.js +0 -1
- package/es/components/ComboButton/index.js +0 -14
- package/es/components/ComposedModal/ComposedModal.js +2 -32
- package/es/components/ComposedModal/ModalFooter.js +0 -21
- package/es/components/ComposedModal/ModalHeader.js +0 -12
- package/es/components/ContainedList/ContainedList.js +5 -32
- package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +0 -6
- package/es/components/ContentSwitcher/ContentSwitcher.js +11 -23
- package/es/components/ContextMenu/useContextMenu.js +1 -6
- package/es/components/Copy/Copy.js +8 -31
- package/es/components/CopyButton/CopyButton.js +0 -4
- package/es/components/DangerButton/DangerButton.js +0 -1
- package/es/components/DataTable/DataTable.js +171 -91
- package/es/components/DataTable/Table.js +0 -6
- package/es/components/DataTable/TableBatchAction.js +0 -4
- package/es/components/DataTable/TableBatchActions.js +0 -8
- package/es/components/DataTable/TableBody.js +0 -1
- package/es/components/DataTable/TableContainer.js +0 -5
- package/es/components/DataTable/TableExpandHeader.js +0 -7
- package/es/components/DataTable/TableExpandRow.js +0 -6
- package/es/components/DataTable/TableExpandedRow.js +0 -6
- package/es/components/DataTable/TableHeader.d.ts +1 -1
- package/es/components/DataTable/TableHeader.js +3 -19
- package/es/components/DataTable/TableRow.js +4 -5
- package/es/components/DataTable/TableSelectAll.js +0 -8
- package/es/components/DataTable/TableSelectRow.js +2 -10
- package/es/components/DataTable/TableToolbar.js +0 -3
- package/es/components/DataTable/TableToolbarMenu.d.ts +1 -1
- package/es/components/DataTable/TableToolbarMenu.js +3 -6
- package/es/components/DataTable/TableToolbarSearch.js +2 -30
- package/es/components/DataTable/state/getDerivedStateFromProps.js +0 -4
- package/es/components/DataTable/state/sorting.js +5 -8
- package/es/components/DataTable/tools/denormalize.js +2 -2
- package/es/components/DataTable/tools/filter.js +0 -2
- package/es/components/DataTable/tools/instanceId.js +0 -1
- package/es/components/DataTable/tools/normalize.js +10 -10
- package/es/components/DataTable/tools/sorting.js +5 -13
- package/es/components/DataTableSkeleton/DataTableSkeleton.js +5 -20
- package/es/components/DatePicker/DatePicker.Skeleton.js +0 -6
- package/es/components/DatePicker/DatePicker.js +154 -177
- package/es/components/DatePicker/plugins/appendToPlugin.js +3 -7
- package/es/components/DatePicker/plugins/fixEventsPlugin.js +14 -25
- package/es/components/DatePicker/plugins/rangePlugin.js +2 -7
- package/es/components/DatePickerInput/DatePickerInput.js +2 -28
- package/es/components/Dropdown/Dropdown.Skeleton.js +0 -2
- package/es/components/Dropdown/Dropdown.js +43 -52
- package/es/components/ErrorBoundary/ErrorBoundary.js +0 -10
- package/es/components/ErrorBoundary/ErrorBoundaryContext.js +0 -1
- package/es/components/ExpandableSearch/ExpandableSearch.js +1 -10
- package/es/components/FeatureFlags/index.js +8 -20
- package/es/components/FileUploader/FileUploader.Skeleton.js +0 -2
- package/es/components/FileUploader/FileUploader.js +3 -38
- package/es/components/FileUploader/FileUploaderButton.js +3 -24
- package/es/components/FileUploader/FileUploaderDropContainer.js +1 -28
- package/es/components/FileUploader/FileUploaderItem.js +1 -11
- package/es/components/FileUploader/Filename.js +0 -10
- package/es/components/FluidComboBox/FluidComboBox.Skeleton.js +0 -1
- package/es/components/FluidComboBox/FluidComboBox.js +0 -18
- package/es/components/FluidDatePicker/FluidDatePicker.Skeleton.js +0 -2
- package/es/components/FluidDatePicker/FluidDatePicker.js +0 -6
- package/es/components/FluidDatePickerInput/FluidDatePickerInput.js +2 -1
- package/es/components/FluidDropdown/FluidDropdown.Skeleton.js +0 -1
- package/es/components/FluidDropdown/FluidDropdown.js +0 -18
- package/es/components/FluidForm/FluidForm.js +0 -2
- package/es/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +0 -1
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +0 -19
- package/es/components/FluidSelect/FluidSelect.Skeleton.js +0 -1
- package/es/components/FluidSelect/FluidSelect.js +0 -10
- package/es/components/FluidTextArea/FluidTextArea.Skeleton.js +0 -1
- package/es/components/FluidTextArea/FluidTextArea.js +0 -20
- package/es/components/FluidTextInput/FluidTextInput.Skeleton.js +0 -1
- package/es/components/FluidTextInput/FluidTextInput.js +0 -14
- package/es/components/FluidTimePicker/FluidTimePicker.Skeleton.js +0 -3
- package/es/components/FluidTimePicker/FluidTimePicker.js +1 -11
- package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +0 -6
- package/es/components/Form/Form.d.ts +23 -0
- package/es/components/Form/Form.js +3 -6
- package/es/components/Form/index.d.ts +7 -0
- package/es/components/FormGroup/FormGroup.js +0 -7
- package/es/components/FormItem/FormItem.js +0 -2
- package/es/components/FormLabel/FormLabel.js +1 -7
- package/es/components/Grid/CSSGrid.js +2 -15
- package/es/components/Grid/Column.js +18 -59
- package/es/components/Grid/ColumnHang.js +2 -5
- package/es/components/Grid/FlexGrid.js +2 -8
- package/es/components/Grid/Grid.js +0 -8
- package/es/components/Grid/GridContext.js +1 -3
- package/es/components/Grid/Row.js +2 -7
- package/es/components/Heading/index.js +0 -4
- package/es/components/Icon/Icon.Skeleton.js +2 -2
- package/es/components/IconButton/index.js +0 -10
- package/es/components/IdPrefix/index.js +0 -2
- package/es/components/InlineCheckbox/InlineCheckbox.js +0 -14
- package/es/components/InlineLoading/InlineLoading.js +0 -12
- package/es/components/Layer/index.js +3 -6
- package/es/components/Layout/LayoutDirection.js +0 -3
- package/es/components/Layout/useLayoutDirection.js +0 -1
- package/es/components/Link/Link.js +3 -10
- package/es/components/ListBox/ListBox.js +2 -13
- package/es/components/ListBox/ListBoxField.js +0 -5
- package/es/components/ListBox/ListBoxMenuIcon.js +0 -4
- package/es/components/ListBox/ListBoxMenuItem.js +2 -6
- package/es/components/ListBox/ListBoxPropTypes.d.ts +2 -2
- package/es/components/ListBox/ListBoxSelection.js +1 -13
- package/es/components/ListBox/next/ListBoxSelection.js +1 -14
- package/es/components/ListBox/next/ListBoxTrigger.js +1 -3
- package/es/components/ListItem/ListItem.d.ts +23 -0
- package/es/components/ListItem/ListItem.js +4 -8
- package/es/components/ListItem/index.d.ts +7 -0
- package/es/components/Loading/Loading.js +0 -6
- package/es/components/Menu/Menu.js +22 -40
- package/es/components/Menu/MenuContext.js +4 -5
- package/es/components/Menu/MenuItem.js +5 -39
- package/es/components/MenuButton/index.js +0 -9
- package/es/components/Modal/Modal.js +0 -43
- package/es/components/ModalWrapper/ModalWrapper.js +2 -15
- package/es/components/MultiSelect/FilterableMultiSelect.js +2 -60
- package/es/components/MultiSelect/MultiSelect.js +22 -70
- package/es/components/MultiSelect/MultiSelectPropTypes.js +0 -1
- package/es/components/MultiSelect/index.js +0 -1
- package/es/components/MultiSelect/tools/itemToString.js +0 -2
- package/es/components/MultiSelect/tools/sorting.js +3 -4
- package/es/components/Notification/Notification.js +0 -78
- package/es/components/NumberInput/NumberInput.Skeleton.js +0 -2
- package/es/components/NumberInput/NumberInput.js +3 -60
- package/es/components/OrderedList/OrderedList.d.ts +39 -0
- package/es/components/OrderedList/OrderedList.js +7 -19
- package/es/components/{Form/index.js → OrderedList/index.d.ts} +1 -3
- package/es/components/OverflowMenu/OverflowMenu.js +65 -86
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +6 -23
- package/es/components/OverflowMenuV2/index.js +0 -5
- package/es/components/Pagination/Pagination.Skeleton.js +0 -2
- package/es/components/Pagination/Pagination.js +11 -47
- package/es/components/Pagination/experimental/PageSelector.js +0 -10
- package/es/components/Pagination/experimental/Pagination.js +2 -48
- package/es/components/PaginationNav/PaginationNav.js +15 -59
- package/es/components/Popover/index.d.ts +14 -8
- package/es/components/Popover/index.js +44 -48
- package/es/components/PrimaryButton/PrimaryButton.js +0 -1
- package/es/components/ProgressBar/ProgressBar.js +0 -15
- package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.js +0 -4
- package/es/components/ProgressIndicator/ProgressIndicator.js +2 -40
- package/es/components/RadioButton/RadioButton.Skeleton.js +0 -1
- package/es/components/RadioButton/RadioButton.js +0 -13
- package/es/components/RadioButtonGroup/RadioButtonGroup.js +3 -23
- package/es/components/RadioTile/RadioTile.js +0 -12
- package/es/components/Search/Search.Skeleton.js +0 -2
- package/es/components/Search/Search.js +1 -28
- package/es/components/SecondaryButton/SecondaryButton.js +0 -1
- package/es/components/Select/Select.Skeleton.js +0 -2
- package/es/components/Select/Select.d.ts +1 -1
- package/es/components/Select/Select.js +6 -33
- package/es/components/SelectItem/SelectItem.js +0 -5
- package/es/components/SelectItemGroup/SelectItemGroup.d.ts +0 -1
- package/es/components/SelectItemGroup/SelectItemGroup.js +1 -7
- package/es/components/SkeletonIcon/SkeletonIcon.js +0 -2
- package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +0 -1
- package/es/components/SkeletonText/SkeletonText.js +0 -12
- package/es/components/Slider/Slider.Skeleton.js +0 -2
- package/es/components/Slider/Slider.d.ts +0 -1
- package/es/components/Slider/Slider.js +112 -135
- package/es/components/Stack/Stack.js +1 -8
- package/es/components/StructuredList/StructuredList.Skeleton.js +0 -5
- package/es/components/StructuredList/StructuredList.js +1 -25
- package/es/components/Switch/IconSwitch.js +0 -18
- package/es/components/Switch/Switch.js +0 -11
- package/es/components/TabContent/TabContent.js +2 -6
- package/es/components/Tabs/Tabs.Skeleton.js +0 -4
- package/es/components/Tabs/Tabs.js +135 -104
- package/es/components/Tabs/usePressable.js +18 -31
- package/es/components/Tag/Tag.Skeleton.js +0 -2
- package/es/components/Tag/Tag.js +0 -15
- package/es/components/Text/Text.js +5 -18
- package/es/components/Text/TextDirection.js +0 -3
- package/es/components/Text/TextDirectionContext.js +0 -1
- package/es/components/Text/createTextComponent.js +0 -3
- package/es/components/TextArea/TextArea.Skeleton.js +0 -2
- package/es/components/TextArea/TextArea.js +11 -33
- package/es/components/TextInput/ControlledPasswordInput.js +0 -20
- package/es/components/TextInput/PasswordInput.js +0 -25
- package/es/components/TextInput/TextInput.Skeleton.js +0 -2
- package/es/components/TextInput/TextInput.d.ts +1 -1
- package/es/components/TextInput/TextInput.js +5 -33
- package/es/components/TextInput/util.js +3 -5
- package/es/components/Theme/index.js +1 -6
- package/es/components/Tile/Tile.js +32 -59
- package/es/components/TileGroup/TileGroup.js +1 -22
- package/es/components/TimePicker/TimePicker.js +6 -32
- package/es/components/TimePickerSelect/TimePickerSelect.js +2 -5
- package/es/components/Toggle/Toggle.Skeleton.js +0 -8
- package/es/components/Toggle/Toggle.js +0 -16
- package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +0 -7
- package/es/components/Toggletip/index.d.ts +148 -0
- package/es/components/Toggletip/index.js +20 -44
- package/es/components/Tooltip/DefinitionTooltip.js +0 -11
- package/es/components/Tooltip/Tooltip.d.ts +1 -1
- package/es/components/Tooltip/Tooltip.js +4 -21
- package/es/components/TreeView/TreeNode.js +21 -66
- package/es/components/TreeView/TreeView.js +11 -67
- package/es/components/UIShell/Content.js +2 -4
- package/es/components/UIShell/Header.js +0 -2
- package/es/components/UIShell/HeaderContainer.d.ts +33 -0
- package/es/components/UIShell/HeaderContainer.js +13 -11
- package/es/components/UIShell/HeaderGlobalAction.js +0 -6
- package/es/components/UIShell/HeaderGlobalBar.js +0 -1
- package/es/components/UIShell/HeaderMenu.js +32 -31
- package/es/components/UIShell/HeaderMenuButton.js +2 -4
- package/es/components/UIShell/HeaderMenuItem.js +0 -8
- package/es/components/UIShell/HeaderName.js +0 -5
- package/es/components/UIShell/HeaderNavigation.js +0 -2
- package/es/components/UIShell/HeaderPanel.js +0 -2
- package/es/components/UIShell/HeaderSideNavItems.js +0 -2
- package/es/components/UIShell/Link.js +2 -3
- package/es/components/UIShell/SideNav.d.ts +3 -1
- package/es/components/UIShell/SideNav.js +44 -36
- package/es/components/UIShell/SideNavDetails.js +0 -3
- package/es/components/UIShell/SideNavDivider.js +0 -1
- package/es/components/UIShell/SideNavFooter.js +1 -4
- package/es/components/UIShell/SideNavHeader.js +0 -4
- package/es/components/UIShell/SideNavIcon.js +0 -3
- package/es/components/UIShell/SideNavItem.js +0 -3
- package/es/components/UIShell/SideNavItems.js +2 -6
- package/es/components/UIShell/SideNavLink.js +3 -7
- package/es/components/UIShell/SideNavLinkText.js +0 -2
- package/es/components/UIShell/SideNavMenu.js +0 -16
- package/es/components/UIShell/SideNavMenuItem.js +0 -2
- package/es/components/UIShell/SideNavSwitcher.js +2 -5
- package/es/components/UIShell/SkipToContent.d.ts +32 -0
- package/es/components/UIShell/SkipToContent.js +8 -15
- package/es/components/UIShell/Switcher.js +0 -2
- package/es/components/UIShell/SwitcherDivider.js +0 -1
- package/es/components/UIShell/SwitcherItem.js +0 -3
- package/es/components/UnorderedList/UnorderedList.d.ts +34 -0
- package/es/components/UnorderedList/UnorderedList.js +6 -16
- package/es/components/UnorderedList/index.d.ts +7 -0
- package/es/index.js +7 -8
- package/es/internal/ClickListener.js +3 -13
- package/es/internal/FloatingMenu.js +57 -63
- package/es/internal/OptimizedResize.js +6 -12
- package/es/internal/Selection.js +2 -25
- package/es/internal/createClassWrapper.js +0 -2
- package/es/internal/deprecateFieldOnObject.js +0 -4
- package/es/internal/focus/index.js +0 -1
- package/es/internal/keyboard/keys.js +2 -1
- package/es/internal/keyboard/match.js +1 -6
- package/es/internal/keyboard/navigation.js +8 -7
- package/es/internal/useAnnouncer.js +0 -1
- package/es/internal/useAttachedMenu.js +1 -9
- package/es/internal/useControllableState.js +6 -13
- package/es/internal/useDelayedState.js +2 -4
- package/es/internal/useEffectOnce.js +0 -1
- package/es/internal/useEvent.js +61 -3
- package/es/internal/useId.js +2 -5
- package/es/internal/useIsomorphicEffect.js +1 -0
- package/es/internal/useMergedRefs.js +2 -2
- package/es/internal/useNoInteractiveChildren.js +2 -13
- package/es/internal/useNormalizedInputProps.js +0 -3
- package/es/internal/useSavedCallback.js +1 -2
- package/es/internal/warning.js +0 -3
- package/es/internal/wrapFocus.js +1 -8
- package/es/prop-types/deprecate.js +2 -5
- package/es/prop-types/isRequiredOneOf.js +2 -5
- package/es/prop-types/requiredIfGivenPropIsTruthy.js +0 -2
- package/es/tools/array.js +0 -3
- package/es/tools/events.js +0 -3
- package/es/tools/mergeRefs.js +0 -2
- package/es/tools/wrapComponent.js +2 -5
- package/lib/_virtual/_rollupPluginBabelHelpers.js +17 -4
- package/lib/components/Accordion/Accordion.Skeleton.js +0 -7
- package/lib/components/Accordion/Accordion.js +1 -27
- package/lib/components/Accordion/AccordionItem.js +5 -19
- package/lib/components/AspectRatio/AspectRatio.js +0 -5
- package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +0 -3
- package/lib/components/Breadcrumb/Breadcrumb.js +0 -3
- package/lib/components/Breadcrumb/BreadcrumbItem.js +0 -7
- package/lib/components/Button/Button.Skeleton.js +2 -26
- package/lib/components/Button/Button.js +2 -36
- package/lib/components/ButtonSet/ButtonSet.js +0 -2
- package/lib/components/Checkbox/Checkbox.Skeleton.js +0 -1
- package/lib/components/Checkbox/Checkbox.js +4 -20
- package/lib/components/CheckboxGroup/CheckboxGroup.js +0 -11
- package/lib/components/ClassPrefix/index.d.ts +26 -0
- package/lib/components/ClassPrefix/index.js +0 -2
- package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +0 -5
- package/lib/components/CodeSnippet/CodeSnippet.js +6 -45
- package/lib/components/ComboBox/ComboBox.js +19 -86
- package/lib/components/ComboBox/tools/filter.js +0 -1
- package/lib/components/ComboButton/index.js +0 -14
- package/lib/components/ComposedModal/ComposedModal.js +2 -32
- package/lib/components/ComposedModal/ModalFooter.js +0 -21
- package/lib/components/ComposedModal/ModalHeader.js +0 -12
- package/lib/components/ContainedList/ContainedList.js +5 -32
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +0 -6
- package/lib/components/ContentSwitcher/ContentSwitcher.js +11 -23
- package/lib/components/ContextMenu/useContextMenu.js +1 -6
- package/lib/components/Copy/Copy.js +8 -50
- package/lib/components/CopyButton/CopyButton.js +0 -4
- package/lib/components/DangerButton/DangerButton.js +0 -1
- package/lib/components/DataTable/DataTable.js +171 -91
- package/lib/components/DataTable/Table.js +0 -6
- package/lib/components/DataTable/TableBatchAction.js +0 -4
- package/lib/components/DataTable/TableBatchActions.js +0 -8
- package/lib/components/DataTable/TableBody.js +0 -1
- package/lib/components/DataTable/TableContainer.js +0 -5
- package/lib/components/DataTable/TableExpandHeader.js +0 -7
- package/lib/components/DataTable/TableExpandRow.js +0 -6
- package/lib/components/DataTable/TableExpandedRow.js +0 -6
- package/lib/components/DataTable/TableHeader.d.ts +1 -1
- package/lib/components/DataTable/TableHeader.js +3 -19
- package/lib/components/DataTable/TableRow.js +4 -5
- package/lib/components/DataTable/TableSelectAll.js +0 -8
- package/lib/components/DataTable/TableSelectRow.js +2 -10
- package/lib/components/DataTable/TableToolbar.js +0 -3
- package/lib/components/DataTable/TableToolbarMenu.d.ts +1 -1
- package/lib/components/DataTable/TableToolbarMenu.js +3 -6
- package/lib/components/DataTable/TableToolbarSearch.js +2 -30
- package/lib/components/DataTable/state/getDerivedStateFromProps.js +0 -4
- package/lib/components/DataTable/state/sorting.js +5 -8
- package/lib/components/DataTable/tools/denormalize.js +2 -2
- package/lib/components/DataTable/tools/filter.js +0 -2
- package/lib/components/DataTable/tools/instanceId.js +0 -1
- package/lib/components/DataTable/tools/normalize.js +10 -10
- package/lib/components/DataTable/tools/sorting.js +5 -13
- package/lib/components/DataTableSkeleton/DataTableSkeleton.js +5 -20
- package/lib/components/DatePicker/DatePicker.Skeleton.js +0 -6
- package/lib/components/DatePicker/DatePicker.js +154 -177
- package/lib/components/DatePicker/plugins/appendToPlugin.js +3 -7
- package/lib/components/DatePicker/plugins/fixEventsPlugin.js +14 -25
- package/lib/components/DatePicker/plugins/rangePlugin.js +2 -7
- package/lib/components/DatePickerInput/DatePickerInput.js +2 -28
- package/lib/components/Dropdown/Dropdown.Skeleton.js +0 -2
- package/lib/components/Dropdown/Dropdown.js +50 -59
- package/lib/components/ErrorBoundary/ErrorBoundary.js +0 -10
- package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +0 -1
- package/lib/components/ExpandableSearch/ExpandableSearch.js +1 -10
- package/lib/components/FeatureFlags/index.js +8 -20
- package/lib/components/FileUploader/FileUploader.Skeleton.js +0 -2
- package/lib/components/FileUploader/FileUploader.js +3 -57
- package/lib/components/FileUploader/FileUploaderButton.js +3 -43
- package/lib/components/FileUploader/FileUploaderDropContainer.js +1 -28
- package/lib/components/FileUploader/FileUploaderItem.js +1 -30
- package/lib/components/FileUploader/Filename.js +0 -10
- package/lib/components/FluidComboBox/FluidComboBox.Skeleton.js +0 -1
- package/lib/components/FluidComboBox/FluidComboBox.js +0 -18
- package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.js +0 -2
- package/lib/components/FluidDatePicker/FluidDatePicker.js +0 -6
- package/lib/components/FluidDatePickerInput/FluidDatePickerInput.js +2 -1
- package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +0 -1
- package/lib/components/FluidDropdown/FluidDropdown.js +0 -18
- package/lib/components/FluidForm/FluidForm.js +0 -2
- package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +0 -1
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +0 -19
- package/lib/components/FluidSelect/FluidSelect.Skeleton.js +0 -1
- package/lib/components/FluidSelect/FluidSelect.js +0 -10
- package/lib/components/FluidTextArea/FluidTextArea.Skeleton.js +0 -1
- package/lib/components/FluidTextArea/FluidTextArea.js +0 -20
- package/lib/components/FluidTextInput/FluidTextInput.Skeleton.js +0 -1
- package/lib/components/FluidTextInput/FluidTextInput.js +0 -14
- package/lib/components/FluidTimePicker/FluidTimePicker.Skeleton.js +0 -3
- package/lib/components/FluidTimePicker/FluidTimePicker.js +1 -11
- package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +0 -6
- package/lib/components/Form/Form.d.ts +23 -0
- package/lib/components/Form/Form.js +3 -6
- package/lib/components/Form/index.d.ts +7 -0
- package/lib/components/FormGroup/FormGroup.js +0 -7
- package/lib/components/FormItem/FormItem.js +0 -2
- package/lib/components/FormLabel/FormLabel.js +1 -26
- package/lib/components/Grid/CSSGrid.js +2 -15
- package/lib/components/Grid/Column.js +18 -59
- package/lib/components/Grid/ColumnHang.js +2 -5
- package/lib/components/Grid/FlexGrid.js +2 -8
- package/lib/components/Grid/Grid.js +0 -8
- package/lib/components/Grid/GridContext.js +1 -3
- package/lib/components/Grid/Row.js +2 -7
- package/lib/components/Heading/index.js +0 -4
- package/lib/components/Icon/Icon.Skeleton.js +2 -2
- package/lib/components/IconButton/index.js +0 -10
- package/lib/components/IdPrefix/index.js +0 -2
- package/lib/components/InlineCheckbox/InlineCheckbox.js +0 -14
- package/lib/components/InlineLoading/InlineLoading.js +0 -12
- package/lib/components/Layer/index.js +3 -6
- package/lib/components/Layout/LayoutDirection.js +0 -3
- package/lib/components/Layout/useLayoutDirection.js +0 -1
- package/lib/components/Link/Link.js +3 -10
- package/lib/components/ListBox/ListBox.js +2 -13
- package/lib/components/ListBox/ListBoxField.js +0 -5
- package/lib/components/ListBox/ListBoxMenuIcon.js +0 -4
- package/lib/components/ListBox/ListBoxMenuItem.js +2 -6
- package/lib/components/ListBox/ListBoxPropTypes.d.ts +2 -2
- package/lib/components/ListBox/ListBoxSelection.js +1 -13
- package/lib/components/ListBox/next/ListBoxSelection.js +1 -14
- package/lib/components/ListBox/next/ListBoxTrigger.js +1 -3
- package/lib/components/ListItem/ListItem.d.ts +23 -0
- package/lib/components/ListItem/ListItem.js +4 -8
- package/lib/components/ListItem/index.d.ts +7 -0
- package/lib/components/Loading/Loading.js +0 -6
- package/lib/components/Menu/Menu.js +22 -40
- package/lib/components/Menu/MenuContext.js +4 -5
- package/lib/components/Menu/MenuItem.js +5 -39
- package/lib/components/MenuButton/index.js +0 -9
- package/lib/components/Modal/Modal.js +0 -43
- package/lib/components/ModalWrapper/ModalWrapper.js +2 -15
- package/lib/components/MultiSelect/FilterableMultiSelect.js +8 -66
- package/lib/components/MultiSelect/MultiSelect.js +30 -78
- package/lib/components/MultiSelect/MultiSelectPropTypes.js +0 -1
- package/lib/components/MultiSelect/index.js +0 -1
- package/lib/components/MultiSelect/tools/itemToString.js +0 -2
- package/lib/components/MultiSelect/tools/sorting.js +3 -4
- package/lib/components/Notification/Notification.js +0 -78
- package/lib/components/NumberInput/NumberInput.Skeleton.js +0 -2
- package/lib/components/NumberInput/NumberInput.js +3 -60
- package/lib/components/OrderedList/OrderedList.d.ts +39 -0
- package/lib/components/OrderedList/OrderedList.js +7 -19
- package/lib/components/OrderedList/index.d.ts +7 -0
- package/lib/components/OverflowMenu/OverflowMenu.js +65 -86
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +6 -23
- package/lib/components/OverflowMenuV2/index.js +0 -5
- package/lib/components/Pagination/Pagination.Skeleton.js +0 -2
- package/lib/components/Pagination/Pagination.js +11 -47
- package/lib/components/Pagination/experimental/PageSelector.js +0 -10
- package/lib/components/Pagination/experimental/Pagination.js +2 -67
- package/lib/components/PaginationNav/PaginationNav.js +15 -78
- package/lib/components/Popover/index.d.ts +14 -8
- package/lib/components/Popover/index.js +44 -48
- package/lib/components/PrimaryButton/PrimaryButton.js +0 -1
- package/lib/components/ProgressBar/ProgressBar.js +0 -15
- package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +0 -4
- package/lib/components/ProgressIndicator/ProgressIndicator.js +2 -40
- package/lib/components/RadioButton/RadioButton.Skeleton.js +0 -1
- package/lib/components/RadioButton/RadioButton.js +0 -13
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +3 -23
- package/lib/components/RadioTile/RadioTile.js +0 -12
- package/lib/components/Search/Search.Skeleton.js +0 -2
- package/lib/components/Search/Search.js +1 -28
- package/lib/components/SecondaryButton/SecondaryButton.js +0 -1
- package/lib/components/Select/Select.Skeleton.js +0 -2
- package/lib/components/Select/Select.d.ts +1 -1
- package/lib/components/Select/Select.js +6 -33
- package/lib/components/SelectItem/SelectItem.js +0 -5
- package/lib/components/SelectItemGroup/SelectItemGroup.d.ts +0 -1
- package/lib/components/SelectItemGroup/SelectItemGroup.js +1 -26
- package/lib/components/SkeletonIcon/SkeletonIcon.js +0 -2
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +0 -1
- package/lib/components/SkeletonText/SkeletonText.js +0 -12
- package/lib/components/Slider/Slider.Skeleton.js +0 -2
- package/lib/components/Slider/Slider.d.ts +0 -1
- package/lib/components/Slider/Slider.js +112 -154
- package/lib/components/Stack/Stack.js +1 -8
- package/lib/components/StructuredList/StructuredList.Skeleton.js +0 -5
- package/lib/components/StructuredList/StructuredList.js +1 -25
- package/lib/components/Switch/IconSwitch.js +0 -18
- package/lib/components/Switch/Switch.js +0 -11
- package/lib/components/TabContent/TabContent.js +2 -6
- package/lib/components/Tabs/Tabs.Skeleton.js +0 -4
- package/lib/components/Tabs/Tabs.js +133 -102
- package/lib/components/Tabs/usePressable.js +18 -31
- package/lib/components/Tag/Tag.Skeleton.js +0 -2
- package/lib/components/Tag/Tag.js +0 -15
- package/lib/components/Text/Text.js +5 -18
- package/lib/components/Text/TextDirection.js +0 -3
- package/lib/components/Text/TextDirectionContext.js +0 -1
- package/lib/components/Text/createTextComponent.js +0 -3
- package/lib/components/TextArea/TextArea.Skeleton.js +0 -2
- package/lib/components/TextArea/TextArea.js +10 -32
- package/lib/components/TextInput/ControlledPasswordInput.js +0 -20
- package/lib/components/TextInput/PasswordInput.js +0 -25
- package/lib/components/TextInput/TextInput.Skeleton.js +0 -2
- package/lib/components/TextInput/TextInput.d.ts +1 -1
- package/lib/components/TextInput/TextInput.js +5 -52
- package/lib/components/TextInput/util.js +3 -5
- package/lib/components/Theme/index.js +1 -6
- package/lib/components/Tile/Tile.js +31 -58
- package/lib/components/TileGroup/TileGroup.js +1 -22
- package/lib/components/TimePicker/TimePicker.js +6 -32
- package/lib/components/TimePickerSelect/TimePickerSelect.js +2 -5
- package/lib/components/Toggle/Toggle.Skeleton.js +0 -8
- package/lib/components/Toggle/Toggle.js +0 -16
- package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +0 -7
- package/lib/components/Toggletip/index.d.ts +148 -0
- package/lib/components/Toggletip/index.js +20 -44
- package/lib/components/Tooltip/DefinitionTooltip.js +0 -11
- package/lib/components/Tooltip/Tooltip.d.ts +1 -1
- package/lib/components/Tooltip/Tooltip.js +4 -21
- package/lib/components/TreeView/TreeNode.js +21 -66
- package/lib/components/TreeView/TreeView.js +11 -67
- package/lib/components/UIShell/Content.js +2 -4
- package/lib/components/UIShell/Header.js +0 -2
- package/lib/components/UIShell/HeaderContainer.d.ts +33 -0
- package/lib/components/UIShell/HeaderContainer.js +13 -11
- package/lib/components/UIShell/HeaderGlobalAction.js +0 -6
- package/lib/components/UIShell/HeaderGlobalBar.js +0 -1
- package/lib/components/UIShell/HeaderMenu.js +32 -31
- package/lib/components/UIShell/HeaderMenuButton.js +2 -4
- package/lib/components/UIShell/HeaderMenuItem.js +0 -8
- package/lib/components/UIShell/HeaderName.js +0 -5
- package/lib/components/UIShell/HeaderNavigation.js +0 -2
- package/lib/components/UIShell/HeaderPanel.js +0 -2
- package/lib/components/UIShell/HeaderSideNavItems.js +0 -2
- package/lib/components/UIShell/Link.js +2 -3
- package/lib/components/UIShell/SideNav.d.ts +3 -1
- package/lib/components/UIShell/SideNav.js +43 -35
- package/lib/components/UIShell/SideNavDetails.js +0 -3
- package/lib/components/UIShell/SideNavDivider.js +0 -1
- package/lib/components/UIShell/SideNavFooter.js +1 -4
- package/lib/components/UIShell/SideNavHeader.js +0 -4
- package/lib/components/UIShell/SideNavIcon.js +0 -3
- package/lib/components/UIShell/SideNavItem.js +0 -3
- package/lib/components/UIShell/SideNavItems.js +2 -6
- package/lib/components/UIShell/SideNavLink.js +3 -7
- package/lib/components/UIShell/SideNavLinkText.js +0 -2
- package/lib/components/UIShell/SideNavMenu.js +0 -16
- package/lib/components/UIShell/SideNavMenuItem.js +0 -2
- package/lib/components/UIShell/SideNavSwitcher.js +2 -5
- package/lib/components/UIShell/SkipToContent.d.ts +32 -0
- package/lib/components/UIShell/SkipToContent.js +8 -15
- package/lib/components/UIShell/Switcher.js +0 -2
- package/lib/components/UIShell/SwitcherDivider.js +0 -1
- package/lib/components/UIShell/SwitcherItem.js +0 -3
- package/lib/components/UnorderedList/UnorderedList.d.ts +34 -0
- package/lib/components/UnorderedList/UnorderedList.js +6 -16
- package/lib/components/UnorderedList/index.d.ts +7 -0
- package/lib/index.js +42 -43
- package/lib/internal/ClickListener.js +3 -13
- package/lib/internal/FloatingMenu.js +57 -63
- package/lib/internal/OptimizedResize.js +6 -12
- package/lib/internal/Selection.js +2 -25
- package/lib/internal/createClassWrapper.js +0 -2
- package/lib/internal/deprecateFieldOnObject.js +0 -4
- package/lib/internal/focus/index.js +0 -1
- package/lib/internal/keyboard/keys.js +2 -1
- package/lib/internal/keyboard/match.js +1 -6
- package/lib/internal/keyboard/navigation.js +8 -7
- package/lib/internal/useAnnouncer.js +0 -1
- package/lib/internal/useAttachedMenu.js +1 -9
- package/lib/internal/useControllableState.js +6 -13
- package/lib/internal/useDelayedState.js +2 -4
- package/lib/internal/useEffectOnce.js +0 -1
- package/lib/internal/useEvent.js +61 -2
- package/lib/internal/useId.js +2 -5
- package/lib/internal/useIsomorphicEffect.js +1 -0
- package/lib/internal/useMergedRefs.js +2 -2
- package/lib/internal/useNoInteractiveChildren.js +2 -13
- package/lib/internal/useNormalizedInputProps.js +0 -3
- package/lib/internal/useSavedCallback.js +1 -2
- package/lib/internal/warning.js +0 -3
- package/lib/internal/wrapFocus.js +1 -8
- package/lib/prop-types/deprecate.js +2 -5
- package/lib/prop-types/isRequiredOneOf.js +2 -5
- package/lib/prop-types/requiredIfGivenPropIsTruthy.js +0 -2
- package/lib/tools/array.js +0 -3
- package/lib/tools/events.js +0 -3
- package/lib/tools/mergeRefs.js +0 -2
- package/lib/tools/wrapComponent.js +2 -5
- package/package.json +9 -9
- package/es/components/Tab/Tab.js +0 -185
- package/es/components/Tab/index.js +0 -14
- package/es/components/TimePickerSelect/index.js +0 -13
- package/lib/components/Form/index.js +0 -17
- package/lib/components/Tab/Tab.js +0 -214
- package/lib/components/Tab/index.js +0 -39
- package/lib/components/TimePickerSelect/index.js +0 -38
|
@@ -43,64 +43,53 @@ function usePressable(ref) {
|
|
|
43
43
|
React.useEffect(() => {
|
|
44
44
|
const {
|
|
45
45
|
current: element
|
|
46
|
-
} = ref;
|
|
46
|
+
} = ref;
|
|
47
47
|
|
|
48
|
+
// Fired when a pointer becomes active buttons state.
|
|
48
49
|
function onPointerDown(event) {
|
|
49
|
-
var _savedOnPressIn$curre;
|
|
50
|
-
|
|
51
50
|
setPendingLongPress(true);
|
|
52
|
-
|
|
51
|
+
savedOnPressIn.current?.();
|
|
53
52
|
event.preventDefault();
|
|
54
|
-
}
|
|
55
|
-
|
|
53
|
+
}
|
|
56
54
|
|
|
55
|
+
// Fired when a pointer is no longer active buttons state.
|
|
57
56
|
function onPointerUp() {
|
|
58
|
-
var _savedOnPressOut$curr;
|
|
59
|
-
|
|
60
57
|
setPendingLongPress(false);
|
|
61
58
|
setLongPress(false);
|
|
62
|
-
|
|
63
|
-
}
|
|
59
|
+
savedOnPressOut.current?.(state.current);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// A browser fires this event if it concludes the pointer
|
|
64
63
|
// will no longer be able to generate events (for example
|
|
65
64
|
// the related device is deactivated).
|
|
66
|
-
|
|
67
|
-
|
|
68
65
|
function onPointerCancel() {
|
|
69
|
-
var _savedOnPressOut$curr2;
|
|
70
|
-
|
|
71
66
|
setPendingLongPress(false);
|
|
72
67
|
setLongPress(false);
|
|
73
|
-
|
|
68
|
+
savedOnPressOut.current?.();
|
|
74
69
|
state.current.longPress = false;
|
|
75
|
-
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Fired when a pointer is moved out of the hit test
|
|
76
73
|
// boundaries of an element. For pen devices, this event
|
|
77
74
|
// is fired when the stylus leaves the hover range
|
|
78
75
|
// detectable by the digitizer.
|
|
79
|
-
|
|
80
|
-
|
|
81
76
|
function onPointerLeave() {
|
|
82
|
-
var _savedOnPressOut$curr3;
|
|
83
|
-
|
|
84
77
|
setPendingLongPress(false);
|
|
85
78
|
setLongPress(false);
|
|
86
|
-
|
|
79
|
+
savedOnPressOut.current?.();
|
|
87
80
|
state.current.longPress = false;
|
|
88
81
|
}
|
|
89
|
-
|
|
90
82
|
function onClick() {
|
|
91
|
-
var _savedOnPress$current;
|
|
92
|
-
|
|
93
83
|
setLongPress(false);
|
|
94
84
|
setPendingLongPress(false);
|
|
95
|
-
|
|
85
|
+
savedOnPress.current?.(state.current);
|
|
96
86
|
state.current.longPress = false;
|
|
97
|
-
}
|
|
98
|
-
|
|
87
|
+
}
|
|
99
88
|
|
|
89
|
+
// Certain devices treat long press events as context menu triggers
|
|
100
90
|
function onContextMenu(event) {
|
|
101
91
|
event.preventDefault();
|
|
102
92
|
}
|
|
103
|
-
|
|
104
93
|
element.addEventListener('pointerdown', onPointerDown);
|
|
105
94
|
element.addEventListener('pointerup', onPointerUp);
|
|
106
95
|
element.addEventListener('pointercancel', onPointerCancel);
|
|
@@ -129,10 +118,8 @@ function usePressable(ref) {
|
|
|
129
118
|
}, [pendingLongPress, delayLongPressMs]);
|
|
130
119
|
React.useEffect(() => {
|
|
131
120
|
if (longPress) {
|
|
132
|
-
var _savedOnLongPress$cur;
|
|
133
|
-
|
|
134
121
|
state.current.longPress = true;
|
|
135
|
-
return
|
|
122
|
+
return savedOnLongPress.current?.();
|
|
136
123
|
}
|
|
137
124
|
}, [longPress]);
|
|
138
125
|
}
|
|
@@ -34,13 +34,11 @@ function TagSkeleton(_ref) {
|
|
|
34
34
|
})
|
|
35
35
|
}, rest));
|
|
36
36
|
}
|
|
37
|
-
|
|
38
37
|
TagSkeleton.propTypes = {
|
|
39
38
|
/**
|
|
40
39
|
* Specify an optional className to add.
|
|
41
40
|
*/
|
|
42
41
|
className: PropTypes__default["default"].string,
|
|
43
|
-
|
|
44
42
|
/**
|
|
45
43
|
* Specify the size of the Tag. Currently supports either `sm` or
|
|
46
44
|
* default sizes.
|
|
@@ -39,7 +39,6 @@ const TYPES = {
|
|
|
39
39
|
'high-contrast': 'High-Contrast',
|
|
40
40
|
outline: 'Outline'
|
|
41
41
|
};
|
|
42
|
-
|
|
43
42
|
const Tag = _ref => {
|
|
44
43
|
let {
|
|
45
44
|
children,
|
|
@@ -63,18 +62,15 @@ const Tag = _ref => {
|
|
|
63
62
|
[`${prefix}--tag--${type}`]: type,
|
|
64
63
|
[`${prefix}--tag--interactive`]: other.onClick && !filter
|
|
65
64
|
});
|
|
66
|
-
|
|
67
65
|
const handleClose = event => {
|
|
68
66
|
if (onClose) {
|
|
69
67
|
event.stopPropagation();
|
|
70
68
|
onClose(event);
|
|
71
69
|
}
|
|
72
70
|
};
|
|
73
|
-
|
|
74
71
|
if (filter) {
|
|
75
72
|
return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
|
|
76
73
|
className: tagClasses,
|
|
77
|
-
"aria-label": title !== undefined ? `${title} ${children}` : `Clear filter ${children}`,
|
|
78
74
|
id: tagId
|
|
79
75
|
}, other), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
80
76
|
className: `${prefix}--tag__label`,
|
|
@@ -88,7 +84,6 @@ const Tag = _ref => {
|
|
|
88
84
|
title: title
|
|
89
85
|
}, _Close || (_Close = /*#__PURE__*/React__default["default"].createElement(iconsReact.Close, null))));
|
|
90
86
|
}
|
|
91
|
-
|
|
92
87
|
const ComponentTag = other.onClick ? 'button' : 'div';
|
|
93
88
|
return /*#__PURE__*/React__default["default"].createElement(ComponentTag, _rollupPluginBabelHelpers["extends"]({
|
|
94
89
|
disabled: ComponentTag === 'button' ? disabled : null,
|
|
@@ -100,55 +95,45 @@ const Tag = _ref => {
|
|
|
100
95
|
title: typeof children === 'string' ? children : null
|
|
101
96
|
}, children !== null && children !== undefined ? children : TYPES[type]));
|
|
102
97
|
};
|
|
103
|
-
|
|
104
98
|
Tag.propTypes = {
|
|
105
99
|
/**
|
|
106
100
|
* Provide content to be rendered inside of a <Tag>
|
|
107
101
|
*/
|
|
108
102
|
children: PropTypes__default["default"].node,
|
|
109
|
-
|
|
110
103
|
/**
|
|
111
104
|
* Provide a custom className that is applied to the containing <span>
|
|
112
105
|
*/
|
|
113
106
|
className: PropTypes__default["default"].string,
|
|
114
|
-
|
|
115
107
|
/**
|
|
116
108
|
* Specify if the <Tag> is disabled
|
|
117
109
|
*/
|
|
118
110
|
disabled: PropTypes__default["default"].bool,
|
|
119
|
-
|
|
120
111
|
/**
|
|
121
112
|
* Determine if <Tag> is a filter/chip
|
|
122
113
|
*/
|
|
123
114
|
filter: PropTypes__default["default"].bool,
|
|
124
|
-
|
|
125
115
|
/**
|
|
126
116
|
* Specify the id for the tag.
|
|
127
117
|
*/
|
|
128
118
|
id: PropTypes__default["default"].string,
|
|
129
|
-
|
|
130
119
|
/**
|
|
131
120
|
* Click handler for filter tag close button.
|
|
132
121
|
*/
|
|
133
122
|
onClose: PropTypes__default["default"].func,
|
|
134
|
-
|
|
135
123
|
/**
|
|
136
124
|
* Optional prop to render a custom icon.
|
|
137
125
|
* Can be a React component class
|
|
138
126
|
*/
|
|
139
127
|
renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object]),
|
|
140
|
-
|
|
141
128
|
/**
|
|
142
129
|
* Specify the size of the Tag. Currently supports either `sm` or
|
|
143
130
|
* 'md' (default) sizes.
|
|
144
131
|
*/
|
|
145
132
|
size: PropTypes__default["default"].oneOf(['sm', 'md']),
|
|
146
|
-
|
|
147
133
|
/**
|
|
148
134
|
* Text to show on clear filters
|
|
149
135
|
*/
|
|
150
136
|
title: PropTypes__default["default"].string,
|
|
151
|
-
|
|
152
137
|
/**
|
|
153
138
|
* Specify the type of the <Tag>
|
|
154
139
|
*/
|
|
@@ -30,9 +30,9 @@ function Text(_ref) {
|
|
|
30
30
|
const context = React.useContext(TextDirectionContext.TextDirectionContext);
|
|
31
31
|
const textProps = {};
|
|
32
32
|
const BaseComponent = as ?? 'span';
|
|
33
|
-
const value = {
|
|
33
|
+
const value = {
|
|
34
|
+
...context
|
|
34
35
|
};
|
|
35
|
-
|
|
36
36
|
if (!context) {
|
|
37
37
|
textProps.dir = dir;
|
|
38
38
|
value.direction = dir;
|
|
@@ -41,11 +41,9 @@ function Text(_ref) {
|
|
|
41
41
|
direction: parentDirection,
|
|
42
42
|
getTextDirection
|
|
43
43
|
} = context;
|
|
44
|
-
|
|
45
44
|
if (getTextDirection && getTextDirection.current) {
|
|
46
45
|
const text = getTextFromChildren(children);
|
|
47
46
|
const override = getTextDirection.current(text);
|
|
48
|
-
|
|
49
47
|
if (parentDirection !== override) {
|
|
50
48
|
textProps.dir = override;
|
|
51
49
|
value.direction = override;
|
|
@@ -59,51 +57,40 @@ function Text(_ref) {
|
|
|
59
57
|
textProps.dir = dir;
|
|
60
58
|
}
|
|
61
59
|
}
|
|
62
|
-
|
|
63
60
|
return /*#__PURE__*/React__default["default"].createElement(TextDirectionContext.TextDirectionContext.Provider, {
|
|
64
61
|
value: value
|
|
65
62
|
}, /*#__PURE__*/React__default["default"].createElement(BaseComponent, _rollupPluginBabelHelpers["extends"]({}, rest, textProps), children));
|
|
66
63
|
}
|
|
67
|
-
|
|
68
64
|
Text.propTypes = {
|
|
69
65
|
/**
|
|
70
66
|
* Provide a custom element type used to render the outermost node
|
|
71
67
|
*/
|
|
72
68
|
as: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].string, PropTypes__default["default"].elementType]),
|
|
73
|
-
|
|
74
69
|
/**
|
|
75
70
|
* Provide child elements or text to be rendered inside of this component
|
|
76
71
|
*/
|
|
77
72
|
children: PropTypes__default["default"].node.isRequired,
|
|
78
|
-
|
|
79
73
|
/**
|
|
80
74
|
* Specify the text direction to be used for this component and any of its
|
|
81
75
|
* children
|
|
82
76
|
*/
|
|
83
77
|
dir: PropTypes__default["default"].oneOf(['ltr', 'rtl', 'auto'])
|
|
84
78
|
};
|
|
85
|
-
|
|
86
79
|
function getTextFromChildren(children) {
|
|
87
|
-
var _React$Children$map;
|
|
88
|
-
|
|
89
80
|
if (typeof children === 'string') {
|
|
90
81
|
return children;
|
|
91
82
|
}
|
|
92
|
-
|
|
93
|
-
const text = (_React$Children$map = React__default["default"].Children.map(children, child => {
|
|
83
|
+
const text = React__default["default"].Children.map(children, child => {
|
|
94
84
|
if (typeof child === 'string') {
|
|
95
85
|
return child;
|
|
96
86
|
}
|
|
97
|
-
|
|
98
87
|
return null;
|
|
99
|
-
})
|
|
88
|
+
})?.filter(text => {
|
|
100
89
|
return text !== null;
|
|
101
90
|
});
|
|
102
|
-
|
|
103
|
-
if ((text === null || text === void 0 ? void 0 : text.length) === 1) {
|
|
91
|
+
if (text?.length === 1) {
|
|
104
92
|
return text[0];
|
|
105
93
|
}
|
|
106
|
-
|
|
107
94
|
return text;
|
|
108
95
|
}
|
|
109
96
|
|
|
@@ -38,18 +38,15 @@ function TextDirection(_ref) {
|
|
|
38
38
|
value: value
|
|
39
39
|
}, children);
|
|
40
40
|
}
|
|
41
|
-
|
|
42
41
|
TextDirection.propTypes = {
|
|
43
42
|
/**
|
|
44
43
|
* Provide children to be rendered inside of this component
|
|
45
44
|
*/
|
|
46
45
|
children: PropTypes__default["default"].node,
|
|
47
|
-
|
|
48
46
|
/**
|
|
49
47
|
* Specify the text direction for rendered children
|
|
50
48
|
*/
|
|
51
49
|
dir: PropTypes__default["default"].oneOf(['ltr', 'rtl', 'auto']),
|
|
52
|
-
|
|
53
50
|
/**
|
|
54
51
|
* Optionally provide a custom function to get the text direction for a piece
|
|
55
52
|
* of text. Whatever is returned will become the value of the `dir` attribute
|
|
@@ -23,18 +23,15 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
23
23
|
* @param {string} element
|
|
24
24
|
* @param {string} displayName
|
|
25
25
|
*/
|
|
26
|
-
|
|
27
26
|
function createTextComponent(element, displayName) {
|
|
28
27
|
function TextWrapper(props) {
|
|
29
28
|
return /*#__PURE__*/React__default["default"].createElement(Text.Text, _rollupPluginBabelHelpers["extends"]({
|
|
30
29
|
as: element
|
|
31
30
|
}, props));
|
|
32
31
|
}
|
|
33
|
-
|
|
34
32
|
if (process.env.NODE_ENV !== "production") {
|
|
35
33
|
TextWrapper.displayName = displayName;
|
|
36
34
|
}
|
|
37
|
-
|
|
38
35
|
return TextWrapper;
|
|
39
36
|
}
|
|
40
37
|
|
|
@@ -36,13 +36,11 @@ const TextAreaSkeleton = props => {
|
|
|
36
36
|
className: `${prefix}--skeleton ${prefix}--text-area`
|
|
37
37
|
}));
|
|
38
38
|
};
|
|
39
|
-
|
|
40
39
|
TextAreaSkeleton.propTypes = {
|
|
41
40
|
/**
|
|
42
41
|
* Specify an optional className to add to the form item wrapper.
|
|
43
42
|
*/
|
|
44
43
|
className: PropTypes__default["default"].string,
|
|
45
|
-
|
|
46
44
|
/**
|
|
47
45
|
* Specify whether the label should be hidden, or not
|
|
48
46
|
*/
|
|
@@ -15,7 +15,6 @@ var React = require('react');
|
|
|
15
15
|
var cx = require('classnames');
|
|
16
16
|
var deprecate = require('../../prop-types/deprecate.js');
|
|
17
17
|
var iconsReact = require('@carbon/icons-react');
|
|
18
|
-
var index = require('../FeatureFlags/index.js');
|
|
19
18
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
20
19
|
require('../FluidForm/FluidForm.js');
|
|
21
20
|
var FormContext = require('../FluidForm/FormContext.js');
|
|
@@ -54,23 +53,26 @@ const TextArea = /*#__PURE__*/React__default["default"].forwardRef((props, forwa
|
|
|
54
53
|
const {
|
|
55
54
|
isFluid
|
|
56
55
|
} = React.useContext(FormContext.FormContext);
|
|
57
|
-
const enabled = index.useFeatureFlag('enable-v11-release');
|
|
58
56
|
const {
|
|
59
57
|
defaultValue,
|
|
60
58
|
value,
|
|
61
59
|
disabled
|
|
62
60
|
} = other;
|
|
63
|
-
const [textCount, setTextCount] = React.useState(
|
|
61
|
+
const [textCount, setTextCount] = React.useState(defaultValue?.toString()?.length || value?.toString()?.length || 0);
|
|
64
62
|
const {
|
|
65
63
|
current: textAreaInstanceId
|
|
66
64
|
} = React.useRef(getInstanceId());
|
|
65
|
+
React.useEffect(() => {
|
|
66
|
+
setTextCount(defaultValue?.toString()?.length || value?.toString()?.length || 0);
|
|
67
|
+
}, [value, defaultValue]);
|
|
67
68
|
const textareaProps = {
|
|
68
69
|
id,
|
|
69
70
|
onChange: evt => {
|
|
70
71
|
if (!other.disabled && onChange) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
// delay textCount assignation to give the textarea element value time to catch up if is a controlled input
|
|
73
|
+
setTimeout(() => {
|
|
74
|
+
setTextCount(evt.target.value?.length);
|
|
75
|
+
}, 0);
|
|
74
76
|
onChange(evt);
|
|
75
77
|
}
|
|
76
78
|
},
|
|
@@ -80,11 +82,9 @@ const TextArea = /*#__PURE__*/React__default["default"].forwardRef((props, forwa
|
|
|
80
82
|
}
|
|
81
83
|
}
|
|
82
84
|
};
|
|
83
|
-
|
|
84
85
|
if (enableCounter) {
|
|
85
86
|
textareaProps.maxLength = maxCount;
|
|
86
87
|
}
|
|
87
|
-
|
|
88
88
|
const ariaAnnouncement = useAnnouncer.useAnnouncer(textCount, maxCount);
|
|
89
89
|
const labelClasses = cx__default["default"](`${prefix}--label`, {
|
|
90
90
|
[`${prefix}--visually-hidden`]: hideLabel && !isFluid,
|
|
@@ -122,7 +122,7 @@ const TextArea = /*#__PURE__*/React__default["default"].forwardRef((props, forwa
|
|
|
122
122
|
}, warnText, isFluid && /*#__PURE__*/React__default["default"].createElement(iconsReact.WarningAltFilled, {
|
|
123
123
|
className: `${prefix}--text-area__invalid-icon ${prefix}--text-area__invalid-icon--warning`
|
|
124
124
|
})) : null;
|
|
125
|
-
const textareaClasses = cx__default["default"](`${prefix}--text-area`,
|
|
125
|
+
const textareaClasses = cx__default["default"](`${prefix}--text-area`, {
|
|
126
126
|
[`${prefix}--text-area--light`]: light,
|
|
127
127
|
[`${prefix}--text-area--invalid`]: invalid,
|
|
128
128
|
[`${prefix}--text-area--warn`]: warn
|
|
@@ -138,13 +138,11 @@ const TextArea = /*#__PURE__*/React__default["default"].forwardRef((props, forwa
|
|
|
138
138
|
}
|
|
139
139
|
}, [other.cols]);
|
|
140
140
|
let ariaDescribedBy;
|
|
141
|
-
|
|
142
141
|
if (invalid) {
|
|
143
142
|
ariaDescribedBy = errorId;
|
|
144
143
|
} else if (!invalid && !warn && !isFluid && helperText) {
|
|
145
144
|
ariaDescribedBy = helperId;
|
|
146
145
|
}
|
|
147
|
-
|
|
148
146
|
const input = /*#__PURE__*/React__default["default"].createElement("textarea", _rollupPluginBabelHelpers["extends"]({}, other, textareaProps, {
|
|
149
147
|
placeholder: placeholder,
|
|
150
148
|
className: textareaClasses,
|
|
@@ -155,7 +153,7 @@ const TextArea = /*#__PURE__*/React__default["default"].forwardRef((props, forwa
|
|
|
155
153
|
ref: ref
|
|
156
154
|
}));
|
|
157
155
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
158
|
-
className:
|
|
156
|
+
className: cx__default["default"](`${prefix}--form-item`, className)
|
|
159
157
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
160
158
|
className: `${prefix}--text-area__label-wrapper`
|
|
161
159
|
}, label, counter), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -182,106 +180,86 @@ TextArea.propTypes = {
|
|
|
182
180
|
* `<textarea>` node
|
|
183
181
|
*/
|
|
184
182
|
className: PropTypes__default["default"].string,
|
|
185
|
-
|
|
186
183
|
/**
|
|
187
184
|
* Specify the `cols` attribute for the underlying `<textarea>` node
|
|
188
185
|
*/
|
|
189
186
|
cols: PropTypes__default["default"].number,
|
|
190
|
-
|
|
191
187
|
/**
|
|
192
188
|
* Optionally provide the default value of the `<textarea>`
|
|
193
189
|
*/
|
|
194
190
|
defaultValue: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].number]),
|
|
195
|
-
|
|
196
191
|
/**
|
|
197
192
|
* Specify whether the control is disabled
|
|
198
193
|
*/
|
|
199
194
|
disabled: PropTypes__default["default"].bool,
|
|
200
|
-
|
|
201
195
|
/**
|
|
202
196
|
* Specify whether to display the character counter
|
|
203
197
|
*/
|
|
204
198
|
enableCounter: PropTypes__default["default"].bool,
|
|
205
|
-
|
|
206
199
|
/**
|
|
207
200
|
* Provide text that is used alongside the control label for additional help
|
|
208
201
|
*/
|
|
209
202
|
helperText: PropTypes__default["default"].node,
|
|
210
|
-
|
|
211
203
|
/**
|
|
212
204
|
* Specify whether you want the underlying label to be visually hidden
|
|
213
205
|
*/
|
|
214
206
|
hideLabel: PropTypes__default["default"].bool,
|
|
215
|
-
|
|
216
207
|
/**
|
|
217
208
|
* Provide a unique identifier for the control
|
|
218
209
|
*/
|
|
219
210
|
id: PropTypes__default["default"].string,
|
|
220
|
-
|
|
221
211
|
/**
|
|
222
212
|
* Specify whether the control is currently invalid
|
|
223
213
|
*/
|
|
224
214
|
invalid: PropTypes__default["default"].bool,
|
|
225
|
-
|
|
226
215
|
/**
|
|
227
216
|
* Provide the text that is displayed when the control is in an invalid state
|
|
228
217
|
*/
|
|
229
218
|
invalidText: PropTypes__default["default"].node,
|
|
230
|
-
|
|
231
219
|
/**
|
|
232
220
|
* Provide the text that will be read by a screen reader when visiting this
|
|
233
221
|
* control
|
|
234
222
|
*/
|
|
235
223
|
labelText: PropTypes__default["default"].node.isRequired,
|
|
236
|
-
|
|
237
224
|
/**
|
|
238
225
|
* `true` to use the light version. For use on $ui-01 backgrounds only.
|
|
239
226
|
* Don't use this to make tile background color same as container background color.
|
|
240
227
|
*/
|
|
241
228
|
light: deprecate["default"](PropTypes__default["default"].bool, 'The `light` prop for `TextArea` has ' + 'been deprecated in favor of the new `Layer` component. It will be removed in the next major release.'),
|
|
242
|
-
|
|
243
229
|
/**
|
|
244
230
|
* Max character count allowed for the textarea. This is needed in order for enableCounter to display
|
|
245
231
|
*/
|
|
246
232
|
maxCount: PropTypes__default["default"].number,
|
|
247
|
-
|
|
248
233
|
/**
|
|
249
234
|
* Optionally provide an `onChange` handler that is called whenever `<textarea>`
|
|
250
235
|
* is updated
|
|
251
236
|
*/
|
|
252
237
|
onChange: PropTypes__default["default"].func,
|
|
253
|
-
|
|
254
238
|
/**
|
|
255
239
|
* Optionally provide an `onClick` handler that is called whenever the
|
|
256
240
|
* `<textarea>` is clicked
|
|
257
241
|
*/
|
|
258
242
|
onClick: PropTypes__default["default"].func,
|
|
259
|
-
|
|
260
243
|
/**
|
|
261
244
|
* Specify the placeholder attribute for the `<textarea>`
|
|
262
245
|
*/
|
|
263
246
|
placeholder: PropTypes__default["default"].string,
|
|
264
|
-
|
|
265
247
|
/**
|
|
266
248
|
* Whether the textarea should be read-only
|
|
267
249
|
*/
|
|
268
250
|
readOnly: PropTypes__default["default"].bool,
|
|
269
|
-
|
|
270
251
|
/**
|
|
271
252
|
* Specify the rows attribute for the `<textarea>`
|
|
272
253
|
*/
|
|
273
254
|
rows: PropTypes__default["default"].number,
|
|
274
|
-
|
|
275
255
|
/**
|
|
276
256
|
* Provide the current value of the `<textarea>`
|
|
277
257
|
*/
|
|
278
258
|
value: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].number]),
|
|
279
|
-
|
|
280
259
|
/**
|
|
281
260
|
* Specify whether the control is currently in warning state
|
|
282
261
|
*/
|
|
283
262
|
warn: PropTypes__default["default"].bool,
|
|
284
|
-
|
|
285
263
|
/**
|
|
286
264
|
* Provide the text that is displayed when the control is in warning state
|
|
287
265
|
*/
|
|
@@ -56,12 +56,10 @@ const ControlledPasswordInput = /*#__PURE__*/React__default["default"].forwardRe
|
|
|
56
56
|
const {
|
|
57
57
|
current: controlledPasswordInstanceId
|
|
58
58
|
} = React.useRef(getInstanceId());
|
|
59
|
-
|
|
60
59
|
if (process.env.NODE_ENV !== "production") {
|
|
61
60
|
process.env.NODE_ENV !== "production" ? warning.warning(didWarnAboutDeprecation, '`<TextInput.ControlledPasswordInput>` has been deprecated in favor of `<TextInput.PasswordInput />` and will be removed in the next major release of `carbon-components-react`') : void 0;
|
|
62
61
|
didWarnAboutDeprecation = true;
|
|
63
62
|
}
|
|
64
|
-
|
|
65
63
|
const errorId = id + '-error-msg';
|
|
66
64
|
const textInputClasses = cx__default["default"](`${prefix}--text-input`, `${prefix}--password-input`, className, {
|
|
67
65
|
[`${prefix}--text-input--light`]: light,
|
|
@@ -147,98 +145,80 @@ ControlledPasswordInput.propTypes = {
|
|
|
147
145
|
* `<input>` node
|
|
148
146
|
*/
|
|
149
147
|
className: PropTypes__default["default"].string,
|
|
150
|
-
|
|
151
148
|
/**
|
|
152
149
|
* Optionally provide the default value of the `<input>`
|
|
153
150
|
*/
|
|
154
151
|
defaultValue: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].number]),
|
|
155
|
-
|
|
156
152
|
/**
|
|
157
153
|
* Specify whether the control is disabled
|
|
158
154
|
*/
|
|
159
155
|
disabled: PropTypes__default["default"].bool,
|
|
160
|
-
|
|
161
156
|
/**
|
|
162
157
|
* Provide text that is used alongside the control label for additional help
|
|
163
158
|
*/
|
|
164
159
|
helperText: PropTypes__default["default"].node,
|
|
165
|
-
|
|
166
160
|
/**
|
|
167
161
|
* Specify whether or not the underlying label is visually hidden
|
|
168
162
|
*/
|
|
169
163
|
hideLabel: PropTypes__default["default"].bool,
|
|
170
|
-
|
|
171
164
|
/**
|
|
172
165
|
* "Hide password" tooltip text on password visibility toggle
|
|
173
166
|
*/
|
|
174
167
|
hidePasswordLabel: PropTypes__default["default"].string,
|
|
175
|
-
|
|
176
168
|
/**
|
|
177
169
|
* Provide a unique identifier for the input field
|
|
178
170
|
*/
|
|
179
171
|
id: PropTypes__default["default"].string.isRequired,
|
|
180
|
-
|
|
181
172
|
/**
|
|
182
173
|
* Specify whether the control is currently invalid
|
|
183
174
|
*/
|
|
184
175
|
invalid: PropTypes__default["default"].bool,
|
|
185
|
-
|
|
186
176
|
/**
|
|
187
177
|
* Provide the text that is displayed when the control is in an invalid state
|
|
188
178
|
*/
|
|
189
179
|
invalidText: PropTypes__default["default"].node,
|
|
190
|
-
|
|
191
180
|
/**
|
|
192
181
|
* Provide the text that will be read by a screen reader when visiting this
|
|
193
182
|
* control
|
|
194
183
|
*/
|
|
195
184
|
labelText: PropTypes__default["default"].node.isRequired,
|
|
196
|
-
|
|
197
185
|
/**
|
|
198
186
|
* `true` to use the light version. For use on $ui-01 backgrounds only.
|
|
199
187
|
* Don't use this to make tile background color same as container background color.
|
|
200
188
|
*/
|
|
201
189
|
light: deprecate["default"](PropTypes__default["default"].bool, 'The `light` prop for `ControlledPasswordInput` has ' + 'been deprecated in favor of the new `Layer` component. It will be removed in the next major release.'),
|
|
202
|
-
|
|
203
190
|
/**
|
|
204
191
|
* Optionally provide an `onChange` handler that is called whenever `<input>`
|
|
205
192
|
* is updated
|
|
206
193
|
*/
|
|
207
194
|
onChange: PropTypes__default["default"].func,
|
|
208
|
-
|
|
209
195
|
/**
|
|
210
196
|
* Optionally provide an `onClick` handler that is called whenever the
|
|
211
197
|
* `<input>` is clicked
|
|
212
198
|
*/
|
|
213
199
|
onClick: PropTypes__default["default"].func,
|
|
214
|
-
|
|
215
200
|
/**
|
|
216
201
|
* Specify the placeholder attribute for the `<input>`
|
|
217
202
|
*/
|
|
218
203
|
placeholder: PropTypes__default["default"].string,
|
|
219
|
-
|
|
220
204
|
/**
|
|
221
205
|
* "Show password" tooltip text on password visibility toggle
|
|
222
206
|
*/
|
|
223
207
|
showPasswordLabel: PropTypes__default["default"].string,
|
|
224
|
-
|
|
225
208
|
/**
|
|
226
209
|
* Specify the size of the Text Input.
|
|
227
210
|
*/
|
|
228
211
|
size: PropTypes__default["default"].oneOf(['sm', 'md', 'lg']),
|
|
229
|
-
|
|
230
212
|
/**
|
|
231
213
|
* Specify the alignment of the tooltip to the icon-only button.
|
|
232
214
|
* Can be one of: start, center, or end.
|
|
233
215
|
*/
|
|
234
216
|
tooltipAlignment: PropTypes__default["default"].oneOf(['start', 'center', 'end']),
|
|
235
|
-
|
|
236
217
|
/**
|
|
237
218
|
* Specify the direction of the tooltip for icon-only buttons.
|
|
238
219
|
* Can be either top, right, bottom, or left.
|
|
239
220
|
*/
|
|
240
221
|
tooltipPosition: PropTypes__default["default"].oneOf(['top', 'right', 'bottom', 'left']),
|
|
241
|
-
|
|
242
222
|
/**
|
|
243
223
|
* Provide the current value of the `<input>`
|
|
244
224
|
*/
|