@carbon/ibm-products 2.68.0 → 2.69.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/carbon.css +382 -74
- package/css/carbon.css.map +1 -1
- package/css/index-full-carbon.css +524 -116
- 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 +126 -42
- 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 +142 -42
- 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 +185 -50
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -1
- package/css/index.min.css.map +1 -1
- package/es/_virtual/_commonjsHelpers.js +3 -1
- package/es/_virtual/index2.js +6 -2
- package/es/_virtual/index3.js +10 -0
- package/es/components/AddSelect/AddSelectColumn.js +41 -18
- package/es/components/AddSelect/AddSelectSort.js +15 -16
- package/es/components/AddSelect/types/index.d.ts +1 -1
- package/es/components/Card/Card.d.ts +2 -2
- package/es/components/Card/Card.js +7 -4
- package/es/components/Coachmark/Coachmark.d.ts +43 -0
- package/es/components/Coachmark/Coachmark.js +49 -33
- package/es/components/Coachmark/CoachmarkOverlay.js +6 -0
- package/es/components/Coachmark/index.d.ts +1 -0
- package/es/components/CoachmarkBeacon/CoachmarkBeacon.d.ts +11 -0
- package/es/components/CoachmarkBeacon/CoachmarkBeacon.js +19 -11
- package/es/components/CoachmarkButton/CoachmarkButton.js +7 -0
- package/es/components/CoachmarkOverlayElement/CoachmarkOverlayElement.js +6 -0
- package/es/components/CoachmarkOverlayElements/CoachmarkOverlayElements.js +7 -0
- package/es/components/Datagrid/Datagrid/DatagridContent.js +7 -5
- package/es/components/Datagrid/Datagrid/DatagridRow.d.ts +1 -1
- package/es/components/Datagrid/Datagrid/DatagridRow.js +4 -3
- package/es/components/Datagrid/Datagrid/DatagridToolbar.d.ts +1 -1
- package/es/components/Datagrid/Datagrid/DatagridToolbar.js +8 -7
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.d.ts +2 -1
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +4 -3
- package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +4 -3
- package/es/components/Datagrid/useNestedRowExpander.js +4 -2
- package/es/components/Datagrid/useOnRowClick.d.ts +1 -1
- package/es/components/Datagrid/useOnRowClick.js +6 -4
- package/es/components/Datagrid/useRowExpander.js +4 -2
- package/es/components/Datagrid/useSelectRows.d.ts +1 -1
- package/es/components/Datagrid/useSelectRows.js +4 -3
- package/es/components/Datagrid/useSortableColumns.d.ts +1 -1
- package/es/components/Datagrid/useSortableColumns.js +6 -5
- package/es/components/EditInPlace/EditInPlace.d.ts +1 -1
- package/es/components/EditInPlace/EditInPlace.js +4 -3
- package/es/components/EmptyStates/EmptyStateContent.d.ts +30 -1
- package/es/components/EmptyStates/EmptyStateContent.js +2 -2
- package/es/components/ExportModal/ExportModal.js +7 -5
- package/es/components/FeatureFlags/index.d.ts +31 -12
- package/es/components/FeatureFlags/index.js +46 -15
- package/es/components/InterstitialScreen/InterstitialScreenBody.js +3 -2
- package/es/components/InterstitialScreen/InterstitialScreenFooter.js +5 -2
- package/es/components/InterstitialScreen/InterstitialScreenHeader.js +3 -1
- package/es/components/ProductiveCard/ProductiveCard.d.ts +1 -1
- package/es/components/ScrollGradient/ScrollGradient.js +9 -7
- package/es/components/SidePanel/SidePanel.js +74 -0
- package/es/components/SidePanel/constants.d.ts +14 -8
- package/es/components/SidePanel/constants.js +1 -1
- package/es/components/SidePanel/resizer/Resizer.d.ts +21 -0
- package/es/components/SidePanel/resizer/Resizer.js +271 -0
- package/es/components/TruncatedList/TruncatedList.d.ts +1 -1
- package/es/components/TruncatedList/TruncatedList.js +4 -3
- package/es/feature-flags.js +5 -1
- package/es/index.js +1 -0
- package/es/node_modules/@carbon/{icons-react/node_modules/@carbon/icon-helpers → icon-helpers}/es/index.js +3 -3
- package/es/node_modules/@carbon/icons-react/es/Icon.js +1 -1
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-10.js +816 -808
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-3.js +615 -637
- package/es/node_modules/lodash.debounce/index.js +367 -0
- package/es/node_modules/prop-types/index.js +1 -1
- package/es/settings.js +1 -4
- package/lib/_virtual/_commonjsHelpers.js +3 -0
- package/lib/_virtual/index2.js +8 -2
- package/lib/_virtual/index3.js +12 -0
- package/lib/components/AddSelect/AddSelectColumn.js +40 -17
- package/lib/components/AddSelect/AddSelectSort.js +13 -14
- package/lib/components/AddSelect/types/index.d.ts +1 -1
- package/lib/components/Card/Card.d.ts +2 -2
- package/lib/components/Card/Card.js +7 -4
- package/lib/components/Coachmark/Coachmark.d.ts +43 -0
- package/lib/components/Coachmark/Coachmark.js +50 -32
- package/lib/components/Coachmark/CoachmarkOverlay.js +6 -0
- package/lib/components/Coachmark/index.d.ts +1 -0
- package/lib/components/CoachmarkBeacon/CoachmarkBeacon.d.ts +11 -0
- package/lib/components/CoachmarkBeacon/CoachmarkBeacon.js +19 -11
- package/lib/components/CoachmarkButton/CoachmarkButton.js +7 -0
- package/lib/components/CoachmarkOverlayElement/CoachmarkOverlayElement.js +6 -0
- package/lib/components/CoachmarkOverlayElements/CoachmarkOverlayElements.js +7 -0
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +5 -3
- package/lib/components/Datagrid/Datagrid/DatagridRow.d.ts +1 -1
- package/lib/components/Datagrid/Datagrid/DatagridRow.js +2 -1
- package/lib/components/Datagrid/Datagrid/DatagridToolbar.d.ts +1 -1
- package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +6 -5
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.d.ts +2 -1
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +3 -2
- package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +2 -1
- package/lib/components/Datagrid/useNestedRowExpander.js +3 -1
- package/lib/components/Datagrid/useOnRowClick.d.ts +1 -1
- package/lib/components/Datagrid/useOnRowClick.js +5 -3
- package/lib/components/Datagrid/useRowExpander.js +3 -1
- package/lib/components/Datagrid/useSelectRows.d.ts +1 -1
- package/lib/components/Datagrid/useSelectRows.js +2 -1
- package/lib/components/Datagrid/useSortableColumns.d.ts +1 -1
- package/lib/components/Datagrid/useSortableColumns.js +4 -3
- package/lib/components/EditInPlace/EditInPlace.d.ts +1 -1
- package/lib/components/EditInPlace/EditInPlace.js +2 -1
- package/lib/components/EmptyStates/EmptyStateContent.d.ts +30 -1
- package/lib/components/EmptyStates/EmptyStateContent.js +2 -2
- package/lib/components/ExportModal/ExportModal.js +5 -3
- package/lib/components/FeatureFlags/index.d.ts +31 -12
- package/lib/components/FeatureFlags/index.js +46 -15
- package/lib/components/InterstitialScreen/InterstitialScreenBody.js +3 -2
- package/lib/components/InterstitialScreen/InterstitialScreenFooter.js +5 -2
- package/lib/components/InterstitialScreen/InterstitialScreenHeader.js +3 -1
- package/lib/components/ProductiveCard/ProductiveCard.d.ts +1 -1
- package/lib/components/ScrollGradient/ScrollGradient.js +8 -6
- package/lib/components/SidePanel/SidePanel.js +74 -0
- package/lib/components/SidePanel/constants.d.ts +14 -8
- package/lib/components/SidePanel/constants.js +1 -1
- package/lib/components/SidePanel/resizer/Resizer.d.ts +21 -0
- package/lib/components/SidePanel/resizer/Resizer.js +277 -0
- package/lib/components/TruncatedList/TruncatedList.d.ts +1 -1
- package/lib/components/TruncatedList/TruncatedList.js +2 -1
- package/lib/feature-flags.js +5 -1
- package/lib/index.js +1 -0
- package/lib/node_modules/@carbon/{icons-react/node_modules/@carbon/icon-helpers → icon-helpers}/es/index.js +3 -3
- package/lib/node_modules/@carbon/icons-react/es/Icon.js +1 -1
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-10.js +839 -831
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-3.js +621 -643
- package/lib/node_modules/lodash.debounce/index.js +369 -0
- package/lib/node_modules/prop-types/index.js +1 -1
- package/lib/settings.js +0 -4
- package/package.json +15 -15
- package/scss/components/AddSelect/_add-select.scss +12 -13
- package/scss/components/SidePanel/_side-panel-variables.scss +1 -5
- package/scss/components/SidePanel/_side-panel.scss +129 -12
- package/scss/global/decorators/_side-panel-decorator.scss +36 -8
- package/telemetry.yml +17 -0
@@ -31,15 +31,21 @@ export interface CoachmarkProps {
|
|
31
31
|
*/
|
32
32
|
onClose?: () => void;
|
33
33
|
/**
|
34
|
+
* @deprecated
|
34
35
|
* Optional class name for the Coachmark Overlay component.
|
35
36
|
*/
|
36
37
|
overlayClassName?: string;
|
37
38
|
/**
|
39
|
+
* @deprecated
|
38
40
|
* What kind or style of Coachmark to render.
|
39
41
|
*/
|
40
42
|
overlayKind?: 'tooltip' | 'floating' | 'stacked';
|
43
|
+
/**
|
44
|
+
* @deprecated
|
45
|
+
*/
|
41
46
|
overlayRef?: MutableRefObject<HTMLElement | null>;
|
42
47
|
/**
|
48
|
+
* @deprecated
|
43
49
|
* By default, the Coachmark will be appended to the end of `document.body`.
|
44
50
|
* The Coachmark will remain persistent as the user navigates the app until
|
45
51
|
* the user closes the Coachmark.
|
@@ -58,10 +64,12 @@ export interface CoachmarkProps {
|
|
58
64
|
y: number;
|
59
65
|
};
|
60
66
|
/**
|
67
|
+
* @deprecated
|
61
68
|
* The optional button or beacon that the user will click to show the Coachmark.
|
62
69
|
*/
|
63
70
|
target: React.ReactNode;
|
64
71
|
/**
|
72
|
+
* @deprecated
|
65
73
|
* Determines the theme of the component.
|
66
74
|
*/
|
67
75
|
theme?: 'light' | 'dark';
|
@@ -77,3 +85,38 @@ export interface CoachmarkProps {
|
|
77
85
|
* user to gain understanding of the product's main value and discover new use cases.
|
78
86
|
*/
|
79
87
|
export declare let Coachmark: React.ForwardRefExoticComponent<CoachmarkProps & React.RefAttributes<HTMLElement>>;
|
88
|
+
export declare const deprecatedProps: {
|
89
|
+
/**
|
90
|
+
* **Deprecated**
|
91
|
+
* Optional class name for the Coachmark Overlay component.
|
92
|
+
*/
|
93
|
+
overlayClassName: any;
|
94
|
+
/**
|
95
|
+
* **Deprecated**
|
96
|
+
* What kind or style of Coachmark to render.
|
97
|
+
*/
|
98
|
+
overlayKind: any;
|
99
|
+
overlayRef: any;
|
100
|
+
/**
|
101
|
+
* **Deprecated**
|
102
|
+
* By default, the Coachmark will be appended to the end of `document.body`.
|
103
|
+
* The Coachmark will remain persistent as the user navigates the app until
|
104
|
+
* the user closes the Coachmark.
|
105
|
+
*
|
106
|
+
* Alternatively, the app developer can tightly couple the Coachmark to a DOM
|
107
|
+
* element or other component by specifying a CSS selector. The Coachmark will
|
108
|
+
* remain visible as long as that element remains visible or mounted. When the
|
109
|
+
* element is hidden or component is unmounted, the Coachmark will disappear.
|
110
|
+
*/
|
111
|
+
portalTarget: any;
|
112
|
+
/**
|
113
|
+
* **Deprecated**
|
114
|
+
* The optional button or beacon that the user will click to show the Coachmark.
|
115
|
+
*/
|
116
|
+
target: any;
|
117
|
+
/**
|
118
|
+
* **Deprecated**
|
119
|
+
* Determines the theme of the component.
|
120
|
+
*/
|
121
|
+
theme: any;
|
122
|
+
};
|
@@ -72,6 +72,10 @@ exports.Coachmark = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
72
72
|
const _overlayRef = overlayRef || overlayBackupRef;
|
73
73
|
const portalNode = React.useRef(null);
|
74
74
|
const popoverRef = React.useRef(null);
|
75
|
+
let targetName;
|
76
|
+
if (/*#__PURE__*/React.isValidElement(target) && typeof target.type !== 'string') {
|
77
|
+
targetName = target.type;
|
78
|
+
}
|
75
79
|
useIsomorphicEffect.useIsomorphicEffect(() => {
|
76
80
|
portalNode.current = portalTarget ? document?.querySelector(portalTarget) ?? document?.querySelector('body') : document?.querySelector('body');
|
77
81
|
}, [portalTarget]);
|
@@ -175,7 +179,9 @@ exports.Coachmark = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
175
179
|
}, /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({
|
176
180
|
className: cx(blockClass, `${blockClass}__${theme}`, className),
|
177
181
|
ref: _coachmarkRef
|
178
|
-
}, rest, devtools.getDevtoolsProps(componentName)), overlayKind !== 'tooltip' ? /*#__PURE__*/React.createElement(React.Fragment, null,
|
182
|
+
}, rest, devtools.getDevtoolsProps(componentName)), overlayKind !== 'tooltip' ? /*#__PURE__*/React.createElement(React.Fragment, null, targetName?.displayName === 'CoachmarkBeacon' ? /*#__PURE__*/React.cloneElement(target, {
|
183
|
+
buttonProps: contextValue.buttonProps
|
184
|
+
}) : target, isOpen && portalNode?.current && /*#__PURE__*/reactDom.createPortal(/*#__PURE__*/React.createElement(CoachmarkOverlay.CoachmarkOverlay, {
|
179
185
|
ref: _overlayRef,
|
180
186
|
fixedIsVisible: false,
|
181
187
|
kind: overlayKind,
|
@@ -191,7 +197,9 @@ exports.Coachmark = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
191
197
|
align: align,
|
192
198
|
autoAlign: autoAlign,
|
193
199
|
open: isOpen
|
194
|
-
},
|
200
|
+
}, targetName?.displayName === 'CoachmarkBeacon' ? /*#__PURE__*/React.cloneElement(target, {
|
201
|
+
buttonProps: contextValue.buttonProps
|
202
|
+
}) : target, /*#__PURE__*/React.createElement(react.PopoverContent, null, isOpen && /*#__PURE__*/React.createElement(CoachmarkOverlay.CoachmarkOverlay, {
|
195
203
|
ref: _overlayRef,
|
196
204
|
fixedIsVisible: false,
|
197
205
|
kind: overlayKind,
|
@@ -212,6 +220,43 @@ exports.Coachmark = settings.pkg.checkComponentEnabled(exports.Coachmark, compon
|
|
212
220
|
// The display name of the component, used by React. Note that displayName
|
213
221
|
// is used in preference to relying on function.name.
|
214
222
|
exports.Coachmark.displayName = componentName;
|
223
|
+
const deprecatedProps = {
|
224
|
+
/**
|
225
|
+
* **Deprecated**
|
226
|
+
* Optional class name for the Coachmark Overlay component.
|
227
|
+
*/
|
228
|
+
overlayClassName: index.default.string,
|
229
|
+
/**
|
230
|
+
* **Deprecated**
|
231
|
+
* What kind or style of Coachmark to render.
|
232
|
+
*/
|
233
|
+
overlayKind: index.default.oneOf(['tooltip', 'floating', 'stacked']),
|
234
|
+
overlayRef: index.default.shape({
|
235
|
+
current: overlayRefType
|
236
|
+
}),
|
237
|
+
/**
|
238
|
+
* **Deprecated**
|
239
|
+
* By default, the Coachmark will be appended to the end of `document.body`.
|
240
|
+
* The Coachmark will remain persistent as the user navigates the app until
|
241
|
+
* the user closes the Coachmark.
|
242
|
+
*
|
243
|
+
* Alternatively, the app developer can tightly couple the Coachmark to a DOM
|
244
|
+
* element or other component by specifying a CSS selector. The Coachmark will
|
245
|
+
* remain visible as long as that element remains visible or mounted. When the
|
246
|
+
* element is hidden or component is unmounted, the Coachmark will disappear.
|
247
|
+
*/
|
248
|
+
portalTarget: index.default.string,
|
249
|
+
/**
|
250
|
+
* **Deprecated**
|
251
|
+
* The optional button or beacon that the user will click to show the Coachmark.
|
252
|
+
*/
|
253
|
+
target: index.default.node,
|
254
|
+
/**
|
255
|
+
* **Deprecated**
|
256
|
+
* Determines the theme of the component.
|
257
|
+
*/
|
258
|
+
theme: index.default.oneOf(['light', 'dark'])
|
259
|
+
};
|
215
260
|
|
216
261
|
// The types and DocGen commentary for the component props,
|
217
262
|
// in alphabetical order (for consistency).
|
@@ -246,28 +291,6 @@ exports.Coachmark.propTypes = {
|
|
246
291
|
* Function to call when the Coachmark closes.
|
247
292
|
*/
|
248
293
|
onClose: index.default.func,
|
249
|
-
/**
|
250
|
-
* Optional class name for the Coachmark Overlay component.
|
251
|
-
*/
|
252
|
-
overlayClassName: index.default.string,
|
253
|
-
/**
|
254
|
-
* What kind or style of Coachmark to render.
|
255
|
-
*/
|
256
|
-
overlayKind: index.default.oneOf(['tooltip', 'floating', 'stacked']),
|
257
|
-
overlayRef: index.default.shape({
|
258
|
-
current: overlayRefType
|
259
|
-
}),
|
260
|
-
/**
|
261
|
-
* By default, the Coachmark will be appended to the end of `document.body`.
|
262
|
-
* The Coachmark will remain persistent as the user navigates the app until
|
263
|
-
* the user closes the Coachmark.
|
264
|
-
*
|
265
|
-
* Alternatively, the app developer can tightly couple the Coachmark to a DOM
|
266
|
-
* element or other component by specifying a CSS selector. The Coachmark will
|
267
|
-
* remain visible as long as that element remains visible or mounted. When the
|
268
|
-
* element is hidden or component is unmounted, the Coachmark will disappear.
|
269
|
-
*/
|
270
|
-
portalTarget: index.default.string,
|
271
294
|
/**
|
272
295
|
* Fine tune the position of the target in pixels. Applies only to Beacons.
|
273
296
|
*/
|
@@ -276,12 +299,7 @@ exports.Coachmark.propTypes = {
|
|
276
299
|
x: index.default.number,
|
277
300
|
y: index.default.number
|
278
301
|
}),
|
279
|
-
|
280
|
-
* The optional button or beacon that the user will click to show the Coachmark.
|
281
|
-
*/
|
282
|
-
target: index.default.node,
|
283
|
-
/**
|
284
|
-
* Determines the theme of the component.
|
285
|
-
*/
|
286
|
-
theme: index.default.oneOf(['light', 'dark'])
|
302
|
+
...deprecatedProps
|
287
303
|
};
|
304
|
+
|
305
|
+
exports.deprecatedProps = deprecatedProps;
|
@@ -199,6 +199,12 @@ const useWindowDimensions = () => {
|
|
199
199
|
return windowDimensions;
|
200
200
|
};
|
201
201
|
|
202
|
+
/**@ts-ignore*/
|
203
|
+
exports.CoachmarkOverlay.deprecated = {
|
204
|
+
level: 'warn',
|
205
|
+
details: `${componentName} is deprecated.`
|
206
|
+
};
|
207
|
+
|
202
208
|
// Return a placeholder if not released and not enabled by feature flag
|
203
209
|
exports.CoachmarkOverlay = settings.pkg.checkComponentEnabled(exports.CoachmarkOverlay, componentName);
|
204
210
|
|
@@ -8,3 +8,4 @@ export { Coachmark } from './Coachmark';
|
|
8
8
|
export { BEACON_KIND, COACHMARK_OVERLAY_KIND, COACHMARK_ALIGNMENT, } from './utils/enums';
|
9
9
|
export { useCoachmark } from './utils/context';
|
10
10
|
export type { CoachmarkProps } from './Coachmark';
|
11
|
+
export { CoachmarkTagline } from './CoachmarkTagline';
|
@@ -6,6 +6,13 @@
|
|
6
6
|
*/
|
7
7
|
import { BEACON_KIND } from '../Coachmark';
|
8
8
|
import React from 'react';
|
9
|
+
import { ButtonProps } from '@carbon/react';
|
10
|
+
export interface CoachmarkButtonProps extends ButtonProps<React.ElementType> {
|
11
|
+
onClick?(): void;
|
12
|
+
onDoubleClick?(): void;
|
13
|
+
tabIndex?: number;
|
14
|
+
['aria-bool']?: boolean;
|
15
|
+
}
|
9
16
|
export interface CoachmarkBeaconProps {
|
10
17
|
/**
|
11
18
|
* Optional class name for this component.
|
@@ -21,6 +28,10 @@ export interface CoachmarkBeaconProps {
|
|
21
28
|
* The aria label.
|
22
29
|
*/
|
23
30
|
label: string;
|
31
|
+
/**
|
32
|
+
* button props
|
33
|
+
*/
|
34
|
+
buttonProps?: CoachmarkButtonProps;
|
24
35
|
}
|
25
36
|
/**
|
26
37
|
* Use beacon for the target prop of a Coachmark component.
|
@@ -8,15 +8,14 @@
|
|
8
8
|
'use strict';
|
9
9
|
|
10
10
|
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
11
|
-
require('../Coachmark/Coachmark.js');
|
12
|
-
var context = require('../Coachmark/utils/context.js');
|
13
11
|
var index = require('../../_virtual/index.js');
|
14
12
|
var React = require('react');
|
15
13
|
var cx = require('classnames');
|
16
14
|
var devtools = require('../../global/js/utils/devtools.js');
|
17
15
|
var settings = require('../../settings.js');
|
16
|
+
var react = require('@carbon/react');
|
18
17
|
|
19
|
-
var
|
18
|
+
var _circle;
|
20
19
|
|
21
20
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
22
21
|
const blockClass = `${settings.pkg.prefix}--coachmark-beacon`;
|
@@ -27,17 +26,14 @@ const defaults = {
|
|
27
26
|
/**
|
28
27
|
* Use beacon for the target prop of a Coachmark component.
|
29
28
|
*/
|
30
|
-
exports.CoachmarkBeacon = /*#__PURE__*/React.forwardRef((
|
31
|
-
|
29
|
+
exports.CoachmarkBeacon = /*#__PURE__*/React.forwardRef((props, ref) => {
|
30
|
+
const {
|
32
31
|
label,
|
33
32
|
className,
|
34
33
|
kind = defaults.kind,
|
34
|
+
buttonProps,
|
35
35
|
...rest
|
36
|
-
} =
|
37
|
-
const coachmark = context.useCoachmark();
|
38
|
-
if (!coachmark) {
|
39
|
-
return _div || (_div = /*#__PURE__*/React.createElement("div", null, "CoachmarkBeacon is to be use exclusively within the target prop of Coachmark"));
|
40
|
-
}
|
36
|
+
} = props;
|
41
37
|
return /*#__PURE__*/React.createElement("span", _rollupPluginBabelHelpers.extends({}, rest, {
|
42
38
|
className: cx(blockClass, `${blockClass}-${kind}`, className),
|
43
39
|
ref: ref
|
@@ -46,7 +42,7 @@ exports.CoachmarkBeacon = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
46
42
|
}), /*#__PURE__*/React.createElement("button", _rollupPluginBabelHelpers.extends({
|
47
43
|
tabIndex: 0,
|
48
44
|
type: "button"
|
49
|
-
},
|
45
|
+
}, buttonProps, {
|
50
46
|
className: `${blockClass}__target`
|
51
47
|
}), /*#__PURE__*/React.createElement("svg", {
|
52
48
|
className: `${blockClass}__center`,
|
@@ -69,6 +65,18 @@ exports.CoachmarkBeacon.displayName = componentName;
|
|
69
65
|
// in alphabetical order (for consistency).
|
70
66
|
// See https://www.npmjs.com/package/prop-types#usage.
|
71
67
|
exports.CoachmarkBeacon.propTypes = {
|
68
|
+
/**
|
69
|
+
* button props
|
70
|
+
*/
|
71
|
+
buttonProps: index.default.shape({
|
72
|
+
/**@ts-ignore*/
|
73
|
+
...react.Button.propTypes,
|
74
|
+
/**@ts-ignore*/
|
75
|
+
onClick: index.default.func,
|
76
|
+
onDoubleClick: index.default.func,
|
77
|
+
tabIndex: index.default.number,
|
78
|
+
['aria-expanded']: index.default.bool
|
79
|
+
}),
|
72
80
|
/**
|
73
81
|
* Optional class name for this component.
|
74
82
|
*/
|
@@ -16,6 +16,7 @@ var devtools = require('../../global/js/utils/devtools.js');
|
|
16
16
|
var settings = require('../../settings.js');
|
17
17
|
require('../Coachmark/Coachmark.js');
|
18
18
|
var context = require('../Coachmark/utils/context.js');
|
19
|
+
require('../Coachmark/CoachmarkTagline.js');
|
19
20
|
|
20
21
|
var _div;
|
21
22
|
|
@@ -71,6 +72,12 @@ exports.CoachmarkButton = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
71
72
|
}, devtools.getDevtoolsProps(componentName), coachmark.buttonProps), label);
|
72
73
|
});
|
73
74
|
|
75
|
+
/**@ts-ignore*/
|
76
|
+
exports.CoachmarkButton.deprecated = {
|
77
|
+
level: 'warn',
|
78
|
+
details: `${componentName} is deprecated.`
|
79
|
+
};
|
80
|
+
|
74
81
|
// Return a placeholder if not released and not enabled by feature flag
|
75
82
|
exports.CoachmarkButton = settings.pkg.checkComponentEnabled(exports.CoachmarkButton, componentName);
|
76
83
|
|
@@ -53,6 +53,12 @@ exports.CoachmarkOverlayElement = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
53
53
|
}, button));
|
54
54
|
});
|
55
55
|
|
56
|
+
/**@ts-ignore*/
|
57
|
+
exports.CoachmarkOverlayElement.deprecated = {
|
58
|
+
level: 'warn',
|
59
|
+
details: `${componentName} is deprecated.`
|
60
|
+
};
|
61
|
+
|
56
62
|
// Return a placeholder if not released and not enabled by feature flag
|
57
63
|
exports.CoachmarkOverlayElement = settings.pkg.checkComponentEnabled(exports.CoachmarkOverlayElement, componentName);
|
58
64
|
|
@@ -20,6 +20,7 @@ var pconsole = require('../../global/js/utils/pconsole.js');
|
|
20
20
|
var settings = require('../../settings.js');
|
21
21
|
require('../Coachmark/Coachmark.js');
|
22
22
|
var context = require('../Coachmark/utils/context.js');
|
23
|
+
require('../Coachmark/CoachmarkTagline.js');
|
23
24
|
|
24
25
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
25
26
|
const blockClass = `${settings.pkg.prefix}--coachmark-overlay-elements`;
|
@@ -164,6 +165,12 @@ exports.CoachmarkOverlayElements = /*#__PURE__*/React.forwardRef((_ref, ref) =>
|
|
164
165
|
}, coachmark.closeButtonProps), closeButtonLabel))));
|
165
166
|
});
|
166
167
|
|
168
|
+
/**@ts-ignore*/
|
169
|
+
exports.CoachmarkOverlayElements.deprecated = {
|
170
|
+
level: 'warn',
|
171
|
+
details: `${componentName} is deprecated.`
|
172
|
+
};
|
173
|
+
|
167
174
|
// Return a placeholder if not released and not enabled by feature flag
|
168
175
|
exports.CoachmarkOverlayElements = settings.pkg.checkComponentEnabled(exports.CoachmarkOverlayElements, componentName);
|
169
176
|
|
@@ -84,6 +84,7 @@ const DatagridContent = _ref => {
|
|
84
84
|
const contentRows = DatagridPagination && page || rows;
|
85
85
|
const gridAreaRef = React.useRef(null);
|
86
86
|
const multiKeyTrackingRef = React.useRef(null);
|
87
|
+
const carbonPrefix = react.usePrefix();
|
87
88
|
const enableEditableCell = index$1.useFeatureFlag('enable-datagrid-useEditableCell');
|
88
89
|
const enableInlineEdit = index$1.useFeatureFlag('enable-datagrid-useInlineEdit');
|
89
90
|
const enableCustomizeCols = index$1.useFeatureFlag('enable-datagrid-useCustomizeColumns');
|
@@ -137,7 +138,8 @@ const DatagridContent = _ref => {
|
|
137
138
|
keysPressedList,
|
138
139
|
state: inlineEditState,
|
139
140
|
usingMac,
|
140
|
-
ref: multiKeyTrackingRef
|
141
|
+
ref: multiKeyTrackingRef,
|
142
|
+
carbonPrefix
|
141
143
|
})),
|
142
144
|
onFocus: withInlineEdit && (() => handleGridFocus.handleGridFocus(inlineEditState, dispatch)),
|
143
145
|
title
|
@@ -160,12 +162,12 @@ const DatagridContent = _ref => {
|
|
160
162
|
return;
|
161
163
|
}
|
162
164
|
const gridElement = document.querySelector(`#${tableId}`);
|
163
|
-
const tableHeader = gridElement?.querySelector(`.${
|
165
|
+
const tableHeader = gridElement?.querySelector(`.${carbonPrefix}--data-table-header`);
|
164
166
|
gridElement?.style?.setProperty(`--${blockClass}--grid-width`, layout.px((totalColumnsWidth || 0) + 32));
|
165
167
|
if (gridActive) {
|
166
168
|
gridElement?.style.setProperty(`--${blockClass}--grid-header-height`, layout.px(tableHeader?.clientHeight || 0));
|
167
169
|
}
|
168
|
-
}, [withInlineEdit, tableId, totalColumnsWidth, datagridState, gridActive]);
|
170
|
+
}, [withInlineEdit, tableId, totalColumnsWidth, datagridState, gridActive, carbonPrefix]);
|
169
171
|
useSubscribeToEventEmitter.default(constants.CLEAR_SINGLE_FILTER, id => FilterProvider.clearSingleFilter(id, setAllFilters, state, contextTableId));
|
170
172
|
const renderFilterSummary = () => state.filters.length > 0 && /*#__PURE__*/React.createElement(FilterSummary.default, {
|
171
173
|
className: `${blockClass}__filter-summary`,
|
@@ -43,6 +43,7 @@ const DatagridRow = datagridState => {
|
|
43
43
|
visibleColumns,
|
44
44
|
getAsyncSubRows
|
45
45
|
} = datagridState;
|
46
|
+
const carbonPrefix = react.usePrefix();
|
46
47
|
const getVisibleNestedRowCount = _ref => {
|
47
48
|
let {
|
48
49
|
isExpanded,
|
@@ -122,7 +123,7 @@ const DatagridRow = datagridState => {
|
|
122
123
|
[`${blockClass}__carbon-row-expanded`]: row.isExpanded,
|
123
124
|
[`${blockClass}__carbon-row-expandable`]: row.canExpand,
|
124
125
|
[`${blockClass}__carbon-row-expandable--async`]: getAsyncSubRows && row.depth > 0,
|
125
|
-
[`${
|
126
|
+
[`${carbonPrefix}--data-table--selected`]: row.isSelected,
|
126
127
|
[`${blockClass}__slug--row`]: /*#__PURE__*/React.isValidElement(row?.original?.slug),
|
127
128
|
[`${blockClass}__ai-label--row`]: /*#__PURE__*/React.isValidElement(row?.original?.aiLabel)
|
128
129
|
});
|
@@ -37,6 +37,7 @@ const DatagridBatchActionsToolbar = (datagridState, width, ref) => {
|
|
37
37
|
batchActionMenuButtonLabel,
|
38
38
|
translateWithIdBatchActions
|
39
39
|
} = datagridState;
|
40
|
+
const carbonPrefix = react.usePrefix();
|
40
41
|
const [availableRowsCount, setAvailableRowsCount] = React.useState(rows.length);
|
41
42
|
const batchActionMenuButtonLabelText = batchActionMenuButtonLabel ?? 'More';
|
42
43
|
const selectedKeys = Object.keys(selectedRowIds || {});
|
@@ -53,19 +54,19 @@ const DatagridBatchActionsToolbar = (datagridState, width, ref) => {
|
|
53
54
|
// the ButtonMenu
|
54
55
|
React.useEffect(() => {
|
55
56
|
if (totalSelected === 1 && !receivedInitialWidth) {
|
56
|
-
const batchActionListWidth = ref?.current?.querySelector(`.${
|
57
|
+
const batchActionListWidth = ref?.current?.querySelector(`.${carbonPrefix}--action-list`).offsetWidth;
|
57
58
|
setInitialListWidth(batchActionListWidth);
|
58
59
|
setReceivedInitialWidth(true);
|
59
60
|
}
|
60
|
-
}, [totalSelected, receivedInitialWidth, ref]);
|
61
|
+
}, [totalSelected, receivedInitialWidth, ref, carbonPrefix]);
|
61
62
|
React.useEffect(() => {
|
62
|
-
const summaryWidth = ref?.current.querySelector(`.${
|
63
|
+
const summaryWidth = ref?.current.querySelector(`.${carbonPrefix}--batch-summary`).offsetWidth;
|
63
64
|
if (width < summaryWidth + initialListWidth + 32) {
|
64
65
|
setDisplayAllInMenu(true);
|
65
66
|
} else {
|
66
67
|
setDisplayAllInMenu(false);
|
67
68
|
}
|
68
|
-
}, [width, ref, initialListWidth]);
|
69
|
+
}, [width, ref, initialListWidth, carbonPrefix]);
|
69
70
|
const getSelectedRowData = () => {
|
70
71
|
if (selectedKeys.length === 0) {
|
71
72
|
return [];
|
@@ -153,7 +154,7 @@ const DatagridBatchActionsToolbar = (datagridState, width, ref) => {
|
|
153
154
|
renderIcon: batchAction.renderIcon,
|
154
155
|
onClick: event => onClickHandler(event, batchAction),
|
155
156
|
className: cx({
|
156
|
-
[`${
|
157
|
+
[`${carbonPrefix}--noLabel`]: !batchAction.label || batchAction.label === ''
|
157
158
|
}),
|
158
159
|
iconDescription: batchAction.label,
|
159
160
|
tabIndex: totalSelected > 0 ? 0 : -1
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export function handleGridKeyPress({ event, dispatch, state, instance, keysPressedList, usingMac, ref, }: {
|
1
|
+
export function handleGridKeyPress({ event, dispatch, state, instance, keysPressedList, usingMac, ref, carbonPrefix, }: {
|
2
2
|
event: any;
|
3
3
|
dispatch: any;
|
4
4
|
state: any;
|
@@ -6,4 +6,5 @@ export function handleGridKeyPress({ event, dispatch, state, instance, keysPress
|
|
6
6
|
keysPressedList: any;
|
7
7
|
usingMac: any;
|
8
8
|
ref: any;
|
9
|
+
carbonPrefix: any;
|
9
10
|
}): void;
|
@@ -20,7 +20,8 @@ const handleGridKeyPress = _ref => {
|
|
20
20
|
instance,
|
21
21
|
keysPressedList,
|
22
22
|
usingMac,
|
23
|
-
ref
|
23
|
+
ref,
|
24
|
+
carbonPrefix
|
24
25
|
} = _ref;
|
25
26
|
const {
|
26
27
|
key
|
@@ -75,7 +76,7 @@ const handleGridKeyPress = _ref => {
|
|
75
76
|
|
76
77
|
// Checks if the date picker is open
|
77
78
|
const datePickerIsActive = () => {
|
78
|
-
const focusedCalendarElement = document.querySelector(`.${
|
79
|
+
const focusedCalendarElement = document.querySelector(`.${carbonPrefix}--date-picker__input.flatpickr-input.active`);
|
79
80
|
if (focusedCalendarElement || document.activeElement.classList.contains(`flatpickr-day`)) {
|
80
81
|
return true;
|
81
82
|
}
|
@@ -29,6 +29,7 @@ const RowSizeDropdown = _ref => {
|
|
29
29
|
} = _ref;
|
30
30
|
const radioGroupRef = React.useRef(undefined);
|
31
31
|
const [isOpen, setIsOpen] = React.useState(false);
|
32
|
+
const carbonPrefix = react.usePrefix();
|
32
33
|
const onCloseHandler = () => {
|
33
34
|
setIsOpen(false);
|
34
35
|
};
|
@@ -45,7 +46,7 @@ const RowSizeDropdown = _ref => {
|
|
45
46
|
React.useEffect(() => {
|
46
47
|
if (isOpen) {
|
47
48
|
const radioGroupParentElement = radioGroupRef?.current;
|
48
|
-
const checkedRadioChild = radioGroupParentElement?.querySelector(`.${
|
49
|
+
const checkedRadioChild = radioGroupParentElement?.querySelector(`.${carbonPrefix}--radio-button:checked`);
|
49
50
|
checkedRadioChild?.focus();
|
50
51
|
}
|
51
52
|
}, [isOpen]);
|
@@ -16,9 +16,11 @@ var cx = require('classnames');
|
|
16
16
|
var settings = require('../../settings.js');
|
17
17
|
var useFocusRowExpander = require('./useFocusRowExpander.js');
|
18
18
|
var stateReducer = require('./Datagrid/addons/stateReducer.js');
|
19
|
+
var react = require('@carbon/react');
|
19
20
|
|
20
21
|
const blockClass = `${settings.pkg.prefix}--datagrid`;
|
21
22
|
const useNestedRowExpander = hooks => {
|
23
|
+
const carbonPrefix = react.usePrefix();
|
22
24
|
const tempState = React.useRef(undefined);
|
23
25
|
const lastExpandedRowIndex = React.useRef(undefined);
|
24
26
|
const useInstance = instance => {
|
@@ -84,7 +86,7 @@ const useNestedRowExpander = hooks => {
|
|
84
86
|
return row.canExpand || getAsyncSubRows ? /*#__PURE__*/React.createElement("button", _rollupPluginBabelHelpers.extends({
|
85
87
|
type: "button",
|
86
88
|
"aria-label": expanderTitle,
|
87
|
-
className: cx(`${blockClass}__row-expander`, `${
|
89
|
+
className: cx(`${blockClass}__row-expander`, `${carbonPrefix}--btn`, `${carbonPrefix}--btn--ghost`)
|
88
90
|
}, expanderButtonProps), /*#__PURE__*/React.createElement(icons.ChevronRight, {
|
89
91
|
className: cx(`${blockClass}__expander-icon`, {
|
90
92
|
[`${blockClass}__expander-icon--not-open`]: !row.isExpanded,
|
@@ -10,9 +10,11 @@
|
|
10
10
|
Object.defineProperty(exports, '__esModule', { value: true });
|
11
11
|
|
12
12
|
var settings = require('../../settings.js');
|
13
|
+
var react = require('@carbon/react');
|
13
14
|
|
14
15
|
const useOnRowClick = hooks => {
|
15
16
|
const useInstance = rowInstance => {
|
17
|
+
const carbonPrefix = react.usePrefix();
|
16
18
|
const {
|
17
19
|
onRowClick
|
18
20
|
} = rowInstance;
|
@@ -36,14 +38,14 @@ const useOnRowClick = hooks => {
|
|
36
38
|
// We do not want to change the list of selected rows if using the useSelectedRows hook, otherwise clicking on an entire row will mark the row as checked
|
37
39
|
|
38
40
|
// Remove selected class from all other clickable rows as only one clickable row can be selected at a time
|
39
|
-
const clickableSelectedRows = document.querySelectorAll(`#${tableId}.${settings.pkg.prefix}--datagrid .${
|
41
|
+
const clickableSelectedRows = document.querySelectorAll(`#${tableId}.${settings.pkg.prefix}--datagrid .${carbonPrefix}--data-table--selected:not(.${settings.pkg.prefix}--datagrid__active-row)`);
|
40
42
|
if (clickableSelectedRows.length) {
|
41
43
|
Array.from(clickableSelectedRows).forEach(row => {
|
42
|
-
row.classList.remove(`${
|
44
|
+
row.classList.remove(`${carbonPrefix}--data-table--selected`);
|
43
45
|
});
|
44
46
|
}
|
45
47
|
const closestRow = event.currentTarget.closest('tr');
|
46
|
-
closestRow.classList.add(`${
|
48
|
+
closestRow.classList.add(`${carbonPrefix}--data-table--selected`);
|
47
49
|
if (!withSelectRows) {
|
48
50
|
if (instance.selectedFlatRows) {
|
49
51
|
instance.selectedFlatRows.map(toggleRow => toggleRow.toggleRowSelected?.(false));
|
@@ -15,6 +15,7 @@ var icons = require('@carbon/react/icons');
|
|
15
15
|
var settings = require('../../settings.js');
|
16
16
|
var cx = require('classnames');
|
17
17
|
var useFocusRowExpander = require('./useFocusRowExpander.js');
|
18
|
+
var react = require('@carbon/react');
|
18
19
|
|
19
20
|
const blockClass = `${settings.pkg.prefix}--datagrid`;
|
20
21
|
const useRowExpander = hooks => {
|
@@ -23,6 +24,7 @@ const useRowExpander = hooks => {
|
|
23
24
|
const useInstance = instance => {
|
24
25
|
tempState.current = instance;
|
25
26
|
};
|
27
|
+
const carbonPrefix = react.usePrefix();
|
26
28
|
useFocusRowExpander.useFocusRowExpander({
|
27
29
|
instance: tempState?.current,
|
28
30
|
lastExpandedRowIndex: lastExpandedRowIndex?.current,
|
@@ -55,7 +57,7 @@ const useRowExpander = hooks => {
|
|
55
57
|
return row.canExpand && /*#__PURE__*/React.createElement("button", _rollupPluginBabelHelpers.extends({
|
56
58
|
type: "button",
|
57
59
|
"aria-label": expanderTitle,
|
58
|
-
className: cx(`${blockClass}__row-expander`, `${
|
60
|
+
className: cx(`${blockClass}__row-expander`, `${carbonPrefix}--btn`, `${carbonPrefix}--btn--ghost`)
|
59
61
|
}, expanderButtonProps), row.isExpanded ? /*#__PURE__*/React.createElement(icons.ChevronUp, {
|
60
62
|
className: `${blockClass}__row-expander--icon`
|
61
63
|
}) : /*#__PURE__*/React.createElement(icons.ChevronDown, {
|
@@ -56,6 +56,7 @@ const useSelectRows = hooks => {
|
|
56
56
|
});
|
57
57
|
};
|
58
58
|
const useHighlightSelection = hooks => {
|
59
|
+
const carbonPrefix = react.usePrefix();
|
59
60
|
const getRowProps = (props, _ref) => {
|
60
61
|
let {
|
61
62
|
row
|
@@ -65,7 +66,7 @@ const useHighlightSelection = hooks => {
|
|
65
66
|
} = row.getToggleRowSelectedProps();
|
66
67
|
return [props, {
|
67
68
|
className: cx([`${blockClass}__carbon-row`, {
|
68
|
-
[`${
|
69
|
+
[`${carbonPrefix}--data-table--selected`]: checked,
|
69
70
|
[`${blockClass}__active-row`]: checked
|
70
71
|
}])
|
71
72
|
}];
|