@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
|
@@ -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,14 +14,13 @@ import { CardBody } from "./CardBody.js";
|
|
|
14
14
|
import { CardFooter } from "./CardFooter.js";
|
|
15
15
|
import { CardHeaderMedia } from "./CardHeaderMedia.js";
|
|
16
16
|
import { CardMedia } from "./CardMedia.js";
|
|
17
|
-
import { CardLabel } from "./CardLabel.js";
|
|
18
17
|
import { CardTitle } from "./CardTitle.js";
|
|
19
18
|
import { CardTitleMedia } from "./CardTitleMedia.js";
|
|
20
|
-
import { CardCaption } from "./CardCaption.js";
|
|
21
19
|
import { CardActions } from "./CardActions.js";
|
|
22
20
|
import { CardAction } from "./CardAction.js";
|
|
23
|
-
import React, { forwardRef, useMemo } from "react";
|
|
21
|
+
import React, { forwardRef, isValidElement, useCallback, useMemo } from "react";
|
|
24
22
|
import PropTypes from "prop-types";
|
|
23
|
+
import { AILabel } from "@carbon/react";
|
|
25
24
|
//#region src/components/Card/next/Card.tsx
|
|
26
25
|
/**
|
|
27
26
|
* Copyright IBM Corp. 2026
|
|
@@ -35,36 +34,40 @@ const blockClass = `${pkg.prefix}--card-next`;
|
|
|
35
34
|
/**
|
|
36
35
|
* Card component - Root container for composable card
|
|
37
36
|
*/
|
|
38
|
-
|
|
39
|
-
const hasAILabel = decorator
|
|
40
|
-
const normalizedDecorator = useMemo(() => {
|
|
41
|
-
if (hasAILabel && React.isValidElement(decorator)) return React.cloneElement(decorator, { size: "xs" });
|
|
42
|
-
return decorator;
|
|
43
|
-
}, [decorator, hasAILabel]);
|
|
37
|
+
let CardComponent = forwardRef(({ clickable = false, onClick, onKeyDown, disabled = false, density = "productive", decorator, horizontal = false, className, children, ...rest }, ref) => {
|
|
38
|
+
const hasAILabel = useMemo(() => isValidElement(decorator) && decorator.type === AILabel, [decorator]);
|
|
44
39
|
const contextValue = useMemo(() => ({
|
|
45
40
|
clickable,
|
|
46
41
|
disabled,
|
|
47
|
-
decorator
|
|
42
|
+
decorator,
|
|
43
|
+
horizontal
|
|
48
44
|
}), [
|
|
49
45
|
clickable,
|
|
50
46
|
disabled,
|
|
51
|
-
|
|
47
|
+
decorator,
|
|
48
|
+
horizontal
|
|
52
49
|
]);
|
|
53
|
-
const handleKeyDown = (event) => {
|
|
50
|
+
const handleKeyDown = useCallback((event) => {
|
|
54
51
|
if (clickable && !disabled && (event.key === "Enter" || event.key === " ")) {
|
|
55
52
|
event.preventDefault();
|
|
56
53
|
onClick?.(event);
|
|
57
54
|
}
|
|
58
55
|
onKeyDown?.(event);
|
|
59
|
-
}
|
|
60
|
-
|
|
56
|
+
}, [
|
|
57
|
+
clickable,
|
|
58
|
+
disabled,
|
|
59
|
+
onClick,
|
|
60
|
+
onKeyDown
|
|
61
|
+
]);
|
|
62
|
+
const handleClick = useCallback((event) => {
|
|
61
63
|
if (!disabled) onClick?.(event);
|
|
62
|
-
};
|
|
64
|
+
}, [disabled, onClick]);
|
|
63
65
|
const cardClasses = (0, import_classnames.default)(blockClass, className, {
|
|
64
66
|
[`${blockClass}--clickable`]: clickable && !disabled,
|
|
65
67
|
[`${blockClass}--disabled`]: disabled,
|
|
66
68
|
[`${blockClass}--${density}`]: density,
|
|
67
|
-
[`${blockClass}--has-ai-label`]: hasAILabel
|
|
69
|
+
[`${blockClass}--has-ai-label`]: hasAILabel,
|
|
70
|
+
[`${blockClass}--horizontal`]: horizontal
|
|
68
71
|
});
|
|
69
72
|
const cardProps = {
|
|
70
73
|
...rest,
|
|
@@ -78,9 +81,27 @@ const CardComponent = forwardRef(({ clickable = false, onClick, onKeyDown, disab
|
|
|
78
81
|
"aria-disabled": disabled
|
|
79
82
|
}
|
|
80
83
|
};
|
|
81
|
-
|
|
84
|
+
const { mediaChildren, contentChildren, mediaIsFirst } = useMemo(() => {
|
|
85
|
+
if (!horizontal) return {
|
|
86
|
+
mediaChildren: [],
|
|
87
|
+
contentChildren: [],
|
|
88
|
+
mediaIsFirst: false
|
|
89
|
+
};
|
|
90
|
+
const childArray = React.Children.toArray(children);
|
|
91
|
+
const isMedia = (child) => React.isValidElement(child) && child.type === CardMedia;
|
|
92
|
+
return {
|
|
93
|
+
mediaChildren: childArray.filter(isMedia),
|
|
94
|
+
contentChildren: childArray.filter((c) => !isMedia(c)),
|
|
95
|
+
mediaIsFirst: childArray.findIndex(isMedia) < childArray.findIndex((c) => !isMedia(c))
|
|
96
|
+
};
|
|
97
|
+
}, [children, horizontal]);
|
|
98
|
+
let renderedChildren = children;
|
|
99
|
+
if (horizontal) {
|
|
100
|
+
const contentWrapper = /* @__PURE__ */ React.createElement("div", { className: `${blockClass}__content` }, contentChildren);
|
|
101
|
+
renderedChildren = mediaIsFirst ? /* @__PURE__ */ React.createElement(React.Fragment, null, mediaChildren, contentWrapper) : /* @__PURE__ */ React.createElement(React.Fragment, null, contentWrapper, mediaChildren);
|
|
102
|
+
}
|
|
103
|
+
return /* @__PURE__ */ React.createElement(CardContext.Provider, { value: contextValue }, /* @__PURE__ */ React.createElement("div", cardProps, renderedChildren));
|
|
82
104
|
});
|
|
83
|
-
CardComponent.displayName = componentName;
|
|
84
105
|
CardComponent.propTypes = {
|
|
85
106
|
/**
|
|
86
107
|
* Card content
|
|
@@ -107,6 +128,10 @@ CardComponent.propTypes = {
|
|
|
107
128
|
*/
|
|
108
129
|
disabled: PropTypes.bool,
|
|
109
130
|
/**
|
|
131
|
+
* When true, renders media on the left and content (header/body/footer) on the right
|
|
132
|
+
*/
|
|
133
|
+
horizontal: PropTypes.bool,
|
|
134
|
+
/**
|
|
110
135
|
* Click handler for clickable cards
|
|
111
136
|
*/
|
|
112
137
|
onClick: PropTypes.func,
|
|
@@ -115,6 +140,8 @@ CardComponent.propTypes = {
|
|
|
115
140
|
*/
|
|
116
141
|
onKeyDown: PropTypes.func
|
|
117
142
|
};
|
|
143
|
+
CardComponent = pkg.checkComponentEnabled(CardComponent, componentName);
|
|
144
|
+
CardComponent.displayName = componentName;
|
|
118
145
|
/**
|
|
119
146
|
* -------
|
|
120
147
|
* Exports
|
|
@@ -130,14 +157,10 @@ const HeaderMedia = CardHeaderMedia;
|
|
|
130
157
|
HeaderMedia.displayName = "Card.HeaderMedia";
|
|
131
158
|
const Media = CardMedia;
|
|
132
159
|
Media.displayName = "Card.Media";
|
|
133
|
-
const Label = CardLabel;
|
|
134
|
-
Label.displayName = "Card.Label";
|
|
135
160
|
const Title = CardTitle;
|
|
136
161
|
Title.displayName = "Card.Title";
|
|
137
162
|
const TitleMedia = CardTitleMedia;
|
|
138
163
|
TitleMedia.displayName = "Card.TitleMedia";
|
|
139
|
-
const Caption = CardCaption;
|
|
140
|
-
Caption.displayName = "Card.Caption";
|
|
141
164
|
const Actions = CardActions;
|
|
142
165
|
Actions.displayName = "Card.Actions";
|
|
143
166
|
const Action = CardAction;
|
|
@@ -148,10 +171,8 @@ const Card = Object.assign(CardComponent, {
|
|
|
148
171
|
Footer,
|
|
149
172
|
HeaderMedia,
|
|
150
173
|
Media,
|
|
151
|
-
Label,
|
|
152
174
|
Title,
|
|
153
175
|
TitleMedia,
|
|
154
|
-
Caption,
|
|
155
176
|
Actions,
|
|
156
177
|
Action
|
|
157
178
|
});
|
|
@@ -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"}
|
|
@@ -9,7 +9,7 @@ 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
11
|
import { getDevtoolsProps } from "../../../global/js/utils/devtools.js";
|
|
12
|
-
import React from "react";
|
|
12
|
+
import React, { forwardRef } from "react";
|
|
13
13
|
import PropTypes from "prop-types";
|
|
14
14
|
//#region src/components/Card/next/CardAction.tsx
|
|
15
15
|
/**
|
|
@@ -29,13 +29,14 @@ const componentName = "CardAction";
|
|
|
29
29
|
* Note: do not use CardAction inside a clickable card — clickable cards
|
|
30
30
|
* should not contain interactive elements (see usage guidelines).
|
|
31
31
|
*/
|
|
32
|
-
|
|
32
|
+
let CardAction = forwardRef(({ children, className, ...rest }, ref) => {
|
|
33
33
|
return /* @__PURE__ */ React.createElement("div", {
|
|
34
34
|
...rest,
|
|
35
|
+
ref,
|
|
35
36
|
className: (0, import_classnames.default)(`${blockClass}__action`, className),
|
|
36
37
|
...getDevtoolsProps(componentName)
|
|
37
38
|
}, children);
|
|
38
|
-
};
|
|
39
|
+
});
|
|
39
40
|
CardAction.propTypes = {
|
|
40
41
|
/**
|
|
41
42
|
* Provide the contents of the CardAction.
|
|
@@ -44,8 +45,13 @@ CardAction.propTypes = {
|
|
|
44
45
|
/**
|
|
45
46
|
* Provide an optional class to be applied to the containing node.
|
|
46
47
|
*/
|
|
47
|
-
className: PropTypes.string
|
|
48
|
+
className: PropTypes.string,
|
|
49
|
+
/**
|
|
50
|
+
* Label shown in the overflow menu when this action is hidden.
|
|
51
|
+
*/
|
|
52
|
+
label: PropTypes.string
|
|
48
53
|
};
|
|
54
|
+
CardAction = pkg.checkComponentEnabled(CardAction, componentName);
|
|
49
55
|
CardAction.displayName = componentName;
|
|
50
56
|
//#endregion
|
|
51
57
|
export { CardAction };
|
|
@@ -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"}
|
|
@@ -9,7 +9,7 @@ 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
11
|
import { getDevtoolsProps } from "../../../global/js/utils/devtools.js";
|
|
12
|
-
import React, { Children, useEffect, useRef, useState } from "react";
|
|
12
|
+
import React, { Children, forwardRef, useEffect, useMemo, useRef, useState } from "react";
|
|
13
13
|
import PropTypes from "prop-types";
|
|
14
14
|
import { FeatureFlags, OverflowMenu, OverflowMenuItem } from "@carbon/react";
|
|
15
15
|
import { createOverflowHandler } from "@carbon/utilities";
|
|
@@ -28,27 +28,28 @@ const componentName = "CardActions";
|
|
|
28
28
|
* Positioned in the top-right corner with 8px gap between actions.
|
|
29
29
|
* When actions exceed 50% of available header space, overflow menu is shown.
|
|
30
30
|
*/
|
|
31
|
-
|
|
31
|
+
let CardActions = forwardRef(({ children, className, overflowMenuLabel = "More actions", ...rest }, ref) => {
|
|
32
32
|
const containerRef = useRef(null);
|
|
33
33
|
const [hiddenItems, setHiddenItems] = useState([]);
|
|
34
34
|
const classes = (0, import_classnames.default)(`${blockClass}__actions`, className);
|
|
35
|
-
const actionItems =
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
35
|
+
const actionItems = useMemo(() => {
|
|
36
|
+
const items = [];
|
|
37
|
+
Children.forEach(children, (child, index) => {
|
|
38
|
+
if (React.isValidElement(child)) {
|
|
39
|
+
const actionProps = child.props;
|
|
40
|
+
const button = actionProps.children;
|
|
41
|
+
const buttonProps = React.isValidElement(button) ? button.props : null;
|
|
42
|
+
const label = actionProps.label ?? buttonProps?.label ?? buttonProps?.iconDescription ?? (typeof buttonProps?.children === "string" ? buttonProps.children : `Action ${index + 1}`);
|
|
43
|
+
const id = `${label}-${index}`;
|
|
44
|
+
items.push({
|
|
45
|
+
id,
|
|
46
|
+
element: child,
|
|
47
|
+
label
|
|
48
|
+
});
|
|
44
49
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
label
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
});
|
|
50
|
+
});
|
|
51
|
+
return items;
|
|
52
|
+
}, [children]);
|
|
52
53
|
useEffect(() => {
|
|
53
54
|
if (!containerRef.current || actionItems.length === 0) return;
|
|
54
55
|
const handler = createOverflowHandler({
|
|
@@ -61,7 +62,11 @@ const CardActions = ({ children, className, overflowMenuLabel = "More actions",
|
|
|
61
62
|
return () => handler.disconnect();
|
|
62
63
|
}, [children]);
|
|
63
64
|
return /* @__PURE__ */ React.createElement("div", {
|
|
64
|
-
ref:
|
|
65
|
+
ref: (node) => {
|
|
66
|
+
containerRef.current = node;
|
|
67
|
+
if (typeof ref === "function") ref(node);
|
|
68
|
+
else if (ref) ref.current = node;
|
|
69
|
+
},
|
|
65
70
|
className: classes,
|
|
66
71
|
...rest,
|
|
67
72
|
...getDevtoolsProps(componentName)
|
|
@@ -71,8 +76,7 @@ const CardActions = ({ children, className, overflowMenuLabel = "More actions",
|
|
|
71
76
|
}, item.element)), /* @__PURE__ */ React.createElement("div", {
|
|
72
77
|
"data-offset": true,
|
|
73
78
|
"data-hidden": true,
|
|
74
|
-
"data-floating-menu-container": true
|
|
75
|
-
style: { position: "relative" }
|
|
79
|
+
"data-floating-menu-container": true
|
|
76
80
|
}, /* @__PURE__ */ React.createElement(FeatureFlags, { enableV12Overflowmenu: true }, /* @__PURE__ */ React.createElement(OverflowMenu, {
|
|
77
81
|
size: "sm",
|
|
78
82
|
"aria-label": overflowMenuLabel
|
|
@@ -87,7 +91,7 @@ const CardActions = ({ children, className, overflowMenuLabel = "More actions",
|
|
|
87
91
|
}
|
|
88
92
|
}
|
|
89
93
|
}))))));
|
|
90
|
-
};
|
|
94
|
+
});
|
|
91
95
|
CardActions.propTypes = {
|
|
92
96
|
/**
|
|
93
97
|
* Provide the contents of the CardActions.
|
|
@@ -102,6 +106,7 @@ CardActions.propTypes = {
|
|
|
102
106
|
*/
|
|
103
107
|
overflowMenuLabel: PropTypes.string
|
|
104
108
|
};
|
|
109
|
+
CardActions = pkg.checkComponentEnabled(CardActions, componentName);
|
|
105
110
|
CardActions.displayName = componentName;
|
|
106
111
|
//#endregion
|
|
107
112
|
export { CardActions };
|
|
@@ -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"}
|
|
@@ -23,7 +23,7 @@ const blockClass = `${pkg.prefix}--card-next__body`;
|
|
|
23
23
|
/**
|
|
24
24
|
* CardBody component - Body section of the card for free-form content
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
let CardBody = forwardRef(({ className, children, ...rest }, ref) => {
|
|
27
27
|
const bodyClasses = (0, import_classnames.default)(blockClass, className);
|
|
28
28
|
return /* @__PURE__ */ React.createElement("div", {
|
|
29
29
|
...rest,
|
|
@@ -31,7 +31,6 @@ const CardBody = forwardRef(({ className, children, ...rest }, ref) => {
|
|
|
31
31
|
className: bodyClasses
|
|
32
32
|
}, children);
|
|
33
33
|
});
|
|
34
|
-
CardBody.displayName = componentName;
|
|
35
34
|
CardBody.propTypes = {
|
|
36
35
|
/**
|
|
37
36
|
* Body content
|
|
@@ -42,5 +41,7 @@ CardBody.propTypes = {
|
|
|
42
41
|
*/
|
|
43
42
|
className: PropTypes.string
|
|
44
43
|
};
|
|
44
|
+
CardBody = pkg.checkComponentEnabled(CardBody, componentName);
|
|
45
|
+
CardBody.displayName = componentName;
|
|
45
46
|
//#endregion
|
|
46
47
|
export { CardBody };
|
|
@@ -8,5 +8,5 @@ import React from 'react';
|
|
|
8
8
|
/**
|
|
9
9
|
* CardFooter component - Footer section of the card
|
|
10
10
|
*/
|
|
11
|
-
export declare
|
|
11
|
+
export declare let CardFooter: React.ForwardRefExoticComponent<import("./Card.types").CardBaseProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
12
|
//# sourceMappingURL=CardFooter.d.ts.map
|
|
@@ -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;AAS1C;;GAEG;AACH,eAAO,
|
|
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,IAAI,UAAU,6GAUpB,CAAC"}
|
|
@@ -23,7 +23,7 @@ const blockClass = `${pkg.prefix}--card-next__footer`;
|
|
|
23
23
|
/**
|
|
24
24
|
* CardFooter component - Footer section of the card
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
let CardFooter = forwardRef(({ className, children, ...rest }, ref) => {
|
|
27
27
|
const footerClasses = (0, import_classnames.default)(blockClass, className);
|
|
28
28
|
return /* @__PURE__ */ React.createElement("div", {
|
|
29
29
|
...rest,
|
|
@@ -31,7 +31,6 @@ const CardFooter = forwardRef(({ className, children, ...rest }, ref) => {
|
|
|
31
31
|
className: footerClasses
|
|
32
32
|
}, children);
|
|
33
33
|
});
|
|
34
|
-
CardFooter.displayName = componentName;
|
|
35
34
|
CardFooter.propTypes = {
|
|
36
35
|
/**
|
|
37
36
|
* Footer content
|
|
@@ -42,5 +41,7 @@ CardFooter.propTypes = {
|
|
|
42
41
|
*/
|
|
43
42
|
className: PropTypes.string
|
|
44
43
|
};
|
|
44
|
+
CardFooter = pkg.checkComponentEnabled(CardFooter, componentName);
|
|
45
|
+
CardFooter.displayName = componentName;
|
|
45
46
|
//#endregion
|
|
46
47
|
export { CardFooter };
|
|
@@ -6,7 +6,13 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
/**
|
|
9
|
-
* CardHeader component - Header section of the card
|
|
9
|
+
* CardHeader component - Header section of the card.
|
|
10
|
+
* Layout is handled entirely by CSS Grid on __header:
|
|
11
|
+
* - CardHeaderMedia spans both columns (full-width row above the title area)
|
|
12
|
+
* - CardTitleMedia occupies column 1 (left icon slot)
|
|
13
|
+
* - CardTitle occupies column 2 (right text slot), or spans full width when
|
|
14
|
+
* CardTitleMedia is absent — detected by the :has selector in SCSS.
|
|
15
|
+
* No child-scanning or wrapper injection is needed.
|
|
10
16
|
*/
|
|
11
|
-
export declare
|
|
17
|
+
export declare let CardHeader: React.ForwardRefExoticComponent<import("./Card.types").CardBaseProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
18
|
//# sourceMappingURL=CardHeader.d.ts.map
|
|
@@ -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,KAAkC,MAAM,OAAO,CAAC;AAUvD;;;;;;;;GAQG;AACH,eAAO,IAAI,UAAU,6GA+BpB,CAAC"}
|