UNPKG

nextuiq

Version:

NextUIQ is a modern, lightweight, and developer-friendly UI component library for React and Next.js. Built with TypeScript and Tailwind CSS, it offers customizable, accessible, and performance-optimized components with built-in dark mode, theme customizat

2 lines (1 loc) 2.29 kB
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index46.js"),t=require("react"),r=t.forwardRef((({type:r="text",id:s,name:a,placeholder:o,defaultValue:l,onChange:c,className:n="",min:d,max:u,step:h,disabled:i=!1,success:m=!1,error:x=!1,hint:v,label:p,required:b=!1,"aria-label":f,"aria-describedby":g,maxLength:k,minLength:j,pattern:y,readOnly:N=!1,autoComplete:R="off",autoFocus:E=!1,value:q,size:w,...C},I)=>{const F=t.useId(),L=s||F,M=`${L}-hint`;let O=` ${n} h-11 w-full rounded-lg border appearance-none px-4 py-2.5 text-sm shadow-sm \n bg-[oklch(var(--theme-background))] \n text-[oklch(var(--theme-foreground))] \n placeholder:text-[oklch(var(--theme-muted-foreground))] \n focus:outline-none focus:ring-0 focus:ring-[oklch(var(--theme-ring))]`;return O+=i?" text-[oklch(var(--theme-muted-foreground))] border-[oklch(var(--theme-border))] \n bg-[oklch(var(--theme-muted))] cursor-not-allowed":x?" text-[oklch(var(--theme-destructive))] border-[oklch(var(--theme-destructive))] \n focus:ring-[oklch(var(--theme-destructive)/0.2)]":m?" text-[oklch(var(--theme-success))] border-[oklch(var(--theme-success))] \n focus:ring-[oklch(var(--theme-success)/0.2)]":" border-[oklch(var(--theme-border))] \n focus:border-[oklch(var(--theme-ring))]",e.jsxRuntimeExports.jsxs("div",{className:"space-y-1.5",children:[p&&e.jsxRuntimeExports.jsxs("label",{htmlFor:L,className:"text-sm font-medium "+(i?"text-[oklch(var(--theme-muted-foreground))]":"text-[oklch(var(--theme-foreground))]"),children:[p,b&&e.jsxRuntimeExports.jsx("span",{className:"text-[oklch(var(--theme-destructive))] ml-1",children:"*"})]}),e.jsxRuntimeExports.jsxs("div",{className:"relative",children:[e.jsxRuntimeExports.jsx("input",{ref:I,type:r,id:L,name:a,placeholder:o,defaultValue:l,onChange:c,min:d,max:u,step:h,disabled:i,required:b,"aria-invalid":x,"aria-label":f||p,"aria-describedby":v?M:g,className:O,...C}),v&&e.jsxRuntimeExports.jsx("p",{id:M,className:"mt-1.5 text-xs "+(x?"text-[oklch(var(--theme-destructive))]":m?"text-[oklch(var(--theme-success))]":"text-[oklch(var(--theme-muted-foreground))]"),children:v})]})]})}));r.displayName="Input";const s=r;exports.Input=s,exports.default=s;