"use client";
import { jsx as u } from "react/jsx-runtime";
import { c as d } from "./cn-ct4n7r74mh8y0f48.js";
import { forwardRef as v } from "react";
import { F as k } from "./field-lnj619xpe8zjd26r.js";
import { I as N } from "./vendor-base-ui-ie71jahf0czyf58j.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-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"
    }
  }
}, p = {
  size: "base",
  variant: "default"
};
function y({
  variant: e = p.variant,
  size: a = p.size,
  parentFocusIndicator: o = !1,
  focusIndicator: n = !1
} = {}) {
  return d(
    // 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-subtle",
    // Apply size styles from KUMO_INPUT_VARIANTS
    c.size[a].classes,
    // Apply variant styles from KUMO_INPUT_VARIANTS
    c.variant[e].classes,
    // Focus state handling
    o && (e === "error" ? "focus-within:ring-kumo-danger/50 focus-within:ring-[1.5px]" : "focus-within:ring-kumo-focus/50 focus-within:ring-[1.5px]"),
    n && (e === "error" ? "focus:ring-kumo-danger/50 focus:ring-[1.5px]" : "focus:ring-kumo-focus/50 focus:ring-[1.5px]")
  );
}
const E = v((e, a) => {
  const {
    className: o,
    size: n = "base",
    variant: t,
    label: i,
    labelTooltip: f,
    description: m,
    error: r,
    ...s
  } = e;
  process.env.NODE_ENV !== "production" && t === "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 g = t ?? (r ? "error" : "default"), { required: b } = s;
  if (process.env.NODE_ENV !== "production") {
    const x = !!i, h = !!s["aria-label"], I = !!s["aria-labelledby"];
    !x && !h && !I && 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 l = /* @__PURE__ */ u(
    N,
    {
      ref: a,
      className: d(
        y({ size: n, variant: g, focusIndicator: !0 }),
        o
      ),
      ...s
    }
  );
  return i ? /* @__PURE__ */ u(
    k,
    {
      label: i,
      required: b,
      labelTooltip: f,
      description: m,
      error: r ? typeof r == "string" ? { message: r, match: !0 } : r : void 0,
      children: l
    }
  ) : l;
});
E.displayName = "Input";
export {
  E as I,
  c as K,
  y as i
};
//# sourceMappingURL=input-lpa5fc75tgrraafv.js.map
