@carbon/ibm-products 2.43.2-canary.304 → 2.43.2-canary.305
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 +12 -6
- 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 +12 -6
- 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 +12 -6
- 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 +12 -6
- 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/Card.d.ts +5 -1
- package/es/components/Card/Card.js +9 -2
- package/es/components/Card/CardHeader.d.ts +12 -2
- package/es/components/Card/CardHeader.js +17 -9
- package/es/components/ExpressiveCard/ExpressiveCard.d.ts +5 -0
- package/es/components/ExpressiveCard/ExpressiveCard.js +5 -0
- package/es/components/ProductiveCard/ProductiveCard.d.ts +5 -0
- package/es/components/ProductiveCard/ProductiveCard.js +4 -0
- package/lib/components/Card/Card.d.ts +5 -1
- package/lib/components/Card/Card.js +9 -2
- package/lib/components/Card/CardHeader.d.ts +12 -2
- package/lib/components/Card/CardHeader.js +17 -9
- package/lib/components/ExpressiveCard/ExpressiveCard.d.ts +5 -0
- package/lib/components/ExpressiveCard/ExpressiveCard.js +5 -0
- package/lib/components/ProductiveCard/ProductiveCard.d.ts +5 -0
- package/lib/components/ProductiveCard/ProductiveCard.js +4 -0
- package/package.json +3 -3
- package/scss/components/Card/_card.scss +14 -6
@@ -16,7 +16,7 @@ import { CardFooter } from './CardFooter.js';
|
|
16
16
|
import { pkg } from '../../settings.js';
|
17
17
|
|
18
18
|
var _Incomplete, _CheckmarkOutline;
|
19
|
-
var _excluded = ["actionIcons", "actionsPlacement", "metadata", "children", "className", "clickZone", "description", "disabled", "footerActionIcon", "getStarted", "label", "media", "mediaPosition", "onClick", "onKeyDown", "onPrimaryButtonClick", "overflowActions", "overflowAriaLabel", "onSecondaryButtonClick", "pictogram", "primaryButtonDisabled", "primaryButtonHref", "primaryButtonIcon", "primaryButtonKind", "primaryButtonPlacement", "primaryButtonText", "productive", "secondaryButtonDisabled", "secondaryButtonHref", "secondaryButtonIcon", "secondaryButtonKind", "secondaryButtonPlacement", "secondaryButtonText", "slug", "status", "sequence", "title", "titleSize", "iconDescription"],
|
19
|
+
var _excluded = ["actionIcons", "actionsPlacement", "aiLabel", "metadata", "children", "className", "clickZone", "description", "disabled", "footerActionIcon", "getStarted", "label", "media", "mediaPosition", "onClick", "onKeyDown", "onPrimaryButtonClick", "overflowActions", "overflowAriaLabel", "onSecondaryButtonClick", "pictogram", "primaryButtonDisabled", "primaryButtonHref", "primaryButtonIcon", "primaryButtonKind", "primaryButtonPlacement", "primaryButtonText", "productive", "secondaryButtonDisabled", "secondaryButtonHref", "secondaryButtonIcon", "secondaryButtonKind", "secondaryButtonPlacement", "secondaryButtonText", "slug", "status", "sequence", "title", "titleSize", "iconDescription"],
|
20
20
|
_excluded2 = ["id"],
|
21
21
|
_excluded3 = ["id", "icon", "onClick", "iconDescription", "href"];
|
22
22
|
var componentName = 'Card';
|
@@ -25,6 +25,7 @@ var Card = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
25
25
|
actionIcons = _ref$actionIcons === void 0 ? Object.freeze([]) : _ref$actionIcons,
|
26
26
|
_ref$actionsPlacement = _ref.actionsPlacement,
|
27
27
|
actionsPlacement = _ref$actionsPlacement === void 0 ? 'bottom' : _ref$actionsPlacement,
|
28
|
+
aiLabel = _ref.aiLabel,
|
28
29
|
_ref$metadata = _ref.metadata,
|
29
30
|
metadata = _ref$metadata === void 0 ? Object.freeze([]) : _ref$metadata,
|
30
31
|
children = _ref.children,
|
@@ -166,7 +167,7 @@ var Card = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
166
167
|
var clickable = hasClickEvent && !productive || hasClickEvent && productive && clickZone === 'one';
|
167
168
|
var cardProps = _objectSpread2(_objectSpread2({}, rest), {}, {
|
168
169
|
ref: ref,
|
169
|
-
className: cx(blockClass, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(blockClass, "__disabled"), disabled), "".concat(blockClass, "__get-started"), getStarted), "".concat(blockClass, "__productive"), productive), "".concat(blockClass, "__clickable"), clickable), "".concat(blockClass, "__media-left"), mediaPosition === 'left'), "".concat(blockClass, "--has-slug"), !!slug), className)
|
170
|
+
className: cx(blockClass, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(blockClass, "__disabled"), disabled), "".concat(blockClass, "__get-started"), getStarted), "".concat(blockClass, "__productive"), productive), "".concat(blockClass, "__clickable"), clickable), "".concat(blockClass, "__media-left"), mediaPosition === 'left'), "".concat(blockClass, "--has-slug"), !!slug), "".concat(blockClass, "--has-ai-label"), !!aiLabel), className)
|
170
171
|
}, clickable && clickableProps);
|
171
172
|
return cardProps;
|
172
173
|
};
|
@@ -182,6 +183,7 @@ var Card = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
182
183
|
var getHeaderProps = function getHeaderProps() {
|
183
184
|
return {
|
184
185
|
actions: actionsPlacement === 'top' ? getActions() : '',
|
186
|
+
aiLabel: aiLabel,
|
185
187
|
noActionIcons: getIcons().length > 0 && actionsPlacement === 'top' ? false : true,
|
186
188
|
actionsPlacement: actionsPlacement,
|
187
189
|
onPrimaryButtonClick: onPrimaryButtonClick,
|
@@ -265,6 +267,10 @@ Card.propTypes = {
|
|
265
267
|
href: PropTypes.string
|
266
268
|
})),
|
267
269
|
actionsPlacement: PropTypes.oneOf(['top', 'bottom']),
|
270
|
+
/**
|
271
|
+
* Optional prop that is intended for any scenario where something is being generated by AI to reinforce AI transparency, accountability, and explainability at the UI level.
|
272
|
+
*/
|
273
|
+
aiLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.bool]),
|
268
274
|
children: PropTypes.node,
|
269
275
|
className: PropTypes.string,
|
270
276
|
clickZone: PropTypes.oneOf(['one', 'two', 'three']),
|
@@ -316,6 +322,7 @@ Card.propTypes = {
|
|
316
322
|
/**
|
317
323
|
* **Experimental:** For all cases a `Slug` component can be provided.
|
318
324
|
* Clickable tiles only accept a boolean value of true and display a hollow slug.
|
325
|
+
* @deprecated please use the `aiLabel` prop
|
319
326
|
*/
|
320
327
|
slug: PropTypes.oneOfType([PropTypes.node, PropTypes.bool]),
|
321
328
|
status: PropTypes.oneOf(['complete', 'incomplete']),
|
@@ -1,7 +1,11 @@
|
|
1
1
|
import React, { ReactNode } from 'react';
|
2
2
|
import PropTypes from 'prop-types';
|
3
3
|
interface CardHeaderProps {
|
4
|
-
actions?: ReactNode
|
4
|
+
actions?: ReactNode;
|
5
|
+
/**
|
6
|
+
* Optional prop that is intended for any scenario where something is being generated by AI to reinforce AI transparency, accountability, and explainability at the UI level.
|
7
|
+
*/
|
8
|
+
aiLabel?: ReactNode | boolean;
|
5
9
|
description?: ReactNode;
|
6
10
|
hasActions?: boolean;
|
7
11
|
/**
|
@@ -25,16 +29,21 @@ interface CardHeaderProps {
|
|
25
29
|
/**
|
26
30
|
* **Experimental:** For all cases a `Slug` component can be provided.
|
27
31
|
* Clickable tiles only accept a boolean value of true and display a hollow slug.
|
32
|
+
* @deprecated please use the `aiLabel` prop
|
28
33
|
*/
|
29
34
|
slug?: ReactNode;
|
30
35
|
title?: ReactNode;
|
31
36
|
titleSize?: 'default' | 'large';
|
32
37
|
}
|
33
38
|
export declare const CardHeader: {
|
34
|
-
({ actions, noActionIcons, onPrimaryButtonClick, onSecondaryButtonClick, primaryButtonIcon, primaryButtonPlacement, primaryButtonText, primaryButtonDisabled, description, hasActions, inClickableCard, label, secondaryButtonDisabled, secondaryButtonHref, secondaryButtonIcon, secondaryButtonPlacement, secondaryButtonText, slug, title, titleSize, }: CardHeaderProps): import("react/jsx-runtime").JSX.Element;
|
39
|
+
({ actions, aiLabel, noActionIcons, onPrimaryButtonClick, onSecondaryButtonClick, primaryButtonIcon, primaryButtonPlacement, primaryButtonText, primaryButtonDisabled, description, hasActions, inClickableCard, label, secondaryButtonDisabled, secondaryButtonHref, secondaryButtonIcon, secondaryButtonPlacement, secondaryButtonText, slug, title, titleSize, }: CardHeaderProps): import("react/jsx-runtime").JSX.Element;
|
35
40
|
/**@ts-ignore */
|
36
41
|
propTypes: {
|
37
42
|
actions: PropTypes.Requireable<NonNullable<any[] | PropTypes.ReactNodeLike>>;
|
43
|
+
/**
|
44
|
+
* Optional prop that is intended for any scenario where something is being generated by AI to reinforce AI transparency, accountability, and explainability at the UI level.
|
45
|
+
*/
|
46
|
+
aiLabel: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
38
47
|
description: PropTypes.Requireable<NonNullable<object | PropTypes.ReactNodeLike>>;
|
39
48
|
hasActions: PropTypes.Requireable<boolean>;
|
40
49
|
/**
|
@@ -58,6 +67,7 @@ export declare const CardHeader: {
|
|
58
67
|
/**
|
59
68
|
* **Experimental:** For all cases a `Slug` component can be provided.
|
60
69
|
* Clickable tiles only accept a boolean value of true and display a hollow slug.
|
70
|
+
* @deprecated please use the `aiLabel` prop
|
61
71
|
*/
|
62
72
|
slug: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
63
73
|
title: PropTypes.Requireable<NonNullable<object | PropTypes.ReactNodeLike>>;
|
@@ -20,6 +20,7 @@ var defaults = {
|
|
20
20
|
};
|
21
21
|
var CardHeader = function CardHeader(_ref) {
|
22
22
|
var actions = _ref.actions,
|
23
|
+
aiLabel = _ref.aiLabel,
|
23
24
|
noActionIcons = _ref.noActionIcons,
|
24
25
|
onPrimaryButtonClick = _ref.onPrimaryButtonClick,
|
25
26
|
onSecondaryButtonClick = _ref.onSecondaryButtonClick,
|
@@ -47,8 +48,9 @@ var CardHeader = function CardHeader(_ref) {
|
|
47
48
|
var headerClasses = cx(headerClass, _defineProperty(_defineProperty(_defineProperty({}, "".concat(headerClass, "-label-only"), label && !title && !description), "".concat(headerClass, "-has-label"), !!label), "".concat(blockClass, "__title-lg"), titleSize === 'large'));
|
48
49
|
var actionGhostButton = "".concat(blockClass, "__actions-header-ghost-button");
|
49
50
|
var actionGhostButtonClass = cx(actionGhostButton, _defineProperty({}, "".concat(actionGhostButton, "--only"), noActionIcons));
|
50
|
-
var
|
51
|
-
className: "".concat(carbonPrefix, "--slug ").concat(carbonPrefix, "--slug-icon")
|
51
|
+
var hollowAiIcon = /*#__PURE__*/React__default.createElement("svg", {
|
52
|
+
className: "".concat(carbonPrefix, "--slug ").concat(carbonPrefix, "--slug-icon") // NOTE: We cannot change this to ai-label until carbon changes their classnames on their end
|
53
|
+
,
|
52
54
|
width: "24",
|
53
55
|
height: "24",
|
54
56
|
viewBox: "0 0 24 24",
|
@@ -63,12 +65,13 @@ var CardHeader = function CardHeader(_ref) {
|
|
63
65
|
d: "M13.2436 16H11.5996L10.9276 13.864H7.95164L7.29164 16H5.68364L8.49164 7.624H10.4596L13.2436 16ZM10.5436 12.508L9.46364 9.064H9.40364L8.33564 12.508H10.5436ZM17.9341 16H14.1301V14.728H15.2341V8.896H14.1301V7.624H17.9341V8.896H16.8181V14.728H17.9341V16Z",
|
64
66
|
fill: "#161616"
|
65
67
|
})));
|
66
|
-
var
|
67
|
-
if (slug) {
|
68
|
-
if (inClickableCard || typeof slug === 'boolean') {
|
69
|
-
|
68
|
+
var normalizedAiLabel = null;
|
69
|
+
if (aiLabel || slug) {
|
70
|
+
if (inClickableCard || typeof aiLabel === 'boolean' || typeof slug === 'boolean') {
|
71
|
+
normalizedAiLabel = hollowAiIcon;
|
70
72
|
} else {
|
71
|
-
|
73
|
+
var element = aiLabel || slug;
|
74
|
+
normalizedAiLabel = /*#__PURE__*/React__default.cloneElement(element, {
|
72
75
|
size: label && title || title && titleSize === 'large' ? 'sm' : 'xs'
|
73
76
|
});
|
74
77
|
}
|
@@ -76,7 +79,7 @@ var CardHeader = function CardHeader(_ref) {
|
|
76
79
|
return /*#__PURE__*/React__default.createElement("div", {
|
77
80
|
className: headerClasses
|
78
81
|
}, /*#__PURE__*/React__default.createElement("div", {
|
79
|
-
className: cx(["".concat(headerClass, "-container"), _defineProperty({}, "".concat(headerClass, "-container--has-slug"), !!slug), _defineProperty({}, "".concat(headerClass, "-container--has-actions"), !!hasActions), _defineProperty({}, "".concat(headerClass, "-container--large-tile-or-label"), title && (label || titleSize === 'large'))])
|
82
|
+
className: cx(["".concat(headerClass, "-container"), _defineProperty({}, "".concat(headerClass, "-container--has-slug"), !!slug), _defineProperty({}, "".concat(headerClass, "-container--has-ai-label"), !!aiLabel), _defineProperty({}, "".concat(headerClass, "-container--has-actions"), !!hasActions), _defineProperty({}, "".concat(headerClass, "-container--large-tile-or-label"), title && (label || titleSize === 'large'))])
|
80
83
|
}, /*#__PURE__*/React__default.createElement("div", {
|
81
84
|
className: "".concat(blockClass, "__title-container")
|
82
85
|
}, label && /*#__PURE__*/React__default.createElement("p", {
|
@@ -102,11 +105,15 @@ var CardHeader = function CardHeader(_ref) {
|
|
102
105
|
onClick: onPrimaryButtonClick,
|
103
106
|
className: actionGhostButtonClass,
|
104
107
|
disabled: primaryButtonDisabled
|
105
|
-
}, primaryButtonText)),
|
108
|
+
}, primaryButtonText)), normalizedAiLabel));
|
106
109
|
};
|
107
110
|
/**@ts-ignore */
|
108
111
|
CardHeader.propTypes = {
|
109
112
|
actions: PropTypes.oneOfType([PropTypes.array, PropTypes.node]),
|
113
|
+
/**
|
114
|
+
* Optional prop that is intended for any scenario where something is being generated by AI to reinforce AI transparency, accountability, and explainability at the UI level.
|
115
|
+
*/
|
116
|
+
aiLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.bool]),
|
110
117
|
description: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.node]),
|
111
118
|
hasActions: PropTypes.bool,
|
112
119
|
/**
|
@@ -130,6 +137,7 @@ CardHeader.propTypes = {
|
|
130
137
|
/**
|
131
138
|
* **Experimental:** For all cases a `Slug` component can be provided.
|
132
139
|
* Clickable tiles only accept a boolean value of true and display a hollow slug.
|
140
|
+
* @deprecated please use the `aiLabel` prop
|
133
141
|
*/
|
134
142
|
slug: PropTypes.oneOfType([PropTypes.node, PropTypes.bool]),
|
135
143
|
title: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.node]),
|
@@ -13,6 +13,10 @@ export interface ExpressiveCardProps extends PropsWithChildren {
|
|
13
13
|
* Icons that are displayed on card. Refer to design documentation for implementation guidelines. Note- href will supersede onClick
|
14
14
|
*/
|
15
15
|
actionIcons?: ActionIcon[];
|
16
|
+
/**
|
17
|
+
* Optional prop that is intended for any scenario where something is being generated by AI to reinforce AI transparency, accountability, and explainability at the UI level.
|
18
|
+
*/
|
19
|
+
aiLabel?: ReactNode | boolean;
|
16
20
|
/**
|
17
21
|
* Content that shows in the body of the card
|
18
22
|
*/
|
@@ -87,6 +91,7 @@ export interface ExpressiveCardProps extends PropsWithChildren {
|
|
87
91
|
/**
|
88
92
|
* **Experimental:** For all cases a `Slug` component can be provided.
|
89
93
|
* Clickable tiles only accept a boolean value of true and display a hollow slug.
|
94
|
+
* @deprecated please use the `aiLabel` prop
|
90
95
|
*/
|
91
96
|
slug?: ReactNode | boolean;
|
92
97
|
/**
|
@@ -36,6 +36,10 @@ ExpressiveCard.propTypes = {
|
|
36
36
|
iconDescription: PropTypes.string,
|
37
37
|
href: PropTypes.string
|
38
38
|
})),
|
39
|
+
/**
|
40
|
+
* Optional prop that is intended for any scenario where something is being generated by AI to reinforce AI transparency, accountability, and explainability at the UI level.
|
41
|
+
*/
|
42
|
+
aiLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.bool]),
|
39
43
|
/**
|
40
44
|
* Content that shows in the body of the card
|
41
45
|
*/
|
@@ -114,6 +118,7 @@ ExpressiveCard.propTypes = {
|
|
114
118
|
/**
|
115
119
|
* **Experimental:** For all cases a `Slug` component can be provided.
|
116
120
|
* Clickable tiles only accept a boolean value of true and display a hollow slug.
|
121
|
+
* @deprecated please use the `aiLabel` prop
|
117
122
|
*/
|
118
123
|
slug: PropTypes.oneOfType([PropTypes.node, PropTypes.bool]),
|
119
124
|
/**
|
@@ -21,6 +21,10 @@ export interface ProductiveCardProps extends PropsWithChildren {
|
|
21
21
|
* Icons that are displayed on card. Refer to design documentation for implementation guidelines. Note- href will supersede onClick
|
22
22
|
*/
|
23
23
|
actionIcons?: ActionIcon[];
|
24
|
+
/**
|
25
|
+
* Optional prop that is intended for any scenario where something is being generated by AI to reinforce AI transparency, accountability, and explainability at the UI level.
|
26
|
+
*/
|
27
|
+
aiLabel?: ReactNode | boolean;
|
24
28
|
/**
|
25
29
|
* Determines if the action icons are on the top or bottom of the card
|
26
30
|
*/
|
@@ -104,6 +108,7 @@ export interface ProductiveCardProps extends PropsWithChildren {
|
|
104
108
|
/**
|
105
109
|
* **Experimental:** For all cases a `Slug` component can be provided.
|
106
110
|
* Clickable tiles only accept a boolean value of true and display a hollow slug.
|
111
|
+
* @deprecated please use the `aiLabel` prop
|
107
112
|
*/
|
108
113
|
slug?: ReactNode | boolean;
|
109
114
|
/**
|
@@ -48,6 +48,10 @@ ProductiveCard.propTypes = {
|
|
48
48
|
* Determines if the action icons are on the top or bottom of the card
|
49
49
|
*/
|
50
50
|
actionsPlacement: PropTypes.oneOf(['top', 'bottom']),
|
51
|
+
/**
|
52
|
+
* Optional prop that is intended for any scenario where something is being generated by AI to reinforce AI transparency, accountability, and explainability at the UI level.
|
53
|
+
*/
|
54
|
+
aiLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.bool]),
|
51
55
|
/**
|
52
56
|
* Content that shows in the body of the card
|
53
57
|
*/
|
@@ -57,10 +57,14 @@ interface CardProp extends PropsWithChildren {
|
|
57
57
|
sequence?: number;
|
58
58
|
iconDescription?: string;
|
59
59
|
/**
|
60
|
-
* **Experimental?** For all cases a `Slug` component can be provided.
|
61
60
|
* Clickable tiles only accept a boolean value of true and display a hollow slug.
|
61
|
+
* @deprecated please use the `aiLabel` prop
|
62
62
|
*/
|
63
63
|
slug?: ReactNode | boolean;
|
64
|
+
/**
|
65
|
+
* Optional prop that is intended for any scenario where something is being generated by AI to reinforce AI transparency, accountability, and explainability at the UI level.
|
66
|
+
*/
|
67
|
+
aiLabel?: ReactNode | boolean;
|
64
68
|
status?: 'complete' | 'incomplete';
|
65
69
|
title?: ReactNode;
|
66
70
|
titleSize?: 'default' | 'large';
|
@@ -18,7 +18,7 @@ var CardFooter = require('./CardFooter.js');
|
|
18
18
|
var settings = require('../../settings.js');
|
19
19
|
|
20
20
|
var _Incomplete, _CheckmarkOutline;
|
21
|
-
var _excluded = ["actionIcons", "actionsPlacement", "metadata", "children", "className", "clickZone", "description", "disabled", "footerActionIcon", "getStarted", "label", "media", "mediaPosition", "onClick", "onKeyDown", "onPrimaryButtonClick", "overflowActions", "overflowAriaLabel", "onSecondaryButtonClick", "pictogram", "primaryButtonDisabled", "primaryButtonHref", "primaryButtonIcon", "primaryButtonKind", "primaryButtonPlacement", "primaryButtonText", "productive", "secondaryButtonDisabled", "secondaryButtonHref", "secondaryButtonIcon", "secondaryButtonKind", "secondaryButtonPlacement", "secondaryButtonText", "slug", "status", "sequence", "title", "titleSize", "iconDescription"],
|
21
|
+
var _excluded = ["actionIcons", "actionsPlacement", "aiLabel", "metadata", "children", "className", "clickZone", "description", "disabled", "footerActionIcon", "getStarted", "label", "media", "mediaPosition", "onClick", "onKeyDown", "onPrimaryButtonClick", "overflowActions", "overflowAriaLabel", "onSecondaryButtonClick", "pictogram", "primaryButtonDisabled", "primaryButtonHref", "primaryButtonIcon", "primaryButtonKind", "primaryButtonPlacement", "primaryButtonText", "productive", "secondaryButtonDisabled", "secondaryButtonHref", "secondaryButtonIcon", "secondaryButtonKind", "secondaryButtonPlacement", "secondaryButtonText", "slug", "status", "sequence", "title", "titleSize", "iconDescription"],
|
22
22
|
_excluded2 = ["id"],
|
23
23
|
_excluded3 = ["id", "icon", "onClick", "iconDescription", "href"];
|
24
24
|
var componentName = 'Card';
|
@@ -27,6 +27,7 @@ var Card = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
27
27
|
actionIcons = _ref$actionIcons === void 0 ? Object.freeze([]) : _ref$actionIcons,
|
28
28
|
_ref$actionsPlacement = _ref.actionsPlacement,
|
29
29
|
actionsPlacement = _ref$actionsPlacement === void 0 ? 'bottom' : _ref$actionsPlacement,
|
30
|
+
aiLabel = _ref.aiLabel,
|
30
31
|
_ref$metadata = _ref.metadata,
|
31
32
|
metadata = _ref$metadata === void 0 ? Object.freeze([]) : _ref$metadata,
|
32
33
|
children = _ref.children,
|
@@ -168,7 +169,7 @@ var Card = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
168
169
|
var clickable = hasClickEvent && !productive || hasClickEvent && productive && clickZone === 'one';
|
169
170
|
var cardProps = _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, rest), {}, {
|
170
171
|
ref: ref,
|
171
|
-
className: cx(blockClass, _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__disabled"), disabled), "".concat(blockClass, "__get-started"), getStarted), "".concat(blockClass, "__productive"), productive), "".concat(blockClass, "__clickable"), clickable), "".concat(blockClass, "__media-left"), mediaPosition === 'left'), "".concat(blockClass, "--has-slug"), !!slug), className)
|
172
|
+
className: cx(blockClass, _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__disabled"), disabled), "".concat(blockClass, "__get-started"), getStarted), "".concat(blockClass, "__productive"), productive), "".concat(blockClass, "__clickable"), clickable), "".concat(blockClass, "__media-left"), mediaPosition === 'left'), "".concat(blockClass, "--has-slug"), !!slug), "".concat(blockClass, "--has-ai-label"), !!aiLabel), className)
|
172
173
|
}, clickable && clickableProps);
|
173
174
|
return cardProps;
|
174
175
|
};
|
@@ -184,6 +185,7 @@ var Card = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
184
185
|
var getHeaderProps = function getHeaderProps() {
|
185
186
|
return {
|
186
187
|
actions: actionsPlacement === 'top' ? getActions() : '',
|
188
|
+
aiLabel: aiLabel,
|
187
189
|
noActionIcons: getIcons().length > 0 && actionsPlacement === 'top' ? false : true,
|
188
190
|
actionsPlacement: actionsPlacement,
|
189
191
|
onPrimaryButtonClick: onPrimaryButtonClick,
|
@@ -267,6 +269,10 @@ Card.propTypes = {
|
|
267
269
|
href: index.default.string
|
268
270
|
})),
|
269
271
|
actionsPlacement: index.default.oneOf(['top', 'bottom']),
|
272
|
+
/**
|
273
|
+
* Optional prop that is intended for any scenario where something is being generated by AI to reinforce AI transparency, accountability, and explainability at the UI level.
|
274
|
+
*/
|
275
|
+
aiLabel: index.default.oneOfType([index.default.node, index.default.bool]),
|
270
276
|
children: index.default.node,
|
271
277
|
className: index.default.string,
|
272
278
|
clickZone: index.default.oneOf(['one', 'two', 'three']),
|
@@ -318,6 +324,7 @@ Card.propTypes = {
|
|
318
324
|
/**
|
319
325
|
* **Experimental:** For all cases a `Slug` component can be provided.
|
320
326
|
* Clickable tiles only accept a boolean value of true and display a hollow slug.
|
327
|
+
* @deprecated please use the `aiLabel` prop
|
321
328
|
*/
|
322
329
|
slug: index.default.oneOfType([index.default.node, index.default.bool]),
|
323
330
|
status: index.default.oneOf(['complete', 'incomplete']),
|
@@ -1,7 +1,11 @@
|
|
1
1
|
import React, { ReactNode } from 'react';
|
2
2
|
import PropTypes from 'prop-types';
|
3
3
|
interface CardHeaderProps {
|
4
|
-
actions?: ReactNode
|
4
|
+
actions?: ReactNode;
|
5
|
+
/**
|
6
|
+
* Optional prop that is intended for any scenario where something is being generated by AI to reinforce AI transparency, accountability, and explainability at the UI level.
|
7
|
+
*/
|
8
|
+
aiLabel?: ReactNode | boolean;
|
5
9
|
description?: ReactNode;
|
6
10
|
hasActions?: boolean;
|
7
11
|
/**
|
@@ -25,16 +29,21 @@ interface CardHeaderProps {
|
|
25
29
|
/**
|
26
30
|
* **Experimental:** For all cases a `Slug` component can be provided.
|
27
31
|
* Clickable tiles only accept a boolean value of true and display a hollow slug.
|
32
|
+
* @deprecated please use the `aiLabel` prop
|
28
33
|
*/
|
29
34
|
slug?: ReactNode;
|
30
35
|
title?: ReactNode;
|
31
36
|
titleSize?: 'default' | 'large';
|
32
37
|
}
|
33
38
|
export declare const CardHeader: {
|
34
|
-
({ actions, noActionIcons, onPrimaryButtonClick, onSecondaryButtonClick, primaryButtonIcon, primaryButtonPlacement, primaryButtonText, primaryButtonDisabled, description, hasActions, inClickableCard, label, secondaryButtonDisabled, secondaryButtonHref, secondaryButtonIcon, secondaryButtonPlacement, secondaryButtonText, slug, title, titleSize, }: CardHeaderProps): import("react/jsx-runtime").JSX.Element;
|
39
|
+
({ actions, aiLabel, noActionIcons, onPrimaryButtonClick, onSecondaryButtonClick, primaryButtonIcon, primaryButtonPlacement, primaryButtonText, primaryButtonDisabled, description, hasActions, inClickableCard, label, secondaryButtonDisabled, secondaryButtonHref, secondaryButtonIcon, secondaryButtonPlacement, secondaryButtonText, slug, title, titleSize, }: CardHeaderProps): import("react/jsx-runtime").JSX.Element;
|
35
40
|
/**@ts-ignore */
|
36
41
|
propTypes: {
|
37
42
|
actions: PropTypes.Requireable<NonNullable<any[] | PropTypes.ReactNodeLike>>;
|
43
|
+
/**
|
44
|
+
* Optional prop that is intended for any scenario where something is being generated by AI to reinforce AI transparency, accountability, and explainability at the UI level.
|
45
|
+
*/
|
46
|
+
aiLabel: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
38
47
|
description: PropTypes.Requireable<NonNullable<object | PropTypes.ReactNodeLike>>;
|
39
48
|
hasActions: PropTypes.Requireable<boolean>;
|
40
49
|
/**
|
@@ -58,6 +67,7 @@ export declare const CardHeader: {
|
|
58
67
|
/**
|
59
68
|
* **Experimental:** For all cases a `Slug` component can be provided.
|
60
69
|
* Clickable tiles only accept a boolean value of true and display a hollow slug.
|
70
|
+
* @deprecated please use the `aiLabel` prop
|
61
71
|
*/
|
62
72
|
slug: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
63
73
|
title: PropTypes.Requireable<NonNullable<object | PropTypes.ReactNodeLike>>;
|
@@ -22,6 +22,7 @@ var defaults = {
|
|
22
22
|
};
|
23
23
|
var CardHeader = function CardHeader(_ref) {
|
24
24
|
var actions = _ref.actions,
|
25
|
+
aiLabel = _ref.aiLabel,
|
25
26
|
noActionIcons = _ref.noActionIcons,
|
26
27
|
onPrimaryButtonClick = _ref.onPrimaryButtonClick,
|
27
28
|
onSecondaryButtonClick = _ref.onSecondaryButtonClick,
|
@@ -49,8 +50,9 @@ var CardHeader = function CardHeader(_ref) {
|
|
49
50
|
var headerClasses = cx(headerClass, _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(headerClass, "-label-only"), label && !title && !description), "".concat(headerClass, "-has-label"), !!label), "".concat(blockClass, "__title-lg"), titleSize === 'large'));
|
50
51
|
var actionGhostButton = "".concat(blockClass, "__actions-header-ghost-button");
|
51
52
|
var actionGhostButtonClass = cx(actionGhostButton, _rollupPluginBabelHelpers.defineProperty({}, "".concat(actionGhostButton, "--only"), noActionIcons));
|
52
|
-
var
|
53
|
-
className: "".concat(carbonPrefix, "--slug ").concat(carbonPrefix, "--slug-icon")
|
53
|
+
var hollowAiIcon = /*#__PURE__*/React.createElement("svg", {
|
54
|
+
className: "".concat(carbonPrefix, "--slug ").concat(carbonPrefix, "--slug-icon") // NOTE: We cannot change this to ai-label until carbon changes their classnames on their end
|
55
|
+
,
|
54
56
|
width: "24",
|
55
57
|
height: "24",
|
56
58
|
viewBox: "0 0 24 24",
|
@@ -65,12 +67,13 @@ var CardHeader = function CardHeader(_ref) {
|
|
65
67
|
d: "M13.2436 16H11.5996L10.9276 13.864H7.95164L7.29164 16H5.68364L8.49164 7.624H10.4596L13.2436 16ZM10.5436 12.508L9.46364 9.064H9.40364L8.33564 12.508H10.5436ZM17.9341 16H14.1301V14.728H15.2341V8.896H14.1301V7.624H17.9341V8.896H16.8181V14.728H17.9341V16Z",
|
66
68
|
fill: "#161616"
|
67
69
|
})));
|
68
|
-
var
|
69
|
-
if (slug) {
|
70
|
-
if (inClickableCard || typeof slug === 'boolean') {
|
71
|
-
|
70
|
+
var normalizedAiLabel = null;
|
71
|
+
if (aiLabel || slug) {
|
72
|
+
if (inClickableCard || typeof aiLabel === 'boolean' || typeof slug === 'boolean') {
|
73
|
+
normalizedAiLabel = hollowAiIcon;
|
72
74
|
} else {
|
73
|
-
|
75
|
+
var element = aiLabel || slug;
|
76
|
+
normalizedAiLabel = /*#__PURE__*/React.cloneElement(element, {
|
74
77
|
size: label && title || title && titleSize === 'large' ? 'sm' : 'xs'
|
75
78
|
});
|
76
79
|
}
|
@@ -78,7 +81,7 @@ var CardHeader = function CardHeader(_ref) {
|
|
78
81
|
return /*#__PURE__*/React.createElement("div", {
|
79
82
|
className: headerClasses
|
80
83
|
}, /*#__PURE__*/React.createElement("div", {
|
81
|
-
className: cx(["".concat(headerClass, "-container"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(headerClass, "-container--has-slug"), !!slug), _rollupPluginBabelHelpers.defineProperty({}, "".concat(headerClass, "-container--has-actions"), !!hasActions), _rollupPluginBabelHelpers.defineProperty({}, "".concat(headerClass, "-container--large-tile-or-label"), title && (label || titleSize === 'large'))])
|
84
|
+
className: cx(["".concat(headerClass, "-container"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(headerClass, "-container--has-slug"), !!slug), _rollupPluginBabelHelpers.defineProperty({}, "".concat(headerClass, "-container--has-ai-label"), !!aiLabel), _rollupPluginBabelHelpers.defineProperty({}, "".concat(headerClass, "-container--has-actions"), !!hasActions), _rollupPluginBabelHelpers.defineProperty({}, "".concat(headerClass, "-container--large-tile-or-label"), title && (label || titleSize === 'large'))])
|
82
85
|
}, /*#__PURE__*/React.createElement("div", {
|
83
86
|
className: "".concat(blockClass, "__title-container")
|
84
87
|
}, label && /*#__PURE__*/React.createElement("p", {
|
@@ -104,11 +107,15 @@ var CardHeader = function CardHeader(_ref) {
|
|
104
107
|
onClick: onPrimaryButtonClick,
|
105
108
|
className: actionGhostButtonClass,
|
106
109
|
disabled: primaryButtonDisabled
|
107
|
-
}, primaryButtonText)),
|
110
|
+
}, primaryButtonText)), normalizedAiLabel));
|
108
111
|
};
|
109
112
|
/**@ts-ignore */
|
110
113
|
CardHeader.propTypes = {
|
111
114
|
actions: index.default.oneOfType([index.default.array, index.default.node]),
|
115
|
+
/**
|
116
|
+
* Optional prop that is intended for any scenario where something is being generated by AI to reinforce AI transparency, accountability, and explainability at the UI level.
|
117
|
+
*/
|
118
|
+
aiLabel: index.default.oneOfType([index.default.node, index.default.bool]),
|
112
119
|
description: index.default.oneOfType([index.default.string, index.default.object, index.default.node]),
|
113
120
|
hasActions: index.default.bool,
|
114
121
|
/**
|
@@ -132,6 +139,7 @@ CardHeader.propTypes = {
|
|
132
139
|
/**
|
133
140
|
* **Experimental:** For all cases a `Slug` component can be provided.
|
134
141
|
* Clickable tiles only accept a boolean value of true and display a hollow slug.
|
142
|
+
* @deprecated please use the `aiLabel` prop
|
135
143
|
*/
|
136
144
|
slug: index.default.oneOfType([index.default.node, index.default.bool]),
|
137
145
|
title: index.default.oneOfType([index.default.string, index.default.object, index.default.node]),
|
@@ -13,6 +13,10 @@ export interface ExpressiveCardProps extends PropsWithChildren {
|
|
13
13
|
* Icons that are displayed on card. Refer to design documentation for implementation guidelines. Note- href will supersede onClick
|
14
14
|
*/
|
15
15
|
actionIcons?: ActionIcon[];
|
16
|
+
/**
|
17
|
+
* Optional prop that is intended for any scenario where something is being generated by AI to reinforce AI transparency, accountability, and explainability at the UI level.
|
18
|
+
*/
|
19
|
+
aiLabel?: ReactNode | boolean;
|
16
20
|
/**
|
17
21
|
* Content that shows in the body of the card
|
18
22
|
*/
|
@@ -87,6 +91,7 @@ export interface ExpressiveCardProps extends PropsWithChildren {
|
|
87
91
|
/**
|
88
92
|
* **Experimental:** For all cases a `Slug` component can be provided.
|
89
93
|
* Clickable tiles only accept a boolean value of true and display a hollow slug.
|
94
|
+
* @deprecated please use the `aiLabel` prop
|
90
95
|
*/
|
91
96
|
slug?: ReactNode | boolean;
|
92
97
|
/**
|
@@ -38,6 +38,10 @@ exports.ExpressiveCard.propTypes = {
|
|
38
38
|
iconDescription: index.default.string,
|
39
39
|
href: index.default.string
|
40
40
|
})),
|
41
|
+
/**
|
42
|
+
* Optional prop that is intended for any scenario where something is being generated by AI to reinforce AI transparency, accountability, and explainability at the UI level.
|
43
|
+
*/
|
44
|
+
aiLabel: index.default.oneOfType([index.default.node, index.default.bool]),
|
41
45
|
/**
|
42
46
|
* Content that shows in the body of the card
|
43
47
|
*/
|
@@ -116,6 +120,7 @@ exports.ExpressiveCard.propTypes = {
|
|
116
120
|
/**
|
117
121
|
* **Experimental:** For all cases a `Slug` component can be provided.
|
118
122
|
* Clickable tiles only accept a boolean value of true and display a hollow slug.
|
123
|
+
* @deprecated please use the `aiLabel` prop
|
119
124
|
*/
|
120
125
|
slug: index.default.oneOfType([index.default.node, index.default.bool]),
|
121
126
|
/**
|
@@ -21,6 +21,10 @@ export interface ProductiveCardProps extends PropsWithChildren {
|
|
21
21
|
* Icons that are displayed on card. Refer to design documentation for implementation guidelines. Note- href will supersede onClick
|
22
22
|
*/
|
23
23
|
actionIcons?: ActionIcon[];
|
24
|
+
/**
|
25
|
+
* Optional prop that is intended for any scenario where something is being generated by AI to reinforce AI transparency, accountability, and explainability at the UI level.
|
26
|
+
*/
|
27
|
+
aiLabel?: ReactNode | boolean;
|
24
28
|
/**
|
25
29
|
* Determines if the action icons are on the top or bottom of the card
|
26
30
|
*/
|
@@ -104,6 +108,7 @@ export interface ProductiveCardProps extends PropsWithChildren {
|
|
104
108
|
/**
|
105
109
|
* **Experimental:** For all cases a `Slug` component can be provided.
|
106
110
|
* Clickable tiles only accept a boolean value of true and display a hollow slug.
|
111
|
+
* @deprecated please use the `aiLabel` prop
|
107
112
|
*/
|
108
113
|
slug?: ReactNode | boolean;
|
109
114
|
/**
|
@@ -50,6 +50,10 @@ exports.ProductiveCard.propTypes = {
|
|
50
50
|
* Determines if the action icons are on the top or bottom of the card
|
51
51
|
*/
|
52
52
|
actionsPlacement: index.default.oneOf(['top', 'bottom']),
|
53
|
+
/**
|
54
|
+
* Optional prop that is intended for any scenario where something is being generated by AI to reinforce AI transparency, accountability, and explainability at the UI level.
|
55
|
+
*/
|
56
|
+
aiLabel: index.default.oneOfType([index.default.node, index.default.bool]),
|
53
57
|
/**
|
54
58
|
* Content that shows in the body of the card
|
55
59
|
*/
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@carbon/ibm-products",
|
3
3
|
"description": "Carbon for IBM Products",
|
4
|
-
"version": "2.43.2-canary.
|
4
|
+
"version": "2.43.2-canary.305+5b94ed8d0",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "lib/index.js",
|
7
7
|
"module": "es/index.js",
|
@@ -96,7 +96,7 @@
|
|
96
96
|
"dependencies": {
|
97
97
|
"@babel/runtime": "^7.23.9",
|
98
98
|
"@carbon/feature-flags": "^0.22.0",
|
99
|
-
"@carbon/ibm-products-styles": "^2.39.1-canary.
|
99
|
+
"@carbon/ibm-products-styles": "^2.39.1-canary.315+5b94ed8d0",
|
100
100
|
"@carbon/telemetry": "^0.1.0",
|
101
101
|
"@dnd-kit/core": "^6.0.8",
|
102
102
|
"@dnd-kit/modifiers": "^7.0.0",
|
@@ -120,5 +120,5 @@
|
|
120
120
|
"react": "^16.8.6 || ^17.0.1 || ^18.2.0",
|
121
121
|
"react-dom": "^16.8.6 || ^17.0.1 || ^18.2.0"
|
122
122
|
},
|
123
|
-
"gitHead": "
|
123
|
+
"gitHead": "5b94ed8d01638db747277f104d9f7dd9ab2e0eb3"
|
124
124
|
}
|
@@ -5,6 +5,8 @@
|
|
5
5
|
// LICENSE file in the root directory of this source tree.
|
6
6
|
//
|
7
7
|
|
8
|
+
// NOTE: Please do not remove the duplicate `slug` and `ai-label` classes. We need both until slug is fully deprecated
|
9
|
+
|
8
10
|
// Standard imports.
|
9
11
|
@use '@carbon/styles/scss/theme' as *;
|
10
12
|
@use '@carbon/styles/scss/spacing' as *;
|
@@ -148,16 +150,19 @@ $block-class: #{c4p-settings.$pkg-prefix}--card;
|
|
148
150
|
right: $spacing-05;
|
149
151
|
}
|
150
152
|
|
151
|
-
.#{$block-class}__header-container--has-slug
|
153
|
+
.#{$block-class}__header-container--has-slug,
|
154
|
+
.#{$block-class}__header-container--has-ai-label {
|
152
155
|
width: 100%;
|
153
156
|
padding-right: $spacing-07;
|
154
157
|
}
|
155
158
|
|
156
|
-
.#{$block-class}__header-container--has-slug.#{$block-class}__header-container--has-actions
|
159
|
+
.#{$block-class}__header-container--has-slug.#{$block-class}__header-container--has-actions,
|
160
|
+
.#{$block-class}__header-container--has-ai-label.#{$block-class}__header-container--has-actions {
|
157
161
|
padding-right: $spacing-08;
|
158
162
|
}
|
159
163
|
|
160
|
-
.#{$block-class}__header-container--has-slug.#{$block-class}__header-container--large-tile-or-label
|
164
|
+
.#{$block-class}__header-container--has-slug.#{$block-class}__header-container--large-tile-or-label,
|
165
|
+
.#{$block-class}__header-container--has-ai-label.#{$block-class}__header-container--large-tile-or-label {
|
161
166
|
padding-right: $spacing-09;
|
162
167
|
}
|
163
168
|
|
@@ -170,7 +175,8 @@ $block-class: #{c4p-settings.$pkg-prefix}--card;
|
|
170
175
|
pointer-events: none;
|
171
176
|
}
|
172
177
|
|
173
|
-
.#{$block-class}--has-slug
|
178
|
+
.#{$block-class}--has-slug,
|
179
|
+
.#{$block-class}--has-ai-label {
|
174
180
|
@include utilities.ai-popover-gradient('default', 0, 'layer');
|
175
181
|
|
176
182
|
border: 1px solid transparent;
|
@@ -178,7 +184,8 @@ $block-class: #{c4p-settings.$pkg-prefix}--card;
|
|
178
184
|
0 4px 10px 2px $ai-drop-shadow;
|
179
185
|
}
|
180
186
|
|
181
|
-
.#{$block-class}__clickable.#{$block-class}--has-slug::before
|
187
|
+
.#{$block-class}__clickable.#{$block-class}--has-slug::before,
|
188
|
+
.#{$block-class}__clickable.#{$block-class}--has-ai-label::before {
|
182
189
|
@include utilities.ai-popover-gradient('hover', 0, 'layer');
|
183
190
|
|
184
191
|
position: absolute;
|
@@ -193,7 +200,8 @@ $block-class: #{c4p-settings.$pkg-prefix}--card;
|
|
193
200
|
transition: opacity $duration-fast-02 motion(standard, productive);
|
194
201
|
}
|
195
202
|
|
196
|
-
.#{$block-class}__clickable.#{$block-class}--has-slug:hover::before
|
203
|
+
.#{$block-class}__clickable.#{$block-class}--has-slug:hover::before,
|
204
|
+
.#{$block-class}__clickable.#{$block-class}--has-ai-label:hover::before {
|
197
205
|
opacity: 1;
|
198
206
|
}
|
199
207
|
|