@pactor-app/ui 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/{chunk-L45CSL6I.js → chunk-7KC6DMKH.js} +3 -3
- package/dist/{chunk-HJPHJKVA.js → chunk-EVGIS2ZE.js} +170 -227
- package/dist/{chunk-F3H23KYG.js → chunk-F42SGQNW.js} +31 -93
- package/dist/chunk-L4Z7MNYY.js +1197 -0
- package/dist/{chunk-LMEJ242M.js → chunk-P54Y23AP.js} +36 -32
- package/dist/{chunk-22TEN3ER.js → chunk-TDVG7MZ5.js} +13 -13
- package/dist/{chunk-Q5NUGUJG.js → chunk-UKA7C3JP.js} +204 -413
- package/dist/chunk-WKJUCGV4.js +78 -0
- package/dist/components/index.cjs +1012 -691
- package/dist/components/index.d.cts +30 -12
- package/dist/components/index.d.ts +30 -12
- package/dist/components/index.js +8 -6
- package/dist/index.cjs +1261 -940
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +10 -8
- package/dist/interaction/index.cjs +10 -6
- package/dist/interaction/index.js +3 -3
- package/dist/layout/index.cjs +695 -265
- package/dist/layout/index.d.cts +1 -1
- package/dist/layout/index.d.ts +1 -1
- package/dist/layout/index.js +4 -4
- package/dist/ui/index.cjs +1688 -533
- package/dist/ui/index.d.cts +130 -16
- package/dist/ui/index.d.ts +130 -16
- package/dist/ui/index.js +481 -22
- package/package.json +6 -5
- package/styles.css +936 -107
- package/dist/chunk-2LYMCWEJ.js +0 -289
- package/dist/chunk-RQHJBTEU.js +0 -10
package/dist/index.cjs
CHANGED
|
@@ -45,6 +45,7 @@ __export(index_exports, {
|
|
|
45
45
|
Card: () => Card2,
|
|
46
46
|
Carousel: () => Carousel2,
|
|
47
47
|
Chart: () => Chart,
|
|
48
|
+
ChatInput: () => ChatInput,
|
|
48
49
|
ChatLayout: () => ChatLayout,
|
|
49
50
|
Checkbox: () => Checkbox2,
|
|
50
51
|
Collapsible: () => Collapsible2,
|
|
@@ -342,16 +343,20 @@ var buttonVariants = (0, import_class_variance_authority2.cva)(
|
|
|
342
343
|
variant: {
|
|
343
344
|
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
344
345
|
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20",
|
|
345
|
-
outline: "border border-border bg-
|
|
346
|
+
outline: "border border-border bg-card hover:bg-accent hover:text-accent-foreground",
|
|
346
347
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
347
348
|
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
348
349
|
link: "text-primary underline-offset-4 hover:underline"
|
|
349
350
|
},
|
|
350
351
|
size: {
|
|
351
352
|
default: "h-9 px-4 py-2",
|
|
353
|
+
xs: "h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
352
354
|
sm: "h-8 gap-1.5 rounded-md px-3 text-xs",
|
|
353
355
|
lg: "h-10 rounded-md px-6",
|
|
354
|
-
icon: "size-9"
|
|
356
|
+
icon: "size-9",
|
|
357
|
+
"icon-xs": "size-6 rounded-md [&_svg:not([class*='size-'])]:size-3",
|
|
358
|
+
"icon-sm": "size-8",
|
|
359
|
+
"icon-lg": "size-10"
|
|
355
360
|
}
|
|
356
361
|
},
|
|
357
362
|
defaultVariants: {
|
|
@@ -416,7 +421,7 @@ function AlertDialogOverlay({
|
|
|
416
421
|
{
|
|
417
422
|
"data-slot": "alert-dialog-overlay",
|
|
418
423
|
className: cn(
|
|
419
|
-
"fixed inset-0 z-50 bg-
|
|
424
|
+
"fixed inset-0 z-50 bg-(--overlay-background) data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
|
|
420
425
|
className
|
|
421
426
|
),
|
|
422
427
|
...props
|
|
@@ -434,7 +439,7 @@ function AlertDialogContent({
|
|
|
434
439
|
{
|
|
435
440
|
"data-slot": "alert-dialog-content",
|
|
436
441
|
className: cn(
|
|
437
|
-
"fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border border-border bg-
|
|
442
|
+
"fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border border-border bg-popover p-6 shadow-lg shadow-(color:--shadow-color) duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 sm:max-w-lg",
|
|
438
443
|
className
|
|
439
444
|
),
|
|
440
445
|
...props
|
|
@@ -877,7 +882,7 @@ function Calendar({
|
|
|
877
882
|
import_react_day_picker.DayPicker,
|
|
878
883
|
{
|
|
879
884
|
showOutsideDays,
|
|
880
|
-
className: cn("bg-
|
|
885
|
+
className: cn("bg-card p-3", className),
|
|
881
886
|
classNames: {
|
|
882
887
|
root: cn("w-fit", defaultClassNames.root),
|
|
883
888
|
months: cn("relative flex flex-col gap-4 md:flex-row", defaultClassNames.months),
|
|
@@ -910,15 +915,15 @@ function Calendar({
|
|
|
910
915
|
week: cn("mt-2 flex w-full", defaultClassNames.week),
|
|
911
916
|
day: cn("h-8 w-8 p-0 text-center text-sm", defaultClassNames.day),
|
|
912
917
|
day_button: cn(
|
|
913
|
-
"size-8 cursor-pointer rounded-md p-0 font-normal hover:bg-
|
|
918
|
+
"size-8 cursor-pointer rounded-md p-0 font-normal hover:bg-(--calendar-day-hover-background) hover:text-(--calendar-day-hover-foreground) aria-selected:opacity-100",
|
|
914
919
|
defaultClassNames.day_button
|
|
915
920
|
),
|
|
916
921
|
selected: cn(
|
|
917
|
-
"[&>button]:bg-
|
|
922
|
+
"[&>button]:bg-(--calendar-selected-background) [&>button]:text-(--calendar-selected-foreground) [&>button]:hover:bg-(--calendar-selected-background)",
|
|
918
923
|
defaultClassNames.selected
|
|
919
924
|
),
|
|
920
925
|
today: cn(
|
|
921
|
-
"[&>button]:bg-
|
|
926
|
+
"[&>button]:bg-(--calendar-today-background) [&>button]:text-(--calendar-today-foreground)",
|
|
922
927
|
defaultClassNames.today
|
|
923
928
|
),
|
|
924
929
|
outside: cn(
|
|
@@ -1028,7 +1033,7 @@ function Card({ className, ...props }) {
|
|
|
1028
1033
|
{
|
|
1029
1034
|
"data-slot": "card",
|
|
1030
1035
|
className: cn(
|
|
1031
|
-
"flex flex-col gap-6 rounded-xl border border-border bg-card py-6 text-card-foreground shadow-
|
|
1036
|
+
"flex flex-col gap-6 rounded-xl border border-border bg-card py-6 text-card-foreground shadow-(--card-shadow)",
|
|
1032
1037
|
className
|
|
1033
1038
|
),
|
|
1034
1039
|
...props
|
|
@@ -1529,7 +1534,7 @@ function PopoverContent({
|
|
|
1529
1534
|
{
|
|
1530
1535
|
"data-slot": "popover-content",
|
|
1531
1536
|
className: cn(
|
|
1532
|
-
"z-50 w-72 rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md outline-none duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
1537
|
+
"z-50 w-72 rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md shadow-(color:--shadow-color) outline-none duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
1533
1538
|
className
|
|
1534
1539
|
),
|
|
1535
1540
|
...props
|
|
@@ -1684,7 +1689,7 @@ function CommandItem({
|
|
|
1684
1689
|
{
|
|
1685
1690
|
"data-slot": "command-item",
|
|
1686
1691
|
className: cn(
|
|
1687
|
-
"relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-
|
|
1692
|
+
"relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-(--menu-active-background) data-[selected=true]:text-(--menu-active-foreground) [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
1688
1693
|
className
|
|
1689
1694
|
),
|
|
1690
1695
|
...props
|
|
@@ -1986,11 +1991,11 @@ var import_recharts2 = require("recharts");
|
|
|
1986
1991
|
var import_recharts = require("recharts");
|
|
1987
1992
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
1988
1993
|
var CHART_TOKEN_COLORS = [
|
|
1989
|
-
"
|
|
1990
|
-
"
|
|
1991
|
-
"
|
|
1992
|
-
"
|
|
1993
|
-
"
|
|
1994
|
+
"var(--chart-1)",
|
|
1995
|
+
"var(--chart-2)",
|
|
1996
|
+
"var(--chart-3)",
|
|
1997
|
+
"var(--chart-4)",
|
|
1998
|
+
"var(--chart-5)"
|
|
1994
1999
|
];
|
|
1995
2000
|
function chartColor(index, colors) {
|
|
1996
2001
|
if (colors && colors.length > 0) {
|
|
@@ -2181,7 +2186,7 @@ function ChatInput({
|
|
|
2181
2186
|
{
|
|
2182
2187
|
"data-slot": "chat-input",
|
|
2183
2188
|
className: cn(
|
|
2184
|
-
"rounded-xl border border-border bg-
|
|
2189
|
+
"rounded-xl border border-border bg-card transition-shadow focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/50",
|
|
2185
2190
|
className
|
|
2186
2191
|
),
|
|
2187
2192
|
style,
|
|
@@ -2260,7 +2265,7 @@ function ContextMenuContent({
|
|
|
2260
2265
|
{
|
|
2261
2266
|
"data-slot": "context-menu-content",
|
|
2262
2267
|
className: cn(
|
|
2263
|
-
"z-50 max-h-(--available-height) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
2268
|
+
"z-50 max-h-(--available-height) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md shadow-(color:--shadow-color) duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
2264
2269
|
className
|
|
2265
2270
|
),
|
|
2266
2271
|
...props
|
|
@@ -2278,7 +2283,7 @@ function ContextMenuItem({
|
|
|
2278
2283
|
"data-slot": "context-menu-item",
|
|
2279
2284
|
"data-variant": variant,
|
|
2280
2285
|
className: cn(
|
|
2281
|
-
"relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-
|
|
2286
|
+
"relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-(--menu-hover-background) focus:text-(--menu-hover-foreground) data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
2282
2287
|
className
|
|
2283
2288
|
),
|
|
2284
2289
|
...props
|
|
@@ -2598,7 +2603,7 @@ function DialogOverlay({
|
|
|
2598
2603
|
{
|
|
2599
2604
|
"data-slot": "dialog-overlay",
|
|
2600
2605
|
className: cn(
|
|
2601
|
-
"fixed inset-0 z-50 bg-
|
|
2606
|
+
"fixed inset-0 z-50 bg-(--overlay-background) data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
|
|
2602
2607
|
className
|
|
2603
2608
|
),
|
|
2604
2609
|
...props
|
|
@@ -2618,7 +2623,7 @@ function DialogContent({
|
|
|
2618
2623
|
{
|
|
2619
2624
|
"data-slot": "dialog-content",
|
|
2620
2625
|
className: cn(
|
|
2621
|
-
"fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border border-border bg-
|
|
2626
|
+
"fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border border-border bg-popover p-6 shadow-lg shadow-(color:--shadow-color) duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 sm:max-w-lg",
|
|
2622
2627
|
className
|
|
2623
2628
|
),
|
|
2624
2629
|
...props,
|
|
@@ -2771,7 +2776,7 @@ function DrawerOverlay({
|
|
|
2771
2776
|
import_vaul.Drawer.Overlay,
|
|
2772
2777
|
{
|
|
2773
2778
|
"data-slot": "drawer-overlay",
|
|
2774
|
-
className: cn("fixed inset-0 z-50 bg-
|
|
2779
|
+
className: cn("fixed inset-0 z-50 bg-(--overlay-background)", className),
|
|
2775
2780
|
...props
|
|
2776
2781
|
}
|
|
2777
2782
|
);
|
|
@@ -2788,7 +2793,7 @@ function DrawerContent({
|
|
|
2788
2793
|
{
|
|
2789
2794
|
"data-slot": "drawer-content",
|
|
2790
2795
|
className: cn(
|
|
2791
|
-
"group/drawer-content fixed z-50 flex h-auto flex-col border-border bg-
|
|
2796
|
+
"group/drawer-content fixed z-50 flex h-auto flex-col border-border bg-popover",
|
|
2792
2797
|
"data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b",
|
|
2793
2798
|
"data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t",
|
|
2794
2799
|
"data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm",
|
|
@@ -2890,7 +2895,7 @@ function DropdownMenuContent({
|
|
|
2890
2895
|
{
|
|
2891
2896
|
"data-slot": "dropdown-menu-content",
|
|
2892
2897
|
className: cn(
|
|
2893
|
-
"z-50 max-h-(--available-height) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
2898
|
+
"z-50 max-h-(--available-height) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md shadow-(color:--shadow-color) duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
2894
2899
|
className
|
|
2895
2900
|
),
|
|
2896
2901
|
...props
|
|
@@ -2910,7 +2915,7 @@ function DropdownMenuItem({
|
|
|
2910
2915
|
"data-slot": "dropdown-menu-item",
|
|
2911
2916
|
"data-variant": variant,
|
|
2912
2917
|
className: cn(
|
|
2913
|
-
"relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-
|
|
2918
|
+
"relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-(--menu-hover-background) focus:text-(--menu-hover-foreground) data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
2914
2919
|
className
|
|
2915
2920
|
),
|
|
2916
2921
|
...props
|
|
@@ -2932,7 +2937,7 @@ function DropdownMenuSubTrigger({
|
|
|
2932
2937
|
{
|
|
2933
2938
|
"data-slot": "dropdown-menu-sub-trigger",
|
|
2934
2939
|
className: cn(
|
|
2935
|
-
"flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-
|
|
2940
|
+
"flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-(--menu-hover-background) focus:text-(--menu-hover-foreground) data-open:bg-(--menu-active-background) data-open:text-(--menu-active-foreground) [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
2936
2941
|
className
|
|
2937
2942
|
),
|
|
2938
2943
|
...props,
|
|
@@ -2953,7 +2958,7 @@ function DropdownMenuSubContent({
|
|
|
2953
2958
|
{
|
|
2954
2959
|
"data-slot": "dropdown-menu-sub-content",
|
|
2955
2960
|
className: cn(
|
|
2956
|
-
"z-50 min-w-32 origin-(--transform-origin) overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
2961
|
+
"z-50 min-w-32 origin-(--transform-origin) overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md shadow-(color:--shadow-color) duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
2957
2962
|
className
|
|
2958
2963
|
),
|
|
2959
2964
|
...props
|
|
@@ -3124,9 +3129,9 @@ function Field2({ label, description, error, children, className, style }) {
|
|
|
3124
3129
|
// src/components/components/Flex/index.tsx
|
|
3125
3130
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
3126
3131
|
var gapClass = {
|
|
3127
|
-
small: "gap-
|
|
3128
|
-
middle: "gap-
|
|
3129
|
-
large: "gap-
|
|
3132
|
+
small: "gap-(--flex-gap-sm)",
|
|
3133
|
+
middle: "gap-(--flex-gap-md)",
|
|
3134
|
+
large: "gap-(--flex-gap-lg)"
|
|
3130
3135
|
};
|
|
3131
3136
|
var justifyClass = {
|
|
3132
3137
|
start: "justify-start",
|
|
@@ -3159,6 +3164,7 @@ function Flex({
|
|
|
3159
3164
|
className: cn(
|
|
3160
3165
|
"flex",
|
|
3161
3166
|
direction === "vertical" && "flex-col",
|
|
3167
|
+
gap === void 0 && "gap-(--flex-gap)",
|
|
3162
3168
|
typeof gap === "string" && gapClass[gap],
|
|
3163
3169
|
justify && justifyClass[justify],
|
|
3164
3170
|
align && alignClass[align],
|
|
@@ -3293,7 +3299,7 @@ function Grid({ columns = 1, gap, className, style, children }) {
|
|
|
3293
3299
|
{
|
|
3294
3300
|
"data-slot": "grid",
|
|
3295
3301
|
"data-columns": cols,
|
|
3296
|
-
className: cn("grid", className),
|
|
3302
|
+
className: cn("grid", gap === void 0 && "gap-(--grid-gap)", className),
|
|
3297
3303
|
style: {
|
|
3298
3304
|
gridTemplateColumns: `repeat(${cols}, minmax(0, 1fr))`,
|
|
3299
3305
|
...gap !== void 0 ? { gap } : {},
|
|
@@ -3334,7 +3340,7 @@ function Header({
|
|
|
3334
3340
|
const hasLocales = locales !== void 0 && locales.length > 0;
|
|
3335
3341
|
const hasUser = user !== void 0;
|
|
3336
3342
|
const rootClass = cn(
|
|
3337
|
-
"flex h-14 shrink-0 items-center gap-4 border-b bg-
|
|
3343
|
+
"flex h-14 shrink-0 items-center gap-4 border-b bg-card px-4",
|
|
3338
3344
|
className
|
|
3339
3345
|
);
|
|
3340
3346
|
if (!hasBrand && !dropdown && !hasMenu && !hasUser && !hasLocales) {
|
|
@@ -3379,7 +3385,7 @@ function HeaderDropdownArea({
|
|
|
3379
3385
|
DropdownMenuTrigger,
|
|
3380
3386
|
{
|
|
3381
3387
|
"data-slot": "header-dropdown",
|
|
3382
|
-
className: cn(menuItemClass, "outline-hidden"),
|
|
3388
|
+
className: cn(menuItemClass, "outline-hidden cursor-pointer"),
|
|
3383
3389
|
children: [
|
|
3384
3390
|
dropdown.label,
|
|
3385
3391
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_lucide_react15.ChevronDownIcon, { className: "size-3.5", "aria-hidden": "true" })
|
|
@@ -3411,7 +3417,7 @@ function HeaderMenuArea({
|
|
|
3411
3417
|
{
|
|
3412
3418
|
"data-slot": "header-menu-item",
|
|
3413
3419
|
"data-key": item.key,
|
|
3414
|
-
className: cn(menuItemClass, "outline-hidden"),
|
|
3420
|
+
className: cn(menuItemClass, "outline-hidden cursor-pointer"),
|
|
3415
3421
|
children: [
|
|
3416
3422
|
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Icon, { name: item.icon, size: "sm" }) : null,
|
|
3417
3423
|
item.label,
|
|
@@ -3443,7 +3449,7 @@ function HeaderMenuEntry({
|
|
|
3443
3449
|
}) {
|
|
3444
3450
|
if (item.children !== void 0 && item.children.length > 0) {
|
|
3445
3451
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(DropdownMenuSub, { children: [
|
|
3446
|
-
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(DropdownMenuSubTrigger, { "data-key": item.key, children: [
|
|
3452
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(DropdownMenuSubTrigger, { "data-key": item.key, className: "cursor-pointer", children: [
|
|
3447
3453
|
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Icon, { name: item.icon, size: "sm" }) : null,
|
|
3448
3454
|
item.label
|
|
3449
3455
|
] }),
|
|
@@ -3474,7 +3480,7 @@ function HeaderUserArea({
|
|
|
3474
3480
|
DropdownMenuTrigger,
|
|
3475
3481
|
{
|
|
3476
3482
|
"data-slot": "header-user",
|
|
3477
|
-
className: "flex items-center gap-2 rounded-md px-2 py-1.5 transition-colors outline-hidden hover:bg-accent/50",
|
|
3483
|
+
className: "flex items-center gap-2 rounded-md px-2 py-1.5 transition-colors outline-hidden hover:bg-accent/50 cursor-pointer",
|
|
3478
3484
|
children: identity
|
|
3479
3485
|
}
|
|
3480
3486
|
),
|
|
@@ -3495,7 +3501,7 @@ function HeaderLocalesArea({
|
|
|
3495
3501
|
DropdownMenuTrigger,
|
|
3496
3502
|
{
|
|
3497
3503
|
"data-slot": "header-locales",
|
|
3498
|
-
className: cn(menuItemClass, "outline-hidden"),
|
|
3504
|
+
className: cn(menuItemClass, "outline-hidden cursor-pointer"),
|
|
3499
3505
|
children: [
|
|
3500
3506
|
current?.label ?? locale,
|
|
3501
3507
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_lucide_react15.ChevronDownIcon, { className: "size-3.5", "aria-hidden": "true" })
|
|
@@ -3548,7 +3554,7 @@ function HoverCardContent({
|
|
|
3548
3554
|
{
|
|
3549
3555
|
"data-slot": "hover-card-content",
|
|
3550
3556
|
className: cn(
|
|
3551
|
-
"z-50 w-64 origin-(--transform-origin) rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md outline-hidden duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
3557
|
+
"z-50 w-64 origin-(--transform-origin) rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md shadow-(color:--shadow-color) outline-hidden duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
3552
3558
|
className
|
|
3553
3559
|
),
|
|
3554
3560
|
...props
|
|
@@ -4068,15 +4074,17 @@ function RailTooltip({
|
|
|
4068
4074
|
|
|
4069
4075
|
// src/components/components/Sidebar/index.tsx
|
|
4070
4076
|
var import_runtime13 = require("@pactor-app/runtime");
|
|
4071
|
-
var
|
|
4077
|
+
var import_react17 = require("react");
|
|
4078
|
+
|
|
4079
|
+
// src/ui/sidebar.tsx
|
|
4080
|
+
var React4 = __toESM(require("react"), 1);
|
|
4081
|
+
var import_class_variance_authority5 = require("class-variance-authority");
|
|
4082
|
+
var import_lucide_react18 = require("lucide-react");
|
|
4083
|
+
|
|
4084
|
+
// src/hooks/use-mobile.ts
|
|
4072
4085
|
var import_react16 = require("react");
|
|
4073
|
-
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
4074
|
-
var SidebarDrawerContext = (0, import_react16.createContext)(null);
|
|
4075
|
-
function useSidebarDrawer() {
|
|
4076
|
-
return (0, import_react16.useContext)(SidebarDrawerContext);
|
|
4077
|
-
}
|
|
4078
4086
|
var MOBILE_MEDIA_QUERY = "(max-width: 767px)";
|
|
4079
|
-
function
|
|
4087
|
+
function useIsMobile() {
|
|
4080
4088
|
const [isMobile, setIsMobile] = (0, import_react16.useState)(
|
|
4081
4089
|
() => typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia(MOBILE_MEDIA_QUERY).matches
|
|
4082
4090
|
);
|
|
@@ -4094,6 +4102,512 @@ function useIsMobileViewport() {
|
|
|
4094
4102
|
}, []);
|
|
4095
4103
|
return isMobile;
|
|
4096
4104
|
}
|
|
4105
|
+
|
|
4106
|
+
// src/ui/separator.tsx
|
|
4107
|
+
var import_separator = require("@base-ui/react/separator");
|
|
4108
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
4109
|
+
function Separator({
|
|
4110
|
+
className,
|
|
4111
|
+
orientation = "horizontal",
|
|
4112
|
+
decorative: _decorative,
|
|
4113
|
+
...props
|
|
4114
|
+
}) {
|
|
4115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
4116
|
+
import_separator.Separator,
|
|
4117
|
+
{
|
|
4118
|
+
"data-slot": "separator",
|
|
4119
|
+
orientation,
|
|
4120
|
+
className: cn(
|
|
4121
|
+
"shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
4122
|
+
className
|
|
4123
|
+
),
|
|
4124
|
+
...props
|
|
4125
|
+
}
|
|
4126
|
+
);
|
|
4127
|
+
}
|
|
4128
|
+
|
|
4129
|
+
// src/ui/sheet.tsx
|
|
4130
|
+
var import_dialog3 = require("@base-ui/react/dialog");
|
|
4131
|
+
var import_lucide_react17 = require("lucide-react");
|
|
4132
|
+
var import_class_variance_authority4 = require("class-variance-authority");
|
|
4133
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
4134
|
+
function Sheet({
|
|
4135
|
+
...props
|
|
4136
|
+
}) {
|
|
4137
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_dialog3.Dialog.Root, { "data-slot": "sheet", ...props });
|
|
4138
|
+
}
|
|
4139
|
+
function SheetPortal({
|
|
4140
|
+
...props
|
|
4141
|
+
}) {
|
|
4142
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_dialog3.Dialog.Portal, { "data-slot": "sheet-portal", ...props });
|
|
4143
|
+
}
|
|
4144
|
+
function SheetOverlay({
|
|
4145
|
+
className,
|
|
4146
|
+
...props
|
|
4147
|
+
}) {
|
|
4148
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
4149
|
+
import_dialog3.Dialog.Backdrop,
|
|
4150
|
+
{
|
|
4151
|
+
"data-slot": "sheet-overlay",
|
|
4152
|
+
className: cn(
|
|
4153
|
+
"fixed inset-0 z-50 bg-(--overlay-background) data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
|
|
4154
|
+
className
|
|
4155
|
+
),
|
|
4156
|
+
...props
|
|
4157
|
+
}
|
|
4158
|
+
);
|
|
4159
|
+
}
|
|
4160
|
+
var sheetVariants = (0, import_class_variance_authority4.cva)(
|
|
4161
|
+
"fixed z-50 flex flex-col gap-4 border-border bg-popover shadow-lg shadow-(color:--shadow-color) transition ease-in-out data-open:animate-in data-open:duration-300 data-closed:animate-out data-closed:duration-200",
|
|
4162
|
+
{
|
|
4163
|
+
variants: {
|
|
4164
|
+
side: {
|
|
4165
|
+
right: "inset-y-0 right-0 h-full w-3/4 border-l data-open:slide-in-from-right data-closed:slide-out-to-right sm:max-w-sm",
|
|
4166
|
+
left: "inset-y-0 left-0 h-full w-3/4 border-r data-open:slide-in-from-left data-closed:slide-out-to-left sm:max-w-sm",
|
|
4167
|
+
top: "inset-x-0 top-0 border-b data-open:slide-in-from-top data-closed:slide-out-to-top",
|
|
4168
|
+
bottom: "inset-x-0 bottom-0 border-t data-open:slide-in-from-bottom data-closed:slide-out-to-bottom"
|
|
4169
|
+
}
|
|
4170
|
+
},
|
|
4171
|
+
defaultVariants: {
|
|
4172
|
+
side: "right"
|
|
4173
|
+
}
|
|
4174
|
+
}
|
|
4175
|
+
);
|
|
4176
|
+
function SheetContent({
|
|
4177
|
+
className,
|
|
4178
|
+
children,
|
|
4179
|
+
side = "right",
|
|
4180
|
+
...props
|
|
4181
|
+
}) {
|
|
4182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(SheetPortal, { "data-slot": "sheet-portal", children: [
|
|
4183
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(SheetOverlay, {}),
|
|
4184
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
4185
|
+
import_dialog3.Dialog.Popup,
|
|
4186
|
+
{
|
|
4187
|
+
"data-slot": "sheet-content",
|
|
4188
|
+
className: cn(sheetVariants({ side }), className),
|
|
4189
|
+
...props,
|
|
4190
|
+
children: [
|
|
4191
|
+
children,
|
|
4192
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
4193
|
+
import_dialog3.Dialog.Close,
|
|
4194
|
+
{
|
|
4195
|
+
"data-slot": "sheet-close",
|
|
4196
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
4197
|
+
"button",
|
|
4198
|
+
{
|
|
4199
|
+
type: "button",
|
|
4200
|
+
className: "absolute top-4 right-4 cursor-pointer rounded-xs opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
|
|
4201
|
+
}
|
|
4202
|
+
),
|
|
4203
|
+
children: [
|
|
4204
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_lucide_react17.XIcon, {}),
|
|
4205
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "sr-only", children: "Close" })
|
|
4206
|
+
]
|
|
4207
|
+
}
|
|
4208
|
+
)
|
|
4209
|
+
]
|
|
4210
|
+
}
|
|
4211
|
+
)
|
|
4212
|
+
] });
|
|
4213
|
+
}
|
|
4214
|
+
function SheetHeader({ className, ...props }) {
|
|
4215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
4216
|
+
"div",
|
|
4217
|
+
{
|
|
4218
|
+
"data-slot": "sheet-header",
|
|
4219
|
+
className: cn("flex flex-col gap-1.5 p-4", className),
|
|
4220
|
+
...props
|
|
4221
|
+
}
|
|
4222
|
+
);
|
|
4223
|
+
}
|
|
4224
|
+
function SheetTitle({
|
|
4225
|
+
className,
|
|
4226
|
+
...props
|
|
4227
|
+
}) {
|
|
4228
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
4229
|
+
import_dialog3.Dialog.Title,
|
|
4230
|
+
{
|
|
4231
|
+
"data-slot": "sheet-title",
|
|
4232
|
+
className: cn("font-semibold text-foreground", className),
|
|
4233
|
+
...props
|
|
4234
|
+
}
|
|
4235
|
+
);
|
|
4236
|
+
}
|
|
4237
|
+
function SheetDescription({
|
|
4238
|
+
className,
|
|
4239
|
+
...props
|
|
4240
|
+
}) {
|
|
4241
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
4242
|
+
import_dialog3.Dialog.Description,
|
|
4243
|
+
{
|
|
4244
|
+
"data-slot": "sheet-description",
|
|
4245
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
4246
|
+
...props
|
|
4247
|
+
}
|
|
4248
|
+
);
|
|
4249
|
+
}
|
|
4250
|
+
|
|
4251
|
+
// src/ui/skeleton.tsx
|
|
4252
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
4253
|
+
function Skeleton({ className, ...props }) {
|
|
4254
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
4255
|
+
"div",
|
|
4256
|
+
{
|
|
4257
|
+
"data-slot": "skeleton",
|
|
4258
|
+
className: cn("animate-pulse rounded-md bg-muted", className),
|
|
4259
|
+
...props
|
|
4260
|
+
}
|
|
4261
|
+
);
|
|
4262
|
+
}
|
|
4263
|
+
|
|
4264
|
+
// src/ui/sidebar.tsx
|
|
4265
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
4266
|
+
var SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
4267
|
+
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
4268
|
+
var SIDEBAR_WIDTH = "16rem";
|
|
4269
|
+
var SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
4270
|
+
var SIDEBAR_WIDTH_ICON = "3rem";
|
|
4271
|
+
var SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
4272
|
+
var SidebarContext = React4.createContext(null);
|
|
4273
|
+
function useSidebar() {
|
|
4274
|
+
const context = React4.useContext(SidebarContext);
|
|
4275
|
+
if (!context) {
|
|
4276
|
+
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
4277
|
+
}
|
|
4278
|
+
return context;
|
|
4279
|
+
}
|
|
4280
|
+
function SidebarProvider({
|
|
4281
|
+
defaultOpen = true,
|
|
4282
|
+
open: openProp,
|
|
4283
|
+
onOpenChange: setOpenProp,
|
|
4284
|
+
className,
|
|
4285
|
+
style,
|
|
4286
|
+
children,
|
|
4287
|
+
...props
|
|
4288
|
+
}) {
|
|
4289
|
+
const isMobile = useIsMobile();
|
|
4290
|
+
const [openMobile, setOpenMobile] = React4.useState(false);
|
|
4291
|
+
const [_open, _setOpen] = React4.useState(defaultOpen);
|
|
4292
|
+
const open = openProp ?? _open;
|
|
4293
|
+
const setOpen = React4.useCallback(
|
|
4294
|
+
(value) => {
|
|
4295
|
+
const openState = typeof value === "function" ? value(open) : value;
|
|
4296
|
+
if (setOpenProp) {
|
|
4297
|
+
setOpenProp(openState);
|
|
4298
|
+
} else {
|
|
4299
|
+
_setOpen(openState);
|
|
4300
|
+
}
|
|
4301
|
+
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
4302
|
+
},
|
|
4303
|
+
[setOpenProp, open]
|
|
4304
|
+
);
|
|
4305
|
+
const toggleSidebar = React4.useCallback(() => {
|
|
4306
|
+
return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
|
|
4307
|
+
}, [isMobile, setOpen, setOpenMobile]);
|
|
4308
|
+
React4.useEffect(() => {
|
|
4309
|
+
const handleKeyDown = (event) => {
|
|
4310
|
+
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
4311
|
+
event.preventDefault();
|
|
4312
|
+
toggleSidebar();
|
|
4313
|
+
}
|
|
4314
|
+
};
|
|
4315
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
4316
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
4317
|
+
}, [toggleSidebar]);
|
|
4318
|
+
const state = open ? "expanded" : "collapsed";
|
|
4319
|
+
const contextValue = React4.useMemo(
|
|
4320
|
+
() => ({
|
|
4321
|
+
state,
|
|
4322
|
+
open,
|
|
4323
|
+
setOpen,
|
|
4324
|
+
isMobile,
|
|
4325
|
+
openMobile,
|
|
4326
|
+
setOpenMobile,
|
|
4327
|
+
toggleSidebar
|
|
4328
|
+
}),
|
|
4329
|
+
[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
|
|
4330
|
+
);
|
|
4331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(TooltipProvider, { delay: 0, children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
4332
|
+
"div",
|
|
4333
|
+
{
|
|
4334
|
+
"data-slot": "sidebar-wrapper",
|
|
4335
|
+
style: {
|
|
4336
|
+
"--sidebar-width": SIDEBAR_WIDTH,
|
|
4337
|
+
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
|
4338
|
+
...style
|
|
4339
|
+
},
|
|
4340
|
+
className: cn(
|
|
4341
|
+
"group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",
|
|
4342
|
+
className
|
|
4343
|
+
),
|
|
4344
|
+
...props,
|
|
4345
|
+
children
|
|
4346
|
+
}
|
|
4347
|
+
) }) });
|
|
4348
|
+
}
|
|
4349
|
+
function SidebarRoot({
|
|
4350
|
+
side = "left",
|
|
4351
|
+
variant = "sidebar",
|
|
4352
|
+
collapsible = "offcanvas",
|
|
4353
|
+
className,
|
|
4354
|
+
children,
|
|
4355
|
+
...props
|
|
4356
|
+
}) {
|
|
4357
|
+
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
4358
|
+
if (collapsible === "none") {
|
|
4359
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
4360
|
+
"div",
|
|
4361
|
+
{
|
|
4362
|
+
"data-slot": "sidebar",
|
|
4363
|
+
className: cn(
|
|
4364
|
+
"flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",
|
|
4365
|
+
className
|
|
4366
|
+
),
|
|
4367
|
+
...props,
|
|
4368
|
+
children
|
|
4369
|
+
}
|
|
4370
|
+
);
|
|
4371
|
+
}
|
|
4372
|
+
if (isMobile) {
|
|
4373
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
|
|
4374
|
+
SheetContent,
|
|
4375
|
+
{
|
|
4376
|
+
"data-sidebar": "sidebar",
|
|
4377
|
+
"data-slot": "sidebar",
|
|
4378
|
+
"data-mobile": "true",
|
|
4379
|
+
className: "w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",
|
|
4380
|
+
style: {
|
|
4381
|
+
"--sidebar-width": SIDEBAR_WIDTH_MOBILE
|
|
4382
|
+
},
|
|
4383
|
+
side,
|
|
4384
|
+
children: [
|
|
4385
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(SheetHeader, { className: "sr-only", children: [
|
|
4386
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(SheetTitle, { children: "Sidebar" }),
|
|
4387
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(SheetDescription, { children: "Displays the mobile sidebar." })
|
|
4388
|
+
] }),
|
|
4389
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "flex h-full w-full flex-col", children })
|
|
4390
|
+
]
|
|
4391
|
+
}
|
|
4392
|
+
) });
|
|
4393
|
+
}
|
|
4394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
|
|
4395
|
+
"div",
|
|
4396
|
+
{
|
|
4397
|
+
className: "group peer hidden text-sidebar-foreground md:block",
|
|
4398
|
+
"data-state": state,
|
|
4399
|
+
"data-collapsible": state === "collapsed" ? collapsible : "",
|
|
4400
|
+
"data-variant": variant,
|
|
4401
|
+
"data-side": side,
|
|
4402
|
+
"data-slot": "sidebar",
|
|
4403
|
+
children: [
|
|
4404
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
4405
|
+
"div",
|
|
4406
|
+
{
|
|
4407
|
+
"data-slot": "sidebar-gap",
|
|
4408
|
+
className: cn(
|
|
4409
|
+
"relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear",
|
|
4410
|
+
"group-data-[collapsible=offcanvas]:w-0",
|
|
4411
|
+
"group-data-[side=right]:rotate-180",
|
|
4412
|
+
variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
|
|
4413
|
+
)
|
|
4414
|
+
}
|
|
4415
|
+
),
|
|
4416
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
4417
|
+
"div",
|
|
4418
|
+
{
|
|
4419
|
+
"data-slot": "sidebar-container",
|
|
4420
|
+
className: cn(
|
|
4421
|
+
"fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",
|
|
4422
|
+
side === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
|
|
4423
|
+
variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",
|
|
4424
|
+
className
|
|
4425
|
+
),
|
|
4426
|
+
...props,
|
|
4427
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
4428
|
+
"div",
|
|
4429
|
+
{
|
|
4430
|
+
"data-sidebar": "sidebar",
|
|
4431
|
+
"data-slot": "sidebar-inner",
|
|
4432
|
+
className: "flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm",
|
|
4433
|
+
children
|
|
4434
|
+
}
|
|
4435
|
+
)
|
|
4436
|
+
}
|
|
4437
|
+
)
|
|
4438
|
+
]
|
|
4439
|
+
}
|
|
4440
|
+
);
|
|
4441
|
+
}
|
|
4442
|
+
function SidebarInset({ className, ...props }) {
|
|
4443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
4444
|
+
"main",
|
|
4445
|
+
{
|
|
4446
|
+
"data-slot": "sidebar-inset",
|
|
4447
|
+
className: cn(
|
|
4448
|
+
"relative flex w-full flex-1 flex-col bg-background",
|
|
4449
|
+
"md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",
|
|
4450
|
+
className
|
|
4451
|
+
),
|
|
4452
|
+
...props
|
|
4453
|
+
}
|
|
4454
|
+
);
|
|
4455
|
+
}
|
|
4456
|
+
function SidebarHeader({ className, ...props }) {
|
|
4457
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
4458
|
+
"div",
|
|
4459
|
+
{
|
|
4460
|
+
"data-slot": "sidebar-header",
|
|
4461
|
+
"data-sidebar": "header",
|
|
4462
|
+
className: cn("flex flex-col gap-2 p-2", className),
|
|
4463
|
+
...props
|
|
4464
|
+
}
|
|
4465
|
+
);
|
|
4466
|
+
}
|
|
4467
|
+
function SidebarFooter({ className, ...props }) {
|
|
4468
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
4469
|
+
"div",
|
|
4470
|
+
{
|
|
4471
|
+
"data-slot": "sidebar-footer",
|
|
4472
|
+
"data-sidebar": "footer",
|
|
4473
|
+
className: cn("flex flex-col gap-2 p-2", className),
|
|
4474
|
+
...props
|
|
4475
|
+
}
|
|
4476
|
+
);
|
|
4477
|
+
}
|
|
4478
|
+
function SidebarContent({ className, ...props }) {
|
|
4479
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
4480
|
+
"div",
|
|
4481
|
+
{
|
|
4482
|
+
"data-slot": "sidebar-content",
|
|
4483
|
+
"data-sidebar": "content",
|
|
4484
|
+
className: cn(
|
|
4485
|
+
"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
|
|
4486
|
+
className
|
|
4487
|
+
),
|
|
4488
|
+
...props
|
|
4489
|
+
}
|
|
4490
|
+
);
|
|
4491
|
+
}
|
|
4492
|
+
function renderAsChild(children, dataSlot, className, rest) {
|
|
4493
|
+
if (!React4.isValidElement(children)) {
|
|
4494
|
+
return null;
|
|
4495
|
+
}
|
|
4496
|
+
return React4.cloneElement(children, {
|
|
4497
|
+
"data-slot": dataSlot,
|
|
4498
|
+
className: cn(
|
|
4499
|
+
className,
|
|
4500
|
+
children.props.className
|
|
4501
|
+
),
|
|
4502
|
+
...rest
|
|
4503
|
+
});
|
|
4504
|
+
}
|
|
4505
|
+
function SidebarMenu({ className, ...props }) {
|
|
4506
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
4507
|
+
"ul",
|
|
4508
|
+
{
|
|
4509
|
+
"data-slot": "sidebar-menu",
|
|
4510
|
+
"data-sidebar": "menu",
|
|
4511
|
+
className: cn("flex w-full min-w-0 flex-col gap-1", className),
|
|
4512
|
+
...props
|
|
4513
|
+
}
|
|
4514
|
+
);
|
|
4515
|
+
}
|
|
4516
|
+
function SidebarMenuItem({ className, ...props }) {
|
|
4517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
4518
|
+
"li",
|
|
4519
|
+
{
|
|
4520
|
+
"data-slot": "sidebar-menu-item",
|
|
4521
|
+
"data-sidebar": "menu-item",
|
|
4522
|
+
className: cn("group/menu-item relative", className),
|
|
4523
|
+
...props
|
|
4524
|
+
}
|
|
4525
|
+
);
|
|
4526
|
+
}
|
|
4527
|
+
var sidebarMenuButtonVariants = (0, import_class_variance_authority5.cva)(
|
|
4528
|
+
"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
|
|
4529
|
+
{
|
|
4530
|
+
variants: {
|
|
4531
|
+
variant: {
|
|
4532
|
+
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
4533
|
+
outline: "bg-sidebar shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"
|
|
4534
|
+
},
|
|
4535
|
+
size: {
|
|
4536
|
+
default: "h-8 text-sm",
|
|
4537
|
+
sm: "h-7 text-xs",
|
|
4538
|
+
lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
|
|
4539
|
+
}
|
|
4540
|
+
},
|
|
4541
|
+
defaultVariants: {
|
|
4542
|
+
variant: "default",
|
|
4543
|
+
size: "default"
|
|
4544
|
+
}
|
|
4545
|
+
}
|
|
4546
|
+
);
|
|
4547
|
+
function SidebarMenuButton({
|
|
4548
|
+
asChild = false,
|
|
4549
|
+
isActive = false,
|
|
4550
|
+
variant = "default",
|
|
4551
|
+
size = "default",
|
|
4552
|
+
tooltip,
|
|
4553
|
+
className,
|
|
4554
|
+
children,
|
|
4555
|
+
...props
|
|
4556
|
+
}) {
|
|
4557
|
+
const { isMobile, state } = useSidebar();
|
|
4558
|
+
const cls = cn(sidebarMenuButtonVariants({ variant, size }), className);
|
|
4559
|
+
const button = asChild ? renderAsChild(children, "sidebar-menu-button", cls, {
|
|
4560
|
+
"data-sidebar": "menu-button",
|
|
4561
|
+
"data-size": size,
|
|
4562
|
+
"data-active": isActive,
|
|
4563
|
+
...props
|
|
4564
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
4565
|
+
"button",
|
|
4566
|
+
{
|
|
4567
|
+
"data-slot": "sidebar-menu-button",
|
|
4568
|
+
"data-sidebar": "menu-button",
|
|
4569
|
+
"data-size": size,
|
|
4570
|
+
"data-active": isActive,
|
|
4571
|
+
className: cls,
|
|
4572
|
+
...props,
|
|
4573
|
+
children
|
|
4574
|
+
}
|
|
4575
|
+
);
|
|
4576
|
+
if (!tooltip) {
|
|
4577
|
+
return button;
|
|
4578
|
+
}
|
|
4579
|
+
if (typeof tooltip === "string") {
|
|
4580
|
+
tooltip = {
|
|
4581
|
+
children: tooltip
|
|
4582
|
+
};
|
|
4583
|
+
}
|
|
4584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(Tooltip2, { children: [
|
|
4585
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(TooltipTrigger, { render: button }),
|
|
4586
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
4587
|
+
TooltipContent,
|
|
4588
|
+
{
|
|
4589
|
+
side: "right",
|
|
4590
|
+
align: "center",
|
|
4591
|
+
hidden: state !== "collapsed" || isMobile,
|
|
4592
|
+
...tooltip
|
|
4593
|
+
}
|
|
4594
|
+
)
|
|
4595
|
+
] });
|
|
4596
|
+
}
|
|
4597
|
+
|
|
4598
|
+
// src/components/components/Sidebar/index.tsx
|
|
4599
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
4600
|
+
function useSidebarDrawer() {
|
|
4601
|
+
try {
|
|
4602
|
+
const ctx = useSidebar();
|
|
4603
|
+
return {
|
|
4604
|
+
close: () => ctx.setOpenMobile(false),
|
|
4605
|
+
collapsed: ctx.state === "collapsed"
|
|
4606
|
+
};
|
|
4607
|
+
} catch {
|
|
4608
|
+
return null;
|
|
4609
|
+
}
|
|
4610
|
+
}
|
|
4097
4611
|
function useOptionalRenderer() {
|
|
4098
4612
|
try {
|
|
4099
4613
|
return (0, import_runtime13.useRenderer)();
|
|
@@ -4101,16 +4615,61 @@ function useOptionalRenderer() {
|
|
|
4101
4615
|
return null;
|
|
4102
4616
|
}
|
|
4103
4617
|
}
|
|
4104
|
-
function
|
|
4618
|
+
function SidebarContentSlot({ content }) {
|
|
4105
4619
|
const renderer = useOptionalRenderer();
|
|
4106
4620
|
if (renderer !== null && typeof content === "object" && content !== null && !("$$typeof" in content) && "type" in content) {
|
|
4107
|
-
return /* @__PURE__ */ (0,
|
|
4621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_jsx_runtime82.Fragment, { children: renderer.renderChildren([content]) });
|
|
4108
4622
|
}
|
|
4109
|
-
return /* @__PURE__ */ (0,
|
|
4623
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_jsx_runtime82.Fragment, { children: content });
|
|
4110
4624
|
}
|
|
4111
4625
|
function isBrandObject(brand) {
|
|
4112
4626
|
return typeof brand === "object" && brand !== null && !("$$typeof" in brand) && "title" in brand;
|
|
4113
4627
|
}
|
|
4628
|
+
function BrandNode({ brand, collapsed }) {
|
|
4629
|
+
if (brand === void 0 || brand === null) {
|
|
4630
|
+
return null;
|
|
4631
|
+
}
|
|
4632
|
+
if (isBrandObject(brand)) {
|
|
4633
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(import_jsx_runtime82.Fragment, { children: [
|
|
4634
|
+
brand.logo ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
4635
|
+
"img",
|
|
4636
|
+
{
|
|
4637
|
+
"data-slot": "sidebar-brand-logo",
|
|
4638
|
+
src: brand.logo,
|
|
4639
|
+
alt: brand.title,
|
|
4640
|
+
className: "size-6 shrink-0"
|
|
4641
|
+
}
|
|
4642
|
+
) : null,
|
|
4643
|
+
collapsed ? null : /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { className: "truncate text-sm font-semibold", children: brand.title })
|
|
4644
|
+
] });
|
|
4645
|
+
}
|
|
4646
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_jsx_runtime82.Fragment, { children: brand });
|
|
4647
|
+
}
|
|
4648
|
+
function SidebarNavItems({ items }) {
|
|
4649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(SidebarMenu, { children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(SidebarNavEntry, { item, depth: 0 }, item.href ?? item.label ?? index)) });
|
|
4650
|
+
}
|
|
4651
|
+
function SidebarNavEntry({ item, depth }) {
|
|
4652
|
+
const iconNode = item.icon ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Icon, { name: item.icon, size: "sm" }) : null;
|
|
4653
|
+
const labelNode = item.label;
|
|
4654
|
+
const button = item.href ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(SidebarMenuButton, { asChild: true, tooltip: item.label, children: /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("a", { href: item.href, children: [
|
|
4655
|
+
iconNode,
|
|
4656
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { children: labelNode })
|
|
4657
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(SidebarMenuButton, { tooltip: item.label, children: [
|
|
4658
|
+
iconNode,
|
|
4659
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { children: labelNode })
|
|
4660
|
+
] });
|
|
4661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(SidebarMenuItem, { children: [
|
|
4662
|
+
button,
|
|
4663
|
+
item.children && item.children.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: cn("ml-4"), children: item.children.map((child, index) => /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
4664
|
+
SidebarNavEntry,
|
|
4665
|
+
{
|
|
4666
|
+
item: child,
|
|
4667
|
+
depth: depth + 1
|
|
4668
|
+
},
|
|
4669
|
+
child.href ?? child.label ?? index
|
|
4670
|
+
)) })
|
|
4671
|
+
] });
|
|
4672
|
+
}
|
|
4114
4673
|
function Sidebar({
|
|
4115
4674
|
brand,
|
|
4116
4675
|
items = [],
|
|
@@ -4123,222 +4682,125 @@ function Sidebar({
|
|
|
4123
4682
|
className,
|
|
4124
4683
|
style,
|
|
4125
4684
|
children
|
|
4685
|
+
}) {
|
|
4686
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
4687
|
+
SidebarProvider,
|
|
4688
|
+
{
|
|
4689
|
+
defaultOpen: true,
|
|
4690
|
+
className,
|
|
4691
|
+
style,
|
|
4692
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
4693
|
+
SidebarInner,
|
|
4694
|
+
{
|
|
4695
|
+
brand,
|
|
4696
|
+
items,
|
|
4697
|
+
content,
|
|
4698
|
+
sidebarFooter,
|
|
4699
|
+
collapsible,
|
|
4700
|
+
onCollapse,
|
|
4701
|
+
locationKey,
|
|
4702
|
+
drawer,
|
|
4703
|
+
children
|
|
4704
|
+
}
|
|
4705
|
+
)
|
|
4706
|
+
}
|
|
4707
|
+
);
|
|
4708
|
+
}
|
|
4709
|
+
function SidebarInner({
|
|
4710
|
+
brand,
|
|
4711
|
+
items = [],
|
|
4712
|
+
content,
|
|
4713
|
+
sidebarFooter,
|
|
4714
|
+
collapsible,
|
|
4715
|
+
onCollapse,
|
|
4716
|
+
locationKey,
|
|
4717
|
+
drawer = true,
|
|
4718
|
+
children
|
|
4126
4719
|
}) {
|
|
4127
4720
|
const { t } = (0, import_runtime13.useI18n)();
|
|
4128
|
-
const isMobile =
|
|
4129
|
-
const
|
|
4130
|
-
const
|
|
4721
|
+
const isMobile = useIsMobile();
|
|
4722
|
+
const { state, setOpenMobile, toggleSidebar } = useSidebar();
|
|
4723
|
+
const collapsed = state === "collapsed";
|
|
4724
|
+
const prevCollapsed = (0, import_react17.useRef)(collapsed);
|
|
4725
|
+
(0, import_react17.useEffect)(() => {
|
|
4726
|
+
if (prevCollapsed.current !== collapsed) {
|
|
4727
|
+
prevCollapsed.current = collapsed;
|
|
4728
|
+
onCollapse?.(collapsed);
|
|
4729
|
+
}
|
|
4730
|
+
}, [collapsed, onCollapse]);
|
|
4731
|
+
(0, import_react17.useEffect)(() => {
|
|
4732
|
+
if (locationKey !== void 0) {
|
|
4733
|
+
setOpenMobile(false);
|
|
4734
|
+
}
|
|
4735
|
+
}, [locationKey, setOpenMobile]);
|
|
4131
4736
|
const collapsedEffective = collapsible === true && collapsed && !isMobile;
|
|
4132
|
-
const
|
|
4133
|
-
const
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
};
|
|
4138
|
-
const [trackedLocationKey, setTrackedLocationKey] = (0, import_react16.useState)(locationKey);
|
|
4139
|
-
if (trackedLocationKey !== locationKey) {
|
|
4140
|
-
setTrackedLocationKey(locationKey);
|
|
4141
|
-
setDrawerOpen(false);
|
|
4142
|
-
}
|
|
4143
|
-
(0, import_react16.useEffect)(() => {
|
|
4144
|
-
if (!drawerOpen) {
|
|
4145
|
-
return;
|
|
4146
|
-
}
|
|
4147
|
-
const onKeyDown = (event) => {
|
|
4148
|
-
if (event.key === "Escape") {
|
|
4149
|
-
setDrawerOpen(false);
|
|
4150
|
-
}
|
|
4151
|
-
};
|
|
4152
|
-
window.addEventListener("keydown", onKeyDown);
|
|
4153
|
-
return () => window.removeEventListener("keydown", onKeyDown);
|
|
4154
|
-
}, [drawerOpen]);
|
|
4155
|
-
const brandNode = isBrandObject(brand) ? /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_jsx_runtime78.Fragment, { children: [
|
|
4156
|
-
brand.logo ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
4157
|
-
"img",
|
|
4737
|
+
const brandNode = /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(BrandNode, { brand, collapsed: collapsedEffective });
|
|
4738
|
+
const sidebarContent = content !== void 0 && content !== null ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(SidebarContentSlot, { content }) : items.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(SidebarNavItems, { items }) : null;
|
|
4739
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(import_jsx_runtime82.Fragment, { children: [
|
|
4740
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
4741
|
+
SidebarRoot,
|
|
4158
4742
|
{
|
|
4159
|
-
"
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4743
|
+
collapsible: collapsible ? "icon" : "offcanvas",
|
|
4744
|
+
children: [
|
|
4745
|
+
(brand !== void 0 || collapsible) && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(SidebarHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
4746
|
+
"div",
|
|
4747
|
+
{
|
|
4748
|
+
"data-slot": "sidebar-brand",
|
|
4749
|
+
className: cn(
|
|
4750
|
+
"flex h-14 shrink-0 items-center gap-2 px-2",
|
|
4751
|
+
collapsedEffective && "justify-center px-0"
|
|
4752
|
+
),
|
|
4753
|
+
children: [
|
|
4754
|
+
collapsedEffective ? null : /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: brandNode }),
|
|
4755
|
+
collapsible && !isMobile && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
4756
|
+
"button",
|
|
4757
|
+
{
|
|
4758
|
+
type: "button",
|
|
4759
|
+
"data-slot": "sidebar-collapse-trigger",
|
|
4760
|
+
"aria-label": collapsedEffective ? t("pactor.layout.expandSidebar") : t("pactor.layout.collapseSidebar"),
|
|
4761
|
+
"aria-expanded": !collapsedEffective,
|
|
4762
|
+
className: "flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md text-sidebar-foreground/60 transition-colors hover:bg-sidebar-accent hover:text-sidebar-foreground",
|
|
4763
|
+
onClick: toggleSidebar,
|
|
4764
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Icon, { name: collapsedEffective ? "chevron-right" : "chevron-left", size: 16 })
|
|
4765
|
+
}
|
|
4766
|
+
)
|
|
4767
|
+
]
|
|
4768
|
+
}
|
|
4769
|
+
) }),
|
|
4770
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(SidebarContent, { children: sidebarContent }),
|
|
4771
|
+
sidebarFooter !== void 0 && sidebarFooter !== null && !collapsedEffective && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(SidebarFooter, { children: sidebarFooter })
|
|
4772
|
+
]
|
|
4163
4773
|
}
|
|
4164
|
-
)
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
const collapseTrigger = collapsible && !isMobile ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
4168
|
-
"button",
|
|
4169
|
-
{
|
|
4170
|
-
type: "button",
|
|
4171
|
-
"data-slot": "sidebar-collapse-trigger",
|
|
4172
|
-
"aria-label": collapsedEffective ? t("pactor.layout.expandSidebar") : t("pactor.layout.collapseSidebar"),
|
|
4173
|
-
"aria-expanded": !collapsedEffective,
|
|
4174
|
-
title: collapsedEffective ? t("pactor.layout.expandSidebar") : t("pactor.layout.collapseSidebar"),
|
|
4175
|
-
className: cn(
|
|
4176
|
-
"cursor-pointer flex size-8 shrink-0 items-center justify-center rounded-md text-sidebar-foreground/60 transition-colors hover:bg-sidebar-accent hover:text-sidebar-foreground"
|
|
4177
|
-
),
|
|
4178
|
-
onClick: toggleCollapsed,
|
|
4179
|
-
children: collapsedEffective ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_lucide_react17.ChevronRight, { "aria-hidden": true, className: "size-4" }) : /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_lucide_react17.ChevronLeft, { "aria-hidden": true, className: "size-4" })
|
|
4180
|
-
}
|
|
4181
|
-
) : null;
|
|
4182
|
-
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
4183
|
-
SidebarDrawerContext.Provider,
|
|
4184
|
-
{
|
|
4185
|
-
value: { close, collapsed: collapsedEffective },
|
|
4186
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
4774
|
+
),
|
|
4775
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(SidebarInset, { children: [
|
|
4776
|
+
drawer && /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
4187
4777
|
"div",
|
|
4188
4778
|
{
|
|
4189
|
-
"data-slot": "sidebar-
|
|
4190
|
-
className:
|
|
4191
|
-
style,
|
|
4779
|
+
"data-slot": "sidebar-topbar",
|
|
4780
|
+
className: "flex h-14 items-center gap-2 border-b border-sidebar-border bg-sidebar px-3 md:hidden",
|
|
4192
4781
|
children: [
|
|
4193
|
-
|
|
4194
|
-
"
|
|
4782
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
4783
|
+
"button",
|
|
4195
4784
|
{
|
|
4196
|
-
|
|
4197
|
-
"
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
4203
|
-
"aside",
|
|
4204
|
-
{
|
|
4205
|
-
"data-slot": "sidebar",
|
|
4206
|
-
"data-collapsed": collapsedEffective || void 0,
|
|
4207
|
-
"data-open": drawerOpen ? "true" : "false",
|
|
4208
|
-
inert: drawer && isMobile && !drawerOpen ? true : void 0,
|
|
4209
|
-
className: cn(
|
|
4210
|
-
"flex shrink-0 flex-col border-r border-sidebar-border bg-sidebar text-sidebar-foreground transition-[width,transform]",
|
|
4211
|
-
collapsedEffective ? "w-16" : "w-60",
|
|
4212
|
-
// 移动端覆盖抽屉:退出文档流,关闭时移出屏幕
|
|
4213
|
-
drawer && "max-md:fixed max-md:inset-y-0 max-md:left-0 max-md:z-50 max-md:w-60 max-md:-translate-x-full max-md:data-[open=true]:translate-x-0"
|
|
4214
|
-
),
|
|
4215
|
-
children: [
|
|
4216
|
-
brand !== void 0 || collapseTrigger !== null ? /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
4217
|
-
"div",
|
|
4218
|
-
{
|
|
4219
|
-
"data-slot": "sidebar-brand",
|
|
4220
|
-
className: cn(
|
|
4221
|
-
"flex h-14 shrink-0 items-center gap-2 border-b border-sidebar-border px-4",
|
|
4222
|
-
// 移动端品牌维持顶栏现状:抽屉内不重复渲染品牌行
|
|
4223
|
-
"max-md:hidden",
|
|
4224
|
-
collapsedEffective && "justify-center px-2"
|
|
4225
|
-
),
|
|
4226
|
-
children: [
|
|
4227
|
-
collapsedEffective ? null : /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: brandNode }),
|
|
4228
|
-
collapseTrigger
|
|
4229
|
-
]
|
|
4230
|
-
}
|
|
4231
|
-
) : null,
|
|
4232
|
-
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
4233
|
-
"nav",
|
|
4234
|
-
{
|
|
4235
|
-
"data-slot": "sidebar-nav",
|
|
4236
|
-
className: "min-h-0 flex-1 overflow-auto p-2",
|
|
4237
|
-
children: content !== void 0 && content !== null ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(SidebarContent, { content }) : items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
4238
|
-
SidebarEntry,
|
|
4239
|
-
{
|
|
4240
|
-
item,
|
|
4241
|
-
depth: 0,
|
|
4242
|
-
collapsed: collapsedEffective
|
|
4243
|
-
},
|
|
4244
|
-
item.href ?? item.label ?? index
|
|
4245
|
-
))
|
|
4246
|
-
}
|
|
4247
|
-
),
|
|
4248
|
-
sidebarFooter !== void 0 && sidebarFooter !== null && !collapsedEffective ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
4249
|
-
"div",
|
|
4250
|
-
{
|
|
4251
|
-
"data-slot": "sidebar-footer",
|
|
4252
|
-
className: "shrink-0 border-t border-sidebar-border p-2",
|
|
4253
|
-
children: sidebarFooter
|
|
4254
|
-
}
|
|
4255
|
-
) : null
|
|
4256
|
-
]
|
|
4785
|
+
type: "button",
|
|
4786
|
+
"data-slot": "sidebar-menu-trigger",
|
|
4787
|
+
"aria-label": t("pactor.layout.openNavigation"),
|
|
4788
|
+
className: "flex size-8 items-center justify-center rounded-md text-sidebar-foreground/60 transition-colors hover:bg-sidebar-accent hover:text-sidebar-foreground",
|
|
4789
|
+
onClick: toggleSidebar,
|
|
4790
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Icon, { name: "menu", size: 18 })
|
|
4257
4791
|
}
|
|
4258
4792
|
),
|
|
4259
|
-
|
|
4260
|
-
"main",
|
|
4261
|
-
{
|
|
4262
|
-
"data-slot": "sidebar-content",
|
|
4263
|
-
className: "flex min-w-0 flex-1 flex-col",
|
|
4264
|
-
children: [
|
|
4265
|
-
drawer ? /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
4266
|
-
"div",
|
|
4267
|
-
{
|
|
4268
|
-
"data-slot": "sidebar-topbar",
|
|
4269
|
-
className: "flex h-14 items-center gap-2 border-b border-sidebar-border bg-sidebar px-3 md:hidden",
|
|
4270
|
-
children: [
|
|
4271
|
-
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
4272
|
-
"button",
|
|
4273
|
-
{
|
|
4274
|
-
type: "button",
|
|
4275
|
-
"data-slot": "sidebar-menu-trigger",
|
|
4276
|
-
"aria-label": t("pactor.layout.openNavigation"),
|
|
4277
|
-
"aria-expanded": drawerOpen,
|
|
4278
|
-
className: "flex size-8 items-center justify-center rounded-md text-sidebar-foreground/60 transition-colors hover:bg-sidebar-accent hover:text-sidebar-foreground",
|
|
4279
|
-
onClick: () => setDrawerOpen(true),
|
|
4280
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Icon, { name: "menu", size: 18 })
|
|
4281
|
-
}
|
|
4282
|
-
),
|
|
4283
|
-
brandNode
|
|
4284
|
-
]
|
|
4285
|
-
}
|
|
4286
|
-
) : null,
|
|
4287
|
-
children
|
|
4288
|
-
]
|
|
4289
|
-
}
|
|
4290
|
-
)
|
|
4793
|
+
brandNode
|
|
4291
4794
|
]
|
|
4292
4795
|
}
|
|
4293
|
-
)
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
}
|
|
4297
|
-
function SidebarEntry({
|
|
4298
|
-
item,
|
|
4299
|
-
depth,
|
|
4300
|
-
collapsed
|
|
4301
|
-
}) {
|
|
4302
|
-
const entryClass = cn(
|
|
4303
|
-
"flex w-full items-center gap-2 rounded-md px-3 py-2 text-left text-sm transition-colors",
|
|
4304
|
-
"text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
4305
|
-
collapsed && "justify-center px-0"
|
|
4306
|
-
);
|
|
4307
|
-
const indentStyle = !collapsed && depth > 0 ? { paddingLeft: 12 + depth * 16 } : void 0;
|
|
4308
|
-
const labelNode = collapsed ? null : item.label;
|
|
4309
|
-
const iconNode = item.icon ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Icon, { name: item.icon, size: "sm" }) : null;
|
|
4310
|
-
const entry = item.href ? /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
4311
|
-
"a",
|
|
4312
|
-
{
|
|
4313
|
-
"data-slot": "sidebar-item",
|
|
4314
|
-
href: item.href,
|
|
4315
|
-
className: entryClass,
|
|
4316
|
-
style: indentStyle,
|
|
4317
|
-
children: [
|
|
4318
|
-
iconNode,
|
|
4319
|
-
labelNode
|
|
4320
|
-
]
|
|
4321
|
-
}
|
|
4322
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("span", { "data-slot": "sidebar-item", className: entryClass, style: indentStyle, children: [
|
|
4323
|
-
iconNode,
|
|
4324
|
-
labelNode
|
|
4325
|
-
] });
|
|
4326
|
-
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { "data-slot": "sidebar-entry", children: [
|
|
4327
|
-
collapsed ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(RailTooltip, { label: item.label, children: entry }) : entry,
|
|
4328
|
-
item.children?.map((child, index) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
4329
|
-
SidebarEntry,
|
|
4330
|
-
{
|
|
4331
|
-
item: child,
|
|
4332
|
-
depth: depth + 1,
|
|
4333
|
-
collapsed
|
|
4334
|
-
},
|
|
4335
|
-
child.href ?? child.label ?? index
|
|
4336
|
-
))
|
|
4796
|
+
),
|
|
4797
|
+
children
|
|
4798
|
+
] })
|
|
4337
4799
|
] });
|
|
4338
4800
|
}
|
|
4339
4801
|
|
|
4340
4802
|
// src/components/components/Menu/index.tsx
|
|
4341
|
-
var
|
|
4803
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
4342
4804
|
function Menu2({
|
|
4343
4805
|
items = [],
|
|
4344
4806
|
mode = "inline",
|
|
@@ -4350,7 +4812,7 @@ function Menu2({
|
|
|
4350
4812
|
const drawer = useSidebarDrawer();
|
|
4351
4813
|
const collapsed = mode === "inline" && drawer?.collapsed === true;
|
|
4352
4814
|
let previousGroup;
|
|
4353
|
-
return /* @__PURE__ */ (0,
|
|
4815
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
4354
4816
|
"nav",
|
|
4355
4817
|
{
|
|
4356
4818
|
"data-slot": "menu",
|
|
@@ -4367,8 +4829,8 @@ function Menu2({
|
|
|
4367
4829
|
groupLabel = item.group;
|
|
4368
4830
|
}
|
|
4369
4831
|
previousGroup = item.group;
|
|
4370
|
-
return /* @__PURE__ */ (0,
|
|
4371
|
-
groupLabel !== void 0 && /* @__PURE__ */ (0,
|
|
4832
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { "data-slot": "menu-group-entry", children: [
|
|
4833
|
+
groupLabel !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
4372
4834
|
"div",
|
|
4373
4835
|
{
|
|
4374
4836
|
"data-slot": "menu-group",
|
|
@@ -4376,7 +4838,7 @@ function Menu2({
|
|
|
4376
4838
|
children: groupLabel
|
|
4377
4839
|
}
|
|
4378
4840
|
),
|
|
4379
|
-
/* @__PURE__ */ (0,
|
|
4841
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
4380
4842
|
MenuEntry,
|
|
4381
4843
|
{
|
|
4382
4844
|
item,
|
|
@@ -4401,7 +4863,7 @@ function MenuEntry({
|
|
|
4401
4863
|
collapsed = false
|
|
4402
4864
|
}) {
|
|
4403
4865
|
const selected = item.key === selectedKey;
|
|
4404
|
-
const button = /* @__PURE__ */ (0,
|
|
4866
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(
|
|
4405
4867
|
"button",
|
|
4406
4868
|
{
|
|
4407
4869
|
type: "button",
|
|
@@ -4412,7 +4874,7 @@ function MenuEntry({
|
|
|
4412
4874
|
"flex w-full items-center gap-2 rounded-md text-sm transition-colors",
|
|
4413
4875
|
mode === "horizontal" ? "px-3 py-2" : "px-3 py-2 text-left",
|
|
4414
4876
|
collapsed && "justify-center px-0",
|
|
4415
|
-
selected ? "bg-
|
|
4877
|
+
selected ? "bg-(--menu-active-background) font-medium text-(--menu-active-foreground)" : "cursor-pointer text-muted-foreground hover:bg-(--menu-hover-background)/50 hover:text-foreground",
|
|
4416
4878
|
item.disabled && "cursor-not-allowed opacity-50 hover:bg-transparent hover:text-muted-foreground"
|
|
4417
4879
|
),
|
|
4418
4880
|
style: mode === "inline" && depth > 0 && !collapsed ? { paddingLeft: 12 + depth * 16 } : void 0,
|
|
@@ -4422,10 +4884,10 @@ function MenuEntry({
|
|
|
4422
4884
|
}
|
|
4423
4885
|
},
|
|
4424
4886
|
children: [
|
|
4425
|
-
item.icon ? /* @__PURE__ */ (0,
|
|
4426
|
-
collapsed ? null : /* @__PURE__ */ (0,
|
|
4427
|
-
item.dot && !collapsed ? /* @__PURE__ */ (0,
|
|
4428
|
-
item.badge !== void 0 && !collapsed ? /* @__PURE__ */ (0,
|
|
4887
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Icon, { name: item.icon, size: "sm" }) : null,
|
|
4888
|
+
collapsed ? null : /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { className: "min-w-0 flex-1 truncate text-left", children: item.label }),
|
|
4889
|
+
item.dot && !collapsed ? /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { "data-slot": "menu-item-dot", className: "size-1.5 shrink-0 rounded-full bg-destructive" }) : null,
|
|
4890
|
+
item.badge !== void 0 && !collapsed ? /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
4429
4891
|
"span",
|
|
4430
4892
|
{
|
|
4431
4893
|
"data-slot": "menu-item-badge",
|
|
@@ -4436,9 +4898,9 @@ function MenuEntry({
|
|
|
4436
4898
|
]
|
|
4437
4899
|
}
|
|
4438
4900
|
);
|
|
4439
|
-
return /* @__PURE__ */ (0,
|
|
4440
|
-
collapsed ? /* @__PURE__ */ (0,
|
|
4441
|
-
item.children?.map((child) => /* @__PURE__ */ (0,
|
|
4901
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { "data-slot": "menu-entry", "data-key": item.key, children: [
|
|
4902
|
+
collapsed ? /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(RailTooltip, { label: item.label, children: button }) : button,
|
|
4903
|
+
item.children?.map((child) => /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
4442
4904
|
MenuEntry,
|
|
4443
4905
|
{
|
|
4444
4906
|
item: child,
|
|
@@ -4456,17 +4918,17 @@ function MenuEntry({
|
|
|
4456
4918
|
// src/ui/menubar.tsx
|
|
4457
4919
|
var import_menu2 = require("@base-ui/react/menu");
|
|
4458
4920
|
var import_menubar = require("@base-ui/react/menubar");
|
|
4459
|
-
var
|
|
4921
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
4460
4922
|
function Menubar({
|
|
4461
4923
|
className,
|
|
4462
4924
|
...props
|
|
4463
4925
|
}) {
|
|
4464
|
-
return /* @__PURE__ */ (0,
|
|
4926
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
4465
4927
|
import_menubar.Menubar,
|
|
4466
4928
|
{
|
|
4467
4929
|
"data-slot": "menubar",
|
|
4468
4930
|
className: cn(
|
|
4469
|
-
"flex h-9 items-center gap-1 rounded-md border border-border bg-
|
|
4931
|
+
"flex h-9 items-center gap-1 rounded-md border border-border bg-card p-1 shadow-xs",
|
|
4470
4932
|
className
|
|
4471
4933
|
),
|
|
4472
4934
|
...props
|
|
@@ -4476,18 +4938,18 @@ function Menubar({
|
|
|
4476
4938
|
function MenubarMenu({
|
|
4477
4939
|
...props
|
|
4478
4940
|
}) {
|
|
4479
|
-
return /* @__PURE__ */ (0,
|
|
4941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_menu2.Menu.Root, { "data-slot": "menubar-menu", ...props });
|
|
4480
4942
|
}
|
|
4481
4943
|
function MenubarTrigger({
|
|
4482
4944
|
className,
|
|
4483
4945
|
...props
|
|
4484
4946
|
}) {
|
|
4485
|
-
return /* @__PURE__ */ (0,
|
|
4947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
4486
4948
|
import_menu2.Menu.Trigger,
|
|
4487
4949
|
{
|
|
4488
4950
|
"data-slot": "menubar-trigger",
|
|
4489
4951
|
className: cn(
|
|
4490
|
-
"flex cursor-pointer items-center rounded-sm px-2 py-1 text-sm font-medium outline-hidden select-none hover:bg-
|
|
4952
|
+
"flex cursor-pointer items-center rounded-sm px-2 py-1 text-sm font-medium outline-hidden select-none hover:bg-(--menu-hover-background) hover:text-(--menu-hover-foreground) focus:bg-(--menu-hover-background) focus:text-(--menu-hover-foreground) data-open:bg-(--menu-active-background) data-open:text-(--menu-active-foreground)",
|
|
4491
4953
|
className
|
|
4492
4954
|
),
|
|
4493
4955
|
...props
|
|
@@ -4501,19 +4963,19 @@ function MenubarContent({
|
|
|
4501
4963
|
sideOffset = 8,
|
|
4502
4964
|
...props
|
|
4503
4965
|
}) {
|
|
4504
|
-
return /* @__PURE__ */ (0,
|
|
4966
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_menu2.Menu.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
4505
4967
|
import_menu2.Menu.Positioner,
|
|
4506
4968
|
{
|
|
4507
4969
|
align,
|
|
4508
4970
|
side,
|
|
4509
4971
|
sideOffset,
|
|
4510
4972
|
className: "isolate z-50",
|
|
4511
|
-
children: /* @__PURE__ */ (0,
|
|
4973
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
4512
4974
|
import_menu2.Menu.Popup,
|
|
4513
4975
|
{
|
|
4514
4976
|
"data-slot": "menubar-content",
|
|
4515
4977
|
className: cn(
|
|
4516
|
-
"z-50 min-w-36 origin-(--transform-origin) overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
4978
|
+
"z-50 min-w-36 origin-(--transform-origin) overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md shadow-(color:--shadow-color) duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
4517
4979
|
className
|
|
4518
4980
|
),
|
|
4519
4981
|
...props
|
|
@@ -4527,13 +4989,13 @@ function MenubarItem({
|
|
|
4527
4989
|
variant = "default",
|
|
4528
4990
|
...props
|
|
4529
4991
|
}) {
|
|
4530
|
-
return /* @__PURE__ */ (0,
|
|
4992
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
4531
4993
|
import_menu2.Menu.Item,
|
|
4532
4994
|
{
|
|
4533
4995
|
"data-slot": "menubar-item",
|
|
4534
4996
|
"data-variant": variant,
|
|
4535
4997
|
className: cn(
|
|
4536
|
-
"relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-
|
|
4998
|
+
"relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-(--menu-hover-background) focus:text-(--menu-hover-foreground) data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
4537
4999
|
className
|
|
4538
5000
|
),
|
|
4539
5001
|
...props
|
|
@@ -4542,17 +5004,17 @@ function MenubarItem({
|
|
|
4542
5004
|
}
|
|
4543
5005
|
|
|
4544
5006
|
// src/components/components/Menubar/index.tsx
|
|
4545
|
-
var
|
|
5007
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
4546
5008
|
function Menubar2({ menus = [], onSelect, className, style }) {
|
|
4547
|
-
return /* @__PURE__ */ (0,
|
|
4548
|
-
/* @__PURE__ */ (0,
|
|
4549
|
-
/* @__PURE__ */ (0,
|
|
5009
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Menubar, { className, style, children: menus.map((menu) => /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(MenubarMenu, { children: [
|
|
5010
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(MenubarTrigger, { children: menu.label }),
|
|
5011
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(MenubarContent, { children: menu.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
|
|
4550
5012
|
MenubarItem,
|
|
4551
5013
|
{
|
|
4552
5014
|
disabled: item.disabled,
|
|
4553
5015
|
onClick: () => onSelect?.(item.value),
|
|
4554
5016
|
children: [
|
|
4555
|
-
item.icon ? /* @__PURE__ */ (0,
|
|
5017
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Icon, { name: item.icon, size: "sm" }) : null,
|
|
4556
5018
|
item.label
|
|
4557
5019
|
]
|
|
4558
5020
|
},
|
|
@@ -4563,15 +5025,15 @@ function Menubar2({ menus = [], onSelect, className, style }) {
|
|
|
4563
5025
|
|
|
4564
5026
|
// src/ui/navigation-menu.tsx
|
|
4565
5027
|
var import_navigation_menu = require("@base-ui/react/navigation-menu");
|
|
4566
|
-
var
|
|
4567
|
-
var
|
|
4568
|
-
var
|
|
5028
|
+
var import_lucide_react19 = require("lucide-react");
|
|
5029
|
+
var import_class_variance_authority6 = require("class-variance-authority");
|
|
5030
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
4569
5031
|
function NavigationMenu({
|
|
4570
5032
|
className,
|
|
4571
5033
|
children,
|
|
4572
5034
|
...props
|
|
4573
5035
|
}) {
|
|
4574
|
-
return /* @__PURE__ */ (0,
|
|
5036
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(
|
|
4575
5037
|
import_navigation_menu.NavigationMenu.Root,
|
|
4576
5038
|
{
|
|
4577
5039
|
"data-slot": "navigation-menu",
|
|
@@ -4579,7 +5041,7 @@ function NavigationMenu({
|
|
|
4579
5041
|
...props,
|
|
4580
5042
|
children: [
|
|
4581
5043
|
children,
|
|
4582
|
-
/* @__PURE__ */ (0,
|
|
5044
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(NavigationMenuViewport, {})
|
|
4583
5045
|
]
|
|
4584
5046
|
}
|
|
4585
5047
|
);
|
|
@@ -4588,7 +5050,7 @@ function NavigationMenuList({
|
|
|
4588
5050
|
className,
|
|
4589
5051
|
...props
|
|
4590
5052
|
}) {
|
|
4591
|
-
return /* @__PURE__ */ (0,
|
|
5053
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
4592
5054
|
import_navigation_menu.NavigationMenu.List,
|
|
4593
5055
|
{
|
|
4594
5056
|
"data-slot": "navigation-menu-list",
|
|
@@ -4601,7 +5063,7 @@ function NavigationMenuItem({
|
|
|
4601
5063
|
className,
|
|
4602
5064
|
...props
|
|
4603
5065
|
}) {
|
|
4604
|
-
return /* @__PURE__ */ (0,
|
|
5066
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
4605
5067
|
import_navigation_menu.NavigationMenu.Item,
|
|
4606
5068
|
{
|
|
4607
5069
|
"data-slot": "navigation-menu-item",
|
|
@@ -4610,15 +5072,15 @@ function NavigationMenuItem({
|
|
|
4610
5072
|
}
|
|
4611
5073
|
);
|
|
4612
5074
|
}
|
|
4613
|
-
var navigationMenuTriggerStyle = (0,
|
|
4614
|
-
"group/navigation-menu-trigger inline-flex h-9 w-max items-center justify-center rounded-md bg-
|
|
5075
|
+
var navigationMenuTriggerStyle = (0, import_class_variance_authority6.cva)(
|
|
5076
|
+
"group/navigation-menu-trigger inline-flex h-9 w-max items-center justify-center rounded-md bg-transparent px-4 py-2 text-sm font-medium transition-colors hover:bg-(--menu-hover-background) hover:text-(--menu-hover-foreground) focus:bg-(--menu-hover-background) focus:text-(--menu-hover-foreground) focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 data-open:bg-(--menu-active-background)/50 data-open:text-(--menu-active-foreground)"
|
|
4615
5077
|
);
|
|
4616
5078
|
function NavigationMenuTrigger({
|
|
4617
5079
|
className,
|
|
4618
5080
|
children,
|
|
4619
5081
|
...props
|
|
4620
5082
|
}) {
|
|
4621
|
-
return /* @__PURE__ */ (0,
|
|
5083
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(
|
|
4622
5084
|
import_navigation_menu.NavigationMenu.Trigger,
|
|
4623
5085
|
{
|
|
4624
5086
|
"data-slot": "navigation-menu-trigger",
|
|
@@ -4626,8 +5088,8 @@ function NavigationMenuTrigger({
|
|
|
4626
5088
|
...props,
|
|
4627
5089
|
children: [
|
|
4628
5090
|
children,
|
|
4629
|
-
/* @__PURE__ */ (0,
|
|
4630
|
-
|
|
5091
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
5092
|
+
import_lucide_react19.ChevronDownIcon,
|
|
4631
5093
|
{
|
|
4632
5094
|
className: "relative top-px ml-1 size-3 transition-transform duration-200 group-data-open/navigation-menu-trigger:rotate-180",
|
|
4633
5095
|
"aria-hidden": "true"
|
|
@@ -4641,7 +5103,7 @@ function NavigationMenuContent({
|
|
|
4641
5103
|
className,
|
|
4642
5104
|
...props
|
|
4643
5105
|
}) {
|
|
4644
|
-
return /* @__PURE__ */ (0,
|
|
5106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
4645
5107
|
import_navigation_menu.NavigationMenu.Content,
|
|
4646
5108
|
{
|
|
4647
5109
|
"data-slot": "navigation-menu-content",
|
|
@@ -4654,21 +5116,21 @@ function NavigationMenuContent({
|
|
|
4654
5116
|
);
|
|
4655
5117
|
}
|
|
4656
5118
|
function NavigationMenuViewport({ className }) {
|
|
4657
|
-
return /* @__PURE__ */ (0,
|
|
5119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_navigation_menu.NavigationMenu.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
4658
5120
|
import_navigation_menu.NavigationMenu.Positioner,
|
|
4659
5121
|
{
|
|
4660
5122
|
side: "bottom",
|
|
4661
5123
|
align: "start",
|
|
4662
5124
|
className: "isolate z-50",
|
|
4663
|
-
children: /* @__PURE__ */ (0,
|
|
5125
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
4664
5126
|
import_navigation_menu.NavigationMenu.Popup,
|
|
4665
5127
|
{
|
|
4666
5128
|
"data-slot": "navigation-menu-popup",
|
|
4667
5129
|
className: cn(
|
|
4668
|
-
"origin-(--transform-origin) overflow-hidden rounded-md border border-border bg-popover text-popover-foreground shadow-md duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
5130
|
+
"origin-(--transform-origin) overflow-hidden rounded-md border border-border bg-popover text-popover-foreground shadow-md shadow-(color:--shadow-color) duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
4669
5131
|
className
|
|
4670
5132
|
),
|
|
4671
|
-
children: /* @__PURE__ */ (0,
|
|
5133
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_navigation_menu.NavigationMenu.Viewport, { "data-slot": "navigation-menu-viewport" })
|
|
4672
5134
|
}
|
|
4673
5135
|
)
|
|
4674
5136
|
}
|
|
@@ -4678,12 +5140,12 @@ function NavigationMenuLink({
|
|
|
4678
5140
|
className,
|
|
4679
5141
|
...props
|
|
4680
5142
|
}) {
|
|
4681
|
-
return /* @__PURE__ */ (0,
|
|
5143
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
4682
5144
|
import_navigation_menu.NavigationMenu.Link,
|
|
4683
5145
|
{
|
|
4684
5146
|
"data-slot": "navigation-menu-link",
|
|
4685
5147
|
className: cn(
|
|
4686
|
-
"flex flex-col gap-1 rounded-md p-2 text-sm transition-colors outline-none hover:bg-
|
|
5148
|
+
"flex flex-col gap-1 rounded-md p-2 text-sm transition-colors outline-none hover:bg-(--menu-hover-background) hover:text-(--menu-hover-foreground) focus:bg-(--menu-hover-background) focus:text-(--menu-hover-foreground) focus-visible:ring-[3px] focus-visible:ring-ring/50 data-active:bg-(--menu-active-background)/50 data-active:text-(--menu-active-foreground) [&_svg:not([class*='size-'])]:size-4",
|
|
4687
5149
|
className
|
|
4688
5150
|
),
|
|
4689
5151
|
...props
|
|
@@ -4692,33 +5154,33 @@ function NavigationMenuLink({
|
|
|
4692
5154
|
}
|
|
4693
5155
|
|
|
4694
5156
|
// src/components/components/NavigationMenu/index.tsx
|
|
4695
|
-
var
|
|
5157
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
4696
5158
|
function NavigationMenu2({ items = [], className, style }) {
|
|
4697
|
-
return /* @__PURE__ */ (0,
|
|
4698
|
-
/* @__PURE__ */ (0,
|
|
5159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(NavigationMenu, { className, style, children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(NavigationMenuList, { children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(NavigationMenuItem, { value: `item-${index}`, children: item.children && item.children.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_jsx_runtime87.Fragment, { children: [
|
|
5160
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
|
|
4699
5161
|
NavigationMenuTrigger,
|
|
4700
5162
|
{
|
|
4701
5163
|
className: item.icon !== void 0 ? "gap-2" : void 0,
|
|
4702
5164
|
children: [
|
|
4703
|
-
item.icon ? /* @__PURE__ */ (0,
|
|
5165
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Icon, { name: item.icon, size: "sm" }) : null,
|
|
4704
5166
|
item.label
|
|
4705
5167
|
]
|
|
4706
5168
|
}
|
|
4707
5169
|
),
|
|
4708
|
-
/* @__PURE__ */ (0,
|
|
4709
|
-
/* @__PURE__ */ (0,
|
|
5170
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(NavigationMenuContent, { children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("ul", { className: "grid w-64 gap-1", children: item.children.map((child) => /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(NavigationMenuLink, { href: child.href, children: [
|
|
5171
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
|
|
4710
5172
|
"span",
|
|
4711
5173
|
{
|
|
4712
5174
|
className: child.icon !== void 0 ? "flex items-center gap-2 font-medium" : "font-medium",
|
|
4713
5175
|
children: [
|
|
4714
|
-
child.icon ? /* @__PURE__ */ (0,
|
|
5176
|
+
child.icon ? /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Icon, { name: child.icon, size: "sm" }) : null,
|
|
4715
5177
|
child.label
|
|
4716
5178
|
]
|
|
4717
5179
|
}
|
|
4718
5180
|
),
|
|
4719
|
-
child.description ? /* @__PURE__ */ (0,
|
|
5181
|
+
child.description ? /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { className: "text-muted-foreground", children: child.description }) : null
|
|
4720
5182
|
] }) }, child.href)) }) })
|
|
4721
|
-
] }) : /* @__PURE__ */ (0,
|
|
5183
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
|
|
4722
5184
|
NavigationMenuLink,
|
|
4723
5185
|
{
|
|
4724
5186
|
href: item.href,
|
|
@@ -4727,7 +5189,7 @@ function NavigationMenu2({ items = [], className, style }) {
|
|
|
4727
5189
|
item.icon !== void 0 && "gap-2"
|
|
4728
5190
|
),
|
|
4729
5191
|
children: [
|
|
4730
|
-
item.icon ? /* @__PURE__ */ (0,
|
|
5192
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Icon, { name: item.icon, size: "sm" }) : null,
|
|
4731
5193
|
item.label
|
|
4732
5194
|
]
|
|
4733
5195
|
}
|
|
@@ -4735,22 +5197,22 @@ function NavigationMenu2({ items = [], className, style }) {
|
|
|
4735
5197
|
}
|
|
4736
5198
|
|
|
4737
5199
|
// src/components/components/Page/index.tsx
|
|
4738
|
-
var
|
|
5200
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
4739
5201
|
function Page({ title, className, style, children }) {
|
|
4740
|
-
return /* @__PURE__ */ (0,
|
|
4741
|
-
title ? /* @__PURE__ */ (0,
|
|
4742
|
-
/* @__PURE__ */ (0,
|
|
5202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { "data-slot": "page", className: cn("p-6", className), style, children: [
|
|
5203
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("h2", { "data-slot": "page-title", className: "mb-5 text-xl font-semibold", children: title }) : null,
|
|
5204
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { "data-slot": "page-content", className: "space-y-5", children })
|
|
4743
5205
|
] });
|
|
4744
5206
|
}
|
|
4745
5207
|
|
|
4746
5208
|
// src/components/components/Pagination/index.tsx
|
|
4747
|
-
var
|
|
5209
|
+
var import_react18 = require("react");
|
|
4748
5210
|
|
|
4749
|
-
// src/ui/pagination.tsx
|
|
4750
|
-
var
|
|
4751
|
-
var
|
|
5211
|
+
// src/ui/pagination.tsx
|
|
5212
|
+
var import_lucide_react20 = require("lucide-react");
|
|
5213
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
4752
5214
|
function Pagination({ className, ...props }) {
|
|
4753
|
-
return /* @__PURE__ */ (0,
|
|
5215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
4754
5216
|
"nav",
|
|
4755
5217
|
{
|
|
4756
5218
|
role: "navigation",
|
|
@@ -4762,7 +5224,7 @@ function Pagination({ className, ...props }) {
|
|
|
4762
5224
|
);
|
|
4763
5225
|
}
|
|
4764
5226
|
function PaginationContent({ className, ...props }) {
|
|
4765
|
-
return /* @__PURE__ */ (0,
|
|
5227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
4766
5228
|
"ul",
|
|
4767
5229
|
{
|
|
4768
5230
|
"data-slot": "pagination-content",
|
|
@@ -4772,7 +5234,7 @@ function PaginationContent({ className, ...props }) {
|
|
|
4772
5234
|
);
|
|
4773
5235
|
}
|
|
4774
5236
|
function PaginationItem({ ...props }) {
|
|
4775
|
-
return /* @__PURE__ */ (0,
|
|
5237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("li", { "data-slot": "pagination-item", ...props });
|
|
4776
5238
|
}
|
|
4777
5239
|
function PaginationLink({
|
|
4778
5240
|
className,
|
|
@@ -4780,7 +5242,7 @@ function PaginationLink({
|
|
|
4780
5242
|
disabled,
|
|
4781
5243
|
...props
|
|
4782
5244
|
}) {
|
|
4783
|
-
return /* @__PURE__ */ (0,
|
|
5245
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
4784
5246
|
"a",
|
|
4785
5247
|
{
|
|
4786
5248
|
"aria-current": isActive ? "page" : void 0,
|
|
@@ -4792,6 +5254,7 @@ function PaginationLink({
|
|
|
4792
5254
|
buttonVariants({
|
|
4793
5255
|
variant: isActive ? "outline" : "ghost"
|
|
4794
5256
|
}),
|
|
5257
|
+
isActive && "border-(color:--pagination-active-border) bg-(--pagination-active-background) rounded-(--pagination-active-radius)",
|
|
4795
5258
|
disabled && "pointer-events-none opacity-50",
|
|
4796
5259
|
className
|
|
4797
5260
|
),
|
|
@@ -4803,15 +5266,15 @@ function PaginationPrevious({
|
|
|
4803
5266
|
className,
|
|
4804
5267
|
...props
|
|
4805
5268
|
}) {
|
|
4806
|
-
return /* @__PURE__ */ (0,
|
|
5269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
|
|
4807
5270
|
PaginationLink,
|
|
4808
5271
|
{
|
|
4809
5272
|
"aria-label": "Go to previous page",
|
|
4810
5273
|
className: cn("gap-1 px-2.5 sm:pl-2.5", className),
|
|
4811
5274
|
...props,
|
|
4812
5275
|
children: [
|
|
4813
|
-
/* @__PURE__ */ (0,
|
|
4814
|
-
/* @__PURE__ */ (0,
|
|
5276
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_lucide_react20.ChevronLeftIcon, {}),
|
|
5277
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "hidden sm:block", children: "Previous" })
|
|
4815
5278
|
]
|
|
4816
5279
|
}
|
|
4817
5280
|
);
|
|
@@ -4820,21 +5283,21 @@ function PaginationNext({
|
|
|
4820
5283
|
className,
|
|
4821
5284
|
...props
|
|
4822
5285
|
}) {
|
|
4823
|
-
return /* @__PURE__ */ (0,
|
|
5286
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
|
|
4824
5287
|
PaginationLink,
|
|
4825
5288
|
{
|
|
4826
5289
|
"aria-label": "Go to next page",
|
|
4827
5290
|
className: cn("gap-1 px-2.5 sm:pr-2.5", className),
|
|
4828
5291
|
...props,
|
|
4829
5292
|
children: [
|
|
4830
|
-
/* @__PURE__ */ (0,
|
|
4831
|
-
/* @__PURE__ */ (0,
|
|
5293
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "hidden sm:block", children: "Next" }),
|
|
5294
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_lucide_react20.ChevronRightIcon, {})
|
|
4832
5295
|
]
|
|
4833
5296
|
}
|
|
4834
5297
|
);
|
|
4835
5298
|
}
|
|
4836
5299
|
function PaginationEllipsis({ className, ...props }) {
|
|
4837
|
-
return /* @__PURE__ */ (0,
|
|
5300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
|
|
4838
5301
|
"span",
|
|
4839
5302
|
{
|
|
4840
5303
|
"aria-hidden": true,
|
|
@@ -4842,15 +5305,15 @@ function PaginationEllipsis({ className, ...props }) {
|
|
|
4842
5305
|
className: cn("flex size-9 items-center justify-center", className),
|
|
4843
5306
|
...props,
|
|
4844
5307
|
children: [
|
|
4845
|
-
/* @__PURE__ */ (0,
|
|
4846
|
-
/* @__PURE__ */ (0,
|
|
5308
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_lucide_react20.MoreHorizontalIcon, { className: "size-4" }),
|
|
5309
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "sr-only", children: "More pages" })
|
|
4847
5310
|
]
|
|
4848
5311
|
}
|
|
4849
5312
|
);
|
|
4850
5313
|
}
|
|
4851
5314
|
|
|
4852
5315
|
// src/components/components/Pagination/index.tsx
|
|
4853
|
-
var
|
|
5316
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
4854
5317
|
function pageItems(current, count) {
|
|
4855
5318
|
if (count <= 7) {
|
|
4856
5319
|
return Array.from({ length: count }, (_, i) => i + 1);
|
|
@@ -4871,7 +5334,7 @@ function Pagination2({
|
|
|
4871
5334
|
className,
|
|
4872
5335
|
style
|
|
4873
5336
|
}) {
|
|
4874
|
-
const [innerPage, setInnerPage] = (0,
|
|
5337
|
+
const [innerPage, setInnerPage] = (0, import_react18.useState)(1);
|
|
4875
5338
|
const pageCount = Math.max(1, Math.ceil(total / Math.max(1, pageSize)));
|
|
4876
5339
|
const current = Math.min(Math.max(1, page ?? innerPage), pageCount);
|
|
4877
5340
|
const goTo = (next) => {
|
|
@@ -4884,8 +5347,8 @@ function Pagination2({
|
|
|
4884
5347
|
}
|
|
4885
5348
|
onChange?.(target);
|
|
4886
5349
|
};
|
|
4887
|
-
return /* @__PURE__ */ (0,
|
|
4888
|
-
/* @__PURE__ */ (0,
|
|
5350
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Pagination, { className, style, children: /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(PaginationContent, { children: [
|
|
5351
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4889
5352
|
PaginationPrevious,
|
|
4890
5353
|
{
|
|
4891
5354
|
href: "#",
|
|
@@ -4896,7 +5359,7 @@ function Pagination2({
|
|
|
4896
5359
|
}
|
|
4897
5360
|
}
|
|
4898
5361
|
) }),
|
|
4899
|
-
pageItems(current, pageCount).map((item, index) => /* @__PURE__ */ (0,
|
|
5362
|
+
pageItems(current, pageCount).map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(PaginationItem, { children: item === "ellipsis" ? /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(PaginationEllipsis, {}) : /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4900
5363
|
PaginationLink,
|
|
4901
5364
|
{
|
|
4902
5365
|
href: "#",
|
|
@@ -4908,7 +5371,7 @@ function Pagination2({
|
|
|
4908
5371
|
children: item
|
|
4909
5372
|
}
|
|
4910
5373
|
) }, item === "ellipsis" ? `ellipsis-${index}` : item)),
|
|
4911
|
-
/* @__PURE__ */ (0,
|
|
5374
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4912
5375
|
PaginationNext,
|
|
4913
5376
|
{
|
|
4914
5377
|
href: "#",
|
|
@@ -4924,14 +5387,14 @@ function Pagination2({
|
|
|
4924
5387
|
|
|
4925
5388
|
// src/components/components/Popover/index.tsx
|
|
4926
5389
|
var import_runtime14 = require("@pactor-app/runtime");
|
|
4927
|
-
var
|
|
5390
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
4928
5391
|
function isDslNode3(value) {
|
|
4929
5392
|
return typeof value === "object" && value !== null && typeof value.type === "string";
|
|
4930
5393
|
}
|
|
4931
5394
|
function Popover2({ content, children, className, style }) {
|
|
4932
5395
|
const { renderChildren } = (0, import_runtime14.useRenderer)();
|
|
4933
|
-
return /* @__PURE__ */ (0,
|
|
4934
|
-
/* @__PURE__ */ (0,
|
|
5396
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(Popover, { children: [
|
|
5397
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
4935
5398
|
PopoverTrigger,
|
|
4936
5399
|
{
|
|
4937
5400
|
nativeButton: false,
|
|
@@ -4939,15 +5402,15 @@ function Popover2({ content, children, className, style }) {
|
|
|
4939
5402
|
children
|
|
4940
5403
|
}
|
|
4941
5404
|
),
|
|
4942
|
-
/* @__PURE__ */ (0,
|
|
5405
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(PopoverContent, { className, style, children: isDslNode3(content) ? renderChildren([content]) : content })
|
|
4943
5406
|
] });
|
|
4944
5407
|
}
|
|
4945
5408
|
|
|
4946
5409
|
// src/ui/progress.tsx
|
|
4947
5410
|
var import_progress = require("@base-ui/react/progress");
|
|
4948
|
-
var
|
|
5411
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
4949
5412
|
function Progress({ className, ...props }) {
|
|
4950
|
-
return /* @__PURE__ */ (0,
|
|
5413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
4951
5414
|
import_progress.Progress.Root,
|
|
4952
5415
|
{
|
|
4953
5416
|
"data-slot": "progress",
|
|
@@ -4957,11 +5420,11 @@ function Progress({ className, ...props }) {
|
|
|
4957
5420
|
);
|
|
4958
5421
|
}
|
|
4959
5422
|
function ProgressTrack({ className, ...props }) {
|
|
4960
|
-
return /* @__PURE__ */ (0,
|
|
5423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
4961
5424
|
import_progress.Progress.Track,
|
|
4962
5425
|
{
|
|
4963
5426
|
"data-slot": "progress-track",
|
|
4964
|
-
className: cn("h-2 w-full overflow-hidden rounded-full bg-
|
|
5427
|
+
className: cn("h-2 w-full overflow-hidden rounded-full bg-(--progress-track)", className),
|
|
4965
5428
|
...props
|
|
4966
5429
|
}
|
|
4967
5430
|
);
|
|
@@ -4970,12 +5433,12 @@ function ProgressIndicator({
|
|
|
4970
5433
|
className,
|
|
4971
5434
|
...props
|
|
4972
5435
|
}) {
|
|
4973
|
-
return /* @__PURE__ */ (0,
|
|
5436
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
4974
5437
|
import_progress.Progress.Indicator,
|
|
4975
5438
|
{
|
|
4976
5439
|
"data-slot": "progress-indicator",
|
|
4977
5440
|
className: cn(
|
|
4978
|
-
"h-full bg-
|
|
5441
|
+
"h-full bg-(--progress-indicator) transition-[width] duration-300 ease-in-out",
|
|
4979
5442
|
className
|
|
4980
5443
|
),
|
|
4981
5444
|
...props
|
|
@@ -4984,21 +5447,21 @@ function ProgressIndicator({
|
|
|
4984
5447
|
}
|
|
4985
5448
|
|
|
4986
5449
|
// src/components/components/Progress/index.tsx
|
|
4987
|
-
var
|
|
5450
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
4988
5451
|
function Progress2({ value, className, style }) {
|
|
4989
5452
|
const resolved = typeof value === "number" && Number.isFinite(value) ? Math.min(100, Math.max(0, value)) : null;
|
|
4990
|
-
return /* @__PURE__ */ (0,
|
|
5453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Progress, { value: resolved, className, style, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(ProgressTrack, { children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(ProgressIndicator, {}) }) });
|
|
4991
5454
|
}
|
|
4992
5455
|
|
|
4993
5456
|
// src/components/components/RadioGroup/index.tsx
|
|
4994
|
-
var
|
|
5457
|
+
var import_react19 = require("react");
|
|
4995
5458
|
|
|
4996
5459
|
// src/ui/radio-group.tsx
|
|
4997
5460
|
var import_radio = require("@base-ui/react/radio");
|
|
4998
5461
|
var import_radio_group = require("@base-ui/react/radio-group");
|
|
4999
|
-
var
|
|
5462
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
5000
5463
|
function RadioGroup({ className, ...props }) {
|
|
5001
|
-
return /* @__PURE__ */ (0,
|
|
5464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
5002
5465
|
import_radio_group.RadioGroup,
|
|
5003
5466
|
{
|
|
5004
5467
|
"data-slot": "radio-group",
|
|
@@ -5008,21 +5471,21 @@ function RadioGroup({ className, ...props }) {
|
|
|
5008
5471
|
);
|
|
5009
5472
|
}
|
|
5010
5473
|
function RadioGroupItem({ className, ...props }) {
|
|
5011
|
-
return /* @__PURE__ */ (0,
|
|
5474
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
5012
5475
|
import_radio.Radio.Root,
|
|
5013
5476
|
{
|
|
5014
5477
|
"data-slot": "radio-group-item",
|
|
5015
5478
|
className: cn(
|
|
5016
|
-
"aspect-square size-4 shrink-0 cursor-pointer rounded-full border border-
|
|
5479
|
+
"aspect-square size-4 shrink-0 cursor-pointer inline-flex items-center justify-center rounded-full border border-(color:--radio-border) shadow-xs transition-colors outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-checked:border-(color:--radio-checked)",
|
|
5017
5480
|
className
|
|
5018
5481
|
),
|
|
5019
5482
|
...props,
|
|
5020
|
-
children: /* @__PURE__ */ (0,
|
|
5483
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
5021
5484
|
import_radio.Radio.Indicator,
|
|
5022
5485
|
{
|
|
5023
5486
|
"data-slot": "radio-group-indicator",
|
|
5024
5487
|
className: "flex items-center justify-center",
|
|
5025
|
-
children: /* @__PURE__ */ (0,
|
|
5488
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { className: "size-2 rounded-full bg-(--radio-checked)" })
|
|
5026
5489
|
}
|
|
5027
5490
|
)
|
|
5028
5491
|
}
|
|
@@ -5030,7 +5493,7 @@ function RadioGroupItem({ className, ...props }) {
|
|
|
5030
5493
|
}
|
|
5031
5494
|
|
|
5032
5495
|
// src/components/components/Form/form-item.tsx
|
|
5033
|
-
var
|
|
5496
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
5034
5497
|
function FieldShell({
|
|
5035
5498
|
layout,
|
|
5036
5499
|
label,
|
|
@@ -5040,14 +5503,14 @@ function FieldShell({
|
|
|
5040
5503
|
style,
|
|
5041
5504
|
children
|
|
5042
5505
|
}) {
|
|
5043
|
-
return /* @__PURE__ */ (0,
|
|
5506
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(
|
|
5044
5507
|
"div",
|
|
5045
5508
|
{
|
|
5046
5509
|
"data-slot": "form-item",
|
|
5047
5510
|
className: cn(formItemClass(layout), className),
|
|
5048
5511
|
style,
|
|
5049
5512
|
children: [
|
|
5050
|
-
label ? /* @__PURE__ */ (0,
|
|
5513
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
5051
5514
|
"label",
|
|
5052
5515
|
{
|
|
5053
5516
|
htmlFor,
|
|
@@ -5056,14 +5519,14 @@ function FieldShell({
|
|
|
5056
5519
|
}
|
|
5057
5520
|
) : null,
|
|
5058
5521
|
children,
|
|
5059
|
-
error ? /* @__PURE__ */ (0,
|
|
5522
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { "data-slot": "form-error", className: "text-sm text-destructive", children: error }) : null
|
|
5060
5523
|
]
|
|
5061
5524
|
}
|
|
5062
5525
|
);
|
|
5063
5526
|
}
|
|
5064
5527
|
|
|
5065
5528
|
// src/components/components/RadioGroup/index.tsx
|
|
5066
|
-
var
|
|
5529
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
5067
5530
|
function RadioGroup2({
|
|
5068
5531
|
name,
|
|
5069
5532
|
label,
|
|
@@ -5076,9 +5539,9 @@ function RadioGroup2({
|
|
|
5076
5539
|
style
|
|
5077
5540
|
}) {
|
|
5078
5541
|
const form = useFormContext();
|
|
5079
|
-
const controlId = (0,
|
|
5542
|
+
const controlId = (0, import_react19.useId)();
|
|
5080
5543
|
const inForm = form?.inForm === true && typeof name === "string" && name !== "";
|
|
5081
|
-
(0,
|
|
5544
|
+
(0, import_react19.useEffect)(() => {
|
|
5082
5545
|
if (inForm && form && name) {
|
|
5083
5546
|
form.registerField(name, rules, value);
|
|
5084
5547
|
return () => form.unregisterField(name);
|
|
@@ -5093,7 +5556,7 @@ function RadioGroup2({
|
|
|
5093
5556
|
onChange?.(next);
|
|
5094
5557
|
};
|
|
5095
5558
|
const groupValue = current ?? "";
|
|
5096
|
-
const group = /* @__PURE__ */ (0,
|
|
5559
|
+
const group = /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
5097
5560
|
RadioGroup,
|
|
5098
5561
|
{
|
|
5099
5562
|
value: groupValue,
|
|
@@ -5104,8 +5567,8 @@ function RadioGroup2({
|
|
|
5104
5567
|
style: inForm ? void 0 : style,
|
|
5105
5568
|
children: options.map((option, index) => {
|
|
5106
5569
|
const optionId = `${controlId}-${index}`;
|
|
5107
|
-
return /* @__PURE__ */ (0,
|
|
5108
|
-
/* @__PURE__ */ (0,
|
|
5570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("span", { className: "inline-flex items-center gap-2", children: [
|
|
5571
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
5109
5572
|
RadioGroupItem,
|
|
5110
5573
|
{
|
|
5111
5574
|
id: optionId,
|
|
@@ -5113,13 +5576,13 @@ function RadioGroup2({
|
|
|
5113
5576
|
disabled: option.disabled
|
|
5114
5577
|
}
|
|
5115
5578
|
),
|
|
5116
|
-
/* @__PURE__ */ (0,
|
|
5579
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("label", { htmlFor: optionId, className: "text-sm leading-none font-medium", children: option.label })
|
|
5117
5580
|
] }, String(option.value));
|
|
5118
5581
|
})
|
|
5119
5582
|
}
|
|
5120
5583
|
);
|
|
5121
5584
|
if (inForm && form && name) {
|
|
5122
|
-
return /* @__PURE__ */ (0,
|
|
5585
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
5123
5586
|
FieldShell,
|
|
5124
5587
|
{
|
|
5125
5588
|
layout: form.layout,
|
|
@@ -5136,17 +5599,17 @@ function RadioGroup2({
|
|
|
5136
5599
|
|
|
5137
5600
|
// src/components/components/Resizable/index.tsx
|
|
5138
5601
|
var import_runtime15 = require("@pactor-app/runtime");
|
|
5139
|
-
var
|
|
5602
|
+
var import_react20 = require("react");
|
|
5140
5603
|
|
|
5141
5604
|
// src/ui/resizable.tsx
|
|
5142
|
-
var
|
|
5605
|
+
var import_lucide_react21 = require("lucide-react");
|
|
5143
5606
|
var import_react_resizable_panels = require("react-resizable-panels");
|
|
5144
|
-
var
|
|
5607
|
+
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
5145
5608
|
function PanelGroup({
|
|
5146
5609
|
className,
|
|
5147
5610
|
...props
|
|
5148
5611
|
}) {
|
|
5149
|
-
return /* @__PURE__ */ (0,
|
|
5612
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
5150
5613
|
import_react_resizable_panels.Group,
|
|
5151
5614
|
{
|
|
5152
5615
|
"data-slot": "resizable-panel-group",
|
|
@@ -5159,14 +5622,14 @@ function PanelGroup({
|
|
|
5159
5622
|
);
|
|
5160
5623
|
}
|
|
5161
5624
|
function Panel({ ...props }) {
|
|
5162
|
-
return /* @__PURE__ */ (0,
|
|
5625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_react_resizable_panels.Panel, { "data-slot": "resizable-panel", ...props });
|
|
5163
5626
|
}
|
|
5164
5627
|
function ResizableHandle({
|
|
5165
5628
|
withHandle,
|
|
5166
5629
|
className,
|
|
5167
5630
|
...props
|
|
5168
5631
|
}) {
|
|
5169
|
-
return /* @__PURE__ */ (0,
|
|
5632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
5170
5633
|
import_react_resizable_panels.Separator,
|
|
5171
5634
|
{
|
|
5172
5635
|
"data-slot": "resizable-handle",
|
|
@@ -5175,13 +5638,13 @@ function ResizableHandle({
|
|
|
5175
5638
|
className
|
|
5176
5639
|
),
|
|
5177
5640
|
...props,
|
|
5178
|
-
children: withHandle ? /* @__PURE__ */ (0,
|
|
5641
|
+
children: withHandle ? /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "z-10 flex h-4 w-3 items-center justify-center rounded-xs border border-border bg-border", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_lucide_react21.GripVerticalIcon, { className: "size-2.5" }) }) : null
|
|
5179
5642
|
}
|
|
5180
5643
|
);
|
|
5181
5644
|
}
|
|
5182
5645
|
|
|
5183
5646
|
// src/components/components/Resizable/index.tsx
|
|
5184
|
-
var
|
|
5647
|
+
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
5185
5648
|
function Resizable({
|
|
5186
5649
|
panels = [],
|
|
5187
5650
|
direction = "horizontal",
|
|
@@ -5189,12 +5652,14 @@ function Resizable({
|
|
|
5189
5652
|
style
|
|
5190
5653
|
}) {
|
|
5191
5654
|
const { renderChildren } = (0, import_runtime15.useRenderer)();
|
|
5192
|
-
return /* @__PURE__ */ (0,
|
|
5193
|
-
index > 0 ? /* @__PURE__ */ (0,
|
|
5194
|
-
/* @__PURE__ */ (0,
|
|
5655
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(PanelGroup, { orientation: direction, className, style, children: panels.map((panel, index) => /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(import_react20.Fragment, { children: [
|
|
5656
|
+
index > 0 ? /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(ResizableHandle, { withHandle: true }) : null,
|
|
5657
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
5195
5658
|
Panel,
|
|
5196
5659
|
{
|
|
5197
|
-
defaultSize: typeof panel.defaultSize === "number" ? `${panel.defaultSize}%` : void 0,
|
|
5660
|
+
defaultSize: typeof panel.defaultSizePx === "number" ? `${panel.defaultSizePx}px` : typeof panel.defaultSize === "number" ? `${panel.defaultSize}%` : void 0,
|
|
5661
|
+
minSize: typeof panel.minSizePx === "number" ? `${panel.minSizePx}px` : void 0,
|
|
5662
|
+
maxSize: typeof panel.maxSizePx === "number" ? `${panel.maxSizePx}px` : void 0,
|
|
5198
5663
|
children: renderChildren(panel.children)
|
|
5199
5664
|
}
|
|
5200
5665
|
)
|
|
@@ -5203,20 +5668,20 @@ function Resizable({
|
|
|
5203
5668
|
|
|
5204
5669
|
// src/ui/scroll-area.tsx
|
|
5205
5670
|
var import_scroll_area = require("@base-ui/react/scroll-area");
|
|
5206
|
-
var
|
|
5671
|
+
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
5207
5672
|
function ScrollArea({
|
|
5208
5673
|
className,
|
|
5209
5674
|
children,
|
|
5210
5675
|
...props
|
|
5211
5676
|
}) {
|
|
5212
|
-
return /* @__PURE__ */ (0,
|
|
5677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(
|
|
5213
5678
|
import_scroll_area.ScrollArea.Root,
|
|
5214
5679
|
{
|
|
5215
5680
|
"data-slot": "scroll-area",
|
|
5216
5681
|
className: cn("relative overflow-hidden", className),
|
|
5217
5682
|
...props,
|
|
5218
5683
|
children: [
|
|
5219
|
-
/* @__PURE__ */ (0,
|
|
5684
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
5220
5685
|
import_scroll_area.ScrollArea.Viewport,
|
|
5221
5686
|
{
|
|
5222
5687
|
"data-slot": "scroll-area-viewport",
|
|
@@ -5224,8 +5689,8 @@ function ScrollArea({
|
|
|
5224
5689
|
children
|
|
5225
5690
|
}
|
|
5226
5691
|
),
|
|
5227
|
-
/* @__PURE__ */ (0,
|
|
5228
|
-
/* @__PURE__ */ (0,
|
|
5692
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)(ScrollBar, {}),
|
|
5693
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_scroll_area.ScrollArea.Corner, {})
|
|
5229
5694
|
]
|
|
5230
5695
|
}
|
|
5231
5696
|
);
|
|
@@ -5235,7 +5700,7 @@ function ScrollBar({
|
|
|
5235
5700
|
orientation = "vertical",
|
|
5236
5701
|
...props
|
|
5237
5702
|
}) {
|
|
5238
|
-
return /* @__PURE__ */ (0,
|
|
5703
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
5239
5704
|
import_scroll_area.ScrollArea.Scrollbar,
|
|
5240
5705
|
{
|
|
5241
5706
|
"data-slot": "scroll-area-scrollbar",
|
|
@@ -5247,7 +5712,7 @@ function ScrollBar({
|
|
|
5247
5712
|
className
|
|
5248
5713
|
),
|
|
5249
5714
|
...props,
|
|
5250
|
-
children: /* @__PURE__ */ (0,
|
|
5715
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
5251
5716
|
import_scroll_area.ScrollArea.Thumb,
|
|
5252
5717
|
{
|
|
5253
5718
|
"data-slot": "scroll-area-thumb",
|
|
@@ -5259,7 +5724,7 @@ function ScrollBar({
|
|
|
5259
5724
|
}
|
|
5260
5725
|
|
|
5261
5726
|
// src/components/components/ScrollArea/index.tsx
|
|
5262
|
-
var
|
|
5727
|
+
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
5263
5728
|
function ScrollArea2({
|
|
5264
5729
|
maxHeight,
|
|
5265
5730
|
maxWidth,
|
|
@@ -5267,7 +5732,7 @@ function ScrollArea2({
|
|
|
5267
5732
|
style,
|
|
5268
5733
|
children
|
|
5269
5734
|
}) {
|
|
5270
|
-
return /* @__PURE__ */ (0,
|
|
5735
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
5271
5736
|
ScrollArea,
|
|
5272
5737
|
{
|
|
5273
5738
|
className,
|
|
@@ -5279,17 +5744,17 @@ function ScrollArea2({
|
|
|
5279
5744
|
|
|
5280
5745
|
// src/components/components/Select/index.tsx
|
|
5281
5746
|
var import_runtime16 = require("@pactor-app/runtime");
|
|
5282
|
-
var
|
|
5747
|
+
var import_react21 = require("react");
|
|
5283
5748
|
|
|
5284
5749
|
// src/ui/select.tsx
|
|
5285
5750
|
var import_select = require("@base-ui/react/select");
|
|
5286
|
-
var
|
|
5287
|
-
var
|
|
5751
|
+
var import_lucide_react22 = require("lucide-react");
|
|
5752
|
+
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
5288
5753
|
var Select = import_select.Select.Root;
|
|
5289
5754
|
function SelectValue({
|
|
5290
5755
|
...props
|
|
5291
5756
|
}) {
|
|
5292
|
-
return /* @__PURE__ */ (0,
|
|
5757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_select.Select.Value, { "data-slot": "select-value", ...props });
|
|
5293
5758
|
}
|
|
5294
5759
|
function SelectTrigger({
|
|
5295
5760
|
className,
|
|
@@ -5297,7 +5762,7 @@ function SelectTrigger({
|
|
|
5297
5762
|
children,
|
|
5298
5763
|
...props
|
|
5299
5764
|
}) {
|
|
5300
|
-
return /* @__PURE__ */ (0,
|
|
5765
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(
|
|
5301
5766
|
import_select.Select.Trigger,
|
|
5302
5767
|
{
|
|
5303
5768
|
"data-slot": "select-trigger",
|
|
@@ -5309,10 +5774,10 @@ function SelectTrigger({
|
|
|
5309
5774
|
...props,
|
|
5310
5775
|
children: [
|
|
5311
5776
|
children,
|
|
5312
|
-
/* @__PURE__ */ (0,
|
|
5777
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
5313
5778
|
import_select.Select.Icon,
|
|
5314
5779
|
{
|
|
5315
|
-
render: /* @__PURE__ */ (0,
|
|
5780
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_lucide_react22.ChevronDownIcon, { className: "size-4 opacity-50" })
|
|
5316
5781
|
}
|
|
5317
5782
|
)
|
|
5318
5783
|
]
|
|
@@ -5328,7 +5793,7 @@ function SelectContent({
|
|
|
5328
5793
|
alignItemWithTrigger = false,
|
|
5329
5794
|
...props
|
|
5330
5795
|
}) {
|
|
5331
|
-
return /* @__PURE__ */ (0,
|
|
5796
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_select.Select.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
5332
5797
|
import_select.Select.Positioner,
|
|
5333
5798
|
{
|
|
5334
5799
|
side,
|
|
@@ -5336,19 +5801,19 @@ function SelectContent({
|
|
|
5336
5801
|
align,
|
|
5337
5802
|
alignItemWithTrigger,
|
|
5338
5803
|
className: "isolate z-50",
|
|
5339
|
-
children: /* @__PURE__ */ (0,
|
|
5804
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(
|
|
5340
5805
|
import_select.Select.Popup,
|
|
5341
5806
|
{
|
|
5342
5807
|
"data-slot": "select-content",
|
|
5343
5808
|
className: cn(
|
|
5344
|
-
"relative z-50 max-h-96 min-w-[8rem] overflow-x-hidden overflow-y-auto rounded-md border border-border bg-popover text-popover-foreground shadow-md duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
5809
|
+
"relative z-50 max-h-96 min-w-[8rem] overflow-x-hidden overflow-y-auto rounded-md border border-border bg-popover text-popover-foreground shadow-md shadow-(color:--shadow-color) duration-200 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
5345
5810
|
className
|
|
5346
5811
|
),
|
|
5347
5812
|
...props,
|
|
5348
5813
|
children: [
|
|
5349
|
-
/* @__PURE__ */ (0,
|
|
5350
|
-
/* @__PURE__ */ (0,
|
|
5351
|
-
/* @__PURE__ */ (0,
|
|
5814
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(SelectScrollUpButton, {}),
|
|
5815
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_select.Select.List, { className: "p-1", children }),
|
|
5816
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(SelectScrollDownButton, {})
|
|
5352
5817
|
]
|
|
5353
5818
|
}
|
|
5354
5819
|
)
|
|
@@ -5360,18 +5825,18 @@ function SelectItem({
|
|
|
5360
5825
|
children,
|
|
5361
5826
|
...props
|
|
5362
5827
|
}) {
|
|
5363
|
-
return /* @__PURE__ */ (0,
|
|
5828
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(
|
|
5364
5829
|
import_select.Select.Item,
|
|
5365
5830
|
{
|
|
5366
5831
|
"data-slot": "select-item",
|
|
5367
5832
|
className: cn(
|
|
5368
|
-
"relative flex w-full cursor-pointer items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-none select-none focus:bg-
|
|
5833
|
+
"relative flex w-full cursor-pointer items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-none select-none focus:bg-(--menu-hover-background) focus:text-(--menu-hover-foreground) data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
5369
5834
|
className
|
|
5370
5835
|
),
|
|
5371
5836
|
...props,
|
|
5372
5837
|
children: [
|
|
5373
|
-
/* @__PURE__ */ (0,
|
|
5374
|
-
/* @__PURE__ */ (0,
|
|
5838
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_select.Select.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_lucide_react22.CheckIcon, { className: "size-4" }) }) }),
|
|
5839
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_select.Select.ItemText, { children })
|
|
5375
5840
|
]
|
|
5376
5841
|
}
|
|
5377
5842
|
);
|
|
@@ -5380,7 +5845,7 @@ function SelectScrollUpButton({
|
|
|
5380
5845
|
className,
|
|
5381
5846
|
...props
|
|
5382
5847
|
}) {
|
|
5383
|
-
return /* @__PURE__ */ (0,
|
|
5848
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
5384
5849
|
import_select.Select.ScrollUpArrow,
|
|
5385
5850
|
{
|
|
5386
5851
|
"data-slot": "select-scroll-up-button",
|
|
@@ -5389,7 +5854,7 @@ function SelectScrollUpButton({
|
|
|
5389
5854
|
className
|
|
5390
5855
|
),
|
|
5391
5856
|
...props,
|
|
5392
|
-
children: /* @__PURE__ */ (0,
|
|
5857
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_lucide_react22.ChevronUpIcon, { className: "size-4" })
|
|
5393
5858
|
}
|
|
5394
5859
|
);
|
|
5395
5860
|
}
|
|
@@ -5397,267 +5862,135 @@ function SelectScrollDownButton({
|
|
|
5397
5862
|
className,
|
|
5398
5863
|
...props
|
|
5399
5864
|
}) {
|
|
5400
|
-
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
5401
|
-
import_select.Select.ScrollDownArrow,
|
|
5402
|
-
{
|
|
5403
|
-
"data-slot": "select-scroll-down-button",
|
|
5404
|
-
className: cn(
|
|
5405
|
-
"flex cursor-default items-center justify-center py-1",
|
|
5406
|
-
className
|
|
5407
|
-
),
|
|
5408
|
-
...props,
|
|
5409
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_lucide_react21.ChevronDownIcon, { className: "size-4" })
|
|
5410
|
-
}
|
|
5411
|
-
);
|
|
5412
|
-
}
|
|
5413
|
-
|
|
5414
|
-
// src/components/components/Select/index.tsx
|
|
5415
|
-
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
5416
|
-
function Select2({
|
|
5417
|
-
name,
|
|
5418
|
-
label,
|
|
5419
|
-
rules,
|
|
5420
|
-
options = [],
|
|
5421
|
-
value,
|
|
5422
|
-
placeholder,
|
|
5423
|
-
disabled,
|
|
5424
|
-
allowClear,
|
|
5425
|
-
onChange,
|
|
5426
|
-
className,
|
|
5427
|
-
style
|
|
5428
|
-
}) {
|
|
5429
|
-
const form = useFormContext();
|
|
5430
|
-
const { t } = (0, import_runtime16.useI18n)();
|
|
5431
|
-
const controlId = (0, import_react20.useId)();
|
|
5432
|
-
const inForm = form?.inForm === true && typeof name === "string" && name !== "";
|
|
5433
|
-
(0, import_react20.useEffect)(() => {
|
|
5434
|
-
if (inForm && form && name) {
|
|
5435
|
-
form.registerField(name, rules, value);
|
|
5436
|
-
return () => form.unregisterField(name);
|
|
5437
|
-
}
|
|
5438
|
-
return void 0;
|
|
5439
|
-
});
|
|
5440
|
-
const current = inForm && form && name ? form.values[name] : value;
|
|
5441
|
-
const selectedValue = current === void 0 || current === null || current === "" ? null : current;
|
|
5442
|
-
const handleChange = (next) => {
|
|
5443
|
-
if (inForm && form && name) {
|
|
5444
|
-
form.setValue(name, next ?? void 0);
|
|
5445
|
-
}
|
|
5446
|
-
onChange?.(next ?? void 0);
|
|
5447
|
-
};
|
|
5448
|
-
const inFormRoot = inForm === true;
|
|
5449
|
-
const select = /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(
|
|
5450
|
-
"span",
|
|
5451
|
-
{
|
|
5452
|
-
className: cn("inline-flex items-center gap-1", !inFormRoot && className),
|
|
5453
|
-
style: inFormRoot ? void 0 : style,
|
|
5454
|
-
children: [
|
|
5455
|
-
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(
|
|
5456
|
-
Select,
|
|
5457
|
-
{
|
|
5458
|
-
items: options,
|
|
5459
|
-
value: selectedValue,
|
|
5460
|
-
onValueChange: handleChange,
|
|
5461
|
-
disabled,
|
|
5462
|
-
name: inForm ? name : void 0,
|
|
5463
|
-
children: [
|
|
5464
|
-
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(SelectTrigger, { id: controlId, children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(SelectValue, { placeholder }) }),
|
|
5465
|
-
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(SelectContent, { children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
5466
|
-
SelectItem,
|
|
5467
|
-
{
|
|
5468
|
-
value: option.value,
|
|
5469
|
-
disabled: option.disabled,
|
|
5470
|
-
children: option.label
|
|
5471
|
-
},
|
|
5472
|
-
String(option.value)
|
|
5473
|
-
)) })
|
|
5474
|
-
]
|
|
5475
|
-
}
|
|
5476
|
-
),
|
|
5477
|
-
allowClear && selectedValue !== null && !disabled ? /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
5478
|
-
"button",
|
|
5479
|
-
{
|
|
5480
|
-
type: "button",
|
|
5481
|
-
"aria-label": t("pactor.select.clear"),
|
|
5482
|
-
className: "cursor-pointer text-muted-foreground hover:text-foreground",
|
|
5483
|
-
onClick: () => {
|
|
5484
|
-
if (inForm && form && name) {
|
|
5485
|
-
form.setValue(name, void 0);
|
|
5486
|
-
}
|
|
5487
|
-
onChange?.(void 0);
|
|
5488
|
-
},
|
|
5489
|
-
children: "\xD7"
|
|
5490
|
-
}
|
|
5491
|
-
) : null
|
|
5492
|
-
]
|
|
5493
|
-
}
|
|
5494
|
-
);
|
|
5495
|
-
if (inForm && form && name) {
|
|
5496
|
-
const error = form.errors[name];
|
|
5497
|
-
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(
|
|
5498
|
-
"div",
|
|
5499
|
-
{
|
|
5500
|
-
"data-slot": "form-item",
|
|
5501
|
-
className: cn(formItemClass(form.layout), className),
|
|
5502
|
-
style,
|
|
5503
|
-
children: [
|
|
5504
|
-
label ? /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
5505
|
-
"label",
|
|
5506
|
-
{
|
|
5507
|
-
htmlFor: controlId,
|
|
5508
|
-
className: "shrink-0 text-sm leading-none font-medium whitespace-nowrap",
|
|
5509
|
-
children: label
|
|
5510
|
-
}
|
|
5511
|
-
) : null,
|
|
5512
|
-
select,
|
|
5513
|
-
error ? /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { "data-slot": "form-error", className: "text-sm text-destructive", children: error }) : null
|
|
5514
|
-
]
|
|
5515
|
-
}
|
|
5516
|
-
);
|
|
5517
|
-
}
|
|
5518
|
-
return select;
|
|
5519
|
-
}
|
|
5520
|
-
|
|
5521
|
-
// src/ui/separator.tsx
|
|
5522
|
-
var import_separator = require("@base-ui/react/separator");
|
|
5523
|
-
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
5524
|
-
function Separator({
|
|
5525
|
-
className,
|
|
5526
|
-
orientation = "horizontal",
|
|
5527
|
-
decorative: _decorative,
|
|
5528
|
-
...props
|
|
5529
|
-
}) {
|
|
5530
|
-
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
5531
|
-
import_separator.Separator,
|
|
5532
|
-
{
|
|
5533
|
-
"data-slot": "separator",
|
|
5534
|
-
orientation,
|
|
5535
|
-
className: cn(
|
|
5536
|
-
"shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
5537
|
-
className
|
|
5538
|
-
),
|
|
5539
|
-
...props
|
|
5540
|
-
}
|
|
5541
|
-
);
|
|
5542
|
-
}
|
|
5543
|
-
|
|
5544
|
-
// src/components/components/Separator/index.tsx
|
|
5545
|
-
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
5546
|
-
function Separator2({ orientation = "horizontal", className, style }) {
|
|
5547
|
-
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Separator, { orientation, className, style });
|
|
5548
|
-
}
|
|
5549
|
-
|
|
5550
|
-
// src/ui/sheet.tsx
|
|
5551
|
-
var import_dialog3 = require("@base-ui/react/dialog");
|
|
5552
|
-
var import_lucide_react22 = require("lucide-react");
|
|
5553
|
-
var import_class_variance_authority5 = require("class-variance-authority");
|
|
5554
|
-
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
5555
|
-
function Sheet({
|
|
5556
|
-
...props
|
|
5557
|
-
}) {
|
|
5558
|
-
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_dialog3.Dialog.Root, { "data-slot": "sheet", ...props });
|
|
5559
|
-
}
|
|
5560
|
-
function SheetPortal({
|
|
5561
|
-
...props
|
|
5562
|
-
}) {
|
|
5563
|
-
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_dialog3.Dialog.Portal, { "data-slot": "sheet-portal", ...props });
|
|
5564
|
-
}
|
|
5565
|
-
function SheetOverlay({
|
|
5566
|
-
className,
|
|
5567
|
-
...props
|
|
5568
|
-
}) {
|
|
5569
|
-
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
5570
|
-
import_dialog3.Dialog.Backdrop,
|
|
5571
|
-
{
|
|
5572
|
-
"data-slot": "sheet-overlay",
|
|
5573
|
-
className: cn(
|
|
5574
|
-
"fixed inset-0 z-50 bg-black/50 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
|
|
5575
|
-
className
|
|
5576
|
-
),
|
|
5577
|
-
...props
|
|
5578
|
-
}
|
|
5579
|
-
);
|
|
5580
|
-
}
|
|
5581
|
-
var sheetVariants = (0, import_class_variance_authority5.cva)(
|
|
5582
|
-
"fixed z-50 flex flex-col gap-4 border-border bg-background shadow-lg transition ease-in-out data-open:animate-in data-open:duration-300 data-closed:animate-out data-closed:duration-200",
|
|
5583
|
-
{
|
|
5584
|
-
variants: {
|
|
5585
|
-
side: {
|
|
5586
|
-
right: "inset-y-0 right-0 h-full w-3/4 border-l data-open:slide-in-from-right data-closed:slide-out-to-right sm:max-w-sm",
|
|
5587
|
-
left: "inset-y-0 left-0 h-full w-3/4 border-r data-open:slide-in-from-left data-closed:slide-out-to-left sm:max-w-sm",
|
|
5588
|
-
top: "inset-x-0 top-0 border-b data-open:slide-in-from-top data-closed:slide-out-to-top",
|
|
5589
|
-
bottom: "inset-x-0 bottom-0 border-t data-open:slide-in-from-bottom data-closed:slide-out-to-bottom"
|
|
5590
|
-
}
|
|
5591
|
-
},
|
|
5592
|
-
defaultVariants: {
|
|
5593
|
-
side: "right"
|
|
5594
|
-
}
|
|
5595
|
-
}
|
|
5596
|
-
);
|
|
5597
|
-
function SheetContent({
|
|
5598
|
-
className,
|
|
5599
|
-
children,
|
|
5600
|
-
side = "right",
|
|
5601
|
-
...props
|
|
5602
|
-
}) {
|
|
5603
|
-
return /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(SheetPortal, { "data-slot": "sheet-portal", children: [
|
|
5604
|
-
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(SheetOverlay, {}),
|
|
5605
|
-
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(
|
|
5606
|
-
import_dialog3.Dialog.Popup,
|
|
5607
|
-
{
|
|
5608
|
-
"data-slot": "sheet-content",
|
|
5609
|
-
className: cn(sheetVariants({ side }), className),
|
|
5610
|
-
...props,
|
|
5611
|
-
children: [
|
|
5612
|
-
children,
|
|
5613
|
-
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(
|
|
5614
|
-
import_dialog3.Dialog.Close,
|
|
5615
|
-
{
|
|
5616
|
-
"data-slot": "sheet-close",
|
|
5617
|
-
render: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
5618
|
-
"button",
|
|
5619
|
-
{
|
|
5620
|
-
type: "button",
|
|
5621
|
-
className: "absolute top-4 right-4 cursor-pointer rounded-xs opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
|
|
5622
|
-
}
|
|
5623
|
-
),
|
|
5624
|
-
children: [
|
|
5625
|
-
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_lucide_react22.XIcon, {}),
|
|
5626
|
-
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("span", { className: "sr-only", children: "Close" })
|
|
5627
|
-
]
|
|
5628
|
-
}
|
|
5629
|
-
)
|
|
5630
|
-
]
|
|
5631
|
-
}
|
|
5632
|
-
)
|
|
5633
|
-
] });
|
|
5634
|
-
}
|
|
5635
|
-
function SheetHeader({ className, ...props }) {
|
|
5636
5865
|
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
5637
|
-
|
|
5866
|
+
import_select.Select.ScrollDownArrow,
|
|
5638
5867
|
{
|
|
5639
|
-
"data-slot": "
|
|
5640
|
-
className: cn(
|
|
5641
|
-
|
|
5868
|
+
"data-slot": "select-scroll-down-button",
|
|
5869
|
+
className: cn(
|
|
5870
|
+
"flex cursor-default items-center justify-center py-1",
|
|
5871
|
+
className
|
|
5872
|
+
),
|
|
5873
|
+
...props,
|
|
5874
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_lucide_react22.ChevronDownIcon, { className: "size-4" })
|
|
5642
5875
|
}
|
|
5643
5876
|
);
|
|
5644
5877
|
}
|
|
5645
|
-
|
|
5878
|
+
|
|
5879
|
+
// src/components/components/Select/index.tsx
|
|
5880
|
+
var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
5881
|
+
function Select2({
|
|
5882
|
+
name,
|
|
5883
|
+
label,
|
|
5884
|
+
rules,
|
|
5885
|
+
options = [],
|
|
5886
|
+
value,
|
|
5887
|
+
placeholder,
|
|
5888
|
+
disabled,
|
|
5889
|
+
allowClear,
|
|
5890
|
+
onChange,
|
|
5646
5891
|
className,
|
|
5647
|
-
|
|
5892
|
+
style
|
|
5648
5893
|
}) {
|
|
5649
|
-
|
|
5650
|
-
|
|
5894
|
+
const form = useFormContext();
|
|
5895
|
+
const { t } = (0, import_runtime16.useI18n)();
|
|
5896
|
+
const controlId = (0, import_react21.useId)();
|
|
5897
|
+
const inForm = form?.inForm === true && typeof name === "string" && name !== "";
|
|
5898
|
+
(0, import_react21.useEffect)(() => {
|
|
5899
|
+
if (inForm && form && name) {
|
|
5900
|
+
form.registerField(name, rules, value);
|
|
5901
|
+
return () => form.unregisterField(name);
|
|
5902
|
+
}
|
|
5903
|
+
return void 0;
|
|
5904
|
+
});
|
|
5905
|
+
const current = inForm && form && name ? form.values[name] : value;
|
|
5906
|
+
const selectedValue = current === void 0 || current === null || current === "" ? null : current;
|
|
5907
|
+
const handleChange = (next) => {
|
|
5908
|
+
if (inForm && form && name) {
|
|
5909
|
+
form.setValue(name, next ?? void 0);
|
|
5910
|
+
}
|
|
5911
|
+
onChange?.(next ?? void 0);
|
|
5912
|
+
};
|
|
5913
|
+
const inFormRoot = inForm === true;
|
|
5914
|
+
const select = /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(
|
|
5915
|
+
"span",
|
|
5651
5916
|
{
|
|
5652
|
-
|
|
5653
|
-
|
|
5654
|
-
|
|
5917
|
+
className: cn("inline-flex items-center gap-1", !inFormRoot && className),
|
|
5918
|
+
style: inFormRoot ? void 0 : style,
|
|
5919
|
+
children: [
|
|
5920
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(
|
|
5921
|
+
Select,
|
|
5922
|
+
{
|
|
5923
|
+
items: options,
|
|
5924
|
+
value: selectedValue,
|
|
5925
|
+
onValueChange: handleChange,
|
|
5926
|
+
disabled,
|
|
5927
|
+
name: inForm ? name : void 0,
|
|
5928
|
+
children: [
|
|
5929
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(SelectTrigger, { id: controlId, children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(SelectValue, { placeholder }) }),
|
|
5930
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(SelectContent, { children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
5931
|
+
SelectItem,
|
|
5932
|
+
{
|
|
5933
|
+
value: option.value,
|
|
5934
|
+
disabled: option.disabled,
|
|
5935
|
+
children: option.label
|
|
5936
|
+
},
|
|
5937
|
+
String(option.value)
|
|
5938
|
+
)) })
|
|
5939
|
+
]
|
|
5940
|
+
}
|
|
5941
|
+
),
|
|
5942
|
+
allowClear && selectedValue !== null && !disabled ? /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
5943
|
+
"button",
|
|
5944
|
+
{
|
|
5945
|
+
type: "button",
|
|
5946
|
+
"aria-label": t("pactor.select.clear"),
|
|
5947
|
+
className: "cursor-pointer text-muted-foreground hover:text-foreground",
|
|
5948
|
+
onClick: () => {
|
|
5949
|
+
if (inForm && form && name) {
|
|
5950
|
+
form.setValue(name, void 0);
|
|
5951
|
+
}
|
|
5952
|
+
onChange?.(void 0);
|
|
5953
|
+
},
|
|
5954
|
+
children: "\xD7"
|
|
5955
|
+
}
|
|
5956
|
+
) : null
|
|
5957
|
+
]
|
|
5655
5958
|
}
|
|
5656
5959
|
);
|
|
5960
|
+
if (inForm && form && name) {
|
|
5961
|
+
const error = form.errors[name];
|
|
5962
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(
|
|
5963
|
+
"div",
|
|
5964
|
+
{
|
|
5965
|
+
"data-slot": "form-item",
|
|
5966
|
+
className: cn(formItemClass(form.layout), className),
|
|
5967
|
+
style,
|
|
5968
|
+
children: [
|
|
5969
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
5970
|
+
"label",
|
|
5971
|
+
{
|
|
5972
|
+
htmlFor: controlId,
|
|
5973
|
+
className: "shrink-0 text-sm leading-none font-medium whitespace-nowrap",
|
|
5974
|
+
children: label
|
|
5975
|
+
}
|
|
5976
|
+
) : null,
|
|
5977
|
+
select,
|
|
5978
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { "data-slot": "form-error", className: "text-sm text-destructive", children: error }) : null
|
|
5979
|
+
]
|
|
5980
|
+
}
|
|
5981
|
+
);
|
|
5982
|
+
}
|
|
5983
|
+
return select;
|
|
5984
|
+
}
|
|
5985
|
+
|
|
5986
|
+
// src/components/components/Separator/index.tsx
|
|
5987
|
+
var import_jsx_runtime103 = require("react/jsx-runtime");
|
|
5988
|
+
function Separator2({ orientation = "horizontal", className, style }) {
|
|
5989
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Separator, { orientation, className, style });
|
|
5657
5990
|
}
|
|
5658
5991
|
|
|
5659
5992
|
// src/components/components/Sheet/index.tsx
|
|
5660
|
-
var
|
|
5993
|
+
var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
5661
5994
|
function Sheet2({
|
|
5662
5995
|
title,
|
|
5663
5996
|
open,
|
|
@@ -5667,7 +6000,7 @@ function Sheet2({
|
|
|
5667
6000
|
className,
|
|
5668
6001
|
style
|
|
5669
6002
|
}) {
|
|
5670
|
-
return /* @__PURE__ */ (0,
|
|
6003
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
5671
6004
|
Sheet,
|
|
5672
6005
|
{
|
|
5673
6006
|
open: open ?? false,
|
|
@@ -5676,9 +6009,9 @@ function Sheet2({
|
|
|
5676
6009
|
onClose?.();
|
|
5677
6010
|
}
|
|
5678
6011
|
},
|
|
5679
|
-
children: /* @__PURE__ */ (0,
|
|
5680
|
-
title ? /* @__PURE__ */ (0,
|
|
5681
|
-
/* @__PURE__ */ (0,
|
|
6012
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(SheetContent, { side, className, style, children: [
|
|
6013
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(SheetHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(SheetTitle, { children: title }) }) : null,
|
|
6014
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: "flex-1 overflow-auto px-4", children })
|
|
5682
6015
|
] })
|
|
5683
6016
|
}
|
|
5684
6017
|
);
|
|
@@ -5686,7 +6019,7 @@ function Sheet2({
|
|
|
5686
6019
|
|
|
5687
6020
|
// src/components/components/Sider/index.tsx
|
|
5688
6021
|
var import_lucide_react23 = require("lucide-react");
|
|
5689
|
-
var
|
|
6022
|
+
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
5690
6023
|
function Sider({
|
|
5691
6024
|
width = 200,
|
|
5692
6025
|
collapsible,
|
|
@@ -5698,26 +6031,26 @@ function Sider({
|
|
|
5698
6031
|
children
|
|
5699
6032
|
}) {
|
|
5700
6033
|
const current = collapsed ? collapsedWidth : width;
|
|
5701
|
-
return /* @__PURE__ */ (0,
|
|
6034
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(
|
|
5702
6035
|
"aside",
|
|
5703
6036
|
{
|
|
5704
6037
|
"data-slot": "layout-sider",
|
|
5705
6038
|
"data-collapsed": collapsed || void 0,
|
|
5706
6039
|
className: cn(
|
|
5707
|
-
"flex min-h-0 shrink-0 flex-col border-r bg-
|
|
6040
|
+
"flex min-h-0 shrink-0 flex-col border-r bg-sidebar transition-[width]",
|
|
5708
6041
|
className
|
|
5709
6042
|
),
|
|
5710
6043
|
style: { width: current, ...style },
|
|
5711
6044
|
children: [
|
|
5712
|
-
/* @__PURE__ */ (0,
|
|
5713
|
-
collapsible ? /* @__PURE__ */ (0,
|
|
6045
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: "min-h-0 flex-1 overflow-auto", children }),
|
|
6046
|
+
collapsible ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
5714
6047
|
"button",
|
|
5715
6048
|
{
|
|
5716
6049
|
type: "button",
|
|
5717
6050
|
"aria-label": collapsed ? "expand sider" : "collapse sider",
|
|
5718
6051
|
className: "flex h-10 shrink-0 items-center justify-center border-t text-muted-foreground hover:text-foreground",
|
|
5719
6052
|
onClick: () => onCollapse?.(!collapsed),
|
|
5720
|
-
children: collapsed ? /* @__PURE__ */ (0,
|
|
6053
|
+
children: collapsed ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_lucide_react23.ChevronRight, { "aria-hidden": true, className: "size-4" }) : /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_lucide_react23.ChevronLeft, { "aria-hidden": true, className: "size-4" })
|
|
5721
6054
|
}
|
|
5722
6055
|
) : null
|
|
5723
6056
|
]
|
|
@@ -5725,21 +6058,8 @@ function Sider({
|
|
|
5725
6058
|
);
|
|
5726
6059
|
}
|
|
5727
6060
|
|
|
5728
|
-
// src/ui/skeleton.tsx
|
|
5729
|
-
var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
5730
|
-
function Skeleton({ className, ...props }) {
|
|
5731
|
-
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
5732
|
-
"div",
|
|
5733
|
-
{
|
|
5734
|
-
"data-slot": "skeleton",
|
|
5735
|
-
className: cn("animate-pulse rounded-md bg-muted", className),
|
|
5736
|
-
...props
|
|
5737
|
-
}
|
|
5738
|
-
);
|
|
5739
|
-
}
|
|
5740
|
-
|
|
5741
6061
|
// src/components/components/Skeleton/index.tsx
|
|
5742
|
-
var
|
|
6062
|
+
var import_jsx_runtime106 = require("react/jsx-runtime");
|
|
5743
6063
|
var shapeDefaults = {
|
|
5744
6064
|
line: { className: "h-4 w-full", style: {} },
|
|
5745
6065
|
circle: { className: "rounded-full", style: { width: 40, height: 40 } },
|
|
@@ -5750,7 +6070,7 @@ function toSize(value) {
|
|
|
5750
6070
|
}
|
|
5751
6071
|
function Skeleton2({ shape = "line", width, height, className, style }) {
|
|
5752
6072
|
const defaults = shapeDefaults[shape];
|
|
5753
|
-
return /* @__PURE__ */ (0,
|
|
6073
|
+
return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
5754
6074
|
Skeleton,
|
|
5755
6075
|
{
|
|
5756
6076
|
className: cn(defaults.className, className),
|
|
@@ -5765,13 +6085,13 @@ function Skeleton2({ shape = "line", width, height, className, style }) {
|
|
|
5765
6085
|
}
|
|
5766
6086
|
|
|
5767
6087
|
// src/components/components/Slider/index.tsx
|
|
5768
|
-
var
|
|
6088
|
+
var import_react22 = require("react");
|
|
5769
6089
|
|
|
5770
6090
|
// src/ui/slider.tsx
|
|
5771
6091
|
var import_slider = require("@base-ui/react/slider");
|
|
5772
|
-
var
|
|
6092
|
+
var import_jsx_runtime107 = require("react/jsx-runtime");
|
|
5773
6093
|
function Slider({ className, ...props }) {
|
|
5774
|
-
return /* @__PURE__ */ (0,
|
|
6094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
5775
6095
|
import_slider.Slider.Root,
|
|
5776
6096
|
{
|
|
5777
6097
|
"data-slot": "slider",
|
|
@@ -5784,7 +6104,7 @@ function Slider({ className, ...props }) {
|
|
|
5784
6104
|
);
|
|
5785
6105
|
}
|
|
5786
6106
|
function SliderControl({ className, ...props }) {
|
|
5787
|
-
return /* @__PURE__ */ (0,
|
|
6107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
5788
6108
|
import_slider.Slider.Control,
|
|
5789
6109
|
{
|
|
5790
6110
|
"data-slot": "slider-control",
|
|
@@ -5794,12 +6114,12 @@ function SliderControl({ className, ...props }) {
|
|
|
5794
6114
|
);
|
|
5795
6115
|
}
|
|
5796
6116
|
function SliderTrack({ className, ...props }) {
|
|
5797
|
-
return /* @__PURE__ */ (0,
|
|
6117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
5798
6118
|
import_slider.Slider.Track,
|
|
5799
6119
|
{
|
|
5800
6120
|
"data-slot": "slider-track",
|
|
5801
6121
|
className: cn(
|
|
5802
|
-
"relative h-1.5 w-full grow overflow-hidden rounded-full bg-
|
|
6122
|
+
"relative h-1.5 w-full grow overflow-hidden rounded-full bg-(--slider-track)",
|
|
5803
6123
|
className
|
|
5804
6124
|
),
|
|
5805
6125
|
...props
|
|
@@ -5807,22 +6127,22 @@ function SliderTrack({ className, ...props }) {
|
|
|
5807
6127
|
);
|
|
5808
6128
|
}
|
|
5809
6129
|
function SliderIndicator({ className, ...props }) {
|
|
5810
|
-
return /* @__PURE__ */ (0,
|
|
6130
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
5811
6131
|
import_slider.Slider.Indicator,
|
|
5812
6132
|
{
|
|
5813
6133
|
"data-slot": "slider-indicator",
|
|
5814
|
-
className: cn("absolute h-full bg-
|
|
6134
|
+
className: cn("absolute h-full bg-(--slider-range)", className),
|
|
5815
6135
|
...props
|
|
5816
6136
|
}
|
|
5817
6137
|
);
|
|
5818
6138
|
}
|
|
5819
6139
|
function SliderThumb({ className, ...props }) {
|
|
5820
|
-
return /* @__PURE__ */ (0,
|
|
6140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
5821
6141
|
import_slider.Slider.Thumb,
|
|
5822
6142
|
{
|
|
5823
6143
|
"data-slot": "slider-thumb",
|
|
5824
6144
|
className: cn(
|
|
5825
|
-
"block size-4 shrink-0 cursor-grab rounded-full border border-primary bg-
|
|
6145
|
+
"block size-4 shrink-0 cursor-grab rounded-full border border-primary bg-(--slider-thumb) shadow-sm transition-colors focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none active:cursor-grabbing disabled:pointer-events-none disabled:opacity-50",
|
|
5826
6146
|
className
|
|
5827
6147
|
),
|
|
5828
6148
|
...props
|
|
@@ -5831,7 +6151,7 @@ function SliderThumb({ className, ...props }) {
|
|
|
5831
6151
|
}
|
|
5832
6152
|
|
|
5833
6153
|
// src/components/components/Slider/index.tsx
|
|
5834
|
-
var
|
|
6154
|
+
var import_jsx_runtime108 = require("react/jsx-runtime");
|
|
5835
6155
|
function Slider2({
|
|
5836
6156
|
name,
|
|
5837
6157
|
label,
|
|
@@ -5847,7 +6167,7 @@ function Slider2({
|
|
|
5847
6167
|
}) {
|
|
5848
6168
|
const form = useFormContext();
|
|
5849
6169
|
const inForm = form?.inForm === true && typeof name === "string" && name !== "";
|
|
5850
|
-
(0,
|
|
6170
|
+
(0, import_react22.useEffect)(() => {
|
|
5851
6171
|
if (inForm && form && name) {
|
|
5852
6172
|
form.registerField(name, rules, value);
|
|
5853
6173
|
return () => form.unregisterField(name);
|
|
@@ -5862,7 +6182,7 @@ function Slider2({
|
|
|
5862
6182
|
}
|
|
5863
6183
|
onChange?.(next);
|
|
5864
6184
|
};
|
|
5865
|
-
const slider = /* @__PURE__ */ (0,
|
|
6185
|
+
const slider = /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
5866
6186
|
Slider,
|
|
5867
6187
|
{
|
|
5868
6188
|
value: numberValue,
|
|
@@ -5874,14 +6194,14 @@ function Slider2({
|
|
|
5874
6194
|
onValueChange: handleChange,
|
|
5875
6195
|
className: inForm ? void 0 : className,
|
|
5876
6196
|
style: inForm ? void 0 : style,
|
|
5877
|
-
children: /* @__PURE__ */ (0,
|
|
5878
|
-
/* @__PURE__ */ (0,
|
|
5879
|
-
/* @__PURE__ */ (0,
|
|
5880
|
-
] })
|
|
6197
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(SliderControl, { children: [
|
|
6198
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)(SliderTrack, { children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(SliderIndicator, {}) }),
|
|
6199
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)(SliderThumb, {})
|
|
6200
|
+
] })
|
|
5881
6201
|
}
|
|
5882
6202
|
);
|
|
5883
6203
|
if (inForm && form && name) {
|
|
5884
|
-
return /* @__PURE__ */ (0,
|
|
6204
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
5885
6205
|
FieldShell,
|
|
5886
6206
|
{
|
|
5887
6207
|
layout: form.layout,
|
|
@@ -5898,12 +6218,12 @@ function Slider2({
|
|
|
5898
6218
|
|
|
5899
6219
|
// src/components/components/Sonner/index.tsx
|
|
5900
6220
|
var import_runtime17 = require("@pactor-app/runtime");
|
|
5901
|
-
var
|
|
6221
|
+
var import_react23 = require("react");
|
|
5902
6222
|
|
|
5903
6223
|
// src/ui/toast.tsx
|
|
5904
6224
|
var import_toast = require("@base-ui/react/toast");
|
|
5905
6225
|
var import_lucide_react24 = require("lucide-react");
|
|
5906
|
-
var
|
|
6226
|
+
var import_jsx_runtime109 = require("react/jsx-runtime");
|
|
5907
6227
|
var toastManager = import_toast.Toast.createToastManager();
|
|
5908
6228
|
function toast(message, options = {}) {
|
|
5909
6229
|
return toastManager.add({
|
|
@@ -5919,7 +6239,7 @@ var toastVariantClass = {
|
|
|
5919
6239
|
};
|
|
5920
6240
|
function ToasterViewport({ className }) {
|
|
5921
6241
|
const { toasts } = import_toast.Toast.useToastManager();
|
|
5922
|
-
return /* @__PURE__ */ (0,
|
|
6242
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_toast.Toast.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
5923
6243
|
import_toast.Toast.Viewport,
|
|
5924
6244
|
{
|
|
5925
6245
|
"data-slot": "toast-viewport",
|
|
@@ -5927,26 +6247,26 @@ function ToasterViewport({ className }) {
|
|
|
5927
6247
|
"fixed top-4 right-4 z-[100] flex w-80 flex-col gap-2 outline-none",
|
|
5928
6248
|
className
|
|
5929
6249
|
),
|
|
5930
|
-
children: toasts.map((item) => /* @__PURE__ */ (0,
|
|
6250
|
+
children: toasts.map((item) => /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
5931
6251
|
import_toast.Toast.Root,
|
|
5932
6252
|
{
|
|
5933
6253
|
toast: item,
|
|
5934
6254
|
"data-slot": "toast",
|
|
5935
6255
|
"data-type": item.type ?? "info",
|
|
5936
6256
|
className: cn(
|
|
5937
|
-
"rounded-md border border-border bg-popover px-4 py-3 text-sm text-popover-foreground shadow-md transition-[opacity,transform] duration-200 data-ending-style:animate-toast-out data-starting-style:animate-toast-in",
|
|
6257
|
+
"rounded-md border border-border bg-popover px-4 py-3 text-sm text-popover-foreground shadow-md shadow-(color:--shadow-color) transition-[opacity,transform] duration-200 data-ending-style:animate-toast-out data-starting-style:animate-toast-in",
|
|
5938
6258
|
toastVariantClass[item.type ?? "info"] ?? toastVariantClass.info
|
|
5939
6259
|
),
|
|
5940
|
-
children: /* @__PURE__ */ (0,
|
|
5941
|
-
/* @__PURE__ */ (0,
|
|
5942
|
-
/* @__PURE__ */ (0,
|
|
6260
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(import_toast.Toast.Content, { className: "flex items-start justify-between gap-2", children: [
|
|
6261
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: "grid gap-0.5", children: [
|
|
6262
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
5943
6263
|
import_toast.Toast.Title,
|
|
5944
6264
|
{
|
|
5945
6265
|
"data-slot": "toast-title",
|
|
5946
6266
|
className: "font-medium"
|
|
5947
6267
|
}
|
|
5948
6268
|
),
|
|
5949
|
-
/* @__PURE__ */ (0,
|
|
6269
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
5950
6270
|
import_toast.Toast.Description,
|
|
5951
6271
|
{
|
|
5952
6272
|
"data-slot": "toast-description",
|
|
@@ -5954,13 +6274,13 @@ function ToasterViewport({ className }) {
|
|
|
5954
6274
|
}
|
|
5955
6275
|
)
|
|
5956
6276
|
] }),
|
|
5957
|
-
/* @__PURE__ */ (0,
|
|
6277
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
5958
6278
|
import_toast.Toast.Close,
|
|
5959
6279
|
{
|
|
5960
6280
|
"data-slot": "toast-close",
|
|
5961
6281
|
"aria-label": "Close",
|
|
5962
6282
|
className: "cursor-pointer rounded-xs opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none [&_svg]:size-3.5",
|
|
5963
|
-
children: /* @__PURE__ */ (0,
|
|
6283
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_lucide_react24.XIcon, {})
|
|
5964
6284
|
}
|
|
5965
6285
|
)
|
|
5966
6286
|
] })
|
|
@@ -5971,14 +6291,14 @@ function ToasterViewport({ className }) {
|
|
|
5971
6291
|
) });
|
|
5972
6292
|
}
|
|
5973
6293
|
function Toaster({ className }) {
|
|
5974
|
-
return /* @__PURE__ */ (0,
|
|
6294
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_toast.Toast.Provider, { toastManager, children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(ToasterViewport, { className }) });
|
|
5975
6295
|
}
|
|
5976
6296
|
|
|
5977
6297
|
// src/components/components/Sonner/index.tsx
|
|
5978
|
-
var
|
|
6298
|
+
var import_jsx_runtime110 = require("react/jsx-runtime");
|
|
5979
6299
|
function Sonner({ className, style }) {
|
|
5980
6300
|
const { context } = (0, import_runtime17.useRenderer)();
|
|
5981
|
-
(0,
|
|
6301
|
+
(0, import_react23.useEffect)(() => {
|
|
5982
6302
|
const { actions } = context;
|
|
5983
6303
|
if (actions.has("toast")) {
|
|
5984
6304
|
return;
|
|
@@ -5992,14 +6312,14 @@ function Sonner({ className, style }) {
|
|
|
5992
6312
|
return { ok: true };
|
|
5993
6313
|
});
|
|
5994
6314
|
}, [context]);
|
|
5995
|
-
return /* @__PURE__ */ (0,
|
|
6315
|
+
return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { "data-slot": "sonner", className, style, children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(Toaster, {}) });
|
|
5996
6316
|
}
|
|
5997
6317
|
|
|
5998
6318
|
// src/ui/spinner.tsx
|
|
5999
6319
|
var import_lucide_react25 = require("lucide-react");
|
|
6000
|
-
var
|
|
6320
|
+
var import_jsx_runtime111 = require("react/jsx-runtime");
|
|
6001
6321
|
function Spinner({ className, ...props }) {
|
|
6002
|
-
return /* @__PURE__ */ (0,
|
|
6322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
6003
6323
|
import_lucide_react25.Loader2Icon,
|
|
6004
6324
|
{
|
|
6005
6325
|
role: "status",
|
|
@@ -6012,50 +6332,50 @@ function Spinner({ className, ...props }) {
|
|
|
6012
6332
|
}
|
|
6013
6333
|
|
|
6014
6334
|
// src/components/components/Spinner/index.tsx
|
|
6015
|
-
var
|
|
6335
|
+
var import_jsx_runtime112 = require("react/jsx-runtime");
|
|
6016
6336
|
var sizeClass = {
|
|
6017
6337
|
sm: "size-3",
|
|
6018
6338
|
default: "size-4",
|
|
6019
6339
|
lg: "size-6"
|
|
6020
6340
|
};
|
|
6021
6341
|
function Spinner2({ size = "default", className, style }) {
|
|
6022
|
-
return /* @__PURE__ */ (0,
|
|
6342
|
+
return /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(Spinner, { className: cn(sizeClass[size], className), style });
|
|
6023
6343
|
}
|
|
6024
6344
|
|
|
6025
6345
|
// src/components/components/Statistic/index.tsx
|
|
6026
|
-
var
|
|
6346
|
+
var import_jsx_runtime113 = require("react/jsx-runtime");
|
|
6027
6347
|
function Statistic({ title, value, precision, suffix, className, style }) {
|
|
6028
6348
|
const display = typeof value === "number" && precision !== void 0 ? value.toFixed(precision) : value;
|
|
6029
|
-
return /* @__PURE__ */ (0,
|
|
6030
|
-
title ? /* @__PURE__ */ (0,
|
|
6031
|
-
/* @__PURE__ */ (0,
|
|
6349
|
+
return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { "data-slot": "statistic", className: cn(className), style, children: [
|
|
6350
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { "data-slot": "statistic-title", className: "text-sm text-muted-foreground", children: title }) : null,
|
|
6351
|
+
/* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { "data-slot": "statistic-value", className: "text-2xl font-bold tabular-nums", children: [
|
|
6032
6352
|
display,
|
|
6033
|
-
suffix ? /* @__PURE__ */ (0,
|
|
6353
|
+
suffix ? /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("span", { className: "ml-1 text-sm font-normal text-muted-foreground", children: suffix }) : null
|
|
6034
6354
|
] })
|
|
6035
6355
|
] });
|
|
6036
6356
|
}
|
|
6037
6357
|
|
|
6038
6358
|
// src/components/components/Switch/index.tsx
|
|
6039
|
-
var
|
|
6359
|
+
var import_react24 = require("react");
|
|
6040
6360
|
|
|
6041
6361
|
// src/ui/switch.tsx
|
|
6042
6362
|
var import_switch = require("@base-ui/react/switch");
|
|
6043
|
-
var
|
|
6363
|
+
var import_jsx_runtime114 = require("react/jsx-runtime");
|
|
6044
6364
|
function Switch({ className, ...props }) {
|
|
6045
|
-
return /* @__PURE__ */ (0,
|
|
6365
|
+
return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
6046
6366
|
import_switch.Switch.Root,
|
|
6047
6367
|
{
|
|
6048
6368
|
"data-slot": "switch",
|
|
6049
6369
|
className: cn(
|
|
6050
|
-
"inline-flex h-[1.15rem] w-8 shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-xs transition-colors outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-checked:bg-
|
|
6370
|
+
"inline-flex h-[1.15rem] w-8 shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-xs transition-colors outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-checked:bg-(--switch-track-checked) data-unchecked:bg-(--switch-track)",
|
|
6051
6371
|
className
|
|
6052
6372
|
),
|
|
6053
6373
|
...props,
|
|
6054
|
-
children: /* @__PURE__ */ (0,
|
|
6374
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
6055
6375
|
import_switch.Switch.Thumb,
|
|
6056
6376
|
{
|
|
6057
6377
|
"data-slot": "switch-thumb",
|
|
6058
|
-
className: "pointer-events-none block size-4 rounded-full bg-
|
|
6378
|
+
className: "pointer-events-none block size-4 rounded-full bg-(--switch-thumb) transition-transform data-checked:translate-x-[calc(100%-2px)] data-unchecked:translate-x-0"
|
|
6059
6379
|
}
|
|
6060
6380
|
)
|
|
6061
6381
|
}
|
|
@@ -6063,7 +6383,7 @@ function Switch({ className, ...props }) {
|
|
|
6063
6383
|
}
|
|
6064
6384
|
|
|
6065
6385
|
// src/components/components/Switch/index.tsx
|
|
6066
|
-
var
|
|
6386
|
+
var import_jsx_runtime115 = require("react/jsx-runtime");
|
|
6067
6387
|
function Switch2({
|
|
6068
6388
|
name,
|
|
6069
6389
|
label,
|
|
@@ -6075,9 +6395,9 @@ function Switch2({
|
|
|
6075
6395
|
style
|
|
6076
6396
|
}) {
|
|
6077
6397
|
const form = useFormContext();
|
|
6078
|
-
const controlId = (0,
|
|
6398
|
+
const controlId = (0, import_react24.useId)();
|
|
6079
6399
|
const inForm = form?.inForm === true && typeof name === "string" && name !== "";
|
|
6080
|
-
(0,
|
|
6400
|
+
(0, import_react24.useEffect)(() => {
|
|
6081
6401
|
if (inForm && form && name) {
|
|
6082
6402
|
form.registerField(name, rules, value);
|
|
6083
6403
|
return () => form.unregisterField(name);
|
|
@@ -6092,13 +6412,13 @@ function Switch2({
|
|
|
6092
6412
|
}
|
|
6093
6413
|
onChange?.(next);
|
|
6094
6414
|
};
|
|
6095
|
-
const control = /* @__PURE__ */ (0,
|
|
6415
|
+
const control = /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(
|
|
6096
6416
|
"span",
|
|
6097
6417
|
{
|
|
6098
6418
|
className: cn("inline-flex items-center gap-2", !inForm && className),
|
|
6099
6419
|
style: inForm ? void 0 : style,
|
|
6100
6420
|
children: [
|
|
6101
|
-
/* @__PURE__ */ (0,
|
|
6421
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
6102
6422
|
Switch,
|
|
6103
6423
|
{
|
|
6104
6424
|
id: controlId,
|
|
@@ -6108,12 +6428,12 @@ function Switch2({
|
|
|
6108
6428
|
onCheckedChange: handleChange
|
|
6109
6429
|
}
|
|
6110
6430
|
),
|
|
6111
|
-
label ? /* @__PURE__ */ (0,
|
|
6431
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("label", { htmlFor: controlId, className: "text-sm leading-none font-medium", children: label }) : null
|
|
6112
6432
|
]
|
|
6113
6433
|
}
|
|
6114
6434
|
);
|
|
6115
6435
|
if (inForm && form && name) {
|
|
6116
|
-
return /* @__PURE__ */ (0,
|
|
6436
|
+
return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(
|
|
6117
6437
|
"div",
|
|
6118
6438
|
{
|
|
6119
6439
|
"data-slot": "form-item",
|
|
@@ -6121,7 +6441,7 @@ function Switch2({
|
|
|
6121
6441
|
style,
|
|
6122
6442
|
children: [
|
|
6123
6443
|
control,
|
|
6124
|
-
form.errors[name] ? /* @__PURE__ */ (0,
|
|
6444
|
+
form.errors[name] ? /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("div", { "data-slot": "form-error", className: "mt-1.5 text-sm text-destructive", children: form.errors[name] }) : null
|
|
6125
6445
|
]
|
|
6126
6446
|
}
|
|
6127
6447
|
);
|
|
@@ -6131,8 +6451,8 @@ function Switch2({
|
|
|
6131
6451
|
|
|
6132
6452
|
// src/components/components/Table/index.tsx
|
|
6133
6453
|
var import_runtime18 = require("@pactor-app/runtime");
|
|
6134
|
-
var
|
|
6135
|
-
var
|
|
6454
|
+
var import_react25 = require("react");
|
|
6455
|
+
var import_jsx_runtime116 = require("react/jsx-runtime");
|
|
6136
6456
|
function renderCellValue2(value) {
|
|
6137
6457
|
if (value === void 0 || value === null) {
|
|
6138
6458
|
return "";
|
|
@@ -6154,7 +6474,7 @@ function Table3({
|
|
|
6154
6474
|
}) {
|
|
6155
6475
|
const { renderChildren } = (0, import_runtime18.useRenderer)();
|
|
6156
6476
|
const { t } = (0, import_runtime18.useI18n)();
|
|
6157
|
-
const [current, setCurrent] = (0,
|
|
6477
|
+
const [current, setCurrent] = (0, import_react25.useState)(1);
|
|
6158
6478
|
const pageSize = pagination === false ? void 0 : pagination?.pageSize;
|
|
6159
6479
|
const total = dataSource.length;
|
|
6160
6480
|
const pageCount = pageSize !== void 0 && pageSize > 0 ? Math.max(1, Math.ceil(total / pageSize)) : 1;
|
|
@@ -6163,17 +6483,17 @@ function Table3({
|
|
|
6163
6483
|
setCurrent(page);
|
|
6164
6484
|
onChange?.({ current: page, pageSize, total });
|
|
6165
6485
|
};
|
|
6166
|
-
return /* @__PURE__ */ (0,
|
|
6167
|
-
loading ? /* @__PURE__ */ (0,
|
|
6486
|
+
return /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("div", { "data-slot": "dsl-table", className: cn("relative", className), style, children: [
|
|
6487
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
6168
6488
|
"div",
|
|
6169
6489
|
{
|
|
6170
6490
|
"data-slot": "table-loading",
|
|
6171
|
-
className: "absolute inset-0 z-10 flex items-center justify-center bg-
|
|
6491
|
+
className: "absolute inset-0 z-10 flex items-center justify-center bg-card/60 text-sm text-muted-foreground",
|
|
6172
6492
|
children: t("pactor.table.loading")
|
|
6173
6493
|
}
|
|
6174
6494
|
) : null,
|
|
6175
|
-
/* @__PURE__ */ (0,
|
|
6176
|
-
/* @__PURE__ */ (0,
|
|
6495
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(Table2, { children: [
|
|
6496
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(TableHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(TableRow, { className: "hover:bg-transparent", children: columns.map((column, index) => /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
6177
6497
|
TableHead,
|
|
6178
6498
|
{
|
|
6179
6499
|
style: column.width !== void 0 ? { width: column.width } : void 0,
|
|
@@ -6181,7 +6501,7 @@ function Table3({
|
|
|
6181
6501
|
},
|
|
6182
6502
|
column.dataIndex ?? String(index)
|
|
6183
6503
|
)) }) }),
|
|
6184
|
-
/* @__PURE__ */ (0,
|
|
6504
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(TableBody, { children: pageRows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(TableRow, { className: "hover:bg-transparent", children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(TableCell, { colSpan: Math.max(1, columns.length), children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
6185
6505
|
"div",
|
|
6186
6506
|
{
|
|
6187
6507
|
"data-slot": "table-empty",
|
|
@@ -6190,10 +6510,10 @@ function Table3({
|
|
|
6190
6510
|
}
|
|
6191
6511
|
) }) }) : pageRows.map((row, rowIndex) => {
|
|
6192
6512
|
const key = row[rowKey];
|
|
6193
|
-
return /* @__PURE__ */ (0,
|
|
6513
|
+
return /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
6194
6514
|
TableRow,
|
|
6195
6515
|
{
|
|
6196
|
-
children: columns.map((column, columnIndex) => /* @__PURE__ */ (0,
|
|
6516
|
+
children: columns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(TableCell, { children: column.cell ? renderChildren([column.cell], { row, rowIndex }) : renderCellValue2(
|
|
6197
6517
|
column.dataIndex === void 0 ? void 0 : row[column.dataIndex]
|
|
6198
6518
|
) }, column.dataIndex ?? String(columnIndex)))
|
|
6199
6519
|
},
|
|
@@ -6201,8 +6521,8 @@ function Table3({
|
|
|
6201
6521
|
);
|
|
6202
6522
|
}) })
|
|
6203
6523
|
] }),
|
|
6204
|
-
pageSize !== void 0 && pageSize > 0 ? /* @__PURE__ */ (0,
|
|
6205
|
-
(page) => /* @__PURE__ */ (0,
|
|
6524
|
+
pageSize !== void 0 && pageSize > 0 ? /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("div", { "data-slot": "table-pagination", className: "mt-3 flex justify-end gap-1", children: Array.from({ length: pageCount }, (_, index) => index + 1).map(
|
|
6525
|
+
(page) => /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
6206
6526
|
Button,
|
|
6207
6527
|
{
|
|
6208
6528
|
type: "button",
|
|
@@ -6223,12 +6543,12 @@ var import_runtime19 = require("@pactor-app/runtime");
|
|
|
6223
6543
|
|
|
6224
6544
|
// src/ui/tabs.tsx
|
|
6225
6545
|
var import_tabs = require("@base-ui/react/tabs");
|
|
6226
|
-
var
|
|
6546
|
+
var import_jsx_runtime117 = require("react/jsx-runtime");
|
|
6227
6547
|
function Tabs({
|
|
6228
6548
|
className,
|
|
6229
6549
|
...props
|
|
6230
6550
|
}) {
|
|
6231
|
-
return /* @__PURE__ */ (0,
|
|
6551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6232
6552
|
import_tabs.Tabs.Root,
|
|
6233
6553
|
{
|
|
6234
6554
|
"data-slot": "tabs",
|
|
@@ -6241,7 +6561,7 @@ function TabsList({
|
|
|
6241
6561
|
className,
|
|
6242
6562
|
...props
|
|
6243
6563
|
}) {
|
|
6244
|
-
return /* @__PURE__ */ (0,
|
|
6564
|
+
return /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6245
6565
|
import_tabs.Tabs.List,
|
|
6246
6566
|
{
|
|
6247
6567
|
"data-slot": "tabs-list",
|
|
@@ -6257,12 +6577,12 @@ function TabsTrigger({
|
|
|
6257
6577
|
className,
|
|
6258
6578
|
...props
|
|
6259
6579
|
}) {
|
|
6260
|
-
return /* @__PURE__ */ (0,
|
|
6580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6261
6581
|
import_tabs.Tabs.Tab,
|
|
6262
6582
|
{
|
|
6263
6583
|
"data-slot": "tabs-trigger",
|
|
6264
6584
|
className: cn(
|
|
6265
|
-
"inline-flex h-[calc(100%-1px)] flex-1 cursor-pointer items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground transition-colors focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-active:border-border data-active:bg-
|
|
6585
|
+
"inline-flex h-[calc(100%-1px)] flex-1 cursor-pointer items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground transition-colors focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-active:border-border data-active:bg-card data-active:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
6266
6586
|
className
|
|
6267
6587
|
),
|
|
6268
6588
|
...props
|
|
@@ -6273,7 +6593,7 @@ function TabsContent({
|
|
|
6273
6593
|
className,
|
|
6274
6594
|
...props
|
|
6275
6595
|
}) {
|
|
6276
|
-
return /* @__PURE__ */ (0,
|
|
6596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6277
6597
|
import_tabs.Tabs.Panel,
|
|
6278
6598
|
{
|
|
6279
6599
|
"data-slot": "tabs-content",
|
|
@@ -6284,10 +6604,10 @@ function TabsContent({
|
|
|
6284
6604
|
}
|
|
6285
6605
|
|
|
6286
6606
|
// src/components/components/Tabs/index.tsx
|
|
6287
|
-
var
|
|
6607
|
+
var import_jsx_runtime118 = require("react/jsx-runtime");
|
|
6288
6608
|
function Tabs2({ items = [], activeKey, onChange, className, style }) {
|
|
6289
6609
|
const { renderChildren } = (0, import_runtime19.useRenderer)();
|
|
6290
|
-
return /* @__PURE__ */ (0,
|
|
6610
|
+
return /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(
|
|
6291
6611
|
Tabs,
|
|
6292
6612
|
{
|
|
6293
6613
|
value: activeKey,
|
|
@@ -6296,20 +6616,20 @@ function Tabs2({ items = [], activeKey, onChange, className, style }) {
|
|
|
6296
6616
|
className,
|
|
6297
6617
|
style,
|
|
6298
6618
|
children: [
|
|
6299
|
-
/* @__PURE__ */ (0,
|
|
6300
|
-
items.map((item) => /* @__PURE__ */ (0,
|
|
6619
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)(TabsList, { children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(TabsTrigger, { value: item.key, children: item.label }, item.key)) }),
|
|
6620
|
+
items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(TabsContent, { value: item.key, children: renderChildren(item.children) }, item.key))
|
|
6301
6621
|
]
|
|
6302
6622
|
}
|
|
6303
6623
|
);
|
|
6304
6624
|
}
|
|
6305
6625
|
|
|
6306
6626
|
// src/components/components/Text/index.tsx
|
|
6307
|
-
var
|
|
6627
|
+
var import_jsx_runtime119 = require("react/jsx-runtime");
|
|
6308
6628
|
var typeClassMap = {
|
|
6309
6629
|
default: "",
|
|
6310
6630
|
secondary: "text-muted-foreground",
|
|
6311
|
-
success: "text-
|
|
6312
|
-
warning: "text-
|
|
6631
|
+
success: "text-success",
|
|
6632
|
+
warning: "text-warning",
|
|
6313
6633
|
danger: "text-destructive"
|
|
6314
6634
|
};
|
|
6315
6635
|
function Text({
|
|
@@ -6323,7 +6643,7 @@ function Text({
|
|
|
6323
6643
|
style,
|
|
6324
6644
|
children
|
|
6325
6645
|
}) {
|
|
6326
|
-
return /* @__PURE__ */ (0,
|
|
6646
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
6327
6647
|
"span",
|
|
6328
6648
|
{
|
|
6329
6649
|
"data-slot": "text",
|
|
@@ -6343,8 +6663,8 @@ function Text({
|
|
|
6343
6663
|
}
|
|
6344
6664
|
|
|
6345
6665
|
// src/components/components/Textarea/index.tsx
|
|
6346
|
-
var
|
|
6347
|
-
var
|
|
6666
|
+
var import_react26 = require("react");
|
|
6667
|
+
var import_jsx_runtime120 = require("react/jsx-runtime");
|
|
6348
6668
|
function Textarea2({
|
|
6349
6669
|
name,
|
|
6350
6670
|
label,
|
|
@@ -6358,9 +6678,9 @@ function Textarea2({
|
|
|
6358
6678
|
style
|
|
6359
6679
|
}) {
|
|
6360
6680
|
const form = useFormContext();
|
|
6361
|
-
const controlId = (0,
|
|
6681
|
+
const controlId = (0, import_react26.useId)();
|
|
6362
6682
|
const inForm = form?.inForm === true && typeof name === "string" && name !== "";
|
|
6363
|
-
(0,
|
|
6683
|
+
(0, import_react26.useEffect)(() => {
|
|
6364
6684
|
if (inForm && form && name) {
|
|
6365
6685
|
form.registerField(name, rules, value);
|
|
6366
6686
|
return () => form.unregisterField(name);
|
|
@@ -6369,7 +6689,7 @@ function Textarea2({
|
|
|
6369
6689
|
});
|
|
6370
6690
|
if (inForm && form && name) {
|
|
6371
6691
|
const fieldValue = form.values[name];
|
|
6372
|
-
return /* @__PURE__ */ (0,
|
|
6692
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
6373
6693
|
FieldShell,
|
|
6374
6694
|
{
|
|
6375
6695
|
layout: form.layout,
|
|
@@ -6378,7 +6698,7 @@ function Textarea2({
|
|
|
6378
6698
|
error: form.errors[name],
|
|
6379
6699
|
className,
|
|
6380
6700
|
style,
|
|
6381
|
-
children: /* @__PURE__ */ (0,
|
|
6701
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
6382
6702
|
Textarea,
|
|
6383
6703
|
{
|
|
6384
6704
|
id: controlId,
|
|
@@ -6395,7 +6715,7 @@ function Textarea2({
|
|
|
6395
6715
|
}
|
|
6396
6716
|
);
|
|
6397
6717
|
}
|
|
6398
|
-
return /* @__PURE__ */ (0,
|
|
6718
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
6399
6719
|
Textarea,
|
|
6400
6720
|
{
|
|
6401
6721
|
value: value ?? "",
|
|
@@ -6411,9 +6731,9 @@ function Textarea2({
|
|
|
6411
6731
|
|
|
6412
6732
|
// src/ui/toggle.tsx
|
|
6413
6733
|
var import_toggle = require("@base-ui/react/toggle");
|
|
6414
|
-
var
|
|
6415
|
-
var
|
|
6416
|
-
var toggleVariants = (0,
|
|
6734
|
+
var import_class_variance_authority7 = require("class-variance-authority");
|
|
6735
|
+
var import_jsx_runtime121 = require("react/jsx-runtime");
|
|
6736
|
+
var toggleVariants = (0, import_class_variance_authority7.cva)(
|
|
6417
6737
|
"inline-flex cursor-pointer items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-colors outline-none hover:bg-muted hover:text-muted-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 data-pressed:bg-accent data-pressed:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
6418
6738
|
{
|
|
6419
6739
|
variants: {
|
|
@@ -6439,7 +6759,7 @@ function Toggle({
|
|
|
6439
6759
|
size,
|
|
6440
6760
|
...props
|
|
6441
6761
|
}) {
|
|
6442
|
-
return /* @__PURE__ */ (0,
|
|
6762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
6443
6763
|
import_toggle.Toggle,
|
|
6444
6764
|
{
|
|
6445
6765
|
"data-slot": "toggle",
|
|
@@ -6450,7 +6770,7 @@ function Toggle({
|
|
|
6450
6770
|
}
|
|
6451
6771
|
|
|
6452
6772
|
// src/components/components/Toggle/index.tsx
|
|
6453
|
-
var
|
|
6773
|
+
var import_jsx_runtime122 = require("react/jsx-runtime");
|
|
6454
6774
|
function Toggle2({
|
|
6455
6775
|
text,
|
|
6456
6776
|
pressed,
|
|
@@ -6461,7 +6781,7 @@ function Toggle2({
|
|
|
6461
6781
|
className,
|
|
6462
6782
|
style
|
|
6463
6783
|
}) {
|
|
6464
|
-
return /* @__PURE__ */ (0,
|
|
6784
|
+
return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
6465
6785
|
Toggle,
|
|
6466
6786
|
{
|
|
6467
6787
|
pressed,
|
|
@@ -6479,9 +6799,9 @@ function Toggle2({
|
|
|
6479
6799
|
// src/ui/toggle-group.tsx
|
|
6480
6800
|
var import_toggle3 = require("@base-ui/react/toggle");
|
|
6481
6801
|
var import_toggle_group = require("@base-ui/react/toggle-group");
|
|
6482
|
-
var
|
|
6483
|
-
var
|
|
6484
|
-
var ToggleGroupContext =
|
|
6802
|
+
var React5 = __toESM(require("react"), 1);
|
|
6803
|
+
var import_jsx_runtime123 = require("react/jsx-runtime");
|
|
6804
|
+
var ToggleGroupContext = React5.createContext({
|
|
6485
6805
|
size: "default",
|
|
6486
6806
|
variant: "default"
|
|
6487
6807
|
});
|
|
@@ -6492,7 +6812,7 @@ function ToggleGroup({
|
|
|
6492
6812
|
children,
|
|
6493
6813
|
...props
|
|
6494
6814
|
}) {
|
|
6495
|
-
return /* @__PURE__ */ (0,
|
|
6815
|
+
return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
6496
6816
|
import_toggle_group.ToggleGroup,
|
|
6497
6817
|
{
|
|
6498
6818
|
"data-slot": "toggle-group",
|
|
@@ -6503,7 +6823,7 @@ function ToggleGroup({
|
|
|
6503
6823
|
className
|
|
6504
6824
|
),
|
|
6505
6825
|
...props,
|
|
6506
|
-
children: /* @__PURE__ */ (0,
|
|
6826
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(ToggleGroupContext.Provider, { value: { variant, size }, children })
|
|
6507
6827
|
}
|
|
6508
6828
|
);
|
|
6509
6829
|
}
|
|
@@ -6514,8 +6834,8 @@ function ToggleGroupItem({
|
|
|
6514
6834
|
size,
|
|
6515
6835
|
...props
|
|
6516
6836
|
}) {
|
|
6517
|
-
const context =
|
|
6518
|
-
return /* @__PURE__ */ (0,
|
|
6837
|
+
const context = React5.useContext(ToggleGroupContext);
|
|
6838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
6519
6839
|
import_toggle3.Toggle,
|
|
6520
6840
|
{
|
|
6521
6841
|
"data-slot": "toggle-group-item",
|
|
@@ -6536,7 +6856,7 @@ function ToggleGroupItem({
|
|
|
6536
6856
|
}
|
|
6537
6857
|
|
|
6538
6858
|
// src/components/components/ToggleGroup/index.tsx
|
|
6539
|
-
var
|
|
6859
|
+
var import_jsx_runtime124 = require("react/jsx-runtime");
|
|
6540
6860
|
function ToggleGroup2({
|
|
6541
6861
|
options = [],
|
|
6542
6862
|
value,
|
|
@@ -6556,7 +6876,7 @@ function ToggleGroup2({
|
|
|
6556
6876
|
onChange?.(added ?? void 0);
|
|
6557
6877
|
}
|
|
6558
6878
|
};
|
|
6559
|
-
return /* @__PURE__ */ (0,
|
|
6879
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
6560
6880
|
ToggleGroup,
|
|
6561
6881
|
{
|
|
6562
6882
|
value: groupValue,
|
|
@@ -6565,7 +6885,7 @@ function ToggleGroup2({
|
|
|
6565
6885
|
onValueChange: (next) => handleChange(next),
|
|
6566
6886
|
className,
|
|
6567
6887
|
style,
|
|
6568
|
-
children: options.map((option) => /* @__PURE__ */ (0,
|
|
6888
|
+
children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
6569
6889
|
ToggleGroupItem,
|
|
6570
6890
|
{
|
|
6571
6891
|
value: option.value,
|
|
@@ -6579,18 +6899,18 @@ function ToggleGroup2({
|
|
|
6579
6899
|
}
|
|
6580
6900
|
|
|
6581
6901
|
// src/components/components/Tooltip/index.tsx
|
|
6582
|
-
var
|
|
6902
|
+
var import_jsx_runtime125 = require("react/jsx-runtime");
|
|
6583
6903
|
function Tooltip3({ content, children, className, style }) {
|
|
6584
|
-
return /* @__PURE__ */ (0,
|
|
6585
|
-
/* @__PURE__ */ (0,
|
|
6586
|
-
/* @__PURE__ */ (0,
|
|
6904
|
+
return /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(Tooltip2, { children: [
|
|
6905
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(TooltipTrigger, { render: triggerWrapper("tooltip-trigger-wrap"), children }),
|
|
6906
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(TooltipContent, { className, style, children: content })
|
|
6587
6907
|
] });
|
|
6588
6908
|
}
|
|
6589
6909
|
|
|
6590
6910
|
// src/ui/typography.tsx
|
|
6591
|
-
var
|
|
6592
|
-
var
|
|
6593
|
-
var typographyVariants = (0,
|
|
6911
|
+
var import_class_variance_authority8 = require("class-variance-authority");
|
|
6912
|
+
var import_jsx_runtime126 = require("react/jsx-runtime");
|
|
6913
|
+
var typographyVariants = (0, import_class_variance_authority8.cva)("", {
|
|
6594
6914
|
variants: {
|
|
6595
6915
|
variant: {
|
|
6596
6916
|
h1: "scroll-m-20 text-4xl font-extrabold tracking-tight text-balance",
|
|
@@ -6625,7 +6945,7 @@ var variantTagMap = {
|
|
|
6625
6945
|
};
|
|
6626
6946
|
function Typography({ className, variant = "p", ...props }) {
|
|
6627
6947
|
const Tag2 = variantTagMap[variant ?? "p"];
|
|
6628
|
-
return /* @__PURE__ */ (0,
|
|
6948
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
6629
6949
|
Tag2,
|
|
6630
6950
|
{
|
|
6631
6951
|
"data-slot": "typography",
|
|
@@ -6637,14 +6957,14 @@ function Typography({ className, variant = "p", ...props }) {
|
|
|
6637
6957
|
}
|
|
6638
6958
|
|
|
6639
6959
|
// src/components/components/Typography/index.tsx
|
|
6640
|
-
var
|
|
6960
|
+
var import_jsx_runtime127 = require("react/jsx-runtime");
|
|
6641
6961
|
function Typography2({
|
|
6642
6962
|
variant = "p",
|
|
6643
6963
|
text,
|
|
6644
6964
|
className,
|
|
6645
6965
|
style
|
|
6646
6966
|
}) {
|
|
6647
|
-
return /* @__PURE__ */ (0,
|
|
6967
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(Typography, { variant, className, style, children: text });
|
|
6648
6968
|
}
|
|
6649
6969
|
|
|
6650
6970
|
// src/components/register.ts
|
|
@@ -6787,10 +7107,10 @@ function collectDefaultOpenKeys(registry, activeMenuId) {
|
|
|
6787
7107
|
var import_permission = require("@pactor-app/permission");
|
|
6788
7108
|
var import_router = require("@pactor-app/router");
|
|
6789
7109
|
var import_runtime20 = require("@pactor-app/runtime");
|
|
6790
|
-
var
|
|
7110
|
+
var import_react28 = require("react");
|
|
6791
7111
|
|
|
6792
7112
|
// src/layout/admin/use-media-query.ts
|
|
6793
|
-
var
|
|
7113
|
+
var import_react27 = require("react");
|
|
6794
7114
|
var BREAKPOINT_PX = {
|
|
6795
7115
|
xs: 480,
|
|
6796
7116
|
sm: 576,
|
|
@@ -6800,10 +7120,10 @@ var BREAKPOINT_PX = {
|
|
|
6800
7120
|
xxl: 1600
|
|
6801
7121
|
};
|
|
6802
7122
|
function useMediaQuery(query) {
|
|
6803
|
-
const [matches, setMatches] = (0,
|
|
7123
|
+
const [matches, setMatches] = (0, import_react27.useState)(
|
|
6804
7124
|
() => typeof window !== "undefined" && typeof window.matchMedia === "function" ? window.matchMedia(query).matches : false
|
|
6805
7125
|
);
|
|
6806
|
-
(0,
|
|
7126
|
+
(0, import_react27.useEffect)(() => {
|
|
6807
7127
|
if (typeof window === "undefined" || typeof window.matchMedia !== "function") {
|
|
6808
7128
|
return;
|
|
6809
7129
|
}
|
|
@@ -6823,7 +7143,7 @@ function useBreakpointBelow(breakpoint) {
|
|
|
6823
7143
|
}
|
|
6824
7144
|
|
|
6825
7145
|
// src/layout/admin/AdminLayout.tsx
|
|
6826
|
-
var
|
|
7146
|
+
var import_jsx_runtime128 = require("react/jsx-runtime");
|
|
6827
7147
|
function buildVisibleMenuTree(registry, permissionChecker) {
|
|
6828
7148
|
const tree = registry.tree();
|
|
6829
7149
|
return permissionChecker === void 0 ? [...tree] : (0, import_permission.filterMenusByPermission)(tree, permissionChecker);
|
|
@@ -6838,7 +7158,7 @@ function navigateMenuItem(menu, bridge) {
|
|
|
6838
7158
|
}
|
|
6839
7159
|
bridge.push(menu.path);
|
|
6840
7160
|
}
|
|
6841
|
-
var menuItemClass2 = "flex w-full cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-left text-sm text-muted-foreground transition-colors hover:bg-
|
|
7161
|
+
var menuItemClass2 = "flex w-full cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-left text-sm text-muted-foreground transition-colors hover:bg-(--menu-hover-background) hover:text-(--menu-hover-foreground) disabled:pointer-events-none disabled:opacity-50";
|
|
6842
7162
|
function CollapsedGroupFlyout({
|
|
6843
7163
|
menu,
|
|
6844
7164
|
registry,
|
|
@@ -6846,8 +7166,8 @@ function CollapsedGroupFlyout({
|
|
|
6846
7166
|
activeMenuId,
|
|
6847
7167
|
defaultOpenKeys
|
|
6848
7168
|
}) {
|
|
6849
|
-
const [open, setOpen] = (0,
|
|
6850
|
-
const closeTimer = (0,
|
|
7169
|
+
const [open, setOpen] = (0, import_react28.useState)(false);
|
|
7170
|
+
const closeTimer = (0, import_react28.useRef)(void 0);
|
|
6851
7171
|
const openNow = () => {
|
|
6852
7172
|
window.clearTimeout(closeTimer.current);
|
|
6853
7173
|
setOpen(true);
|
|
@@ -6856,12 +7176,12 @@ function CollapsedGroupFlyout({
|
|
|
6856
7176
|
window.clearTimeout(closeTimer.current);
|
|
6857
7177
|
closeTimer.current = window.setTimeout(() => setOpen(false), 200);
|
|
6858
7178
|
};
|
|
6859
|
-
(0,
|
|
6860
|
-
return /* @__PURE__ */ (0,
|
|
6861
|
-
/* @__PURE__ */ (0,
|
|
7179
|
+
(0, import_react28.useEffect)(() => () => window.clearTimeout(closeTimer.current), []);
|
|
7180
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(Popover, { open, onOpenChange: setOpen, children: [
|
|
7181
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
6862
7182
|
PopoverTrigger,
|
|
6863
7183
|
{
|
|
6864
|
-
render: /* @__PURE__ */ (0,
|
|
7184
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
6865
7185
|
"button",
|
|
6866
7186
|
{
|
|
6867
7187
|
type: "button",
|
|
@@ -6879,7 +7199,7 @@ function CollapsedGroupFlyout({
|
|
|
6879
7199
|
)
|
|
6880
7200
|
}
|
|
6881
7201
|
),
|
|
6882
|
-
/* @__PURE__ */ (0,
|
|
7202
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(
|
|
6883
7203
|
PopoverContent,
|
|
6884
7204
|
{
|
|
6885
7205
|
"data-slot": "menu-flyout",
|
|
@@ -6896,8 +7216,8 @@ function CollapsedGroupFlyout({
|
|
|
6896
7216
|
}
|
|
6897
7217
|
},
|
|
6898
7218
|
children: [
|
|
6899
|
-
/* @__PURE__ */ (0,
|
|
6900
|
-
/* @__PURE__ */ (0,
|
|
7219
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { className: "px-3 pt-2 pb-1 text-xs font-semibold text-muted-foreground", children: menu.title }),
|
|
7220
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
6901
7221
|
MenuTree,
|
|
6902
7222
|
{
|
|
6903
7223
|
menus: menu.children ?? [],
|
|
@@ -6921,9 +7241,9 @@ function MenuTree({
|
|
|
6921
7241
|
collapsed = false
|
|
6922
7242
|
}) {
|
|
6923
7243
|
if (collapsed) {
|
|
6924
|
-
return /* @__PURE__ */ (0,
|
|
7244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { "data-slot": "menu", "data-collapsed": "true", className: "flex flex-col gap-1", children: menus.map((menu) => {
|
|
6925
7245
|
if (menu.type === "group") {
|
|
6926
|
-
return /* @__PURE__ */ (0,
|
|
7246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
6927
7247
|
CollapsedGroupFlyout,
|
|
6928
7248
|
{
|
|
6929
7249
|
menu,
|
|
@@ -6935,7 +7255,7 @@ function MenuTree({
|
|
|
6935
7255
|
menu.id
|
|
6936
7256
|
);
|
|
6937
7257
|
}
|
|
6938
|
-
return /* @__PURE__ */ (0,
|
|
7258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
6939
7259
|
"button",
|
|
6940
7260
|
{
|
|
6941
7261
|
type: "button",
|
|
@@ -6944,7 +7264,7 @@ function MenuTree({
|
|
|
6944
7264
|
className: cn(
|
|
6945
7265
|
menuItemClass2,
|
|
6946
7266
|
"mx-auto size-10 justify-center px-0 font-semibold",
|
|
6947
|
-
menu.id === activeMenuId && "bg-
|
|
7267
|
+
menu.id === activeMenuId && "bg-(--menu-active-background) font-semibold text-(--menu-active-foreground)"
|
|
6948
7268
|
),
|
|
6949
7269
|
disabled: menu.disabled,
|
|
6950
7270
|
title: menu.title,
|
|
@@ -6955,7 +7275,7 @@ function MenuTree({
|
|
|
6955
7275
|
);
|
|
6956
7276
|
}) });
|
|
6957
7277
|
}
|
|
6958
|
-
return /* @__PURE__ */ (0,
|
|
7278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
6959
7279
|
Accordion,
|
|
6960
7280
|
{
|
|
6961
7281
|
type: "multiple",
|
|
@@ -6964,27 +7284,27 @@ function MenuTree({
|
|
|
6964
7284
|
className: "flex flex-col gap-0.5 px-2",
|
|
6965
7285
|
children: menus.map((menu) => {
|
|
6966
7286
|
if (menu.type === "group") {
|
|
6967
|
-
return /* @__PURE__ */ (0,
|
|
7287
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(
|
|
6968
7288
|
AccordionItem,
|
|
6969
7289
|
{
|
|
6970
7290
|
value: menu.id,
|
|
6971
7291
|
"data-slot": "menu-group",
|
|
6972
7292
|
className: "border-b-0",
|
|
6973
7293
|
children: [
|
|
6974
|
-
/* @__PURE__ */ (0,
|
|
7294
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
6975
7295
|
AccordionTrigger,
|
|
6976
7296
|
{
|
|
6977
7297
|
"data-slot": "menu-group-trigger",
|
|
6978
7298
|
className: cn(menuItemClass2, "py-2 font-medium"),
|
|
6979
7299
|
disabled: menu.disabled,
|
|
6980
7300
|
title: menu.title,
|
|
6981
|
-
children: /* @__PURE__ */ (0,
|
|
6982
|
-
menu.icon ? /* @__PURE__ */ (0,
|
|
7301
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("span", { className: "inline-flex items-center gap-2", children: [
|
|
7302
|
+
menu.icon ? /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(Icon, { name: menu.icon, size: "sm" }) : null,
|
|
6983
7303
|
menu.title
|
|
6984
7304
|
] })
|
|
6985
7305
|
}
|
|
6986
7306
|
),
|
|
6987
|
-
/* @__PURE__ */ (0,
|
|
7307
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(AccordionContent, { "data-slot": "menu-group-content", className: "pb-1", children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { className: "flex flex-col gap-0.5 pl-3", children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
6988
7308
|
MenuTree,
|
|
6989
7309
|
{
|
|
6990
7310
|
menus: menu.children ?? [],
|
|
@@ -6999,7 +7319,7 @@ function MenuTree({
|
|
|
6999
7319
|
menu.id
|
|
7000
7320
|
);
|
|
7001
7321
|
}
|
|
7002
|
-
return /* @__PURE__ */ (0,
|
|
7322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(
|
|
7003
7323
|
"button",
|
|
7004
7324
|
{
|
|
7005
7325
|
type: "button",
|
|
@@ -7007,13 +7327,13 @@ function MenuTree({
|
|
|
7007
7327
|
"data-active": menu.id === activeMenuId || void 0,
|
|
7008
7328
|
className: cn(
|
|
7009
7329
|
menuItemClass2,
|
|
7010
|
-
menu.id === activeMenuId && "bg-
|
|
7330
|
+
menu.id === activeMenuId && "bg-(--menu-active-background) font-semibold text-(--menu-active-foreground)"
|
|
7011
7331
|
),
|
|
7012
7332
|
disabled: menu.disabled,
|
|
7013
7333
|
title: menu.title,
|
|
7014
7334
|
onClick: () => navigateMenuItem(registry.findById(menu.id), bridge),
|
|
7015
7335
|
children: [
|
|
7016
|
-
menu.icon ? /* @__PURE__ */ (0,
|
|
7336
|
+
menu.icon ? /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(Icon, { name: menu.icon, size: "sm" }) : null,
|
|
7017
7337
|
menu.title
|
|
7018
7338
|
]
|
|
7019
7339
|
},
|
|
@@ -7040,16 +7360,16 @@ function AdminLayout({
|
|
|
7040
7360
|
const showTabs = config.tabs ?? false;
|
|
7041
7361
|
const showBreadcrumb = config.breadcrumb ?? false;
|
|
7042
7362
|
const showFooter = config.footer ?? false;
|
|
7043
|
-
const [collapsed, setCollapsed] = (0,
|
|
7363
|
+
const [collapsed, setCollapsed] = (0, import_react28.useState)(config.collapsed ?? false);
|
|
7044
7364
|
const broken = useBreakpointBelow(config.breakpoint);
|
|
7045
7365
|
const effectiveCollapsed = collapsed || broken;
|
|
7046
|
-
const [bridgeRoute, setBridgeRoute] = (0,
|
|
7366
|
+
const [bridgeRoute, setBridgeRoute] = (0, import_react28.useState)(
|
|
7047
7367
|
() => (0, import_router.resolveRoute)(registry, bridge.getLocation())
|
|
7048
7368
|
);
|
|
7049
|
-
const [tabs, setTabs] = (0,
|
|
7050
|
-
const tabsRef = (0,
|
|
7369
|
+
const [tabs, setTabs] = (0, import_react28.useState)([]);
|
|
7370
|
+
const tabsRef = (0, import_react28.useRef)(tabs);
|
|
7051
7371
|
tabsRef.current = tabs;
|
|
7052
|
-
(0,
|
|
7372
|
+
(0, import_react28.useEffect)(() => {
|
|
7053
7373
|
const handleLocation = (location) => {
|
|
7054
7374
|
const next = (0, import_router.resolveRoute)(registry, location);
|
|
7055
7375
|
setBridgeRoute(next);
|
|
@@ -7070,16 +7390,16 @@ function AdminLayout({
|
|
|
7070
7390
|
}, [registry, bridge]);
|
|
7071
7391
|
const route = routeProp ?? bridgeRoute;
|
|
7072
7392
|
const activeMenuId = route?.activeMenu;
|
|
7073
|
-
const visibleMenus = (0,
|
|
7393
|
+
const visibleMenus = (0, import_react28.useMemo)(
|
|
7074
7394
|
() => buildVisibleMenuTree(registry, permissionChecker),
|
|
7075
7395
|
[registry, permissionChecker]
|
|
7076
7396
|
);
|
|
7077
|
-
const defaultOpenKeysRef = (0,
|
|
7397
|
+
const defaultOpenKeysRef = (0, import_react28.useRef)(null);
|
|
7078
7398
|
if (defaultOpenKeysRef.current === null) {
|
|
7079
7399
|
defaultOpenKeysRef.current = collectDefaultOpenKeys(registry, activeMenuId);
|
|
7080
7400
|
}
|
|
7081
7401
|
const defaultOpenKeys = defaultOpenKeysRef.current;
|
|
7082
|
-
const activeTopId = (0,
|
|
7402
|
+
const activeTopId = (0, import_react28.useMemo)(() => {
|
|
7083
7403
|
if (activeMenuId !== void 0) {
|
|
7084
7404
|
const chain = findMenuChain(registry, activeMenuId);
|
|
7085
7405
|
if (chain.length > 0) {
|
|
@@ -7088,11 +7408,11 @@ function AdminLayout({
|
|
|
7088
7408
|
}
|
|
7089
7409
|
return void 0;
|
|
7090
7410
|
}, [registry, activeMenuId]);
|
|
7091
|
-
const [selectedTopId, setSelectedTopId] = (0,
|
|
7411
|
+
const [selectedTopId, setSelectedTopId] = (0, import_react28.useState)();
|
|
7092
7412
|
const secondaryTopId = selectedTopId ?? activeTopId ?? visibleMenus.find((m) => m.type === "group")?.id ?? visibleMenus[0]?.id;
|
|
7093
7413
|
const secondaryTop = visibleMenus.find((m) => m.id === secondaryTopId);
|
|
7094
7414
|
const hasSecondary = (secondaryTop?.children?.length ?? 0) > 0;
|
|
7095
|
-
const breadcrumbItems = (0,
|
|
7415
|
+
const breadcrumbItems = (0, import_react28.useMemo)(() => {
|
|
7096
7416
|
if (!showBreadcrumb || activeMenuId === void 0) {
|
|
7097
7417
|
return [];
|
|
7098
7418
|
}
|
|
@@ -7108,30 +7428,30 @@ function AdminLayout({
|
|
|
7108
7428
|
};
|
|
7109
7429
|
const fixedHeader = config.fixedHeader ?? true;
|
|
7110
7430
|
const fixedSider = config.fixedSider ?? true;
|
|
7111
|
-
const header = showHeader ? /* @__PURE__ */ (0,
|
|
7431
|
+
const header = showHeader ? /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(
|
|
7112
7432
|
"header",
|
|
7113
7433
|
{
|
|
7114
7434
|
"data-slot": "admin-header",
|
|
7115
7435
|
className: cn(
|
|
7116
|
-
"flex h-14 items-center gap-4 border-b border-border bg-
|
|
7436
|
+
"flex h-14 items-center gap-4 border-b border-border bg-card px-6",
|
|
7117
7437
|
fixedHeader && "sticky top-0 z-20"
|
|
7118
7438
|
),
|
|
7119
7439
|
children: [
|
|
7120
|
-
mode !== "side-full" && /* @__PURE__ */ (0,
|
|
7440
|
+
mode !== "side-full" && /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_jsx_runtime128.Fragment, { children: [
|
|
7121
7441
|
brand.logo,
|
|
7122
|
-
/* @__PURE__ */ (0,
|
|
7442
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("span", { "data-slot": "admin-brand", className: "text-lg font-semibold", children: brand.title })
|
|
7123
7443
|
] }),
|
|
7124
|
-
/* @__PURE__ */ (0,
|
|
7444
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { className: "flex-1" }),
|
|
7125
7445
|
headerExtra
|
|
7126
7446
|
]
|
|
7127
7447
|
}
|
|
7128
7448
|
) : null;
|
|
7129
|
-
const primaryColumn = /* @__PURE__ */ (0,
|
|
7449
|
+
const primaryColumn = /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
7130
7450
|
"div",
|
|
7131
7451
|
{
|
|
7132
7452
|
"data-slot": "admin-primary-col",
|
|
7133
7453
|
className: "flex w-12 shrink-0 flex-col items-center gap-1 border-r border-border py-2",
|
|
7134
|
-
children: visibleMenus.map((menu) => /* @__PURE__ */ (0,
|
|
7454
|
+
children: visibleMenus.map((menu) => /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
7135
7455
|
"button",
|
|
7136
7456
|
{
|
|
7137
7457
|
type: "button",
|
|
@@ -7140,7 +7460,7 @@ function AdminLayout({
|
|
|
7140
7460
|
className: cn(
|
|
7141
7461
|
menuItemClass2,
|
|
7142
7462
|
"size-10 justify-center px-0 font-semibold",
|
|
7143
|
-
(menu.id === secondaryTopId || menu.id === activeTopId) && "bg-
|
|
7463
|
+
(menu.id === secondaryTopId || menu.id === activeTopId) && "bg-(--menu-active-background) text-(--menu-active-foreground)"
|
|
7144
7464
|
),
|
|
7145
7465
|
disabled: menu.disabled,
|
|
7146
7466
|
title: menu.title,
|
|
@@ -7158,32 +7478,32 @@ function AdminLayout({
|
|
|
7158
7478
|
}
|
|
7159
7479
|
);
|
|
7160
7480
|
const showTrigger = config.collapsible && mode !== "two-column";
|
|
7161
|
-
const sidebar = showSidebar ? /* @__PURE__ */ (0,
|
|
7481
|
+
const sidebar = showSidebar ? /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(
|
|
7162
7482
|
"aside",
|
|
7163
7483
|
{
|
|
7164
7484
|
"data-slot": "admin-sidebar",
|
|
7165
7485
|
"data-collapsed": effectiveCollapsed || void 0,
|
|
7166
7486
|
className: cn(
|
|
7167
|
-
"shrink-0 overflow-auto border-r border-border bg-
|
|
7487
|
+
"shrink-0 overflow-auto border-r border-border bg-sidebar py-2",
|
|
7168
7488
|
effectiveCollapsed ? "w-16 px-1.5" : "w-52",
|
|
7169
7489
|
fixedSider && (mode === "side-full" ? "sticky top-0 h-screen" : "sticky top-14 h-[calc(100vh-3.5rem)]")
|
|
7170
7490
|
),
|
|
7171
7491
|
style: mode === "two-column" && !hasSecondary ? { width: 56 } : void 0,
|
|
7172
7492
|
children: [
|
|
7173
|
-
mode === "side-full" && /* @__PURE__ */ (0,
|
|
7493
|
+
mode === "side-full" && /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(
|
|
7174
7494
|
"div",
|
|
7175
7495
|
{
|
|
7176
7496
|
"data-slot": "admin-sidebar-brand",
|
|
7177
7497
|
className: "flex items-center gap-2 border-b border-border px-4 py-4 font-semibold",
|
|
7178
7498
|
children: [
|
|
7179
7499
|
brand.logo,
|
|
7180
|
-
/* @__PURE__ */ (0,
|
|
7500
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("span", { children: brand.title })
|
|
7181
7501
|
]
|
|
7182
7502
|
}
|
|
7183
7503
|
),
|
|
7184
|
-
mode === "two-column" ? /* @__PURE__ */ (0,
|
|
7504
|
+
mode === "two-column" ? /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { "data-slot": "admin-two-col", className: "flex h-full", children: [
|
|
7185
7505
|
primaryColumn,
|
|
7186
|
-
hasSecondary && /* @__PURE__ */ (0,
|
|
7506
|
+
hasSecondary && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { "data-slot": "admin-secondary-col", className: "min-w-0 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
7187
7507
|
MenuTree,
|
|
7188
7508
|
{
|
|
7189
7509
|
menus: secondaryTop?.children ?? [],
|
|
@@ -7193,7 +7513,7 @@ function AdminLayout({
|
|
|
7193
7513
|
defaultOpenKeys
|
|
7194
7514
|
}
|
|
7195
7515
|
) })
|
|
7196
|
-
] }) : /* @__PURE__ */ (0,
|
|
7516
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
7197
7517
|
MenuTree,
|
|
7198
7518
|
{
|
|
7199
7519
|
menus: visibleMenus,
|
|
@@ -7204,14 +7524,14 @@ function AdminLayout({
|
|
|
7204
7524
|
collapsed: effectiveCollapsed
|
|
7205
7525
|
}
|
|
7206
7526
|
),
|
|
7207
|
-
showTrigger && /* @__PURE__ */ (0,
|
|
7527
|
+
showTrigger && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
7208
7528
|
"button",
|
|
7209
7529
|
{
|
|
7210
7530
|
type: "button",
|
|
7211
7531
|
"data-slot": "admin-collapse-trigger",
|
|
7212
7532
|
"aria-label": effectiveCollapsed ? t("pactor.layout.expandSidebar") : t("pactor.layout.collapseSidebar"),
|
|
7213
7533
|
"aria-expanded": !effectiveCollapsed,
|
|
7214
|
-
className: "sticky bottom-0 flex w-full cursor-pointer items-center justify-center border-t border-border bg-
|
|
7534
|
+
className: "sticky bottom-0 flex w-full cursor-pointer items-center justify-center border-t border-border bg-sidebar py-2 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
|
|
7215
7535
|
onClick: () => setCollapsed((value) => !value),
|
|
7216
7536
|
children: effectiveCollapsed ? "\xBB" : "\xAB"
|
|
7217
7537
|
}
|
|
@@ -7219,14 +7539,14 @@ function AdminLayout({
|
|
|
7219
7539
|
]
|
|
7220
7540
|
}
|
|
7221
7541
|
) : null;
|
|
7222
|
-
const body = /* @__PURE__ */ (0,
|
|
7223
|
-
showTabs && /* @__PURE__ */ (0,
|
|
7542
|
+
const body = /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { "data-slot": "admin-body", className: "flex min-w-0 flex-1 flex-col", children: [
|
|
7543
|
+
showTabs && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
7224
7544
|
"div",
|
|
7225
7545
|
{
|
|
7226
7546
|
"data-slot": "admin-tabs",
|
|
7227
7547
|
role: "tablist",
|
|
7228
|
-
className: "flex items-center gap-1 border-b border-border bg-
|
|
7229
|
-
children: tabs.map((tab, index) => /* @__PURE__ */ (0,
|
|
7548
|
+
className: "flex items-center gap-1 border-b border-border bg-card px-4 pt-2",
|
|
7549
|
+
children: tabs.map((tab, index) => /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(
|
|
7230
7550
|
"div",
|
|
7231
7551
|
{
|
|
7232
7552
|
"data-slot": "admin-tab",
|
|
@@ -7234,10 +7554,10 @@ function AdminLayout({
|
|
|
7234
7554
|
role: "presentation",
|
|
7235
7555
|
className: cn(
|
|
7236
7556
|
"inline-flex items-center gap-1 rounded-t-md border border-b-0 border-border px-3 py-1.5 text-sm",
|
|
7237
|
-
tab.key === currentPath ? "bg-
|
|
7557
|
+
tab.key === currentPath ? "bg-card font-medium text-foreground" : "bg-muted text-muted-foreground"
|
|
7238
7558
|
),
|
|
7239
7559
|
children: [
|
|
7240
|
-
/* @__PURE__ */ (0,
|
|
7560
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
7241
7561
|
"button",
|
|
7242
7562
|
{
|
|
7243
7563
|
type: "button",
|
|
@@ -7248,7 +7568,7 @@ function AdminLayout({
|
|
|
7248
7568
|
children: tab.title
|
|
7249
7569
|
}
|
|
7250
7570
|
),
|
|
7251
|
-
index > 0 && /* @__PURE__ */ (0,
|
|
7571
|
+
index > 0 && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
7252
7572
|
"button",
|
|
7253
7573
|
{
|
|
7254
7574
|
type: "button",
|
|
@@ -7265,21 +7585,21 @@ function AdminLayout({
|
|
|
7265
7585
|
))
|
|
7266
7586
|
}
|
|
7267
7587
|
),
|
|
7268
|
-
/* @__PURE__ */ (0,
|
|
7588
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(
|
|
7269
7589
|
"main",
|
|
7270
7590
|
{
|
|
7271
7591
|
"data-slot": "admin-content",
|
|
7272
7592
|
className: "flex-1 bg-muted/40 p-6",
|
|
7273
7593
|
children: [
|
|
7274
|
-
showBreadcrumb && breadcrumbItems.length > 0 && /* @__PURE__ */ (0,
|
|
7594
|
+
showBreadcrumb && breadcrumbItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
7275
7595
|
"nav",
|
|
7276
7596
|
{
|
|
7277
7597
|
"data-slot": "admin-breadcrumb",
|
|
7278
7598
|
"aria-label": t("pactor.layout.breadcrumb"),
|
|
7279
7599
|
className: "mb-4",
|
|
7280
|
-
children: /* @__PURE__ */ (0,
|
|
7281
|
-
index > 0 && /* @__PURE__ */ (0,
|
|
7282
|
-
/* @__PURE__ */ (0,
|
|
7600
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("ol", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: breadcrumbItems.map((title, index) => /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("li", { className: "flex items-center gap-2", children: [
|
|
7601
|
+
index > 0 && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("span", { "aria-hidden": true, children: "/" }),
|
|
7602
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("span", { "data-slot": "breadcrumb-link", children: title })
|
|
7283
7603
|
] }, index)) })
|
|
7284
7604
|
}
|
|
7285
7605
|
),
|
|
@@ -7288,7 +7608,7 @@ function AdminLayout({
|
|
|
7288
7608
|
}
|
|
7289
7609
|
)
|
|
7290
7610
|
] });
|
|
7291
|
-
const footer = showFooter ? /* @__PURE__ */ (0,
|
|
7611
|
+
const footer = showFooter ? /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
7292
7612
|
"footer",
|
|
7293
7613
|
{
|
|
7294
7614
|
"data-slot": "admin-footer",
|
|
@@ -7296,7 +7616,7 @@ function AdminLayout({
|
|
|
7296
7616
|
children: brand.title
|
|
7297
7617
|
}
|
|
7298
7618
|
) : null;
|
|
7299
|
-
return /* @__PURE__ */ (0,
|
|
7619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
7300
7620
|
"div",
|
|
7301
7621
|
{
|
|
7302
7622
|
"data-slot": "admin-layout",
|
|
@@ -7304,9 +7624,9 @@ function AdminLayout({
|
|
|
7304
7624
|
"data-fixed-header": fixedHeader || void 0,
|
|
7305
7625
|
"data-fixed-sider": fixedSider || void 0,
|
|
7306
7626
|
className: "flex min-h-screen flex-col bg-background text-foreground",
|
|
7307
|
-
children: mode === "side-full" ? /* @__PURE__ */ (0,
|
|
7627
|
+
children: mode === "side-full" ? /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { "data-slot": "admin-side-full", className: "flex min-h-screen flex-1", children: [
|
|
7308
7628
|
sidebar,
|
|
7309
|
-
/* @__PURE__ */ (0,
|
|
7629
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(
|
|
7310
7630
|
"div",
|
|
7311
7631
|
{
|
|
7312
7632
|
"data-slot": "admin-side-full-main",
|
|
@@ -7318,9 +7638,9 @@ function AdminLayout({
|
|
|
7318
7638
|
]
|
|
7319
7639
|
}
|
|
7320
7640
|
)
|
|
7321
|
-
] }) : /* @__PURE__ */ (0,
|
|
7641
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_jsx_runtime128.Fragment, { children: [
|
|
7322
7642
|
header,
|
|
7323
|
-
/* @__PURE__ */ (0,
|
|
7643
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { "data-slot": "admin-main", className: "flex min-h-0 flex-1", children: [
|
|
7324
7644
|
sidebar,
|
|
7325
7645
|
body
|
|
7326
7646
|
] }),
|
|
@@ -7331,9 +7651,9 @@ function AdminLayout({
|
|
|
7331
7651
|
}
|
|
7332
7652
|
|
|
7333
7653
|
// src/layout/basic/BlankLayout.tsx
|
|
7334
|
-
var
|
|
7654
|
+
var import_jsx_runtime129 = require("react/jsx-runtime");
|
|
7335
7655
|
function BlankLayout({ children }) {
|
|
7336
|
-
return /* @__PURE__ */ (0,
|
|
7656
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
7337
7657
|
"div",
|
|
7338
7658
|
{
|
|
7339
7659
|
"data-slot": "blank-layout",
|
|
@@ -7345,8 +7665,8 @@ function BlankLayout({ children }) {
|
|
|
7345
7665
|
|
|
7346
7666
|
// src/layout/chat/ChatLayout.tsx
|
|
7347
7667
|
var import_permission2 = require("@pactor-app/permission");
|
|
7348
|
-
var
|
|
7349
|
-
var
|
|
7668
|
+
var import_react29 = require("react");
|
|
7669
|
+
var import_jsx_runtime130 = require("react/jsx-runtime");
|
|
7350
7670
|
function ChatLayout({
|
|
7351
7671
|
brand,
|
|
7352
7672
|
menu,
|
|
@@ -7361,7 +7681,7 @@ function ChatLayout({
|
|
|
7361
7681
|
sidebarFooter,
|
|
7362
7682
|
children
|
|
7363
7683
|
}) {
|
|
7364
|
-
const registryMenus = (0,
|
|
7684
|
+
const registryMenus = (0, import_react29.useMemo)(() => {
|
|
7365
7685
|
if (menu !== void 0 || registry === void 0) {
|
|
7366
7686
|
return [];
|
|
7367
7687
|
}
|
|
@@ -7370,10 +7690,10 @@ function ChatLayout({
|
|
|
7370
7690
|
return visible.flatMap((item) => menuItemToMenuData(item));
|
|
7371
7691
|
}, [menu, registry, permissionChecker]);
|
|
7372
7692
|
const menuItems = menu ?? registryMenus;
|
|
7373
|
-
const [bridgePath, setBridgePath] = (0,
|
|
7693
|
+
const [bridgePath, setBridgePath] = (0, import_react29.useState)(
|
|
7374
7694
|
() => bridge?.getLocation().pathname ?? "/"
|
|
7375
7695
|
);
|
|
7376
|
-
(0,
|
|
7696
|
+
(0, import_react29.useEffect)(() => {
|
|
7377
7697
|
if (bridge === void 0) {
|
|
7378
7698
|
return;
|
|
7379
7699
|
}
|
|
@@ -7381,7 +7701,7 @@ function ChatLayout({
|
|
|
7381
7701
|
setBridgePath(location.pathname);
|
|
7382
7702
|
});
|
|
7383
7703
|
}, [bridge]);
|
|
7384
|
-
const activeKey = (0,
|
|
7704
|
+
const activeKey = (0, import_react29.useMemo)(() => {
|
|
7385
7705
|
if (activeMenuKey !== void 0) {
|
|
7386
7706
|
return activeMenuKey;
|
|
7387
7707
|
}
|
|
@@ -7401,7 +7721,7 @@ function ChatLayout({
|
|
|
7401
7721
|
bridge.push(item.path);
|
|
7402
7722
|
}
|
|
7403
7723
|
};
|
|
7404
|
-
const sidebarContent = sidebar !== void 0 && sidebar !== null ? sidebar : menuItems.length > 0 ? /* @__PURE__ */ (0,
|
|
7724
|
+
const sidebarContent = sidebar !== void 0 && sidebar !== null ? sidebar : menuItems.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
7405
7725
|
Menu2,
|
|
7406
7726
|
{
|
|
7407
7727
|
items: menuItems.map((item) => chatMenuItemToUiMenuItem(item)),
|
|
@@ -7409,7 +7729,7 @@ function ChatLayout({
|
|
|
7409
7729
|
onSelect: handleSelect
|
|
7410
7730
|
}
|
|
7411
7731
|
) : void 0;
|
|
7412
|
-
return /* @__PURE__ */ (0,
|
|
7732
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
7413
7733
|
Sidebar,
|
|
7414
7734
|
{
|
|
7415
7735
|
brand,
|
|
@@ -7417,7 +7737,7 @@ function ChatLayout({
|
|
|
7417
7737
|
sidebarFooter,
|
|
7418
7738
|
collapsible,
|
|
7419
7739
|
locationKey: routeProp?.path ?? bridgePath,
|
|
7420
|
-
children: /* @__PURE__ */ (0,
|
|
7740
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
7421
7741
|
"div",
|
|
7422
7742
|
{
|
|
7423
7743
|
"data-slot": "chat-layout-content",
|
|
@@ -7471,26 +7791,26 @@ function menuItemToMenuData(item) {
|
|
|
7471
7791
|
}
|
|
7472
7792
|
|
|
7473
7793
|
// src/layout/basic/LoginLayout.tsx
|
|
7474
|
-
var
|
|
7794
|
+
var import_jsx_runtime131 = require("react/jsx-runtime");
|
|
7475
7795
|
function LoginLayout({
|
|
7476
7796
|
variant = "center",
|
|
7477
7797
|
brand,
|
|
7478
7798
|
children
|
|
7479
7799
|
}) {
|
|
7480
|
-
const brandBlock = /* @__PURE__ */ (0,
|
|
7800
|
+
const brandBlock = /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { "data-slot": "login-brand", className: "flex flex-col items-center gap-2", children: [
|
|
7481
7801
|
brand.logo,
|
|
7482
|
-
/* @__PURE__ */ (0,
|
|
7483
|
-
brand.description !== void 0 && /* @__PURE__ */ (0,
|
|
7802
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("h1", { className: "text-xl font-semibold", children: brand.title }),
|
|
7803
|
+
brand.description !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "text-sm text-muted-foreground", children: brand.description })
|
|
7484
7804
|
] });
|
|
7485
7805
|
if (variant === "split") {
|
|
7486
|
-
return /* @__PURE__ */ (0,
|
|
7806
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
7487
7807
|
"div",
|
|
7488
7808
|
{
|
|
7489
7809
|
"data-slot": "login-layout",
|
|
7490
7810
|
"data-variant": "split",
|
|
7491
7811
|
className: "grid min-h-screen grid-cols-2 bg-background text-foreground",
|
|
7492
7812
|
children: [
|
|
7493
|
-
/* @__PURE__ */ (0,
|
|
7813
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
7494
7814
|
"div",
|
|
7495
7815
|
{
|
|
7496
7816
|
"data-slot": "login-brand-panel",
|
|
@@ -7498,7 +7818,7 @@ function LoginLayout({
|
|
|
7498
7818
|
children: brandBlock
|
|
7499
7819
|
}
|
|
7500
7820
|
),
|
|
7501
|
-
/* @__PURE__ */ (0,
|
|
7821
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
7502
7822
|
"div",
|
|
7503
7823
|
{
|
|
7504
7824
|
"data-slot": "login-form-panel",
|
|
@@ -7510,46 +7830,46 @@ function LoginLayout({
|
|
|
7510
7830
|
}
|
|
7511
7831
|
);
|
|
7512
7832
|
}
|
|
7513
|
-
return /* @__PURE__ */ (0,
|
|
7833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
7514
7834
|
"div",
|
|
7515
7835
|
{
|
|
7516
7836
|
"data-slot": "login-layout",
|
|
7517
7837
|
"data-variant": "center",
|
|
7518
7838
|
className: "flex min-h-screen items-center justify-center bg-muted/40 text-foreground",
|
|
7519
|
-
children: /* @__PURE__ */ (0,
|
|
7520
|
-
/* @__PURE__ */ (0,
|
|
7521
|
-
/* @__PURE__ */ (0,
|
|
7839
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(Card, { "data-slot": "login-card", className: "w-full max-w-sm gap-4 py-6", children: [
|
|
7840
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(CardHeader, { className: "px-6", children: [
|
|
7841
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(CardTitle, { className: "sr-only", children: brand.title }),
|
|
7522
7842
|
brandBlock
|
|
7523
7843
|
] }),
|
|
7524
|
-
/* @__PURE__ */ (0,
|
|
7844
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(CardContent, { className: "flex flex-col gap-4 px-6", children })
|
|
7525
7845
|
] })
|
|
7526
7846
|
}
|
|
7527
7847
|
);
|
|
7528
7848
|
}
|
|
7529
7849
|
|
|
7530
7850
|
// src/layout/basic/LandingLayout.tsx
|
|
7531
|
-
var
|
|
7851
|
+
var import_jsx_runtime132 = require("react/jsx-runtime");
|
|
7532
7852
|
function LandingLayout({
|
|
7533
7853
|
navbar,
|
|
7534
7854
|
footer,
|
|
7535
7855
|
children
|
|
7536
7856
|
}) {
|
|
7537
|
-
return /* @__PURE__ */ (0,
|
|
7857
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(
|
|
7538
7858
|
"div",
|
|
7539
7859
|
{
|
|
7540
7860
|
"data-slot": "landing-layout",
|
|
7541
7861
|
className: "flex min-h-screen flex-col bg-background text-foreground",
|
|
7542
7862
|
children: [
|
|
7543
|
-
navbar !== void 0 && /* @__PURE__ */ (0,
|
|
7863
|
+
navbar !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
7544
7864
|
"header",
|
|
7545
7865
|
{
|
|
7546
7866
|
"data-slot": "landing-navbar",
|
|
7547
|
-
className: "border-b border-border bg-
|
|
7867
|
+
className: "border-b border-border bg-card",
|
|
7548
7868
|
children: navbar
|
|
7549
7869
|
}
|
|
7550
7870
|
),
|
|
7551
|
-
/* @__PURE__ */ (0,
|
|
7552
|
-
footer !== void 0 && /* @__PURE__ */ (0,
|
|
7871
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("main", { "data-slot": "landing-content", className: "flex-1", children }),
|
|
7872
|
+
footer !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
7553
7873
|
"footer",
|
|
7554
7874
|
{
|
|
7555
7875
|
"data-slot": "landing-footer",
|
|
@@ -7756,9 +8076,9 @@ function isRecord(value) {
|
|
|
7756
8076
|
|
|
7757
8077
|
// src/interaction/provider.tsx
|
|
7758
8078
|
var import_runtime22 = require("@pactor-app/runtime");
|
|
7759
|
-
var
|
|
8079
|
+
var import_react30 = require("react");
|
|
7760
8080
|
var import_react_dom = require("react-dom");
|
|
7761
|
-
var
|
|
8081
|
+
var import_jsx_runtime133 = require("react/jsx-runtime");
|
|
7762
8082
|
var TOAST_DURATION = 3e3;
|
|
7763
8083
|
var toastTypeClass = {
|
|
7764
8084
|
success: "border-l-4 border-l-success",
|
|
@@ -7770,10 +8090,10 @@ function InteractionProvider({
|
|
|
7770
8090
|
bridge,
|
|
7771
8091
|
children
|
|
7772
8092
|
}) {
|
|
7773
|
-
const [confirmState, setConfirmState] = (0,
|
|
7774
|
-
const [toasts, setToasts] = (0,
|
|
8093
|
+
const [confirmState, setConfirmState] = (0, import_react30.useState)(null);
|
|
8094
|
+
const [toasts, setToasts] = (0, import_react30.useState)([]);
|
|
7775
8095
|
const { t } = (0, import_runtime22.useI18n)();
|
|
7776
|
-
const { modal, message } = (0,
|
|
8096
|
+
const { modal, message } = (0, import_react30.useMemo)(() => {
|
|
7777
8097
|
const pushToast = (type, content) => {
|
|
7778
8098
|
const id = Date.now() + Math.random();
|
|
7779
8099
|
setToasts((prev) => [...prev, { id, type, content }]);
|
|
@@ -7794,7 +8114,7 @@ function InteractionProvider({
|
|
|
7794
8114
|
};
|
|
7795
8115
|
return { modal: modalImpl, message: messageImpl };
|
|
7796
8116
|
}, []);
|
|
7797
|
-
(0,
|
|
8117
|
+
(0, import_react30.useEffect)(() => {
|
|
7798
8118
|
bridge.modal = modal;
|
|
7799
8119
|
bridge.message = message;
|
|
7800
8120
|
return () => {
|
|
@@ -7812,11 +8132,11 @@ function InteractionProvider({
|
|
|
7812
8132
|
setConfirmState(null);
|
|
7813
8133
|
state?.onCancel?.();
|
|
7814
8134
|
};
|
|
7815
|
-
return /* @__PURE__ */ (0,
|
|
8135
|
+
return /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(import_jsx_runtime133.Fragment, { children: [
|
|
7816
8136
|
children,
|
|
7817
8137
|
typeof document !== "undefined" && (0, import_react_dom.createPortal)(
|
|
7818
|
-
/* @__PURE__ */ (0,
|
|
7819
|
-
/* @__PURE__ */ (0,
|
|
8138
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(import_jsx_runtime133.Fragment, { children: [
|
|
8139
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
7820
8140
|
Dialog,
|
|
7821
8141
|
{
|
|
7822
8142
|
open: confirmState !== null,
|
|
@@ -7825,29 +8145,29 @@ function InteractionProvider({
|
|
|
7825
8145
|
handleCancel();
|
|
7826
8146
|
}
|
|
7827
8147
|
},
|
|
7828
|
-
children: /* @__PURE__ */ (0,
|
|
7829
|
-
/* @__PURE__ */ (0,
|
|
7830
|
-
/* @__PURE__ */ (0,
|
|
7831
|
-
confirmState?.content !== void 0 && /* @__PURE__ */ (0,
|
|
8148
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(DialogContent, { "data-slot": "confirm-dialog", className: "sm:max-w-sm", children: [
|
|
8149
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(DialogHeader, { children: [
|
|
8150
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(DialogTitle, { children: confirmState?.title ?? "" }),
|
|
8151
|
+
confirmState?.content !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
7832
8152
|
DialogDescription,
|
|
7833
8153
|
{
|
|
7834
|
-
render: /* @__PURE__ */ (0,
|
|
8154
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("div", { children: confirmState.content })
|
|
7835
8155
|
}
|
|
7836
8156
|
)
|
|
7837
8157
|
] }),
|
|
7838
|
-
/* @__PURE__ */ (0,
|
|
7839
|
-
/* @__PURE__ */ (0,
|
|
7840
|
-
/* @__PURE__ */ (0,
|
|
8158
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(DialogFooter, { children: [
|
|
8159
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(Button, { type: "button", variant: "outline", onClick: handleCancel, children: t("pactor.alertDialog.cancel") }),
|
|
8160
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(Button, { type: "button", onClick: handleOk, children: t("pactor.alertDialog.confirm") })
|
|
7841
8161
|
] })
|
|
7842
8162
|
] })
|
|
7843
8163
|
}
|
|
7844
8164
|
),
|
|
7845
|
-
toasts.length > 0 && /* @__PURE__ */ (0,
|
|
8165
|
+
toasts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
7846
8166
|
"div",
|
|
7847
8167
|
{
|
|
7848
8168
|
"data-slot": "toast-container",
|
|
7849
8169
|
className: "fixed top-4 right-4 z-[100] flex w-80 flex-col gap-2",
|
|
7850
|
-
children: toasts.map((toast2) => /* @__PURE__ */ (0,
|
|
8170
|
+
children: toasts.map((toast2) => /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
7851
8171
|
"div",
|
|
7852
8172
|
{
|
|
7853
8173
|
"data-slot": "toast",
|
|
@@ -7872,8 +8192,8 @@ function InteractionProvider({
|
|
|
7872
8192
|
// src/interaction/host.tsx
|
|
7873
8193
|
var import_lucide_react26 = require("lucide-react");
|
|
7874
8194
|
var import_runtime23 = require("@pactor-app/runtime");
|
|
7875
|
-
var
|
|
7876
|
-
var
|
|
8195
|
+
var import_react31 = require("react");
|
|
8196
|
+
var import_jsx_runtime134 = require("react/jsx-runtime");
|
|
7877
8197
|
function toCssWidth(width) {
|
|
7878
8198
|
if (width === void 0) {
|
|
7879
8199
|
return void 0;
|
|
@@ -7882,11 +8202,11 @@ function toCssWidth(width) {
|
|
|
7882
8202
|
}
|
|
7883
8203
|
function OverlayHost({ manager, resolvePage }) {
|
|
7884
8204
|
const renderer = (0, import_runtime23.useRenderer)();
|
|
7885
|
-
const stack = (0,
|
|
8205
|
+
const stack = (0, import_react31.useSyncExternalStore)(
|
|
7886
8206
|
(onChange) => manager.subscribe(onChange),
|
|
7887
8207
|
() => manager.stack()
|
|
7888
8208
|
);
|
|
7889
|
-
(0,
|
|
8209
|
+
(0, import_react31.useSyncExternalStore)(
|
|
7890
8210
|
(onChange) => {
|
|
7891
8211
|
const offState = renderer.context.state.subscribe(onChange);
|
|
7892
8212
|
const offData = renderer.context.data.subscribe(onChange);
|
|
@@ -7897,7 +8217,7 @@ function OverlayHost({ manager, resolvePage }) {
|
|
|
7897
8217
|
},
|
|
7898
8218
|
() => `${renderer.context.state.getVersion()}:${renderer.context.data.getVersion()}`
|
|
7899
8219
|
);
|
|
7900
|
-
return /* @__PURE__ */ (0,
|
|
8220
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_jsx_runtime134.Fragment, { children: stack.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
7901
8221
|
OverlayEntryView,
|
|
7902
8222
|
{
|
|
7903
8223
|
entry,
|
|
@@ -7923,7 +8243,7 @@ function OverlayEntryView({
|
|
|
7923
8243
|
parent: manager.parentScopeOf(entry.id)
|
|
7924
8244
|
});
|
|
7925
8245
|
} else if (entry.page) {
|
|
7926
|
-
body = /* @__PURE__ */ (0,
|
|
8246
|
+
body = /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
7927
8247
|
PageOverlayBody,
|
|
7928
8248
|
{
|
|
7929
8249
|
entry,
|
|
@@ -7933,9 +8253,9 @@ function OverlayEntryView({
|
|
|
7933
8253
|
);
|
|
7934
8254
|
}
|
|
7935
8255
|
if (entry.type === "drawer") {
|
|
7936
|
-
return /* @__PURE__ */ (0,
|
|
8256
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(ShadcnDrawerView, { entry, onCancel: handleCancel, children: body });
|
|
7937
8257
|
}
|
|
7938
|
-
return /* @__PURE__ */ (0,
|
|
8258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
7939
8259
|
Dialog,
|
|
7940
8260
|
{
|
|
7941
8261
|
open: true,
|
|
@@ -7944,7 +8264,7 @@ function OverlayEntryView({
|
|
|
7944
8264
|
handleCancel();
|
|
7945
8265
|
}
|
|
7946
8266
|
},
|
|
7947
|
-
children: /* @__PURE__ */ (0,
|
|
8267
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(
|
|
7948
8268
|
DialogContent,
|
|
7949
8269
|
{
|
|
7950
8270
|
"data-slot": "overlay-modal",
|
|
@@ -7952,25 +8272,25 @@ function OverlayEntryView({
|
|
|
7952
8272
|
style: entry.width === void 0 ? void 0 : { width: toCssWidth(entry.width) },
|
|
7953
8273
|
showCloseButton: false,
|
|
7954
8274
|
children: [
|
|
7955
|
-
/* @__PURE__ */ (0,
|
|
7956
|
-
/* @__PURE__ */ (0,
|
|
7957
|
-
/* @__PURE__ */ (0,
|
|
8275
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(DialogHeader, { children: [
|
|
8276
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(DialogTitle, { children: entry.title ?? "" }),
|
|
8277
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
7958
8278
|
DialogClose,
|
|
7959
8279
|
{
|
|
7960
|
-
render: /* @__PURE__ */ (0,
|
|
8280
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
7961
8281
|
"button",
|
|
7962
8282
|
{
|
|
7963
8283
|
type: "button",
|
|
7964
8284
|
"data-slot": "overlay-modal-close",
|
|
7965
8285
|
"aria-label": t("pactor.overlay.close"),
|
|
7966
8286
|
className: "absolute top-4 right-4 cursor-pointer rounded-xs opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none",
|
|
7967
|
-
children: /* @__PURE__ */ (0,
|
|
8287
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_lucide_react26.XIcon, { className: "size-4" })
|
|
7968
8288
|
}
|
|
7969
8289
|
)
|
|
7970
8290
|
}
|
|
7971
8291
|
)
|
|
7972
8292
|
] }),
|
|
7973
|
-
/* @__PURE__ */ (0,
|
|
8293
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { "data-slot": "overlay-modal-body", children: body })
|
|
7974
8294
|
]
|
|
7975
8295
|
}
|
|
7976
8296
|
)
|
|
@@ -7984,7 +8304,7 @@ function ShadcnDrawerView({
|
|
|
7984
8304
|
}) {
|
|
7985
8305
|
const { t } = (0, import_runtime23.useI18n)();
|
|
7986
8306
|
const panelStyle = entry.width === void 0 ? void 0 : { width: toCssWidth(entry.width) };
|
|
7987
|
-
return /* @__PURE__ */ (0,
|
|
8307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
7988
8308
|
Drawer,
|
|
7989
8309
|
{
|
|
7990
8310
|
direction: "right",
|
|
@@ -7994,34 +8314,34 @@ function ShadcnDrawerView({
|
|
|
7994
8314
|
onCancel();
|
|
7995
8315
|
}
|
|
7996
8316
|
},
|
|
7997
|
-
children: /* @__PURE__ */ (0,
|
|
8317
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(
|
|
7998
8318
|
DrawerContent,
|
|
7999
8319
|
{
|
|
8000
8320
|
"data-slot": "drawer-panel",
|
|
8001
8321
|
className: cn(entry.width !== void 0 && "sm:max-w-none"),
|
|
8002
8322
|
style: panelStyle,
|
|
8003
8323
|
children: [
|
|
8004
|
-
/* @__PURE__ */ (0,
|
|
8324
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(
|
|
8005
8325
|
DrawerHeader,
|
|
8006
8326
|
{
|
|
8007
8327
|
"data-slot": "drawer-header",
|
|
8008
8328
|
className: "flex flex-row items-center justify-between border-b border-border px-6 py-4",
|
|
8009
8329
|
children: [
|
|
8010
|
-
/* @__PURE__ */ (0,
|
|
8011
|
-
/* @__PURE__ */ (0,
|
|
8330
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(DrawerTitle, { className: "text-lg", children: entry.title ?? "" }),
|
|
8331
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(DrawerClose, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
8012
8332
|
"button",
|
|
8013
8333
|
{
|
|
8014
8334
|
type: "button",
|
|
8015
8335
|
"data-slot": "drawer-close",
|
|
8016
8336
|
"aria-label": t("pactor.overlay.close"),
|
|
8017
8337
|
className: "cursor-pointer rounded-xs opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none",
|
|
8018
|
-
children: /* @__PURE__ */ (0,
|
|
8338
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_lucide_react26.XIcon, { className: "size-4" })
|
|
8019
8339
|
}
|
|
8020
8340
|
) })
|
|
8021
8341
|
]
|
|
8022
8342
|
}
|
|
8023
8343
|
),
|
|
8024
|
-
/* @__PURE__ */ (0,
|
|
8344
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { "data-slot": "drawer-body", className: "flex-1 overflow-auto p-6", children })
|
|
8025
8345
|
]
|
|
8026
8346
|
}
|
|
8027
8347
|
)
|
|
@@ -8033,9 +8353,9 @@ function PageOverlayBody({
|
|
|
8033
8353
|
renderer,
|
|
8034
8354
|
resolvePage
|
|
8035
8355
|
}) {
|
|
8036
|
-
const [child, setChild] = (0,
|
|
8037
|
-
const [error, setError] = (0,
|
|
8038
|
-
(0,
|
|
8356
|
+
const [child, setChild] = (0, import_react31.useState)(null);
|
|
8357
|
+
const [error, setError] = (0, import_react31.useState)(null);
|
|
8358
|
+
(0, import_react31.useEffect)(() => {
|
|
8039
8359
|
if (!resolvePage) {
|
|
8040
8360
|
setError(
|
|
8041
8361
|
new Error(
|
|
@@ -8077,12 +8397,12 @@ function PageOverlayBody({
|
|
|
8077
8397
|
};
|
|
8078
8398
|
}, [entry.id]);
|
|
8079
8399
|
if (error) {
|
|
8080
|
-
return /* @__PURE__ */ (0,
|
|
8400
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { role: "alert", children: error.message });
|
|
8081
8401
|
}
|
|
8082
8402
|
if (!child) {
|
|
8083
8403
|
return null;
|
|
8084
8404
|
}
|
|
8085
|
-
return /* @__PURE__ */ (0,
|
|
8405
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_runtime23.PageRuntimeView, { runtime: child });
|
|
8086
8406
|
}
|
|
8087
8407
|
// Annotate the CommonJS export names for ESM import in node:
|
|
8088
8408
|
0 && (module.exports = {
|
|
@@ -8101,6 +8421,7 @@ function PageOverlayBody({
|
|
|
8101
8421
|
Card,
|
|
8102
8422
|
Carousel,
|
|
8103
8423
|
Chart,
|
|
8424
|
+
ChatInput,
|
|
8104
8425
|
ChatLayout,
|
|
8105
8426
|
Checkbox,
|
|
8106
8427
|
Collapsible,
|