@atlaskit/onboarding 10.4.0 → 10.5.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/CHANGELOG.md +23 -0
- package/dist/cjs/components/modal.js +13 -16
- package/dist/cjs/components/spotlight-card.js +133 -100
- package/dist/cjs/components/spotlight-dialog.js +6 -18
- package/dist/cjs/components/spotlight-manager.js +8 -6
- package/dist/cjs/components/spotlight-target.js +4 -2
- package/dist/cjs/components/spotlight-transition.js +7 -3
- package/dist/cjs/components/spotlight.js +4 -4
- package/dist/cjs/components/theme.js +10 -0
- package/dist/cjs/components/use-spotlight.js +1 -7
- package/dist/cjs/styled/target.js +6 -4
- package/dist/cjs/utils/use-element-box.js +6 -4
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/modal.js +6 -9
- package/dist/es2019/components/spotlight-card.js +120 -63
- package/dist/es2019/components/spotlight-dialog.js +8 -17
- package/dist/es2019/components/spotlight-manager.js +5 -5
- package/dist/es2019/components/spotlight-target.js +4 -2
- package/dist/es2019/components/spotlight-transition.js +6 -3
- package/dist/es2019/components/spotlight.js +4 -4
- package/dist/es2019/components/theme.js +10 -0
- package/dist/es2019/components/use-spotlight.js +1 -7
- package/dist/es2019/styled/target.js +5 -3
- package/dist/es2019/utils/use-element-box.js +5 -4
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/modal.js +13 -16
- package/dist/esm/components/spotlight-card.js +120 -90
- package/dist/esm/components/spotlight-dialog.js +6 -16
- package/dist/esm/components/spotlight-manager.js +5 -4
- package/dist/esm/components/spotlight-target.js +4 -2
- package/dist/esm/components/spotlight-transition.js +6 -3
- package/dist/esm/components/spotlight.js +4 -4
- package/dist/esm/components/theme.js +10 -0
- package/dist/esm/components/use-spotlight.js +1 -7
- package/dist/esm/styled/target.js +6 -4
- package/dist/esm/utils/use-element-box.js +5 -4
- package/dist/esm/version.json +1 -1
- package/dist/types/components/modal.d.ts +6 -5
- package/dist/types/components/spotlight-card.d.ts +25 -7
- package/dist/types/components/spotlight-manager.d.ts +5 -3
- package/dist/types/components/spotlight-target.d.ts +4 -2
- package/dist/types/components/spotlight-transition.d.ts +4 -2
- package/dist/types/components/spotlight.d.ts +4 -4
- package/dist/types/components/theme.d.ts +8 -0
- package/dist/types/components/use-spotlight.d.ts +1 -7
- package/dist/types/styled/target.d.ts +5 -3
- package/package.json +8 -3
- package/report.api.md +406 -0
- package/dist/cjs/components/card.js +0 -160
- package/dist/es2019/components/card.js +0 -131
- package/dist/esm/components/card.js +0 -142
- package/dist/types/components/card.d.ts +0 -59
|
@@ -1,106 +1,136 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
|
|
4
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
var _excluded = ["container"];
|
|
2
|
+
var _excluded = ["text", "key"];
|
|
10
3
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
18
|
-
|
|
19
|
-
import React from 'react';
|
|
20
|
-
import { Theme as ButtonTheme } from '@atlaskit/button/custom-theme-button';
|
|
4
|
+
/** @jsx jsx */
|
|
5
|
+
import React, { forwardRef } from 'react';
|
|
6
|
+
import { css, jsx } from '@emotion/core';
|
|
7
|
+
import Button, { Theme as ButtonTheme } from '@atlaskit/button/custom-theme-button';
|
|
8
|
+
import Heading from '@atlaskit/heading';
|
|
21
9
|
import { N0, N50A, N60A, P300 } from '@atlaskit/theme/colors';
|
|
22
|
-
import
|
|
10
|
+
import { createTheme } from '@atlaskit/theme/components';
|
|
11
|
+
import { borderRadius, gridSize as getGridSize, layers } from '@atlaskit/theme/constants';
|
|
12
|
+
import { DialogActionItem, DialogActionItemContainer } from '../styled/dialog';
|
|
23
13
|
import { spotlightButtonTheme } from './theme';
|
|
14
|
+
var gridSize = getGridSize();
|
|
15
|
+
var bodyStyles = css({
|
|
16
|
+
display: 'flex',
|
|
17
|
+
padding: "".concat(gridSize * 2, "px ").concat(gridSize * 2.5, "px"),
|
|
18
|
+
flexDirection: 'column'
|
|
19
|
+
});
|
|
20
|
+
var defaultHeaderStyles = css({
|
|
21
|
+
display: 'flex',
|
|
22
|
+
paddingBottom: "".concat(gridSize, "px"),
|
|
23
|
+
alignItems: 'baseline',
|
|
24
|
+
justifyContent: 'space-between'
|
|
25
|
+
});
|
|
24
26
|
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
var DefaultHeader = function DefaultHeader(_ref) {
|
|
28
|
+
var children = _ref.children;
|
|
29
|
+
return jsx("div", {
|
|
30
|
+
css: defaultHeaderStyles
|
|
31
|
+
}, children);
|
|
32
|
+
};
|
|
29
33
|
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
var defaultFooterStyles = css({
|
|
35
|
+
display: 'flex',
|
|
36
|
+
paddingTop: "".concat(gridSize, "px"),
|
|
37
|
+
alignItems: 'center',
|
|
38
|
+
justifyContent: 'space-between'
|
|
39
|
+
});
|
|
32
40
|
|
|
33
|
-
|
|
34
|
-
|
|
41
|
+
var DefaultFooter = function DefaultFooter(_ref2) {
|
|
42
|
+
var children = _ref2.children;
|
|
43
|
+
return jsx("div", {
|
|
44
|
+
css: defaultFooterStyles
|
|
45
|
+
}, children);
|
|
46
|
+
};
|
|
35
47
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
width = _this$props.width,
|
|
51
|
-
testId = _this$props.testId;
|
|
52
|
-
return /*#__PURE__*/React.createElement(ButtonTheme.Provider, {
|
|
53
|
-
value: spotlightButtonTheme
|
|
54
|
-
}, /*#__PURE__*/React.createElement(Card, {
|
|
55
|
-
testId: testId,
|
|
56
|
-
ref: innerRef,
|
|
57
|
-
heading: heading,
|
|
58
|
-
headingAfterElement: headingAfterElement,
|
|
59
|
-
actions: actions,
|
|
60
|
-
actionsBeforeElement: actionsBeforeElement,
|
|
61
|
-
components: components,
|
|
62
|
-
image: image // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
|
|
63
|
-
,
|
|
64
|
-
theme: function theme(parent) {
|
|
65
|
-
var _parent = parent({}),
|
|
66
|
-
container = _parent.container,
|
|
67
|
-
others = _objectWithoutProperties(_parent, _excluded);
|
|
48
|
+
var containerStyles = css({
|
|
49
|
+
height: 'fit-content',
|
|
50
|
+
zIndex: layers.spotlight() + 1,
|
|
51
|
+
background: "var(--ds-background-discovery-bold, ".concat(P300, ")"),
|
|
52
|
+
borderRadius: "".concat(borderRadius(), "px"),
|
|
53
|
+
color: "var(--ds-text-inverse, ".concat(N0, ")"),
|
|
54
|
+
overflow: 'auto'
|
|
55
|
+
});
|
|
56
|
+
var containerShadowStyles = css({
|
|
57
|
+
boxShadow: "var(--ds-shadow-raised, ".concat("0 4px 8px -2px ".concat(N50A, ", 0 0 1px ").concat(N60A), ")")
|
|
58
|
+
});
|
|
59
|
+
/**
|
|
60
|
+
* @deprecated
|
|
61
|
+
*/
|
|
68
62
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
});
|
|
78
|
-
}, {});
|
|
79
|
-
}
|
|
80
|
-
}, children));
|
|
81
|
-
}
|
|
82
|
-
}]);
|
|
63
|
+
var Theme = createTheme(function () {
|
|
64
|
+
return {
|
|
65
|
+
container: {}
|
|
66
|
+
};
|
|
67
|
+
});
|
|
68
|
+
/**
|
|
69
|
+
* @deprecated
|
|
70
|
+
*/
|
|
83
71
|
|
|
84
|
-
return SpotlightCard;
|
|
85
|
-
}(React.Component);
|
|
86
72
|
/**
|
|
87
73
|
* __Spotlight card__
|
|
88
74
|
*
|
|
89
|
-
*
|
|
75
|
+
* A spotlight card is for onboarding messages that need a more flexible layout, or don't require a dialog.
|
|
76
|
+
*
|
|
77
|
+
* - [Examples](https://atlassian.design/components/onboarding/spotlight-card/examples)
|
|
78
|
+
* - [Code](https://atlassian.design/components/onboarding/spotlight-card/code)
|
|
79
|
+
* - [Usage](https://atlassian.design/components/onboarding/spotlight-card/usage)
|
|
90
80
|
*/
|
|
81
|
+
var SpotlightCard = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
82
|
+
var _props$actions = props.actions,
|
|
83
|
+
actions = _props$actions === void 0 ? [] : _props$actions,
|
|
84
|
+
actionsBeforeElement = props.actionsBeforeElement,
|
|
85
|
+
children = props.children,
|
|
86
|
+
_props$components = props.components,
|
|
87
|
+
components = _props$components === void 0 ? {} : _props$components,
|
|
88
|
+
heading = props.heading,
|
|
89
|
+
headingAfterElement = props.headingAfterElement,
|
|
90
|
+
image = props.image,
|
|
91
|
+
innerRef = props.innerRef,
|
|
92
|
+
isFlat = props.isFlat,
|
|
93
|
+
testId = props.testId,
|
|
94
|
+
theme = props.theme,
|
|
95
|
+
_props$width = props.width,
|
|
96
|
+
width = _props$width === void 0 ? 400 : _props$width;
|
|
97
|
+
var _components$Header = components.Header,
|
|
98
|
+
Header = _components$Header === void 0 ? DefaultHeader : _components$Header,
|
|
99
|
+
_components$Footer = components.Footer,
|
|
100
|
+
Footer = _components$Footer === void 0 ? DefaultFooter : _components$Footer;
|
|
101
|
+
return jsx(ButtonTheme.Provider, {
|
|
102
|
+
value: spotlightButtonTheme
|
|
103
|
+
}, jsx(Theme.Provider, {
|
|
104
|
+
value: theme
|
|
105
|
+
}, jsx(Theme.Consumer, null, function (_ref3) {
|
|
106
|
+
var container = _ref3.container;
|
|
107
|
+
return jsx("div", {
|
|
108
|
+
css: [containerStyles, !isFlat && containerShadowStyles, // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
|
|
109
|
+
container],
|
|
110
|
+
style: {
|
|
111
|
+
width: "".concat(Math.min(Math.max(width, 160), 600), "px")
|
|
112
|
+
},
|
|
113
|
+
ref: ref || innerRef,
|
|
114
|
+
"data-testid": testId
|
|
115
|
+
}, typeof image === 'string' ? jsx("img", {
|
|
116
|
+
src: image,
|
|
117
|
+
alt: ""
|
|
118
|
+
}) : image, jsx("div", {
|
|
119
|
+
css: bodyStyles
|
|
120
|
+
}, heading || headingAfterElement ? jsx(Header, null, jsx(Heading, {
|
|
121
|
+
color: "inverse",
|
|
122
|
+
level: "h600",
|
|
123
|
+
as: "h4"
|
|
124
|
+
}, heading), headingAfterElement) : null, children, actions.length > 0 || actionsBeforeElement ? jsx(Footer, null, actionsBeforeElement || jsx("span", null), jsx(DialogActionItemContainer, null, actions.map(function (_ref4, idx) {
|
|
125
|
+
var text = _ref4.text,
|
|
126
|
+
key = _ref4.key,
|
|
127
|
+
rest = _objectWithoutProperties(_ref4, _excluded);
|
|
91
128
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
theme: function theme(themeFn) {
|
|
98
|
-
return themeFn();
|
|
99
|
-
}
|
|
129
|
+
return jsx(DialogActionItem, {
|
|
130
|
+
key: key || (typeof text === 'string' ? text : "".concat(idx))
|
|
131
|
+
}, jsx(Button, rest, text));
|
|
132
|
+
}))) : null));
|
|
133
|
+
})));
|
|
100
134
|
});
|
|
101
|
-
|
|
102
|
-
export default
|
|
103
|
-
return /*#__PURE__*/React.createElement(SpotlightCard, _extends({}, props, {
|
|
104
|
-
innerRef: ref
|
|
105
|
-
}));
|
|
106
|
-
});
|
|
135
|
+
SpotlightCard.displayName = 'SpotlightCard';
|
|
136
|
+
export default SpotlightCard;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
3
|
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
@@ -6,7 +5,6 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
6
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
var _excluded = ["container"];
|
|
10
8
|
|
|
11
9
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12
10
|
|
|
@@ -24,7 +22,7 @@ import { DialogImage } from '../styled/dialog';
|
|
|
24
22
|
import SpotlightCard from './spotlight-card';
|
|
25
23
|
import ValueChanged from './value-changed';
|
|
26
24
|
var packageName = "@atlaskit/onboarding";
|
|
27
|
-
var packageVersion = "10.
|
|
25
|
+
var packageVersion = "10.5.0";
|
|
28
26
|
|
|
29
27
|
var SpotlightDialog = /*#__PURE__*/function (_Component) {
|
|
30
28
|
_inherits(SpotlightDialog, _Component);
|
|
@@ -126,19 +124,11 @@ var SpotlightDialog = /*#__PURE__*/function (_Component) {
|
|
|
126
124
|
disabled: focusLockDisabled,
|
|
127
125
|
returnFocus: false,
|
|
128
126
|
autoFocus: true
|
|
129
|
-
}, /*#__PURE__*/React.createElement(
|
|
127
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
130
128
|
ref: ref,
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
var _parent = parent({}),
|
|
135
|
-
container = _parent.container,
|
|
136
|
-
others = _objectWithoutProperties(_parent, _excluded);
|
|
137
|
-
|
|
138
|
-
return _objectSpread(_objectSpread({}, others), {}, {
|
|
139
|
-
container: _objectSpread(_objectSpread(_objectSpread({}, container), style), animationStyles)
|
|
140
|
-
});
|
|
141
|
-
},
|
|
129
|
+
style: _objectSpread(_objectSpread({}, style), animationStyles)
|
|
130
|
+
}, /*#__PURE__*/React.createElement(SpotlightCard, {
|
|
131
|
+
testId: testId,
|
|
142
132
|
width: dialogWidth,
|
|
143
133
|
actions: actions,
|
|
144
134
|
actionsBeforeElement: actionsBeforeElement,
|
|
@@ -152,7 +142,7 @@ var SpotlightDialog = /*#__PURE__*/function (_Component) {
|
|
|
152
142
|
},
|
|
153
143
|
heading: heading,
|
|
154
144
|
headingAfterElement: headingAfterElement
|
|
155
|
-
}, children)));
|
|
145
|
+
}, children))));
|
|
156
146
|
});
|
|
157
147
|
}
|
|
158
148
|
}]);
|
|
@@ -16,13 +16,12 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
16
16
|
|
|
17
17
|
import React, { createContext, PureComponent } from 'react';
|
|
18
18
|
import memoizeOne from 'memoize-one';
|
|
19
|
+
import noop from '@atlaskit/ds-lib/noop';
|
|
19
20
|
import Portal from '@atlaskit/portal';
|
|
20
21
|
import { layers } from '@atlaskit/theme/constants';
|
|
21
22
|
import Blanket from '../styled/blanket';
|
|
22
23
|
import { Fade } from './animation';
|
|
23
24
|
|
|
24
|
-
var noop = function noop() {};
|
|
25
|
-
|
|
26
25
|
var _createContext = /*#__PURE__*/createContext(undefined),
|
|
27
26
|
TargetConsumer = _createContext.Consumer,
|
|
28
27
|
TargetProvider = _createContext.Provider;
|
|
@@ -45,9 +44,11 @@ var Container = function Container(_ref) {
|
|
|
45
44
|
/**
|
|
46
45
|
* __Spotlight manager__
|
|
47
46
|
*
|
|
48
|
-
*
|
|
47
|
+
* A spotlight manager manages the visibility of spotlights used to introduce new features to users through focused messages or multi-step tours.
|
|
49
48
|
*
|
|
50
|
-
* - [Examples](https://
|
|
49
|
+
* - [Examples](https://atlassian.design/components/onboarding/examples)
|
|
50
|
+
* - [Code](https://atlassian.design/components/onboarding/code)
|
|
51
|
+
* - [Usage](https://atlassian.design/components/onboarding/usage)
|
|
51
52
|
*/
|
|
52
53
|
|
|
53
54
|
|
|
@@ -5,9 +5,11 @@ import { TargetConsumer } from './spotlight-manager';
|
|
|
5
5
|
/**
|
|
6
6
|
* __Spotlight target__
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* A spotlight target marks a component to be used for introducing new features to users through focused messages or multi-step tours.
|
|
9
9
|
*
|
|
10
|
-
* - [Examples](https://
|
|
10
|
+
* - [Examples](https://atlassian.design/components/onboarding/examples)
|
|
11
|
+
* - [Code](https://atlassian.design/components/onboarding/code)
|
|
12
|
+
* - [Usage](https://atlassian.design/components/onboarding/usage)
|
|
11
13
|
*/
|
|
12
14
|
var SpotlightTarget = function SpotlightTarget(_ref) {
|
|
13
15
|
var children = _ref.children,
|
|
@@ -11,9 +11,10 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
11
11
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
12
|
|
|
13
13
|
import React, { createContext } from 'react';
|
|
14
|
+
import noop from '@atlaskit/ds-lib/noop';
|
|
14
15
|
var SpotlightTransitionContext = /*#__PURE__*/createContext({
|
|
15
16
|
isOpen: true,
|
|
16
|
-
onExited:
|
|
17
|
+
onExited: noop
|
|
17
18
|
}); // checks if children exist and are truthy
|
|
18
19
|
|
|
19
20
|
var hasChildren = function hasChildren(children) {
|
|
@@ -24,9 +25,11 @@ var hasChildren = function hasChildren(children) {
|
|
|
24
25
|
/**
|
|
25
26
|
* __Spotlight transition__
|
|
26
27
|
*
|
|
27
|
-
*
|
|
28
|
+
* A spotlight transition holds onto spotlights so they can fade out when exiting the viewport.
|
|
28
29
|
*
|
|
29
|
-
* - [Examples](https://
|
|
30
|
+
* - [Examples](https://atlassian.design/components/onboarding/examples)
|
|
31
|
+
* - [Code](https://atlassian.design/components/onboarding/code)
|
|
32
|
+
* - [Usage](https://atlassian.design/components/onboarding/usage)
|
|
30
33
|
*/
|
|
31
34
|
|
|
32
35
|
|
|
@@ -8,11 +8,11 @@ import { SpotlightConsumer } from './spotlight-manager';
|
|
|
8
8
|
/**
|
|
9
9
|
* __Spotlight__
|
|
10
10
|
*
|
|
11
|
-
*
|
|
11
|
+
* An onboarding spotlight introduces new features to users through focused messages or multi-step tours.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* - [
|
|
13
|
+
* - [Examples](https://atlassian.design/components/onboarding/examples)
|
|
14
|
+
* - [Code](https://atlassian.design/components/onboarding/code)
|
|
15
|
+
* - [Usage](https://atlassian.design/components/onboarding/usage)
|
|
16
16
|
*/
|
|
17
17
|
var Spotlight = function Spotlight(_ref) {
|
|
18
18
|
var _ref$dialogWidth = _ref.dialogWidth,
|
|
@@ -146,6 +146,11 @@ function extract(newTheme, _ref) {
|
|
|
146
146
|
return acc;
|
|
147
147
|
}, {});
|
|
148
148
|
}
|
|
149
|
+
/**
|
|
150
|
+
* @deprecated
|
|
151
|
+
* Custom button themes are deprecated and will be removed in the future.
|
|
152
|
+
*/
|
|
153
|
+
|
|
149
154
|
|
|
150
155
|
export var spotlightButtonTheme = function spotlightButtonTheme(current, themeProps) {
|
|
151
156
|
var _current = current(themeProps),
|
|
@@ -156,6 +161,11 @@ export var spotlightButtonTheme = function spotlightButtonTheme(current, themePr
|
|
|
156
161
|
buttonStyles: _objectSpread(_objectSpread({}, buttonStyles), extract(spotlightTheme, themeProps))
|
|
157
162
|
}, rest);
|
|
158
163
|
};
|
|
164
|
+
/**
|
|
165
|
+
* @deprecated
|
|
166
|
+
* Custom button themes are deprecated and will be removed in the future.
|
|
167
|
+
*/
|
|
168
|
+
|
|
159
169
|
export var modalButtonTheme = function modalButtonTheme(current, themeProps) {
|
|
160
170
|
var _current2 = current(themeProps),
|
|
161
171
|
buttonStyles = _current2.buttonStyles,
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { useCallback, useContext, useEffect, useMemo, useRef } from 'react';
|
|
2
2
|
import { SpotlightContext } from './spotlight-manager';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* Provides the following methods:
|
|
7
|
-
* - `isTargetRendered`
|
|
8
|
-
*
|
|
9
|
-
* Checks if the given spotlight target is currently
|
|
10
|
-
* being rendered.
|
|
4
|
+
* Use spotlight hook returns information about available spotlight targets.
|
|
11
5
|
*/
|
|
12
6
|
|
|
13
7
|
export default function useSpotlight() {
|
|
@@ -19,7 +19,7 @@ var baseShadow = "0 0 0 2px ".concat("var(--ds-border-discovery, ".concat(P300,
|
|
|
19
19
|
var easing = 'cubic-bezier(0.55, 0.055, 0.675, 0.19)';
|
|
20
20
|
var pulseKeyframes = keyframes({
|
|
21
21
|
'0%, 33%': {
|
|
22
|
-
boxShadow: "".concat(baseShadow, ", 0 0 0 "
|
|
22
|
+
boxShadow: "".concat(baseShadow, ", 0 0 0 ", "var(--ds-border-discovery, rgba(101, 84, 192, 1))")
|
|
23
23
|
},
|
|
24
24
|
'66%, 100%': {
|
|
25
25
|
boxShadow: "".concat(baseShadow, ", 0 0 0 10px rgba(101, 84, 192, 0.01)")
|
|
@@ -99,11 +99,13 @@ export var TargetOverlay = function TargetOverlay(props) {
|
|
|
99
99
|
}));
|
|
100
100
|
};
|
|
101
101
|
/**
|
|
102
|
-
*
|
|
102
|
+
* __Spotlight pulse__
|
|
103
103
|
*
|
|
104
|
-
*
|
|
104
|
+
* A spotlight pulse draws attention to a new feature.
|
|
105
105
|
*
|
|
106
|
-
* - [Examples](https://
|
|
106
|
+
* - [Examples](https://atlassian.design/components/onboarding/examples)
|
|
107
|
+
* - [Code](https://atlassian.design/components/onboarding/code)
|
|
108
|
+
* - [Usage](https://atlassian.design/components/onboarding/usage)
|
|
107
109
|
*/
|
|
108
110
|
|
|
109
111
|
export var Pulse = function Pulse(_ref3) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import { useEffect, useLayoutEffect, useState } from 'react';
|
|
3
|
+
import { bind } from 'bind-event-listener';
|
|
3
4
|
|
|
4
5
|
var getElementRect = function getElementRect(element) {
|
|
5
6
|
var _element$getBoundingC = element.getBoundingClientRect(),
|
|
@@ -43,10 +44,10 @@ export var useElementBox = function useElementBox(element) {
|
|
|
43
44
|
});
|
|
44
45
|
};
|
|
45
46
|
|
|
46
|
-
window
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
};
|
|
47
|
+
return bind(window, {
|
|
48
|
+
type: 'resize',
|
|
49
|
+
listener: onResize
|
|
50
|
+
});
|
|
50
51
|
}, [element]);
|
|
51
52
|
return box;
|
|
52
53
|
};
|
package/dist/esm/version.json
CHANGED
|
@@ -33,14 +33,15 @@ declare type ModalProps = {
|
|
|
33
33
|
experimental_shouldShowPrimaryButtonOnRight?: boolean;
|
|
34
34
|
};
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* __Benefits modal__
|
|
37
37
|
*
|
|
38
|
-
*
|
|
39
|
-
* this component can be used to outline the benefits of the change to the user.
|
|
38
|
+
* A benefits modal explains the benefits of a significant new feature or experience change.
|
|
40
39
|
*
|
|
41
|
-
* - [Examples](https://
|
|
40
|
+
* - [Examples](https://atlassian.design/components/onboarding/benefits-modal/examples)
|
|
41
|
+
* - [Code](https://atlassian.design/components/onboarding/benefits-modal/code)
|
|
42
|
+
* - [Usage](https://atlassian.design/components/onboarding/benefits-modal/usage)
|
|
42
43
|
*/
|
|
43
|
-
export default class
|
|
44
|
+
export default class BenefitsModal extends Component<ModalProps> {
|
|
44
45
|
headerComponent: (props: ModalProps) => ElementType<HeaderComponentProps> | (() => JSX.Element);
|
|
45
46
|
footerComponent: (props: ModalProps) => ElementType<FooterComponentProps> | (() => JSX.Element | null);
|
|
46
47
|
render(): JSX.Element;
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import React, { ComponentType, ReactNode, Ref } from 'react';
|
|
2
3
|
import { ThemeProp } from '@atlaskit/theme/components';
|
|
3
4
|
import { Actions } from '../types';
|
|
4
|
-
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated
|
|
7
|
+
*/
|
|
8
|
+
interface CardTokens {
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated
|
|
11
|
+
*/
|
|
12
|
+
container: Record<string, string | undefined>;
|
|
13
|
+
}
|
|
5
14
|
interface SpotlightCardProps {
|
|
6
15
|
/**
|
|
7
16
|
* Buttons to render in the footer
|
|
@@ -39,14 +48,19 @@ interface SpotlightCardProps {
|
|
|
39
48
|
*/
|
|
40
49
|
isFlat?: boolean;
|
|
41
50
|
/**
|
|
42
|
-
*
|
|
51
|
+
* @deprecated
|
|
52
|
+
* Theme prop is deprecated and will be removed in the future.
|
|
43
53
|
*/
|
|
44
54
|
theme?: ThemeProp<CardTokens, {}>;
|
|
45
55
|
/**
|
|
46
|
-
* Width of the card in pixels
|
|
56
|
+
* Width of the card in pixels.
|
|
47
57
|
*/
|
|
48
58
|
width?: number;
|
|
49
|
-
|
|
59
|
+
/**
|
|
60
|
+
* @deprecated
|
|
61
|
+
* Use `ref` instead.
|
|
62
|
+
*/
|
|
63
|
+
innerRef?: Ref<HTMLDivElement> | null;
|
|
50
64
|
/**
|
|
51
65
|
* A `testId` prop is provided for specified elements,
|
|
52
66
|
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
@@ -54,10 +68,14 @@ interface SpotlightCardProps {
|
|
|
54
68
|
*/
|
|
55
69
|
testId?: string;
|
|
56
70
|
}
|
|
57
|
-
declare const _default: React.ForwardRefExoticComponent<SpotlightCardProps & React.RefAttributes<HTMLElement>>;
|
|
58
71
|
/**
|
|
59
72
|
* __Spotlight card__
|
|
60
73
|
*
|
|
61
|
-
*
|
|
74
|
+
* A spotlight card is for onboarding messages that need a more flexible layout, or don't require a dialog.
|
|
75
|
+
*
|
|
76
|
+
* - [Examples](https://atlassian.design/components/onboarding/spotlight-card/examples)
|
|
77
|
+
* - [Code](https://atlassian.design/components/onboarding/spotlight-card/code)
|
|
78
|
+
* - [Usage](https://atlassian.design/components/onboarding/spotlight-card/usage)
|
|
62
79
|
*/
|
|
63
|
-
|
|
80
|
+
declare const SpotlightCard: React.ForwardRefExoticComponent<SpotlightCardProps & React.RefAttributes<HTMLDivElement>>;
|
|
81
|
+
export default SpotlightCard;
|
|
@@ -27,16 +27,18 @@ interface SpotlightManagerProps {
|
|
|
27
27
|
children: ReactNode;
|
|
28
28
|
/**
|
|
29
29
|
* @deprecated
|
|
30
|
-
*
|
|
30
|
+
* Component is deprecated and will be removed in the future.
|
|
31
31
|
*/
|
|
32
32
|
component?: ElementType;
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* __Spotlight manager__
|
|
36
36
|
*
|
|
37
|
-
*
|
|
37
|
+
* A spotlight manager manages the visibility of spotlights used to introduce new features to users through focused messages or multi-step tours.
|
|
38
38
|
*
|
|
39
|
-
* - [Examples](https://
|
|
39
|
+
* - [Examples](https://atlassian.design/components/onboarding/examples)
|
|
40
|
+
* - [Code](https://atlassian.design/components/onboarding/code)
|
|
41
|
+
* - [Usage](https://atlassian.design/components/onboarding/usage)
|
|
40
42
|
*/
|
|
41
43
|
export default class SpotlightManager extends PureComponent<SpotlightManagerProps, {
|
|
42
44
|
spotlightCount: number;
|
|
@@ -12,9 +12,11 @@ interface SpotlightTargetProps {
|
|
|
12
12
|
/**
|
|
13
13
|
* __Spotlight target__
|
|
14
14
|
*
|
|
15
|
-
*
|
|
15
|
+
* A spotlight target marks a component to be used for introducing new features to users through focused messages or multi-step tours.
|
|
16
16
|
*
|
|
17
|
-
* - [Examples](https://
|
|
17
|
+
* - [Examples](https://atlassian.design/components/onboarding/examples)
|
|
18
|
+
* - [Code](https://atlassian.design/components/onboarding/code)
|
|
19
|
+
* - [Usage](https://atlassian.design/components/onboarding/usage)
|
|
18
20
|
*/
|
|
19
21
|
declare const SpotlightTarget: React.FC<SpotlightTargetProps>;
|
|
20
22
|
export default SpotlightTarget;
|
|
@@ -16,9 +16,11 @@ interface SpotlightTransitionContextModel {
|
|
|
16
16
|
/**
|
|
17
17
|
* __Spotlight transition__
|
|
18
18
|
*
|
|
19
|
-
*
|
|
19
|
+
* A spotlight transition holds onto spotlights so they can fade out when exiting the viewport.
|
|
20
20
|
*
|
|
21
|
-
* - [Examples](https://
|
|
21
|
+
* - [Examples](https://atlassian.design/components/onboarding/examples)
|
|
22
|
+
* - [Code](https://atlassian.design/components/onboarding/code)
|
|
23
|
+
* - [Usage](https://atlassian.design/components/onboarding/usage)
|
|
22
24
|
*/
|
|
23
25
|
declare class SpotlightTransition extends React.Component<SpotlightTransitionProps, State> {
|
|
24
26
|
static getDerivedStateFromProps(props: SpotlightTransitionProps, state: State): {
|
|
@@ -86,11 +86,11 @@ export interface SpotlightProps {
|
|
|
86
86
|
/**
|
|
87
87
|
* __Spotlight__
|
|
88
88
|
*
|
|
89
|
-
*
|
|
89
|
+
* An onboarding spotlight introduces new features to users through focused messages or multi-step tours.
|
|
90
90
|
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
* - [
|
|
91
|
+
* - [Examples](https://atlassian.design/components/onboarding/examples)
|
|
92
|
+
* - [Code](https://atlassian.design/components/onboarding/code)
|
|
93
|
+
* - [Usage](https://atlassian.design/components/onboarding/usage)
|
|
94
94
|
*/
|
|
95
95
|
declare const Spotlight: React.FC<SpotlightProps>;
|
|
96
96
|
export default Spotlight;
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated
|
|
3
|
+
* Custom button themes are deprecated and will be removed in the future.
|
|
4
|
+
*/
|
|
1
5
|
export declare const spotlightButtonTheme: (current: any, themeProps: Record<string, any>) => any;
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated
|
|
8
|
+
* Custom button themes are deprecated and will be removed in the future.
|
|
9
|
+
*/
|
|
2
10
|
export declare const modalButtonTheme: (current: any, themeProps: Record<string, any>) => any;
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Provides the following methods:
|
|
5
|
-
* - `isTargetRendered`
|
|
6
|
-
*
|
|
7
|
-
* Checks if the given spotlight target is currently
|
|
8
|
-
* being rendered.
|
|
2
|
+
* Use spotlight hook returns information about available spotlight targets.
|
|
9
3
|
*/
|
|
10
4
|
export default function useSpotlight(): {
|
|
11
5
|
isTargetRendered: (target: string) => boolean;
|