@atlaskit/onboarding 10.6.7 → 10.6.8

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.
Files changed (61) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/components/animation.js +2 -13
  3. package/dist/cjs/components/clone.js +10 -16
  4. package/dist/cjs/components/index.js +0 -9
  5. package/dist/cjs/components/modal.js +11 -45
  6. package/dist/cjs/components/spotlight-card.js +26 -46
  7. package/dist/cjs/components/spotlight-dialog.js +19 -52
  8. package/dist/cjs/components/spotlight-inner.js +9 -44
  9. package/dist/cjs/components/spotlight-manager.js +8 -41
  10. package/dist/cjs/components/spotlight-target.js +1 -7
  11. package/dist/cjs/components/spotlight-transition.js +3 -27
  12. package/dist/cjs/components/spotlight.js +10 -19
  13. package/dist/cjs/components/theme.js +9 -32
  14. package/dist/cjs/components/use-spotlight.js +1 -5
  15. package/dist/cjs/components/value-changed.js +0 -14
  16. package/dist/cjs/index.js +0 -4
  17. package/dist/cjs/styled/blanket.js +3 -13
  18. package/dist/cjs/styled/dialog.js +6 -17
  19. package/dist/cjs/styled/modal.js +19 -33
  20. package/dist/cjs/styled/target.js +27 -41
  21. package/dist/cjs/utils/use-element-box.js +14 -26
  22. package/dist/cjs/version.json +1 -1
  23. package/dist/es2019/components/animation.js +2 -2
  24. package/dist/es2019/components/clone.js +3 -6
  25. package/dist/es2019/components/modal.js +3 -10
  26. package/dist/es2019/components/spotlight-card.js +7 -11
  27. package/dist/es2019/components/spotlight-dialog.js +6 -11
  28. package/dist/es2019/components/spotlight-inner.js +2 -12
  29. package/dist/es2019/components/spotlight-manager.js +3 -13
  30. package/dist/es2019/components/spotlight-target.js +0 -2
  31. package/dist/es2019/components/spotlight-transition.js +4 -10
  32. package/dist/es2019/components/spotlight.js +0 -2
  33. package/dist/es2019/components/theme.js +6 -9
  34. package/dist/es2019/components/use-spotlight.js +1 -1
  35. package/dist/es2019/components/value-changed.js +0 -2
  36. package/dist/es2019/styled/blanket.js +5 -5
  37. package/dist/es2019/styled/dialog.js +5 -7
  38. package/dist/es2019/styled/modal.js +15 -14
  39. package/dist/es2019/styled/target.js +16 -15
  40. package/dist/es2019/utils/use-element-box.js +2 -5
  41. package/dist/es2019/version.json +1 -1
  42. package/dist/esm/components/animation.js +2 -8
  43. package/dist/esm/components/clone.js +10 -13
  44. package/dist/esm/components/modal.js +13 -32
  45. package/dist/esm/components/spotlight-card.js +26 -32
  46. package/dist/esm/components/spotlight-dialog.js +19 -35
  47. package/dist/esm/components/spotlight-inner.js +9 -29
  48. package/dist/esm/components/spotlight-manager.js +8 -32
  49. package/dist/esm/components/spotlight-target.js +1 -3
  50. package/dist/esm/components/spotlight-transition.js +3 -18
  51. package/dist/esm/components/spotlight.js +10 -13
  52. package/dist/esm/components/theme.js +9 -20
  53. package/dist/esm/components/use-spotlight.js +2 -3
  54. package/dist/esm/components/value-changed.js +0 -10
  55. package/dist/esm/styled/blanket.js +3 -7
  56. package/dist/esm/styled/dialog.js +6 -9
  57. package/dist/esm/styled/modal.js +18 -19
  58. package/dist/esm/styled/target.js +27 -32
  59. package/dist/esm/utils/use-element-box.js +14 -19
  60. package/dist/esm/version.json +1 -1
  61. package/package.json +1 -1
@@ -3,27 +3,28 @@ import { css, jsx } from '@emotion/react';
3
3
  import { useGlobalTheme } from '@atlaskit/theme/components';
4
4
  import { borderRadius as getBorderRadius } from '@atlaskit/theme/constants';
5
5
  import { h600 } from '@atlaskit/theme/typography';
