@atlaskit/onboarding 10.5.3 → 10.6.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 +17 -0
- package/dist/cjs/components/clone.js +1 -0
- package/dist/cjs/components/modal.js +8 -8
- package/dist/cjs/components/spotlight-card.js +18 -18
- package/dist/cjs/components/spotlight-dialog.js +1 -1
- package/dist/cjs/styled/blanket.js +3 -3
- package/dist/cjs/styled/dialog.js +7 -7
- package/dist/cjs/styled/modal.js +14 -14
- package/dist/cjs/styled/target.js +9 -9
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/clone.js +1 -0
- package/dist/es2019/components/modal.js +1 -1
- package/dist/es2019/components/spotlight-card.js +1 -1
- package/dist/es2019/components/spotlight-dialog.js +1 -1
- package/dist/es2019/styled/blanket.js +1 -1
- package/dist/es2019/styled/dialog.js +1 -1
- package/dist/es2019/styled/modal.js +1 -1
- package/dist/es2019/styled/target.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/clone.js +1 -0
- package/dist/esm/components/modal.js +1 -1
- package/dist/esm/components/spotlight-card.js +1 -1
- package/dist/esm/components/spotlight-dialog.js +1 -1
- package/dist/esm/styled/blanket.js +1 -1
- package/dist/esm/styled/dialog.js +1 -1
- package/dist/esm/styled/modal.js +1 -1
- package/dist/esm/styled/target.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/components/modal.d.ts +4 -3
- package/dist/types/components/spotlight-dialog.d.ts +1 -1
- package/dist/types-ts4.0/components/animation.d.ts +15 -0
- package/dist/types-ts4.0/components/clone.d.ts +50 -0
- package/dist/types-ts4.0/components/index.d.ts +9 -0
- package/dist/types-ts4.0/components/modal.d.ts +50 -0
- package/dist/types-ts4.0/components/spotlight-card.d.ts +81 -0
- package/dist/types-ts4.0/components/spotlight-dialog.d.ts +61 -0
- package/dist/types-ts4.0/components/spotlight-inner.d.ts +54 -0
- package/dist/types-ts4.0/components/spotlight-manager.d.ts +66 -0
- package/dist/types-ts4.0/components/spotlight-target.d.ts +22 -0
- package/dist/types-ts4.0/components/spotlight-transition.d.ts +43 -0
- package/dist/types-ts4.0/components/spotlight.d.ts +96 -0
- package/dist/types-ts4.0/components/theme.d.ts +10 -0
- package/dist/types-ts4.0/components/use-spotlight.d.ts +6 -0
- package/dist/types-ts4.0/components/value-changed.d.ts +11 -0
- package/dist/types-ts4.0/index.d.ts +14 -0
- package/dist/types-ts4.0/styled/blanket.d.ts +18 -0
- package/dist/types-ts4.0/styled/dialog.d.ts +25 -0
- package/dist/types-ts4.0/styled/modal.d.ts +36 -0
- package/dist/types-ts4.0/styled/target.d.ts +40 -0
- package/dist/types-ts4.0/types.d.ts +8 -0
- package/dist/types-ts4.0/utils/use-element-box.d.ts +23 -0
- package/package.json +14 -7
- package/report.api.md +68 -34
- package/types/package.json +8 -1
package/dist/esm/version.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { Component, ElementType, ReactNode } from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
3
4
|
import { ModalFooterProps as FooterComponentProps, ModalHeaderProps as HeaderComponentProps } from '@atlaskit/modal-dialog';
|
|
4
5
|
import { Actions } from '../types';
|
|
5
6
|
declare type ModalProps = {
|
|
@@ -42,8 +43,8 @@ declare type ModalProps = {
|
|
|
42
43
|
* - [Usage](https://atlassian.design/components/onboarding/benefits-modal/usage)
|
|
43
44
|
*/
|
|
44
45
|
export default class BenefitsModal extends Component<ModalProps> {
|
|
45
|
-
headerComponent: (props: ModalProps) => ElementType<HeaderComponentProps> | (() => JSX.Element);
|
|
46
|
-
footerComponent: (props: ModalProps) => ElementType<FooterComponentProps> | (() => JSX.Element | null);
|
|
47
|
-
render(): JSX.Element;
|
|
46
|
+
headerComponent: (props: ModalProps) => ElementType<HeaderComponentProps> | (() => jsx.JSX.Element);
|
|
47
|
+
footerComponent: (props: ModalProps) => ElementType<FooterComponentProps> | (() => jsx.JSX.Element | null);
|
|
48
|
+
render(): jsx.JSX.Element;
|
|
48
49
|
}
|
|
49
50
|
export {};
|
|
@@ -57,5 +57,5 @@ export interface SpotlightDialogProps extends WithAnalyticsEventsProps {
|
|
|
57
57
|
*/
|
|
58
58
|
testId?: string;
|
|
59
59
|
}
|
|
60
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Omit<SpotlightDialogProps, keyof WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "children" | "footer" | "header" | "image" | "
|
|
60
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Omit<SpotlightDialogProps, keyof WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "children" | "footer" | "header" | "image" | "key" | "testId" | "analyticsContext" | "actions" | "heading" | "targetNode" | "actionsBeforeElement" | "headingAfterElement" | "dialogPlacement" | "dialogWidth" | "animationStyles"> & React.RefAttributes<any>>;
|
|
61
61
|
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface FadeProps {
|
|
3
|
+
hasEntered: boolean;
|
|
4
|
+
children: (animationStyles: Record<string, any>) => ReactNode;
|
|
5
|
+
onExited?: () => any;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* __Fade__
|
|
9
|
+
*
|
|
10
|
+
* A fade in animation used for spotlights.
|
|
11
|
+
*
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export declare const Fade: ({ hasEntered, children, onExited }: FadeProps) => JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { MouseEvent } from 'react';
|
|
2
|
+
export interface CloneProps {
|
|
3
|
+
/**
|
|
4
|
+
* Whether or not to display a pulse animation around the spotlighted element
|
|
5
|
+
*/
|
|
6
|
+
pulse: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* An object containing the information used for positioning clone
|
|
9
|
+
*/
|
|
10
|
+
style: Record<string, any>;
|
|
11
|
+
/**
|
|
12
|
+
* The name of the SpotlightTarget
|
|
13
|
+
*/
|
|
14
|
+
target?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The spotlight target node
|
|
17
|
+
*/
|
|
18
|
+
targetNode: HTMLElement;
|
|
19
|
+
/**
|
|
20
|
+
* The background color of the element being highlighted
|
|
21
|
+
*/
|
|
22
|
+
targetBgColor?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Function to fire when a user clicks on the cloned target
|
|
25
|
+
*/
|
|
26
|
+
targetOnClick?: (eventData: {
|
|
27
|
+
event: MouseEvent<HTMLElement>;
|
|
28
|
+
target?: string;
|
|
29
|
+
}) => void;
|
|
30
|
+
/**
|
|
31
|
+
* The border-radius of the element being highlighted
|
|
32
|
+
*/
|
|
33
|
+
targetRadius?: number;
|
|
34
|
+
/**
|
|
35
|
+
* A `testId` prop is provided for specified elements,
|
|
36
|
+
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
37
|
+
* serving as a hook for automated tests.
|
|
38
|
+
*/
|
|
39
|
+
testId?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* __Clone__
|
|
43
|
+
*
|
|
44
|
+
* Used for cloning spotlight targets. The clone is positioned on top of the spotlight target with
|
|
45
|
+
* a pulsing animation.
|
|
46
|
+
*
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
49
|
+
declare const Clone: (props: CloneProps) => JSX.Element;
|
|
50
|
+
export default Clone;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Modal from './modal';
|
|
2
|
+
import Spotlight from './spotlight';
|
|
3
|
+
import SpotlightCard from './spotlight-card';
|
|
4
|
+
import SpotlightManager from './spotlight-manager';
|
|
5
|
+
import SpotlightTarget from './spotlight-target';
|
|
6
|
+
import SpotlightTransition from './spotlight-transition';
|
|
7
|
+
import useSpotlight from './use-spotlight';
|
|
8
|
+
export { spotlightButtonTheme, modalButtonTheme } from './theme';
|
|
9
|
+
export { Modal, Spotlight, SpotlightCard, SpotlightManager, SpotlightTarget, SpotlightTransition, useSpotlight, };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { Component, ElementType, ReactNode } from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
import { ModalFooterProps as FooterComponentProps, ModalHeaderProps as HeaderComponentProps } from '@atlaskit/modal-dialog';
|
|
5
|
+
import { Actions } from '../types';
|
|
6
|
+
declare type ModalProps = {
|
|
7
|
+
/**
|
|
8
|
+
* Buttons to render in the footer
|
|
9
|
+
*/
|
|
10
|
+
actions?: Actions;
|
|
11
|
+
/**
|
|
12
|
+
* The elements rendered in the modal
|
|
13
|
+
*/
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Path to the the your image
|
|
17
|
+
*/
|
|
18
|
+
image?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Optional element rendered above the body
|
|
21
|
+
*/
|
|
22
|
+
header?: ElementType<HeaderComponentProps>;
|
|
23
|
+
/**
|
|
24
|
+
* Optional element rendered below the body
|
|
25
|
+
*/
|
|
26
|
+
footer?: ElementType<FooterComponentProps>;
|
|
27
|
+
/**
|
|
28
|
+
* Heading text rendered above the body
|
|
29
|
+
*/
|
|
30
|
+
heading?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Boolean prop to confirm if primary button in the footer should be shown on the right
|
|
33
|
+
*/
|
|
34
|
+
experimental_shouldShowPrimaryButtonOnRight?: boolean;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* __Benefits modal__
|
|
38
|
+
*
|
|
39
|
+
* A benefits modal explains the benefits of a significant new feature or experience change.
|
|
40
|
+
*
|
|
41
|
+
* - [Examples](https://atlassian.design/components/onboarding/benefits-modal/examples)
|
|
42
|
+
* - [Code](https://atlassian.design/components/onboarding/benefits-modal/code)
|
|
43
|
+
* - [Usage](https://atlassian.design/components/onboarding/benefits-modal/usage)
|
|
44
|
+
*/
|
|
45
|
+
export default class BenefitsModal extends Component<ModalProps> {
|
|
46
|
+
headerComponent: (props: ModalProps) => ElementType<HeaderComponentProps> | (() => jsx.JSX.Element);
|
|
47
|
+
footerComponent: (props: ModalProps) => ElementType<FooterComponentProps> | (() => jsx.JSX.Element | null);
|
|
48
|
+
render(): jsx.JSX.Element;
|
|
49
|
+
}
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React, { ComponentType, ReactNode, Ref } from 'react';
|
|
3
|
+
import { ThemeProp } from '@atlaskit/theme/components';
|
|
4
|
+
import { Actions } from '../types';
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated
|
|
7
|
+
*/
|
|
8
|
+
interface CardTokens {
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated
|
|
11
|
+
*/
|
|
12
|
+
container: Record<string, string | undefined>;
|
|
13
|
+
}
|
|
14
|
+
interface SpotlightCardProps {
|
|
15
|
+
/**
|
|
16
|
+
* Buttons to render in the footer
|
|
17
|
+
*/
|
|
18
|
+
actions?: Actions;
|
|
19
|
+
/**
|
|
20
|
+
* An optional element rendered to the left of the footer actions
|
|
21
|
+
*/
|
|
22
|
+
actionsBeforeElement?: ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* The content of the card
|
|
25
|
+
*/
|
|
26
|
+
children?: ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* The container elements rendered by the component
|
|
29
|
+
*/
|
|
30
|
+
components?: {
|
|
31
|
+
Header?: ComponentType<any>;
|
|
32
|
+
Footer?: ComponentType<any>;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* The heading to be rendered above the body
|
|
36
|
+
*/
|
|
37
|
+
heading?: ReactNode;
|
|
38
|
+
/**
|
|
39
|
+
* An optional element rendered to the right of the heading
|
|
40
|
+
*/
|
|
41
|
+
headingAfterElement?: ReactNode;
|
|
42
|
+
/**
|
|
43
|
+
* The image src to render above the heading
|
|
44
|
+
*/
|
|
45
|
+
image?: string | ReactNode;
|
|
46
|
+
/**
|
|
47
|
+
* Removes elevation styles if set
|
|
48
|
+
*/
|
|
49
|
+
isFlat?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* @deprecated
|
|
52
|
+
* Theme prop is deprecated and will be removed in the future.
|
|
53
|
+
*/
|
|
54
|
+
theme?: ThemeProp<CardTokens, {}>;
|
|
55
|
+
/**
|
|
56
|
+
* Width of the card in pixels.
|
|
57
|
+
*/
|
|
58
|
+
width?: number;
|
|
59
|
+
/**
|
|
60
|
+
* @deprecated
|
|
61
|
+
* Use `ref` instead.
|
|
62
|
+
*/
|
|
63
|
+
innerRef?: Ref<HTMLDivElement> | null;
|
|
64
|
+
/**
|
|
65
|
+
* A `testId` prop is provided for specified elements,
|
|
66
|
+
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
67
|
+
* serving as a hook for automated tests.
|
|
68
|
+
*/
|
|
69
|
+
testId?: string;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* __Spotlight card__
|
|
73
|
+
*
|
|
74
|
+
* A spotlight card is for onboarding messages that need a more flexible layout, or don't require a dialog.
|
|
75
|
+
*
|
|
76
|
+
* - [Examples](https://atlassian.design/components/onboarding/spotlight-card/examples)
|
|
77
|
+
* - [Code](https://atlassian.design/components/onboarding/spotlight-card/code)
|
|
78
|
+
* - [Usage](https://atlassian.design/components/onboarding/spotlight-card/usage)
|
|
79
|
+
*/
|
|
80
|
+
declare const SpotlightCard: React.ForwardRefExoticComponent<SpotlightCardProps & React.RefAttributes<HTMLDivElement>>;
|
|
81
|
+
export default SpotlightCard;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React, { ComponentType, ReactNode } from 'react';
|
|
2
|
+
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
|
+
import { Actions } from '../types';
|
|
4
|
+
export interface SpotlightDialogProps extends WithAnalyticsEventsProps {
|
|
5
|
+
/**
|
|
6
|
+
* Buttons to render in the footer
|
|
7
|
+
*/
|
|
8
|
+
actions?: Actions;
|
|
9
|
+
/**
|
|
10
|
+
* An optional element rendered beside the footer actions
|
|
11
|
+
*/
|
|
12
|
+
actionsBeforeElement?: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* The elements rendered in the modal
|
|
15
|
+
*/
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* Where the dialog should appear, relative to the contents of the children.
|
|
19
|
+
*/
|
|
20
|
+
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';
|
|
21
|
+
/**
|
|
22
|
+
* The width of the dialog in pixels. Min 160 - Max 600
|
|
23
|
+
*/
|
|
24
|
+
dialogWidth: number;
|
|
25
|
+
/**
|
|
26
|
+
* Optional element rendered below the body
|
|
27
|
+
*/
|
|
28
|
+
footer?: ComponentType<any>;
|
|
29
|
+
/**
|
|
30
|
+
* Optional element rendered above the body
|
|
31
|
+
*/
|
|
32
|
+
header?: ComponentType<any>;
|
|
33
|
+
/**
|
|
34
|
+
* Heading text rendered above the body
|
|
35
|
+
*/
|
|
36
|
+
heading?: string;
|
|
37
|
+
/**
|
|
38
|
+
* An optional element rendered to the right of the heading
|
|
39
|
+
*/
|
|
40
|
+
headingAfterElement?: ReactNode;
|
|
41
|
+
/**
|
|
42
|
+
* Path to the image
|
|
43
|
+
*/
|
|
44
|
+
image?: string;
|
|
45
|
+
/**
|
|
46
|
+
* The spotlight target node
|
|
47
|
+
*/
|
|
48
|
+
targetNode: HTMLElement;
|
|
49
|
+
/**
|
|
50
|
+
* js object containing the animation styles to apply to component
|
|
51
|
+
*/
|
|
52
|
+
animationStyles: Object;
|
|
53
|
+
/**
|
|
54
|
+
* A `testId` prop is provided for specified elements,
|
|
55
|
+
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
56
|
+
* serving as a hook for automated tests.
|
|
57
|
+
*/
|
|
58
|
+
testId?: string;
|
|
59
|
+
}
|
|
60
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Omit<SpotlightDialogProps, keyof WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "children" | "footer" | "header" | "image" | "key" | "testId" | "analyticsContext" | "actions" | "heading" | "targetNode" | "actionsBeforeElement" | "headingAfterElement" | "dialogPlacement" | "dialogWidth" | "animationStyles"> & React.RefAttributes<any>>;
|
|
61
|
+
export default _default;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ElementBoundingBox } from '../utils/use-element-box';
|
|
3
|
+
import { SpotlightProps } from './spotlight';
|
|
4
|
+
export interface SpotlightInnerProps extends SpotlightProps {
|
|
5
|
+
/**
|
|
6
|
+
* The spotlight target dom element
|
|
7
|
+
*/
|
|
8
|
+
targetNode: HTMLElement;
|
|
9
|
+
/**
|
|
10
|
+
* Called when the component has been mounted
|
|
11
|
+
*/
|
|
12
|
+
onOpened: () => any;
|
|
13
|
+
/**
|
|
14
|
+
* Called when the component has been unmounted
|
|
15
|
+
*/
|
|
16
|
+
onClosed: () => any;
|
|
17
|
+
/**
|
|
18
|
+
* Whether or not to display a pulse animation around the spotlighted element.
|
|
19
|
+
*
|
|
20
|
+
* Same as `SpotlightProps` but required instead of optional.
|
|
21
|
+
*/
|
|
22
|
+
pulse: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* The width of the dialog in pixels. Min 160 - Max 600.
|
|
25
|
+
*
|
|
26
|
+
* Same as `SpotlightProps` but required instead of optional.
|
|
27
|
+
*/
|
|
28
|
+
dialogWidth: number;
|
|
29
|
+
}
|
|
30
|
+
interface State {
|
|
31
|
+
replacementElement: HTMLElement | null;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* __Spotlight inner__
|
|
35
|
+
*
|
|
36
|
+
* Renders the spotlight target clone and dialog.
|
|
37
|
+
*
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
declare class SpotlightInner extends React.Component<SpotlightInnerProps, State> {
|
|
41
|
+
static defaultProps: {
|
|
42
|
+
dialogWidth: number;
|
|
43
|
+
pulse: boolean;
|
|
44
|
+
};
|
|
45
|
+
state: {
|
|
46
|
+
replacementElement: null;
|
|
47
|
+
};
|
|
48
|
+
componentDidUpdate(prevProps: SpotlightInnerProps): void;
|
|
49
|
+
componentDidMount(): void;
|
|
50
|
+
componentWillUnmount(): void;
|
|
51
|
+
getTargetNodeStyle: (box: ElementBoundingBox) => {};
|
|
52
|
+
render(): JSX.Element;
|
|
53
|
+
}
|
|
54
|
+
export default SpotlightInner;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React, { ElementType, PureComponent, ReactNode } from 'react';
|
|
2
|
+
declare const TargetConsumer: React.Consumer<any>;
|
|
3
|
+
declare const SpotlightContext: React.Context<{
|
|
4
|
+
opened: () => void;
|
|
5
|
+
closed: () => void;
|
|
6
|
+
targets: {
|
|
7
|
+
[key: string]: HTMLElement | undefined;
|
|
8
|
+
};
|
|
9
|
+
}>;
|
|
10
|
+
declare const SpotlightStateConsumer: React.Consumer<{
|
|
11
|
+
opened: () => void;
|
|
12
|
+
closed: () => void;
|
|
13
|
+
targets: {
|
|
14
|
+
[key: string]: HTMLElement | undefined;
|
|
15
|
+
};
|
|
16
|
+
}>;
|
|
17
|
+
export { TargetConsumer };
|
|
18
|
+
export { SpotlightContext, SpotlightStateConsumer as SpotlightConsumer };
|
|
19
|
+
interface SpotlightManagerProps {
|
|
20
|
+
/**
|
|
21
|
+
* Boolean prop for toggling blanket transparency
|
|
22
|
+
*/
|
|
23
|
+
blanketIsTinted?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Typically the app, or a section of the app
|
|
26
|
+
*/
|
|
27
|
+
children: ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated
|
|
30
|
+
* Component is deprecated and will be removed in the future.
|
|
31
|
+
*/
|
|
32
|
+
component?: ElementType;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* __Spotlight manager__
|
|
36
|
+
*
|
|
37
|
+
* A spotlight manager manages the visibility of spotlights used to introduce new features to users through focused messages or multi-step tours.
|
|
38
|
+
*
|
|
39
|
+
* - [Examples](https://atlassian.design/components/onboarding/examples)
|
|
40
|
+
* - [Code](https://atlassian.design/components/onboarding/code)
|
|
41
|
+
* - [Usage](https://atlassian.design/components/onboarding/usage)
|
|
42
|
+
*/
|
|
43
|
+
export default class SpotlightManager extends PureComponent<SpotlightManagerProps, {
|
|
44
|
+
spotlightCount: number;
|
|
45
|
+
targets: {
|
|
46
|
+
[key: string]: HTMLElement | void;
|
|
47
|
+
};
|
|
48
|
+
}> {
|
|
49
|
+
static defaultProps: {
|
|
50
|
+
blanketIsTinted: boolean;
|
|
51
|
+
};
|
|
52
|
+
componentDidMount(): void;
|
|
53
|
+
state: {
|
|
54
|
+
spotlightCount: number;
|
|
55
|
+
targets: {};
|
|
56
|
+
};
|
|
57
|
+
targetRef: (name: string) => (element: HTMLElement | void) => void;
|
|
58
|
+
spotlightOpen: () => void;
|
|
59
|
+
spotlightClose: () => void;
|
|
60
|
+
getStateProviderValue: import("memoize-one").MemoizedFn<(this: any, targets: any) => {
|
|
61
|
+
opened: () => void;
|
|
62
|
+
closed: () => void;
|
|
63
|
+
targets: any;
|
|
64
|
+
}>;
|
|
65
|
+
render(): JSX.Element;
|
|
66
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
interface SpotlightTargetProps {
|
|
3
|
+
/**
|
|
4
|
+
* A single child
|
|
5
|
+
*/
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* The name to reference from Spotlight
|
|
9
|
+
*/
|
|
10
|
+
name: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* __Spotlight target__
|
|
14
|
+
*
|
|
15
|
+
* A spotlight target marks a component to be used for introducing new features to users through focused messages or multi-step tours.
|
|
16
|
+
*
|
|
17
|
+
* - [Examples](https://atlassian.design/components/onboarding/examples)
|
|
18
|
+
* - [Code](https://atlassian.design/components/onboarding/code)
|
|
19
|
+
* - [Usage](https://atlassian.design/components/onboarding/usage)
|
|
20
|
+
*/
|
|
21
|
+
declare const SpotlightTarget: React.FC<SpotlightTargetProps>;
|
|
22
|
+
export default SpotlightTarget;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
interface SpotlightTransitionProps {
|
|
3
|
+
/**
|
|
4
|
+
* Children that are conditionally rendered. The transition happens based
|
|
5
|
+
* on the existence or non-existence of children.
|
|
6
|
+
*/
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
interface State {
|
|
10
|
+
currentChildren: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
interface SpotlightTransitionContextModel {
|
|
13
|
+
isOpen: boolean;
|
|
14
|
+
onExited: () => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* __Spotlight transition__
|
|
18
|
+
*
|
|
19
|
+
* A spotlight transition holds onto spotlights so they can fade out when exiting the viewport.
|
|
20
|
+
*
|
|
21
|
+
* - [Examples](https://atlassian.design/components/onboarding/examples)
|
|
22
|
+
* - [Code](https://atlassian.design/components/onboarding/code)
|
|
23
|
+
* - [Usage](https://atlassian.design/components/onboarding/usage)
|
|
24
|
+
*/
|
|
25
|
+
declare class SpotlightTransition extends React.Component<SpotlightTransitionProps, State> {
|
|
26
|
+
static getDerivedStateFromProps(props: SpotlightTransitionProps, state: State): {
|
|
27
|
+
currentChildren: React.ReactNode;
|
|
28
|
+
};
|
|
29
|
+
state: {
|
|
30
|
+
currentChildren: undefined;
|
|
31
|
+
};
|
|
32
|
+
onExited: () => void;
|
|
33
|
+
render(): JSX.Element;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* __Spotlight transition consumer__
|
|
37
|
+
*
|
|
38
|
+
* Used to consume the spotlight transition context through render props.
|
|
39
|
+
*
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
42
|
+
export declare const SpotlightTransitionConsumer: React.Consumer<SpotlightTransitionContextModel>;
|
|
43
|
+
export default SpotlightTransition;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import React, { ComponentType, MouseEvent, ReactNode } from 'react';
|
|
2
|
+
import { Actions } from '../types';
|
|
3
|
+
export interface SpotlightProps {
|
|
4
|
+
/**
|
|
5
|
+
* Buttons to render in the footer
|
|
6
|
+
*/
|
|
7
|
+
actions?: Actions;
|
|
8
|
+
/**
|
|
9
|
+
* An optional node to be rendered beside the footer actions
|
|
10
|
+
*/
|
|
11
|
+
actionsBeforeElement?: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* The elements rendered in the modal
|
|
14
|
+
*/
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Where the dialog should appear, relative to the contents of the children.
|
|
18
|
+
*/
|
|
19
|
+
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';
|
|
20
|
+
/**
|
|
21
|
+
* The width of the dialog in pixels. Min 160 - Max 600
|
|
22
|
+
*/
|
|
23
|
+
dialogWidth?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Optional element rendered below the body
|
|
26
|
+
*/
|
|
27
|
+
footer?: ComponentType<any>;
|
|
28
|
+
/**
|
|
29
|
+
* Optional element rendered above the body
|
|
30
|
+
*/
|
|
31
|
+
header?: ComponentType<any>;
|
|
32
|
+
/**
|
|
33
|
+
* Heading text rendered above the body
|
|
34
|
+
*/
|
|
35
|
+
heading?: string;
|
|
36
|
+
/**
|
|
37
|
+
* An optional element rendered to the right of the heading
|
|
38
|
+
*/
|
|
39
|
+
headingAfterElement?: ReactNode;
|
|
40
|
+
/**
|
|
41
|
+
* Path to the the your image
|
|
42
|
+
*/
|
|
43
|
+
image?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Whether or not to display a pulse animation around the spotlighted element
|
|
46
|
+
*/
|
|
47
|
+
pulse?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* The name of the SpotlightTarget
|
|
50
|
+
*/
|
|
51
|
+
target?: string;
|
|
52
|
+
/**
|
|
53
|
+
* The spotlight target node
|
|
54
|
+
*/
|
|
55
|
+
targetNode?: HTMLElement;
|
|
56
|
+
/**
|
|
57
|
+
* The background color of the element being highlighted
|
|
58
|
+
*/
|
|
59
|
+
targetBgColor?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Function to fire when a user clicks on the cloned target
|
|
62
|
+
*/
|
|
63
|
+
targetOnClick?: (eventData: {
|
|
64
|
+
event: MouseEvent<HTMLElement>;
|
|
65
|
+
target?: string;
|
|
66
|
+
}) => void;
|
|
67
|
+
/**
|
|
68
|
+
* The border-radius of the element being highlighted
|
|
69
|
+
*/
|
|
70
|
+
targetRadius?: number;
|
|
71
|
+
/**
|
|
72
|
+
* Alternative element to render than the wrapped target
|
|
73
|
+
*/
|
|
74
|
+
targetReplacement?: ComponentType<any>;
|
|
75
|
+
/**
|
|
76
|
+
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.
|
|
77
|
+
As this component is composed of multiple components we use this `testId` as a prefix:
|
|
78
|
+
|
|
79
|
+
- `"${testId}--dialog"` to identify the spotlight dialog
|
|
80
|
+
- `"${testId}--target"` to identify the spotlight target clone
|
|
81
|
+
|
|
82
|
+
Defaults to `"spotlight"`.
|
|
83
|
+
*/
|
|
84
|
+
testId?: string;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* __Spotlight__
|
|
88
|
+
*
|
|
89
|
+
* An onboarding spotlight introduces new features to users through focused messages or multi-step tours.
|
|
90
|
+
*
|
|
91
|
+
* - [Examples](https://atlassian.design/components/onboarding/examples)
|
|
92
|
+
* - [Code](https://atlassian.design/components/onboarding/code)
|
|
93
|
+
* - [Usage](https://atlassian.design/components/onboarding/usage)
|
|
94
|
+
*/
|
|
95
|
+
declare const Spotlight: React.FC<SpotlightProps>;
|
|
96
|
+
export default Spotlight;
|
|
@@ -0,0 +1,10 @@
|
|
|
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;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { 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 {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* We re-export this because products may have multiple versions of
|
|
3
|
+
* `@atlaskit/modal-dialog`.
|
|
4
|
+
*
|
|
5
|
+
* If a consumer uses the onboarding `Modal` with the `ModalTransition` from an
|
|
6
|
+
* incompatible version of `@atlaskit/modal-dialog`, then the modal can get
|
|
7
|
+
* stuck in an open state.
|
|
8
|
+
*
|
|
9
|
+
* See https://product-fabric.atlassian.net/browse/DSP-796 for more details
|
|
10
|
+
* and a reproduction.
|
|
11
|
+
*/
|
|
12
|
+
export { default as ModalTransition } from '@atlaskit/modal-dialog/modal-transition';
|
|
13
|
+
export { Modal, Spotlight, SpotlightCard, SpotlightManager, SpotlightTarget, SpotlightTransition, modalButtonTheme, spotlightButtonTheme, useSpotlight, } from './components';
|
|
14
|
+
export { Pulse as SpotlightPulse } from './styled/target';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type BlanketProps = {
|
|
3
|
+
isTinted?: boolean;
|
|
4
|
+
style?: React.CSSProperties;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* __Blanket__
|
|
8
|
+
*
|
|
9
|
+
* A replacement for `@atlaskit/blanket`.
|
|
10
|
+
*
|
|
11
|
+
* We use this for spotlights instead of `@atlaskit/blanket`
|
|
12
|
+
* because spotlights must sit on top of other layered elements,
|
|
13
|
+
* such as modals, which have their own blankets.
|
|
14
|
+
*
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
declare const Blanket: React.FC<BlanketProps>;
|
|
18
|
+
export default Blanket;
|