@yuhuanowo/yunui 0.2.14 → 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.
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { cn } from './chunk-GHO4RCDR.js';
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';
@@ -646,8 +646,13 @@ function Combobox({
646
646
  const resolvedCreatableText = creatableText || t("creatableText", { value: "" });
647
647
  const [isOpen, setIsOpen] = useState(false);
648
648
  const [inputValue, setInputValue] = useState(value || "");
649
+ const [highlighted, setHighlighted] = useState(-1);
649
650
  const containerRef = useRef(null);
650
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}`;
651
656
  useEffect(() => {
652
657
  const selectedOption2 = options.find((o) => o.value === value);
653
658
  setInputValue(selectedOption2?.label || value || "");
@@ -661,6 +666,9 @@ function Combobox({
661
666
  document.addEventListener("mousedown", handleClickOutside);
662
667
  return () => document.removeEventListener("mousedown", handleClickOutside);
663
668
  }, []);
669
+ useEffect(() => {
670
+ setHighlighted(-1);
671
+ }, [inputValue, isOpen]);
664
672
  const filteredOptions = inputValue ? options.filter(
665
673
  (o) => o.label.toLowerCase().includes(inputValue.toLowerCase()) || o.value.toLowerCase().includes(inputValue.toLowerCase())
666
674
  ) : options;
@@ -676,16 +684,43 @@ function Combobox({
676
684
  setIsOpen(true);
677
685
  };
678
686
  const handleKeyDown = (e) => {
679
- if (e.key === "Enter") {
680
- e.preventDefault();
681
- if (canCreateNew) {
682
- handleSelect(inputValue);
683
- } else if (filteredOptions.length > 0) {
684
- handleSelect(filteredOptions[0].value);
685
- }
686
- } else if (e.key === "Escape") {
687
- setIsOpen(false);
688
- setInputValue(value || "");
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;
689
724
  }
690
725
  };
691
726
  const clearValue = () => {
@@ -718,6 +753,12 @@ function Combobox({
718
753
  onFocus: () => !disabled && setIsOpen(true),
719
754
  onKeyDown: handleKeyDown,
720
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,
721
762
  disabled,
722
763
  className: `
723
764
  w-full py-2
@@ -752,54 +793,61 @@ function Combobox({
752
793
  }
753
794
  )
754
795
  ] }),
755
- isOpen && !disabled && /* @__PURE__ */ jsx("div", { className: "absolute z-50 w-full mt-1 py-1 rounded-xl border border-(--border-default) bg-(--bg-elevated) shadow-lg overflow-hidden", children: /* @__PURE__ */ jsx("div", { className: "max-h-60 overflow-y-auto", 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: [
756
- filteredOptions.map((option) => {
757
- const isSelected = option.value === value;
758
- const optionIconPath = option.iconUrl ?? null;
759
- return /* @__PURE__ */ jsxs(
760
- "button",
761
- {
762
- type: "button",
763
- onClick: () => handleSelect(option.value),
764
- className: `
765
- w-full px-3 py-2 text-left text-sm
766
- flex items-center gap-2
767
- hover:bg-(--bg-hover) transition-colors
768
- outline-none focus-visible:ring-2 focus-visible:ring-ring
769
- ${isSelected ? "bg-primary/10 text-primary" : ""}
770
- `,
771
- children: [
772
- 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(
773
- Image2,
774
- {
775
- src: optionIconPath,
776
- alt: option.label,
777
- width: 16,
778
- height: 16,
779
- className: "object-cover",
780
- unoptimized: true
781
- }
782
- ) }),
783
- /* @__PURE__ */ jsx("span", { className: "font-medium truncate", children: option.label }),
784
- isSelected && /* @__PURE__ */ jsx(Check, { size: 14, className: "ml-auto shrink-0" })
785
- ]
786
- },
787
- option.value
788
- );
789
- }),
790
- canCreateNew && /* @__PURE__ */ jsxs(
791
- "button",
792
- {
793
- type: "button",
794
- onClick: () => handleSelect(inputValue),
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 ",
796
- children: [
797
- /* @__PURE__ */ jsx("span", { className: "text-lg", children: creatableIcon ?? "+" }),
798
- /* @__PURE__ */ jsx("span", { children: resolvedCreatableText.replace("{value}", inputValue) })
799
- ]
800
- }
801
- )
802
- ] }) }) })
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
+ )
803
851
  ] });
804
852
  }
805
853
  var Accordion = AccordionPrimitive.Root;
