import { jsx as G } from "react/jsx-runtime";
import { useState as O, useMemo as u, createElement as C } from "react";
import { c as N, s as z, a as B } from "../tools/tools.js";
import { L as m } from "./list-group-item.js";
const d = function(f) {
  const {
    as: v = "ul",
    className: a,
    dropOldClass: r,
    flush: n,
    horizontal: s,
    itemAction: y,
    numbered: l,
    options: L,
    style: p,
    variables: c,
    variant: o,
    ...b
  } = f, x = (L ?? []).map((t, i) => ({
    ...t,
    id: t.id ?? i
  })), [e] = O(x), g = u(() => {
    const t = N(
      !r && "list-group",
      n && "list-group-flush",
      l && "list-group-numbered",
      s && `list-group-horizontal${typeof s == "boolean" ? "" : "-" + s}`,
      o && `list-group-item-${o}`,
      a
    ), i = z((I, A) => ({ tKey: B(A) }), c, p);
    return {
      className: t,
      style: i
    };
  }, [a, r, n, s, l, p, c, o]), h = u(() => e.some((t) => t.active), [e]);
  return /* @__PURE__ */ G(v, { ...b, ...g, children: e.map((t) => /* @__PURE__ */ C(
    m,
    {
      ...t.props,
      active: t.active,
      disabled: t.disabled,
      flexFill: t.flexFill,
      itemAction: t.itemAction || h || y,
      key: t.id,
      variant: t.variant
    },
    t.item
  )) });
};
d.Item = m;
d.displayName = "BRL.ListGroup";
export {
  d as L
};
//# sourceMappingURL=list-group.js.map
