"use client";
import { jsx as l } from "react/jsx-runtime";
import { c as p } from "./cn-ct4n7r74mh8y0f48.js";
import { forwardRef as I } from "react";
import { F as k } from "./field-csje72m7j9403fj5.js";
import { I as v } from "./vendor-base-ui-ccr5l0ynrievzzv3.js";
const c = {
  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"
    }
  }
}, u = {
  size: "base",
  variant: "default"
};
function N({
  variant: s = u.variant,
  size: r = u.size,
  parentFocusIndicator: o = !1,
  focusIndicator: i = !1
} = {}) {
  return p(
    // Base styles
    "border-0 bg-kumo-control text-kumo-default ring ring-kumo-line",
    // Disabled state and placeholder styles (using vanilla CSS class for Chrome compatibility)
    "kumo-input-placeholder disabled:text-kumo-subtle",
    // Apply size styles from KUMO_INPUT_VARIANTS
    c.size[r].classes,
    // Apply variant styles from KUMO_INPUT_VARIANTS
    c.variant[s].classes,
    // Focus state handling
    o && "[&:has(:focus-within)]:ring-kumo-ring",
    i && "focus:ring-kumo-ring"
  );
}
const A = I((s, r) => {
  const {
    className: o,
    size: i = "base",
    variant: d = "default",
    label: t,
    labelTooltip: m,
    description: f,
    error: a,
    ...e
  } = s, { required: b } = e;
  if (process.env.NODE_ENV !== "production") {
    const g = !!t, 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: i, variant: d, focusIndicator: !0 }),
        o
      ),
      ...e
    }
  );
  return t ? /* @__PURE__ */ l(
    k,
    {
      label: t,
      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,
  c as K,
  N as i
};
//# sourceMappingURL=input-c8jmidy7gdqfiky1.js.map
