@carbon/react 1.70.0 → 1.71.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.
Files changed (160) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +972 -947
  2. package/es/components/AILabel/index.js +15 -15
  3. package/es/components/Checkbox/Checkbox.d.ts +5 -0
  4. package/es/components/Checkbox/Checkbox.js +16 -7
  5. package/es/components/CheckboxGroup/CheckboxGroup.d.ts +5 -0
  6. package/es/components/CheckboxGroup/CheckboxGroup.js +16 -7
  7. package/es/components/CodeSnippet/CodeSnippet.d.ts +5 -2
  8. package/es/components/CodeSnippet/CodeSnippet.js +40 -1
  9. package/es/components/ComboBox/ComboBox.d.ts +1 -1
  10. package/es/components/ComboBox/ComboBox.js +19 -22
  11. package/es/components/ComboButton/index.js +40 -1
  12. package/es/components/ComposedModal/ComposedModal.d.ts +5 -0
  13. package/es/components/ComposedModal/ComposedModal.js +16 -10
  14. package/es/components/ContentSwitcher/ContentSwitcher.d.ts +2 -2
  15. package/es/components/ContentSwitcher/ContentSwitcher.js +1 -1
  16. package/es/components/Copy/Copy.d.ts +5 -2
  17. package/es/components/Copy/Copy.js +40 -1
  18. package/es/components/CopyButton/CopyButton.d.ts +5 -2
  19. package/es/components/CopyButton/CopyButton.js +40 -1
  20. package/es/components/DataTable/TableSelectRow.js +14 -6
  21. package/es/components/DataTable/TableToolbarSearch.js +1 -1
  22. package/es/components/DataTable/stories/examples/TableToolbarFilter.d.ts +1 -1
  23. package/es/components/DatePicker/plugins/fixEventsPlugin.js +2 -2
  24. package/es/components/DatePickerInput/DatePickerInput.d.ts +6 -1
  25. package/es/components/DatePickerInput/DatePickerInput.js +16 -10
  26. package/es/components/Dropdown/Dropdown.d.ts +5 -0
  27. package/es/components/Dropdown/Dropdown.js +132 -92
  28. package/es/components/FeatureFlags/index.js +1 -2
  29. package/es/components/FluidNumberInput/FluidNumberInput.d.ts +4 -0
  30. package/es/components/FluidSelect/FluidSelect.d.ts +4 -0
  31. package/es/components/FluidSelect/FluidSelect.js +5 -1
  32. package/es/components/FluidTextArea/FluidTextArea.d.ts +4 -0
  33. package/es/components/FluidTextArea/FluidTextArea.js +5 -1
  34. package/es/components/FluidTextInput/FluidPasswordInput.d.ts +4 -0
  35. package/es/components/FluidTextInput/FluidPasswordInput.js +5 -1
  36. package/es/components/FluidTextInput/FluidTextInput.d.ts +4 -0
  37. package/es/components/FluidTextInput/FluidTextInput.js +5 -1
  38. package/es/components/FluidTimePicker/FluidTimePicker.d.ts +4 -0
  39. package/es/components/FluidTimePicker/FluidTimePicker.js +23 -7
  40. package/es/components/IconButton/index.d.ts +4 -1
  41. package/es/components/IconButton/index.js +40 -1
  42. package/es/components/InlineCheckbox/InlineCheckbox.d.ts +50 -0
  43. package/es/components/InlineCheckbox/InlineCheckbox.js +3 -6
  44. package/es/components/InlineCheckbox/index.d.ts +9 -0
  45. package/es/components/LayoutDirection/LayoutDirection.d.ts +44 -0
  46. package/es/components/LayoutDirection/LayoutDirectionContext.d.ts +10 -0
  47. package/es/components/LayoutDirection/useLayoutDirection.d.ts +12 -0
  48. package/es/components/Menu/MenuItem.js +0 -3
  49. package/es/components/Modal/Modal.d.ts +5 -0
  50. package/es/components/Modal/Modal.js +16 -10
  51. package/es/components/MultiSelect/FilterableMultiSelect.d.ts +1 -1
  52. package/es/components/MultiSelect/FilterableMultiSelect.js +1 -2
  53. package/es/components/MultiSelect/MultiSelect.js +1 -1
  54. package/es/components/Notification/Notification.d.ts +9 -2
  55. package/es/components/Notification/Notification.js +16 -2
  56. package/es/components/NumberInput/NumberInput.d.ts +5 -0
  57. package/es/components/NumberInput/NumberInput.js +17 -9
  58. package/es/components/OverflowMenu/next/index.js +40 -1
  59. package/es/components/Pagination/Pagination.js +1 -1
  60. package/es/components/PaginationNav/PaginationNav.d.ts +1 -1
  61. package/es/components/PaginationNav/PaginationNav.js +22 -5
  62. package/es/components/RadioButton/RadioButton.d.ts +5 -0
  63. package/es/components/RadioButton/RadioButton.js +16 -7
  64. package/es/components/RadioButtonGroup/RadioButtonGroup.d.ts +5 -0
  65. package/es/components/RadioButtonGroup/RadioButtonGroup.js +16 -7
  66. package/es/components/RadioTile/RadioTile.d.ts +5 -0
  67. package/es/components/RadioTile/RadioTile.js +17 -8
  68. package/es/components/Tabs/Tabs.js +46 -29
  69. package/es/components/Tag/DismissibleTag.d.ts +11 -2
  70. package/es/components/Tag/DismissibleTag.js +13 -5
  71. package/es/components/Tag/Tag.d.ts +5 -0
  72. package/es/components/Tag/Tag.js +14 -7
  73. package/es/components/TextArea/TextArea.d.ts +5 -0
  74. package/es/components/TextArea/TextArea.js +15 -7
  75. package/es/components/TextInput/TextInput.d.ts +5 -0
  76. package/es/components/TextInput/TextInput.js +15 -7
  77. package/es/components/Tile/Tile.d.ts +21 -1
  78. package/es/components/Tile/Tile.js +68 -48
  79. package/es/components/UIShell/SideNavMenuItem.d.ts +5 -1
  80. package/es/components/UIShell/SideNavMenuItem.js +7 -2
  81. package/lib/components/AILabel/index.js +15 -15
  82. package/lib/components/Checkbox/Checkbox.d.ts +5 -0
  83. package/lib/components/Checkbox/Checkbox.js +16 -7
  84. package/lib/components/CheckboxGroup/CheckboxGroup.d.ts +5 -0
  85. package/lib/components/CheckboxGroup/CheckboxGroup.js +16 -7
  86. package/lib/components/CodeSnippet/CodeSnippet.d.ts +5 -2
  87. package/lib/components/CodeSnippet/CodeSnippet.js +40 -1
  88. package/lib/components/ComboBox/ComboBox.d.ts +1 -1
  89. package/lib/components/ComboBox/ComboBox.js +19 -22
  90. package/lib/components/ComboButton/index.js +40 -1
  91. package/lib/components/ComposedModal/ComposedModal.d.ts +5 -0
  92. package/lib/components/ComposedModal/ComposedModal.js +16 -10
  93. package/lib/components/ContentSwitcher/ContentSwitcher.d.ts +2 -2
  94. package/lib/components/ContentSwitcher/ContentSwitcher.js +1 -1
  95. package/lib/components/Copy/Copy.d.ts +5 -2
  96. package/lib/components/Copy/Copy.js +40 -1
  97. package/lib/components/CopyButton/CopyButton.d.ts +5 -2
  98. package/lib/components/CopyButton/CopyButton.js +40 -1
  99. package/lib/components/DataTable/TableSelectRow.js +14 -6
  100. package/lib/components/DataTable/TableToolbarSearch.js +1 -1
  101. package/lib/components/DataTable/stories/examples/TableToolbarFilter.d.ts +1 -1
  102. package/lib/components/DatePicker/plugins/fixEventsPlugin.js +2 -2
  103. package/lib/components/DatePickerInput/DatePickerInput.d.ts +6 -1
  104. package/lib/components/DatePickerInput/DatePickerInput.js +16 -10
  105. package/lib/components/Dropdown/Dropdown.d.ts +5 -0
  106. package/lib/components/Dropdown/Dropdown.js +131 -91
  107. package/lib/components/FeatureFlags/index.js +1 -2
  108. package/lib/components/FluidNumberInput/FluidNumberInput.d.ts +4 -0
  109. package/lib/components/FluidSelect/FluidSelect.d.ts +4 -0
  110. package/lib/components/FluidSelect/FluidSelect.js +5 -1
  111. package/lib/components/FluidTextArea/FluidTextArea.d.ts +4 -0
  112. package/lib/components/FluidTextArea/FluidTextArea.js +5 -1
  113. package/lib/components/FluidTextInput/FluidPasswordInput.d.ts +4 -0
  114. package/lib/components/FluidTextInput/FluidPasswordInput.js +5 -1
  115. package/lib/components/FluidTextInput/FluidTextInput.d.ts +4 -0
  116. package/lib/components/FluidTextInput/FluidTextInput.js +5 -1
  117. package/lib/components/FluidTimePicker/FluidTimePicker.d.ts +4 -0
  118. package/lib/components/FluidTimePicker/FluidTimePicker.js +23 -7
  119. package/lib/components/IconButton/index.d.ts +4 -1
  120. package/lib/components/IconButton/index.js +40 -1
  121. package/lib/components/InlineCheckbox/InlineCheckbox.d.ts +50 -0
  122. package/lib/components/InlineCheckbox/InlineCheckbox.js +3 -6
  123. package/lib/components/InlineCheckbox/index.d.ts +9 -0
  124. package/lib/components/LayoutDirection/LayoutDirection.d.ts +44 -0
  125. package/lib/components/LayoutDirection/LayoutDirectionContext.d.ts +10 -0
  126. package/lib/components/LayoutDirection/useLayoutDirection.d.ts +12 -0
  127. package/lib/components/Menu/MenuItem.js +0 -3
  128. package/lib/components/Modal/Modal.d.ts +5 -0
  129. package/lib/components/Modal/Modal.js +16 -10
  130. package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +1 -1
  131. package/lib/components/MultiSelect/FilterableMultiSelect.js +1 -2
  132. package/lib/components/MultiSelect/MultiSelect.js +1 -1
  133. package/lib/components/Notification/Notification.d.ts +9 -2
  134. package/lib/components/Notification/Notification.js +16 -2
  135. package/lib/components/NumberInput/NumberInput.d.ts +5 -0
  136. package/lib/components/NumberInput/NumberInput.js +17 -9
  137. package/lib/components/OverflowMenu/next/index.js +40 -1
  138. package/lib/components/Pagination/Pagination.js +1 -1
  139. package/lib/components/PaginationNav/PaginationNav.d.ts +1 -1
  140. package/lib/components/PaginationNav/PaginationNav.js +22 -5
  141. package/lib/components/RadioButton/RadioButton.d.ts +5 -0
  142. package/lib/components/RadioButton/RadioButton.js +16 -7
  143. package/lib/components/RadioButtonGroup/RadioButtonGroup.d.ts +5 -0
  144. package/lib/components/RadioButtonGroup/RadioButtonGroup.js +16 -7
  145. package/lib/components/RadioTile/RadioTile.d.ts +5 -0
  146. package/lib/components/RadioTile/RadioTile.js +17 -8
  147. package/lib/components/Tabs/Tabs.js +46 -29
  148. package/lib/components/Tag/DismissibleTag.d.ts +11 -2
  149. package/lib/components/Tag/DismissibleTag.js +13 -5
  150. package/lib/components/Tag/Tag.d.ts +5 -0
  151. package/lib/components/Tag/Tag.js +14 -7
  152. package/lib/components/TextArea/TextArea.d.ts +5 -0
  153. package/lib/components/TextArea/TextArea.js +15 -7
  154. package/lib/components/TextInput/TextInput.d.ts +5 -0
  155. package/lib/components/TextInput/TextInput.js +15 -7
  156. package/lib/components/Tile/Tile.d.ts +21 -1
  157. package/lib/components/Tile/Tile.js +67 -47
  158. package/lib/components/UIShell/SideNavMenuItem.d.ts +5 -1
  159. package/lib/components/UIShell/SideNavMenuItem.js +7 -2
  160. package/package.json +5 -5
