@atlaskit/spotlight 0.3.3 → 0.3.5
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 +15 -0
- package/dist/cjs/ui/card/caret/index.compiled.css +4 -3
- package/dist/cjs/ui/card/caret/index.js +11 -11
- package/dist/cjs/ui/dismiss-control/index.js +10 -5
- package/dist/cjs/ui/popover-content/index.compiled.css +1 -5
- package/dist/cjs/ui/popover-content/index.js +4 -6
- package/dist/cjs/ui/step-count/index.js +1 -1
- package/dist/es2019/ui/card/caret/index.compiled.css +4 -3
- package/dist/es2019/ui/card/caret/index.js +11 -11
- package/dist/es2019/ui/dismiss-control/index.js +8 -4
- package/dist/es2019/ui/popover-content/index.compiled.css +1 -5
- package/dist/es2019/ui/popover-content/index.js +15 -15
- package/dist/es2019/ui/step-count/index.js +1 -1
- package/dist/esm/ui/card/caret/index.compiled.css +4 -3
- package/dist/esm/ui/card/caret/index.js +11 -11
- package/dist/esm/ui/dismiss-control/index.js +10 -5
- package/dist/esm/ui/popover-content/index.compiled.css +1 -5
- package/dist/esm/ui/popover-content/index.js +4 -6
- package/dist/esm/ui/step-count/index.js +1 -1
- package/dist/types/ui/actions/index.d.ts +1 -1
- package/dist/types/ui/body/index.d.ts +1 -1
- package/dist/types/ui/card/caret/index.d.ts +1 -1
- package/dist/types/ui/card/index.d.ts +1 -1
- package/dist/types/ui/controls/index.d.ts +1 -1
- package/dist/types/ui/dismiss-control/index.d.ts +9 -1
- package/dist/types/ui/footer/index.d.ts +1 -1
- package/dist/types/ui/header/index.d.ts +1 -1
- package/dist/types/ui/headline/index.d.ts +1 -1
- package/dist/types/ui/media/index.d.ts +1 -1
- package/dist/types/ui/popover-content/index.d.ts +1 -1
- package/dist/types/ui/primary-action/index.d.ts +1 -1
- package/dist/types/ui/secondary-action/index.d.ts +1 -1
- package/dist/types/ui/show-more-control/index.d.ts +1 -1
- package/dist/types/ui/step-count/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/actions/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/body/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/card/caret/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/card/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/controls/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/dismiss-control/index.d.ts +9 -1
- package/dist/types-ts4.5/ui/footer/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/header/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/headline/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/media/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/popover-content/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/primary-action/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/secondary-action/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/show-more-control/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/step-count/index.d.ts +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/spotlight
|
|
2
2
|
|
|
3
|
+
## 0.3.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`39e543109ec09`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/39e543109ec09) -
|
|
8
|
+
add type info to forwardRef components
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 0.3.4
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`cc92031710191`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cc92031710191) -
|
|
16
|
+
`SpotlightDismissControl` now applies `autofocus` when it is mounted.
|
|
17
|
+
|
|
3
18
|
## 0.3.3
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -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)}
|
|
@@ -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__
|
|
@@ -24,14 +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
|
-
|
|
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,
|
|
32
35
|
onClick: onClick,
|
|
33
36
|
ref: ref,
|
|
34
|
-
testId: testId
|
|
37
|
+
testId: testId,
|
|
38
|
+
xcss: styles.root,
|
|
39
|
+
"aria-label": "Dismiss"
|
|
35
40
|
}, /*#__PURE__*/React.createElement(_cross.default, {
|
|
36
41
|
label: "Close"
|
|
37
42
|
}));
|
|
@@ -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
|
|
@@ -63,7 +59,6 @@ var PopoverContent = exports.PopoverContent = function PopoverContent(_ref) {
|
|
|
63
59
|
var _useContext = (0, _react.useContext)(_context.SpotlightContext),
|
|
64
60
|
setPlacement = _useContext.setPlacement,
|
|
65
61
|
heading = _useContext.heading;
|
|
66
|
-
var visibility = isVisible ? 'visible' : 'hidden';
|
|
67
62
|
(0, _react.useEffect)(function () {
|
|
68
63
|
setPlacement(placement);
|
|
69
64
|
}, [placement, setPlacement]);
|
|
@@ -73,6 +68,9 @@ var PopoverContent = exports.PopoverContent = function PopoverContent(_ref) {
|
|
|
73
68
|
}, function (_ref2) {
|
|
74
69
|
var ref = _ref2.ref,
|
|
75
70
|
style = _ref2.style;
|
|
71
|
+
if (!isVisible) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
76
74
|
return /*#__PURE__*/React.createElement("div", {
|
|
77
75
|
role: "dialog",
|
|
78
76
|
"data-testid": testId,
|
|
@@ -81,7 +79,7 @@ var PopoverContent = exports.PopoverContent = function PopoverContent(_ref) {
|
|
|
81
79
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
82
80
|
,
|
|
83
81
|
style: style,
|
|
84
|
-
className: (0, _runtime.ax)([styles.root
|
|
82
|
+
className: (0, _runtime.ax)([styles.root])
|
|
85
83
|
}, children);
|
|
86
84
|
});
|
|
87
85
|
};
|
|
@@ -31,5 +31,5 @@ var SpotlightStepCount = exports.SpotlightStepCount = /*#__PURE__*/(0, _react.fo
|
|
|
31
31
|
}, /*#__PURE__*/React.createElement(_compiled.Text, {
|
|
32
32
|
ref: ref,
|
|
33
33
|
testId: testId
|
|
34
|
-
}, children,
|
|
34
|
+
}, children, " ", /*#__PURE__*/React.createElement(_visuallyHidden.default, null, "steps")));
|
|
35
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)}
|
|
@@ -5,17 +5,17 @@ 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__
|
|
@@ -15,15 +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
|
-
|
|
23
|
-
|
|
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,
|
|
24
26
|
onClick: onClick,
|
|
25
27
|
ref: ref,
|
|
26
|
-
testId: testId
|
|
28
|
+
testId: testId,
|
|
29
|
+
xcss: styles.root,
|
|
30
|
+
"aria-label": "Dismiss"
|
|
27
31
|
}, /*#__PURE__*/React.createElement(CrossIcon, {
|
|
28
32
|
label: "Close"
|
|
29
33
|
}));
|
|
@@ -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
|
|
@@ -56,7 +52,6 @@ export const PopoverContent = ({
|
|
|
56
52
|
setPlacement,
|
|
57
53
|
heading
|
|
58
54
|
} = useContext(SpotlightContext);
|
|
59
|
-
const visibility = isVisible ? 'visible' : 'hidden';
|
|
60
55
|
useEffect(() => {
|
|
61
56
|
setPlacement(placement);
|
|
62
57
|
}, [placement, setPlacement]);
|
|
@@ -66,14 +61,19 @@ export const PopoverContent = ({
|
|
|
66
61
|
}, ({
|
|
67
62
|
ref,
|
|
68
63
|
style
|
|
69
|
-
}) =>
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
+
});
|
|
79
79
|
};
|
|
@@ -23,5 +23,5 @@ export const SpotlightStepCount = /*#__PURE__*/forwardRef(({
|
|
|
23
23
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
24
24
|
ref: ref,
|
|
25
25
|
testId: testId
|
|
26
|
-
}, children,
|
|
26
|
+
}, children, " ", /*#__PURE__*/React.createElement(VisuallyHidden, null, "steps")));
|
|
27
27
|
});
|
|
@@ -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)}
|
|
@@ -5,17 +5,17 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
5
5
|
import { forwardRef, useContext } from 'react';
|
|
6
6
|
import { SpotlightContext } from '../../../controllers/context';
|
|
7
7
|
var 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__
|
|
@@ -15,14 +15,19 @@ var styles = {
|
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
17
|
export var SpotlightDismissControl = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
18
|
-
var
|
|
18
|
+
var _ref$autoFocus = _ref.autoFocus,
|
|
19
|
+
autoFocus = _ref$autoFocus === void 0 ? true : _ref$autoFocus,
|
|
20
|
+
onClick = _ref.onClick,
|
|
19
21
|
testId = _ref.testId;
|
|
20
|
-
return /*#__PURE__*/React.createElement(Pressable
|
|
21
|
-
|
|
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
|
}));
|
|
@@ -8,10 +8,6 @@ import { SpotlightContext } from '../../controllers/context';
|
|
|
8
8
|
var styles = {
|
|
9
9
|
root: "_1pby1fw0"
|
|
10
10
|
};
|
|
11
|
-
var 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
|
|
@@ -55,7 +51,6 @@ export var PopoverContent = function PopoverContent(_ref) {
|
|
|
55
51
|
var _useContext = useContext(SpotlightContext),
|
|
56
52
|
setPlacement = _useContext.setPlacement,
|
|
57
53
|
heading = _useContext.heading;
|
|
58
|
-
var visibility = isVisible ? 'visible' : 'hidden';
|
|
59
54
|
useEffect(function () {
|
|
60
55
|
setPlacement(placement);
|
|
61
56
|
}, [placement, setPlacement]);
|
|
@@ -65,6 +60,9 @@ export var PopoverContent = function PopoverContent(_ref) {
|
|
|
65
60
|
}, function (_ref2) {
|
|
66
61
|
var ref = _ref2.ref,
|
|
67
62
|
style = _ref2.style;
|
|
63
|
+
if (!isVisible) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
68
66
|
return /*#__PURE__*/React.createElement("div", {
|
|
69
67
|
role: "dialog",
|
|
70
68
|
"data-testid": testId,
|
|
@@ -73,7 +71,7 @@ export var PopoverContent = function PopoverContent(_ref) {
|
|
|
73
71
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
74
72
|
,
|
|
75
73
|
style: style,
|
|
76
|
-
className: ax([styles.root
|
|
74
|
+
className: ax([styles.root])
|
|
77
75
|
}, children);
|
|
78
76
|
});
|
|
79
77
|
};
|
|
@@ -22,5 +22,5 @@ export var SpotlightStepCount = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
22
22
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
23
23
|
ref: ref,
|
|
24
24
|
testId: testId
|
|
25
|
-
}, children,
|
|
25
|
+
}, children, " ", /*#__PURE__*/React.createElement(VisuallyHidden, null, "steps")));
|
|
26
26
|
});
|
|
@@ -21,4 +21,4 @@ export interface SpotlightActionsProps {
|
|
|
21
21
|
* `SpotlightActions` groups `SpotlightAction` components.
|
|
22
22
|
*
|
|
23
23
|
*/
|
|
24
|
-
export declare const SpotlightActions:
|
|
24
|
+
export declare const SpotlightActions: React.ForwardRefExoticComponent<React.PropsWithoutRef<SpotlightActionsProps> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -22,4 +22,4 @@ export interface SpotlightBodyProps {
|
|
|
22
22
|
* `SpotlightBody` is required in a `Spotlight`. The content should be brief and direct to elaborate on the intent.
|
|
23
23
|
*
|
|
24
24
|
*/
|
|
25
|
-
export declare const SpotlightBody:
|
|
25
|
+
export declare const SpotlightBody: React.ForwardRefExoticComponent<React.PropsWithoutRef<SpotlightBodyProps> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -12,4 +12,4 @@ export interface CaretProps {
|
|
|
12
12
|
* A `Caret` is a purely visual pointer displayed on the edge of a spotlight, which points to the target element.
|
|
13
13
|
*
|
|
14
14
|
*/
|
|
15
|
-
export declare const Caret:
|
|
15
|
+
export declare const Caret: React.ForwardRefExoticComponent<React.PropsWithoutRef<CaretProps> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -21,4 +21,4 @@ export interface SpotlightCardProps {
|
|
|
21
21
|
* The base UI card that wraps composable spotlight components.
|
|
22
22
|
*
|
|
23
23
|
*/
|
|
24
|
-
export declare const SpotlightCard:
|
|
24
|
+
export declare const SpotlightCard: React.ForwardRefExoticComponent<React.PropsWithoutRef<SpotlightCardProps> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -20,4 +20,4 @@ export interface SpotlightControlsProps {
|
|
|
20
20
|
*
|
|
21
21
|
* `SpotlightControls` groups spotlight control components.
|
|
22
22
|
*/
|
|
23
|
-
export declare const SpotlightControls:
|
|
23
|
+
export declare const SpotlightControls: React.ForwardRefExoticComponent<React.PropsWithoutRef<SpotlightControlsProps> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -10,6 +10,14 @@ export interface SpotlightDismissControlProps {
|
|
|
10
10
|
* The action to take when the button is clicked.
|
|
11
11
|
*/
|
|
12
12
|
onClick?: PressableProps['onClick'];
|
|
13
|
+
/**
|
|
14
|
+
* @default true
|
|
15
|
+
*
|
|
16
|
+
* Specifies whether the dismiss button should be focused when the spotlight is rendered.
|
|
17
|
+
* For spotlights that are triggered by user-action, this should be `true`. In the event that
|
|
18
|
+
* a spotlight is rendered on pageload, without explicit user interaction, this should be `false`.
|
|
19
|
+
*/
|
|
20
|
+
autoFocus?: boolean;
|
|
13
21
|
}
|
|
14
22
|
/**
|
|
15
23
|
* __SpotlightDismissControl__
|
|
@@ -17,4 +25,4 @@ export interface SpotlightDismissControlProps {
|
|
|
17
25
|
* SpotlightDismissControl allows the user to close the `Spotlight`.
|
|
18
26
|
*
|
|
19
27
|
*/
|
|
20
|
-
export declare const SpotlightDismissControl:
|
|
28
|
+
export declare const SpotlightDismissControl: React.ForwardRefExoticComponent<React.PropsWithoutRef<SpotlightDismissControlProps> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -21,4 +21,4 @@ export interface SpotlightFooterProps {
|
|
|
21
21
|
* `SpotlightFooter` is intended to display the `SpotlightActions` and `SpotLightStepCount` components.
|
|
22
22
|
*
|
|
23
23
|
*/
|
|
24
|
-
export declare const SpotlightFooter:
|
|
24
|
+
export declare const SpotlightFooter: React.ForwardRefExoticComponent<React.PropsWithoutRef<SpotlightFooterProps> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -22,4 +22,4 @@ export interface SpotlightHeaderProps {
|
|
|
22
22
|
* intended to show the `SpotlightHeadline` component, as well as `SpotLightControls`.
|
|
23
23
|
*
|
|
24
24
|
*/
|
|
25
|
-
export declare const SpotlightHeader:
|
|
25
|
+
export declare const SpotlightHeader: React.ForwardRefExoticComponent<React.PropsWithoutRef<SpotlightHeaderProps> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -21,4 +21,4 @@ export interface SpotlightHeadlineProps {
|
|
|
21
21
|
* `SpotlightHeadline` is required in a `Spotlight`. The content should be brief and direct to quickly hook the user on the intent.
|
|
22
22
|
*
|
|
23
23
|
*/
|
|
24
|
-
export declare const SpotlightHeadline:
|
|
24
|
+
export declare const SpotlightHeadline: React.ForwardRefExoticComponent<React.PropsWithoutRef<SpotlightHeadlineProps> & React.RefAttributes<HTMLHeadingElement>>;
|
|
@@ -22,4 +22,4 @@ export interface SpotlightMediaProps {
|
|
|
22
22
|
* `SpotlightMedia` is optional in a `Spotlight`.
|
|
23
23
|
*
|
|
24
24
|
*/
|
|
25
|
-
export declare const SpotlightMedia:
|
|
25
|
+
export declare const SpotlightMedia: React.ForwardRefExoticComponent<React.PropsWithoutRef<SpotlightMediaProps> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -20,5 +20,5 @@ interface PopoverContentProps {
|
|
|
20
20
|
*
|
|
21
21
|
* A `PopoverContent` is the element that is shown as a popover.
|
|
22
22
|
*/
|
|
23
|
-
export declare const PopoverContent: ({ children, placement, isVisible, testId }: PopoverContentProps) => JSX.Element;
|
|
23
|
+
export declare const PopoverContent: ({ children, placement, isVisible, testId, }: PopoverContentProps) => JSX.Element;
|
|
24
24
|
export {};
|
|
@@ -31,4 +31,4 @@ export interface SpotlightPrimaryActionProps {
|
|
|
31
31
|
* for single step spotlights, or to show the next step on multi step spotlight tours.
|
|
32
32
|
*
|
|
33
33
|
*/
|
|
34
|
-
export declare const SpotlightPrimaryAction:
|
|
34
|
+
export declare const SpotlightPrimaryAction: React.ForwardRefExoticComponent<React.PropsWithoutRef<SpotlightPrimaryActionProps> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -31,4 +31,4 @@ export interface SpotlightSecondaryActionProps {
|
|
|
31
31
|
* It is intended to be used to go back to the previous step in multi step spotlight tours, or other similar actions.
|
|
32
32
|
*
|
|
33
33
|
*/
|
|
34
|
-
export declare const SpotlightSecondaryAction:
|
|
34
|
+
export declare const SpotlightSecondaryAction: React.ForwardRefExoticComponent<React.PropsWithoutRef<SpotlightSecondaryActionProps> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -17,4 +17,4 @@ export interface SpotlightShowMoreControlProps {
|
|
|
17
17
|
* SpotlightShowMoreControl allows the user to close the `Spotlight`.
|
|
18
18
|
*
|
|
19
19
|
*/
|
|
20
|
-
export declare const SpotlightShowMoreControl:
|
|
20
|
+
export declare const SpotlightShowMoreControl: React.ForwardRefExoticComponent<React.PropsWithoutRef<SpotlightShowMoreControlProps> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -21,4 +21,4 @@ export interface SpotlightStepCountProps {
|
|
|
21
21
|
* `SpotlightStepCount` groups `SpotlightAction` components.
|
|
22
22
|
*
|
|
23
23
|
*/
|
|
24
|
-
export declare const SpotlightStepCount:
|
|
24
|
+
export declare const SpotlightStepCount: React.ForwardRefExoticComponent<React.PropsWithoutRef<SpotlightStepCountProps> & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -21,4 +21,4 @@ export interface SpotlightActionsProps {
|
|
|
21
21
|
* `SpotlightActions` groups `SpotlightAction` components.
|
|
22
22
|
*
|
|
23
23
|
*/
|
|
24
|
-
export declare const SpotlightActions:
|
|
24
|
+
export declare const SpotlightActions: React.ForwardRefExoticComponent<React.PropsWithoutRef<SpotlightActionsProps> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -22,4 +22,4 @@ export interface SpotlightBodyProps {
|
|
|
22
22
|
* `SpotlightBody` is required in a `Spotlight`. The content should be brief and direct to elaborate on the intent.
|
|
23
23
|
*
|
|
24
24
|
*/
|
|
25
|
-
export declare const SpotlightBody:
|
|
25
|
+
export declare const SpotlightBody: React.ForwardRefExoticComponent<React.PropsWithoutRef<SpotlightBodyProps> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -12,4 +12,4 @@ export interface CaretProps {
|
|
|
12
12
|
* A `Caret` is a purely visual pointer displayed on the edge of a spotlight, which points to the target element.
|
|
13
13
|
*
|
|
14
14
|
*/
|
|
15
|
-
export declare const Caret:
|
|
15
|
+
export declare const Caret: React.ForwardRefExoticComponent<React.PropsWithoutRef<CaretProps> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -21,4 +21,4 @@ export interface SpotlightCardProps {
|
|
|
21
21
|
* The base UI card that wraps composable spotlight components.
|
|
22
22
|
*
|
|
23
23
|
*/
|
|
24
|
-
export declare const SpotlightCard:
|
|
24
|
+
export declare const SpotlightCard: React.ForwardRefExoticComponent<React.PropsWithoutRef<SpotlightCardProps> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -20,4 +20,4 @@ export interface SpotlightControlsProps {
|
|
|
20
20
|
*
|
|
21
21
|
* `SpotlightControls` groups spotlight control components.
|
|
22
22
|
*/
|
|
23
|
-
export declare const SpotlightControls:
|
|
23
|
+
export declare const SpotlightControls: React.ForwardRefExoticComponent<React.PropsWithoutRef<SpotlightControlsProps> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -10,6 +10,14 @@ export interface SpotlightDismissControlProps {
|
|
|
10
10
|
* The action to take when the button is clicked.
|
|
11
11
|
*/
|
|
12
12
|
onClick?: PressableProps['onClick'];
|
|
13
|
+
/**
|
|
14
|
+
* @default true
|
|
15
|
+
*
|
|
16
|
+
* Specifies whether the dismiss button should be focused when the spotlight is rendered.
|
|
17
|
+
* For spotlights that are triggered by user-action, this should be `true`. In the event that
|
|
18
|
+
* a spotlight is rendered on pageload, without explicit user interaction, this should be `false`.
|
|
19
|
+
*/
|
|
20
|
+
autoFocus?: boolean;
|
|
13
21
|
}
|
|
14
22
|
/**
|
|
15
23
|
* __SpotlightDismissControl__
|
|
@@ -17,4 +25,4 @@ export interface SpotlightDismissControlProps {
|
|
|
17
25
|
* SpotlightDismissControl allows the user to close the `Spotlight`.
|
|
18
26
|
*
|
|
19
27
|
*/
|
|
20
|
-
export declare const SpotlightDismissControl:
|
|
28
|
+
export declare const SpotlightDismissControl: React.ForwardRefExoticComponent<React.PropsWithoutRef<SpotlightDismissControlProps> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -21,4 +21,4 @@ export interface SpotlightFooterProps {
|
|
|
21
21
|
* `SpotlightFooter` is intended to display the `SpotlightActions` and `SpotLightStepCount` components.
|
|
22
22
|
*
|
|
23
23
|
*/
|
|
24
|
-
export declare const SpotlightFooter:
|
|
24
|
+
export declare const SpotlightFooter: React.ForwardRefExoticComponent<React.PropsWithoutRef<SpotlightFooterProps> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -22,4 +22,4 @@ export interface SpotlightHeaderProps {
|
|
|
22
22
|
* intended to show the `SpotlightHeadline` component, as well as `SpotLightControls`.
|
|
23
23
|
*
|
|
24
24
|
*/
|
|
25
|
-
export declare const SpotlightHeader:
|
|
25
|
+
export declare const SpotlightHeader: React.ForwardRefExoticComponent<React.PropsWithoutRef<SpotlightHeaderProps> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -21,4 +21,4 @@ export interface SpotlightHeadlineProps {
|
|
|
21
21
|
* `SpotlightHeadline` is required in a `Spotlight`. The content should be brief and direct to quickly hook the user on the intent.
|
|
22
22
|
*
|
|
23
23
|
*/
|
|
24
|
-
export declare const SpotlightHeadline:
|
|
24
|
+
export declare const SpotlightHeadline: React.ForwardRefExoticComponent<React.PropsWithoutRef<SpotlightHeadlineProps> & React.RefAttributes<HTMLHeadingElement>>;
|
|
@@ -22,4 +22,4 @@ export interface SpotlightMediaProps {
|
|
|
22
22
|
* `SpotlightMedia` is optional in a `Spotlight`.
|
|
23
23
|
*
|
|
24
24
|
*/
|
|
25
|
-
export declare const SpotlightMedia:
|
|
25
|
+
export declare const SpotlightMedia: React.ForwardRefExoticComponent<React.PropsWithoutRef<SpotlightMediaProps> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -20,5 +20,5 @@ interface PopoverContentProps {
|
|
|
20
20
|
*
|
|
21
21
|
* A `PopoverContent` is the element that is shown as a popover.
|
|
22
22
|
*/
|
|
23
|
-
export declare const PopoverContent: ({ children, placement, isVisible, testId }: PopoverContentProps) => JSX.Element;
|
|
23
|
+
export declare const PopoverContent: ({ children, placement, isVisible, testId, }: PopoverContentProps) => JSX.Element;
|
|
24
24
|
export {};
|
|
@@ -31,4 +31,4 @@ export interface SpotlightPrimaryActionProps {
|
|
|
31
31
|
* for single step spotlights, or to show the next step on multi step spotlight tours.
|
|
32
32
|
*
|
|
33
33
|
*/
|
|
34
|
-
export declare const SpotlightPrimaryAction:
|
|
34
|
+
export declare const SpotlightPrimaryAction: React.ForwardRefExoticComponent<React.PropsWithoutRef<SpotlightPrimaryActionProps> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -31,4 +31,4 @@ export interface SpotlightSecondaryActionProps {
|
|
|
31
31
|
* It is intended to be used to go back to the previous step in multi step spotlight tours, or other similar actions.
|
|
32
32
|
*
|
|
33
33
|
*/
|
|
34
|
-
export declare const SpotlightSecondaryAction:
|
|
34
|
+
export declare const SpotlightSecondaryAction: React.ForwardRefExoticComponent<React.PropsWithoutRef<SpotlightSecondaryActionProps> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -17,4 +17,4 @@ export interface SpotlightShowMoreControlProps {
|
|
|
17
17
|
* SpotlightShowMoreControl allows the user to close the `Spotlight`.
|
|
18
18
|
*
|
|
19
19
|
*/
|
|
20
|
-
export declare const SpotlightShowMoreControl:
|
|
20
|
+
export declare const SpotlightShowMoreControl: React.ForwardRefExoticComponent<React.PropsWithoutRef<SpotlightShowMoreControlProps> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -21,4 +21,4 @@ export interface SpotlightStepCountProps {
|
|
|
21
21
|
* `SpotlightStepCount` groups `SpotlightAction` components.
|
|
22
22
|
*
|
|
23
23
|
*/
|
|
24
|
-
export declare const SpotlightStepCount:
|
|
24
|
+
export declare const SpotlightStepCount: React.ForwardRefExoticComponent<React.PropsWithoutRef<SpotlightStepCountProps> & React.RefAttributes<HTMLSpanElement>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/spotlight",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
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",
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"@atlaskit/button": "^23.4.0",
|
|
30
30
|
"@atlaskit/css": "^0.14.0",
|
|
31
31
|
"@atlaskit/heading": "^5.2.0",
|
|
32
|
-
"@atlaskit/icon": "^28.
|
|
32
|
+
"@atlaskit/icon": "^28.3.0",
|
|
33
33
|
"@atlaskit/image": "^3.0.0",
|
|
34
34
|
"@atlaskit/popper": "^7.1.0",
|
|
35
35
|
"@atlaskit/primitives": "^14.15.0",
|
|
36
|
-
"@atlaskit/tokens": "^6.
|
|
36
|
+
"@atlaskit/tokens": "^6.4.0",
|
|
37
37
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
38
38
|
"@babel/runtime": "^7.0.0",
|
|
39
39
|
"@compiled/react": "^0.18.3"
|