"use client";
import { jsx as d } from "react/jsx-runtime";
import { r as f } from "./resolve-variant-gw6eh7fa4st8ej7m.js";
import { forwardRef as w } from "react";
import { F as E, n as N } from "./field-bmglk138wa8bf3ei.js";
import { I as y } from "./vendor-base-ui-elpbzr8xeffrz4h2.js";
import { c as g } from "./vendor-styling-ofvnbcuht98q88oo.js";
const m = {
  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-focus/50 focus:ring-[1.5px]",
      description: "Default input appearance"
    },
    error: {
      classes: "!ring-kumo-danger focus:ring-kumo-danger/50 focus:ring-[1.5px]",
      description: "Error state for validation failures"
    }
  }
}, a = {
  size: "base",
  variant: "default"
};
function z({
  variant: r = a.variant,
  size: o = a.size,
  parentFocusIndicator: s = !1,
  focusIndicator: n = !1
} = {}) {
  return g(
    // Base styles
    "border-0 bg-kumo-control text-kumo-default ring ring-kumo-line outline-none focus:outline-none",
    // Disabled state and placeholder styles (using vanilla CSS class for Chrome compatibility)
    "kumo-input-placeholder disabled:text-kumo-disabled",
    // Apply size styles from KUMO_INPUT_VARIANTS
    f(
      m.size,
      o,
      a.size
    ).classes,
    // Apply variant styles from KUMO_INPUT_VARIANTS
    f(
      m.variant,
      r,
      a.variant
    ).classes,
    // Focus state handling
    s && (r === "error" ? "focus-within:ring-kumo-danger/50 focus-within:ring-[1.5px]" : "focus-within:ring-kumo-focus/50 focus-within:ring-[1.5px]"),
    n && (r === "error" ? "focus:ring-kumo-danger/50 focus:ring-[1.5px]" : "focus:ring-kumo-focus/50 focus:ring-[1.5px]")
  );
}
const A = w((r, o) => {
  const {
    className: s,
    size: n = "base",
    variant: l,
    label: i,
    labelTooltip: b,
    description: u,
    error: t,
    passwordManagerIgnore: p = !1,
    ...e
  } = r;
  process.env.NODE_ENV !== "production" && l === "error" && console.warn(
    '[Kumo Input]: variant="error" is deprecated. Error styling is now automatically applied when the `error` prop is truthy. Simply remove the variant prop and pass an error message instead.'
  );
  const x = l ?? (t ? "error" : "default"), { required: h } = e;
  if (process.env.NODE_ENV !== "production") {
    const I = !!i, v = !!e["aria-label"], k = !!e["aria-labelledby"];
    !I && !v && !k && console.warn(
      `[Kumo Input]: Input must have an accessible name. Provide either:
  - label prop: <Input label='Email' />
  - aria-label: <Input aria-label='Email address' />
  - aria-labelledby for custom label association`
    );
  }
  const c = /* @__PURE__ */ d(
    y,
    {
      ref: o,
      className: g(
        z({ size: n, variant: x, focusIndicator: !0 }),
        p && "keeper-ignore",
        s
      ),
      ...p ? {
        "data-1p-ignore": "true",
        "data-bwignore": "true",
        "data-form-type": "other",
        "data-lpignore": "true"
      } : {},
      ...e
    }
  );
  return i || t || u ? /* @__PURE__ */ d(
    E,
    {
      label: i,
      required: h,
      labelTooltip: b,
      description: u,
      error: N(t),
      children: c
    }
  ) : c;
});
A.displayName = "Input";
export {
  A as I,
  m as K,
  z as i
};
//# sourceMappingURL=input-ckl5misj0jd9cu5r.js.map
