@sckyzo/cosmos-react 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +54 -0
- package/README.md +18 -9
- package/dist/index.cjs +1219 -514
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +257 -65
- package/dist/index.d.ts +257 -65
- package/dist/index.js +1218 -515
- package/dist/index.js.map +1 -1
- package/package.json +7 -5
package/dist/index.cjs
CHANGED
|
@@ -170,6 +170,7 @@ var Shell = ({
|
|
|
170
170
|
defaultSidebarCollapsed = false,
|
|
171
171
|
sidebarCollapsed: controlledCollapsed,
|
|
172
172
|
onSidebarToggle,
|
|
173
|
+
collapseControl = "topbar",
|
|
173
174
|
className
|
|
174
175
|
}) => {
|
|
175
176
|
const [internalCollapsed, setInternalCollapsed] = react.useState(defaultSidebarCollapsed);
|
|
@@ -179,12 +180,22 @@ var Shell = ({
|
|
|
179
180
|
if (controlledCollapsed === void 0) setInternalCollapsed(next);
|
|
180
181
|
onSidebarToggle?.(next);
|
|
181
182
|
};
|
|
182
|
-
const
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
183
|
+
const inSidebar = collapseControl === "sidebar";
|
|
184
|
+
const enhancedTopbar = topbar && sidebar ? react.cloneElement(
|
|
185
|
+
topbar,
|
|
186
|
+
inSidebar ? (
|
|
187
|
+
// The control moved to the sidebar: no hamburger unless asked for.
|
|
188
|
+
{ sidebarCollapsed: topbar.props.sidebarCollapsed ?? null }
|
|
189
|
+
) : {
|
|
190
|
+
sidebarCollapsed: topbar.props.sidebarCollapsed ?? collapsed,
|
|
191
|
+
onToggleSidebar: topbar.props.onToggleSidebar ?? handleToggle
|
|
192
|
+
}
|
|
193
|
+
) : topbar;
|
|
186
194
|
const enhancedSidebar = sidebar ? react.cloneElement(sidebar, {
|
|
187
|
-
collapsed: sidebar.props.collapsed ?? collapsed
|
|
195
|
+
collapsed: sidebar.props.collapsed ?? collapsed,
|
|
196
|
+
...inSidebar && {
|
|
197
|
+
onCollapsedChange: sidebar.props.onCollapsedChange ?? handleToggle
|
|
198
|
+
}
|
|
188
199
|
}) : sidebar;
|
|
189
200
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
190
201
|
"div",
|
|
@@ -269,17 +280,200 @@ var Topbar = ({
|
|
|
269
280
|
]
|
|
270
281
|
}
|
|
271
282
|
);
|
|
283
|
+
var PopoverContext = react.createContext(null);
|
|
284
|
+
var useCtx = () => {
|
|
285
|
+
const ctx = react.useContext(PopoverContext);
|
|
286
|
+
if (!ctx) throw new Error("Popover.* must be used inside <Popover>");
|
|
287
|
+
return ctx;
|
|
288
|
+
};
|
|
289
|
+
var PopoverRoot = ({
|
|
290
|
+
open: openProp,
|
|
291
|
+
defaultOpen = false,
|
|
292
|
+
onOpenChange,
|
|
293
|
+
children
|
|
294
|
+
}) => {
|
|
295
|
+
const [internalOpen, setInternalOpen] = react.useState(defaultOpen);
|
|
296
|
+
const isControlled = openProp !== void 0;
|
|
297
|
+
const open = isControlled ? openProp : internalOpen;
|
|
298
|
+
const triggerRef = react.useRef(null);
|
|
299
|
+
const [triggerRect, setTriggerRect] = react.useState(null);
|
|
300
|
+
const refreshRect = react.useCallback(() => {
|
|
301
|
+
if (triggerRef.current) setTriggerRect(triggerRef.current.getBoundingClientRect());
|
|
302
|
+
}, []);
|
|
303
|
+
const setOpen = react.useCallback(
|
|
304
|
+
(v) => {
|
|
305
|
+
if (v) refreshRect();
|
|
306
|
+
if (!isControlled) setInternalOpen(v);
|
|
307
|
+
onOpenChange?.(v);
|
|
308
|
+
},
|
|
309
|
+
[isControlled, onOpenChange, refreshRect]
|
|
310
|
+
);
|
|
311
|
+
react.useEffect(() => {
|
|
312
|
+
if (!open) return;
|
|
313
|
+
const handler = () => refreshRect();
|
|
314
|
+
window.addEventListener("resize", handler);
|
|
315
|
+
window.addEventListener("scroll", handler, true);
|
|
316
|
+
const observer = new ResizeObserver(handler);
|
|
317
|
+
if (triggerRef.current) observer.observe(triggerRef.current, { box: "border-box" });
|
|
318
|
+
return () => {
|
|
319
|
+
window.removeEventListener("resize", handler);
|
|
320
|
+
window.removeEventListener("scroll", handler, true);
|
|
321
|
+
observer.disconnect();
|
|
322
|
+
};
|
|
323
|
+
}, [open, refreshRect]);
|
|
324
|
+
react.useEffect(() => {
|
|
325
|
+
if (!open) return;
|
|
326
|
+
const handler = (e) => {
|
|
327
|
+
if (e.key === "Escape") setOpen(false);
|
|
328
|
+
};
|
|
329
|
+
document.addEventListener("keydown", handler);
|
|
330
|
+
return () => document.removeEventListener("keydown", handler);
|
|
331
|
+
}, [open, setOpen]);
|
|
332
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PopoverContext.Provider, { value: { open, setOpen, triggerRef, triggerRect, refreshRect }, children });
|
|
333
|
+
};
|
|
334
|
+
var PopoverTrigger = react.forwardRef(function PopoverTrigger2({ onClick, children, ...rest }, forwardedRef) {
|
|
335
|
+
const { open, setOpen, triggerRef, refreshRect } = useCtx();
|
|
336
|
+
const setRef = (node) => {
|
|
337
|
+
triggerRef.current = node;
|
|
338
|
+
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
339
|
+
else if (forwardedRef) forwardedRef.current = node;
|
|
340
|
+
};
|
|
341
|
+
react.useEffect(() => {
|
|
342
|
+
if (open) refreshRect();
|
|
343
|
+
}, [open, refreshRect]);
|
|
344
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
345
|
+
"button",
|
|
346
|
+
{
|
|
347
|
+
ref: setRef,
|
|
348
|
+
type: "button",
|
|
349
|
+
"aria-haspopup": "dialog",
|
|
350
|
+
"aria-expanded": open,
|
|
351
|
+
onClick: (e) => {
|
|
352
|
+
onClick?.(e);
|
|
353
|
+
setOpen(!open);
|
|
354
|
+
},
|
|
355
|
+
...rest,
|
|
356
|
+
children
|
|
357
|
+
}
|
|
358
|
+
);
|
|
359
|
+
});
|
|
360
|
+
var VIEWPORT_MARGIN = 16;
|
|
361
|
+
var positionStyle = (position, align, rect, offset) => {
|
|
362
|
+
const left = align === "end" ? rect.right : rect.left + rect.width / 2;
|
|
363
|
+
const shiftX = align === "end" ? "-100%" : "-50%";
|
|
364
|
+
const maxWidth = align === "end" ? rect.right - VIEWPORT_MARGIN : void 0;
|
|
365
|
+
switch (position) {
|
|
366
|
+
case "top":
|
|
367
|
+
return {
|
|
368
|
+
top: rect.top - offset,
|
|
369
|
+
left,
|
|
370
|
+
maxWidth,
|
|
371
|
+
transform: `translate(${shiftX}, -100%)`
|
|
372
|
+
};
|
|
373
|
+
case "right":
|
|
374
|
+
return {
|
|
375
|
+
top: rect.top + rect.height / 2,
|
|
376
|
+
left: rect.right + offset,
|
|
377
|
+
transform: "translateY(-50%)"
|
|
378
|
+
};
|
|
379
|
+
case "left":
|
|
380
|
+
return {
|
|
381
|
+
top: rect.top + rect.height / 2,
|
|
382
|
+
left: rect.left - offset,
|
|
383
|
+
transform: "translate(-100%, -50%)"
|
|
384
|
+
};
|
|
385
|
+
case "bottom":
|
|
386
|
+
default:
|
|
387
|
+
return {
|
|
388
|
+
top: rect.bottom + offset,
|
|
389
|
+
left,
|
|
390
|
+
maxWidth,
|
|
391
|
+
transform: `translateX(${shiftX})`
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
var arrowStyle = (position, align, rect) => {
|
|
396
|
+
const base = {
|
|
397
|
+
position: "absolute",
|
|
398
|
+
width: 8,
|
|
399
|
+
height: 8,
|
|
400
|
+
transform: "rotate(45deg)"
|
|
401
|
+
};
|
|
402
|
+
const x = align === "end" ? { right: rect.width / 2 - 1, marginRight: -4 } : { left: "50%", marginLeft: -4 };
|
|
403
|
+
switch (position) {
|
|
404
|
+
case "top":
|
|
405
|
+
return { ...base, bottom: -4, ...x };
|
|
406
|
+
case "right":
|
|
407
|
+
return { ...base, left: -4, top: "50%", marginTop: -4 };
|
|
408
|
+
case "left":
|
|
409
|
+
return { ...base, right: -4, top: "50%", marginTop: -4 };
|
|
410
|
+
case "bottom":
|
|
411
|
+
default:
|
|
412
|
+
return { ...base, top: -4, ...x };
|
|
413
|
+
}
|
|
414
|
+
};
|
|
415
|
+
var PopoverContent = ({
|
|
416
|
+
position = "bottom",
|
|
417
|
+
align = "center",
|
|
418
|
+
"aria-label": ariaLabel,
|
|
419
|
+
offset = 8,
|
|
420
|
+
arrow = false,
|
|
421
|
+
width = "w-64",
|
|
422
|
+
className,
|
|
423
|
+
children
|
|
424
|
+
}) => {
|
|
425
|
+
const { open, setOpen, triggerRect } = useCtx();
|
|
426
|
+
if (!open || !triggerRect) return null;
|
|
427
|
+
return reactDom.createPortal(
|
|
428
|
+
/* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
429
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "fixed inset-0 z-[9998]", onClick: () => setOpen(false) }),
|
|
430
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
431
|
+
"div",
|
|
432
|
+
{
|
|
433
|
+
role: "dialog",
|
|
434
|
+
"aria-label": ariaLabel,
|
|
435
|
+
style: positionStyle(position, align, triggerRect, offset),
|
|
436
|
+
className: clsx.clsx(
|
|
437
|
+
"fixed z-[9999] rounded-xl border border-gray-200 bg-white p-4 text-sm shadow-xl dark:border-gray-700 dark:bg-gray-900 dark:text-gray-100",
|
|
438
|
+
width,
|
|
439
|
+
className
|
|
440
|
+
),
|
|
441
|
+
children: [
|
|
442
|
+
arrow && /* @__PURE__ */ jsxRuntime.jsx(
|
|
443
|
+
"span",
|
|
444
|
+
{
|
|
445
|
+
"aria-hidden": true,
|
|
446
|
+
style: arrowStyle(position, align, triggerRect),
|
|
447
|
+
className: "border border-gray-200 bg-white dark:border-gray-700 dark:bg-gray-900"
|
|
448
|
+
}
|
|
449
|
+
),
|
|
450
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative", children })
|
|
451
|
+
]
|
|
452
|
+
}
|
|
453
|
+
)
|
|
454
|
+
] }),
|
|
455
|
+
document.body
|
|
456
|
+
);
|
|
457
|
+
};
|
|
458
|
+
var Popover = Object.assign(PopoverRoot, {
|
|
459
|
+
Trigger: PopoverTrigger,
|
|
460
|
+
Content: PopoverContent
|
|
461
|
+
});
|
|
272
462
|
var SidebarContext = react.createContext({ collapsed: false });
|
|
273
463
|
var useSidebarCollapsed = (override) => {
|
|
274
464
|
const ctx = react.useContext(SidebarContext);
|
|
275
465
|
return override ?? ctx.collapsed;
|
|
276
466
|
};
|
|
467
|
+
var SidebarDepthContext = react.createContext(0);
|
|
468
|
+
var rowPadding = (depth) => 12 + depth * 20;
|
|
469
|
+
var guideLeft = (depth) => 8 + rowPadding(depth) + 10;
|
|
277
470
|
var SidebarRoot = ({
|
|
278
471
|
collapsed = false,
|
|
279
472
|
width = 264,
|
|
280
473
|
collapsedWidth = 72,
|
|
281
474
|
children,
|
|
282
475
|
footer,
|
|
476
|
+
onCollapsedChange,
|
|
283
477
|
className
|
|
284
478
|
}) => /* @__PURE__ */ jsxRuntime.jsx(SidebarContext.Provider, { value: { collapsed }, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
285
479
|
"nav",
|
|
@@ -293,10 +487,32 @@ var SidebarRoot = ({
|
|
|
293
487
|
),
|
|
294
488
|
children: [
|
|
295
489
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-x-hidden overflow-y-auto", children }),
|
|
296
|
-
footer && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 overflow-hidden border-t border-[var(--color-border)] p-3", children: footer })
|
|
490
|
+
footer && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 overflow-hidden border-t border-[var(--color-border)] p-3", children: footer }),
|
|
491
|
+
onCollapsedChange && /* @__PURE__ */ jsxRuntime.jsx(CollapseButton, { collapsed, onClick: () => onCollapsedChange(!collapsed) })
|
|
297
492
|
]
|
|
298
493
|
}
|
|
299
494
|
) });
|
|
495
|
+
var CollapseButton = ({ collapsed, onClick }) => {
|
|
496
|
+
const Icon2 = collapsed ? lucideReact.PanelLeftOpen : lucideReact.PanelLeftClose;
|
|
497
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 border-t border-[var(--color-border)] py-2", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
498
|
+
"button",
|
|
499
|
+
{
|
|
500
|
+
type: "button",
|
|
501
|
+
onClick,
|
|
502
|
+
"aria-label": collapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
503
|
+
"aria-expanded": !collapsed,
|
|
504
|
+
title: collapsed ? "Expand sidebar" : void 0,
|
|
505
|
+
className: clsx.clsx(
|
|
506
|
+
"focus-visible:ring-brand-500 mx-2 flex w-[calc(100%-1rem)] items-center gap-3 rounded-lg py-2 text-sm font-medium text-[var(--color-text-secondary)] transition-colors hover:bg-black/5 hover:text-[var(--color-text-primary)] focus:outline-none focus-visible:ring-2 dark:hover:bg-white/5",
|
|
507
|
+
collapsed ? "justify-center px-2" : "px-3"
|
|
508
|
+
),
|
|
509
|
+
children: [
|
|
510
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "h-5 w-5 shrink-0", "aria-hidden": true }),
|
|
511
|
+
!collapsed && /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Collapse" })
|
|
512
|
+
]
|
|
513
|
+
}
|
|
514
|
+
) });
|
|
515
|
+
};
|
|
300
516
|
var SidebarBrand = ({
|
|
301
517
|
logo,
|
|
302
518
|
title,
|
|
@@ -339,15 +555,17 @@ var SidebarItem = ({
|
|
|
339
555
|
onClick,
|
|
340
556
|
badge,
|
|
341
557
|
collapsed: collapsedProp,
|
|
342
|
-
depth
|
|
558
|
+
depth: depthProp
|
|
343
559
|
}) => {
|
|
344
560
|
const collapsed = useSidebarCollapsed(collapsedProp);
|
|
561
|
+
const contextDepth = react.useContext(SidebarDepthContext);
|
|
562
|
+
const depth = depthProp ?? contextDepth;
|
|
345
563
|
const baseClass = clsx.clsx(
|
|
346
564
|
"group mx-2 flex items-center gap-3 rounded-lg py-2 text-sm font-medium transition-colors",
|
|
347
565
|
collapsed ? "justify-center px-2" : "px-3",
|
|
348
566
|
active ? "bg-brand-500/10 text-brand-600 dark:text-brand-400" : "text-[var(--color-text-secondary)] hover:bg-black/5 hover:text-[var(--color-text-primary)] dark:hover:bg-white/5"
|
|
349
567
|
);
|
|
350
|
-
const style = !collapsed && depth > 0 ? { paddingLeft:
|
|
568
|
+
const style = !collapsed && depth > 0 ? { paddingLeft: rowPadding(depth) } : void 0;
|
|
351
569
|
const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
352
570
|
/* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "h-5 w-5 shrink-0" }),
|
|
353
571
|
!collapsed && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -364,6 +582,7 @@ var SidebarItem = ({
|
|
|
364
582
|
className: baseClass,
|
|
365
583
|
style,
|
|
366
584
|
"aria-current": active ? "page" : void 0,
|
|
585
|
+
"data-sidebar-item": "",
|
|
367
586
|
children: content
|
|
368
587
|
}
|
|
369
588
|
);
|
|
@@ -377,10 +596,15 @@ var SidebarItem = ({
|
|
|
377
596
|
className: clsx.clsx(baseClass, "w-[calc(100%-1rem)] text-left"),
|
|
378
597
|
style,
|
|
379
598
|
"aria-current": active ? "page" : void 0,
|
|
599
|
+
"data-sidebar-item": "",
|
|
380
600
|
children: content
|
|
381
601
|
}
|
|
382
602
|
);
|
|
383
603
|
};
|
|
604
|
+
var SUBMENU_ROW = (active) => clsx.clsx(
|
|
605
|
+
"group mx-2 flex w-[calc(100%-1rem)] items-center rounded-lg py-2 text-sm font-medium transition-colors",
|
|
606
|
+
active ? "bg-brand-500/10 text-brand-600 dark:text-brand-400" : "text-[var(--color-text-secondary)] hover:bg-black/5 hover:text-[var(--color-text-primary)] dark:hover:bg-white/5"
|
|
607
|
+
);
|
|
384
608
|
var SidebarSubMenu = ({
|
|
385
609
|
icon: Icon2,
|
|
386
610
|
label,
|
|
@@ -391,20 +615,35 @@ var SidebarSubMenu = ({
|
|
|
391
615
|
children
|
|
392
616
|
}) => {
|
|
393
617
|
const collapsed = useSidebarCollapsed(collapsedProp);
|
|
618
|
+
const depth = react.useContext(SidebarDepthContext);
|
|
394
619
|
const [open, setOpen] = react.useState(defaultOpen || active);
|
|
620
|
+
const [flyoutOpen, setFlyoutOpen] = react.useState(false);
|
|
395
621
|
if (collapsed) {
|
|
396
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
}
|
|
407
|
-
|
|
622
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: flyoutOpen, onOpenChange: setFlyoutOpen, children: [
|
|
623
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
624
|
+
Popover.Trigger,
|
|
625
|
+
{
|
|
626
|
+
title: label,
|
|
627
|
+
"aria-label": label,
|
|
628
|
+
className: clsx.clsx(SUBMENU_ROW(active), "justify-center px-2"),
|
|
629
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "h-5 w-5 shrink-0" })
|
|
630
|
+
}
|
|
631
|
+
),
|
|
632
|
+
/* @__PURE__ */ jsxRuntime.jsx(Popover.Content, { position: "right", "aria-label": label, width: "w-64", className: "p-2!", children: /* @__PURE__ */ jsxRuntime.jsx(SidebarContext.Provider, { value: { collapsed: false }, children: /* @__PURE__ */ jsxRuntime.jsxs(SidebarDepthContext.Provider, { value: 0, children: [
|
|
633
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-3 pt-1 pb-2 text-xs font-semibold tracking-wider text-[var(--color-text-muted)] uppercase", children: label }),
|
|
634
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
635
|
+
"div",
|
|
636
|
+
{
|
|
637
|
+
className: "-mx-2 space-y-0.5",
|
|
638
|
+
onClick: (e) => {
|
|
639
|
+
if (e.target.closest("[data-sidebar-item]"))
|
|
640
|
+
setFlyoutOpen(false);
|
|
641
|
+
},
|
|
642
|
+
children
|
|
643
|
+
}
|
|
644
|
+
)
|
|
645
|
+
] }) }) })
|
|
646
|
+
] });
|
|
408
647
|
}
|
|
409
648
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
410
649
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -413,10 +652,8 @@ var SidebarSubMenu = ({
|
|
|
413
652
|
type: "button",
|
|
414
653
|
onClick: () => setOpen((v) => !v),
|
|
415
654
|
"aria-expanded": open,
|
|
416
|
-
className: clsx.clsx(
|
|
417
|
-
|
|
418
|
-
active ? "bg-brand-500/10 text-brand-600 dark:text-brand-400" : "text-[var(--color-text-secondary)] hover:bg-black/5 hover:text-[var(--color-text-primary)] dark:hover:bg-white/5"
|
|
419
|
-
),
|
|
655
|
+
className: clsx.clsx(SUBMENU_ROW(active), "gap-3 px-3 text-left"),
|
|
656
|
+
style: depth > 0 ? { paddingLeft: rowPadding(depth) } : void 0,
|
|
420
657
|
children: [
|
|
421
658
|
/* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "h-5 w-5 shrink-0" }),
|
|
422
659
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 truncate", children: label }),
|
|
@@ -433,7 +670,17 @@ var SidebarSubMenu = ({
|
|
|
433
670
|
]
|
|
434
671
|
}
|
|
435
672
|
),
|
|
436
|
-
open && /* @__PURE__ */ jsxRuntime.
|
|
673
|
+
open && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative mt-0.5 space-y-0.5", children: [
|
|
674
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
675
|
+
"span",
|
|
676
|
+
{
|
|
677
|
+
"aria-hidden": true,
|
|
678
|
+
className: "absolute top-0 bottom-0 w-px bg-[var(--color-border)]",
|
|
679
|
+
style: { left: guideLeft(depth) }
|
|
680
|
+
}
|
|
681
|
+
),
|
|
682
|
+
/* @__PURE__ */ jsxRuntime.jsx(SidebarDepthContext.Provider, { value: depth + 1, children })
|
|
683
|
+
] })
|
|
437
684
|
] });
|
|
438
685
|
};
|
|
439
686
|
var SidebarGroup = ({
|
|
@@ -453,7 +700,7 @@ var SidebarGroup = ({
|
|
|
453
700
|
{
|
|
454
701
|
type: "button",
|
|
455
702
|
onClick: () => setOpen((v) => !v),
|
|
456
|
-
className: "mx-2 flex w-[calc(100%-1rem)] items-center gap-2 px-3 py-1.5
|
|
703
|
+
className: "text-3xs mx-2 flex w-[calc(100%-1rem)] items-center gap-2 px-3 py-1.5 font-bold tracking-wider text-[var(--color-text-muted)] uppercase hover:text-[var(--color-text-secondary)]",
|
|
457
704
|
children: [
|
|
458
705
|
open ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-3 w-3" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-3 w-3" }),
|
|
459
706
|
label
|
|
@@ -466,7 +713,7 @@ var SidebarGroup = ({
|
|
|
466
713
|
var SidebarSection = ({ label, collapsed: collapsedProp, children }) => {
|
|
467
714
|
const collapsed = useSidebarCollapsed(collapsedProp);
|
|
468
715
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "my-2 border-t border-[var(--color-border)] pt-2", children: [
|
|
469
|
-
label && !collapsed && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-5 py-1.5
|
|
716
|
+
label && !collapsed && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-3xs px-5 py-1.5 font-bold tracking-wider text-[var(--color-text-muted)] uppercase", children: label }),
|
|
470
717
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-0.5", children })
|
|
471
718
|
] });
|
|
472
719
|
};
|
|
@@ -489,17 +736,22 @@ var PageBreadcrumb = ({ items, className }) => /* @__PURE__ */ jsxRuntime.jsx("n
|
|
|
489
736
|
isLast ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-[var(--color-text-primary)]", children: item.label }) : item.onClick ? /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: item.onClick, className: linkClass, children: renderInner }) : /* @__PURE__ */ jsxRuntime.jsx("a", { href: item.href ?? "#", className: clsx.clsx(linkClass), children: renderInner })
|
|
490
737
|
] }, item.label);
|
|
491
738
|
}) }) });
|
|
492
|
-
var Root3 = ({ title, description, breadcrumb, meta, actions, className }) =>
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
] })
|
|
739
|
+
var Root3 = ({ title, description, breadcrumb, meta, actions, className }) => (
|
|
740
|
+
// The title column asks for 16rem: when that and the actions don't both fit
|
|
741
|
+
// (a phone, a narrow pane), the actions wrap under the title instead of
|
|
742
|
+
// squeezing it until its words run under the buttons.
|
|
743
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex flex-wrap items-start justify-between gap-4 ${className ?? ""}`, children: [
|
|
744
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 grow basis-64", children: [
|
|
745
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-xl font-bold text-[var(--color-text-primary)]", children: title }),
|
|
746
|
+
breadcrumb && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1.5", children: breadcrumb }),
|
|
747
|
+
!breadcrumb && description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-sm text-[var(--color-text-secondary)]", children: description }),
|
|
748
|
+
meta && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-2 flex flex-wrap items-center gap-x-6 gap-y-1 text-sm text-[var(--color-text-secondary)]", children: meta })
|
|
749
|
+
] }),
|
|
750
|
+
actions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex shrink-0 items-center gap-2", children: actions })
|
|
751
|
+
] })
|
|
752
|
+
);
|
|
501
753
|
var MetaItem = ({ icon: Icon2, children }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center", children: [
|
|
502
|
-
Icon2 && /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "mr-1.5 size-5 text-[var(--color-text-muted)]", "aria-hidden": true }),
|
|
754
|
+
Icon2 && /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "mr-1.5 size-5 shrink-0 text-[var(--color-text-muted)]", "aria-hidden": true }),
|
|
503
755
|
children
|
|
504
756
|
] });
|
|
505
757
|
var PageHeader = Object.assign(Root3, { MetaItem });
|
|
@@ -575,16 +827,6 @@ var SectionCard = ({
|
|
|
575
827
|
}
|
|
576
828
|
);
|
|
577
829
|
};
|
|
578
|
-
var PageCard = ({ children, className }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
579
|
-
"div",
|
|
580
|
-
{
|
|
581
|
-
className: clsx.clsx(
|
|
582
|
-
"min-h-[60vh] rounded-2xl border border-[var(--color-border)] bg-[var(--color-bg-panel)] px-5 py-8 xl:px-10 xl:py-12",
|
|
583
|
-
className
|
|
584
|
-
),
|
|
585
|
-
children
|
|
586
|
-
}
|
|
587
|
-
);
|
|
588
830
|
var ContentNarrow = ({ children, maxWidth = 680, className }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: `mx-auto w-full ${className ?? ""}`, style: { maxWidth }, children });
|
|
589
831
|
var ColBox = ({ label, height = 80, className }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
590
832
|
"div",
|
|
@@ -689,7 +931,7 @@ var SkeletonList = ({ rows = 4, showAction = true, className }) => /* @__PURE__
|
|
|
689
931
|
i
|
|
690
932
|
)) });
|
|
691
933
|
var SIZE_CLASS = {
|
|
692
|
-
sm: "px-1.5 py-0.5 text-
|
|
934
|
+
sm: "px-1.5 py-0.5 text-3xs",
|
|
693
935
|
md: "px-2 py-0.5 text-xs",
|
|
694
936
|
lg: "px-3 py-1 text-sm"
|
|
695
937
|
};
|
|
@@ -829,7 +1071,7 @@ var StackedListItem = react.forwardRef(function StackedListItem2({ avatar, title
|
|
|
829
1071
|
] }),
|
|
830
1072
|
(meta || trailing || isLinked && chevron) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-x-4", children: [
|
|
831
1073
|
meta && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "hidden sm:flex sm:flex-col sm:items-end", children: meta }),
|
|
832
|
-
trailing,
|
|
1074
|
+
trailing && (isLinked ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative flex items-center gap-x-4", children: trailing }) : trailing),
|
|
833
1075
|
isLinked && chevron && /* @__PURE__ */ jsxRuntime.jsx(
|
|
834
1076
|
lucideReact.ChevronRight,
|
|
835
1077
|
{
|
|
@@ -875,9 +1117,9 @@ var ContentStackedListItem = react.forwardRef(
|
|
|
875
1117
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm/6 font-semibold text-gray-900 dark:text-white", children: titleEl }),
|
|
876
1118
|
badge
|
|
877
1119
|
] }),
|
|
878
|
-
hasMeta && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1 flex items-center gap-x-2 text-xs/5 text-gray-500 dark:text-gray-400", children: react.Children.toArray(metaItems).map((item, i) => /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
|
|
1120
|
+
hasMeta && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1 flex items-center gap-x-2 text-xs/5 text-gray-500 dark:text-gray-400", children: react.Children.toArray(metaItems).map((item, i, items) => /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
|
|
879
1121
|
i > 0 && /* @__PURE__ */ jsxRuntime.jsx(Dot, {}),
|
|
880
|
-
item
|
|
1122
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: i === items.length - 1 ? "truncate" : "whitespace-nowrap", children: item })
|
|
881
1123
|
] }, i)) })
|
|
882
1124
|
] }),
|
|
883
1125
|
trailing && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-none items-center gap-x-4", children: trailing })
|
|
@@ -934,7 +1176,7 @@ var NarrowStackedListHeader = react.forwardRef(
|
|
|
934
1176
|
{
|
|
935
1177
|
ref,
|
|
936
1178
|
className: clsx.clsx(
|
|
937
|
-
"border-t border-b border-t-gray-200 border-b-gray-200 bg-gray-50 px-3 py-1.5 text-sm/6 font-semibold text-gray-900 dark:border-t-white/10 dark:border-b-white/10 dark:bg-gray-800
|
|
1179
|
+
"border-t border-b border-t-gray-200 border-b-gray-200 bg-gray-50 px-3 py-1.5 text-sm/6 font-semibold text-gray-900 dark:border-t-white/10 dark:border-b-white/10 dark:bg-gray-800 dark:text-white",
|
|
938
1180
|
sticky && "sticky top-0 z-10",
|
|
939
1181
|
className
|
|
940
1182
|
),
|
|
@@ -957,7 +1199,8 @@ var NarrowStackedListItem = react.forwardRef(
|
|
|
957
1199
|
] }),
|
|
958
1200
|
description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 line-clamp-2 text-sm/6 text-gray-600 dark:text-gray-400", children: description }),
|
|
959
1201
|
!description && subtitle && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 truncate text-xs/5 text-gray-500 dark:text-gray-400", children: subtitle })
|
|
960
|
-
] })
|
|
1202
|
+
] }),
|
|
1203
|
+
trailing && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-none items-center", children: trailing })
|
|
961
1204
|
] });
|
|
962
1205
|
}
|
|
963
1206
|
if (trailing) {
|
|
@@ -1058,7 +1301,7 @@ var StatusRow = ({
|
|
|
1058
1301
|
"span",
|
|
1059
1302
|
{
|
|
1060
1303
|
className: clsx.clsx(
|
|
1061
|
-
"shrink-0 rounded-full px-2 py-0.5
|
|
1304
|
+
"text-3xs shrink-0 rounded-full px-2 py-0.5 font-bold",
|
|
1062
1305
|
STATUS_CLASS2[status]
|
|
1063
1306
|
),
|
|
1064
1307
|
children: status
|
|
@@ -1163,18 +1406,21 @@ var Footer = react.forwardRef(function GridListFooter({ className, children, ...
|
|
|
1163
1406
|
});
|
|
1164
1407
|
var FooterAction = react.forwardRef(
|
|
1165
1408
|
function GridListFooterAction({ index = 0, className, children, ...rest }, ref) {
|
|
1166
|
-
return
|
|
1167
|
-
|
|
1168
|
-
{
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
className
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1409
|
+
return (
|
|
1410
|
+
// The cell's position picks the card corner it rounds: first bottom-left, last bottom-right.
|
|
1411
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx.clsx("group/action flex w-0 flex-1", index > 0 && "-ml-px"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1412
|
+
"a",
|
|
1413
|
+
{
|
|
1414
|
+
ref,
|
|
1415
|
+
className: clsx.clsx(
|
|
1416
|
+
"relative inline-flex w-0 flex-1 items-center justify-center gap-x-3 border border-transparent py-4 text-sm font-semibold text-gray-900 group-first/action:rounded-bl-lg group-last/action:rounded-br-lg hover:bg-gray-50 dark:text-white dark:hover:bg-white/5",
|
|
1417
|
+
className
|
|
1418
|
+
),
|
|
1419
|
+
...rest,
|
|
1420
|
+
children
|
|
1421
|
+
}
|
|
1422
|
+
) })
|
|
1423
|
+
);
|
|
1178
1424
|
}
|
|
1179
1425
|
);
|
|
1180
1426
|
var GridList = Object.assign(Root5, {
|
|
@@ -1238,74 +1484,73 @@ var Breadcrumb = ({ items, separator = "chevron", className }) => /* @__PURE__ *
|
|
|
1238
1484
|
);
|
|
1239
1485
|
var ROOT_BG = {
|
|
1240
1486
|
light: "bg-white shadow-sm border-b border-gray-200 dark:bg-gray-800 dark:border-white/10",
|
|
1241
|
-
dark: "bg-gray-800"
|
|
1487
|
+
dark: "bg-gray-800 text-white"
|
|
1242
1488
|
};
|
|
1243
|
-
var ITEM_BASE =
|
|
1244
|
-
|
|
1245
|
-
|
|
1489
|
+
var ITEM_BASE = "rounded-md px-3 py-2 text-sm font-medium";
|
|
1490
|
+
var ITEM_IDLE = {
|
|
1491
|
+
light: "text-gray-700 hover:bg-gray-100 dark:text-gray-200 dark:hover:bg-white/5",
|
|
1492
|
+
dark: "text-gray-300 hover:bg-gray-700 hover:text-white"
|
|
1246
1493
|
};
|
|
1247
1494
|
var ITEM_ACTIVE = {
|
|
1248
1495
|
light: "bg-gray-100 text-gray-900 dark:bg-white/10 dark:text-white",
|
|
1249
1496
|
dark: "bg-gray-900 text-white"
|
|
1250
1497
|
};
|
|
1498
|
+
var NavbarThemeContext = react.createContext("light");
|
|
1251
1499
|
var RootCmp = react.forwardRef(function NavbarRoot({ theme = "light", maxWidth = "7xl", heightClassName = "h-16", className, children, ...rest }, ref) {
|
|
1252
|
-
return /* @__PURE__ */ jsxRuntime.jsx("nav", { ref, className: clsx.clsx(ROOT_BG[theme], className), "data-theme": theme, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx.clsx("px-4 sm:px-6 lg:px-8", maxWidth === "7xl" && "mx-auto max-w-7xl"), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx.clsx("flex items-center justify-between", heightClassName), children }) }) });
|
|
1500
|
+
return /* @__PURE__ */ jsxRuntime.jsx("nav", { ref, className: clsx.clsx(ROOT_BG[theme], className), "data-theme": theme, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx.clsx("px-4 sm:px-6 lg:px-8", maxWidth === "7xl" && "mx-auto max-w-7xl"), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx.clsx("flex items-center justify-between", heightClassName), children: /* @__PURE__ */ jsxRuntime.jsx(NavbarThemeContext.Provider, { value: theme, children }) }) }) });
|
|
1253
1501
|
});
|
|
1254
1502
|
var Brand = ({ className, children, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx.clsx("flex shrink-0 items-center", className), ...rest, children });
|
|
1255
1503
|
var Items = ({ className, children, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx.clsx("hidden md:ml-10 md:block", className), ...rest, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-baseline space-x-4", children }) });
|
|
1256
|
-
var Item2 = ({
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
}
|
|
1270
|
-
);
|
|
1504
|
+
var Item2 = ({ active = false, theme, className, children, ...rest }) => {
|
|
1505
|
+
const inherited = react.useContext(NavbarThemeContext);
|
|
1506
|
+
const resolved = theme ?? inherited;
|
|
1507
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1508
|
+
"a",
|
|
1509
|
+
{
|
|
1510
|
+
"aria-current": active ? "page" : void 0,
|
|
1511
|
+
className: clsx.clsx(ITEM_BASE, active ? ITEM_ACTIVE[resolved] : ITEM_IDLE[resolved], className),
|
|
1512
|
+
...rest,
|
|
1513
|
+
children
|
|
1514
|
+
}
|
|
1515
|
+
);
|
|
1516
|
+
};
|
|
1271
1517
|
var Actions = ({ className, children, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx.clsx("hidden md:block", className), ...rest, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-4 flex items-center gap-3 md:ml-6", children }) });
|
|
1272
|
-
var MobileMenuButton = ({
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
);
|
|
1518
|
+
var MobileMenuButton = ({ theme, className, children, ...rest }) => {
|
|
1519
|
+
const inherited = react.useContext(NavbarThemeContext);
|
|
1520
|
+
const resolved = theme ?? inherited;
|
|
1521
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1522
|
+
"button",
|
|
1523
|
+
{
|
|
1524
|
+
type: "button",
|
|
1525
|
+
"aria-label": "Toggle menu",
|
|
1526
|
+
className: clsx.clsx(
|
|
1527
|
+
"relative inline-flex size-10 items-center justify-center rounded-md md:hidden",
|
|
1528
|
+
resolved === "dark" ? "text-gray-400 hover:bg-gray-700 hover:text-white focus-visible:outline focus-visible:outline-2 focus-visible:outline-white" : "focus-visible:outline-brand-500 text-gray-500 hover:bg-gray-100 hover:text-gray-700 focus-visible:outline focus-visible:outline-2 dark:text-gray-400 dark:hover:bg-white/5 dark:hover:text-white",
|
|
1529
|
+
className
|
|
1530
|
+
),
|
|
1531
|
+
...rest,
|
|
1532
|
+
children: children ?? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1533
|
+
"svg",
|
|
1534
|
+
{
|
|
1535
|
+
className: "size-6",
|
|
1536
|
+
fill: "none",
|
|
1537
|
+
viewBox: "0 0 24 24",
|
|
1538
|
+
strokeWidth: "1.5",
|
|
1539
|
+
stroke: "currentColor",
|
|
1540
|
+
"aria-hidden": true,
|
|
1541
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1542
|
+
"path",
|
|
1543
|
+
{
|
|
1544
|
+
strokeLinecap: "round",
|
|
1545
|
+
strokeLinejoin: "round",
|
|
1546
|
+
d: "M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"
|
|
1547
|
+
}
|
|
1548
|
+
)
|
|
1549
|
+
}
|
|
1550
|
+
)
|
|
1551
|
+
}
|
|
1552
|
+
);
|
|
1553
|
+
};
|
|
1309
1554
|
var Navbar = Object.assign(RootCmp, {
|
|
1310
1555
|
Brand,
|
|
1311
1556
|
Items,
|
|
@@ -1622,7 +1867,7 @@ var StepperRoot = ({
|
|
|
1622
1867
|
react.isValidElement
|
|
1623
1868
|
);
|
|
1624
1869
|
const effectiveOrientation = variant === "indicators" ? orientation : "horizontal";
|
|
1625
|
-
const rootClass = variant === "panels" ? "divide-y divide-gray-200 overflow-hidden rounded-md border border-gray-300 md:flex md:divide-
|
|
1870
|
+
const rootClass = variant === "panels" ? "divide-y divide-gray-200 overflow-hidden rounded-md border border-gray-300 md:flex md:divide-y-0 dark:divide-white/10 dark:border-white/10" : variant === "bars" ? "space-y-4 md:flex md:space-y-0 md:space-x-8" : effectiveOrientation === "horizontal" ? "flex w-full items-start" : "flex flex-col";
|
|
1626
1871
|
return /* @__PURE__ */ jsxRuntime.jsx("ol", { className: clsx.clsx(rootClass, className), "aria-label": "Progress", children: steps.map((step, i) => {
|
|
1627
1872
|
const status = i < current ? "done" : i === current ? "active" : "pending";
|
|
1628
1873
|
return react.cloneElement(step, {
|
|
@@ -1707,18 +1952,25 @@ var VARIANT_CLASS = {
|
|
|
1707
1952
|
soft: "bg-brand-50 text-brand-700 hover:bg-brand-100 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-brand-500/10 dark:text-brand-300 dark:hover:bg-brand-500/20"
|
|
1708
1953
|
};
|
|
1709
1954
|
var SIZE_CLASS2 = {
|
|
1710
|
-
xs: "h-7
|
|
1711
|
-
sm: "h-8
|
|
1712
|
-
md: "h-9
|
|
1713
|
-
lg: "h-11
|
|
1714
|
-
xl: "h-12
|
|
1955
|
+
xs: "h-7 text-xs gap-1",
|
|
1956
|
+
sm: "h-8 text-xs gap-1.5",
|
|
1957
|
+
md: "h-9 text-sm gap-2",
|
|
1958
|
+
lg: "h-11 text-base gap-2",
|
|
1959
|
+
xl: "h-12 text-base gap-2.5"
|
|
1960
|
+
};
|
|
1961
|
+
var PADDING_X = {
|
|
1962
|
+
xs: "px-2",
|
|
1963
|
+
sm: "px-3",
|
|
1964
|
+
md: "px-3.5",
|
|
1965
|
+
lg: "px-5",
|
|
1966
|
+
xl: "px-6"
|
|
1715
1967
|
};
|
|
1716
1968
|
var CIRCLE_SQUARE = {
|
|
1717
|
-
xs: "w-7
|
|
1718
|
-
sm: "w-8
|
|
1719
|
-
md: "w-9
|
|
1720
|
-
lg: "w-11
|
|
1721
|
-
xl: "w-12
|
|
1969
|
+
xs: "w-7",
|
|
1970
|
+
sm: "w-8",
|
|
1971
|
+
md: "w-9",
|
|
1972
|
+
lg: "w-11",
|
|
1973
|
+
xl: "w-12"
|
|
1722
1974
|
};
|
|
1723
1975
|
var SHAPE_CLASS = {
|
|
1724
1976
|
rounded: "rounded-lg",
|
|
@@ -1754,7 +2006,7 @@ var Button = ({
|
|
|
1754
2006
|
VARIANT_CLASS[variant],
|
|
1755
2007
|
SIZE_CLASS2[size],
|
|
1756
2008
|
SHAPE_CLASS[shape],
|
|
1757
|
-
shape === "circle"
|
|
2009
|
+
shape === "circle" ? CIRCLE_SQUARE[size] : PADDING_X[size],
|
|
1758
2010
|
className
|
|
1759
2011
|
),
|
|
1760
2012
|
...rest,
|
|
@@ -1856,7 +2108,7 @@ var VARIANT_SOLID = {
|
|
|
1856
2108
|
info: "bg-blue-500 text-white"
|
|
1857
2109
|
};
|
|
1858
2110
|
var SIZE_CLASS3 = {
|
|
1859
|
-
sm: "px-1.5 py-0.5 text-
|
|
2111
|
+
sm: "px-1.5 py-0.5 text-3xs gap-1",
|
|
1860
2112
|
md: "px-2 py-0.5 text-xs gap-1.5"
|
|
1861
2113
|
};
|
|
1862
2114
|
var ICON_SIZE2 = {
|
|
@@ -1892,7 +2144,7 @@ var Badge = ({
|
|
|
1892
2144
|
);
|
|
1893
2145
|
};
|
|
1894
2146
|
var SIZE_CLASS4 = {
|
|
1895
|
-
xs: "h-6 w-6 text-
|
|
2147
|
+
xs: "h-6 w-6 text-3xs",
|
|
1896
2148
|
sm: "h-8 w-8 text-xs",
|
|
1897
2149
|
md: "h-10 w-10 text-sm",
|
|
1898
2150
|
lg: "h-12 w-12 text-base",
|
|
@@ -1929,6 +2181,21 @@ var Avatar = ({ src, alt, name, size = "md", className }) => {
|
|
|
1929
2181
|
}
|
|
1930
2182
|
);
|
|
1931
2183
|
};
|
|
2184
|
+
var SIZE = {
|
|
2185
|
+
sm: "h-5 min-w-[20px] px-1.5 text-3xs",
|
|
2186
|
+
md: "h-6 min-w-[24px] px-2 text-xs"
|
|
2187
|
+
};
|
|
2188
|
+
var Kbd = ({ children, size = "md", className }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2189
|
+
"kbd",
|
|
2190
|
+
{
|
|
2191
|
+
className: clsx.clsx(
|
|
2192
|
+
"inline-flex shrink-0 items-center justify-center rounded border border-gray-200 bg-gray-50 font-mono font-medium text-gray-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.04)] dark:border-gray-700 dark:bg-gray-800 dark:text-gray-200 dark:shadow-[inset_0_-1px_0_0_rgba(255,255,255,0.04)]",
|
|
2193
|
+
SIZE[size],
|
|
2194
|
+
className
|
|
2195
|
+
),
|
|
2196
|
+
children
|
|
2197
|
+
}
|
|
2198
|
+
);
|
|
1932
2199
|
var BOX_POS = {
|
|
1933
2200
|
top: "bottom-full left-1/2 -translate-x-1/2 mb-2.5",
|
|
1934
2201
|
bottom: "top-full left-1/2 -translate-x-1/2 mt-2.5",
|
|
@@ -1944,54 +2211,124 @@ var ARROW_POS = {
|
|
|
1944
2211
|
var VARIANT_BOX = {
|
|
1945
2212
|
dark: "bg-gray-900 text-white shadow-[0_0_20px_rgba(0,0,0,0.35)] dark:bg-gray-700",
|
|
1946
2213
|
white: "bg-white text-gray-700 border border-gray-200 shadow-[0_0_20px_rgba(0,0,0,0.15)] dark:bg-gray-800 dark:text-gray-200 dark:border-gray-700",
|
|
1947
|
-
brand: "bg-brand-500 text-white shadow-[0_0_20px_rgba(0,0,0,0.25)]"
|
|
2214
|
+
brand: "bg-brand-500 text-white shadow-[0_0_20px_rgba(0,0,0,0.25)]",
|
|
2215
|
+
// Shades picked for 4.5:1 text contrast; amber is too light for white text.
|
|
2216
|
+
success: "bg-green-700 text-white shadow-[0_0_20px_rgba(0,0,0,0.25)]",
|
|
2217
|
+
warning: "bg-amber-400 text-gray-900 shadow-[0_0_20px_rgba(0,0,0,0.25)]",
|
|
2218
|
+
danger: "bg-red-600 text-white shadow-[0_0_20px_rgba(0,0,0,0.25)]"
|
|
1948
2219
|
};
|
|
1949
2220
|
var VARIANT_ARROW = {
|
|
1950
2221
|
dark: "bg-gray-900 dark:bg-gray-700",
|
|
1951
2222
|
white: "bg-white border border-gray-200 dark:bg-gray-800 dark:border-gray-700",
|
|
1952
|
-
brand: "bg-brand-500"
|
|
2223
|
+
brand: "bg-brand-500",
|
|
2224
|
+
success: "bg-green-700",
|
|
2225
|
+
warning: "bg-amber-400",
|
|
2226
|
+
danger: "bg-red-600"
|
|
1953
2227
|
};
|
|
1954
2228
|
var Tooltip = ({
|
|
1955
2229
|
content,
|
|
1956
2230
|
children,
|
|
1957
2231
|
position = "top",
|
|
1958
2232
|
variant = "dark",
|
|
1959
|
-
maxWidth = "max-w-xs"
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
2233
|
+
maxWidth = "max-w-xs",
|
|
2234
|
+
shortcut,
|
|
2235
|
+
title,
|
|
2236
|
+
arrow = true,
|
|
2237
|
+
delay = 0
|
|
2238
|
+
}) => {
|
|
2239
|
+
const id = react.useId();
|
|
2240
|
+
const [open, setOpen] = react.useState(false);
|
|
2241
|
+
const [engaged, setEngaged] = react.useState(false);
|
|
2242
|
+
const timer = react.useRef(void 0);
|
|
2243
|
+
react.useEffect(() => () => clearTimeout(timer.current), []);
|
|
2244
|
+
const show = () => {
|
|
2245
|
+
setEngaged(true);
|
|
2246
|
+
clearTimeout(timer.current);
|
|
2247
|
+
if (delay > 0) timer.current = setTimeout(() => setOpen(true), delay);
|
|
2248
|
+
else setOpen(true);
|
|
2249
|
+
};
|
|
2250
|
+
const hide = () => {
|
|
2251
|
+
setEngaged(false);
|
|
2252
|
+
clearTimeout(timer.current);
|
|
2253
|
+
setOpen(false);
|
|
2254
|
+
};
|
|
2255
|
+
react.useEffect(() => {
|
|
2256
|
+
if (!engaged) return;
|
|
2257
|
+
const onKeyDown = (e) => {
|
|
2258
|
+
if (e.key !== "Escape") return;
|
|
2259
|
+
if (open) e.stopPropagation();
|
|
2260
|
+
clearTimeout(timer.current);
|
|
2261
|
+
setEngaged(false);
|
|
2262
|
+
setOpen(false);
|
|
2263
|
+
};
|
|
2264
|
+
document.addEventListener("keydown", onKeyDown, true);
|
|
2265
|
+
return () => document.removeEventListener("keydown", onKeyDown, true);
|
|
2266
|
+
}, [engaged, open]);
|
|
2267
|
+
const trigger = react.isValidElement(children) ? react.cloneElement(children, {
|
|
2268
|
+
"aria-describedby": [children.props["aria-describedby"], id].filter(Boolean).join(" ")
|
|
2269
|
+
}) : children;
|
|
2270
|
+
return (
|
|
2271
|
+
// `inline-block w-fit` keeps the wrapper exactly the size of the children even
|
|
2272
|
+
// inside grid/flex parents, so the absolute-positioned tooltip stays anchored
|
|
2273
|
+
// on the trigger rather than on the parent cell.
|
|
1966
2274
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1967
2275
|
"span",
|
|
1968
2276
|
{
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
VARIANT_BOX[variant]
|
|
1975
|
-
),
|
|
2277
|
+
className: "relative inline-block w-fit align-middle",
|
|
2278
|
+
onMouseEnter: show,
|
|
2279
|
+
onMouseLeave: hide,
|
|
2280
|
+
onFocus: show,
|
|
2281
|
+
onBlur: hide,
|
|
1976
2282
|
children: [
|
|
1977
|
-
|
|
1978
|
-
/* @__PURE__ */ jsxRuntime.
|
|
2283
|
+
trigger,
|
|
2284
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1979
2285
|
"span",
|
|
1980
2286
|
{
|
|
1981
|
-
|
|
1982
|
-
|
|
2287
|
+
id,
|
|
2288
|
+
role: "tooltip",
|
|
2289
|
+
className: clsx.clsx(
|
|
2290
|
+
"pointer-events-none absolute z-50 block w-max rounded-lg px-3 py-2 text-xs leading-relaxed font-normal whitespace-normal transition-opacity duration-150",
|
|
2291
|
+
open ? "opacity-100" : "opacity-0",
|
|
2292
|
+
maxWidth,
|
|
2293
|
+
BOX_POS[position],
|
|
2294
|
+
VARIANT_BOX[variant]
|
|
2295
|
+
),
|
|
2296
|
+
children: [
|
|
2297
|
+
title && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block font-semibold", children: title }),
|
|
2298
|
+
title ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-0.5 block opacity-80", children: content }) : content,
|
|
2299
|
+
shortcut && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-2 inline-flex gap-0.5 align-middle", children: shortcut.map((key, i) => /* @__PURE__ */ jsxRuntime.jsx(Kbd, { size: "sm", children: key }, i)) }),
|
|
2300
|
+
arrow && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2301
|
+
"span",
|
|
2302
|
+
{
|
|
2303
|
+
"aria-hidden": true,
|
|
2304
|
+
className: clsx.clsx(
|
|
2305
|
+
"absolute h-2 w-2 rotate-45",
|
|
2306
|
+
ARROW_POS[position],
|
|
2307
|
+
VARIANT_ARROW[variant]
|
|
2308
|
+
)
|
|
2309
|
+
}
|
|
2310
|
+
)
|
|
2311
|
+
]
|
|
1983
2312
|
}
|
|
1984
2313
|
)
|
|
1985
2314
|
]
|
|
1986
2315
|
}
|
|
1987
2316
|
)
|
|
1988
|
-
|
|
1989
|
-
|
|
2317
|
+
);
|
|
2318
|
+
};
|
|
1990
2319
|
var TooltipHelp = ({
|
|
1991
2320
|
text,
|
|
1992
2321
|
position = "top",
|
|
1993
2322
|
variant = "dark"
|
|
1994
|
-
}) => /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { content: text, position, variant, maxWidth: "max-w-[260px]", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2323
|
+
}) => /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { content: text, position, variant, maxWidth: "max-w-[260px]", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2324
|
+
"button",
|
|
2325
|
+
{
|
|
2326
|
+
type: "button",
|
|
2327
|
+
"aria-label": "Help",
|
|
2328
|
+
className: "focus-visible:ring-brand-500 inline-flex cursor-help rounded-full text-gray-400 transition-colors hover:text-gray-600 focus:outline-none focus-visible:ring-2 dark:text-gray-500 dark:hover:text-gray-300",
|
|
2329
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.HelpCircle, { className: "h-3.5 w-3.5", "aria-hidden": true })
|
|
2330
|
+
}
|
|
2331
|
+
) });
|
|
1995
2332
|
var isDivider = (item) => item.divider === true;
|
|
1996
2333
|
var Dropdown = ({
|
|
1997
2334
|
label,
|
|
@@ -2554,25 +2891,91 @@ var useTabs = () => {
|
|
|
2554
2891
|
if (!ctx) throw new Error("Tabs.* must be used inside <Tabs>");
|
|
2555
2892
|
return ctx;
|
|
2556
2893
|
};
|
|
2557
|
-
var
|
|
2894
|
+
var LIST_CLASSES = {
|
|
2895
|
+
underline: {
|
|
2896
|
+
horizontal: "flex items-center gap-1 border-b border-gray-200 dark:border-gray-800",
|
|
2897
|
+
vertical: "flex shrink-0 flex-col gap-1 border-r border-gray-200 dark:border-gray-800"
|
|
2898
|
+
},
|
|
2899
|
+
// The list's border is the panel's edge: it runs under the inactive tabs and
|
|
2900
|
+
// the active tab covers it.
|
|
2901
|
+
folder: {
|
|
2902
|
+
horizontal: "flex items-end gap-1 border-b border-[var(--color-border)]",
|
|
2903
|
+
vertical: "flex shrink-0 flex-col gap-1 border-r border-[var(--color-border)]"
|
|
2904
|
+
}
|
|
2905
|
+
};
|
|
2906
|
+
var TRIGGER_CLASSES = {
|
|
2907
|
+
underline: {
|
|
2908
|
+
horizontal: {
|
|
2909
|
+
base: "-mb-px border-b-2 px-3 py-2",
|
|
2910
|
+
active: "border-brand-500 text-brand-600 dark:text-brand-400",
|
|
2911
|
+
inactive: "border-transparent text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200"
|
|
2912
|
+
},
|
|
2913
|
+
vertical: {
|
|
2914
|
+
base: "-mr-px justify-start rounded-l-lg border-r-2 px-3 py-2 text-left whitespace-nowrap",
|
|
2915
|
+
active: "border-brand-500 bg-brand-50 text-brand-600 dark:bg-brand-500/10 dark:text-brand-400",
|
|
2916
|
+
inactive: "border-transparent text-gray-500 hover:bg-gray-50 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-white/5 dark:hover:text-gray-200"
|
|
2917
|
+
}
|
|
2918
|
+
},
|
|
2919
|
+
// Every tab overlaps the list's border by 1px. The active one has the
|
|
2920
|
+
// panel's background and a transparent edge on the panel side, so it covers
|
|
2921
|
+
// the line and opens into the panel; it is also 4px taller (wider when
|
|
2922
|
+
// vertical) than the inactive ones, which sit on the line with the page's
|
|
2923
|
+
// background. The padding moves with the size so the labels don't shift.
|
|
2924
|
+
folder: {
|
|
2925
|
+
horizontal: {
|
|
2926
|
+
base: "-mb-px rounded-t-lg border border-[var(--color-border)] px-3 pb-2",
|
|
2927
|
+
active: "border-b-transparent bg-[var(--color-bg-panel)] pt-3 text-brand-600 dark:text-brand-400",
|
|
2928
|
+
inactive: "bg-[var(--color-bg-base)] pt-2 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200"
|
|
2929
|
+
},
|
|
2930
|
+
vertical: {
|
|
2931
|
+
base: "-mr-px justify-start rounded-l-lg border border-[var(--color-border)] py-2 pr-3 text-left whitespace-nowrap",
|
|
2932
|
+
active: "border-r-transparent bg-[var(--color-bg-panel)] pl-4 text-brand-600 dark:text-brand-400",
|
|
2933
|
+
inactive: "ml-1 bg-[var(--color-bg-base)] pl-3 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200"
|
|
2934
|
+
}
|
|
2935
|
+
}
|
|
2936
|
+
};
|
|
2937
|
+
var PANEL_CLASSES = {
|
|
2938
|
+
underline: { horizontal: "pt-5", vertical: "flex-1" },
|
|
2939
|
+
// Bordered on three sides: the list's border closes the side facing the tabs.
|
|
2940
|
+
folder: {
|
|
2941
|
+
horizontal: "rounded-b-xl border border-t-0 border-[var(--color-border)] bg-[var(--color-bg-panel)] p-5",
|
|
2942
|
+
vertical: "flex-1 rounded-r-xl border border-l-0 border-[var(--color-border)] bg-[var(--color-bg-panel)] p-5"
|
|
2943
|
+
}
|
|
2944
|
+
};
|
|
2945
|
+
var Root10 = ({
|
|
2946
|
+
value,
|
|
2947
|
+
onChange,
|
|
2948
|
+
orientation = "horizontal",
|
|
2949
|
+
variant = "underline",
|
|
2950
|
+
children,
|
|
2951
|
+
className
|
|
2952
|
+
}) => /* @__PURE__ */ jsxRuntime.jsx(TabsContext.Provider, { value: { value, onChange, orientation, variant }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2953
|
+
"div",
|
|
2954
|
+
{
|
|
2955
|
+
className: clsx.clsx(
|
|
2956
|
+
// Folder tabs touch their panel, so no gap between list and panel.
|
|
2957
|
+
orientation === "vertical" && (variant === "folder" ? "flex" : "flex gap-6"),
|
|
2958
|
+
className
|
|
2959
|
+
),
|
|
2960
|
+
children
|
|
2961
|
+
}
|
|
2962
|
+
) });
|
|
2558
2963
|
var List = ({ children, className }) => {
|
|
2559
|
-
const { orientation } = useTabs();
|
|
2964
|
+
const { orientation, variant } = useTabs();
|
|
2560
2965
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2561
2966
|
"div",
|
|
2562
2967
|
{
|
|
2563
2968
|
role: "tablist",
|
|
2564
2969
|
"aria-orientation": orientation,
|
|
2565
|
-
className: clsx.clsx(
|
|
2566
|
-
orientation === "vertical" ? "flex shrink-0 flex-col gap-1 border-r border-gray-200 dark:border-gray-800" : "flex items-center gap-1 border-b border-gray-200 dark:border-gray-800",
|
|
2567
|
-
className
|
|
2568
|
-
),
|
|
2970
|
+
className: clsx.clsx(LIST_CLASSES[variant][orientation], className),
|
|
2569
2971
|
children
|
|
2570
2972
|
}
|
|
2571
2973
|
);
|
|
2572
2974
|
};
|
|
2573
2975
|
var Trigger = ({ value, children, icon: Icon2, badge, disabled, className }) => {
|
|
2574
|
-
const { value: active, onChange, orientation } = useTabs();
|
|
2976
|
+
const { value: active, onChange, orientation, variant } = useTabs();
|
|
2575
2977
|
const isActive = value === active;
|
|
2978
|
+
const styles = TRIGGER_CLASSES[variant][orientation];
|
|
2576
2979
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2577
2980
|
"button",
|
|
2578
2981
|
{
|
|
@@ -2583,13 +2986,8 @@ var Trigger = ({ value, children, icon: Icon2, badge, disabled, className }) =>
|
|
|
2583
2986
|
onClick: () => onChange(value),
|
|
2584
2987
|
className: clsx.clsx(
|
|
2585
2988
|
"flex items-center gap-2 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
isActive ? "border-brand-500 bg-brand-50 text-brand-600 dark:bg-brand-500/10 dark:text-brand-400" : "border-transparent text-gray-500 hover:bg-gray-50 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-white/5 dark:hover:text-gray-200"
|
|
2589
|
-
) : clsx.clsx(
|
|
2590
|
-
"-mb-px border-b-2 px-3 py-2",
|
|
2591
|
-
isActive ? "border-brand-500 text-brand-600 dark:text-brand-400" : "border-transparent text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200"
|
|
2592
|
-
),
|
|
2989
|
+
styles.base,
|
|
2990
|
+
isActive ? styles.active : styles.inactive,
|
|
2593
2991
|
className
|
|
2594
2992
|
),
|
|
2595
2993
|
children: [
|
|
@@ -2599,7 +2997,7 @@ var Trigger = ({ value, children, icon: Icon2, badge, disabled, className }) =>
|
|
|
2599
2997
|
"span",
|
|
2600
2998
|
{
|
|
2601
2999
|
className: clsx.clsx(
|
|
2602
|
-
"ms-auto rounded-full px-1.5 py-0.5
|
|
3000
|
+
"text-3xs ms-auto rounded-full px-1.5 py-0.5 font-bold",
|
|
2603
3001
|
isActive ? "bg-brand-100 text-brand-600 dark:bg-brand-500/20 dark:text-brand-400" : "bg-gray-100 text-gray-500 dark:bg-gray-800 dark:text-gray-400"
|
|
2604
3002
|
),
|
|
2605
3003
|
children: badge
|
|
@@ -2614,16 +3012,9 @@ var Panel = ({
|
|
|
2614
3012
|
children,
|
|
2615
3013
|
className
|
|
2616
3014
|
}) => {
|
|
2617
|
-
const { value: active, orientation } = useTabs();
|
|
3015
|
+
const { value: active, orientation, variant } = useTabs();
|
|
2618
3016
|
if (value !== active) return null;
|
|
2619
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2620
|
-
"div",
|
|
2621
|
-
{
|
|
2622
|
-
role: "tabpanel",
|
|
2623
|
-
className: clsx.clsx(orientation === "vertical" ? "flex-1" : "pt-5", className),
|
|
2624
|
-
children
|
|
2625
|
-
}
|
|
2626
|
-
);
|
|
3017
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { role: "tabpanel", className: clsx.clsx(PANEL_CLASSES[variant][orientation], className), children });
|
|
2627
3018
|
};
|
|
2628
3019
|
var Tabs = Object.assign(Root10, { List, Trigger, Panel });
|
|
2629
3020
|
var SIZE_ICON = {
|
|
@@ -2713,7 +3104,13 @@ var Clipboard = react.forwardRef(function Clipboard2({
|
|
|
2713
3104
|
}
|
|
2714
3105
|
);
|
|
2715
3106
|
});
|
|
2716
|
-
var CodeBlock = ({
|
|
3107
|
+
var CodeBlock = ({
|
|
3108
|
+
code,
|
|
3109
|
+
language,
|
|
3110
|
+
highlight,
|
|
3111
|
+
showCopy = true,
|
|
3112
|
+
className
|
|
3113
|
+
}) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2717
3114
|
"div",
|
|
2718
3115
|
{
|
|
2719
3116
|
className: clsx.clsx(
|
|
@@ -2722,10 +3119,10 @@ var CodeBlock = ({ code, language, showCopy = true, className }) => /* @__PURE__
|
|
|
2722
3119
|
),
|
|
2723
3120
|
children: [
|
|
2724
3121
|
language && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between border-b border-gray-200 px-4 py-1.5 dark:border-gray-800", children: [
|
|
2725
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-
|
|
3122
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-3xs font-semibold tracking-wider text-gray-500 uppercase dark:text-gray-400", children: language }),
|
|
2726
3123
|
showCopy && /* @__PURE__ */ jsxRuntime.jsx(Clipboard, { value: code, floating: true })
|
|
2727
3124
|
] }),
|
|
2728
|
-
/* @__PURE__ */ jsxRuntime.jsx("pre", { className: "overflow-x-auto p-4 text-xs leading-relaxed text-gray-800 dark:text-gray-200", children: /* @__PURE__ */ jsxRuntime.jsx("code", { children: code }) }),
|
|
3125
|
+
/* @__PURE__ */ jsxRuntime.jsx("pre", { className: "overflow-x-auto p-4 text-xs leading-relaxed text-gray-800 dark:text-gray-200", children: /* @__PURE__ */ jsxRuntime.jsx("code", { children: highlight ? highlight(code, language) : code }) }),
|
|
2729
3126
|
showCopy && !language && /* @__PURE__ */ jsxRuntime.jsx(Clipboard, { value: code, floating: true, className: "absolute top-2 right-2" })
|
|
2730
3127
|
]
|
|
2731
3128
|
}
|
|
@@ -2934,7 +3331,7 @@ var SectionLabel = ({ children, className }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
|
2934
3331
|
"p",
|
|
2935
3332
|
{
|
|
2936
3333
|
className: clsx.clsx(
|
|
2937
|
-
"text-
|
|
3334
|
+
"text-3xs font-semibold tracking-wider text-gray-400 uppercase dark:text-gray-600",
|
|
2938
3335
|
className
|
|
2939
3336
|
),
|
|
2940
3337
|
children
|
|
@@ -3230,7 +3627,7 @@ var BADGE_BG = {
|
|
|
3230
3627
|
success: "bg-green-500"
|
|
3231
3628
|
};
|
|
3232
3629
|
var NotificationsPanelContext = react.createContext(null);
|
|
3233
|
-
var
|
|
3630
|
+
var useCtx2 = () => {
|
|
3234
3631
|
const ctx = react.useContext(NotificationsPanelContext);
|
|
3235
3632
|
if (!ctx) throw new Error("NotificationsPanel.* must be used inside <NotificationsPanel>");
|
|
3236
3633
|
return ctx;
|
|
@@ -3288,7 +3685,7 @@ var NotificationsPanelRoot = ({
|
|
|
3288
3685
|
};
|
|
3289
3686
|
var NotificationsPanelTrigger = react.forwardRef(
|
|
3290
3687
|
function NotificationsPanelTrigger2({ count = 0, muted = false, ping, className, ...rest }, forwardedRef) {
|
|
3291
|
-
const { open, setOpen, triggerRef, refreshRect } =
|
|
3688
|
+
const { open, setOpen, triggerRef, refreshRect } = useCtx2();
|
|
3292
3689
|
const setRef = (node) => {
|
|
3293
3690
|
triggerRef.current = node;
|
|
3294
3691
|
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
@@ -3330,7 +3727,7 @@ var NotificationsPanelContent = ({
|
|
|
3330
3727
|
className,
|
|
3331
3728
|
children
|
|
3332
3729
|
}) => {
|
|
3333
|
-
const { open, setOpen, triggerRect, align } =
|
|
3730
|
+
const { open, setOpen, triggerRect, align } = useCtx2();
|
|
3334
3731
|
if (!open || !triggerRect) return null;
|
|
3335
3732
|
const top = triggerRect.bottom + 8;
|
|
3336
3733
|
const positionStyle2 = align === "right" ? { top, right: window.innerWidth - triggerRect.right } : { top, left: triggerRect.left };
|
|
@@ -3429,7 +3826,7 @@ var NotificationsPanelItem = react.forwardRef(
|
|
|
3429
3826
|
className,
|
|
3430
3827
|
...rest
|
|
3431
3828
|
}, ref) {
|
|
3432
|
-
const { setOpen } =
|
|
3829
|
+
const { setOpen } = useCtx2();
|
|
3433
3830
|
const meta = SEVERITY_META[severity];
|
|
3434
3831
|
const Icon2 = meta.icon;
|
|
3435
3832
|
const defaultLabel = severity === "success" ? "OK" : severity.toUpperCase();
|
|
@@ -3461,13 +3858,13 @@ var NotificationsPanelItem = react.forwardRef(
|
|
|
3461
3858
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
3462
3859
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "truncate text-sm font-semibold text-gray-900 dark:text-white", children: title }),
|
|
3463
3860
|
subtitle && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "truncate text-xs text-gray-500 dark:text-gray-400", children: subtitle }),
|
|
3464
|
-
caption && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 truncate font-mono text-
|
|
3861
|
+
caption && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-3xs mt-0.5 truncate font-mono text-gray-400", children: caption })
|
|
3465
3862
|
] }),
|
|
3466
3863
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3467
3864
|
"span",
|
|
3468
3865
|
{
|
|
3469
3866
|
className: clsx.clsx(
|
|
3470
|
-
"mt-0.5 shrink-0 rounded-full px-2 py-0.5
|
|
3867
|
+
"text-3xs mt-0.5 shrink-0 rounded-full px-2 py-0.5 font-bold text-white",
|
|
3471
3868
|
BADGE_BG[severity]
|
|
3472
3869
|
),
|
|
3473
3870
|
children: badgeLabel ?? defaultLabel
|
|
@@ -3494,7 +3891,7 @@ var NotificationsPanelFooter = ({
|
|
|
3494
3891
|
className,
|
|
3495
3892
|
...rest
|
|
3496
3893
|
}) => {
|
|
3497
|
-
const { setOpen } =
|
|
3894
|
+
const { setOpen } = useCtx2();
|
|
3498
3895
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-gray-100 p-2 dark:border-gray-800", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3499
3896
|
"button",
|
|
3500
3897
|
{
|
|
@@ -3616,7 +4013,7 @@ var NotificationCard = Object.assign(Root11, {
|
|
|
3616
4013
|
Condensed: CondensedVariant
|
|
3617
4014
|
});
|
|
3618
4015
|
var UserMenuContext = react.createContext(null);
|
|
3619
|
-
var
|
|
4016
|
+
var useCtx3 = () => {
|
|
3620
4017
|
const ctx = react.useContext(UserMenuContext);
|
|
3621
4018
|
if (!ctx) throw new Error("UserMenu.* must be used inside <UserMenu>");
|
|
3622
4019
|
return ctx;
|
|
@@ -3672,7 +4069,7 @@ var UserMenuRoot = ({
|
|
|
3672
4069
|
};
|
|
3673
4070
|
var UserMenuTrigger = react.forwardRef(
|
|
3674
4071
|
function UserMenuTrigger2({ name, avatarSrc, hideName = false, className, ...rest }, forwardedRef) {
|
|
3675
|
-
const { open, setOpen, triggerRef, refreshRect } =
|
|
4072
|
+
const { open, setOpen, triggerRef, refreshRect } = useCtx3();
|
|
3676
4073
|
const setRef = (node) => {
|
|
3677
4074
|
triggerRef.current = node;
|
|
3678
4075
|
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
@@ -3713,7 +4110,7 @@ var UserMenuTrigger = react.forwardRef(
|
|
|
3713
4110
|
}
|
|
3714
4111
|
);
|
|
3715
4112
|
var UserMenuContent = ({ width = "w-56", className, children }) => {
|
|
3716
|
-
const { open, setOpen, triggerRect, align } =
|
|
4113
|
+
const { open, setOpen, triggerRect, align } = useCtx3();
|
|
3717
4114
|
if (!open || !triggerRect) return null;
|
|
3718
4115
|
const top = triggerRect.bottom + 8;
|
|
3719
4116
|
const positionStyle2 = align === "right" ? { top, right: window.innerWidth - triggerRect.right } : { top, left: triggerRect.left };
|
|
@@ -3756,7 +4153,7 @@ var UserMenuHeader = ({ name, email, avatarSrc, className }) => /* @__PURE__ */
|
|
|
3756
4153
|
);
|
|
3757
4154
|
var UserMenuItems = ({ children }) => /* @__PURE__ */ jsxRuntime.jsx("div", { role: "group", className: "py-1", children });
|
|
3758
4155
|
var UserMenuItem = react.forwardRef(function UserMenuItem2({ icon: Icon2, variant = "default", closeOnClick = true, onClick, className, children, ...rest }, ref) {
|
|
3759
|
-
const { setOpen } =
|
|
4156
|
+
const { setOpen } = useCtx3();
|
|
3760
4157
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3761
4158
|
"button",
|
|
3762
4159
|
{
|
|
@@ -3933,7 +4330,7 @@ var ButtonGroup = ({
|
|
|
3933
4330
|
);
|
|
3934
4331
|
};
|
|
3935
4332
|
var CarouselContext = react.createContext(null);
|
|
3936
|
-
var
|
|
4333
|
+
var useCtx4 = () => {
|
|
3937
4334
|
const ctx = react.useContext(CarouselContext);
|
|
3938
4335
|
if (!ctx) throw new Error("Carousel.* must be used inside <Carousel>");
|
|
3939
4336
|
return ctx;
|
|
@@ -3989,7 +4386,7 @@ var CarouselRoot = ({
|
|
|
3989
4386
|
);
|
|
3990
4387
|
};
|
|
3991
4388
|
var CarouselViewport = ({ children, className }) => {
|
|
3992
|
-
const { emblaRef } =
|
|
4389
|
+
const { emblaRef } = useCtx4();
|
|
3993
4390
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: emblaRef, className: clsx.clsx("overflow-hidden", className), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex", children }) });
|
|
3994
4391
|
};
|
|
3995
4392
|
var CarouselSlide = ({ basis = "basis-full", className, children }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx.clsx("min-w-0 shrink-0 grow-0 px-1", basis, className), children });
|
|
@@ -3999,7 +4396,7 @@ var CarouselControls = ({
|
|
|
3999
4396
|
prevLabel = "Previous slide",
|
|
4000
4397
|
nextLabel = "Next slide"
|
|
4001
4398
|
}) => {
|
|
4002
|
-
const { scrollPrev, scrollNext, canScrollPrev, canScrollNext } =
|
|
4399
|
+
const { scrollPrev, scrollNext, canScrollPrev, canScrollNext } = useCtx4();
|
|
4003
4400
|
const baseBtn = "flex h-9 w-9 items-center justify-center rounded-full border border-gray-200 bg-white text-gray-600 shadow-sm transition-colors hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-40 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700";
|
|
4004
4401
|
if (position === "outside") {
|
|
4005
4402
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx.clsx("mt-3 flex items-center justify-center gap-2", className), children: [
|
|
@@ -4010,252 +4407,73 @@ var CarouselControls = ({
|
|
|
4010
4407
|
"aria-label": prevLabel,
|
|
4011
4408
|
disabled: !canScrollPrev,
|
|
4012
4409
|
onClick: scrollPrev,
|
|
4013
|
-
className: baseBtn,
|
|
4014
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "h-4 w-4" })
|
|
4015
|
-
}
|
|
4016
|
-
),
|
|
4017
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4018
|
-
"button",
|
|
4019
|
-
{
|
|
4020
|
-
type: "button",
|
|
4021
|
-
"aria-label": nextLabel,
|
|
4022
|
-
disabled: !canScrollNext,
|
|
4023
|
-
onClick: scrollNext,
|
|
4024
|
-
className: baseBtn,
|
|
4025
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4" })
|
|
4026
|
-
}
|
|
4027
|
-
)
|
|
4028
|
-
] });
|
|
4029
|
-
}
|
|
4030
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4031
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4032
|
-
"button",
|
|
4033
|
-
{
|
|
4034
|
-
type: "button",
|
|
4035
|
-
"aria-label": prevLabel,
|
|
4036
|
-
disabled: !canScrollPrev,
|
|
4037
|
-
onClick: scrollPrev,
|
|
4038
|
-
className: clsx.clsx("absolute top-1/2 left-2 z-10 -translate-y-1/2", baseBtn, className),
|
|
4039
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "h-4 w-4" })
|
|
4040
|
-
}
|
|
4041
|
-
),
|
|
4042
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4043
|
-
"button",
|
|
4044
|
-
{
|
|
4045
|
-
type: "button",
|
|
4046
|
-
"aria-label": nextLabel,
|
|
4047
|
-
disabled: !canScrollNext,
|
|
4048
|
-
onClick: scrollNext,
|
|
4049
|
-
className: clsx.clsx("absolute top-1/2 right-2 z-10 -translate-y-1/2", baseBtn, className),
|
|
4050
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4" })
|
|
4051
|
-
}
|
|
4052
|
-
)
|
|
4053
|
-
] });
|
|
4054
|
-
};
|
|
4055
|
-
var CarouselIndicators = ({ className }) => {
|
|
4056
|
-
const { scrollSnaps, selectedIndex, scrollTo } = useCtx3();
|
|
4057
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx.clsx("mt-3 flex items-center justify-center gap-2", className), children: scrollSnaps.map((_, i) => {
|
|
4058
|
-
const active = i === selectedIndex;
|
|
4059
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4060
|
-
"button",
|
|
4061
|
-
{
|
|
4062
|
-
type: "button",
|
|
4063
|
-
"aria-label": `Go to slide ${i + 1}`,
|
|
4064
|
-
"aria-current": active,
|
|
4065
|
-
onClick: () => scrollTo(i),
|
|
4066
|
-
className: clsx.clsx(
|
|
4067
|
-
"h-2 rounded-full transition-all",
|
|
4068
|
-
active ? "bg-brand-500 w-6" : "w-2 bg-gray-300 dark:bg-gray-600"
|
|
4069
|
-
)
|
|
4070
|
-
},
|
|
4071
|
-
i
|
|
4072
|
-
);
|
|
4073
|
-
}) });
|
|
4074
|
-
};
|
|
4075
|
-
var Carousel = Object.assign(CarouselRoot, {
|
|
4076
|
-
Viewport: CarouselViewport,
|
|
4077
|
-
Slide: CarouselSlide,
|
|
4078
|
-
Controls: CarouselControls,
|
|
4079
|
-
Indicators: CarouselIndicators
|
|
4080
|
-
});
|
|
4081
|
-
var PopoverContext = react.createContext(null);
|
|
4082
|
-
var useCtx4 = () => {
|
|
4083
|
-
const ctx = react.useContext(PopoverContext);
|
|
4084
|
-
if (!ctx) throw new Error("Popover.* must be used inside <Popover>");
|
|
4085
|
-
return ctx;
|
|
4086
|
-
};
|
|
4087
|
-
var PopoverRoot = ({
|
|
4088
|
-
open: openProp,
|
|
4089
|
-
defaultOpen = false,
|
|
4090
|
-
onOpenChange,
|
|
4091
|
-
children
|
|
4092
|
-
}) => {
|
|
4093
|
-
const [internalOpen, setInternalOpen] = react.useState(defaultOpen);
|
|
4094
|
-
const isControlled = openProp !== void 0;
|
|
4095
|
-
const open = isControlled ? openProp : internalOpen;
|
|
4096
|
-
const triggerRef = react.useRef(null);
|
|
4097
|
-
const [triggerRect, setTriggerRect] = react.useState(null);
|
|
4098
|
-
const refreshRect = react.useCallback(() => {
|
|
4099
|
-
if (triggerRef.current) setTriggerRect(triggerRef.current.getBoundingClientRect());
|
|
4100
|
-
}, []);
|
|
4101
|
-
const setOpen = react.useCallback(
|
|
4102
|
-
(v) => {
|
|
4103
|
-
if (v) refreshRect();
|
|
4104
|
-
if (!isControlled) setInternalOpen(v);
|
|
4105
|
-
onOpenChange?.(v);
|
|
4106
|
-
},
|
|
4107
|
-
[isControlled, onOpenChange, refreshRect]
|
|
4108
|
-
);
|
|
4109
|
-
react.useEffect(() => {
|
|
4110
|
-
if (!open) return;
|
|
4111
|
-
const handler = () => refreshRect();
|
|
4112
|
-
window.addEventListener("resize", handler);
|
|
4113
|
-
window.addEventListener("scroll", handler, true);
|
|
4114
|
-
const observer = new ResizeObserver(handler);
|
|
4115
|
-
if (triggerRef.current) observer.observe(triggerRef.current, { box: "border-box" });
|
|
4116
|
-
return () => {
|
|
4117
|
-
window.removeEventListener("resize", handler);
|
|
4118
|
-
window.removeEventListener("scroll", handler, true);
|
|
4119
|
-
observer.disconnect();
|
|
4120
|
-
};
|
|
4121
|
-
}, [open, refreshRect]);
|
|
4122
|
-
react.useEffect(() => {
|
|
4123
|
-
if (!open) return;
|
|
4124
|
-
const handler = (e) => {
|
|
4125
|
-
if (e.key === "Escape") setOpen(false);
|
|
4126
|
-
};
|
|
4127
|
-
document.addEventListener("keydown", handler);
|
|
4128
|
-
return () => document.removeEventListener("keydown", handler);
|
|
4129
|
-
}, [open, setOpen]);
|
|
4130
|
-
return /* @__PURE__ */ jsxRuntime.jsx(PopoverContext.Provider, { value: { open, setOpen, triggerRef, triggerRect, refreshRect }, children });
|
|
4131
|
-
};
|
|
4132
|
-
var PopoverTrigger = react.forwardRef(function PopoverTrigger2({ onClick, children, ...rest }, forwardedRef) {
|
|
4133
|
-
const { open, setOpen, triggerRef, refreshRect } = useCtx4();
|
|
4134
|
-
const setRef = (node) => {
|
|
4135
|
-
triggerRef.current = node;
|
|
4136
|
-
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
4137
|
-
else if (forwardedRef) forwardedRef.current = node;
|
|
4138
|
-
};
|
|
4139
|
-
react.useEffect(() => {
|
|
4140
|
-
if (open) refreshRect();
|
|
4141
|
-
}, [open, refreshRect]);
|
|
4142
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4143
|
-
"button",
|
|
4144
|
-
{
|
|
4145
|
-
ref: setRef,
|
|
4146
|
-
type: "button",
|
|
4147
|
-
"aria-haspopup": "dialog",
|
|
4148
|
-
"aria-expanded": open,
|
|
4149
|
-
onClick: (e) => {
|
|
4150
|
-
onClick?.(e);
|
|
4151
|
-
setOpen(!open);
|
|
4152
|
-
},
|
|
4153
|
-
...rest,
|
|
4154
|
-
children
|
|
4155
|
-
}
|
|
4156
|
-
);
|
|
4157
|
-
});
|
|
4158
|
-
var VIEWPORT_MARGIN = 16;
|
|
4159
|
-
var positionStyle = (position, align, rect, offset) => {
|
|
4160
|
-
const left = align === "end" ? rect.right : rect.left + rect.width / 2;
|
|
4161
|
-
const shiftX = align === "end" ? "-100%" : "-50%";
|
|
4162
|
-
const maxWidth = align === "end" ? rect.right - VIEWPORT_MARGIN : void 0;
|
|
4163
|
-
switch (position) {
|
|
4164
|
-
case "top":
|
|
4165
|
-
return {
|
|
4166
|
-
top: rect.top - offset,
|
|
4167
|
-
left,
|
|
4168
|
-
maxWidth,
|
|
4169
|
-
transform: `translate(${shiftX}, -100%)`
|
|
4170
|
-
};
|
|
4171
|
-
case "right":
|
|
4172
|
-
return {
|
|
4173
|
-
top: rect.top + rect.height / 2,
|
|
4174
|
-
left: rect.right + offset,
|
|
4175
|
-
transform: "translateY(-50%)"
|
|
4176
|
-
};
|
|
4177
|
-
case "left":
|
|
4178
|
-
return {
|
|
4179
|
-
top: rect.top + rect.height / 2,
|
|
4180
|
-
left: rect.left - offset,
|
|
4181
|
-
transform: "translate(-100%, -50%)"
|
|
4182
|
-
};
|
|
4183
|
-
case "bottom":
|
|
4184
|
-
default:
|
|
4185
|
-
return {
|
|
4186
|
-
top: rect.bottom + offset,
|
|
4187
|
-
left,
|
|
4188
|
-
maxWidth,
|
|
4189
|
-
transform: `translateX(${shiftX})`
|
|
4190
|
-
};
|
|
4191
|
-
}
|
|
4192
|
-
};
|
|
4193
|
-
var arrowStyle = (position, align, rect) => {
|
|
4194
|
-
const base = {
|
|
4195
|
-
position: "absolute",
|
|
4196
|
-
width: 8,
|
|
4197
|
-
height: 8,
|
|
4198
|
-
transform: "rotate(45deg)"
|
|
4199
|
-
};
|
|
4200
|
-
const x = align === "end" ? { right: rect.width / 2 - 1, marginRight: -4 } : { left: "50%", marginLeft: -4 };
|
|
4201
|
-
switch (position) {
|
|
4202
|
-
case "top":
|
|
4203
|
-
return { ...base, bottom: -4, ...x };
|
|
4204
|
-
case "right":
|
|
4205
|
-
return { ...base, left: -4, top: "50%", marginTop: -4 };
|
|
4206
|
-
case "left":
|
|
4207
|
-
return { ...base, right: -4, top: "50%", marginTop: -4 };
|
|
4208
|
-
case "bottom":
|
|
4209
|
-
default:
|
|
4210
|
-
return { ...base, top: -4, ...x };
|
|
4211
|
-
}
|
|
4212
|
-
};
|
|
4213
|
-
var PopoverContent = ({
|
|
4214
|
-
position = "bottom",
|
|
4215
|
-
align = "center",
|
|
4216
|
-
"aria-label": ariaLabel,
|
|
4217
|
-
offset = 8,
|
|
4218
|
-
arrow = false,
|
|
4219
|
-
width = "w-64",
|
|
4220
|
-
className,
|
|
4221
|
-
children
|
|
4222
|
-
}) => {
|
|
4223
|
-
const { open, setOpen, triggerRect } = useCtx4();
|
|
4224
|
-
if (!open || !triggerRect) return null;
|
|
4225
|
-
return reactDom.createPortal(
|
|
4226
|
-
/* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4227
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "fixed inset-0 z-[9998]", onClick: () => setOpen(false) }),
|
|
4228
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4229
|
-
"div",
|
|
4230
|
-
{
|
|
4231
|
-
role: "dialog",
|
|
4232
|
-
"aria-label": ariaLabel,
|
|
4233
|
-
style: positionStyle(position, align, triggerRect, offset),
|
|
4234
|
-
className: clsx.clsx(
|
|
4235
|
-
"fixed z-[9999] rounded-xl border border-gray-200 bg-white p-4 text-sm shadow-xl dark:border-gray-700 dark:bg-gray-900 dark:text-gray-100",
|
|
4236
|
-
width,
|
|
4237
|
-
className
|
|
4238
|
-
),
|
|
4239
|
-
children: [
|
|
4240
|
-
arrow && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4241
|
-
"span",
|
|
4242
|
-
{
|
|
4243
|
-
"aria-hidden": true,
|
|
4244
|
-
style: arrowStyle(position, align, triggerRect),
|
|
4245
|
-
className: "border border-gray-200 bg-white dark:border-gray-700 dark:bg-gray-900"
|
|
4246
|
-
}
|
|
4247
|
-
),
|
|
4248
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative", children })
|
|
4249
|
-
]
|
|
4410
|
+
className: baseBtn,
|
|
4411
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "h-4 w-4" })
|
|
4412
|
+
}
|
|
4413
|
+
),
|
|
4414
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4415
|
+
"button",
|
|
4416
|
+
{
|
|
4417
|
+
type: "button",
|
|
4418
|
+
"aria-label": nextLabel,
|
|
4419
|
+
disabled: !canScrollNext,
|
|
4420
|
+
onClick: scrollNext,
|
|
4421
|
+
className: baseBtn,
|
|
4422
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4" })
|
|
4250
4423
|
}
|
|
4251
4424
|
)
|
|
4252
|
-
] })
|
|
4253
|
-
|
|
4254
|
-
|
|
4425
|
+
] });
|
|
4426
|
+
}
|
|
4427
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4428
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4429
|
+
"button",
|
|
4430
|
+
{
|
|
4431
|
+
type: "button",
|
|
4432
|
+
"aria-label": prevLabel,
|
|
4433
|
+
disabled: !canScrollPrev,
|
|
4434
|
+
onClick: scrollPrev,
|
|
4435
|
+
className: clsx.clsx("absolute top-1/2 left-2 z-10 -translate-y-1/2", baseBtn, className),
|
|
4436
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "h-4 w-4" })
|
|
4437
|
+
}
|
|
4438
|
+
),
|
|
4439
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4440
|
+
"button",
|
|
4441
|
+
{
|
|
4442
|
+
type: "button",
|
|
4443
|
+
"aria-label": nextLabel,
|
|
4444
|
+
disabled: !canScrollNext,
|
|
4445
|
+
onClick: scrollNext,
|
|
4446
|
+
className: clsx.clsx("absolute top-1/2 right-2 z-10 -translate-y-1/2", baseBtn, className),
|
|
4447
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4" })
|
|
4448
|
+
}
|
|
4449
|
+
)
|
|
4450
|
+
] });
|
|
4255
4451
|
};
|
|
4256
|
-
var
|
|
4257
|
-
|
|
4258
|
-
|
|
4452
|
+
var CarouselIndicators = ({ className }) => {
|
|
4453
|
+
const { scrollSnaps, selectedIndex, scrollTo } = useCtx4();
|
|
4454
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx.clsx("mt-3 flex items-center justify-center gap-2", className), children: scrollSnaps.map((_, i) => {
|
|
4455
|
+
const active = i === selectedIndex;
|
|
4456
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4457
|
+
"button",
|
|
4458
|
+
{
|
|
4459
|
+
type: "button",
|
|
4460
|
+
"aria-label": `Go to slide ${i + 1}`,
|
|
4461
|
+
"aria-current": active,
|
|
4462
|
+
onClick: () => scrollTo(i),
|
|
4463
|
+
className: clsx.clsx(
|
|
4464
|
+
"h-2 rounded-full transition-all",
|
|
4465
|
+
active ? "bg-brand-500 w-6" : "w-2 bg-gray-300 dark:bg-gray-600"
|
|
4466
|
+
)
|
|
4467
|
+
},
|
|
4468
|
+
i
|
|
4469
|
+
);
|
|
4470
|
+
}) });
|
|
4471
|
+
};
|
|
4472
|
+
var Carousel = Object.assign(CarouselRoot, {
|
|
4473
|
+
Viewport: CarouselViewport,
|
|
4474
|
+
Slide: CarouselSlide,
|
|
4475
|
+
Controls: CarouselControls,
|
|
4476
|
+
Indicators: CarouselIndicators
|
|
4259
4477
|
});
|
|
4260
4478
|
var SIZE_TRACK = {
|
|
4261
4479
|
xs: "h-1",
|
|
@@ -4325,7 +4543,7 @@ var ProgressBar = ({
|
|
|
4325
4543
|
INTENT_BG2[intent],
|
|
4326
4544
|
striped && "motion-safe:animate-[progressStripes_1s_linear_infinite]"
|
|
4327
4545
|
),
|
|
4328
|
-
children: showInsideLabel && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "px-2
|
|
4546
|
+
children: showInsideLabel && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-3xs px-2 leading-none font-bold text-white", children: labelText })
|
|
4329
4547
|
}
|
|
4330
4548
|
)
|
|
4331
4549
|
}
|
|
@@ -4382,7 +4600,7 @@ var Ribbon = ({
|
|
|
4382
4600
|
"span",
|
|
4383
4601
|
{
|
|
4384
4602
|
className: clsx.clsx(
|
|
4385
|
-
"absolute z-10 w-40 px-2 py-1 text-center
|
|
4603
|
+
"text-2xs absolute z-10 w-40 px-2 py-1 text-center font-bold tracking-wide uppercase shadow-md",
|
|
4386
4604
|
INTENT_BG3[intent],
|
|
4387
4605
|
ANGLED_POSITION[position],
|
|
4388
4606
|
className
|
|
@@ -4395,7 +4613,7 @@ var Ribbon = ({
|
|
|
4395
4613
|
"span",
|
|
4396
4614
|
{
|
|
4397
4615
|
className: clsx.clsx(
|
|
4398
|
-
"absolute z-10 px-2.5 py-1
|
|
4616
|
+
"text-2xs absolute z-10 px-2.5 py-1 font-bold tracking-wide uppercase shadow",
|
|
4399
4617
|
INTENT_BG3[intent],
|
|
4400
4618
|
FLAT_POSITION[position],
|
|
4401
4619
|
className
|
|
@@ -4962,7 +5180,7 @@ var CommandPaletteGroup = react.forwardRef(
|
|
|
4962
5180
|
{
|
|
4963
5181
|
ref,
|
|
4964
5182
|
className: clsx.clsx(
|
|
4965
|
-
"px-1 pb-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:pt-2 [&_[cmdk-group-heading]]:pb-1.5 [&_[cmdk-group-heading]]:
|
|
5183
|
+
"[&_[cmdk-group-heading]]:text-2xs px-1 pb-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:pt-2 [&_[cmdk-group-heading]]:pb-1.5 [&_[cmdk-group-heading]]:font-semibold [&_[cmdk-group-heading]]:tracking-wider [&_[cmdk-group-heading]]:text-gray-400 [&_[cmdk-group-heading]]:uppercase dark:[&_[cmdk-group-heading]]:text-gray-500",
|
|
4966
5184
|
className
|
|
4967
5185
|
),
|
|
4968
5186
|
...rest
|
|
@@ -4987,7 +5205,7 @@ var CommandPaletteItem = react.forwardRef(
|
|
|
4987
5205
|
children: [
|
|
4988
5206
|
Icon2 && /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "h-4 w-4 shrink-0 text-gray-400", "aria-hidden": true }),
|
|
4989
5207
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 truncate", children }),
|
|
4990
|
-
shortcut && /* @__PURE__ */ jsxRuntime.jsx("kbd", { className: "shrink-0 rounded border border-gray-200 bg-gray-50 px-1.5 py-0.5 font-mono
|
|
5208
|
+
shortcut && /* @__PURE__ */ jsxRuntime.jsx("kbd", { className: "text-3xs shrink-0 rounded border border-gray-200 bg-gray-50 px-1.5 py-0.5 font-mono font-medium text-gray-500 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400", children: shortcut })
|
|
4991
5209
|
]
|
|
4992
5210
|
}
|
|
4993
5211
|
);
|
|
@@ -5027,7 +5245,7 @@ var CommandPaletteFooter = ({ className, children }) => /* @__PURE__ */ jsxRunti
|
|
|
5027
5245
|
"div",
|
|
5028
5246
|
{
|
|
5029
5247
|
className: clsx.clsx(
|
|
5030
|
-
"flex items-center justify-between border-t border-gray-100 px-4 py-2 text-
|
|
5248
|
+
"text-2xs flex items-center justify-between border-t border-gray-100 px-4 py-2 text-gray-500 dark:border-gray-800 dark:text-gray-400",
|
|
5031
5249
|
className
|
|
5032
5250
|
),
|
|
5033
5251
|
children
|
|
@@ -5152,11 +5370,11 @@ var formatKey = (raw, isMac) => {
|
|
|
5152
5370
|
if (KEY_LABEL[key]) return KEY_LABEL[key];
|
|
5153
5371
|
return raw.length === 1 ? raw.toUpperCase() : raw;
|
|
5154
5372
|
};
|
|
5155
|
-
var
|
|
5373
|
+
var Kbd2 = ({ children, className }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5156
5374
|
"kbd",
|
|
5157
5375
|
{
|
|
5158
5376
|
className: clsx.clsx(
|
|
5159
|
-
"inline-flex h-6 min-w-[1.5rem] items-center justify-center rounded border border-gray-200 bg-gray-50 px-1.5 font-mono
|
|
5377
|
+
"text-2xs inline-flex h-6 min-w-[1.5rem] items-center justify-center rounded border border-gray-200 bg-gray-50 px-1.5 font-mono font-medium text-gray-700 shadow-[0_1px_0_0_rgba(0,0,0,0.05)] dark:border-gray-700 dark:bg-gray-800 dark:text-gray-300",
|
|
5160
5378
|
className
|
|
5161
5379
|
),
|
|
5162
5380
|
children
|
|
@@ -5246,7 +5464,7 @@ var HelpOverlayRoot = ({
|
|
|
5246
5464
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 gap-x-8 gap-y-6 overflow-y-auto px-5 py-5 sm:grid-cols-2", children }),
|
|
5247
5465
|
(footer ?? true) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-end gap-2 border-t border-gray-200 bg-gray-50 px-5 py-2.5 text-xs text-gray-500 dark:border-gray-800 dark:bg-gray-800/50 dark:text-gray-400", children: footer ?? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5248
5466
|
"Press ",
|
|
5249
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5467
|
+
/* @__PURE__ */ jsxRuntime.jsx(Kbd2, { children: "Esc" }),
|
|
5250
5468
|
" to close"
|
|
5251
5469
|
] }) })
|
|
5252
5470
|
]
|
|
@@ -5257,7 +5475,7 @@ var HelpOverlayRoot = ({
|
|
|
5257
5475
|
);
|
|
5258
5476
|
};
|
|
5259
5477
|
var HelpOverlaySection = ({ title, className, children }) => /* @__PURE__ */ jsxRuntime.jsxs("section", { className: clsx.clsx("space-y-2", className), children: [
|
|
5260
|
-
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-
|
|
5478
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-2xs font-semibold tracking-wider text-gray-400 uppercase dark:text-gray-500", children: title }),
|
|
5261
5479
|
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: "divide-y divide-gray-100 dark:divide-gray-800", children })
|
|
5262
5480
|
] });
|
|
5263
5481
|
var HelpOverlayShortcut = ({ keys, description, className }) => {
|
|
@@ -5268,10 +5486,10 @@ var HelpOverlayShortcut = ({ keys, description, className }) => {
|
|
|
5268
5486
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex shrink-0 items-center gap-1", children: sequence.map((combo, idx) => {
|
|
5269
5487
|
const parts = combo.split("+");
|
|
5270
5488
|
return /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
|
|
5271
|
-
idx > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "px-0.5 text-
|
|
5489
|
+
idx > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-3xs px-0.5 text-gray-400 uppercase dark:text-gray-500", children: "then" }),
|
|
5272
5490
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center gap-1", children: parts.map((part, pIdx) => /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
|
|
5273
5491
|
pIdx > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-gray-400 dark:text-gray-500", children: "+" }),
|
|
5274
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5492
|
+
/* @__PURE__ */ jsxRuntime.jsx(Kbd2, { children: formatKey(part, isMac) })
|
|
5275
5493
|
] }, `${part}-${pIdx}`)) })
|
|
5276
5494
|
] }, `${combo}-${idx}`);
|
|
5277
5495
|
}) })
|
|
@@ -5531,13 +5749,14 @@ var StepperInput = ({
|
|
|
5531
5749
|
className
|
|
5532
5750
|
}) => {
|
|
5533
5751
|
const clamp = (v) => Math.min(max, Math.max(min, v));
|
|
5534
|
-
const arrowBtn = "flex flex-1 items-center justify-center
|
|
5752
|
+
const arrowBtn = "flex flex-1 items-center justify-center text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 active:bg-gray-200 disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-transparent dark:text-gray-400 dark:hover:bg-white/10 dark:hover:text-gray-200 dark:active:bg-white/15";
|
|
5535
5753
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5536
5754
|
"div",
|
|
5537
5755
|
{
|
|
5538
5756
|
className: clsx.clsx(
|
|
5539
5757
|
fullWidth ? "flex w-full" : "inline-flex",
|
|
5540
|
-
|
|
5758
|
+
// dark:focus-within: is explicit, dark:border-gray-700 would win otherwise.
|
|
5759
|
+
"focus-within:border-brand-500 dark:focus-within:border-brand-500 h-9 overflow-hidden rounded-lg border border-gray-200 bg-white transition-colors dark:border-gray-700 dark:bg-gray-800",
|
|
5541
5760
|
disabled && "opacity-50",
|
|
5542
5761
|
className
|
|
5543
5762
|
),
|
|
@@ -5556,13 +5775,14 @@ var StepperInput = ({
|
|
|
5556
5775
|
max,
|
|
5557
5776
|
step,
|
|
5558
5777
|
className: clsx.clsx(
|
|
5559
|
-
|
|
5778
|
+
// min-w-0: in a narrower container the input gives way, not the arrows.
|
|
5779
|
+
"h-full min-w-0 [appearance:textfield] bg-transparent pr-1 pl-3 text-sm font-medium text-gray-700 focus:outline-none disabled:cursor-not-allowed dark:text-gray-200 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",
|
|
5560
5780
|
fullWidth ? "flex-1" : width
|
|
5561
5781
|
)
|
|
5562
5782
|
}
|
|
5563
5783
|
),
|
|
5564
|
-
unit && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center pr-1.5 text-xs text-gray-400 select-none dark:text-gray-500", children: unit }),
|
|
5565
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col border-l border-gray-200 dark:border-gray-700", children: [
|
|
5784
|
+
unit && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex shrink-0 items-center pr-1.5 text-xs text-gray-400 select-none dark:text-gray-500", children: unit }),
|
|
5785
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-7 shrink-0 flex-col border-l border-gray-200 dark:border-gray-700", children: [
|
|
5566
5786
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5567
5787
|
"button",
|
|
5568
5788
|
{
|
|
@@ -5572,7 +5792,7 @@ var StepperInput = ({
|
|
|
5572
5792
|
tabIndex: -1,
|
|
5573
5793
|
"aria-label": "Increase",
|
|
5574
5794
|
className: arrowBtn,
|
|
5575
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronUp, { className: "h-3
|
|
5795
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronUp, { className: "h-3 w-3", strokeWidth: 2.25, "aria-hidden": true })
|
|
5576
5796
|
}
|
|
5577
5797
|
),
|
|
5578
5798
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5584,7 +5804,7 @@ var StepperInput = ({
|
|
|
5584
5804
|
tabIndex: -1,
|
|
5585
5805
|
"aria-label": "Decrease",
|
|
5586
5806
|
className: clsx.clsx("border-t border-gray-200 dark:border-gray-700", arrowBtn),
|
|
5587
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-3
|
|
5807
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-3 w-3", strokeWidth: 2.25, "aria-hidden": true })
|
|
5588
5808
|
}
|
|
5589
5809
|
)
|
|
5590
5810
|
] })
|
|
@@ -6661,7 +6881,7 @@ var Calendar = ({ classNames, components, className, ...rest }) => {
|
|
|
6661
6881
|
months_dropdown: "",
|
|
6662
6882
|
years_dropdown: "",
|
|
6663
6883
|
weekdays: clsx.clsx(def.weekdays, ""),
|
|
6664
|
-
weekday: "h-8 w-8 text-center text-
|
|
6884
|
+
weekday: "h-8 w-8 text-center text-2xs font-medium text-gray-400 dark:text-gray-500",
|
|
6665
6885
|
week: clsx.clsx(def.week, ""),
|
|
6666
6886
|
day: "h-8 w-8 p-0 text-center align-middle",
|
|
6667
6887
|
day_button: "inline-flex h-8 w-8 items-center justify-center rounded-md text-sm text-gray-700 transition-colors hover:bg-gray-100 dark:text-gray-200 dark:hover:bg-white/5",
|
|
@@ -7017,7 +7237,7 @@ var OtpInput = ({
|
|
|
7017
7237
|
}) => {
|
|
7018
7238
|
const refs = react.useRef([]);
|
|
7019
7239
|
react.useEffect(() => {
|
|
7020
|
-
if (autoFocus) refs.current[0]?.focus();
|
|
7240
|
+
if (autoFocus) refs.current[0]?.focus({ preventScroll: true });
|
|
7021
7241
|
}, [autoFocus]);
|
|
7022
7242
|
const setCell = (idx, char) => {
|
|
7023
7243
|
const cleaned = sanitize(char, alphanumeric).slice(0, 1);
|
|
@@ -7379,30 +7599,84 @@ var StepperIndicator = ({
|
|
|
7379
7599
|
children: Icon2 ? /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "h-5 w-5" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "h-2 w-2 rounded-full bg-current" })
|
|
7380
7600
|
}
|
|
7381
7601
|
);
|
|
7602
|
+
var Meta = ({ meta }) => meta ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 text-xs text-gray-500 dark:text-gray-400", children: meta }) : null;
|
|
7382
7603
|
var Body5 = ({ item }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1 pb-2 last:pb-0", children: [
|
|
7383
7604
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: item.title }),
|
|
7384
7605
|
item.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 text-xs text-gray-500 dark:text-gray-400", children: item.description }),
|
|
7385
|
-
|
|
7606
|
+
/* @__PURE__ */ jsxRuntime.jsx(Meta, { meta: item.meta }),
|
|
7607
|
+
item.time && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-3xs mt-0.5 font-mono text-gray-400 uppercase", children: item.time })
|
|
7386
7608
|
] });
|
|
7387
|
-
var
|
|
7609
|
+
var TimelineList = ({
|
|
7610
|
+
items,
|
|
7611
|
+
variant = "dot",
|
|
7612
|
+
className,
|
|
7613
|
+
startIndex = 0,
|
|
7614
|
+
labelledBy
|
|
7615
|
+
}) => {
|
|
7388
7616
|
if (variant === "card") {
|
|
7389
|
-
return /* @__PURE__ */ jsxRuntime.jsx("ol", { className: clsx.clsx("space-y-3", className), children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7617
|
+
return /* @__PURE__ */ jsxRuntime.jsx("ol", { "aria-labelledby": labelledBy, className: clsx.clsx("space-y-3", className), children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7390
7618
|
"li",
|
|
7391
7619
|
{
|
|
7392
7620
|
className: "rounded-xl border border-gray-200 bg-white p-3 dark:border-gray-800 dark:bg-gray-900",
|
|
7393
7621
|
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-3", children: [
|
|
7394
7622
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
|
|
7395
7623
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: item.title }),
|
|
7396
|
-
item.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 text-xs text-gray-500 dark:text-gray-400", children: item.description })
|
|
7624
|
+
item.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 text-xs text-gray-500 dark:text-gray-400", children: item.description }),
|
|
7625
|
+
/* @__PURE__ */ jsxRuntime.jsx(Meta, { meta: item.meta })
|
|
7397
7626
|
] }),
|
|
7398
|
-
item.time && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 font-mono text-
|
|
7627
|
+
item.time && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-3xs shrink-0 font-mono text-gray-400 uppercase", children: item.time })
|
|
7399
7628
|
] })
|
|
7400
7629
|
},
|
|
7401
7630
|
item.id
|
|
7402
7631
|
)) });
|
|
7403
7632
|
}
|
|
7633
|
+
if (variant === "alternating") {
|
|
7634
|
+
return /* @__PURE__ */ jsxRuntime.jsx("ol", { "aria-labelledby": labelledBy, className: clsx.clsx("flex flex-col", className), children: items.map((item, i) => {
|
|
7635
|
+
const isLast = i === items.length - 1;
|
|
7636
|
+
const left = (startIndex + i) % 2 === 0;
|
|
7637
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7638
|
+
"li",
|
|
7639
|
+
{
|
|
7640
|
+
className: "grid grid-cols-[2.5rem_minmax(0,1fr)] gap-x-4 md:grid-cols-[minmax(0,1fr)_2.5rem_minmax(0,1fr)]",
|
|
7641
|
+
children: [
|
|
7642
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-start-1 row-start-1 flex flex-col items-center md:col-start-2", children: [
|
|
7643
|
+
/* @__PURE__ */ jsxRuntime.jsx(StepperIndicator, { icon: item.icon, tone: item.tone }),
|
|
7644
|
+
!isLast && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "my-1 w-px flex-1 bg-gray-200 dark:bg-gray-700" })
|
|
7645
|
+
] }),
|
|
7646
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7647
|
+
"div",
|
|
7648
|
+
{
|
|
7649
|
+
className: clsx.clsx(
|
|
7650
|
+
"col-start-2 row-start-1",
|
|
7651
|
+
left ? "md:col-start-1" : "md:col-start-3",
|
|
7652
|
+
!isLast && "pb-6"
|
|
7653
|
+
),
|
|
7654
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-xl border border-gray-200 bg-white p-4 dark:border-gray-800 dark:bg-gray-900", children: [
|
|
7655
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: item.title }),
|
|
7656
|
+
item.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 text-xs text-gray-500 dark:text-gray-400", children: item.description }),
|
|
7657
|
+
/* @__PURE__ */ jsxRuntime.jsx(Meta, { meta: item.meta }),
|
|
7658
|
+
item.time && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-3xs mt-2 font-mono text-gray-400 uppercase md:hidden", children: item.time })
|
|
7659
|
+
] })
|
|
7660
|
+
}
|
|
7661
|
+
),
|
|
7662
|
+
item.time && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7663
|
+
"p",
|
|
7664
|
+
{
|
|
7665
|
+
className: clsx.clsx(
|
|
7666
|
+
"text-3xs row-start-1 hidden pt-3 font-mono text-gray-400 uppercase md:block",
|
|
7667
|
+
left ? "md:col-start-3" : "md:col-start-1 md:text-right"
|
|
7668
|
+
),
|
|
7669
|
+
children: item.time
|
|
7670
|
+
}
|
|
7671
|
+
)
|
|
7672
|
+
]
|
|
7673
|
+
},
|
|
7674
|
+
item.id
|
|
7675
|
+
);
|
|
7676
|
+
}) });
|
|
7677
|
+
}
|
|
7404
7678
|
const gap = variant === "stepper" ? "gap-x-4" : "gap-x-3";
|
|
7405
|
-
return /* @__PURE__ */ jsxRuntime.jsx("ol", { className: clsx.clsx("flex flex-col", className), children: items.map((item, i) => {
|
|
7679
|
+
return /* @__PURE__ */ jsxRuntime.jsx("ol", { "aria-labelledby": labelledBy, className: clsx.clsx("flex flex-col", className), children: items.map((item, i) => {
|
|
7406
7680
|
const isLast = i === items.length - 1;
|
|
7407
7681
|
return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: clsx.clsx("flex", gap), children: [
|
|
7408
7682
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center", children: [
|
|
@@ -7413,7 +7687,50 @@ var Timeline = ({ items, variant = "dot", className }) => {
|
|
|
7413
7687
|
] }, item.id);
|
|
7414
7688
|
}) });
|
|
7415
7689
|
};
|
|
7416
|
-
var
|
|
7690
|
+
var groupRuns = (items) => {
|
|
7691
|
+
const runs = [];
|
|
7692
|
+
items.forEach((item, i) => {
|
|
7693
|
+
const last = runs[runs.length - 1];
|
|
7694
|
+
if (last && last.group === item.group) last.items.push(item);
|
|
7695
|
+
else runs.push({ group: item.group, start: i, items: [item] });
|
|
7696
|
+
});
|
|
7697
|
+
return runs;
|
|
7698
|
+
};
|
|
7699
|
+
var GroupHeader = ({ id, label, centred }) => centred ? (
|
|
7700
|
+
// A pill on the line; it moves to the left with the line below `md`.
|
|
7701
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { id, className: "mb-4 flex md:justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded-full border border-gray-200 bg-white px-3 py-1 text-xs font-semibold text-gray-700 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-200", children: label }) })
|
|
7702
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
7703
|
+
"h3",
|
|
7704
|
+
{
|
|
7705
|
+
id,
|
|
7706
|
+
className: "mb-3 text-xs font-semibold tracking-wider text-gray-500 uppercase dark:text-gray-400",
|
|
7707
|
+
children: label
|
|
7708
|
+
}
|
|
7709
|
+
);
|
|
7710
|
+
var Timeline = ({ items, variant = "dot", className }) => {
|
|
7711
|
+
const baseId = react.useId();
|
|
7712
|
+
const runs = groupRuns(items);
|
|
7713
|
+
if (runs.every((run) => !run.group)) {
|
|
7714
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TimelineList, { items, variant, className });
|
|
7715
|
+
}
|
|
7716
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx.clsx("space-y-6", className), children: runs.map((run, i) => {
|
|
7717
|
+
const headerId = `${baseId}-group-${i}`;
|
|
7718
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
7719
|
+
run.group && /* @__PURE__ */ jsxRuntime.jsx(GroupHeader, { id: headerId, label: run.group, centred: variant === "alternating" }),
|
|
7720
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7721
|
+
TimelineList,
|
|
7722
|
+
{
|
|
7723
|
+
items: run.items,
|
|
7724
|
+
variant,
|
|
7725
|
+
startIndex: run.start,
|
|
7726
|
+
labelledBy: run.group ? headerId : void 0
|
|
7727
|
+
}
|
|
7728
|
+
)
|
|
7729
|
+
] }, run.start);
|
|
7730
|
+
}) });
|
|
7731
|
+
};
|
|
7732
|
+
|
|
7733
|
+
// src/data/calendar-dates.ts
|
|
7417
7734
|
var MONTHS = [
|
|
7418
7735
|
"January",
|
|
7419
7736
|
"February",
|
|
@@ -7430,6 +7747,8 @@ var MONTHS = [
|
|
|
7430
7747
|
];
|
|
7431
7748
|
var isoDate = (d) => `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`;
|
|
7432
7749
|
var sameDay = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
7750
|
+
var isoWeekday = (d) => (d.getDay() + 6) % 7;
|
|
7751
|
+
var WEEK_DAYS = ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"];
|
|
7433
7752
|
var MiniCalendar = ({
|
|
7434
7753
|
today = /* @__PURE__ */ new Date(),
|
|
7435
7754
|
selected,
|
|
@@ -7441,7 +7760,7 @@ var MiniCalendar = ({
|
|
|
7441
7760
|
const cells = react.useMemo(() => {
|
|
7442
7761
|
const firstOfMonth = new Date(view.getFullYear(), view.getMonth(), 1);
|
|
7443
7762
|
const daysInMonth = new Date(view.getFullYear(), view.getMonth() + 1, 0).getDate();
|
|
7444
|
-
const isoOffset = (firstOfMonth
|
|
7763
|
+
const isoOffset = isoWeekday(firstOfMonth);
|
|
7445
7764
|
const arr = Array(isoOffset).fill(null);
|
|
7446
7765
|
for (let d = 1; d <= daysInMonth; d++)
|
|
7447
7766
|
arr.push(new Date(view.getFullYear(), view.getMonth(), d));
|
|
@@ -7498,7 +7817,7 @@ var MiniCalendar = ({
|
|
|
7498
7817
|
WEEK_DAYS.map((d) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7499
7818
|
"span",
|
|
7500
7819
|
{
|
|
7501
|
-
className: "py-1
|
|
7820
|
+
className: "text-3xs py-1 font-semibold tracking-wider text-gray-400 uppercase",
|
|
7502
7821
|
children: d
|
|
7503
7822
|
},
|
|
7504
7823
|
d
|
|
@@ -7538,6 +7857,275 @@ var MiniCalendar = ({
|
|
|
7538
7857
|
}
|
|
7539
7858
|
);
|
|
7540
7859
|
};
|
|
7860
|
+
var WEEK_DAYS2 = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
|
|
7861
|
+
var WEEK_DAYS_LONG = [
|
|
7862
|
+
"Monday",
|
|
7863
|
+
"Tuesday",
|
|
7864
|
+
"Wednesday",
|
|
7865
|
+
"Thursday",
|
|
7866
|
+
"Friday",
|
|
7867
|
+
"Saturday",
|
|
7868
|
+
"Sunday"
|
|
7869
|
+
];
|
|
7870
|
+
var MAX_CHIPS = 3;
|
|
7871
|
+
var TONE_DOT = {
|
|
7872
|
+
brand: "bg-brand-500",
|
|
7873
|
+
success: "bg-green-500",
|
|
7874
|
+
warning: "bg-amber-500",
|
|
7875
|
+
danger: "bg-red-500",
|
|
7876
|
+
info: "bg-blue-500",
|
|
7877
|
+
violet: "bg-violet-500"
|
|
7878
|
+
};
|
|
7879
|
+
var TONE_CHIP = {
|
|
7880
|
+
brand: "bg-brand-50 dark:bg-brand-500/15",
|
|
7881
|
+
success: "bg-green-50 dark:bg-green-500/15",
|
|
7882
|
+
warning: "bg-amber-50 dark:bg-amber-500/15",
|
|
7883
|
+
danger: "bg-red-50 dark:bg-red-500/15",
|
|
7884
|
+
info: "bg-blue-50 dark:bg-blue-500/15",
|
|
7885
|
+
violet: "bg-violet-50 dark:bg-violet-500/15"
|
|
7886
|
+
};
|
|
7887
|
+
var TONE_CHIP_HOVER = {
|
|
7888
|
+
brand: "hover:bg-brand-100 dark:hover:bg-brand-500/25",
|
|
7889
|
+
success: "hover:bg-green-100 dark:hover:bg-green-500/25",
|
|
7890
|
+
warning: "hover:bg-amber-100 dark:hover:bg-amber-500/25",
|
|
7891
|
+
danger: "hover:bg-red-100 dark:hover:bg-red-500/25",
|
|
7892
|
+
info: "hover:bg-blue-100 dark:hover:bg-blue-500/25",
|
|
7893
|
+
violet: "hover:bg-violet-100 dark:hover:bg-violet-500/25"
|
|
7894
|
+
};
|
|
7895
|
+
var FOCUS_RING = "focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-500";
|
|
7896
|
+
var addDays = (d, n) => new Date(d.getFullYear(), d.getMonth(), d.getDate() + n);
|
|
7897
|
+
var startOfDay = (d) => new Date(d.getFullYear(), d.getMonth(), d.getDate());
|
|
7898
|
+
var startOfMonth = (d) => new Date(d.getFullYear(), d.getMonth(), 1);
|
|
7899
|
+
var dayLabel = (d) => `${WEEK_DAYS_LONG[isoWeekday(d)]} ${d.getDate()} ${MONTHS[d.getMonth()]} ${d.getFullYear()}`;
|
|
7900
|
+
var monthGrid = (month) => {
|
|
7901
|
+
const first = startOfMonth(month);
|
|
7902
|
+
const last = new Date(first.getFullYear(), first.getMonth() + 1, 0);
|
|
7903
|
+
const end = addDays(last, 6 - isoWeekday(last));
|
|
7904
|
+
const days = [];
|
|
7905
|
+
for (let d = addDays(first, -isoWeekday(first)); d <= end; d = addDays(d, 1)) days.push(d);
|
|
7906
|
+
return days;
|
|
7907
|
+
};
|
|
7908
|
+
var indexByDay = (events, first, last) => {
|
|
7909
|
+
const byDay = /* @__PURE__ */ new Map();
|
|
7910
|
+
const sorted = [...events].sort((a, b) => a.start.getTime() - b.start.getTime());
|
|
7911
|
+
for (const event of sorted) {
|
|
7912
|
+
const start = startOfDay(event.start);
|
|
7913
|
+
const end = event.end && event.end > event.start ? startOfDay(event.end) : start;
|
|
7914
|
+
const to = end < last ? end : last;
|
|
7915
|
+
for (let d = start < first ? first : start; d <= to; d = addDays(d, 1)) {
|
|
7916
|
+
const key = isoDate(d);
|
|
7917
|
+
const list = byDay.get(key);
|
|
7918
|
+
if (list) list.push(event);
|
|
7919
|
+
else byDay.set(key, [event]);
|
|
7920
|
+
}
|
|
7921
|
+
}
|
|
7922
|
+
return byDay;
|
|
7923
|
+
};
|
|
7924
|
+
var EventChip = ({
|
|
7925
|
+
event,
|
|
7926
|
+
onClick,
|
|
7927
|
+
compact = false
|
|
7928
|
+
}) => {
|
|
7929
|
+
const tone = event.tone ?? "brand";
|
|
7930
|
+
const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
7931
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: clsx.clsx("h-1.5 w-1.5 shrink-0 rounded-full", TONE_DOT[tone]) }),
|
|
7932
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: clsx.clsx("truncate", compact && "max-sm:sr-only"), children: event.title })
|
|
7933
|
+
] });
|
|
7934
|
+
const className = clsx.clsx(
|
|
7935
|
+
"flex min-w-0 items-center gap-1.5 rounded-md px-1.5 py-0.5 text-left text-xs text-gray-700 dark:text-gray-200",
|
|
7936
|
+
TONE_CHIP[tone],
|
|
7937
|
+
compact ? "max-sm:bg-transparent max-sm:px-1 sm:w-full max-sm:dark:bg-transparent" : "w-full"
|
|
7938
|
+
);
|
|
7939
|
+
if (!onClick) {
|
|
7940
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { title: event.title, className, children: content });
|
|
7941
|
+
}
|
|
7942
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7943
|
+
"button",
|
|
7944
|
+
{
|
|
7945
|
+
type: "button",
|
|
7946
|
+
title: event.title,
|
|
7947
|
+
onClick: () => onClick(event),
|
|
7948
|
+
className: clsx.clsx(className, TONE_CHIP_HOVER[tone], FOCUS_RING),
|
|
7949
|
+
children: content
|
|
7950
|
+
}
|
|
7951
|
+
);
|
|
7952
|
+
};
|
|
7953
|
+
var EventCalendar = ({
|
|
7954
|
+
events,
|
|
7955
|
+
month,
|
|
7956
|
+
defaultMonth,
|
|
7957
|
+
onMonthChange,
|
|
7958
|
+
today = /* @__PURE__ */ new Date(),
|
|
7959
|
+
onEventClick,
|
|
7960
|
+
onDayClick,
|
|
7961
|
+
className
|
|
7962
|
+
}) => {
|
|
7963
|
+
const [internalMonth, setInternalMonth] = react.useState(() => startOfMonth(defaultMonth ?? today));
|
|
7964
|
+
const [openDay, setOpenDay] = react.useState(null);
|
|
7965
|
+
const shown = startOfMonth(month ?? internalMonth);
|
|
7966
|
+
const { days, byDay } = react.useMemo(() => {
|
|
7967
|
+
const grid = monthGrid(month ?? internalMonth);
|
|
7968
|
+
return { days: grid, byDay: indexByDay(events, grid[0], grid[grid.length - 1]) };
|
|
7969
|
+
}, [events, month, internalMonth]);
|
|
7970
|
+
const goTo = (next) => {
|
|
7971
|
+
if (month === void 0) setInternalMonth(next);
|
|
7972
|
+
onMonthChange?.(next);
|
|
7973
|
+
};
|
|
7974
|
+
const isTodayMonth = shown.getFullYear() === today.getFullYear() && shown.getMonth() === today.getMonth();
|
|
7975
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7976
|
+
"div",
|
|
7977
|
+
{
|
|
7978
|
+
className: clsx.clsx(
|
|
7979
|
+
"overflow-hidden rounded-2xl border border-gray-200 bg-white dark:border-gray-800 dark:bg-gray-900",
|
|
7980
|
+
className
|
|
7981
|
+
),
|
|
7982
|
+
children: [
|
|
7983
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-3 px-4 py-3", children: [
|
|
7984
|
+
/* @__PURE__ */ jsxRuntime.jsxs("h3", { "aria-live": "polite", className: "text-base font-semibold text-[var(--color-text-primary)]", children: [
|
|
7985
|
+
MONTHS[shown.getMonth()],
|
|
7986
|
+
" ",
|
|
7987
|
+
shown.getFullYear()
|
|
7988
|
+
] }),
|
|
7989
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
7990
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7991
|
+
Button,
|
|
7992
|
+
{
|
|
7993
|
+
variant: "secondary",
|
|
7994
|
+
size: "sm",
|
|
7995
|
+
onClick: () => goTo(startOfMonth(today)),
|
|
7996
|
+
disabled: isTodayMonth,
|
|
7997
|
+
className: "mr-1",
|
|
7998
|
+
children: "Today"
|
|
7999
|
+
}
|
|
8000
|
+
),
|
|
8001
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8002
|
+
"button",
|
|
8003
|
+
{
|
|
8004
|
+
type: "button",
|
|
8005
|
+
onClick: () => goTo(new Date(shown.getFullYear(), shown.getMonth() - 1, 1)),
|
|
8006
|
+
"aria-label": "Previous month",
|
|
8007
|
+
className: clsx.clsx(
|
|
8008
|
+
"flex h-8 w-8 items-center justify-center rounded-lg text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-white/5 dark:hover:text-gray-200",
|
|
8009
|
+
FOCUS_RING
|
|
8010
|
+
),
|
|
8011
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "h-4 w-4", "aria-hidden": true })
|
|
8012
|
+
}
|
|
8013
|
+
),
|
|
8014
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8015
|
+
"button",
|
|
8016
|
+
{
|
|
8017
|
+
type: "button",
|
|
8018
|
+
onClick: () => goTo(new Date(shown.getFullYear(), shown.getMonth() + 1, 1)),
|
|
8019
|
+
"aria-label": "Next month",
|
|
8020
|
+
className: clsx.clsx(
|
|
8021
|
+
"flex h-8 w-8 items-center justify-center rounded-lg text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-white/5 dark:hover:text-gray-200",
|
|
8022
|
+
FOCUS_RING
|
|
8023
|
+
),
|
|
8024
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4", "aria-hidden": true })
|
|
8025
|
+
}
|
|
8026
|
+
)
|
|
8027
|
+
] })
|
|
8028
|
+
] }),
|
|
8029
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-7 border-y border-gray-200 dark:border-gray-800", "aria-hidden": true, children: WEEK_DAYS2.map((d) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
8030
|
+
"span",
|
|
8031
|
+
{
|
|
8032
|
+
className: "text-2xs py-2 text-center font-semibold tracking-wider text-gray-500 uppercase dark:text-gray-400",
|
|
8033
|
+
children: d
|
|
8034
|
+
},
|
|
8035
|
+
d
|
|
8036
|
+
)) }),
|
|
8037
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "-mb-px grid grid-cols-7", children: days.map((day, i) => {
|
|
8038
|
+
const key = isoDate(day);
|
|
8039
|
+
const label = dayLabel(day);
|
|
8040
|
+
const dayEvents = byDay.get(key) ?? [];
|
|
8041
|
+
const hidden = dayEvents.length - MAX_CHIPS;
|
|
8042
|
+
const outside = day.getMonth() !== shown.getMonth();
|
|
8043
|
+
const isToday = sameDay(day, today);
|
|
8044
|
+
const numberClass = clsx.clsx(
|
|
8045
|
+
"inline-flex h-6 min-w-6 items-center justify-center rounded-full px-1 text-xs font-medium",
|
|
8046
|
+
isToday ? "bg-brand-500 text-white" : outside ? "text-gray-400 dark:text-gray-500" : "text-gray-700 dark:text-gray-200"
|
|
8047
|
+
);
|
|
8048
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8049
|
+
"div",
|
|
8050
|
+
{
|
|
8051
|
+
role: "group",
|
|
8052
|
+
"aria-label": label,
|
|
8053
|
+
className: clsx.clsx(
|
|
8054
|
+
"min-h-20 min-w-0 border-b border-gray-200 p-1.5 sm:min-h-28 dark:border-gray-800",
|
|
8055
|
+
i % 7 !== 6 && "border-r",
|
|
8056
|
+
outside && "bg-gray-50 dark:bg-white/[0.02]"
|
|
8057
|
+
),
|
|
8058
|
+
children: [
|
|
8059
|
+
onDayClick ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
8060
|
+
"button",
|
|
8061
|
+
{
|
|
8062
|
+
type: "button",
|
|
8063
|
+
"aria-label": label,
|
|
8064
|
+
"aria-current": isToday ? "date" : void 0,
|
|
8065
|
+
onClick: () => onDayClick(day),
|
|
8066
|
+
className: clsx.clsx(
|
|
8067
|
+
numberClass,
|
|
8068
|
+
!isToday && "hover:bg-gray-100 dark:hover:bg-white/5",
|
|
8069
|
+
FOCUS_RING
|
|
8070
|
+
),
|
|
8071
|
+
children: day.getDate()
|
|
8072
|
+
}
|
|
8073
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
8074
|
+
"time",
|
|
8075
|
+
{
|
|
8076
|
+
dateTime: key,
|
|
8077
|
+
"aria-current": isToday ? "date" : void 0,
|
|
8078
|
+
className: numberClass,
|
|
8079
|
+
children: day.getDate()
|
|
8080
|
+
}
|
|
8081
|
+
),
|
|
8082
|
+
dayEvents.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "mt-1 flex flex-wrap gap-0.5 sm:flex-col sm:flex-nowrap", children: dayEvents.slice(0, MAX_CHIPS).map((event) => /* @__PURE__ */ jsxRuntime.jsx("li", { className: "min-w-0", children: /* @__PURE__ */ jsxRuntime.jsx(EventChip, { event, onClick: onEventClick, compact: true }) }, event.id)) }),
|
|
8083
|
+
hidden > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8084
|
+
Popover,
|
|
8085
|
+
{
|
|
8086
|
+
open: openDay === key,
|
|
8087
|
+
onOpenChange: (open) => setOpenDay(open ? key : null),
|
|
8088
|
+
children: [
|
|
8089
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
8090
|
+
Popover.Trigger,
|
|
8091
|
+
{
|
|
8092
|
+
"aria-label": `+${hidden} more on ${label}`,
|
|
8093
|
+
className: clsx.clsx(
|
|
8094
|
+
"mt-0.5 rounded px-1.5 text-xs font-medium text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white",
|
|
8095
|
+
FOCUS_RING
|
|
8096
|
+
),
|
|
8097
|
+
children: [
|
|
8098
|
+
"+",
|
|
8099
|
+
hidden,
|
|
8100
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "max-sm:sr-only", children: " more" })
|
|
8101
|
+
]
|
|
8102
|
+
}
|
|
8103
|
+
),
|
|
8104
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Popover.Content, { "aria-label": `Events on ${label}`, width: "w-60", children: [
|
|
8105
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-2 text-xs font-semibold text-[var(--color-text-primary)]", children: label }),
|
|
8106
|
+
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: "space-y-1", children: dayEvents.map((event) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8107
|
+
EventChip,
|
|
8108
|
+
{
|
|
8109
|
+
event,
|
|
8110
|
+
onClick: onEventClick && ((e) => {
|
|
8111
|
+
setOpenDay(null);
|
|
8112
|
+
onEventClick(e);
|
|
8113
|
+
})
|
|
8114
|
+
}
|
|
8115
|
+
) }, event.id)) })
|
|
8116
|
+
] })
|
|
8117
|
+
]
|
|
8118
|
+
}
|
|
8119
|
+
)
|
|
8120
|
+
]
|
|
8121
|
+
},
|
|
8122
|
+
key
|
|
8123
|
+
);
|
|
8124
|
+
}) })
|
|
8125
|
+
]
|
|
8126
|
+
}
|
|
8127
|
+
);
|
|
8128
|
+
};
|
|
7541
8129
|
var ColumnFilterDropdown = ({
|
|
7542
8130
|
values,
|
|
7543
8131
|
selected,
|
|
@@ -7602,6 +8190,16 @@ var ColumnFilterDropdown = ({
|
|
|
7602
8190
|
}
|
|
7603
8191
|
);
|
|
7604
8192
|
};
|
|
8193
|
+
|
|
8194
|
+
// src/table/density.ts
|
|
8195
|
+
var HEADER_CELL_PADDING = {
|
|
8196
|
+
default: "py-3",
|
|
8197
|
+
comfortable: "py-4"
|
|
8198
|
+
};
|
|
8199
|
+
var BODY_CELL_PADDING = {
|
|
8200
|
+
default: "py-3.5",
|
|
8201
|
+
comfortable: "py-5"
|
|
8202
|
+
};
|
|
7605
8203
|
var ALIGN_CLASS2 = {
|
|
7606
8204
|
left: "text-left",
|
|
7607
8205
|
right: "text-right",
|
|
@@ -7618,6 +8216,7 @@ var ColumnHeader = ({
|
|
|
7618
8216
|
filterSelected,
|
|
7619
8217
|
onFilterToggle,
|
|
7620
8218
|
onFilterClear,
|
|
8219
|
+
density = "default",
|
|
7621
8220
|
className
|
|
7622
8221
|
}) => {
|
|
7623
8222
|
const [open, setOpen] = react.useState(false);
|
|
@@ -7635,7 +8234,9 @@ var ColumnHeader = ({
|
|
|
7635
8234
|
"th",
|
|
7636
8235
|
{
|
|
7637
8236
|
className: clsx.clsx(
|
|
7638
|
-
"bg-gray-50 px-4
|
|
8237
|
+
"bg-gray-50 px-4",
|
|
8238
|
+
HEADER_CELL_PADDING[density],
|
|
8239
|
+
"text-xs font-semibold tracking-wider text-gray-500 uppercase dark:bg-gray-800 dark:text-gray-400",
|
|
7639
8240
|
ALIGN_CLASS2[align],
|
|
7640
8241
|
className
|
|
7641
8242
|
),
|
|
@@ -7666,7 +8267,7 @@ var ColumnHeader = ({
|
|
|
7666
8267
|
),
|
|
7667
8268
|
children: [
|
|
7668
8269
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Filter, { className: "h-3 w-3" }),
|
|
7669
|
-
filterCount > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-
|
|
8270
|
+
filterCount > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-3xs", children: filterCount })
|
|
7670
8271
|
]
|
|
7671
8272
|
}
|
|
7672
8273
|
),
|
|
@@ -7866,6 +8467,7 @@ var DataTable = ({
|
|
|
7866
8467
|
onRetry,
|
|
7867
8468
|
emptyTitle = "No results",
|
|
7868
8469
|
emptyDescription,
|
|
8470
|
+
density = "default",
|
|
7869
8471
|
selectable = false,
|
|
7870
8472
|
selection: selectionProp,
|
|
7871
8473
|
defaultSelection,
|
|
@@ -8092,15 +8694,25 @@ var DataTable = ({
|
|
|
8092
8694
|
renderRowAction && /* @__PURE__ */ jsxRuntime.jsx("col", { style: { width: "8%" } })
|
|
8093
8695
|
] }),
|
|
8094
8696
|
/* @__PURE__ */ jsxRuntime.jsx("thead", { className: "sticky top-0 z-10", children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: "border-b border-gray-100 dark:border-gray-800", children: [
|
|
8095
|
-
selectable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8096
|
-
|
|
8697
|
+
selectable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8698
|
+
"th",
|
|
8097
8699
|
{
|
|
8098
|
-
|
|
8099
|
-
|
|
8100
|
-
|
|
8101
|
-
|
|
8700
|
+
className: clsx.clsx(
|
|
8701
|
+
"bg-gray-50 px-4",
|
|
8702
|
+
HEADER_CELL_PADDING[density],
|
|
8703
|
+
"dark:bg-gray-800"
|
|
8704
|
+
),
|
|
8705
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8706
|
+
Checkbox,
|
|
8707
|
+
{
|
|
8708
|
+
"aria-label": "Select all rows",
|
|
8709
|
+
checked: allVisibleSelected,
|
|
8710
|
+
indeterminate: someVisibleSelected,
|
|
8711
|
+
onChange: toggleAllVisible
|
|
8712
|
+
}
|
|
8713
|
+
)
|
|
8102
8714
|
}
|
|
8103
|
-
)
|
|
8715
|
+
),
|
|
8104
8716
|
columns.map((col) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
8105
8717
|
ColumnHeader,
|
|
8106
8718
|
{
|
|
@@ -8113,11 +8725,22 @@ var DataTable = ({
|
|
|
8113
8725
|
filterValues: columnFilterValues[col.key],
|
|
8114
8726
|
filterSelected: filters[col.key],
|
|
8115
8727
|
onFilterToggle: (v) => handleFilterToggle(col.key, v),
|
|
8116
|
-
onFilterClear: () => clearFilter(col.key)
|
|
8728
|
+
onFilterClear: () => clearFilter(col.key),
|
|
8729
|
+
density
|
|
8117
8730
|
},
|
|
8118
8731
|
col.key
|
|
8119
8732
|
)),
|
|
8120
|
-
renderRowAction && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8733
|
+
renderRowAction && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8734
|
+
"th",
|
|
8735
|
+
{
|
|
8736
|
+
className: clsx.clsx(
|
|
8737
|
+
"bg-gray-50 px-4",
|
|
8738
|
+
HEADER_CELL_PADDING[density],
|
|
8739
|
+
"text-right text-xs font-semibold tracking-wider text-gray-500 uppercase dark:bg-gray-800 dark:text-gray-400"
|
|
8740
|
+
),
|
|
8741
|
+
children: "Action"
|
|
8742
|
+
}
|
|
8743
|
+
)
|
|
8121
8744
|
] }) }),
|
|
8122
8745
|
/* @__PURE__ */ jsxRuntime.jsx("tbody", { className: "divide-y divide-gray-100 dark:divide-gray-800", children: pageRows.map((row) => {
|
|
8123
8746
|
const key = rowKey(row);
|
|
@@ -8130,7 +8753,7 @@ var DataTable = ({
|
|
|
8130
8753
|
isSelected && "bg-brand-50/40 dark:bg-brand-500/5"
|
|
8131
8754
|
),
|
|
8132
8755
|
children: [
|
|
8133
|
-
selectable && /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4
|
|
8756
|
+
selectable && /* @__PURE__ */ jsxRuntime.jsx("td", { className: clsx.clsx("px-4", BODY_CELL_PADDING[density]), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8134
8757
|
Checkbox,
|
|
8135
8758
|
{
|
|
8136
8759
|
"aria-label": `Select row ${key}`,
|
|
@@ -8141,12 +8764,17 @@ var DataTable = ({
|
|
|
8141
8764
|
columns.map((col) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
8142
8765
|
"td",
|
|
8143
8766
|
{
|
|
8144
|
-
className: clsx.clsx(
|
|
8767
|
+
className: clsx.clsx(
|
|
8768
|
+
"px-4",
|
|
8769
|
+
BODY_CELL_PADDING[density],
|
|
8770
|
+
"text-sm",
|
|
8771
|
+
ALIGN_CELL[col.align ?? "left"]
|
|
8772
|
+
),
|
|
8145
8773
|
children: col.render(row)
|
|
8146
8774
|
},
|
|
8147
8775
|
col.key
|
|
8148
8776
|
)),
|
|
8149
|
-
renderRowAction && /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4
|
|
8777
|
+
renderRowAction && /* @__PURE__ */ jsxRuntime.jsx("td", { className: clsx.clsx("px-4", BODY_CELL_PADDING[density], "text-right"), children: renderRowAction(row) })
|
|
8150
8778
|
]
|
|
8151
8779
|
},
|
|
8152
8780
|
key
|
|
@@ -8258,7 +8886,7 @@ var IntegrationCard = ({
|
|
|
8258
8886
|
status && /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: STATUS_VARIANT[status], appearance: "light", children: STATUS_LABEL2[status] })
|
|
8259
8887
|
] }),
|
|
8260
8888
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-4 min-w-0 flex-1", children: [
|
|
8261
|
-
category && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-mono
|
|
8889
|
+
category && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-3xs font-mono tracking-wide text-gray-400 uppercase dark:text-gray-500", children: category }),
|
|
8262
8890
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "mt-0.5 truncate text-sm font-semibold text-gray-900 dark:text-white", children: name }),
|
|
8263
8891
|
description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 line-clamp-2 text-xs text-gray-600 dark:text-gray-400", children: description })
|
|
8264
8892
|
] }),
|
|
@@ -8817,7 +9445,7 @@ var ColorSwatch = ({
|
|
|
8817
9445
|
"span",
|
|
8818
9446
|
{
|
|
8819
9447
|
className: clsx.clsx(
|
|
8820
|
-
"text-
|
|
9448
|
+
"text-3xs leading-none font-medium",
|
|
8821
9449
|
active ? "text-gray-700 dark:text-gray-200" : "text-gray-400 dark:text-gray-500"
|
|
8822
9450
|
),
|
|
8823
9451
|
children: label
|
|
@@ -8904,7 +9532,7 @@ var PaletteCard = ({ meta, active = false, onClick, className }) => /* @__PURE__
|
|
|
8904
9532
|
children: meta.label
|
|
8905
9533
|
}
|
|
8906
9534
|
),
|
|
8907
|
-
meta.desc && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "
|
|
9535
|
+
meta.desc && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-3xs block", style: { color: meta.preview.text ?? "#9ca3af" }, children: meta.desc })
|
|
8908
9536
|
] }),
|
|
8909
9537
|
active && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "bg-brand-500 flex h-4 w-4 shrink-0 items-center justify-center rounded-full", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-2.5 w-2.5 text-white", "aria-hidden": true }) })
|
|
8910
9538
|
]
|
|
@@ -8959,7 +9587,7 @@ var OptionCard = ({
|
|
|
8959
9587
|
children: label
|
|
8960
9588
|
}
|
|
8961
9589
|
),
|
|
8962
|
-
desc && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-
|
|
9590
|
+
desc && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-3xs text-gray-400 dark:text-gray-500", children: desc })
|
|
8963
9591
|
] }),
|
|
8964
9592
|
active && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "bg-brand-500 absolute top-1.5 right-1.5 flex h-4 w-4 items-center justify-center rounded-full", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-2.5 w-2.5 text-white", "aria-hidden": true }) })
|
|
8965
9593
|
]
|
|
@@ -9032,15 +9660,37 @@ var COSMOS_ACCENTS = [
|
|
|
9032
9660
|
{ id: "amber", label: "Amber", hex: "#a46800" },
|
|
9033
9661
|
{ id: "green", label: "Green", hex: "#02863c" }
|
|
9034
9662
|
];
|
|
9663
|
+
var COSMOS_FONTS = [
|
|
9664
|
+
{ id: "outfit", label: "Outfit", family: "'Outfit', system-ui, sans-serif" },
|
|
9665
|
+
{ id: "inter", label: "Inter", family: "'Inter Variable', system-ui, sans-serif" },
|
|
9666
|
+
{ id: "plex", label: "IBM Plex Sans", family: "'IBM Plex Sans Variable', system-ui, sans-serif" },
|
|
9667
|
+
{ id: "montserrat", label: "Montserrat", family: "'Montserrat Variable', system-ui, sans-serif" },
|
|
9668
|
+
{ id: "open-sans", label: "Open Sans", family: "'Open Sans Variable', system-ui, sans-serif" },
|
|
9669
|
+
{
|
|
9670
|
+
id: "system",
|
|
9671
|
+
label: "System",
|
|
9672
|
+
family: "system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif"
|
|
9673
|
+
}
|
|
9674
|
+
];
|
|
9675
|
+
var COSMOS_TEXT_SIZES = [
|
|
9676
|
+
{ id: "sm", label: "Small", scale: 0.9375 },
|
|
9677
|
+
{ id: "md", label: "Default", scale: 1 },
|
|
9678
|
+
{ id: "lg", label: "Large", scale: 1.125 },
|
|
9679
|
+
{ id: "xl", label: "Extra large", scale: 1.25 }
|
|
9680
|
+
];
|
|
9035
9681
|
var THEME_CLASSES = COSMOS_THEMES.map((t) => t.id).filter((id) => id !== "light");
|
|
9036
9682
|
var isDarkTheme = (theme) => COSMOS_THEMES.some((t) => t.id === theme && t.dark);
|
|
9037
|
-
var applyAppearance = ({ theme, accent }, root) => {
|
|
9683
|
+
var applyAppearance = ({ theme, accent, font, textSize }, root) => {
|
|
9038
9684
|
const el = root ?? (typeof document === "undefined" ? void 0 : document.documentElement);
|
|
9039
9685
|
if (!el) return;
|
|
9040
9686
|
el.classList.remove(...THEME_CLASSES);
|
|
9041
9687
|
if (theme !== "light") el.classList.add(theme);
|
|
9042
9688
|
if (accent === "blue") delete el.dataset.accent;
|
|
9043
9689
|
else el.dataset.accent = accent;
|
|
9690
|
+
if (font === "outfit") delete el.dataset.font;
|
|
9691
|
+
else if (font) el.dataset.font = font;
|
|
9692
|
+
if (textSize === "md") delete el.dataset.textSize;
|
|
9693
|
+
else if (textSize) el.dataset.textSize = textSize;
|
|
9044
9694
|
};
|
|
9045
9695
|
var AppearanceSettings = ({
|
|
9046
9696
|
theme,
|
|
@@ -9052,10 +9702,20 @@ var AppearanceSettings = ({
|
|
|
9052
9702
|
themes = COSMOS_THEMES,
|
|
9053
9703
|
accents = COSMOS_ACCENTS,
|
|
9054
9704
|
themeColumns = 4,
|
|
9705
|
+
font = "outfit",
|
|
9706
|
+
onFontChange,
|
|
9707
|
+
textSize = "md",
|
|
9708
|
+
onTextSizeChange,
|
|
9709
|
+
fontLabel = "Font",
|
|
9710
|
+
textSizeLabel = "Text size",
|
|
9711
|
+
fonts = COSMOS_FONTS,
|
|
9712
|
+
textSizes = COSMOS_TEXT_SIZES,
|
|
9055
9713
|
className
|
|
9056
9714
|
}) => {
|
|
9057
9715
|
const themeHeadingId = react.useId();
|
|
9058
9716
|
const accentHeadingId = react.useId();
|
|
9717
|
+
const fontHeadingId = react.useId();
|
|
9718
|
+
const textSizeHeadingId = react.useId();
|
|
9059
9719
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx.clsx("space-y-6", className), children: [
|
|
9060
9720
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { role: "group", "aria-labelledby": themeHeadingId, children: [
|
|
9061
9721
|
/* @__PURE__ */ jsxRuntime.jsx("p", { id: themeHeadingId, className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: themeLabel }),
|
|
@@ -9082,6 +9742,64 @@ var AppearanceSettings = ({
|
|
|
9082
9742
|
cols: 6
|
|
9083
9743
|
}
|
|
9084
9744
|
)
|
|
9745
|
+
] }),
|
|
9746
|
+
onFontChange && /* @__PURE__ */ jsxRuntime.jsxs("div", { role: "group", "aria-labelledby": fontHeadingId, children: [
|
|
9747
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { id: fontHeadingId, className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: fontLabel }),
|
|
9748
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9749
|
+
OptionPicker,
|
|
9750
|
+
{
|
|
9751
|
+
className: "mt-3",
|
|
9752
|
+
cols: 3,
|
|
9753
|
+
value: font,
|
|
9754
|
+
onChange: (id) => onFontChange(id),
|
|
9755
|
+
options: fonts.map((f) => ({
|
|
9756
|
+
id: f.id,
|
|
9757
|
+
label: f.label,
|
|
9758
|
+
preview: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9759
|
+
"span",
|
|
9760
|
+
{
|
|
9761
|
+
"aria-hidden": true,
|
|
9762
|
+
style: { fontFamily: f.family },
|
|
9763
|
+
className: "text-xl text-gray-900 dark:text-gray-100",
|
|
9764
|
+
children: "Aa"
|
|
9765
|
+
}
|
|
9766
|
+
)
|
|
9767
|
+
}))
|
|
9768
|
+
}
|
|
9769
|
+
)
|
|
9770
|
+
] }),
|
|
9771
|
+
onTextSizeChange && /* @__PURE__ */ jsxRuntime.jsxs("div", { role: "group", "aria-labelledby": textSizeHeadingId, children: [
|
|
9772
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9773
|
+
"p",
|
|
9774
|
+
{
|
|
9775
|
+
id: textSizeHeadingId,
|
|
9776
|
+
className: "text-sm font-medium text-gray-700 dark:text-gray-300",
|
|
9777
|
+
children: textSizeLabel
|
|
9778
|
+
}
|
|
9779
|
+
),
|
|
9780
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9781
|
+
OptionPicker,
|
|
9782
|
+
{
|
|
9783
|
+
className: "mt-3",
|
|
9784
|
+
cols: 4,
|
|
9785
|
+
value: textSize,
|
|
9786
|
+
onChange: (id) => onTextSizeChange(id),
|
|
9787
|
+
options: textSizes.map((t) => ({
|
|
9788
|
+
id: t.id,
|
|
9789
|
+
label: t.label,
|
|
9790
|
+
// Pixel sizes, so the previews don't scale with the setting.
|
|
9791
|
+
preview: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9792
|
+
"span",
|
|
9793
|
+
{
|
|
9794
|
+
"aria-hidden": true,
|
|
9795
|
+
style: { fontSize: `${16 * t.scale}px` },
|
|
9796
|
+
className: "text-gray-900 dark:text-gray-100",
|
|
9797
|
+
children: "Aa"
|
|
9798
|
+
}
|
|
9799
|
+
)
|
|
9800
|
+
}))
|
|
9801
|
+
}
|
|
9802
|
+
)
|
|
9085
9803
|
] })
|
|
9086
9804
|
] });
|
|
9087
9805
|
};
|
|
@@ -9110,10 +9828,10 @@ var AppearanceMenu = ({
|
|
|
9110
9828
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Palette, { className: icon, "aria-hidden": true })
|
|
9111
9829
|
}
|
|
9112
9830
|
),
|
|
9113
|
-
/* @__PURE__ */ jsxRuntime.jsx(Popover.Content, { align: "end", width: "w-96", "aria-label": label, children: /* @__PURE__ */ jsxRuntime.jsx(AppearanceSettings, { themeColumns: 2, ...settings }) })
|
|
9831
|
+
/* @__PURE__ */ jsxRuntime.jsx(Popover.Content, { align: "end", width: "w-96", "aria-label": label, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "-m-4 max-h-[calc(100dvh-6rem)] overflow-y-auto p-4", children: /* @__PURE__ */ jsxRuntime.jsx(AppearanceSettings, { themeColumns: 2, ...settings }) }) })
|
|
9114
9832
|
] });
|
|
9115
9833
|
};
|
|
9116
|
-
var
|
|
9834
|
+
var SIZE2 = {
|
|
9117
9835
|
sm: "text-base leading-relaxed",
|
|
9118
9836
|
md: "text-lg leading-relaxed",
|
|
9119
9837
|
lg: "text-2xl leading-snug"
|
|
@@ -9133,7 +9851,7 @@ var Blockquote = ({
|
|
|
9133
9851
|
authorAvatar,
|
|
9134
9852
|
className
|
|
9135
9853
|
}) => {
|
|
9136
|
-
const text = /* @__PURE__ */ jsxRuntime.jsx("p", { className: clsx.clsx("font-medium text-gray-700 italic dark:text-gray-200",
|
|
9854
|
+
const text = /* @__PURE__ */ jsxRuntime.jsx("p", { className: clsx.clsx("font-medium text-gray-700 italic dark:text-gray-200", SIZE2[size]), children });
|
|
9137
9855
|
if (variant === "icon") {
|
|
9138
9856
|
return /* @__PURE__ */ jsxRuntime.jsxs("blockquote", { className: clsx.clsx(ALIGN[align], className), children: [
|
|
9139
9857
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -9215,21 +9933,6 @@ var Blockquote = ({
|
|
|
9215
9933
|
}
|
|
9216
9934
|
);
|
|
9217
9935
|
};
|
|
9218
|
-
var SIZE2 = {
|
|
9219
|
-
sm: "h-5 min-w-[20px] px-1.5 text-[10px]",
|
|
9220
|
-
md: "h-6 min-w-[24px] px-2 text-xs"
|
|
9221
|
-
};
|
|
9222
|
-
var Kbd2 = ({ children, size = "md", className }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
9223
|
-
"kbd",
|
|
9224
|
-
{
|
|
9225
|
-
className: clsx.clsx(
|
|
9226
|
-
"inline-flex shrink-0 items-center justify-center rounded border border-gray-200 bg-gray-50 font-mono font-medium text-gray-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.04)] dark:border-gray-700 dark:bg-gray-800 dark:text-gray-200 dark:shadow-[inset_0_-1px_0_0_rgba(255,255,255,0.04)]",
|
|
9227
|
-
SIZE2[size],
|
|
9228
|
-
className
|
|
9229
|
-
),
|
|
9230
|
-
children
|
|
9231
|
-
}
|
|
9232
|
-
);
|
|
9233
9936
|
var SIZE3 = {
|
|
9234
9937
|
xs: "max-w-xs",
|
|
9235
9938
|
sm: "max-w-sm",
|
|
@@ -9304,6 +10007,8 @@ exports.Breadcrumb = Breadcrumb;
|
|
|
9304
10007
|
exports.Button = Button;
|
|
9305
10008
|
exports.ButtonGroup = ButtonGroup;
|
|
9306
10009
|
exports.COSMOS_ACCENTS = COSMOS_ACCENTS;
|
|
10010
|
+
exports.COSMOS_FONTS = COSMOS_FONTS;
|
|
10011
|
+
exports.COSMOS_TEXT_SIZES = COSMOS_TEXT_SIZES;
|
|
9307
10012
|
exports.COSMOS_THEMES = COSMOS_THEMES;
|
|
9308
10013
|
exports.Calendar = Calendar;
|
|
9309
10014
|
exports.Card = Card2;
|
|
@@ -9334,6 +10039,7 @@ exports.Dropzone = Dropzone;
|
|
|
9334
10039
|
exports.EmptyState = EmptyState;
|
|
9335
10040
|
exports.ErrorPage = ErrorPage;
|
|
9336
10041
|
exports.ErrorState = ErrorState;
|
|
10042
|
+
exports.EventCalendar = EventCalendar;
|
|
9337
10043
|
exports.Figure = Figure;
|
|
9338
10044
|
exports.FileInput = FileInput;
|
|
9339
10045
|
exports.FilterPills = FilterPills;
|
|
@@ -9347,7 +10053,7 @@ exports.IconBox = IconBox;
|
|
|
9347
10053
|
exports.ImageGrid = ImageGrid;
|
|
9348
10054
|
exports.Input = Input;
|
|
9349
10055
|
exports.IntegrationCard = IntegrationCard;
|
|
9350
|
-
exports.Kbd =
|
|
10056
|
+
exports.Kbd = Kbd;
|
|
9351
10057
|
exports.KpiCard = KpiCard;
|
|
9352
10058
|
exports.Link = Link;
|
|
9353
10059
|
exports.List = List2;
|
|
@@ -9366,7 +10072,6 @@ exports.OtpInput = OtpInput;
|
|
|
9366
10072
|
exports.PageActionButton = PageActionButton;
|
|
9367
10073
|
exports.PageActionIconButton = PageActionIconButton;
|
|
9368
10074
|
exports.PageBreadcrumb = PageBreadcrumb;
|
|
9369
|
-
exports.PageCard = PageCard;
|
|
9370
10075
|
exports.PageHeader = PageHeader;
|
|
9371
10076
|
exports.Pagination = Pagination;
|
|
9372
10077
|
exports.PaletteCard = PaletteCard;
|