@atlaskit/spotlight 0.7.1 → 0.7.2
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
CHANGED
|
@@ -7,6 +7,7 @@ import SingleStepExample from '../../examples/constellation/single-step';
|
|
|
7
7
|
import MultipleStepsExample from '../../examples/constellation/multiple-steps';
|
|
8
8
|
import MediaExample from '../../examples/constellation/media';
|
|
9
9
|
import ControlsExample from '../../examples/constellation/controls';
|
|
10
|
+
import MotionExample from '../../examples/constellation/motion';
|
|
10
11
|
|
|
11
12
|
## Single step
|
|
12
13
|
|
|
@@ -20,16 +21,16 @@ To show/hide the `SpotlightCard`, simply use a `useState` to control the `isVisi
|
|
|
20
21
|
`PopoverContent`. To position the `SpotlightCard`, use `PopoverProvider`, `PopoverTarget` and
|
|
21
22
|
`PopoverContent` and set the `placement` prop.
|
|
22
23
|
|
|
23
|
-
<Example Component={SingleStepExample} packageName="@atlaskit/
|
|
24
|
+
<Example Component={SingleStepExample} packageName="@atlaskit/spotlight" />
|
|
24
25
|
|
|
25
26
|
## Multi-step tour
|
|
26
27
|
|
|
27
|
-
Multiple steps should be avoided if possible
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
Multiple steps should be avoided if possible, but if they are required, manage the tour with a
|
|
29
|
+
`useState`. If `useState` is not feasible, then a React context may be used. However, these contexts
|
|
30
|
+
will often need to be wrapping the entire `App` and therefore will cause the entire `App` to
|
|
31
|
+
re-render every time a new spotlight step is shown.
|
|
31
32
|
|
|
32
|
-
<Example Component={MultipleStepsExample} packageName="@atlaskit/
|
|
33
|
+
<Example Component={MultipleStepsExample} packageName="@atlaskit/spotlight" />
|
|
33
34
|
|
|
34
35
|
## Placements
|
|
35
36
|
|
|
@@ -37,7 +38,7 @@ Spotlight placements are static. They do not change as the user scrolls, or if t
|
|
|
37
38
|
overflows out of the viewport. Make sure to choose a placement that ensures the `SpotlightCard` is
|
|
38
39
|
displayed in full.
|
|
39
40
|
|
|
40
|
-
<Example Component={PlacementsExample} packageName="@atlaskit/
|
|
41
|
+
<Example Component={PlacementsExample} packageName="@atlaskit/spotlight" />
|
|
41
42
|
|
|
42
43
|
## Media
|
|
43
44
|
|
|
@@ -46,9 +47,16 @@ correct reflow on smaller viewports, media must be 295px width X 135px height.
|
|
|
46
47
|
|
|
47
48
|
Media can be an image, gif, or video that helps communicate spotlight intent.
|
|
48
49
|
|
|
49
|
-
<Example Component={MediaExample} packageName="@atlaskit/
|
|
50
|
+
<Example Component={MediaExample} packageName="@atlaskit/spotlight" />
|
|
50
51
|
|
|
51
52
|
## Controls
|
|
52
53
|
|
|
53
54
|
`SpotlightDismissControl` is required for all `SpotlightCard` components. It **must** be the first
|
|
54
55
|
focusable element on the `SpotlightCard` card to provide an accessible experience.
|
|
56
|
+
|
|
57
|
+
## Motion
|
|
58
|
+
|
|
59
|
+
`@atlaskit/spotlight` can be composed with `@atlaskit/motion` or other CSS animation packages to
|
|
60
|
+
create smooth 'enter' or 'exit' transitions.
|
|
61
|
+
|
|
62
|
+
<Example Component={MotionExample} packageName="@atlaskit/spotlight" />
|
|
@@ -24,19 +24,19 @@ interface BasePopoverContentProps {
|
|
|
24
24
|
*/
|
|
25
25
|
shouldDismissOnClickOutside?: boolean;
|
|
26
26
|
/**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
* Spotlights can be dismissed by:
|
|
28
|
+
* - Clicking the `SpotlightDismissControl`
|
|
29
|
+
* - Clicking any DOM element outside the spotlight (if `shouldDismissOnClickOutside === true`)
|
|
30
|
+
* - Pressing the Escape key
|
|
31
|
+
*
|
|
32
|
+
* These events align to the React.MouseEvent<HTMLButtonElement, MouseEvent>, MouseEvent, and KeyboardEvent events respectively.
|
|
33
|
+
* Defaults to `true`.
|
|
34
34
|
*/
|
|
35
35
|
dismiss: (event: DismissEvent) => void;
|
|
36
36
|
/**
|
|
37
37
|
* Invoked when the user clicks `SpotlightSecondaryAction`. If an `onClick` handler is provided to `SpotlightSecondaryAction`
|
|
38
38
|
* then that takes precedence, and `back` will be ignored.
|
|
39
|
-
|
|
39
|
+
*/
|
|
40
40
|
back?: (event: BackEvent) => void;
|
|
41
41
|
/**
|
|
42
42
|
* The content to be rendered in `PopoverContent`. This is intended to be a `SpotlightCard`.
|
|
@@ -24,19 +24,19 @@ interface BasePopoverContentProps {
|
|
|
24
24
|
*/
|
|
25
25
|
shouldDismissOnClickOutside?: boolean;
|
|
26
26
|
/**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
* Spotlights can be dismissed by:
|
|
28
|
+
* - Clicking the `SpotlightDismissControl`
|
|
29
|
+
* - Clicking any DOM element outside the spotlight (if `shouldDismissOnClickOutside === true`)
|
|
30
|
+
* - Pressing the Escape key
|
|
31
|
+
*
|
|
32
|
+
* These events align to the React.MouseEvent<HTMLButtonElement, MouseEvent>, MouseEvent, and KeyboardEvent events respectively.
|
|
33
|
+
* Defaults to `true`.
|
|
34
34
|
*/
|
|
35
35
|
dismiss: (event: DismissEvent) => void;
|
|
36
36
|
/**
|
|
37
37
|
* Invoked when the user clicks `SpotlightSecondaryAction`. If an `onClick` handler is provided to `SpotlightSecondaryAction`
|
|
38
38
|
* then that takes precedence, and `back` will be ignored.
|
|
39
|
-
|
|
39
|
+
*/
|
|
40
40
|
back?: (event: BackEvent) => void;
|
|
41
41
|
/**
|
|
42
42
|
* The content to be rendered in `PopoverContent`. This is intended to be a `SpotlightCard`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/spotlight",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
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",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@atlaskit/icon": "^28.5.0",
|
|
41
41
|
"@atlaskit/image": "^3.0.0",
|
|
42
42
|
"@atlaskit/popper": "^7.1.0",
|
|
43
|
-
"@atlaskit/primitives": "^16.
|
|
43
|
+
"@atlaskit/primitives": "^16.1.0",
|
|
44
44
|
"@atlaskit/tokens": "^7.0.0",
|
|
45
45
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
46
46
|
"@babel/runtime": "^7.0.0",
|