@atlaskit/onboarding 10.8.12 → 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,10 +1,16 @@
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
+
3
9
  ## 10.8.12
4
10
 
5
11
  ### Patch Changes
6
12
 
7
- - [#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
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
8
14
 
9
15
  ## 10.8.11
10
16
 
@@ -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");
@@ -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,7 +84,6 @@ 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
88
  width = _props$width === void 0 ? 400 : _props$width,
105
89
  headingId = props.headingId;
@@ -109,41 +93,34 @@ var SpotlightCard = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
109
93
  Footer = _components$Footer === void 0 ? DefaultFooter : _components$Footer;
110
94
  return (0, _react2.jsx)(_customThemeButton.Theme.Provider, {
111
95
  value: _theme.spotlightButtonTheme
112
- }, (0, _react2.jsx)(Theme.Provider, {
113
- value: theme
114
- }, (0, _react2.jsx)(Theme.Consumer, null, function (_ref3) {
115
- var container = _ref3.container;
116
- return (0, _react2.jsx)("div", {
117
- css: [containerStyles, !isFlat && containerShadowStyles,
118
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
119
- container],
120
- style: {
121
- minWidth: '160px',
122
- maxWidth: '600px',
123
- width: typeof width === 'string' ? width : "".concat(width, "px")
124
- },
125
- ref: ref || innerRef,
126
- "data-testid": testId
127
- }, typeof image === 'string' ? (0, _react2.jsx)("img", {
128
- css: imageStyles,
129
- src: image,
130
- alt: ""
131
- }) : image, (0, _react2.jsx)("div", {
132
- css: bodyStyles
133
- }, heading || headingAfterElement ? (0, _react2.jsx)(Header, null, (0, _react2.jsx)(_heading.default, {
134
- id: headingId,
135
- color: "inverse",
136
- level: "h600",
137
- as: "h4"
138
- }, 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) {
139
- var text = _ref4.text,
140
- key = _ref4.key,
141
- rest = (0, _objectWithoutProperties2.default)(_ref4, _excluded);
142
- return (0, _react2.jsx)(_dialog.DialogActionItem, {
143
- key: key || (typeof text === 'string' ? text : "".concat(idx))
144
- }, (0, _react2.jsx)(_customThemeButton.default, rest, text));
145
- }))) : null));
146
- })));
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)));
147
124
  });
148
125
  SpotlightCard.displayName = 'SpotlightCard';
149
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.12";
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';
@@ -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,7 +69,6 @@ const SpotlightCard = /*#__PURE__*/forwardRef((props, ref) => {
82
69
  innerRef,
83
70
  isFlat,
84
71
  testId,
85
- theme,
86
72
  width = 400,
87
73
  headingId
88
74
  } = props;
@@ -92,43 +78,35 @@ const SpotlightCard = /*#__PURE__*/forwardRef((props, ref) => {
92
78
  } = components;
93
79
  return jsx(ButtonTheme.Provider, {
94
80
  value: spotlightButtonTheme
95
- }, jsx(Theme.Provider, {
96
- value: theme
97
- }, jsx(Theme.Consumer, null, ({
98
- container
99
- }) => {
100
- return jsx("div", {
101
- css: [containerStyles, !isFlat && containerShadowStyles,
102
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
103
- container],
104
- style: {
105
- minWidth: '160px',
106
- maxWidth: '600px',
107
- width: typeof width === 'string' ? width : `${width}px`
108
- },
109
- ref: ref || innerRef,
110
- "data-testid": testId
111
- }, typeof image === 'string' ? jsx("img", {
112
- css: imageStyles,
113
- src: image,
114
- alt: ""
115
- }) : image, jsx("div", {
116
- css: bodyStyles
117
- }, heading || headingAfterElement ? jsx(Header, null, jsx(Heading, {
118
- id: headingId,
119
- color: "inverse",
120
- level: "h600",
121
- as: "h4"
122
- }, heading), headingAfterElement) : null, children, actions.length > 0 || actionsBeforeElement ? jsx(Footer, null, actionsBeforeElement || jsx("span", null), jsx(DialogActionItemContainer, null, actions.map(({
123
- text,
124
- key,
125
- ...rest
126
- }, idx) => {
127
- return jsx(DialogActionItem, {
128
- key: key || (typeof text === 'string' ? text : `${idx}`)
129
- }, jsx(Button, rest, text));
130
- }))) : null));
131
- })));
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)));
132
110
  });
133
111
  SpotlightCard.displayName = 'SpotlightCard';
134
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.12";
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';
@@ -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,7 +74,6 @@ 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
78
  width = _props$width === void 0 ? 400 : _props$width,
95
79
  headingId = props.headingId;
