@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.
- package/css/carbon.css +92 -103
- package/css/carbon.css.map +1 -1
- package/css/index-full-carbon.css +605 -186
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +1 -1
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +43 -7
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +1 -1
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +513 -83
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +1 -1
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +308 -178
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -1
- package/css/index.min.css.map +1 -1
- package/es/components/APIKeyModal/APIKeyModal.d.ts +3 -0
- package/es/components/APIKeyModal/APIKeyModal.d.ts.map +1 -1
- package/es/components/APIKeyModal/APIKeyModal.js +8 -0
- package/es/components/AddSelect/next/AddSelect.d.ts +7 -9
- package/es/components/AddSelect/next/AddSelect.d.ts.map +1 -1
- package/es/components/AddSelect/next/AddSelect.js +0 -2
- package/es/components/AddSelect/next/AddSelectBody.d.ts +4 -0
- package/es/components/AddSelect/next/AddSelectBody.d.ts.map +1 -1
- package/es/components/AddSelect/next/AddSelectBody.js +80 -4
- package/es/components/AddSelect/next/AddSelectColumn.d.ts +1 -1
- package/es/components/AddSelect/next/AddSelectRow.d.ts +6 -0
- package/es/components/AddSelect/next/AddSelectRow.d.ts.map +1 -1
- package/es/components/AddSelect/next/AddSelectRow.js +10 -3
- package/es/components/AddSelect/next/AddSelectSelectionSummaryItem.d.ts.map +1 -1
- package/es/components/AddSelect/next/AddSelectSelectionSummaryItem.js +5 -3
- package/es/components/AddSelect/next/index.d.ts +0 -1
- package/es/components/AddSelect/next/index.d.ts.map +1 -1
- package/es/components/BigNumber/BigNumber.d.ts +1 -1
- package/es/components/BigNumber/BigNumber.d.ts.map +1 -1
- package/es/components/BigNumber/BigNumber.js +2 -2
- package/es/components/Card/next/Card.d.ts +87 -11
- package/es/components/Card/next/Card.d.ts.map +1 -1
- package/es/components/Card/next/Card.js +62 -8
- package/es/components/Card/next/Card.types.d.ts +13 -0
- package/es/components/Card/next/Card.types.d.ts.map +1 -1
- package/es/components/Card/next/CardAction.d.ts +43 -0
- package/es/components/Card/next/CardAction.d.ts.map +1 -0
- package/es/components/Card/next/CardAction.js +51 -0
- package/es/components/Card/next/CardActions.d.ts +46 -0
- package/es/components/Card/next/CardActions.d.ts.map +1 -0
- package/es/components/Card/next/CardActions.js +107 -0
- package/es/components/Card/next/CardCaption.d.ts +46 -0
- package/es/components/Card/next/CardCaption.d.ts.map +1 -0
- package/es/components/Card/next/CardCaption.js +52 -0
- package/es/components/Card/next/CardContext.js +12 -2
- package/es/components/Card/next/CardFooter.d.ts.map +1 -1
- package/es/components/Card/next/CardHeader.d.ts.map +1 -1
- package/es/components/Card/next/CardHeader.js +25 -2
- package/es/components/Card/next/CardHeaderMedia.d.ts +33 -0
- package/es/components/Card/next/CardHeaderMedia.d.ts.map +1 -0
- package/es/components/Card/next/CardHeaderMedia.js +44 -0
- package/es/components/Card/next/CardLabel.d.ts +46 -0
- package/es/components/Card/next/CardLabel.d.ts.map +1 -0
- package/es/components/Card/next/CardLabel.js +52 -0
- package/es/components/Card/next/CardMedia.d.ts +39 -0
- package/es/components/Card/next/CardMedia.d.ts.map +1 -0
- package/es/components/Card/next/CardMedia.js +50 -0
- package/es/components/Card/next/CardTitle.d.ts +82 -0
- package/es/components/Card/next/CardTitle.d.ts.map +1 -0
- package/es/components/Card/next/CardTitle.js +77 -0
- package/es/components/Card/next/CardTitleMedia.d.ts +24 -0
- package/es/components/Card/next/CardTitleMedia.d.ts.map +1 -0
- package/es/components/Card/next/CardTitleMedia.js +48 -0
- package/es/components/Card/next/index.d.ts +2 -3
- package/es/components/Card/next/index.d.ts.map +1 -1
- package/es/components/Card/next/index.js +17 -5
- package/es/components/Coachmark/next/Coachmark/Coachmark.d.ts +9 -3
- package/es/components/Coachmark/next/Coachmark/Coachmark.d.ts.map +1 -1
- package/es/components/Coachmark/next/Coachmark/Coachmark.js +6 -13
- package/es/components/Coachmark/next/Coachmark/CoachmarkContent.d.ts +1 -1
- package/es/components/Coachmark/next/Coachmark/CoachmarkContent.d.ts.map +1 -1
- package/es/components/Coachmark/next/Coachmark/CoachmarkContent.js +16 -32
- package/es/components/Coachmark/next/Coachmark/context.d.ts +2 -2
- package/es/components/Coachmark/next/Coachmark/context.d.ts.map +1 -1
- package/es/components/Coachmark/next/Coachmark/context.js +1 -2
- package/es/components/ExportModal/ExportModal.d.ts +1 -0
- package/es/components/ExportModal/ExportModal.d.ts.map +1 -1
- package/es/components/ExportModal/ExportModal.js +6 -0
- package/es/components/ImportModal/ImportModal.d.ts +3 -0
- package/es/components/ImportModal/ImportModal.d.ts.map +1 -1
- package/es/components/ImportModal/ImportModal.js +8 -0
- package/es/components/PageHeader/PageHeader.d.ts +6 -0
- package/es/components/PageHeader/PageHeader.d.ts.map +1 -1
- package/es/components/PageHeader/PageHeader.js +11 -0
- package/es/components/Tearsheet/next/StackContext.d.ts +2 -2
- package/es/components/Tearsheet/next/StackContext.d.ts.map +1 -1
- package/es/components/Tearsheet/next/Tearsheet.d.ts +30 -28
- package/es/components/Tearsheet/next/Tearsheet.d.ts.map +1 -1
- package/es/components/Tearsheet/next/Tearsheet.js +4 -2
- package/es/components/Tearsheet/next/TearsheetBody.d.ts +20 -14
- package/es/components/Tearsheet/next/TearsheetBody.d.ts.map +1 -1
- package/es/components/Tearsheet/next/TearsheetBody.js +4 -0
- package/es/components/Tearsheet/next/TearsheetHeader.d.ts +15 -14
- package/es/components/Tearsheet/next/TearsheetHeader.d.ts.map +1 -1
- package/es/components/Tearsheet/next/TearsheetHeader.js +14 -7
- package/es/components/Tearsheet/next/TearsheetHeaderActions.d.ts +10 -6
- package/es/components/Tearsheet/next/TearsheetHeaderActions.d.ts.map +1 -1
- package/es/components/Tearsheet/next/TearsheetHeaderActions.js +6 -3
- package/es/components/Tearsheet/next/TearsheetHeaderContent.d.ts.map +1 -1
- package/es/components/Tearsheet/next/TearsheetHeaderContent.js +7 -4
- package/es/components/Tearsheet/next/_story-assets/StepTearsheet.d.ts +7 -1
- package/es/components/Tearsheet/next/_story-assets/StepTearsheet.d.ts.map +1 -1
- package/es/components/Tearsheet/next/context.d.ts +2 -1
- package/es/components/Tearsheet/next/context.d.ts.map +1 -1
- package/es/components/index.d.ts +1 -1
- package/es/components/index.d.ts.map +1 -1
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-11.js +283 -294
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-3.js +25 -41
- package/es/node_modules/@carbon/icons-react/es/{iconPropTypes-BElKp6Sn.js → iconPropTypes-CdMBxq3Y.js} +1 -1
- package/lib/components/APIKeyModal/APIKeyModal.d.ts +3 -0
- package/lib/components/APIKeyModal/APIKeyModal.d.ts.map +1 -1
- package/lib/components/APIKeyModal/APIKeyModal.js +8 -0
- package/lib/components/AddSelect/next/AddSelect.d.ts +7 -9
- package/lib/components/AddSelect/next/AddSelect.d.ts.map +1 -1
- package/lib/components/AddSelect/next/AddSelect.js +0 -2
- package/lib/components/AddSelect/next/AddSelectBody.d.ts +4 -0
- package/lib/components/AddSelect/next/AddSelectBody.d.ts.map +1 -1
- package/lib/components/AddSelect/next/AddSelectBody.js +78 -2
- package/lib/components/AddSelect/next/AddSelectColumn.d.ts +1 -1
- package/lib/components/AddSelect/next/AddSelectRow.d.ts +6 -0
- package/lib/components/AddSelect/next/AddSelectRow.d.ts.map +1 -1
- package/lib/components/AddSelect/next/AddSelectRow.js +9 -2
- package/lib/components/AddSelect/next/AddSelectSelectionSummaryItem.d.ts.map +1 -1
- package/lib/components/AddSelect/next/AddSelectSelectionSummaryItem.js +5 -3
- package/lib/components/AddSelect/next/index.d.ts +0 -1
- package/lib/components/AddSelect/next/index.d.ts.map +1 -1
- package/lib/components/BigNumber/BigNumber.d.ts +1 -1
- package/lib/components/BigNumber/BigNumber.d.ts.map +1 -1
- package/lib/components/BigNumber/BigNumber.js +2 -2
- package/lib/components/Card/next/Card.d.ts +87 -11
- package/lib/components/Card/next/Card.d.ts.map +1 -1
- package/lib/components/Card/next/Card.js +61 -11
- package/lib/components/Card/next/Card.types.d.ts +13 -0
- package/lib/components/Card/next/Card.types.d.ts.map +1 -1
- package/lib/components/Card/next/CardAction.d.ts +43 -0
- package/lib/components/Card/next/CardAction.d.ts.map +1 -0
- package/lib/components/Card/next/CardAction.js +53 -0
- package/lib/components/Card/next/CardActions.d.ts +46 -0
- package/lib/components/Card/next/CardActions.d.ts.map +1 -0
- package/lib/components/Card/next/CardActions.js +109 -0
- package/lib/components/Card/next/CardCaption.d.ts +46 -0
- package/lib/components/Card/next/CardCaption.d.ts.map +1 -0
- package/lib/components/Card/next/CardCaption.js +54 -0
- package/lib/components/Card/next/CardContext.js +13 -1
- package/lib/components/Card/next/CardFooter.d.ts.map +1 -1
- package/lib/components/Card/next/CardHeader.d.ts.map +1 -1
- package/lib/components/Card/next/CardHeader.js +24 -1
- package/lib/components/Card/next/CardHeaderMedia.d.ts +33 -0
- package/lib/components/Card/next/CardHeaderMedia.d.ts.map +1 -0
- package/lib/components/Card/next/CardHeaderMedia.js +46 -0
- package/lib/components/Card/next/CardLabel.d.ts +46 -0
- package/lib/components/Card/next/CardLabel.d.ts.map +1 -0
- package/lib/components/Card/next/CardLabel.js +54 -0
- package/lib/components/Card/next/CardMedia.d.ts +39 -0
- package/lib/components/Card/next/CardMedia.d.ts.map +1 -0
- package/lib/components/Card/next/CardMedia.js +52 -0
- package/lib/components/Card/next/CardTitle.d.ts +82 -0
- package/lib/components/Card/next/CardTitle.d.ts.map +1 -0
- package/lib/components/Card/next/CardTitle.js +79 -0
- package/lib/components/Card/next/CardTitleMedia.d.ts +24 -0
- package/lib/components/Card/next/CardTitleMedia.d.ts.map +1 -0
- package/lib/components/Card/next/CardTitleMedia.js +50 -0
- package/lib/components/Card/next/index.d.ts +2 -3
- package/lib/components/Card/next/index.d.ts.map +1 -1
- package/lib/components/Card/next/index.js +16 -4
- package/lib/components/Coachmark/next/Coachmark/Coachmark.d.ts +9 -3
- package/lib/components/Coachmark/next/Coachmark/Coachmark.d.ts.map +1 -1
- package/lib/components/Coachmark/next/Coachmark/Coachmark.js +6 -13
- package/lib/components/Coachmark/next/Coachmark/CoachmarkContent.d.ts +1 -1
- package/lib/components/Coachmark/next/Coachmark/CoachmarkContent.d.ts.map +1 -1
- package/lib/components/Coachmark/next/Coachmark/CoachmarkContent.js +16 -32
- package/lib/components/Coachmark/next/Coachmark/context.d.ts +2 -2
- package/lib/components/Coachmark/next/Coachmark/context.d.ts.map +1 -1
- package/lib/components/Coachmark/next/Coachmark/context.js +1 -2
- package/lib/components/ExportModal/ExportModal.d.ts +1 -0
- package/lib/components/ExportModal/ExportModal.d.ts.map +1 -1
- package/lib/components/ExportModal/ExportModal.js +6 -0
- package/lib/components/ImportModal/ImportModal.d.ts +3 -0
- package/lib/components/ImportModal/ImportModal.d.ts.map +1 -1
- package/lib/components/ImportModal/ImportModal.js +8 -0
- package/lib/components/PageHeader/PageHeader.d.ts +6 -0
- package/lib/components/PageHeader/PageHeader.d.ts.map +1 -1
- package/lib/components/PageHeader/PageHeader.js +11 -0
- package/lib/components/Tearsheet/next/StackContext.d.ts +2 -2
- package/lib/components/Tearsheet/next/StackContext.d.ts.map +1 -1
- package/lib/components/Tearsheet/next/Tearsheet.d.ts +30 -28
- package/lib/components/Tearsheet/next/Tearsheet.d.ts.map +1 -1
- package/lib/components/Tearsheet/next/Tearsheet.js +4 -2
- package/lib/components/Tearsheet/next/TearsheetBody.d.ts +20 -14
- package/lib/components/Tearsheet/next/TearsheetBody.d.ts.map +1 -1
- package/lib/components/Tearsheet/next/TearsheetBody.js +4 -0
- package/lib/components/Tearsheet/next/TearsheetHeader.d.ts +15 -14
- package/lib/components/Tearsheet/next/TearsheetHeader.d.ts.map +1 -1
- package/lib/components/Tearsheet/next/TearsheetHeader.js +14 -7
- package/lib/components/Tearsheet/next/TearsheetHeaderActions.d.ts +10 -6
- package/lib/components/Tearsheet/next/TearsheetHeaderActions.d.ts.map +1 -1
- package/lib/components/Tearsheet/next/TearsheetHeaderActions.js +4 -1
- package/lib/components/Tearsheet/next/TearsheetHeaderContent.d.ts.map +1 -1
- package/lib/components/Tearsheet/next/TearsheetHeaderContent.js +7 -4
- package/lib/components/Tearsheet/next/_story-assets/StepTearsheet.d.ts +7 -1
- package/lib/components/Tearsheet/next/_story-assets/StepTearsheet.d.ts.map +1 -1
- package/lib/components/Tearsheet/next/context.d.ts +2 -1
- package/lib/components/Tearsheet/next/context.d.ts.map +1 -1
- package/lib/components/index.d.ts +1 -1
- package/lib/components/index.d.ts.map +1 -1
- package/lib/node_modules/@carbon/icons-react/lib/{Icon-2zUDcllO.js → Icon.js} +8 -37
- package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-0.js +133 -131
- package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-1.js +140 -138
- package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-10.js +393 -403
- package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-11.js +417 -426
- package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-12.js +447 -441
- package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-13.js +449 -470
- package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-14.js +487 -456
- package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-15.js +550 -548
- package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-16.js +680 -733
- package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-17.js +810 -828
- package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-18.js +754 -670
- package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-19.js +622 -726
- package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-2.js +150 -148
- package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-20.js +752 -752
- package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-21.js +724 -55
- package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-3.js +176 -190
- package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-4.js +198 -180
- package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-5.js +217 -227
- package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-6.js +270 -335
- package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-7.js +405 -339
- package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-8.js +400 -577
- package/lib/node_modules/@carbon/icons-react/lib/generated/bucket-9.js +578 -388
- package/lib/node_modules/@carbon/icons-react/lib/{iconPropTypes-DaTOKOBs.js → iconPropTypes-Dkz7B3UR.js} +6 -6
- package/lib/node_modules/@carbon/icons-react/lib/index.js +465 -423
- package/lib/node_modules/@carbon/icons-react/lib/rolldown-runtime-DyAcNxqs.js +51 -0
- package/package.json +18 -18
- package/scss/components/AboutModal/_about-modal.scss +12 -3
- package/scss/components/AddSelect/_add-select_next.scss +238 -99
- package/scss/components/BigNumber/_big-number.scss +4 -0
- package/scss/components/Card/_card-next.scss +394 -8
- package/scss/components/Tearsheet/_tearsheet_next.scss +38 -4
- package/telemetry.yml +24 -18
- package/es/components/AddSelect/next/AddSelectContent.d.ts +0 -26
- package/es/components/AddSelect/next/AddSelectContent.d.ts.map +0 -1
- package/es/components/AddSelect/next/AddSelectContent.js +0 -113
- package/lib/components/AddSelect/next/AddSelectContent.d.ts +0 -26
- package/lib/components/AddSelect/next/AddSelectContent.d.ts.map +0 -1
- package/lib/components/AddSelect/next/AddSelectContent.js +0 -115
|
@@ -12,6 +12,14 @@ const require_CardContext = require("./CardContext.js");
|
|
|
12
12
|
const require_CardHeader = require("./CardHeader.js");
|
|
13
13
|
const require_CardBody = require("./CardBody.js");
|
|
14
14
|
const require_CardFooter = require("./CardFooter.js");
|
|
15
|
+
const require_CardHeaderMedia = require("./CardHeaderMedia.js");
|
|
16
|
+
const require_CardMedia = require("./CardMedia.js");
|
|
17
|
+
const require_CardLabel = require("./CardLabel.js");
|
|
18
|
+
const require_CardTitle = require("./CardTitle.js");
|
|
19
|
+
const require_CardTitleMedia = require("./CardTitleMedia.js");
|
|
20
|
+
const require_CardCaption = require("./CardCaption.js");
|
|
21
|
+
const require_CardActions = require("./CardActions.js");
|
|
22
|
+
const require_CardAction = require("./CardAction.js");
|
|
15
23
|
let react = require("react");
|
|
16
24
|
react = require_runtime.__toESM(react);
|
|
17
25
|
let prop_types = require("prop-types");
|
|
@@ -29,11 +37,21 @@ const blockClass = `${require_settings.pkg.prefix}--card-next`;
|
|
|
29
37
|
/**
|
|
30
38
|
* Card component - Root container for composable card
|
|
31
39
|
*/
|
|
32
|
-
const CardComponent = (0, react.forwardRef)(({ clickable = false, onClick, onKeyDown, disabled = false, className, children, ...rest }, ref) => {
|
|
40
|
+
const CardComponent = (0, react.forwardRef)(({ clickable = false, onClick, onKeyDown, disabled = false, density = "productive", decorator, className, children, ...rest }, ref) => {
|
|
41
|
+
const hasAILabel = decorator?.["type"]?.displayName === "AILabel";
|
|
42
|
+
const normalizedDecorator = (0, react.useMemo)(() => {
|
|
43
|
+
if (hasAILabel && react.default.isValidElement(decorator)) return react.default.cloneElement(decorator, { size: "xs" });
|
|
44
|
+
return decorator;
|
|
45
|
+
}, [decorator, hasAILabel]);
|
|
33
46
|
const contextValue = (0, react.useMemo)(() => ({
|
|
34
47
|
clickable,
|
|
35
|
-
disabled
|
|
36
|
-
|
|
48
|
+
disabled,
|
|
49
|
+
decorator: normalizedDecorator
|
|
50
|
+
}), [
|
|
51
|
+
clickable,
|
|
52
|
+
disabled,
|
|
53
|
+
normalizedDecorator
|
|
54
|
+
]);
|
|
37
55
|
const handleKeyDown = (event) => {
|
|
38
56
|
if (clickable && !disabled && (event.key === "Enter" || event.key === " ")) {
|
|
39
57
|
event.preventDefault();
|
|
@@ -46,7 +64,9 @@ const CardComponent = (0, react.forwardRef)(({ clickable = false, onClick, onKey
|
|
|
46
64
|
};
|
|
47
65
|
const cardClasses = (0, import_classnames.default)(blockClass, className, {
|
|
48
66
|
[`${blockClass}--clickable`]: clickable && !disabled,
|
|
49
|
-
[`${blockClass}--disabled`]: disabled
|
|
67
|
+
[`${blockClass}--disabled`]: disabled,
|
|
68
|
+
[`${blockClass}--${density}`]: density,
|
|
69
|
+
[`${blockClass}--has-ai-label`]: hasAILabel
|
|
50
70
|
});
|
|
51
71
|
const cardProps = {
|
|
52
72
|
...rest,
|
|
@@ -77,6 +97,14 @@ CardComponent.propTypes = {
|
|
|
77
97
|
*/
|
|
78
98
|
clickable: prop_types.default.bool,
|
|
79
99
|
/**
|
|
100
|
+
* Optional decorator component (typically AILabel from Carbon)
|
|
101
|
+
*/
|
|
102
|
+
decorator: prop_types.default.node,
|
|
103
|
+
/**
|
|
104
|
+
* Density variant: productive uses heading-compact-02, expressive uses heading-03
|
|
105
|
+
*/
|
|
106
|
+
density: prop_types.default.oneOf(["productive", "expressive"]),
|
|
107
|
+
/**
|
|
80
108
|
* Disables the card and all interactive elements
|
|
81
109
|
*/
|
|
82
110
|
disabled: prop_types.default.bool,
|
|
@@ -89,23 +117,45 @@ CardComponent.propTypes = {
|
|
|
89
117
|
*/
|
|
90
118
|
onKeyDown: prop_types.default.func
|
|
91
119
|
};
|
|
92
|
-
const Card = CardComponent;
|
|
93
120
|
/**
|
|
94
121
|
* -------
|
|
95
122
|
* Exports
|
|
96
123
|
* -------
|
|
97
124
|
*/
|
|
98
|
-
const Root = Card;
|
|
99
|
-
Root.displayName = "Card.Root";
|
|
100
125
|
const Header = require_CardHeader.CardHeader;
|
|
101
126
|
Header.displayName = "Card.Header";
|
|
102
127
|
const Body = require_CardBody.CardBody;
|
|
103
128
|
Body.displayName = "Card.Body";
|
|
104
129
|
const Footer = require_CardFooter.CardFooter;
|
|
105
130
|
Footer.displayName = "Card.Footer";
|
|
131
|
+
const HeaderMedia = require_CardHeaderMedia.CardHeaderMedia;
|
|
132
|
+
HeaderMedia.displayName = "Card.HeaderMedia";
|
|
133
|
+
const Media = require_CardMedia.CardMedia;
|
|
134
|
+
Media.displayName = "Card.Media";
|
|
135
|
+
const Label = require_CardLabel.CardLabel;
|
|
136
|
+
Label.displayName = "Card.Label";
|
|
137
|
+
const Title = require_CardTitle.CardTitle;
|
|
138
|
+
Title.displayName = "Card.Title";
|
|
139
|
+
const TitleMedia = require_CardTitleMedia.CardTitleMedia;
|
|
140
|
+
TitleMedia.displayName = "Card.TitleMedia";
|
|
141
|
+
const Caption = require_CardCaption.CardCaption;
|
|
142
|
+
Caption.displayName = "Card.Caption";
|
|
143
|
+
const Actions = require_CardActions.CardActions;
|
|
144
|
+
Actions.displayName = "Card.Actions";
|
|
145
|
+
const Action = require_CardAction.CardAction;
|
|
146
|
+
Action.displayName = "Card.Action";
|
|
147
|
+
const Card = Object.assign(CardComponent, {
|
|
148
|
+
Header,
|
|
149
|
+
Body,
|
|
150
|
+
Footer,
|
|
151
|
+
HeaderMedia,
|
|
152
|
+
Media,
|
|
153
|
+
Label,
|
|
154
|
+
Title,
|
|
155
|
+
TitleMedia,
|
|
156
|
+
Caption,
|
|
157
|
+
Actions,
|
|
158
|
+
Action
|
|
159
|
+
});
|
|
106
160
|
//#endregion
|
|
107
|
-
exports.Body = Body;
|
|
108
161
|
exports.Card = Card;
|
|
109
|
-
exports.Footer = Footer;
|
|
110
|
-
exports.Header = Header;
|
|
111
|
-
exports.Root = Root;
|
|
@@ -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;
|
|
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,53 @@
|
|
|
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
|
+
const require_runtime = require("../../../_virtual/_rolldown/runtime.js");
|
|
9
|
+
const require_index = require("../../../node_modules/classnames/index.js");
|
|
10
|
+
const require_settings = require("../../../settings.js");
|
|
11
|
+
const require_devtools = require("../../../global/js/utils/devtools.js");
|
|
12
|
+
let react = require("react");
|
|
13
|
+
react = require_runtime.__toESM(react);
|
|
14
|
+
let prop_types = require("prop-types");
|
|
15
|
+
prop_types = require_runtime.__toESM(prop_types);
|
|
16
|
+
//#region src/components/Card/next/CardAction.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__ */ require_runtime.__toESM(require_index.default);
|
|
24
|
+
const blockClass = `${require_settings.pkg.prefix}--card-next`;
|
|
25
|
+
const componentName = "CardAction";
|
|
26
|
+
/**
|
|
27
|
+
* CardAction is a wrapper for interactive elements in the card footer.
|
|
28
|
+
* Its presence signals action-set layout to the footer (no padding, auto
|
|
29
|
+
* border, stretch behavior).
|
|
30
|
+
*
|
|
31
|
+
* Note: do not use CardAction inside a clickable card — clickable cards
|
|
32
|
+
* should not contain interactive elements (see usage guidelines).
|
|
33
|
+
*/
|
|
34
|
+
const CardAction = ({ children, className, ...rest }) => {
|
|
35
|
+
return /* @__PURE__ */ react.default.createElement("div", {
|
|
36
|
+
...rest,
|
|
37
|
+
className: (0, import_classnames.default)(`${blockClass}__action`, className),
|
|
38
|
+
...require_devtools.getDevtoolsProps(componentName)
|
|
39
|
+
}, children);
|
|
40
|
+
};
|
|
41
|
+
CardAction.propTypes = {
|
|
42
|
+
/**
|
|
43
|
+
* Provide the contents of the CardAction.
|
|
44
|
+
*/
|
|
45
|
+
children: prop_types.default.node,
|
|
46
|
+
/**
|
|
47
|
+
* Provide an optional class to be applied to the containing node.
|
|
48
|
+
*/
|
|
49
|
+
className: prop_types.default.string
|
|
50
|
+
};
|
|
51
|
+
CardAction.displayName = componentName;
|
|
52
|
+
//#endregion
|
|
53
|
+
exports.CardAction = 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,109 @@
|
|
|
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
|
+
const require_runtime = require("../../../_virtual/_rolldown/runtime.js");
|
|
9
|
+
const require_index = require("../../../node_modules/classnames/index.js");
|
|
10
|
+
const require_settings = require("../../../settings.js");
|
|
11
|
+
const require_devtools = require("../../../global/js/utils/devtools.js");
|
|
12
|
+
let react = require("react");
|
|
13
|
+
react = require_runtime.__toESM(react);
|
|
14
|
+
let prop_types = require("prop-types");
|
|
15
|
+
prop_types = require_runtime.__toESM(prop_types);
|
|
16
|
+
let _carbon_react = require("@carbon/react");
|
|
17
|
+
let _carbon_utilities = require("@carbon/utilities");
|
|
18
|
+
//#region src/components/Card/next/CardActions.tsx
|
|
19
|
+
/**
|
|
20
|
+
* Copyright IBM Corp. 2026
|
|
21
|
+
*
|
|
22
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
23
|
+
* LICENSE file in the root directory of this source tree.
|
|
24
|
+
*/
|
|
25
|
+
var import_classnames = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
|
|
26
|
+
const blockClass = `${require_settings.pkg.prefix}--card-next`;
|
|
27
|
+
const componentName = "CardActions";
|
|
28
|
+
/**
|
|
29
|
+
* CardActions is a container for action buttons in the card header.
|
|
30
|
+
* Positioned in the top-right corner with 8px gap between actions.
|
|
31
|
+
* When actions exceed 50% of available header space, overflow menu is shown.
|
|
32
|
+
*/
|
|
33
|
+
const CardActions = ({ children, className, overflowMenuLabel = "More actions", ...rest }) => {
|
|
34
|
+
const containerRef = (0, react.useRef)(null);
|
|
35
|
+
const [hiddenItems, setHiddenItems] = (0, react.useState)([]);
|
|
36
|
+
const classes = (0, import_classnames.default)(`${blockClass}__actions`, className);
|
|
37
|
+
const actionItems = [];
|
|
38
|
+
react.Children.forEach(children, (child, index) => {
|
|
39
|
+
if (react.default.isValidElement(child)) {
|
|
40
|
+
const id = `action-${index}`;
|
|
41
|
+
let label = overflowMenuLabel;
|
|
42
|
+
const childProps = child.props;
|
|
43
|
+
if (childProps.children && react.default.isValidElement(childProps.children)) {
|
|
44
|
+
const iconButton = childProps.children;
|
|
45
|
+
label = iconButton.props?.label || iconButton.props?.iconDescription || `Action ${index + 1}`;
|
|
46
|
+
}
|
|
47
|
+
actionItems.push({
|
|
48
|
+
id,
|
|
49
|
+
element: child,
|
|
50
|
+
label
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
(0, react.useEffect)(() => {
|
|
55
|
+
if (!containerRef.current || actionItems.length === 0) return;
|
|
56
|
+
const handler = (0, _carbon_utilities.createOverflowHandler)({
|
|
57
|
+
container: containerRef.current,
|
|
58
|
+
onChange: (_visible, hidden) => {
|
|
59
|
+
const hiddenIds = hidden.map((el) => el.dataset.id);
|
|
60
|
+
setHiddenItems(actionItems.filter((item) => hiddenIds.includes(item.id)));
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
return () => handler.disconnect();
|
|
64
|
+
}, [children]);
|
|
65
|
+
return /* @__PURE__ */ react.default.createElement("div", {
|
|
66
|
+
ref: containerRef,
|
|
67
|
+
className: classes,
|
|
68
|
+
...rest,
|
|
69
|
+
...require_devtools.getDevtoolsProps(componentName)
|
|
70
|
+
}, actionItems.map((item) => /* @__PURE__ */ react.default.createElement("div", {
|
|
71
|
+
key: item.id,
|
|
72
|
+
"data-id": item.id
|
|
73
|
+
}, item.element)), /* @__PURE__ */ react.default.createElement("div", {
|
|
74
|
+
"data-offset": true,
|
|
75
|
+
"data-hidden": true,
|
|
76
|
+
"data-floating-menu-container": true,
|
|
77
|
+
style: { position: "relative" }
|
|
78
|
+
}, /* @__PURE__ */ react.default.createElement(_carbon_react.FeatureFlags, { enableV12Overflowmenu: true }, /* @__PURE__ */ react.default.createElement(_carbon_react.OverflowMenu, {
|
|
79
|
+
size: "sm",
|
|
80
|
+
"aria-label": overflowMenuLabel
|
|
81
|
+
}, hiddenItems.map((item) => /* @__PURE__ */ react.default.createElement(_carbon_react.OverflowMenuItem, {
|
|
82
|
+
key: item.id,
|
|
83
|
+
itemText: item.label || "Action",
|
|
84
|
+
onClick: () => {
|
|
85
|
+
const button = item.element.props.children;
|
|
86
|
+
if (button && react.default.isValidElement(button)) {
|
|
87
|
+
const buttonProps = button.props;
|
|
88
|
+
if (buttonProps.onClick) buttonProps.onClick();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}))))));
|
|
92
|
+
};
|
|
93
|
+
CardActions.propTypes = {
|
|
94
|
+
/**
|
|
95
|
+
* Provide the contents of the CardActions.
|
|
96
|
+
*/
|
|
97
|
+
children: prop_types.default.node,
|
|
98
|
+
/**
|
|
99
|
+
* Provide an optional class to be applied to the containing node.
|
|
100
|
+
*/
|
|
101
|
+
className: prop_types.default.string,
|
|
102
|
+
/**
|
|
103
|
+
* Aria label for the overflow menu
|
|
104
|
+
*/
|
|
105
|
+
overflowMenuLabel: prop_types.default.string
|
|
106
|
+
};
|
|
107
|
+
CardActions.displayName = componentName;
|
|
108
|
+
//#endregion
|
|
109
|
+
exports.CardActions = 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,54 @@
|
|
|
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
|
+
const require_runtime = require("../../../_virtual/_rolldown/runtime.js");
|
|
9
|
+
const require_index = require("../../../node_modules/classnames/index.js");
|
|
10
|
+
const require_settings = require("../../../settings.js");
|
|
11
|
+
const require_devtools = require("../../../global/js/utils/devtools.js");
|
|
12
|
+
let react = require("react");
|
|
13
|
+
react = require_runtime.__toESM(react);
|
|
14
|
+
let prop_types = require("prop-types");
|
|
15
|
+
prop_types = require_runtime.__toESM(prop_types);
|
|
16
|
+
//#region src/components/Card/next/CardCaption.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__ */ require_runtime.__toESM(require_index.default);
|
|
24
|
+
const blockClass = `${require_settings.pkg.prefix}--card-next`;
|
|
25
|
+
const componentName = "CardCaption";
|
|
26
|
+
/**
|
|
27
|
+
* CardCaption displays secondary text below the title in the card header.
|
|
28
|
+
* Uses $label-01 typography token and $text-secondary color.
|
|
29
|
+
*/
|
|
30
|
+
const CardCaption = ({ children, className, truncate = false, ...rest }) => {
|
|
31
|
+
const classes = (0, import_classnames.default)(`${blockClass}__caption`, { [`${blockClass}__caption--truncate`]: truncate }, className);
|
|
32
|
+
return /* @__PURE__ */ react.default.createElement("div", {
|
|
33
|
+
...rest,
|
|
34
|
+
className: classes,
|
|
35
|
+
...require_devtools.getDevtoolsProps(componentName)
|
|
36
|
+
}, children);
|
|
37
|
+
};
|
|
38
|
+
CardCaption.propTypes = {
|
|
39
|
+
/**
|
|
40
|
+
* Provide the contents of the CardCaption.
|
|
41
|
+
*/
|
|
42
|
+
children: prop_types.default.node,
|
|
43
|
+
/**
|
|
44
|
+
* Provide an optional class to be applied to the containing node.
|
|
45
|
+
*/
|
|
46
|
+
className: prop_types.default.string,
|
|
47
|
+
/**
|
|
48
|
+
* Enable text truncation with ellipsis.
|
|
49
|
+
*/
|
|
50
|
+
truncate: prop_types.default.bool
|
|
51
|
+
};
|
|
52
|
+
CardCaption.displayName = componentName;
|
|
53
|
+
//#endregion
|
|
54
|
+
exports.CardCaption = CardCaption;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
require("../../../_virtual/_rolldown/runtime.js");
|
|
9
|
+
let react = require("react");
|
|
9
10
|
//#region src/components/Card/next/CardContext.tsx
|
|
10
11
|
/**
|
|
11
12
|
* Copyright IBM Corp. 2026
|
|
@@ -16,6 +17,17 @@ require("../../../_virtual/_rolldown/runtime.js");
|
|
|
16
17
|
/**
|
|
17
18
|
* Context for sharing Card state with child components
|
|
18
19
|
*/
|
|
19
|
-
const CardContext = (0,
|
|
20
|
+
const CardContext = (0, react.createContext)(void 0);
|
|
21
|
+
/**
|
|
22
|
+
* Hook to access Card context
|
|
23
|
+
* @returns CardContextValue
|
|
24
|
+
* @throws Error if used outside of Card component
|
|
25
|
+
*/
|
|
26
|
+
const useCardContext = () => {
|
|
27
|
+
const context = (0, react.useContext)(CardContext);
|
|
28
|
+
if (!context) throw new Error("Card subcomponents must be used within a Card component");
|
|
29
|
+
return context;
|
|
30
|
+
};
|
|
20
31
|
//#endregion
|
|
21
32
|
exports.CardContext = CardContext;
|
|
33
|
+
exports.useCardContext = 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;
|
|
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,
|
|
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,6 +8,7 @@
|
|
|
8
8
|
const require_runtime = require("../../../_virtual/_rolldown/runtime.js");
|
|
9
9
|
const require_index = require("../../../node_modules/classnames/index.js");
|
|
10
10
|
const require_settings = require("../../../settings.js");
|
|
11
|
+
const require_CardContext = require("./CardContext.js");
|
|
11
12
|
let react = require("react");
|
|
12
13
|
react = require_runtime.__toESM(react);
|
|
13
14
|
let prop_types = require("prop-types");
|
|
@@ -26,12 +27,34 @@ const blockClass = `${require_settings.pkg.prefix}--card-next__header`;
|
|
|
26
27
|
* CardHeader component - Header section of the card
|
|
27
28
|
*/
|
|
28
29
|
const CardHeader = (0, react.forwardRef)(({ className, children, ...rest }, ref) => {
|
|
30
|
+
const context = require_CardContext.useCardContext();
|
|
31
|
+
const cardBlockClass = `${require_settings.pkg.prefix}--card-next`;
|
|
32
|
+
const hasTitleMedia = react.Children.toArray(children).some((child) => {
|
|
33
|
+
return (0, react.isValidElement)(child) && child.type?.["displayName"] === "Card.TitleMedia";
|
|
34
|
+
});
|
|
35
|
+
const titleMediaElements = [];
|
|
36
|
+
const mediaElements = [];
|
|
37
|
+
const otherContent = [];
|
|
38
|
+
if (hasTitleMedia) react.Children.forEach(children, (child) => {
|
|
39
|
+
if ((0, react.isValidElement)(child) && child.type?.["displayName"] === "Card.TitleMedia") titleMediaElements.push(child);
|
|
40
|
+
else if ((0, react.isValidElement)(child) && child.type?.["displayName"] === "Card.Media") mediaElements.push(child);
|
|
41
|
+
else otherContent.push(child);
|
|
42
|
+
});
|
|
29
43
|
const headerClasses = (0, import_classnames.default)(blockClass, className);
|
|
30
44
|
return /* @__PURE__ */ react.default.createElement("div", {
|
|
31
45
|
...rest,
|
|
32
46
|
ref,
|
|
33
47
|
className: headerClasses
|
|
34
|
-
}, children
|
|
48
|
+
}, hasTitleMedia ? /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, mediaElements, /* @__PURE__ */ react.default.createElement("div", { className: `${cardBlockClass}__header-content` }, titleMediaElements, /* @__PURE__ */ react.default.createElement("div", { className: `${cardBlockClass}__title-content` }, otherContent))) : children, context.decorator && /* @__PURE__ */ react.default.createElement("div", {
|
|
49
|
+
className: `${cardBlockClass}__decorator`,
|
|
50
|
+
role: "presentation",
|
|
51
|
+
onClick: (e) => {
|
|
52
|
+
e.stopPropagation();
|
|
53
|
+
},
|
|
54
|
+
onKeyDown: (e) => {
|
|
55
|
+
e.stopPropagation();
|
|
56
|
+
}
|
|
57
|
+
}, context.decorator));
|
|
35
58
|
});
|
|
36
59
|
CardHeader.displayName = componentName;
|
|
37
60
|
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"}
|