@atlaskit/spotlight 0.0.10 → 0.0.12

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 (38) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/index.js +14 -0
  3. package/dist/cjs/ui/media/index.compiled.css +2 -0
  4. package/dist/cjs/ui/media/index.js +31 -0
  5. package/dist/cjs/ui/show-more-control/index.js +31 -0
  6. package/dist/cjs/ui/spotlight/caret/index.compiled.css +6 -2
  7. package/dist/cjs/ui/spotlight/caret/index.js +13 -2
  8. package/dist/cjs/ui/spotlight/index.compiled.css +5 -5
  9. package/dist/cjs/ui/spotlight/index.js +8 -8
  10. package/dist/es2019/index.js +2 -0
  11. package/dist/es2019/ui/media/index.compiled.css +2 -0
  12. package/dist/es2019/ui/media/index.js +24 -0
  13. package/dist/es2019/ui/popover-content/index.js +1 -1
  14. package/dist/es2019/ui/show-more-control/index.js +23 -0
  15. package/dist/es2019/ui/spotlight/caret/index.compiled.css +6 -2
  16. package/dist/es2019/ui/spotlight/caret/index.js +15 -3
  17. package/dist/es2019/ui/spotlight/index.compiled.css +5 -5
  18. package/dist/es2019/ui/spotlight/index.js +8 -8
  19. package/dist/esm/index.js +2 -0
  20. package/dist/esm/ui/media/index.compiled.css +2 -0
  21. package/dist/esm/ui/media/index.js +23 -0
  22. package/dist/esm/ui/popover-content/index.js +1 -1
  23. package/dist/esm/ui/show-more-control/index.js +22 -0
  24. package/dist/esm/ui/spotlight/caret/index.compiled.css +6 -2
  25. package/dist/esm/ui/spotlight/caret/index.js +14 -3
  26. package/dist/esm/ui/spotlight/index.compiled.css +5 -5
  27. package/dist/esm/ui/spotlight/index.js +8 -8
  28. package/dist/types/index.d.ts +2 -0
  29. package/dist/types/ui/body/index.d.ts +1 -1
  30. package/dist/types/ui/media/index.d.ts +21 -0
  31. package/dist/types/ui/popover-content/index.d.ts +1 -1
  32. package/dist/types/ui/show-more-control/index.d.ts +21 -0
  33. package/dist/types-ts4.5/index.d.ts +2 -0
  34. package/dist/types-ts4.5/ui/body/index.d.ts +1 -1
  35. package/dist/types-ts4.5/ui/media/index.d.ts +21 -0
  36. package/dist/types-ts4.5/ui/popover-content/index.d.ts +1 -1
  37. package/dist/types-ts4.5/ui/show-more-control/index.d.ts +21 -0
  38. package/package.json +4 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atlaskit/spotlight
2
2
 
