@loja-integrada/admin-components 1.2.1 → 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.
@@ -0,0 +1,10 @@
1
+ import { a } from './chunk-7Z3CCBLX.js';
2
+ import { a as a$1 } from './chunk-G3GCVCTU.js';
3
+ import { a as a$2 } from './chunk-REQIQLRI.js';
4
+ import { cva } from 'class-variance-authority';
5
+ import x, { useMemo, useRef, useEffect } from 'react';
6
+ import { jsx, jsxs } from 'react/jsx-runtime';
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";
9
+
10
+ export { V as a };
@@ -0,0 +1,11 @@
1
+ import { a as a$3 } from './chunk-RB4S3T7L.js';
2
+ import { a as a$1 } from './chunk-NW24WOHT.js';
3
+ import { a } from './chunk-7Z3CCBLX.js';
4
+ import { a as a$4 } from './chunk-G3GCVCTU.js';
5
+ import { a as a$2 } from './chunk-REQIQLRI.js';
6
+ import { forwardRef, useState } from 'react';
7
+ import { jsxs, jsx } from 'react/jsx-runtime';
8
+
9
+ var L=[{label:"mm",value:"mm"},{label:"cm",value:"cm"},{label:"m",value:"m"}],S=forwardRef(({units:o=L,maxSize:b=6,className:c="",inputClassName:v="",dropdownClassName:g="",helpText:w="",disabled:r=!1,errorMessage:t="",hasError:l=!1,required:s=!1,label:C,inputPlaceholder:I,fixedUnit:n,onChangeValue:N,onChangeUnit:p},x)=>{let[E,U]=useState(o[0]);return jsxs("div",{className:`flex flex-col ${c}`,id:"input-with-unit__container",children:[jsx(a,{label:C,required:s,hasError:l||!!t,htmlFor:"input-with-unit",className:"mb-1"}),jsxs("div",{className:"flex w-full items-start gap-x-1",children:[jsx(a$1,{id:"input-with-unit",ref:x,maxLength:b,formatValue:"onlyNumber",disabled:r,hasError:l||!!t,required:s,onChange:N,placeholder:I,formGroupClassName:a$2("w-full",v)}),jsx(a$3,{id:"input-with-unit-dropdown",formGroupClassName:a$2("w-40",g),placeholder:"mm",options:o,value:n??E,onChange:i=>{n||(U({label:i.label,value:String(i.value)}),p&&p(i));},disabled:!!n||r,hasError:l||!!t})]}),jsx(a$4,{helpText:t||w,hasError:!!t})]})});S.displayName="InputWithUnit";
10
+
11
+ export { L as a, S as b };
@@ -1,15 +1,15 @@
1
- "use client";export { a as Calendar } from '../../chunk-C5JZK45Z.js';
1
+ "use client";export { a as Calendar } from '../../chunk-PHVC2M6R.js';
2
2
  import '../../chunk-KN7DOGNL.js';
3
3
  import '../../chunk-DTLT3DYY.js';
4
4
  import '../../chunk-DBWOW4GL.js';
5
+ import '../../chunk-6W6QWPEA.js';
6
+ import '../../chunk-4QFFUXWM.js';
7
+ import '../../chunk-3BKW5XAK.js';
8
+ import '../../chunk-L6H2NDVS.js';
5
9
  import '../../chunk-NW24WOHT.js';
6
10
  import '../../chunk-SJ4MATMO.js';
7
11
  import '../../chunk-7Z3CCBLX.js';
8
- import '../../chunk-N7M3KM3L.js';
9
12
  import '../../chunk-VVJUHPYS.js';
10
- import '../../chunk-4QFFUXWM.js';
11
- import '../../chunk-3BKW5XAK.js';
12
- import '../../chunk-L6H2NDVS.js';
13
13
  import '../../chunk-JZ6ZGBZ4.js';
14
14
  import '../../chunk-DVFKTOCS.js';
15
15
  import '../../chunk-DIENJUYM.js';