@@ -11,6 +11,7 @@ import React__default, { useRef, useState, useLayoutEffect } from 'react';
11
11
  import cx from 'classnames';
12
12
  import { useId } from '../../internal/useId.js';
13
13
  import { usePrefix } from '../../internal/usePrefix.js';
14
+ import deprecate from '../../prop-types/deprecate.js';
14
15
  import Tag, { SIZES, TYPES } from './Tag.js';
15
16
  import { Close } from '@carbon/icons-react';
16
17
  import '../Tooltip/DefinitionTooltip.js';
@@ -23,6 +24,7 @@ var _Close;
23
24
  const DismissibleTag = _ref => {
24
25
  let {
25
26
  className,
27
+ decorator,
26
28
  disabled,
27
29
  id,
28
30
  renderIcon,
@@ -50,9 +52,9 @@ const DismissibleTag = _ref => {
50
52
  onClose(event);
51
53
  }
52
54
  };
53
- let normalizedSlug;
54
- if (slug && slug['type']?.displayName === 'AILabel') {
55
- normalizedSlug = /*#__PURE__*/React__default.cloneElement(slug, {
55
+ let normalizedDecorator = /*#__PURE__*/React__default.isValidElement(slug ?? decorator) ? slug ?? decorator : null;
56
+ if (normalizedDecorator && normalizedDecorator['type']?.displayName === 'AILabel') {
57
+ normalizedDecorator = /*#__PURE__*/React__default.cloneElement(normalizedDecorator, {
56
58
  size: 'sm',
57
59
  kind: 'inline'
58
60
  });
@@ -79,7 +81,9 @@ const DismissibleTag = _ref => {
79
81
  }, /*#__PURE__*/React__default.createElement(Text, {
80
82
  title: tagTitle ? tagTitle : text,
81
83
  className: `${prefix}--tag__label`
82
- }, text), normalizedSlug, /*#__PURE__*/React__default.createElement(Tooltip, {
84
+ }, text), slug ? normalizedDecorator : decorator ? /*#__PURE__*/React__default.createElement("div", {
85
+ className: `${prefix}--tag__decorator`
86
+ }, normalizedDecorator) : '', /*#__PURE__*/React__default.createElement(Tooltip, {
83
87
  label: isEllipsisApplied ? dismissLabel : title,
84
88
  align: "bottom",
85
89
  className: tooltipClasses,
@@ -98,6 +102,10 @@ DismissibleTag.propTypes = {
98
102
  * Provide a custom className that is applied to the containing <span>
99
103
  */
100
104
  className: PropTypes.string,
105
+ /**
106
+ * **Experimental:** Provide a `decorator` component to be rendered inside the `DismissibleTag` component
107
+ */
108
+ decorator: PropTypes.node,
101
109
  /**
102
110
  * Specify if the `DismissibleTag` is disabled
103
111
  */
@@ -123,7 +131,7 @@ DismissibleTag.propTypes = {
123
131
  /**
124
132
  * **Experimental:** Provide a `Slug` component to be rendered inside the `DismissibleTag` component
125
133
  */
126
- slug: PropTypes.node,
134
+ slug: deprecate(PropTypes.node, 'The `slug` prop has been deprecated and will be removed in the next major version. Use the decorator prop instead.'),
127
135
  /**
128
136
  * Provide text to be rendered inside of a the tag.
129
137
  */
@@ -34,6 +34,10 @@ export interface TagBaseProps {
34
34
  * Provide a custom className that is applied to the containing <span>
35
35
  */
36
36
  className?: string;
37
+ /**
38
+ * **Experimental:** Provide a `decorator` component to be rendered inside the `Tag` component
39
+ */
40
+ decorator?: ReactNode;
37
41
  /**
38
42
  * Specify if the `Tag` is disabled
39
43
  */
@@ -61,6 +65,7 @@ export interface TagBaseProps {
61
65
  */
62
66
  size?: keyof typeof SIZES;
63
67
  /**
68
+ * @deprecated please use `decorator` instead.
64
69
  * **Experimental:** Provide a `Slug` component to be rendered inside the `Tag` component
65
70
  */
66
71
  slug?: ReactNode;
@@ -44,6 +44,7 @@ const Tag = /*#__PURE__*/React__default.forwardRef(function Tag(_ref, forwardRef
44
44
  let {
45
45
  children,
46
46
  className,
47
+ decorator,
47
48
  id,
48
49
  type,
49
50
  filter,
@@ -87,10 +88,10 @@ const Tag = /*#__PURE__*/React__default.forwardRef(function Tag(_ref, forwardRef
87
88
  }
88
89
  };
89
90
 
90
- // Slug is always size `md` and `inline`
91
- let normalizedSlug;
92
- if (slug && slug['type']?.displayName === 'AILabel' && !isInteractiveTag) {
93
- normalizedSlug = /*#__PURE__*/React__default.cloneElement(slug, {
91
+ // AILabel is always size `sm` and `inline`
92
+ let normalizedDecorator = /*#__PURE__*/React__default.isValidElement(slug ?? decorator) ? slug ?? decorator : null;
93
+ if (normalizedDecorator && normalizedDecorator['type']?.displayName === 'AILabel' && !isInteractiveTag) {
94
+ normalizedDecorator = /*#__PURE__*/React__default.cloneElement(normalizedDecorator, {
94
95
  size: 'sm',
95
96
  kind: 'inline'
96
97
  });
@@ -105,7 +106,7 @@ const Tag = /*#__PURE__*/React__default.forwardRef(function Tag(_ref, forwardRef
105
106
  }, /*#__PURE__*/React__default.createElement(CustomIconElement, null)) : '', /*#__PURE__*/React__default.createElement(Text, {
106
107
  title: typeof children === 'string' ? children : undefined,
107
108
  className: `${prefix}--tag__label`
108
- }, children !== null && children !== undefined ? children : typeText), normalizedSlug, /*#__PURE__*/React__default.createElement("button", {
109
+ }, children !== null && children !== undefined ? children : typeText), normalizedDecorator, /*#__PURE__*/React__default.createElement("button", {
109
110
  type: "button",
110
111
  className: `${prefix}--tag__close-icon`,
111
112
  onClick: handleClose,
@@ -136,7 +137,9 @@ const Tag = /*#__PURE__*/React__default.forwardRef(function Tag(_ref, forwardRef
136
137
  }, children !== null && children !== undefined ? children : typeText)) : /*#__PURE__*/React__default.createElement(Text, {
137
138
  title: children !== null && children !== undefined && typeof children === 'string' ? children : typeText,
138
139
  className: labelClasses
139
- }, children !== null && children !== undefined ? children : typeText), normalizedSlug);
140
+ }, children !== null && children !== undefined ? children : typeText), slug ? normalizedDecorator : decorator ? /*#__PURE__*/React__default.createElement("div", {
141
+ className: `${prefix}--tag__decorator`
142
+ }, normalizedDecorator) : '');
140
143
  });
141
144
  Tag.propTypes = {
142
145
  /**
@@ -152,6 +155,10 @@ Tag.propTypes = {
152
155
  * Provide a custom className that is applied to the containing <span>
153
156
  */
154
157
  className: PropTypes.string,
158
+ /**
159
+ * **Experimental:** Provide a `decorator` component to be rendered inside the `Tag` component
160
+ */
161
+ decorator: PropTypes.node,
155
162
  /**
156
163
  * Specify if the `Tag` is disabled
157
164
  */
@@ -181,7 +188,7 @@ Tag.propTypes = {
181
188
  /**
182
189
  * **Experimental:** Provide a `Slug` component to be rendered inside the `Tag` component
183
190
  */
184
- slug: PropTypes.node,
191
+ slug: deprecate(PropTypes.node, 'The `slug` prop has been deprecated and will be removed in the next major version. Use the decorator prop instead.'),
185
192
  /**
186
193
  * Text to show on clear filters
187
194
  */
@@ -15,6 +15,10 @@ export interface TextAreaProps extends React.InputHTMLAttributes<HTMLTextAreaEle
15
15
  * Specify the `cols` attribute for the underlying `<textarea>` node
16
16
  */
17
17
  cols?: number;
18
+ /**
19
+ * **Experimental**: Provide a `decorator` component to be rendered inside the `TextArea` component
20
+ */
21
+ decorator?: ReactNode;
18
22
  /**
19
23
  * Optionally provide the default value of the `<textarea>`
20
24
  */
@@ -90,6 +94,7 @@ export interface TextAreaProps extends React.InputHTMLAttributes<HTMLTextAreaEle
90
94
  */
91
95
  rows?: number;
92
96
  /**
97
+ * @deprecated please use `decorator` instead.
93
98
  * **Experimental**: Provide a `Slug` component to be rendered inside the `TextArea` component
94
99
  */
95
100
  slug?: ReactNode;
@@ -25,6 +25,7 @@ import { Text } from '../Text/Text.js';
25
25
  const TextArea = /*#__PURE__*/React__default.forwardRef((props, forwardRef) => {
26
26
  const {
27
27
  className,
28
+ decorator,
28
29
  disabled = false,
29
30
  id,
30
31
  labelText,
@@ -154,7 +155,8 @@ const TextArea = /*#__PURE__*/React__default.forwardRef((props, forwardRef) => {
154
155
  [`${prefix}--text-area__wrapper--cols`]: other.cols,
155
156
  [`${prefix}--text-area__wrapper--readonly`]: other.readOnly,
156
157
  [`${prefix}--text-area__wrapper--warn`]: warn,
157
- [`${prefix}--text-area__wrapper--slug`]: slug
158
+ [`${prefix}--text-area__wrapper--slug`]: slug,
159
+ [`${prefix}--text-area__wrapper--decorator`]: decorator
158
160
  });
159
161
  const labelClasses = cx(`${prefix}--label`, {
160
162
  [`${prefix}--visually-hidden`]: hideLabel && !isFluid,
@@ -253,10 +255,10 @@ const TextArea = /*#__PURE__*/React__default.forwardRef((props, forwardRef) => {
253
255
  ref: ref
254
256
  }));
255
257
 
256
- // Slug is always size `mini`
257
- let normalizedSlug;
258
- if (slug && slug['type']?.displayName === 'AILabel') {
259
- normalizedSlug = /*#__PURE__*/React__default.cloneElement(slug, {
258
+ // AILabel is always size `mini`
259
+ let normalizedDecorator = /*#__PURE__*/React__default.isValidElement(slug ?? decorator) ? slug ?? decorator : null;
260
+ if (normalizedDecorator && normalizedDecorator['type']?.displayName === 'AILabel') {
261
+ normalizedDecorator = /*#__PURE__*/React__default.cloneElement(normalizedDecorator, {
260
262
  size: 'mini'
261
263
  });
262
264
  }
@@ -271,7 +273,9 @@ const TextArea = /*#__PURE__*/React__default.forwardRef((props, forwardRef) => {
271
273
  className: `${prefix}--text-area__invalid-icon`
272
274
  }), warn && !invalid && !isFluid && /*#__PURE__*/React__default.createElement(WarningAltFilled, {
273
275
  className: `${prefix}--text-area__invalid-icon ${prefix}--text-area__invalid-icon--warning`
274
- }), input, normalizedSlug, /*#__PURE__*/React__default.createElement("span", {
276
+ }), input, slug ? normalizedDecorator : decorator ? /*#__PURE__*/React__default.createElement("div", {
277
+ className: `${prefix}--text-area__inner-wrapper--decorator`
278
+ }, normalizedDecorator) : '', /*#__PURE__*/React__default.createElement("span", {
275
279
  className: `${prefix}--text-area__counter-alert`,
276
280
  role: "alert",
277
281
  "aria-live": "assertive",
@@ -296,6 +300,10 @@ TextArea.propTypes = {
296
300
  * Specify the method used for calculating the counter number
297
301
  */
298
302
  counterMode: PropTypes.oneOf(['character', 'word']),
303
+ /**
304
+ * **Experimental**: Provide a `decorator` component to be rendered inside the `TextArea` component
305
+ */
306
+ decorator: PropTypes.node,
299
307
  /**
300
308
  * Optionally provide the default value of the `<textarea>`
301
309
  */
@@ -372,7 +380,7 @@ TextArea.propTypes = {
372
380
  /**
373
381
  * **Experimental**: Provide a `Slug` component to be rendered inside the `TextArea` component
374
382
  */
375
- slug: PropTypes.node,
383
+ slug: deprecate(PropTypes.node, 'The `slug` prop for `TextArea` has ' + 'been deprecated in favor of the new `decorator` prop. It will be removed in the next major release.'),
376
384
  /**
377
385
  * Provide the current value of the `<textarea>`
378
386
  */
@@ -11,6 +11,10 @@ export interface TextInputProps extends Omit<React.InputHTMLAttributes<HTMLInput
11
11
  * Specify an optional className to be applied to the `<input>` node
12
12
  */
13
13
  className?: string;
14
+ /**
15
+ * **Experimental**: Provide a `decorator` component to be rendered inside the `TextInput` component
16
+ */
17
+ decorator?: ReactNode;
14
18
  /**
15
19
  * Optionally provide the default value of the `<input>`
16
20
  */
@@ -86,6 +90,7 @@ export interface TextInputProps extends Omit<React.InputHTMLAttributes<HTMLInput
86
90
  */
87
91
  size?: 'sm' | 'md' | 'lg' | 'xl';
88
92
  /**
93
+ * @deprecated please use `decorator` instead.
89
94
  * **Experimental**: Provide a `Slug` component to be rendered inside the `TextInput` component
90
95
  */
91
96
  slug?: ReactNode;
@@ -23,6 +23,7 @@ import { Text } from '../Text/Text.js';
23
23
  const TextInput = /*#__PURE__*/React__default.forwardRef(function TextInput(_ref, ref) {
24
24
  let {
25
25
  className,
26
+ decorator,
26
27
  disabled = false,
27
28
  helperText,
28
29
  hideLabel,
@@ -115,7 +116,8 @@ const TextInput = /*#__PURE__*/React__default.forwardRef(function TextInput(_ref
115
116
  });
116
117
  const fieldWrapperClasses = cx(`${prefix}--text-input__field-wrapper`, {
117
118
  [`${prefix}--text-input__field-wrapper--warning`]: normalizedProps.warn,
118
- [`${prefix}--text-input__field-wrapper--slug`]: slug
119
+ [`${prefix}--text-input__field-wrapper--slug`]: slug,
120
+ [`${prefix}--text-input__field-wrapper--decorator`]: decorator
119
121
  });
120
122
  const iconClasses = cx({
121
123
  [`${prefix}--text-input__invalid-icon`]: normalizedProps.invalid || normalizedProps.warn,
@@ -179,10 +181,10 @@ const TextInput = /*#__PURE__*/React__default.forwardRef(function TextInput(_ref
179
181
  }, [ariaAnnouncement, prevAnnouncement]);
180
182
  const Icon = normalizedProps.icon;
181
183
 
182
- // Slug is always size `mini`
183
- let normalizedSlug;
184
- if (slug && slug['type']?.displayName === 'AILabel') {
185
- normalizedSlug = /*#__PURE__*/React__default.cloneElement(slug, {
184
+ // AILabel is always size `mini`
185
+ let normalizedDecorator = /*#__PURE__*/React__default.isValidElement(slug ?? decorator) ? slug ?? decorator : null;
186
+ if (normalizedDecorator && normalizedDecorator['type']?.displayName === 'AILabel') {
187
+ normalizedDecorator = /*#__PURE__*/React__default.cloneElement(normalizedDecorator, {
186
188
  size: 'mini'
187
189
  });
188
190
  }
@@ -197,7 +199,9 @@ const TextInput = /*#__PURE__*/React__default.forwardRef(function TextInput(_ref
197
199
  "data-invalid": normalizedProps.invalid || null
198
200
  }, Icon && /*#__PURE__*/React__default.createElement(Icon, {
199
201
  className: iconClasses
200
- }), input, normalizedSlug, /*#__PURE__*/React__default.createElement("span", {
202
+ }), input, slug ? normalizedDecorator : decorator ? /*#__PURE__*/React__default.createElement("div", {
203
+ className: `${prefix}--text-input__field-inner-wrapper--decorator`
204
+ }, normalizedDecorator) : '', /*#__PURE__*/React__default.createElement("span", {
201
205
  className: `${prefix}--text-input__counter-alert`,
202
206
  role: "alert",
203
207
  "aria-live": "assertive",
@@ -215,6 +219,10 @@ TextInput.propTypes = {
215
219
  * Specify an optional className to be applied to the `<input>` node
216
220
  */
217
221
  className: PropTypes.string,
222
+ /**
223
+ * **Experimental**: Provide a `decorator` component to be rendered inside the `TextInput` component
224
+ */
225
+ decorator: PropTypes.node,
218
226
  /**
219
227
  * Optionally provide the default value of the `<input>`
220
228
  */
@@ -290,7 +298,7 @@ TextInput.propTypes = {
290
298
  /**
291
299
  * **Experimental**: Provide a `Slug` component to be rendered inside the `TextInput` component
292
300
  */
293
- slug: PropTypes.node,
301
+ slug: deprecate(PropTypes.node, 'The `slug` prop for `TextInput` has ' + 'been deprecated in favor of the new `decorator` prop. It will be removed in the next major release.'),
294
302
  /**
295
303
  * Specify the type of the `<input>`
296
304
  */
@@ -2,6 +2,10 @@ import React, { type ReactNode, type MouseEvent, type KeyboardEvent, type HTMLAt
2
2
  export interface TileProps extends HTMLAttributes<HTMLDivElement> {
3
3
  children?: ReactNode;
4
4
  className?: string;
5
+ /**
6
+ * **Experimental**: Provide a `decorator` component to be rendered inside the `Tile` component
7
+ */
8
+ decorator?: ReactNode;
5
9
  /** @deprecated */
6
10
  light?: boolean;
7
11
  /**
@@ -10,7 +14,8 @@ export interface TileProps extends HTMLAttributes<HTMLDivElement> {
10
14
  */
11
15
  hasRoundedCorners?: boolean;
12
16
  /**
13
- * **Experimental**: Provide a `Slug` component to be rendered inside the `SelectableTile` component
17
+ * @deprecated please use `decorator` instead.
18
+ * **Experimental**: Provide a `Slug` component to be rendered inside the `Tile` component
14
19
  */
15
20
  slug?: ReactNode;
16
21
  }
@@ -18,6 +23,10 @@ export declare const Tile: React.ForwardRefExoticComponent<TileProps & React.Ref
18
23
  export interface ClickableTileProps extends HTMLAttributes<HTMLAnchorElement> {
19
24
  children?: ReactNode;
20
25
  className?: string;
26
+ /**
27
+ * **Experimental**: Provide a `decorator` component or set the boolean to True for an AILabel icon to be rendered inside the `ClickableTile` component
28
+ */
29
+ decorator?: boolean | ReactNode;
21
30
  /** @deprecated */
22
31
  light?: boolean;
23
32
  /**
@@ -56,6 +65,7 @@ export interface ClickableTileProps extends HTMLAttributes<HTMLAnchorElement> {
56
65
  */
57
66
  rel?: string;
58
67
  /**
68
+ * @deprecated please use `decorator` instead.
59
69
  * **Experimental**: Specify if a `Slug` icon should be rendered inside the `ClickableTile`
60
70
  */
61
71
  slug?: boolean;
@@ -64,6 +74,10 @@ export declare const ClickableTile: React.ForwardRefExoticComponent<ClickableTil
64
74
  export interface SelectableTileProps extends HTMLAttributes<HTMLDivElement> {
65
75
  children?: ReactNode;
66
76
  className?: string;
77
+ /**
78
+ * **Experimental**: Provide a `decorator` component to be rendered inside the `SelectableTile` component
79
+ */
80
+ decorator?: ReactNode;
67
81
  /** @deprecated */
68
82
  light?: boolean;
69
83
  /**
@@ -101,6 +115,7 @@ export interface SelectableTileProps extends HTMLAttributes<HTMLDivElement> {
101
115
  */
102
116
  selected?: boolean;
103
117
  /**
118
+ * @deprecated please use `decorator` instead.
104
119
  * **Experimental**: Provide a `Slug` component to be rendered inside the `SelectableTile` component
105
120
  */
106
121
  slug?: ReactNode;
@@ -122,6 +137,10 @@ export declare const SelectableTile: React.ForwardRefExoticComponent<SelectableT
122
137
  export interface ExpandableTileProps extends HTMLAttributes<HTMLDivElement> {
123
138
  children?: ReactNode;
124
139
  className?: string;
140
+ /**
141
+ * **Experimental**: Provide a `decorator` component to be rendered inside the `ExpandableTile` component
142
+ */
143
+ decorator?: ReactNode;
125
144
  /** @deprecated */
126
145
  light?: boolean;
127
146
  /**
@@ -146,6 +165,7 @@ export interface ExpandableTileProps extends HTMLAttributes<HTMLDivElement> {
146
165
  */
147
166
  onKeyUp?(event: KeyboardEvent): void;
148
167
  /**
168
+ * @deprecated please use `decorator` instead.
149
169
  * **Experimental**: Provide a `Slug` component to be rendered inside the `ExpandableTile` component
150
170
  */
151
171
  slug?: ReactNode;