@drawbridge/components 0.1.21 → 0.1.23

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.
Files changed (71) hide show
  1. package/dist/bridge/template-modal.js +2 -1
  2. package/dist/bridge/template-modal.mjs +2 -1
  3. package/dist/dashboard/buttons-subscription.js +65 -20
  4. package/dist/dashboard/buttons-subscription.mjs +64 -20
  5. package/dist/dashboard/card-payment-method.js +1 -1
  6. package/dist/dashboard/card-payment-method.mjs +1 -1
  7. package/dist/dashboard/card-section.js +2 -2
  8. package/dist/dashboard/card-section.mjs +2 -2
  9. package/dist/dashboard/card-setting.js +4 -3
  10. package/dist/dashboard/card-setting.mjs +4 -3
  11. package/dist/dashboard/card-task.js +22 -4
  12. package/dist/dashboard/card-task.mjs +22 -4
  13. package/dist/dashboard/card-tile.js +6 -6
  14. package/dist/dashboard/card-tile.mjs +6 -6
  15. package/dist/dashboard/drawer.js +7 -2
  16. package/dist/dashboard/drawer.mjs +8 -3
  17. package/dist/dashboard/form-organization-campaign-field-list.js +1 -1
  18. package/dist/dashboard/form-organization-campaign-field-list.mjs +1 -1
  19. package/dist/dashboard/form-organization-workflow.js +2 -2
  20. package/dist/dashboard/form-organization-workflow.mjs +2 -2
  21. package/dist/dashboard/input-combobox.js +7 -2
  22. package/dist/dashboard/input-combobox.mjs +7 -2
  23. package/dist/dashboard/lib/escape.js +48 -0
  24. package/dist/dashboard/lib/escape.mjs +25 -0
  25. package/dist/dashboard/lib/rail.js +75 -0
  26. package/dist/dashboard/lib/rail.mjs +46 -0
  27. package/dist/dashboard/lib/throttle.js +57 -0
  28. package/dist/dashboard/lib/throttle.mjs +34 -0
  29. package/dist/dashboard/list.js +1 -1
  30. package/dist/dashboard/list.mjs +1 -1
  31. package/dist/dashboard/menu.js +188 -96
  32. package/dist/dashboard/menu.mjs +189 -97
  33. package/dist/dashboard/modal.js +9 -3
  34. package/dist/dashboard/modal.mjs +10 -4
  35. package/dist/dashboard/notice.js +5 -3
  36. package/dist/dashboard/notice.mjs +5 -3
  37. package/dist/dashboard/table-cell-title.js +2 -0
  38. package/dist/dashboard/table-cell-title.mjs +2 -0
  39. package/dist/dashboard/table.js +61 -20
  40. package/dist/dashboard/table.mjs +61 -20
  41. package/dist/dashboard/template-dashboard.js +35 -133
  42. package/dist/dashboard/template-dashboard.mjs +36 -134
  43. package/dist/dashboard/template-rail.js +674 -0
  44. package/dist/dashboard/template-rail.mjs +640 -0
  45. package/dist/dashboard/template-socket.js +19 -3
  46. package/dist/dashboard/template-socket.mjs +19 -3
  47. package/dist/dashboard/template-ui.js +150 -186
  48. package/dist/dashboard/template-ui.mjs +151 -187
  49. package/dist/icons/book-open.js +46 -0
  50. package/dist/icons/book-open.mjs +27 -0
  51. package/dist/icons/task.js +46 -0
  52. package/dist/icons/task.mjs +27 -0
  53. package/dist/shared/lib/helpers.js +9 -2
  54. package/dist/shared/lib/helpers.mjs +9 -2
  55. package/dist/shared/lib/motion.js +27 -0
  56. package/dist/shared/lib/motion.mjs +4 -0
  57. package/dist/shared/overlay.js +5 -3
  58. package/dist/shared/overlay.mjs +5 -3
  59. package/package.json +27 -12
  60. package/types/dashboard/card-task.d.ts +5 -1
  61. package/types/dashboard/lib/rail.d.ts +32 -0
  62. package/types/dashboard/lib/throttle.d.ts +5 -0
  63. package/types/dashboard/table.d.ts +3 -1
  64. package/types/dashboard/template-dashboard.d.ts +4 -1
  65. package/types/dashboard/template-rail.d.ts +36 -0
  66. package/types/dashboard/template-ui.d.ts +2 -2
  67. package/types/icons/book-open.d.ts +5 -0
  68. package/types/icons/task.d.ts +5 -0
  69. package/dist/dashboard/guide.js +0 -238
  70. package/dist/dashboard/guide.mjs +0 -209
  71. package/types/dashboard/guide.d.ts +0 -23
