@atlaskit/onboarding 10.6.7 → 10.6.9
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 +12 -0
- package/dist/cjs/components/animation.js +2 -13
- package/dist/cjs/components/clone.js +10 -16
- package/dist/cjs/components/index.js +0 -9
- package/dist/cjs/components/modal.js +11 -45
- package/dist/cjs/components/spotlight-card.js +26 -46
- package/dist/cjs/components/spotlight-dialog.js +19 -52
- package/dist/cjs/components/spotlight-inner.js +9 -44
- package/dist/cjs/components/spotlight-manager.js +8 -41
- package/dist/cjs/components/spotlight-target.js +1 -7
- package/dist/cjs/components/spotlight-transition.js +3 -27
- package/dist/cjs/components/spotlight.js +10 -19
- package/dist/cjs/components/theme.js +9 -32
- package/dist/cjs/components/use-spotlight.js +1 -5
- package/dist/cjs/components/value-changed.js +0 -14
- package/dist/cjs/index.js +0 -4
- package/dist/cjs/styled/blanket.js +3 -13
- package/dist/cjs/styled/dialog.js +6 -17
- package/dist/cjs/styled/modal.js +19 -33
- package/dist/cjs/styled/target.js +27 -41
- package/dist/cjs/utils/use-element-box.js +14 -26
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/animation.js +2 -2
- package/dist/es2019/components/clone.js +3 -6
- package/dist/es2019/components/modal.js +3 -10
- package/dist/es2019/components/spotlight-card.js +7 -11
- package/dist/es2019/components/spotlight-dialog.js +6 -11
- package/dist/es2019/components/spotlight-inner.js +2 -12
- package/dist/es2019/components/spotlight-manager.js +3 -13
- package/dist/es2019/components/spotlight-target.js +0 -2
- package/dist/es2019/components/spotlight-transition.js +4 -10
- package/dist/es2019/components/spotlight.js +0 -2
- package/dist/es2019/components/theme.js +6 -9
- package/dist/es2019/components/use-spotlight.js +1 -1
- package/dist/es2019/components/value-changed.js +0 -2
- package/dist/es2019/styled/blanket.js +5 -5
- package/dist/es2019/styled/dialog.js +5 -7
- package/dist/es2019/styled/modal.js +15 -14
- package/dist/es2019/styled/target.js +16 -15
- package/dist/es2019/utils/use-element-box.js +2 -5
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/animation.js +2 -8
- package/dist/esm/components/clone.js +10 -13
- package/dist/esm/components/modal.js +13 -32
- package/dist/esm/components/spotlight-card.js +26 -32
- package/dist/esm/components/spotlight-dialog.js +19 -35
- package/dist/esm/components/spotlight-inner.js +9 -29
- package/dist/esm/components/spotlight-manager.js +8 -32
- package/dist/esm/components/spotlight-target.js +1 -3
- package/dist/esm/components/spotlight-transition.js +3 -18
- package/dist/esm/components/spotlight.js +10 -13
- package/dist/esm/components/theme.js +9 -20
- package/dist/esm/components/use-spotlight.js +2 -3
- package/dist/esm/components/value-changed.js +0 -10
- package/dist/esm/styled/blanket.js +3 -7
- package/dist/esm/styled/dialog.js +6 -9
- package/dist/esm/styled/modal.js +18 -19
- package/dist/esm/styled/target.js +27 -32
- package/dist/esm/utils/use-element-box.js +14 -19
- package/dist/esm/version.json +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
3
2
|
/** @jsx jsx */
|
|
4
3
|
import { css, jsx, keyframes } from '@emotion/react';
|
|
5
4
|
import { P300 } from '@atlaskit/theme/colors';
|
|
@@ -15,18 +14,18 @@ const pulseKeyframes = keyframes({
|
|
|
15
14
|
'66%, 100%': {
|
|
16
15
|
boxShadow: `${baseShadow}, 0 0 0 10px rgba(101, 84, 192, 0.01)`
|
|
17
16
|
}
|
|
18
|
-
});
|
|
19
|
-
|
|
17
|
+
});
|
|
18
|
+
// This is needed for unit tests
|
|
20
19
|
export const pulseKeyframesName = pulseKeyframes.name;
|
|
21
20
|
const animationStyles = css({
|
|
22
21
|
animation: `${pulseKeyframes} 3000ms ${easing} infinite`
|
|
23
|
-
});
|
|
24
|
-
// to body instead of nearest stacking context (Portal in our case).
|
|
22
|
+
});
|
|
25
23
|
|
|
24
|
+
// IE11 and Edge: z-index needed because fixed position calculates z-index relative
|
|
25
|
+
// to body instead of nearest stacking context (Portal in our case).
|
|
26
26
|
const baseStyles = css({
|
|
27
27
|
zIndex: layers.spotlight() + 1
|
|
28
28
|
});
|
|
29
|
-
|
|
30
29
|
const Base = ({
|
|
31
30
|
children,
|
|
32
31
|
bgColor,
|
|
@@ -37,12 +36,14 @@ const Base = ({
|
|
|
37
36
|
}) => jsx("div", _extends({
|
|
38
37
|
css: baseStyles,
|
|
39
38
|
"data-testid": testId,
|
|
40
|
-
style: {
|
|
39
|
+
style: {
|
|
40
|
+
...style,
|
|
41
41
|
backgroundColor: bgColor,
|
|
42
42
|
borderRadius: radius ? `${radius}px` : undefined
|
|
43
|
-
}
|
|
44
|
-
|
|
43
|
+
}
|
|
44
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
45
45
|
}, props), children);
|
|
46
|
+
|
|
46
47
|
/**
|
|
47
48
|
* __Target inner__
|
|
48
49
|
*
|
|
@@ -50,13 +51,12 @@ const Base = ({
|
|
|
50
51
|
*
|
|
51
52
|
* @internal
|
|
52
53
|
*/
|
|
53
|
-
|
|
54
|
-
|
|
55
54
|
export const TargetInner = ({
|
|
56
55
|
children,
|
|
57
56
|
pulse,
|
|
58
57
|
...props
|
|
59
|
-
}) =>
|
|
58
|
+
}) =>
|
|
59
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
60
60
|
jsx(Base, _extends({}, props, {
|
|
61
61
|
css: [pulse && animationStyles]
|
|
62
62
|
}), children);
|
|
@@ -67,6 +67,7 @@ const targetOverlayStyles = css({
|
|
|
67
67
|
top: 0,
|
|
68
68
|
left: 0
|
|
69
69
|
});
|
|
70
|
+
|
|
70
71
|
/**
|
|
71
72
|
* __Target overlay__
|
|
72
73
|
*
|
|
@@ -75,13 +76,13 @@ const targetOverlayStyles = css({
|
|
|
75
76
|
*
|
|
76
77
|
* @internal
|
|
77
78
|
*/
|
|
78
|
-
|
|
79
79
|
export const TargetOverlay = props => jsx("div", _extends({}, props, {
|
|
80
80
|
css: targetOverlayStyles,
|
|
81
81
|
style: {
|
|
82
82
|
cursor: props.onClick ? 'pointer' : 'auto'
|
|
83
83
|
}
|
|
84
84
|
}));
|
|
85
|
+
|
|
85
86
|
/**
|
|
86
87
|
* __Spotlight pulse__
|
|
87
88
|
*
|
|
@@ -91,13 +92,13 @@ export const TargetOverlay = props => jsx("div", _extends({}, props, {
|
|
|
91
92
|
* - [Code](https://atlassian.design/components/onboarding/code)
|
|
92
93
|
* - [Usage](https://atlassian.design/components/onboarding/usage)
|
|
93
94
|
*/
|
|
94
|
-
|
|
95
95
|
export const Pulse = ({
|
|
96
96
|
children,
|
|
97
97
|
pulse = true,
|
|
98
98
|
testId,
|
|
99
99
|
...props
|
|
100
|
-
}) =>
|
|
100
|
+
}) =>
|
|
101
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
101
102
|
jsx(Base, _extends({}, props, {
|
|
102
103
|
css: [pulse && animationStyles],
|
|
103
104
|
testId: testId
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useEffect, useLayoutEffect, useState } from 'react';
|
|
2
2
|
import { bind } from 'bind-event-listener';
|
|
3
|
-
|
|
4
3
|
const getElementRect = element => {
|
|
5
4
|
const {
|
|
6
5
|
height,
|
|
@@ -15,13 +14,12 @@ const getElementRect = element => {
|
|
|
15
14
|
width
|
|
16
15
|
};
|
|
17
16
|
};
|
|
17
|
+
|
|
18
18
|
/**
|
|
19
19
|
* Will listen to the document resizing to see if an element has moved positions.
|
|
20
20
|
* Not using ResizeObserver because of IE11 support.
|
|
21
21
|
* @param element HTMLElement to watch when resizing.
|
|
22
22
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
23
|
export const useElementBox = element => {
|
|
26
24
|
const [box, setBox] = useState({
|
|
27
25
|
width: 0,
|
|
@@ -38,7 +36,6 @@ export const useElementBox = element => {
|
|
|
38
36
|
setBox(getElementRect(element));
|
|
39
37
|
});
|
|
40
38
|
};
|
|
41
|
-
|
|
42
39
|
return bind(window, {
|
|
43
40
|
type: 'resize',
|
|
44
41
|
listener: onResize
|
|
@@ -46,6 +43,7 @@ export const useElementBox = element => {
|
|
|
46
43
|
}, [element]);
|
|
47
44
|
return box;
|
|
48
45
|
};
|
|
46
|
+
|
|
49
47
|
/**
|
|
50
48
|
* __Element box__
|
|
51
49
|
*
|
|
@@ -53,7 +51,6 @@ export const useElementBox = element => {
|
|
|
53
51
|
*
|
|
54
52
|
* @internal
|
|
55
53
|
*/
|
|
56
|
-
|
|
57
54
|
export const ElementBox = props => {
|
|
58
55
|
const box = useElementBox(props.element);
|
|
59
56
|
return props.children(box);
|
package/dist/es2019/version.json
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
2
|
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; }
|
|
4
|
-
|
|
5
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
|
|
7
4
|
import React from 'react';
|
|
8
5
|
import { Transition } from 'react-transition-group';
|
|
9
6
|
var duration = {
|
|
10
7
|
enter: 0,
|
|
11
8
|
exit: 100
|
|
12
9
|
};
|
|
13
|
-
|
|
14
10
|
/**
|
|
15
11
|
* __Fade__
|
|
16
12
|
*
|
|
@@ -20,8 +16,8 @@ var duration = {
|
|
|
20
16
|
*/
|
|
21
17
|
export var Fade = function Fade(_ref) {
|
|
22
18
|
var hasEntered = _ref.hasEntered,
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
children = _ref.children,
|
|
20
|
+
onExited = _ref.onExited;
|
|
25
21
|
return /*#__PURE__*/React.createElement(Transition, {
|
|
26
22
|
in: hasEntered,
|
|
27
23
|
timeout: duration,
|
|
@@ -41,9 +37,7 @@ export var Fade = function Fade(_ref) {
|
|
|
41
37
|
opacity: 0
|
|
42
38
|
}
|
|
43
39
|
};
|
|
44
|
-
|
|
45
40
|
var style = _objectSpread(_objectSpread({}, base), anim[status]);
|
|
46
|
-
|
|
47
41
|
return children(style);
|
|
48
42
|
});
|
|
49
43
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TargetInner, TargetOverlay } from '../styled/target';
|
|
3
|
-
|
|
4
3
|
function cloneAndOverrideStyles(node) {
|
|
5
4
|
var shouldCloneChildren = true;
|
|
6
5
|
var clonedNode = node.cloneNode(shouldCloneChildren);
|
|
7
6
|
clonedNode.style.margin = '0';
|
|
8
|
-
clonedNode.style.position = 'static';
|
|
7
|
+
clonedNode.style.position = 'static';
|
|
8
|
+
// The target may have other transforms applied. Avoid unintended side effects
|
|
9
9
|
// by zeroing out "translate" rather than applying a value of "none".
|
|
10
|
-
|
|
11
10
|
clonedNode.style.transform = 'translate(0, 0) translate3d(0, 0, 0)';
|
|
12
11
|
return clonedNode;
|
|
13
12
|
}
|
|
13
|
+
|
|
14
14
|
/**
|
|
15
15
|
* __Clone__
|
|
16
16
|
*
|
|
@@ -19,17 +19,15 @@ function cloneAndOverrideStyles(node) {
|
|
|
19
19
|
*
|
|
20
20
|
* @internal
|
|
21
21
|
*/
|
|
22
|
-
|
|
23
|
-
|
|
24
22
|
var Clone = function Clone(props) {
|
|
25
23
|
var pulse = props.pulse,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
style = props.style,
|
|
25
|
+
target = props.target,
|
|
26
|
+
targetBgColor = props.targetBgColor,
|
|
27
|
+
targetOnClick = props.targetOnClick,
|
|
28
|
+
targetNode = props.targetNode,
|
|
29
|
+
targetRadius = props.targetRadius,
|
|
30
|
+
testId = props.testId;
|
|
33
31
|
return /*#__PURE__*/React.createElement(TargetInner, {
|
|
34
32
|
"data-testid": testId,
|
|
35
33
|
pulse: pulse,
|
|
@@ -54,5 +52,4 @@ var Clone = function Clone(props) {
|
|
|
54
52
|
} : undefined
|
|
55
53
|
}));
|
|
56
54
|
};
|
|
57
|
-
|
|
58
55
|
export default Clone;
|
|
@@ -8,20 +8,18 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
8
8
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
9
9
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
10
|
var _excluded = ["text", "key"],
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
_excluded2 = ["actions", "children", "heading"];
|
|
13
12
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
14
|
-
|
|
15
13
|
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; } }
|
|
16
|
-
|
|
17
14
|
/** @jsx jsx */
|
|
18
15
|
import { Component } from 'react';
|
|
19
16
|
import { jsx } from '@emotion/react';
|
|
20
17
|
import Button, { Theme as ButtonTheme } from '@atlaskit/button/custom-theme-button';
|
|
21
18
|
import Modal, { ModalBody } from '@atlaskit/modal-dialog';
|
|
22
19
|
import { ModalBody as Body, ModalHeading as Heading, ModalActionContainer, ModalActionItem, ModalImage } from '../styled/modal';
|
|
23
|
-
import { modalButtonTheme } from './theme';
|
|
20
|
+
import { modalButtonTheme } from './theme';
|
|
24
21
|
|
|
22
|
+
// TODO: DSP-1250 - use a composable API consistent with normal modal dialog
|
|
25
23
|
/**
|
|
26
24
|
* __Benefits modal__
|
|
27
25
|
*
|
|
@@ -33,40 +31,30 @@ import { modalButtonTheme } from './theme'; // TODO: DSP-1250 - use a composable
|
|
|
33
31
|
*/
|
|
34
32
|
var BenefitsModal = /*#__PURE__*/function (_Component) {
|
|
35
33
|
_inherits(BenefitsModal, _Component);
|
|
36
|
-
|
|
37
34
|
var _super = _createSuper(BenefitsModal);
|
|
38
|
-
|
|
39
35
|
function BenefitsModal() {
|
|
40
36
|
var _this;
|
|
41
|
-
|
|
42
37
|
_classCallCheck(this, BenefitsModal);
|
|
43
|
-
|
|
44
38
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
45
39
|
args[_key] = arguments[_key];
|
|
46
40
|
}
|
|
47
|
-
|
|
48
41
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
49
|
-
|
|
50
42
|
_defineProperty(_assertThisInitialized(_this), "headerComponent", function (props) {
|
|
51
43
|
var HeaderElement = props.header,
|
|
52
|
-
|
|
53
|
-
|
|
44
|
+
src = props.image;
|
|
54
45
|
var ImageElement = function ImageElement() {
|
|
55
46
|
return jsx(ModalImage, {
|
|
56
47
|
src: src,
|
|
57
48
|
alt: ""
|
|
58
49
|
});
|
|
59
50
|
};
|
|
60
|
-
|
|
61
51
|
return HeaderElement || ImageElement;
|
|
62
52
|
});
|
|
63
|
-
|
|
64
53
|
_defineProperty(_assertThisInitialized(_this), "footerComponent", function (props) {
|
|
65
54
|
var FooterElement = props.footer,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
55
|
+
actionList = props.actions,
|
|
56
|
+
_props$experimental_s = props.experimental_shouldShowPrimaryButtonOnRight,
|
|
57
|
+
experimental_shouldShowPrimaryButtonOnRight = _props$experimental_s === void 0 ? false : _props$experimental_s;
|
|
70
58
|
var ActionsElement = function ActionsElement() {
|
|
71
59
|
return actionList ? jsx(ButtonTheme.Provider, {
|
|
72
60
|
value: modalButtonTheme
|
|
@@ -74,9 +62,8 @@ var BenefitsModal = /*#__PURE__*/function (_Component) {
|
|
|
74
62
|
shouldReverseButtonOrder: experimental_shouldShowPrimaryButtonOnRight
|
|
75
63
|
}, actionList.map(function (_ref, idx) {
|
|
76
64
|
var text = _ref.text,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
65
|
+
key = _ref.key,
|
|
66
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
80
67
|
var variant = idx ? 'subtle-link' : 'primary';
|
|
81
68
|
return jsx(ModalActionItem, {
|
|
82
69
|
key: key || (typeof text === 'string' ? text : "".concat(idx))
|
|
@@ -86,22 +73,18 @@ var BenefitsModal = /*#__PURE__*/function (_Component) {
|
|
|
86
73
|
}, rest), text));
|
|
87
74
|
}))) : null;
|
|
88
75
|
};
|
|
89
|
-
|
|
90
76
|
return FooterElement || ActionsElement;
|
|
91
77
|
});
|
|
92
|
-
|
|
93
78
|
return _this;
|
|
94
79
|
}
|
|
95
|
-
|
|
96
80
|
_createClass(BenefitsModal, [{
|
|
97
81
|
key: "render",
|
|
98
82
|
value: function render() {
|
|
99
83
|
var _this$props = this.props,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
84
|
+
actions = _this$props.actions,
|
|
85
|
+
children = _this$props.children,
|
|
86
|
+
heading = _this$props.heading,
|
|
87
|
+
props = _objectWithoutProperties(_this$props, _excluded2);
|
|
105
88
|
var Header = this.headerComponent(this.props);
|
|
106
89
|
var Footer = this.footerComponent(this.props);
|
|
107
90
|
return jsx(Modal, _extends({
|
|
@@ -112,8 +95,6 @@ var BenefitsModal = /*#__PURE__*/function (_Component) {
|
|
|
112
95
|
}, props), jsx(Header, null), jsx(ModalBody, null, jsx(Body, null, heading && jsx(Heading, null, heading), children)), jsx(Footer, null));
|
|
113
96
|
}
|
|
114
97
|
}]);
|
|
115
|
-
|
|
116
98
|
return BenefitsModal;
|
|
117
99
|
}(Component);
|
|
118
|
-
|
|
119
100
|
export { BenefitsModal as default };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
2
|
var _excluded = ["text", "key"];
|
|
3
|
-
|
|
4
3
|
/** @jsx jsx */
|
|
5
4
|
import React, { forwardRef } from 'react';
|
|
6
5
|
import { css, jsx } from '@emotion/react';
|
|
@@ -13,39 +12,33 @@ import { DialogActionItem, DialogActionItemContainer } from '../styled/dialog';
|
|
|
13
12
|
import { spotlightButtonTheme } from './theme';
|
|
14
13
|
var bodyStyles = css({
|
|
15
14
|
display: 'flex',
|
|
16
|
-
padding: "var(--ds-
|
|
15
|
+
padding: "var(--ds-space-200, 16px)".concat(" ", "var(--ds-space-250, 20px)"),
|
|
17
16
|
flexDirection: 'column'
|
|
18
17
|
});
|
|
19
18
|
var defaultHeaderStyles = css({
|
|
20
19
|
display: 'flex',
|
|
21
|
-
|
|
22
|
-
paddingBottom: "var(--ds-scale-100, 8px)",
|
|
20
|
+
paddingBottom: "var(--ds-space-100, 8px)",
|
|
23
21
|
alignItems: 'baseline',
|
|
24
22
|
justifyContent: 'space-between'
|
|
25
23
|
});
|
|
26
|
-
|
|
27
24
|
var DefaultHeader = function DefaultHeader(_ref) {
|
|
28
25
|
var children = _ref.children;
|
|
29
26
|
return jsx("div", {
|
|
30
27
|
css: defaultHeaderStyles
|
|
31
28
|
}, children);
|
|
32
29
|
};
|
|
33
|
-
|
|
34
30
|
var defaultFooterStyles = css({
|
|
35
31
|
display: 'flex',
|
|
36
|
-
|
|
37
|
-
paddingTop: "var(--ds-scale-100, 8px)",
|
|
32
|
+
paddingTop: "var(--ds-space-100, 8px)",
|
|
38
33
|
alignItems: 'center',
|
|
39
34
|
justifyContent: 'space-between'
|
|
40
35
|
});
|
|
41
|
-
|
|
42
36
|
var DefaultFooter = function DefaultFooter(_ref2) {
|
|
43
37
|
var children = _ref2.children;
|
|
44
38
|
return jsx("div", {
|
|
45
39
|
css: defaultFooterStyles
|
|
46
40
|
}, children);
|
|
47
41
|
};
|
|
48
|
-
|
|
49
42
|
var containerStyles = css({
|
|
50
43
|
height: 'fit-content',
|
|
51
44
|
zIndex: layers.spotlight() + 1,
|
|
@@ -57,15 +50,16 @@ var containerStyles = css({
|
|
|
57
50
|
var containerShadowStyles = css({
|
|
58
51
|
boxShadow: "var(--ds-shadow-raised, ".concat("0 4px 8px -2px ".concat(N50A, ", 0 0 1px ").concat(N60A), ")")
|
|
59
52
|
});
|
|
53
|
+
|
|
60
54
|
/**
|
|
61
55
|
* @deprecated
|
|
62
56
|
*/
|
|
63
|
-
|
|
64
57
|
var Theme = createTheme(function () {
|
|
65
58
|
return {
|
|
66
59
|
container: {}
|
|
67
60
|
};
|
|
68
61
|
});
|
|
62
|
+
|
|
69
63
|
/**
|
|
70
64
|
* @deprecated
|
|
71
65
|
*/
|
|
@@ -81,24 +75,24 @@ var Theme = createTheme(function () {
|
|
|
81
75
|
*/
|
|
82
76
|
var SpotlightCard = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
83
77
|
var _props$actions = props.actions,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
78
|
+
actions = _props$actions === void 0 ? [] : _props$actions,
|
|
79
|
+
actionsBeforeElement = props.actionsBeforeElement,
|
|
80
|
+
children = props.children,
|
|
81
|
+
_props$components = props.components,
|
|
82
|
+
components = _props$components === void 0 ? {} : _props$components,
|
|
83
|
+
heading = props.heading,
|
|
84
|
+
headingAfterElement = props.headingAfterElement,
|
|
85
|
+
image = props.image,
|
|
86
|
+
innerRef = props.innerRef,
|
|
87
|
+
isFlat = props.isFlat,
|
|
88
|
+
testId = props.testId,
|
|
89
|
+
theme = props.theme,
|
|
90
|
+
_props$width = props.width,
|
|
91
|
+
width = _props$width === void 0 ? 400 : _props$width;
|
|
98
92
|
var _components$Header = components.Header,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
93
|
+
Header = _components$Header === void 0 ? DefaultHeader : _components$Header,
|
|
94
|
+
_components$Footer = components.Footer,
|
|
95
|
+
Footer = _components$Footer === void 0 ? DefaultFooter : _components$Footer;
|
|
102
96
|
return jsx(ButtonTheme.Provider, {
|
|
103
97
|
value: spotlightButtonTheme
|
|
104
98
|
}, jsx(Theme.Provider, {
|
|
@@ -106,7 +100,8 @@ var SpotlightCard = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
106
100
|
}, jsx(Theme.Consumer, null, function (_ref3) {
|
|
107
101
|
var container = _ref3.container;
|
|
108
102
|
return jsx("div", {
|
|
109
|
-
css: [containerStyles, !isFlat && containerShadowStyles,
|
|
103
|
+
css: [containerStyles, !isFlat && containerShadowStyles,
|
|
104
|
+
// eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
|
|
110
105
|
container],
|
|
111
106
|
style: {
|
|
112
107
|
width: "".concat(Math.min(Math.max(width, 160), 600), "px")
|
|
@@ -124,9 +119,8 @@ var SpotlightCard = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
124
119
|
as: "h4"
|
|
125
120
|
}, heading), headingAfterElement) : null, children, actions.length > 0 || actionsBeforeElement ? jsx(Footer, null, actionsBeforeElement || jsx("span", null), jsx(DialogActionItemContainer, null, actions.map(function (_ref4, idx) {
|
|
126
121
|
var text = _ref4.text,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
122
|
+
key = _ref4.key,
|
|
123
|
+
rest = _objectWithoutProperties(_ref4, _excluded);
|
|
130
124
|
return jsx(DialogActionItem, {
|
|
131
125
|
key: key || (typeof text === 'string' ? text : "".concat(idx))
|
|
132
126
|
}, jsx(Button, rest, text));
|
|
@@ -5,15 +5,10 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
|
|
9
8
|
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; }
|
|
10
|
-
|
|
11
9
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12
|
-
|
|
13
10
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
14
|
-
|
|
15
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; } }
|
|
16
|
-
|
|
17
12
|
import React, { Component } from 'react';
|
|
18
13
|
import FocusLock from 'react-focus-lock';
|
|
19
14
|
import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
@@ -22,36 +17,26 @@ import { DialogImage } from '../styled/dialog';
|
|
|
22
17
|
import SpotlightCard from './spotlight-card';
|
|
23
18
|
import ValueChanged from './value-changed';
|
|
24
19
|
var packageName = "@atlaskit/onboarding";
|
|
25
|
-
var packageVersion = "10.6.
|
|
26
|
-
|
|
20
|
+
var packageVersion = "10.6.9";
|
|
27
21
|
var SpotlightDialog = /*#__PURE__*/function (_Component) {
|
|
28
22
|
_inherits(SpotlightDialog, _Component);
|
|
29
|
-
|
|
30
23
|
var _super = _createSuper(SpotlightDialog);
|
|
31
|
-
|
|
32
24
|
function SpotlightDialog() {
|
|
33
25
|
var _this;
|
|
34
|
-
|
|
35
26
|
_classCallCheck(this, SpotlightDialog);
|
|
36
|
-
|
|
37
27
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
38
28
|
args[_key] = arguments[_key];
|
|
39
29
|
}
|
|
40
|
-
|
|
41
30
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
42
|
-
|
|
43
31
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
44
32
|
focusLockDisabled: true
|
|
45
33
|
});
|
|
46
|
-
|
|
47
34
|
return _this;
|
|
48
35
|
}
|
|
49
|
-
|
|
50
36
|
_createClass(SpotlightDialog, [{
|
|
51
37
|
key: "componentDidMount",
|
|
52
38
|
value: function componentDidMount() {
|
|
53
39
|
var _this2 = this;
|
|
54
|
-
|
|
55
40
|
this.focusLockTimeoutId = window.setTimeout(function () {
|
|
56
41
|
// we delay the enabling of the focus lock to avoid the scroll position
|
|
57
42
|
// jumping around in some situations
|
|
@@ -69,19 +54,19 @@ var SpotlightDialog = /*#__PURE__*/function (_Component) {
|
|
|
69
54
|
key: "render",
|
|
70
55
|
value: function render() {
|
|
71
56
|
var _this$props = this.props,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
57
|
+
actions = _this$props.actions,
|
|
58
|
+
actionsBeforeElement = _this$props.actionsBeforeElement,
|
|
59
|
+
animationStyles = _this$props.animationStyles,
|
|
60
|
+
children = _this$props.children,
|
|
61
|
+
dialogPlacement = _this$props.dialogPlacement,
|
|
62
|
+
dialogWidth = _this$props.dialogWidth,
|
|
63
|
+
footer = _this$props.footer,
|
|
64
|
+
header = _this$props.header,
|
|
65
|
+
heading = _this$props.heading,
|
|
66
|
+
headingAfterElement = _this$props.headingAfterElement,
|
|
67
|
+
image = _this$props.image,
|
|
68
|
+
targetNode = _this$props.targetNode,
|
|
69
|
+
testId = _this$props.testId;
|
|
85
70
|
var focusLockDisabled = this.state.focusLockDisabled;
|
|
86
71
|
var translatedPlacement = dialogPlacement ? {
|
|
87
72
|
'top left': 'top-start',
|
|
@@ -96,10 +81,11 @@ var SpotlightDialog = /*#__PURE__*/function (_Component) {
|
|
|
96
81
|
'left top': 'left-start',
|
|
97
82
|
'left middle': 'left',
|
|
98
83
|
'left bottom': 'left-end'
|
|
99
|
-
}[dialogPlacement] : undefined;
|
|
84
|
+
}[dialogPlacement] : undefined;
|
|
85
|
+
|
|
86
|
+
// If there's no room on either side of the popper, it will extend off-screen.
|
|
100
87
|
// This looks buggy when scroll-lock and focus is placed on the dialog, so we
|
|
101
88
|
// customise popper so it overflows the spotlight instead with altAxis=true.
|
|
102
|
-
|
|
103
89
|
var modifiers = [{
|
|
104
90
|
name: 'preventOverflow',
|
|
105
91
|
options: {
|
|
@@ -115,8 +101,8 @@ var SpotlightDialog = /*#__PURE__*/function (_Component) {
|
|
|
115
101
|
placement: translatedPlacement
|
|
116
102
|
}, function (_ref) {
|
|
117
103
|
var ref = _ref.ref,
|
|
118
|
-
|
|
119
|
-
|
|
104
|
+
style = _ref.style,
|
|
105
|
+
update = _ref.update;
|
|
120
106
|
return /*#__PURE__*/React.createElement(ValueChanged, {
|
|
121
107
|
value: dialogWidth,
|
|
122
108
|
onChange: update
|
|
@@ -146,10 +132,8 @@ var SpotlightDialog = /*#__PURE__*/function (_Component) {
|
|
|
146
132
|
});
|
|
147
133
|
}
|
|
148
134
|
}]);
|
|
149
|
-
|
|
150
135
|
return SpotlightDialog;
|
|
151
136
|
}(Component);
|
|
152
|
-
|
|
153
137
|
var createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
|
|
154
138
|
export default withAnalyticsContext({
|
|
155
139
|
componentName: 'spotlight',
|