@carbon/ibm-products 2.94.0 → 2.95.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 (252) hide show
  1. package/css/carbon.css +92 -103
  2. package/css/carbon.css.map +1 -1
  3. package/css/index-full-carbon.css +605 -186
  4. package/css/index-full-carbon.css.map +1 -1
  5. package/css/index-full-carbon.min.css +1 -1
  6. package/css/index-full-carbon.min.css.map +1 -1
  7. package/css/index-without-carbon-released-only.css +43 -7
  8. package/css/index-without-carbon-released-only.css.map +1 -1
  9. package/css/index-without-carbon-released-only.min.css +1 -1
  10. package/css/index-without-carbon-released-only.min.css.map +1 -1
  11. package/css/index-without-carbon.css +513 -83
  12. package/css/index-without-carbon.css.map +1 -1
  13. package/css/index-without-carbon.min.css +1 -1
  14. package/css/index-without-carbon.min.css.map +1 -1
  15. package/css/index.css +308 -178
  16. package/css/index.css.map +1 -1
  17. package/css/index.min.css +1 -1
  18. package/css/index.min.css.map +1 -1
  19. package/es/components/APIKeyModal/APIKeyModal.d.ts +3 -0
  20. package/es/components/APIKeyModal/APIKeyModal.d.ts.map +1 -1
  21. package/es/components/APIKeyModal/APIKeyModal.js +8 -0
  22. package/es/components/AddSelect/next/AddSelect.d.ts +7 -9
  23. package/es/components/AddSelect/next/AddSelect.d.ts.map +1 -1
  24. package/es/components/AddSelect/next/AddSelect.js +0 -2
  25. package/es/components/AddSelect/next/AddSelectBody.d.ts +4 -0
  26. package/es/components/AddSelect/next/AddSelectBody.d.ts.map +1 -1
  27. package/es/components/AddSelect/next/AddSelectBody.js +80 -4
  28. package/es/components/AddSelect/next/AddSelectColumn.d.ts +1 -1
  29. package/es/components/AddSelect/next/AddSelectRow.d.ts +6 -0
  30. package/es/components/AddSelect/next/AddSelectRow.d.ts.map +1 -1
  31. package/es/components/AddSelect/next/AddSelectRow.js +10 -3
  32. package/es/components/AddSelect/next/AddSelectSelectionSummaryItem.d.ts.map +1 -1
  33. package/es/components/AddSelect/next/AddSelectSelectionSummaryItem.js +5 -3
  34. package/es/components/AddSelect/next/index.d.ts +0 -1
  35. package/es/components/AddSelect/next/index.d.ts.map +1 -1
  36. package/es/components/BigNumber/BigNumber.d.ts +1 -1
  37. package/es/components/BigNumber/BigNumber.d.ts.map +1 -1
  38. package/es/components/BigNumber/BigNumber.js +2 -2
  39. package/es/components/Card/next/Card.d.ts +87 -11
  40. package/es/components/Card/next/Card.d.ts.map +1 -1
  41. package/es/components/Card/next/Card.js +62 -8
  42. package/es/components/Card/next/Card.types.d.ts +13 -0
  43. package/es/components/Card/next/Card.types.d.ts.map +1 -1
  44. package/es/components/Card/next/CardAction.d.ts +43 -0
  45. package/es/components/Card/next/CardAction.d.ts.map +1 -0
  46. package/es/components/Card/next/CardAction.js +51 -0
  47. package/es/components/Card/next/CardActions.d.ts +46 -0
  48. package/es/components/Card/next/CardActions.d.ts.map +1 -0
  49. package/es/components/Card/next/CardActions.js +107 -0
  50. package/es/components/Card/next/CardCaption.d.ts +46 -0
  51. package/es/components/Card/next/CardCaption.d.ts.map +1 -0
  52. package/es/components/Card/next/CardCaption.js +52 -0
  53. package/es/components/Card/next/CardContext.js +12 -2
  54. package/es/components/Card/next/CardFooter.d.ts.map +1 -1
  55. package/es/components/Card/next/CardHeader.d.ts.map +1 -1
  56. package/es/components/Card/next/CardHeader.js +25 -2
  57. package/es/components/Card/next/CardHeaderMedia.d.ts +33 -0
  58. package/es/components/Card/next/CardHeaderMedia.d.ts.map +1 -0
  59. package/es/components/Card/next/CardHeaderMedia.js +44 -0
  60. package/es/components/Card/next/CardLabel.d.ts +46 -0
  61. package/es/components/Card/next/CardLabel.d.ts.map +1 -0
  62. package/es/components/Card/next/CardLabel.js +52 -0
  63. package/es/components/Card/next/CardMedia.d.ts +39 -0
  64. package/es/components/Card/next/CardMedia.d.ts.map +1 -0
  65. package/es/components/Card/next/CardMedia.js +50 -0
  66. package/es/components/Card/next/CardTitle.d.ts +82 -0
  67. package/es/components/Card/next/CardTitle.d.ts.map +1 -0
  68. package/es/components/Card/next/CardTitle.js +77 -0
  69. package/es/components/Card/next/CardTitleMedia.d.ts +24 -0
  70. package/es/components/Card/next/CardTitleMedia.d.ts.map +1 -0
  71. package/es/components/Card/next/CardTitleMedia.js +48 -0
  72. package/es/components/Card/next/index.d.ts +2 -3
  73. package/es/components/Card/next/index.d.ts.map +1 -1
  74. package/es/components/Card/next/index.js +17 -5
  75. package/es/components/Coachmark/next/Coachmark/Coachmark.d.ts +9 -3
  76. package/es/components/Coachmark/next/Coachmark/Coachmark.d.ts.map +1 -1
  77. package/es/components/Coachmark/next/Coachmark/Coachmark.js +6 -13
  78. package/es/components/Coachmark/next/Coachmark/CoachmarkContent.d.ts +1 -1
  79. package/es/components/Coachmark/next/Coachmark/CoachmarkContent.d.ts.map +1 -1
  80. package/es/components/Coachmark/next/Coachmark/CoachmarkContent.js +16 -32
  81. package/es/components/Coachmark/next/Coachmark/context.d.ts +2 -2
  82. package/es/components/Coachmark/next/Coachmark/context.d.ts.map +1 -1
  83. package/es/components/Coachmark/next/Coachmark/context.js +1 -2
  84. package/es/components/ExportModal/ExportModal.d.ts +1 -0
  85. package/es/components/ExportModal/ExportModal.d.ts.map +1 -1
  86. package/es/components/ExportModal/ExportModal.js +6 -0
  87. package/es/components/ImportModal/ImportModal.d.ts +3 -0
  88. package/es/components/ImportModal/ImportModal.d.ts.map +1 -1
  89. package/es/components/ImportModal/ImportModal.js +8 -0
  90. package/es/components/PageHeader/PageHeader.d.ts +6 -0
  91. package/es/components/PageHeader/PageHeader.d.ts.map +1 -1
  92. package/es/components/PageHeader/PageHeader.js +11 -0
  93. package/es/components/Tearsheet/next/StackContext.d.ts +2 -2
  94. package/es/components/Tearsheet/next/StackContext.d.ts.map +1 -1
  95. package/es/components/Tearsheet/next/Tearsheet.d.ts +30 -28
  96. package/es/components/Tearsheet/next/Tearsheet.d.ts.map +1 -1
  97. package/es/components/Tearsheet/next/Tearsheet.js +4 -2
  98. package/es/components/Tearsheet/next/TearsheetBody.d.ts +20 -14
  99. package/es/components/Tearsheet/next/TearsheetBody.d.ts.map +1 -1
  100. package/es/components/Tearsheet/next/TearsheetBody.js +4 -0
  101. package/es/components/Tearsheet/next/TearsheetHeader.d.ts +15 -14
  102. package/es/components/Tearsheet/next/TearsheetHeader.d.ts.map +1 -1
  103. package/es/components/Tearsheet/next/TearsheetHeader.js +14 -7
  104. package/es/components/Tearsheet/next/TearsheetHeaderActions.d.ts +10 -6
  105. package/es/components/Tearsheet/next/TearsheetHeaderActions.d.ts.map +1 -1
  106. package/es/components/Tearsheet/next/TearsheetHeaderActions.js +6 -3
  107. package/es/components/Tearsheet/next/TearsheetHeaderContent.d.ts.map +1 -1
  108. package/es/components/Tearsheet/next/TearsheetHeaderContent.js +7 -4
  109. package/es/components/Tearsheet/next/_story-assets/StepTearsheet.d.ts +7 -1
  110. package/es/components/Tearsheet/next/_story-assets/StepTearsheet.d.ts.map +1 -1
  111. package/es/components/Tearsheet/next/context.d.ts +2 -1
  112. package/es/components/Tearsheet/next/context.d.ts.map +1 -1
  113. package/es/components/index.d.ts +1 -1
  114. package/es/components/index.d.ts.map +1 -1
  115. package/es/node_modules/@carbon/icons-react/es/generated/bucket-11.js +283 -294
  116. package/es/node_modules/@carbon/icons-react/es/generated/bucket-3.js +25 -41
  117. package/es/node_modules/@carbon/icons-react/es/{iconPropTypes-BElKp6Sn.js → iconPropTypes-CdMBxq3Y.js} +1 -1
  118. package/lib/components/APIKeyModal/APIKeyModal.d.ts +3 -0
  119. package/lib/components/APIKeyModal/APIKeyModal.d.ts.map +1 -1
  120. package/lib/components/APIKeyModal/APIKeyModal.js +8 -0
  121. package/lib/components/AddSelect/next/AddSelect.d.ts +7 -9
  122. package/lib/components/AddSelect/next/AddSelect.d.ts.map +1 -1
  123. package/lib/components/AddSelect/next/AddSelect.js +0 -2
  124. package/lib/components/AddSelect/next/AddSelectBody.d.ts +4 -0
  125. package/lib/components/AddSelect/next/AddSelectBody.d.ts.map +1 -1
  126. package/lib/components/AddSelect/next/AddSelectBody.js +78 -2
  127. package/lib/components/AddSelect/next/AddSelectColumn.d.ts +1 -1
  128. package/lib/components/AddSelect/next/AddSelectRow.d.ts +6 -0
  129. package/lib/components/AddSelect/next/AddSelectRow.d.ts.map +1 -1
  130. package/lib/components/AddSelect/next/AddSelectRow.js +9 -2
  131. package/lib/components/AddSelect/next/AddSelectSelectionSummaryItem.d.ts.map +1 -1
  132. package/lib/components/AddSelect/next/AddSelectSelectionSummaryItem.js +5 -3
  133. package/lib/components/AddSelect/next/index.d.ts +0 -1
  134. package/lib/components/AddSelect/next/index.d.ts.map +1 -1
  135. package/lib/components/BigNumber/BigNumber.d.ts +1 -1
  136. package/lib/components/BigNumber/BigNumber.d.ts.map +1 -1
  137. package/lib/components/BigNumber/BigNumber.js +2 -2
  138. package/lib/components/Card/next/Card.d.ts +87 -11
  139. package/lib/components/Card/next/Card.d.ts.map +1 -1
  140. package/lib/components/Card/next/Card.js +61 -11
  141. package/lib/components/Card/next/Card.types.d.ts +13 -0
  142. package/lib/components/Card/next/Card.types.d.ts.map +1 -1
  143. package/lib/components/Card/next/CardAction.d.ts +43 -0
  144. package/lib/components/Card/next/CardAction.d.ts.map +1 -0
  145. package/lib/components/Card/next/CardAction.js +53 -0
  146. package/lib/components/Card/next/CardActions.d.ts +46 -0
  147. package/lib/components/Card/next/CardActions.d.ts.map +1 -0
  148. package/lib/components/Card/next/CardActions.js +109 -0
  149. package/lib/components/Card/next/CardCaption.d.ts +46 -0
  150. package/lib/components/Card/next/CardCaption.d.ts.map +1 -0
  151. package/lib/components/Card/next/CardCaption.js +54 -0
  152. package/lib/components/Card/next/CardContext.js +13 -1
  153. package/lib/components/Card/next/CardFooter.d.ts.map +1 -1
  154. package/lib/components/Card/next/CardHeader.d.ts.map +1 -1
  155. package/lib/components/Card/next/CardHeader.js +24 -1
  156. package/lib/components/Card/next/CardHeaderMedia.d.ts +33 -0
  157. package/lib/components/Card/next/CardHeaderMedia.d.ts.map +1 -0
  158. package/lib/components/Card/next/CardHeaderMedia.js +46 -0
  159. package/lib/components/Card/next/CardLabel.d.ts +46 -0
  160. package/lib/components/Card/next/CardLabel.d.ts.map +1 -0
  161. package/lib/components/Card/next/CardLabel.js +54 -0
  162. package/lib/components/Card/next/CardMedia.d.ts +39 -0
  163. package/lib/components/Card/next/CardMedia.d.ts.map +1 -0
  164. package/lib/components/Card/next/CardMedia.js +52 -0
  165. package/lib/components/Card/next/CardTitle.d.ts +82 -0
  166. package/lib/components/Card/next/CardTitle.d.ts.map +1 -0
  167. package/lib/components/Card/next/CardTitle.js +79 -0
  168. package/lib/components/Card/next/CardTitleMedia.d.ts +24 -0
  169. package/lib/components/Card/next/CardTitleMedia.d.ts.map +1 -0
  170. package/lib/components/Card/next/CardTitleMedia.js +50 -0
  171. package/lib/components/Card/next/index.d.ts +2 -3
  172. package/lib/components/Card/next/index.d.ts.map +1 -1
  173. package/lib/components/Card/next/index.js +16 -4
  174. package/lib/components/Coachmark/next/Coachmark/Coachmark.d.ts +9 -3
  175. package/lib/components/Coachmark/next/Coachmark/Coachmark.d.ts.map +1 -1
  176. package/lib/components/Coachmark/next/Coachmark/Coachmark.js +6 -13
  177. package/lib/components/Coachmark/next/Coachmark/CoachmarkContent.d.ts +1 -1
  178. package/lib/components/Coachmark/next/Coachmark/CoachmarkContent.d.ts.map +1 -1
  179. package/lib/components/Coachmark/next/Coachmark/CoachmarkContent.js +16 -32
  180. package/lib/components/Coachmark/next/Coachmark/context.d.ts +2 -2
  181. package/lib/components/Coachmark/next/Coachmark/context.d.ts.map +1 -1
  182. package/lib/components/Coachmark/next/Coachmark/context.js +1 -2
  183. package/lib/components/ExportModal/ExportModal.d.ts +1 -0
  184. package/lib/components/ExportModal/ExportModal.d.ts.map +1 -1
  185. package/lib/components/ExportModal/ExportModal.js +6 -0
  186. package/lib/components/ImportModal/ImportModal.d.ts +3 -0
  187. package/lib/components/ImportModal/ImportModal.d.ts.map +1 -1
  188. package/lib/components/ImportModal/ImportModal.js +8 -0
  189. package/lib/components/PageHeader/PageHeader.d.ts +6 -0
  190. package/lib/components/PageHeader/PageHeader.d.ts.map +1 -1
  191. package/lib/components/PageHeader/PageHeader.js +11 -0
  192. package/lib/components/Tearsheet/next/StackContext.d.ts +2 -2
  193. package/lib/components/Tearsheet/next/StackContext.d.ts.map +1 -1
  194. package/lib/components/Tearsheet/next/Tearsheet.d.ts +30 -28
  195. package/lib/components/Tearsheet/next/Tearsheet.d.ts.map +1 -1
  196. package/lib/components/Tearsheet/next/Tearsheet.js +4 -2
  197. package/lib/components/Tearsheet/next/TearsheetBody.d.ts +20 -14
  198. package/lib/components/Tearsheet/next/TearsheetBody.d.ts.map +1 -1
  199. package/lib/components/Tearsheet/next/TearsheetBody.js +4 -0
  200. package/lib/components/Tearsheet/next/TearsheetHeader.d.ts +15 -14
  201. package/lib/components/Tearsheet/next/TearsheetHeader.d.ts.map +1 -1
  202. package/lib/components/Tearsheet/next/TearsheetHeader.js +14 -7
  203. package/lib/components/Tearsheet/next/TearsheetHeaderActions.d.ts +10 -6
  204. package/lib/components/Tearsheet/next/TearsheetHeaderActions.d.ts.map +1 -1
  205. package/lib/components/Tearsheet/next/TearsheetHeaderActions.js +4 -1
  206. package/lib/components/Tearsheet/next/TearsheetHeaderContent.d.ts.map +1 -1
  207. package/lib/components/Tearsheet/next/TearsheetHeaderContent.js +7 -4
  208. package/lib/components/Tearsheet/next/_story-assets/StepTearsheet.d.ts +7 -1
  209. package/lib/components/Tearsheet/next/_story-assets/StepTearsheet.d.ts.map +1 -1
  210. package/lib/components/Tearsheet/next/context.d.ts +2 -1
  211. package/lib/components/Tearsheet/next/context.d.ts.map +1 -1
  212. package/lib/components/index.d.ts +1 -1
  213. package/lib/components/index.d.ts.map +1 -1
  214. package/lib/node_modules/@carbon/icons-react/lib/{Icon-2zUDcllO.js → Icon.js} +8 -37
  215. package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-0.js +133 -131
  216. package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-1.js +140 -138
  217. package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-10.js +393 -403
  218. package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-11.js +417 -426
  219. package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-12.js +447 -441
  220. package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-13.js +449 -470
  221. package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-14.js +487 -456
  222. package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-15.js +550 -548
  223. package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-16.js +680 -733
  224. package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-17.js +810 -828
  225. package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-18.js +754 -670
  226. package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-19.js +622 -726
  227. package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-2.js +150 -148
  228. package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-20.js +752 -752
  229. package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-21.js +724 -55
  230. package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-3.js +176 -190
  231. package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-4.js +198 -180
  232. package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-5.js +217 -227
  233. package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-6.js +270 -335
  234. package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-7.js +405 -339
  235. package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-8.js +400 -577
  236. package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-9.js +578 -388
  237. package/lib/node_modules/@carbon/icons-react/lib/{iconPropTypes-DaTOKOBs.js → iconPropTypes-Dkz7B3UR.js} +6 -6
  238. package/lib/node_modules/@carbon/icons-react/lib/index.js +465 -423
  239. package/lib/node_modules/@carbon/icons-react/lib/rolldown-runtime-DyAcNxqs.js +51 -0
  240. package/package.json +18 -18
  241. package/scss/components/AboutModal/_about-modal.scss +12 -3
  242. package/scss/components/AddSelect/_add-select_next.scss +238 -99
  243. package/scss/components/BigNumber/_big-number.scss +4 -0
  244. package/scss/components/Card/_card-next.scss +394 -8
  245. package/scss/components/Tearsheet/_tearsheet_next.scss +38 -4
  246. package/telemetry.yml +24 -18
  247. package/es/components/AddSelect/next/AddSelectContent.d.ts +0 -26
  248. package/es/components/AddSelect/next/AddSelectContent.d.ts.map +0 -1
  249. package/es/components/AddSelect/next/AddSelectContent.js +0 -113
  250. package/lib/components/AddSelect/next/AddSelectContent.d.ts +0 -26
  251. package/lib/components/AddSelect/next/AddSelectContent.d.ts.map +0 -1
  252. package/lib/components/AddSelect/next/AddSelectContent.js +0 -115
