@yuhuanowo/yunui 0.2.13 → 0.2.15
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/README.md +17 -1
- package/README.zh-CN.md +17 -1
- package/README.zh-TW.md +17 -1
- package/dist/ai.d.ts +37 -1
- package/dist/ai.js +261 -125
- package/dist/ai.js.map +1 -1
- package/dist/{chunk-MTEICYIC.js → chunk-6MZN3GOP.js} +312 -209
- package/dist/chunk-6MZN3GOP.js.map +1 -0
- package/dist/chunk-LLNTUA5K.js +155 -0
- package/dist/chunk-LLNTUA5K.js.map +1 -0
- package/dist/index.d.ts +111 -6
- package/dist/index.js +2 -2
- package/dist/patterns.d.ts +236 -2
- package/dist/patterns.js +445 -28
- package/dist/patterns.js.map +1 -1
- package/package.json +1 -1
- package/styles/tokens.css +704 -352
- package/styles/yunui.css +224 -19
- package/dist/chunk-MTEICYIC.js.map +0 -1
- package/dist/chunk-TFZKMJGF.js +0 -85
- package/dist/chunk-TFZKMJGF.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { cn } from './chunk-
|
|
2
|
+
import { cn, useAnchoredPosition } from './chunk-LLNTUA5K.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
|
`,
|
|
@@ -636,8 +646,13 @@ function Combobox({
|
|
|
636
646
|
const resolvedCreatableText = creatableText || t("creatableText", { value: "" });
|
|
637
647
|
const [isOpen, setIsOpen] = useState(false);
|
|
638
648
|
const [inputValue, setInputValue] = useState(value || "");
|
|
649
|
+
const [highlighted, setHighlighted] = useState(-1);
|
|
639
650
|
const containerRef = useRef(null);
|
|
640
651
|
const inputRef = useRef(null);
|
|
652
|
+
const panelRef = useRef(null);
|
|
653
|
+
const { shift, maxHeight } = useAnchoredPosition(isOpen, panelRef);
|
|
654
|
+
const listboxId = useId();
|
|
655
|
+
const optionId = (i) => `${listboxId}-opt-${i}`;
|
|
641
656
|
useEffect(() => {
|
|
642
657
|
const selectedOption2 = options.find((o) => o.value === value);
|
|
643
658
|
setInputValue(selectedOption2?.label || value || "");
|
|
@@ -651,6 +666,9 @@ function Combobox({
|
|
|
651
666
|
document.addEventListener("mousedown", handleClickOutside);
|
|
652
667
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
653
668
|
}, []);
|
|
669
|
+
useEffect(() => {
|
|
670
|
+
setHighlighted(-1);
|
|
671
|
+
}, [inputValue, isOpen]);
|
|
654
672
|
const filteredOptions = inputValue ? options.filter(
|
|
655
673
|
(o) => o.label.toLowerCase().includes(inputValue.toLowerCase()) || o.value.toLowerCase().includes(inputValue.toLowerCase())
|
|
656
674
|
) : options;
|
|
@@ -666,16 +684,43 @@ function Combobox({
|
|
|
666
684
|
setIsOpen(true);
|
|
667
685
|
};
|
|
668
686
|
const handleKeyDown = (e) => {
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
687
|
+
switch (e.key) {
|
|
688
|
+
case "ArrowDown":
|
|
689
|
+
e.preventDefault();
|
|
690
|
+
if (!isOpen) return setIsOpen(true);
|
|
691
|
+
setHighlighted((h) => Math.min(h + 1, filteredOptions.length - 1));
|
|
692
|
+
break;
|
|
693
|
+
case "ArrowUp":
|
|
694
|
+
e.preventDefault();
|
|
695
|
+
if (!isOpen) return setIsOpen(true);
|
|
696
|
+
setHighlighted((h) => Math.max(h - 1, 0));
|
|
697
|
+
break;
|
|
698
|
+
case "Home":
|
|
699
|
+
if (isOpen) {
|
|
700
|
+
e.preventDefault();
|
|
701
|
+
setHighlighted(0);
|
|
702
|
+
}
|
|
703
|
+
break;
|
|
704
|
+
case "End":
|
|
705
|
+
if (isOpen) {
|
|
706
|
+
e.preventDefault();
|
|
707
|
+
setHighlighted(filteredOptions.length - 1);
|
|
708
|
+
}
|
|
709
|
+
break;
|
|
710
|
+
case "Enter":
|
|
711
|
+
e.preventDefault();
|
|
712
|
+
if (isOpen && highlighted >= 0 && filteredOptions[highlighted]) {
|
|
713
|
+
handleSelect(filteredOptions[highlighted].value);
|
|
714
|
+
} else if (canCreateNew) {
|
|
715
|
+
handleSelect(inputValue);
|
|
716
|
+
} else if (filteredOptions.length > 0) {
|
|
717
|
+
handleSelect(filteredOptions[0].value);
|
|
718
|
+
}
|
|
719
|
+
break;
|
|
720
|
+
case "Escape":
|
|
721
|
+
setIsOpen(false);
|
|
722
|
+
setInputValue(value || "");
|
|
723
|
+
break;
|
|
679
724
|
}
|
|
680
725
|
};
|
|
681
726
|
const clearValue = () => {
|
|
@@ -708,6 +753,12 @@ function Combobox({
|
|
|
708
753
|
onFocus: () => !disabled && setIsOpen(true),
|
|
709
754
|
onKeyDown: handleKeyDown,
|
|
710
755
|
placeholder: resolvedPlaceholder,
|
|
756
|
+
"aria-label": resolvedPlaceholder,
|
|
757
|
+
role: "combobox",
|
|
758
|
+
"aria-expanded": isOpen,
|
|
759
|
+
"aria-controls": listboxId,
|
|
760
|
+
"aria-autocomplete": "list",
|
|
761
|
+
"aria-activedescendant": isOpen && highlighted >= 0 ? optionId(highlighted) : void 0,
|
|
711
762
|
disabled,
|
|
712
763
|
className: `
|
|
713
764
|
w-full py-2
|
|
@@ -725,7 +776,8 @@ function Combobox({
|
|
|
725
776
|
{
|
|
726
777
|
type: "button",
|
|
727
778
|
onClick: clearValue,
|
|
728
|
-
|
|
779
|
+
"aria-label": "Clear",
|
|
780
|
+
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
781
|
children: /* @__PURE__ */ jsx(X, { size: 14 })
|
|
730
782
|
}
|
|
731
783
|
),
|
|
@@ -735,58 +787,67 @@ function Combobox({
|
|
|
735
787
|
type: "button",
|
|
736
788
|
onClick: () => !disabled && setIsOpen(!isOpen),
|
|
737
789
|
disabled,
|
|
738
|
-
|
|
790
|
+
"aria-label": "Toggle options",
|
|
791
|
+
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
792
|
children: /* @__PURE__ */ jsx(ChevronDown, { size: 14, className: isOpen ? "rotate-180 transition-transform" : "" })
|
|
740
793
|
}
|
|
741
794
|
)
|
|
742
795
|
] }),
|
|
743
|
-
isOpen && !disabled && /* @__PURE__ */ jsx(
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
className: "
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
796
|
+
isOpen && !disabled && /* @__PURE__ */ jsx(
|
|
797
|
+
"div",
|
|
798
|
+
{
|
|
799
|
+
ref: panelRef,
|
|
800
|
+
style: { marginLeft: shift, maxHeight },
|
|
801
|
+
className: "absolute z-50 w-full mt-2 p-1 rounded-2xl border border-border bg-background/60 backdrop-blur-2xl text-popover-foreground shadow-lg shadow-black/5 overflow-hidden flex flex-col animate-in fade-in-0 zoom-in-95 duration-200",
|
|
802
|
+
children: /* @__PURE__ */ jsx("div", { className: "flex-1 min-h-0 max-h-60 overflow-y-auto", role: "listbox", id: listboxId, children: filteredOptions.length === 0 && !canCreateNew ? /* @__PURE__ */ jsx("div", { className: "px-3 py-2 text-sm text-muted-foreground", children: t("noResults") }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
803
|
+
filteredOptions.map((option, i) => {
|
|
804
|
+
const isSelected = option.value === value;
|
|
805
|
+
const isHigh = i === highlighted;
|
|
806
|
+
const optionIconPath = option.iconUrl ?? null;
|
|
807
|
+
return /* @__PURE__ */ jsxs(
|
|
808
|
+
"button",
|
|
809
|
+
{
|
|
810
|
+
id: optionId(i),
|
|
811
|
+
type: "button",
|
|
812
|
+
role: "option",
|
|
813
|
+
"aria-selected": isSelected,
|
|
814
|
+
"data-highlighted": isHigh ? "" : void 0,
|
|
815
|
+
onClick: () => handleSelect(option.value),
|
|
816
|
+
onMouseEnter: () => setHighlighted(i),
|
|
817
|
+
className: `dropdown-item w-full text-left outline-none focus-visible:ring-2 focus-visible:ring-ring ${isSelected ? "active" : ""}`,
|
|
818
|
+
children: [
|
|
819
|
+
optionIconPath && /* @__PURE__ */ jsx("div", { className: "rounded-md overflow-hidden bg-linear-to-br from-black/2 to-black/5 shrink-0", style: { width: 16, height: 16 }, children: /* @__PURE__ */ jsx(
|
|
820
|
+
Image2,
|
|
821
|
+
{
|
|
822
|
+
src: optionIconPath,
|
|
823
|
+
alt: option.label,
|
|
824
|
+
width: 16,
|
|
825
|
+
height: 16,
|
|
826
|
+
className: "object-cover",
|
|
827
|
+
unoptimized: true
|
|
828
|
+
}
|
|
829
|
+
) }),
|
|
830
|
+
/* @__PURE__ */ jsx("span", { className: "flex-1 truncate", children: option.label })
|
|
831
|
+
]
|
|
832
|
+
},
|
|
833
|
+
option.value
|
|
834
|
+
);
|
|
835
|
+
}),
|
|
836
|
+
canCreateNew && /* @__PURE__ */ jsxs(
|
|
837
|
+
"button",
|
|
838
|
+
{
|
|
839
|
+
type: "button",
|
|
840
|
+
onClick: () => handleSelect(inputValue),
|
|
841
|
+
className: "dropdown-item w-full text-left text-primary outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
842
|
+
children: [
|
|
843
|
+
/* @__PURE__ */ jsx("span", { className: "text-lg leading-none", children: creatableIcon ?? "+" }),
|
|
844
|
+
/* @__PURE__ */ jsx("span", { className: "flex-1 truncate", children: resolvedCreatableText.replace("{value}", inputValue) })
|
|
845
|
+
]
|
|
846
|
+
}
|
|
847
|
+
)
|
|
848
|
+
] }) })
|
|
849
|
+
}
|
|
850
|
+
)
|
|
790
851
|
] });
|
|
791
852
|
}
|
|
792
853
|
var Accordion = AccordionPrimitive.Root;
|
|
@@ -853,7 +914,7 @@ var RadioGroupItem = React7.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
853
914
|
ref,
|
|
854
915
|
className: cn(
|
|
855
916
|
"h-4 w-4 shrink-0 rounded-full border-2 flex items-center justify-center",
|
|
856
|
-
"border-
|
|
917
|
+
"border-(--border-strong) bg-transparent",
|
|
857
918
|
"transition-all duration-200 ease-in-out",
|
|
858
919
|
"hover:border-primary/50",
|
|
859
920
|
"data-[state=checked]:border-primary",
|
|
@@ -1180,8 +1241,6 @@ var BreadcrumbPage = React7.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
1180
1241
|
"span",
|
|
1181
1242
|
{
|
|
1182
1243
|
ref,
|
|
1183
|
-
role: "link",
|
|
1184
|
-
"aria-disabled": "true",
|
|
1185
1244
|
"aria-current": "page",
|
|
1186
1245
|
className: cn("font-medium text-foreground", className),
|
|
1187
1246
|
...props
|
|
@@ -1388,13 +1447,13 @@ var Input = React7.forwardRef(
|
|
|
1388
1447
|
"focus:border-ring focus:ring-2 focus:ring-ring/20",
|
|
1389
1448
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1390
1449
|
icon && "pl-10",
|
|
1391
|
-
error ? "border-
|
|
1450
|
+
error ? "border-(--error) focus:border-(--error)" : "border-border",
|
|
1392
1451
|
className
|
|
1393
1452
|
),
|
|
1394
1453
|
...props
|
|
1395
1454
|
}
|
|
1396
1455
|
),
|
|
1397
|
-
error && /* @__PURE__ */ jsxs("p", { id: errorId, className: "mt-1.5 text-xs text-
|
|
1456
|
+
error && /* @__PURE__ */ jsxs("p", { id: errorId, className: "mt-1.5 text-xs text-error flex items-center gap-1", children: [
|
|
1398
1457
|
/* @__PURE__ */ jsx(AlertCircle, { "aria-hidden": "true", className: "w-3 h-3" }),
|
|
1399
1458
|
error
|
|
1400
1459
|
] })
|
|
@@ -1421,13 +1480,13 @@ var Textarea = React7.forwardRef(
|
|
|
1421
1480
|
"placeholder:text-muted-foreground",
|
|
1422
1481
|
"focus:border-ring focus:ring-2 focus:ring-ring/20",
|
|
1423
1482
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1424
|
-
error ? "border-
|
|
1483
|
+
error ? "border-(--error) focus:border-(--error)" : "border-border",
|
|
1425
1484
|
className
|
|
1426
1485
|
),
|
|
1427
1486
|
...props
|
|
1428
1487
|
}
|
|
1429
1488
|
),
|
|
1430
|
-
error && /* @__PURE__ */ jsxs("p", { id: errorId, className: "mt-1.5 text-xs text-
|
|
1489
|
+
error && /* @__PURE__ */ jsxs("p", { id: errorId, className: "mt-1.5 text-xs text-error flex items-center gap-1", children: [
|
|
1431
1490
|
/* @__PURE__ */ jsx(AlertCircle, { "aria-hidden": "true", className: "w-3 h-3" }),
|
|
1432
1491
|
error
|
|
1433
1492
|
] })
|
|
@@ -1449,7 +1508,7 @@ var PasswordInput = React7.forwardRef(
|
|
|
1449
1508
|
className: cn(
|
|
1450
1509
|
"flex items-center h-10 rounded-xl border bg-background transition-colors",
|
|
1451
1510
|
"focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/20",
|
|
1452
|
-
error ? "border-
|
|
1511
|
+
error ? "border-(--error) focus:border-(--error)" : "border-border",
|
|
1453
1512
|
disabled && "opacity-50",
|
|
1454
1513
|
className
|
|
1455
1514
|
),
|
|
@@ -1483,7 +1542,7 @@ var PasswordInput = React7.forwardRef(
|
|
|
1483
1542
|
]
|
|
1484
1543
|
}
|
|
1485
1544
|
),
|
|
1486
|
-
error && /* @__PURE__ */ jsxs("p", { id: errorId, className: "mt-1.5 text-xs text-
|
|
1545
|
+
error && /* @__PURE__ */ jsxs("p", { id: errorId, className: "mt-1.5 text-xs text-error flex items-center gap-1", children: [
|
|
1487
1546
|
/* @__PURE__ */ jsx(AlertCircle, { "aria-hidden": "true", className: "w-3 h-3" }),
|
|
1488
1547
|
error
|
|
1489
1548
|
] })
|
|
@@ -1509,7 +1568,7 @@ var NumberInput = React7.forwardRef(
|
|
|
1509
1568
|
{
|
|
1510
1569
|
className: cn(
|
|
1511
1570
|
"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-
|
|
1571
|
+
error ? "border-(--error) focus:border-(--error)" : "border-border",
|
|
1513
1572
|
disabled && "opacity-50",
|
|
1514
1573
|
className
|
|
1515
1574
|
),
|
|
@@ -1558,7 +1617,7 @@ var NumberInput = React7.forwardRef(
|
|
|
1558
1617
|
]
|
|
1559
1618
|
}
|
|
1560
1619
|
),
|
|
1561
|
-
error && /* @__PURE__ */ jsxs("p", { id: errorId, className: "mt-1.5 text-xs text-
|
|
1620
|
+
error && /* @__PURE__ */ jsxs("p", { id: errorId, className: "mt-1.5 text-xs text-error flex items-center gap-1", children: [
|
|
1562
1621
|
/* @__PURE__ */ jsx(AlertCircle, { "aria-hidden": "true", className: "w-3 h-3" }),
|
|
1563
1622
|
error
|
|
1564
1623
|
] })
|
|
@@ -1612,6 +1671,7 @@ var SearchInput = React7.forwardRef(
|
|
|
1612
1671
|
ref: setRef,
|
|
1613
1672
|
type: "text",
|
|
1614
1673
|
role: "searchbox",
|
|
1674
|
+
"aria-label": props.placeholder,
|
|
1615
1675
|
value,
|
|
1616
1676
|
onChange: (e) => onChange?.(e.target.value),
|
|
1617
1677
|
disabled,
|
|
@@ -1666,10 +1726,10 @@ Card.displayName = "Card";
|
|
|
1666
1726
|
function Badge({ className, variant = "default", ...props }) {
|
|
1667
1727
|
const variants = {
|
|
1668
1728
|
default: "bg-muted text-foreground/80",
|
|
1669
|
-
success: "bg-
|
|
1670
|
-
warning: "bg-
|
|
1671
|
-
error: "bg-
|
|
1672
|
-
info: "bg-
|
|
1729
|
+
success: "bg-success-soft text-success",
|
|
1730
|
+
warning: "bg-warning-soft text-warning",
|
|
1731
|
+
error: "bg-error-soft text-error",
|
|
1732
|
+
info: "bg-info-soft text-info"
|
|
1673
1733
|
};
|
|
1674
1734
|
return /* @__PURE__ */ jsx(
|
|
1675
1735
|
"span",
|
|
@@ -1705,10 +1765,10 @@ function Separator2({
|
|
|
1705
1765
|
}
|
|
1706
1766
|
function Alert({ className, variant = "info", title, icon, children, ...props }) {
|
|
1707
1767
|
const styles = {
|
|
1708
|
-
info: "bg-
|
|
1709
|
-
success: "bg-
|
|
1710
|
-
warning: "bg-
|
|
1711
|
-
error: "bg-
|
|
1768
|
+
info: "bg-info-soft text-info border-info-soft",
|
|
1769
|
+
success: "bg-success-soft text-success border-success-soft",
|
|
1770
|
+
warning: "bg-warning-soft text-warning border-warning-soft",
|
|
1771
|
+
error: "bg-error-soft text-error border-error-soft"
|
|
1712
1772
|
};
|
|
1713
1773
|
const defaultIcon = {
|
|
1714
1774
|
info: /* @__PURE__ */ jsx(Info, { className: "h-4 w-4" }),
|
|
@@ -1717,10 +1777,11 @@ function Alert({ className, variant = "info", title, icon, children, ...props })
|
|
|
1717
1777
|
error: /* @__PURE__ */ jsx(AlertCircle, { className: "h-4 w-4" })
|
|
1718
1778
|
};
|
|
1719
1779
|
const resolvedIcon = icon === void 0 ? defaultIcon[variant] : icon;
|
|
1780
|
+
const role = variant === "error" || variant === "warning" ? "alert" : "status";
|
|
1720
1781
|
return /* @__PURE__ */ jsxs(
|
|
1721
1782
|
"div",
|
|
1722
1783
|
{
|
|
1723
|
-
role
|
|
1784
|
+
role,
|
|
1724
1785
|
className: cn("flex gap-3 rounded-xl border p-3 text-sm", styles[variant], className),
|
|
1725
1786
|
...props,
|
|
1726
1787
|
children: [
|
|
@@ -1766,10 +1827,10 @@ function StatusIndicator({
|
|
|
1766
1827
|
...props
|
|
1767
1828
|
}) {
|
|
1768
1829
|
const color = {
|
|
1769
|
-
online: "bg-
|
|
1830
|
+
online: "bg-(--success)",
|
|
1770
1831
|
offline: "bg-zinc-400",
|
|
1771
|
-
busy: "bg-
|
|
1772
|
-
away: "bg-
|
|
1832
|
+
busy: "bg-(--error)",
|
|
1833
|
+
away: "bg-(--warning)",
|
|
1773
1834
|
neutral: "bg-muted-foreground"
|
|
1774
1835
|
}[status];
|
|
1775
1836
|
return /* @__PURE__ */ jsxs("span", { className: cn("inline-flex items-center gap-1.5 text-sm", className), ...props, children: [
|
|
@@ -1786,6 +1847,21 @@ function StatusIndicator({
|
|
|
1786
1847
|
children
|
|
1787
1848
|
] });
|
|
1788
1849
|
}
|
|
1850
|
+
var inlineStatusConfig = {
|
|
1851
|
+
pending: { icon: Loader2, className: "text-warning" },
|
|
1852
|
+
processing: { icon: Loader2, className: "text-warning" },
|
|
1853
|
+
completed: { icon: CheckCircle2, className: "text-success" },
|
|
1854
|
+
failed: { icon: AlertCircle, className: "text-error" }
|
|
1855
|
+
};
|
|
1856
|
+
function InlineStatus({ status, label, progress, size = 12, className }) {
|
|
1857
|
+
const config = inlineStatusConfig[status];
|
|
1858
|
+
const Icon2 = config.icon;
|
|
1859
|
+
const isProcessing = status === "processing" || status === "pending";
|
|
1860
|
+
return /* @__PURE__ */ jsxs("span", { className: cn("inline-flex items-center gap-1", config.className, className), children: [
|
|
1861
|
+
/* @__PURE__ */ jsx(Icon2, { size, className: cn(isProcessing && "animate-spin") }),
|
|
1862
|
+
/* @__PURE__ */ jsx("span", { children: isProcessing && progress !== void 0 && progress > 0 ? `${progress}%` : label })
|
|
1863
|
+
] });
|
|
1864
|
+
}
|
|
1789
1865
|
function InlineCode({ className, ...props }) {
|
|
1790
1866
|
return /* @__PURE__ */ jsx(
|
|
1791
1867
|
"code",
|
|
@@ -1880,7 +1956,7 @@ var DialogContent = React7.forwardRef(({ className, children, ...props }, ref) =
|
|
|
1880
1956
|
...props,
|
|
1881
1957
|
children: [
|
|
1882
1958
|
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" }) })
|
|
1959
|
+
/* @__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
1960
|
]
|
|
1885
1961
|
}
|
|
1886
1962
|
)
|
|
@@ -1938,7 +2014,7 @@ var SelectContent = React7.forwardRef(({ className, children, position = "popper
|
|
|
1938
2014
|
ref,
|
|
1939
2015
|
position,
|
|
1940
2016
|
className: cn(
|
|
1941
|
-
"relative z-50 min-w-32 overflow-hidden rounded-
|
|
2017
|
+
"relative z-50 min-w-32 overflow-hidden rounded-2xl border border-border bg-background/60 backdrop-blur-2xl text-popover-foreground shadow-lg shadow-black/5",
|
|
1942
2018
|
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
1943
2019
|
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
1944
2020
|
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
@@ -1959,20 +2035,18 @@ var SelectContent = React7.forwardRef(({ className, children, position = "popper
|
|
|
1959
2035
|
}
|
|
1960
2036
|
) }));
|
|
1961
2037
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
1962
|
-
var SelectItem = React7.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
2038
|
+
var SelectItem = React7.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1963
2039
|
SelectPrimitive.Item,
|
|
1964
2040
|
{
|
|
1965
2041
|
ref,
|
|
1966
2042
|
className: cn(
|
|
1967
|
-
|
|
1968
|
-
|
|
2043
|
+
// Shares the LanguageSwitcher row look: the left accent bar (via
|
|
2044
|
+
// data-state=checked) marks the selection — no separate checkmark.
|
|
2045
|
+
"dropdown-item w-full cursor-pointer select-none outline-none data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
1969
2046
|
className
|
|
1970
2047
|
),
|
|
1971
2048
|
...props,
|
|
1972
|
-
children:
|
|
1973
|
-
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) }) }),
|
|
1974
|
-
/* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
|
|
1975
|
-
]
|
|
2049
|
+
children: /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
|
|
1976
2050
|
}
|
|
1977
2051
|
));
|
|
1978
2052
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
@@ -2016,7 +2090,7 @@ var TabsList = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
2016
2090
|
{
|
|
2017
2091
|
ref,
|
|
2018
2092
|
className: cn(
|
|
2019
|
-
"inline-flex h-11 items-center justify-center rounded-xl bg-muted p-1 flex-nowrap overflow-x-auto",
|
|
2093
|
+
"inline-flex h-11 items-center justify-center rounded-xl bg-muted p-1 flex-nowrap overflow-x-auto overflow-y-hidden overscroll-x-contain",
|
|
2020
2094
|
className
|
|
2021
2095
|
),
|
|
2022
2096
|
...props
|
|
@@ -2226,7 +2300,7 @@ var DropdownMenuSubTrigger = React7.forwardRef(({ className, inset, children, ..
|
|
|
2226
2300
|
{
|
|
2227
2301
|
ref,
|
|
2228
2302
|
className: cn(
|
|
2229
|
-
"flex cursor-default select-none items-center rounded-
|
|
2303
|
+
"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
2304
|
inset && "pl-8",
|
|
2231
2305
|
className
|
|
2232
2306
|
),
|
|
@@ -2243,7 +2317,7 @@ var DropdownMenuSubContent = React7.forwardRef(({ className, ...props }, ref) =>
|
|
|
2243
2317
|
{
|
|
2244
2318
|
ref,
|
|
2245
2319
|
className: cn(
|
|
2246
|
-
"z-50 min-w-32 overflow-hidden rounded-
|
|
2320
|
+
"z-50 min-w-32 overflow-hidden rounded-2xl border border-border bg-background/60 backdrop-blur-2xl p-1 text-popover-foreground shadow-lg shadow-black/5 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
2321
|
className
|
|
2248
2322
|
),
|
|
2249
2323
|
...props
|
|
@@ -2256,7 +2330,7 @@ var DropdownMenuContent = React7.forwardRef(({ className, sideOffset = 4, ...pro
|
|
|
2256
2330
|
ref,
|
|
2257
2331
|
sideOffset,
|
|
2258
2332
|
className: cn(
|
|
2259
|
-
"z-50 min-w-32 overflow-hidden rounded-
|
|
2333
|
+
"z-50 min-w-32 overflow-hidden rounded-2xl border border-border bg-background/60 backdrop-blur-2xl p-1 text-popover-foreground shadow-lg shadow-black/5",
|
|
2260
2334
|
"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",
|
|
2261
2335
|
className
|
|
2262
2336
|
),
|
|
@@ -2269,7 +2343,7 @@ var DropdownMenuItem = React7.forwardRef(({ className, inset, ...props }, ref) =
|
|
|
2269
2343
|
{
|
|
2270
2344
|
ref,
|
|
2271
2345
|
className: cn(
|
|
2272
|
-
"relative flex cursor-default select-none items-center rounded-
|
|
2346
|
+
"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
2347
|
inset && "pl-8",
|
|
2274
2348
|
className
|
|
2275
2349
|
),
|
|
@@ -2283,7 +2357,7 @@ var DropdownMenuCheckboxItem = React7.forwardRef(({ className, children, checked
|
|
|
2283
2357
|
{
|
|
2284
2358
|
ref,
|
|
2285
2359
|
className: cn(
|
|
2286
|
-
"relative flex cursor-default select-none items-center rounded-
|
|
2360
|
+
"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
2361
|
className
|
|
2288
2362
|
),
|
|
2289
2363
|
checked,
|
|
@@ -2300,7 +2374,7 @@ var DropdownMenuRadioItem = React7.forwardRef(({ className, children, ...props }
|
|
|
2300
2374
|
{
|
|
2301
2375
|
ref,
|
|
2302
2376
|
className: cn(
|
|
2303
|
-
"relative flex cursor-default select-none items-center rounded-
|
|
2377
|
+
"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
2378
|
className
|
|
2305
2379
|
),
|
|
2306
2380
|
...props,
|
|
@@ -2364,6 +2438,8 @@ function CustomSelect({
|
|
|
2364
2438
|
const inputRef = useRef(null);
|
|
2365
2439
|
const triggerRef = useRef(null);
|
|
2366
2440
|
const listRef = useRef(null);
|
|
2441
|
+
const panelRef = useRef(null);
|
|
2442
|
+
const { shift, maxHeight } = useAnchoredPosition(isOpen, panelRef);
|
|
2367
2443
|
const baseId = useId();
|
|
2368
2444
|
const listboxId = `${baseId}-listbox`;
|
|
2369
2445
|
const optionId = (i) => `${baseId}-opt-${i}`;
|
|
@@ -2382,7 +2458,9 @@ function CustomSelect({
|
|
|
2382
2458
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
2383
2459
|
}, []);
|
|
2384
2460
|
useEffect(() => {
|
|
2385
|
-
if (isOpen
|
|
2461
|
+
if (!isOpen) return;
|
|
2462
|
+
if (searchable && inputRef.current) inputRef.current.focus();
|
|
2463
|
+
else triggerRef.current?.focus();
|
|
2386
2464
|
}, [isOpen, searchable]);
|
|
2387
2465
|
useEffect(() => {
|
|
2388
2466
|
if (isOpen) {
|
|
@@ -2497,76 +2575,81 @@ function CustomSelect({
|
|
|
2497
2575
|
]
|
|
2498
2576
|
}
|
|
2499
2577
|
),
|
|
2500
|
-
isOpen && /* @__PURE__ */ jsxs(
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
children: /* @__PURE__ */ jsx(X, { size: 12 })
|
|
2528
|
-
}
|
|
2529
|
-
)
|
|
2530
|
-
] }) }),
|
|
2531
|
-
/* @__PURE__ */ jsx(
|
|
2532
|
-
"div",
|
|
2533
|
-
{
|
|
2534
|
-
ref: listRef,
|
|
2535
|
-
role: "listbox",
|
|
2536
|
-
id: listboxId,
|
|
2537
|
-
className: "max-h-52 overflow-y-auto overscroll-contain",
|
|
2538
|
-
children: filteredOptions.length === 0 ? /* @__PURE__ */ jsx("div", { className: "px-3 py-2 text-sm text-muted-foreground text-center whitespace-nowrap", children: t("noOptions") }) : filteredOptions.map((option, i) => {
|
|
2539
|
-
const isSelected = option.value === value;
|
|
2540
|
-
const isHigh = i === highlighted;
|
|
2541
|
-
return /* @__PURE__ */ jsxs(
|
|
2578
|
+
isOpen && /* @__PURE__ */ jsxs(
|
|
2579
|
+
"div",
|
|
2580
|
+
{
|
|
2581
|
+
ref: panelRef,
|
|
2582
|
+
style: { marginLeft: shift, maxHeight },
|
|
2583
|
+
className: "\n absolute z-50 w-full mt-2\n rounded-2xl border border-border\n bg-background/60 backdrop-blur-2xl text-popover-foreground\n shadow-lg shadow-black/5\n max-h-64 overflow-hidden flex flex-col\n animate-in fade-in-0 zoom-in-95 duration-200\n ",
|
|
2584
|
+
children: [
|
|
2585
|
+
searchable && /* @__PURE__ */ jsx("div", { className: "px-2.5 pb-2 pt-1.5 border-b border-(--border-subtle)", children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
2586
|
+
/* @__PURE__ */ jsx(Search, { size: 14, className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none" }),
|
|
2587
|
+
/* @__PURE__ */ jsx(
|
|
2588
|
+
"input",
|
|
2589
|
+
{
|
|
2590
|
+
ref: inputRef,
|
|
2591
|
+
type: "text",
|
|
2592
|
+
role: "combobox",
|
|
2593
|
+
"aria-expanded": isOpen,
|
|
2594
|
+
"aria-controls": listboxId,
|
|
2595
|
+
"aria-activedescendant": highlighted >= 0 ? optionId(highlighted) : void 0,
|
|
2596
|
+
"aria-autocomplete": "list",
|
|
2597
|
+
value: searchQuery,
|
|
2598
|
+
onChange: (e) => setSearchQuery(e.target.value),
|
|
2599
|
+
placeholder: t("search"),
|
|
2600
|
+
"aria-label": t("search"),
|
|
2601
|
+
className: "w-full pl-9 pr-8 py-1.5 text-sm rounded-lg\n bg-(--bg-muted) border border-transparent\n focus:border-primary focus:outline-none focus:bg-(--bg-elevated) transition-colors"
|
|
2602
|
+
}
|
|
2603
|
+
),
|
|
2604
|
+
searchQuery && /* @__PURE__ */ jsx(
|
|
2542
2605
|
"button",
|
|
2543
2606
|
{
|
|
2544
|
-
id: optionId(i),
|
|
2545
2607
|
type: "button",
|
|
2546
|
-
|
|
2547
|
-
"aria-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2608
|
+
onClick: () => setSearchQuery(""),
|
|
2609
|
+
"aria-label": t("clearSearch"),
|
|
2610
|
+
className: "absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors p-0.5 rounded-md hover:bg-(--bg-hover)",
|
|
2611
|
+
title: t("clearSearch"),
|
|
2612
|
+
children: /* @__PURE__ */ jsx(X, { size: 12 })
|
|
2613
|
+
}
|
|
2614
|
+
)
|
|
2615
|
+
] }) }),
|
|
2616
|
+
/* @__PURE__ */ jsx(
|
|
2617
|
+
"div",
|
|
2618
|
+
{
|
|
2619
|
+
ref: listRef,
|
|
2620
|
+
role: "listbox",
|
|
2621
|
+
id: listboxId,
|
|
2622
|
+
className: "flex-1 min-h-0 max-h-52 overflow-y-auto overscroll-contain p-1",
|
|
2623
|
+
children: filteredOptions.length === 0 ? /* @__PURE__ */ jsx("div", { className: "px-3 py-2 text-sm text-muted-foreground text-center whitespace-nowrap", children: t("noOptions") }) : filteredOptions.map((option, i) => {
|
|
2624
|
+
const isSelected = option.value === value;
|
|
2625
|
+
const isHigh = i === highlighted;
|
|
2626
|
+
return /* @__PURE__ */ jsxs(
|
|
2627
|
+
"button",
|
|
2628
|
+
{
|
|
2629
|
+
id: optionId(i),
|
|
2630
|
+
type: "button",
|
|
2631
|
+
role: "option",
|
|
2632
|
+
"aria-selected": isSelected,
|
|
2633
|
+
"data-highlighted": isHigh ? "" : void 0,
|
|
2634
|
+
onClick: () => handleSelect(option.value),
|
|
2635
|
+
onMouseEnter: () => setHighlighted(i),
|
|
2636
|
+
className: `dropdown-item w-full text-left outline-none ${isSelected ? "active" : ""}`,
|
|
2637
|
+
children: [
|
|
2638
|
+
option.icon && /* @__PURE__ */ jsx("span", { className: "shrink-0 w-5 h-5 flex items-center justify-center", children: option.icon }),
|
|
2639
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
2640
|
+
/* @__PURE__ */ jsx("div", { className: "truncate", children: option.label }),
|
|
2641
|
+
option.description && /* @__PURE__ */ jsx("div", { className: "text-xs font-normal text-muted-foreground truncate", children: option.description })
|
|
2642
|
+
] })
|
|
2643
|
+
]
|
|
2644
|
+
},
|
|
2645
|
+
option.value
|
|
2646
|
+
);
|
|
2647
|
+
})
|
|
2648
|
+
}
|
|
2649
|
+
)
|
|
2650
|
+
]
|
|
2651
|
+
}
|
|
2652
|
+
)
|
|
2570
2653
|
] });
|
|
2571
2654
|
}
|
|
2572
2655
|
function SegmentedSelect({
|
|
@@ -2587,8 +2670,8 @@ function SegmentedSelect({
|
|
|
2587
2670
|
"aria-pressed": value === opt.value,
|
|
2588
2671
|
title: opt.desc,
|
|
2589
2672
|
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",
|
|
2673
|
+
"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",
|
|
2674
|
+
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
2675
|
disabled && "opacity-50 cursor-not-allowed pointer-events-none"
|
|
2593
2676
|
),
|
|
2594
2677
|
children: [
|
|
@@ -2602,7 +2685,7 @@ function SegmentedSelect({
|
|
|
2602
2685
|
}
|
|
2603
2686
|
function NavTabs({ tabs, activeKey, onChange, className = "", ariaLabel }) {
|
|
2604
2687
|
const { Link } = useYunUI();
|
|
2605
|
-
return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx("nav", { className: "flex items-center gap-1 overflow-x-auto", "aria-label": ariaLabel, children: tabs.map((tab) => {
|
|
2688
|
+
return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx("nav", { className: "flex items-center gap-1 overflow-x-auto overflow-y-hidden overscroll-x-contain", "aria-label": ariaLabel, children: tabs.map((tab) => {
|
|
2606
2689
|
const active = tab.key === activeKey;
|
|
2607
2690
|
const cls = `nav-tab ${active ? "active" : ""}`;
|
|
2608
2691
|
return tab.href ? /* @__PURE__ */ jsx(Link, { href: tab.href, className: cls, "aria-current": active ? "page" : void 0, children: tab.label }, tab.key) : /* @__PURE__ */ jsx(
|
|
@@ -2629,7 +2712,7 @@ function ShinyButton({
|
|
|
2629
2712
|
"div",
|
|
2630
2713
|
{
|
|
2631
2714
|
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-(--
|
|
2715
|
+
"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
2716
|
className
|
|
2634
2717
|
),
|
|
2635
2718
|
children: [
|
|
@@ -2641,10 +2724,11 @@ function ShinyButton({
|
|
|
2641
2724
|
]
|
|
2642
2725
|
}
|
|
2643
2726
|
);
|
|
2727
|
+
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
2728
|
if (href) {
|
|
2645
|
-
return /* @__PURE__ */ jsx(Link, { href, onClick, children: ButtonContent });
|
|
2729
|
+
return /* @__PURE__ */ jsx(Link, { href, onClick, className: focusCls, children: ButtonContent });
|
|
2646
2730
|
}
|
|
2647
|
-
return /* @__PURE__ */ jsx("button", { onClick, children: ButtonContent });
|
|
2731
|
+
return /* @__PURE__ */ jsx("button", { type: "button", onClick, className: focusCls, children: ButtonContent });
|
|
2648
2732
|
}
|
|
2649
2733
|
function Marquee({
|
|
2650
2734
|
className,
|
|
@@ -2716,7 +2800,7 @@ var BentoCard = ({
|
|
|
2716
2800
|
header,
|
|
2717
2801
|
/* @__PURE__ */ jsxs("div", { className: "group-hover/bento:translate-x-2 transition duration-200", children: [
|
|
2718
2802
|
/* @__PURE__ */ jsx("div", { className: "mb-2 text-[var(--text-primary)]", children: icon }),
|
|
2719
|
-
/* @__PURE__ */ jsx("div", { className: "font-
|
|
2803
|
+
/* @__PURE__ */ jsx("div", { className: "font-semibold text-[var(--text-primary)] text-lg mb-2 mt-2", children: title }),
|
|
2720
2804
|
/* @__PURE__ */ jsx("div", { className: "font-normal text-[var(--text-secondary)] text-sm leading-relaxed", children: description })
|
|
2721
2805
|
] })
|
|
2722
2806
|
]
|
|
@@ -2755,7 +2839,7 @@ var PopoverContent = React7.forwardRef(({ className, align = "center", sideOffse
|
|
|
2755
2839
|
sideOffset,
|
|
2756
2840
|
side: "bottom",
|
|
2757
2841
|
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-
|
|
2842
|
+
"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-2xl border border-border bg-background/60 backdrop-blur-2xl p-2 text-sm text-popover-foreground shadow-lg shadow-black/5 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
2843
|
className
|
|
2760
2844
|
),
|
|
2761
2845
|
...props
|
|
@@ -2778,27 +2862,27 @@ var sizeClasses = {
|
|
|
2778
2862
|
var variantClasses = {
|
|
2779
2863
|
default: {
|
|
2780
2864
|
checkedTrack: "border-primary bg-primary/10",
|
|
2781
|
-
uncheckedTrack: "border-
|
|
2865
|
+
uncheckedTrack: "border-(--border-strong) bg-muted",
|
|
2782
2866
|
checkedThumb: "bg-primary",
|
|
2783
|
-
uncheckedThumb: "bg-
|
|
2867
|
+
uncheckedThumb: "bg-(--border-strong)"
|
|
2784
2868
|
},
|
|
2785
2869
|
success: {
|
|
2786
|
-
checkedTrack: "border-
|
|
2787
|
-
uncheckedTrack: "border-
|
|
2788
|
-
checkedThumb: "bg-
|
|
2789
|
-
uncheckedThumb: "bg-
|
|
2870
|
+
checkedTrack: "border-(--success) bg-success-soft",
|
|
2871
|
+
uncheckedTrack: "border-(--border-strong) bg-muted",
|
|
2872
|
+
checkedThumb: "bg-(--success)",
|
|
2873
|
+
uncheckedThumb: "bg-(--border-strong)"
|
|
2790
2874
|
},
|
|
2791
2875
|
warning: {
|
|
2792
|
-
checkedTrack: "border-
|
|
2793
|
-
uncheckedTrack: "border-
|
|
2794
|
-
checkedThumb: "bg-
|
|
2795
|
-
uncheckedThumb: "bg-
|
|
2876
|
+
checkedTrack: "border-(--warning) bg-warning-soft",
|
|
2877
|
+
uncheckedTrack: "border-(--border-strong) bg-muted",
|
|
2878
|
+
checkedThumb: "bg-(--warning)",
|
|
2879
|
+
uncheckedThumb: "bg-(--border-strong)"
|
|
2796
2880
|
},
|
|
2797
2881
|
danger: {
|
|
2798
|
-
checkedTrack: "border-
|
|
2799
|
-
uncheckedTrack: "border-
|
|
2800
|
-
checkedThumb: "bg-
|
|
2801
|
-
uncheckedThumb: "bg-
|
|
2882
|
+
checkedTrack: "border-(--error) bg-error-soft",
|
|
2883
|
+
uncheckedTrack: "border-(--border-strong) bg-muted",
|
|
2884
|
+
checkedThumb: "bg-(--error)",
|
|
2885
|
+
uncheckedThumb: "bg-(--border-strong)"
|
|
2802
2886
|
}
|
|
2803
2887
|
};
|
|
2804
2888
|
var Switch = forwardRef(
|
|
@@ -2870,25 +2954,25 @@ var toast = {
|
|
|
2870
2954
|
success: (message, description) => {
|
|
2871
2955
|
toast$1.success(message, {
|
|
2872
2956
|
description,
|
|
2873
|
-
icon: /* @__PURE__ */ jsx(CheckCircle2, { className: "w-5 h-5 text-
|
|
2957
|
+
icon: /* @__PURE__ */ jsx(CheckCircle2, { className: "w-5 h-5 text-success" })
|
|
2874
2958
|
});
|
|
2875
2959
|
},
|
|
2876
2960
|
error: (message, description) => {
|
|
2877
2961
|
toast$1.error(message, {
|
|
2878
2962
|
description,
|
|
2879
|
-
icon: /* @__PURE__ */ jsx(AlertCircle, { className: "w-5 h-5 text-
|
|
2963
|
+
icon: /* @__PURE__ */ jsx(AlertCircle, { className: "w-5 h-5 text-error" })
|
|
2880
2964
|
});
|
|
2881
2965
|
},
|
|
2882
2966
|
info: (message, description) => {
|
|
2883
2967
|
toast$1.info(message, {
|
|
2884
2968
|
description,
|
|
2885
|
-
icon: /* @__PURE__ */ jsx(Info, { className: "w-5 h-5 text-
|
|
2969
|
+
icon: /* @__PURE__ */ jsx(Info, { className: "w-5 h-5 text-info" })
|
|
2886
2970
|
});
|
|
2887
2971
|
},
|
|
2888
2972
|
warning: (message, description) => {
|
|
2889
2973
|
toast$1.warning(message, {
|
|
2890
2974
|
description,
|
|
2891
|
-
icon: /* @__PURE__ */ jsx(AlertTriangle, { className: "w-5 h-5 text-
|
|
2975
|
+
icon: /* @__PURE__ */ jsx(AlertTriangle, { className: "w-5 h-5 text-warning" })
|
|
2892
2976
|
});
|
|
2893
2977
|
},
|
|
2894
2978
|
loading: (message) => {
|
|
@@ -2916,18 +3000,37 @@ var YUNUI_PALETTES = [
|
|
|
2916
3000
|
"dusk",
|
|
2917
3001
|
"red",
|
|
2918
3002
|
"orange",
|
|
3003
|
+
"amber",
|
|
2919
3004
|
"yellow",
|
|
3005
|
+
"lime",
|
|
2920
3006
|
"moss",
|
|
2921
3007
|
"green",
|
|
2922
3008
|
"emerald",
|
|
3009
|
+
"teal",
|
|
2923
3010
|
"aqua",
|
|
2924
3011
|
"cyan",
|
|
2925
3012
|
"blue",
|
|
2926
3013
|
"indigo",
|
|
2927
3014
|
"violet",
|
|
3015
|
+
"plum",
|
|
2928
3016
|
"magenta",
|
|
3017
|
+
"fuchsia",
|
|
2929
3018
|
"pink"
|
|
2930
3019
|
];
|
|
3020
|
+
var YUNUI_THEME_PRESETS = {
|
|
3021
|
+
aurora: { label: "Aurora", brand: "blue", accent: "violet", neutral: "slate" },
|
|
3022
|
+
sunset: { label: "Sunset", brand: "orange", accent: "pink", neutral: "sand" },
|
|
3023
|
+
forest: { label: "Forest", brand: "green", accent: "lime", neutral: "gray" },
|
|
3024
|
+
ocean: { label: "Ocean", brand: "cyan", accent: "teal", neutral: "slate" },
|
|
3025
|
+
grape: { label: "Grape", brand: "violet", accent: "magenta", neutral: "dusk" },
|
|
3026
|
+
ember: { label: "Ember", brand: "red", accent: "amber", neutral: "sand" },
|
|
3027
|
+
lagoon: { label: "Lagoon", brand: "teal", accent: "emerald", neutral: "mint" },
|
|
3028
|
+
blossom: { label: "Blossom", brand: "pink", accent: "fuchsia", neutral: "rose" },
|
|
3029
|
+
royal: { label: "Royal", brand: "indigo", accent: "blue", neutral: "slate" },
|
|
3030
|
+
citrus: { label: "Citrus", brand: "lime", accent: "yellow", neutral: "sand" },
|
|
3031
|
+
orchid: { label: "Orchid", brand: "plum", accent: "violet", neutral: "dusk" },
|
|
3032
|
+
mono: { label: "Mono", brand: "gray", accent: "gray", neutral: "gray" }
|
|
3033
|
+
};
|
|
2931
3034
|
var ATTR = {
|
|
2932
3035
|
brand: "data-brand",
|
|
2933
3036
|
accent: "data-accent",
|
|
@@ -2989,6 +3092,6 @@ function useYunUITheme(defaults = {}) {
|
|
|
2989
3092
|
return [theme, update];
|
|
2990
3093
|
}
|
|
2991
3094
|
|
|
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-
|
|
3095
|
+
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, YUNUI_THEME_PRESETS, applyTheme, fadeIn, readTheme, staggerContainer, staggerItem, toast, useBodyScrollLock, useEscapeKey, useFocusTrap, useModalBehavior, useYunUITheme };
|
|
3096
|
+
//# sourceMappingURL=chunk-6MZN3GOP.js.map
|
|
3097
|
+
//# sourceMappingURL=chunk-6MZN3GOP.js.map
|