@atlaskit/spotlight 0.0.8 → 0.0.9

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 (45) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/cjs/index.js +7 -0
  3. package/dist/cjs/ui/body/index.compiled.css +1 -0
  4. package/dist/cjs/ui/body/index.js +31 -0
  5. package/dist/cjs/ui/footer/index.compiled.css +0 -1
  6. package/dist/cjs/ui/footer/index.js +1 -1
  7. package/dist/cjs/ui/header/index.compiled.css +0 -2
  8. package/dist/cjs/ui/header/index.js +1 -1
  9. package/dist/cjs/ui/headline/index.js +0 -1
  10. package/dist/cjs/ui/popover-content/index.js +3 -1
  11. package/dist/cjs/ui/spotlight/index.compiled.css +5 -2
  12. package/dist/cjs/ui/spotlight/index.js +8 -5
  13. package/dist/es2019/index.js +1 -0
  14. package/dist/es2019/ui/body/index.compiled.css +1 -0
  15. package/dist/es2019/ui/body/index.js +24 -0
  16. package/dist/es2019/ui/footer/index.compiled.css +0 -1
  17. package/dist/es2019/ui/footer/index.js +1 -1
  18. package/dist/es2019/ui/header/index.compiled.css +0 -2
  19. package/dist/es2019/ui/header/index.js +1 -1
  20. package/dist/es2019/ui/headline/index.js +0 -1
  21. package/dist/es2019/ui/popover-content/index.js +4 -2
  22. package/dist/es2019/ui/spotlight/index.compiled.css +5 -2
  23. package/dist/es2019/ui/spotlight/index.js +8 -5
  24. package/dist/esm/index.js +1 -0
  25. package/dist/esm/ui/body/index.compiled.css +1 -0
  26. package/dist/esm/ui/body/index.js +23 -0
  27. package/dist/esm/ui/footer/index.compiled.css +0 -1
  28. package/dist/esm/ui/footer/index.js +1 -1
  29. package/dist/esm/ui/header/index.compiled.css +0 -2
  30. package/dist/esm/ui/header/index.js +1 -1
  31. package/dist/esm/ui/headline/index.js +0 -1
  32. package/dist/esm/ui/popover-content/index.js +4 -2
  33. package/dist/esm/ui/spotlight/index.compiled.css +5 -2
  34. package/dist/esm/ui/spotlight/index.js +8 -5
  35. package/dist/types/index.d.ts +1 -0
  36. package/dist/types/ui/body/index.d.ts +21 -0
  37. package/dist/types/ui/headline/index.d.ts +1 -1
  38. package/dist/types/ui/popover-content/index.d.ts +2 -2
  39. package/dist/types/ui/spotlight/caret/index.d.ts +0 -1
  40. package/dist/types-ts4.5/index.d.ts +1 -0
  41. package/dist/types-ts4.5/ui/body/index.d.ts +21 -0
  42. package/dist/types-ts4.5/ui/headline/index.d.ts +1 -1
  43. package/dist/types-ts4.5/ui/popover-content/index.d.ts +2 -2
  44. package/dist/types-ts4.5/ui/spotlight/caret/index.d.ts +0 -1
  45. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @atlaskit/spotlight
2
2
 
3
+ ## 0.0.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [`d972e69e6461e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d972e69e6461e) -
8
+ Create Body component. Rework spacing of Spotlight card. Minor refactoring.
9
+
3
10
  ## 0.0.8
4
11
 
5
12
  ### Patch Changes
package/dist/cjs/index.js CHANGED
@@ -33,6 +33,12 @@ Object.defineProperty(exports, "SpotlightActions", {
33
33
  return _actions.SpotlightActions;
34
34
  }
35
35
  });
