@atlaskit/spotlight 0.7.0 → 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.
Files changed (50) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +1 -6
  3. package/constellation/images/color-application.png +0 -0
  4. package/constellation/images/multi-step-step-1.png +0 -0
  5. package/constellation/images/multi-step-step-2.png +0 -0
  6. package/constellation/images/principles-of-use-do.png +0 -0
  7. package/constellation/images/principles-of-use-dont.png +0 -0
  8. package/constellation/images/single-step.png +0 -0
  9. package/constellation/images/spotlight-anatomy.png +0 -0
  10. package/constellation/images/tour-use-do.png +0 -0
  11. package/constellation/images/tour-use-dont.png +0 -0
  12. package/constellation/images/triggered-spotlight.png +0 -0
  13. package/constellation/index/examples.mdx +25 -19
  14. package/constellation/index/usage.mdx +169 -84
  15. package/dist/cjs/ui/body/index.js +1 -1
  16. package/dist/cjs/ui/secondary-action/index.js +1 -1
  17. package/dist/cjs/ui/show-more-control/index.js +1 -1
  18. package/dist/es2019/ui/body/index.js +1 -1
  19. package/dist/es2019/ui/popover-provider/index.js +0 -1
  20. package/dist/es2019/ui/popover-target/index.js +0 -1
  21. package/dist/es2019/ui/secondary-action/index.js +1 -1
  22. package/dist/es2019/ui/show-more-control/index.js +1 -1
  23. package/dist/esm/ui/body/index.js +1 -1
  24. package/dist/esm/ui/popover-provider/index.js +0 -1
  25. package/dist/esm/ui/popover-target/index.js +0 -1
  26. package/dist/esm/ui/secondary-action/index.js +1 -1
  27. package/dist/esm/ui/show-more-control/index.js +1 -1
  28. package/dist/types/ui/body/index.d.ts +3 -3
  29. package/dist/types/ui/card/index.d.ts +1 -1
  30. package/dist/types/ui/dismiss-control/index.d.ts +1 -1
  31. package/dist/types/ui/headline/index.d.ts +1 -1
  32. package/dist/types/ui/media/index.d.ts +1 -2
  33. package/dist/types/ui/popover-content/index.d.ts +39 -0
  34. package/dist/types/ui/popover-provider/index.d.ts +8 -3
  35. package/dist/types/ui/popover-target/index.d.ts +8 -3
  36. package/dist/types/ui/primary-action/index.d.ts +1 -1
  37. package/dist/types/ui/secondary-action/index.d.ts +2 -2
  38. package/dist/types/ui/show-more-control/index.d.ts +1 -1
  39. package/dist/types-ts4.5/ui/body/index.d.ts +3 -3
  40. package/dist/types-ts4.5/ui/card/index.d.ts +1 -1
  41. package/dist/types-ts4.5/ui/dismiss-control/index.d.ts +1 -1
  42. package/dist/types-ts4.5/ui/headline/index.d.ts +1 -1
  43. package/dist/types-ts4.5/ui/media/index.d.ts +1 -2
  44. package/dist/types-ts4.5/ui/popover-content/index.d.ts +39 -0
  45. package/dist/types-ts4.5/ui/popover-provider/index.d.ts +8 -3
  46. package/dist/types-ts4.5/ui/popover-target/index.d.ts +8 -3
  47. package/dist/types-ts4.5/ui/primary-action/index.d.ts +1 -1
  48. package/dist/types-ts4.5/ui/secondary-action/index.d.ts +2 -2
  49. package/dist/types-ts4.5/ui/show-more-control/index.d.ts +1 -1
  50. package/package.json +10 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/spotlight
2
2
 
