@loja-integrada/admin-components 1.3.0 → 1.3.1

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.
@@ -5,6 +5,6 @@ import { cva } from 'class-variance-authority';
5
5
  import x, { useMemo, useRef, useEffect } from 'react';
6
6
  import { jsx, jsxs } from 'react/jsx-runtime';
7
7
 
8
- var i=24,O=cva("relative appearance-none overflow-hidden rounded border border-card-stroke bg-base-1 px-4 py-3 shadow-none outline-none transition-colors focus-within:border-inverted-1 focus:border-inverted-1",{variants:{hasErrorState:{true:"border-danger focus:border-danger [&~.adornment]:border-danger [&~.adornment]:focus:border-danger"},disabled:{true:"pointer-events-none bg-base-3 text-on-base-2"},readOnly:{true:"bg-base-2"}},defaultVariants:{hasErrorState:!1,disabled:!1,readOnly:!1}}),k=({className:g="",formGroupClassName:T="",label:v,labelComplement:H,helpText:w,hasError:y=!1,errorMessage:l,required:d=!1,id:E,name:p,disabled:c,readOnly:f,minLines:n=2,maxLines:I=5,...A},L)=>{let N=useMemo(()=>Math.random().toString(36).substring(7),[]),m=E||p||N,a$3=y||!!l,R=jsx(a,{label:v,labelComplement:H,required:d,hasError:a$3,htmlFor:m,className:"mb-1"}),P=jsx(a$1,{helpText:l||w,hasError:a$3,className:"mt-2"}),r=useRef(null),M=()=>{let e=r.current;if(e){let t=I*i,u=n*i;e.scrollHeight>t?(e.style.height="auto",e.style.height=`${t}px`):e.scrollHeight<u?(e.style.height="auto",e.style.height=`${u}px`):(e.style.height="auto",e.style.height=`${e.scrollHeight}px`);}};return useEffect(()=>{let e=r.current;if(e){let t=n*i;e.style.height=`${t}px`;}},[r,n]),jsxs("div",{className:a$2("form-group flex flex-col ",T),ref:L,children:[R,jsx("div",{className:a$2("relative appearance-none overflow-hidden rounded border border-card-stroke bg-base-1 px-4 py-3 shadow-none outline-none transition-colors focus-within:border-inverted-1 focus:border-inverted-1",O({hasErrorState:a$3,disabled:c,readOnly:f,className:g})),children:jsx("textarea",{ref:r,onInput:M,className:"peer text-f6 flex w-full min-w-0 resize-none bg-transparent text-on-base shadow-none outline-none transition-colors focus-within:border-inverted-1 focus:border-inverted-1",id:m,name:p,required:d,disabled:c,readOnly:f,...A})}),P]})},G=x.forwardRef(k),V=x.memo(G);V.displayName="TextArea";
8
+ var i=24,O=cva("relative appearance-none overflow-hidden rounded border border-card-stroke bg-base-1 px-4 py-3 shadow-none outline-none transition-colors focus-within:border-inverted-1 focus:border-inverted-1",{variants:{hasErrorState:{true:"border-danger focus:border-danger [&~.adornment]:border-danger [&~.adornment]:focus:border-danger"},disabled:{true:"pointer-events-none bg-base-3 text-on-base-2"},readOnly:{true:"bg-base-2"}},defaultVariants:{hasErrorState:!1,disabled:!1,readOnly:!1}}),k=({className:g="",formGroupClassName:T="",label:v,labelComplement:H,helpText:w,hasError:y=!1,errorMessage:l,required:d=!1,id:E,name:p,disabled:c,readOnly:f,minLines:n=2,maxLines:I=5,...A},L)=>{let N=useMemo(()=>Math.random().toString(36).substring(7),[]),m=E||p||N,a$3=y||!!l,R=jsx(a,{label:v,labelComplement:H,required:d,hasError:a$3,htmlFor:m,className:"mb-1"}),P=jsx(a$1,{helpText:l||w,hasError:a$3,className:"mt-2"}),r=useRef(null),M=()=>{let e=r.current;if(e){let t=I*i,u=n*i;e.scrollHeight>t?(e.style.height="auto",e.style.height=`${t}px`):e.scrollHeight<=u?(e.style.height="auto",e.style.height=`${u}px`):(e.style.height="auto",e.style.height=`${e.scrollHeight}px`);}};return useEffect(()=>{let e=r.current;if(e){let t=n*i;e.style.height=`${t}px`;}},[r,n]),jsxs("div",{className:a$2("form-group flex flex-col ",T),ref:L,children:[R,jsx("div",{className:a$2("relative appearance-none overflow-hidden rounded border border-card-stroke bg-base-1 px-4 py-3 shadow-none outline-none transition-colors focus-within:border-inverted-1 focus:border-inverted-1",O({hasErrorState:a$3,disabled:c,readOnly:f,className:g})),children:jsx("textarea",{ref:r,onInput:M,className:"peer text-f6 flex w-full min-w-0 resize-none bg-transparent text-on-base shadow-none outline-none transition-colors focus-within:border-inverted-1 focus:border-inverted-1",id:m,name:p,required:d,disabled:c,readOnly:f,...A})}),P]})},G=x.forwardRef(k),V=x.memo(G);V.displayName="TextArea";
9
9
 
10
10
  export { V as a };
@@ -1,4 +1,4 @@
1
- export { a as TextArea } from '../../chunk-UIXQQMI7.js';
1
+ export { a as TextArea } from '../../chunk-7BT5L3CO.js';
2
2
  import '../../chunk-7Z3CCBLX.js';
3
3
  import '../../chunk-G3GCVCTU.js';
4
4
  import '../../chunk-REQIQLRI.js';
@@ -1,5 +1,5 @@
1
1
  import '../chunk-SLXIJR46.js';
2
- export { a as TextArea } from '../chunk-UIXQQMI7.js';
2
+ export { a as TextArea } from '../chunk-7BT5L3CO.js';
3
3
  export { b as Select, a as SelectComponent } from '../chunk-HZACKBIW.js';
4
4
  export { a as Calendar } from '../chunk-PHVC2M6R.js';
5
5
  import '../chunk-KN7DOGNL.js';
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import './chunk-SLXIJR46.js';
2
- export { a as TextArea } from './chunk-UIXQQMI7.js';
2
+ export { a as TextArea } from './chunk-7BT5L3CO.js';
3
3
  import './chunk-7RP4L6ZM.js';
4
4
  import './chunk-4PUGMMDC.js';
5
5
  export { a as Tooltip } from './chunk-TZI6YTCW.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loja-integrada/admin-components",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "author": "Loja Integrada",
5
5
  "license": "MIT",
6
6
  "repository": {