@undp/design-system-react
Version:
React based design system for UNDP
1 lines • 2 kB
Source Map (JSON)
{"version":3,"file":"Input.cjs","names":[],"sources":["../src/components/ui/input.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nconst inputVariants = cva(\n 'w-full h-auto bg-background rounded-base text-content-primary text-base transition-colors file:border-0 file:bg-transparent file:font-regular file:text-content-primary focus-visible:outline-hidden focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-disabled placeholder:text-content-placeholder',\n {\n variants: {\n variant: {\n light: 'border border-stroke',\n normal: 'border-2 border-foreground',\n },\n rounded: {\n base: 'rounded',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n xl: 'rounded-xl',\n '2xl': 'rounded-2xl',\n full: 'rounded-full',\n },\n inputSize: {\n sm: 'px-2.5 py-1',\n base: 'p-2.5',\n },\n },\n defaultVariants: {\n inputSize: 'base',\n variant: 'normal',\n rounded: 'base',\n },\n },\n);\n\nconst Input = React.forwardRef<\n HTMLInputElement,\n React.InputHTMLAttributes<HTMLInputElement> & VariantProps<typeof inputVariants>\n>(({ className, inputSize, variant, ...props }, ref) => {\n return (\n <input {...props} ref={ref} className={cn(inputVariants({ inputSize, variant }), className)} />\n );\n});\nInput.displayName = 'Input';\n\nexport { Input };\n"],"mappings":"8PAKA,IAAM,EAAgB,EAAA,EACpB,uTACA,CACE,SAAU,CACR,QAAS,CACP,MAAO,uBACP,OAAQ,4BACV,EACA,QAAS,CACP,KAAM,UACN,GAAI,aACJ,GAAI,aACJ,GAAI,aACJ,GAAI,aACJ,MAAO,cACP,KAAM,cACR,EACA,UAAW,CACT,GAAI,cACJ,KAAM,OACR,CACF,EACA,gBAAiB,CACf,UAAW,OACX,QAAS,SACT,QAAS,MACX,CACF,CACF,EAEM,EAAQ,EAAA,QAAM,YAGjB,CAAE,YAAW,YAAW,UAAS,GAAG,GAAS,KAE5C,EAAA,EAAA,IAAA,CAAC,QAAD,CAAO,GAAI,EAAY,MAAK,UAAW,EAAA,EAAG,EAAc,CAAE,YAAW,SAAQ,CAAC,EAAG,CAAS,CAAI,CAAA,CAEjG,EACD,EAAM,YAAc"}