@atlaskit/onboarding 14.2.6 → 14.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,14 @@
1
1
  # @atlaskit/onboarding
2
2
 
3
+ ## 14.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#187608](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/187608)
8
+ [`b447e727a9968`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b447e727a9968) -
9
+ Cleans up the `platform_dst_onboarding_react_transition_group` feature gate. Animations are now
10
+ done using `@atlaskit/motion`, and `react-transition-group` has been removed.
11
+
3
12
  ## 14.2.6
4
13
 
5
14
  ### Patch Changes
@@ -20,8 +20,6 @@ var _dialog = require("../styled/dialog");
20
20
  var _spotlightCard = _interopRequireDefault(require("./spotlight-card"));
21
21
  var _valueChanged = _interopRequireDefault(require("./value-changed"));
22
22
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
23
- 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; }
24
- 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; }
25
23
  function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
26
24
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
27
25
  /**
@@ -71,7 +69,6 @@ var SpotlightDialogComponent = /*#__PURE__*/function (_Component) {
71
69
  var _this$props = this.props,
72
70
  actions = _this$props.actions,
73
71
  actionsBeforeElement = _this$props.actionsBeforeElement,
74
- animationStyles = _this$props.animationStyles,
75
72
  children = _this$props.children,
76
73
  dialogPlacement = _this$props.dialogPlacement,
77
74
  dialogWidth = _this$props.dialogWidth,
@@ -133,7 +130,7 @@ var SpotlightDialogComponent = /*#__PURE__*/function (_Component) {
133
130
  }, /*#__PURE__*/_react.default.createElement(_compiled.Box
134
131
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
135
132
  , {
136
- style: _objectSpread(_objectSpread({}, style), animationStyles),
133
+ style: style,
137
134
  ref: ref,
138
135
  "aria-modal": true,
139
136
  role: "dialog",
@@ -22,7 +22,6 @@ var _motion = require("@atlaskit/motion");
22
22
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
23
23
  var _portal = _interopRequireDefault(require("@atlaskit/portal"));
24
24
  var _useElementBox = require("../utils/use-element-box");
25
- var _animation = require("./animation");
26
25
  var _clone = _interopRequireDefault(require("./clone"));
27
26
  var _nodeResolverSpotlightInner = _interopRequireDefault(require("./node-resolver-spotlight-inner"));
28
27
  var _spotlightDialog = _interopRequireDefault(require("./spotlight-dialog"));
@@ -100,56 +99,24 @@ var SpotlightInner = /*#__PURE__*/function (_React$Component) {
100
99
  value: function componentWillUnmount() {
101
100
  this.props.onClosed();
102
101
  }
103
- }, {
104
- key: "renderSpotlightDialog",
105
- value:
106
- /**
107
- * Only exists to avoid duplication with the `platform_dst_onboarding_react_transition_group` flag.
108
- *
109
- * TODO: Make this inline in `render` when cleaning up `platform_dst_onboarding_react_transition_group`.
110
- */
111
- function renderSpotlightDialog(_ref) {
112
- var animationStyles = _ref.animationStyles;
113
- var _this$props = this.props,
114
- targetNode = _this$props.targetNode,
115
- testId = _this$props.testId;
116
- var replacementElement = this.state.replacementElement;
117
- return /*#__PURE__*/_react.default.createElement(_spotlightDialog.default, {
118
- testId: "".concat(testId, "--dialog"),
119
- actions: this.props.actions,
120
- actionsBeforeElement: this.props.actionsBeforeElement,
121
- children: this.props.children,
122
- dialogPlacement: this.props.dialogPlacement,
123
- dialogWidth: this.props.dialogWidth,
124
- footer: this.props.footer,
125
- header: this.props.header,
126
- heading: this.props.heading,
127
- titleId: this.props.titleId,
128
- label: this.props.label,
129
- headingAfterElement: this.props.headingAfterElement,
130
- image: this.props.image,
131
- targetNode: replacementElement || targetNode,
132
- animationStyles: animationStyles
133
- });
134
- }
135
102
  }, {
136
103
  key: "render",
137
104
  value: function render() {
138
105
  var _this2 = this;
139
- var _this$props2 = this.props,
140
- pulse = _this$props2.pulse,
141
- shouldWatchTarget = _this$props2.shouldWatchTarget,
142
- target = _this$props2.target,
143
- targetNode = _this$props2.targetNode,
144
- targetBgColor = _this$props2.targetBgColor,
145
- targetOnClick = _this$props2.targetOnClick,
146
- targetRadius = _this$props2.targetRadius,
147
- testId = _this$props2.testId,
148
- TargetReplacement = _this$props2.targetReplacement;
106
+ var _this$props = this.props,
107
+ pulse = _this$props.pulse,
108
+ shouldWatchTarget = _this$props.shouldWatchTarget,
109
+ target = _this$props.target,
110
+ targetNode = _this$props.targetNode,
111
+ targetBgColor = _this$props.targetBgColor,
112
+ targetOnClick = _this$props.targetOnClick,
113
+ targetRadius = _this$props.targetRadius,
114
+ testId = _this$props.testId,
115
+ TargetReplacement = _this$props.targetReplacement;
149
116
  var replacementElement = this.state.replacementElement;
150
- return /*#__PURE__*/_react.default.createElement(_spotlightTransition.SpotlightTransitionConsumer, null, function (_ref2) {
151
- var isOpen = _ref2.isOpen,
152
- onExited = _ref2.onExited;
117
+ return /*#__PURE__*/_react.default.createElement(_spotlightTransition.SpotlightTransitionConsumer, null, function (_ref) {
118
+ var isOpen = _ref.isOpen,
119
+ onExited = _ref.onExited;
153
120
  return /*#__PURE__*/_react.default.createElement(_portal.default, {
154
121
  zIndex: 701
155
122
  }, TargetReplacement ? /*#__PURE__*/_react.default.createElement(_nodeResolverSpotlightInner.default, {
@@ -185,17 +152,17 @@ var SpotlightInner = /*#__PURE__*/function (_React$Component) {
185
152
  });
186
153
  }), TargetReplacement && !replacementElement ? null : /*#__PURE__*/_react.default.createElement(_layering.Layering, {
187
154
  isDisabled: false
188
- }, (0, _platformFeatureFlags.fg)('platform_dst_onboarding_react_transition_group') ? /*#__PURE__*/_react.default.createElement(_motion.ExitingPersistence, {
155
+ }, /*#__PURE__*/_react.default.createElement(_motion.ExitingPersistence, {
189
156
  appear: true
190
157
  }, isOpen && /*#__PURE__*/_react.default.createElement(_motion.FadeIn, {
191
158
  onFinish: function onFinish(state) {
192
159
  state === 'exiting' && onExited();
193
160
  },
194
161
  duration: "medium"
195
- }, function (_ref3) {
196
- var ref = _ref3.ref,
197
- className = _ref3.className,
198
- style = _ref3.style;
162
+ }, function (_ref2) {
163
+ var ref = _ref2.ref,
164
+ className = _ref2.className,
165
+ style = _ref2.style;
199
166
  return /*#__PURE__*/_react.default.createElement("div", {
200
167
  ref: ref
201
168
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
@@ -204,17 +171,23 @@ var SpotlightInner = /*#__PURE__*/function (_React$Component) {
204
171
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
205
172
  ,
206
173
  style: style
207
- }, _this2.renderSpotlightDialog({
208
- animationStyles: {}
174
+ }, /*#__PURE__*/_react.default.createElement(_spotlightDialog.default, {
175
+ testId: "".concat(testId, "--dialog"),
176
+ actions: _this2.props.actions,
177
+ actionsBeforeElement: _this2.props.actionsBeforeElement,
178
+ children: _this2.props.children,
179
+ dialogPlacement: _this2.props.dialogPlacement,
180
+ dialogWidth: _this2.props.dialogWidth,
181
+ footer: _this2.props.footer,
182
+ header: _this2.props.header,
183
+ heading: _this2.props.heading,
184
+ titleId: _this2.props.titleId,
185
+ label: _this2.props.label,
186
+ headingAfterElement: _this2.props.headingAfterElement,
187
+ image: _this2.props.image,
188
+ targetNode: replacementElement || targetNode
209
189
  }));
210
- })) : /*#__PURE__*/_react.default.createElement(_animation.Fade, {
211
- hasEntered: isOpen,
212
- onExited: onExited
213
- }, function (animationStyles) {
214
- return _this2.renderSpotlightDialog({
215
- animationStyles: animationStyles
216
- });
217
- })), /*#__PURE__*/_react.default.createElement(_reactScrolllock.default, null));
190
+ }))), /*#__PURE__*/_react.default.createElement(_reactScrolllock.default, null));
218
191
  });
219
192
  }
220
193
  }]);
