@servicetitan/feature-spotlight 3.2.1 → 3.4.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.
@@ -1,20 +1,12 @@
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 = (_a) => {
17
- var rest = __rest(_a, []);
18
- return _jsx(Modal, Object.assign({ className: classNames(Styles.featureModalHeader) }, rest));
5
+ export const FeatureModal = ({ ...rest })=>{
6
+ return /*#__PURE__*/ _jsx(Modal, {
7
+ className: classNames(Styles.featureModalHeader),
8
+ ...rest
9
+ });
19
10
  };
11
+
20
12
  //# sourceMappingURL=feature-modal.js.map
@@ -1 +1 @@
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,EAAW,EAAE,EAAE;QAAV,IAAI,cAAT,EAAW,CAAF;IAClD,OAAO,KAAC,KAAK,kBAAC,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,kBAAkB,CAAC,IAAM,IAAI,EAAI,CAAC;AACjF,CAAC,CAAC"}
1
+ {"version":3,"sources":["../../src/components/feature-modal.tsx"],"sourcesContent":["import { FC } from 'react';\nimport classNames from 'classnames';\nimport { Modal, ModalProps } from '@servicetitan/design-system';\nimport * as Styles from '../feature-spotlight.module.css';\n\nexport const FeatureModal: FC<ModalProps> = ({ ...rest }) => {\n return <Modal className={classNames(Styles.featureModalHeader)} {...rest} />;\n};\n"],"names":["classNames","Modal","Styles","FeatureModal","rest","className","featureModalHeader"],"mappings":";AACA,OAAOA,gBAAgB,aAAa;AACpC,SAASC,KAAK,QAAoB,8BAA8B;AAChE,YAAYC,YAAY,kCAAkC;AAE1D,OAAO,MAAMC,eAA+B,CAAC,EAAE,GAAGC,MAAM;IACpD,qBAAO,KAACH;QAAMI,WAAWL,WAAWE,OAAOI,kBAAkB;QAAI,GAAGF,IAAI;;AAC5E,EAAE"}
@@ -1,20 +1,29 @@
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 = (_a) => {
17
- var { children, footer, header } = _a, rest = __rest(_a, ["children", "footer", "header"]);
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 /*#__PURE__*/ _jsxs(Popover, {
7
+ className: classNames(Styles.featurePopover),
8
+ caret: {
9
+ show: true,
10
+ className: Styles.featurePopoverCaret
11
+ },
12
+ padding: "m",
13
+ ...rest,
14
+ children: [
15
+ header && /*#__PURE__*/ _jsx(Popover.Header, {
16
+ className: classNames(Styles.featurePopoverHeader),
17
+ children: header
18
+ }),
19
+ children,
20
+ footer && /*#__PURE__*/ _jsx(Popover.Footer, {
21
+ className: classNames(Styles.featurePopoverFooter),
22
+ align: "right",
23
+ children: footer
24
+ })
25
+ ]
26
+ });
19
27
  };
28
+
20
29
  //# sourceMappingURL=feature-popover.js.map
@@ -1 +1 @@
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,EAAqC,EAAE,EAAE;QAAzC,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAW,EAAN,IAAI,cAAnC,gCAAqC,CAAF;IACvF,OAAO,CACH,MAAC,OAAO,kBACJ,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,IACP,IAAI,eAEP,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,KACK,CACb,CAAC;AACN,CAAC,CAAC"}
1
+ {"version":3,"sources":["../../src/components/feature-popover.tsx"],"sourcesContent":["import { FC } from 'react';\nimport classNames from 'classnames';\nimport { Popover, PopoverProps } from '@servicetitan/design-system';\nimport * as Styles from '../feature-spotlight.module.css';\n\nexport interface FeaturePopoverProps extends PopoverProps {\n footer?: PopoverProps['footer'];\n header?: PopoverProps['header'];\n children?: PopoverProps['children'];\n}\n\nexport const FeaturePopover: FC<FeaturePopoverProps> = ({ children, footer, header, ...rest }) => {\n return (\n <Popover\n className={classNames(Styles.featurePopover)}\n caret={{ show: true, className: Styles.featurePopoverCaret }}\n padding=\"m\"\n {...rest}\n >\n {header && (\n <Popover.Header className={classNames(Styles.featurePopoverHeader)}>\n {header}\n </Popover.Header>\n )}\n {children}\n {footer && (\n <Popover.Footer className={classNames(Styles.featurePopoverFooter)} align=\"right\">\n {footer}\n </Popover.Footer>\n )}\n </Popover>\n );\n};\n"],"names":["classNames","Popover","Styles","FeaturePopover","children","footer","header","rest","className","featurePopover","caret","show","featurePopoverCaret","padding","Header","featurePopoverHeader","Footer","featurePopoverFooter","align"],"mappings":";AACA,OAAOA,gBAAgB,aAAa;AACpC,SAASC,OAAO,QAAsB,8BAA8B;AACpE,YAAYC,YAAY,kCAAkC;AAQ1D,OAAO,MAAMC,iBAA0C,CAAC,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,MAAM,EAAE,GAAGC,MAAM;IACzF,qBACI,MAACN;QACGO,WAAWR,WAAWE,OAAOO,cAAc;QAC3CC,OAAO;YAAEC,MAAM;YAAMH,WAAWN,OAAOU,mBAAmB;QAAC;QAC3DC,SAAQ;QACP,GAAGN,IAAI;;YAEPD,wBACG,KAACL,QAAQa,MAAM;gBAACN,WAAWR,WAAWE,OAAOa,oBAAoB;0BAC5DT;;YAGRF;YACAC,wBACG,KAACJ,QAAQe,MAAM;gBAACR,WAAWR,WAAWE,OAAOe,oBAAoB;gBAAGC,OAAM;0BACrEb;;;;AAKrB,EAAE"}
@@ -1,20 +1,12 @@
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 = (_a) => {
17
- var { center } = _a, rest = __rest(_a, ["center"]);
18
- return (_jsx(Toast, Object.assign({ className: classNames(Styles.featureToast, center && Styles.featureToastCenter) }, rest)));
5
+ export const FeatureToast = ({ center, ...rest })=>{
6
+ return /*#__PURE__*/ _jsx(Toast, {
7
+ className: classNames(Styles.featureToast, center && Styles.featureToastCenter),
8
+ ...rest
9
+ });
19
10
  };
11
+
20
12
  //# sourceMappingURL=feature-toast.js.map
@@ -1 +1 @@
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,EAAmB,EAAE,EAAE;QAAvB,EAAE,MAAM,OAAW,EAAN,IAAI,cAAjB,UAAmB,CAAF;IACjE,OAAO,CACH,KAAC,KAAK,kBACF,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,IAAI,MAAM,CAAC,kBAAkB,CAAC,IAC3E,IAAI,EACV,CACL,CAAC;AACN,CAAC,CAAC"}
1
+ {"version":3,"sources":["../../src/components/feature-toast.tsx"],"sourcesContent":["import { FC } from 'react';\nimport classNames from 'classnames';\nimport { Toast, ToastProps } from '@servicetitan/design-system';\nimport * as Styles from '../feature-spotlight.module.css';\n\nexport interface FeatureToastProps extends ToastProps {\n center?: boolean;\n}\n\nexport const FeatureToast: FC<FeatureToastProps> = ({ center, ...rest }) => {\n return (\n <Toast\n className={classNames(Styles.featureToast, center && Styles.featureToastCenter)}\n {...rest}\n />\n );\n};\n"],"names":["classNames","Toast","Styles","FeatureToast","center","rest","className","featureToast","featureToastCenter"],"mappings":";AACA,OAAOA,gBAAgB,aAAa;AACpC,SAASC,KAAK,QAAoB,8BAA8B;AAChE,YAAYC,YAAY,kCAAkC;AAM1D,OAAO,MAAMC,eAAsC,CAAC,EAAEC,MAAM,EAAE,GAAGC,MAAM;IACnE,qBACI,KAACJ;QACGK,WAAWN,WAAWE,OAAOK,YAAY,EAAEH,UAAUF,OAAOM,kBAAkB;QAC7E,GAAGH,IAAI;;AAGpB,EAAE"}
@@ -1,8 +1,54 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import classNames from 'classnames';
3
- import { Stack, Headline, BodyText, Button, ButtonGroup, } from '@servicetitan/design-system';
3
+ import { Stack, Headline, BodyText, Button, ButtonGroup } from '@servicetitan/design-system';
4
4
  import * as Styles from '../feature-spotlight.module.css';
5
- export const TourPopover = ({ children, currentStep = 1, endText = 'Close', headerText, nextText = 'Next', onClose, onNext, totalStepCount = 1, }) => {
6
- return (_jsx(Stack, { direction: "column", className: classNames(Styles.featurePopover, 'Popper__body Popover__body Popover__body--open Popover--w-s p-x-3 p-y-2'), children: _jsxs(Stack.Item, { className: "m-t-half", children: [headerText && _jsx(Headline, { size: "small", children: headerText }), children, _jsxs(Stack, { direction: "row", alignItems: "center", justifyContent: "space-between", className: "m-t-2 m-b-half", children: [_jsxs(BodyText, { subdued: true, children: [currentStep + 1, "/", totalStepCount] }), _jsxs(ButtonGroup, { children: [currentStep !== totalStepCount - 1 && (_jsx(Button, { fill: "subtle", size: "small", onClick: onClose, children: "Skip" })), _jsx(Button, { size: "small", onClick: onNext, primary: true, children: currentStep !== totalStepCount - 1 ? nextText : endText })] })] })] }) }));
5
+ export const TourPopover = ({ children, currentStep = 1, endText = 'Close', headerText, nextText = 'Next', onClose, onNext, totalStepCount = 1 })=>{
6
+ return /*#__PURE__*/ _jsx(Stack, {
7
+ direction: "column",
8
+ className: classNames(Styles.featurePopover, 'Popper__body Popover__body Popover__body--open Popover--w-s p-x-3 p-y-2'),
9
+ children: /*#__PURE__*/ _jsxs(Stack.Item, {
10
+ className: "m-t-half",
11
+ children: [
12
+ headerText && /*#__PURE__*/ _jsx(Headline, {
13
+ size: "small",
14
+ children: headerText
15
+ }),
16
+ children,
17
+ /*#__PURE__*/ _jsxs(Stack, {
18
+ direction: "row",
19
+ alignItems: "center",
20
+ justifyContent: "space-between",
21
+ className: "m-t-2 m-b-half",
22
+ children: [
23
+ /*#__PURE__*/ _jsxs(BodyText, {
24
+ subdued: true,
25
+ children: [
26
+ currentStep + 1,
27
+ "/",
28
+ totalStepCount
29
+ ]
30
+ }),
31
+ /*#__PURE__*/ _jsxs(ButtonGroup, {
32
+ children: [
33
+ currentStep !== totalStepCount - 1 && /*#__PURE__*/ _jsx(Button, {
34
+ fill: "subtle",
35
+ size: "small",
36
+ onClick: onClose,
37
+ children: "Skip"
38
+ }),
39
+ /*#__PURE__*/ _jsx(Button, {
40
+ size: "small",
41
+ onClick: onNext,
42
+ primary: true,
43
+ children: currentStep !== totalStepCount - 1 ? nextText : endText
44
+ })
45
+ ]
46
+ })
47
+ ]
48
+ })
49
+ ]
50
+ })
51
+ });
7
52
  };
53
+
8
54
  //# sourceMappingURL=tour-popover.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tour-popover.js","sourceRoot":"","sources":["../../src/components/tour-popover.tsx"],"names":[],"mappings":";AACA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAEH,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,WAAW,GACd,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,MAAM,MAAM,iCAAiC,CAAC;AAa1D,MAAM,CAAC,MAAM,WAAW,GAAyB,CAAC,EAC9C,QAAQ,EACR,WAAW,GAAG,CAAC,EACf,OAAO,GAAG,OAAO,EACjB,UAAU,EACV,QAAQ,GAAG,MAAM,EACjB,OAAO,EACP,MAAM,EACN,cAAc,GAAG,CAAC,GACrB,EAAE,EAAE;IACD,OAAO,CACH,KAAC,KAAK,IACF,SAAS,EAAC,QAAQ,EAClB,SAAS,EAAE,UAAU,CACjB,MAAM,CAAC,cAAc,EACrB,yEAAyE,CAC5E,YAED,MAAC,KAAK,CAAC,IAAI,IAAC,SAAS,EAAC,UAAU,aAC3B,UAAU,IAAI,KAAC,QAAQ,IAAC,IAAI,EAAC,OAAO,YAAE,UAAU,GAAY,EAC5D,QAAQ,EACT,MAAC,KAAK,IACF,SAAS,EAAC,KAAK,EACf,UAAU,EAAC,QAAQ,EACnB,cAAc,EAAC,eAAe,EAC9B,SAAS,EAAC,gBAAgB,aAE1B,MAAC,QAAQ,IAAC,OAAO,mBACZ,WAAW,GAAG,CAAC,OAAG,cAAc,IAC1B,EACX,MAAC,WAAW,eACP,WAAW,KAAK,cAAc,GAAG,CAAC,IAAI,CACnC,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,OAAO,qBAE1C,CACZ,EACD,KAAC,MAAM,IAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,MAAM,EAAE,OAAO,kBACxC,WAAW,KAAK,cAAc,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,GACnD,IACC,IACV,IACC,GACT,CACX,CAAC;AACN,CAAC,CAAC"}
1
+ {"version":3,"sources":["../../src/components/tour-popover.tsx"],"sourcesContent":["import { FC, SyntheticEvent, ReactNode } from 'react';\nimport classNames from 'classnames';\nimport {\n PopoverProps,\n Stack,\n Headline,\n BodyText,\n Button,\n ButtonGroup,\n} from '@servicetitan/design-system';\nimport * as Styles from '../feature-spotlight.module.css';\n\nexport interface TourPopoverProps extends PopoverProps {\n children?: ReactNode;\n currentStep?: number;\n endText?: string;\n headerText?: string;\n nextText?: string;\n onClose?: (e?: SyntheticEvent<HTMLElement>) => void;\n onNext?: (e?: SyntheticEvent<HTMLElement>) => void;\n totalStepCount?: number;\n}\n\nexport const TourPopover: FC<TourPopoverProps> = ({\n children,\n currentStep = 1,\n endText = 'Close',\n headerText,\n nextText = 'Next',\n onClose,\n onNext,\n totalStepCount = 1,\n}) => {\n return (\n <Stack\n direction=\"column\"\n className={classNames(\n Styles.featurePopover,\n 'Popper__body Popover__body Popover__body--open Popover--w-s p-x-3 p-y-2'\n )}\n >\n <Stack.Item className=\"m-t-half\">\n {headerText && <Headline size=\"small\">{headerText}</Headline>}\n {children}\n <Stack\n direction=\"row\"\n alignItems=\"center\"\n justifyContent=\"space-between\"\n className=\"m-t-2 m-b-half\"\n >\n <BodyText subdued>\n {currentStep + 1}/{totalStepCount}\n </BodyText>\n <ButtonGroup>\n {currentStep !== totalStepCount - 1 && (\n <Button fill=\"subtle\" size=\"small\" onClick={onClose}>\n Skip\n </Button>\n )}\n <Button size=\"small\" onClick={onNext} primary>\n {currentStep !== totalStepCount - 1 ? nextText : endText}\n </Button>\n </ButtonGroup>\n </Stack>\n </Stack.Item>\n </Stack>\n );\n};\n"],"names":["classNames","Stack","Headline","BodyText","Button","ButtonGroup","Styles","TourPopover","children","currentStep","endText","headerText","nextText","onClose","onNext","totalStepCount","direction","className","featurePopover","Item","size","alignItems","justifyContent","subdued","fill","onClick","primary"],"mappings":";AACA,OAAOA,gBAAgB,aAAa;AACpC,SAEIC,KAAK,EACLC,QAAQ,EACRC,QAAQ,EACRC,MAAM,EACNC,WAAW,QACR,8BAA8B;AACrC,YAAYC,YAAY,kCAAkC;AAa1D,OAAO,MAAMC,cAAoC,CAAC,EAC9CC,QAAQ,EACRC,cAAc,CAAC,EACfC,UAAU,OAAO,EACjBC,UAAU,EACVC,WAAW,MAAM,EACjBC,OAAO,EACPC,MAAM,EACNC,iBAAiB,CAAC,EACrB;IACG,qBACI,KAACd;QACGe,WAAU;QACVC,WAAWjB,WACPM,OAAOY,cAAc,EACrB;kBAGJ,cAAA,MAACjB,MAAMkB,IAAI;YAACF,WAAU;;gBACjBN,4BAAc,KAACT;oBAASkB,MAAK;8BAAST;;gBACtCH;8BACD,MAACP;oBACGe,WAAU;oBACVK,YAAW;oBACXC,gBAAe;oBACfL,WAAU;;sCAEV,MAACd;4BAASoB,OAAO;;gCACZd,cAAc;gCAAE;gCAAEM;;;sCAEvB,MAACV;;gCACII,gBAAgBM,iBAAiB,mBAC9B,KAACX;oCAAOoB,MAAK;oCAASJ,MAAK;oCAAQK,SAASZ;8CAAS;;8CAIzD,KAACT;oCAAOgB,MAAK;oCAAQK,SAASX;oCAAQY,OAAO;8CACxCjB,gBAAgBM,iBAAiB,IAAIH,WAAWF;;;;;;;;;AAO7E,EAAE"}
@@ -0,0 +1,9 @@
1
+ export const __esModule: true;
2
+ export const featureModalHeader: string;
3
+ export const featurePopover: string;
4
+ export const featurePopoverCaret: string;
5
+ export const featurePopoverFooter: string;
6
+ export const featurePopoverHeader: string;
7
+ export const featureToast: string;
8
+ export const featureToastCenter: string;
9
+
@@ -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"}
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './components/feature-popover';
2
2
  export * from './components/feature-modal';
3
3
  export * from './components/feature-toast';
4
+
4
5
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './components/feature-popover';\nexport * from './components/feature-modal';\nexport * from './components/feature-toast';\n"],"names":[],"mappings":"AAAA,cAAc,+BAA+B;AAC7C,cAAc,6BAA6B;AAC3C,cAAc,6BAA6B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/feature-spotlight",
3
- "version": "3.2.1",
3
+ "version": "3.4.0",
4
4
  "description": "Provides specific styles to Anvil components to highlight a feature",
5
5
  "repository": {
6
6
  "type": "git",
@@ -19,7 +19,7 @@
19
19
  "@types/history": "~4.7.10",
20
20
  "@types/react": "~18.2.55",
21
21
  "@types/react-router": "~5.1.17",
22
- "react": "~18.2.0",
22
+ "react": "^18.2.0",
23
23
  "react-dom": "~18.2.0"
24
24
  },
25
25
  "peerDependencies": {
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@reactour/tour": "^3.1.4",
32
- "classnames": "~2.3.1"
32
+ "classnames": "^2.3.1"
33
33
  },
34
34
  "publishConfig": {
35
35
  "access": "public"
@@ -37,5 +37,5 @@
37
37
  "cli": {
38
38
  "webpack": false
39
39
  },
40
- "gitHead": "17fc7d50aebf18316775bddae960a29a2c79b1b0"
40
+ "gitHead": "7fc7b9cbf766fe23879ae81831f28bdd96559bce"
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 React, { FC } from 'react';
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
- <React.Fragment>
42
- <Stack
43
- direction="column"
44
- spacing={5}
45
- alignItems="center"
46
- justifyContent="center"
47
- className="p-4"
48
- style={{ height: '800px' }}
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
- <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 }}
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
- <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
93
- and 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>
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
- <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
118
- and 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>
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
- <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
143
- and 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>
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?: React.ReactNode;
251
+ children?: ReactNode;
253
252
  headerText?: string;
254
253
  }
255
254
 
256
- const InternalTourControls: FC<InternalTourProps> = React.memo(({ children, headerText }) => {
255
+ const InternalTourControls: FC<InternalTourProps> = memo(({ children, headerText }) => {
257
256
  const { setCurrentStep, currentStep, steps, setIsOpen } = useTour();
258
257
 
259
- const handleClose = React.useCallback(() => {
258
+ const handleClose = useCallback(() => {
260
259
  setIsOpen(false);
261
260
  }, [setIsOpen]);
262
261
 
263
- const handleNext = React.useCallback(() => {
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 = React.useCallback(() => {
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
- <ReactTour>
352
+ <ReactTour>
356
353
  <Page
357
354
  header={
358
355
  <Stack justifyContent="space-between" alignItems="center">
359
- <Headline size="large" className="step-3">Page Title</Headline>
356
+ <Headline size="large" className="step-3">
357
+ Page Title
358
+ </Headline>
360
359
  <StartTourButton />
361
360
  </Stack>
362
361
  }