@carbon/react 1.40.0 → 1.41.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 (260) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +1564 -872
  2. package/es/components/Accordion/Accordion.Skeleton.d.ts +0 -5
  3. package/es/components/Accordion/Accordion.Skeleton.js +0 -5
  4. package/es/components/Breadcrumb/BreadcrumbItem.js +3 -1
  5. package/es/components/Checkbox/Checkbox.js +3 -6
  6. package/es/components/CodeSnippet/CodeSnippet.js +5 -12
  7. package/es/components/ComboBox/ComboBox.d.ts +1 -5
  8. package/es/components/ComboBox/ComboBox.js +6 -20
  9. package/es/components/ComposedModal/ComposedModal.js +1 -5
  10. package/es/components/ComposedModal/ModalFooter.js +4 -9
  11. package/es/components/ComposedModal/ModalHeader.js +1 -4
  12. package/es/components/ContentSwitcher/ContentSwitcher.d.ts +3 -8
  13. package/es/components/ContentSwitcher/ContentSwitcher.js +7 -11
  14. package/es/components/Copy/Copy.js +4 -8
  15. package/es/components/CopyButton/CopyButton.js +8 -7
  16. package/es/components/DataTable/DataTable.d.ts +3 -39
  17. package/es/components/DataTable/DataTable.js +10 -18
  18. package/es/components/DataTable/Table.d.ts +0 -4
  19. package/es/components/DataTable/Table.js +4 -7
  20. package/es/components/DataTable/TableBatchAction.js +12 -5
  21. package/es/components/DataTable/TableBatchActions.js +1 -6
  22. package/es/components/DataTable/TableBody.d.ts +0 -3
  23. package/es/components/DataTable/TableBody.js +1 -3
  24. package/es/components/DataTable/TableExpandHeader.d.ts +1 -1
  25. package/es/components/DataTable/TableHeader.js +3 -8
  26. package/es/components/DataTable/TableSelectAll.d.ts +0 -3
  27. package/es/components/DataTable/TableSelectAll.js +1 -4
  28. package/es/components/DataTable/TableToolbar.d.ts +10 -0
  29. package/es/components/DataTable/TableToolbar.js +15 -7
  30. package/es/components/DataTable/TableToolbarMenu.js +2 -6
  31. package/es/components/DataTable/TableToolbarSearch.d.ts +2 -8
  32. package/es/components/DataTable/TableToolbarSearch.js +6 -11
  33. package/es/components/DataTable/tools/sorting.js +2 -2
  34. package/es/components/DatePicker/DatePicker.d.ts +4 -4
  35. package/es/components/DatePicker/DatePicker.js +9 -4
  36. package/es/components/DatePicker/plugins/fixEventsPlugin.js +6 -0
  37. package/es/components/DatePickerInput/DatePickerInput.d.ts +1 -1
  38. package/es/components/DatePickerInput/DatePickerInput.js +12 -6
  39. package/es/components/Dropdown/Dropdown.js +6 -15
  40. package/es/components/FileUploader/FileUploader.d.ts +2 -11
  41. package/es/components/FileUploader/FileUploader.js +15 -19
  42. package/es/components/FileUploader/FileUploaderButton.js +2 -2
  43. package/es/components/FileUploader/FileUploaderDropContainer.d.ts +0 -7
  44. package/es/components/FileUploader/FileUploaderDropContainer.js +2 -8
  45. package/es/components/FileUploader/FileUploaderItem.d.ts +0 -4
  46. package/es/components/FileUploader/FileUploaderItem.js +12 -9
  47. package/es/components/FileUploader/Filename.d.ts +6 -10
  48. package/es/components/FileUploader/Filename.js +7 -11
  49. package/es/components/FormGroup/FormGroup.d.ts +0 -5
  50. package/es/components/FormGroup/FormGroup.js +3 -8
  51. package/es/components/FormItem/FormItem.d.ts +32 -0
  52. package/es/components/FormItem/index.d.ts +9 -0
  53. package/es/components/FormLabel/FormLabel.js +4 -1
  54. package/es/components/ListBox/ListBox.js +4 -8
  55. package/es/components/ListBox/ListBoxMenuIcon.js +1 -4
  56. package/es/components/ListBox/ListBoxMenuItem.js +4 -8
  57. package/es/components/ListBox/ListBoxSelection.d.ts +5 -5
  58. package/es/components/ListBox/ListBoxSelection.js +12 -13
  59. package/es/components/ListBox/next/ListBoxSelection.js +12 -13
  60. package/es/components/ListBox/next/ListBoxTrigger.js +3 -5
  61. package/es/components/ListItem/ListItem.d.ts +1 -1
  62. package/es/components/ListItem/ListItem.js +6 -2
  63. package/es/components/Menu/MenuItem.js +4 -1
  64. package/es/components/Modal/Modal.d.ts +137 -0
  65. package/es/components/Modal/Modal.js +39 -45
  66. package/es/components/Modal/index.d.ts +9 -0
  67. package/es/components/ModalWrapper/ModalWrapper.js +13 -19
  68. package/es/components/MultiSelect/FilterableMultiSelect.js +14 -28
  69. package/es/components/MultiSelect/MultiSelect.js +17 -33
  70. package/es/components/MultiSelect/MultiSelectPropTypes.js +2 -2
  71. package/es/components/MultiSelect/tools/sorting.js +2 -2
  72. package/es/components/Notification/Notification.d.ts +11 -29
  73. package/es/components/Notification/Notification.js +38 -57
  74. package/es/components/NumberInput/NumberInput.js +6 -2
  75. package/es/components/OverflowMenu/OverflowMenu.js +27 -33
  76. package/es/components/OverflowMenuItem/OverflowMenuItem.js +4 -1
  77. package/es/components/Pagination/experimental/PageSelector.js +3 -8
  78. package/es/components/Pagination/experimental/Pagination.js +16 -34
  79. package/es/components/ProgressIndicator/ProgressIndicator.js +7 -6
  80. package/es/components/RadioTile/RadioTile.js +6 -7
  81. package/es/components/Search/Search.Skeleton.d.ts +0 -3
  82. package/es/components/Search/Search.Skeleton.js +1 -4
  83. package/es/components/Select/Select.d.ts +2 -2
  84. package/es/components/Select/Select.js +13 -16
  85. package/es/components/SelectItem/SelectItem.d.ts +0 -6
  86. package/es/components/SelectItem/SelectItem.js +4 -10
  87. package/es/components/SelectItemGroup/SelectItemGroup.d.ts +0 -3
  88. package/es/components/SelectItemGroup/SelectItemGroup.js +1 -4
  89. package/es/components/SkeletonIcon/SkeletonIcon.d.ts +13 -0
  90. package/es/components/SkeletonIcon/SkeletonIcon.js +2 -3
  91. package/es/components/SkeletonText/SkeletonText.d.ts +0 -6
  92. package/es/components/SkeletonText/SkeletonText.js +0 -6
  93. package/es/components/Slider/Slider.Skeleton.d.ts +9 -1
  94. package/es/components/Slider/Slider.Skeleton.js +20 -4
  95. package/es/components/Slider/Slider.d.ts +137 -25
  96. package/es/components/Slider/Slider.js +779 -186
  97. package/es/components/StructuredList/StructuredList.js +5 -2
  98. package/es/components/Switch/Switch.js +3 -7
  99. package/es/components/Tabs/Tabs.js +5 -2
  100. package/es/components/Tag/Tag.js +4 -2
  101. package/es/components/Text/Text.js +1 -1
  102. package/es/components/Text/TextDirection.d.ts +1 -1
  103. package/es/components/TextArea/TextArea.js +30 -34
  104. package/es/components/TextInput/ControlledPasswordInput.js +12 -19
  105. package/es/components/TextInput/TextInput.js +8 -3
  106. package/es/components/Tile/Tile.js +5 -3
  107. package/es/components/TileGroup/TileGroup.js +5 -4
  108. package/es/components/Toggle/Toggle.js +4 -2
  109. package/es/components/Toggletip/index.d.ts +6 -1
  110. package/es/components/Toggletip/index.js +7 -1
  111. package/es/components/UIShell/Content.js +1 -4
  112. package/es/components/UIShell/SideNav.d.ts +1 -1
  113. package/es/components/UIShell/SideNavDetails.d.ts +32 -0
  114. package/es/components/UIShell/SideNavDetails.js +1 -2
  115. package/es/components/UIShell/SideNavDivider.d.ts +15 -0
  116. package/es/components/UIShell/SideNavDivider.js +2 -2
  117. package/es/components/UIShell/SideNavFooter.js +2 -5
  118. package/es/components/UIShell/SideNavIcon.d.ts +25 -0
  119. package/es/components/UIShell/SideNavIcon.js +4 -7
  120. package/es/components/UIShell/SideNavSwitcher.d.ts +31 -0
  121. package/es/components/UIShell/SideNavSwitcher.js +6 -5
  122. package/es/index.js +2 -2
  123. package/es/internal/FloatingMenu.js +2 -7
  124. package/es/internal/Selection.js +0 -3
  125. package/es/internal/noopFn.d.ts +7 -0
  126. package/es/internal/noopFn.js +10 -0
  127. package/es/internal/useNormalizedInputProps.js +6 -2
  128. package/es/internal/wrapFocus.js +5 -5
  129. package/es/prop-types/requiredIfGivenPropIsTruthy.js +2 -2
  130. package/lib/components/Accordion/Accordion.Skeleton.d.ts +0 -5
  131. package/lib/components/Accordion/Accordion.Skeleton.js +0 -5
  132. package/lib/components/Breadcrumb/BreadcrumbItem.js +3 -1
  133. package/lib/components/Checkbox/Checkbox.js +3 -6
  134. package/lib/components/CodeSnippet/CodeSnippet.js +5 -12
  135. package/lib/components/ComboBox/ComboBox.d.ts +1 -5
  136. package/lib/components/ComboBox/ComboBox.js +5 -19
  137. package/lib/components/ComposedModal/ComposedModal.js +1 -5
  138. package/lib/components/ComposedModal/ModalFooter.js +4 -9
  139. package/lib/components/ComposedModal/ModalHeader.js +1 -4
  140. package/lib/components/ContentSwitcher/ContentSwitcher.d.ts +3 -8
  141. package/lib/components/ContentSwitcher/ContentSwitcher.js +7 -11
  142. package/lib/components/Copy/Copy.js +4 -8
  143. package/lib/components/CopyButton/CopyButton.js +8 -7
  144. package/lib/components/DataTable/DataTable.d.ts +3 -39
  145. package/lib/components/DataTable/DataTable.js +13 -21
  146. package/lib/components/DataTable/Table.d.ts +0 -4
  147. package/lib/components/DataTable/Table.js +3 -6
  148. package/lib/components/DataTable/TableBatchAction.js +12 -5
  149. package/lib/components/DataTable/TableBatchActions.js +1 -6
  150. package/lib/components/DataTable/TableBody.d.ts +0 -3
  151. package/lib/components/DataTable/TableBody.js +1 -3
  152. package/lib/components/DataTable/TableExpandHeader.d.ts +1 -1
  153. package/lib/components/DataTable/TableHeader.js +3 -8
  154. package/lib/components/DataTable/TableSelectAll.d.ts +0 -3
  155. package/lib/components/DataTable/TableSelectAll.js +1 -4
  156. package/lib/components/DataTable/TableToolbar.d.ts +10 -0
  157. package/lib/components/DataTable/TableToolbar.js +15 -7
  158. package/lib/components/DataTable/TableToolbarMenu.js +2 -6
  159. package/lib/components/DataTable/TableToolbarSearch.d.ts +2 -8
  160. package/lib/components/DataTable/TableToolbarSearch.js +6 -11
  161. package/lib/components/DataTable/tools/sorting.js +2 -2
  162. package/lib/components/DatePicker/DatePicker.d.ts +4 -4
  163. package/lib/components/DatePicker/DatePicker.js +9 -4
  164. package/lib/components/DatePicker/plugins/fixEventsPlugin.js +6 -0
  165. package/lib/components/DatePickerInput/DatePickerInput.d.ts +1 -1
  166. package/lib/components/DatePickerInput/DatePickerInput.js +12 -6
  167. package/lib/components/Dropdown/Dropdown.js +6 -15
  168. package/lib/components/FileUploader/FileUploader.d.ts +2 -11
  169. package/lib/components/FileUploader/FileUploader.js +15 -19
  170. package/lib/components/FileUploader/FileUploaderButton.js +2 -2
  171. package/lib/components/FileUploader/FileUploaderDropContainer.d.ts +0 -7
  172. package/lib/components/FileUploader/FileUploaderDropContainer.js +2 -8
  173. package/lib/components/FileUploader/FileUploaderItem.d.ts +0 -4
  174. package/lib/components/FileUploader/FileUploaderItem.js +12 -9
  175. package/lib/components/FileUploader/Filename.d.ts +6 -10
  176. package/lib/components/FileUploader/Filename.js +7 -11
  177. package/lib/components/FormGroup/FormGroup.d.ts +0 -5
  178. package/lib/components/FormGroup/FormGroup.js +3 -8
  179. package/lib/components/FormItem/FormItem.d.ts +32 -0
  180. package/lib/components/FormItem/index.d.ts +9 -0
  181. package/lib/components/FormLabel/FormLabel.js +4 -1
  182. package/lib/components/ListBox/ListBox.js +4 -8
  183. package/lib/components/ListBox/ListBoxMenuIcon.js +1 -4
  184. package/lib/components/ListBox/ListBoxMenuItem.js +4 -8
  185. package/lib/components/ListBox/ListBoxSelection.d.ts +5 -5
  186. package/lib/components/ListBox/ListBoxSelection.js +12 -13
  187. package/lib/components/ListBox/next/ListBoxSelection.js +12 -13
  188. package/lib/components/ListBox/next/ListBoxTrigger.js +3 -5
  189. package/lib/components/ListItem/ListItem.d.ts +1 -1
  190. package/lib/components/ListItem/ListItem.js +6 -2
  191. package/lib/components/Menu/MenuItem.js +4 -1
  192. package/lib/components/Modal/Modal.d.ts +137 -0
  193. package/lib/components/Modal/Modal.js +40 -45
  194. package/lib/components/Modal/index.d.ts +9 -0
  195. package/lib/components/ModalWrapper/ModalWrapper.js +13 -19
  196. package/lib/components/MultiSelect/FilterableMultiSelect.js +18 -32
  197. package/lib/components/MultiSelect/MultiSelect.js +16 -32
  198. package/lib/components/MultiSelect/MultiSelectPropTypes.js +2 -2
  199. package/lib/components/MultiSelect/tools/sorting.js +2 -2
  200. package/lib/components/Notification/Notification.d.ts +11 -29
  201. package/lib/components/Notification/Notification.js +38 -57
  202. package/lib/components/NumberInput/NumberInput.js +6 -2
  203. package/lib/components/OverflowMenu/OverflowMenu.js +27 -33
  204. package/lib/components/OverflowMenuItem/OverflowMenuItem.js +4 -1
  205. package/lib/components/Pagination/experimental/PageSelector.js +3 -8
  206. package/lib/components/Pagination/experimental/Pagination.js +16 -34
  207. package/lib/components/ProgressIndicator/ProgressIndicator.js +7 -6
  208. package/lib/components/RadioTile/RadioTile.js +6 -7
  209. package/lib/components/Search/Search.Skeleton.d.ts +0 -3
  210. package/lib/components/Search/Search.Skeleton.js +1 -4
  211. package/lib/components/Select/Select.d.ts +2 -2
  212. package/lib/components/Select/Select.js +13 -16
  213. package/lib/components/SelectItem/SelectItem.d.ts +0 -6
  214. package/lib/components/SelectItem/SelectItem.js +4 -10
  215. package/lib/components/SelectItemGroup/SelectItemGroup.d.ts +0 -3
  216. package/lib/components/SelectItemGroup/SelectItemGroup.js +1 -4
  217. package/lib/components/SkeletonIcon/SkeletonIcon.d.ts +13 -0
  218. package/lib/components/SkeletonIcon/SkeletonIcon.js +2 -3
  219. package/lib/components/SkeletonText/SkeletonText.d.ts +0 -6
  220. package/lib/components/SkeletonText/SkeletonText.js +0 -6
  221. package/lib/components/Slider/Slider.Skeleton.d.ts +9 -1
  222. package/lib/components/Slider/Slider.Skeleton.js +20 -4
  223. package/lib/components/Slider/Slider.d.ts +137 -25
  224. package/lib/components/Slider/Slider.js +778 -185
  225. package/lib/components/StructuredList/StructuredList.js +5 -2
  226. package/lib/components/Switch/Switch.js +3 -7
  227. package/lib/components/Tabs/Tabs.js +5 -2
  228. package/lib/components/Tag/Tag.js +4 -2
  229. package/lib/components/Text/Text.js +1 -1
  230. package/lib/components/Text/TextDirection.d.ts +1 -1
  231. package/lib/components/TextArea/TextArea.js +30 -34
  232. package/lib/components/TextInput/ControlledPasswordInput.js +12 -19
  233. package/lib/components/TextInput/TextInput.js +8 -3
  234. package/lib/components/Tile/Tile.js +5 -3
  235. package/lib/components/TileGroup/TileGroup.js +5 -4
  236. package/lib/components/Toggle/Toggle.js +4 -2
  237. package/lib/components/Toggletip/index.d.ts +6 -1
  238. package/lib/components/Toggletip/index.js +7 -1
  239. package/lib/components/UIShell/Content.js +1 -4
  240. package/lib/components/UIShell/SideNav.d.ts +1 -1
  241. package/lib/components/UIShell/SideNavDetails.d.ts +32 -0
  242. package/lib/components/UIShell/SideNavDetails.js +1 -2
  243. package/lib/components/UIShell/SideNavDivider.d.ts +15 -0
  244. package/lib/components/UIShell/SideNavDivider.js +2 -2
  245. package/lib/components/UIShell/SideNavFooter.js +2 -5
  246. package/lib/components/UIShell/SideNavIcon.d.ts +25 -0
  247. package/lib/components/UIShell/SideNavIcon.js +4 -7
  248. package/lib/components/UIShell/SideNavSwitcher.d.ts +31 -0
  249. package/lib/components/UIShell/SideNavSwitcher.js +5 -4
  250. package/lib/index.js +4 -4
  251. package/lib/internal/FloatingMenu.js +2 -7
  252. package/lib/internal/Selection.js +0 -3
  253. package/lib/internal/noopFn.d.ts +7 -0
  254. package/lib/internal/noopFn.js +14 -0
  255. package/lib/internal/useNormalizedInputProps.js +6 -2
  256. package/lib/internal/wrapFocus.js +5 -5
  257. package/lib/prop-types/requiredIfGivenPropIsTruthy.js +2 -2
  258. package/package.json +9 -9
  259. package/scss/components/slug/_index.scss +9 -0
  260. package/scss/components/slug/_slug.scss +9 -0
