@carbon/react 1.29.1 → 1.30.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 +153 -175
- 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 +5 -12
- package/es/components/FileUploader/Filename.js +6 -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 +1 -46
- 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 +0 -1
- 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 +153 -175
- 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 +5 -31
- package/lib/components/FileUploader/Filename.js +6 -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 +1 -46
- 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 +0 -1
- 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
|
@@ -68,12 +68,10 @@ const PasswordInput = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
|
68
68
|
const {
|
|
69
69
|
isFluid
|
|
70
70
|
} = React.useContext(FormContext.FormContext);
|
|
71
|
-
|
|
72
71
|
const handleTogglePasswordVisibility = event => {
|
|
73
72
|
setInputType(inputType === 'password' ? 'text' : 'password');
|
|
74
73
|
onTogglePasswordVisibility && onTogglePasswordVisibility(event);
|
|
75
74
|
};
|
|
76
|
-
|
|
77
75
|
const textInputClasses = cx__default["default"](`${prefix}--text-input`, `${prefix}--password-input`, className, {
|
|
78
76
|
[`${prefix}--text-input--light`]: light,
|
|
79
77
|
[`${prefix}--text-input--invalid`]: normalizedProps.invalid,
|
|
@@ -187,124 +185,101 @@ PasswordInput.propTypes = {
|
|
|
187
185
|
* `<input>` node
|
|
188
186
|
*/
|
|
189
187
|
className: PropTypes__default["default"].string,
|
|
190
|
-
|
|
191
188
|
/**
|
|
192
189
|
* Optionally provide the default value of the `<input>`
|
|
193
190
|
*/
|
|
194
191
|
defaultValue: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].number]),
|
|
195
|
-
|
|
196
192
|
/**
|
|
197
193
|
* Specify whether the control is disabled
|
|
198
194
|
*/
|
|
199
195
|
disabled: PropTypes__default["default"].bool,
|
|
200
|
-
|
|
201
196
|
/**
|
|
202
197
|
* Provide text that is used alongside the control label for additional help
|
|
203
198
|
*/
|
|
204
199
|
helperText: PropTypes__default["default"].node,
|
|
205
|
-
|
|
206
200
|
/**
|
|
207
201
|
* Specify whether or not the underlying label is visually hidden
|
|
208
202
|
*/
|
|
209
203
|
hideLabel: PropTypes__default["default"].bool,
|
|
210
|
-
|
|
211
204
|
/**
|
|
212
205
|
* "Hide password" tooltip text on password visibility toggle
|
|
213
206
|
*/
|
|
214
207
|
hidePasswordLabel: PropTypes__default["default"].string,
|
|
215
|
-
|
|
216
208
|
/**
|
|
217
209
|
* Provide a unique identifier for the input field
|
|
218
210
|
*/
|
|
219
211
|
id: PropTypes__default["default"].string.isRequired,
|
|
220
|
-
|
|
221
212
|
/**
|
|
222
213
|
* `true` to use the inline version.
|
|
223
214
|
*/
|
|
224
215
|
inline: PropTypes__default["default"].bool,
|
|
225
|
-
|
|
226
216
|
/**
|
|
227
217
|
* Specify whether the control is currently invalid
|
|
228
218
|
*/
|
|
229
219
|
invalid: PropTypes__default["default"].bool,
|
|
230
|
-
|
|
231
220
|
/**
|
|
232
221
|
* Provide the text that is displayed when the control is in an invalid state
|
|
233
222
|
*/
|
|
234
223
|
invalidText: PropTypes__default["default"].node,
|
|
235
|
-
|
|
236
224
|
/**
|
|
237
225
|
* Provide the text that will be read by a screen reader when visiting this
|
|
238
226
|
* control
|
|
239
227
|
*/
|
|
240
228
|
labelText: PropTypes__default["default"].node.isRequired,
|
|
241
|
-
|
|
242
229
|
/**
|
|
243
230
|
* `true` to use the light version. For use on $ui-01 backgrounds only.
|
|
244
231
|
* Don't use this to make tile background color same as container background color.
|
|
245
232
|
*/
|
|
246
233
|
light: deprecate["default"](PropTypes__default["default"].bool, 'The `light` prop for `PasswordInput` has ' + 'been deprecated in favor of the new `Layer` component. It will be removed in the next major release.'),
|
|
247
|
-
|
|
248
234
|
/**
|
|
249
235
|
* Optionally provide an `onChange` handler that is called whenever `<input>`
|
|
250
236
|
* is updated
|
|
251
237
|
*/
|
|
252
238
|
onChange: PropTypes__default["default"].func,
|
|
253
|
-
|
|
254
239
|
/**
|
|
255
240
|
* Optionally provide an `onClick` handler that is called whenever the
|
|
256
241
|
* `<input>` is clicked
|
|
257
242
|
*/
|
|
258
243
|
onClick: PropTypes__default["default"].func,
|
|
259
|
-
|
|
260
244
|
/**
|
|
261
245
|
* Callback function that is called whenever the toggle password visibility
|
|
262
246
|
* button is clicked
|
|
263
247
|
*/
|
|
264
248
|
onTogglePasswordVisibility: PropTypes__default["default"].func,
|
|
265
|
-
|
|
266
249
|
/**
|
|
267
250
|
* Specify the placeholder attribute for the `<input>`
|
|
268
251
|
*/
|
|
269
252
|
placeholder: PropTypes__default["default"].string,
|
|
270
|
-
|
|
271
253
|
/**
|
|
272
254
|
* "Show password" tooltip text on password visibility toggle
|
|
273
255
|
*/
|
|
274
256
|
showPasswordLabel: PropTypes__default["default"].string,
|
|
275
|
-
|
|
276
257
|
/**
|
|
277
258
|
* Specify the size of the Text Input. Supports `sm`, `md`, or `lg`.
|
|
278
259
|
*/
|
|
279
260
|
size: PropTypes__default["default"].oneOf(['sm', 'md', 'lg']),
|
|
280
|
-
|
|
281
261
|
/**
|
|
282
262
|
* Specify the alignment of the tooltip to the icon-only button.
|
|
283
263
|
* Can be one of: start, center, or end.
|
|
284
264
|
*/
|
|
285
265
|
tooltipAlignment: PropTypes__default["default"].oneOf(['start', 'center', 'end']),
|
|
286
|
-
|
|
287
266
|
/**
|
|
288
267
|
* Specify the direction of the tooltip for icon-only buttons.
|
|
289
268
|
* Can be either top, right, bottom, or left.
|
|
290
269
|
*/
|
|
291
270
|
tooltipPosition: PropTypes__default["default"].oneOf(['top', 'right', 'bottom', 'left']),
|
|
292
|
-
|
|
293
271
|
/**
|
|
294
272
|
* The input type, either password or text
|
|
295
273
|
*/
|
|
296
274
|
type: PropTypes__default["default"].oneOf(['password', 'text']),
|
|
297
|
-
|
|
298
275
|
/**
|
|
299
276
|
* Provide the current value of the `<input>`
|
|
300
277
|
*/
|
|
301
278
|
value: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].number]),
|
|
302
|
-
|
|
303
279
|
/**
|
|
304
280
|
* Specify whether the control is currently in warning state
|
|
305
281
|
*/
|
|
306
282
|
warn: PropTypes__default["default"].bool,
|
|
307
|
-
|
|
308
283
|
/**
|
|
309
284
|
* Provide the text that is displayed when the control is in warning state
|
|
310
285
|
*/
|
|
@@ -36,13 +36,11 @@ const TextInputSkeleton = _ref => {
|
|
|
36
36
|
className: `${prefix}--skeleton ${prefix}--text-input`
|
|
37
37
|
}));
|
|
38
38
|
};
|
|
39
|
-
|
|
40
39
|
TextInputSkeleton.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
|
*/
|
|
@@ -67,7 +67,7 @@ export interface TextInputProps extends Omit<React.InputHTMLAttributes<HTMLInput
|
|
|
67
67
|
* Optionally provide an `onChange` handler that is called whenever `<input>`
|
|
68
68
|
* is updated
|
|
69
69
|
*/
|
|
70
|
-
onChange?: (event: React.ChangeEvent<HTMLInputElement
|
|
70
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
71
71
|
/**
|
|
72
72
|
* Optionally provide an `onClick` handler that is called whenever the
|
|
73
73
|
* `<input>` is clicked
|
|
@@ -19,35 +19,14 @@ var deprecate = require('../../prop-types/deprecate.js');
|
|
|
19
19
|
var util = require('./util.js');
|
|
20
20
|
require('../FluidForm/FluidForm.js');
|
|
21
21
|
var FormContext = require('../FluidForm/FormContext.js');
|
|
22
|
-
var index = require('../FeatureFlags/index.js');
|
|
23
|
-
var FeatureFlags = require('@carbon/feature-flags');
|
|
24
22
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
25
23
|
var useAnnouncer = require('../../internal/useAnnouncer.js');
|
|
26
24
|
|
|
27
25
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
28
26
|
|
|
29
|
-
function _interopNamespace(e) {
|
|
30
|
-
if (e && e.__esModule) return e;
|
|
31
|
-
var n = Object.create(null);
|
|
32
|
-
if (e) {
|
|
33
|
-
Object.keys(e).forEach(function (k) {
|
|
34
|
-
if (k !== 'default') {
|
|
35
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
36
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
get: function () { return e[k]; }
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
n["default"] = e;
|
|
44
|
-
return Object.freeze(n);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
27
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
48
28
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
49
29
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
50
|
-
var FeatureFlags__namespace = /*#__PURE__*/_interopNamespace(FeatureFlags);
|
|
51
30
|
|
|
52
31
|
const TextInput = /*#__PURE__*/React__default["default"].forwardRef(function TextInput(_ref, ref) {
|
|
53
32
|
let {
|
|
@@ -74,12 +53,11 @@ const TextInput = /*#__PURE__*/React__default["default"].forwardRef(function Tex
|
|
|
74
53
|
...rest
|
|
75
54
|
} = _ref;
|
|
76
55
|
const prefix = usePrefix.usePrefix();
|
|
77
|
-
const enabled = index.useFeatureFlag('enable-v11-release');
|
|
78
56
|
const {
|
|
79
57
|
defaultValue,
|
|
80
58
|
value
|
|
81
59
|
} = rest;
|
|
82
|
-
const [textCount, setTextCount] = React.useState(
|
|
60
|
+
const [textCount, setTextCount] = React.useState(defaultValue?.toString().length || value?.toString().length || 0);
|
|
83
61
|
const normalizedProps = useNormalizedInputProps.useNormalizedInputProps({
|
|
84
62
|
id,
|
|
85
63
|
readOnly,
|
|
@@ -89,7 +67,7 @@ const TextInput = /*#__PURE__*/React__default["default"].forwardRef(function Tex
|
|
|
89
67
|
warn,
|
|
90
68
|
warnText
|
|
91
69
|
});
|
|
92
|
-
const textInputClasses = cx__default["default"](`${prefix}--text-input`,
|
|
70
|
+
const textInputClasses = cx__default["default"](`${prefix}--text-input`, {
|
|
93
71
|
[`${prefix}--text-input--light`]: light,
|
|
94
72
|
[`${prefix}--text-input--invalid`]: normalizedProps.invalid,
|
|
95
73
|
[`${prefix}--text-input--warning`]: normalizedProps.warn,
|
|
@@ -99,9 +77,7 @@ const TextInput = /*#__PURE__*/React__default["default"].forwardRef(function Tex
|
|
|
99
77
|
id,
|
|
100
78
|
onChange: evt => {
|
|
101
79
|
if (!normalizedProps.disabled) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
setTextCount((_evt$target$value = evt.target.value) === null || _evt$target$value === void 0 ? void 0 : _evt$target$value.length);
|
|
80
|
+
setTextCount(evt.target.value?.length);
|
|
105
81
|
onChange(evt);
|
|
106
82
|
}
|
|
107
83
|
},
|
|
@@ -120,12 +96,10 @@ const TextInput = /*#__PURE__*/React__default["default"].forwardRef(function Tex
|
|
|
120
96
|
['aria-describedby']: helperText && normalizedProps.helperId,
|
|
121
97
|
...rest
|
|
122
98
|
};
|
|
123
|
-
|
|
124
99
|
if (enableCounter) {
|
|
125
100
|
sharedTextInputProps.maxLength = maxCount;
|
|
126
101
|
}
|
|
127
|
-
|
|
128
|
-
const inputWrapperClasses = cx__default["default"]([enabled ? cx__default["default"](`${prefix}--form-item`, className) : `${prefix}--form-item`], `${prefix}--text-input-wrapper`, {
|
|
102
|
+
const inputWrapperClasses = cx__default["default"]([cx__default["default"](`${prefix}--form-item`, className)], `${prefix}--text-input-wrapper`, {
|
|
129
103
|
[`${prefix}--text-input-wrapper--readonly`]: readOnly,
|
|
130
104
|
[`${prefix}--text-input-wrapper--light`]: light,
|
|
131
105
|
[`${prefix}--text-input-wrapper--inline`]: inline,
|
|
@@ -207,111 +181,90 @@ TextInput.propTypes = {
|
|
|
207
181
|
* Specify an optional className to be applied to the `<input>` node
|
|
208
182
|
*/
|
|
209
183
|
className: PropTypes__default["default"].string,
|
|
210
|
-
|
|
211
184
|
/**
|
|
212
185
|
* Optionally provide the default value of the `<input>`
|
|
213
186
|
*/
|
|
214
187
|
defaultValue: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].number]),
|
|
215
|
-
|
|
216
188
|
/**
|
|
217
189
|
* Specify whether the `<input>` should be disabled
|
|
218
190
|
*/
|
|
219
191
|
disabled: PropTypes__default["default"].bool,
|
|
220
|
-
|
|
221
192
|
/**
|
|
222
193
|
* Specify whether to display the character counter
|
|
223
194
|
*/
|
|
224
195
|
enableCounter: PropTypes__default["default"].bool,
|
|
225
|
-
|
|
226
196
|
/**
|
|
227
197
|
* Provide text that is used alongside the control label for additional help
|
|
228
198
|
*/
|
|
229
199
|
helperText: PropTypes__default["default"].node,
|
|
230
|
-
|
|
231
200
|
/**
|
|
232
201
|
* Specify whether you want the underlying label to be visually hidden
|
|
233
202
|
*/
|
|
234
203
|
hideLabel: PropTypes__default["default"].bool,
|
|
235
|
-
|
|
236
204
|
/**
|
|
237
205
|
* Specify a custom `id` for the `<input>`
|
|
238
206
|
*/
|
|
239
207
|
id: PropTypes__default["default"].string.isRequired,
|
|
240
|
-
|
|
241
208
|
/**
|
|
242
209
|
* `true` to use the inline version.
|
|
243
210
|
*/
|
|
244
211
|
inline: PropTypes__default["default"].bool,
|
|
245
|
-
|
|
246
212
|
/**
|
|
247
213
|
* Specify whether the control is currently invalid
|
|
248
214
|
*/
|
|
249
215
|
invalid: PropTypes__default["default"].bool,
|
|
250
|
-
|
|
251
216
|
/**
|
|
252
217
|
* Provide the text that is displayed when the control is in an invalid state
|
|
253
218
|
*/
|
|
254
219
|
invalidText: PropTypes__default["default"].node,
|
|
255
|
-
|
|
256
220
|
/**
|
|
257
221
|
* Provide the text that will be read by a screen reader when visiting this
|
|
258
222
|
* control
|
|
259
223
|
*/
|
|
260
224
|
labelText: PropTypes__default["default"].node.isRequired,
|
|
261
|
-
|
|
262
225
|
/**
|
|
263
226
|
* `true` to use the light version. For use on $ui-01 backgrounds only.
|
|
264
227
|
* Don't use this to make tile background color same as container background color.
|
|
265
228
|
*/
|
|
266
229
|
light: deprecate["default"](PropTypes__default["default"].bool, 'The `light` prop for `TextInput` has ' + 'been deprecated in favor of the new `Layer` component. It will be removed in the next major release.'),
|
|
267
|
-
|
|
268
230
|
/**
|
|
269
231
|
* Max character count allowed for the input. This is needed in order for enableCounter to display
|
|
270
232
|
*/
|
|
271
233
|
maxCount: PropTypes__default["default"].number,
|
|
272
|
-
|
|
273
234
|
/**
|
|
274
235
|
* Optionally provide an `onChange` handler that is called whenever `<input>`
|
|
275
236
|
* is updated
|
|
276
237
|
*/
|
|
277
238
|
onChange: PropTypes__default["default"].func,
|
|
278
|
-
|
|
279
239
|
/**
|
|
280
240
|
* Optionally provide an `onClick` handler that is called whenever the
|
|
281
241
|
* `<input>` is clicked
|
|
282
242
|
*/
|
|
283
243
|
onClick: PropTypes__default["default"].func,
|
|
284
|
-
|
|
285
244
|
/**
|
|
286
245
|
* Specify the placeholder attribute for the `<input>`
|
|
287
246
|
*/
|
|
288
247
|
placeholder: PropTypes__default["default"].string,
|
|
289
|
-
|
|
290
248
|
/**
|
|
291
249
|
* Whether the input should be read-only
|
|
292
250
|
*/
|
|
293
251
|
readOnly: PropTypes__default["default"].bool,
|
|
294
|
-
|
|
295
252
|
/**
|
|
296
253
|
* Specify the size of the Text Input. Currently supports the following:
|
|
297
254
|
*/
|
|
298
|
-
size:
|
|
299
|
-
|
|
255
|
+
size: PropTypes__default["default"].oneOf(['sm', 'md', 'lg']),
|
|
300
256
|
/**
|
|
301
257
|
* Specify the type of the `<input>`
|
|
302
258
|
*/
|
|
303
259
|
type: PropTypes__default["default"].string,
|
|
304
|
-
|
|
305
260
|
/**
|
|
306
261
|
* Specify the value of the `<input>`
|
|
307
262
|
*/
|
|
308
263
|
value: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].number]),
|
|
309
|
-
|
|
310
264
|
/**
|
|
311
265
|
* Specify whether the control is currently in warning state
|
|
312
266
|
*/
|
|
313
267
|
warn: PropTypes__default["default"].bool,
|
|
314
|
-
|
|
315
268
|
/**
|
|
316
269
|
* Provide the text that is displayed when the control is in warning state
|
|
317
270
|
*/
|
|
@@ -14,20 +14,17 @@ const invalidProps = invalidId => ({
|
|
|
14
14
|
'aria-invalid': true,
|
|
15
15
|
'aria-describedby': invalidId
|
|
16
16
|
});
|
|
17
|
-
|
|
18
17
|
const warnProps = warnId => ({
|
|
19
18
|
'aria-describedby': warnId
|
|
20
19
|
});
|
|
21
|
-
|
|
22
20
|
const helperProps = helperId => ({
|
|
23
21
|
'aria-describedby': helperId
|
|
24
22
|
});
|
|
23
|
+
|
|
25
24
|
/**
|
|
26
25
|
* @param {{sharedTextInputProps: object, invalid?: boolean, invalidId?: string, warn?: boolean, warnId?: string, hasHelper?: boolean, helperId?: string}} config
|
|
27
26
|
* @returns {object}
|
|
28
27
|
*/
|
|
29
|
-
|
|
30
|
-
|
|
31
28
|
const textInputProps = _ref => {
|
|
32
29
|
let {
|
|
33
30
|
sharedTextInputProps,
|
|
@@ -38,7 +35,8 @@ const textInputProps = _ref => {
|
|
|
38
35
|
hasHelper,
|
|
39
36
|
helperId
|
|
40
37
|
} = _ref;
|
|
41
|
-
return {
|
|
38
|
+
return {
|
|
39
|
+
...sharedTextInputProps,
|
|
42
40
|
...(invalid ? invalidProps(invalidId) : {}),
|
|
43
41
|
...(warn ? warnProps(warnId) : {}),
|
|
44
42
|
...(hasHelper ? helperProps(helperId) : {})
|
|
@@ -45,13 +45,11 @@ GlobalTheme.propTypes = {
|
|
|
45
45
|
* typically the root of your app
|
|
46
46
|
*/
|
|
47
47
|
children: PropTypes__default["default"].node,
|
|
48
|
-
|
|
49
48
|
/**
|
|
50
49
|
* Specify the global theme for your app
|
|
51
50
|
*/
|
|
52
51
|
theme: PropTypes__default["default"].oneOf(['white', 'g10', 'g90', 'g100'])
|
|
53
52
|
};
|
|
54
|
-
|
|
55
53
|
/**
|
|
56
54
|
* Specify the theme to be applied to a page, or a region in a page
|
|
57
55
|
*/
|
|
@@ -90,27 +88,24 @@ Theme.propTypes = {
|
|
|
90
88
|
* element in the component
|
|
91
89
|
*/
|
|
92
90
|
as: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].string, PropTypes__default["default"].elementType]),
|
|
93
|
-
|
|
94
91
|
/**
|
|
95
92
|
* Provide child elements to be rendered inside of `Theme`
|
|
96
93
|
*/
|
|
97
94
|
children: PropTypes__default["default"].node,
|
|
98
|
-
|
|
99
95
|
/**
|
|
100
96
|
* Provide a custom class name to be used on the outermost element rendered by
|
|
101
97
|
* the component
|
|
102
98
|
*/
|
|
103
99
|
className: PropTypes__default["default"].string,
|
|
104
|
-
|
|
105
100
|
/**
|
|
106
101
|
* Specify the theme
|
|
107
102
|
*/
|
|
108
103
|
theme: PropTypes__default["default"].oneOf(['white', 'g10', 'g90', 'g100'])
|
|
109
104
|
};
|
|
105
|
+
|
|
110
106
|
/**
|
|
111
107
|
* Get access to the current theme
|
|
112
108
|
*/
|
|
113
|
-
|
|
114
109
|
function useTheme() {
|
|
115
110
|
return React__default["default"].useContext(ThemeContext);
|
|
116
111
|
}
|