@atlaskit/onboarding 14.1.0 → 14.2.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 +24 -0
- package/dist/cjs/components/spotlight-card.js +1 -0
- package/dist/cjs/components/spotlight-inner.js +74 -33
- package/dist/cjs/components/spotlight-manager.js +22 -2
- package/dist/cjs/styled/blanket.js +12 -7
- package/dist/es2019/components/spotlight-card.js +1 -0
- package/dist/es2019/components/spotlight-inner.js +60 -19
- package/dist/es2019/components/spotlight-manager.js +21 -2
- package/dist/es2019/styled/blanket.js +14 -9
- package/dist/esm/components/spotlight-card.js +1 -0
- package/dist/esm/components/spotlight-inner.js +74 -33
- package/dist/esm/components/spotlight-manager.js +22 -2
- package/dist/esm/styled/blanket.js +11 -6
- package/dist/types/components/spotlight-card.d.ts +2 -70
- package/dist/types/components/spotlight-inner.d.ts +8 -0
- package/dist/types/styled/blanket.d.ts +2 -1
- package/dist/types/types.d.ts +65 -1
- package/dist/types-ts4.5/components/spotlight-card.d.ts +2 -70
- package/dist/types-ts4.5/components/spotlight-inner.d.ts +8 -0
- package/dist/types-ts4.5/styled/blanket.d.ts +2 -1
- package/dist/types-ts4.5/types.d.ts +65 -1
- package/package.json +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @atlaskit/onboarding
|
|
2
2
|
|
|
3
|
+
## 14.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#161229](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/161229)
|
|
8
|
+
[`37873d53dbc22`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/37873d53dbc22) -
|
|
9
|
+
Adds `platform_dst_onboarding_react_transition_group` feature gate. When enabled
|
|
10
|
+
`@atlaskit/motion` will be used for transitions instead of `react-transition-group`.
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#155802](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/155802)
|
|
15
|
+
[`08019848e3eab`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/08019848e3eab) -
|
|
16
|
+
Refreshed "issue" terminology.
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
19
|
+
## 14.1.1
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- [#153897](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/153897)
|
|
24
|
+
[`86e45dd6e3502`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/86e45dd6e3502) -
|
|
25
|
+
Export SpotlightCard prop types
|
|
26
|
+
|
|
3
27
|
## 14.1.0
|
|
4
28
|
|
|
5
29
|
### Minor Changes
|
|
@@ -18,6 +18,7 @@ var _exenv = require("exenv");
|
|
|
18
18
|
var _reactScrolllock = _interopRequireDefault(require("react-scrolllock"));
|
|
19
19
|
var _scrollIntoViewIfNeeded = _interopRequireDefault(require("scroll-into-view-if-needed"));
|
|
20
20
|
var _layering = require("@atlaskit/layering");
|
|
21
|
+
var _motion = require("@atlaskit/motion");
|
|
21
22
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
22
23
|
var _portal = _interopRequireDefault(require("@atlaskit/portal"));
|
|
23
24
|
var _useElementBox = require("../utils/use-element-box");
|
|
@@ -99,24 +100,56 @@ var SpotlightInner = /*#__PURE__*/function (_React$Component) {
|
|
|
99
100
|
value: function componentWillUnmount() {
|
|
100
101
|
this.props.onClosed();
|
|
101
102
|
}
|
|
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
|
+
}
|
|
102
135
|
}, {
|
|
103
136
|
key: "render",
|
|
104
137
|
value: function render() {
|
|
105
138
|
var _this2 = this;
|
|
106
|
-
var _this$
|
|
107
|
-
pulse = _this$
|
|
108
|
-
shouldWatchTarget = _this$
|
|
109
|
-
target = _this$
|
|
110
|
-
targetNode = _this$
|
|
111
|
-
targetBgColor = _this$
|
|
112
|
-
targetOnClick = _this$
|
|
113
|
-
targetRadius = _this$
|
|
114
|
-
testId = _this$
|
|
115
|
-
TargetReplacement = _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;
|
|
116
149
|
var replacementElement = this.state.replacementElement;
|
|
117
|
-
return /*#__PURE__*/_react.default.createElement(_spotlightTransition.SpotlightTransitionConsumer, null, function (
|
|
118
|
-
var isOpen =
|
|
119
|
-
onExited =
|
|
150
|
+
return /*#__PURE__*/_react.default.createElement(_spotlightTransition.SpotlightTransitionConsumer, null, function (_ref2) {
|
|
151
|
+
var isOpen = _ref2.isOpen,
|
|
152
|
+
onExited = _ref2.onExited;
|
|
120
153
|
return /*#__PURE__*/_react.default.createElement(_portal.default, {
|
|
121
154
|
zIndex: 701
|
|
122
155
|
}, TargetReplacement ? /*#__PURE__*/_react.default.createElement(_nodeResolverSpotlightInner.default, {
|
|
@@ -150,30 +183,38 @@ var SpotlightInner = /*#__PURE__*/function (_React$Component) {
|
|
|
150
183
|
targetOnClick: targetOnClick,
|
|
151
184
|
targetRadius: targetRadius
|
|
152
185
|
});
|
|
153
|
-
}), TargetReplacement && !replacementElement ? null : /*#__PURE__*/_react.default.createElement(
|
|
186
|
+
}), TargetReplacement && !replacementElement ? null : /*#__PURE__*/_react.default.createElement(_layering.Layering, {
|
|
187
|
+
isDisabled: false
|
|
188
|
+
}, (0, _platformFeatureFlags.fg)('platform_dst_onboarding_react_transition_group') ? /*#__PURE__*/_react.default.createElement(_motion.ExitingPersistence, {
|
|
189
|
+
appear: true
|
|
190
|
+
}, isOpen && /*#__PURE__*/_react.default.createElement(_motion.FadeIn, {
|
|
191
|
+
onFinish: function onFinish(state) {
|
|
192
|
+
state === 'exiting' && onExited();
|
|
193
|
+
},
|
|
194
|
+
duration: "medium"
|
|
195
|
+
}, function (_ref3) {
|
|
196
|
+
var ref = _ref3.ref,
|
|
197
|
+
className = _ref3.className,
|
|
198
|
+
style = _ref3.style;
|
|
199
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
200
|
+
ref: ref
|
|
201
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
202
|
+
,
|
|
203
|
+
className: className
|
|
204
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
205
|
+
,
|
|
206
|
+
style: style
|
|
207
|
+
}, _this2.renderSpotlightDialog({
|
|
208
|
+
animationStyles: {}
|
|
209
|
+
}));
|
|
210
|
+
})) : /*#__PURE__*/_react.default.createElement(_animation.Fade, {
|
|
154
211
|
hasEntered: isOpen,
|
|
155
212
|
onExited: onExited
|
|
156
213
|
}, function (animationStyles) {
|
|
157
|
-
return
|
|
158
|
-
isDisabled: false
|
|
159
|
-
}, /*#__PURE__*/_react.default.createElement(_spotlightDialog.default, {
|
|
160
|
-
testId: "".concat(testId, "--dialog"),
|
|
161
|
-
actions: _this2.props.actions,
|
|
162
|
-
actionsBeforeElement: _this2.props.actionsBeforeElement,
|
|
163
|
-
children: _this2.props.children,
|
|
164
|
-
dialogPlacement: _this2.props.dialogPlacement,
|
|
165
|
-
dialogWidth: _this2.props.dialogWidth,
|
|
166
|
-
footer: _this2.props.footer,
|
|
167
|
-
header: _this2.props.header,
|
|
168
|
-
heading: _this2.props.heading,
|
|
169
|
-
titleId: _this2.props.titleId,
|
|
170
|
-
label: _this2.props.label,
|
|
171
|
-
headingAfterElement: _this2.props.headingAfterElement,
|
|
172
|
-
image: _this2.props.image,
|
|
173
|
-
targetNode: replacementElement || targetNode,
|
|
214
|
+
return _this2.renderSpotlightDialog({
|
|
174
215
|
animationStyles: animationStyles
|
|
175
|
-
})
|
|
176
|
-
}), /*#__PURE__*/_react.default.createElement(_reactScrolllock.default, null));
|
|
216
|
+
});
|
|
217
|
+
})), /*#__PURE__*/_react.default.createElement(_reactScrolllock.default, null));
|
|
177
218
|
});
|
|
178
219
|
}
|
|
179
220
|
}]);
|
|
@@ -15,6 +15,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
15
15
|
var _react = _interopRequireWildcard(require("react"));
|
|
16
16
|
var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
17
17
|
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
18
|
+
var _motion = require("@atlaskit/motion");
|
|
18
19
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
19
20
|
var _portal = _interopRequireDefault(require("@atlaskit/portal"));
|
|
20
21
|
var _blanket = _interopRequireDefault(require("../styled/blanket"));
|
|
@@ -130,14 +131,33 @@ var SpotlightManager = exports.default = /*#__PURE__*/function (_PureComponent)
|
|
|
130
131
|
children = _this$props.children,
|
|
131
132
|
Tag = _this$props.component,
|
|
132
133
|
onBlanketClicked = _this$props.onBlanketClicked;
|
|
134
|
+
var isActive = this.state.spotlightCount > 0;
|
|
133
135
|
return /*#__PURE__*/_react.default.createElement(SpotlightStateProvider, {
|
|
134
136
|
value: this.getStateProviderValue(this.state.targets)
|
|
135
137
|
}, /*#__PURE__*/_react.default.createElement(TargetProvider, {
|
|
136
138
|
value: this.getTargetRef
|
|
137
139
|
}, /*#__PURE__*/_react.default.createElement(Container, {
|
|
138
140
|
component: Tag || _react.default.Fragment
|
|
139
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
140
|
-
|
|
141
|
+
}, (0, _platformFeatureFlags.fg)('platform_dst_onboarding_react_transition_group') ? /*#__PURE__*/_react.default.createElement(_motion.ExitingPersistence, null, isActive && /*#__PURE__*/_react.default.createElement(_motion.FadeIn, {
|
|
142
|
+
duration: "medium"
|
|
143
|
+
}, function (_ref2) {
|
|
144
|
+
var ref = _ref2.ref,
|
|
145
|
+
className = _ref2.className,
|
|
146
|
+
style = _ref2.style;
|
|
147
|
+
return /*#__PURE__*/_react.default.createElement(_portal.default, {
|
|
148
|
+
zIndex: 700
|
|
149
|
+
}, /*#__PURE__*/_react.default.createElement(_blanket.default, {
|
|
150
|
+
ref: ref
|
|
151
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
152
|
+
,
|
|
153
|
+
className: className
|
|
154
|
+
/* eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766 */,
|
|
155
|
+
style: style,
|
|
156
|
+
isTinted: blanketIsTinted,
|
|
157
|
+
onBlanketClicked: onBlanketClicked
|
|
158
|
+
}));
|
|
159
|
+
})) : /*#__PURE__*/_react.default.createElement(_animation.Fade, {
|
|
160
|
+
hasEntered: isActive
|
|
141
161
|
}, function (animationStyles) {
|
|
142
162
|
return /*#__PURE__*/_react.default.createElement(_portal.default, {
|
|
143
163
|
zIndex: 700
|
|
@@ -8,7 +8,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
});
|
|
9
9
|
exports.default = void 0;
|
|
10
10
|
require("./blanket.compiled.css");
|
|
11
|
-
var
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var React = _react;
|
|
12
13
|
var _runtime = require("@compiled/react/runtime");
|
|
13
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
15
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -29,17 +30,21 @@ var blanketStyles = null;
|
|
|
29
30
|
*
|
|
30
31
|
* @internal
|
|
31
32
|
*/
|
|
32
|
-
var Blanket = function
|
|
33
|
+
var Blanket = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
33
34
|
var isTinted = _ref.isTinted,
|
|
34
35
|
onBlanketClicked = _ref.onBlanketClicked,
|
|
35
|
-
style = _ref.style
|
|
36
|
+
style = _ref.style,
|
|
37
|
+
className = _ref.className;
|
|
36
38
|
return /*#__PURE__*/React.createElement("div", {
|
|
37
|
-
|
|
39
|
+
ref: ref,
|
|
40
|
+
role: "presentation"
|
|
41
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
42
|
+
,
|
|
43
|
+
className: (0, _runtime.ax)(["_1r04idpf _v56414ka _kqsw1n9t _1pby1fw0", className]),
|
|
38
44
|
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
39
45
|
backgroundColor: isTinted ? "var(--ds-blanket, #091E427D)" : 'transparent'
|
|
40
46
|
}),
|
|
41
|
-
onClick: onBlanketClicked
|
|
42
|
-
className: (0, _runtime.ax)(["_1r04idpf _v56414ka _kqsw1n9t _1pby1fw0"])
|
|
47
|
+
onClick: onBlanketClicked
|
|
43
48
|
});
|
|
44
|
-
};
|
|
49
|
+
});
|
|
45
50
|
var _default = exports.default = Blanket;
|
|
@@ -5,6 +5,7 @@ import { canUseDOM } from 'exenv';
|
|
|
5
5
|
import ScrollLock from 'react-scrolllock';
|
|
6
6
|
import scrollIntoView from 'scroll-into-view-if-needed';
|
|
7
7
|
import { Layering } from '@atlaskit/layering';
|
|
8
|
+
import { ExitingPersistence, FadeIn } from '@atlaskit/motion';
|
|
8
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
10
|
import Portal from '@atlaskit/portal';
|
|
10
11
|
import { ElementBox } from '../utils/use-element-box';
|
|
@@ -75,6 +76,39 @@ class SpotlightInner extends React.Component {
|
|
|
75
76
|
componentWillUnmount() {
|
|
76
77
|
this.props.onClosed();
|
|
77
78
|
}
|
|
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
|
+
}
|
|
78
112
|
render() {
|
|
79
113
|
const {
|
|
80
114
|
pulse,
|
|
@@ -120,27 +154,34 @@ class SpotlightInner extends React.Component {
|
|
|
120
154
|
targetNode: targetNode,
|
|
121
155
|
targetOnClick: targetOnClick,
|
|
122
156
|
targetRadius: targetRadius
|
|
123
|
-
})), TargetReplacement && !replacementElement ? null : /*#__PURE__*/React.createElement(
|
|
157
|
+
})), TargetReplacement && !replacementElement ? null : /*#__PURE__*/React.createElement(Layering, {
|
|
158
|
+
isDisabled: false
|
|
159
|
+
}, fg('platform_dst_onboarding_react_transition_group') ? /*#__PURE__*/React.createElement(ExitingPersistence, {
|
|
160
|
+
appear: true
|
|
161
|
+
}, isOpen && /*#__PURE__*/React.createElement(FadeIn, {
|
|
162
|
+
onFinish: state => {
|
|
163
|
+
state === 'exiting' && onExited();
|
|
164
|
+
},
|
|
165
|
+
duration: "medium"
|
|
166
|
+
}, ({
|
|
167
|
+
ref,
|
|
168
|
+
className,
|
|
169
|
+
style
|
|
170
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
171
|
+
ref: ref
|
|
172
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
173
|
+
,
|
|
174
|
+
className: className
|
|
175
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
176
|
+
,
|
|
177
|
+
style: style
|
|
178
|
+
}, this.renderSpotlightDialog({
|
|
179
|
+
animationStyles: {}
|
|
180
|
+
})))) : /*#__PURE__*/React.createElement(Fade, {
|
|
124
181
|
hasEntered: isOpen,
|
|
125
182
|
onExited: onExited
|
|
126
|
-
}, animationStyles =>
|
|
127
|
-
|
|
128
|
-
}, /*#__PURE__*/React.createElement(SpotlightDialog, {
|
|
129
|
-
testId: `${testId}--dialog`,
|
|
130
|
-
actions: this.props.actions,
|
|
131
|
-
actionsBeforeElement: this.props.actionsBeforeElement,
|
|
132
|
-
children: this.props.children,
|
|
133
|
-
dialogPlacement: this.props.dialogPlacement,
|
|
134
|
-
dialogWidth: this.props.dialogWidth,
|
|
135
|
-
footer: this.props.footer,
|
|
136
|
-
header: this.props.header,
|
|
137
|
-
heading: this.props.heading,
|
|
138
|
-
titleId: this.props.titleId,
|
|
139
|
-
label: this.props.label,
|
|
140
|
-
headingAfterElement: this.props.headingAfterElement,
|
|
141
|
-
image: this.props.image,
|
|
142
|
-
targetNode: replacementElement || targetNode,
|
|
143
|
-
animationStyles: animationStyles
|
|
183
|
+
}, animationStyles => this.renderSpotlightDialog({
|
|
184
|
+
animationStyles
|
|
144
185
|
}))), /*#__PURE__*/React.createElement(ScrollLock, null)));
|
|
145
186
|
}
|
|
146
187
|
}
|
|
@@ -2,6 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import React, { createContext, PureComponent, startTransition } from 'react';
|
|
3
3
|
import memoizeOne from 'memoize-one';
|
|
4
4
|
import noop from '@atlaskit/ds-lib/noop';
|
|
5
|
+
import { ExitingPersistence, FadeIn } from '@atlaskit/motion';
|
|
5
6
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
import Portal from '@atlaskit/portal';
|
|
7
8
|
import Blanket from '../styled/blanket';
|
|
@@ -97,14 +98,32 @@ export default class SpotlightManager extends PureComponent {
|
|
|
97
98
|
component: Tag,
|
|
98
99
|
onBlanketClicked
|
|
99
100
|
} = this.props;
|
|
101
|
+
const isActive = this.state.spotlightCount > 0;
|
|
100
102
|
return /*#__PURE__*/React.createElement(SpotlightStateProvider, {
|
|
101
103
|
value: this.getStateProviderValue(this.state.targets)
|
|
102
104
|
}, /*#__PURE__*/React.createElement(TargetProvider, {
|
|
103
105
|
value: this.getTargetRef
|
|
104
106
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
105
107
|
component: Tag || React.Fragment
|
|
106
|
-
}, /*#__PURE__*/React.createElement(
|
|
107
|
-
|
|
108
|
+
}, fg('platform_dst_onboarding_react_transition_group') ? /*#__PURE__*/React.createElement(ExitingPersistence, null, isActive && /*#__PURE__*/React.createElement(FadeIn, {
|
|
109
|
+
duration: "medium"
|
|
110
|
+
}, ({
|
|
111
|
+
ref,
|
|
112
|
+
className,
|
|
113
|
+
style
|
|
114
|
+
}) => /*#__PURE__*/React.createElement(Portal, {
|
|
115
|
+
zIndex: 700
|
|
116
|
+
}, /*#__PURE__*/React.createElement(Blanket, {
|
|
117
|
+
ref: ref
|
|
118
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
119
|
+
,
|
|
120
|
+
className: className
|
|
121
|
+
/* eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766 */,
|
|
122
|
+
style: style,
|
|
123
|
+
isTinted: blanketIsTinted,
|
|
124
|
+
onBlanketClicked: onBlanketClicked
|
|
125
|
+
})))) : /*#__PURE__*/React.createElement(Fade, {
|
|
126
|
+
hasEntered: isActive
|
|
108
127
|
}, animationStyles => /*#__PURE__*/React.createElement(Portal, {
|
|
109
128
|
zIndex: 700
|
|
110
129
|
}, /*#__PURE__*/React.createElement(Blanket
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/* blanket.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
-
// IE11 and Edge: z-index needed because fixed position calculates z-index relative
|
|
3
|
-
// to body instead of nearest stacking context (Portal in our case).
|
|
4
2
|
import "./blanket.compiled.css";
|
|
5
3
|
import * as React from 'react';
|
|
6
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
import { forwardRef } from 'react';
|
|
6
|
+
// IE11 and Edge: z-index needed because fixed position calculates z-index relative
|
|
7
|
+
// to body instead of nearest stacking context (Portal in our case).
|
|
7
8
|
const blanketStyles = null;
|
|
8
9
|
/**
|
|
9
10
|
* __Blanket__
|
|
@@ -16,20 +17,24 @@ const blanketStyles = null;
|
|
|
16
17
|
*
|
|
17
18
|
* @internal
|
|
18
19
|
*/
|
|
19
|
-
const Blanket = ({
|
|
20
|
+
const Blanket = /*#__PURE__*/forwardRef(({
|
|
20
21
|
isTinted,
|
|
21
22
|
onBlanketClicked,
|
|
22
|
-
style
|
|
23
|
-
|
|
23
|
+
style,
|
|
24
|
+
className
|
|
25
|
+
}, ref) => {
|
|
24
26
|
return /*#__PURE__*/React.createElement("div", {
|
|
25
|
-
|
|
27
|
+
ref: ref,
|
|
28
|
+
role: "presentation"
|
|
29
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
30
|
+
,
|
|
31
|
+
className: ax(["_1r04idpf _v56414ka _kqsw1n9t _1pby1fw0", className]),
|
|
26
32
|
style: {
|
|
27
33
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Pass-through style props are not allowed
|
|
28
34
|
...style,
|
|
29
35
|
backgroundColor: isTinted ? "var(--ds-blanket, #091E427D)" : 'transparent'
|
|
30
36
|
},
|
|
31
|
-
onClick: onBlanketClicked
|
|
32
|
-
className: ax(["_1r04idpf _v56414ka _kqsw1n9t _1pby1fw0"])
|
|
37
|
+
onClick: onBlanketClicked
|
|
33
38
|
});
|
|
34
|
-
};
|
|
39
|
+
});
|
|
35
40
|
export default Blanket;
|
|
@@ -16,6 +16,7 @@ import { canUseDOM } from 'exenv';
|
|
|
16
16
|
import ScrollLock from 'react-scrolllock';
|
|
17
17
|
import scrollIntoView from 'scroll-into-view-if-needed';
|
|
18
18
|
import { Layering } from '@atlaskit/layering';
|
|
19
|
+
import { ExitingPersistence, FadeIn } from '@atlaskit/motion';
|
|
19
20
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
20
21
|
import Portal from '@atlaskit/portal';
|
|
21
22
|
import { ElementBox } from '../utils/use-element-box';
|
|
@@ -92,24 +93,56 @@ var SpotlightInner = /*#__PURE__*/function (_React$Component) {
|
|
|
92
93
|
value: function componentWillUnmount() {
|
|
93
94
|
this.props.onClosed();
|
|
94
95
|
}
|
|
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
|
+
}
|
|
95
128
|
}, {
|
|
96
129
|
key: "render",
|
|
97
130
|
value: function render() {
|
|
98
131
|
var _this2 = this;
|
|
99
|
-
var _this$
|
|
100
|
-
pulse = _this$
|
|
101
|
-
shouldWatchTarget = _this$
|
|
102
|
-
target = _this$
|
|
103
|
-
targetNode = _this$
|
|
104
|
-
targetBgColor = _this$
|
|
105
|
-
targetOnClick = _this$
|
|
106
|
-
targetRadius = _this$
|
|
107
|
-
testId = _this$
|
|
108
|
-
TargetReplacement = _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;
|
|
109
142
|
var replacementElement = this.state.replacementElement;
|
|
110
|
-
return /*#__PURE__*/React.createElement(SpotlightTransitionConsumer, null, function (
|
|
111
|
-
var isOpen =
|
|
112
|
-
onExited =
|
|
143
|
+
return /*#__PURE__*/React.createElement(SpotlightTransitionConsumer, null, function (_ref2) {
|
|
144
|
+
var isOpen = _ref2.isOpen,
|
|
145
|
+
onExited = _ref2.onExited;
|
|
113
146
|
return /*#__PURE__*/React.createElement(Portal, {
|
|
114
147
|
zIndex: 701
|
|
115
148
|
}, TargetReplacement ? /*#__PURE__*/React.createElement(NodeResolverSpotlightInner, {
|
|
@@ -143,30 +176,38 @@ var SpotlightInner = /*#__PURE__*/function (_React$Component) {
|
|
|
143
176
|
targetOnClick: targetOnClick,
|
|
144
177
|
targetRadius: targetRadius
|
|
145
178
|
});
|
|
146
|
-
}), TargetReplacement && !replacementElement ? null : /*#__PURE__*/React.createElement(
|
|
179
|
+
}), TargetReplacement && !replacementElement ? null : /*#__PURE__*/React.createElement(Layering, {
|
|
180
|
+
isDisabled: false
|
|
181
|
+
}, fg('platform_dst_onboarding_react_transition_group') ? /*#__PURE__*/React.createElement(ExitingPersistence, {
|
|
182
|
+
appear: true
|
|
183
|
+
}, isOpen && /*#__PURE__*/React.createElement(FadeIn, {
|
|
184
|
+
onFinish: function onFinish(state) {
|
|
185
|
+
state === 'exiting' && onExited();
|
|
186
|
+
},
|
|
187
|
+
duration: "medium"
|
|
188
|
+
}, function (_ref3) {
|
|
189
|
+
var ref = _ref3.ref,
|
|
190
|
+
className = _ref3.className,
|
|
191
|
+
style = _ref3.style;
|
|
192
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
193
|
+
ref: ref
|
|
194
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
195
|
+
,
|
|
196
|
+
className: className
|
|
197
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
198
|
+
,
|
|
199
|
+
style: style
|
|
200
|
+
}, _this2.renderSpotlightDialog({
|
|
201
|
+
animationStyles: {}
|
|
202
|
+
}));
|
|
203
|
+
})) : /*#__PURE__*/React.createElement(Fade, {
|
|
147
204
|
hasEntered: isOpen,
|
|
148
205
|
onExited: onExited
|
|
149
206
|
}, function (animationStyles) {
|
|
150
|
-
return
|
|
151
|
-
isDisabled: false
|
|
152
|
-
}, /*#__PURE__*/React.createElement(SpotlightDialog, {
|
|
153
|
-
testId: "".concat(testId, "--dialog"),
|
|
154
|
-
actions: _this2.props.actions,
|
|
155
|
-
actionsBeforeElement: _this2.props.actionsBeforeElement,
|
|
156
|
-
children: _this2.props.children,
|
|
157
|
-
dialogPlacement: _this2.props.dialogPlacement,
|
|
158
|
-
dialogWidth: _this2.props.dialogWidth,
|
|
159
|
-
footer: _this2.props.footer,
|
|
160
|
-
header: _this2.props.header,
|
|
161
|
-
heading: _this2.props.heading,
|
|
162
|
-
titleId: _this2.props.titleId,
|
|
163
|
-
label: _this2.props.label,
|
|
164
|
-
headingAfterElement: _this2.props.headingAfterElement,
|
|
165
|
-
image: _this2.props.image,
|
|
166
|
-
targetNode: replacementElement || targetNode,
|
|
207
|
+
return _this2.renderSpotlightDialog({
|
|
167
208
|
animationStyles: animationStyles
|
|
168
|
-
})
|
|
169
|
-
}), /*#__PURE__*/React.createElement(ScrollLock, null));
|
|
209
|
+
});
|
|
210
|
+
})), /*#__PURE__*/React.createElement(ScrollLock, null));
|
|
170
211
|
});
|
|
171
212
|
}
|
|
172
213
|
}]);
|
|
@@ -11,6 +11,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
11
11
|
import React, { createContext, PureComponent, startTransition } from 'react';
|
|
12
12
|
import memoizeOne from 'memoize-one';
|
|
13
13
|
import noop from '@atlaskit/ds-lib/noop';
|
|
14
|
+
import { ExitingPersistence, FadeIn } from '@atlaskit/motion';
|
|
14
15
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
16
|
import Portal from '@atlaskit/portal';
|
|
16
17
|
import Blanket from '../styled/blanket';
|
|
@@ -122,14 +123,33 @@ var SpotlightManager = /*#__PURE__*/function (_PureComponent) {
|
|
|
122
123
|
children = _this$props.children,
|
|
123
124
|
Tag = _this$props.component,
|
|
124
125
|
onBlanketClicked = _this$props.onBlanketClicked;
|
|
126
|
+
var isActive = this.state.spotlightCount > 0;
|
|
125
127
|
return /*#__PURE__*/React.createElement(SpotlightStateProvider, {
|
|
126
128
|
value: this.getStateProviderValue(this.state.targets)
|
|
127
129
|
}, /*#__PURE__*/React.createElement(TargetProvider, {
|
|
128
130
|
value: this.getTargetRef
|
|
129
131
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
130
132
|
component: Tag || React.Fragment
|
|
131
|
-
}, /*#__PURE__*/React.createElement(
|
|
132
|
-
|
|
133
|
+
}, fg('platform_dst_onboarding_react_transition_group') ? /*#__PURE__*/React.createElement(ExitingPersistence, null, isActive && /*#__PURE__*/React.createElement(FadeIn, {
|
|
134
|
+
duration: "medium"
|
|
135
|
+
}, function (_ref2) {
|
|
136
|
+
var ref = _ref2.ref,
|
|
137
|
+
className = _ref2.className,
|
|
138
|
+
style = _ref2.style;
|
|
139
|
+
return /*#__PURE__*/React.createElement(Portal, {
|
|
140
|
+
zIndex: 700
|
|
141
|
+
}, /*#__PURE__*/React.createElement(Blanket, {
|
|
142
|
+
ref: ref
|
|
143
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
144
|
+
,
|
|
145
|
+
className: className
|
|
146
|
+
/* eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766 */,
|
|
147
|
+
style: style,
|
|
148
|
+
isTinted: blanketIsTinted,
|
|
149
|
+
onBlanketClicked: onBlanketClicked
|
|
150
|
+
}));
|
|
151
|
+
})) : /*#__PURE__*/React.createElement(Fade, {
|
|
152
|
+
hasEntered: isActive
|
|
133
153
|
}, function (animationStyles) {
|
|
134
154
|
return /*#__PURE__*/React.createElement(Portal, {
|
|
135
155
|
zIndex: 700
|
|
@@ -5,6 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
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; }
|
|
7
7
|
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; }
|
|
8
|
+
import { forwardRef } from 'react';
|
|
8
9
|
// IE11 and Edge: z-index needed because fixed position calculates z-index relative
|
|
9
10
|
// to body instead of nearest stacking context (Portal in our case).
|
|
10
11
|
var blanketStyles = null;
|
|
@@ -19,17 +20,21 @@ var blanketStyles = null;
|
|
|
19
20
|
*
|
|
20
21
|
* @internal
|
|
21
22
|
*/
|
|
22
|
-
var Blanket = function
|
|
23
|
+
var Blanket = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
23
24
|
var isTinted = _ref.isTinted,
|
|
24
25
|
onBlanketClicked = _ref.onBlanketClicked,
|
|
25
|
-
style = _ref.style
|
|
26
|
+
style = _ref.style,
|
|
27
|
+
className = _ref.className;
|
|
26
28
|
return /*#__PURE__*/React.createElement("div", {
|
|
27
|
-
|
|
29
|
+
ref: ref,
|
|
30
|
+
role: "presentation"
|
|
31
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
32
|
+
,
|
|
33
|
+
className: ax(["_1r04idpf _v56414ka _kqsw1n9t _1pby1fw0", className]),
|
|
28
34
|
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
29
35
|
backgroundColor: isTinted ? "var(--ds-blanket, #091E427D)" : 'transparent'
|
|
30
36
|
}),
|
|
31
|
-
onClick: onBlanketClicked
|
|
32
|
-
className: ax(["_1r04idpf _v56414ka _kqsw1n9t _1pby1fw0"])
|
|
37
|
+
onClick: onBlanketClicked
|
|
33
38
|
});
|
|
34
|
-
};
|
|
39
|
+
});
|
|
35
40
|
export default Blanket;
|
|
@@ -1,73 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import { type ComponentType, type ReactNode, type Ref } from 'react';
|
|
6
|
-
import { type Actions } from '../types';
|
|
7
|
-
interface SpotlightCardProps {
|
|
8
|
-
/**
|
|
9
|
-
* Buttons to render in the footer.
|
|
10
|
-
*/
|
|
11
|
-
actions?: Actions;
|
|
12
|
-
/**
|
|
13
|
-
* An optional element rendered to the left of the footer actions.
|
|
14
|
-
*/
|
|
15
|
-
actionsBeforeElement?: ReactNode;
|
|
16
|
-
/**
|
|
17
|
-
* The content of the card.
|
|
18
|
-
*/
|
|
19
|
-
children?: ReactNode;
|
|
20
|
-
/**
|
|
21
|
-
* The container elements rendered by the component.
|
|
22
|
-
*/
|
|
23
|
-
components?: {
|
|
24
|
-
Header?: ComponentType<any>;
|
|
25
|
-
Footer?: ComponentType<any>;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* The heading to be rendered above the body content.
|
|
29
|
-
*/
|
|
30
|
-
heading?: ReactNode;
|
|
31
|
-
/**
|
|
32
|
-
* Specifies the heading level in the document structure.
|
|
33
|
-
* If not specified, level 4 will be applied by default.
|
|
34
|
-
*/
|
|
35
|
-
headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
36
|
-
/**
|
|
37
|
-
* An optional element rendered to the right of the heading, usually used to number steps in a multi-step flow.
|
|
38
|
-
*/
|
|
39
|
-
headingAfterElement?: ReactNode;
|
|
40
|
-
/**
|
|
41
|
-
* The image src to render above the heading.
|
|
42
|
-
*/
|
|
43
|
-
image?: string | ReactNode;
|
|
44
|
-
/**
|
|
45
|
-
* Removes elevation styles if set.
|
|
46
|
-
*/
|
|
47
|
-
isFlat?: boolean;
|
|
48
|
-
/**
|
|
49
|
-
* Specifies the width of the card component. Accepts either a number or the string '100%'.
|
|
50
|
-
* When a number is provided, the width is set in pixels. When '100%' is provided, the width
|
|
51
|
-
* is set to occupy 100% of the parent container's width. Regardless of whether `width` is set,
|
|
52
|
-
* the width is constrained to a minimum width of 160px and a maximum width of 600px.
|
|
53
|
-
*/
|
|
54
|
-
width?: number | '100%';
|
|
55
|
-
/**
|
|
56
|
-
* @deprecated
|
|
57
|
-
* Use `ref` instead.
|
|
58
|
-
*/
|
|
59
|
-
innerRef?: Ref<HTMLDivElement> | null;
|
|
60
|
-
/**
|
|
61
|
-
* A `testId` prop is provided for specified elements,
|
|
62
|
-
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
63
|
-
* serving as a hook for automated tests.
|
|
64
|
-
*/
|
|
65
|
-
testId?: string;
|
|
66
|
-
/**
|
|
67
|
-
* The ID of heading.
|
|
68
|
-
*/
|
|
69
|
-
headingId?: string;
|
|
70
|
-
}
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type SpotlightCardProps } from '../types';
|
|
71
3
|
/**
|
|
72
4
|
* __Spotlight card__
|
|
73
5
|
*
|
|
@@ -53,6 +53,14 @@ 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;
|
|
56
64
|
render(): React.JSX.Element;
|
|
57
65
|
}
|
|
58
66
|
export default SpotlightInner;
|
|
@@ -3,6 +3,7 @@ type BlanketProps = {
|
|
|
3
3
|
isTinted?: boolean;
|
|
4
4
|
style?: React.CSSProperties;
|
|
5
5
|
onBlanketClicked?: () => void;
|
|
6
|
+
className?: string;
|
|
6
7
|
};
|
|
7
8
|
/**
|
|
8
9
|
* __Blanket__
|
|
@@ -15,5 +16,5 @@ type BlanketProps = {
|
|
|
15
16
|
*
|
|
16
17
|
* @internal
|
|
17
18
|
*/
|
|
18
|
-
declare const Blanket: (
|
|
19
|
+
declare const Blanket: import("react").ForwardRefExoticComponent<BlanketProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
19
20
|
export default Blanket;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ComponentType, type MouseEvent, type ReactNode } from 'react';
|
|
1
|
+
import { type ComponentType, type MouseEvent, type ReactNode, type Ref } from 'react';
|
|
2
2
|
import { type CustomThemeButtonProps } from '@atlaskit/button/types';
|
|
3
3
|
interface Action extends Omit<CustomThemeButtonProps, 'children'> {
|
|
4
4
|
key?: string;
|
|
@@ -106,3 +106,67 @@ export interface SpotlightProps {
|
|
|
106
106
|
*/
|
|
107
107
|
titleId?: string;
|
|
108
108
|
}
|
|
109
|
+
export interface SpotlightCardProps {
|
|
110
|
+
/**
|
|
111
|
+
* Buttons to render in the footer.
|
|
112
|
+
*/
|
|
113
|
+
actions?: Actions;
|
|
114
|
+
/**
|
|
115
|
+
* An optional element rendered to the left of the footer actions.
|
|
116
|
+
*/
|
|
117
|
+
actionsBeforeElement?: ReactNode;
|
|
118
|
+
/**
|
|
119
|
+
* The content of the card.
|
|
120
|
+
*/
|
|
121
|
+
children?: ReactNode;
|
|
122
|
+
/**
|
|
123
|
+
* The container elements rendered by the component.
|
|
124
|
+
*/
|
|
125
|
+
components?: {
|
|
126
|
+
Header?: ComponentType<any>;
|
|
127
|
+
Footer?: ComponentType<any>;
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* The heading to be rendered above the body content.
|
|
131
|
+
*/
|
|
132
|
+
heading?: ReactNode;
|
|
133
|
+
/**
|
|
134
|
+
* Specifies the heading level in the document structure.
|
|
135
|
+
* If not specified, level 4 will be applied by default.
|
|
136
|
+
*/
|
|
137
|
+
headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
138
|
+
/**
|
|
139
|
+
* An optional element rendered to the right of the heading, usually used to number steps in a multi-step flow.
|
|
140
|
+
*/
|
|
141
|
+
headingAfterElement?: ReactNode;
|
|
142
|
+
/**
|
|
143
|
+
* The image src to render above the heading.
|
|
144
|
+
*/
|
|
145
|
+
image?: string | ReactNode;
|
|
146
|
+
/**
|
|
147
|
+
* Removes elevation styles if set.
|
|
148
|
+
*/
|
|
149
|
+
isFlat?: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Specifies the width of the card component. Accepts either a number or the string '100%'.
|
|
152
|
+
* When a number is provided, the width is set in pixels. When '100%' is provided, the width
|
|
153
|
+
* is set to occupy 100% of the parent container's width. Regardless of whether `width` is set,
|
|
154
|
+
* the width is constrained to a minimum width of 160px and a maximum width of 600px.
|
|
155
|
+
*/
|
|
156
|
+
width?: number | '100%';
|
|
157
|
+
/**
|
|
158
|
+
* @deprecated
|
|
159
|
+
* Use `ref` instead.
|
|
160
|
+
*/
|
|
161
|
+
innerRef?: Ref<HTMLDivElement> | null;
|
|
162
|
+
/**
|
|
163
|
+
* A `testId` prop is provided for specified elements,
|
|
164
|
+
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
165
|
+
* serving as a hook for automated tests.
|
|
166
|
+
*/
|
|
167
|
+
testId?: string;
|
|
168
|
+
/**
|
|
169
|
+
* The ID of heading.
|
|
170
|
+
*/
|
|
171
|
+
headingId?: string;
|
|
172
|
+
}
|
|
@@ -1,73 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import { type ComponentType, type ReactNode, type Ref } from 'react';
|
|
6
|
-
import { type Actions } from '../types';
|
|
7
|
-
interface SpotlightCardProps {
|
|
8
|
-
/**
|
|
9
|
-
* Buttons to render in the footer.
|
|
10
|
-
*/
|
|
11
|
-
actions?: Actions;
|
|
12
|
-
/**
|
|
13
|
-
* An optional element rendered to the left of the footer actions.
|
|
14
|
-
*/
|
|
15
|
-
actionsBeforeElement?: ReactNode;
|
|
16
|
-
/**
|
|
17
|
-
* The content of the card.
|
|
18
|
-
*/
|
|
19
|
-
children?: ReactNode;
|
|
20
|
-
/**
|
|
21
|
-
* The container elements rendered by the component.
|
|
22
|
-
*/
|
|
23
|
-
components?: {
|
|
24
|
-
Header?: ComponentType<any>;
|
|
25
|
-
Footer?: ComponentType<any>;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* The heading to be rendered above the body content.
|
|
29
|
-
*/
|
|
30
|
-
heading?: ReactNode;
|
|
31
|
-
/**
|
|
32
|
-
* Specifies the heading level in the document structure.
|
|
33
|
-
* If not specified, level 4 will be applied by default.
|
|
34
|
-
*/
|
|
35
|
-
headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
36
|
-
/**
|
|
37
|
-
* An optional element rendered to the right of the heading, usually used to number steps in a multi-step flow.
|
|
38
|
-
*/
|
|
39
|
-
headingAfterElement?: ReactNode;
|
|
40
|
-
/**
|
|
41
|
-
* The image src to render above the heading.
|
|
42
|
-
*/
|
|
43
|
-
image?: string | ReactNode;
|
|
44
|
-
/**
|
|
45
|
-
* Removes elevation styles if set.
|
|
46
|
-
*/
|
|
47
|
-
isFlat?: boolean;
|
|
48
|
-
/**
|
|
49
|
-
* Specifies the width of the card component. Accepts either a number or the string '100%'.
|
|
50
|
-
* When a number is provided, the width is set in pixels. When '100%' is provided, the width
|
|
51
|
-
* is set to occupy 100% of the parent container's width. Regardless of whether `width` is set,
|
|
52
|
-
* the width is constrained to a minimum width of 160px and a maximum width of 600px.
|
|
53
|
-
*/
|
|
54
|
-
width?: number | '100%';
|
|
55
|
-
/**
|
|
56
|
-
* @deprecated
|
|
57
|
-
* Use `ref` instead.
|
|
58
|
-
*/
|
|
59
|
-
innerRef?: Ref<HTMLDivElement> | null;
|
|
60
|
-
/**
|
|
61
|
-
* A `testId` prop is provided for specified elements,
|
|
62
|
-
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
63
|
-
* serving as a hook for automated tests.
|
|
64
|
-
*/
|
|
65
|
-
testId?: string;
|
|
66
|
-
/**
|
|
67
|
-
* The ID of heading.
|
|
68
|
-
*/
|
|
69
|
-
headingId?: string;
|
|
70
|
-
}
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type SpotlightCardProps } from '../types';
|
|
71
3
|
/**
|
|
72
4
|
* __Spotlight card__
|
|
73
5
|
*
|
|
@@ -53,6 +53,14 @@ 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;
|
|
56
64
|
render(): React.JSX.Element;
|
|
57
65
|
}
|
|
58
66
|
export default SpotlightInner;
|
|
@@ -3,6 +3,7 @@ type BlanketProps = {
|
|
|
3
3
|
isTinted?: boolean;
|
|
4
4
|
style?: React.CSSProperties;
|
|
5
5
|
onBlanketClicked?: () => void;
|
|
6
|
+
className?: string;
|
|
6
7
|
};
|
|
7
8
|
/**
|
|
8
9
|
* __Blanket__
|
|
@@ -15,5 +16,5 @@ type BlanketProps = {
|
|
|
15
16
|
*
|
|
16
17
|
* @internal
|
|
17
18
|
*/
|
|
18
|
-
declare const Blanket: (
|
|
19
|
+
declare const Blanket: import("react").ForwardRefExoticComponent<BlanketProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
19
20
|
export default Blanket;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ComponentType, type MouseEvent, type ReactNode } from 'react';
|
|
1
|
+
import { type ComponentType, type MouseEvent, type ReactNode, type Ref } from 'react';
|
|
2
2
|
import { type CustomThemeButtonProps } from '@atlaskit/button/types';
|
|
3
3
|
interface Action extends Omit<CustomThemeButtonProps, 'children'> {
|
|
4
4
|
key?: string;
|
|
@@ -106,3 +106,67 @@ export interface SpotlightProps {
|
|
|
106
106
|
*/
|
|
107
107
|
titleId?: string;
|
|
108
108
|
}
|
|
109
|
+
export interface SpotlightCardProps {
|
|
110
|
+
/**
|
|
111
|
+
* Buttons to render in the footer.
|
|
112
|
+
*/
|
|
113
|
+
actions?: Actions;
|
|
114
|
+
/**
|
|
115
|
+
* An optional element rendered to the left of the footer actions.
|
|
116
|
+
*/
|
|
117
|
+
actionsBeforeElement?: ReactNode;
|
|
118
|
+
/**
|
|
119
|
+
* The content of the card.
|
|
120
|
+
*/
|
|
121
|
+
children?: ReactNode;
|
|
122
|
+
/**
|
|
123
|
+
* The container elements rendered by the component.
|
|
124
|
+
*/
|
|
125
|
+
components?: {
|
|
126
|
+
Header?: ComponentType<any>;
|
|
127
|
+
Footer?: ComponentType<any>;
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* The heading to be rendered above the body content.
|
|
131
|
+
*/
|
|
132
|
+
heading?: ReactNode;
|
|
133
|
+
/**
|
|
134
|
+
* Specifies the heading level in the document structure.
|
|
135
|
+
* If not specified, level 4 will be applied by default.
|
|
136
|
+
*/
|
|
137
|
+
headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
138
|
+
/**
|
|
139
|
+
* An optional element rendered to the right of the heading, usually used to number steps in a multi-step flow.
|
|
140
|
+
*/
|
|
141
|
+
headingAfterElement?: ReactNode;
|
|
142
|
+
/**
|
|
143
|
+
* The image src to render above the heading.
|
|
144
|
+
*/
|
|
145
|
+
image?: string | ReactNode;
|
|
146
|
+
/**
|
|
147
|
+
* Removes elevation styles if set.
|
|
148
|
+
*/
|
|
149
|
+
isFlat?: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Specifies the width of the card component. Accepts either a number or the string '100%'.
|
|
152
|
+
* When a number is provided, the width is set in pixels. When '100%' is provided, the width
|
|
153
|
+
* is set to occupy 100% of the parent container's width. Regardless of whether `width` is set,
|
|
154
|
+
* the width is constrained to a minimum width of 160px and a maximum width of 600px.
|
|
155
|
+
*/
|
|
156
|
+
width?: number | '100%';
|
|
157
|
+
/**
|
|
158
|
+
* @deprecated
|
|
159
|
+
* Use `ref` instead.
|
|
160
|
+
*/
|
|
161
|
+
innerRef?: Ref<HTMLDivElement> | null;
|
|
162
|
+
/**
|
|
163
|
+
* A `testId` prop is provided for specified elements,
|
|
164
|
+
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
165
|
+
* serving as a hook for automated tests.
|
|
166
|
+
*/
|
|
167
|
+
testId?: string;
|
|
168
|
+
/**
|
|
169
|
+
* The ID of heading.
|
|
170
|
+
*/
|
|
171
|
+
headingId?: string;
|
|
172
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/onboarding",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.2.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/"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"runReact18": true
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@atlaskit/button": "^23.
|
|
41
|
+
"@atlaskit/button": "^23.2.0",
|
|
42
42
|
"@atlaskit/css": "^0.10.0",
|
|
43
43
|
"@atlaskit/ds-lib": "^4.0.0",
|
|
44
44
|
"@atlaskit/heading": "^5.2.0",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
49
49
|
"@atlaskit/popper": "^7.0.0",
|
|
50
50
|
"@atlaskit/portal": "^5.1.0",
|
|
51
|
-
"@atlaskit/primitives": "^14.
|
|
52
|
-
"@atlaskit/tokens": "^4.
|
|
51
|
+
"@atlaskit/primitives": "^14.8.0",
|
|
52
|
+
"@atlaskit/tokens": "^4.9.0",
|
|
53
53
|
"@babel/runtime": "^7.0.0",
|
|
54
54
|
"@compiled/react": "^0.18.3",
|
|
55
55
|
"bind-event-listener": "^3.0.0",
|
|
@@ -96,6 +96,9 @@
|
|
|
96
96
|
},
|
|
97
97
|
"platform_fix_component_state_update_for_suspense": {
|
|
98
98
|
"type": "boolean"
|
|
99
|
+
},
|
|
100
|
+
"platform_dst_onboarding_react_transition_group": {
|
|
101
|
+
"type": "boolean"
|
|
99
102
|
}
|
|
100
103
|
},
|
|
101
104
|
"techstack": {
|