@@ -99,41 +83,34 @@ var SpotlightCard = /*#__PURE__*/forwardRef(function (props, ref) {
99
83
  Footer = _components$Footer === void 0 ? DefaultFooter : _components$Footer;
100
84
  return jsx(ButtonTheme.Provider, {
101
85
  value: spotlightButtonTheme
102
- }, jsx(Theme.Provider, {
103
- value: theme
104
- }, jsx(Theme.Consumer, null, function (_ref3) {
105
- var container = _ref3.container;
106
- return jsx("div", {
107
- css: [containerStyles, !isFlat && containerShadowStyles,
108
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
109
- container],
110
- style: {
111
- minWidth: '160px',
112
- maxWidth: '600px',
113
- width: typeof width === 'string' ? width : "".concat(width, "px")
114
- },
115
- ref: ref || innerRef,
116
- "data-testid": testId
117
- }, typeof image === 'string' ? jsx("img", {
118
- css: imageStyles,
119
- src: image,
120
- alt: ""
121
- }) : image, jsx("div", {
122
- css: bodyStyles
123
- }, heading || headingAfterElement ? jsx(Header, null, jsx(Heading, {
124
- id: headingId,
125
- color: "inverse",
126
- level: "h600",
127
- as: "h4"
128
- }, heading), headingAfterElement) : null, children, actions.length > 0 || actionsBeforeElement ? jsx(Footer, null, actionsBeforeElement || jsx("span", null), jsx(DialogActionItemContainer, null, actions.map(function (_ref4, idx) {
129
- var text = _ref4.text,
130
- key = _ref4.key,
131
- rest = _objectWithoutProperties(_ref4, _excluded);
132
- return jsx(DialogActionItem, {
133
- key: key || (typeof text === 'string' ? text : "".concat(idx))
134
- }, jsx(Button, rest, text));
135
- }))) : null));
136
- })));
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)));
137
114
  });
138
115
  SpotlightCard.displayName = 'SpotlightCard';
139
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.12";
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
@@ -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/onboarding",
3
- "version": "10.8.12",
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.15.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
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",
@@ -1,227 +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
- headingId?: string;
98
- image?: ReactNode | string;
99
- // @deprecated (undocumented)
100
- innerRef?: Ref<HTMLDivElement> | null;
101
- isFlat?: boolean;
102
- testId?: string;
103
- // @deprecated (undocumented)
104
- theme?: ThemeProp<CardTokens, {}>;
105
- width?: '100%' | number;
106
- }
107
-
108
- // @public
109
- export class SpotlightManager extends PureComponent<SpotlightManagerProps, {
110
- spotlightCount: number;
111
- targets: {
112
- [key: string]: HTMLElement | void;
113
- };
114
- }> {
115
- // (undocumented)
116
- componentDidMount(): void;
117
- // (undocumented)
118
- static defaultProps: {
119
- blanketIsTinted: boolean;
120
- };
121
- // (undocumented)
122
- getStateProviderValue: MemoizedFn<(this: any, targets: any) => {
123
- opened: () => void;
124
- closed: () => void;
125
- targets: any;
126
- }>;
127
- // (undocumented)
128
- render(): JSX.Element;
129
- // (undocumented)
130
- spotlightClose: () => void;
131
- // (undocumented)
132
- spotlightOpen: () => void;
133
- // (undocumented)
134
- state: {
135
- spotlightCount: number;
136
- targets: {};
137
- };
138
- // (undocumented)
139
- targetRef: (name: string) => (element: HTMLElement | void) => void;
140
- }
141
-
142
- // @public (undocumented)
143
- interface SpotlightManagerProps {
144
- blanketIsTinted?: boolean;
145
- children: ReactNode;
146
- // @deprecated (undocumented)
147
- component?: ElementType;
148
- }
149
-
150
- // @public (undocumented)
151
- interface SpotlightProps {
152
- actions?: Actions;
153
- actionsBeforeElement?: ReactNode;
154
- children?: ReactNode;
155
- 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';
156
- dialogWidth?: number;
157
- footer?: ComponentType<any>;
158
- header?: ComponentType<any>;
159
- heading?: string;
160
- headingAfterElement?: ReactNode;
161
- image?: string;
162
- pulse?: boolean;
163
- target?: string;
164
- targetBgColor?: string;
165
- targetNode?: HTMLElement;
166
- targetOnClick?: (eventData: {
167
- event: MouseEvent_2<HTMLElement>;
168
- target?: string;
169
- }) => void;
170
- targetRadius?: number;
171
- targetReplacement?: ComponentType<any>;
172
- testId?: string;
173
- }
174
-
175
- // @public
176
- export const SpotlightPulse: ({ children, pulse, testId, ...props }: TargetProps) => jsx.JSX.Element;
177
-
178
- // @public
179
- export const SpotlightTarget: ({ children, name }: SpotlightTargetProps) => JSX.Element;
180
-
181
- // @public (undocumented)
182
- interface SpotlightTargetProps {
183
- children: ReactNode;
184
- name: string;
185
- }
186
-
187
- // @public
188
- export class SpotlightTransition extends React_2.Component<SpotlightTransitionProps, State> {
189
- // (undocumented)
190
- static getDerivedStateFromProps(props: SpotlightTransitionProps, state: State): {
191
- currentChildren: React_2.ReactNode;
192
- };
193
- // (undocumented)
194
- onExited: () => void;
195
- // (undocumented)
196
- render(): JSX.Element;
197
- // (undocumented)
198
- state: {
199
- currentChildren: undefined;
200
- };
201
- }
202
-
203
- // @public (undocumented)
204
- interface SpotlightTransitionProps {
205
- children?: ReactNode;
206
- }
207
-
208
- // @public (undocumented)
209
- interface State {
210
- // (undocumented)
211
- currentChildren: ReactNode;
212
- }
213
-
214
- // @public (undocumented)
215
- type TargetProps = Omit<BaseProps, 'css'> & {
216
- pulse?: boolean;
217
- testId?: string;
218
- };
219
-
220
- // @public
221
- export function useSpotlight(): {
222
- isTargetRendered: (target: string) => boolean;
223
- };
224
-
225
- // (No @packageDocumentation comment for this package)
226
-
227
- ```