@@ -1623,6 +1671,7 @@ var SearchInput = React7.forwardRef(
1623
1671
  ref: setRef,
1624
1672
  type: "text",
1625
1673
  role: "searchbox",
1674
+ "aria-label": props.placeholder,
1626
1675
  value,
1627
1676
  onChange: (e) => onChange?.(e.target.value),
1628
1677
  disabled,
@@ -1965,7 +2014,7 @@ var SelectContent = React7.forwardRef(({ className, children, position = "popper
1965
2014
  ref,
1966
2015
  position,
1967
2016
  className: cn(
1968
- "relative z-50 min-w-32 overflow-hidden rounded-xl border border-border bg-popover/90 backdrop-blur-xl shadow-lg",
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",
1969
2018
  "data-[state=open]:animate-in data-[state=closed]:animate-out",
1970
2019
  "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
1971
2020
  "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
@@ -1986,20 +2035,18 @@ var SelectContent = React7.forwardRef(({ className, children, position = "popper
1986
2035
  }
1987
2036
  ) }));
1988
2037
  SelectContent.displayName = SelectPrimitive.Content.displayName;
1989
- var SelectItem = React7.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
2038
+ var SelectItem = React7.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
1990
2039
  SelectPrimitive.Item,
1991
2040
  {
1992
2041
  ref,
1993
2042
  className: cn(
1994
- "relative flex w-full cursor-pointer select-none items-center rounded-lg py-2 pl-8 pr-3 text-sm outline-none",
1995
- "focus:bg-muted data-disabled:pointer-events-none data-disabled:opacity-50",
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",
1996
2046
  className
1997
2047
  ),
1998
2048
  ...props,
1999
- children: [
2000
- /* @__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" }) }) }),
2001
- /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
2002
- ]
2049
+ children: /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
2003
2050
  }
2004
2051
  ));
2005
2052
  SelectItem.displayName = SelectPrimitive.Item.displayName;
@@ -2043,7 +2090,7 @@ var TabsList = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__
2043
2090
  {
2044
2091
  ref,
2045
2092
  className: cn(
2046
- "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",
2047
2094
  className
2048
2095
  ),
2049
2096
  ...props
@@ -2270,7 +2317,7 @@ var DropdownMenuSubContent = React7.forwardRef(({ className, ...props }, ref) =>
2270
2317
  {
2271
2318
  ref,
2272
2319
  className: cn(
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",
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",
2274
2321
  className
2275
2322
  ),
2276
2323
  ...props
@@ -2283,7 +2330,7 @@ var DropdownMenuContent = React7.forwardRef(({ className, sideOffset = 4, ...pro
2283
2330
  ref,
2284
2331
  sideOffset,
2285
2332
  className: cn(
2286
- "z-50 min-w-32 overflow-hidden rounded-xl border border-border bg-popover/90 backdrop-blur-xl p-1 text-popover-foreground shadow-md",
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",
2287
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",
2288
2335
  className
2289
2336
  ),
@@ -2391,6 +2438,8 @@ function CustomSelect({
2391
2438
  const inputRef = useRef(null);
2392
2439
  const triggerRef = useRef(null);
2393
2440
  const listRef = useRef(null);
2441
+ const panelRef = useRef(null);
2442
+ const { shift, maxHeight } = useAnchoredPosition(isOpen, panelRef);
2394
2443
  const baseId = useId();
2395
2444
  const listboxId = `${baseId}-listbox`;
2396
2445
  const optionId = (i) => `${baseId}-opt-${i}`;
@@ -2409,7 +2458,9 @@ function CustomSelect({
2409
2458
  return () => document.removeEventListener("mousedown", handleClickOutside);
2410
2459
  }, []);
2411
2460
  useEffect(() => {
2412
- if (isOpen && searchable && inputRef.current) inputRef.current.focus();
2461
+ if (!isOpen) return;
2462
+ if (searchable && inputRef.current) inputRef.current.focus();
2463
+ else triggerRef.current?.focus();
2413
2464
  }, [isOpen, searchable]);
2414
2465
  useEffect(() => {
2415
2466
  if (isOpen) {
@@ -2524,76 +2575,81 @@ function CustomSelect({
2524
2575
  ]
2525
2576
  }
2526
2577
  ),
2527
- isOpen && /* @__PURE__ */ jsxs("div", { className: "\n absolute z-50 w-full mt-1 py-1\n rounded-xl border border-(--border-default)\n bg-(--bg-elevated) shadow-lg\n max-h-64 overflow-hidden\n animate-in fade-in-0 zoom-in-95 duration-200\n ", children: [
2528
- 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: [
2529
- /* @__PURE__ */ jsx(Search, { size: 14, className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none" }),
2530
- /* @__PURE__ */ jsx(
2531
- "input",
2532
- {
2533
- ref: inputRef,
2534
- type: "text",
2535
- role: "combobox",
2536
- "aria-expanded": isOpen,
2537
- "aria-controls": listboxId,
2538
- "aria-activedescendant": highlighted >= 0 ? optionId(highlighted) : void 0,
2539
- "aria-autocomplete": "list",
2540
- value: searchQuery,
2541
- onChange: (e) => setSearchQuery(e.target.value),
2542
- placeholder: t("search"),
2543
- 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"
2544
- }
2545
- ),
2546
- searchQuery && /* @__PURE__ */ jsx(
2547
- "button",
2548
- {
2549
- type: "button",
2550
- onClick: () => setSearchQuery(""),
2551
- "aria-label": t("clearSearch"),
2552
- 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)",
2553
- title: t("clearSearch"),
2554
- children: /* @__PURE__ */ jsx(X, { size: 12 })
2555
- }
2556
- )
2557
- ] }) }),
2558
- /* @__PURE__ */ jsx(
2559
- "div",
2560
- {
2561
- ref: listRef,
2562
- role: "listbox",
2563
- id: listboxId,
2564
- className: "max-h-52 overflow-y-auto overscroll-contain",
2565
- 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) => {
2566
- const isSelected = option.value === value;
2567
- const isHigh = i === highlighted;
2568
- 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(
2569
2605
  "button",
2570
2606
  {
2571
- id: optionId(i),
2572
2607
  type: "button",
2573
- role: "option",
2574
- "aria-selected": isSelected,
2575
- onClick: () => handleSelect(option.value),
2576
- onMouseEnter: () => setHighlighted(i),
2577
- className: `
2578
- w-full flex items-center gap-2 px-3 py-2 text-sm text-left transition-colors
2579
- ${isHigh ? "bg-(--bg-hover)" : ""}
2580
- ${isSelected ? "bg-primary/10 text-primary" : ""}
2581
- `,
2582
- children: [
2583
- option.icon && /* @__PURE__ */ jsx("span", { className: "shrink-0 w-5 h-5 flex items-center justify-center", children: option.icon }),
2584
- /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
2585
- /* @__PURE__ */ jsx("div", { className: "truncate", children: option.label }),
2586
- option.description && /* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground truncate", children: option.description })
2587
- ] }),
2588
- isSelected && /* @__PURE__ */ jsx(Check, { size: 14, className: "shrink-0 text-primary" })
2589
- ]
2590
- },
2591
- option.value
2592
- );
2593
- })
2594
- }
2595
- )
2596
- ] })
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
+ )
2597
2653
  ] });
