@loja-integrada/admin-components 1.3.2 → 1.3.3
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-JZAHJSYD.js → chunk-2K7HK2ZW.js} +1 -1
- package/dist/{chunk-RN4YOSXH.js → chunk-K6KKI3CU.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/index.js +2 -2
- package/dist/forms/Toggle/Toggle.client.d.ts +6 -0
- package/dist/forms/Toggle/index.d.ts +1 -0
- package/dist/forms/Toggle/index.js +6 -0
- package/dist/forms/index.js +2 -2
- package/dist/index.js +4 -4
- package/dist/indicators/index.js +1 -1
- package/dist/navigation/index.js +1 -1
- package/package.json +5 -1
|
@@ -8,6 +8,6 @@ import O, { useMemo } from 'react';
|
|
|
8
8
|
import j, { components } from 'react-select';
|
|
9
9
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
10
10
|
|
|
11
|
-
var $=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:J,DropdownIndicator:A}=components,K=r=>{let{selectProps:s}=r,t=`transform transition duration-200 ${s.menuIsOpen?"rotate-180":"rotate-0"} text-inverted-2`;return jsx(A,{...r,className:"mr-2",children:jsx(a$3,{icon:"sortDown",size:5,className:t})})},Q=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})})]})},U=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(J,{...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})},Y=({options:r,isSearchable:s=!1,isMultivalued:t=!1,onChange:a$3,onMultiChange:n,onBlur:i,size:c="default",variant:S="default",placeholder:I="Selecione um item",emptyMessage:y="Nenhuma op\xE7\xE3o dispon\xEDvel",hasError:M=!1,errorMessage:b,helpText:N,label:
|
|
11
|
+
var $=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:J,DropdownIndicator:A}=components,K=r=>{let{selectProps:s}=r,t=`transform transition duration-200 ${s.menuIsOpen?"rotate-180":"rotate-0"} text-inverted-2`;return jsx(A,{...r,className:"mr-2",children:jsx(a$3,{icon:"sortDown",size:5,className:t})})},Q=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})})]})},U=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(J,{...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})},Y=({options:r,isSearchable:s=!1,isMultivalued:t=!1,onChange:a$3,onMultiChange:n,onBlur:i,size:c="default",variant:S="default",placeholder:I="Selecione um item",emptyMessage:y="Nenhuma op\xE7\xE3o dispon\xEDvel",hasError:M=!1,errorMessage:b,helpText:N,label:V,labelComplement:D,id:E,name:W,required:k=!1,disabled:g,readOnly:m,maxMenuHeight:G=300,menuPosition:L="absolute",menuPlacement:z="auto",menuWidth:B="100%",menuHorizontalPlacement:l,formGroupClassName:R="",value:F},T)=>{let H=useMemo(()=>Math.random().toString(36).substring(7),[]),h=E||W||H,p=M||!!b;return jsxs("div",{className:a("form-group flex flex-col",R),children:[jsx(a$1,{label:V,labelComplement:D,required:k,hasError:p,htmlFor:h,className:"mb-1"}),jsx(j,{id:h,ref:T,value:F,classNamePrefix:"select",options:r,isSearchable:s,blurInputOnSelect:!t,isMulti:t,hideSelectedOptions:!1,closeMenuOnSelect:!t,isDisabled:g||m,maxMenuHeight:G,menuPortalTarget:document?.body,menuPosition:L,menuPlacement:z,placeholder:I,noOptionsMessage:({inputValue:e})=>e?`Nenhum resultado para "${e}"`:y,onChange:e=>{t&&n?n(e):a$3&&e&&a$3(e);},onBlur:e=>i?.(e),components:{Option:e=>U(e),DropdownIndicator:e=>K(e),MultiValue:e=>Q(e),ClearIndicator:()=>null},classNames:{input:()=>"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($({variant:S,size:c,hasErrorState:p,disabled:g,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:B,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:b||N,hasError:p,className:"mt-2"})]})},Z=O.forwardRef(Y),_=O.memo(Z);_.displayName="Dropdown";
|
|
12
12
|
|
|
13
13
|
export { _ as a };
|
|
@@ -148,4 +148,4 @@ interface CustomGroupedOptionsProps {
|
|
|
148
148
|
options: CustomOptionProps[];
|
|
149
149
|
}
|
|
150
150
|
declare const Dropdown: React.MemoExoticComponent<React.ForwardRefExoticComponent<DropdownProps & React.RefAttributes<SelectInstance<CustomOptionProps>>>>;
|
|
151
|
-
export { type CustomGroupedOptionsProps, type CustomOptionProps, Dropdown, type DropdownProps };
|
|
151
|
+
export { type CustomGroupedOptionsProps, type CustomOptionProps, Dropdown, type DropdownProps, type MultiValue };
|
|
@@ -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-K6KKI3CU.js';
|
|
2
|
+
import '../../chunk-2K7HK2ZW.js';
|
|
3
3
|
import '../../chunk-NW24WOHT.js';
|
|
4
4
|
import '../../chunk-SJ4MATMO.js';
|
|
5
5
|
import '../../chunk-7Z3CCBLX.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const Toggle: React.MemoExoticComponent<React.ForwardRefExoticComponent<ToggleProps & React.RefAttributes<HTMLInputElement>>>;
|
|
3
|
+
interface ToggleProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
4
|
+
label?: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export { Toggle, type ToggleProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Toggle.client';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use client";import t from 'react';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
var v=({label:p,id:m,name:f,onChange:s,checked:a,disabled:l,...o},k)=>{let r=m||f,[n,c]=t.useState(a||!1),d=l?"disabled":"enabled",g=n?"checked":"unchecked";t.useEffect(()=>{c(!!a);},[a]);let h=i=>{l||o.readOnly||(c(i.target.checked),s&&s(i));},b={background:{checked:{enabled:"bg-primary border-primary",disabled:"bg-base-3 border-card-stroke"},unchecked:{enabled:"bg-base-1 border-card-stroke",disabled:"bg-base-3 border-card-stroke"}},circle:{checked:{enabled:"translate-x-full ml-px bg-base-1",disabled:"translate-x-full ml-px bg-base-1"},unchecked:{enabled:"translate-x-0 bg-inverted-2",disabled:"translate-x-0 bg-base-1"}}},x=`${l?"pointer-events-none":""} relative`,C=`block border w-[53px] h-8 rounded-full ${b.background[g][d]} transition`,T=`transform ${b.circle[g][d]} absolute left-[6px] top-[6px] w-5 h-5 rounded-full transition`;return jsxs("label",{htmlFor:r,className:"inline-flex cursor-pointer items-center",children:[jsxs("div",{className:`${x}`,children:[jsx("input",{ref:k,type:"checkbox",id:r,className:"sr-only",checked:n,onChange:h,...o}),jsx("div",{className:C}),jsx("div",{className:T})]}),jsx("div",{className:"ml-2 text-inverted-1 text-f6 tracking-4 label",children:p})]})},R=t.forwardRef(v),N=t.memo(R);N.displayName="Toggle";
|
|
5
|
+
|
|
6
|
+
export { N as Toggle };
|
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-K6KKI3CU.js';
|
|
13
|
+
export { a as Dropdown } from '../chunk-2K7HK2ZW.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
|
@@ -2,12 +2,13 @@ import './chunk-SLXIJR46.js';
|
|
|
2
2
|
export { a as TextArea } from './chunk-7BT5L3CO.js';
|
|
3
3
|
import './chunk-7RP4L6ZM.js';
|
|
4
4
|
import './chunk-4PUGMMDC.js';
|
|
5
|
+
export { a as Stepper } from './chunk-I7PCF2VW.js';
|
|
6
|
+
export { b as ToastContainer, a as notify } from './chunk-RXFTQHN7.js';
|
|
5
7
|
export { a as Tooltip } from './chunk-TZI6YTCW.js';
|
|
6
8
|
export { a as Breadcrumb } from './chunk-TSAI6WF3.js';
|
|
7
9
|
export { a as HelpLink } from './chunk-N224DIUR.js';
|
|
8
10
|
export { c as DEFAULT_OPTIONS, d as Pagination, a as PaginationInfo, b as PaginationNav } from './chunk-LYUEZJYR.js';
|
|
9
11
|
export { b as Select, a as SelectComponent } from './chunk-HZACKBIW.js';
|
|
10
|
-
export { a as Stepper } from './chunk-I7PCF2VW.js';
|
|
11
12
|
export { a as Calendar } from './chunk-PHVC2M6R.js';
|
|
12
13
|
import './chunk-KN7DOGNL.js';
|
|
13
14
|
export { a as IconCircular } from './chunk-DTLT3DYY.js';
|
|
@@ -16,8 +17,8 @@ export { a as ActionBar } from './chunk-6W6QWPEA.js';
|
|
|
16
17
|
export { b as Box, d as BoxContent, c as BoxHeader, a as BoxSeparator } from './chunk-4QFFUXWM.js';
|
|
17
18
|
export { a as Container, b as ContainerHeader } from './chunk-3BKW5XAK.js';
|
|
18
19
|
import './chunk-L6H2NDVS.js';
|
|
19
|
-
export { a as DEFAULT_UNITS, b as InputWithUnit } from './chunk-
|
|
20
|
-
export { a as Dropdown } from './chunk-
|
|
20
|
+
export { a as DEFAULT_UNITS, b as InputWithUnit } from './chunk-K6KKI3CU.js';
|
|
21
|
+
export { a as Dropdown } from './chunk-2K7HK2ZW.js';
|
|
21
22
|
export { a as InputMask } from './chunk-NW24WOHT.js';
|
|
22
23
|
export { a as Input } from './chunk-SJ4MATMO.js';
|
|
23
24
|
export { a as InputLabel } from './chunk-7Z3CCBLX.js';
|
|
@@ -25,7 +26,6 @@ export { a as Alert } from './chunk-NGGA7AJU.js';
|
|
|
25
26
|
export { a as Badge } from './chunk-7NXFX6TD.js';
|
|
26
27
|
export { a as Tag } from './chunk-EUZRZJ5Q.js';
|
|
27
28
|
export { a as Button } from './chunk-VVJUHPYS.js';
|
|
28
|
-
export { b as ToastContainer, a as notify } from './chunk-RXFTQHN7.js';
|
|
29
29
|
export { a as DataTable } from './chunk-JZ6ZGBZ4.js';
|
|
30
30
|
import './chunk-DVFKTOCS.js';
|
|
31
31
|
export { a as Checkbox } from './chunk-DIENJUYM.js';
|
package/dist/indicators/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import '../chunk-7RP4L6ZM.js';
|
|
2
|
+
export { b as ToastContainer, a as notify } from '../chunk-RXFTQHN7.js';
|
|
2
3
|
export { a as Tooltip } from '../chunk-TZI6YTCW.js';
|
|
3
4
|
export { a as Alert } from '../chunk-NGGA7AJU.js';
|
|
4
5
|
export { a as Badge } from '../chunk-7NXFX6TD.js';
|
|
5
6
|
export { a as Tag } from '../chunk-EUZRZJ5Q.js';
|
|
6
7
|
import '../chunk-VVJUHPYS.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';
|
package/dist/navigation/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import '../chunk-4PUGMMDC.js';
|
|
2
|
+
export { a as Stepper } from '../chunk-I7PCF2VW.js';
|
|
2
3
|
export { a as Breadcrumb } from '../chunk-TSAI6WF3.js';
|
|
3
4
|
export { a as HelpLink } from '../chunk-N224DIUR.js';
|
|
4
5
|
export { c as DEFAULT_OPTIONS, d as Pagination, a as PaginationInfo, b as PaginationNav } from '../chunk-LYUEZJYR.js';
|
|
5
6
|
import '../chunk-HZACKBIW.js';
|
|
6
|
-
export { a as Stepper } from '../chunk-I7PCF2VW.js';
|
|
7
7
|
import '../chunk-7Z3CCBLX.js';
|
|
8
8
|
import '../chunk-DVFKTOCS.js';
|
|
9
9
|
import '../chunk-G3GCVCTU.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loja-integrada/admin-components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"author": "Loja Integrada",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -145,6 +145,10 @@
|
|
|
145
145
|
"types": "./dist/forms/TextArea/TextArea.d.ts",
|
|
146
146
|
"import": "./dist/forms/TextArea/index.js"
|
|
147
147
|
},
|
|
148
|
+
"./Toggle": {
|
|
149
|
+
"types": "./dist/forms/Toggle/Toggle.d.ts",
|
|
150
|
+
"import": "./dist/forms/Toggle/index.js"
|
|
151
|
+
},
|
|
148
152
|
"./hooks": {
|
|
149
153
|
"types": "./dist/hooks/hooks.d.ts",
|
|
150
154
|
"import": "./dist/hooks/index.js"
|