@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.mjs
CHANGED
|
@@ -2320,9 +2320,227 @@ function FormSection({
|
|
|
2320
2320
|
] });
|
|
2321
2321
|
}
|
|
2322
2322
|
|
|
2323
|
+
// src/components/form/local-input.tsx
|
|
2324
|
+
import { useState as useState5, useRef as useRef3, useEffect as useEffect4 } from "react";
|
|
2325
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
2326
|
+
function LocalInput({
|
|
2327
|
+
value,
|
|
2328
|
+
onChange,
|
|
2329
|
+
commitOnBlur,
|
|
2330
|
+
...rest
|
|
2331
|
+
}) {
|
|
2332
|
+
const [local, setLocal] = useState5(String(value ?? ""));
|
|
2333
|
+
const ref = useRef3(null);
|
|
2334
|
+
const onChangeRef = useRef3(onChange);
|
|
2335
|
+
onChangeRef.current = onChange;
|
|
2336
|
+
useEffect4(() => {
|
|
2337
|
+
if (document.activeElement !== ref.current) {
|
|
2338
|
+
setLocal(String(value ?? ""));
|
|
2339
|
+
}
|
|
2340
|
+
}, [value]);
|
|
2341
|
+
return /* @__PURE__ */ jsx39(
|
|
2342
|
+
"input",
|
|
2343
|
+
{
|
|
2344
|
+
ref,
|
|
2345
|
+
...rest,
|
|
2346
|
+
value: local,
|
|
2347
|
+
onChange: (e) => {
|
|
2348
|
+
setLocal(e.target.value);
|
|
2349
|
+
if (!commitOnBlur) {
|
|
2350
|
+
onChangeRef.current(e.target.value);
|
|
2351
|
+
}
|
|
2352
|
+
},
|
|
2353
|
+
onBlur: (e) => {
|
|
2354
|
+
if (commitOnBlur) {
|
|
2355
|
+
onChangeRef.current(e.target.value);
|
|
2356
|
+
}
|
|
2357
|
+
}
|
|
2358
|
+
}
|
|
2359
|
+
);
|
|
2360
|
+
}
|
|
2361
|
+
|
|
2362
|
+
// src/components/form/responsive-size-device-icon.tsx
|
|
2363
|
+
import { useState as useState6 } from "react";
|
|
2364
|
+
|
|
2365
|
+
// src/components/form/responsive-types.tsx
|
|
2366
|
+
import { jsx as jsx40, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2367
|
+
var DEVICES = [
|
|
2368
|
+
{ key: "desktop", label: "Desktop", width: "1200px" },
|
|
2369
|
+
{ key: "laptop", label: "Laptop", width: "1024px" },
|
|
2370
|
+
{ key: "tablet", label: "Tablet", width: "768px" },
|
|
2371
|
+
{ key: "mobile", label: "Mobile", width: "375px" }
|
|
2372
|
+
];
|
|
2373
|
+
var DEVICE_ICONS = {
|
|
2374
|
+
desktop: /* @__PURE__ */ jsxs25("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
2375
|
+
/* @__PURE__ */ jsx40("rect", { x: "2", y: "4", width: "20", height: "14", rx: "2" }),
|
|
2376
|
+
/* @__PURE__ */ jsx40("path", { d: "M8 20h8M12 18v2" })
|
|
2377
|
+
] }),
|
|
2378
|
+
laptop: /* @__PURE__ */ jsxs25("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
2379
|
+
/* @__PURE__ */ jsx40("rect", { x: "3", y: "5", width: "18", height: "12", rx: "1.5" }),
|
|
2380
|
+
/* @__PURE__ */ jsx40("path", { d: "M1 19h22" })
|
|
2381
|
+
] }),
|
|
2382
|
+
tablet: /* @__PURE__ */ jsxs25("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
2383
|
+
/* @__PURE__ */ jsx40("rect", { x: "4", y: "2", width: "16", height: "20", rx: "2" }),
|
|
2384
|
+
/* @__PURE__ */ jsx40("circle", { cx: "12", cy: "18", r: "0.5", fill: "currentColor" })
|
|
2385
|
+
] }),
|
|
2386
|
+
mobile: /* @__PURE__ */ jsxs25("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
2387
|
+
/* @__PURE__ */ jsx40("rect", { x: "6", y: "2", width: "12", height: "20", rx: "2" }),
|
|
2388
|
+
/* @__PURE__ */ jsx40("circle", { cx: "12", cy: "18", r: "0.5", fill: "currentColor" })
|
|
2389
|
+
] })
|
|
2390
|
+
};
|
|
2391
|
+
|
|
2392
|
+
// src/components/form/responsive-size-device-icon.tsx
|
|
2393
|
+
import { jsx as jsx41, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2394
|
+
function ResponsiveSizeDeviceIcon({
|
|
2395
|
+
activeDevice,
|
|
2396
|
+
setActiveDevice
|
|
2397
|
+
}) {
|
|
2398
|
+
const [open, setOpen] = useState6(false);
|
|
2399
|
+
return /* @__PURE__ */ jsxs26("div", { className: "relative", children: [
|
|
2400
|
+
/* @__PURE__ */ jsx41(
|
|
2401
|
+
"button",
|
|
2402
|
+
{
|
|
2403
|
+
type: "button",
|
|
2404
|
+
onClick: () => setOpen((o) => !o),
|
|
2405
|
+
className: "flex items-center text-white/30 hover:text-white/60 transition-colors",
|
|
2406
|
+
children: DEVICE_ICONS[activeDevice]
|
|
2407
|
+
}
|
|
2408
|
+
),
|
|
2409
|
+
open && /* @__PURE__ */ jsx41(
|
|
2410
|
+
"div",
|
|
2411
|
+
{
|
|
2412
|
+
className: "absolute left-0 top-full mt-1 z-[200] rounded-lg overflow-hidden border border-white/10 shadow-xl",
|
|
2413
|
+
style: { background: "#1e2030", minWidth: 160 },
|
|
2414
|
+
children: DEVICES.map((d) => /* @__PURE__ */ jsxs26(
|
|
2415
|
+
"button",
|
|
2416
|
+
{
|
|
2417
|
+
type: "button",
|
|
2418
|
+
onClick: () => {
|
|
2419
|
+
setActiveDevice(d.key);
|
|
2420
|
+
setOpen(false);
|
|
2421
|
+
},
|
|
2422
|
+
className: "w-full flex items-center gap-3 px-3 py-2 text-xs hover:bg-white/10 transition-colors",
|
|
2423
|
+
children: [
|
|
2424
|
+
/* @__PURE__ */ jsx41("span", { className: "text-white/60", children: DEVICE_ICONS[d.key] }),
|
|
2425
|
+
/* @__PURE__ */ jsx41("span", { className: "text-white/70 flex-1 text-left", children: d.label }),
|
|
2426
|
+
/* @__PURE__ */ jsx41("span", { className: "text-white/30", children: d.width }),
|
|
2427
|
+
activeDevice === d.key && /* @__PURE__ */ jsx41(
|
|
2428
|
+
"svg",
|
|
2429
|
+
{
|
|
2430
|
+
className: "w-3 h-3 text-[#287f71] shrink-0",
|
|
2431
|
+
viewBox: "0 0 24 24",
|
|
2432
|
+
fill: "none",
|
|
2433
|
+
stroke: "currentColor",
|
|
2434
|
+
strokeWidth: "2.5",
|
|
2435
|
+
children: /* @__PURE__ */ jsx41("path", { d: "m5 13 4 4L19 7" })
|
|
2436
|
+
}
|
|
2437
|
+
)
|
|
2438
|
+
]
|
|
2439
|
+
},
|
|
2440
|
+
d.key
|
|
2441
|
+
))
|
|
2442
|
+
}
|
|
2443
|
+
)
|
|
2444
|
+
] });
|
|
2445
|
+
}
|
|
2446
|
+
|
|
2447
|
+
// src/components/form/responsive-size-field.tsx
|
|
2448
|
+
import { useState as useState7 } from "react";
|
|
2449
|
+
import { jsx as jsx42, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2450
|
+
function ResponsiveSizeField({
|
|
2451
|
+
value,
|
|
2452
|
+
unit,
|
|
2453
|
+
customUnit,
|
|
2454
|
+
activeDevice,
|
|
2455
|
+
onSizeChange,
|
|
2456
|
+
onUnitChange,
|
|
2457
|
+
onCustomChange
|
|
2458
|
+
}) {
|
|
2459
|
+
const [unitOpen, setUnitOpen] = useState7(false);
|
|
2460
|
+
const currentVal = value[activeDevice] ?? value.desktop ?? 0;
|
|
2461
|
+
const isCustom = unit === "custom";
|
|
2462
|
+
return /* @__PURE__ */ jsxs27("div", { className: "relative flex items-center border border-white/10 rounded-md bg-white/5 w-full", style: { height: 32 }, children: [
|
|
2463
|
+
isCustom ? /* @__PURE__ */ jsx42(
|
|
2464
|
+
LocalInput,
|
|
2465
|
+
{
|
|
2466
|
+
type: "text",
|
|
2467
|
+
value: customUnit || "",
|
|
2468
|
+
onChange: (v) => onCustomChange?.(v),
|
|
2469
|
+
commitOnBlur: true,
|
|
2470
|
+
placeholder: "e.g. 2rem",
|
|
2471
|
+
className: "flex-1 min-w-0 bg-transparent px-2 text-xs text-white/80 outline-none h-full"
|
|
2472
|
+
}
|
|
2473
|
+
) : /* @__PURE__ */ jsx42(
|
|
2474
|
+
LocalInput,
|
|
2475
|
+
{
|
|
2476
|
+
type: "number",
|
|
2477
|
+
min: 0,
|
|
2478
|
+
value: currentVal,
|
|
2479
|
+
onChange: (v) => onSizeChange(activeDevice, +v),
|
|
2480
|
+
commitOnBlur: true,
|
|
2481
|
+
className: "flex-1 min-w-0 bg-transparent px-2 text-xs text-white/80 outline-none text-center h-full"
|
|
2482
|
+
}
|
|
2483
|
+
),
|
|
2484
|
+
isCustom ? /* @__PURE__ */ jsxs27("div", { className: "relative shrink-0", children: [
|
|
2485
|
+
/* @__PURE__ */ jsx42(
|
|
2486
|
+
"div",
|
|
2487
|
+
{
|
|
2488
|
+
role: "button",
|
|
2489
|
+
tabIndex: 0,
|
|
2490
|
+
onClick: () => setUnitOpen((o) => !o),
|
|
2491
|
+
title: "Choose unit",
|
|
2492
|
+
className: "flex items-center justify-center px-2 h-full text-white/30 hover:text-white/60 transition-colors cursor-pointer",
|
|
2493
|
+
children: /* @__PURE__ */ jsx42(
|
|
2494
|
+
"svg",
|
|
2495
|
+
{
|
|
2496
|
+
className: "w-3 h-3",
|
|
2497
|
+
viewBox: "0 0 24 24",
|
|
2498
|
+
fill: "none",
|
|
2499
|
+
stroke: "currentColor",
|
|
2500
|
+
strokeWidth: "1.5",
|
|
2501
|
+
children: /* @__PURE__ */ jsx42("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" })
|
|
2502
|
+
}
|
|
2503
|
+
)
|
|
2504
|
+
}
|
|
2505
|
+
),
|
|
2506
|
+
unitOpen && /* @__PURE__ */ jsx42(
|
|
2507
|
+
"div",
|
|
2508
|
+
{
|
|
2509
|
+
className: "absolute right-0 top-full mt-1 z-[200] rounded-lg overflow-hidden border border-white/10 shadow-xl",
|
|
2510
|
+
style: { background: "#1e2030", minWidth: 60 },
|
|
2511
|
+
children: ["px", "rem", "em", "vh", "vw"].map((u) => /* @__PURE__ */ jsx42(
|
|
2512
|
+
"div",
|
|
2513
|
+
{
|
|
2514
|
+
role: "button",
|
|
2515
|
+
tabIndex: 0,
|
|
2516
|
+
onClick: () => {
|
|
2517
|
+
onUnitChange(u);
|
|
2518
|
+
setUnitOpen(false);
|
|
2519
|
+
},
|
|
2520
|
+
className: "w-full px-3 py-2 text-xs text-white/70 hover:bg-white/10 text-right transition-colors cursor-pointer",
|
|
2521
|
+
children: u
|
|
2522
|
+
},
|
|
2523
|
+
u
|
|
2524
|
+
))
|
|
2525
|
+
}
|
|
2526
|
+
)
|
|
2527
|
+
] }) : /* @__PURE__ */ jsxs27(Select, { value: unit, onValueChange: onUnitChange, children: [
|
|
2528
|
+
/* @__PURE__ */ jsx42(
|
|
2529
|
+
SelectTrigger,
|
|
2530
|
+
{
|
|
2531
|
+
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",
|
|
2532
|
+
style: { width: 52, minWidth: 52 },
|
|
2533
|
+
children: /* @__PURE__ */ jsx42(SelectValue, {})
|
|
2534
|
+
}
|
|
2535
|
+
),
|
|
2536
|
+
/* @__PURE__ */ jsx42(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__ */ jsx42(SelectItem, { value: u, children: u }, u)) })
|
|
2537
|
+
] })
|
|
2538
|
+
] });
|
|
2539
|
+
}
|
|
2540
|
+
|
|
2323
2541
|
// src/components/feedback/alert.tsx
|
|
2324
2542
|
import { AlertCircle, CheckCircle2, Info, AlertTriangle, X as X2 } from "lucide-react";
|
|
2325
|
-
import { jsx as
|
|
2543
|
+
import { jsx as jsx43, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2326
2544
|
var variantConfig = {
|
|
2327
2545
|
info: {
|
|
2328
2546
|
icon: Info,
|
|
@@ -2351,7 +2569,7 @@ function Alert({
|
|
|
2351
2569
|
}) {
|
|
2352
2570
|
const config = variantConfig[variant];
|
|
2353
2571
|
const Icon2 = config.icon;
|
|
2354
|
-
return /* @__PURE__ */
|
|
2572
|
+
return /* @__PURE__ */ jsxs28(
|
|
2355
2573
|
"div",
|
|
2356
2574
|
{
|
|
2357
2575
|
className: cn(
|
|
@@ -2361,17 +2579,17 @@ function Alert({
|
|
|
2361
2579
|
),
|
|
2362
2580
|
role: "alert",
|
|
2363
2581
|
children: [
|
|
2364
|
-
/* @__PURE__ */
|
|
2365
|
-
/* @__PURE__ */
|
|
2366
|
-
title && /* @__PURE__ */
|
|
2367
|
-
/* @__PURE__ */
|
|
2582
|
+
/* @__PURE__ */ jsx43(Icon2, { className: "mt-0.5 h-5 w-5 shrink-0" }),
|
|
2583
|
+
/* @__PURE__ */ jsxs28("div", { className: "flex-1", children: [
|
|
2584
|
+
title && /* @__PURE__ */ jsx43("p", { className: "font-medium", children: title }),
|
|
2585
|
+
/* @__PURE__ */ jsx43("div", { className: cn("text-sm", title && "mt-1"), children })
|
|
2368
2586
|
] }),
|
|
2369
|
-
dismissible && /* @__PURE__ */
|
|
2587
|
+
dismissible && /* @__PURE__ */ jsx43(
|
|
2370
2588
|
"button",
|
|
2371
2589
|
{
|
|
2372
2590
|
onClick: onDismiss,
|
|
2373
2591
|
className: "absolute right-3 top-3 rounded-md p-1 opacity-70 hover:opacity-100",
|
|
2374
|
-
children: /* @__PURE__ */
|
|
2592
|
+
children: /* @__PURE__ */ jsx43(X2, { className: "h-4 w-4" })
|
|
2375
2593
|
}
|
|
2376
2594
|
)
|
|
2377
2595
|
]
|
|
@@ -2381,14 +2599,14 @@ function Alert({
|
|
|
2381
2599
|
|
|
2382
2600
|
// src/components/feedback/loading-spinner.tsx
|
|
2383
2601
|
import { Loader2 } from "lucide-react";
|
|
2384
|
-
import { jsx as
|
|
2602
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
2385
2603
|
var sizeMap2 = {
|
|
2386
2604
|
sm: "h-4 w-4",
|
|
2387
2605
|
md: "h-6 w-6",
|
|
2388
2606
|
lg: "h-8 w-8"
|
|
2389
2607
|
};
|
|
2390
2608
|
function LoadingSpinner({ size = "md", className }) {
|
|
2391
|
-
return /* @__PURE__ */
|
|
2609
|
+
return /* @__PURE__ */ jsx44(
|
|
2392
2610
|
Loader2,
|
|
2393
2611
|
{
|
|
2394
2612
|
className: cn("animate-spin text-muted-foreground", sizeMap2[size], className)
|
|
@@ -2397,7 +2615,7 @@ function LoadingSpinner({ size = "md", className }) {
|
|
|
2397
2615
|
}
|
|
2398
2616
|
|
|
2399
2617
|
// src/components/feedback/confirm-dialog.tsx
|
|
2400
|
-
import { jsx as
|
|
2618
|
+
import { jsx as jsx45, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2401
2619
|
function ConfirmDialog({
|
|
2402
2620
|
open,
|
|
2403
2621
|
onOpenChange,
|
|
@@ -2409,13 +2627,13 @@ function ConfirmDialog({
|
|
|
2409
2627
|
loading,
|
|
2410
2628
|
variant = "default"
|
|
2411
2629
|
}) {
|
|
2412
|
-
return /* @__PURE__ */
|
|
2413
|
-
/* @__PURE__ */
|
|
2414
|
-
/* @__PURE__ */
|
|
2415
|
-
description && /* @__PURE__ */
|
|
2630
|
+
return /* @__PURE__ */ jsx45(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs29(DialogContent, { children: [
|
|
2631
|
+
/* @__PURE__ */ jsxs29(DialogHeader, { children: [
|
|
2632
|
+
/* @__PURE__ */ jsx45(DialogTitle, { children: title }),
|
|
2633
|
+
description && /* @__PURE__ */ jsx45(DialogDescription, { children: description })
|
|
2416
2634
|
] }),
|
|
2417
|
-
/* @__PURE__ */
|
|
2418
|
-
/* @__PURE__ */
|
|
2635
|
+
/* @__PURE__ */ jsxs29(DialogFooter, { children: [
|
|
2636
|
+
/* @__PURE__ */ jsx45(
|
|
2419
2637
|
Button,
|
|
2420
2638
|
{
|
|
2421
2639
|
variant: "outline",
|
|
@@ -2424,14 +2642,14 @@ function ConfirmDialog({
|
|
|
2424
2642
|
children: cancelLabel
|
|
2425
2643
|
}
|
|
2426
2644
|
),
|
|
2427
|
-
/* @__PURE__ */
|
|
2645
|
+
/* @__PURE__ */ jsxs29(
|
|
2428
2646
|
Button,
|
|
2429
2647
|
{
|
|
2430
2648
|
variant: variant === "destructive" ? "destructive" : "default",
|
|
2431
2649
|
onClick: onConfirm,
|
|
2432
2650
|
disabled: loading,
|
|
2433
2651
|
children: [
|
|
2434
|
-
loading && /* @__PURE__ */
|
|
2652
|
+
loading && /* @__PURE__ */ jsx45(LoadingSpinner, { size: "sm", className: "mr-2" }),
|
|
2435
2653
|
confirmLabel
|
|
2436
2654
|
]
|
|
2437
2655
|
}
|
|
@@ -2441,7 +2659,7 @@ function ConfirmDialog({
|
|
|
2441
2659
|
}
|
|
2442
2660
|
|
|
2443
2661
|
// src/components/content/post-status-badge.tsx
|
|
2444
|
-
import { jsx as
|
|
2662
|
+
import { jsx as jsx46, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
2445
2663
|
var statusConfig = {
|
|
2446
2664
|
DRAFT: {
|
|
2447
2665
|
label: "Draft",
|
|
@@ -2474,7 +2692,7 @@ function PostStatusBadge({
|
|
|
2474
2692
|
className
|
|
2475
2693
|
}) {
|
|
2476
2694
|
const config = statusConfig[status];
|
|
2477
|
-
return /* @__PURE__ */
|
|
2695
|
+
return /* @__PURE__ */ jsxs30(
|
|
2478
2696
|
"span",
|
|
2479
2697
|
{
|
|
2480
2698
|
className: cn(
|
|
@@ -2484,7 +2702,7 @@ function PostStatusBadge({
|
|
|
2484
2702
|
className
|
|
2485
2703
|
),
|
|
2486
2704
|
children: [
|
|
2487
|
-
/* @__PURE__ */
|
|
2705
|
+
/* @__PURE__ */ jsx46(
|
|
2488
2706
|
"span",
|
|
2489
2707
|
{
|
|
2490
2708
|
className: cn("inline-block rounded-full", config.dot, {
|
|
@@ -2503,9 +2721,9 @@ function PostStatusBadge({
|
|
|
2503
2721
|
import * as React21 from "react";
|
|
2504
2722
|
|
|
2505
2723
|
// src/components/Skeleton.tsx
|
|
2506
|
-
import { jsx as
|
|
2724
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
2507
2725
|
function Skeleton2({ width = "100%", height = 16, rounded, style }) {
|
|
2508
|
-
return /* @__PURE__ */
|
|
2726
|
+
return /* @__PURE__ */ jsx47(
|
|
2509
2727
|
"div",
|
|
2510
2728
|
{
|
|
2511
2729
|
style: {
|
|
@@ -2518,7 +2736,7 @@ function Skeleton2({ width = "100%", height = 16, rounded, style }) {
|
|
|
2518
2736
|
flexShrink: 0,
|
|
2519
2737
|
...style
|
|
2520
2738
|
},
|
|
2521
|
-
children: /* @__PURE__ */
|
|
2739
|
+
children: /* @__PURE__ */ jsx47(
|
|
2522
2740
|
"div",
|
|
2523
2741
|
{
|
|
2524
2742
|
style: {
|
|
@@ -2534,49 +2752,49 @@ function Skeleton2({ width = "100%", height = 16, rounded, style }) {
|
|
|
2534
2752
|
}
|
|
2535
2753
|
|
|
2536
2754
|
// src/components/content/post-list-table.tsx
|
|
2537
|
-
import { jsx as
|
|
2755
|
+
import { jsx as jsx48, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
2538
2756
|
function IconEdit() {
|
|
2539
|
-
return /* @__PURE__ */
|
|
2540
|
-
/* @__PURE__ */
|
|
2541
|
-
/* @__PURE__ */
|
|
2757
|
+
return /* @__PURE__ */ jsxs31("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2758
|
+
/* @__PURE__ */ jsx48("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }),
|
|
2759
|
+
/* @__PURE__ */ jsx48("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })
|
|
2542
2760
|
] });
|
|
2543
2761
|
}
|
|
2544
2762
|
function IconTrash() {
|
|
2545
|
-
return /* @__PURE__ */
|
|
2546
|
-
/* @__PURE__ */
|
|
2547
|
-
/* @__PURE__ */
|
|
2548
|
-
/* @__PURE__ */
|
|
2549
|
-
/* @__PURE__ */
|
|
2550
|
-
/* @__PURE__ */
|
|
2763
|
+
return /* @__PURE__ */ jsxs31("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2764
|
+
/* @__PURE__ */ jsx48("polyline", { points: "3 6 5 6 21 6" }),
|
|
2765
|
+
/* @__PURE__ */ jsx48("path", { d: "M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6" }),
|
|
2766
|
+
/* @__PURE__ */ jsx48("path", { d: "M10 11v6" }),
|
|
2767
|
+
/* @__PURE__ */ jsx48("path", { d: "M14 11v6" }),
|
|
2768
|
+
/* @__PURE__ */ jsx48("path", { d: "M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2" })
|
|
2551
2769
|
] });
|
|
2552
2770
|
}
|
|
2553
2771
|
function IconCopy() {
|
|
2554
|
-
return /* @__PURE__ */
|
|
2555
|
-
/* @__PURE__ */
|
|
2556
|
-
/* @__PURE__ */
|
|
2772
|
+
return /* @__PURE__ */ jsxs31("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2773
|
+
/* @__PURE__ */ jsx48("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" }),
|
|
2774
|
+
/* @__PURE__ */ jsx48("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
2557
2775
|
] });
|
|
2558
2776
|
}
|
|
2559
2777
|
function IconMoreHorizontal() {
|
|
2560
|
-
return /* @__PURE__ */
|
|
2561
|
-
/* @__PURE__ */
|
|
2562
|
-
/* @__PURE__ */
|
|
2563
|
-
/* @__PURE__ */
|
|
2778
|
+
return /* @__PURE__ */ jsxs31("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2779
|
+
/* @__PURE__ */ jsx48("circle", { cx: "5", cy: "12", r: "1", fill: "currentColor" }),
|
|
2780
|
+
/* @__PURE__ */ jsx48("circle", { cx: "12", cy: "12", r: "1", fill: "currentColor" }),
|
|
2781
|
+
/* @__PURE__ */ jsx48("circle", { cx: "19", cy: "12", r: "1", fill: "currentColor" })
|
|
2564
2782
|
] });
|
|
2565
2783
|
}
|
|
2566
2784
|
function IconChevronRight() {
|
|
2567
|
-
return /* @__PURE__ */
|
|
2785
|
+
return /* @__PURE__ */ jsx48("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx48("polyline", { points: "9 18 15 12 9 6" }) });
|
|
2568
2786
|
}
|
|
2569
2787
|
function IconImage() {
|
|
2570
|
-
return /* @__PURE__ */
|
|
2571
|
-
/* @__PURE__ */
|
|
2572
|
-
/* @__PURE__ */
|
|
2573
|
-
/* @__PURE__ */
|
|
2788
|
+
return /* @__PURE__ */ jsxs31("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2789
|
+
/* @__PURE__ */ jsx48("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }),
|
|
2790
|
+
/* @__PURE__ */ jsx48("circle", { cx: "8.5", cy: "8.5", r: "1.5" }),
|
|
2791
|
+
/* @__PURE__ */ jsx48("polyline", { points: "21 15 16 10 5 21" })
|
|
2574
2792
|
] });
|
|
2575
2793
|
}
|
|
2576
2794
|
function IconPlus() {
|
|
2577
|
-
return /* @__PURE__ */
|
|
2578
|
-
/* @__PURE__ */
|
|
2579
|
-
/* @__PURE__ */
|
|
2795
|
+
return /* @__PURE__ */ jsxs31("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2796
|
+
/* @__PURE__ */ jsx48("line", { x1: "12", y1: "5", x2: "12", y2: "19" }),
|
|
2797
|
+
/* @__PURE__ */ jsx48("line", { x1: "5", y1: "12", x2: "19", y2: "12" })
|
|
2580
2798
|
] });
|
|
2581
2799
|
}
|
|
2582
2800
|
function formatDate(date) {
|
|
@@ -2609,17 +2827,17 @@ function RowActions({ post, onEdit, onDelete, onDuplicate, onStatusChange }) {
|
|
|
2609
2827
|
{ label: "Publish", value: "PUBLISHED" },
|
|
2610
2828
|
{ label: "Archive", value: "ARCHIVED" }
|
|
2611
2829
|
];
|
|
2612
|
-
return /* @__PURE__ */
|
|
2613
|
-
/* @__PURE__ */
|
|
2830
|
+
return /* @__PURE__ */ jsxs31("div", { className: "relative flex items-center gap-1", ref, children: [
|
|
2831
|
+
/* @__PURE__ */ jsx48(
|
|
2614
2832
|
"button",
|
|
2615
2833
|
{
|
|
2616
2834
|
onClick: () => onEdit?.(post.id),
|
|
2617
2835
|
className: "inline-flex items-center justify-center h-7 w-7 rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors",
|
|
2618
2836
|
title: "Edit",
|
|
2619
|
-
children: /* @__PURE__ */
|
|
2837
|
+
children: /* @__PURE__ */ jsx48(IconEdit, {})
|
|
2620
2838
|
}
|
|
2621
2839
|
),
|
|
2622
|
-
/* @__PURE__ */
|
|
2840
|
+
/* @__PURE__ */ jsx48(
|
|
2623
2841
|
"button",
|
|
2624
2842
|
{
|
|
2625
2843
|
onClick: () => {
|
|
@@ -2628,11 +2846,11 @@ function RowActions({ post, onEdit, onDelete, onDuplicate, onStatusChange }) {
|
|
|
2628
2846
|
},
|
|
2629
2847
|
className: "inline-flex items-center justify-center h-7 w-7 rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors",
|
|
2630
2848
|
title: "More actions",
|
|
2631
|
-
children: /* @__PURE__ */
|
|
2849
|
+
children: /* @__PURE__ */ jsx48(IconMoreHorizontal, {})
|
|
2632
2850
|
}
|
|
2633
2851
|
),
|
|
2634
|
-
open && /* @__PURE__ */
|
|
2635
|
-
/* @__PURE__ */
|
|
2852
|
+
open && /* @__PURE__ */ jsxs31("div", { className: "absolute right-0 top-8 z-50 min-w-[160px] rounded-lg border border-border bg-card shadow-md py-1", children: [
|
|
2853
|
+
/* @__PURE__ */ jsxs31(
|
|
2636
2854
|
"button",
|
|
2637
2855
|
{
|
|
2638
2856
|
onClick: () => {
|
|
@@ -2641,13 +2859,13 @@ function RowActions({ post, onEdit, onDelete, onDuplicate, onStatusChange }) {
|
|
|
2641
2859
|
},
|
|
2642
2860
|
className: "flex w-full items-center gap-2 px-3 py-1.5 text-sm hover:bg-accent transition-colors",
|
|
2643
2861
|
children: [
|
|
2644
|
-
/* @__PURE__ */
|
|
2862
|
+
/* @__PURE__ */ jsx48(IconCopy, {}),
|
|
2645
2863
|
"Duplicate"
|
|
2646
2864
|
]
|
|
2647
2865
|
}
|
|
2648
2866
|
),
|
|
2649
|
-
/* @__PURE__ */
|
|
2650
|
-
/* @__PURE__ */
|
|
2867
|
+
/* @__PURE__ */ jsxs31("div", { className: "relative", children: [
|
|
2868
|
+
/* @__PURE__ */ jsxs31(
|
|
2651
2869
|
"button",
|
|
2652
2870
|
{
|
|
2653
2871
|
onMouseEnter: () => setStatusOpen(true),
|
|
@@ -2655,18 +2873,18 @@ function RowActions({ post, onEdit, onDelete, onDuplicate, onStatusChange }) {
|
|
|
2655
2873
|
onClick: () => setStatusOpen((v) => !v),
|
|
2656
2874
|
className: "flex w-full items-center justify-between gap-2 px-3 py-1.5 text-sm hover:bg-accent transition-colors",
|
|
2657
2875
|
children: [
|
|
2658
|
-
/* @__PURE__ */
|
|
2659
|
-
/* @__PURE__ */
|
|
2876
|
+
/* @__PURE__ */ jsx48("span", { children: "Change status" }),
|
|
2877
|
+
/* @__PURE__ */ jsx48(IconChevronRight, {})
|
|
2660
2878
|
]
|
|
2661
2879
|
}
|
|
2662
2880
|
),
|
|
2663
|
-
statusOpen && /* @__PURE__ */
|
|
2881
|
+
statusOpen && /* @__PURE__ */ jsx48(
|
|
2664
2882
|
"div",
|
|
2665
2883
|
{
|
|
2666
2884
|
className: "absolute left-full top-0 z-50 min-w-[130px] rounded-lg border border-border bg-card shadow-md py-1",
|
|
2667
2885
|
onMouseEnter: () => setStatusOpen(true),
|
|
2668
2886
|
onMouseLeave: () => setStatusOpen(false),
|
|
2669
|
-
children: statusOptions.map((opt) => /* @__PURE__ */
|
|
2887
|
+
children: statusOptions.map((opt) => /* @__PURE__ */ jsx48(
|
|
2670
2888
|
"button",
|
|
2671
2889
|
{
|
|
2672
2890
|
onClick: () => {
|
|
@@ -2685,8 +2903,8 @@ function RowActions({ post, onEdit, onDelete, onDuplicate, onStatusChange }) {
|
|
|
2685
2903
|
}
|
|
2686
2904
|
)
|
|
2687
2905
|
] }),
|
|
2688
|
-
/* @__PURE__ */
|
|
2689
|
-
/* @__PURE__ */
|
|
2906
|
+
/* @__PURE__ */ jsx48("div", { className: "my-1 border-t border-border" }),
|
|
2907
|
+
/* @__PURE__ */ jsxs31(
|
|
2690
2908
|
"button",
|
|
2691
2909
|
{
|
|
2692
2910
|
onClick: () => {
|
|
@@ -2695,7 +2913,7 @@ function RowActions({ post, onEdit, onDelete, onDuplicate, onStatusChange }) {
|
|
|
2695
2913
|
},
|
|
2696
2914
|
className: "flex w-full items-center gap-2 px-3 py-1.5 text-sm text-destructive hover:bg-destructive/10 transition-colors",
|
|
2697
2915
|
children: [
|
|
2698
|
-
/* @__PURE__ */
|
|
2916
|
+
/* @__PURE__ */ jsx48(IconTrash, {}),
|
|
2699
2917
|
"Delete"
|
|
2700
2918
|
]
|
|
2701
2919
|
}
|
|
@@ -2704,21 +2922,21 @@ function RowActions({ post, onEdit, onDelete, onDuplicate, onStatusChange }) {
|
|
|
2704
2922
|
] });
|
|
2705
2923
|
}
|
|
2706
2924
|
function SkeletonRow() {
|
|
2707
|
-
return /* @__PURE__ */
|
|
2708
|
-
/* @__PURE__ */
|
|
2709
|
-
/* @__PURE__ */
|
|
2710
|
-
/* @__PURE__ */
|
|
2711
|
-
/* @__PURE__ */
|
|
2925
|
+
return /* @__PURE__ */ jsxs31("tr", { children: [
|
|
2926
|
+
/* @__PURE__ */ jsx48("td", { className: "px-4 py-3", children: /* @__PURE__ */ jsx48(Skeleton2, { className: "w-10 h-10 rounded-lg" }) }),
|
|
2927
|
+
/* @__PURE__ */ jsxs31("td", { className: "px-4 py-3", children: [
|
|
2928
|
+
/* @__PURE__ */ jsx48(Skeleton2, { className: "h-4 w-40 mb-1.5" }),
|
|
2929
|
+
/* @__PURE__ */ jsx48(Skeleton2, { className: "h-3 w-24" })
|
|
2712
2930
|
] }),
|
|
2713
|
-
/* @__PURE__ */
|
|
2714
|
-
/* @__PURE__ */
|
|
2715
|
-
/* @__PURE__ */
|
|
2716
|
-
/* @__PURE__ */
|
|
2931
|
+
/* @__PURE__ */ jsx48("td", { className: "px-4 py-3", children: /* @__PURE__ */ jsx48(Skeleton2, { className: "h-5 w-20 rounded-full" }) }),
|
|
2932
|
+
/* @__PURE__ */ jsx48("td", { className: "px-4 py-3", children: /* @__PURE__ */ jsxs31("div", { className: "flex items-center gap-2", children: [
|
|
2933
|
+
/* @__PURE__ */ jsx48(Skeleton2, { className: "w-6 h-6 rounded-full" }),
|
|
2934
|
+
/* @__PURE__ */ jsx48(Skeleton2, { className: "h-4 w-20" })
|
|
2717
2935
|
] }) }),
|
|
2718
|
-
/* @__PURE__ */
|
|
2719
|
-
/* @__PURE__ */
|
|
2720
|
-
/* @__PURE__ */
|
|
2721
|
-
/* @__PURE__ */
|
|
2936
|
+
/* @__PURE__ */ jsx48("td", { className: "px-4 py-3", children: /* @__PURE__ */ jsx48(Skeleton2, { className: "h-4 w-24" }) }),
|
|
2937
|
+
/* @__PURE__ */ jsx48("td", { className: "px-4 py-3", children: /* @__PURE__ */ jsxs31("div", { className: "flex gap-1", children: [
|
|
2938
|
+
/* @__PURE__ */ jsx48(Skeleton2, { className: "w-7 h-7 rounded-md" }),
|
|
2939
|
+
/* @__PURE__ */ jsx48(Skeleton2, { className: "w-7 h-7 rounded-md" })
|
|
2722
2940
|
] }) })
|
|
2723
2941
|
] });
|
|
2724
2942
|
}
|
|
@@ -2737,45 +2955,45 @@ function PostListTable({
|
|
|
2737
2955
|
className
|
|
2738
2956
|
}) {
|
|
2739
2957
|
const isEmpty = !loading && posts.length === 0;
|
|
2740
|
-
return /* @__PURE__ */
|
|
2741
|
-
/* @__PURE__ */
|
|
2742
|
-
/* @__PURE__ */
|
|
2743
|
-
/* @__PURE__ */
|
|
2744
|
-
/* @__PURE__ */
|
|
2745
|
-
/* @__PURE__ */
|
|
2746
|
-
/* @__PURE__ */
|
|
2747
|
-
/* @__PURE__ */
|
|
2748
|
-
/* @__PURE__ */
|
|
2958
|
+
return /* @__PURE__ */ jsxs31("div", { className: cn("w-full overflow-x-auto rounded-lg border border-border bg-card", className), children: [
|
|
2959
|
+
/* @__PURE__ */ jsxs31("table", { className: "w-full text-sm", children: [
|
|
2960
|
+
/* @__PURE__ */ jsx48("thead", { children: /* @__PURE__ */ jsxs31("tr", { className: "border-b border-border bg-muted/40", children: [
|
|
2961
|
+
/* @__PURE__ */ jsx48("th", { className: "px-4 py-2.5 text-left text-xs font-medium text-muted-foreground w-14", children: "Image" }),
|
|
2962
|
+
/* @__PURE__ */ jsx48("th", { className: "px-4 py-2.5 text-left text-xs font-medium text-muted-foreground", children: "Title" }),
|
|
2963
|
+
/* @__PURE__ */ jsx48("th", { className: "px-4 py-2.5 text-left text-xs font-medium text-muted-foreground", children: "Status" }),
|
|
2964
|
+
/* @__PURE__ */ jsx48("th", { className: "px-4 py-2.5 text-left text-xs font-medium text-muted-foreground", children: "Author" }),
|
|
2965
|
+
/* @__PURE__ */ jsx48("th", { className: "px-4 py-2.5 text-left text-xs font-medium text-muted-foreground", children: "Date" }),
|
|
2966
|
+
/* @__PURE__ */ jsx48("th", { className: "px-4 py-2.5 text-right text-xs font-medium text-muted-foreground", children: "Actions" })
|
|
2749
2967
|
] }) }),
|
|
2750
|
-
/* @__PURE__ */
|
|
2968
|
+
/* @__PURE__ */ jsx48("tbody", { children: loading ? Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ jsx48(SkeletonRow, {}, i)) : isEmpty ? null : posts.map((post) => {
|
|
2751
2969
|
const date = post.status === "PUBLISHED" && post.publishedAt ? formatDate(post.publishedAt) : formatDate(post.createdAt);
|
|
2752
|
-
return /* @__PURE__ */
|
|
2970
|
+
return /* @__PURE__ */ jsxs31(
|
|
2753
2971
|
"tr",
|
|
2754
2972
|
{
|
|
2755
2973
|
className: "border-b border-border last:border-0 hover:bg-muted/30 transition-colors",
|
|
2756
2974
|
children: [
|
|
2757
|
-
/* @__PURE__ */
|
|
2975
|
+
/* @__PURE__ */ jsx48("td", { className: "px-4 py-3", children: post.featuredImageUrl ? /* @__PURE__ */ jsx48(
|
|
2758
2976
|
"img",
|
|
2759
2977
|
{
|
|
2760
2978
|
src: post.featuredImageUrl,
|
|
2761
2979
|
alt: post.title,
|
|
2762
2980
|
className: "w-10 h-10 rounded-lg object-cover"
|
|
2763
2981
|
}
|
|
2764
|
-
) : /* @__PURE__ */
|
|
2765
|
-
/* @__PURE__ */
|
|
2766
|
-
/* @__PURE__ */
|
|
2767
|
-
/* @__PURE__ */
|
|
2982
|
+
) : /* @__PURE__ */ jsx48("div", { className: "w-10 h-10 rounded-lg bg-muted flex items-center justify-center text-muted-foreground", children: /* @__PURE__ */ jsx48(IconImage, {}) }) }),
|
|
2983
|
+
/* @__PURE__ */ jsxs31("td", { className: "px-4 py-3", children: [
|
|
2984
|
+
/* @__PURE__ */ jsx48("div", { className: "font-medium text-foreground leading-tight truncate max-w-[240px]", children: post.title }),
|
|
2985
|
+
/* @__PURE__ */ jsxs31("div", { className: "text-xs text-muted-foreground mt-0.5 truncate max-w-[240px]", children: [
|
|
2768
2986
|
"/",
|
|
2769
2987
|
post.slug
|
|
2770
2988
|
] })
|
|
2771
2989
|
] }),
|
|
2772
|
-
/* @__PURE__ */
|
|
2773
|
-
/* @__PURE__ */
|
|
2774
|
-
/* @__PURE__ */
|
|
2775
|
-
/* @__PURE__ */
|
|
2776
|
-
] }) : /* @__PURE__ */
|
|
2777
|
-
/* @__PURE__ */
|
|
2778
|
-
/* @__PURE__ */
|
|
2990
|
+
/* @__PURE__ */ jsx48("td", { className: "px-4 py-3", children: /* @__PURE__ */ jsx48(PostStatusBadge, { status: post.status, size: "sm" }) }),
|
|
2991
|
+
/* @__PURE__ */ jsx48("td", { className: "px-4 py-3", children: post.author ? /* @__PURE__ */ jsxs31("div", { className: "flex items-center gap-2", children: [
|
|
2992
|
+
/* @__PURE__ */ jsx48("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) }),
|
|
2993
|
+
/* @__PURE__ */ jsx48("span", { className: "text-sm text-foreground truncate max-w-[100px]", children: post.author })
|
|
2994
|
+
] }) : /* @__PURE__ */ jsx48("span", { className: "text-muted-foreground text-xs", children: "\u2014" }) }),
|
|
2995
|
+
/* @__PURE__ */ jsx48("td", { className: "px-4 py-3 text-sm text-muted-foreground whitespace-nowrap", children: date }),
|
|
2996
|
+
/* @__PURE__ */ jsx48("td", { className: "px-4 py-3", children: /* @__PURE__ */ jsx48("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx48(
|
|
2779
2997
|
RowActions,
|
|
2780
2998
|
{
|
|
2781
2999
|
post,
|
|
@@ -2791,22 +3009,22 @@ function PostListTable({
|
|
|
2791
3009
|
);
|
|
2792
3010
|
}) })
|
|
2793
3011
|
] }),
|
|
2794
|
-
isEmpty && /* @__PURE__ */
|
|
2795
|
-
/* @__PURE__ */
|
|
2796
|
-
/* @__PURE__ */
|
|
2797
|
-
/* @__PURE__ */
|
|
2798
|
-
/* @__PURE__ */
|
|
2799
|
-
/* @__PURE__ */
|
|
2800
|
-
/* @__PURE__ */
|
|
3012
|
+
isEmpty && /* @__PURE__ */ jsxs31("div", { className: "flex flex-col items-center justify-center py-16 px-6 text-center", children: [
|
|
3013
|
+
/* @__PURE__ */ jsx48("div", { className: "text-muted-foreground mb-3", children: emptyIcon ?? /* @__PURE__ */ jsxs31("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: [
|
|
3014
|
+
/* @__PURE__ */ jsx48("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
3015
|
+
/* @__PURE__ */ jsx48("polyline", { points: "14 2 14 8 20 8" }),
|
|
3016
|
+
/* @__PURE__ */ jsx48("line", { x1: "16", y1: "13", x2: "8", y2: "13" }),
|
|
3017
|
+
/* @__PURE__ */ jsx48("line", { x1: "16", y1: "17", x2: "8", y2: "17" }),
|
|
3018
|
+
/* @__PURE__ */ jsx48("polyline", { points: "10 9 9 9 8 9" })
|
|
2801
3019
|
] }) }),
|
|
2802
|
-
/* @__PURE__ */
|
|
2803
|
-
onNewPost && /* @__PURE__ */
|
|
3020
|
+
/* @__PURE__ */ jsx48("p", { className: "text-sm text-muted-foreground mb-4", children: emptyMessage ?? `No ${singularLabel.toLowerCase()}s yet.` }),
|
|
3021
|
+
onNewPost && /* @__PURE__ */ jsxs31(
|
|
2804
3022
|
"button",
|
|
2805
3023
|
{
|
|
2806
3024
|
onClick: onNewPost,
|
|
2807
3025
|
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",
|
|
2808
3026
|
children: [
|
|
2809
|
-
/* @__PURE__ */
|
|
3027
|
+
/* @__PURE__ */ jsx48(IconPlus, {}),
|
|
2810
3028
|
newPostLabel ?? `New ${singularLabel}`
|
|
2811
3029
|
]
|
|
2812
3030
|
}
|
|
@@ -2816,7 +3034,7 @@ function PostListTable({
|
|
|
2816
3034
|
}
|
|
2817
3035
|
|
|
2818
3036
|
// src/components/content/post-filters-bar.tsx
|
|
2819
|
-
import { jsx as
|
|
3037
|
+
import { jsx as jsx49, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
2820
3038
|
var STATUS_TABS = [
|
|
2821
3039
|
{ value: "all", label: "All" },
|
|
2822
3040
|
{ value: "DRAFT", label: "Draft" },
|
|
@@ -2825,7 +3043,7 @@ var STATUS_TABS = [
|
|
|
2825
3043
|
{ value: "ARCHIVED", label: "Archived" }
|
|
2826
3044
|
];
|
|
2827
3045
|
function IconSearch() {
|
|
2828
|
-
return /* @__PURE__ */
|
|
3046
|
+
return /* @__PURE__ */ jsxs32(
|
|
2829
3047
|
"svg",
|
|
2830
3048
|
{
|
|
2831
3049
|
width: "14",
|
|
@@ -2837,14 +3055,14 @@ function IconSearch() {
|
|
|
2837
3055
|
strokeLinecap: "round",
|
|
2838
3056
|
strokeLinejoin: "round",
|
|
2839
3057
|
children: [
|
|
2840
|
-
/* @__PURE__ */
|
|
2841
|
-
/* @__PURE__ */
|
|
3058
|
+
/* @__PURE__ */ jsx49("circle", { cx: "11", cy: "11", r: "8" }),
|
|
3059
|
+
/* @__PURE__ */ jsx49("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
|
|
2842
3060
|
]
|
|
2843
3061
|
}
|
|
2844
3062
|
);
|
|
2845
3063
|
}
|
|
2846
3064
|
function IconPlus2() {
|
|
2847
|
-
return /* @__PURE__ */
|
|
3065
|
+
return /* @__PURE__ */ jsxs32(
|
|
2848
3066
|
"svg",
|
|
2849
3067
|
{
|
|
2850
3068
|
width: "14",
|
|
@@ -2856,8 +3074,8 @@ function IconPlus2() {
|
|
|
2856
3074
|
strokeLinecap: "round",
|
|
2857
3075
|
strokeLinejoin: "round",
|
|
2858
3076
|
children: [
|
|
2859
|
-
/* @__PURE__ */
|
|
2860
|
-
/* @__PURE__ */
|
|
3077
|
+
/* @__PURE__ */ jsx49("line", { x1: "12", y1: "5", x2: "12", y2: "19" }),
|
|
3078
|
+
/* @__PURE__ */ jsx49("line", { x1: "5", y1: "12", x2: "19", y2: "12" })
|
|
2861
3079
|
]
|
|
2862
3080
|
}
|
|
2863
3081
|
);
|
|
@@ -2873,11 +3091,11 @@ function PostFiltersBar({
|
|
|
2873
3091
|
typeLabel = "Posts",
|
|
2874
3092
|
className
|
|
2875
3093
|
}) {
|
|
2876
|
-
return /* @__PURE__ */
|
|
2877
|
-
/* @__PURE__ */
|
|
2878
|
-
/* @__PURE__ */
|
|
2879
|
-
/* @__PURE__ */
|
|
2880
|
-
/* @__PURE__ */
|
|
3094
|
+
return /* @__PURE__ */ jsxs32("div", { className: cn("space-y-2", className), children: [
|
|
3095
|
+
/* @__PURE__ */ jsxs32("div", { className: "flex flex-wrap items-center gap-3", children: [
|
|
3096
|
+
/* @__PURE__ */ jsxs32("div", { className: "relative flex items-center", children: [
|
|
3097
|
+
/* @__PURE__ */ jsx49("span", { className: "absolute left-2.5 text-muted-foreground pointer-events-none", children: /* @__PURE__ */ jsx49(IconSearch, {}) }),
|
|
3098
|
+
/* @__PURE__ */ jsx49(
|
|
2881
3099
|
"input",
|
|
2882
3100
|
{
|
|
2883
3101
|
type: "text",
|
|
@@ -2888,7 +3106,7 @@ function PostFiltersBar({
|
|
|
2888
3106
|
}
|
|
2889
3107
|
)
|
|
2890
3108
|
] }),
|
|
2891
|
-
/* @__PURE__ */
|
|
3109
|
+
/* @__PURE__ */ jsx49("div", { className: "flex items-center gap-1 rounded-lg bg-muted p-0.5", children: STATUS_TABS.map((tab) => /* @__PURE__ */ jsx49(
|
|
2892
3110
|
"button",
|
|
2893
3111
|
{
|
|
2894
3112
|
onClick: () => onStatusChange(tab.value),
|
|
@@ -2900,20 +3118,20 @@ function PostFiltersBar({
|
|
|
2900
3118
|
},
|
|
2901
3119
|
tab.value
|
|
2902
3120
|
)) }),
|
|
2903
|
-
/* @__PURE__ */
|
|
2904
|
-
onNew && /* @__PURE__ */
|
|
3121
|
+
/* @__PURE__ */ jsx49("div", { className: "flex-1" }),
|
|
3122
|
+
onNew && /* @__PURE__ */ jsxs32(
|
|
2905
3123
|
"button",
|
|
2906
3124
|
{
|
|
2907
3125
|
onClick: onNew,
|
|
2908
3126
|
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",
|
|
2909
3127
|
children: [
|
|
2910
|
-
/* @__PURE__ */
|
|
3128
|
+
/* @__PURE__ */ jsx49(IconPlus2, {}),
|
|
2911
3129
|
newLabel
|
|
2912
3130
|
]
|
|
2913
3131
|
}
|
|
2914
3132
|
)
|
|
2915
3133
|
] }),
|
|
2916
|
-
total !== void 0 && /* @__PURE__ */
|
|
3134
|
+
total !== void 0 && /* @__PURE__ */ jsxs32("p", { className: "text-xs text-muted-foreground", children: [
|
|
2917
3135
|
total,
|
|
2918
3136
|
" ",
|
|
2919
3137
|
total === 1 ? typeLabel.replace(/s$/, "") : typeLabel
|
|
@@ -2922,9 +3140,9 @@ function PostFiltersBar({
|
|
|
2922
3140
|
}
|
|
2923
3141
|
|
|
2924
3142
|
// src/components/content/post-editor-shell.tsx
|
|
2925
|
-
import { jsx as
|
|
3143
|
+
import { jsx as jsx50, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
2926
3144
|
function IconArrowLeft() {
|
|
2927
|
-
return /* @__PURE__ */
|
|
3145
|
+
return /* @__PURE__ */ jsxs33(
|
|
2928
3146
|
"svg",
|
|
2929
3147
|
{
|
|
2930
3148
|
width: "14",
|
|
@@ -2936,14 +3154,14 @@ function IconArrowLeft() {
|
|
|
2936
3154
|
strokeLinecap: "round",
|
|
2937
3155
|
strokeLinejoin: "round",
|
|
2938
3156
|
children: [
|
|
2939
|
-
/* @__PURE__ */
|
|
2940
|
-
/* @__PURE__ */
|
|
3157
|
+
/* @__PURE__ */ jsx50("line", { x1: "19", y1: "12", x2: "5", y2: "12" }),
|
|
3158
|
+
/* @__PURE__ */ jsx50("polyline", { points: "12 19 5 12 12 5" })
|
|
2941
3159
|
]
|
|
2942
3160
|
}
|
|
2943
3161
|
);
|
|
2944
3162
|
}
|
|
2945
3163
|
function IconSpinner() {
|
|
2946
|
-
return /* @__PURE__ */
|
|
3164
|
+
return /* @__PURE__ */ jsx50(
|
|
2947
3165
|
"svg",
|
|
2948
3166
|
{
|
|
2949
3167
|
width: "14",
|
|
@@ -2955,12 +3173,12 @@ function IconSpinner() {
|
|
|
2955
3173
|
strokeLinecap: "round",
|
|
2956
3174
|
strokeLinejoin: "round",
|
|
2957
3175
|
className: "animate-spin",
|
|
2958
|
-
children: /* @__PURE__ */
|
|
3176
|
+
children: /* @__PURE__ */ jsx50("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
|
|
2959
3177
|
}
|
|
2960
3178
|
);
|
|
2961
3179
|
}
|
|
2962
3180
|
function IconMoreHorizontal2() {
|
|
2963
|
-
return /* @__PURE__ */
|
|
3181
|
+
return /* @__PURE__ */ jsxs33(
|
|
2964
3182
|
"svg",
|
|
2965
3183
|
{
|
|
2966
3184
|
width: "16",
|
|
@@ -2972,9 +3190,9 @@ function IconMoreHorizontal2() {
|
|
|
2972
3190
|
strokeLinecap: "round",
|
|
2973
3191
|
strokeLinejoin: "round",
|
|
2974
3192
|
children: [
|
|
2975
|
-
/* @__PURE__ */
|
|
2976
|
-
/* @__PURE__ */
|
|
2977
|
-
/* @__PURE__ */
|
|
3193
|
+
/* @__PURE__ */ jsx50("circle", { cx: "5", cy: "12", r: "1", fill: "currentColor" }),
|
|
3194
|
+
/* @__PURE__ */ jsx50("circle", { cx: "12", cy: "12", r: "1", fill: "currentColor" }),
|
|
3195
|
+
/* @__PURE__ */ jsx50("circle", { cx: "19", cy: "12", r: "1", fill: "currentColor" })
|
|
2978
3196
|
]
|
|
2979
3197
|
}
|
|
2980
3198
|
);
|
|
@@ -2992,60 +3210,60 @@ function PostEditorShell({
|
|
|
2992
3210
|
sidebar,
|
|
2993
3211
|
className
|
|
2994
3212
|
}) {
|
|
2995
|
-
return /* @__PURE__ */
|
|
2996
|
-
/* @__PURE__ */
|
|
2997
|
-
onBack && /* @__PURE__ */
|
|
3213
|
+
return /* @__PURE__ */ jsxs33("div", { className: cn("flex flex-col h-screen bg-background overflow-hidden", className), children: [
|
|
3214
|
+
/* @__PURE__ */ jsxs33("div", { className: "flex items-center gap-3 h-14 px-4 border-b border-border bg-card shrink-0", children: [
|
|
3215
|
+
onBack && /* @__PURE__ */ jsxs33(
|
|
2998
3216
|
"button",
|
|
2999
3217
|
{
|
|
3000
3218
|
onClick: onBack,
|
|
3001
3219
|
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",
|
|
3002
3220
|
children: [
|
|
3003
|
-
/* @__PURE__ */
|
|
3221
|
+
/* @__PURE__ */ jsx50(IconArrowLeft, {}),
|
|
3004
3222
|
backLabel
|
|
3005
3223
|
]
|
|
3006
3224
|
}
|
|
3007
3225
|
),
|
|
3008
|
-
onBack && /* @__PURE__ */
|
|
3009
|
-
title && /* @__PURE__ */
|
|
3010
|
-
status && /* @__PURE__ */
|
|
3011
|
-
/* @__PURE__ */
|
|
3012
|
-
/* @__PURE__ */
|
|
3013
|
-
/* @__PURE__ */
|
|
3226
|
+
onBack && /* @__PURE__ */ jsx50("div", { className: "h-5 w-px bg-border" }),
|
|
3227
|
+
title && /* @__PURE__ */ jsx50("span", { className: "text-sm font-medium text-muted-foreground truncate max-w-xs", children: title }),
|
|
3228
|
+
status && /* @__PURE__ */ jsx50(PostStatusBadge, { status, size: "sm" }),
|
|
3229
|
+
/* @__PURE__ */ jsx50("div", { className: "flex-1" }),
|
|
3230
|
+
/* @__PURE__ */ jsx50("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__ */ jsx50(IconMoreHorizontal2, {}) }),
|
|
3231
|
+
/* @__PURE__ */ jsxs33(
|
|
3014
3232
|
"button",
|
|
3015
3233
|
{
|
|
3016
3234
|
onClick: onSave,
|
|
3017
3235
|
disabled: saving,
|
|
3018
3236
|
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",
|
|
3019
3237
|
children: [
|
|
3020
|
-
saving && /* @__PURE__ */
|
|
3238
|
+
saving && /* @__PURE__ */ jsx50(IconSpinner, {}),
|
|
3021
3239
|
"Save Draft"
|
|
3022
3240
|
]
|
|
3023
3241
|
}
|
|
3024
3242
|
),
|
|
3025
|
-
/* @__PURE__ */
|
|
3243
|
+
/* @__PURE__ */ jsxs33(
|
|
3026
3244
|
"button",
|
|
3027
3245
|
{
|
|
3028
3246
|
onClick: onPublish,
|
|
3029
3247
|
disabled: publishing,
|
|
3030
3248
|
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",
|
|
3031
3249
|
children: [
|
|
3032
|
-
publishing && /* @__PURE__ */
|
|
3250
|
+
publishing && /* @__PURE__ */ jsx50(IconSpinner, {}),
|
|
3033
3251
|
"Publish"
|
|
3034
3252
|
]
|
|
3035
3253
|
}
|
|
3036
3254
|
)
|
|
3037
3255
|
] }),
|
|
3038
|
-
/* @__PURE__ */
|
|
3039
|
-
/* @__PURE__ */
|
|
3040
|
-
/* @__PURE__ */
|
|
3256
|
+
/* @__PURE__ */ jsxs33("div", { className: "flex flex-1 overflow-hidden", children: [
|
|
3257
|
+
/* @__PURE__ */ jsx50("div", { className: "flex-1 overflow-y-auto p-6", children: /* @__PURE__ */ jsx50("div", { className: "max-w-3xl mx-auto", children }) }),
|
|
3258
|
+
/* @__PURE__ */ jsx50("div", { className: "w-72 shrink-0 border-l border-border overflow-y-auto p-4", children: sidebar })
|
|
3041
3259
|
] })
|
|
3042
3260
|
] });
|
|
3043
3261
|
}
|
|
3044
3262
|
|
|
3045
3263
|
// src/components/content/slug-input.tsx
|
|
3046
|
-
import { jsx as
|
|
3264
|
+
import { jsx as jsx51, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
3047
3265
|
function IconRefresh() {
|
|
3048
|
-
return /* @__PURE__ */
|
|
3266
|
+
return /* @__PURE__ */ jsxs34(
|
|
3049
3267
|
"svg",
|
|
3050
3268
|
{
|
|
3051
3269
|
width: "13",
|
|
@@ -3057,9 +3275,9 @@ function IconRefresh() {
|
|
|
3057
3275
|
strokeLinecap: "round",
|
|
3058
3276
|
strokeLinejoin: "round",
|
|
3059
3277
|
children: [
|
|
3060
|
-
/* @__PURE__ */
|
|
3061
|
-
/* @__PURE__ */
|
|
3062
|
-
/* @__PURE__ */
|
|
3278
|
+
/* @__PURE__ */ jsx51("polyline", { points: "23 4 23 10 17 10" }),
|
|
3279
|
+
/* @__PURE__ */ jsx51("polyline", { points: "1 20 1 14 7 14" }),
|
|
3280
|
+
/* @__PURE__ */ jsx51("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" })
|
|
3063
3281
|
]
|
|
3064
3282
|
}
|
|
3065
3283
|
);
|
|
@@ -3072,10 +3290,10 @@ function SlugInput({
|
|
|
3072
3290
|
disabled = false,
|
|
3073
3291
|
className
|
|
3074
3292
|
}) {
|
|
3075
|
-
return /* @__PURE__ */
|
|
3076
|
-
/* @__PURE__ */
|
|
3077
|
-
prefix && /* @__PURE__ */
|
|
3078
|
-
/* @__PURE__ */
|
|
3293
|
+
return /* @__PURE__ */ jsxs34("div", { className: cn("space-y-1", className), children: [
|
|
3294
|
+
/* @__PURE__ */ jsxs34("div", { className: "flex items-center gap-1", children: [
|
|
3295
|
+
prefix && /* @__PURE__ */ jsx51("span", { className: "shrink-0 text-sm text-muted-foreground select-none", children: prefix }),
|
|
3296
|
+
/* @__PURE__ */ jsx51(
|
|
3079
3297
|
"input",
|
|
3080
3298
|
{
|
|
3081
3299
|
type: "text",
|
|
@@ -3089,26 +3307,26 @@ function SlugInput({
|
|
|
3089
3307
|
placeholder: "your-slug-here"
|
|
3090
3308
|
}
|
|
3091
3309
|
),
|
|
3092
|
-
onGenerate && /* @__PURE__ */
|
|
3310
|
+
onGenerate && /* @__PURE__ */ jsx51(
|
|
3093
3311
|
"button",
|
|
3094
3312
|
{
|
|
3095
3313
|
onClick: onGenerate,
|
|
3096
3314
|
disabled,
|
|
3097
3315
|
title: "Generate slug",
|
|
3098
3316
|
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",
|
|
3099
|
-
children: /* @__PURE__ */
|
|
3317
|
+
children: /* @__PURE__ */ jsx51(IconRefresh, {})
|
|
3100
3318
|
}
|
|
3101
3319
|
)
|
|
3102
3320
|
] }),
|
|
3103
|
-
/* @__PURE__ */
|
|
3321
|
+
/* @__PURE__ */ jsx51("p", { className: "text-[10px] text-muted-foreground", children: "Only lowercase letters, numbers, and hyphens" })
|
|
3104
3322
|
] });
|
|
3105
3323
|
}
|
|
3106
3324
|
|
|
3107
3325
|
// src/components/content/post-sidebar-section.tsx
|
|
3108
3326
|
import * as React22 from "react";
|
|
3109
|
-
import { jsx as
|
|
3327
|
+
import { jsx as jsx52, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
3110
3328
|
function IconChevronDown() {
|
|
3111
|
-
return /* @__PURE__ */
|
|
3329
|
+
return /* @__PURE__ */ jsx52(
|
|
3112
3330
|
"svg",
|
|
3113
3331
|
{
|
|
3114
3332
|
width: "14",
|
|
@@ -3119,7 +3337,7 @@ function IconChevronDown() {
|
|
|
3119
3337
|
strokeWidth: "2",
|
|
3120
3338
|
strokeLinecap: "round",
|
|
3121
3339
|
strokeLinejoin: "round",
|
|
3122
|
-
children: /* @__PURE__ */
|
|
3340
|
+
children: /* @__PURE__ */ jsx52("polyline", { points: "6 9 12 15 18 9" })
|
|
3123
3341
|
}
|
|
3124
3342
|
);
|
|
3125
3343
|
}
|
|
@@ -3130,28 +3348,28 @@ function PostSidebarSection({
|
|
|
3130
3348
|
className
|
|
3131
3349
|
}) {
|
|
3132
3350
|
const [open, setOpen] = React22.useState(defaultOpen);
|
|
3133
|
-
return /* @__PURE__ */
|
|
3134
|
-
/* @__PURE__ */
|
|
3351
|
+
return /* @__PURE__ */ jsxs35("div", { className: cn("border-b border-border", className), children: [
|
|
3352
|
+
/* @__PURE__ */ jsxs35(
|
|
3135
3353
|
"button",
|
|
3136
3354
|
{
|
|
3137
3355
|
onClick: () => setOpen((v) => !v),
|
|
3138
3356
|
className: "flex w-full items-center justify-between py-3 px-0 text-sm font-medium text-foreground hover:text-primary transition-colors",
|
|
3139
3357
|
children: [
|
|
3140
3358
|
title,
|
|
3141
|
-
/* @__PURE__ */
|
|
3359
|
+
/* @__PURE__ */ jsx52(
|
|
3142
3360
|
"span",
|
|
3143
3361
|
{
|
|
3144
3362
|
className: cn(
|
|
3145
3363
|
"text-muted-foreground transition-transform duration-200",
|
|
3146
3364
|
open ? "rotate-0" : "-rotate-90"
|
|
3147
3365
|
),
|
|
3148
|
-
children: /* @__PURE__ */
|
|
3366
|
+
children: /* @__PURE__ */ jsx52(IconChevronDown, {})
|
|
3149
3367
|
}
|
|
3150
3368
|
)
|
|
3151
3369
|
]
|
|
3152
3370
|
}
|
|
3153
3371
|
),
|
|
3154
|
-
/* @__PURE__ */
|
|
3372
|
+
/* @__PURE__ */ jsx52(
|
|
3155
3373
|
"div",
|
|
3156
3374
|
{
|
|
3157
3375
|
className: cn(
|
|
@@ -3165,7 +3383,7 @@ function PostSidebarSection({
|
|
|
3165
3383
|
}
|
|
3166
3384
|
|
|
3167
3385
|
// src/components/ui/hsl-color-input.tsx
|
|
3168
|
-
import { useState as
|
|
3386
|
+
import { useState as useState11, useRef as useRef6, useEffect as useEffect7, useCallback as useCallback2 } from "react";
|
|
3169
3387
|
import Color2 from "color";
|
|
3170
3388
|
import * as Popover2 from "@radix-ui/react-popover";
|
|
3171
3389
|
|
|
@@ -3176,13 +3394,13 @@ import {
|
|
|
3176
3394
|
memo,
|
|
3177
3395
|
useCallback,
|
|
3178
3396
|
useContext,
|
|
3179
|
-
useEffect as
|
|
3397
|
+
useEffect as useEffect6,
|
|
3180
3398
|
useMemo as useMemo2,
|
|
3181
|
-
useRef as
|
|
3182
|
-
useState as
|
|
3399
|
+
useRef as useRef5,
|
|
3400
|
+
useState as useState10
|
|
3183
3401
|
} from "react";
|
|
3184
3402
|
import * as Slider from "@radix-ui/react-slider";
|
|
3185
|
-
import { jsx as
|
|
3403
|
+
import { jsx as jsx53, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
3186
3404
|
var ColorPickerContext = createContext(void 0);
|
|
3187
3405
|
var useColorPicker = () => {
|
|
3188
3406
|
const ctx = useContext(ColorPickerContext);
|
|
@@ -3203,18 +3421,17 @@ var ColorPicker = ({
|
|
|
3203
3421
|
return Color("#000000");
|
|
3204
3422
|
}
|
|
3205
3423
|
})();
|
|
3206
|
-
const [hue, setHueState] =
|
|
3207
|
-
const [saturation, setSaturationState] =
|
|
3208
|
-
const [lightness, setLightnessState] =
|
|
3209
|
-
const [alpha, setAlphaState] =
|
|
3210
|
-
const [mode, setMode] =
|
|
3211
|
-
const notifyRef =
|
|
3212
|
-
|
|
3424
|
+
const [hue, setHueState] = useState10(initial.hue());
|
|
3425
|
+
const [saturation, setSaturationState] = useState10(initial.saturationl());
|
|
3426
|
+
const [lightness, setLightnessState] = useState10(initial.lightness());
|
|
3427
|
+
const [alpha, setAlphaState] = useState10(initial.alpha() * 100);
|
|
3428
|
+
const [mode, setMode] = useState10("HEX");
|
|
3429
|
+
const notifyRef = useRef5(onChange);
|
|
3430
|
+
useEffect6(() => {
|
|
3213
3431
|
notifyRef.current = onChange;
|
|
3214
3432
|
}, [onChange]);
|
|
3215
3433
|
const notify = useCallback((h, s, l, a) => {
|
|
3216
|
-
|
|
3217
|
-
notifyRef.current?.(hex);
|
|
3434
|
+
notifyRef.current?.(Color.hsl(h, s, l).alpha(a / 100).hexa());
|
|
3218
3435
|
}, []);
|
|
3219
3436
|
const setHue = useCallback((h) => {
|
|
3220
3437
|
setHueState(h);
|
|
@@ -3232,14 +3449,14 @@ var ColorPicker = ({
|
|
|
3232
3449
|
setAlphaState(a);
|
|
3233
3450
|
notify(hue, saturation, lightness, a);
|
|
3234
3451
|
}, [hue, saturation, lightness, notify]);
|
|
3235
|
-
return /* @__PURE__ */
|
|
3452
|
+
return /* @__PURE__ */ jsx53(ColorPickerContext.Provider, { value: { hue, saturation, lightness, alpha, mode, setHue, setSaturation, setLightness, setAlpha, setMode }, children: /* @__PURE__ */ jsx53("div", { className: cn("flex flex-col gap-3", className), ...props, children }) });
|
|
3236
3453
|
};
|
|
3237
3454
|
var ColorPickerSelection = memo(({ className, ...props }) => {
|
|
3238
|
-
const containerRef =
|
|
3239
|
-
const [isDragging, setIsDragging] =
|
|
3455
|
+
const containerRef = useRef5(null);
|
|
3456
|
+
const [isDragging, setIsDragging] = useState10(false);
|
|
3240
3457
|
const { hue, saturation, lightness, setSaturation, setLightness } = useColorPicker();
|
|
3241
|
-
const [posX, setPosX] =
|
|
3242
|
-
const [posY, setPosY] =
|
|
3458
|
+
const [posX, setPosX] = useState10(() => saturation / 100);
|
|
3459
|
+
const [posY, setPosY] = useState10(() => {
|
|
3243
3460
|
const x = saturation / 100;
|
|
3244
3461
|
const topL = x < 0.01 ? 100 : 50 + 50 * (1 - x);
|
|
3245
3462
|
return topL > 0 ? Math.max(0, Math.min(1, 1 - lightness / topL)) : 0;
|
|
@@ -3256,10 +3473,9 @@ var ColorPickerSelection = memo(({ className, ...props }) => {
|
|
|
3256
3473
|
setPosX(x);
|
|
3257
3474
|
setPosY(y);
|
|
3258
3475
|
setSaturation(x * 100);
|
|
3259
|
-
|
|
3260
|
-
setLightness(topL * (1 - y));
|
|
3476
|
+
setLightness((x < 0.01 ? 100 : 50 + 50 * (1 - x)) * (1 - y));
|
|
3261
3477
|
}, [isDragging, setSaturation, setLightness]);
|
|
3262
|
-
|
|
3478
|
+
useEffect6(() => {
|
|
3263
3479
|
if (!isDragging) return;
|
|
3264
3480
|
const up = () => setIsDragging(false);
|
|
3265
3481
|
window.addEventListener("pointermove", handleMove);
|
|
@@ -3269,7 +3485,7 @@ var ColorPickerSelection = memo(({ className, ...props }) => {
|
|
|
3269
3485
|
window.removeEventListener("pointerup", up);
|
|
3270
3486
|
};
|
|
3271
3487
|
}, [isDragging, handleMove]);
|
|
3272
|
-
return /* @__PURE__ */
|
|
3488
|
+
return /* @__PURE__ */ jsx53(
|
|
3273
3489
|
"div",
|
|
3274
3490
|
{
|
|
3275
3491
|
ref: containerRef,
|
|
@@ -3281,15 +3497,11 @@ var ColorPickerSelection = memo(({ className, ...props }) => {
|
|
|
3281
3497
|
handleMove(e.nativeEvent);
|
|
3282
3498
|
},
|
|
3283
3499
|
...props,
|
|
3284
|
-
children: /* @__PURE__ */
|
|
3500
|
+
children: /* @__PURE__ */ jsx53(
|
|
3285
3501
|
"div",
|
|
3286
3502
|
{
|
|
3287
3503
|
className: "pointer-events-none absolute h-4 w-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white",
|
|
3288
|
-
style: {
|
|
3289
|
-
left: `${posX * 100}%`,
|
|
3290
|
-
top: `${posY * 100}%`,
|
|
3291
|
-
boxShadow: "0 0 0 1px rgba(0,0,0,0.6)"
|
|
3292
|
-
}
|
|
3504
|
+
style: { left: `${posX * 100}%`, top: `${posY * 100}%`, boxShadow: "0 0 0 1px rgba(0,0,0,0.6)" }
|
|
3293
3505
|
}
|
|
3294
3506
|
)
|
|
3295
3507
|
}
|
|
@@ -3298,119 +3510,82 @@ var ColorPickerSelection = memo(({ className, ...props }) => {
|
|
|
3298
3510
|
ColorPickerSelection.displayName = "ColorPickerSelection";
|
|
3299
3511
|
var ColorPickerHue = ({ className, ...props }) => {
|
|
3300
3512
|
const { hue, setHue } = useColorPicker();
|
|
3301
|
-
return /* @__PURE__ */
|
|
3302
|
-
Slider.
|
|
3303
|
-
{
|
|
3304
|
-
|
|
3305
|
-
max: 360,
|
|
3306
|
-
step: 1,
|
|
3307
|
-
value: [hue],
|
|
3308
|
-
onValueChange: ([h]) => setHue(h),
|
|
3309
|
-
...props,
|
|
3310
|
-
children: [
|
|
3311
|
-
/* @__PURE__ */ jsx49(Slider.Track, { className: "relative h-3 w-full grow rounded-full bg-[linear-gradient(90deg,#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00)]", children: /* @__PURE__ */ jsx49(Slider.Range, { className: "absolute h-full" }) }),
|
|
3312
|
-
/* @__PURE__ */ jsx49(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)" } })
|
|
3313
|
-
]
|
|
3314
|
-
}
|
|
3315
|
-
);
|
|
3513
|
+
return /* @__PURE__ */ jsxs36(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: [
|
|
3514
|
+
/* @__PURE__ */ jsx53(Slider.Track, { className: "relative h-3 w-full grow rounded-full bg-[linear-gradient(90deg,#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00)]", children: /* @__PURE__ */ jsx53(Slider.Range, { className: "absolute h-full" }) }),
|
|
3515
|
+
/* @__PURE__ */ jsx53(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)" } })
|
|
3516
|
+
] });
|
|
3316
3517
|
};
|
|
3317
3518
|
var ColorPickerAlpha = ({ className, ...props }) => {
|
|
3318
3519
|
const { alpha, setAlpha, hue, saturation, lightness } = useColorPicker();
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
{
|
|
3323
|
-
|
|
3324
|
-
max: 100,
|
|
3325
|
-
step: 1,
|
|
3326
|
-
value: [alpha],
|
|
3327
|
-
onValueChange: ([a]) => setAlpha(a),
|
|
3328
|
-
...props,
|
|
3329
|
-
children: [
|
|
3330
|
-
/* @__PURE__ */ jsx49(
|
|
3331
|
-
Slider.Track,
|
|
3332
|
-
{
|
|
3333
|
-
className: "relative h-3 w-full grow rounded-full",
|
|
3334
|
-
style: {
|
|
3335
|
-
backgroundImage: `linear-gradient(90deg, transparent, ${solidColor}), url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==")`
|
|
3336
|
-
},
|
|
3337
|
-
children: /* @__PURE__ */ jsx49(Slider.Range, { className: "absolute h-full" })
|
|
3338
|
-
}
|
|
3339
|
-
),
|
|
3340
|
-
/* @__PURE__ */ jsx49(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)" } })
|
|
3341
|
-
]
|
|
3342
|
-
}
|
|
3343
|
-
);
|
|
3344
|
-
};
|
|
3345
|
-
var ColorPickerHexOutput = ({ className, ...props }) => {
|
|
3346
|
-
const { hue, saturation, lightness, alpha } = useColorPicker();
|
|
3347
|
-
const hex = Color.hsl(hue, saturation, lightness).alpha(alpha / 100).hex();
|
|
3348
|
-
return /* @__PURE__ */ jsxs33("div", { className: cn("flex items-center gap-1.5 px-1", className), ...props, children: [
|
|
3349
|
-
/* @__PURE__ */ jsx49("div", { className: "w-5 h-5 rounded border border-white/20 shrink-0", style: { background: `hsl(${hue},${saturation}%,${lightness}%)` } }),
|
|
3350
|
-
/* @__PURE__ */ jsx49("span", { className: "text-xs font-mono text-white/50 flex-1", children: hex })
|
|
3520
|
+
return /* @__PURE__ */ jsxs36(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: [
|
|
3521
|
+
/* @__PURE__ */ jsx53(Slider.Track, { className: "relative h-3 w-full grow rounded-full", style: {
|
|
3522
|
+
backgroundImage: `linear-gradient(90deg,transparent,hsl(${hue},${saturation}%,${lightness}%)),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==")`
|
|
3523
|
+
}, children: /* @__PURE__ */ jsx53(Slider.Range, { className: "absolute h-full" }) }),
|
|
3524
|
+
/* @__PURE__ */ jsx53(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)" } })
|
|
3351
3525
|
] });
|
|
3352
3526
|
};
|
|
3353
3527
|
var ColorPickerEyeDropper = ({ className, ...props }) => {
|
|
3354
3528
|
const { setHue, setSaturation, setLightness, setAlpha } = useColorPicker();
|
|
3355
|
-
|
|
3356
|
-
try {
|
|
3357
|
-
const result = await new EyeDropper().open();
|
|
3358
|
-
const c = Color(result.sRGBHex);
|
|
3359
|
-
setHue(c.hue());
|
|
3360
|
-
setSaturation(c.saturationl());
|
|
3361
|
-
setLightness(c.lightness());
|
|
3362
|
-
setAlpha(100);
|
|
3363
|
-
} catch {
|
|
3364
|
-
}
|
|
3365
|
-
};
|
|
3366
|
-
return /* @__PURE__ */ jsx49(
|
|
3529
|
+
return /* @__PURE__ */ jsx53(
|
|
3367
3530
|
"button",
|
|
3368
3531
|
{
|
|
3369
3532
|
type: "button",
|
|
3370
|
-
onClick: pick,
|
|
3371
3533
|
title: "Eye dropper",
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3534
|
+
onClick: async () => {
|
|
3535
|
+
try {
|
|
3536
|
+
const r = await new EyeDropper().open();
|
|
3537
|
+
const c = Color(r.sRGBHex);
|
|
3538
|
+
setHue(c.hue());
|
|
3539
|
+
setSaturation(c.saturationl());
|
|
3540
|
+
setLightness(c.lightness());
|
|
3541
|
+
setAlpha(100);
|
|
3542
|
+
} catch {
|
|
3543
|
+
}
|
|
3544
|
+
},
|
|
3545
|
+
className: cn("shrink-0 focus:outline-none", className),
|
|
3546
|
+
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" },
|
|
3378
3547
|
...props,
|
|
3379
|
-
children: /* @__PURE__ */
|
|
3380
|
-
/* @__PURE__ */
|
|
3381
|
-
/* @__PURE__ */
|
|
3382
|
-
/* @__PURE__ */
|
|
3548
|
+
children: /* @__PURE__ */ jsxs36("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
3549
|
+
/* @__PURE__ */ jsx53("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" }),
|
|
3550
|
+
/* @__PURE__ */ jsx53("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" }),
|
|
3551
|
+
/* @__PURE__ */ jsx53("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" })
|
|
3383
3552
|
] })
|
|
3384
3553
|
}
|
|
3385
3554
|
);
|
|
3386
3555
|
};
|
|
3387
3556
|
var ColorPickerOutput = ({ className, ...props }) => {
|
|
3388
3557
|
const { mode, setMode } = useColorPicker();
|
|
3389
|
-
return /* @__PURE__ */
|
|
3390
|
-
/* @__PURE__ */
|
|
3391
|
-
|
|
3392
|
-
SelectContent,
|
|
3558
|
+
return /* @__PURE__ */ jsxs36("div", { className: cn("relative shrink-0", className), ...props, children: [
|
|
3559
|
+
/* @__PURE__ */ jsx53(
|
|
3560
|
+
"select",
|
|
3393
3561
|
{
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3562
|
+
value: mode,
|
|
3563
|
+
onChange: (e) => setMode(e.target.value),
|
|
3564
|
+
style: {
|
|
3565
|
+
height: 32,
|
|
3566
|
+
width: 72,
|
|
3567
|
+
backgroundColor: "rgba(255,255,255,0.06)",
|
|
3568
|
+
border: "1px solid rgba(255,255,255,0.12)",
|
|
3569
|
+
borderRadius: 6,
|
|
3570
|
+
color: "rgba(255,255,255,0.75)",
|
|
3571
|
+
fontSize: 12,
|
|
3572
|
+
paddingLeft: 8,
|
|
3573
|
+
paddingRight: 24,
|
|
3574
|
+
outline: "none",
|
|
3575
|
+
cursor: "pointer",
|
|
3576
|
+
appearance: "none",
|
|
3577
|
+
WebkitAppearance: "none"
|
|
3578
|
+
},
|
|
3579
|
+
children: ["HEX", "HSL", "RGB"].map((f) => /* @__PURE__ */ jsx53("option", { value: f, style: { backgroundColor: "#1e2130", color: "rgba(255,255,255,0.8)" }, children: f }, f))
|
|
3406
3580
|
}
|
|
3407
|
-
)
|
|
3581
|
+
),
|
|
3582
|
+
/* @__PURE__ */ jsx53("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__ */ jsx53("path", { d: "m6 9 6 6 6-6" }) })
|
|
3408
3583
|
] });
|
|
3409
3584
|
};
|
|
3410
3585
|
var ColorPickerFormat = ({ className, ...props }) => {
|
|
3411
3586
|
const { hue, saturation, lightness, alpha, mode, setHue, setSaturation, setLightness, setAlpha } = useColorPicker();
|
|
3412
|
-
const [focused, setFocused] =
|
|
3413
|
-
const [localVal, setLocalVal] =
|
|
3587
|
+
const [focused, setFocused] = useState10(false);
|
|
3588
|
+
const [localVal, setLocalVal] = useState10("");
|
|
3414
3589
|
const computedVal = (() => {
|
|
3415
3590
|
try {
|
|
3416
3591
|
const c = Color.hsl(hue, saturation, lightness).alpha(alpha / 100);
|
|
@@ -3424,29 +3599,28 @@ var ColorPickerFormat = ({ className, ...props }) => {
|
|
|
3424
3599
|
}
|
|
3425
3600
|
return "";
|
|
3426
3601
|
})();
|
|
3427
|
-
|
|
3602
|
+
useEffect6(() => {
|
|
3428
3603
|
if (!focused) setLocalVal(computedVal);
|
|
3429
3604
|
}, [computedVal, focused]);
|
|
3430
3605
|
const tryApply = (raw) => {
|
|
3431
3606
|
try {
|
|
3432
3607
|
if (mode === "HEX") {
|
|
3433
|
-
const
|
|
3434
|
-
const c = Color(hex);
|
|
3608
|
+
const c = Color(raw.startsWith("#") ? raw : `#${raw}`);
|
|
3435
3609
|
setHue(c.hue());
|
|
3436
3610
|
setSaturation(c.saturationl());
|
|
3437
3611
|
setLightness(c.lightness());
|
|
3438
3612
|
setAlpha(c.alpha() * 100);
|
|
3439
3613
|
} else if (mode === "HSL") {
|
|
3440
|
-
const
|
|
3441
|
-
if (
|
|
3442
|
-
setHue(+
|
|
3443
|
-
setSaturation(+
|
|
3444
|
-
setLightness(+
|
|
3614
|
+
const p = raw.split(/[\s,%]+/).filter(Boolean);
|
|
3615
|
+
if (p.length >= 3) {
|
|
3616
|
+
setHue(+p[0]);
|
|
3617
|
+
setSaturation(+p[1]);
|
|
3618
|
+
setLightness(+p[2]);
|
|
3445
3619
|
}
|
|
3446
3620
|
} else if (mode === "RGB") {
|
|
3447
|
-
const
|
|
3448
|
-
if (
|
|
3449
|
-
const c = Color.rgb(+
|
|
3621
|
+
const p = raw.split(/[\s,]+/).filter(Boolean);
|
|
3622
|
+
if (p.length >= 3) {
|
|
3623
|
+
const c = Color.rgb(+p[0], +p[1], +p[2]);
|
|
3450
3624
|
setHue(c.hue());
|
|
3451
3625
|
setSaturation(c.saturationl());
|
|
3452
3626
|
setLightness(c.lightness());
|
|
@@ -3455,7 +3629,7 @@ var ColorPickerFormat = ({ className, ...props }) => {
|
|
|
3455
3629
|
} catch {
|
|
3456
3630
|
}
|
|
3457
3631
|
};
|
|
3458
|
-
return /* @__PURE__ */
|
|
3632
|
+
return /* @__PURE__ */ jsx53(
|
|
3459
3633
|
"input",
|
|
3460
3634
|
{
|
|
3461
3635
|
type: "text",
|
|
@@ -3472,18 +3646,35 @@ var ColorPickerFormat = ({ className, ...props }) => {
|
|
|
3472
3646
|
tryApply(localVal);
|
|
3473
3647
|
setFocused(false);
|
|
3474
3648
|
},
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3649
|
+
style: {
|
|
3650
|
+
flex: 1,
|
|
3651
|
+
minWidth: 0,
|
|
3652
|
+
height: 32,
|
|
3653
|
+
backgroundColor: "rgba(255,255,255,0.05)",
|
|
3654
|
+
border: "1px solid rgba(255,255,255,0.12)",
|
|
3655
|
+
borderRadius: 6,
|
|
3656
|
+
padding: "0 8px",
|
|
3657
|
+
color: "rgba(255,255,255,0.75)",
|
|
3658
|
+
fontSize: 12,
|
|
3659
|
+
fontFamily: "monospace",
|
|
3660
|
+
outline: "none"
|
|
3661
|
+
},
|
|
3662
|
+
className,
|
|
3480
3663
|
...props
|
|
3481
3664
|
}
|
|
3482
3665
|
);
|
|
3483
3666
|
};
|
|
3667
|
+
var ColorPickerHexOutput = ({ className, ...props }) => {
|
|
3668
|
+
const { hue, saturation, lightness } = useColorPicker();
|
|
3669
|
+
const hex = Color.hsl(hue, saturation, lightness).hex();
|
|
3670
|
+
return /* @__PURE__ */ jsxs36("div", { className: cn("flex items-center gap-1.5 px-0.5", className), ...props, children: [
|
|
3671
|
+
/* @__PURE__ */ jsx53("div", { className: "w-5 h-5 rounded border border-white/20 shrink-0", style: { background: `hsl(${hue},${saturation}%,${lightness}%)` } }),
|
|
3672
|
+
/* @__PURE__ */ jsx53("span", { className: "text-xs font-mono text-white/50", children: hex })
|
|
3673
|
+
] });
|
|
3674
|
+
};
|
|
3484
3675
|
|
|
3485
3676
|
// src/components/ui/hsl-color-input.tsx
|
|
3486
|
-
import { jsx as
|
|
3677
|
+
import { jsx as jsx54, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
3487
3678
|
function hslToHex(hsl) {
|
|
3488
3679
|
if (!hsl) return "#000000";
|
|
3489
3680
|
try {
|
|
@@ -3506,7 +3697,7 @@ function hexToHsl(hex) {
|
|
|
3506
3697
|
}
|
|
3507
3698
|
function ColorReader({ onHexChange }) {
|
|
3508
3699
|
const { hue, saturation, lightness, alpha } = useColorPicker();
|
|
3509
|
-
|
|
3700
|
+
useEffect7(() => {
|
|
3510
3701
|
try {
|
|
3511
3702
|
const hex = Color2.hsl(hue, saturation, lightness).alpha(alpha / 100).hex();
|
|
3512
3703
|
onHexChange(hex);
|
|
@@ -3516,15 +3707,15 @@ function ColorReader({ onHexChange }) {
|
|
|
3516
3707
|
return null;
|
|
3517
3708
|
}
|
|
3518
3709
|
function HslColorInput({ value, onChange, className, inputClassName, disabled }) {
|
|
3519
|
-
const [open, setOpen] =
|
|
3710
|
+
const [open, setOpen] = useState11(false);
|
|
3520
3711
|
const hexValue = hslToHex(value);
|
|
3521
3712
|
const cssColor = value ? `hsl(${value})` : "transparent";
|
|
3522
|
-
const pendingHexRef =
|
|
3523
|
-
const onChangeRef =
|
|
3524
|
-
|
|
3713
|
+
const pendingHexRef = useRef6(hexValue);
|
|
3714
|
+
const onChangeRef = useRef6(onChange);
|
|
3715
|
+
useEffect7(() => {
|
|
3525
3716
|
onChangeRef.current = onChange;
|
|
3526
3717
|
}, [onChange]);
|
|
3527
|
-
|
|
3718
|
+
useEffect7(() => {
|
|
3528
3719
|
if (open) pendingHexRef.current = hexValue;
|
|
3529
3720
|
}, [open, hexValue]);
|
|
3530
3721
|
const handleHexChange = useCallback2((hex) => {
|
|
@@ -3539,8 +3730,8 @@ function HslColorInput({ value, onChange, className, inputClassName, disabled })
|
|
|
3539
3730
|
}
|
|
3540
3731
|
setOpen(newOpen);
|
|
3541
3732
|
}, [open, hexValue]);
|
|
3542
|
-
return /* @__PURE__ */
|
|
3543
|
-
/* @__PURE__ */
|
|
3733
|
+
return /* @__PURE__ */ jsxs37(Popover2.Root, { open, onOpenChange: disabled ? void 0 : handleOpenChange, children: [
|
|
3734
|
+
/* @__PURE__ */ jsx54(Popover2.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs37(
|
|
3544
3735
|
"button",
|
|
3545
3736
|
{
|
|
3546
3737
|
type: "button",
|
|
@@ -3555,18 +3746,18 @@ function HslColorInput({ value, onChange, className, inputClassName, disabled })
|
|
|
3555
3746
|
),
|
|
3556
3747
|
"aria-label": "Pick color",
|
|
3557
3748
|
children: [
|
|
3558
|
-
/* @__PURE__ */
|
|
3749
|
+
/* @__PURE__ */ jsx54(
|
|
3559
3750
|
"span",
|
|
3560
3751
|
{
|
|
3561
3752
|
className: "w-4 h-4 rounded-full border border-white/20 shrink-0 inline-block",
|
|
3562
3753
|
style: { background: cssColor }
|
|
3563
3754
|
}
|
|
3564
3755
|
),
|
|
3565
|
-
/* @__PURE__ */
|
|
3756
|
+
/* @__PURE__ */ jsx54("span", { children: hexValue.toUpperCase() })
|
|
3566
3757
|
]
|
|
3567
3758
|
}
|
|
3568
3759
|
) }),
|
|
3569
|
-
/* @__PURE__ */
|
|
3760
|
+
/* @__PURE__ */ jsx54(Popover2.Portal, { children: /* @__PURE__ */ jsx54(
|
|
3570
3761
|
Popover2.Content,
|
|
3571
3762
|
{
|
|
3572
3763
|
sideOffset: 6,
|
|
@@ -3577,19 +3768,19 @@ function HslColorInput({ value, onChange, className, inputClassName, disabled })
|
|
|
3577
3768
|
"focus:outline-none"
|
|
3578
3769
|
),
|
|
3579
3770
|
onInteractOutside: () => handleOpenChange(false),
|
|
3580
|
-
children: open && /* @__PURE__ */
|
|
3581
|
-
/* @__PURE__ */
|
|
3582
|
-
/* @__PURE__ */
|
|
3583
|
-
/* @__PURE__ */
|
|
3584
|
-
/* @__PURE__ */
|
|
3585
|
-
/* @__PURE__ */
|
|
3586
|
-
/* @__PURE__ */
|
|
3587
|
-
/* @__PURE__ */
|
|
3771
|
+
children: open && /* @__PURE__ */ jsxs37(ColorPicker, { defaultValue: hexValue, className: "gap-2.5", children: [
|
|
3772
|
+
/* @__PURE__ */ jsx54(ColorReader, { onHexChange: handleHexChange }),
|
|
3773
|
+
/* @__PURE__ */ jsx54(ColorPickerSelection, { className: "h-32 w-full rounded-lg" }),
|
|
3774
|
+
/* @__PURE__ */ jsxs37("div", { className: "flex items-center gap-3", children: [
|
|
3775
|
+
/* @__PURE__ */ jsx54(ColorPickerEyeDropper, {}),
|
|
3776
|
+
/* @__PURE__ */ jsxs37("div", { className: "flex flex-col gap-1.5 flex-1", children: [
|
|
3777
|
+
/* @__PURE__ */ jsx54(ColorPickerHue, {}),
|
|
3778
|
+
/* @__PURE__ */ jsx54(ColorPickerAlpha, {})
|
|
3588
3779
|
] })
|
|
3589
3780
|
] }),
|
|
3590
|
-
/* @__PURE__ */
|
|
3591
|
-
/* @__PURE__ */
|
|
3592
|
-
/* @__PURE__ */
|
|
3781
|
+
/* @__PURE__ */ jsxs37("div", { className: "flex items-center gap-1.5 min-w-0", children: [
|
|
3782
|
+
/* @__PURE__ */ jsx54(ColorPickerOutput, {}),
|
|
3783
|
+
/* @__PURE__ */ jsx54(ColorPickerFormat, { className: "min-w-0" })
|
|
3593
3784
|
] })
|
|
3594
3785
|
] }, hexValue)
|
|
3595
3786
|
}
|
|
@@ -3598,9 +3789,9 @@ function HslColorInput({ value, onChange, className, inputClassName, disabled })
|
|
|
3598
3789
|
}
|
|
3599
3790
|
|
|
3600
3791
|
// src/hooks/index.ts
|
|
3601
|
-
import { useState as
|
|
3792
|
+
import { useState as useState12 } from "react";
|
|
3602
3793
|
function useDisclosure(initial = false) {
|
|
3603
|
-
const [isOpen, setIsOpen] =
|
|
3794
|
+
const [isOpen, setIsOpen] = useState12(initial);
|
|
3604
3795
|
return {
|
|
3605
3796
|
isOpen,
|
|
3606
3797
|
open: () => setIsOpen(true),
|
|
@@ -3610,15 +3801,15 @@ function useDisclosure(initial = false) {
|
|
|
3610
3801
|
};
|
|
3611
3802
|
}
|
|
3612
3803
|
function usePagination(total, pageSize = 20) {
|
|
3613
|
-
const [page, setPage] =
|
|
3804
|
+
const [page, setPage] = useState12(1);
|
|
3614
3805
|
const totalPages = Math.ceil(total / pageSize);
|
|
3615
3806
|
return { page, setPage, pageSize, total, totalPages };
|
|
3616
3807
|
}
|
|
3617
3808
|
|
|
3618
3809
|
// src/components/auth/AuthShell.tsx
|
|
3619
|
-
import { jsx as
|
|
3810
|
+
import { jsx as jsx55, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
3620
3811
|
function AuthShell({ children, pattern = "dots", maxWidth = "520px" }) {
|
|
3621
|
-
return /* @__PURE__ */
|
|
3812
|
+
return /* @__PURE__ */ jsxs38(
|
|
3622
3813
|
"div",
|
|
3623
3814
|
{
|
|
3624
3815
|
style: {
|
|
@@ -3633,7 +3824,7 @@ function AuthShell({ children, pattern = "dots", maxWidth = "520px" }) {
|
|
|
3633
3824
|
overflow: "hidden"
|
|
3634
3825
|
},
|
|
3635
3826
|
children: [
|
|
3636
|
-
pattern === "dots" && /* @__PURE__ */
|
|
3827
|
+
pattern === "dots" && /* @__PURE__ */ jsx55(
|
|
3637
3828
|
"div",
|
|
3638
3829
|
{
|
|
3639
3830
|
"aria-hidden": true,
|
|
@@ -3647,7 +3838,7 @@ function AuthShell({ children, pattern = "dots", maxWidth = "520px" }) {
|
|
|
3647
3838
|
}
|
|
3648
3839
|
}
|
|
3649
3840
|
),
|
|
3650
|
-
pattern === "grid" && /* @__PURE__ */
|
|
3841
|
+
pattern === "grid" && /* @__PURE__ */ jsx55(
|
|
3651
3842
|
"div",
|
|
3652
3843
|
{
|
|
3653
3844
|
"aria-hidden": true,
|
|
@@ -3661,16 +3852,16 @@ function AuthShell({ children, pattern = "dots", maxWidth = "520px" }) {
|
|
|
3661
3852
|
}
|
|
3662
3853
|
}
|
|
3663
3854
|
),
|
|
3664
|
-
/* @__PURE__ */
|
|
3855
|
+
/* @__PURE__ */ jsx55("div", { style: { position: "relative", zIndex: 1, width: "100%", maxWidth }, children })
|
|
3665
3856
|
]
|
|
3666
3857
|
}
|
|
3667
3858
|
);
|
|
3668
3859
|
}
|
|
3669
3860
|
|
|
3670
3861
|
// src/components/auth/AuthCard.tsx
|
|
3671
|
-
import { jsx as
|
|
3862
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
3672
3863
|
function AuthCard({ children, padding = "24px 28px" }) {
|
|
3673
|
-
return /* @__PURE__ */
|
|
3864
|
+
return /* @__PURE__ */ jsx56(
|
|
3674
3865
|
"div",
|
|
3675
3866
|
{
|
|
3676
3867
|
style: {
|
|
@@ -3687,10 +3878,10 @@ function AuthCard({ children, padding = "24px 28px" }) {
|
|
|
3687
3878
|
}
|
|
3688
3879
|
|
|
3689
3880
|
// src/components/auth/AuthLogo.tsx
|
|
3690
|
-
import { jsx as
|
|
3881
|
+
import { jsx as jsx57, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
3691
3882
|
function AuthLogo({ appName = "Builify CMS", letter = "B", imageUrl, size = 36 }) {
|
|
3692
|
-
return /* @__PURE__ */
|
|
3693
|
-
imageUrl ? /* @__PURE__ */
|
|
3883
|
+
return /* @__PURE__ */ jsxs39("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: "10px", marginBottom: "28px" }, children: [
|
|
3884
|
+
imageUrl ? /* @__PURE__ */ jsx57(
|
|
3694
3885
|
"img",
|
|
3695
3886
|
{
|
|
3696
3887
|
src: imageUrl,
|
|
@@ -3699,7 +3890,7 @@ function AuthLogo({ appName = "Builify CMS", letter = "B", imageUrl, size = 36 }
|
|
|
3699
3890
|
height: size,
|
|
3700
3891
|
style: { borderRadius: "calc(var(--radius, 0.5rem) * 1.2)", flexShrink: 0, display: "block" }
|
|
3701
3892
|
}
|
|
3702
|
-
) : /* @__PURE__ */
|
|
3893
|
+
) : /* @__PURE__ */ jsx57(
|
|
3703
3894
|
"div",
|
|
3704
3895
|
{
|
|
3705
3896
|
style: {
|
|
@@ -3718,7 +3909,7 @@ function AuthLogo({ appName = "Builify CMS", letter = "B", imageUrl, size = 36 }
|
|
|
3718
3909
|
children: letter
|
|
3719
3910
|
}
|
|
3720
3911
|
),
|
|
3721
|
-
/* @__PURE__ */
|
|
3912
|
+
/* @__PURE__ */ jsx57(
|
|
3722
3913
|
"span",
|
|
3723
3914
|
{
|
|
3724
3915
|
style: {
|
|
@@ -3734,10 +3925,10 @@ function AuthLogo({ appName = "Builify CMS", letter = "B", imageUrl, size = 36 }
|
|
|
3734
3925
|
}
|
|
3735
3926
|
|
|
3736
3927
|
// src/components/auth/AuthHeader.tsx
|
|
3737
|
-
import { jsx as
|
|
3928
|
+
import { jsx as jsx58, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
3738
3929
|
function AuthHeader({ title, description }) {
|
|
3739
|
-
return /* @__PURE__ */
|
|
3740
|
-
/* @__PURE__ */
|
|
3930
|
+
return /* @__PURE__ */ jsxs40("div", { style: { marginBottom: "24px", textAlign: "center" }, children: [
|
|
3931
|
+
/* @__PURE__ */ jsx58(
|
|
3741
3932
|
"h1",
|
|
3742
3933
|
{
|
|
3743
3934
|
style: {
|
|
@@ -3750,7 +3941,7 @@ function AuthHeader({ title, description }) {
|
|
|
3750
3941
|
children: title
|
|
3751
3942
|
}
|
|
3752
3943
|
),
|
|
3753
|
-
description && /* @__PURE__ */
|
|
3944
|
+
description && /* @__PURE__ */ jsx58(
|
|
3754
3945
|
"p",
|
|
3755
3946
|
{
|
|
3756
3947
|
style: {
|
|
@@ -3766,12 +3957,12 @@ function AuthHeader({ title, description }) {
|
|
|
3766
3957
|
}
|
|
3767
3958
|
|
|
3768
3959
|
// src/components/auth/AuthField.tsx
|
|
3769
|
-
import { jsx as
|
|
3960
|
+
import { jsx as jsx59, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
3770
3961
|
function AuthField({ label, error, hint, rightLabel, id, ...props }) {
|
|
3771
3962
|
const fieldId = id ?? label.toLowerCase().replace(/\s+/g, "-");
|
|
3772
|
-
return /* @__PURE__ */
|
|
3773
|
-
/* @__PURE__ */
|
|
3774
|
-
/* @__PURE__ */
|
|
3963
|
+
return /* @__PURE__ */ jsxs41("div", { style: { display: "flex", flexDirection: "column", gap: "6px" }, children: [
|
|
3964
|
+
/* @__PURE__ */ jsxs41("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
|
|
3965
|
+
/* @__PURE__ */ jsx59(
|
|
3775
3966
|
"label",
|
|
3776
3967
|
{
|
|
3777
3968
|
htmlFor: fieldId,
|
|
@@ -3783,9 +3974,9 @@ function AuthField({ label, error, hint, rightLabel, id, ...props }) {
|
|
|
3783
3974
|
children: label
|
|
3784
3975
|
}
|
|
3785
3976
|
),
|
|
3786
|
-
rightLabel && /* @__PURE__ */
|
|
3977
|
+
rightLabel && /* @__PURE__ */ jsx59("span", { style: { fontSize: "0.8125rem" }, children: rightLabel })
|
|
3787
3978
|
] }),
|
|
3788
|
-
/* @__PURE__ */
|
|
3979
|
+
/* @__PURE__ */ jsx59(
|
|
3789
3980
|
"input",
|
|
3790
3981
|
{
|
|
3791
3982
|
id: fieldId,
|
|
@@ -3815,13 +4006,13 @@ function AuthField({ label, error, hint, rightLabel, id, ...props }) {
|
|
|
3815
4006
|
...props
|
|
3816
4007
|
}
|
|
3817
4008
|
),
|
|
3818
|
-
error && /* @__PURE__ */
|
|
3819
|
-
hint && !error && /* @__PURE__ */
|
|
4009
|
+
error && /* @__PURE__ */ jsx59("p", { style: { fontSize: "0.8rem", color: "var(--destructive)", margin: 0 }, children: error }),
|
|
4010
|
+
hint && !error && /* @__PURE__ */ jsx59("p", { style: { fontSize: "0.8rem", color: "var(--muted-foreground)", margin: 0 }, children: hint })
|
|
3820
4011
|
] });
|
|
3821
4012
|
}
|
|
3822
4013
|
|
|
3823
4014
|
// src/components/auth/AuthButton.tsx
|
|
3824
|
-
import { Fragment as Fragment5, jsx as
|
|
4015
|
+
import { Fragment as Fragment5, jsx as jsx60, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
3825
4016
|
function AuthButton({
|
|
3826
4017
|
loading,
|
|
3827
4018
|
variant = "primary",
|
|
@@ -3864,7 +4055,7 @@ function AuthButton({
|
|
|
3864
4055
|
color: "var(--foreground)"
|
|
3865
4056
|
}
|
|
3866
4057
|
};
|
|
3867
|
-
return /* @__PURE__ */
|
|
4058
|
+
return /* @__PURE__ */ jsx60(
|
|
3868
4059
|
"button",
|
|
3869
4060
|
{
|
|
3870
4061
|
disabled: loading || disabled,
|
|
@@ -3876,8 +4067,8 @@ function AuthButton({
|
|
|
3876
4067
|
e.currentTarget.style.filter = "none";
|
|
3877
4068
|
},
|
|
3878
4069
|
...props,
|
|
3879
|
-
children: loading ? /* @__PURE__ */
|
|
3880
|
-
/* @__PURE__ */
|
|
4070
|
+
children: loading ? /* @__PURE__ */ jsxs42(Fragment5, { children: [
|
|
4071
|
+
/* @__PURE__ */ jsx60(
|
|
3881
4072
|
"span",
|
|
3882
4073
|
{
|
|
3883
4074
|
style: {
|
|
@@ -3898,19 +4089,19 @@ function AuthButton({
|
|
|
3898
4089
|
}
|
|
3899
4090
|
|
|
3900
4091
|
// src/components/auth/AuthDivider.tsx
|
|
3901
|
-
import { jsx as
|
|
4092
|
+
import { jsx as jsx61, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
3902
4093
|
function AuthDivider({ label = "or" }) {
|
|
3903
|
-
return /* @__PURE__ */
|
|
3904
|
-
/* @__PURE__ */
|
|
3905
|
-
/* @__PURE__ */
|
|
3906
|
-
/* @__PURE__ */
|
|
4094
|
+
return /* @__PURE__ */ jsxs43("div", { style: { display: "flex", alignItems: "center", gap: "12px", margin: "20px 0" }, children: [
|
|
4095
|
+
/* @__PURE__ */ jsx61("div", { style: { flex: 1, height: 1, background: "var(--border)" } }),
|
|
4096
|
+
/* @__PURE__ */ jsx61("span", { style: { fontSize: "0.75rem", color: "var(--muted-foreground)", userSelect: "none" }, children: label }),
|
|
4097
|
+
/* @__PURE__ */ jsx61("div", { style: { flex: 1, height: 1, background: "var(--border)" } })
|
|
3907
4098
|
] });
|
|
3908
4099
|
}
|
|
3909
4100
|
|
|
3910
4101
|
// src/components/auth/AuthFootnote.tsx
|
|
3911
|
-
import { jsx as
|
|
4102
|
+
import { jsx as jsx62, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
3912
4103
|
function AuthFootnote({ text, linkText, linkHref }) {
|
|
3913
|
-
return /* @__PURE__ */
|
|
4104
|
+
return /* @__PURE__ */ jsxs44("p", { style: {
|
|
3914
4105
|
textAlign: "center",
|
|
3915
4106
|
marginTop: "20px",
|
|
3916
4107
|
fontSize: "0.8125rem",
|
|
@@ -3918,7 +4109,7 @@ function AuthFootnote({ text, linkText, linkHref }) {
|
|
|
3918
4109
|
}, children: [
|
|
3919
4110
|
text,
|
|
3920
4111
|
" ",
|
|
3921
|
-
/* @__PURE__ */
|
|
4112
|
+
/* @__PURE__ */ jsx62(
|
|
3922
4113
|
"a",
|
|
3923
4114
|
{
|
|
3924
4115
|
href: linkHref,
|
|
@@ -3966,6 +4157,8 @@ export {
|
|
|
3966
4157
|
ColorPickerOutput,
|
|
3967
4158
|
ColorPickerSelection,
|
|
3968
4159
|
ConfirmDialog,
|
|
4160
|
+
DEVICES,
|
|
4161
|
+
DEVICE_ICONS,
|
|
3969
4162
|
DashboardLayout,
|
|
3970
4163
|
DataTable,
|
|
3971
4164
|
Dialog,
|
|
@@ -4002,6 +4195,7 @@ export {
|
|
|
4002
4195
|
Input,
|
|
4003
4196
|
Label2 as Label,
|
|
4004
4197
|
LoadingSpinner,
|
|
4198
|
+
LocalInput,
|
|
4005
4199
|
MediaCard,
|
|
4006
4200
|
MediaGrid,
|
|
4007
4201
|
MediaPickerDialog,
|
|
@@ -4018,6 +4212,8 @@ export {
|
|
|
4018
4212
|
PostListTable,
|
|
4019
4213
|
PostSidebarSection,
|
|
4020
4214
|
PostStatusBadge,
|
|
4215
|
+
ResponsiveSizeDeviceIcon,
|
|
4216
|
+
ResponsiveSizeField,
|
|
4021
4217
|
SearchBar,
|
|
4022
4218
|
Select,
|
|
4023
4219
|
SelectContent,
|