import { o as p } from "./rolldown-runtime.js";
import { i as v, t as h } from "./vendor/react.js";
import { t as k } from "./minus.js";
import { t as b } from "./dist.js";
import { t as s } from "./utils.js";
var u = /* @__PURE__ */ p(v(), 1), i = h();
function E(o = {}) {
  const { value: e, defaultValue: a, onValueChange: r } = o, [d, t] = u.useState(a), c = e !== void 0;
  return [c ? e : d, u.useCallback((n) => {
    c || t(n), r?.(n);
  }, [c, r])];
}
function F(o = {}) {
  const { value: e, defaultValue: a = [], onValueChange: r } = o, [d, t] = u.useState(a), c = e !== void 0, n = c ? e : d;
  return [n, u.useCallback((l, f) => {
    const g = f ? [...n, l] : n.filter((x) => x !== l);
    c || t(g), r?.(g);
  }, [
    c,
    n,
    r
  ])];
}
var y = {
  primary: {
    indicator: "border-primary",
    indicatorChecked: "bg-primary",
    border: "border-primary",
    bg: "bg-primary",
    text: "text-primary-foreground"
  },
  secondary: {
    indicator: "border-secondary",
    indicatorChecked: "bg-secondary",
    border: "border-secondary",
    bg: "bg-secondary",
    text: "text-secondary-foreground"
  },
  success: {
    indicator: "border-success",
    indicatorChecked: "bg-success",
    border: "border-success",
    bg: "bg-success",
    text: "text-success-foreground"
  },
  warning: {
    indicator: "border-warning",
    indicatorChecked: "bg-warning",
    border: "border-warning",
    bg: "bg-warning",
    text: "text-warning-foreground"
  },
  info: {
    indicator: "border-info",
    indicatorChecked: "bg-info",
    border: "border-info",
    bg: "bg-info",
    text: "text-info-foreground"
  },
  destructive: {
    indicator: "border-destructive",
    indicatorChecked: "bg-destructive",
    border: "border-destructive",
    bg: "bg-destructive",
    text: "text-destructive-foreground"
  }
}, K = b("flex", {
  variants: {
    orientation: {
      horizontal: "flex-row flex-wrap",
      vertical: "flex-col"
    },
    gap: {
      sm: "gap-2",
      md: "gap-3",
      lg: "gap-4"
    }
  },
  defaultVariants: {
    orientation: "horizontal",
    gap: "md"
  }
}), z = b("shrink-0 rounded-full border-2 transition-all flex items-center justify-center", {
  variants: { size: {
    sm: "size-4",
    md: "size-5",
    lg: "size-6"
  } },
  defaultVariants: { size: "sm" }
}), C = b("shrink-0 border transition-[border-color,background-color,color,box-shadow] duration-200 ease-out motion-reduce:transition-none flex items-center justify-center", {
  variants: { size: {
    sm: "size-4 rounded-[4px]",
    md: "size-5 rounded-[5px]",
    lg: "size-6 rounded-[6px]"
  } },
  defaultVariants: { size: "sm" }
}), w = {
  sm: "size-1.5",
  md: "size-2",
  lg: "size-2.5"
}, B = {
  sm: "text-sm",
  md: "text-sm",
  lg: "text-base"
}, m = {
  sm: "size-3",
  md: "size-3.5",
  lg: "size-4"
}, S = "M4 12l5 5L20 6";
function j({ className: o }) {
  return /* @__PURE__ */ (0, i.jsx)("svg", {
    viewBox: "0 0 24 24",
    fill: "none",
    stroke: "currentColor",
    strokeWidth: 3,
    strokeLinecap: "round",
    strokeLinejoin: "round",
    className: s(o, "delight-check-draw"),
    children: /* @__PURE__ */ (0, i.jsx)("path", { d: S })
  });
}
var V = u.forwardRef(({ type: o, checked: e = !1, disabled: a = !1, size: r = "sm", color: d = "primary", className: t, indeterminate: c = !1 }, n) => {
  const l = y[d];
  return o === "checkbox" ? /* @__PURE__ */ (0, i.jsx)("span", {
    ref: n,
    "data-slot": "selection-indicator",
    "data-type": "checkbox",
    "data-checked": e,
    className: s(C({ size: r }), e ? s(l.indicatorChecked, l.border, l.text, "border", "delight-check-bounce") : "border-border bg-background", a && "opacity-50", t),
    "aria-hidden": "true",
    children: e && (c ? /* @__PURE__ */ (0, i.jsx)(k, {
      className: s(m[r], "animate-[scale-in_150ms_ease-out] motion-reduce:animate-none"),
      strokeWidth: 3
    }) : /* @__PURE__ */ (0, i.jsx)(j, { className: m[r] }))
  }) : /* @__PURE__ */ (0, i.jsx)("span", {
    ref: n,
    "data-slot": "selection-indicator",
    "data-type": "radio",
    "data-checked": e,
    className: s(z({ size: r }), "transition-[background-color,border-color] duration-150 motion-reduce:transition-none", e ? s(l.indicatorChecked, "border-transparent") : "border-border bg-background", a && "opacity-50", t),
    "aria-hidden": "true",
    children: /* @__PURE__ */ (0, i.jsx)("span", { className: s("bg-primary-foreground rounded-full transition-transform duration-150 ease-out motion-reduce:transition-none", w[r], e ? "scale-100" : "scale-0") })
  });
});
V.displayName = "SelectionIndicator";
var I = {
  sm: "size-8",
  md: "size-10",
  lg: "size-12"
}, N = {
  sm: "size-4",
  md: "size-5",
  lg: "size-6"
}, _ = u.forwardRef(({ children: o, size: e = "sm", className: a }, r) => {
  const d = I[e], t = N[e];
  return /* @__PURE__ */ (0, i.jsx)("div", {
    ref: r,
    "data-slot": "featured-icon",
    className: s("shrink-0 rounded-md border border-border bg-card/60", "flex items-center justify-center", "dark:bg-foreground/60 dark:border-border", d, a),
    style: { boxShadow: "var(--shadow-inset-ring)" },
    children: /* @__PURE__ */ (0, i.jsx)("div", {
      className: s("text-secondary-foreground dark:text-quaternary-foreground", t),
      children: o
    })
  });
});
_.displayName = "FeaturedIcon";
var M = {
  gray: "bg-muted",
  orange: "bg-warning",
  red: "bg-destructive",
  darkRed: "bg-destructive-hover",
  brand: "bg-primary/10",
  success: "bg-success/10",
  warning: "bg-warning/10",
  error: "bg-destructive/10"
}, R = {
  sm: "size-[10px]",
  md: "size-3",
  lg: "size-3.5"
}, D = u.forwardRef(({ color: o, size: e = "sm", className: a }, r) => {
  if (!o) return null;
  const d = M[o], t = o.startsWith("#");
  return /* @__PURE__ */ (0, i.jsx)("span", {
    ref: r,
    "data-slot": "color-dot",
    className: s("shrink-0 rounded-full", R[e], !t && d, a),
    style: t ? { backgroundColor: o } : void 0,
    "aria-hidden": "true"
  });
});
D.displayName = "ColorDot";
export {
  y as a,
  F as c,
  V as i,
  E as l,
  j as n,
  K as o,
  _ as r,
  B as s,
  D as t
};

//# sourceMappingURL=selection-group.js.map