@wealthx/shadcn 1.5.11 → 1.5.13
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/.turbo/turbo-build.log +88 -88
- package/CHANGELOG.md +12 -0
- package/dist/{chunk-O5CP6VP6.mjs → chunk-BF5FKUF6.mjs} +104 -63
- package/dist/{chunk-ZMTCMP2G.mjs → chunk-EB626HVW.mjs} +70 -3
- package/dist/chunk-KICT4VQL.mjs +508 -0
- package/dist/chunk-V23CBULF.mjs +432 -0
- package/dist/components/ui/ai-conversations.js +70 -3
- package/dist/components/ui/ai-conversations.mjs +1 -1
- package/dist/components/ui/appointment-calendar-view.js +177 -176
- package/dist/components/ui/appointment-calendar-view.mjs +1 -1
- package/dist/components/ui/bank-statement-generate-dialog.js +209 -107
- package/dist/components/ui/bank-statement-generate-dialog.mjs +2 -1
- package/dist/components/ui/resource-center/index.js +1030 -0
- package/dist/components/ui/resource-center/index.mjs +29 -0
- package/dist/index.js +661 -403
- package/dist/index.mjs +16 -14
- package/dist/styles.css +1 -1
- package/package.json +4 -4
- package/src/components/index.tsx +2 -0
- package/src/components/ui/ai-conversations.tsx +157 -23
- package/src/components/ui/appointment-calendar-view.tsx +211 -199
- package/src/components/ui/bank-statement-generate-dialog.tsx +147 -96
- package/src/components/ui/resource-center/index.tsx +35 -0
- package/src/components/ui/resource-center/resource-cards.tsx +218 -0
- package/src/components/ui/resource-center/resource-carousel.tsx +122 -0
- package/src/components/ui/resource-center/resource-center-header.tsx +95 -0
- package/src/components/ui/resource-center/resource-email-editor-dialog.tsx +131 -0
- package/src/components/ui/resource-center/resource-modal.tsx +76 -0
- package/src/components/ui/resource-center/types.ts +81 -0
- package/src/styles/styles-css.ts +1 -1
- package/tsup.config.ts +1 -1
- package/dist/chunk-IODGRCQG.mjs +0 -438
- package/dist/chunk-XYWEGBAA.mjs +0 -348
- package/dist/components/ui/resource-center.js +0 -748
- package/dist/components/ui/resource-center.mjs +0 -24
- package/src/components/ui/resource-center.tsx +0 -539
|
@@ -0,0 +1,508 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Dialog,
|
|
3
|
+
DialogContent,
|
|
4
|
+
DialogHeader,
|
|
5
|
+
DialogTitle
|
|
6
|
+
} from "./chunk-LI2CTS5O.mjs";
|
|
7
|
+
import {
|
|
8
|
+
Badge
|
|
9
|
+
} from "./chunk-X6RC5UWB.mjs";
|
|
10
|
+
import {
|
|
11
|
+
ToggleGroup,
|
|
12
|
+
ToggleGroupItem
|
|
13
|
+
} from "./chunk-OWFQSXVD.mjs";
|
|
14
|
+
import {
|
|
15
|
+
Input
|
|
16
|
+
} from "./chunk-LBTHZSBT.mjs";
|
|
17
|
+
import {
|
|
18
|
+
Button
|
|
19
|
+
} from "./chunk-NOOEKOWY.mjs";
|
|
20
|
+
import {
|
|
21
|
+
cn
|
|
22
|
+
} from "./chunk-AFML43VJ.mjs";
|
|
23
|
+
|
|
24
|
+
// src/components/ui/resource-center/resource-carousel.tsx
|
|
25
|
+
import { useRef, useState } from "react";
|
|
26
|
+
import {
|
|
27
|
+
ChevronLeft,
|
|
28
|
+
ChevronRight,
|
|
29
|
+
GalleryHorizontal,
|
|
30
|
+
LayoutGrid
|
|
31
|
+
} from "lucide-react";
|
|
32
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
33
|
+
function ResourceCarousel({
|
|
34
|
+
title,
|
|
35
|
+
items,
|
|
36
|
+
headerAction,
|
|
37
|
+
onViewModeChange,
|
|
38
|
+
className
|
|
39
|
+
}) {
|
|
40
|
+
const scrollRef = useRef(null);
|
|
41
|
+
const [viewMode, setViewMode] = useState("compact");
|
|
42
|
+
function scrollLeft() {
|
|
43
|
+
var _a;
|
|
44
|
+
(_a = scrollRef.current) == null ? void 0 : _a.scrollBy({ left: -380, behavior: "smooth" });
|
|
45
|
+
}
|
|
46
|
+
function scrollRight() {
|
|
47
|
+
var _a;
|
|
48
|
+
(_a = scrollRef.current) == null ? void 0 : _a.scrollBy({ left: 380, behavior: "smooth" });
|
|
49
|
+
}
|
|
50
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-4", className), children: [
|
|
51
|
+
(title || headerAction) && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4", children: [
|
|
52
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-1 items-center gap-4 min-w-0", children: [
|
|
53
|
+
title && /* @__PURE__ */ jsx("h2", { className: "text-h3 text-foreground", children: title }),
|
|
54
|
+
headerAction && /* @__PURE__ */ jsx("div", { className: "flex-1 flex justify-end", children: headerAction })
|
|
55
|
+
] }),
|
|
56
|
+
/* @__PURE__ */ jsxs(
|
|
57
|
+
ToggleGroup,
|
|
58
|
+
{
|
|
59
|
+
type: "single",
|
|
60
|
+
variant: "outline",
|
|
61
|
+
value: [viewMode],
|
|
62
|
+
onValueChange: (v) => {
|
|
63
|
+
if (v.length > 0) {
|
|
64
|
+
const mode = v[0];
|
|
65
|
+
setViewMode(mode);
|
|
66
|
+
onViewModeChange == null ? void 0 : onViewModeChange(mode);
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"aria-label": "View mode",
|
|
70
|
+
children: [
|
|
71
|
+
/* @__PURE__ */ jsx(ToggleGroupItem, { value: "compact", "aria-label": "Compact view", children: /* @__PURE__ */ jsx(GalleryHorizontal, { className: "size-4" }) }),
|
|
72
|
+
/* @__PURE__ */ jsx(ToggleGroupItem, { value: "grid", "aria-label": "Grid view", children: /* @__PURE__ */ jsx(LayoutGrid, { className: "size-4" }) })
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
] }),
|
|
77
|
+
items.length === 0 ? /* @__PURE__ */ jsx("p", { className: "py-8 text-center text-body-small text-muted-foreground", children: "No items available" }) : viewMode === "grid" ? /* @__PURE__ */ jsx("div", { className: "grid grid-cols-4 gap-6 max-[1280px]:grid-cols-3 max-[900px]:grid-cols-2 max-[600px]:grid-cols-1", children: items.map((item, i) => /* @__PURE__ */ jsx("div", { children: item }, i)) }) : /* @__PURE__ */ jsxs("div", { className: "group/track relative", children: [
|
|
78
|
+
/* @__PURE__ */ jsx(
|
|
79
|
+
"button",
|
|
80
|
+
{
|
|
81
|
+
type: "button",
|
|
82
|
+
onClick: scrollLeft,
|
|
83
|
+
"aria-label": "Scroll left",
|
|
84
|
+
className: cn(
|
|
85
|
+
"absolute left-0 top-1/2 z-10 -translate-x-1/2 -translate-y-1/2",
|
|
86
|
+
"flex size-9 items-center justify-center",
|
|
87
|
+
"border border-border bg-background shadow-sm",
|
|
88
|
+
"opacity-0 transition-opacity duration-200 group-hover/track:opacity-100",
|
|
89
|
+
"hover:bg-muted focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
90
|
+
),
|
|
91
|
+
children: /* @__PURE__ */ jsx(ChevronLeft, { className: "size-4 text-foreground" })
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
/* @__PURE__ */ jsx(
|
|
95
|
+
"div",
|
|
96
|
+
{
|
|
97
|
+
ref: scrollRef,
|
|
98
|
+
className: "flex gap-4 overflow-x-auto scroll-smooth pb-2",
|
|
99
|
+
style: { scrollbarWidth: "none" },
|
|
100
|
+
children: items.map((item, i) => /* @__PURE__ */ jsx("div", { className: "w-[360px] shrink-0", children: item }, i))
|
|
101
|
+
}
|
|
102
|
+
),
|
|
103
|
+
/* @__PURE__ */ jsx(
|
|
104
|
+
"button",
|
|
105
|
+
{
|
|
106
|
+
type: "button",
|
|
107
|
+
onClick: scrollRight,
|
|
108
|
+
"aria-label": "Scroll right",
|
|
109
|
+
className: cn(
|
|
110
|
+
"absolute right-0 top-1/2 z-10 translate-x-1/2 -translate-y-1/2",
|
|
111
|
+
"flex size-9 items-center justify-center",
|
|
112
|
+
"border border-border bg-background shadow-sm",
|
|
113
|
+
"opacity-0 transition-opacity duration-200 group-hover/track:opacity-100",
|
|
114
|
+
"hover:bg-muted focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
115
|
+
),
|
|
116
|
+
children: /* @__PURE__ */ jsx(ChevronRight, { className: "size-4 text-foreground" })
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
] })
|
|
120
|
+
] });
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// src/components/ui/resource-center/resource-center-header.tsx
|
|
124
|
+
import { useState as useState2 } from "react";
|
|
125
|
+
import { Play } from "lucide-react";
|
|
126
|
+
|
|
127
|
+
// src/components/ui/resource-center/resource-modal.tsx
|
|
128
|
+
import { Download } from "lucide-react";
|
|
129
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
130
|
+
function ResourceModal({
|
|
131
|
+
open,
|
|
132
|
+
onClose,
|
|
133
|
+
title,
|
|
134
|
+
videoUrl,
|
|
135
|
+
tags,
|
|
136
|
+
attachments
|
|
137
|
+
}) {
|
|
138
|
+
return /* @__PURE__ */ jsx2(Dialog, { open, onOpenChange: (v) => !v && onClose(), children: /* @__PURE__ */ jsxs2(
|
|
139
|
+
DialogContent,
|
|
140
|
+
{
|
|
141
|
+
size: "2xl",
|
|
142
|
+
className: "flex flex-col gap-4 p-0 overflow-hidden",
|
|
143
|
+
children: [
|
|
144
|
+
/* @__PURE__ */ jsxs2(DialogHeader, { className: "px-6 pt-6 pb-0", children: [
|
|
145
|
+
/* @__PURE__ */ jsx2(DialogTitle, { className: "text-h5", children: title }),
|
|
146
|
+
tags && tags.length > 0 && /* @__PURE__ */ jsx2("div", { className: "flex flex-wrap gap-1.5 pt-1", children: tags.map((tag) => /* @__PURE__ */ jsx2(Badge, { variant: "secondary", children: tag }, tag)) })
|
|
147
|
+
] }),
|
|
148
|
+
videoUrl && /* @__PURE__ */ jsx2("div", { className: "aspect-video w-full bg-foreground", children: /* @__PURE__ */ jsx2(
|
|
149
|
+
"iframe",
|
|
150
|
+
{
|
|
151
|
+
src: videoUrl,
|
|
152
|
+
title,
|
|
153
|
+
className: "h-full w-full",
|
|
154
|
+
allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",
|
|
155
|
+
allowFullScreen: true
|
|
156
|
+
}
|
|
157
|
+
) }),
|
|
158
|
+
attachments && attachments.length > 0 && /* @__PURE__ */ jsxs2("div", { className: "flex flex-col gap-2 px-6 pb-6", children: [
|
|
159
|
+
/* @__PURE__ */ jsx2("p", { className: "text-body-small font-medium text-foreground", children: "Attachments" }),
|
|
160
|
+
/* @__PURE__ */ jsx2("div", { className: "flex flex-col gap-1", children: attachments.map((attachment, i) => /* @__PURE__ */ jsxs2(
|
|
161
|
+
"a",
|
|
162
|
+
{
|
|
163
|
+
href: attachment.url,
|
|
164
|
+
download: true,
|
|
165
|
+
className: "flex items-center gap-2 text-body-small text-primary hover:underline",
|
|
166
|
+
children: [
|
|
167
|
+
/* @__PURE__ */ jsx2(Download, { className: "size-3.5 shrink-0" }),
|
|
168
|
+
attachment.name
|
|
169
|
+
]
|
|
170
|
+
},
|
|
171
|
+
i
|
|
172
|
+
)) })
|
|
173
|
+
] }),
|
|
174
|
+
(!attachments || attachments.length === 0) && /* @__PURE__ */ jsx2("div", { className: "pb-2" })
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
) });
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// src/components/ui/resource-center/resource-center-header.tsx
|
|
181
|
+
import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
182
|
+
function ResourceCenterHeader({
|
|
183
|
+
title,
|
|
184
|
+
description,
|
|
185
|
+
backgroundImageUrl,
|
|
186
|
+
backgroundVideoUrl,
|
|
187
|
+
watchVideoUrl
|
|
188
|
+
}) {
|
|
189
|
+
const [watchModalOpen, setWatchModalOpen] = useState2(false);
|
|
190
|
+
const hasBackground = !!backgroundImageUrl || !!backgroundVideoUrl;
|
|
191
|
+
return /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
192
|
+
/* @__PURE__ */ jsxs3(
|
|
193
|
+
"div",
|
|
194
|
+
{
|
|
195
|
+
className: cn(
|
|
196
|
+
"relative flex min-h-[480px] w-full items-center overflow-hidden max-[900px]:min-h-[360px] max-[600px]:min-h-[260px]"
|
|
197
|
+
),
|
|
198
|
+
children: [
|
|
199
|
+
/* @__PURE__ */ jsx3(
|
|
200
|
+
"div",
|
|
201
|
+
{
|
|
202
|
+
className: cn(
|
|
203
|
+
"absolute inset-0 z-[0]",
|
|
204
|
+
hasBackground ? "bg-foreground" : "bg-gradient-to-br from-primary to-foreground"
|
|
205
|
+
)
|
|
206
|
+
}
|
|
207
|
+
),
|
|
208
|
+
backgroundImageUrl && !backgroundVideoUrl && /* @__PURE__ */ jsx3(
|
|
209
|
+
"img",
|
|
210
|
+
{
|
|
211
|
+
src: backgroundImageUrl,
|
|
212
|
+
alt: "",
|
|
213
|
+
"aria-hidden": "true",
|
|
214
|
+
className: "absolute inset-0 h-full w-full object-cover z-[1]"
|
|
215
|
+
}
|
|
216
|
+
),
|
|
217
|
+
backgroundVideoUrl && /* @__PURE__ */ jsx3(
|
|
218
|
+
"video",
|
|
219
|
+
{
|
|
220
|
+
className: "absolute inset-0 h-full w-full object-cover z-[1]",
|
|
221
|
+
src: backgroundVideoUrl,
|
|
222
|
+
autoPlay: true,
|
|
223
|
+
muted: true,
|
|
224
|
+
loop: true,
|
|
225
|
+
playsInline: true
|
|
226
|
+
}
|
|
227
|
+
),
|
|
228
|
+
/* @__PURE__ */ jsx3(
|
|
229
|
+
"div",
|
|
230
|
+
{
|
|
231
|
+
className: cn(
|
|
232
|
+
"absolute inset-0 z-[2]",
|
|
233
|
+
hasBackground ? "bg-black/50" : "bg-black/20"
|
|
234
|
+
)
|
|
235
|
+
}
|
|
236
|
+
),
|
|
237
|
+
/* @__PURE__ */ jsxs3("div", { className: "relative z-[3] flex flex-col gap-4 px-8 py-12 md:px-16 max-w-3xl", children: [
|
|
238
|
+
/* @__PURE__ */ jsx3("h1", { className: "text-[56px] font-bold text-white leading-none max-[900px]:text-[40px] max-[600px]:text-[32px]", children: title }),
|
|
239
|
+
/* @__PURE__ */ jsx3("p", { className: "text-body-medium text-white/80 leading-relaxed", children: description }),
|
|
240
|
+
watchVideoUrl && /* @__PURE__ */ jsx3("div", { className: "pt-2", children: /* @__PURE__ */ jsxs3(Button, { variant: "default", onClick: () => setWatchModalOpen(true), children: [
|
|
241
|
+
/* @__PURE__ */ jsx3(Play, { className: "mr-2 size-4" }),
|
|
242
|
+
"Watch Now"
|
|
243
|
+
] }) })
|
|
244
|
+
] })
|
|
245
|
+
]
|
|
246
|
+
}
|
|
247
|
+
),
|
|
248
|
+
watchVideoUrl && /* @__PURE__ */ jsx3(
|
|
249
|
+
ResourceModal,
|
|
250
|
+
{
|
|
251
|
+
open: watchModalOpen,
|
|
252
|
+
onClose: () => setWatchModalOpen(false),
|
|
253
|
+
title,
|
|
254
|
+
videoUrl: watchVideoUrl
|
|
255
|
+
}
|
|
256
|
+
)
|
|
257
|
+
] });
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// src/components/ui/resource-center/resource-cards.tsx
|
|
261
|
+
import { useState as useState3 } from "react";
|
|
262
|
+
import { Download as Download2, Play as Play2 } from "lucide-react";
|
|
263
|
+
import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
264
|
+
function ResourceVideoCard({ video }) {
|
|
265
|
+
const [modalOpen, setModalOpen] = useState3(false);
|
|
266
|
+
return /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
267
|
+
/* @__PURE__ */ jsxs4(
|
|
268
|
+
"button",
|
|
269
|
+
{
|
|
270
|
+
type: "button",
|
|
271
|
+
onClick: () => setModalOpen(true),
|
|
272
|
+
className: "group relative flex w-full flex-col gap-2 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
273
|
+
children: [
|
|
274
|
+
/* @__PURE__ */ jsxs4("div", { className: "relative w-full overflow-hidden bg-muted aspect-video", children: [
|
|
275
|
+
video.thumbnailUrl ? /* @__PURE__ */ jsx4(
|
|
276
|
+
"img",
|
|
277
|
+
{
|
|
278
|
+
src: video.thumbnailUrl,
|
|
279
|
+
alt: video.title,
|
|
280
|
+
className: "h-full w-full object-cover transition-transform duration-200 group-hover:scale-105"
|
|
281
|
+
}
|
|
282
|
+
) : /* @__PURE__ */ jsx4("div", { className: "flex h-full w-full items-center justify-center", children: /* @__PURE__ */ jsx4(Play2, { className: "size-10 text-muted-foreground opacity-40" }) }),
|
|
283
|
+
/* @__PURE__ */ jsx4("div", { className: "absolute inset-0 flex items-center justify-center bg-black/30 opacity-0 transition-opacity duration-200 group-hover:opacity-100", children: /* @__PURE__ */ jsx4("div", { className: "flex size-12 items-center justify-center bg-background/90", children: /* @__PURE__ */ jsx4(Play2, { className: "size-5 text-foreground" }) }) }),
|
|
284
|
+
video.duration && /* @__PURE__ */ jsx4("span", { className: "absolute bottom-2 right-2 bg-black/70 px-1.5 py-0.5 text-caption text-white", children: video.duration })
|
|
285
|
+
] }),
|
|
286
|
+
/* @__PURE__ */ jsx4("p", { className: "text-body-medium font-semibold text-foreground leading-snug line-clamp-2", children: video.title })
|
|
287
|
+
]
|
|
288
|
+
}
|
|
289
|
+
),
|
|
290
|
+
/* @__PURE__ */ jsx4(
|
|
291
|
+
ResourceModal,
|
|
292
|
+
{
|
|
293
|
+
open: modalOpen,
|
|
294
|
+
onClose: () => setModalOpen(false),
|
|
295
|
+
title: video.title,
|
|
296
|
+
videoUrl: video.videoUrl,
|
|
297
|
+
tags: video.tags,
|
|
298
|
+
attachments: video.attachments
|
|
299
|
+
}
|
|
300
|
+
)
|
|
301
|
+
] });
|
|
302
|
+
}
|
|
303
|
+
function ResourceEmailTemplateCard({
|
|
304
|
+
template,
|
|
305
|
+
onClick
|
|
306
|
+
}) {
|
|
307
|
+
if (template.isAddTemplate) {
|
|
308
|
+
return /* @__PURE__ */ jsxs4(
|
|
309
|
+
"button",
|
|
310
|
+
{
|
|
311
|
+
type: "button",
|
|
312
|
+
onClick,
|
|
313
|
+
className: cn(
|
|
314
|
+
"flex w-full flex-col items-center justify-center gap-3",
|
|
315
|
+
"border-2 border-dashed border-border bg-muted/40",
|
|
316
|
+
"aspect-video hover:border-primary hover:bg-muted/70 transition-colors",
|
|
317
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
318
|
+
),
|
|
319
|
+
children: [
|
|
320
|
+
/* @__PURE__ */ jsx4("div", { className: "flex size-10 items-center justify-center border-2 border-dashed border-muted-foreground/40", children: /* @__PURE__ */ jsx4("span", { className: "text-2xl text-muted-foreground/60", children: "+" }) }),
|
|
321
|
+
/* @__PURE__ */ jsx4("p", { className: "text-body-small font-medium text-muted-foreground", children: "Add Template" })
|
|
322
|
+
]
|
|
323
|
+
}
|
|
324
|
+
);
|
|
325
|
+
}
|
|
326
|
+
return /* @__PURE__ */ jsxs4(
|
|
327
|
+
"button",
|
|
328
|
+
{
|
|
329
|
+
type: "button",
|
|
330
|
+
onClick,
|
|
331
|
+
className: "group relative flex w-full flex-col gap-2 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
332
|
+
children: [
|
|
333
|
+
/* @__PURE__ */ jsxs4("div", { className: "relative w-full overflow-hidden border border-border bg-background aspect-video", children: [
|
|
334
|
+
template.htmlContent ? /* @__PURE__ */ jsx4(
|
|
335
|
+
"iframe",
|
|
336
|
+
{
|
|
337
|
+
srcDoc: template.htmlContent,
|
|
338
|
+
title: template.title,
|
|
339
|
+
className: "h-full w-full pointer-events-none",
|
|
340
|
+
style: {
|
|
341
|
+
transform: "scale(0.5)",
|
|
342
|
+
transformOrigin: "top left",
|
|
343
|
+
width: "200%",
|
|
344
|
+
height: "200%"
|
|
345
|
+
},
|
|
346
|
+
sandbox: "allow-same-origin"
|
|
347
|
+
}
|
|
348
|
+
) : /* @__PURE__ */ jsx4("div", { className: "flex h-full w-full items-center justify-center bg-muted", children: /* @__PURE__ */ jsx4("p", { className: "text-caption text-muted-foreground", children: "No preview available" }) }),
|
|
349
|
+
/* @__PURE__ */ jsx4("div", { className: "absolute inset-0 flex items-center justify-center bg-foreground/60 opacity-0 transition-opacity duration-200 group-hover:opacity-100", children: /* @__PURE__ */ jsx4("span", { className: "text-body-small font-medium text-white", children: "Use Template" }) })
|
|
350
|
+
] }),
|
|
351
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center justify-between gap-2", children: [
|
|
352
|
+
/* @__PURE__ */ jsx4("p", { className: "text-body-small font-medium text-foreground leading-snug line-clamp-1", children: template.title }),
|
|
353
|
+
template.type && /* @__PURE__ */ jsx4(Badge, { variant: "secondary", className: "shrink-0", children: template.type === "system" ? "System" : "Company" })
|
|
354
|
+
] })
|
|
355
|
+
]
|
|
356
|
+
}
|
|
357
|
+
);
|
|
358
|
+
}
|
|
359
|
+
function ResourceDocumentCard({
|
|
360
|
+
document,
|
|
361
|
+
onClick
|
|
362
|
+
}) {
|
|
363
|
+
return /* @__PURE__ */ jsxs4("div", { className: "flex w-full flex-col gap-2", children: [
|
|
364
|
+
/* @__PURE__ */ jsxs4(
|
|
365
|
+
"button",
|
|
366
|
+
{
|
|
367
|
+
type: "button",
|
|
368
|
+
onClick,
|
|
369
|
+
className: "group relative w-full overflow-hidden border border-border bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring aspect-video",
|
|
370
|
+
children: [
|
|
371
|
+
document.pdfUrl ? /* @__PURE__ */ jsx4(
|
|
372
|
+
"iframe",
|
|
373
|
+
{
|
|
374
|
+
src: document.pdfUrl,
|
|
375
|
+
title: document.title,
|
|
376
|
+
className: "h-full w-full pointer-events-none"
|
|
377
|
+
}
|
|
378
|
+
) : document.thumbnailUrl ? /* @__PURE__ */ jsx4(
|
|
379
|
+
"img",
|
|
380
|
+
{
|
|
381
|
+
src: document.thumbnailUrl,
|
|
382
|
+
alt: document.title,
|
|
383
|
+
className: "h-full w-full object-cover"
|
|
384
|
+
}
|
|
385
|
+
) : /* @__PURE__ */ jsxs4("div", { className: "flex h-full w-full flex-col items-center justify-center gap-2", children: [
|
|
386
|
+
/* @__PURE__ */ jsx4("div", { className: "flex items-center justify-center bg-muted-foreground/10 p-4", children: /* @__PURE__ */ jsx4(Download2, { className: "size-8 text-muted-foreground opacity-50" }) }),
|
|
387
|
+
/* @__PURE__ */ jsx4("span", { className: "text-caption text-muted-foreground", children: document.title })
|
|
388
|
+
] }),
|
|
389
|
+
/* @__PURE__ */ jsx4("div", { className: "absolute inset-0 bg-foreground/40 opacity-0 transition-opacity duration-200 group-hover:opacity-100" })
|
|
390
|
+
]
|
|
391
|
+
}
|
|
392
|
+
),
|
|
393
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center justify-between gap-2", children: [
|
|
394
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-1 min-w-0", children: [
|
|
395
|
+
/* @__PURE__ */ jsx4("p", { className: "text-body-small font-medium text-foreground leading-snug line-clamp-1", children: document.title }),
|
|
396
|
+
document.tags && document.tags.length > 0 && /* @__PURE__ */ jsx4("div", { className: "flex flex-wrap gap-1", children: document.tags.map((tag) => /* @__PURE__ */ jsx4(Badge, { variant: "secondary", children: tag }, tag)) })
|
|
397
|
+
] }),
|
|
398
|
+
document.downloadUrl && /* @__PURE__ */ jsx4(
|
|
399
|
+
"a",
|
|
400
|
+
{
|
|
401
|
+
href: document.downloadUrl,
|
|
402
|
+
download: true,
|
|
403
|
+
onClick: (e) => e.stopPropagation(),
|
|
404
|
+
className: "shrink-0",
|
|
405
|
+
"aria-label": `Download ${document.title}`,
|
|
406
|
+
children: /* @__PURE__ */ jsx4(Button, { variant: "outline", size: "icon", className: "size-8", children: /* @__PURE__ */ jsx4(Download2, { className: "size-4" }) })
|
|
407
|
+
}
|
|
408
|
+
)
|
|
409
|
+
] })
|
|
410
|
+
] });
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
// src/components/ui/resource-center/resource-email-editor-dialog.tsx
|
|
414
|
+
import { useState as useState4 } from "react";
|
|
415
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
416
|
+
var EDITOR_CONTENT_TYPES = [
|
|
417
|
+
"Columns",
|
|
418
|
+
"Button",
|
|
419
|
+
"Divider",
|
|
420
|
+
"Heading",
|
|
421
|
+
"Paragraph",
|
|
422
|
+
"Image",
|
|
423
|
+
"Social",
|
|
424
|
+
"Menu",
|
|
425
|
+
"HTML"
|
|
426
|
+
];
|
|
427
|
+
function ResourceEmailEditorDialog({
|
|
428
|
+
open,
|
|
429
|
+
onClose,
|
|
430
|
+
onSave,
|
|
431
|
+
editorSlot
|
|
432
|
+
}) {
|
|
433
|
+
const [templateName, setTemplateName] = useState4("");
|
|
434
|
+
function handleSave() {
|
|
435
|
+
onSave(templateName);
|
|
436
|
+
}
|
|
437
|
+
function handleClose() {
|
|
438
|
+
setTemplateName("");
|
|
439
|
+
onClose();
|
|
440
|
+
}
|
|
441
|
+
return /* @__PURE__ */ jsx5(Dialog, { open, onOpenChange: (v) => !v && handleClose(), children: /* @__PURE__ */ jsxs5(
|
|
442
|
+
DialogContent,
|
|
443
|
+
{
|
|
444
|
+
size: "4xl",
|
|
445
|
+
className: "flex flex-col gap-0 p-0 overflow-hidden h-[90vh]",
|
|
446
|
+
children: [
|
|
447
|
+
/* @__PURE__ */ jsxs5("div", { className: "shrink-0 border-b border-border px-6 py-4", children: [
|
|
448
|
+
/* @__PURE__ */ jsx5("p", { className: "text-label-small text-muted-foreground mb-1", children: "Template Name" }),
|
|
449
|
+
/* @__PURE__ */ jsx5(
|
|
450
|
+
Input,
|
|
451
|
+
{
|
|
452
|
+
placeholder: "Enter template name",
|
|
453
|
+
value: templateName,
|
|
454
|
+
onChange: (e) => setTemplateName(e.target.value),
|
|
455
|
+
className: "border-none shadow-none px-0 text-body-medium h-auto focus-visible:ring-0 bg-transparent"
|
|
456
|
+
}
|
|
457
|
+
)
|
|
458
|
+
] }),
|
|
459
|
+
/* @__PURE__ */ jsx5("div", { className: "flex-1 overflow-hidden", children: editorSlot != null ? editorSlot : /* @__PURE__ */ jsx5(EditorPlaceholder, {}) }),
|
|
460
|
+
/* @__PURE__ */ jsxs5("div", { className: "shrink-0 flex items-center justify-between border-t border-border px-6 py-4", children: [
|
|
461
|
+
/* @__PURE__ */ jsx5(Button, { variant: "outline", onClick: handleClose, children: "Back" }),
|
|
462
|
+
/* @__PURE__ */ jsx5(Button, { variant: "default", onClick: handleSave, children: "Save Email" })
|
|
463
|
+
] })
|
|
464
|
+
]
|
|
465
|
+
}
|
|
466
|
+
) });
|
|
467
|
+
}
|
|
468
|
+
function EditorPlaceholder() {
|
|
469
|
+
return /* @__PURE__ */ jsxs5("div", { className: "flex h-full", children: [
|
|
470
|
+
/* @__PURE__ */ jsx5("div", { className: "flex flex-1 items-center justify-center bg-[#f4f4f4]", children: /* @__PURE__ */ jsx5("div", { className: "max-w-[500px] w-full border-2 border-dashed border-[#9ecbf0] bg-[#e8f4ff] px-16 py-10 text-center", children: /* @__PURE__ */ jsx5("p", { className: "text-body-small text-[#5c9fd8]", children: "No content here. Drag content from right." }) }) }),
|
|
471
|
+
/* @__PURE__ */ jsxs5("div", { className: "w-[280px] shrink-0 flex flex-col border-l border-border bg-background", children: [
|
|
472
|
+
/* @__PURE__ */ jsx5("div", { className: "flex border-b border-border", children: ["Content", "Blocks", "Body"].map((tab, i) => /* @__PURE__ */ jsx5(
|
|
473
|
+
"button",
|
|
474
|
+
{
|
|
475
|
+
type: "button",
|
|
476
|
+
className: cn(
|
|
477
|
+
"flex flex-1 flex-col items-center gap-1 py-3 text-caption",
|
|
478
|
+
i === 0 ? "text-foreground border-b-2 border-foreground" : "text-muted-foreground"
|
|
479
|
+
),
|
|
480
|
+
children: tab
|
|
481
|
+
},
|
|
482
|
+
tab
|
|
483
|
+
)) }),
|
|
484
|
+
/* @__PURE__ */ jsx5("div", { className: "grid grid-cols-3 gap-2 p-3", children: EDITOR_CONTENT_TYPES.map((item) => /* @__PURE__ */ jsxs5(
|
|
485
|
+
"div",
|
|
486
|
+
{
|
|
487
|
+
className: "flex flex-col items-center gap-1.5 border border-border p-2 hover:bg-muted transition-colors cursor-grab",
|
|
488
|
+
children: [
|
|
489
|
+
/* @__PURE__ */ jsx5("div", { className: "size-6 bg-foreground/10 flex items-center justify-center", children: /* @__PURE__ */ jsx5("span", { className: "text-[10px] text-foreground/40", children: "\u25A4" }) }),
|
|
490
|
+
/* @__PURE__ */ jsx5("span", { className: "text-[11px] text-foreground leading-none text-center", children: item })
|
|
491
|
+
]
|
|
492
|
+
},
|
|
493
|
+
item
|
|
494
|
+
)) }),
|
|
495
|
+
/* @__PURE__ */ jsx5("div", { className: "mt-auto border-t border-border py-2.5 text-center", children: /* @__PURE__ */ jsx5("span", { className: "text-caption text-muted-foreground", children: "\u26A1 by Unlayer Editor" }) })
|
|
496
|
+
] })
|
|
497
|
+
] });
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
export {
|
|
501
|
+
ResourceCarousel,
|
|
502
|
+
ResourceModal,
|
|
503
|
+
ResourceCenterHeader,
|
|
504
|
+
ResourceVideoCard,
|
|
505
|
+
ResourceEmailTemplateCard,
|
|
506
|
+
ResourceDocumentCard,
|
|
507
|
+
ResourceEmailEditorDialog
|
|
508
|
+
};
|