@loja-integrada/admin-components 1.3.5 → 1.3.7
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/chunk-6RTGFDXR.js +11 -0
- package/dist/{chunk-AUYKYD3L.js → chunk-VELH5CA2.js} +1 -1
- package/dist/forms/Dropdown/Dropdown.client.d.ts +1 -1
- package/dist/forms/Dropdown/index.js +1 -1
- package/dist/forms/InputWithUnit/InputWithUnit.client.d.ts +7 -0
- package/dist/forms/InputWithUnit/index.js +2 -2
- package/dist/forms/index.js +2 -2
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-GIQ4GFAU.js +0 -11
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { a as a$3 } from './chunk-VELH5CA2.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 S=[{label:"mm",value:"mm"},{label:"cm",value:"cm"},{label:"m",value:"m"}],W=forwardRef(({units:r=S,maxSize:b=6,className:g="",inputClassName:v="",dropdownClassName:c="",helpText:w="",disabled:o=!1,errorMessage:t="",hasError:l=!1,required:s=!1,label:C,inputPlaceholder:I,defaultUnit:N,fixedUnit:n,onChangeValue:x,onChangeUnit:p},U)=>{let[E,T]=useState(r[0]);return jsxs("div",{className:`flex flex-col ${g}`,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:U,maxLength:b,formatValue:"onlyNumber",disabled:o,hasError:l||!!t,required:s,onChange:x,placeholder:I,formGroupClassName:a$2("w-full",v)}),jsx(a$3,{id:"input-with-unit-dropdown",formGroupClassName:a$2("w-40",c),placeholder:"mm",options:r,value:n??N??E,onChange:i=>{n||(T({label:i.label,value:String(i.value)}),p&&p(i));},disabled:!!n||o,hasError:l||!!t})]}),jsx(a$4,{helpText:t||w,hasError:!!t})]})});W.displayName="InputWithUnit";
|
|
10
|
+
|
|
11
|
+
export { S as a, W as b };
|
|
@@ -9,6 +9,6 @@ import q, { components } from 'react-select';
|
|
|
9
9
|
import A from 'react-select/creatable';
|
|
10
10
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
11
11
|
|
|
12
|
-
var K=cva("flex w-full cursor-pointer items-center border bg-base-1 transition-colors",{variants:{size:{small:"text-f7 h-10",default:"text-f6 h-12",large:"text-f5 h-14",xlarge:"text-f4 h-24"},variant:{default:"rounded border-card-stroke font-normal text-on-base",secondary:"rounded-md border-inverted-2 font-semibold shadow-inner hover:bg-base-3 focus:bg-base-1 focus:ring-2 focus:ring-focus focus:ring-offset-2"},disabled:{true:"pointer-events-none bg-base-3 text-on-base-2"},readOnly:{true:"pointer-events-none bg-base-2"},hasErrorState:{true:"border-danger focus:border-danger"}},defaultVariants:{variant:"default",size:"default",hasErrorState:!1,disabled:!1,readOnly:!1}}),{Option:Q,DropdownIndicator:U}=components,Y=r=>{let{selectProps:s}=r,t=`transform transition duration-200 ${s.menuIsOpen?"rotate-180":"rotate-0"} text-inverted-2`;return jsx(U,{...r,className:"mr-2",children:jsx(a$3,{icon:"sortDown",size:5,className:t})})},Z=r=>{let{data:s,removeProps:t}=r;return jsxs("div",{...r,className:"selected-option mr-2 flex items-center gap-x-1.5 rounded-sm bg-primary-light px-2 text-inverted-1",children:[jsx("span",{className:"text-f7 truncate font-semibold",children:s.label}),jsx("div",{onClick:t.onClick,...t,className:"cursor-pointer",children:jsx(a$3,{icon:"close",size:3})})]})},_=r=>{let{isSelected:s,isDisabled:t,isFocused:a$1,data:n,isMulti:i}=r,c=useMemo(()=>n.element?n.element:jsx(Fragment,{children:i?jsx(a$4,{label:n.label,checked:s}):jsxs(Fragment,{children:[n.icon?jsx(a$3,{icon:n.icon,className:"mr-2"}):null,n.label]})}),[n,s,i]);return jsx(Q,{...r,className:a("text-f6 first:mt-2 last:mb-2 py-2 px-5 font-semibold transition-colors flex items-center",t?"opacity-50 cursor-not-allowed":"hover:text-on-base hover:bg-inverted-2/5 cursor-pointer",s?"text-inverted-1":"text-inverted-2",a$1&&"bg-inverted-2/5"),children:c})},ee=({options:r,isSearchable:s=!1,allowCreation:t=!1,isMultivalued:a$3=!1,onChange:n,onMultiChange:i,onBlur:c,size:S="default",variant:I="default",placeholder:y="Selecione um item",emptyMessage:M="Nenhuma op\xE7\xE3o dispon\xEDvel",hasError:
|
|
12
|
+
var K=cva("flex w-full cursor-pointer items-center border bg-base-1 transition-colors",{variants:{size:{small:"text-f7 h-10",default:"text-f6 h-12",large:"text-f5 h-14",xlarge:"text-f4 h-24"},variant:{default:"rounded border-card-stroke font-normal text-on-base",secondary:"rounded-md border-inverted-2 font-semibold shadow-inner hover:bg-base-3 focus:bg-base-1 focus:ring-2 focus:ring-focus focus:ring-offset-2"},disabled:{true:"pointer-events-none bg-base-3 text-on-base-2"},readOnly:{true:"pointer-events-none bg-base-2"},hasErrorState:{true:"border-danger focus:border-danger"}},defaultVariants:{variant:"default",size:"default",hasErrorState:!1,disabled:!1,readOnly:!1}}),{Option:Q,DropdownIndicator:U}=components,Y=r=>{let{selectProps:s}=r,t=`transform transition duration-200 ${s.menuIsOpen?"rotate-180":"rotate-0"} text-inverted-2`;return jsx(U,{...r,className:"mr-2",children:jsx(a$3,{icon:"sortDown",size:5,className:t})})},Z=r=>{let{data:s,removeProps:t}=r;return jsxs("div",{...r,className:"selected-option mr-2 flex items-center gap-x-1.5 rounded-sm bg-primary-light px-2 text-inverted-1",children:[jsx("span",{className:"text-f7 truncate font-semibold",children:s.label}),jsx("div",{onClick:t.onClick,...t,className:"cursor-pointer",children:jsx(a$3,{icon:"close",size:3})})]})},_=r=>{let{isSelected:s,isDisabled:t,isFocused:a$1,data:n,isMulti:i}=r,c=useMemo(()=>n.element?n.element:jsx(Fragment,{children:i?jsx(a$4,{label:n.label,checked:s}):jsxs(Fragment,{children:[n.icon?jsx(a$3,{icon:n.icon,className:"mr-2"}):null,n.label]})}),[n,s,i]);return jsx(Q,{...r,className:a("text-f6 first:mt-2 last:mb-2 py-2 px-5 font-semibold transition-colors flex items-center",t?"opacity-50 cursor-not-allowed":"hover:text-on-base hover:bg-inverted-2/5 cursor-pointer",s?"text-inverted-1":"text-inverted-2",a$1&&"bg-inverted-2/5"),children:c})},ee=({options:r,isSearchable:s=!1,allowCreation:t=!1,isMultivalued:a$3=!1,onChange:n,onMultiChange:i,onBlur:c,size:S="default",variant:I="default",placeholder:y="Selecione um item",emptyMessage:M="Nenhuma op\xE7\xE3o dispon\xEDvel",hasError:V=!1,errorMessage:g,helpText:D,label:N,labelComplement:L,id:E,name:W,required:k=!1,disabled:h,readOnly:m,maxMenuHeight:G=300,menuPosition:B="absolute",menuPlacement:z="auto",menuWidth:R="100%",menuHorizontalPlacement:l,formGroupClassName:T="",value:F},H)=>{let X=useMemo(()=>Math.random().toString(36).substring(7),[]),x=E||W||X,p=V||!!g,$=useMemo(()=>t?A:q,[t]);return jsxs("div",{className:a("form-group flex flex-col",T),children:[jsx(a$1,{label:N,labelComplement:L,required:k,hasError:p,htmlFor:x,className:"mb-1"}),jsx($,{id:x,ref:H,value:F,classNamePrefix:"select",options:r,isSearchable:t||s,blurInputOnSelect:!a$3,isMulti:a$3,hideSelectedOptions:!1,closeMenuOnSelect:!a$3,isDisabled:h||m,maxMenuHeight:G,menuPortalTarget:document?.body,menuPosition:B,menuPlacement:z,placeholder:y,noOptionsMessage:({inputValue:e})=>e?`Nenhum resultado para "${e}"`:M,formatCreateLabel:e=>`Selecionar "${e}"`,onChange:e=>{a$3&&i?i(e):n&&e&&n(e);},onBlur:e=>c?.(e),components:{Option:e=>_(e),DropdownIndicator:e=>Y(e),MultiValue:e=>Z(e),ClearIndicator:()=>null},classNames:{input:()=>t?"":"absolute !mx-0",noOptionsMessage:()=>"text-on-base-3 text-f6 font-semibold break-words",valueContainer:()=>"w-full min-h-10",singleValue:()=>"truncate",placeholder:()=>"w-full truncate pr-2 h-full text-on-base-3",control:({isFocused:e})=>a(K({variant:I,size:S,hasErrorState:p,disabled:h,readOnly:m}),e&&!p&&!m&&"border-inverted-1"),groupHeading:()=>"px-5 text-on-base-3 text-f7 font-semibold uppercase"},styles:{option:()=>({}),control:()=>({}),menu:e=>({...e,width:R,backgroundColor:"rgb(var(--color-base-1) / 100)",zIndex:999,...l&&l==="left"&&{left:0},...l&&l==="right"&&{right:0}}),menuPortal:e=>({...e,zIndex:9999}),indicatorSeparator:()=>({}),groupHeading:()=>({}),singleValue:()=>({maxWidth:"calc(100% - 6px)"}),valueContainer:e=>({...e,paddingLeft:16,display:"flex",flexWrap:"nowrap",alignItems:"center",overflowX:"auto",msOverflowStyle:"none",scrollbarWidth:"none","::-webkit-scrollbar":{display:"none"}}),placeholder:()=>({}),multiValue:e=>({...e,overflow:"scroll",display:"flex",flexWrap:"nowrap",overflowX:"auto",scrollbarWidth:"thin",msOverflowStyle:"auto",whiteSpace:"nowrap"})}}),jsx(a$2,{helpText:g||D,hasError:p,className:"mt-2"})]})},oe=w.forwardRef(ee),te=w.memo(oe);te.displayName="Dropdown";
|
|
13
13
|
|
|
14
14
|
export { te as a };
|
|
@@ -64,6 +64,13 @@ type InputWithUnitProps = {
|
|
|
64
64
|
* Placeholder for the input field.
|
|
65
65
|
* */
|
|
66
66
|
inputPlaceholder?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Sets a fixed (immutable) unit.
|
|
69
|
+
* */
|
|
70
|
+
defaultUnit?: {
|
|
71
|
+
label: string;
|
|
72
|
+
value: string;
|
|
73
|
+
};
|
|
67
74
|
/**
|
|
68
75
|
* Sets a fixed (immutable) unit.
|
|
69
76
|
* */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use client";export { a as DEFAULT_UNITS, b as InputWithUnit } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
1
|
+
"use client";export { a as DEFAULT_UNITS, b as InputWithUnit } from '../../chunk-6RTGFDXR.js';
|
|
2
|
+
import '../../chunk-VELH5CA2.js';
|
|
3
3
|
import '../../chunk-NW24WOHT.js';
|
|
4
4
|
import '../../chunk-SJ4MATMO.js';
|
|
5
5
|
import '../../chunk-7Z3CCBLX.js';
|
package/dist/forms/index.js
CHANGED
|
@@ -9,8 +9,8 @@ import '../chunk-6W6QWPEA.js';
|
|
|
9
9
|
import '../chunk-4QFFUXWM.js';
|
|
10
10
|
import '../chunk-3BKW5XAK.js';
|
|
11
11
|
import '../chunk-L6H2NDVS.js';
|
|
12
|
-
export { a as DEFAULT_UNITS, b as InputWithUnit } from '../chunk-
|
|
13
|
-
export { a as Dropdown } from '../chunk-
|
|
12
|
+
export { a as DEFAULT_UNITS, b as InputWithUnit } from '../chunk-6RTGFDXR.js';
|
|
13
|
+
export { a as Dropdown } from '../chunk-VELH5CA2.js';
|
|
14
14
|
export { a as InputMask } from '../chunk-NW24WOHT.js';
|
|
15
15
|
export { a as Input } from '../chunk-SJ4MATMO.js';
|
|
16
16
|
export { a as InputLabel } from '../chunk-7Z3CCBLX.js';
|
package/dist/index.js
CHANGED
|
@@ -17,8 +17,8 @@ export { a as ActionBar } from './chunk-6W6QWPEA.js';
|
|
|
17
17
|
export { b as Box, d as BoxContent, c as BoxHeader, a as BoxSeparator } from './chunk-4QFFUXWM.js';
|
|
18
18
|
export { a as Container, b as ContainerHeader } from './chunk-3BKW5XAK.js';
|
|
19
19
|
import './chunk-L6H2NDVS.js';
|
|
20
|
-
export { a as DEFAULT_UNITS, b as InputWithUnit } from './chunk-
|
|
21
|
-
export { a as Dropdown } from './chunk-
|
|
20
|
+
export { a as DEFAULT_UNITS, b as InputWithUnit } from './chunk-6RTGFDXR.js';
|
|
21
|
+
export { a as Dropdown } from './chunk-VELH5CA2.js';
|
|
22
22
|
export { a as InputMask } from './chunk-NW24WOHT.js';
|
|
23
23
|
export { a as Input } from './chunk-SJ4MATMO.js';
|
|
24
24
|
export { a as InputLabel } from './chunk-7Z3CCBLX.js';
|
package/package.json
CHANGED
package/dist/chunk-GIQ4GFAU.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { a as a$3 } from './chunk-AUYKYD3L.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 };
|