@servicetitan/feature-spotlight 3.2.1 → 3.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/dist/components/feature-modal.js +2 -14
- package/dist/components/feature-modal.js.map +1 -1
- package/dist/components/feature-popover.js +2 -14
- package/dist/components/feature-popover.js.map +1 -1
- package/dist/components/feature-toast.js +2 -14
- package/dist/components/feature-toast.js.map +1 -1
- package/dist/feature-spotlight.stories.d.ts +20 -0
- package/dist/feature-spotlight.stories.d.ts.map +1 -0
- package/dist/feature-spotlight.stories.js +91 -0
- package/dist/feature-spotlight.stories.js.map +1 -0
- package/package.json +2 -2
- package/src/feature-spotlight.stories.tsx +117 -118
|
@@ -1,20 +1,8 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
2
|
import classNames from 'classnames';
|
|
14
3
|
import { Modal } from '@servicetitan/design-system';
|
|
15
4
|
import * as Styles from '../feature-spotlight.module.css';
|
|
16
|
-
export const FeatureModal = (
|
|
17
|
-
|
|
18
|
-
return _jsx(Modal, Object.assign({ className: classNames(Styles.featureModalHeader) }, rest));
|
|
5
|
+
export const FeatureModal = ({ ...rest }) => {
|
|
6
|
+
return _jsx(Modal, { className: classNames(Styles.featureModalHeader), ...rest });
|
|
19
7
|
};
|
|
20
8
|
//# sourceMappingURL=feature-modal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-modal.js","sourceRoot":"","sources":["../../src/components/feature-modal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"feature-modal.js","sourceRoot":"","sources":["../../src/components/feature-modal.tsx"],"names":[],"mappings":";AACA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,KAAK,EAAc,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,MAAM,MAAM,iCAAiC,CAAC;AAE1D,MAAM,CAAC,MAAM,YAAY,GAAmB,CAAC,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;IACxD,OAAO,KAAC,KAAK,IAAC,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,kBAAkB,CAAC,KAAM,IAAI,GAAI,CAAC;AACjF,CAAC,CAAC"}
|
|
@@ -1,20 +1,8 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
2
|
import classNames from 'classnames';
|
|
14
3
|
import { Popover } from '@servicetitan/design-system';
|
|
15
4
|
import * as Styles from '../feature-spotlight.module.css';
|
|
16
|
-
export const FeaturePopover = (
|
|
17
|
-
|
|
18
|
-
return (_jsxs(Popover, Object.assign({ className: classNames(Styles.featurePopover), caret: { show: true, className: Styles.featurePopoverCaret }, padding: "m" }, rest, { children: [header && (_jsx(Popover.Header, { className: classNames(Styles.featurePopoverHeader), children: header })), children, footer && (_jsx(Popover.Footer, { className: classNames(Styles.featurePopoverFooter), align: "right", children: footer }))] })));
|
|
5
|
+
export const FeaturePopover = ({ children, footer, header, ...rest }) => {
|
|
6
|
+
return (_jsxs(Popover, { className: classNames(Styles.featurePopover), caret: { show: true, className: Styles.featurePopoverCaret }, padding: "m", ...rest, children: [header && (_jsx(Popover.Header, { className: classNames(Styles.featurePopoverHeader), children: header })), children, footer && (_jsx(Popover.Footer, { className: classNames(Styles.featurePopoverFooter), align: "right", children: footer }))] }));
|
|
19
7
|
};
|
|
20
8
|
//# sourceMappingURL=feature-popover.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-popover.js","sourceRoot":"","sources":["../../src/components/feature-popover.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"feature-popover.js","sourceRoot":"","sources":["../../src/components/feature-popover.tsx"],"names":[],"mappings":";AACA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,OAAO,EAAgB,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,MAAM,MAAM,iCAAiC,CAAC;AAQ1D,MAAM,CAAC,MAAM,cAAc,GAA4B,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;IAC7F,OAAO,CACH,MAAC,OAAO,IACJ,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,cAAc,CAAC,EAC5C,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,mBAAmB,EAAE,EAC5D,OAAO,EAAC,GAAG,KACP,IAAI,aAEP,MAAM,IAAI,CACP,KAAC,OAAO,CAAC,MAAM,IAAC,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,oBAAoB,CAAC,YAC7D,MAAM,GACM,CACpB,EACA,QAAQ,EACR,MAAM,IAAI,CACP,KAAC,OAAO,CAAC,MAAM,IAAC,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,oBAAoB,CAAC,EAAE,KAAK,EAAC,OAAO,YAC5E,MAAM,GACM,CACpB,IACK,CACb,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,20 +1,8 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
2
|
import classNames from 'classnames';
|
|
14
3
|
import { Toast } from '@servicetitan/design-system';
|
|
15
4
|
import * as Styles from '../feature-spotlight.module.css';
|
|
16
|
-
export const FeatureToast = (
|
|
17
|
-
|
|
18
|
-
return (_jsx(Toast, Object.assign({ className: classNames(Styles.featureToast, center && Styles.featureToastCenter) }, rest)));
|
|
5
|
+
export const FeatureToast = ({ center, ...rest }) => {
|
|
6
|
+
return (_jsx(Toast, { className: classNames(Styles.featureToast, center && Styles.featureToastCenter), ...rest }));
|
|
19
7
|
};
|
|
20
8
|
//# sourceMappingURL=feature-toast.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-toast.js","sourceRoot":"","sources":["../../src/components/feature-toast.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"feature-toast.js","sourceRoot":"","sources":["../../src/components/feature-toast.tsx"],"names":[],"mappings":";AACA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,KAAK,EAAc,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,MAAM,MAAM,iCAAiC,CAAC;AAM1D,MAAM,CAAC,MAAM,YAAY,GAA0B,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;IACvE,OAAO,CACH,KAAC,KAAK,IACF,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,IAAI,MAAM,CAAC,kBAAkB,CAAC,KAC3E,IAAI,GACV,CACL,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
title: string;
|
|
3
|
+
};
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Popover: () => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const modal: {
|
|
7
|
+
(args: any): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
args: {
|
|
9
|
+
open: boolean;
|
|
10
|
+
title: string;
|
|
11
|
+
closable: boolean;
|
|
12
|
+
onClose: () => void;
|
|
13
|
+
scrollable: boolean;
|
|
14
|
+
children: import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
footer: import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export declare const toast: () => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare const tour: () => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
//# sourceMappingURL=feature-spotlight.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature-spotlight.stories.d.ts","sourceRoot":"","sources":["../src/feature-spotlight.stories.tsx"],"names":[],"mappings":";;;AAoCA,wBAEE;AAEF,eAAO,MAAM,OAAO,+CA6GnB,CAAC;AAIF,eAAO,MAAM,KAAK;WAAU,GAAG;;;;;;;;;;CAA+B,CAAC;AA4B/D,eAAO,MAAM,KAAK,+CAkEjB,CAAC;AAqGF,eAAO,MAAM,IAAI,+CA6BhB,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// eslint-disable-next-line spaced-comment, @typescript-eslint/triple-slash-reference
|
|
3
|
+
/// <reference path="../../../storybook-static/index.d.ts" />
|
|
4
|
+
import { memo, useCallback } from 'react';
|
|
5
|
+
import { BodyText, Stack, Button, ButtonGroup, Link, Checkbox, Toast, Frame, Headline, Page, Layout, Card, } from '@servicetitan/design-system';
|
|
6
|
+
import { FeaturePopover } from './components/feature-popover';
|
|
7
|
+
import { FeatureModal } from './components/feature-modal';
|
|
8
|
+
import { FeatureToast } from './components/feature-toast';
|
|
9
|
+
import { TourPopover } from './components/tour-popover';
|
|
10
|
+
import geofence from '../../../storybook-static/geofence.png';
|
|
11
|
+
import dashboard from '../../../storybook-static/dashboard.png';
|
|
12
|
+
import { TourProvider, useTour } from '@reactour/tour';
|
|
13
|
+
const image = {
|
|
14
|
+
src: geofence,
|
|
15
|
+
alt: 'alt text description',
|
|
16
|
+
};
|
|
17
|
+
const imageDashboard = {
|
|
18
|
+
src: dashboard,
|
|
19
|
+
alt: 'alt text description',
|
|
20
|
+
};
|
|
21
|
+
export default {
|
|
22
|
+
title: 'Feature Spotlight/Demos',
|
|
23
|
+
};
|
|
24
|
+
export const Popover = () => (_jsxs(Stack, { direction: "column", spacing: 5, alignItems: "center", justifyContent: "center", className: "p-4", style: { height: '800px' }, children: [_jsx(FeaturePopover, { trigger: _jsx(Button, { inactive: true, children: "Top" }), open: true, direction: "t", header: "\uD83D\uDC4B Bills has moved", footer: _jsx(ButtonGroup, { children: _jsx(Button, { small: true, primary: true, children: "Take me there" }) }), footerAlign: "right", offset: { distance: 200 }, children: _jsxs(Stack, { spacing: 1, direction: "column", children: [_jsxs(BodyText, { size: "small", children: ["Bills has a new home in Accounting. It is still the same feature you know and love except now something goes here.", _jsx(Link, { primary: true, children: "Learn More" })] }), _jsx(Checkbox, { size: "small", label: "Don\u2019t show me again" })] }) }), _jsx(FeaturePopover, { trigger: _jsx(Button, { inactive: true, children: "Right" }), open: true, direction: "r", header: "\uD83D\uDC4B Bills has moved", footer: _jsx(ButtonGroup, { children: _jsx(Button, { small: true, primary: true, children: "Take me there" }) }), footerAlign: "right", offset: { distance: 200 }, children: _jsxs(Stack, { spacing: 1, direction: "column", children: [_jsxs(BodyText, { size: "small", children: ["Bills has a new home in Accounting. It is still the same feature you know and love except now something goes here.", _jsx(Link, { primary: true, children: "Learn More" })] }), _jsx(Checkbox, { size: "small", label: "Don\u2019t show me again" })] }) }), _jsx(FeaturePopover, { trigger: _jsx(Button, { inactive: true, children: "Left" }), open: true, direction: "l", header: "\uD83D\uDC4B Bills has moved", footer: _jsx(ButtonGroup, { children: _jsx(Button, { small: true, primary: true, children: "Take me there" }) }), footerAlign: "right", offset: { distance: 200 }, children: _jsxs(Stack, { spacing: 1, direction: "column", children: [_jsxs(BodyText, { size: "small", children: ["Bills has a new home in Accounting. It is still the same feature you know and love except now something goes here.", _jsx(Link, { primary: true, children: "Learn More" })] }), _jsx(Checkbox, { size: "small", label: "Don\u2019t show me again" })] }) }), _jsx(FeaturePopover, { trigger: _jsx(Button, { inactive: true, children: "Bottom" }), open: true, direction: "b", header: "\uD83D\uDC4B Bills has moved", footer: _jsx(ButtonGroup, { children: _jsx(Button, { small: true, primary: true, children: "Take me there" }) }), footerAlign: "right", offset: { distance: 200 }, children: _jsxs(Stack, { spacing: 1, direction: "column", children: [_jsxs(BodyText, { size: "small", children: ["Bills has a new home in Accounting. It is still the same feature you know and love except now something goes here.", _jsx(Link, { primary: true, children: "Learn More" })] }), _jsx(Checkbox, { size: "small", label: "Don\u2019t show me again" })] }) })] }));
|
|
25
|
+
const closeMethod = () => alert('closing');
|
|
26
|
+
export const modal = (args) => _jsx(FeatureModal, { ...args });
|
|
27
|
+
modal.args = {
|
|
28
|
+
open: true,
|
|
29
|
+
title: 'FleetPro Has Launched!',
|
|
30
|
+
closable: true,
|
|
31
|
+
onClose: closeMethod,
|
|
32
|
+
scrollable: true,
|
|
33
|
+
children: (_jsxs(Stack, { direction: "column", alignItems: "center", spacing: 4, children: [_jsx("img", { src: image.src, alt: image.alt, className: "p-t-4" }), _jsxs(BodyText, { size: "large", className: "ta-center", children: ["We\u2019re excited to announce that FleetPro is now live in ServiceTitan! With FleetPro, you can manage and track your company\u2019s vehicles all in one place. Add FleetPro to your existing tenant now for $100 /mo or view the", ' ', _jsx(Link, { primary: true, children: "Knowledge Base" }), " to learn more."] })] })),
|
|
34
|
+
footer: (_jsxs(ButtonGroup, { children: [_jsx(Button, { onClick: closeMethod, children: "No, Thank You" }), _jsx(Button, { primary: true, onClick: closeMethod, children: "Add FleetPro Now" })] })),
|
|
35
|
+
};
|
|
36
|
+
export const toast = () => {
|
|
37
|
+
return (_jsx(Frame, { children: _jsxs(Toast.Group, { children: [_jsx(FeatureToast, { title: "\u2728 This page has a new look and feel", onPrimaryActionClick: () => { }, primaryActionName: "Got it", onSecondaryActionClick: () => { }, secondaryActionName: "Revert to Old View", onClose: closeMethod, portal: false, children: _jsx(BodyText, { children: "We\u2019ve updated this page with some cool stuff...but if you don\u2019t like it you can go back to the old one for now. This can be changed later in settings." }) }), _jsx(Toast, { status: "info", title: "Ordinary toast", portal: false, children: "In progress" }), _jsx(FeatureToast, { center: true, title: "Dashboards", onPrimaryActionClick: () => { }, primaryActionName: "Learn more", onClose: closeMethod, portal: false, children: _jsxs(Stack, { direction: "column", spacing: 2, alignItems: "center", children: [_jsx("img", { src: imageDashboard.src, alt: image.alt, width: "166px", className: "p-t-1" }), _jsx(BodyText, { children: "We noticed you don\u2019t really use this thing, but did you know it could increase your profit margins by 10%?" })] }) }), _jsx(FeatureToast, { center: true, title: "Slightly longer line that wraps to a second", onPrimaryActionClick: () => { }, primaryActionName: "Learn More", onClose: closeMethod, portal: false, children: _jsxs(Stack, { direction: "column", spacing: 2, alignItems: "center", children: [_jsx("img", { src: imageDashboard.src, alt: image.alt, width: "166px", className: "p-t-1" }), _jsx(BodyText, { children: "We noticed you don\u2019t really use this thing, but did you know it could increase your profit margins by 10%?" })] }) })] }) }));
|
|
38
|
+
};
|
|
39
|
+
const InternalTourControls = memo(({ children, headerText }) => {
|
|
40
|
+
const { setCurrentStep, currentStep, steps, setIsOpen } = useTour();
|
|
41
|
+
const handleClose = useCallback(() => {
|
|
42
|
+
setIsOpen(false);
|
|
43
|
+
}, [setIsOpen]);
|
|
44
|
+
const handleNext = useCallback(() => {
|
|
45
|
+
if (currentStep === steps.length - 1) {
|
|
46
|
+
handleClose();
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
setCurrentStep(currentStep + 1);
|
|
50
|
+
}
|
|
51
|
+
}, [currentStep, handleClose, setCurrentStep, steps.length]);
|
|
52
|
+
return (_jsx(TourPopover, { currentStep: currentStep, onClose: handleClose, onNext: handleNext, totalStepCount: steps.length, headerText: headerText, children: children }));
|
|
53
|
+
});
|
|
54
|
+
const ReactTour = ({ children }) => {
|
|
55
|
+
const steps = [
|
|
56
|
+
{
|
|
57
|
+
selector: '.step-1',
|
|
58
|
+
content: (_jsxs(InternalTourControls, { headerText: "\u26A0\uFE0F This is now a required field", children: [_jsx(BodyText, { size: "small", className: "m-b-2", children: "You must now select a date range beforehand because of reasons." }), _jsx(BodyText, { size: "small", children: _jsx(Link, { primary: true, children: "Learn More" }) })] })),
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
selector: '.step-2',
|
|
62
|
+
content: _jsx(InternalTourControls, { headerText: "Give it up for step 2" }),
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
selector: '.step-3',
|
|
66
|
+
content: (_jsx(InternalTourControls, { children: "This is the final step with just body text." })),
|
|
67
|
+
},
|
|
68
|
+
];
|
|
69
|
+
const styles = {
|
|
70
|
+
popover: (base) => ({
|
|
71
|
+
...base,
|
|
72
|
+
borderRadius: '6px',
|
|
73
|
+
padding: 'inherit',
|
|
74
|
+
margin: 'inherit',
|
|
75
|
+
maxWidth: 'inherit',
|
|
76
|
+
}),
|
|
77
|
+
};
|
|
78
|
+
return (_jsx(TourProvider, { defaultOpen: true, steps: steps, showBadge: false, showPrevNextButtons: false, showCloseButton: false, showNavigation: false, showDots: false, styles: styles, children: children }));
|
|
79
|
+
};
|
|
80
|
+
const StartTourButton = () => {
|
|
81
|
+
const { setIsOpen, setCurrentStep } = useTour();
|
|
82
|
+
const handleTourClick = useCallback(() => {
|
|
83
|
+
setCurrentStep(0);
|
|
84
|
+
setIsOpen(true);
|
|
85
|
+
}, [setCurrentStep, setIsOpen]);
|
|
86
|
+
return _jsx(Button, { onClick: handleTourClick, children: "Start Tour" });
|
|
87
|
+
};
|
|
88
|
+
export const tour = () => {
|
|
89
|
+
return (_jsx(Frame, { children: _jsx(ReactTour, { children: _jsx(Page, { header: _jsxs(Stack, { justifyContent: "space-between", alignItems: "center", children: [_jsx(Headline, { size: "large", className: "step-3", children: "Page Title" }), _jsx(StartTourButton, {})] }), children: _jsxs(Layout, { type: "3Col", children: [_jsx(Layout.Section, { children: _jsx(Card, { className: "step-1", children: "Card 1" }) }), _jsx(Layout.Section, { children: _jsx(Card, { className: "step-2", children: "Card 2" }) }), _jsx(Layout.Section, { children: _jsx(Card, { children: "Card 3" }) })] }) }) }) }));
|
|
90
|
+
};
|
|
91
|
+
//# sourceMappingURL=feature-spotlight.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature-spotlight.stories.js","sourceRoot":"","sources":["../src/feature-spotlight.stories.tsx"],"names":[],"mappings":";AAAA,qFAAqF;AACrF,6DAA6D;AAC7D,OAAO,EAAoC,IAAI,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC5E,OAAO,EACH,QAAQ,EACR,KAAK,EACL,MAAM,EACN,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,KAAK,EACL,QAAQ,EACR,IAA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,CAAC;IAEhC,OAAO,KAAC,MAAM,IAAC,OAAO,EAAE,eAAe,2BAAqB,CAAC;AACjE,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,EAAE;IACrB,OAAO,CACH,KAAC,KAAK,cACF,KAAC,SAAS,cACN,KAAC,IAAI,IACD,MAAM,EACF,MAAC,KAAK,IAAC,cAAc,EAAC,eAAe,EAAC,UAAU,EAAC,QAAQ,aACrD,KAAC,QAAQ,IAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,QAAQ,2BAE9B,EACX,KAAC,eAAe,KAAG,IACf,YAGZ,MAAC,MAAM,IAAC,IAAI,EAAC,MAAM,aACf,KAAC,MAAM,CAAC,OAAO,cACX,KAAC,IAAI,IAAC,SAAS,EAAC,QAAQ,uBAAc,GACzB,EACjB,KAAC,MAAM,CAAC,OAAO,cACX,KAAC,IAAI,IAAC,SAAS,EAAC,QAAQ,uBAAc,GACzB,EACjB,KAAC,MAAM,CAAC,OAAO,cACX,KAAC,IAAI,yBAAc,GACN,IACZ,GACN,GACC,GACR,CACX,CAAC;AACN,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/feature-spotlight",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "Provides specific styles to Anvil components to highlight a feature",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"cli": {
|
|
38
38
|
"webpack": false
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "c1d645b3e5643ba5a50e4898d9f786212334792a"
|
|
41
41
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
// eslint-disable-next-line spaced-comment, @typescript-eslint/triple-slash-reference
|
|
1
2
|
/// <reference path="../../../storybook-static/index.d.ts" />
|
|
2
|
-
import
|
|
3
|
+
import { FC, PropsWithChildren, ReactNode, memo, useCallback } from 'react';
|
|
3
4
|
import {
|
|
4
5
|
BodyText,
|
|
5
6
|
Stack,
|
|
@@ -38,116 +39,114 @@ export default {
|
|
|
38
39
|
};
|
|
39
40
|
|
|
40
41
|
export const Popover = () => (
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
<Stack
|
|
43
|
+
direction="column"
|
|
44
|
+
spacing={5}
|
|
45
|
+
alignItems="center"
|
|
46
|
+
justifyContent="center"
|
|
47
|
+
className="p-4"
|
|
48
|
+
style={{ height: '800px' }}
|
|
49
|
+
>
|
|
50
|
+
<FeaturePopover
|
|
51
|
+
trigger={<Button inactive>Top</Button>}
|
|
52
|
+
open
|
|
53
|
+
direction="t"
|
|
54
|
+
header="👋 Bills has moved"
|
|
55
|
+
footer={
|
|
56
|
+
<ButtonGroup>
|
|
57
|
+
<Button small primary>
|
|
58
|
+
Take me there
|
|
59
|
+
</Button>
|
|
60
|
+
</ButtonGroup>
|
|
61
|
+
}
|
|
62
|
+
footerAlign="right"
|
|
63
|
+
offset={{ distance: 200 }}
|
|
49
64
|
>
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
</Button>
|
|
60
|
-
</ButtonGroup>
|
|
61
|
-
}
|
|
62
|
-
footerAlign="right"
|
|
63
|
-
offset={{ distance: 200 }}
|
|
64
|
-
>
|
|
65
|
-
<Stack spacing={1} direction="column">
|
|
66
|
-
<BodyText size="small">
|
|
67
|
-
Bills has a new home in Accounting. It is still the same feature you know
|
|
68
|
-
and love except now something goes here.
|
|
69
|
-
<Link primary>Learn More</Link>
|
|
70
|
-
</BodyText>
|
|
71
|
-
<Checkbox size="small" label="Don’t show me again" />
|
|
72
|
-
</Stack>
|
|
73
|
-
</FeaturePopover>
|
|
65
|
+
<Stack spacing={1} direction="column">
|
|
66
|
+
<BodyText size="small">
|
|
67
|
+
Bills has a new home in Accounting. It is still the same feature you know and
|
|
68
|
+
love except now something goes here.
|
|
69
|
+
<Link primary>Learn More</Link>
|
|
70
|
+
</BodyText>
|
|
71
|
+
<Checkbox size="small" label="Don’t show me again" />
|
|
72
|
+
</Stack>
|
|
73
|
+
</FeaturePopover>
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
75
|
+
<FeaturePopover
|
|
76
|
+
trigger={<Button inactive>Right</Button>}
|
|
77
|
+
open
|
|
78
|
+
direction="r"
|
|
79
|
+
header="👋 Bills has moved"
|
|
80
|
+
footer={
|
|
81
|
+
<ButtonGroup>
|
|
82
|
+
<Button small primary>
|
|
83
|
+
Take me there
|
|
84
|
+
</Button>
|
|
85
|
+
</ButtonGroup>
|
|
86
|
+
}
|
|
87
|
+
footerAlign="right"
|
|
88
|
+
offset={{ distance: 200 }}
|
|
89
|
+
>
|
|
90
|
+
<Stack spacing={1} direction="column">
|
|
91
|
+
<BodyText size="small">
|
|
92
|
+
Bills has a new home in Accounting. It is still the same feature you know and
|
|
93
|
+
love except now something goes here.
|
|
94
|
+
<Link primary>Learn More</Link>
|
|
95
|
+
</BodyText>
|
|
96
|
+
<Checkbox size="small" label="Don’t show me again" />
|
|
97
|
+
</Stack>
|
|
98
|
+
</FeaturePopover>
|
|
99
99
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
100
|
+
<FeaturePopover
|
|
101
|
+
trigger={<Button inactive>Left</Button>}
|
|
102
|
+
open
|
|
103
|
+
direction="l"
|
|
104
|
+
header="👋 Bills has moved"
|
|
105
|
+
footer={
|
|
106
|
+
<ButtonGroup>
|
|
107
|
+
<Button small primary>
|
|
108
|
+
Take me there
|
|
109
|
+
</Button>
|
|
110
|
+
</ButtonGroup>
|
|
111
|
+
}
|
|
112
|
+
footerAlign="right"
|
|
113
|
+
offset={{ distance: 200 }}
|
|
114
|
+
>
|
|
115
|
+
<Stack spacing={1} direction="column">
|
|
116
|
+
<BodyText size="small">
|
|
117
|
+
Bills has a new home in Accounting. It is still the same feature you know and
|
|
118
|
+
love except now something goes here.
|
|
119
|
+
<Link primary>Learn More</Link>
|
|
120
|
+
</BodyText>
|
|
121
|
+
<Checkbox size="small" label="Don’t show me again" />
|
|
122
|
+
</Stack>
|
|
123
|
+
</FeaturePopover>
|
|
124
124
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
</React.Fragment>
|
|
125
|
+
<FeaturePopover
|
|
126
|
+
trigger={<Button inactive>Bottom</Button>}
|
|
127
|
+
open
|
|
128
|
+
direction="b"
|
|
129
|
+
header="👋 Bills has moved"
|
|
130
|
+
footer={
|
|
131
|
+
<ButtonGroup>
|
|
132
|
+
<Button small primary>
|
|
133
|
+
Take me there
|
|
134
|
+
</Button>
|
|
135
|
+
</ButtonGroup>
|
|
136
|
+
}
|
|
137
|
+
footerAlign="right"
|
|
138
|
+
offset={{ distance: 200 }}
|
|
139
|
+
>
|
|
140
|
+
<Stack spacing={1} direction="column">
|
|
141
|
+
<BodyText size="small">
|
|
142
|
+
Bills has a new home in Accounting. It is still the same feature you know and
|
|
143
|
+
love except now something goes here.
|
|
144
|
+
<Link primary>Learn More</Link>
|
|
145
|
+
</BodyText>
|
|
146
|
+
<Checkbox size="small" label="Don’t show me again" />
|
|
147
|
+
</Stack>
|
|
148
|
+
</FeaturePopover>
|
|
149
|
+
</Stack>
|
|
151
150
|
);
|
|
152
151
|
|
|
153
152
|
const closeMethod = () => alert('closing');
|
|
@@ -249,18 +248,18 @@ export const toast = () => {
|
|
|
249
248
|
};
|
|
250
249
|
|
|
251
250
|
interface InternalTourProps {
|
|
252
|
-
children?:
|
|
251
|
+
children?: ReactNode;
|
|
253
252
|
headerText?: string;
|
|
254
253
|
}
|
|
255
254
|
|
|
256
|
-
const InternalTourControls: FC<InternalTourProps> =
|
|
255
|
+
const InternalTourControls: FC<InternalTourProps> = memo(({ children, headerText }) => {
|
|
257
256
|
const { setCurrentStep, currentStep, steps, setIsOpen } = useTour();
|
|
258
257
|
|
|
259
|
-
const handleClose =
|
|
258
|
+
const handleClose = useCallback(() => {
|
|
260
259
|
setIsOpen(false);
|
|
261
260
|
}, [setIsOpen]);
|
|
262
261
|
|
|
263
|
-
const handleNext =
|
|
262
|
+
const handleNext = useCallback(() => {
|
|
264
263
|
if (currentStep === steps.length - 1) {
|
|
265
264
|
handleClose();
|
|
266
265
|
} else {
|
|
@@ -281,7 +280,7 @@ const InternalTourControls: FC<InternalTourProps> = React.memo(({ children, head
|
|
|
281
280
|
);
|
|
282
281
|
});
|
|
283
282
|
|
|
284
|
-
const ReactTour: FC = ({ children }) => {
|
|
283
|
+
const ReactTour: FC<PropsWithChildren> = ({ children }) => {
|
|
285
284
|
const steps: StepType[] = [
|
|
286
285
|
{
|
|
287
286
|
selector: '.step-1',
|
|
@@ -298,9 +297,7 @@ const ReactTour: FC = ({ children }) => {
|
|
|
298
297
|
},
|
|
299
298
|
{
|
|
300
299
|
selector: '.step-2',
|
|
301
|
-
content:
|
|
302
|
-
<InternalTourControls headerText="Give it up for step 2"></InternalTourControls>
|
|
303
|
-
),
|
|
300
|
+
content: <InternalTourControls headerText="Give it up for step 2" />,
|
|
304
301
|
},
|
|
305
302
|
{
|
|
306
303
|
selector: '.step-3',
|
|
@@ -341,7 +338,7 @@ const ReactTour: FC = ({ children }) => {
|
|
|
341
338
|
const StartTourButton = () => {
|
|
342
339
|
const { setIsOpen, setCurrentStep } = useTour();
|
|
343
340
|
|
|
344
|
-
const handleTourClick =
|
|
341
|
+
const handleTourClick = useCallback(() => {
|
|
345
342
|
setCurrentStep(0);
|
|
346
343
|
setIsOpen(true);
|
|
347
344
|
}, [setCurrentStep, setIsOpen]);
|
|
@@ -352,11 +349,13 @@ const StartTourButton = () => {
|
|
|
352
349
|
export const tour = () => {
|
|
353
350
|
return (
|
|
354
351
|
<Frame>
|
|
355
|
-
|
|
352
|
+
<ReactTour>
|
|
356
353
|
<Page
|
|
357
354
|
header={
|
|
358
355
|
<Stack justifyContent="space-between" alignItems="center">
|
|
359
|
-
<Headline size="large" className="step-3">
|
|
356
|
+
<Headline size="large" className="step-3">
|
|
357
|
+
Page Title
|
|
358
|
+
</Headline>
|
|
360
359
|
<StartTourButton />
|
|
361
360
|
</Stack>
|
|
362
361
|
}
|