@atlaskit/onboarding 11.2.6 → 11.3.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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/onboarding
2
2
 
3
+ ## 11.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#84838](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/84838) [`e3dc0b4099fe`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e3dc0b4099fe) - [ux] Now the pulsing animations in both the standard Spotlight and the dedicated Pulse component respect `prefers-reduced-motion` user preferences. If a user sets their system preferences to reduce motion, instead of a pulsing animation we will show a static 'discovery' outline.
8
+
9
+ ## 11.2.7
10
+
11
+ ### Patch Changes
12
+
13
+ - [#85076](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/85076) [`3032fb024382`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3032fb024382) - Associates the heading prop with the accessible label for the benefits modal.
14
+
3
15
  ## 11.2.6
4
16
 
5
17
  ### Patch Changes
@@ -95,12 +95,19 @@ var BenefitsModal = exports.default = /*#__PURE__*/function (_Component) {
95
95
  props = (0, _objectWithoutProperties2.default)(_this$props, _excluded2);
96
96
  var Header = this.headerComponent(this.props);
97
97
  var Footer = this.footerComponent(this.props);
98
+ var CustomHeader = function CustomHeader() {
99
+ var _useModal = (0, _modalDialog.useModal)(),
100
+ titleId = _useModal.titleId;
101
+ return (0, _react2.jsx)(_modal.ModalHeading, {
102
+ id: titleId
103
+ }, heading);
104
+ };
98
105
  return (0, _react2.jsx)(_modalDialog.default, (0, _extends2.default)({
99
106
  autoFocus: true,
100
107
  shouldScrollInViewport: true,
101
108
  shouldCloseOnOverlayClick: false,
102
109
  shouldCloseOnEscapePress: false
103
- }, props), (0, _react2.jsx)(Header, null), (0, _react2.jsx)(_modalDialog.ModalBody, null, (0, _react2.jsx)(_modal.ModalBody, null, heading && (0, _react2.jsx)(_modal.ModalHeading, null, heading), children)), (0, _react2.jsx)(Footer, null));
110
+ }, props), (0, _react2.jsx)(Header, null), (0, _react2.jsx)(_modalDialog.ModalBody, null, (0, _react2.jsx)(_modal.ModalBody, null, heading && (0, _react2.jsx)(CustomHeader, null), children)), (0, _react2.jsx)(Footer, null));
104
111
  }
105
112
  }]);
106
113
  return BenefitsModal;
@@ -27,7 +27,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
27
27
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
28
28
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
29
29
  var packageName = "@atlaskit/onboarding";
