@atlaskit/spotlight 0.3.1 → 0.3.3
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 +19 -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.js +3 -1
- package/dist/cjs/ui/card/index.compiled.css +1 -0
- package/dist/cjs/ui/card/index.js +3 -1
- package/dist/cjs/ui/controls/index.js +1 -1
- package/dist/cjs/ui/dismiss-control/index.js +2 -1
- 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.js +13 -4
- 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.js +3 -1
- package/dist/es2019/ui/card/index.compiled.css +1 -0
- package/dist/es2019/ui/card/index.js +3 -1
- package/dist/es2019/ui/controls/index.js +1 -1
- package/dist/es2019/ui/dismiss-control/index.js +2 -1
- 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.js +13 -4
- 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.js +3 -1
- package/dist/esm/ui/card/index.compiled.css +1 -0
- package/dist/esm/ui/card/index.js +3 -1
- package/dist/esm/ui/controls/index.js +1 -1
- package/dist/esm/ui/dismiss-control/index.js +2 -1
- 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.js +13 -4
- 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/index.d.ts +1 -0
- package/dist/types/types.d.ts +1 -1
- 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/index.d.ts +1 -0
- package/dist/types-ts4.5/types.d.ts +1 -1
- 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/offerings.json +33 -0
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/spotlight
|
|
2
2
|
|
|
3
|
+
## 0.3.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`bd8e43d78afb8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bd8e43d78afb8) - -
|
|
8
|
+
Add `role="dialog"` to PopoverContent. `aria-labelledby` is internally managed by
|
|
9
|
+
`SpotlightContext`.
|
|
10
|
+
- Add `aria-label='Dismiss'` to `SpotlightDismissControl`.
|
|
11
|
+
- Add `aria-label'` prop to `SpotlightPrimaryAction`.
|
|
12
|
+
- Add `aria-label'` prop to `SpotlightSecondaryAction`.
|
|
13
|
+
|
|
14
|
+
## 0.3.2
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [`ec2250eef3ec9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ec2250eef3ec9) -
|
|
19
|
+
Spotlight now accepts `top-center` and `bottom-center` placements to ensure SpotlightCard content
|
|
20
|
+
can be seen on small viewports.
|
|
21
|
+
|
|
3
22
|
## 0.3.1
|
|
4
23
|
|
|
5
24
|
### 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,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");
|
|
@@ -15,8 +15,10 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
15
15
|
var styles = {
|
|
16
16
|
root: "_kqswh2mm _1pby1fw0 _1bsbo7ao _4t3io7ao _t9ecjyd4 _bfhkcdhy",
|
|
17
17
|
'top-start': "_1eint94y",
|
|
18
|
+
'top-center': "_1eint94y",
|
|
18
19
|
'top-end': "_1eint94y",
|
|
19
20
|
'bottom-start': "_1s1gt94y",
|
|
21
|
+
'bottom-center': "_1s1gt94y",
|
|
20
22
|
'bottom-end': "_1s1gt94y",
|
|
21
23
|
'right-start': "_1yxnt94y",
|
|
22
24
|
'right-end': "_1yxnt94y",
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
._16qs9g9j{box-shadow:var(--ds-shadow-overflow,0 0 8px #091e4228,0 0 1px #091e421e)}
|
|
6
6
|
._1bsbaq3k{width:295px}
|
|
7
7
|
._1e0212x7{inset-inline-start:var(--ds-space-075,6px)}
|
|
8
|
+
._1e021qz4{inset-inline-start:-140px}
|
|
8
9
|
._1e02c7mi{inset-inline-start:var(--ds-space-negative-250,-20px)}
|
|
9
10
|
._1e0c1txw{display:flex}
|
|
10
11
|
._1q51u2gc{padding-block-start:var(--ds-space-100,8px)}
|
|
@@ -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");
|
|
@@ -21,10 +21,12 @@ var styles = {
|
|
|
21
21
|
};
|
|
22
22
|
var placementStyles = {
|
|
23
23
|
'top-start': "_u7co12x7 _rjxpc7mi",
|
|
24
|
+
'top-center': "_u7co12x7 _1e021qz4",
|
|
24
25
|
'top-end': "_u7co12x7 _1e02c7mi",
|
|
25
26
|
'right-start': "_1e0212x7 _u7comgjw",
|
|
26
27
|
'right-end': "_1e0212x7 _152tmgjw",
|
|
27
28
|
'bottom-start': "_152t12x7 _rjxpc7mi",
|
|
29
|
+
'bottom-center': "_152t12x7 _1e021qz4",
|
|
28
30
|
'bottom-end': "_152t12x7 _1e02c7mi",
|
|
29
31
|
'left-start': "_rjxp12x7 _u7comgjw",
|
|
30
32
|
'left-end': "_rjxp12x7 _152tmgjw"
|
|
@@ -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");
|
|
@@ -27,6 +27,7 @@ var SpotlightDismissControl = exports.SpotlightDismissControl = /*#__PURE__*/(0,
|
|
|
27
27
|
var onClick = _ref.onClick,
|
|
28
28
|
testId = _ref.testId;
|
|
29
29
|
return /*#__PURE__*/React.createElement(_compiled.Pressable, {
|
|
30
|
+
"aria-label": "Dismiss",
|
|
30
31
|
xcss: styles.root,
|
|
31
32
|
onClick: onClick,
|
|
32
33
|
ref: ref,
|
|
@@ -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");
|
|
@@ -38,8 +38,10 @@ var offset = [0, 2];
|
|
|
38
38
|
*/
|
|
39
39
|
var popperPlacementMap = {
|
|
40
40
|
'top-start': 'top',
|
|
41
|
+
'top-center': 'top',
|
|
41
42
|
'top-end': 'top',
|
|
42
43
|
'bottom-start': 'bottom',
|
|
44
|
+
'bottom-center': 'bottom',
|
|
43
45
|
'bottom-end': 'bottom',
|
|
44
46
|
'right-start': 'right',
|
|
45
47
|
'right-end': 'right',
|
|
@@ -56,9 +58,11 @@ var PopoverContent = exports.PopoverContent = function PopoverContent(_ref) {
|
|
|
56
58
|
var children = _ref.children,
|
|
57
59
|
placement = _ref.placement,
|
|
58
60
|
_ref$isVisible = _ref.isVisible,
|
|
59
|
-
isVisible = _ref$isVisible === void 0 ? true : _ref$isVisible
|
|
61
|
+
isVisible = _ref$isVisible === void 0 ? true : _ref$isVisible,
|
|
62
|
+
testId = _ref.testId;
|
|
60
63
|
var _useContext = (0, _react.useContext)(_context.SpotlightContext),
|
|
61
|
-
setPlacement = _useContext.setPlacement
|
|
64
|
+
setPlacement = _useContext.setPlacement,
|
|
65
|
+
heading = _useContext.heading;
|
|
62
66
|
var visibility = isVisible ? 'visible' : 'hidden';
|
|
63
67
|
(0, _react.useEffect)(function () {
|
|
64
68
|
setPlacement(placement);
|
|
@@ -70,7 +74,12 @@ var PopoverContent = exports.PopoverContent = function PopoverContent(_ref) {
|
|
|
70
74
|
var ref = _ref2.ref,
|
|
71
75
|
style = _ref2.style;
|
|
72
76
|
return /*#__PURE__*/React.createElement("div", {
|
|
73
|
-
|
|
77
|
+
role: "dialog",
|
|
78
|
+
"data-testid": testId,
|
|
79
|
+
"aria-labelledby": heading.id,
|
|
80
|
+
ref: ref
|
|
81
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
82
|
+
,
|
|
74
83
|
style: style,
|
|
75
84
|
className: (0, _runtime.ax)([styles.root, visibilityStyles[visibility]])
|
|
76
85
|
}, children);
|
|
@@ -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,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";
|
|
@@ -7,8 +7,10 @@ import { SpotlightContext } from '../../../controllers/context';
|
|
|
7
7
|
const styles = {
|
|
8
8
|
root: "_kqswh2mm _1pby1fw0 _1bsbo7ao _4t3io7ao _t9ecjyd4 _bfhkcdhy",
|
|
9
9
|
'top-start': "_1eint94y",
|
|
10
|
+
'top-center': "_1eint94y",
|
|
10
11
|
'top-end': "_1eint94y",
|
|
11
12
|
'bottom-start': "_1s1gt94y",
|
|
13
|
+
'bottom-center': "_1s1gt94y",
|
|
12
14
|
'bottom-end': "_1s1gt94y",
|
|
13
15
|
'right-start': "_1yxnt94y",
|
|
14
16
|
'right-end': "_1yxnt94y",
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
._16qs9g9j{box-shadow:var(--ds-shadow-overflow,0 0 8px #091e4228,0 0 1px #091e421e)}
|
|
6
6
|
._1bsbaq3k{width:295px}
|
|
7
7
|
._1e0212x7{inset-inline-start:var(--ds-space-075,6px)}
|
|
8
|
+
._1e021qz4{inset-inline-start:-140px}
|
|
8
9
|
._1e02c7mi{inset-inline-start:var(--ds-space-negative-250,-20px)}
|
|
9
10
|
._1e0c1txw{display:flex}
|
|
10
11
|
._1q51u2gc{padding-block-start:var(--ds-space-100,8px)}
|
|
@@ -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";
|
|
@@ -13,10 +13,12 @@ const styles = {
|
|
|
13
13
|
};
|
|
14
14
|
const placementStyles = {
|
|
15
15
|
'top-start': "_u7co12x7 _rjxpc7mi",
|
|
16
|
+
'top-center': "_u7co12x7 _1e021qz4",
|
|
16
17
|
'top-end': "_u7co12x7 _1e02c7mi",
|
|
17
18
|
'right-start': "_1e0212x7 _u7comgjw",
|
|
18
19
|
'right-end': "_1e0212x7 _152tmgjw",
|
|
19
20
|
'bottom-start': "_152t12x7 _rjxpc7mi",
|
|
21
|
+
'bottom-center': "_152t12x7 _1e021qz4",
|
|
20
22
|
'bottom-end': "_152t12x7 _1e02c7mi",
|
|
21
23
|
'left-start': "_rjxp12x7 _u7comgjw",
|
|
22
24
|
'left-end': "_rjxp12x7 _152tmgjw"
|
|
@@ -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";
|
|
@@ -19,6 +19,7 @@ export const SpotlightDismissControl = /*#__PURE__*/forwardRef(({
|
|
|
19
19
|
testId
|
|
20
20
|
}, ref) => {
|
|
21
21
|
return /*#__PURE__*/React.createElement(Pressable, {
|
|
22
|
+
"aria-label": "Dismiss",
|
|
22
23
|
xcss: styles.root,
|
|
23
24
|
onClick: onClick,
|
|
24
25
|
ref: ref,
|
|
@@ -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";
|
|
@@ -30,8 +30,10 @@ const offset = [0, 2];
|
|
|
30
30
|
*/
|
|
31
31
|
const popperPlacementMap = {
|
|
32
32
|
'top-start': 'top',
|
|
33
|
+
'top-center': 'top',
|
|
33
34
|
'top-end': 'top',
|
|
34
35
|
'bottom-start': 'bottom',
|
|
36
|
+
'bottom-center': 'bottom',
|
|
35
37
|
'bottom-end': 'bottom',
|
|
36
38
|
'right-start': 'right',
|
|
37
39
|
'right-end': 'right',
|
|
@@ -47,10 +49,12 @@ const popperPlacementMap = {
|
|
|
47
49
|
export const PopoverContent = ({
|
|
48
50
|
children,
|
|
49
51
|
placement,
|
|
50
|
-
isVisible = true
|
|
52
|
+
isVisible = true,
|
|
53
|
+
testId
|
|
51
54
|
}) => {
|
|
52
55
|
const {
|
|
53
|
-
setPlacement
|
|
56
|
+
setPlacement,
|
|
57
|
+
heading
|
|
54
58
|
} = useContext(SpotlightContext);
|
|
55
59
|
const visibility = isVisible ? 'visible' : 'hidden';
|
|
56
60
|
useEffect(() => {
|
|
@@ -63,7 +67,12 @@ export const PopoverContent = ({
|
|
|
63
67
|
ref,
|
|
64
68
|
style
|
|
65
69
|
}) => /*#__PURE__*/React.createElement("div", {
|
|
66
|
-
|
|
70
|
+
role: "dialog",
|
|
71
|
+
"data-testid": testId,
|
|
72
|
+
"aria-labelledby": heading.id,
|
|
73
|
+
ref: ref
|
|
74
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
75
|
+
,
|
|
67
76
|
style: style,
|
|
68
77
|
className: ax([styles.root, visibilityStyles[visibility]])
|
|
69
78
|
}, children));
|
|
@@ -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,11 +15,13 @@ const styles = {
|
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
17
|
export const SpotlightPrimaryAction = /*#__PURE__*/forwardRef(({
|
|
18
|
+
'aria-label': ariaLabel,
|
|
18
19
|
onClick,
|
|
19
20
|
children,
|
|
20
21
|
testId
|
|
21
22
|
}, ref) => {
|
|
22
23
|
return /*#__PURE__*/React.createElement(Pressable, {
|
|
24
|
+
"aria-label": ariaLabel,
|
|
23
25
|
ref: ref,
|
|
24
26
|
testId: testId,
|
|
25
27
|
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
|
import "./index.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
@@ -15,11 +15,13 @@ const styles = {
|
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
17
|
export const SpotlightSecondaryAction = /*#__PURE__*/forwardRef(({
|
|
18
|
+
'aria-label': ariaLabel,
|
|
18
19
|
onClick,
|
|
19
20
|
children,
|
|
20
21
|
testId
|
|
21
22
|
}, ref) => {
|
|
22
23
|
return /*#__PURE__*/React.createElement(Pressable, {
|
|
24
|
+
"aria-label": ariaLabel,
|
|
23
25
|
ref: ref,
|
|
24
26
|
testId: testId,
|
|
25
27
|
xcss: styles.root,
|
|
@@ -1,9 +1,10 @@
|
|
|
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 } from 'react';
|
|
6
6
|
import { Flex, Text } from '@atlaskit/primitives/compiled';
|
|
7
|
+
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
7
8
|
const styles = {
|
|
8
9
|
root: "_1ul91ris"
|
|
9
10
|
};
|
|
@@ -22,5 +23,5 @@ export const SpotlightStepCount = /*#__PURE__*/forwardRef(({
|
|
|
22
23
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
23
24
|
ref: ref,
|
|
24
25
|
testId: testId
|
|
25
|
-
}, children));
|
|
26
|
+
}, children, ' ', /*#__PURE__*/React.createElement(VisuallyHidden, null, "steps")));
|
|
26
27
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/* context.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* context.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
-
import { createContext, useState } from 'react';
|
|
5
|
+
import { createContext, useId, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
// eslint-disable-next-line @repo/internal/react/consistent-types-definitions
|
|
8
8
|
|
|
@@ -11,20 +11,35 @@ export var SpotlightContext = /*#__PURE__*/createContext({
|
|
|
11
11
|
placement: 'bottom-end',
|
|
12
12
|
setPlacement: function setPlacement() {
|
|
13
13
|
return undefined;
|
|
14
|
+
},
|
|
15
|
+
heading: {
|
|
16
|
+
id: '',
|
|
17
|
+
setId: function setId() {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
14
20
|
}
|
|
15
21
|
});
|
|
16
22
|
|
|
17
23
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
18
24
|
export var SpotlightContextProvider = function SpotlightContextProvider(_ref) {
|
|
19
25
|
var children = _ref.children;
|
|
26
|
+
var id = useId();
|
|
20
27
|
var _useState = useState('bottom-end'),
|
|
21
28
|
_useState2 = _slicedToArray(_useState, 2),
|
|
22
29
|
placement = _useState2[0],
|
|
23
30
|
setPlacement = _useState2[1];
|
|
31
|
+
var _useState3 = useState("".concat(id, "-heading")),
|
|
32
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
33
|
+
headingId = _useState4[0],
|
|
34
|
+
setHeadingId = _useState4[1];
|
|
24
35
|
return /*#__PURE__*/React.createElement(SpotlightContext.Provider, {
|
|
25
36
|
value: {
|
|
26
37
|
placement: placement,
|
|
27
|
-
setPlacement: setPlacement
|
|
38
|
+
setPlacement: setPlacement,
|
|
39
|
+
heading: {
|
|
40
|
+
id: headingId,
|
|
41
|
+
setId: setHeadingId
|
|
42
|
+
}
|
|
28
43
|
}
|
|
29
44
|
}, children);
|
|
30
45
|
};
|
|
@@ -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";
|
|
@@ -7,8 +7,10 @@ import { SpotlightContext } from '../../../controllers/context';
|
|
|
7
7
|
var styles = {
|
|
8
8
|
root: "_kqswh2mm _1pby1fw0 _1bsbo7ao _4t3io7ao _t9ecjyd4 _bfhkcdhy",
|
|
9
9
|
'top-start': "_1eint94y",
|
|
10
|
+
'top-center': "_1eint94y",
|
|
10
11
|
'top-end': "_1eint94y",
|
|
11
12
|
'bottom-start': "_1s1gt94y",
|
|
13
|
+
'bottom-center': "_1s1gt94y",
|
|
12
14
|
'bottom-end': "_1s1gt94y",
|
|
13
15
|
'right-start': "_1yxnt94y",
|
|
14
16
|
'right-end': "_1yxnt94y",
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
._16qs9g9j{box-shadow:var(--ds-shadow-overflow,0 0 8px #091e4228,0 0 1px #091e421e)}
|
|
6
6
|
._1bsbaq3k{width:295px}
|
|
7
7
|
._1e0212x7{inset-inline-start:var(--ds-space-075,6px)}
|
|
8
|
+
._1e021qz4{inset-inline-start:-140px}
|
|
8
9
|
._1e02c7mi{inset-inline-start:var(--ds-space-negative-250,-20px)}
|
|
9
10
|
._1e0c1txw{display:flex}
|
|
10
11
|
._1q51u2gc{padding-block-start:var(--ds-space-100,8px)}
|
|
@@ -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";
|
|
@@ -13,10 +13,12 @@ var styles = {
|
|
|
13
13
|
};
|
|
14
14
|
var placementStyles = {
|
|
15
15
|
'top-start': "_u7co12x7 _rjxpc7mi",
|
|
16
|
+
'top-center': "_u7co12x7 _1e021qz4",
|
|
16
17
|
'top-end': "_u7co12x7 _1e02c7mi",
|
|
17
18
|
'right-start': "_1e0212x7 _u7comgjw",
|
|
18
19
|
'right-end': "_1e0212x7 _152tmgjw",
|
|
19
20
|
'bottom-start': "_152t12x7 _rjxpc7mi",
|
|
21
|
+
'bottom-center': "_152t12x7 _1e021qz4",
|
|
20
22
|
'bottom-end': "_152t12x7 _1e02c7mi",
|
|
21
23
|
'left-start': "_rjxp12x7 _u7comgjw",
|
|
22
24
|
'left-end': "_rjxp12x7 _152tmgjw"
|
|
@@ -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";
|
|
@@ -18,6 +18,7 @@ export var SpotlightDismissControl = /*#__PURE__*/forwardRef(function (_ref, ref
|
|
|
18
18
|
var onClick = _ref.onClick,
|
|
19
19
|
testId = _ref.testId;
|
|
20
20
|
return /*#__PURE__*/React.createElement(Pressable, {
|
|
21
|
+
"aria-label": "Dismiss",
|
|
21
22
|
xcss: styles.root,
|
|
22
23
|
onClick: onClick,
|
|
23
24
|
ref: ref,
|
|
@@ -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
|
*
|
|
@@ -12,7 +13,10 @@ import Heading from '@atlaskit/heading';
|
|
|
12
13
|
export var SpotlightHeadline = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
13
14
|
var children = _ref.children,
|
|
14
15
|
testId = _ref.testId;
|
|
16
|
+
var _useContext = useContext(SpotlightContext),
|
|
17
|
+
heading = _useContext.heading;
|
|
15
18
|
return /*#__PURE__*/React.createElement(Heading, {
|
|
19
|
+
id: heading.id,
|
|
16
20
|
ref: ref,
|
|
17
21
|
testId: testId,
|
|
18
22
|
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";
|
|
@@ -30,8 +30,10 @@ var offset = [0, 2];
|
|
|
30
30
|
*/
|
|
31
31
|
var popperPlacementMap = {
|
|
32
32
|
'top-start': 'top',
|
|
33
|
+
'top-center': 'top',
|
|
33
34
|
'top-end': 'top',
|
|
34
35
|
'bottom-start': 'bottom',
|
|
36
|
+
'bottom-center': 'bottom',
|
|
35
37
|
'bottom-end': 'bottom',
|
|
36
38
|
'right-start': 'right',
|
|
37
39
|
'right-end': 'right',
|
|
@@ -48,9 +50,11 @@ export var PopoverContent = function PopoverContent(_ref) {
|
|
|
48
50
|
var children = _ref.children,
|
|
49
51
|
placement = _ref.placement,
|
|
50
52
|
_ref$isVisible = _ref.isVisible,
|
|
51
|
-
isVisible = _ref$isVisible === void 0 ? true : _ref$isVisible
|
|
53
|
+
isVisible = _ref$isVisible === void 0 ? true : _ref$isVisible,
|
|
54
|
+
testId = _ref.testId;
|
|
52
55
|
var _useContext = useContext(SpotlightContext),
|
|
53
|
-
setPlacement = _useContext.setPlacement
|
|
56
|
+
setPlacement = _useContext.setPlacement,
|
|
57
|
+
heading = _useContext.heading;
|
|
54
58
|
var visibility = isVisible ? 'visible' : 'hidden';
|
|
55
59
|
useEffect(function () {
|
|
56
60
|
setPlacement(placement);
|
|
@@ -62,7 +66,12 @@ export var PopoverContent = function PopoverContent(_ref) {
|
|
|
62
66
|
var ref = _ref2.ref,
|
|
63
67
|
style = _ref2.style;
|
|
64
68
|
return /*#__PURE__*/React.createElement("div", {
|
|
65
|
-
|
|
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
|
+
,
|
|
66
75
|
style: style,
|
|
67
76
|
className: ax([styles.root, visibilityStyles[visibility]])
|
|
68
77
|
}, children);
|
|
@@ -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,10 +15,12 @@ var styles = {
|
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
17
|
export var SpotlightPrimaryAction = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
18
|
-
var
|
|
18
|
+
var ariaLabel = _ref['aria-label'],
|
|
19
|
+
onClick = _ref.onClick,
|
|
19
20
|
children = _ref.children,
|
|
20
21
|
testId = _ref.testId;
|
|
21
22
|
return /*#__PURE__*/React.createElement(Pressable, {
|
|
23
|
+
"aria-label": ariaLabel,
|
|
22
24
|
ref: ref,
|
|
23
25
|
testId: testId,
|
|
24
26
|
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
|
import "./index.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
@@ -15,10 +15,12 @@ var styles = {
|
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
17
|
export var SpotlightSecondaryAction = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
18
|
-
var
|
|
18
|
+
var ariaLabel = _ref['aria-label'],
|
|
19
|
+
onClick = _ref.onClick,
|
|
19
20
|
children = _ref.children,
|
|
20
21
|
testId = _ref.testId;
|
|
21
22
|
return /*#__PURE__*/React.createElement(Pressable, {
|
|
23
|
+
"aria-label": ariaLabel,
|
|
22
24
|
ref: ref,
|
|
23
25
|
testId: testId,
|
|
24
26
|
xcss: styles.root,
|
|
@@ -1,9 +1,10 @@
|
|
|
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 } from 'react';
|
|
6
6
|
import { Flex, Text } from '@atlaskit/primitives/compiled';
|
|
7
|
+
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
7
8
|
var styles = {
|
|
8
9
|
root: "_1ul91ris"
|
|
9
10
|
};
|
|
@@ -21,5 +22,5 @@ export var SpotlightStepCount = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
21
22
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
22
23
|
ref: ref,
|
|
23
24
|
testId: testId
|
|
24
|
-
}, children));
|
|
25
|
+
}, children, ' ', /*#__PURE__*/React.createElement(VisuallyHidden, null, "steps")));
|
|
25
26
|
});
|
|
@@ -7,6 +7,10 @@ import type { Placement } from '../types';
|
|
|
7
7
|
interface SpotlightContextType {
|
|
8
8
|
placement: Placement;
|
|
9
9
|
setPlacement: Dispatch<SetStateAction<Placement>>;
|
|
10
|
+
heading: {
|
|
11
|
+
id: string;
|
|
12
|
+
setId: Dispatch<SetStateAction<string>>;
|
|
13
|
+
};
|
|
10
14
|
}
|
|
11
15
|
export declare const SpotlightContext: import("react").Context<SpotlightContextType>;
|
|
12
16
|
export declare const SpotlightContextProvider: ({ children }: {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -14,3 +14,4 @@ export { SpotlightMedia, type SpotlightMediaProps } from './ui/media';
|
|
|
14
14
|
export { PopoverProvider } from './ui/popover-provider';
|
|
15
15
|
export { PopoverContent } from './ui/popover-content';
|
|
16
16
|
export { PopoverTarget } from './ui/popover-target';
|
|
17
|
+
export { type Placement } from './types';
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export type Placement = 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'right-start' | 'right-end' | 'left-start' | 'left-end';
|
|
1
|
+
export type Placement = 'top-start' | 'top-center' | 'top-end' | 'bottom-start' | 'bottom-center' | 'bottom-end' | 'right-start' | 'right-end' | 'left-start' | 'left-end';
|
|
@@ -5,6 +5,12 @@
|
|
|
5
5
|
import { type ReactNode } from 'react';
|
|
6
6
|
import type { Placement } from '../../types';
|
|
7
7
|
interface PopoverContentProps {
|
|
8
|
+
/**
|
|
9
|
+
* A `testId` prop is provided for specified elements, which is a unique
|
|
10
|
+
* string that appears as a data attribute `data-testid` in the rendered code,
|
|
11
|
+
* serving as a hook for automated tests
|
|
12
|
+
*/
|
|
13
|
+
testId?: string;
|
|
8
14
|
placement: Placement;
|
|
9
15
|
isVisible?: boolean;
|
|
10
16
|
children: ReactNode;
|
|
@@ -14,5 +20,5 @@ interface PopoverContentProps {
|
|
|
14
20
|
*
|
|
15
21
|
* A `PopoverContent` is the element that is shown as a popover.
|
|
16
22
|
*/
|
|
17
|
-
export declare const PopoverContent: ({ children, placement, isVisible }: PopoverContentProps) => JSX.Element;
|
|
23
|
+
export declare const PopoverContent: ({ children, placement, isVisible, testId }: PopoverContentProps) => JSX.Element;
|
|
18
24
|
export {};
|
|
@@ -19,6 +19,10 @@ export interface SpotlightPrimaryActionProps {
|
|
|
19
19
|
* The action to take when the button is clicked.
|
|
20
20
|
*/
|
|
21
21
|
onClick?: PressableProps['onClick'];
|
|
22
|
+
/**
|
|
23
|
+
* An accessible label to read out in the event that the displayed text does not provide anough context.
|
|
24
|
+
*/
|
|
25
|
+
'aria-label'?: string;
|
|
22
26
|
}
|
|
23
27
|
/**
|
|
24
28
|
* __Spotlight primary action__
|
|
@@ -19,6 +19,10 @@ export interface SpotlightSecondaryActionProps {
|
|
|
19
19
|
* The action to take when the button is clicked.
|
|
20
20
|
*/
|
|
21
21
|
onClick?: PressableProps['onClick'];
|
|
22
|
+
/**
|
|
23
|
+
* An accessible label to read out in the event that the displayed text does not provide anough context.
|
|
24
|
+
*/
|
|
25
|
+
'aria-label'?: string;
|
|
22
26
|
}
|
|
23
27
|
/**
|
|
24
28
|
* __Spotlight secondary action__
|
|
@@ -7,6 +7,10 @@ import type { Placement } from '../types';
|
|
|
7
7
|
interface SpotlightContextType {
|
|
8
8
|
placement: Placement;
|
|
9
9
|
setPlacement: Dispatch<SetStateAction<Placement>>;
|
|
10
|
+
heading: {
|
|
11
|
+
id: string;
|
|
12
|
+
setId: Dispatch<SetStateAction<string>>;
|
|
13
|
+
};
|
|
10
14
|
}
|
|
11
15
|
export declare const SpotlightContext: import("react").Context<SpotlightContextType>;
|
|
12
16
|
export declare const SpotlightContextProvider: ({ children }: {
|
|
@@ -14,3 +14,4 @@ export { SpotlightMedia, type SpotlightMediaProps } from './ui/media';
|
|
|
14
14
|
export { PopoverProvider } from './ui/popover-provider';
|
|
15
15
|
export { PopoverContent } from './ui/popover-content';
|
|
16
16
|
export { PopoverTarget } from './ui/popover-target';
|
|
17
|
+
export { type Placement } from './types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type Placement = 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'right-start' | 'right-end' | 'left-start' | 'left-end';
|
|
1
|
+
export type Placement = 'top-start' | 'top-center' | 'top-end' | 'bottom-start' | 'bottom-center' | 'bottom-end' | 'right-start' | 'right-end' | 'left-start' | 'left-end';
|
|
@@ -5,6 +5,12 @@
|
|
|
5
5
|
import { type ReactNode } from 'react';
|
|
6
6
|
import type { Placement } from '../../types';
|
|
7
7
|
interface PopoverContentProps {
|
|
8
|
+
/**
|
|
9
|
+
* A `testId` prop is provided for specified elements, which is a unique
|
|
10
|
+
* string that appears as a data attribute `data-testid` in the rendered code,
|
|
11
|
+
* serving as a hook for automated tests
|
|
12
|
+
*/
|
|
13
|
+
testId?: string;
|
|
8
14
|
placement: Placement;
|
|
9
15
|
isVisible?: boolean;
|
|
10
16
|
children: ReactNode;
|
|
@@ -14,5 +20,5 @@ interface PopoverContentProps {
|
|
|
14
20
|
*
|
|
15
21
|
* A `PopoverContent` is the element that is shown as a popover.
|
|
16
22
|
*/
|
|
17
|
-
export declare const PopoverContent: ({ children, placement, isVisible }: PopoverContentProps) => JSX.Element;
|
|
23
|
+
export declare const PopoverContent: ({ children, placement, isVisible, testId }: PopoverContentProps) => JSX.Element;
|
|
18
24
|
export {};
|
|
@@ -19,6 +19,10 @@ export interface SpotlightPrimaryActionProps {
|
|
|
19
19
|
* The action to take when the button is clicked.
|
|
20
20
|
*/
|
|
21
21
|
onClick?: PressableProps['onClick'];
|
|
22
|
+
/**
|
|
23
|
+
* An accessible label to read out in the event that the displayed text does not provide anough context.
|
|
24
|
+
*/
|
|
25
|
+
'aria-label'?: string;
|
|
22
26
|
}
|
|
23
27
|
/**
|
|
24
28
|
* __Spotlight primary action__
|
|
@@ -19,6 +19,10 @@ export interface SpotlightSecondaryActionProps {
|
|
|
19
19
|
* The action to take when the button is clicked.
|
|
20
20
|
*/
|
|
21
21
|
onClick?: PressableProps['onClick'];
|
|
22
|
+
/**
|
|
23
|
+
* An accessible label to read out in the event that the displayed text does not provide anough context.
|
|
24
|
+
*/
|
|
25
|
+
'aria-label'?: string;
|
|
22
26
|
}
|
|
23
27
|
/**
|
|
24
28
|
* __Spotlight secondary action__
|
package/offerings.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"name": "Spotlight",
|
|
4
|
+
"package": "@atlaskit/spotlight",
|
|
5
|
+
"import": {
|
|
6
|
+
"name": "Spotlight",
|
|
7
|
+
"package": "@atlaskit/spotlight",
|
|
8
|
+
"type": "named"
|
|
9
|
+
},
|
|
10
|
+
"keywords": ["spotlight", "search", "command", "palette", "quick"],
|
|
11
|
+
"categories": ["navigation"],
|
|
12
|
+
"shortDescription": "A component for quick search and command execution.",
|
|
13
|
+
"status": "general-availability",
|
|
14
|
+
"accessibilityGuidelines": [
|
|
15
|
+
"Ensure proper keyboard navigation",
|
|
16
|
+
"Provide clear search functionality",
|
|
17
|
+
"Use appropriate ARIA attributes",
|
|
18
|
+
"Consider screen reader announcements"
|
|
19
|
+
],
|
|
20
|
+
"usageGuidelines": [
|
|
21
|
+
"Use for quick search and commands",
|
|
22
|
+
"Provide clear search functionality",
|
|
23
|
+
"Consider keyboard shortcuts",
|
|
24
|
+
"Handle search results appropriately"
|
|
25
|
+
],
|
|
26
|
+
"contentGuidelines": [
|
|
27
|
+
"Use clear, descriptive search labels",
|
|
28
|
+
"Provide helpful search suggestions",
|
|
29
|
+
"Use consistent command naming",
|
|
30
|
+
"Keep search results relevant"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/spotlight",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "A spotlight introduces users to various points of interest across Atlassian through focused messages or multi-step tours.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,8 +32,9 @@
|
|
|
32
32
|
"@atlaskit/icon": "^28.2.0",
|
|
33
33
|
"@atlaskit/image": "^3.0.0",
|
|
34
34
|
"@atlaskit/popper": "^7.1.0",
|
|
35
|
-
"@atlaskit/primitives": "^14.
|
|
35
|
+
"@atlaskit/primitives": "^14.15.0",
|
|
36
36
|
"@atlaskit/tokens": "^6.3.0",
|
|
37
|
+
"@atlaskit/visually-hidden": "^3.0.0",
|
|
37
38
|
"@babel/runtime": "^7.0.0",
|
|
38
39
|
"@compiled/react": "^0.18.3"
|
|
39
40
|
},
|