示例工程 16-shadcn-ui-component-layer

16-shadcn-ui-component-layer/app/src/components/ui/input.tsx

tsx · 0.7 KB

// vendored from shadcn/ui (base style) — input
// source: https://ui.shadcn.com/docs/components/input
// fetched: 2026-11-26 · shadcn CLI 4.23.0 · base-nova
// 本地修改:使用 token 颜色,去掉 shadow 与 ring-offset
import type { ComponentProps } from "react";
import { cn } from "@/lib/utils";

export function Input({ className, ...props }: ComponentProps<"input">) {
  return (
    <input
      className={cn(
        "flex h-9 w-full rounded-card border border-border bg-surface px-3 py-1 text-sm text-text placeholder:text-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
        className,
      )}
      {...props}
    />
  );
}