@loja-integrada/admin-components 1.3.1 → 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-2K7HK2ZW.js +13 -0
- package/dist/{chunk-YNBEDPYZ.js → chunk-K6KKI3CU.js} +1 -1
- package/dist/forms/Dropdown/Dropdown.client.d.ts +13 -3
- package/dist/forms/Dropdown/index.js +2 -1
- package/dist/forms/InputWithUnit/index.js +3 -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
- package/dist/chunk-RB4S3T7L.js +0 -12
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { a as a$1 } from './chunk-7Z3CCBLX.js';
|
|
2
|
+
import { a as a$4 } from './chunk-DIENJUYM.js';
|
|
3
|
+
import { a as a$2 } from './chunk-G3GCVCTU.js';
|
|
4
|
+
import { a as a$3 } from './chunk-KEDPPRQK.js';
|
|
5
|
+
import { a } from './chunk-REQIQLRI.js';
|
|
6
|
+
import { cva } from 'class-variance-authority';
|
|
7
|
+
import O, { useMemo } from 'react';
|
|
8
|
+
import j, { components } from 'react-select';
|
|
9
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
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: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
|
+
|
|
13
|
+
export { _ as a };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type VariantProps } from 'class-variance-authority';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { SelectInstance } from 'react-select';
|
|
3
|
+
import { MultiValue, SelectInstance } from 'react-select';
|
|
4
4
|
import { IconProps } from '../../components/Icon';
|
|
5
5
|
import { InputLabelProps } from '../InputLabel';
|
|
6
6
|
declare const dropdownVariants: (props?: ({
|
|
@@ -19,6 +19,11 @@ interface DropdownProps {
|
|
|
19
19
|
* Options displayed inside dropdown
|
|
20
20
|
* */
|
|
21
21
|
options: CustomOptionProps[] | CustomGroupedOptionsProps[];
|
|
22
|
+
/**
|
|
23
|
+
* Controls whether the dropdown is multivalued or not
|
|
24
|
+
* @default false
|
|
25
|
+
* */
|
|
26
|
+
isMultivalued?: boolean;
|
|
22
27
|
/**
|
|
23
28
|
* Placeholder text
|
|
24
29
|
* @default "Selecione um item"
|
|
@@ -27,7 +32,11 @@ interface DropdownProps {
|
|
|
27
32
|
/**
|
|
28
33
|
* Callback function triggered when an option is selected
|
|
29
34
|
* */
|
|
30
|
-
onChange?: (
|
|
35
|
+
onChange?: (options: CustomOptionProps) => void;
|
|
36
|
+
/**
|
|
37
|
+
* Callback function triggered when an option is selected
|
|
38
|
+
* */
|
|
39
|
+
onMultiChange?: (options: MultiValue<CustomOptionProps>) => void;
|
|
31
40
|
/**
|
|
32
41
|
* Callback function triggered when the dropdown loses
|
|
33
42
|
* focus
|
|
@@ -132,10 +141,11 @@ interface CustomOptionProps {
|
|
|
132
141
|
label: string;
|
|
133
142
|
icon?: IconProps['icon'];
|
|
134
143
|
isDisabled?: boolean | undefined;
|
|
144
|
+
element?: JSX.Element;
|
|
135
145
|
}
|
|
136
146
|
interface CustomGroupedOptionsProps {
|
|
137
147
|
label: string;
|
|
138
148
|
options: CustomOptionProps[];
|
|
139
149
|
}
|
|
140
150
|
declare const Dropdown: React.MemoExoticComponent<React.ForwardRefExoticComponent<DropdownProps & React.RefAttributes<SelectInstance<CustomOptionProps>>>>;
|
|
141
|
-
export { type CustomGroupedOptionsProps, type CustomOptionProps, Dropdown, type DropdownProps };
|
|
151
|
+
export { type CustomGroupedOptionsProps, type CustomOptionProps, Dropdown, type DropdownProps, type MultiValue };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
"use client";export { a as Dropdown } from '../../chunk-
|
|
1
|
+
"use client";export { a as Dropdown } from '../../chunk-2K7HK2ZW.js';
|
|
2
2
|
import '../../chunk-7Z3CCBLX.js';
|
|
3
|
+
import '../../chunk-DIENJUYM.js';
|
|
3
4
|
import '../../chunk-G3GCVCTU.js';
|
|
4
5
|
import '../../chunk-LTWCICTK.js';
|
|
5
6
|
import '../../chunk-KEDPPRQK.js';
|
|
@@ -1,8 +1,9 @@
|
|
|
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';
|
|
6
|
+
import '../../chunk-DIENJUYM.js';
|
|
6
7
|
import '../../chunk-G3GCVCTU.js';
|
|
7
8
|
import '../../chunk-LTWCICTK.js';
|
|
8
9
|
import '../../chunk-KEDPPRQK.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"
|
package/dist/chunk-RB4S3T7L.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { a as a$1 } from './chunk-7Z3CCBLX.js';
|
|
2
|
-
import { a as a$2 } from './chunk-G3GCVCTU.js';
|
|
3
|
-
import { a as a$3 } from './chunk-KEDPPRQK.js';
|
|
4
|
-
import { a } from './chunk-REQIQLRI.js';
|
|
5
|
-
import { cva } from 'class-variance-authority';
|
|
6
|
-
import h, { useMemo } from 'react';
|
|
7
|
-
import k, { components } from 'react-select';
|
|
8
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
9
|
-
|
|
10
|
-
var W=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:$}=components,A=o=>{let{selectProps:n}=o,t=`transform transition duration-200 ${n.menuIsOpen?"rotate-180":"rotate-0"} text-inverted-2`;return jsx($,{...o,className:"mr-2",children:jsx(a$3,{icon:"sortDown",size:5,className:t})})},J=o=>{let{isSelected:n,isDisabled:t,isFocused:p,data:s}=o;return jsxs(q,{...o,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",n?"text-inverted-1":"text-inverted-2",p&&"bg-inverted-2/5"),children:[s.icon?jsx(a$3,{icon:s.icon,className:"mr-2"}):null,s.label]})},K=({options:o,isSearchable:n=!1,onChange:t,onBlur:p,size:s="default",variant:P="default",placeholder:v="Selecione um item",emptyMessage:w="Nenhuma op\xE7\xE3o dispon\xEDvel",hasError:C=!1,errorMessage:m,helpText:O,label:I,labelComplement:D,id:y,name:N,required:S=!1,disabled:c,readOnly:d,maxMenuHeight:E=300,menuPosition:M="absolute",menuPlacement:V="auto",menuWidth:G="100%",menuHorizontalPlacement:a$3,formGroupClassName:R="",value:z},B)=>{let F=useMemo(()=>Math.random().toString(36).substring(7),[]),f=y||N||F,i=C||!!m;return jsxs("div",{className:a("form-group flex flex-col",R),children:[jsx(a$1,{label:I,labelComplement:D,required:S,hasError:i,htmlFor:f,className:"mb-1"}),jsx(k,{id:f,ref:B,value:z,classNamePrefix:"select",options:o,isSearchable:n,isDisabled:c||d,maxMenuHeight:E,menuPortalTarget:document?.body,menuPosition:M,menuPlacement:V,placeholder:v,noOptionsMessage:({inputValue:e})=>e?`Nenhum resultado para "${e}"`:w,onChange:e=>t&&e&&t(e),onBlur:e=>p?.(e),components:{Option:e=>J(e),DropdownIndicator:e=>A(e)},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(W({variant:P,size:s,hasErrorState:i,disabled:c,readOnly:d}),e&&!i&&!d&&"border-inverted-1"),groupHeading:()=>"px-5 text-on-base-3 text-f7 font-semibold uppercase"},styles:{option:()=>({}),control:()=>({}),menu:e=>({...e,width:G,backgroundColor:"rgb(var(--color-base-1) / 100)",zIndex:999,...a$3&&a$3==="left"&&{left:0},...a$3&&a$3==="right"&&{right:0}}),menuPortal:e=>({...e,zIndex:9999}),indicatorSeparator:()=>({}),groupHeading:()=>({}),singleValue:()=>({maxWidth:"calc(100% - 6px)"}),valueContainer:e=>({...e,paddingLeft:16,display:"flex",alignItems:"center",flexWrap:"nowrap"}),placeholder:()=>({})}}),jsx(a$2,{helpText:m||O,hasError:i,className:"mt-2"})]})},Q=h.forwardRef(K),U=h.memo(Q);U.displayName="Dropdown";
|
|
11
|
-
|
|
12
|
-
export { U as a };
|