@@ -19,7 +19,6 @@ var _motion = require("@atlaskit/motion");
19
19
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
20
20
  var _portal = _interopRequireDefault(require("@atlaskit/portal"));
21
21
  var _blanket = _interopRequireDefault(require("../styled/blanket"));
22
- var _animation = require("./animation");
23
22
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
24
23
  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; }
25
24
  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; }
@@ -137,7 +136,7 @@ var SpotlightManager = exports.default = /*#__PURE__*/function (_PureComponent)
137
136
  value: this.getTargetRef
138
137
  }, /*#__PURE__*/_react.default.createElement(Container, {
139
138
  component: Tag || _react.default.Fragment
140
- }, (0, _platformFeatureFlags.fg)('platform_dst_onboarding_react_transition_group') ? /*#__PURE__*/_react.default.createElement(_motion.ExitingPersistence, null, isActive && /*#__PURE__*/_react.default.createElement(_motion.FadeIn, {
139
+ }, /*#__PURE__*/_react.default.createElement(_motion.ExitingPersistence, null, isActive && /*#__PURE__*/_react.default.createElement(_motion.FadeIn, {
141
140
  duration: "medium"
142
141
  }, function (_ref2) {
143
142
  var ref = _ref2.ref,
@@ -155,18 +154,7 @@ var SpotlightManager = exports.default = /*#__PURE__*/function (_PureComponent)
155
154
  isTinted: blanketIsTinted,
156
155
  onBlanketClicked: onBlanketClicked
157
156
  }));
158
- })) : /*#__PURE__*/_react.default.createElement(_animation.Fade, {
159
- hasEntered: isActive
160
- }, function (animationStyles) {
161
- return /*#__PURE__*/_react.default.createElement(_portal.default, {
162
- zIndex: 700
163
- }, /*#__PURE__*/_react.default.createElement(_blanket.default
164
- /* eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766 */, {
165
- style: animationStyles,
166
- isTinted: blanketIsTinted,
167
- onBlanketClicked: onBlanketClicked
168
- }));
169
- }), children)));
157
+ })), children)));
170
158
  }
