@atlaskit/onboarding 10.8.1 → 10.8.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 (29) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/components/spotlight-dialog.js +1 -1
  3. package/dist/cjs/version.json +1 -1
  4. package/dist/es2019/components/spotlight-dialog.js +1 -1
  5. package/dist/es2019/version.json +1 -1
  6. package/dist/esm/components/spotlight-dialog.js +1 -1
  7. package/dist/esm/version.json +1 -1
  8. package/dist/types-ts4.5/components/animation.d.ts +15 -0
  9. package/dist/types-ts4.5/components/clone.d.ts +50 -0
  10. package/dist/types-ts4.5/components/index.d.ts +9 -0
  11. package/dist/types-ts4.5/components/modal.d.ts +50 -0
  12. package/dist/types-ts4.5/components/spotlight-card.d.ts +81 -0
  13. package/dist/types-ts4.5/components/spotlight-dialog.d.ts +61 -0
  14. package/dist/types-ts4.5/components/spotlight-inner.d.ts +54 -0
  15. package/dist/types-ts4.5/components/spotlight-manager.d.ts +66 -0
  16. package/dist/types-ts4.5/components/spotlight-target.d.ts +22 -0
  17. package/dist/types-ts4.5/components/spotlight-transition.d.ts +43 -0
  18. package/dist/types-ts4.5/components/spotlight.d.ts +96 -0
  19. package/dist/types-ts4.5/components/theme.d.ts +10 -0
  20. package/dist/types-ts4.5/components/use-spotlight.d.ts +6 -0
  21. package/dist/types-ts4.5/components/value-changed.d.ts +11 -0
  22. package/dist/types-ts4.5/index.d.ts +14 -0
  23. package/dist/types-ts4.5/styled/blanket.d.ts +18 -0
  24. package/dist/types-ts4.5/styled/dialog.d.ts +30 -0
  25. package/dist/types-ts4.5/styled/modal.d.ts +44 -0
  26. package/dist/types-ts4.5/styled/target.d.ts +42 -0
  27. package/dist/types-ts4.5/types.d.ts +8 -0
  28. package/dist/types-ts4.5/utils/use-element-box.d.ts +23 -0
  29. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/onboarding
2
2
 
3
+ ## 10.8.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
8
+
3
9
  ## 10.8.1
4
10
 
5
11
  ### Patch Changes
@@ -27,7 +27,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
27
27
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
28
28
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
29
29
  var packageName = "@atlaskit/onboarding";
30
- var packageVersion = "10.8.1";
30
+ var packageVersion = "10.8.2";
31
31
  var SpotlightDialog = /*#__PURE__*/function (_Component) {
32
32
  (0, _inherits2.default)(SpotlightDialog, _Component);
33
33
  var _super = _createSuper(SpotlightDialog);
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/onboarding",
3
- "version": "10.8.1",
3
+ "version": "10.8.2",
4
4
  "sideEffects": false
5
5
  }
@@ -7,7 +7,7 @@ import { DialogImage } from '../styled/dialog';
7
7
  import SpotlightCard from './spotlight-card';
8
8
  import ValueChanged from './value-changed';
9
9
  const packageName = "@atlaskit/onboarding";