36
+ Object.defineProperty(exports, "SpotlightBody", {
37
+ enumerable: true,
38
+ get: function get() {
39
+ return _body.SpotlightBody;
40
+ }
41
+ });
36
42
  Object.defineProperty(exports, "SpotlightControls", {
37
43
  enumerable: true,
38
44
  get: function get() {
@@ -76,6 +82,7 @@ Object.defineProperty(exports, "SpotlightSecondaryAction", {
76
82
  }
77
83
  });
78
84
  var _spotlight = require("./ui/spotlight");
85
+ var _body = require("./ui/body");
79
86
  var _header = require("./ui/header");
80
87
  var _headline = require("./ui/headline");
81
88
  var _footer = require("./ui/footer");
@@ -0,0 +1 @@
1
+ ._18zrpxbi{padding-inline:var(--ds-space-200,1pc)}
@@ -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.SpotlightBody = 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: "_18zrpxbi"
16
+ };
17
+ /**
18
+ * __SpotlightBody__
19
+ *
20
+ * `SpotlightBody` is required in a `Spotlight`. The content should be brief and direct to elaborate on the intent.
21
+ *
22
+ */
23
+ var SpotlightBody = exports.SpotlightBody = /*#__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
+ });
@@ -1,4 +1,3 @@
1
1
  ._1bsb1osq{width:100%}
2
- ._85i5utpp{padding-block-end:var(--ds-space-150,9pt)}
3
2
  ._bozgpxbi{padding-inline-start:var(--ds-space-200,1pc)}
4
3
  ._y4tiutpp{padding-inline-end:var(--ds-space-150,9pt)}
@@ -12,7 +12,7 @@ var _react = _interopRequireWildcard(require("react"));
12
12
  var _compiled = require("@atlaskit/primitives/compiled");
13
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
14
  var styles = {
15
- root: "_bozgpxbi _y4tiutpp _85i5utpp _1bsb1osq"
15
+ root: "_bozgpxbi _y4tiutpp _1bsb1osq"
16
16
  };
17
17
  /**
18
18
  * __SpotlightFooter__
@@ -1,4 +1,2 @@
1
- ._1q51utpp{padding-block-start:var(--ds-space-150,9pt)}
2
- ._85i5utpp{padding-block-end:var(--ds-space-150,9pt)}
3
1
  ._bozgpxbi{padding-inline-start:var(--ds-space-200,1pc)}
4
2
  ._y4tiutpp{padding-inline-end:var(--ds-space-150,9pt)}
@@ -12,7 +12,7 @@ var _react = _interopRequireWildcard(require("react"));
12
12
  var _compiled = require("@atlaskit/primitives/compiled");
13
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
14
  var styles = {
15
- root: "_bozgpxbi _y4tiutpp _1q51utpp _85i5utpp"
15
+ root: "_bozgpxbi _y4tiutpp"
16
16
  };
17
17
  /**
18
18
  * __SpotlightHeader__
@@ -21,7 +21,6 @@ var SpotlightHeadline = exports.SpotlightHeadline = /*#__PURE__*/(0, _react.forw
21
21
  return /*#__PURE__*/_react.default.createElement(_heading.default, {
22
22
  ref: ref,
23
23
  testId: testId,
24
- color: "color.text.inverse",
25
24
  size: "xsmall"
26
25
  }, children);
27
26
  });