171
159
  }]);
172
160
  }(_react.PureComponent);
@@ -39,7 +39,6 @@ class SpotlightDialogComponent extends Component {
39
39
  const {
40
40
  actions,
41
41
  actionsBeforeElement,
42
- animationStyles,
43
42
  children,
44
43
  dialogPlacement,
45
44
  dialogWidth,
@@ -103,10 +102,7 @@ class SpotlightDialogComponent extends Component {
103
102
  }, /*#__PURE__*/React.createElement(Box
104
103
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
105
104
  , {
106
- style: {
107
- ...style,
108
- ...animationStyles
109
- },
105
+ style: style,
110
106
  ref: ref,
111
107
  "aria-modal": true,
112
108
  role: "dialog",
@@ -9,7 +9,6 @@ import { ExitingPersistence, FadeIn } from '@atlaskit/motion';
9
9
  import { fg } from '@atlaskit/platform-feature-flags';
10
10
  import Portal from '@atlaskit/portal';
11
11
  import { ElementBox } from '../utils/use-element-box';
12
- import { Fade } from './animation';
13
12
  import Clone from './clone';
14
13
  import NodeResolverSpotlightInner from './node-resolver-spotlight-inner';
15
14
  import SpotlightDialog from './spotlight-dialog';
@@ -76,39 +75,6 @@ class SpotlightInner extends React.Component {
76
75
  componentWillUnmount() {
77
76
  this.props.onClosed();
78
77
  }
79
- /**
80
- * Only exists to avoid duplication with the `platform_dst_onboarding_react_transition_group` flag.
81
- *
82
- * TODO: Make this inline in `render` when cleaning up `platform_dst_onboarding_react_transition_group`.
83
- */
84
- renderSpotlightDialog({
85
- animationStyles
86
- }) {
87
- const {
88
- targetNode,
89
- testId
90
- } = this.props;
91
- const {
92
- replacementElement
93
- } = this.state;
94
- return /*#__PURE__*/React.createElement(SpotlightDialog, {
95
- testId: `${testId}--dialog`,
96
- actions: this.props.actions,
97
- actionsBeforeElement: this.props.actionsBeforeElement,
98
- children: this.props.children,
99
- dialogPlacement: this.props.dialogPlacement,
100
- dialogWidth: this.props.dialogWidth,
101
- footer: this.props.footer,
102
- header: this.props.header,
103
- heading: this.props.heading,
104
- titleId: this.props.titleId,
105
- label: this.props.label,
106
- headingAfterElement: this.props.headingAfterElement,
107
- image: this.props.image,
108
- targetNode: replacementElement || targetNode,
109
- animationStyles: animationStyles
110
- });
111
- }
112
78
  render() {
113
79
  const {
114
80
  pulse,
@@ -156,7 +122,7 @@ class SpotlightInner extends React.Component {
156
122
  targetRadius: targetRadius
157
123
  })), TargetReplacement && !replacementElement ? null : /*#__PURE__*/React.createElement(Layering, {
158
124
  isDisabled: false
159
- }, fg('platform_dst_onboarding_react_transition_group') ? /*#__PURE__*/React.createElement(ExitingPersistence, {
125
+ }, /*#__PURE__*/React.createElement(ExitingPersistence, {
160
126
  appear: true
161
127
  }, isOpen && /*#__PURE__*/React.createElement(FadeIn, {
162
128
  onFinish: state => {
@@ -175,14 +141,22 @@ class SpotlightInner extends React.Component {
175
141
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
176
142
  ,
177
143
  style: style
178
- }, this.renderSpotlightDialog({
179
- animationStyles: {}
180
- })))) : /*#__PURE__*/React.createElement(Fade, {
181
- hasEntered: isOpen,
182
- onExited: onExited
183
- }, animationStyles => this.renderSpotlightDialog({
184
- animationStyles
185
- }))), /*#__PURE__*/React.createElement(ScrollLock, null)));
144
+ }, /*#__PURE__*/React.createElement(SpotlightDialog, {
145
+ testId: `${testId}--dialog`,
146
+ actions: this.props.actions,
147
+ actionsBeforeElement: this.props.actionsBeforeElement,
148
+ children: this.props.children,
149
+ dialogPlacement: this.props.dialogPlacement,
150
+ dialogWidth: this.props.dialogWidth,
151
+ footer: this.props.footer,
152
+ header: this.props.header,
153
+ heading: this.props.heading,
154
+ titleId: this.props.titleId,
155
+ label: this.props.label,
156
+ headingAfterElement: this.props.headingAfterElement,
157
+ image: this.props.image,
158
+ targetNode: replacementElement || targetNode
159
+ }))))), /*#__PURE__*/React.createElement(ScrollLock, null)));
186
160
  }
