@yuhuanowo/yunui 0.2.13 → 0.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai.d.ts +37 -1
- package/dist/ai.js +134 -33
- package/dist/ai.js.map +1 -1
- package/dist/{chunk-TFZKMJGF.js → chunk-GHO4RCDR.js} +5 -5
- package/dist/{chunk-TFZKMJGF.js.map → chunk-GHO4RCDR.js.map} +1 -1
- package/dist/{chunk-MTEICYIC.js → chunk-VXFEANVX.js} +103 -75
- package/dist/chunk-VXFEANVX.js.map +1 -0
- package/dist/index.d.ts +21 -5
- package/dist/index.js +2 -2
- package/dist/patterns.d.ts +216 -2
- package/dist/patterns.js +430 -28
- package/dist/patterns.js.map +1 -1
- package/package.json +1 -1
- package/styles/yunui.css +122 -19
- package/dist/chunk-MTEICYIC.js.map +0 -1
|
@@ -42,7 +42,7 @@ function ThemeToggle({ variant = "icon", align = "right", className = "" }) {
|
|
|
42
42
|
"button",
|
|
43
43
|
{
|
|
44
44
|
onClick: () => setIsOpen(!isOpen),
|
|
45
|
-
className: "flex items-center gap-1.5 h-9 px-3 rounded-full text-sm font-medium transition-all bg-(--bg-elevated) hover:bg-(--bg-elevated)/80 border border-(--border-hairline) text-(--text-secondary) hover:text-(--text-primary)",
|
|
45
|
+
className: "flex items-center gap-1.5 h-9 px-3 rounded-full text-sm font-medium transition-all bg-(--bg-elevated) hover:bg-(--bg-elevated)/80 border border-(--border-hairline) text-(--text-secondary) hover:text-(--text-primary) outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
46
46
|
"aria-label": t("toggle"),
|
|
47
47
|
children: [
|
|
48
48
|
/* @__PURE__ */ jsx(Sun, { size: 14, className: "rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" }),
|
|
@@ -53,7 +53,7 @@ function ThemeToggle({ variant = "icon", align = "right", className = "" }) {
|
|
|
53
53
|
"button",
|
|
54
54
|
{
|
|
55
55
|
onClick: () => setIsOpen(!isOpen),
|
|
56
|
-
className: "w-9 h-9 rounded-lg flex items-center justify-center hover:bg-foreground/5 transition-colors",
|
|
56
|
+
className: "w-9 h-9 rounded-lg flex items-center justify-center hover:bg-foreground/5 transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
57
57
|
"aria-label": t("toggle"),
|
|
58
58
|
children: [
|
|
59
59
|
/* @__PURE__ */ jsx(Sun, { className: "h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0 absolute" }),
|
|
@@ -62,7 +62,7 @@ function ThemeToggle({ variant = "icon", align = "right", className = "" }) {
|
|
|
62
62
|
]
|
|
63
63
|
}
|
|
64
64
|
),
|
|
65
|
-
isOpen && /* @__PURE__ */ jsx("div", { className: `absolute ${align === "left" ? "left-0" : "right-0"} top-full mt-2 z-50 rounded-2xl border border-
|
|
65
|
+
isOpen && /* @__PURE__ */ jsx("div", { className: `absolute ${align === "left" ? "left-0" : "right-0"} top-full mt-2 z-50 rounded-2xl border border-border bg-background/60 backdrop-blur-2xl text-popover-foreground shadow-lg shadow-black/5 animate-in fade-in-0 zoom-in-95 duration-200`, children: /* @__PURE__ */ jsx("div", { className: "p-1", children: themes.map((themeItem) => /* @__PURE__ */ jsxs(
|
|
66
66
|
"button",
|
|
67
67
|
{
|
|
68
68
|
onClick: () => {
|
|
@@ -81,5 +81,5 @@ function ThemeToggle({ variant = "icon", align = "right", className = "" }) {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
export { ThemeToggle, cn };
|
|
84
|
-
//# sourceMappingURL=chunk-
|
|
85
|
-
//# sourceMappingURL=chunk-
|
|
84
|
+
//# sourceMappingURL=chunk-GHO4RCDR.js.map
|
|
85
|
+
//# sourceMappingURL=chunk-GHO4RCDR.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/cn.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;AAAA,OAAA;AAAA,MAVrC,SAAA,CAAU;AAAA,KAYtB,GACL,CAAA,EACJ;AAAA,GAAA,EAER,CAAA;AAER","file":"chunk-GHO4RCDR.js","sourcesContent":["import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * Merge class names with Tailwind-aware conflict resolution.\n * `cn(\"px-4\", \"px-8\")` → `\"px-8\"`.\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport { Moon, Sun, Monitor, Droplet } from \"lucide-react\"\nimport { useTheme } from \"next-themes\"\nimport { useYunUI } from \"../adapters/context\"\n\ninterface ThemeToggleProps {\n /** Visual variant: `icon` (default, icon-only) or `pill`. */\n variant?: \"icon\" | \"pill\";\n /** Dropdown alignment: `left` or `right` (default). */\n align?: \"left\" | \"right\";\n /** Additional className */\n className?: string;\n}\n\n/** Theme switcher dropdown (light / dark / true-black / system) backed by next-themes. */\nexport function ThemeToggle({ variant = \"icon\", align = \"right\", className = \"\" }: ThemeToggleProps) {\n const { theme, setTheme } = useTheme()\n const t = useYunUI().useT(\"common.theme\")\n const [mounted, setMounted] = React.useState(false)\n const [isOpen, setIsOpen] = React.useState(false)\n const containerRef = React.useRef<HTMLDivElement>(null)\n\n React.useEffect(() => {\n setMounted(true)\n }, [])\n\n // Close on outside click\n React.useEffect(() => {\n const handleClickOutside = (e: MouseEvent) => {\n if (containerRef.current && !containerRef.current.contains(e.target as Node)) {\n setIsOpen(false)\n }\n }\n document.addEventListener(\"mousedown\", handleClickOutside)\n return () => document.removeEventListener(\"mousedown\", handleClickOutside)\n }, [])\n\n const themes = [\n { value: \"light\", label: t(\"light\"), icon: <Sun size={14} /> },\n { value: \"dark\", label: t(\"zincDark\"), icon: <Moon size={14} /> },\n { value: \"true-black\", label: t(\"trueBlack\"), icon: <Droplet size={14} fill=\"currentColor\" /> },\n { value: \"system\", label: t(\"system\"), icon: <Monitor size={14} /> },\n ]\n\n if (!mounted) {\n return (\n <div className={className}>\n {variant === \"pill\" ? (\n <div className=\"h-8 w-16 rounded-full bg-(--bg-elevated) border border-(--border-hairline)\" />\n ) : (\n <div className=\"w-9 h-9 rounded-lg\" />\n )}\n </div>\n )\n }\n\n return (\n <div ref={containerRef} className={`relative ${className}`}>\n {/* Trigger */}\n {variant === \"pill\" ? (\n <button\n onClick={() => setIsOpen(!isOpen)}\n className=\"flex items-center gap-1.5 h-9 px-3 rounded-full text-sm font-medium transition-all bg-(--bg-elevated) hover:bg-(--bg-elevated)/80 border border-(--border-hairline) text-(--text-secondary) hover:text-(--text-primary) outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\"\n aria-label={t(\"toggle\")}\n >\n <Sun size={14} className=\"rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0\" />\n <Moon size={14} className=\"absolute rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100\" />\n </button>\n ) : (\n <button\n onClick={() => setIsOpen(!isOpen)}\n className=\"w-9 h-9 rounded-lg flex items-center justify-center hover:bg-foreground/5 transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\"\n aria-label={t(\"toggle\")}\n >\n <Sun className=\"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0 absolute\" />\n <Moon className=\"h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100\" />\n <span className=\"sr-only\">{t(\"toggle\")}</span>\n </button>\n )}\n\n {/* Dropdown */}\n {isOpen && (\n <div className={`absolute ${align === \"left\" ? \"left-0\" : \"right-0\"} top-full mt-2 z-50 rounded-2xl border border-border bg-background/60 backdrop-blur-2xl text-popover-foreground shadow-lg shadow-black/5 animate-in fade-in-0 zoom-in-95 duration-200`}>\n <div className=\"p-1\">\n {themes.map((themeItem) => (\n <button\n key={themeItem.value}\n onClick={() => {\n setTheme(themeItem.value)\n setIsOpen(false)\n }}\n className={`dropdown-item w-full text-left ${\n theme === themeItem.value ? \"active\" : \"\"\n }`}\n >\n {themeItem.icon}\n <span className=\"flex-1\">{themeItem.label}</span>\n </button>\n ))}\n </div>\n </div>\n )}\n </div>\n )\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { cn } from './chunk-
|
|
2
|
+
import { cn } from './chunk-GHO4RCDR.js';
|
|
3
3
|
import { useYunUI } from './chunk-U2LNRVMI.js';
|
|
4
4
|
import * as React7 from 'react';
|
|
5
5
|
import { forwardRef, useState, useEffect, useRef, useCallback, useId } from 'react';
|
|
@@ -282,7 +282,7 @@ function Modal({
|
|
|
282
282
|
/* @__PURE__ */ jsxs("div", { className: "space-y-1 min-w-0", children: [
|
|
283
283
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
284
284
|
/* @__PURE__ */ jsx("h2", { id: "modal-title", className: "text-lg font-semibold truncate", children: title }),
|
|
285
|
-
showUnsavedBadge && /* @__PURE__ */ jsx("span", { className: "badge
|
|
285
|
+
showUnsavedBadge && /* @__PURE__ */ jsx("span", { className: "badge-warning shrink-0", children: t("unsaved") })
|
|
286
286
|
] }),
|
|
287
287
|
subtitle && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground truncate", children: subtitle })
|
|
288
288
|
] }),
|
|
@@ -311,26 +311,26 @@ function Modal({
|
|
|
311
311
|
var closeIdCounter2 = 0;
|
|
312
312
|
var variantConfig = {
|
|
313
313
|
danger: {
|
|
314
|
-
iconBg: "bg-
|
|
315
|
-
iconColor: "text-
|
|
314
|
+
iconBg: "bg-error-soft",
|
|
315
|
+
iconColor: "text-error",
|
|
316
316
|
buttonVariant: "red",
|
|
317
317
|
Icon: Trash2
|
|
318
318
|
},
|
|
319
319
|
warning: {
|
|
320
|
-
iconBg: "bg-
|
|
321
|
-
iconColor: "text-
|
|
320
|
+
iconBg: "bg-warning-soft",
|
|
321
|
+
iconColor: "text-warning",
|
|
322
322
|
buttonVariant: "amber",
|
|
323
323
|
Icon: RefreshCw
|
|
324
324
|
},
|
|
325
325
|
info: {
|
|
326
|
-
iconBg: "bg-
|
|
327
|
-
iconColor: "text-
|
|
326
|
+
iconBg: "bg-info-soft",
|
|
327
|
+
iconColor: "text-info",
|
|
328
328
|
buttonVariant: "default",
|
|
329
329
|
Icon: Info
|
|
330
330
|
},
|
|
331
331
|
success: {
|
|
332
|
-
iconBg: "bg-
|
|
333
|
-
iconColor: "text-
|
|
332
|
+
iconBg: "bg-success-soft",
|
|
333
|
+
iconColor: "text-success",
|
|
334
334
|
buttonVariant: "default",
|
|
335
335
|
Icon: CheckCircle
|
|
336
336
|
}
|
|
@@ -351,11 +351,13 @@ function ConfirmModal({
|
|
|
351
351
|
}) {
|
|
352
352
|
const t = useYunUI().useT("components.confirmModal");
|
|
353
353
|
const confirmButtonRef = useRef(null);
|
|
354
|
+
const dialogRef = useRef(null);
|
|
354
355
|
const timeoutRef = useRef(null);
|
|
355
356
|
const closeIdRef = useRef(0);
|
|
356
357
|
const [isClosing, setIsClosing] = useState(false);
|
|
357
358
|
const [mounted, setMounted] = useState(false);
|
|
358
359
|
const config = variantConfig[variant];
|
|
360
|
+
useFocusTrap(dialogRef, isOpen && !isClosing && mounted);
|
|
359
361
|
const _confirmText = confirmText ?? t("confirm");
|
|
360
362
|
const _cancelText = cancelText ?? t("cancel");
|
|
361
363
|
useEffect(() => {
|
|
@@ -437,6 +439,7 @@ function ConfirmModal({
|
|
|
437
439
|
/* @__PURE__ */ jsx(
|
|
438
440
|
"div",
|
|
439
441
|
{
|
|
442
|
+
ref: dialogRef,
|
|
440
443
|
className: cn(
|
|
441
444
|
"card relative w-full max-w-sm shadow-2xl transition-all",
|
|
442
445
|
isClosing ? "scale-95 opacity-0" : "scale-100 opacity-100",
|
|
@@ -537,11 +540,14 @@ function RegenerateConfirmModal({
|
|
|
537
540
|
}
|
|
538
541
|
function Sheet({ open, onClose, children, title, mobileOnly = false }) {
|
|
539
542
|
const [mounted, setMounted] = useState(false);
|
|
543
|
+
const panelRef = useRef(null);
|
|
544
|
+
const titleId = useId();
|
|
540
545
|
useEffect(() => {
|
|
541
546
|
setMounted(true);
|
|
542
547
|
return () => setMounted(false);
|
|
543
548
|
}, []);
|
|
544
549
|
useModalBehavior(open, onClose);
|
|
550
|
+
useFocusTrap(panelRef, open && mounted);
|
|
545
551
|
if (!mounted) return null;
|
|
546
552
|
return createPortal(
|
|
547
553
|
/* @__PURE__ */ jsx(AnimatePresence, { children: open && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -562,6 +568,10 @@ function Sheet({ open, onClose, children, title, mobileOnly = false }) {
|
|
|
562
568
|
/* @__PURE__ */ jsxs(
|
|
563
569
|
motion.div,
|
|
564
570
|
{
|
|
571
|
+
ref: panelRef,
|
|
572
|
+
role: "dialog",
|
|
573
|
+
"aria-modal": "true",
|
|
574
|
+
"aria-labelledby": title ? titleId : void 0,
|
|
565
575
|
initial: { x: "100%" },
|
|
566
576
|
animate: { x: 0 },
|
|
567
577
|
exit: { x: "100%" },
|
|
@@ -571,7 +581,7 @@ function Sheet({ open, onClose, children, title, mobileOnly = false }) {
|
|
|
571
581
|
onClick: (e) => e.stopPropagation(),
|
|
572
582
|
children: [
|
|
573
583
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-5 py-4 border-b border-border/60 shrink-0", children: [
|
|
574
|
-
title && /* @__PURE__ */ jsx("h2", { className: "font-semibold text-sm tracking-tight", children: title }),
|
|
584
|
+
title && /* @__PURE__ */ jsx("h2", { id: titleId, className: "font-semibold text-sm tracking-tight", children: title }),
|
|
575
585
|
/* @__PURE__ */ jsx(
|
|
576
586
|
"button",
|
|
577
587
|
{
|
|
@@ -592,7 +602,7 @@ function Sheet({ open, onClose, children, title, mobileOnly = false }) {
|
|
|
592
602
|
);
|
|
593
603
|
}
|
|
594
604
|
var Checkbox = forwardRef(
|
|
595
|
-
({ checked, onCheckedChange, disabled = false, className = "", id }, ref) => {
|
|
605
|
+
({ checked = false, onCheckedChange, disabled = false, className = "", id }, ref) => {
|
|
596
606
|
const filled = checked === true || checked === "indeterminate";
|
|
597
607
|
return /* @__PURE__ */ jsx(
|
|
598
608
|
"button",
|
|
@@ -602,13 +612,13 @@ var Checkbox = forwardRef(
|
|
|
602
612
|
role: "checkbox",
|
|
603
613
|
"aria-checked": checked === "indeterminate" ? "mixed" : checked,
|
|
604
614
|
id,
|
|
605
|
-
onClick: () => !disabled && onCheckedChange(checked !== true),
|
|
615
|
+
onClick: () => !disabled && onCheckedChange?.(checked !== true),
|
|
606
616
|
disabled,
|
|
607
617
|
className: `
|
|
608
618
|
w-4 h-4 rounded border-2 flex items-center justify-center
|
|
609
619
|
transition-all duration-200 ease-in-out
|
|
610
620
|
outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background
|
|
611
|
-
${filled ? "bg-primary border-primary text-primary-foreground" : "border-
|
|
621
|
+
${filled ? "bg-primary border-primary text-primary-foreground" : "border-(--border-strong) bg-transparent hover:border-primary/50"}
|
|
612
622
|
${disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"}
|
|
613
623
|
${className}
|
|
614
624
|
`,
|
|
@@ -725,7 +735,8 @@ function Combobox({
|
|
|
725
735
|
{
|
|
726
736
|
type: "button",
|
|
727
737
|
onClick: clearValue,
|
|
728
|
-
|
|
738
|
+
"aria-label": "Clear",
|
|
739
|
+
className: "absolute right-8 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors p-1 outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
729
740
|
children: /* @__PURE__ */ jsx(X, { size: 14 })
|
|
730
741
|
}
|
|
731
742
|
),
|
|
@@ -735,7 +746,8 @@ function Combobox({
|
|
|
735
746
|
type: "button",
|
|
736
747
|
onClick: () => !disabled && setIsOpen(!isOpen),
|
|
737
748
|
disabled,
|
|
738
|
-
|
|
749
|
+
"aria-label": "Toggle options",
|
|
750
|
+
className: "absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors p-1 disabled:opacity-50 outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
739
751
|
children: /* @__PURE__ */ jsx(ChevronDown, { size: 14, className: isOpen ? "rotate-180 transition-transform" : "" })
|
|
740
752
|
}
|
|
741
753
|
)
|
|
@@ -753,6 +765,7 @@ function Combobox({
|
|
|
753
765
|
w-full px-3 py-2 text-left text-sm
|
|
754
766
|
flex items-center gap-2
|
|
755
767
|
hover:bg-(--bg-hover) transition-colors
|
|
768
|
+
outline-none focus-visible:ring-2 focus-visible:ring-ring
|
|
756
769
|
${isSelected ? "bg-primary/10 text-primary" : ""}
|
|
757
770
|
`,
|
|
758
771
|
children: [
|
|
@@ -779,7 +792,7 @@ function Combobox({
|
|
|
779
792
|
{
|
|
780
793
|
type: "button",
|
|
781
794
|
onClick: () => handleSelect(inputValue),
|
|
782
|
-
className: "\n w-full px-3 py-2 text-left text-sm\n flex items-center gap-2\n text-primary hover:bg-muted/50\n transition-colors\n ",
|
|
795
|
+
className: "\n w-full px-3 py-2 text-left text-sm\n flex items-center gap-2\n text-primary hover:bg-muted/50\n transition-colors\n outline-none focus-visible:ring-2 focus-visible:ring-ring\n ",
|
|
783
796
|
children: [
|
|
784
797
|
/* @__PURE__ */ jsx("span", { className: "text-lg", children: creatableIcon ?? "+" }),
|
|
785
798
|
/* @__PURE__ */ jsx("span", { children: resolvedCreatableText.replace("{value}", inputValue) })
|
|
@@ -853,7 +866,7 @@ var RadioGroupItem = React7.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
853
866
|
ref,
|
|
854
867
|
className: cn(
|
|
855
868
|
"h-4 w-4 shrink-0 rounded-full border-2 flex items-center justify-center",
|
|
856
|
-
"border-
|
|
869
|
+
"border-(--border-strong) bg-transparent",
|
|
857
870
|
"transition-all duration-200 ease-in-out",
|
|
858
871
|
"hover:border-primary/50",
|
|
859
872
|
"data-[state=checked]:border-primary",
|
|
@@ -1180,8 +1193,6 @@ var BreadcrumbPage = React7.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
1180
1193
|
"span",
|
|
1181
1194
|
{
|
|
1182
1195
|
ref,
|
|
1183
|
-
role: "link",
|
|
1184
|
-
"aria-disabled": "true",
|
|
1185
1196
|
"aria-current": "page",
|
|
1186
1197
|
className: cn("font-medium text-foreground", className),
|
|
1187
1198
|
...props
|
|
@@ -1388,13 +1399,13 @@ var Input = React7.forwardRef(
|
|
|
1388
1399
|
"focus:border-ring focus:ring-2 focus:ring-ring/20",
|
|
1389
1400
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1390
1401
|
icon && "pl-10",
|
|
1391
|
-
error ? "border-
|
|
1402
|
+
error ? "border-(--error) focus:border-(--error)" : "border-border",
|
|
1392
1403
|
className
|
|
1393
1404
|
),
|
|
1394
1405
|
...props
|
|
1395
1406
|
}
|
|
1396
1407
|
),
|
|
1397
|
-
error && /* @__PURE__ */ jsxs("p", { id: errorId, className: "mt-1.5 text-xs text-
|
|
1408
|
+
error && /* @__PURE__ */ jsxs("p", { id: errorId, className: "mt-1.5 text-xs text-error flex items-center gap-1", children: [
|
|
1398
1409
|
/* @__PURE__ */ jsx(AlertCircle, { "aria-hidden": "true", className: "w-3 h-3" }),
|
|
1399
1410
|
error
|
|
1400
1411
|
] })
|
|
@@ -1421,13 +1432,13 @@ var Textarea = React7.forwardRef(
|
|
|
1421
1432
|
"placeholder:text-muted-foreground",
|
|
1422
1433
|
"focus:border-ring focus:ring-2 focus:ring-ring/20",
|
|
1423
1434
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1424
|
-
error ? "border-
|
|
1435
|
+
error ? "border-(--error) focus:border-(--error)" : "border-border",
|
|
1425
1436
|
className
|
|
1426
1437
|
),
|
|
1427
1438
|
...props
|
|
1428
1439
|
}
|
|
1429
1440
|
),
|
|
1430
|
-
error && /* @__PURE__ */ jsxs("p", { id: errorId, className: "mt-1.5 text-xs text-
|
|
1441
|
+
error && /* @__PURE__ */ jsxs("p", { id: errorId, className: "mt-1.5 text-xs text-error flex items-center gap-1", children: [
|
|
1431
1442
|
/* @__PURE__ */ jsx(AlertCircle, { "aria-hidden": "true", className: "w-3 h-3" }),
|
|
1432
1443
|
error
|
|
1433
1444
|
] })
|
|
@@ -1449,7 +1460,7 @@ var PasswordInput = React7.forwardRef(
|
|
|
1449
1460
|
className: cn(
|
|
1450
1461
|
"flex items-center h-10 rounded-xl border bg-background transition-colors",
|
|
1451
1462
|
"focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/20",
|
|
1452
|
-
error ? "border-
|
|
1463
|
+
error ? "border-(--error) focus:border-(--error)" : "border-border",
|
|
1453
1464
|
disabled && "opacity-50",
|
|
1454
1465
|
className
|
|
1455
1466
|
),
|
|
@@ -1483,7 +1494,7 @@ var PasswordInput = React7.forwardRef(
|
|
|
1483
1494
|
]
|
|
1484
1495
|
}
|
|
1485
1496
|
),
|
|
1486
|
-
error && /* @__PURE__ */ jsxs("p", { id: errorId, className: "mt-1.5 text-xs text-
|
|
1497
|
+
error && /* @__PURE__ */ jsxs("p", { id: errorId, className: "mt-1.5 text-xs text-error flex items-center gap-1", children: [
|
|
1487
1498
|
/* @__PURE__ */ jsx(AlertCircle, { "aria-hidden": "true", className: "w-3 h-3" }),
|
|
1488
1499
|
error
|
|
1489
1500
|
] })
|
|
@@ -1509,7 +1520,7 @@ var NumberInput = React7.forwardRef(
|
|
|
1509
1520
|
{
|
|
1510
1521
|
className: cn(
|
|
1511
1522
|
"relative flex items-stretch rounded-xl border bg-background transition-colors focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/20",
|
|
1512
|
-
error ? "border-
|
|
1523
|
+
error ? "border-(--error) focus:border-(--error)" : "border-border",
|
|
1513
1524
|
disabled && "opacity-50",
|
|
1514
1525
|
className
|
|
1515
1526
|
),
|
|
@@ -1558,7 +1569,7 @@ var NumberInput = React7.forwardRef(
|
|
|
1558
1569
|
]
|
|
1559
1570
|
}
|
|
1560
1571
|
),
|
|
1561
|
-
error && /* @__PURE__ */ jsxs("p", { id: errorId, className: "mt-1.5 text-xs text-
|
|
1572
|
+
error && /* @__PURE__ */ jsxs("p", { id: errorId, className: "mt-1.5 text-xs text-error flex items-center gap-1", children: [
|
|
1562
1573
|
/* @__PURE__ */ jsx(AlertCircle, { "aria-hidden": "true", className: "w-3 h-3" }),
|
|
1563
1574
|
error
|
|
1564
1575
|
] })
|
|
@@ -1666,10 +1677,10 @@ Card.displayName = "Card";
|
|
|
1666
1677
|
function Badge({ className, variant = "default", ...props }) {
|
|
1667
1678
|
const variants = {
|
|
1668
1679
|
default: "bg-muted text-foreground/80",
|
|
1669
|
-
success: "bg-
|
|
1670
|
-
warning: "bg-
|
|
1671
|
-
error: "bg-
|
|
1672
|
-
info: "bg-
|
|
1680
|
+
success: "bg-success-soft text-success",
|
|
1681
|
+
warning: "bg-warning-soft text-warning",
|
|
1682
|
+
error: "bg-error-soft text-error",
|
|
1683
|
+
info: "bg-info-soft text-info"
|
|
1673
1684
|
};
|
|
1674
1685
|
return /* @__PURE__ */ jsx(
|
|
1675
1686
|
"span",
|
|
@@ -1705,10 +1716,10 @@ function Separator2({
|
|
|
1705
1716
|
}
|
|
1706
1717
|
function Alert({ className, variant = "info", title, icon, children, ...props }) {
|
|
1707
1718
|
const styles = {
|
|
1708
|
-
info: "bg-
|
|
1709
|
-
success: "bg-
|
|
1710
|
-
warning: "bg-
|
|
1711
|
-
error: "bg-
|
|
1719
|
+
info: "bg-info-soft text-info border-info-soft",
|
|
1720
|
+
success: "bg-success-soft text-success border-success-soft",
|
|
1721
|
+
warning: "bg-warning-soft text-warning border-warning-soft",
|
|
1722
|
+
error: "bg-error-soft text-error border-error-soft"
|
|
1712
1723
|
};
|
|
1713
1724
|
const defaultIcon = {
|
|
1714
1725
|
info: /* @__PURE__ */ jsx(Info, { className: "h-4 w-4" }),
|
|
@@ -1717,10 +1728,11 @@ function Alert({ className, variant = "info", title, icon, children, ...props })
|
|
|
1717
1728
|
error: /* @__PURE__ */ jsx(AlertCircle, { className: "h-4 w-4" })
|
|
1718
1729
|
};
|
|
1719
1730
|
const resolvedIcon = icon === void 0 ? defaultIcon[variant] : icon;
|
|
1731
|
+
const role = variant === "error" || variant === "warning" ? "alert" : "status";
|
|
1720
1732
|
return /* @__PURE__ */ jsxs(
|
|
1721
1733
|
"div",
|
|
1722
1734
|
{
|
|
1723
|
-
role
|
|
1735
|
+
role,
|
|
1724
1736
|
className: cn("flex gap-3 rounded-xl border p-3 text-sm", styles[variant], className),
|
|
1725
1737
|
...props,
|
|
1726
1738
|
children: [
|
|
@@ -1766,10 +1778,10 @@ function StatusIndicator({
|
|
|
1766
1778
|
...props
|
|
1767
1779
|
}) {
|
|
1768
1780
|
const color = {
|
|
1769
|
-
online: "bg-
|
|
1781
|
+
online: "bg-(--success)",
|
|
1770
1782
|
offline: "bg-zinc-400",
|
|
1771
|
-
busy: "bg-
|
|
1772
|
-
away: "bg-
|
|
1783
|
+
busy: "bg-(--error)",
|
|
1784
|
+
away: "bg-(--warning)",
|
|
1773
1785
|
neutral: "bg-muted-foreground"
|
|
1774
1786
|
}[status];
|
|
1775
1787
|
return /* @__PURE__ */ jsxs("span", { className: cn("inline-flex items-center gap-1.5 text-sm", className), ...props, children: [
|
|
@@ -1786,6 +1798,21 @@ function StatusIndicator({
|
|
|
1786
1798
|
children
|
|
1787
1799
|
] });
|
|
1788
1800
|
}
|
|
1801
|
+
var inlineStatusConfig = {
|
|
1802
|
+
pending: { icon: Loader2, className: "text-warning" },
|
|
1803
|
+
processing: { icon: Loader2, className: "text-warning" },
|
|
1804
|
+
completed: { icon: CheckCircle2, className: "text-success" },
|
|
1805
|
+
failed: { icon: AlertCircle, className: "text-error" }
|
|
1806
|
+
};
|
|
1807
|
+
function InlineStatus({ status, label, progress, size = 12, className }) {
|
|
1808
|
+
const config = inlineStatusConfig[status];
|
|
1809
|
+
const Icon2 = config.icon;
|
|
1810
|
+
const isProcessing = status === "processing" || status === "pending";
|
|
1811
|
+
return /* @__PURE__ */ jsxs("span", { className: cn("inline-flex items-center gap-1", config.className, className), children: [
|
|
1812
|
+
/* @__PURE__ */ jsx(Icon2, { size, className: cn(isProcessing && "animate-spin") }),
|
|
1813
|
+
/* @__PURE__ */ jsx("span", { children: isProcessing && progress !== void 0 && progress > 0 ? `${progress}%` : label })
|
|
1814
|
+
] });
|
|
1815
|
+
}
|
|
1789
1816
|
function InlineCode({ className, ...props }) {
|
|
1790
1817
|
return /* @__PURE__ */ jsx(
|
|
1791
1818
|
"code",
|
|
@@ -1880,7 +1907,7 @@ var DialogContent = React7.forwardRef(({ className, children, ...props }, ref) =
|
|
|
1880
1907
|
...props,
|
|
1881
1908
|
children: [
|
|
1882
1909
|
children,
|
|
1883
|
-
/* @__PURE__ */ jsx(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-lg p-1.5 text-muted-foreground hover:text-foreground hover:bg-muted transition-colors", children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }) })
|
|
1910
|
+
/* @__PURE__ */ jsx(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-lg p-1.5 text-muted-foreground hover:text-foreground hover:bg-muted transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring", children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }) })
|
|
1884
1911
|
]
|
|
1885
1912
|
}
|
|
1886
1913
|
)
|
|
@@ -1964,7 +1991,7 @@ var SelectItem = React7.forwardRef(({ className, children, ...props }, ref) => /
|
|
|
1964
1991
|
{
|
|
1965
1992
|
ref,
|
|
1966
1993
|
className: cn(
|
|
1967
|
-
"relative flex w-full cursor-pointer select-none items-center rounded-lg py-2
|
|
1994
|
+
"relative flex w-full cursor-pointer select-none items-center rounded-lg py-2 pl-8 pr-3 text-sm outline-none",
|
|
1968
1995
|
"focus:bg-muted data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
1969
1996
|
className
|
|
1970
1997
|
),
|
|
@@ -2226,7 +2253,7 @@ var DropdownMenuSubTrigger = React7.forwardRef(({ className, inset, children, ..
|
|
|
2226
2253
|
{
|
|
2227
2254
|
ref,
|
|
2228
2255
|
className: cn(
|
|
2229
|
-
"flex cursor-default select-none items-center rounded-
|
|
2256
|
+
"flex cursor-default select-none items-center rounded-md px-2 py-1.5 text-sm outline-none focus:bg-muted focus:text-foreground data-[state=open]:bg-muted",
|
|
2230
2257
|
inset && "pl-8",
|
|
2231
2258
|
className
|
|
2232
2259
|
),
|
|
@@ -2243,7 +2270,7 @@ var DropdownMenuSubContent = React7.forwardRef(({ className, ...props }, ref) =>
|
|
|
2243
2270
|
{
|
|
2244
2271
|
ref,
|
|
2245
2272
|
className: cn(
|
|
2246
|
-
"z-50 min-w-32 overflow-hidden rounded-
|
|
2273
|
+
"z-50 min-w-32 overflow-hidden rounded-xl border border-border bg-popover/90 backdrop-blur-xl p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
2247
2274
|
className
|
|
2248
2275
|
),
|
|
2249
2276
|
...props
|
|
@@ -2269,7 +2296,7 @@ var DropdownMenuItem = React7.forwardRef(({ className, inset, ...props }, ref) =
|
|
|
2269
2296
|
{
|
|
2270
2297
|
ref,
|
|
2271
2298
|
className: cn(
|
|
2272
|
-
"relative flex cursor-default select-none items-center rounded-
|
|
2299
|
+
"relative flex cursor-default select-none items-center rounded-md px-2 py-1.5 text-sm outline-none transition-colors focus:bg-muted focus:text-foreground data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
2273
2300
|
inset && "pl-8",
|
|
2274
2301
|
className
|
|
2275
2302
|
),
|
|
@@ -2283,7 +2310,7 @@ var DropdownMenuCheckboxItem = React7.forwardRef(({ className, children, checked
|
|
|
2283
2310
|
{
|
|
2284
2311
|
ref,
|
|
2285
2312
|
className: cn(
|
|
2286
|
-
"relative flex cursor-default select-none items-center rounded-
|
|
2313
|
+
"relative flex cursor-default select-none items-center rounded-md py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-muted focus:text-foreground data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
2287
2314
|
className
|
|
2288
2315
|
),
|
|
2289
2316
|
checked,
|
|
@@ -2300,7 +2327,7 @@ var DropdownMenuRadioItem = React7.forwardRef(({ className, children, ...props }
|
|
|
2300
2327
|
{
|
|
2301
2328
|
ref,
|
|
2302
2329
|
className: cn(
|
|
2303
|
-
"relative flex cursor-default select-none items-center rounded-
|
|
2330
|
+
"relative flex cursor-default select-none items-center rounded-md py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-muted focus:text-foreground data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
2304
2331
|
className
|
|
2305
2332
|
),
|
|
2306
2333
|
...props,
|
|
@@ -2587,8 +2614,8 @@ function SegmentedSelect({
|
|
|
2587
2614
|
"aria-pressed": value === opt.value,
|
|
2588
2615
|
title: opt.desc,
|
|
2589
2616
|
className: cn(
|
|
2590
|
-
"inline-flex items-center justify-center gap-2 px-3 py-1.5 text-xs font-medium border rounded-lg whitespace-nowrap transition-all duration-150 ease cursor-pointer outline-none",
|
|
2591
|
-
value === opt.value ? "text-foreground border-border-strong bg-accent-subtle hover:bg-accent-muted hover:shadow-xs" : "text-muted-foreground border-border-default bg-muted/50 hover:text-foreground hover:border-border-strong hover:bg-muted",
|
|
2617
|
+
"inline-flex items-center justify-center gap-2 px-3 py-1.5 text-xs font-medium border rounded-lg whitespace-nowrap transition-all duration-150 ease cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background",
|
|
2618
|
+
value === opt.value ? "text-foreground border-(--border-strong) bg-accent-subtle hover:bg-accent-muted hover:shadow-xs" : "text-muted-foreground border-(--border-default) bg-muted/50 hover:text-foreground hover:border-(--border-strong) hover:bg-muted",
|
|
2592
2619
|
disabled && "opacity-50 cursor-not-allowed pointer-events-none"
|
|
2593
2620
|
),
|
|
2594
2621
|
children: [
|
|
@@ -2629,7 +2656,7 @@ function ShinyButton({
|
|
|
2629
2656
|
"div",
|
|
2630
2657
|
{
|
|
2631
2658
|
className: cn(
|
|
2632
|
-
"group relative flex items-center justify-center gap-2 overflow-hidden rounded-xl bg-(--text-primary) px-8 py-3 font-semibold text-background transition-all hover:ring-2 hover:ring-(--
|
|
2659
|
+
"group relative flex items-center justify-center gap-2 overflow-hidden rounded-xl bg-(--text-primary) px-8 py-3 font-semibold text-background transition-all hover:ring-2 hover:ring-(--accent) hover:ring-offset-2 hover:ring-offset-background",
|
|
2633
2660
|
className
|
|
2634
2661
|
),
|
|
2635
2662
|
children: [
|
|
@@ -2641,10 +2668,11 @@ function ShinyButton({
|
|
|
2641
2668
|
]
|
|
2642
2669
|
}
|
|
2643
2670
|
);
|
|
2671
|
+
const focusCls = "rounded-xl outline-none focus-visible:ring-2 focus-visible:ring-(--accent) focus-visible:ring-offset-2 focus-visible:ring-offset-background";
|
|
2644
2672
|
if (href) {
|
|
2645
|
-
return /* @__PURE__ */ jsx(Link, { href, onClick, children: ButtonContent });
|
|
2673
|
+
return /* @__PURE__ */ jsx(Link, { href, onClick, className: focusCls, children: ButtonContent });
|
|
2646
2674
|
}
|
|
2647
|
-
return /* @__PURE__ */ jsx("button", { onClick, children: ButtonContent });
|
|
2675
|
+
return /* @__PURE__ */ jsx("button", { type: "button", onClick, className: focusCls, children: ButtonContent });
|
|
2648
2676
|
}
|
|
2649
2677
|
function Marquee({
|
|
2650
2678
|
className,
|
|
@@ -2716,7 +2744,7 @@ var BentoCard = ({
|
|
|
2716
2744
|
header,
|
|
2717
2745
|
/* @__PURE__ */ jsxs("div", { className: "group-hover/bento:translate-x-2 transition duration-200", children: [
|
|
2718
2746
|
/* @__PURE__ */ jsx("div", { className: "mb-2 text-[var(--text-primary)]", children: icon }),
|
|
2719
|
-
/* @__PURE__ */ jsx("div", { className: "font-
|
|
2747
|
+
/* @__PURE__ */ jsx("div", { className: "font-semibold text-[var(--text-primary)] text-lg mb-2 mt-2", children: title }),
|
|
2720
2748
|
/* @__PURE__ */ jsx("div", { className: "font-normal text-[var(--text-secondary)] text-sm leading-relaxed", children: description })
|
|
2721
2749
|
] })
|
|
2722
2750
|
]
|
|
@@ -2755,7 +2783,7 @@ var PopoverContent = React7.forwardRef(({ className, align = "center", sideOffse
|
|
|
2755
2783
|
sideOffset,
|
|
2756
2784
|
side: "bottom",
|
|
2757
2785
|
className: cn(
|
|
2758
|
-
"z-50 origin-(--radix-popover-content-transform-origin) overflow-y-auto max-h-(--radix-popover-content-available-height) min-w-[240px] max-w-[98vw] rounded-xl border bg-
|
|
2786
|
+
"z-50 origin-(--radix-popover-content-transform-origin) overflow-y-auto max-h-(--radix-popover-content-available-height) min-w-[240px] max-w-[98vw] rounded-xl border border-border bg-popover/95 backdrop-blur-lg p-2 text-sm text-popover-foreground shadow-lg focus-visible:outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
2759
2787
|
className
|
|
2760
2788
|
),
|
|
2761
2789
|
...props
|
|
@@ -2778,27 +2806,27 @@ var sizeClasses = {
|
|
|
2778
2806
|
var variantClasses = {
|
|
2779
2807
|
default: {
|
|
2780
2808
|
checkedTrack: "border-primary bg-primary/10",
|
|
2781
|
-
uncheckedTrack: "border-
|
|
2809
|
+
uncheckedTrack: "border-(--border-strong) bg-muted",
|
|
2782
2810
|
checkedThumb: "bg-primary",
|
|
2783
|
-
uncheckedThumb: "bg-
|
|
2811
|
+
uncheckedThumb: "bg-(--border-strong)"
|
|
2784
2812
|
},
|
|
2785
2813
|
success: {
|
|
2786
|
-
checkedTrack: "border-
|
|
2787
|
-
uncheckedTrack: "border-
|
|
2788
|
-
checkedThumb: "bg-
|
|
2789
|
-
uncheckedThumb: "bg-
|
|
2814
|
+
checkedTrack: "border-(--success) bg-success-soft",
|
|
2815
|
+
uncheckedTrack: "border-(--border-strong) bg-muted",
|
|
2816
|
+
checkedThumb: "bg-(--success)",
|
|
2817
|
+
uncheckedThumb: "bg-(--border-strong)"
|
|
2790
2818
|
},
|
|
2791
2819
|
warning: {
|
|
2792
|
-
checkedTrack: "border-
|
|
2793
|
-
uncheckedTrack: "border-
|
|
2794
|
-
checkedThumb: "bg-
|
|
2795
|
-
uncheckedThumb: "bg-
|
|
2820
|
+
checkedTrack: "border-(--warning) bg-warning-soft",
|
|
2821
|
+
uncheckedTrack: "border-(--border-strong) bg-muted",
|
|
2822
|
+
checkedThumb: "bg-(--warning)",
|
|
2823
|
+
uncheckedThumb: "bg-(--border-strong)"
|
|
2796
2824
|
},
|
|
2797
2825
|
danger: {
|
|
2798
|
-
checkedTrack: "border-
|
|
2799
|
-
uncheckedTrack: "border-
|
|
2800
|
-
checkedThumb: "bg-
|
|
2801
|
-
uncheckedThumb: "bg-
|
|
2826
|
+
checkedTrack: "border-(--error) bg-error-soft",
|
|
2827
|
+
uncheckedTrack: "border-(--border-strong) bg-muted",
|
|
2828
|
+
checkedThumb: "bg-(--error)",
|
|
2829
|
+
uncheckedThumb: "bg-(--border-strong)"
|
|
2802
2830
|
}
|
|
2803
2831
|
};
|
|
2804
2832
|
var Switch = forwardRef(
|
|
@@ -2870,25 +2898,25 @@ var toast = {
|
|
|
2870
2898
|
success: (message, description) => {
|
|
2871
2899
|
toast$1.success(message, {
|
|
2872
2900
|
description,
|
|
2873
|
-
icon: /* @__PURE__ */ jsx(CheckCircle2, { className: "w-5 h-5 text-
|
|
2901
|
+
icon: /* @__PURE__ */ jsx(CheckCircle2, { className: "w-5 h-5 text-success" })
|
|
2874
2902
|
});
|
|
2875
2903
|
},
|
|
2876
2904
|
error: (message, description) => {
|
|
2877
2905
|
toast$1.error(message, {
|
|
2878
2906
|
description,
|
|
2879
|
-
icon: /* @__PURE__ */ jsx(AlertCircle, { className: "w-5 h-5 text-
|
|
2907
|
+
icon: /* @__PURE__ */ jsx(AlertCircle, { className: "w-5 h-5 text-error" })
|
|
2880
2908
|
});
|
|
2881
2909
|
},
|
|
2882
2910
|
info: (message, description) => {
|
|
2883
2911
|
toast$1.info(message, {
|
|
2884
2912
|
description,
|
|
2885
|
-
icon: /* @__PURE__ */ jsx(Info, { className: "w-5 h-5 text-
|
|
2913
|
+
icon: /* @__PURE__ */ jsx(Info, { className: "w-5 h-5 text-info" })
|
|
2886
2914
|
});
|
|
2887
2915
|
},
|
|
2888
2916
|
warning: (message, description) => {
|
|
2889
2917
|
toast$1.warning(message, {
|
|
2890
2918
|
description,
|
|
2891
|
-
icon: /* @__PURE__ */ jsx(AlertTriangle, { className: "w-5 h-5 text-
|
|
2919
|
+
icon: /* @__PURE__ */ jsx(AlertTriangle, { className: "w-5 h-5 text-warning" })
|
|
2892
2920
|
});
|
|
2893
2921
|
},
|
|
2894
2922
|
loading: (message) => {
|
|
@@ -2989,6 +3017,6 @@ function useYunUITheme(defaults = {}) {
|
|
|
2989
3017
|
return [theme, update];
|
|
2990
3018
|
}
|
|
2991
3019
|
|
|
2992
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AnimatedNumber, Avatar, AvatarFallback, AvatarGroup, AvatarImage, Badge, BentoCard, BentoGrid, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, Checkbox, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, Column, Combobox, ConfirmModal, CustomSelect, DeleteConfirmModal, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, Flex, Grid, IconButton, InlineCode, Input, Kbd, Label2 as Label, Marquee, Modal, MotionDiv, MotionSpan, NavTabs, NumberInput, PageLoader, Pagination, PasswordInput, Popover, PopoverClose2 as PopoverClose, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, RegenerateConfirmModal, Row, SearchInput, SegmentedSelect, Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue, Separator2 as Separator, Sheet, ShinyButton, Skeleton, Slider, Spinner, Stack, StatusIndicator, Steps, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, Textarea, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, YUNUI_PALETTES, applyTheme, fadeIn, readTheme, staggerContainer, staggerItem, toast, useBodyScrollLock, useEscapeKey, useFocusTrap, useModalBehavior, useYunUITheme };
|
|
2993
|
-
//# sourceMappingURL=chunk-
|
|
2994
|
-
//# sourceMappingURL=chunk-
|
|
3020
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AnimatedNumber, Avatar, AvatarFallback, AvatarGroup, AvatarImage, Badge, BentoCard, BentoGrid, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, Checkbox, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, Column, Combobox, ConfirmModal, CustomSelect, DeleteConfirmModal, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, Flex, Grid, IconButton, InlineCode, InlineStatus, Input, Kbd, Label2 as Label, Marquee, Modal, MotionDiv, MotionSpan, NavTabs, NumberInput, PageLoader, Pagination, PasswordInput, Popover, PopoverClose2 as PopoverClose, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, RegenerateConfirmModal, Row, SearchInput, SegmentedSelect, Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue, Separator2 as Separator, Sheet, ShinyButton, Skeleton, Slider, Spinner, Stack, StatusIndicator, Steps, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, Textarea, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, YUNUI_PALETTES, applyTheme, fadeIn, readTheme, staggerContainer, staggerItem, toast, useBodyScrollLock, useEscapeKey, useFocusTrap, useModalBehavior, useYunUITheme };
|
|
3021
|
+
//# sourceMappingURL=chunk-VXFEANVX.js.map
|
|
3022
|
+
//# sourceMappingURL=chunk-VXFEANVX.js.map
|