@@ -12,6 +12,14 @@ import { CardContext } from "./CardContext.js";
12
12
  import { CardHeader } from "./CardHeader.js";
13
13
  import { CardBody } from "./CardBody.js";
14
14
  import { CardFooter } from "./CardFooter.js";
15
+ import { CardHeaderMedia } from "./CardHeaderMedia.js";
16
+ import { CardMedia } from "./CardMedia.js";
17
+ import { CardLabel } from "./CardLabel.js";
18
+ import { CardTitle } from "./CardTitle.js";
19
+ import { CardTitleMedia } from "./CardTitleMedia.js";
20
+ import { CardCaption } from "./CardCaption.js";
21
+ import { CardActions } from "./CardActions.js";
22
+ import { CardAction } from "./CardAction.js";
15
23
  import React, { forwardRef, useMemo } from "react";
16
24
  import PropTypes from "prop-types";
17
25
  //#region src/components/Card/next/Card.tsx
@@ -27,11 +35,21 @@ const blockClass = `${pkg.prefix}--card-next`;
27
35
  /**
28
36
  * Card component - Root container for composable card
29
37
  */
30
- const CardComponent = forwardRef(({ clickable = false, onClick, onKeyDown, disabled = false, className, children, ...rest }, ref) => {
38
+ const CardComponent = forwardRef(({ clickable = false, onClick, onKeyDown, disabled = false, density = "productive", decorator, className, children, ...rest }, ref) => {
39
+ const hasAILabel = decorator?.["type"]?.displayName === "AILabel";
40
+ const normalizedDecorator = useMemo(() => {
41
+ if (hasAILabel && React.isValidElement(decorator)) return React.cloneElement(decorator, { size: "xs" });
42
+ return decorator;
43
+ }, [decorator, hasAILabel]);
31
44
  const contextValue = useMemo(() => ({
32
45
  clickable,
33
- disabled
34
- }), [clickable, disabled]);
46
+ disabled,
47
+ decorator: normalizedDecorator
48
+ }), [
49
+ clickable,
50
+ disabled,
51
+ normalizedDecorator
52
+ ]);
35
53
  const handleKeyDown = (event) => {
36
54
  if (clickable && !disabled && (event.key === "Enter" || event.key === " ")) {
37
55
  event.preventDefault();
@@ -44,7 +62,9 @@ const CardComponent = forwardRef(({ clickable = false, onClick, onKeyDown, disab
44
62
  };
45
63
  const cardClasses = (0, import_classnames.default)(blockClass, className, {
46
64
  [`${blockClass}--clickable`]: clickable && !disabled,
47
- [`${blockClass}--disabled`]: disabled
65
+ [`${blockClass}--disabled`]: disabled,
66
+ [`${blockClass}--${density}`]: density,
67
+ [`${blockClass}--has-ai-label`]: hasAILabel
48
68
  });
49
69
  const cardProps = {
50
70
  ...rest,
@@ -75,6 +95,14 @@ CardComponent.propTypes = {
75
95
  */
76
96
  clickable: PropTypes.bool,
77
97
  /**
98
+ * Optional decorator component (typically AILabel from Carbon)
99
+ */
100
+ decorator: PropTypes.node,
101
+ /**
102
+ * Density variant: productive uses heading-compact-02, expressive uses heading-03
103
+ */
104
+ density: PropTypes.oneOf(["productive", "expressive"]),
105
+ /**
78
106
  * Disables the card and all interactive elements
79
107
  */
80
108
  disabled: PropTypes.bool,
@@ -87,19 +115,45 @@ CardComponent.propTypes = {
87
115
  */
88
116
  onKeyDown: PropTypes.func
89
117
  };
90
- const Card = CardComponent;
91
118
  /**
92
119
  * -------
93
120
  * Exports
94
121
  * -------
95
122
  */
96
- const Root = Card;
97
- Root.displayName = "Card.Root";
98
123
  const Header = CardHeader;
99
124
  Header.displayName = "Card.Header";
100
125
  const Body = CardBody;
101
126
  Body.displayName = "Card.Body";
102
127
  const Footer = CardFooter;
103
128
  Footer.displayName = "Card.Footer";
129
+ const HeaderMedia = CardHeaderMedia;
130
+ HeaderMedia.displayName = "Card.HeaderMedia";
131
+ const Media = CardMedia;
132
+ Media.displayName = "Card.Media";
133
+ const Label = CardLabel;
134
+ Label.displayName = "Card.Label";
135
+ const Title = CardTitle;
136
+ Title.displayName = "Card.Title";
137
+ const TitleMedia = CardTitleMedia;
138
+ TitleMedia.displayName = "Card.TitleMedia";
139
+ const Caption = CardCaption;
140
+ Caption.displayName = "Card.Caption";
141
+ const Actions = CardActions;
142
+ Actions.displayName = "Card.Actions";
143
+ const Action = CardAction;
144
+ Action.displayName = "Card.Action";
145
+ const Card = Object.assign(CardComponent, {
146
+ Header,
147
+ Body,
148
+ Footer,
149
+ HeaderMedia,
150
+ Media,
151
+ Label,
152
+ Title,
153
+ TitleMedia,
154
+ Caption,
155
+ Actions,
156
+ Action
157
+ });
104
158
  //#endregion
105
- export { Body, Card, Footer, Header, Root };
159
+ export { Card };
@@ -38,6 +38,15 @@ export interface CardProps extends CardBaseProps {
38
38
  * Disables the card and all interactive elements
39
39
  */
40
40
  disabled?: boolean;
41
+ /**
42
+ * Density variant: productive uses heading-compact-02, expressive uses heading-03
43
+ */
44
+ density?: 'productive' | 'expressive';
45
+ /**
46
+ * Optional decorator component (typically AILabel from Carbon).
47
+ * Renders in the top-right corner of the card header with a blue gradient border.
48
+ */
49
+ decorator?: ReactNode;
41
50
  }
42
51
  /**
43
52
  * Props for CardHeader component
@@ -63,5 +72,9 @@ export interface CardContextValue {
63
72
  * Whether the card is disabled
64
73
  */
65
74
  disabled: boolean;
75
+ /**
76
+ * Optional decorator component (typically AILabel) to be rendered by CardHeader
77
+ */
78
+ decorator?: ReactNode;
66
79
  }
67
80
  //# sourceMappingURL=Card.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Card.types.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/next/Card.types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,aAAa;IAC9C;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IAC5D;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IACjE;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,aAAa,CAAC;AAE5C;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,aAAa,CAAC;AAE1C;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,aAAa,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;CACnB"}
1
+ {"version":3,"file":"Card.types.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/next/Card.types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,aAAa;IAC9C;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IAC5D;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IACjE;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,GAAG,YAAY,CAAC;IACtC;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,aAAa,CAAC;AAE5C;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,aAAa,CAAC;AAE1C;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,aAAa,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Copyright IBM Corp. 2026
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, { ReactNode } from 'react';
8
+ import PropTypes from 'prop-types';
9
+ export interface CardActionProps {
10
+ /**
11
+ * Provide the contents of the CardAction (typically a Button or IconButton).
12
+ * Wrapping content in CardAction opts into action-set layout: no footer
13
+ * padding, automatic top border, and stretch/fixed-width button behavior.
14
+ */
15
+ children?: ReactNode;
16
+ /**
17
+ * Provide an optional class to be applied to the containing node.
18
+ */
19
+ className?: string;
20
+ }
21
+ /**
22
+ * CardAction is a wrapper for interactive elements in the card footer.
23
+ * Its presence signals action-set layout to the footer (no padding, auto
24
+ * border, stretch behavior).
25
+ *
26
+ * Note: do not use CardAction inside a clickable card — clickable cards
27
+ * should not contain interactive elements (see usage guidelines).
28
+ */
29
+ export declare const CardAction: {
30
+ ({ children, className, ...rest }: CardActionProps): React.JSX.Element;
31
+ propTypes: {
32
+ /**
33
+ * Provide the contents of the CardAction.
34
+ */
35
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
36
+ /**
37
+ * Provide an optional class to be applied to the containing node.
38
+ */
39
+ className: PropTypes.Requireable<string>;
40
+ };
41
+ displayName: string;
42
+ };
43
+ //# sourceMappingURL=CardAction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CardAction.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/next/CardAction.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,SAAS,MAAM,YAAY,CAAC;AAQnC,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU;uCAIpB,eAAe;;QAahB;;WAEG;;QAGH;;WAEG;;;;CAVJ,CAAC"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Copyright IBM Corp. 2020, 2026
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
+
8
+ import { __toESM } from "../../../_virtual/_rolldown/runtime.js";
9
+ import { require_classnames } from "../../../node_modules/classnames/index.js";
10
+ import { pkg } from "../../../settings.js";
11
+ import { getDevtoolsProps } from "../../../global/js/utils/devtools.js";
12
+ import React from "react";
13
+ import PropTypes from "prop-types";
14
+ //#region src/components/Card/next/CardAction.tsx
15
+ /**
16
+ * Copyright IBM Corp. 2026
17
+ *
18
+ * This source code is licensed under the Apache-2.0 license found in the
19
+ * LICENSE file in the root directory of this source tree.
20
+ */
21
+ var import_classnames = /* @__PURE__ */ __toESM(require_classnames());
22
+ const blockClass = `${pkg.prefix}--card-next`;
23
+ const componentName = "CardAction";
24
+ /**
25
+ * CardAction is a wrapper for interactive elements in the card footer.
26
+ * Its presence signals action-set layout to the footer (no padding, auto
27
+ * border, stretch behavior).
28
+ *
29
+ * Note: do not use CardAction inside a clickable card — clickable cards
30
+ * should not contain interactive elements (see usage guidelines).
31
+ */
32
+ const CardAction = ({ children, className, ...rest }) => {
33
+ return /* @__PURE__ */ React.createElement("div", {
34
+ ...rest,
35
+ className: (0, import_classnames.default)(`${blockClass}__action`, className),
36
+ ...getDevtoolsProps(componentName)
37
+ }, children);
38
+ };
39
+ CardAction.propTypes = {
40
+ /**
41
+ * Provide the contents of the CardAction.
42
+ */
43
+ children: PropTypes.node,
44
+ /**
45
+ * Provide an optional class to be applied to the containing node.
46
+ */
47
+ className: PropTypes.string
48
+ };
49
+ CardAction.displayName = componentName;
50
+ //#endregion
51
+ export { CardAction };
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Copyright IBM Corp. 2026
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, { ReactNode } from 'react';
8
+ import PropTypes from 'prop-types';
9
+ export interface CardActionsProps {
10
+ /**
11
+ * Provide the contents of the CardActions (typically CardAction components).
12
+ */
13
+ children?: ReactNode;
14
+ /**
15
+ * Provide an optional class to be applied to the containing node.
16
+ */
17
+ className?: string;
18
+ /**
19
+ * Aria label for the overflow menu
20
+ */
21
+ overflowMenuLabel?: string;
22
+ }
23
+ /**
24
+ * CardActions is a container for action buttons in the card header.
25
+ * Positioned in the top-right corner with 8px gap between actions.
26
+ * When actions exceed 50% of available header space, overflow menu is shown.
27
+ */
28
+ export declare const CardActions: {
29
+ ({ children, className, overflowMenuLabel, ...rest }: CardActionsProps): React.JSX.Element;
30
+ propTypes: {
31
+ /**
32
+ * Provide the contents of the CardActions.
33
+ */
34
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
35
+ /**
36
+ * Provide an optional class to be applied to the containing node.
37
+ */
38
+ className: PropTypes.Requireable<string>;
39
+ /**
40
+ * Aria label for the overflow menu
41
+ */
42
+ overflowMenuLabel: PropTypes.Requireable<string>;
43
+ };
44
+ displayName: string;
45
+ };
46
+ //# sourceMappingURL=CardActions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CardActions.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/next/CardActions.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,EAAE,SAAS,EAAyC,MAAM,OAAO,CAAC;AAChF,OAAO,SAAS,MAAM,YAAY,CAAC;AAUnC,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAQD;;;;GAIG;AACH,eAAO,MAAM,WAAW;0DAKrB,gBAAgB;;QA2FjB;;WAEG;;QAGH;;WAEG;;QAGH;;WAEG;;;;CAfJ,CAAC"}
@@ -0,0 +1,107 @@
1
+ /**
2
+ * Copyright IBM Corp. 2020, 2026
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
+
8
+ import { __toESM } from "../../../_virtual/_rolldown/runtime.js";
9
+ import { require_classnames } from "../../../node_modules/classnames/index.js";
10
+ import { pkg } from "../../../settings.js";
11
+ import { getDevtoolsProps } from "../../../global/js/utils/devtools.js";
12
+ import React, { Children, useEffect, useRef, useState } from "react";
13
+ import PropTypes from "prop-types";
14
+ import { FeatureFlags, OverflowMenu, OverflowMenuItem } from "@carbon/react";
15
+ import { createOverflowHandler } from "@carbon/utilities";
16
+ //#region src/components/Card/next/CardActions.tsx
17
+ /**
18
+ * Copyright IBM Corp. 2026
19
+ *
20
+ * This source code is licensed under the Apache-2.0 license found in the
21
+ * LICENSE file in the root directory of this source tree.
22
+ */
23
+ var import_classnames = /* @__PURE__ */ __toESM(require_classnames());
24
+ const blockClass = `${pkg.prefix}--card-next`;
25
+ const componentName = "CardActions";
26
+ /**
27
+ * CardActions is a container for action buttons in the card header.
28
+ * Positioned in the top-right corner with 8px gap between actions.
29
+ * When actions exceed 50% of available header space, overflow menu is shown.
30
+ */
31
+ const CardActions = ({ children, className, overflowMenuLabel = "More actions", ...rest }) => {
32
+ const containerRef = useRef(null);
33
+ const [hiddenItems, setHiddenItems] = useState([]);
34
+ const classes = (0, import_classnames.default)(`${blockClass}__actions`, className);
35
+ const actionItems = [];
36
+ Children.forEach(children, (child, index) => {
37
+ if (React.isValidElement(child)) {
38
+ const id = `action-${index}`;
39
+ let label = overflowMenuLabel;
40
+ const childProps = child.props;
41
+ if (childProps.children && React.isValidElement(childProps.children)) {
42
+ const iconButton = childProps.children;
43
+ label = iconButton.props?.label || iconButton.props?.iconDescription || `Action ${index + 1}`;
44
+ }
45
+ actionItems.push({
46
+ id,
47
+ element: child,
48
+ label
49
+ });
50
+ }
51
+ });
52
+ useEffect(() => {
53
+ if (!containerRef.current || actionItems.length === 0) return;
54
+ const handler = createOverflowHandler({
55
+ container: containerRef.current,
56
+ onChange: (_visible, hidden) => {
57
+ const hiddenIds = hidden.map((el) => el.dataset.id);
58
+ setHiddenItems(actionItems.filter((item) => hiddenIds.includes(item.id)));
59
+ }
60
+ });
61
+ return () => handler.disconnect();
62
+ }, [children]);
63
+ return /* @__PURE__ */ React.createElement("div", {
64
+ ref: containerRef,
65
+ className: classes,
66
+ ...rest,
67
+ ...getDevtoolsProps(componentName)
68
+ }, actionItems.map((item) => /* @__PURE__ */ React.createElement("div", {
69
+ key: item.id,
70
+ "data-id": item.id
71
+ }, item.element)), /* @__PURE__ */ React.createElement("div", {
72
+ "data-offset": true,
73
+ "data-hidden": true,
74
+ "data-floating-menu-container": true,
75
+ style: { position: "relative" }
76
+ }, /* @__PURE__ */ React.createElement(FeatureFlags, { enableV12Overflowmenu: true }, /* @__PURE__ */ React.createElement(OverflowMenu, {
77
+ size: "sm",
78
+ "aria-label": overflowMenuLabel
79
+ }, hiddenItems.map((item) => /* @__PURE__ */ React.createElement(OverflowMenuItem, {
80
+ key: item.id,
81
+ itemText: item.label || "Action",
82
+ onClick: () => {
83
+ const button = item.element.props.children;
84
+ if (button && React.isValidElement(button)) {
85
+ const buttonProps = button.props;
86
+ if (buttonProps.onClick) buttonProps.onClick();
87
+ }
88
+ }
89
+ }))))));
90
+ };
91
+ CardActions.propTypes = {
92
+ /**
93
+ * Provide the contents of the CardActions.
94
+ */
95
+ children: PropTypes.node,
96
+ /**
97
+ * Provide an optional class to be applied to the containing node.
98
+ */
99
+ className: PropTypes.string,
100
+ /**
101
+ * Aria label for the overflow menu
102
+ */
103
+ overflowMenuLabel: PropTypes.string
104
+ };
105
+ CardActions.displayName = componentName;
106
+ //#endregion
107
+ export { CardActions };
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Copyright IBM Corp. 2026
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, { ReactNode } from 'react';
8
+ import PropTypes from 'prop-types';
9
+ export interface CardCaptionProps {
10
+ /**
11
+ * Provide the contents of the CardCaption.
12
+ */
13
+ children?: ReactNode;
14
+ /**
15
+ * Provide an optional class to be applied to the containing node.
16
+ */
17
+ className?: string;
18
+ /**
19
+ * Enable text truncation with ellipsis.
20
+ * @default false
21
+ */
22
+ truncate?: boolean;
23
+ }
24
+ /**
25
+ * CardCaption displays secondary text below the title in the card header.
26
+ * Uses $label-01 typography token and $text-secondary color.
27
+ */
28
+ export declare const CardCaption: {
29
+ ({ children, className, truncate, ...rest }: CardCaptionProps): React.JSX.Element;
30
+ propTypes: {
31
+ /**
32
+ * Provide the contents of the CardCaption.
33
+ */
34
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
35
+ /**
36
+ * Provide an optional class to be applied to the containing node.
37
+ */
38
+ className: PropTypes.Requireable<string>;
39
+ /**
40
+ * Enable text truncation with ellipsis.
41
+ */
42
+ truncate: PropTypes.Requireable<boolean>;
43
+ };
44
+ displayName: string;
45
+ };
46
+ //# sourceMappingURL=CardCaption.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CardCaption.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/next/CardCaption.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,SAAS,MAAM,YAAY,CAAC;AAQnC,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW;iDAKrB,gBAAgB;;QAiBjB;;WAEG;;QAGH;;WAEG;;QAGH;;WAEG;;;;CAfJ,CAAC"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Copyright IBM Corp. 2020, 2026
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
+
8
+ import { __toESM } from "../../../_virtual/_rolldown/runtime.js";
9
+ import { require_classnames } from "../../../node_modules/classnames/index.js";
10
+ import { pkg } from "../../../settings.js";
11
+ import { getDevtoolsProps } from "../../../global/js/utils/devtools.js";
12
+ import React from "react";
13
+ import PropTypes from "prop-types";
14
+ //#region src/components/Card/next/CardCaption.tsx
15
+ /**
16
+ * Copyright IBM Corp. 2026
17
+ *
18
+ * This source code is licensed under the Apache-2.0 license found in the
19
+ * LICENSE file in the root directory of this source tree.
20
+ */
21
+ var import_classnames = /* @__PURE__ */ __toESM(require_classnames());
22
+ const blockClass = `${pkg.prefix}--card-next`;
23
+ const componentName = "CardCaption";
24
+ /**
25
+ * CardCaption displays secondary text below the title in the card header.
26
+ * Uses $label-01 typography token and $text-secondary color.
27
+ */
28
+ const CardCaption = ({ children, className, truncate = false, ...rest }) => {
29
+ const classes = (0, import_classnames.default)(`${blockClass}__caption`, { [`${blockClass}__caption--truncate`]: truncate }, className);
30
+ return /* @__PURE__ */ React.createElement("div", {
31
+ ...rest,
32
+ className: classes,
33
+ ...getDevtoolsProps(componentName)
34
+ }, children);
35
+ };
36
+ CardCaption.propTypes = {
37
+ /**
38
+ * Provide the contents of the CardCaption.
39
+ */
40
+ children: PropTypes.node,
41
+ /**
42
+ * Provide an optional class to be applied to the containing node.
43
+ */
44
+ className: PropTypes.string,
45
+ /**
46
+ * Enable text truncation with ellipsis.
47
+ */
48
+ truncate: PropTypes.bool
49
+ };
50
+ CardCaption.displayName = componentName;
51
+ //#endregion
52
+ export { CardCaption };
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import { createContext } from "react";
8
+ import { createContext, useContext } from "react";
9
9
  //#region src/components/Card/next/CardContext.tsx
10
10
  /**
11
11
  * Copyright IBM Corp. 2026
@@ -17,5 +17,15 @@ import { createContext } from "react";
17
17
  * Context for sharing Card state with child components
18
18
  */
19
19
  const CardContext = createContext(void 0);
20
+ /**
21
+ * Hook to access Card context
22
+ * @returns CardContextValue
23
+ * @throws Error if used outside of Card component
24
+ */
25
+ const useCardContext = () => {
26
+ const context = useContext(CardContext);
27
+ if (!context) throw new Error("Card subcomponents must be used within a Card component");
28
+ return context;
29
+ };
20
30
  //#endregion
21
- export { CardContext };
31
+ export { CardContext, useCardContext };
@@ -1 +1 @@
1
- {"version":3,"file":"CardFooter.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/next/CardFooter.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAqB,MAAM,OAAO,CAAC;AAU1C;;GAEG;AACH,eAAO,MAAM,UAAU,6GAUtB,CAAC"}
1
+ {"version":3,"file":"CardFooter.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/next/CardFooter.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAqB,MAAM,OAAO,CAAC;AAS1C;;GAEG;AACH,eAAO,MAAM,UAAU,6GAUtB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CardHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/next/CardHeader.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAqB,MAAM,OAAO,CAAC;AAU1C;;GAEG;AACH,eAAO,MAAM,UAAU,6GAUtB,CAAC"}
1
+ {"version":3,"file":"CardHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/next/CardHeader.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAA0D,MAAM,OAAO,CAAC;AAU/E;;GAEG;AACH,eAAO,MAAM,UAAU,6GA4EtB,CAAC"}
@@ -8,7 +8,8 @@
8
8
  import { __toESM } from "../../../_virtual/_rolldown/runtime.js";
9
9
  import { require_classnames } from "../../../node_modules/classnames/index.js";
10
10
  import { pkg } from "../../../settings.js";
11
- import React, { forwardRef } from "react";
11
+ import { useCardContext } from "./CardContext.js";
12
+ import React, { Children, forwardRef, isValidElement } from "react";
12
13
  import PropTypes from "prop-types";
13
14
  //#region src/components/Card/next/CardHeader.tsx
14
15
  /**
@@ -24,12 +25,34 @@ const blockClass = `${pkg.prefix}--card-next__header`;
24
25
  * CardHeader component - Header section of the card
25
26
  */
26
27
  const CardHeader = forwardRef(({ className, children, ...rest }, ref) => {
28
+ const context = useCardContext();
29
+ const cardBlockClass = `${pkg.prefix}--card-next`;
30
+ const hasTitleMedia = Children.toArray(children).some((child) => {
31
+ return isValidElement(child) && child.type?.["displayName"] === "Card.TitleMedia";
32
+ });
33
+ const titleMediaElements = [];
34
+ const mediaElements = [];
35
+ const otherContent = [];
36
+ if (hasTitleMedia) Children.forEach(children, (child) => {
37
+ if (isValidElement(child) && child.type?.["displayName"] === "Card.TitleMedia") titleMediaElements.push(child);
38
+ else if (isValidElement(child) && child.type?.["displayName"] === "Card.Media") mediaElements.push(child);
39
+ else otherContent.push(child);
40
+ });
27
41
  const headerClasses = (0, import_classnames.default)(blockClass, className);
28
42
  return /* @__PURE__ */ React.createElement("div", {
29
43
  ...rest,
30
44
  ref,
31
45
  className: headerClasses
32
- }, children);
46
+ }, hasTitleMedia ? /* @__PURE__ */ React.createElement(React.Fragment, null, mediaElements, /* @__PURE__ */ React.createElement("div", { className: `${cardBlockClass}__header-content` }, titleMediaElements, /* @__PURE__ */ React.createElement("div", { className: `${cardBlockClass}__title-content` }, otherContent))) : children, context.decorator && /* @__PURE__ */ React.createElement("div", {
47
+ className: `${cardBlockClass}__decorator`,
48
+ role: "presentation",
49
+ onClick: (e) => {
50
+ e.stopPropagation();
51
+ },
52
+ onKeyDown: (e) => {
53
+ e.stopPropagation();
54
+ }
55
+ }, context.decorator));
33
56
  });
34
57
  CardHeader.displayName = componentName;
35
58
  CardHeader.propTypes = {
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Copyright IBM Corp. 2026
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, { ReactNode } from 'react';
8
+ import PropTypes from 'prop-types';
9
+ export interface CardHeaderMediaProps {
10
+ /**
11
+ * Provide the contents of the CardHeaderMedia.
12
+ */
13
+ children?: ReactNode;
14
+ /**
15
+ * Provide an optional class to be applied to the containing node.
16
+ */
17
+ className?: string;
18
+ }
19
+ export declare const CardHeaderMedia: {
20
+ ({ children, className, ...rest }: CardHeaderMediaProps): React.JSX.Element;
21
+ propTypes: {
22
+ /**
23
+ * Provide the contents of the CardHeaderMedia.
24
+ */
25
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
26
+ /**
27
+ * Provide an optional class to be applied to the containing node.
28
+ */
29
+ className: PropTypes.Requireable<string>;
30
+ };
31
+ displayName: string;
32
+ };
33
+ //# sourceMappingURL=CardHeaderMedia.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CardHeaderMedia.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/next/CardHeaderMedia.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,SAAS,MAAM,YAAY,CAAC;AAQnC,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,eAAe;uCAIzB,oBAAoB;;QAWrB;;WAEG;;QAGH;;WAEG;;;;CAVJ,CAAC"}