187
161
  }
188
162
  _defineProperty(SpotlightInner, "defaultProps", {
@@ -6,7 +6,6 @@ import { ExitingPersistence, FadeIn } from '@atlaskit/motion';
6
6
  import { fg } from '@atlaskit/platform-feature-flags';
7
7
  import Portal from '@atlaskit/portal';
8
8
  import Blanket from '../styled/blanket';
9
- import { Fade } from './animation';
10
9
  const {
11
10
  Consumer: TargetConsumer,
12
11
  Provider: TargetProvider
@@ -105,7 +104,7 @@ export default class SpotlightManager extends PureComponent {
105
104
  value: this.getTargetRef
106
105
  }, /*#__PURE__*/React.createElement(Container, {
107
106
  component: Tag || React.Fragment
108
- }, fg('platform_dst_onboarding_react_transition_group') ? /*#__PURE__*/React.createElement(ExitingPersistence, null, isActive && /*#__PURE__*/React.createElement(FadeIn, {
107
+ }, /*#__PURE__*/React.createElement(ExitingPersistence, null, isActive && /*#__PURE__*/React.createElement(FadeIn, {
109
108
  duration: "medium"
110
109
  }, ({
111
110
  ref,
@@ -122,16 +121,7 @@ export default class SpotlightManager extends PureComponent {
122
121
  style: style,
123
122
  isTinted: blanketIsTinted,
124
123
  onBlanketClicked: onBlanketClicked
125
- })))) : /*#__PURE__*/React.createElement(Fade, {
126
- hasEntered: isActive
127
- }, animationStyles => /*#__PURE__*/React.createElement(Portal, {
128
- zIndex: 700
129
- }, /*#__PURE__*/React.createElement(Blanket
130
- /* eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766 */, {
131
- style: animationStyles,
132
- isTinted: blanketIsTinted,
133
- onBlanketClicked: onBlanketClicked
134
- }))), children)));
124
+ })))), children)));
135
125
  }
136
126
  }
137
127
  _defineProperty(SpotlightManager, "defaultProps", {
@@ -4,8 +4,6 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
4
4
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
5
5
  import _inherits from "@babel/runtime/helpers/inherits";
6
6
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
7
- 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; }
8
- 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; }
9
7
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
10
8
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
11
9
  import React, { Component } from 'react';
