@sarunyu/system-one 4.7.7 → 4.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2837,44 +2837,44 @@ const Dropdown = forwardRef(
2837
2837
  }
2838
2838
  )
2839
2839
  ),
2840
- isFocus ? /* @__PURE__ */ jsx(CaretUp, { size: 22, className: cn("shrink-0", caretClassName) }) : /* @__PURE__ */ jsx(CaretDown, { size: 22, className: cn("shrink-0", caretClassName) })
2840
+ isFocus ? /* @__PURE__ */ jsx(CaretUp, { size: 22, className: cn("shrink-0", caretClassName) }) : /* @__PURE__ */ jsx(CaretDown, { size: 22, className: cn("shrink-0", caretClassName) }),
2841
+ open && !forceState && options.length > 0 && /* @__PURE__ */ jsx(
2842
+ "div",
2843
+ {
2844
+ className: cn(
2845
+ "absolute top-full left-0 w-full mt-1 bg-popover rounded-lg overflow-clip p-2 z-50 flex flex-col items-start text-popover-foreground",
2846
+ filteredOptions.length > 10 && "overflow-y-auto"
2847
+ ),
2848
+ style: {
2849
+ boxShadow: "var(--elevation-popover)",
2850
+ ...filteredOptions.length > 10 ? { maxHeight: 10 * 48 + 16 } : {}
2851
+ },
2852
+ children: filteredOptions.length > 0 ? filteredOptions.map((opt) => /* @__PURE__ */ jsx(
2853
+ "div",
2854
+ {
2855
+ onClick: () => handleSelect(opt.value),
2856
+ className: cn(
2857
+ "w-full shrink-0 rounded-[4px] cursor-pointer transition-colors duration-100",
2858
+ opt.value === currentValue ? "bg-primary-action-light" : "bg-popover hover:bg-disabled-bg"
2859
+ ),
2860
+ children: /* @__PURE__ */ jsx("div", { className: "flex flex-row items-center size-full", children: /* @__PURE__ */ jsx("div", { className: "flex items-center p-3.5 relative w-full", children: /* @__PURE__ */ jsx(
2861
+ "p",
2862
+ {
2863
+ className: cn(
2864
+ "flex-1 min-w-0 min-h-[1px] leading-5 not-italic overflow-hidden text-sm text-ellipsis whitespace-nowrap",
2865
+ opt.value === currentValue ? "text-primary-action" : "text-foreground"
2866
+ ),
2867
+ children: opt.label
2868
+ }
2869
+ ) }) })
2870
+ },
2871
+ opt.value
2872
+ )) : /* @__PURE__ */ jsx("div", { className: "w-full shrink-0 bg-popover", children: /* @__PURE__ */ jsx("div", { className: "flex flex-row items-center size-full", children: /* @__PURE__ */ jsx("div", { className: "flex items-center p-[14px] relative w-full", children: /* @__PURE__ */ jsx("p", { className: "flex-1 min-w-0 min-h-[1px] leading-[20px] not-italic text-[14px] text-disabled", children: "No results found" }) }) }) })
2873
+ }
2874
+ )
2841
2875
  ]
2842
2876
  }
2843
2877
  ),
2844
- open && !forceState && options.length > 0 && /* @__PURE__ */ jsx(
2845
- "div",
2846
- {
2847
- className: cn(
2848
- "relative bg-popover rounded-lg overflow-clip p-2 z-20 flex flex-col items-start text-popover-foreground",
2849
- filteredOptions.length > 10 && "overflow-y-auto"
2850
- ),
2851
- style: {
2852
- boxShadow: "var(--elevation-popover)",
2853
- ...filteredOptions.length > 10 ? { maxHeight: 10 * 48 + 16 } : {}
2854
- },
2855
- children: filteredOptions.length > 0 ? filteredOptions.map((opt) => /* @__PURE__ */ jsx(
2856
- "div",
2857
- {
2858
- onClick: () => handleSelect(opt.value),
2859
- className: cn(
2860
- "w-full shrink-0 rounded-[4px] cursor-pointer transition-colors duration-100",
2861
- opt.value === currentValue ? "bg-primary-action-light" : "bg-popover hover:bg-disabled-bg"
2862
- ),
2863
- children: /* @__PURE__ */ jsx("div", { className: "flex flex-row items-center size-full", children: /* @__PURE__ */ jsx("div", { className: "flex items-center p-3.5 relative w-full", children: /* @__PURE__ */ jsx(
2864
- "p",
2865
- {
2866
- className: cn(
2867
- "flex-1 min-w-0 min-h-[1px] leading-5 not-italic overflow-hidden text-sm text-ellipsis whitespace-nowrap",
2868
- opt.value === currentValue ? "text-primary-action" : "text-foreground"
2869
- ),
2870
- children: opt.label
2871
- }
2872
- ) }) })
2873
- },
2874
- opt.value
2875
- )) : /* @__PURE__ */ jsx("div", { className: "w-full shrink-0 bg-popover", children: /* @__PURE__ */ jsx("div", { className: "flex flex-row items-center size-full", children: /* @__PURE__ */ jsx("div", { className: "flex items-center p-[14px] relative w-full", children: /* @__PURE__ */ jsx("p", { className: "flex-1 min-w-0 min-h-[1px] leading-[20px] not-italic text-[14px] text-disabled", children: "No results found" }) }) }) })
2876
- }
2877
- ),
2878
2878
  showBelow && /* @__PURE__ */ jsx("div", { className: "flex items-start px-[4px] text-[12px] leading-[16px]", children: /* @__PURE__ */ jsx("span", { className: "flex-1 min-w-0", style: { color: leftColor }, children: leftText }) })
2879
2879
  ]
2880
2880
  }
@@ -3139,8 +3139,9 @@ const DropdownMultiple = forwardRef(
3139
3139
  const handleTriggerClick = () => {
3140
3140
  var _a;
3141
3141
  if (isDisabled || isStatic) return;
3142
- if (!open) setOpen(true);
3143
- (_a = inputRef.current) == null ? void 0 : _a.focus();
3142
+ const next = !open;
3143
+ setOpen(next);
3144
+ if (next) (_a = inputRef.current) == null ? void 0 : _a.focus();
3144
3145
  };
3145
3146
  const handleInputKeyDown = (e) => {
3146
3147
  if (e.key === "Escape") setOpen(false);