import { jsx as e } from "@emotion/react/jsx-runtime";
import i from "clsx";
import { forwardRef as N } from "react";
import { TEST_PROP_ID as m } from "../../test/constants_no_mock.js";
import { DaysOfMonthPickerRootStyled as n, DaysOfMonthPickerDaysStyled as c, SkeletonDayStyled as O } from "./slots/DaysOfMonthPickerSlots.js";
import { DAYS_OF_MONTH_PICKER_CLASSES as r } from "./constants.js";
import { useDaysOfMonthPicker as h } from "./hooks/useDaysOfMonthPicker/useDaysOfMonthPicker.js";
const u = N((a, o) => {
  const { className: s, dataTestId: t, disabled: y } = a, { days: l, ownerState: d, currentSize: p, isSkeleton: D, renderDay: S } = h(a);
  return D ? /* @__PURE__ */ e(
    n,
    {
      ref: o,
      className: i(s, r.root),
      ownerState: d,
      role: "group",
      "aria-label": "Selector de días del mes",
      ...process.env.NODE_ENV !== "production" ? { [m]: t } : {},
      children: /* @__PURE__ */ e(
        c,
        {
          className: r.days,
          role: "grid",
          "aria-label": "Días del mes",
          children: l.map((f) => /* @__PURE__ */ e(
            O,
            {
              variant: "rounded",
              className: r.skeletonDay,
              ownerState: { size: p }
            },
            f
          ))
        }
      )
    }
  ) : /* @__PURE__ */ e(
    n,
    {
      ref: o,
      className: i(s, r.root),
      ownerState: d,
      role: "group",
      "aria-label": "Selector de días del mes",
      "aria-disabled": y || void 0,
      ...process.env.NODE_ENV !== "production" ? { [m]: t } : {},
      children: /* @__PURE__ */ e(
        c,
        {
          className: r.days,
          role: "grid",
          "aria-label": "Días del mes",
          children: l.map(S)
        }
      )
    }
  );
});
u.displayName = "DaysOfMonthPicker";
export {
  u as DaysOfMonthPicker
};