@@ -51,6 +51,16 @@ export declare namespace NotificationActionButton {
51
51
  * ==================
52
52
  */
53
53
  export interface NotificationButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
54
+ /**
55
+ * Specify a label to be read by screen readers on the container node
56
+ * 'aria-label' of the NotificationButton component.
57
+ */
58
+ ['aria-label']?: string;
59
+ /**
60
+ * @deprecated please use `aria-label` instead.
61
+ * 'aria-label' of the NotificationButton component.
62
+ */
63
+ ariaLabel?: string;
54
64
  /**
55
65
  * Specify an optional icon for the Button through a string,
56
66
  * if provided. However, regular "close" icon is preferred.
@@ -107,12 +117,6 @@ export declare namespace NotificationButton {
107
117
  */
108
118
  type: PropTypes.Requireable<string>;
109
119
  };
110
- var defaultProps: {
111
- "aria-label": string;
112
- notificationType: string;
113
- type: string;
114
- renderIcon: any;
115
- };
116
120
  }
117
121
  export interface NotificationIconProps {
118
122
  iconDescription: string;
@@ -248,13 +252,6 @@ export declare namespace ToastNotification {
248
252
  */
249
253
  title: PropTypes.Requireable<string>;
250
254
  };
251
- var defaultProps: {
252
- kind: string;
253
- role: string;
254
- onCloseButtonClick: () => void;
255
- hideCloseButton: boolean;
256
- timeout: number;
257
- };
258
255
  }
