@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.
Files changed (50) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/ui/card/caret/index.compiled.css +4 -3
  3. package/dist/cjs/ui/card/caret/index.js +11 -11
  4. package/dist/cjs/ui/dismiss-control/index.js +10 -5
  5. package/dist/cjs/ui/popover-content/index.compiled.css +1 -5
  6. package/dist/cjs/ui/popover-content/index.js +4 -6
  7. package/dist/cjs/ui/step-count/index.js +1 -1
  8. package/dist/es2019/ui/card/caret/index.compiled.css +4 -3
  9. package/dist/es2019/ui/card/caret/index.js +11 -11
  10. package/dist/es2019/ui/dismiss-control/index.js +8 -4
  11. package/dist/es2019/ui/popover-content/index.compiled.css +1 -5
  12. package/dist/es2019/ui/popover-content/index.js +15 -15
  13. package/dist/es2019/ui/step-count/index.js +1 -1
  14. package/dist/esm/ui/card/caret/index.compiled.css +4 -3
  15. package/dist/esm/ui/card/caret/index.js +11 -11
  16. package/dist/esm/ui/dismiss-control/index.js +10 -5
  17. package/dist/esm/ui/popover-content/index.compiled.css +1 -5
  18. package/dist/esm/ui/popover-content/index.js +4 -6
  19. package/dist/esm/ui/step-count/index.js +1 -1
  20. package/dist/types/ui/actions/index.d.ts +1 -1
  21. package/dist/types/ui/body/index.d.ts +1 -1
  22. package/dist/types/ui/card/caret/index.d.ts +1 -1
  23. package/dist/types/ui/card/index.d.ts +1 -1
  24. package/dist/types/ui/controls/index.d.ts +1 -1
  25. package/dist/types/ui/dismiss-control/index.d.ts +9 -1
  26. package/dist/types/ui/footer/index.d.ts +1 -1
  27. package/dist/types/ui/header/index.d.ts +1 -1
  28. package/dist/types/ui/headline/index.d.ts +1 -1
  29. package/dist/types/ui/media/index.d.ts +1 -1
  30. package/dist/types/ui/popover-content/index.d.ts +1 -1
  31. package/dist/types/ui/primary-action/index.d.ts +1 -1
  32. package/dist/types/ui/secondary-action/index.d.ts +1 -1
  33. package/dist/types/ui/show-more-control/index.d.ts +1 -1
  34. package/dist/types/ui/step-count/index.d.ts +1 -1
  35. package/dist/types-ts4.5/ui/actions/index.d.ts +1 -1
  36. package/dist/types-ts4.5/ui/body/index.d.ts +1 -1
  37. package/dist/types-ts4.5/ui/card/caret/index.d.ts +1 -1
  38. package/dist/types-ts4.5/ui/card/index.d.ts +1 -1
  39. package/dist/types-ts4.5/ui/controls/index.d.ts +1 -1
  40. package/dist/types-ts4.5/ui/dismiss-control/index.d.ts +9 -1
  41. package/dist/types-ts4.5/ui/footer/index.d.ts +1 -1
  42. package/dist/types-ts4.5/ui/header/index.d.ts +1 -1
  43. package/dist/types-ts4.5/ui/headline/index.d.ts +1 -1
  44. package/dist/types-ts4.5/ui/media/index.d.ts +1 -1
  45. package/dist/types-ts4.5/ui/popover-content/index.d.ts +1 -1
  46. package/dist/types-ts4.5/ui/primary-action/index.d.ts +1 -1
  47. package/dist/types-ts4.5/ui/secondary-action/index.d.ts +1 -1
  48. package/dist/types-ts4.5/ui/show-more-control/index.d.ts +1 -1
  49. package/dist/types-ts4.5/ui/step-count/index.d.ts +1 -1
  50. 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: "_kqswh2mm _1pby1fw0 _1bsbo7ao _4t3io7ao _t9ecjyd4 _bfhkcdhy",
17
- 'top-start': "_1eint94y",
18
- 'top-center': "_1eint94y",
19
- 'top-end': "_1eint94y",
20
- 'bottom-start': "_1s1gt94y",
21
- 'bottom-center': "_1s1gt94y",
22
- 'bottom-end': "_1s1gt94y",
23
- 'right-start': "_1yxnt94y",
24
- 'right-end': "_1yxnt94y",
25
- 'left-start': "_5fbct94y",
26
- 'left-end': "_5fbct94y"
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 onClick = _ref.onClick,
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
- "aria-label": "Dismiss",
31
- xcss: styles.root,
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
  }));
@@ -1,5 +1 @@
1
- ._1pby1fw0{z-index:700}
2
- ._3um015vq{visibility:hidden}
3
- ._3um0ewfl{visibility:visible}
4
- ._lcxv1wug{pointer-events:auto}
5
- ._lcxvglyw{pointer-events:none}
1
+ ._1pby1fw0{z-index:700}
@@ -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, visibilityStyles[visibility]])
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, ' ', /*#__PURE__*/React.createElement(_visuallyHidden.default, null, "steps")));
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: "_kqswh2mm _1pby1fw0 _1bsbo7ao _4t3io7ao _t9ecjyd4 _bfhkcdhy",
9
- 'top-start': "_1eint94y",
10
- 'top-center': "_1eint94y",
11
- 'top-end': "_1eint94y",
12
- 'bottom-start': "_1s1gt94y",
13
- 'bottom-center': "_1s1gt94y",
14
- 'bottom-end': "_1s1gt94y",
15
- 'right-start': "_1yxnt94y",
16
- 'right-end': "_1yxnt94y",
17
- 'left-start': "_5fbct94y",
18
- 'left-end': "_5fbct94y"
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
- "aria-label": "Dismiss",
23
- xcss: styles.root,
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
  }));
