import{j as h,k as t}from"./iframe-B4rglaWu.js";import{F as E,E as S}from"./ErrorMessage-DFhVHOBn.js";import{I as j}from"./inputtext.esm-PyaMa37F.js";const I=T=>{const e=h.c(24);let a,o,r,s,i,g;e[0]!==T?({className:a,id:r,label:s,required:g,error:o,...i}=T,e[0]=T,e[1]=a,e[2]=o,e[3]=r,e[4]=s,e[5]=i,e[6]=g):(a=e[1],o=e[2],r=e[3],s=e[4],i=e[5],g=e[6]);const q=!!o;let n;e[7]!==r||e[8]!==i||e[9]!==q?(n=t.jsx(j,{id:r,...i,className:"w-full",invalid:q}),e[7]=r,e[8]=i,e[9]=q,e[10]=n):n=e[10];const y=g?"*":"";let l;e[11]!==r||e[12]!==s||e[13]!==y?(l=t.jsxs("label",{htmlFor:r,children:[s," ",y]}),e[11]=r,e[12]=s,e[13]=y,e[14]=l):l=e[14];let d;e[15]!==n||e[16]!==l?(d=t.jsxs(E,{className:"w-full",children:[n,l]}),e[15]=n,e[16]=l,e[17]=d):d=e[17];let c;e[18]!==o?(c=t.jsx(S,{error:o}),e[18]=o,e[19]=c):c=e[19];let f;return e[20]!==a||e[21]!==d||e[22]!==c?(f=t.jsx(t.Fragment,{children:t.jsxs("div",{className:a,children:[d,c]})}),e[20]=a,e[21]=d,e[22]=c,e[23]=f):f=e[23],f};I.__docgenInfo={description:`Componente de entrada de texto com label flutuante e suporte a mensagens de erro.

Utiliza o InputText do PrimeReact com FloatLabel para criar um campo de texto
estilizado e consistente com o design system da aplicação.

@example
\`\`\`tsx
<UiInputText
  id="nome"
  label="Nome"
  value={nome}
  onChange={(e) => setNome(e.target.value)}
  required
  error={errors.nome?.message}
/>
\`\`\`

@see {@link https://primereact.org/inputtext/ | PrimeReact InputText}`,methods:[],displayName:"UiInputText",props:{id:{required:!0,tsType:{name:"string"},description:"Identificador único do campo, usado para associar o label ao input"},label:{required:!0,tsType:{name:"string"},description:"Texto do label flutuante exibido acima do campo"},className:{required:!1,tsType:{name:"string"},description:"Classes CSS adicionais para o container do componente"},required:{required:!1,tsType:{name:"boolean"},description:"Indica se o campo é obrigatório (adiciona asterisco ao label)"},error:{required:!1,tsType:{name:"string"},description:"Mensagem de erro a ser exibida abaixo do campo"}},composes:["InputTextProps"]};const v={title:"Components/Form/UiInputText",component:I,parameters:{layout:"centered"},tags:["autodocs"],argTypes:{error:{control:"text",description:"Mensagem de erro exibida abaixo do campo"},required:{control:"boolean",description:"Indica se o campo é obrigatório"},disabled:{control:"boolean",description:"Desabilita o campo"}}},m={args:{id:"texto",label:"Texto"}},p={args:{id:"texto-obrigatorio",label:"Nome",required:!0}},u={args:{id:"texto-erro",label:"Email",error:"Email inválido",required:!0}},x={args:{id:"texto-desabilitado",label:"Texto",disabled:!0,value:"Valor desabilitado"}},b={args:{id:"texto-numerico",label:"Somente números",keyfilter:"int"}};m.parameters={...m.parameters,docs:{...m.parameters?.docs,source:{originalSource:`{
  args: {
    id: 'texto',
    label: 'Texto'
  }
}`,...m.parameters?.docs?.source}}};p.parameters={...p.parameters,docs:{...p.parameters?.docs,source:{originalSource:`{
  args: {
    id: 'texto-obrigatorio',
    label: 'Nome',
    required: true
  }
}`,...p.parameters?.docs?.source}}};u.parameters={...u.parameters,docs:{...u.parameters?.docs,source:{originalSource:`{
  args: {
    id: 'texto-erro',
    label: 'Email',
    error: 'Email inválido',
    required: true
  }
}`,...u.parameters?.docs?.source}}};x.parameters={...x.parameters,docs:{...x.parameters?.docs,source:{originalSource:`{
  args: {
    id: 'texto-desabilitado',
    label: 'Texto',
    disabled: true,
    value: 'Valor desabilitado'
  }
}`,...x.parameters?.docs?.source}}};b.parameters={...b.parameters,docs:{...b.parameters?.docs,source:{originalSource:`{
  args: {
    id: 'texto-numerico',
    label: 'Somente números',
    keyfilter: 'int'
  }
}`,...b.parameters?.docs?.source}}};const N=["Default","Required","WithError","Disabled","WithKeyFilter"],R=Object.freeze(Object.defineProperty({__proto__:null,Default:m,Disabled:x,Required:p,WithError:u,WithKeyFilter:b,__namedExportsOrder:N,default:v},Symbol.toStringTag,{value:"Module"}));export{I as U,R as a};
