@mvr-ui/components 1.0.13 → 1.0.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.
package/dist/page.d.mts CHANGED
@@ -62,7 +62,6 @@ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "
62
62
  value?: string;
63
63
  onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
64
64
  }
65
- declare const Input: React$1.ForwardRefExoticComponent<InputProps & React$1.RefAttributes<HTMLInputElement>>;
66
65
  declare const InputPrimitive: (props: InputProps & React$1.RefAttributes<HTMLInputElement>) => react_jsx_runtime.JSX.Element;
67
66
 
68
67
  interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
@@ -142,4 +141,4 @@ interface HelperFieldProps {
142
141
  }
143
142
  declare const HelperFieldPrimitive: (props: HelperFieldProps) => react_jsx_runtime.JSX.Element;
144
143
 
145
- export { ButtonPrimitive, ButtonProps, CardPrimitive, CardProps, CheckBoxPrimitive, CheckBoxProps, HelperFieldPrimitive, HelperFieldProps, Input, InputPrimitive, LabelPrimitive, LabelProps, LicenseProvider, RadioPrimitive, RadioProps, SelectPrimitive, SelectProps, SwitchPrimitive, SwitchProps, TextAreaPrimitive, TextAreaProps, ValidateFieldPrimitive, ValidateFieldProps };
144
+ export { ButtonPrimitive, ButtonProps, CardPrimitive, CardProps, CheckBoxPrimitive, CheckBoxProps, HelperFieldPrimitive, HelperFieldProps, InputPrimitive, InputProps, LabelPrimitive, LabelProps, LicenseProvider, RadioPrimitive, RadioProps, SelectPrimitive, SelectProps, SwitchPrimitive, SwitchProps, TextAreaPrimitive, TextAreaProps, ValidateFieldPrimitive, ValidateFieldProps };
package/dist/page.d.ts CHANGED
@@ -62,7 +62,6 @@ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "
62
62
  value?: string;
63
63
  onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
64
64
  }
65
- declare const Input: React$1.ForwardRefExoticComponent<InputProps & React$1.RefAttributes<HTMLInputElement>>;
66
65
  declare const InputPrimitive: (props: InputProps & React$1.RefAttributes<HTMLInputElement>) => react_jsx_runtime.JSX.Element;
67
66
 
68
67
  interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
@@ -142,4 +141,4 @@ interface HelperFieldProps {
142
141
  }
143
142
  declare const HelperFieldPrimitive: (props: HelperFieldProps) => react_jsx_runtime.JSX.Element;
144
143
 
145
- export { ButtonPrimitive, ButtonProps, CardPrimitive, CardProps, CheckBoxPrimitive, CheckBoxProps, HelperFieldPrimitive, HelperFieldProps, Input, InputPrimitive, LabelPrimitive, LabelProps, LicenseProvider, RadioPrimitive, RadioProps, SelectPrimitive, SelectProps, SwitchPrimitive, SwitchProps, TextAreaPrimitive, TextAreaProps, ValidateFieldPrimitive, ValidateFieldProps };
144
+ export { ButtonPrimitive, ButtonProps, CardPrimitive, CardProps, CheckBoxPrimitive, CheckBoxProps, HelperFieldPrimitive, HelperFieldProps, InputPrimitive, InputProps, LabelPrimitive, LabelProps, LicenseProvider, RadioPrimitive, RadioProps, SelectPrimitive, SelectProps, SwitchPrimitive, SwitchProps, TextAreaPrimitive, TextAreaProps, ValidateFieldPrimitive, ValidateFieldProps };
package/dist/page.js CHANGED
@@ -21,7 +21,6 @@ exports.ButtonPrimitive = Tr;
21
21
  exports.CardPrimitive = Er;
22
22
  exports.CheckBoxPrimitive = Zr;
23
23
  exports.HelperFieldPrimitive = Xe;
24
- exports.Input = Ye;
25
24
  exports.InputPrimitive = Mo;
26
25
  exports.LabelPrimitive = C;
27
26
  exports.LicenseProvider = ct;
