@drawbridge/components 0.1.31 → 0.1.33
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/bridge/template-modal.js +2 -1
- package/dist/bridge/template-modal.mjs +2 -1
- package/dist/dashboard/buttons-subscription.js +65 -20
- package/dist/dashboard/buttons-subscription.mjs +64 -20
- package/dist/dashboard/card-payment-method.js +1 -1
- package/dist/dashboard/card-payment-method.mjs +1 -1
- package/dist/dashboard/card-section.js +2 -2
- package/dist/dashboard/card-section.mjs +2 -2
- package/dist/dashboard/card-setting.js +4 -3
- package/dist/dashboard/card-setting.mjs +4 -3
- package/dist/dashboard/card-task.js +22 -4
- package/dist/dashboard/card-task.mjs +22 -4
- package/dist/dashboard/card-tile.js +6 -6
- package/dist/dashboard/card-tile.mjs +6 -6
- package/dist/dashboard/drawer.js +7 -2
- package/dist/dashboard/drawer.mjs +8 -3
- package/dist/dashboard/form-organization-workflow.js +87 -65
- package/dist/dashboard/form-organization-workflow.mjs +87 -65
- package/dist/dashboard/input-combobox.js +7 -2
- package/dist/dashboard/input-combobox.mjs +7 -2
- package/dist/dashboard/lib/escape.js +48 -0
- package/dist/dashboard/lib/escape.mjs +25 -0
- package/dist/dashboard/lib/rail.js +75 -0
- package/dist/dashboard/lib/rail.mjs +46 -0
- package/dist/dashboard/lib/throttle.js +57 -0
- package/dist/dashboard/lib/throttle.mjs +34 -0
- package/dist/dashboard/list.js +1 -1
- package/dist/dashboard/list.mjs +1 -1
- package/dist/dashboard/menu.js +188 -96
- package/dist/dashboard/menu.mjs +189 -97
- package/dist/dashboard/modal.js +9 -3
- package/dist/dashboard/modal.mjs +10 -4
- package/dist/dashboard/notice.js +5 -3
- package/dist/dashboard/notice.mjs +5 -3
- package/dist/dashboard/table-cell-title.js +2 -0
- package/dist/dashboard/table-cell-title.mjs +2 -0
- package/dist/dashboard/table.js +61 -20
- package/dist/dashboard/table.mjs +61 -20
- package/dist/dashboard/template-dashboard.js +35 -133
- package/dist/dashboard/template-dashboard.mjs +36 -134
- package/dist/dashboard/template-rail.js +674 -0
- package/dist/dashboard/template-rail.mjs +640 -0
- package/dist/dashboard/template-socket.js +19 -3
- package/dist/dashboard/template-socket.mjs +19 -3
- package/dist/dashboard/template-ui.js +150 -186
- package/dist/dashboard/template-ui.mjs +151 -187
- package/dist/icons/book-open.js +46 -0
- package/dist/icons/book-open.mjs +27 -0
- package/dist/icons/task.js +46 -0
- package/dist/icons/task.mjs +27 -0
- package/dist/shared/lib/helpers.js +9 -2
- package/dist/shared/lib/helpers.mjs +9 -2
- package/dist/shared/lib/motion.js +27 -0
- package/dist/shared/lib/motion.mjs +4 -0
- package/dist/shared/overlay.js +5 -3
- package/dist/shared/overlay.mjs +5 -3
- package/package.json +28 -13
- package/types/dashboard/card-task.d.ts +5 -1
- package/types/dashboard/lib/rail.d.ts +32 -0
- package/types/dashboard/lib/throttle.d.ts +5 -0
- package/types/dashboard/table.d.ts +3 -1
- package/types/dashboard/template-dashboard.d.ts +4 -1
- package/types/dashboard/template-rail.d.ts +36 -0
- package/types/dashboard/template-ui.d.ts +2 -2
- package/types/icons/book-open.d.ts +5 -0
- package/types/icons/task.d.ts +5 -0
- package/dist/dashboard/guide.js +0 -238
- package/dist/dashboard/guide.mjs +0 -209
- package/types/dashboard/guide.d.ts +0 -23
package/dist/shared/overlay.js
CHANGED
|
@@ -33,11 +33,12 @@ __export(overlay_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(overlay_exports);
|
|
34
34
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
35
|
var import_react = require("@headlessui/react");
|
|
36
|
+
var import_motion = require("./lib/motion");
|
|
36
37
|
var import_button = __toESM(require("./button"));
|
|
37
38
|
var import_styles = require("../styles");
|
|
38
39
|
const Overlay = ({
|
|
39
40
|
className = "z-40 fixed inset-0",
|
|
40
|
-
// linger: the tint stays
|
|
41
|
+
// linger: the tint stays 100ms on leave, so the panel above animates out first.
|
|
41
42
|
linger = false,
|
|
42
43
|
onClick,
|
|
43
44
|
show = false,
|
|
@@ -50,8 +51,9 @@ const Overlay = ({
|
|
|
50
51
|
as: "div",
|
|
51
52
|
className: [
|
|
52
53
|
className,
|
|
53
|
-
"flex
|
|
54
|
-
|
|
54
|
+
"flex data-[closed]:opacity-0 " + import_motion.motion,
|
|
55
|
+
// The panel's 150 ms leave runs first, then the backdrop fades.
|
|
56
|
+
linger && "data-[leave]:data-[closed]:delay-100",
|
|
55
57
|
!style && "bg-black/50"
|
|
56
58
|
].filter(Boolean).join(" "),
|
|
57
59
|
show: Boolean(show),
|
package/dist/shared/overlay.mjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { Transition } from "@headlessui/react";
|
|
4
|
+
import { motion } from "./lib/motion.mjs";
|
|
4
5
|
import Button from "./button.mjs";
|
|
5
6
|
import { textStyle } from "../styles.mjs";
|
|
6
7
|
const Overlay = ({
|
|
7
8
|
className = "z-40 fixed inset-0",
|
|
8
|
-
// linger: the tint stays
|
|
9
|
+
// linger: the tint stays 100ms on leave, so the panel above animates out first.
|
|
9
10
|
linger = false,
|
|
10
11
|
onClick,
|
|
11
12
|
show = false,
|
|
@@ -18,8 +19,9 @@ const Overlay = ({
|
|
|
18
19
|
as: "div",
|
|
19
20
|
className: [
|
|
20
21
|
className,
|
|
21
|
-
"flex
|
|
22
|
-
|
|
22
|
+
"flex data-[closed]:opacity-0 " + motion,
|
|
23
|
+
// The panel's 150 ms leave runs first, then the backdrop fades.
|
|
24
|
+
linger && "data-[leave]:data-[closed]:delay-100",
|
|
23
25
|
!style && "bg-black/50"
|
|
24
26
|
].filter(Boolean).join(" "),
|
|
25
27
|
show: Boolean(show),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@drawbridge/components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.33",
|
|
4
4
|
"exports": {
|
|
5
5
|
"./advertisement": {
|
|
6
6
|
"types": "./types/advertisement.d.ts",
|
|
@@ -677,11 +677,6 @@
|
|
|
677
677
|
"import": "./dist/dashboard/guard-navigation.mjs",
|
|
678
678
|
"default": "./dist/dashboard/guard-navigation.js"
|
|
679
679
|
},
|
|
680
|
-
"./dashboard/guide": {
|
|
681
|
-
"types": "./types/dashboard/guide.d.ts",
|
|
682
|
-
"import": "./dist/dashboard/guide.mjs",
|
|
683
|
-
"default": "./dist/dashboard/guide.js"
|
|
684
|
-
},
|
|
685
680
|
"./dashboard/input-address-saved": {
|
|
686
681
|
"types": "./types/dashboard/input-address-saved.d.ts",
|
|
687
682
|
"import": "./dist/dashboard/input-address-saved.mjs",
|
|
@@ -812,6 +807,11 @@
|
|
|
812
807
|
"import": "./dist/dashboard/lib/overage.mjs",
|
|
813
808
|
"default": "./dist/dashboard/lib/overage.js"
|
|
814
809
|
},
|
|
810
|
+
"./dashboard/lib/rail": {
|
|
811
|
+
"types": "./types/dashboard/lib/rail.d.ts",
|
|
812
|
+
"import": "./dist/dashboard/lib/rail.mjs",
|
|
813
|
+
"default": "./dist/dashboard/lib/rail.js"
|
|
814
|
+
},
|
|
815
815
|
"./dashboard/lib/sms": {
|
|
816
816
|
"types": "./types/dashboard/lib/sms.d.ts",
|
|
817
817
|
"import": "./dist/dashboard/lib/sms.mjs",
|
|
@@ -822,6 +822,11 @@
|
|
|
822
822
|
"import": "./dist/dashboard/lib/table-actions.mjs",
|
|
823
823
|
"default": "./dist/dashboard/lib/table-actions.js"
|
|
824
824
|
},
|
|
825
|
+
"./dashboard/lib/throttle": {
|
|
826
|
+
"types": "./types/dashboard/lib/throttle.d.ts",
|
|
827
|
+
"import": "./dist/dashboard/lib/throttle.mjs",
|
|
828
|
+
"default": "./dist/dashboard/lib/throttle.js"
|
|
829
|
+
},
|
|
825
830
|
"./dashboard/lib/time-slots": {
|
|
826
831
|
"types": "./types/dashboard/lib/time-slots.d.ts",
|
|
827
832
|
"import": "./dist/dashboard/lib/time-slots.mjs",
|
|
@@ -962,6 +967,11 @@
|
|
|
962
967
|
"import": "./dist/dashboard/template-not-found.mjs",
|
|
963
968
|
"default": "./dist/dashboard/template-not-found.js"
|
|
964
969
|
},
|
|
970
|
+
"./dashboard/template-rail": {
|
|
971
|
+
"types": "./types/dashboard/template-rail.d.ts",
|
|
972
|
+
"import": "./dist/dashboard/template-rail.mjs",
|
|
973
|
+
"default": "./dist/dashboard/template-rail.js"
|
|
974
|
+
},
|
|
965
975
|
"./dashboard/template-socket": {
|
|
966
976
|
"types": "./types/dashboard/template-socket.d.ts",
|
|
967
977
|
"import": "./dist/dashboard/template-socket.mjs",
|
|
@@ -1022,6 +1032,11 @@
|
|
|
1022
1032
|
"import": "./dist/icons/bolt.mjs",
|
|
1023
1033
|
"default": "./dist/icons/bolt.js"
|
|
1024
1034
|
},
|
|
1035
|
+
"./icons/book-open": {
|
|
1036
|
+
"types": "./types/icons/book-open.d.ts",
|
|
1037
|
+
"import": "./dist/icons/book-open.mjs",
|
|
1038
|
+
"default": "./dist/icons/book-open.js"
|
|
1039
|
+
},
|
|
1025
1040
|
"./icons/calendar": {
|
|
1026
1041
|
"types": "./types/icons/calendar.d.ts",
|
|
1027
1042
|
"import": "./dist/icons/calendar.mjs",
|
|
@@ -1352,6 +1367,11 @@
|
|
|
1352
1367
|
"import": "./dist/icons/tablet.mjs",
|
|
1353
1368
|
"default": "./dist/icons/tablet.js"
|
|
1354
1369
|
},
|
|
1370
|
+
"./icons/task": {
|
|
1371
|
+
"types": "./types/icons/task.d.ts",
|
|
1372
|
+
"import": "./dist/icons/task.mjs",
|
|
1373
|
+
"default": "./dist/icons/task.js"
|
|
1374
|
+
},
|
|
1355
1375
|
"./icons/threads": {
|
|
1356
1376
|
"types": "./types/icons/threads.d.ts",
|
|
1357
1377
|
"import": "./dist/icons/threads.mjs",
|
|
@@ -1693,7 +1713,6 @@
|
|
|
1693
1713
|
"react-day-picker": ">=9.14.0",
|
|
1694
1714
|
"react-google-recaptcha-v3": ">=1.10.1",
|
|
1695
1715
|
"react-hook-form": ">=7.62.0",
|
|
1696
|
-
"react-joyride": ">=2.9.3",
|
|
1697
1716
|
"react-share": ">=5.3.0",
|
|
1698
1717
|
"recharts": ">=2.15.1",
|
|
1699
1718
|
"socket.io-client": ">=4.8.3",
|
|
@@ -1763,9 +1782,6 @@
|
|
|
1763
1782
|
"react-day-picker": {
|
|
1764
1783
|
"optional": true
|
|
1765
1784
|
},
|
|
1766
|
-
"react-joyride": {
|
|
1767
|
-
"optional": true
|
|
1768
|
-
},
|
|
1769
1785
|
"react-share": {
|
|
1770
1786
|
"optional": true
|
|
1771
1787
|
},
|
|
@@ -1781,9 +1797,9 @@
|
|
|
1781
1797
|
},
|
|
1782
1798
|
"devDependencies": {
|
|
1783
1799
|
"@analytics/google-tag-manager": "0.5.5",
|
|
1784
|
-
"@drawbridge/drawbridge-agents": "0.1.
|
|
1800
|
+
"@drawbridge/drawbridge-agents": "0.1.104",
|
|
1785
1801
|
"@drawbridge/drawbridge-telemetry": "0.0.19",
|
|
1786
|
-
"@drawbridge/drawbridge-utils": "0.0.
|
|
1802
|
+
"@drawbridge/drawbridge-utils": "0.0.233",
|
|
1787
1803
|
"@headlessui/react": "2.2.9",
|
|
1788
1804
|
"@hookform/resolvers": "3.1.1",
|
|
1789
1805
|
"@sentry/nextjs": "10.58.0",
|
|
@@ -1822,7 +1838,6 @@
|
|
|
1822
1838
|
"react-dom": "18.3.1",
|
|
1823
1839
|
"react-google-recaptcha-v3": "1.10.1",
|
|
1824
1840
|
"react-hook-form": "7.62.0",
|
|
1825
|
-
"react-joyride": "2.9.3",
|
|
1826
1841
|
"react-share": "5.3.0",
|
|
1827
1842
|
"react-test-renderer": "18.3.1",
|
|
1828
1843
|
"recharts": "2.15.1",
|
|
@@ -19,13 +19,17 @@ export interface CardTaskButton {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export interface CardTaskProps {
|
|
22
|
+
// A small badge at the card's top right, naming its area.
|
|
23
|
+
badge?: ReactNode;
|
|
22
24
|
// Rendered only with an href or onClick.
|
|
23
25
|
button?: CardTaskButton;
|
|
24
26
|
className?: string;
|
|
25
27
|
'data-guide'?: string;
|
|
26
28
|
message?: ReactNode;
|
|
29
|
+
// The button under the words, for a card too narrow to sit them side by side.
|
|
30
|
+
stack?: boolean;
|
|
27
31
|
title?: ReactNode;
|
|
28
|
-
type?: 'default' | 'error' | 'success' | 'warning';
|
|
32
|
+
type?: 'default' | 'error' | 'recommended' | 'success' | 'warning';
|
|
29
33
|
[ key: string ]: unknown;
|
|
30
34
|
}
|
|
31
35
|
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface RailItem {
|
|
2
|
+
area?: string;
|
|
3
|
+
button?: string;
|
|
4
|
+
href?: string;
|
|
5
|
+
kind?: 'recommended' | 'required';
|
|
6
|
+
title?: string;
|
|
7
|
+
why?: string;
|
|
8
|
+
[ key: string ]: unknown;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface RailTasks {
|
|
12
|
+
items?: RailItem[];
|
|
13
|
+
list?: Record<string, { count?: number; items?: RailItem[] }>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface RailItemsArgs {
|
|
17
|
+
account?: { tasks?: RailTasks } | null;
|
|
18
|
+
campaign?: { tasks?: RailTasks } | null;
|
|
19
|
+
organization?: { tasks?: RailTasks } | null;
|
|
20
|
+
page?: { tasks?: RailTasks } | null;
|
|
21
|
+
params?: Record<string, string | string[] | undefined>;
|
|
22
|
+
path?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function railItems( args: RailItemsArgs ): RailItem[];
|
|
26
|
+
export function railCount( items?: RailItem[] ): number;
|
|
27
|
+
export function railFirst( items?: RailItem[] ): RailItem | undefined;
|
|
28
|
+
export function railLead( count: number ): string;
|
|
29
|
+
export function railView( args: { guide?: unknown; panel?: string | null } ): string | null;
|
|
30
|
+
export function railOverlap( a: DOMRectReadOnly, b: DOMRectReadOnly ): boolean;
|
|
31
|
+
export function railOnScreen( rect: DOMRectReadOnly, viewport: { height: number; width: number } ): boolean;
|
|
32
|
+
export function railTabTarget( args: { active: unknown; items: unknown[]; shift: boolean } ): unknown;
|
|
@@ -53,7 +53,7 @@ export interface TableRowLoading {
|
|
|
53
53
|
export type TableColumn<TData = any> = ColumnDef<TData, any> & {
|
|
54
54
|
// Maps to tanstack's enableSorting.
|
|
55
55
|
sortable?: boolean;
|
|
56
|
-
meta?: { className?: string; classNameCell?: string; classNameHeader?: string };
|
|
56
|
+
meta?: { className?: string; classNameCell?: string; classNameHeader?: string; shrink?: boolean };
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
export interface TableProps<TData = any> {
|
|
@@ -71,6 +71,8 @@ export interface TableProps<TData = any> {
|
|
|
71
71
|
onSortingChange?: OnChangeFn<SortingState>;
|
|
72
72
|
sorting?: SortingState;
|
|
73
73
|
truncate?: boolean;
|
|
74
|
+
// false: the actions scroll with the row, for a list too wide for any laptop.
|
|
75
|
+
fixedActions?: boolean;
|
|
74
76
|
}
|
|
75
77
|
|
|
76
78
|
export type TableCellRenderer = ( context: Pick<CellContext<any, any>, 'getValue'> & Partial<Pick<CellContext<any, any>, 'row'>> ) => ReactNode;
|
|
@@ -25,10 +25,13 @@ export interface TemplateDashboardBadge {
|
|
|
25
25
|
|
|
26
26
|
// An organization or campaign task, as the api's tasks list ships it.
|
|
27
27
|
export interface TemplateDashboardTask {
|
|
28
|
+
area?: string;
|
|
29
|
+
button?: string;
|
|
28
30
|
complete?: boolean;
|
|
29
31
|
href?: string;
|
|
30
|
-
|
|
32
|
+
kind?: 'recommended' | 'required';
|
|
31
33
|
title: ReactNode;
|
|
34
|
+
why?: string;
|
|
32
35
|
[ key: string ]: unknown;
|
|
33
36
|
}
|
|
34
37
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ComponentType, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface TemplateRailGuideStep {
|
|
4
|
+
content: string[];
|
|
5
|
+
// A data-guide selector, or 'body' for a step about the whole screen.
|
|
6
|
+
target: string;
|
|
7
|
+
title: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface TemplateRailGuide {
|
|
11
|
+
steps: TemplateRailGuideStep[];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface TemplateRailProps {
|
|
15
|
+
// The responses the page already loaded, as TemplateUi holds them.
|
|
16
|
+
account?: { tasks?: unknown } | null;
|
|
17
|
+
campaign?: { tasks?: unknown } | null;
|
|
18
|
+
// The page, left of the panel and the rail.
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
// This screen's guide; with none, the rail shows no Screen guide button.
|
|
21
|
+
guide?: TemplateRailGuide;
|
|
22
|
+
organization?: { tasks?: unknown } | null;
|
|
23
|
+
params?: Record<string, string | string[] | undefined>;
|
|
24
|
+
path?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// The open panel, from the query cache: 'next', 'guide' or null.
|
|
28
|
+
export function useRail(): { panel: string | null; set: ( panel: string | null ) => void };
|
|
29
|
+
|
|
30
|
+
// The book icon in the phone's black bar. With no guide, nothing.
|
|
31
|
+
export const TemplateRailBook: ComponentType<{ guide?: TemplateRailGuide }>;
|
|
32
|
+
|
|
33
|
+
// The page's column: the page, the panel and the rail.
|
|
34
|
+
declare const TemplateRail: ComponentType<TemplateRailProps>;
|
|
35
|
+
|
|
36
|
+
export default TemplateRail;
|
|
@@ -3,12 +3,12 @@ import { ComponentType, ReactNode } from 'react';
|
|
|
3
3
|
export interface TemplateUiProps {
|
|
4
4
|
// The page, right of the sidebar.
|
|
5
5
|
children?: ReactNode;
|
|
6
|
-
// Key into the account's guide ( e.g. 'organization.campaigns' ) for this page's
|
|
6
|
+
// Key into the account's guide ( e.g. 'organization.campaigns' ) for this page's steps on the rail.
|
|
7
7
|
guide?: string;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
// The dashboard shell: sidebar header, the menu for the route ( organization,
|
|
11
|
-
// campaign, app, admin or account )
|
|
11
|
+
// campaign, app, admin or account ), the account dropdown and the rail.
|
|
12
12
|
declare const TemplateUi: ComponentType<TemplateUiProps>;
|
|
13
13
|
|
|
14
14
|
export default TemplateUi;
|
package/dist/dashboard/guide.js
DELETED
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var guide_exports = {};
|
|
29
|
-
__export(guide_exports, {
|
|
30
|
-
default: () => guide_default
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(guide_exports);
|
|
33
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
34
|
-
var import_react = require("react");
|
|
35
|
-
var import_dynamic = __toESM(require("next/dynamic"));
|
|
36
|
-
var import_times = __toESM(require("../icons/times"));
|
|
37
|
-
var import_button = __toESM(require("../shared/button"));
|
|
38
|
-
var import_wrapper_gradient = __toESM(require("../wrapper-gradient"));
|
|
39
|
-
const Joyride = (0, import_dynamic.default)(() => import("react-joyride"), { ssr: false });
|
|
40
|
-
const Video = (0, import_dynamic.default)(() => import("../video"), { ssr: false });
|
|
41
|
-
const Beacon = (0, import_react.forwardRef)((props, ref) => {
|
|
42
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
43
|
-
import_button.default,
|
|
44
|
-
{
|
|
45
|
-
...{
|
|
46
|
-
"aria-label": props["aria-label"],
|
|
47
|
-
inline: true,
|
|
48
|
-
onClick: props.onClick,
|
|
49
|
-
onMouseEnter: props.onMouseEnter,
|
|
50
|
-
ref,
|
|
51
|
-
title: props.title,
|
|
52
|
-
variant: "link"
|
|
53
|
-
},
|
|
54
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55
|
-
"span",
|
|
56
|
-
{
|
|
57
|
-
...{
|
|
58
|
-
className: "block w-4 h-4 bg-green rounded-full animate-pulse"
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
)
|
|
62
|
-
}
|
|
63
|
-
);
|
|
64
|
-
});
|
|
65
|
-
Beacon.displayName = "Beacon";
|
|
66
|
-
const Tooltip = ({
|
|
67
|
-
backProps,
|
|
68
|
-
continuous,
|
|
69
|
-
index,
|
|
70
|
-
primaryProps,
|
|
71
|
-
skipProps,
|
|
72
|
-
step,
|
|
73
|
-
tooltipProps
|
|
74
|
-
}) => {
|
|
75
|
-
var _a;
|
|
76
|
-
const { children: skipLabel, ...skip } = skipProps;
|
|
77
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
78
|
-
"div",
|
|
79
|
-
{
|
|
80
|
-
...{
|
|
81
|
-
className: "w-dvw max-w-md bg-white rounded overflow-hidden shadow-lg",
|
|
82
|
-
...tooltipProps
|
|
83
|
-
},
|
|
84
|
-
children: [
|
|
85
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
86
|
-
"div",
|
|
87
|
-
{
|
|
88
|
-
...{
|
|
89
|
-
className: "w-full flex items-center justify-between bg-white px-6 pt-6 pb-3 space-x-6"
|
|
90
|
-
},
|
|
91
|
-
children: [
|
|
92
|
-
(step == null ? void 0 : step.title) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
93
|
-
"p",
|
|
94
|
-
{
|
|
95
|
-
...{
|
|
96
|
-
className: "text-md lg:text-lg"
|
|
97
|
-
},
|
|
98
|
-
children: step.title
|
|
99
|
-
}
|
|
100
|
-
),
|
|
101
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
102
|
-
import_button.default,
|
|
103
|
-
{
|
|
104
|
-
...{
|
|
105
|
-
icon: import_times.default,
|
|
106
|
-
inline: true,
|
|
107
|
-
variant: "link",
|
|
108
|
-
...skip
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
)
|
|
112
|
-
]
|
|
113
|
-
}
|
|
114
|
-
),
|
|
115
|
-
((step == null ? void 0 : step.title) || (step == null ? void 0 : step.content)) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
116
|
-
"div",
|
|
117
|
-
{
|
|
118
|
-
...{
|
|
119
|
-
className: "w-full relative px-6 space-y-2"
|
|
120
|
-
},
|
|
121
|
-
children: [
|
|
122
|
-
((_a = step == null ? void 0 : step.data) == null ? void 0 : _a.video) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
123
|
-
"div",
|
|
124
|
-
{
|
|
125
|
-
...{
|
|
126
|
-
className: "w-full py-3"
|
|
127
|
-
},
|
|
128
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
129
|
-
Video,
|
|
130
|
-
{
|
|
131
|
-
...{
|
|
132
|
-
className: "aspect-video",
|
|
133
|
-
controls: true,
|
|
134
|
-
mp4: step.data.video
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
)
|
|
138
|
-
}
|
|
139
|
-
),
|
|
140
|
-
(step == null ? void 0 : step.content) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
141
|
-
import_wrapper_gradient.default,
|
|
142
|
-
{
|
|
143
|
-
...{
|
|
144
|
-
classNameScroll: "max-h-48 space-y-4 ",
|
|
145
|
-
classNameGradient: "from-white from-[16%] to-transparent h-8"
|
|
146
|
-
},
|
|
147
|
-
children: step.content.map((line, key) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: line }, key))
|
|
148
|
-
}
|
|
149
|
-
)
|
|
150
|
-
]
|
|
151
|
-
}
|
|
152
|
-
),
|
|
153
|
-
continuous && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
154
|
-
"div",
|
|
155
|
-
{
|
|
156
|
-
...{
|
|
157
|
-
className: "flex items-center justify-between space-x-6 p-6"
|
|
158
|
-
},
|
|
159
|
-
children: [
|
|
160
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: index > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
161
|
-
import_button.default,
|
|
162
|
-
{
|
|
163
|
-
...{
|
|
164
|
-
inline: true,
|
|
165
|
-
size: "small",
|
|
166
|
-
variant: "secondary",
|
|
167
|
-
...backProps
|
|
168
|
-
},
|
|
169
|
-
children: backProps.title
|
|
170
|
-
}
|
|
171
|
-
) }),
|
|
172
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
173
|
-
import_button.default,
|
|
174
|
-
{
|
|
175
|
-
...{
|
|
176
|
-
inline: true,
|
|
177
|
-
size: "small",
|
|
178
|
-
...primaryProps
|
|
179
|
-
},
|
|
180
|
-
children: primaryProps.title
|
|
181
|
-
}
|
|
182
|
-
) })
|
|
183
|
-
]
|
|
184
|
-
}
|
|
185
|
-
)
|
|
186
|
-
]
|
|
187
|
-
}
|
|
188
|
-
);
|
|
189
|
-
};
|
|
190
|
-
const Guide = ({
|
|
191
|
-
steps = [],
|
|
192
|
-
...rest
|
|
193
|
-
}) => {
|
|
194
|
-
if (steps.length > 0) {
|
|
195
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
196
|
-
Joyride,
|
|
197
|
-
{
|
|
198
|
-
...{
|
|
199
|
-
beaconComponent: Beacon,
|
|
200
|
-
continuous: true,
|
|
201
|
-
disableCloseOnEsc: true,
|
|
202
|
-
disableOverlayClose: true,
|
|
203
|
-
disableScrolling: false,
|
|
204
|
-
disableScrollParentFix: true,
|
|
205
|
-
floaterProps: {
|
|
206
|
-
styles: {
|
|
207
|
-
arrow: {
|
|
208
|
-
length: 8,
|
|
209
|
-
spread: 16
|
|
210
|
-
},
|
|
211
|
-
floater: {
|
|
212
|
-
filter: "none"
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
},
|
|
216
|
-
locale: {
|
|
217
|
-
back: "Back",
|
|
218
|
-
close: "Close",
|
|
219
|
-
last: "Done",
|
|
220
|
-
next: "Next",
|
|
221
|
-
skip: "Skip"
|
|
222
|
-
},
|
|
223
|
-
spotlightPadding: 0,
|
|
224
|
-
steps,
|
|
225
|
-
styles: {
|
|
226
|
-
overlay: {
|
|
227
|
-
height: "100%"
|
|
228
|
-
}
|
|
229
|
-
},
|
|
230
|
-
tooltipComponent: Tooltip,
|
|
231
|
-
...rest
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
);
|
|
235
|
-
}
|
|
236
|
-
return null;
|
|
237
|
-
};
|
|
238
|
-
var guide_default = Guide;
|