@carbon/ibm-products 2.54.0-canary.54 → 2.54.0-canary.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/css/index-full-carbon.css +17 -4
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +1 -1
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon-released-only.css +17 -4
  6. package/css/index-without-carbon-released-only.css.map +1 -1
  7. package/css/index-without-carbon-released-only.min.css +1 -1
  8. package/css/index-without-carbon-released-only.min.css.map +1 -1
  9. package/css/index-without-carbon.css +17 -4
  10. package/css/index-without-carbon.css.map +1 -1
  11. package/css/index-without-carbon.min.css +1 -1
  12. package/css/index-without-carbon.min.css.map +1 -1
  13. package/css/index.css +17 -4
  14. package/css/index.css.map +1 -1
  15. package/css/index.min.css +1 -1
  16. package/css/index.min.css.map +1 -1
  17. package/es/components/Card/Card.d.ts +3 -3
  18. package/es/components/Card/Card.js +10 -9
  19. package/es/components/Card/CardHeader.d.ts +7 -7
  20. package/es/components/Card/CardHeader.js +14 -12
  21. package/es/components/Coachmark/Coachmark.d.ts +5 -0
  22. package/es/components/Coachmark/Coachmark.js +11 -3
  23. package/es/components/ExpressiveCard/ExpressiveCard.d.ts +5 -5
  24. package/es/components/ExpressiveCard/ExpressiveCard.js +5 -5
  25. package/es/components/ProductiveCard/ProductiveCard.d.ts +3 -3
  26. package/es/components/ProductiveCard/ProductiveCard.js +4 -4
  27. package/lib/components/Card/Card.d.ts +3 -3
  28. package/lib/components/Card/Card.js +10 -9
  29. package/lib/components/Card/CardHeader.d.ts +7 -7
  30. package/lib/components/Card/CardHeader.js +14 -12
  31. package/lib/components/Coachmark/Coachmark.d.ts +5 -0
  32. package/lib/components/Coachmark/Coachmark.js +11 -3
  33. package/lib/components/ExpressiveCard/ExpressiveCard.d.ts +5 -5
  34. package/lib/components/ExpressiveCard/ExpressiveCard.js +5 -5
  35. package/lib/components/ProductiveCard/ProductiveCard.d.ts +3 -3
  36. package/lib/components/ProductiveCard/ProductiveCard.js +4 -4
  37. package/package.json +3 -3
  38. package/scss/components/Card/_card.scss +19 -5
@@ -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", "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"],
19
+ var _excluded = ["actionIcons", "actionsPlacement", "decorator", "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", "itemText"],
21
21
  _excluded3 = ["id", "icon", "onClick", "iconDescription", "href"];
22
22
  var componentName = 'Card';
@@ -25,7 +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
+ decorator = _ref.decorator,
29
29
  _ref$metadata = _ref.metadata,
30
30
  metadata = _ref$metadata === void 0 ? Object.freeze([]) : _ref$metadata,
31
31
  children = _ref.children,
