@s_mart/form 7.2.8 → 8.0.0-next.0
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.
- package/dist/index.d.mts +3 -9
- package/dist/index.mjs +5 -5
- package/package.json +22 -22
package/dist/index.d.mts
CHANGED
|
@@ -2,6 +2,7 @@ import * as react_hook_form from 'react-hook-form';
|
|
|
2
2
|
import { FieldValues, UseFormReturn, FormProviderProps, UseFormProps, ControllerProps, UseControllerProps } from 'react-hook-form';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import * as react from 'react';
|
|
5
|
+
import react__default from 'react';
|
|
5
6
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
7
|
import { TextFieldProps as TextFieldProps$1, SelectProps as SelectProps$1, AutocompleteProps as AutocompleteProps$1, CheckboxProps as CheckboxProps$1, SwitchProps as SwitchProps$1, RadioProps as RadioProps$1, RadioGroupProps as RadioGroupProps$1, SliderProps as SliderProps$1 } from '@mui/material';
|
|
7
8
|
import { DatePickerProps as DatePickerProps$1, TimePickerProps as TimePickerProps$1 } from '@mui/x-date-pickers';
|
|
@@ -575,7 +576,7 @@ type TimePickerProps = Omit<UseControllerProps, 'control'> & Pick<TextFieldProps
|
|
|
575
576
|
disableIconError?: boolean;
|
|
576
577
|
};
|
|
577
578
|
|
|
578
|
-
declare const _default$4:
|
|
579
|
+
declare const _default$4: react__default.MemoExoticComponent<({ rules, defaultValue, shouldUnregister, name, required, label, timePickerProps, placeholder, disabled, disableIconError, ...rest }: TimePickerProps) => react_jsx_runtime.JSX.Element>;
|
|
579
580
|
|
|
580
581
|
type AutoCompleteOption = {
|
|
581
582
|
key?: string | number;
|
|
@@ -583,7 +584,7 @@ type AutoCompleteOption = {
|
|
|
583
584
|
value: string | number | readonly string[] | undefined;
|
|
584
585
|
afterLabel?: string | React.ReactNode;
|
|
585
586
|
};
|
|
586
|
-
type AutocompleteProps<
|
|
587
|
+
type AutocompleteProps<ValueType = any> = Omit<UseControllerProps, 'control'> & Omit<AutocompleteProps$1<ValueType, any, any, any>, 'renderInput' | 'size' | 'onInputChange' | 'onChange' | 'options'> & {
|
|
587
588
|
/**
|
|
588
589
|
* Opções do autocomplete
|
|
589
590
|
* @default []
|
|
@@ -597,13 +598,6 @@ type AutocompleteProps<T = any> = Omit<UseControllerProps, 'control'> & Omit<Aut
|
|
|
597
598
|
* @memberof AutocompleteProps
|
|
598
599
|
*/
|
|
599
600
|
options: AutoCompleteOption[];
|
|
600
|
-
/**
|
|
601
|
-
* Props do textField que é renderizado dentro do autocomplete
|
|
602
|
-
* @default {}
|
|
603
|
-
* @type {TextFieldProps}
|
|
604
|
-
* @memberof AutocompleteProps
|
|
605
|
-
*/
|
|
606
|
-
textFieldProps?: TextFieldProps$1;
|
|
607
601
|
label?: React.ReactNode;
|
|
608
602
|
required?: boolean;
|
|
609
603
|
onInputChange?: (value: string, values: FieldValues) => void;
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{FormProvider as io}from"react-hook-form";import{jsx as
|
|
1
|
+
import{FormProvider as io}from"react-hook-form";import{jsx as Ie}from"react/jsx-runtime";function lo({children:e,style:t,onSubmit:i,...n}){return Ie(io,{...n,children:Ie("form",{onSubmit:l=>{l.preventDefault(),l.stopPropagation(),i(l)},style:t,children:e})})}var Fe=lo;import{useEffect as no}from"react";import{useForm as ao}from"react-hook-form";import{zodResolver as so}from"@hookform/resolvers/zod";var po=({disableDefaultValuesUpdate:e,onSubmit:t,...i})=>{let n=ao({...i,resolver:i.schema&&so(i.schema)});return no(()=>{e||n.reset(i.defaultValues)},[i.defaultValues,n.reset]),{...n,onSubmit:n.handleSubmit(l=>t(l,n))}},ge=po;import{jsx as fo}from"react/jsx-runtime";function mo({children:e,style:t,...i}){let n=ge(i);return fo(Fe,{...n,style:t,children:typeof e=="function"?e(n):e})}var uo=mo;import{memo as Po,useRef as vo,useState as Co}from"react";import{Controller as To,useFormContext as So}from"react-hook-form";import{Tooltip as Io,Grid as he,InputAdornment as ko,TextField as Vo}from"@mui/material";import{lineEye as wo,lineEyeSlash as Ro,lineInfoCircle as Eo}from"@s_mart/solid-icons";import*as we from"@s_mart/masks";import{Typography as ke}from"@mui/material";import{toRem as co}from"@s_mart/utils";import{jsx as Ve,jsxs as xo}from"react/jsx-runtime";var yo=({label:e,required:t,regular:i})=>xo("span",{style:{display:"flex",alignItems:"center",gap:co(2)},children:[Ve(ke,{variant:"caption",fontWeight:i?400:700,style:{display:"flex",alignItems:"center"},children:e}),t&&Ve(ke,{variant:"caption",fontWeight:900,color:"error",children:"*"})]}),v=yo;import{useFormContext as bo}from"react-hook-form";import{Indicator as Fo}from"@s_mart/core";var R=(e,t)=>t.replace(/[[\]]/g,"").split(".").reduce((n,l)=>n?.[l],e);import{jsx as ho}from"react/jsx-runtime";var go=({name:e,disableIcon:t})=>{let i=bo(),n=R(i?.formState?.errors,e);return n?ho(Fo,{severity:"error",icon:t?!1:void 0,children:n?.message}):null},S=go;import{LIcon as Re}from"@s_mart/core";import{jsx as q,jsxs as Ee}from"react/jsx-runtime";var Lo=({name:e,rules:t,defaultValue:i,shouldUnregister:n,label:l,required:h,mask:c,variant:y="outlined",info:C,parse:u,format:f,onInputChange:s,disableIconError:b,...a})=>{let F=So(),g=vo(i||void 0);if(!F)throw new Error("Para usar o <TextField /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let[d,x]=Co(!1),p=o=>{let r=o;return r=f?.(o)??o,c?we?.[c]?.format(r):r},m=o=>{let r=o;return r=u?.(o)??r,c?we?.[c]?.parse(r,g.current):r},E=o=>{if(!o||c!=="porcentagem"&&c!=="porcentagem0")return;o?.stopPropagation();let r=(o?.target).value;if(r){let T=String(r);if(T.length>0){let I=T.indexOf("%");I>-1&&(o.currentTarget.selectionEnd=I)}}},L=R(F.formState.errors,e);return q(To,{control:F.control,name:e,rules:t,defaultValue:i,shouldUnregister:n,render:({field:{value:o,onChange:r,ref:T}})=>Ee(he,{display:"flex",flexDirection:"column",children:[Ee("div",{style:{display:"flex"},children:[l&&q(he,{item:!0,children:q(v,{label:l,required:h})}),C&&q(he,{item:!0,children:q(Io,{title:C,placement:"top",children:q("div",{style:{width:"fit-content"},children:q(Re,{icon:Eo,color:"#757575"})})})})]}),q(Vo,{variant:y,defaultValue:i,value:p(o||(o!=0?"":o)),onChange:I=>{let H=m(I?.target?.value);r(H),s?.(H,F.getValues()),g.current=I.target.value},error:!!L,...a,type:a.type==="password"?d?"text":"password":a.type,autoComplete:a.autoComplete||"off",InputProps:{onKeyDown:E,inputRef:T,endAdornment:a.type==="password"&&q(ko,{position:"start",onClick:()=>x(!d),style:{cursor:"pointer"},children:q(Re,{icon:d?wo:Ro,size:"24px",removeMargin:!0})}),...a.InputProps}},e),q(S,{name:e,disableIcon:b})]})})},Ao=Po(Lo);import{memo as Bo,useState as Go}from"react";import{Controller as Mo,useFormContext as $o}from"react-hook-form";import{IconButton as Do,LIcon as Le}from"@s_mart/core";import{lineTimes as _o}from"@s_mart/regular-icons";import{lineInfoCircle as qo}from"@s_mart/solid-icons";import{colorPalette as zo}from"@s_mart/tokens";import{Divider as Oo,Tooltip as No,Grid as J,Select as Uo,MenuItem as jo,useTheme as Ho}from"@mui/material";import{Fragment as Yo,jsx as $,jsxs as ne}from"react/jsx-runtime";var Ae=Bo(({name:e,rules:t,defaultValue:i,shouldUnregister:n,label:l,required:h,options:c,placeholder:y,clearable:C,disableOnChangeForm:u=!1,multiple:f,info:s,footer:b,onChange:a,disableIconError:F,variant:g="outlined",...d})=>{let x=$o(),{palette:p}=Ho(),[m,E]=Go(!1);if(!x)throw new Error("Para usar o <Select /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let L=R(x.formState.errors,e);return $(Mo,{control:x.control,name:e,rules:t,defaultValue:i,shouldUnregister:n,render:({field:{value:o,onChange:r,ref:T}})=>ne(J,{display:"flex",flexDirection:"column",children:[ne("div",{style:{display:"flex"},children:[l&&$(J,{item:!0,children:$(v,{label:l,required:h})}),s&&$(J,{item:!0,children:$(No,{title:s,placement:"top",children:$("div",{style:{width:"fit-content"},children:$(Le,{icon:qo,color:"#757575"})})})})]}),ne(Uo,{open:m,onOpen:()=>E(!0),onClose:()=>E(!1),displayEmpty:!!y,variant:g,autoComplete:"off",value:o?o||"":f?[]:"",renderValue:I=>{if(I.label)return I.label;if(y)return $("p",{style:{color:p.grey[400]},children:y})},multiple:f,onChange:I=>{!u&&r(I.target.value),a&&a(I.target.value,x.getValues())},error:!!L,size:d.size||"medium",inputRef:T,...d,endAdornment:ne(Yo,{children:[d.endAdornment,!!(C&&o)&&$(Do,{variant:"text",color:"neutral",size:"small",sx:{borderRadius:"50%",position:"absolute",right:"2rem"},style:{padding:0},"aria-label":"Clear",title:"Clear",onClick:()=>{!u&&r(null),a&&a(null,x.getValues())},children:$(Le,{icon:_o,color:zo.neutral[100],size:"25px",removeMargin:!0})})]}),children:[c?.map((I,H)=>$(jo,{value:I,children:ne(J,{container:!0,direction:"column",children:[$(J,{item:!0,children:I.label}),I.afterLabel&&$(J,{item:!0,children:I.afterLabel})]})},H)),b&&[$(J,{px:2,py:1,children:$(Oo,{})},"footer-divider"),$("div",{children:b({closeSelect:()=>E(!1)})},"footer-content")]]},e),$(S,{name:e,disableIcon:F})]})})});Ae.displayName="Select";var Wo=Ae;import{forwardRef as Jo,memo as Ko}from"react";import{Controller as Xo,useFormContext as Qo}from"react-hook-form";import{Tooltip as Zo,Divider as Be,Grid as W,Autocomplete as er,TextField as or}from"@mui/material";import{LIcon as rr}from"@s_mart/core";import{lineInfoCircle as tr}from"@s_mart/solid-icons";import{colorPalette as ir}from"@s_mart/tokens";import{Fragment as pe,jsx as M,jsxs as K}from"react/jsx-runtime";import{createElement as Ge}from"react";var Me=Ko(({name:e,rules:t,defaultValue:i,shouldUnregister:n,label:l,required:h,options:c,textFieldProps:y,noOptionsText:C,footer:u,multiple:f,info:s,placeholder:b,onChange:a,onInputChange:F,disableIconError:g,...d})=>{let x=Qo();if(!x)throw new Error("Para usar o <Searchable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let p=R(x.formState.errors,e);return M(Xo,{control:x.control,name:e,rules:t,defaultValue:i,shouldUnregister:n,render:({field:{onChange:m,value:E,ref:L}})=>K(W,{display:"flex",flexDirection:"column",children:[K("div",{style:{display:"flex"},children:[l&&M(W,{item:!0,children:M(v,{label:l,required:h})}),s&&M(W,{item:!0,children:M(Zo,{title:s,placement:"top",children:M("div",{style:{width:"fit-content"},children:M(rr,{icon:tr,color:"#757575"})})})})]}),M(er,{onChange:(o,r)=>{m(r),a?.(r,x.getValues())},onInputChange:(o,r,T)=>{T==="input"&&setTimeout(()=>{F?.(r,x.getValues())},0)},slotProps:{...d.slotProps||{},paper:{...(d.slotProps||{}).paper||{},sx:{border:`1px solid ${ir.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"}}},value:E||(f?[]:null),options:c,multiple:f,readOnly:d.disabled,noOptionsText:K(pe,{children:[C||"Nenhum resultado encontrado",u?K(pe,{children:[M(W,{py:1,children:M(Be,{})}),u]}):null]}),isOptionEqualToValue:(o,r)=>typeof o=="string"&&typeof r=="string"?o===r:typeof o=="object"&&typeof r=="object"?typeof o.value=="object"&&typeof r.value=="object"&&o.key!==void 0&&r.key!==void 0?o.key===r.key:o.value===r.value:!1,renderOption:(o,r)=>typeof r=="object"?Ge("li",{...o,key:r.key||r.value},K(W,{container:!0,direction:"column",children:[M(W,{item:!0,children:r.label}),r.afterLabel&&M(W,{item:!0,children:r.afterLabel})]})):Ge("li",{...o,key:r},r),ListboxComponent:Jo(function(r,T){return K(pe,{children:[M("ul",{...r,ref:T}),!!u&&M("div",{...r,children:K(pe,{children:[M(W,{px:2,py:1,children:M(Be,{})}),u]})},"searchable-footer")]})}),...d,renderInput:o=>M(or,{error:!!p,placeholder:b,...o,...y,inputRef:L})},e),M(S,{name:e,disableIcon:g})]})})});Me.displayName="Searchable";var lr=Me;import{forwardRef as dr,memo as sr}from"react";import{Controller as pr,useFormContext as mr}from"react-hook-form";import{isObject as ur,isEmpty as fr}from"lodash-es";import{Grid as X,Autocomplete as cr,TextField as yr,Tooltip as xr,Divider as br}from"@mui/material";import{LIcon as ue,Button as Fr}from"@s_mart/core";import{colorPalette as gr}from"@s_mart/tokens";import{linePlus as qe,linePen as hr,lineInfoCircle as Pr}from"@s_mart/solid-icons";import{toRem as ze}from"@s_mart/utils";import{toRem as me}from"@s_mart/utils";import nr from"@emotion/styled";import{css as $e}from"@emotion/react";var De=$e`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
@@ -51,7 +51,7 @@ import{FormProvider as io}from"react-hook-form";import{jsx as Se}from"react/jsx-
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
${({hideAddButton:e,theme:t})=>!e&&ar(t)}
|
|
54
|
-
`;import{Fragment as
|
|
54
|
+
`;import{Fragment as Pe,jsx as k,jsxs as N}from"react/jsx-runtime";import{createElement as Oe}from"react";var Ne=sr(({name:e,rules:t,defaultValue:i,shouldUnregister:n,label:l,required:h,options:c,editable:y,footer:C,onEditOption:u,onCreateOption:f,textFieldProps:s,hideAddButton:b,multiple:a,info:F,onChange:g,onInputChange:d,placeholder:x,disableIconError:p,...m})=>{let E=mr();if(!E)throw new Error("Para usar o <Creatable /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let L=R(E.formState.errors,e),o=b||m.disabled,r=w=>{let D=0;return s?.InputProps||(D+=2.5),o||(D+=2.56,T(w)&&(D+=2.56)),!m.disableClearable&&!m.disabled&&(D+=1.3),D+"rem"},T=w=>m.disabled?!1:y&&ur(w)&&!fr(w);console.warn=()=>{};let I=w=>{f?f(w):console.error("onCreateOption n\xE3o foi definido")},H=w=>{u?u(w):console.error("onEditOption n\xE3o foi definido")};return k(pr,{control:E.control,name:e,rules:t,defaultValue:i,shouldUnregister:n,render:({field:{value:w,onChange:D,ref:be}})=>{let ie=w?.label||w?.value||w;return N(X,{display:"flex",flexDirection:"column",children:[N("div",{style:{display:"flex"},children:[l&&k(X,{item:!0,children:k(v,{label:l,required:h})}),F&&k(X,{item:!0,children:k(xr,{title:F,placement:"top",children:k("div",{style:{width:"fit-content"},children:k(ue,{icon:Pr,color:"#757575"})})})})]}),k(_e,{hideAddButton:o,children:k(cr,{fullWidth:!0,onChange:(A,P)=>{D(P),g?.(P,E.getValues())},onInputChange:(A,P,le)=>{le==="input"&&setTimeout(()=>{d?.(P,E.getValues())},0)},slotProps:{...m.slotProps||{},paper:{...(m.slotProps||{}).paper||{},sx:{border:`1px solid ${gr.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"}}},options:c,value:w||(a?[]:null),multiple:a,readOnly:m.disabled,noOptionsText:o?void 0:N(Fr,{sx:{justifyContent:"flex-start",padding:`${ze(6)} ${ze(-16)}`,margin:0},fullWidth:!0,onClick:()=>I(w),variant:"text",startIcon:k(ue,{icon:qe}),children:["Adicionar ",ie&&`"${ie}"`]}),isOptionEqualToValue:(A,P)=>P?typeof A=="string"&&typeof P=="string"?A===P:typeof A=="object"&&typeof P=="object"?typeof A.value=="object"&&typeof P.value=="object"&&A.key!==void 0&&P.key!==void 0?A.key===P.key:A.value===P.value:typeof A=="object"&&typeof P=="string":!1,renderOption:(A,P)=>typeof P=="object"?Oe("li",{...A,key:P.key||P.value},N(X,{container:!0,direction:"column",children:[k(X,{item:!0,children:P.label}),P.afterLabel&&k(X,{item:!0,children:P.afterLabel})]})):Oe("li",{...A,key:P},P),ListboxComponent:dr(function(P,le){return N(Pe,{children:[k("ul",{...P,ref:le}),!!C&&k("div",{...P,children:N(Pe,{children:[k(X,{px:2,py:1,children:k(br,{})}),C]})},"creatable-footer")]})}),...m,sx:{"& div.MuiInputBase-root":{paddingRight:`${r(w)} !important`},...m.sx},renderInput:A=>k(yr,{placeholder:x,...A,error:!!L,InputProps:{...A.InputProps,inputRef:be,endAdornment:N("div",{className:"endAdornments",children:[A.InputProps.endAdornment,!o&&N(Pe,{children:[T(w)?N("div",{className:"editable",children:[k("div",{className:"divider"}),k("div",{className:"button",onClick:()=>H(w),children:k(ue,{icon:hr,size:"24px",removeMargin:!0})})]}):null,N("div",{className:"creatable",children:[k("div",{className:"divider"}),k("div",{className:"button",onClick:()=>I(w),children:k(ue,{icon:qe,size:"24px",removeMargin:!0})})]})]})]})},...s})},e)}),k(S,{name:e,disableIcon:p})]})}})});Ne.displayName="Creatable";var vr=Ne;import{Controller as Cr,useFormContext as Tr}from"react-hook-form";import{Grid as Sr,Checkbox as Ir,FormControlLabel as kr}from"@mui/material";import{jsx as ae,jsxs as Rr}from"react/jsx-runtime";var Vr=({name:e,rules:t,defaultValue:i,shouldUnregister:n,label:l,labelPlacement:h,required:c,disableIconError:y,onChange:C,...u})=>{let f=Tr();if(!f)throw new Error("Para usar o <Checkbox /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return ae(Cr,{control:f.control,name:e,rules:t,defaultValue:i,shouldUnregister:n,render:({field:{value:s,onChange:b}})=>Rr(Sr,{display:"flex",flexDirection:"column",children:[ae(kr,{control:ae(Ir,{checked:!!s,value:s??"",defaultValue:s,onChange:(a,F)=>{b(a,F),C?.(a,F)},...u},e),label:ae(v,{label:l,required:c,regular:!0}),labelPlacement:h||"end"}),ae(S,{name:e,disableIcon:y})]})})},wr=Vr;import{Controller as Er,useFormContext as Lr}from"react-hook-form";import{Grid as Ar,Switch as Br,FormControlLabel as Gr}from"@mui/material";import{jsx as de,jsxs as Dr}from"react/jsx-runtime";var Mr=({name:e,rules:t,defaultValue:i,shouldUnregister:n,label:l,labelPlacement:h,disableIconError:c,onChange:y,...C})=>{let u=Lr();if(!u)throw new Error("Para usar o <Switch /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return de(Er,{control:u.control,name:e,rules:t,defaultValue:i,shouldUnregister:n,render:({field:{value:f,onChange:s}})=>Dr(Ar,{display:"flex",flexDirection:"column",children:[de(Gr,{control:de(Br,{value:f??"",checked:f??!1,defaultValue:f,onChange:(b,a)=>{s(b,a),y?.(b,a)},...C},e),label:de(v,{label:l}),labelPlacement:h||"end"}),de(S,{name:e,disableIcon:c})]})})},$r=Mr;import{Grid as _r,Radio as qr,FormControlLabel as zr}from"@mui/material";import{jsx as fe}from"react/jsx-runtime";var Or=({label:e,labelPlacement:t,...i})=>fe(_r,{display:"flex",flexDirection:"column",children:fe(zr,{control:fe(qr,{...i}),label:fe(v,{label:e}),labelPlacement:t||"end"})}),Nr=Or;import{Controller as Ur,useFormContext as jr}from"react-hook-form";import{Grid as Hr,RadioGroup as Wr}from"@mui/material";import{jsx as ce,jsxs as Kr}from"react/jsx-runtime";var Yr=({name:e,rules:t,defaultValue:i,shouldUnregister:n,label:l,required:h,children:c,orientation:y="row",disableIconError:C,...u})=>{let f=jr();if(!f)throw new Error("Para usar o <RadioGroup /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return ce(Ur,{control:f.control,name:e,rules:t,defaultValue:i,shouldUnregister:n,render:({field:{value:s,onChange:b}})=>Kr(Hr,{display:"flex",flexDirection:"column",children:[l&&ce(v,{label:l,required:h}),ce(Wr,{value:s||"",name:e,...u,onChange:a=>{u?.onChange?.(a,a.target?.value),b(a)},style:{display:"flex",flexDirection:y},children:c},e),ce(S,{name:e,disableIcon:C})]})})},Jr=Yr;import{Controller as Xr,useFormContext as Qr}from"react-hook-form";import{Slider as Zr}from"@mui/material";import{jsx as Ue}from"react/jsx-runtime";var et=({name:e,rules:t,defaultValue:i,shouldUnregister:n,...l})=>{let h=Qr();if(!h)throw new Error("Para usar o <Slider /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");return Ue(Xr,{control:h.control,name:e,rules:t,defaultValue:i,shouldUnregister:n,render:({field:{value:c,onChange:y}})=>Ue(Zr,{value:c||l?.min||0,onChange:y,valueLabelDisplay:"auto",...l},e)})},ot=et;import{memo as nt}from"react";import{Controller as at,useFormContext as dt}from"react-hook-form";import{composeValidators as st,date as He}from"@s_mart/rules";import{Grid as pt,TextField as mt}from"@mui/material";import{DatePicker as ut}from"@mui/x-date-pickers/DatePicker";import{AdapterDayjs as ft}from"@mui/x-date-pickers/AdapterDayjs";import{LocalizationProvider as ct}from"@mui/x-date-pickers/LocalizationProvider";import{ptBR as yt}from"@mui/x-date-pickers/locales/ptBR";import xt from"dayjs/locale/pt-br";import rt from"@emotion/styled";import{IconButton as tt}from"@mui/material";import{toRem as U}from"@s_mart/utils";var it=e=>{switch(e){case"small":return U(16);default:case"medium":return U(20);case"large":return U(24)}},lt=e=>{switch(e){case"small":return`${U(2)} ${U(8)}`;default:case"medium":return`${U(6)} ${U(8)}`;case"large":return`${U(10)}`}},je=rt(tt)`
|
|
55
55
|
margin: 0px;
|
|
56
56
|
|
|
57
57
|
padding: ${({size:e})=>lt(e)};
|
|
@@ -60,7 +60,7 @@ import{FormProvider as io}from"react-hook-form";import{jsx as Se}from"react/jsx-
|
|
|
60
60
|
svg {
|
|
61
61
|
width: ${({size:e})=>it(e)} !important;
|
|
62
62
|
}
|
|
63
|
-
`;import{jsx as se,jsxs as
|
|
63
|
+
`;import{jsx as se,jsxs as ht}from"react/jsx-runtime";import{createElement as gt}from"react";var bt=({rules:e,name:t,defaultValue:i,shouldUnregister:n,datePickerProps:l,label:h,required:c,placeholder:y,disabled:C,disableIconError:u,...f})=>{let s=dt();if(!s)throw new Error("Para usar o <DataPicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let b=R(s.formState.errors,t),a=l?.format||"DD/MM/YYYY",F=e?st([He(a),e]):He(a);return se(ct,{dateAdapter:ft,adapterLocale:xt,localeText:yt.components.MuiLocalizationProvider.defaultProps.localeText,children:se(at,{control:s.control,name:t,rules:F,defaultValue:i,shouldUnregister:n,render:({field:{value:g,onChange:d,ref:x}})=>ht(pt,{display:"flex",flexDirection:"column",children:[h&&se(v,{label:h,required:c}),gt(ut,{...l,key:t,value:g??null,format:a,onChange:(p,m)=>{d(p,m),l?.onChange?.(p,m)},disabled:C,slots:{textField:mt,openPickerButton:p=>se(je,{...p,size:f.size})},slotProps:{textField:p=>({variant:"outlined",...p,error:!!b,...f,inputProps:{...p.inputProps,placeholder:y||p.inputProps?.placeholder},InputProps:{...p.InputProps,inputRef:m=>{x(m),typeof p.inputRef=="function"&&p.inputRef(m)}}})}}),se(S,{name:t,disableIcon:u})]})})})},Ft=nt(bt);import{memo as St}from"react";import{Controller as It,useFormContext as kt}from"react-hook-form";import{composeValidators as Vt,time as Ye}from"@s_mart/rules";import{Grid as wt,TextField as Rt}from"@mui/material";import{TimePicker as Et}from"@mui/x-date-pickers/TimePicker";import{AdapterDayjs as Lt}from"@mui/x-date-pickers/AdapterDayjs";import{LocalizationProvider as At}from"@mui/x-date-pickers/LocalizationProvider";import{ptBR as Bt}from"@mui/x-date-pickers/locales/ptBR";import Gt from"dayjs/locale/pt-br";import Pt from"@emotion/styled";import{IconButton as vt}from"@mui/material";import{toRem as j}from"@s_mart/utils";var Ct=e=>{switch(e){case"small":return j(16);default:case"medium":return j(20);case"large":return j(24)}},Tt=e=>{switch(e){case"small":return`${j(2)} ${j(8)}`;default:case"medium":return`${j(6)} ${j(8)}`;case"large":return`${j(10)}`}},We=Pt(vt)`
|
|
64
64
|
margin: 0px;
|
|
65
65
|
|
|
66
66
|
padding: ${({size:e})=>Tt(e)};
|
|
@@ -69,7 +69,7 @@ import{FormProvider as io}from"react-hook-form";import{jsx as Se}from"react/jsx-
|
|
|
69
69
|
svg {
|
|
70
70
|
width: ${({size:e})=>Ct(e)} !important;
|
|
71
71
|
}
|
|
72
|
-
`;import{jsx as oe,jsxs as Dt}from"react/jsx-runtime";var Mt=({rules:e,defaultValue:t,shouldUnregister:i,name:n,required:l,label:
|
|
72
|
+
`;import{jsx as oe,jsxs as Dt}from"react/jsx-runtime";var Mt=({rules:e,defaultValue:t,shouldUnregister:i,name:n,required:l,label:h,timePickerProps:c,placeholder:y,disabled:C,disableIconError:u,...f})=>{let s=kt();if(!s)throw new Error("Para usar o <TimePicker /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let b=R(s.formState.errors,n),a=c?.format||"HH:mm",F=e?Vt([Ye(a),e]):Ye(a);return oe(At,{dateAdapter:Lt,adapterLocale:Gt,localeText:Bt.components.MuiLocalizationProvider.defaultProps.localeText,children:oe(It,{control:s.control,name:n,rules:F,defaultValue:t,shouldUnregister:i,render:({field:{value:g,onChange:d,ref:x}})=>Dt(wt,{display:"flex",flexDirection:"column",children:[h&&oe(v,{label:h,required:l}),oe(Et,{ampm:!1,format:a,value:g??null,disabled:C,...c,onChange:(p,m)=>{d(p,m),c?.onChange?.(p,m)},slots:{textField:Rt,openPickerButton:p=>oe(We,{...p,size:f.size})},slotProps:{textField:p=>({variant:"outlined",...p,error:!!b,...f,inputProps:{...p.inputProps,placeholder:y||p.inputProps?.placeholder},InputProps:{...p.InputProps,inputRef:m=>{x(m),typeof p.inputRef=="function"&&p.inputRef(m)}}})}},n),oe(S,{name:n,disableIcon:u})]})})})},$t=St(Mt);import{memo as _t}from"react";import{Controller as qt,useFormContext as zt}from"react-hook-form";import{Grid as ye,Autocomplete as Ot,TextField as Nt}from"@mui/material";import{colorPalette as Ut}from"@s_mart/tokens";import{jsx as Q,jsxs as Je}from"react/jsx-runtime";import{createElement as Wt}from"react";var jt=({name:e,defaultValue:t,rules:i,shouldUnregister:n,label:l,required:h,noOptionsText:c,placeholder:y,onInputChange:C,onChange:u,disableIconError:f,...s})=>{let b=zt();if(!b)throw new Error("Para usar o <Autocomplete /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let a=R(b.formState.errors,e);return console.warn=()=>{},Q(qt,{name:e,control:b.control,defaultValue:t,rules:i,shouldUnregister:n,render:({field:F})=>Je(ye,{display:"flex",flexDirection:"column",children:[l&&Q(v,{label:l,required:h}),Q(Ot,{onChange:(g,d)=>{F.onChange(d),u?.(d,b.getValues())},onInputChange:(g,d,x)=>{x==="input"&&(F.onChange(d),setTimeout(()=>{C?.(d,b.getValues())},0))},slotProps:{...s.slotProps||{},paper:{...s.slotProps?.paper||{},sx:{border:`1px solid ${Ut.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"}}},isOptionEqualToValue:(g,d)=>g.value===d.value,renderOption:(g,d)=>Wt("li",{...g,key:d.key||d.value,onClick:x=>{g.onClick?.(x),F.onChange(d)}},Je(ye,{container:!0,direction:"column",children:[Q(ye,{item:!0,children:d.label}),d.afterLabel&&Q(ye,{item:!0,children:d.afterLabel})]})),value:F.value||null,readOnly:s.disabled,noOptionsText:c||"Nenhuma op\xE7\xE3o encontrada",...s,renderInput:g=>Q(Nt,{placeholder:y,...g,error:!!a,slotProps:{input:{inputProps:g.inputProps,inputRef:F.ref}}})},e),Q(S,{name:e,disableIcon:f})]})})},Ht=_t(jt);import{useController as Zt,useFormContext as ei}from"react-hook-form";import{Tooltip as Yt}from"@mui/material";import{LIcon as Jt}from"@s_mart/core";import{lineInfoCircle as Kt}from"@s_mart/solid-icons";import{jsx as ve}from"react/jsx-runtime";var Xt=({title:e})=>ve(Yt,{title:e,placement:"top",children:ve("div",{style:{width:"fit-content"},children:ve(Jt,{icon:Kt,color:"#757575"})})}),Z=Xt;import{Autocomplete as oi,Divider as Ke,TextField as ri}from"@mui/material";import{isEqual as ti}from"lodash-es";import{forwardRef as ii}from"react";import{colorPalette as li}from"@s_mart/tokens";import{memo as Qt}from"react";var re=Qt;import{Fragment as Ce,jsx as _,jsxs as ee}from"react/jsx-runtime";import{createElement as di}from"react";var ni=({name:e,rules:t,defaultValue:i,shouldUnregister:n,label:l,required:h,options:c,textFieldProps:y,noOptionsText:C,footer:u,multiple:f,info:s,placeholder:b,onChange:a,onInputChange:F,getOptionAfterLabel:g,getOptionLabel:d,getOptionKey:x,...p})=>{let m=ei();if(!m)throw new Error("Para usar o <SearchableV2 /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let E=R(m.formState.errors,e),{field:L}=Zt({name:e,control:m.control,rules:t,defaultValue:i,shouldUnregister:n});return ee("div",{style:{display:"flex",flexDirection:"column"},children:[ee("div",{style:{display:"flex"},children:[l&&_(v,{label:l,required:h}),s&&_(Z,{title:s})]}),_(oi,{onChange:(o,r)=>{L.onChange(r),a?.(r)},onInputChange:(o,r,T)=>{T==="input"&&F?.(r)},value:L.value?L.value:f?[]:null,options:c,multiple:f,readOnly:p.disabled,slotProps:{...p.slotProps,paper:{...p.slotProps?.paper,sx:{border:`1px solid ${li.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"}}},noOptionsText:ee(Ce,{children:[C||"Nenhuma op\xE7\xE3o encontrada",typeof u<"u"?ee(Ce,{children:[_("div",{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},children:_(Ke,{})}),u()]}):null]}),isOptionEqualToValue:(o,r)=>ti(o,r),getOptionLabel:o=>d(o),getOptionKey:o=>x(o),renderOption:typeof g=="function"?(o,r)=>{let T=g(r),I=x(r);return di("li",{...o,key:I},ee("div",{style:{display:"flex",flexDirection:"column"},children:[_("span",{children:d(r)}),typeof T=="string"?_("span",{children:T}):T]}))}:void 0,ListboxComponent:ii(function(r,T){return ee(Ce,{children:[_("ul",{...r,ref:T}),typeof u<"u"?ee("div",{...r,children:[_("div",{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},children:_(Ke,{})}),u()]},"searchable-footer"):null]})}),...p,renderInput:o=>_(ri,{error:!!E,placeholder:b,...o,...y,inputRef:L.ref})},e),_(S,{name:e})]})},ai=re(ni);import{useState as mi}from"react";import{useController as ui,useFormContext as fi}from"react-hook-form";import{IconButton as ci,LIcon as yi}from"@s_mart/core";import{lineTimes as xi}from"@s_mart/regular-icons";import{colorPalette as bi}from"@s_mart/tokens";import{Select as Fi,MenuItem as gi,Divider as hi}from"@mui/material";import{colorPalette as si}from"@s_mart/tokens";import{jsx as pi}from"react/jsx-runtime";var Xe=({value:e,placeholder:t,getOptionLabel:i})=>e===null||e?.length===0?pi("p",{style:{color:si.neutral[100]},children:t}):i(e);import{Fragment as Ci,jsx as z,jsxs as te}from"react/jsx-runtime";var Pi=({name:e,rules:t,defaultValue:i,shouldUnregister:n,label:l,required:h,options:c,placeholder:y,clearable:C,info:u,footer:f,onChange:s,variant:b="outlined",getOptionKey:a,getOptionLabel:F,getOptionAfterLabel:g,...d})=>{let x=fi(),[p,m]=mi(!1);if(!x)throw new Error("Para usar o <SelectV2 /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let E=R(x.formState.errors,e),{field:L}=ui({control:x.control,name:e,rules:t,defaultValue:i,shouldUnregister:n});return te("div",{style:{display:"flex",flexDirection:"column"},children:[te("div",{style:{display:"flex"},children:[l&&z(v,{label:l,required:h}),u&&z(Z,{title:u})]}),te(Fi,{open:p,onOpen:()=>m(!0),onClose:()=>m(!1),displayEmpty:!!y,variant:b,autoComplete:"off",value:L.value||null,renderValue:o=>z(Xe,{getOptionLabel:F,placeholder:y,value:o}),onChange:o=>{L.onChange(o.target.value),s?.(o.target.value)},error:!!E,size:d.size||"medium",inputRef:L.ref,...d,endAdornment:te(Ci,{children:[d.endAdornment,!!(C&&L.value)&&z(ci,{variant:"text",color:"neutral",size:"small",sx:{borderRadius:"50%",position:"absolute",right:"2rem"},style:{padding:0},"aria-label":"Limpar",title:"Limpar",onClick:()=>{L.onChange(null),s?.(null)},children:z(yi,{icon:xi,color:bi.neutral[100],size:"25px",removeMargin:!0})})]}),children:[c.map(o=>{let r=a(o),T=F(o);return z(gi,{value:o,children:te("div",{style:{display:"flex",flexDirection:"column",flex:1},children:[T,z("span",{children:g?.(o)??null})]})},r)}),f!==void 0&&te("div",{children:[z("div",{style:{padding:"8px 16px"},children:z(hi,{})},"footer-divider"),z("div",{children:f({closeSelect:()=>m(!1)})},"footer-content")]},"footer")]},e),z(S,{name:e})]})},vi=re(Pi);import{forwardRef as Ii,useCallback as ki,useState as Vi}from"react";import{useController as wi,useFormContext as Ri}from"react-hook-form";import{isObject as Ei,isEmpty as Li,isEqual as Ai}from"lodash-es";import{Autocomplete as Bi,TextField as Gi,Divider as eo}from"@mui/material";import{LIcon as Te,Button as Mi}from"@s_mart/core";import{colorPalette as $i}from"@s_mart/tokens";import{linePlus as oo,linePen as Di}from"@s_mart/solid-icons";import{toRem as ro}from"@s_mart/utils";import{toRem as xe}from"@s_mart/utils";import Ti from"@emotion/styled";import{css as Si}from"@emotion/react";var Qe=Si`
|
|
73
73
|
display: flex;
|
|
74
74
|
align-items: center;
|
|
75
75
|
justify-content: center;
|
|
@@ -120,4 +120,4 @@ import{FormProvider as io}from"react-hook-form";import{jsx as Se}from"react/jsx-
|
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
`;import{Fragment as
|
|
123
|
+
`;import{Fragment as Se,jsx as G,jsxs as O}from"react/jsx-runtime";import{createElement as zi}from"react";var _i=({name:e,rules:t,defaultValue:i,shouldUnregister:n,label:l,required:h,options:c,footer:y,showCreatableButton:C=!0,showEditableButton:u,onEditOption:f,onCreateOption:s,getOptionKey:b,getOptionLabel:a,getOptionAfterLabel:F,textFieldProps:g,multiple:d,info:x,noOptionsText:p,onChange:m,onInputChange:E,placeholder:L,...o})=>{let[r,T]=Vi(""),I=Ri();if(!I)throw new Error("Para usar o <CreatableV2 /> \xE9 necess\xE1rio que ele esteja dentro de um <Form />");let H=R(I.formState.errors,e),w=!C||o.disabled,{field:D}=wi({name:e,control:I.control,rules:t,defaultValue:i,shouldUnregister:n}),be=V=>{let B=0;return g?.InputProps||(B+=2.5),w||(B+=2.56,ie(V)&&(B+=2.56)),!o.disableClearable&&!o.disabled&&(B+=1.3),B+"rem"},ie=V=>o.disabled?!1:u&&Ei(V)&&!Li(V),A=()=>o.disabled?!1:C,P=ki(()=>{typeof s<"u"&&(s(r),T(""))},[r]),le=V=>{f?.(V)};return O("div",{style:{display:"flex",flexDirection:"column"},children:[O("div",{style:{display:"flex"},children:[l&&G(v,{label:l,required:h}),x&&G(Z,{title:x})]}),G(Ze,{children:G(Bi,{fullWidth:!0,onChange:(V,B)=>{T(""),D.onChange(B),m?.(B)},onInputChange:(V,B,Y)=>{Y==="input"&&(T(B),E?.(B))},slotProps:{...o.slotProps,paper:{...o.slotProps?.paper,sx:{border:`1px solid ${$i.neutral[30]}`,boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.15)"}}},value:D.value?D.value:d?[]:null,options:c,multiple:d,readOnly:o.disabled,noOptionsText:O(Se,{children:[p||"Nenhuma op\xE7\xE3o encontrada",!w&&O(Mi,{sx:{justifyContent:"flex-start",padding:`${ro(6)} ${ro(-16)}`,margin:0},fullWidth:!0,onClick:P,variant:"text",startIcon:G(Te,{icon:oo}),children:["Adicionar ",`"${r}"`]}),typeof y<"u"&&O(Se,{children:[G("div",{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},children:G(eo,{})}),y()]})]}),isOptionEqualToValue:(V,B)=>Ai(V,B),getOptionLabel:V=>a(V),getOptionKey:V=>b(V),renderOption:typeof F=="function"?(V,B)=>{let Y=F(B),to=b(B);return zi("li",{...V,key:to},O("div",{style:{display:"flex",flexDirection:"column"},children:[G("span",{children:a(B)}),typeof Y=="string"?G("span",{children:Y}):Y]}))}:void 0,ListboxComponent:Ii(function(B,Y){return O(Se,{children:[G("ul",{...B,ref:Y}),typeof y<"u"?O("div",{...B,children:[G("div",{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},children:G(eo,{})}),y()]},"creatable-footer"):null]})}),...o,sx:{"& div.MuiInputBase-root":{paddingRight:`${be(D.value)} !important`},...o.sx},onBlur:V=>{o?.onBlur?.(V),T("")},renderInput:V=>G(Gi,{placeholder:L,...V,error:!!H,...g,InputProps:{...V.InputProps,...g?.InputProps,inputRef:D.ref,endAdornment:O("div",{className:"endAdornments",children:[V.InputProps.endAdornment,g?.InputProps?.endAdornment??null,ie(D.value)?O("div",{className:"editable",children:[G("div",{className:"divider"}),G("div",{className:"button",onClick:()=>le(D.value),children:G(Te,{icon:Di,size:"24px",removeMargin:!0})})]}):null,A()&&O("div",{className:"creatable",children:[G("div",{className:"divider"}),G("div",{className:"button",onClick:P,children:G(Te,{icon:oo,size:"24px",removeMargin:!0})})]})]})}})},e)}),G(S,{name:e})]})},qi=re(_i);export{Ht as Autocomplete,wr as Checkbox,vr as Creatable,qi as CreatableV2,Ft as DatePicker,v as FieldLabel,uo as Form,Fe as FormProvider,Nr as RadioButton,Jr as RadioGroup,lr as Searchable,ai as SearchableV2,Wo as Select,vi as SelectV2,ot as Slider,$r as Switch,Ao as TextField,$t as TimePicker,ge as useForm};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@s_mart/form",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-next.0",
|
|
4
4
|
"main": "./dist/index.mjs",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"types": "./dist/index.d.mts",
|
|
@@ -11,30 +11,18 @@
|
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@hookform/resolvers": "^3.1.0",
|
|
14
|
-
"@types/lodash-es": ">=4.17.12",
|
|
15
|
-
"@types/node": "^22.7.5",
|
|
16
|
-
"@types/react": ">=18.3.1",
|
|
17
|
-
"@types/react-dom": ">=18.3.0",
|
|
18
|
-
"dayjs": "^1.11.10",
|
|
19
14
|
"lodash-es": "^4.17.21",
|
|
20
15
|
"tsup": "8.0.2",
|
|
21
|
-
"typescript": ">=5.4.2",
|
|
22
|
-
"@s_mart/core": "7.0.3",
|
|
23
|
-
"@s_mart/masks": "5.1.2",
|
|
24
16
|
"@s_mart/regular-icons": "5.3.1",
|
|
25
|
-
"@s_mart/
|
|
26
|
-
"@s_mart/solid-icons": "5.2.1",
|
|
27
|
-
"@s_mart/tokens": "5.1.0",
|
|
28
|
-
"@s_mart/typed": "6.0.0",
|
|
29
|
-
"@s_mart/utils": "5.1.1",
|
|
30
|
-
"eslint-config-smarten": "4.1.0"
|
|
17
|
+
"@s_mart/solid-icons": "5.2.1"
|
|
31
18
|
},
|
|
32
19
|
"peerDependencies": {
|
|
33
20
|
"@emotion/react": "^11.11.4",
|
|
34
|
-
"@emotion/styled": "
|
|
35
|
-
"@mui/material": "
|
|
21
|
+
"@emotion/styled": "^11.13.0",
|
|
22
|
+
"@mui/material": "^6.1.3",
|
|
36
23
|
"@mui/x-date-pickers": ">=6.3.0",
|
|
37
24
|
"@types/lodash-es": ">=4.17.12",
|
|
25
|
+
"@types/node": ">=20.0.0",
|
|
38
26
|
"@types/react": ">=18.3.1",
|
|
39
27
|
"@types/react-dom": ">=18.3.0",
|
|
40
28
|
"dayjs": "^1.11.10",
|
|
@@ -43,19 +31,31 @@
|
|
|
43
31
|
"react-hook-form": "^7.51.0",
|
|
44
32
|
"typescript": ">=5.4.2",
|
|
45
33
|
"zod": ">=3.21.4",
|
|
46
|
-
"@s_mart/core": "
|
|
47
|
-
"@s_mart/masks": "5.1.2",
|
|
34
|
+
"@s_mart/core": "8.0.0-next.0",
|
|
48
35
|
"@s_mart/rules": "5.1.1",
|
|
49
36
|
"@s_mart/tokens": "5.1.0",
|
|
37
|
+
"@s_mart/masks": "5.1.2",
|
|
50
38
|
"@s_mart/typed": "6.0.0",
|
|
51
39
|
"@s_mart/utils": "5.1.1"
|
|
52
40
|
},
|
|
53
41
|
"devDependencies": {
|
|
54
|
-
"
|
|
42
|
+
"@emotion/styled": "^11.13.0",
|
|
43
|
+
"@mui/material": "^6.1.3",
|
|
44
|
+
"@types/node": ">=20.0.0",
|
|
45
|
+
"@types/lodash-es": ">=4.17.12",
|
|
46
|
+
"@types/react": ">=18.3.1",
|
|
47
|
+
"@types/react-dom": ">=18.3.0",
|
|
48
|
+
"dayjs": "^1.11.10",
|
|
49
|
+
"typescript": ">=5.4.2",
|
|
50
|
+
"@s_mart/core": "8.0.0-next.0",
|
|
51
|
+
"@s_mart/masks": "5.1.2",
|
|
52
|
+
"@s_mart/rules": "5.1.1",
|
|
53
|
+
"@s_mart/tokens": "5.1.0",
|
|
54
|
+
"@s_mart/typed": "6.0.0",
|
|
55
|
+
"@s_mart/utils": "5.1.1"
|
|
55
56
|
},
|
|
56
57
|
"scripts": {
|
|
57
58
|
"build": "tsup src/index.tsx --minify --format esm --dts --external react",
|
|
58
|
-
"dev": "tsup src/index.tsx --format esm --watch --dts --external react"
|
|
59
|
-
"lint": "eslint src/**/*.ts* --fix"
|
|
59
|
+
"dev": "tsup src/index.tsx --format esm --watch --dts --external react"
|
|
60
60
|
}
|
|
61
61
|
}
|