@webdevarif/dashui 0.3.12 → 0.4.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/dist/index.d.mts +182 -111
- package/dist/index.d.ts +182 -111
- package/dist/index.js +584 -383
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +569 -373
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -58,6 +58,8 @@ __export(index_exports, {
|
|
|
58
58
|
ColorPickerOutput: () => ColorPickerOutput,
|
|
59
59
|
ColorPickerSelection: () => ColorPickerSelection,
|
|
60
60
|
ConfirmDialog: () => ConfirmDialog,
|
|
61
|
+
DEVICES: () => DEVICES,
|
|
62
|
+
DEVICE_ICONS: () => DEVICE_ICONS,
|
|
61
63
|
DashboardLayout: () => DashboardLayout,
|
|
62
64
|
DataTable: () => DataTable,
|
|
63
65
|
Dialog: () => Dialog,
|
|
@@ -94,6 +96,7 @@ __export(index_exports, {
|
|
|
94
96
|
Input: () => Input,
|
|
95
97
|
Label: () => Label2,
|
|
96
98
|
LoadingSpinner: () => LoadingSpinner,
|
|
99
|
+
LocalInput: () => LocalInput,
|
|
97
100
|
MediaCard: () => MediaCard,
|
|
98
101
|
MediaGrid: () => MediaGrid,
|
|
99
102
|
MediaPickerDialog: () => MediaPickerDialog,
|
|
@@ -110,6 +113,8 @@ __export(index_exports, {
|
|
|
110
113
|
PostListTable: () => PostListTable,
|
|
111
114
|
PostSidebarSection: () => PostSidebarSection,
|
|
112
115
|
PostStatusBadge: () => PostStatusBadge,
|
|
116
|
+
ResponsiveSizeDeviceIcon: () => ResponsiveSizeDeviceIcon,
|
|
117
|
+
ResponsiveSizeField: () => ResponsiveSizeField,
|
|
113
118
|
SearchBar: () => SearchBar,
|
|
114
119
|
Select: () => Select,
|
|
115
120
|
SelectContent: () => SelectContent,
|
|
@@ -2472,9 +2477,227 @@ function FormSection({
|
|
|
2472
2477
|
] });
|
|
2473
2478
|
}
|
|
2474
2479
|
|
|
2480
|
+
// src/components/form/local-input.tsx
|
|
2481
|
+
var import_react = require("react");
|
|
2482
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2483
|
+
function LocalInput({
|
|
2484
|
+
value,
|
|
2485
|
+
onChange,
|
|
2486
|
+
commitOnBlur,
|
|
2487
|
+
...rest
|
|
2488
|
+
}) {
|
|
2489
|
+
const [local, setLocal] = (0, import_react.useState)(String(value ?? ""));
|
|
2490
|
+
const ref = (0, import_react.useRef)(null);
|
|
2491
|
+
const onChangeRef = (0, import_react.useRef)(onChange);
|
|
2492
|
+
onChangeRef.current = onChange;
|
|
2493
|
+
(0, import_react.useEffect)(() => {
|
|
2494
|
+
if (document.activeElement !== ref.current) {
|
|
2495
|
+
setLocal(String(value ?? ""));
|
|
2496
|
+
}
|
|
2497
|
+
}, [value]);
|
|
2498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2499
|
+
"input",
|
|
2500
|
+
{
|
|
2501
|
+
ref,
|
|
2502
|
+
...rest,
|
|
2503
|
+
value: local,
|
|
2504
|
+
onChange: (e) => {
|
|
2505
|
+
setLocal(e.target.value);
|
|
2506
|
+
if (!commitOnBlur) {
|
|
2507
|
+
onChangeRef.current(e.target.value);
|
|
2508
|
+
}
|
|
2509
|
+
},
|
|
2510
|
+
onBlur: (e) => {
|
|
2511
|
+
if (commitOnBlur) {
|
|
2512
|
+
onChangeRef.current(e.target.value);
|
|
2513
|
+
}
|
|
2514
|
+
}
|
|
2515
|
+
}
|
|
2516
|
+
);
|
|
2517
|
+
}
|
|
2518
|
+
|
|
2519
|
+
// src/components/form/responsive-size-device-icon.tsx
|
|
2520
|
+
var import_react2 = require("react");
|
|
2521
|
+
|
|
2522
|
+
// src/components/form/responsive-types.tsx
|
|
2523
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2524
|
+
var DEVICES = [
|
|
2525
|
+
{ key: "desktop", label: "Desktop", width: "1200px" },
|
|
2526
|
+
{ key: "laptop", label: "Laptop", width: "1024px" },
|
|
2527
|
+
{ key: "tablet", label: "Tablet", width: "768px" },
|
|
2528
|
+
{ key: "mobile", label: "Mobile", width: "375px" }
|
|
2529
|
+
];
|
|
2530
|
+
var DEVICE_ICONS = {
|
|
2531
|
+
desktop: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
2532
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("rect", { x: "2", y: "4", width: "20", height: "14", rx: "2" }),
|
|
2533
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("path", { d: "M8 20h8M12 18v2" })
|
|
2534
|
+
] }),
|
|
2535
|
+
laptop: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
2536
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("rect", { x: "3", y: "5", width: "18", height: "12", rx: "1.5" }),
|
|
2537
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("path", { d: "M1 19h22" })
|
|
2538
|
+
] }),
|
|
2539
|
+
tablet: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
2540
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("rect", { x: "4", y: "2", width: "16", height: "20", rx: "2" }),
|
|
2541
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("circle", { cx: "12", cy: "18", r: "0.5", fill: "currentColor" })
|
|
2542
|
+
] }),
|
|
2543
|
+
mobile: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
2544
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("rect", { x: "6", y: "2", width: "12", height: "20", rx: "2" }),
|
|
2545
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("circle", { cx: "12", cy: "18", r: "0.5", fill: "currentColor" })
|
|
2546
|
+
] })
|
|
2547
|
+
};
|
|
2548
|
+
|
|
2549
|
+
// src/components/form/responsive-size-device-icon.tsx
|
|
2550
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2551
|
+
function ResponsiveSizeDeviceIcon({
|
|
2552
|
+
activeDevice,
|
|
2553
|
+
setActiveDevice
|
|
2554
|
+
}) {
|
|
2555
|
+
const [open, setOpen] = (0, import_react2.useState)(false);
|
|
2556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "relative", children: [
|
|
2557
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2558
|
+
"button",
|
|
2559
|
+
{
|
|
2560
|
+
type: "button",
|
|
2561
|
+
onClick: () => setOpen((o) => !o),
|
|
2562
|
+
className: "flex items-center text-white/30 hover:text-white/60 transition-colors",
|
|
2563
|
+
children: DEVICE_ICONS[activeDevice]
|
|
2564
|
+
}
|
|
2565
|
+
),
|
|
2566
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2567
|
+
"div",
|
|
2568
|
+
{
|
|
2569
|
+
className: "absolute left-0 top-full mt-1 z-[200] rounded-lg overflow-hidden border border-white/10 shadow-xl",
|
|
2570
|
+
style: { background: "#1e2030", minWidth: 160 },
|
|
2571
|
+
children: DEVICES.map((d) => /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
2572
|
+
"button",
|
|
2573
|
+
{
|
|
2574
|
+
type: "button",
|
|
2575
|
+
onClick: () => {
|
|
2576
|
+
setActiveDevice(d.key);
|
|
2577
|
+
setOpen(false);
|
|
2578
|
+
},
|
|
2579
|
+
className: "w-full flex items-center gap-3 px-3 py-2 text-xs hover:bg-white/10 transition-colors",
|
|
2580
|
+
children: [
|
|
2581
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-white/60", children: DEVICE_ICONS[d.key] }),
|
|
2582
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-white/70 flex-1 text-left", children: d.label }),
|
|
2583
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-white/30", children: d.width }),
|
|
2584
|
+
activeDevice === d.key && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2585
|
+
"svg",
|
|
2586
|
+
{
|
|
2587
|
+
className: "w-3 h-3 text-[#287f71] shrink-0",
|
|
2588
|
+
viewBox: "0 0 24 24",
|
|
2589
|
+
fill: "none",
|
|
2590
|
+
stroke: "currentColor",
|
|
2591
|
+
strokeWidth: "2.5",
|
|
2592
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("path", { d: "m5 13 4 4L19 7" })
|
|
2593
|
+
}
|
|
2594
|
+
)
|
|
2595
|
+
]
|
|
2596
|
+
},
|
|
2597
|
+
d.key
|
|
2598
|
+
))
|
|
2599
|
+
}
|
|
2600
|
+
)
|
|
2601
|
+
] });
|
|
2602
|
+
}
|
|
2603
|
+
|
|
2604
|
+
// src/components/form/responsive-size-field.tsx
|
|
2605
|
+
var import_react3 = require("react");
|
|
2606
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2607
|
+
function ResponsiveSizeField({
|
|
2608
|
+
value,
|
|
2609
|
+
unit,
|
|
2610
|
+
customUnit,
|
|
2611
|
+
activeDevice,
|
|
2612
|
+
onSizeChange,
|
|
2613
|
+
onUnitChange,
|
|
2614
|
+
onCustomChange
|
|
2615
|
+
}) {
|
|
2616
|
+
const [unitOpen, setUnitOpen] = (0, import_react3.useState)(false);
|
|
2617
|
+
const currentVal = value[activeDevice] ?? value.desktop ?? 0;
|
|
2618
|
+
const isCustom = unit === "custom";
|
|
2619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "relative flex items-center border border-white/10 rounded-md bg-white/5 w-full", style: { height: 32 }, children: [
|
|
2620
|
+
isCustom ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2621
|
+
LocalInput,
|
|
2622
|
+
{
|
|
2623
|
+
type: "text",
|
|
2624
|
+
value: customUnit || "",
|
|
2625
|
+
onChange: (v) => onCustomChange?.(v),
|
|
2626
|
+
commitOnBlur: true,
|
|
2627
|
+
placeholder: "e.g. 2rem",
|
|
2628
|
+
className: "flex-1 min-w-0 bg-transparent px-2 text-xs text-white/80 outline-none h-full"
|
|
2629
|
+
}
|
|
2630
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2631
|
+
LocalInput,
|
|
2632
|
+
{
|
|
2633
|
+
type: "number",
|
|
2634
|
+
min: 0,
|
|
2635
|
+
value: currentVal,
|
|
2636
|
+
onChange: (v) => onSizeChange(activeDevice, +v),
|
|
2637
|
+
commitOnBlur: true,
|
|
2638
|
+
className: "flex-1 min-w-0 bg-transparent px-2 text-xs text-white/80 outline-none text-center h-full"
|
|
2639
|
+
}
|
|
2640
|
+
),
|
|
2641
|
+
isCustom ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "relative shrink-0", children: [
|
|
2642
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2643
|
+
"div",
|
|
2644
|
+
{
|
|
2645
|
+
role: "button",
|
|
2646
|
+
tabIndex: 0,
|
|
2647
|
+
onClick: () => setUnitOpen((o) => !o),
|
|
2648
|
+
title: "Choose unit",
|
|
2649
|
+
className: "flex items-center justify-center px-2 h-full text-white/30 hover:text-white/60 transition-colors cursor-pointer",
|
|
2650
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2651
|
+
"svg",
|
|
2652
|
+
{
|
|
2653
|
+
className: "w-3 h-3",
|
|
2654
|
+
viewBox: "0 0 24 24",
|
|
2655
|
+
fill: "none",
|
|
2656
|
+
stroke: "currentColor",
|
|
2657
|
+
strokeWidth: "1.5",
|
|
2658
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("path", { d: "m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Z" })
|
|
2659
|
+
}
|
|
2660
|
+
)
|
|
2661
|
+
}
|
|
2662
|
+
),
|
|
2663
|
+
unitOpen && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2664
|
+
"div",
|
|
2665
|
+
{
|
|
2666
|
+
className: "absolute right-0 top-full mt-1 z-[200] rounded-lg overflow-hidden border border-white/10 shadow-xl",
|
|
2667
|
+
style: { background: "#1e2030", minWidth: 60 },
|
|
2668
|
+
children: ["px", "rem", "em", "vh", "vw"].map((u) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2669
|
+
"div",
|
|
2670
|
+
{
|
|
2671
|
+
role: "button",
|
|
2672
|
+
tabIndex: 0,
|
|
2673
|
+
onClick: () => {
|
|
2674
|
+
onUnitChange(u);
|
|
2675
|
+
setUnitOpen(false);
|
|
2676
|
+
},
|
|
2677
|
+
className: "w-full px-3 py-2 text-xs text-white/70 hover:bg-white/10 text-right transition-colors cursor-pointer",
|
|
2678
|
+
children: u
|
|
2679
|
+
},
|
|
2680
|
+
u
|
|
2681
|
+
))
|
|
2682
|
+
}
|
|
2683
|
+
)
|
|
2684
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Select, { value: unit, onValueChange: onUnitChange, children: [
|
|
2685
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2686
|
+
SelectTrigger,
|
|
2687
|
+
{
|
|
2688
|
+
className: "h-full border-0 rounded-l-none rounded-r-lg px-2 text-xs text-white/50 bg-transparent focus:ring-0 shadow-none",
|
|
2689
|
+
style: { width: 52, minWidth: 52 },
|
|
2690
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(SelectValue, {})
|
|
2691
|
+
}
|
|
2692
|
+
),
|
|
2693
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(SelectContent, { style: { background: "#1a1c2e", border: "1px solid rgba(255,255,255,0.1)", color: "rgba(255,255,255,0.7)" }, children: ["px", "rem", "em", "vh", "vw", "custom"].map((u) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(SelectItem, { value: u, children: u }, u)) })
|
|
2694
|
+
] })
|
|
2695
|
+
] });
|
|
2696
|
+
}
|
|
2697
|
+
|
|
2475
2698
|
// src/components/feedback/alert.tsx
|
|
2476
2699
|
var import_lucide_react10 = require("lucide-react");
|
|
2477
|
-
var
|
|
2700
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2478
2701
|
var variantConfig = {
|
|
2479
2702
|
info: {
|
|
2480
2703
|
icon: import_lucide_react10.Info,
|
|
@@ -2503,7 +2726,7 @@ function Alert({
|
|
|
2503
2726
|
}) {
|
|
2504
2727
|
const config = variantConfig[variant];
|
|
2505
2728
|
const Icon2 = config.icon;
|
|
2506
|
-
return /* @__PURE__ */ (0,
|
|
2729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
2507
2730
|
"div",
|
|
2508
2731
|
{
|
|
2509
2732
|
className: cn(
|
|
@@ -2513,17 +2736,17 @@ function Alert({
|
|
|
2513
2736
|
),
|
|
2514
2737
|
role: "alert",
|
|
2515
2738
|
children: [
|
|
2516
|
-
/* @__PURE__ */ (0,
|
|
2517
|
-
/* @__PURE__ */ (0,
|
|
2518
|
-
title && /* @__PURE__ */ (0,
|
|
2519
|
-
/* @__PURE__ */ (0,
|
|
2739
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Icon2, { className: "mt-0.5 h-5 w-5 shrink-0" }),
|
|
2740
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex-1", children: [
|
|
2741
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "font-medium", children: title }),
|
|
2742
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: cn("text-sm", title && "mt-1"), children })
|
|
2520
2743
|
] }),
|
|
2521
|
-
dismissible && /* @__PURE__ */ (0,
|
|
2744
|
+
dismissible && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2522
2745
|
"button",
|
|
2523
2746
|
{
|
|
2524
2747
|
onClick: onDismiss,
|
|
2525
2748
|
className: "absolute right-3 top-3 rounded-md p-1 opacity-70 hover:opacity-100",
|
|
2526
|
-
children: /* @__PURE__ */ (0,
|
|
2749
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react10.X, { className: "h-4 w-4" })
|
|
2527
2750
|
}
|
|
2528
2751
|
)
|
|
2529
2752
|
]
|
|
@@ -2533,14 +2756,14 @@ function Alert({
|
|
|
2533
2756
|
|
|
2534
2757
|
// src/components/feedback/loading-spinner.tsx
|
|
2535
2758
|
var import_lucide_react11 = require("lucide-react");
|
|
2536
|
-
var
|
|
2759
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
2537
2760
|
var sizeMap2 = {
|
|
2538
2761
|
sm: "h-4 w-4",
|
|
2539
2762
|
md: "h-6 w-6",
|
|
2540
2763
|
lg: "h-8 w-8"
|
|
2541
2764
|
};
|
|
2542
2765
|
function LoadingSpinner({ size = "md", className }) {
|
|
2543
|
-
return /* @__PURE__ */ (0,
|
|
2766
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
2544
2767
|
import_lucide_react11.Loader2,
|
|
2545
2768
|
{
|
|
2546
2769
|
className: cn("animate-spin text-muted-foreground", sizeMap2[size], className)
|
|
@@ -2549,7 +2772,7 @@ function LoadingSpinner({ size = "md", className }) {
|
|
|
2549
2772
|
}
|
|
2550
2773
|
|
|
2551
2774
|
// src/components/feedback/confirm-dialog.tsx
|
|
2552
|
-
var
|
|
2775
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
2553
2776
|
function ConfirmDialog({
|
|
2554
2777
|
open,
|
|
2555
2778
|
onOpenChange,
|
|
@@ -2561,13 +2784,13 @@ function ConfirmDialog({
|
|
|
2561
2784
|
loading,
|
|
2562
2785
|
variant = "default"
|
|
2563
2786
|
}) {
|
|
2564
|
-
return /* @__PURE__ */ (0,
|
|
2565
|
-
/* @__PURE__ */ (0,
|
|
2566
|
-
/* @__PURE__ */ (0,
|
|
2567
|
-
description && /* @__PURE__ */ (0,
|
|
2787
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Dialog, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(DialogContent, { children: [
|
|
2788
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(DialogHeader, { children: [
|
|
2789
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DialogTitle, { children: title }),
|
|
2790
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DialogDescription, { children: description })
|
|
2568
2791
|
] }),
|
|
2569
|
-
/* @__PURE__ */ (0,
|
|
2570
|
-
/* @__PURE__ */ (0,
|
|
2792
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(DialogFooter, { children: [
|
|
2793
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
2571
2794
|
Button,
|
|
2572
2795
|
{
|
|
2573
2796
|
variant: "outline",
|
|
@@ -2576,14 +2799,14 @@ function ConfirmDialog({
|
|
|
2576
2799
|
children: cancelLabel
|
|
2577
2800
|
}
|
|
2578
2801
|
),
|
|
2579
|
-
/* @__PURE__ */ (0,
|
|
2802
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
2580
2803
|
Button,
|
|
2581
2804
|
{
|
|
2582
2805
|
variant: variant === "destructive" ? "destructive" : "default",
|
|
2583
2806
|
onClick: onConfirm,
|
|
2584
2807
|
disabled: loading,
|
|
2585
2808
|
children: [
|
|
2586
|
-
loading && /* @__PURE__ */ (0,
|
|
2809
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(LoadingSpinner, { size: "sm", className: "mr-2" }),
|
|
2587
2810
|
confirmLabel
|
|
2588
2811
|
]
|
|
2589
2812
|
}
|
|
@@ -2593,7 +2816,7 @@ function ConfirmDialog({
|
|
|
2593
2816
|
}
|
|
2594
2817
|
|
|
2595
2818
|
// src/components/content/post-status-badge.tsx
|
|
2596
|
-
var
|
|
2819
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
2597
2820
|
var statusConfig = {
|
|
2598
2821
|
DRAFT: {
|
|
2599
2822
|
label: "Draft",
|
|
@@ -2626,7 +2849,7 @@ function PostStatusBadge({
|
|
|
2626
2849
|
className
|
|
2627
2850
|
}) {
|
|
2628
2851
|
const config = statusConfig[status];
|
|
2629
|
-
return /* @__PURE__ */ (0,
|
|
2852
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
2630
2853
|
"span",
|
|
2631
2854
|
{
|
|
2632
2855
|
className: cn(
|
|
@@ -2636,7 +2859,7 @@ function PostStatusBadge({
|
|
|
2636
2859
|
className
|
|
2637
2860
|
),
|
|
2638
2861
|
children: [
|
|
2639
|
-
/* @__PURE__ */ (0,
|
|
2862
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
2640
2863
|
"span",
|
|
2641
2864
|
{
|
|
2642
2865
|
className: cn("inline-block rounded-full", config.dot, {
|
|
@@ -2655,9 +2878,9 @@ function PostStatusBadge({
|
|
|
2655
2878
|
var React21 = __toESM(require("react"));
|
|
2656
2879
|
|
|
2657
2880
|
// src/components/Skeleton.tsx
|
|
2658
|
-
var
|
|
2881
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
2659
2882
|
function Skeleton2({ width = "100%", height = 16, rounded, style }) {
|
|
2660
|
-
return /* @__PURE__ */ (0,
|
|
2883
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
2661
2884
|
"div",
|
|
2662
2885
|
{
|
|
2663
2886
|
style: {
|
|
@@ -2670,7 +2893,7 @@ function Skeleton2({ width = "100%", height = 16, rounded, style }) {
|
|
|
2670
2893
|
flexShrink: 0,
|
|
2671
2894
|
...style
|
|
2672
2895
|
},
|
|
2673
|
-
children: /* @__PURE__ */ (0,
|
|
2896
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
2674
2897
|
"div",
|
|
2675
2898
|
{
|
|
2676
2899
|
style: {
|
|
@@ -2686,49 +2909,49 @@ function Skeleton2({ width = "100%", height = 16, rounded, style }) {
|
|
|
2686
2909
|
}
|
|
2687
2910
|
|
|
2688
2911
|
// src/components/content/post-list-table.tsx
|
|
2689
|
-
var
|
|
2912
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
2690
2913
|
function IconEdit() {
|
|
2691
|
-
return /* @__PURE__ */ (0,
|
|
2692
|
-
/* @__PURE__ */ (0,
|
|
2693
|
-
/* @__PURE__ */ (0,
|
|
2914
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2915
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }),
|
|
2916
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })
|
|
2694
2917
|
] });
|
|
2695
2918
|
}
|
|
2696
2919
|
function IconTrash() {
|
|
2697
|
-
return /* @__PURE__ */ (0,
|
|
2698
|
-
/* @__PURE__ */ (0,
|
|
2699
|
-
/* @__PURE__ */ (0,
|
|
2700
|
-
/* @__PURE__ */ (0,
|
|
2701
|
-
/* @__PURE__ */ (0,
|
|
2702
|
-
/* @__PURE__ */ (0,
|
|
2920
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2921
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("polyline", { points: "3 6 5 6 21 6" }),
|
|
2922
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("path", { d: "M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6" }),
|
|
2923
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("path", { d: "M10 11v6" }),
|
|
2924
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("path", { d: "M14 11v6" }),
|
|
2925
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("path", { d: "M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2" })
|
|
2703
2926
|
] });
|
|
2704
2927
|
}
|
|
2705
2928
|
function IconCopy() {
|
|
2706
|
-
return /* @__PURE__ */ (0,
|
|
2707
|
-
/* @__PURE__ */ (0,
|
|
2708
|
-
/* @__PURE__ */ (0,
|
|
2929
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2930
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" }),
|
|
2931
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
2709
2932
|
] });
|
|
2710
2933
|
}
|
|
2711
2934
|
function IconMoreHorizontal() {
|
|
2712
|
-
return /* @__PURE__ */ (0,
|
|
2713
|
-
/* @__PURE__ */ (0,
|
|
2714
|
-
/* @__PURE__ */ (0,
|
|
2715
|
-
/* @__PURE__ */ (0,
|
|
2935
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2936
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("circle", { cx: "5", cy: "12", r: "1", fill: "currentColor" }),
|
|
2937
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("circle", { cx: "12", cy: "12", r: "1", fill: "currentColor" }),
|
|
2938
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("circle", { cx: "19", cy: "12", r: "1", fill: "currentColor" })
|
|
2716
2939
|
] });
|
|
2717
2940
|
}
|
|
2718
2941
|
function IconChevronRight() {
|
|
2719
|
-
return /* @__PURE__ */ (0,
|
|
2942
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("polyline", { points: "9 18 15 12 9 6" }) });
|
|
2720
2943
|
}
|
|
2721
2944
|
function IconImage() {
|
|
2722
|
-
return /* @__PURE__ */ (0,
|
|
2723
|
-
/* @__PURE__ */ (0,
|
|
2724
|
-
/* @__PURE__ */ (0,
|
|
2725
|
-
/* @__PURE__ */ (0,
|
|
2945
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2946
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }),
|
|
2947
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("circle", { cx: "8.5", cy: "8.5", r: "1.5" }),
|
|
2948
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("polyline", { points: "21 15 16 10 5 21" })
|
|
2726
2949
|
] });
|
|
2727
2950
|
}
|
|
2728
2951
|
function IconPlus() {
|
|
2729
|
-
return /* @__PURE__ */ (0,
|
|
2730
|
-
/* @__PURE__ */ (0,
|
|
2731
|
-
/* @__PURE__ */ (0,
|
|
2952
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2953
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("line", { x1: "12", y1: "5", x2: "12", y2: "19" }),
|
|
2954
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("line", { x1: "5", y1: "12", x2: "19", y2: "12" })
|
|
2732
2955
|
] });
|
|
2733
2956
|
}
|
|
2734
2957
|
function formatDate(date) {
|
|
@@ -2761,17 +2984,17 @@ function RowActions({ post, onEdit, onDelete, onDuplicate, onStatusChange }) {
|
|
|
2761
2984
|
{ label: "Publish", value: "PUBLISHED" },
|
|
2762
2985
|
{ label: "Archive", value: "ARCHIVED" }
|
|
2763
2986
|
];
|
|
2764
|
-
return /* @__PURE__ */ (0,
|
|
2765
|
-
/* @__PURE__ */ (0,
|
|
2987
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "relative flex items-center gap-1", ref, children: [
|
|
2988
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
2766
2989
|
"button",
|
|
2767
2990
|
{
|
|
2768
2991
|
onClick: () => onEdit?.(post.id),
|
|
2769
2992
|
className: "inline-flex items-center justify-center h-7 w-7 rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors",
|
|
2770
2993
|
title: "Edit",
|
|
2771
|
-
children: /* @__PURE__ */ (0,
|
|
2994
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(IconEdit, {})
|
|
2772
2995
|
}
|
|
2773
2996
|
),
|
|
2774
|
-
/* @__PURE__ */ (0,
|
|
2997
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
2775
2998
|
"button",
|
|
2776
2999
|
{
|
|
2777
3000
|
onClick: () => {
|
|
@@ -2780,11 +3003,11 @@ function RowActions({ post, onEdit, onDelete, onDuplicate, onStatusChange }) {
|
|
|
2780
3003
|
},
|
|
2781
3004
|
className: "inline-flex items-center justify-center h-7 w-7 rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors",
|
|
2782
3005
|
title: "More actions",
|
|
2783
|
-
children: /* @__PURE__ */ (0,
|
|
3006
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(IconMoreHorizontal, {})
|
|
2784
3007
|
}
|
|
2785
3008
|
),
|
|
2786
|
-
open && /* @__PURE__ */ (0,
|
|
2787
|
-
/* @__PURE__ */ (0,
|
|
3009
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "absolute right-0 top-8 z-50 min-w-[160px] rounded-lg border border-border bg-card shadow-md py-1", children: [
|
|
3010
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
2788
3011
|
"button",
|
|
2789
3012
|
{
|
|
2790
3013
|
onClick: () => {
|
|
@@ -2793,13 +3016,13 @@ function RowActions({ post, onEdit, onDelete, onDuplicate, onStatusChange }) {
|
|
|
2793
3016
|
},
|
|
2794
3017
|
className: "flex w-full items-center gap-2 px-3 py-1.5 text-sm hover:bg-accent transition-colors",
|
|
2795
3018
|
children: [
|
|
2796
|
-
/* @__PURE__ */ (0,
|
|
3019
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(IconCopy, {}),
|
|
2797
3020
|
"Duplicate"
|
|
2798
3021
|
]
|
|
2799
3022
|
}
|
|
2800
3023
|
),
|
|
2801
|
-
/* @__PURE__ */ (0,
|
|
2802
|
-
/* @__PURE__ */ (0,
|
|
3024
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "relative", children: [
|
|
3025
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
2803
3026
|
"button",
|
|
2804
3027
|
{
|
|
2805
3028
|
onMouseEnter: () => setStatusOpen(true),
|
|
@@ -2807,18 +3030,18 @@ function RowActions({ post, onEdit, onDelete, onDuplicate, onStatusChange }) {
|
|
|
2807
3030
|
onClick: () => setStatusOpen((v) => !v),
|
|
2808
3031
|
className: "flex w-full items-center justify-between gap-2 px-3 py-1.5 text-sm hover:bg-accent transition-colors",
|
|
2809
3032
|
children: [
|
|
2810
|
-
/* @__PURE__ */ (0,
|
|
2811
|
-
/* @__PURE__ */ (0,
|
|
3033
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { children: "Change status" }),
|
|
3034
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(IconChevronRight, {})
|
|
2812
3035
|
]
|
|
2813
3036
|
}
|
|
2814
3037
|
),
|
|
2815
|
-
statusOpen && /* @__PURE__ */ (0,
|
|
3038
|
+
statusOpen && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
2816
3039
|
"div",
|
|
2817
3040
|
{
|
|
2818
3041
|
className: "absolute left-full top-0 z-50 min-w-[130px] rounded-lg border border-border bg-card shadow-md py-1",
|
|
2819
3042
|
onMouseEnter: () => setStatusOpen(true),
|
|
2820
3043
|
onMouseLeave: () => setStatusOpen(false),
|
|
2821
|
-
children: statusOptions.map((opt) => /* @__PURE__ */ (0,
|
|
3044
|
+
children: statusOptions.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
2822
3045
|
"button",
|
|
2823
3046
|
{
|
|
2824
3047
|
onClick: () => {
|
|
@@ -2837,8 +3060,8 @@ function RowActions({ post, onEdit, onDelete, onDuplicate, onStatusChange }) {
|
|
|
2837
3060
|
}
|
|
2838
3061
|
)
|
|
2839
3062
|
] }),
|
|
2840
|
-
/* @__PURE__ */ (0,
|
|
2841
|
-
/* @__PURE__ */ (0,
|
|
3063
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "my-1 border-t border-border" }),
|
|
3064
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
2842
3065
|
"button",
|
|
2843
3066
|
{
|
|
2844
3067
|
onClick: () => {
|
|
@@ -2847,7 +3070,7 @@ function RowActions({ post, onEdit, onDelete, onDuplicate, onStatusChange }) {
|
|
|
2847
3070
|
},
|
|
2848
3071
|
className: "flex w-full items-center gap-2 px-3 py-1.5 text-sm text-destructive hover:bg-destructive/10 transition-colors",
|
|
2849
3072
|
children: [
|
|
2850
|
-
/* @__PURE__ */ (0,
|
|
3073
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(IconTrash, {}),
|
|
2851
3074
|
"Delete"
|
|
2852
3075
|
]
|
|
2853
3076
|
}
|
|
@@ -2856,21 +3079,21 @@ function RowActions({ post, onEdit, onDelete, onDuplicate, onStatusChange }) {
|
|
|
2856
3079
|
] });
|
|
2857
3080
|
}
|
|
2858
3081
|
function SkeletonRow() {
|
|
2859
|
-
return /* @__PURE__ */ (0,
|
|
2860
|
-
/* @__PURE__ */ (0,
|
|
2861
|
-
/* @__PURE__ */ (0,
|
|
2862
|
-
/* @__PURE__ */ (0,
|
|
2863
|
-
/* @__PURE__ */ (0,
|
|
3082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("tr", { children: [
|
|
3083
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("td", { className: "px-4 py-3", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Skeleton2, { className: "w-10 h-10 rounded-lg" }) }),
|
|
3084
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("td", { className: "px-4 py-3", children: [
|
|
3085
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Skeleton2, { className: "h-4 w-40 mb-1.5" }),
|
|
3086
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Skeleton2, { className: "h-3 w-24" })
|
|
2864
3087
|
] }),
|
|
2865
|
-
/* @__PURE__ */ (0,
|
|
2866
|
-
/* @__PURE__ */ (0,
|
|
2867
|
-
/* @__PURE__ */ (0,
|
|
2868
|
-
/* @__PURE__ */ (0,
|
|
3088
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("td", { className: "px-4 py-3", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Skeleton2, { className: "h-5 w-20 rounded-full" }) }),
|
|
3089
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("td", { className: "px-4 py-3", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3090
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Skeleton2, { className: "w-6 h-6 rounded-full" }),
|
|
3091
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Skeleton2, { className: "h-4 w-20" })
|
|
2869
3092
|
] }) }),
|
|
2870
|
-
/* @__PURE__ */ (0,
|
|
2871
|
-
/* @__PURE__ */ (0,
|
|
2872
|
-
/* @__PURE__ */ (0,
|
|
2873
|
-
/* @__PURE__ */ (0,
|
|
3093
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("td", { className: "px-4 py-3", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Skeleton2, { className: "h-4 w-24" }) }),
|
|
3094
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("td", { className: "px-4 py-3", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex gap-1", children: [
|
|
3095
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Skeleton2, { className: "w-7 h-7 rounded-md" }),
|
|
3096
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Skeleton2, { className: "w-7 h-7 rounded-md" })
|
|
2874
3097
|
] }) })
|
|
2875
3098
|
] });
|
|
2876
3099
|
}
|
|
@@ -2889,45 +3112,45 @@ function PostListTable({
|
|
|
2889
3112
|
className
|
|
2890
3113
|
}) {
|
|
2891
3114
|
const isEmpty = !loading && posts.length === 0;
|
|
2892
|
-
return /* @__PURE__ */ (0,
|
|
2893
|
-
/* @__PURE__ */ (0,
|
|
2894
|
-
/* @__PURE__ */ (0,
|
|
2895
|
-
/* @__PURE__ */ (0,
|
|
2896
|
-
/* @__PURE__ */ (0,
|
|
2897
|
-
/* @__PURE__ */ (0,
|
|
2898
|
-
/* @__PURE__ */ (0,
|
|
2899
|
-
/* @__PURE__ */ (0,
|
|
2900
|
-
/* @__PURE__ */ (0,
|
|
3115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: cn("w-full overflow-x-auto rounded-lg border border-border bg-card", className), children: [
|
|
3116
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("table", { className: "w-full text-sm", children: [
|
|
3117
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("tr", { className: "border-b border-border bg-muted/40", children: [
|
|
3118
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("th", { className: "px-4 py-2.5 text-left text-xs font-medium text-muted-foreground w-14", children: "Image" }),
|
|
3119
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("th", { className: "px-4 py-2.5 text-left text-xs font-medium text-muted-foreground", children: "Title" }),
|
|
3120
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("th", { className: "px-4 py-2.5 text-left text-xs font-medium text-muted-foreground", children: "Status" }),
|
|
3121
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("th", { className: "px-4 py-2.5 text-left text-xs font-medium text-muted-foreground", children: "Author" }),
|
|
3122
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("th", { className: "px-4 py-2.5 text-left text-xs font-medium text-muted-foreground", children: "Date" }),
|
|
3123
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("th", { className: "px-4 py-2.5 text-right text-xs font-medium text-muted-foreground", children: "Actions" })
|
|
2901
3124
|
] }) }),
|
|
2902
|
-
/* @__PURE__ */ (0,
|
|
3125
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("tbody", { children: loading ? Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SkeletonRow, {}, i)) : isEmpty ? null : posts.map((post) => {
|
|
2903
3126
|
const date = post.status === "PUBLISHED" && post.publishedAt ? formatDate(post.publishedAt) : formatDate(post.createdAt);
|
|
2904
|
-
return /* @__PURE__ */ (0,
|
|
3127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
2905
3128
|
"tr",
|
|
2906
3129
|
{
|
|
2907
3130
|
className: "border-b border-border last:border-0 hover:bg-muted/30 transition-colors",
|
|
2908
3131
|
children: [
|
|
2909
|
-
/* @__PURE__ */ (0,
|
|
3132
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("td", { className: "px-4 py-3", children: post.featuredImageUrl ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
2910
3133
|
"img",
|
|
2911
3134
|
{
|
|
2912
3135
|
src: post.featuredImageUrl,
|
|
2913
3136
|
alt: post.title,
|
|
2914
3137
|
className: "w-10 h-10 rounded-lg object-cover"
|
|
2915
3138
|
}
|
|
2916
|
-
) : /* @__PURE__ */ (0,
|
|
2917
|
-
/* @__PURE__ */ (0,
|
|
2918
|
-
/* @__PURE__ */ (0,
|
|
2919
|
-
/* @__PURE__ */ (0,
|
|
3139
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "w-10 h-10 rounded-lg bg-muted flex items-center justify-center text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(IconImage, {}) }) }),
|
|
3140
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("td", { className: "px-4 py-3", children: [
|
|
3141
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "font-medium text-foreground leading-tight truncate max-w-[240px]", children: post.title }),
|
|
3142
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "text-xs text-muted-foreground mt-0.5 truncate max-w-[240px]", children: [
|
|
2920
3143
|
"/",
|
|
2921
3144
|
post.slug
|
|
2922
3145
|
] })
|
|
2923
3146
|
] }),
|
|
2924
|
-
/* @__PURE__ */ (0,
|
|
2925
|
-
/* @__PURE__ */ (0,
|
|
2926
|
-
/* @__PURE__ */ (0,
|
|
2927
|
-
/* @__PURE__ */ (0,
|
|
2928
|
-
] }) : /* @__PURE__ */ (0,
|
|
2929
|
-
/* @__PURE__ */ (0,
|
|
2930
|
-
/* @__PURE__ */ (0,
|
|
3147
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("td", { className: "px-4 py-3", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(PostStatusBadge, { status: post.status, size: "sm" }) }),
|
|
3148
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("td", { className: "px-4 py-3", children: post.author ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3149
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "w-6 h-6 rounded-full bg-primary/20 text-primary flex items-center justify-center text-[10px] font-semibold shrink-0", children: getInitials(post.author) }),
|
|
3150
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "text-sm text-foreground truncate max-w-[100px]", children: post.author })
|
|
3151
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "text-muted-foreground text-xs", children: "\u2014" }) }),
|
|
3152
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("td", { className: "px-4 py-3 text-sm text-muted-foreground whitespace-nowrap", children: date }),
|
|
3153
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("td", { className: "px-4 py-3", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
2931
3154
|
RowActions,
|
|
2932
3155
|
{
|
|
2933
3156
|
post,
|
|
@@ -2943,22 +3166,22 @@ function PostListTable({
|
|
|
2943
3166
|
);
|
|
2944
3167
|
}) })
|
|
2945
3168
|
] }),
|
|
2946
|
-
isEmpty && /* @__PURE__ */ (0,
|
|
2947
|
-
/* @__PURE__ */ (0,
|
|
2948
|
-
/* @__PURE__ */ (0,
|
|
2949
|
-
/* @__PURE__ */ (0,
|
|
2950
|
-
/* @__PURE__ */ (0,
|
|
2951
|
-
/* @__PURE__ */ (0,
|
|
2952
|
-
/* @__PURE__ */ (0,
|
|
3169
|
+
isEmpty && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex flex-col items-center justify-center py-16 px-6 text-center", children: [
|
|
3170
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "text-muted-foreground mb-3", children: emptyIcon ?? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.2", strokeLinecap: "round", strokeLinejoin: "round", className: "opacity-40", children: [
|
|
3171
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
3172
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("polyline", { points: "14 2 14 8 20 8" }),
|
|
3173
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("line", { x1: "16", y1: "13", x2: "8", y2: "13" }),
|
|
3174
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("line", { x1: "16", y1: "17", x2: "8", y2: "17" }),
|
|
3175
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("polyline", { points: "10 9 9 9 8 9" })
|
|
2953
3176
|
] }) }),
|
|
2954
|
-
/* @__PURE__ */ (0,
|
|
2955
|
-
onNewPost && /* @__PURE__ */ (0,
|
|
3177
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "text-sm text-muted-foreground mb-4", children: emptyMessage ?? `No ${singularLabel.toLowerCase()}s yet.` }),
|
|
3178
|
+
onNewPost && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
2956
3179
|
"button",
|
|
2957
3180
|
{
|
|
2958
3181
|
onClick: onNewPost,
|
|
2959
3182
|
className: "inline-flex items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground hover:bg-primary/90 transition-colors",
|
|
2960
3183
|
children: [
|
|
2961
|
-
/* @__PURE__ */ (0,
|
|
3184
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(IconPlus, {}),
|
|
2962
3185
|
newPostLabel ?? `New ${singularLabel}`
|
|
2963
3186
|
]
|
|
2964
3187
|
}
|
|
@@ -2968,7 +3191,7 @@ function PostListTable({
|
|
|
2968
3191
|
}
|
|
2969
3192
|
|
|
2970
3193
|
// src/components/content/post-filters-bar.tsx
|
|
2971
|
-
var
|
|
3194
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
2972
3195
|
var STATUS_TABS = [
|
|
2973
3196
|
{ value: "all", label: "All" },
|
|
2974
3197
|
{ value: "DRAFT", label: "Draft" },
|
|
@@ -2977,7 +3200,7 @@ var STATUS_TABS = [
|
|
|
2977
3200
|
{ value: "ARCHIVED", label: "Archived" }
|
|
2978
3201
|
];
|
|
2979
3202
|
function IconSearch() {
|
|
2980
|
-
return /* @__PURE__ */ (0,
|
|
3203
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
2981
3204
|
"svg",
|
|
2982
3205
|
{
|
|
2983
3206
|
width: "14",
|
|
@@ -2989,14 +3212,14 @@ function IconSearch() {
|
|
|
2989
3212
|
strokeLinecap: "round",
|
|
2990
3213
|
strokeLinejoin: "round",
|
|
2991
3214
|
children: [
|
|
2992
|
-
/* @__PURE__ */ (0,
|
|
2993
|
-
/* @__PURE__ */ (0,
|
|
3215
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("circle", { cx: "11", cy: "11", r: "8" }),
|
|
3216
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
|
|
2994
3217
|
]
|
|
2995
3218
|
}
|
|
2996
3219
|
);
|
|
2997
3220
|
}
|
|
2998
3221
|
function IconPlus2() {
|
|
2999
|
-
return /* @__PURE__ */ (0,
|
|
3222
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
3000
3223
|
"svg",
|
|
3001
3224
|
{
|
|
3002
3225
|
width: "14",
|
|
@@ -3008,8 +3231,8 @@ function IconPlus2() {
|
|
|
3008
3231
|
strokeLinecap: "round",
|
|
3009
3232
|
strokeLinejoin: "round",
|
|
3010
3233
|
children: [
|
|
3011
|
-
/* @__PURE__ */ (0,
|
|
3012
|
-
/* @__PURE__ */ (0,
|
|
3234
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("line", { x1: "12", y1: "5", x2: "12", y2: "19" }),
|
|
3235
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("line", { x1: "5", y1: "12", x2: "19", y2: "12" })
|
|
3013
3236
|
]
|
|
3014
3237
|
}
|
|
3015
3238
|
);
|
|
@@ -3025,11 +3248,11 @@ function PostFiltersBar({
|
|
|
3025
3248
|
typeLabel = "Posts",
|
|
3026
3249
|
className
|
|
3027
3250
|
}) {
|
|
3028
|
-
return /* @__PURE__ */ (0,
|
|
3029
|
-
/* @__PURE__ */ (0,
|
|
3030
|
-
/* @__PURE__ */ (0,
|
|
3031
|
-
/* @__PURE__ */ (0,
|
|
3032
|
-
/* @__PURE__ */ (0,
|
|
3251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: cn("space-y-2", className), children: [
|
|
3252
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-wrap items-center gap-3", children: [
|
|
3253
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "relative flex items-center", children: [
|
|
3254
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "absolute left-2.5 text-muted-foreground pointer-events-none", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(IconSearch, {}) }),
|
|
3255
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3033
3256
|
"input",
|
|
3034
3257
|
{
|
|
3035
3258
|
type: "text",
|
|
@@ -3040,7 +3263,7 @@ function PostFiltersBar({
|
|
|
3040
3263
|
}
|
|
3041
3264
|
)
|
|
3042
3265
|
] }),
|
|
3043
|
-
/* @__PURE__ */ (0,
|
|
3266
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "flex items-center gap-1 rounded-lg bg-muted p-0.5", children: STATUS_TABS.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3044
3267
|
"button",
|
|
3045
3268
|
{
|
|
3046
3269
|
onClick: () => onStatusChange(tab.value),
|
|
@@ -3052,20 +3275,20 @@ function PostFiltersBar({
|
|
|
3052
3275
|
},
|
|
3053
3276
|
tab.value
|
|
3054
3277
|
)) }),
|
|
3055
|
-
/* @__PURE__ */ (0,
|
|
3056
|
-
onNew && /* @__PURE__ */ (0,
|
|
3278
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "flex-1" }),
|
|
3279
|
+
onNew && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
3057
3280
|
"button",
|
|
3058
3281
|
{
|
|
3059
3282
|
onClick: onNew,
|
|
3060
3283
|
className: "inline-flex items-center gap-1.5 h-8 rounded-lg bg-primary px-3 text-sm font-medium text-primary-foreground hover:bg-primary/90 transition-colors",
|
|
3061
3284
|
children: [
|
|
3062
|
-
/* @__PURE__ */ (0,
|
|
3285
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(IconPlus2, {}),
|
|
3063
3286
|
newLabel
|
|
3064
3287
|
]
|
|
3065
3288
|
}
|
|
3066
3289
|
)
|
|
3067
3290
|
] }),
|
|
3068
|
-
total !== void 0 && /* @__PURE__ */ (0,
|
|
3291
|
+
total !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("p", { className: "text-xs text-muted-foreground", children: [
|
|
3069
3292
|
total,
|
|
3070
3293
|
" ",
|
|
3071
3294
|
total === 1 ? typeLabel.replace(/s$/, "") : typeLabel
|
|
@@ -3074,9 +3297,9 @@ function PostFiltersBar({
|
|
|
3074
3297
|
}
|
|
3075
3298
|
|
|
3076
3299
|
// src/components/content/post-editor-shell.tsx
|
|
3077
|
-
var
|
|
3300
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
3078
3301
|
function IconArrowLeft() {
|
|
3079
|
-
return /* @__PURE__ */ (0,
|
|
3302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
3080
3303
|
"svg",
|
|
3081
3304
|
{
|
|
3082
3305
|
width: "14",
|
|
@@ -3088,14 +3311,14 @@ function IconArrowLeft() {
|
|
|
3088
3311
|
strokeLinecap: "round",
|
|
3089
3312
|
strokeLinejoin: "round",
|
|
3090
3313
|
children: [
|
|
3091
|
-
/* @__PURE__ */ (0,
|
|
3092
|
-
/* @__PURE__ */ (0,
|
|
3314
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("line", { x1: "19", y1: "12", x2: "5", y2: "12" }),
|
|
3315
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("polyline", { points: "12 19 5 12 12 5" })
|
|
3093
3316
|
]
|
|
3094
3317
|
}
|
|
3095
3318
|
);
|
|
3096
3319
|
}
|
|
3097
3320
|
function IconSpinner() {
|
|
3098
|
-
return /* @__PURE__ */ (0,
|
|
3321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
3099
3322
|
"svg",
|
|
3100
3323
|
{
|
|
3101
3324
|
width: "14",
|
|
@@ -3107,12 +3330,12 @@ function IconSpinner() {
|
|
|
3107
3330
|
strokeLinecap: "round",
|
|
3108
3331
|
strokeLinejoin: "round",
|
|
3109
3332
|
className: "animate-spin",
|
|
3110
|
-
children: /* @__PURE__ */ (0,
|
|
3333
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
|
|
3111
3334
|
}
|
|
3112
3335
|
);
|
|
3113
3336
|
}
|
|
3114
3337
|
function IconMoreHorizontal2() {
|
|
3115
|
-
return /* @__PURE__ */ (0,
|
|
3338
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
3116
3339
|
"svg",
|
|
3117
3340
|
{
|
|
3118
3341
|
width: "16",
|
|
@@ -3124,9 +3347,9 @@ function IconMoreHorizontal2() {
|
|
|
3124
3347
|
strokeLinecap: "round",
|
|
3125
3348
|
strokeLinejoin: "round",
|
|
3126
3349
|
children: [
|
|
3127
|
-
/* @__PURE__ */ (0,
|
|
3128
|
-
/* @__PURE__ */ (0,
|
|
3129
|
-
/* @__PURE__ */ (0,
|
|
3350
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("circle", { cx: "5", cy: "12", r: "1", fill: "currentColor" }),
|
|
3351
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("circle", { cx: "12", cy: "12", r: "1", fill: "currentColor" }),
|
|
3352
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("circle", { cx: "19", cy: "12", r: "1", fill: "currentColor" })
|
|
3130
3353
|
]
|
|
3131
3354
|
}
|
|
3132
3355
|
);
|
|
@@ -3144,60 +3367,60 @@ function PostEditorShell({
|
|
|
3144
3367
|
sidebar,
|
|
3145
3368
|
className
|
|
3146
3369
|
}) {
|
|
3147
|
-
return /* @__PURE__ */ (0,
|
|
3148
|
-
/* @__PURE__ */ (0,
|
|
3149
|
-
onBack && /* @__PURE__ */ (0,
|
|
3370
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: cn("flex flex-col h-screen bg-background overflow-hidden", className), children: [
|
|
3371
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center gap-3 h-14 px-4 border-b border-border bg-card shrink-0", children: [
|
|
3372
|
+
onBack && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
3150
3373
|
"button",
|
|
3151
3374
|
{
|
|
3152
3375
|
onClick: onBack,
|
|
3153
3376
|
className: "inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-sm text-muted-foreground hover:bg-accent hover:text-foreground transition-colors",
|
|
3154
3377
|
children: [
|
|
3155
|
-
/* @__PURE__ */ (0,
|
|
3378
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(IconArrowLeft, {}),
|
|
3156
3379
|
backLabel
|
|
3157
3380
|
]
|
|
3158
3381
|
}
|
|
3159
3382
|
),
|
|
3160
|
-
onBack && /* @__PURE__ */ (0,
|
|
3161
|
-
title && /* @__PURE__ */ (0,
|
|
3162
|
-
status && /* @__PURE__ */ (0,
|
|
3163
|
-
/* @__PURE__ */ (0,
|
|
3164
|
-
/* @__PURE__ */ (0,
|
|
3165
|
-
/* @__PURE__ */ (0,
|
|
3383
|
+
onBack && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "h-5 w-px bg-border" }),
|
|
3384
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "text-sm font-medium text-muted-foreground truncate max-w-xs", children: title }),
|
|
3385
|
+
status && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(PostStatusBadge, { status, size: "sm" }),
|
|
3386
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "flex-1" }),
|
|
3387
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("button", { className: "inline-flex items-center justify-center h-8 w-8 rounded-lg text-muted-foreground hover:bg-accent hover:text-foreground transition-colors", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(IconMoreHorizontal2, {}) }),
|
|
3388
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
3166
3389
|
"button",
|
|
3167
3390
|
{
|
|
3168
3391
|
onClick: onSave,
|
|
3169
3392
|
disabled: saving,
|
|
3170
3393
|
className: "inline-flex items-center gap-1.5 h-8 rounded-lg border border-border bg-background px-3 text-sm font-medium hover:bg-accent transition-colors disabled:opacity-60",
|
|
3171
3394
|
children: [
|
|
3172
|
-
saving && /* @__PURE__ */ (0,
|
|
3395
|
+
saving && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(IconSpinner, {}),
|
|
3173
3396
|
"Save Draft"
|
|
3174
3397
|
]
|
|
3175
3398
|
}
|
|
3176
3399
|
),
|
|
3177
|
-
/* @__PURE__ */ (0,
|
|
3400
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
3178
3401
|
"button",
|
|
3179
3402
|
{
|
|
3180
3403
|
onClick: onPublish,
|
|
3181
3404
|
disabled: publishing,
|
|
3182
3405
|
className: "inline-flex items-center gap-1.5 h-8 rounded-lg bg-primary px-3 text-sm font-medium text-primary-foreground hover:bg-primary/90 transition-colors disabled:opacity-60",
|
|
3183
3406
|
children: [
|
|
3184
|
-
publishing && /* @__PURE__ */ (0,
|
|
3407
|
+
publishing && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(IconSpinner, {}),
|
|
3185
3408
|
"Publish"
|
|
3186
3409
|
]
|
|
3187
3410
|
}
|
|
3188
3411
|
)
|
|
3189
3412
|
] }),
|
|
3190
|
-
/* @__PURE__ */ (0,
|
|
3191
|
-
/* @__PURE__ */ (0,
|
|
3192
|
-
/* @__PURE__ */ (0,
|
|
3413
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex flex-1 overflow-hidden", children: [
|
|
3414
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "flex-1 overflow-y-auto p-6", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "max-w-3xl mx-auto", children }) }),
|
|
3415
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "w-72 shrink-0 border-l border-border overflow-y-auto p-4", children: sidebar })
|
|
3193
3416
|
] })
|
|
3194
3417
|
] });
|
|
3195
3418
|
}
|
|
3196
3419
|
|
|
3197
3420
|
// src/components/content/slug-input.tsx
|
|
3198
|
-
var
|
|
3421
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
3199
3422
|
function IconRefresh() {
|
|
3200
|
-
return /* @__PURE__ */ (0,
|
|
3423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
3201
3424
|
"svg",
|
|
3202
3425
|
{
|
|
3203
3426
|
width: "13",
|
|
@@ -3209,9 +3432,9 @@ function IconRefresh() {
|
|
|
3209
3432
|
strokeLinecap: "round",
|
|
3210
3433
|
strokeLinejoin: "round",
|
|
3211
3434
|
children: [
|
|
3212
|
-
/* @__PURE__ */ (0,
|
|
3213
|
-
/* @__PURE__ */ (0,
|
|
3214
|
-
/* @__PURE__ */ (0,
|
|
3435
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("polyline", { points: "23 4 23 10 17 10" }),
|
|
3436
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("polyline", { points: "1 20 1 14 7 14" }),
|
|
3437
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("path", { d: "M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15" })
|
|
3215
3438
|
]
|
|
3216
3439
|
}
|
|
3217
3440
|
);
|
|
@@ -3224,10 +3447,10 @@ function SlugInput({
|
|
|
3224
3447
|
disabled = false,
|
|
3225
3448
|
className
|
|
3226
3449
|
}) {
|
|
3227
|
-
return /* @__PURE__ */ (0,
|
|
3228
|
-
/* @__PURE__ */ (0,
|
|
3229
|
-
prefix && /* @__PURE__ */ (0,
|
|
3230
|
-
/* @__PURE__ */ (0,
|
|
3450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: cn("space-y-1", className), children: [
|
|
3451
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
3452
|
+
prefix && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "shrink-0 text-sm text-muted-foreground select-none", children: prefix }),
|
|
3453
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3231
3454
|
"input",
|
|
3232
3455
|
{
|
|
3233
3456
|
type: "text",
|
|
@@ -3241,26 +3464,26 @@ function SlugInput({
|
|
|
3241
3464
|
placeholder: "your-slug-here"
|
|
3242
3465
|
}
|
|
3243
3466
|
),
|
|
3244
|
-
onGenerate && /* @__PURE__ */ (0,
|
|
3467
|
+
onGenerate && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3245
3468
|
"button",
|
|
3246
3469
|
{
|
|
3247
3470
|
onClick: onGenerate,
|
|
3248
3471
|
disabled,
|
|
3249
3472
|
title: "Generate slug",
|
|
3250
3473
|
className: "inline-flex items-center justify-center h-7 w-7 rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors disabled:opacity-60",
|
|
3251
|
-
children: /* @__PURE__ */ (0,
|
|
3474
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(IconRefresh, {})
|
|
3252
3475
|
}
|
|
3253
3476
|
)
|
|
3254
3477
|
] }),
|
|
3255
|
-
/* @__PURE__ */ (0,
|
|
3478
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("p", { className: "text-[10px] text-muted-foreground", children: "Only lowercase letters, numbers, and hyphens" })
|
|
3256
3479
|
] });
|
|
3257
3480
|
}
|
|
3258
3481
|
|
|
3259
3482
|
// src/components/content/post-sidebar-section.tsx
|
|
3260
3483
|
var React22 = __toESM(require("react"));
|
|
3261
|
-
var
|
|
3484
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
3262
3485
|
function IconChevronDown() {
|
|
3263
|
-
return /* @__PURE__ */ (0,
|
|
3486
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
3264
3487
|
"svg",
|
|
3265
3488
|
{
|
|
3266
3489
|
width: "14",
|
|
@@ -3271,7 +3494,7 @@ function IconChevronDown() {
|
|
|
3271
3494
|
strokeWidth: "2",
|
|
3272
3495
|
strokeLinecap: "round",
|
|
3273
3496
|
strokeLinejoin: "round",
|
|
3274
|
-
children: /* @__PURE__ */ (0,
|
|
3497
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("polyline", { points: "6 9 12 15 18 9" })
|
|
3275
3498
|
}
|
|
3276
3499
|
);
|
|
3277
3500
|
}
|
|
@@ -3282,28 +3505,28 @@ function PostSidebarSection({
|
|
|
3282
3505
|
className
|
|
3283
3506
|
}) {
|
|
3284
3507
|
const [open, setOpen] = React22.useState(defaultOpen);
|
|
3285
|
-
return /* @__PURE__ */ (0,
|
|
3286
|
-
/* @__PURE__ */ (0,
|
|
3508
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: cn("border-b border-border", className), children: [
|
|
3509
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
3287
3510
|
"button",
|
|
3288
3511
|
{
|
|
3289
3512
|
onClick: () => setOpen((v) => !v),
|
|
3290
3513
|
className: "flex w-full items-center justify-between py-3 px-0 text-sm font-medium text-foreground hover:text-primary transition-colors",
|
|
3291
3514
|
children: [
|
|
3292
3515
|
title,
|
|
3293
|
-
/* @__PURE__ */ (0,
|
|
3516
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
3294
3517
|
"span",
|
|
3295
3518
|
{
|
|
3296
3519
|
className: cn(
|
|
3297
3520
|
"text-muted-foreground transition-transform duration-200",
|
|
3298
3521
|
open ? "rotate-0" : "-rotate-90"
|
|
3299
3522
|
),
|
|
3300
|
-
children: /* @__PURE__ */ (0,
|
|
3523
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(IconChevronDown, {})
|
|
3301
3524
|
}
|
|
3302
3525
|
)
|
|
3303
3526
|
]
|
|
3304
3527
|
}
|
|
3305
3528
|
),
|
|
3306
|
-
/* @__PURE__ */ (0,
|
|
3529
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
3307
3530
|
"div",
|
|
3308
3531
|
{
|
|
3309
3532
|
className: cn(
|
|
@@ -3317,18 +3540,18 @@ function PostSidebarSection({
|
|
|
3317
3540
|
}
|
|
3318
3541
|
|
|
3319
3542
|
// src/components/ui/hsl-color-input.tsx
|
|
3320
|
-
var
|
|
3543
|
+
var import_react5 = require("react");
|
|
3321
3544
|
var import_color2 = __toESM(require("color"));
|
|
3322
3545
|
var Popover2 = __toESM(require("@radix-ui/react-popover"));
|
|
3323
3546
|
|
|
3324
3547
|
// src/components/ui/color-picker.tsx
|
|
3325
3548
|
var import_color = __toESM(require("color"));
|
|
3326
|
-
var
|
|
3549
|
+
var import_react4 = require("react");
|
|
3327
3550
|
var Slider = __toESM(require("@radix-ui/react-slider"));
|
|
3328
|
-
var
|
|
3329
|
-
var ColorPickerContext = (0,
|
|
3551
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3552
|
+
var ColorPickerContext = (0, import_react4.createContext)(void 0);
|
|
3330
3553
|
var useColorPicker = () => {
|
|
3331
|
-
const ctx = (0,
|
|
3554
|
+
const ctx = (0, import_react4.useContext)(ColorPickerContext);
|
|
3332
3555
|
if (!ctx) throw new Error("useColorPicker must be used within ColorPicker");
|
|
3333
3556
|
return ctx;
|
|
3334
3557
|
};
|
|
@@ -3346,52 +3569,51 @@ var ColorPicker = ({
|
|
|
3346
3569
|
return (0, import_color.default)("#000000");
|
|
3347
3570
|
}
|
|
3348
3571
|
})();
|
|
3349
|
-
const [hue, setHueState] = (0,
|
|
3350
|
-
const [saturation, setSaturationState] = (0,
|
|
3351
|
-
const [lightness, setLightnessState] = (0,
|
|
3352
|
-
const [alpha, setAlphaState] = (0,
|
|
3353
|
-
const [mode, setMode] = (0,
|
|
3354
|
-
const notifyRef = (0,
|
|
3355
|
-
(0,
|
|
3572
|
+
const [hue, setHueState] = (0, import_react4.useState)(initial.hue());
|
|
3573
|
+
const [saturation, setSaturationState] = (0, import_react4.useState)(initial.saturationl());
|
|
3574
|
+
const [lightness, setLightnessState] = (0, import_react4.useState)(initial.lightness());
|
|
3575
|
+
const [alpha, setAlphaState] = (0, import_react4.useState)(initial.alpha() * 100);
|
|
3576
|
+
const [mode, setMode] = (0, import_react4.useState)("HEX");
|
|
3577
|
+
const notifyRef = (0, import_react4.useRef)(onChange);
|
|
3578
|
+
(0, import_react4.useEffect)(() => {
|
|
3356
3579
|
notifyRef.current = onChange;
|
|
3357
3580
|
}, [onChange]);
|
|
3358
|
-
const notify = (0,
|
|
3359
|
-
|
|
3360
|
-
notifyRef.current?.(hex);
|
|
3581
|
+
const notify = (0, import_react4.useCallback)((h, s, l, a) => {
|
|
3582
|
+
notifyRef.current?.(import_color.default.hsl(h, s, l).alpha(a / 100).hexa());
|
|
3361
3583
|
}, []);
|
|
3362
|
-
const setHue = (0,
|
|
3584
|
+
const setHue = (0, import_react4.useCallback)((h) => {
|
|
3363
3585
|
setHueState(h);
|
|
3364
3586
|
notify(h, saturation, lightness, alpha);
|
|
3365
3587
|
}, [saturation, lightness, alpha, notify]);
|
|
3366
|
-
const setSaturation = (0,
|
|
3588
|
+
const setSaturation = (0, import_react4.useCallback)((s) => {
|
|
3367
3589
|
setSaturationState(s);
|
|
3368
3590
|
notify(hue, s, lightness, alpha);
|
|
3369
3591
|
}, [hue, lightness, alpha, notify]);
|
|
3370
|
-
const setLightness = (0,
|
|
3592
|
+
const setLightness = (0, import_react4.useCallback)((l) => {
|
|
3371
3593
|
setLightnessState(l);
|
|
3372
3594
|
notify(hue, saturation, l, alpha);
|
|
3373
3595
|
}, [hue, saturation, alpha, notify]);
|
|
3374
|
-
const setAlpha = (0,
|
|
3596
|
+
const setAlpha = (0, import_react4.useCallback)((a) => {
|
|
3375
3597
|
setAlphaState(a);
|
|
3376
3598
|
notify(hue, saturation, lightness, a);
|
|
3377
3599
|
}, [hue, saturation, lightness, notify]);
|
|
3378
|
-
return /* @__PURE__ */ (0,
|
|
3600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ColorPickerContext.Provider, { value: { hue, saturation, lightness, alpha, mode, setHue, setSaturation, setLightness, setAlpha, setMode }, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: cn("flex flex-col gap-3", className), ...props, children }) });
|
|
3379
3601
|
};
|
|
3380
|
-
var ColorPickerSelection = (0,
|
|
3381
|
-
const containerRef = (0,
|
|
3382
|
-
const [isDragging, setIsDragging] = (0,
|
|
3602
|
+
var ColorPickerSelection = (0, import_react4.memo)(({ className, ...props }) => {
|
|
3603
|
+
const containerRef = (0, import_react4.useRef)(null);
|
|
3604
|
+
const [isDragging, setIsDragging] = (0, import_react4.useState)(false);
|
|
3383
3605
|
const { hue, saturation, lightness, setSaturation, setLightness } = useColorPicker();
|
|
3384
|
-
const [posX, setPosX] = (0,
|
|
3385
|
-
const [posY, setPosY] = (0,
|
|
3606
|
+
const [posX, setPosX] = (0, import_react4.useState)(() => saturation / 100);
|
|
3607
|
+
const [posY, setPosY] = (0, import_react4.useState)(() => {
|
|
3386
3608
|
const x = saturation / 100;
|
|
3387
3609
|
const topL = x < 0.01 ? 100 : 50 + 50 * (1 - x);
|
|
3388
3610
|
return topL > 0 ? Math.max(0, Math.min(1, 1 - lightness / topL)) : 0;
|
|
3389
3611
|
});
|
|
3390
|
-
const bg = (0,
|
|
3612
|
+
const bg = (0, import_react4.useMemo)(
|
|
3391
3613
|
() => `linear-gradient(0deg,rgba(0,0,0,1),rgba(0,0,0,0)),linear-gradient(90deg,rgba(255,255,255,1),rgba(255,255,255,0)),hsl(${hue},100%,50%)`,
|
|
3392
3614
|
[hue]
|
|
3393
3615
|
);
|
|
3394
|
-
const handleMove = (0,
|
|
3616
|
+
const handleMove = (0, import_react4.useCallback)((e) => {
|
|
3395
3617
|
if (!isDragging || !containerRef.current) return;
|
|
3396
3618
|
const rect = containerRef.current.getBoundingClientRect();
|
|
3397
3619
|
const x = Math.max(0, Math.min(1, (e.clientX - rect.left) / rect.width));
|
|
@@ -3399,10 +3621,9 @@ var ColorPickerSelection = (0, import_react.memo)(({ className, ...props }) => {
|
|
|
3399
3621
|
setPosX(x);
|
|
3400
3622
|
setPosY(y);
|
|
3401
3623
|
setSaturation(x * 100);
|
|
3402
|
-
|
|
3403
|
-
setLightness(topL * (1 - y));
|
|
3624
|
+
setLightness((x < 0.01 ? 100 : 50 + 50 * (1 - x)) * (1 - y));
|
|
3404
3625
|
}, [isDragging, setSaturation, setLightness]);
|
|
3405
|
-
(0,
|
|
3626
|
+
(0, import_react4.useEffect)(() => {
|
|
3406
3627
|
if (!isDragging) return;
|
|
3407
3628
|
const up = () => setIsDragging(false);
|
|
3408
3629
|
window.addEventListener("pointermove", handleMove);
|
|
@@ -3412,7 +3633,7 @@ var ColorPickerSelection = (0, import_react.memo)(({ className, ...props }) => {
|
|
|
3412
3633
|
window.removeEventListener("pointerup", up);
|
|
3413
3634
|
};
|
|
3414
3635
|
}, [isDragging, handleMove]);
|
|
3415
|
-
return /* @__PURE__ */ (0,
|
|
3636
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3416
3637
|
"div",
|
|
3417
3638
|
{
|
|
3418
3639
|
ref: containerRef,
|
|
@@ -3424,15 +3645,11 @@ var ColorPickerSelection = (0, import_react.memo)(({ className, ...props }) => {
|
|
|
3424
3645
|
handleMove(e.nativeEvent);
|
|
3425
3646
|
},
|
|
3426
3647
|
...props,
|
|
3427
|
-
children: /* @__PURE__ */ (0,
|
|
3648
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3428
3649
|
"div",
|
|
3429
3650
|
{
|
|
3430
3651
|
className: "pointer-events-none absolute h-4 w-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white",
|
|
3431
|
-
style: {
|
|
3432
|
-
left: `${posX * 100}%`,
|
|
3433
|
-
top: `${posY * 100}%`,
|
|
3434
|
-
boxShadow: "0 0 0 1px rgba(0,0,0,0.6)"
|
|
3435
|
-
}
|
|
3652
|
+
style: { left: `${posX * 100}%`, top: `${posY * 100}%`, boxShadow: "0 0 0 1px rgba(0,0,0,0.6)" }
|
|
3436
3653
|
}
|
|
3437
3654
|
)
|
|
3438
3655
|
}
|
|
@@ -3441,119 +3658,82 @@ var ColorPickerSelection = (0, import_react.memo)(({ className, ...props }) => {
|
|
|
3441
3658
|
ColorPickerSelection.displayName = "ColorPickerSelection";
|
|
3442
3659
|
var ColorPickerHue = ({ className, ...props }) => {
|
|
3443
3660
|
const { hue, setHue } = useColorPicker();
|
|
3444
|
-
return /* @__PURE__ */ (0,
|
|
3445
|
-
Slider.
|
|
3446
|
-
{
|
|
3447
|
-
|
|
3448
|
-
max: 360,
|
|
3449
|
-
step: 1,
|
|
3450
|
-
value: [hue],
|
|
3451
|
-
onValueChange: ([h]) => setHue(h),
|
|
3452
|
-
...props,
|
|
3453
|
-
children: [
|
|
3454
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Slider.Track, { className: "relative h-3 w-full grow rounded-full bg-[linear-gradient(90deg,#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00)]", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Slider.Range, { className: "absolute h-full" }) }),
|
|
3455
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Slider.Thumb, { className: "block h-4 w-4 rounded-full border-2 border-white shadow-md focus:outline-none", style: { boxShadow: "0 0 0 1px rgba(0,0,0,0.4)" } })
|
|
3456
|
-
]
|
|
3457
|
-
}
|
|
3458
|
-
);
|
|
3661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Slider.Root, { className: cn("relative flex h-4 w-full touch-none items-center", className), max: 360, step: 1, value: [hue], onValueChange: ([h]) => setHue(h), ...props, children: [
|
|
3662
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Slider.Track, { className: "relative h-3 w-full grow rounded-full bg-[linear-gradient(90deg,#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00)]", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Slider.Range, { className: "absolute h-full" }) }),
|
|
3663
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Slider.Thumb, { className: "block h-4 w-4 rounded-full border-2 border-white shadow-md focus:outline-none", style: { boxShadow: "0 0 0 1px rgba(0,0,0,0.4)" } })
|
|
3664
|
+
] });
|
|
3459
3665
|
};
|
|
3460
3666
|
var ColorPickerAlpha = ({ className, ...props }) => {
|
|
3461
3667
|
const { alpha, setAlpha, hue, saturation, lightness } = useColorPicker();
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
{
|
|
3466
|
-
|
|
3467
|
-
max: 100,
|
|
3468
|
-
step: 1,
|
|
3469
|
-
value: [alpha],
|
|
3470
|
-
onValueChange: ([a]) => setAlpha(a),
|
|
3471
|
-
...props,
|
|
3472
|
-
children: [
|
|
3473
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3474
|
-
Slider.Track,
|
|
3475
|
-
{
|
|
3476
|
-
className: "relative h-3 w-full grow rounded-full",
|
|
3477
|
-
style: {
|
|
3478
|
-
backgroundImage: `linear-gradient(90deg, transparent, ${solidColor}), url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==")`
|
|
3479
|
-
},
|
|
3480
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Slider.Range, { className: "absolute h-full" })
|
|
3481
|
-
}
|
|
3482
|
-
),
|
|
3483
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Slider.Thumb, { className: "block h-4 w-4 rounded-full border-2 border-white shadow-md focus:outline-none", style: { boxShadow: "0 0 0 1px rgba(0,0,0,0.4)" } })
|
|
3484
|
-
]
|
|
3485
|
-
}
|
|
3486
|
-
);
|
|
3487
|
-
};
|
|
3488
|
-
var ColorPickerHexOutput = ({ className, ...props }) => {
|
|
3489
|
-
const { hue, saturation, lightness, alpha } = useColorPicker();
|
|
3490
|
-
const hex = import_color.default.hsl(hue, saturation, lightness).alpha(alpha / 100).hex();
|
|
3491
|
-
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: cn("flex items-center gap-1.5 px-1", className), ...props, children: [
|
|
3492
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "w-5 h-5 rounded border border-white/20 shrink-0", style: { background: `hsl(${hue},${saturation}%,${lightness}%)` } }),
|
|
3493
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "text-xs font-mono text-white/50 flex-1", children: hex })
|
|
3668
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Slider.Root, { className: cn("relative flex h-4 w-full touch-none items-center", className), max: 100, step: 1, value: [alpha], onValueChange: ([a]) => setAlpha(a), ...props, children: [
|
|
3669
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Slider.Track, { className: "relative h-3 w-full grow rounded-full", style: {
|
|
3670
|
+
backgroundImage: `linear-gradient(90deg,transparent,hsl(${hue},${saturation}%,${lightness}%)),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==")`
|
|
3671
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Slider.Range, { className: "absolute h-full" }) }),
|
|
3672
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Slider.Thumb, { className: "block h-4 w-4 rounded-full border-2 border-white shadow-md focus:outline-none", style: { boxShadow: "0 0 0 1px rgba(0,0,0,0.4)" } })
|
|
3494
3673
|
] });
|
|
3495
3674
|
};
|
|
3496
3675
|
var ColorPickerEyeDropper = ({ className, ...props }) => {
|
|
3497
3676
|
const { setHue, setSaturation, setLightness, setAlpha } = useColorPicker();
|
|
3498
|
-
|
|
3499
|
-
try {
|
|
3500
|
-
const result = await new EyeDropper().open();
|
|
3501
|
-
const c = (0, import_color.default)(result.sRGBHex);
|
|
3502
|
-
setHue(c.hue());
|
|
3503
|
-
setSaturation(c.saturationl());
|
|
3504
|
-
setLightness(c.lightness());
|
|
3505
|
-
setAlpha(100);
|
|
3506
|
-
} catch {
|
|
3507
|
-
}
|
|
3508
|
-
};
|
|
3509
|
-
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3510
3678
|
"button",
|
|
3511
3679
|
{
|
|
3512
3680
|
type: "button",
|
|
3513
|
-
onClick: pick,
|
|
3514
3681
|
title: "Eye dropper",
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3682
|
+
onClick: async () => {
|
|
3683
|
+
try {
|
|
3684
|
+
const r = await new EyeDropper().open();
|
|
3685
|
+
const c = (0, import_color.default)(r.sRGBHex);
|
|
3686
|
+
setHue(c.hue());
|
|
3687
|
+
setSaturation(c.saturationl());
|
|
3688
|
+
setLightness(c.lightness());
|
|
3689
|
+
setAlpha(100);
|
|
3690
|
+
} catch {
|
|
3691
|
+
}
|
|
3692
|
+
},
|
|
3693
|
+
className: cn("shrink-0 focus:outline-none", className),
|
|
3694
|
+
style: { width: 32, height: 32, display: "flex", alignItems: "center", justifyContent: "center", borderRadius: 6, border: "1px solid rgba(255,255,255,0.12)", backgroundColor: "rgba(255,255,255,0.05)", color: "rgba(255,255,255,0.5)", cursor: "pointer" },
|
|
3521
3695
|
...props,
|
|
3522
|
-
children: /* @__PURE__ */ (0,
|
|
3523
|
-
/* @__PURE__ */ (0,
|
|
3524
|
-
/* @__PURE__ */ (0,
|
|
3525
|
-
/* @__PURE__ */ (0,
|
|
3696
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
3697
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("path", { d: "M9.53 16.122a3 3 0 0 0-5.78 1.128 2.25 2.25 0 0 1-2.4 2.245 4.5 4.5 0 0 0 8.4-2.245c0-.399-.078-.78-.22-1.128Z" }),
|
|
3698
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("path", { d: "m13.5 10.5 2.25-2.25m0 0 2.25-2.25M15.75 8.25l2.25 2.25M15.75 8.25 13.5 6m4.5-1.5 1.5-1.5" }),
|
|
3699
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("path", { d: "M6.75 7.5 10.5 4.5c.5-.375 1.25-.375 1.5 0l6.75 6.75c.375.5.375 1.25 0 1.5L15 16.5" })
|
|
3526
3700
|
] })
|
|
3527
3701
|
}
|
|
3528
3702
|
);
|
|
3529
3703
|
};
|
|
3530
3704
|
var ColorPickerOutput = ({ className, ...props }) => {
|
|
3531
3705
|
const { mode, setMode } = useColorPicker();
|
|
3532
|
-
return /* @__PURE__ */ (0,
|
|
3533
|
-
/* @__PURE__ */ (0,
|
|
3534
|
-
|
|
3535
|
-
SelectContent,
|
|
3706
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: cn("relative shrink-0", className), ...props, children: [
|
|
3707
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3708
|
+
"select",
|
|
3536
3709
|
{
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3710
|
+
value: mode,
|
|
3711
|
+
onChange: (e) => setMode(e.target.value),
|
|
3712
|
+
style: {
|
|
3713
|
+
height: 32,
|
|
3714
|
+
width: 72,
|
|
3715
|
+
backgroundColor: "rgba(255,255,255,0.06)",
|
|
3716
|
+
border: "1px solid rgba(255,255,255,0.12)",
|
|
3717
|
+
borderRadius: 6,
|
|
3718
|
+
color: "rgba(255,255,255,0.75)",
|
|
3719
|
+
fontSize: 12,
|
|
3720
|
+
paddingLeft: 8,
|
|
3721
|
+
paddingRight: 24,
|
|
3722
|
+
outline: "none",
|
|
3723
|
+
cursor: "pointer",
|
|
3724
|
+
appearance: "none",
|
|
3725
|
+
WebkitAppearance: "none"
|
|
3726
|
+
},
|
|
3727
|
+
children: ["HEX", "HSL", "RGB"].map((f) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("option", { value: f, style: { backgroundColor: "#1e2130", color: "rgba(255,255,255,0.8)" }, children: f }, f))
|
|
3549
3728
|
}
|
|
3550
|
-
)
|
|
3729
|
+
),
|
|
3730
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("svg", { style: { position: "absolute", right: 6, top: "50%", transform: "translateY(-50%)", width: 12, height: 12, color: "rgba(255,255,255,0.35)", pointerEvents: "none" }, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("path", { d: "m6 9 6 6 6-6" }) })
|
|
3551
3731
|
] });
|
|
3552
3732
|
};
|
|
3553
3733
|
var ColorPickerFormat = ({ className, ...props }) => {
|
|
3554
3734
|
const { hue, saturation, lightness, alpha, mode, setHue, setSaturation, setLightness, setAlpha } = useColorPicker();
|
|
3555
|
-
const [focused, setFocused] = (0,
|
|
3556
|
-
const [localVal, setLocalVal] = (0,
|
|
3735
|
+
const [focused, setFocused] = (0, import_react4.useState)(false);
|
|
3736
|
+
const [localVal, setLocalVal] = (0, import_react4.useState)("");
|
|
3557
3737
|
const computedVal = (() => {
|
|
3558
3738
|
try {
|
|
3559
3739
|
const c = import_color.default.hsl(hue, saturation, lightness).alpha(alpha / 100);
|
|
@@ -3567,29 +3747,28 @@ var ColorPickerFormat = ({ className, ...props }) => {
|
|
|
3567
3747
|
}
|
|
3568
3748
|
return "";
|
|
3569
3749
|
})();
|
|
3570
|
-
(0,
|
|
3750
|
+
(0, import_react4.useEffect)(() => {
|
|
3571
3751
|
if (!focused) setLocalVal(computedVal);
|
|
3572
3752
|
}, [computedVal, focused]);
|
|
3573
3753
|
const tryApply = (raw) => {
|
|
3574
3754
|
try {
|
|
3575
3755
|
if (mode === "HEX") {
|
|
3576
|
-
const
|
|
3577
|
-
const c = (0, import_color.default)(hex);
|
|
3756
|
+
const c = (0, import_color.default)(raw.startsWith("#") ? raw : `#${raw}`);
|
|
3578
3757
|
setHue(c.hue());
|
|
3579
3758
|
setSaturation(c.saturationl());
|
|
3580
3759
|
setLightness(c.lightness());
|
|
3581
3760
|
setAlpha(c.alpha() * 100);
|
|
3582
3761
|
} else if (mode === "HSL") {
|
|
3583
|
-
const
|
|
3584
|
-
if (
|
|
3585
|
-
setHue(+
|
|
3586
|
-
setSaturation(+
|
|
3587
|
-
setLightness(+
|
|
3762
|
+
const p = raw.split(/[\s,%]+/).filter(Boolean);
|
|
3763
|
+
if (p.length >= 3) {
|
|
3764
|
+
setHue(+p[0]);
|
|
3765
|
+
setSaturation(+p[1]);
|
|
3766
|
+
setLightness(+p[2]);
|
|
3588
3767
|
}
|
|
3589
3768
|
} else if (mode === "RGB") {
|
|
3590
|
-
const
|
|
3591
|
-
if (
|
|
3592
|
-
const c = import_color.default.rgb(+
|
|
3769
|
+
const p = raw.split(/[\s,]+/).filter(Boolean);
|
|
3770
|
+
if (p.length >= 3) {
|
|
3771
|
+
const c = import_color.default.rgb(+p[0], +p[1], +p[2]);
|
|
3593
3772
|
setHue(c.hue());
|
|
3594
3773
|
setSaturation(c.saturationl());
|
|
3595
3774
|
setLightness(c.lightness());
|
|
@@ -3598,7 +3777,7 @@ var ColorPickerFormat = ({ className, ...props }) => {
|
|
|
3598
3777
|
} catch {
|
|
3599
3778
|
}
|
|
3600
3779
|
};
|
|
3601
|
-
return /* @__PURE__ */ (0,
|
|
3780
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3602
3781
|
"input",
|
|
3603
3782
|
{
|
|
3604
3783
|
type: "text",
|
|
@@ -3615,18 +3794,35 @@ var ColorPickerFormat = ({ className, ...props }) => {
|
|
|
3615
3794
|
tryApply(localVal);
|
|
3616
3795
|
setFocused(false);
|
|
3617
3796
|
},
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3797
|
+
style: {
|
|
3798
|
+
flex: 1,
|
|
3799
|
+
minWidth: 0,
|
|
3800
|
+
height: 32,
|
|
3801
|
+
backgroundColor: "rgba(255,255,255,0.05)",
|
|
3802
|
+
border: "1px solid rgba(255,255,255,0.12)",
|
|
3803
|
+
borderRadius: 6,
|
|
3804
|
+
padding: "0 8px",
|
|
3805
|
+
color: "rgba(255,255,255,0.75)",
|
|
3806
|
+
fontSize: 12,
|
|
3807
|
+
fontFamily: "monospace",
|
|
3808
|
+
outline: "none"
|
|
3809
|
+
},
|
|
3810
|
+
className,
|
|
3623
3811
|
...props
|
|
3624
3812
|
}
|
|
3625
3813
|
);
|
|
3626
3814
|
};
|
|
3815
|
+
var ColorPickerHexOutput = ({ className, ...props }) => {
|
|
3816
|
+
const { hue, saturation, lightness } = useColorPicker();
|
|
3817
|
+
const hex = import_color.default.hsl(hue, saturation, lightness).hex();
|
|
3818
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: cn("flex items-center gap-1.5 px-0.5", className), ...props, children: [
|
|
3819
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "w-5 h-5 rounded border border-white/20 shrink-0", style: { background: `hsl(${hue},${saturation}%,${lightness}%)` } }),
|
|
3820
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "text-xs font-mono text-white/50", children: hex })
|
|
3821
|
+
] });
|
|
3822
|
+
};
|
|
3627
3823
|
|
|
3628
3824
|
// src/components/ui/hsl-color-input.tsx
|
|
3629
|
-
var
|
|
3825
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
3630
3826
|
function hslToHex(hsl) {
|
|
3631
3827
|
if (!hsl) return "#000000";
|
|
3632
3828
|
try {
|
|
@@ -3649,7 +3845,7 @@ function hexToHsl(hex) {
|
|
|
3649
3845
|
}
|
|
3650
3846
|
function ColorReader({ onHexChange }) {
|
|
3651
3847
|
const { hue, saturation, lightness, alpha } = useColorPicker();
|
|
3652
|
-
(0,
|
|
3848
|
+
(0, import_react5.useEffect)(() => {
|
|
3653
3849
|
try {
|
|
3654
3850
|
const hex = import_color2.default.hsl(hue, saturation, lightness).alpha(alpha / 100).hex();
|
|
3655
3851
|
onHexChange(hex);
|
|
@@ -3659,21 +3855,21 @@ function ColorReader({ onHexChange }) {
|
|
|
3659
3855
|
return null;
|
|
3660
3856
|
}
|
|
3661
3857
|
function HslColorInput({ value, onChange, className, inputClassName, disabled }) {
|
|
3662
|
-
const [open, setOpen] = (0,
|
|
3858
|
+
const [open, setOpen] = (0, import_react5.useState)(false);
|
|
3663
3859
|
const hexValue = hslToHex(value);
|
|
3664
3860
|
const cssColor = value ? `hsl(${value})` : "transparent";
|
|
3665
|
-
const pendingHexRef = (0,
|
|
3666
|
-
const onChangeRef = (0,
|
|
3667
|
-
(0,
|
|
3861
|
+
const pendingHexRef = (0, import_react5.useRef)(hexValue);
|
|
3862
|
+
const onChangeRef = (0, import_react5.useRef)(onChange);
|
|
3863
|
+
(0, import_react5.useEffect)(() => {
|
|
3668
3864
|
onChangeRef.current = onChange;
|
|
3669
3865
|
}, [onChange]);
|
|
3670
|
-
(0,
|
|
3866
|
+
(0, import_react5.useEffect)(() => {
|
|
3671
3867
|
if (open) pendingHexRef.current = hexValue;
|
|
3672
3868
|
}, [open, hexValue]);
|
|
3673
|
-
const handleHexChange = (0,
|
|
3869
|
+
const handleHexChange = (0, import_react5.useCallback)((hex) => {
|
|
3674
3870
|
pendingHexRef.current = hex;
|
|
3675
3871
|
}, []);
|
|
3676
|
-
const handleOpenChange = (0,
|
|
3872
|
+
const handleOpenChange = (0, import_react5.useCallback)((newOpen) => {
|
|
3677
3873
|
if (!newOpen && open) {
|
|
3678
3874
|
const pending = pendingHexRef.current;
|
|
3679
3875
|
if (pending && pending !== hexValue) {
|
|
@@ -3682,8 +3878,8 @@ function HslColorInput({ value, onChange, className, inputClassName, disabled })
|
|
|
3682
3878
|
}
|
|
3683
3879
|
setOpen(newOpen);
|
|
3684
3880
|
}, [open, hexValue]);
|
|
3685
|
-
return /* @__PURE__ */ (0,
|
|
3686
|
-
/* @__PURE__ */ (0,
|
|
3881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Popover2.Root, { open, onOpenChange: disabled ? void 0 : handleOpenChange, children: [
|
|
3882
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Popover2.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
3687
3883
|
"button",
|
|
3688
3884
|
{
|
|
3689
3885
|
type: "button",
|
|
@@ -3698,18 +3894,18 @@ function HslColorInput({ value, onChange, className, inputClassName, disabled })
|
|
|
3698
3894
|
),
|
|
3699
3895
|
"aria-label": "Pick color",
|
|
3700
3896
|
children: [
|
|
3701
|
-
/* @__PURE__ */ (0,
|
|
3897
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3702
3898
|
"span",
|
|
3703
3899
|
{
|
|
3704
3900
|
className: "w-4 h-4 rounded-full border border-white/20 shrink-0 inline-block",
|
|
3705
3901
|
style: { background: cssColor }
|
|
3706
3902
|
}
|
|
3707
3903
|
),
|
|
3708
|
-
/* @__PURE__ */ (0,
|
|
3904
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { children: hexValue.toUpperCase() })
|
|
3709
3905
|
]
|
|
3710
3906
|
}
|
|
3711
3907
|
) }),
|
|
3712
|
-
/* @__PURE__ */ (0,
|
|
3908
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Popover2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3713
3909
|
Popover2.Content,
|
|
3714
3910
|
{
|
|
3715
3911
|
sideOffset: 6,
|
|
@@ -3720,19 +3916,19 @@ function HslColorInput({ value, onChange, className, inputClassName, disabled })
|
|
|
3720
3916
|
"focus:outline-none"
|
|
3721
3917
|
),
|
|
3722
3918
|
onInteractOutside: () => handleOpenChange(false),
|
|
3723
|
-
children: open && /* @__PURE__ */ (0,
|
|
3724
|
-
/* @__PURE__ */ (0,
|
|
3725
|
-
/* @__PURE__ */ (0,
|
|
3726
|
-
/* @__PURE__ */ (0,
|
|
3727
|
-
/* @__PURE__ */ (0,
|
|
3728
|
-
/* @__PURE__ */ (0,
|
|
3729
|
-
/* @__PURE__ */ (0,
|
|
3730
|
-
/* @__PURE__ */ (0,
|
|
3919
|
+
children: open && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(ColorPicker, { defaultValue: hexValue, className: "gap-2.5", children: [
|
|
3920
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ColorReader, { onHexChange: handleHexChange }),
|
|
3921
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ColorPickerSelection, { className: "h-32 w-full rounded-lg" }),
|
|
3922
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
3923
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ColorPickerEyeDropper, {}),
|
|
3924
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex flex-col gap-1.5 flex-1", children: [
|
|
3925
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ColorPickerHue, {}),
|
|
3926
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ColorPickerAlpha, {})
|
|
3731
3927
|
] })
|
|
3732
3928
|
] }),
|
|
3733
|
-
/* @__PURE__ */ (0,
|
|
3734
|
-
/* @__PURE__ */ (0,
|
|
3735
|
-
/* @__PURE__ */ (0,
|
|
3929
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center gap-1.5 min-w-0", children: [
|
|
3930
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ColorPickerOutput, {}),
|
|
3931
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ColorPickerFormat, { className: "min-w-0" })
|
|
3736
3932
|
] })
|
|
3737
3933
|
] }, hexValue)
|
|
3738
3934
|
}
|
|
@@ -3741,9 +3937,9 @@ function HslColorInput({ value, onChange, className, inputClassName, disabled })
|
|
|
3741
3937
|
}
|
|
3742
3938
|
|
|
3743
3939
|
// src/hooks/index.ts
|
|
3744
|
-
var
|
|
3940
|
+
var import_react6 = require("react");
|
|
3745
3941
|
function useDisclosure(initial = false) {
|
|
3746
|
-
const [isOpen, setIsOpen] = (0,
|
|
3942
|
+
const [isOpen, setIsOpen] = (0, import_react6.useState)(initial);
|
|
3747
3943
|
return {
|
|
3748
3944
|
isOpen,
|
|
3749
3945
|
open: () => setIsOpen(true),
|
|
@@ -3753,15 +3949,15 @@ function useDisclosure(initial = false) {
|
|
|
3753
3949
|
};
|
|
3754
3950
|
}
|
|
3755
3951
|
function usePagination(total, pageSize = 20) {
|
|
3756
|
-
const [page, setPage] = (0,
|
|
3952
|
+
const [page, setPage] = (0, import_react6.useState)(1);
|
|
3757
3953
|
const totalPages = Math.ceil(total / pageSize);
|
|
3758
3954
|
return { page, setPage, pageSize, total, totalPages };
|
|
3759
3955
|
}
|
|
3760
3956
|
|
|
3761
3957
|
// src/components/auth/AuthShell.tsx
|
|
3762
|
-
var
|
|
3958
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
3763
3959
|
function AuthShell({ children, pattern = "dots", maxWidth = "520px" }) {
|
|
3764
|
-
return /* @__PURE__ */ (0,
|
|
3960
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
3765
3961
|
"div",
|
|
3766
3962
|
{
|
|
3767
3963
|
style: {
|
|
@@ -3776,7 +3972,7 @@ function AuthShell({ children, pattern = "dots", maxWidth = "520px" }) {
|
|
|
3776
3972
|
overflow: "hidden"
|
|
3777
3973
|
},
|
|
3778
3974
|
children: [
|
|
3779
|
-
pattern === "dots" && /* @__PURE__ */ (0,
|
|
3975
|
+
pattern === "dots" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3780
3976
|
"div",
|
|
3781
3977
|
{
|
|
3782
3978
|
"aria-hidden": true,
|
|
@@ -3790,7 +3986,7 @@ function AuthShell({ children, pattern = "dots", maxWidth = "520px" }) {
|
|
|
3790
3986
|
}
|
|
3791
3987
|
}
|
|
3792
3988
|
),
|
|
3793
|
-
pattern === "grid" && /* @__PURE__ */ (0,
|
|
3989
|
+
pattern === "grid" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3794
3990
|
"div",
|
|
3795
3991
|
{
|
|
3796
3992
|
"aria-hidden": true,
|
|
@@ -3804,16 +4000,16 @@ function AuthShell({ children, pattern = "dots", maxWidth = "520px" }) {
|
|
|
3804
4000
|
}
|
|
3805
4001
|
}
|
|
3806
4002
|
),
|
|
3807
|
-
/* @__PURE__ */ (0,
|
|
4003
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { style: { position: "relative", zIndex: 1, width: "100%", maxWidth }, children })
|
|
3808
4004
|
]
|
|
3809
4005
|
}
|
|
3810
4006
|
);
|
|
3811
4007
|
}
|
|
3812
4008
|
|
|
3813
4009
|
// src/components/auth/AuthCard.tsx
|
|
3814
|
-
var
|
|
4010
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
3815
4011
|
function AuthCard({ children, padding = "24px 28px" }) {
|
|
3816
|
-
return /* @__PURE__ */ (0,
|
|
4012
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
3817
4013
|
"div",
|
|
3818
4014
|
{
|
|
3819
4015
|
style: {
|
|
@@ -3830,10 +4026,10 @@ function AuthCard({ children, padding = "24px 28px" }) {
|
|
|
3830
4026
|
}
|
|
3831
4027
|
|
|
3832
4028
|
// src/components/auth/AuthLogo.tsx
|
|
3833
|
-
var
|
|
4029
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
3834
4030
|
function AuthLogo({ appName = "Builify CMS", letter = "B", imageUrl, size = 36 }) {
|
|
3835
|
-
return /* @__PURE__ */ (0,
|
|
3836
|
-
imageUrl ? /* @__PURE__ */ (0,
|
|
4031
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: "10px", marginBottom: "28px" }, children: [
|
|
4032
|
+
imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
3837
4033
|
"img",
|
|
3838
4034
|
{
|
|
3839
4035
|
src: imageUrl,
|
|
@@ -3842,7 +4038,7 @@ function AuthLogo({ appName = "Builify CMS", letter = "B", imageUrl, size = 36 }
|
|
|
3842
4038
|
height: size,
|
|
3843
4039
|
style: { borderRadius: "calc(var(--radius, 0.5rem) * 1.2)", flexShrink: 0, display: "block" }
|
|
3844
4040
|
}
|
|
3845
|
-
) : /* @__PURE__ */ (0,
|
|
4041
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
3846
4042
|
"div",
|
|
3847
4043
|
{
|
|
3848
4044
|
style: {
|
|
@@ -3861,7 +4057,7 @@ function AuthLogo({ appName = "Builify CMS", letter = "B", imageUrl, size = 36 }
|
|
|
3861
4057
|
children: letter
|
|
3862
4058
|
}
|
|
3863
4059
|
),
|
|
3864
|
-
/* @__PURE__ */ (0,
|
|
4060
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
3865
4061
|
"span",
|
|
3866
4062
|
{
|
|
3867
4063
|
style: {
|
|
@@ -3877,10 +4073,10 @@ function AuthLogo({ appName = "Builify CMS", letter = "B", imageUrl, size = 36 }
|
|
|
3877
4073
|
}
|
|
3878
4074
|
|
|
3879
4075
|
// src/components/auth/AuthHeader.tsx
|
|
3880
|
-
var
|
|
4076
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
3881
4077
|
function AuthHeader({ title, description }) {
|
|
3882
|
-
return /* @__PURE__ */ (0,
|
|
3883
|
-
/* @__PURE__ */ (0,
|
|
4078
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { style: { marginBottom: "24px", textAlign: "center" }, children: [
|
|
4079
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
3884
4080
|
"h1",
|
|
3885
4081
|
{
|
|
3886
4082
|
style: {
|
|
@@ -3893,7 +4089,7 @@ function AuthHeader({ title, description }) {
|
|
|
3893
4089
|
children: title
|
|
3894
4090
|
}
|
|
3895
4091
|
),
|
|
3896
|
-
description && /* @__PURE__ */ (0,
|
|
4092
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
3897
4093
|
"p",
|
|
3898
4094
|
{
|
|
3899
4095
|
style: {
|
|
@@ -3909,12 +4105,12 @@ function AuthHeader({ title, description }) {
|
|
|
3909
4105
|
}
|
|
3910
4106
|
|
|
3911
4107
|
// src/components/auth/AuthField.tsx
|
|
3912
|
-
var
|
|
4108
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
3913
4109
|
function AuthField({ label, error, hint, rightLabel, id, ...props }) {
|
|
3914
4110
|
const fieldId = id ?? label.toLowerCase().replace(/\s+/g, "-");
|
|
3915
|
-
return /* @__PURE__ */ (0,
|
|
3916
|
-
/* @__PURE__ */ (0,
|
|
3917
|
-
/* @__PURE__ */ (0,
|
|
4111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "6px" }, children: [
|
|
4112
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
|
|
4113
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
3918
4114
|
"label",
|
|
3919
4115
|
{
|
|
3920
4116
|
htmlFor: fieldId,
|
|
@@ -3926,9 +4122,9 @@ function AuthField({ label, error, hint, rightLabel, id, ...props }) {
|
|
|
3926
4122
|
children: label
|
|
3927
4123
|
}
|
|
3928
4124
|
),
|
|
3929
|
-
rightLabel && /* @__PURE__ */ (0,
|
|
4125
|
+
rightLabel && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { style: { fontSize: "0.8125rem" }, children: rightLabel })
|
|
3930
4126
|
] }),
|
|
3931
|
-
/* @__PURE__ */ (0,
|
|
4127
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
3932
4128
|
"input",
|
|
3933
4129
|
{
|
|
3934
4130
|
id: fieldId,
|
|
@@ -3958,13 +4154,13 @@ function AuthField({ label, error, hint, rightLabel, id, ...props }) {
|
|
|
3958
4154
|
...props
|
|
3959
4155
|
}
|
|
3960
4156
|
),
|
|
3961
|
-
error && /* @__PURE__ */ (0,
|
|
3962
|
-
hint && !error && /* @__PURE__ */ (0,
|
|
4157
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("p", { style: { fontSize: "0.8rem", color: "var(--destructive)", margin: 0 }, children: error }),
|
|
4158
|
+
hint && !error && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("p", { style: { fontSize: "0.8rem", color: "var(--muted-foreground)", margin: 0 }, children: hint })
|
|
3963
4159
|
] });
|
|
3964
4160
|
}
|
|
3965
4161
|
|
|
3966
4162
|
// src/components/auth/AuthButton.tsx
|
|
3967
|
-
var
|
|
4163
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
3968
4164
|
function AuthButton({
|
|
3969
4165
|
loading,
|
|
3970
4166
|
variant = "primary",
|
|
@@ -4007,7 +4203,7 @@ function AuthButton({
|
|
|
4007
4203
|
color: "var(--foreground)"
|
|
4008
4204
|
}
|
|
4009
4205
|
};
|
|
4010
|
-
return /* @__PURE__ */ (0,
|
|
4206
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
4011
4207
|
"button",
|
|
4012
4208
|
{
|
|
4013
4209
|
disabled: loading || disabled,
|
|
@@ -4019,8 +4215,8 @@ function AuthButton({
|
|
|
4019
4215
|
e.currentTarget.style.filter = "none";
|
|
4020
4216
|
},
|
|
4021
4217
|
...props,
|
|
4022
|
-
children: loading ? /* @__PURE__ */ (0,
|
|
4023
|
-
/* @__PURE__ */ (0,
|
|
4218
|
+
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
|
|
4219
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
4024
4220
|
"span",
|
|
4025
4221
|
{
|
|
4026
4222
|
style: {
|
|
@@ -4041,19 +4237,19 @@ function AuthButton({
|
|
|
4041
4237
|
}
|
|
4042
4238
|
|
|
4043
4239
|
// src/components/auth/AuthDivider.tsx
|
|
4044
|
-
var
|
|
4240
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
4045
4241
|
function AuthDivider({ label = "or" }) {
|
|
4046
|
-
return /* @__PURE__ */ (0,
|
|
4047
|
-
/* @__PURE__ */ (0,
|
|
4048
|
-
/* @__PURE__ */ (0,
|
|
4049
|
-
/* @__PURE__ */ (0,
|
|
4242
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "12px", margin: "20px 0" }, children: [
|
|
4243
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { style: { flex: 1, height: 1, background: "var(--border)" } }),
|
|
4244
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { style: { fontSize: "0.75rem", color: "var(--muted-foreground)", userSelect: "none" }, children: label }),
|
|
4245
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { style: { flex: 1, height: 1, background: "var(--border)" } })
|
|
4050
4246
|
] });
|
|
4051
4247
|
}
|
|
4052
4248
|
|
|
4053
4249
|
// src/components/auth/AuthFootnote.tsx
|
|
4054
|
-
var
|
|
4250
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
4055
4251
|
function AuthFootnote({ text, linkText, linkHref }) {
|
|
4056
|
-
return /* @__PURE__ */ (0,
|
|
4252
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("p", { style: {
|
|
4057
4253
|
textAlign: "center",
|
|
4058
4254
|
marginTop: "20px",
|
|
4059
4255
|
fontSize: "0.8125rem",
|
|
@@ -4061,7 +4257,7 @@ function AuthFootnote({ text, linkText, linkHref }) {
|
|
|
4061
4257
|
}, children: [
|
|
4062
4258
|
text,
|
|
4063
4259
|
" ",
|
|
4064
|
-
/* @__PURE__ */ (0,
|
|
4260
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
4065
4261
|
"a",
|
|
4066
4262
|
{
|
|
4067
4263
|
href: linkHref,
|
|
@@ -4110,6 +4306,8 @@ var import_next_themes2 = require("next-themes");
|
|
|
4110
4306
|
ColorPickerOutput,
|
|
4111
4307
|
ColorPickerSelection,
|
|
4112
4308
|
ConfirmDialog,
|
|
4309
|
+
DEVICES,
|
|
4310
|
+
DEVICE_ICONS,
|
|
4113
4311
|
DashboardLayout,
|
|
4114
4312
|
DataTable,
|
|
4115
4313
|
Dialog,
|
|
@@ -4146,6 +4344,7 @@ var import_next_themes2 = require("next-themes");
|
|
|
4146
4344
|
Input,
|
|
4147
4345
|
Label,
|
|
4148
4346
|
LoadingSpinner,
|
|
4347
|
+
LocalInput,
|
|
4149
4348
|
MediaCard,
|
|
4150
4349
|
MediaGrid,
|
|
4151
4350
|
MediaPickerDialog,
|
|
@@ -4162,6 +4361,8 @@ var import_next_themes2 = require("next-themes");
|
|
|
4162
4361
|
PostListTable,
|
|
4163
4362
|
PostSidebarSection,
|
|
4164
4363
|
PostStatusBadge,
|
|
4364
|
+
ResponsiveSizeDeviceIcon,
|
|
4365
|
+
ResponsiveSizeField,
|
|
4165
4366
|
SearchBar,
|
|
4166
4367
|
Select,
|
|
4167
4368
|
SelectContent,
|