import { jsxs as g, jsx as l } from "react/jsx-runtime";
import { forwardRef as a, isValidElement as f, Children as N } from "react";
import { c } from "./bind-CU-R61T-.mjs";
import { a as $ } from "./checkmark.es-DdgIZN2R.mjs";
import { a as v } from "./paragraph-DNtj7OLr.mjs";
const n = {
  "purpur-listbox": "_purpur-listbox_6c8yl_1",
  "purpur-listbox-item": "_purpur-listbox-item_6c8yl_15",
  "purpur-listbox-item--hovered": "_purpur-listbox-item--hovered_6c8yl_29",
  "purpur-listbox-item--highlighted": "_purpur-listbox-item--highlighted_6c8yl_37",
  "purpur-listbox-item--noninteractive": "_purpur-listbox-item--noninteractive_6c8yl_41",
  "purpur-listbox-item--disabled": "_purpur-listbox-item--disabled_6c8yl_44",
  "purpur-listbox-item__icon": "_purpur-listbox-item__icon_6c8yl_51"
}, m = c.bind(n), i = "purpur-listbox", p = a((t, e) => {
  const {
    disabled: r,
    highlighted: d,
    hovered: x,
    selected: s,
    children: o,
    className: _,
    noninteractive: b,
    ...h
  } = t, y = m(`${i}-item`, _, {
    [`${i}-item--highlighted`]: d,
    [`${i}-item--selected`]: s,
    [`${i}-item--hovered`]: x,
    [`${i}-item--disabled`]: r,
    [`${i}-item--noninteractive`]: b
  });
  return /* @__PURE__ */ g(
    "li",
    {
      ...h,
      ref: e,
      className: y,
      "aria-selected": !!s,
      role: "option",
      "aria-disabled": !!r,
      children: [
        typeof o == "string" ? /* @__PURE__ */ l(v, { children: o }) : o,
        s && /* @__PURE__ */ l($, { size: "xs", className: m(`${i}-item__icon`) })
      ]
    }
  );
}), L = (t) => f(t) && t?.type === p;
p.displayName = "ListBoxItem";
const I = c.bind(n), C = "purpur-listbox", u = a(
  ({ children: t, ...e }, r) => /* @__PURE__ */ l(
    "ul",
    {
      ...e,
      ref: r,
      className: I(C, e.className),
      role: "listbox",
      children: N.toArray(t).filter(L)
    }
  )
);
u.Item = p;
u.displayName = "ListBox";
export {
  u as L
};
//# sourceMappingURL=listbox-u6__DsLw.mjs.map
