@atlaskit/spotlight 0.3.2 → 0.3.4
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 +18 -0
- package/dist/cjs/controllers/context.js +17 -2
- package/dist/cjs/ui/actions/index.js +1 -1
- package/dist/cjs/ui/body/index.js +1 -1
- package/dist/cjs/ui/card/caret/index.compiled.css +4 -3
- package/dist/cjs/ui/card/caret/index.js +12 -12
- package/dist/cjs/ui/card/index.js +1 -1
- package/dist/cjs/ui/controls/index.js +1 -1
- package/dist/cjs/ui/dismiss-control/index.js +11 -5
- package/dist/cjs/ui/footer/index.js +1 -1
- package/dist/cjs/ui/header/index.js +1 -1
- package/dist/cjs/ui/headline/index.js +5 -1
- package/dist/cjs/ui/media/index.js +1 -1
- package/dist/cjs/ui/popover-content/index.compiled.css +1 -5
- package/dist/cjs/ui/popover-content/index.js +15 -10
- package/dist/cjs/ui/popover-provider/index.js +1 -1
- package/dist/cjs/ui/popover-target/index.js +1 -1
- package/dist/cjs/ui/primary-action/index.js +4 -2
- package/dist/cjs/ui/secondary-action/index.js +4 -2
- package/dist/cjs/ui/show-more-control/index.js +1 -1
- package/dist/cjs/ui/step-count/index.js +4 -2
- package/dist/es2019/controllers/context.js +14 -4
- package/dist/es2019/ui/actions/index.js +1 -1
- package/dist/es2019/ui/body/index.js +1 -1
- package/dist/es2019/ui/card/caret/index.compiled.css +4 -3
- package/dist/es2019/ui/card/caret/index.js +12 -12
- package/dist/es2019/ui/card/index.js +1 -1
- package/dist/es2019/ui/controls/index.js +1 -1
- package/dist/es2019/ui/dismiss-control/index.js +9 -4
- package/dist/es2019/ui/footer/index.js +1 -1
- package/dist/es2019/ui/header/index.js +1 -1
- package/dist/es2019/ui/headline/index.js +7 -2
- package/dist/es2019/ui/media/index.js +1 -1
- package/dist/es2019/ui/popover-content/index.compiled.css +1 -5
- package/dist/es2019/ui/popover-content/index.js +20 -13
- package/dist/es2019/ui/popover-provider/index.js +1 -1
- package/dist/es2019/ui/popover-target/index.js +1 -1
- package/dist/es2019/ui/primary-action/index.js +3 -1
- package/dist/es2019/ui/secondary-action/index.js +3 -1
- package/dist/es2019/ui/show-more-control/index.js +1 -1
- package/dist/es2019/ui/step-count/index.js +3 -2
- package/dist/esm/controllers/context.js +18 -3
- package/dist/esm/ui/actions/index.js +1 -1
- package/dist/esm/ui/body/index.js +1 -1
- package/dist/esm/ui/card/caret/index.compiled.css +4 -3
- package/dist/esm/ui/card/caret/index.js +12 -12
- package/dist/esm/ui/card/index.js +1 -1
- package/dist/esm/ui/controls/index.js +1 -1
- package/dist/esm/ui/dismiss-control/index.js +11 -5
- package/dist/esm/ui/footer/index.js +1 -1
- package/dist/esm/ui/header/index.js +1 -1
- package/dist/esm/ui/headline/index.js +6 -2
- package/dist/esm/ui/media/index.js +1 -1
- package/dist/esm/ui/popover-content/index.compiled.css +1 -5
- package/dist/esm/ui/popover-content/index.js +15 -10
- package/dist/esm/ui/popover-provider/index.js +1 -1
- package/dist/esm/ui/popover-target/index.js +1 -1
- package/dist/esm/ui/primary-action/index.js +4 -2
- package/dist/esm/ui/secondary-action/index.js +4 -2
- package/dist/esm/ui/show-more-control/index.js +1 -1
- package/dist/esm/ui/step-count/index.js +3 -2
- package/dist/types/controllers/context.d.ts +4 -0
- package/dist/types/ui/dismiss-control/index.d.ts +8 -0
- package/dist/types/ui/popover-content/index.d.ts +7 -1
- package/dist/types/ui/primary-action/index.d.ts +4 -0
- package/dist/types/ui/secondary-action/index.d.ts +4 -0
- package/dist/types-ts4.5/controllers/context.d.ts +4 -0
- package/dist/types-ts4.5/ui/dismiss-control/index.d.ts +8 -0
- package/dist/types-ts4.5/ui/popover-content/index.d.ts +7 -1
- package/dist/types-ts4.5/ui/primary-action/index.d.ts +4 -0
- package/dist/types-ts4.5/ui/secondary-action/index.d.ts +4 -0
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/spotlight
|
|
2
2
|
|
|
3
|
+
## 0.3.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`cc92031710191`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cc92031710191) -
|
|
8
|
+
`SpotlightDismissControl` now applies `autofocus` when it is mounted.
|
|
9
|
+
|
|
10
|
+
## 0.3.3
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`bd8e43d78afb8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bd8e43d78afb8) - -
|
|
15
|
+
Add `role="dialog"` to PopoverContent. `aria-labelledby` is internally managed by
|
|
16
|
+
`SpotlightContext`.
|
|
17
|
+
- Add `aria-label='Dismiss'` to `SpotlightDismissControl`.
|
|
18
|
+
- Add `aria-label'` prop to `SpotlightPrimaryAction`.
|
|
19
|
+
- Add `aria-label'` prop to `SpotlightSecondaryAction`.
|
|
20
|
+
|
|
3
21
|
## 0.3.2
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* context.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* context.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -19,20 +19,35 @@ var SpotlightContext = exports.SpotlightContext = /*#__PURE__*/(0, _react.create
|
|
|
19
19
|
placement: 'bottom-end',
|
|
20
20
|
setPlacement: function setPlacement() {
|
|
21
21
|
return undefined;
|
|
22
|
+
},
|
|
23
|
+
heading: {
|
|
24
|
+
id: '',
|
|
25
|
+
setId: function setId() {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
22
28
|
}
|
|
23
29
|
});
|
|
24
30
|
|
|
25
31
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
26
32
|
var SpotlightContextProvider = exports.SpotlightContextProvider = function SpotlightContextProvider(_ref) {
|
|
27
33
|
var children = _ref.children;
|
|
34
|
+
var id = (0, _react.useId)();
|
|
28
35
|
var _useState = (0, _react.useState)('bottom-end'),
|
|
29
36
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
30
37
|
placement = _useState2[0],
|
|
31
38
|
setPlacement = _useState2[1];
|
|
39
|
+
var _useState3 = (0, _react.useState)("".concat(id, "-heading")),
|
|
40
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
41
|
+
headingId = _useState4[0],
|
|
42
|
+
setHeadingId = _useState4[1];
|
|
32
43
|
return /*#__PURE__*/React.createElement(SpotlightContext.Provider, {
|
|
33
44
|
value: {
|
|
34
45
|
placement: placement,
|
|
35
|
-
setPlacement: setPlacement
|
|
46
|
+
setPlacement: setPlacement,
|
|
47
|
+
heading: {
|
|
48
|
+
id: headingId,
|
|
49
|
+
setId: setHeadingId
|
|
50
|
+
}
|
|
36
51
|
}
|
|
37
52
|
}, children);
|
|
38
53
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
._1bsbo7ao{width:15px}
|
|
2
|
-
._1eint94y{border-end-end-radius:1px}
|
|
3
2
|
._1pby1fw0{z-index:700}
|
|
4
|
-
._1s1gt94y{border-start-start-radius:1px}
|
|
5
3
|
._1yxnt94y{border-end-start-radius:1px}
|
|
6
4
|
._4t3io7ao{height:15px}
|
|
7
|
-
._5fbct94y{border-start-end-radius:1px}
|
|
8
5
|
._bfhkcdhy{background-color:var(--ds-background-neutral-bold,#44546f)}
|
|
9
6
|
._kqswh2mm{position:relative}
|
|
7
|
+
._mkrzmhja{clip-path:polygon(0 0,100% 100%,0 100%)}
|
|
8
|
+
._t9ec1hke{transform:rotate(135deg)}
|
|
9
|
+
._t9ec71a3{transform:rotate(315deg)}
|
|
10
|
+
._t9ecebzf{transform:rotate(225deg)}
|
|
10
11
|
._t9ecjyd4{transform:rotate(45deg)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* index.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
@@ -13,17 +13,17 @@ var _runtime = require("@compiled/react/runtime");
|
|
|
13
13
|
var _context = require("../../../controllers/context");
|
|
14
14
|
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); }
|
|
15
15
|
var styles = {
|
|
16
|
-
root: "
|
|
17
|
-
'top-start': "
|
|
18
|
-
'top-center': "
|
|
19
|
-
'top-end': "
|
|
20
|
-
'bottom-start': "
|
|
21
|
-
'bottom-center': "
|
|
22
|
-
'bottom-end': "
|
|
23
|
-
'right-start': "
|
|
24
|
-
'right-end': "
|
|
25
|
-
'left-start': "
|
|
26
|
-
'left-end': "
|
|
16
|
+
root: "_bfhkcdhy _1yxnt94y _mkrzmhja _4t3io7ao _kqswh2mm _1bsbo7ao _1pby1fw0",
|
|
17
|
+
'top-start': "_t9ec71a3",
|
|
18
|
+
'top-center': "_t9ec71a3",
|
|
19
|
+
'top-end': "_t9ec71a3",
|
|
20
|
+
'bottom-start': "_t9ec1hke",
|
|
21
|
+
'bottom-center': "_t9ec1hke",
|
|
22
|
+
'bottom-end': "_t9ec1hke",
|
|
23
|
+
'right-start': "_t9ecjyd4",
|
|
24
|
+
'right-end': "_t9ecjyd4",
|
|
25
|
+
'left-start': "_t9ecebzf",
|
|
26
|
+
'left-end': "_t9ecebzf"
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
29
29
|
* __Caret__
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* index.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -24,13 +24,19 @@ var styles = {
|
|
|
24
24
|
*
|
|
25
25
|
*/
|
|
26
26
|
var SpotlightDismissControl = exports.SpotlightDismissControl = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
27
|
-
var
|
|
27
|
+
var _ref$autoFocus = _ref.autoFocus,
|
|
28
|
+
autoFocus = _ref$autoFocus === void 0 ? true : _ref$autoFocus,
|
|
29
|
+
onClick = _ref.onClick,
|
|
28
30
|
testId = _ref.testId;
|
|
29
|
-
return /*#__PURE__*/React.createElement(_compiled.Pressable
|
|
30
|
-
|
|
31
|
+
return /*#__PURE__*/React.createElement(_compiled.Pressable
|
|
32
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus -- VERIFIED: autoFocus moving to first focusable element on non-modal modal dialog.
|
|
33
|
+
, {
|
|
34
|
+
autoFocus: autoFocus,
|
|
31
35
|
onClick: onClick,
|
|
32
36
|
ref: ref,
|
|
33
|
-
testId: testId
|
|
37
|
+
testId: testId,
|
|
38
|
+
xcss: styles.root,
|
|
39
|
+
"aria-label": "Dismiss"
|
|
34
40
|
}, /*#__PURE__*/React.createElement(_cross.default, {
|
|
35
41
|
label: "Close"
|
|
36
42
|
}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* index.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -11,6 +11,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
var React = _react;
|
|
12
12
|
var _runtime = require("@compiled/react/runtime");
|
|
13
13
|
var _heading = _interopRequireDefault(require("@atlaskit/heading"));
|
|
14
|
+
var _context = require("../../controllers/context");
|
|
14
15
|
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); }
|
|
15
16
|
/**
|
|
16
17
|
* __SpotlightHeadline__
|
|
@@ -21,7 +22,10 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
21
22
|
var SpotlightHeadline = exports.SpotlightHeadline = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
22
23
|
var children = _ref.children,
|
|
23
24
|
testId = _ref.testId;
|
|
25
|
+
var _useContext = (0, _react.useContext)(_context.SpotlightContext),
|
|
26
|
+
heading = _useContext.heading;
|
|
24
27
|
return /*#__PURE__*/React.createElement(_heading.default, {
|
|
28
|
+
id: heading.id,
|
|
25
29
|
ref: ref,
|
|
26
30
|
testId: testId,
|
|
27
31
|
size: "xsmall"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* index.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
@@ -16,10 +16,6 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
16
16
|
var styles = {
|
|
17
17
|
root: "_1pby1fw0"
|
|
18
18
|
};
|
|
19
|
-
var visibilityStyles = {
|
|
20
|
-
visible: "_lcxv1wug _3um0ewfl",
|
|
21
|
-
hidden: "_lcxvglyw _3um015vq"
|
|
22
|
-
};
|
|
23
19
|
|
|
24
20
|
/**
|
|
25
21
|
* The `transform: rotate(45deg);` styles used to rotate the `Caret` component result in the corners of
|
|
@@ -58,10 +54,11 @@ var PopoverContent = exports.PopoverContent = function PopoverContent(_ref) {
|
|
|
58
54
|
var children = _ref.children,
|
|
59
55
|
placement = _ref.placement,
|
|
60
56
|
_ref$isVisible = _ref.isVisible,
|
|
61
|
-
isVisible = _ref$isVisible === void 0 ? true : _ref$isVisible
|
|
57
|
+
isVisible = _ref$isVisible === void 0 ? true : _ref$isVisible,
|
|
58
|
+
testId = _ref.testId;
|
|
62
59
|
var _useContext = (0, _react.useContext)(_context.SpotlightContext),
|
|
63
|
-
setPlacement = _useContext.setPlacement
|
|
64
|
-
|
|
60
|
+
setPlacement = _useContext.setPlacement,
|
|
61
|
+
heading = _useContext.heading;
|
|
65
62
|
(0, _react.useEffect)(function () {
|
|
66
63
|
setPlacement(placement);
|
|
67
64
|
}, [placement, setPlacement]);
|
|
@@ -71,10 +68,18 @@ var PopoverContent = exports.PopoverContent = function PopoverContent(_ref) {
|
|
|
71
68
|
}, function (_ref2) {
|
|
72
69
|
var ref = _ref2.ref,
|
|
73
70
|
style = _ref2.style;
|
|
71
|
+
if (!isVisible) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
74
|
return /*#__PURE__*/React.createElement("div", {
|
|
75
|
-
|
|
75
|
+
role: "dialog",
|
|
76
|
+
"data-testid": testId,
|
|
77
|
+
"aria-labelledby": heading.id,
|
|
78
|
+
ref: ref
|
|
79
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
80
|
+
,
|
|
76
81
|
style: style,
|
|
77
|
-
className: (0, _runtime.ax)([styles.root
|
|
82
|
+
className: (0, _runtime.ax)([styles.root])
|
|
78
83
|
}, children);
|
|
79
84
|
});
|
|
80
85
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* index.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
@@ -23,10 +23,12 @@ var styles = {
|
|
|
23
23
|
*
|
|
24
24
|
*/
|
|
25
25
|
var SpotlightPrimaryAction = exports.SpotlightPrimaryAction = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
26
|
-
var
|
|
26
|
+
var ariaLabel = _ref['aria-label'],
|
|
27
|
+
onClick = _ref.onClick,
|
|
27
28
|
children = _ref.children,
|
|
28
29
|
testId = _ref.testId;
|
|
29
30
|
return /*#__PURE__*/React.createElement(_compiled.Pressable, {
|
|
31
|
+
"aria-label": ariaLabel,
|
|
30
32
|
ref: ref,
|
|
31
33
|
testId: testId,
|
|
32
34
|
xcss: styles.root,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* index.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
@@ -23,10 +23,12 @@ var styles = {
|
|
|
23
23
|
*
|
|
24
24
|
*/
|
|
25
25
|
var SpotlightSecondaryAction = exports.SpotlightSecondaryAction = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
26
|
-
var
|
|
26
|
+
var ariaLabel = _ref['aria-label'],
|
|
27
|
+
onClick = _ref.onClick,
|
|
27
28
|
children = _ref.children,
|
|
28
29
|
testId = _ref.testId;
|
|
29
30
|
return /*#__PURE__*/React.createElement(_compiled.Pressable, {
|
|
31
|
+
"aria-label": ariaLabel,
|
|
30
32
|
ref: ref,
|
|
31
33
|
testId: testId,
|
|
32
34
|
xcss: styles.root,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
/* index.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
5
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
6
|
Object.defineProperty(exports, "__esModule", {
|
|
6
7
|
value: true
|
|
@@ -11,6 +12,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
12
|
var React = _react;
|
|
12
13
|
var _runtime = require("@compiled/react/runtime");
|
|
13
14
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
15
|
+
var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
|
|
14
16
|
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); }
|
|
15
17
|
var styles = {
|
|
16
18
|
root: "_1ul91ris"
|
|
@@ -29,5 +31,5 @@ var SpotlightStepCount = exports.SpotlightStepCount = /*#__PURE__*/(0, _react.fo
|
|
|
29
31
|
}, /*#__PURE__*/React.createElement(_compiled.Text, {
|
|
30
32
|
ref: ref,
|
|
31
33
|
testId: testId
|
|
32
|
-
}, children));
|
|
34
|
+
}, children, " ", /*#__PURE__*/React.createElement(_visuallyHidden.default, null, "steps")));
|
|
33
35
|
});
|
|
@@ -1,25 +1,35 @@
|
|
|
1
|
-
/* context.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* context.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
-
import { createContext, useState } from 'react';
|
|
4
|
+
import { createContext, useId, useState } from 'react';
|
|
5
5
|
|
|
6
6
|
// eslint-disable-next-line @repo/internal/react/consistent-types-definitions
|
|
7
7
|
|
|
8
8
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
9
9
|
export const SpotlightContext = /*#__PURE__*/createContext({
|
|
10
10
|
placement: 'bottom-end',
|
|
11
|
-
setPlacement: () => undefined
|
|
11
|
+
setPlacement: () => undefined,
|
|
12
|
+
heading: {
|
|
13
|
+
id: '',
|
|
14
|
+
setId: () => undefined
|
|
15
|
+
}
|
|
12
16
|
});
|
|
13
17
|
|
|
14
18
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
15
19
|
export const SpotlightContextProvider = ({
|
|
16
20
|
children
|
|
17
21
|
}) => {
|
|
22
|
+
const id = useId();
|
|
18
23
|
const [placement, setPlacement] = useState('bottom-end');
|
|
24
|
+
const [headingId, setHeadingId] = useState(`${id}-heading`);
|
|
19
25
|
return /*#__PURE__*/React.createElement(SpotlightContext.Provider, {
|
|
20
26
|
value: {
|
|
21
27
|
placement,
|
|
22
|
-
setPlacement
|
|
28
|
+
setPlacement,
|
|
29
|
+
heading: {
|
|
30
|
+
id: headingId,
|
|
31
|
+
setId: setHeadingId
|
|
32
|
+
}
|
|
23
33
|
}
|
|
24
34
|
}, children);
|
|
25
35
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
._1bsbo7ao{width:15px}
|
|
2
|
-
._1eint94y{border-end-end-radius:1px}
|
|
3
2
|
._1pby1fw0{z-index:700}
|
|
4
|
-
._1s1gt94y{border-start-start-radius:1px}
|
|
5
3
|
._1yxnt94y{border-end-start-radius:1px}
|
|
6
4
|
._4t3io7ao{height:15px}
|
|
7
|
-
._5fbct94y{border-start-end-radius:1px}
|
|
8
5
|
._bfhkcdhy{background-color:var(--ds-background-neutral-bold,#44546f)}
|
|
9
6
|
._kqswh2mm{position:relative}
|
|
7
|
+
._mkrzmhja{clip-path:polygon(0 0,100% 100%,0 100%)}
|
|
8
|
+
._t9ec1hke{transform:rotate(135deg)}
|
|
9
|
+
._t9ec71a3{transform:rotate(315deg)}
|
|
10
|
+
._t9ecebzf{transform:rotate(225deg)}
|
|
10
11
|
._t9ecjyd4{transform:rotate(45deg)}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
/* index.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
import "./index.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import { forwardRef, useContext } from 'react';
|
|
6
6
|
import { SpotlightContext } from '../../../controllers/context';
|
|
7
7
|
const styles = {
|
|
8
|
-
root: "
|
|
9
|
-
'top-start': "
|
|
10
|
-
'top-center': "
|
|
11
|
-
'top-end': "
|
|
12
|
-
'bottom-start': "
|
|
13
|
-
'bottom-center': "
|
|
14
|
-
'bottom-end': "
|
|
15
|
-
'right-start': "
|
|
16
|
-
'right-end': "
|
|
17
|
-
'left-start': "
|
|
18
|
-
'left-end': "
|
|
8
|
+
root: "_bfhkcdhy _1yxnt94y _mkrzmhja _4t3io7ao _kqswh2mm _1bsbo7ao _1pby1fw0",
|
|
9
|
+
'top-start': "_t9ec71a3",
|
|
10
|
+
'top-center': "_t9ec71a3",
|
|
11
|
+
'top-end': "_t9ec71a3",
|
|
12
|
+
'bottom-start': "_t9ec1hke",
|
|
13
|
+
'bottom-center': "_t9ec1hke",
|
|
14
|
+
'bottom-end': "_t9ec1hke",
|
|
15
|
+
'right-start': "_t9ecjyd4",
|
|
16
|
+
'right-end': "_t9ecjyd4",
|
|
17
|
+
'left-start': "_t9ecebzf",
|
|
18
|
+
'left-end': "_t9ecebzf"
|
|
19
19
|
};
|
|
20
20
|
/**
|
|
21
21
|
* __Caret__
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* index.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
import "./index.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
@@ -15,14 +15,19 @@ const styles = {
|
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
17
|
export const SpotlightDismissControl = /*#__PURE__*/forwardRef(({
|
|
18
|
+
autoFocus = true,
|
|
18
19
|
onClick,
|
|
19
20
|
testId
|
|
20
21
|
}, ref) => {
|
|
21
|
-
return /*#__PURE__*/React.createElement(Pressable
|
|
22
|
-
|
|
22
|
+
return /*#__PURE__*/React.createElement(Pressable
|
|
23
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus -- VERIFIED: autoFocus moving to first focusable element on non-modal modal dialog.
|
|
24
|
+
, {
|
|
25
|
+
autoFocus: autoFocus,
|
|
23
26
|
onClick: onClick,
|
|
24
27
|
ref: ref,
|
|
25
|
-
testId: testId
|
|
28
|
+
testId: testId,
|
|
29
|
+
xcss: styles.root,
|
|
30
|
+
"aria-label": "Dismiss"
|
|
26
31
|
}, /*#__PURE__*/React.createElement(CrossIcon, {
|
|
27
32
|
label: "Close"
|
|
28
33
|
}));
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
/* index.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
-
import { forwardRef } from 'react';
|
|
4
|
+
import { forwardRef, useContext } from 'react';
|
|
5
5
|
import Heading from '@atlaskit/heading';
|
|
6
|
+
import { SpotlightContext } from '../../controllers/context';
|
|
6
7
|
/**
|
|
7
8
|
* __SpotlightHeadline__
|
|
8
9
|
*
|
|
@@ -13,7 +14,11 @@ export const SpotlightHeadline = /*#__PURE__*/forwardRef(({
|
|
|
13
14
|
children,
|
|
14
15
|
testId
|
|
15
16
|
}, ref) => {
|
|
17
|
+
const {
|
|
18
|
+
heading
|
|
19
|
+
} = useContext(SpotlightContext);
|
|
16
20
|
return /*#__PURE__*/React.createElement(Heading, {
|
|
21
|
+
id: heading.id,
|
|
17
22
|
ref: ref,
|
|
18
23
|
testId: testId,
|
|
19
24
|
size: "xsmall"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* index.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
import "./index.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
@@ -8,10 +8,6 @@ import { SpotlightContext } from '../../controllers/context';
|
|
|
8
8
|
const styles = {
|
|
9
9
|
root: "_1pby1fw0"
|
|
10
10
|
};
|
|
11
|
-
const visibilityStyles = {
|
|
12
|
-
visible: "_lcxv1wug _3um0ewfl",
|
|
13
|
-
hidden: "_lcxvglyw _3um015vq"
|
|
14
|
-
};
|
|
15
11
|
|
|
16
12
|
/**
|
|
17
13
|
* The `transform: rotate(45deg);` styles used to rotate the `Caret` component result in the corners of
|
|
@@ -49,12 +45,13 @@ const popperPlacementMap = {
|
|
|
49
45
|
export const PopoverContent = ({
|
|
50
46
|
children,
|
|
51
47
|
placement,
|
|
52
|
-
isVisible = true
|
|
48
|
+
isVisible = true,
|
|
49
|
+
testId
|
|
53
50
|
}) => {
|
|
54
51
|
const {
|
|
55
|
-
setPlacement
|
|
52
|
+
setPlacement,
|
|
53
|
+
heading
|
|
56
54
|
} = useContext(SpotlightContext);
|
|
57
|
-
const visibility = isVisible ? 'visible' : 'hidden';
|
|
58
55
|
useEffect(() => {
|
|
59
56
|
setPlacement(placement);
|
|
60
57
|
}, [placement, setPlacement]);
|
|
@@ -64,9 +61,19 @@ export const PopoverContent = ({
|
|
|
64
61
|
}, ({
|
|
65
62
|
ref,
|
|
66
63
|
style
|
|
67
|
-
}) =>
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
64
|
+
}) => {
|
|
65
|
+
if (!isVisible) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
69
|
+
role: "dialog",
|
|
70
|
+
"data-testid": testId,
|
|
71
|
+
"aria-labelledby": heading.id,
|
|
72
|
+
ref: ref
|
|
73
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
74
|
+
,
|
|
75
|
+
style: style,
|
|
76
|
+
className: ax([styles.root])
|
|
77
|
+
}, children);
|
|
78
|
+
});
|
|
72
79
|
};
|