@atlaskit/spotlight 0.3.2 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/cjs/controllers/context.js +17 -2
  3. package/dist/cjs/ui/actions/index.js +1 -1
  4. package/dist/cjs/ui/body/index.js +1 -1
  5. package/dist/cjs/ui/card/caret/index.compiled.css +4 -3
  6. package/dist/cjs/ui/card/caret/index.js +12 -12
  7. package/dist/cjs/ui/card/index.js +1 -1
  8. package/dist/cjs/ui/controls/index.js +1 -1
  9. package/dist/cjs/ui/dismiss-control/index.js +11 -5
  10. package/dist/cjs/ui/footer/index.js +1 -1
  11. package/dist/cjs/ui/header/index.js +1 -1
  12. package/dist/cjs/ui/headline/index.js +5 -1
  13. package/dist/cjs/ui/media/index.js +1 -1
  14. package/dist/cjs/ui/popover-content/index.compiled.css +1 -5
  15. package/dist/cjs/ui/popover-content/index.js +15 -10
  16. package/dist/cjs/ui/popover-provider/index.js +1 -1
  17. package/dist/cjs/ui/popover-target/index.js +1 -1
  18. package/dist/cjs/ui/primary-action/index.js +4 -2
  19. package/dist/cjs/ui/secondary-action/index.js +4 -2
  20. package/dist/cjs/ui/show-more-control/index.js +1 -1
  21. package/dist/cjs/ui/step-count/index.js +4 -2
  22. package/dist/es2019/controllers/context.js +14 -4
  23. package/dist/es2019/ui/actions/index.js +1 -1
  24. package/dist/es2019/ui/body/index.js +1 -1
  25. package/dist/es2019/ui/card/caret/index.compiled.css +4 -3
  26. package/dist/es2019/ui/card/caret/index.js +12 -12
  27. package/dist/es2019/ui/card/index.js +1 -1
  28. package/dist/es2019/ui/controls/index.js +1 -1
  29. package/dist/es2019/ui/dismiss-control/index.js +9 -4
  30. package/dist/es2019/ui/footer/index.js +1 -1
  31. package/dist/es2019/ui/header/index.js +1 -1
  32. package/dist/es2019/ui/headline/index.js +7 -2
  33. package/dist/es2019/ui/media/index.js +1 -1
  34. package/dist/es2019/ui/popover-content/index.compiled.css +1 -5
  35. package/dist/es2019/ui/popover-content/index.js +20 -13
  36. package/dist/es2019/ui/popover-provider/index.js +1 -1
  37. package/dist/es2019/ui/popover-target/index.js +1 -1
  38. package/dist/es2019/ui/primary-action/index.js +3 -1
  39. package/dist/es2019/ui/secondary-action/index.js +3 -1
  40. package/dist/es2019/ui/show-more-control/index.js +1 -1
  41. package/dist/es2019/ui/step-count/index.js +3 -2
  42. package/dist/esm/controllers/context.js +18 -3
  43. package/dist/esm/ui/actions/index.js +1 -1
  44. package/dist/esm/ui/body/index.js +1 -1
  45. package/dist/esm/ui/card/caret/index.compiled.css +4 -3
  46. package/dist/esm/ui/card/caret/index.js +12 -12
  47. package/dist/esm/ui/card/index.js +1 -1
  48. package/dist/esm/ui/controls/index.js +1 -1
  49. package/dist/esm/ui/dismiss-control/index.js +11 -5
  50. package/dist/esm/ui/footer/index.js +1 -1
  51. package/dist/esm/ui/header/index.js +1 -1
  52. package/dist/esm/ui/headline/index.js +6 -2
  53. package/dist/esm/ui/media/index.js +1 -1
  54. package/dist/esm/ui/popover-content/index.compiled.css +1 -5
  55. package/dist/esm/ui/popover-content/index.js +15 -10
  56. package/dist/esm/ui/popover-provider/index.js +1 -1
  57. package/dist/esm/ui/popover-target/index.js +1 -1
  58. package/dist/esm/ui/primary-action/index.js +4 -2
  59. package/dist/esm/ui/secondary-action/index.js +4 -2
  60. package/dist/esm/ui/show-more-control/index.js +1 -1
  61. package/dist/esm/ui/step-count/index.js +3 -2
  62. package/dist/types/controllers/context.d.ts +4 -0
  63. package/dist/types/ui/dismiss-control/index.d.ts +8 -0
  64. package/dist/types/ui/popover-content/index.d.ts +7 -1
  65. package/dist/types/ui/primary-action/index.d.ts +4 -0
  66. package/dist/types/ui/secondary-action/index.d.ts +4 -0
  67. package/dist/types-ts4.5/controllers/context.d.ts +4 -0
  68. package/dist/types-ts4.5/ui/dismiss-control/index.d.ts +8 -0
  69. package/dist/types-ts4.5/ui/popover-content/index.d.ts +7 -1
  70. package/dist/types-ts4.5/ui/primary-action/index.d.ts +4 -0
  71. package/dist/types-ts4.5/ui/secondary-action/index.d.ts +4 -0
  72. package/package.json +4 -3
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
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";
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
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.36.1 */
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,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
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";
@@ -1,9 +1,10 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
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.36.1 */
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.36.1 */
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";
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
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";
@@ -1,10 +1,11 @@
1
1
  ._1bsbo7ao{width:15px}
