@carbon/ibm-products 2.54.0-canary.54 → 2.54.0-canary.55
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.
@@ -65,6 +65,11 @@ export interface CoachmarkProps {
|
|
65
65
|
* Determines the theme of the component.
|
66
66
|
*/
|
67
67
|
theme?: 'light' | 'dark';
|
68
|
+
/**
|
69
|
+
* Determines if the coachmark is open by default.
|
70
|
+
* Does nothing if `overlayKind=stacked`.
|
71
|
+
*/
|
72
|
+
isOpenByDefault?: boolean;
|
68
73
|
}
|
69
74
|
/**
|
70
75
|
* Coachmarks are used to call out specific functionality or concepts
|
@@ -20,7 +20,7 @@ import { throttle } from 'lodash';
|
|
20
20
|
import { Popover, PopoverContent } from '@carbon/react';
|
21
21
|
import { useIsomorphicEffect } from '../../global/js/hooks/useIsomorphicEffect.js';
|
22
22
|
|
23
|
-
var _excluded = ["align", "autoAlign", "children", "className", "onClose", "overlayClassName", "overlayKind", "overlayRef", "positionTune", "portalTarget", "target", "theme"];
|
23
|
+
var _excluded = ["align", "autoAlign", "children", "className", "onClose", "overlayClassName", "overlayKind", "overlayRef", "positionTune", "portalTarget", "target", "theme", "isOpenByDefault"];
|
24
24
|
|
25
25
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
26
26
|
var blockClass = "".concat(pkg.prefix, "--coachmark");
|
@@ -30,7 +30,8 @@ var defaults = {
|
|
30
30
|
align: 'bottom',
|
31
31
|
onClose: function onClose() {},
|
32
32
|
overlayKind: 'tooltip',
|
33
|
-
theme: 'light'
|
33
|
+
theme: 'light',
|
34
|
+
isOpenByDefault: false
|
34
35
|
};
|
35
36
|
/**
|
36
37
|
* Coachmarks are used to call out specific functionality or concepts
|
@@ -55,10 +56,12 @@ var Coachmark = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
55
56
|
target = _ref.target,
|
56
57
|
_ref$theme = _ref.theme,
|
57
58
|
theme = _ref$theme === void 0 ? defaults.theme : _ref$theme,
|
59
|
+
_ref$isOpenByDefault = _ref.isOpenByDefault,
|
60
|
+
isOpenByDefault = _ref$isOpenByDefault === void 0 ? defaults.isOpenByDefault : _ref$isOpenByDefault,
|
58
61
|
rest = _objectWithoutProperties(_ref, _excluded);
|
59
62
|
var isBeacon = overlayKind === COACHMARK_OVERLAY_KIND.TOOLTIP;
|
60
63
|
var isStacked = overlayKind === COACHMARK_OVERLAY_KIND.STACKED;
|
61
|
-
var _useState = useState(isStacked),
|
64
|
+
var _useState = useState(isStacked || isOpenByDefault),
|
62
65
|
_useState2 = _slicedToArray(_useState, 2),
|
63
66
|
isOpen = _useState2[0],
|
64
67
|
setIsOpen = _useState2[1];
|
@@ -250,6 +253,11 @@ Coachmark.propTypes = {
|
|
250
253
|
* Optional class name for this component.
|
251
254
|
*/
|
252
255
|
className: PropTypes.string,
|
256
|
+
/**
|
257
|
+
* Determines if the coachmark is open by default.
|
258
|
+
* Does nothing if `overlayKind=stacked`.
|
259
|
+
*/
|
260
|
+
isOpenByDefault: PropTypes.bool,
|
253
261
|
/**
|
254
262
|
* Function to call when the Coachmark closes.
|
255
263
|
*/
|
@@ -65,6 +65,11 @@ export interface CoachmarkProps {
|
|
65
65
|
* Determines the theme of the component.
|
66
66
|
*/
|
67
67
|
theme?: 'light' | 'dark';
|
68
|
+
/**
|
69
|
+
* Determines if the coachmark is open by default.
|
70
|
+
* Does nothing if `overlayKind=stacked`.
|
71
|
+
*/
|
72
|
+
isOpenByDefault?: boolean;
|
68
73
|
}
|
69
74
|
/**
|
70
75
|
* Coachmarks are used to call out specific functionality or concepts
|
@@ -22,7 +22,7 @@ var lodash = require('lodash');
|
|
22
22
|
var react = require('@carbon/react');
|
23
23
|
var useIsomorphicEffect = require('../../global/js/hooks/useIsomorphicEffect.js');
|
24
24
|
|
25
|
-
var _excluded = ["align", "autoAlign", "children", "className", "onClose", "overlayClassName", "overlayKind", "overlayRef", "positionTune", "portalTarget", "target", "theme"];
|
25
|
+
var _excluded = ["align", "autoAlign", "children", "className", "onClose", "overlayClassName", "overlayKind", "overlayRef", "positionTune", "portalTarget", "target", "theme", "isOpenByDefault"];
|
26
26
|
|
27
27
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
28
28
|
var blockClass = "".concat(settings.pkg.prefix, "--coachmark");
|
@@ -32,7 +32,8 @@ var defaults = {
|
|
32
32
|
align: 'bottom',
|
33
33
|
onClose: function onClose() {},
|
34
34
|
overlayKind: 'tooltip',
|
35
|
-
theme: 'light'
|
35
|
+
theme: 'light',
|
36
|
+
isOpenByDefault: false
|
36
37
|
};
|
37
38
|
/**
|
38
39
|
* Coachmarks are used to call out specific functionality or concepts
|
@@ -57,10 +58,12 @@ exports.Coachmark = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
57
58
|
target = _ref.target,
|
58
59
|
_ref$theme = _ref.theme,
|
59
60
|
theme = _ref$theme === void 0 ? defaults.theme : _ref$theme,
|
61
|
+
_ref$isOpenByDefault = _ref.isOpenByDefault,
|
62
|
+
isOpenByDefault = _ref$isOpenByDefault === void 0 ? defaults.isOpenByDefault : _ref$isOpenByDefault,
|
60
63
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
61
64
|
var isBeacon = overlayKind === enums.COACHMARK_OVERLAY_KIND.TOOLTIP;
|
62
65
|
var isStacked = overlayKind === enums.COACHMARK_OVERLAY_KIND.STACKED;
|
63
|
-
var _useState = React.useState(isStacked),
|
66
|
+
var _useState = React.useState(isStacked || isOpenByDefault),
|
64
67
|
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
65
68
|
isOpen = _useState2[0],
|
66
69
|
setIsOpen = _useState2[1];
|
@@ -252,6 +255,11 @@ exports.Coachmark.propTypes = {
|
|
252
255
|
* Optional class name for this component.
|
253
256
|
*/
|
254
257
|
className: index.default.string,
|
258
|
+
/**
|
259
|
+
* Determines if the coachmark is open by default.
|
260
|
+
* Does nothing if `overlayKind=stacked`.
|
261
|
+
*/
|
262
|
+
isOpenByDefault: index.default.bool,
|
255
263
|
/**
|
256
264
|
* Function to call when the Coachmark closes.
|
257
265
|
*/
|
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.54.0-canary.
|
4
|
+
"version": "2.54.0-canary.55+73ee693dd",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "lib/index.js",
|
7
7
|
"module": "es/index.js",
|
@@ -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": "73ee693dda68bbbc0ccc6ed802b0efe8f528950e"
|
124
124
|
}
|