@s_mart/form 10.0.0-beta.13 → 10.0.0-beta.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.mjs +6 -6
  2. package/package.json +6 -6
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import{useController as qe,useFormContext as Ge}from"react-hook-form";import{Checkbox as Ne,FormControlLabel as Ue}from"@mui/material";import{Indicator as Ee}from"@s_mart/core";import{useFormState as Be}from"react-hook-form";var R=(e,o)=>o.replace(/[[\]]/g,"").split(".").reduce((l,p)=>l?.[p],e);import{jsx as Me}from"react/jsx-runtime";var De=({name:e,disableIcon:o,control:r})=>{let l=Be({control:r,name:e}),p=R(l?.errors,e);return p?Me(Ee,{severity:"error",icon:o?!1:void 0,children:p?.message}):null},C=De;import{Typography as me}from"@mui/material";import{toRem as Ae}from"@s_mart/utils";import{jsx as ue,jsxs as $e}from"react/jsx-runtime";var Oe=({label:e,required:o,regular:r})=>$e("span",{style:{display:"flex",alignItems:"center",gap:Ae(2)},children:[ue(me,{variant:"caption",style:{display:"flex",alignItems:"center"},sx:{fontWeight:r?400:700},children:e}),o&&ue(me,{variant:"caption",color:"error",sx:{fontWeight:900},children:"*"})]}),x=Oe;var P=class extends Error{constructor(o){super(`O componente ${o} precisa de um control para funcionar. Passe o control como prop ou coloque o componente dentro de um <Form />`),this.name="FormComponentPrecisaDeControl"}};import{memo as ze}from"react";var I=ze;import{jsx as Q,jsxs as Ke}from"react/jsx-runtime";var _e=({name:e,rules:o,defaultValue:r,shouldUnregister:l,control:p,label:u,labelPlacement:f,required:s,disableIconError:b,onChange:y,...S})=>{let m=Ge()?.control,c=p??m;if(!c)throw new P("Checkbox");let{field:n}=qe({control:c,name:e,rules:o,defaultValue:r,shouldUnregister:l});return Ke("span",{children:[Q(Ue,{control:Q(Ne,{checked:!!n.value,value:n.value??"",defaultValue:n.value,onChange:(d,w)=>{n.onChange(d,w),y?.(d,w)},...S},e),label:Q(x,{label:u,required:s,regular:!0}),labelPlacement:f||"end"}),Q(C,{name:e,disableIcon:b,control:c})]})},He=I(_e);import{forwardRef as je,useCallback as eo,useState as oo}from"react";import{useController as to,useFormContext as ro,useFormState as lo}from"react-hook-form";import io from"lodash-es/isObject";import no from"lodash-es/isEmpty";import ao from"lodash-es/isEqual";import{Autocomplete as po,TextField as so,Divider as ye,Button as mo}from"@mui/material";import{LIcon as re}from"@s_mart/core";import{linePlus as Fe,linePen as uo}from"@s_mart/solid-icons";import{toRem as xe}from"@s_mart/utils";import{css as We,styled as Ye}from"@mui/material";import{toRem as Z}from"@s_mart/utils";var fe=We`
1
+ import{useController as qe,useFormContext as Ge}from"react-hook-form";import{Checkbox as Ne,FormControlLabel as Ue}from"@mui/material";import{Indicator as Ee}from"@s_mart/core";import{useFormState as Be}from"react-hook-form";var R=(e,o)=>o.replace(/[[\]]/g,"").split(".").reduce((l,s)=>l?.[s],e);import{jsx as Me}from"react/jsx-runtime";var De=({name:e,disableIcon:o,control:r})=>{let l=Be({control:r,name:e}),s=R(l?.errors,e);return s?Me(Ee,{severity:"error",icon:o?!1:void 0,children:s?.message}):null},C=De;import{Typography as me}from"@mui/material";import{toRem as Ae}from"@s_mart/utils";import{jsx as ue,jsxs as $e}from"react/jsx-runtime";var Oe=({label:e,required:o,regular:r})=>$e("span",{style:{display:"flex",alignItems:"center",gap:Ae(2)},children:[ue(me,{variant:"caption",style:{display:"flex",alignItems:"center"},sx:{fontWeight:r?400:700},children:e}),o&&ue(me,{variant:"caption",color:"error",sx:{fontWeight:900},children:"*"})]}),x=Oe;var P=class extends Error{constructor(o){super(`O componente ${o} precisa de um control para funcionar. Passe o control como prop ou coloque o componente dentro de um <Form />`),this.name="FormComponentPrecisaDeControl"}};import{memo as ze}from"react";var I=ze;import{jsx as Q,jsxs as Ke}from"react/jsx-runtime";var _e=({name:e,rules:o,defaultValue:r,shouldUnregister:l,control:s,label:u,labelPlacement:f,required:p,disableIconError:b,onChange:y,...S})=>{let m=Ge()?.control,c=s??m;if(!c)throw new P("Checkbox");let{field:n}=qe({control:c,name:e,rules:o,defaultValue:r,shouldUnregister:l});return Ke("span",{children:[Q(Ue,{control:Q(Ne,{checked:!!n.value,value:n.value??"",defaultValue:n.value,onChange:(d,w)=>{n.onChange(d,w),y?.(d,w)},...S},e),label:Q(x,{label:u,required:p,regular:!0}),labelPlacement:f||"end"}),Q(C,{name:e,disableIcon:b,control:c})]})},He=I(_e);import{forwardRef as je,useCallback as eo,useState as oo}from"react";import{useController as to,useFormContext as ro,useFormState as lo}from"react-hook-form";import io from"lodash-es/isObject";import no from"lodash-es/isEmpty";import ao from"lodash-es/isEqual";import{Autocomplete as so,TextField as po,Divider as ye,Button as mo}from"@mui/material";import{LIcon as re}from"@s_mart/core";import{linePlus as Fe,linePen as uo}from"@s_mart/solid-icons";import{toRem as xe}from"@s_mart/utils";import{css as We,styled as Ye}from"@mui/material";import{toRem as Z}from"@s_mart/utils";var fe=We`
2
2
  display: flex;
3
3
  align-items: center;
4
4
  justify-content: center;
@@ -49,22 +49,22 @@ import{useController as qe,useFormContext as Ge}from"react-hook-form";import{Che
49
49
  }
50
50
  }
51
51
  }