@@ -28,6 +28,14 @@ type InputWithUnitProps = {
28
28
  * Additional class name to be applied to the outter container.
29
29
  * */
30
30
  className?: string;
31
+ /**
32
+ * Additional class name to be applied to the input container.
33
+ * */
34
+ inputClassName?: string;
35
+ /**
36
+ * Additional class name to be applied to the dropdown container.
37
+ * */
38
+ dropdownClassName?: string;
31
39
  /**
32
40
  * Controls whether the input is disabled.
33
41
  * @default false
@@ -52,6 +60,17 @@ type InputWithUnitProps = {
52
60
  * Label for the input field.
53
61
  * */
54
62
  label: string;
63
+ /**
64
+ * Placeholder for the input field.
65
+ * */
66
+ inputPlaceholder?: string;
67
+ /**
68
+ * Sets a fixed (immutable) unit.
69
+ * */
70
+ fixedUnit?: {
71
+ label: string;
72
+ value: string;
73
+ };
55
74
  /**
56
75
  * Callback to be called when the value changes.
57
76
  * */
@@ -1,4 +1,4 @@
1
- "use client";export { a as DEFAULT_UNITS, b as InputWithUnit } from '../../chunk-G4JMDQZZ.js';
1
+ "use client";export { a as DEFAULT_UNITS, b as InputWithUnit } from '../../chunk-YNBEDPYZ.js';
2
2
  import '../../chunk-RB4S3T7L.js';
3
3
  import '../../chunk-NW24WOHT.js';
4
4
  import '../../chunk-SJ4MATMO.js';
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import { InputHelpTextProps } from '../InputHelpText';
3
+ import { InputLabelProps } from '../InputLabel';
4
+ declare const TextArea: React.MemoExoticComponent<React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<HTMLDivElement>>>;
5
+ interface TextAreaProps extends InputLabelProps, InputHelpTextProps, Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'prefix'> {
6
+ /**
7
+ * Input custom class name
8
+ * */
9
+ className?: string;
10
+ /**
11
+ * Form group custom class name
12
+ * */
13
+ formGroupClassName?: string;
14
+ /**
15
+ * Change input style to error state
16
+ * @default false
17
+ * */
18
+ hasError?: boolean;
19
+ /**
20
+ * Error message to display
21
+ * */
22
+ errorMessage?: string;
23
+ /**
24
+ * Sets initial number of lines for the textarea on render
25
+ * @default 2
26
+ * */
27
+ minLines?: number;
28
+ /**
29
+ * Sets maximum number of lines for the textarea
30
+ * @default 5
31
+ * */
32
+ maxLines?: number;
33
+ }
34
+ export { TextArea, type TextAreaProps };
@@ -0,0 +1 @@
1
+ export * from './TextArea';
@@ -0,0 +1,4 @@
1
+ export { a as TextArea } from '../../chunk-7BT5L3CO.js';
2
+ import '../../chunk-7Z3CCBLX.js';
3
+ import '../../chunk-G3GCVCTU.js';
4
+ import '../../chunk-REQIQLRI.js';
@@ -7,3 +7,4 @@ export * from './InputLabel';
7
7
  export * from './InputMask';
8
8
  export * from './InputWithUnit';
9
9
  export * from './Select';
10
+ export * from './TextArea';
@@ -1,19 +1,20 @@
1
- import '../chunk-RDFLMV5V.js';
1
+ import '../chunk-SLXIJR46.js';
2
+ export { a as TextArea } from '../chunk-7BT5L3CO.js';
2
3
  export { b as Select, a as SelectComponent } from '../chunk-HZACKBIW.js';
3
- export { a as Calendar } from '../chunk-C5JZK45Z.js';
4
+ export { a as Calendar } from '../chunk-PHVC2M6R.js';
4
5
  import '../chunk-KN7DOGNL.js';
5
6
  import '../chunk-DTLT3DYY.js';
6
7
  import '../chunk-DBWOW4GL.js';
7
- export { a as DEFAULT_UNITS, b as InputWithUnit } from '../chunk-G4JMDQZZ.js';
8
+ import '../chunk-6W6QWPEA.js';
9
+ import '../chunk-4QFFUXWM.js';
10
+ import '../chunk-3BKW5XAK.js';
11
+ import '../chunk-L6H2NDVS.js';
12
+ export { a as DEFAULT_UNITS, b as InputWithUnit } from '../chunk-YNBEDPYZ.js';
8
13
  export { a as Dropdown } from '../chunk-RB4S3T7L.js';
9
14
  export { a as InputMask } from '../chunk-NW24WOHT.js';
10
15
  export { a as Input } from '../chunk-SJ4MATMO.js';
11
16
  export { a as InputLabel } from '../chunk-7Z3CCBLX.js';
12
- import '../chunk-N7M3KM3L.js';
13
17
  import '../chunk-VVJUHPYS.js';
14
- import '../chunk-4QFFUXWM.js';
15
- import '../chunk-3BKW5XAK.js';
16
- import '../chunk-L6H2NDVS.js';
17
18
  import '../chunk-JZ6ZGBZ4.js';
18
19
  import '../chunk-DVFKTOCS.js';
19
20
  export { a as Checkbox } from '../chunk-DIENJUYM.js';
package/dist/index.js CHANGED
@@ -1,30 +1,31 @@
1
- import './chunk-RDFLMV5V.js';
1
+ import './chunk-SLXIJR46.js';
2
+ export { a as TextArea } from './chunk-7BT5L3CO.js';
2
3
  import './chunk-7RP4L6ZM.js';
3
4
  import './chunk-4PUGMMDC.js';
4
- export { a as Badge } from './chunk-7NXFX6TD.js';
5
- export { a as Tag } from './chunk-EUZRZJ5Q.js';
6
- export { b as ToastContainer, a as notify } from './chunk-RXFTQHN7.js';
7
5
  export { a as Tooltip } from './chunk-TZI6YTCW.js';
8
6
  export { a as Breadcrumb } from './chunk-TSAI6WF3.js';
9
7
  export { a as HelpLink } from './chunk-N224DIUR.js';
10
8
  export { c as DEFAULT_OPTIONS, d as Pagination, a as PaginationInfo, b as PaginationNav } from './chunk-LYUEZJYR.js';
11
9
  export { b as Select, a as SelectComponent } from './chunk-HZACKBIW.js';
12
10
  export { a as Stepper } from './chunk-I7PCF2VW.js';
13
- export { a as Calendar } from './chunk-C5JZK45Z.js';
11
+ export { a as Calendar } from './chunk-PHVC2M6R.js';
14
12
  import './chunk-KN7DOGNL.js';
15
13
  export { a as IconCircular } from './chunk-DTLT3DYY.js';
16
14
  import './chunk-DBWOW4GL.js';
17
- export { a as DEFAULT_UNITS, b as InputWithUnit } from './chunk-G4JMDQZZ.js';
15
+ export { a as ActionBar } from './chunk-6W6QWPEA.js';
16
+ export { b as Box, d as BoxContent, c as BoxHeader, a as BoxSeparator } from './chunk-4QFFUXWM.js';
17
+ export { a as Container, b as ContainerHeader } from './chunk-3BKW5XAK.js';
18
+ import './chunk-L6H2NDVS.js';
19
+ export { a as DEFAULT_UNITS, b as InputWithUnit } from './chunk-YNBEDPYZ.js';
18
20
  export { a as Dropdown } from './chunk-RB4S3T7L.js';
19
21
  export { a as InputMask } from './chunk-NW24WOHT.js';
20
22
  export { a as Input } from './chunk-SJ4MATMO.js';
21
23
  export { a as InputLabel } from './chunk-7Z3CCBLX.js';
22
- export { a as ActionBar } from './chunk-N7M3KM3L.js';
23
- export { a as Button } from './chunk-VVJUHPYS.js';
24
- export { b as Box, d as BoxContent, c as BoxHeader, a as BoxSeparator } from './chunk-4QFFUXWM.js';
25
- export { a as Container, b as ContainerHeader } from './chunk-3BKW5XAK.js';
26
- import './chunk-L6H2NDVS.js';
27
24
  export { a as Alert } from './chunk-NGGA7AJU.js';
25
+ export { a as Badge } from './chunk-7NXFX6TD.js';
26
+ export { a as Tag } from './chunk-EUZRZJ5Q.js';
27
+ export { a as Button } from './chunk-VVJUHPYS.js';
28
+ export { b as ToastContainer, a as notify } from './chunk-RXFTQHN7.js';
28
29
  export { a as DataTable } from './chunk-JZ6ZGBZ4.js';
29
30
  import './chunk-DVFKTOCS.js';
30
31
  export { a as Checkbox } from './chunk-DIENJUYM.js';
@@ -1,10 +1,10 @@
1
1
  import '../chunk-7RP4L6ZM.js';
2
+ export { a as Tooltip } from '../chunk-TZI6YTCW.js';
3
+ export { a as Alert } from '../chunk-NGGA7AJU.js';
2
4
  export { a as Badge } from '../chunk-7NXFX6TD.js';
3
5
  export { a as Tag } from '../chunk-EUZRZJ5Q.js';
4
- export { b as ToastContainer, a as notify } from '../chunk-RXFTQHN7.js';
5
- export { a as Tooltip } from '../chunk-TZI6YTCW.js';
6
6
  import '../chunk-VVJUHPYS.js';
7
- export { a as Alert } from '../chunk-NGGA7AJU.js';
7
+ export { b as ToastContainer, a as notify } from '../chunk-RXFTQHN7.js';
8
8
  import '../chunk-LTWCICTK.js';
9
9
  import '../chunk-KEDPPRQK.js';
10
10
  import '../chunk-G2ZF74EK.js';
@@ -1,6 +1,6 @@
1
- "use client";export { a as ActionBar } from '../../chunk-N7M3KM3L.js';
2
- import '../../chunk-VVJUHPYS.js';
1
+ "use client";export { a as ActionBar } from '../../chunk-6W6QWPEA.js';
3
2
  import '../../chunk-L6H2NDVS.js';
3
+ import '../../chunk-VVJUHPYS.js';
4
4
  import '../../chunk-LTWCICTK.js';
5
5
  import '../../chunk-KEDPPRQK.js';
6
6
  import '../../chunk-G2ZF74EK.js';
@@ -1,9 +1,9 @@
1
1
  import '../chunk-DBWOW4GL.js';
2
- export { a as ActionBar } from '../chunk-N7M3KM3L.js';
3
- import '../chunk-VVJUHPYS.js';
2
+ export { a as ActionBar } from '../chunk-6W6QWPEA.js';
4
3
  export { b as Box, d as BoxContent, c as BoxHeader, a as BoxSeparator } from '../chunk-4QFFUXWM.js';
5
4
  export { a as Container, b as ContainerHeader } from '../chunk-3BKW5XAK.js';
6
5
  import '../chunk-L6H2NDVS.js';
6
+ import '../chunk-VVJUHPYS.js';
7
7
  import '../chunk-LTWCICTK.js';
8
8
  import '../chunk-KEDPPRQK.js';
9
9
  import '../chunk-G2ZF74EK.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loja-integrada/admin-components",
3
- "version": "1.2.1",
3
+ "version": "1.3.1",
4
4
  "author": "Loja Integrada",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -141,6 +141,10 @@
141
141
  "types": "./dist/forms/Select/Select.d.ts",
142
142
  "import": "./dist/forms/Select/index.js"
143
143
  },
