import{j as T,k as t,r as S}from"./iframe-B4rglaWu.js";import{C as j}from"./calendar.esm-O4kIknHG.js";import{F as v,E}from"./ErrorMessage-DFhVHOBn.js";import"./preload-helper-PPVm8Dsz.js";import"./button.esm-BWX-wzE5.js";import"./componentbase.esm-O764U3c0.js";import"./index.esm-Bp9biEJw.js";import"./iconbase.esm-CeJUwaxq.js";import"./ripple.esm-Bd7Vm0vw.js";import"./tooltip.esm-C17X5ypA.js";import"./portal.esm-9O3HNf5A.js";import"./index.esm-ykNyILbO.js";import"./index.esm-Dh1FCB31.js";import"./inputtext.esm-PyaMa37F.js";import"./keyfilter.esm-Bl_Obi_0.js";import"./overlayservice.esm-C5VFRSbT.js";const F=s=>{const e=T.c(24);let o,a,r,i,n,p;e[0]!==s?({className:o,id:r,label:i,required:p,error:a,...n}=s,e[0]=s,e[1]=o,e[2]=a,e[3]=r,e[4]=i,e[5]=n,e[6]=p):(o=e[1],a=e[2],r=e[3],i=e[4],n=e[5],p=e[6]);const q=!!a;let d;e[7]!==r||e[8]!==n||e[9]!==q?(d=t.jsx(j,{id:r,...n,className:"w-full",invalid:q}),e[7]=r,e[8]=n,e[9]=q,e[10]=d):d=e[10];const y=p?"*":"";let l;e[11]!==r||e[12]!==i||e[13]!==y?(l=t.jsxs("label",{htmlFor:r,children:[i," ",y]}),e[11]=r,e[12]=i,e[13]=y,e[14]=l):l=e[14];let c;e[15]!==d||e[16]!==l?(c=t.jsxs(v,{className:"w-full",children:[d,l]}),e[15]=d,e[16]=l,e[17]=c):c=e[17];let m;e[18]!==a?(m=t.jsx(E,{error:a}),e[18]=a,e[19]=m):m=e[19];let u;return e[20]!==o||e[21]!==c||e[22]!==m?(u=t.jsx(t.Fragment,{children:t.jsxs("div",{className:o,children:[c,m]})}),e[20]=o,e[21]=c,e[22]=m,e[23]=u):u=e[23],u};F.__docgenInfo={description:`Componente de seleção de data com label flutuante e suporte a mensagens de erro.

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

@example
\`\`\`tsx
<UiCalendar
  id="data-nascimento"
  label="Data de Nascimento"
  value={date}
  onChange={(e) => setDate(e.value)}
  required
  error={errors.dataNascimento?.message}
/>
\`\`\`

@see {@link https://primereact.org/calendar/ | PrimeReact Calendar}`,methods:[],displayName:"UiCalendar",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:["CalendarProps"]};const A={title:"Components/Form/UiCalendar",component:F,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"},showIcon:{control:"boolean",description:"Exibe ícone de calendário"},showTime:{control:"boolean",description:"Permite seleção de hora"},dateFormat:{control:"text",description:"Formato da data (ex: dd/mm/yy)"}},render:s=>{const[e,o]=S.useState(s.value);return t.jsx(F,{...s,value:e,onChange:a=>o(a.value)})}},b={args:{id:"data",label:"Data"}},g={args:{id:"data-obrigatoria",label:"Data de Nascimento",required:!0}},h={args:{id:"data-erro",label:"Data",error:"Data inválida",required:!0}},x={args:{id:"data-icone",label:"Data",showIcon:!0}},f={args:{id:"data-hora",label:"Data e Hora",showTime:!0,hourFormat:"24"}},D={args:{id:"data-desabilitada",label:"Data",disabled:!0}},C={args:{id:"data-formato",label:"Data",dateFormat:"dd/mm/yy"}};b.parameters={...b.parameters,docs:{...b.parameters?.docs,source:{originalSource:`{
  args: {
    id: 'data',
    label: 'Data'
  }
}`,...b.parameters?.docs?.source}}};g.parameters={...g.parameters,docs:{...g.parameters?.docs,source:{originalSource:`{
  args: {
    id: 'data-obrigatoria',
    label: 'Data de Nascimento',
    required: true
  }
}`,...g.parameters?.docs?.source}}};h.parameters={...h.parameters,docs:{...h.parameters?.docs,source:{originalSource:`{
  args: {
    id: 'data-erro',
    label: 'Data',
    error: 'Data inválida',
    required: true
  }
}`,...h.parameters?.docs?.source}}};x.parameters={...x.parameters,docs:{...x.parameters?.docs,source:{originalSource:`{
  args: {
    id: 'data-icone',
    label: 'Data',
    showIcon: true
  }
}`,...x.parameters?.docs?.source}}};f.parameters={...f.parameters,docs:{...f.parameters?.docs,source:{originalSource:`{
  args: {
    id: 'data-hora',
    label: 'Data e Hora',
    showTime: true,
    hourFormat: '24'
  }
}`,...f.parameters?.docs?.source}}};D.parameters={...D.parameters,docs:{...D.parameters?.docs,source:{originalSource:`{
  args: {
    id: 'data-desabilitada',
    label: 'Data',
    disabled: true
  }
}`,...D.parameters?.docs?.source}}};C.parameters={...C.parameters,docs:{...C.parameters?.docs,source:{originalSource:`{
  args: {
    id: 'data-formato',
    label: 'Data',
    dateFormat: 'dd/mm/yy'
  }
}`,...C.parameters?.docs?.source}}};const B=["Default","Required","WithError","WithIcon","WithTime","Disabled","CustomFormat"];export{C as CustomFormat,b as Default,D as Disabled,g as Required,h as WithError,x as WithIcon,f as WithTime,B as __namedExportsOrder,A as default};