@@ -168,10 +168,11 @@ var Card = /*#__PURE__*/forwardRef(function (_ref, ref) {
168
168
  return icons;
169
169
  };
170
170
  var getCardProps = function getCardProps() {
171
+ var _decorator$type, _decorator$type2;
171
172
  var clickable = hasClickEvent && !productive || hasClickEvent && productive && clickZone === 'one';
172
173
  var cardProps = _objectSpread2(_objectSpread2({}, rest), {}, {
173
174
  ref: ref,
174
- 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)
175
+ className: cx(blockClass, _defineProperty(_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-decorator"), !!decorator && ((_decorator$type = decorator['type']) === null || _decorator$type === void 0 ? void 0 : _decorator$type.displayName) !== 'AILabel'), "".concat(blockClass, "--has-ai-label"), !!decorator && ((_decorator$type2 = decorator['type']) === null || _decorator$type2 === void 0 ? void 0 : _decorator$type2.displayName) === 'AILabel'), className)
175
176
  }, clickable && clickableProps);
176
177
  return cardProps;
177
178
  };
@@ -187,7 +188,7 @@ var Card = /*#__PURE__*/forwardRef(function (_ref, ref) {
187
188
  var getHeaderProps = function getHeaderProps() {
188
189
  return {
189
190
  actions: actionsPlacement === 'top' ? getActions() : '',
190
- aiLabel: aiLabel,
191
+ decorator: decorator,
191
192
  noActionIcons: getIcons().length > 0 && actionsPlacement === 'top' ? false : true,
192
193
  actionsPlacement: actionsPlacement,
193
194
  onPrimaryButtonClick: onPrimaryButtonClick,
@@ -271,13 +272,13 @@ Card.propTypes = {
271
272
  href: PropTypes.string
272
273
  })),
273
274
  actionsPlacement: PropTypes.oneOf(['top', 'bottom']),
274
- /**
275
- * 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.
276
- */
277
- aiLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.bool]),
278
275
  children: PropTypes.node,
279
276
  className: PropTypes.string,
280
277
  clickZone: PropTypes.oneOf(['one', 'two', 'three']),
278
+ /**
279
+ * Optional prop that allows you to pass any component.
280
+ */
281
+ decorator: PropTypes.oneOfType([PropTypes.node, PropTypes.bool]),
281
282
  /**@ts-ignore */
282
283
  description: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
283
284
  disabled: PropTypes.bool,
@@ -326,7 +327,7 @@ Card.propTypes = {
326
327
  /**
327
328
  * **Experimental:** For all cases a `Slug` component can be provided.
328
329
  * Clickable tiles only accept a boolean value of true and display a hollow slug.
329
- * @deprecated please use the `aiLabel` prop
330
+ * @deprecated please use the `decorator` prop
330
331
  */
331
332
  slug: PropTypes.oneOfType([PropTypes.node, PropTypes.bool]),
332
333
  status: PropTypes.oneOf(['complete', 'incomplete']),
@@ -3,9 +3,9 @@ import PropTypes from 'prop-types';
3
3
  interface CardHeaderProps {
4
4
  actions?: ReactNode;
5
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.
6
+ * Optional prop that allows you to pass any component.
7
7
  */
8
- aiLabel?: ReactNode | boolean;
8
+ decorator?: ReactNode | boolean;
9
9
  description?: ReactNode;
10
10
  hasActions?: boolean;
11
11
  /**
@@ -29,21 +29,21 @@ interface CardHeaderProps {
29
29
  /**
30
30
  * **Experimental:** For all cases a `Slug` component can be provided.
31
31
  * Clickable tiles only accept a boolean value of true and display a hollow slug.
32
- * @deprecated please use the `aiLabel` prop
32
+ * @deprecated please use the `decorator` prop
33
33
  */
34
34
  slug?: ReactNode;
35
35
  title?: ReactNode;
36
36
  titleSize?: 'default' | 'large';
37
37
  }
38
38
  export declare const CardHeader: {
39
- ({ actions, aiLabel, noActionIcons, onPrimaryButtonClick, onSecondaryButtonClick, primaryButtonIcon, primaryButtonPlacement, primaryButtonText, primaryButtonDisabled, description, hasActions, inClickableCard, label, secondaryButtonDisabled, secondaryButtonHref, secondaryButtonIcon, secondaryButtonPlacement, secondaryButtonText, slug, title, titleSize, }: CardHeaderProps): React.JSX.Element;
39
+ ({ actions, decorator, noActionIcons, onPrimaryButtonClick, onSecondaryButtonClick, primaryButtonIcon, primaryButtonPlacement, primaryButtonText, primaryButtonDisabled, description, hasActions, inClickableCard, label, secondaryButtonDisabled, secondaryButtonHref, secondaryButtonIcon, secondaryButtonPlacement, secondaryButtonText, slug, title, titleSize, }: CardHeaderProps): React.JSX.Element;
40
40
  /**@ts-ignore */
41
41
  propTypes: {
42
42
  actions: PropTypes.Requireable<NonNullable<any[] | PropTypes.ReactNodeLike>>;
43
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.
44
+ * Optional prop that allows you to pass any component.
45
45
  */
46
- aiLabel: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
46
+ decorator: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
47
47
  description: PropTypes.Requireable<NonNullable<object | PropTypes.ReactNodeLike>>;
48
48
  hasActions: PropTypes.Requireable<boolean>;
49
49
  /**
@@ -67,7 +67,7 @@ export declare const CardHeader: {
67
67
  /**
68
68
  * **Experimental:** For all cases a `Slug` component can be provided.
69
69
  * Clickable tiles only accept a boolean value of true and display a hollow slug.
70
- * @deprecated please use the `aiLabel` prop
70
+ * @deprecated please use the `decorator` prop
71
71
  */
72
72
  slug: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
73
73
  title: PropTypes.Requireable<NonNullable<object | PropTypes.ReactNodeLike>>;
@@ -20,7 +20,7 @@ var defaults = {
20
20
  };
21
21
  var CardHeader = function CardHeader(_ref) {
22
22
  var actions = _ref.actions,
23
- aiLabel = _ref.aiLabel,
23
+ decorator = _ref.decorator,
24
24
  noActionIcons = _ref.noActionIcons,
25
25
  onPrimaryButtonClick = _ref.onPrimaryButtonClick,
26
26
  onSecondaryButtonClick = _ref.onSecondaryButtonClick,
@@ -65,13 +65,13 @@ var CardHeader = function CardHeader(_ref) {
65
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",
66
66
  fill: "#161616"
67
67
  })));
68
- var normalizedAiLabel = null;
69
- if (aiLabel || slug) {
70
- if (inClickableCard || typeof aiLabel === 'boolean' || typeof slug === 'boolean') {
71
- normalizedAiLabel = hollowAiIcon;
68
+ var normalizedDecorator = null;
69
+ if (decorator || slug) {
70
+ if (inClickableCard || typeof decorator === 'boolean' || typeof slug === 'boolean') {
71
+ normalizedDecorator = hollowAiIcon;
72
72
  } else {
73
- var element = aiLabel || slug;
74
- normalizedAiLabel = /*#__PURE__*/React__default.cloneElement(element, {
73
+ var element = decorator || slug;
74
+ normalizedDecorator = /*#__PURE__*/React__default.cloneElement(element, {
75
75
  size: label && title || title && titleSize === 'large' ? 'sm' : 'xs'
76
76
  });
77
77
  }
@@ -79,7 +79,7 @@ var CardHeader = function CardHeader(_ref) {
79
79
  return /*#__PURE__*/React__default.createElement("div", {
80
80
  className: headerClasses
81
81
  }, /*#__PURE__*/React__default.createElement("div", {
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'))])
82
+ className: cx(["".concat(headerClass, "-container"), _defineProperty({}, "".concat(headerClass, "-container--has-slug"), !!slug), _defineProperty({}, "".concat(headerClass, "-container--has-decorator"), !!decorator), _defineProperty({}, "".concat(headerClass, "-container--has-actions"), !!hasActions), _defineProperty({}, "".concat(headerClass, "-container--large-tile-or-label"), title && (label || titleSize === 'large'))])
83
83
  }, /*#__PURE__*/React__default.createElement("div", {
84
84
  className: "".concat(blockClass, "__title-container")
85
85
  }, label && /*#__PURE__*/React__default.createElement("p", {
@@ -105,15 +105,17 @@ var CardHeader = function CardHeader(_ref) {
105
105
  onClick: onPrimaryButtonClick,
106
106
  className: actionGhostButtonClass,
107
107
  disabled: primaryButtonDisabled
108
- }, primaryButtonText)), normalizedAiLabel));
108
+ }, primaryButtonText)), slug ? normalizedDecorator : decorator ? /*#__PURE__*/React__default.createElement("div", {
109
+ className: "".concat(blockClass, "__header__inner-wrapper--decorator")
110
+ }, normalizedDecorator) : ''));
109
111
  };
110
112
  /**@ts-ignore */
111
113
  CardHeader.propTypes = {
112
114
  actions: PropTypes.oneOfType([PropTypes.array, PropTypes.node]),
113
115
  /**
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.
116
+ * Optional prop that allows you to pass any component.
115
117
  */
116
- aiLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.bool]),
118
+ decorator: PropTypes.oneOfType([PropTypes.node, PropTypes.bool]),
117
119
  description: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.node]),
118
120
  hasActions: PropTypes.bool,
119
121
  /**
@@ -137,7 +139,7 @@ CardHeader.propTypes = {
137
139
  /**
138
140
  * **Experimental:** For all cases a `Slug` component can be provided.
139
141
  * Clickable tiles only accept a boolean value of true and display a hollow slug.
140
- * @deprecated please use the `aiLabel` prop
142
+ * @deprecated please use the `decorator` prop
141
143
  */
142
144
  slug: PropTypes.oneOfType([PropTypes.node, PropTypes.bool]),
143
145
  title: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.node]),