52
- `;import{Tooltip as Je}from"@mui/material";import{LIcon as Xe}from"@s_mart/core";import{lineInfoCircle as Qe}from"@s_mart/solid-icons";import{jsx as te}from"react/jsx-runtime";var Ze=({title:e})=>te(Je,{title:e,placement:"top",children:te("div",{style:{width:"fit-content"},children:te(Xe,{icon:Qe,color:"#757575"})})}),_=Ze;import{Fragment as le,jsx as V,jsxs as M}from"react/jsx-runtime";import{createElement as yo}from"react";function fo(e){let{name:o,rules:r,defaultValue:l,shouldUnregister:p,control:u,label:f,required:s,options:b,footer:y,showCreatableButton:S=!0,showEditableButton:m,onEditOption:c,onCreateOption:n,getOptionKey:d,getOptionLabel:w,getOptionAfterLabel:g,multiple:E,info:T,noOptionsText:i,onChange:h,onInputChange:O,placeholder:$,...F}=e,[U,B]=oo(""),a=ro()?.control,t=u??a;if(!t)throw new P("CreatableV2");let L=lo({control:t,name:o}),z=R(L.errors,o),J=!S||F.disabled,{field:Y}=to({name:o,control:t,rules:r,defaultValue:l,shouldUnregister:p}),Ie=k=>{let v=0;return e.slotProps?.textField?.slotProps?.input||(v+=2.5),J||(v+=2.56,se(k)&&(v+=2.56)),!F.disableClearable&&!F.disabled&&(v+=1.3),`${v}rem`},se=k=>F.disabled?!1:m&&io(k)&&!no(k),we=()=>F.disabled?!1:S,de=eo(()=>{typeof n<"u"&&(n(U),B(""))},[U,n]),Le=()=>{c?.(Y.value)};return M("div",{style:{display:"flex",flexDirection:"column"},children:[M("div",{style:{display:"flex"},children:[f&&V(x,{label:f,required:s}),T&&V(_,{title:T})]}),V(ce,{children:V(po,{fullWidth:!0,onChange:(k,v)=>{B(""),Y.onChange(v),h?.(v)},onInputChange:(k,v,H)=>{H==="input"&&(B(v),O?.(v))},slotProps:{...F.slotProps,listbox:{component:je(function(v,H){return M(le,{children:[V("ul",{...v,ref:H}),typeof y<"u"?M("div",{...v,children:[V("div",{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},children:V(ye,{})}),y()]},"creatable-footer"):null]})})}},value:Y.value,options:b,multiple:E,readOnly:F.disabled,noOptionsText:M(le,{children:[i||"Nenhuma op\xE7\xE3o encontrada",!J&&M(mo,{sx:{justifyContent:"flex-start",padding:`${xe(6)} ${xe(-16)}`,margin:0},fullWidth:!0,onClick:de,variant:"text",startIcon:V(re,{icon:Fe}),children:["Adicionar ",`"${U}"`]}),typeof y<"u"&&M(le,{children:[V("div",{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},children:V(ye,{})}),y()]})]}),isOptionEqualToValue:(k,v)=>ao(k,v),getOptionLabel:w,getOptionKey:d,renderOption:typeof g=="function"?(k,v)=>{let H=g(v),Re=d(v);return yo("li",{...k,key:Re},M("div",{style:{display:"flex",flexDirection:"column",flex:1},children:[V("span",{children:w(v)}),typeof H=="string"?V("span",{children:H}):H]}))}:void 0,...F,sx:{"& div.MuiInputBase-root":{paddingRight:`${Ie(Y.value)} !important`},...F.sx},onBlur:k=>{F?.onBlur?.(k),B("")},renderInput:k=>V(so,{placeholder:$,...k,error:!!z,...e.slotProps?.textField,slotProps:{input:{...k.InputProps,...e.slotProps?.textField?.slotProps?.input,inputRef:Y.ref,endAdornment:M("div",{className:"endAdornments",children:[k.InputProps.endAdornment,e.slotProps?.textField?.slotProps?.input?.endAdornment??null,se(Y.value)?M("div",{className:"editable",children:[V("div",{className:"divider"}),V("div",{className:"button",onKeyUp:Le,children:V(re,{icon:uo,size:"24px",removeMargin:!0})})]}):null,we()&&M("div",{className:"creatable",children:[V("div",{className:"divider"}),V("div",{className:"button",onKeyUp:de,children:V(re,{icon:Fe,size:"24px",removeMargin:!0})})]})]})}}})},o)}),V(C,{name:o,control:t})]})}var co=I(fo);import{Stack as bo,TextField as go}from"@mui/material";import{AdapterDayjs as vo}from"@mui/x-date-pickers/AdapterDayjs";import{DatePicker as Co}from"@mui/x-date-pickers/DatePicker";import{LocalizationProvider as Vo}from"@mui/x-date-pickers/LocalizationProvider";import{ptBR as So}from"@mui/x-date-pickers/locales/ptBR";import{composeValidators as To,date as he}from"@s_mart/rules";import ko from"dayjs/locale/pt-br";import{useController as Io,useFormContext as wo,useFormState as Lo}from"react-hook-form";import{IconButton as Fo,styled as xo}from"@mui/material";import{toRem as q}from"@s_mart/utils";var Po=e=>{switch(e){case"small":return q(16);case"large":return q(24);default:return q(20)}},ho=e=>{switch(e){case"small":return`${q(2)} ${q(8)}`;case"large":return`${q(10)}`;default:return`${q(6)} ${q(8)}`}},Pe=xo(Fo)`
52
+ `;import{Tooltip as Je}from"@mui/material";import{LIcon as Xe}from"@s_mart/core";import{lineInfoCircle as Qe}from"@s_mart/solid-icons";import{jsx as te}from"react/jsx-runtime";var Ze=({title:e})=>te(Je,{title:e,placement:"top",children:te("div",{style:{width:"fit-content"},children:te(Xe,{icon:Qe,color:"#757575"})})}),_=Ze;import{Fragment as le,jsx as V,jsxs as M}from"react/jsx-runtime";import{createElement as yo}from"react";function fo(e){let{name:o,rules:r,defaultValue:l,shouldUnregister:s,control:u,label:f,required:p,options:b,footer:y,showCreatableButton:S=!0,showEditableButton:m,onEditOption:c,onCreateOption:n,getOptionKey:d,getOptionLabel:w,getOptionAfterLabel:g,multiple:E,info:T,noOptionsText:i,onChange:h,onInputChange:O,placeholder:$,...F}=e,[N,B]=oo(""),a=ro()?.control,t=u??a;if(!t)throw new P("CreatableV2");let L=lo({control:t,name:o}),U=R(L.errors,o),J=!S||F.disabled,{field:Y}=to({name:o,control:t,rules:r,defaultValue:l,shouldUnregister:s}),Ie=k=>{let v=0;return e.slotProps?.textField?.slotProps?.input||(v+=2.5),J||(v+=2.56,pe(k)&&(v+=2.56)),!F.disableClearable&&!F.disabled&&(v+=1.3),`${v}rem`},pe=k=>F.disabled?!1:m&&io(k)&&!no(k),we=()=>F.disabled?!1:S,de=eo(()=>{typeof n<"u"&&(n(N),B(""))},[N,n]),Le=()=>{c?.(Y.value)};return M("div",{style:{display:"flex",flexDirection:"column"},children:[M("div",{style:{display:"flex"},children:[f&&V(x,{label:f,required:p}),T&&V(_,{title:T})]}),V(ce,{children:V(so,{fullWidth:!0,onChange:(k,v)=>{B(""),Y.onChange(v),h?.(v)},onInputChange:(k,v,H)=>{H==="input"&&(B(v),O?.(v))},slotProps:{...F.slotProps,listbox:{component:je(function(v,H){return M(le,{children:[V("ul",{...v,ref:H}),typeof y<"u"?M("div",{...v,children:[V("div",{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},children:V(ye,{})}),y()]},"creatable-footer"):null]})})}},value:Y.value,options:b,multiple:E,readOnly:F.disabled,noOptionsText:M(le,{children:[i||"Nenhuma op\xE7\xE3o encontrada",!J&&M(mo,{sx:{justifyContent:"flex-start",padding:`${xe(6)} ${xe(-16)}`,margin:0},fullWidth:!0,onClick:de,variant:"text",startIcon:V(re,{icon:Fe}),children:["Adicionar ",`"${N}"`]}),typeof y<"u"&&M(le,{children:[V("div",{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},children:V(ye,{})}),y()]})]}),isOptionEqualToValue:(k,v)=>ao(k,v),getOptionLabel:w,getOptionKey:d,renderOption:typeof g=="function"?(k,v)=>{let H=g(v),Re=d(v);return yo("li",{...k,key:Re},M("div",{style:{display:"flex",flexDirection:"column",flex:1},children:[V("span",{children:w(v)}),typeof H=="string"?V("span",{children:H}):H]}))}:void 0,...F,sx:{"& div.MuiInputBase-root":{paddingRight:`${Ie(Y.value)} !important`},...F.sx},onBlur:k=>{F?.onBlur?.(k),B("")},renderInput:k=>V(po,{placeholder:$,...k,error:!!U,...e.slotProps?.textField,slotProps:{input:{...k.InputProps,...e.slotProps?.textField?.slotProps?.input,inputRef:Y.ref,endAdornment:M("div",{className:"endAdornments",children:[k.InputProps.endAdornment,e.slotProps?.textField?.slotProps?.input?.endAdornment??null,pe(Y.value)?M("div",{className:"editable",children:[V("div",{className:"divider"}),V("div",{className:"button",onKeyUp:Le,children:V(re,{icon:uo,size:"24px",removeMargin:!0})})]}):null,we()&&M("div",{className:"creatable",children:[V("div",{className:"divider"}),V("div",{className:"button",onKeyUp:de,children:V(re,{icon:Fe,size:"24px",removeMargin:!0})})]})]})}}})},o)}),V(C,{name:o,control:t})]})}var co=I(fo);import{Stack as bo,TextField as go}from"@mui/material";import{AdapterDayjs as vo}from"@mui/x-date-pickers/AdapterDayjs";import{DatePicker as Co}from"@mui/x-date-pickers/DatePicker";import{LocalizationProvider as Vo}from"@mui/x-date-pickers/LocalizationProvider";import{ptBR as So}from"@mui/x-date-pickers/locales/ptBR";import{composeValidators as To,date as he}from"@s_mart/rules";import ko from"dayjs/locale/pt-br";import{useController as Io,useFormContext as wo,useFormState as Lo}from"react-hook-form";import{IconButton as Fo,styled as xo}from"@mui/material";import{toRem as z}from"@s_mart/utils";var Po=e=>{switch(e){case"small":return z(16);case"large":return z(24);default:return z(20)}},ho=e=>{switch(e){case"small":return`${z(2)} ${z(8)}`;case"large":return`${z(10)}`;default:return`${z(6)} ${z(8)}`}},Pe=xo(Fo)`
53
53
  margin: 0px;