3
+ ## 0.0.12
4
+
5
+ ### Patch Changes
6
+
7
+ - [`7121a32fb1613`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7121a32fb1613) -
8
+ Create ShowMoreControl component.
9
+
10
+ ## 0.0.11
11
+
12
+ ### Patch Changes
13
+
14
+ - [#200012](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/200012)
15
+ [`fa829c42fc74f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fa829c42fc74f) -
16
+ Create SpotlightMedia component.
17
+
3
18
  ## 0.0.10
4
19
 
5
20
  ### Patch Changes
package/dist/cjs/index.js CHANGED
@@ -69,6 +69,12 @@ Object.defineProperty(exports, "SpotlightHeadline", {
69
69
  return _headline.SpotlightHeadline;
70
70
  }
71
71
  });
72
+ Object.defineProperty(exports, "SpotlightMedia", {
73
+ enumerable: true,
74
+ get: function get() {
75
+ return _media.SpotlightMedia;
76
+ }
77
+ });
72
78
  Object.defineProperty(exports, "SpotlightPrimaryAction", {
73
79
  enumerable: true,
74
80
  get: function get() {
@@ -81,6 +87,12 @@ Object.defineProperty(exports, "SpotlightSecondaryAction", {
81
87
  return _secondaryAction.SpotlightSecondaryAction;
82
88
  }
83
89
  });
90
+ Object.defineProperty(exports, "SpotlightShowMoreControl", {
91
+ enumerable: true,
92
+ get: function get() {
93
+ return _showMoreControl.SpotlightShowMoreControl;
94
+ }
95
+ });
84
96
  Object.defineProperty(exports, "TourContext", {
85
97
  enumerable: true,
86
98
  get: function get() {
@@ -103,6 +115,8 @@ var _primaryAction = require("./ui/primary-action");
103
115
  var _secondaryAction = require("./ui/secondary-action");
104
116
  var _controls = require("./ui/controls");
105
117
  var _dismissControl = require("./ui/dismiss-control");
118
+ var _showMoreControl = require("./ui/show-more-control");
119
+ var _media = require("./ui/media");
106
120
  var _popoverProvider = require("./ui/popover-provider");
107
121
  var _popoverContent = require("./ui/popover-content");
108
122
  var _popoverTarget = require("./ui/popover-target");
@@ -0,0 +1,2 @@
1
+ ._1bsbaq3k{width:295px}
2
+ ._4t3ihcro{height:135px}
@@ -0,0 +1,31 @@
1
+ /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ "use strict";
3
+
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.SpotlightMedia = void 0;
9
+ require("./index.compiled.css");
10
+ var _runtime = require("@compiled/react/runtime");
11
+ var _react = _interopRequireWildcard(require("react"));
12
+ var _compiled = require("@atlaskit/primitives/compiled");
13
+ 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); }
14
+ var styles = {
15
+ root: "_1bsbaq3k _4t3ihcro"
16
+ };
17
+ /**
18
+ * __SpotlightMedia__
19
+ *
20
+ * `SpotlightMedia` is optional in a `Spotlight`.
21
+ *
22
+ */
23
+ var SpotlightMedia = exports.SpotlightMedia = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
24
+ var children = _ref.children,
25
+ testId = _ref.testId;
26
+ return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
27
+ ref: ref,
28
+ xcss: styles.root,
29
+ testId: testId
30
+ }, children);
31
+ });
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.SpotlightShowMoreControl = void 0;
9
+ var _react = _interopRequireWildcard(require("react"));
10
+ var _new = require("@atlaskit/button/new");
11
+ var _showMoreHorizontal = _interopRequireDefault(require("@atlaskit/icon/core/show-more-horizontal"));
12
+ 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); }
13
+ /**
14
+ * __SpotlightShowMoreControl__
15
+ *
16
+ * SpotlightShowMoreControl allows the user to close the `Spotlight`.
17
+ *
18
+ */
19
+ var SpotlightShowMoreControl = exports.SpotlightShowMoreControl = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
20
+ var onClick = _ref.onClick,
21
+ testId = _ref.testId;
22
+ return /*#__PURE__*/_react.default.createElement(_new.IconButton, {
23
+ appearance: "default",
24
+ icon: _showMoreHorizontal.default,
25
+ label: "Close",
26
+ onClick: onClick,
27
+ ref: ref,
28
+ spacing: "compact",
29
+ testId: testId
30
+ });
31
+ });
@@ -1,4 +1,8 @@
1
- ._1bsb7vkz{width:1pc}
2
- ._4t3i7vkz{height:1pc}
1
+ ._13lit94y{border-top-left-radius:1px}
2
+ ._1bsbo7ao{width:15px}
3
+ ._1o0zt94y{border-bottom-right-radius:1px}
4
+ ._4t3io7ao{height:15px}
3
5
  ._bfhkcdhy{background-color:var(--ds-background-neutral-bold,#44546f)}
6
+ ._mrkbt94y{border-bottom-left-radius:1px}
7
+ ._qrwqt94y{border-top-right-radius:1px}
4
8
  ._t9ecjyd4{transform:rotate(45deg)}
@@ -10,9 +10,18 @@ require("./index.compiled.css");
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
  var React = _react;
12
12
  var _runtime = require("@compiled/react/runtime");
13
+ var _context = require("../../../controllers/context");
13
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); }
14
15
  var styles = {
15
- root: "_1bsb7vkz _4t3i7vkz _t9ecjyd4 _bfhkcdhy"
16
+ root: "_1bsbo7ao _4t3io7ao _t9ecjyd4 _bfhkcdhy",
17
+ 'top-start': "_1o0zt94y",
18
+ 'top-end': "_1o0zt94y",
19
+ 'bottom-start': "_13lit94y",
20
+ 'bottom-end': "_13lit94y",
21
+ 'right-start': "_mrkbt94y",
22
+ 'right-end': "_mrkbt94y",
23
+ 'left-start': "_qrwqt94y",
24
+ 'left-end': "_qrwqt94y"
16
25
  };
17
26
  /**
18
27
  * __Caret__
@@ -22,9 +31,11 @@ var styles = {
22
31
  */
23
32
  var Caret = exports.Caret = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
24
33
  var testId = _ref.testId;
34
+ var _useContext = (0, _react.useContext)(_context.SpotlightContext),
35
+ placement = _useContext.placement;
25
36
  return /*#__PURE__*/React.createElement("div", {
26
37
  "data-testid": testId,
27
38
  ref: ref,
28
- className: (0, _runtime.ax)([styles.root])
39
+ className: (0, _runtime.ax)([styles.root, styles[placement]])
29
40
  });
30
41
  });
@@ -1,16 +1,16 @@
1
1
 
2
2
  ._2rkopd34{border-radius:var(--ds-border-radius-200,8px)}
3
3
  ._zulppxbi{gap:var(--ds-space-200,1pc)}
4
- ._1rjcutpp{padding-block:var(--ds-space-150,9pt)}._154imgjw{top:var(--ds-space-negative-200,-1pc)}
5
- ._154iu2gc{top:var(--ds-space-100,8px)}
4
+ ._1rjcutpp{padding-block:var(--ds-space-150,9pt)}._154i12x7{top:var(--ds-space-075,6px)}
5
+ ._154imgjw{top:var(--ds-space-negative-200,-1pc)}
6
6
  ._1bsbaq3k{width:295px}
7
7
  ._1e0c1txw{display:flex}
8
+ ._1ltv12x7{left:var(--ds-space-075,6px)}
8
9
  ._1ltvmgjw{left:var(--ds-space-negative-200,-1pc)}
9
- ._1ltvu2gc{left:var(--ds-space-100,8px)}
10
+ ._1xi212x7{right:var(--ds-space-075,6px)}
10
11
  ._1xi2mgjw{right:var(--ds-space-negative-200,-1pc)}
11
- ._1xi2u2gc{right:var(--ds-space-100,8px)}
12
12
  ._2lx21bp4{flex-direction:column}
13
+ ._94n512x7{bottom:var(--ds-space-075,6px)}
13
14
  ._94n5mgjw{bottom:var(--ds-space-negative-200,-1pc)}
14
- ._94n5u2gc{bottom:var(--ds-space-100,8px)}
15
15
  ._kqswh2mm{position:relative}
16
16
  ._kqswstnw{position:absolute}
@@ -20,14 +20,14 @@ var styles = {
20
20
  card: "_2rkopd34 _zulppxbi _1rjcutpp _kqswstnw _1bsbaq3k _1e0c1txw _2lx21bp4"
21
21
  };
22
22
  var placementStyles = {
23
- 'top-start': "_94n5u2gc _1xi2mgjw",
24
- 'top-end': "_94n5u2gc _1ltvmgjw",
25
- 'right-start': "_1ltvu2gc _94n5mgjw",
26
- 'right-end': "_1ltvu2gc _154imgjw",
27
- 'bottom-start': "_154iu2gc _1xi2mgjw",
28
- 'bottom-end': "_154iu2gc _1ltvmgjw",
29
- 'left-start': "_1xi2u2gc _94n5mgjw",
30
- 'left-end': "_1xi2u2gc _154imgjw"
23
+ 'top-start': "_94n512x7 _1xi2mgjw",
24
+ 'top-end': "_94n512x7 _1ltvmgjw",
25
+ 'right-start': "_1ltv12x7 _94n5mgjw",
26
+ 'right-end': "_1ltv12x7 _154imgjw",
27
+ 'bottom-start': "_154i12x7 _1xi2mgjw",
28
+ 'bottom-end': "_154i12x7 _1ltvmgjw",
29
+ 'left-start': "_1xi212x7 _94n5mgjw",
30
+ 'left-end': "_1xi212x7 _154imgjw"
31
31
  };
32
32
  /**
33
33
  * __Spotlight__
@@ -8,6 +8,8 @@ export { SpotlightPrimaryAction } from './ui/primary-action';
8
8
  export { SpotlightSecondaryAction } from './ui/secondary-action';
9
9
  export { SpotlightControls } from './ui/controls';
10
10
  export { SpotlightDismissControl } from './ui/dismiss-control';
11
+ export { SpotlightShowMoreControl } from './ui/show-more-control';
12
+ export { SpotlightMedia } from './ui/media';
11
13
  export { PopoverProvider } from './ui/popover-provider';
12
14
  export { PopoverContent } from './ui/popover-content';
13
15
  export { PopoverTarget } from './ui/popover-target';
@@ -0,0 +1,2 @@
1
+ ._1bsbaq3k{width:295px}
2
+ ._4t3ihcro{height:135px}
@@ -0,0 +1,24 @@
1
+ /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import "./index.compiled.css";
3
+ import { ax, ix } from "@compiled/react/runtime";
4
+ import React, { forwardRef } from 'react';
5
+ import { Box } from '@atlaskit/primitives/compiled';
6
+ const styles = {
7
+ root: "_1bsbaq3k _4t3ihcro"
8
+ };
9
+ /**
10
+ * __SpotlightMedia__
11
+ *
12
+ * `SpotlightMedia` is optional in a `Spotlight`.
13
+ *
14
+ */
15
+ export const SpotlightMedia = /*#__PURE__*/forwardRef(({
16
+ children,
17
+ testId
18
+ }, ref) => {
19
+ return /*#__PURE__*/React.createElement(Box, {
20
+ ref: ref,
21
+ xcss: styles.root,
22
+ testId: testId
23
+ }, children);
24
+ });
@@ -2,7 +2,7 @@
2
2
  import "./index.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
- import { useContext, useEffect } from "react";
5
+ import { useContext, useEffect } from 'react';
6
6
  import { Popper } from '@atlaskit/popper';
7
7
  import { SpotlightContext } from '../../controllers/context';
8
8
  const styles = {
@@ -0,0 +1,23 @@
1
+ import React, { forwardRef } from 'react';
2
+ import { IconButton } from '@atlaskit/button/new';
3
+ import ShowMoreHorizontalIcon from '@atlaskit/icon/core/show-more-horizontal';
4
+ /**
5
+ * __SpotlightShowMoreControl__
6
+ *
7
+ * SpotlightShowMoreControl allows the user to close the `Spotlight`.
8
+ *
9
+ */
10
+ export const SpotlightShowMoreControl = /*#__PURE__*/forwardRef(({
11
+ onClick,
12
+ testId
13
+ }, ref) => {
14
+ return /*#__PURE__*/React.createElement(IconButton, {
15
+ appearance: "default",
16
+ icon: ShowMoreHorizontalIcon,
17
+ label: "Close",
18
+ onClick: onClick,
19
+ ref: ref,
20
+ spacing: "compact",
21
+ testId: testId
22
+ });
23
+ });
@@ -1,4 +1,8 @@
1
- ._1bsb7vkz{width:1pc}
2
- ._4t3i7vkz{height:1pc}
1
+ ._13lit94y{border-top-left-radius:1px}
2
+ ._1bsbo7ao{width:15px}
3
+ ._1o0zt94y{border-bottom-right-radius:1px}
4
+ ._4t3io7ao{height:15px}
3
5
  ._bfhkcdhy{background-color:var(--ds-background-neutral-bold,#44546f)}
6
+ ._mrkbt94y{border-bottom-left-radius:1px}
7
+ ._qrwqt94y{border-top-right-radius:1px}
4
8
  ._t9ecjyd4{transform:rotate(45deg)}
@@ -2,9 +2,18 @@
2
2
  import "./index.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
- import { forwardRef } from 'react';
5
+ import { forwardRef, useContext } from 'react';
6
+ import { SpotlightContext } from '../../../controllers/context';
6
7
  const styles = {
7
- root: "_1bsb7vkz _4t3i7vkz _t9ecjyd4 _bfhkcdhy"
8
+ root: "_1bsbo7ao _4t3io7ao _t9ecjyd4 _bfhkcdhy",
9
+ 'top-start': "_1o0zt94y",
10
+ 'top-end': "_1o0zt94y",
11
+ 'bottom-start': "_13lit94y",
12
+ 'bottom-end': "_13lit94y",
13
+ 'right-start': "_mrkbt94y",
14
+ 'right-end': "_mrkbt94y",
15
+ 'left-start': "_qrwqt94y",
16
+ 'left-end': "_qrwqt94y"
8
17
  };
9
18
  /**
10
19
  * __Caret__
@@ -15,9 +24,12 @@ const styles = {
15
24
  export const Caret = /*#__PURE__*/forwardRef(({
16
25
  testId
17
26
  }, ref) => {
27
+ const {
28
+ placement
29
+ } = useContext(SpotlightContext);
18
30
  return /*#__PURE__*/React.createElement("div", {
19
31
  "data-testid": testId,
20
32
  ref: ref,
21
- className: ax([styles.root])
33
+ className: ax([styles.root, styles[placement]])
22
34
  });
23
35
  });
@@ -1,16 +1,16 @@
1
1
 
2
2
  ._2rkopd34{border-radius:var(--ds-border-radius-200,8px)}
3
3
  ._zulppxbi{gap:var(--ds-space-200,1pc)}
4
- ._1rjcutpp{padding-block:var(--ds-space-150,9pt)}._154imgjw{top:var(--ds-space-negative-200,-1pc)}
5
- ._154iu2gc{top:var(--ds-space-100,8px)}
4
+ ._1rjcutpp{padding-block:var(--ds-space-150,9pt)}._154i12x7{top:var(--ds-space-075,6px)}
5
+ ._154imgjw{top:var(--ds-space-negative-200,-1pc)}
6
6
  ._1bsbaq3k{width:295px}
7
7
  ._1e0c1txw{display:flex}
8
+ ._1ltv12x7{left:var(--ds-space-075,6px)}
8
9
  ._1ltvmgjw{left:var(--ds-space-negative-200,-1pc)}
9
- ._1ltvu2gc{left:var(--ds-space-100,8px)}
10
+ ._1xi212x7{right:var(--ds-space-075,6px)}
10
11
  ._1xi2mgjw{right:var(--ds-space-negative-200,-1pc)}
11
- ._1xi2u2gc{right:var(--ds-space-100,8px)}
12
12
  ._2lx21bp4{flex-direction:column}
13
+ ._94n512x7{bottom:var(--ds-space-075,6px)}
13
14
  ._94n5mgjw{bottom:var(--ds-space-negative-200,-1pc)}
14
- ._94n5u2gc{bottom:var(--ds-space-100,8px)}
15
15
  ._kqswh2mm{position:relative}
16
16
  ._kqswstnw{position:absolute}
@@ -12,14 +12,14 @@ const styles = {
12
12
  card: "_2rkopd34 _zulppxbi _1rjcutpp _kqswstnw _1bsbaq3k _1e0c1txw _2lx21bp4"
13
13
  };
14
14
  const placementStyles = {
15
- 'top-start': "_94n5u2gc _1xi2mgjw",
16
- 'top-end': "_94n5u2gc _1ltvmgjw",
17
- 'right-start': "_1ltvu2gc _94n5mgjw",
18
- 'right-end': "_1ltvu2gc _154imgjw",
19
- 'bottom-start': "_154iu2gc _1xi2mgjw",
20
- 'bottom-end': "_154iu2gc _1ltvmgjw",
21
- 'left-start': "_1xi2u2gc _94n5mgjw",
22
- 'left-end': "_1xi2u2gc _154imgjw"
15
+ 'top-start': "_94n512x7 _1xi2mgjw",
16
+ 'top-end': "_94n512x7 _1ltvmgjw",
17
+ 'right-start': "_1ltv12x7 _94n5mgjw",
18
+ 'right-end': "_1ltv12x7 _154imgjw",
19
+ 'bottom-start': "_154i12x7 _1xi2mgjw",
20
+ 'bottom-end': "_154i12x7 _1ltvmgjw",
21
+ 'left-start': "_1xi212x7 _94n5mgjw",
22
+ 'left-end': "_1xi212x7 _154imgjw"
23
23
  };
24
24
  /**
25
25
  * __Spotlight__
package/dist/esm/index.js CHANGED
@@ -8,6 +8,8 @@ export { SpotlightPrimaryAction } from './ui/primary-action';
8
8
  export { SpotlightSecondaryAction } from './ui/secondary-action';
9
9
  export { SpotlightControls } from './ui/controls';
10
10
  export { SpotlightDismissControl } from './ui/dismiss-control';
11
+ export { SpotlightShowMoreControl } from './ui/show-more-control';
12
+ export { SpotlightMedia } from './ui/media';
11
13
  export { PopoverProvider } from './ui/popover-provider';
12
14
  export { PopoverContent } from './ui/popover-content';
13
15
  export { PopoverTarget } from './ui/popover-target';
@@ -0,0 +1,2 @@
1
+ ._1bsbaq3k{width:295px}
2
+ ._4t3ihcro{height:135px}
@@ -0,0 +1,23 @@
1
+ /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import "./index.compiled.css";
3
+ import { ax, ix } from "@compiled/react/runtime";
4
+ import React, { forwardRef } from 'react';
5
+ import { Box } from '@atlaskit/primitives/compiled';
6
+ var styles = {
7
+ root: "_1bsbaq3k _4t3ihcro"
8
+ };
9
+ /**
10
+ * __SpotlightMedia__
11
+ *
12
+ * `SpotlightMedia` is optional in a `Spotlight`.
13
+ *
14
+ */
15
+ export var SpotlightMedia = /*#__PURE__*/forwardRef(function (_ref, ref) {
16
+ var children = _ref.children,
17
+ testId = _ref.testId;
18
+ return /*#__PURE__*/React.createElement(Box, {
19
+ ref: ref,
20
+ xcss: styles.root,
21
+ testId: testId
22
+ }, children);
23
+ });
@@ -2,7 +2,7 @@
2
2
  import "./index.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
- import { useContext, useEffect } from "react";
5
+ import { useContext, useEffect } from 'react';
6
6
  import { Popper } from '@atlaskit/popper';
7
7
  import { SpotlightContext } from '../../controllers/context';
8
8
  var styles = {
@@ -0,0 +1,22 @@
1
+ import React, { forwardRef } from 'react';
2
+ import { IconButton } from '@atlaskit/button/new';
3
+ import ShowMoreHorizontalIcon from '@atlaskit/icon/core/show-more-horizontal';
4
+ /**
5
+ * __SpotlightShowMoreControl__
6
+ *
7
+ * SpotlightShowMoreControl allows the user to close the `Spotlight`.
8
+ *
9
+ */
10
+ export var SpotlightShowMoreControl = /*#__PURE__*/forwardRef(function (_ref, ref) {
11
+ var onClick = _ref.onClick,
12
+ testId = _ref.testId;
13
+ return /*#__PURE__*/React.createElement(IconButton, {
14
+ appearance: "default",
15
+ icon: ShowMoreHorizontalIcon,
16
+ label: "Close",
17
+ onClick: onClick,
18
+ ref: ref,
19
+ spacing: "compact",
20
+ testId: testId
21
+ });
22
+ });
@@ -1,4 +1,8 @@
1
- ._1bsb7vkz{width:1pc}
2
- ._4t3i7vkz{height:1pc}
1
+ ._13lit94y{border-top-left-radius:1px}
2
+ ._1bsbo7ao{width:15px}
3
+ ._1o0zt94y{border-bottom-right-radius:1px}
4
+ ._4t3io7ao{height:15px}
3
5
  ._bfhkcdhy{background-color:var(--ds-background-neutral-bold,#44546f)}
6
+ ._mrkbt94y{border-bottom-left-radius:1px}
7
+ ._qrwqt94y{border-top-right-radius:1px}
4
8
  ._t9ecjyd4{transform:rotate(45deg)}
@@ -2,9 +2,18 @@
2
2
  import "./index.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
- import { forwardRef } from 'react';
5
+ import { forwardRef, useContext } from 'react';
6
+ import { SpotlightContext } from '../../../controllers/context';
6
7
  var styles = {
7
- root: "_1bsb7vkz _4t3i7vkz _t9ecjyd4 _bfhkcdhy"
8
+ root: "_1bsbo7ao _4t3io7ao _t9ecjyd4 _bfhkcdhy",
9
+ 'top-start': "_1o0zt94y",
10
+ 'top-end': "_1o0zt94y",
11
+ 'bottom-start': "_13lit94y",
12
+ 'bottom-end': "_13lit94y",
13
+ 'right-start': "_mrkbt94y",
14
+ 'right-end': "_mrkbt94y",
15
+ 'left-start': "_qrwqt94y",
16
+ 'left-end': "_qrwqt94y"
8
17
  };
9
18
  /**
10
19
  * __Caret__
@@ -14,9 +23,11 @@ var styles = {
14
23
  */
15
24
  export var Caret = /*#__PURE__*/forwardRef(function (_ref, ref) {
16
25
  var testId = _ref.testId;
26
+ var _useContext = useContext(SpotlightContext),
27
+ placement = _useContext.placement;
17
28
  return /*#__PURE__*/React.createElement("div", {
18
29
  "data-testid": testId,
19
30
  ref: ref,
20
- className: ax([styles.root])
31
+ className: ax([styles.root, styles[placement]])
21
32
  });
22
33
  });
@@ -1,16 +1,16 @@
1
1
 
2
2
  ._2rkopd34{border-radius:var(--ds-border-radius-200,8px)}
3
3
  ._zulppxbi{gap:var(--ds-space-200,1pc)}
4
- ._1rjcutpp{padding-block:var(--ds-space-150,9pt)}._154imgjw{top:var(--ds-space-negative-200,-1pc)}
5
- ._154iu2gc{top:var(--ds-space-100,8px)}
4
+ ._1rjcutpp{padding-block:var(--ds-space-150,9pt)}._154i12x7{top:var(--ds-space-075,6px)}
5
+ ._154imgjw{top:var(--ds-space-negative-200,-1pc)}
6
6
  ._1bsbaq3k{width:295px}
7
7
  ._1e0c1txw{display:flex}
8
+ ._1ltv12x7{left:var(--ds-space-075,6px)}
8
9
  ._1ltvmgjw{left:var(--ds-space-negative-200,-1pc)}
9
- ._1ltvu2gc{left:var(--ds-space-100,8px)}
10
+ ._1xi212x7{right:var(--ds-space-075,6px)}
10
11
  ._1xi2mgjw{right:var(--ds-space-negative-200,-1pc)}
11
- ._1xi2u2gc{right:var(--ds-space-100,8px)}
12
12
  ._2lx21bp4{flex-direction:column}
13
+ ._94n512x7{bottom:var(--ds-space-075,6px)}
13
14
  ._94n5mgjw{bottom:var(--ds-space-negative-200,-1pc)}
14
- ._94n5u2gc{bottom:var(--ds-space-100,8px)}
15
15
  ._kqswh2mm{position:relative}
16
16
  ._kqswstnw{position:absolute}
@@ -12,14 +12,14 @@ var styles = {
12
12
  card: "_2rkopd34 _zulppxbi _1rjcutpp _kqswstnw _1bsbaq3k _1e0c1txw _2lx21bp4"
13
13
  };
14
14
  var placementStyles = {
15
- 'top-start': "_94n5u2gc _1xi2mgjw",
16
- 'top-end': "_94n5u2gc _1ltvmgjw",
17
- 'right-start': "_1ltvu2gc _94n5mgjw",
18
- 'right-end': "_1ltvu2gc _154imgjw",
19
- 'bottom-start': "_154iu2gc _1xi2mgjw",
20
- 'bottom-end': "_154iu2gc _1ltvmgjw",
21
- 'left-start': "_1xi2u2gc _94n5mgjw",
22
- 'left-end': "_1xi2u2gc _154imgjw"
15
+ 'top-start': "_94n512x7 _1xi2mgjw",
16
+ 'top-end': "_94n512x7 _1ltvmgjw",
17
+ 'right-start': "_1ltv12x7 _94n5mgjw",
18
+ 'right-end': "_1ltv12x7 _154imgjw",
19
+ 'bottom-start': "_154i12x7 _1xi2mgjw",
20
+ 'bottom-end': "_154i12x7 _1ltvmgjw",
21
+ 'left-start': "_1xi212x7 _94n5mgjw",
22
+ 'left-end': "_1xi212x7 _154imgjw"
23
23
  };
24
24
  /**
25
25
  * __Spotlight__
@@ -8,6 +8,8 @@ export { SpotlightPrimaryAction, type SpotlightPrimaryActionProps } from './ui/p
8
8
  export { SpotlightSecondaryAction, type SpotlightSecondaryActionProps, } from './ui/secondary-action';
9
9
  export { SpotlightControls, type SpotlightControlsProps } from './ui/controls';
10
10
  export { SpotlightDismissControl, type SpotlightDismissControlProps } from './ui/dismiss-control';
11
+ export { SpotlightShowMoreControl, type SpotlightShowMoreControlProps } from './ui/show-more-control';
12
+ export { SpotlightMedia, type SpotlightMediaProps } from './ui/media';
11
13
  export { PopoverProvider } from './ui/popover-provider';
12
14
  export { PopoverContent } from './ui/popover-content';
13
15
  export { PopoverTarget } from './ui/popover-target';
@@ -18,4 +18,4 @@ export interface SpotlightBodyProps {
18
18
  * `SpotlightBody` is required in a `Spotlight`. The content should be brief and direct to elaborate on the intent.
19
19
  *
20
20
  */
21
- export declare const SpotlightBody: React.ForwardRefExoticComponent<SpotlightBodyProps & React.RefAttributes<HTMLHeadingElement>>;
21
+ export declare const SpotlightBody: React.ForwardRefExoticComponent<SpotlightBodyProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,21 @@
1
+ import React, { type ReactNode } from 'react';
2
+ export interface SpotlightMediaProps {
3
+ /**
4
+ * A `testId` prop is provided for specified elements, which is a unique
5
+ * string that appears as a data attribute `data-testid` in the rendered code,
6
+ * serving as a hook for automated tests
7
+ */
8
+ testId?: string;
9
+ /**
10
+ * Textual content is required for all spotlights. It should be brief and direct
11
+ * to quickly elaborate on the intent.
12
+ */
13
+ children: ReactNode;
14
+ }
15
+ /**
16
+ * __SpotlightMedia__
17
+ *
18
+ * `SpotlightMedia` is optional in a `Spotlight`.
19
+ *
20
+ */
21
+ export declare const SpotlightMedia: React.ForwardRefExoticComponent<SpotlightMediaProps & React.RefAttributes<HTMLDivElement>>;
@@ -2,7 +2,7 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
- import { type ReactNode } from "react";
5
+ import { type ReactNode } from 'react';
6
6
  import type { Placement } from '../../types';
7
7
  interface PopoverContentProps {
8
8
  placement: Placement;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { type IconButtonProps } from '@atlaskit/button/new';
3
+ export interface SpotlightShowMoreControlProps {
4
+ /**
5
+ * A `testId` prop is provided for specified elements, which is a unique
6
+ * string that appears as a data attribute `data-testid` in the rendered code,
7
+ * serving as a hook for automated tests
8
+ */
9
+ testId?: string;
10
+ /**
11
+ * The action to take when the button is clicked.
12
+ */
13
+ onClick?: IconButtonProps['onClick'];
14
+ }
15
+ /**
16
+ * __SpotlightShowMoreControl__
17
+ *
18
+ * SpotlightShowMoreControl allows the user to close the `Spotlight`.
19
+ *
20
+ */
21
+ export declare const SpotlightShowMoreControl: React.ForwardRefExoticComponent<SpotlightShowMoreControlProps & React.RefAttributes<HTMLButtonElement>>;
@@ -8,6 +8,8 @@ export { SpotlightPrimaryAction, type SpotlightPrimaryActionProps } from './ui/p
8
8
  export { SpotlightSecondaryAction, type SpotlightSecondaryActionProps, } from './ui/secondary-action';
9
9
  export { SpotlightControls, type SpotlightControlsProps } from './ui/controls';
10
10
  export { SpotlightDismissControl, type SpotlightDismissControlProps } from './ui/dismiss-control';
11
+ export { SpotlightShowMoreControl, type SpotlightShowMoreControlProps } from './ui/show-more-control';
12
+ export { SpotlightMedia, type SpotlightMediaProps } from './ui/media';
11
13
  export { PopoverProvider } from './ui/popover-provider';
12
14
  export { PopoverContent } from './ui/popover-content';
13
15
  export { PopoverTarget } from './ui/popover-target';
@@ -18,4 +18,4 @@ export interface SpotlightBodyProps {
18
18
  * `SpotlightBody` is required in a `Spotlight`. The content should be brief and direct to elaborate on the intent.
19
19
  *
20
20
  */
21
- export declare const SpotlightBody: React.ForwardRefExoticComponent<SpotlightBodyProps & React.RefAttributes<HTMLHeadingElement>>;
21
+ export declare const SpotlightBody: React.ForwardRefExoticComponent<SpotlightBodyProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,21 @@
1
+ import React, { type ReactNode } from 'react';
2
+ export interface SpotlightMediaProps {
3
+ /**
4
+ * A `testId` prop is provided for specified elements, which is a unique
5
+ * string that appears as a data attribute `data-testid` in the rendered code,
6
+ * serving as a hook for automated tests
7
+ */
8
+ testId?: string;
9
+ /**
10
+ * Textual content is required for all spotlights. It should be brief and direct
11
+ * to quickly elaborate on the intent.
12
+ */
13
+ children: ReactNode;
14
+ }
15
+ /**
16
+ * __SpotlightMedia__
17
+ *
18
+ * `SpotlightMedia` is optional in a `Spotlight`.
19
+ *
20
+ */
21
+ export declare const SpotlightMedia: React.ForwardRefExoticComponent<SpotlightMediaProps & React.RefAttributes<HTMLDivElement>>;
@@ -2,7 +2,7 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
- import { type ReactNode } from "react";
5
+ import { type ReactNode } from 'react';
6
6
  import type { Placement } from '../../types';
7
7
  interface PopoverContentProps {
8
8
  placement: Placement;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { type IconButtonProps } from '@atlaskit/button/new';
3
+ export interface SpotlightShowMoreControlProps {
4
+ /**
5
+ * A `testId` prop is provided for specified elements, which is a unique
6
+ * string that appears as a data attribute `data-testid` in the rendered code,
7
+ * serving as a hook for automated tests
8
+ */
9
+ testId?: string;
10
+ /**
11
+ * The action to take when the button is clicked.
12
+ */
13
+ onClick?: IconButtonProps['onClick'];
14
+ }
15
+ /**
16
+ * __SpotlightShowMoreControl__
17
+ *
18
+ * SpotlightShowMoreControl allows the user to close the `Spotlight`.
19
+ *
20
+ */
21
+ export declare const SpotlightShowMoreControl: React.ForwardRefExoticComponent<SpotlightShowMoreControlProps & React.RefAttributes<HTMLButtonElement>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/spotlight",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "description": "A spotlight introduces users to various points of interest across Atlassian through focused messages or multi-step tours.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,7 +32,8 @@
32
32
  "@atlaskit/button": "^23.3.0",
33
33
  "@atlaskit/css": "^0.12.0",
34
34
  "@atlaskit/heading": "^5.2.0",
35
- "@atlaskit/icon": "^27.11.0",
35
+ "@atlaskit/icon": "^27.12.0",
36
+ "@atlaskit/image": "^3.0.0",
36
37
  "@atlaskit/popper": "^7.1.0",
37
38
  "@atlaskit/primitives": "^14.11.0",
38
39
  "@atlaskit/tokens": "^6.0.0",
@@ -45,6 +46,7 @@
45
46
  "devDependencies": {
46
47
  "@af/integration-testing": "workspace:^",
47
48
  "@af/visual-regression": "workspace:^",
49
+ "@atlaskit/dropdown-menu": "^16.3.0",
48
50
  "@atlaskit/ssr": "workspace:^",
49
51
  "@atlaskit/visual-regression": "workspace:^",
50
52
  "@testing-library/react": "^13.4.0",