10
- const packageVersion = "10.8.1";
10
+ const packageVersion = "10.8.2";
11
11
  class SpotlightDialog extends Component {
12
12
  constructor(...args) {
13
13
  super(...args);
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/onboarding",
3
- "version": "10.8.1",
3
+ "version": "10.8.2",
4
4
  "sideEffects": false
5
5
  }
@@ -17,7 +17,7 @@ import { DialogImage } from '../styled/dialog';
17
17
  import SpotlightCard from './spotlight-card';
18
18
  import ValueChanged from './value-changed';
19
19
  var packageName = "@atlaskit/onboarding";
20
- var packageVersion = "10.8.1";
20
+ var packageVersion = "10.8.2";
21
21
  var SpotlightDialog = /*#__PURE__*/function (_Component) {
22
22
  _inherits(SpotlightDialog, _Component);
23
23
  var _super = _createSuper(SpotlightDialog);
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/onboarding",
3
- "version": "10.8.1",
3
+ "version": "10.8.2",
4
4
  "sideEffects": false
5
5
  }
@@ -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
+ 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,6 @@
1
+ /**
2
+ * Use spotlight hook returns information about available spotlight targets.
3
+ */
4
+ export default function useSpotlight(): {
5
+ isTargetRendered: (target: string) => boolean;
6
+ };
@@ -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
+ 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;
@@ -0,0 +1,30 @@
1
+ /** @jsx jsx */
2
+ import { ReactNode } from 'react';
3
+ /**
4
+ * __Dialog image__
5
+ *
6
+ * An optional header image in spotlight dialogs.
7
+ *
8
+ * @internal
9
+ */
10
+ export declare const DialogImage: React.FC<React.ImgHTMLAttributes<HTMLImageElement>>;
11
+ /**
12
+ * __Dialog action item container__
13
+ *
14
+ * Flex wrapper around dialog action items.
15
+ *
16
+ * @internal
17
+ */
18
+ export declare const DialogActionItemContainer: React.FC<{
19
+ children: ReactNode;
20
+ }>;
21
+ /**
22
+ * __Dialog action item__
23
+ *
24
+ * Action items shown inside of the dialog.
25
+ *
26
+ * @internal
27
+ */
28
+ export declare const DialogActionItem: React.FC<{
29
+ children: ReactNode;
30
+ }>;
@@ -0,0 +1,44 @@
1
+ /** @jsx jsx */
2
+ import { ReactNode } from 'react';
3
+ /**
4
+ * __Modal body__
5
+ *
6
+ * @internal
7
+ */
8
+ export declare const ModalBody: React.FC<{
9
+ children: ReactNode;
10
+ }>;
11
+ /**
12
+ * __Modal heading__
13
+ *
14
+ * @internal
15
+ */
16
+ export declare const ModalHeading: React.FC<{
17
+ children: string;
18
+ }>;
19
+ /**
20
+ * __Modal image__
21
+ *
22
+ * @internal
23
+ */
24
+ export declare const ModalImage: React.FC<{
25
+ alt: string;
26
+ src?: string;
27
+ }>;
28
+ /**
29
+ * __Modal action container__
30
+ *
31
+ * @internal
32
+ */
33
+ export declare const ModalActionContainer: React.FC<{
34
+ shouldReverseButtonOrder: boolean;
35
+ children: ReactNode;
36
+ }>;
37
+ /**
38
+ * __Modal action item__
39
+ *
40
+ * @internal
41
+ */
42
+ export declare const ModalActionItem: React.FC<{
43
+ children: ReactNode;
44
+ }>;
@@ -0,0 +1,42 @@
1
+ /** @jsx jsx */
2
+ import { ReactNode } from 'react';
3
+ type BaseProps = React.HTMLAttributes<HTMLDivElement> & {
4
+ bgColor?: string;
5
+ radius?: number;
6
+ className?: string;
7
+ testId?: string;
8
+ children?: ReactNode;
9
+ };
10
+ type TargetProps = Omit<BaseProps, 'css'> & {
11
+ pulse?: boolean;
12
+ testId?: string;
13
+ };
14
+ export declare const pulseKeyframesName: string;
15
+ /**
16
+ * __Target inner__
17
+ *
18
+ * Used to apply spotlight border and pulse to spotlight targets.
19
+ *
20
+ * @internal
21
+ */
22
+ export declare const TargetInner: React.FC<TargetProps>;
23
+ /**
24
+ * __Target overlay__
25
+ *
26
+ * Overlays a spotlight target, allowing for custom click events that are intended
27
+ * only for onboarding.
28
+ *
29
+ * @internal
30
+ */
31
+ export declare const TargetOverlay: React.FC<React.HTMLAttributes<HTMLDivElement>>;
32
+ /**
33
+ * __Spotlight pulse__
34
+ *
35
+ * A spotlight pulse draws attention to a new feature.
36
+ *
37
+ * - [Examples](https://atlassian.design/components/onboarding/examples)
38
+ * - [Code](https://atlassian.design/components/onboarding/code)
39
+ * - [Usage](https://atlassian.design/components/onboarding/usage)
40
+ */
41
+ export declare const Pulse: React.FC<TargetProps>;
42
+ export {};
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from 'react';
2
+ import { 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 {};
@@ -0,0 +1,23 @@
1
+ export interface ElementBoundingBox {
2
+ height: number;
3
+ left: number;
4
+ top: number;
5
+ width: number;
6
+ }
7
+ /**
8
+ * Will listen to the document resizing to see if an element has moved positions.
9
+ * Not using ResizeObserver because of IE11 support.
10
+ * @param element HTMLElement to watch when resizing.
11
+ */
12
+ export declare const useElementBox: (element: HTMLElement) => ElementBoundingBox;
13
+ /**
14
+ * __Element box__
15
+ *
16
+ * Allows consumption of `userElementBox` hook through render props.
17
+ *
18
+ * @internal
19
+ */
20
+ export declare const ElementBox: (props: {
21
+ element: HTMLElement;
22
+ children: (box: ElementBoundingBox) => any;
23
+ }) => any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/onboarding",
3
- "version": "10.8.1",
3
+ "version": "10.8.2",
4
4
  "description": "An onboarding spotlight introduces new features to users through focused messages or multi-step tours.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"