54
54
 
55
55
  padding: ${({size:e})=>ho(e)};
56
- border-radius: 0 ${q(4)} ${q(4)} 0;
56
+ border-radius: 0 ${z(4)} ${z(4)} 0;
57
57
 
58
58
  svg {
59
59
  width: ${({size:e})=>Po(e)} !important;
60
60
  }
61
- `;import{jsx as j,jsxs as Do}from"react/jsx-runtime";import{createElement as Bo}from"react";var Ro=({rules:e,name:o,defaultValue:r,shouldUnregister:l,control:p,datePickerProps:u,label:f,required:s,placeholder:b,disabled:y,disableIconError:S,...m})=>{let c=wo()?.control,n=p??c;if(!n)throw new P("DatePicker");let d=Lo({control:n,name:o}),w=R(d.errors,o),g=u?.format||"DD/MM/YYYY",E=e?To([he(g),e]):he(g),{field:T}=Io({control:n,name:o,rules:E,defaultValue:r,shouldUnregister:l});return j(Vo,{dateAdapter:vo,adapterLocale:ko,localeText:So.components.MuiLocalizationProvider.defaultProps.localeText,children:Do(bo,{children:[f&&j(x,{label:f,required:s}),Bo(Co,{...u,key:o,value:T.value??null,format:g,onChange:(i,h)=>{T.onChange(i,h),u?.onChange?.(i,h)},disabled:y,slots:{textField:go,openPickerButton:i=>j(Pe,{...i,size:m.size})},slotProps:{textField:i=>({variant:"outlined",...i,error:!!w,...m,inputProps:{...i.inputProps,placeholder:b||i.inputProps?.placeholder},InputProps:{...i.InputProps,inputRef:h=>{T.ref(h),typeof i.inputRef=="function"&&i.inputRef(h)}}})}}),j(C,{name:o,disableIcon:S,control:n})]})})},Eo=I(Ro);import{FormProvider as Mo}from"react-hook-form";import{jsx as be}from"react/jsx-runtime";function Ao({children:e,style:o,onSubmit:r,...l}){return be(Mo,{...l,children:be("form",{onSubmit:p=>{p.preventDefault(),p.stopPropagation(),r(p)},style:o,children:e})})}var ie=Ao;import{useEffect as Oo}from"react";import{useForm as $o}from"react-hook-form";import{zodResolver as zo}from"@hookform/resolvers/zod";var qo=({disableDefaultValuesUpdate:e,onSubmit:o,...r})=>{let l=$o({...r,resolver:r.schema&&zo(r.schema)});return Oo(()=>{e||l.reset(r.defaultValues)},[r.defaultValues,l.reset]),{...l,onSubmit:l.handleSubmit(p=>o(p,l))}},ne=qo;import{jsx as Uo}from"react/jsx-runtime";function Go({children:e,style:o,...r}){let l=ne(r);return Uo(ie,{...l,style:o,children:typeof e=="function"?e(l):e})}var No=Go;import{RadioGroup as _o,Stack as Ho}from"@mui/material";import{useController as Ko,useFormContext as Wo}from"react-hook-form";import{jsx as ae,jsxs as Xo}from"react/jsx-runtime";var Yo=({name:e,rules:o,defaultValue:r,shouldUnregister:l,control:p,label:u,required:f,children:s,orientation:b="row",disableIconError:y,...S})=>{let m=Wo()?.control,c=p??m;if(!c)throw new P("RadioGroup");let{field:n}=Ko({control:c,name:e,rules:o,defaultValue:r,shouldUnregister:l});return Xo(Ho,{children:[u&&ae(x,{label:u,required:f}),ae(_o,{value:n.value||"",name:e,...S,onChange:d=>{S?.onChange?.(d,d.target?.value),n.onChange(d)},style:{display:"flex",flexDirection:b},children:s},e),ae(C,{name:e,disableIcon:y,control:c})]})},Jo=Yo;import{FormControlLabel as Qo,Grid2 as Zo,Radio as jo}from"@mui/material";import{jsx as ee}from"react/jsx-runtime";var et=({label:e,labelPlacement:o,...r})=>ee(Zo,{sx:{display:"flex",flexDirection:"column"},children:ee(Qo,{control:ee(jo,{...r}),label:ee(x,{label:e}),labelPlacement:o||"end"})}),ot=et;import{Autocomplete as tt,Divider as ge,TextField as rt}from"@mui/material";import lt from"lodash-es/isEqual";import{forwardRef as it}from"react";import{useController as nt,useFormContext as at,useFormState as pt}from"react-hook-form";import{Fragment as pe,jsx as D,jsxs as K}from"react/jsx-runtime";import{createElement as mt}from"react";var st=e=>{let{name:o,rules:r,defaultValue:l,shouldUnregister:p,control:u,label:f,required:s,options:b,textFieldProps:y,noOptionsText:S,footer:m,multiple:c,info:n,placeholder:d,onChange:w,onInputChange:g,getOptionAfterLabel:E,getOptionLabel:T,getOptionKey:i,...h}=e,O=at()?.control,$=u??O;if(!$)throw new P("SearchableV2");let F=pt({control:$,name:o}),U=R(F.errors,o),{field:B}=nt({name:o,control:$,rules:r,defaultValue:l,shouldUnregister:p});return K("div",{style:{display:"flex",flexDirection:"column"},children:[K("div",{style:{display:"flex"},children:[f&&D(x,{label:f,required:s}),n&&D(_,{title:n})]}),D(tt,{onChange:(a,t)=>{B.onChange(t),w?.(t)},onInputChange:(a,t,L)=>{L==="input"&&g?.(t)},value:B.value,options:b,multiple:c,readOnly:h.disabled,slotProps:{...h.slotProps,listbox:{component:it(function(t,L){return K(pe,{children:[D("ul",{...t,ref:L}),typeof m<"u"?K("div",{...t,children:[D("div",{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},children:D(ge,{})}),m()]},"searchable-footer"):null]})})}},noOptionsText:K(pe,{children:[S||"Nenhuma op\xE7\xE3o encontrada",typeof m<"u"?K(pe,{children:[D("div",{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},children:D(ge,{})}),m()]}):null]}),isOptionEqualToValue:(a,t)=>lt(a,t),getOptionLabel:T,getOptionKey:i,renderOption:typeof E=="function"?(a,t)=>{let L=E(t),z=i(t);return mt("li",{...a,key:z},K("div",{style:{display:"flex",flexDirection:"column",flex:1},children:[D("span",{children:T(t)}),typeof L=="string"?D("span",{children:L}):L]}))}:void 0,...h,renderInput:a=>D(rt,{error:!!U,placeholder:d,...a,...y,inputRef:B.ref})},o),D(C,{name:o,control:$})]})},dt=I(st);import{useState as ct}from"react";import{useController as yt,useFormContext as Ft,useFormState as xt}from"react-hook-form";import{IconButton as Pt,LIcon as ht}from"@s_mart/core";import{lineTimes as bt}from"@s_mart/regular-icons";import{colorPalette as gt}from"@s_mart/tokens";import{Select as vt,MenuItem as Ct,Divider as Vt}from"@mui/material";import{colorPalette as ut}from"@s_mart/tokens";import{jsx as ft}from"react/jsx-runtime";var ve=({value:e,placeholder:o,getOptionLabel:r})=>e===null||e?.length===0?ft("p",{style:{color:ut.neutral[100]},children:o}):r(e);import{Fragment as kt,jsx as A,jsxs as W}from"react/jsx-runtime";var St=e=>{let{name:o,rules:r,defaultValue:l,shouldUnregister:p,control:u,label:f,required:s,options:b,placeholder:y,clearable:S,info:m,footer:c,onChange:n,variant:d="outlined",getOptionKey:w,getOptionLabel:g,getOptionAfterLabel:E,getOptionIcon:T,...i}=e,h=Ft()?.control,O=u??h,[$,F]=ct(!1);if(!O)throw new P("SelectV2");let U=xt({control:O,name:o}),B=R(U.errors,o),{field:a}=yt({control:O,name:o,rules:r,defaultValue:l,shouldUnregister:p});return W("div",{style:{display:"flex",flexDirection:"column"},children:[W("div",{style:{display:"flex"},children:[f&&A(x,{label:f,required:s}),m&&A(_,{title:m})]}),W(vt,{open:$,onOpen:()=>F(!0),onClose:()=>F(!1),displayEmpty:!!y,variant:d,autoComplete:"off",value:a.value||null,renderValue:t=>A(ve,{getOptionLabel:g,placeholder:y,value:t}),onChange:t=>{a.onChange(t.target.value),n?.(t.target.value)},error:!!B,size:i.size||"medium",inputRef:a.ref,...i,endAdornment:W(kt,{children:[i.endAdornment,!!(S&&a.value)&&A(Pt,{variant:"text",color:"neutral",size:"small",sx:{borderRadius:"50%",position:"absolute",right:"2rem"},style:{padding:0},"aria-label":"Limpar",title:"Limpar",onClick:()=>{a.onChange(null),n?.(null)},children:A(ht,{icon:bt,color:gt.neutral[100],size:"25px",removeMargin:!0})})]}),children:[b.map(t=>{let L=w(t),z=g(t),J=T?.(t);return A(Ct,{value:L??z,children:W("div",{style:{display:"flex",flexDirection:"column",flex:1},children:[J!==void 0?W("div",{style:{display:"flex",alignItems:"center"},children:[J,z]}):z,A("span",{children:E?.(t)??null})]})},L)}),c!==void 0&&W("div",{children:[A("div",{style:{padding:"8px 16px"},children:A(Vt,{})},"footer-divider"),A("div",{children:c({closeSelect:()=>F(!1)})},"footer-content")]},"footer")]},o),A(C,{name:o,control:O})]})},Tt=I(St);import{useController as It,useFormContext as wt}from"react-hook-form";import{Slider as Lt}from"@mui/material";import{jsx as Bt}from"react/jsx-runtime";var Rt=({name:e,rules:o,defaultValue:r,shouldUnregister:l,control:p,...u})=>{let f=wt()?.control,s=p??f;if(!s)throw new P("Slider");let{field:b}=It({control:s,name:e,rules:o,defaultValue:r,shouldUnregister:l});return Bt(Lt,{value:b.value||u?.min||0,onChange:b.onChange,valueLabelDisplay:"auto",...u},e)},Et=Rt;import{FormControlLabel as Dt,Stack as Mt,Switch as At}from"@mui/material";import{useController as Ot,useFormContext as $t}from"react-hook-form";import{jsx as oe,jsxs as Gt}from"react/jsx-runtime";var zt=({name:e,rules:o,defaultValue:r,shouldUnregister:l,control:p,label:u,labelPlacement:f,disableIconError:s,onChange:b,...y})=>{let S=$t()?.control,m=p??S;if(!m)throw new P("Switch");let{field:c}=Ot({control:m,name:e,rules:o,defaultValue:r,shouldUnregister:l});return Gt(Mt,{children:[oe(Dt,{control:oe(At,{value:c.value??"",checked:c.value??!1,onChange:(n,d)=>{c.onChange(n,d),b?.(n,d)},...y},e),label:oe(x,{label:u}),labelPlacement:f||"end"}),oe(C,{name:e,disableIcon:s,control:m})]})},qt=I(zt);import{InputAdornment as Nt,Stack as Ut,TextField as _t,Tooltip as Ht}from"@mui/material";import{LIcon as Ce}from"@s_mart/core";import*as Ve from"@s_mart/masks";import{lineEye as Kt,lineEyeSlash as Wt,lineInfoCircle as Yt}from"@s_mart/solid-icons";import{useRef as Jt,useState as Xt}from"react";import{useController as Qt,useFormContext as Zt,useFormState as jt}from"react-hook-form";import{jsx as G,jsxs as Se}from"react/jsx-runtime";var er=({name:e,rules:o,defaultValue:r,shouldUnregister:l,control:p,label:u,required:f,mask:s,variant:b="outlined",info:y,parse:S,format:m,onInputChange:c,disableIconError:n,...d})=>{let w=Zt()?.control,g=p??w,E=Jt(r||void 0);if(!g)throw new P("TextField");let[T,i]=Xt(!1),h=a=>{let t=a;return t=m?.(a)??a,s?Ve?.[s]?.format(t):t},O=a=>{let t=a;return t=S?.(a)??t,s?Ve?.[s]?.parse(t,E.current):t},$=a=>{if(!a||s!=="porcentagem"&&s!=="porcentagem0")return;a?.stopPropagation();let t=(a?.target).value;if(t){let L=String(t);if(L.length>0){let z=L.indexOf("%");z>-1&&(a.currentTarget.selectionEnd=z)}}},{field:F}=Qt({control:g,name:e,rules:o,defaultValue:r,shouldUnregister:l}),U=jt({control:g,name:e}),B=R(U.errors,e);return Se(Ut,{children:[Se("div",{style:{display:"flex"},children:[u&&G("div",{children:G(x,{label:u,required:f})}),y&&G("div",{children:G(Ht,{title:y,placement:"top",children:G("div",{style:{width:"fit-content"},children:G(Ce,{icon:Yt,color:"#757575"})})})})]}),G(_t,{variant:b,defaultValue:r,value:h(F.value||(F.value!=0?"":F.value)),onChange:a=>{let t=O(a?.target?.value);F.onChange(t),c?.(t),E.current=a.target.value},error:!!B,...d,type:d.type==="password"?T?"text":"password":d.type,autoComplete:d.autoComplete||"off",slotProps:{input:{onKeyDown:$,inputRef:F.ref,endAdornment:d.type==="password"&&G(Nt,{position:"start",onClick:()=>i(!T),style:{cursor:"pointer"},children:G(Ce,{icon:T?Kt:Wt,size:"24px",removeMargin:!0})}),...d.slotProps?.input}}},e),G(C,{name:e,disableIcon:n,control:g})]})},or=I(er);import{Stack as nr,TextField as ar}from"@mui/material";import{AdapterDayjs as pr}from"@mui/x-date-pickers/AdapterDayjs";import{LocalizationProvider as sr}from"@mui/x-date-pickers/LocalizationProvider";import{TimePicker as dr}from"@mui/x-date-pickers/TimePicker";import{ptBR as mr}from"@mui/x-date-pickers/locales/ptBR";import{composeValidators as ur,time as ke}from"@s_mart/rules";import fr from"dayjs/locale/pt-br";import{useController as cr,useFormContext as yr,useFormState as Fr}from"react-hook-form";import{styled as tr}from"@mui/material";import{IconButton as rr}from"@mui/material";import{toRem as N}from"@s_mart/utils";var lr=e=>{switch(e){case"small":return N(16);case"large":return N(24);default:return N(20)}},ir=e=>{switch(e){case"small":return`${N(2)} ${N(8)}`;case"large":return N(10);default:return`${N(6)} ${N(8)}`}},Te=tr(rr)`
61
+ `;import{jsx as j,jsxs as Do}from"react/jsx-runtime";import{createElement as Bo}from"react";var Ro=({rules:e,name:o,defaultValue:r,shouldUnregister:l,control:s,datePickerProps:u,label:f,required:p,placeholder:b,disabled:y,disableIconError:S,...m})=>{let c=wo()?.control,n=s??c;if(!n)throw new P("DatePicker");let d=Lo({control:n,name:o}),w=R(d.errors,o),g=u?.format||"DD/MM/YYYY",E=e?To([he(g),e]):he(g),{field:T}=Io({control:n,name:o,rules:E,defaultValue:r,shouldUnregister:l});return j(Vo,{dateAdapter:vo,adapterLocale:ko,localeText:So.components.MuiLocalizationProvider.defaultProps.localeText,children:Do(bo,{children:[f&&j(x,{label:f,required:p}),Bo(Co,{...u,key:o,value:T.value??null,format:g,onChange:(i,h)=>{T.onChange(i,h),u?.onChange?.(i,h)},disabled:y,slots:{textField:go,openPickerButton:i=>j(Pe,{...i,size:m.size})},slotProps:{textField:i=>({variant:"outlined",...i,error:!!w,...m,inputProps:{...i.inputProps,placeholder:b||i.inputProps?.placeholder},InputProps:{...i.InputProps,inputRef:h=>{T.ref(h),typeof i.inputRef=="function"&&i.inputRef(h)}}})}}),j(C,{name:o,disableIcon:S,control:n})]})})},Eo=I(Ro);import{FormProvider as Mo}from"react-hook-form";import{jsx as be}from"react/jsx-runtime";function Ao({children:e,style:o,onSubmit:r,...l}){return be(Mo,{...l,children:be("form",{onSubmit:s=>{s.preventDefault(),s.stopPropagation(),r(s)},style:o,children:e})})}var ie=Ao;import{useEffect as Oo}from"react";import{useForm as $o}from"react-hook-form";import{zodResolver as zo}from"@hookform/resolvers/zod";var qo=({disableDefaultValuesUpdate:e,onSubmit:o,...r})=>{let l=$o({...r,resolver:r.schema&&zo(r.schema)});return Oo(()=>{e||l.reset(r.defaultValues)},[r.defaultValues,l.reset]),{...l,onSubmit:l.handleSubmit(s=>o(s,l))}},ne=qo;import{jsx as Uo}from"react/jsx-runtime";function Go({children:e,style:o,...r}){let l=ne(r);return Uo(ie,{...l,style:o,children:typeof e=="function"?e(l):e})}var No=Go;import{RadioGroup as _o,Stack as Ho}from"@mui/material";import{useController as Ko,useFormContext as Wo}from"react-hook-form";import{jsx as ae,jsxs as Xo}from"react/jsx-runtime";var Yo=({name:e,rules:o,defaultValue:r,shouldUnregister:l,control:s,label:u,required:f,children:p,orientation:b="row",disableIconError:y,...S})=>{let m=Wo()?.control,c=s??m;if(!c)throw new P("RadioGroup");let{field:n}=Ko({control:c,name:e,rules:o,defaultValue:r,shouldUnregister:l});return Xo(Ho,{children:[u&&ae(x,{label:u,required:f}),ae(_o,{value:n.value||"",name:e,...S,onChange:d=>{S?.onChange?.(d,d.target?.value),n.onChange(d)},style:{display:"flex",flexDirection:b},children:p},e),ae(C,{name:e,disableIcon:y,control:c})]})},Jo=Yo;import{FormControlLabel as Qo,Grid2 as Zo,Radio as jo}from"@mui/material";import{jsx as ee}from"react/jsx-runtime";var et=({label:e,labelPlacement:o,...r})=>ee(Zo,{sx:{display:"flex",flexDirection:"column"},children:ee(Qo,{control:ee(jo,{...r}),label:ee(x,{label:e}),labelPlacement:o||"end"})}),ot=et;import{Autocomplete as tt,Divider as ge,TextField as rt}from"@mui/material";import lt from"lodash-es/isEqual";import{forwardRef as it}from"react";import{useController as nt,useFormContext as at,useFormState as st}from"react-hook-form";import{Fragment as se,jsx as D,jsxs as K}from"react/jsx-runtime";import{createElement as mt}from"react";var pt=e=>{let{name:o,rules:r,defaultValue:l,shouldUnregister:s,control:u,label:f,required:p,options:b,textFieldProps:y,noOptionsText:S,footer:m,multiple:c,info:n,placeholder:d,onChange:w,onInputChange:g,getOptionAfterLabel:E,getOptionLabel:T,getOptionKey:i,...h}=e,O=at()?.control,$=u??O;if(!$)throw new P("SearchableV2");let F=st({control:$,name:o}),N=R(F.errors,o),{field:B}=nt({name:o,control:$,rules:r,defaultValue:l,shouldUnregister:s});return K("div",{style:{display:"flex",flexDirection:"column"},children:[K("div",{style:{display:"flex"},children:[f&&D(x,{label:f,required:p}),n&&D(_,{title:n})]}),D(tt,{onChange:(a,t)=>{B.onChange(t),w?.(t)},onInputChange:(a,t,L)=>{L==="input"&&g?.(t)},value:B.value,options:b,multiple:c,readOnly:h.disabled,slotProps:{...h.slotProps,listbox:{component:it(function(t,L){return K(se,{children:[D("ul",{...t,ref:L}),typeof m<"u"?K("div",{...t,children:[D("div",{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},children:D(ge,{})}),m()]},"searchable-footer"):null]})})}},noOptionsText:K(se,{children:[S||"Nenhuma op\xE7\xE3o encontrada",typeof m<"u"?K(se,{children:[D("div",{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},children:D(ge,{})}),m()]}):null]}),isOptionEqualToValue:(a,t)=>lt(a,t),getOptionLabel:T,getOptionKey:i,renderOption:typeof E=="function"?(a,t)=>{let L=E(t),U=i(t);return mt("li",{...a,key:U},K("div",{style:{display:"flex",flexDirection:"column",flex:1},children:[D("span",{children:T(t)}),typeof L=="string"?D("span",{children:L}):L]}))}:void 0,...h,renderInput:a=>D(rt,{error:!!N,placeholder:d,...a,...y,inputRef:B.ref})},o),D(C,{name:o,control:$})]})},dt=I(pt);import{useState as ct}from"react";import{useController as yt,useFormContext as Ft,useFormState as xt}from"react-hook-form";import{IconButton as Pt,LIcon as ht}from"@s_mart/core";import{lineTimes as bt}from"@s_mart/regular-icons";import{colorPalette as gt}from"@s_mart/tokens";import{Select as vt,MenuItem as Ct,Divider as Vt}from"@mui/material";import{colorPalette as ut}from"@s_mart/tokens";import{jsx as ft}from"react/jsx-runtime";var ve=({value:e,placeholder:o,getOptionLabel:r})=>e===null||e?.length===0?ft("p",{style:{color:ut.neutral[100]},children:o}):r(e);import{Fragment as kt,jsx as A,jsxs as W}from"react/jsx-runtime";var St=e=>{let{name:o,rules:r,defaultValue:l,shouldUnregister:s,control:u,label:f,required:p,options:b,placeholder:y,clearable:S,info:m,footer:c,onChange:n,variant:d="outlined",getOptionKey:w,getOptionLabel:g,getOptionAfterLabel:E,getOptionIcon:T,...i}=e,h=Ft()?.control,O=u??h,[$,F]=ct(!1);if(!O)throw new P("SelectV2");let N=xt({control:O,name:o}),B=R(N.errors,o),{field:a}=yt({control:O,name:o,rules:r,defaultValue:l,shouldUnregister:s});return W("div",{style:{display:"flex",flexDirection:"column"},children:[W("div",{style:{display:"flex"},children:[f&&A(x,{label:f,required:p}),m&&A(_,{title:m})]}),W(vt,{open:$,onOpen:()=>F(!0),onClose:()=>F(!1),displayEmpty:!!y,variant:d,autoComplete:"off",value:a.value||null,renderValue:t=>A(ve,{getOptionLabel:g,placeholder:y,value:t}),onChange:t=>{console.log(t),a.onChange(t.target.value),n?.(t.target.value)},error:!!B,size:i.size||"medium",inputRef:a.ref,...i,endAdornment:W(kt,{children:[i.endAdornment,!!(S&&a.value)&&A(Pt,{variant:"text",color:"neutral",size:"small",sx:{borderRadius:"50%",position:"absolute",right:"2rem"},style:{padding:0},"aria-label":"Limpar",title:"Limpar",onClick:()=>{a.onChange(null),n?.(null)},children:A(ht,{icon:bt,color:gt.neutral[100],size:"25px",removeMargin:!0})})]}),children:[b.map(t=>{let L=w(t),U=g(t),J=T?.(t);return A(Ct,{value:t,children:W("div",{style:{display:"flex",flexDirection:"column",flex:1},children:[J!==void 0?W("div",{style:{display:"flex",alignItems:"center"},children:[J,U]}):U,A("span",{children:E?.(t)??null})]})},L)}),c!==void 0&&W("div",{children:[A("div",{style:{padding:"8px 16px"},children:A(Vt,{})},"footer-divider"),A("div",{children:c({closeSelect:()=>F(!1)})},"footer-content")]},"footer")]},o),A(C,{name:o,control:O})]})},Tt=I(St);import{useController as It,useFormContext as wt}from"react-hook-form";import{Slider as Lt}from"@mui/material";import{jsx as Bt}from"react/jsx-runtime";var Rt=({name:e,rules:o,defaultValue:r,shouldUnregister:l,control:s,...u})=>{let f=wt()?.control,p=s??f;if(!p)throw new P("Slider");let{field:b}=It({control:p,name:e,rules:o,defaultValue:r,shouldUnregister:l});return Bt(Lt,{value:b.value||u?.min||0,onChange:b.onChange,valueLabelDisplay:"auto",...u},e)},Et=Rt;import{FormControlLabel as Dt,Stack as Mt,Switch as At}from"@mui/material";import{useController as Ot,useFormContext as $t}from"react-hook-form";import{jsx as oe,jsxs as Gt}from"react/jsx-runtime";var zt=({name:e,rules:o,defaultValue:r,shouldUnregister:l,control:s,label:u,labelPlacement:f,disableIconError:p,onChange:b,...y})=>{let S=$t()?.control,m=s??S;if(!m)throw new P("Switch");let{field:c}=Ot({control:m,name:e,rules:o,defaultValue:r,shouldUnregister:l});return Gt(Mt,{children:[oe(Dt,{control:oe(At,{value:c.value??"",checked:c.value??!1,onChange:(n,d)=>{c.onChange(n,d),b?.(n,d)},...y},e),label:oe(x,{label:u}),labelPlacement:f||"end"}),oe(C,{name:e,disableIcon:p,control:m})]})},qt=I(zt);import{InputAdornment as Nt,Stack as Ut,TextField as _t,Tooltip as Ht}from"@mui/material";import{LIcon as Ce}from"@s_mart/core";import*as Ve from"@s_mart/masks";import{lineEye as Kt,lineEyeSlash as Wt,lineInfoCircle as Yt}from"@s_mart/solid-icons";import{useRef as Jt,useState as Xt}from"react";import{useController as Qt,useFormContext as Zt,useFormState as jt}from"react-hook-form";import{jsx as q,jsxs as Se}from"react/jsx-runtime";var er=({name:e,rules:o,defaultValue:r,shouldUnregister:l,control:s,label:u,required:f,mask:p,variant:b="outlined",info:y,parse:S,format:m,onInputChange:c,disableIconError:n,...d})=>{let w=Zt()?.control,g=s??w,E=Jt(r||void 0);if(!g)throw new P("TextField");let[T,i]=Xt(!1),h=a=>{let t=a;return t=m?.(a)??a,p?Ve?.[p]?.format(t):t},O=a=>{let t=a;return t=S?.(a)??t,p?Ve?.[p]?.parse(t,E.current):t},$=a=>{if(!a||p!=="porcentagem"&&p!=="porcentagem0")return;a?.stopPropagation();let t=(a?.target).value;if(t){let L=String(t);if(L.length>0){let U=L.indexOf("%");U>-1&&(a.currentTarget.selectionEnd=U)}}},{field:F}=Qt({control:g,name:e,rules:o,defaultValue:r,shouldUnregister:l}),N=jt({control:g,name:e}),B=R(N.errors,e);return Se(Ut,{children:[Se("div",{style:{display:"flex"},children:[u&&q("div",{children:q(x,{label:u,required:f})}),y&&q("div",{children:q(Ht,{title:y,placement:"top",children:q("div",{style:{width:"fit-content"},children:q(Ce,{icon:Yt,color:"#757575"})})})})]}),q(_t,{variant:b,defaultValue:r,value:h(F.value||(F.value!=0?"":F.value)),onChange:a=>{let t=O(a?.target?.value);F.onChange(t),c?.(t),E.current=a.target.value},error:!!B,...d,type:d.type==="password"?T?"text":"password":d.type,autoComplete:d.autoComplete||"off",slotProps:{input:{onKeyDown:$,inputRef:F.ref,endAdornment:d.type==="password"&&q(Nt,{position:"start",onClick:()=>i(!T),style:{cursor:"pointer"},children:q(Ce,{icon:T?Kt:Wt,size:"24px",removeMargin:!0})}),...d.slotProps?.input}}},e),q(C,{name:e,disableIcon:n,control:g})]})},or=I(er);import{Stack as nr,TextField as ar}from"@mui/material";import{AdapterDayjs as sr}from"@mui/x-date-pickers/AdapterDayjs";import{LocalizationProvider as pr}from"@mui/x-date-pickers/LocalizationProvider";import{TimePicker as dr}from"@mui/x-date-pickers/TimePicker";import{ptBR as mr}from"@mui/x-date-pickers/locales/ptBR";import{composeValidators as ur,time as ke}from"@s_mart/rules";import fr from"dayjs/locale/pt-br";import{useController as cr,useFormContext as yr,useFormState as Fr}from"react-hook-form";import{styled as tr}from"@mui/material";import{IconButton as rr}from"@mui/material";import{toRem as G}from"@s_mart/utils";var lr=e=>{switch(e){case"small":return G(16);case"large":return G(24);default:return G(20)}},ir=e=>{switch(e){case"small":return`${G(2)} ${G(8)}`;case"large":return G(10);default:return`${G(6)} ${G(8)}`}},Te=tr(rr)`
62
62
  margin: 0px;
