@carbon/react 1.31.2 → 1.32.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/README.md +1 -1
  2. package/es/components/Accordion/Accordion.Skeleton.d.ts +64 -0
  3. package/es/components/Accordion/Accordion.Skeleton.js +3 -3
  4. package/es/components/Accordion/Accordion.d.ts +65 -0
  5. package/es/components/Accordion/Accordion.js +5 -6
  6. package/es/components/Accordion/AccordionItem.d.ts +105 -0
  7. package/es/components/Accordion/AccordionItem.js +12 -9
  8. package/es/components/Accordion/AccordionProvider.d.ts +20 -0
  9. package/es/components/Accordion/AccordionProvider.js +25 -0
  10. package/es/components/Accordion/index.d.ts +11 -0
  11. package/es/components/Button/Button.Skeleton.d.ts +28 -0
  12. package/es/components/Button/Button.Skeleton.js +5 -3
  13. package/es/components/Button/Button.d.ts +72 -0
  14. package/es/components/Button/Button.js +13 -10
  15. package/es/components/Button/index.d.ts +11 -0
  16. package/es/components/Button/index.js +2 -1
  17. package/es/components/ButtonSet/ButtonSet.d.ts +17 -0
  18. package/es/components/ButtonSet/ButtonSet.js +1 -2
  19. package/es/components/ButtonSet/index.d.ts +9 -0
  20. package/es/components/CodeSnippet/CodeSnippet.js +1 -0
  21. package/es/components/ComboButton/index.js +1 -0
  22. package/es/components/ComposedModal/ComposedModal.d.ts +70 -0
  23. package/es/components/ComposedModal/ComposedModal.js +58 -67
  24. package/es/components/ComposedModal/ModalFooter.d.ts +71 -0
  25. package/es/components/ComposedModal/ModalFooter.js +22 -19
  26. package/es/components/ComposedModal/ModalHeader.d.ts +58 -0
  27. package/es/components/ComposedModal/ModalHeader.js +8 -25
  28. package/es/components/ComposedModal/index.d.ts +9 -0
  29. package/es/components/ContainedList/ContainedList.js +12 -1
  30. package/es/components/ContentSwitcher/ContentSwitcher.d.ts +109 -0
  31. package/es/components/ContentSwitcher/ContentSwitcher.js +14 -6
  32. package/es/components/DangerButton/DangerButton.d.ts +9 -0
  33. package/es/components/DangerButton/DangerButton.js +2 -2
  34. package/es/components/DangerButton/index.d.ts +9 -0
  35. package/es/components/DataTable/TableBatchAction.js +1 -0
  36. package/es/components/DataTable/TableBatchActions.js +1 -0
  37. package/es/components/DataTable/TableBody.d.ts +29 -0
  38. package/es/components/DataTable/TableBody.js +2 -3
  39. package/es/components/DataTable/TableContainer.d.ts +51 -0
  40. package/es/components/DataTable/TableContainer.js +3 -4
  41. package/es/components/DataTable/TableExpandHeader.d.ts +86 -0
  42. package/es/components/DataTable/TableExpandHeader.js +4 -5
  43. package/es/components/DatePicker/plugins/fixEventsPlugin.js +12 -16
  44. package/es/components/Dropdown/Dropdown.js +1 -0
  45. package/es/components/FluidTextInput/FluidTextInput.js +1 -0
  46. package/es/components/FormGroup/FormGroup.d.ts +80 -0
  47. package/es/components/IconButton/index.js +3 -2
  48. package/es/components/Layout/index.d.ts +74 -0
  49. package/es/components/Layout/index.js +14 -5
  50. package/es/components/Link/Link.d.ts +2 -2
  51. package/es/components/Link/Link.js +2 -1
  52. package/es/components/MenuButton/index.js +1 -0
  53. package/es/components/Modal/Modal.js +1 -0
  54. package/es/components/ModalWrapper/ModalWrapper.js +1 -0
  55. package/es/components/Notification/Notification.d.ts +531 -0
  56. package/es/components/Notification/Notification.js +40 -6
  57. package/es/components/Notification/index.d.ts +7 -0
  58. package/es/components/PrimaryButton/PrimaryButton.js +1 -0
  59. package/es/components/SecondaryButton/SecondaryButton.js +1 -0
  60. package/es/components/Select/Select.d.ts +1 -1
  61. package/es/components/SkeletonText/SkeletonText.d.ts +61 -0
  62. package/es/components/SkeletonText/SkeletonText.js +15 -17
  63. package/es/components/SkeletonText/index.d.ts +9 -0
  64. package/es/components/Switch/Switch.d.ts +56 -0
  65. package/es/components/Switch/Switch.js +4 -4
  66. package/es/components/Tab/index.d.ts +9 -0
  67. package/es/components/TabContent/TabContent.d.ts +40 -0
  68. package/es/components/TabContent/TabContent.js +6 -12
  69. package/es/components/TabContent/index.d.ts +10 -0
  70. package/es/components/Tabs/Tabs.Skeleton.d.ts +33 -0
  71. package/es/components/Tabs/Tabs.Skeleton.js +2 -2
  72. package/es/components/Tabs/Tabs.d.ts +303 -0
  73. package/es/components/Tabs/Tabs.js +136 -95
  74. package/es/components/Tabs/index.d.ts +10 -0
  75. package/es/components/Tabs/usePressable.js +11 -0
  76. package/es/components/TextInput/ControlledPasswordInput.d.ts +90 -0
  77. package/es/components/TextInput/ControlledPasswordInput.js +5 -6
  78. package/es/components/Tile/Tile.d.ts +153 -0
  79. package/es/components/Tile/Tile.js +62 -74
  80. package/es/components/Tile/index.d.ts +7 -0
  81. package/es/components/Toggle/Toggle.Skeleton.d.ts +3 -47
  82. package/es/components/Toggle/Toggle.Skeleton.js +24 -64
  83. package/es/components/Toggle/Toggle.js +1 -1
  84. package/es/components/UIShell/HeaderGlobalAction.js +1 -0
  85. package/es/components/UIShell/SideNav.d.ts +1 -1
  86. package/es/index.js +16 -16
  87. package/es/internal/keyboard/match.js +2 -2
  88. package/es/internal/useControllableState.js +2 -2
  89. package/es/internal/wrapFocus.js +6 -6
  90. package/es/prop-types/requiredIfGivenPropIsTruthy.js +1 -1
  91. package/es/prop-types/types.js +3 -0
  92. package/lib/components/Accordion/Accordion.Skeleton.d.ts +64 -0
  93. package/lib/components/Accordion/Accordion.Skeleton.js +3 -3
  94. package/lib/components/Accordion/Accordion.d.ts +65 -0
  95. package/lib/components/Accordion/Accordion.js +5 -6
  96. package/lib/components/Accordion/AccordionItem.d.ts +105 -0
  97. package/lib/components/Accordion/AccordionItem.js +11 -8
  98. package/lib/components/Accordion/AccordionProvider.d.ts +20 -0
  99. package/lib/components/Accordion/AccordionProvider.js +34 -0
  100. package/lib/components/Accordion/index.d.ts +11 -0
  101. package/lib/components/Button/Button.Skeleton.d.ts +28 -0
  102. package/lib/components/Button/Button.Skeleton.js +5 -3
  103. package/lib/components/Button/Button.d.ts +72 -0
  104. package/lib/components/Button/Button.js +18 -11
  105. package/lib/components/Button/index.d.ts +11 -0
  106. package/lib/components/Button/index.js +6 -0
  107. package/lib/components/ButtonSet/ButtonSet.d.ts +17 -0
  108. package/lib/components/ButtonSet/ButtonSet.js +1 -2
  109. package/lib/components/ButtonSet/index.d.ts +9 -0
  110. package/lib/components/CodeSnippet/CodeSnippet.js +1 -0
  111. package/lib/components/ComboButton/index.js +1 -0
  112. package/lib/components/ComposedModal/ComposedModal.d.ts +70 -0
  113. package/lib/components/ComposedModal/ComposedModal.js +58 -67
  114. package/lib/components/ComposedModal/ModalFooter.d.ts +71 -0
  115. package/lib/components/ComposedModal/ModalFooter.js +22 -19
  116. package/lib/components/ComposedModal/ModalHeader.d.ts +58 -0
  117. package/lib/components/ComposedModal/ModalHeader.js +8 -25
  118. package/lib/components/ComposedModal/index.d.ts +9 -0
  119. package/lib/components/ContainedList/ContainedList.js +12 -1
  120. package/lib/components/ContentSwitcher/ContentSwitcher.d.ts +109 -0
  121. package/lib/components/ContentSwitcher/ContentSwitcher.js +14 -6
  122. package/lib/components/DangerButton/DangerButton.d.ts +9 -0
  123. package/lib/components/DangerButton/DangerButton.js +2 -2
  124. package/lib/components/DangerButton/index.d.ts +9 -0
  125. package/lib/components/DataTable/TableBatchAction.js +1 -0
  126. package/lib/components/DataTable/TableBatchActions.js +1 -0
  127. package/lib/components/DataTable/TableBody.d.ts +29 -0
  128. package/lib/components/DataTable/TableBody.js +3 -4
  129. package/lib/components/DataTable/TableContainer.d.ts +51 -0
  130. package/lib/components/DataTable/TableContainer.js +3 -4
  131. package/lib/components/DataTable/TableExpandHeader.d.ts +86 -0
  132. package/lib/components/DataTable/TableExpandHeader.js +4 -5
  133. package/lib/components/DatePicker/plugins/fixEventsPlugin.js +12 -16
  134. package/lib/components/Dropdown/Dropdown.js +1 -0
  135. package/lib/components/FluidTextInput/FluidTextInput.js +1 -0
  136. package/lib/components/FormGroup/FormGroup.d.ts +80 -0
  137. package/lib/components/IconButton/index.js +3 -2
  138. package/lib/components/Layout/index.d.ts +74 -0
  139. package/lib/components/Layout/index.js +14 -5
  140. package/lib/components/Link/Link.d.ts +2 -2
  141. package/lib/components/Link/Link.js +2 -1
  142. package/lib/components/MenuButton/index.js +1 -0
  143. package/lib/components/Modal/Modal.js +1 -0
  144. package/lib/components/ModalWrapper/ModalWrapper.js +1 -0
  145. package/lib/components/Notification/Notification.d.ts +531 -0
  146. package/lib/components/Notification/Notification.js +40 -6
  147. package/lib/components/Notification/index.d.ts +7 -0
  148. package/lib/components/PrimaryButton/PrimaryButton.js +1 -0
  149. package/lib/components/SecondaryButton/SecondaryButton.js +1 -0
  150. package/lib/components/Select/Select.d.ts +1 -1
  151. package/lib/components/SkeletonText/SkeletonText.d.ts +61 -0
  152. package/lib/components/SkeletonText/SkeletonText.js +15 -17
  153. package/lib/components/SkeletonText/index.d.ts +9 -0
  154. package/lib/components/Switch/Switch.d.ts +56 -0
  155. package/lib/components/Switch/Switch.js +4 -4
  156. package/lib/components/Tab/index.d.ts +9 -0
  157. package/lib/components/TabContent/TabContent.d.ts +40 -0
  158. package/lib/components/TabContent/TabContent.js +6 -12
  159. package/lib/components/TabContent/index.d.ts +10 -0
  160. package/lib/components/Tabs/Tabs.Skeleton.d.ts +33 -0
  161. package/lib/components/Tabs/Tabs.Skeleton.js +2 -2
  162. package/lib/components/Tabs/Tabs.d.ts +303 -0
  163. package/lib/components/Tabs/Tabs.js +135 -94
  164. package/lib/components/Tabs/index.d.ts +10 -0
  165. package/lib/components/Tabs/usePressable.js +11 -0
  166. package/lib/components/TextInput/ControlledPasswordInput.d.ts +90 -0
  167. package/lib/components/TextInput/ControlledPasswordInput.js +5 -6
  168. package/lib/components/Tile/Tile.d.ts +153 -0
  169. package/lib/components/Tile/Tile.js +62 -74
  170. package/lib/components/Tile/index.d.ts +7 -0
  171. package/lib/components/Toggle/Toggle.Skeleton.d.ts +3 -47
  172. package/lib/components/Toggle/Toggle.Skeleton.js +22 -62
  173. package/lib/components/Toggle/Toggle.js +1 -1
  174. package/lib/components/UIShell/HeaderGlobalAction.js +1 -0
  175. package/lib/components/UIShell/SideNav.d.ts +1 -1
  176. package/lib/index.js +51 -47
  177. package/lib/internal/keyboard/match.js +2 -2
  178. package/lib/internal/useControllableState.js +2 -2
  179. package/lib/internal/wrapFocus.js +6 -6
  180. package/lib/prop-types/requiredIfGivenPropIsTruthy.js +1 -1
  181. package/lib/prop-types/types.js +3 -0
  182. package/package.json +4 -3
  183. package/scss/components/contained-list/_contained-list.scss +9 -0
  184. package/scss/components/contained-list/_index.scss +9 -0
