@atlaskit/onboarding 10.8.11 → 11.0.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.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#54210](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/54210) [`524ec7b6505d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/524ec7b6505d) - Removed all remaining legacy theming logic from the Onboarding component.
8
+
9
+ ## 10.8.12
10
+
11
+ ### Patch Changes
12
+
13
+ - [#43073](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43073) [`2d760e89b53`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2d760e89b53) - headingId is the id of heading in spotlightCard, which is used as the value of aria-labelledby attribute of `<div>` element containing the modal dialog heading for screen reader recognising the dialog
14
+
3
15
  ## 10.8.11
4
16
 
5
17
  ### Patch Changes
@@ -12,7 +12,6 @@ var _react2 = require("@emotion/react");
12
12
  var _customThemeButton = _interopRequireWildcard(require("@atlaskit/button/custom-theme-button"));
13
13
  var _heading = _interopRequireDefault(require("@atlaskit/heading"));
14
14
  var _colors = require("@atlaskit/theme/colors");
15
- var _components = require("@atlaskit/theme/components");
16
15
  var _constants = require("@atlaskit/theme/constants");
17
16
  var _dialog = require("../styled/dialog");
18
17
  var _theme = require("./theme");
@@ -30,9 +29,9 @@ var imageStyles = (0, _react2.css)({
30
29
  });
31
30
  var defaultHeaderStyles = (0, _react2.css)({
32
31
  display: 'flex',
33
- paddingBottom: "var(--ds-space-100, 8px)",
34
32
  alignItems: 'baseline',
35
- justifyContent: 'space-between'
33
+ justifyContent: 'space-between',
34
+ paddingBlockEnd: "var(--ds-space-100, 8px)"
36
35
  });
37
36
  var DefaultHeader = function DefaultHeader(_ref) {
38
37
  var children = _ref.children;
@@ -42,9 +41,9 @@ var DefaultHeader = function DefaultHeader(_ref) {
42
41
  };
43
42
  var defaultFooterStyles = (0, _react2.css)({
44
43
  display: 'flex',
45
- paddingTop: "var(--ds-space-100, 8px)",
46
44
  alignItems: 'center',
47
- justifyContent: 'space-between'
45
+ justifyContent: 'space-between',
46
+ paddingBlockStart: "var(--ds-space-100, 8px)"
48
47
  });
49
48
  var DefaultFooter = function DefaultFooter(_ref2) {
50
49
  var children = _ref2.children;
@@ -63,20 +62,6 @@ var containerStyles = (0, _react2.css)({
63
62
  var containerShadowStyles = (0, _react2.css)({
64
63
  boxShadow: "var(--ds-shadow-raised, ".concat("0 4px 8px -2px ".concat(_colors.N50A, ", 0 0 1px ").concat(_colors.N60A), ")")
65
64
  });
66
-
67
- /**
68
- * @deprecated
69
- */
70
- var Theme = (0, _components.createTheme)(function () {
71
- return {
72
- container: {}
73
- };
74
- });
75
-
76
- /**
77
- * @deprecated
78
- */
79
-
80
65
  /**
81
66
  * __Spotlight card__
82
67
  *
@@ -99,49 +84,43 @@ var SpotlightCard = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
99
84
  innerRef = props.innerRef,
100
85
  isFlat = props.isFlat,
101
86
  testId = props.testId,
102
- theme = props.theme,
103
87
  _props$width = props.width,
104
- width = _props$width === void 0 ? 400 : _props$width;
88
+ width = _props$width === void 0 ? 400 : _props$width,
89
+ headingId = props.headingId;
105
90
  var _components$Header = components.Header,
106
91
  Header = _components$Header === void 0 ? DefaultHeader : _components$Header,
107
92
  _components$Footer = components.Footer,
108
93
  Footer = _components$Footer === void 0 ? DefaultFooter : _components$Footer;
109
94
  return (0, _react2.jsx)(_customThemeButton.Theme.Provider, {
110
95
  value: _theme.spotlightButtonTheme
111
- }, (0, _react2.jsx)(Theme.Provider, {
112
- value: theme
113
- }, (0, _react2.jsx)(Theme.Consumer, null, function (_ref3) {
114
- var container = _ref3.container;
115
- return (0, _react2.jsx)("div", {
116
- css: [containerStyles, !isFlat && containerShadowStyles,
117
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
118
- container],
119
- style: {
120
- minWidth: '160px',
121
- maxWidth: '600px',
122
- width: typeof width === 'string' ? width : "".concat(width, "px")
123
- },
124
- ref: ref || innerRef,
125
- "data-testid": testId
126
- }, typeof image === 'string' ? (0, _react2.jsx)("img", {
127
- css: imageStyles,
128
- src: image,
129
- alt: ""
130
- }) : image, (0, _react2.jsx)("div", {
131
- css: bodyStyles
132
- }, heading || headingAfterElement ? (0, _react2.jsx)(Header, null, (0, _react2.jsx)(_heading.default, {
133
- color: "inverse",
134
- level: "h600",
135
- as: "h4"
136
- }, heading), headingAfterElement) : null, children, actions.length > 0 || actionsBeforeElement ? (0, _react2.jsx)(Footer, null, actionsBeforeElement || (0, _react2.jsx)("span", null), (0, _react2.jsx)(_dialog.DialogActionItemContainer, null, actions.map(function (_ref4, idx) {
137
- var text = _ref4.text,
138
- key = _ref4.key,
139
- rest = (0, _objectWithoutProperties2.default)(_ref4, _excluded);
140
- return (0, _react2.jsx)(_dialog.DialogActionItem, {
141
- key: key || (typeof text === 'string' ? text : "".concat(idx))
142
- }, (0, _react2.jsx)(_customThemeButton.default, rest, text));
143
- }))) : null));
144
- })));
96
+ }, (0, _react2.jsx)("div", {
97
+ css: [containerStyles, !isFlat && containerShadowStyles],
98
+ style: {
99
+ minWidth: '160px',
100
+ maxWidth: '600px',
101
+ width: typeof width === 'string' ? width : "".concat(width, "px")
102
+ },
103
+ ref: ref || innerRef,
104
+ "data-testid": testId
105
+ }, typeof image === 'string' ? (0, _react2.jsx)("img", {
106
+ css: imageStyles,
107
+ src: image,
108
+ alt: ""
109
+ }) : image, (0, _react2.jsx)("div", {
110
+ css: bodyStyles
111
+ }, heading || headingAfterElement ? (0, _react2.jsx)(Header, null, (0, _react2.jsx)(_heading.default, {
112
+ id: headingId,
113
+ color: "inverse",
114
+ level: "h600",
115
+ as: "h4"
116
+ }, heading), headingAfterElement) : null, children, actions.length > 0 || actionsBeforeElement ? (0, _react2.jsx)(Footer, null, actionsBeforeElement || (0, _react2.jsx)("span", null), (0, _react2.jsx)(_dialog.DialogActionItemContainer, null, actions.map(function (_ref3, idx) {
117
+ var text = _ref3.text,
118
+ key = _ref3.key,
119
+ rest = (0, _objectWithoutProperties2.default)(_ref3, _excluded);
120
+ return (0, _react2.jsx)(_dialog.DialogActionItem, {
121
+ key: key || (typeof text === 'string' ? text : "".concat(idx))
122
+ }, (0, _react2.jsx)(_customThemeButton.default, rest, text));
123
+ }))) : null)));
145
124
  });
146
125
  SpotlightCard.displayName = 'SpotlightCard';
147
126
  var _default = exports.default = SpotlightCard;
@@ -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() { 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; } }
29
29
  var packageName = "@atlaskit/onboarding";
30
- var packageVersion = "10.8.11";
30
+ var packageVersion = "11.0.0";
31
31
  var SpotlightDialog = /*#__PURE__*/function (_Component) {
32
32
  (0, _inherits2.default)(SpotlightDialog, _Component);
33
33
  var _super = _createSuper(SpotlightDialog);
@@ -8,15 +8,9 @@ exports.default = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _react = require("@emotion/react");
10
10
  var _colors = require("@atlaskit/theme/colors");
11
- var _components = require("@atlaskit/theme/components");
12
11
  var _constants = require("@atlaskit/theme/constants");
13
12
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
14
13
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /** @jsx jsx */
15
- var backgroundColor = (0, _components.themed)({
16
- light: "var(--ds-blanket, ".concat(_colors.N100A, ")"),
17
- dark: "var(--ds-blanket, ".concat(_colors.DN90A, ")")
18
- });
19
-
20
14
  // IE11 and Edge: z-index needed because fixed position calculates z-index relative
21
15
  // to body instead of nearest stacking context (Portal in our case).
22
16
  var blanketStyles = (0, _react.css)({
@@ -37,13 +31,10 @@ var blanketStyles = (0, _react.css)({
37
31
  * @internal
38
32
  */
39
33
  var Blanket = function Blanket(props) {
40
- var theme = (0, _components.useGlobalTheme)();
41
34
  return (0, _react.jsx)("div", {
42
35
  css: blanketStyles,
43
36
  style: _objectSpread(_objectSpread({}, props.style), {}, {
44
- backgroundColor: props.isTinted ? backgroundColor({
45
- theme: theme
46
- }) : 'transparent'
37
+ backgroundColor: props.isTinted ? "var(--ds-blanket, ".concat(_colors.N100A, ")") : 'transparent'
47
38
  })
48
39
  });
49
40
  };
@@ -5,37 +5,29 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.ModalImage = exports.ModalHeading = exports.ModalBody = exports.ModalActionItem = exports.ModalActionContainer = void 0;
7
7
  var _react = require("@emotion/react");
8
- var _components = require("@atlaskit/theme/components");
9
8
  var _typography = require("@atlaskit/theme/typography");
9
+ /* eslint-disable @atlaskit/design-system/no-nested-styles */
10
10
  /** @jsx jsx */
11
11
 
12
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
13
- var lightH600Styles = (0, _react.css)((0, _typography.h600)({
14
- theme: {
15
- mode: 'light'
16
- }
17
- }));
18
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
19
- var darkH600Styles = (0, _react.css)((0, _typography.h600)({
20
- theme: {
21
- mode: 'dark'
22
- }
23
- }));
24
12
  var modalBodyStyles = (0, _react.css)({
25
13
  padding: "var(--ds-space-500, 40px)".concat(" ", "var(--ds-space-250, 20px)"),
26
14
  textAlign: 'center'
27
15
  });
28
- var modalHeadingStyles = (0, _react.css)({
16
+
17
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
18
+ var modalHeadingStyles = (0, _react.css)([(0, _react.css)((0, _typography.h600)({
19
+ theme: {
20
+ mode: 'light'
21
+ }
22
+ })), {
29
23
  marginBottom: "var(--ds-space-100, 8px)",
30
24
  color: 'inherit'
31
- });
25
+ }]);
32
26
  var modalImageStyles = (0, _react.css)({
33
27
  width: '100%',
34
28
  height: 'auto',
35
- borderTopLeftRadius: "var(--ds-border-radius, 3px)",
36
- borderTopRightRadius: "var(--ds-border-radius, 3px)",
37
- // TODO: Use new breakpoints
38
- // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
29
+ borderStartEndRadius: "var(--ds-border-radius, 3px)",
30
+ borderStartStartRadius: "var(--ds-border-radius, 3px)",
39
31
  '@media (min-width: 320px) and (max-width: 480px)': {
40
32
  borderRadius: 0
41
33
  }
@@ -73,10 +65,8 @@ var ModalBody = exports.ModalBody = function ModalBody(_ref) {
73
65
  */
74
66
  var ModalHeading = exports.ModalHeading = function ModalHeading(_ref2) {
75
67
  var children = _ref2.children;
76
- var _useGlobalTheme = (0, _components.useGlobalTheme)(),
77
- mode = _useGlobalTheme.mode;
78
68
  return (0, _react.jsx)("h4", {
79
- css: [mode === 'light' ? lightH600Styles : darkH600Styles, modalHeadingStyles]
69
+ css: modalHeadingStyles
80
70
  }, children);
81
71
  };
82
72
 
@@ -4,7 +4,6 @@ import { css, jsx } from '@emotion/react';
4
4
  import Button, { Theme as ButtonTheme } from '@atlaskit/button/custom-theme-button';
5
5
  import Heading from '@atlaskit/heading';
6
6
  import { N0, N50A, N60A, P300 } from '@atlaskit/theme/colors';
7
- import { createTheme } from '@atlaskit/theme/components';
8
7
  import { layers } from '@atlaskit/theme/constants';
9
8
  import { DialogActionItem, DialogActionItemContainer } from '../styled/dialog';
10
9
  import { spotlightButtonTheme } from './theme';
@@ -18,9 +17,9 @@ const imageStyles = css({
18
17
  });
19
18
  const defaultHeaderStyles = css({
20
19
  display: 'flex',
21
- paddingBottom: "var(--ds-space-100, 8px)",
22
20
  alignItems: 'baseline',
23
- justifyContent: 'space-between'
21
+ justifyContent: 'space-between',
22
+ paddingBlockEnd: "var(--ds-space-100, 8px)"
24
23
  });
25
24
  const DefaultHeader = ({
26
25
  children
@@ -29,9 +28,9 @@ const DefaultHeader = ({
29
28
  }, children);
30
29
  const defaultFooterStyles = css({
31
30
  display: 'flex',
32
- paddingTop: "var(--ds-space-100, 8px)",
33
31
  alignItems: 'center',
34
- justifyContent: 'space-between'
32
+ justifyContent: 'space-between',
33
+ paddingBlockStart: "var(--ds-space-100, 8px)"
35
34
  });
36
35
  const DefaultFooter = ({
37
36
  children
@@ -49,18 +48,6 @@ const containerStyles = css({
49
48
  const containerShadowStyles = css({
50
49
  boxShadow: `var(--ds-shadow-raised, ${`0 4px 8px -2px ${N50A}, 0 0 1px ${N60A}`})`
51
50
  });
52
-
53
- /**
54
- * @deprecated
55
- */
56
- const Theme = createTheme(() => ({
57
- container: {}
58
- }));
59
-
60
- /**
61
- * @deprecated
62
- */
63
-
64
51
  /**
65
52
  * __Spotlight card__
66
53
  *
@@ -82,8 +69,8 @@ const SpotlightCard = /*#__PURE__*/forwardRef((props, ref) => {
82
69
  innerRef,
83
70
  isFlat,
84
71
  testId,
85
- theme,
86
- width = 400
72
+ width = 400,
73
+ headingId
87
74
  } = props;
88
75
  const {
89
76
  Header = DefaultHeader,
@@ -91,42 +78,35 @@ const SpotlightCard = /*#__PURE__*/forwardRef((props, ref) => {
91
78
  } = components;
92
79
  return jsx(ButtonTheme.Provider, {
93
80
  value: spotlightButtonTheme
94
- }, jsx(Theme.Provider, {
95
- value: theme
96
- }, jsx(Theme.Consumer, null, ({
97
- container
98
- }) => {
99
- return jsx("div", {
100
- css: [containerStyles, !isFlat && containerShadowStyles,
101
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
102
- container],
103
- style: {
104
- minWidth: '160px',
105
- maxWidth: '600px',
106
- width: typeof width === 'string' ? width : `${width}px`
107
- },
108
- ref: ref || innerRef,
109
- "data-testid": testId
110
- }, typeof image === 'string' ? jsx("img", {
111
- css: imageStyles,
112
- src: image,
113
- alt: ""
114
- }) : image, jsx("div", {
115
- css: bodyStyles
116
- }, heading || headingAfterElement ? jsx(Header, null, jsx(Heading, {
117
- color: "inverse",
118
- level: "h600",
119
- as: "h4"
120
- }, heading), headingAfterElement) : null, children, actions.length > 0 || actionsBeforeElement ? jsx(Footer, null, actionsBeforeElement || jsx("span", null), jsx(DialogActionItemContainer, null, actions.map(({
121
- text,
122
- key,
123
- ...rest
124
- }, idx) => {
125
- return jsx(DialogActionItem, {
126
- key: key || (typeof text === 'string' ? text : `${idx}`)
127
- }, jsx(Button, rest, text));
128
- }))) : null));
129
- })));
81
+ }, jsx("div", {
82
+ css: [containerStyles, !isFlat && containerShadowStyles],
83
+ style: {
84
+ minWidth: '160px',
85
+ maxWidth: '600px',
86
+ width: typeof width === 'string' ? width : `${width}px`
87
+ },
88
+ ref: ref || innerRef,
89
+ "data-testid": testId
90
+ }, typeof image === 'string' ? jsx("img", {
91
+ css: imageStyles,
92
+ src: image,
93
+ alt: ""
94
+ }) : image, jsx("div", {
95
+ css: bodyStyles
96
+ }, heading || headingAfterElement ? jsx(Header, null, jsx(Heading, {
97
+ id: headingId,
98
+ color: "inverse",
99
+ level: "h600",
100
+ as: "h4"
101
+ }, heading), headingAfterElement) : null, children, actions.length > 0 || actionsBeforeElement ? jsx(Footer, null, actionsBeforeElement || jsx("span", null), jsx(DialogActionItemContainer, null, actions.map(({
102
+ text,
103
+ key,
104
+ ...rest
105
+ }, idx) => {
106
+ return jsx(DialogActionItem, {
107
+ key: key || (typeof text === 'string' ? text : `${idx}`)
108
+ }, jsx(Button, rest, text));
109
+ }))) : null)));
130
110
  });
131
111
  SpotlightCard.displayName = 'SpotlightCard';
132
112
  export default SpotlightCard;
@@ -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 = "10.8.11";
10
+ const packageVersion = "11.0.0";
11
11
  class SpotlightDialog extends Component {
12
12
  constructor(...args) {
13
13
  super(...args);
@@ -1,13 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { css, jsx } from '@emotion/react';
3
- import { DN90A, N100A } from '@atlaskit/theme/colors';
4
- import { themed, useGlobalTheme } from '@atlaskit/theme/components';
3
+ import { N100A } from '@atlaskit/theme/colors';
5
4
  import { layers } from '@atlaskit/theme/constants';
6
- const backgroundColor = themed({
7
- light: `var(--ds-blanket, ${N100A})`,
8
- dark: `var(--ds-blanket, ${DN90A})`
9
- });
10
-
11
5
  // IE11 and Edge: z-index needed because fixed position calculates z-index relative
12
6
  // to body instead of nearest stacking context (Portal in our case).
13
7
  const blanketStyles = css({
@@ -28,14 +22,11 @@ const blanketStyles = css({
28
22
  * @internal
29
23
  */
30
24
  const Blanket = props => {
31
- const theme = useGlobalTheme();
32
25
  return jsx("div", {
33
26
  css: blanketStyles,
34
27
  style: {
35
28
  ...props.style,
36
- backgroundColor: props.isTinted ? backgroundColor({
37
- theme
38
- }) : 'transparent'
29
+ backgroundColor: props.isTinted ? `var(--ds-blanket, ${N100A})` : 'transparent'
39
30
  }
40
31
  });
41
32
  };
@@ -1,35 +1,27 @@
1
+ /* eslint-disable @atlaskit/design-system/no-nested-styles */
1
2
  /** @jsx jsx */
2
3
 
3
4
  import { css, jsx } from '@emotion/react';
4
- import { useGlobalTheme } from '@atlaskit/theme/components';
5
5
  import { h600 } from '@atlaskit/theme/typography';
6
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
7
- const lightH600Styles = css(h600({
8
- theme: {
9
- mode: 'light'
10
- }
11
- }));
12
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
13
- const darkH600Styles = css(h600({
14
- theme: {
15
- mode: 'dark'
16
- }
17
- }));
18
6
  const modalBodyStyles = css({
19
7
  padding: `${"var(--ds-space-500, 40px)"} ${"var(--ds-space-250, 20px)"}`,
20
8
  textAlign: 'center'
21
9
  });
22
- const modalHeadingStyles = css({
10
+
11
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
12
+ const modalHeadingStyles = css([css(h600({
13
+ theme: {
14
+ mode: 'light'
15
+ }
16
+ })), {
23
17
  marginBottom: "var(--ds-space-100, 8px)",
24
18
  color: 'inherit'
25
- });
19
+ }]);
26
20
  const modalImageStyles = css({
27
21
  width: '100%',
28
22
  height: 'auto',
29
- borderTopLeftRadius: "var(--ds-border-radius, 3px)",
30
- borderTopRightRadius: "var(--ds-border-radius, 3px)",
31
- // TODO: Use new breakpoints
32
- // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
23
+ borderStartEndRadius: "var(--ds-border-radius, 3px)",
24
+ borderStartStartRadius: "var(--ds-border-radius, 3px)",
33
25
  '@media (min-width: 320px) and (max-width: 480px)': {
34
26
  borderRadius: 0
35
27
  }
@@ -67,11 +59,8 @@ export const ModalBody = ({
67
59
  export const ModalHeading = ({
68
60
  children
69
61
  }) => {
70
- const {
71
- mode
72
- } = useGlobalTheme();
73
62
  return jsx("h4", {
74
- css: [mode === 'light' ? lightH600Styles : darkH600Styles, modalHeadingStyles]
63
+ css: modalHeadingStyles
75
64
  }, children);
76
65
  };
77
66
 
@@ -6,7 +6,6 @@ import { css, jsx } from '@emotion/react';
6
6
  import Button, { Theme as ButtonTheme } from '@atlaskit/button/custom-theme-button';
7
7
  import Heading from '@atlaskit/heading';
8
8
  import { N0, N50A, N60A, P300 } from '@atlaskit/theme/colors';
9
- import { createTheme } from '@atlaskit/theme/components';
10
9
  import { layers } from '@atlaskit/theme/constants';
11
10
  import { DialogActionItem, DialogActionItemContainer } from '../styled/dialog';
12
11
  import { spotlightButtonTheme } from './theme';
@@ -20,9 +19,9 @@ var imageStyles = css({
20
19
  });
21
20
  var defaultHeaderStyles = css({
22
21
  display: 'flex',
23
- paddingBottom: "var(--ds-space-100, 8px)",
24
22
  alignItems: 'baseline',
25
- justifyContent: 'space-between'
23
+ justifyContent: 'space-between',
24
+ paddingBlockEnd: "var(--ds-space-100, 8px)"
26
25
  });
27
26
  var DefaultHeader = function DefaultHeader(_ref) {
28
27
  var children = _ref.children;
@@ -32,9 +31,9 @@ var DefaultHeader = function DefaultHeader(_ref) {
32
31
  };
33
32
  var defaultFooterStyles = css({
34
33
  display: 'flex',
35
- paddingTop: "var(--ds-space-100, 8px)",
36
34
  alignItems: 'center',
37
- justifyContent: 'space-between'
35
+ justifyContent: 'space-between',
36
+ paddingBlockStart: "var(--ds-space-100, 8px)"
38
37
  });
39
38
  var DefaultFooter = function DefaultFooter(_ref2) {
40
39
  var children = _ref2.children;
@@ -53,20 +52,6 @@ var containerStyles = css({
53
52
  var containerShadowStyles = css({
54
53
  boxShadow: "var(--ds-shadow-raised, ".concat("0 4px 8px -2px ".concat(N50A, ", 0 0 1px ").concat(N60A), ")")
55
54
  });
56
-
57
- /**
58
- * @deprecated
59
- */
60
- var Theme = createTheme(function () {
61
- return {
62
- container: {}
63
- };
64
- });
65
-
66
- /**
67
- * @deprecated
68
- */
69
-
70
55
  /**
71
56
  * __Spotlight card__
72
57
  *
@@ -89,49 +74,43 @@ var SpotlightCard = /*#__PURE__*/forwardRef(function (props, ref) {
89
74
  innerRef = props.innerRef,
90
75
  isFlat = props.isFlat,
91
76
  testId = props.testId,
92
- theme = props.theme,
93
77
  _props$width = props.width,
94
- width = _props$width === void 0 ? 400 : _props$width;
78
+ width = _props$width === void 0 ? 400 : _props$width,
79
+ headingId = props.headingId;
95
80
  var _components$Header = components.Header,
96
81
  Header = _components$Header === void 0 ? DefaultHeader : _components$Header,
97
82
  _components$Footer = components.Footer,
98
83
  Footer = _components$Footer === void 0 ? DefaultFooter : _components$Footer;
99
84
  return jsx(ButtonTheme.Provider, {
100
85
  value: spotlightButtonTheme
101
- }, jsx(Theme.Provider, {
102
- value: theme
103
- }, jsx(Theme.Consumer, null, function (_ref3) {
104
- var container = _ref3.container;
105
- return jsx("div", {
106
- css: [containerStyles, !isFlat && containerShadowStyles,
107
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
108
- container],
109
- style: {
110
- minWidth: '160px',
111
- maxWidth: '600px',
112
- width: typeof width === 'string' ? width : "".concat(width, "px")
113
- },
114
- ref: ref || innerRef,
115
- "data-testid": testId
116
- }, typeof image === 'string' ? jsx("img", {
117
- css: imageStyles,
118
- src: image,
119
- alt: ""
120
- }) : image, jsx("div", {
121
- css: bodyStyles
122
- }, heading || headingAfterElement ? jsx(Header, null, jsx(Heading, {
123
- color: "inverse",
124
- level: "h600",
125
- as: "h4"
126
- }, heading), headingAfterElement) : null, children, actions.length > 0 || actionsBeforeElement ? jsx(Footer, null, actionsBeforeElement || jsx("span", null), jsx(DialogActionItemContainer, null, actions.map(function (_ref4, idx) {
127
- var text = _ref4.text,
128
- key = _ref4.key,
129
- rest = _objectWithoutProperties(_ref4, _excluded);
130
- return jsx(DialogActionItem, {
131
- key: key || (typeof text === 'string' ? text : "".concat(idx))
132
- }, jsx(Button, rest, text));
133
- }))) : null));
134
- })));
86
+ }, jsx("div", {
87
+ css: [containerStyles, !isFlat && containerShadowStyles],
88
+ style: {
89
+ minWidth: '160px',
90
+ maxWidth: '600px',
91
+ width: typeof width === 'string' ? width : "".concat(width, "px")
92
+ },
93
+ ref: ref || innerRef,
94
+ "data-testid": testId
95
+ }, typeof image === 'string' ? jsx("img", {
96
+ css: imageStyles,
97
+ src: image,
98
+ alt: ""
99
+ }) : image, jsx("div", {
100
+ css: bodyStyles
101
+ }, heading || headingAfterElement ? jsx(Header, null, jsx(Heading, {
102
+ id: headingId,
103
+ color: "inverse",
104
+ level: "h600",
105
+ as: "h4"
106
+ }, heading), headingAfterElement) : null, children, actions.length > 0 || actionsBeforeElement ? jsx(Footer, null, actionsBeforeElement || jsx("span", null), jsx(DialogActionItemContainer, null, actions.map(function (_ref3, idx) {
107
+ var text = _ref3.text,
108
+ key = _ref3.key,
109
+ rest = _objectWithoutProperties(_ref3, _excluded);
110
+ return jsx(DialogActionItem, {
111
+ key: key || (typeof text === 'string' ? text : "".concat(idx))
112
+ }, jsx(Button, rest, text));
113
+ }))) : null)));
135
114
  });
136
115
  SpotlightCard.displayName = 'SpotlightCard';
137
116
  export default SpotlightCard;
@@ -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 = "10.8.11";
20
+ var packageVersion = "11.0.0";
21
21
  var SpotlightDialog = /*#__PURE__*/function (_Component) {
22
22
  _inherits(SpotlightDialog, _Component);
23
23
  var _super = _createSuper(SpotlightDialog);
@@ -3,14 +3,8 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
4
  /** @jsx jsx */
5
5
  import { css, jsx } from '@emotion/react';
6
- import { DN90A, N100A } from '@atlaskit/theme/colors';
7
- import { themed, useGlobalTheme } from '@atlaskit/theme/components';
6
+ import { N100A } from '@atlaskit/theme/colors';
8
7
  import { layers } from '@atlaskit/theme/constants';
9
- var backgroundColor = themed({
10
- light: "var(--ds-blanket, ".concat(N100A, ")"),
11
- dark: "var(--ds-blanket, ".concat(DN90A, ")")
12
- });
13
-
14
8
  // IE11 and Edge: z-index needed because fixed position calculates z-index relative
15
9
  // to body instead of nearest stacking context (Portal in our case).
16
10
  var blanketStyles = css({
@@ -31,13 +25,10 @@ var blanketStyles = css({
31
25
  * @internal
32
26
  */
33
27
  var Blanket = function Blanket(props) {
34
- var theme = useGlobalTheme();
35
28
  return jsx("div", {
36
29
  css: blanketStyles,
37
30
  style: _objectSpread(_objectSpread({}, props.style), {}, {
38
- backgroundColor: props.isTinted ? backgroundColor({
39
- theme: theme
40
- }) : 'transparent'
31
+ backgroundColor: props.isTinted ? "var(--ds-blanket, ".concat(N100A, ")") : 'transparent'
41
32
  })
42
33
  });
43
34
  };
@@ -1,35 +1,27 @@
1
+ /* eslint-disable @atlaskit/design-system/no-nested-styles */
1
2
  /** @jsx jsx */
2
3
 
3
4
  import { css, jsx } from '@emotion/react';
4
- import { useGlobalTheme } from '@atlaskit/theme/components';
5
5
  import { h600 } from '@atlaskit/theme/typography';
6
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
7
- var lightH600Styles = css(h600({
8
- theme: {
9
- mode: 'light'
10
- }
11
- }));
12
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
13
- var darkH600Styles = css(h600({
14
- theme: {
15
- mode: 'dark'
16
- }
17
- }));
18
6
  var modalBodyStyles = css({
19
7
  padding: "var(--ds-space-500, 40px)".concat(" ", "var(--ds-space-250, 20px)"),
20
8
  textAlign: 'center'
21
9
  });
22
- var modalHeadingStyles = css({
10
+
11
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
12
+ var modalHeadingStyles = css([css(h600({
13
+ theme: {
14
+ mode: 'light'
15
+ }
16
+ })), {
23
17
  marginBottom: "var(--ds-space-100, 8px)",
24
18
  color: 'inherit'
25
- });
19
+ }]);
26
20
  var modalImageStyles = css({
27
21
  width: '100%',
28
22
  height: 'auto',
29
- borderTopLeftRadius: "var(--ds-border-radius, 3px)",
30
- borderTopRightRadius: "var(--ds-border-radius, 3px)",
31
- // TODO: Use new breakpoints
32
- // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
23
+ borderStartEndRadius: "var(--ds-border-radius, 3px)",
24
+ borderStartStartRadius: "var(--ds-border-radius, 3px)",
33
25
  '@media (min-width: 320px) and (max-width: 480px)': {
34
26
  borderRadius: 0
35
27
  }
@@ -67,10 +59,8 @@ export var ModalBody = function ModalBody(_ref) {
67
59
  */
68
60
  export var ModalHeading = function ModalHeading(_ref2) {
69
61
  var children = _ref2.children;
70
- var _useGlobalTheme = useGlobalTheme(),
71
- mode = _useGlobalTheme.mode;
72
62
  return jsx("h4", {
73
- css: [mode === 'light' ? lightH600Styles : darkH600Styles, modalHeadingStyles]
63
+ css: modalHeadingStyles
74
64
  }, children);
75
65
  };
76
66
 
@@ -1,16 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import { ComponentType, ReactNode, Ref } from 'react';
3
- import { ThemeProp } from '@atlaskit/theme/components';
4
3
  import { Actions } from '../types';
5
- /**
6
- * @deprecated
7
- */
8
- interface CardTokens {
9
- /**
10
- * @deprecated
11
- */
12
- container: Record<string, string | undefined>;
13
- }
14
4
  interface SpotlightCardProps {
15
5
  /**
16
6
  * Buttons to render in the footer
@@ -47,11 +37,6 @@ interface SpotlightCardProps {
47
37
  * Removes elevation styles if set
48
38
  */
49
39
  isFlat?: boolean;
50
- /**
51
- * @deprecated
52
- * Theme prop is deprecated and will be removed in the future.
53
- */
54
- theme?: ThemeProp<CardTokens, {}>;
55
40
  /**
56
41
  * Specifies the width of the card component. Accepts either a number or the string '100%'.
57
42
  * When a number is provided, the width is set in pixels. When '100%' is provided, the width
@@ -70,6 +55,10 @@ interface SpotlightCardProps {
70
55
  * serving as a hook for automated tests.
71
56
  */
72
57
  testId?: string;
58
+ /**
59
+ * The id of heading
60
+ */
61
+ headingId?: string;
73
62
  }
74
63
  /**
75
64
  * __Spotlight card__
@@ -1,16 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import { ComponentType, ReactNode, Ref } from 'react';
3
- import { ThemeProp } from '@atlaskit/theme/components';
4
3
  import { Actions } from '../types';
5
- /**
6
- * @deprecated
7
- */
8
- interface CardTokens {
9
- /**
10
- * @deprecated
11
- */
12
- container: Record<string, string | undefined>;
13
- }
14
4
  interface SpotlightCardProps {
15
5
  /**
16
6
  * Buttons to render in the footer
@@ -47,11 +37,6 @@ interface SpotlightCardProps {
47
37
  * Removes elevation styles if set
48
38
  */
49
39
  isFlat?: boolean;
50
- /**
51
- * @deprecated
52
- * Theme prop is deprecated and will be removed in the future.
53
- */
54
- theme?: ThemeProp<CardTokens, {}>;
55
40
  /**
56
41
  * Specifies the width of the card component. Accepts either a number or the string '100%'.
57
42
  * When a number is provided, the width is set in pixels. When '100%' is provided, the width
@@ -70,6 +55,10 @@ interface SpotlightCardProps {
70
55
  * serving as a hook for automated tests.
71
56
  */
72
57
  testId?: string;
58
+ /**
59
+ * The id of heading
60
+ */
61
+ headingId?: string;
73
62
  }
74
63
  /**
75
64
  * __Spotlight card__
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/onboarding",
3
- "version": "10.8.11",
3
+ "version": "11.0.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/"
@@ -34,14 +34,14 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@atlaskit/analytics-next": "^9.1.0",
37
- "@atlaskit/button": "^16.10.0",
37
+ "@atlaskit/button": "^16.17.0",
38
38
  "@atlaskit/ds-lib": "^2.2.0",
39
39
  "@atlaskit/heading": "^1.4.0",
40
- "@atlaskit/modal-dialog": "^12.8.0",
40
+ "@atlaskit/modal-dialog": "^12.9.0",
41
41
  "@atlaskit/popper": "^5.5.0",
42
- "@atlaskit/portal": "^4.3.0",
42
+ "@atlaskit/portal": "^4.4.0",
43
43
  "@atlaskit/theme": "^12.6.0",
44
- "@atlaskit/tokens": "^1.28.0",
44
+ "@atlaskit/tokens": "^1.29.0",
45
45
  "@babel/runtime": "^7.0.0",
46
46
  "@emotion/react": "^11.7.1",
47
47
  "bind-event-listener": "^2.1.1",
@@ -67,6 +67,7 @@
67
67
  "@testing-library/react-hooks": "^8.0.1",
68
68
  "@types/exenv": "^1.2.0",
69
69
  "@types/react-node-resolver": "^2.0.0",
70
+ "@types/react-transition-group": "^2.0.6",
70
71
  "raf-stub": "^2.0.1",
71
72
  "react-dom": "^16.8.0",
72
73
  "react-lorem-component": "^0.13.0",
package/report.api.md CHANGED
@@ -124,6 +124,7 @@ interface SpotlightCardProps {
124
124
  };
125
125
  heading?: ReactNode;
126
126
  headingAfterElement?: ReactNode;
127
+ headingId?: string;
127
128
  image?: ReactNode | string;
128
129
  // @deprecated (undocumented)
129
130
  innerRef?: Ref<HTMLDivElement> | null;
@@ -1,226 +0,0 @@
1
- ## API Report File for "@atlaskit/onboarding"
2
-
3
- > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
-
5
- ```ts
6
-
7
- import { Component } from 'react';
8
- import { ComponentType } from 'react';
9
- import { CustomThemeButtonProps } from '@atlaskit/button/types';
10
- import { ElementType } from 'react';
11
- import { ForwardRefExoticComponent } from 'react';
12
- import { jsx } from '@emotion/react';
13
- import { MemoizedFn } from 'memoize-one';
14
- import { ModalFooterProps } from '@atlaskit/modal-dialog';
15
- import { ModalHeaderProps } from '@atlaskit/modal-dialog';
16
- import { default as ModalTransition } from '@atlaskit/modal-dialog/modal-transition';
17
- import { MouseEvent as MouseEvent_2 } from 'react';
18
- import { PureComponent } from 'react';
19
- import { default as React_2 } from 'react';
20
- import { ReactNode } from 'react';
21
- import { Ref } from 'react';
22
- import { RefAttributes } from 'react';
23
- import { ThemeProp } from '@atlaskit/theme/components';
24
-
25
- // @public (undocumented)
26
- interface Action extends Omit<CustomThemeButtonProps, 'children'> {
27
- // (undocumented)
28
- key?: string;
29
- // (undocumented)
30
- text?: ReactNode;
31
- }
32
-
33
- // @public (undocumented)
34
- type Actions = Action[];
35
-
36
- // @public (undocumented)
37
- type BaseProps = React.HTMLAttributes<HTMLDivElement> & {
38
- bgColor?: string;
39
- radius?: number;
40
- className?: string;
41
- testId?: string;
42
- children?: ReactNode;
43
- };
44
-
45
- // @public @deprecated (undocumented)
46
- interface CardTokens {
47
- // @deprecated (undocumented)
48
- container: Record<string, string | undefined>;
49
- }
50
-
51
- // @public
52
- export class Modal extends Component<ModalProps> {
53
- // (undocumented)
54
- footerComponent: (props: ModalProps) => (() => jsx.JSX.Element | null) | ElementType<ModalFooterProps>;
55
- // (undocumented)
56
- headerComponent: (props: ModalProps) => (() => jsx.JSX.Element) | ElementType<ModalHeaderProps>;
57
- // (undocumented)
58
- render(): jsx.JSX.Element;
59
- }
60
-
61
- // @public @deprecated (undocumented)
62
- export const modalButtonTheme: (current: any, themeProps: Record<string, any>) => any;
63
-
64
- // @public (undocumented)
65
- type ModalProps = {
66
- actions?: Actions;
67
- children: ReactNode;
68
- image?: string;
69
- header?: ElementType<ModalHeaderProps>;
70
- footer?: ElementType<ModalFooterProps>;
71
- heading?: string;
72
- experimental_shouldShowPrimaryButtonOnRight?: boolean;
73
- };
74
-
75
- export { ModalTransition }
76
-
77
- // @public
78
- export const Spotlight: ({ dialogWidth, pulse, testId, targetNode, target, ...rest }: SpotlightProps) => JSX.Element;
79
-
80
- // @public @deprecated (undocumented)
81
- export const spotlightButtonTheme: (current: any, themeProps: Record<string, any>) => any;
82
-
83
- // @public
84
- export const SpotlightCard: ForwardRefExoticComponent<SpotlightCardProps & RefAttributes<HTMLDivElement>>;
85
-
86
- // @public (undocumented)
87
- interface SpotlightCardProps {
88
- actions?: Actions;
89
- actionsBeforeElement?: ReactNode;
90
- children?: ReactNode;
91
- components?: {
92
- Header?: ComponentType<any>;
93
- Footer?: ComponentType<any>;
94
- };
95
- heading?: ReactNode;
96
- headingAfterElement?: ReactNode;
97
- image?: ReactNode | string;
98
- // @deprecated (undocumented)
99
- innerRef?: Ref<HTMLDivElement> | null;
100
- isFlat?: boolean;
101
- testId?: string;
102
- // @deprecated (undocumented)
103
- theme?: ThemeProp<CardTokens, {}>;
104
- width?: '100%' | number;
105
- }
106
-
107
- // @public
108
- export class SpotlightManager extends PureComponent<SpotlightManagerProps, {
109
- spotlightCount: number;
110
- targets: {
111
- [key: string]: HTMLElement | void;
112
- };
113
- }> {
114
- // (undocumented)
115
- componentDidMount(): void;
116
- // (undocumented)
117
- static defaultProps: {
118
- blanketIsTinted: boolean;
119
- };
120
- // (undocumented)
121
- getStateProviderValue: MemoizedFn<(this: any, targets: any) => {
122
- opened: () => void;
123
- closed: () => void;
124
- targets: any;
125
- }>;
126
- // (undocumented)
127
- render(): JSX.Element;
128
- // (undocumented)
129
- spotlightClose: () => void;
130
- // (undocumented)
131
- spotlightOpen: () => void;
132
- // (undocumented)
133
- state: {
134
- spotlightCount: number;
135
- targets: {};
136
- };
137
- // (undocumented)
138
- targetRef: (name: string) => (element: HTMLElement | void) => void;
139
- }
140
-
141
- // @public (undocumented)
142
- interface SpotlightManagerProps {
143
- blanketIsTinted?: boolean;
144
- children: ReactNode;
145
- // @deprecated (undocumented)
146
- component?: ElementType;
147
- }
148
-
149
- // @public (undocumented)
150
- interface SpotlightProps {
151
- actions?: Actions;
152
- actionsBeforeElement?: ReactNode;
153
- children?: ReactNode;
154
- dialogPlacement?: 'bottom center' | 'bottom left' | 'bottom right' | 'left bottom' | 'left middle' | 'left top' | 'right bottom' | 'right middle' | 'right top' | 'top center' | 'top left' | 'top right';
155
- dialogWidth?: number;
156
- footer?: ComponentType<any>;
157
- header?: ComponentType<any>;
158
- heading?: string;
159
- headingAfterElement?: ReactNode;
160
- image?: string;
161
- pulse?: boolean;
162
- target?: string;
163
- targetBgColor?: string;
164
- targetNode?: HTMLElement;
165
- targetOnClick?: (eventData: {
166
- event: MouseEvent_2<HTMLElement>;
167
- target?: string;
168
- }) => void;
169
- targetRadius?: number;
170
- targetReplacement?: ComponentType<any>;
171
- testId?: string;
172
- }
173
-
174
- // @public
175
- export const SpotlightPulse: ({ children, pulse, testId, ...props }: TargetProps) => jsx.JSX.Element;
176
-
177
- // @public
178
- export const SpotlightTarget: ({ children, name }: SpotlightTargetProps) => JSX.Element;
179
-
180
- // @public (undocumented)
181
- interface SpotlightTargetProps {
182
- children: ReactNode;
183
- name: string;
184
- }
185
-
186
- // @public
187
- export class SpotlightTransition extends React_2.Component<SpotlightTransitionProps, State> {
188
- // (undocumented)
189
- static getDerivedStateFromProps(props: SpotlightTransitionProps, state: State): {
190
- currentChildren: React_2.ReactNode;
191
- };
192
- // (undocumented)
193
- onExited: () => void;
194
- // (undocumented)
195
- render(): JSX.Element;
196
- // (undocumented)
197
- state: {
198
- currentChildren: undefined;
199
- };
200
- }
201
-
202
- // @public (undocumented)
203
- interface SpotlightTransitionProps {
204
- children?: ReactNode;
205
- }
206
-
207
- // @public (undocumented)
208
- interface State {
209
- // (undocumented)
210
- currentChildren: ReactNode;
211
- }
212
-
213
- // @public (undocumented)
214
- type TargetProps = Omit<BaseProps, 'css'> & {
215
- pulse?: boolean;
216
- testId?: string;
217
- };
218
-
219
- // @public
220
- export function useSpotlight(): {
221
- isTargetRendered: (target: string) => boolean;
222
- };
223
-
224
- // (No @packageDocumentation comment for this package)
225
-
226
- ```