@atlaskit/onboarding 14.6.2 → 15.0.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.
Files changed (71) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/cjs/components/spotlight-manager.js +4 -1
  3. package/dist/cjs/components/spotlight-transition.js +1 -0
  4. package/dist/cjs/components/theme.js +4 -3
  5. package/dist/cjs/styled/dialog.js +2 -0
  6. package/dist/cjs/styled/modal.js +4 -0
  7. package/dist/cjs/styled/target.compiled.css +1 -1
  8. package/dist/cjs/styled/target.js +4 -2
  9. package/dist/es2019/components/index.js +15 -1
  10. package/dist/es2019/components/spotlight-manager.js +3 -1
  11. package/dist/es2019/components/spotlight-transition.js +1 -0
  12. package/dist/es2019/components/theme.js +4 -3
  13. package/dist/es2019/styled/dialog.js +2 -0
  14. package/dist/es2019/styled/modal.js +4 -0
  15. package/dist/es2019/styled/target.compiled.css +1 -1
  16. package/dist/es2019/styled/target.js +4 -2
  17. package/dist/esm/components/index.js +15 -1
  18. package/dist/esm/components/spotlight-manager.js +3 -1
  19. package/dist/esm/components/spotlight-transition.js +1 -0
  20. package/dist/esm/components/theme.js +4 -3
  21. package/dist/esm/styled/dialog.js +2 -0
  22. package/dist/esm/styled/modal.js +4 -0
  23. package/dist/esm/styled/target.compiled.css +1 -1
  24. package/dist/esm/styled/target.js +4 -2
  25. package/modal/package.json +1 -8
  26. package/modal-transition/package.json +1 -8
  27. package/package.json +16 -42
  28. package/spotlight/package.json +1 -8
  29. package/spotlight-card/package.json +1 -8
  30. package/spotlight-manager/package.json +1 -8
  31. package/spotlight-target/package.json +1 -8
  32. package/spotlight-transition/package.json +1 -8
  33. package/target/package.json +1 -8
  34. package/theme/package.json +1 -8
  35. package/types/package.json +1 -8
  36. package/use-spotlight/package.json +1 -8
  37. package/dist/types-ts4.5/components/clone.d.ts +0 -54
  38. package/dist/types-ts4.5/components/index.d.ts +0 -10
  39. package/dist/types-ts4.5/components/modal-transition.d.ts +0 -17
  40. package/dist/types-ts4.5/components/modal.d.ts +0 -54
  41. package/dist/types-ts4.5/components/node-resolver-spotlight-inner.d.ts +0 -18
  42. package/dist/types-ts4.5/components/node-resolver-spotlight-target.d.ts +0 -27
  43. package/dist/types-ts4.5/components/spotlight-card.d.ts +0 -14
  44. package/dist/types-ts4.5/components/spotlight-dialog.d.ts +0 -86
  45. package/dist/types-ts4.5/components/spotlight-inner.d.ts +0 -58
  46. package/dist/types-ts4.5/components/spotlight-manager.d.ts +0 -83
  47. package/dist/types-ts4.5/components/spotlight-target.d.ts +0 -50
  48. package/dist/types-ts4.5/components/spotlight-transition.d.ts +0 -45
  49. package/dist/types-ts4.5/components/spotlight.d.ts +0 -15
  50. package/dist/types-ts4.5/components/theme.d.ts +0 -10
  51. package/dist/types-ts4.5/components/use-spotlight.d.ts +0 -9
  52. package/dist/types-ts4.5/components/value-changed.d.ts +0 -11
  53. package/dist/types-ts4.5/entry-points/modal-transition.d.ts +0 -1
  54. package/dist/types-ts4.5/entry-points/modal.d.ts +0 -1
  55. package/dist/types-ts4.5/entry-points/spotlight-card.d.ts +0 -1
  56. package/dist/types-ts4.5/entry-points/spotlight-manager.d.ts +0 -3
  57. package/dist/types-ts4.5/entry-points/spotlight-target.d.ts +0 -1
  58. package/dist/types-ts4.5/entry-points/spotlight-transition.d.ts +0 -2
  59. package/dist/types-ts4.5/entry-points/spotlight.d.ts +0 -1
  60. package/dist/types-ts4.5/entry-points/target.d.ts +0 -1
  61. package/dist/types-ts4.5/entry-points/theme.d.ts +0 -1
  62. package/dist/types-ts4.5/entry-points/types.d.ts +0 -1
  63. package/dist/types-ts4.5/entry-points/use-spotlight.d.ts +0 -1
  64. package/dist/types-ts4.5/index.d.ts +0 -2
  65. package/dist/types-ts4.5/styled/blanket.d.ts +0 -19
  66. package/dist/types-ts4.5/styled/dialog.d.ts +0 -33
  67. package/dist/types-ts4.5/styled/modal.d.ts +0 -51
  68. package/dist/types-ts4.5/styled/target.d.ts +0 -45
  69. package/dist/types-ts4.5/types.d.ts +0 -173
  70. package/dist/types-ts4.5/utils/use-element-box.d.ts +0 -20
  71. package/dist/types-ts4.5/utils/use-element-observer.d.ts +0 -16
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import { type SpotlightProps } from '../types';
3
- /**
4
- * __Spotlight__
5
- *
6
- * An onboarding spotlight introduces new features to users through focused messages or multi-step tours.
7
- *
8
- * - [Examples](https://atlassian.design/components/onboarding/examples)
9
- * - [Code](https://atlassian.design/components/onboarding/code)
10
- * - [Usage](https://atlassian.design/components/onboarding/usage)
11
- *
12
- * @deprecated Use `@atlaskit/spotlight` instead.
13
- */
14
- declare const Spotlight: ({ actions, actionsBeforeElement, children, dialogPlacement, dialogWidth, footer, header, heading, headingAfterElement, image, label, pulse, scrollPositionBlock, shouldWatchTarget, target, targetBgColor, targetNode, targetOnClick, targetRadius, targetReplacement, testId, titleId, ...rest }: SpotlightProps) => React.JSX.Element;
15
- export default Spotlight;
@@ -1,10 +0,0 @@
1
- /**
2
- * @deprecated
3
- * Custom button themes are deprecated and will be removed in the future.
4
- */
5
- export declare const spotlightButtonTheme: (current: any, themeProps: Record<string, any>) => any;
6
- /**
7
- * @deprecated
8
- * Custom button themes are deprecated and will be removed in the future.
9
- */
10
- export declare const modalButtonTheme: (current: any, themeProps: Record<string, any>) => any;
@@ -1,9 +0,0 @@
1
- /**
2
- * Use spotlight hook returns information about available spotlight targets.
3
- *
4
- * @deprecated Use `@atlaskit/spotlight` instead.
5
- */
6
- export default function useSpotlight(): {
7
- isTargetRendered: (target: string) => boolean;
8
- checkVisibility: (target: string) => (options?: CheckVisibilityOptions) => boolean;
9
- };
@@ -1,11 +0,0 @@
1
- import React, { type ReactNode } from 'react';
2
- interface ValueChangedProps {
3
- value: any;
4
- onChange: Function;
5
- children: ReactNode;
6
- }
7
- export default class ValueChanged extends React.Component<ValueChangedProps> {
8
- componentDidUpdate(prevProps: ValueChangedProps): void;
9
- render(): React.ReactNode;
10
- }
11
- export {};
@@ -1 +0,0 @@
1
- export { default } from '../components/modal-transition';
@@ -1 +0,0 @@
1
- export { default } from '../components/modal';
@@ -1 +0,0 @@
1
- export { default } from '../components/spotlight-card';
@@ -1,3 +0,0 @@
1
- export { SpotlightConsumer, SpotlightContext, TargetConsumer, } from '../components/spotlight-manager';
2
- export type { GetTargetRef, TargetRef } from '../components/spotlight-manager';
3
- export { default } from '../components/spotlight-manager';
@@ -1 +0,0 @@
1
- export { default } from '../components/spotlight-target';
@@ -1,2 +0,0 @@
1
- export { SpotlightTransitionConsumer } from '../components/spotlight-transition';
2
- export { default } from '../components/spotlight-transition';
@@ -1 +0,0 @@
1
- export { default } from '../components/spotlight';
@@ -1 +0,0 @@
1
- export { Pulse, TargetInner, TargetOverlay } from '../styled/target';
@@ -1 +0,0 @@
1
- export { modalButtonTheme, spotlightButtonTheme } from '../components/theme';
@@ -1 +0,0 @@
1
- export type { Actions, ScrollLogicalPosition, SpotlightCardProps, SpotlightProps } from '../types';
@@ -1 +0,0 @@
1
- export { default } from '../components/use-spotlight';
@@ -1,2 +0,0 @@
1
- export { Modal, Spotlight, SpotlightCard, SpotlightManager, SpotlightTarget, SpotlightTransition, modalButtonTheme, spotlightButtonTheme, useSpotlight, ModalTransition, } from './components';
2
- export { Pulse as SpotlightPulse } from './styled/target';
@@ -1,19 +0,0 @@
1
- type BlanketProps = {
2
- isTinted?: boolean;
3
- style?: React.CSSProperties;
4
- onBlanketClicked?: () => void;
5
- className?: string;
6
- };
7
- /**
8
- * __Blanket__
9
- *
10
- * A replacement for `@atlaskit/blanket`.
11
- *
12
- * We use this for spotlights instead of `@atlaskit/blanket`
13
- * because spotlights must sit on top of other layered elements,
14
- * such as modals, which have their own blankets.
15
- *
16
- * @internal
17
- */
18
- declare const Blanket: React.ForwardRefExoticComponent<React.PropsWithoutRef<BlanketProps> & React.RefAttributes<HTMLDivElement>>;
19
- export default Blanket;
@@ -1,33 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import { type ImgHTMLAttributes, type ReactNode } from 'react';
6
- /**
7
- * __Dialog image__
8
- *
9
- * An optional header image in spotlight dialogs.
10
- *
11
- * @internal
12
- */
13
- export declare const DialogImage: ({ alt, ...props }: ImgHTMLAttributes<HTMLImageElement>) => JSX.Element;
14
- /**
15
- * __Dialog action item container__
16
- *
17
- * Flex wrapper around dialog action items.
18
- *
19
- * @internal
20
- */
21
- export declare const DialogActionItemContainer: ({ children }: {
22
- children: ReactNode;
23
- }) => JSX.Element;
24
- /**
25
- * __Dialog action item__
26
- *
27
- * Action items shown inside of the dialog.
28
- *
29
- * @internal
30
- */
31
- export declare const DialogActionItem: ({ children }: {
32
- children: ReactNode;
33
- }) => JSX.Element;
@@ -1,51 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import { type ReactNode } from 'react';
6
- type ModalImageProps = {
7
- alt: string;
8
- src?: string;
9
- };
10
- type ModalActionContainerProps = {
11
- shouldReverseButtonOrder: boolean;
12
- children: ReactNode;
13
- };
14
- /**
15
- * __Modal body__
16
- *
17
- * @internal
18
- */
19
- export declare const ModalBody: ({ children }: {
20
- children: ReactNode;
21
- }) => JSX.Element;
22
- /**
23
- * __Modal heading__
24
- *
25
- * @internal
26
- */
27
- export declare const ModalHeading: ({ children, id, }: {
28
- children: ReactNode;
29
- id: string;
30
- }) => JSX.Element;
31
- /**
32
- * __Modal image__
33
- *
34
- * @internal
35
- */
36
- export declare const ModalImage: ({ alt, src }: ModalImageProps) => JSX.Element;
37
- /**
38
- * __Modal action container__
39
- *
40
- * @internal
41
- */
42
- export declare const ModalActionContainer: ({ children, shouldReverseButtonOrder, }: ModalActionContainerProps) => JSX.Element;
43
- /**
44
- * __Modal action item__
45
- *
46
- * @internal
47
- */
48
- export declare const ModalActionItem: ({ children }: {
49
- children: ReactNode;
50
- }) => JSX.Element;
51
- export {};
@@ -1,45 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import { type HTMLAttributes, type ReactNode } from 'react';
6
- type BaseProps = React.HTMLAttributes<HTMLDivElement> & {
7
- bgColor?: string;
8
- children?: ReactNode;
9
- className?: string;
10
- radius?: number | string;
11
- testId?: string;
12
- };
13
- type TargetProps = Omit<BaseProps, 'css'> & {
14
- pulse?: boolean;
15
- };
16
- /**
17
- * __Target inner__
18
- *
19
- * Used to apply spotlight border and pulse to spotlight targets.
20
- *
21
- * @internal
22
- */
23
- export declare const TargetInner: ({ bgColor, children, className, pulse, radius, testId, ...props }: TargetProps) => JSX.Element;
24
- /**
25
- * __Target overlay__
26
- *
27
- * Overlays a spotlight target, allowing for custom click events that are intended
28
- * only for onboarding.
29
- *
30
- * @internal
31
- */
32
- export declare const TargetOverlay: ({ onClick, ...props }: HTMLAttributes<HTMLDivElement>) => JSX.Element;
33
- /**
34
- * __Spotlight pulse__
35
- *
36
- * A spotlight pulse draws attention to a new feature.
37
- *
38
- * - [Examples](https://atlassian.design/components/onboarding/examples)
39
- * - [Code](https://atlassian.design/components/onboarding/code)
40
- * - [Usage](https://atlassian.design/components/onboarding/usage)
41
- *
42
- * @deprecated Use `@atlaskit/spotlight` instead.
43
- */
44
- export declare const Pulse: ({ bgColor, children, className, radius, pulse, testId, ...props }: TargetProps) => JSX.Element;
45
- export {};
@@ -1,173 +0,0 @@
1
- import { type ComponentType, type MouseEvent, type ReactNode, type Ref } from 'react';
2
- import { type CustomThemeButtonProps } from '@atlaskit/button/types';
3
- interface Action extends Omit<CustomThemeButtonProps, 'children'> {
4
- key?: string;
5
- text?: ReactNode;
6
- }
7
- export type Actions = Action[];
8
- export type ScrollLogicalPosition = 'start' | 'center' | 'end' | 'nearest';
9
- export interface SpotlightProps {
10
- /**
11
- * Buttons to render in the footer.
12
- */
13
- actions?: Actions;
14
- /**
15
- * An optional node to be rendered beside the footer actions.
16
- */
17
- actionsBeforeElement?: ReactNode;
18
- /**
19
- * The elements rendered in the modal.
20
- */
21
- children?: ReactNode;
22
- /**
23
- * Where the dialog should appear, relative to the contents of the children.
24
- */
25
- dialogPlacement?: 'top left' | 'top center' | 'top right' | 'right top' | 'right middle' | 'right bottom' | 'bottom left' | 'bottom center' | 'bottom right' | 'left top' | 'left middle' | 'left bottom';
26
- /**
27
- * The width of the dialog in pixels. The minimum possible width is 160px and the maximum width is 600px.
28
- */
29
- dialogWidth?: number;
30
- /**
31
- * Optional element rendered below the body.
32
- */
33
- footer?: ComponentType<any>;
34
- /**
35
- * Optional element rendered above the body.
36
- */
37
- header?: ComponentType<any>;
38
- /**
39
- * Heading text rendered above the body.
40
- */
41
- heading?: string;
42
- /**
43
- * An optional element rendered to the right of the heading.
44
- */
45
- headingAfterElement?: ReactNode;
46
- /**
47
- * Path to the image.
48
- */
49
- image?: string;
50
- /**
51
- * Whether or not to display a pulse animation around the spotlighted element.
52
- */
53
- pulse?: boolean;
54
- /**
55
- * Whether the spotlight should check for changes to the spotlighted element or its position.
56
- * This prop may negatively affect performance and should be used only if layout shifts are causing the spotlight to be positioned incorrectly.
57
- */
58
- shouldWatchTarget?: boolean;
59
- /**
60
- * The name of the SpotlightTarget.
61
- */
62
- target?: string;
63
- /**
64
- * The spotlight target node.
65
- */
66
- targetNode?: HTMLElement;
67
- /**
68
- * The background color of the element being highlighted.
69
- */
70
- targetBgColor?: string;
71
- /**
72
- * Function to fire when a person clicks on the cloned target.
73
- */
74
- targetOnClick?: (eventData: {
75
- event: MouseEvent<HTMLElement>;
76
- target?: string;
77
- }) => void;
78
- /**
79
- * The border radius of the element being highlighted.
80
- */
81
- targetRadius?: number | string;
82
- /**
83
- * Alternative element to render than the wrapped target.
84
- */
85
- targetReplacement?: ComponentType<any>;
86
- /**
87
- * This prop is a unique string that appears as an attribute `data-testid` in the rendered HTML output serving as a hook for automated tests.
88
- * Defaults to `"spotlight"`.
89
- * As this component is composed of multiple components we use this `testId` as a prefix:
90
- * - `"${testId}--dialog"` to identify the spotlight dialog
91
- * - `"${testId}--target"` to identify the spotlight target clone
92
- */
93
- testId?: string;
94
- /**
95
- * Used set the 'block' attribute on scrollIntoView, which determines the vertical alignment of the target node to the nearest scrollable ancestor.
96
- */
97
- scrollPositionBlock?: ScrollLogicalPosition;
98
- /**
99
- * Refers to an `aria-label` attribute. Sets an accessible name for the spotlight dialog wrapper to announce it to users of assistive technology.
100
- * Usage of either this, or the `titleId` prop is strongly recommended to improve accessibility.
101
- */
102
- label?: string;
103
- /**
104
- * Refers to a value of an `aria-labelledby` attribute. References an element to define accessible name for the spotlight dialog.
105
- * Usage of either this, or the `label` prop is strongly recommended to improve accessibility.
106
- */
107
- titleId?: string;
108
- }
109
- export interface SpotlightCardProps {
110
- /**
111
- * Buttons to render in the footer.
112
- */
113
- actions?: Actions;
114
- /**
115
- * An optional element rendered to the left of the footer actions.
116
- */
117
- actionsBeforeElement?: ReactNode;
118
- /**
119
- * The content of the card.
120
- */
121
- children?: ReactNode;
122
- /**
123
- * The container elements rendered by the component.
124
- */
125
- components?: {
126
- Header?: ComponentType<any>;
127
- Footer?: ComponentType<any>;
128
- };
129
- /**
130
- * The heading to be rendered above the body content.
131
- */
132
- heading?: ReactNode;
133
- /**
134
- * Specifies the heading level in the document structure.
135
- * If not specified, level 4 will be applied by default.
136
- */
137
- headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
138
- /**
139
- * An optional element rendered to the right of the heading, usually used to number steps in a multi-step flow.
140
- */
141
- headingAfterElement?: ReactNode;
142
- /**
143
- * The image src to render above the heading.
144
- */
145
- image?: string | ReactNode;
146
- /**
147
- * Removes elevation styles if set.
148
- */
149
- isFlat?: boolean;
150
- /**
151
- * Specifies the width of the card component. Accepts either a number or the string '100%'.
152
- * When a number is provided, the width is set in pixels. When '100%' is provided, the width
153
- * is set to occupy 100% of the parent container's width. Regardless of whether `width` is set,
154
- * the width is constrained to a minimum width of 160px and a maximum width of 600px.
155
- */
156
- width?: number | '100%';
157
- /**
158
- * @deprecated
159
- * Use `ref` instead.
160
- */
161
- innerRef?: Ref<HTMLDivElement> | null;
162
- /**
163
- * A `testId` prop is provided for specified elements,
164
- * which is a unique string that appears as a data attribute `data-testid` in the rendered code,
165
- * serving as a hook for automated tests.
166
- */
167
- testId?: string;
168
- /**
169
- * The ID of heading.
170
- */
171
- headingId?: string;
172
- }
173
- export {};
@@ -1,20 +0,0 @@
1
- export interface ElementBoundingBox {
2
- height: number;
3
- left: number;
4
- top: number;
5
- width: number;
6
- }
7
- type ResizeUpdateMethod = 'polling' | 'resizeListener';
8
- /**
9
- * __Element box__
10
- *
11
- * Allows consumption of `userElementBox` hook through render props.
12
- *
13
- * @internal
14
- */
15
- export declare const ElementBox: (props: {
16
- element: HTMLElement;
17
- children: (box: ElementBoundingBox) => any;
18
- resizeUpdateMethod?: ResizeUpdateMethod;
19
- }) => any;
20
- export {};
@@ -1,16 +0,0 @@
1
- /**
2
- * A hook that watches for changes to a node and forces a re-render when it changes.
3
- *
4
- * @param element The node to watch for changes.
5
- * @param opts Options for the hook.
6
- * @param [opts.disableWatch=false] Whether to watch for changes or not.
7
- * @param [opts.onChange] A callback that is called when the node changes.
8
- *
9
- * @returns A version number that is incremented when the node changes to force a re-render.
10
- *
11
- * @internal
12
- */
13
- export declare function useElementObserver(element: Node, opts?: {
14
- disableWatch?: boolean;
15
- onChange?: (version: number) => void;
16
- }): number;