admin/dist/assets/Input-dc2009a3.js

2 lines
1023 B
JavaScript

import{j as r}from"./vendor-query-a3e439f2.js";import{R as e}from"./vendor-react-ac1483bd.js";import{c as a}from"./vendor-ui-8a3c5c7d.js";import{d as s}from"./index-590deac5.js";const t=e.forwardRef(({label:e,error:t,helperText:d,inputSize:o="md",className:i,id:l,...x},n)=>{const c=a("w-full border rounded-lg transition-all duration-200 focus:outline-none focus:ring-2",{sm:"px-3 py-2 text-sm",md:"px-3 py-3 text-base",lg:"px-4 py-4 text-lg"}[o],t?"border-red-300 focus:border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:border-primary-500 focus:ring-primary-500","bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100","placeholder-gray-500 dark:placeholder-gray-400",i);return r.jsxs("div",{className:"space-y-1",children:[e&&r.jsx(s,{htmlFor:l,children:e}),r.jsx("input",{ref:n,id:l,className:c,...x}),d&&!t&&r.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:d}),t&&r.jsx("p",{className:"text-xs text-red-600 dark:text-red-400",children:t})]})});export{t as I};