2
- ._1eint94y{border-end-end-radius:1px}
3
2
  ._1pby1fw0{z-index:700}
4
- ._1s1gt94y{border-start-start-radius:1px}
5
3
  ._1yxnt94y{border-end-start-radius:1px}
6
4
  ._4t3io7ao{height:15px}
7
- ._5fbct94y{border-start-end-radius:1px}
8
5
  ._bfhkcdhy{background-color:var(--ds-background-neutral-bold,#44546f)}
9
6
  ._kqswh2mm{position:relative}
7
+ ._mkrzmhja{clip-path:polygon(0 0,100% 100%,0 100%)}
8
+ ._t9ec1hke{transform:rotate(135deg)}
9
+ ._t9ec71a3{transform:rotate(315deg)}
10
+ ._t9ecebzf{transform:rotate(225deg)}
10
11
  ._t9ecjyd4{transform:rotate(45deg)}
@@ -1,21 +1,21 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./index.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import { forwardRef, useContext } from 'react';
6
6
  import { SpotlightContext } from '../../../controllers/context';
7
7
  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__
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
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";
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
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";
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
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,13 +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
- 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,
22
26
  onClick: onClick,
23
27
  ref: ref,
24
- testId: testId
28
+ testId: testId,
29
+ xcss: styles.root,
30
+ "aria-label": "Dismiss"
25
31
  }, /*#__PURE__*/React.createElement(CrossIcon, {
26
32
  label: "Close"
27
33
  }));
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
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";
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
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";
@@ -1,8 +1,9 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
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.36.1 */
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";
@@ -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}
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./index.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -8,10 +8,6 @@ import { SpotlightContext } from '../../controllers/context';
8
8
  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
@@ -50,10 +46,11 @@ export var PopoverContent = function PopoverContent(_ref) {
50
46
  var children = _ref.children,
51
47
  placement = _ref.placement,
52
48
  _ref$isVisible = _ref.isVisible,
53
- isVisible = _ref$isVisible === void 0 ? true : _ref$isVisible;
49
+ isVisible = _ref$isVisible === void 0 ? true : _ref$isVisible,
50
+ testId = _ref.testId;
54
51
  var _useContext = useContext(SpotlightContext),
55
- setPlacement = _useContext.setPlacement;
56
- var visibility = isVisible ? 'visible' : 'hidden';
52
+ setPlacement = _useContext.setPlacement,
53
+ heading = _useContext.heading;
57
54
  useEffect(function () {
58
55
  setPlacement(placement);
59
56
  }, [placement, setPlacement]);
@@ -63,10 +60,18 @@ export var PopoverContent = function PopoverContent(_ref) {
63
60
  }, function (_ref2) {
64
61
  var ref = _ref2.ref,
65
62
  style = _ref2.style;
63
+ if (!isVisible) {
64
+ return;
65
+ }
66
66
  return /*#__PURE__*/React.createElement("div", {
67
- ref: ref,
67
+ role: "dialog",
68
+ "data-testid": testId,
69
+ "aria-labelledby": heading.id,
70
+ ref: ref
71
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
72
+ ,
68
73
  style: style,
69
- className: ax([styles.root, visibilityStyles[visibility]])
74
+ className: ax([styles.root])
70
75
  }, children);
71
76
  });
72
77
  };
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
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
4
  import { Manager } from '@atlaskit/popper';
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
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";
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
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 onClick = _ref.onClick,
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.36.1 */
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 onClick = _ref.onClick,
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.36.1 */
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";
@@ -1,9 +1,10 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
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 }: {
@@ -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__
@@ -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 }: {
@@ -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__
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/spotlight",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
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,12 @@
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
- "@atlaskit/primitives": "^14.14.0",
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
  },