3
+ ## 0.7.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`ccbe07df5c620`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ccbe07df5c620) -
8
+ Update documentation to include motion example.
9
+
10
+ ## 0.7.1
11
+
12
+ ### Patch Changes
13
+
14
+ - [`991d1598db6d6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/991d1598db6d6) -
15
+ Documentation for upcoming beta release.
16
+
3
17
  ## 0.7.0
4
18
 
5
19
  ### Minor Changes
package/README.md CHANGED
@@ -1,13 +1,8 @@
1
1
  # Spotlight
2
2
 
3
- Note: This package is in pre-alpha. It is not ready to be consumed and used.
4
-
5
- A spotlight introduces users to various points of interest across Atlassian through focused messages
6
- or multi-step tours.
3
+ A spotlight introduces users to points of interest, from focused messages to multi-step tours.
7
4
 
8
5
  ## Usage
9
6
 
10
- `import { Spotlight } from '@atlaskit/spotlight';`
11
-
12
7
  Detailed docs and example usage can be found
13
8
  [here](https://atlaskit.atlassian.com/packages/design-system/spotlight).
@@ -7,31 +7,30 @@ 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
- ## Single Step
12
+ ## Single step
12
13
 
13
- Ideally, spotlights should only have a single step so as not to overwhelm users with too much
14
- information. Try and combine or eliminate tasks where possible. Dismiss functionality is required.
15
- Don't force users to participate.
14
+ Always aim for a single step experience.
16
15
 
17
- By design `@atlaskit/spotlight` does not have a blanket, scroll-lock, focus-trap, or click-outside
18
- to dismiss functionality. This is to ensure the user is not hijacked into the spotlight experience,
19
- and can opt-in if they are interested.
16
+ By design, `@atlaskit/spotlight` does not have a blanket, scroll-lock, or focus-trap functionality.
17
+ This is to ensure the user is not hijacked into the spotlight experience, and can opt-in if they are
18
+ interested.
20
19
 
21
20
  To show/hide the `SpotlightCard`, simply use a `useState` to control the `isVisible` prop on
22
21
  `PopoverContent`. To position the `SpotlightCard`, use `PopoverProvider`, `PopoverTarget` and
23
22
  `PopoverContent` and set the `placement` prop.
24
23
 
25
- <Example Component={SingleStepExample} packageName="@atlaskit/spinner" />
24
+ <Example Component={SingleStepExample} packageName="@atlaskit/spotlight" />
26
25
 
27
- ## Multiple Steps/Tour
26
+ ## Multi-step tour
28
27
 
29
- Multiple steps should be avoided if possible. Try and combine or eliminate steps where possible. If
30
- multiple steps are required, preference managing the tour with a `useState`. As a last resort a
31
- React context may be used. However, these contexts will often need to be wrapping the entire `App`
32
- and therefore will cause the entire `App` to re-render every time a new spotlight step is shown.
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.
33
32
 
34
- <Example Component={MultipleStepsExample} packageName="@atlaskit/spinner" />
33
+ <Example Component={MultipleStepsExample} packageName="@atlaskit/spotlight" />
35
34
 
36
35
  ## Placements
37
36
 
@@ -39,18 +38,25 @@ Spotlight placements are static. They do not change as the user scrolls, or if t
39
38
  overflows out of the viewport. Make sure to choose a placement that ensures the `SpotlightCard` is
40
39
  displayed in full.
41
40
 
42
- <Example Component={PlacementsExample} packageName="@atlaskit/spinner" />
41
+ <Example Component={PlacementsExample} packageName="@atlaskit/spotlight" />
43
42
 
44
43
  ## Media
45
44
 
46
- Media is optional for a `SpotlightCard`. However if it is used it must be 295px width X 135px
47
- height. This is to ensure correct reflow on smaller viewports.
45
+ Media is optional for a `SpotlightCard`and should only be used for more complex features. To ensure
46
+ correct reflow on smaller viewports, media must be 295px width X 135px height.
48
47
 
49
- Media can be an image, video, animation, or any other visual aid to communicate spotlight intent.
48
+ Media can be an image, gif, or video that helps communicate spotlight intent.
50
49
 
51
- <Example Component={MediaExample} packageName="@atlaskit/spinner" />
50
+ <Example Component={MediaExample} packageName="@atlaskit/spotlight" />
52
51
 
53
52
  ## Controls
54
53
 
55
54
  `SpotlightDismissControl` is required for all `SpotlightCard` components. It **must** be the first
56
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" />
@@ -1,127 +1,212 @@
1
- import { SingleStepSpotlightTable, MultiStepSpotlightTable } from '@af/design-system-docs-ui';
1
+ import {
2
+ SpotlightTable,
3
+ SpotlightVisualGuidelines,
4
+ SpotlightCollectionBackgroundColors,
5
+ } from '@af/design-system-docs-ui';
6
+ import { Stack } from '@atlaskit/primitives/compiled';
7
+
8
+ import tourUseDo from '../images/tour-use-do.png';
9
+ import tourUseDont from '../images/tour-use-dont.png';
10
+ import principlesDo from '../images/principles-of-use-do.png';
11
+ import principlesDont from '../images/principles-of-use-dont.png';
2
12
 
3
13
  ## Usage
4
14
 
5
- A spotlight focuses attention on a specific part of the UI, such as a button or icon, to educate
6
- users about key features or workflows. Spotlights are most effective for onboarding new users,
7
- driving feature discovery, or highlighting important changes. Use them sparingly — if your UI needs
8
- frequent spotlights, consider simplifying the core experience instead.
15
+ Use a spotlight to bring attention to a specific part of the UI, such as a button or icon, to
16
+ educate users about key features or workflows.
9
17
 
10
- ## Spotlight Scenarios
18
+ Spotlights are most effective for onboarding new users, driving feature discovery, or highlighting
19
+ important changes. Use them sparingly. If your UI needs frequent spotlights, consider simplifying
20
+ the core experience instead.
11
21
 
12
- ### Top use cases
22
+ ### Single-step spotlight
13
23
 
14
- - **Onboarding new users**: Guide first-time users to essential features and workflows.
15
- - **Feature discovery**: Help existing users learn about new or updated capabilities.
24
+ The ideal spotlight experience is lightweight and a single-step. Always try to limit your experience
25
+ to one spotlight to prevent information overload for the user.
16
26
 
17
- ### Growth use cases
27
+ ![Example of a single-step spotlight with content about Jira tasks pointing at a task on a Jira board.](../images/single-step.png)
18
28
 
19
- - **Cross-flow, cross-join, co-use**: Use spotlights only when triggered by another message type
20
- (e.g., a banner that asks for permission to “show me” before triggering a spotlight).
29
+ ### Multi-step tour
21
30
 
22
- ### Unsupported use cases
31
+ A tour is a series of spotlights that point to multiple areas of the UI. <br /> Ensure your tour:
23
32
 
24
- - **Transactional**: Never use spotlights for transactional messages.
33
+ - has a maximum of three steps
34
+ - is logically sequenced
35
+ - is limited to one screen
36
+ - includes a “Back” call-to-action (CTA) after the initial spotlight
37
+ - displays a step count
25
38
 
26
- ## Guiding Principles
39
+ **In a tour, the initial spotlight references step count and clear next action**
27
40
 
28
- - **Use sparingly**: Spotlights are a Level 3 (Neutral Plus) attention component. Overuse can
29
- distract and fatigue users.
30
- - **One at a time**: Only show one spotlight at a time.
31
- - **Dismissibility**: Always provide a dismiss option. Never force participation.
32
- - **Step count**: Prefer single-step spotlights. For tours, keep flows short (2–3 steps max).
33
- - **Orchestration**: Build spotlights with Post Office to avoid message collisions and enforce
34
- fatigue rules (Atlassians Only).
35
- - **Media**: Use media (images or video) only when it enhances understanding. Exclude media if the
36
- spotlight already focuses attention effectively.
41
+ ![Example of a first spotlight in multi-step tour with content about Loom pointing at a Loom video.](../images/multi-step-step-1.png)
37
42
 
38
- ## Anatomy & Specifications
43
+ **Advancing to the next step introduces a Back button**
39
44
 
40
- ### Single Step Spotlight
45
+ ![Example of a second spotlight in multi-step tour with content about creating docs in Jira pointing at a Jira update.](../images/multi-step-step-2.png)
41
46
 
42
- <SingleStepSpotlightTable />
43
- <br />
47
+ ### Tour use
44
48
 
45
- ### Multi Step Spotlight/Tour
49
+ Tours should be used sparingly. Before designing a tour, assess if you can combine or eliminate
50
+ steps to keep the experience as lightweight as possible, as seen below.
46
51
 
47
- <MultiStepSpotlightTable />
48
- <br />
52
+ <DoDont
53
+ type="do"
54
+ image={{
55
+ url: tourUseDo,
56
+ alt: 'Example of a single-step spotlight with content that combines the example content of the multi-step tour next to it.',
57
+ }}
58
+ >
59
+ Keep things lightweight. Aim for one step with active and concise messaging.
60
+ </DoDont>
49
61
 
50
- ## Visual Guidance
62
+ <DoDont
63
+ type="dont"
64
+ image={{
65
+ url: tourUseDont,
66
+ alt: 'Example of a multi-step spotlight with content that that can be combined into a single step.',
67
+ }}
68
+ >
69
+ Avoid tours unless the steps are crucial. Consolidate information first.
70
+ </DoDont>
51
71
 
52
- - **Complexity**: Match the visual complexity to the feature’s learning curve. Use text-only for
53
- simple features, a single illustration for moderate complexity, and a narrative/motion for complex
54
- flows.
72
+ ### Triggered spotlights
55
73
 
56
- - **Brand color**: Use solid backgrounds to focus attention. Limit to three brand colors per
57
- composition.
74
+ Spotlights can activate UI if triggered by another component. Although they are a second step in an
75
+ experience, they should not use a step count or “Back” CTA.
58
76
 
59
- - **Composition**: Highlight the focal point with size, color, and gesture lines. Use motion only if
60
- it clarifies the feature.
77
+ **In this example, a banner triggers a spotlight that opens a dropdown**
61
78
 
62
- ## Behavior
79
+ ![Example of a single-step spotlight with content that combines the example content of the multi-step tour next to it.](../images/triggered-spotlight.png)
63
80
 
64
- - **Entry points**: Spotlights should be triggered contextually and never interrupt core workflows.
65
- For cross-product or promotional spotlights, use a less obtrusive entrypoint (like a banner)
66
- first.
81
+ ## Spotlight use cases
67
82
 
68
- - **Tours**: Sequence steps logically. Keep flows short and focused.
83
+ ### Onboarding
69
84
 
70
- ## Best Practices
85
+ Guide first-time users to essential features and workflows.
71
86
 
72
- - Use spotlights only when necessary to drive understanding or adoption.
73
- - Sequence multi-step spotlights logically; aim for 2–3 steps max.
74
- - Always allow users to dismiss or skip.
75
- - Avoid competing with other in-product messages.
76
- - Prefer embedded, contextual education over overlays.
87
+ ### Feature discovery
77
88
 
78
- ## Accessibility
89
+ Help existing users learn about new or updated capabilities.
90
+
91
+ ### Cross-flow, cross-join, and co-use
92
+
93
+ Trigger a spotlight from another component to elaborate on the message. For example, a flag with a
94
+ “Show me” CTA triggers a spotlight to demonstrate the feature in context. Triggered spotlights can
95
+ also activate UI.
96
+
97
+ ## Principles of use
98
+
99
+ <DoDont
100
+ type="do"
101
+ image={{
102
+ url: principlesDo,
103
+ alt: 'Example of spotlight with content that explains what Rovo is.',
104
+ }}
105
+ >
106
+ Use spotlights to educate users or introduce them to something new.
107
+ </DoDont>
79
108
 
80
- - The headline is used as the accessible name for the spotlight dialog.
81
- - Keep content concise and avoid motion that could be disruptive.
82
- - Ensure the carat and spotlight are not truncated by the browser bounds.
109
+ <DoDont
110
+ type="dont"
111
+ image={{
112
+ url: principlesDont,
113
+ alt: 'Example of a spotlight with content that promotes purchasing collections to get Rovo.',
114
+ }}
115
+ >
116
+ Use spotlights for upsells or other transactional messaging.
117
+ </DoDont>
83
118
 
84
- ### Focus Management
119
+ ## Anatomy and specifications
85
120
 
86
- #### Single step spotlights
121
+ ![Example spotlight with a diagram that points to the elements that exist within a spotlight.](../images/spotlight-anatomy.png)
87
122
 
88
- The spotlight should **not** grab focus. Allow users to tab onto the spotlight in normal tabbing
89
- order. By default the tabbable elements in spotlight will be ordered directly after the target
90
- element to give screen-reader/keyboard users context about what the spotlight is related to.
123
+ <SpotlightTable />
91
124
 
92
- The first focusable element in the spotlight should **always** be the dismiss button at the top of
93
- the card. This will happen automatically even when a show-more button is visually ahead of it. So
94
- product engineers shouldn't need to do any additional work.
125
+ ## Visual guidelines
95
126
 
96
- #### Multi step spotlights
127
+ ### Media
97
128
 
98
- The first spotlight in a tour should **not** grab focus. Allow users to tab onto the spotlight in
99
- normal tabbing order.
129
+ Media should only be used to make messaging clearer for more complex features. For simple
130
+ experiences, stick to text to avoid distracting the user.
100
131
 
101
- The second (and subsequent step) spotlights **should** grab focus. This is because screen-reader
102
- users have no other method of knowing where the new spotlight steps are shown.
132
+ The cognitive load necessary for comprehension should determine the level of complexity.
103
133
 
104
- Once the tour completes, focus should be returned to the target element for the first step. This
105
- allows screen-reader users to easily perform the actions just taught to them via the spotlight tour.
134
+ <br />
135
+ <SpotlightVisualGuidelines />
136
+ <br />
137
+
138
+ ### Color application
139
+
140
+ ![Example spotlight with a diagram that points to the background color then outlines that it should be the right collection color.](../images/color-application.png)
106
141
 
107
- ## Content Guidelines
142
+ - Use solid color for the background color to drive focus to the main UI elements
143
+ - Incorporate the collection color into background color to further strengthen the color association
144
+ to the collection (see colors below)
145
+ - Start with the color designated for each collection, then evenly distribute other brand colors to
146
+ the UI elements
147
+ - Limit the use to no more than three different colors in a single composition
148
+ - Different shades can be used to create contrast and spatial depth in the UI illustrations, but
149
+ avoid using too many shades within one composition
108
150
 
109
- ## Headline
151
+ ### Collection background colors
152
+
153
+ <br />
154
+ <SpotlightCollectionBackgroundColors />
155
+ <br />
110
156
 
111
- - Required. Begin with an active verb where possible.
112
- - Brief and direct; communicate the main benefit.
113
- - Limit to one line and use sentence case.
157
+ ## Content guidelines
158
+
159
+ A successful spotlight can be understood in just a few seconds. Spotlight content should be as
160
+ concise as possible, easy to scan, and only communicate essential information.
161
+
162
+ ### Messaging guidelines
163
+
164
+ - Prioritize the most relevant information and if more context is needed, find a way to provide a
165
+ path to further learning
166
+ - Don’t talk about things the user cannot see at that time
167
+
168
+ #### Headline
169
+
170
+ - 27 characters max
171
+ - Start with an active verb
172
+ - Clearly communicate intent
173
+ - Focus on benefits rather than announcements
174
+ - Personalize with words such as, “your” where it is relevant
175
+
176
+ #### Body copy
177
+
178
+ - 75 characters max
179
+ - Brief and direct
180
+ - Elaborate value

181
+
182
+ #### Primary CTA
183
+
184
+ - 24 characters max for single-step
185
+ - 15 characters max for tour
186
+ - Provide an obvious next action
187
+ - If used for dismissal, use “Done”
188
+ - Let them know where they’re going next when navigating to another screen “Go to Jira”
189
+ - Be explicit when activating UI components “Chat with Rovo” opens the Rovo panel
190
+ - Use “Learn more” when navigating to more detailed information
191
+ - For tours: start with “Next” and conclude the flow with “Done”

192
+
193
+ #### Secondary CTA
194
+
195
+ - Reserved for “Back” navigation in tours
196
+
197
+ ## Accessibility
114
198
 
115
- ## Body
199
+ - The headline is used as the accessible name for the spotlight dialog
200
+ - Keep content concise and avoid motion that could be disruptive
201
+ - Ensure the arrow and spotlight are not truncated by the browser bounds
116
202
 
117
- - Required. Briefly elaborate on the intent.
118
- - Avoid repeating the headline verb.
119
- - Two lines max. Focus on benefits and relevance.
120
- - Reference only visible elements.
203
+ ### Focus management
121
204
 
122
- ## CTA
205
+ For a **single-step spotlight** or the **first in a multi-step tour**, tabbing begins after the
206
+ targeted element so the user is aware of what the spotlight is referring to. It follows a normal
207
+ tabbing order, automatically starting with the "X" dismissal on the top right, even if a "…" show
208
+ more is included ahead of it.
123
209
 
124
- - Required. One clear next action.
125
- - Avoid plan or feature names in CTAs.
126
- - For tours: “Next”, “Back”, “Done”.
127
- - For features: 1–3 words; “Done” is acceptable if no clear next action.
210
+ Unless the first spotlight is dismissed with the "X," in a **multi-step tour** the second and third
211
+ spotlights grab focus to continue the messaging narrative then return to the targeted element once
212
+ complete so the user can perform the intended action.
@@ -18,7 +18,7 @@ var styles = {
18
18
  /**
19
19
  * __SpotlightBody__
20
20
  *
21
- * `SpotlightBody` is required in a `Spotlight`. The content should be brief and direct to elaborate on the intent.
21
+ * `SpotlightBody` is required in a spotlight. The content should be brief and direct to elaborate on the intent.
22
22
  *
23
23
  */
24
24
  var SpotlightBody = exports.SpotlightBody = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
@@ -19,7 +19,7 @@ var styles = {
19
19
  /**
20
20
  * __Spotlight secondary action__
21
21
  *
22
- * `SpotlightSecondaryAction` is not required for all `Spotlight` components. It should supplement the SpotlightPrimaryAction.
22
+ * `SpotlightSecondaryAction` is not required for all spotlight components. It should supplement the `SpotlightPrimaryAction`.
23
23
  * It is intended to be used to go back to the previous step in multi step spotlight tours, or other similar actions.
24
24
  *
25
25
  */
@@ -20,7 +20,7 @@ var styles = {
20
20
  /**
21
21
  * __SpotlightShowMoreControl__
22
22
  *
23
- * SpotlightShowMoreControl allows the user to close the `Spotlight`.
23
+ * `SpotlightShowMoreControl` provides follow-up actions and customizations for the spotlight.
24
24
  *
25
25
  */
26
26
  var SpotlightShowMoreControl = exports.SpotlightShowMoreControl = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
@@ -10,7 +10,7 @@ const styles = {
10
10
  /**
11
11
  * __SpotlightBody__
12
12
  *
13
- * `SpotlightBody` is required in a `Spotlight`. The content should be brief and direct to elaborate on the intent.
13
+ * `SpotlightBody` is required in a spotlight. The content should be brief and direct to elaborate on the intent.
14
14
  *
15
15
  */
16
16
  export const SpotlightBody = /*#__PURE__*/forwardRef(({
@@ -3,7 +3,6 @@ import * as React from 'react';
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import { Manager } from '@atlaskit/popper';
5
5
  import { SpotlightContextProvider } from '../../controllers/context';
6
-
7
6
  /**
8
7
  * __Popover provider__
9
8
  *
@@ -2,7 +2,6 @@
2
2
  import * as React from 'react';
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import { Reference } from '@atlaskit/popper';
5
-
6
5
  /**
7
6
  * __Target__
8
7
  *
@@ -11,7 +11,7 @@ const styles = {
11
11
  /**
12
12
  * __Spotlight secondary action__
13
13
  *
14
- * `SpotlightSecondaryAction` is not required for all `Spotlight` components. It should supplement the SpotlightPrimaryAction.
14
+ * `SpotlightSecondaryAction` is not required for all spotlight components. It should supplement the `SpotlightPrimaryAction`.
15
15
  * It is intended to be used to go back to the previous step in multi step spotlight tours, or other similar actions.
16
16
  *
17
17
  */
@@ -11,7 +11,7 @@ const styles = {
11
11
  /**
12
12
  * __SpotlightShowMoreControl__
13
13
  *
14
- * SpotlightShowMoreControl allows the user to close the `Spotlight`.
14
+ * `SpotlightShowMoreControl` provides follow-up actions and customizations for the spotlight.
15
15
  *
16
16
  */
17
17
  export const SpotlightShowMoreControl = /*#__PURE__*/forwardRef(({
@@ -10,7 +10,7 @@ var styles = {
10
10
  /**
11
11
  * __SpotlightBody__
12
12
  *
13
- * `SpotlightBody` is required in a `Spotlight`. The content should be brief and direct to elaborate on the intent.
13
+ * `SpotlightBody` is required in a spotlight. The content should be brief and direct to elaborate on the intent.
14
14
  *
15
15
  */
16
16
  export var SpotlightBody = /*#__PURE__*/forwardRef(function (_ref, ref) {
@@ -3,7 +3,6 @@ import * as React from 'react';
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import { Manager } from '@atlaskit/popper';
5
5
  import { SpotlightContextProvider } from '../../controllers/context';
6
-
7
6
  /**
8
7
  * __Popover provider__
9
8
  *
@@ -2,7 +2,6 @@
2
2
  import * as React from 'react';
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import { Reference } from '@atlaskit/popper';
5
-
6
5
  /**
7
6
  * __Target__
8
7
  *
@@ -11,7 +11,7 @@ var styles = {
11
11
  /**
12
12
  * __Spotlight secondary action__
13
13
  *
14
- * `SpotlightSecondaryAction` is not required for all `Spotlight` components. It should supplement the SpotlightPrimaryAction.
14
+ * `SpotlightSecondaryAction` is not required for all spotlight components. It should supplement the `SpotlightPrimaryAction`.
15
15
  * It is intended to be used to go back to the previous step in multi step spotlight tours, or other similar actions.
16
16
  *
17
17
  */
@@ -11,7 +11,7 @@ var styles = {
11
11
  /**
12
12
  * __SpotlightShowMoreControl__
13
13
  *
14
- * SpotlightShowMoreControl allows the user to close the `Spotlight`.
14
+ * `SpotlightShowMoreControl` provides follow-up actions and customizations for the spotlight.
15
15
  *
16
16
  */
17
17
  export var SpotlightShowMoreControl = /*#__PURE__*/forwardRef(function (_ref, ref) {
@@ -11,15 +11,15 @@ export interface SpotlightBodyProps {
11
11
  */
12
12
  testId?: string;
13
13
  /**
14
- * Textual content is required for all spotlights. It should be brief and direct
15
- * to quickly elaborate on the intent.
14
+ * Textual content is required for all spotlights.
15
+ * It should be brief and direct to quickly elaborate on the value.
16
16
  */
17
17
  children: ReactNode;
18
18
  }
19
19
  /**
20
20
  * __SpotlightBody__
21
21
  *
22
- * `SpotlightBody` is required in a `Spotlight`. The content should be brief and direct to elaborate on the intent.
22
+ * `SpotlightBody` is required in a spotlight. The content should be brief and direct to elaborate on the intent.
23
23
  *
24
24
  */
25
25
  export declare const SpotlightBody: React.ForwardRefExoticComponent<React.PropsWithoutRef<SpotlightBodyProps> & React.RefAttributes<HTMLDivElement>>;
@@ -11,7 +11,7 @@ export interface SpotlightCardProps {
11
11
  */
12
12
  testId?: string;
13
13
  /**
14
- * Elements to be rendered inside the spotlight.
14
+ * Elements to be rendered inside the `SpotlightCard`.
15
15
  */
16
16
  children?: ReactNode;
17
17
  }
@@ -15,7 +15,7 @@ export interface SpotlightDismissControlProps {
15
15
  *
16
16
  * Specifies whether the dismiss button should be focused when the spotlight is rendered.
17
17
  * For spotlights that are triggered by user-action, this should be `true`. In the event that
18
- * a spotlight is rendered on pageload, without explicit user interaction, this should be `false`.
18
+ * a spotlight is rendered on page load, without explicit user interaction, this should be `false`.
19
19
  */
20
20
  autoFocus?: boolean;
21
21
  }
@@ -11,7 +11,7 @@ export interface SpotlightHeadlineProps {
11
11
  */
12
12
  testId?: string;
13
13
  /**
14
- * A brief and direct title to quickly hook the user on the intent.
14
+ * A brief and direct title to clearly communicate the intent.
15
15
  */
16
16
  children: ReactNode;
17
17
  }
@@ -11,8 +11,7 @@ export interface SpotlightMediaProps {
11
11
  */
12
12
  testId?: string;
13
13
  /**
14
- * Textual content is required for all spotlights. It should be brief and direct
15
- * to quickly elaborate on the intent.
14
+ * Media to be displayed. This can be an image, video, gif that helps communicate spotlight intent.
16
15
  */
17
16
  children: ReactNode;
18
17
  }
@@ -11,15 +11,54 @@ interface BasePopoverContentProps {
11
11
  * serving as a hook for automated tests
12
12
  */
13
13
  testId?: string;
14
+ /**
15
+ * The position in relation to the target the content should be shown at.
16
+ */
14
17
  placement: Placement;
18
+ /**
19
+ * Controls whether or not `PopoverContent` is visible. Defaults to `true`.
20
+ */
15
21
  isVisible?: boolean;
22
+ /**
23
+ * Controls whether the 'dismiss' action is invoked when the user clicks outside the content. Defaults to `true`.
24
+ */
16
25
  shouldDismissOnClickOutside?: boolean;
26
+ /**
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
+ */
17
35
  dismiss: (event: DismissEvent) => void;
36
+ /**
37
+ * Invoked when the user clicks `SpotlightSecondaryAction`. If an `onClick` handler is provided to `SpotlightSecondaryAction`
38
+ * then that takes precedence, and `back` will be ignored.
39
+ */
18
40
  back?: (event: BackEvent) => void;
41
+ /**
42
+ * The content to be rendered in `PopoverContent`. This is intended to be a `SpotlightCard`.
43
+ */
19
44
  children: ReactNode;
20
45
  }
21
46
  export type PopoverContentProps = BasePopoverContentProps & ({
47
+ /**
48
+ * Invoked when the user clicks `SpotlightPrimaryAction` in a tour.
49
+ * If an `onClick` handler is provided to `SpotlightPrimaryAction` then that takes precedence,
50
+ * and `next` will be ignored.
51
+ *
52
+ * If `next` is passed to `PopoverContent`, then `done` cannot be passed. This will result in a type error.
53
+ */
22
54
  next: (event: NextEvent) => void;
55
+ /**
56
+ * Invoked when the user clicks `SpotlightPrimaryAction`.
57
+ * If an `onClick` handler is provided to SpotlightPrimaryAction then that takes precedence,
58
+ * and `done` will be ignored.
59
+ *
60
+ * If `done` is passed to PopoverContent, then `next` cannot be passed. This will result in a type error.
61
+ */
23
62
  done?: never;
24
63
  } | {
25
64
  done: (event: DoneEvent) => void;
@@ -3,12 +3,17 @@
3
3
  * @jsx jsx
4
4
  */
5
5
  import { type ReactNode } from 'react';
6
+ interface PopoverProviderProps {
7
+ /**
8
+ * The to be rendered in `PopoverProvider`. This is intended to be `PopoverContent`, and `PopoverTarget`.
9
+ */
10
+ children: ReactNode;
11
+ }
6
12
  /**
7
13
  * __Popover provider__
8
14
  *
9
15
  * A popover provider provides necesary context for the `PopoverContent` and `PopoverTarget` components.
10
16
  *
11
17
  */
12
- export declare const PopoverProvider: ({ children }: {
13
- children: ReactNode;
14
- }) => JSX.Element;
18
+ export declare const PopoverProvider: ({ children }: PopoverProviderProps) => JSX.Element;
19
+ export {};
@@ -3,11 +3,16 @@
3
3
  * @jsx jsx
4
4
  */
5
5
  import { type ReactNode } from 'react';
6
+ interface PopoverTargetProps {
7
+ /**
8
+ * The content to be rendered in `PopoverTarget`. This is intended to be the element you want to point the spotlight at.
9
+ */
10
+ children: ReactNode;
11
+ }
6
12
  /**
7
13
  * __Target__
8
14
  *
9
15
  * A target is the element that the popover content will be positioned in relation to.
10
16
  */
11
- export declare const PopoverTarget: ({ children }: {
12
- children: ReactNode;
13
- }) => JSX.Element;
17
+ export declare const PopoverTarget: ({ children }: PopoverTargetProps) => JSX.Element;
18
+ export {};
@@ -20,7 +20,7 @@ export interface SpotlightPrimaryActionProps {
20
20
  */
21
21
  onClick?: PressableProps['onClick'];
22
22
  /**
23
- * An accessible label to read out in the event that the displayed text does not provide anough context.
23
+ * An accessible label to read out in the event that the displayed text does not provide enough context.
24
24
  */
25
25
  'aria-label'?: string;
26
26
  }
@@ -20,14 +20,14 @@ export interface SpotlightSecondaryActionProps {
20
20
  */
21
21
  onClick?: PressableProps['onClick'];
22
22
  /**
23
- * An accessible label to read out in the event that the displayed text does not provide anough context.
23
+ * An accessible label to read out in the event that the displayed text does not provide enough context.
24
24
  */
25
25
  'aria-label'?: string;
26
26
  }
27
27
  /**
28
28
  * __Spotlight secondary action__
29
29
  *
30
- * `SpotlightSecondaryAction` is not required for all `Spotlight` components. It should supplement the SpotlightPrimaryAction.
30
+ * `SpotlightSecondaryAction` is not required for all spotlight components. It should supplement the `SpotlightPrimaryAction`.
31
31
  * It is intended to be used to go back to the previous step in multi step spotlight tours, or other similar actions.
32
32
  *
33
33
  */
@@ -14,7 +14,7 @@ export interface SpotlightShowMoreControlProps {
14
14
  /**
15
15
  * __SpotlightShowMoreControl__
16
16
  *
17
- * SpotlightShowMoreControl allows the user to close the `Spotlight`.
17
+ * `SpotlightShowMoreControl` provides follow-up actions and customizations for the spotlight.
18
18
  *
19
19
  */
20
20
  export declare const SpotlightShowMoreControl: React.ForwardRefExoticComponent<React.PropsWithoutRef<SpotlightShowMoreControlProps> & React.RefAttributes<HTMLButtonElement>>;
@@ -11,15 +11,15 @@ export interface SpotlightBodyProps {
11
11
  */
12
12
  testId?: string;
13
13
  /**
14
- * Textual content is required for all spotlights. It should be brief and direct
15
- * to quickly elaborate on the intent.
14
+ * Textual content is required for all spotlights.
15
+ * It should be brief and direct to quickly elaborate on the value.
16
16
  */
17
17
  children: ReactNode;
18
18
  }
19
19
  /**
20
20
  * __SpotlightBody__
21
21
  *
22
- * `SpotlightBody` is required in a `Spotlight`. The content should be brief and direct to elaborate on the intent.
22
+ * `SpotlightBody` is required in a spotlight. The content should be brief and direct to elaborate on the intent.
23
23
  *
24
24
  */
25
25
  export declare const SpotlightBody: React.ForwardRefExoticComponent<React.PropsWithoutRef<SpotlightBodyProps> & React.RefAttributes<HTMLDivElement>>;
@@ -11,7 +11,7 @@ export interface SpotlightCardProps {
11
11
  */
12
12
  testId?: string;
13
13
  /**
14
- * Elements to be rendered inside the spotlight.
14
+ * Elements to be rendered inside the `SpotlightCard`.
15
15
  */
16
16
  children?: ReactNode;
17
17
  }
@@ -15,7 +15,7 @@ export interface SpotlightDismissControlProps {
15
15
  *
16
16
  * Specifies whether the dismiss button should be focused when the spotlight is rendered.
17
17
  * For spotlights that are triggered by user-action, this should be `true`. In the event that
18
- * a spotlight is rendered on pageload, without explicit user interaction, this should be `false`.
18
+ * a spotlight is rendered on page load, without explicit user interaction, this should be `false`.
19
19
  */
20
20
  autoFocus?: boolean;
21
21
  }
@@ -11,7 +11,7 @@ export interface SpotlightHeadlineProps {
11
11
  */
12
12
  testId?: string;
13
13
  /**
14
- * A brief and direct title to quickly hook the user on the intent.
14
+ * A brief and direct title to clearly communicate the intent.
15
15
  */
16
16
  children: ReactNode;
17
17
  }
@@ -11,8 +11,7 @@ export interface SpotlightMediaProps {
11
11
  */
12
12
  testId?: string;
13
13
  /**
14
- * Textual content is required for all spotlights. It should be brief and direct
15
- * to quickly elaborate on the intent.
14
+ * Media to be displayed. This can be an image, video, gif that helps communicate spotlight intent.
16
15
  */
17
16
  children: ReactNode;
18
17
  }
@@ -11,15 +11,54 @@ interface BasePopoverContentProps {
11
11
  * serving as a hook for automated tests
12
12
  */
13
13
  testId?: string;
14
+ /**
15
+ * The position in relation to the target the content should be shown at.
16
+ */
14
17
  placement: Placement;
18
+ /**
19
+ * Controls whether or not `PopoverContent` is visible. Defaults to `true`.
20
+ */
15
21
  isVisible?: boolean;
22
+ /**
23
+ * Controls whether the 'dismiss' action is invoked when the user clicks outside the content. Defaults to `true`.
24
+ */
16
25
  shouldDismissOnClickOutside?: boolean;
26
+ /**
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
+ */
17
35
  dismiss: (event: DismissEvent) => void;
36
+ /**
37
+ * Invoked when the user clicks `SpotlightSecondaryAction`. If an `onClick` handler is provided to `SpotlightSecondaryAction`
38
+ * then that takes precedence, and `back` will be ignored.
39
+ */
18
40
  back?: (event: BackEvent) => void;
41
+ /**
42
+ * The content to be rendered in `PopoverContent`. This is intended to be a `SpotlightCard`.
43
+ */
19
44
  children: ReactNode;
20
45
  }
21
46
  export type PopoverContentProps = BasePopoverContentProps & ({
47
+ /**
48
+ * Invoked when the user clicks `SpotlightPrimaryAction` in a tour.
49
+ * If an `onClick` handler is provided to `SpotlightPrimaryAction` then that takes precedence,
50
+ * and `next` will be ignored.
51
+ *
52
+ * If `next` is passed to `PopoverContent`, then `done` cannot be passed. This will result in a type error.
53
+ */
22
54
  next: (event: NextEvent) => void;
55
+ /**
56
+ * Invoked when the user clicks `SpotlightPrimaryAction`.
57
+ * If an `onClick` handler is provided to SpotlightPrimaryAction then that takes precedence,
58
+ * and `done` will be ignored.
59
+ *
60
+ * If `done` is passed to PopoverContent, then `next` cannot be passed. This will result in a type error.
61
+ */
23
62
  done?: never;
24
63
  } | {
25
64
  done: (event: DoneEvent) => void;
@@ -3,12 +3,17 @@
3
3
  * @jsx jsx
4
4
  */
5
5
  import { type ReactNode } from 'react';
6
+ interface PopoverProviderProps {
7
+ /**
8
+ * The to be rendered in `PopoverProvider`. This is intended to be `PopoverContent`, and `PopoverTarget`.
9
+ */
10
+ children: ReactNode;
11
+ }
6
12
  /**
7
13
  * __Popover provider__
8
14
  *
9
15
  * A popover provider provides necesary context for the `PopoverContent` and `PopoverTarget` components.
10
16
  *
11
17
  */
12
- export declare const PopoverProvider: ({ children }: {
13
- children: ReactNode;
14
- }) => JSX.Element;
18
+ export declare const PopoverProvider: ({ children }: PopoverProviderProps) => JSX.Element;
19
+ export {};
@@ -3,11 +3,16 @@
3
3
  * @jsx jsx
4
4
  */
5
5
  import { type ReactNode } from 'react';
6
+ interface PopoverTargetProps {
7
+ /**
8
+ * The content to be rendered in `PopoverTarget`. This is intended to be the element you want to point the spotlight at.
9
+ */
10
+ children: ReactNode;
11
+ }
6
12
  /**
7
13
  * __Target__
8
14
  *
9
15
  * A target is the element that the popover content will be positioned in relation to.
10
16
  */
11
- export declare const PopoverTarget: ({ children }: {
12
- children: ReactNode;
13
- }) => JSX.Element;
17
+ export declare const PopoverTarget: ({ children }: PopoverTargetProps) => JSX.Element;
18
+ export {};
@@ -20,7 +20,7 @@ export interface SpotlightPrimaryActionProps {
20
20
  */
21
21
  onClick?: PressableProps['onClick'];
22
22
  /**
23
- * An accessible label to read out in the event that the displayed text does not provide anough context.
23
+ * An accessible label to read out in the event that the displayed text does not provide enough context.
24
24
  */
25
25
  'aria-label'?: string;
26
26
  }
@@ -20,14 +20,14 @@ export interface SpotlightSecondaryActionProps {
20
20
  */
21
21
  onClick?: PressableProps['onClick'];
22
22
  /**
23
- * An accessible label to read out in the event that the displayed text does not provide anough context.
23
+ * An accessible label to read out in the event that the displayed text does not provide enough context.
24
24
  */
25
25
  'aria-label'?: string;
26
26
  }
27
27
  /**
28
28
  * __Spotlight secondary action__
29
29
  *
30
- * `SpotlightSecondaryAction` is not required for all `Spotlight` components. It should supplement the SpotlightPrimaryAction.
30
+ * `SpotlightSecondaryAction` is not required for all spotlight components. It should supplement the `SpotlightPrimaryAction`.
31
31
  * It is intended to be used to go back to the previous step in multi step spotlight tours, or other similar actions.
32
32
  *
33
33
  */
@@ -14,7 +14,7 @@ export interface SpotlightShowMoreControlProps {
14
14
  /**
15
15
  * __SpotlightShowMoreControl__
16
16
  *
17
- * SpotlightShowMoreControl allows the user to close the `Spotlight`.
17
+ * `SpotlightShowMoreControl` provides follow-up actions and customizations for the spotlight.
18
18
  *
19
19
  */
20
20
  export declare const SpotlightShowMoreControl: React.ForwardRefExoticComponent<React.PropsWithoutRef<SpotlightShowMoreControlProps> & React.RefAttributes<HTMLButtonElement>>;
package/package.json CHANGED
@@ -1,11 +1,17 @@
1
1
  {
2
2
  "name": "@atlaskit/spotlight",
3
- "version": "0.7.0",
4
- "description": "A spotlight introduces users to various points of interest across Atlassian through focused messages or multi-step tours.",
3
+ "version": "0.7.2",
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",
7
7
  "atlassian": {
8
- "team": "Design System Team"
8
+ "team": "Design System Team",
9
+ "website": {
10
+ "category": "Messaging",
11
+ "status": {
12
+ "type": "beta"
13
+ }
14
+ }
9
15
  },
10
16
  "homepage": "https://atlassian.design/components/spotlight/",
11
17
  "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
@@ -34,7 +40,7 @@
34
40
  "@atlaskit/icon": "^28.5.0",
35
41
  "@atlaskit/image": "^3.0.0",
36
42
  "@atlaskit/popper": "^7.1.0",
37
- "@atlaskit/primitives": "^16.0.0",
43
+ "@atlaskit/primitives": "^16.1.0",
38
44
  "@atlaskit/tokens": "^7.0.0",
39
45
  "@atlaskit/visually-hidden": "^3.0.0",
40
46
  "@babel/runtime": "^7.0.0",