6
- var borderRadius = getBorderRadius(); // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
6
+ var borderRadius = getBorderRadius();
7
7
 
8
+ // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
8
9
  var lightH600Styles = css(h600({
9
10
  theme: {
10
11
  mode: 'light'
11
12
  }
12
- })); // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
13
-
13
+ }));
14
+ // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
14
15
  var darkH600Styles = css(h600({
15
16
  theme: {
16
17
  mode: 'dark'
17
18
  }
18
19
  }));
19
20
  var modalBodyStyles = css({
20
- padding: "var(--ds-scale-500, 40px)".concat(" ", "var(--ds-scale-250, 20px)"),
21
+ padding: "var(--ds-space-500, 40px)".concat(" ", "var(--ds-space-250, 20px)"),
21
22
  textAlign: 'center'
22
- }); // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
23
+ });
23
24
 
25
+ // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
24
26
  var modalHeadingStyles = css({
25
- // TODO Delete this comment after verifying spacing token -> previous value ``${gridSize}px``
26
- marginBottom: "var(--ds-scale-100, 8px)",
27
+ marginBottom: "var(--ds-space-100, 8px)",
27
28
  color: 'inherit'
28
29
  });
29
30
  var modalImageStyles = css({
@@ -37,7 +38,7 @@ var modalImageStyles = css({
37
38
  });
38
39
  var modalActionContainerStyles = css({
39
40
  display: 'flex',
40
- padding: "var(--ds-scale-0, 0px)".concat(" ", "var(--ds-scale-500, 40px)", " 36px"),
41
+ padding: "var(--ds-space-0, 0px)".concat(" ", "var(--ds-space-500, 40px)", " 36px"),
41
42
  justifyContent: 'center',
42
43
  flexDirection: 'row',
43
44
  flexFlow: 'wrap'
@@ -46,70 +47,68 @@ var modalActionContainerReversedStyles = css({
46
47
  flexDirection: 'row-reverse'
47
48
  });
48
49
  var modalActionItemStyles = css({
49
- margin: "var(--ds-scale-0, 0px)".concat(" ", "var(--ds-scale-050, 4px)", " ", "var(--ds-scale-050, 4px)")
50
+ margin: "var(--ds-space-0, 0px)".concat(" ", "var(--ds-space-050, 4px)", " ", "var(--ds-space-050, 4px)")
50
51
  });
52
+
51
53
  /**
52
54
  * __Modal body__
53
55
  *
54
56
  * @internal
55
57
  */
56
-
57
58
  export var ModalBody = function ModalBody(_ref) {
58
59
  var children = _ref.children;
59
60
  return jsx("div", {
60
61
  css: modalBodyStyles
61
62
  }, children);
62
63
  };
64
+
63
65
  /**
64
66
  * __Modal heading__
65
67
  *
66
68
  * @internal
67
69
  */
68
-
69
70
  export var ModalHeading = function ModalHeading(_ref2) {
70
71
  var children = _ref2.children;
71
-
72
72
  var _useGlobalTheme = useGlobalTheme(),
73
- mode = _useGlobalTheme.mode;
74
-
73
+ mode = _useGlobalTheme.mode;
75
74
  return jsx("h4", {
76
75
  css: [mode === 'light' ? lightH600Styles : darkH600Styles, modalHeadingStyles]
77
76
  }, children);
78
77
  };
78
+
79
79
  /**
80
80
  * __Modal image__
81
81
  *
82
82
  * @internal
83
83
  */
84
-
85
84
  export var ModalImage = function ModalImage(_ref3) {
86
85
  var alt = _ref3.alt,
87
- src = _ref3.src;
86
+ src = _ref3.src;
88
87
  return jsx("img", {
89
88
  css: modalImageStyles,
90
89
  alt: alt,
91
90
  src: src
92
91
  });
93
92
  };
93
+
94
94
  /**
95
95
  * __Modal action container__
96
96
  *
97
97
  * @internal
98
98
  */
99
-
100
99
  export var ModalActionContainer = function ModalActionContainer(_ref4) {
101
100
  var children = _ref4.children,
102
- shouldReverseButtonOrder = _ref4.shouldReverseButtonOrder;
101
+ shouldReverseButtonOrder = _ref4.shouldReverseButtonOrder;
103
102
  return jsx("div", {
104
103
  css: [modalActionContainerStyles, shouldReverseButtonOrder && modalActionContainerReversedStyles]
105
104
  }, children);
106
105
  };
106
+
107
107
  /**
108
108
  * __Modal action item__
109
109
  *
110
110
  * @internal
111
111
  */
112
-
113
112
  export var ModalActionItem = function ModalActionItem(_ref5) {
114
113
  var children = _ref5.children;
115
114
  return jsx("div", {
@@ -2,13 +2,10 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
4
  var _excluded = ["children", "bgColor", "radius", "style", "testId"],
5
- _excluded2 = ["children", "pulse"],
6
- _excluded3 = ["children", "pulse", "testId"];
7
-
5
+ _excluded2 = ["children", "pulse"],
6
+ _excluded3 = ["children", "pulse", "testId"];
8
7
  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; }
9
-
10
8
  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; }
11
-
12
9
  /** @jsx jsx */
13
10
  import { css, jsx, keyframes } from '@emotion/react';
14
11
  import { P300 } from '@atlaskit/theme/colors';
@@ -24,36 +21,36 @@ var pulseKeyframes = keyframes({
24
21
  '66%, 100%': {
25
22
  boxShadow: "".concat(baseShadow, ", 0 0 0 10px rgba(101, 84, 192, 0.01)")
26
23
  }
27
- }); // This is needed for unit tests
28
-
24
+ });
25
+ // This is needed for unit tests
29
26
  export var pulseKeyframesName = pulseKeyframes.name;
30
27
  var animationStyles = css({
31
28
  animation: "".concat(pulseKeyframes, " 3000ms ").concat(easing, " infinite")
32
- }); // IE11 and Edge: z-index needed because fixed position calculates z-index relative
33
- // to body instead of nearest stacking context (Portal in our case).
29
+ });
34
30
 
31
+ // IE11 and Edge: z-index needed because fixed position calculates z-index relative
32
+ // to body instead of nearest stacking context (Portal in our case).
35
33
  var baseStyles = css({
36
34
  zIndex: layers.spotlight() + 1
37
35
  });
38
-
39
36
  var Base = function Base(_ref) {
40
37
  var children = _ref.children,
41
- bgColor = _ref.bgColor,
42
- radius = _ref.radius,
43
- style = _ref.style,
44
- testId = _ref.testId,
45
- props = _objectWithoutProperties(_ref, _excluded);
46
-
38
+ bgColor = _ref.bgColor,
39
+ radius = _ref.radius,
40
+ style = _ref.style,
41
+ testId = _ref.testId,
42
+ props = _objectWithoutProperties(_ref, _excluded);
47
43
  return jsx("div", _extends({
48
44
  css: baseStyles,
49
45
  "data-testid": testId,
50
46
  style: _objectSpread(_objectSpread({}, style), {}, {
51
47
  backgroundColor: bgColor,
52
48
  borderRadius: radius ? "".concat(radius, "px") : undefined
53
- }) // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
54
-
49
+ })
50
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
55
51
  }, props), children);