@@ -1,209 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
3
- import dynamic from "next/dynamic";
4
- import Times from "../icons/times.mjs";
5
- import Button from "../shared/button.mjs";
6
- const Joyride = dynamic(() => import("react-joyride"), { ssr: false });
7
- const Video = dynamic(() => import("../video.mjs"), { ssr: false });
8
- import WrapperGradient from "../wrapper-gradient.mjs";
9
- const Beacon = forwardRef((props, ref) => {
10
- return /* @__PURE__ */ jsx(
11
- Button,
12
- {
13
- ...{
14
- "aria-label": props["aria-label"],
15
- inline: true,
16
- onClick: props.onClick,
17
- onMouseEnter: props.onMouseEnter,
18
- ref,
19
- title: props.title,
20
- variant: "link"
21
- },
22
- children: /* @__PURE__ */ jsx(
23
- "span",
24
- {
25
- ...{
26
- className: "block w-4 h-4 bg-green rounded-full animate-pulse"
27
- }
28
- }
29
- )
30
- }
31
- );
32
- });
33
- Beacon.displayName = "Beacon";
34
- const Tooltip = ({
35
- backProps,
36
- continuous,
37
- index,
38
- primaryProps,
39
- skipProps,
40
- step,
41
- tooltipProps
42
- }) => {
43
- var _a;
44
- const { children: skipLabel, ...skip } = skipProps;
45
- return /* @__PURE__ */ jsxs(
46
- "div",
47
- {
48
- ...{
49
- className: "w-dvw max-w-md bg-white rounded overflow-hidden shadow-lg",
50
- ...tooltipProps
51
- },
52
- children: [
53
- /* @__PURE__ */ jsxs(
54
- "div",
55
- {
56
- ...{
57
- className: "w-full flex items-center justify-between bg-white px-6 pt-6 pb-3 space-x-6"
58
- },
59
- children: [
60
- (step == null ? void 0 : step.title) && /* @__PURE__ */ jsx(
61
- "p",
62
- {
63
- ...{
64
- className: "text-md lg:text-lg"
65
- },
66
- children: step.title
67
- }
68
- ),
69
- /* @__PURE__ */ jsx(
70
- Button,
71
- {
72
- ...{
73
- icon: Times,
74
- inline: true,
75
- variant: "link",
76
- ...skip
77
- }
78
- }
79
- )
80
- ]
81
- }
82
- ),
83
- ((step == null ? void 0 : step.title) || (step == null ? void 0 : step.content)) && /* @__PURE__ */ jsxs(
84
- "div",
85
- {
86
- ...{
87
- className: "w-full relative px-6 space-y-2"
88
- },
89
- children: [
90
- ((_a = step == null ? void 0 : step.data) == null ? void 0 : _a.video) && /* @__PURE__ */ jsx(
91
- "div",
92
- {
93
- ...{
94
- className: "w-full py-3"
95
- },
96
- children: /* @__PURE__ */ jsx(
97
- Video,
98
- {
99
- ...{
100
- className: "aspect-video",
101
- controls: true,
102
- mp4: step.data.video
103
- }
104
- }
105
- )
106
- }
107
- ),
108
- (step == null ? void 0 : step.content) && /* @__PURE__ */ jsx(
109
- WrapperGradient,
110
- {
111
- ...{
112
- classNameScroll: "max-h-48 space-y-4 ",
113
- classNameGradient: "from-white from-[16%] to-transparent h-8"
114
- },
115
- children: step.content.map((line, key) => /* @__PURE__ */ jsx("p", { children: line }, key))
116
- }
117
- )
118
- ]
119
- }
120
- ),
121
- continuous && /* @__PURE__ */ jsxs(
122
- "div",
123
- {
124
- ...{
125
- className: "flex items-center justify-between space-x-6 p-6"
126
- },
127
- children: [
128
- /* @__PURE__ */ jsx("span", { children: index > 0 && /* @__PURE__ */ jsx(
129
- Button,
130
- {
131
- ...{
132
- inline: true,
133
- size: "small",
134
- variant: "secondary",
135
- ...backProps
136
- },
137
- children: backProps.title
138
- }
139
- ) }),
140
- /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
141
- Button,
142
- {
143
- ...{
144
- inline: true,
145
- size: "small",
146
- ...primaryProps
147
- },
148
- children: primaryProps.title
149
- }
150
- ) })
151
- ]
152
- }
153
- )
154
- ]
155
- }
156
- );
157
- };
158
- const Guide = ({
159
- steps = [],
160
- ...rest
161
- }) => {
162
- if (steps.length > 0) {
163
- return /* @__PURE__ */ jsx(
164
- Joyride,
165
- {
166
- ...{
167
- beaconComponent: Beacon,
168
- continuous: true,
169
- disableCloseOnEsc: true,
170
- disableOverlayClose: true,
171
- disableScrolling: false,
172
- disableScrollParentFix: true,
173
- floaterProps: {
174
- styles: {
175
- arrow: {
176
- length: 8,
177
- spread: 16
178
- },
179
- floater: {
180
- filter: "none"
181
- }
182
- }
183
- },
184
- locale: {
185
- back: "Back",
186
- close: "Close",
187
- last: "Done",
188
- next: "Next",
189
- skip: "Skip"
190
- },
191
- spotlightPadding: 0,
192
- steps,
193
- styles: {
194
- overlay: {
195
- height: "100%"
196
- }
197
- },
198
- tooltipComponent: Tooltip,
199
- ...rest
200
- }
201
- }
202
- );
203
- }
204
- return null;
205
- };
206
- var guide_default = Guide;
207
- export {
208
- guide_default as default
209
- };
@@ -1,23 +0,0 @@
1
- import { ComponentType, ReactNode } from 'react';
2
-
3
- export interface GuideStep {
4
- content?: ReactNode[];
5
- // data.video is an mp4 shown above the content; other keys are the
6
- // caller's callback hooks ( e.g. 'next.step:before' ).
7
- data?: { video?: string; [ key: string ]: unknown };
8
- disableBeacon?: boolean;
9
- placement?: string;
10
- target: string | HTMLElement;
11
- title?: ReactNode;
12
- [ key: string ]: unknown;
13
- }
14
-
15
- // Everything else is passed to react-joyride ( run, stepIndex, callback… ).
16
- export interface GuideProps {
17
- steps?: GuideStep[];
18
- [ key: string ]: unknown;
19
- }
20
-
21
- declare const Guide: ComponentType<GuideProps>;
22
-
23
- export default Guide;