@@ -62,7 +60,6 @@ var SpotlightDialogComponent = /*#__PURE__*/function (_Component) {
62
60
  var _this$props = this.props,
63
61
  actions = _this$props.actions,
64
62
  actionsBeforeElement = _this$props.actionsBeforeElement,
65
- animationStyles = _this$props.animationStyles,
66
63
  children = _this$props.children,
67
64
  dialogPlacement = _this$props.dialogPlacement,
68
65
  dialogWidth = _this$props.dialogWidth,
@@ -124,7 +121,7 @@ var SpotlightDialogComponent = /*#__PURE__*/function (_Component) {
124
121
  }, /*#__PURE__*/React.createElement(Box
125
122
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
126
123
  , {
127
- style: _objectSpread(_objectSpread({}, style), animationStyles),
124
+ style: style,
128
125
  ref: ref,
129
126
  "aria-modal": true,
130
127
  role: "dialog",
@@ -20,7 +20,6 @@ import { ExitingPersistence, FadeIn } from '@atlaskit/motion';
20
20
  import { fg } from '@atlaskit/platform-feature-flags';
21
21
  import Portal from '@atlaskit/portal';
22
22
  import { ElementBox } from '../utils/use-element-box';
23
- import { Fade } from './animation';
24
23
  import Clone from './clone';
25
24
  import NodeResolverSpotlightInner from './node-resolver-spotlight-inner';
26
25
  import SpotlightDialog from './spotlight-dialog';
@@ -93,56 +92,24 @@ var SpotlightInner = /*#__PURE__*/function (_React$Component) {
93
92
  value: function componentWillUnmount() {
94
93
  this.props.onClosed();
95
94
  }
96
- }, {
97
- key: "renderSpotlightDialog",
98
- value:
99
- /**
100
- * Only exists to avoid duplication with the `platform_dst_onboarding_react_transition_group` flag.
101
- *
102
- * TODO: Make this inline in `render` when cleaning up `platform_dst_onboarding_react_transition_group`.
103
- */
104
- function renderSpotlightDialog(_ref) {
105
- var animationStyles = _ref.animationStyles;
106
- var _this$props = this.props,
107
- targetNode = _this$props.targetNode,
108
- testId = _this$props.testId;
109
- var replacementElement = this.state.replacementElement;
110
- return /*#__PURE__*/React.createElement(SpotlightDialog, {
111
- testId: "".concat(testId, "--dialog"),
112
- actions: this.props.actions,
113
- actionsBeforeElement: this.props.actionsBeforeElement,
114
- children: this.props.children,
115
- dialogPlacement: this.props.dialogPlacement,
116
- dialogWidth: this.props.dialogWidth,
117
- footer: this.props.footer,
118
- header: this.props.header,
119
- heading: this.props.heading,
120
- titleId: this.props.titleId,
121
- label: this.props.label,
122
- headingAfterElement: this.props.headingAfterElement,
123
- image: this.props.image,
124
- targetNode: replacementElement || targetNode,
125
- animationStyles: animationStyles
126
- });
127
- }
128
95
  }, {
129
96
  key: "render",
130
97
  value: function render() {
131
98
  var _this2 = this;
132
- var _this$props2 = this.props,
133
- pulse = _this$props2.pulse,
134
- shouldWatchTarget = _this$props2.shouldWatchTarget,
135
- target = _this$props2.target,
136
- targetNode = _this$props2.targetNode,
137
- targetBgColor = _this$props2.targetBgColor,
138
- targetOnClick = _this$props2.targetOnClick,
139
- targetRadius = _this$props2.targetRadius,
140
- testId = _this$props2.testId,
141
- TargetReplacement = _this$props2.targetReplacement;
99
+ var _this$props = this.props,
100
+ pulse = _this$props.pulse,
101
+ shouldWatchTarget = _this$props.shouldWatchTarget,
102
+ target = _this$props.target,
103
+ targetNode = _this$props.targetNode,
104
+ targetBgColor = _this$props.targetBgColor,
105
+ targetOnClick = _this$props.targetOnClick,
106
+ targetRadius = _this$props.targetRadius,
107
+ testId = _this$props.testId,
108
+ TargetReplacement = _this$props.targetReplacement;
142
109
  var replacementElement = this.state.replacementElement;
143
- return /*#__PURE__*/React.createElement(SpotlightTransitionConsumer, null, function (_ref2) {
144
- var isOpen = _ref2.isOpen,
145
- onExited = _ref2.onExited;
110
+ return /*#__PURE__*/React.createElement(SpotlightTransitionConsumer, null, function (_ref) {
111
+ var isOpen = _ref.isOpen,
112
+ onExited = _ref.onExited;
146
113
  return /*#__PURE__*/React.createElement(Portal, {
147
114
  zIndex: 701
148
115
  }, TargetReplacement ? /*#__PURE__*/React.createElement(NodeResolverSpotlightInner, {
@@ -178,17 +145,17 @@ var SpotlightInner = /*#__PURE__*/function (_React$Component) {
178
145
  });
179
146
  }), TargetReplacement && !replacementElement ? null : /*#__PURE__*/React.createElement(Layering, {
180
147
  isDisabled: false
181
- }, fg('platform_dst_onboarding_react_transition_group') ? /*#__PURE__*/React.createElement(ExitingPersistence, {
148
+ }, /*#__PURE__*/React.createElement(ExitingPersistence, {
182
149
  appear: true
183
150
  }, isOpen && /*#__PURE__*/React.createElement(FadeIn, {
184
151
  onFinish: function onFinish(state) {
185
152
  state === 'exiting' && onExited();
186
153
  },
187
154
  duration: "medium"
188
- }, function (_ref3) {
189
- var ref = _ref3.ref,
190
- className = _ref3.className,
191
- style = _ref3.style;
155
+ }, function (_ref2) {
156
+ var ref = _ref2.ref,
157
+ className = _ref2.className,
158
+ style = _ref2.style;
192
159
  return /*#__PURE__*/React.createElement("div", {
193
160
  ref: ref
194
161
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
@@ -197,17 +164,23 @@ var SpotlightInner = /*#__PURE__*/function (_React$Component) {
197
164
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
198
165
  ,
199
166
  style: style
200
- }, _this2.renderSpotlightDialog({
201
- animationStyles: {}
167
+ }, /*#__PURE__*/React.createElement(SpotlightDialog, {
168
+ testId: "".concat(testId, "--dialog"),
169
+ actions: _this2.props.actions,
170
+ actionsBeforeElement: _this2.props.actionsBeforeElement,
171
+ children: _this2.props.children,
172
+ dialogPlacement: _this2.props.dialogPlacement,
173
+ dialogWidth: _this2.props.dialogWidth,
174
+ footer: _this2.props.footer,
175
+ header: _this2.props.header,
176
+ heading: _this2.props.heading,
177
+ titleId: _this2.props.titleId,
178
+ label: _this2.props.label,
179
+ headingAfterElement: _this2.props.headingAfterElement,
180
+ image: _this2.props.image,
181
+ targetNode: replacementElement || targetNode
202
182
  }));
203
- })) : /*#__PURE__*/React.createElement(Fade, {
204
- hasEntered: isOpen,
205
- onExited: onExited
206
- }, function (animationStyles) {
207
- return _this2.renderSpotlightDialog({
208
- animationStyles: animationStyles
209
- });
210
- })), /*#__PURE__*/React.createElement(ScrollLock, null));
183
+ }))), /*#__PURE__*/React.createElement(ScrollLock, null));
211
184
  });
212
185
  }
213
186
  }]);