63
63
 
64
64
  padding: ${({size:e})=>ir(e)};
65
- border-radius: 0 ${N(4)} ${N(4)} 0;
65
+ border-radius: 0 ${G(4)} ${G(4)} 0;
66
66
 
67
67
  svg {
68
68
  width: ${({size:e})=>lr(e)} !important;
69
69
  }
70
- `;import{jsx as X,jsxs as hr}from"react/jsx-runtime";var xr=({rules:e,defaultValue:o,shouldUnregister:r,name:l,control:p,required:u,label:f,timePickerProps:s,placeholder:b,disabled:y,disableIconError:S,...m})=>{let c=yr()?.control,n=p??c;if(!n)throw new P("TimePicker");let d=Fr({control:n,name:l}),w=R(d.errors,l),g=s?.format||"HH:mm",E=e?ur([ke(g),e]):ke(g),{field:T}=cr({control:n,name:l,rules:E,defaultValue:o,shouldUnregister:r});return X(sr,{dateAdapter:pr,adapterLocale:fr,localeText:mr.components.MuiLocalizationProvider.defaultProps.localeText,children:hr(nr,{children:[f&&X(x,{label:f,required:u}),X(dr,{ampm:!1,format:g,value:T.value??null,disabled:y,...s,onChange:(i,h)=>{T.onChange(i,h),s?.onChange?.(i,h)},slots:{textField:ar,openPickerButton:i=>X(Te,{...i,size:m.size})},slotProps:{textField:i=>({variant:"outlined",...i,error:!!w,...m,inputProps:{...i.inputProps,placeholder:b||i.inputProps?.placeholder},InputProps:{...i.InputProps,inputRef:h=>{T.ref(h),typeof i.inputRef=="function"&&i.inputRef(h)}}})}},l),X(C,{name:l,disableIcon:S,control:n})]})})},Pr=I(xr);export{He as Checkbox,co as CreatableV2,Eo as DatePicker,C as FieldError,_ as FieldInfo,x as FieldLabel,No as Form,ie as FormProvider,ot as RadioButton,Jo as RadioGroup,dt as SearchableV2,Tt as SelectV2,Et as Slider,qt as Switch,or as TextField,Pr as TimePicker,ne as useForm};
70
+ `;import{jsx as X,jsxs as hr}from"react/jsx-runtime";var xr=({rules:e,defaultValue:o,shouldUnregister:r,name:l,control:s,required:u,label:f,timePickerProps:p,placeholder:b,disabled:y,disableIconError:S,...m})=>{let c=yr()?.control,n=s??c;if(!n)throw new P("TimePicker");let d=Fr({control:n,name:l}),w=R(d.errors,l),g=p?.format||"HH:mm",E=e?ur([ke(g),e]):ke(g),{field:T}=cr({control:n,name:l,rules:E,defaultValue:o,shouldUnregister:r});return X(pr,{dateAdapter:sr,adapterLocale:fr,localeText:mr.components.MuiLocalizationProvider.defaultProps.localeText,children:hr(nr,{children:[f&&X(x,{label:f,required:u}),X(dr,{ampm:!1,format:g,value:T.value??null,disabled:y,...p,onChange:(i,h)=>{T.onChange(i,h),p?.onChange?.(i,h)},slots:{textField:ar,openPickerButton:i=>X(Te,{...i,size:m.size})},slotProps:{textField:i=>({variant:"outlined",...i,error:!!w,...m,inputProps:{...i.inputProps,placeholder:b||i.inputProps?.placeholder},InputProps:{...i.InputProps,inputRef:h=>{T.ref(h),typeof i.inputRef=="function"&&i.inputRef(h)}}})}},l),X(C,{name:l,disableIcon:S,control:n})]})})},Pr=I(xr);export{He as Checkbox,co as CreatableV2,Eo as DatePicker,C as FieldError,_ as FieldInfo,x as FieldLabel,No as Form,ie as FormProvider,ot as RadioButton,Jo as RadioGroup,dt as SearchableV2,Tt as SelectV2,Et as Slider,qt as Switch,or as TextField,Pr as TimePicker,ne as useForm};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@s_mart/form",
3
- "version": "10.0.0-beta.13",
3
+ "version": "10.0.0-beta.15",
4
4
  "main": "./dist/index.mjs",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.mts",
