"use client"; import React, { forwardRef } from "react"; import { cva, type VariantProps } from "class-variance-authority"; import { cn } from "@/utils/cn"; /** * Select 下拉选择框组件 * * Design System 中的下拉选择框组件。 * * @example * ```tsx * * ``` */ /** * Select 变体样式 */ const selectVariants = cva( // 基础样式 "flex w-full appearance-none items-center justify-between rounded-md border px-3 py-2 pr-8 text-base transition-all duration-250 placeholder:text-gray-400 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", { variants: { variant: { default: "border-b-2 border-gray-300 bg-transparent rounded-t-md", bordered: "border-gray-300 bg-white", filled: "border-transparent bg-gray-100", }, size: { sm: "h-9 px-3 text-sm", md: "h-10 px-4 text-base", lg: "h-12 px-5 text-lg", }, error: { true: "border-error-500 focus-visible:ring-error-500", false: "", }, }, compoundVariants: [ { variant: "filled", error: true, className: "bg-error-50", }, ], defaultVariants: { variant: "default", size: "md", error: false, }, } ); export type SelectVariant = VariantProps["variant"]; export type SelectSize = VariantProps["size"]; export interface SelectProps extends Omit, "size">, VariantProps {} /** * Select 下拉选择框组件 */ export const Select = forwardRef( ( { variant = "default", size = "md", error = false, className, children, ...props }, ref ) => { return (
{/* 下拉箭头图标 */}
); } ); Select.displayName = "Select";