@carbon/ibm-products 2.95.0 → 2.96.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/index-full-carbon.css +94 -89
- 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 +15 -11
- 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 +94 -89
- 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 +15 -11
- 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/Card/next/Card.d.ts +6 -69
- package/es/components/Card/next/Card.d.ts.map +1 -1
- package/es/components/Card/next/Card.js +45 -24
- package/es/components/Card/next/Card.types.d.ts +12 -3
- package/es/components/Card/next/Card.types.d.ts.map +1 -1
- package/es/components/Card/next/CardAction.d.ts +7 -15
- package/es/components/Card/next/CardAction.d.ts.map +1 -1
- package/es/components/Card/next/CardAction.js +10 -4
- package/es/components/Card/next/CardActions.d.ts +1 -19
- package/es/components/Card/next/CardActions.d.ts.map +1 -1
- package/es/components/Card/next/CardActions.js +27 -22
- package/es/components/Card/next/CardBody.d.ts +1 -1
- package/es/components/Card/next/CardBody.d.ts.map +1 -1
- package/es/components/Card/next/CardBody.js +3 -2
- package/es/components/Card/next/CardFooter.d.ts +1 -1
- package/es/components/Card/next/CardFooter.d.ts.map +1 -1
- package/es/components/Card/next/CardFooter.js +3 -2
- package/es/components/Card/next/CardHeader.d.ts +8 -2
- package/es/components/Card/next/CardHeader.d.ts.map +1 -1
- package/es/components/Card/next/CardHeader.js +17 -24
- package/es/components/Card/next/CardHeaderMedia.d.ts +1 -15
- package/es/components/Card/next/CardHeaderMedia.d.ts.map +1 -1
- package/es/components/Card/next/CardHeaderMedia.js +5 -3
- package/es/components/Card/next/CardMedia.d.ts +12 -18
- package/es/components/Card/next/CardMedia.d.ts.map +1 -1
- package/es/components/Card/next/CardMedia.js +22 -13
- package/es/components/Card/next/CardTitle.d.ts +27 -33
- package/es/components/Card/next/CardTitle.d.ts.map +1 -1
- package/es/components/Card/next/CardTitle.js +62 -18
- package/es/components/Card/next/CardTitleMedia.d.ts +1 -1
- package/es/components/Card/next/CardTitleMedia.d.ts.map +1 -1
- package/es/components/Card/next/CardTitleMedia.js +3 -2
- package/es/components/Card/next/_story-assets/data.d.ts +7 -0
- package/es/components/Card/next/_story-assets/data.d.ts.map +1 -0
- package/es/components/Card/next/_story-assets/options.d.ts +48 -0
- package/es/components/Card/next/_story-assets/options.d.ts.map +1 -0
- package/es/components/Card/next/index.d.ts +2 -2
- package/es/components/Card/next/index.d.ts.map +1 -1
- package/es/components/Card/next/index.js +0 -4
- package/es/components/Tearsheet/next/Tearsheet.d.ts.map +1 -1
- package/es/components/Tearsheet/next/Tearsheet.js +5 -2
- package/es/components/Tearsheet/next/TearsheetBody.d.ts.map +1 -1
- package/es/components/Tearsheet/next/TearsheetBody.js +2 -1
- package/es/global/js/package-settings.d.ts +10 -0
- package/es/global/js/package-settings.d.ts.map +1 -1
- package/es/global/js/package-settings.js +10 -0
- package/es/settings.d.ts +10 -0
- package/es/settings.d.ts.map +1 -1
- package/lib/components/Card/next/Card.d.ts +6 -69
- package/lib/components/Card/next/Card.d.ts.map +1 -1
- package/lib/components/Card/next/Card.js +44 -23
- package/lib/components/Card/next/Card.types.d.ts +12 -3
- package/lib/components/Card/next/Card.types.d.ts.map +1 -1
- package/lib/components/Card/next/CardAction.d.ts +7 -15
- package/lib/components/Card/next/CardAction.d.ts.map +1 -1
- package/lib/components/Card/next/CardAction.js +15 -4
- package/lib/components/Card/next/CardActions.d.ts +1 -19
- package/lib/components/Card/next/CardActions.d.ts.map +1 -1
- package/lib/components/Card/next/CardActions.js +32 -22
- package/lib/components/Card/next/CardBody.d.ts +1 -1
- package/lib/components/Card/next/CardBody.d.ts.map +1 -1
- package/lib/components/Card/next/CardBody.js +9 -3
- package/lib/components/Card/next/CardFooter.d.ts +1 -1
- package/lib/components/Card/next/CardFooter.d.ts.map +1 -1
- package/lib/components/Card/next/CardFooter.js +9 -3
- package/lib/components/Card/next/CardHeader.d.ts +8 -2
- package/lib/components/Card/next/CardHeader.d.ts.map +1 -1
- package/lib/components/Card/next/CardHeader.js +22 -24
- package/lib/components/Card/next/CardHeaderMedia.d.ts +1 -15
- package/lib/components/Card/next/CardHeaderMedia.d.ts.map +1 -1
- package/lib/components/Card/next/CardHeaderMedia.js +10 -3
- package/lib/components/Card/next/CardMedia.d.ts +12 -18
- package/lib/components/Card/next/CardMedia.d.ts.map +1 -1
- package/lib/components/Card/next/CardMedia.js +27 -13
- package/lib/components/Card/next/CardTitle.d.ts +27 -33
- package/lib/components/Card/next/CardTitle.d.ts.map +1 -1
- package/lib/components/Card/next/CardTitle.js +67 -18
- package/lib/components/Card/next/CardTitleMedia.d.ts +1 -1
- package/lib/components/Card/next/CardTitleMedia.d.ts.map +1 -1
- package/lib/components/Card/next/CardTitleMedia.js +9 -3
- package/lib/components/Card/next/_story-assets/data.d.ts +7 -0
- package/lib/components/Card/next/_story-assets/data.d.ts.map +1 -0
- package/lib/components/Card/next/_story-assets/options.d.ts +48 -0
- package/lib/components/Card/next/_story-assets/options.d.ts.map +1 -0
- package/lib/components/Card/next/index.d.ts +2 -2
- package/lib/components/Card/next/index.d.ts.map +1 -1
- package/lib/components/Card/next/index.js +0 -4
- package/lib/components/Tearsheet/next/Tearsheet.d.ts.map +1 -1
- package/lib/components/Tearsheet/next/Tearsheet.js +5 -2
- package/lib/components/Tearsheet/next/TearsheetBody.d.ts.map +1 -1
- package/lib/components/Tearsheet/next/TearsheetBody.js +2 -1
- package/lib/global/js/package-settings.d.ts +10 -0
- package/lib/global/js/package-settings.d.ts.map +1 -1
- package/lib/global/js/package-settings.js +10 -0
- package/lib/settings.d.ts +10 -0
- package/lib/settings.d.ts.map +1 -1
- package/package.json +9 -8
- package/scss/components/AboutModal/_about-modal.scss +12 -12
- package/scss/components/Card/_card-next.scss +184 -157
- package/scss/components/PageHeader/_page-header.scss +1 -1
- package/scss/components/Tearsheet/_tearsheet_next.scss +1 -2
- package/telemetry.yml +9 -9
- package/es/components/Card/next/CardCaption.d.ts +0 -46
- package/es/components/Card/next/CardCaption.d.ts.map +0 -1
- package/es/components/Card/next/CardCaption.js +0 -52
- package/es/components/Card/next/CardLabel.d.ts +0 -46
- package/es/components/Card/next/CardLabel.d.ts.map +0 -1
- package/es/components/Card/next/CardLabel.js +0 -52
- package/es/components/Tearsheet/next/_story-assets/StepTearsheet.d.ts +0 -30
- package/es/components/Tearsheet/next/_story-assets/StepTearsheet.d.ts.map +0 -1
- package/lib/components/Card/next/CardCaption.d.ts +0 -46
- package/lib/components/Card/next/CardCaption.d.ts.map +0 -1
- package/lib/components/Card/next/CardCaption.js +0 -54
- package/lib/components/Card/next/CardLabel.d.ts +0 -46
- package/lib/components/Card/next/CardLabel.d.ts.map +0 -1
- package/lib/components/Card/next/CardLabel.js +0 -54
- package/lib/components/Tearsheet/next/_story-assets/StepTearsheet.d.ts +0 -30
- package/lib/components/Tearsheet/next/_story-assets/StepTearsheet.d.ts.map +0 -1
|
@@ -72,7 +72,7 @@ const SummaryContent = forwardRef(({ children, className, summaryPanelOpen = fal
|
|
|
72
72
|
return !isSm ? /* @__PURE__ */ React.createElement("div", {
|
|
73
73
|
className: (0, import_classnames.default)(`${blockClass}__summary-content`, className, { [`${blockClass}__flush`]: isFlush }),
|
|
74
74
|
ref
|
|
75
|
-
}, /* @__PURE__ */ React.createElement("aside",
|
|
75
|
+
}, /* @__PURE__ */ React.createElement("aside", { "aria-label": summaryPanelAriaLabel }, children)) : /* @__PURE__ */ React.createElement(SidePanel, {
|
|
76
76
|
size: "sm",
|
|
77
77
|
open: summaryPanelOpen,
|
|
78
78
|
onRequestClose: onSummaryPanelClose,
|
|
@@ -92,6 +92,7 @@ const Influencer = forwardRef(({ children, className, influencerPanelOpen = fals
|
|
|
92
92
|
prevOpenRef.current = influencerPanelOpen;
|
|
93
93
|
}, [influencerPanelOpen, influencerPanelTriggerRef]);
|
|
94
94
|
return !isSm ? /* @__PURE__ */ React.createElement("aside", {
|
|
95
|
+
"aria-label": influencerPanelAriaLabel,
|
|
95
96
|
className: (0, import_classnames.default)(`${blockClass}__influencer`, className, { [`${blockClass}__flush`]: isFlush }),
|
|
96
97
|
ref
|
|
97
98
|
}, children) : /* @__PURE__ */ React.createElement(SidePanel, {
|
|
@@ -101,6 +101,16 @@ declare namespace defaults {
|
|
|
101
101
|
let FilterPanelSearch: boolean;
|
|
102
102
|
let ConditionBuilder: boolean;
|
|
103
103
|
let GetStartedCard: boolean;
|
|
104
|
+
let Card: boolean;
|
|
105
|
+
let CardAction: boolean;
|
|
106
|
+
let CardActions: boolean;
|
|
107
|
+
let CardBody: boolean;
|
|
108
|
+
let CardFooter: boolean;
|
|
109
|
+
let CardHeader: boolean;
|
|
110
|
+
let CardHeaderMedia: boolean;
|
|
111
|
+
let CardMedia: boolean;
|
|
112
|
+
let CardTitle: boolean;
|
|
113
|
+
let CardTitleMedia: boolean;
|
|
104
114
|
let Coachmark: boolean;
|
|
105
115
|
let CoachmarkBeacon: boolean;
|
|
106
116
|
let CoachmarkButton: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-settings.d.ts","sourceRoot":"","sources":["../../../src/global/js/package-settings.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"package-settings.d.ts","sourceRoot":"","sources":["../../../src/global/js/package-settings.js"],"names":[],"mappings":"AAqOA,0DAEC;AAJD,gCAAiC,yBAAyB,CAAC;;;;;;;;IAarC,mFAMnB;IAEkB,kFAOlB;IAEiB,6EAEjB;IAED,qEAOC;IAEgB,4EAKhB;IAEiB,qDAIjB;IAEe,mDAIf;IAEiB,mDAKjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA1FH;;;;;;;EAqBE"}
|
|
@@ -89,6 +89,16 @@ const defaults = {
|
|
|
89
89
|
FilterPanelSearch: false,
|
|
90
90
|
ConditionBuilder: false,
|
|
91
91
|
GetStartedCard: false,
|
|
92
|
+
Card: false,
|
|
93
|
+
CardAction: false,
|
|
94
|
+
CardActions: false,
|
|
95
|
+
CardBody: false,
|
|
96
|
+
CardFooter: false,
|
|
97
|
+
CardHeader: false,
|
|
98
|
+
CardHeaderMedia: false,
|
|
99
|
+
CardMedia: false,
|
|
100
|
+
CardTitle: false,
|
|
101
|
+
CardTitleMedia: false,
|
|
92
102
|
Coachmark: false,
|
|
93
103
|
CoachmarkBeacon: false,
|
|
94
104
|
CoachmarkButton: false,
|
package/es/settings.d.ts
CHANGED
|
@@ -92,6 +92,16 @@ export const pkg: {
|
|
|
92
92
|
FilterPanelSearch: boolean;
|
|
93
93
|
ConditionBuilder: boolean;
|
|
94
94
|
GetStartedCard: boolean;
|
|
95
|
+
Card: boolean;
|
|
96
|
+
CardAction: boolean;
|
|
97
|
+
CardActions: boolean;
|
|
98
|
+
CardBody: boolean;
|
|
99
|
+
CardFooter: boolean;
|
|
100
|
+
CardHeader: boolean;
|
|
101
|
+
CardHeaderMedia: boolean;
|
|
102
|
+
CardMedia: boolean;
|
|
103
|
+
CardTitle: boolean;
|
|
104
|
+
CardTitleMedia: boolean;
|
|
95
105
|
Coachmark: boolean;
|
|
96
106
|
CoachmarkBeacon: boolean;
|
|
97
107
|
CoachmarkButton: boolean;
|
package/es/settings.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../src/settings.js"],"names":[],"mappings":";;;;;;;;;AAmGA
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../src/settings.js"],"names":[],"mappings":";;;;;;;;;AAmGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA+B"}
|
|
@@ -5,96 +5,33 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
|
-
import PropTypes from 'prop-types';
|
|
9
8
|
import { CardProps } from './Card.types';
|
|
10
9
|
import { CardHeader } from './CardHeader';
|
|
11
10
|
import { CardBody } from './CardBody';
|
|
12
11
|
import { CardFooter } from './CardFooter';
|
|
13
12
|
import { CardHeaderMedia } from './CardHeaderMedia';
|
|
14
13
|
import { CardMedia } from './CardMedia';
|
|
15
|
-
import { CardLabel } from './CardLabel';
|
|
16
14
|
import { CardTitle } from './CardTitle';
|
|
17
15
|
import { CardTitleMedia } from './CardTitleMedia';
|
|
18
|
-
import { CardCaption } from './CardCaption';
|
|
19
16
|
import { CardActions } from './CardActions';
|
|
20
17
|
import { CardAction } from './CardAction';
|
|
21
18
|
export declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>> & {
|
|
22
19
|
Header: React.ForwardRefExoticComponent<import("./Card.types").CardBaseProps & React.RefAttributes<HTMLDivElement>>;
|
|
23
20
|
Body: React.ForwardRefExoticComponent<import("./Card.types").CardBaseProps & React.RefAttributes<HTMLDivElement>>;
|
|
24
21
|
Footer: React.ForwardRefExoticComponent<import("./Card.types").CardBaseProps & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
-
HeaderMedia:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
29
|
-
className: PropTypes.Requireable<string>;
|
|
30
|
-
};
|
|
31
|
-
displayName: string;
|
|
32
|
-
};
|
|
33
|
-
Media: {
|
|
34
|
-
({ children, className, ...rest }: import("./CardMedia").CardMediaProps): React.JSX.Element;
|
|
35
|
-
propTypes: {
|
|
36
|
-
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
37
|
-
className: PropTypes.Requireable<string>;
|
|
38
|
-
};
|
|
39
|
-
displayName: string;
|
|
40
|
-
};
|
|
41
|
-
Label: {
|
|
42
|
-
({ children, className, truncate, ...rest }: import("./CardLabel").CardLabelProps): React.JSX.Element;
|
|
43
|
-
propTypes: {
|
|
44
|
-
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
45
|
-
className: PropTypes.Requireable<string>;
|
|
46
|
-
truncate: PropTypes.Requireable<boolean>;
|
|
47
|
-
};
|
|
48
|
-
displayName: string;
|
|
49
|
-
};
|
|
50
|
-
Title: {
|
|
51
|
-
({ children, className, truncate, maxWidth, titleStart, titleEnd, ...rest }: import("./CardTitle").CardTitleProps): React.JSX.Element;
|
|
52
|
-
propTypes: {
|
|
53
|
-
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
54
|
-
className: PropTypes.Requireable<string>;
|
|
55
|
-
maxWidth: PropTypes.Requireable<string>;
|
|
56
|
-
titleEnd: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
57
|
-
titleStart: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
58
|
-
truncate: PropTypes.Requireable<NonNullable<number | boolean>>;
|
|
59
|
-
};
|
|
60
|
-
displayName: string;
|
|
61
|
-
};
|
|
22
|
+
HeaderMedia: React.ForwardRefExoticComponent<import("./CardHeaderMedia").CardHeaderMediaProps & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
Media: React.ForwardRefExoticComponent<import("./CardMedia").CardMediaProps & React.RefAttributes<HTMLDivElement>>;
|
|
24
|
+
Title: React.ForwardRefExoticComponent<import("./CardTitle").CardTitleProps & React.RefAttributes<HTMLDivElement>>;
|
|
62
25
|
TitleMedia: React.ForwardRefExoticComponent<import("./CardTitleMedia").CardTitleMediaProps & React.RefAttributes<HTMLDivElement>>;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
propTypes: {
|
|
66
|
-
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
67
|
-
className: PropTypes.Requireable<string>;
|
|
68
|
-
truncate: PropTypes.Requireable<boolean>;
|
|
69
|
-
};
|
|
70
|
-
displayName: string;
|
|
71
|
-
};
|
|
72
|
-
Actions: {
|
|
73
|
-
({ children, className, overflowMenuLabel, ...rest }: import("./CardActions").CardActionsProps): React.JSX.Element;
|
|
74
|
-
propTypes: {
|
|
75
|
-
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
76
|
-
className: PropTypes.Requireable<string>;
|
|
77
|
-
overflowMenuLabel: PropTypes.Requireable<string>;
|
|
78
|
-
};
|
|
79
|
-
displayName: string;
|
|
80
|
-
};
|
|
81
|
-
Action: {
|
|
82
|
-
({ children, className, ...rest }: import("./CardAction").CardActionProps): React.JSX.Element;
|
|
83
|
-
propTypes: {
|
|
84
|
-
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
85
|
-
className: PropTypes.Requireable<string>;
|
|
86
|
-
};
|
|
87
|
-
displayName: string;
|
|
88
|
-
};
|
|
26
|
+
Actions: React.ForwardRefExoticComponent<import("./CardActions").CardActionsProps & React.RefAttributes<HTMLDivElement>>;
|
|
27
|
+
Action: React.ForwardRefExoticComponent<import("./CardAction").CardActionProps & React.RefAttributes<HTMLDivElement>>;
|
|
89
28
|
};
|
|
90
|
-
export { Card as default, CardHeader, CardBody, CardFooter, CardHeaderMedia, CardMedia,
|
|
29
|
+
export { Card as default, CardHeader, CardBody, CardFooter, CardHeaderMedia, CardMedia, CardTitle, CardTitleMedia, CardActions, CardAction, };
|
|
91
30
|
export type { CardProps, CardHeaderProps, CardBodyProps, CardFooterProps, } from './Card.types';
|
|
92
31
|
export type { CardHeaderMediaProps } from './CardHeaderMedia';
|
|
93
32
|
export type { CardMediaProps } from './CardMedia';
|
|
94
|
-
export type { CardLabelProps } from './CardLabel';
|
|
95
33
|
export type { CardTitleProps } from './CardTitle';
|
|
96
34
|
export type { CardTitleMediaProps } from './CardTitleMedia';
|
|
97
|
-
export type { CardCaptionProps } from './CardCaption';
|
|
98
35
|
export type { CardActionsProps } from './CardActions';
|
|
99
36
|
export type { CardActionProps } from './CardAction';
|
|
100
37
|
//# sourceMappingURL=Card.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/next/Card.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/next/Card.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAA2D,MAAM,OAAO,CAAC;AAIhF,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAKzC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA0N1C,eAAO,MAAM,IAAI;;;;;;;;;;CAUf,CAAC;AAEH,OAAO,EACL,IAAI,IAAI,OAAO,EACf,UAAU,EACV,QAAQ,EACR,UAAU,EACV,eAAe,EACf,SAAS,EACT,SAAS,EACT,cAAc,EACd,WAAW,EACX,UAAU,GACX,CAAC;AAEF,YAAY,EACV,SAAS,EACT,eAAe,EACf,aAAa,EACb,eAAe,GAChB,MAAM,cAAc,CAAC;AAGtB,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -14,16 +14,15 @@ const require_CardBody = require("./CardBody.js");
|
|
|
14
14
|
const require_CardFooter = require("./CardFooter.js");
|
|
15
15
|
const require_CardHeaderMedia = require("./CardHeaderMedia.js");
|
|
16
16
|
const require_CardMedia = require("./CardMedia.js");
|
|
17
|
-
const require_CardLabel = require("./CardLabel.js");
|
|
18
17
|
const require_CardTitle = require("./CardTitle.js");
|
|
19
18
|
const require_CardTitleMedia = require("./CardTitleMedia.js");
|
|
20
|
-
const require_CardCaption = require("./CardCaption.js");
|
|
21
19
|
const require_CardActions = require("./CardActions.js");
|
|
22
20
|
const require_CardAction = require("./CardAction.js");
|
|
23
21
|
let react = require("react");
|
|
24
22
|
react = require_runtime.__toESM(react);
|
|
25
23
|
let prop_types = require("prop-types");
|
|
26
24
|
prop_types = require_runtime.__toESM(prop_types);
|
|
25
|
+
let _carbon_react = require("@carbon/react");
|
|
27
26
|
//#region src/components/Card/next/Card.tsx
|
|
28
27
|
/**
|
|
29
28
|
* Copyright IBM Corp. 2026
|
|
@@ -37,36 +36,40 @@ const blockClass = `${require_settings.pkg.prefix}--card-next`;
|
|
|
37
36
|
/**
|
|
38
37
|
* Card component - Root container for composable card
|
|
39
38
|
*/
|
|
40
|
-
|
|
41
|
-
const hasAILabel = decorator
|
|
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]);
|
|
39
|
+
let CardComponent = (0, react.forwardRef)(({ clickable = false, onClick, onKeyDown, disabled = false, density = "productive", decorator, horizontal = false, className, children, ...rest }, ref) => {
|
|
40
|
+
const hasAILabel = (0, react.useMemo)(() => (0, react.isValidElement)(decorator) && decorator.type === _carbon_react.AILabel, [decorator]);
|
|
46
41
|
const contextValue = (0, react.useMemo)(() => ({
|
|
47
42
|
clickable,
|
|
48
43
|
disabled,
|
|
49
|
-
decorator
|
|
44
|
+
decorator,
|
|
45
|
+
horizontal
|
|
50
46
|
}), [
|
|
51
47
|
clickable,
|
|
52
48
|
disabled,
|
|
53
|
-
|
|
49
|
+
decorator,
|
|
50
|
+
horizontal
|
|
54
51
|
]);
|
|
55
|
-
const handleKeyDown = (event) => {
|
|
52
|
+
const handleKeyDown = (0, react.useCallback)((event) => {
|
|
56
53
|
if (clickable && !disabled && (event.key === "Enter" || event.key === " ")) {
|
|
57
54
|
event.preventDefault();
|
|
58
55
|
onClick?.(event);
|
|
59
56
|
}
|
|
60
57
|
onKeyDown?.(event);
|
|
61
|
-
}
|
|
62
|
-
|
|
58
|
+
}, [
|
|
59
|
+
clickable,
|
|
60
|
+
disabled,
|
|
61
|
+
onClick,
|
|
62
|
+
onKeyDown
|
|
63
|
+
]);
|
|
64
|
+
const handleClick = (0, react.useCallback)((event) => {
|
|
63
65
|
if (!disabled) onClick?.(event);
|
|
64
|
-
};
|
|
66
|
+
}, [disabled, onClick]);
|
|
65
67
|
const cardClasses = (0, import_classnames.default)(blockClass, className, {
|
|
66
68
|
[`${blockClass}--clickable`]: clickable && !disabled,
|
|
67
69
|
[`${blockClass}--disabled`]: disabled,
|
|
68
70
|
[`${blockClass}--${density}`]: density,
|
|
69
|
-
[`${blockClass}--has-ai-label`]: hasAILabel
|
|
71
|
+
[`${blockClass}--has-ai-label`]: hasAILabel,
|
|
72
|
+
[`${blockClass}--horizontal`]: horizontal
|
|
70
73
|
});
|
|
71
74
|
const cardProps = {
|
|
72
75
|
...rest,
|
|
@@ -80,9 +83,27 @@ const CardComponent = (0, react.forwardRef)(({ clickable = false, onClick, onKey
|
|
|
80
83
|
"aria-disabled": disabled
|
|
81
84
|
}
|
|
82
85
|
};
|
|
83
|
-
|
|
86
|
+
const { mediaChildren, contentChildren, mediaIsFirst } = (0, react.useMemo)(() => {
|
|
87
|
+
if (!horizontal) return {
|
|
88
|
+
mediaChildren: [],
|
|
89
|
+
contentChildren: [],
|
|
90
|
+
mediaIsFirst: false
|
|
91
|
+
};
|
|
92
|
+
const childArray = react.default.Children.toArray(children);
|
|
93
|
+
const isMedia = (child) => react.default.isValidElement(child) && child.type === require_CardMedia.CardMedia;
|
|
94
|
+
return {
|
|
95
|
+
mediaChildren: childArray.filter(isMedia),
|
|
96
|
+
contentChildren: childArray.filter((c) => !isMedia(c)),
|
|
97
|
+
mediaIsFirst: childArray.findIndex(isMedia) < childArray.findIndex((c) => !isMedia(c))
|
|
98
|
+
};
|
|
99
|
+
}, [children, horizontal]);
|
|
100
|
+
let renderedChildren = children;
|
|
101
|
+
if (horizontal) {
|
|
102
|
+
const contentWrapper = /* @__PURE__ */ react.default.createElement("div", { className: `${blockClass}__content` }, contentChildren);
|
|
103
|
+
renderedChildren = mediaIsFirst ? /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, mediaChildren, contentWrapper) : /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, contentWrapper, mediaChildren);
|
|
104
|
+
}
|
|
105
|
+
return /* @__PURE__ */ react.default.createElement(require_CardContext.CardContext.Provider, { value: contextValue }, /* @__PURE__ */ react.default.createElement("div", cardProps, renderedChildren));
|
|
84
106
|
});
|
|
85
|
-
CardComponent.displayName = componentName;
|
|
86
107
|
CardComponent.propTypes = {
|
|
87
108
|
/**
|
|
88
109
|
* Card content
|
|
@@ -109,6 +130,10 @@ CardComponent.propTypes = {
|
|
|
109
130
|
*/
|
|
110
131
|
disabled: prop_types.default.bool,
|
|
111
132
|
/**
|
|
133
|
+
* When true, renders media on the left and content (header/body/footer) on the right
|
|
134
|
+
*/
|
|
135
|
+
horizontal: prop_types.default.bool,
|
|
136
|
+
/**
|
|
112
137
|
* Click handler for clickable cards
|
|
113
138
|
*/
|
|
114
139
|
onClick: prop_types.default.func,
|
|
@@ -117,6 +142,8 @@ CardComponent.propTypes = {
|
|
|
117
142
|
*/
|
|
118
143
|
onKeyDown: prop_types.default.func
|
|
119
144
|
};
|
|
145
|
+
CardComponent = require_settings.pkg.checkComponentEnabled(CardComponent, componentName);
|
|
146
|
+
CardComponent.displayName = componentName;
|
|
120
147
|
/**
|
|
121
148
|
* -------
|
|
122
149
|
* Exports
|
|
@@ -132,14 +159,10 @@ const HeaderMedia = require_CardHeaderMedia.CardHeaderMedia;
|
|
|
132
159
|
HeaderMedia.displayName = "Card.HeaderMedia";
|
|
133
160
|
const Media = require_CardMedia.CardMedia;
|
|
134
161
|
Media.displayName = "Card.Media";
|
|
135
|
-
const Label = require_CardLabel.CardLabel;
|
|
136
|
-
Label.displayName = "Card.Label";
|
|
137
162
|
const Title = require_CardTitle.CardTitle;
|
|
138
163
|
Title.displayName = "Card.Title";
|
|
139
164
|
const TitleMedia = require_CardTitleMedia.CardTitleMedia;
|
|
140
165
|
TitleMedia.displayName = "Card.TitleMedia";
|
|
141
|
-
const Caption = require_CardCaption.CardCaption;
|
|
142
|
-
Caption.displayName = "Card.Caption";
|
|
143
166
|
const Actions = require_CardActions.CardActions;
|
|
144
167
|
Actions.displayName = "Card.Actions";
|
|
145
168
|
const Action = require_CardAction.CardAction;
|
|
@@ -150,10 +173,8 @@ const Card = Object.assign(CardComponent, {
|
|
|
150
173
|
Footer,
|
|
151
174
|
HeaderMedia,
|
|
152
175
|
Media,
|
|
153
|
-
Label,
|
|
154
176
|
Title,
|
|
155
177
|
TitleMedia,
|
|
156
|
-
Caption,
|
|
157
178
|
Actions,
|
|
158
179
|
Action
|
|
159
180
|
});
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import { ReactNode } from 'react';
|
|
7
|
+
import { ReactNode, MouseEvent, KeyboardEvent } from 'react';
|
|
8
8
|
/**
|
|
9
9
|
* Base props shared across card components
|
|
10
10
|
*/
|
|
@@ -29,11 +29,11 @@ export interface CardProps extends CardBaseProps {
|
|
|
29
29
|
/**
|
|
30
30
|
* Click handler for clickable cards
|
|
31
31
|
*/
|
|
32
|
-
onClick?: (event:
|
|
32
|
+
onClick?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
33
33
|
/**
|
|
34
34
|
* Keyboard event handler for clickable cards
|
|
35
35
|
*/
|
|
36
|
-
onKeyDown?: (event:
|
|
36
|
+
onKeyDown?: (event: KeyboardEvent<HTMLDivElement>) => void;
|
|
37
37
|
/**
|
|
38
38
|
* Disables the card and all interactive elements
|
|
39
39
|
*/
|
|
@@ -47,6 +47,11 @@ export interface CardProps extends CardBaseProps {
|
|
|
47
47
|
* Renders in the top-right corner of the card header with a blue gradient border.
|
|
48
48
|
*/
|
|
49
49
|
decorator?: ReactNode;
|
|
50
|
+
/**
|
|
51
|
+
* When true, the card renders in a horizontal layout: media on the left,
|
|
52
|
+
* header/body/footer stacked vertically on the right.
|
|
53
|
+
*/
|
|
54
|
+
horizontal?: boolean;
|
|
50
55
|
}
|
|
51
56
|
/**
|
|
52
57
|
* Props for CardHeader component
|
|
@@ -76,5 +81,9 @@ export interface CardContextValue {
|
|
|
76
81
|
* Optional decorator component (typically AILabel) to be rendered by CardHeader
|
|
77
82
|
*/
|
|
78
83
|
decorator?: ReactNode;
|
|
84
|
+
/**
|
|
85
|
+
* Whether the card is in horizontal layout mode
|
|
86
|
+
*/
|
|
87
|
+
horizontal: boolean;
|
|
79
88
|
}
|
|
80
89
|
//# 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;
|
|
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,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE7D;;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,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IACtD;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IAC3D;;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;IACtB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;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;IACtB;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;CACrB"}
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import React, { ReactNode } from 'react';
|
|
8
|
-
import PropTypes from 'prop-types';
|
|
9
8
|
export interface CardActionProps {
|
|
10
9
|
/**
|
|
11
10
|
* Provide the contents of the CardAction (typically a Button or IconButton).
|
|
@@ -17,6 +16,12 @@ export interface CardActionProps {
|
|
|
17
16
|
* Provide an optional class to be applied to the containing node.
|
|
18
17
|
*/
|
|
19
18
|
className?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Label shown in the overflow menu when this action is hidden.
|
|
21
|
+
* If not provided, CardActions will attempt to read it from the
|
|
22
|
+
* direct child's props (label, iconDescription, or children text).
|
|
23
|
+
*/
|
|
24
|
+
label?: string;
|
|
20
25
|
}
|
|
21
26
|
/**
|
|
22
27
|
* CardAction is a wrapper for interactive elements in the card footer.
|
|
@@ -26,18 +31,5 @@ export interface CardActionProps {
|
|
|
26
31
|
* Note: do not use CardAction inside a clickable card — clickable cards
|
|
27
32
|
* should not contain interactive elements (see usage guidelines).
|
|
28
33
|
*/
|
|
29
|
-
export declare
|
|
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
|
-
};
|
|
34
|
+
export declare let CardAction: React.ForwardRefExoticComponent<CardActionProps & React.RefAttributes<HTMLDivElement>>;
|
|
43
35
|
//# sourceMappingURL=CardAction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardAction.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/next/CardAction.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"CardAction.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/next/CardAction.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,EAAc,SAAS,EAAE,MAAM,OAAO,CAAC;AASrD,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,eAAO,IAAI,UAAU,wFAapB,CAAC"}
|
|
@@ -31,13 +31,14 @@ const componentName = "CardAction";
|
|
|
31
31
|
* Note: do not use CardAction inside a clickable card — clickable cards
|
|
32
32
|
* should not contain interactive elements (see usage guidelines).
|
|
33
33
|
*/
|
|
34
|
-
|
|
34
|
+
let CardAction = (0, react.forwardRef)(({ children, className, ...rest }, ref) => {
|
|
35
35
|
return /* @__PURE__ */ react.default.createElement("div", {
|
|
36
36
|
...rest,
|
|
37
|
+
ref,
|
|
37
38
|
className: (0, import_classnames.default)(`${blockClass}__action`, className),
|
|
38
39
|
...require_devtools.getDevtoolsProps(componentName)
|
|
39
40
|
}, children);
|
|
40
|
-
};
|
|
41
|
+
});
|
|
41
42
|
CardAction.propTypes = {
|
|
42
43
|
/**
|
|
43
44
|
* Provide the contents of the CardAction.
|
|
@@ -46,8 +47,18 @@ CardAction.propTypes = {
|
|
|
46
47
|
/**
|
|
47
48
|
* Provide an optional class to be applied to the containing node.
|
|
48
49
|
*/
|
|
49
|
-
className: prop_types.default.string
|
|
50
|
+
className: prop_types.default.string,
|
|
51
|
+
/**
|
|
52
|
+
* Label shown in the overflow menu when this action is hidden.
|
|
53
|
+
*/
|
|
54
|
+
label: prop_types.default.string
|
|
50
55
|
};
|
|
56
|
+
CardAction = require_settings.pkg.checkComponentEnabled(CardAction, componentName);
|
|
51
57
|
CardAction.displayName = componentName;
|
|
52
58
|
//#endregion
|
|
53
|
-
exports
|
|
59
|
+
Object.defineProperty(exports, "CardAction", {
|
|
60
|
+
enumerable: true,
|
|
61
|
+
get: function() {
|
|
62
|
+
return CardAction;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import React, { ReactNode } from 'react';
|
|
8
|
-
import PropTypes from 'prop-types';
|
|
9
8
|
export interface CardActionsProps {
|
|
10
9
|
/**
|
|
11
10
|
* Provide the contents of the CardActions (typically CardAction components).
|
|
@@ -25,22 +24,5 @@ export interface CardActionsProps {
|
|
|
25
24
|
* Positioned in the top-right corner with 8px gap between actions.
|
|
26
25
|
* When actions exceed 50% of available header space, overflow menu is shown.
|
|
27
26
|
*/
|
|
28
|
-
export declare
|
|
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
|
-
};
|
|
27
|
+
export declare let CardActions: React.ForwardRefExoticComponent<CardActionsProps & React.RefAttributes<HTMLDivElement>>;
|
|
46
28
|
//# sourceMappingURL=CardActions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardActions.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/next/CardActions.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"CardActions.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/next/CardActions.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,EAEZ,SAAS,EAMV,MAAM,OAAO,CAAC;AAYf,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,IAAI,WAAW,yFAwGrB,CAAC"}
|
|
@@ -30,27 +30,28 @@ const componentName = "CardActions";
|
|
|
30
30
|
* Positioned in the top-right corner with 8px gap between actions.
|
|
31
31
|
* When actions exceed 50% of available header space, overflow menu is shown.
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
let CardActions = (0, react.forwardRef)(({ children, className, overflowMenuLabel = "More actions", ...rest }, ref) => {
|
|
34
34
|
const containerRef = (0, react.useRef)(null);
|
|
35
35
|
const [hiddenItems, setHiddenItems] = (0, react.useState)([]);
|
|
36
36
|
const classes = (0, import_classnames.default)(`${blockClass}__actions`, className);
|
|
37
|
-
const actionItems =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
|
|
37
|
+
const actionItems = (0, react.useMemo)(() => {
|
|
38
|
+
const items = [];
|
|
39
|
+
react.Children.forEach(children, (child, index) => {
|
|
40
|
+
if (react.default.isValidElement(child)) {
|
|
41
|
+
const actionProps = child.props;
|
|
42
|
+
const button = actionProps.children;
|
|
43
|
+
const buttonProps = react.default.isValidElement(button) ? button.props : null;
|
|
44
|
+
const label = actionProps.label ?? buttonProps?.label ?? buttonProps?.iconDescription ?? (typeof buttonProps?.children === "string" ? buttonProps.children : `Action ${index + 1}`);
|
|
45
|
+
const id = `${label}-${index}`;
|
|
46
|
+
items.push({
|
|
47
|
+
id,
|
|
48
|
+
element: child,
|
|
49
|
+
label
|
|
50
|
+
});
|
|
46
51
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
label
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
});
|
|
52
|
+
});
|
|
53
|
+
return items;
|
|
54
|
+
}, [children]);
|
|
54
55
|
(0, react.useEffect)(() => {
|
|
55
56
|
if (!containerRef.current || actionItems.length === 0) return;
|
|
56
57
|
const handler = (0, _carbon_utilities.createOverflowHandler)({
|
|
@@ -63,7 +64,11 @@ const CardActions = ({ children, className, overflowMenuLabel = "More actions",
|
|
|
63
64
|
return () => handler.disconnect();
|
|
64
65
|
}, [children]);
|
|
65
66
|
return /* @__PURE__ */ react.default.createElement("div", {
|
|
66
|
-
ref:
|
|
67
|
+
ref: (node) => {
|
|
68
|
+
containerRef.current = node;
|
|
69
|
+
if (typeof ref === "function") ref(node);
|
|
70
|
+
else if (ref) ref.current = node;
|
|
71
|
+
},
|
|
67
72
|
className: classes,
|
|
68
73
|
...rest,
|
|
69
74
|
...require_devtools.getDevtoolsProps(componentName)
|
|
@@ -73,8 +78,7 @@ const CardActions = ({ children, className, overflowMenuLabel = "More actions",
|
|
|
73
78
|
}, item.element)), /* @__PURE__ */ react.default.createElement("div", {
|
|
74
79
|
"data-offset": true,
|
|
75
80
|
"data-hidden": true,
|
|
76
|
-
"data-floating-menu-container": true
|
|
77
|
-
style: { position: "relative" }
|
|
81
|
+
"data-floating-menu-container": true
|
|
78
82
|
}, /* @__PURE__ */ react.default.createElement(_carbon_react.FeatureFlags, { enableV12Overflowmenu: true }, /* @__PURE__ */ react.default.createElement(_carbon_react.OverflowMenu, {
|
|
79
83
|
size: "sm",
|
|
80
84
|
"aria-label": overflowMenuLabel
|
|
@@ -89,7 +93,7 @@ const CardActions = ({ children, className, overflowMenuLabel = "More actions",
|
|
|
89
93
|
}
|
|
90
94
|
}
|
|
91
95
|
}))))));
|
|
92
|
-
};
|
|
96
|
+
});
|
|
93
97
|
CardActions.propTypes = {
|
|
94
98
|
/**
|
|
95
99
|
* Provide the contents of the CardActions.
|
|
@@ -104,6 +108,12 @@ CardActions.propTypes = {
|
|
|
104
108
|
*/
|
|
105
109
|
overflowMenuLabel: prop_types.default.string
|
|
106
110
|
};
|
|
111
|
+
CardActions = require_settings.pkg.checkComponentEnabled(CardActions, componentName);
|
|
107
112
|
CardActions.displayName = componentName;
|
|
108
113
|
//#endregion
|
|
109
|
-
exports
|
|
114
|
+
Object.defineProperty(exports, "CardActions", {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
get: function() {
|
|
117
|
+
return CardActions;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
@@ -8,5 +8,5 @@ import React from 'react';
|
|
|
8
8
|
/**
|
|
9
9
|
* CardBody component - Body section of the card for free-form content
|
|
10
10
|
*/
|
|
11
|
-
export declare
|
|
11
|
+
export declare let CardBody: React.ForwardRefExoticComponent<import("./Card.types").CardBaseProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
12
|
//# sourceMappingURL=CardBody.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardBody.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/next/CardBody.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAqB,MAAM,OAAO,CAAC;AAU1C;;GAEG;AACH,eAAO,
|
|
1
|
+
{"version":3,"file":"CardBody.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/next/CardBody.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAqB,MAAM,OAAO,CAAC;AAU1C;;GAEG;AACH,eAAO,IAAI,QAAQ,6GAUlB,CAAC"}
|
|
@@ -25,7 +25,7 @@ const blockClass = `${require_settings.pkg.prefix}--card-next__body`;
|
|
|
25
25
|
/**
|
|
26
26
|
* CardBody component - Body section of the card for free-form content
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
let CardBody = (0, react.forwardRef)(({ className, children, ...rest }, ref) => {
|
|
29
29
|
const bodyClasses = (0, import_classnames.default)(blockClass, className);
|
|
30
30
|
return /* @__PURE__ */ react.default.createElement("div", {
|
|
31
31
|
...rest,
|
|
@@ -33,7 +33,6 @@ const CardBody = (0, react.forwardRef)(({ className, children, ...rest }, ref) =
|
|
|
33
33
|
className: bodyClasses
|
|
34
34
|
}, children);
|
|
35
35
|
});
|
|
36
|
-
CardBody.displayName = componentName;
|
|
37
36
|
CardBody.propTypes = {
|
|
38
37
|
/**
|
|
39
38
|
* Body content
|
|
@@ -44,5 +43,12 @@ CardBody.propTypes = {
|
|
|
44
43
|
*/
|
|
45
44
|
className: prop_types.default.string
|
|
46
45
|
};
|
|
46
|
+
CardBody = require_settings.pkg.checkComponentEnabled(CardBody, componentName);
|
|
47
|
+
CardBody.displayName = componentName;
|
|
47
48
|
//#endregion
|
|
48
|
-
exports
|
|
49
|
+
Object.defineProperty(exports, "CardBody", {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
get: function() {
|
|
52
|
+
return CardBody;
|
|
53
|
+
}
|
|
54
|
+
});
|