@@ -65,6 +65,11 @@ export interface CoachmarkProps {
65
65
  * Determines the theme of the component.
66
66
  */
67
67
  theme?: 'light' | 'dark';
68
+ /**
69
+ * Determines if the coachmark is open by default.
70
+ * Does nothing if `overlayKind=stacked`.
71
+ */
72
+ isOpenByDefault?: boolean;
68
73
  }
69
74
  /**
70
75
  * Coachmarks are used to call out specific functionality or concepts
@@ -20,7 +20,7 @@ import { throttle } from 'lodash';
20
20
  import { Popover, PopoverContent } from '@carbon/react';
21
21
  import { useIsomorphicEffect } from '../../global/js/hooks/useIsomorphicEffect.js';
22
22
 
23
- var _excluded = ["align", "autoAlign", "children", "className", "onClose", "overlayClassName", "overlayKind", "overlayRef", "positionTune", "portalTarget", "target", "theme"];
23
+ var _excluded = ["align", "autoAlign", "children", "className", "onClose", "overlayClassName", "overlayKind", "overlayRef", "positionTune", "portalTarget", "target", "theme", "isOpenByDefault"];
24
24
 
25
25
  // The block part of our conventional BEM class names (blockClass__E--M).
26
26
  var blockClass = "".concat(pkg.prefix, "--coachmark");
@@ -30,7 +30,8 @@ var defaults = {
30
30
  align: 'bottom',
31
31
  onClose: function onClose() {},
32
32
  overlayKind: 'tooltip',
33
- theme: 'light'
33
+ theme: 'light',
34
+ isOpenByDefault: false
34
35
  };
35
36
  /**
36
37
  * Coachmarks are used to call out specific functionality or concepts
@@ -55,10 +56,12 @@ var Coachmark = /*#__PURE__*/forwardRef(function (_ref, ref) {
55
56
  target = _ref.target,
56
57
  _ref$theme = _ref.theme,
57
58
  theme = _ref$theme === void 0 ? defaults.theme : _ref$theme,
59
+ _ref$isOpenByDefault = _ref.isOpenByDefault,
60
+ isOpenByDefault = _ref$isOpenByDefault === void 0 ? defaults.isOpenByDefault : _ref$isOpenByDefault,
58
61
  rest = _objectWithoutProperties(_ref, _excluded);
59
62
  var isBeacon = overlayKind === COACHMARK_OVERLAY_KIND.TOOLTIP;
60
63
  var isStacked = overlayKind === COACHMARK_OVERLAY_KIND.STACKED;
61
- var _useState = useState(isStacked),
64
+ var _useState = useState(isStacked || isOpenByDefault),
62
65
  _useState2 = _slicedToArray(_useState, 2),
63
66
  isOpen = _useState2[0],
64
67
  setIsOpen = _useState2[1];
@@ -250,6 +253,11 @@ Coachmark.propTypes = {
250
253
  * Optional class name for this component.
251
254
  */
252
255
  className: PropTypes.string,
256
+ /**
257
+ * Determines if the coachmark is open by default.
258
+ * Does nothing if `overlayKind=stacked`.
259
+ */
260
+ isOpenByDefault: PropTypes.bool,
253
261
  /**
254
262
  * Function to call when the Coachmark closes.
255
263
  */
@@ -13,10 +13,6 @@ 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;
20
16
  /**
21
17
  * Content that shows in the body of the card
22
18
  */
@@ -24,6 +20,10 @@ export interface ExpressiveCardProps extends PropsWithChildren {
24
20
  * Optional user provided class
25
21
  */
26
22
  className?: string;
23
+ /**
24
+ * Optional prop that allows you to pass any component.
25
+ */
26
+ decorator?: ReactNode | boolean;
27
27
  /**
28
28
  * Optional header description
29
29
  */
@@ -91,7 +91,7 @@ export interface ExpressiveCardProps extends PropsWithChildren {
91
91
  /**
92
92
  * **Experimental:** For all cases a `Slug` component can be provided.
93
93
  * Clickable tiles only accept a boolean value of true and display a hollow slug.
94
- * @deprecated please use the `aiLabel` prop
94
+ * @deprecated please use the `decorator` prop
95
95
  */
96
96
  slug?: ReactNode | boolean;
97
97
  /**
@@ -36,10 +36,6 @@ 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]),
43
39
  /**
44
40
  * Content that shows in the body of the card
45
41
  */
@@ -48,6 +44,10 @@ ExpressiveCard.propTypes = {
48
44
  * Optional user provided class
49
45
  */
50
46
  className: PropTypes.string,
47
+ /**
48
+ * Optional prop that allows you to pass any component.
49
+ */
50
+ decorator: PropTypes.oneOfType([PropTypes.node, PropTypes.bool]),
51
51
  /**
52
52
  * Optional header description
53
53
  */
@@ -118,7 +118,7 @@ ExpressiveCard.propTypes = {
118
118
  /**
119
119
  * **Experimental:** For all cases a `Slug` component can be provided.
120
120
  * Clickable tiles only accept a boolean value of true and display a hollow slug.
121
- * @deprecated please use the `aiLabel` prop
121
+ * @deprecated please use the `decorator` prop
122
122
  */
123
123
  slug: PropTypes.oneOfType([PropTypes.node, PropTypes.bool]),
124
124
  /**
@@ -22,9 +22,9 @@ export interface ProductiveCardProps extends PropsWithChildren {
22
22
  */
23
23
  actionIcons?: ActionIcon[];
24
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.
25
+ * Optional prop that allows you to pass any component.
26
26
  */
27
- aiLabel?: ReactNode | boolean;
27
+ decorator?: ReactNode | boolean;
28
28
  /**
29
29
  * Determines if the action icons are on the top or bottom of the card
30
30
  */
@@ -108,7 +108,7 @@ export interface ProductiveCardProps extends PropsWithChildren {
108
108
  /**
109
109
  * **Experimental:** For all cases a `Slug` component can be provided.
110
110
  * Clickable tiles only accept a boolean value of true and display a hollow slug.
111
- * @deprecated please use the `aiLabel` prop
111
+ * @deprecated please use the `decorator` prop
112
112
  */
113
113
  slug?: ReactNode | boolean;
114
114
  /**
@@ -48,10 +48,6 @@ 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]),
55
51
  /**
56
52
  * Content that shows in the body of the card
57
53
  */
@@ -64,6 +60,10 @@ ProductiveCard.propTypes = {
64
60
  * Designates which zones of the card are clickable. Refer to design documentation for implementation guidelines
65
61
  */
66
62
  clickZone: PropTypes.oneOf(['one', 'two', 'three']),
63
+ /**
64
+ * Optional prop that allows you to pass any component.
65
+ */
66
+ decorator: PropTypes.oneOfType([PropTypes.node, PropTypes.bool]),
67
67
  /**
68
68
  * Optional header description
69
69
  */
@@ -58,13 +58,13 @@ interface CardProp extends PropsWithChildren {
58
58
  iconDescription?: string;
59
59
  /**
60
60
  * Clickable tiles only accept a boolean value of true and display a hollow slug.
61
- * @deprecated please use the `aiLabel` prop
61
+ * @deprecated please use the `decorator` prop
62
62
  */
63
63
  slug?: ReactNode | boolean;
64
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.
65
+ * Optional prop that allows you to pass any component.
66
66
  */
67
- aiLabel?: ReactNode | boolean;
67
+ decorator?: ReactNode | boolean;
68
68
  status?: 'complete' | 'incomplete';
69
69
  title?: ReactNode;
70
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", "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"],
21
+ var _excluded = ["actionIcons", "actionsPlacement", "decorator", "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", "itemText"],
23
23
  _excluded3 = ["id", "icon", "onClick", "iconDescription", "href"];
24
24
  var componentName = 'Card';
@@ -27,7 +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
+ decorator = _ref.decorator,
31
31
  _ref$metadata = _ref.metadata,
32
32
  metadata = _ref$metadata === void 0 ? Object.freeze([]) : _ref$metadata,
33
33
  children = _ref.children,
@@ -170,10 +170,11 @@ var Card = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
170
170
  return icons;
171
171
  };
172
172
  var getCardProps = function getCardProps() {
173
+ var _decorator$type, _decorator$type2;
173
174
  var clickable = hasClickEvent && !productive || hasClickEvent && productive && clickZone === 'one';
174
175
  var cardProps = _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, rest), {}, {
175
176
  ref: ref,
176
- 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)
177
+ className: cx(blockClass, _rollupPluginBabelHelpers.defineProperty(_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-decorator"), !!decorator && ((_decorator$type = decorator['type']) === null || _decorator$type === void 0 ? void 0 : _decorator$type.displayName) !== 'AILabel'), "".concat(blockClass, "--has-ai-label"), !!decorator && ((_decorator$type2 = decorator['type']) === null || _decorator$type2 === void 0 ? void 0 : _decorator$type2.displayName) === 'AILabel'), className)
177
178
  }, clickable && clickableProps);
178
179
  return cardProps;
179
180
  };
@@ -189,7 +190,7 @@ var Card = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
189
190
  var getHeaderProps = function getHeaderProps() {
190
191
  return {
191
192
  actions: actionsPlacement === 'top' ? getActions() : '',
192
- aiLabel: aiLabel,
193
+ decorator: decorator,
193
194
  noActionIcons: getIcons().length > 0 && actionsPlacement === 'top' ? false : true,
194
195
  actionsPlacement: actionsPlacement,
195
196
  onPrimaryButtonClick: onPrimaryButtonClick,
@@ -273,13 +274,13 @@ Card.propTypes = {
273
274
  href: index.default.string
274
275
  })),
275
276
  actionsPlacement: index.default.oneOf(['top', 'bottom']),
276
- /**
277
- * 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.
278
- */
279
- aiLabel: index.default.oneOfType([index.default.node, index.default.bool]),
280
277
  children: index.default.node,
281
278
  className: index.default.string,
282
279
  clickZone: index.default.oneOf(['one', 'two', 'three']),
280
+ /**
281
+ * Optional prop that allows you to pass any component.
282
+ */
283
+ decorator: index.default.oneOfType([index.default.node, index.default.bool]),
283
284
  /**@ts-ignore */
284
285
  description: index.default.oneOfType([index.default.string, index.default.node]),
285
286
  disabled: index.default.bool,
@@ -328,7 +329,7 @@ Card.propTypes = {
328
329
  /**
329
330
  * **Experimental:** For all cases a `Slug` component can be provided.
330
331
  * Clickable tiles only accept a boolean value of true and display a hollow slug.
331
- * @deprecated please use the `aiLabel` prop
332
+ * @deprecated please use the `decorator` prop
332
333
  */
333
334
  slug: index.default.oneOfType([index.default.node, index.default.bool]),
334
335
  status: index.default.oneOf(['complete', 'incomplete']),
@@ -3,9 +3,9 @@ import PropTypes from 'prop-types';
3
3
  interface CardHeaderProps {
4
4
  actions?: ReactNode;
5
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.
6
+ * Optional prop that allows you to pass any component.
7
7
  */
8
- aiLabel?: ReactNode | boolean;
8
+ decorator?: ReactNode | boolean;
9
9
  description?: ReactNode;
10
10
  hasActions?: boolean;
11
11
  /**
@@ -29,21 +29,21 @@ interface CardHeaderProps {
29
29
  /**
30
30
  * **Experimental:** For all cases a `Slug` component can be provided.
31
31
  * Clickable tiles only accept a boolean value of true and display a hollow slug.
32
- * @deprecated please use the `aiLabel` prop
32
+ * @deprecated please use the `decorator` prop
33
33
  */
34
34
  slug?: ReactNode;
35
35
  title?: ReactNode;
36
36
  titleSize?: 'default' | 'large';
37
37
  }
38
38
  export declare const CardHeader: {
39
- ({ actions, aiLabel, noActionIcons, onPrimaryButtonClick, onSecondaryButtonClick, primaryButtonIcon, primaryButtonPlacement, primaryButtonText, primaryButtonDisabled, description, hasActions, inClickableCard, label, secondaryButtonDisabled, secondaryButtonHref, secondaryButtonIcon, secondaryButtonPlacement, secondaryButtonText, slug, title, titleSize, }: CardHeaderProps): React.JSX.Element;
39
+ ({ actions, decorator, noActionIcons, onPrimaryButtonClick, onSecondaryButtonClick, primaryButtonIcon, primaryButtonPlacement, primaryButtonText, primaryButtonDisabled, description, hasActions, inClickableCard, label, secondaryButtonDisabled, secondaryButtonHref, secondaryButtonIcon, secondaryButtonPlacement, secondaryButtonText, slug, title, titleSize, }: CardHeaderProps): React.JSX.Element;
40
40
  /**@ts-ignore */
41
41
  propTypes: {
42
42
  actions: PropTypes.Requireable<NonNullable<any[] | PropTypes.ReactNodeLike>>;
43
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.
44
+ * Optional prop that allows you to pass any component.
45
45
  */
46
- aiLabel: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
46
+ decorator: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
47
47
  description: PropTypes.Requireable<NonNullable<object | PropTypes.ReactNodeLike>>;
48
48
  hasActions: PropTypes.Requireable<boolean>;
49
49
  /**
@@ -67,7 +67,7 @@ export declare const CardHeader: {
67
67
  /**
68
68
  * **Experimental:** For all cases a `Slug` component can be provided.
69
69
  * Clickable tiles only accept a boolean value of true and display a hollow slug.
70
- * @deprecated please use the `aiLabel` prop
70
+ * @deprecated please use the `decorator` prop
71
71
  */
72
72
  slug: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
73
73
  title: PropTypes.Requireable<NonNullable<object | PropTypes.ReactNodeLike>>;
@@ -22,7 +22,7 @@ var defaults = {
22
22
  };
23
23
  var CardHeader = function CardHeader(_ref) {
24
24
  var actions = _ref.actions,
25
- aiLabel = _ref.aiLabel,
25
+ decorator = _ref.decorator,
26
26
  noActionIcons = _ref.noActionIcons,
27
27
  onPrimaryButtonClick = _ref.onPrimaryButtonClick,
28
28
  onSecondaryButtonClick = _ref.onSecondaryButtonClick,
@@ -67,13 +67,13 @@ var CardHeader = function CardHeader(_ref) {
67
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",
68
68
  fill: "#161616"
69
69
  })));
70
- var normalizedAiLabel = null;
71
- if (aiLabel || slug) {
72
- if (inClickableCard || typeof aiLabel === 'boolean' || typeof slug === 'boolean') {
73
- normalizedAiLabel = hollowAiIcon;
70
+ var normalizedDecorator = null;
71
+ if (decorator || slug) {
72
+ if (inClickableCard || typeof decorator === 'boolean' || typeof slug === 'boolean') {
73
+ normalizedDecorator = hollowAiIcon;
74
74
  } else {
75
- var element = aiLabel || slug;
76
- normalizedAiLabel = /*#__PURE__*/React.cloneElement(element, {
75
+ var element = decorator || slug;
76
+ normalizedDecorator = /*#__PURE__*/React.cloneElement(element, {
77
77
  size: label && title || title && titleSize === 'large' ? 'sm' : 'xs'
78
78
  });
79
79
  }
@@ -81,7 +81,7 @@ var CardHeader = function CardHeader(_ref) {
81
81
  return /*#__PURE__*/React.createElement("div", {
82
82
  className: headerClasses
83
83
  }, /*#__PURE__*/React.createElement("div", {
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'))])
84
+ className: cx(["".concat(headerClass, "-container"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(headerClass, "-container--has-slug"), !!slug), _rollupPluginBabelHelpers.defineProperty({}, "".concat(headerClass, "-container--has-decorator"), !!decorator), _rollupPluginBabelHelpers.defineProperty({}, "".concat(headerClass, "-container--has-actions"), !!hasActions), _rollupPluginBabelHelpers.defineProperty({}, "".concat(headerClass, "-container--large-tile-or-label"), title && (label || titleSize === 'large'))])
85
85
  }, /*#__PURE__*/React.createElement("div", {
86
86
  className: "".concat(blockClass, "__title-container")
87
87
  }, label && /*#__PURE__*/React.createElement("p", {
@@ -107,15 +107,17 @@ var CardHeader = function CardHeader(_ref) {
107
107
  onClick: onPrimaryButtonClick,
108
108
  className: actionGhostButtonClass,
109
109
  disabled: primaryButtonDisabled
110
- }, primaryButtonText)), normalizedAiLabel));
110
+ }, primaryButtonText)), slug ? normalizedDecorator : decorator ? /*#__PURE__*/React.createElement("div", {
111
+ className: "".concat(blockClass, "__header__inner-wrapper--decorator")
112
+ }, normalizedDecorator) : ''));
111
113
  };
112
114
  /**@ts-ignore */
113
115
  CardHeader.propTypes = {
114
116
  actions: index.default.oneOfType([index.default.array, index.default.node]),
115
117
  /**
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.
118
+ * Optional prop that allows you to pass any component.
117
119
  */
118
- aiLabel: index.default.oneOfType([index.default.node, index.default.bool]),
120
+ decorator: index.default.oneOfType([index.default.node, index.default.bool]),
119
121
  description: index.default.oneOfType([index.default.string, index.default.object, index.default.node]),
120
122
  hasActions: index.default.bool,
121
123
  /**
@@ -139,7 +141,7 @@ CardHeader.propTypes = {
139
141
  /**
140
142
  * **Experimental:** For all cases a `Slug` component can be provided.
141
143
  * Clickable tiles only accept a boolean value of true and display a hollow slug.
142
- * @deprecated please use the `aiLabel` prop
144
+ * @deprecated please use the `decorator` prop
143
145
  */
144
146
  slug: index.default.oneOfType([index.default.node, index.default.bool]),
145
147
  title: index.default.oneOfType([index.default.string, index.default.object, index.default.node]),
@@ -65,6 +65,11 @@ export interface CoachmarkProps {
65
65
  * Determines the theme of the component.
66
66
  */
67
67
  theme?: 'light' | 'dark';
68
+ /**
69
+ * Determines if the coachmark is open by default.
70
+ * Does nothing if `overlayKind=stacked`.
71
+ */
72
+ isOpenByDefault?: boolean;
68
73
  }
69
74
  /**
70
75
  * Coachmarks are used to call out specific functionality or concepts
@@ -22,7 +22,7 @@ var lodash = require('lodash');
22
22
  var react = require('@carbon/react');
23
23
  var useIsomorphicEffect = require('../../global/js/hooks/useIsomorphicEffect.js');
24
24
 
25
- var _excluded = ["align", "autoAlign", "children", "className", "onClose", "overlayClassName", "overlayKind", "overlayRef", "positionTune", "portalTarget", "target", "theme"];
25
+ var _excluded = ["align", "autoAlign", "children", "className", "onClose", "overlayClassName", "overlayKind", "overlayRef", "positionTune", "portalTarget", "target", "theme", "isOpenByDefault"];
26
26
 
27
27
  // The block part of our conventional BEM class names (blockClass__E--M).
28
28
  var blockClass = "".concat(settings.pkg.prefix, "--coachmark");
@@ -32,7 +32,8 @@ var defaults = {
32
32
  align: 'bottom',
33
33
  onClose: function onClose() {},
34
34
  overlayKind: 'tooltip',
35
- theme: 'light'
35
+ theme: 'light',
36
+ isOpenByDefault: false
36
37
  };
37
38
  /**
38
39
  * Coachmarks are used to call out specific functionality or concepts
@@ -57,10 +58,12 @@ exports.Coachmark = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
57
58
  target = _ref.target,
58
59
  _ref$theme = _ref.theme,
59
60
  theme = _ref$theme === void 0 ? defaults.theme : _ref$theme,
61
+ _ref$isOpenByDefault = _ref.isOpenByDefault,
62
+ isOpenByDefault = _ref$isOpenByDefault === void 0 ? defaults.isOpenByDefault : _ref$isOpenByDefault,
60
63
  rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
61
64
  var isBeacon = overlayKind === enums.COACHMARK_OVERLAY_KIND.TOOLTIP;
62
65
  var isStacked = overlayKind === enums.COACHMARK_OVERLAY_KIND.STACKED;
63
- var _useState = React.useState(isStacked),
66
+ var _useState = React.useState(isStacked || isOpenByDefault),
64
67
  _useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
65
68
  isOpen = _useState2[0],
66
69
  setIsOpen = _useState2[1];
@@ -252,6 +255,11 @@ exports.Coachmark.propTypes = {
252
255
  * Optional class name for this component.
253
256
  */
254
257
  className: index.default.string,
258
+ /**
259
+ * Determines if the coachmark is open by default.
260
+ * Does nothing if `overlayKind=stacked`.
261
+ */
262
+ isOpenByDefault: index.default.bool,
255
263
  /**
256
264
  * Function to call when the Coachmark closes.
257
265
  */