@@ -31,10 +31,10 @@
31
31
  "typescript": ">=5.4.2",
32
32
  "zod": "^3.22.4",
33
33
  "@s_mart/regular-icons": "6.0.10",
34
+ "@s_mart/core": "10.0.0-beta.8",
34
35
  "@s_mart/solid-icons": "6.0.7",
35
- "@s_mart/masks": "5.2.0",
36
- "@s_mart/core": "10.0.0-beta.6",
37
36
  "@s_mart/rules": "5.1.2-beta.0",
37
+ "@s_mart/masks": "5.2.0",
38
38
  "@s_mart/tokens": "5.1.1",
39
39
  "@s_mart/typed": "7.2.3",
40
40
  "@s_mart/utils": "5.3.4"
@@ -50,11 +50,11 @@
50
50
  "@types/react-dom": ">=18.3.1",
51
51
  "dayjs": "^1.11.10",
52
52
  "typescript": ">=5.4.2",
53
- "@s_mart/core": "10.0.0-beta.6",
54
- "@s_mart/masks": "5.2.0",
55
- "@s_mart/rules": "5.1.2-beta.0",
53
+ "@s_mart/core": "10.0.0-beta.8",
56
54
  "@s_mart/tokens": "5.1.1",
55
+ "@s_mart/masks": "5.2.0",
57
56
  "@s_mart/typed": "7.2.3",
57
+ "@s_mart/rules": "5.1.2-beta.0",
58
58
  "@s_mart/utils": "5.3.4"
59
59
  },
60
60
  "scripts": {