@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.mjs
CHANGED
|
@@ -2084,6 +2084,9 @@ function Select({
|
|
|
2084
2084
|
const [isOpen, setIsOpen] = useState7(false);
|
|
2085
2085
|
const dropdownRef = useRef5(null);
|
|
2086
2086
|
const [validationError, _setValidationError] = useState7();
|
|
2087
|
+
const [focusedIndex, setFocusedIndex] = useState7(-1);
|
|
2088
|
+
const [searchString, setSearchString] = useState7("");
|
|
2089
|
+
const searchTimeoutRef = useRef5();
|
|
2087
2090
|
let value;
|
|
2088
2091
|
let displayError;
|
|
2089
2092
|
if (form && name) {
|
|
@@ -2168,9 +2171,68 @@ function Select({
|
|
|
2168
2171
|
if (disabled) return;
|
|
2169
2172
|
if (e.key === "Enter" || e.key === " ") {
|
|
2170
2173
|
e.preventDefault();
|
|
2171
|
-
|
|
2174
|
+
if (!isOpen) {
|
|
2175
|
+
setIsOpen(true);
|
|
2176
|
+
const currentIndex = options.findIndex(
|
|
2177
|
+
(opt) => opt.value === value
|
|
2178
|
+
);
|
|
2179
|
+
setFocusedIndex(currentIndex);
|
|
2180
|
+
} else if (focusedIndex >= 0 && focusedIndex < options.length) {
|
|
2181
|
+
handleSelect(options[focusedIndex].value);
|
|
2182
|
+
}
|
|
2172
2183
|
} else if (e.key === "Escape") {
|
|
2173
2184
|
setIsOpen(false);
|
|
2185
|
+
setFocusedIndex(-1);
|
|
2186
|
+
} else if (e.key === "ArrowDown") {
|
|
2187
|
+
e.preventDefault();
|
|
2188
|
+
if (!isOpen) {
|
|
2189
|
+
const currentIndex = options.findIndex(
|
|
2190
|
+
(opt) => opt.value === value
|
|
2191
|
+
);
|
|
2192
|
+
const nextIndex = currentIndex < options.length - 1 ? currentIndex + 1 : currentIndex;
|
|
2193
|
+
if (nextIndex !== currentIndex && options[nextIndex]) {
|
|
2194
|
+
handleSelect(options[nextIndex].value);
|
|
2195
|
+
} else if (currentIndex === -1 && options.length > 0) {
|
|
2196
|
+
handleSelect(options[0].value);
|
|
2197
|
+
}
|
|
2198
|
+
} else {
|
|
2199
|
+
setFocusedIndex(
|
|
2200
|
+
(prev) => prev < options.length - 1 ? prev + 1 : prev
|
|
2201
|
+
);
|
|
2202
|
+
}
|
|
2203
|
+
} else if (e.key === "ArrowUp") {
|
|
2204
|
+
e.preventDefault();
|
|
2205
|
+
if (!isOpen) {
|
|
2206
|
+
const currentIndex = options.findIndex(
|
|
2207
|
+
(opt) => opt.value === value
|
|
2208
|
+
);
|
|
2209
|
+
const prevIndex = currentIndex > 0 ? currentIndex - 1 : currentIndex;
|
|
2210
|
+
if (prevIndex !== currentIndex && options[prevIndex]) {
|
|
2211
|
+
handleSelect(options[prevIndex].value);
|
|
2212
|
+
}
|
|
2213
|
+
} else {
|
|
2214
|
+
setFocusedIndex((prev) => prev > 0 ? prev - 1 : 0);
|
|
2215
|
+
}
|
|
2216
|
+
} else if (e.key.length === 1 && /[a-z0-9]/i.test(e.key)) {
|
|
2217
|
+
e.preventDefault();
|
|
2218
|
+
if (searchTimeoutRef.current) {
|
|
2219
|
+
clearTimeout(searchTimeoutRef.current);
|
|
2220
|
+
}
|
|
2221
|
+
const newSearchString = searchString + e.key.toLowerCase();
|
|
2222
|
+
setSearchString(newSearchString);
|
|
2223
|
+
const matchIndex = options.findIndex(
|
|
2224
|
+
(opt) => opt.label.toLowerCase().startsWith(newSearchString)
|
|
2225
|
+
);
|
|
2226
|
+
if (matchIndex >= 0) {
|
|
2227
|
+
if (!isOpen) {
|
|
2228
|
+
handleSelect(options[matchIndex].value);
|
|
2229
|
+
} else {
|
|
2230
|
+
setFocusedIndex(matchIndex);
|
|
2231
|
+
}
|
|
2232
|
+
}
|
|
2233
|
+
searchTimeoutRef.current = setTimeout(() => {
|
|
2234
|
+
setSearchString("");
|
|
2235
|
+
}, 1e3);
|
|
2174
2236
|
}
|
|
2175
2237
|
};
|
|
2176
2238
|
return /* @__PURE__ */ jsxs9(
|
|
@@ -2190,6 +2252,15 @@ function Select({
|
|
|
2190
2252
|
]
|
|
2191
2253
|
}
|
|
2192
2254
|
),
|
|
2255
|
+
name && /* @__PURE__ */ jsx10(
|
|
2256
|
+
"input",
|
|
2257
|
+
{
|
|
2258
|
+
type: "hidden",
|
|
2259
|
+
name,
|
|
2260
|
+
value: value ?? "",
|
|
2261
|
+
required
|
|
2262
|
+
}
|
|
2263
|
+
),
|
|
2193
2264
|
/* @__PURE__ */ jsxs9("div", { ref: dropdownRef, className: "relative", children: [
|
|
2194
2265
|
/* @__PURE__ */ jsxs9(
|
|
2195
2266
|
"button",
|
|
@@ -2261,16 +2332,17 @@ function Select({
|
|
|
2261
2332
|
children: placeholder
|
|
2262
2333
|
}
|
|
2263
2334
|
) }, "__placeholder__"),
|
|
2264
|
-
options.map((option) => /* @__PURE__ */ jsx10("li", { children: /* @__PURE__ */ jsx10(
|
|
2335
|
+
options.map((option, index) => /* @__PURE__ */ jsx10("li", { children: /* @__PURE__ */ jsx10(
|
|
2265
2336
|
"button",
|
|
2266
2337
|
{
|
|
2267
2338
|
type: "button",
|
|
2268
2339
|
onClick: () => !option.disabled && handleSelect(option.value),
|
|
2269
2340
|
disabled: option.disabled,
|
|
2341
|
+
onMouseEnter: () => setFocusedIndex(index),
|
|
2270
2342
|
className: `
|
|
2271
2343
|
w-full ${optionSizeStyles[size]} text-left
|
|
2272
2344
|
transition-colors duration-150
|
|
2273
|
-
${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)"}
|
|
2345
|
+
${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)"}
|
|
2274
2346
|
${option.disabled ? "opacity-50 cursor-not-allowed" : ""}
|
|
2275
2347
|
`,
|
|
2276
2348
|
role: "option",
|
|
@@ -2295,9 +2367,123 @@ function Select({
|
|
|
2295
2367
|
);
|
|
2296
2368
|
}
|
|
2297
2369
|
|
|
2370
|
+
// src/ui/native-select.tsx
|
|
2371
|
+
import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2372
|
+
function NativeSelect({
|
|
2373
|
+
name,
|
|
2374
|
+
label,
|
|
2375
|
+
value: externalValue,
|
|
2376
|
+
onChange,
|
|
2377
|
+
children,
|
|
2378
|
+
error,
|
|
2379
|
+
helperText,
|
|
2380
|
+
required = false,
|
|
2381
|
+
size = "md",
|
|
2382
|
+
className = "",
|
|
2383
|
+
validate,
|
|
2384
|
+
errorMessage,
|
|
2385
|
+
disabled = false,
|
|
2386
|
+
...htmlProps
|
|
2387
|
+
}) {
|
|
2388
|
+
const form = useForm();
|
|
2389
|
+
let value;
|
|
2390
|
+
let displayError;
|
|
2391
|
+
if (form && name) {
|
|
2392
|
+
value = form.values[name] ?? externalValue;
|
|
2393
|
+
displayError = form.shouldShowError(name) ? form.getFieldError(name) : void 0;
|
|
2394
|
+
} else {
|
|
2395
|
+
value = externalValue;
|
|
2396
|
+
displayError = error;
|
|
2397
|
+
}
|
|
2398
|
+
if (form && name) {
|
|
2399
|
+
const validator = async (val) => {
|
|
2400
|
+
if (required && (val === void 0 || val === null || val === "")) {
|
|
2401
|
+
return errorMessage || "Please select an option";
|
|
2402
|
+
}
|
|
2403
|
+
if (validate) {
|
|
2404
|
+
return await validate(val);
|
|
2405
|
+
}
|
|
2406
|
+
return void 0;
|
|
2407
|
+
};
|
|
2408
|
+
form.registerField(name, validator);
|
|
2409
|
+
}
|
|
2410
|
+
const handleChange = (e) => {
|
|
2411
|
+
const newValue = e.target.value;
|
|
2412
|
+
if (form && name) {
|
|
2413
|
+
form.setFieldValue(name, newValue);
|
|
2414
|
+
form.setFieldTouched(name, true);
|
|
2415
|
+
form.validateField(name, newValue);
|
|
2416
|
+
} else {
|
|
2417
|
+
onChange?.(newValue);
|
|
2418
|
+
}
|
|
2419
|
+
};
|
|
2420
|
+
const sizeStyles = {
|
|
2421
|
+
xs: "px-2 py-1.5 text-xs",
|
|
2422
|
+
sm: "px-2.5 py-2 text-sm",
|
|
2423
|
+
md: "px-3 py-2.5 text-base",
|
|
2424
|
+
lg: "px-4 py-3 text-lg",
|
|
2425
|
+
xl: "px-5 py-3.5 text-xl"
|
|
2426
|
+
};
|
|
2427
|
+
return /* @__PURE__ */ jsxs10(
|
|
2428
|
+
"div",
|
|
2429
|
+
{
|
|
2430
|
+
className: `w-full ${className}`,
|
|
2431
|
+
style: { marginBottom: "var(--form-control-spacing)" },
|
|
2432
|
+
children: [
|
|
2433
|
+
label && /* @__PURE__ */ jsxs10(
|
|
2434
|
+
"label",
|
|
2435
|
+
{
|
|
2436
|
+
className: "block text-small font-semibold mb-1",
|
|
2437
|
+
style: { color: "var(--color-muted-foreground)" },
|
|
2438
|
+
children: [
|
|
2439
|
+
label,
|
|
2440
|
+
required && /* @__PURE__ */ jsx11("span", { className: "ml-1 text-error", children: "*" })
|
|
2441
|
+
]
|
|
2442
|
+
}
|
|
2443
|
+
),
|
|
2444
|
+
/* @__PURE__ */ jsx11(
|
|
2445
|
+
"select",
|
|
2446
|
+
{
|
|
2447
|
+
name,
|
|
2448
|
+
value: value ?? "",
|
|
2449
|
+
onChange: handleChange,
|
|
2450
|
+
disabled,
|
|
2451
|
+
required,
|
|
2452
|
+
className: `
|
|
2453
|
+
w-full ${sizeStyles[size]}
|
|
2454
|
+
bg-(--color-background)
|
|
2455
|
+
border rounded-(--dropdown-radius)
|
|
2456
|
+
transition-all duration-200
|
|
2457
|
+
appearance-none
|
|
2458
|
+
cursor-pointer
|
|
2459
|
+
${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)"}
|
|
2460
|
+
${disabled ? "bg-(--color-muted) cursor-not-allowed opacity-60" : "hover:border-(--color-primary)"}
|
|
2461
|
+
${!value ? "text-(--color-placeholder)" : "text-(--color-foreground)"}
|
|
2462
|
+
pr-10
|
|
2463
|
+
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')]
|
|
2464
|
+
bg-[length:1.25rem_1.25rem]
|
|
2465
|
+
bg-[position:right_0.5rem_center]
|
|
2466
|
+
bg-no-repeat
|
|
2467
|
+
`,
|
|
2468
|
+
...htmlProps,
|
|
2469
|
+
children
|
|
2470
|
+
}
|
|
2471
|
+
),
|
|
2472
|
+
/* @__PURE__ */ jsx11("div", { className: "h-5 mt-1.5", children: (helperText || displayError) && /* @__PURE__ */ jsx11(
|
|
2473
|
+
"p",
|
|
2474
|
+
{
|
|
2475
|
+
className: `text-small ${displayError ? "text-error" : "text-(--color-muted-foreground)"}`,
|
|
2476
|
+
children: displayError || helperText
|
|
2477
|
+
}
|
|
2478
|
+
) })
|
|
2479
|
+
]
|
|
2480
|
+
}
|
|
2481
|
+
);
|
|
2482
|
+
}
|
|
2483
|
+
|
|
2298
2484
|
// src/ui/spinner.tsx
|
|
2299
2485
|
import React7 from "react";
|
|
2300
|
-
import { jsx as
|
|
2486
|
+
import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2301
2487
|
var Spinner = React7.forwardRef(
|
|
2302
2488
|
({ className, size = "md", color = "primary", label, ...props }, ref) => {
|
|
2303
2489
|
const sizes = {
|
|
@@ -2311,7 +2497,7 @@ var Spinner = React7.forwardRef(
|
|
|
2311
2497
|
secondary: "text-(--color-muted-foreground)",
|
|
2312
2498
|
white: "text-white"
|
|
2313
2499
|
};
|
|
2314
|
-
return /* @__PURE__ */
|
|
2500
|
+
return /* @__PURE__ */ jsxs11(
|
|
2315
2501
|
"div",
|
|
2316
2502
|
{
|
|
2317
2503
|
ref,
|
|
@@ -2321,7 +2507,7 @@ var Spinner = React7.forwardRef(
|
|
|
2321
2507
|
),
|
|
2322
2508
|
...props,
|
|
2323
2509
|
children: [
|
|
2324
|
-
/* @__PURE__ */
|
|
2510
|
+
/* @__PURE__ */ jsxs11(
|
|
2325
2511
|
"svg",
|
|
2326
2512
|
{
|
|
2327
2513
|
className: cn("animate-spin", sizes[size], colors[color]),
|
|
@@ -2329,7 +2515,7 @@ var Spinner = React7.forwardRef(
|
|
|
2329
2515
|
fill: "none",
|
|
2330
2516
|
viewBox: "0 0 24 24",
|
|
2331
2517
|
children: [
|
|
2332
|
-
/* @__PURE__ */
|
|
2518
|
+
/* @__PURE__ */ jsx12(
|
|
2333
2519
|
"circle",
|
|
2334
2520
|
{
|
|
2335
2521
|
className: "opacity-25",
|
|
@@ -2340,7 +2526,7 @@ var Spinner = React7.forwardRef(
|
|
|
2340
2526
|
strokeWidth: "4"
|
|
2341
2527
|
}
|
|
2342
2528
|
),
|
|
2343
|
-
/* @__PURE__ */
|
|
2529
|
+
/* @__PURE__ */ jsx12(
|
|
2344
2530
|
"path",
|
|
2345
2531
|
{
|
|
2346
2532
|
className: "opacity-75",
|
|
@@ -2351,7 +2537,7 @@ var Spinner = React7.forwardRef(
|
|
|
2351
2537
|
]
|
|
2352
2538
|
}
|
|
2353
2539
|
),
|
|
2354
|
-
label && /* @__PURE__ */
|
|
2540
|
+
label && /* @__PURE__ */ jsx12("p", { className: "text-small text-(--color-muted-foreground)", children: label })
|
|
2355
2541
|
]
|
|
2356
2542
|
}
|
|
2357
2543
|
);
|
|
@@ -2362,7 +2548,7 @@ Spinner.displayName = "Spinner";
|
|
|
2362
2548
|
// src/ui/code-snippet.tsx
|
|
2363
2549
|
import { Highlight, themes } from "prism-react-renderer";
|
|
2364
2550
|
import { useState as useState8 } from "react";
|
|
2365
|
-
import { jsx as
|
|
2551
|
+
import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2366
2552
|
function CodeSnippet({
|
|
2367
2553
|
code,
|
|
2368
2554
|
language = "tsx",
|
|
@@ -2385,9 +2571,9 @@ function CodeSnippet({
|
|
|
2385
2571
|
console.error("Failed to copy:", err);
|
|
2386
2572
|
}
|
|
2387
2573
|
};
|
|
2388
|
-
return /* @__PURE__ */
|
|
2389
|
-
/* @__PURE__ */
|
|
2390
|
-
/* @__PURE__ */
|
|
2574
|
+
return /* @__PURE__ */ jsxs12("div", { className: "relative group w-full", children: [
|
|
2575
|
+
/* @__PURE__ */ jsxs12("div", { className: "absolute right-3 top-3 [z-index:var(--z-index-code-button)]", children: [
|
|
2576
|
+
/* @__PURE__ */ jsx13(
|
|
2391
2577
|
"button",
|
|
2392
2578
|
{
|
|
2393
2579
|
onClick: handleCopy,
|
|
@@ -2397,14 +2583,14 @@ function CodeSnippet({
|
|
|
2397
2583
|
"aria-label": "Copy code",
|
|
2398
2584
|
children: copied ? (
|
|
2399
2585
|
// Check icon
|
|
2400
|
-
/* @__PURE__ */
|
|
2586
|
+
/* @__PURE__ */ jsx13(
|
|
2401
2587
|
"svg",
|
|
2402
2588
|
{
|
|
2403
2589
|
className: "w-4 h-4 text-green-400",
|
|
2404
2590
|
fill: "none",
|
|
2405
2591
|
stroke: "currentColor",
|
|
2406
2592
|
viewBox: "0 0 24 24",
|
|
2407
|
-
children: /* @__PURE__ */
|
|
2593
|
+
children: /* @__PURE__ */ jsx13(
|
|
2408
2594
|
"path",
|
|
2409
2595
|
{
|
|
2410
2596
|
strokeLinecap: "round",
|
|
@@ -2417,14 +2603,14 @@ function CodeSnippet({
|
|
|
2417
2603
|
)
|
|
2418
2604
|
) : (
|
|
2419
2605
|
// Copy icon
|
|
2420
|
-
/* @__PURE__ */
|
|
2606
|
+
/* @__PURE__ */ jsx13(
|
|
2421
2607
|
"svg",
|
|
2422
2608
|
{
|
|
2423
2609
|
className: "w-4 h-4",
|
|
2424
2610
|
fill: "none",
|
|
2425
2611
|
stroke: "currentColor",
|
|
2426
2612
|
viewBox: "0 0 24 24",
|
|
2427
|
-
children: /* @__PURE__ */
|
|
2613
|
+
children: /* @__PURE__ */ jsx13(
|
|
2428
2614
|
"path",
|
|
2429
2615
|
{
|
|
2430
2616
|
strokeLinecap: "round",
|
|
@@ -2438,26 +2624,26 @@ function CodeSnippet({
|
|
|
2438
2624
|
)
|
|
2439
2625
|
}
|
|
2440
2626
|
),
|
|
2441
|
-
showTooltip && !copied && /* @__PURE__ */
|
|
2627
|
+
showTooltip && !copied && /* @__PURE__ */ jsxs12("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: [
|
|
2442
2628
|
"Copy code",
|
|
2443
|
-
/* @__PURE__ */
|
|
2629
|
+
/* @__PURE__ */ jsx13("div", { className: "absolute -top-1 right-3 w-2 h-2 bg-[#1f2937] border-l border-t border-[#374151] transform rotate-45" })
|
|
2444
2630
|
] }),
|
|
2445
|
-
copied && /* @__PURE__ */
|
|
2631
|
+
copied && /* @__PURE__ */ jsxs12("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: [
|
|
2446
2632
|
"Copied!",
|
|
2447
|
-
/* @__PURE__ */
|
|
2633
|
+
/* @__PURE__ */ jsx13("div", { className: "absolute -top-1 right-3 w-2 h-2 bg-green-600 transform rotate-45" })
|
|
2448
2634
|
] })
|
|
2449
2635
|
] }),
|
|
2450
|
-
/* @__PURE__ */
|
|
2636
|
+
/* @__PURE__ */ jsx13(
|
|
2451
2637
|
"div",
|
|
2452
2638
|
{
|
|
2453
2639
|
className: `rounded-lg overflow-x-auto border border-[#1f2937] ${fontSizeClassMap[fontSize]} code-snippet-${fontSize}`,
|
|
2454
|
-
children: /* @__PURE__ */
|
|
2640
|
+
children: /* @__PURE__ */ jsx13(
|
|
2455
2641
|
Highlight,
|
|
2456
2642
|
{
|
|
2457
2643
|
theme: themes.vsDark,
|
|
2458
2644
|
code,
|
|
2459
2645
|
language,
|
|
2460
|
-
children: ({ style, tokens, getLineProps, getTokenProps }) => /* @__PURE__ */
|
|
2646
|
+
children: ({ style, tokens, getLineProps, getTokenProps }) => /* @__PURE__ */ jsx13(
|
|
2461
2647
|
"pre",
|
|
2462
2648
|
{
|
|
2463
2649
|
style: {
|
|
@@ -2469,7 +2655,7 @@ function CodeSnippet({
|
|
|
2469
2655
|
whiteSpace: wrap ? "pre-wrap" : "pre",
|
|
2470
2656
|
wordBreak: wrap ? "break-word" : "normal"
|
|
2471
2657
|
},
|
|
2472
|
-
children: tokens.map((line, i) => /* @__PURE__ */
|
|
2658
|
+
children: tokens.map((line, i) => /* @__PURE__ */ jsx13("div", { ...getLineProps({ line }), children: line.map((token, key) => /* @__PURE__ */ jsx13(
|
|
2473
2659
|
"span",
|
|
2474
2660
|
{
|
|
2475
2661
|
...getTokenProps({ token })
|
|
@@ -2488,7 +2674,7 @@ function CodeSnippet({
|
|
|
2488
2674
|
// src/ui/rating.tsx
|
|
2489
2675
|
import { Star } from "lucide-react";
|
|
2490
2676
|
import React8, { useId as useId5 } from "react";
|
|
2491
|
-
import { jsx as
|
|
2677
|
+
import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2492
2678
|
var Rating = ({
|
|
2493
2679
|
value,
|
|
2494
2680
|
max = 5,
|
|
@@ -2530,7 +2716,7 @@ var Rating = ({
|
|
|
2530
2716
|
const isHalf = displayValue >= i - 0.5 && displayValue < i;
|
|
2531
2717
|
const isEmpty = displayValue < i - 0.5;
|
|
2532
2718
|
stars.push(
|
|
2533
|
-
/* @__PURE__ */
|
|
2719
|
+
/* @__PURE__ */ jsxs13(
|
|
2534
2720
|
"span",
|
|
2535
2721
|
{
|
|
2536
2722
|
onClick: () => handleStarClick(i),
|
|
@@ -2563,7 +2749,7 @@ var Rating = ({
|
|
|
2563
2749
|
},
|
|
2564
2750
|
className: responsive ? "sm:w-(--star-size) sm:h-(--star-size) w-(--star-mobile-size) h-(--star-mobile-size)" : "",
|
|
2565
2751
|
children: [
|
|
2566
|
-
/* @__PURE__ */
|
|
2752
|
+
/* @__PURE__ */ jsx14(
|
|
2567
2753
|
Star,
|
|
2568
2754
|
{
|
|
2569
2755
|
size: displaySize,
|
|
@@ -2572,7 +2758,7 @@ var Rating = ({
|
|
|
2572
2758
|
style: { position: "absolute", left: 0, top: 0 }
|
|
2573
2759
|
}
|
|
2574
2760
|
),
|
|
2575
|
-
isFull && /* @__PURE__ */
|
|
2761
|
+
isFull && /* @__PURE__ */ jsx14(
|
|
2576
2762
|
Star,
|
|
2577
2763
|
{
|
|
2578
2764
|
size: displaySize,
|
|
@@ -2581,7 +2767,7 @@ var Rating = ({
|
|
|
2581
2767
|
style: { position: "absolute", left: 0, top: 0 }
|
|
2582
2768
|
}
|
|
2583
2769
|
),
|
|
2584
|
-
isHalf && /* @__PURE__ */
|
|
2770
|
+
isHalf && /* @__PURE__ */ jsxs13(
|
|
2585
2771
|
"svg",
|
|
2586
2772
|
{
|
|
2587
2773
|
width: displaySize,
|
|
@@ -2589,7 +2775,7 @@ var Rating = ({
|
|
|
2589
2775
|
viewBox: `0 0 ${displaySize} ${displaySize}`,
|
|
2590
2776
|
style: { position: "absolute", left: 0, top: 0 },
|
|
2591
2777
|
children: [
|
|
2592
|
-
/* @__PURE__ */
|
|
2778
|
+
/* @__PURE__ */ jsx14("defs", { children: /* @__PURE__ */ jsxs13(
|
|
2593
2779
|
"linearGradient",
|
|
2594
2780
|
{
|
|
2595
2781
|
id: `half-${uniqueId}-${i}`,
|
|
@@ -2598,12 +2784,12 @@ var Rating = ({
|
|
|
2598
2784
|
y1: "0",
|
|
2599
2785
|
y2: "0",
|
|
2600
2786
|
children: [
|
|
2601
|
-
/* @__PURE__ */
|
|
2602
|
-
/* @__PURE__ */
|
|
2787
|
+
/* @__PURE__ */ jsx14("stop", { offset: "50%", stopColor: color }),
|
|
2788
|
+
/* @__PURE__ */ jsx14("stop", { offset: "50%", stopColor: "transparent" })
|
|
2603
2789
|
]
|
|
2604
2790
|
}
|
|
2605
2791
|
) }),
|
|
2606
|
-
/* @__PURE__ */
|
|
2792
|
+
/* @__PURE__ */ jsx14(
|
|
2607
2793
|
Star,
|
|
2608
2794
|
{
|
|
2609
2795
|
size: displaySize,
|
|
@@ -2622,7 +2808,7 @@ var Rating = ({
|
|
|
2622
2808
|
}
|
|
2623
2809
|
const valueText = valueFormat === "fraction" ? `${value.toFixed(1)}/${max}` : value.toFixed(1);
|
|
2624
2810
|
if (showValue && valuePosition === "bottom") {
|
|
2625
|
-
return /* @__PURE__ */
|
|
2811
|
+
return /* @__PURE__ */ jsxs13(
|
|
2626
2812
|
"div",
|
|
2627
2813
|
{
|
|
2628
2814
|
className,
|
|
@@ -2633,7 +2819,7 @@ var Rating = ({
|
|
|
2633
2819
|
gap: gap * 2
|
|
2634
2820
|
},
|
|
2635
2821
|
children: [
|
|
2636
|
-
/* @__PURE__ */
|
|
2822
|
+
/* @__PURE__ */ jsx14(
|
|
2637
2823
|
"div",
|
|
2638
2824
|
{
|
|
2639
2825
|
style: {
|
|
@@ -2644,7 +2830,7 @@ var Rating = ({
|
|
|
2644
2830
|
children: stars
|
|
2645
2831
|
}
|
|
2646
2832
|
),
|
|
2647
|
-
/* @__PURE__ */
|
|
2833
|
+
/* @__PURE__ */ jsx14(
|
|
2648
2834
|
"span",
|
|
2649
2835
|
{
|
|
2650
2836
|
style: {
|
|
@@ -2659,7 +2845,7 @@ var Rating = ({
|
|
|
2659
2845
|
}
|
|
2660
2846
|
);
|
|
2661
2847
|
}
|
|
2662
|
-
return /* @__PURE__ */
|
|
2848
|
+
return /* @__PURE__ */ jsxs13(
|
|
2663
2849
|
"div",
|
|
2664
2850
|
{
|
|
2665
2851
|
className,
|
|
@@ -2672,7 +2858,7 @@ var Rating = ({
|
|
|
2672
2858
|
},
|
|
2673
2859
|
children: [
|
|
2674
2860
|
stars,
|
|
2675
|
-
showValue && /* @__PURE__ */
|
|
2861
|
+
showValue && /* @__PURE__ */ jsx14(
|
|
2676
2862
|
"span",
|
|
2677
2863
|
{
|
|
2678
2864
|
style: {
|
|
@@ -2690,7 +2876,7 @@ var Rating = ({
|
|
|
2690
2876
|
};
|
|
2691
2877
|
|
|
2692
2878
|
// src/ui/divider.tsx
|
|
2693
|
-
import { jsx as
|
|
2879
|
+
import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2694
2880
|
var Divider = ({
|
|
2695
2881
|
variant = "fullWidth",
|
|
2696
2882
|
orientation = "horizontal",
|
|
@@ -2720,21 +2906,21 @@ var Divider = ({
|
|
|
2720
2906
|
if (children) {
|
|
2721
2907
|
const leftLineClasses = textAlign === "left" ? `${baseClasses} ${orientationClasses}` : `flex-1 ${baseClasses} ${orientationClasses}`;
|
|
2722
2908
|
const rightLineClasses = textAlign === "right" ? `${baseClasses} ${orientationClasses}` : `flex-1 ${baseClasses} ${orientationClasses}`;
|
|
2723
|
-
return /* @__PURE__ */
|
|
2909
|
+
return /* @__PURE__ */ jsxs14(
|
|
2724
2910
|
"div",
|
|
2725
2911
|
{
|
|
2726
2912
|
role: "presentation",
|
|
2727
2913
|
className: `flex items-center gap-3 ${variantClasses[variant]} ${className}`,
|
|
2728
2914
|
children: [
|
|
2729
|
-
textAlign !== "left" && /* @__PURE__ */
|
|
2915
|
+
textAlign !== "left" && /* @__PURE__ */ jsx15(
|
|
2730
2916
|
"div",
|
|
2731
2917
|
{
|
|
2732
2918
|
style: { ...baseStyles, ...thicknessStyle },
|
|
2733
2919
|
className: leftLineClasses
|
|
2734
2920
|
}
|
|
2735
2921
|
),
|
|
2736
|
-
/* @__PURE__ */
|
|
2737
|
-
textAlign !== "right" && /* @__PURE__ */
|
|
2922
|
+
/* @__PURE__ */ jsx15("div", { style: textStyles, className: "whitespace-nowrap", children }),
|
|
2923
|
+
textAlign !== "right" && /* @__PURE__ */ jsx15(
|
|
2738
2924
|
"div",
|
|
2739
2925
|
{
|
|
2740
2926
|
style: { ...baseStyles, ...thicknessStyle },
|
|
@@ -2746,7 +2932,7 @@ var Divider = ({
|
|
|
2746
2932
|
);
|
|
2747
2933
|
}
|
|
2748
2934
|
if (isVertical) {
|
|
2749
|
-
return /* @__PURE__ */
|
|
2935
|
+
return /* @__PURE__ */ jsx15(
|
|
2750
2936
|
"div",
|
|
2751
2937
|
{
|
|
2752
2938
|
role: "separator",
|
|
@@ -2756,7 +2942,7 @@ var Divider = ({
|
|
|
2756
2942
|
}
|
|
2757
2943
|
);
|
|
2758
2944
|
}
|
|
2759
|
-
return /* @__PURE__ */
|
|
2945
|
+
return /* @__PURE__ */ jsx15(
|
|
2760
2946
|
"hr",
|
|
2761
2947
|
{
|
|
2762
2948
|
style: { ...baseStyles, ...thicknessStyle },
|
|
@@ -2767,7 +2953,7 @@ var Divider = ({
|
|
|
2767
2953
|
|
|
2768
2954
|
// src/ui/slider.tsx
|
|
2769
2955
|
import { useState as useState9, useRef as useRef6, useEffect as useEffect6 } from "react";
|
|
2770
|
-
import { jsx as
|
|
2956
|
+
import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2771
2957
|
var Slider = ({
|
|
2772
2958
|
value: controlledValue,
|
|
2773
2959
|
defaultValue = 0,
|
|
@@ -3005,7 +3191,7 @@ var Slider = ({
|
|
|
3005
3191
|
const showLabelAlways = valueLabelDisplay === "on";
|
|
3006
3192
|
const showLabelOnActiveOrHover = valueLabelDisplay === "auto";
|
|
3007
3193
|
const thumbStyle = isVertical ? { bottom: `${percent}%` } : { left: `${percent}%` };
|
|
3008
|
-
return /* @__PURE__ */
|
|
3194
|
+
return /* @__PURE__ */ jsxs15(
|
|
3009
3195
|
"div",
|
|
3010
3196
|
{
|
|
3011
3197
|
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`,
|
|
@@ -3013,19 +3199,19 @@ var Slider = ({
|
|
|
3013
3199
|
onMouseDown: handleMouseDown(index),
|
|
3014
3200
|
onTouchStart: handleMouseDown(index),
|
|
3015
3201
|
children: [
|
|
3016
|
-
/* @__PURE__ */
|
|
3202
|
+
/* @__PURE__ */ jsx16(
|
|
3017
3203
|
"div",
|
|
3018
3204
|
{
|
|
3019
3205
|
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" : ""}`
|
|
3020
3206
|
}
|
|
3021
3207
|
),
|
|
3022
|
-
showLabelAlways && /* @__PURE__ */
|
|
3208
|
+
showLabelAlways && /* @__PURE__ */ jsxs15(
|
|
3023
3209
|
"div",
|
|
3024
3210
|
{
|
|
3025
3211
|
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)`,
|
|
3026
3212
|
children: [
|
|
3027
3213
|
valueLabelFormat(val),
|
|
3028
|
-
/* @__PURE__ */
|
|
3214
|
+
/* @__PURE__ */ jsx16(
|
|
3029
3215
|
"div",
|
|
3030
3216
|
{
|
|
3031
3217
|
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"}`
|
|
@@ -3034,13 +3220,13 @@ var Slider = ({
|
|
|
3034
3220
|
]
|
|
3035
3221
|
}
|
|
3036
3222
|
),
|
|
3037
|
-
showLabelOnActiveOrHover && /* @__PURE__ */
|
|
3223
|
+
showLabelOnActiveOrHover && /* @__PURE__ */ jsxs15(
|
|
3038
3224
|
"div",
|
|
3039
3225
|
{
|
|
3040
3226
|
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)`,
|
|
3041
3227
|
children: [
|
|
3042
3228
|
valueLabelFormat(val),
|
|
3043
|
-
/* @__PURE__ */
|
|
3229
|
+
/* @__PURE__ */ jsx16(
|
|
3044
3230
|
"div",
|
|
3045
3231
|
{
|
|
3046
3232
|
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"}`
|
|
@@ -3058,13 +3244,13 @@ var Slider = ({
|
|
|
3058
3244
|
const hasMarkLabels = marksList.some((mark) => mark.label);
|
|
3059
3245
|
const containerClasses = isVertical ? "flex flex-col items-center py-4" : `flex items-center w-full px-2 ${hasMarkLabels ? "pb-6" : ""}`;
|
|
3060
3246
|
const railClasses = isVertical ? `${currentSizeStyles.rail} relative overflow-visible` : `w-full ${currentSizeStyles.rail} relative overflow-visible`;
|
|
3061
|
-
return /* @__PURE__ */
|
|
3247
|
+
return /* @__PURE__ */ jsxs15(
|
|
3062
3248
|
"div",
|
|
3063
3249
|
{
|
|
3064
3250
|
className: `${containerClasses} ${className}`,
|
|
3065
3251
|
style: isVertical ? { minHeight: "200px", height: "200px" } : void 0,
|
|
3066
3252
|
children: [
|
|
3067
|
-
/* @__PURE__ */
|
|
3253
|
+
/* @__PURE__ */ jsxs15(
|
|
3068
3254
|
"div",
|
|
3069
3255
|
{
|
|
3070
3256
|
ref: sliderRef,
|
|
@@ -3082,13 +3268,13 @@ var Slider = ({
|
|
|
3082
3268
|
"aria-orientation": orientation,
|
|
3083
3269
|
tabIndex: disabled ? -1 : 0,
|
|
3084
3270
|
children: [
|
|
3085
|
-
/* @__PURE__ */
|
|
3271
|
+
/* @__PURE__ */ jsx16(
|
|
3086
3272
|
"div",
|
|
3087
3273
|
{
|
|
3088
3274
|
className: `absolute ${isVertical ? "inset-x-0 h-full" : "inset-y-0 w-full"} bg-[#d1d5db] rounded-full ${disabled ? "opacity-50" : ""} z-0`
|
|
3089
3275
|
}
|
|
3090
3276
|
),
|
|
3091
|
-
track !== false && /* @__PURE__ */
|
|
3277
|
+
track !== false && /* @__PURE__ */ jsx16(
|
|
3092
3278
|
"div",
|
|
3093
3279
|
{
|
|
3094
3280
|
className: `absolute ${isVertical ? "inset-x-0" : "inset-y-0"} ${currentColorStyles.track} rounded-full ${disabled ? "opacity-50" : ""} z-0`,
|
|
@@ -3111,32 +3297,32 @@ var Slider = ({
|
|
|
3111
3297
|
}
|
|
3112
3298
|
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]";
|
|
3113
3299
|
const labelColor = isInSelectedRange ? currentColorStyles.labelSelected : currentColorStyles.labelUnselected;
|
|
3114
|
-
return /* @__PURE__ */
|
|
3300
|
+
return /* @__PURE__ */ jsxs15(
|
|
3115
3301
|
"div",
|
|
3116
3302
|
{
|
|
3117
3303
|
className: `group/mark absolute ${isVertical ? "left-1/2 -translate-x-1/2" : "top-1/2 -translate-y-1/2"} z-30`,
|
|
3118
3304
|
style: markStyle,
|
|
3119
3305
|
children: [
|
|
3120
|
-
/* @__PURE__ */
|
|
3306
|
+
/* @__PURE__ */ jsx16(
|
|
3121
3307
|
"div",
|
|
3122
3308
|
{
|
|
3123
3309
|
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"}`
|
|
3124
3310
|
}
|
|
3125
3311
|
),
|
|
3126
|
-
mark.label && /* @__PURE__ */
|
|
3312
|
+
mark.label && /* @__PURE__ */ jsx16(
|
|
3127
3313
|
"div",
|
|
3128
3314
|
{
|
|
3129
3315
|
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)`,
|
|
3130
3316
|
children: mark.label
|
|
3131
3317
|
}
|
|
3132
3318
|
),
|
|
3133
|
-
showMarkLabelsOnHover && !mark.label && /* @__PURE__ */
|
|
3319
|
+
showMarkLabelsOnHover && !mark.label && /* @__PURE__ */ jsxs15(
|
|
3134
3320
|
"div",
|
|
3135
3321
|
{
|
|
3136
3322
|
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)`,
|
|
3137
3323
|
children: [
|
|
3138
3324
|
valueLabelFormat(mark.value),
|
|
3139
|
-
/* @__PURE__ */
|
|
3325
|
+
/* @__PURE__ */ jsx16(
|
|
3140
3326
|
"div",
|
|
3141
3327
|
{
|
|
3142
3328
|
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"}`
|
|
@@ -3154,7 +3340,7 @@ var Slider = ({
|
|
|
3154
3340
|
]
|
|
3155
3341
|
}
|
|
3156
3342
|
),
|
|
3157
|
-
name && /* @__PURE__ */
|
|
3343
|
+
name && /* @__PURE__ */ jsx16(
|
|
3158
3344
|
"input",
|
|
3159
3345
|
{
|
|
3160
3346
|
type: "hidden",
|
|
@@ -3170,7 +3356,7 @@ var Slider = ({
|
|
|
3170
3356
|
|
|
3171
3357
|
// src/ui/switch.tsx
|
|
3172
3358
|
import { useState as useState10, useEffect as useEffect7 } from "react";
|
|
3173
|
-
import { Fragment as Fragment2, jsx as
|
|
3359
|
+
import { Fragment as Fragment2, jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3174
3360
|
function Switch({
|
|
3175
3361
|
checked: controlledChecked,
|
|
3176
3362
|
onChange,
|
|
@@ -3267,7 +3453,7 @@ function Switch({
|
|
|
3267
3453
|
top: "gap-2",
|
|
3268
3454
|
bottom: "gap-2"
|
|
3269
3455
|
};
|
|
3270
|
-
const switchElement = /* @__PURE__ */
|
|
3456
|
+
const switchElement = /* @__PURE__ */ jsx17(
|
|
3271
3457
|
"button",
|
|
3272
3458
|
{
|
|
3273
3459
|
type: "button",
|
|
@@ -3284,7 +3470,7 @@ function Switch({
|
|
|
3284
3470
|
disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:opacity-90",
|
|
3285
3471
|
checked && !disabled && "focus:ring-blue-500"
|
|
3286
3472
|
),
|
|
3287
|
-
children: /* @__PURE__ */
|
|
3473
|
+
children: /* @__PURE__ */ jsx17(
|
|
3288
3474
|
"span",
|
|
3289
3475
|
{
|
|
3290
3476
|
className: cn(
|
|
@@ -3297,9 +3483,9 @@ function Switch({
|
|
|
3297
3483
|
)
|
|
3298
3484
|
}
|
|
3299
3485
|
);
|
|
3300
|
-
const content = !label ? /* @__PURE__ */
|
|
3486
|
+
const content = !label ? /* @__PURE__ */ jsxs16(Fragment2, { children: [
|
|
3301
3487
|
switchElement,
|
|
3302
|
-
name && /* @__PURE__ */
|
|
3488
|
+
name && /* @__PURE__ */ jsx17(
|
|
3303
3489
|
"input",
|
|
3304
3490
|
{
|
|
3305
3491
|
type: "checkbox",
|
|
@@ -3311,7 +3497,7 @@ function Switch({
|
|
|
3311
3497
|
required
|
|
3312
3498
|
}
|
|
3313
3499
|
)
|
|
3314
|
-
] }) : /* @__PURE__ */
|
|
3500
|
+
] }) : /* @__PURE__ */ jsxs16(
|
|
3315
3501
|
"label",
|
|
3316
3502
|
{
|
|
3317
3503
|
className: cn(
|
|
@@ -3322,7 +3508,7 @@ function Switch({
|
|
|
3322
3508
|
),
|
|
3323
3509
|
children: [
|
|
3324
3510
|
switchElement,
|
|
3325
|
-
/* @__PURE__ */
|
|
3511
|
+
/* @__PURE__ */ jsxs16(
|
|
3326
3512
|
"span",
|
|
3327
3513
|
{
|
|
3328
3514
|
className: cn(
|
|
@@ -3332,11 +3518,11 @@ function Switch({
|
|
|
3332
3518
|
style: !disabled ? { color: "var(--color-muted-foreground)" } : void 0,
|
|
3333
3519
|
children: [
|
|
3334
3520
|
label,
|
|
3335
|
-
required && /* @__PURE__ */
|
|
3521
|
+
required && /* @__PURE__ */ jsx17("span", { className: "ml-1", children: "*" })
|
|
3336
3522
|
]
|
|
3337
3523
|
}
|
|
3338
3524
|
),
|
|
3339
|
-
name && /* @__PURE__ */
|
|
3525
|
+
name && /* @__PURE__ */ jsx17(
|
|
3340
3526
|
"input",
|
|
3341
3527
|
{
|
|
3342
3528
|
type: "checkbox",
|
|
@@ -3351,7 +3537,7 @@ function Switch({
|
|
|
3351
3537
|
]
|
|
3352
3538
|
}
|
|
3353
3539
|
);
|
|
3354
|
-
return /* @__PURE__ */
|
|
3540
|
+
return /* @__PURE__ */ jsx17(
|
|
3355
3541
|
"div",
|
|
3356
3542
|
{
|
|
3357
3543
|
className,
|
|
@@ -3365,7 +3551,7 @@ function Switch({
|
|
|
3365
3551
|
|
|
3366
3552
|
// src/ui/dialog.tsx
|
|
3367
3553
|
import React10, { useEffect as useEffect8 } from "react";
|
|
3368
|
-
import { jsx as
|
|
3554
|
+
import { jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3369
3555
|
var Dialog = ({
|
|
3370
3556
|
open,
|
|
3371
3557
|
onClose,
|
|
@@ -3416,14 +3602,14 @@ var Dialog = ({
|
|
|
3416
3602
|
onClose();
|
|
3417
3603
|
}
|
|
3418
3604
|
};
|
|
3419
|
-
return /* @__PURE__ */
|
|
3605
|
+
return /* @__PURE__ */ jsx18(
|
|
3420
3606
|
"div",
|
|
3421
3607
|
{
|
|
3422
3608
|
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",
|
|
3423
3609
|
onClick: handleBackdropClick,
|
|
3424
3610
|
role: "dialog",
|
|
3425
3611
|
"aria-modal": "true",
|
|
3426
|
-
children: /* @__PURE__ */
|
|
3612
|
+
children: /* @__PURE__ */ jsxs17(
|
|
3427
3613
|
"div",
|
|
3428
3614
|
{
|
|
3429
3615
|
className: cn(
|
|
@@ -3431,7 +3617,7 @@ var Dialog = ({
|
|
|
3431
3617
|
sizes[size]
|
|
3432
3618
|
),
|
|
3433
3619
|
children: [
|
|
3434
|
-
showCloseButton && /* @__PURE__ */
|
|
3620
|
+
showCloseButton && /* @__PURE__ */ jsx18(
|
|
3435
3621
|
"button",
|
|
3436
3622
|
{
|
|
3437
3623
|
onClick: onClose,
|
|
@@ -3474,14 +3660,14 @@ var Dialog = ({
|
|
|
3474
3660
|
},
|
|
3475
3661
|
className: "absolute right-2 top-2 p-1.5 rounded-full [z-index:var(--z-index-base)] focus:outline-none",
|
|
3476
3662
|
"aria-label": "Close dialog",
|
|
3477
|
-
children: /* @__PURE__ */
|
|
3663
|
+
children: /* @__PURE__ */ jsx18(
|
|
3478
3664
|
"svg",
|
|
3479
3665
|
{
|
|
3480
3666
|
className: "w-5 h-5",
|
|
3481
3667
|
fill: "none",
|
|
3482
3668
|
stroke: "currentColor",
|
|
3483
3669
|
viewBox: "0 0 24 24",
|
|
3484
|
-
children: /* @__PURE__ */
|
|
3670
|
+
children: /* @__PURE__ */ jsx18(
|
|
3485
3671
|
"path",
|
|
3486
3672
|
{
|
|
3487
3673
|
strokeLinecap: "round",
|
|
@@ -3494,7 +3680,7 @@ var Dialog = ({
|
|
|
3494
3680
|
)
|
|
3495
3681
|
}
|
|
3496
3682
|
),
|
|
3497
|
-
/* @__PURE__ */
|
|
3683
|
+
/* @__PURE__ */ jsx18(DialogContext.Provider, { value: { variant }, children })
|
|
3498
3684
|
]
|
|
3499
3685
|
}
|
|
3500
3686
|
)
|
|
@@ -3527,7 +3713,7 @@ var DialogHeader = React10.forwardRef(({ className, children, ...props }, ref) =
|
|
|
3527
3713
|
borderColor: "var(--color-error-border)"
|
|
3528
3714
|
}
|
|
3529
3715
|
};
|
|
3530
|
-
return /* @__PURE__ */
|
|
3716
|
+
return /* @__PURE__ */ jsx18(
|
|
3531
3717
|
"div",
|
|
3532
3718
|
{
|
|
3533
3719
|
ref,
|
|
@@ -3542,7 +3728,7 @@ var DialogHeader = React10.forwardRef(({ className, children, ...props }, ref) =
|
|
|
3542
3728
|
);
|
|
3543
3729
|
});
|
|
3544
3730
|
DialogHeader.displayName = "DialogHeader";
|
|
3545
|
-
var DialogTitle = React10.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
3731
|
+
var DialogTitle = React10.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx18(
|
|
3546
3732
|
"h2",
|
|
3547
3733
|
{
|
|
3548
3734
|
ref,
|
|
@@ -3555,7 +3741,7 @@ var DialogTitle = React10.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
3555
3741
|
}
|
|
3556
3742
|
));
|
|
3557
3743
|
DialogTitle.displayName = "DialogTitle";
|
|
3558
|
-
var DialogDescription = React10.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
3744
|
+
var DialogDescription = React10.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx18(
|
|
3559
3745
|
"p",
|
|
3560
3746
|
{
|
|
3561
3747
|
ref,
|
|
@@ -3565,9 +3751,9 @@ var DialogDescription = React10.forwardRef(({ className, children, ...props }, r
|
|
|
3565
3751
|
}
|
|
3566
3752
|
));
|
|
3567
3753
|
DialogDescription.displayName = "DialogDescription";
|
|
3568
|
-
var DialogContent = React10.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
3754
|
+
var DialogContent = React10.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx18("div", { ref, className: cn("px-6 py-4", className), ...props, children }));
|
|
3569
3755
|
DialogContent.displayName = "DialogContent";
|
|
3570
|
-
var DialogFooter = React10.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
3756
|
+
var DialogFooter = React10.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx18(
|
|
3571
3757
|
"div",
|
|
3572
3758
|
{
|
|
3573
3759
|
ref,
|
|
@@ -3583,7 +3769,7 @@ DialogFooter.displayName = "DialogFooter";
|
|
|
3583
3769
|
|
|
3584
3770
|
// src/feedback/alert.tsx
|
|
3585
3771
|
import React11 from "react";
|
|
3586
|
-
import { jsx as
|
|
3772
|
+
import { jsx as jsx19, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3587
3773
|
var Alert = React11.forwardRef(
|
|
3588
3774
|
({
|
|
3589
3775
|
className,
|
|
@@ -3624,7 +3810,7 @@ var Alert = React11.forwardRef(
|
|
|
3624
3810
|
error: { color: "var(--color-error-border)" }
|
|
3625
3811
|
};
|
|
3626
3812
|
const defaultIcons = {
|
|
3627
|
-
info: /* @__PURE__ */
|
|
3813
|
+
info: /* @__PURE__ */ jsx19("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx19(
|
|
3628
3814
|
"path",
|
|
3629
3815
|
{
|
|
3630
3816
|
fillRule: "evenodd",
|
|
@@ -3632,7 +3818,7 @@ var Alert = React11.forwardRef(
|
|
|
3632
3818
|
clipRule: "evenodd"
|
|
3633
3819
|
}
|
|
3634
3820
|
) }),
|
|
3635
|
-
success: /* @__PURE__ */
|
|
3821
|
+
success: /* @__PURE__ */ jsx19("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx19(
|
|
3636
3822
|
"path",
|
|
3637
3823
|
{
|
|
3638
3824
|
fillRule: "evenodd",
|
|
@@ -3640,7 +3826,7 @@ var Alert = React11.forwardRef(
|
|
|
3640
3826
|
clipRule: "evenodd"
|
|
3641
3827
|
}
|
|
3642
3828
|
) }),
|
|
3643
|
-
warning: /* @__PURE__ */
|
|
3829
|
+
warning: /* @__PURE__ */ jsx19("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx19(
|
|
3644
3830
|
"path",
|
|
3645
3831
|
{
|
|
3646
3832
|
fillRule: "evenodd",
|
|
@@ -3648,7 +3834,7 @@ var Alert = React11.forwardRef(
|
|
|
3648
3834
|
clipRule: "evenodd"
|
|
3649
3835
|
}
|
|
3650
3836
|
) }),
|
|
3651
|
-
error: /* @__PURE__ */
|
|
3837
|
+
error: /* @__PURE__ */ jsx19("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx19(
|
|
3652
3838
|
"path",
|
|
3653
3839
|
{
|
|
3654
3840
|
fillRule: "evenodd",
|
|
@@ -3657,7 +3843,7 @@ var Alert = React11.forwardRef(
|
|
|
3657
3843
|
}
|
|
3658
3844
|
) })
|
|
3659
3845
|
};
|
|
3660
|
-
return /* @__PURE__ */
|
|
3846
|
+
return /* @__PURE__ */ jsx19(
|
|
3661
3847
|
"div",
|
|
3662
3848
|
{
|
|
3663
3849
|
ref,
|
|
@@ -3665,13 +3851,13 @@ var Alert = React11.forwardRef(
|
|
|
3665
3851
|
className: cn("relative border rounded-lg p-4", className),
|
|
3666
3852
|
role: "alert",
|
|
3667
3853
|
...props,
|
|
3668
|
-
children: /* @__PURE__ */
|
|
3669
|
-
/* @__PURE__ */
|
|
3670
|
-
/* @__PURE__ */
|
|
3671
|
-
title && /* @__PURE__ */
|
|
3672
|
-
/* @__PURE__ */
|
|
3854
|
+
children: /* @__PURE__ */ jsxs18("div", { className: "flex items-start gap-3", children: [
|
|
3855
|
+
/* @__PURE__ */ jsx19("div", { className: "shrink-0", style: iconStyles[variant], children: icon || defaultIcons[variant] }),
|
|
3856
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex-1", children: [
|
|
3857
|
+
title && /* @__PURE__ */ jsx19("h5", { className: "font-semibold mb-1", children: title }),
|
|
3858
|
+
/* @__PURE__ */ jsx19("div", { className: "text-sm", children })
|
|
3673
3859
|
] }),
|
|
3674
|
-
dismissible && onDismiss && /* @__PURE__ */
|
|
3860
|
+
dismissible && onDismiss && /* @__PURE__ */ jsx19(
|
|
3675
3861
|
"button",
|
|
3676
3862
|
{
|
|
3677
3863
|
type: "button",
|
|
@@ -3705,7 +3891,7 @@ var Alert = React11.forwardRef(
|
|
|
3705
3891
|
},
|
|
3706
3892
|
className: "shrink-0 rounded-lg p-1.5 inline-flex focus:outline-none",
|
|
3707
3893
|
"aria-label": "Close",
|
|
3708
|
-
children: /* @__PURE__ */
|
|
3894
|
+
children: /* @__PURE__ */ jsx19("svg", { className: "w-4 h-4", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx19(
|
|
3709
3895
|
"path",
|
|
3710
3896
|
{
|
|
3711
3897
|
fillRule: "evenodd",
|
|
@@ -3724,7 +3910,7 @@ Alert.displayName = "Alert";
|
|
|
3724
3910
|
|
|
3725
3911
|
// src/layout/container.tsx
|
|
3726
3912
|
import React12 from "react";
|
|
3727
|
-
import { jsx as
|
|
3913
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
3728
3914
|
var Container = React12.forwardRef(
|
|
3729
3915
|
({
|
|
3730
3916
|
className,
|
|
@@ -3742,7 +3928,7 @@ var Container = React12.forwardRef(
|
|
|
3742
3928
|
"2xl": "max-w-screen-2xl",
|
|
3743
3929
|
full: "max-w-full"
|
|
3744
3930
|
};
|
|
3745
|
-
return /* @__PURE__ */
|
|
3931
|
+
return /* @__PURE__ */ jsx20(
|
|
3746
3932
|
"div",
|
|
3747
3933
|
{
|
|
3748
3934
|
ref,
|
|
@@ -3763,13 +3949,13 @@ Container.displayName = "Container";
|
|
|
3763
3949
|
|
|
3764
3950
|
// src/layout/section-layout.tsx
|
|
3765
3951
|
import React13 from "react";
|
|
3766
|
-
import { Fragment as Fragment3, jsx as
|
|
3952
|
+
import { Fragment as Fragment3, jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3767
3953
|
function SectionLayout({
|
|
3768
3954
|
children,
|
|
3769
3955
|
hasStickyPreview = false
|
|
3770
3956
|
}) {
|
|
3771
3957
|
if (!hasStickyPreview) {
|
|
3772
|
-
return /* @__PURE__ */
|
|
3958
|
+
return /* @__PURE__ */ jsx21(Fragment3, { children });
|
|
3773
3959
|
}
|
|
3774
3960
|
const childArray = React13.Children.toArray(children);
|
|
3775
3961
|
if (childArray.length === 0) {
|
|
@@ -3777,16 +3963,16 @@ function SectionLayout({
|
|
|
3777
3963
|
}
|
|
3778
3964
|
const stickyPreview = childArray[0];
|
|
3779
3965
|
const scrollableContent = childArray.slice(1);
|
|
3780
|
-
return /* @__PURE__ */
|
|
3966
|
+
return /* @__PURE__ */ jsxs19(Fragment3, { children: [
|
|
3781
3967
|
stickyPreview,
|
|
3782
|
-
scrollableContent.length > 0 && /* @__PURE__ */
|
|
3968
|
+
scrollableContent.length > 0 && /* @__PURE__ */ jsx21("div", { className: "space-y-8", children: scrollableContent })
|
|
3783
3969
|
] });
|
|
3784
3970
|
}
|
|
3785
3971
|
|
|
3786
3972
|
// src/layout/nav.tsx
|
|
3787
3973
|
import { Menu, X as X2, ChevronDown as ChevronDown2 } from "lucide-react";
|
|
3788
3974
|
import React14, { useState as useState11, useEffect as useEffect9, useRef as useRef7 } from "react";
|
|
3789
|
-
import { Fragment as Fragment4, jsx as
|
|
3975
|
+
import { Fragment as Fragment4, jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3790
3976
|
var Nav = React14.forwardRef(
|
|
3791
3977
|
({
|
|
3792
3978
|
className,
|
|
@@ -3816,7 +4002,7 @@ var Nav = React14.forwardRef(
|
|
|
3816
4002
|
const mobileMenuRef = useRef7(null);
|
|
3817
4003
|
const [navElement, setNavElement] = useState11(null);
|
|
3818
4004
|
const [isNavVisible, setIsNavVisible] = useState11(true);
|
|
3819
|
-
const
|
|
4005
|
+
const lastScrollYRef = useRef7(0);
|
|
3820
4006
|
useEffect9(() => {
|
|
3821
4007
|
if (!autoHideOnScroll || position === "static") {
|
|
3822
4008
|
setIsNavVisible(true);
|
|
@@ -3826,16 +4012,19 @@ var Nav = React14.forwardRef(
|
|
|
3826
4012
|
const currentScrollY = window.scrollY;
|
|
3827
4013
|
if (currentScrollY < 10) {
|
|
3828
4014
|
setIsNavVisible(true);
|
|
3829
|
-
|
|
4015
|
+
lastScrollYRef.current = currentScrollY;
|
|
4016
|
+
return;
|
|
4017
|
+
}
|
|
4018
|
+
if (currentScrollY > lastScrollYRef.current) {
|
|
3830
4019
|
setIsNavVisible(false);
|
|
3831
|
-
} else {
|
|
4020
|
+
} else if (currentScrollY < lastScrollYRef.current) {
|
|
3832
4021
|
setIsNavVisible(true);
|
|
3833
4022
|
}
|
|
3834
|
-
|
|
4023
|
+
lastScrollYRef.current = currentScrollY;
|
|
3835
4024
|
};
|
|
3836
4025
|
window.addEventListener("scroll", handleScroll, { passive: true });
|
|
3837
4026
|
return () => window.removeEventListener("scroll", handleScroll);
|
|
3838
|
-
}, [
|
|
4027
|
+
}, [autoHideOnScroll, position]);
|
|
3839
4028
|
useEffect9(() => {
|
|
3840
4029
|
function handleClickOutside(event) {
|
|
3841
4030
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
@@ -3937,7 +4126,7 @@ var Nav = React14.forwardRef(
|
|
|
3937
4126
|
};
|
|
3938
4127
|
const renderNavItem = (item, isMobile = false) => {
|
|
3939
4128
|
if (item.type === "divider") {
|
|
3940
|
-
return /* @__PURE__ */
|
|
4129
|
+
return /* @__PURE__ */ jsx22(
|
|
3941
4130
|
"div",
|
|
3942
4131
|
{
|
|
3943
4132
|
className: cn(
|
|
@@ -3949,7 +4138,7 @@ var Nav = React14.forwardRef(
|
|
|
3949
4138
|
);
|
|
3950
4139
|
}
|
|
3951
4140
|
if (item.type === "custom" && item.render) {
|
|
3952
|
-
return /* @__PURE__ */
|
|
4141
|
+
return /* @__PURE__ */ jsx22("div", { children: item.render() }, item.id);
|
|
3953
4142
|
}
|
|
3954
4143
|
const isActive = activeId === item.id;
|
|
3955
4144
|
const isDropdownOpen = openDropdownId === item.id;
|
|
@@ -3963,11 +4152,11 @@ var Nav = React14.forwardRef(
|
|
|
3963
4152
|
orientation === "vertical" && "w-full",
|
|
3964
4153
|
item.disabled && "opacity-50 cursor-not-allowed"
|
|
3965
4154
|
);
|
|
3966
|
-
const content = /* @__PURE__ */
|
|
3967
|
-
item.icon && /* @__PURE__ */
|
|
3968
|
-
/* @__PURE__ */
|
|
3969
|
-
item.badge && /* @__PURE__ */
|
|
3970
|
-
hasChildren && /* @__PURE__ */
|
|
4155
|
+
const content = /* @__PURE__ */ jsxs20(Fragment4, { children: [
|
|
4156
|
+
item.icon && /* @__PURE__ */ jsx22("span", { className: "flex-shrink-0", children: item.icon }),
|
|
4157
|
+
/* @__PURE__ */ jsx22("span", { children: item.label }),
|
|
4158
|
+
item.badge && /* @__PURE__ */ jsx22("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 }),
|
|
4159
|
+
hasChildren && /* @__PURE__ */ jsx22(
|
|
3971
4160
|
ChevronDown2,
|
|
3972
4161
|
{
|
|
3973
4162
|
className: cn(
|
|
@@ -3978,8 +4167,8 @@ var Nav = React14.forwardRef(
|
|
|
3978
4167
|
)
|
|
3979
4168
|
] });
|
|
3980
4169
|
if (hasChildren) {
|
|
3981
|
-
return /* @__PURE__ */
|
|
3982
|
-
/* @__PURE__ */
|
|
4170
|
+
return /* @__PURE__ */ jsxs20("div", { className: "relative", ref: dropdownRef, children: [
|
|
4171
|
+
/* @__PURE__ */ jsx22(
|
|
3983
4172
|
"button",
|
|
3984
4173
|
{
|
|
3985
4174
|
onClick: () => handleItemClick(item),
|
|
@@ -3988,14 +4177,14 @@ var Nav = React14.forwardRef(
|
|
|
3988
4177
|
children: content
|
|
3989
4178
|
}
|
|
3990
4179
|
),
|
|
3991
|
-
isDropdownOpen && /* @__PURE__ */
|
|
4180
|
+
isDropdownOpen && /* @__PURE__ */ jsx22(
|
|
3992
4181
|
"div",
|
|
3993
4182
|
{
|
|
3994
4183
|
className: cn(
|
|
3995
4184
|
"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",
|
|
3996
4185
|
orientation === "vertical" && "left-full top-0 ml-2 mt-0"
|
|
3997
4186
|
),
|
|
3998
|
-
children: /* @__PURE__ */
|
|
4187
|
+
children: /* @__PURE__ */ jsx22("div", { className: "py-1", children: item.children.map((child) => /* @__PURE__ */ jsxs20(
|
|
3999
4188
|
"button",
|
|
4000
4189
|
{
|
|
4001
4190
|
onClick: () => handleItemClick(child),
|
|
@@ -4006,9 +4195,9 @@ var Nav = React14.forwardRef(
|
|
|
4006
4195
|
activeId === child.id && "bg-(--color-primary)/10 text-(--color-primary) [font-weight:var(--font-semibold)]"
|
|
4007
4196
|
),
|
|
4008
4197
|
children: [
|
|
4009
|
-
child.icon && /* @__PURE__ */
|
|
4010
|
-
/* @__PURE__ */
|
|
4011
|
-
child.badge && /* @__PURE__ */
|
|
4198
|
+
child.icon && /* @__PURE__ */ jsx22("span", { className: "flex-shrink-0", children: child.icon }),
|
|
4199
|
+
/* @__PURE__ */ jsx22("span", { children: child.label }),
|
|
4200
|
+
child.badge && /* @__PURE__ */ jsx22("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 })
|
|
4012
4201
|
]
|
|
4013
4202
|
},
|
|
4014
4203
|
child.id
|
|
@@ -4018,7 +4207,7 @@ var Nav = React14.forwardRef(
|
|
|
4018
4207
|
] }, item.id);
|
|
4019
4208
|
}
|
|
4020
4209
|
if (item.href) {
|
|
4021
|
-
return /* @__PURE__ */
|
|
4210
|
+
return /* @__PURE__ */ jsx22(
|
|
4022
4211
|
"a",
|
|
4023
4212
|
{
|
|
4024
4213
|
href: item.href,
|
|
@@ -4030,7 +4219,7 @@ var Nav = React14.forwardRef(
|
|
|
4030
4219
|
item.id
|
|
4031
4220
|
);
|
|
4032
4221
|
}
|
|
4033
|
-
return /* @__PURE__ */
|
|
4222
|
+
return /* @__PURE__ */ jsx22(
|
|
4034
4223
|
"button",
|
|
4035
4224
|
{
|
|
4036
4225
|
onClick: () => handleItemClick(item),
|
|
@@ -4041,7 +4230,7 @@ var Nav = React14.forwardRef(
|
|
|
4041
4230
|
item.id
|
|
4042
4231
|
);
|
|
4043
4232
|
};
|
|
4044
|
-
const desktopNav = /* @__PURE__ */
|
|
4233
|
+
const desktopNav = /* @__PURE__ */ jsx22(
|
|
4045
4234
|
"div",
|
|
4046
4235
|
{
|
|
4047
4236
|
className: cn(
|
|
@@ -4063,13 +4252,12 @@ var Nav = React14.forwardRef(
|
|
|
4063
4252
|
},
|
|
4064
4253
|
[ref]
|
|
4065
4254
|
);
|
|
4066
|
-
return /* @__PURE__ */
|
|
4255
|
+
return /* @__PURE__ */ jsxs20(
|
|
4067
4256
|
"nav",
|
|
4068
4257
|
{
|
|
4069
4258
|
ref: setRefs,
|
|
4070
4259
|
className: cn(
|
|
4071
4260
|
baseStyles,
|
|
4072
|
-
"relative",
|
|
4073
4261
|
// Border styles
|
|
4074
4262
|
!borderless && "border border-(--color-border)",
|
|
4075
4263
|
borderless && "border-0",
|
|
@@ -4077,11 +4265,11 @@ var Nav = React14.forwardRef(
|
|
|
4077
4265
|
),
|
|
4078
4266
|
...htmlProps,
|
|
4079
4267
|
children: [
|
|
4080
|
-
/* @__PURE__ */
|
|
4081
|
-
logo && /* @__PURE__ */
|
|
4268
|
+
/* @__PURE__ */ jsxs20("div", { className: containerStyles, children: [
|
|
4269
|
+
logo && /* @__PURE__ */ jsx22("div", { className: "shrink-0", children: logo }),
|
|
4082
4270
|
desktopNav,
|
|
4083
|
-
actions && /* @__PURE__ */
|
|
4084
|
-
/* @__PURE__ */
|
|
4271
|
+
actions && /* @__PURE__ */ jsx22("div", { className: "shrink-0 flex items-center gap-2 ml-auto", children: actions }),
|
|
4272
|
+
/* @__PURE__ */ jsx22(
|
|
4085
4273
|
"button",
|
|
4086
4274
|
{
|
|
4087
4275
|
onClick: () => setIsMobileMenuOpen(!isMobileMenuOpen),
|
|
@@ -4090,11 +4278,11 @@ var Nav = React14.forwardRef(
|
|
|
4090
4278
|
breakpointClasses[mobileBreakpoint]
|
|
4091
4279
|
),
|
|
4092
4280
|
"aria-label": "Toggle menu",
|
|
4093
|
-
children: isMobileMenuOpen ? /* @__PURE__ */
|
|
4281
|
+
children: isMobileMenuOpen ? /* @__PURE__ */ jsx22(X2, { className: "w-6 h-6" }) : /* @__PURE__ */ jsx22(Menu, { className: "w-6 h-6" })
|
|
4094
4282
|
}
|
|
4095
4283
|
)
|
|
4096
4284
|
] }),
|
|
4097
|
-
mobileMenuDirection === "top" && /* @__PURE__ */
|
|
4285
|
+
mobileMenuDirection === "top" && /* @__PURE__ */ jsx22(
|
|
4098
4286
|
"div",
|
|
4099
4287
|
{
|
|
4100
4288
|
ref: mobileMenuRef,
|
|
@@ -4103,11 +4291,11 @@ var Nav = React14.forwardRef(
|
|
|
4103
4291
|
breakpointClasses[mobileBreakpoint],
|
|
4104
4292
|
isMobileMenuOpen ? "max-h-96 opacity-100 border-(--color-border)" : "max-h-0 opacity-0 border-transparent"
|
|
4105
4293
|
),
|
|
4106
|
-
children: /* @__PURE__ */
|
|
4294
|
+
children: /* @__PURE__ */ jsx22("div", { className: "space-y-1 px-2 py-2", children: items.map((item) => renderNavItem(item, true)) })
|
|
4107
4295
|
}
|
|
4108
4296
|
),
|
|
4109
|
-
mobileMenuDirection !== "top" && /* @__PURE__ */
|
|
4110
|
-
isMobileMenuOpen && /* @__PURE__ */
|
|
4297
|
+
mobileMenuDirection !== "top" && /* @__PURE__ */ jsxs20(Fragment4, { children: [
|
|
4298
|
+
isMobileMenuOpen && /* @__PURE__ */ jsx22(
|
|
4111
4299
|
"div",
|
|
4112
4300
|
{
|
|
4113
4301
|
className: cn(
|
|
@@ -4120,7 +4308,7 @@ var Nav = React14.forwardRef(
|
|
|
4120
4308
|
onClick: () => setIsMobileMenuOpen(false)
|
|
4121
4309
|
}
|
|
4122
4310
|
),
|
|
4123
|
-
/* @__PURE__ */
|
|
4311
|
+
/* @__PURE__ */ jsx22(
|
|
4124
4312
|
"div",
|
|
4125
4313
|
{
|
|
4126
4314
|
ref: mobileMenuRef,
|
|
@@ -4140,7 +4328,7 @@ var Nav = React14.forwardRef(
|
|
|
4140
4328
|
style: {
|
|
4141
4329
|
transitionDuration: "var(--transition-drawer-duration, 500ms)"
|
|
4142
4330
|
},
|
|
4143
|
-
children: /* @__PURE__ */
|
|
4331
|
+
children: /* @__PURE__ */ jsx22("div", { className: "flex flex-col space-y-1 px-2 pt-2", children: items.map((item) => renderNavItem(item, true)) })
|
|
4144
4332
|
}
|
|
4145
4333
|
)
|
|
4146
4334
|
] })
|
|
@@ -4154,7 +4342,7 @@ Nav.displayName = "Nav";
|
|
|
4154
4342
|
// src/layout/drawer.tsx
|
|
4155
4343
|
import { Menu as Menu2, X as X3 } from "lucide-react";
|
|
4156
4344
|
import { useState as useState12, useEffect as useEffect10 } from "react";
|
|
4157
|
-
import { Fragment as Fragment5, jsx as
|
|
4345
|
+
import { Fragment as Fragment5, jsx as jsx23, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4158
4346
|
function Drawer({
|
|
4159
4347
|
title,
|
|
4160
4348
|
subtitle,
|
|
@@ -4199,8 +4387,8 @@ function Drawer({
|
|
|
4199
4387
|
window.addEventListener("scroll", handleScroll, { passive: true });
|
|
4200
4388
|
return () => window.removeEventListener("scroll", handleScroll);
|
|
4201
4389
|
}, [lastScrollY, autoHideOnScroll]);
|
|
4202
|
-
return /* @__PURE__ */
|
|
4203
|
-
/* @__PURE__ */
|
|
4390
|
+
return /* @__PURE__ */ jsxs21(Fragment5, { children: [
|
|
4391
|
+
/* @__PURE__ */ jsx23(
|
|
4204
4392
|
"div",
|
|
4205
4393
|
{
|
|
4206
4394
|
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"}`,
|
|
@@ -4209,13 +4397,13 @@ function Drawer({
|
|
|
4209
4397
|
opacity: blur ? 0.85 : 1,
|
|
4210
4398
|
borderBottom: !borderless && !blur ? "1px solid var(--color-border)" : "none"
|
|
4211
4399
|
},
|
|
4212
|
-
children: /* @__PURE__ */
|
|
4400
|
+
children: /* @__PURE__ */ jsxs21(
|
|
4213
4401
|
"div",
|
|
4214
4402
|
{
|
|
4215
4403
|
className: `flex items-center ${isLeft ? "justify-between" : "justify-between flex-row-reverse"}`,
|
|
4216
4404
|
children: [
|
|
4217
|
-
/* @__PURE__ */
|
|
4218
|
-
homeUrl && /* @__PURE__ */
|
|
4405
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-2", children: [
|
|
4406
|
+
homeUrl && /* @__PURE__ */ jsx23(
|
|
4219
4407
|
"a",
|
|
4220
4408
|
{
|
|
4221
4409
|
href: homeUrl,
|
|
@@ -4224,14 +4412,14 @@ function Drawer({
|
|
|
4224
4412
|
onMouseOver: (e) => e.currentTarget.style.background = "var(--color-muted)",
|
|
4225
4413
|
onMouseOut: (e) => e.currentTarget.style.background = "transparent",
|
|
4226
4414
|
"aria-label": "Go to home",
|
|
4227
|
-
children: /* @__PURE__ */
|
|
4415
|
+
children: /* @__PURE__ */ jsx23(
|
|
4228
4416
|
"svg",
|
|
4229
4417
|
{
|
|
4230
4418
|
className: "w-5 h-5",
|
|
4231
4419
|
fill: "none",
|
|
4232
4420
|
stroke: "currentColor",
|
|
4233
4421
|
viewBox: "0 0 24 24",
|
|
4234
|
-
children: /* @__PURE__ */
|
|
4422
|
+
children: /* @__PURE__ */ jsx23(
|
|
4235
4423
|
"path",
|
|
4236
4424
|
{
|
|
4237
4425
|
strokeLinecap: "round",
|
|
@@ -4244,7 +4432,7 @@ function Drawer({
|
|
|
4244
4432
|
)
|
|
4245
4433
|
}
|
|
4246
4434
|
),
|
|
4247
|
-
/* @__PURE__ */
|
|
4435
|
+
/* @__PURE__ */ jsx23(
|
|
4248
4436
|
"button",
|
|
4249
4437
|
{
|
|
4250
4438
|
onClick: () => setMobileMenuOpen(!mobileMenuOpen),
|
|
@@ -4253,13 +4441,13 @@ function Drawer({
|
|
|
4253
4441
|
onMouseOver: (e) => e.currentTarget.style.background = "var(--color-muted)",
|
|
4254
4442
|
onMouseOut: (e) => e.currentTarget.style.background = "transparent",
|
|
4255
4443
|
"aria-label": "Toggle menu",
|
|
4256
|
-
children: mobileMenuOpen ? /* @__PURE__ */
|
|
4444
|
+
children: mobileMenuOpen ? /* @__PURE__ */ jsx23(X3, { className: "w-6 h-6" }) : /* @__PURE__ */ jsx23(Menu2, { className: "w-6 h-6" })
|
|
4257
4445
|
}
|
|
4258
4446
|
)
|
|
4259
4447
|
] }),
|
|
4260
|
-
headerActions && /* @__PURE__ */
|
|
4261
|
-
/* @__PURE__ */
|
|
4262
|
-
/* @__PURE__ */
|
|
4448
|
+
headerActions && /* @__PURE__ */ jsx23("div", { className: "flex items-center", children: headerActions }),
|
|
4449
|
+
/* @__PURE__ */ jsxs21("div", { children: [
|
|
4450
|
+
/* @__PURE__ */ jsx23(
|
|
4263
4451
|
"h1",
|
|
4264
4452
|
{
|
|
4265
4453
|
className: "font-bold text-h5",
|
|
@@ -4269,7 +4457,7 @@ function Drawer({
|
|
|
4269
4457
|
children: title
|
|
4270
4458
|
}
|
|
4271
4459
|
),
|
|
4272
|
-
subtitle && /* @__PURE__ */
|
|
4460
|
+
subtitle && /* @__PURE__ */ jsx23(
|
|
4273
4461
|
"p",
|
|
4274
4462
|
{
|
|
4275
4463
|
className: "text-caption",
|
|
@@ -4285,7 +4473,7 @@ function Drawer({
|
|
|
4285
4473
|
)
|
|
4286
4474
|
}
|
|
4287
4475
|
),
|
|
4288
|
-
mobileMenuOpen && /* @__PURE__ */
|
|
4476
|
+
mobileMenuOpen && /* @__PURE__ */ jsx23(
|
|
4289
4477
|
"div",
|
|
4290
4478
|
{
|
|
4291
4479
|
className: "fixed inset-0 lg:hidden transition-opacity ease-in-out",
|
|
@@ -4297,7 +4485,7 @@ function Drawer({
|
|
|
4297
4485
|
onClick: () => setMobileMenuOpen(false)
|
|
4298
4486
|
}
|
|
4299
4487
|
),
|
|
4300
|
-
/* @__PURE__ */
|
|
4488
|
+
/* @__PURE__ */ jsxs21(
|
|
4301
4489
|
"aside",
|
|
4302
4490
|
{
|
|
4303
4491
|
className: `
|
|
@@ -4315,7 +4503,7 @@ function Drawer({
|
|
|
4315
4503
|
...mobileMenuOpen && typeof window !== "undefined" && window.innerWidth < 1024 ? { zIndex: 9999 } : {}
|
|
4316
4504
|
},
|
|
4317
4505
|
children: [
|
|
4318
|
-
/* @__PURE__ */
|
|
4506
|
+
/* @__PURE__ */ jsxs21(
|
|
4319
4507
|
"div",
|
|
4320
4508
|
{
|
|
4321
4509
|
className: "hidden lg:block px-6 py-5",
|
|
@@ -4324,7 +4512,7 @@ function Drawer({
|
|
|
4324
4512
|
background: "var(--color-muted)"
|
|
4325
4513
|
},
|
|
4326
4514
|
children: [
|
|
4327
|
-
/* @__PURE__ */
|
|
4515
|
+
/* @__PURE__ */ jsx23(
|
|
4328
4516
|
"h1",
|
|
4329
4517
|
{
|
|
4330
4518
|
className: "font-bold text-h5",
|
|
@@ -4334,7 +4522,7 @@ function Drawer({
|
|
|
4334
4522
|
children: title
|
|
4335
4523
|
}
|
|
4336
4524
|
),
|
|
4337
|
-
subtitle && /* @__PURE__ */
|
|
4525
|
+
subtitle && /* @__PURE__ */ jsx23(
|
|
4338
4526
|
"p",
|
|
4339
4527
|
{
|
|
4340
4528
|
className: "mt-0.5 text-caption",
|
|
@@ -4347,14 +4535,14 @@ function Drawer({
|
|
|
4347
4535
|
]
|
|
4348
4536
|
}
|
|
4349
4537
|
),
|
|
4350
|
-
/* @__PURE__ */
|
|
4538
|
+
/* @__PURE__ */ jsxs21(
|
|
4351
4539
|
"div",
|
|
4352
4540
|
{
|
|
4353
4541
|
className: "lg:hidden p-4 flex items-center justify-between",
|
|
4354
4542
|
style: { borderBottom: "1px solid var(--color-border)" },
|
|
4355
4543
|
children: [
|
|
4356
|
-
/* @__PURE__ */
|
|
4357
|
-
/* @__PURE__ */
|
|
4544
|
+
/* @__PURE__ */ jsxs21("div", { children: [
|
|
4545
|
+
/* @__PURE__ */ jsx23(
|
|
4358
4546
|
"h1",
|
|
4359
4547
|
{
|
|
4360
4548
|
className: "font-bold text-h5",
|
|
@@ -4364,7 +4552,7 @@ function Drawer({
|
|
|
4364
4552
|
children: title
|
|
4365
4553
|
}
|
|
4366
4554
|
),
|
|
4367
|
-
subtitle && /* @__PURE__ */
|
|
4555
|
+
subtitle && /* @__PURE__ */ jsx23(
|
|
4368
4556
|
"p",
|
|
4369
4557
|
{
|
|
4370
4558
|
className: "mt-1 text-caption",
|
|
@@ -4375,7 +4563,7 @@ function Drawer({
|
|
|
4375
4563
|
}
|
|
4376
4564
|
)
|
|
4377
4565
|
] }),
|
|
4378
|
-
/* @__PURE__ */
|
|
4566
|
+
/* @__PURE__ */ jsx23(
|
|
4379
4567
|
"button",
|
|
4380
4568
|
{
|
|
4381
4569
|
onClick: () => setMobileMenuOpen(false),
|
|
@@ -4384,20 +4572,20 @@ function Drawer({
|
|
|
4384
4572
|
onMouseOver: (e) => e.currentTarget.style.background = "var(--color-muted)",
|
|
4385
4573
|
onMouseOut: (e) => e.currentTarget.style.background = "transparent",
|
|
4386
4574
|
"aria-label": "Close menu",
|
|
4387
|
-
children: /* @__PURE__ */
|
|
4575
|
+
children: /* @__PURE__ */ jsx23(X3, { className: "w-5 h-5" })
|
|
4388
4576
|
}
|
|
4389
4577
|
)
|
|
4390
4578
|
]
|
|
4391
4579
|
}
|
|
4392
4580
|
),
|
|
4393
|
-
/* @__PURE__ */
|
|
4581
|
+
/* @__PURE__ */ jsx23("nav", { className: "px-3 py-4", children: useSections.map((section, sectionIndex) => /* @__PURE__ */ jsxs21(
|
|
4394
4582
|
"div",
|
|
4395
4583
|
{
|
|
4396
4584
|
style: {
|
|
4397
4585
|
paddingTop: sectionIndex > 0 ? "var(--drawer-section-padding-y)" : "0"
|
|
4398
4586
|
},
|
|
4399
4587
|
children: [
|
|
4400
|
-
section.title && /* @__PURE__ */
|
|
4588
|
+
section.title && /* @__PURE__ */ jsx23(
|
|
4401
4589
|
"h3",
|
|
4402
4590
|
{
|
|
4403
4591
|
className: "font-semibold uppercase tracking-wide text-caption",
|
|
@@ -4409,7 +4597,7 @@ function Drawer({
|
|
|
4409
4597
|
children: section.title
|
|
4410
4598
|
}
|
|
4411
4599
|
),
|
|
4412
|
-
/* @__PURE__ */
|
|
4600
|
+
/* @__PURE__ */ jsx23(
|
|
4413
4601
|
"ul",
|
|
4414
4602
|
{
|
|
4415
4603
|
style: {
|
|
@@ -4417,7 +4605,7 @@ function Drawer({
|
|
|
4417
4605
|
flexDirection: "column",
|
|
4418
4606
|
gap: "var(--drawer-item-spacing)"
|
|
4419
4607
|
},
|
|
4420
|
-
children: section.items.map((item) => /* @__PURE__ */
|
|
4608
|
+
children: section.items.map((item) => /* @__PURE__ */ jsx23("li", { children: /* @__PURE__ */ jsxs21(
|
|
4421
4609
|
"button",
|
|
4422
4610
|
{
|
|
4423
4611
|
onClick: () => handleItemClick(item.id),
|
|
@@ -4445,8 +4633,8 @@ function Drawer({
|
|
|
4445
4633
|
boxShadow: activeItem === item.id ? "0 1px 3px rgba(0,0,0,0.1)" : "none"
|
|
4446
4634
|
},
|
|
4447
4635
|
children: [
|
|
4448
|
-
item.icon && /* @__PURE__ */
|
|
4449
|
-
/* @__PURE__ */
|
|
4636
|
+
item.icon && /* @__PURE__ */ jsx23("span", { className: "shrink-0 opacity-75", children: item.icon }),
|
|
4637
|
+
/* @__PURE__ */ jsx23("span", { children: item.label })
|
|
4450
4638
|
]
|
|
4451
4639
|
}
|
|
4452
4640
|
) }, item.id))
|
|
@@ -4456,7 +4644,7 @@ function Drawer({
|
|
|
4456
4644
|
},
|
|
4457
4645
|
sectionIndex
|
|
4458
4646
|
)) }),
|
|
4459
|
-
footer && /* @__PURE__ */
|
|
4647
|
+
footer && /* @__PURE__ */ jsx23(
|
|
4460
4648
|
"div",
|
|
4461
4649
|
{
|
|
4462
4650
|
className: "p-4 mt-auto",
|
|
@@ -4473,7 +4661,7 @@ function Drawer({
|
|
|
4473
4661
|
// src/layout/sidebar-nav.tsx
|
|
4474
4662
|
import { Menu as Menu3, X as X4 } from "lucide-react";
|
|
4475
4663
|
import { useState as useState13 } from "react";
|
|
4476
|
-
import { Fragment as Fragment6, jsx as
|
|
4664
|
+
import { Fragment as Fragment6, jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4477
4665
|
function SidebarNav({
|
|
4478
4666
|
title,
|
|
4479
4667
|
subtitle,
|
|
@@ -4491,29 +4679,29 @@ function SidebarNav({
|
|
|
4491
4679
|
setMobileMenuOpen(false);
|
|
4492
4680
|
};
|
|
4493
4681
|
const useSections = sections || (items ? [{ title: "", items }] : []);
|
|
4494
|
-
return /* @__PURE__ */
|
|
4495
|
-
/* @__PURE__ */
|
|
4682
|
+
return /* @__PURE__ */ jsxs22(Fragment6, { children: [
|
|
4683
|
+
/* @__PURE__ */ jsx24("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__ */ jsxs22(
|
|
4496
4684
|
"div",
|
|
4497
4685
|
{
|
|
4498
4686
|
className: `flex items-center ${isLeft ? "justify-between" : "justify-between flex-row-reverse"}`,
|
|
4499
4687
|
children: [
|
|
4500
|
-
/* @__PURE__ */
|
|
4688
|
+
/* @__PURE__ */ jsx24(
|
|
4501
4689
|
"button",
|
|
4502
4690
|
{
|
|
4503
4691
|
onClick: () => setMobileMenuOpen(!mobileMenuOpen),
|
|
4504
4692
|
className: "p-2 rounded-lg hover:bg-(--color-muted) transition-colors",
|
|
4505
4693
|
"aria-label": "Toggle menu",
|
|
4506
|
-
children: mobileMenuOpen ? /* @__PURE__ */
|
|
4694
|
+
children: mobileMenuOpen ? /* @__PURE__ */ jsx24(X4, { className: "w-6 h-6 text-(--color-muted-foreground)" }) : /* @__PURE__ */ jsx24(Menu3, { className: "w-6 h-6 text-(--color-muted-foreground)" })
|
|
4507
4695
|
}
|
|
4508
4696
|
),
|
|
4509
|
-
/* @__PURE__ */
|
|
4510
|
-
/* @__PURE__ */
|
|
4511
|
-
subtitle && /* @__PURE__ */
|
|
4697
|
+
/* @__PURE__ */ jsxs22("div", { children: [
|
|
4698
|
+
/* @__PURE__ */ jsx24("h1", { className: "text-h4 font-bold text-(--color-foreground)", children: title }),
|
|
4699
|
+
subtitle && /* @__PURE__ */ jsx24("p", { className: "text-caption text-(--color-muted-foreground)", children: subtitle })
|
|
4512
4700
|
] })
|
|
4513
4701
|
]
|
|
4514
4702
|
}
|
|
4515
4703
|
) }),
|
|
4516
|
-
mobileMenuOpen && /* @__PURE__ */
|
|
4704
|
+
mobileMenuOpen && /* @__PURE__ */ jsx24(
|
|
4517
4705
|
"div",
|
|
4518
4706
|
{
|
|
4519
4707
|
className: "fixed inset-0 bg-black/50 lg:hidden",
|
|
@@ -4521,7 +4709,7 @@ function SidebarNav({
|
|
|
4521
4709
|
onClick: () => setMobileMenuOpen(false)
|
|
4522
4710
|
}
|
|
4523
4711
|
),
|
|
4524
|
-
/* @__PURE__ */
|
|
4712
|
+
/* @__PURE__ */ jsxs22(
|
|
4525
4713
|
"aside",
|
|
4526
4714
|
{
|
|
4527
4715
|
className: `
|
|
@@ -4532,18 +4720,18 @@ function SidebarNav({
|
|
|
4532
4720
|
${mobileMenuOpen ? "translate-x-0" : `${isLeft ? "-translate-x-full" : "translate-x-full"} lg:translate-x-0`}
|
|
4533
4721
|
`,
|
|
4534
4722
|
children: [
|
|
4535
|
-
/* @__PURE__ */
|
|
4536
|
-
/* @__PURE__ */
|
|
4537
|
-
subtitle && /* @__PURE__ */
|
|
4723
|
+
/* @__PURE__ */ jsxs22("div", { className: "hidden lg:block p-6 border-b border-(--color-border)", children: [
|
|
4724
|
+
/* @__PURE__ */ jsx24("h1", { className: "text-h3 font-bold text-(--color-foreground)", children: title }),
|
|
4725
|
+
subtitle && /* @__PURE__ */ jsx24("p", { className: "text-caption text-(--color-muted-foreground) mt-1", children: subtitle })
|
|
4538
4726
|
] }),
|
|
4539
|
-
/* @__PURE__ */
|
|
4540
|
-
/* @__PURE__ */
|
|
4727
|
+
/* @__PURE__ */ jsx24("div", { className: "lg:hidden h-[57px]", "aria-hidden": "true" }),
|
|
4728
|
+
/* @__PURE__ */ jsx24("nav", { className: "p-4", children: useSections.map((section, sectionIndex) => /* @__PURE__ */ jsxs22(
|
|
4541
4729
|
"div",
|
|
4542
4730
|
{
|
|
4543
4731
|
className: sectionIndex > 0 ? "mt-6" : "",
|
|
4544
4732
|
children: [
|
|
4545
|
-
section.title && /* @__PURE__ */
|
|
4546
|
-
/* @__PURE__ */
|
|
4733
|
+
section.title && /* @__PURE__ */ jsx24("h3", { className: "px-4 mb-2 text-caption font-semibold text-(--color-muted-foreground) uppercase tracking-wider", children: section.title }),
|
|
4734
|
+
/* @__PURE__ */ jsx24("ul", { className: "space-y-1", children: section.items.map((item) => /* @__PURE__ */ jsx24("li", { children: /* @__PURE__ */ jsxs22(
|
|
4547
4735
|
"button",
|
|
4548
4736
|
{
|
|
4549
4737
|
onClick: () => handleItemClick(item.id),
|
|
@@ -4552,8 +4740,8 @@ function SidebarNav({
|
|
|
4552
4740
|
${activeItem === item.id ? "bg-[color-mix(in_srgb,var(--color-primary)_10%,transparent)] text-(--color-primary)" : "text-(--color-muted-foreground) hover:bg-(--color-muted)"}
|
|
4553
4741
|
`,
|
|
4554
4742
|
children: [
|
|
4555
|
-
item.icon && /* @__PURE__ */
|
|
4556
|
-
/* @__PURE__ */
|
|
4743
|
+
item.icon && /* @__PURE__ */ jsx24("span", { className: "shrink-0", children: item.icon }),
|
|
4744
|
+
/* @__PURE__ */ jsx24("span", { children: item.label })
|
|
4557
4745
|
]
|
|
4558
4746
|
}
|
|
4559
4747
|
) }, item.id)) })
|
|
@@ -4561,7 +4749,7 @@ function SidebarNav({
|
|
|
4561
4749
|
},
|
|
4562
4750
|
sectionIndex
|
|
4563
4751
|
)) }),
|
|
4564
|
-
footer && /* @__PURE__ */
|
|
4752
|
+
footer && /* @__PURE__ */ jsx24("div", { className: "p-4 border-t border-(--color-border) mt-auto", children: footer })
|
|
4565
4753
|
]
|
|
4566
4754
|
}
|
|
4567
4755
|
)
|
|
@@ -4570,10 +4758,10 @@ function SidebarNav({
|
|
|
4570
4758
|
|
|
4571
4759
|
// src/shared/empty-state.tsx
|
|
4572
4760
|
import React17 from "react";
|
|
4573
|
-
import { jsx as
|
|
4761
|
+
import { jsx as jsx25, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
4574
4762
|
var EmptyState = React17.forwardRef(
|
|
4575
4763
|
({ className, icon, title, description, action, ...props }, ref) => {
|
|
4576
|
-
return /* @__PURE__ */
|
|
4764
|
+
return /* @__PURE__ */ jsxs23(
|
|
4577
4765
|
"div",
|
|
4578
4766
|
{
|
|
4579
4767
|
ref,
|
|
@@ -4583,10 +4771,10 @@ var EmptyState = React17.forwardRef(
|
|
|
4583
4771
|
),
|
|
4584
4772
|
...props,
|
|
4585
4773
|
children: [
|
|
4586
|
-
icon && /* @__PURE__ */
|
|
4587
|
-
/* @__PURE__ */
|
|
4588
|
-
description && /* @__PURE__ */
|
|
4589
|
-
action && /* @__PURE__ */
|
|
4774
|
+
icon && /* @__PURE__ */ jsx25("div", { className: "mb-4 text-(--color-placeholder)", children: icon }),
|
|
4775
|
+
/* @__PURE__ */ jsx25("h3", { className: "text-h4 font-semibold text-(--color-foreground) mb-2", children: title }),
|
|
4776
|
+
description && /* @__PURE__ */ jsx25("p", { className: "text-small text-(--color-muted-foreground) mb-6 max-w-sm", children: description }),
|
|
4777
|
+
action && /* @__PURE__ */ jsx25("div", { children: action })
|
|
4590
4778
|
]
|
|
4591
4779
|
}
|
|
4592
4780
|
);
|
|
@@ -4834,7 +5022,7 @@ var themes2 = {
|
|
|
4834
5022
|
var themes_default = themes2;
|
|
4835
5023
|
|
|
4836
5024
|
// src/contexts/ThemeProvider.tsx
|
|
4837
|
-
import { jsx as
|
|
5025
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
4838
5026
|
var ThemeContext = createContext3(void 0);
|
|
4839
5027
|
var themeRegistry = themes_default;
|
|
4840
5028
|
var getInitialTheme = (defaultTheme = "dark") => {
|
|
@@ -4963,7 +5151,7 @@ function ThemeProvider({
|
|
|
4963
5151
|
applyTheme(theme);
|
|
4964
5152
|
}
|
|
4965
5153
|
}, [currentTheme, customTheme, applyTheme]);
|
|
4966
|
-
return /* @__PURE__ */
|
|
5154
|
+
return /* @__PURE__ */ jsx26(
|
|
4967
5155
|
ThemeContext.Provider,
|
|
4968
5156
|
{
|
|
4969
5157
|
value: {
|
|
@@ -5016,6 +5204,7 @@ export {
|
|
|
5016
5204
|
FormControlLabel,
|
|
5017
5205
|
FormHelperText,
|
|
5018
5206
|
Input,
|
|
5207
|
+
NativeSelect,
|
|
5019
5208
|
Nav,
|
|
5020
5209
|
RadioGroup,
|
|
5021
5210
|
Rating,
|