@@ -36,7 +36,9 @@ var PopoverContent = exports.PopoverContent = function PopoverContent(_ref) {
36
36
  placement = _ref.placement;
37
37
  var _useContext = (0, _react.useContext)(_context.SpotlightContext),
38
38
  setPlacement = _useContext.setPlacement;
39
- setPlacement(placement);
39
+ (0, _react.useEffect)(function () {
40
+ setPlacement(placement);
41
+ }, [placement, setPlacement]);
40
42
  return /*#__PURE__*/_react.default.createElement(_popper.Popper, {
41
43
  offset: [0, 0],
42
44
  placement: popperPlacementMap[placement]
@@ -1,13 +1,16 @@
1
1
 
2
- ._2rkopd34{border-radius:var(--ds-border-radius-200,8px)}._154imgjw{top:var(--ds-space-negative-200,-1pc)}
2
+ ._2rkopd34{border-radius:var(--ds-border-radius-200,8px)}
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)}
3
5
  ._154iu2gc{top:var(--ds-space-100,8px)}
4
6
  ._1bsbaq3k{width:295px}
7
+ ._1e0c1txw{display:flex}
5
8
  ._1ltvmgjw{left:var(--ds-space-negative-200,-1pc)}
6
9
  ._1ltvu2gc{left:var(--ds-space-100,8px)}
7
10
  ._1xi2mgjw{right:var(--ds-space-negative-200,-1pc)}
8
11
  ._1xi2u2gc{right:var(--ds-space-100,8px)}
12
+ ._2lx21bp4{flex-direction:column}
9
13
  ._94n5mgjw{bottom:var(--ds-space-negative-200,-1pc)}
10
14
  ._94n5u2gc{bottom:var(--ds-space-100,8px)}
11
- ._bfhkcdhy{background-color:var(--ds-background-neutral-bold,#44546f)}
12
15
  ._kqswh2mm{position:relative}
13
16
  ._kqswstnw{position:absolute}
@@ -10,12 +10,14 @@ 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 _css = require("@atlaskit/css");
14
+ var _compiled = require("@atlaskit/primitives/compiled");
13
15
  var _context = require("../../controllers/context");
14
16
  var _caret = require("./caret");
15
17
  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); }
16
18
  var styles = {
17
19
  root: "_kqswh2mm",
18
- card: "_2rkopd34 _kqswstnw _1bsbaq3k _bfhkcdhy"
20
+ card: "_2rkopd34 _zulppxbi _1rjcutpp _kqswstnw _1bsbaq3k _1e0c1txw _2lx21bp4"
19
21
  };
20
22
  var placementStyles = {
21
23
  'top-start': "_94n5u2gc _1xi2mgjw",
@@ -39,10 +41,11 @@ var Spotlight = exports.Spotlight = /*#__PURE__*/(0, _react.forwardRef)(function
39
41
  var _useContext = (0, _react.useContext)(_context.SpotlightContext),
40
42
  placement = _useContext.placement;
41
43
  return /*#__PURE__*/React.createElement("div", {
42
- className: (0, _runtime.ax)([styles.root])
43
- }, /*#__PURE__*/React.createElement(_caret.Caret, null), /*#__PURE__*/React.createElement("div", {
44
- ref: ref,
45
44
  "data-testid": testId,
46
- className: (0, _runtime.ax)([styles.card, placementStyles[placement]])
45
+ ref: ref,
46
+ className: (0, _runtime.ax)([styles.root])
47
+ }, /*#__PURE__*/React.createElement(_caret.Caret, null), /*#__PURE__*/React.createElement(_compiled.Box, {
48
+ backgroundColor: "color.background.neutral.bold",
49
+ xcss: (0, _css.cx)(styles.card, placementStyles[placement])
47
50
  }, children));
48
51
  });
@@ -1,4 +1,5 @@
1
1
  export { Spotlight } from './ui/spotlight';
2
+ export { SpotlightBody } from './ui/body';
2
3
  export { SpotlightHeader } from './ui/header';
3
4
  export { SpotlightHeadline } from './ui/headline';
4
5
  export { SpotlightFooter } from './ui/footer';
@@ -0,0 +1 @@
1
+ ._18zrpxbi{padding-inline:var(--ds-space-200,1pc)}
@@ -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: "_18zrpxbi"
8
+ };
9
+ /**
10
+ * __SpotlightBody__
11
+ *
12
+ * `SpotlightBody` is required in a `Spotlight`. The content should be brief and direct to elaborate on the intent.
13
+ *
14
+ */
15
+ export const SpotlightBody = /*#__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
+ });
@@ -1,4 +1,3 @@
1
1
  ._1bsb1osq{width:100%}
2
- ._85i5utpp{padding-block-end:var(--ds-space-150,9pt)}
3
2
  ._bozgpxbi{padding-inline-start:var(--ds-space-200,1pc)}
4
3
  ._y4tiutpp{padding-inline-end:var(--ds-space-150,9pt)}
@@ -4,7 +4,7 @@ import { ax, ix } from "@compiled/react/runtime";
4
4
  import React, { forwardRef } from 'react';
5
5
  import { Flex } from '@atlaskit/primitives/compiled';
6
6
  const styles = {
7
- root: "_bozgpxbi _y4tiutpp _85i5utpp _1bsb1osq"
7
+ root: "_bozgpxbi _y4tiutpp _1bsb1osq"
8
8
  };
9
9
  /**
10
10
  * __SpotlightFooter__
@@ -1,4 +1,2 @@
1
- ._1q51utpp{padding-block-start:var(--ds-space-150,9pt)}
2
- ._85i5utpp{padding-block-end:var(--ds-space-150,9pt)}
3
1
  ._bozgpxbi{padding-inline-start:var(--ds-space-200,1pc)}
4
2
  ._y4tiutpp{padding-inline-end:var(--ds-space-150,9pt)}
@@ -4,7 +4,7 @@ import { ax, ix } from "@compiled/react/runtime";
4
4
  import React, { forwardRef } from 'react';
5
5
  import { Flex } from '@atlaskit/primitives/compiled';
6
6
  const styles = {
7
- root: "_bozgpxbi _y4tiutpp _1q51utpp _85i5utpp"
7
+ root: "_bozgpxbi _y4tiutpp"
8
8
  };
9
9
  /**
10
10
  * __SpotlightHeader__
@@ -13,7 +13,6 @@ export const SpotlightHeadline = /*#__PURE__*/forwardRef(({
13
13
  return /*#__PURE__*/React.createElement(Heading, {
14
14
  ref: ref,
15
15
  testId: testId,
16
- color: "color.text.inverse",
17
16
  size: "xsmall"
18
17
  }, children);
19
18
  });
@@ -1,4 +1,4 @@
1
- import React, { useContext } from 'react';
1
+ import React, { useContext, useEffect } from "react";
2
2
  import { Popper } from '@atlaskit/popper';
3
3
  import { SpotlightContext } from '../../controllers/context';
4
4
  /**
@@ -30,7 +30,9 @@ export const PopoverContent = ({
30
30
  const {
31
31
  setPlacement
32
32
  } = useContext(SpotlightContext);
33
- setPlacement(placement);
33
+ useEffect(() => {
34
+ setPlacement(placement);
35
+ }, [placement, setPlacement]);
34
36
  return /*#__PURE__*/React.createElement(Popper, {
35
37
  offset: [0, 0],
36
38
  placement: popperPlacementMap[placement]
@@ -1,13 +1,16 @@
1
1
 
2
- ._2rkopd34{border-radius:var(--ds-border-radius-200,8px)}._154imgjw{top:var(--ds-space-negative-200,-1pc)}
2
+ ._2rkopd34{border-radius:var(--ds-border-radius-200,8px)}
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)}
3
5
  ._154iu2gc{top:var(--ds-space-100,8px)}
4
6
  ._1bsbaq3k{width:295px}
7
+ ._1e0c1txw{display:flex}
5
8
  ._1ltvmgjw{left:var(--ds-space-negative-200,-1pc)}
6
9
  ._1ltvu2gc{left:var(--ds-space-100,8px)}
7
10
  ._1xi2mgjw{right:var(--ds-space-negative-200,-1pc)}
8
11
  ._1xi2u2gc{right:var(--ds-space-100,8px)}
12
+ ._2lx21bp4{flex-direction:column}
9
13
  ._94n5mgjw{bottom:var(--ds-space-negative-200,-1pc)}
10
14
  ._94n5u2gc{bottom:var(--ds-space-100,8px)}
11
- ._bfhkcdhy{background-color:var(--ds-background-neutral-bold,#44546f)}
12
15
  ._kqswh2mm{position:relative}
13
16
  ._kqswstnw{position:absolute}
@@ -3,11 +3,13 @@ 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
+ import { cx } from '@atlaskit/css';
7
+ import { Box } from '@atlaskit/primitives/compiled';
6
8
  import { SpotlightContext } from '../../controllers/context';
7
9
  import { Caret } from './caret';
8
10
  const styles = {
9
11
  root: "_kqswh2mm",
10
- card: "_2rkopd34 _kqswstnw _1bsbaq3k _bfhkcdhy"
12
+ card: "_2rkopd34 _zulppxbi _1rjcutpp _kqswstnw _1bsbaq3k _1e0c1txw _2lx21bp4"
11
13
  };
12
14
  const placementStyles = {
13
15
  'top-start': "_94n5u2gc _1xi2mgjw",
@@ -33,10 +35,11 @@ export const Spotlight = /*#__PURE__*/forwardRef(({
33
35
  placement
34
36
  } = useContext(SpotlightContext);
35
37
  return /*#__PURE__*/React.createElement("div", {
36
- className: ax([styles.root])
37
- }, /*#__PURE__*/React.createElement(Caret, null), /*#__PURE__*/React.createElement("div", {
38
- ref: ref,
39
38
  "data-testid": testId,
40
- className: ax([styles.card, placementStyles[placement]])
39
+ ref: ref,
40
+ className: ax([styles.root])
41
+ }, /*#__PURE__*/React.createElement(Caret, null), /*#__PURE__*/React.createElement(Box, {
42
+ backgroundColor: "color.background.neutral.bold",
43
+ xcss: cx(styles.card, placementStyles[placement])
41
44
  }, children));
42
45
  });
package/dist/esm/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export { Spotlight } from './ui/spotlight';
2
+ export { SpotlightBody } from './ui/body';
2
3
  export { SpotlightHeader } from './ui/header';
3
4
  export { SpotlightHeadline } from './ui/headline';
4
5
  export { SpotlightFooter } from './ui/footer';
@@ -0,0 +1 @@
1
+ ._18zrpxbi{padding-inline:var(--ds-space-200,1pc)}
@@ -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: "_18zrpxbi"
8
+ };
9
+ /**
10
+ * __SpotlightBody__
11
+ *
12
+ * `SpotlightBody` is required in a `Spotlight`. The content should be brief and direct to elaborate on the intent.
13
+ *
14
+ */
15
+ export var SpotlightBody = /*#__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
+ });
@@ -1,4 +1,3 @@
1
1
  ._1bsb1osq{width:100%}
2
- ._85i5utpp{padding-block-end:var(--ds-space-150,9pt)}
3
2
  ._bozgpxbi{padding-inline-start:var(--ds-space-200,1pc)}
4
3
  ._y4tiutpp{padding-inline-end:var(--ds-space-150,9pt)}
@@ -4,7 +4,7 @@ import { ax, ix } from "@compiled/react/runtime";
4
4
  import React, { forwardRef } from 'react';
5
5
  import { Flex } from '@atlaskit/primitives/compiled';
6
6
  var styles = {
7
- root: "_bozgpxbi _y4tiutpp _85i5utpp _1bsb1osq"
7
+ root: "_bozgpxbi _y4tiutpp _1bsb1osq"
8
8
  };
9
9
  /**
10
10
  * __SpotlightFooter__
@@ -1,4 +1,2 @@
1
- ._1q51utpp{padding-block-start:var(--ds-space-150,9pt)}
2
- ._85i5utpp{padding-block-end:var(--ds-space-150,9pt)}
3
1
  ._bozgpxbi{padding-inline-start:var(--ds-space-200,1pc)}
4
2
  ._y4tiutpp{padding-inline-end:var(--ds-space-150,9pt)}
@@ -4,7 +4,7 @@ import { ax, ix } from "@compiled/react/runtime";
4
4
  import React, { forwardRef } from 'react';
5
5
  import { Flex } from '@atlaskit/primitives/compiled';
6
6
  var styles = {
7
- root: "_bozgpxbi _y4tiutpp _1q51utpp _85i5utpp"
7
+ root: "_bozgpxbi _y4tiutpp"
8
8
  };
9
9
  /**
10
10
  * __SpotlightHeader__
@@ -12,7 +12,6 @@ export var SpotlightHeadline = /*#__PURE__*/forwardRef(function (_ref, ref) {
12
12
  return /*#__PURE__*/React.createElement(Heading, {
13
13
  ref: ref,
14
14
  testId: testId,
15
- color: "color.text.inverse",
16
15
  size: "xsmall"
17
16
  }, children);
18
17
  });
@@ -1,4 +1,4 @@
1
- import React, { useContext } from 'react';
1
+ import React, { useContext, useEffect } from "react";
2
2
  import { Popper } from '@atlaskit/popper';
3
3
  import { SpotlightContext } from '../../controllers/context';
4
4
  /**
@@ -28,7 +28,9 @@ export var PopoverContent = function PopoverContent(_ref) {
28
28
  placement = _ref.placement;
29
29
  var _useContext = useContext(SpotlightContext),
30
30
  setPlacement = _useContext.setPlacement;
31
- setPlacement(placement);
31
+ useEffect(function () {
32
+ setPlacement(placement);
33
+ }, [placement, setPlacement]);
32
34
  return /*#__PURE__*/React.createElement(Popper, {
33
35
  offset: [0, 0],
34
36
  placement: popperPlacementMap[placement]
@@ -1,13 +1,16 @@
1
1
 
2
- ._2rkopd34{border-radius:var(--ds-border-radius-200,8px)}._154imgjw{top:var(--ds-space-negative-200,-1pc)}
2
+ ._2rkopd34{border-radius:var(--ds-border-radius-200,8px)}
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)}
3
5
  ._154iu2gc{top:var(--ds-space-100,8px)}
4
6
  ._1bsbaq3k{width:295px}
7
+ ._1e0c1txw{display:flex}
5
8
  ._1ltvmgjw{left:var(--ds-space-negative-200,-1pc)}
6
9
  ._1ltvu2gc{left:var(--ds-space-100,8px)}
7
10
  ._1xi2mgjw{right:var(--ds-space-negative-200,-1pc)}
8
11
  ._1xi2u2gc{right:var(--ds-space-100,8px)}
12
+ ._2lx21bp4{flex-direction:column}
9
13
  ._94n5mgjw{bottom:var(--ds-space-negative-200,-1pc)}
10
14
  ._94n5u2gc{bottom:var(--ds-space-100,8px)}
11
- ._bfhkcdhy{background-color:var(--ds-background-neutral-bold,#44546f)}
12
15
  ._kqswh2mm{position:relative}
13
16
  ._kqswstnw{position:absolute}
@@ -3,11 +3,13 @@ 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
+ import { cx } from '@atlaskit/css';
7
+ import { Box } from '@atlaskit/primitives/compiled';
6
8
  import { SpotlightContext } from '../../controllers/context';
7
9
  import { Caret } from './caret';
8
10
  var styles = {
9
11
  root: "_kqswh2mm",
10
- card: "_2rkopd34 _kqswstnw _1bsbaq3k _bfhkcdhy"
12
+ card: "_2rkopd34 _zulppxbi _1rjcutpp _kqswstnw _1bsbaq3k _1e0c1txw _2lx21bp4"
11
13
  };
12
14
  var placementStyles = {
13
15
  'top-start': "_94n5u2gc _1xi2mgjw",
@@ -31,10 +33,11 @@ export var Spotlight = /*#__PURE__*/forwardRef(function (_ref, ref) {
31
33
  var _useContext = useContext(SpotlightContext),
32
34
  placement = _useContext.placement;
33
35
  return /*#__PURE__*/React.createElement("div", {
34
- className: ax([styles.root])
35
- }, /*#__PURE__*/React.createElement(Caret, null), /*#__PURE__*/React.createElement("div", {
36
- ref: ref,
37
36
  "data-testid": testId,
38
- className: ax([styles.card, placementStyles[placement]])
37
+ ref: ref,
38
+ className: ax([styles.root])
39
+ }, /*#__PURE__*/React.createElement(Caret, null), /*#__PURE__*/React.createElement(Box, {
40
+ backgroundColor: "color.background.neutral.bold",
41
+ xcss: cx(styles.card, placementStyles[placement])
39
42
  }, children));
40
43
  });
@@ -1,4 +1,5 @@
1
1
  export { Spotlight, type SpotlightProps } from './ui/spotlight';
2
+ export { SpotlightBody, type SpotlightBodyProps } from './ui/body';
2
3
  export { SpotlightHeader, type SpotlightHeaderProps } from './ui/header';
3
4
  export { SpotlightHeadline, type SpotlightHeadlineProps } from './ui/headline';
4
5
  export { SpotlightFooter, type SpotlightFooterProps } from './ui/footer';
@@ -0,0 +1,21 @@
1
+ import React, { type ReactNode } from 'react';
2
+ export interface SpotlightBodyProps {
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
+ * __SpotlightBody__
17
+ *
18
+ * `SpotlightBody` is required in a `Spotlight`. The content should be brief and direct to elaborate on the intent.
19
+ *
20
+ */
21
+ export declare const SpotlightBody: React.ForwardRefExoticComponent<SpotlightBodyProps & React.RefAttributes<HTMLHeadingElement>>;
@@ -9,7 +9,7 @@ export interface SpotlightHeadlineProps {
9
9
  /**
10
10
  * A brief and direct title to quickly hook the user on the intent.
11
11
  */
12
- children?: ReactNode;
12
+ children: ReactNode;
13
13
  }
14
14
  /**
15
15
  * __SpotlightHeadline__
@@ -1,11 +1,11 @@
1
- import React, { type ReactNode } from 'react';
1
+ import React, { type ReactNode } from "react";
2
2
  import type { Placement } from '../../types';
3
3
  /**
4
4
  * __PopoverContent__
5
5
  *
6
6
  * A `PopoverContent` is the element that is shown as a popover.
7
7
  */
8
- export declare const PopoverContent: ({ children, placement, }: {
8
+ export declare const PopoverContent: ({ children, placement }: {
9
9
  children: ReactNode;
10
10
  placement: Placement;
11
11
  }) => React.JSX.Element;
@@ -2,7 +2,6 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
- /// <reference types="react" />
6
5
  export interface CaretProps {
7
6
  /**
8
7
  * A `testId` prop is provided for specified elements, which is a unique
@@ -1,4 +1,5 @@
1
1
  export { Spotlight, type SpotlightProps } from './ui/spotlight';
2
+ export { SpotlightBody, type SpotlightBodyProps } from './ui/body';
2
3
  export { SpotlightHeader, type SpotlightHeaderProps } from './ui/header';
3
4
  export { SpotlightHeadline, type SpotlightHeadlineProps } from './ui/headline';
4
5
  export { SpotlightFooter, type SpotlightFooterProps } from './ui/footer';
@@ -0,0 +1,21 @@
1
+ import React, { type ReactNode } from 'react';
2
+ export interface SpotlightBodyProps {
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
+ * __SpotlightBody__
17
+ *
18
+ * `SpotlightBody` is required in a `Spotlight`. The content should be brief and direct to elaborate on the intent.
19
+ *
20
+ */
21
+ export declare const SpotlightBody: React.ForwardRefExoticComponent<SpotlightBodyProps & React.RefAttributes<HTMLHeadingElement>>;
@@ -9,7 +9,7 @@ export interface SpotlightHeadlineProps {
9
9
  /**
10
10
  * A brief and direct title to quickly hook the user on the intent.
11
11
  */
12
- children?: ReactNode;
12
+ children: ReactNode;
13
13
  }
14
14
  /**
15
15
  * __SpotlightHeadline__
@@ -1,11 +1,11 @@
1
- import React, { type ReactNode } from 'react';
1
+ import React, { type ReactNode } from "react";
2
2
  import type { Placement } from '../../types';
3
3
  /**
4
4
  * __PopoverContent__
5
5
  *
6
6
  * A `PopoverContent` is the element that is shown as a popover.
7
7
  */
8
- export declare const PopoverContent: ({ children, placement, }: {
8
+ export declare const PopoverContent: ({ children, placement }: {
9
9
  children: ReactNode;
10
10
  placement: Placement;
11
11
  }) => React.JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  /**
3
2
  * @jsxRuntime classic
4
3
  * @jsx jsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/spotlight",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
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,7 @@
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.10.0",
35
+ "@atlaskit/icon": "^27.11.0",
36
36
  "@atlaskit/popper": "^7.1.0",
37
37
  "@atlaskit/primitives": "^14.11.0",
38
38
  "@atlaskit/tokens": "^6.0.0",