@carbon/ibm-products 2.43.2-canary.83 → 2.43.2-canary.88
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 +9 -66
- 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.css +9 -66
- 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 -66
- 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/Coachmark/Coachmark.d.ts +6 -1
- package/es/components/Coachmark/Coachmark.js +37 -6
- package/es/components/Coachmark/CoachmarkOverlay.js +2 -4
- package/es/components/CoachmarkBeacon/CoachmarkBeacon.js +1 -7
- package/lib/components/Coachmark/Coachmark.d.ts +6 -1
- package/lib/components/Coachmark/Coachmark.js +36 -5
- package/lib/components/Coachmark/CoachmarkOverlay.js +2 -4
- package/lib/components/CoachmarkBeacon/CoachmarkBeacon.js +1 -7
- package/package.json +4 -4
- package/scss/components/Coachmark/_coachmark-overlay.scss +6 -70
- package/scss/components/Coachmark/_coachmark.scss +5 -4
- package/scss/components/CoachmarkBeacon/_coachmark-beacon.scss +1 -3
@@ -5,7 +5,7 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
|
8
|
-
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
8
|
+
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, extends as _extends, objectSpread2 as _objectSpread2, defineProperty as _defineProperty } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
9
9
|
import React__default, { forwardRef, useState, useRef, useCallback, useEffect } from 'react';
|
10
10
|
import cx from 'classnames';
|
11
11
|
import PropTypes from '../../node_modules/prop-types/index.js';
|
@@ -17,9 +17,11 @@ import { useClickOutsideElement, useWindowEvent } from './utils/hooks.js';
|
|
17
17
|
import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
|
18
18
|
import { pkg } from '../../settings.js';
|
19
19
|
import { throttle } from 'lodash';
|
20
|
+
import { Popover, PopoverContent } from '@carbon/react';
|
20
21
|
import { useIsomorphicEffect } from '../../global/js/hooks/useIsomorphicEffect.js';
|
21
22
|
|
22
|
-
var _excluded = ["align", "children", "className", "onClose", "overlayClassName", "overlayKind", "overlayRef", "
|
23
|
+
var _excluded = ["align", "autoAlign", "children", "className", "onClose", "overlayClassName", "overlayKind", "overlayRef", "positionTune", "portalTarget", "target", "theme"];
|
24
|
+
|
23
25
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
24
26
|
var blockClass = "".concat(pkg.prefix, "--coachmark");
|
25
27
|
var overlayBlockClass = "".concat(blockClass, "-overlay");
|
@@ -37,8 +39,10 @@ var defaults = {
|
|
37
39
|
*/
|
38
40
|
|
39
41
|
var Coachmark = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
42
|
+
var _positionTune$y, _positionTune$x;
|
40
43
|
var _ref$align = _ref.align,
|
41
44
|
align = _ref$align === void 0 ? defaults.align : _ref$align,
|
45
|
+
autoAlign = _ref.autoAlign,
|
42
46
|
children = _ref.children,
|
43
47
|
className = _ref.className,
|
44
48
|
_ref$onClose = _ref.onClose,
|
@@ -47,8 +51,8 @@ var Coachmark = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
47
51
|
_ref$overlayKind = _ref.overlayKind,
|
48
52
|
overlayKind = _ref$overlayKind === void 0 ? defaults.overlayKind : _ref$overlayKind,
|
49
53
|
overlayRef = _ref.overlayRef,
|
50
|
-
portalTarget = _ref.portalTarget,
|
51
54
|
positionTune = _ref.positionTune,
|
55
|
+
portalTarget = _ref.portalTarget,
|
52
56
|
target = _ref.target,
|
53
57
|
_ref$theme = _ref.theme,
|
54
58
|
theme = _ref$theme === void 0 ? defaults.theme : _ref$theme,
|
@@ -124,6 +128,10 @@ var Coachmark = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
124
128
|
setShouldResetPosition(true);
|
125
129
|
}
|
126
130
|
};
|
131
|
+
var overlayPositionStyle = {
|
132
|
+
top: ((_positionTune$y = positionTune === null || positionTune === void 0 ? void 0 : positionTune.y) !== null && _positionTune$y !== void 0 ? _positionTune$y : 0) - 16,
|
133
|
+
left: ((_positionTune$x = positionTune === null || positionTune === void 0 ? void 0 : positionTune.x) !== null && _positionTune$x !== void 0 ? _positionTune$x : 0) - 16
|
134
|
+
};
|
127
135
|
var contextValue = {
|
128
136
|
buttonProps: {
|
129
137
|
'aria-expanded': isOpen,
|
@@ -139,7 +147,8 @@ var Coachmark = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
139
147
|
targetRect: targetRect,
|
140
148
|
targetOffset: targetOffset,
|
141
149
|
align: align,
|
142
|
-
positionTune: positionTune
|
150
|
+
positionTune: positionTune,
|
151
|
+
isOpen: isOpen
|
143
152
|
};
|
144
153
|
var handleResize = throttle(function () {
|
145
154
|
closeOverlay();
|
@@ -173,7 +182,7 @@ var Coachmark = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
173
182
|
}, /*#__PURE__*/React__default.createElement("div", _extends({
|
174
183
|
className: cx(blockClass, "".concat(blockClass, "__").concat(theme), className),
|
175
184
|
ref: _coachmarkRef
|
176
|
-
}, rest, getDevtoolsProps(componentName)), target, isOpen && (portalNode === null || portalNode === void 0 ? void 0 : portalNode.current) && /*#__PURE__*/createPortal( /*#__PURE__*/React__default.createElement(CoachmarkOverlay, {
|
185
|
+
}, rest, getDevtoolsProps(componentName)), overlayKind !== 'tooltip' ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, target, isOpen && (portalNode === null || portalNode === void 0 ? void 0 : portalNode.current) && /*#__PURE__*/createPortal( /*#__PURE__*/React__default.createElement(CoachmarkOverlay, {
|
177
186
|
ref: _overlayRef,
|
178
187
|
fixedIsVisible: false,
|
179
188
|
kind: overlayKind,
|
@@ -181,7 +190,23 @@ var Coachmark = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
181
190
|
theme: theme,
|
182
191
|
className: cx(overlayClassName, "".concat(overlayBlockClass, "--is-visible"))
|
183
192
|
}, children), // Default to `document.body` when `portalNode` is `null`
|
184
|
-
portalNode === null || portalNode === void 0 ? void 0 : portalNode.current))
|
193
|
+
portalNode === null || portalNode === void 0 ? void 0 : portalNode.current)) : /*#__PURE__*/React__default.createElement(Popover, {
|
194
|
+
highContrast: true,
|
195
|
+
caret: true,
|
196
|
+
style: _objectSpread2({
|
197
|
+
position: 'absolute'
|
198
|
+
}, overlayPositionStyle),
|
199
|
+
align: align,
|
200
|
+
autoAlign: autoAlign,
|
201
|
+
open: isOpen
|
202
|
+
}, target, /*#__PURE__*/React__default.createElement(PopoverContent, null, isOpen && /*#__PURE__*/React__default.createElement(CoachmarkOverlay, {
|
203
|
+
ref: _overlayRef,
|
204
|
+
fixedIsVisible: false,
|
205
|
+
kind: overlayKind,
|
206
|
+
onClose: handleClose,
|
207
|
+
theme: theme,
|
208
|
+
className: cx(overlayClassName, _defineProperty({}, "".concat(overlayBlockClass, "--is-visible"), isOpen))
|
209
|
+
}, children)))));
|
185
210
|
});
|
186
211
|
var overlayRefType = typeof HTMLElement === 'undefined' ? PropTypes.object :
|
187
212
|
// eslint-disable-next-line ssr-friendly/no-dom-globals-in-module-scope
|
@@ -204,6 +229,11 @@ Coachmark.propTypes = {
|
|
204
229
|
* @see COACHMARK_ALIGNMENT
|
205
230
|
*/
|
206
231
|
align: PropTypes.oneOf(['bottom', 'bottom-left', 'bottom-right', 'left', 'left-top', 'left-bottom', 'right', 'right-top', 'right-bottom', 'top', 'top-left', 'top-right']),
|
232
|
+
/**
|
233
|
+
* Auto aligns the coachmark based on screen boundaries
|
234
|
+
* Applies only to Tooltip Coachmarks.
|
235
|
+
*/
|
236
|
+
autoAlign: PropTypes.bool,
|
207
237
|
/**
|
208
238
|
* Coachmark should use a single CoachmarkOverlayElements component as a child.
|
209
239
|
* @see CoachmarkOverlayElements
|
@@ -242,6 +272,7 @@ Coachmark.propTypes = {
|
|
242
272
|
/**
|
243
273
|
* Fine tune the position of the target in pixels. Applies only to Beacons.
|
244
274
|
*/
|
275
|
+
// @ts-ignore
|
245
276
|
positionTune: PropTypes.shape({
|
246
277
|
x: PropTypes.number,
|
247
278
|
y: PropTypes.number
|
@@ -55,7 +55,7 @@ var CoachmarkOverlay = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
55
55
|
var coachmark = useCoachmark();
|
56
56
|
var isBeacon = kind === COACHMARK_OVERLAY_KIND.TOOLTIP;
|
57
57
|
var isDraggable = kind === COACHMARK_OVERLAY_KIND.FLOATING;
|
58
|
-
var isVisible = className
|
58
|
+
var isVisible = className === null || className === void 0 ? void 0 : className.includes('is-visible');
|
59
59
|
var handleKeyPress = function handleKeyPress(event) {
|
60
60
|
var shiftKey = event.shiftKey,
|
61
61
|
key = event.key;
|
@@ -163,9 +163,7 @@ var CoachmarkOverlay = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
163
163
|
return /*#__PURE__*/React__default.cloneElement(child, {
|
164
164
|
isVisible: isVisible
|
165
165
|
});
|
166
|
-
}))
|
167
|
-
className: "".concat(blockClass, "__caret")
|
168
|
-
}));
|
166
|
+
})));
|
169
167
|
});
|
170
168
|
function getWindowDimensions() {
|
171
169
|
var _window = window,
|
@@ -26,7 +26,6 @@ var defaults = {
|
|
26
26
|
* Use beacon for the target prop of a Coachmark component.
|
27
27
|
*/
|
28
28
|
var CoachmarkBeacon = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
29
|
-
var _coachmark$positionTu, _coachmark$positionTu2, _coachmark$positionTu3, _coachmark$positionTu4;
|
30
29
|
var label = _ref.label,
|
31
30
|
className = _ref.className,
|
32
31
|
_ref$kind = _ref.kind,
|
@@ -36,14 +35,9 @@ var CoachmarkBeacon = /*#__PURE__*/React__default.forwardRef(function (_ref, ref
|
|
36
35
|
if (!coachmark) {
|
37
36
|
return _div || (_div = /*#__PURE__*/React__default.createElement("div", null, "CoachmarkBeacon is to be use exclusively within the target prop of Coachmark"));
|
38
37
|
}
|
39
|
-
var overlayPositionStyle = {
|
40
|
-
top: (_coachmark$positionTu = (_coachmark$positionTu2 = coachmark.positionTune) === null || _coachmark$positionTu2 === void 0 ? void 0 : _coachmark$positionTu2.y) !== null && _coachmark$positionTu !== void 0 ? _coachmark$positionTu : 0,
|
41
|
-
left: (_coachmark$positionTu3 = (_coachmark$positionTu4 = coachmark.positionTune) === null || _coachmark$positionTu4 === void 0 ? void 0 : _coachmark$positionTu4.x) !== null && _coachmark$positionTu3 !== void 0 ? _coachmark$positionTu3 : 0
|
42
|
-
};
|
43
38
|
return /*#__PURE__*/React__default.createElement("span", _extends({}, rest, {
|
44
39
|
className: cx(blockClass, "".concat(blockClass, "-").concat(kind), className),
|
45
|
-
ref: ref
|
46
|
-
style: overlayPositionStyle
|
40
|
+
ref: ref
|
47
41
|
}, getDevtoolsProps(componentName), {
|
48
42
|
role: "tooltip"
|
49
43
|
}), /*#__PURE__*/React__default.createElement("button", _extends({
|
@@ -12,6 +12,11 @@ interface CoachmarkProps {
|
|
12
12
|
* @see COACHMARK_ALIGNMENT
|
13
13
|
*/
|
14
14
|
align?: 'bottom' | 'bottom-left' | 'bottom-right' | 'left' | 'left-top' | 'left-bottom' | 'right' | 'right-top' | 'right-bottom' | 'top' | 'top-left' | 'top-right';
|
15
|
+
/**
|
16
|
+
* Auto aligns the coachmark based on screen boundaries
|
17
|
+
* Applies only to Tooltip Coachmarks.
|
18
|
+
*/
|
19
|
+
autoAlign?: boolean;
|
15
20
|
/**
|
16
21
|
* Coachmark should use a single CoachmarkOverlayElements component as a child.
|
17
22
|
* @see CoachmarkOverlayElements
|
@@ -51,7 +56,7 @@ interface CoachmarkProps {
|
|
51
56
|
positionTune?: {
|
52
57
|
x: number;
|
53
58
|
y: number;
|
54
|
-
}
|
59
|
+
};
|
55
60
|
/**
|
56
61
|
* The optional button or beacon that the user will click to show the Coachmark.
|
57
62
|
*/
|
@@ -21,6 +21,7 @@ var hooks = require('./utils/hooks.js');
|
|
21
21
|
var devtools = require('../../global/js/utils/devtools.js');
|
22
22
|
var settings = require('../../settings.js');
|
23
23
|
var lodash = require('lodash');
|
24
|
+
var react = require('@carbon/react');
|
24
25
|
var useIsomorphicEffect = require('../../global/js/hooks/useIsomorphicEffect.js');
|
25
26
|
|
26
27
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
@@ -28,7 +29,8 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
28
29
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
29
30
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
30
31
|
|
31
|
-
var _excluded = ["align", "children", "className", "onClose", "overlayClassName", "overlayKind", "overlayRef", "
|
32
|
+
var _excluded = ["align", "autoAlign", "children", "className", "onClose", "overlayClassName", "overlayKind", "overlayRef", "positionTune", "portalTarget", "target", "theme"];
|
33
|
+
|
32
34
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
33
35
|
var blockClass = "".concat(settings.pkg.prefix, "--coachmark");
|
34
36
|
var overlayBlockClass = "".concat(blockClass, "-overlay");
|
@@ -46,8 +48,10 @@ var defaults = {
|
|
46
48
|
*/
|
47
49
|
|
48
50
|
exports.Coachmark = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
51
|
+
var _positionTune$y, _positionTune$x;
|
49
52
|
var _ref$align = _ref.align,
|
50
53
|
align = _ref$align === void 0 ? defaults.align : _ref$align,
|
54
|
+
autoAlign = _ref.autoAlign,
|
51
55
|
children = _ref.children,
|
52
56
|
className = _ref.className,
|
53
57
|
_ref$onClose = _ref.onClose,
|
@@ -56,8 +60,8 @@ exports.Coachmark = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
56
60
|
_ref$overlayKind = _ref.overlayKind,
|
57
61
|
overlayKind = _ref$overlayKind === void 0 ? defaults.overlayKind : _ref$overlayKind,
|
58
62
|
overlayRef = _ref.overlayRef,
|
59
|
-
portalTarget = _ref.portalTarget,
|
60
63
|
positionTune = _ref.positionTune,
|
64
|
+
portalTarget = _ref.portalTarget,
|
61
65
|
target = _ref.target,
|
62
66
|
_ref$theme = _ref.theme,
|
63
67
|
theme = _ref$theme === void 0 ? defaults.theme : _ref$theme,
|
@@ -133,6 +137,10 @@ exports.Coachmark = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
133
137
|
setShouldResetPosition(true);
|
134
138
|
}
|
135
139
|
};
|
140
|
+
var overlayPositionStyle = {
|
141
|
+
top: ((_positionTune$y = positionTune === null || positionTune === void 0 ? void 0 : positionTune.y) !== null && _positionTune$y !== void 0 ? _positionTune$y : 0) - 16,
|
142
|
+
left: ((_positionTune$x = positionTune === null || positionTune === void 0 ? void 0 : positionTune.x) !== null && _positionTune$x !== void 0 ? _positionTune$x : 0) - 16
|
143
|
+
};
|
136
144
|
var contextValue = {
|
137
145
|
buttonProps: {
|
138
146
|
'aria-expanded': isOpen,
|
@@ -148,7 +156,8 @@ exports.Coachmark = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
148
156
|
targetRect: targetRect,
|
149
157
|
targetOffset: targetOffset,
|
150
158
|
align: align,
|
151
|
-
positionTune: positionTune
|
159
|
+
positionTune: positionTune,
|
160
|
+
isOpen: isOpen
|
152
161
|
};
|
153
162
|
var handleResize = lodash.throttle(function () {
|
154
163
|
closeOverlay();
|
@@ -182,7 +191,7 @@ exports.Coachmark = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
182
191
|
}, /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
|
183
192
|
className: cx__default["default"](blockClass, "".concat(blockClass, "__").concat(theme), className),
|
184
193
|
ref: _coachmarkRef
|
185
|
-
}, rest, devtools.getDevtoolsProps(componentName)), target, isOpen && (portalNode === null || portalNode === void 0 ? void 0 : portalNode.current) && /*#__PURE__*/reactDom.createPortal( /*#__PURE__*/React__default["default"].createElement(CoachmarkOverlay.CoachmarkOverlay, {
|
194
|
+
}, rest, devtools.getDevtoolsProps(componentName)), overlayKind !== 'tooltip' ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, target, isOpen && (portalNode === null || portalNode === void 0 ? void 0 : portalNode.current) && /*#__PURE__*/reactDom.createPortal( /*#__PURE__*/React__default["default"].createElement(CoachmarkOverlay.CoachmarkOverlay, {
|
186
195
|
ref: _overlayRef,
|
187
196
|
fixedIsVisible: false,
|
188
197
|
kind: overlayKind,
|
@@ -190,7 +199,23 @@ exports.Coachmark = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
190
199
|
theme: theme,
|
191
200
|
className: cx__default["default"](overlayClassName, "".concat(overlayBlockClass, "--is-visible"))
|
192
201
|
}, children), // Default to `document.body` when `portalNode` is `null`
|
193
|
-
portalNode === null || portalNode === void 0 ? void 0 : portalNode.current))
|
202
|
+
portalNode === null || portalNode === void 0 ? void 0 : portalNode.current)) : /*#__PURE__*/React__default["default"].createElement(react.Popover, {
|
203
|
+
highContrast: true,
|
204
|
+
caret: true,
|
205
|
+
style: _rollupPluginBabelHelpers.objectSpread2({
|
206
|
+
position: 'absolute'
|
207
|
+
}, overlayPositionStyle),
|
208
|
+
align: align,
|
209
|
+
autoAlign: autoAlign,
|
210
|
+
open: isOpen
|
211
|
+
}, target, /*#__PURE__*/React__default["default"].createElement(react.PopoverContent, null, isOpen && /*#__PURE__*/React__default["default"].createElement(CoachmarkOverlay.CoachmarkOverlay, {
|
212
|
+
ref: _overlayRef,
|
213
|
+
fixedIsVisible: false,
|
214
|
+
kind: overlayKind,
|
215
|
+
onClose: handleClose,
|
216
|
+
theme: theme,
|
217
|
+
className: cx__default["default"](overlayClassName, _rollupPluginBabelHelpers.defineProperty({}, "".concat(overlayBlockClass, "--is-visible"), isOpen))
|
218
|
+
}, children)))));
|
194
219
|
});
|
195
220
|
var overlayRefType = typeof HTMLElement === 'undefined' ? index["default"].object :
|
196
221
|
// eslint-disable-next-line ssr-friendly/no-dom-globals-in-module-scope
|
@@ -213,6 +238,11 @@ exports.Coachmark.propTypes = {
|
|
213
238
|
* @see COACHMARK_ALIGNMENT
|
214
239
|
*/
|
215
240
|
align: index["default"].oneOf(['bottom', 'bottom-left', 'bottom-right', 'left', 'left-top', 'left-bottom', 'right', 'right-top', 'right-bottom', 'top', 'top-left', 'top-right']),
|
241
|
+
/**
|
242
|
+
* Auto aligns the coachmark based on screen boundaries
|
243
|
+
* Applies only to Tooltip Coachmarks.
|
244
|
+
*/
|
245
|
+
autoAlign: index["default"].bool,
|
216
246
|
/**
|
217
247
|
* Coachmark should use a single CoachmarkOverlayElements component as a child.
|
218
248
|
* @see CoachmarkOverlayElements
|
@@ -251,6 +281,7 @@ exports.Coachmark.propTypes = {
|
|
251
281
|
/**
|
252
282
|
* Fine tune the position of the target in pixels. Applies only to Beacons.
|
253
283
|
*/
|
284
|
+
// @ts-ignore
|
254
285
|
positionTune: index["default"].shape({
|
255
286
|
x: index["default"].number,
|
256
287
|
y: index["default"].number
|
@@ -64,7 +64,7 @@ exports.CoachmarkOverlay = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
64
64
|
var coachmark = context.useCoachmark();
|
65
65
|
var isBeacon = kind === enums.COACHMARK_OVERLAY_KIND.TOOLTIP;
|
66
66
|
var isDraggable = kind === enums.COACHMARK_OVERLAY_KIND.FLOATING;
|
67
|
-
var isVisible = className
|
67
|
+
var isVisible = className === null || className === void 0 ? void 0 : className.includes('is-visible');
|
68
68
|
var handleKeyPress = function handleKeyPress(event) {
|
69
69
|
var shiftKey = event.shiftKey,
|
70
70
|
key = event.key;
|
@@ -172,9 +172,7 @@ exports.CoachmarkOverlay = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
172
172
|
return /*#__PURE__*/React__default["default"].cloneElement(child, {
|
173
173
|
isVisible: isVisible
|
174
174
|
});
|
175
|
-
}))
|
176
|
-
className: "".concat(blockClass, "__caret")
|
177
|
-
}));
|
175
|
+
})));
|
178
176
|
});
|
179
177
|
function getWindowDimensions() {
|
180
178
|
var _window = window,
|
@@ -35,7 +35,6 @@ var defaults = {
|
|
35
35
|
* Use beacon for the target prop of a Coachmark component.
|
36
36
|
*/
|
37
37
|
exports.CoachmarkBeacon = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, ref) {
|
38
|
-
var _coachmark$positionTu, _coachmark$positionTu2, _coachmark$positionTu3, _coachmark$positionTu4;
|
39
38
|
var label = _ref.label,
|
40
39
|
className = _ref.className,
|
41
40
|
_ref$kind = _ref.kind,
|
@@ -45,14 +44,9 @@ exports.CoachmarkBeacon = /*#__PURE__*/React__default["default"].forwardRef(func
|
|
45
44
|
if (!coachmark) {
|
46
45
|
return _div || (_div = /*#__PURE__*/React__default["default"].createElement("div", null, "CoachmarkBeacon is to be use exclusively within the target prop of Coachmark"));
|
47
46
|
}
|
48
|
-
var overlayPositionStyle = {
|
49
|
-
top: (_coachmark$positionTu = (_coachmark$positionTu2 = coachmark.positionTune) === null || _coachmark$positionTu2 === void 0 ? void 0 : _coachmark$positionTu2.y) !== null && _coachmark$positionTu !== void 0 ? _coachmark$positionTu : 0,
|
50
|
-
left: (_coachmark$positionTu3 = (_coachmark$positionTu4 = coachmark.positionTune) === null || _coachmark$positionTu4 === void 0 ? void 0 : _coachmark$positionTu4.x) !== null && _coachmark$positionTu3 !== void 0 ? _coachmark$positionTu3 : 0
|
51
|
-
};
|
52
47
|
return /*#__PURE__*/React__default["default"].createElement("span", _rollupPluginBabelHelpers["extends"]({}, rest, {
|
53
48
|
className: cx__default["default"](blockClass, "".concat(blockClass, "-").concat(kind), className),
|
54
|
-
ref: ref
|
55
|
-
style: overlayPositionStyle
|
49
|
+
ref: ref
|
56
50
|
}, devtools.getDevtoolsProps(componentName), {
|
57
51
|
role: "tooltip"
|
58
52
|
}), /*#__PURE__*/React__default["default"].createElement("button", _rollupPluginBabelHelpers["extends"]({
|
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.88+8ac63a48e",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "lib/index.js",
|
7
7
|
"module": "es/index.js",
|
@@ -81,7 +81,7 @@
|
|
81
81
|
"fs-extra": "^11.2.0",
|
82
82
|
"glob": "^10.3.10",
|
83
83
|
"jest": "^29.7.0",
|
84
|
-
"jest-config-ibm-cloud-cognitive": "^1.4.0
|
84
|
+
"jest-config-ibm-cloud-cognitive": "^1.4.0",
|
85
85
|
"jest-environment-jsdom": "^29.7.0",
|
86
86
|
"namor": "^1.1.2",
|
87
87
|
"npm-check-updates": "^16.14.12",
|
@@ -96,7 +96,7 @@
|
|
96
96
|
"dependencies": {
|
97
97
|
"@babel/runtime": "^7.23.9",
|
98
98
|
"@carbon/feature-flags": "^0.20.0",
|
99
|
-
"@carbon/ibm-products-styles": "^2.
|
99
|
+
"@carbon/ibm-products-styles": "^2.39.1-canary.98+8ac63a48e",
|
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": "8ac63a48e79c75a4a3baa8f00e502d1595091fef"
|
124
124
|
}
|
@@ -45,6 +45,11 @@ $draghandle-btn-class: #{$block-class}__handle;
|
|
45
45
|
|
46
46
|
visibility: hidden;
|
47
47
|
|
48
|
+
&--tooltip {
|
49
|
+
position: initial;
|
50
|
+
transform: none !important;
|
51
|
+
}
|
52
|
+
|
48
53
|
&--fixed {
|
49
54
|
position: fixed;
|
50
55
|
right: $spacing-05;
|
@@ -68,45 +73,19 @@ $draghandle-btn-class: #{$block-class}__handle;
|
|
68
73
|
visibility: visible;
|
69
74
|
}
|
70
75
|
|
71
|
-
//
|
72
|
-
&__caret {
|
73
|
-
// background-color: this property is set in _coachmark-overlay-theme.scss
|
74
|
-
position: absolute;
|
75
|
-
z-index: 5902;
|
76
|
-
width: 0;
|
77
|
-
height: 0;
|
78
|
-
// border-bottom-color: this property is set in _coachmark-overlay-theme.scss
|
79
|
-
border-right: $caret-center solid transparent;
|
80
|
-
border-bottom: solid $caret-center $background-inverse;
|
81
|
-
border-left: $caret-center solid transparent;
|
82
|
-
}
|
83
|
-
|
84
|
-
// OVERLAY AND CARET POSITIONING
|
76
|
+
// OVERLAY POSITIONING
|
85
77
|
&--top {
|
86
78
|
$horizontal-push: calc($distance-offset - $caret-center);
|
87
79
|
$translate-y: calc(-1 * (100% + $distance-offset + $caret-height));
|
88
80
|
|
89
81
|
transform: translate(-50%, $translate-y);
|
90
82
|
|
91
|
-
.#{$block-class}__caret {
|
92
|
-
left: calc(50% - $caret-center);
|
93
|
-
transform: rotate(180deg);
|
94
|
-
}
|
95
|
-
|
96
83
|
&-left {
|
97
84
|
transform: translate(calc(-1 * $distance-offset), $translate-y);
|
98
|
-
.#{$block-class}__caret {
|
99
|
-
left: $horizontal-push;
|
100
|
-
transform: rotate(180deg);
|
101
|
-
}
|
102
85
|
}
|
103
86
|
|
104
87
|
&-right {
|
105
88
|
transform: translate(calc(-1 * (100% - $distance-offset)), $translate-y);
|
106
|
-
.#{$block-class}__caret {
|
107
|
-
right: $horizontal-push;
|
108
|
-
transform: rotate(180deg);
|
109
|
-
}
|
110
89
|
}
|
111
90
|
}
|
112
91
|
|
@@ -116,26 +95,13 @@ $draghandle-btn-class: #{$block-class}__handle;
|
|
116
95
|
$translate-y: calc($distance-offset + $caret-height);
|
117
96
|
|
118
97
|
transform: translate(-50%, $translate-y);
|
119
|
-
.#{$block-class}__caret {
|
120
|
-
top: $top;
|
121
|
-
left: calc(50% - $caret-center);
|
122
|
-
}
|
123
98
|
|
124
99
|
&-left {
|
125
100
|
transform: translate(calc(-1 * $distance-offset), $translate-y);
|
126
|
-
.#{$block-class}__caret {
|
127
|
-
top: $top;
|
128
|
-
left: $horizontal-push;
|
129
|
-
}
|
130
101
|
}
|
131
102
|
|
132
103
|
&-right {
|
133
104
|
transform: translate(calc(-1 * (100% - $distance-offset)), $translate-y);
|
134
|
-
|
135
|
-
.#{$block-class}__caret {
|
136
|
-
top: $top;
|
137
|
-
right: $horizontal-push;
|
138
|
-
}
|
139
105
|
}
|
140
106
|
}
|
141
107
|
|
@@ -145,28 +111,13 @@ $draghandle-btn-class: #{$block-class}__handle;
|
|
145
111
|
$vertical-push: calc($distance-offset - ($caret-height * 0.5));
|
146
112
|
|
147
113
|
transform: translate($translate-x, -50%);
|
148
|
-
.#{$block-class}__caret {
|
149
|
-
top: calc(50% - ($caret-height * 0.5));
|
150
|
-
right: $right;
|
151
|
-
transform: rotate(90deg);
|
152
|
-
}
|
153
114
|
|
154
115
|
&-top {
|
155
116
|
transform: translate($translate-x, calc(-1 * $distance-offset));
|
156
|
-
.#{$block-class}__caret {
|
157
|
-
top: $vertical-push;
|
158
|
-
right: $right;
|
159
|
-
transform: rotate(90deg);
|
160
|
-
}
|
161
117
|
}
|
162
118
|
|
163
119
|
&-bottom {
|
164
120
|
transform: translate($translate-x, calc(-1 * (100% - $distance-offset)));
|
165
|
-
.#{$block-class}__caret {
|
166
|
-
right: $right;
|
167
|
-
bottom: $vertical-push;
|
168
|
-
transform: rotate(90deg);
|
169
|
-
}
|
170
121
|
}
|
171
122
|
}
|
172
123
|
|
@@ -176,28 +127,13 @@ $draghandle-btn-class: #{$block-class}__handle;
|
|
176
127
|
$vertical-push: calc($distance-offset - ($caret-height * 0.5));
|
177
128
|
|
178
129
|
transform: translate($translate-x, -50%);
|
179
|
-
.#{$block-class}__caret {
|
180
|
-
top: calc(50% - ($caret-height * 0.5));
|
181
|
-
left: $left;
|
182
|
-
transform: rotate(-90deg);
|
183
|
-
}
|
184
130
|
|
185
131
|
&-top {
|
186
132
|
transform: translate($translate-x, calc(-1 * $distance-offset));
|
187
|
-
.#{$block-class}__caret {
|
188
|
-
top: $vertical-push;
|
189
|
-
left: $left;
|
190
|
-
transform: rotate(-90deg);
|
191
|
-
}
|
192
133
|
}
|
193
134
|
|
194
135
|
&-bottom {
|
195
136
|
transform: translate($translate-x, calc(-1 * (100% - $distance-offset)));
|
196
|
-
.#{$block-class}__caret {
|
197
|
-
bottom: $vertical-push;
|
198
|
-
left: $left;
|
199
|
-
transform: rotate(-90deg);
|
200
|
-
}
|
201
137
|
}
|
202
138
|
}
|
203
139
|
|
@@ -8,6 +8,7 @@
|
|
8
8
|
// Standard imports.
|
9
9
|
@use '../../global/styles/project-settings' as c4p-settings;
|
10
10
|
@use '../../global/styles/mixins';
|
11
|
+
@use '@carbon/styles/scss/config';
|
11
12
|
|
12
13
|
@use './coachmark-dragbar';
|
13
14
|
@use './coachmark-header';
|
@@ -23,8 +24,8 @@
|
|
23
24
|
// TODO: @use(s) of IBM Products component styles used by Coachmark
|
24
25
|
|
25
26
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
26
|
-
|
27
|
+
$block-class: #{c4p-settings.$pkg-prefix}--coachmark;
|
27
28
|
|
28
|
-
|
29
|
-
|
30
|
-
|
29
|
+
.#{$block-class} {
|
30
|
+
position: relative;
|
31
|
+
}
|
@@ -69,9 +69,7 @@ $block-class: #{c4p-settings.$pkg-prefix}--coachmark-beacon;
|
|
69
69
|
}
|
70
70
|
.#{$block-class}__target {
|
71
71
|
// the hit area
|
72
|
-
|
73
|
-
top: calc(-1 * $spacing-05);
|
74
|
-
left: calc(-1 * $spacing-05);
|
72
|
+
display: flex;
|
75
73
|
width: $spacing-07;
|
76
74
|
height: $spacing-07;
|
77
75
|
padding: 0;
|