@atlaskit/onboarding 10.2.3 → 10.3.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 +32 -0
- package/dist/cjs/components/{Animation.js → animation.js} +8 -1
- package/dist/cjs/components/card.js +159 -0
- package/dist/cjs/components/{Clone.js → clone.js} +12 -3
- package/dist/cjs/components/index.js +13 -13
- package/dist/cjs/components/{Modal.js → modal.js} +22 -11
- package/dist/cjs/components/{SpotlightCard.js → spotlight-card.js} +15 -6
- package/dist/cjs/components/{SpotlightDialog.js → spotlight-dialog.js} +9 -8
- package/dist/cjs/components/{SpotlightInner.js → spotlight-inner.js} +16 -9
- package/dist/cjs/components/{SpotlightManager.js → spotlight-manager.js} +13 -5
- package/dist/cjs/components/spotlight-target.js +34 -0
- package/dist/cjs/components/{SpotlightTransition.js → spotlight-transition.js} +27 -11
- package/dist/cjs/components/spotlight.js +58 -0
- package/dist/cjs/components/theme.js +56 -180
- package/dist/cjs/components/{useSpotlight.js → use-spotlight.js} +11 -2
- package/dist/cjs/components/{ValueChanged.js → value-changed.js} +0 -0
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/styled/blanket.js +66 -0
- package/dist/cjs/styled/dialog.js +86 -0
- package/dist/cjs/styled/modal.js +144 -0
- package/dist/cjs/styled/target.js +125 -0
- package/dist/cjs/utils/use-element-box.js +8 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/{Animation.js → animation.js} +9 -1
- package/dist/es2019/components/card.js +131 -0
- package/dist/es2019/components/{Clone.js → clone.js} +10 -1
- package/dist/es2019/components/index.js +7 -7
- package/dist/es2019/components/{Modal.js → modal.js} +23 -11
- package/dist/es2019/components/{SpotlightCard.js → spotlight-card.js} +13 -6
- package/dist/es2019/components/{SpotlightDialog.js → spotlight-dialog.js} +7 -6
- package/dist/es2019/components/{SpotlightInner.js → spotlight-inner.js} +12 -5
- package/dist/es2019/components/{SpotlightManager.js → spotlight-manager.js} +11 -3
- package/dist/es2019/components/spotlight-target.js +19 -0
- package/dist/es2019/components/{SpotlightTransition.js → spotlight-transition.js} +21 -5
- package/dist/es2019/components/spotlight.js +40 -0
- package/dist/es2019/components/theme.js +55 -180
- package/dist/es2019/components/{useSpotlight.js → use-spotlight.js} +11 -1
- package/dist/es2019/components/{ValueChanged.js → value-changed.js} +0 -0
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/styled/blanket.js +46 -0
- package/dist/es2019/styled/dialog.js +62 -0
- package/dist/es2019/styled/modal.js +115 -0
- package/dist/es2019/styled/target.js +93 -0
- package/dist/es2019/utils/use-element-box.js +8 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/{Animation.js → animation.js} +9 -1
- package/dist/esm/components/card.js +140 -0
- package/dist/esm/components/{Clone.js → clone.js} +10 -1
- package/dist/esm/components/index.js +7 -7
- package/dist/esm/components/{Modal.js → modal.js} +22 -11
- package/dist/esm/components/{SpotlightCard.js → spotlight-card.js} +13 -5
- package/dist/esm/components/{SpotlightDialog.js → spotlight-dialog.js} +7 -6
- package/dist/esm/components/{SpotlightInner.js → spotlight-inner.js} +13 -6
- package/dist/esm/components/{SpotlightManager.js → spotlight-manager.js} +11 -3
- package/dist/esm/components/spotlight-target.js +22 -0
- package/dist/esm/components/{SpotlightTransition.js → spotlight-transition.js} +27 -11
- package/dist/esm/components/spotlight.js +45 -0
- package/dist/esm/components/theme.js +55 -180
- package/dist/esm/components/{useSpotlight.js → use-spotlight.js} +11 -1
- package/dist/esm/components/{ValueChanged.js → value-changed.js} +0 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/styled/blanket.js +52 -0
- package/dist/esm/styled/dialog.js +67 -0
- package/dist/esm/styled/modal.js +119 -0
- package/dist/esm/styled/target.js +107 -0
- package/dist/esm/utils/use-element-box.js +8 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/components/animation.d.ts +15 -0
- package/dist/types/components/{Card.d.ts → card.d.ts} +35 -12
- package/dist/types/components/clone.d.ts +50 -0
- package/dist/types/components/index.d.ts +7 -7
- package/dist/types/components/modal.d.ts +48 -0
- package/dist/types/components/spotlight-card.d.ts +63 -0
- package/dist/types/components/{SpotlightDialog.d.ts → spotlight-dialog.d.ts} +37 -13
- package/dist/types/components/spotlight-inner.d.ts +54 -0
- package/dist/types/components/{SpotlightManager.d.ts → spotlight-manager.d.ts} +21 -5
- package/dist/types/components/spotlight-target.d.ts +20 -0
- package/dist/types/components/spotlight-transition.d.ts +41 -0
- package/dist/types/components/spotlight.d.ts +96 -0
- package/dist/types/components/use-spotlight.d.ts +12 -0
- package/dist/types/components/value-changed.d.ts +11 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/styled/blanket.d.ts +18 -0
- package/dist/types/styled/dialog.d.ts +25 -0
- package/dist/types/styled/modal.d.ts +36 -0
- package/dist/types/styled/target.d.ts +35 -0
- package/dist/types/utils/use-element-box.d.ts +7 -0
- package/package.json +22 -11
- package/dist/cjs/components/Card.js +0 -103
- package/dist/cjs/components/Spotlight.js +0 -79
- package/dist/cjs/components/SpotlightTarget.js +0 -62
- package/dist/cjs/styled/Blanket.js +0 -35
- package/dist/cjs/styled/Dialog.js +0 -50
- package/dist/cjs/styled/Modal.js +0 -42
- package/dist/cjs/styled/Target.js +0 -54
- package/dist/es2019/components/Card.js +0 -87
- package/dist/es2019/components/Spotlight.js +0 -39
- package/dist/es2019/components/SpotlightTarget.js +0 -14
- package/dist/es2019/styled/Blanket.js +0 -23
- package/dist/es2019/styled/Dialog.js +0 -51
- package/dist/es2019/styled/Modal.js +0 -40
- package/dist/es2019/styled/Target.js +0 -40
- package/dist/esm/components/Card.js +0 -78
- package/dist/esm/components/Spotlight.js +0 -64
- package/dist/esm/components/SpotlightTarget.js +0 -42
- package/dist/esm/styled/Blanket.js +0 -20
- package/dist/esm/styled/Dialog.js +0 -18
- package/dist/esm/styled/Modal.js +0 -16
- package/dist/esm/styled/Target.js +0 -29
- package/dist/types/components/Animation.d.ts +0 -8
- package/dist/types/components/Clone.d.ts +0 -27
- package/dist/types/components/Modal.d.ts +0 -25
- package/dist/types/components/Spotlight.d.ts +0 -59
- package/dist/types/components/SpotlightCard.d.ts +0 -38
- package/dist/types/components/SpotlightInner.d.ts +0 -30
- package/dist/types/components/SpotlightTarget.d.ts +0 -11
- package/dist/types/components/SpotlightTransition.d.ts +0 -27
- package/dist/types/components/ValueChanged.d.ts +0 -11
- package/dist/types/components/useSpotlight.d.ts +0 -3
- package/dist/types/styled/Blanket.d.ts +0 -7
- package/dist/types/styled/Dialog.d.ts +0 -12
- package/dist/types/styled/Modal.d.ts +0 -10
- package/dist/types/styled/Target.d.ts +0 -16
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
+
|
|
5
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
+
|
|
7
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
8
|
+
|
|
9
|
+
/** @jsx jsx */
|
|
10
|
+
import { css, jsx, keyframes } from '@emotion/core';
|
|
11
|
+
import { P300 } from '@atlaskit/theme/colors';
|
|
12
|
+
import { layers } from '@atlaskit/theme/constants';
|
|
13
|
+
import { token } from '@atlaskit/tokens';
|
|
14
|
+
// NOTE:
|
|
15
|
+
// Pulse color "rgb(101, 84, 192)" derived from "colors.P300"
|
|
16
|
+
var baseShadow = token('shadow.overlay', "0 0 0 2px ".concat(P300));
|
|
17
|
+
var easing = 'cubic-bezier(0.55, 0.055, 0.675, 0.19)';
|
|
18
|
+
var pulseKeyframes = keyframes({
|
|
19
|
+
'0%, 33%': {
|
|
20
|
+
boxShadow: "".concat(baseShadow, ", 0 0 0 rgba(101, 84, 192, 1)")
|
|
21
|
+
},
|
|
22
|
+
'66%, 100%': {
|
|
23
|
+
boxShadow: "".concat(baseShadow, ", 0 0 0 10px rgba(101, 84, 192, 0.01)")
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
var animationStyles = css({
|
|
27
|
+
animation: "".concat(pulseKeyframes, " 3000ms ").concat(easing, " infinite")
|
|
28
|
+
}); // IE11 and Edge: z-index needed because fixed position calculates z-index relative
|
|
29
|
+
// to body instead of nearest stacking context (Portal in our case).
|
|
30
|
+
|
|
31
|
+
var baseStyles = css({
|
|
32
|
+
zIndex: layers.spotlight() + 1
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
var Base = function Base(_ref) {
|
|
36
|
+
var children = _ref.children,
|
|
37
|
+
bgColor = _ref.bgColor,
|
|
38
|
+
radius = _ref.radius,
|
|
39
|
+
style = _ref.style,
|
|
40
|
+
props = _objectWithoutProperties(_ref, ["children", "bgColor", "radius", "style"]);
|
|
41
|
+
|
|
42
|
+
return jsx("div", _extends({
|
|
43
|
+
css: baseStyles,
|
|
44
|
+
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
45
|
+
backgroundColor: bgColor,
|
|
46
|
+
borderRadius: radius ? "".concat(radius, "px") : undefined
|
|
47
|
+
})
|
|
48
|
+
}, props), children);
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* __Target inner__
|
|
52
|
+
*
|
|
53
|
+
* Used to apply spotlight border and pulse to spotlight targets.
|
|
54
|
+
*
|
|
55
|
+
* @internal
|
|
56
|
+
*/
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
export var TargetInner = function TargetInner(_ref2) {
|
|
60
|
+
var children = _ref2.children,
|
|
61
|
+
pulse = _ref2.pulse,
|
|
62
|
+
props = _objectWithoutProperties(_ref2, ["children", "pulse"]);
|
|
63
|
+
|
|
64
|
+
return jsx(Base, _extends({}, props, {
|
|
65
|
+
css: [pulse && animationStyles]
|
|
66
|
+
}), children);
|
|
67
|
+
};
|
|
68
|
+
var targetOverlayStyles = css({
|
|
69
|
+
width: '100%',
|
|
70
|
+
height: '100%',
|
|
71
|
+
position: 'absolute',
|
|
72
|
+
top: 0,
|
|
73
|
+
left: 0
|
|
74
|
+
});
|
|
75
|
+
/**
|
|
76
|
+
* __Target overlay__
|
|
77
|
+
*
|
|
78
|
+
* Overlays a spotlight target, allowing for custom click events that are intended
|
|
79
|
+
* only for onboarding.
|
|
80
|
+
*
|
|
81
|
+
* @internal
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
export var TargetOverlay = function TargetOverlay(props) {
|
|
85
|
+
return jsx("div", _extends({}, props, {
|
|
86
|
+
css: targetOverlayStyles,
|
|
87
|
+
style: {
|
|
88
|
+
cursor: props.onClick ? 'pointer' : 'auto'
|
|
89
|
+
}
|
|
90
|
+
}));
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* __Pulse__
|
|
94
|
+
*
|
|
95
|
+
* Allows consumers to apply the spotlight pulse effect in a custom way.
|
|
96
|
+
*
|
|
97
|
+
* - [Examples](https://atlaskit.atlassian.com/packages/design-system/onboarding)
|
|
98
|
+
*/
|
|
99
|
+
|
|
100
|
+
export var Pulse = function Pulse(_ref3) {
|
|
101
|
+
var children = _ref3.children,
|
|
102
|
+
props = _objectWithoutProperties(_ref3, ["children"]);
|
|
103
|
+
|
|
104
|
+
return jsx(Base, _extends({}, props, {
|
|
105
|
+
css: animationStyles
|
|
106
|
+
}), children);
|
|
107
|
+
};
|
|
@@ -50,6 +50,14 @@ export var useElementBox = function useElementBox(element) {
|
|
|
50
50
|
}, [element]);
|
|
51
51
|
return box;
|
|
52
52
|
};
|
|
53
|
+
/**
|
|
54
|
+
* __Element box__
|
|
55
|
+
*
|
|
56
|
+
* Allows consumption of `userElementBox` hook through render props.
|
|
57
|
+
*
|
|
58
|
+
* @internal
|
|
59
|
+
*/
|
|
60
|
+
|
|
53
61
|
export var ElementBox = function ElementBox(props) {
|
|
54
62
|
var box = useElementBox(props.element);
|
|
55
63
|
return props.children(box);
|
package/dist/esm/version.json
CHANGED
|
@@ -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 {};
|
|
@@ -1,30 +1,46 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import React, { ComponentType, ReactNode } from 'react';
|
|
2
3
|
import { ThemeProp } from '@atlaskit/theme/components';
|
|
3
4
|
import { Actions } from '../types';
|
|
4
5
|
export interface CardTokens {
|
|
5
6
|
container: Record<string, string | undefined>;
|
|
6
7
|
}
|
|
7
|
-
interface
|
|
8
|
-
/**
|
|
8
|
+
interface CardProps {
|
|
9
|
+
/**
|
|
10
|
+
* Buttons to render in the footer
|
|
11
|
+
*/
|
|
9
12
|
actions?: Actions;
|
|
10
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* An optional element rendered to the left of the footer actions
|
|
15
|
+
*/
|
|
11
16
|
actionsBeforeElement?: ReactNode;
|
|
12
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* The content of the card
|
|
19
|
+
*/
|
|
13
20
|
children?: ReactNode;
|
|
14
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* The container elements rendered by the component
|
|
23
|
+
*/
|
|
15
24
|
components?: {
|
|
16
25
|
Header?: ComponentType<any>;
|
|
17
26
|
Footer?: ComponentType<any>;
|
|
18
27
|
};
|
|
19
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* The heading to be rendered above the body
|
|
30
|
+
*/
|
|
20
31
|
heading?: ReactNode;
|
|
21
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* An optional element rendered to the right of the heading
|
|
34
|
+
*/
|
|
22
35
|
headingAfterElement?: ReactNode;
|
|
23
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* The image to render above the heading. Can be a url or a Node.
|
|
38
|
+
*/
|
|
24
39
|
image?: string | ReactNode;
|
|
25
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* The theme of the card
|
|
42
|
+
*/
|
|
26
43
|
theme?: ThemeProp<CardTokens, {}>;
|
|
27
|
-
innerRef?: React.Ref<HTMLElement>;
|
|
28
44
|
/**
|
|
29
45
|
* A `testId` prop is provided for specified elements,
|
|
30
46
|
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
@@ -32,5 +48,12 @@ interface Props {
|
|
|
32
48
|
*/
|
|
33
49
|
testId?: string;
|
|
34
50
|
}
|
|
35
|
-
|
|
36
|
-
|
|
51
|
+
/**
|
|
52
|
+
* __Card__
|
|
53
|
+
*
|
|
54
|
+
* A card base for the spotlight card. The external `SpotlightCard` wraps this component.
|
|
55
|
+
*
|
|
56
|
+
* @internal
|
|
57
|
+
*/
|
|
58
|
+
declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLElement>>;
|
|
59
|
+
export default Card;
|
|
@@ -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;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import Modal from './
|
|
2
|
-
import Spotlight from './
|
|
3
|
-
import SpotlightCard from './
|
|
4
|
-
import SpotlightManager from './
|
|
5
|
-
import SpotlightTarget from './
|
|
6
|
-
import SpotlightTransition from './
|
|
7
|
-
import useSpotlight from './
|
|
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
8
|
export { spotlightButtonTheme, modalButtonTheme } from './theme';
|
|
9
9
|
export { Modal, Spotlight, SpotlightCard, SpotlightManager, SpotlightTarget, SpotlightTransition, useSpotlight, };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { Component, ElementType, ReactNode } from 'react';
|
|
3
|
+
import { ModalFooterProps as FooterComponentProps, ModalHeaderProps as HeaderComponentProps } from '@atlaskit/modal-dialog';
|
|
4
|
+
import { Actions } from '../types';
|
|
5
|
+
declare type ModalProps = {
|
|
6
|
+
/**
|
|
7
|
+
* Buttons to render in the footer
|
|
8
|
+
*/
|
|
9
|
+
actions?: Actions;
|
|
10
|
+
/**
|
|
11
|
+
* The elements rendered in the modal
|
|
12
|
+
*/
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Path to the the your image
|
|
16
|
+
*/
|
|
17
|
+
image?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Optional element rendered above the body
|
|
20
|
+
*/
|
|
21
|
+
header?: ElementType<HeaderComponentProps>;
|
|
22
|
+
/**
|
|
23
|
+
* Optional element rendered below the body
|
|
24
|
+
*/
|
|
25
|
+
footer?: ElementType<FooterComponentProps>;
|
|
26
|
+
/**
|
|
27
|
+
* Heading text rendered above the body
|
|
28
|
+
*/
|
|
29
|
+
heading?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Boolean prop to confirm if primary button in the footer should be shown on the right
|
|
32
|
+
*/
|
|
33
|
+
experimental_shouldShowPrimaryButtonOnRight?: boolean;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* __Onboarding modal__
|
|
37
|
+
*
|
|
38
|
+
* If the product change is large enough,
|
|
39
|
+
* this component can be used to outline the benefits of the change to the user.
|
|
40
|
+
*
|
|
41
|
+
* - [Examples](https://atlaskit.atlassian.com/packages/design-system/onboarding)
|
|
42
|
+
*/
|
|
43
|
+
export default class OnboardingModal extends Component<ModalProps> {
|
|
44
|
+
headerComponent: (props: ModalProps) => "symbol" | "object" | "clipPath" | "filter" | "mask" | "marker" | "small" | "ruby" | "table" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "menu" | "menuitem" | "meta" | "meter" | "nav" | "noindex" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "s" | "samp" | "script" | "section" | "select" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | "template" | import("react").ComponentClass<HeaderComponentProps, any> | import("react").FunctionComponent<HeaderComponentProps> | (() => JSX.Element);
|
|
45
|
+
footerComponent: (props: ModalProps) => "symbol" | "object" | "clipPath" | "filter" | "mask" | "marker" | "small" | "ruby" | "table" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "menu" | "menuitem" | "meta" | "meter" | "nav" | "noindex" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "s" | "samp" | "script" | "section" | "select" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | "template" | import("react").ComponentClass<FooterComponentProps, any> | import("react").FunctionComponent<FooterComponentProps> | (() => JSX.Element | null);
|
|
46
|
+
render(): JSX.Element;
|
|
47
|
+
}
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React, { ComponentType, ReactNode, Ref } from 'react';
|
|
2
|
+
import { ThemeProp } from '@atlaskit/theme/components';
|
|
3
|
+
import { Actions } from '../types';
|
|
4
|
+
import { CardTokens } from './card';
|
|
5
|
+
interface SpotlightCardProps {
|
|
6
|
+
/**
|
|
7
|
+
* Buttons to render in the footer
|
|
8
|
+
*/
|
|
9
|
+
actions?: Actions;
|
|
10
|
+
/**
|
|
11
|
+
* An optional element rendered to the left of the footer actions
|
|
12
|
+
*/
|
|
13
|
+
actionsBeforeElement?: ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* The content of the card
|
|
16
|
+
*/
|
|
17
|
+
children?: ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* The container elements rendered by the component
|
|
20
|
+
*/
|
|
21
|
+
components?: {
|
|
22
|
+
Header?: ComponentType<any>;
|
|
23
|
+
Footer?: ComponentType<any>;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* The heading to be rendered above the body
|
|
27
|
+
*/
|
|
28
|
+
heading?: ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* An optional element rendered to the right of the heading
|
|
31
|
+
*/
|
|
32
|
+
headingAfterElement?: ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* The image src to render above the heading
|
|
35
|
+
*/
|
|
36
|
+
image?: string | ReactNode;
|
|
37
|
+
/**
|
|
38
|
+
* Removes elevation styles if set
|
|
39
|
+
*/
|
|
40
|
+
isFlat?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* The theme of the card
|
|
43
|
+
*/
|
|
44
|
+
theme?: ThemeProp<CardTokens, {}>;
|
|
45
|
+
/**
|
|
46
|
+
* Width of the card in pixels
|
|
47
|
+
*/
|
|
48
|
+
width?: number;
|
|
49
|
+
innerRef?: Ref<HTMLElement> | null;
|
|
50
|
+
/**
|
|
51
|
+
* A `testId` prop is provided for specified elements,
|
|
52
|
+
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
53
|
+
* serving as a hook for automated tests.
|
|
54
|
+
*/
|
|
55
|
+
testId?: string;
|
|
56
|
+
}
|
|
57
|
+
declare const _default: React.ForwardRefExoticComponent<SpotlightCardProps & React.RefAttributes<HTMLElement>>;
|
|
58
|
+
/**
|
|
59
|
+
* __Spotlight card__
|
|
60
|
+
*
|
|
61
|
+
* - [Examples](https://atlaskit.atlassian.com/packages/design-system/onboarding)
|
|
62
|
+
*/
|
|
63
|
+
export default _default;
|
|
@@ -2,29 +2,53 @@ import React, { ComponentType, ReactNode } from 'react';
|
|
|
2
2
|
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
3
|
import { Actions } from '../types';
|
|
4
4
|
export interface SpotlightDialogProps extends WithAnalyticsEventsProps {
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Buttons to render in the footer
|
|
7
|
+
*/
|
|
6
8
|
actions?: Actions;
|
|
7
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* An optional element rendered beside the footer actions
|
|
11
|
+
*/
|
|
8
12
|
actionsBeforeElement?: ReactNode;
|
|
9
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* The elements rendered in the modal
|
|
15
|
+
*/
|
|
10
16
|
children?: ReactNode;
|
|
11
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* Where the dialog should appear, relative to the contents of the children.
|
|
19
|
+
*/
|
|
12
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';
|
|
13
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* The width of the dialog in pixels. Min 160 - Max 600
|
|
23
|
+
*/
|
|
14
24
|
dialogWidth: number;
|
|
15
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Optional element rendered below the body
|
|
27
|
+
*/
|
|
16
28
|
footer?: ComponentType<any>;
|
|
17
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* Optional element rendered above the body
|
|
31
|
+
*/
|
|
18
32
|
header?: ComponentType<any>;
|
|
19
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Heading text rendered above the body
|
|
35
|
+
*/
|
|
20
36
|
heading?: string;
|
|
21
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* An optional element rendered to the right of the heading
|
|
39
|
+
*/
|
|
22
40
|
headingAfterElement?: ReactNode;
|
|
23
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* Path to the image
|
|
43
|
+
*/
|
|
24
44
|
image?: string;
|
|
25
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* The spotlight target node
|
|
47
|
+
*/
|
|
26
48
|
targetNode: HTMLElement;
|
|
27
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* js object containing the animation styles to apply to component
|
|
51
|
+
*/
|
|
28
52
|
animationStyles: Object;
|
|
29
53
|
/**
|
|
30
54
|
* A `testId` prop is provided for specified elements,
|
|
@@ -33,5 +57,5 @@ export interface SpotlightDialogProps extends WithAnalyticsEventsProps {
|
|
|
33
57
|
*/
|
|
34
58
|
testId?: string;
|
|
35
59
|
}
|
|
36
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Pick<SpotlightDialogProps, "
|
|
60
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Pick<SpotlightDialogProps, "children" | "footer" | "header" | "image" | "testId" | "actions" | "heading" | "targetNode" | "actionsBeforeElement" | "headingAfterElement" | "dialogPlacement" | "dialogWidth" | "animationStyles"> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "children" | "footer" | "header" | "image" | "testId" | "analyticsContext" | "actions" | "heading" | "key" | "targetNode" | "actionsBeforeElement" | "headingAfterElement" | "dialogPlacement" | "dialogWidth" | "animationStyles"> & React.RefAttributes<any>>;
|
|
37
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;
|
|
@@ -16,13 +16,29 @@ declare const SpotlightStateConsumer: React.Consumer<{
|
|
|
16
16
|
}>;
|
|
17
17
|
export { TargetConsumer };
|
|
18
18
|
export { SpotlightContext, SpotlightStateConsumer as SpotlightConsumer };
|
|
19
|
-
interface
|
|
20
|
-
/**
|
|
19
|
+
interface SpotlightManagerProps {
|
|
20
|
+
/**
|
|
21
|
+
* Boolean prop for toggling blanket transparency
|
|
22
|
+
*/
|
|
21
23
|
blanketIsTinted?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Typically the app, or a section of the app
|
|
26
|
+
*/
|
|
22
27
|
children: ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated
|
|
30
|
+
* Replaces the wrapping fragment with component
|
|
31
|
+
*/
|
|
23
32
|
component?: ElementType;
|
|
24
33
|
}
|
|
25
|
-
|
|
34
|
+
/**
|
|
35
|
+
* __Spotlight manager__
|
|
36
|
+
*
|
|
37
|
+
* Wraps usage of spotlight and manages progression through multiple spotlights.
|
|
38
|
+
*
|
|
39
|
+
* - [Examples](https://atlaskit.atlassian.com/packages/design-system/onboarding)
|
|
40
|
+
*/
|
|
41
|
+
export default class SpotlightManager extends PureComponent<SpotlightManagerProps, {
|
|
26
42
|
spotlightCount: number;
|
|
27
43
|
targets: {
|
|
28
44
|
[key: string]: HTMLElement | void;
|
|
@@ -39,10 +55,10 @@ export default class SpotlightManager extends PureComponent<Props, {
|
|
|
39
55
|
targetRef: (name: string) => (element: HTMLElement | void) => void;
|
|
40
56
|
spotlightOpen: () => void;
|
|
41
57
|
spotlightClose: () => void;
|
|
42
|
-
getStateProviderValue: (this: any, targets: any) => {
|
|
58
|
+
getStateProviderValue: import("memoize-one").MemoizedFn<(this: any, targets: any) => {
|
|
43
59
|
opened: () => void;
|
|
44
60
|
closed: () => void;
|
|
45
61
|
targets: any;
|
|
46
|
-
}
|
|
62
|
+
}>;
|
|
47
63
|
render(): JSX.Element;
|
|
48
64
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
* Wraps an element, allowing it to be targeted by a spotlight.
|
|
16
|
+
*
|
|
17
|
+
* - [Examples](https://atlaskit.atlassian.com/packages/design-system/onboarding)
|
|
18
|
+
*/
|
|
19
|
+
declare const SpotlightTarget: React.FC<SpotlightTargetProps>;
|
|
20
|
+
export default SpotlightTarget;
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
* Provides context used for fading animations.
|
|
20
|
+
*
|
|
21
|
+
* - [Examples](https://atlaskit.atlassian.com/packages/design-system/onboarding)
|
|
22
|
+
*/
|
|
23
|
+
declare class SpotlightTransition extends React.Component<SpotlightTransitionProps, State> {
|
|
24
|
+
static getDerivedStateFromProps(props: SpotlightTransitionProps, state: State): {
|
|
25
|
+
currentChildren: {} | null | undefined;
|
|
26
|
+
};
|
|
27
|
+
state: {
|
|
28
|
+
currentChildren: undefined;
|
|
29
|
+
};
|
|
30
|
+
onExited: () => void;
|
|
31
|
+
render(): JSX.Element;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* __Spotlight transition consumer__
|
|
35
|
+
*
|
|
36
|
+
* Used to consume the spotlight transition context through render props.
|
|
37
|
+
*
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
export declare const SpotlightTransitionConsumer: React.Consumer<SpotlightTransitionContextModel>;
|
|
41
|
+
export default SpotlightTransition;
|