@carbon/ibm-products 2.43.2-canary.301 → 2.43.2-canary.303
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 +15 -12
- 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 +9 -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 +15 -12
- 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 +9 -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/Tearsheet/TearsheetShell.d.ts +13 -4
- package/es/components/Tearsheet/TearsheetShell.js +16 -9
- package/lib/components/Tearsheet/TearsheetShell.d.ts +13 -4
- package/lib/components/Tearsheet/TearsheetShell.js +16 -9
- package/package.json +3 -3
- package/scss/components/Datagrid/styles/_datagrid.scss +2 -0
- package/scss/components/Tearsheet/_tearsheet.scss +13 -3
@@ -13,6 +13,7 @@ import cx from 'classnames';
|
|
13
13
|
import { pkg } from '../../settings.js';
|
14
14
|
import pconsole from '../../global/js/utils/pconsole.js';
|
15
15
|
import { getNodeTextContent } from '../../global/js/utils/getNodeTextContent.js';
|
16
|
+
import { deprecateProp } from '../../global/js/utils/props-helper.js';
|
16
17
|
import { Button, usePrefix, unstable_FeatureFlags, ComposedModal, ModalHeader, Layer } from '@carbon/react';
|
17
18
|
import { ActionSet } from '../ActionSet/ActionSet.js';
|
18
19
|
import { Wrap } from '../../global/js/utils/Wrap.js';
|
@@ -20,7 +21,7 @@ import { usePortalTarget } from '../../global/js/hooks/usePortalTarget.js';
|
|
20
21
|
import { useFocus, getSpecificElement } from '../../global/js/hooks/useFocus.js';
|
21
22
|
import { usePreviousValue } from '../../global/js/hooks/usePreviousValue.js';
|
22
23
|
|
23
|
-
var _excluded = ["actions", "ariaLabel", "children", "className", "closeIconDescription", "description", "hasCloseIcon", "headerActions", "influencer", "influencerPosition", "influencerWidth", "label", "navigation", "onClose", "open", "portalTarget", "selectorPrimaryFocus", "selectorsFloatingMenus", "size", "slug", "title", "verticalPosition", "launcherButtonRef"];
|
24
|
+
var _excluded = ["actions", "aiLabel", "ariaLabel", "children", "className", "closeIconDescription", "description", "hasCloseIcon", "headerActions", "influencer", "influencerPosition", "influencerWidth", "label", "navigation", "onClose", "open", "portalTarget", "selectorPrimaryFocus", "selectorsFloatingMenus", "size", "slug", "title", "verticalPosition", "launcherButtonRef"];
|
24
25
|
|
25
26
|
// The block part of our conventional BEM class names (bc__E--M).
|
26
27
|
var bc = "".concat(pkg.prefix, "--tearsheet");
|
@@ -63,6 +64,7 @@ var tearsheetHasCloseIcon = function tearsheetHasCloseIcon(actions, hasCloseIcon
|
|
63
64
|
* */
|
64
65
|
var TearsheetShell = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
65
66
|
var actions = _ref.actions,
|
67
|
+
aiLabel = _ref.aiLabel,
|
66
68
|
ariaLabel = _ref.ariaLabel,
|
67
69
|
children = _ref.children,
|
68
70
|
className = _ref.className,
|
@@ -82,7 +84,7 @@ var TearsheetShell = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
82
84
|
_ref$selectorsFloatin = _ref.selectorsFloatingMenus,
|
83
85
|
selectorsFloatingMenus = _ref$selectorsFloatin === void 0 ? [] : _ref$selectorsFloatin,
|
84
86
|
size = _ref.size,
|
85
|
-
|
87
|
+
deprecated_slug = _ref.slug,
|
86
88
|
title = _ref.title,
|
87
89
|
verticalPosition = _ref.verticalPosition,
|
88
90
|
launcherButtonRef = _ref.launcherButtonRef,
|
@@ -263,10 +265,10 @@ var TearsheetShell = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
263
265
|
}
|
264
266
|
}, /*#__PURE__*/React__default.createElement(ComposedModal, _extends({}, rest, {
|
265
267
|
"aria-label": ariaLabel || getNodeTextContent(title),
|
266
|
-
className: cx(bc, className, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(bc, "--stacked-").concat(position, "-of-").concat(depth),
|
268
|
+
className: cx(bc, className, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(bc, "--stacked-").concat(position, "-of-").concat(depth),
|
267
269
|
// Don't apply this on the initial open of a single tearsheet.
|
268
|
-
depth > 1 || depth === 1 && ((_prevDepth$current = prevDepth === null || prevDepth === void 0 ? void 0 : prevDepth.current) !== null && _prevDepth$current !== void 0 ? _prevDepth$current : 0) > 1), "".concat(bc, "--wide"), wide), "".concat(bc, "--narrow"), !wide), "".concat(bc, "--has-slug"),
|
269
|
-
slug:
|
270
|
+
depth > 1 || depth === 1 && ((_prevDepth$current = prevDepth === null || prevDepth === void 0 ? void 0 : prevDepth.current) !== null && _prevDepth$current !== void 0 ? _prevDepth$current : 0) > 1), "".concat(bc, "--wide"), wide), "".concat(bc, "--narrow"), !wide), "".concat(bc, "--has-slug"), deprecated_slug), "".concat(bc, "--has-ai-label"), aiLabel), "".concat(bc, "--has-close"), effectiveHasCloseIcon)),
|
271
|
+
slug: aiLabel || deprecated_slug,
|
270
272
|
style: setScaleValues(),
|
271
273
|
containerClassName: cx("".concat(bc, "__container"), _defineProperty(_defineProperty({}, "".concat(bc, "__container--lower"), verticalPosition === 'lower'), "".concat(bc, "__container--mixed-size-stacking"), !areAllSameSizeVariant())),
|
272
274
|
onClose: onClose,
|
@@ -344,6 +346,10 @@ var portalType = typeof Element === 'undefined' ? PropTypes.object :
|
|
344
346
|
// eslint-disable-next-line ssr-friendly/no-dom-globals-in-module-scope
|
345
347
|
PropTypes.instanceOf(Element);
|
346
348
|
var deprecatedProps = {
|
349
|
+
/**
|
350
|
+
* @deprecated Property replaced by `aiLabel`
|
351
|
+
*/
|
352
|
+
slug: deprecateProp(PropTypes.node, 'Property replaced by `aiLabel`'),
|
347
353
|
/**
|
348
354
|
* **Deprecated**
|
349
355
|
*
|
@@ -388,6 +394,11 @@ TearsheetShell.propTypes = _objectSpread2({
|
|
388
394
|
/**@ts-ignore*/
|
389
395
|
onClick: Button.propTypes.onClick
|
390
396
|
}))),
|
397
|
+
/**
|
398
|
+
* Optional prop that is intended for any scenario where something is being generated by AI to reinforce AI transparency,
|
399
|
+
* accountability, and explainability at the UI level.
|
400
|
+
*/
|
401
|
+
aiLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.bool]),
|
391
402
|
/**
|
392
403
|
* The main content of the tearsheet.
|
393
404
|
*/
|
@@ -494,10 +505,6 @@ TearsheetShell.propTypes = _objectSpread2({
|
|
494
505
|
*/
|
495
506
|
/**@ts-ignore*/
|
496
507
|
size: PropTypes.oneOf(['narrow', 'wide']).isRequired,
|
497
|
-
/**
|
498
|
-
* **Experimental:** Provide a `Slug` component to be rendered inside the `Tearsheet` component
|
499
|
-
*/
|
500
|
-
slug: PropTypes.node,
|
501
508
|
/**
|
502
509
|
* The main title of the tearsheet, displayed in the header area.
|
503
510
|
*/
|
@@ -10,6 +10,11 @@ import PropTypes from 'prop-types';
|
|
10
10
|
import { type ButtonProps } from '@carbon/react';
|
11
11
|
interface TearsheetShellProps extends PropsWithChildren {
|
12
12
|
actions?: ButtonProps<'button'>[];
|
13
|
+
/**
|
14
|
+
* Optional prop that is intended for any scenario where something is being generated by AI to reinforce AI transparency,
|
15
|
+
* accountability, and explainability at the UI level.
|
16
|
+
*/
|
17
|
+
aiLabel?: ReactNode;
|
13
18
|
ariaLabel?: string;
|
14
19
|
/**
|
15
20
|
* An optional class or classes to be added to the outermost element.
|
@@ -96,15 +101,15 @@ interface TearsheetShellProps extends PropsWithChildren {
|
|
96
101
|
* Specifies the width of the tearsheet, 'narrow' or 'wide'.
|
97
102
|
*/
|
98
103
|
size: 'narrow' | 'wide';
|
99
|
-
/**
|
100
|
-
* **Experimental:** Provide a `Slug` component to be rendered inside the `Tearsheet` component
|
101
|
-
*/
|
102
|
-
slug?: ReactNode;
|
103
104
|
/**
|
104
105
|
* The main title of the tearsheet, displayed in the header area.
|
105
106
|
*/
|
106
107
|
title?: ReactNode;
|
107
108
|
verticalPosition?: 'normal' | 'lower';
|
109
|
+
/**
|
110
|
+
* @deprecated Property replaced by `aiLabel`
|
111
|
+
*/
|
112
|
+
slug?: ReactNode;
|
108
113
|
}
|
109
114
|
export type CloseIconDescriptionTypes = {
|
110
115
|
hasCloseIcon?: false;
|
@@ -126,6 +131,10 @@ export declare const tearsheetHasCloseIcon: (actions: any, hasCloseIcon: any) =>
|
|
126
131
|
export declare const TearsheetShell: React.ForwardRefExoticComponent<(TearsheetShellProps & CloseIconDescriptionTypes) & React.RefAttributes<HTMLDivElement>>;
|
127
132
|
export declare const portalType: PropTypes.Requireable<object>;
|
128
133
|
export declare const deprecatedProps: {
|
134
|
+
/**
|
135
|
+
* @deprecated Property replaced by `aiLabel`
|
136
|
+
*/
|
137
|
+
slug: (props: any, propName: any, comp: any, loc: any, propFullName: any, secret: any) => any;
|
129
138
|
/**
|
130
139
|
* **Deprecated**
|
131
140
|
*
|
@@ -15,6 +15,7 @@ var cx = require('classnames');
|
|
15
15
|
var settings = require('../../settings.js');
|
16
16
|
var pconsole = require('../../global/js/utils/pconsole.js');
|
17
17
|
var getNodeTextContent = require('../../global/js/utils/getNodeTextContent.js');
|
18
|
+
var propsHelper = require('../../global/js/utils/props-helper.js');
|
18
19
|
var react = require('@carbon/react');
|
19
20
|
var ActionSet = require('../ActionSet/ActionSet.js');
|
20
21
|
var Wrap = require('../../global/js/utils/Wrap.js');
|
@@ -22,7 +23,7 @@ var usePortalTarget = require('../../global/js/hooks/usePortalTarget.js');
|
|
22
23
|
var useFocus = require('../../global/js/hooks/useFocus.js');
|
23
24
|
var usePreviousValue = require('../../global/js/hooks/usePreviousValue.js');
|
24
25
|
|
25
|
-
var _excluded = ["actions", "ariaLabel", "children", "className", "closeIconDescription", "description", "hasCloseIcon", "headerActions", "influencer", "influencerPosition", "influencerWidth", "label", "navigation", "onClose", "open", "portalTarget", "selectorPrimaryFocus", "selectorsFloatingMenus", "size", "slug", "title", "verticalPosition", "launcherButtonRef"];
|
26
|
+
var _excluded = ["actions", "aiLabel", "ariaLabel", "children", "className", "closeIconDescription", "description", "hasCloseIcon", "headerActions", "influencer", "influencerPosition", "influencerWidth", "label", "navigation", "onClose", "open", "portalTarget", "selectorPrimaryFocus", "selectorsFloatingMenus", "size", "slug", "title", "verticalPosition", "launcherButtonRef"];
|
26
27
|
|
27
28
|
// The block part of our conventional BEM class names (bc__E--M).
|
28
29
|
var bc = "".concat(settings.pkg.prefix, "--tearsheet");
|
@@ -65,6 +66,7 @@ var tearsheetHasCloseIcon = function tearsheetHasCloseIcon(actions, hasCloseIcon
|
|
65
66
|
* */
|
66
67
|
var TearsheetShell = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
67
68
|
var actions = _ref.actions,
|
69
|
+
aiLabel = _ref.aiLabel,
|
68
70
|
ariaLabel = _ref.ariaLabel,
|
69
71
|
children = _ref.children,
|
70
72
|
className = _ref.className,
|
@@ -84,7 +86,7 @@ var TearsheetShell = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
84
86
|
_ref$selectorsFloatin = _ref.selectorsFloatingMenus,
|
85
87
|
selectorsFloatingMenus = _ref$selectorsFloatin === void 0 ? [] : _ref$selectorsFloatin,
|
86
88
|
size = _ref.size,
|
87
|
-
|
89
|
+
deprecated_slug = _ref.slug,
|
88
90
|
title = _ref.title,
|
89
91
|
verticalPosition = _ref.verticalPosition,
|
90
92
|
launcherButtonRef = _ref.launcherButtonRef,
|
@@ -265,10 +267,10 @@ var TearsheetShell = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
265
267
|
}
|
266
268
|
}, /*#__PURE__*/React.createElement(react.ComposedModal, _rollupPluginBabelHelpers.extends({}, rest, {
|
267
269
|
"aria-label": ariaLabel || getNodeTextContent.getNodeTextContent(title),
|
268
|
-
className: cx(bc, className, _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(bc, "--stacked-").concat(position, "-of-").concat(depth),
|
270
|
+
className: cx(bc, className, _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(bc, "--stacked-").concat(position, "-of-").concat(depth),
|
269
271
|
// Don't apply this on the initial open of a single tearsheet.
|
270
|
-
depth > 1 || depth === 1 && ((_prevDepth$current = prevDepth === null || prevDepth === void 0 ? void 0 : prevDepth.current) !== null && _prevDepth$current !== void 0 ? _prevDepth$current : 0) > 1), "".concat(bc, "--wide"), wide), "".concat(bc, "--narrow"), !wide), "".concat(bc, "--has-slug"),
|
271
|
-
slug:
|
272
|
+
depth > 1 || depth === 1 && ((_prevDepth$current = prevDepth === null || prevDepth === void 0 ? void 0 : prevDepth.current) !== null && _prevDepth$current !== void 0 ? _prevDepth$current : 0) > 1), "".concat(bc, "--wide"), wide), "".concat(bc, "--narrow"), !wide), "".concat(bc, "--has-slug"), deprecated_slug), "".concat(bc, "--has-ai-label"), aiLabel), "".concat(bc, "--has-close"), effectiveHasCloseIcon)),
|
273
|
+
slug: aiLabel || deprecated_slug,
|
272
274
|
style: setScaleValues(),
|
273
275
|
containerClassName: cx("".concat(bc, "__container"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(bc, "__container--lower"), verticalPosition === 'lower'), "".concat(bc, "__container--mixed-size-stacking"), !areAllSameSizeVariant())),
|
274
276
|
onClose: onClose,
|
@@ -346,6 +348,10 @@ var portalType = typeof Element === 'undefined' ? index.default.object :
|
|
346
348
|
// eslint-disable-next-line ssr-friendly/no-dom-globals-in-module-scope
|
347
349
|
index.default.instanceOf(Element);
|
348
350
|
var deprecatedProps = {
|
351
|
+
/**
|
352
|
+
* @deprecated Property replaced by `aiLabel`
|
353
|
+
*/
|
354
|
+
slug: propsHelper.deprecateProp(index.default.node, 'Property replaced by `aiLabel`'),
|
349
355
|
/**
|
350
356
|
* **Deprecated**
|
351
357
|
*
|
@@ -390,6 +396,11 @@ TearsheetShell.propTypes = _rollupPluginBabelHelpers.objectSpread2({
|
|
390
396
|
/**@ts-ignore*/
|
391
397
|
onClick: react.Button.propTypes.onClick
|
392
398
|
}))),
|
399
|
+
/**
|
400
|
+
* Optional prop that is intended for any scenario where something is being generated by AI to reinforce AI transparency,
|
401
|
+
* accountability, and explainability at the UI level.
|
402
|
+
*/
|
403
|
+
aiLabel: index.default.oneOfType([index.default.node, index.default.bool]),
|
393
404
|
/**
|
394
405
|
* The main content of the tearsheet.
|
395
406
|
*/
|
@@ -496,10 +507,6 @@ TearsheetShell.propTypes = _rollupPluginBabelHelpers.objectSpread2({
|
|
496
507
|
*/
|
497
508
|
/**@ts-ignore*/
|
498
509
|
size: index.default.oneOf(['narrow', 'wide']).isRequired,
|
499
|
-
/**
|
500
|
-
* **Experimental:** Provide a `Slug` component to be rendered inside the `Tearsheet` component
|
501
|
-
*/
|
502
|
-
slug: index.default.node,
|
503
510
|
/**
|
504
511
|
* The main title of the tearsheet, displayed in the header area.
|
505
512
|
*/
|
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.303+2311bdb74",
|
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.
|
99
|
+
"@carbon/ibm-products-styles": "^2.39.1-canary.313+2311bdb74",
|
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": "2311bdb7477e72a6cd4d7f915f6dc754874b7375"
|
124
124
|
}
|
@@ -110,6 +110,8 @@ $motion-duration: $duration-moderate-02;
|
|
110
110
|
}
|
111
111
|
|
112
112
|
&.#{$block-class}.#{$block-class}.#{$block-class}.#{$block-class}--has-slug
|
113
|
+
.#{$block-class}__container,
|
114
|
+
&.#{$block-class}.#{$block-class}.#{$block-class}.#{$block-class}--has-ai-label
|
113
115
|
.#{$block-class}__container {
|
114
116
|
border: 1px solid transparent;
|
115
117
|
border-bottom: 0;
|
@@ -276,11 +278,15 @@ $motion-duration: $duration-moderate-02;
|
|
276
278
|
|
277
279
|
&.#{$block-class}--wide
|
278
280
|
.#{$block-class}__header.#{$block-class}__header--with-close-icon,
|
279
|
-
&.#{$block-class}--has-slug .#{$block-class}__header.#{$block-class}__header
|
281
|
+
&.#{$block-class}--has-slug .#{$block-class}__header.#{$block-class}__header,
|
282
|
+
&.#{$block-class}--has-ai-label
|
283
|
+
.#{$block-class}__header.#{$block-class}__header {
|
280
284
|
padding-inline-end: $spacing-11;
|
281
285
|
}
|
282
286
|
|
283
287
|
&.#{$block-class}--wide.#{$block-class}--has-slug
|
288
|
+
.#{$block-class}__header.#{$block-class}__header--with-close-icon,
|
289
|
+
&.#{$block-class}--wide.#{$block-class}--has-ai-label
|
284
290
|
.#{$block-class}__header.#{$block-class}__header--with-close-icon {
|
285
291
|
/* spacing 11 plus additional space for slug/close */
|
286
292
|
/* stylelint-disable-next-line carbon/layout-token-use */
|
@@ -362,7 +368,8 @@ $motion-duration: $duration-moderate-02;
|
|
362
368
|
flex-grow: 1;
|
363
369
|
}
|
364
370
|
|
365
|
-
&.#{$block-class}--has-slug .#{$block-class}__content
|
371
|
+
&.#{$block-class}--has-slug .#{$block-class}__content,
|
372
|
+
&.#{$block-class}--has-ai-label .#{$block-class}__content {
|
366
373
|
@include utilities.ai-popover-gradient('default', 0);
|
367
374
|
|
368
375
|
box-shadow: inset 0 -80px 70px -65px $ai-inner-shadow;
|
@@ -418,12 +425,15 @@ $motion-duration: $duration-moderate-02;
|
|
418
425
|
background: $background;
|
419
426
|
}
|
420
427
|
|
421
|
-
&.#{$block-class}--has-slug
|
428
|
+
&.#{$block-class}--has-slug,
|
429
|
+
&.#{$block-class}--has-ai-label {
|
422
430
|
/* stylelint-disable-next-line carbon/theme-token-use */
|
423
431
|
--overlay-color: #{$ai-overlay};
|
424
432
|
}
|
425
433
|
|
426
434
|
&.#{$block-class}--has-slug:not(.#{$block-class}--has-close)
|
435
|
+
.#{$carbon-prefix}--slug,
|
436
|
+
&.#{$block-class}--has-ai-label:not(.#{$block-class}--has-close)
|
427
437
|
.#{$carbon-prefix}--slug {
|
428
438
|
inset-inline-end: 0;
|
429
439
|
margin-block: 6px;
|