@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
|
@@ -39,64 +39,53 @@ function usePressable(ref) {
|
|
|
39
39
|
useEffect(() => {
|
|
40
40
|
const {
|
|
41
41
|
current: element
|
|
42
|
-
} = ref;
|
|
42
|
+
} = ref;
|
|
43
43
|
|
|
44
|
+
// Fired when a pointer becomes active buttons state.
|
|
44
45
|
function onPointerDown(event) {
|
|
45
|
-
var _savedOnPressIn$curre;
|
|
46
|
-
|
|
47
46
|
setPendingLongPress(true);
|
|
48
|
-
|
|
47
|
+
savedOnPressIn.current?.();
|
|
49
48
|
event.preventDefault();
|
|
50
|
-
}
|
|
51
|
-
|
|
49
|
+
}
|
|
52
50
|
|
|
51
|
+
// Fired when a pointer is no longer active buttons state.
|
|
53
52
|
function onPointerUp() {
|
|
54
|
-
var _savedOnPressOut$curr;
|
|
55
|
-
|
|
56
53
|
setPendingLongPress(false);
|
|
57
54
|
setLongPress(false);
|
|
58
|
-
|
|
59
|
-
}
|
|
55
|
+
savedOnPressOut.current?.(state.current);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// A browser fires this event if it concludes the pointer
|
|
60
59
|
// will no longer be able to generate events (for example
|
|
61
60
|
// the related device is deactivated).
|
|
62
|
-
|
|
63
|
-
|
|
64
61
|
function onPointerCancel() {
|
|
65
|
-
var _savedOnPressOut$curr2;
|
|
66
|
-
|
|
67
62
|
setPendingLongPress(false);
|
|
68
63
|
setLongPress(false);
|
|
69
|
-
|
|
64
|
+
savedOnPressOut.current?.();
|
|
70
65
|
state.current.longPress = false;
|
|
71
|
-
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Fired when a pointer is moved out of the hit test
|
|
72
69
|
// boundaries of an element. For pen devices, this event
|
|
73
70
|
// is fired when the stylus leaves the hover range
|
|
74
71
|
// detectable by the digitizer.
|
|
75
|
-
|
|
76
|
-
|
|
77
72
|
function onPointerLeave() {
|
|
78
|
-
var _savedOnPressOut$curr3;
|
|
79
|
-
|
|
80
73
|
setPendingLongPress(false);
|
|
81
74
|
setLongPress(false);
|
|
82
|
-
|
|
75
|
+
savedOnPressOut.current?.();
|
|
83
76
|
state.current.longPress = false;
|
|
84
77
|
}
|
|
85
|
-
|
|
86
78
|
function onClick() {
|
|
87
|
-
var _savedOnPress$current;
|
|
88
|
-
|
|
89
79
|
setLongPress(false);
|
|
90
80
|
setPendingLongPress(false);
|
|
91
|
-
|
|
81
|
+
savedOnPress.current?.(state.current);
|
|
92
82
|
state.current.longPress = false;
|
|
93
|
-
}
|
|
94
|
-
|
|
83
|
+
}
|
|
95
84
|
|
|
85
|
+
// Certain devices treat long press events as context menu triggers
|
|
96
86
|
function onContextMenu(event) {
|
|
97
87
|
event.preventDefault();
|
|
98
88
|
}
|
|
99
|
-
|
|
100
89
|
element.addEventListener('pointerdown', onPointerDown);
|
|
101
90
|
element.addEventListener('pointerup', onPointerUp);
|
|
102
91
|
element.addEventListener('pointercancel', onPointerCancel);
|
|
@@ -125,10 +114,8 @@ function usePressable(ref) {
|
|
|
125
114
|
}, [pendingLongPress, delayLongPressMs]);
|
|
126
115
|
useEffect(() => {
|
|
127
116
|
if (longPress) {
|
|
128
|
-
var _savedOnLongPress$cur;
|
|
129
|
-
|
|
130
117
|
state.current.longPress = true;
|
|
131
|
-
return
|
|
118
|
+
return savedOnLongPress.current?.();
|
|
132
119
|
}
|
|
133
120
|
}, [longPress]);
|
|
134
121
|
}
|
|
@@ -24,13 +24,11 @@ function TagSkeleton(_ref) {
|
|
|
24
24
|
})
|
|
25
25
|
}, rest));
|
|
26
26
|
}
|
|
27
|
-
|
|
28
27
|
TagSkeleton.propTypes = {
|
|
29
28
|
/**
|
|
30
29
|
* Specify an optional className to add.
|
|
31
30
|
*/
|
|
32
31
|
className: PropTypes.string,
|
|
33
|
-
|
|
34
32
|
/**
|
|
35
33
|
* Specify the size of the Tag. Currently supports either `sm` or
|
|
36
34
|
* default sizes.
|
package/es/components/Tag/Tag.js
CHANGED
|
@@ -29,7 +29,6 @@ const TYPES = {
|
|
|
29
29
|
'high-contrast': 'High-Contrast',
|
|
30
30
|
outline: 'Outline'
|
|
31
31
|
};
|
|
32
|
-
|
|
33
32
|
const Tag = _ref => {
|
|
34
33
|
let {
|
|
35
34
|
children,
|
|
@@ -53,18 +52,15 @@ const Tag = _ref => {
|
|
|
53
52
|
[`${prefix}--tag--${type}`]: type,
|
|
54
53
|
[`${prefix}--tag--interactive`]: other.onClick && !filter
|
|
55
54
|
});
|
|
56
|
-
|
|
57
55
|
const handleClose = event => {
|
|
58
56
|
if (onClose) {
|
|
59
57
|
event.stopPropagation();
|
|
60
58
|
onClose(event);
|
|
61
59
|
}
|
|
62
60
|
};
|
|
63
|
-
|
|
64
61
|
if (filter) {
|
|
65
62
|
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
66
63
|
className: tagClasses,
|
|
67
|
-
"aria-label": title !== undefined ? `${title} ${children}` : `Clear filter ${children}`,
|
|
68
64
|
id: tagId
|
|
69
65
|
}, other), /*#__PURE__*/React__default.createElement("span", {
|
|
70
66
|
className: `${prefix}--tag__label`,
|
|
@@ -78,7 +74,6 @@ const Tag = _ref => {
|
|
|
78
74
|
title: title
|
|
79
75
|
}, _Close || (_Close = /*#__PURE__*/React__default.createElement(Close, null))));
|
|
80
76
|
}
|
|
81
|
-
|
|
82
77
|
const ComponentTag = other.onClick ? 'button' : 'div';
|
|
83
78
|
return /*#__PURE__*/React__default.createElement(ComponentTag, _extends({
|
|
84
79
|
disabled: ComponentTag === 'button' ? disabled : null,
|
|
@@ -90,55 +85,45 @@ const Tag = _ref => {
|
|
|
90
85
|
title: typeof children === 'string' ? children : null
|
|
91
86
|
}, children !== null && children !== undefined ? children : TYPES[type]));
|
|
92
87
|
};
|
|
93
|
-
|
|
94
88
|
Tag.propTypes = {
|
|
95
89
|
/**
|
|
96
90
|
* Provide content to be rendered inside of a <Tag>
|
|
97
91
|
*/
|
|
98
92
|
children: PropTypes.node,
|
|
99
|
-
|
|
100
93
|
/**
|
|
101
94
|
* Provide a custom className that is applied to the containing <span>
|
|
102
95
|
*/
|
|
103
96
|
className: PropTypes.string,
|
|
104
|
-
|
|
105
97
|
/**
|
|
106
98
|
* Specify if the <Tag> is disabled
|
|
107
99
|
*/
|
|
108
100
|
disabled: PropTypes.bool,
|
|
109
|
-
|
|
110
101
|
/**
|
|
111
102
|
* Determine if <Tag> is a filter/chip
|
|
112
103
|
*/
|
|
113
104
|
filter: PropTypes.bool,
|
|
114
|
-
|
|
115
105
|
/**
|
|
116
106
|
* Specify the id for the tag.
|
|
117
107
|
*/
|
|
118
108
|
id: PropTypes.string,
|
|
119
|
-
|
|
120
109
|
/**
|
|
121
110
|
* Click handler for filter tag close button.
|
|
122
111
|
*/
|
|
123
112
|
onClose: PropTypes.func,
|
|
124
|
-
|
|
125
113
|
/**
|
|
126
114
|
* Optional prop to render a custom icon.
|
|
127
115
|
* Can be a React component class
|
|
128
116
|
*/
|
|
129
117
|
renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
130
|
-
|
|
131
118
|
/**
|
|
132
119
|
* Specify the size of the Tag. Currently supports either `sm` or
|
|
133
120
|
* 'md' (default) sizes.
|
|
134
121
|
*/
|
|
135
122
|
size: PropTypes.oneOf(['sm', 'md']),
|
|
136
|
-
|
|
137
123
|
/**
|
|
138
124
|
* Text to show on clear filters
|
|
139
125
|
*/
|
|
140
126
|
title: PropTypes.string,
|
|
141
|
-
|
|
142
127
|
/**
|
|
143
128
|
* Specify the type of the <Tag>
|
|
144
129
|
*/
|
|
@@ -21,9 +21,9 @@ function Text(_ref) {
|
|
|
21
21
|
const context = useContext(TextDirectionContext);
|
|
22
22
|
const textProps = {};
|
|
23
23
|
const BaseComponent = as ?? 'span';
|
|
24
|
-
const value = {
|
|
24
|
+
const value = {
|
|
25
|
+
...context
|
|
25
26
|
};
|
|
26
|
-
|
|
27
27
|
if (!context) {
|
|
28
28
|
textProps.dir = dir;
|
|
29
29
|
value.direction = dir;
|
|
@@ -32,11 +32,9 @@ function Text(_ref) {
|
|
|
32
32
|
direction: parentDirection,
|
|
33
33
|
getTextDirection
|
|
34
34
|
} = context;
|
|
35
|
-
|
|
36
35
|
if (getTextDirection && getTextDirection.current) {
|
|
37
36
|
const text = getTextFromChildren(children);
|
|
38
37
|
const override = getTextDirection.current(text);
|
|
39
|
-
|
|
40
38
|
if (parentDirection !== override) {
|
|
41
39
|
textProps.dir = override;
|
|
42
40
|
value.direction = override;
|
|
@@ -50,51 +48,40 @@ function Text(_ref) {
|
|
|
50
48
|
textProps.dir = dir;
|
|
51
49
|
}
|
|
52
50
|
}
|
|
53
|
-
|
|
54
51
|
return /*#__PURE__*/React__default.createElement(TextDirectionContext.Provider, {
|
|
55
52
|
value: value
|
|
56
53
|
}, /*#__PURE__*/React__default.createElement(BaseComponent, _extends({}, rest, textProps), children));
|
|
57
54
|
}
|
|
58
|
-
|
|
59
55
|
Text.propTypes = {
|
|
60
56
|
/**
|
|
61
57
|
* Provide a custom element type used to render the outermost node
|
|
62
58
|
*/
|
|
63
59
|
as: PropTypes.oneOfType([PropTypes.func, PropTypes.string, PropTypes.elementType]),
|
|
64
|
-
|
|
65
60
|
/**
|
|
66
61
|
* Provide child elements or text to be rendered inside of this component
|
|
67
62
|
*/
|
|
68
63
|
children: PropTypes.node.isRequired,
|
|
69
|
-
|
|
70
64
|
/**
|
|
71
65
|
* Specify the text direction to be used for this component and any of its
|
|
72
66
|
* children
|
|
73
67
|
*/
|
|
74
68
|
dir: PropTypes.oneOf(['ltr', 'rtl', 'auto'])
|
|
75
69
|
};
|
|
76
|
-
|
|
77
70
|
function getTextFromChildren(children) {
|
|
78
|
-
var _React$Children$map;
|
|
79
|
-
|
|
80
71
|
if (typeof children === 'string') {
|
|
81
72
|
return children;
|
|
82
73
|
}
|
|
83
|
-
|
|
84
|
-
const text = (_React$Children$map = React__default.Children.map(children, child => {
|
|
74
|
+
const text = React__default.Children.map(children, child => {
|
|
85
75
|
if (typeof child === 'string') {
|
|
86
76
|
return child;
|
|
87
77
|
}
|
|
88
|
-
|
|
89
78
|
return null;
|
|
90
|
-
})
|
|
79
|
+
})?.filter(text => {
|
|
91
80
|
return text !== null;
|
|
92
81
|
});
|
|
93
|
-
|
|
94
|
-
if ((text === null || text === void 0 ? void 0 : text.length) === 1) {
|
|
82
|
+
if (text?.length === 1) {
|
|
95
83
|
return text[0];
|
|
96
84
|
}
|
|
97
|
-
|
|
98
85
|
return text;
|
|
99
86
|
}
|
|
100
87
|
|
|
@@ -29,18 +29,15 @@ function TextDirection(_ref) {
|
|
|
29
29
|
value: value
|
|
30
30
|
}, children);
|
|
31
31
|
}
|
|
32
|
-
|
|
33
32
|
TextDirection.propTypes = {
|
|
34
33
|
/**
|
|
35
34
|
* Provide children to be rendered inside of this component
|
|
36
35
|
*/
|
|
37
36
|
children: PropTypes.node,
|
|
38
|
-
|
|
39
37
|
/**
|
|
40
38
|
* Specify the text direction for rendered children
|
|
41
39
|
*/
|
|
42
40
|
dir: PropTypes.oneOf(['ltr', 'rtl', 'auto']),
|
|
43
|
-
|
|
44
41
|
/**
|
|
45
42
|
* Optionally provide a custom function to get the text direction for a piece
|
|
46
43
|
* of text. Whatever is returned will become the value of the `dir` attribute
|
|
@@ -15,18 +15,15 @@ import { Text } from './Text.js';
|
|
|
15
15
|
* @param {string} element
|
|
16
16
|
* @param {string} displayName
|
|
17
17
|
*/
|
|
18
|
-
|
|
19
18
|
function createTextComponent(element, displayName) {
|
|
20
19
|
function TextWrapper(props) {
|
|
21
20
|
return /*#__PURE__*/React__default.createElement(Text, _extends({
|
|
22
21
|
as: element
|
|
23
22
|
}, props));
|
|
24
23
|
}
|
|
25
|
-
|
|
26
24
|
if (process.env.NODE_ENV !== "production") {
|
|
27
25
|
TextWrapper.displayName = displayName;
|
|
28
26
|
}
|
|
29
|
-
|
|
30
27
|
return TextWrapper;
|
|
31
28
|
}
|
|
32
29
|
|
|
@@ -26,13 +26,11 @@ const TextAreaSkeleton = props => {
|
|
|
26
26
|
className: `${prefix}--skeleton ${prefix}--text-area`
|
|
27
27
|
}));
|
|
28
28
|
};
|
|
29
|
-
|
|
30
29
|
TextAreaSkeleton.propTypes = {
|
|
31
30
|
/**
|
|
32
31
|
* Specify an optional className to add to the form item wrapper.
|
|
33
32
|
*/
|
|
34
33
|
className: PropTypes.string,
|
|
35
|
-
|
|
36
34
|
/**
|
|
37
35
|
* Specify whether the label should be hidden, or not
|
|
38
36
|
*/
|
|
@@ -7,11 +7,10 @@
|
|
|
7
7
|
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
|
-
import React__default, { useContext, useState, useRef } from 'react';
|
|
10
|
+
import React__default, { useContext, useState, useRef, useEffect } from 'react';
|
|
11
11
|
import cx from 'classnames';
|
|
12
12
|
import deprecate from '../../prop-types/deprecate.js';
|
|
13
13
|
import { WarningFilled, WarningAltFilled } from '@carbon/icons-react';
|
|
14
|
-
import { useFeatureFlag } from '../FeatureFlags/index.js';
|
|
15
14
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
16
15
|
import '../FluidForm/FluidForm.js';
|
|
17
16
|
import { FormContext } from '../FluidForm/FormContext.js';
|
|
@@ -44,23 +43,26 @@ const TextArea = /*#__PURE__*/React__default.forwardRef((props, forwardRef) => {
|
|
|
44
43
|
const {
|
|
45
44
|
isFluid
|
|
46
45
|
} = useContext(FormContext);
|
|
47
|
-
const enabled = useFeatureFlag('enable-v11-release');
|
|
48
46
|
const {
|
|
49
47
|
defaultValue,
|
|
50
48
|
value,
|
|
51
49
|
disabled
|
|
52
50
|
} = other;
|
|
53
|
-
const [textCount, setTextCount] = useState(
|
|
51
|
+
const [textCount, setTextCount] = useState(defaultValue?.toString()?.length || value?.toString()?.length || 0);
|
|
54
52
|
const {
|
|
55
53
|
current: textAreaInstanceId
|
|
56
54
|
} = useRef(getInstanceId());
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
setTextCount(defaultValue?.toString()?.length || value?.toString()?.length || 0);
|
|
57
|
+
}, [value, defaultValue]);
|
|
57
58
|
const textareaProps = {
|
|
58
59
|
id,
|
|
59
60
|
onChange: evt => {
|
|
60
61
|
if (!other.disabled && onChange) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
// delay textCount assignation to give the textarea element value time to catch up if is a controlled input
|
|
63
|
+
setTimeout(() => {
|
|
64
|
+
setTextCount(evt.target.value?.length);
|
|
65
|
+
}, 0);
|
|
64
66
|
onChange(evt);
|
|
65
67
|
}
|
|
66
68
|
},
|
|
@@ -70,11 +72,9 @@ const TextArea = /*#__PURE__*/React__default.forwardRef((props, forwardRef) => {
|
|
|
70
72
|
}
|
|
71
73
|
}
|
|
72
74
|
};
|
|
73
|
-
|
|
74
75
|
if (enableCounter) {
|
|
75
76
|
textareaProps.maxLength = maxCount;
|
|
76
77
|
}
|
|
77
|
-
|
|
78
78
|
const ariaAnnouncement = useAnnouncer(textCount, maxCount);
|
|
79
79
|
const labelClasses = cx(`${prefix}--label`, {
|
|
80
80
|
[`${prefix}--visually-hidden`]: hideLabel && !isFluid,
|
|
@@ -112,7 +112,7 @@ const TextArea = /*#__PURE__*/React__default.forwardRef((props, forwardRef) => {
|
|
|
112
112
|
}, warnText, isFluid && /*#__PURE__*/React__default.createElement(WarningAltFilled, {
|
|
113
113
|
className: `${prefix}--text-area__invalid-icon ${prefix}--text-area__invalid-icon--warning`
|
|
114
114
|
})) : null;
|
|
115
|
-
const textareaClasses = cx(`${prefix}--text-area`,
|
|
115
|
+
const textareaClasses = cx(`${prefix}--text-area`, {
|
|
116
116
|
[`${prefix}--text-area--light`]: light,
|
|
117
117
|
[`${prefix}--text-area--invalid`]: invalid,
|
|
118
118
|
[`${prefix}--text-area--warn`]: warn
|
|
@@ -128,13 +128,11 @@ const TextArea = /*#__PURE__*/React__default.forwardRef((props, forwardRef) => {
|
|
|
128
128
|
}
|
|
129
129
|
}, [other.cols]);
|
|
130
130
|
let ariaDescribedBy;
|
|
131
|
-
|
|
132
131
|
if (invalid) {
|
|
133
132
|
ariaDescribedBy = errorId;
|
|
134
133
|
} else if (!invalid && !warn && !isFluid && helperText) {
|
|
135
134
|
ariaDescribedBy = helperId;
|
|
136
135
|
}
|
|
137
|
-
|
|
138
136
|
const input = /*#__PURE__*/React__default.createElement("textarea", _extends({}, other, textareaProps, {
|
|
139
137
|
placeholder: placeholder,
|
|
140
138
|
className: textareaClasses,
|
|
@@ -145,7 +143,7 @@ const TextArea = /*#__PURE__*/React__default.forwardRef((props, forwardRef) => {
|
|
|
145
143
|
ref: ref
|
|
146
144
|
}));
|
|
147
145
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
148
|
-
className:
|
|
146
|
+
className: cx(`${prefix}--form-item`, className)
|
|
149
147
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
150
148
|
className: `${prefix}--text-area__label-wrapper`
|
|
151
149
|
}, label, counter), /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -172,106 +170,86 @@ TextArea.propTypes = {
|
|
|
172
170
|
* `<textarea>` node
|
|
173
171
|
*/
|
|
174
172
|
className: PropTypes.string,
|
|
175
|
-
|
|
176
173
|
/**
|
|
177
174
|
* Specify the `cols` attribute for the underlying `<textarea>` node
|
|
178
175
|
*/
|
|
179
176
|
cols: PropTypes.number,
|
|
180
|
-
|
|
181
177
|
/**
|
|
182
178
|
* Optionally provide the default value of the `<textarea>`
|
|
183
179
|
*/
|
|
184
180
|
defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
185
|
-
|
|
186
181
|
/**
|
|
187
182
|
* Specify whether the control is disabled
|
|
188
183
|
*/
|
|
189
184
|
disabled: PropTypes.bool,
|
|
190
|
-
|
|
191
185
|
/**
|
|
192
186
|
* Specify whether to display the character counter
|
|
193
187
|
*/
|
|
194
188
|
enableCounter: PropTypes.bool,
|
|
195
|
-
|
|
196
189
|
/**
|
|
197
190
|
* Provide text that is used alongside the control label for additional help
|
|
198
191
|
*/
|
|
199
192
|
helperText: PropTypes.node,
|
|
200
|
-
|
|
201
193
|
/**
|
|
202
194
|
* Specify whether you want the underlying label to be visually hidden
|
|
203
195
|
*/
|
|
204
196
|
hideLabel: PropTypes.bool,
|
|
205
|
-
|
|
206
197
|
/**
|
|
207
198
|
* Provide a unique identifier for the control
|
|
208
199
|
*/
|
|
209
200
|
id: PropTypes.string,
|
|
210
|
-
|
|
211
201
|
/**
|
|
212
202
|
* Specify whether the control is currently invalid
|
|
213
203
|
*/
|
|
214
204
|
invalid: PropTypes.bool,
|
|
215
|
-
|
|
216
205
|
/**
|
|
217
206
|
* Provide the text that is displayed when the control is in an invalid state
|
|
218
207
|
*/
|
|
219
208
|
invalidText: PropTypes.node,
|
|
220
|
-
|
|
221
209
|
/**
|
|
222
210
|
* Provide the text that will be read by a screen reader when visiting this
|
|
223
211
|
* control
|
|
224
212
|
*/
|
|
225
213
|
labelText: PropTypes.node.isRequired,
|
|
226
|
-
|
|
227
214
|
/**
|
|
228
215
|
* `true` to use the light version. For use on $ui-01 backgrounds only.
|
|
229
216
|
* Don't use this to make tile background color same as container background color.
|
|
230
217
|
*/
|
|
231
218
|
light: deprecate(PropTypes.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.'),
|
|
232
|
-
|
|
233
219
|
/**
|
|
234
220
|
* Max character count allowed for the textarea. This is needed in order for enableCounter to display
|
|
235
221
|
*/
|
|
236
222
|
maxCount: PropTypes.number,
|
|
237
|
-
|
|
238
223
|
/**
|
|
239
224
|
* Optionally provide an `onChange` handler that is called whenever `<textarea>`
|
|
240
225
|
* is updated
|
|
241
226
|
*/
|
|
242
227
|
onChange: PropTypes.func,
|
|
243
|
-
|
|
244
228
|
/**
|
|
245
229
|
* Optionally provide an `onClick` handler that is called whenever the
|
|
246
230
|
* `<textarea>` is clicked
|
|
247
231
|
*/
|
|
248
232
|
onClick: PropTypes.func,
|
|
249
|
-
|
|
250
233
|
/**
|
|
251
234
|
* Specify the placeholder attribute for the `<textarea>`
|
|
252
235
|
*/
|
|
253
236
|
placeholder: PropTypes.string,
|
|
254
|
-
|
|
255
237
|
/**
|
|
256
238
|
* Whether the textarea should be read-only
|
|
257
239
|
*/
|
|
258
240
|
readOnly: PropTypes.bool,
|
|
259
|
-
|
|
260
241
|
/**
|
|
261
242
|
* Specify the rows attribute for the `<textarea>`
|
|
262
243
|
*/
|
|
263
244
|
rows: PropTypes.number,
|
|
264
|
-
|
|
265
245
|
/**
|
|
266
246
|
* Provide the current value of the `<textarea>`
|
|
267
247
|
*/
|
|
268
248
|
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
269
|
-
|
|
270
249
|
/**
|
|
271
250
|
* Specify whether the control is currently in warning state
|
|
272
251
|
*/
|
|
273
252
|
warn: PropTypes.bool,
|
|
274
|
-
|
|
275
253
|
/**
|
|
276
254
|
* Provide the text that is displayed when the control is in warning state
|
|
277
255
|
*/
|
|
@@ -46,12 +46,10 @@ const ControlledPasswordInput = /*#__PURE__*/React__default.forwardRef(function
|
|
|
46
46
|
const {
|
|
47
47
|
current: controlledPasswordInstanceId
|
|
48
48
|
} = useRef(getInstanceId());
|
|
49
|
-
|
|
50
49
|
if (process.env.NODE_ENV !== "production") {
|
|
51
50
|
process.env.NODE_ENV !== "production" ? 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;
|
|
52
51
|
didWarnAboutDeprecation = true;
|
|
53
52
|
}
|
|
54
|
-
|
|
55
53
|
const errorId = id + '-error-msg';
|
|
56
54
|
const textInputClasses = cx(`${prefix}--text-input`, `${prefix}--password-input`, className, {
|
|
57
55
|
[`${prefix}--text-input--light`]: light,
|
|
@@ -137,98 +135,80 @@ ControlledPasswordInput.propTypes = {
|
|
|
137
135
|
* `<input>` node
|
|
138
136
|
*/
|
|
139
137
|
className: PropTypes.string,
|
|
140
|
-
|
|
141
138
|
/**
|
|
142
139
|
* Optionally provide the default value of the `<input>`
|
|
143
140
|
*/
|
|
144
141
|
defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
145
|
-
|
|
146
142
|
/**
|
|
147
143
|
* Specify whether the control is disabled
|
|
148
144
|
*/
|
|
149
145
|
disabled: PropTypes.bool,
|
|
150
|
-
|
|
151
146
|
/**
|
|
152
147
|
* Provide text that is used alongside the control label for additional help
|
|
153
148
|
*/
|
|
154
149
|
helperText: PropTypes.node,
|
|
155
|
-
|
|
156
150
|
/**
|
|
157
151
|
* Specify whether or not the underlying label is visually hidden
|
|
158
152
|
*/
|
|
159
153
|
hideLabel: PropTypes.bool,
|
|
160
|
-
|
|
161
154
|
/**
|
|
162
155
|
* "Hide password" tooltip text on password visibility toggle
|
|
163
156
|
*/
|
|
164
157
|
hidePasswordLabel: PropTypes.string,
|
|
165
|
-
|
|
166
158
|
/**
|
|
167
159
|
* Provide a unique identifier for the input field
|
|
168
160
|
*/
|
|
169
161
|
id: PropTypes.string.isRequired,
|
|
170
|
-
|
|
171
162
|
/**
|
|
172
163
|
* Specify whether the control is currently invalid
|
|
173
164
|
*/
|
|
174
165
|
invalid: PropTypes.bool,
|
|
175
|
-
|
|
176
166
|
/**
|
|
177
167
|
* Provide the text that is displayed when the control is in an invalid state
|
|
178
168
|
*/
|
|
179
169
|
invalidText: PropTypes.node,
|
|
180
|
-
|
|
181
170
|
/**
|
|
182
171
|
* Provide the text that will be read by a screen reader when visiting this
|
|
183
172
|
* control
|
|
184
173
|
*/
|
|
185
174
|
labelText: PropTypes.node.isRequired,
|
|
186
|
-
|
|
187
175
|
/**
|
|
188
176
|
* `true` to use the light version. For use on $ui-01 backgrounds only.
|
|
189
177
|
* Don't use this to make tile background color same as container background color.
|
|
190
178
|
*/
|
|
191
179
|
light: deprecate(PropTypes.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.'),
|
|
192
|
-
|
|
193
180
|
/**
|
|
194
181
|
* Optionally provide an `onChange` handler that is called whenever `<input>`
|
|
195
182
|
* is updated
|
|
196
183
|
*/
|
|
197
184
|
onChange: PropTypes.func,
|
|
198
|
-
|
|
199
185
|
/**
|
|
200
186
|
* Optionally provide an `onClick` handler that is called whenever the
|
|
201
187
|
* `<input>` is clicked
|
|
202
188
|
*/
|
|
203
189
|
onClick: PropTypes.func,
|
|
204
|
-
|
|
205
190
|
/**
|
|
206
191
|
* Specify the placeholder attribute for the `<input>`
|
|
207
192
|
*/
|
|
208
193
|
placeholder: PropTypes.string,
|
|
209
|
-
|
|
210
194
|
/**
|
|
211
195
|
* "Show password" tooltip text on password visibility toggle
|
|
212
196
|
*/
|
|
213
197
|
showPasswordLabel: PropTypes.string,
|
|
214
|
-
|
|
215
198
|
/**
|
|
216
199
|
* Specify the size of the Text Input.
|
|
217
200
|
*/
|
|
218
201
|
size: PropTypes.oneOf(['sm', 'md', 'lg']),
|
|
219
|
-
|
|
220
202
|
/**
|
|
221
203
|
* Specify the alignment of the tooltip to the icon-only button.
|
|
222
204
|
* Can be one of: start, center, or end.
|
|
223
205
|
*/
|
|
224
206
|
tooltipAlignment: PropTypes.oneOf(['start', 'center', 'end']),
|
|
225
|
-
|
|
226
207
|
/**
|
|
227
208
|
* Specify the direction of the tooltip for icon-only buttons.
|
|
228
209
|
* Can be either top, right, bottom, or left.
|
|
229
210
|
*/
|
|
230
211
|
tooltipPosition: PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
|
|
231
|
-
|
|
232
212
|
/**
|
|
233
213
|
* Provide the current value of the `<input>`
|
|
234
214
|
*/
|