@@ -1,5 +1 @@
1
- ._1pby1fw0{z-index:700}
2
- ._3um015vq{visibility:hidden}
3
- ._3um0ewfl{visibility:visible}
4
- ._lcxv1wug{pointer-events:auto}
5
- ._lcxvglyw{pointer-events:none}
1
+ ._1pby1fw0{z-index:700}
@@ -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
- }) => /*#__PURE__*/React.createElement("div", {
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
- ,
76
- style: style,
77
- className: ax([styles.root, visibilityStyles[visibility]])
78
- }, children));
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, ' ', /*#__PURE__*/React.createElement(VisuallyHidden, null, "steps")));
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: "_kqswh2mm _1pby1fw0 _1bsbo7ao _4t3io7ao _t9ecjyd4 _bfhkcdhy",
9
- 'top-start': "_1eint94y",
10
- 'top-center': "_1eint94y",
11
- 'top-end': "_1eint94y",
12
- 'bottom-start': "_1s1gt94y",
13
- 'bottom-center': "_1s1gt94y",
14
- 'bottom-end': "_1s1gt94y",
15
- 'right-start': "_1yxnt94y",
16
- 'right-end': "_1yxnt94y",
17
- 'left-start': "_5fbct94y",
18
- 'left-end': "_5fbct94y"
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 onClick = _ref.onClick,
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
- "aria-label": "Dismiss",
22
- xcss: styles.root,
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,5 +1 @@
1
- ._1pby1fw0{z-index:700}
2
- ._3um015vq{visibility:hidden}
3
- ._3um0ewfl{visibility:visible}
4
- ._lcxv1wug{pointer-events:auto}
5
- ._lcxvglyw{pointer-events:none}
1
+ ._1pby1fw0{z-index:700}
@@ -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, visibilityStyles[visibility]])
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, ' ', /*#__PURE__*/React.createElement(VisuallyHidden, null, "steps")));
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: import("react").ForwardRefExoticComponent<SpotlightActionsProps & import("react").RefAttributes<HTMLDivElement>>;
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: import("react").ForwardRefExoticComponent<SpotlightBodyProps & import("react").RefAttributes<HTMLDivElement>>;
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: import("react").ForwardRefExoticComponent<CaretProps & import("react").RefAttributes<HTMLDivElement>>;
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: import("react").ForwardRefExoticComponent<SpotlightCardProps & import("react").RefAttributes<HTMLDivElement>>;
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: import("react").ForwardRefExoticComponent<SpotlightControlsProps & import("react").RefAttributes<HTMLDivElement>>;
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: import("react").ForwardRefExoticComponent<SpotlightDismissControlProps & import("react").RefAttributes<HTMLButtonElement>>;
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: import("react").ForwardRefExoticComponent<SpotlightFooterProps & import("react").RefAttributes<HTMLDivElement>>;
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: import("react").ForwardRefExoticComponent<SpotlightHeaderProps & import("react").RefAttributes<HTMLDivElement>>;
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: import("react").ForwardRefExoticComponent<SpotlightHeadlineProps & import("react").RefAttributes<HTMLHeadingElement>>;
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: import("react").ForwardRefExoticComponent<SpotlightMediaProps & import("react").RefAttributes<HTMLDivElement>>;
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: import("react").ForwardRefExoticComponent<SpotlightPrimaryActionProps & import("react").RefAttributes<HTMLButtonElement>>;
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: import("react").ForwardRefExoticComponent<SpotlightSecondaryActionProps & import("react").RefAttributes<HTMLButtonElement>>;
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: import("react").ForwardRefExoticComponent<SpotlightShowMoreControlProps & import("react").RefAttributes<HTMLButtonElement>>;
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: import("react").ForwardRefExoticComponent<SpotlightStepCountProps & import("react").RefAttributes<HTMLSpanElement>>;
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: import("react").ForwardRefExoticComponent<SpotlightActionsProps & import("react").RefAttributes<HTMLDivElement>>;
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: import("react").ForwardRefExoticComponent<SpotlightBodyProps & import("react").RefAttributes<HTMLDivElement>>;
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: import("react").ForwardRefExoticComponent<CaretProps & import("react").RefAttributes<HTMLDivElement>>;
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: import("react").ForwardRefExoticComponent<SpotlightCardProps & import("react").RefAttributes<HTMLDivElement>>;
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: import("react").ForwardRefExoticComponent<SpotlightControlsProps & import("react").RefAttributes<HTMLDivElement>>;
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: import("react").ForwardRefExoticComponent<SpotlightDismissControlProps & import("react").RefAttributes<HTMLButtonElement>>;
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: import("react").ForwardRefExoticComponent<SpotlightFooterProps & import("react").RefAttributes<HTMLDivElement>>;
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: import("react").ForwardRefExoticComponent<SpotlightHeaderProps & import("react").RefAttributes<HTMLDivElement>>;
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: import("react").ForwardRefExoticComponent<SpotlightHeadlineProps & import("react").RefAttributes<HTMLHeadingElement>>;
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: import("react").ForwardRefExoticComponent<SpotlightMediaProps & import("react").RefAttributes<HTMLDivElement>>;
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: import("react").ForwardRefExoticComponent<SpotlightPrimaryActionProps & import("react").RefAttributes<HTMLButtonElement>>;
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: import("react").ForwardRefExoticComponent<SpotlightSecondaryActionProps & import("react").RefAttributes<HTMLButtonElement>>;
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: import("react").ForwardRefExoticComponent<SpotlightShowMoreControlProps & import("react").RefAttributes<HTMLButtonElement>>;
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: import("react").ForwardRefExoticComponent<SpotlightStepCountProps & import("react").RefAttributes<HTMLSpanElement>>;
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",
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.2.0",
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.3.0",
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"