@@ -15,7 +15,6 @@ import { ExitingPersistence, FadeIn } from '@atlaskit/motion';
15
15
  import { fg } from '@atlaskit/platform-feature-flags';
16
16
  import Portal from '@atlaskit/portal';
17
17
  import Blanket from '../styled/blanket';
18
- import { Fade } from './animation';
19
18
  var _createContext = /*#__PURE__*/createContext(undefined),
20
19
  TargetConsumer = _createContext.Consumer,
21
20
  TargetProvider = _createContext.Provider;
@@ -130,7 +129,7 @@ var SpotlightManager = /*#__PURE__*/function (_PureComponent) {
130
129
  value: this.getTargetRef
131
130
  }, /*#__PURE__*/React.createElement(Container, {
132
131
  component: Tag || React.Fragment
133
- }, fg('platform_dst_onboarding_react_transition_group') ? /*#__PURE__*/React.createElement(ExitingPersistence, null, isActive && /*#__PURE__*/React.createElement(FadeIn, {
132
+ }, /*#__PURE__*/React.createElement(ExitingPersistence, null, isActive && /*#__PURE__*/React.createElement(FadeIn, {
134
133
  duration: "medium"
135
134
  }, function (_ref2) {
136
135
  var ref = _ref2.ref,
@@ -148,18 +147,7 @@ var SpotlightManager = /*#__PURE__*/function (_PureComponent) {
148
147
  isTinted: blanketIsTinted,
149
148
  onBlanketClicked: onBlanketClicked
150
149
  }));
151
- })) : /*#__PURE__*/React.createElement(Fade, {
152
- hasEntered: isActive
153
- }, function (animationStyles) {
154
- return /*#__PURE__*/React.createElement(Portal, {
155
- zIndex: 700
156
- }, /*#__PURE__*/React.createElement(Blanket
157
- /* eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766 */, {
158
- style: animationStyles,
159
- isTinted: blanketIsTinted,
160
- onBlanketClicked: onBlanketClicked
161
- }));
162
- }), children)));
150
+ })), children)));
163
151
  }
164
152
  }]);
165
153
  }(PureComponent);