259
256
  /**
260
257
  * InlineNotification
@@ -364,12 +361,6 @@ export declare namespace InlineNotification {
364
361
  */
365
362
  title: PropTypes.Requireable<string>;
366
363
  };
367
- var defaultProps: {
368
- kind: string;
369
- role: string;
370
- onCloseButtonClick: () => void;
371
- hideCloseButton: boolean;
372
- };
373
364
  }
374
365
  /**
375
366
  * ActionableNotification
@@ -484,7 +475,7 @@ export declare namespace ActionableNotification {
484
475
  /**
485
476
  * Specify what state the notification represents
486
477
  */
487
- kind: PropTypes.Validator<string>;
478
+ kind: PropTypes.Requireable<string>;
488
479
  /**
489
480
  * Specify whether you are using the low contrast variant of the ActionableNotification.
490
481
  */
@@ -519,13 +510,4 @@ export declare namespace ActionableNotification {
519
510
  */
520
511
  title: PropTypes.Requireable<string>;
521
512
  };
522
- var defaultProps: {
523
- kind: string;
524
- role: string;
525
- onCloseButtonClick: () => void;
526
- hideCloseButton: boolean;
527
- hasFocus: boolean;
528
- closeOnEscape: boolean;
529
- inline: boolean;
530
- };
531
513
  }