56
52
  };
53
+
57
54
  /**
58
55
  * __Target inner__
59
56
  *
@@ -61,14 +58,12 @@ var Base = function Base(_ref) {
61
58
  *
62
59
  * @internal
63
60
  */
64
-
65
-
66
61
  export var TargetInner = function TargetInner(_ref2) {
67
62
  var children = _ref2.children,
68
- pulse = _ref2.pulse,
69
- props = _objectWithoutProperties(_ref2, _excluded2);
70
-
71
- return (// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
63
+ pulse = _ref2.pulse,
64
+ props = _objectWithoutProperties(_ref2, _excluded2);
65
+ return (
66
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
72
67
  jsx(Base, _extends({}, props, {
73
68
  css: [pulse && animationStyles]
74
69
  }), children)
@@ -81,6 +76,7 @@ var targetOverlayStyles = css({
81
76
  top: 0,
82
77
  left: 0
83
78
  });
79
+
84
80
  /**
85
81
  * __Target overlay__
86
82
  *
@@ -89,7 +85,6 @@ var targetOverlayStyles = css({
89
85
  *
90
86
  * @internal
91
87
  */
92
-
93
88
  export var TargetOverlay = function TargetOverlay(props) {
94
89
  return jsx("div", _extends({}, props, {
95
90
  css: targetOverlayStyles,
@@ -98,6 +93,7 @@ export var TargetOverlay = function TargetOverlay(props) {
98
93
  }
99
94
  }));
100
95
  };
96
+
101
97
  /**
102
98
  * __Spotlight pulse__
103
99
  *
@@ -107,15 +103,14 @@ export var TargetOverlay = function TargetOverlay(props) {
107
103
  * - [Code](https://atlassian.design/components/onboarding/code)
108
104
  * - [Usage](https://atlassian.design/components/onboarding/usage)
109
105
  */
110
-
111
106
  export var Pulse = function Pulse(_ref3) {
112
107
  var children = _ref3.children,
113
- _ref3$pulse = _ref3.pulse,
114
- pulse = _ref3$pulse === void 0 ? true : _ref3$pulse,
115
- testId = _ref3.testId,
116
- props = _objectWithoutProperties(_ref3, _excluded3);
117
-
118
- return (// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
108
+ _ref3$pulse = _ref3.pulse,
109
+ pulse = _ref3$pulse === void 0 ? true : _ref3$pulse,
110
+ testId = _ref3.testId,
111
+ props = _objectWithoutProperties(_ref3, _excluded3);
112
+ return (
113
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
119
114
  jsx(Base, _extends({}, props, {
120
115
  css: [pulse && animationStyles],
121
116
  testId: testId
@@ -1,14 +1,12 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import { useEffect, useLayoutEffect, useState } from 'react';
3
3
  import { bind } from 'bind-event-listener';
4
-
5
4
  var getElementRect = function getElementRect(element) {
6
5
  var _element$getBoundingC = element.getBoundingClientRect(),
7
- height = _element$getBoundingC.height,
8
- left = _element$getBoundingC.left,
9
- top = _element$getBoundingC.top,
10
- width = _element$getBoundingC.width;
11
-
6
+ height = _element$getBoundingC.height,
7
+ left = _element$getBoundingC.left,
8
+ top = _element$getBoundingC.top,
9
+ width = _element$getBoundingC.width;
12
10
  return {
13
11
  height: height,
14
12
  left: left,
@@ -16,24 +14,22 @@ var getElementRect = function getElementRect(element) {
16
14
  width: width
17
15
  };
18
16
  };
17
+
19
18
  /**
20
19
  * Will listen to the document resizing to see if an element has moved positions.
21
20
  * Not using ResizeObserver because of IE11 support.
22
21
  * @param element HTMLElement to watch when resizing.
23
22
  */
24
-
25
-
26
23
  export var useElementBox = function useElementBox(element) {
27
24
  var _useState = useState({
28
- width: 0,
29
- height: 0,
30
- left: 0,
31
- top: 0
32
- }),
33
- _useState2 = _slicedToArray(_useState, 2),
34
- box = _useState2[0],
35
- setBox = _useState2[1];
36
-
25
+ width: 0,
26
+ height: 0,
27
+ left: 0,
28
+ top: 0
29
+ }),
30
+ _useState2 = _slicedToArray(_useState, 2),
31
+ box = _useState2[0],
32
+ setBox = _useState2[1];
37
33
  useLayoutEffect(function () {
38
34
  setBox(getElementRect(element));
39
35
  }, [element]);
@@ -43,7 +39,6 @@ export var useElementBox = function useElementBox(element) {
43
39
  setBox(getElementRect(element));
44
40
  });
45
41
  };
46
-
47
42
  return bind(window, {
48
43
  type: 'resize',
49
44
  listener: onResize
@@ -51,6 +46,7 @@ export var useElementBox = function useElementBox(element) {
51
46
  }, [element]);
52
47
  return box;
53
48
  };
49
+
54
50
  /**
55
51
  * __Element box__
56
52
  *
@@ -58,7 +54,6 @@ export var useElementBox = function useElementBox(element) {
58
54
  *
59
55
  * @internal
60
56
  */
61
-
62
57
  export var ElementBox = function ElementBox(props) {
63
58
  var box = useElementBox(props.element);
64
59
  return props.children(box);
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/onboarding",
3
- "version": "10.6.7",
3
+ "version": "10.6.8",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/onboarding",
3
- "version": "10.6.7",
3
+ "version": "10.6.8",
4
4
  "description": "An onboarding spotlight introduces new features to users through focused messages or multi-step tours.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"