@@ -45,10 +45,6 @@ interface SpotlightDialogProps {
45
45
  * The spotlight target node.
46
46
  */
47
47
  targetNode: HTMLElement;
48
- /**
49
- * Contains the animation styles to apply to the component.
50
- */
51
- animationStyles: Object;
52
48
  /**
53
49
  * A `testId` prop is provided for specified elements,
54
50
  * which is a unique string that appears as a data attribute `data-testid` in the rendered code,
@@ -53,14 +53,6 @@ declare class SpotlightInner extends React.Component<SpotlightInnerProps, State>
53
53
  componentDidMount(): void;
54
54
  componentWillUnmount(): void;
55
55
  getTargetNodeStyle: (box: ElementBoundingBox) => {};
56
- /**
57
- * Only exists to avoid duplication with the `platform_dst_onboarding_react_transition_group` flag.
58
- *
59
- * TODO: Make this inline in `render` when cleaning up `platform_dst_onboarding_react_transition_group`.
60
- */
61
- renderSpotlightDialog({ animationStyles }: {
62
- animationStyles: React.CSSProperties;
63
- }): React.JSX.Element;
64
56
  render(): React.JSX.Element;
65
57
  }
66
58
  export default SpotlightInner;
@@ -45,10 +45,6 @@ interface SpotlightDialogProps {
45
45
  * The spotlight target node.
46
46
  */
47
47
  targetNode: HTMLElement;
48
- /**
49
- * Contains the animation styles to apply to the component.
50
- */
51
- animationStyles: Object;
52
48
  /**
53
49
  * A `testId` prop is provided for specified elements,
54
50
  * which is a unique string that appears as a data attribute `data-testid` in the rendered code,
@@ -53,14 +53,6 @@ declare class SpotlightInner extends React.Component<SpotlightInnerProps, State>
53
53
  componentDidMount(): void;
54
54
  componentWillUnmount(): void;
55
55
  getTargetNodeStyle: (box: ElementBoundingBox) => {};
56
- /**
57
- * Only exists to avoid duplication with the `platform_dst_onboarding_react_transition_group` flag.
58
- *
59
- * TODO: Make this inline in `render` when cleaning up `platform_dst_onboarding_react_transition_group`.
60
- */
61
- renderSpotlightDialog({ animationStyles }: {
62
- animationStyles: React.CSSProperties;
63
- }): React.JSX.Element;
64
56
  render(): React.JSX.Element;
65
57
  }
66
58
  export default SpotlightInner;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/onboarding",
3
- "version": "14.2.6",
3
+ "version": "14.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/"
@@ -49,7 +49,7 @@
49
49
  "dependencies": {
50
50
  "@atlaskit/button": "^23.2.0",
51
51
  "@atlaskit/css": "^0.12.0",
52
- "@atlaskit/ds-lib": "^4.0.0",
52
+ "@atlaskit/ds-lib": "^4.1.0",
53
53
  "@atlaskit/heading": "^5.2.0",
54
54
  "@atlaskit/layering": "^3.0.0",
55
55
  "@atlaskit/modal-dialog": "^14.2.0",
@@ -67,7 +67,6 @@
67
67
  "react-focus-lock": "^2.9.5",
68
68
  "react-node-resolver": "^1.0.1",
69
69
  "react-scrolllock": "^5.0.1",
70
- "react-transition-group": "^4.4.1",
71
70
  "scroll-into-view-if-needed": "^2.2.20"
72
71
  },
73
72
  "peerDependencies": {
@@ -85,7 +84,6 @@
85
84
  "@testing-library/user-event": "^14.4.3",
86
85
  "@types/exenv": "^1.2.0",
87
86
  "@types/react-node-resolver": "^2.0.0",
88
- "@types/react-transition-group": "^2.0.6",
89
87
  "raf-stub": "^2.0.1",
90
88
  "react-dom": "^18.2.0",
91
89
  "react-lorem-component": "^0.13.0",
@@ -104,9 +102,6 @@
104
102
  },
105
103
  "platform_fix_component_state_update_for_suspense": {
106
104
  "type": "boolean"
107
- },
108
- "platform_dst_onboarding_react_transition_group": {
109
- "type": "boolean"
110
105
  }
111
106
  },
