@atlaskit/spotlight 0.10.10 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/cjs/ui/card/caret/index.js +3 -2
- package/dist/cjs/ui/card/index.compiled.css +1 -0
- package/dist/cjs/ui/card/index.js +24 -4
- package/dist/es2019/ui/card/caret/index.js +2 -1
- package/dist/es2019/ui/card/index.compiled.css +1 -0
- package/dist/es2019/ui/card/index.js +24 -4
- package/dist/esm/ui/card/caret/index.js +3 -2
- package/dist/esm/ui/card/index.compiled.css +1 -0
- package/dist/esm/ui/card/index.js +24 -4
- package/dist/types/ui/card/caret/index.d.ts +5 -0
- package/dist/types/ui/card/index.d.ts +5 -0
- package/dist/types/ui/popover-content/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/card/caret/index.d.ts +5 -0
- package/dist/types-ts4.5/ui/card/index.d.ts +5 -0
- package/dist/types-ts4.5/ui/popover-content/index.d.ts +2 -2
- package/package.json +9 -5
- package/spotlight.docs.tsx +222 -20
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/spotlight
|
|
2
2
|
|
|
3
|
+
## 0.11.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`58f8502090976`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/58f8502090976) -
|
|
8
|
+
Expose `placement` prop on `SpotlightCard`. `SpotlightCard` is now better supported to render
|
|
9
|
+
outside of a `PopoverProvider`.
|
|
10
|
+
|
|
3
11
|
## 0.10.10
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -32,7 +32,8 @@ var styles = {
|
|
|
32
32
|
*
|
|
33
33
|
*/
|
|
34
34
|
var Caret = exports.Caret = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
35
|
-
var
|
|
35
|
+
var placement = _ref.placement,
|
|
36
|
+
testId = _ref.testId;
|
|
36
37
|
var _useContext = (0, _react.useContext)(_context.SpotlightContext),
|
|
37
38
|
card = _useContext.card;
|
|
38
39
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -43,6 +44,6 @@ var Caret = exports.Caret = /*#__PURE__*/(0, _react.forwardRef)(function (_ref,
|
|
|
43
44
|
style: {
|
|
44
45
|
borderEndStartRadius: '1px'
|
|
45
46
|
},
|
|
46
|
-
className: (0, _runtime.ax)([styles.root, styles[card.placement]])
|
|
47
|
+
className: (0, _runtime.ax)([styles.root, styles[placement || card.placement]])
|
|
47
48
|
});
|
|
48
49
|
});
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
._zulpu2gc{gap:var(--ds-space-100,8px)}._152t12x7{inset-block-start:var(--ds-space-075,6px)}
|
|
4
4
|
._152tmgjw{inset-block-start:var(--ds-space-negative-200,-1pc)}
|
|
5
5
|
._16qs1nax{box-shadow:var(--ds-shadow-overflow,0 0 8px #1e1f2128,0 0 1px #1e1f211e)}
|
|
6
|
+
._1bsb1ns9{width:-moz-fit-content;width:fit-content}
|
|
6
7
|
._1bsbaq3k{width:295px}
|
|
7
8
|
._1e0212x7{inset-inline-start:var(--ds-space-075,6px)}
|
|
8
9
|
._1e021qz4{inset-inline-start:-140px}
|
|
@@ -11,12 +11,14 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
var React = _react;
|
|
12
12
|
var _runtime = require("@compiled/react/runtime");
|
|
13
13
|
var _css = require("@atlaskit/css");
|
|
14
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
15
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
15
16
|
var _context = require("../../controllers/context");
|
|
16
17
|
var _caret = require("./caret");
|
|
17
18
|
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); }
|
|
18
19
|
var styles = {
|
|
19
|
-
root: "
|
|
20
|
+
root: "_1bsb1ns9",
|
|
21
|
+
container: "_kqswh2mm",
|
|
20
22
|
card: "_2rko1mok _zulpu2gc _kqswstnw _1bsbaq3k _1q51u2gc _85i5utpp _1e0c1txw _2lx21bp4 _16qs1nax"
|
|
21
23
|
};
|
|
22
24
|
var placementStyles = {
|
|
@@ -39,6 +41,7 @@ var placementStyles = {
|
|
|
39
41
|
*/
|
|
40
42
|
var SpotlightCard = exports.SpotlightCard = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
41
43
|
var children = _ref.children,
|
|
44
|
+
placement = _ref.placement,
|
|
42
45
|
testId = _ref.testId;
|
|
43
46
|
var _useContext = (0, _react.useContext)(_context.SpotlightContext),
|
|
44
47
|
card = _useContext.card;
|
|
@@ -46,13 +49,30 @@ var SpotlightCard = exports.SpotlightCard = /*#__PURE__*/(0, _react.forwardRef)(
|
|
|
46
49
|
(0, _react.useEffect)(function () {
|
|
47
50
|
card.setRef(cardRef);
|
|
48
51
|
}, [card]);
|
|
52
|
+
if ((0, _platformFeatureFlags.fg)('platform_spotlight_card_fit_content_anchor')) {
|
|
53
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
54
|
+
"data-testid": testId,
|
|
55
|
+
ref: ref,
|
|
56
|
+
className: (0, _runtime.ax)([styles.root])
|
|
57
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
58
|
+
className: (0, _runtime.ax)([styles.container])
|
|
59
|
+
}, /*#__PURE__*/React.createElement(_caret.Caret, {
|
|
60
|
+
placement: placement || card.placement
|
|
61
|
+
}), /*#__PURE__*/React.createElement(_compiled.Box, {
|
|
62
|
+
ref: cardRef,
|
|
63
|
+
backgroundColor: "color.background.neutral.bold",
|
|
64
|
+
xcss: (0, _css.cx)(styles.card, placementStyles[placement || card.placement])
|
|
65
|
+
}, children)));
|
|
66
|
+
}
|
|
49
67
|
return /*#__PURE__*/React.createElement("div", {
|
|
50
68
|
"data-testid": testId,
|
|
51
69
|
ref: ref,
|
|
52
|
-
className: (0, _runtime.ax)([styles.
|
|
53
|
-
}, /*#__PURE__*/React.createElement(_caret.Caret,
|
|
70
|
+
className: (0, _runtime.ax)([styles.container])
|
|
71
|
+
}, /*#__PURE__*/React.createElement(_caret.Caret, {
|
|
72
|
+
placement: placement || card.placement
|
|
73
|
+
}), /*#__PURE__*/React.createElement(_compiled.Box, {
|
|
54
74
|
ref: cardRef,
|
|
55
75
|
backgroundColor: "color.background.neutral.bold",
|
|
56
|
-
xcss: (0, _css.cx)(styles.card, placementStyles[card.placement])
|
|
76
|
+
xcss: (0, _css.cx)(styles.card, placementStyles[placement || card.placement])
|
|
57
77
|
}, children));
|
|
58
78
|
});
|
|
@@ -24,6 +24,7 @@ const styles = {
|
|
|
24
24
|
*
|
|
25
25
|
*/
|
|
26
26
|
export const Caret = /*#__PURE__*/forwardRef(({
|
|
27
|
+
placement,
|
|
27
28
|
testId
|
|
28
29
|
}, ref) => {
|
|
29
30
|
const {
|
|
@@ -37,6 +38,6 @@ export const Caret = /*#__PURE__*/forwardRef(({
|
|
|
37
38
|
style: {
|
|
38
39
|
borderEndStartRadius: '1px'
|
|
39
40
|
},
|
|
40
|
-
className: ax([styles.root, styles[card.placement]])
|
|
41
|
+
className: ax([styles.root, styles[placement || card.placement]])
|
|
41
42
|
});
|
|
42
43
|
});
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
._zulpu2gc{gap:var(--ds-space-100,8px)}._152t12x7{inset-block-start:var(--ds-space-075,6px)}
|
|
4
4
|
._152tmgjw{inset-block-start:var(--ds-space-negative-200,-1pc)}
|
|
5
5
|
._16qs1nax{box-shadow:var(--ds-shadow-overflow,0 0 8px #1e1f2128,0 0 1px #1e1f211e)}
|
|
6
|
+
._1bsb1ns9{width:-moz-fit-content;width:fit-content}
|
|
6
7
|
._1bsbaq3k{width:295px}
|
|
7
8
|
._1e0212x7{inset-inline-start:var(--ds-space-075,6px)}
|
|
8
9
|
._1e021qz4{inset-inline-start:-140px}
|
|
@@ -4,11 +4,13 @@ import * as React from 'react';
|
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import { forwardRef, useContext, useEffect, useRef } from 'react';
|
|
6
6
|
import { cx } from '@atlaskit/css';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
8
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
8
9
|
import { SpotlightContext } from '../../controllers/context';
|
|
9
10
|
import { Caret } from './caret';
|
|
10
11
|
const styles = {
|
|
11
|
-
root: "
|
|
12
|
+
root: "_1bsb1ns9",
|
|
13
|
+
container: "_kqswh2mm",
|
|
12
14
|
card: "_2rko1mok _zulpu2gc _kqswstnw _1bsbaq3k _1q51u2gc _85i5utpp _1e0c1txw _2lx21bp4 _16qs1nax"
|
|
13
15
|
};
|
|
14
16
|
const placementStyles = {
|
|
@@ -31,6 +33,7 @@ const placementStyles = {
|
|
|
31
33
|
*/
|
|
32
34
|
export const SpotlightCard = /*#__PURE__*/forwardRef(({
|
|
33
35
|
children,
|
|
36
|
+
placement,
|
|
34
37
|
testId
|
|
35
38
|
}, ref) => {
|
|
36
39
|
const {
|
|
@@ -40,13 +43,30 @@ export const SpotlightCard = /*#__PURE__*/forwardRef(({
|
|
|
40
43
|
useEffect(() => {
|
|
41
44
|
card.setRef(cardRef);
|
|
42
45
|
}, [card]);
|
|
46
|
+
if (fg('platform_spotlight_card_fit_content_anchor')) {
|
|
47
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
48
|
+
"data-testid": testId,
|
|
49
|
+
ref: ref,
|
|
50
|
+
className: ax([styles.root])
|
|
51
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
52
|
+
className: ax([styles.container])
|
|
53
|
+
}, /*#__PURE__*/React.createElement(Caret, {
|
|
54
|
+
placement: placement || card.placement
|
|
55
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
56
|
+
ref: cardRef,
|
|
57
|
+
backgroundColor: "color.background.neutral.bold",
|
|
58
|
+
xcss: cx(styles.card, placementStyles[placement || card.placement])
|
|
59
|
+
}, children)));
|
|
60
|
+
}
|
|
43
61
|
return /*#__PURE__*/React.createElement("div", {
|
|
44
62
|
"data-testid": testId,
|
|
45
63
|
ref: ref,
|
|
46
|
-
className: ax([styles.
|
|
47
|
-
}, /*#__PURE__*/React.createElement(Caret,
|
|
64
|
+
className: ax([styles.container])
|
|
65
|
+
}, /*#__PURE__*/React.createElement(Caret, {
|
|
66
|
+
placement: placement || card.placement
|
|
67
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
48
68
|
ref: cardRef,
|
|
49
69
|
backgroundColor: "color.background.neutral.bold",
|
|
50
|
-
xcss: cx(styles.card, placementStyles[card.placement])
|
|
70
|
+
xcss: cx(styles.card, placementStyles[placement || card.placement])
|
|
51
71
|
}, children));
|
|
52
72
|
});
|
|
@@ -24,7 +24,8 @@ var styles = {
|
|
|
24
24
|
*
|
|
25
25
|
*/
|
|
26
26
|
export var Caret = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
27
|
-
var
|
|
27
|
+
var placement = _ref.placement,
|
|
28
|
+
testId = _ref.testId;
|
|
28
29
|
var _useContext = useContext(SpotlightContext),
|
|
29
30
|
card = _useContext.card;
|
|
30
31
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -35,6 +36,6 @@ export var Caret = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
35
36
|
style: {
|
|
36
37
|
borderEndStartRadius: '1px'
|
|
37
38
|
},
|
|
38
|
-
className: ax([styles.root, styles[card.placement]])
|
|
39
|
+
className: ax([styles.root, styles[placement || card.placement]])
|
|
39
40
|
});
|
|
40
41
|
});
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
._zulpu2gc{gap:var(--ds-space-100,8px)}._152t12x7{inset-block-start:var(--ds-space-075,6px)}
|
|
4
4
|
._152tmgjw{inset-block-start:var(--ds-space-negative-200,-1pc)}
|
|
5
5
|
._16qs1nax{box-shadow:var(--ds-shadow-overflow,0 0 8px #1e1f2128,0 0 1px #1e1f211e)}
|
|
6
|
+
._1bsb1ns9{width:-moz-fit-content;width:fit-content}
|
|
6
7
|
._1bsbaq3k{width:295px}
|
|
7
8
|
._1e0212x7{inset-inline-start:var(--ds-space-075,6px)}
|
|
8
9
|
._1e021qz4{inset-inline-start:-140px}
|
|
@@ -4,11 +4,13 @@ import * as React from 'react';
|
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import { forwardRef, useContext, useEffect, useRef } from 'react';
|
|
6
6
|
import { cx } from '@atlaskit/css';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
8
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
8
9
|
import { SpotlightContext } from '../../controllers/context';
|
|
9
10
|
import { Caret } from './caret';
|
|
10
11
|
var styles = {
|
|
11
|
-
root: "
|
|
12
|
+
root: "_1bsb1ns9",
|
|
13
|
+
container: "_kqswh2mm",
|
|
12
14
|
card: "_2rko1mok _zulpu2gc _kqswstnw _1bsbaq3k _1q51u2gc _85i5utpp _1e0c1txw _2lx21bp4 _16qs1nax"
|
|
13
15
|
};
|
|
14
16
|
var placementStyles = {
|
|
@@ -31,6 +33,7 @@ var placementStyles = {
|
|
|
31
33
|
*/
|
|
32
34
|
export var SpotlightCard = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
33
35
|
var children = _ref.children,
|
|
36
|
+
placement = _ref.placement,
|
|
34
37
|
testId = _ref.testId;
|
|
35
38
|
var _useContext = useContext(SpotlightContext),
|
|
36
39
|
card = _useContext.card;
|
|
@@ -38,13 +41,30 @@ export var SpotlightCard = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
38
41
|
useEffect(function () {
|
|
39
42
|
card.setRef(cardRef);
|
|
40
43
|
}, [card]);
|
|
44
|
+
if (fg('platform_spotlight_card_fit_content_anchor')) {
|
|
45
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
46
|
+
"data-testid": testId,
|
|
47
|
+
ref: ref,
|
|
48
|
+
className: ax([styles.root])
|
|
49
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
50
|
+
className: ax([styles.container])
|
|
51
|
+
}, /*#__PURE__*/React.createElement(Caret, {
|
|
52
|
+
placement: placement || card.placement
|
|
53
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
54
|
+
ref: cardRef,
|
|
55
|
+
backgroundColor: "color.background.neutral.bold",
|
|
56
|
+
xcss: cx(styles.card, placementStyles[placement || card.placement])
|
|
57
|
+
}, children)));
|
|
58
|
+
}
|
|
41
59
|
return /*#__PURE__*/React.createElement("div", {
|
|
42
60
|
"data-testid": testId,
|
|
43
61
|
ref: ref,
|
|
44
|
-
className: ax([styles.
|
|
45
|
-
}, /*#__PURE__*/React.createElement(Caret,
|
|
62
|
+
className: ax([styles.container])
|
|
63
|
+
}, /*#__PURE__*/React.createElement(Caret, {
|
|
64
|
+
placement: placement || card.placement
|
|
65
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
46
66
|
ref: cardRef,
|
|
47
67
|
backgroundColor: "color.background.neutral.bold",
|
|
48
|
-
xcss: cx(styles.card, placementStyles[card.placement])
|
|
68
|
+
xcss: cx(styles.card, placementStyles[placement || card.placement])
|
|
49
69
|
}, children));
|
|
50
70
|
});
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
import type { Placement } from '../../../types';
|
|
1
2
|
export interface CaretProps {
|
|
3
|
+
/**
|
|
4
|
+
* The position in relation to the target the content should be shown at. Overrides `PopoverContent.placement`
|
|
5
|
+
*/
|
|
6
|
+
placement?: Placement;
|
|
2
7
|
/**
|
|
3
8
|
* A `testId` prop is provided for specified elements, which is a unique
|
|
4
9
|
* string that appears as a data attribute `data-testid` in the rendered code,
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
import { type ReactNode } from 'react';
|
|
6
|
+
import type { Placement } from '../../types';
|
|
6
7
|
export interface SpotlightCardProps {
|
|
7
8
|
/**
|
|
8
9
|
* A `testId` prop is provided for specified elements, which is a unique
|
|
@@ -10,6 +11,10 @@ export interface SpotlightCardProps {
|
|
|
10
11
|
* serving as a hook for automated tests
|
|
11
12
|
*/
|
|
12
13
|
testId?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The position in relation to the target the content should be shown at. Overrides `PopoverContent.placement`
|
|
16
|
+
*/
|
|
17
|
+
placement?: Placement;
|
|
13
18
|
/**
|
|
14
19
|
* Elements to be rendered inside the `SpotlightCard`.
|
|
15
20
|
*/
|
|
@@ -50,8 +50,8 @@ interface BasePopoverContentProps {
|
|
|
50
50
|
*/
|
|
51
51
|
offset?: Offset;
|
|
52
52
|
/**
|
|
53
|
-
* Describes the positioning strategy to use. By default, it is `
|
|
54
|
-
*
|
|
53
|
+
* Describes the positioning strategy to use. By default, it is `fixed`, which positions the popper correctly when it's in the normal
|
|
54
|
+
* flow of the document. If your reference element is in an absolute container, like a modal, use the `absolute` strategy instead.
|
|
55
55
|
*
|
|
56
56
|
* For more details see: https://popper.js.org/docs/v2/constructors/#strategy
|
|
57
57
|
*/
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
import type { Placement } from '../../../types';
|
|
1
2
|
export interface CaretProps {
|
|
3
|
+
/**
|
|
4
|
+
* The position in relation to the target the content should be shown at. Overrides `PopoverContent.placement`
|
|
5
|
+
*/
|
|
6
|
+
placement?: Placement;
|
|
2
7
|
/**
|
|
3
8
|
* A `testId` prop is provided for specified elements, which is a unique
|
|
4
9
|
* string that appears as a data attribute `data-testid` in the rendered code,
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
import { type ReactNode } from 'react';
|
|
6
|
+
import type { Placement } from '../../types';
|
|
6
7
|
export interface SpotlightCardProps {
|
|
7
8
|
/**
|
|
8
9
|
* A `testId` prop is provided for specified elements, which is a unique
|
|
@@ -10,6 +11,10 @@ export interface SpotlightCardProps {
|
|
|
10
11
|
* serving as a hook for automated tests
|
|
11
12
|
*/
|
|
12
13
|
testId?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The position in relation to the target the content should be shown at. Overrides `PopoverContent.placement`
|
|
16
|
+
*/
|
|
17
|
+
placement?: Placement;
|
|
13
18
|
/**
|
|
14
19
|
* Elements to be rendered inside the `SpotlightCard`.
|
|
15
20
|
*/
|
|
@@ -53,8 +53,8 @@ interface BasePopoverContentProps {
|
|
|
53
53
|
*/
|
|
54
54
|
offset?: Offset;
|
|
55
55
|
/**
|
|
56
|
-
* Describes the positioning strategy to use. By default, it is `
|
|
57
|
-
*
|
|
56
|
+
* Describes the positioning strategy to use. By default, it is `fixed`, which positions the popper correctly when it's in the normal
|
|
57
|
+
* flow of the document. If your reference element is in an absolute container, like a modal, use the `absolute` strategy instead.
|
|
58
58
|
*
|
|
59
59
|
* For more details see: https://popper.js.org/docs/v2/constructors/#strategy
|
|
60
60
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/spotlight",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "A spotlight introduces users to points of interest, from focused messages to multi-step tours.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"@atlaskit/css": "^0.19.0",
|
|
38
38
|
"@atlaskit/ds-lib": "^6.0.0",
|
|
39
39
|
"@atlaskit/heading": "^5.3.0",
|
|
40
|
-
"@atlaskit/icon": "^33.
|
|
40
|
+
"@atlaskit/icon": "^33.1.0",
|
|
41
41
|
"@atlaskit/image": "^3.0.0",
|
|
42
42
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
43
43
|
"@atlaskit/popper": "^7.1.0",
|
|
44
|
-
"@atlaskit/primitives": "^18.
|
|
45
|
-
"@atlaskit/tokens": "^11.
|
|
44
|
+
"@atlaskit/primitives": "^18.1.0",
|
|
45
|
+
"@atlaskit/tokens": "^11.4.0",
|
|
46
46
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
47
47
|
"@babel/runtime": "^7.0.0",
|
|
48
48
|
"@compiled/react": "^0.20.0",
|
|
@@ -55,9 +55,10 @@
|
|
|
55
55
|
"@af/accessibility-testing": "workspace:^",
|
|
56
56
|
"@af/integration-testing": "workspace:^",
|
|
57
57
|
"@af/visual-regression": "workspace:^",
|
|
58
|
-
"@atlaskit/dropdown-menu": "^16.
|
|
58
|
+
"@atlaskit/dropdown-menu": "^16.8.0",
|
|
59
59
|
"@atlaskit/ssr": "workspace:^",
|
|
60
60
|
"@atlassian/a11y-jest-testing": "^0.10.0",
|
|
61
|
+
"@atlassian/structured-docs-types": "workspace:^",
|
|
61
62
|
"@testing-library/react": "^16.3.0",
|
|
62
63
|
"react-dom": "^18.2.0"
|
|
63
64
|
},
|
|
@@ -67,6 +68,9 @@
|
|
|
67
68
|
},
|
|
68
69
|
"platform-dst-shape-theme-default": {
|
|
69
70
|
"type": "boolean"
|
|
71
|
+
},
|
|
72
|
+
"platform_spotlight_card_fit_content_anchor": {
|
|
73
|
+
"type": "boolean"
|
|
70
74
|
}
|
|
71
75
|
},
|
|
72
76
|
"techstack": {
|
package/spotlight.docs.tsx
CHANGED
|
@@ -4,36 +4,238 @@ import type { ComponentStructuredContentSource } from '@atlassian/structured-doc
|
|
|
4
4
|
|
|
5
5
|
const documentation: ComponentStructuredContentSource[] = [
|
|
6
6
|
{
|
|
7
|
-
name: '
|
|
8
|
-
description:
|
|
9
|
-
|
|
7
|
+
name: 'SpotlightCard',
|
|
8
|
+
description:
|
|
9
|
+
'A spotlight introduces users to points of interest, from focused messages to multi-step tours.',
|
|
10
|
+
status: 'open-beta',
|
|
10
11
|
import: {
|
|
11
|
-
name: '
|
|
12
|
+
name: 'SpotlightCard',
|
|
12
13
|
package: '@atlaskit/spotlight',
|
|
13
14
|
type: 'named',
|
|
14
15
|
packagePath: path.resolve(__dirname),
|
|
15
16
|
packageJson: require('./package.json'),
|
|
16
17
|
},
|
|
17
18
|
usageGuidelines: [
|
|
18
|
-
'Use for
|
|
19
|
-
'
|
|
20
|
-
'
|
|
21
|
-
'
|
|
22
|
-
],
|
|
23
|
-
contentGuidelines: [
|
|
24
|
-
'Use clear, descriptive search labels',
|
|
25
|
-
'Provide helpful search suggestions',
|
|
26
|
-
'Use consistent command naming',
|
|
27
|
-
'Keep search results relevant',
|
|
19
|
+
'Use for onboarding, feature discovery, or highlighting UI',
|
|
20
|
+
'Keep content to a single step when possible; max three steps for tours',
|
|
21
|
+
'Always include a dismiss control as the first focusable element',
|
|
22
|
+
'Use primary and secondary actions for buttons or links as needed',
|
|
28
23
|
],
|
|
29
24
|
accessibilityGuidelines: [
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
'Dismiss control must be first focusable element',
|
|
26
|
+
'Ensure spotlight content is understandable in seconds',
|
|
27
|
+
],
|
|
28
|
+
examples: [
|
|
29
|
+
{
|
|
30
|
+
name: 'Spotlight Card',
|
|
31
|
+
description: 'Spotlight example',
|
|
32
|
+
source: path.resolve(__dirname, './examples/constellation/actions.tsx'),
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
keywords: ['spotlight', 'onboarding', 'feature', 'discovery', 'card'],
|
|
36
|
+
categories: ['navigation'],
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'SpotlightHeader',
|
|
40
|
+
description: 'Header section of a spotlight card. Contains the headline and controls.',
|
|
41
|
+
status: 'open-beta',
|
|
42
|
+
import: {
|
|
43
|
+
name: 'SpotlightHeader',
|
|
44
|
+
package: '@atlaskit/spotlight',
|
|
45
|
+
type: 'named',
|
|
46
|
+
packagePath: path.resolve(__dirname),
|
|
47
|
+
packageJson: require('./package.json'),
|
|
48
|
+
},
|
|
49
|
+
usageGuidelines: ['Contains the headline and dismiss/control area'],
|
|
50
|
+
examples: [
|
|
51
|
+
{
|
|
52
|
+
name: 'Spotlight Header',
|
|
53
|
+
description: 'SpotlightHeader example',
|
|
54
|
+
source: path.resolve(__dirname, './examples/constellation/actions.tsx'),
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
keywords: ['spotlight', 'header'],
|
|
58
|
+
categories: ['navigation'],
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'SpotlightBody',
|
|
62
|
+
description: 'Main content area of a spotlight card.',
|
|
63
|
+
status: 'open-beta',
|
|
64
|
+
import: {
|
|
65
|
+
name: 'SpotlightBody',
|
|
66
|
+
package: '@atlaskit/spotlight',
|
|
67
|
+
type: 'named',
|
|
68
|
+
packagePath: path.resolve(__dirname),
|
|
69
|
+
packageJson: require('./package.json'),
|
|
70
|
+
},
|
|
71
|
+
examples: [
|
|
72
|
+
{
|
|
73
|
+
name: 'Spotlight Body',
|
|
74
|
+
description: 'SpotlightBody example',
|
|
75
|
+
source: path.resolve(__dirname, './examples/constellation/actions.tsx'),
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
keywords: ['spotlight', 'body', 'content'],
|
|
79
|
+
categories: ['navigation'],
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: 'SpotlightFooter',
|
|
83
|
+
description: 'Footer section of a spotlight card. Contains action buttons or links.',
|
|
84
|
+
status: 'open-beta',
|
|
85
|
+
import: {
|
|
86
|
+
name: 'SpotlightFooter',
|
|
87
|
+
package: '@atlaskit/spotlight',
|
|
88
|
+
type: 'named',
|
|
89
|
+
packagePath: path.resolve(__dirname),
|
|
90
|
+
packageJson: require('./package.json'),
|
|
91
|
+
},
|
|
92
|
+
usageGuidelines: ['Contains primary and secondary action buttons or links'],
|
|
93
|
+
examples: [
|
|
94
|
+
{
|
|
95
|
+
name: 'Spotlight Footer',
|
|
96
|
+
description: 'SpotlightFooter example',
|
|
97
|
+
source: path.resolve(__dirname, './examples/constellation/actions.tsx'),
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
keywords: ['spotlight', 'footer', 'actions'],
|
|
101
|
+
categories: ['navigation'],
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: 'PopoverProvider',
|
|
105
|
+
description:
|
|
106
|
+
'Context provider for positioning spotlight content. Wrap with PopoverTarget and PopoverContent.',
|
|
107
|
+
status: 'open-beta',
|
|
108
|
+
import: {
|
|
109
|
+
name: 'PopoverProvider',
|
|
110
|
+
package: '@atlaskit/spotlight',
|
|
111
|
+
type: 'named',
|
|
112
|
+
packagePath: path.resolve(__dirname),
|
|
113
|
+
packageJson: require('./package.json'),
|
|
114
|
+
},
|
|
115
|
+
usageGuidelines: ['Wraps the target element and spotlight content for positioning'],
|
|
116
|
+
examples: [
|
|
117
|
+
{
|
|
118
|
+
name: 'Popover Provider',
|
|
119
|
+
description: 'PopoverProvider example',
|
|
120
|
+
source: path.resolve(__dirname, './examples/constellation/actions.tsx'),
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
keywords: ['spotlight', 'popover', 'provider', 'positioning'],
|
|
124
|
+
categories: ['navigation'],
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: 'PopoverContent',
|
|
128
|
+
description: 'Renders the spotlight card content. Use with PopoverProvider and PopoverTarget.',
|
|
129
|
+
status: 'open-beta',
|
|
130
|
+
import: {
|
|
131
|
+
name: 'PopoverContent',
|
|
132
|
+
package: '@atlaskit/spotlight',
|
|
133
|
+
type: 'named',
|
|
134
|
+
packagePath: path.resolve(__dirname),
|
|
135
|
+
packageJson: require('./package.json'),
|
|
136
|
+
},
|
|
137
|
+
usageGuidelines: ['Placement is static—choose placement that prevents overflow'],
|
|
138
|
+
examples: [
|
|
139
|
+
{
|
|
140
|
+
name: 'Popover Content',
|
|
141
|
+
description: 'PopoverContent example',
|
|
142
|
+
source: path.resolve(__dirname, './examples/constellation/actions.tsx'),
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
keywords: ['spotlight', 'popover', 'content', 'positioning'],
|
|
146
|
+
categories: ['navigation'],
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: 'PopoverTarget',
|
|
150
|
+
description:
|
|
151
|
+
'The element the spotlight is positioned relative to. Use with PopoverProvider and PopoverContent.',
|
|
152
|
+
status: 'open-beta',
|
|
153
|
+
import: {
|
|
154
|
+
name: 'PopoverTarget',
|
|
155
|
+
package: '@atlaskit/spotlight',
|
|
156
|
+
type: 'named',
|
|
157
|
+
packagePath: path.resolve(__dirname),
|
|
158
|
+
packageJson: require('./package.json'),
|
|
159
|
+
},
|
|
160
|
+
usageGuidelines: ['Wrap the UI element the spotlight points to'],
|
|
161
|
+
examples: [
|
|
162
|
+
{
|
|
163
|
+
name: 'Popover Target',
|
|
164
|
+
description: 'PopoverTarget example',
|
|
165
|
+
source: path.resolve(__dirname, './examples/constellation/actions.tsx'),
|
|
166
|
+
},
|
|
167
|
+
],
|
|
168
|
+
keywords: ['spotlight', 'popover', 'target', 'positioning'],
|
|
169
|
+
categories: ['navigation'],
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
name: 'SpotlightDismissControl',
|
|
173
|
+
description:
|
|
174
|
+
'Required close/dismiss button for spotlight cards. Must be the first focusable element.',
|
|
175
|
+
status: 'open-beta',
|
|
176
|
+
import: {
|
|
177
|
+
name: 'SpotlightDismissControl',
|
|
178
|
+
package: '@atlaskit/spotlight',
|
|
179
|
+
type: 'named',
|
|
180
|
+
packagePath: path.resolve(__dirname),
|
|
181
|
+
packageJson: require('./package.json'),
|
|
182
|
+
},
|
|
183
|
+
usageGuidelines: [
|
|
184
|
+
'Required for all spotlights—must be the first focusable element for accessibility',
|
|
185
|
+
],
|
|
186
|
+
accessibilityGuidelines: ['Must be first focusable element for proper focus order'],
|
|
187
|
+
examples: [
|
|
188
|
+
{
|
|
189
|
+
name: 'Spotlight Dismiss Control',
|
|
190
|
+
description: 'SpotlightDismissControl example',
|
|
191
|
+
source: path.resolve(__dirname, './examples/constellation/actions.tsx'),
|
|
192
|
+
},
|
|
193
|
+
],
|
|
194
|
+
keywords: ['spotlight', 'dismiss', 'close', 'control'],
|
|
195
|
+
categories: ['navigation'],
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
name: 'SpotlightHeadline',
|
|
199
|
+
description: 'The headline/title of a spotlight card. Use within SpotlightHeader.',
|
|
200
|
+
status: 'open-beta',
|
|
201
|
+
import: {
|
|
202
|
+
name: 'SpotlightHeadline',
|
|
203
|
+
package: '@atlaskit/spotlight',
|
|
204
|
+
type: 'named',
|
|
205
|
+
packagePath: path.resolve(__dirname),
|
|
206
|
+
packageJson: require('./package.json'),
|
|
207
|
+
},
|
|
208
|
+
usageGuidelines: ['Keep headlines concise and understandable in seconds'],
|
|
209
|
+
examples: [
|
|
210
|
+
{
|
|
211
|
+
name: 'Spotlight Headline',
|
|
212
|
+
description: 'SpotlightHeadline example',
|
|
213
|
+
source: path.resolve(__dirname, './examples/constellation/actions.tsx'),
|
|
214
|
+
},
|
|
215
|
+
],
|
|
216
|
+
keywords: ['spotlight', 'headline', 'title'],
|
|
217
|
+
categories: ['navigation'],
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
name: 'SpotlightActions',
|
|
221
|
+
description: 'Container for spotlight footer action buttons or links.',
|
|
222
|
+
status: 'open-beta',
|
|
223
|
+
import: {
|
|
224
|
+
name: 'SpotlightActions',
|
|
225
|
+
package: '@atlaskit/spotlight',
|
|
226
|
+
type: 'named',
|
|
227
|
+
packagePath: path.resolve(__dirname),
|
|
228
|
+
packageJson: require('./package.json'),
|
|
229
|
+
},
|
|
230
|
+
usageGuidelines: ['Container for primary and secondary action buttons or links'],
|
|
231
|
+
examples: [
|
|
232
|
+
{
|
|
233
|
+
name: 'Spotlight Actions',
|
|
234
|
+
description: 'SpotlightActions example',
|
|
235
|
+
source: path.resolve(__dirname, './examples/constellation/actions.tsx'),
|
|
236
|
+
},
|
|
34
237
|
],
|
|
35
|
-
|
|
36
|
-
keywords: ['spotlight', 'search', 'command', 'palette', 'quick'],
|
|
238
|
+
keywords: ['spotlight', 'actions', 'footer', 'buttons'],
|
|
37
239
|
categories: ['navigation'],
|
|
38
240
|
},
|
|
39
241
|
];
|