@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
package/es/_virtual/index2.js
CHANGED
@@ -5,6 +5,10 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
|
8
|
-
|
8
|
+
import { getDefaultExportFromCjs } from './_commonjsHelpers.js';
|
9
|
+
import { __require as requireLodash_debounce } from '../node_modules/lodash.debounce/index.js';
|
9
10
|
|
10
|
-
|
11
|
+
var lodash_debounceExports = requireLodash_debounce();
|
12
|
+
var debounce = /*@__PURE__*/getDefaultExportFromCjs(lodash_debounceExports);
|
13
|
+
|
14
|
+
export { debounce as default };
|
@@ -8,16 +8,17 @@
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
9
9
|
import React__default, { useState } from 'react';
|
10
10
|
import PropTypes from '../../_virtual/index.js';
|
11
|
-
import {
|
11
|
+
import { Search, unstable_FeatureFlags, Popover, IconButton, PopoverContent, Checkbox, Tag } from '@carbon/react';
|
12
12
|
import { Filter } from '@carbon/react/icons';
|
13
13
|
import { pkg } from '../../settings.js';
|
14
14
|
import { AddSelectList } from './AddSelectList.js';
|
15
15
|
import { AddSelectSort } from './AddSelectSort.js';
|
16
16
|
import { sortItems } from './add-select-utils.js';
|
17
17
|
import { useItemSort } from './hooks/useItemSort.js';
|
18
|
-
import
|
18
|
+
import { useId } from '../../global/js/utils/useId.js';
|
19
19
|
import useParentSelect from './hooks/useParentSelect.js';
|
20
20
|
|
21
|
+
var _Filter;
|
21
22
|
const blockClass = `${pkg.prefix}--add-select`;
|
22
23
|
const colClass = `${blockClass}__column`;
|
23
24
|
const componentName = 'AddSelectColumn';
|
@@ -35,11 +36,13 @@ let AddSelectColumn = _ref => {
|
|
35
36
|
sortByLabel,
|
36
37
|
...props
|
37
38
|
} = _ref;
|
38
|
-
const carbonPrefix = usePrefix();
|
39
39
|
const {
|
40
40
|
parentSelected,
|
41
41
|
setParentSelected
|
42
42
|
} = useParentSelect();
|
43
|
+
const selectAllId = useId();
|
44
|
+
const filterId = useId();
|
45
|
+
const searchId = useId();
|
43
46
|
const [searchTerm, setSearchTerm] = useState('');
|
44
47
|
const {
|
45
48
|
sortDirection,
|
@@ -47,6 +50,7 @@ let AddSelectColumn = _ref => {
|
|
47
50
|
sortAttribute,
|
48
51
|
setSortAttribute
|
49
52
|
} = useItemSort();
|
53
|
+
const [filterOpen, setFilterOpen] = useState(false);
|
50
54
|
const [filters, setFilters] = useState([]);
|
51
55
|
const {
|
52
56
|
entries,
|
@@ -112,6 +116,7 @@ let AddSelectColumn = _ref => {
|
|
112
116
|
const filterByValue = item[filterBy];
|
113
117
|
return filters.some(filter => filter === filterByValue);
|
114
118
|
};
|
119
|
+
const filterBtnId = `filter-${filterId}`;
|
115
120
|
const sortFn = sortItems(sortAttribute, sortDirection);
|
116
121
|
const colItems = entries.filter(filterBySearch) // first check if the item meets the search
|
117
122
|
.filter(filterByAttribute) // then check if the item is included in the filter
|
@@ -130,7 +135,7 @@ let AddSelectColumn = _ref => {
|
|
130
135
|
onChange: e => setSearchTerm(e.target.value),
|
131
136
|
placeholder: columnInputPlaceholder,
|
132
137
|
className: `${colClass}-input`,
|
133
|
-
id:
|
138
|
+
id: searchId,
|
134
139
|
labelText: columnInputPlaceholder,
|
135
140
|
size: "md"
|
136
141
|
}), /*#__PURE__*/React__default.createElement("div", {
|
@@ -143,20 +148,38 @@ let AddSelectColumn = _ref => {
|
|
143
148
|
sortDirection: sortDirection,
|
144
149
|
sortBy: sortBy,
|
145
150
|
sortByLabel: sortByLabel
|
146
|
-
}), filterByOpts.length > 0 && /*#__PURE__*/React__default.createElement(
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
151
|
+
}), filterByOpts.length > 0 && /*#__PURE__*/React__default.createElement(unstable_FeatureFlags, {
|
152
|
+
enableV12DynamicFloatingStyles: true
|
153
|
+
}, /*#__PURE__*/React__default.createElement(Popover, {
|
154
|
+
align: "bottom-right",
|
155
|
+
isTabTip: true,
|
156
|
+
onKeyDown: e => {
|
157
|
+
if (e.key === 'Escape') {
|
158
|
+
setFilterOpen(false);
|
159
|
+
e.preventDefault(); // prevent modal close
|
160
|
+
e.stopPropagation();
|
161
|
+
const filterBtn = document.querySelector(`#${filterBtnId}`);
|
162
|
+
filterBtn?.focus(); // workaround to return focus, refs not possible on button inside popover for some reason
|
163
|
+
}
|
164
|
+
},
|
165
|
+
onRequestClose: () => setFilterOpen(false),
|
166
|
+
open: filterOpen
|
167
|
+
}, /*#__PURE__*/React__default.createElement(IconButton, {
|
168
|
+
size: "md",
|
169
|
+
id: filterBtnId,
|
170
|
+
hasIconOnly: true,
|
171
|
+
"aria-expanded": filterOpen,
|
172
|
+
badgeCount: filters.length > 0 ? 0 : undefined // setting to 0 renders an empty dot
|
173
|
+
,
|
174
|
+
kind: "ghost",
|
175
|
+
label: filterByLabel || 'Filter',
|
176
|
+
onClick: () => {
|
177
|
+
setFilterOpen(prev => !prev);
|
178
|
+
}
|
179
|
+
}, _Filter || (_Filter = /*#__PURE__*/React__default.createElement(Filter, null))), /*#__PURE__*/React__default.createElement(PopoverContent, {
|
180
|
+
className: `${colClass}-filter-popover`
|
181
|
+
}, filterByOpts.map(opt => /*#__PURE__*/React__default.createElement(Checkbox, {
|
155
182
|
key: opt,
|
156
|
-
className: `${carbonPrefix}--overflow-menu-options__option`
|
157
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
158
|
-
className: `${carbonPrefix}--overflow-menu-options__btn`
|
159
|
-
}, /*#__PURE__*/React__default.createElement(Checkbox, {
|
160
183
|
id: opt,
|
161
184
|
labelText: opt,
|
162
185
|
onChange: (event, _ref3) => {
|
@@ -169,7 +192,7 @@ let AddSelectColumn = _ref => {
|
|
169
192
|
}))))))), /*#__PURE__*/React__default.createElement("div", {
|
170
193
|
className: `${blockClass}__tags`
|
171
194
|
}, /*#__PURE__*/React__default.createElement(Checkbox, {
|
172
|
-
id: `${
|
195
|
+
id: `${selectAllId}-select-all`,
|
173
196
|
className: `${colClass}__select-all`,
|
174
197
|
checked: allSelected,
|
175
198
|
onChange: selectAllHandler,
|
@@ -8,11 +8,10 @@
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
9
9
|
import React__default from 'react';
|
10
10
|
import PropTypes from '../../_virtual/index.js';
|
11
|
-
import { OverflowMenu,
|
12
|
-
import {
|
11
|
+
import { unstable_FeatureFlags, OverflowMenu, MenuItem } from '@carbon/react';
|
12
|
+
import { ArrowsVertical } from '@carbon/react/icons';
|
13
13
|
import { pkg } from '../../settings.js';
|
14
14
|
|
15
|
-
var _ArrowUp, _ArrowDown;
|
16
15
|
const blockClass = `${pkg.prefix}--add-select-sort`;
|
17
16
|
const componentName = 'AddSelectSort';
|
18
17
|
const AddSelectSort = _ref => {
|
@@ -25,16 +24,12 @@ const AddSelectSort = _ref => {
|
|
25
24
|
const sortByOpts = sortBy ? sortBy?.reduce((acc, cur) => {
|
26
25
|
const opts = [{
|
27
26
|
id: `${cur}-asc`,
|
28
|
-
|
29
|
-
size: 16
|
30
|
-
})), cur),
|
27
|
+
label: cur,
|
31
28
|
direction: 'asc',
|
32
29
|
attribute: cur
|
33
30
|
}, {
|
34
31
|
id: `${cur}-desc`,
|
35
|
-
|
36
|
-
size: 16
|
37
|
-
})), cur),
|
32
|
+
label: cur,
|
38
33
|
direction: 'desc',
|
39
34
|
attribute: cur
|
40
35
|
}];
|
@@ -52,22 +47,26 @@ const AddSelectSort = _ref => {
|
|
52
47
|
};
|
53
48
|
return /*#__PURE__*/React__default.createElement("div", {
|
54
49
|
className: blockClass
|
55
|
-
}, sortByOpts.length > 0 && /*#__PURE__*/React__default.createElement(
|
50
|
+
}, sortByOpts.length > 0 && /*#__PURE__*/React__default.createElement(unstable_FeatureFlags, {
|
51
|
+
enableV12Overflowmenu: true
|
52
|
+
}, /*#__PURE__*/React__default.createElement(OverflowMenu
|
53
|
+
// @ts-ignore // TODO: remove after carbon fixes this ts error
|
54
|
+
, {
|
55
|
+
autoAlign: true,
|
56
|
+
menuAlignment: "bottom-end",
|
56
57
|
renderIcon: props => /*#__PURE__*/React__default.createElement(ArrowsVertical, _extends({
|
57
58
|
size: 32
|
58
59
|
}, props)),
|
59
60
|
className: `${blockClass}_overflow`,
|
60
|
-
|
61
|
-
"aria-label": sortByLabel,
|
62
|
-
iconDescription: sortByLabel
|
61
|
+
label: sortByLabel
|
63
62
|
}, sortByOpts.map(opt => {
|
64
|
-
return /*#__PURE__*/React__default.createElement(
|
63
|
+
return /*#__PURE__*/React__default.createElement(MenuItem, {
|
65
64
|
className: `${blockClass}_overflow-item`,
|
66
65
|
key: opt?.id,
|
67
|
-
|
66
|
+
label: `${opt?.label} ${opt?.direction}`,
|
68
67
|
onClick: () => sortHandler(opt)
|
69
68
|
});
|
70
|
-
})));
|
69
|
+
}))));
|
71
70
|
};
|
72
71
|
AddSelectSort.propTypes = {
|
73
72
|
setSortAttribute: PropTypes.func,
|
@@ -10,7 +10,7 @@ type LinkType = {
|
|
10
10
|
[key: string]: unknown;
|
11
11
|
};
|
12
12
|
export interface ActionIcon extends Metadata {
|
13
|
-
|
13
|
+
onKeyDown?: (event: KeyboardEvent) => void;
|
14
14
|
onClick?: (event: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void;
|
15
15
|
/**
|
16
16
|
* @deprecated please use the `link.href` instead
|
@@ -22,7 +22,7 @@ type OverflowActions = {
|
|
22
22
|
id?: string;
|
23
23
|
itemText?: string;
|
24
24
|
onClick?: () => void;
|
25
|
-
|
25
|
+
onKeyDown?: () => void;
|
26
26
|
};
|
27
27
|
interface CardProp extends PropsWithChildren {
|
28
28
|
actionIcons?: readonly ActionIcon[];
|
@@ -96,12 +96,15 @@ const Card = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
96
96
|
let {
|
97
97
|
id,
|
98
98
|
itemText,
|
99
|
-
|
99
|
+
onKeyDown,
|
100
|
+
onClick
|
100
101
|
} = _ref2;
|
101
|
-
return /*#__PURE__*/React__default.createElement(MenuItem,
|
102
|
+
return /*#__PURE__*/React__default.createElement(MenuItem, {
|
102
103
|
key: id,
|
103
|
-
label: itemText ?? ''
|
104
|
-
|
104
|
+
label: itemText ?? '',
|
105
|
+
onKeyDown: onKeyDown,
|
106
|
+
onClick: onClick
|
107
|
+
});
|
105
108
|
}))));
|
106
109
|
}
|
107
110
|
const icons = getIcons().map(_ref3 => {
|
@@ -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
|
+
};
|
@@ -70,6 +70,10 @@ let Coachmark = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
70
70
|
const _overlayRef = overlayRef || overlayBackupRef;
|
71
71
|
const portalNode = useRef(null);
|
72
72
|
const popoverRef = useRef(null);
|
73
|
+
let targetName;
|
74
|
+
if (/*#__PURE__*/React__default.isValidElement(target) && typeof target.type !== 'string') {
|
75
|
+
targetName = target.type;
|
76
|
+
}
|
73
77
|
useIsomorphicEffect(() => {
|
74
78
|
portalNode.current = portalTarget ? document?.querySelector(portalTarget) ?? document?.querySelector('body') : document?.querySelector('body');
|
75
79
|
}, [portalTarget]);
|
@@ -173,7 +177,9 @@ let Coachmark = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
173
177
|
}, /*#__PURE__*/React__default.createElement("div", _extends({
|
174
178
|
className: cx(blockClass, `${blockClass}__${theme}`, className),
|
175
179
|
ref: _coachmarkRef
|
176
|
-
}, rest, getDevtoolsProps(componentName)), overlayKind !== 'tooltip' ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null,
|
180
|
+
}, rest, getDevtoolsProps(componentName)), overlayKind !== 'tooltip' ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, targetName?.displayName === 'CoachmarkBeacon' ? /*#__PURE__*/React__default.cloneElement(target, {
|
181
|
+
buttonProps: contextValue.buttonProps
|
182
|
+
}) : target, isOpen && portalNode?.current && /*#__PURE__*/createPortal(/*#__PURE__*/React__default.createElement(CoachmarkOverlay, {
|
177
183
|
ref: _overlayRef,
|
178
184
|
fixedIsVisible: false,
|
179
185
|
kind: overlayKind,
|
@@ -189,7 +195,9 @@ let Coachmark = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
189
195
|
align: align,
|
190
196
|
autoAlign: autoAlign,
|
191
197
|
open: isOpen
|
192
|
-
},
|
198
|
+
}, targetName?.displayName === 'CoachmarkBeacon' ? /*#__PURE__*/React__default.cloneElement(target, {
|
199
|
+
buttonProps: contextValue.buttonProps
|
200
|
+
}) : target, /*#__PURE__*/React__default.createElement(PopoverContent, null, isOpen && /*#__PURE__*/React__default.createElement(CoachmarkOverlay, {
|
193
201
|
ref: _overlayRef,
|
194
202
|
fixedIsVisible: false,
|
195
203
|
kind: overlayKind,
|
@@ -210,6 +218,43 @@ Coachmark = pkg.checkComponentEnabled(Coachmark, componentName);
|
|
210
218
|
// The display name of the component, used by React. Note that displayName
|
211
219
|
// is used in preference to relying on function.name.
|
212
220
|
Coachmark.displayName = componentName;
|
221
|
+
const deprecatedProps = {
|
222
|
+
/**
|
223
|
+
* **Deprecated**
|
224
|
+
* Optional class name for the Coachmark Overlay component.
|
225
|
+
*/
|
226
|
+
overlayClassName: PropTypes.string,
|
227
|
+
/**
|
228
|
+
* **Deprecated**
|
229
|
+
* What kind or style of Coachmark to render.
|
230
|
+
*/
|
231
|
+
overlayKind: PropTypes.oneOf(['tooltip', 'floating', 'stacked']),
|
232
|
+
overlayRef: PropTypes.shape({
|
233
|
+
current: overlayRefType
|
234
|
+
}),
|
235
|
+
/**
|
236
|
+
* **Deprecated**
|
237
|
+
* By default, the Coachmark will be appended to the end of `document.body`.
|
238
|
+
* The Coachmark will remain persistent as the user navigates the app until
|
239
|
+
* the user closes the Coachmark.
|
240
|
+
*
|
241
|
+
* Alternatively, the app developer can tightly couple the Coachmark to a DOM
|
242
|
+
* element or other component by specifying a CSS selector. The Coachmark will
|
243
|
+
* remain visible as long as that element remains visible or mounted. When the
|
244
|
+
* element is hidden or component is unmounted, the Coachmark will disappear.
|
245
|
+
*/
|
246
|
+
portalTarget: PropTypes.string,
|
247
|
+
/**
|
248
|
+
* **Deprecated**
|
249
|
+
* The optional button or beacon that the user will click to show the Coachmark.
|
250
|
+
*/
|
251
|
+
target: PropTypes.node,
|
252
|
+
/**
|
253
|
+
* **Deprecated**
|
254
|
+
* Determines the theme of the component.
|
255
|
+
*/
|
256
|
+
theme: PropTypes.oneOf(['light', 'dark'])
|
257
|
+
};
|
213
258
|
|
214
259
|
// The types and DocGen commentary for the component props,
|
215
260
|
// in alphabetical order (for consistency).
|
@@ -244,28 +289,6 @@ Coachmark.propTypes = {
|
|
244
289
|
* Function to call when the Coachmark closes.
|
245
290
|
*/
|
246
291
|
onClose: PropTypes.func,
|
247
|
-
/**
|
248
|
-
* Optional class name for the Coachmark Overlay component.
|
249
|
-
*/
|
250
|
-
overlayClassName: PropTypes.string,
|
251
|
-
/**
|
252
|
-
* What kind or style of Coachmark to render.
|
253
|
-
*/
|
254
|
-
overlayKind: PropTypes.oneOf(['tooltip', 'floating', 'stacked']),
|
255
|
-
overlayRef: PropTypes.shape({
|
256
|
-
current: overlayRefType
|
257
|
-
}),
|
258
|
-
/**
|
259
|
-
* By default, the Coachmark will be appended to the end of `document.body`.
|
260
|
-
* The Coachmark will remain persistent as the user navigates the app until
|
261
|
-
* the user closes the Coachmark.
|
262
|
-
*
|
263
|
-
* Alternatively, the app developer can tightly couple the Coachmark to a DOM
|
264
|
-
* element or other component by specifying a CSS selector. The Coachmark will
|
265
|
-
* remain visible as long as that element remains visible or mounted. When the
|
266
|
-
* element is hidden or component is unmounted, the Coachmark will disappear.
|
267
|
-
*/
|
268
|
-
portalTarget: PropTypes.string,
|
269
292
|
/**
|
270
293
|
* Fine tune the position of the target in pixels. Applies only to Beacons.
|
271
294
|
*/
|
@@ -274,14 +297,7 @@ Coachmark.propTypes = {
|
|
274
297
|
x: PropTypes.number,
|
275
298
|
y: PropTypes.number
|
276
299
|
}),
|
277
|
-
|
278
|
-
* The optional button or beacon that the user will click to show the Coachmark.
|
279
|
-
*/
|
280
|
-
target: PropTypes.node,
|
281
|
-
/**
|
282
|
-
* Determines the theme of the component.
|
283
|
-
*/
|
284
|
-
theme: PropTypes.oneOf(['light', 'dark'])
|
300
|
+
...deprecatedProps
|
285
301
|
};
|
286
302
|
|
287
|
-
export { Coachmark };
|
303
|
+
export { Coachmark, deprecatedProps };
|
@@ -197,6 +197,12 @@ const useWindowDimensions = () => {
|
|
197
197
|
return windowDimensions;
|
198
198
|
};
|
199
199
|
|
200
|
+
/**@ts-ignore*/
|
201
|
+
CoachmarkOverlay.deprecated = {
|
202
|
+
level: 'warn',
|
203
|
+
details: `${componentName} is deprecated.`
|
204
|
+
};
|
205
|
+
|
200
206
|
// Return a placeholder if not released and not enabled by feature flag
|
201
207
|
CoachmarkOverlay = pkg.checkComponentEnabled(CoachmarkOverlay, componentName);
|
202
208
|
|
@@ -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.
|
@@ -6,15 +6,14 @@
|
|
6
6
|
*/
|
7
7
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
9
|
-
import '../Coachmark/Coachmark.js';
|
10
|
-
import { useCoachmark } from '../Coachmark/utils/context.js';
|
11
9
|
import PropTypes from '../../_virtual/index.js';
|
12
10
|
import React__default from 'react';
|
13
11
|
import cx from 'classnames';
|
14
12
|
import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
|
15
13
|
import { pkg } from '../../settings.js';
|
14
|
+
import { Button } from '@carbon/react';
|
16
15
|
|
17
|
-
var
|
16
|
+
var _circle;
|
18
17
|
|
19
18
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
20
19
|
const blockClass = `${pkg.prefix}--coachmark-beacon`;
|
@@ -25,17 +24,14 @@ const defaults = {
|
|
25
24
|
/**
|
26
25
|
* Use beacon for the target prop of a Coachmark component.
|
27
26
|
*/
|
28
|
-
let CoachmarkBeacon = /*#__PURE__*/React__default.forwardRef((
|
29
|
-
|
27
|
+
let CoachmarkBeacon = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
28
|
+
const {
|
30
29
|
label,
|
31
30
|
className,
|
32
31
|
kind = defaults.kind,
|
32
|
+
buttonProps,
|
33
33
|
...rest
|
34
|
-
} =
|
35
|
-
const coachmark = useCoachmark();
|
36
|
-
if (!coachmark) {
|
37
|
-
return _div || (_div = /*#__PURE__*/React__default.createElement("div", null, "CoachmarkBeacon is to be use exclusively within the target prop of Coachmark"));
|
38
|
-
}
|
34
|
+
} = props;
|
39
35
|
return /*#__PURE__*/React__default.createElement("span", _extends({}, rest, {
|
40
36
|
className: cx(blockClass, `${blockClass}-${kind}`, className),
|
41
37
|
ref: ref
|
@@ -44,7 +40,7 @@ let CoachmarkBeacon = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
44
40
|
}), /*#__PURE__*/React__default.createElement("button", _extends({
|
45
41
|
tabIndex: 0,
|
46
42
|
type: "button"
|
47
|
-
},
|
43
|
+
}, buttonProps, {
|
48
44
|
className: `${blockClass}__target`
|
49
45
|
}), /*#__PURE__*/React__default.createElement("svg", {
|
50
46
|
className: `${blockClass}__center`,
|
@@ -67,6 +63,18 @@ CoachmarkBeacon.displayName = componentName;
|
|
67
63
|
// in alphabetical order (for consistency).
|
68
64
|
// See https://www.npmjs.com/package/prop-types#usage.
|
69
65
|
CoachmarkBeacon.propTypes = {
|
66
|
+
/**
|
67
|
+
* button props
|
68
|
+
*/
|
69
|
+
buttonProps: PropTypes.shape({
|
70
|
+
/**@ts-ignore*/
|
71
|
+
...Button.propTypes,
|
72
|
+
/**@ts-ignore*/
|
73
|
+
onClick: PropTypes.func,
|
74
|
+
onDoubleClick: PropTypes.func,
|
75
|
+
tabIndex: PropTypes.number,
|
76
|
+
['aria-expanded']: PropTypes.bool
|
77
|
+
}),
|
70
78
|
/**
|
71
79
|
* Optional class name for this component.
|
72
80
|
*/
|
@@ -14,6 +14,7 @@ import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
|
|
14
14
|
import { pkg } from '../../settings.js';
|
15
15
|
import '../Coachmark/Coachmark.js';
|
16
16
|
import { useCoachmark } from '../Coachmark/utils/context.js';
|
17
|
+
import '../Coachmark/CoachmarkTagline.js';
|
17
18
|
|
18
19
|
var _div;
|
19
20
|
|
@@ -69,6 +70,12 @@ let CoachmarkButton = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
69
70
|
}, getDevtoolsProps(componentName), coachmark.buttonProps), label);
|
70
71
|
});
|
71
72
|
|
73
|
+
/**@ts-ignore*/
|
74
|
+
CoachmarkButton.deprecated = {
|
75
|
+
level: 'warn',
|
76
|
+
details: `${componentName} is deprecated.`
|
77
|
+
};
|
78
|
+
|
72
79
|
// Return a placeholder if not released and not enabled by feature flag
|
73
80
|
CoachmarkButton = pkg.checkComponentEnabled(CoachmarkButton, componentName);
|
74
81
|
|
@@ -51,6 +51,12 @@ let CoachmarkOverlayElement = /*#__PURE__*/React__default.forwardRef((_ref, ref)
|
|
51
51
|
}, button));
|
52
52
|
});
|
53
53
|
|
54
|
+
/**@ts-ignore*/
|
55
|
+
CoachmarkOverlayElement.deprecated = {
|
56
|
+
level: 'warn',
|
57
|
+
details: `${componentName} is deprecated.`
|
58
|
+
};
|
59
|
+
|
54
60
|
// Return a placeholder if not released and not enabled by feature flag
|
55
61
|
CoachmarkOverlayElement = pkg.checkComponentEnabled(CoachmarkOverlayElement, componentName);
|
56
62
|
|
@@ -18,6 +18,7 @@ import pconsole from '../../global/js/utils/pconsole.js';
|
|
18
18
|
import { pkg } from '../../settings.js';
|
19
19
|
import '../Coachmark/Coachmark.js';
|
20
20
|
import { useCoachmark } from '../Coachmark/utils/context.js';
|
21
|
+
import '../Coachmark/CoachmarkTagline.js';
|
21
22
|
|
22
23
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
23
24
|
const blockClass = `${pkg.prefix}--coachmark-overlay-elements`;
|
@@ -162,6 +163,12 @@ let CoachmarkOverlayElements = /*#__PURE__*/React__default.forwardRef((_ref, ref
|
|
162
163
|
}, coachmark.closeButtonProps), closeButtonLabel))));
|
163
164
|
});
|
164
165
|
|
166
|
+
/**@ts-ignore*/
|
167
|
+
CoachmarkOverlayElements.deprecated = {
|
168
|
+
level: 'warn',
|
169
|
+
details: `${componentName} is deprecated.`
|
170
|
+
};
|
171
|
+
|
165
172
|
// Return a placeholder if not released and not enabled by feature flag
|
166
173
|
CoachmarkOverlayElements = pkg.checkComponentEnabled(CoachmarkOverlayElements, componentName);
|
167
174
|
|
@@ -8,8 +8,8 @@
|
|
8
8
|
import { extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
9
9
|
import '../../../feature-flags.js';
|
10
10
|
import React__default, { useContext, useRef, useEffect } from 'react';
|
11
|
-
import { TableContainer, Table } from '@carbon/react';
|
12
|
-
import { pkg
|
11
|
+
import { usePrefix, TableContainer, Table } from '@carbon/react';
|
12
|
+
import { pkg } from '../../../settings.js';
|
13
13
|
import { CLEAR_FILTERS, CLEAR_SINGLE_FILTER } from './addons/Filtering/constants.js';
|
14
14
|
import DatagridBody from './DatagridBody.js';
|
15
15
|
import DatagridHead from './DatagridHead.js';
|
@@ -82,6 +82,7 @@ const DatagridContent = _ref => {
|
|
82
82
|
const contentRows = DatagridPagination && page || rows;
|
83
83
|
const gridAreaRef = useRef(null);
|
84
84
|
const multiKeyTrackingRef = useRef(null);
|
85
|
+
const carbonPrefix = usePrefix();
|
85
86
|
const enableEditableCell = useFeatureFlag('enable-datagrid-useEditableCell');
|
86
87
|
const enableInlineEdit = useFeatureFlag('enable-datagrid-useInlineEdit');
|
87
88
|
const enableCustomizeCols = useFeatureFlag('enable-datagrid-useCustomizeColumns');
|
@@ -135,7 +136,8 @@ const DatagridContent = _ref => {
|
|
135
136
|
keysPressedList,
|
136
137
|
state: inlineEditState,
|
137
138
|
usingMac,
|
138
|
-
ref: multiKeyTrackingRef
|
139
|
+
ref: multiKeyTrackingRef,
|
140
|
+
carbonPrefix
|
139
141
|
})),
|
140
142
|
onFocus: withInlineEdit && (() => handleGridFocus(inlineEditState, dispatch)),
|
141
143
|
title
|
@@ -158,12 +160,12 @@ const DatagridContent = _ref => {
|
|
158
160
|
return;
|
159
161
|
}
|
160
162
|
const gridElement = document.querySelector(`#${tableId}`);
|
161
|
-
const tableHeader = gridElement?.querySelector(`.${
|
163
|
+
const tableHeader = gridElement?.querySelector(`.${carbonPrefix}--data-table-header`);
|
162
164
|
gridElement?.style?.setProperty(`--${blockClass}--grid-width`, px((totalColumnsWidth || 0) + 32));
|
163
165
|
if (gridActive) {
|
164
166
|
gridElement?.style.setProperty(`--${blockClass}--grid-header-height`, px(tableHeader?.clientHeight || 0));
|
165
167
|
}
|
166
|
-
}, [withInlineEdit, tableId, totalColumnsWidth, datagridState, gridActive]);
|
168
|
+
}, [withInlineEdit, tableId, totalColumnsWidth, datagridState, gridActive, carbonPrefix]);
|
167
169
|
useSubscribeToEventEmitter(CLEAR_SINGLE_FILTER, id => clearSingleFilter(id, setAllFilters, state, contextTableId));
|
168
170
|
const renderFilterSummary = () => state.filters.length > 0 && /*#__PURE__*/React__default.createElement(FilterSummary, {
|
169
171
|
className: `${blockClass}__filter-summary`,
|