@@ -12,6 +12,7 @@ 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
14
  import Button from '../Button/Button.js';
15
+ import '../Button/Button.Skeleton.js';
15
16
  import useIsomorphicEffect from '../../internal/useIsomorphicEffect.js';
16
17
  import { useNoInteractiveChildren } from '../../internal/useNoInteractiveChildren.js';
17
18
  import { usePrefix } from '../../internal/usePrefix.js';
@@ -76,9 +77,16 @@ NotificationActionButton.propTypes = {
76
77
  */
77
78
  onClick: PropTypes.func
78
79
  };
80
+
81
+ /**
82
+ * NotificationButton
83
+ * ==================
84
+ */
85
+
79
86
  function NotificationButton(_ref2) {
80
87
  let {
81
- ['aria-label']: ariaLabel,
88
+ 'aria-label': ariaLabel,
89
+ // @ts-expect-error: deprecated prop
82
90
  ariaLabel: deprecatedAriaLabel,
83
91
  className,
84
92
  type,
@@ -144,6 +152,12 @@ NotificationButton.defaultProps = {
144
152
  type: 'button',
145
153
  renderIcon: Close
146
154
  };
155
+
156
+ /**
157
+ * NotificationIcon
158
+ * ================
159
+ */
160
+
147
161
  const iconTypes = {
148
162
  error: ErrorFilled,
149
163
  success: CheckmarkFilled,
@@ -173,9 +187,16 @@ NotificationIcon.propTypes = {
173
187
  kind: PropTypes.oneOf(['error', 'success', 'warning', 'warning-alt', 'info', 'info-square']).isRequired,
174
188
  notificationType: PropTypes.oneOf(['inline', 'toast']).isRequired
175
189
  };
190
+
191
+ /**
192
+ * ToastNotification
193
+ * =================
194
+ */
195
+
176
196
  function ToastNotification(_ref4) {
177
197
  let {
178
198
  ['aria-label']: ariaLabel,
199
+ // @ts-expect-error: deprecated prop
179
200
  ariaLabel: deprecatedAriaLabel,
180
201
  role,
181
202
  onClose,
@@ -255,7 +276,7 @@ function ToastNotification(_ref4) {
255
276
  onClick: handleCloseButtonClick,
256
277
  "aria-hidden": "true",
257
278
  "aria-label": deprecatedAriaLabel || ariaLabel,
258
- tabIndex: "-1"
279
+ tabIndex: -1
259
280
  }));
260
281
  }
261
282
  ToastNotification.propTypes = {
@@ -310,7 +331,7 @@ ToastNotification.propTypes = {
310
331
  */
311
332
  statusIconDescription: PropTypes.string,
312
333
  /**
313
- * Specify the sub-title
334
+ * Specify the subtitle
314
335
  */
315
336
  subtitle: PropTypes.string,
316
337
  /**
@@ -329,6 +350,12 @@ ToastNotification.defaultProps = {
329
350
  hideCloseButton: false,
330
351
  timeout: 0
331
352
  };
353
+
354
+ /**
355
+ * InlineNotification
356
+ * ==================
357
+ */
358
+
332
359
  function InlineNotification(_ref5) {
333
360
  let {
334
361
  ['aria-label']: ariaLabel,
@@ -391,7 +418,7 @@ function InlineNotification(_ref5) {
391
418
  onClick: handleCloseButtonClick,
392
419
  "aria-hidden": "true",
393
420
  "aria-label": ariaLabel,
394
- tabIndex: "-1"
421
+ tabIndex: -1
395
422
  }));
396
423
  }
397
424
  InlineNotification.propTypes = {
@@ -437,7 +464,7 @@ InlineNotification.propTypes = {
437
464
  */
438
465
  statusIconDescription: PropTypes.string,
439
466
  /**
440
- * Specify the sub-title
467
+ * Specify the subtitle
441
468
  */
442
469
  subtitle: PropTypes.string,
443
470
  /**
@@ -451,10 +478,17 @@ InlineNotification.defaultProps = {
451
478
  onCloseButtonClick: () => {},
452
479
  hideCloseButton: false
453
480
  };
481
+
482
+ /**
483
+ * ActionableNotification
484
+ * ======================
485
+ */
486
+
454
487
  function ActionableNotification(_ref6) {
455
488
  let {
456
489
  actionButtonLabel,
457
490
  ['aria-label']: ariaLabel,
491
+ // @ts-expect-error: deprecated prop
458
492
  ariaLabel: deprecatedAriaLabel,
459
493
  children,
460
494
  role,
@@ -599,7 +633,7 @@ ActionableNotification.propTypes = {
599
633
  */
600
634
  statusIconDescription: PropTypes.string,
601
635
  /**
602
- * Specify the sub-title
636
+ * Specify the subtitle
603
637
  */
604
638
  subtitle: PropTypes.string,
605
639
  /**
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ export { NotificationActionButton, type NotificationActionButtonProps, NotificationButton, type NotificationButtonProps, ToastNotification, type ToastNotificationProps, InlineNotification, type InlineNotificationProps, ActionableNotification, type ActionableNotificationProps, } from './Notification';
@@ -8,6 +8,7 @@
8
8
  import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import React__default from 'react';
10
10
  import Button from '../Button/Button.js';
11
+ import '../Button/Button.Skeleton.js';
11
12
 
12
13
  const PrimaryButton = props => /*#__PURE__*/React__default.createElement(Button, _extends({
13
14
  kind: "primary"
@@ -8,6 +8,7 @@
8
8
  import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import React__default from 'react';
10
10
  import Button from '../Button/Button.js';
11
+ import '../Button/Button.Skeleton.js';
11
12
 
12
13
  const SecondaryButton = props => /*#__PURE__*/React__default.createElement(Button, _extends({
13
14
  kind: "secondary"
@@ -85,5 +85,5 @@ interface SelectProps extends Omit<ComponentPropsWithRef<'select'>, ExcludedAttr
85
85
  */
86
86
  warnText?: ReactNode;
87
87
  }
88
- declare const Select: React.ForwardRefExoticComponent<Pick<SelectProps, "value" | "children" | "className" | "disabled" | "size" | "form" | "slot" | "style" | "title" | "dir" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "autoComplete" | "multiple" | "key" | "id" | "onAnimationEnd" | "aria-controls" | "aria-expanded" | "onClick" | "onKeyDown" | "contentEditable" | "contextMenu" | "draggable" | "hidden" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "inline" | "name" | "readOnly" | "required" | "invalid" | "labelText" | "helperText" | "invalidText" | "hideLabel" | "warn" | "warnText" | "light" | "noLabel"> & React.RefAttributes<HTMLSelectElement>>;
88
+ declare const Select: React.ForwardRefExoticComponent<Pick<SelectProps, "value" | "children" | "disabled" | "form" | "slot" | "style" | "title" | "className" | "size" | "dir" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "autoComplete" | "multiple" | "key" | "id" | "aria-controls" | "aria-expanded" | "onClick" | "onAnimationEnd" | "onKeyDown" | "contentEditable" | "contextMenu" | "draggable" | "hidden" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "inline" | "name" | "readOnly" | "required" | "light" | "invalid" | "labelText" | "helperText" | "invalidText" | "hideLabel" | "warn" | "warnText" | "noLabel"> & React.RefAttributes<HTMLSelectElement>>;
89
89
  export default Select;
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import PropTypes from 'prop-types';
8
+ interface SkeletonTextProps {
9
+ /**
10
+ * Specify an optional className to be applied to the container node.
11
+ */
12
+ className?: string;
13
+ /**
14
+ * Generates skeleton text at a larger size.
15
+ */
16
+ heading?: boolean;
17
+ /**
18
+ * The number of lines shown if paragraph is true.
19
+ */
20
+ lineCount?: number;
21
+ /**
22
+ * Set this to true to generate multiple lines of text.
23
+ */
24
+ paragraph?: boolean;
25
+ /**
26
+ * Width (in px or %) of single line of text or max-width of paragraph lines.
27
+ */
28
+ width?: string;
29
+ }
30
+ declare const SkeletonText: {
31
+ ({ paragraph, lineCount, width, heading, className, ...rest }: SkeletonTextProps): JSX.Element;
32
+ propTypes: {
33
+ /**
34
+ * Specify an optional className to be applied to the container node
35
+ */
36
+ className: PropTypes.Requireable<string>;
37
+ /**
38
+ * generates skeleton text at a larger size
39
+ */
40
+ heading: PropTypes.Requireable<boolean>;
41
+ /**
42
+ * the number of lines shown if paragraph is true
43
+ */
44
+ lineCount: PropTypes.Requireable<number>;
45
+ /**
46
+ * will generate multiple lines of text
47
+ */
48
+ paragraph: PropTypes.Requireable<boolean>;
49
+ /**
50
+ * width (in px or %) of single line of text or max-width of paragraph lines
51
+ */
52
+ width: PropTypes.Requireable<string>;
53
+ };
54
+ defaultProps: {
55
+ paragraph: boolean;
56
+ width: string;
57
+ heading: boolean;
58
+ lineCount: number;
59
+ };
60
+ };
61
+ export default SkeletonText;
@@ -18,12 +18,12 @@ function getRandomInt(min, max, n) {
18
18
  }
19
19
  const SkeletonText = _ref => {
20
20
  let {
21
- paragraph,
22
- lineCount,
23
- width,
24
- heading,
25
- className,
26
- ...other
21
+ paragraph = false,
22
+ lineCount = 3,
23
+ width = '100%',
24
+ heading = false,
25
+ className = '',
26
+ ...rest
27
27
  } = _ref;
28
28
  const prefix = usePrefix();
29
29
  const skeletonTextClasses = cx({
@@ -34,10 +34,8 @@ const SkeletonText = _ref => {
34
34
  const widthNum = parseInt(width, 10);
35
35
  const widthPx = width.includes('px');
36
36
  const widthPercent = width.includes('%');
37
- let lineCountNumber;
38
- if (!paragraph) {
39
- lineCountNumber = '1';
40
- } else {
37
+ let lineCountNumber = 1;
38
+ if (paragraph) {
41
39
  lineCountNumber = lineCount;
42
40
  }
43
41
  const refs = useRef([]);
@@ -57,18 +55,19 @@ const SkeletonText = _ref => {
57
55
  });
58
56
  }, [lineCountNumber, paragraph, refs, width, widthNum, widthPercent, widthPx]);
59
57
  const lines = [];
60
- for (var i = 0; i < lineCountNumber; i++) {
58
+ for (let i = 0; i < lineCountNumber; i++) {
61
59
  lines.push( /*#__PURE__*/React__default.createElement("p", _extends({
62
60
  className: skeletonTextClasses,
63
61
  key: i,
64
62
  ref: el => refs.current = [...refs.current, el]
65
- }, other)));
63
+ }, rest)));
66
64
  }
67
- if (lineCountNumber !== '1') {
65
+ if (lineCountNumber !== 1) {
68
66
  return /*#__PURE__*/React__default.createElement("div", null, lines);
69
- } else {
70
- return lines;
71
67
  }
68
+
69
+ // eslint-disable-next-line react/jsx-no-useless-fragment
70
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, lines);
72
71
  };
73
72
  SkeletonText.propTypes = {
74
73
  /**
@@ -98,6 +97,5 @@ SkeletonText.defaultProps = {
98
97
  heading: false,
99
98
  lineCount: 3
100
99
  };
101
- var SkeletonText$1 = SkeletonText;
102
100
 
103
- export { SkeletonText$1 as default };
101
+ export { SkeletonText as default };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import SkeletonText from './SkeletonText';
8
+ export default SkeletonText;
9
+ export { SkeletonText };
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import React, { ButtonHTMLAttributes, ReactNode } from 'react';
8
+ interface SwitchEventHandlersParams {
9
+ index?: number;
10
+ name?: string | number;
11
+ text?: string;
12
+ key?: string | number;
13
+ }
14
+ export interface SwitchProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'name' | 'onClick' | 'onKeyDown'> {
15
+ /**
16
+ * Provide child elements to be rendered inside of the Switch
17
+ */
18
+ children?: ReactNode;
19
+ /**
20
+ * Specify an optional className to be added to your Switch
21
+ */
22
+ className?: string;
23
+ /**
24
+ * Specify whether or not the Switch should be disabled
25
+ */
26
+ disabled?: boolean;
27
+ /**
28
+ * The index of your Switch in your ContentSwitcher that is used for event handlers.
29
+ * Reserved for usage in ContentSwitcher
30
+ */
31
+ index?: number;
32
+ /**
33
+ * Provide the name of your Switch that is used for event handlers
34
+ */
35
+ name?: string | number;
36
+ /**
37
+ * A handler that is invoked when a user clicks on the control.
38
+ * Reserved for usage in ContentSwitcher
39
+ */
40
+ onClick?: (params: SwitchEventHandlersParams) => void;
41
+ /**
42
+ * A handler that is invoked on the key down event for the control.
43
+ * Reserved for usage in ContentSwitcher
44
+ */
45
+ onKeyDown?: (params: SwitchEventHandlersParams) => void;
46
+ /**
47
+ * Whether your Switch is selected. Reserved for usage in ContentSwitcher
48
+ */
49
+ selected?: boolean;
50
+ /**
51
+ * Provide the contents of your Switch
52
+ */
53
+ text?: string;
54
+ }
55
+ declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLButtonElement>>;
56
+ export default Switch;
@@ -20,14 +20,14 @@ const Switch = /*#__PURE__*/React__default.forwardRef(function Switch(props, tab
20
20
  name,
21
21
  onClick,
22
22
  onKeyDown,
23
- selected,
23
+ selected = false,
24
24
  text,
25
25
  ...other
26
26
  } = props;
27
27
  const prefix = usePrefix();
28
28
  const handleClick = e => {
29
29
  e.preventDefault();
30
- onClick({
30
+ onClick?.({
31
31
  index,
32
32
  name,
33
33
  text
@@ -35,7 +35,7 @@ const Switch = /*#__PURE__*/React__default.forwardRef(function Switch(props, tab
35
35
  };
36
36
  const handleKeyDown = event => {
37
37
  const key = event.key || event.which;
38
- onKeyDown({
38
+ onKeyDown?.({
39
39
  index,
40
40
  name,
41
41
  text,
@@ -55,7 +55,7 @@ const Switch = /*#__PURE__*/React__default.forwardRef(function Switch(props, tab
55
55
  type: "button",
56
56
  ref: tabRef,
57
57
  role: "tab",
58
- tabIndex: selected ? '0' : '-1',
58
+ tabIndex: selected ? 0 : -1,
59
59
  "aria-selected": selected
60
60
  }, other, commonProps), /*#__PURE__*/React__default.createElement("span", {
61
61
  className: `${prefix}--content-switcher__label`,
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import { Tab } from '../Tabs/Tabs';
8
+ export default Tab;
9
+ export { Tab };
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import PropTypes from 'prop-types';
8
+ import { type HTMLAttributes, type ReactNode } from 'react';
9
+ export interface TabContentProps extends HTMLAttributes<HTMLDivElement> {
10
+ /**
11
+ * Pass in content to render inside the TabContent
12
+ */
13
+ children?: ReactNode;
14
+ /**
15
+ * Provide a className for the tab content container
16
+ */
17
+ className?: string;
18
+ /**
19
+ * Specify whether the TabContent is selected
20
+ */
21
+ selected?: boolean;
22
+ }
23
+ declare function TabContent(props: any): JSX.Element;
24
+ declare namespace TabContent {
25
+ var propTypes: {
26
+ /**
27
+ * Pass in content to render inside the TabContent
28
+ */
29
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
30
+ /**
31
+ * Provide a className for the tab content container
32
+ */
33
+ className: PropTypes.Requireable<string>;
34
+ /**
35
+ * Specify whether the TabContent is selected
36
+ */
37
+ selected: PropTypes.Requireable<boolean>;
38
+ };
39
+ }
40
+ export default TabContent;
@@ -22,12 +22,12 @@ function useTabbableContent(ref) {
22
22
  // eslint-disable-next-line react-hooks/exhaustive-deps
23
23
  useIsomorphicEffect(() => {
24
24
  if (ref.current) {
25
- setHasTabbableContent(ref.current.querySelector(selectorTabbable));
25
+ setHasTabbableContent(!!ref.current.querySelector(selectorTabbable));
26
26
  }
27
27
  });
28
28
  return hasTabbableContent;
29
29
  }
30
- const TabContent = props => {
30
+ function TabContent(props) {
31
31
  const {
32
32
  className,
33
33
  selected,
@@ -35,9 +35,7 @@ const TabContent = props => {
35
35
  ...other
36
36
  } = props;
37
37
  const prefix = usePrefix();
38
- const tabContentClasses = cx(`${prefix}--tab-content`, {
39
- [className]: className
40
- });
38
+ const tabContentClasses = cx(`${prefix}--tab-content`, className);
41
39
  const ref = useRef(null);
42
40
  const hasTabbableContent = useTabbableContent(ref);
43
41
  return /*#__PURE__*/React__default.createElement("div", _extends({
@@ -49,10 +47,10 @@ const TabContent = props => {
49
47
  ref: ref,
50
48
  tabIndex: hasTabbableContent ? undefined : 0
51
49
  }), children);
52
- };
50
+ }
53
51
  TabContent.propTypes = {
54
52
  /**
55
- * Pass in content to render inside of the TabContent
53
+ * Pass in content to render inside the TabContent
56
54
  */
57
55
  children: PropTypes.node,
58
56
  /**
@@ -64,9 +62,5 @@ TabContent.propTypes = {
64
62
  */
65
63
  selected: PropTypes.bool
66
64
  };
67
- TabContent.defaultProps = {
68
- selected: false
69
- };
70
- var TabContent$1 = TabContent;
71
65
 
72
- export { TabContent$1 as default };
66
+ export { TabContent as default };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ export { type TabContentProps } from './TabContent';
8
+ import TabContent from './TabContent';
9
+ export default TabContent;
10
+ export { TabContent };
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import PropTypes from 'prop-types';
8
+ import { type HTMLAttributes } from 'react';
9
+ export interface TabsSkeletonProps extends HTMLAttributes<HTMLDivElement> {
10
+ /**
11
+ * Specify an optional className to add.
12
+ */
13
+ className?: string;
14
+ /**
15
+ * Provide the type of Tab
16
+ */
17
+ contained?: boolean;
18
+ }
19
+ declare function TabsSkeleton({ className, contained, ...rest }: TabsSkeletonProps): JSX.Element;
20
+ declare namespace TabsSkeleton {
21
+ var propTypes: {
22
+ /**
23
+ * Specify an optional className to add.
24
+ */
25
+ className: PropTypes.Requireable<string>;
26
+ /**
27
+ * Provide the type of Tab
28
+ */
29
+ contained: PropTypes.Requireable<boolean>;
30
+ };
31
+ }
32
+ export default TabsSkeleton;
33
+ export { TabsSkeleton };
@@ -11,7 +11,7 @@ import React__default from 'react';
11
11
  import cx from 'classnames';
12
12
  import { usePrefix } from '../../internal/usePrefix.js';
13
13
 
14
- var _span;
14
+ var _span, _Tab, _Tab2, _Tab3, _Tab4, _Tab5;
15
15
  function Tab() {
16
16
  const prefix = usePrefix();
17
17
  return /*#__PURE__*/React__default.createElement("li", {
@@ -34,7 +34,7 @@ function TabsSkeleton(_ref) {
34
34
  className: tabClasses
35
35
  }, rest), /*#__PURE__*/React__default.createElement("ul", {
36
36
  className: `${prefix}--tabs__nav`
37
- }, Tab(), Tab(), Tab(), Tab(), Tab()));
37
+ }, _Tab || (_Tab = /*#__PURE__*/React__default.createElement(Tab, null)), _Tab2 || (_Tab2 = /*#__PURE__*/React__default.createElement(Tab, null)), _Tab3 || (_Tab3 = /*#__PURE__*/React__default.createElement(Tab, null)), _Tab4 || (_Tab4 = /*#__PURE__*/React__default.createElement(Tab, null)), _Tab5 || (_Tab5 = /*#__PURE__*/React__default.createElement(Tab, null))));
38
38
  }
39
39
  TabsSkeleton.propTypes = {
40
40
  /**