112
107
  "techstack": {
@@ -1,53 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.Fade = void 0;
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
- var _react = _interopRequireDefault(require("react"));
11
- var _reactTransitionGroup = require("react-transition-group");
12
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
13
- 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
- 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; }
15
- var duration = {
16
- enter: 0,
17
- exit: 100
18
- };
19
- /**
20
- * __Fade__
21
- *
22
- * A fade in animation used for spotlights.
23
- *
24
- * @internal
25
- */
26
- var Fade = exports.Fade = function Fade(_ref) {
27
- var hasEntered = _ref.hasEntered,
28
- children = _ref.children,
29
- onExited = _ref.onExited;
30
- var nodeRef = _react.default.useRef(null);
31
- return /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.Transition, (0, _extends2.default)({
32
- in: hasEntered,
33
- timeout: duration,
34
- onExited: onExited,
35
- unmountOnExit: true,
36
- appear: true
37
- }, (0, _platformFeatureFlags.fg)('platform_design_system_team_transition_group_r18') && {
38
- nodeRef: nodeRef
39
- }), function (status) {
40
- var anim = {
41
- entered: {
42
- opacity: 1
43
- },
44
- exiting: {
45
- opacity: 0
46
- }
47
- };
48
- return children(_objectSpread({
49
- transition: "opacity ".concat(duration.exit, "ms"),
50
- opacity: 0
51
- }, status in anim ? anim[status] : {}));
52
- });
53
- };
@@ -1,45 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react';
3
- import { Transition } from 'react-transition-group';
4
- import { fg } from '@atlaskit/platform-feature-flags';
5
- const duration = {
6
- enter: 0,
7
- exit: 100
8
- };
9
- /**
10
- * __Fade__
11
- *
12
- * A fade in animation used for spotlights.
13
- *
14
- * @internal
15
- */
16
- export const Fade = ({
17
- hasEntered,
18
- children,
19
- onExited
20
- }) => {
21
- const nodeRef = React.useRef(null);
22
- return /*#__PURE__*/React.createElement(Transition, _extends({
23
- in: hasEntered,
24
- timeout: duration,
25
- onExited: onExited,
26
- unmountOnExit: true,
27
- appear: true
28
- }, fg('platform_design_system_team_transition_group_r18') && {
29
- nodeRef
30
- }), status => {
31
- const anim = {
32
- entered: {
33
- opacity: 1
34
- },
35
- exiting: {
36
- opacity: 0
37
- }
38
- };
39
- return children({
40
- transition: `opacity ${duration.exit}ms`,
41
- opacity: 0,
42
- ...(status in anim ? anim[status] : {})
43
- });
44
- });
45
- };
@@ -1,46 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
- 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; }
4
- 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; }
5
- import React from 'react';
6
- import { Transition } from 'react-transition-group';
7
- import { fg } from '@atlaskit/platform-feature-flags';
8
- var duration = {
9
- enter: 0,
10
- exit: 100
11
- };
12
- /**
13
- * __Fade__
14
- *
15
- * A fade in animation used for spotlights.
16
- *
17
- * @internal
18
- */
19
- export var Fade = function Fade(_ref) {
20
- var hasEntered = _ref.hasEntered,
21
- children = _ref.children,
22
- onExited = _ref.onExited;
23
- var nodeRef = React.useRef(null);
24
- return /*#__PURE__*/React.createElement(Transition, _extends({
25
- in: hasEntered,
26
- timeout: duration,
27
- onExited: onExited,
28
- unmountOnExit: true,
29
- appear: true
30
- }, fg('platform_design_system_team_transition_group_r18') && {
31
- nodeRef: nodeRef
32
- }), function (status) {
33
- var anim = {
34
- entered: {
35
- opacity: 1
36
- },
37
- exiting: {
38
- opacity: 0
39
- }
40
- };
41
- return children(_objectSpread({
42
- transition: "opacity ".concat(duration.exit, "ms"),
43
- opacity: 0
44
- }, status in anim ? anim[status] : {}));
45
- });
46
- };
@@ -1,15 +0,0 @@
1
- import React, { type ReactNode } from 'react';
2
- interface FadeProps {
3
- hasEntered: boolean;
4
- children: (animationStyles: Record<string, any>) => ReactNode;
5
- onExited?: () => any;
6
- }
7
- /**
8
- * __Fade__
9
- *
10
- * A fade in animation used for spotlights.
11
- *
12
- * @internal
13
- */
14
- export declare const Fade: ({ hasEntered, children, onExited }: FadeProps) => React.JSX.Element;
15
- export {};
@@ -1,15 +0,0 @@
1
- import React, { type ReactNode } from 'react';
2
- interface FadeProps {
3
- hasEntered: boolean;
4
- children: (animationStyles: Record<string, any>) => ReactNode;
5
- onExited?: () => any;
6
- }
7
- /**
8
- * __Fade__
9
- *
10
- * A fade in animation used for spotlights.
11
- *
12
- * @internal
13
- */
14
- export declare const Fade: ({ hasEntered, children, onExited }: FadeProps) => React.JSX.Element;
15
- export {};