package/dist/page.mjs CHANGED
@@ -10,4 +10,4 @@ var be=createContext(void 0),lt=({message:e})=>jsx("div",{className:"flex justif
10
10
  hover:bg-gray-100
11
11
  ${s??""}`,onClick:()=>l(d),role:"option","aria-selected":u,children:String(d[t])},g)}):jsx("li",{className:"px-3 py-2 text-gray-500",children:ne(i,"Nenhuma op\xE7\xE3o encontrada")})});var Qt=({label:e,labelKey:t,valueKey:r,typeSet:o="object",options:n,required:i=!1,errors:a,name:s,placeholder:c,placeholderOptions:l,className:d,dropDownClassName:g,optionClassName:u,allowClear:f=!1,control:x,mode:b="single",...p})=>{let{handleSelect:L,isOpen:k,setIsOpen:N,searchTerm:h,setSearchTerm:A,activeIndex:I,setActiveIndex:S}=Q(o),v=useRef(null);Ke(v,()=>N(!1));let E=ce(n,t,h),H=tt(),F=rt(o),K=et(o),fe=kt("bg-white px-2 py-3 w-full text-stone-400 text-sm font-normal leading-tight border-2 border-opacity-0 shadow-input rounded-lg focus:outline-none focus:border-blue-500 border-neutral-400",{"border-[#DD052B] border-opacity-80 shadow-inputError":!!a},d??""),ee=(y,$)=>$==="multiple"?y.map(te=>te.value):T(y)?[y[0]?.value]:[];return jsxs("div",{className:"flex flex-col w-container gap-2",children:[e&&jsx(C,{htmlFor:s,className:"font-poppins text-[14px] font-medium leading-[21px] text-colorLight dark:text-colorDark",required:i,children:e}),jsx(Controller,{name:s,control:x,render:({field:y})=>{let $=F(b==="multiple"?y.value:[y.value],n,t,r),te=b!=="multiple"||oe($)||k;return jsxs("div",{ref:v,className:"relative w-container",children:[jsxs("div",{className:"flex flex-col justify-center items-center",children:[jsxs("button",{className:`flex flex-wrap items-center w-full gap-2 p-2 min-h-12 ${fe}`,type:"button",onClick:()=>N(!0),children:[b=="multiple"&&$?.map(R=>jsxs("div",{className:"flex items-center bg-blue-100 text-blue-800 px-2 py-1 rounded-full text-xs gap-1",children:[String(R.label),jsx("span",{className:"text-blue-500 hover:text-blue-700 cursor-pointer",onClick:()=>H(R.value,y.onChange,y.value,r),children:"\xD7"})]},String(R.value))),te&&jsx("input",{...p,type:"text",className:"flex-1 min-w-[50px] bg-transparent focus:outline-none",value:h,onFocus:()=>N(!0),onChange:R=>A(R.target.value),onKeyDown:R=>K(R,y.onChange,y.value,b,t,r,E,A,N,S,h,k,I),placeholder:oe($)?"":c,role:"combobox","aria-autocomplete":"list","aria-expanded":k,"aria-haspopup":"listbox","aria-controls":`${s}-listbox`,"aria-activedescendant":y.value?`${s}-option-${y.value}`:void 0})]}),f&&(h?.length>0||T($)||U(h,h))&&jsx(Y,{className:"absolute right-2 cursor-pointer text-neutral-500 hover:text-neutral-700 text-xl",onClick:R=>{R.stopPropagation(),y.onChange(null),A("");}})]}),k&&jsx(ot,{name:s,labelKey:t,valueKey:r,selectedValues:ee($,b),data:E,onSelect:R=>L(R,y.onChange,y.value,b,t,r),placeholderOptions:l,dropDownClassName:g,optionClassName:u,activeIndex:I})]})}}),a&&jsx(w,{children:a})]})},Hn=m(Qt);var Kt=(e,t)=>useMemo(()=>{let r=e?`${e}-group`:void 0,o=e&&t?`${e}-error`:void 0;return {groupId:r,errorId:o,ariaProps:{"aria-labelledby":r,"aria-invalid":t?"true":void 0,"aria-errormessage":t?o:void 0}}},[e,t]),nt=Kt;var er=({name:e,label:t,required:r,errors:o,className:n,option:i,...a})=>{let{groupId:s,errorId:c,ariaProps:l}=nt(e,o);return jsxs("div",{className:`switch-group ${n}`,children:[t&&jsx(C,{htmlFor:e,id:s,className:"font-poppins text-[14px] font-medium leading-[21px] text-colorLight dark:text-colorDark",required:r,children:t}),jsx("div",{...l,children:jsxs(C,{htmlFor:e,className:"flex items-center gap-2 cursor-pointer",children:[jsxs("div",{className:"relative inline-block w-12 h-6",children:[jsx("input",{id:e,name:e,type:"checkbox",className:"opacity-0 w-0 h-0 peer","data-testid":"INPUT_SWITCH"+e,"aria-describedby":c,...a}),jsx("span",{className:"absolute cursor-pointer top-0 left-0 right-0 bottom-0 bg-gray-300 rounded-full transition duration-300 before:absolute before:content-[''] before:h-5 before:w-5 before:left-0.5 before:bottom-0.5 before:bg-white before:rounded-full before:transition before:duration-300 peer-checked:bg-blue-600 peer-checked:before:translate-x-6"})]}),i]})}),o&&jsx(w,{children:o})]})},_n=m(er);var or=({label:e,required:t=!1,errors:r,name:o,maxLength:n,className:i,...a})=>{let[s,c]=useState(0),l=kt("px-2 py-3 w-full text-stone-400 text-sm font-normal leading-tight border-2 border-opacity-0 shadow-input rounded-lg focus:outline-none focus:border-blue-500 border-neutral-400",{"border-[#DD052B] border-opacity-80 shadow-inputError":!!r},i??"");return jsxs("div",{className:"flex flex-col w-full gap-2",children:[e&&jsx(C,{htmlFor:o,className:"font-poppins text-[14px] font-medium leading-[21px] text-colorLight dark:text-colorDark",required:t,children:e}),jsxs("div",{className:"flex flex-col justify-center items-end w-full gap-1",children:[jsx("textarea",{...a,"data-testid":"TEXT_AREA"+o,name:o,maxLength:n,className:l,onInput:d=>c(d.currentTarget.textLength)}),n&&jsx("div",{children:jsxs("p",{children:[s," / ",n]})})]}),r&&jsx(w,{children:r})]})},Zn=m(or);
12
12
 
13
- export { Tr as ButtonPrimitive, Er as CardPrimitive, Zr as CheckBoxPrimitive, Xe as HelperFieldPrimitive, Ye as Input, Mo as InputPrimitive, C as LabelPrimitive, ct as LicenseProvider, Xo as RadioPrimitive, Hn as SelectPrimitive, _n as SwitchPrimitive, Zn as TextAreaPrimitive, w as ValidateFieldPrimitive };
13
+ export { Tr as ButtonPrimitive, Er as CardPrimitive, Zr as CheckBoxPrimitive, Xe as HelperFieldPrimitive, Mo as InputPrimitive, C as LabelPrimitive, ct as LicenseProvider, Xo as RadioPrimitive, Hn as SelectPrimitive, _n as SwitchPrimitive, Zn as TextAreaPrimitive, w as ValidateFieldPrimitive };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mvr-ui/components",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "sideEffects": false,
5
5
  "main": "dist/page.cjs",
6
6
  "module": "dist/page.js",