sodtrack-web-ui 0.61.3 → 0.61.4
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/chip-form-complementary.d.mts +3 -3
- package/dist/chip-form-complementary.d.ts +3 -3
- package/dist/chip-form.d.mts +3 -3
- package/dist/chip-form.d.ts +3 -3
- package/dist/chip-status-complementary.d.mts +1 -1
- package/dist/chip-status-complementary.d.ts +1 -1
- package/dist/{chunk-QBX2P5NO.mjs → chunk-6656TD7P.mjs} +1 -1
- package/dist/{chunk-GQSPOA7L.mjs → chunk-AHN4ESWA.mjs} +1 -1
- package/dist/chunk-AYAULBBH.mjs +1 -0
- package/dist/chunk-DEMXLQGG.mjs +1 -0
- package/dist/{chunk-EOB2KGVR.mjs → chunk-HYCZHDLP.mjs} +1 -1
- package/dist/{chunk-UVBUJL4P.mjs → chunk-PJ5ZUPVG.mjs} +1 -1
- package/dist/{chunk-D7F6I4QH.mjs → chunk-SFABS5IQ.mjs} +1 -1
- package/dist/{chunk-VY3HVT62.mjs → chunk-T3EYW66N.mjs} +1 -1
- package/dist/country-text-field.js +1 -1
- package/dist/country-text-field.mjs +1 -1
- package/dist/date-picker.js +1 -1
- package/dist/date-picker.mjs +1 -1
- package/dist/flag-select.js +1 -1
- package/dist/flag-select.mjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.mts +0 -8
- package/dist/index.d.ts +0 -8
- package/dist/index.js +2 -2
- package/dist/index.mjs +1 -1
- package/dist/list-item-arrow.css +1 -1
- package/dist/list-item-arrow.mjs +1 -1
- package/dist/list-item-button.css +1 -1
- package/dist/list-item-button.mjs +1 -1
- package/dist/list-item-checkbox.css +1 -1
- package/dist/list-item-checkbox.mjs +1 -1
- package/dist/list-item.css +1 -1
- package/dist/list-item.mjs +1 -1
- package/dist/search-bar.js +1 -1
- package/dist/search-bar.mjs +1 -1
- package/dist/select.js +1 -1
- package/dist/select.mjs +1 -1
- package/dist/tab.d.mts +1 -1
- package/dist/tab.d.ts +1 -1
- package/dist/text-field.js +1 -1
- package/dist/text-field.mjs +1 -1
- package/dist/time-picker.js +1 -1
- package/dist/time-picker.mjs +1 -1
- package/package.json +2 -6
- package/dist/checkbox_old.d.mts +0 -17
- package/dist/checkbox_old.d.ts +0 -17
- package/dist/checkbox_old.js +0 -16
- package/dist/checkbox_old.mjs +0 -1
- package/dist/chunk-6T3T33NK.mjs +0 -1
- package/dist/chunk-A7OUZRND.mjs +0 -1
- package/dist/chunk-BNYSNYRJ.mjs +0 -1
- package/dist/chunk-HPADBBCW.mjs +0 -1
- package/dist/chunk-HTBT6CLR.mjs +0 -1
- package/dist/chunk-PGGV7VMC.mjs +0 -1
- package/dist/snackbar_old.d.mts +0 -14
- package/dist/snackbar_old.d.ts +0 -14
- package/dist/snackbar_old.js +0 -15
- package/dist/snackbar_old.mjs +0 -1
- package/dist/toggle.d.mts +0 -11
- package/dist/toggle.d.ts +0 -11
- package/dist/toggle.js +0 -1
- package/dist/toggle.mjs +0 -1
- package/dist/tooltip_old.d.mts +0 -12
- package/dist/tooltip_old.d.ts +0 -12
- package/dist/tooltip_old.js +0 -1
- package/dist/tooltip_old.mjs +0 -1
|
@@ -6,7 +6,7 @@ type ChipFormComplementaryVariantsType = (typeof ChipFormComplementaryVariants)[
|
|
|
6
6
|
declare const ChipFormComplementaryVariantsClassNames: Record<ChipFormComplementaryVariantsType, string>;
|
|
7
7
|
declare const chipForm: (props?: ({
|
|
8
8
|
variant?: "zoro" | "ussop" | "crocodile" | "silvers" | "buggy" | "nami" | "shanks" | "piiman" | "sanji" | "ace" | "hancock" | "chopper" | "bentham" | "ivankov" | "brook" | "luffy" | "frankie" | "jinbe" | "robin" | "law" | undefined;
|
|
9
|
-
size?: "
|
|
9
|
+
size?: "md" | "sm" | undefined;
|
|
10
10
|
selected?: boolean | undefined;
|
|
11
11
|
disabled?: boolean | undefined;
|
|
12
12
|
} & ({
|
|
@@ -74,7 +74,7 @@ declare const ChipFormComplementary: React__default.ForwardRefExoticComponent<{
|
|
|
74
74
|
children?: React__default.ReactNode | undefined;
|
|
75
75
|
} & Omit<VariantProps<(props?: ({
|
|
76
76
|
variant?: "zoro" | "ussop" | "crocodile" | "silvers" | "buggy" | "nami" | "shanks" | "piiman" | "sanji" | "ace" | "hancock" | "chopper" | "bentham" | "ivankov" | "brook" | "luffy" | "frankie" | "jinbe" | "robin" | "law" | undefined;
|
|
77
|
-
size?: "
|
|
77
|
+
size?: "md" | "sm" | undefined;
|
|
78
78
|
selected?: boolean | undefined;
|
|
79
79
|
disabled?: boolean | undefined;
|
|
80
80
|
} & ({
|
|
@@ -133,7 +133,7 @@ declare const ChipFormComplementary: React__default.ForwardRefExoticComponent<{
|
|
|
133
133
|
} | null | undefined;
|
|
134
134
|
})) | undefined) => string>, "variant"> & Required<Pick<VariantProps<(props?: ({
|
|
135
135
|
variant?: "zoro" | "ussop" | "crocodile" | "silvers" | "buggy" | "nami" | "shanks" | "piiman" | "sanji" | "ace" | "hancock" | "chopper" | "bentham" | "ivankov" | "brook" | "luffy" | "frankie" | "jinbe" | "robin" | "law" | undefined;
|
|
136
|
-
size?: "
|
|
136
|
+
size?: "md" | "sm" | undefined;
|
|
137
137
|
selected?: boolean | undefined;
|
|
138
138
|
disabled?: boolean | undefined;
|
|
139
139
|
} & ({
|
|
@@ -6,7 +6,7 @@ type ChipFormComplementaryVariantsType = (typeof ChipFormComplementaryVariants)[
|
|
|
6
6
|
declare const ChipFormComplementaryVariantsClassNames: Record<ChipFormComplementaryVariantsType, string>;
|
|
7
7
|
declare const chipForm: (props?: ({
|
|
8
8
|
variant?: "zoro" | "ussop" | "crocodile" | "silvers" | "buggy" | "nami" | "shanks" | "piiman" | "sanji" | "ace" | "hancock" | "chopper" | "bentham" | "ivankov" | "brook" | "luffy" | "frankie" | "jinbe" | "robin" | "law" | undefined;
|
|
9
|
-
size?: "
|
|
9
|
+
size?: "md" | "sm" | undefined;
|
|
10
10
|
selected?: boolean | undefined;
|
|
11
11
|
disabled?: boolean | undefined;
|
|
12
12
|
} & ({
|
|
@@ -74,7 +74,7 @@ declare const ChipFormComplementary: React__default.ForwardRefExoticComponent<{
|
|
|
74
74
|
children?: React__default.ReactNode | undefined;
|
|
75
75
|
} & Omit<VariantProps<(props?: ({
|
|
76
76
|
variant?: "zoro" | "ussop" | "crocodile" | "silvers" | "buggy" | "nami" | "shanks" | "piiman" | "sanji" | "ace" | "hancock" | "chopper" | "bentham" | "ivankov" | "brook" | "luffy" | "frankie" | "jinbe" | "robin" | "law" | undefined;
|
|
77
|
-
size?: "
|
|
77
|
+
size?: "md" | "sm" | undefined;
|
|
78
78
|
selected?: boolean | undefined;
|
|
79
79
|
disabled?: boolean | undefined;
|
|
80
80
|
} & ({
|
|
@@ -133,7 +133,7 @@ declare const ChipFormComplementary: React__default.ForwardRefExoticComponent<{
|
|
|
133
133
|
} | null | undefined;
|
|
134
134
|
})) | undefined) => string>, "variant"> & Required<Pick<VariantProps<(props?: ({
|
|
135
135
|
variant?: "zoro" | "ussop" | "crocodile" | "silvers" | "buggy" | "nami" | "shanks" | "piiman" | "sanji" | "ace" | "hancock" | "chopper" | "bentham" | "ivankov" | "brook" | "luffy" | "frankie" | "jinbe" | "robin" | "law" | undefined;
|
|
136
|
-
size?: "
|
|
136
|
+
size?: "md" | "sm" | undefined;
|
|
137
137
|
selected?: boolean | undefined;
|
|
138
138
|
disabled?: boolean | undefined;
|
|
139
139
|
} & ({
|
package/dist/chip-form.d.mts
CHANGED
|
@@ -19,7 +19,7 @@ declare const ChipForm: React__default.ForwardRefExoticComponent<{
|
|
|
19
19
|
selected?: boolean | undefined;
|
|
20
20
|
disabled?: boolean | undefined;
|
|
21
21
|
duotone?: boolean | undefined;
|
|
22
|
-
size?: "
|
|
22
|
+
size?: "md" | "sm" | "xs" | undefined;
|
|
23
23
|
} & ({
|
|
24
24
|
class?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | {
|
|
25
25
|
[x: string]: any;
|
|
@@ -80,7 +80,7 @@ declare const ChipForm: React__default.ForwardRefExoticComponent<{
|
|
|
80
80
|
selected?: boolean | undefined;
|
|
81
81
|
disabled?: boolean | undefined;
|
|
82
82
|
duotone?: boolean | undefined;
|
|
83
|
-
size?: "
|
|
83
|
+
size?: "md" | "sm" | "xs" | undefined;
|
|
84
84
|
} & ({
|
|
85
85
|
class?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | {
|
|
86
86
|
[x: string]: any;
|
|
@@ -141,7 +141,7 @@ declare const ChipForm: React__default.ForwardRefExoticComponent<{
|
|
|
141
141
|
selected?: boolean | undefined;
|
|
142
142
|
disabled?: boolean | undefined;
|
|
143
143
|
duotone?: boolean | undefined;
|
|
144
|
-
size?: "
|
|
144
|
+
size?: "md" | "sm" | "xs" | undefined;
|
|
145
145
|
} & ({
|
|
146
146
|
class?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | {
|
|
147
147
|
[x: string]: any;
|
package/dist/chip-form.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ declare const ChipForm: React__default.ForwardRefExoticComponent<{
|
|
|
19
19
|
selected?: boolean | undefined;
|
|
20
20
|
disabled?: boolean | undefined;
|
|
21
21
|
duotone?: boolean | undefined;
|
|
22
|
-
size?: "
|
|
22
|
+
size?: "md" | "sm" | "xs" | undefined;
|
|
23
23
|
} & ({
|
|
24
24
|
class?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | {
|
|
25
25
|
[x: string]: any;
|
|
@@ -80,7 +80,7 @@ declare const ChipForm: React__default.ForwardRefExoticComponent<{
|
|
|
80
80
|
selected?: boolean | undefined;
|
|
81
81
|
disabled?: boolean | undefined;
|
|
82
82
|
duotone?: boolean | undefined;
|
|
83
|
-
size?: "
|
|
83
|
+
size?: "md" | "sm" | "xs" | undefined;
|
|
84
84
|
} & ({
|
|
85
85
|
class?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | {
|
|
86
86
|
[x: string]: any;
|
|
@@ -141,7 +141,7 @@ declare const ChipForm: React__default.ForwardRefExoticComponent<{
|
|
|
141
141
|
selected?: boolean | undefined;
|
|
142
142
|
disabled?: boolean | undefined;
|
|
143
143
|
duotone?: boolean | undefined;
|
|
144
|
-
size?: "
|
|
144
|
+
size?: "md" | "sm" | "xs" | undefined;
|
|
145
145
|
} & ({
|
|
146
146
|
class?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | {
|
|
147
147
|
[x: string]: any;
|
|
@@ -6,7 +6,7 @@ type ChipStatusComplementaryVariantType = (typeof ChipStatusComplementaryVariant
|
|
|
6
6
|
type ChipStatusComplementarySizeType = (typeof ChipStatusComplementarySizes)[number];
|
|
7
7
|
declare const chipStatusComplementary: (props?: ({
|
|
8
8
|
variant?: "zoro" | "ussop" | "crocodile" | "silvers" | "buggy" | "nami" | "shanks" | "piiman" | "sanji" | "ace" | "hancock" | "chopper" | "bentham" | "ivankov" | "brook" | "luffy" | "frankie" | "jinbe" | "robin" | "law" | undefined;
|
|
9
|
-
size?: "
|
|
9
|
+
size?: "md" | "sm" | "xs" | undefined;
|
|
10
10
|
} & ({
|
|
11
11
|
class?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | {
|
|
12
12
|
[x: string]: any;
|
|
@@ -6,7 +6,7 @@ type ChipStatusComplementaryVariantType = (typeof ChipStatusComplementaryVariant
|
|
|
6
6
|
type ChipStatusComplementarySizeType = (typeof ChipStatusComplementarySizes)[number];
|
|
7
7
|
declare const chipStatusComplementary: (props?: ({
|
|
8
8
|
variant?: "zoro" | "ussop" | "crocodile" | "silvers" | "buggy" | "nami" | "shanks" | "piiman" | "sanji" | "ace" | "hancock" | "chopper" | "bentham" | "ivankov" | "brook" | "luffy" | "frankie" | "jinbe" | "robin" | "law" | undefined;
|
|
9
|
-
size?: "
|
|
9
|
+
size?: "md" | "sm" | "xs" | undefined;
|
|
10
10
|
} & ({
|
|
11
11
|
class?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | {
|
|
12
12
|
[x: string]: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-KTRSJBA4.mjs';import {a as a$1}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-KTRSJBA4.mjs';import {a as a$1}from'./chunk-AYAULBBH.mjs';import {a as a$3}from'./chunk-TLIQP6K7.mjs';import {n}from'./chunk-QWBSZY37.mjs';import {a as a$2}from'./chunk-2WINTZSS.mjs';import {useState,useRef,useMemo,useCallback,useEffect}from'react';import*as w from'@radix-ui/react-portal';import {format}from'date-fns';import {jsxs,Fragment,jsx}from'react/jsx-runtime';var q=({value:c,onChange:m,locale:x,disabledDates:D,...T})=>{let[E,f]=useState(false),[a$4,d]=useState(c),[o,P]=useState(),[L,F]=useState("bottom"),[k,y]=useState(0),l=useRef(null),e=useRef(null),[u,H]=useState();a(l,()=>{f(false);});let z=n=>{d(n),m?.(n);},M=useMemo(()=>a$4?format(a$4,"P"):"",[a$4]),N=()=>{d(void 0),m?.(void 0);},t=useCallback(()=>{if(!e.current)return;let n=e.current.getBoundingClientRect();if(!u)return;let i=u.height;y(i),P(n);let O=window.innerHeight-n.bottom>i,B=n.top+n.height>i;F(O?"bottom":B?"top":"bottom");},[e.current,u]);return useEffect(()=>{d(c);},[c]),useEffect(()=>{if(e?.current)return t(),e.current.addEventListener("mousedown",t),e.current.addEventListener("input",t),window.addEventListener("scroll",t,true),window.addEventListener("resize",t),()=>{e.current?.removeEventListener("mousedown",t),e.current?.removeEventListener("input",t),window.removeEventListener("scroll",t,true),window.removeEventListener("resize",t);}},[e.current,t]),useEffect(()=>{H(l.current?.getBoundingClientRect());},[l.current]),jsxs(Fragment,{children:[jsx(a$1,{ref:e,startIcon:jsx(n,{}),onClean:N,readOnly:true,value:M,onClick:n=>{P(n.currentTarget.getBoundingClientRect()),f(i=>!i);},...T}),jsx(w.Root,{asChild:true,children:jsx("div",{ref:l,className:a$2("pointer-events-auto fixed z-50 hidden",E&&"block"),style:o?{top:L==="bottom"?`${o.height+o.y}px`:o.top-k,left:o?.left}:void 0,children:jsx(a$3,{className:"w-[20rem] max-w-full",mode:"single",selected:a$4,onSelect:z,locale:x,disabled:D})})})]})};q.displayName="DatePicker";export{q as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a,b,c,d,e,f,g,h,i}from'./chunk-E5G7444M.mjs';import {a as a$2}from'./chunk-
|
|
1
|
+
import {a,b,c,d,e,f,g,h,i}from'./chunk-E5G7444M.mjs';import {a as a$2}from'./chunk-AYAULBBH.mjs';import {a as a$3}from'./chunk-QHBCNAWO.mjs';import {g as g$1}from'./chunk-QWBSZY37.mjs';import {a as a$1}from'./chunk-2WINTZSS.mjs';import Q,{useId,useRef,useState,useEffect}from'react';import*as A from'@radix-ui/react-portal';import {jsx,jsxs}from'react/jsx-runtime';var H=56,p=6,Z=[{id:0,code:"+56",name:"Chile",flag:a,country:"CL"},{id:1,code:"+54",name:"Argentina",flag:b,country:"AR"},{id:2,code:"+57",name:"Colombia",flag:c,country:"CO"},{id:3,code:"+502",name:"Guatemala",flag:d,country:"GT"},{id:4,code:"+52",name:"Mexico",flag:e,country:"MX"},{id:5,code:"+51",name:"Per\xFA",flag:f,country:"PE"},{id:6,code:"+55",name:"Brasil",flag:g,country:"BR"},{id:7,code:"+598",name:"Uruguay",flag:h,country:"UY"},{id:8,code:"+1",name:"Estados Unidos",flag:i,country:"US"}],we=({options:o=Z,noResults:y,selectedOption:B,onSelect:U,onChange:h,onClick:ee,className:G,defaultCountry:v="CL",initialValue:s,size:$="md",...i})=>{let z=useId(),c=useRef(null),l=useRef(null),D=useRef(null),[Y,_]=useState("bottom"),[d,V]=useState(),[X,j]=useState(-1),[a,x]=useState(B??null),[E,F]=useState(""),q=e=>{let t={target:{value:e.code+E}};h?.(t),c.current.style.display="none",l.current.value=e.code,x(e),U?.(e);};return useEffect(()=>{if(!l.current)return;let e=()=>{if(!l.current)return;let t=H*(o.length<p?o.length:p)+16,m=l.current.getBoundingClientRect();V(m);let J=window.innerHeight-m.bottom>t,K=m.top>t;_(J?"bottom":K?"top":"bottom");};return e(),l.current.addEventListener("mousedown",e),window.addEventListener("scroll",e,true),window.addEventListener("resize",e),()=>{l.current?.removeEventListener("mousedown",e),window.removeEventListener("scroll",e,true),window.removeEventListener("resize",e);}},[l.current]),useEffect(()=>{function e(t){c.current&&!c.current.contains(t.target)&&(c.current.style.display="none",j(-1));}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e);}},[c.current]),useEffect(()=>{if(v&&!s){let e=o.find(t=>t.country===v)??null;x(e);}},[v,s]),useEffect(()=>{if(s){let e=o.find(t=>s.includes(t.code))??null;x(e),F(s.replace(e?.code??"",""));}},[s]),jsx("div",{className:a$1("flex flex-col",G),children:jsxs("div",{className:a$1("relative flex flex-col"),children:[jsx(a$2,{ref:l,value:E,placeholder:i.placeholder??"",onChange:e=>{let t=e.target.value.replace(/\D/g,"");F(t);let m={target:{value:a?.code&&!t.includes(a.code)?a?.code+t:t}};h?.(m);},startComponent:jsxs("div",{className:"z-[100000] ml-3 flex h-2 w-[7.5rem] cursor-pointer items-center",onClick:()=>{i.disabled||(c.current.style.display="flex");},children:[jsx("img",{src:a?.flag,alt:a?.country,className:a$1("h-6 w-6 cursor-pointer",i.disabled&&"cursor-not-allowed text-neutral-400")}),jsx("span",{className:a$1("ml-1",i.disabled&&"cursor-not-allowed text-neutral-400"),children:a?.code}),jsx(g$1,{className:a$1($==="md"?"h-6 w-6":"h-4.5 w-4.5","cursor-pointer",i.disabled&&"cursor-not-allowed text-neutral-400")})]}),...i}),jsx(A.Root,{asChild:true,children:jsx("ul",{ref:c,className:"pointer-events-auto absolute z-[10000] hidden w-full",style:d?{width:`${d.width}px`,left:d.left,top:Y==="bottom"?`${d.height+d.top+window.scrollY}px`:window.scrollY+d.top-(o.length<p?o.length:p)*H-16}:void 0,children:jsxs(a$3,{className:"elevation-8 my-2 flex max-h-[336px] w-full flex-col rounded-lg bg-neutral-50",ref:D,children:[o.length===0&&jsxs("div",{className:"elevation-8 max-h-88 flex flex-1 flex-col items-center justify-center rounded-lg bg-neutral-50 px-8 py-6",children:[Q.cloneElement(y.icon,{className:"mb-2 h-8 w-8 text-neutral-300"}),jsx("p",{className:"text-center text-sm leading-[120%] text-neutral-500",children:y.message})]}),o.map((e,t)=>jsx("li",{onClick:()=>{q(e);},className:a$1("flex-shrink-0 cursor-pointer py-4 pl-4 pr-6 text-left hover:bg-primary-100",a?.code===e.code&&"bg-primary-200",X===t&&"bg-primary-200"),value:e.code,children:jsxs("div",{className:a$1("flex items-center space-x-3"),children:[jsx("img",{src:e.flag,alt:e.country,className:"h-6 w-6"}),jsx("p",{children:e.name}),jsx("p",{className:"text-primary-500",children:`(${e.code})`})]})},`select-option-${z}-${e.id??e.code}`))]})})})]})})};export{we as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-SVUSHVWV.mjs';import {q,d,g as g$1}from'./chunk-QWBSZY37.mjs';import {a}from'./chunk-2WINTZSS.mjs';import g,{forwardRef,useId,useRef,useState,useCallback,useEffect}from'react';import {Label}from'@radix-ui/react-label';import {jsxs,jsx}from'react/jsx-runtime';var U=forwardRef(({label:x,placeholder:y,error:t,selectMode:b=false,showClearButton:H=true,helperText:M,className:I,size:e="md",onClean:P,onChange:f,startIcon:u,endIcon:p,startComponent:c,fixedTopLabel:C,startText:i,disabled:o,required:v,...D},m)=>{let w=useId(),l=useRef(null),[s,h]=useState(false),T=!l.current?.value,F=useCallback(()=>{if(l.current&&!o){l.current.value="",h(false),P?.();let a={target:l.current,currentTarget:l.current,type:"change",bubbles:true,cancelable:false,defaultPrevented:false,eventPhase:0,isTrusted:true,preventDefault:()=>{},stopPropagation:()=>{},persist:()=>{},isDefaultPrevented:()=>false,isPropagationStopped:()=>false,timeStamp:Date.now(),nativeEvent:new Event("change")};f?.(a);}},[o,f,l.current]);return useEffect(()=>{l.current&&h(l.current.value.length>0);},[]),jsxs("div",{className:a("flex flex-col",I),children:[jsxs("div",{className:a("relative flex flex-col rounded-lg bg-neutral-50",e==="lg"&&"h-12",e==="md"&&"h-10",e==="sm"&&"h-8"),children:[jsx("input",{id:w,disabled:o,required:v,className:a("hover:caret-neutral-text-neutral-600 hover:ring-neutral-text-neutral-600 hover:text-neutral no-spinner peer absolute z-20 h-full w-full rounded-lg bg-neutral-50/0 text-left tracking-normal text-neutral-900 placeholder-neutral-500/100 caret-neutral-900 outline-0 ring-1 ring-inset ring-neutral-400 transition-all ease-linear focus:text-neutral-900 focus:placeholder-neutral-500 focus:placeholder-opacity-100 focus:caret-primary-800 focus:ring-[2px] focus:ring-primary-800 disabled:bg-neutral-80 disabled:text-neutral-400 disabled:ring-neutral-100 [&:not(:placeholder-shown)]:z-10",x&&"placeholder-neutral-500/0",t&&"placeholder-error-700/0 ring-error-700 hover:text-neutral-900 hover:ring-error-700 focus:ring-error-700",e==="lg"&&"text-base",e==="md"&&"text-sm",e==="sm"&&"text-sm",u?e==="lg"?"pl-[2.75rem]":"pl-[2.38rem]":c?"pl-[6.5rem]":"pl-4",i&&"pl-[1.94rem]",p?e==="lg"?"pr-[2.75rem]":"pr-[2.38rem]":"pr-4"),placeholder:y??"",ref:a=>{typeof m=="function"?m(a):m&&(m.current=a),l.current=a;},onChange:a=>{h(a.target.value.length>0),f?.(a);},...D}),c&&g.cloneElement(c,{className:a("absolute z-20 flex left-3 top-1/2 transform -translate-y-1/2 items-center rounded-full peer-disabled:text-neutral-400",t&&!s&&"text-error-700 peer-hover:text-error-700 peer-focus:text-error-700")}),u&&g.cloneElement(u,{size:18,className:a("absolute flex peer-focus:text-neutral-900 z-20 text-neutral-500 left-3 h-full items-center rounded-full peer-disabled:text-neutral-400",t&&!s&&"text-error-700 peer-hover:text-error-700 peer-focus:text-error-700")}),i&&jsx("div",{className:"flex h-full items-center pl-3",children:jsx("p",{className:a("text-neutral-700",t&&"text-error-700"),children:i})}),x&&jsxs(Label,{htmlFor:w,className:a("absolute -top-[0.5625rem] z-10 ml-3 bg-neutral-50 px-1 tracking-normal text-neutral-50 transition-all duration-75 ease-linear peer-hover:text-primary-800 peer-disabled:z-20 peer-disabled:text-neutral-400","peer-focus:-top-[0.5625rem] peer-focus:z-20 peer-focus:ml-3 peer-focus:text-xs peer-focus:text-primary-800 peer-[:placeholder-shown]:peer-[:not(:focus)]:peer-[:disabled]:bg-neutral-80",!t&&"peer-[:not(:focus)]:peer-[:not(:disabled)]:text-neutral-400 peer-[:not(:placeholder-shown)]:peer-[:not(:focus)]:peer-[:not(:disabled)]:text-neutral-900",s&&"peer-disabled:bg-neutral-80",e==="lg"?"text-base placeholder-shown:text-xs peer-placeholder-shown:top-3":e==="md"?"text-sm placeholder-shown:text-xs peer-placeholder-shown:top-2.5":"text-sm placeholder-shown:text-xs peer-placeholder-shown:top-1.5",!T&&"text-xs",t&&"text-error-700 peer-hover:text-error-700 peer-focus:text-error-700",u?e==="lg"?"peer-placeholder-shown:ml-[2.75rem]":"peer-placeholder-shown:ml-[2.38rem]":c?"peer-placeholder-shown:ml-[6rem]":"ml-3",C&&"!-top-[0.375rem] z-20 ml-3 !text-xs !transition-none",i&&"peer-placeholder-shown:ml-[1.94rem]"),children:[v&&"*",x]}),(H&&(!T||s)||t)&&jsxs("div",{className:a("absolute z-10 hidden h-full items-center peer-focus:flex",t&&!o&&"flex",b||p?e==="lg"?"right-[2.81rem]":e==="md"?"right-[2.125rem]":"right-[1.875rem]":"right-4"),children:[t&&jsx(q,{size:e==="sm"?14:18,className:"text-error-700"}),!t&&jsx(d,{onMouseDown:F,size:e==="sm"?14:18,className:"cursor-pointer text-neutral-900"})]}),p&&g.cloneElement(p,{size:e==="sm"?14:18,className:a("absolute peer-focus:text-neutral-900 z-20 text-neutral-500 flex right-3 h-full items-center rounded-full peer-disabled:text-neutral-400",t&&!s&&"text-error-700 peer-hover:text-error-700 peer-focus:text-error-700")}),b&&jsx("div",{className:a("peer-hover:text-neutral absolute right-4 z-20 flex h-full items-center rounded-full transition-all ease-linear peer-focus:rotate-180 peer-focus:text-primary-900 peer-disabled:text-neutral-400"),children:jsx(g$1,{className:e==="lg"?"h-6 w-6":"h-4.5 w-4.5"})})]}),jsx(a$1,{helperText:M,error:t,disabled:o})]})});export{U as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a as a$5}from'./chunk-KTRSJBA4.mjs';import {c as c$3}from'./chunk-WS2F7JWJ.mjs';import {a as a$4}from'./chunk-AYAULBBH.mjs';import {a}from'./chunk-QHBCNAWO.mjs';import {c as c$2}from'./chunk-WB5ZPQ7L.mjs';import {d}from'./chunk-GZ2UJSIO.mjs';import {a as a$1}from'./chunk-WGMDH4XX.mjs';import {a as a$3}from'./chunk-BVHU5ZT3.mjs';import {c}from'./chunk-4DF3NXNT.mjs';import {c as c$1,h}from'./chunk-QWBSZY37.mjs';import {a as a$2}from'./chunk-2WINTZSS.mjs';import ht,{createContext,useMemo,useCallback,useContext,useRef,useEffect,useState,useId}from'react';import*as At from'@radix-ui/react-portal';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var _t=({title:t,titleLines:o=2,description:e,descriptionLines:r=1,Icon:l,iconAsColumn:n=true,className:a,...i})=>jsxs("div",{className:a$2("flex gap-2 py-4 pl-4 pr-6",n&&"flex-col items-center gap-1",!n&&!e&&"items-center"),...i,children:[l&&jsx(l,{className:a$2("shrink-0 text-neutral-300"),size:24}),jsxs("div",{className:a$2("flex flex-col gap-1",n&&"text-center"),children:[jsx("p",{className:a$2("leading-[130%] text-neutral-500",!!e&&"font-medium"),style:o?{overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:o}:void 0,children:t}),e&&jsx("p",{className:"text-sm leading-[130%] text-neutral-500",style:r?{overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:r}:void 0,children:e})]})]}),it=_t;var Jt=ht.memo(({handleSelect:t,NoResultsIcon:o,noResultsLabel:e,noResultsDescription:r,noResultsDescriptionLines:l,noResultsAsColumn:n,noResultsButtonOnClick:a$3,optionDescriptionLines:i,noResultsButtonLabel:s,filteredOptions:d,inputRect:c$1,inputRef:b,popoverPosition:x,optionsListRef:k,selectedOption:w,options:z,setFilteredOptions:v})=>jsx(At.Root,{asChild:true,children:jsx("div",{ref:k,className:"pointer-events-auto fixed z-50 hidden w-full",style:c$1?{width:`${c$1.width}px`,left:c$1.left,top:x==="bottom"?`${c$1.bottom}px`:void 0,bottom:x==="top"?`${window.innerHeight-c$1.top}px`:void 0}:void 0,children:jsxs(a,{className:"elevation-8 mb-2 flex max-h-[336px] w-full flex-col rounded-lg bg-neutral-50",children:[d.length===0&&jsxs("div",{className:"elevation-8 max-h-88 flex flex-1 flex-col justify-center rounded-lg bg-neutral-50",children:[jsx(it,{title:e,description:r,Icon:o,iconAsColumn:n,descriptionLines:l}),a$3&&jsxs(Fragment,{children:[jsx(a$1,{}),jsx(c,{variant:"ghost",className:"my-3 w-fit self-center",onClick:m=>{k.current.style.display="none",b.current.value="",v(z),a$3();},children:s})]})]}),d.map(m=>jsx(Ot,{title:m.label,disabled:m.disabled,description:m.description,descriptionLines:i,onClick:()=>t(m),className:a$2(w?.value===m.value&&"bg-primary-200")},m.key??m.value))]})})})),Mt=Jt;var Qt=336,nr=({options:t,defaultSelectedOption:o,onSelect:e,onClick:r,onInputChange:l,error:n,helperText:a,label:i,placeholder:s,value:d,size:c="md",optionDescriptionLines:b=1,noResultsLabel:x,noResultsIcon:k,noResultsDescription:w,noResultsDescriptionLines:z,noResultsAsColumn:v,noResultsButtonOnClick:m,noResultsButtonLabel:M,className:G,disabled:h})=>{let[p,y]=useState(o??null),R=useRef(null),g=useRef(null),[st,lt]=useState(),[ct,N]=useState([]),[dt,B]=useState("bottom"),[U,Z]=useState(),$=Qt,X=useCallback(f=>{R.current.style.display="none",g.current.value=f.label,y(f),e?.(f);},[e]),C=useCallback(()=>{if(!g?.current)return;let f=g.current.getBoundingClientRect();lt(f);let O=U?U.height:$,A=window.innerHeight-f.bottom>O,tt=f.top>O;B(A?"bottom":tt?"top":"bottom");},[U?.height]),_=useCallback(()=>{let f=t.filter(O=>O.label.toLowerCase().includes(g?.current?.value.toLowerCase()??""));if(N(f),R?.current){let O=R.current.getBoundingClientRect();Z(O);}},[t]);return useEffect(()=>{N(t);},[t]),useEffect(()=>{if(!d){y(null),g.current&&(g.current.value="");return}(!g.current?.value||p?.value!==d.value)&&(y(d),g.current.value=d.label);},[d]),a$5(R,()=>{R.current.style.display="none",p&&g.current&&(g.current.value=p.label);}),useEffect(()=>{if(g?.current)return C(),g.current.addEventListener("mousedown",C),g.current.addEventListener("input",_),window.addEventListener("scroll",C,true),window.addEventListener("resize",C),()=>{g.current?.removeEventListener("mousedown",C),g.current?.removeEventListener("input",_),window.removeEventListener("scroll",C,true),window.removeEventListener("resize",C);}},[C,_]),jsxs("div",{className:a$2("relative",G),children:[jsx(a$4,{ref:g,autoComplete:"off",list:"",selectMode:true,onChange:f=>{f.target.value||(y(null),e?.(null)),l?.(f);},onClean:()=>{y(null),N(t),e?.(null);},onClick:f=>{R.current.style.display="flex",r?.(f);},onBlur:()=>{p&&g.current&&(g.current.value=p.label);},label:i,helperText:a,placeholder:s,size:c,error:n,disabled:h}),jsx(Mt,{handleSelect:X,noResultsLabel:x,NoResultsIcon:k,optionDescriptionLines:b,noResultsAsColumn:v,noResultsButtonLabel:M,noResultsButtonOnClick:m,noResultsDescription:w,noResultsDescriptionLines:z,filteredOptions:ct,inputRect:st,inputRef:g,popoverPosition:dt,optionsListRef:R,selectedOption:p,options:t,setFilteredOptions:N})]})};var te=({children:t,title:o,titleLines:e,description:r="",descriptionLines:l,disabled:n=false,className:a,...i})=>jsxs("div",{className:"flex w-full flex-col gap-1",...i,children:[jsx("p",{className:a$2("break-all text-sm leading-[130%]",!!r&&"font-medium"),style:e?{overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:e}:void 0,children:o}),r&&jsx("p",{className:a$2("text-xs leading-[130%]",n?"text-neutral-400":"text-neutral-700"),style:l?{overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:l}:void 0,children:r})]}),F=te;var vr=({children:t,title:o,titleLines:e,description:r="",descriptionLines:l,startIcon:n,badgeContent:a,hasDivider:i=false,disabled:s=false,onSelect:d,className:c,...b})=>jsxs(D,{hasDescription:!!r,disabled:s,onClick:d,hasDivider:i,className:a$2(!s&&"cursor-pointer",c),...b,children:[n&&ht.cloneElement(n,{className:"shrink-0 mr-2 h-4.5 w-4.5"}),jsx(F,{title:o,titleLines:e,description:r,descriptionLines:l,disabled:s}),jsxs("div",{className:"ml-4 flex gap-2",children:[a&&jsx(a$3,{content:a,size:"lg",variant:"alert",className:a$2("self-center",s&&"bg-neutral-400")}),jsx(h,{className:"h-4.5 w-4.5 self-center"})]})]});var Dt=({children:t,title:o,titleLines:e=1,description:r="",descriptionLines:l,startIcon:n,hasDivider:a=false,disabled:i=false,checked:s,onCheckedChange:d,className:c,...b})=>jsxs(D,{hasDescription:!!r,disabled:i,hasDivider:a,...b,className:a$2("pr-6",c),children:[n&&ht.cloneElement(n,{className:"shrink-0 w-4.5 h-4.5 mr-2"}),jsx(F,{title:o,titleLines:e,description:r,descriptionLines:l,disabled:i}),jsx(c$2,{size:"sm",checked:s,onCheckedChange:d,className:"ml-4 self-center",disabled:i})]});var S=336,Tt=createContext({inputRef:null,optionsListRef:null,scrollAreaRef:null,autocompleteId:"",inputRect:void 0,showChips:false,filteredOptions:[],currentFocus:-1,popoverPosition:"bottom",setFilteredOptions:()=>{},setCurrentFocus:()=>{},setShowChips:()=>{},setPopoverPosition:()=>{},setInputRect:()=>{},optionsListHeight:S,setOptionsListHeight:()=>{},optionsListRect:void 0,setOptionsListRect:()=>{}}),P=()=>{let t=useContext(Tt);if(t===null)throw new Error("useAutocompleteMultipleContext must be used within a AutocompleteMultipleProvider");return t},Ht=({children:t})=>{let o=useRef(null),e=useRef(null),r=useRef(null),l=useId(),[n,a]=useState(),[i,s]=useState(true),[d,c]=useState([]),[b,x]=useState(-1),[k,w]=useState("bottom"),[z,v]=useState(),[m,M]=useState(S);return jsx(Tt.Provider,{value:{optionsListRef:o,inputRef:e,scrollAreaRef:r,autocompleteId:l,inputRect:n,showChips:i,filteredOptions:d,currentFocus:b,popoverPosition:k,setFilteredOptions:c,setCurrentFocus:x,setShowChips:s,setPopoverPosition:w,setInputRect:a,optionsListHeight:m,optionsListRect:z,setOptionsListRect:v,setOptionsListHeight:M},children:t})};var pe=({option:t,onMountWidth:o,size:e})=>{let r=useRef(null);return useEffect(()=>{r.current&&o?.(r.current.clientWidth);},[]),jsx(d,{type:"fill",variant:"standard",ref:r,className:"flex-shrink-0",size:e==="md"?"xs":"sm",hasCloseIcon:false,children:t.label})},Nt=pe;var ue=150,be=ht.memo(({selectedOptions:t,error:o,onCleanSelectedOptions:e,disabled:r,size:l})=>{let{autocompleteId:n,inputRect:a,inputRef:i,optionsListRef:s}=P(),d=ht.useRef(null),[c,b]=ht.useState(new Map),x=useMemo(()=>{if(!a?.width)return [];let w=0,z=a.width-ue,v=0;for(let m=0;m<t.length&&(v+=c.get(m)??0,!(v>z));m++)w++;return t.slice(0,w)},[a?.width,t,c]),k=useCallback(()=>{r||(i?.current?.focus(),s.current.style.display="flex");},[r]);return jsxs("div",{onClick:k,className:a$2("absolute top-0 z-30 flex w-full cursor-pointer flex-nowrap items-center gap-2 pl-3 pr-12",r&&"cursor-not-allowed"),style:{maxWidth:a?.width?a?.width:void 0,height:a?.height?a?.height:void 0},children:[jsx("div",{className:"flex flex-1 gap-1 overflow-hidden",ref:d,children:x.map((w,z)=>jsx(Nt,{option:w,onMountWidth:v=>b(m=>new Map(m).set(z,v)),size:l},`chip-input-${n}-${w.value}`))}),t.length>x.length&&jsx("span",{className:"text-base",children:"..."}),t.length>0&&!o&&jsx(a$3,{content:String(t.length),size:l}),o&&t.length>0&&jsx(c$1,{className:"h-6 w-6 text-error-700",onClick:w=>{w.stopPropagation(),e();}})]})}),Bt=be;var fe=ht.memo(({option:t,index:o,onPressOption:e,isSelected:r,optionDescriptionLines:l})=>{let{currentFocus:n,inputRef:a}=P();return jsx(Dt,{title:t.label,checked:r,disabled:t.disabled,className:n===o?"bg-primary-200":void 0,onMouseDown:i=>{t.disabled||(a?.current?.value&&i.preventDefault(),e?.(t,i));},description:t.description,descriptionLines:l})}),vt=fe;var Le=ht.memo(({selectedOptions:t,handleSelect:o,NoResultsIcon:e,noResultsLabel:r,noResultsDescription:l,noResultsDescriptionLines:n,noResultsAsColumn:a$2,noResultsButtonOnClick:i,optionDescriptionLines:s,noResultsButtonLabel:d})=>{let{popoverPosition:c$1,scrollAreaRef:b,optionsListRef:x,filteredOptions:k,inputRect:w,autocompleteId:z,inputRef:v,optionsListHeight:m}=P(),M=useCallback(h=>t.some(p=>p.value===h.value),[t]),G=useMemo(()=>t.filter(h=>h.label.toLowerCase().includes(v?.current?.value.toLowerCase()??"")),[t,v?.current?.value]);return jsx(At.Root,{asChild:true,children:jsx("div",{ref:x,className:"pointer-events-auto fixed z-50 hidden w-full",style:w?{width:`${w.width}px`,left:w.left,top:c$1==="bottom"?`${w.bottom}px`:void 0,bottom:c$1==="top"?`${window.innerHeight-w.top}px`:void 0}:void 0,children:jsxs(a,{className:"elevation-8 mb-2 flex w-full flex-col rounded-lg bg-neutral-50",style:{maxHeight:m+"px"},ref:b,children:[k.length===0&&jsxs("div",{className:"elevation-8 max-h-88 flex flex-1 flex-col justify-center rounded-lg bg-neutral-50",children:[jsx(it,{title:r,description:l,Icon:e,iconAsColumn:a$2,descriptionLines:n}),i&&jsxs(Fragment,{children:[jsx(a$1,{}),jsx(c,{variant:"ghost",className:"my-3 w-fit self-center",onClick:h=>{x.current.style.display="none",v.current.value="",i();},children:d})]})]}),G.map((h,p)=>jsx(vt,{option:h,index:p,onPressOption:y=>o(y),isSelected:M(h),optionDescriptionLines:s},`autocomplete-option-${z}-${h.key??h.value}`)),k.map((h,p)=>!t.some(y=>y.value===h.value)&&jsx(vt,{option:h,index:p,onPressOption:y=>o(y),isSelected:M(h),optionDescriptionLines:s},`autocomplete-option-${z}-${h.key??h.value}`))]})})})}),Yt=Le;var Ae=ht.memo(({selectedOptions:t,onSelect:o,error:e,helperText:r,label:l,placeholder:n,options:a,onInputChange:i,size:s,disabled:d})=>{let{setCurrentFocus:c,setFilteredOptions:b,optionsListRef:x,inputRef:k}=P();return jsx(a$4,{ref:k,autoComplete:"off",list:"",disabled:d,selectMode:true,onChange:w=>{c(-1),i?.(w.target.value);},onClean:()=>{c(-1),b(a),o?.(null,t);},onClick:()=>{d||(x.current.style.display="flex");},error:e,helperText:r,label:l,placeholder:n,fixedTopLabel:t.length>0,size:s})}),Wt=Ae;var Vt=({options:t,defaultSelectedOptions:o,onSelect:e,error:r,helperText:l,label:n,placeholder:a,noResultsLabel:i,noResultsIcon:s,noResultsDescription:d,noResultsDescriptionLines:c,noResultsAsColumn:b,noResultsButtonOnClick:x,noResultsButtonLabel:k,className:w,onInputChange:z,value:v,loading:m,size:M="md",optionDescriptionLines:G=1,disabled:h})=>{let{inputRef:p,optionsListRef:y,setFilteredOptions:R,setShowChips:g,setInputRect:st,setPopoverPosition:lt,setCurrentFocus:ct,showChips:N,setOptionsListRect:dt,optionsListRect:B,setOptionsListHeight:U}=P(),Z=useRef(false),[$,X]=useState(o??[]),C=useCallback(L=>{X(I=>{let E,q=I.findIndex($t=>$t.value===L.value);return q===-1?(E=I.concat(L),e?.(L,E),E):(E=I.toSpliced(q,1),e?.(L,E),E)});},[e]),_=useCallback(()=>{X([]),R(t),e?.(null,[]);},[]),f=useCallback(()=>{g(false);},[]),O=useCallback(()=>{g(true);},[]),A=useCallback(()=>{if(!p?.current)return;let L=p.current.getBoundingClientRect();st(L);let I=B?B.height>S?S:B.height:S,E=window.innerHeight-L.bottom>I,q=L.top>I;lt(E?"bottom":q?"top":"bottom"),U(q?S:window.innerHeight-L.bottom>S?S:window.innerHeight-L.bottom);},[B?.height]),tt=useCallback(()=>{let L=t.filter(I=>I.label.toLowerCase().includes(p?.current?.value.toLowerCase()??""));if(R(L),y?.current){let I=y.current.getBoundingClientRect();dt(I);}},[t,y?.current]);return useEffect(()=>{R(t);},[t]),a$5(y,()=>{y.current.style.display="none",ct(-1);}),useEffect(()=>{if(p?.current)return A(),p.current.addEventListener("mousedown",A),p.current.addEventListener("input",tt),p.current.addEventListener("focusin",f),p.current.addEventListener("focusout",O),window.addEventListener("scroll",A,true),window.addEventListener("resize",A),()=>{p.current?.removeEventListener("mousedown",A),p.current?.removeEventListener("input",A),p.current?.removeEventListener("focusout",O),p.current?.removeEventListener("focusin",f),window.removeEventListener("scroll",A,true),window.removeEventListener("resize",A);}},[A,O,f,tt]),useEffect(()=>{v&&(X(v),g(true));},[v]),useEffect(()=>{m||o&&o.length&&!Z.current&&(X(o),Z.current=true,g(true));},[o,m]),jsxs("div",{className:a$2("relative",w),children:[jsx(Wt,{selectedOptions:$,onSelect:e,error:r,helperText:l,label:n,placeholder:a,handleSelect:C,options:t,onInputChange:z,size:M,disabled:h}),N&&jsx(Bt,{selectedOptions:$,disabled:h,error:r,onCleanSelectedOptions:_,size:M}),jsx(Yt,{handleSelect:C,selectedOptions:$,noResultsLabel:i,NoResultsIcon:s,optionDescriptionLines:G,noResultsAsColumn:b,noResultsButtonLabel:k,noResultsButtonOnClick:x,noResultsDescription:d,noResultsDescriptionLines:c})]})};var Fo=t=>jsx(Ht,{children:jsx(Vt,{...t})});var Vo=({children:t,title:o,titleLines:e=1,description:r,descriptionLines:l=1,StartIcon:n,hasDivider:a=false,disabled:i=false,actionButton:s,isSelected:d=false,className:c$1,...b})=>jsxs(D,{hasDescription:!!r,disabled:i,hasDivider:a,isSelected:d,...b,className:c$1,children:[n&&jsx(n,{className:"mr-2 h-4.5 w-4.5 shrink-0 flex-grow-0"}),jsx(F,{title:o,titleLines:e,description:r,descriptionLines:l,disabled:i}),s&&jsx(Fragment,{children:s.isIcon?jsx(c$3,{...s,className:"ml-4 self-center",variant:"ghost",size:"sm",disabled:i??s.disabled}):jsx(c,{...s,className:"ml-4 self-center",size:"sm",variant:"ghost",disabled:i??s.disabled})})]});var Fe=({children:t,hasDescription:o=false,disabled:e=false,hasDivider:r=false,className:l,isSelected:n,onClick:a,...i})=>jsxs(Fragment,{children:[jsx("div",{className:a$2("flex flex-row px-3 py-4 text-neutral-900 transition-colors",o?"py-3":"py-[0.875rem]",e?"cursor-not-allowed text-neutral-400":"hover:bg-primary-100 focus:bg-primary-200",n&&"bg-primary-200",l),onClick:s=>{e||a?.(s);},...i,children:t}),r&&jsx(a$1,{})]}),D=Fe;var Ot=({children:t,title:o,titleLines:e,description:r="",descriptionLines:l,startIcon:n,endIcon:a,hasDivider:i=false,disabled:s=false,isSelected:d=false,className:c,...b})=>jsxs(D,{hasDescription:!!r,disabled:s,hasDivider:i,className:c,isSelected:d,...b,children:[n&&ht.cloneElement(n,{className:"shrink-0 mr-2 h-4.5 w-4.5"}),jsx(F,{title:o,titleLines:e,description:r,descriptionLines:l,disabled:s}),a&&ht.cloneElement(a,{className:"min-h-4.5 min-w-4.5 self-center ml-4"})]});export{nr as a,Ot as b,vr as c,Dt as d,Fo as e,Vo as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a
|
|
1
|
+
import {a as a$1}from'./chunk-KTRSJBA4.mjs';import {a,b,c,d,e,f,g,h,i as i$1}from'./chunk-E5G7444M.mjs';import {a as a$3}from'./chunk-AYAULBBH.mjs';import {a as a$4}from'./chunk-QHBCNAWO.mjs';import {g as g$1}from'./chunk-QWBSZY37.mjs';import {a as a$2}from'./chunk-2WINTZSS.mjs';import V,{useId,useRef,useState,useEffect,useMemo}from'react';import*as S from'@radix-ui/react-portal';import {jsx,jsxs}from'react/jsx-runtime';var M=56,p=6,K=(o=>(o.CL="CL",o.AR="AR",o.CO="CO",o.GT="GT",o.MX="MX",o.PE="PE",o.BR="BR",o.UY="UY",o.US="US",o))(K||{}),I=new Map([["CL",{name:"Chile",flag:a}],["AR",{name:"Argentina",flag:b}],["CO",{name:"Colombia",flag:c}],["GT",{name:"Guatemala",flag:d}],["MX",{name:"Mexico",flag:e}],["PE",{name:"Per\xFA",flag:f}],["BR",{name:"Brasil",flag:g}],["UY",{name:"Uruguay",flag:h}],["US",{name:"Estados Unidos",flag:i$1}]]),i=Array.from(I.entries()),ge=({noResults:x,selectedCountry:d,onSelect:A,className:U,size:B="md",...m})=>{let H=useId(),l=useRef(null),r=useRef(null),o=useRef(null),[G,Y]=useState("bottom"),[s,$]=useState(),[k,z]=useState(-1),X=e=>{l.current.style.display="none",A?.(e);};useEffect(()=>{if(!r.current)return;let e=()=>{if(!r.current)return;let a=M*(i.length<p?i.length:p)+16,c=r.current.getBoundingClientRect();$(c);let _=window.innerHeight-c.bottom>a,D=c.top>a;Y(_?"bottom":D?"top":"bottom");};return e(),r.current.addEventListener("mousedown",e),window.addEventListener("scroll",e,true),window.addEventListener("resize",e),()=>{r.current?.removeEventListener("mousedown",e),window.removeEventListener("scroll",e,true),window.removeEventListener("resize",e);}},[r.current]),a$1(l,()=>{l.current&&(l.current.style.display="none",z(-1));});let w=useMemo(()=>I.get(d),[d]);return jsx("div",{className:a$2("flex flex-col",U),children:jsxs("div",{className:a$2("relative flex flex-col"),children:[jsx(a$3,{ref:r,startComponent:jsxs("div",{className:"z-[100000] ml-3 flex h-2 w-[7.5rem] cursor-pointer items-center",onClick:()=>{m.disabled||(l.current.style.display="flex");},children:[jsx("img",{src:w?.flag,alt:w?.name,className:a$2("h-6 w-6 cursor-pointer",m.disabled&&"cursor-not-allowed text-neutral-400")}),jsx("span",{className:a$2("ml-1",m.disabled&&"cursor-not-allowed text-neutral-400"),children:d}),jsx(g$1,{className:a$2(B==="md"?"h-6 w-6":"h-4.5 w-4.5","cursor-pointer",m.disabled&&"cursor-not-allowed text-neutral-400")})]}),...m}),jsx(S.Root,{asChild:true,children:jsx("ul",{ref:l,className:"pointer-events-auto absolute z-[10000] hidden w-full",style:s?{width:`${s.width}px`,left:s.left,top:G==="bottom"?`${s.height+s.top+window.scrollY}px`:window.scrollY+s.top-(i.length<p?i.length:p)*M-16}:void 0,children:jsxs(a$4,{className:"elevation-8 my-2 flex max-h-[336px] w-full flex-col rounded-lg bg-neutral-50",ref:o,children:[i.length===0&&jsxs("div",{className:"elevation-8 max-h-88 flex flex-1 flex-col items-center justify-center rounded-lg bg-neutral-50 px-8 py-6",children:[V.cloneElement(x.icon,{className:"mb-2 h-8 w-8 text-neutral-300"}),jsx("p",{className:"text-center text-sm leading-[120%] text-neutral-500",children:x.message})]}),i.map(([e,a],c)=>jsx("li",{onClick:()=>{X(e);},className:a$2("flex-shrink-0 cursor-pointer py-4 pl-4 pr-6 text-left hover:bg-primary-100",d===e&&"bg-primary-200",k===c&&"bg-primary-200"),children:jsxs("div",{className:a$2("flex items-center space-x-3"),children:[jsx("img",{src:a.flag,alt:a.name,className:"h-6 w-6"}),jsx("p",{children:a.name}),jsx("p",{className:"text-primary-500",children:`(${e})`})]})},`select-option-${H}-${e}`))]})})})]})})};export{K as a,ge as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-AYAULBBH.mjs';import {p}from'./chunk-QWBSZY37.mjs';import {jsx}from'react/jsx-runtime';var i=({size:t="md",...p$1})=>jsx(a,{endIcon:jsx(p,{}),type:"search",...p$1,size:t});export{i as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-AYAULBBH.mjs';import {a as a$2}from'./chunk-QHBCNAWO.mjs';import {a as a$1}from'./chunk-2WINTZSS.mjs';import $,{useId,useRef,useState,useEffect}from'react';import*as R from'@radix-ui/react-portal';import {jsxs,Fragment,jsx}from'react/jsx-runtime';var i=56,u=6,q=({options:l,noResults:v,selectedOption:L,onSelect:P,onChange:C,onClick:T,className:k,...I})=>{let N=useId(),n=useRef(null),r=useRef(null),b=useRef(null),[H,M]=useState("bottom"),[o,F]=useState(),[s,c]=useState(-1),[g,h]=useState(L??null),y=e=>{n.current.style.display="none",r.current.value=e.label,h(e),P?.(e);},A=e=>{if(e.key==="ArrowDown"){if(s===l.length-1)return;c(t=>t+1),n.current.style.display="flex",x();}else if(e.key==="ArrowUp"){if(s===0)return;c(t=>t-1),x();}else e.key==="Enter"&&(y(l[s]),c(-1));},x=()=>{let e=i*u;b.current.scroll({top:(s+2)*i<=e?0:i*(s+2)-e,behavior:"smooth"});};return useEffect(()=>{if(!r.current)return;let e=()=>{if(!r.current)return;let t=i*(l.length<u?l.length:u)+16,m=r.current.getBoundingClientRect();F(m);let B=window.innerHeight-m.bottom>t,D=m.top>t;M(B?"bottom":D?"top":"bottom");};return e(),r.current.addEventListener("mousedown",e),window.addEventListener("scroll",e,true),window.addEventListener("resize",e),()=>{r.current?.removeEventListener("mousedown",e),window.removeEventListener("scroll",e,true),window.removeEventListener("resize",e);}},[r.current]),useEffect(()=>{function e(t){n.current&&!n.current.contains(t.target)&&(n.current.style.display="none",c(-1));}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e);}},[n.current]),jsxs(Fragment,{children:[jsx(a,{className:a$1("w-full !cursor-pointer",k),readOnly:true,ref:r,autoComplete:"off",list:"",selectMode:true,value:g?.label,showClearButton:false,onClick:e=>{n.current.style.display="flex",T?.(e);},onChange:e=>{c(-1),h(null),C?.(e);},onKeyDown:A,...I}),jsx(R.Root,{asChild:true,children:jsx("ul",{ref:n,className:"pointer-events-auto absolute z-[10000] hidden w-full",style:o?{width:`${o.width}px`,left:o.left,top:H==="bottom"?`${o.height+o.top+window.scrollY}px`:window.scrollY+o.top-(l.length<u?l.length:u)*i-16}:void 0,children:jsxs(a$2,{className:"elevation-8 my-2 flex max-h-[336px] w-full flex-col rounded-lg bg-neutral-50",ref:b,children:[l.length===0&&jsxs("div",{className:"elevation-8 max-h-88 flex flex-1 flex-col items-center justify-center rounded-lg bg-neutral-50 px-8 py-6",children:[$.cloneElement(v.icon,{className:"mb-2 h-8 w-8 text-neutral-300"}),jsx("p",{className:"text-center text-sm leading-[120%] text-neutral-500",children:v.message})]}),l.map((e,t)=>jsx("li",{onClick:()=>{e.disabled||y(e);},className:a$1("w-full flex-shrink-0 py-4 pl-4 pr-6 text-left",g?.value===e.value&&"bg-primary-200",s===t&&!e.disabled&&"bg-primary-200",e.disabled?"cursor-not-allowed text-neutral-400":"cursor-pointer hover:bg-primary-100"),children:e.label},`select-option-${N}-${e.key??e.value}`))]})})})]})};export{q as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-KTRSJBA4.mjs';import {a as a$1}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-KTRSJBA4.mjs';import {a as a$1}from'./chunk-AYAULBBH.mjs';import {a as a$3}from'./chunk-QHBCNAWO.mjs';import {o}from'./chunk-QWBSZY37.mjs';import {a as a$2}from'./chunk-2WINTZSS.mjs';import {useState,useRef,useMemo,useEffect}from'react';import*as S from'@radix-ui/react-portal';import {format}from'date-fns';import {jsxs,Fragment,jsx}from'react/jsx-runtime';var U=["00:00:00","00:30:00","01:00:00","01:30:00","02:00:00","02:30:00","03:00:00","03:30:00","04:00:00","04:30:00","05:00:00","05:30:00","06:00:00","06:30:00","07:00:00","07:30:00","08:00:00","08:30:00","09:00:00","09:30:00","10:00:00","10:30:00","11:00:00","11:30:00","12:00:00","12:30:00","13:00:00","13:30:00","14:00:00","14:30:00","15:00:00","15:30:00","16:00:00","16:30:00","17:00:00","17:30:00","18:00:00","18:30:00","19:00:00","19:30:00","20:00:00","20:30:00","21:00:00","21:30:00","22:00:00","22:30:00","23:00:00","23:30:00"],i=56,d=6,V=({value:f,onChange:P,locale:g,minTime:T,maxTime:v,...N})=>{let[O,u]=useState(false),[p,h]=useState(f),[n,y]=useState(),[z,A]=useState("bottom"),E=useRef(null),o$1=useRef(null),x=useRef(null),[l,c]=useState(-1),k=e=>{h(e),P?.(e),u(false),c(-1);},B=useMemo(()=>p?format(new Date("2024-01-01T"+p),"p"):"",[p,g]),K=()=>{h(void 0),c(-1),P?.(void 0);},r=useMemo(()=>U.map(e=>({value:e,label:format(new Date("2024-01-01T"+e),"p"),disabled:T&&e<T||v&&e>v})),[g,T,v]),_=e=>{if(e.preventDefault(),e.key==="ArrowDown"){if(l===r.length-1)return;c(t=>t+1),u(true),L();}else if(e.key==="ArrowUp"){if(l===0)return;c(t=>t-1),L();}else e.key==="Enter"&&(k(r[l].value),c(-1));},L=()=>{let e=i*d;x.current.scroll({top:(l+2)*i<=e?0:i*(l+2)-e,behavior:"smooth"});};return useEffect(()=>{h(f);},[f]),a(E,()=>{u(false);}),useEffect(()=>{if(!o$1.current)return;let e=()=>{if(!o$1.current)return;let t=i*(r.length<d?r.length:d)+16,m=o$1.current.getBoundingClientRect();y(m);let $=window.innerHeight-m.bottom>t,G=m.top+m.height>t;A($?"bottom":G?"top":"bottom");};return e(),o$1.current.addEventListener("mousedown",e),window.addEventListener("scroll",e,true),window.addEventListener("resize",e),()=>{o$1.current?.removeEventListener("mousedown",e),window.removeEventListener("scroll",e,true),window.removeEventListener("resize",e);}},[o$1.current]),jsxs(Fragment,{children:[jsx(a$1,{ref:o$1,autoComplete:"off",startIcon:jsx(o,{}),onClean:K,readOnly:true,value:B,onKeyDown:_,onClick:e=>{y(e.currentTarget.getBoundingClientRect()),u(t=>!t);},...N}),jsx(S.Root,{children:jsx("div",{ref:E,className:a$2("pointer-events-auto fixed z-50 hidden",O&&"block"),style:n?{width:`${n.width}px`,top:z==="bottom"?`${n.height+n.top}px`:n.top-(r.length<d?r.length:d)*i-16,left:n?.left}:void 0,children:jsx(a$3,{className:"elevation-8 my-2 flex max-h-84 w-full flex-col rounded-lg bg-neutral-50",ref:x,children:r.map((e,t)=>jsx("div",{onClick:()=>!e.disabled&&k(e.value),className:a$2("flex w-full items-center px-2 hover:cursor-pointer",!e.disabled&&"hover:bg-primary-100",p===e.value&&"bg-primary-200",l===t&&"bg-primary-200",e.disabled&&"text-neutral-500 hover:cursor-not-allowed"),style:{height:i},children:e.label},e.value))})})})]})};V.displayName="TimePicker";export{V as a};
|