"use client";
import { jsx as l } from "react/jsx-runtime";
import { c as p } from "./cn-Bhsu1vx2.js";
import { forwardRef as I } from "react";
import { F as k } from "./field-B8xISAuX.js";
import { I as v } from "./vendor-base-ui-Bsg5ebHI.js";
const u = {
  size: {
    xs: {
      classes: "h-5 gap-1 rounded-sm px-1.5 text-xs",
      description: "Extra small input for compact UIs"
    },
    sm: {
      classes: "h-6.5 gap-1 rounded-md px-2 text-xs",
      description: "Small input for secondary fields"
    },
    base: {
      classes: "h-9 gap-1.5 rounded-lg px-3 text-base",
      description: "Default input size"
    },
    lg: {
      classes: "h-10 gap-2 rounded-lg px-4 text-base",
      description: "Large input for prominent fields"
    }
  },
  variant: {
    default: {
      classes: "focus:ring-kumo-ring",
      description: "Default input appearance"
    },
    error: {
      classes: "!ring-kumo-danger focus:ring-kumo-danger",
      description: "Error state for validation failures"
    }
  }
}, c = {
  size: "base",
  variant: "default"
};
function N({
  variant: s = c.variant,
  size: r = c.size,
  parentFocusIndicator: o = !1,
  focusIndicator: t = !1
} = {}) {
  return p(
    // Base styles
    "border-0 bg-kumo-control text-kumo-default ring ring-kumo-line",
    // Disabled state and placeholder styles
    "outline-none placeholder:text-kumo-subtle disabled:text-kumo-subtle",
    // Apply size styles from KUMO_INPUT_VARIANTS
    u.size[r].classes,
    // Apply variant styles from KUMO_INPUT_VARIANTS
    u.variant[s].classes,
    // Focus state handling
    o && "[&:has(:focus-within)]:ring-kumo-ring",
    t && "focus:ring-kumo-ring"
  );
}
const A = I((s, r) => {
  const {
    className: o,
    size: t = "base",
    variant: d = "default",
    label: i,
    labelTooltip: m,
    description: f,
    error: a,
    ...e
  } = s, { required: b } = e;
  if (process.env.NODE_ENV !== "production") {
    const g = !!i, h = !!(e.placeholder && e["aria-label"]), x = !!e["aria-labelledby"];
    !g && !h && !x && console.warn(
      `[Kumo Input]: Input must have an accessible name. Provide either:
  - label prop: <Input label='Email' />
  - placeholder + aria-label: <Input placeholder='Email' aria-label='Email address' />
  - aria-labelledby for custom label association`
    );
  }
  const n = /* @__PURE__ */ l(
    v,
    {
      ref: r,
      className: p(
        N({ size: t, variant: d, focusIndicator: !0 }),
        o
      ),
      ...e
    }
  );
  return i ? /* @__PURE__ */ l(
    k,
    {
      label: i,
      required: b,
      labelTooltip: m,
      description: f,
      error: a ? typeof a == "string" ? { message: a, match: !0 } : a : void 0,
      children: n
    }
  ) : n;
});
A.displayName = "Input";
export {
  A as I,
  u as K,
  N as i
};
//# sourceMappingURL=input-DCzpefuq.js.map