144
+ "./TextArea": {
145
+ "types": "./dist/forms/TextArea/TextArea.d.ts",
146
+ "import": "./dist/forms/TextArea/index.js"
147
+ },
144
148
  "./hooks": {
145
149
  "types": "./dist/hooks/hooks.d.ts",
146
150
  "import": "./dist/hooks/index.js"
@@ -1,10 +0,0 @@
1
- import { a as a$2 } from './chunk-RB4S3T7L.js';
2
- import { a as a$1 } from './chunk-NW24WOHT.js';
3
- import { a } from './chunk-7Z3CCBLX.js';
4
- import { a as a$3 } from './chunk-G3GCVCTU.js';
5
- import { forwardRef, useState } from 'react';
6
- import { jsxs, jsx } from 'react/jsx-runtime';
7
-
8
- var N=[{label:"mm",value:"mm"},{label:"cm",value:"cm"},{label:"m",value:"m"}],U=forwardRef(({units:i=N,maxSize:h=6,className:f="",helpText:b="",disabled:a$4=!1,errorMessage:t="",hasError:l=!1,required:o=!1,label:v,onChangeValue:c,onChangeUnit:r},g)=>{let[x,I]=useState(i[0]);return jsxs("div",{className:`flex flex-col ${f}`,id:"input-with-unit__container",children:[jsx(a,{label:v,required:o,hasError:l||!!t,htmlFor:"input-with-unit",className:"mb-1"}),jsxs("div",{className:"flex w-full items-start gap-x-1",children:[jsx(a$1,{id:"input-with-unit",ref:g,maxLength:h,formatValue:"onlyNumber",disabled:a$4,hasError:l||!!t,required:o,onChange:c,formGroupClassName:"w-full"}),jsx(a$2,{id:"input-with-unit-dropdown",formGroupClassName:"w-28",placeholder:"mm",options:i,value:x,onChange:n=>{I({label:n.label,value:String(n.value)}),r&&r(n);},disabled:a$4,hasError:l||!!t})]}),jsx(a$3,{helpText:t||b,hasError:!!t})]})});U.displayName="InputWithUnit";
9
-
10
- export { N as a, U as b };
@@ -1,5 +1,5 @@
1
- import { a as a$1 } from './chunk-VVJUHPYS.js';
2
1
  import { a } from './chunk-L6H2NDVS.js';
2
+ import { a as a$1 } from './chunk-VVJUHPYS.js';
3
3
  import s, { memo, useState, useEffect } from 'react';
4
4
  import { jsx, jsxs } from 'react/jsx-runtime';
5
5
 
@@ -1,6 +1,6 @@
1
+ import { b } from './chunk-4QFFUXWM.js';
1
2
  import { a as a$1 } from './chunk-NW24WOHT.js';
2
3
  import { a as a$2 } from './chunk-VVJUHPYS.js';
3
- import { b } from './chunk-4QFFUXWM.js';
4
4
  import { a } from './chunk-KEDPPRQK.js';
5
5
  import { subDays, subMonths, addDays, parse, isBefore, isValid, isWithinInterval, isEqual, isAfter, format } from 'date-fns';
6
6
  import { ptBR } from 'date-fns/locale/pt-BR';
File without changes