@pelatform/starter.shared 0.2.16 → 0.2.18
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/index.d.ts +52 -22
- package/dist/index.js +366 -221
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import Link3 from "next/link";
|
|
|
5
5
|
import { usePathname } from "next/navigation";
|
|
6
6
|
import { useTranslations as useTranslations4 } from "next-intl";
|
|
7
7
|
import { useConfig as useConfig3 } from "@pelatform/starter.hook";
|
|
8
|
+
import { cn as cn3 } from "pelatform-ui";
|
|
8
9
|
import { LayoutBlank } from "pelatform-ui/components";
|
|
9
10
|
|
|
10
11
|
// src/components/logo.tsx
|
|
@@ -52,11 +53,11 @@ import { useTranslations as useTranslations2 } from "next-intl";
|
|
|
52
53
|
import { useSession as useSession2 } from "@pelatform/starter.hook";
|
|
53
54
|
import { ScreenLoader } from "pelatform-ui/components";
|
|
54
55
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
55
|
-
function LayoutLoader({ children }) {
|
|
56
|
+
function LayoutLoader({ children, className }) {
|
|
56
57
|
const t = useTranslations2();
|
|
57
58
|
const { isPending } = useSession2();
|
|
58
59
|
if (isPending) {
|
|
59
|
-
return /* @__PURE__ */ jsx3(ScreenLoader, { loadingText: t("common.status.loading") });
|
|
60
|
+
return /* @__PURE__ */ jsx3(ScreenLoader, { className, loadingText: t("common.status.loading") });
|
|
60
61
|
}
|
|
61
62
|
return children;
|
|
62
63
|
}
|
|
@@ -148,6 +149,7 @@ function ToolbarRSC({ show = DEFAULT_SHOW }) {
|
|
|
148
149
|
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
149
150
|
function AuthLayout({
|
|
150
151
|
children,
|
|
152
|
+
className,
|
|
151
153
|
logo = /* @__PURE__ */ jsx6(LogoWithHref, {}),
|
|
152
154
|
disableFooter = false,
|
|
153
155
|
signInHint = false,
|
|
@@ -184,7 +186,7 @@ function AuthLayout({
|
|
|
184
186
|
/* @__PURE__ */ jsx6(
|
|
185
187
|
LayoutBlank,
|
|
186
188
|
{
|
|
187
|
-
className: "[&_.max-w-4xl]:max-w-sm [&_.max-w-4xl]:px-0",
|
|
189
|
+
className: cn3("[&_.max-w-4xl]:max-w-sm [&_.max-w-4xl]:px-0", className),
|
|
188
190
|
logo,
|
|
189
191
|
footer: disableFooter || pathname === path.auth.SIGN_OUT || pathname === path.auth.CALLBACK ? null : footer,
|
|
190
192
|
children
|
|
@@ -200,6 +202,7 @@ import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
|
200
202
|
import { usePathname as usePathname2 } from "next/navigation";
|
|
201
203
|
import { MenuIcon, PanelRightIcon } from "lucide-react";
|
|
202
204
|
import { useLayout } from "@pelatform/starter.hook";
|
|
205
|
+
import { cn as cn6 } from "pelatform-ui";
|
|
203
206
|
import {
|
|
204
207
|
Button as Button2,
|
|
205
208
|
Sheet,
|
|
@@ -215,7 +218,14 @@ import {
|
|
|
215
218
|
import { Fragment as Fragment2, useCallback, useEffect, useState } from "react";
|
|
216
219
|
import Link4 from "next/link";
|
|
217
220
|
import { useRouter as useRouter2 } from "next/navigation";
|
|
218
|
-
import {
|
|
221
|
+
import {
|
|
222
|
+
HouseIcon,
|
|
223
|
+
LogOutIcon,
|
|
224
|
+
PlusCircleIcon,
|
|
225
|
+
SettingsIcon,
|
|
226
|
+
ShieldIcon,
|
|
227
|
+
UserStarIcon
|
|
228
|
+
} from "lucide-react";
|
|
219
229
|
import { useTranslations as useTranslations7 } from "next-intl";
|
|
220
230
|
import {
|
|
221
231
|
useConfig as useConfig4,
|
|
@@ -238,13 +248,13 @@ import {
|
|
|
238
248
|
// src/components/view.tsx
|
|
239
249
|
import { KeyRoundIcon } from "lucide-react";
|
|
240
250
|
import { useLocale as useLocale2, useTranslations as useTranslations6 } from "next-intl";
|
|
241
|
-
import { cn as
|
|
251
|
+
import { cn as cn5, formatDate, getUserName as getUserName2 } from "pelatform-ui";
|
|
242
252
|
import { Skeleton as Skeleton2 } from "pelatform-ui/default";
|
|
243
253
|
|
|
244
254
|
// src/components/avatar.tsx
|
|
245
255
|
import { BuildingIcon, UserRoundIcon } from "lucide-react";
|
|
246
256
|
import { useTranslations as useTranslations5 } from "next-intl";
|
|
247
|
-
import { cn as
|
|
257
|
+
import { cn as cn4, getSizeAvatar, getUserName } from "pelatform-ui";
|
|
248
258
|
import { getInitials } from "pelatform-ui/components";
|
|
249
259
|
import { Avatar, AvatarFallback, AvatarImage, Skeleton } from "pelatform-ui/default";
|
|
250
260
|
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
@@ -264,7 +274,7 @@ function UserAvatar({
|
|
|
264
274
|
return /* @__PURE__ */ jsx7(
|
|
265
275
|
Skeleton,
|
|
266
276
|
{
|
|
267
|
-
className:
|
|
277
|
+
className: cn4(
|
|
268
278
|
"shrink-0 rounded-full",
|
|
269
279
|
getSizeAvatar(size),
|
|
270
280
|
className,
|
|
@@ -277,7 +287,7 @@ function UserAvatar({
|
|
|
277
287
|
return /* @__PURE__ */ jsxs5(
|
|
278
288
|
Avatar,
|
|
279
289
|
{
|
|
280
|
-
className:
|
|
290
|
+
className: cn4("rounded-full bg-accent", getSizeAvatar(size), className, classNames?.base),
|
|
281
291
|
...props,
|
|
282
292
|
children: [
|
|
283
293
|
/* @__PURE__ */ jsx7(
|
|
@@ -291,9 +301,9 @@ function UserAvatar({
|
|
|
291
301
|
/* @__PURE__ */ jsx7(
|
|
292
302
|
AvatarFallback,
|
|
293
303
|
{
|
|
294
|
-
className:
|
|
304
|
+
className: cn4("text-foreground uppercase", classNames?.fallback),
|
|
295
305
|
delayMs: src ? 600 : void 0,
|
|
296
|
-
children: getInitials(name, 2) || /* @__PURE__ */ jsx7(UserRoundIcon, { className:
|
|
306
|
+
children: getInitials(name, 2) || /* @__PURE__ */ jsx7(UserRoundIcon, { className: cn4("size-[50%]", classNames?.fallbackIcon) })
|
|
297
307
|
}
|
|
298
308
|
)
|
|
299
309
|
]
|
|
@@ -316,7 +326,7 @@ function WorkspaceLogo({
|
|
|
316
326
|
return /* @__PURE__ */ jsx7(
|
|
317
327
|
Skeleton,
|
|
318
328
|
{
|
|
319
|
-
className:
|
|
329
|
+
className: cn4(
|
|
320
330
|
"shrink-0 rounded-full",
|
|
321
331
|
getSizeAvatar(size),
|
|
322
332
|
className,
|
|
@@ -329,7 +339,7 @@ function WorkspaceLogo({
|
|
|
329
339
|
return /* @__PURE__ */ jsxs5(
|
|
330
340
|
Avatar,
|
|
331
341
|
{
|
|
332
|
-
className:
|
|
342
|
+
className: cn4("rounded-full bg-accent", getSizeAvatar(size), className, classNames?.base),
|
|
333
343
|
...props,
|
|
334
344
|
children: [
|
|
335
345
|
/* @__PURE__ */ jsx7(
|
|
@@ -343,9 +353,9 @@ function WorkspaceLogo({
|
|
|
343
353
|
/* @__PURE__ */ jsx7(
|
|
344
354
|
AvatarFallback,
|
|
345
355
|
{
|
|
346
|
-
className:
|
|
356
|
+
className: cn4("text-foreground", classNames?.fallback),
|
|
347
357
|
delayMs: src ? 600 : void 0,
|
|
348
|
-
children: /* @__PURE__ */ jsx7(BuildingIcon, { className:
|
|
358
|
+
children: /* @__PURE__ */ jsx7(BuildingIcon, { className: cn4("size-[50%]", classNames?.fallbackIcon) })
|
|
349
359
|
}
|
|
350
360
|
)
|
|
351
361
|
]
|
|
@@ -357,22 +367,22 @@ function WorkspaceLogo({
|
|
|
357
367
|
import { Fragment, jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
358
368
|
function UserView({ className, classNames, isPending, size, user }) {
|
|
359
369
|
const t = useTranslations6();
|
|
360
|
-
return /* @__PURE__ */ jsxs6("div", { className:
|
|
370
|
+
return /* @__PURE__ */ jsxs6("div", { className: cn5("flex items-center gap-2", className, classNames?.base), children: [
|
|
361
371
|
/* @__PURE__ */ jsx8(
|
|
362
372
|
UserAvatar,
|
|
363
373
|
{
|
|
364
|
-
className:
|
|
374
|
+
className: cn5(size !== "sm" && "my-0.5"),
|
|
365
375
|
classNames: classNames?.avatar,
|
|
366
376
|
isPending,
|
|
367
377
|
size,
|
|
368
378
|
user
|
|
369
379
|
}
|
|
370
380
|
),
|
|
371
|
-
/* @__PURE__ */ jsx8("div", { className:
|
|
381
|
+
/* @__PURE__ */ jsx8("div", { className: cn5("grid flex-1 text-start leading-tight", classNames?.content), children: isPending ? /* @__PURE__ */ jsxs6(Fragment, { children: [
|
|
372
382
|
/* @__PURE__ */ jsx8(
|
|
373
383
|
Skeleton2,
|
|
374
384
|
{
|
|
375
|
-
className:
|
|
385
|
+
className: cn5(
|
|
376
386
|
"max-w-full",
|
|
377
387
|
size === "lg" ? "h-4.5 w-32" : "h-3.5 w-24",
|
|
378
388
|
classNames?.title,
|
|
@@ -383,7 +393,7 @@ function UserView({ className, classNames, isPending, size, user }) {
|
|
|
383
393
|
size !== "sm" && /* @__PURE__ */ jsx8(
|
|
384
394
|
Skeleton2,
|
|
385
395
|
{
|
|
386
|
-
className:
|
|
396
|
+
className: cn5(
|
|
387
397
|
"mt-1.5 max-w-full",
|
|
388
398
|
size === "lg" ? "h-3.5 w-40" : "h-3 w-32",
|
|
389
399
|
classNames?.subtitle,
|
|
@@ -395,7 +405,7 @@ function UserView({ className, classNames, isPending, size, user }) {
|
|
|
395
405
|
/* @__PURE__ */ jsx8(
|
|
396
406
|
"span",
|
|
397
407
|
{
|
|
398
|
-
className:
|
|
408
|
+
className: cn5(
|
|
399
409
|
"truncate font-semibold",
|
|
400
410
|
size === "lg" ? "text-base" : "text-sm",
|
|
401
411
|
classNames?.title
|
|
@@ -406,7 +416,7 @@ function UserView({ className, classNames, isPending, size, user }) {
|
|
|
406
416
|
!user?.isAnonymous && size !== "sm" && (user?.name || user?.username) && /* @__PURE__ */ jsx8(
|
|
407
417
|
"span",
|
|
408
418
|
{
|
|
409
|
-
className:
|
|
419
|
+
className: cn5(
|
|
410
420
|
"truncate opacity-70",
|
|
411
421
|
size === "lg" ? "text-sm" : "text-xs",
|
|
412
422
|
classNames?.subtitle
|
|
@@ -431,8 +441,8 @@ function ApiKeyView({ className, classNames, apiKey }) {
|
|
|
431
441
|
);
|
|
432
442
|
return `${t("common.time.expires")} ${expiresDate}`;
|
|
433
443
|
};
|
|
434
|
-
return /* @__PURE__ */ jsxs6("div", { className:
|
|
435
|
-
/* @__PURE__ */ jsx8(KeyRoundIcon, { className:
|
|
444
|
+
return /* @__PURE__ */ jsxs6("div", { className: cn5("flex items-center gap-3 truncate", className, classNames?.base), children: [
|
|
445
|
+
/* @__PURE__ */ jsx8(KeyRoundIcon, { className: cn5("size-4 shrink-0", classNames?.icon) }),
|
|
436
446
|
/* @__PURE__ */ jsxs6("div", { className: "flex flex-col truncate text-start", children: [
|
|
437
447
|
/* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-2", children: [
|
|
438
448
|
/* @__PURE__ */ jsx8("span", { className: "truncate font-semibold text-sm", children: apiKey.name }),
|
|
@@ -447,22 +457,22 @@ function ApiKeyView({ className, classNames, apiKey }) {
|
|
|
447
457
|
}
|
|
448
458
|
function WorkspaceView({ className, classNames, isPending, size, workspace }) {
|
|
449
459
|
const t = useTranslations6();
|
|
450
|
-
return /* @__PURE__ */ jsxs6("div", { className:
|
|
460
|
+
return /* @__PURE__ */ jsxs6("div", { className: cn5("flex items-center gap-2 truncate", className, classNames?.base), children: [
|
|
451
461
|
/* @__PURE__ */ jsx8(
|
|
452
462
|
WorkspaceLogo,
|
|
453
463
|
{
|
|
454
|
-
className:
|
|
464
|
+
className: cn5(size !== "sm" && "my-0.5"),
|
|
455
465
|
classNames: classNames?.avatar,
|
|
456
466
|
isPending,
|
|
457
467
|
workspace,
|
|
458
468
|
size
|
|
459
469
|
}
|
|
460
470
|
),
|
|
461
|
-
/* @__PURE__ */ jsx8("div", { className:
|
|
471
|
+
/* @__PURE__ */ jsx8("div", { className: cn5("flex flex-col truncate text-start leading-tight", classNames?.content), children: isPending ? /* @__PURE__ */ jsxs6(Fragment, { children: [
|
|
462
472
|
/* @__PURE__ */ jsx8(
|
|
463
473
|
Skeleton2,
|
|
464
474
|
{
|
|
465
|
-
className:
|
|
475
|
+
className: cn5(
|
|
466
476
|
"max-w-full",
|
|
467
477
|
size === "lg" ? "h-4.5 w-32" : "h-3.5 w-24",
|
|
468
478
|
classNames?.title,
|
|
@@ -473,7 +483,7 @@ function WorkspaceView({ className, classNames, isPending, size, workspace }) {
|
|
|
473
483
|
size !== "sm" && /* @__PURE__ */ jsx8(
|
|
474
484
|
Skeleton2,
|
|
475
485
|
{
|
|
476
|
-
className:
|
|
486
|
+
className: cn5(
|
|
477
487
|
"mt-1.5 max-w-full",
|
|
478
488
|
size === "lg" ? "h-3.5 w-24" : "h-3 w-16",
|
|
479
489
|
classNames?.subtitle,
|
|
@@ -485,7 +495,7 @@ function WorkspaceView({ className, classNames, isPending, size, workspace }) {
|
|
|
485
495
|
/* @__PURE__ */ jsx8(
|
|
486
496
|
"span",
|
|
487
497
|
{
|
|
488
|
-
className:
|
|
498
|
+
className: cn5(
|
|
489
499
|
"truncate font-semibold",
|
|
490
500
|
size === "lg" ? "text-base" : "text-sm",
|
|
491
501
|
classNames?.title
|
|
@@ -496,7 +506,7 @@ function WorkspaceView({ className, classNames, isPending, size, workspace }) {
|
|
|
496
506
|
size !== "sm" && workspace?.slug && /* @__PURE__ */ jsx8(
|
|
497
507
|
"span",
|
|
498
508
|
{
|
|
499
|
-
className:
|
|
509
|
+
className: cn5(
|
|
500
510
|
"truncate opacity-70",
|
|
501
511
|
size === "lg" ? "text-sm" : "text-xs",
|
|
502
512
|
classNames?.subtitle
|
|
@@ -512,6 +522,9 @@ function WorkspaceView({ className, classNames, isPending, size, workspace }) {
|
|
|
512
522
|
import { Fragment as Fragment3, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
513
523
|
function UserMenu({
|
|
514
524
|
homeUrl,
|
|
525
|
+
disableSettings = false,
|
|
526
|
+
disableSecurity = false,
|
|
527
|
+
disableAdminMenu = true,
|
|
515
528
|
hiddenSwitcher = false,
|
|
516
529
|
side = "bottom",
|
|
517
530
|
align = "end",
|
|
@@ -570,14 +583,18 @@ function UserMenu({
|
|
|
570
583
|
/* @__PURE__ */ jsx9(HouseIcon, {}),
|
|
571
584
|
/* @__PURE__ */ jsx9("span", { children: t("ui.navigation.home") })
|
|
572
585
|
] }) }),
|
|
573
|
-
/* @__PURE__ */ jsx9(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsxs7(Link4, { href: path.account.SETTINGS, children: [
|
|
586
|
+
!disableSettings && /* @__PURE__ */ jsx9(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsxs7(Link4, { href: path.account.SETTINGS, children: [
|
|
574
587
|
/* @__PURE__ */ jsx9(SettingsIcon, {}),
|
|
575
588
|
/* @__PURE__ */ jsx9("span", { children: t("ui.navigation.preferences") })
|
|
576
589
|
] }) }),
|
|
577
|
-
/* @__PURE__ */ jsx9(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsxs7(Link4, { href: path.account.SECURITY, children: [
|
|
590
|
+
!disableSecurity && /* @__PURE__ */ jsx9(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsxs7(Link4, { href: path.account.SECURITY, children: [
|
|
578
591
|
/* @__PURE__ */ jsx9(ShieldIcon, {}),
|
|
579
592
|
/* @__PURE__ */ jsx9("span", { children: t("ui.navigation.security") })
|
|
580
593
|
] }) }),
|
|
594
|
+
!disableAdminMenu && "admin" === userRole && /* @__PURE__ */ jsx9(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsxs7(Link4, { href: path.admin.OVERVIEW, children: [
|
|
595
|
+
/* @__PURE__ */ jsx9(UserStarIcon, {}),
|
|
596
|
+
/* @__PURE__ */ jsx9("span", { children: "Admin Dashboard" })
|
|
597
|
+
] }) }),
|
|
581
598
|
!hiddenSwitcher && /* @__PURE__ */ jsxs7(Fragment3, { children: [
|
|
582
599
|
/* @__PURE__ */ jsx9(DropdownMenuSeparator, {}),
|
|
583
600
|
/* @__PURE__ */ jsx9(
|
|
@@ -630,16 +647,34 @@ function UserMenu({
|
|
|
630
647
|
|
|
631
648
|
// src/components/layouts/header.tsx
|
|
632
649
|
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
633
|
-
function Header({ children }) {
|
|
650
|
+
function Header({ children, className }) {
|
|
634
651
|
const { version } = useLayout();
|
|
635
652
|
if (version === "v2") {
|
|
636
|
-
return /* @__PURE__ */ jsx10(
|
|
653
|
+
return /* @__PURE__ */ jsx10(
|
|
654
|
+
"header",
|
|
655
|
+
{
|
|
656
|
+
className: cn6(
|
|
657
|
+
"fixed start-0 end-0 top-0 z-50 flex h-(--header-height-mobile) shrink-0 items-center bg-background/95 pe-[var(--removed-body-scroll-bar-size,0px)] backdrop-blur-sm transition-[start,end] duration-300 supports-backdrop-filter:bg-muted",
|
|
658
|
+
className
|
|
659
|
+
),
|
|
660
|
+
children: /* @__PURE__ */ jsx10("div", { className: "@container flex grow items-stretch justify-between gap-2.5 pe-5", children })
|
|
661
|
+
}
|
|
662
|
+
);
|
|
637
663
|
}
|
|
638
|
-
return /* @__PURE__ */ jsx10(
|
|
664
|
+
return /* @__PURE__ */ jsx10(
|
|
665
|
+
"header",
|
|
666
|
+
{
|
|
667
|
+
className: cn6(
|
|
668
|
+
"fixed start-0 end-0 top-0 z-10 flex h-(--header-height-mobile) shrink-0 items-stretch border-border border-b bg-background/95 pe-(--removed-body-scroll-bar-size,0px) backdrop-blur-sm supports-backdrop-filter:bg-background/60 lg:h-(--header-height)",
|
|
669
|
+
className
|
|
670
|
+
),
|
|
671
|
+
children: /* @__PURE__ */ jsx10("div", { className: "@container flex grow items-stretch justify-between gap-2.5 pe-5", children })
|
|
672
|
+
}
|
|
673
|
+
);
|
|
639
674
|
}
|
|
640
|
-
function HeaderLeft() {
|
|
675
|
+
function HeaderLeft({ className }) {
|
|
641
676
|
const { logoHeader, sidebarToggle } = useLayout();
|
|
642
|
-
return /* @__PURE__ */ jsx10("div", { className: "flex items-center gap-2 px-5 lg:w-(--sidebar-width)", children: /* @__PURE__ */ jsxs8("div", { className: "flex w-full items-center justify-between", children: [
|
|
677
|
+
return /* @__PURE__ */ jsx10("div", { className: cn6("flex items-center gap-2 px-5 lg:w-(--sidebar-width)", className), children: /* @__PURE__ */ jsxs8("div", { className: "flex w-full items-center justify-between", children: [
|
|
643
678
|
logoHeader,
|
|
644
679
|
/* @__PURE__ */ jsx10(
|
|
645
680
|
Button2,
|
|
@@ -654,18 +689,23 @@ function HeaderLeft() {
|
|
|
654
689
|
] }) });
|
|
655
690
|
}
|
|
656
691
|
function HeaderRight({
|
|
692
|
+
className,
|
|
657
693
|
sidebar,
|
|
658
694
|
button,
|
|
659
|
-
homeUrl
|
|
695
|
+
homeUrl,
|
|
696
|
+
...props
|
|
660
697
|
}) {
|
|
661
698
|
const { isMobile } = useLayout();
|
|
662
|
-
return /* @__PURE__ */ jsxs8("nav", { className: "flex items-center gap-1.5 lg:gap-2.5", children: [
|
|
699
|
+
return /* @__PURE__ */ jsxs8("nav", { className: cn6("flex items-center gap-1.5 lg:gap-2.5", className), children: [
|
|
663
700
|
button,
|
|
664
701
|
isMobile && sidebar,
|
|
665
|
-
/* @__PURE__ */ jsx10(UserMenu, { homeUrl })
|
|
702
|
+
/* @__PURE__ */ jsx10(UserMenu, { homeUrl, ...props })
|
|
666
703
|
] });
|
|
667
704
|
}
|
|
668
|
-
function HeaderSidebarMobile({
|
|
705
|
+
function HeaderSidebarMobile({
|
|
706
|
+
children,
|
|
707
|
+
className
|
|
708
|
+
}) {
|
|
669
709
|
const pathname = usePathname2();
|
|
670
710
|
const [isSheetOpen, setIsSheetOpen] = useState2(false);
|
|
671
711
|
useEffect2(() => {
|
|
@@ -673,13 +713,21 @@ function HeaderSidebarMobile({ children }) {
|
|
|
673
713
|
}, [pathname]);
|
|
674
714
|
return /* @__PURE__ */ jsxs8(Sheet, { open: isSheetOpen, onOpenChange: setIsSheetOpen, children: [
|
|
675
715
|
/* @__PURE__ */ jsx10(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsx10(Button2, { variant: "ghost", mode: "icon", size: "icon", children: /* @__PURE__ */ jsx10(MenuIcon, { className: "size-4" }) }) }),
|
|
676
|
-
/* @__PURE__ */ jsxs8(
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
716
|
+
/* @__PURE__ */ jsxs8(
|
|
717
|
+
SheetContent,
|
|
718
|
+
{
|
|
719
|
+
className: cn6("w-(--sidebar-width) gap-0 p-0", className),
|
|
720
|
+
side: "left",
|
|
721
|
+
close: false,
|
|
722
|
+
children: [
|
|
723
|
+
/* @__PURE__ */ jsxs8(SheetHeader, { className: "hidden space-y-0 p-0", children: [
|
|
724
|
+
/* @__PURE__ */ jsx10(SheetTitle, { className: "sr-only", children: "Navigation menu" }),
|
|
725
|
+
/* @__PURE__ */ jsx10(SheetDescription, { className: "sr-only", children: "NavigatSheet Description" })
|
|
726
|
+
] }),
|
|
727
|
+
/* @__PURE__ */ jsx10(SheetBody, { className: "flex grow flex-col p-0", children })
|
|
728
|
+
]
|
|
729
|
+
}
|
|
730
|
+
)
|
|
683
731
|
] });
|
|
684
732
|
}
|
|
685
733
|
|
|
@@ -689,7 +737,7 @@ import Link5 from "next/link";
|
|
|
689
737
|
import { usePathname as usePathname3 } from "next/navigation";
|
|
690
738
|
import { useLocale as useLocale3, useTranslations as useTranslations8 } from "next-intl";
|
|
691
739
|
import { useLayout as useLayout2 } from "@pelatform/starter.hook";
|
|
692
|
-
import { cn as
|
|
740
|
+
import { cn as cn7 } from "pelatform-ui";
|
|
693
741
|
import { BackLink } from "pelatform-ui/components";
|
|
694
742
|
import {
|
|
695
743
|
AccordionMenu,
|
|
@@ -704,46 +752,85 @@ import {
|
|
|
704
752
|
ScrollArea
|
|
705
753
|
} from "pelatform-ui/default";
|
|
706
754
|
import { Fragment as Fragment4, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
707
|
-
function Sidebar({ children }) {
|
|
755
|
+
function Sidebar({ children, className }) {
|
|
708
756
|
const { isMobile, logoHeader, version } = useLayout2();
|
|
709
757
|
if (isMobile) {
|
|
710
758
|
return null;
|
|
711
759
|
}
|
|
712
760
|
if (version === "v2") {
|
|
713
|
-
return /* @__PURE__ */ jsx11(
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
761
|
+
return /* @__PURE__ */ jsx11(
|
|
762
|
+
"aside",
|
|
763
|
+
{
|
|
764
|
+
className: cn7(
|
|
765
|
+
"fixed start-2.5 top-2.5 bottom-2.5 z-20 flex in-data-[sidebar-open=false]:w-(--sidebar-width-collapsed) w-(--sidebar-width) shrink-0 items-stretch overflow-hidden rounded-xl border border-input bg-background transition-all duration-300",
|
|
766
|
+
className
|
|
767
|
+
),
|
|
768
|
+
children: /* @__PURE__ */ jsxs9("div", { className: "w-(--sidebar-width) shrink-0 grow transition-all duration-300", children: [
|
|
769
|
+
/* @__PURE__ */ jsx11("div", { className: "flex h-14 shrink-0 items-center justify-center px-2.5 lg:h-15", children: logoHeader }),
|
|
770
|
+
children
|
|
771
|
+
] })
|
|
772
|
+
}
|
|
773
|
+
);
|
|
717
774
|
}
|
|
718
|
-
return /* @__PURE__ */ jsxs9(
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
775
|
+
return /* @__PURE__ */ jsxs9(
|
|
776
|
+
"aside",
|
|
777
|
+
{
|
|
778
|
+
className: cn7(
|
|
779
|
+
"fixed in-data-[sidebar-open=false]:-start-full start-0 top-(--header-height) bottom-0 flex w-(--sidebar-width) shrink-0 flex-col items-stretch border-border border-e transition-all duration-300",
|
|
780
|
+
className
|
|
781
|
+
),
|
|
782
|
+
children: [
|
|
783
|
+
children,
|
|
784
|
+
/* @__PURE__ */ jsx11("div", {})
|
|
785
|
+
]
|
|
786
|
+
}
|
|
787
|
+
);
|
|
722
788
|
}
|
|
723
789
|
function SidebarHeaderBack({
|
|
790
|
+
className,
|
|
724
791
|
linkHref = "/",
|
|
725
792
|
admin = false,
|
|
726
793
|
text
|
|
727
794
|
}) {
|
|
728
795
|
const t = useTranslations8();
|
|
729
|
-
return /* @__PURE__ */ jsx11(
|
|
796
|
+
return /* @__PURE__ */ jsx11(
|
|
797
|
+
"div",
|
|
798
|
+
{
|
|
799
|
+
className: cn7(
|
|
800
|
+
"flex h-14 shrink-0 items-center gap-2 border-border border-b px-2.5 lg:h-15",
|
|
801
|
+
className
|
|
802
|
+
),
|
|
803
|
+
children: /* @__PURE__ */ jsx11(BackLink, { Link: Link5, href: linkHref, children: text ?? (admin ? t("common.actions.back") : t("ui.navigation.settings")) })
|
|
804
|
+
}
|
|
805
|
+
);
|
|
730
806
|
}
|
|
731
|
-
function SidebarContent({
|
|
807
|
+
function SidebarContent({
|
|
808
|
+
children,
|
|
809
|
+
className
|
|
810
|
+
}) {
|
|
732
811
|
const { isMobile, version } = useLayout2();
|
|
733
812
|
if (version === "v2") {
|
|
734
813
|
return /* @__PURE__ */ jsx11(
|
|
735
814
|
ScrollArea,
|
|
736
815
|
{
|
|
737
|
-
className:
|
|
738
|
-
isMobile ? "my-2 h-[calc(100vh-5.5rem)] grow" : "my-2 h-[calc(100vh-1rem)] w-full shrink-0 lg:my-4 lg:h-[calc(100vh-14.7rem)]"
|
|
816
|
+
className: cn7(
|
|
817
|
+
isMobile ? "my-2 h-[calc(100vh-5.5rem)] grow" : "my-2 h-[calc(100vh-1rem)] w-full shrink-0 lg:my-4 lg:h-[calc(100vh-14.7rem)]",
|
|
818
|
+
className
|
|
739
819
|
),
|
|
740
820
|
children
|
|
741
821
|
}
|
|
742
822
|
);
|
|
743
823
|
}
|
|
744
|
-
return /* @__PURE__ */ jsx11(
|
|
824
|
+
return /* @__PURE__ */ jsx11(
|
|
825
|
+
ScrollArea,
|
|
826
|
+
{
|
|
827
|
+
className: cn7("my-2 h-[calc(100vh-5.5rem)] grow lg:my-4 lg:h-[calc(100vh-4rem)]", className),
|
|
828
|
+
children
|
|
829
|
+
}
|
|
830
|
+
);
|
|
745
831
|
}
|
|
746
832
|
function SidebarContentMenu({
|
|
833
|
+
className,
|
|
747
834
|
menu,
|
|
748
835
|
type = "default"
|
|
749
836
|
}) {
|
|
@@ -792,7 +879,7 @@ function SidebarContentMenu({
|
|
|
792
879
|
defaultValue: "menu-trigger",
|
|
793
880
|
matchPath,
|
|
794
881
|
collapsible: true,
|
|
795
|
-
className: "space-y-7.5 px-2.5",
|
|
882
|
+
className: cn7("space-y-7.5 px-2.5", className),
|
|
796
883
|
classNames: {
|
|
797
884
|
item: "h-8.5 px-2.5 text-sm font-normal text-foreground hover:text-primary data-[selected=true]:bg-muted data-[selected=true]:text-foreground [&[data-selected=true]_svg]:opacity-100",
|
|
798
885
|
subTrigger: "text-xs font-normal text-muted-foreground hover:bg-transparent",
|
|
@@ -843,7 +930,7 @@ function SidebarContentMenu({
|
|
|
843
930
|
type: "multiple",
|
|
844
931
|
selectedValue: pathname,
|
|
845
932
|
matchPath,
|
|
846
|
-
className: "space-y-7.5 px-2.5",
|
|
933
|
+
className: cn7("space-y-7.5 px-2.5", className),
|
|
847
934
|
classNames: {
|
|
848
935
|
label: "text-xs font-normal text-muted-foreground mb-2",
|
|
849
936
|
item: "h-8.5 px-2.5 text-sm font-normal text-foreground hover:text-primary data-[selected=true]:bg-muted data-[selected=true]:font-medium data-[selected=true]:text-foreground [&[data-selected=true]_svg]:opacity-100",
|
|
@@ -897,7 +984,7 @@ function SidebarFooter({
|
|
|
897
984
|
return /* @__PURE__ */ jsxs9(
|
|
898
985
|
"div",
|
|
899
986
|
{
|
|
900
|
-
className:
|
|
987
|
+
className: cn7(
|
|
901
988
|
"flex h-14 shrink-0 items-center gap-2 border-border border-t px-2.5 lg:h-15",
|
|
902
989
|
className
|
|
903
990
|
),
|
|
@@ -913,36 +1000,45 @@ function SidebarFooter({
|
|
|
913
1000
|
import Link6 from "next/link";
|
|
914
1001
|
import { useTranslations as useTranslations9 } from "next-intl";
|
|
915
1002
|
import { useConfig as useConfig5 } from "@pelatform/starter.hook";
|
|
916
|
-
import { cn as
|
|
1003
|
+
import { cn as cn8 } from "pelatform-ui";
|
|
917
1004
|
import { SiteFooter as UISiteFooter } from "pelatform-ui/components";
|
|
918
1005
|
import { Button as Button3 } from "pelatform-ui/default";
|
|
919
1006
|
import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
920
|
-
function SiteFooter({
|
|
1007
|
+
function SiteFooter({
|
|
1008
|
+
className,
|
|
1009
|
+
disableProjectBy = false
|
|
1010
|
+
}) {
|
|
921
1011
|
const { app } = useConfig5();
|
|
922
1012
|
const t = useTranslations9();
|
|
923
|
-
return /* @__PURE__ */ jsxs10(
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
(
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
1013
|
+
return /* @__PURE__ */ jsxs10(
|
|
1014
|
+
UISiteFooter,
|
|
1015
|
+
{
|
|
1016
|
+
className: cn8("*:gap-2! *:py-0!", disableProjectBy ? "*:justify-center!" : "", className),
|
|
1017
|
+
children: [
|
|
1018
|
+
/* @__PURE__ */ jsxs10("div", { className: "text-balance text-center text-muted-foreground text-sm leading-loose md:text-left", children: [
|
|
1019
|
+
"\xA9 ",
|
|
1020
|
+
(/* @__PURE__ */ new Date()).getFullYear(),
|
|
1021
|
+
" ",
|
|
1022
|
+
app.name,
|
|
1023
|
+
". ",
|
|
1024
|
+
t("ui.common.copyright")
|
|
1025
|
+
] }),
|
|
1026
|
+
!disableProjectBy && /* @__PURE__ */ jsx12("div", { className: "flex items-center gap-2.5 text-balance text-sm leading-loose", children: /* @__PURE__ */ jsxs10("div", { className: "inline-flex items-center gap-1", children: [
|
|
1027
|
+
/* @__PURE__ */ jsx12("span", { className: "text-muted-foreground", children: t("ui.common.projectBy") }),
|
|
1028
|
+
" ",
|
|
1029
|
+
/* @__PURE__ */ jsx12(Button3, { mode: "link", underline: "dashed", children: /* @__PURE__ */ jsx12(
|
|
1030
|
+
Link6,
|
|
1031
|
+
{
|
|
1032
|
+
href: "https://pelatform.com",
|
|
1033
|
+
target: "_blank",
|
|
1034
|
+
className: "font-medium text-foreground",
|
|
1035
|
+
children: "Pelatform"
|
|
1036
|
+
}
|
|
1037
|
+
) })
|
|
1038
|
+
] }) })
|
|
1039
|
+
]
|
|
1040
|
+
}
|
|
1041
|
+
);
|
|
946
1042
|
}
|
|
947
1043
|
|
|
948
1044
|
// src/components/layouts/site-header.tsx
|
|
@@ -951,6 +1047,7 @@ import Link7 from "next/link";
|
|
|
951
1047
|
import { usePathname as usePathname4, useRouter as useRouter3 } from "next/navigation";
|
|
952
1048
|
import { useTranslations as useTranslations10 } from "next-intl";
|
|
953
1049
|
import { useConfig as useConfig6, useSession as useSession4 } from "@pelatform/starter.hook";
|
|
1050
|
+
import { cn as cn9 } from "pelatform-ui";
|
|
954
1051
|
import {
|
|
955
1052
|
MainNav,
|
|
956
1053
|
MobileNav,
|
|
@@ -961,8 +1058,10 @@ import {
|
|
|
961
1058
|
import { Button as Button4, Separator } from "pelatform-ui/default";
|
|
962
1059
|
import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
963
1060
|
function SiteHeader({
|
|
1061
|
+
className,
|
|
964
1062
|
menu,
|
|
965
|
-
logo = /* @__PURE__ */ jsx13(LogoWithHref, { href: "/" })
|
|
1063
|
+
logo = /* @__PURE__ */ jsx13(LogoWithHref, { href: "/" }),
|
|
1064
|
+
...props
|
|
966
1065
|
}) {
|
|
967
1066
|
const { path } = useConfig6();
|
|
968
1067
|
const pathname = usePathname4();
|
|
@@ -971,45 +1070,52 @@ function SiteHeader({
|
|
|
971
1070
|
const { isPending, session, user } = useSession4();
|
|
972
1071
|
const [, setMobileNavOpen] = useState3(false);
|
|
973
1072
|
const isAuthenticated = !isPending && session && user;
|
|
974
|
-
return /* @__PURE__ */ jsxs11(
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1073
|
+
return /* @__PURE__ */ jsxs11(
|
|
1074
|
+
UISiteHeader,
|
|
1075
|
+
{
|
|
1076
|
+
className: cn9("backdrop-blur-none supports-backdrop-filter:bg-background", className),
|
|
1077
|
+
children: [
|
|
1078
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-4.5", children: [
|
|
1079
|
+
logo,
|
|
1080
|
+
/* @__PURE__ */ jsx13(MainNav, { Link: Link7, pathname, items: menu })
|
|
1081
|
+
] }),
|
|
1082
|
+
/* @__PURE__ */ jsx13("div", { className: "flex items-center justify-end gap-3", children: /* @__PURE__ */ jsxs11("nav", { className: "flex items-center gap-0 md:gap-1", children: [
|
|
1083
|
+
/* @__PURE__ */ jsx13(ModeSwitcher3, {}),
|
|
1084
|
+
/* @__PURE__ */ jsx13(LanguageSwitcher, {}),
|
|
1085
|
+
/* @__PURE__ */ jsx13(Separator, { orientation: "vertical", className: "mx-3 h-5 max-lg:hidden" }),
|
|
1086
|
+
/* @__PURE__ */ jsx13(MobileNav, { children: /* @__PURE__ */ jsxs11("div", { className: "flex flex-col space-y-3", children: [
|
|
1087
|
+
menu?.map(
|
|
1088
|
+
(item, navIndex) => item.href || item.children ? /* @__PURE__ */ jsx13(
|
|
1089
|
+
MobileNavItemRenderer,
|
|
1090
|
+
{
|
|
1091
|
+
item,
|
|
1092
|
+
Link: Link7,
|
|
1093
|
+
pathname,
|
|
1094
|
+
level: 1,
|
|
1095
|
+
onOpenChange: setMobileNavOpen
|
|
1096
|
+
},
|
|
1097
|
+
`nav-${navIndex}-${item.href}`
|
|
1098
|
+
) : null
|
|
1099
|
+
),
|
|
1100
|
+
/* @__PURE__ */ jsx13("div", { className: "border-t pt-3", children: isAuthenticated ? /* @__PURE__ */ jsx13(
|
|
1101
|
+
Button4,
|
|
1102
|
+
{
|
|
1103
|
+
variant: "outline",
|
|
1104
|
+
size: "sm",
|
|
1105
|
+
className: "w-full",
|
|
1106
|
+
onClick: () => router.push(path.auth.SIGN_OUT),
|
|
1107
|
+
children: t("ui.navigation.signOut")
|
|
1108
|
+
}
|
|
1109
|
+
) : /* @__PURE__ */ jsx13(Button4, { variant: "secondary", size: "sm", className: "w-full", children: /* @__PURE__ */ jsx13(Link7, { href: path.auth.SIGN_IN, children: t("ui.navigation.signIn") }) }) })
|
|
1110
|
+
] }) }),
|
|
1111
|
+
isAuthenticated ? /* @__PURE__ */ jsx13(UserMenu, { ...props }) : /* @__PURE__ */ jsx13(Button4, { variant: "secondary", size: "sm", className: "hidden md:flex", children: /* @__PURE__ */ jsx13(Link7, { href: path.auth.SIGN_IN, children: t("ui.navigation.signIn") }) })
|
|
1112
|
+
] }) })
|
|
1113
|
+
]
|
|
1114
|
+
}
|
|
1115
|
+
);
|
|
1011
1116
|
}
|
|
1012
1117
|
function SiteHeaderSecondary({
|
|
1118
|
+
className,
|
|
1013
1119
|
menu,
|
|
1014
1120
|
logo = /* @__PURE__ */ jsx13(LogoWithHref, { href: "/" }),
|
|
1015
1121
|
loginHref,
|
|
@@ -1018,36 +1124,42 @@ function SiteHeaderSecondary({
|
|
|
1018
1124
|
const pathname = usePathname4();
|
|
1019
1125
|
const t = useTranslations10();
|
|
1020
1126
|
const [, setMobileNavOpen] = useState3(false);
|
|
1021
|
-
return /* @__PURE__ */ jsxs11(
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1127
|
+
return /* @__PURE__ */ jsxs11(
|
|
1128
|
+
UISiteHeader,
|
|
1129
|
+
{
|
|
1130
|
+
className: cn9("backdrop-blur-none supports-backdrop-filter:bg-background", className),
|
|
1131
|
+
children: [
|
|
1132
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-4.5", children: [
|
|
1133
|
+
logo,
|
|
1134
|
+
/* @__PURE__ */ jsx13(MainNav, { Link: Link7, pathname, items: menu })
|
|
1135
|
+
] }),
|
|
1136
|
+
/* @__PURE__ */ jsx13("div", { className: "flex items-center justify-end gap-3", children: /* @__PURE__ */ jsxs11("nav", { className: "flex items-center gap-0 md:gap-1", children: [
|
|
1137
|
+
/* @__PURE__ */ jsx13(ModeSwitcher3, {}),
|
|
1138
|
+
/* @__PURE__ */ jsx13(LanguageSwitcher, {}),
|
|
1139
|
+
/* @__PURE__ */ jsx13(MobileNav, { children: /* @__PURE__ */ jsxs11("div", { className: "flex flex-col space-y-3", children: [
|
|
1140
|
+
menu?.map(
|
|
1141
|
+
(item, navIndex) => item.href || item.children ? /* @__PURE__ */ jsx13(
|
|
1142
|
+
MobileNavItemRenderer,
|
|
1143
|
+
{
|
|
1144
|
+
item,
|
|
1145
|
+
Link: Link7,
|
|
1146
|
+
pathname,
|
|
1147
|
+
level: 1,
|
|
1148
|
+
onOpenChange: setMobileNavOpen
|
|
1149
|
+
},
|
|
1150
|
+
`nav-${navIndex}-${item.href}`
|
|
1151
|
+
) : null
|
|
1152
|
+
),
|
|
1153
|
+
loginHref && /* @__PURE__ */ jsx13("div", { className: "border-t pt-3", children: /* @__PURE__ */ jsx13(Button4, { variant: "secondary", size: "sm", className: "w-full", children: /* @__PURE__ */ jsx13(Link7, { href: loginHref, target: loginTarget, children: t("ui.navigation.signIn") }) }) })
|
|
1154
|
+
] }) }),
|
|
1155
|
+
loginHref && /* @__PURE__ */ jsxs11(Fragment5, { children: [
|
|
1156
|
+
/* @__PURE__ */ jsx13(Separator, { orientation: "vertical", className: "mx-3 h-5 max-md:hidden" }),
|
|
1157
|
+
/* @__PURE__ */ jsx13(Button4, { variant: "secondary", size: "sm", className: "hidden md:flex", children: /* @__PURE__ */ jsx13(Link7, { href: loginHref, target: loginTarget, children: t("ui.navigation.signIn") }) })
|
|
1158
|
+
] })
|
|
1159
|
+
] }) })
|
|
1160
|
+
]
|
|
1161
|
+
}
|
|
1162
|
+
);
|
|
1051
1163
|
}
|
|
1052
1164
|
|
|
1053
1165
|
// src/components/layouts/wrapper.tsx
|
|
@@ -1055,13 +1167,13 @@ import { useEffect as useEffect4, useState as useState5 } from "react";
|
|
|
1055
1167
|
import Link8 from "next/link";
|
|
1056
1168
|
import { RocketIcon } from "lucide-react";
|
|
1057
1169
|
import { useLayout as useLayout3, useSession as useSession5 } from "@pelatform/starter.hook";
|
|
1058
|
-
import { cn as
|
|
1170
|
+
import { cn as cn11 } from "pelatform-ui";
|
|
1059
1171
|
import { Button as Button5 } from "pelatform-ui/default";
|
|
1060
1172
|
|
|
1061
1173
|
// src/components/providers/layout.tsx
|
|
1062
1174
|
import { useEffect as useEffect3, useMemo as useMemo2, useState as useState4 } from "react";
|
|
1063
1175
|
import { LayoutContext } from "@pelatform/starter.hook";
|
|
1064
|
-
import { cn as
|
|
1176
|
+
import { cn as cn10 } from "pelatform-ui";
|
|
1065
1177
|
import { TooltipProvider } from "pelatform-ui/default";
|
|
1066
1178
|
import { useIsMobile } from "pelatform-ui/hooks";
|
|
1067
1179
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
@@ -1134,7 +1246,7 @@ function LayoutProvider({
|
|
|
1134
1246
|
"div",
|
|
1135
1247
|
{
|
|
1136
1248
|
"data-slot": "layout-wrapper",
|
|
1137
|
-
className:
|
|
1249
|
+
className: cn10("flex grow", className),
|
|
1138
1250
|
"data-sidebar-open": isSidebarOpen,
|
|
1139
1251
|
style,
|
|
1140
1252
|
children: /* @__PURE__ */ jsx14(TooltipProvider, { delayDuration: 0, children })
|
|
@@ -1148,6 +1260,7 @@ function LayoutProvider({
|
|
|
1148
1260
|
import { Fragment as Fragment6, jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1149
1261
|
function LayoutWrapper({
|
|
1150
1262
|
children,
|
|
1263
|
+
classNames,
|
|
1151
1264
|
logoHeader,
|
|
1152
1265
|
version = "v1",
|
|
1153
1266
|
...props
|
|
@@ -1158,13 +1271,15 @@ function LayoutWrapper({
|
|
|
1158
1271
|
{
|
|
1159
1272
|
logoHeader,
|
|
1160
1273
|
version,
|
|
1161
|
-
bodyClassName: isVersionV1 ? "" : "bg-muted!",
|
|
1162
|
-
|
|
1274
|
+
bodyClassName: cn11(isVersionV1 ? "" : "bg-muted!", classNames?.body),
|
|
1275
|
+
className: classNames?.layout,
|
|
1276
|
+
children: isVersionV1 ? /* @__PURE__ */ jsx15(ContentWrapper, { classNames, ...props, children }) : /* @__PURE__ */ jsx15(ContentWrapperV2, { classNames, ...props, children })
|
|
1163
1277
|
}
|
|
1164
1278
|
);
|
|
1165
1279
|
}
|
|
1166
1280
|
function ContentWrapper({
|
|
1167
1281
|
children,
|
|
1282
|
+
classNames,
|
|
1168
1283
|
sidebarHeader,
|
|
1169
1284
|
sidebarMenu,
|
|
1170
1285
|
homeUrl,
|
|
@@ -1173,32 +1288,52 @@ function ContentWrapper({
|
|
|
1173
1288
|
const { user } = useSession5();
|
|
1174
1289
|
const sidebarContent = /* @__PURE__ */ jsxs12(Fragment6, { children: [
|
|
1175
1290
|
sidebarHeader,
|
|
1176
|
-
/* @__PURE__ */ jsx15(SidebarContent, { children: sidebarMenu })
|
|
1291
|
+
/* @__PURE__ */ jsx15(SidebarContent, { className: classNames?.sidebarContent, children: sidebarMenu })
|
|
1177
1292
|
] });
|
|
1178
|
-
const studioButton = /* @__PURE__ */ jsx15(Button5, { variant: "ghost", asChild: true, children: /* @__PURE__ */ jsxs12(Link8, { href: studioUrl || "#", target: "_blank", children: [
|
|
1293
|
+
const studioButton = /* @__PURE__ */ jsx15(Button5, { variant: "ghost", asChild: true, className: classNames?.studioButton, children: /* @__PURE__ */ jsxs12(Link8, { href: studioUrl || "#", target: "_blank", children: [
|
|
1179
1294
|
/* @__PURE__ */ jsx15(RocketIcon, {}),
|
|
1180
1295
|
" Studio"
|
|
1181
1296
|
] }) });
|
|
1182
1297
|
return /* @__PURE__ */ jsxs12(Fragment6, { children: [
|
|
1183
|
-
/* @__PURE__ */ jsxs12(Header, { children: [
|
|
1184
|
-
/* @__PURE__ */ jsx15(HeaderLeft, {}),
|
|
1298
|
+
/* @__PURE__ */ jsxs12(Header, { className: classNames?.header, children: [
|
|
1299
|
+
/* @__PURE__ */ jsx15(HeaderLeft, { className: classNames?.headerLeft }),
|
|
1185
1300
|
/* @__PURE__ */ jsx15(
|
|
1186
1301
|
HeaderRight,
|
|
1187
1302
|
{
|
|
1303
|
+
className: classNames?.headerRight,
|
|
1188
1304
|
sidebar: /* @__PURE__ */ jsx15(HeaderSidebarMobile, { children: sidebarContent }),
|
|
1189
1305
|
button: studioUrl && user?.role === "admin" ? studioButton : null,
|
|
1190
1306
|
homeUrl
|
|
1191
1307
|
}
|
|
1192
1308
|
)
|
|
1193
1309
|
] }),
|
|
1194
|
-
/* @__PURE__ */ jsxs12(
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1310
|
+
/* @__PURE__ */ jsxs12(
|
|
1311
|
+
"div",
|
|
1312
|
+
{
|
|
1313
|
+
className: cn11(
|
|
1314
|
+
"flex grow pt-(--header-height-mobile) lg:pt-(--header-height)",
|
|
1315
|
+
classNames?.wrapper
|
|
1316
|
+
),
|
|
1317
|
+
children: [
|
|
1318
|
+
/* @__PURE__ */ jsx15(Sidebar, { className: classNames?.sidebar, children: sidebarContent }),
|
|
1319
|
+
/* @__PURE__ */ jsx15(
|
|
1320
|
+
"main",
|
|
1321
|
+
{
|
|
1322
|
+
className: cn11(
|
|
1323
|
+
"grow transition-all duration-300 lg:in-data-[sidebar-open=false]:ps-0 lg:ps-(--sidebar-width)",
|
|
1324
|
+
classNames?.content
|
|
1325
|
+
),
|
|
1326
|
+
children
|
|
1327
|
+
}
|
|
1328
|
+
)
|
|
1329
|
+
]
|
|
1330
|
+
}
|
|
1331
|
+
)
|
|
1198
1332
|
] });
|
|
1199
1333
|
}
|
|
1200
1334
|
function ContentWrapperV2({
|
|
1201
1335
|
children,
|
|
1336
|
+
classNames,
|
|
1202
1337
|
sidebarHeader,
|
|
1203
1338
|
sidebarMenu,
|
|
1204
1339
|
sidebarFooter,
|
|
@@ -1214,21 +1349,31 @@ function ContentWrapperV2({
|
|
|
1214
1349
|
}, []);
|
|
1215
1350
|
const sidebarContent = /* @__PURE__ */ jsxs12(Fragment6, { children: [
|
|
1216
1351
|
sidebarHeader,
|
|
1217
|
-
/* @__PURE__ */ jsx15(SidebarContent, { children: sidebarMenu }),
|
|
1352
|
+
/* @__PURE__ */ jsx15(SidebarContent, { className: classNames?.sidebarContent, children: sidebarMenu }),
|
|
1218
1353
|
!isMobile && sidebarFooter
|
|
1219
1354
|
] });
|
|
1220
|
-
const studioButton = /* @__PURE__ */ jsx15(
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1355
|
+
const studioButton = /* @__PURE__ */ jsx15(
|
|
1356
|
+
Button5,
|
|
1357
|
+
{
|
|
1358
|
+
variant: "mono",
|
|
1359
|
+
size: "sm",
|
|
1360
|
+
className: cn11("rounded-full", classNames?.studioButton),
|
|
1361
|
+
asChild: true,
|
|
1362
|
+
children: /* @__PURE__ */ jsxs12(Link8, { href: studioUrl || "#", target: "_blank", children: [
|
|
1363
|
+
/* @__PURE__ */ jsx15(RocketIcon, {}),
|
|
1364
|
+
" Studio"
|
|
1365
|
+
] })
|
|
1366
|
+
}
|
|
1367
|
+
);
|
|
1368
|
+
return /* @__PURE__ */ jsxs12("div", { className: cn11("flex h-screen w-full [&_.container-fluid]:px-5", classNames?.wrapper), children: [
|
|
1369
|
+
/* @__PURE__ */ jsx15(Sidebar, { className: classNames?.sidebar, children: sidebarContent }),
|
|
1226
1370
|
/* @__PURE__ */ jsxs12("div", { className: "flex w-full min-w-0 flex-1 flex-col pt-(--header-height-mobile) lg:pt-0", children: [
|
|
1227
|
-
isMobile && /* @__PURE__ */ jsxs12(Header, { children: [
|
|
1228
|
-
/* @__PURE__ */ jsx15(HeaderLeft, {}),
|
|
1371
|
+
isMobile && /* @__PURE__ */ jsxs12(Header, { className: classNames?.header, children: [
|
|
1372
|
+
/* @__PURE__ */ jsx15(HeaderLeft, { className: classNames?.headerLeft }),
|
|
1229
1373
|
/* @__PURE__ */ jsx15(
|
|
1230
1374
|
HeaderRight,
|
|
1231
1375
|
{
|
|
1376
|
+
className: classNames?.headerRight,
|
|
1232
1377
|
sidebar: /* @__PURE__ */ jsx15(HeaderSidebarMobile, { children: sidebarContent }),
|
|
1233
1378
|
button: studioUrl && user?.role === "admin" ? studioButton : null,
|
|
1234
1379
|
homeUrl
|
|
@@ -1238,11 +1383,11 @@ function ContentWrapperV2({
|
|
|
1238
1383
|
/* @__PURE__ */ jsx15("div", { className: "mx-5 flex grow py-2.5 lg:mx-2.5", children: /* @__PURE__ */ jsx15(
|
|
1239
1384
|
"div",
|
|
1240
1385
|
{
|
|
1241
|
-
className:
|
|
1386
|
+
className: cn11(
|
|
1242
1387
|
"grow overflow-y-auto rounded-xl border border-input bg-background shadow-xs duration-300 lg:in-data-[sidebar-open=true]:ms-[calc(var(--sidebar-width)+0.6rem)] lg:ms-[calc(var(--sidebar-width-collapsed)+0.6rem)]",
|
|
1243
1388
|
enableTransitions ? "transition-all duration-300" : "transition-none"
|
|
1244
1389
|
),
|
|
1245
|
-
children: /* @__PURE__ */ jsx15("main", { className: "grow", children })
|
|
1390
|
+
children: /* @__PURE__ */ jsx15("main", { className: cn11("grow", classNames?.content), children })
|
|
1246
1391
|
}
|
|
1247
1392
|
) })
|
|
1248
1393
|
] })
|
|
@@ -1332,7 +1477,7 @@ import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
|
|
1332
1477
|
import { NextIntlClientProvider } from "next-intl";
|
|
1333
1478
|
import { useConfig as useConfig7 } from "@pelatform/starter.hook";
|
|
1334
1479
|
import { QueryProvider, ThemeProvider } from "pelatform-ui/components";
|
|
1335
|
-
import { Toaster as Sonner } from "pelatform-ui/default";
|
|
1480
|
+
import { Toaster as Sonner, TooltipProvider as TooltipProvider2 } from "pelatform-ui/default";
|
|
1336
1481
|
import { jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1337
1482
|
function SharedProviders({
|
|
1338
1483
|
children,
|
|
@@ -1343,16 +1488,16 @@ function SharedProviders({
|
|
|
1343
1488
|
}) {
|
|
1344
1489
|
const config = useConfig7();
|
|
1345
1490
|
return /* @__PURE__ */ jsxs13(QueryProvider, { children: [
|
|
1346
|
-
/* @__PURE__ */ jsx17(ThemeProvider, { defaultTheme: config.ui.defaultTheme, children: /* @__PURE__ */ jsx17(NextIntlClientProvider, { locale, messages, timeZone, children: /* @__PURE__ */ jsxs13(Suspense2, { children: [
|
|
1491
|
+
/* @__PURE__ */ jsx17(ThemeProvider, { defaultTheme: config.ui.defaultTheme, children: /* @__PURE__ */ jsx17(TooltipProvider2, { children: /* @__PURE__ */ jsx17(NextIntlClientProvider, { locale, messages, timeZone, children: /* @__PURE__ */ jsxs13(Suspense2, { children: [
|
|
1347
1492
|
children,
|
|
1348
1493
|
/* @__PURE__ */ jsx17(Sonner, { position: sonnerPosition })
|
|
1349
|
-
] }) }) }),
|
|
1494
|
+
] }) }) }) }),
|
|
1350
1495
|
/* @__PURE__ */ jsx17(ReactQueryDevtools, { initialIsOpen: false })
|
|
1351
1496
|
] });
|
|
1352
1497
|
}
|
|
1353
1498
|
|
|
1354
1499
|
// src/components/utils/card.tsx
|
|
1355
|
-
import { cn as
|
|
1500
|
+
import { cn as cn12 } from "pelatform-ui";
|
|
1356
1501
|
import { Button as Button6, Card, CardContent, CardFooter, Skeleton as Skeleton4, Spinner } from "pelatform-ui/default";
|
|
1357
1502
|
import { Fragment as Fragment7, jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1358
1503
|
function CardComponent({
|
|
@@ -1373,7 +1518,7 @@ function CardComponent({
|
|
|
1373
1518
|
return /* @__PURE__ */ jsxs14(
|
|
1374
1519
|
Card,
|
|
1375
1520
|
{
|
|
1376
|
-
className:
|
|
1521
|
+
className: cn12(
|
|
1377
1522
|
"w-full overflow-hidden",
|
|
1378
1523
|
isDestructive && "border-destructive/70",
|
|
1379
1524
|
className,
|
|
@@ -1381,7 +1526,7 @@ function CardComponent({
|
|
|
1381
1526
|
),
|
|
1382
1527
|
...props,
|
|
1383
1528
|
children: [
|
|
1384
|
-
/* @__PURE__ */ jsxs14(CardContent, { className:
|
|
1529
|
+
/* @__PURE__ */ jsxs14(CardContent, { className: cn12("space-y-6 p-5 sm:p-10", classNames?.content), children: [
|
|
1385
1530
|
/* @__PURE__ */ jsx18(
|
|
1386
1531
|
CardHeaderComponent,
|
|
1387
1532
|
{
|
|
@@ -1417,12 +1562,12 @@ function CardHeaderComponent({
|
|
|
1417
1562
|
description,
|
|
1418
1563
|
isPending
|
|
1419
1564
|
}) {
|
|
1420
|
-
return /* @__PURE__ */ jsx18("div", { className:
|
|
1421
|
-
/* @__PURE__ */ jsx18(Skeleton4, { className:
|
|
1422
|
-
description && /* @__PURE__ */ jsx18(Skeleton4, { className:
|
|
1565
|
+
return /* @__PURE__ */ jsx18("div", { className: cn12("flex flex-col space-y-2", className, classNames?.header), children: isPending ? /* @__PURE__ */ jsxs14(Fragment7, { children: [
|
|
1566
|
+
/* @__PURE__ */ jsx18(Skeleton4, { className: cn12("h-7 w-1/3", classNames?.skeleton) }),
|
|
1567
|
+
description && /* @__PURE__ */ jsx18(Skeleton4, { className: cn12("h-5 w-2/3", classNames?.skeleton) })
|
|
1423
1568
|
] }) : /* @__PURE__ */ jsxs14(Fragment7, { children: [
|
|
1424
|
-
/* @__PURE__ */ jsx18("h2", { className:
|
|
1425
|
-
description && /* @__PURE__ */ jsx18("p", { className:
|
|
1569
|
+
/* @__PURE__ */ jsx18("h2", { className: cn12("font-medium text-xl", classNames?.title), children: title }),
|
|
1570
|
+
description && /* @__PURE__ */ jsx18("p", { className: cn12("text-muted-foreground text-sm", classNames?.description), children: description })
|
|
1426
1571
|
] }) });
|
|
1427
1572
|
}
|
|
1428
1573
|
function CardFooterComponent({
|
|
@@ -1439,7 +1584,7 @@ function CardFooterComponent({
|
|
|
1439
1584
|
return /* @__PURE__ */ jsx18(
|
|
1440
1585
|
CardFooter,
|
|
1441
1586
|
{
|
|
1442
|
-
className:
|
|
1587
|
+
className: cn12(
|
|
1443
1588
|
"flex items-center justify-between space-x-4 bg-muted p-3 sm:px-10",
|
|
1444
1589
|
isDestructive && "border-destructive/70",
|
|
1445
1590
|
className,
|
|
@@ -1449,7 +1594,7 @@ function CardFooterComponent({
|
|
|
1449
1594
|
instructions && /* @__PURE__ */ jsx18(
|
|
1450
1595
|
Skeleton4,
|
|
1451
1596
|
{
|
|
1452
|
-
className:
|
|
1597
|
+
className: cn12(
|
|
1453
1598
|
"h-4 w-48 max-w-full bg-muted-foreground/10 md:h-5 md:w-60",
|
|
1454
1599
|
classNames?.skeleton
|
|
1455
1600
|
)
|
|
@@ -1458,14 +1603,14 @@ function CardFooterComponent({
|
|
|
1458
1603
|
actionLabel && /* @__PURE__ */ jsx18(
|
|
1459
1604
|
Skeleton4,
|
|
1460
1605
|
{
|
|
1461
|
-
className:
|
|
1606
|
+
className: cn12("h-8 w-20 bg-muted-foreground/10 md:ms-auto", classNames?.skeleton)
|
|
1462
1607
|
}
|
|
1463
1608
|
)
|
|
1464
1609
|
] }) : /* @__PURE__ */ jsxs14(Fragment7, { children: [
|
|
1465
1610
|
instructions && /* @__PURE__ */ jsx18(
|
|
1466
1611
|
"div",
|
|
1467
1612
|
{
|
|
1468
|
-
className:
|
|
1613
|
+
className: cn12("text-muted-foreground text-xs md:text-sm", classNames?.instructions),
|
|
1469
1614
|
children: instructions
|
|
1470
1615
|
}
|
|
1471
1616
|
),
|
|
@@ -1499,7 +1644,7 @@ function CardActionComponent({
|
|
|
1499
1644
|
type: onClick ? "button" : "submit",
|
|
1500
1645
|
variant: isDestructive ? "destructive" : "primary",
|
|
1501
1646
|
size: "sm",
|
|
1502
|
-
className:
|
|
1647
|
+
className: cn12(
|
|
1503
1648
|
"ms-auto",
|
|
1504
1649
|
isSubmitting || disabled ? "pointer-events-auto! cursor-not-allowed" : "",
|
|
1505
1650
|
classNames?.button,
|
|
@@ -1518,7 +1663,7 @@ function CardActionComponent({
|
|
|
1518
1663
|
|
|
1519
1664
|
// src/components/utils/dialog.tsx
|
|
1520
1665
|
import { useTranslations as useTranslations11 } from "next-intl";
|
|
1521
|
-
import { cn as
|
|
1666
|
+
import { cn as cn13 } from "pelatform-ui";
|
|
1522
1667
|
import {
|
|
1523
1668
|
Button as Button7,
|
|
1524
1669
|
Dialog,
|
|
@@ -1546,13 +1691,13 @@ function DialogComponent({
|
|
|
1546
1691
|
DialogContent,
|
|
1547
1692
|
{
|
|
1548
1693
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
1549
|
-
className:
|
|
1694
|
+
className: cn13("bg-muted sm:max-w-md", classNames?.dialog?.content),
|
|
1550
1695
|
showCloseButton,
|
|
1551
1696
|
children: [
|
|
1552
1697
|
/* @__PURE__ */ jsxs15(
|
|
1553
1698
|
DialogHeader,
|
|
1554
1699
|
{
|
|
1555
|
-
className:
|
|
1700
|
+
className: cn13(
|
|
1556
1701
|
"-ms-6 -me-6 -mt-6 space-y-2 rounded-t-lg bg-background p-6",
|
|
1557
1702
|
classNames?.header
|
|
1558
1703
|
),
|
|
@@ -1586,13 +1731,13 @@ function DialogFooterComponent({
|
|
|
1586
1731
|
button
|
|
1587
1732
|
}) {
|
|
1588
1733
|
const t = useTranslations11();
|
|
1589
|
-
return /* @__PURE__ */ jsxs15(DialogFooter, { className:
|
|
1734
|
+
return /* @__PURE__ */ jsxs15(DialogFooter, { className: cn13(className, classNames?.dialog?.footer), children: [
|
|
1590
1735
|
cancelButton && /* @__PURE__ */ jsx19(
|
|
1591
1736
|
Button7,
|
|
1592
1737
|
{
|
|
1593
1738
|
type: "button",
|
|
1594
1739
|
variant: "ghost",
|
|
1595
|
-
className:
|
|
1740
|
+
className: cn13(classNames?.button),
|
|
1596
1741
|
onClick: () => onOpenChange?.(false),
|
|
1597
1742
|
disabled: cancelButtonDisabled,
|
|
1598
1743
|
children: t("common.actions.cancel")
|
|
@@ -1603,22 +1748,22 @@ function DialogFooterComponent({
|
|
|
1603
1748
|
}
|
|
1604
1749
|
|
|
1605
1750
|
// src/components/utils/skeleton.tsx
|
|
1606
|
-
import { cn as
|
|
1751
|
+
import { cn as cn14 } from "pelatform-ui";
|
|
1607
1752
|
import { Card as Card2, Skeleton as Skeleton5 } from "pelatform-ui/default";
|
|
1608
1753
|
import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1609
1754
|
function SkeletonViewComponent({ classNames }) {
|
|
1610
|
-
return /* @__PURE__ */ jsxs16(Card2, { className:
|
|
1755
|
+
return /* @__PURE__ */ jsxs16(Card2, { className: cn14("flex-row items-center gap-3 px-4 py-3", classNames?.cell), children: [
|
|
1611
1756
|
/* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-2", children: [
|
|
1612
|
-
/* @__PURE__ */ jsx20(Skeleton5, { className:
|
|
1613
|
-
/* @__PURE__ */ jsx20("div", { children: /* @__PURE__ */ jsx20(Skeleton5, { className:
|
|
1757
|
+
/* @__PURE__ */ jsx20(Skeleton5, { className: cn14("size-5 rounded-full", classNames?.skeleton) }),
|
|
1758
|
+
/* @__PURE__ */ jsx20("div", { children: /* @__PURE__ */ jsx20(Skeleton5, { className: cn14("h-4 w-32", classNames?.skeleton) }) })
|
|
1614
1759
|
] }),
|
|
1615
|
-
/* @__PURE__ */ jsx20(Skeleton5, { className:
|
|
1760
|
+
/* @__PURE__ */ jsx20(Skeleton5, { className: cn14("ms-auto size-8 w-16", classNames?.skeleton) })
|
|
1616
1761
|
] });
|
|
1617
1762
|
}
|
|
1618
1763
|
function SkeletonInputComponent({ classNames }) {
|
|
1619
1764
|
return /* @__PURE__ */ jsxs16("div", { className: "flex flex-col gap-1.5", children: [
|
|
1620
|
-
/* @__PURE__ */ jsx20(Skeleton5, { className:
|
|
1621
|
-
/* @__PURE__ */ jsx20(Skeleton5, { className:
|
|
1765
|
+
/* @__PURE__ */ jsx20(Skeleton5, { className: cn14("h-4 w-32", classNames?.skeleton) }),
|
|
1766
|
+
/* @__PURE__ */ jsx20(Skeleton5, { className: cn14("h-9 w-full", classNames?.skeleton) })
|
|
1622
1767
|
] });
|
|
1623
1768
|
}
|
|
1624
1769
|
|
|
@@ -1626,14 +1771,14 @@ function SkeletonInputComponent({ classNames }) {
|
|
|
1626
1771
|
import { useRef } from "react";
|
|
1627
1772
|
import { CheckIcon, CopyIcon } from "lucide-react";
|
|
1628
1773
|
import { useTranslations as useTranslations12 } from "next-intl";
|
|
1629
|
-
import { cn as
|
|
1774
|
+
import { cn as cn15 } from "pelatform-ui";
|
|
1630
1775
|
import {
|
|
1631
1776
|
Button as Button8,
|
|
1632
1777
|
Input,
|
|
1633
1778
|
Skeleton as Skeleton6,
|
|
1634
1779
|
Tooltip,
|
|
1635
1780
|
TooltipContent,
|
|
1636
|
-
TooltipProvider as
|
|
1781
|
+
TooltipProvider as TooltipProvider3,
|
|
1637
1782
|
TooltipTrigger
|
|
1638
1783
|
} from "pelatform-ui/default";
|
|
1639
1784
|
import { useCopyToClipboard } from "pelatform-ui/hooks";
|
|
@@ -1664,17 +1809,17 @@ function DisplayIdCard({
|
|
|
1664
1809
|
description,
|
|
1665
1810
|
isPending,
|
|
1666
1811
|
...props,
|
|
1667
|
-
children: isPending ? /* @__PURE__ */ jsx21(Skeleton6, { className:
|
|
1812
|
+
children: isPending ? /* @__PURE__ */ jsx21(Skeleton6, { className: cn15("h-11.5 w-full max-w-md", classNames?.skeleton) }) : /* @__PURE__ */ jsxs17(
|
|
1668
1813
|
"div",
|
|
1669
1814
|
{
|
|
1670
|
-
className:
|
|
1815
|
+
className: cn15(
|
|
1671
1816
|
"flex w-full max-w-md items-center justify-between rounded-md border p-2",
|
|
1672
1817
|
classNames?.grid
|
|
1673
1818
|
),
|
|
1674
1819
|
children: [
|
|
1675
1820
|
/* @__PURE__ */ jsx21(Input, { value: id, ref: inputRef, disabled: true, className: "border-none! bg-transparent!" }),
|
|
1676
|
-
/* @__PURE__ */ jsx21(
|
|
1677
|
-
/* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx21(Button8, { variant: "dim", onClick: handleCopy, disabled: copied, children: copied ? /* @__PURE__ */ jsx21(CheckIcon, { className:
|
|
1821
|
+
/* @__PURE__ */ jsx21(TooltipProvider3, { delayDuration: 0, children: /* @__PURE__ */ jsxs17(Tooltip, { children: [
|
|
1822
|
+
/* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx21(Button8, { variant: "dim", onClick: handleCopy, disabled: copied, children: copied ? /* @__PURE__ */ jsx21(CheckIcon, { className: cn15("stroke-green-600", classNames?.icon) }) : /* @__PURE__ */ jsx21(CopyIcon, { className: classNames?.icon }) }) }),
|
|
1678
1823
|
/* @__PURE__ */ jsx21(TooltipContent, { className: "px-2 py-1 text-xs", children: t("common.actions.copy") })
|
|
1679
1824
|
] }) })
|
|
1680
1825
|
]
|
|
@@ -1687,7 +1832,7 @@ function DisplayIdCard({
|
|
|
1687
1832
|
// src/components/empty-state.tsx
|
|
1688
1833
|
import Link9 from "next/link";
|
|
1689
1834
|
import { useTranslations as useTranslations13 } from "next-intl";
|
|
1690
|
-
import { cn as
|
|
1835
|
+
import { cn as cn16 } from "pelatform-ui";
|
|
1691
1836
|
import { jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1692
1837
|
function EmptyState({
|
|
1693
1838
|
className,
|
|
@@ -1699,7 +1844,7 @@ function EmptyState({
|
|
|
1699
1844
|
children
|
|
1700
1845
|
}) {
|
|
1701
1846
|
const t = useTranslations13();
|
|
1702
|
-
return /* @__PURE__ */ jsxs18("div", { className:
|
|
1847
|
+
return /* @__PURE__ */ jsxs18("div", { className: cn16("flex flex-col items-center justify-center gap-y-4", className), children: [
|
|
1703
1848
|
Icon && /* @__PURE__ */ jsx22("div", { className: "flex size-14 items-center justify-center rounded-2xl border bg-muted", children: /* @__PURE__ */ jsx22(Icon, { className: "size-6 text-foreground" }) }),
|
|
1704
1849
|
/* @__PURE__ */ jsx22("p", { className: "text-center font-medium text-base text-foreground", children: title }),
|
|
1705
1850
|
description && /* @__PURE__ */ jsxs18("p", { className: "max-w-sm text-balance text-center text-muted-foreground text-sm", children: [
|
|
@@ -1771,7 +1916,7 @@ function OTPInputGroup({ otpSeparators = 0 }) {
|
|
|
1771
1916
|
// src/components/password-input.tsx
|
|
1772
1917
|
import { useState as useState6 } from "react";
|
|
1773
1918
|
import { EyeIcon, EyeOffIcon } from "lucide-react";
|
|
1774
|
-
import { cn as
|
|
1919
|
+
import { cn as cn17 } from "pelatform-ui";
|
|
1775
1920
|
import { Button as Button9, Input as Input2 } from "pelatform-ui/default";
|
|
1776
1921
|
import { Fragment as Fragment9, jsx as jsx24, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1777
1922
|
function PasswordInput({
|
|
@@ -1789,7 +1934,7 @@ function PasswordInput({
|
|
|
1789
1934
|
{
|
|
1790
1935
|
type: isVisible && enableToggle ? "text" : "password",
|
|
1791
1936
|
variant,
|
|
1792
|
-
className:
|
|
1937
|
+
className: cn17(enableToggle && "pe-10", className),
|
|
1793
1938
|
...props,
|
|
1794
1939
|
onChange: (event) => {
|
|
1795
1940
|
setDisabled(!event.target.value);
|