@yomologic/react-ui 0.5.4 → 0.5.6
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 +54 -2
- package/dist/index.d.ts +54 -2
- package/dist/index.js +390 -200
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +389 -200
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +20 -0
- package/dist/styles.css.map +1 -1
- package/package.json +5 -2
package/dist/index.js
CHANGED
|
@@ -61,6 +61,7 @@ __export(index_exports, {
|
|
|
61
61
|
FormControlLabel: () => FormControlLabel,
|
|
62
62
|
FormHelperText: () => FormHelperText,
|
|
63
63
|
Input: () => Input,
|
|
64
|
+
NativeSelect: () => NativeSelect,
|
|
64
65
|
Nav: () => Nav,
|
|
65
66
|
RadioGroup: () => RadioGroup,
|
|
66
67
|
Rating: () => Rating,
|
|
@@ -2152,6 +2153,9 @@ function Select({
|
|
|
2152
2153
|
const [isOpen, setIsOpen] = (0, import_react11.useState)(false);
|
|
2153
2154
|
const dropdownRef = (0, import_react11.useRef)(null);
|
|
2154
2155
|
const [validationError, _setValidationError] = (0, import_react11.useState)();
|
|
2156
|
+
const [focusedIndex, setFocusedIndex] = (0, import_react11.useState)(-1);
|
|
2157
|
+
const [searchString, setSearchString] = (0, import_react11.useState)("");
|
|
2158
|
+
const searchTimeoutRef = (0, import_react11.useRef)();
|
|
2155
2159
|
let value;
|
|
2156
2160
|
let displayError;
|
|
2157
2161
|
if (form && name) {
|
|
@@ -2236,9 +2240,68 @@ function Select({
|
|
|
2236
2240
|
if (disabled) return;
|
|
2237
2241
|
if (e.key === "Enter" || e.key === " ") {
|
|
2238
2242
|
e.preventDefault();
|
|
2239
|
-
|
|
2243
|
+
if (!isOpen) {
|
|
2244
|
+
setIsOpen(true);
|
|
2245
|
+
const currentIndex = options.findIndex(
|
|
2246
|
+
(opt) => opt.value === value
|
|
2247
|
+
);
|
|
2248
|
+
setFocusedIndex(currentIndex);
|
|
2249
|
+
} else if (focusedIndex >= 0 && focusedIndex < options.length) {
|
|
2250
|
+
handleSelect(options[focusedIndex].value);
|
|
2251
|
+
}
|
|
2240
2252
|
} else if (e.key === "Escape") {
|
|
2241
2253
|
setIsOpen(false);
|
|
2254
|
+
setFocusedIndex(-1);
|
|
2255
|
+
} else if (e.key === "ArrowDown") {
|
|
2256
|
+
e.preventDefault();
|
|
2257
|
+
if (!isOpen) {
|
|
2258
|
+
const currentIndex = options.findIndex(
|
|
2259
|
+
(opt) => opt.value === value
|
|
2260
|
+
);
|
|
2261
|
+
const nextIndex = currentIndex < options.length - 1 ? currentIndex + 1 : currentIndex;
|
|
2262
|
+
if (nextIndex !== currentIndex && options[nextIndex]) {
|
|
2263
|
+
handleSelect(options[nextIndex].value);
|
|
2264
|
+
} else if (currentIndex === -1 && options.length > 0) {
|
|
2265
|
+
handleSelect(options[0].value);
|
|
2266
|
+
}
|
|
2267
|
+
} else {
|
|
2268
|
+
setFocusedIndex(
|
|
2269
|
+
(prev) => prev < options.length - 1 ? prev + 1 : prev
|
|
2270
|
+
);
|
|
2271
|
+
}
|
|
2272
|
+
} else if (e.key === "ArrowUp") {
|
|
2273
|
+
e.preventDefault();
|
|
2274
|
+
if (!isOpen) {
|
|
2275
|
+
const currentIndex = options.findIndex(
|
|
2276
|
+
(opt) => opt.value === value
|
|
2277
|
+
);
|
|
2278
|
+
const prevIndex = currentIndex > 0 ? currentIndex - 1 : currentIndex;
|
|
2279
|
+
if (prevIndex !== currentIndex && options[prevIndex]) {
|
|
2280
|
+
handleSelect(options[prevIndex].value);
|
|
2281
|
+
}
|
|
2282
|
+
} else {
|
|
2283
|
+
setFocusedIndex((prev) => prev > 0 ? prev - 1 : 0);
|
|
2284
|
+
}
|
|
2285
|
+
} else if (e.key.length === 1 && /[a-z0-9]/i.test(e.key)) {
|
|
2286
|
+
e.preventDefault();
|
|
2287
|
+
if (searchTimeoutRef.current) {
|
|
2288
|
+
clearTimeout(searchTimeoutRef.current);
|
|
2289
|
+
}
|
|
2290
|
+
const newSearchString = searchString + e.key.toLowerCase();
|
|
2291
|
+
setSearchString(newSearchString);
|
|
2292
|
+
const matchIndex = options.findIndex(
|
|
2293
|
+
(opt) => opt.label.toLowerCase().startsWith(newSearchString)
|
|
2294
|
+
);
|
|
2295
|
+
if (matchIndex >= 0) {
|
|
2296
|
+
if (!isOpen) {
|
|
2297
|
+
handleSelect(options[matchIndex].value);
|
|
2298
|
+
} else {
|
|
2299
|
+
setFocusedIndex(matchIndex);
|
|
2300
|
+
}
|
|
2301
|
+
}
|
|
2302
|
+
searchTimeoutRef.current = setTimeout(() => {
|
|
2303
|
+
setSearchString("");
|
|
2304
|
+
}, 1e3);
|
|
2242
2305
|
}
|
|
2243
2306
|
};
|
|
2244
2307
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
@@ -2258,6 +2321,15 @@ function Select({
|
|
|
2258
2321
|
]
|
|
2259
2322
|
}
|
|
2260
2323
|
),
|
|
2324
|
+
name && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2325
|
+
"input",
|
|
2326
|
+
{
|
|
2327
|
+
type: "hidden",
|
|
2328
|
+
name,
|
|
2329
|
+
value: value ?? "",
|
|
2330
|
+
required
|
|
2331
|
+
}
|
|
2332
|
+
),
|
|
2261
2333
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { ref: dropdownRef, className: "relative", children: [
|
|
2262
2334
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2263
2335
|
"button",
|
|
@@ -2329,16 +2401,17 @@ function Select({
|
|
|
2329
2401
|
children: placeholder
|
|
2330
2402
|
}
|
|
2331
2403
|
) }, "__placeholder__"),
|
|
2332
|
-
options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2404
|
+
options.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2333
2405
|
"button",
|
|
2334
2406
|
{
|
|
2335
2407
|
type: "button",
|
|
2336
2408
|
onClick: () => !option.disabled && handleSelect(option.value),
|
|
2337
2409
|
disabled: option.disabled,
|
|
2410
|
+
onMouseEnter: () => setFocusedIndex(index),
|
|
2338
2411
|
className: `
|
|
2339
2412
|
w-full ${optionSizeStyles[size]} text-left
|
|
2340
2413
|
transition-colors duration-150
|
|
2341
|
-
${option.value === value ? "bg-[color-mix(in_srgb,var(--color-primary)_10%,transparent)] text-(--color-primary) font-medium" : "text-(--color-foreground) hover:bg-(--color-muted)"}
|
|
2414
|
+
${option.value === value ? "bg-[color-mix(in_srgb,var(--color-primary)_10%,transparent)] text-(--color-primary) font-medium" : index === focusedIndex ? "bg-(--color-muted) text-(--color-foreground)" : "text-(--color-foreground) hover:bg-(--color-muted)"}
|
|
2342
2415
|
${option.disabled ? "opacity-50 cursor-not-allowed" : ""}
|
|
2343
2416
|
`,
|
|
2344
2417
|
role: "option",
|
|
@@ -2363,9 +2436,123 @@ function Select({
|
|
|
2363
2436
|
);
|
|
2364
2437
|
}
|
|
2365
2438
|
|
|
2439
|
+
// src/ui/native-select.tsx
|
|
2440
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
2441
|
+
function NativeSelect({
|
|
2442
|
+
name,
|
|
2443
|
+
label,
|
|
2444
|
+
value: externalValue,
|
|
2445
|
+
onChange,
|
|
2446
|
+
children,
|
|
2447
|
+
error,
|
|
2448
|
+
helperText,
|
|
2449
|
+
required = false,
|
|
2450
|
+
size = "md",
|
|
2451
|
+
className = "",
|
|
2452
|
+
validate,
|
|
2453
|
+
errorMessage,
|
|
2454
|
+
disabled = false,
|
|
2455
|
+
...htmlProps
|
|
2456
|
+
}) {
|
|
2457
|
+
const form = useForm();
|
|
2458
|
+
let value;
|
|
2459
|
+
let displayError;
|
|
2460
|
+
if (form && name) {
|
|
2461
|
+
value = form.values[name] ?? externalValue;
|
|
2462
|
+
displayError = form.shouldShowError(name) ? form.getFieldError(name) : void 0;
|
|
2463
|
+
} else {
|
|
2464
|
+
value = externalValue;
|
|
2465
|
+
displayError = error;
|
|
2466
|
+
}
|
|
2467
|
+
if (form && name) {
|
|
2468
|
+
const validator = async (val) => {
|
|
2469
|
+
if (required && (val === void 0 || val === null || val === "")) {
|
|
2470
|
+
return errorMessage || "Please select an option";
|
|
2471
|
+
}
|
|
2472
|
+
if (validate) {
|
|
2473
|
+
return await validate(val);
|
|
2474
|
+
}
|
|
2475
|
+
return void 0;
|
|
2476
|
+
};
|
|
2477
|
+
form.registerField(name, validator);
|
|
2478
|
+
}
|
|
2479
|
+
const handleChange = (e) => {
|
|
2480
|
+
const newValue = e.target.value;
|
|
2481
|
+
if (form && name) {
|
|
2482
|
+
form.setFieldValue(name, newValue);
|
|
2483
|
+
form.setFieldTouched(name, true);
|
|
2484
|
+
form.validateField(name, newValue);
|
|
2485
|
+
} else {
|
|
2486
|
+
onChange?.(newValue);
|
|
2487
|
+
}
|
|
2488
|
+
};
|
|
2489
|
+
const sizeStyles = {
|
|
2490
|
+
xs: "px-2 py-1.5 text-xs",
|
|
2491
|
+
sm: "px-2.5 py-2 text-sm",
|
|
2492
|
+
md: "px-3 py-2.5 text-base",
|
|
2493
|
+
lg: "px-4 py-3 text-lg",
|
|
2494
|
+
xl: "px-5 py-3.5 text-xl"
|
|
2495
|
+
};
|
|
2496
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
2497
|
+
"div",
|
|
2498
|
+
{
|
|
2499
|
+
className: `w-full ${className}`,
|
|
2500
|
+
style: { marginBottom: "var(--form-control-spacing)" },
|
|
2501
|
+
children: [
|
|
2502
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
2503
|
+
"label",
|
|
2504
|
+
{
|
|
2505
|
+
className: "block text-small font-semibold mb-1",
|
|
2506
|
+
style: { color: "var(--color-muted-foreground)" },
|
|
2507
|
+
children: [
|
|
2508
|
+
label,
|
|
2509
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "ml-1 text-error", children: "*" })
|
|
2510
|
+
]
|
|
2511
|
+
}
|
|
2512
|
+
),
|
|
2513
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2514
|
+
"select",
|
|
2515
|
+
{
|
|
2516
|
+
name,
|
|
2517
|
+
value: value ?? "",
|
|
2518
|
+
onChange: handleChange,
|
|
2519
|
+
disabled,
|
|
2520
|
+
required,
|
|
2521
|
+
className: `
|
|
2522
|
+
w-full ${sizeStyles[size]}
|
|
2523
|
+
bg-(--color-background)
|
|
2524
|
+
border rounded-(--dropdown-radius)
|
|
2525
|
+
transition-all duration-200
|
|
2526
|
+
appearance-none
|
|
2527
|
+
cursor-pointer
|
|
2528
|
+
${displayError ? "border-error focus:ring-2 focus:ring-error focus:border-error" : "border-(--color-border) focus:ring-2 focus:ring-[color-mix(in_srgb,var(--color-primary)_30%,transparent)] focus:border-(--color-primary)"}
|
|
2529
|
+
${disabled ? "bg-(--color-muted) cursor-not-allowed opacity-60" : "hover:border-(--color-primary)"}
|
|
2530
|
+
${!value ? "text-(--color-placeholder)" : "text-(--color-foreground)"}
|
|
2531
|
+
pr-10
|
|
2532
|
+
bg-[url('data:image/svg+xml;charset=UTF-8,%3csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3c%2fpolyline%3E%3c%2fsvg%3E')]
|
|
2533
|
+
bg-[length:1.25rem_1.25rem]
|
|
2534
|
+
bg-[position:right_0.5rem_center]
|
|
2535
|
+
bg-no-repeat
|
|
2536
|
+
`,
|
|
2537
|
+
...htmlProps,
|
|
2538
|
+
children
|
|
2539
|
+
}
|
|
2540
|
+
),
|
|
2541
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "h-5 mt-1.5", children: (helperText || displayError) && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2542
|
+
"p",
|
|
2543
|
+
{
|
|
2544
|
+
className: `text-small ${displayError ? "text-error" : "text-(--color-muted-foreground)"}`,
|
|
2545
|
+
children: displayError || helperText
|
|
2546
|
+
}
|
|
2547
|
+
) })
|
|
2548
|
+
]
|
|
2549
|
+
}
|
|
2550
|
+
);
|
|
2551
|
+
}
|
|
2552
|
+
|
|
2366
2553
|
// src/ui/spinner.tsx
|
|
2367
2554
|
var import_react12 = __toESM(require("react"));
|
|
2368
|
-
var
|
|
2555
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
2369
2556
|
var Spinner = import_react12.default.forwardRef(
|
|
2370
2557
|
({ className, size = "md", color = "primary", label, ...props }, ref) => {
|
|
2371
2558
|
const sizes = {
|
|
@@ -2379,7 +2566,7 @@ var Spinner = import_react12.default.forwardRef(
|
|
|
2379
2566
|
secondary: "text-(--color-muted-foreground)",
|
|
2380
2567
|
white: "text-white"
|
|
2381
2568
|
};
|
|
2382
|
-
return /* @__PURE__ */ (0,
|
|
2569
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2383
2570
|
"div",
|
|
2384
2571
|
{
|
|
2385
2572
|
ref,
|
|
@@ -2389,7 +2576,7 @@ var Spinner = import_react12.default.forwardRef(
|
|
|
2389
2576
|
),
|
|
2390
2577
|
...props,
|
|
2391
2578
|
children: [
|
|
2392
|
-
/* @__PURE__ */ (0,
|
|
2579
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2393
2580
|
"svg",
|
|
2394
2581
|
{
|
|
2395
2582
|
className: cn("animate-spin", sizes[size], colors[color]),
|
|
@@ -2397,7 +2584,7 @@ var Spinner = import_react12.default.forwardRef(
|
|
|
2397
2584
|
fill: "none",
|
|
2398
2585
|
viewBox: "0 0 24 24",
|
|
2399
2586
|
children: [
|
|
2400
|
-
/* @__PURE__ */ (0,
|
|
2587
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2401
2588
|
"circle",
|
|
2402
2589
|
{
|
|
2403
2590
|
className: "opacity-25",
|
|
@@ -2408,7 +2595,7 @@ var Spinner = import_react12.default.forwardRef(
|
|
|
2408
2595
|
strokeWidth: "4"
|
|
2409
2596
|
}
|
|
2410
2597
|
),
|
|
2411
|
-
/* @__PURE__ */ (0,
|
|
2598
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2412
2599
|
"path",
|
|
2413
2600
|
{
|
|
2414
2601
|
className: "opacity-75",
|
|
@@ -2419,7 +2606,7 @@ var Spinner = import_react12.default.forwardRef(
|
|
|
2419
2606
|
]
|
|
2420
2607
|
}
|
|
2421
2608
|
),
|
|
2422
|
-
label && /* @__PURE__ */ (0,
|
|
2609
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-small text-(--color-muted-foreground)", children: label })
|
|
2423
2610
|
]
|
|
2424
2611
|
}
|
|
2425
2612
|
);
|
|
@@ -2430,7 +2617,7 @@ Spinner.displayName = "Spinner";
|
|
|
2430
2617
|
// src/ui/code-snippet.tsx
|
|
2431
2618
|
var import_prism_react_renderer = require("prism-react-renderer");
|
|
2432
2619
|
var import_react13 = require("react");
|
|
2433
|
-
var
|
|
2620
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
2434
2621
|
function CodeSnippet({
|
|
2435
2622
|
code,
|
|
2436
2623
|
language = "tsx",
|
|
@@ -2453,9 +2640,9 @@ function CodeSnippet({
|
|
|
2453
2640
|
console.error("Failed to copy:", err);
|
|
2454
2641
|
}
|
|
2455
2642
|
};
|
|
2456
|
-
return /* @__PURE__ */ (0,
|
|
2457
|
-
/* @__PURE__ */ (0,
|
|
2458
|
-
/* @__PURE__ */ (0,
|
|
2643
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "relative group w-full", children: [
|
|
2644
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "absolute right-3 top-3 [z-index:var(--z-index-code-button)]", children: [
|
|
2645
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2459
2646
|
"button",
|
|
2460
2647
|
{
|
|
2461
2648
|
onClick: handleCopy,
|
|
@@ -2465,14 +2652,14 @@ function CodeSnippet({
|
|
|
2465
2652
|
"aria-label": "Copy code",
|
|
2466
2653
|
children: copied ? (
|
|
2467
2654
|
// Check icon
|
|
2468
|
-
/* @__PURE__ */ (0,
|
|
2655
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2469
2656
|
"svg",
|
|
2470
2657
|
{
|
|
2471
2658
|
className: "w-4 h-4 text-green-400",
|
|
2472
2659
|
fill: "none",
|
|
2473
2660
|
stroke: "currentColor",
|
|
2474
2661
|
viewBox: "0 0 24 24",
|
|
2475
|
-
children: /* @__PURE__ */ (0,
|
|
2662
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2476
2663
|
"path",
|
|
2477
2664
|
{
|
|
2478
2665
|
strokeLinecap: "round",
|
|
@@ -2485,14 +2672,14 @@ function CodeSnippet({
|
|
|
2485
2672
|
)
|
|
2486
2673
|
) : (
|
|
2487
2674
|
// Copy icon
|
|
2488
|
-
/* @__PURE__ */ (0,
|
|
2675
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2489
2676
|
"svg",
|
|
2490
2677
|
{
|
|
2491
2678
|
className: "w-4 h-4",
|
|
2492
2679
|
fill: "none",
|
|
2493
2680
|
stroke: "currentColor",
|
|
2494
2681
|
viewBox: "0 0 24 24",
|
|
2495
|
-
children: /* @__PURE__ */ (0,
|
|
2682
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2496
2683
|
"path",
|
|
2497
2684
|
{
|
|
2498
2685
|
strokeLinecap: "round",
|
|
@@ -2506,26 +2693,26 @@ function CodeSnippet({
|
|
|
2506
2693
|
)
|
|
2507
2694
|
}
|
|
2508
2695
|
),
|
|
2509
|
-
showTooltip && !copied && /* @__PURE__ */ (0,
|
|
2696
|
+
showTooltip && !copied && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "absolute right-0 top-full mt-2 px-2 py-1 bg-[#1f2937] text-white text-caption rounded shadow-lg whitespace-nowrap border border-[#374151]", children: [
|
|
2510
2697
|
"Copy code",
|
|
2511
|
-
/* @__PURE__ */ (0,
|
|
2698
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "absolute -top-1 right-3 w-2 h-2 bg-[#1f2937] border-l border-t border-[#374151] transform rotate-45" })
|
|
2512
2699
|
] }),
|
|
2513
|
-
copied && /* @__PURE__ */ (0,
|
|
2700
|
+
copied && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "absolute right-0 top-full mt-2 px-2 py-1 bg-green-600 text-white text-caption rounded shadow-lg whitespace-nowrap", children: [
|
|
2514
2701
|
"Copied!",
|
|
2515
|
-
/* @__PURE__ */ (0,
|
|
2702
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "absolute -top-1 right-3 w-2 h-2 bg-green-600 transform rotate-45" })
|
|
2516
2703
|
] })
|
|
2517
2704
|
] }),
|
|
2518
|
-
/* @__PURE__ */ (0,
|
|
2705
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2519
2706
|
"div",
|
|
2520
2707
|
{
|
|
2521
2708
|
className: `rounded-lg overflow-x-auto border border-[#1f2937] ${fontSizeClassMap[fontSize]} code-snippet-${fontSize}`,
|
|
2522
|
-
children: /* @__PURE__ */ (0,
|
|
2709
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2523
2710
|
import_prism_react_renderer.Highlight,
|
|
2524
2711
|
{
|
|
2525
2712
|
theme: import_prism_react_renderer.themes.vsDark,
|
|
2526
2713
|
code,
|
|
2527
2714
|
language,
|
|
2528
|
-
children: ({ style, tokens, getLineProps, getTokenProps }) => /* @__PURE__ */ (0,
|
|
2715
|
+
children: ({ style, tokens, getLineProps, getTokenProps }) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2529
2716
|
"pre",
|
|
2530
2717
|
{
|
|
2531
2718
|
style: {
|
|
@@ -2537,7 +2724,7 @@ function CodeSnippet({
|
|
|
2537
2724
|
whiteSpace: wrap ? "pre-wrap" : "pre",
|
|
2538
2725
|
wordBreak: wrap ? "break-word" : "normal"
|
|
2539
2726
|
},
|
|
2540
|
-
children: tokens.map((line, i) => /* @__PURE__ */ (0,
|
|
2727
|
+
children: tokens.map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { ...getLineProps({ line }), children: line.map((token, key) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2541
2728
|
"span",
|
|
2542
2729
|
{
|
|
2543
2730
|
...getTokenProps({ token })
|
|
@@ -2556,7 +2743,7 @@ function CodeSnippet({
|
|
|
2556
2743
|
// src/ui/rating.tsx
|
|
2557
2744
|
var import_lucide_react2 = require("lucide-react");
|
|
2558
2745
|
var import_react14 = __toESM(require("react"));
|
|
2559
|
-
var
|
|
2746
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2560
2747
|
var Rating = ({
|
|
2561
2748
|
value,
|
|
2562
2749
|
max = 5,
|
|
@@ -2598,7 +2785,7 @@ var Rating = ({
|
|
|
2598
2785
|
const isHalf = displayValue >= i - 0.5 && displayValue < i;
|
|
2599
2786
|
const isEmpty = displayValue < i - 0.5;
|
|
2600
2787
|
stars.push(
|
|
2601
|
-
/* @__PURE__ */ (0,
|
|
2788
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2602
2789
|
"span",
|
|
2603
2790
|
{
|
|
2604
2791
|
onClick: () => handleStarClick(i),
|
|
@@ -2631,7 +2818,7 @@ var Rating = ({
|
|
|
2631
2818
|
},
|
|
2632
2819
|
className: responsive ? "sm:w-(--star-size) sm:h-(--star-size) w-(--star-mobile-size) h-(--star-mobile-size)" : "",
|
|
2633
2820
|
children: [
|
|
2634
|
-
/* @__PURE__ */ (0,
|
|
2821
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2635
2822
|
import_lucide_react2.Star,
|
|
2636
2823
|
{
|
|
2637
2824
|
size: displaySize,
|
|
@@ -2640,7 +2827,7 @@ var Rating = ({
|
|
|
2640
2827
|
style: { position: "absolute", left: 0, top: 0 }
|
|
2641
2828
|
}
|
|
2642
2829
|
),
|
|
2643
|
-
isFull && /* @__PURE__ */ (0,
|
|
2830
|
+
isFull && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2644
2831
|
import_lucide_react2.Star,
|
|
2645
2832
|
{
|
|
2646
2833
|
size: displaySize,
|
|
@@ -2649,7 +2836,7 @@ var Rating = ({
|
|
|
2649
2836
|
style: { position: "absolute", left: 0, top: 0 }
|
|
2650
2837
|
}
|
|
2651
2838
|
),
|
|
2652
|
-
isHalf && /* @__PURE__ */ (0,
|
|
2839
|
+
isHalf && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2653
2840
|
"svg",
|
|
2654
2841
|
{
|
|
2655
2842
|
width: displaySize,
|
|
@@ -2657,7 +2844,7 @@ var Rating = ({
|
|
|
2657
2844
|
viewBox: `0 0 ${displaySize} ${displaySize}`,
|
|
2658
2845
|
style: { position: "absolute", left: 0, top: 0 },
|
|
2659
2846
|
children: [
|
|
2660
|
-
/* @__PURE__ */ (0,
|
|
2847
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2661
2848
|
"linearGradient",
|
|
2662
2849
|
{
|
|
2663
2850
|
id: `half-${uniqueId}-${i}`,
|
|
@@ -2666,12 +2853,12 @@ var Rating = ({
|
|
|
2666
2853
|
y1: "0",
|
|
2667
2854
|
y2: "0",
|
|
2668
2855
|
children: [
|
|
2669
|
-
/* @__PURE__ */ (0,
|
|
2670
|
-
/* @__PURE__ */ (0,
|
|
2856
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("stop", { offset: "50%", stopColor: color }),
|
|
2857
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("stop", { offset: "50%", stopColor: "transparent" })
|
|
2671
2858
|
]
|
|
2672
2859
|
}
|
|
2673
2860
|
) }),
|
|
2674
|
-
/* @__PURE__ */ (0,
|
|
2861
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2675
2862
|
import_lucide_react2.Star,
|
|
2676
2863
|
{
|
|
2677
2864
|
size: displaySize,
|
|
@@ -2690,7 +2877,7 @@ var Rating = ({
|
|
|
2690
2877
|
}
|
|
2691
2878
|
const valueText = valueFormat === "fraction" ? `${value.toFixed(1)}/${max}` : value.toFixed(1);
|
|
2692
2879
|
if (showValue && valuePosition === "bottom") {
|
|
2693
|
-
return /* @__PURE__ */ (0,
|
|
2880
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2694
2881
|
"div",
|
|
2695
2882
|
{
|
|
2696
2883
|
className,
|
|
@@ -2701,7 +2888,7 @@ var Rating = ({
|
|
|
2701
2888
|
gap: gap * 2
|
|
2702
2889
|
},
|
|
2703
2890
|
children: [
|
|
2704
|
-
/* @__PURE__ */ (0,
|
|
2891
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2705
2892
|
"div",
|
|
2706
2893
|
{
|
|
2707
2894
|
style: {
|
|
@@ -2712,7 +2899,7 @@ var Rating = ({
|
|
|
2712
2899
|
children: stars
|
|
2713
2900
|
}
|
|
2714
2901
|
),
|
|
2715
|
-
/* @__PURE__ */ (0,
|
|
2902
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2716
2903
|
"span",
|
|
2717
2904
|
{
|
|
2718
2905
|
style: {
|
|
@@ -2727,7 +2914,7 @@ var Rating = ({
|
|
|
2727
2914
|
}
|
|
2728
2915
|
);
|
|
2729
2916
|
}
|
|
2730
|
-
return /* @__PURE__ */ (0,
|
|
2917
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2731
2918
|
"div",
|
|
2732
2919
|
{
|
|
2733
2920
|
className,
|
|
@@ -2740,7 +2927,7 @@ var Rating = ({
|
|
|
2740
2927
|
},
|
|
2741
2928
|
children: [
|
|
2742
2929
|
stars,
|
|
2743
|
-
showValue && /* @__PURE__ */ (0,
|
|
2930
|
+
showValue && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2744
2931
|
"span",
|
|
2745
2932
|
{
|
|
2746
2933
|
style: {
|
|
@@ -2758,7 +2945,7 @@ var Rating = ({
|
|
|
2758
2945
|
};
|
|
2759
2946
|
|
|
2760
2947
|
// src/ui/divider.tsx
|
|
2761
|
-
var
|
|
2948
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2762
2949
|
var Divider = ({
|
|
2763
2950
|
variant = "fullWidth",
|
|
2764
2951
|
orientation = "horizontal",
|
|
@@ -2788,21 +2975,21 @@ var Divider = ({
|
|
|
2788
2975
|
if (children) {
|
|
2789
2976
|
const leftLineClasses = textAlign === "left" ? `${baseClasses} ${orientationClasses}` : `flex-1 ${baseClasses} ${orientationClasses}`;
|
|
2790
2977
|
const rightLineClasses = textAlign === "right" ? `${baseClasses} ${orientationClasses}` : `flex-1 ${baseClasses} ${orientationClasses}`;
|
|
2791
|
-
return /* @__PURE__ */ (0,
|
|
2978
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
2792
2979
|
"div",
|
|
2793
2980
|
{
|
|
2794
2981
|
role: "presentation",
|
|
2795
2982
|
className: `flex items-center gap-3 ${variantClasses[variant]} ${className}`,
|
|
2796
2983
|
children: [
|
|
2797
|
-
textAlign !== "left" && /* @__PURE__ */ (0,
|
|
2984
|
+
textAlign !== "left" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2798
2985
|
"div",
|
|
2799
2986
|
{
|
|
2800
2987
|
style: { ...baseStyles, ...thicknessStyle },
|
|
2801
2988
|
className: leftLineClasses
|
|
2802
2989
|
}
|
|
2803
2990
|
),
|
|
2804
|
-
/* @__PURE__ */ (0,
|
|
2805
|
-
textAlign !== "right" && /* @__PURE__ */ (0,
|
|
2991
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: textStyles, className: "whitespace-nowrap", children }),
|
|
2992
|
+
textAlign !== "right" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2806
2993
|
"div",
|
|
2807
2994
|
{
|
|
2808
2995
|
style: { ...baseStyles, ...thicknessStyle },
|
|
@@ -2814,7 +3001,7 @@ var Divider = ({
|
|
|
2814
3001
|
);
|
|
2815
3002
|
}
|
|
2816
3003
|
if (isVertical) {
|
|
2817
|
-
return /* @__PURE__ */ (0,
|
|
3004
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2818
3005
|
"div",
|
|
2819
3006
|
{
|
|
2820
3007
|
role: "separator",
|
|
@@ -2824,7 +3011,7 @@ var Divider = ({
|
|
|
2824
3011
|
}
|
|
2825
3012
|
);
|
|
2826
3013
|
}
|
|
2827
|
-
return /* @__PURE__ */ (0,
|
|
3014
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2828
3015
|
"hr",
|
|
2829
3016
|
{
|
|
2830
3017
|
style: { ...baseStyles, ...thicknessStyle },
|
|
@@ -2835,7 +3022,7 @@ var Divider = ({
|
|
|
2835
3022
|
|
|
2836
3023
|
// src/ui/slider.tsx
|
|
2837
3024
|
var import_react15 = require("react");
|
|
2838
|
-
var
|
|
3025
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2839
3026
|
var Slider = ({
|
|
2840
3027
|
value: controlledValue,
|
|
2841
3028
|
defaultValue = 0,
|
|
@@ -3073,7 +3260,7 @@ var Slider = ({
|
|
|
3073
3260
|
const showLabelAlways = valueLabelDisplay === "on";
|
|
3074
3261
|
const showLabelOnActiveOrHover = valueLabelDisplay === "auto";
|
|
3075
3262
|
const thumbStyle = isVertical ? { bottom: `${percent}%` } : { left: `${percent}%` };
|
|
3076
|
-
return /* @__PURE__ */ (0,
|
|
3263
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
3077
3264
|
"div",
|
|
3078
3265
|
{
|
|
3079
3266
|
className: `absolute ${isVertical ? "left-1/2 -translate-x-1/2" : "top-1/2 -translate-y-1/2"} cursor-pointer ${disabled ? "cursor-not-allowed opacity-50" : ""} group/thumb z-20`,
|
|
@@ -3081,19 +3268,19 @@ var Slider = ({
|
|
|
3081
3268
|
onMouseDown: handleMouseDown(index),
|
|
3082
3269
|
onTouchStart: handleMouseDown(index),
|
|
3083
3270
|
children: [
|
|
3084
|
-
/* @__PURE__ */ (0,
|
|
3271
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3085
3272
|
"div",
|
|
3086
3273
|
{
|
|
3087
3274
|
className: `absolute left-0 top-0 -translate-x-1/2 -translate-y-1/2 ${isActive ? currentSizeStyles.thumbActive : currentSizeStyles.thumb} ${currentColorStyles.thumb} ${!isActive && currentColorStyles.thumbHover} rounded-full shadow-md transition-all ${isActive ? `${currentSizeStyles.ringActive} ${currentColorStyles.thumbRing}` : `group-hover/thumb:shadow-lg ${currentSizeStyles.ringHover} ${currentColorStyles.thumbRingHover}`} ${disabled ? "pointer-events-none" : ""}`
|
|
3088
3275
|
}
|
|
3089
3276
|
),
|
|
3090
|
-
showLabelAlways && /* @__PURE__ */ (0,
|
|
3277
|
+
showLabelAlways && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
3091
3278
|
"div",
|
|
3092
3279
|
{
|
|
3093
3280
|
className: `absolute ${isVertical ? "left-6" : "-top-10"} ${isVertical ? "top-1/2 -translate-y-1/2" : "left-1/2 -translate-x-1/2"} px-2 py-1 text-caption font-semibold text-white ${color === "primary" ? "bg-(--color-primary)" : "bg-purple-500"} rounded shadow-lg whitespace-nowrap z-(--z-index-tooltip)`,
|
|
3094
3281
|
children: [
|
|
3095
3282
|
valueLabelFormat(val),
|
|
3096
|
-
/* @__PURE__ */ (0,
|
|
3283
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3097
3284
|
"div",
|
|
3098
3285
|
{
|
|
3099
3286
|
className: `absolute ${isVertical ? "left-0 top-1/2 -translate-y-1/2 -translate-x-full" : "left-1/2 -translate-x-1/2 top-full"} w-0 h-0 ${isVertical ? "border-t-4 border-t-transparent border-b-4 border-b-transparent" : "border-l-4 border-l-transparent border-r-4 border-r-transparent"} ${isVertical ? color === "primary" ? "border-r-4 border-r-[var(--color-primary)]" : "border-r-4 border-r-purple-500" : color === "primary" ? "border-t-4 border-t-[var(--color-primary)]" : "border-t-4 border-t-purple-500"}`
|
|
@@ -3102,13 +3289,13 @@ var Slider = ({
|
|
|
3102
3289
|
]
|
|
3103
3290
|
}
|
|
3104
3291
|
),
|
|
3105
|
-
showLabelOnActiveOrHover && /* @__PURE__ */ (0,
|
|
3292
|
+
showLabelOnActiveOrHover && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
3106
3293
|
"div",
|
|
3107
3294
|
{
|
|
3108
3295
|
className: `absolute ${isVertical ? "left-6" : "-top-10"} ${isVertical ? "top-1/2 -translate-y-1/2" : "left-1/2 -translate-x-1/2"} px-2 py-1 text-caption font-semibold text-white ${color === "primary" ? "bg-(--color-primary)" : "bg-purple-500"} rounded shadow-lg whitespace-nowrap opacity-0 scale-90 ${isActive ? "opacity-100 scale-100" : "group-hover/thumb:opacity-100 group-hover/thumb:scale-100"} transition-all duration-300 ease-out pointer-events-none z-(--z-index-tooltip)`,
|
|
3109
3296
|
children: [
|
|
3110
3297
|
valueLabelFormat(val),
|
|
3111
|
-
/* @__PURE__ */ (0,
|
|
3298
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3112
3299
|
"div",
|
|
3113
3300
|
{
|
|
3114
3301
|
className: `absolute ${isVertical ? "left-0 top-1/2 -translate-y-1/2 -translate-x-full" : "left-1/2 -translate-x-1/2 top-full"} w-0 h-0 ${isVertical ? "border-t-4 border-t-transparent border-b-4 border-b-transparent" : "border-l-4 border-l-transparent border-r-4 border-r-transparent"} ${isVertical ? color === "primary" ? "border-r-4 border-r-[var(--color-primary)]" : "border-r-4 border-r-purple-500" : color === "primary" ? "border-t-4 border-t-[var(--color-primary)]" : "border-t-4 border-t-purple-500"}`
|
|
@@ -3126,13 +3313,13 @@ var Slider = ({
|
|
|
3126
3313
|
const hasMarkLabels = marksList.some((mark) => mark.label);
|
|
3127
3314
|
const containerClasses = isVertical ? "flex flex-col items-center py-4" : `flex items-center w-full px-2 ${hasMarkLabels ? "pb-6" : ""}`;
|
|
3128
3315
|
const railClasses = isVertical ? `${currentSizeStyles.rail} relative overflow-visible` : `w-full ${currentSizeStyles.rail} relative overflow-visible`;
|
|
3129
|
-
return /* @__PURE__ */ (0,
|
|
3316
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
3130
3317
|
"div",
|
|
3131
3318
|
{
|
|
3132
3319
|
className: `${containerClasses} ${className}`,
|
|
3133
3320
|
style: isVertical ? { minHeight: "200px", height: "200px" } : void 0,
|
|
3134
3321
|
children: [
|
|
3135
|
-
/* @__PURE__ */ (0,
|
|
3322
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
3136
3323
|
"div",
|
|
3137
3324
|
{
|
|
3138
3325
|
ref: sliderRef,
|
|
@@ -3150,13 +3337,13 @@ var Slider = ({
|
|
|
3150
3337
|
"aria-orientation": orientation,
|
|
3151
3338
|
tabIndex: disabled ? -1 : 0,
|
|
3152
3339
|
children: [
|
|
3153
|
-
/* @__PURE__ */ (0,
|
|
3340
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3154
3341
|
"div",
|
|
3155
3342
|
{
|
|
3156
3343
|
className: `absolute ${isVertical ? "inset-x-0 h-full" : "inset-y-0 w-full"} bg-[#d1d5db] rounded-full ${disabled ? "opacity-50" : ""} z-0`
|
|
3157
3344
|
}
|
|
3158
3345
|
),
|
|
3159
|
-
track !== false && /* @__PURE__ */ (0,
|
|
3346
|
+
track !== false && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3160
3347
|
"div",
|
|
3161
3348
|
{
|
|
3162
3349
|
className: `absolute ${isVertical ? "inset-x-0" : "inset-y-0"} ${currentColorStyles.track} rounded-full ${disabled ? "opacity-50" : ""} z-0`,
|
|
@@ -3179,32 +3366,32 @@ var Slider = ({
|
|
|
3179
3366
|
}
|
|
3180
3367
|
const markColor = isInSelectedRange ? "bg-(--color-background) shadow-sm group-hover/mark:bg-(--color-background) group-hover/mark:shadow-md" : "bg-[#4b5563] group-hover/mark:bg-[#1f2937]";
|
|
3181
3368
|
const labelColor = isInSelectedRange ? currentColorStyles.labelSelected : currentColorStyles.labelUnselected;
|
|
3182
|
-
return /* @__PURE__ */ (0,
|
|
3369
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
3183
3370
|
"div",
|
|
3184
3371
|
{
|
|
3185
3372
|
className: `group/mark absolute ${isVertical ? "left-1/2 -translate-x-1/2" : "top-1/2 -translate-y-1/2"} z-30`,
|
|
3186
3373
|
style: markStyle,
|
|
3187
3374
|
children: [
|
|
3188
|
-
/* @__PURE__ */ (0,
|
|
3375
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3189
3376
|
"div",
|
|
3190
3377
|
{
|
|
3191
3378
|
className: `absolute left-0 top-0 -translate-x-1/2 -translate-y-1/2 w-1.5 h-1.5 ${markColor} rounded-full transition-all duration-200 cursor-pointer group-hover/mark:w-2 group-hover/mark:h-2 ${!disabled ? "" : "cursor-not-allowed"}`
|
|
3192
3379
|
}
|
|
3193
3380
|
),
|
|
3194
|
-
mark.label && /* @__PURE__ */ (0,
|
|
3381
|
+
mark.label && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3195
3382
|
"div",
|
|
3196
3383
|
{
|
|
3197
3384
|
className: `absolute ${isVertical ? "left-4 top-1/2 -translate-y-1/2" : "top-3 left-1/2 -translate-x-1/2"} text-caption font-medium ${labelColor} transition-colors duration-200 whitespace-nowrap pointer-events-none z-(--z-index-base)`,
|
|
3198
3385
|
children: mark.label
|
|
3199
3386
|
}
|
|
3200
3387
|
),
|
|
3201
|
-
showMarkLabelsOnHover && !mark.label && /* @__PURE__ */ (0,
|
|
3388
|
+
showMarkLabelsOnHover && !mark.label && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
3202
3389
|
"div",
|
|
3203
3390
|
{
|
|
3204
3391
|
className: `absolute ${isVertical ? "left-6 top-1/2 -translate-y-1/2" : "-top-8 left-1/2 -translate-x-1/2"} px-2 py-1 text-caption font-semibold text-white ${color === "primary" ? "bg-(--color-primary)" : "bg-purple-500"} rounded shadow-lg whitespace-nowrap opacity-0 scale-90 group-hover/mark:opacity-100 group-hover/mark:scale-100 transition-all duration-300 ease-out pointer-events-none z-(--z-index-tooltip)`,
|
|
3205
3392
|
children: [
|
|
3206
3393
|
valueLabelFormat(mark.value),
|
|
3207
|
-
/* @__PURE__ */ (0,
|
|
3394
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3208
3395
|
"div",
|
|
3209
3396
|
{
|
|
3210
3397
|
className: `absolute ${isVertical ? "right-full top-1/2 -translate-y-1/2 border-y-4 border-y-transparent border-r-4" : "top-full left-1/2 -translate-x-1/2 border-x-4 border-x-transparent border-t-4"} ${color === "primary" ? isVertical ? "border-r-[var(--color-primary)]" : "border-t-[var(--color-primary)]" : isVertical ? "border-r-purple-500" : "border-t-purple-500"}`
|
|
@@ -3222,7 +3409,7 @@ var Slider = ({
|
|
|
3222
3409
|
]
|
|
3223
3410
|
}
|
|
3224
3411
|
),
|
|
3225
|
-
name && /* @__PURE__ */ (0,
|
|
3412
|
+
name && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3226
3413
|
"input",
|
|
3227
3414
|
{
|
|
3228
3415
|
type: "hidden",
|
|
@@ -3238,7 +3425,7 @@ var Slider = ({
|
|
|
3238
3425
|
|
|
3239
3426
|
// src/ui/switch.tsx
|
|
3240
3427
|
var import_react16 = require("react");
|
|
3241
|
-
var
|
|
3428
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
3242
3429
|
function Switch({
|
|
3243
3430
|
checked: controlledChecked,
|
|
3244
3431
|
onChange,
|
|
@@ -3335,7 +3522,7 @@ function Switch({
|
|
|
3335
3522
|
top: "gap-2",
|
|
3336
3523
|
bottom: "gap-2"
|
|
3337
3524
|
};
|
|
3338
|
-
const switchElement = /* @__PURE__ */ (0,
|
|
3525
|
+
const switchElement = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3339
3526
|
"button",
|
|
3340
3527
|
{
|
|
3341
3528
|
type: "button",
|
|
@@ -3352,7 +3539,7 @@ function Switch({
|
|
|
3352
3539
|
disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:opacity-90",
|
|
3353
3540
|
checked && !disabled && "focus:ring-blue-500"
|
|
3354
3541
|
),
|
|
3355
|
-
children: /* @__PURE__ */ (0,
|
|
3542
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3356
3543
|
"span",
|
|
3357
3544
|
{
|
|
3358
3545
|
className: cn(
|
|
@@ -3365,9 +3552,9 @@ function Switch({
|
|
|
3365
3552
|
)
|
|
3366
3553
|
}
|
|
3367
3554
|
);
|
|
3368
|
-
const content = !label ? /* @__PURE__ */ (0,
|
|
3555
|
+
const content = !label ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
3369
3556
|
switchElement,
|
|
3370
|
-
name && /* @__PURE__ */ (0,
|
|
3557
|
+
name && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3371
3558
|
"input",
|
|
3372
3559
|
{
|
|
3373
3560
|
type: "checkbox",
|
|
@@ -3379,7 +3566,7 @@ function Switch({
|
|
|
3379
3566
|
required
|
|
3380
3567
|
}
|
|
3381
3568
|
)
|
|
3382
|
-
] }) : /* @__PURE__ */ (0,
|
|
3569
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
3383
3570
|
"label",
|
|
3384
3571
|
{
|
|
3385
3572
|
className: cn(
|
|
@@ -3390,7 +3577,7 @@ function Switch({
|
|
|
3390
3577
|
),
|
|
3391
3578
|
children: [
|
|
3392
3579
|
switchElement,
|
|
3393
|
-
/* @__PURE__ */ (0,
|
|
3580
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
3394
3581
|
"span",
|
|
3395
3582
|
{
|
|
3396
3583
|
className: cn(
|
|
@@ -3400,11 +3587,11 @@ function Switch({
|
|
|
3400
3587
|
style: !disabled ? { color: "var(--color-muted-foreground)" } : void 0,
|
|
3401
3588
|
children: [
|
|
3402
3589
|
label,
|
|
3403
|
-
required && /* @__PURE__ */ (0,
|
|
3590
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "ml-1", children: "*" })
|
|
3404
3591
|
]
|
|
3405
3592
|
}
|
|
3406
3593
|
),
|
|
3407
|
-
name && /* @__PURE__ */ (0,
|
|
3594
|
+
name && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3408
3595
|
"input",
|
|
3409
3596
|
{
|
|
3410
3597
|
type: "checkbox",
|
|
@@ -3419,7 +3606,7 @@ function Switch({
|
|
|
3419
3606
|
]
|
|
3420
3607
|
}
|
|
3421
3608
|
);
|
|
3422
|
-
return /* @__PURE__ */ (0,
|
|
3609
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3423
3610
|
"div",
|
|
3424
3611
|
{
|
|
3425
3612
|
className,
|
|
@@ -3433,7 +3620,7 @@ function Switch({
|
|
|
3433
3620
|
|
|
3434
3621
|
// src/ui/dialog.tsx
|
|
3435
3622
|
var import_react17 = __toESM(require("react"));
|
|
3436
|
-
var
|
|
3623
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
3437
3624
|
var Dialog = ({
|
|
3438
3625
|
open,
|
|
3439
3626
|
onClose,
|
|
@@ -3484,14 +3671,14 @@ var Dialog = ({
|
|
|
3484
3671
|
onClose();
|
|
3485
3672
|
}
|
|
3486
3673
|
};
|
|
3487
|
-
return /* @__PURE__ */ (0,
|
|
3674
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3488
3675
|
"div",
|
|
3489
3676
|
{
|
|
3490
3677
|
className: "fixed inset-0 [z-index:var(--z-index-modal)] flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm animate-in fade-in duration-200",
|
|
3491
3678
|
onClick: handleBackdropClick,
|
|
3492
3679
|
role: "dialog",
|
|
3493
3680
|
"aria-modal": "true",
|
|
3494
|
-
children: /* @__PURE__ */ (0,
|
|
3681
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
3495
3682
|
"div",
|
|
3496
3683
|
{
|
|
3497
3684
|
className: cn(
|
|
@@ -3499,7 +3686,7 @@ var Dialog = ({
|
|
|
3499
3686
|
sizes[size]
|
|
3500
3687
|
),
|
|
3501
3688
|
children: [
|
|
3502
|
-
showCloseButton && /* @__PURE__ */ (0,
|
|
3689
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3503
3690
|
"button",
|
|
3504
3691
|
{
|
|
3505
3692
|
onClick: onClose,
|
|
@@ -3542,14 +3729,14 @@ var Dialog = ({
|
|
|
3542
3729
|
},
|
|
3543
3730
|
className: "absolute right-2 top-2 p-1.5 rounded-full [z-index:var(--z-index-base)] focus:outline-none",
|
|
3544
3731
|
"aria-label": "Close dialog",
|
|
3545
|
-
children: /* @__PURE__ */ (0,
|
|
3732
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3546
3733
|
"svg",
|
|
3547
3734
|
{
|
|
3548
3735
|
className: "w-5 h-5",
|
|
3549
3736
|
fill: "none",
|
|
3550
3737
|
stroke: "currentColor",
|
|
3551
3738
|
viewBox: "0 0 24 24",
|
|
3552
|
-
children: /* @__PURE__ */ (0,
|
|
3739
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3553
3740
|
"path",
|
|
3554
3741
|
{
|
|
3555
3742
|
strokeLinecap: "round",
|
|
@@ -3562,7 +3749,7 @@ var Dialog = ({
|
|
|
3562
3749
|
)
|
|
3563
3750
|
}
|
|
3564
3751
|
),
|
|
3565
|
-
/* @__PURE__ */ (0,
|
|
3752
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DialogContext.Provider, { value: { variant }, children })
|
|
3566
3753
|
]
|
|
3567
3754
|
}
|
|
3568
3755
|
)
|
|
@@ -3595,7 +3782,7 @@ var DialogHeader = import_react17.default.forwardRef(({ className, children, ...
|
|
|
3595
3782
|
borderColor: "var(--color-error-border)"
|
|
3596
3783
|
}
|
|
3597
3784
|
};
|
|
3598
|
-
return /* @__PURE__ */ (0,
|
|
3785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3599
3786
|
"div",
|
|
3600
3787
|
{
|
|
3601
3788
|
ref,
|
|
@@ -3610,7 +3797,7 @@ var DialogHeader = import_react17.default.forwardRef(({ className, children, ...
|
|
|
3610
3797
|
);
|
|
3611
3798
|
});
|
|
3612
3799
|
DialogHeader.displayName = "DialogHeader";
|
|
3613
|
-
var DialogTitle = import_react17.default.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3800
|
+
var DialogTitle = import_react17.default.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3614
3801
|
"h2",
|
|
3615
3802
|
{
|
|
3616
3803
|
ref,
|
|
@@ -3623,7 +3810,7 @@ var DialogTitle = import_react17.default.forwardRef(({ className, children, ...p
|
|
|
3623
3810
|
}
|
|
3624
3811
|
));
|
|
3625
3812
|
DialogTitle.displayName = "DialogTitle";
|
|
3626
|
-
var DialogDescription = import_react17.default.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3813
|
+
var DialogDescription = import_react17.default.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3627
3814
|
"p",
|
|
3628
3815
|
{
|
|
3629
3816
|
ref,
|
|
@@ -3633,9 +3820,9 @@ var DialogDescription = import_react17.default.forwardRef(({ className, children
|
|
|
3633
3820
|
}
|
|
3634
3821
|
));
|
|
3635
3822
|
DialogDescription.displayName = "DialogDescription";
|
|
3636
|
-
var DialogContent = import_react17.default.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3823
|
+
var DialogContent = import_react17.default.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { ref, className: cn("px-6 py-4", className), ...props, children }));
|
|
3637
3824
|
DialogContent.displayName = "DialogContent";
|
|
3638
|
-
var DialogFooter = import_react17.default.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3825
|
+
var DialogFooter = import_react17.default.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3639
3826
|
"div",
|
|
3640
3827
|
{
|
|
3641
3828
|
ref,
|
|
@@ -3651,7 +3838,7 @@ DialogFooter.displayName = "DialogFooter";
|
|
|
3651
3838
|
|
|
3652
3839
|
// src/feedback/alert.tsx
|
|
3653
3840
|
var import_react18 = __toESM(require("react"));
|
|
3654
|
-
var
|
|
3841
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
3655
3842
|
var Alert = import_react18.default.forwardRef(
|
|
3656
3843
|
({
|
|
3657
3844
|
className,
|
|
@@ -3692,7 +3879,7 @@ var Alert = import_react18.default.forwardRef(
|
|
|
3692
3879
|
error: { color: "var(--color-error-border)" }
|
|
3693
3880
|
};
|
|
3694
3881
|
const defaultIcons = {
|
|
3695
|
-
info: /* @__PURE__ */ (0,
|
|
3882
|
+
info: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3696
3883
|
"path",
|
|
3697
3884
|
{
|
|
3698
3885
|
fillRule: "evenodd",
|
|
@@ -3700,7 +3887,7 @@ var Alert = import_react18.default.forwardRef(
|
|
|
3700
3887
|
clipRule: "evenodd"
|
|
3701
3888
|
}
|
|
3702
3889
|
) }),
|
|
3703
|
-
success: /* @__PURE__ */ (0,
|
|
3890
|
+
success: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3704
3891
|
"path",
|
|
3705
3892
|
{
|
|
3706
3893
|
fillRule: "evenodd",
|
|
@@ -3708,7 +3895,7 @@ var Alert = import_react18.default.forwardRef(
|
|
|
3708
3895
|
clipRule: "evenodd"
|
|
3709
3896
|
}
|
|
3710
3897
|
) }),
|
|
3711
|
-
warning: /* @__PURE__ */ (0,
|
|
3898
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3712
3899
|
"path",
|
|
3713
3900
|
{
|
|
3714
3901
|
fillRule: "evenodd",
|
|
@@ -3716,7 +3903,7 @@ var Alert = import_react18.default.forwardRef(
|
|
|
3716
3903
|
clipRule: "evenodd"
|
|
3717
3904
|
}
|
|
3718
3905
|
) }),
|
|
3719
|
-
error: /* @__PURE__ */ (0,
|
|
3906
|
+
error: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3720
3907
|
"path",
|
|
3721
3908
|
{
|
|
3722
3909
|
fillRule: "evenodd",
|
|
@@ -3725,7 +3912,7 @@ var Alert = import_react18.default.forwardRef(
|
|
|
3725
3912
|
}
|
|
3726
3913
|
) })
|
|
3727
3914
|
};
|
|
3728
|
-
return /* @__PURE__ */ (0,
|
|
3915
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3729
3916
|
"div",
|
|
3730
3917
|
{
|
|
3731
3918
|
ref,
|
|
@@ -3733,13 +3920,13 @@ var Alert = import_react18.default.forwardRef(
|
|
|
3733
3920
|
className: cn("relative border rounded-lg p-4", className),
|
|
3734
3921
|
role: "alert",
|
|
3735
3922
|
...props,
|
|
3736
|
-
children: /* @__PURE__ */ (0,
|
|
3737
|
-
/* @__PURE__ */ (0,
|
|
3738
|
-
/* @__PURE__ */ (0,
|
|
3739
|
-
title && /* @__PURE__ */ (0,
|
|
3740
|
-
/* @__PURE__ */ (0,
|
|
3923
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-start gap-3", children: [
|
|
3924
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "shrink-0", style: iconStyles[variant], children: icon || defaultIcons[variant] }),
|
|
3925
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex-1", children: [
|
|
3926
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("h5", { className: "font-semibold mb-1", children: title }),
|
|
3927
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "text-sm", children })
|
|
3741
3928
|
] }),
|
|
3742
|
-
dismissible && onDismiss && /* @__PURE__ */ (0,
|
|
3929
|
+
dismissible && onDismiss && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3743
3930
|
"button",
|
|
3744
3931
|
{
|
|
3745
3932
|
type: "button",
|
|
@@ -3773,7 +3960,7 @@ var Alert = import_react18.default.forwardRef(
|
|
|
3773
3960
|
},
|
|
3774
3961
|
className: "shrink-0 rounded-lg p-1.5 inline-flex focus:outline-none",
|
|
3775
3962
|
"aria-label": "Close",
|
|
3776
|
-
children: /* @__PURE__ */ (0,
|
|
3963
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("svg", { className: "w-4 h-4", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3777
3964
|
"path",
|
|
3778
3965
|
{
|
|
3779
3966
|
fillRule: "evenodd",
|
|
@@ -3792,7 +3979,7 @@ Alert.displayName = "Alert";
|
|
|
3792
3979
|
|
|
3793
3980
|
// src/layout/container.tsx
|
|
3794
3981
|
var import_react19 = __toESM(require("react"));
|
|
3795
|
-
var
|
|
3982
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
3796
3983
|
var Container = import_react19.default.forwardRef(
|
|
3797
3984
|
({
|
|
3798
3985
|
className,
|
|
@@ -3810,7 +3997,7 @@ var Container = import_react19.default.forwardRef(
|
|
|
3810
3997
|
"2xl": "max-w-screen-2xl",
|
|
3811
3998
|
full: "max-w-full"
|
|
3812
3999
|
};
|
|
3813
|
-
return /* @__PURE__ */ (0,
|
|
4000
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3814
4001
|
"div",
|
|
3815
4002
|
{
|
|
3816
4003
|
ref,
|
|
@@ -3831,13 +4018,13 @@ Container.displayName = "Container";
|
|
|
3831
4018
|
|
|
3832
4019
|
// src/layout/section-layout.tsx
|
|
3833
4020
|
var import_react20 = __toESM(require("react"));
|
|
3834
|
-
var
|
|
4021
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
3835
4022
|
function SectionLayout({
|
|
3836
4023
|
children,
|
|
3837
4024
|
hasStickyPreview = false
|
|
3838
4025
|
}) {
|
|
3839
4026
|
if (!hasStickyPreview) {
|
|
3840
|
-
return /* @__PURE__ */ (0,
|
|
4027
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_jsx_runtime21.Fragment, { children });
|
|
3841
4028
|
}
|
|
3842
4029
|
const childArray = import_react20.default.Children.toArray(children);
|
|
3843
4030
|
if (childArray.length === 0) {
|
|
@@ -3845,16 +4032,16 @@ function SectionLayout({
|
|
|
3845
4032
|
}
|
|
3846
4033
|
const stickyPreview = childArray[0];
|
|
3847
4034
|
const scrollableContent = childArray.slice(1);
|
|
3848
|
-
return /* @__PURE__ */ (0,
|
|
4035
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
3849
4036
|
stickyPreview,
|
|
3850
|
-
scrollableContent.length > 0 && /* @__PURE__ */ (0,
|
|
4037
|
+
scrollableContent.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "space-y-8", children: scrollableContent })
|
|
3851
4038
|
] });
|
|
3852
4039
|
}
|
|
3853
4040
|
|
|
3854
4041
|
// src/layout/nav.tsx
|
|
3855
4042
|
var import_lucide_react3 = require("lucide-react");
|
|
3856
4043
|
var import_react21 = __toESM(require("react"));
|
|
3857
|
-
var
|
|
4044
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
3858
4045
|
var Nav = import_react21.default.forwardRef(
|
|
3859
4046
|
({
|
|
3860
4047
|
className,
|
|
@@ -3884,7 +4071,7 @@ var Nav = import_react21.default.forwardRef(
|
|
|
3884
4071
|
const mobileMenuRef = (0, import_react21.useRef)(null);
|
|
3885
4072
|
const [navElement, setNavElement] = (0, import_react21.useState)(null);
|
|
3886
4073
|
const [isNavVisible, setIsNavVisible] = (0, import_react21.useState)(true);
|
|
3887
|
-
const
|
|
4074
|
+
const lastScrollYRef = (0, import_react21.useRef)(0);
|
|
3888
4075
|
(0, import_react21.useEffect)(() => {
|
|
3889
4076
|
if (!autoHideOnScroll || position === "static") {
|
|
3890
4077
|
setIsNavVisible(true);
|
|
@@ -3894,16 +4081,19 @@ var Nav = import_react21.default.forwardRef(
|
|
|
3894
4081
|
const currentScrollY = window.scrollY;
|
|
3895
4082
|
if (currentScrollY < 10) {
|
|
3896
4083
|
setIsNavVisible(true);
|
|
3897
|
-
|
|
4084
|
+
lastScrollYRef.current = currentScrollY;
|
|
4085
|
+
return;
|
|
4086
|
+
}
|
|
4087
|
+
if (currentScrollY > lastScrollYRef.current) {
|
|
3898
4088
|
setIsNavVisible(false);
|
|
3899
|
-
} else {
|
|
4089
|
+
} else if (currentScrollY < lastScrollYRef.current) {
|
|
3900
4090
|
setIsNavVisible(true);
|
|
3901
4091
|
}
|
|
3902
|
-
|
|
4092
|
+
lastScrollYRef.current = currentScrollY;
|
|
3903
4093
|
};
|
|
3904
4094
|
window.addEventListener("scroll", handleScroll, { passive: true });
|
|
3905
4095
|
return () => window.removeEventListener("scroll", handleScroll);
|
|
3906
|
-
}, [
|
|
4096
|
+
}, [autoHideOnScroll, position]);
|
|
3907
4097
|
(0, import_react21.useEffect)(() => {
|
|
3908
4098
|
function handleClickOutside(event) {
|
|
3909
4099
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
@@ -4005,7 +4195,7 @@ var Nav = import_react21.default.forwardRef(
|
|
|
4005
4195
|
};
|
|
4006
4196
|
const renderNavItem = (item, isMobile = false) => {
|
|
4007
4197
|
if (item.type === "divider") {
|
|
4008
|
-
return /* @__PURE__ */ (0,
|
|
4198
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4009
4199
|
"div",
|
|
4010
4200
|
{
|
|
4011
4201
|
className: cn(
|
|
@@ -4017,7 +4207,7 @@ var Nav = import_react21.default.forwardRef(
|
|
|
4017
4207
|
);
|
|
4018
4208
|
}
|
|
4019
4209
|
if (item.type === "custom" && item.render) {
|
|
4020
|
-
return /* @__PURE__ */ (0,
|
|
4210
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { children: item.render() }, item.id);
|
|
4021
4211
|
}
|
|
4022
4212
|
const isActive = activeId === item.id;
|
|
4023
4213
|
const isDropdownOpen = openDropdownId === item.id;
|
|
@@ -4031,11 +4221,11 @@ var Nav = import_react21.default.forwardRef(
|
|
|
4031
4221
|
orientation === "vertical" && "w-full",
|
|
4032
4222
|
item.disabled && "opacity-50 cursor-not-allowed"
|
|
4033
4223
|
);
|
|
4034
|
-
const content = /* @__PURE__ */ (0,
|
|
4035
|
-
item.icon && /* @__PURE__ */ (0,
|
|
4036
|
-
/* @__PURE__ */ (0,
|
|
4037
|
-
item.badge && /* @__PURE__ */ (0,
|
|
4038
|
-
hasChildren && /* @__PURE__ */ (0,
|
|
4224
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
4225
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "flex-shrink-0", children: item.icon }),
|
|
4226
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: item.label }),
|
|
4227
|
+
item.badge && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "ml-auto inline-flex items-center rounded-full bg-(--color-primary) px-2 py-0.5 text-caption font-medium text-white", children: item.badge }),
|
|
4228
|
+
hasChildren && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4039
4229
|
import_lucide_react3.ChevronDown,
|
|
4040
4230
|
{
|
|
4041
4231
|
className: cn(
|
|
@@ -4046,8 +4236,8 @@ var Nav = import_react21.default.forwardRef(
|
|
|
4046
4236
|
)
|
|
4047
4237
|
] });
|
|
4048
4238
|
if (hasChildren) {
|
|
4049
|
-
return /* @__PURE__ */ (0,
|
|
4050
|
-
/* @__PURE__ */ (0,
|
|
4239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "relative", ref: dropdownRef, children: [
|
|
4240
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4051
4241
|
"button",
|
|
4052
4242
|
{
|
|
4053
4243
|
onClick: () => handleItemClick(item),
|
|
@@ -4056,14 +4246,14 @@ var Nav = import_react21.default.forwardRef(
|
|
|
4056
4246
|
children: content
|
|
4057
4247
|
}
|
|
4058
4248
|
),
|
|
4059
|
-
isDropdownOpen && /* @__PURE__ */ (0,
|
|
4249
|
+
isDropdownOpen && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4060
4250
|
"div",
|
|
4061
4251
|
{
|
|
4062
4252
|
className: cn(
|
|
4063
4253
|
"absolute left-0 mt-[var(--nav-gap)] min-w-[200px] bg-(--color-background) border border-(--color-border) rounded-[var(--nav-border-radius)] shadow-xl [z-index:var(--z-index-dropdown)] animate-in fade-in-0 zoom-in-95 duration-200",
|
|
4064
4254
|
orientation === "vertical" && "left-full top-0 ml-2 mt-0"
|
|
4065
4255
|
),
|
|
4066
|
-
children: /* @__PURE__ */ (0,
|
|
4256
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "py-1", children: item.children.map((child) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
4067
4257
|
"button",
|
|
4068
4258
|
{
|
|
4069
4259
|
onClick: () => handleItemClick(child),
|
|
@@ -4074,9 +4264,9 @@ var Nav = import_react21.default.forwardRef(
|
|
|
4074
4264
|
activeId === child.id && "bg-(--color-primary)/10 text-(--color-primary) [font-weight:var(--font-semibold)]"
|
|
4075
4265
|
),
|
|
4076
4266
|
children: [
|
|
4077
|
-
child.icon && /* @__PURE__ */ (0,
|
|
4078
|
-
/* @__PURE__ */ (0,
|
|
4079
|
-
child.badge && /* @__PURE__ */ (0,
|
|
4267
|
+
child.icon && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "flex-shrink-0", children: child.icon }),
|
|
4268
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: child.label }),
|
|
4269
|
+
child.badge && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "ml-auto px-2 py-0.5 [font-size:var(--text-xs)] font-semibold bg-(--color-primary) text-white rounded-[var(--radius-full)]", children: child.badge })
|
|
4080
4270
|
]
|
|
4081
4271
|
},
|
|
4082
4272
|
child.id
|
|
@@ -4086,7 +4276,7 @@ var Nav = import_react21.default.forwardRef(
|
|
|
4086
4276
|
] }, item.id);
|
|
4087
4277
|
}
|
|
4088
4278
|
if (item.href) {
|
|
4089
|
-
return /* @__PURE__ */ (0,
|
|
4279
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4090
4280
|
"a",
|
|
4091
4281
|
{
|
|
4092
4282
|
href: item.href,
|
|
@@ -4098,7 +4288,7 @@ var Nav = import_react21.default.forwardRef(
|
|
|
4098
4288
|
item.id
|
|
4099
4289
|
);
|
|
4100
4290
|
}
|
|
4101
|
-
return /* @__PURE__ */ (0,
|
|
4291
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4102
4292
|
"button",
|
|
4103
4293
|
{
|
|
4104
4294
|
onClick: () => handleItemClick(item),
|
|
@@ -4109,7 +4299,7 @@ var Nav = import_react21.default.forwardRef(
|
|
|
4109
4299
|
item.id
|
|
4110
4300
|
);
|
|
4111
4301
|
};
|
|
4112
|
-
const desktopNav = /* @__PURE__ */ (0,
|
|
4302
|
+
const desktopNav = /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4113
4303
|
"div",
|
|
4114
4304
|
{
|
|
4115
4305
|
className: cn(
|
|
@@ -4131,13 +4321,12 @@ var Nav = import_react21.default.forwardRef(
|
|
|
4131
4321
|
},
|
|
4132
4322
|
[ref]
|
|
4133
4323
|
);
|
|
4134
|
-
return /* @__PURE__ */ (0,
|
|
4324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
4135
4325
|
"nav",
|
|
4136
4326
|
{
|
|
4137
4327
|
ref: setRefs,
|
|
4138
4328
|
className: cn(
|
|
4139
4329
|
baseStyles,
|
|
4140
|
-
"relative",
|
|
4141
4330
|
// Border styles
|
|
4142
4331
|
!borderless && "border border-(--color-border)",
|
|
4143
4332
|
borderless && "border-0",
|
|
@@ -4145,11 +4334,11 @@ var Nav = import_react21.default.forwardRef(
|
|
|
4145
4334
|
),
|
|
4146
4335
|
...htmlProps,
|
|
4147
4336
|
children: [
|
|
4148
|
-
/* @__PURE__ */ (0,
|
|
4149
|
-
logo && /* @__PURE__ */ (0,
|
|
4337
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: containerStyles, children: [
|
|
4338
|
+
logo && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "shrink-0", children: logo }),
|
|
4150
4339
|
desktopNav,
|
|
4151
|
-
actions && /* @__PURE__ */ (0,
|
|
4152
|
-
/* @__PURE__ */ (0,
|
|
4340
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "shrink-0 flex items-center gap-2 ml-auto", children: actions }),
|
|
4341
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4153
4342
|
"button",
|
|
4154
4343
|
{
|
|
4155
4344
|
onClick: () => setIsMobileMenuOpen(!isMobileMenuOpen),
|
|
@@ -4158,11 +4347,11 @@ var Nav = import_react21.default.forwardRef(
|
|
|
4158
4347
|
breakpointClasses[mobileBreakpoint]
|
|
4159
4348
|
),
|
|
4160
4349
|
"aria-label": "Toggle menu",
|
|
4161
|
-
children: isMobileMenuOpen ? /* @__PURE__ */ (0,
|
|
4350
|
+
children: isMobileMenuOpen ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react3.X, { className: "w-6 h-6" }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react3.Menu, { className: "w-6 h-6" })
|
|
4162
4351
|
}
|
|
4163
4352
|
)
|
|
4164
4353
|
] }),
|
|
4165
|
-
mobileMenuDirection === "top" && /* @__PURE__ */ (0,
|
|
4354
|
+
mobileMenuDirection === "top" && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4166
4355
|
"div",
|
|
4167
4356
|
{
|
|
4168
4357
|
ref: mobileMenuRef,
|
|
@@ -4171,11 +4360,11 @@ var Nav = import_react21.default.forwardRef(
|
|
|
4171
4360
|
breakpointClasses[mobileBreakpoint],
|
|
4172
4361
|
isMobileMenuOpen ? "max-h-96 opacity-100 border-(--color-border)" : "max-h-0 opacity-0 border-transparent"
|
|
4173
4362
|
),
|
|
4174
|
-
children: /* @__PURE__ */ (0,
|
|
4363
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "space-y-1 px-2 py-2", children: items.map((item) => renderNavItem(item, true)) })
|
|
4175
4364
|
}
|
|
4176
4365
|
),
|
|
4177
|
-
mobileMenuDirection !== "top" && /* @__PURE__ */ (0,
|
|
4178
|
-
isMobileMenuOpen && /* @__PURE__ */ (0,
|
|
4366
|
+
mobileMenuDirection !== "top" && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
4367
|
+
isMobileMenuOpen && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4179
4368
|
"div",
|
|
4180
4369
|
{
|
|
4181
4370
|
className: cn(
|
|
@@ -4188,7 +4377,7 @@ var Nav = import_react21.default.forwardRef(
|
|
|
4188
4377
|
onClick: () => setIsMobileMenuOpen(false)
|
|
4189
4378
|
}
|
|
4190
4379
|
),
|
|
4191
|
-
/* @__PURE__ */ (0,
|
|
4380
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4192
4381
|
"div",
|
|
4193
4382
|
{
|
|
4194
4383
|
ref: mobileMenuRef,
|
|
@@ -4208,7 +4397,7 @@ var Nav = import_react21.default.forwardRef(
|
|
|
4208
4397
|
style: {
|
|
4209
4398
|
transitionDuration: "var(--transition-drawer-duration, 500ms)"
|
|
4210
4399
|
},
|
|
4211
|
-
children: /* @__PURE__ */ (0,
|
|
4400
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "flex flex-col space-y-1 px-2 pt-2", children: items.map((item) => renderNavItem(item, true)) })
|
|
4212
4401
|
}
|
|
4213
4402
|
)
|
|
4214
4403
|
] })
|
|
@@ -4222,7 +4411,7 @@ Nav.displayName = "Nav";
|
|
|
4222
4411
|
// src/layout/drawer.tsx
|
|
4223
4412
|
var import_lucide_react4 = require("lucide-react");
|
|
4224
4413
|
var import_react22 = require("react");
|
|
4225
|
-
var
|
|
4414
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
4226
4415
|
function Drawer({
|
|
4227
4416
|
title,
|
|
4228
4417
|
subtitle,
|
|
@@ -4267,8 +4456,8 @@ function Drawer({
|
|
|
4267
4456
|
window.addEventListener("scroll", handleScroll, { passive: true });
|
|
4268
4457
|
return () => window.removeEventListener("scroll", handleScroll);
|
|
4269
4458
|
}, [lastScrollY, autoHideOnScroll]);
|
|
4270
|
-
return /* @__PURE__ */ (0,
|
|
4271
|
-
/* @__PURE__ */ (0,
|
|
4459
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
4460
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4272
4461
|
"div",
|
|
4273
4462
|
{
|
|
4274
4463
|
className: `lg:hidden fixed top-0 left-0 right-0 px-4 py-3 z-(--z-index-drawer-header) transition-transform duration-500 ease-in-out ${blur ? "backdrop-blur-md backdrop-saturate-150" : ""} ${borderless ? "border-b-0" : ""} ${isHeaderVisible ? "translate-y-0" : "-translate-y-full"}`,
|
|
@@ -4277,13 +4466,13 @@ function Drawer({
|
|
|
4277
4466
|
opacity: blur ? 0.85 : 1,
|
|
4278
4467
|
borderBottom: !borderless && !blur ? "1px solid var(--color-border)" : "none"
|
|
4279
4468
|
},
|
|
4280
|
-
children: /* @__PURE__ */ (0,
|
|
4469
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4281
4470
|
"div",
|
|
4282
4471
|
{
|
|
4283
4472
|
className: `flex items-center ${isLeft ? "justify-between" : "justify-between flex-row-reverse"}`,
|
|
4284
4473
|
children: [
|
|
4285
|
-
/* @__PURE__ */ (0,
|
|
4286
|
-
homeUrl && /* @__PURE__ */ (0,
|
|
4474
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
4475
|
+
homeUrl && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4287
4476
|
"a",
|
|
4288
4477
|
{
|
|
4289
4478
|
href: homeUrl,
|
|
@@ -4292,14 +4481,14 @@ function Drawer({
|
|
|
4292
4481
|
onMouseOver: (e) => e.currentTarget.style.background = "var(--color-muted)",
|
|
4293
4482
|
onMouseOut: (e) => e.currentTarget.style.background = "transparent",
|
|
4294
4483
|
"aria-label": "Go to home",
|
|
4295
|
-
children: /* @__PURE__ */ (0,
|
|
4484
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4296
4485
|
"svg",
|
|
4297
4486
|
{
|
|
4298
4487
|
className: "w-5 h-5",
|
|
4299
4488
|
fill: "none",
|
|
4300
4489
|
stroke: "currentColor",
|
|
4301
4490
|
viewBox: "0 0 24 24",
|
|
4302
|
-
children: /* @__PURE__ */ (0,
|
|
4491
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4303
4492
|
"path",
|
|
4304
4493
|
{
|
|
4305
4494
|
strokeLinecap: "round",
|
|
@@ -4312,7 +4501,7 @@ function Drawer({
|
|
|
4312
4501
|
)
|
|
4313
4502
|
}
|
|
4314
4503
|
),
|
|
4315
|
-
/* @__PURE__ */ (0,
|
|
4504
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4316
4505
|
"button",
|
|
4317
4506
|
{
|
|
4318
4507
|
onClick: () => setMobileMenuOpen(!mobileMenuOpen),
|
|
@@ -4321,13 +4510,13 @@ function Drawer({
|
|
|
4321
4510
|
onMouseOver: (e) => e.currentTarget.style.background = "var(--color-muted)",
|
|
4322
4511
|
onMouseOut: (e) => e.currentTarget.style.background = "transparent",
|
|
4323
4512
|
"aria-label": "Toggle menu",
|
|
4324
|
-
children: mobileMenuOpen ? /* @__PURE__ */ (0,
|
|
4513
|
+
children: mobileMenuOpen ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react4.X, { className: "w-6 h-6" }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react4.Menu, { className: "w-6 h-6" })
|
|
4325
4514
|
}
|
|
4326
4515
|
)
|
|
4327
4516
|
] }),
|
|
4328
|
-
headerActions && /* @__PURE__ */ (0,
|
|
4329
|
-
/* @__PURE__ */ (0,
|
|
4330
|
-
/* @__PURE__ */ (0,
|
|
4517
|
+
headerActions && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex items-center", children: headerActions }),
|
|
4518
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { children: [
|
|
4519
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4331
4520
|
"h1",
|
|
4332
4521
|
{
|
|
4333
4522
|
className: "font-bold text-h5",
|
|
@@ -4337,7 +4526,7 @@ function Drawer({
|
|
|
4337
4526
|
children: title
|
|
4338
4527
|
}
|
|
4339
4528
|
),
|
|
4340
|
-
subtitle && /* @__PURE__ */ (0,
|
|
4529
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4341
4530
|
"p",
|
|
4342
4531
|
{
|
|
4343
4532
|
className: "text-caption",
|
|
@@ -4353,7 +4542,7 @@ function Drawer({
|
|
|
4353
4542
|
)
|
|
4354
4543
|
}
|
|
4355
4544
|
),
|
|
4356
|
-
mobileMenuOpen && /* @__PURE__ */ (0,
|
|
4545
|
+
mobileMenuOpen && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4357
4546
|
"div",
|
|
4358
4547
|
{
|
|
4359
4548
|
className: "fixed inset-0 lg:hidden transition-opacity ease-in-out",
|
|
@@ -4365,7 +4554,7 @@ function Drawer({
|
|
|
4365
4554
|
onClick: () => setMobileMenuOpen(false)
|
|
4366
4555
|
}
|
|
4367
4556
|
),
|
|
4368
|
-
/* @__PURE__ */ (0,
|
|
4557
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4369
4558
|
"aside",
|
|
4370
4559
|
{
|
|
4371
4560
|
className: `
|
|
@@ -4383,7 +4572,7 @@ function Drawer({
|
|
|
4383
4572
|
...mobileMenuOpen && typeof window !== "undefined" && window.innerWidth < 1024 ? { zIndex: 9999 } : {}
|
|
4384
4573
|
},
|
|
4385
4574
|
children: [
|
|
4386
|
-
/* @__PURE__ */ (0,
|
|
4575
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4387
4576
|
"div",
|
|
4388
4577
|
{
|
|
4389
4578
|
className: "hidden lg:block px-6 py-5",
|
|
@@ -4392,7 +4581,7 @@ function Drawer({
|
|
|
4392
4581
|
background: "var(--color-muted)"
|
|
4393
4582
|
},
|
|
4394
4583
|
children: [
|
|
4395
|
-
/* @__PURE__ */ (0,
|
|
4584
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4396
4585
|
"h1",
|
|
4397
4586
|
{
|
|
4398
4587
|
className: "font-bold text-h5",
|
|
@@ -4402,7 +4591,7 @@ function Drawer({
|
|
|
4402
4591
|
children: title
|
|
4403
4592
|
}
|
|
4404
4593
|
),
|
|
4405
|
-
subtitle && /* @__PURE__ */ (0,
|
|
4594
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4406
4595
|
"p",
|
|
4407
4596
|
{
|
|
4408
4597
|
className: "mt-0.5 text-caption",
|
|
@@ -4415,14 +4604,14 @@ function Drawer({
|
|
|
4415
4604
|
]
|
|
4416
4605
|
}
|
|
4417
4606
|
),
|
|
4418
|
-
/* @__PURE__ */ (0,
|
|
4607
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4419
4608
|
"div",
|
|
4420
4609
|
{
|
|
4421
4610
|
className: "lg:hidden p-4 flex items-center justify-between",
|
|
4422
4611
|
style: { borderBottom: "1px solid var(--color-border)" },
|
|
4423
4612
|
children: [
|
|
4424
|
-
/* @__PURE__ */ (0,
|
|
4425
|
-
/* @__PURE__ */ (0,
|
|
4613
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { children: [
|
|
4614
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4426
4615
|
"h1",
|
|
4427
4616
|
{
|
|
4428
4617
|
className: "font-bold text-h5",
|
|
@@ -4432,7 +4621,7 @@ function Drawer({
|
|
|
4432
4621
|
children: title
|
|
4433
4622
|
}
|
|
4434
4623
|
),
|
|
4435
|
-
subtitle && /* @__PURE__ */ (0,
|
|
4624
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4436
4625
|
"p",
|
|
4437
4626
|
{
|
|
4438
4627
|
className: "mt-1 text-caption",
|
|
@@ -4443,7 +4632,7 @@ function Drawer({
|
|
|
4443
4632
|
}
|
|
4444
4633
|
)
|
|
4445
4634
|
] }),
|
|
4446
|
-
/* @__PURE__ */ (0,
|
|
4635
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4447
4636
|
"button",
|
|
4448
4637
|
{
|
|
4449
4638
|
onClick: () => setMobileMenuOpen(false),
|
|
@@ -4452,20 +4641,20 @@ function Drawer({
|
|
|
4452
4641
|
onMouseOver: (e) => e.currentTarget.style.background = "var(--color-muted)",
|
|
4453
4642
|
onMouseOut: (e) => e.currentTarget.style.background = "transparent",
|
|
4454
4643
|
"aria-label": "Close menu",
|
|
4455
|
-
children: /* @__PURE__ */ (0,
|
|
4644
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react4.X, { className: "w-5 h-5" })
|
|
4456
4645
|
}
|
|
4457
4646
|
)
|
|
4458
4647
|
]
|
|
4459
4648
|
}
|
|
4460
4649
|
),
|
|
4461
|
-
/* @__PURE__ */ (0,
|
|
4650
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("nav", { className: "px-3 py-4", children: useSections.map((section, sectionIndex) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4462
4651
|
"div",
|
|
4463
4652
|
{
|
|
4464
4653
|
style: {
|
|
4465
4654
|
paddingTop: sectionIndex > 0 ? "var(--drawer-section-padding-y)" : "0"
|
|
4466
4655
|
},
|
|
4467
4656
|
children: [
|
|
4468
|
-
section.title && /* @__PURE__ */ (0,
|
|
4657
|
+
section.title && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4469
4658
|
"h3",
|
|
4470
4659
|
{
|
|
4471
4660
|
className: "font-semibold uppercase tracking-wide text-caption",
|
|
@@ -4477,7 +4666,7 @@ function Drawer({
|
|
|
4477
4666
|
children: section.title
|
|
4478
4667
|
}
|
|
4479
4668
|
),
|
|
4480
|
-
/* @__PURE__ */ (0,
|
|
4669
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4481
4670
|
"ul",
|
|
4482
4671
|
{
|
|
4483
4672
|
style: {
|
|
@@ -4485,7 +4674,7 @@ function Drawer({
|
|
|
4485
4674
|
flexDirection: "column",
|
|
4486
4675
|
gap: "var(--drawer-item-spacing)"
|
|
4487
4676
|
},
|
|
4488
|
-
children: section.items.map((item) => /* @__PURE__ */ (0,
|
|
4677
|
+
children: section.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4489
4678
|
"button",
|
|
4490
4679
|
{
|
|
4491
4680
|
onClick: () => handleItemClick(item.id),
|
|
@@ -4513,8 +4702,8 @@ function Drawer({
|
|
|
4513
4702
|
boxShadow: activeItem === item.id ? "0 1px 3px rgba(0,0,0,0.1)" : "none"
|
|
4514
4703
|
},
|
|
4515
4704
|
children: [
|
|
4516
|
-
item.icon && /* @__PURE__ */ (0,
|
|
4517
|
-
/* @__PURE__ */ (0,
|
|
4705
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "shrink-0 opacity-75", children: item.icon }),
|
|
4706
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { children: item.label })
|
|
4518
4707
|
]
|
|
4519
4708
|
}
|
|
4520
4709
|
) }, item.id))
|
|
@@ -4524,7 +4713,7 @@ function Drawer({
|
|
|
4524
4713
|
},
|
|
4525
4714
|
sectionIndex
|
|
4526
4715
|
)) }),
|
|
4527
|
-
footer && /* @__PURE__ */ (0,
|
|
4716
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4528
4717
|
"div",
|
|
4529
4718
|
{
|
|
4530
4719
|
className: "p-4 mt-auto",
|
|
@@ -4541,7 +4730,7 @@ function Drawer({
|
|
|
4541
4730
|
// src/layout/sidebar-nav.tsx
|
|
4542
4731
|
var import_lucide_react5 = require("lucide-react");
|
|
4543
4732
|
var import_react23 = require("react");
|
|
4544
|
-
var
|
|
4733
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
4545
4734
|
function SidebarNav({
|
|
4546
4735
|
title,
|
|
4547
4736
|
subtitle,
|
|
@@ -4559,29 +4748,29 @@ function SidebarNav({
|
|
|
4559
4748
|
setMobileMenuOpen(false);
|
|
4560
4749
|
};
|
|
4561
4750
|
const useSections = sections || (items ? [{ title: "", items }] : []);
|
|
4562
|
-
return /* @__PURE__ */ (0,
|
|
4563
|
-
/* @__PURE__ */ (0,
|
|
4751
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
4752
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "lg:hidden fixed top-0 left-0 right-0 [z-index:var(--z-index-nav)] bg-(--color-background) border-b border-(--color-border) px-4 py-3", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
4564
4753
|
"div",
|
|
4565
4754
|
{
|
|
4566
4755
|
className: `flex items-center ${isLeft ? "justify-between" : "justify-between flex-row-reverse"}`,
|
|
4567
4756
|
children: [
|
|
4568
|
-
/* @__PURE__ */ (0,
|
|
4757
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4569
4758
|
"button",
|
|
4570
4759
|
{
|
|
4571
4760
|
onClick: () => setMobileMenuOpen(!mobileMenuOpen),
|
|
4572
4761
|
className: "p-2 rounded-lg hover:bg-(--color-muted) transition-colors",
|
|
4573
4762
|
"aria-label": "Toggle menu",
|
|
4574
|
-
children: mobileMenuOpen ? /* @__PURE__ */ (0,
|
|
4763
|
+
children: mobileMenuOpen ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react5.X, { className: "w-6 h-6 text-(--color-muted-foreground)" }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react5.Menu, { className: "w-6 h-6 text-(--color-muted-foreground)" })
|
|
4575
4764
|
}
|
|
4576
4765
|
),
|
|
4577
|
-
/* @__PURE__ */ (0,
|
|
4578
|
-
/* @__PURE__ */ (0,
|
|
4579
|
-
subtitle && /* @__PURE__ */ (0,
|
|
4766
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { children: [
|
|
4767
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h1", { className: "text-h4 font-bold text-(--color-foreground)", children: title }),
|
|
4768
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-caption text-(--color-muted-foreground)", children: subtitle })
|
|
4580
4769
|
] })
|
|
4581
4770
|
]
|
|
4582
4771
|
}
|
|
4583
4772
|
) }),
|
|
4584
|
-
mobileMenuOpen && /* @__PURE__ */ (0,
|
|
4773
|
+
mobileMenuOpen && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4585
4774
|
"div",
|
|
4586
4775
|
{
|
|
4587
4776
|
className: "fixed inset-0 bg-black/50 lg:hidden",
|
|
@@ -4589,7 +4778,7 @@ function SidebarNav({
|
|
|
4589
4778
|
onClick: () => setMobileMenuOpen(false)
|
|
4590
4779
|
}
|
|
4591
4780
|
),
|
|
4592
|
-
/* @__PURE__ */ (0,
|
|
4781
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
4593
4782
|
"aside",
|
|
4594
4783
|
{
|
|
4595
4784
|
className: `
|
|
@@ -4600,18 +4789,18 @@ function SidebarNav({
|
|
|
4600
4789
|
${mobileMenuOpen ? "translate-x-0" : `${isLeft ? "-translate-x-full" : "translate-x-full"} lg:translate-x-0`}
|
|
4601
4790
|
`,
|
|
4602
4791
|
children: [
|
|
4603
|
-
/* @__PURE__ */ (0,
|
|
4604
|
-
/* @__PURE__ */ (0,
|
|
4605
|
-
subtitle && /* @__PURE__ */ (0,
|
|
4792
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "hidden lg:block p-6 border-b border-(--color-border)", children: [
|
|
4793
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h1", { className: "text-h3 font-bold text-(--color-foreground)", children: title }),
|
|
4794
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-caption text-(--color-muted-foreground) mt-1", children: subtitle })
|
|
4606
4795
|
] }),
|
|
4607
|
-
/* @__PURE__ */ (0,
|
|
4608
|
-
/* @__PURE__ */ (0,
|
|
4796
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "lg:hidden h-[57px]", "aria-hidden": "true" }),
|
|
4797
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("nav", { className: "p-4", children: useSections.map((section, sectionIndex) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
4609
4798
|
"div",
|
|
4610
4799
|
{
|
|
4611
4800
|
className: sectionIndex > 0 ? "mt-6" : "",
|
|
4612
4801
|
children: [
|
|
4613
|
-
section.title && /* @__PURE__ */ (0,
|
|
4614
|
-
/* @__PURE__ */ (0,
|
|
4802
|
+
section.title && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h3", { className: "px-4 mb-2 text-caption font-semibold text-(--color-muted-foreground) uppercase tracking-wider", children: section.title }),
|
|
4803
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("ul", { className: "space-y-1", children: section.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
4615
4804
|
"button",
|
|
4616
4805
|
{
|
|
4617
4806
|
onClick: () => handleItemClick(item.id),
|
|
@@ -4620,8 +4809,8 @@ function SidebarNav({
|
|
|
4620
4809
|
${activeItem === item.id ? "bg-[color-mix(in_srgb,var(--color-primary)_10%,transparent)] text-(--color-primary)" : "text-(--color-muted-foreground) hover:bg-(--color-muted)"}
|
|
4621
4810
|
`,
|
|
4622
4811
|
children: [
|
|
4623
|
-
item.icon && /* @__PURE__ */ (0,
|
|
4624
|
-
/* @__PURE__ */ (0,
|
|
4812
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "shrink-0", children: item.icon }),
|
|
4813
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: item.label })
|
|
4625
4814
|
]
|
|
4626
4815
|
}
|
|
4627
4816
|
) }, item.id)) })
|
|
@@ -4629,7 +4818,7 @@ function SidebarNav({
|
|
|
4629
4818
|
},
|
|
4630
4819
|
sectionIndex
|
|
4631
4820
|
)) }),
|
|
4632
|
-
footer && /* @__PURE__ */ (0,
|
|
4821
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "p-4 border-t border-(--color-border) mt-auto", children: footer })
|
|
4633
4822
|
]
|
|
4634
4823
|
}
|
|
4635
4824
|
)
|
|
@@ -4638,10 +4827,10 @@ function SidebarNav({
|
|
|
4638
4827
|
|
|
4639
4828
|
// src/shared/empty-state.tsx
|
|
4640
4829
|
var import_react24 = __toESM(require("react"));
|
|
4641
|
-
var
|
|
4830
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
4642
4831
|
var EmptyState = import_react24.default.forwardRef(
|
|
4643
4832
|
({ className, icon, title, description, action, ...props }, ref) => {
|
|
4644
|
-
return /* @__PURE__ */ (0,
|
|
4833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
4645
4834
|
"div",
|
|
4646
4835
|
{
|
|
4647
4836
|
ref,
|
|
@@ -4651,10 +4840,10 @@ var EmptyState = import_react24.default.forwardRef(
|
|
|
4651
4840
|
),
|
|
4652
4841
|
...props,
|
|
4653
4842
|
children: [
|
|
4654
|
-
icon && /* @__PURE__ */ (0,
|
|
4655
|
-
/* @__PURE__ */ (0,
|
|
4656
|
-
description && /* @__PURE__ */ (0,
|
|
4657
|
-
action && /* @__PURE__ */ (0,
|
|
4843
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "mb-4 text-(--color-placeholder)", children: icon }),
|
|
4844
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h3", { className: "text-h4 font-semibold text-(--color-foreground) mb-2", children: title }),
|
|
4845
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-small text-(--color-muted-foreground) mb-6 max-w-sm", children: description }),
|
|
4846
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { children: action })
|
|
4658
4847
|
]
|
|
4659
4848
|
}
|
|
4660
4849
|
);
|
|
@@ -4897,7 +5086,7 @@ var themes2 = {
|
|
|
4897
5086
|
var themes_default = themes2;
|
|
4898
5087
|
|
|
4899
5088
|
// src/contexts/ThemeProvider.tsx
|
|
4900
|
-
var
|
|
5089
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
4901
5090
|
var ThemeContext = (0, import_react25.createContext)(void 0);
|
|
4902
5091
|
var themeRegistry = themes_default;
|
|
4903
5092
|
var getInitialTheme = (defaultTheme = "dark") => {
|
|
@@ -5026,7 +5215,7 @@ function ThemeProvider({
|
|
|
5026
5215
|
applyTheme(theme);
|
|
5027
5216
|
}
|
|
5028
5217
|
}, [currentTheme, customTheme, applyTheme]);
|
|
5029
|
-
return /* @__PURE__ */ (0,
|
|
5218
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
5030
5219
|
ThemeContext.Provider,
|
|
5031
5220
|
{
|
|
5032
5221
|
value: {
|
|
@@ -5080,6 +5269,7 @@ function useTheme() {
|
|
|
5080
5269
|
FormControlLabel,
|
|
5081
5270
|
FormHelperText,
|
|
5082
5271
|
Input,
|
|
5272
|
+
NativeSelect,
|
|
5083
5273
|
Nav,
|
|
5084
5274
|
RadioGroup,
|
|
5085
5275
|
Rating,
|