@@ -11,12 +11,15 @@ import React__default, { useState, useRef, useEffect } from 'react';
11
11
  import deprecate from '../../prop-types/deprecate.js';
12
12
  import cx from 'classnames';
13
13
  import { Close, ErrorFilled, CheckmarkFilled, WarningFilled, WarningAltFilled, InformationFilled, InformationSquareFilled } from '@carbon/icons-react';
14
+ import '../Text/index.js';
14
15
  import Button from '../Button/Button.js';
15
16
  import '../Button/Button.Skeleton.js';
16
17
  import useIsomorphicEffect from '../../internal/useIsomorphicEffect.js';
17
18
  import { useNoInteractiveChildren } from '../../internal/useNoInteractiveChildren.js';
18
19
  import { usePrefix } from '../../internal/usePrefix.js';
19
20
  import { useId } from '../../internal/useId.js';
21
+ import { noopFn } from '../../internal/noopFn.js';
22
+ import { Text } from '../Text/Text.js';
20
23
  import { matches } from '../../internal/keyboard/match.js';
21
24
  import { Escape } from '../../internal/keyboard/keys.js';
22
25
 
@@ -85,14 +88,13 @@ NotificationActionButton.propTypes = {
85
88
 
86
89
  function NotificationButton(_ref2) {
87
90
  let {
88
- 'aria-label': ariaLabel,
89
- // @ts-expect-error: deprecated prop
91
+ 'aria-label': ariaLabel = 'close notification',
90
92
  ariaLabel: deprecatedAriaLabel,
91
93
  className,
92
- type,
93
- renderIcon: IconTag,
94
+ type = 'button',
95
+ renderIcon: IconTag = Close,
94
96
  name,
95
- notificationType,
97
+ notificationType = 'toast',
96
98
  ...rest
97
99
  } = _ref2;
98
100
  const prefix = usePrefix();
@@ -146,12 +148,6 @@ NotificationButton.propTypes = {
146
148
  */
147
149
  type: PropTypes.string
148
150
  };
149
- NotificationButton.defaultProps = {
150
- ['aria-label']: 'close notification',
151
- notificationType: 'toast',
152
- type: 'button',
153
- renderIcon: Close
154
- };
155
151
 
156
152
  /**
157
153
  * NotificationIcon
@@ -198,16 +194,16 @@ function ToastNotification(_ref4) {
198
194
  ['aria-label']: ariaLabel,
199
195
  // @ts-expect-error: deprecated prop
200
196
  ariaLabel: deprecatedAriaLabel,
201
- role,
197
+ role = 'status',
202
198
  onClose,
203
- onCloseButtonClick,
199
+ onCloseButtonClick = noopFn,
204
200
  statusIconDescription,
205
201
  className,
206
202
  children,
207
- kind,
203
+ kind = 'error',
208
204
  lowContrast,
209
- hideCloseButton,
210
- timeout,
205
+ hideCloseButton = false,
206
+ timeout = 0,
211
207
  title,
212
208
  caption,
213
209
  subtitle,
@@ -265,11 +261,14 @@ function ToastNotification(_ref4) {
265
261
  }), /*#__PURE__*/React__default.createElement("div", {
266
262
  ref: contentRef,
267
263
  className: `${prefix}--toast-notification__details`
268
- }, title && /*#__PURE__*/React__default.createElement("div", {
264
+ }, title && /*#__PURE__*/React__default.createElement(Text, {
265
+ as: "div",
269
266
  className: `${prefix}--toast-notification__title`
270
- }, title), subtitle && /*#__PURE__*/React__default.createElement("div", {
267
+ }, title), subtitle && /*#__PURE__*/React__default.createElement(Text, {
268
+ as: "div",
271
269
  className: `${prefix}--toast-notification__subtitle`
272
- }, subtitle), caption && /*#__PURE__*/React__default.createElement("div", {
270
+ }, subtitle), caption && /*#__PURE__*/React__default.createElement(Text, {
271
+ as: "div",
273
272
  className: `${prefix}--toast-notification__caption`
274
273
  }, caption), children), !hideCloseButton && /*#__PURE__*/React__default.createElement(NotificationButton, {
275
274
  notificationType: "toast",
@@ -343,13 +342,6 @@ ToastNotification.propTypes = {
343
342
  */
344
343
  title: PropTypes.string
345
344
  };
346
- ToastNotification.defaultProps = {
347
- kind: 'error',
348
- role: 'status',
349
- onCloseButtonClick: () => {},
350
- hideCloseButton: false,
351
- timeout: 0
352
- };
353
345
 
354
346
  /**
355
347
  * InlineNotification
@@ -362,14 +354,14 @@ function InlineNotification(_ref5) {
362
354
  children,
363
355
  title,
364
356
  subtitle,
365
- role,
357
+ role = 'status',
366
358
  onClose,
367
- onCloseButtonClick,
359
+ onCloseButtonClick = noopFn,
368
360
  statusIconDescription,
369
361
  className,
370
- kind,
362
+ kind = 'error',
371
363
  lowContrast,
372
- hideCloseButton,
364
+ hideCloseButton = false,
373
365
  ...rest
374
366
  } = _ref5;
375
367
  const [isOpen, setIsOpen] = useState(true);
@@ -409,9 +401,11 @@ function InlineNotification(_ref5) {
409
401
  }), /*#__PURE__*/React__default.createElement("div", {
410
402
  ref: contentRef,
411
403
  className: `${prefix}--inline-notification__text-wrapper`
412
- }, title && /*#__PURE__*/React__default.createElement("div", {
404
+ }, title && /*#__PURE__*/React__default.createElement(Text, {
405
+ as: "div",
413
406
  className: `${prefix}--inline-notification__title`
414
- }, title), subtitle && /*#__PURE__*/React__default.createElement("div", {
407
+ }, title), subtitle && /*#__PURE__*/React__default.createElement(Text, {
408
+ as: "div",
415
409
  className: `${prefix}--inline-notification__subtitle`
416
410
  }, subtitle), children)), !hideCloseButton && /*#__PURE__*/React__default.createElement(NotificationButton, {
417
411
  notificationType: "inline",
@@ -472,12 +466,6 @@ InlineNotification.propTypes = {
472
466
  */
473
467
  title: PropTypes.string
474
468
  };
475
- InlineNotification.defaultProps = {
476
- kind: 'error',
477
- role: 'status',
478
- onCloseButtonClick: () => {},
479
- hideCloseButton: false
480
- };
481
469
 
482
470
  /**
483
471
  * ActionableNotification
@@ -491,18 +479,18 @@ function ActionableNotification(_ref6) {
491
479
  // @ts-expect-error: deprecated prop
492
480
  ariaLabel: deprecatedAriaLabel,
493
481
  children,
494
- role,
482
+ role = 'alertdialog',
495
483
  onActionButtonClick,
496
484
  onClose,
497
- onCloseButtonClick,
485
+ onCloseButtonClick = noopFn,
498
486
  statusIconDescription,
499
487
  className,
500
- inline,
501
- kind,
488
+ inline = false,
489
+ kind = 'error',
502
490
  lowContrast,
503
- hideCloseButton,
504
- hasFocus,
505
- closeOnEscape,
491
+ hideCloseButton = false,
492
+ hasFocus = true,
493
+ closeOnEscape = true,
506
494
  title,
507
495
  subtitle,
508
496
  ...rest
@@ -552,10 +540,12 @@ function ActionableNotification(_ref6) {
552
540
  className: `${prefix}--actionable-notification__text-wrapper`
553
541
  }, /*#__PURE__*/React__default.createElement("div", {
554
542
  className: `${prefix}--actionable-notification__content`
555
- }, title && /*#__PURE__*/React__default.createElement("div", {
543
+ }, title && /*#__PURE__*/React__default.createElement(Text, {
544
+ as: "div",
556
545
  className: `${prefix}--actionable-notification__title`,
557
546
  id: id
558
- }, title), subtitle && /*#__PURE__*/React__default.createElement("div", {
547
+ }, title), subtitle && /*#__PURE__*/React__default.createElement(Text, {
548
+ as: "div",
559
549
  className: `${prefix}--actionable-notification__subtitle`,
560
550
  id: subtitleId
561
551
  }, subtitle), children))), actionButtonLabel && /*#__PURE__*/React__default.createElement(NotificationActionButton, {
@@ -608,7 +598,7 @@ ActionableNotification.propTypes = {
608
598
  /**
609
599
  * Specify what state the notification represents
610
600
  */
611
- kind: PropTypes.oneOf(['error', 'info', 'info-square', 'success', 'warning', 'warning-alt']).isRequired,
601
+ kind: PropTypes.oneOf(['error', 'info', 'info-square', 'success', 'warning', 'warning-alt']),
612
602
  /**
613
603
  * Specify whether you are using the low contrast variant of the ActionableNotification.
614
604
  */
@@ -643,14 +633,5 @@ ActionableNotification.propTypes = {
643
633
  */
644
634
  title: PropTypes.string
645
635
  };
646
- ActionableNotification.defaultProps = {
647
- kind: 'error',
648
- role: 'alertdialog',
649
- onCloseButtonClick: () => {},
650
- hideCloseButton: false,
651
- hasFocus: true,
652
- closeOnEscape: true,
653
- inline: false
654
- };
655
636
 
656
637
  export { ActionableNotification, InlineNotification, NotificationActionButton, NotificationButton, ToastNotification };
@@ -16,6 +16,8 @@ import { usePrefix } from '../../internal/usePrefix.js';
16
16
  import deprecate from '../../prop-types/deprecate.js';
17
17
  import '../FluidForm/FluidForm.js';
18
18
  import { FormContext } from '../FluidForm/FormContext.js';
19
+ import '../Text/index.js';
20
+ import { Text } from '../Text/Text.js';
19
21
 
20
22
  var _Subtract, _Add;
21
23
  const translationIds = {
@@ -371,7 +373,8 @@ function Label(_ref) {
371
373
  [`${prefix}--visually-hidden`]: hideLabel
372
374
  });
373
375
  if (label) {
374
- return /*#__PURE__*/React__default.createElement("label", {
376
+ return /*#__PURE__*/React__default.createElement(Text, {
377
+ as: "label",
375
378
  htmlFor: id,
376
379
  className: className
377
380
  }, label);
@@ -395,7 +398,8 @@ function HelperText(_ref2) {
395
398
  [`${prefix}--form__helper-text--disabled`]: disabled
396
399
  });
397
400
  if (description) {
398
- return /*#__PURE__*/React__default.createElement("div", {
401
+ return /*#__PURE__*/React__default.createElement(Text, {
402
+ as: "div",
399
403
  id: id,
400
404
  className: className
401
405
  }, description);
@@ -18,6 +18,7 @@ import { PrefixContext } from '../../internal/usePrefix.js';
18
18
  import deprecate from '../../prop-types/deprecate.js';
19
19
  import { IconButton } from '../IconButton/index.js';
20
20
  import setupGetInstanceId from '../../tools/setupGetInstanceId.js';
21
+ import { noopFn } from '../../internal/noopFn.js';
21
22
  import { matches } from '../../internal/keyboard/match.js';
22
23
  import { ArrowUp, ArrowRight, ArrowDown, ArrowLeft, Escape } from '../../internal/keyboard/keys.js';
23
24
 
@@ -114,12 +115,15 @@ class OverflowMenu extends Component {
114
115
  */
115
116
  _defineProperty(this, "_triggerRef", /*#__PURE__*/React__default.createRef());
116
117
  _defineProperty(this, "handleClick", evt => {
118
+ const {
119
+ onClick = noopFn
120
+ } = this.props;
117
121
  evt.stopPropagation();
118
122
  if (!this._menuBody || !this._menuBody.contains(evt.target)) {
119
123
  this.setState({
120
124
  open: !this.state.open
121
125
  });
122
- this.props.onClick(evt);
126
+ onClick(evt);
123
127
  }
124
128
  });
125
129
  _defineProperty(this, "closeMenuAndFocus", () => {
@@ -149,6 +153,9 @@ class OverflowMenu extends Component {
149
153
  }
150
154
  });
151
155
  _defineProperty(this, "closeMenu", onCloseMenu => {
156
+ const {
157
+ onClose = noopFn
158
+ } = this.props;
152
159
  this.setState({
153
160
  open: false
154
161
  }, () => {
@@ -156,7 +163,7 @@ class OverflowMenu extends Component {
156
163
  if (onCloseMenu) {
157
164
  onCloseMenu();
158
165
  }
159
- this.props.onClose();
166
+ onClose();
160
167
  });
161
168
  });
162
169
  _defineProperty(this, "focusMenuEl", () => {
@@ -221,6 +228,9 @@ class OverflowMenu extends Component {
221
228
  * @private
222
229
  */
223
230
  _defineProperty(this, "_handlePlace", menuBody => {
231
+ const {
232
+ onOpen = noopFn
233
+ } = this.props;
224
234
  if (menuBody) {
225
235
  this._menuBody = menuBody;
226
236
  const hasFocusin = ('onfocusin' in window);
@@ -236,7 +246,7 @@ class OverflowMenu extends Component {
236
246
  }
237
247
  }
238
248
  }, !hasFocusin);
239
- this.props.onOpen();
249
+ onOpen();
240
250
  }
241
251
  });
242
252
  /**
@@ -251,7 +261,7 @@ class OverflowMenu extends Component {
251
261
  }
252
262
  componentDidUpdate(_, prevState) {
253
263
  const {
254
- onClose
264
+ onClose = noopFn
255
265
  } = this.props;
256
266
  if (!this.state.open && prevState.open) {
257
267
  onClose();
@@ -288,23 +298,23 @@ class OverflowMenu extends Component {
288
298
  const prefix = this.context;
289
299
  const {
290
300
  id,
291
- ['aria-label']: ariaLabel,
301
+ ['aria-label']: ariaLabel = null,
292
302
  ariaLabel: deprecatedAriaLabel,
293
303
  children,
294
- iconDescription,
295
- direction,
296
- flipped,
297
- focusTrap,
298
- menuOffset,
299
- menuOffsetFlip,
304
+ iconDescription = 'Options',
305
+ direction = DIRECTION_BOTTOM,
306
+ flipped = false,
307
+ focusTrap = true,
308
+ menuOffset = getMenuOffset,
309
+ menuOffsetFlip = getMenuOffset,
300
310
  iconClass,
301
- onClick,
311
+ onClick = noopFn,
302
312
  // eslint-disable-line
303
- onOpen,
313
+ onOpen = noopFn,
304
314
  // eslint-disable-line
305
315
  selectorPrimaryFocus = '[data-floating-menu-primary-focus]',
306
316
  // eslint-disable-line
307
- renderIcon: IconElement,
317
+ renderIcon: IconElement = OverflowMenuVertical,
308
318
  // eslint-disable-next-line react/prop-types
309
319
  innerRef: ref,
310
320
  menuOptionsClass,
@@ -313,7 +323,7 @@ class OverflowMenu extends Component {
313
323
  ...other
314
324
  } = this.props;
315
325
  const {
316
- open
326
+ open = false
317
327
  } = this.state;
318
328
  const overflowMenuClasses = cx(this.props.className, `${prefix}--overflow-menu`, {
319
329
  [`${prefix}--overflow-menu--open`]: open,
@@ -369,7 +379,7 @@ class OverflowMenu extends Component {
369
379
  }, /*#__PURE__*/React__default.createElement(IconButton, _extends({}, other, {
370
380
  type: "button",
371
381
  "aria-haspopup": true,
372
- "aria-expanded": this.state.open,
382
+ "aria-expanded": open,
373
383
  "aria-controls": open ? menuBodyId : null,
374
384
  className: overflowMenuClasses,
375
385
  onClick: this.handleClick,
@@ -417,7 +427,7 @@ _defineProperty(OverflowMenu, "propTypes", {
417
427
  /**
418
428
  * The icon description.
419
429
  */
420
- iconDescription: PropTypes.string.isRequired,
430
+ iconDescription: PropTypes.string,
421
431
  /**
422
432
  * The element ID.
423
433
  */
@@ -484,22 +494,6 @@ _defineProperty(OverflowMenu, "propTypes", {
484
494
  size: PropTypes.oneOf(['sm', 'md', 'lg'])
485
495
  });
486
496
  _defineProperty(OverflowMenu, "contextType", PrefixContext);
487
- _defineProperty(OverflowMenu, "defaultProps", {
488
- ['aria-label']: null,
489
- iconDescription: 'Options',
490
- open: false,
491
- direction: DIRECTION_BOTTOM,
492
- flipped: false,
493
- focusTrap: true,
494
- renderIcon: OverflowMenuVertical,
495
- onClick: () => {},
496
- onKeyDown: () => {},
497
- onClose: () => {},
498
- onOpen: () => {},
499
- menuOffset: getMenuOffset,
500
- menuOffsetFlip: getMenuOffset,
501
- selectorPrimaryFocus: '[data-overflow-menu-primary-focus]'
502
- });
503
497
  (() => {
504
498
  const forwardRef = (props, ref) => /*#__PURE__*/React__default.createElement(OverflowMenu, _extends({}, props, {
505
499
  innerRef: ref
@@ -11,6 +11,8 @@ import PropTypes from 'prop-types';
11
11
  import React__default from 'react';
12
12
  import { usePrefix } from '../../internal/usePrefix.js';
13
13
  import { warning } from '../../internal/warning.js';
14
+ import '../Text/index.js';
15
+ import { Text } from '../Text/Text.js';
14
16
  import { match } from '../../internal/keyboard/match.js';
15
17
  import { ArrowDown, ArrowUp } from '../../internal/keyboard/keys.js';
16
18
 
@@ -71,7 +73,8 @@ const OverflowMenuItem = /*#__PURE__*/React__default.forwardRef(function Overflo
71
73
  className: `${prefix}--overflow-menu-options__option-content`
72
74
  }, itemText);
73
75
  })();
74
- return /*#__PURE__*/React__default.createElement("li", {
76
+ return /*#__PURE__*/React__default.createElement(Text, {
77
+ as: "li",
75
78
  className: overflowMenuItemClasses,
76
79
  role: "none"
77
80
  }, /*#__PURE__*/React__default.createElement(TagToUse, _extends({
@@ -18,10 +18,10 @@ import { usePrefix } from '../../../internal/usePrefix.js';
18
18
  const getInstanceId = setupGetInstanceId();
19
19
  function PageSelector(_ref) {
20
20
  let {
21
- className,
21
+ className = null,
22
22
  currentPage,
23
- id,
24
- labelText,
23
+ id = 1,
24
+ labelText = 'Current page number',
25
25
  totalPages,
26
26
  ...other
27
27
  } = _ref;
@@ -63,10 +63,5 @@ PageSelector.propTypes = {
63
63
  */
64
64
  totalPages: PropTypes.number.isRequired
65
65
  };
66
- PageSelector.defaultProps = {
67
- className: null,
68
- id: 1,
69
- labelText: 'Current page number'
70
- };
71
66
 
72
67
  export { PageSelector as default };
@@ -19,23 +19,23 @@ import { usePrefix } from '../../../internal/usePrefix.js';
19
19
  var _CaretLeft, _CaretRight;
20
20
  function Pagination(_ref) {
21
21
  let {
22
- backwardText,
23
- children,
24
- className,
25
- disabled,
26
- forwardText,
27
- id,
28
- initialPage,
29
- itemsPerPageText,
30
- itemRangeText,
31
- itemText,
22
+ backwardText = 'Previous page',
23
+ children = undefined,
24
+ className = null,
25
+ disabled = false,
26
+ forwardText = 'Next page',
27
+ id = 1,
28
+ initialPage = 1,
29
+ itemsPerPageText = 'Items per page:',
30
+ itemRangeText = (min, max, total) => `${min}–${max} of ${total} items`,
31
+ itemText = (min, max) => `${min}–${max} items`,
32
32
  onChange,
33
- pageRangeText,
34
- pageSize,
35
- pageSizes,
36
- pageText,
37
- pagesUnknown,
38
- totalItems,
33
+ pageRangeText = (current, total) => `${current} of ${total} pages`,
34
+ pageSize = 10,
35
+ pageSizes = undefined,
36
+ pageText = page => `page ${page}`,
37
+ pagesUnknown = false,
38
+ totalItems = undefined,
39
39
  ...other
40
40
  } = _ref;
41
41
  const [currentPage, setCurrentPage] = useState(initialPage);
@@ -193,23 +193,5 @@ Pagination.propTypes = {
193
193
  */
194
194
  totalItems: PropTypes.number
195
195
  };
196
- Pagination.defaultProps = {
197
- backwardText: 'Previous page',
198
- className: null,
199
- children: undefined,
200
- disabled: false,
201
- forwardText: 'Next page',
202
- id: 1,
203
- itemsPerPageText: 'Items per page:',
204
- itemRangeText: (min, max, total) => `${min}–${max} of ${total} items`,
205
- itemText: (min, max) => `${min}–${max} items`,
206
- initialPage: 1,
207
- pageRangeText: (current, total) => `${current} of ${total} pages`,
208
- pageSize: 10,
209
- pageSizes: undefined,
210
- pageText: page => `page ${page}`,
211
- pagesUnknown: false,
212
- totalItems: undefined
213
- };
214
196
 
215
197
  export { Pagination as default };
@@ -11,6 +11,8 @@ import PropTypes from 'prop-types';
11
11
  import React__default, { useState } from 'react';
12
12
  import { Warning, Incomplete, CheckmarkOutline, CircleDash } from '@carbon/icons-react';
13
13
  import { usePrefix } from '../../internal/usePrefix.js';
14
+ import '../Text/index.js';
15
+ import { Text } from '../Text/Text.js';
14
16
  import { matches } from '../../internal/keyboard/match.js';
15
17
  import { Enter, Space } from '../../internal/keyboard/keys.js';
16
18
 
@@ -114,7 +116,7 @@ function ProgressStep(_ref2) {
114
116
  secondaryLabel,
115
117
  disabled,
116
118
  onClick,
117
- translateWithId: t,
119
+ translateWithId: t = translateWithId,
118
120
  ...rest
119
121
  } = _ref2;
120
122
  const prefix = usePrefix();
@@ -185,9 +187,11 @@ function ProgressStep(_ref2) {
185
187
  prefix: prefix
186
188
  }), /*#__PURE__*/React__default.createElement("div", {
187
189
  className: `${prefix}--progress-text`
188
- }, /*#__PURE__*/React__default.createElement("p", {
190
+ }, /*#__PURE__*/React__default.createElement(Text, {
191
+ as: "p",
189
192
  className: `${prefix}--progress-label`
190
- }, label), secondaryLabel !== null && secondaryLabel !== undefined ? /*#__PURE__*/React__default.createElement("p", {
193
+ }, label), secondaryLabel !== null && secondaryLabel !== undefined ? /*#__PURE__*/React__default.createElement(Text, {
194
+ as: "p",
191
195
  className: `${prefix}--progress-optional`
192
196
  }, secondaryLabel) : null), /*#__PURE__*/React__default.createElement("span", {
193
197
  className: `${prefix}--assistive-text`
@@ -250,8 +254,5 @@ ProgressStep.propTypes = {
250
254
  */
251
255
  translateWithId: PropTypes.func
252
256
  };
253
- ProgressStep.defaultProps = {
254
- translateWithId
255
- };
256
257
 
257
258
  export { ProgressIndicator, ProgressStep };
@@ -13,6 +13,9 @@ import React__default from 'react';
13
13
  import { useFallbackId } from '../../internal/useId.js';
14
14
  import { usePrefix } from '../../internal/usePrefix.js';
15
15
  import deprecate from '../../prop-types/deprecate.js';
16
+ import { noopFn } from '../../internal/noopFn.js';
17
+ import '../Text/index.js';
18
+ import { Text } from '../Text/Text.js';
16
19
  import { matches } from '../../internal/keyboard/match.js';
17
20
  import { Enter, Space } from '../../internal/keyboard/keys.js';
18
21
 
@@ -28,8 +31,8 @@ const RadioTile = /*#__PURE__*/React__default.forwardRef(function RadioTile(_ref
28
31
  name,
29
32
  value,
30
33
  id,
31
- onChange,
32
- tabIndex,
34
+ onChange = noopFn,
35
+ tabIndex = 0,
33
36
  ...rest
34
37
  } = _ref;
35
38
  const prefix = usePrefix();
@@ -65,7 +68,7 @@ const RadioTile = /*#__PURE__*/React__default.forwardRef(function RadioTile(_ref
65
68
  className: className
66
69
  }), /*#__PURE__*/React__default.createElement("span", {
67
70
  className: `${prefix}--tile__checkmark`
68
- }, _CheckmarkFilled || (_CheckmarkFilled = /*#__PURE__*/React__default.createElement(CheckmarkFilled, null))), /*#__PURE__*/React__default.createElement("span", {
71
+ }, _CheckmarkFilled || (_CheckmarkFilled = /*#__PURE__*/React__default.createElement(CheckmarkFilled, null))), /*#__PURE__*/React__default.createElement(Text, {
69
72
  className: `${prefix}--tile-content`
70
73
  }, children)));
71
74
  });
@@ -112,10 +115,6 @@ RadioTile.propTypes = {
112
115
  */
113
116
  value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired
114
117
  };
115
- RadioTile.defaultProps = {
116
- onChange: () => {},
117
- tabIndex: 0
118
- };
119
118
  var RadioTile$1 = RadioTile;
120
119
 
121
120
  export { RadioTile$1 as default };
@@ -28,9 +28,6 @@ declare const SearchSkeleton: {
28
28
  */
29
29
  small: PropTypes.Requireable<boolean>;
30
30
  };
31
- defaultProps: {
32
- small: boolean;
33
- };
34
31
  };
35
32
  export default SearchSkeleton;
36
33
  export { SearchSkeleton };