2598
2654
  }
2599
2655
  function SegmentedSelect({
@@ -2629,7 +2685,7 @@ function SegmentedSelect({
2629
2685
  }
2630
2686
  function NavTabs({ tabs, activeKey, onChange, className = "", ariaLabel }) {
2631
2687
  const { Link } = useYunUI();
2632
- 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) => {
2633
2689
  const active = tab.key === activeKey;
2634
2690
  const cls = `nav-tab ${active ? "active" : ""}`;
2635
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(
@@ -2783,7 +2839,7 @@ var PopoverContent = React7.forwardRef(({ className, align = "center", sideOffse
2783
2839
  sideOffset,
2784
2840
  side: "bottom",
2785
2841
  className: cn(
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",
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",
2787
2843
  className
2788
2844
  ),
2789
2845
  ...props
@@ -2944,18 +3000,37 @@ var YUNUI_PALETTES = [
2944
3000
  "dusk",
2945
3001
  "red",
2946
3002
  "orange",
3003
+ "amber",
2947
3004
  "yellow",
3005
+ "lime",
2948
3006
  "moss",
2949
3007
  "green",
2950
3008
  "emerald",
3009
+ "teal",
2951
3010
  "aqua",
2952
3011
  "cyan",
2953
3012
  "blue",
2954
3013
  "indigo",
2955
3014
  "violet",
3015
+ "plum",
2956
3016
  "magenta",
3017
+ "fuchsia",
2957
3018
  "pink"
2958
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
+ };
2959
3034
  var ATTR = {
2960
3035
  brand: "data-brand",
2961
3036
  accent: "data-accent",
@@ -3017,6 +3092,6 @@ function useYunUITheme(defaults = {}) {
3017
3092
  return [theme, update];
3018
3093
  }
3019
3094
 
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
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