import { jsxs as u, jsx as l } from "react/jsx-runtime";
import { useCallback as m } from "react";
import { Select as p, SelectTrigger as v, SelectValue as b, SelectContent as g, SelectGroup as h, SelectItem as S } from "../../../select/SelectPrimitives.js";
import { c as f } from "../../../../index-BtlgVD4m.js";
const y = (n) => {
  const { "aria-label": i, value: a, onChange: r, options: t = [], disabled: s } = n, c = m(
    (e) => {
      const d = { target: { value: e } };
      r == null || r(d);
    },
    [r]
  ), o = Array.isArray(a) ? a.length > 0 ? String(a[0]) : void 0 : a != null ? String(a) : void 0;
  return /* @__PURE__ */ u(p, { value: o, onValueChange: c, disabled: s, children: [
    /* @__PURE__ */ l(
      v,
      {
        tabIndex: 0,
        size: "sm",
        "aria-label": i,
        className: f(
          "h-[var(--spacing-7)]",
          "min-w-0 w-auto",
          // Reduce horizontal padding for compact header appearance
          "px-[var(--spacing-2)]",
          "gap-[var(--spacing-1)]",
          // Hide the default min-width so month/year labels stay concise
          "[&>span]:line-clamp-1"
        ),
        children: /* @__PURE__ */ l(b, {})
      }
    ),
    /* @__PURE__ */ l(g, { className: "bg-[var(--base-popover)] border-[var(--base-border)]", isPortal: !0, children: /* @__PURE__ */ l(h, { children: t.map((e) => /* @__PURE__ */ l(S, { value: String(e.value), disabled: e.disabled, children: e.label }, e.value)) }) })
  ] });
};
export {
  y as default
};
//# sourceMappingURL=CalendarDropdown.js.map
