@carbon/react 1.87.0-rc.0 → 1.87.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +853 -853
- package/es/_virtual/_rollupPluginBabelHelpers.js +4 -4
- package/es/components/Button/Button.js +1 -1
- package/es/components/Button/index.js +5 -1
- package/es/components/ButtonSet/index.js +4 -1
- package/es/components/Checkbox/index.js +4 -1
- package/es/components/ComboBox/ComboBox.js +1 -1
- package/es/components/ComboBox/index.js +4 -1
- package/es/components/ComposedModal/ComposedModal.js +18 -8
- package/es/components/ContainedList/ContainedListItem/index.js +4 -1
- package/es/components/ContainedList/index.js +2 -2
- package/es/components/Copy/Copy.js +1 -1
- package/es/components/Copy/index.js +4 -1
- package/es/components/CopyButton/index.js +4 -1
- package/es/components/DataTable/Table.js +1 -1
- package/es/components/DataTable/state/getDerivedStateFromProps.d.ts +19 -0
- package/es/components/DataTable/state/getDerivedStateFromProps.js +1 -2
- package/es/components/DataTable/state/sorting.d.ts +15 -0
- package/es/components/DataTable/state/sorting.js +1 -2
- package/es/components/DataTable/tools/denormalize.d.ts +22 -0
- package/es/components/DataTable/tools/denormalize.js +1 -2
- package/es/components/DataTable/tools/normalize.d.ts +9 -0
- package/es/components/DataTable/tools/normalize.js +1 -2
- package/es/components/DatePicker/DatePicker.js +18 -11
- package/es/components/DatePicker/index.js +4 -1
- package/es/components/DatePicker/plugins/fixEventsPlugin.d.ts +2 -0
- package/es/components/DatePicker/plugins/rangePlugin.d.ts +2 -0
- package/es/components/DatePickerInput/DatePickerInput.js +6 -0
- package/es/components/DatePickerInput/index.js +4 -1
- package/es/components/Dialog/index.js +2 -2
- package/es/components/Dropdown/Dropdown.js +2 -2
- package/es/components/Dropdown/index.js +4 -1
- package/es/components/FeatureFlags/index.js +2 -2
- package/es/components/FluidSelect/index.js +4 -1
- package/es/components/FluidTextInput/index.js +4 -1
- package/es/components/IconIndicator/index.js +1 -1
- package/es/components/InlineCheckbox/index.js +4 -1
- package/es/components/InlineLoading/index.js +4 -1
- package/es/components/LayoutDirection/LayoutDirection.js +1 -2
- package/es/components/Link/index.js +4 -1
- package/es/components/ListBox/ListBox.js +1 -1
- package/es/components/Loading/index.js +4 -1
- package/es/components/Menu/Menu.d.ts +3 -1
- package/es/components/Menu/Menu.js +3 -1
- package/es/components/Menu/MenuItem.js +1 -1
- package/es/components/Modal/Modal.js +16 -5
- package/es/components/Modal/index.js +4 -1
- package/es/components/MultiSelect/FilterableMultiSelect.js +3 -3
- package/es/components/MultiSelect/MultiSelect.js +2 -2
- package/es/components/MultiSelect/filter.js +0 -4
- package/es/components/MultiSelect/tools/itemToString.d.ts +1 -0
- package/es/components/MultiSelect/tools/sorting.d.ts +9 -0
- package/es/components/Notification/Notification.js +2 -2
- package/es/components/NumberInput/NumberInput.js +1 -1
- package/es/components/OverflowMenu/next/index.js +1 -1
- package/es/components/OverflowMenuItem/index.js +4 -1
- package/es/components/OverflowMenuV2/index.d.ts +1 -0
- package/es/components/PageHeader/PageHeader.js +1 -1
- package/es/components/Pagination/experimental/PageSelector.d.ts +19 -0
- package/es/components/Pagination/experimental/Pagination.d.ts +43 -0
- package/es/components/Pagination/experimental/index.d.ts +3 -0
- package/es/components/Popover/index.js +21 -4
- package/es/components/RadioButton/index.js +4 -1
- package/es/components/RadioTile/index.js +4 -1
- package/es/components/Search/Search.js +1 -1
- package/es/components/Search/index.js +4 -1
- package/es/components/Select/index.js +4 -1
- package/es/components/SelectItem/index.js +4 -1
- package/es/components/ShapeIndicator/index.js +1 -1
- package/es/components/SkeletonText/index.js +4 -1
- package/es/components/Slider/Slider.js +1 -1
- package/es/components/Switch/IconSwitch.d.ts +3 -0
- package/es/components/Switch/IconSwitch.js +1 -2
- package/es/components/TabContent/TabContent.js +2 -22
- package/es/components/Tabs/Tabs.js +5 -5
- package/es/components/Tag/DismissibleTag.js +1 -1
- package/es/components/TextArea/TextArea.js +1 -1
- package/es/components/TextArea/index.js +4 -1
- package/es/components/TextInput/index.js +4 -1
- package/es/components/TextInput/util.d.ts +9 -0
- package/es/components/Toggletip/index.js +2 -2
- package/es/components/UIShell/HeaderMenu.js +2 -2
- package/es/components/UIShell/SideNav.js +1 -1
- package/es/components/UIShell/_utils.d.ts +7 -0
- package/es/feature-flags.d.ts +1 -0
- package/es/internal/FloatingMenu.js +1 -1
- package/es/internal/deprecateFieldOnObject.js +1 -1
- package/es/internal/useId.d.ts +21 -0
- package/es/internal/useId.js +27 -1
- package/es/internal/useOverflowItems.js +0 -6
- package/es/node_modules/es-toolkit/dist/compat/function/{debounce.mjs.js → debounce.js} +1 -1
- package/es/node_modules/es-toolkit/dist/compat/function/{throttle.mjs.js → throttle.js} +1 -1
- package/es/prop-types/deprecateComponent.d.ts +1 -0
- package/es/prop-types/deprecateComponent.js +1 -4
- package/es/prop-types/deprecateValuesWithin.d.ts +1 -0
- package/es/prop-types/requiredIfGivenPropIsTruthy.d.ts +14 -0
- package/es/tools/mergeRefs.d.ts +12 -0
- package/es/tools/mergeRefs.js +1 -2
- package/icons/index.js +1 -3
- package/lib/_virtual/_rollupPluginBabelHelpers.js +5 -7
- package/lib/components/AILabel/index.js +35 -43
- package/lib/components/AISkeleton/AISkeletonIcon.js +5 -11
- package/lib/components/AISkeleton/AISkeletonPlaceholder.js +4 -10
- package/lib/components/AISkeleton/AISkeletonText.js +8 -14
- package/lib/components/Accordion/Accordion.Skeleton.js +21 -27
- package/lib/components/Accordion/Accordion.js +11 -17
- package/lib/components/Accordion/AccordionItem.js +19 -25
- package/lib/components/Accordion/AccordionProvider.js +1 -7
- package/lib/components/AspectRatio/AspectRatio.js +7 -13
- package/lib/components/BadgeIndicator/index.js +7 -13
- package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +7 -13
- package/lib/components/Breadcrumb/Breadcrumb.js +9 -15
- package/lib/components/Breadcrumb/BreadcrumbItem.js +16 -22
- package/lib/components/Button/Button.Skeleton.js +8 -14
- package/lib/components/Button/Button.js +31 -36
- package/lib/components/Button/ButtonBase.js +6 -11
- package/lib/components/Button/index.js +3 -3
- package/lib/components/ButtonSet/ButtonSet.js +6 -12
- package/lib/components/ButtonSet/index.js +2 -2
- package/lib/components/ChatButton/ChatButton.Skeleton.js +5 -11
- package/lib/components/ChatButton/ChatButton.js +12 -18
- package/lib/components/Checkbox/Checkbox.Skeleton.js +6 -12
- package/lib/components/Checkbox/Checkbox.js +33 -39
- package/lib/components/Checkbox/index.js +3 -3
- package/lib/components/CheckboxGroup/CheckboxGroup.js +24 -30
- package/lib/components/ClassPrefix/index.js +3 -10
- package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +10 -16
- package/lib/components/CodeSnippet/CodeSnippet.js +39 -46
- package/lib/components/ComboBox/ComboBox.js +57 -64
- package/lib/components/ComboBox/index.js +2 -2
- package/lib/components/ComboButton/index.js +20 -28
- package/lib/components/ComposedModal/ComposedModal.js +61 -57
- package/lib/components/ComposedModal/ModalFooter.js +37 -45
- package/lib/components/ComposedModal/ModalHeader.js +23 -31
- package/lib/components/ContainedList/ContainedList.js +18 -24
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +14 -20
- package/lib/components/ContainedList/ContainedListItem/index.js +2 -2
- package/lib/components/ContainedList/index.js +5 -5
- package/lib/components/ContentSwitcher/ContentSwitcher.js +11 -19
- package/lib/components/ContextMenu/useContextMenu.js +1 -1
- package/lib/components/Copy/Copy.js +12 -18
- package/lib/components/Copy/index.js +2 -2
- package/lib/components/CopyButton/CopyButton.js +12 -18
- package/lib/components/CopyButton/index.js +2 -2
- package/lib/components/DangerButton/DangerButton.js +2 -6
- package/lib/components/DataTable/DataTable.js +48 -55
- package/lib/components/DataTable/Table.js +18 -24
- package/lib/components/DataTable/TableActionList.js +2 -2
- package/lib/components/DataTable/TableBatchAction.js +4 -9
- package/lib/components/DataTable/TableBatchActions.js +19 -25
- package/lib/components/DataTable/TableBody.js +5 -10
- package/lib/components/DataTable/TableCell.js +8 -14
- package/lib/components/DataTable/TableContainer.js +14 -20
- package/lib/components/DataTable/TableContext.js +0 -2
- package/lib/components/DataTable/TableDecoratorRow.js +5 -11
- package/lib/components/DataTable/TableExpandHeader.js +16 -22
- package/lib/components/DataTable/TableExpandRow.js +20 -26
- package/lib/components/DataTable/TableExpandedRow.js +8 -14
- package/lib/components/DataTable/TableHead.js +2 -2
- package/lib/components/DataTable/TableHeader.js +26 -32
- package/lib/components/DataTable/TableRow.js +8 -14
- package/lib/components/DataTable/TableSelectAll.js +13 -19
- package/lib/components/DataTable/TableSelectRow.js +15 -21
- package/lib/components/DataTable/TableSlugRow.js +7 -13
- package/lib/components/DataTable/TableToolbar.js +7 -13
- package/lib/components/DataTable/TableToolbarAction.js +5 -10
- package/lib/components/DataTable/TableToolbarContent.js +2 -2
- package/lib/components/DataTable/TableToolbarMenu.js +9 -15
- package/lib/components/DataTable/TableToolbarSearch.js +22 -28
- package/lib/components/DataTable/state/getDerivedStateFromProps.d.ts +19 -0
- package/lib/components/DataTable/state/getDerivedStateFromProps.js +2 -3
- package/lib/components/DataTable/state/sortStates.js +0 -2
- package/lib/components/DataTable/state/sorting.d.ts +15 -0
- package/lib/components/DataTable/state/sorting.js +0 -2
- package/lib/components/DataTable/tools/cells.js +0 -2
- package/lib/components/DataTable/tools/denormalize.d.ts +22 -0
- package/lib/components/DataTable/tools/denormalize.js +1 -2
- package/lib/components/DataTable/tools/filter.js +0 -2
- package/lib/components/DataTable/tools/normalize.d.ts +9 -0
- package/lib/components/DataTable/tools/normalize.js +1 -2
- package/lib/components/DataTable/tools/sorting.js +0 -2
- package/lib/components/DataTableSkeleton/DataTableSkeleton.js +25 -31
- package/lib/components/DatePicker/DatePicker.Skeleton.js +14 -20
- package/lib/components/DatePicker/DatePicker.js +65 -66
- package/lib/components/DatePicker/index.js +3 -3
- package/lib/components/DatePicker/plugins/appendToPlugin.js +0 -2
- package/lib/components/DatePicker/plugins/fixEventsPlugin.d.ts +2 -0
- package/lib/components/DatePicker/plugins/fixEventsPlugin.js +1 -1
- package/lib/components/DatePicker/plugins/rangePlugin.d.ts +2 -0
- package/lib/components/DatePicker/plugins/rangePlugin.js +2 -6
- package/lib/components/DatePickerInput/DatePickerInput.js +49 -49
- package/lib/components/DatePickerInput/index.js +2 -2
- package/lib/components/Dialog/index.js +72 -80
- package/lib/components/Dropdown/Dropdown.Skeleton.js +8 -14
- package/lib/components/Dropdown/Dropdown.js +49 -55
- package/lib/components/Dropdown/index.js +3 -3
- package/lib/components/ErrorBoundary/ErrorBoundary.js +4 -9
- package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +0 -2
- package/lib/components/ExpandableSearch/ExpandableSearch.js +6 -11
- package/lib/components/FeatureFlags/index.js +10 -17
- package/lib/components/FileUploader/FileUploader.Skeleton.js +7 -13
- package/lib/components/FileUploader/FileUploader.js +30 -36
- package/lib/components/FileUploader/FileUploaderButton.js +19 -25
- package/lib/components/FileUploader/FileUploaderDropContainer.js +18 -24
- package/lib/components/FileUploader/FileUploaderItem.js +23 -29
- package/lib/components/FileUploader/Filename.js +13 -18
- package/lib/components/FluidComboBox/FluidComboBox.Skeleton.js +7 -13
- package/lib/components/FluidComboBox/FluidComboBox.js +24 -30
- package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.js +14 -20
- package/lib/components/FluidDatePicker/FluidDatePicker.js +12 -18
- package/lib/components/FluidDatePickerInput/FluidDatePickerInput.js +4 -8
- package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +7 -13
- package/lib/components/FluidDropdown/FluidDropdown.js +24 -30
- package/lib/components/FluidForm/FluidForm.js +6 -12
- package/lib/components/FluidForm/FormContext.js +0 -2
- package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +7 -13
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +36 -42
- package/lib/components/FluidNumberInput/FluidNumberInput.Skeleton.js +7 -13
- package/lib/components/FluidNumberInput/FluidNumberInput.js +30 -36
- package/lib/components/FluidSearch/FluidSearch.Skeleton.js +7 -13
- package/lib/components/FluidSearch/FluidSearch.js +19 -25
- package/lib/components/FluidSelect/FluidSelect.Skeleton.js +7 -13
- package/lib/components/FluidSelect/FluidSelect.js +17 -23
- package/lib/components/FluidSelect/index.js +3 -3
- package/lib/components/FluidTextArea/FluidTextArea.Skeleton.js +7 -13
- package/lib/components/FluidTextArea/FluidTextArea.js +25 -31
- package/lib/components/FluidTextInput/FluidPasswordInput.js +18 -22
- package/lib/components/FluidTextInput/FluidTextInput.Skeleton.js +7 -13
- package/lib/components/FluidTextInput/FluidTextInput.js +23 -29
- package/lib/components/FluidTextInput/index.js +3 -3
- package/lib/components/FluidTimePicker/FluidTimePicker.Skeleton.js +6 -12
- package/lib/components/FluidTimePicker/FluidTimePicker.js +23 -29
- package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +10 -15
- package/lib/components/Form/Form.js +5 -11
- package/lib/components/FormGroup/FormGroup.js +13 -19
- package/lib/components/FormItem/FormItem.js +5 -11
- package/lib/components/FormLabel/FormLabel.js +6 -12
- package/lib/components/Grid/CSSGrid.js +20 -28
- package/lib/components/Grid/Column.js +31 -37
- package/lib/components/Grid/ColumnHang.js +5 -13
- package/lib/components/Grid/FlexGrid.js +10 -18
- package/lib/components/Grid/Grid.js +9 -16
- package/lib/components/Grid/GridContext.js +7 -14
- package/lib/components/Grid/Row.js +8 -14
- package/lib/components/Heading/index.js +14 -21
- package/lib/components/Icon/Icon.Skeleton.js +4 -10
- package/lib/components/IconButton/index.js +25 -33
- package/lib/components/IconIndicator/index.js +9 -15
- package/lib/components/IdPrefix/index.js +3 -10
- package/lib/components/InlineCheckbox/InlineCheckbox.js +17 -22
- package/lib/components/InlineCheckbox/index.js +2 -2
- package/lib/components/InlineLoading/InlineLoading.js +17 -23
- package/lib/components/InlineLoading/index.js +2 -2
- package/lib/components/Layer/LayerContext.js +1 -7
- package/lib/components/Layer/LayerLevel.js +0 -2
- package/lib/components/Layer/index.js +11 -19
- package/lib/components/Layout/index.js +22 -30
- package/lib/components/LayoutDirection/LayoutDirection.js +6 -13
- package/lib/components/LayoutDirection/LayoutDirectionContext.js +1 -7
- package/lib/components/LayoutDirection/useLayoutDirection.js +0 -2
- package/lib/components/Link/Link.js +15 -21
- package/lib/components/Link/index.js +2 -2
- package/lib/components/ListBox/ListBox.js +17 -23
- package/lib/components/ListBox/ListBoxField.js +7 -12
- package/lib/components/ListBox/ListBoxMenu.js +7 -12
- package/lib/components/ListBox/ListBoxMenuIcon.js +7 -13
- package/lib/components/ListBox/ListBoxMenuItem.js +9 -15
- package/lib/components/ListBox/ListBoxPropTypes.js +2 -8
- package/lib/components/ListBox/ListBoxSelection.js +14 -20
- package/lib/components/ListBox/index.js +7 -7
- package/lib/components/ListBox/next/ListBoxSelection.js +18 -24
- package/lib/components/ListBox/next/ListBoxTrigger.js +7 -13
- package/lib/components/ListItem/ListItem.js +5 -11
- package/lib/components/Loading/Loading.js +14 -20
- package/lib/components/Loading/index.js +2 -2
- package/lib/components/Menu/Menu.d.ts +3 -1
- package/lib/components/Menu/Menu.js +18 -24
- package/lib/components/Menu/MenuContext.js +0 -2
- package/lib/components/Menu/MenuItem.js +44 -52
- package/lib/components/MenuButton/index.js +16 -24
- package/lib/components/Modal/Modal.js +91 -86
- package/lib/components/Modal/index.js +2 -2
- package/lib/components/ModalWrapper/ModalWrapper.js +30 -35
- package/lib/components/MultiSelect/FilterableMultiSelect.js +57 -67
- package/lib/components/MultiSelect/MultiSelect.js +61 -70
- package/lib/components/MultiSelect/MultiSelectPropTypes.js +2 -8
- package/lib/components/MultiSelect/filter.js +0 -6
- package/lib/components/MultiSelect/tools/itemToString.d.ts +1 -0
- package/lib/components/MultiSelect/tools/itemToString.js +1 -7
- package/lib/components/MultiSelect/tools/sorting.d.ts +9 -0
- package/lib/components/MultiSelect/tools/sorting.js +0 -2
- package/lib/components/Notification/Notification.js +118 -126
- package/lib/components/NumberInput/NumberFormatPropTypes.js +21 -27
- package/lib/components/NumberInput/NumberInput.Skeleton.js +8 -14
- package/lib/components/NumberInput/NumberInput.js +66 -74
- package/lib/components/OrderedList/OrderedList.js +8 -14
- package/lib/components/OverflowMenu/OverflowMenu.js +42 -49
- package/lib/components/OverflowMenu/index.js +3 -7
- package/lib/components/OverflowMenu/next/index.js +18 -26
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +27 -33
- package/lib/components/OverflowMenuItem/index.js +2 -2
- package/lib/components/OverflowMenuV2/index.d.ts +1 -0
- package/lib/components/OverflowMenuV2/index.js +2 -8
- package/lib/components/PageHeader/PageHeader.js +70 -78
- package/lib/components/PageHeader/index.js +0 -2
- package/lib/components/Pagination/Pagination.Skeleton.js +10 -16
- package/lib/components/Pagination/Pagination.js +44 -51
- package/lib/components/Pagination/experimental/PageSelector.d.ts +19 -0
- package/lib/components/Pagination/experimental/PageSelector.js +9 -15
- package/lib/components/Pagination/experimental/Pagination.d.ts +43 -0
- package/lib/components/Pagination/experimental/Pagination.js +34 -40
- package/lib/components/Pagination/experimental/index.d.ts +3 -0
- package/lib/components/PaginationNav/PaginationNav.js +54 -60
- package/lib/components/Popover/index.js +56 -47
- package/lib/components/PrimaryButton/PrimaryButton.js +2 -6
- package/lib/components/ProgressBar/ProgressBar.js +25 -31
- package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +10 -16
- package/lib/components/ProgressIndicator/ProgressIndicator.js +41 -49
- package/lib/components/RadioButton/RadioButton.Skeleton.js +6 -12
- package/lib/components/RadioButton/RadioButton.js +26 -32
- package/lib/components/RadioButton/index.js +2 -2
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +37 -43
- package/lib/components/RadioTile/RadioTile.js +25 -31
- package/lib/components/RadioTile/index.js +2 -2
- package/lib/components/Search/Search.Skeleton.js +7 -13
- package/lib/components/Search/Search.js +33 -39
- package/lib/components/Search/index.js +3 -3
- package/lib/components/SecondaryButton/SecondaryButton.js +2 -6
- package/lib/components/Select/Select.Skeleton.js +8 -14
- package/lib/components/Select/Select.js +42 -48
- package/lib/components/Select/index.js +3 -3
- package/lib/components/SelectItem/SelectItem.js +8 -14
- package/lib/components/SelectItem/index.js +2 -2
- package/lib/components/SelectItemGroup/SelectItemGroup.js +7 -13
- package/lib/components/ShapeIndicator/index.js +12 -18
- package/lib/components/SkeletonIcon/SkeletonIcon.js +4 -10
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +4 -10
- package/lib/components/SkeletonText/SkeletonText.js +11 -17
- package/lib/components/SkeletonText/index.js +2 -2
- package/lib/components/Slider/Slider.Skeleton.js +29 -35
- package/lib/components/Slider/Slider.js +84 -90
- package/lib/components/Slider/SliderHandles.js +18 -24
- package/lib/components/Slider/index.js +3 -3
- package/lib/components/Stack/HStack.js +1 -7
- package/lib/components/Stack/Stack.js +7 -15
- package/lib/components/Stack/VStack.js +1 -7
- package/lib/components/StructuredList/StructuredList.Skeleton.js +15 -21
- package/lib/components/StructuredList/StructuredList.js +60 -68
- package/lib/components/Switch/IconSwitch.d.ts +3 -0
- package/lib/components/Switch/IconSwitch.js +18 -25
- package/lib/components/Switch/Switch.js +14 -20
- package/lib/components/TabContent/TabContent.js +7 -33
- package/lib/components/Tabs/Tabs.Skeleton.js +10 -16
- package/lib/components/Tabs/Tabs.js +121 -129
- package/lib/components/Tabs/usePressable.js +0 -2
- package/lib/components/Tag/DismissibleTag.js +24 -30
- package/lib/components/Tag/OperationalTag.js +16 -22
- package/lib/components/Tag/SelectableTag.js +19 -25
- package/lib/components/Tag/Tag.Skeleton.js +5 -11
- package/lib/components/Tag/Tag.js +28 -34
- package/lib/components/Tag/isEllipsisActive.js +0 -2
- package/lib/components/Text/Text.js +6 -13
- package/lib/components/Text/TextDirection.js +4 -11
- package/lib/components/Text/TextDirectionContext.js +0 -2
- package/lib/components/Text/createTextComponent.js +1 -7
- package/lib/components/Text/index.js +0 -2
- package/lib/components/TextArea/TextArea.Skeleton.js +7 -13
- package/lib/components/TextArea/TextArea.js +49 -55
- package/lib/components/TextArea/index.js +3 -3
- package/lib/components/TextInput/ControlledPasswordInput.js +36 -42
- package/lib/components/TextInput/PasswordInput.js +48 -54
- package/lib/components/TextInput/TextInput.Skeleton.js +7 -13
- package/lib/components/TextInput/TextInput.js +47 -53
- package/lib/components/TextInput/index.js +3 -3
- package/lib/components/TextInput/util.d.ts +9 -0
- package/lib/components/TextInput/util.js +0 -2
- package/lib/components/Theme/index.js +16 -24
- package/lib/components/Tile/Tile.js +92 -100
- package/lib/components/TileGroup/TileGroup.js +15 -22
- package/lib/components/TimePicker/TimePicker.js +39 -45
- package/lib/components/TimePickerSelect/TimePickerSelect.js +10 -16
- package/lib/components/Toggle/Toggle.Skeleton.js +7 -13
- package/lib/components/Toggle/Toggle.js +28 -34
- package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +12 -20
- package/lib/components/Toggletip/index.js +32 -40
- package/lib/components/Tooltip/DefinitionTooltip.js +14 -22
- package/lib/components/Tooltip/Tooltip.js +19 -27
- package/lib/components/TreeView/TreeContext.js +0 -2
- package/lib/components/TreeView/TreeNode.js +41 -47
- package/lib/components/TreeView/TreeView.js +17 -23
- package/lib/components/UIShell/Content.js +6 -12
- package/lib/components/UIShell/Header.js +4 -10
- package/lib/components/UIShell/HeaderContainer.js +4 -9
- package/lib/components/UIShell/HeaderGlobalAction.js +11 -17
- package/lib/components/UIShell/HeaderGlobalBar.js +2 -2
- package/lib/components/UIShell/HeaderMenu.js +17 -23
- package/lib/components/UIShell/HeaderMenuButton.js +9 -15
- package/lib/components/UIShell/HeaderMenuItem.js +11 -17
- package/lib/components/UIShell/HeaderName.js +8 -14
- package/lib/components/UIShell/HeaderNavigation.js +6 -12
- package/lib/components/UIShell/HeaderPanel.js +11 -17
- package/lib/components/UIShell/HeaderSideNavItems.js +6 -12
- package/lib/components/UIShell/Link.js +6 -11
- package/lib/components/UIShell/SideNav.js +23 -29
- package/lib/components/UIShell/SideNavDetails.js +7 -13
- package/lib/components/UIShell/SideNavDivider.js +5 -11
- package/lib/components/UIShell/SideNavFooter.js +12 -18
- package/lib/components/UIShell/SideNavHeader.js +8 -14
- package/lib/components/UIShell/SideNavIcon.js +6 -12
- package/lib/components/UIShell/SideNavItem.js +6 -12
- package/lib/components/UIShell/SideNavItems.js +9 -15
- package/lib/components/UIShell/SideNavLink.js +13 -19
- package/lib/components/UIShell/SideNavLinkText.js +5 -11
- package/lib/components/UIShell/SideNavMenu.js +20 -26
- package/lib/components/UIShell/SideNavMenuItem.js +13 -19
- package/lib/components/UIShell/SideNavSwitcher.js +13 -19
- package/lib/components/UIShell/SkipToContent.js +7 -13
- package/lib/components/UIShell/Switcher.js +9 -15
- package/lib/components/UIShell/SwitcherDivider.js +4 -10
- package/lib/components/UIShell/SwitcherItem.js +15 -21
- package/lib/components/UIShell/_utils.d.ts +7 -0
- package/lib/components/UIShell/_utils.js +0 -2
- package/lib/components/UnorderedList/UnorderedList.js +7 -13
- package/lib/feature-flags.d.ts +1 -0
- package/lib/feature-flags.js +3 -4
- package/lib/index.js +180 -182
- package/lib/internal/FloatingMenu.js +10 -18
- package/lib/internal/OptimizedResize.js +2 -8
- package/lib/internal/Selection.js +1 -7
- package/lib/internal/clamp.js +0 -2
- package/lib/internal/createClassWrapper.js +1 -7
- package/lib/internal/deprecateFieldOnObject.js +1 -3
- package/lib/internal/environment.js +0 -2
- package/lib/internal/getAnnouncement.js +0 -2
- package/lib/internal/keyboard/keys.js +0 -2
- package/lib/internal/keyboard/match.js +0 -2
- package/lib/internal/keyboard/navigation.js +0 -2
- package/lib/internal/noopFn.js +0 -2
- package/lib/internal/useAttachedMenu.js +0 -2
- package/lib/internal/useControllableState.js +0 -2
- package/lib/internal/useDelayedState.js +0 -2
- package/lib/internal/useEvent.js +0 -2
- package/lib/internal/useId.d.ts +21 -0
- package/lib/internal/useId.js +27 -7
- package/lib/internal/useIdPrefix.js +2 -8
- package/lib/internal/useIsomorphicEffect.js +1 -1
- package/lib/internal/useMatchMedia.js +0 -2
- package/lib/internal/useMergedRefs.js +0 -2
- package/lib/internal/useNoInteractiveChildren.js +0 -2
- package/lib/internal/useNormalizedInputProps.js +2 -8
- package/lib/internal/useOutsideClick.js +0 -2
- package/lib/internal/useOverflowItems.js +1 -7
- package/lib/internal/usePrefix.js +2 -8
- package/lib/internal/usePreviousValue.js +0 -2
- package/lib/internal/useResizeObserver.js +0 -2
- package/lib/internal/useSavedCallback.js +0 -2
- package/lib/internal/utils.js +0 -2
- package/lib/internal/warning.js +0 -2
- package/lib/internal/wrapFocus.js +0 -2
- package/lib/node_modules/es-toolkit/dist/compat/function/{debounce.mjs.js → debounce.js} +1 -3
- package/lib/node_modules/es-toolkit/dist/compat/function/{throttle.mjs.js → throttle.js} +1 -3
- package/lib/node_modules/es-toolkit/dist/function/{debounce.mjs.js → debounce.js} +0 -2
- package/lib/prop-types/AriaPropTypes.js +2 -8
- package/lib/prop-types/deprecate.js +0 -2
- package/lib/prop-types/deprecateComponent.d.ts +1 -0
- package/lib/prop-types/deprecateComponent.js +2 -5
- package/lib/prop-types/deprecateValuesWithin.d.ts +1 -0
- package/lib/prop-types/deprecateValuesWithin.js +1 -1
- package/lib/prop-types/isRequiredOneOf.js +0 -2
- package/lib/prop-types/requiredIfGivenPropIsTruthy.d.ts +14 -0
- package/lib/prop-types/requiredIfGivenPropIsTruthy.js +1 -1
- package/lib/tools/events.js +0 -2
- package/lib/tools/mapPopoverAlign.js +0 -2
- package/lib/tools/mergeRefs.d.ts +12 -0
- package/lib/tools/mergeRefs.js +1 -2
- package/lib/tools/setupGetInstanceId.js +0 -2
- package/lib/tools/toggleClass.js +0 -2
- package/lib/tools/wrapComponent.js +4 -10
- package/package.json +11 -11
- /package/es/node_modules/es-toolkit/dist/function/{debounce.mjs.js → debounce.js} +0 -0
|
@@ -20,13 +20,7 @@ var usePrefix = require('../../internal/usePrefix.js');
|
|
|
20
20
|
var useId = require('../../internal/useId.js');
|
|
21
21
|
var noopFn = require('../../internal/noopFn.js');
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
26
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
27
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
28
|
-
|
|
29
|
-
const ControlledPasswordInput = /*#__PURE__*/React__default["default"].forwardRef(function ControlledPasswordInput({
|
|
23
|
+
const ControlledPasswordInput = /*#__PURE__*/React.forwardRef(function ControlledPasswordInput({
|
|
30
24
|
labelText,
|
|
31
25
|
className,
|
|
32
26
|
id,
|
|
@@ -53,7 +47,7 @@ const ControlledPasswordInput = /*#__PURE__*/React__default["default"].forwardRe
|
|
|
53
47
|
const prefix = usePrefix.usePrefix();
|
|
54
48
|
const controlledPasswordInstanceId = useId.useId();
|
|
55
49
|
const errorId = id + '-error-msg';
|
|
56
|
-
const textInputClasses =
|
|
50
|
+
const textInputClasses = cx(`${prefix}--text-input`, `${prefix}--password-input`, className, {
|
|
57
51
|
[`${prefix}--text-input--light`]: light,
|
|
58
52
|
[`${prefix}--text-input--invalid`]: invalid,
|
|
59
53
|
[`${prefix}--text-input--${size}`]: size
|
|
@@ -76,33 +70,33 @@ const ControlledPasswordInput = /*#__PURE__*/React__default["default"].forwardRe
|
|
|
76
70
|
className: textInputClasses,
|
|
77
71
|
...other
|
|
78
72
|
};
|
|
79
|
-
const labelClasses =
|
|
73
|
+
const labelClasses = cx(`${prefix}--label`, {
|
|
80
74
|
[`${prefix}--visually-hidden`]: hideLabel,
|
|
81
75
|
[`${prefix}--label--disabled`]: disabled
|
|
82
76
|
});
|
|
83
|
-
const helperTextClasses =
|
|
77
|
+
const helperTextClasses = cx(`${prefix}--form__helper-text`, {
|
|
84
78
|
[`${prefix}--form__helper-text--disabled`]: disabled
|
|
85
79
|
});
|
|
86
|
-
const label = labelText ? /*#__PURE__*/
|
|
80
|
+
const label = labelText ? /*#__PURE__*/React.createElement("label", {
|
|
87
81
|
htmlFor: id,
|
|
88
82
|
className: labelClasses
|
|
89
83
|
}, labelText) : null;
|
|
90
|
-
const error = invalid ? /*#__PURE__*/
|
|
84
|
+
const error = invalid ? /*#__PURE__*/React.createElement("div", {
|
|
91
85
|
className: `${prefix}--form-requirement`,
|
|
92
86
|
id: errorId
|
|
93
87
|
}, invalidText) : null;
|
|
94
88
|
const passwordIsVisible = type === 'text';
|
|
95
|
-
const passwordVisibilityIcon = passwordIsVisible ? /*#__PURE__*/
|
|
89
|
+
const passwordVisibilityIcon = passwordIsVisible ? /*#__PURE__*/React.createElement(iconsReact.ViewOff, {
|
|
96
90
|
className: `${prefix}--icon-visibility-off`
|
|
97
|
-
}) : /*#__PURE__*/
|
|
91
|
+
}) : /*#__PURE__*/React.createElement(iconsReact.View, {
|
|
98
92
|
className: `${prefix}--icon-visibility-on`
|
|
99
93
|
});
|
|
100
|
-
const passwordVisibilityToggleClasses =
|
|
94
|
+
const passwordVisibilityToggleClasses = cx(`${prefix}--text-input--password__visibility__toggle`, `${prefix}--btn`, `${prefix}--btn--icon-only`, `${prefix}--tooltip__trigger`, `${prefix}--tooltip--a11y`, {
|
|
101
95
|
[`${prefix}--tooltip--${tooltipPosition}`]: tooltipPosition,
|
|
102
96
|
[`${prefix}--tooltip--align-${tooltipAlignment}`]: tooltipAlignment
|
|
103
97
|
});
|
|
104
98
|
const helperId = !helperText ? undefined : `controlled-password-helper-text-${controlledPasswordInstanceId}`;
|
|
105
|
-
const input = /*#__PURE__*/
|
|
99
|
+
const input = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("input", _rollupPluginBabelHelpers.extends({}, util.textInputProps({
|
|
106
100
|
invalid,
|
|
107
101
|
sharedTextInputProps,
|
|
108
102
|
invalidId: errorId,
|
|
@@ -110,23 +104,23 @@ const ControlledPasswordInput = /*#__PURE__*/React__default["default"].forwardRe
|
|
|
110
104
|
helperId
|
|
111
105
|
}), {
|
|
112
106
|
"data-toggle-password-visibility": type === 'password'
|
|
113
|
-
})), /*#__PURE__*/
|
|
107
|
+
})), /*#__PURE__*/React.createElement("button", {
|
|
114
108
|
type: "button",
|
|
115
109
|
className: passwordVisibilityToggleClasses,
|
|
116
110
|
onClick: togglePasswordVisibility
|
|
117
|
-
}, /*#__PURE__*/
|
|
111
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
118
112
|
className: `${prefix}--assistive-text`
|
|
119
113
|
}, passwordIsVisible ? hidePasswordLabel : showPasswordLabel), passwordVisibilityIcon));
|
|
120
|
-
const helper = helperText ? /*#__PURE__*/
|
|
114
|
+
const helper = helperText ? /*#__PURE__*/React.createElement("div", {
|
|
121
115
|
id: helperId,
|
|
122
116
|
className: helperTextClasses
|
|
123
117
|
}, helperText) : null;
|
|
124
|
-
return /*#__PURE__*/
|
|
118
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
125
119
|
className: `${prefix}--form-item ${prefix}--text-input-wrapper ${prefix}--password-input-wrapper`
|
|
126
|
-
}, label, /*#__PURE__*/
|
|
120
|
+
}, label, /*#__PURE__*/React.createElement("div", {
|
|
127
121
|
className: `${prefix}--text-input__field-wrapper`,
|
|
128
122
|
"data-invalid": invalid || null
|
|
129
|
-
}, invalid && /*#__PURE__*/
|
|
123
|
+
}, invalid && /*#__PURE__*/React.createElement(iconsReact.WarningFilled, {
|
|
130
124
|
className: `${prefix}--text-input__invalid-icon`
|
|
131
125
|
}), input), error ? error : helper);
|
|
132
126
|
});
|
|
@@ -136,85 +130,85 @@ ControlledPasswordInput.propTypes = {
|
|
|
136
130
|
* Provide a custom className that is applied directly to the underlying
|
|
137
131
|
* `<input>` node
|
|
138
132
|
*/
|
|
139
|
-
className:
|
|
133
|
+
className: PropTypes.string,
|
|
140
134
|
/**
|
|
141
135
|
* Optionally provide the default value of the `<input>`
|
|
142
136
|
*/
|
|
143
|
-
defaultValue:
|
|
137
|
+
defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
144
138
|
/**
|
|
145
139
|
* Specify whether the control is disabled
|
|
146
140
|
*/
|
|
147
|
-
disabled:
|
|
141
|
+
disabled: PropTypes.bool,
|
|
148
142
|
/**
|
|
149
143
|
* Provide text that is used alongside the control label for additional help
|
|
150
144
|
*/
|
|
151
|
-
helperText:
|
|
145
|
+
helperText: PropTypes.node,
|
|
152
146
|
/**
|
|
153
147
|
* Specify whether or not the underlying label is visually hidden
|
|
154
148
|
*/
|
|
155
|
-
hideLabel:
|
|
149
|
+
hideLabel: PropTypes.bool,
|
|
156
150
|
/**
|
|
157
151
|
* "Hide password" tooltip text on password visibility toggle
|
|
158
152
|
*/
|
|
159
|
-
hidePasswordLabel:
|
|
153
|
+
hidePasswordLabel: PropTypes.string,
|
|
160
154
|
/**
|
|
161
155
|
* Provide a unique identifier for the input field
|
|
162
156
|
*/
|
|
163
|
-
id:
|
|
157
|
+
id: PropTypes.string.isRequired,
|
|
164
158
|
/**
|
|
165
159
|
* Specify whether the control is currently invalid
|
|
166
160
|
*/
|
|
167
|
-
invalid:
|
|
161
|
+
invalid: PropTypes.bool,
|
|
168
162
|
/**
|
|
169
163
|
* Provide the text that is displayed when the control is in an invalid state
|
|
170
164
|
*/
|
|
171
|
-
invalidText:
|
|
165
|
+
invalidText: PropTypes.node,
|
|
172
166
|
/**
|
|
173
167
|
* Provide the text that will be read by a screen reader when visiting this
|
|
174
168
|
* control
|
|
175
169
|
*/
|
|
176
|
-
labelText:
|
|
170
|
+
labelText: PropTypes.node.isRequired,
|
|
177
171
|
/**
|
|
178
172
|
* `true` to use the light version. For use on $ui-01 backgrounds only.
|
|
179
173
|
* Don't use this to make tile background color same as container background color.
|
|
180
174
|
*/
|
|
181
|
-
light: deprecate.deprecate(
|
|
175
|
+
light: deprecate.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.'),
|
|
182
176
|
/**
|
|
183
177
|
* Optionally provide an `onChange` handler that is called whenever `<input>`
|
|
184
178
|
* is updated
|
|
185
179
|
*/
|
|
186
|
-
onChange:
|
|
180
|
+
onChange: PropTypes.func,
|
|
187
181
|
/**
|
|
188
182
|
* Optionally provide an `onClick` handler that is called whenever the
|
|
189
183
|
* `<input>` is clicked
|
|
190
184
|
*/
|
|
191
|
-
onClick:
|
|
185
|
+
onClick: PropTypes.func,
|
|
192
186
|
/**
|
|
193
187
|
* Specify the placeholder attribute for the `<input>`
|
|
194
188
|
*/
|
|
195
|
-
placeholder:
|
|
189
|
+
placeholder: PropTypes.string,
|
|
196
190
|
/**
|
|
197
191
|
* "Show password" tooltip text on password visibility toggle
|
|
198
192
|
*/
|
|
199
|
-
showPasswordLabel:
|
|
193
|
+
showPasswordLabel: PropTypes.string,
|
|
200
194
|
/**
|
|
201
195
|
* Specify the size of the Text Input.
|
|
202
196
|
*/
|
|
203
|
-
size:
|
|
197
|
+
size: PropTypes.oneOf(['sm', 'md', 'lg']),
|
|
204
198
|
/**
|
|
205
199
|
* Specify the alignment of the tooltip to the icon-only button.
|
|
206
200
|
* Can be one of: start, center, or end.
|
|
207
201
|
*/
|
|
208
|
-
tooltipAlignment:
|
|
202
|
+
tooltipAlignment: PropTypes.oneOf(['start', 'center', 'end']),
|
|
209
203
|
/**
|
|
210
204
|
* Specify the direction of the tooltip for icon-only buttons.
|
|
211
205
|
* Can be either top, right, bottom, or left.
|
|
212
206
|
*/
|
|
213
|
-
tooltipPosition:
|
|
207
|
+
tooltipPosition: PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
|
|
214
208
|
/**
|
|
215
209
|
* Provide the current value of the `<input>`
|
|
216
210
|
*/
|
|
217
|
-
value:
|
|
211
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
218
212
|
};
|
|
219
213
|
|
|
220
|
-
exports
|
|
214
|
+
exports.default = ControlledPasswordInput;
|
|
@@ -23,13 +23,7 @@ var Tooltip = require('../Tooltip/Tooltip.js');
|
|
|
23
23
|
var deprecate = require('../../prop-types/deprecate.js');
|
|
24
24
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
29
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
30
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
31
|
-
|
|
32
|
-
const PasswordInput = /*#__PURE__*/React__default["default"].forwardRef(function PasswordInput({
|
|
26
|
+
const PasswordInput = /*#__PURE__*/React.forwardRef(function PasswordInput({
|
|
33
27
|
className,
|
|
34
28
|
disabled = false,
|
|
35
29
|
helperText,
|
|
@@ -73,7 +67,7 @@ const PasswordInput = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
|
73
67
|
setInputType(inputType === 'password' ? 'text' : 'password');
|
|
74
68
|
onTogglePasswordVisibility && onTogglePasswordVisibility(event);
|
|
75
69
|
};
|
|
76
|
-
const textInputClasses =
|
|
70
|
+
const textInputClasses = cx(`${prefix}--text-input`, `${prefix}--password-input`, className, {
|
|
77
71
|
[`${prefix}--text-input--light`]: light,
|
|
78
72
|
[`${prefix}--text-input--invalid`]: normalizedProps.invalid,
|
|
79
73
|
[`${prefix}--text-input--warning`]: normalizedProps.warn,
|
|
@@ -100,47 +94,47 @@ const PasswordInput = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
|
100
94
|
ref,
|
|
101
95
|
...rest
|
|
102
96
|
};
|
|
103
|
-
const inputWrapperClasses =
|
|
97
|
+
const inputWrapperClasses = cx(`${prefix}--form-item`, `${prefix}--text-input-wrapper`, `${prefix}--password-input-wrapper`, {
|
|
104
98
|
[`${prefix}--text-input-wrapper--readonly`]: readOnly,
|
|
105
99
|
[`${prefix}--text-input-wrapper--light`]: light,
|
|
106
100
|
[`${prefix}--text-input-wrapper--inline`]: inline,
|
|
107
101
|
[`${prefix}--text-input--fluid`]: isFluid
|
|
108
102
|
});
|
|
109
|
-
const labelClasses =
|
|
103
|
+
const labelClasses = cx(`${prefix}--label`, {
|
|
110
104
|
[`${prefix}--visually-hidden`]: hideLabel,
|
|
111
105
|
[`${prefix}--label--disabled`]: disabled,
|
|
112
106
|
[`${prefix}--label--inline`]: inline,
|
|
113
107
|
[`${prefix}--label--inline--${size}`]: inline && !!size
|
|
114
108
|
});
|
|
115
|
-
const helperTextClasses =
|
|
109
|
+
const helperTextClasses = cx(`${prefix}--form__helper-text`, {
|
|
116
110
|
[`${prefix}--form__helper-text--disabled`]: disabled,
|
|
117
111
|
[`${prefix}--form__helper-text--inline`]: inline
|
|
118
112
|
});
|
|
119
|
-
const fieldOuterWrapperClasses =
|
|
113
|
+
const fieldOuterWrapperClasses = cx(`${prefix}--text-input__field-outer-wrapper`, {
|
|
120
114
|
[`${prefix}--text-input__field-outer-wrapper--inline`]: inline
|
|
121
115
|
});
|
|
122
|
-
const fieldWrapperClasses =
|
|
116
|
+
const fieldWrapperClasses = cx(`${prefix}--text-input__field-wrapper`, {
|
|
123
117
|
[`${prefix}--text-input__field-wrapper--warning`]: normalizedProps.warn
|
|
124
118
|
});
|
|
125
|
-
const iconClasses =
|
|
119
|
+
const iconClasses = cx({
|
|
126
120
|
[`${prefix}--text-input__invalid-icon`]: normalizedProps.invalid || normalizedProps.warn,
|
|
127
121
|
[`${prefix}--text-input__invalid-icon--warning`]: normalizedProps.warn
|
|
128
122
|
});
|
|
129
|
-
const label = labelText ? /*#__PURE__*/
|
|
123
|
+
const label = labelText ? /*#__PURE__*/React.createElement("label", {
|
|
130
124
|
htmlFor: id,
|
|
131
125
|
className: labelClasses
|
|
132
126
|
}, labelText) : null;
|
|
133
|
-
const helper = helperText ? /*#__PURE__*/
|
|
127
|
+
const helper = helperText ? /*#__PURE__*/React.createElement("div", {
|
|
134
128
|
id: normalizedProps.helperId,
|
|
135
129
|
className: helperTextClasses
|
|
136
130
|
}, helperText) : null;
|
|
137
131
|
const passwordIsVisible = inputType === 'text';
|
|
138
|
-
const passwordVisibilityIcon = passwordIsVisible ? /*#__PURE__*/
|
|
132
|
+
const passwordVisibilityIcon = passwordIsVisible ? /*#__PURE__*/React.createElement(iconsReact.ViewOff, {
|
|
139
133
|
className: `${prefix}--icon-visibility-off`
|
|
140
|
-
}) : /*#__PURE__*/
|
|
134
|
+
}) : /*#__PURE__*/React.createElement(iconsReact.View, {
|
|
141
135
|
className: `${prefix}--icon-visibility-on`
|
|
142
136
|
});
|
|
143
|
-
const passwordVisibilityToggleClasses =
|
|
137
|
+
const passwordVisibilityToggleClasses = cx(`${prefix}--text-input--password__visibility__toggle`, `${prefix}--btn`, `${prefix}--tooltip__trigger`, `${prefix}--tooltip--a11y`, {
|
|
144
138
|
[`${prefix}--tooltip--${tooltipPosition}`]: tooltipPosition,
|
|
145
139
|
[`${prefix}--tooltip--align-${tooltipAlignment}`]: tooltipAlignment
|
|
146
140
|
});
|
|
@@ -164,7 +158,7 @@ const PasswordInput = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
|
164
158
|
} else if (!showPasswordLabel || showPasswordLabel.trim() === '') {
|
|
165
159
|
console.warn('Warning: The "showPasswordLabel" should not be blank.');
|
|
166
160
|
}
|
|
167
|
-
const input = /*#__PURE__*/
|
|
161
|
+
const input = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("input", _rollupPluginBabelHelpers.extends({}, util.textInputProps({
|
|
168
162
|
sharedTextInputProps,
|
|
169
163
|
invalid: normalizedProps.invalid,
|
|
170
164
|
invalidId: normalizedProps.invalidId,
|
|
@@ -175,13 +169,13 @@ const PasswordInput = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
|
175
169
|
}), {
|
|
176
170
|
disabled: disabled,
|
|
177
171
|
"data-toggle-password-visibility": inputType === 'password'
|
|
178
|
-
})), isFluid && /*#__PURE__*/
|
|
172
|
+
})), isFluid && /*#__PURE__*/React.createElement("hr", {
|
|
179
173
|
className: `${prefix}--text-input__divider`
|
|
180
|
-
}), /*#__PURE__*/
|
|
174
|
+
}), /*#__PURE__*/React.createElement(Tooltip.Tooltip, {
|
|
181
175
|
align: align,
|
|
182
176
|
className: `${prefix}--toggle-password-tooltip`,
|
|
183
177
|
label: passwordIsVisible ? hidePasswordLabel : showPasswordLabel
|
|
184
|
-
}, /*#__PURE__*/
|
|
178
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
185
179
|
type: "button",
|
|
186
180
|
className: passwordVisibilityToggleClasses,
|
|
187
181
|
disabled: disabled || readOnly,
|
|
@@ -191,16 +185,16 @@ const PasswordInput = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
|
191
185
|
setInputType(type);
|
|
192
186
|
}, [type]);
|
|
193
187
|
const Icon = normalizedProps.icon;
|
|
194
|
-
return /*#__PURE__*/
|
|
188
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
195
189
|
className: inputWrapperClasses
|
|
196
|
-
}, !inline ? label : /*#__PURE__*/
|
|
190
|
+
}, !inline ? label : /*#__PURE__*/React.createElement("div", {
|
|
197
191
|
className: `${prefix}--text-input__label-helper-wrapper`
|
|
198
|
-
}, label, !isFluid && helper), /*#__PURE__*/
|
|
192
|
+
}, label, !isFluid && helper), /*#__PURE__*/React.createElement("div", {
|
|
199
193
|
className: fieldOuterWrapperClasses
|
|
200
|
-
}, /*#__PURE__*/
|
|
194
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
201
195
|
className: fieldWrapperClasses,
|
|
202
196
|
"data-invalid": normalizedProps.invalid || null
|
|
203
|
-
}, Icon && /*#__PURE__*/
|
|
197
|
+
}, Icon && /*#__PURE__*/React.createElement(Icon, {
|
|
204
198
|
className: iconClasses
|
|
205
199
|
}), input, isFluid && !inline && normalizedProps.validation), !isFluid && !inline && (normalizedProps.validation || helper)));
|
|
206
200
|
});
|
|
@@ -210,110 +204,110 @@ PasswordInput.propTypes = {
|
|
|
210
204
|
* Provide a custom className that is applied directly to the underlying
|
|
211
205
|
* `<input>` node
|
|
212
206
|
*/
|
|
213
|
-
className:
|
|
207
|
+
className: PropTypes.string,
|
|
214
208
|
/**
|
|
215
209
|
* Optionally provide the default value of the `<input>`
|
|
216
210
|
*/
|
|
217
|
-
defaultValue:
|
|
211
|
+
defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
218
212
|
/**
|
|
219
213
|
* Specify whether the control is disabled
|
|
220
214
|
*/
|
|
221
|
-
disabled:
|
|
215
|
+
disabled: PropTypes.bool,
|
|
222
216
|
/**
|
|
223
217
|
* Provide text that is used alongside the control label for additional help
|
|
224
218
|
*/
|
|
225
|
-
helperText:
|
|
219
|
+
helperText: PropTypes.node,
|
|
226
220
|
/**
|
|
227
221
|
* Specify whether or not the underlying label is visually hidden
|
|
228
222
|
*/
|
|
229
|
-
hideLabel:
|
|
223
|
+
hideLabel: PropTypes.bool,
|
|
230
224
|
/**
|
|
231
225
|
* "Hide password" tooltip text on password visibility toggle
|
|
232
226
|
*/
|
|
233
|
-
hidePasswordLabel:
|
|
227
|
+
hidePasswordLabel: PropTypes.string,
|
|
234
228
|
/**
|
|
235
229
|
* Provide a unique identifier for the input field
|
|
236
230
|
*/
|
|
237
|
-
id:
|
|
231
|
+
id: PropTypes.string.isRequired,
|
|
238
232
|
/**
|
|
239
233
|
* `true` to use the inline version.
|
|
240
234
|
*/
|
|
241
|
-
inline:
|
|
235
|
+
inline: PropTypes.bool,
|
|
242
236
|
/**
|
|
243
237
|
* Specify whether the control is currently invalid
|
|
244
238
|
*/
|
|
245
|
-
invalid:
|
|
239
|
+
invalid: PropTypes.bool,
|
|
246
240
|
/**
|
|
247
241
|
* Whether the PasswordInput should be read-only
|
|
248
242
|
*/
|
|
249
|
-
readOnly:
|
|
243
|
+
readOnly: PropTypes.bool,
|
|
250
244
|
/**
|
|
251
245
|
* Provide the text that is displayed when the control is in an invalid state
|
|
252
246
|
*/
|
|
253
|
-
invalidText:
|
|
247
|
+
invalidText: PropTypes.node,
|
|
254
248
|
/**
|
|
255
249
|
* Provide the text that will be read by a screen reader when visiting this
|
|
256
250
|
* control
|
|
257
251
|
*/
|
|
258
|
-
labelText:
|
|
252
|
+
labelText: PropTypes.node.isRequired,
|
|
259
253
|
/**
|
|
260
254
|
* `true` to use the light version. For use on $ui-01 backgrounds only.
|
|
261
255
|
* Don't use this to make tile background color same as container background color.
|
|
262
256
|
*/
|
|
263
|
-
light: deprecate.deprecate(
|
|
257
|
+
light: deprecate.deprecate(PropTypes.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.'),
|
|
264
258
|
/**
|
|
265
259
|
* Optionally provide an `onChange` handler that is called whenever `<input>`
|
|
266
260
|
* is updated
|
|
267
261
|
*/
|
|
268
|
-
onChange:
|
|
262
|
+
onChange: PropTypes.func,
|
|
269
263
|
/**
|
|
270
264
|
* Optionally provide an `onClick` handler that is called whenever the
|
|
271
265
|
* `<input>` is clicked
|
|
272
266
|
*/
|
|
273
|
-
onClick:
|
|
267
|
+
onClick: PropTypes.func,
|
|
274
268
|
/**
|
|
275
269
|
* Callback function that is called whenever the toggle password visibility
|
|
276
270
|
* button is clicked
|
|
277
271
|
*/
|
|
278
|
-
onTogglePasswordVisibility:
|
|
272
|
+
onTogglePasswordVisibility: PropTypes.func,
|
|
279
273
|
/**
|
|
280
274
|
* Specify the placeholder attribute for the `<input>`
|
|
281
275
|
*/
|
|
282
|
-
placeholder:
|
|
276
|
+
placeholder: PropTypes.string,
|
|
283
277
|
/**
|
|
284
278
|
* "Show password" tooltip text on password visibility toggle
|
|
285
279
|
*/
|
|
286
|
-
showPasswordLabel:
|
|
280
|
+
showPasswordLabel: PropTypes.string,
|
|
287
281
|
/**
|
|
288
282
|
* Specify the size of the Text Input. Supports `sm`, `md`, or `lg`.
|
|
289
283
|
*/
|
|
290
|
-
size:
|
|
284
|
+
size: PropTypes.oneOf(['sm', 'md', 'lg']),
|
|
291
285
|
/**
|
|
292
286
|
* Specify the alignment of the tooltip to the icon-only button.
|
|
293
287
|
* Can be one of: start, center, or end.
|
|
294
288
|
*/
|
|
295
|
-
tooltipAlignment:
|
|
289
|
+
tooltipAlignment: PropTypes.oneOf(['start', 'center', 'end']),
|
|
296
290
|
/**
|
|
297
291
|
* Specify the direction of the tooltip for icon-only buttons.
|
|
298
292
|
* Can be either top, right, bottom, or left.
|
|
299
293
|
*/
|
|
300
|
-
tooltipPosition:
|
|
294
|
+
tooltipPosition: PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
|
|
301
295
|
/**
|
|
302
296
|
* The input type, either password or text
|
|
303
297
|
*/
|
|
304
|
-
type:
|
|
298
|
+
type: PropTypes.oneOf(['password', 'text']),
|
|
305
299
|
/**
|
|
306
300
|
* Provide the current value of the `<input>`
|
|
307
301
|
*/
|
|
308
|
-
value:
|
|
302
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
309
303
|
/**
|
|
310
304
|
* Specify whether the control is currently in warning state
|
|
311
305
|
*/
|
|
312
|
-
warn:
|
|
306
|
+
warn: PropTypes.bool,
|
|
313
307
|
/**
|
|
314
308
|
* Provide the text that is displayed when the control is in warning state
|
|
315
309
|
*/
|
|
316
|
-
warnText:
|
|
310
|
+
warnText: PropTypes.node
|
|
317
311
|
};
|
|
318
312
|
|
|
319
|
-
exports
|
|
313
|
+
exports.default = PasswordInput;
|
|
@@ -15,23 +15,17 @@ var React = require('react');
|
|
|
15
15
|
var cx = require('classnames');
|
|
16
16
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
17
17
|
|
|
18
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
19
|
-
|
|
20
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
21
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
22
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
23
|
-
|
|
24
18
|
const TextInputSkeleton = ({
|
|
25
19
|
hideLabel,
|
|
26
20
|
className,
|
|
27
21
|
...rest
|
|
28
22
|
}) => {
|
|
29
23
|
const prefix = usePrefix.usePrefix();
|
|
30
|
-
return /*#__PURE__*/
|
|
31
|
-
className:
|
|
32
|
-
}, rest), !hideLabel && /*#__PURE__*/
|
|
24
|
+
return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({
|
|
25
|
+
className: cx(`${prefix}--form-item`, className)
|
|
26
|
+
}, rest), !hideLabel && /*#__PURE__*/React.createElement("span", {
|
|
33
27
|
className: `${prefix}--label ${prefix}--skeleton`
|
|
34
|
-
}), /*#__PURE__*/
|
|
28
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
35
29
|
className: `${prefix}--skeleton ${prefix}--text-input`
|
|
36
30
|
}));
|
|
37
31
|
};
|
|
@@ -39,12 +33,12 @@ TextInputSkeleton.propTypes = {
|
|
|
39
33
|
/**
|
|
40
34
|
* Specify an optional className to add to the form item wrapper.
|
|
41
35
|
*/
|
|
42
|
-
className:
|
|
36
|
+
className: PropTypes.string,
|
|
43
37
|
/**
|
|
44
38
|
* Specify whether the label should be hidden, or not
|
|
45
39
|
*/
|
|
46
|
-
hideLabel:
|
|
40
|
+
hideLabel: PropTypes.bool
|
|
47
41
|
};
|
|
48
42
|
|
|
49
43
|
exports.TextInputSkeleton = TextInputSkeleton;
|
|
50
|
-
exports
|
|
44
|
+
exports.default = TextInputSkeleton;
|