30
- var packageVersion = "11.2.6";
30
+ var packageVersion = "11.3.0";
31
31
  var SpotlightDialog = /*#__PURE__*/function (_Component) {
32
32
  (0, _inherits2.default)(SpotlightDialog, _Component);
33
33
  var _super = _createSuper(SpotlightDialog);
@@ -64,9 +64,11 @@ var ModalBody = exports.ModalBody = function ModalBody(_ref) {
64
64
  * @internal
65
65
  */
66
66
  var ModalHeading = exports.ModalHeading = function ModalHeading(_ref2) {
67
- var children = _ref2.children;
68
- return (0, _react.jsx)("h4", {
69
- css: modalHeadingStyles
67
+ var children = _ref2.children,
68
+ id = _ref2.id;
69
+ return (0, _react.jsx)("h1", {
70
+ css: modalHeadingStyles,
71
+ id: id
70
72
  }, children);
71
73
  };
72
74
 
@@ -9,6 +9,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
11
  var _react = require("@emotion/react");
12
+ var _motion = require("@atlaskit/motion");
12
13
  var _colors = require("@atlaskit/theme/colors");
13
14
  var _constants = require("@atlaskit/theme/constants");
14
15
  var _excluded = ["children", "bgColor", "radius", "style", "testId"],
@@ -32,7 +33,10 @@ var pulseKeyframes = (0, _react.keyframes)({
32
33
  // This is needed for unit tests
33
34
  var pulseKeyframesName = exports.pulseKeyframesName = pulseKeyframes.name;
34
35
  var animationStyles = (0, _react.css)({
35
- animation: "".concat(pulseKeyframes, " 3000ms ").concat(easing, " infinite")
36
+ animation: "".concat(pulseKeyframes, " 3000ms ").concat(easing, " infinite"),
37
+ // Keep a purple boxshadow on the Pulse component if `prefers-reduced-motion`
38
+ // is applied so we still have a functioning semantic affordance.
39
+ boxShadow: baseShadow
36
40
  });
37
41
 
38
42
  // IE11 and Edge: z-index needed because fixed position calculates z-index relative
@@ -69,21 +73,21 @@ var TargetInner = exports.TargetInner = function TargetInner(_ref2) {
69
73
  var children = _ref2.children,
70
74
  pulse = _ref2.pulse,
71
75
  props = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
72
- return (
73
- // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
74
- (0, _react.jsx)(Base, (0, _extends2.default)({}, props, {
75
- css: [pulse && animationStyles]
76
- }), children)
77
- );
76
+ return (0, _react.jsx)(Base
77
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
78
+ , (0, _extends2.default)({}, props, {
79
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
80
+ css: [pulse && animationStyles, _motion.reduceMotionAsPerUserPreference]
81
+ }), children);
78
82
  };
79
83
  var targetOverlayStyles = (0, _react.css)({
80
84
  width: '100%',
81
85
  height: '100%',
82
86
  position: 'absolute',
83
87
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
84
- top: 0,
88
+ insetBlockStart: 0,
85
89
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
86
- left: 0
90
+ insetInlineStart: 0
87
91
  });
88
92
 
89
93
  /**
@@ -118,11 +122,12 @@ var Pulse = exports.Pulse = function Pulse(_ref3) {
118
122
  pulse = _ref3$pulse === void 0 ? true : _ref3$pulse,
119
123
  testId = _ref3.testId,
120
124
  props = (0, _objectWithoutProperties2.default)(_ref3, _excluded3);
121
- return (
122
- // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
123
- (0, _react.jsx)(Base, (0, _extends2.default)({}, props, {
124
- css: [pulse && animationStyles],
125
- testId: testId
126
- }), children)
127
- );
125
+ return (0, _react.jsx)(Base
126
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
127
+ , (0, _extends2.default)({}, props, {
128
+ css: [pulse && animationStyles,
129
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
130
+ _motion.reduceMotionAsPerUserPreference],
131
+ testId: testId
132
+ }), children);
128
133
  };
@@ -4,7 +4,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
4
  import { Component } from 'react';
5
5
  import { jsx } from '@emotion/react';
6
6
  import Button, { Theme as ButtonTheme } from '@atlaskit/button/custom-theme-button';
7
- import Modal, { ModalBody } from '@atlaskit/modal-dialog';
7
+ import Modal, { ModalBody, useModal } from '@atlaskit/modal-dialog';
8
8
  import { ModalBody as Body, ModalHeading as Heading, ModalActionContainer, ModalActionItem, ModalImage } from '../styled/modal';
9
9
  import { modalButtonTheme } from './theme';
10
10
 
@@ -68,11 +68,19 @@ export default class BenefitsModal extends Component {
68
68
  } = this.props;
69
69
  const Header = this.headerComponent(this.props);
70
70
  const Footer = this.footerComponent(this.props);
71
+ const CustomHeader = () => {
72
+ const {
73
+ titleId
74
+ } = useModal();
75
+ return jsx(Heading, {
76
+ id: titleId
77
+ }, heading);
78
+ };
71
79
  return jsx(Modal, _extends({
72
80
  autoFocus: true,
73
81
  shouldScrollInViewport: true,
74
82
  shouldCloseOnOverlayClick: false,
75
83
  shouldCloseOnEscapePress: false
76
- }, props), jsx(Header, null), jsx(ModalBody, null, jsx(Body, null, heading && jsx(Heading, null, heading), children)), jsx(Footer, null));
84
+ }, props), jsx(Header, null), jsx(ModalBody, null, jsx(Body, null, heading && jsx(CustomHeader, null), children)), jsx(Footer, null));
77
85
  }
78
86
  }
@@ -7,7 +7,7 @@ import { DialogImage } from '../styled/dialog';
7
7
  import SpotlightCard from './spotlight-card';
8
8
  import ValueChanged from './value-changed';
9
9
  const packageName = "@atlaskit/onboarding";
10
- const packageVersion = "11.2.6";
10
+ const packageVersion = "11.3.0";
11
11
  class SpotlightDialog extends Component {
12
12
  constructor(...args) {
13
13
  super(...args);
@@ -57,10 +57,12 @@ export const ModalBody = ({
57
57
  * @internal
58
58
  */
59
59
  export const ModalHeading = ({
60
- children
60
+ children,
61
+ id
61
62
  }) => {
62
- return jsx("h4", {
63
- css: modalHeadingStyles
63
+ return jsx("h1", {
64
+ css: modalHeadingStyles,
65
+ id: id
64
66
  }, children);
65
67
  };
66
68
 
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  /** @jsx jsx */
3
3
 
4
4
  import { css, jsx, keyframes } from '@emotion/react';
5
+ import { reduceMotionAsPerUserPreference } from '@atlaskit/motion';
5
6
  import { P300 } from '@atlaskit/theme/colors';
6
7
  import { layers } from '@atlaskit/theme/constants';
7
8
  // NOTE:
@@ -19,7 +20,10 @@ const pulseKeyframes = keyframes({
19
20
  // This is needed for unit tests
20
21
  export const pulseKeyframesName = pulseKeyframes.name;
21
22
  const animationStyles = css({
22
- animation: `${pulseKeyframes} 3000ms ${easing} infinite`
23
+ animation: `${pulseKeyframes} 3000ms ${easing} infinite`,
24
+ // Keep a purple boxshadow on the Pulse component if `prefers-reduced-motion`
25
+ // is applied so we still have a functioning semantic affordance.
26
+ boxShadow: baseShadow
23
27
  });
24
28
 
25
29
  // IE11 and Edge: z-index needed because fixed position calculates z-index relative
@@ -56,19 +60,20 @@ export const TargetInner = ({
56
60
  children,
57
61
  pulse,
58
62
  ...props
59
- }) =>
63
+ }) => jsx(Base
60
64
  // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
61
- jsx(Base, _extends({}, props, {
62
- css: [pulse && animationStyles]
65
+ , _extends({}, props, {
66
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
67
+ css: [pulse && animationStyles, reduceMotionAsPerUserPreference]
63
68
  }), children);
64
69
  const targetOverlayStyles = css({
65
70
  width: '100%',
66
71
  height: '100%',
67
72
  position: 'absolute',
68
73
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
69
- top: 0,
74
+ insetBlockStart: 0,
70
75
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
71
- left: 0
76
+ insetInlineStart: 0
72
77
  });
73
78
 
74
79
  /**
@@ -100,9 +105,11 @@ export const Pulse = ({
100
105
  pulse = true,
101
106
  testId,
102
107
  ...props
103
- }) =>
108
+ }) => jsx(Base
104
109
  // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
105
- jsx(Base, _extends({}, props, {
106
- css: [pulse && animationStyles],
110
+ , _extends({}, props, {
111
+ css: [pulse && animationStyles,
112
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
113
+ reduceMotionAsPerUserPreference],
107
114
  testId: testId
108
115
  }), children);
@@ -15,7 +15,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
15
15
  import { Component } from 'react';
16
16
  import { jsx } from '@emotion/react';
17
17
  import Button, { Theme as ButtonTheme } from '@atlaskit/button/custom-theme-button';
18
- import Modal, { ModalBody } from '@atlaskit/modal-dialog';
18
+ import Modal, { ModalBody, useModal } from '@atlaskit/modal-dialog';
19
19
  import { ModalBody as Body, ModalHeading as Heading, ModalActionContainer, ModalActionItem, ModalImage } from '../styled/modal';
20
20
  import { modalButtonTheme } from './theme';
21
21
 
@@ -87,12 +87,19 @@ var BenefitsModal = /*#__PURE__*/function (_Component) {
87
87
  props = _objectWithoutProperties(_this$props, _excluded2);
88
88
  var Header = this.headerComponent(this.props);
89
89
  var Footer = this.footerComponent(this.props);
90
+ var CustomHeader = function CustomHeader() {
91
+ var _useModal = useModal(),
92
+ titleId = _useModal.titleId;
93
+ return jsx(Heading, {
94
+ id: titleId
95
+ }, heading);
96
+ };
90
97
  return jsx(Modal, _extends({
91
98
  autoFocus: true,
92
99
  shouldScrollInViewport: true,
93
100
  shouldCloseOnOverlayClick: false,
94
101
  shouldCloseOnEscapePress: false
95
- }, props), jsx(Header, null), jsx(ModalBody, null, jsx(Body, null, heading && jsx(Heading, null, heading), children)), jsx(Footer, null));
102
+ }, props), jsx(Header, null), jsx(ModalBody, null, jsx(Body, null, heading && jsx(CustomHeader, null), children)), jsx(Footer, null));
96
103
  }
97
104
  }]);
98
105
  return BenefitsModal;
@@ -17,7 +17,7 @@ import { DialogImage } from '../styled/dialog';
17
17
  import SpotlightCard from './spotlight-card';
18
18
  import ValueChanged from './value-changed';
19
19
  var packageName = "@atlaskit/onboarding";
20
- var packageVersion = "11.2.6";
20
+ var packageVersion = "11.3.0";
21
21
  var SpotlightDialog = /*#__PURE__*/function (_Component) {
22
22
  _inherits(SpotlightDialog, _Component);
23
23
  var _super = _createSuper(SpotlightDialog);
@@ -58,9 +58,11 @@ export var ModalBody = function ModalBody(_ref) {
58
58
  * @internal
59
59
  */
60
60
  export var ModalHeading = function ModalHeading(_ref2) {
61
- var children = _ref2.children;
62
- return jsx("h4", {
63
- css: modalHeadingStyles
61
+ var children = _ref2.children,
62
+ id = _ref2.id;
63
+ return jsx("h1", {
64
+ css: modalHeadingStyles,
65
+ id: id
64
66
  }, children);
65
67
  };
66
68
 
@@ -9,6 +9,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
9
9
  /** @jsx jsx */
10
10
 
11
11
  import { css, jsx, keyframes } from '@emotion/react';
12
+ import { reduceMotionAsPerUserPreference } from '@atlaskit/motion';
12
13
  import { P300 } from '@atlaskit/theme/colors';
13
14
  import { layers } from '@atlaskit/theme/constants';
14
15
  // NOTE:
@@ -26,7 +27,10 @@ var pulseKeyframes = keyframes({
26
27
  // This is needed for unit tests
27
28
  export var pulseKeyframesName = pulseKeyframes.name;
28
29
  var animationStyles = css({
29
- animation: "".concat(pulseKeyframes, " 3000ms ").concat(easing, " infinite")
30
+ animation: "".concat(pulseKeyframes, " 3000ms ").concat(easing, " infinite"),
31
+ // Keep a purple boxshadow on the Pulse component if `prefers-reduced-motion`
32
+ // is applied so we still have a functioning semantic affordance.
33
+ boxShadow: baseShadow
30
34
  });
31
35
 
32
36
  // IE11 and Edge: z-index needed because fixed position calculates z-index relative
@@ -63,21 +67,21 @@ export var TargetInner = function TargetInner(_ref2) {
63
67
  var children = _ref2.children,
64
68
  pulse = _ref2.pulse,
65
69
  props = _objectWithoutProperties(_ref2, _excluded2);
66
- return (
67
- // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
68
- jsx(Base, _extends({}, props, {
69
- css: [pulse && animationStyles]
70
- }), children)
71
- );
70
+ return jsx(Base
71
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
72
+ , _extends({}, props, {
73
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
74
+ css: [pulse && animationStyles, reduceMotionAsPerUserPreference]
75
+ }), children);
72
76
  };
73
77
  var targetOverlayStyles = css({
74
78
  width: '100%',
75
79
  height: '100%',
76
80
  position: 'absolute',
77
81
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
78
- top: 0,
82
+ insetBlockStart: 0,
79
83
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
80
- left: 0
84
+ insetInlineStart: 0
81
85
  });
82
86
 
83
87
  /**
@@ -112,11 +116,12 @@ export var Pulse = function Pulse(_ref3) {
112
116
  pulse = _ref3$pulse === void 0 ? true : _ref3$pulse,
113
117
  testId = _ref3.testId,
114
118
  props = _objectWithoutProperties(_ref3, _excluded3);
115
- return (
116
- // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
117
- jsx(Base, _extends({}, props, {
118
- css: [pulse && animationStyles],
119
- testId: testId
120
- }), children)
121
- );
119
+ return jsx(Base
120
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
121
+ , _extends({}, props, {
122
+ css: [pulse && animationStyles,
123
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
124
+ reduceMotionAsPerUserPreference],
125
+ testId: testId
126
+ }), children);
122
127
  };
@@ -22,8 +22,9 @@ export declare const ModalBody: ({ children }: {
22
22
  *
23
23
  * @internal
24
24
  */
25
- export declare const ModalHeading: ({ children }: {
25
+ export declare const ModalHeading: ({ children, id, }: {
26
26
  children: ReactNode;
27
+ id: string;
27
28
  }) => jsx.JSX.Element;
28
29
  /**
29
30
  * __Modal image__
@@ -22,8 +22,9 @@ export declare const ModalBody: ({ children }: {
22
22
  *
23
23
  * @internal
24
24
  */
25
- export declare const ModalHeading: ({ children }: {
25
+ export declare const ModalHeading: ({ children, id, }: {
26
26
  children: ReactNode;
27
+ id: string;
27
28
  }) => jsx.JSX.Element;
28
29
  /**
29
30
  * __Modal image__
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/onboarding",
3
- "version": "11.2.6",
3
+ "version": "11.3.0",
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/"
@@ -40,14 +40,15 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@atlaskit/analytics-next": "^9.2.0",
43
- "@atlaskit/button": "^17.7.0",
43
+ "@atlaskit/button": "^17.12.0",
44
44
  "@atlaskit/ds-lib": "^2.2.0",
45
45
  "@atlaskit/heading": "^2.1.0",
46
46
  "@atlaskit/modal-dialog": "^12.10.0",
47
+ "@atlaskit/motion": "^1.5.0",
47
48
  "@atlaskit/popper": "^5.5.0",
48
49
  "@atlaskit/portal": "^4.4.0",
49
- "@atlaskit/theme": "^12.6.0",
50
- "@atlaskit/tokens": "^1.42.0",
50
+ "@atlaskit/theme": "^12.7.0",
51
+ "@atlaskit/tokens": "^1.43.0",
51
52
  "@babel/runtime": "^7.0.0",
52
53
  "@emotion/react": "^11.7.1",
53
54
  "bind-event-listener": "^2.1.1",