@atlaskit/onboarding 10.8.1 → 10.8.3
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 +12 -0
- package/dist/cjs/components/spotlight-card.js +1 -1
- package/dist/cjs/components/spotlight-dialog.js +1 -1
- package/dist/cjs/styled/dialog.js +7 -4
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/spotlight-card.js +1 -1
- package/dist/es2019/components/spotlight-dialog.js +1 -1
- package/dist/es2019/styled/dialog.js +3 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/spotlight-card.js +1 -1
- package/dist/esm/components/spotlight-dialog.js +1 -1
- package/dist/esm/styled/dialog.js +7 -4
- package/dist/esm/version.json +1 -1
- package/dist/types/components/spotlight-card.d.ts +2 -2
- package/dist/types/components/spotlight-target.d.ts +2 -2
- package/dist/types/components/spotlight.d.ts +2 -2
- package/dist/types/styled/blanket.d.ts +3 -1
- package/dist/types/styled/dialog.d.ts +7 -6
- package/dist/types/styled/modal.d.ts +19 -15
- package/dist/types/styled/target.d.ts +5 -4
- package/dist/types-ts4.5/components/animation.d.ts +15 -0
- package/dist/types-ts4.5/components/clone.d.ts +50 -0
- package/dist/types-ts4.5/components/index.d.ts +9 -0
- package/dist/types-ts4.5/components/modal.d.ts +50 -0
- package/dist/types-ts4.5/components/spotlight-card.d.ts +81 -0
- package/dist/types-ts4.5/components/spotlight-dialog.d.ts +61 -0
- package/dist/types-ts4.5/components/spotlight-inner.d.ts +54 -0
- package/dist/types-ts4.5/components/spotlight-manager.d.ts +66 -0
- package/dist/types-ts4.5/components/spotlight-target.d.ts +22 -0
- package/dist/types-ts4.5/components/spotlight-transition.d.ts +43 -0
- package/dist/types-ts4.5/components/spotlight.d.ts +96 -0
- package/dist/types-ts4.5/components/theme.d.ts +10 -0
- package/dist/types-ts4.5/components/use-spotlight.d.ts +6 -0
- package/dist/types-ts4.5/components/value-changed.d.ts +11 -0
- package/dist/types-ts4.5/index.d.ts +14 -0
- package/dist/types-ts4.5/styled/blanket.d.ts +20 -0
- package/dist/types-ts4.5/styled/dialog.d.ts +31 -0
- package/dist/types-ts4.5/styled/modal.d.ts +48 -0
- package/dist/types-ts4.5/styled/target.d.ts +43 -0
- package/dist/types-ts4.5/types.d.ts +8 -0
- package/dist/types-ts4.5/utils/use-element-box.d.ts +23 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/onboarding
|
|
2
2
|
|
|
3
|
+
## 10.8.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`e7ea6832ad2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e7ea6832ad2) - Bans the use of React.FC/React.FunctionComponent type in ADS components as part of the React 18 migration work. The change is internal only and should not introduce any changes for the component consumers.
|
|
8
|
+
|
|
9
|
+
## 10.8.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
|
|
14
|
+
|
|
3
15
|
## 10.8.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var _react =
|
|
10
|
+
var _react = require("react");
|
|
11
11
|
var _react2 = require("@emotion/react");
|
|
12
12
|
var _customThemeButton = _interopRequireWildcard(require("@atlaskit/button/custom-theme-button"));
|
|
13
13
|
var _heading = _interopRequireDefault(require("@atlaskit/heading"));
|
|
@@ -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.
|
|
30
|
+
var packageVersion = "10.8.3";
|
|
31
31
|
var SpotlightDialog = /*#__PURE__*/function (_Component) {
|
|
32
32
|
(0, _inherits2.default)(SpotlightDialog, _Component);
|
|
33
33
|
var _super = _createSuper(SpotlightDialog);
|
|
@@ -35,10 +35,13 @@ var actionItemStyles = (0, _react.css)({
|
|
|
35
35
|
var DialogImage = function DialogImage(_ref) {
|
|
36
36
|
var alt = _ref.alt,
|
|
37
37
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
38
|
-
return (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
return (
|
|
39
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
40
|
+
(0, _react.jsx)("img", (0, _extends2.default)({
|
|
41
|
+
css: imageStyles,
|
|
42
|
+
alt: alt
|
|
43
|
+
}, props))
|
|
44
|
+
);
|
|
42
45
|
};
|
|
43
46
|
|
|
44
47
|
/**
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import Button, { Theme as ButtonTheme } from '@atlaskit/button/custom-theme-button';
|
|
5
5
|
import Heading from '@atlaskit/heading';
|
|
@@ -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.
|
|
10
|
+
const packageVersion = "10.8.3";
|
|
11
11
|
class SpotlightDialog extends Component {
|
|
12
12
|
constructor(...args) {
|
|
13
13
|
super(...args);
|
|
@@ -27,7 +27,9 @@ const actionItemStyles = css({
|
|
|
27
27
|
export const DialogImage = ({
|
|
28
28
|
alt,
|
|
29
29
|
...props
|
|
30
|
-
}) =>
|
|
30
|
+
}) =>
|
|
31
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
32
|
+
jsx("img", _extends({
|
|
31
33
|
css: imageStyles,
|
|
32
34
|
alt: alt
|
|
33
35
|
}, props));
|
package/dist/es2019/version.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
2
|
var _excluded = ["text", "key"];
|
|
3
3
|
/** @jsx jsx */
|
|
4
|
-
import
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
5
|
import { css, jsx } from '@emotion/react';
|
|
6
6
|
import Button, { Theme as ButtonTheme } from '@atlaskit/button/custom-theme-button';
|
|
7
7
|
import Heading from '@atlaskit/heading';
|
|
@@ -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.
|
|
20
|
+
var packageVersion = "10.8.3";
|
|
21
21
|
var SpotlightDialog = /*#__PURE__*/function (_Component) {
|
|
22
22
|
_inherits(SpotlightDialog, _Component);
|
|
23
23
|
var _super = _createSuper(SpotlightDialog);
|
|
@@ -29,10 +29,13 @@ var actionItemStyles = css({
|
|
|
29
29
|
export var DialogImage = function DialogImage(_ref) {
|
|
30
30
|
var alt = _ref.alt,
|
|
31
31
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
32
|
-
return
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
return (
|
|
33
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
34
|
+
jsx("img", _extends({
|
|
35
|
+
css: imageStyles,
|
|
36
|
+
alt: alt
|
|
37
|
+
}, props))
|
|
38
|
+
);
|
|
36
39
|
};
|
|
37
40
|
|
|
38
41
|
/**
|
package/dist/esm/version.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import
|
|
2
|
+
import { ComponentType, ReactNode, Ref } from 'react';
|
|
3
3
|
import { ThemeProp } from '@atlaskit/theme/components';
|
|
4
4
|
import { Actions } from '../types';
|
|
5
5
|
/**
|
|
@@ -77,5 +77,5 @@ interface SpotlightCardProps {
|
|
|
77
77
|
* - [Code](https://atlassian.design/components/onboarding/spotlight-card/code)
|
|
78
78
|
* - [Usage](https://atlassian.design/components/onboarding/spotlight-card/usage)
|
|
79
79
|
*/
|
|
80
|
-
declare const SpotlightCard:
|
|
80
|
+
declare const SpotlightCard: import("react").ForwardRefExoticComponent<SpotlightCardProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
81
81
|
export default SpotlightCard;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
interface SpotlightTargetProps {
|
|
3
3
|
/**
|
|
4
4
|
* A single child
|
|
@@ -18,5 +18,5 @@ interface SpotlightTargetProps {
|
|
|
18
18
|
* - [Code](https://atlassian.design/components/onboarding/code)
|
|
19
19
|
* - [Usage](https://atlassian.design/components/onboarding/usage)
|
|
20
20
|
*/
|
|
21
|
-
declare const SpotlightTarget:
|
|
21
|
+
declare const SpotlightTarget: ({ children, name }: SpotlightTargetProps) => JSX.Element;
|
|
22
22
|
export default SpotlightTarget;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ComponentType, MouseEvent, ReactNode } from 'react';
|
|
2
2
|
import { Actions } from '../types';
|
|
3
3
|
export interface SpotlightProps {
|
|
4
4
|
/**
|
|
@@ -92,5 +92,5 @@ export interface SpotlightProps {
|
|
|
92
92
|
* - [Code](https://atlassian.design/components/onboarding/code)
|
|
93
93
|
* - [Usage](https://atlassian.design/components/onboarding/usage)
|
|
94
94
|
*/
|
|
95
|
-
declare const Spotlight:
|
|
95
|
+
declare const Spotlight: ({ dialogWidth, pulse, testId, targetNode, target, ...rest }: SpotlightProps) => JSX.Element;
|
|
96
96
|
export default Spotlight;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
2
4
|
type BlanketProps = {
|
|
3
5
|
isTinted?: boolean;
|
|
4
6
|
style?: React.CSSProperties;
|
|
@@ -14,5 +16,5 @@ type BlanketProps = {
|
|
|
14
16
|
*
|
|
15
17
|
* @internal
|
|
16
18
|
*/
|
|
17
|
-
declare const Blanket:
|
|
19
|
+
declare const Blanket: (props: BlanketProps) => jsx.JSX.Element;
|
|
18
20
|
export default Blanket;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import { ImgHTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
3
4
|
/**
|
|
4
5
|
* __Dialog image__
|
|
5
6
|
*
|
|
@@ -7,7 +8,7 @@ import { ReactNode } from 'react';
|
|
|
7
8
|
*
|
|
8
9
|
* @internal
|
|
9
10
|
*/
|
|
10
|
-
export declare const DialogImage:
|
|
11
|
+
export declare const DialogImage: ({ alt, ...props }: ImgHTMLAttributes<HTMLImageElement>) => jsx.JSX.Element;
|
|
11
12
|
/**
|
|
12
13
|
* __Dialog action item container__
|
|
13
14
|
*
|
|
@@ -15,9 +16,9 @@ export declare const DialogImage: React.FC<React.ImgHTMLAttributes<HTMLImageElem
|
|
|
15
16
|
*
|
|
16
17
|
* @internal
|
|
17
18
|
*/
|
|
18
|
-
export declare const DialogActionItemContainer:
|
|
19
|
+
export declare const DialogActionItemContainer: ({ children, }: {
|
|
19
20
|
children: ReactNode;
|
|
20
|
-
}
|
|
21
|
+
}) => jsx.JSX.Element;
|
|
21
22
|
/**
|
|
22
23
|
* __Dialog action item__
|
|
23
24
|
*
|
|
@@ -25,6 +26,6 @@ export declare const DialogActionItemContainer: React.FC<{
|
|
|
25
26
|
*
|
|
26
27
|
* @internal
|
|
27
28
|
*/
|
|
28
|
-
export declare const DialogActionItem:
|
|
29
|
+
export declare const DialogActionItem: ({ children }: {
|
|
29
30
|
children: ReactNode;
|
|
30
|
-
}
|
|
31
|
+
}) => jsx.JSX.Element;
|
|
@@ -1,44 +1,48 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
type ModalImageProps = {
|
|
5
|
+
alt: string;
|
|
6
|
+
src?: string;
|
|
7
|
+
};
|
|
8
|
+
type ModalActionContainerProps = {
|
|
9
|
+
shouldReverseButtonOrder: boolean;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
};
|
|
3
12
|
/**
|
|
4
13
|
* __Modal body__
|
|
5
14
|
*
|
|
6
15
|
* @internal
|
|
7
16
|
*/
|
|
8
|
-
export declare const ModalBody:
|
|
17
|
+
export declare const ModalBody: ({ children }: {
|
|
9
18
|
children: ReactNode;
|
|
10
|
-
}
|
|
19
|
+
}) => jsx.JSX.Element;
|
|
11
20
|
/**
|
|
12
21
|
* __Modal heading__
|
|
13
22
|
*
|
|
14
23
|
* @internal
|
|
15
24
|
*/
|
|
16
|
-
export declare const ModalHeading:
|
|
17
|
-
children:
|
|
18
|
-
}
|
|
25
|
+
export declare const ModalHeading: ({ children }: {
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
}) => jsx.JSX.Element;
|
|
19
28
|
/**
|
|
20
29
|
* __Modal image__
|
|
21
30
|
*
|
|
22
31
|
* @internal
|
|
23
32
|
*/
|
|
24
|
-
export declare const ModalImage:
|
|
25
|
-
alt: string;
|
|
26
|
-
src?: string;
|
|
27
|
-
}>;
|
|
33
|
+
export declare const ModalImage: ({ alt, src }: ModalImageProps) => jsx.JSX.Element;
|
|
28
34
|
/**
|
|
29
35
|
* __Modal action container__
|
|
30
36
|
*
|
|
31
37
|
* @internal
|
|
32
38
|
*/
|
|
33
|
-
export declare const ModalActionContainer:
|
|
34
|
-
shouldReverseButtonOrder: boolean;
|
|
35
|
-
children: ReactNode;
|
|
36
|
-
}>;
|
|
39
|
+
export declare const ModalActionContainer: ({ children, shouldReverseButtonOrder, }: ModalActionContainerProps) => jsx.JSX.Element;
|
|
37
40
|
/**
|
|
38
41
|
* __Modal action item__
|
|
39
42
|
*
|
|
40
43
|
* @internal
|
|
41
44
|
*/
|
|
42
|
-
export declare const ModalActionItem:
|
|
45
|
+
export declare const ModalActionItem: ({ children }: {
|
|
43
46
|
children: ReactNode;
|
|
44
|
-
}
|
|
47
|
+
}) => jsx.JSX.Element;
|
|
48
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
3
4
|
type BaseProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
4
5
|
bgColor?: string;
|
|
5
6
|
radius?: number;
|
|
@@ -19,7 +20,7 @@ export declare const pulseKeyframesName: string;
|
|
|
19
20
|
*
|
|
20
21
|
* @internal
|
|
21
22
|
*/
|
|
22
|
-
export declare const TargetInner:
|
|
23
|
+
export declare const TargetInner: ({ children, pulse, ...props }: TargetProps) => jsx.JSX.Element;
|
|
23
24
|
/**
|
|
24
25
|
* __Target overlay__
|
|
25
26
|
*
|
|
@@ -28,7 +29,7 @@ export declare const TargetInner: React.FC<TargetProps>;
|
|
|
28
29
|
*
|
|
29
30
|
* @internal
|
|
30
31
|
*/
|
|
31
|
-
export declare const TargetOverlay:
|
|
32
|
+
export declare const TargetOverlay: (props: HTMLAttributes<HTMLDivElement>) => jsx.JSX.Element;
|
|
32
33
|
/**
|
|
33
34
|
* __Spotlight pulse__
|
|
34
35
|
*
|
|
@@ -38,5 +39,5 @@ export declare const TargetOverlay: React.FC<React.HTMLAttributes<HTMLDivElement
|
|
|
38
39
|
* - [Code](https://atlassian.design/components/onboarding/code)
|
|
39
40
|
* - [Usage](https://atlassian.design/components/onboarding/usage)
|
|
40
41
|
*/
|
|
41
|
-
export declare const Pulse:
|
|
42
|
+
export declare const Pulse: ({ children, pulse, testId, ...props }: TargetProps) => jsx.JSX.Element;
|
|
42
43
|
export {};
|
|
@@ -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 { 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: import("react").ForwardRefExoticComponent<SpotlightCardProps & import("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 { 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: ({ children, name }: SpotlightTargetProps) => JSX.Element;
|
|
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 { 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: ({ dialogWidth, pulse, testId, targetNode, target, ...rest }: SpotlightProps) => JSX.Element;
|
|
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,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
type BlanketProps = {
|
|
5
|
+
isTinted?: boolean;
|
|
6
|
+
style?: React.CSSProperties;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* __Blanket__
|
|
10
|
+
*
|
|
11
|
+
* A replacement for `@atlaskit/blanket`.
|
|
12
|
+
*
|
|
13
|
+
* We use this for spotlights instead of `@atlaskit/blanket`
|
|
14
|
+
* because spotlights must sit on top of other layered elements,
|
|
15
|
+
* such as modals, which have their own blankets.
|
|
16
|
+
*
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
declare const Blanket: (props: BlanketProps) => jsx.JSX.Element;
|
|
20
|
+
export default Blanket;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { ImgHTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
/**
|
|
5
|
+
* __Dialog image__
|
|
6
|
+
*
|
|
7
|
+
* An optional header image in spotlight dialogs.
|
|
8
|
+
*
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export declare const DialogImage: ({ alt, ...props }: ImgHTMLAttributes<HTMLImageElement>) => jsx.JSX.Element;
|
|
12
|
+
/**
|
|
13
|
+
* __Dialog action item container__
|
|
14
|
+
*
|
|
15
|
+
* Flex wrapper around dialog action items.
|
|
16
|
+
*
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare const DialogActionItemContainer: ({ children, }: {
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
}) => jsx.JSX.Element;
|
|
22
|
+
/**
|
|
23
|
+
* __Dialog action item__
|
|
24
|
+
*
|
|
25
|
+
* Action items shown inside of the dialog.
|
|
26
|
+
*
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export declare const DialogActionItem: ({ children }: {
|
|
30
|
+
children: ReactNode;
|
|
31
|
+
}) => jsx.JSX.Element;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
type ModalImageProps = {
|
|
5
|
+
alt: string;
|
|
6
|
+
src?: string;
|
|
7
|
+
};
|
|
8
|
+
type ModalActionContainerProps = {
|
|
9
|
+
shouldReverseButtonOrder: boolean;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* __Modal body__
|
|
14
|
+
*
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export declare const ModalBody: ({ children }: {
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
}) => jsx.JSX.Element;
|
|
20
|
+
/**
|
|
21
|
+
* __Modal heading__
|
|
22
|
+
*
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
export declare const ModalHeading: ({ children }: {
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
}) => jsx.JSX.Element;
|
|
28
|
+
/**
|
|
29
|
+
* __Modal image__
|
|
30
|
+
*
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
export declare const ModalImage: ({ alt, src }: ModalImageProps) => jsx.JSX.Element;
|
|
34
|
+
/**
|
|
35
|
+
* __Modal action container__
|
|
36
|
+
*
|
|
37
|
+
* @internal
|
|
38
|
+
*/
|
|
39
|
+
export declare const ModalActionContainer: ({ children, shouldReverseButtonOrder, }: ModalActionContainerProps) => jsx.JSX.Element;
|
|
40
|
+
/**
|
|
41
|
+
* __Modal action item__
|
|
42
|
+
*
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
export declare const ModalActionItem: ({ children }: {
|
|
46
|
+
children: ReactNode;
|
|
47
|
+
}) => jsx.JSX.Element;
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
type BaseProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
5
|
+
bgColor?: string;
|
|
6
|
+
radius?: number;
|
|
7
|
+
className?: string;
|
|
8
|
+
testId?: string;
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
type TargetProps = Omit<BaseProps, 'css'> & {
|
|
12
|
+
pulse?: boolean;
|
|
13
|
+
testId?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const pulseKeyframesName: string;
|
|
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: ({ children, pulse, ...props }: TargetProps) => jsx.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: (props: HTMLAttributes<HTMLDivElement>) => jsx.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
|
+
export declare const Pulse: ({ children, pulse, testId, ...props }: TargetProps) => jsx.JSX.Element;
|
|
43
|
+
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.
|
|
3
|
+
"version": "10.8.3",
|
|
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/"
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@atlaskit/popper": "^5.5.0",
|
|
42
42
|
"@atlaskit/portal": "^4.3.0",
|
|
43
43
|
"@atlaskit/theme": "^12.5.0",
|
|
44
|
-
"@atlaskit/tokens": "^1.
|
|
44
|
+
"@atlaskit/tokens": "^1.5.0",
|
|
45
45
|
"@babel/runtime": "^7.0.0",
|
|
46
46
|
"@emotion/react": "^11.7.1",
|
|
47
47
|
"bind-event-listener": "^2.1.1",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@atlaskit/docs": "*",
|
|
63
63
|
"@atlaskit/icon": "^21.12.0",
|
|
64
64
|
"@atlaskit/progress-indicator": "^9.5.0",
|
|
65
|
-
"@atlaskit/select": "^16.
|
|
65
|
+
"@atlaskit/select": "^16.5.0",
|
|
66
66
|
"@atlaskit/ssr": "*",
|
|
67
67
|
"@atlaskit/visual-regression": "*",
|
|
68
68
|
"@atlaskit/webdriver-runner": "*",
|