@xploreu/components 0.4.0 → 0.4.2
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-2TQHUVNP.js +2 -0
- package/dist/chunk-2TQHUVNP.js.map +1 -0
- package/dist/{chunk-YZCOEN5Y.js → chunk-7FRAZHPK.js} +2 -2
- package/dist/{chunk-YZCOEN5Y.js.map → chunk-7FRAZHPK.js.map} +1 -1
- package/dist/chunk-DSH6THYW.js +2 -0
- package/dist/chunk-DSH6THYW.js.map +1 -0
- package/dist/{chunk-BT5SLUEA.js → chunk-ISGXRZLJ.js} +2 -2
- package/dist/{chunk-BT5SLUEA.js.map → chunk-ISGXRZLJ.js.map} +1 -1
- package/dist/chunk-IXWAWSD4.js +2 -0
- package/dist/chunk-IXWAWSD4.js.map +1 -0
- package/dist/chunk-JWKTYYJB.js +2 -0
- package/dist/{chunk-HQEFYA3Z.js.map → chunk-JWKTYYJB.js.map} +1 -1
- package/dist/chunk-RBLL355H.js +2 -0
- package/dist/chunk-RBLL355H.js.map +1 -0
- package/dist/{chunk-S2GJ24IN.js → chunk-Y4HXGKZD.js} +2 -2
- package/dist/{chunk-S2GJ24IN.js.map → chunk-Y4HXGKZD.js.map} +1 -1
- package/dist/chunk-Z67QQMOX.js +2 -0
- package/dist/chunk-Z67QQMOX.js.map +1 -0
- package/dist/composites/combobox-chip-outside.js +1 -1
- package/dist/composites/index.js +1 -1
- package/dist/composites/index.js.map +1 -1
- package/dist/composites/phone-input.js +1 -1
- package/dist/form/form-input.js +1 -1
- package/dist/form/index.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/primitives/alert-dialog.d.ts +34 -0
- package/dist/primitives/alert-dialog.js +2 -0
- package/dist/primitives/alert-dialog.js.map +1 -0
- package/dist/primitives/index.d.ts +3 -0
- package/dist/primitives/index.js +1 -1
- package/dist/primitives/sheet.d.ts +33 -0
- package/dist/primitives/sheet.js +2 -0
- package/dist/primitives/sheet.js.map +1 -0
- package/dist/ui/alert-dialog.d.ts +27 -0
- package/dist/ui/alert-dialog.js +2 -0
- package/dist/ui/alert-dialog.js.map +1 -0
- package/dist/ui/combobox.js +1 -1
- package/dist/ui/dialog.d.ts +2 -1
- package/dist/ui/dialog.js +1 -1
- package/dist/ui/index.d.ts +6 -1
- package/dist/ui/index.js +1 -1
- package/dist/ui/input.js +1 -1
- package/dist/ui/sheet.d.ts +31 -0
- package/dist/ui/sheet.js +2 -0
- package/dist/ui/sheet.js.map +1 -0
- package/package.json +1 -1
- package/dist/chunk-6VN6YGMG.js +0 -2
- package/dist/chunk-6VN6YGMG.js.map +0 -1
- package/dist/chunk-HQEFYA3Z.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {b as b$1,c,g,d,f as f$1,j,k as k$1,e}from'./chunk-RBLL355H.js';import'react';import {cn}from'@xploreu/lib/cn';import {jsx,jsxs}from'react/jsx-runtime';function u(r){return jsx(b$1,{...r})}function v(r){return jsx(c,{...r})}function x(r){return jsx(g,{...r})}function n({className:r,...e$1}){return jsx(e,{className:cn("fixed inset-0 z-50 bg-black/50 backdrop-blur-sm",r),...e$1})}function f({className:r,children:e,...A}){return jsxs(d,{children:[jsx(n,{}),jsx(f$1,{className:cn("fixed left-[50%] top-[50%] z-50 grid w-[calc(100%-2rem)] max-w-md translate-x-[-50%] translate-y-[-50%] border border-border-primary bg-bg-primary shadow-xp-lg rounded-xp-card-base overflow-hidden",r),...A,children:e})]})}function b({className:r,...e}){return jsx("div",{"data-slot":"alert-dialog-header",className:cn("relative px-4 py-3 flex flex-col bg-bg-primary has-[[data-slot=alert-dialog-icon]]:pl-16",r),...e})}function T({className:r,...e}){return jsx("div",{"data-slot":"alert-dialog-content",className:cn("px-4 py-4 max-h-[60vh] overflow-y-auto",r),...e})}function C({className:r,...e}){return jsx("div",{"data-slot":"alert-dialog-footer",className:cn("flex gap-2 items-center justify-end bg-bg-primary px-4 py-3",r),...e})}function _({className:r,...e}){return jsx(j,{className:cn("text-label-bold-2 text-text-primary",r),...e})}function h({className:r,...e}){return jsx(k$1,{className:cn("mt-0.5 text-body-regular-3 text-text-secondary",r),...e})}function k({className:r,...e}){return jsx("div",{"data-slot":"alert-dialog-icon",className:cn("absolute top-[13px] left-4 flex items-center justify-center rounded-lg bg-bg-primary p-2.5 [&_svg]:size-4 bg-bg-brand-solid text-fg-white shadow-[0px_1px_2px_-1px_var(--color-shadow-lg-01),0px_1px_3px_0px_var(--color-shadow-md-01),0px_0px_0px_4px_var(--color-focus-ring-secondary)]",r),...e})}export{u as a,v as b,x as c,f as d,b as e,T as f,C as g,_ as h,h as i,k as j};//# sourceMappingURL=chunk-2TQHUVNP.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-2TQHUVNP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ui/alert-dialog.tsx"],"names":["AlertDialog","props","jsx","AlertDialogTrigger","AlertDialogClose","AlertDialogBackdrop","className","cn","AlertDialogPopup","children","jsxs","AlertDialogPortal","AlertDialogHeader","AlertDialogContent","AlertDialogFooter","AlertDialogTitle","AlertDialogDescription","AlertDialogIcon"],"mappings":"+JAwBA,SAASA,CAAAA,CAAYC,CAAAA,CAAyB,CAC5C,OAAOC,GAAAA,CAACF,GAAAA,CAAA,CAAsB,GAAGC,CAAAA,CAAO,CAC1C,CAIA,SAASE,CAAAA,CAAmBF,CAAAA,CAAgC,CAC1D,OAAOC,GAAAA,CAACC,EAAA,CAA6B,GAAGF,CAAAA,CAAO,CACjD,CAIA,SAASG,CAAAA,CAAiBH,CAAAA,CAA8B,CACtD,OAAOC,GAAAA,CAACE,CAAAA,CAAA,CAA2B,GAAGH,EAAO,CAC/C,CAIA,SAASI,CAAAA,CAAoB,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGL,GAAM,CAAA,CAA6B,CAC9E,OACEC,GAAAA,CAACG,CAAAA,CAAA,CACC,SAAA,CAAWE,EAAAA,CAAG,iDAAA,CAAmD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CAAWR,EAAAA,CAAG,qCAAA,CAAuCD,CAAS,CAAA,CAC7D,GAAGL,CAAAA,CACN,CAEJ,CAIA,SAASe,CAAAA,CAAuB,CAAE,SAAA,CAAAV,CAAAA,CAAW,GAAGL,CAAM,CAAA,CAAgC,CACpF,OACEC,GAAAA,CAACc,GAAAA,CAAA,CACC,SAAA,CAAWT,GAAG,gDAAA,CAAkDD,CAAS,CAAA,CACxE,GAAGL,CAAAA,CACN,CAEJ,CAIA,SAASgB,CAAAA,CAAgB,CAAE,SAAA,CAAAX,CAAAA,CAAW,GAAGL,CAAM,CAAA,CAAyB,CACtE,OACEC,GAAAA,CAAC,KAAA,CAAA,CACC,WAAA,CAAU,mBAAA,CACV,SAAA,CAAWK,EAAAA,CACT,2RAAA,CACAD,CACF,CAAA,CACC,GAAGL,CAAAA,CACN,CAEJ","file":"chunk-2TQHUVNP.js","sourcesContent":["import * as React from 'react';\r\n\r\nimport {\r\n AlertDialog as AlertDialogPrimitive,\r\n AlertDialogTrigger as AlertDialogTriggerPrimitive,\r\n AlertDialogPortal as AlertDialogPortalPrimitive,\r\n AlertDialogBackdrop as AlertDialogBackdropPrimitive,\r\n AlertDialogPopup as AlertDialogPopupPrimitive,\r\n AlertDialogClose as AlertDialogClosePrimitive,\r\n AlertDialogTitle as AlertDialogTitlePrimitive,\r\n AlertDialogDescription as AlertDialogDescriptionPrimitive,\r\n type AlertDialogProps as AlertDialogPrimitiveProps,\r\n type AlertDialogTriggerProps as AlertDialogTriggerPrimitiveProps,\r\n type AlertDialogPortalProps as AlertDialogPortalPrimitiveProps,\r\n type AlertDialogBackdropProps as AlertDialogBackdropPrimitiveProps,\r\n type AlertDialogPopupProps as AlertDialogPopupPrimitiveProps,\r\n type AlertDialogCloseProps as AlertDialogClosePrimitiveProps,\r\n type AlertDialogTitleProps as AlertDialogTitlePrimitiveProps,\r\n type AlertDialogDescriptionProps as AlertDialogDescriptionPrimitiveProps,\r\n} from '../primitives/alert-dialog';\r\nimport { cn } from '@xploreu/lib/cn';\r\n\r\ntype AlertDialogProps = AlertDialogPrimitiveProps;\r\n\r\nfunction AlertDialog(props: AlertDialogProps) {\r\n return <AlertDialogPrimitive {...props} />;\r\n}\r\n\r\ntype AlertDialogTriggerProps = AlertDialogTriggerPrimitiveProps;\r\n\r\nfunction AlertDialogTrigger(props: AlertDialogTriggerProps) {\r\n return <AlertDialogTriggerPrimitive {...props} />;\r\n}\r\n\r\ntype AlertDialogCloseProps = AlertDialogClosePrimitiveProps;\r\n\r\nfunction AlertDialogClose(props: AlertDialogCloseProps) {\r\n return <AlertDialogClosePrimitive {...props} />;\r\n}\r\n\r\ntype AlertDialogBackdropProps = AlertDialogBackdropPrimitiveProps;\r\n\r\nfunction AlertDialogBackdrop({ className, ...props }: AlertDialogBackdropProps) {\r\n return (\r\n <AlertDialogBackdropPrimitive\r\n className={cn('fixed inset-0 z-50 bg-black/50 backdrop-blur-sm', className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogPopupProps = AlertDialogPopupPrimitiveProps;\r\n\r\nfunction AlertDialogPopup({ className, children, ...props }: AlertDialogPopupProps) {\r\n return (\r\n <AlertDialogPortalPrimitive>\r\n <AlertDialogBackdrop />\r\n <AlertDialogPopupPrimitive\r\n className={cn(\r\n \"fixed left-[50%] top-[50%] z-50 grid w-[calc(100%-2rem)] max-w-md translate-x-[-50%] translate-y-[-50%] border border-border-primary bg-bg-primary shadow-xp-lg rounded-xp-card-base overflow-hidden\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n </AlertDialogPopupPrimitive>\r\n </AlertDialogPortalPrimitive>\r\n );\r\n}\r\n\r\ntype AlertDialogHeaderProps = React.HTMLAttributes<HTMLDivElement>;\r\n\r\nfunction AlertDialogHeader({ className, ...props }: AlertDialogHeaderProps) {\r\n return (\r\n <div\r\n data-slot=\"alert-dialog-header\"\r\n className={cn(\r\n \"relative px-4 py-3 flex flex-col bg-bg-primary has-[[data-slot=alert-dialog-icon]]:pl-16\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogContentProps = React.HTMLAttributes<HTMLDivElement>;\r\n\r\nfunction AlertDialogContent({ className, ...props }: AlertDialogContentProps) {\r\n return (\r\n <div\r\n data-slot=\"alert-dialog-content\"\r\n className={cn(\"px-4 py-4 max-h-[60vh] overflow-y-auto\", className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogFooterProps = React.HTMLAttributes<HTMLDivElement>;\r\n\r\nfunction AlertDialogFooter({ className, ...props }: AlertDialogFooterProps) {\r\n return (\r\n <div\r\n data-slot=\"alert-dialog-footer\"\r\n className={cn(\r\n \"flex gap-2 items-center justify-end bg-bg-primary px-4 py-3\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogTitleProps = AlertDialogTitlePrimitiveProps;\r\n\r\nfunction AlertDialogTitle({ className, ...props }: AlertDialogTitleProps) {\r\n return (\r\n <AlertDialogTitlePrimitive\r\n className={cn(\"text-label-bold-2 text-text-primary\", className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogDescriptionProps = AlertDialogDescriptionPrimitiveProps;\r\n\r\nfunction AlertDialogDescription({ className, ...props }: AlertDialogDescriptionProps) {\r\n return (\r\n <AlertDialogDescriptionPrimitive\r\n className={cn(\"mt-0.5 text-body-regular-3 text-text-secondary\", className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogIconProps = React.ComponentProps<\"div\">;\r\n\r\nfunction AlertDialogIcon({ className, ...props }: AlertDialogIconProps) {\r\n return (\r\n <div\r\n data-slot=\"alert-dialog-icon\"\r\n className={cn(\r\n \"absolute top-[13px] left-4 flex items-center justify-center rounded-lg bg-bg-primary p-2.5 [&_svg]:size-4 bg-bg-brand-solid text-fg-white shadow-[0px_1px_2px_-1px_var(--color-shadow-lg-01),0px_1px_3px_0px_var(--color-shadow-md-01),0px_0px_0px_4px_var(--color-focus-ring-secondary)]\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nexport {\r\n AlertDialog,\r\n AlertDialogTrigger,\r\n AlertDialogClose,\r\n AlertDialogPopup,\r\n AlertDialogHeader,\r\n AlertDialogContent,\r\n AlertDialogFooter,\r\n AlertDialogTitle,\r\n AlertDialogDescription,\r\n AlertDialogIcon,\r\n type AlertDialogProps,\r\n type AlertDialogTriggerProps,\r\n type AlertDialogCloseProps,\r\n type AlertDialogPopupProps,\r\n type AlertDialogHeaderProps,\r\n type AlertDialogContentProps,\r\n type AlertDialogFooterProps,\r\n type AlertDialogTitleProps,\r\n type AlertDialogDescriptionProps,\r\n};\r\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {d,b,e,m,l,n,o,p,t,v,z,G}from'./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import {d,b,e,m,l,n,o,p,t,v,z,G}from'./chunk-ISGXRZLJ.js';import {b as b$1}from'./chunk-HUWF445V.js';import*as r from'react';import {cn}from'@xploreu/lib/cn';import {SearchIcon,XIcon}from'lucide-react';import {useControlledState}from'@xploreu/hooks/use-controlled-state';import {jsxs,jsx,Fragment}from'react/jsx-runtime';function j({multiple:z$1=true,inputPlaceholder:B="Search...",container:q,items:u,infiniteScroll:A,isPending:H,taggable:c=false,maxVisible:i,...m$1}){let[h,g]=useControlledState({value:m$1?.inputValue?.toString(),defaultValue:m$1?.defaultInputValue?.toString(),onChange:m$1?.onInputValueChange}),[b$2,x]=useControlledState({value:m$1?.value??[],defaultValue:m$1?.defaultValue??[],onChange:m$1?.onValueChange}),[v$1,I]=r.useState([]),d$1=r.useRef(new Set);r.useEffect(()=>{let e=new Set(b$2.map(t=>t.value));I(t=>{let l=t.filter(a=>e.has(a.value));return l.length===t.length?t:(d$1.current=new Set(l.map(a=>a.value)),l)});},[b$2]);let n$1=h?.toString().trim()??"",U=r.useMemo(()=>n$1?b$2.some(e=>e.value.toLowerCase()===n$1.toLowerCase()):false,[n$1,b$2]),p$1=r.useMemo(()=>!c||!n$1?false:!u?.some(e=>e.label.toLowerCase()===n$1.toLowerCase()),[c,n$1,u]),X=r.useMemo(()=>{let e=[...u??[],...v$1];if(p$1){let t={label:n$1,value:n$1,tag:true};return [...e,t]}return e},[u,v$1,p$1,n$1]);return jsxs(d,{...m$1,behavior:"chip-outside",multiple:true,items:c?X:u,isItemEqualToValue:(e,t)=>e.value===t.value,onValueChange:(e,t)=>{if(c){let l=e.filter(a=>a?.tag===true&&!d$1.current.has(a.value));if(l.length>0){for(let a of l)d$1.current.add(a.value);I(a=>[...a,...l]);}}x(z$1?e:[e[e.length-1]],t);},onInputValueChange:g,children:[jsxs("div",{className:"flex flex-col gap-2",children:[jsx(b,{render:jsx(b$1,{className:"h-9 text-body-regular-3 pl-9 pr-7",endContent:jsx(e,{nativeButton:false,render:jsx(XIcon,{className:"!size-5 !right-1.5 data-[hidden=true]:opacity-0 opacity-100 transition-opacity duration-300 cursor-pointer","data-hidden":!h,"data-slot":"combobox-clear-input",onClick:e=>{g("",{reason:"none",event:e.nativeEvent,cancel:()=>{},allowPropagation:()=>{},isCanceled:false,isPropagationAllowed:true,trigger:void 0});}})}),placeholder:B,startContent:jsx(SearchIcon,{className:"!size-4 !text-fg-tertiary-hover"}),wrapperClassName:"w-full"})}),jsx(m,{className:cn(i!==void 0&&"flex-nowrap overflow-hidden"),onMouseDown:e=>e.preventBaseUIHandler(),children:jsx(l,{children:e=>{let t=i!==void 0?e.slice(0,i):e,l=i!==void 0?e.length-i:0;return jsxs(Fragment,{children:[t?.map(a=>jsxs(n,{className:cn(i!==void 0&&"min-w-0 shrink"),children:[i!==void 0?jsx("span",{className:"truncate",children:a?.label||""}):a?.label||"",jsx(o,{})]},a?.value||"")),l>0&&jsxs(n,{className:"shrink-0",children:["+",l]})]})}})})]}),jsxs(p,{container:q,children:[jsx(t,{status:H||u===void 0?"pending":u?.length===0&&!p$1?"empty":null}),jsxs(v,{children:[u?.map(e=>jsx(z,{value:{label:e.label,value:e.value},children:jsx("div",{className:"flex items-center gap-2 w-full min-w-0",children:jsx("span",{className:"truncate",children:e.label})})},e.value)),p$1&&jsx(z,{value:{label:n$1,value:n$1,tag:true},children:jsxs("div",{className:"flex items-center gap-1.5 w-full min-w-0",children:[!U&&jsx("span",{className:"text-text-secondary",children:"Create:"}),jsx("span",{className:"font-medium text-text-primary truncate",children:n$1})]})}),jsx(G,{...A})]})]})]})}export{j as a};//# sourceMappingURL=chunk-7FRAZHPK.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-7FRAZHPK.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/composites/combobox-chip-outside.tsx"],"names":["ComboboxChipOutside","multiple","inputPlaceholder","container","items","infiniteScroll","isPending","taggable","maxVisible","props","inputValue","setInputValue","useControlledState","value","setValue","createdItems","setCreatedItems","createdValuesRef","currentValues","v","prev","next","item","trimmedInput","isInputSelected","isCreatingItem","combinedItems","base","createItem","jsxs","Combobox","a","b","eventDetails","newTags","tag","jsx","ComboboxInput","Input","ComboboxTrigger","XIcon","event","SearchIcon","ComboboxChips","cn","ComboboxValue","visible","overflow","Fragment","ComboboxChip","ComboboxChipRemove","ComboboxPopup","ComboboxStatus","ComboboxList","ComboboxItem","ComboboxInfiniteScroll"],"mappings":"iUA4CA,SAASA,CAAAA,CAAgF,CACvF,QAAA,CAAAC,IAAW,IAAA,CACX,gBAAA,CAAAC,CAAAA,CAAmB,WAAA,CACnB,UAAAC,CAAAA,CACA,KAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,EAAW,KAAA,CACX,UAAA,CAAAC,CAAAA,CACA,GAAGC,GACL,CAAA,CAAoC,CAClC,GAAM,CAACC,EAAYC,CAAa,CAAA,CAAIC,kBAAAA,CAAmB,CACrD,MAAOH,GAAAA,EAAO,UAAA,EAAY,QAAA,EAAS,CACn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A,CACAA,GAAO,MAAA,GAAW,CAAA,EAAK,CAACqB,GAAAA,CACtB,QACA,IAAA,CAEV,CAAA,CACAI,IAAAA,CAACwB,CAAAA,CAAA,CACE,QAAA,CAAA,CAAAjD,CAAAA,EAAO,GAAA,CAAKkB,CAAAA,EACXc,GAAAA,CAACkB,CAAAA,CAAA,CAEC,KAAA,CAAO,CAAE,KAAA,CAAOhC,CAAAA,CAAK,KAAA,CAAO,KAAA,CAAOA,EAAK,KAAM,CAAA,CAE9C,QAAA,CAAAc,GAAAA,CAAC,OAAI,SAAA,CAAU,wCAAA,CACb,QAAA,CAAAA,GAAAA,CAAC,QAAK,SAAA,CAAU,UAAA,CACb,QAAA,CAAAd,CAAAA,CAAK,MACR,CAAA,CACF,CAAA,CAAA,CAPKA,CAAAA,CAAK,KAQZ,CACD,CAAA,CACAG,GAAAA,EACCW,GAAAA,CAACkB,CAAAA,CAAA,CACC,KAAA,CAAO,CAAE,KAAA,CAAO/B,GAAAA,CAAc,KAAA,CAAOA,GAAAA,CAAc,GAAA,CAAK,IAAK,EAE7D,QAAA,CAAAM,IAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,2CACZ,QAAA,CAAA,CAAA,CAACL,CAAAA,EACAY,GAAAA,CAAC,MAAA,CAAA,CAAK,UAAU,qBAAA,CAAsB,QAAA,CAAA,SAAA,CAAO,CAAA,CAE/CA,GAAAA,CAAC,QAAK,SAAA,CAAU,wCAAA,CACb,QAAA,CAAAb,GAAAA,CACH,GACF,CAAA,CACF,CAAA,CAEFa,GAAAA,CAACmB,CAAAA,CAAA,CAAwB,GAAGlD,CAAAA,CAAgB,CAAA,CAAA,CAC9C,CAAA,CAAA,CACF,GACF,CAEJ","file":"chunk-YZCOEN5Y.js","sourcesContent":["import * as React from \"react\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\nimport { ComboboxInput as ComboboxInputPrimitive } from \"../primitives/combobox\"\r\nimport { Input } from \"../ui\"\r\nimport {\r\n Combobox,\r\n ComboboxChip,\r\n ComboboxChipRemove,\r\n ComboboxChips,\r\n ComboboxInfiniteScroll,\r\n ComboboxItem,\r\n ComboboxList,\r\n ComboboxPortal,\r\n ComboboxPopup,\r\n ComboboxStatus,\r\n ComboboxTrigger,\r\n ComboboxValue,\r\n type ComboboxProps\r\n} from \"../ui/combobox\"\r\nimport { SearchIcon, XIcon } from \"lucide-react\"\r\nimport { useControlledState } from \"@xploreu/hooks/use-controlled-state\"\r\n\r\ntype ComboboxChipOutsideProps<Value> = Omit<ComboboxProps<Value, true>, \"multiple\"> & {\r\n multiple?: boolean\r\n inputPlaceholder?: string\r\n container?: React.ComponentProps<typeof ComboboxPortal>[\"container\"]\r\n items: ({ label: string; value: string }[]) | undefined\r\n infiniteScroll?: React.ComponentProps<typeof ComboboxInfiniteScroll>\r\n isPending?: boolean\r\n /**\r\n * When true, enables creatable / taggable mode.\r\n * If the typed value has no exact match in the current item list,\r\n * a \"Create \\\"…\\\"\" option is shown at the top of the dropdown.\r\n * Created items are appended to the value with `{ label, value, tag: true }`.\r\n */\r\n taggable?: boolean\r\n /**\r\n * Maximum number of chips to show before collapsing the rest into a \"+N\" chip.\r\n * When undefined, all chips are shown.\r\n */\r\n maxVisible?: number\r\n}\r\n\r\nfunction ComboboxChipOutside<Value extends { label: string; value: string; tag?: true }>({\r\n multiple = true,\r\n inputPlaceholder = \"Search...\",\r\n container,\r\n items,\r\n infiniteScroll,\r\n isPending,\r\n taggable = false,\r\n maxVisible,\r\n ...props\r\n}: ComboboxChipOutsideProps<Value>) {\r\n const [inputValue, setInputValue] = useControlledState({\r\n value: props?.inputValue?.toString(),\r\n defaultValue: props?.defaultInputValue?.toString(),\r\n onChange: props?.onInputValueChange,\r\n })\r\n\r\n const [value, setValue] = useControlledState({\r\n value: props?.value ?? [],\r\n defaultValue: props?.defaultValue ?? [],\r\n onChange: props?.onValueChange,\r\n })\r\n\r\n // Track items created via taggable mode\r\n // Sync with value to avoid stale tags when controlled value is reset from outside\r\n const [createdItems, setCreatedItems] = React.useState<Value[]>([])\r\n const createdValuesRef = React.useRef<Set<string>>(new Set())\r\n\r\n React.useEffect(() => {\r\n const currentValues = new Set(value.map((v) => v.value))\r\n setCreatedItems((prev) => {\r\n const next = prev.filter((item) => currentValues.has(item.value))\r\n if (next.length === prev.length) return prev\r\n createdValuesRef.current = new Set(next.map((v) => v.value))\r\n return next\r\n })\r\n }, [value])\r\n\r\n // Determine if the current input has no exact match in existing items\r\n const trimmedInput = inputValue?.toString().trim() ?? \"\"\r\n const isInputSelected = React.useMemo(() => {\r\n if (!trimmedInput) return false\r\n return value.some(\r\n (item) => item.value.toLowerCase() === trimmedInput.toLowerCase()\r\n )\r\n }, [trimmedInput, value])\r\n // true = show the taggable item in dropdown (either as \"Create:\" or as checked item)\r\n const isCreatingItem = React.useMemo(() => {\r\n if (!taggable || !trimmedInput) return false\r\n return !items?.some(\r\n (item) => item.label.toLowerCase() === trimmedInput.toLowerCase()\r\n )\r\n }, [taggable, trimmedInput, items])\r\n\r\n // Merge server items with locally created tags + the \"Create\" placeholder\r\n const combinedItems = React.useMemo(() => {\r\n const base: Value[] = [\r\n ...items ?? [],\r\n ...createdItems,\r\n ]\r\n\r\n if (isCreatingItem) {\r\n const createItem = {\r\n label: trimmedInput,\r\n value: trimmedInput,\r\n tag: true,\r\n }\r\n return [...base, createItem]\r\n }\r\n\r\n return base\r\n }, [items, createdItems, isCreatingItem, trimmedInput])\r\n\r\n const handleValueChange: ComboboxProps<Value, true>[\"onValueChange\"] = (value, eventDetails) => {\r\n // Capture newly created taggable items internally\r\n if (taggable) {\r\n const newTags = value.filter(\r\n (v) => v?.tag === true\r\n && !createdValuesRef.current.has(v.value)\r\n )\r\n if (newTags.length > 0) {\r\n for (const tag of newTags) {\r\n createdValuesRef.current.add(tag.value)\r\n }\r\n setCreatedItems((prev) => [...prev, ...newTags])\r\n }\r\n }\r\n\r\n // if multiple is false, we need to replace the value with the new value instead of adding to it\r\n if (!multiple) {\r\n setValue([value[value.length - 1]], eventDetails)\r\n } else {\r\n setValue(value, eventDetails)\r\n }\r\n }\r\n\r\n return (\r\n <Combobox\r\n {...props}\r\n behavior=\"chip-outside\"\r\n multiple\r\n items={taggable ? combinedItems : items}\r\n isItemEqualToValue={(a, b) => a.value === b.value}\r\n onValueChange={handleValueChange}\r\n onInputValueChange={setInputValue}\r\n >\r\n <div className=\"flex flex-col gap-2\">\r\n <ComboboxInputPrimitive\r\n render={\r\n <Input\r\n className=\"h-9 text-body-regular-3 pl-9 pr-7\"\r\n endContent={\r\n <ComboboxTrigger\r\n nativeButton={false}\r\n render={(\r\n <XIcon\r\n className=\"!size-5 !right-1.5 data-[hidden=true]:opacity-0 opacity-100 transition-opacity duration-300 cursor-pointer\"\r\n data-hidden={!inputValue}\r\n data-slot=\"combobox-clear-input\"\r\n onClick={(event) => {\r\n setInputValue(\"\", {\r\n reason: \"none\",\r\n event: event.nativeEvent,\r\n cancel: () => { },\r\n allowPropagation: () => { },\r\n isCanceled: false,\r\n isPropagationAllowed: true,\r\n trigger: undefined,\r\n })\r\n }}\r\n />\r\n )}\r\n />\r\n }\r\n placeholder={inputPlaceholder}\r\n startContent={<SearchIcon className=\"!size-4 !text-fg-tertiary-hover\" />}\r\n wrapperClassName=\"w-full\"\r\n />\r\n }\r\n />\r\n <ComboboxChips\r\n className={cn(maxVisible !== undefined && \"flex-nowrap overflow-hidden\")}\r\n onMouseDown={(e) => e.preventBaseUIHandler()}\r\n >\r\n <ComboboxValue>\r\n {(value: Value[]) => {\r\n const visible = maxVisible !== undefined ? value.slice(0, maxVisible) : value\r\n const overflow = maxVisible !== undefined ? value.length - maxVisible : 0\r\n return (\r\n <>\r\n {visible?.map((item) => (\r\n <ComboboxChip\r\n key={item?.value || \"\"}\r\n className={cn(maxVisible !== undefined && \"min-w-0 shrink\")}\r\n >\r\n {maxVisible !== undefined\r\n ? <span className=\"truncate\">{item?.label || \"\"}</span>\r\n : (item?.label || \"\")\r\n }\r\n <ComboboxChipRemove />\r\n </ComboboxChip>\r\n ))}\r\n {overflow > 0 && (\r\n <ComboboxChip className=\"shrink-0\">\r\n +{overflow}\r\n </ComboboxChip>\r\n )}\r\n </>\r\n )\r\n }}\r\n </ComboboxValue>\r\n </ComboboxChips>\r\n </div>\r\n <ComboboxPopup container={container}>\r\n <ComboboxStatus\r\n status={\r\n isPending || items === undefined\r\n ? \"pending\"\r\n : items?.length === 0 && !isCreatingItem\r\n ? \"empty\"\r\n : null\r\n }\r\n />\r\n <ComboboxList>\r\n {items?.map((item) => (\r\n <ComboboxItem\r\n key={item.value}\r\n value={{ label: item.label, value: item.value }}\r\n >\r\n <div className=\"flex items-center gap-2 w-full min-w-0\">\r\n <span className=\"truncate\">\r\n {item.label}\r\n </span>\r\n </div>\r\n </ComboboxItem>\r\n ))}\r\n {isCreatingItem && (\r\n <ComboboxItem\r\n value={{ label: trimmedInput, value: trimmedInput, tag: true }}\r\n >\r\n <div className=\"flex items-center gap-1.5 w-full min-w-0\">\r\n {!isInputSelected && (\r\n <span className=\"text-text-secondary\">Create:</span>\r\n )}\r\n <span className=\"font-medium text-text-primary truncate\">\r\n {trimmedInput}\r\n </span>\r\n </div>\r\n </ComboboxItem>\r\n )}\r\n <ComboboxInfiniteScroll {...infiniteScroll} />\r\n </ComboboxList>\r\n </ComboboxPopup>\r\n </Combobox>\r\n )\r\n}\r\n\r\nexport { ComboboxChipOutside }"]}
|
|
1
|
+
{"version":3,"sources":["../src/composites/combobox-chip-outside.tsx"],"names":["ComboboxChipOutside","multiple","inputPlaceholder","container","items","infiniteScroll","isPending","taggable","maxVisible","props","inputValue","setInputValue","useControlledState","value","setValue","createdItems","setCreatedItems","createdValuesRef","currentValues","v","prev","next","item","trimmedInput","isInputSelected","isCreatingItem","combinedItems","base","createItem","jsxs","Combobox","a","b","eventDetails","newTags","tag","jsx","ComboboxInput","Input","ComboboxTrigger","XIcon","event","SearchIcon","ComboboxChips","cn","ComboboxValue","visible","overflow","Fragment","ComboboxChip","ComboboxChipRemove","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A,CAAC,MAAA,CAAA,CAAK,UAAU,qBAAA,CAAsB,QAAA,CAAA,SAAA,CAAO,CAAA,CAE/CA,GAAAA,CAAC,QAAK,SAAA,CAAU,wCAAA,CACb,QAAA,CAAAb,GAAAA,CACH,GACF,CAAA,CACF,CAAA,CAEFa,GAAAA,CAACmB,CAAAA,CAAA,CAAwB,GAAGlD,CAAAA,CAAgB,CAAA,CAAA,CAC9C,CAAA,CAAA,CACF,GACF,CAEJ","file":"chunk-7FRAZHPK.js","sourcesContent":["import * as React from \"react\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\nimport { ComboboxInput as ComboboxInputPrimitive } from \"../primitives/combobox\"\r\nimport { Input } from \"../ui\"\r\nimport {\r\n Combobox,\r\n ComboboxChip,\r\n ComboboxChipRemove,\r\n ComboboxChips,\r\n ComboboxInfiniteScroll,\r\n ComboboxItem,\r\n ComboboxList,\r\n ComboboxPortal,\r\n ComboboxPopup,\r\n ComboboxStatus,\r\n ComboboxTrigger,\r\n ComboboxValue,\r\n type ComboboxProps\r\n} from \"../ui/combobox\"\r\nimport { SearchIcon, XIcon } from \"lucide-react\"\r\nimport { useControlledState } from \"@xploreu/hooks/use-controlled-state\"\r\n\r\ntype ComboboxChipOutsideProps<Value> = Omit<ComboboxProps<Value, true>, \"multiple\"> & {\r\n multiple?: boolean\r\n inputPlaceholder?: string\r\n container?: React.ComponentProps<typeof ComboboxPortal>[\"container\"]\r\n items: ({ label: string; value: string }[]) | undefined\r\n infiniteScroll?: React.ComponentProps<typeof ComboboxInfiniteScroll>\r\n isPending?: boolean\r\n /**\r\n * When true, enables creatable / taggable mode.\r\n * If the typed value has no exact match in the current item list,\r\n * a \"Create \\\"…\\\"\" option is shown at the top of the dropdown.\r\n * Created items are appended to the value with `{ label, value, tag: true }`.\r\n */\r\n taggable?: boolean\r\n /**\r\n * Maximum number of chips to show before collapsing the rest into a \"+N\" chip.\r\n * When undefined, all chips are shown.\r\n */\r\n maxVisible?: number\r\n}\r\n\r\nfunction ComboboxChipOutside<Value extends { label: string; value: string; tag?: true }>({\r\n multiple = true,\r\n inputPlaceholder = \"Search...\",\r\n container,\r\n items,\r\n infiniteScroll,\r\n isPending,\r\n taggable = false,\r\n maxVisible,\r\n ...props\r\n}: ComboboxChipOutsideProps<Value>) {\r\n const [inputValue, setInputValue] = useControlledState({\r\n value: props?.inputValue?.toString(),\r\n defaultValue: props?.defaultInputValue?.toString(),\r\n onChange: props?.onInputValueChange,\r\n })\r\n\r\n const [value, setValue] = useControlledState({\r\n value: props?.value ?? [],\r\n defaultValue: props?.defaultValue ?? [],\r\n onChange: props?.onValueChange,\r\n })\r\n\r\n // Track items created via taggable mode\r\n // Sync with value to avoid stale tags when controlled value is reset from outside\r\n const [createdItems, setCreatedItems] = React.useState<Value[]>([])\r\n const createdValuesRef = React.useRef<Set<string>>(new Set())\r\n\r\n React.useEffect(() => {\r\n const currentValues = new Set(value.map((v) => v.value))\r\n setCreatedItems((prev) => {\r\n const next = prev.filter((item) => currentValues.has(item.value))\r\n if (next.length === prev.length) return prev\r\n createdValuesRef.current = new Set(next.map((v) => v.value))\r\n return next\r\n })\r\n }, [value])\r\n\r\n // Determine if the current input has no exact match in existing items\r\n const trimmedInput = inputValue?.toString().trim() ?? \"\"\r\n const isInputSelected = React.useMemo(() => {\r\n if (!trimmedInput) return false\r\n return value.some(\r\n (item) => item.value.toLowerCase() === trimmedInput.toLowerCase()\r\n )\r\n }, [trimmedInput, value])\r\n // true = show the taggable item in dropdown (either as \"Create:\" or as checked item)\r\n const isCreatingItem = React.useMemo(() => {\r\n if (!taggable || !trimmedInput) return false\r\n return !items?.some(\r\n (item) => item.label.toLowerCase() === trimmedInput.toLowerCase()\r\n )\r\n }, [taggable, trimmedInput, items])\r\n\r\n // Merge server items with locally created tags + the \"Create\" placeholder\r\n const combinedItems = React.useMemo(() => {\r\n const base: Value[] = [\r\n ...items ?? [],\r\n ...createdItems,\r\n ]\r\n\r\n if (isCreatingItem) {\r\n const createItem = {\r\n label: trimmedInput,\r\n value: trimmedInput,\r\n tag: true,\r\n }\r\n return [...base, createItem]\r\n }\r\n\r\n return base\r\n }, [items, createdItems, isCreatingItem, trimmedInput])\r\n\r\n const handleValueChange: ComboboxProps<Value, true>[\"onValueChange\"] = (value, eventDetails) => {\r\n // Capture newly created taggable items internally\r\n if (taggable) {\r\n const newTags = value.filter(\r\n (v) => v?.tag === true\r\n && !createdValuesRef.current.has(v.value)\r\n )\r\n if (newTags.length > 0) {\r\n for (const tag of newTags) {\r\n createdValuesRef.current.add(tag.value)\r\n }\r\n setCreatedItems((prev) => [...prev, ...newTags])\r\n }\r\n }\r\n\r\n // if multiple is false, we need to replace the value with the new value instead of adding to it\r\n if (!multiple) {\r\n setValue([value[value.length - 1]], eventDetails)\r\n } else {\r\n setValue(value, eventDetails)\r\n }\r\n }\r\n\r\n return (\r\n <Combobox\r\n {...props}\r\n behavior=\"chip-outside\"\r\n multiple\r\n items={taggable ? combinedItems : items}\r\n isItemEqualToValue={(a, b) => a.value === b.value}\r\n onValueChange={handleValueChange}\r\n onInputValueChange={setInputValue}\r\n >\r\n <div className=\"flex flex-col gap-2\">\r\n <ComboboxInputPrimitive\r\n render={\r\n <Input\r\n className=\"h-9 text-body-regular-3 pl-9 pr-7\"\r\n endContent={\r\n <ComboboxTrigger\r\n nativeButton={false}\r\n render={(\r\n <XIcon\r\n className=\"!size-5 !right-1.5 data-[hidden=true]:opacity-0 opacity-100 transition-opacity duration-300 cursor-pointer\"\r\n data-hidden={!inputValue}\r\n data-slot=\"combobox-clear-input\"\r\n onClick={(event) => {\r\n setInputValue(\"\", {\r\n reason: \"none\",\r\n event: event.nativeEvent,\r\n cancel: () => { },\r\n allowPropagation: () => { },\r\n isCanceled: false,\r\n isPropagationAllowed: true,\r\n trigger: undefined,\r\n })\r\n }}\r\n />\r\n )}\r\n />\r\n }\r\n placeholder={inputPlaceholder}\r\n startContent={<SearchIcon className=\"!size-4 !text-fg-tertiary-hover\" />}\r\n wrapperClassName=\"w-full\"\r\n />\r\n }\r\n />\r\n <ComboboxChips\r\n className={cn(maxVisible !== undefined && \"flex-nowrap overflow-hidden\")}\r\n onMouseDown={(e) => e.preventBaseUIHandler()}\r\n >\r\n <ComboboxValue>\r\n {(value: Value[]) => {\r\n const visible = maxVisible !== undefined ? value.slice(0, maxVisible) : value\r\n const overflow = maxVisible !== undefined ? value.length - maxVisible : 0\r\n return (\r\n <>\r\n {visible?.map((item) => (\r\n <ComboboxChip\r\n key={item?.value || \"\"}\r\n className={cn(maxVisible !== undefined && \"min-w-0 shrink\")}\r\n >\r\n {maxVisible !== undefined\r\n ? <span className=\"truncate\">{item?.label || \"\"}</span>\r\n : (item?.label || \"\")\r\n }\r\n <ComboboxChipRemove />\r\n </ComboboxChip>\r\n ))}\r\n {overflow > 0 && (\r\n <ComboboxChip className=\"shrink-0\">\r\n +{overflow}\r\n </ComboboxChip>\r\n )}\r\n </>\r\n )\r\n }}\r\n </ComboboxValue>\r\n </ComboboxChips>\r\n </div>\r\n <ComboboxPopup container={container}>\r\n <ComboboxStatus\r\n status={\r\n isPending || items === undefined\r\n ? \"pending\"\r\n : items?.length === 0 && !isCreatingItem\r\n ? \"empty\"\r\n : null\r\n }\r\n />\r\n <ComboboxList>\r\n {items?.map((item) => (\r\n <ComboboxItem\r\n key={item.value}\r\n value={{ label: item.label, value: item.value }}\r\n >\r\n <div className=\"flex items-center gap-2 w-full min-w-0\">\r\n <span className=\"truncate\">\r\n {item.label}\r\n </span>\r\n </div>\r\n </ComboboxItem>\r\n ))}\r\n {isCreatingItem && (\r\n <ComboboxItem\r\n value={{ label: trimmedInput, value: trimmedInput, tag: true }}\r\n >\r\n <div className=\"flex items-center gap-1.5 w-full min-w-0\">\r\n {!isInputSelected && (\r\n <span className=\"text-text-secondary\">Create:</span>\r\n )}\r\n <span className=\"font-medium text-text-primary truncate\">\r\n {trimmedInput}\r\n </span>\r\n </div>\r\n </ComboboxItem>\r\n )}\r\n <ComboboxInfiniteScroll {...infiniteScroll} />\r\n </ComboboxList>\r\n </ComboboxPopup>\r\n </Combobox>\r\n )\r\n}\r\n\r\nexport { ComboboxChipOutside }"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {b,c,g,d,f,h as h$1,i,j,k as k$1,e}from'./chunk-5YDJTHDG.js';import'react';import {XIcon}from'lucide-react';import {cn}from'@xploreu/lib/cn';import {jsx,jsxs}from'react/jsx-runtime';function C(o){return jsx(b,{...o})}function h(o){return jsx(c,{...o})}function k(o){return jsx(g,{...o})}function x({className:o,...i}){return jsx(e,{className:cn("fixed inset-0 z-50 bg-black/50 backdrop-blur-sm",o),...i})}function H({className:o,children:i,showCloseButton:c=true,closeClassName:y,...v}){return jsxs(d,{children:[jsx(x,{}),jsxs(f,{className:cn("fixed left-[50%] top-[50%] z-50 grid w-[calc(100%-2rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] border border-border-primary bg-bg-primary shadow-xp-lg rounded-xp-card-base overflow-hidden",o),...v,children:[i,c&&jsxs(g,{className:cn("data-[state=open]:bg-bg-primary data-[state=open]:text-text-primary absolute top-3 right-4 rounded-xs transition-colors hover:text-text-error-primary-hover disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",y),children:[jsx(XIcon,{}),jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function N({className:o,...i}){return jsx(h$1,{className:cn("relative px-4 py-3 flex flex-col bg-bg-primary border-b border-border-primary bg-radial-[100%_200%_at_0%_0%] from-modal-dialog-stop-0 to-bg-primary has-[[data-slot=dialog-icon]]:pl-16",o),...i})}function w({className:o,...i}){return jsx("div",{"data-slot":"dialog-content",className:cn("px-4 py-4 max-h-[60vh] overflow-y-auto",o),...i})}function B({className:o,...i$1}){return jsx(i,{className:cn("flex gap-2 items-center justify-end bg-bg-primary border-t border-border-primary px-4 py-3",o),...i$1})}function F({className:o,...i}){return jsx(j,{className:cn("text-label-bold-2 text-text-primary",o),...i})}function z({className:o,...i}){return jsx(k$1,{className:cn("mt-0.5 text-body-regular-3 text-text-secondary",o),...i})}function R({className:o,...i}){return jsx("div",{"data-slot":"dialog-icon",className:cn("absolute top-[13px] left-4 flex items-center justify-center rounded-lg bg-bg-primary p-2.5 [&_svg]:size-4 bg-bg-brand-solid text-fg-white shadow-[0px_1px_2px_-1px_var(--color-shadow-lg-01),0px_1px_3px_0px_var(--color-shadow-md-01),0px_0px_0px_4px_var(--color-focus-ring-secondary)]",o),...i})}export{C as a,h as b,k as c,H as d,N as e,w as f,B as g,F as h,z as i,R as j};//# sourceMappingURL=chunk-DSH6THYW.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-DSH6THYW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ui/dialog.tsx"],"names":["Dialog","props","jsx","DialogTrigger","DialogClose","DialogBackdrop","className","cn","DialogPopup","children","showCloseButton","closeClassName","jsxs","DialogPortal","XIcon","DialogHeader","DialogContent","DialogFooter","DialogTitle","DialogDescription","DialogIcon"],"mappings":"6LA4BA,SAASA,CAAAA,CAAOC,CAAAA,CAAoB,CAClC,OAAOC,GAAAA,CAACF,CAAAA,CAAA,CAAiB,GAAGC,CAAAA,CAAO,CACrC,CAIA,SAASE,CAAAA,CAAcF,EAA2B,CAChD,OAAOC,GAAAA,CAACC,CAAAA,CAAA,CAAwB,GAAGF,CAAAA,CAAO,CAC5C,CAIA,SAASG,CAAAA,CAAYH,CAAAA,CAAyB,CAC5C,OAAOC,GAAAA,CAACE,CAAAA,CAAA,CAAsB,GAAGH,CAAAA,CAAO,CAC1C,CAIA,SAASI,CAAAA,CAAe,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGL,CAAM,CAAA,CAAwB,CACpE,OACEC,GAAAA,CAACG,CAAAA,CAAA,CACC,SAAA,CAAWE,EAAAA,CAAG,iDAAA,CAAmDD,CAAS,CAAA,CACzE,GAAGL,CAAAA,CACN,CAEJ,CAOA,SAASO,CAAAA,CAAY,CACn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e,CAAAA,CAAA,CACC,SAAA,CAAWV,EAAAA,CACT,4FAAA,CACAD,CACF,CAAA,CACC,GAAGL,GAAAA,CACN,CAEJ,CAIA,SAASiB,CAAAA,CAAY,CAAE,SAAA,CAAAZ,CAAAA,CAAW,GAAGL,CAAM,CAAA,CAAqB,CAC9D,OACEC,GAAAA,CAACgB,CAAAA,CAAA,CACC,UAAWX,EAAAA,CAAG,qCAAA,CAAuCD,CAAS,CAAA,CAC7D,GAAGL,CAAAA,CACN,CAEJ,CAIA,SAASkB,CAAAA,CAAkB,CAAE,SAAA,CAAAb,CAAAA,CAAW,GAAGL,CAAM,CAAA,CAA2B,CAC1E,OACEC,GAAAA,CAACiB,GAAAA,CAAA,CACC,SAAA,CAAWZ,EAAAA,CAAG,gDAAA,CAAkDD,CAAS,CAAA,CACxE,GAAGL,CAAAA,CACN,CAEJ,CAEA,SAASmB,CAAAA,CAAW,CAAE,UAAAd,CAAAA,CAAW,GAAGL,CAAM,CAAA,CAAgC,CACxE,OACEC,GAAAA,CAAC,KAAA,CAAA,CACC,WAAA,CAAU,aAAA,CACV,SAAA,CAAWK,EAAAA,CAAG,2RAAA,CAA6RD,CAAS,CAAA,CACnT,GAAGL,EACN,CAEJ","file":"chunk-DSH6THYW.js","sourcesContent":["import * as React from 'react';\r\nimport { XIcon } from 'lucide-react';\r\n\r\nimport {\r\n Dialog as DialogPrimitive,\r\n DialogPopup as DialogPopupPrimitive,\r\n DialogDescription as DialogDescriptionPrimitive,\r\n DialogFooter as DialogFooterPrimitive,\r\n DialogHeader as DialogHeaderPrimitive,\r\n DialogTitle as DialogTitlePrimitive,\r\n DialogTrigger as DialogTriggerPrimitive,\r\n DialogPortal as DialogPortalPrimitive,\r\n DialogBackdrop as DialogBackdropPrimitive,\r\n DialogClose as DialogClosePrimitive,\r\n type DialogProps as DialogPrimitiveProps,\r\n type DialogPopupProps as DialogPopupPrimitiveProps,\r\n type DialogDescriptionProps as DialogDescriptionPrimitiveProps,\r\n type DialogFooterProps as DialogFooterPrimitiveProps,\r\n type DialogHeaderProps as DialogHeaderPrimitiveProps,\r\n type DialogTitleProps as DialogTitlePrimitiveProps,\r\n type DialogTriggerProps as DialogTriggerPrimitiveProps,\r\n type DialogBackdropProps as DialogBackdropPrimitiveProps,\r\n type DialogCloseProps as DialogClosePrimitiveProps,\r\n} from '../primitives/dialog';\r\nimport { cn } from '@xploreu/lib/cn';\r\n\r\ntype DialogProps = DialogPrimitiveProps;\r\n\r\nfunction Dialog(props: DialogProps) {\r\n return <DialogPrimitive {...props} />;\r\n}\r\n\r\ntype DialogTriggerProps = DialogTriggerPrimitiveProps;\r\n\r\nfunction DialogTrigger(props: DialogTriggerProps) {\r\n return <DialogTriggerPrimitive {...props} />;\r\n}\r\n\r\ntype DialogCloseProps = DialogClosePrimitiveProps;\r\n\r\nfunction DialogClose(props: DialogCloseProps) {\r\n return <DialogClosePrimitive {...props} />;\r\n}\r\n\r\ntype DialogBackdropProps = DialogBackdropPrimitiveProps;\r\n\r\nfunction DialogBackdrop({ className, ...props }: DialogBackdropProps) {\r\n return (\r\n <DialogBackdropPrimitive\r\n className={cn('fixed inset-0 z-50 bg-black/50 backdrop-blur-sm', className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype DialogPopupProps = DialogPopupPrimitiveProps & {\r\n showCloseButton?: boolean;\r\n closeClassName?: string;\r\n};\r\n\r\nfunction DialogPopup({\r\n className,\r\n children,\r\n showCloseButton = true,\r\n closeClassName,\r\n ...props\r\n}: DialogPopupProps) {\r\n return (\r\n <DialogPortalPrimitive>\r\n <DialogBackdrop />\r\n <DialogPopupPrimitive\r\n className={cn(\r\n \"fixed left-[50%] top-[50%] z-50 grid w-[calc(100%-2rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] border border-border-primary bg-bg-primary shadow-xp-lg rounded-xp-card-base overflow-hidden\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n {showCloseButton && (\r\n <DialogClosePrimitive\r\n className={cn(\r\n \"data-[state=open]:bg-bg-primary data-[state=open]:text-text-primary absolute top-3 right-4 rounded-xs transition-colors hover:text-text-error-primary-hover disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\r\n closeClassName\r\n )}\r\n >\r\n <XIcon />\r\n <span className=\"sr-only\">Close</span>\r\n </DialogClosePrimitive>\r\n )}\r\n </DialogPopupPrimitive>\r\n </DialogPortalPrimitive>\r\n );\r\n}\r\n\r\ntype DialogHeaderProps = DialogHeaderPrimitiveProps;\r\n\r\nfunction DialogHeader({ className, ...props }: DialogHeaderProps) {\r\n return (\r\n <DialogHeaderPrimitive\r\n className={cn(\"relative px-4 py-3 flex flex-col bg-bg-primary border-b border-border-primary bg-radial-[100%_200%_at_0%_0%] from-modal-dialog-stop-0 to-bg-primary has-[[data-slot=dialog-icon]]:pl-16\", className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype DialogContentProps = React.HTMLAttributes<HTMLDivElement>;\r\n\r\nfunction DialogContent({ className, ...props }: DialogContentProps) {\r\n return (\r\n <div\r\n data-slot=\"dialog-content\"\r\n className={cn(\"px-4 py-4 max-h-[60vh] overflow-y-auto\", className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype DialogFooterProps = DialogFooterPrimitiveProps;\r\n\r\nfunction DialogFooter({ className, ...props }: DialogFooterProps) {\r\n return (\r\n <DialogFooterPrimitive\r\n className={cn(\r\n \"flex gap-2 items-center justify-end bg-bg-primary border-t border-border-primary px-4 py-3\",\r\n className\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype DialogTitleProps = DialogTitlePrimitiveProps;\r\n\r\nfunction DialogTitle({ className, ...props }: DialogTitleProps) {\r\n return (\r\n <DialogTitlePrimitive\r\n className={cn(\"text-label-bold-2 text-text-primary\", className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype DialogDescriptionProps = DialogDescriptionPrimitiveProps;\r\n\r\nfunction DialogDescription({ className, ...props }: DialogDescriptionProps) {\r\n return (\r\n <DialogDescriptionPrimitive\r\n className={cn(\"mt-0.5 text-body-regular-3 text-text-secondary\", className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nfunction DialogIcon({ className, ...props }: React.ComponentProps<\"div\">) {\r\n return (\r\n <div\r\n data-slot=\"dialog-icon\"\r\n className={cn(\"absolute top-[13px] left-4 flex items-center justify-center rounded-lg bg-bg-primary p-2.5 [&_svg]:size-4 bg-bg-brand-solid text-fg-white shadow-[0px_1px_2px_-1px_var(--color-shadow-lg-01),0px_1px_3px_0px_var(--color-shadow-md-01),0px_0px_0px_4px_var(--color-focus-ring-secondary)]\", className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nexport {\r\n Dialog,\r\n DialogTrigger,\r\n DialogClose,\r\n DialogPopup,\r\n DialogHeader,\r\n DialogContent,\r\n DialogFooter,\r\n DialogTitle,\r\n DialogDescription,\r\n DialogIcon,\r\n type DialogProps,\r\n type DialogTriggerProps,\r\n type DialogCloseProps,\r\n type DialogPopupProps,\r\n type DialogHeaderProps,\r\n type DialogContentProps,\r\n type DialogFooterProps,\r\n type DialogTitleProps,\r\n type DialogDescriptionProps,\r\n};"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {b as b$2,c as c$2}from'./chunk-KYD4ATTG.js';import {b as b$1,c as c$1}from'./chunk-DZKJRP4J.js';import {a}from'./chunk-TED2PUK6.js';import
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import {b}from'./chunk-HUWF445V.js';import {b as b$2,c as c$2}from'./chunk-KYD4ATTG.js';import {b as b$1,c as c$1}from'./chunk-DZKJRP4J.js';import {a}from'./chunk-TED2PUK6.js';import*as S from'react';import {SearchIcon,XIcon,Loader2Icon,CheckCircle2Icon}from'lucide-react';import {Combobox}from'@base-ui/react/combobox';import {AnimatePresence,motion}from'motion/react';import {useControlledState}from'@xploreu/hooks/use-controlled-state';import {useDataState}from'@xploreu/hooks/use-data-state';import {getStrictContext}from'@xploreu/lib/get-strict-context';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {cn}from'@xploreu/lib/cn';var[ao,c]=getStrictContext("ComboboxContext"),[no,H]=getStrictContext("ComboboxActiveValueContext");function R({behavior:o="default",...t}){let[b,m]=useControlledState({value:t?.open,defaultValue:t?.defaultOpen,onChange:t?.onOpenChange}),[s,C]=useControlledState({value:t?.inputValue?.toString(),defaultValue:t?.defaultInputValue?.toString(),onChange:t?.onInputValueChange}),[n,l]=S.useState(null),P=(x,a)=>{if(a.reason==="input-clear")return a.cancel();C(x,a);},y=(x,a)=>{let io=a.trigger?.dataset;if(o==="chip-outside"&&(a.reason==="trigger-press"&&io?.slot==="combobox-clear-input"&&!x||a.reason==="item-press"))return a.cancel();m(x,a);};return jsx(no,{value:{highlightedValue:n,setHighlightedValue:l},children:jsx(ao,{value:{open:b,setOpen:m,inputValue:s,setInputValue:C},children:jsx(Combobox.Root,{"data-slot":"combobox",...t,onInputValueChange:P,onOpenChange:y})})})}function T(o){return jsx(Combobox.Trigger,{"data-slot":"combobox-trigger",...o})}function k(o){return jsx(Combobox.Label,{"data-slot":"combobox-label",...o})}function A(o){return jsx(Combobox.InputGroup,{"data-slot":"combobox-input-group",...o})}function d(o){return jsx(Combobox.Input,{"data-slot":"combobox-input",...o})}function M(o){return jsx(Combobox.Icon,{"data-slot":"combobox-icon",...o})}function B(o){return jsx(Combobox.Clear,{"data-slot":"combobox-clear",...o})}function E(o){return jsx(Combobox.Value,{"data-slot":"combobox-value",...o})}function O(o){return jsx(Combobox.Chips,{"data-slot":"combobox-chips",...o})}function z(o){return jsx(Combobox.Chip,{"data-slot":"combobox-chip",...o})}function F(o){return jsx(Combobox.ChipRemove,{"data-slot":"combobox-chip-remove",...o})}function h(o){let{open:t}=c();return jsx(AnimatePresence,{children:t&&jsx(Combobox.Portal,{"data-slot":"combobox-portal",keepMounted:true,...o})})}function v(o){return jsx(Combobox.Positioner,{"data-slot":"combobox-positioner",...o})}function q({initialFocus:o,finalFocus:t,transition:b={type:"spring",stiffness:300,damping:25},...m}){return jsx(Combobox.Popup,{finalFocus:t,initialFocus:o,render:jsx(motion.div,{animate:{opacity:1,scale:1},"data-slot":"combobox-popup",exit:{opacity:0,scale:.5},initial:{opacity:0,scale:.5},transition:b,...m},"combobox-popup")})}function U(o){return jsx(Combobox.Backdrop,{"data-slot":"combobox-backdrop",...o})}function X(o){return jsx(Combobox.Status,{"data-slot":"combobox-status",...o})}function $(o){return jsx(Combobox.Empty,{"data-slot":"combobox-empty",...o})}function J(o){return jsx(Combobox.List,{"data-slot":"combobox-list",...o})}function K({transition:o={type:"spring",stiffness:350,damping:35},...t}){let{highlightedValue:b}=H();return jsx(b$2,{click:false,controlledItems:true,"data-slot":"combobox-highlight",transition:o,value:b,...t})}function Q(o){return jsx(c$2,{"data-slot":"combobox-highlight-item",...o})}function W(o){return jsx(Combobox.Row,{"data-slot":"combobox-row",...o})}function Y(o){let{setHighlightedValue:t}=H(),[,b]=useDataState("highlighted",void 0,(m,s)=>{if(m===true){let C=s.current,n=C?.dataset.value||C?.id||null;n&&t(n);}});return jsx(Combobox.Item,{ref:b,"data-slot":"combobox-item",...o})}function Z(o){return jsx(Combobox.ItemIndicator,{"data-slot":"combobox-item-indicator",...o})}function _(o){return jsx(Combobox.Separator,{"data-slot":"combobox-separator",...o})}function j(o){return jsx(Combobox.Group,{"data-slot":"combobox-group",...o})}function D(o){return jsx(Combobox.GroupLabel,{"data-slot":"combobox-group-label",...o})}function oo(o){return jsx(Combobox.Collection,{"data-slot":"combobox-collection",...o})}function to(o){return jsx(Combobox.Arrow,{"data-slot":"combobox-arrow",...o})}function Oo(o){return jsx(R,{...o})}function xo(o){let{className:t,...b}=o;return jsx(T,{className:cn("group/combobox-trigger flex items-center gap-2",t),...b})}function zo(o){let{className:t,...b}=o;return jsx(k,{className:cn("text-label-semibold-2 text-text-secondary",t),...b})}function Fo(o){let{className:t,...b}=o;return jsx(A,{className:cn("flex w-full items-center gap-2",t),...b})}function qo({className:o,wrapperClassName:t,...b$1}){return jsx("div",{className:cn("px-3 py-2.5 border-b border-border-primary",t),children:jsx(d,{className:o,render:jsx(b,{size:"sm",startContent:jsx(SearchIcon,{})}),...b$1})})}function Uo({className:o,displayValueKey:t={label:"label",value:"value"},placeholder:b$1="Search and Select Company",inputProps:m,...s}){let{inputValue:C,setInputValue:n}=c(),{className:l,startContent:P,...y}=m||{};return jsx("div",{className:cn("flex flex-col gap-2",o),children:jsxs(Po,{onMouseDown:x=>x.preventBaseUIHandler(),className:"flex-col",children:[jsx(d,{render:jsx(b,{className:cn("h-9 text-body-regular-3 pl-9 pr-7",l),endContent:jsx(xo,{nativeButton:false,render:jsx(XIcon,{className:"!size-5 !right-1.5 data-[hidden=true]:opacity-0 opacity-100 transition-opacity duration-300 cursor-pointer","data-hidden":!C,"data-slot":"combobox-clear-input",onClick:x=>{n("",{reason:"none",event:x.nativeEvent,cancel:()=>{},allowPropagation:()=>{},isCanceled:false,isPropagationAllowed:true,trigger:void 0});}})}),placeholder:b$1,startContent:P??jsx(SearchIcon,{className:"!size-4 !text-fg-tertiary-hover"}),...y}),...s}),jsx(lo,{children:x=>x?.map(a=>jsxs(uo,{children:[a?.[t.label]||"",jsx(co,{})]},a?.[t.value]||""))})]})})}function Xo(o){let{className:t,...b}=o;return jsx(M,{className:cn("text-text-secondary",t),...b})}function $o(o){return jsx(B,{render:jsx(XIcon,{}),...o})}function lo(o){return jsx(E,{...o})}function Po({className:o,...t}){return jsx(O,{className:cn("flex flex-wrap gap-2",o),...t})}function uo({className:o,...t}){return jsx(b$1,{className:cn("ring-1 ring-border-brand text-body-medium-3",o),color:"brand",render:jsx(z,{...t}),size:"lg"})}function co({className:o,...t}){return jsx(c$1,{className:cn("text-fg-quaternary",o),render:jsx(F,{...t})})}function Jo({className:o,align:t="start",sideOffset:b=4,container:m,initialFocus:s,finalFocus:C,style:n,children:l,...P}){return jsx(h,{container:m,children:jsx(v,{align:t,className:"isolate z-50",sideOffset:b,...P,children:jsx(q,{className:cn("group/combobox-popup bg-bg-primary text-text-primary max-h-(--available-height) w-72 max-w-(--available-width) origin-(--transform-origin) rounded-md border border-border-primary shadow-md outline-hidden",o),finalFocus:C,initialFocus:s,style:n,children:jsx(yo,{children:l})})})})}function Ko(o){return jsx(h,{...o})}function Qo(o){return jsx(v,{...o})}function Wo(o){let{className:t,...b}=o;return jsx(U,{className:cn("bg-black/30",t),...b})}function Yo({className:o,status:t,...b}){let{inputValue:m}=c(),s=m?.toString().trim(),n=t==="empty"&&s?`No matches for "${s}".`:t==="empty"&&!s?"No results.":t==="pending"?jsxs(Fragment,{children:[jsx(Loader2Icon,{className:"animate-spin size-4"}),jsx("span",{children:"Searching..."})]}):null;return jsx(X,{className:cn("px-2 py-2.5 text-body-regular-2 text-text-disabled flex items-center gap-2",!n&&"hidden",o),...b,children:n})}function Zo({className:o,...t}){return jsx($,{className:cn("px-3 py-2 text-body-regular-2 text-text-secondary",o),...t})}function _o({className:o,...t}){return jsx(J,{className:cn("max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] overflow-auto scrollbar-thin flex flex-col py-1 focus-visible:outline-none",o),...t})}function yo(o){let{className:t,...b}=o;return jsx(K,{className:cn("absolute inset-0 bg-bg-primary-hover",t),...b})}function go(o){return jsx(Q,{...o})}function jo(o){let{className:t,...b}=o;return jsx(W,{className:cn("group/combobox-row",t),...b})}function Do({className:o,children:t,withIndicator:b=true,...m}){let{disabled:s}=m;return jsx(go,{activeClassName:"bg-bg-primary-hover",disabled:s,children:jsxs(Y,{className:cn("flex w-full cursor-default items-center gap-xp-md px-3 py-2.5 text-body-medium-2 text-text-primary outline-none",o),...m,children:[t,b&&jsx(ho,{children:jsx(CheckCircle2Icon,{className:"size-5 text-fg-brand-primary shrink-0"})})]})})}function ho(o){return jsx(Z,{...o})}function ot(o){let{className:t,...b}=o;return jsx(_,{className:cn("my-1 h-px bg-border-primary",t),...b})}function tt(o){let{className:t,...b}=o;return jsx(j,{className:cn("py-1",t),...b})}function et(o){let{className:t,...b}=o;return jsx(D,{className:cn("px-3 py-1 text-body-semibold-sm text-text-secondary",t),...b})}function bt(o){return jsx(oo,{...o})}function rt(o){let{className:t,...b}=o;return jsx(to,{className:cn("fill-bg-primary",t),...b})}function it({hasMore:o,threshold:t=.5,...b}){return jsx(a,{hasMore:o,threshold:t,...b,children:o&&jsxs("div",{className:"px-2 py-2.5 text-body-regular-2 text-text-disabled flex items-center gap-2",children:[jsx(Loader2Icon,{className:"animate-spin size-4"}),jsx("span",{children:"Loading more..."})]})})}export{ho as A,ot as B,tt as C,et as D,bt as E,rt as F,it as G,A as a,d as b,Z as c,Oo as d,xo as e,zo as f,Fo as g,qo as h,Uo as i,Xo as j,$o as k,lo as l,Po as m,uo as n,co as o,Jo as p,Ko as q,Qo as r,Wo as s,Yo as t,Zo as u,_o as v,yo as w,go as x,jo as y,Do as z};//# sourceMappingURL=chunk-ISGXRZLJ.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-ISGXRZLJ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/primitives/combobox.tsx","../src/ui/combobox.tsx"],"names":["ComboboxProvider","useCombobox","getStrictContext","ComboboxActiveValueProvider","useComboboxActiveValue","Combobox","behavior","props","open","setOpen","useControlledState","inputValue","setInputValue","highlightedValue","setHighlightedValue","handleInputValueChange","eventDetails","handleOpenChange","dataSet","jsx","ComboboxPrimitive","ComboboxTrigger","ComboboxLabel","ComboboxInputGroup","ComboboxInput","ComboboxIcon","ComboboxClear","ComboboxValue","ComboboxChips","ComboboxChip","ComboboxChipRemove","ComboboxPortal","AnimatePresence","ComboboxPositioner","ComboboxPopup","initialFocus","finalFocus","transition","motion","ComboboxBackdrop","ComboboxStatus","ComboboxEmpty","ComboboxList","ComboboxHighlight","Highlight","ComboboxHighlightItem","HighlightItem","ComboboxRow","ComboboxItem","highlightedRef","useDataState","value","ref","el","v","ComboboxItemIndicator","ComboboxSeparator","ComboboxGroup","ComboboxGroupLabel","ComboboxCollection","ComboboxArrow","className","rest","cn","wrapperClassName","Input","SearchIcon","ComboboxInputFilter","displayValueKey","placeholder","inputProps","inputClassName","startContent","restInputProps","jsxs","e","XIcon","event","item","Badge","BadgeButton","align","sideOffset","container","style","children","status","trimmedInputValue","text","Fragment","Loader2Icon","withIndicator","disabled","CheckCircle2Icon","ComboboxInfiniteScroll","hasMore","threshold","InfiniteScroll"],"mappings":"koBAiCA,GAAM,CAACA,EAAAA,CAAkBC,CAAW,CAAA,CAClCC,iBAA+C,iBAAiB,CAAA,CAE5D,CAACC,EAAAA,CAA6BC,CAAsB,CAAA,CACxDF,iBAAiD,4BAA4B,CAAA,CAM/E,SAASG,CAAAA,CAA8D,CACrE,SAAAC,CAAAA,CAAW,SAAA,CACX,GAAGC,CACL,CAAA,CAAmC,CACjC,GAAM,CAACC,CAAAA,CAAMC,CAAO,CAAA,CAAIC,kBAAAA,CAAmB,CACzC,KAAA,CAAOH,CAAAA,EAAO,IAAA,CACd,YAAA,CAAcA,CAAAA,EAAO,WAAA,CACrB,SAAUA,CAAAA,EAAO,YACnB,CAAC,CAAA,CAEK,CAACI,EAAYC,CAAa,CAAA,CAAIF,kBAAAA,CAAmB,CACrD,KAAA,CAAOH,CAAAA,EAAO,YAAY,QAAA,EAAS,CACnC,YAAA,CAAcA,CAAAA,EAAO,iBAAA,EAAmB,QAAA,GACxC,QAAA,CAAUA,CAAAA,EAAO,kBACnB,CAAC,CAAA,CAEK,CAACM,EAAkBC,CAAmB,CAAA,CAAU,WAAwB,IAAI,CAAA,CAE5EC,EAA+E,CAACJ,CAAAA,CAAYK,CAAAA,GAAiB,CAEjH,GAAIA,CAAAA,CAAa,SAAW,aAAA,CAAe,OAAOA,EAAa,MAAA,EAAO,CAEtEJ,EAAcD,CAAAA,CAAYK,CAAY,EACxC,CAAA,CAEMC,CAAAA,CAAmE,CAACT,EAAMQ,CAAAA,GAAiB,CAC/F,IAAME,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CACN,CACF,CAEA,SAASgC,GAAuB,CAC9B,OAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CAAY,EAAA,CACZ,GAAGzF,CACL,CAAA,CAAkE,CAChE,OACEY,GAAAA,CAAC8E,CAAAA,CAAA,CACC,OAAA,CAASF,CAAAA,CACT,UAAWC,CAAAA,CACV,GAAGzF,EAEH,QAAA,CAAAwF,CAAAA,EACCrB,IAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,4EAAA,CACb,UAAAvD,GAAAA,CAACuE,WAAAA,CAAA,CAAY,SAAA,CAAU,qBAAA,CAAsB,CAAA,CAC7CvE,IAAC,MAAA,CAAA,CAAK,QAAA,CAAA,iBAAA,CAEN,CAAA,CAAA,CACF,CAAA,CAEJ,CAEJ","file":"chunk-BT5SLUEA.js","sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\n\r\nimport { Combobox as ComboboxPrimitive } from \"@base-ui/react/combobox\"\r\nimport {\r\n AnimatePresence,\r\n type HTMLMotionProps,\r\n motion\r\n} from \"motion/react\"\r\n\r\nimport {\r\n Highlight,\r\n HighlightItem,\r\n type HighlightItemProps,\r\n type HighlightProps,\r\n} from \"../effects/highlight\"\r\nimport { useControlledState } from \"@xploreu/hooks/use-controlled-state\"\r\nimport { useDataState } from \"@xploreu/hooks/use-data-state\"\r\nimport { getStrictContext } from \"@xploreu/lib/get-strict-context\"\r\n\r\ntype ComboboxContextType<Value, Multiple extends boolean | undefined = false> = {\r\n open: ComboboxProps<Value, Multiple>[\"open\"];\r\n setOpen: NonNullable<ComboboxProps<Value, Multiple>[\"onOpenChange\"]>;\r\n inputValue: ComboboxProps<Value, Multiple>[\"inputValue\"];\r\n setInputValue: NonNullable<ComboboxProps<Value, Multiple>[\"onInputValueChange\"]>;\r\n}\r\n\r\ntype ComboboxActiveValueContextType = {\r\n highlightedValue: string | null;\r\n setHighlightedValue: (value: string | null) => void;\r\n}\r\n\r\nconst [ComboboxProvider, useCombobox] =\r\n getStrictContext<ComboboxContextType<unknown>>(\"ComboboxContext\")\r\n\r\nconst [ComboboxActiveValueProvider, useComboboxActiveValue] =\r\n getStrictContext<ComboboxActiveValueContextType>(\"ComboboxActiveValueContext\")\r\n\r\ntype ComboboxProps<Value, Multiple extends boolean | undefined = false> = ComboboxPrimitive.Root.Props<Value, Multiple> & {\r\n behavior?: \"default\" | \"chip-outside\";\r\n}\r\n\r\nfunction Combobox<Value, Multiple extends boolean | undefined = false>({\r\n behavior = \"default\",\r\n ...props\r\n}: ComboboxProps<Value, Multiple>) {\r\n const [open, setOpen] = useControlledState({\r\n value: props?.open,\r\n defaultValue: props?.defaultOpen,\r\n onChange: props?.onOpenChange,\r\n })\r\n\r\n const [inputValue, setInputValue] = useControlledState({\r\n value: props?.inputValue?.toString(),\r\n defaultValue: props?.defaultInputValue?.toString(),\r\n onChange: props?.onInputValueChange,\r\n })\r\n\r\n const [highlightedValue, setHighlightedValue] = React.useState<string | null>(null)\r\n\r\n const handleInputValueChange: ComboboxProps<Value, Multiple>[\"onInputValueChange\"] = (inputValue, eventDetails) => {\r\n // if the input is cleared, we want to cancel the event to prevent resetting the input value.\r\n if (eventDetails.reason === \"input-clear\") return eventDetails.cancel()\r\n\r\n setInputValue(inputValue, eventDetails)\r\n }\r\n\r\n const handleOpenChange: ComboboxProps<Value, Multiple>[\"onOpenChange\"] = (open, eventDetails) => {\r\n const dataSet = (eventDetails.trigger as HTMLElement)?.dataset\r\n\r\n\r\n if (behavior === \"chip-outside\") {\r\n if (\r\n eventDetails.reason === \"trigger-press\" &&\r\n dataSet?.slot === \"combobox-clear-input\" &&\r\n !open\r\n ) {\r\n return eventDetails.cancel()\r\n }\r\n\r\n if (eventDetails.reason === \"item-press\") {\r\n return eventDetails.cancel()\r\n }\r\n }\r\n\r\n setOpen(open, eventDetails)\r\n }\r\n\r\n return (\r\n <ComboboxActiveValueProvider value={{ highlightedValue, setHighlightedValue }}>\r\n <ComboboxProvider value={{ open, setOpen, inputValue, setInputValue }}>\r\n <ComboboxPrimitive.Root\r\n data-slot=\"combobox\"\r\n {...props}\r\n onInputValueChange={handleInputValueChange}\r\n onOpenChange={handleOpenChange}\r\n />\r\n </ComboboxProvider>\r\n </ComboboxActiveValueProvider>\r\n )\r\n}\r\n\r\ntype ComboboxTriggerProps = ComboboxPrimitive.Trigger.Props\r\n\r\nfunction ComboboxTrigger(props: ComboboxTriggerProps) {\r\n return <ComboboxPrimitive.Trigger\r\n data-slot=\"combobox-trigger\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxLabelProps = ComboboxPrimitive.Label.Props\r\n\r\nfunction ComboboxLabel(props: ComboboxLabelProps) {\r\n return <ComboboxPrimitive.Label\r\n data-slot=\"combobox-label\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxInputGroupProps = ComboboxPrimitive.InputGroup.Props\r\n\r\nfunction ComboboxInputGroup(props: ComboboxInputGroupProps) {\r\n return <ComboboxPrimitive.InputGroup\r\n data-slot=\"combobox-input-group\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxInputProps = ComboboxPrimitive.Input.Props\r\n\r\nfunction ComboboxInput(props: ComboboxInputProps) {\r\n return <ComboboxPrimitive.Input\r\n data-slot=\"combobox-input\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxIconProps = ComboboxPrimitive.Icon.Props\r\n\r\nfunction ComboboxIcon(props: ComboboxIconProps) {\r\n return <ComboboxPrimitive.Icon\r\n data-slot=\"combobox-icon\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxClearProps = ComboboxPrimitive.Clear.Props\r\n\r\nfunction ComboboxClear(props: ComboboxClearProps) {\r\n return <ComboboxPrimitive.Clear\r\n data-slot=\"combobox-clear\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxValueProps = ComboboxPrimitive.Value.Props\r\n\r\nfunction ComboboxValue(props: ComboboxValueProps) {\r\n return <ComboboxPrimitive.Value\r\n data-slot=\"combobox-value\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxChipsProps = ComboboxPrimitive.Chips.Props\r\n\r\nfunction ComboboxChips(props: ComboboxChipsProps) {\r\n return <ComboboxPrimitive.Chips\r\n data-slot=\"combobox-chips\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxChipProps = ComboboxPrimitive.Chip.Props\r\n\r\nfunction ComboboxChip(props: ComboboxChipProps) {\r\n return <ComboboxPrimitive.Chip\r\n data-slot=\"combobox-chip\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxChipRemoveProps = ComboboxPrimitive.ChipRemove.Props\r\n\r\nfunction ComboboxChipRemove(props: ComboboxChipRemoveProps) {\r\n return <ComboboxPrimitive.ChipRemove\r\n data-slot=\"combobox-chip-remove\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxPortalProps = Omit<\r\n ComboboxPrimitive.Portal.Props,\r\n \"keepMounted\"\r\n>\r\n\r\nfunction ComboboxPortal(props: ComboboxPortalProps) {\r\n const { open } = useCombobox()\r\n\r\n return (\r\n <AnimatePresence>\r\n {open && (\r\n <ComboboxPrimitive.Portal\r\n data-slot=\"combobox-portal\"\r\n keepMounted\r\n {...props}\r\n />\r\n )}\r\n </AnimatePresence>\r\n )\r\n}\r\n\r\ntype ComboboxPositionerProps = ComboboxPrimitive.Positioner.Props\r\n\r\nfunction ComboboxPositioner(props: ComboboxPositionerProps) {\r\n return (\r\n <ComboboxPrimitive.Positioner\r\n data-slot=\"combobox-positioner\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxPopupProps = Omit<\r\n ComboboxPrimitive.Popup.Props,\r\n \"render\"\r\n> &\r\n HTMLMotionProps<\"div\">\r\n\r\nfunction ComboboxPopup({\r\n initialFocus,\r\n finalFocus,\r\n transition = { type: \"spring\", stiffness: 300, damping: 25 },\r\n ...props\r\n}: ComboboxPopupProps) {\r\n return (\r\n <ComboboxPrimitive.Popup\r\n finalFocus={finalFocus}\r\n initialFocus={initialFocus}\r\n render={\r\n <motion.div\r\n key=\"combobox-popup\"\r\n animate={{ opacity: 1, scale: 1 }}\r\n data-slot=\"combobox-popup\"\r\n exit={{ opacity: 0, scale: 0.5 }}\r\n initial={{ opacity: 0, scale: 0.5 }}\r\n transition={transition}\r\n {...props}\r\n />\r\n }\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxBackdropProps = ComboboxPrimitive.Backdrop.Props\r\n\r\nfunction ComboboxBackdrop(props: ComboboxBackdropProps) {\r\n return <ComboboxPrimitive.Backdrop\r\n data-slot=\"combobox-backdrop\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxStatusProps = ComboboxPrimitive.Status.Props\r\n\r\nfunction ComboboxStatus(props: ComboboxStatusProps) {\r\n return <ComboboxPrimitive.Status\r\n data-slot=\"combobox-status\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxEmptyProps = ComboboxPrimitive.Empty.Props\r\n\r\nfunction ComboboxEmpty(props: ComboboxEmptyProps) {\r\n return <ComboboxPrimitive.Empty\r\n data-slot=\"combobox-empty\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxListProps = ComboboxPrimitive.List.Props\r\n\r\nfunction ComboboxList(props: ComboboxListProps) {\r\n return <ComboboxPrimitive.List\r\n data-slot=\"combobox-list\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxHighlightProps = Omit<\r\n HighlightProps,\r\n \"controlledItems\" | \"enabled\" | \"hover\"\r\n>\r\n\r\nfunction ComboboxHighlight({\r\n transition = { type: \"spring\", stiffness: 350, damping: 35 },\r\n ...props\r\n}: ComboboxHighlightProps) {\r\n const { highlightedValue } = useComboboxActiveValue()\r\n\r\n return (\r\n <Highlight\r\n click={false}\r\n controlledItems\r\n data-slot=\"combobox-highlight\"\r\n transition={transition}\r\n value={highlightedValue}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxHighlightItemProps = HighlightItemProps\r\n\r\nfunction ComboboxHighlightItem(props: ComboboxHighlightItemProps) {\r\n return (\r\n <HighlightItem\r\n data-slot=\"combobox-highlight-item\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxRowProps = ComboboxPrimitive.Row.Props\r\n\r\nfunction ComboboxRow(props: ComboboxRowProps) {\r\n return <ComboboxPrimitive.Row\r\n data-slot=\"combobox-row\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxItemProps = ComboboxPrimitive.Item.Props\r\n\r\nfunction ComboboxItem(props: ComboboxItemProps) {\r\n const { setHighlightedValue } = useComboboxActiveValue()\r\n const [, highlightedRef] = useDataState<HTMLDivElement>(\r\n \"highlighted\",\r\n undefined,\r\n (value, ref) => {\r\n if (value === true) {\r\n const el = ref.current\r\n const v = el?.dataset.value || el?.id || null\r\n if (v) setHighlightedValue(v)\r\n }\r\n },\r\n )\r\n\r\n return <ComboboxPrimitive.Item\r\n ref={highlightedRef}\r\n data-slot=\"combobox-item\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxItemIndicatorProps = ComboboxPrimitive.ItemIndicator.Props\r\n\r\nfunction ComboboxItemIndicator(props: ComboboxItemIndicatorProps) {\r\n return <ComboboxPrimitive.ItemIndicator\r\n data-slot=\"combobox-item-indicator\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxSeparatorProps = ComboboxPrimitive.Separator.Props\r\n\r\nfunction ComboboxSeparator(props: ComboboxSeparatorProps) {\r\n return <ComboboxPrimitive.Separator\r\n data-slot=\"combobox-separator\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxGroupProps = ComboboxPrimitive.Group.Props\r\n\r\nfunction ComboboxGroup(props: ComboboxGroupProps) {\r\n return <ComboboxPrimitive.Group\r\n data-slot=\"combobox-group\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxGroupLabelProps = ComboboxPrimitive.GroupLabel.Props\r\n\r\nfunction ComboboxGroupLabel(props: ComboboxGroupLabelProps) {\r\n return <ComboboxPrimitive.GroupLabel\r\n data-slot=\"combobox-group-label\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxCollectionProps = ComboboxPrimitive.Collection.Props\r\n\r\nfunction ComboboxCollection(props: ComboboxCollectionProps) {\r\n return <ComboboxPrimitive.Collection\r\n data-slot=\"combobox-collection\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxArrowProps = ComboboxPrimitive.Arrow.Props\r\n\r\nfunction ComboboxArrow(props: ComboboxArrowProps) {\r\n return <ComboboxPrimitive.Arrow\r\n data-slot=\"combobox-arrow\"\r\n {...props}\r\n />\r\n}\r\n\r\nexport {\r\n Combobox,\r\n type ComboboxActiveValueContextType,\r\n ComboboxArrow,\r\n type ComboboxArrowProps,\r\n ComboboxBackdrop,\r\n type ComboboxBackdropProps,\r\n ComboboxChip,\r\n type ComboboxChipProps,\r\n ComboboxChipRemove,\r\n type ComboboxChipRemoveProps,\r\n ComboboxChips,\r\n type ComboboxChipsProps,\r\n ComboboxClear,\r\n type ComboboxClearProps,\r\n ComboboxCollection,\r\n type ComboboxCollectionProps,\r\n type ComboboxContextType,\r\n ComboboxEmpty,\r\n type ComboboxEmptyProps,\r\n ComboboxGroup,\r\n ComboboxGroupLabel,\r\n type ComboboxGroupLabelProps,\r\n type ComboboxGroupProps,\r\n ComboboxHighlight,\r\n ComboboxHighlightItem,\r\n type ComboboxHighlightItemProps,\r\n type ComboboxHighlightProps,\r\n ComboboxIcon,\r\n type ComboboxIconProps,\r\n ComboboxInput,\r\n ComboboxInputGroup,\r\n type ComboboxInputGroupProps,\r\n type ComboboxInputProps,\r\n ComboboxItem,\r\n ComboboxItemIndicator,\r\n type ComboboxItemIndicatorProps,\r\n type ComboboxItemProps,\r\n ComboboxLabel,\r\n type ComboboxLabelProps,\r\n ComboboxList,\r\n type ComboboxListProps,\r\n ComboboxPopup,\r\n type ComboboxPopupProps,\r\n ComboboxPortal,\r\n type ComboboxPortalProps,\r\n ComboboxPositioner,\r\n type ComboboxPositionerProps,\r\n type ComboboxProps,\r\n ComboboxRow,\r\n type ComboboxRowProps,\r\n ComboboxSeparator,\r\n type ComboboxSeparatorProps,\r\n ComboboxStatus,\r\n type ComboboxStatusProps,\r\n ComboboxTrigger,\r\n type ComboboxTriggerProps,\r\n ComboboxValue,\r\n type ComboboxValueProps,\r\n useCombobox,\r\n useComboboxActiveValue,\r\n}","import * as React from \"react\"\r\n\r\nimport {\r\n CheckCircle2Icon,\r\n Loader2Icon,\r\n SearchIcon,\r\n XIcon\r\n} from \"lucide-react\"\r\n\r\nimport {\r\n Combobox as ComboboxPrimitive,\r\n ComboboxArrow as ComboboxArrowPrimitive,\r\n type ComboboxArrowProps as ComboboxArrowPrimitiveProps,\r\n ComboboxBackdrop as ComboboxBackdropPrimitive,\r\n type ComboboxBackdropProps as ComboboxBackdropPrimitiveProps,\r\n ComboboxChip as ComboboxChipPrimitive,\r\n type ComboboxChipProps as ComboboxChipPrimitiveProps,\r\n ComboboxChipRemove as ComboboxChipRemovePrimitive,\r\n type ComboboxChipRemoveProps as ComboboxChipRemovePrimitiveProps,\r\n ComboboxChips as ComboboxChipsPrimitive,\r\n type ComboboxChipsProps as ComboboxChipsPrimitiveProps,\r\n ComboboxClear as ComboboxClearPrimitive,\r\n type ComboboxClearProps as ComboboxClearPrimitiveProps,\r\n ComboboxCollection as ComboboxCollectionPrimitive,\r\n type ComboboxCollectionProps as ComboboxCollectionPrimitiveProps,\r\n ComboboxEmpty as ComboboxEmptyPrimitive,\r\n type ComboboxEmptyProps as ComboboxEmptyPrimitiveProps,\r\n ComboboxGroup as ComboboxGroupPrimitive,\r\n ComboboxGroupLabel as ComboboxGroupLabelPrimitive,\r\n type ComboboxGroupLabelProps as ComboboxGroupLabelPrimitiveProps,\r\n type ComboboxGroupProps as ComboboxGroupPrimitiveProps,\r\n ComboboxHighlight as ComboboxHighlightPrimitive,\r\n ComboboxHighlightItem as ComboboxHighlightItemPrimitive,\r\n type ComboboxHighlightItemProps as ComboboxHighlightItemPrimitiveProps,\r\n type ComboboxHighlightProps as ComboboxHighlightPrimitiveProps,\r\n ComboboxIcon as ComboboxIconPrimitive,\r\n type ComboboxIconProps as ComboboxIconPrimitiveProps,\r\n ComboboxInput as ComboboxInputPrimitive,\r\n ComboboxInputGroup as ComboboxInputGroupPrimitive,\r\n type ComboboxInputGroupProps as ComboboxInputGroupPrimitiveProps,\r\n type ComboboxInputProps as ComboboxInputPrimitiveProps,\r\n ComboboxItem as ComboboxItemPrimitive,\r\n ComboboxItemIndicator as ComboboxItemIndicatorPrimitive,\r\n type ComboboxItemIndicatorProps as ComboboxItemIndicatorPrimitiveProps,\r\n type ComboboxItemProps as ComboboxItemPrimitiveProps,\r\n ComboboxLabel as ComboboxLabelPrimitive,\r\n type ComboboxLabelProps as ComboboxLabelPrimitiveProps,\r\n ComboboxList as ComboboxListPrimitive,\r\n type ComboboxListProps as ComboboxListPrimitiveProps,\r\n ComboboxPopup as ComboboxPopupPrimitive,\r\n type ComboboxPopupProps as ComboboxPopupPrimitiveProps,\r\n ComboboxPortal as ComboboxPortalPrimitive,\r\n type ComboboxPortalProps as ComboboxPortalPrimitiveProps,\r\n ComboboxPositioner as ComboboxPositionerPrimitive,\r\n type ComboboxPositionerProps as ComboboxPositionerPrimitiveProps,\r\n type ComboboxProps as ComboboxPrimitiveProps,\r\n ComboboxRow as ComboboxRowPrimitive,\r\n type ComboboxRowProps as ComboboxRowPrimitiveProps,\r\n ComboboxSeparator as ComboboxSeparatorPrimitive,\r\n type ComboboxSeparatorProps as ComboboxSeparatorPrimitiveProps,\r\n ComboboxStatus as ComboboxStatusPrimitive,\r\n type ComboboxStatusProps as ComboboxStatusPrimitiveProps,\r\n ComboboxTrigger as ComboboxTriggerPrimitive,\r\n type ComboboxTriggerProps as ComboboxTriggerPrimitiveProps,\r\n ComboboxValue as ComboboxValuePrimitive,\r\n type ComboboxValueProps as ComboboxValuePrimitiveProps,\r\n useCombobox,\r\n} from \"../primitives/combobox\"\r\nimport { cn } from \"@xploreu/lib/cn\"\r\n\r\nimport { Badge, BadgeButton } from \"./badge\"\r\nimport { InfiniteScroll } from \"./infinite-scroll\"\r\nimport { Input, inputVariants } from \"./input\"\r\n\r\ntype ComboboxProps<Value, Multiple extends boolean | undefined = false> = ComboboxPrimitiveProps<Value, Multiple>\r\n\r\nfunction Combobox<Value, Multiple extends boolean | undefined = false>(props: ComboboxProps<Value, Multiple>) {\r\n return (\r\n <ComboboxPrimitive {...props} />\r\n )\r\n}\r\n\r\ntype ComboboxTriggerProps = ComboboxTriggerPrimitiveProps\r\n\r\nfunction ComboboxTrigger(props: ComboboxTriggerProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxTriggerPrimitive\r\n className={cn(\r\n \"group/combobox-trigger flex items-center gap-2\",\r\n className,\r\n )}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxLabelProps = ComboboxLabelPrimitiveProps\r\n\r\nfunction ComboboxLabel(props: ComboboxLabelProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxLabelPrimitive\r\n className={cn(\r\n \"text-label-semibold-2 text-text-secondary\",\r\n className,\r\n )}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxInputGroupProps = ComboboxInputGroupPrimitiveProps\r\n\r\nfunction ComboboxInputGroup(props: ComboboxInputGroupProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxInputGroupPrimitive\r\n className={cn(\r\n \"flex w-full items-center gap-2\",\r\n className,\r\n )}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxInputProps = ComboboxInputPrimitiveProps & {\r\n wrapperClassName?: string\r\n}\r\n\r\nfunction ComboboxInput({\r\n className,\r\n wrapperClassName,\r\n ...props\r\n}: ComboboxInputProps) {\r\n\r\n return (\r\n <div className={cn(\"px-3 py-2.5 border-b border-border-primary\", wrapperClassName)}>\r\n <ComboboxInputPrimitive\r\n className={className}\r\n render={<Input size=\"sm\" startContent={<SearchIcon />} />}\r\n {...props}\r\n />\r\n </div>\r\n )\r\n}\r\n\r\nfunction ComboboxInputFilter({\r\n className,\r\n displayValueKey = { label: \"label\", value: \"value\" },\r\n placeholder = \"Search and Select Company\",\r\n inputProps,\r\n ...props\r\n}: ComboboxInputProps & {\r\n displayValueKey?: {\r\n label: string\r\n value: string\r\n }\r\n placeholder?: string\r\n inputProps?: React.ComponentProps<typeof Input>\r\n}) {\r\n const { inputValue, setInputValue } = useCombobox()\r\n const { className: inputClassName, startContent, ...restInputProps } = inputProps || {}\r\n\r\n return (\r\n <div className={cn(\"flex flex-col gap-2\", className)}>\r\n <ComboboxChips\r\n onMouseDown={(e) => e.preventBaseUIHandler()}\r\n className=\"flex-col\"\r\n >\r\n <ComboboxInputPrimitive\r\n render={\r\n <Input\r\n className={cn(\"h-9 text-body-regular-3 pl-9 pr-7\", inputClassName)}\r\n endContent={\r\n <ComboboxTrigger\r\n nativeButton={false}\r\n render={(\r\n <XIcon\r\n className=\"!size-5 !right-1.5 data-[hidden=true]:opacity-0 opacity-100 transition-opacity duration-300 cursor-pointer\"\r\n data-hidden={!inputValue}\r\n data-slot=\"combobox-clear-input\"\r\n onClick={(event) => {\r\n setInputValue(\"\", {\r\n reason: \"none\",\r\n event: event.nativeEvent,\r\n cancel: () => { },\r\n allowPropagation: () => { },\r\n isCanceled: false,\r\n isPropagationAllowed: true,\r\n trigger: undefined,\r\n })\r\n }}\r\n />\r\n )}\r\n />\r\n }\r\n placeholder={placeholder}\r\n startContent={startContent ?? <SearchIcon className=\"!size-4 !text-fg-tertiary-hover\" />}\r\n {...restInputProps}\r\n />\r\n }\r\n {...props}\r\n />\r\n <ComboboxValue>\r\n {/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}\r\n {(value) => value?.map((item: any) => (\r\n <ComboboxChip key={item?.[displayValueKey.value] || \"\"}>\r\n {item?.[displayValueKey.label] || \"\"}\r\n <ComboboxChipRemove />\r\n </ComboboxChip>\r\n ))}\r\n </ComboboxValue>\r\n </ComboboxChips>\r\n </div>\r\n )\r\n}\r\n\r\ntype ComboboxIconProps = ComboboxIconPrimitiveProps\r\n\r\nfunction ComboboxIcon(props: ComboboxIconProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxIconPrimitive\r\n className={cn(\"text-text-secondary\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxClearProps = ComboboxClearPrimitiveProps\r\n\r\nfunction ComboboxClear(props: ComboboxClearProps) {\r\n\r\n return (\r\n <ComboboxClearPrimitive\r\n render={<XIcon />}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxValueProps = ComboboxValuePrimitiveProps\r\n\r\nfunction ComboboxValue(props: ComboboxValueProps) {\r\n return <ComboboxValuePrimitive {...props} />\r\n}\r\n\r\ntype ComboboxChipsProps = ComboboxChipsPrimitiveProps\r\n\r\nfunction ComboboxChips({\r\n className,\r\n ...props\r\n}: ComboboxChipsProps) {\r\n return <ComboboxChipsPrimitive\r\n className={cn(\"flex flex-wrap gap-2\", className)}\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxChipProps = ComboboxChipPrimitiveProps\r\n\r\nfunction ComboboxChip({\r\n className,\r\n ...props\r\n}: ComboboxChipProps) {\r\n return (\r\n <Badge\r\n className={cn(\"ring-1 ring-border-brand text-body-medium-3\", className)}\r\n color=\"brand\"\r\n render={(\r\n <ComboboxChipPrimitive\r\n {...props}\r\n />\r\n )}\r\n size=\"lg\"\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxChipRemoveProps = ComboboxChipRemovePrimitiveProps\r\n\r\nfunction ComboboxChipRemove({\r\n className,\r\n ...props\r\n}: ComboboxChipRemoveProps) {\r\n return (\r\n <BadgeButton\r\n className={cn(\"text-fg-quaternary\", className)}\r\n render={(\r\n <ComboboxChipRemovePrimitive\r\n {...props}\r\n />\r\n )}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxPopupProps = ComboboxPositionerPrimitiveProps &\r\n ComboboxPopupPrimitiveProps & {\r\n container?: React.ComponentProps<typeof ComboboxPortal>[\"container\"]\r\n }\r\n\r\nfunction ComboboxPopup({\r\n className,\r\n align = \"start\",\r\n sideOffset = 4,\r\n container,\r\n initialFocus,\r\n finalFocus,\r\n style,\r\n children,\r\n ...props\r\n}: ComboboxPopupProps) {\r\n return (\r\n <ComboboxPortalPrimitive container={container}>\r\n <ComboboxPositionerPrimitive\r\n align={align}\r\n className=\"isolate z-50\"\r\n sideOffset={sideOffset}\r\n {...props}\r\n >\r\n <ComboboxPopupPrimitive\r\n className={cn(\r\n \"group/combobox-popup bg-bg-primary text-text-primary max-h-(--available-height) w-72 max-w-(--available-width) origin-(--transform-origin) rounded-md border border-border-primary shadow-md outline-hidden\",\r\n className,\r\n )}\r\n finalFocus={finalFocus}\r\n initialFocus={initialFocus}\r\n style={style}\r\n >\r\n <ComboboxHighlight>\r\n {children}\r\n </ComboboxHighlight>\r\n </ComboboxPopupPrimitive>\r\n </ComboboxPositionerPrimitive>\r\n </ComboboxPortalPrimitive>\r\n )\r\n}\r\n\r\ntype ComboboxPortalProps = ComboboxPortalPrimitiveProps\r\n\r\nfunction ComboboxPortal(props: ComboboxPortalProps) {\r\n return <ComboboxPortalPrimitive {...props} />\r\n}\r\n\r\ntype ComboboxPositionerProps = ComboboxPositionerPrimitiveProps\r\n\r\nfunction ComboboxPositioner(props: ComboboxPositionerProps) {\r\n return <ComboboxPositionerPrimitive {...props} />\r\n}\r\n\r\ntype ComboboxBackdropProps = ComboboxBackdropPrimitiveProps\r\n\r\nfunction ComboboxBackdrop(props: ComboboxBackdropProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxBackdropPrimitive\r\n className={cn(\"bg-black/30\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxStatusProps = ComboboxStatusPrimitiveProps\r\n\r\nfunction ComboboxStatus({\r\n className,\r\n status,\r\n ...props\r\n}: Omit<ComboboxStatusProps, \"children\"> & {\r\n status?: \"empty\" | \"pending\" | null\r\n}) {\r\n const { inputValue } = useCombobox()\r\n\r\n const trimmedInputValue = inputValue?.toString().trim()\r\n\r\n const getText = () => {\r\n if (status === \"empty\" && trimmedInputValue)\r\n return `No matches for \"${trimmedInputValue}\".`\r\n\r\n if (status === \"empty\" && !trimmedInputValue)\r\n return \"No results.\"\r\n\r\n if (status === \"pending\")\r\n return (\r\n <>\r\n <Loader2Icon className=\"animate-spin size-4\" />\r\n <span>\r\n Searching...\r\n </span>\r\n </>\r\n )\r\n\r\n return null\r\n }\r\n\r\n const text = getText()\r\n\r\n return (\r\n <ComboboxStatusPrimitive\r\n className={cn(\r\n \"px-2 py-2.5 text-body-regular-2 text-text-disabled flex items-center gap-2\",\r\n !text && \"hidden\",\r\n className\r\n )}\r\n {...props}\r\n >\r\n {text}\r\n </ComboboxStatusPrimitive>\r\n )\r\n}\r\n\r\ntype ComboboxLoadingProps = React.ComponentProps<\"div\">\r\n\r\ntype ComboboxEmptyProps = ComboboxEmptyPrimitiveProps\r\n\r\nfunction ComboboxEmpty({ className, ...props }: ComboboxEmptyProps) {\r\n return <ComboboxEmptyPrimitive\r\n className={cn(\"px-3 py-2 text-body-regular-2 text-text-secondary\", className)}\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxListProps = ComboboxListPrimitiveProps\r\n\r\nfunction ComboboxList({\r\n className,\r\n ...props\r\n}: ComboboxListProps) {\r\n return (\r\n <ComboboxListPrimitive\r\n className={cn(\"max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] overflow-auto scrollbar-thin flex flex-col py-1 focus-visible:outline-none\", className)}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxHighlightProps = ComboboxHighlightPrimitiveProps\r\n\r\nfunction ComboboxHighlight(props: ComboboxHighlightProps) {\r\n const { className, ...rest } = props\r\n\r\n return (\r\n <ComboboxHighlightPrimitive\r\n className={cn(\"absolute inset-0 bg-bg-primary-hover\", className)}\r\n {...rest}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxHighlightItemProps = ComboboxHighlightItemPrimitiveProps\r\n\r\nfunction ComboboxHighlightItem(props: ComboboxHighlightItemProps) {\r\n return <ComboboxHighlightItemPrimitive {...props} />\r\n}\r\n\r\ntype ComboboxRowProps = ComboboxRowPrimitiveProps\r\n\r\nfunction ComboboxRow(props: ComboboxRowProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxRowPrimitive\r\n className={cn(\"group/combobox-row\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxItemProps = ComboboxItemPrimitiveProps & {\r\n withIndicator?: boolean\r\n}\r\n\r\nfunction ComboboxItem({\r\n className,\r\n children,\r\n withIndicator = true,\r\n ...props\r\n}: ComboboxItemProps) {\r\n const { disabled } = props\r\n\r\n return (\r\n <ComboboxHighlightItem\r\n activeClassName=\"bg-bg-primary-hover\"\r\n disabled={disabled}\r\n >\r\n <ComboboxItemPrimitive\r\n className={cn(\r\n \"flex w-full cursor-default items-center gap-xp-md px-3 py-2.5 text-body-medium-2 text-text-primary outline-none\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n {withIndicator && (\r\n <ComboboxItemIndicator>\r\n <CheckCircle2Icon className=\"size-5 text-fg-brand-primary shrink-0\" />\r\n </ComboboxItemIndicator>\r\n )}\r\n </ComboboxItemPrimitive>\r\n </ComboboxHighlightItem>\r\n )\r\n}\r\n\r\ntype ComboboxItemIndicatorProps = ComboboxItemIndicatorPrimitiveProps\r\n\r\nfunction ComboboxItemIndicator(props: ComboboxItemIndicatorProps) {\r\n return (\r\n <ComboboxItemIndicatorPrimitive {...props} />\r\n )\r\n}\r\n\r\ntype ComboboxSeparatorProps = ComboboxSeparatorPrimitiveProps\r\n\r\nfunction ComboboxSeparator(props: ComboboxSeparatorProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxSeparatorPrimitive\r\n className={cn(\"my-1 h-px bg-border-primary\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxGroupProps = ComboboxGroupPrimitiveProps\r\n\r\nfunction ComboboxGroup(props: ComboboxGroupProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxGroupPrimitive\r\n className={cn(\"py-1\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxGroupLabelProps = ComboboxGroupLabelPrimitiveProps\r\n\r\nfunction ComboboxGroupLabel(props: ComboboxGroupLabelProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxGroupLabelPrimitive\r\n className={cn(\"px-3 py-1 text-body-semibold-sm text-text-secondary\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxCollectionProps = ComboboxCollectionPrimitiveProps\r\n\r\nfunction ComboboxCollection(props: ComboboxCollectionProps) {\r\n return <ComboboxCollectionPrimitive {...props} />\r\n}\r\n\r\ntype ComboboxArrowProps = ComboboxArrowPrimitiveProps\r\n\r\nfunction ComboboxArrow(props: ComboboxArrowProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxArrowPrimitive\r\n className={cn(\"fill-bg-primary\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\nfunction ComboboxInfiniteScroll({\r\n hasMore,\r\n threshold = 0.5,\r\n ...props\r\n}: Omit<React.ComponentProps<typeof InfiniteScroll>, \"children\">) {\r\n return (\r\n <InfiniteScroll\r\n hasMore={hasMore}\r\n threshold={threshold}\r\n {...props}\r\n >\r\n {hasMore && (\r\n <div className=\"px-2 py-2.5 text-body-regular-2 text-text-disabled flex items-center gap-2\">\r\n <Loader2Icon className=\"animate-spin size-4\" />\r\n <span>\r\n Loading more...\r\n </span>\r\n </div>\r\n )}\r\n </InfiniteScroll>\r\n )\r\n}\r\n\r\nexport {\r\n Combobox,\r\n ComboboxArrow,\r\n type ComboboxArrowProps,\r\n ComboboxBackdrop,\r\n type ComboboxBackdropProps,\r\n ComboboxChip,\r\n type ComboboxChipProps,\r\n ComboboxChipRemove,\r\n type ComboboxChipRemoveProps,\r\n ComboboxChips,\r\n type ComboboxChipsProps,\r\n ComboboxClear,\r\n type ComboboxClearProps,\r\n ComboboxCollection,\r\n type ComboboxCollectionProps,\r\n ComboboxPopup,\r\n type ComboboxPopupProps,\r\n ComboboxEmpty,\r\n type ComboboxEmptyProps,\r\n ComboboxGroup,\r\n ComboboxGroupLabel,\r\n type ComboboxGroupLabelProps,\r\n type ComboboxGroupProps,\r\n ComboboxHighlight,\r\n ComboboxHighlightItem,\r\n type ComboboxHighlightItemProps,\r\n type ComboboxHighlightProps,\r\n ComboboxIcon,\r\n type ComboboxIconProps,\r\n ComboboxInfiniteScroll,\r\n ComboboxInput,\r\n ComboboxInputFilter,\r\n ComboboxInputGroup,\r\n type ComboboxInputGroupProps,\r\n type ComboboxInputProps,\r\n ComboboxItem,\r\n ComboboxItemIndicator,\r\n type ComboboxItemIndicatorProps,\r\n type ComboboxItemProps,\r\n ComboboxLabel,\r\n type ComboboxLabelProps,\r\n ComboboxList,\r\n type ComboboxListProps,\r\n type ComboboxLoadingProps,\r\n ComboboxPortal,\r\n type ComboboxPortalProps,\r\n ComboboxPositioner,\r\n type ComboboxPositionerProps,\r\n type ComboboxProps,\r\n ComboboxRow,\r\n type ComboboxRowProps,\r\n ComboboxSeparator,\r\n type ComboboxSeparatorProps,\r\n ComboboxStatus,\r\n type ComboboxStatusProps,\r\n ComboboxTrigger,\r\n type ComboboxTriggerProps,\r\n ComboboxValue,\r\n type ComboboxValueProps\r\n}"]}
|
|
1
|
+
{"version":3,"sources":["../src/primitives/combobox.tsx","../src/ui/combobox.tsx"],"names":["ComboboxProvider","useCombobox","getStrictContext","ComboboxActiveValueProvider","useComboboxActiveValue","Combobox","behavior","props","open","setOpen","useControlledState","inputValue","setInputValue","highlightedValue","setHighlightedValue","handleInputValueChange","eventDetails","handleOpenChange","dataSet","jsx","ComboboxPrimitive","ComboboxTrigger","ComboboxLabel","ComboboxInputGroup","ComboboxInput","ComboboxIcon","ComboboxClear","ComboboxValue","ComboboxChips","ComboboxChip","ComboboxChipRemove","ComboboxPortal","AnimatePresence","ComboboxPositioner","ComboboxPopup","initialFocus","finalFocus","transition","motion","ComboboxBackdrop","ComboboxStatus","ComboboxEmpty","ComboboxList","ComboboxHighlight","Highlight","ComboboxHighlightItem","HighlightItem","ComboboxRow","ComboboxItem","highlightedRef","useDataState","value","ref","el","v","ComboboxItemIndicator","ComboboxSeparator","ComboboxGroup","ComboboxGroupLabel","ComboboxCollection","ComboboxArrow","className","rest","cn","wrapperClassName","Input","SearchIcon","ComboboxInputFilter","displayValueKey","placeholder","inputProps","inputClassName","startContent","restInputProps","jsxs","e","XIcon","event","item","Badge","BadgeButton","align","sideOffset","container","style","children","status","trimmedInputValue","text","Fragment","Loader2Icon","withIndicator","disabled","CheckCircle2Icon","ComboboxInfiniteScroll","hasMore","threshold","InfiniteScroll"],"mappings":"koBAiCA,GAAM,CAACA,EAAAA,CAAkBC,CAAW,CAAA,CAClCC,iBAA+C,iBAAiB,CAAA,CAE5D,CAACC,EAAAA,CAA6BC,CAAsB,CAAA,CACxDF,iBAAiD,4BAA4B,CAAA,CAM/E,SAASG,CAAAA,CAA8D,CACrE,SAAAC,CAAAA,CAAW,SAAA,CACX,GAAGC,CACL,CAAA,CAAmC,CACjC,GAAM,CAACC,CAAAA,CAAMC,CAAO,CAAA,CAAIC,kBAAAA,CAAmB,CACzC,KAAA,CAAOH,CAAAA,EAAO,IAAA,CACd,YAAA,CAAcA,CAAAA,EAAO,WAAA,CACrB,SAAUA,CAAAA,EAAO,YACnB,CAAC,CAAA,CAEK,CAACI,EAAYC,CAAa,CAAA,CAAIF,kBAAAA,CAAmB,CACrD,KAAA,CAAOH,CAAAA,EAAO,YAAY,QAAA,EAAS,CACnC,YAAA,CAAcA,CAAAA,EAAO,iBAAA,EAAmB,QAAA,GACxC,QAAA,CAAUA,CAAAA,EAAO,kBACnB,CAAC,CAAA,CAEK,CAACM,EAAkBC,CAAmB,CAAA,CAAU,WAAwB,IAAI,CAAA,CAE5EC,EAA+E,CAACJ,CAAAA,CAAYK,CAAAA,GAAiB,CAEjH,GAAIA,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AAE,UAAAsD,CAAAA,CAAW,GAAGC,CAAK,CAAA,CAAIvD,CAAAA,CAE/B,OAAOY,IAACyC,EAAAA,CAAA,CACN,UAAWG,EAAAA,CAAG,iBAAA,CAAmBF,CAAS,CAAA,CACzC,GAAGC,CAAAA,CACN,CACF,CAEA,SAASgC,GAAuB,CAC9B,OAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CAAY,EAAA,CACZ,GAAGzF,CACL,CAAA,CAAkE,CAChE,OACEY,GAAAA,CAAC8E,CAAAA,CAAA,CACC,OAAA,CAASF,CAAAA,CACT,UAAWC,CAAAA,CACV,GAAGzF,EAEH,QAAA,CAAAwF,CAAAA,EACCrB,IAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,4EAAA,CACb,UAAAvD,GAAAA,CAACuE,WAAAA,CAAA,CAAY,SAAA,CAAU,qBAAA,CAAsB,CAAA,CAC7CvE,IAAC,MAAA,CAAA,CAAK,QAAA,CAAA,iBAAA,CAEN,CAAA,CAAA,CACF,CAAA,CAEJ,CAEJ","file":"chunk-ISGXRZLJ.js","sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\n\r\nimport { Combobox as ComboboxPrimitive } from \"@base-ui/react/combobox\"\r\nimport {\r\n AnimatePresence,\r\n type HTMLMotionProps,\r\n motion\r\n} from \"motion/react\"\r\n\r\nimport {\r\n Highlight,\r\n HighlightItem,\r\n type HighlightItemProps,\r\n type HighlightProps,\r\n} from \"../effects/highlight\"\r\nimport { useControlledState } from \"@xploreu/hooks/use-controlled-state\"\r\nimport { useDataState } from \"@xploreu/hooks/use-data-state\"\r\nimport { getStrictContext } from \"@xploreu/lib/get-strict-context\"\r\n\r\ntype ComboboxContextType<Value, Multiple extends boolean | undefined = false> = {\r\n open: ComboboxProps<Value, Multiple>[\"open\"];\r\n setOpen: NonNullable<ComboboxProps<Value, Multiple>[\"onOpenChange\"]>;\r\n inputValue: ComboboxProps<Value, Multiple>[\"inputValue\"];\r\n setInputValue: NonNullable<ComboboxProps<Value, Multiple>[\"onInputValueChange\"]>;\r\n}\r\n\r\ntype ComboboxActiveValueContextType = {\r\n highlightedValue: string | null;\r\n setHighlightedValue: (value: string | null) => void;\r\n}\r\n\r\nconst [ComboboxProvider, useCombobox] =\r\n getStrictContext<ComboboxContextType<unknown>>(\"ComboboxContext\")\r\n\r\nconst [ComboboxActiveValueProvider, useComboboxActiveValue] =\r\n getStrictContext<ComboboxActiveValueContextType>(\"ComboboxActiveValueContext\")\r\n\r\ntype ComboboxProps<Value, Multiple extends boolean | undefined = false> = ComboboxPrimitive.Root.Props<Value, Multiple> & {\r\n behavior?: \"default\" | \"chip-outside\";\r\n}\r\n\r\nfunction Combobox<Value, Multiple extends boolean | undefined = false>({\r\n behavior = \"default\",\r\n ...props\r\n}: ComboboxProps<Value, Multiple>) {\r\n const [open, setOpen] = useControlledState({\r\n value: props?.open,\r\n defaultValue: props?.defaultOpen,\r\n onChange: props?.onOpenChange,\r\n })\r\n\r\n const [inputValue, setInputValue] = useControlledState({\r\n value: props?.inputValue?.toString(),\r\n defaultValue: props?.defaultInputValue?.toString(),\r\n onChange: props?.onInputValueChange,\r\n })\r\n\r\n const [highlightedValue, setHighlightedValue] = React.useState<string | null>(null)\r\n\r\n const handleInputValueChange: ComboboxProps<Value, Multiple>[\"onInputValueChange\"] = (inputValue, eventDetails) => {\r\n // if the input is cleared, we want to cancel the event to prevent resetting the input value.\r\n if (eventDetails.reason === \"input-clear\") return eventDetails.cancel()\r\n\r\n setInputValue(inputValue, eventDetails)\r\n }\r\n\r\n const handleOpenChange: ComboboxProps<Value, Multiple>[\"onOpenChange\"] = (open, eventDetails) => {\r\n const dataSet = (eventDetails.trigger as HTMLElement)?.dataset\r\n\r\n\r\n if (behavior === \"chip-outside\") {\r\n if (\r\n eventDetails.reason === \"trigger-press\" &&\r\n dataSet?.slot === \"combobox-clear-input\" &&\r\n !open\r\n ) {\r\n return eventDetails.cancel()\r\n }\r\n\r\n if (eventDetails.reason === \"item-press\") {\r\n return eventDetails.cancel()\r\n }\r\n }\r\n\r\n setOpen(open, eventDetails)\r\n }\r\n\r\n return (\r\n <ComboboxActiveValueProvider value={{ highlightedValue, setHighlightedValue }}>\r\n <ComboboxProvider value={{ open, setOpen, inputValue, setInputValue }}>\r\n <ComboboxPrimitive.Root\r\n data-slot=\"combobox\"\r\n {...props}\r\n onInputValueChange={handleInputValueChange}\r\n onOpenChange={handleOpenChange}\r\n />\r\n </ComboboxProvider>\r\n </ComboboxActiveValueProvider>\r\n )\r\n}\r\n\r\ntype ComboboxTriggerProps = ComboboxPrimitive.Trigger.Props\r\n\r\nfunction ComboboxTrigger(props: ComboboxTriggerProps) {\r\n return <ComboboxPrimitive.Trigger\r\n data-slot=\"combobox-trigger\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxLabelProps = ComboboxPrimitive.Label.Props\r\n\r\nfunction ComboboxLabel(props: ComboboxLabelProps) {\r\n return <ComboboxPrimitive.Label\r\n data-slot=\"combobox-label\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxInputGroupProps = ComboboxPrimitive.InputGroup.Props\r\n\r\nfunction ComboboxInputGroup(props: ComboboxInputGroupProps) {\r\n return <ComboboxPrimitive.InputGroup\r\n data-slot=\"combobox-input-group\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxInputProps = ComboboxPrimitive.Input.Props\r\n\r\nfunction ComboboxInput(props: ComboboxInputProps) {\r\n return <ComboboxPrimitive.Input\r\n data-slot=\"combobox-input\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxIconProps = ComboboxPrimitive.Icon.Props\r\n\r\nfunction ComboboxIcon(props: ComboboxIconProps) {\r\n return <ComboboxPrimitive.Icon\r\n data-slot=\"combobox-icon\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxClearProps = ComboboxPrimitive.Clear.Props\r\n\r\nfunction ComboboxClear(props: ComboboxClearProps) {\r\n return <ComboboxPrimitive.Clear\r\n data-slot=\"combobox-clear\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxValueProps = ComboboxPrimitive.Value.Props\r\n\r\nfunction ComboboxValue(props: ComboboxValueProps) {\r\n return <ComboboxPrimitive.Value\r\n data-slot=\"combobox-value\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxChipsProps = ComboboxPrimitive.Chips.Props\r\n\r\nfunction ComboboxChips(props: ComboboxChipsProps) {\r\n return <ComboboxPrimitive.Chips\r\n data-slot=\"combobox-chips\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxChipProps = ComboboxPrimitive.Chip.Props\r\n\r\nfunction ComboboxChip(props: ComboboxChipProps) {\r\n return <ComboboxPrimitive.Chip\r\n data-slot=\"combobox-chip\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxChipRemoveProps = ComboboxPrimitive.ChipRemove.Props\r\n\r\nfunction ComboboxChipRemove(props: ComboboxChipRemoveProps) {\r\n return <ComboboxPrimitive.ChipRemove\r\n data-slot=\"combobox-chip-remove\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxPortalProps = Omit<\r\n ComboboxPrimitive.Portal.Props,\r\n \"keepMounted\"\r\n>\r\n\r\nfunction ComboboxPortal(props: ComboboxPortalProps) {\r\n const { open } = useCombobox()\r\n\r\n return (\r\n <AnimatePresence>\r\n {open && (\r\n <ComboboxPrimitive.Portal\r\n data-slot=\"combobox-portal\"\r\n keepMounted\r\n {...props}\r\n />\r\n )}\r\n </AnimatePresence>\r\n )\r\n}\r\n\r\ntype ComboboxPositionerProps = ComboboxPrimitive.Positioner.Props\r\n\r\nfunction ComboboxPositioner(props: ComboboxPositionerProps) {\r\n return (\r\n <ComboboxPrimitive.Positioner\r\n data-slot=\"combobox-positioner\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxPopupProps = Omit<\r\n ComboboxPrimitive.Popup.Props,\r\n \"render\"\r\n> &\r\n HTMLMotionProps<\"div\">\r\n\r\nfunction ComboboxPopup({\r\n initialFocus,\r\n finalFocus,\r\n transition = { type: \"spring\", stiffness: 300, damping: 25 },\r\n ...props\r\n}: ComboboxPopupProps) {\r\n return (\r\n <ComboboxPrimitive.Popup\r\n finalFocus={finalFocus}\r\n initialFocus={initialFocus}\r\n render={\r\n <motion.div\r\n key=\"combobox-popup\"\r\n animate={{ opacity: 1, scale: 1 }}\r\n data-slot=\"combobox-popup\"\r\n exit={{ opacity: 0, scale: 0.5 }}\r\n initial={{ opacity: 0, scale: 0.5 }}\r\n transition={transition}\r\n {...props}\r\n />\r\n }\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxBackdropProps = ComboboxPrimitive.Backdrop.Props\r\n\r\nfunction ComboboxBackdrop(props: ComboboxBackdropProps) {\r\n return <ComboboxPrimitive.Backdrop\r\n data-slot=\"combobox-backdrop\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxStatusProps = ComboboxPrimitive.Status.Props\r\n\r\nfunction ComboboxStatus(props: ComboboxStatusProps) {\r\n return <ComboboxPrimitive.Status\r\n data-slot=\"combobox-status\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxEmptyProps = ComboboxPrimitive.Empty.Props\r\n\r\nfunction ComboboxEmpty(props: ComboboxEmptyProps) {\r\n return <ComboboxPrimitive.Empty\r\n data-slot=\"combobox-empty\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxListProps = ComboboxPrimitive.List.Props\r\n\r\nfunction ComboboxList(props: ComboboxListProps) {\r\n return <ComboboxPrimitive.List\r\n data-slot=\"combobox-list\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxHighlightProps = Omit<\r\n HighlightProps,\r\n \"controlledItems\" | \"enabled\" | \"hover\"\r\n>\r\n\r\nfunction ComboboxHighlight({\r\n transition = { type: \"spring\", stiffness: 350, damping: 35 },\r\n ...props\r\n}: ComboboxHighlightProps) {\r\n const { highlightedValue } = useComboboxActiveValue()\r\n\r\n return (\r\n <Highlight\r\n click={false}\r\n controlledItems\r\n data-slot=\"combobox-highlight\"\r\n transition={transition}\r\n value={highlightedValue}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxHighlightItemProps = HighlightItemProps\r\n\r\nfunction ComboboxHighlightItem(props: ComboboxHighlightItemProps) {\r\n return (\r\n <HighlightItem\r\n data-slot=\"combobox-highlight-item\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxRowProps = ComboboxPrimitive.Row.Props\r\n\r\nfunction ComboboxRow(props: ComboboxRowProps) {\r\n return <ComboboxPrimitive.Row\r\n data-slot=\"combobox-row\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxItemProps = ComboboxPrimitive.Item.Props\r\n\r\nfunction ComboboxItem(props: ComboboxItemProps) {\r\n const { setHighlightedValue } = useComboboxActiveValue()\r\n const [, highlightedRef] = useDataState<HTMLDivElement>(\r\n \"highlighted\",\r\n undefined,\r\n (value, ref) => {\r\n if (value === true) {\r\n const el = ref.current\r\n const v = el?.dataset.value || el?.id || null\r\n if (v) setHighlightedValue(v)\r\n }\r\n },\r\n )\r\n\r\n return <ComboboxPrimitive.Item\r\n ref={highlightedRef}\r\n data-slot=\"combobox-item\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxItemIndicatorProps = ComboboxPrimitive.ItemIndicator.Props\r\n\r\nfunction ComboboxItemIndicator(props: ComboboxItemIndicatorProps) {\r\n return <ComboboxPrimitive.ItemIndicator\r\n data-slot=\"combobox-item-indicator\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxSeparatorProps = ComboboxPrimitive.Separator.Props\r\n\r\nfunction ComboboxSeparator(props: ComboboxSeparatorProps) {\r\n return <ComboboxPrimitive.Separator\r\n data-slot=\"combobox-separator\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxGroupProps = ComboboxPrimitive.Group.Props\r\n\r\nfunction ComboboxGroup(props: ComboboxGroupProps) {\r\n return <ComboboxPrimitive.Group\r\n data-slot=\"combobox-group\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxGroupLabelProps = ComboboxPrimitive.GroupLabel.Props\r\n\r\nfunction ComboboxGroupLabel(props: ComboboxGroupLabelProps) {\r\n return <ComboboxPrimitive.GroupLabel\r\n data-slot=\"combobox-group-label\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxCollectionProps = ComboboxPrimitive.Collection.Props\r\n\r\nfunction ComboboxCollection(props: ComboboxCollectionProps) {\r\n return <ComboboxPrimitive.Collection\r\n data-slot=\"combobox-collection\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxArrowProps = ComboboxPrimitive.Arrow.Props\r\n\r\nfunction ComboboxArrow(props: ComboboxArrowProps) {\r\n return <ComboboxPrimitive.Arrow\r\n data-slot=\"combobox-arrow\"\r\n {...props}\r\n />\r\n}\r\n\r\nexport {\r\n Combobox,\r\n type ComboboxActiveValueContextType,\r\n ComboboxArrow,\r\n type ComboboxArrowProps,\r\n ComboboxBackdrop,\r\n type ComboboxBackdropProps,\r\n ComboboxChip,\r\n type ComboboxChipProps,\r\n ComboboxChipRemove,\r\n type ComboboxChipRemoveProps,\r\n ComboboxChips,\r\n type ComboboxChipsProps,\r\n ComboboxClear,\r\n type ComboboxClearProps,\r\n ComboboxCollection,\r\n type ComboboxCollectionProps,\r\n type ComboboxContextType,\r\n ComboboxEmpty,\r\n type ComboboxEmptyProps,\r\n ComboboxGroup,\r\n ComboboxGroupLabel,\r\n type ComboboxGroupLabelProps,\r\n type ComboboxGroupProps,\r\n ComboboxHighlight,\r\n ComboboxHighlightItem,\r\n type ComboboxHighlightItemProps,\r\n type ComboboxHighlightProps,\r\n ComboboxIcon,\r\n type ComboboxIconProps,\r\n ComboboxInput,\r\n ComboboxInputGroup,\r\n type ComboboxInputGroupProps,\r\n type ComboboxInputProps,\r\n ComboboxItem,\r\n ComboboxItemIndicator,\r\n type ComboboxItemIndicatorProps,\r\n type ComboboxItemProps,\r\n ComboboxLabel,\r\n type ComboboxLabelProps,\r\n ComboboxList,\r\n type ComboboxListProps,\r\n ComboboxPopup,\r\n type ComboboxPopupProps,\r\n ComboboxPortal,\r\n type ComboboxPortalProps,\r\n ComboboxPositioner,\r\n type ComboboxPositionerProps,\r\n type ComboboxProps,\r\n ComboboxRow,\r\n type ComboboxRowProps,\r\n ComboboxSeparator,\r\n type ComboboxSeparatorProps,\r\n ComboboxStatus,\r\n type ComboboxStatusProps,\r\n ComboboxTrigger,\r\n type ComboboxTriggerProps,\r\n ComboboxValue,\r\n type ComboboxValueProps,\r\n useCombobox,\r\n useComboboxActiveValue,\r\n}","import * as React from \"react\"\r\n\r\nimport {\r\n CheckCircle2Icon,\r\n Loader2Icon,\r\n SearchIcon,\r\n XIcon\r\n} from \"lucide-react\"\r\n\r\nimport {\r\n Combobox as ComboboxPrimitive,\r\n ComboboxArrow as ComboboxArrowPrimitive,\r\n type ComboboxArrowProps as ComboboxArrowPrimitiveProps,\r\n ComboboxBackdrop as ComboboxBackdropPrimitive,\r\n type ComboboxBackdropProps as ComboboxBackdropPrimitiveProps,\r\n ComboboxChip as ComboboxChipPrimitive,\r\n type ComboboxChipProps as ComboboxChipPrimitiveProps,\r\n ComboboxChipRemove as ComboboxChipRemovePrimitive,\r\n type ComboboxChipRemoveProps as ComboboxChipRemovePrimitiveProps,\r\n ComboboxChips as ComboboxChipsPrimitive,\r\n type ComboboxChipsProps as ComboboxChipsPrimitiveProps,\r\n ComboboxClear as ComboboxClearPrimitive,\r\n type ComboboxClearProps as ComboboxClearPrimitiveProps,\r\n ComboboxCollection as ComboboxCollectionPrimitive,\r\n type ComboboxCollectionProps as ComboboxCollectionPrimitiveProps,\r\n ComboboxEmpty as ComboboxEmptyPrimitive,\r\n type ComboboxEmptyProps as ComboboxEmptyPrimitiveProps,\r\n ComboboxGroup as ComboboxGroupPrimitive,\r\n ComboboxGroupLabel as ComboboxGroupLabelPrimitive,\r\n type ComboboxGroupLabelProps as ComboboxGroupLabelPrimitiveProps,\r\n type ComboboxGroupProps as ComboboxGroupPrimitiveProps,\r\n ComboboxHighlight as ComboboxHighlightPrimitive,\r\n ComboboxHighlightItem as ComboboxHighlightItemPrimitive,\r\n type ComboboxHighlightItemProps as ComboboxHighlightItemPrimitiveProps,\r\n type ComboboxHighlightProps as ComboboxHighlightPrimitiveProps,\r\n ComboboxIcon as ComboboxIconPrimitive,\r\n type ComboboxIconProps as ComboboxIconPrimitiveProps,\r\n ComboboxInput as ComboboxInputPrimitive,\r\n ComboboxInputGroup as ComboboxInputGroupPrimitive,\r\n type ComboboxInputGroupProps as ComboboxInputGroupPrimitiveProps,\r\n type ComboboxInputProps as ComboboxInputPrimitiveProps,\r\n ComboboxItem as ComboboxItemPrimitive,\r\n ComboboxItemIndicator as ComboboxItemIndicatorPrimitive,\r\n type ComboboxItemIndicatorProps as ComboboxItemIndicatorPrimitiveProps,\r\n type ComboboxItemProps as ComboboxItemPrimitiveProps,\r\n ComboboxLabel as ComboboxLabelPrimitive,\r\n type ComboboxLabelProps as ComboboxLabelPrimitiveProps,\r\n ComboboxList as ComboboxListPrimitive,\r\n type ComboboxListProps as ComboboxListPrimitiveProps,\r\n ComboboxPopup as ComboboxPopupPrimitive,\r\n type ComboboxPopupProps as ComboboxPopupPrimitiveProps,\r\n ComboboxPortal as ComboboxPortalPrimitive,\r\n type ComboboxPortalProps as ComboboxPortalPrimitiveProps,\r\n ComboboxPositioner as ComboboxPositionerPrimitive,\r\n type ComboboxPositionerProps as ComboboxPositionerPrimitiveProps,\r\n type ComboboxProps as ComboboxPrimitiveProps,\r\n ComboboxRow as ComboboxRowPrimitive,\r\n type ComboboxRowProps as ComboboxRowPrimitiveProps,\r\n ComboboxSeparator as ComboboxSeparatorPrimitive,\r\n type ComboboxSeparatorProps as ComboboxSeparatorPrimitiveProps,\r\n ComboboxStatus as ComboboxStatusPrimitive,\r\n type ComboboxStatusProps as ComboboxStatusPrimitiveProps,\r\n ComboboxTrigger as ComboboxTriggerPrimitive,\r\n type ComboboxTriggerProps as ComboboxTriggerPrimitiveProps,\r\n ComboboxValue as ComboboxValuePrimitive,\r\n type ComboboxValueProps as ComboboxValuePrimitiveProps,\r\n useCombobox,\r\n} from \"../primitives/combobox\"\r\nimport { cn } from \"@xploreu/lib/cn\"\r\n\r\nimport { Badge, BadgeButton } from \"./badge\"\r\nimport { InfiniteScroll } from \"./infinite-scroll\"\r\nimport { Input, inputVariants } from \"./input\"\r\n\r\ntype ComboboxProps<Value, Multiple extends boolean | undefined = false> = ComboboxPrimitiveProps<Value, Multiple>\r\n\r\nfunction Combobox<Value, Multiple extends boolean | undefined = false>(props: ComboboxProps<Value, Multiple>) {\r\n return (\r\n <ComboboxPrimitive {...props} />\r\n )\r\n}\r\n\r\ntype ComboboxTriggerProps = ComboboxTriggerPrimitiveProps\r\n\r\nfunction ComboboxTrigger(props: ComboboxTriggerProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxTriggerPrimitive\r\n className={cn(\r\n \"group/combobox-trigger flex items-center gap-2\",\r\n className,\r\n )}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxLabelProps = ComboboxLabelPrimitiveProps\r\n\r\nfunction ComboboxLabel(props: ComboboxLabelProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxLabelPrimitive\r\n className={cn(\r\n \"text-label-semibold-2 text-text-secondary\",\r\n className,\r\n )}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxInputGroupProps = ComboboxInputGroupPrimitiveProps\r\n\r\nfunction ComboboxInputGroup(props: ComboboxInputGroupProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxInputGroupPrimitive\r\n className={cn(\r\n \"flex w-full items-center gap-2\",\r\n className,\r\n )}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxInputProps = ComboboxInputPrimitiveProps & {\r\n wrapperClassName?: string\r\n}\r\n\r\nfunction ComboboxInput({\r\n className,\r\n wrapperClassName,\r\n ...props\r\n}: ComboboxInputProps) {\r\n\r\n return (\r\n <div className={cn(\"px-3 py-2.5 border-b border-border-primary\", wrapperClassName)}>\r\n <ComboboxInputPrimitive\r\n className={className}\r\n render={<Input size=\"sm\" startContent={<SearchIcon />} />}\r\n {...props}\r\n />\r\n </div>\r\n )\r\n}\r\n\r\nfunction ComboboxInputFilter({\r\n className,\r\n displayValueKey = { label: \"label\", value: \"value\" },\r\n placeholder = \"Search and Select Company\",\r\n inputProps,\r\n ...props\r\n}: ComboboxInputProps & {\r\n displayValueKey?: {\r\n label: string\r\n value: string\r\n }\r\n placeholder?: string\r\n inputProps?: React.ComponentProps<typeof Input>\r\n}) {\r\n const { inputValue, setInputValue } = useCombobox()\r\n const { className: inputClassName, startContent, ...restInputProps } = inputProps || {}\r\n\r\n return (\r\n <div className={cn(\"flex flex-col gap-2\", className)}>\r\n <ComboboxChips\r\n onMouseDown={(e) => e.preventBaseUIHandler()}\r\n className=\"flex-col\"\r\n >\r\n <ComboboxInputPrimitive\r\n render={\r\n <Input\r\n className={cn(\"h-9 text-body-regular-3 pl-9 pr-7\", inputClassName)}\r\n endContent={\r\n <ComboboxTrigger\r\n nativeButton={false}\r\n render={(\r\n <XIcon\r\n className=\"!size-5 !right-1.5 data-[hidden=true]:opacity-0 opacity-100 transition-opacity duration-300 cursor-pointer\"\r\n data-hidden={!inputValue}\r\n data-slot=\"combobox-clear-input\"\r\n onClick={(event) => {\r\n setInputValue(\"\", {\r\n reason: \"none\",\r\n event: event.nativeEvent,\r\n cancel: () => { },\r\n allowPropagation: () => { },\r\n isCanceled: false,\r\n isPropagationAllowed: true,\r\n trigger: undefined,\r\n })\r\n }}\r\n />\r\n )}\r\n />\r\n }\r\n placeholder={placeholder}\r\n startContent={startContent ?? <SearchIcon className=\"!size-4 !text-fg-tertiary-hover\" />}\r\n {...restInputProps}\r\n />\r\n }\r\n {...props}\r\n />\r\n <ComboboxValue>\r\n {/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}\r\n {(value) => value?.map((item: any) => (\r\n <ComboboxChip key={item?.[displayValueKey.value] || \"\"}>\r\n {item?.[displayValueKey.label] || \"\"}\r\n <ComboboxChipRemove />\r\n </ComboboxChip>\r\n ))}\r\n </ComboboxValue>\r\n </ComboboxChips>\r\n </div>\r\n )\r\n}\r\n\r\ntype ComboboxIconProps = ComboboxIconPrimitiveProps\r\n\r\nfunction ComboboxIcon(props: ComboboxIconProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxIconPrimitive\r\n className={cn(\"text-text-secondary\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxClearProps = ComboboxClearPrimitiveProps\r\n\r\nfunction ComboboxClear(props: ComboboxClearProps) {\r\n\r\n return (\r\n <ComboboxClearPrimitive\r\n render={<XIcon />}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxValueProps = ComboboxValuePrimitiveProps\r\n\r\nfunction ComboboxValue(props: ComboboxValueProps) {\r\n return <ComboboxValuePrimitive {...props} />\r\n}\r\n\r\ntype ComboboxChipsProps = ComboboxChipsPrimitiveProps\r\n\r\nfunction ComboboxChips({\r\n className,\r\n ...props\r\n}: ComboboxChipsProps) {\r\n return <ComboboxChipsPrimitive\r\n className={cn(\"flex flex-wrap gap-2\", className)}\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxChipProps = ComboboxChipPrimitiveProps\r\n\r\nfunction ComboboxChip({\r\n className,\r\n ...props\r\n}: ComboboxChipProps) {\r\n return (\r\n <Badge\r\n className={cn(\"ring-1 ring-border-brand text-body-medium-3\", className)}\r\n color=\"brand\"\r\n render={(\r\n <ComboboxChipPrimitive\r\n {...props}\r\n />\r\n )}\r\n size=\"lg\"\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxChipRemoveProps = ComboboxChipRemovePrimitiveProps\r\n\r\nfunction ComboboxChipRemove({\r\n className,\r\n ...props\r\n}: ComboboxChipRemoveProps) {\r\n return (\r\n <BadgeButton\r\n className={cn(\"text-fg-quaternary\", className)}\r\n render={(\r\n <ComboboxChipRemovePrimitive\r\n {...props}\r\n />\r\n )}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxPopupProps = ComboboxPositionerPrimitiveProps &\r\n ComboboxPopupPrimitiveProps & {\r\n container?: React.ComponentProps<typeof ComboboxPortal>[\"container\"]\r\n }\r\n\r\nfunction ComboboxPopup({\r\n className,\r\n align = \"start\",\r\n sideOffset = 4,\r\n container,\r\n initialFocus,\r\n finalFocus,\r\n style,\r\n children,\r\n ...props\r\n}: ComboboxPopupProps) {\r\n return (\r\n <ComboboxPortalPrimitive container={container}>\r\n <ComboboxPositionerPrimitive\r\n align={align}\r\n className=\"isolate z-50\"\r\n sideOffset={sideOffset}\r\n {...props}\r\n >\r\n <ComboboxPopupPrimitive\r\n className={cn(\r\n \"group/combobox-popup bg-bg-primary text-text-primary max-h-(--available-height) w-72 max-w-(--available-width) origin-(--transform-origin) rounded-md border border-border-primary shadow-md outline-hidden\",\r\n className,\r\n )}\r\n finalFocus={finalFocus}\r\n initialFocus={initialFocus}\r\n style={style}\r\n >\r\n <ComboboxHighlight>\r\n {children}\r\n </ComboboxHighlight>\r\n </ComboboxPopupPrimitive>\r\n </ComboboxPositionerPrimitive>\r\n </ComboboxPortalPrimitive>\r\n )\r\n}\r\n\r\ntype ComboboxPortalProps = ComboboxPortalPrimitiveProps\r\n\r\nfunction ComboboxPortal(props: ComboboxPortalProps) {\r\n return <ComboboxPortalPrimitive {...props} />\r\n}\r\n\r\ntype ComboboxPositionerProps = ComboboxPositionerPrimitiveProps\r\n\r\nfunction ComboboxPositioner(props: ComboboxPositionerProps) {\r\n return <ComboboxPositionerPrimitive {...props} />\r\n}\r\n\r\ntype ComboboxBackdropProps = ComboboxBackdropPrimitiveProps\r\n\r\nfunction ComboboxBackdrop(props: ComboboxBackdropProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxBackdropPrimitive\r\n className={cn(\"bg-black/30\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxStatusProps = ComboboxStatusPrimitiveProps\r\n\r\nfunction ComboboxStatus({\r\n className,\r\n status,\r\n ...props\r\n}: Omit<ComboboxStatusProps, \"children\"> & {\r\n status?: \"empty\" | \"pending\" | null\r\n}) {\r\n const { inputValue } = useCombobox()\r\n\r\n const trimmedInputValue = inputValue?.toString().trim()\r\n\r\n const getText = () => {\r\n if (status === \"empty\" && trimmedInputValue)\r\n return `No matches for \"${trimmedInputValue}\".`\r\n\r\n if (status === \"empty\" && !trimmedInputValue)\r\n return \"No results.\"\r\n\r\n if (status === \"pending\")\r\n return (\r\n <>\r\n <Loader2Icon className=\"animate-spin size-4\" />\r\n <span>\r\n Searching...\r\n </span>\r\n </>\r\n )\r\n\r\n return null\r\n }\r\n\r\n const text = getText()\r\n\r\n return (\r\n <ComboboxStatusPrimitive\r\n className={cn(\r\n \"px-2 py-2.5 text-body-regular-2 text-text-disabled flex items-center gap-2\",\r\n !text && \"hidden\",\r\n className\r\n )}\r\n {...props}\r\n >\r\n {text}\r\n </ComboboxStatusPrimitive>\r\n )\r\n}\r\n\r\ntype ComboboxLoadingProps = React.ComponentProps<\"div\">\r\n\r\ntype ComboboxEmptyProps = ComboboxEmptyPrimitiveProps\r\n\r\nfunction ComboboxEmpty({ className, ...props }: ComboboxEmptyProps) {\r\n return <ComboboxEmptyPrimitive\r\n className={cn(\"px-3 py-2 text-body-regular-2 text-text-secondary\", className)}\r\n {...props}\r\n />\r\n}\r\n\r\ntype ComboboxListProps = ComboboxListPrimitiveProps\r\n\r\nfunction ComboboxList({\r\n className,\r\n ...props\r\n}: ComboboxListProps) {\r\n return (\r\n <ComboboxListPrimitive\r\n className={cn(\"max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] overflow-auto scrollbar-thin flex flex-col py-1 focus-visible:outline-none\", className)}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxHighlightProps = ComboboxHighlightPrimitiveProps\r\n\r\nfunction ComboboxHighlight(props: ComboboxHighlightProps) {\r\n const { className, ...rest } = props\r\n\r\n return (\r\n <ComboboxHighlightPrimitive\r\n className={cn(\"absolute inset-0 bg-bg-primary-hover\", className)}\r\n {...rest}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxHighlightItemProps = ComboboxHighlightItemPrimitiveProps\r\n\r\nfunction ComboboxHighlightItem(props: ComboboxHighlightItemProps) {\r\n return <ComboboxHighlightItemPrimitive {...props} />\r\n}\r\n\r\ntype ComboboxRowProps = ComboboxRowPrimitiveProps\r\n\r\nfunction ComboboxRow(props: ComboboxRowProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxRowPrimitive\r\n className={cn(\"group/combobox-row\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxItemProps = ComboboxItemPrimitiveProps & {\r\n withIndicator?: boolean\r\n}\r\n\r\nfunction ComboboxItem({\r\n className,\r\n children,\r\n withIndicator = true,\r\n ...props\r\n}: ComboboxItemProps) {\r\n const { disabled } = props\r\n\r\n return (\r\n <ComboboxHighlightItem\r\n activeClassName=\"bg-bg-primary-hover\"\r\n disabled={disabled}\r\n >\r\n <ComboboxItemPrimitive\r\n className={cn(\r\n \"flex w-full cursor-default items-center gap-xp-md px-3 py-2.5 text-body-medium-2 text-text-primary outline-none\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n {withIndicator && (\r\n <ComboboxItemIndicator>\r\n <CheckCircle2Icon className=\"size-5 text-fg-brand-primary shrink-0\" />\r\n </ComboboxItemIndicator>\r\n )}\r\n </ComboboxItemPrimitive>\r\n </ComboboxHighlightItem>\r\n )\r\n}\r\n\r\ntype ComboboxItemIndicatorProps = ComboboxItemIndicatorPrimitiveProps\r\n\r\nfunction ComboboxItemIndicator(props: ComboboxItemIndicatorProps) {\r\n return (\r\n <ComboboxItemIndicatorPrimitive {...props} />\r\n )\r\n}\r\n\r\ntype ComboboxSeparatorProps = ComboboxSeparatorPrimitiveProps\r\n\r\nfunction ComboboxSeparator(props: ComboboxSeparatorProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxSeparatorPrimitive\r\n className={cn(\"my-1 h-px bg-border-primary\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxGroupProps = ComboboxGroupPrimitiveProps\r\n\r\nfunction ComboboxGroup(props: ComboboxGroupProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxGroupPrimitive\r\n className={cn(\"py-1\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxGroupLabelProps = ComboboxGroupLabelPrimitiveProps\r\n\r\nfunction ComboboxGroupLabel(props: ComboboxGroupLabelProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxGroupLabelPrimitive\r\n className={cn(\"px-3 py-1 text-body-semibold-sm text-text-secondary\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\ntype ComboboxCollectionProps = ComboboxCollectionPrimitiveProps\r\n\r\nfunction ComboboxCollection(props: ComboboxCollectionProps) {\r\n return <ComboboxCollectionPrimitive {...props} />\r\n}\r\n\r\ntype ComboboxArrowProps = ComboboxArrowPrimitiveProps\r\n\r\nfunction ComboboxArrow(props: ComboboxArrowProps) {\r\n const { className, ...rest } = props\r\n\r\n return <ComboboxArrowPrimitive\r\n className={cn(\"fill-bg-primary\", className)}\r\n {...rest}\r\n />\r\n}\r\n\r\nfunction ComboboxInfiniteScroll({\r\n hasMore,\r\n threshold = 0.5,\r\n ...props\r\n}: Omit<React.ComponentProps<typeof InfiniteScroll>, \"children\">) {\r\n return (\r\n <InfiniteScroll\r\n hasMore={hasMore}\r\n threshold={threshold}\r\n {...props}\r\n >\r\n {hasMore && (\r\n <div className=\"px-2 py-2.5 text-body-regular-2 text-text-disabled flex items-center gap-2\">\r\n <Loader2Icon className=\"animate-spin size-4\" />\r\n <span>\r\n Loading more...\r\n </span>\r\n </div>\r\n )}\r\n </InfiniteScroll>\r\n )\r\n}\r\n\r\nexport {\r\n Combobox,\r\n ComboboxArrow,\r\n type ComboboxArrowProps,\r\n ComboboxBackdrop,\r\n type ComboboxBackdropProps,\r\n ComboboxChip,\r\n type ComboboxChipProps,\r\n ComboboxChipRemove,\r\n type ComboboxChipRemoveProps,\r\n ComboboxChips,\r\n type ComboboxChipsProps,\r\n ComboboxClear,\r\n type ComboboxClearProps,\r\n ComboboxCollection,\r\n type ComboboxCollectionProps,\r\n ComboboxPopup,\r\n type ComboboxPopupProps,\r\n ComboboxEmpty,\r\n type ComboboxEmptyProps,\r\n ComboboxGroup,\r\n ComboboxGroupLabel,\r\n type ComboboxGroupLabelProps,\r\n type ComboboxGroupProps,\r\n ComboboxHighlight,\r\n ComboboxHighlightItem,\r\n type ComboboxHighlightItemProps,\r\n type ComboboxHighlightProps,\r\n ComboboxIcon,\r\n type ComboboxIconProps,\r\n ComboboxInfiniteScroll,\r\n ComboboxInput,\r\n ComboboxInputFilter,\r\n ComboboxInputGroup,\r\n type ComboboxInputGroupProps,\r\n type ComboboxInputProps,\r\n ComboboxItem,\r\n ComboboxItemIndicator,\r\n type ComboboxItemIndicatorProps,\r\n type ComboboxItemProps,\r\n ComboboxLabel,\r\n type ComboboxLabelProps,\r\n ComboboxList,\r\n type ComboboxListProps,\r\n type ComboboxLoadingProps,\r\n ComboboxPortal,\r\n type ComboboxPortalProps,\r\n ComboboxPositioner,\r\n type ComboboxPositionerProps,\r\n type ComboboxProps,\r\n ComboboxRow,\r\n type ComboboxRowProps,\r\n ComboboxSeparator,\r\n type ComboboxSeparatorProps,\r\n ComboboxStatus,\r\n type ComboboxStatusProps,\r\n ComboboxTrigger,\r\n type ComboboxTriggerProps,\r\n ComboboxValue,\r\n type ComboboxValueProps\r\n}"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a,b,e,d,c,k as k$1,l,f,g as g$1,h,i}from'./chunk-Z67QQMOX.js';import'react';import {XIcon}from'lucide-react';import {cn}from'@xploreu/lib/cn';import {jsx,jsxs}from'react/jsx-runtime';function D(e){return jsx(a,{...e})}function F(e){return jsx(b,{...e})}function H(e$1){return jsx(e,{...e$1})}function g({className:e,...t}){return jsx(d,{className:cn("fixed inset-0 z-50 bg-black/50 backdrop-blur-sm",e),...t})}var x={right:"inset-y-0 right-0 h-full w-full max-w-sm border-l border-border-primary",left:"inset-y-0 left-0 h-full w-full max-w-sm border-r border-border-primary",top:"inset-x-0 top-0 h-full max-h-sm w-full border-b border-border-primary",bottom:"inset-x-0 bottom-0 h-full max-h-sm w-full border-t border-border-primary"};function O({side:e$1="right",className:t,children:u,showCloseButton:d=true,closeClassName:c$1,...b}){return jsxs(c,{children:[jsx(g,{}),jsxs(k$1,{side:e$1,className:cn("fixed z-50 flex flex-col bg-bg-primary shadow-xp-lg",x[e$1],t),...b,children:[u,d&&jsxs(e,{className:cn('absolute top-4 right-4 rounded-xs transition-colors hover:text-text-error-primary-hover disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*="size-"])]:size-4',c$1),children:[jsx(XIcon,{}),jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function z({className:e,...t}){return jsx(l,{className:cn("flex-1 overflow-y-auto px-6 py-4",e),...t})}function k({className:e,...t}){return jsx(f,{className:cn("flex flex-col gap-1 border-b border-border-primary px-6 py-4",e),...t})}function _({className:e,...t}){return jsx(g$1,{className:cn("mt-auto flex items-center justify-end gap-2 border-t border-border-primary px-6 py-4",e),...t})}function R({className:e,...t}){return jsx(h,{className:cn("text-label-bold-2 text-text-primary",e),...t})}function B({className:e,...t}){return jsx(i,{className:cn("text-body-regular-3 text-text-secondary",e),...t})}export{D as a,F as b,H as c,g as d,O as e,z as f,k as g,_ as h,R as i,B as j};//# sourceMappingURL=chunk-IXWAWSD4.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-IXWAWSD4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ui/sheet.tsx"],"names":["Sheet","props","jsx","SheetTrigger","SheetClose","SheetOverlay","className","cn","sideClasses","SheetPopup","side","children","showCloseButton","closeClassName","jsxs","SheetPortal","XIcon","SheetContent","SheetHeader","SheetFooter","SheetTitle","SheetDescription"],"mappings":"+LA+BA,SAASA,CAAAA,CAAMC,CAAAA,CAAmB,CAChC,OAAOC,GAAAA,CAACF,CAAAA,CAAA,CAAgB,GAAGC,CAAAA,CAAO,CACpC,CAIA,SAASE,CAAAA,CAAaF,EAA0B,CAC9C,OAAOC,GAAAA,CAACC,CAAAA,CAAA,CAAuB,GAAGF,CAAAA,CAAO,CAC3C,CAIA,SAASG,CAAAA,CAAWH,GAAAA,CAAwB,CAC1C,OAAOC,GAAAA,CAACE,CAAAA,CAAA,CAAqB,GAAGH,GAAAA,CAAO,CACzC,CAIA,SAASI,CAAAA,CAAa,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGL,CAAM,CAAA,CAAsB,CAChE,OACEC,GAAAA,CAACG,EAAA,CACC,SAAA,CAAWE,EAAAA,CAAG,iDAAA,CAAmDD,CAAS,CAAA,CACzE,GAAGL,CAAAA,CACN,CAEJ,CAOA,IAAMO,CAAAA,CAAyC,CAC7C,KAAA,CAAO,yEAAA,CACP,IAAA,CAAM,wEAAA,CACN,GAAA,CAAK,uEAAA,CACL,MAAA,CACE,0EACJ,CAAA,CAEA,SAASC,CAAAA,CAAW,CAClB,IAAA,CAAAC,GAAAA,CAAO,OAAA,CACP,SAAA,CAAAJ,CAAAA,CACA,QAAA,CAAAK,CAAAA,CACA,gBAAAC,CAAAA,CAAkB,IAAA,CAClB,cAAA,CAAAC,GAAAA,CACA,GAAGZ,CACL,CAAA,CAAoB,CAClB,OACEa,IAAAA,CAACC,CAAAA,CAAA,CACC,QAAA,CAAA,CAAAb,GAAAA,CAACG,CAAAA,CAAA,EAAa,CAAA,CACdS,IAAAA,CAACL,GAAAA,CAAA,CACC,IAAA,CAAMC,GAAAA,CACN,SAAA,CAAWH,EAAAA,CACT,qDAAA,CACAC,CAAAA,CAAYE,GAAI,CAAA,CAChBJ,CACF,CAAA,CACC,GAAGL,CA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AAAA,CAAW,GAAGL,CAAM,CAAA,CAA0B,CACxE,OACEC,GAAAA,CAACmB,CAAAA,CAAA,CACC,SAAA,CAAWd,EAAAA,CAAG,yCAAA,CAA2CD,CAAS,CAAA,CACjE,GAAGL,EACN,CAEJ","file":"chunk-IXWAWSD4.js","sourcesContent":["import * as React from 'react';\r\nimport { XIcon } from 'lucide-react';\r\n\r\nimport {\r\n Sheet as SheetPrimitive,\r\n SheetPopup as SheetPopupPrimitive,\r\n SheetContent as SheetContentPrimitive,\r\n SheetDescription as SheetDescriptionPrimitive,\r\n SheetFooter as SheetFooterPrimitive,\r\n SheetHeader as SheetHeaderPrimitive,\r\n SheetOverlay as SheetOverlayPrimitive,\r\n SheetPortal as SheetPortalPrimitive,\r\n SheetTitle as SheetTitlePrimitive,\r\n SheetTrigger as SheetTriggerPrimitive,\r\n SheetClose as SheetClosePrimitive,\r\n type SheetPopupProps as SheetPopupPrimitiveProps,\r\n type SheetContentProps as SheetContentPrimitiveProps,\r\n type SheetDescriptionProps as SheetDescriptionPrimitiveProps,\r\n type SheetFooterProps as SheetFooterPrimitiveProps,\r\n type SheetHeaderProps as SheetHeaderPrimitiveProps,\r\n type SheetOverlayProps as SheetOverlayPrimitiveProps,\r\n type SheetTitleProps as SheetTitlePrimitiveProps,\r\n type SheetTriggerProps as SheetTriggerPrimitiveProps,\r\n type SheetProps as SheetPrimitiveProps,\r\n type SheetCloseProps as SheetClosePrimitiveProps,\r\n type SheetSide,\r\n} from '../primitives/sheet';\r\nimport { cn } from '@xploreu/lib/cn';\r\n\r\ntype SheetProps = SheetPrimitiveProps;\r\n\r\nfunction Sheet(props: SheetProps) {\r\n return <SheetPrimitive {...props} />;\r\n}\r\n\r\ntype SheetTriggerProps = SheetTriggerPrimitiveProps;\r\n\r\nfunction SheetTrigger(props: SheetTriggerProps) {\r\n return <SheetTriggerPrimitive {...props} />;\r\n}\r\n\r\ntype SheetCloseProps = SheetClosePrimitiveProps;\r\n\r\nfunction SheetClose(props: SheetCloseProps) {\r\n return <SheetClosePrimitive {...props} />;\r\n}\r\n\r\ntype SheetOverlayProps = SheetOverlayPrimitiveProps;\r\n\r\nfunction SheetOverlay({ className, ...props }: SheetOverlayProps) {\r\n return (\r\n <SheetOverlayPrimitive\r\n className={cn('fixed inset-0 z-50 bg-black/50 backdrop-blur-sm', className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype SheetPopupProps = SheetPopupPrimitiveProps & {\r\n showCloseButton?: boolean;\r\n closeClassName?: string;\r\n};\r\n\r\nconst sideClasses: Record<SheetSide, string> = {\r\n right: 'inset-y-0 right-0 h-full w-full max-w-sm border-l border-border-primary',\r\n left: 'inset-y-0 left-0 h-full w-full max-w-sm border-r border-border-primary',\r\n top: 'inset-x-0 top-0 h-full max-h-sm w-full border-b border-border-primary',\r\n bottom:\r\n 'inset-x-0 bottom-0 h-full max-h-sm w-full border-t border-border-primary',\r\n};\r\n\r\nfunction SheetPopup({\r\n side = 'right',\r\n className,\r\n children,\r\n showCloseButton = true,\r\n closeClassName,\r\n ...props\r\n}: SheetPopupProps) {\r\n return (\r\n <SheetPortalPrimitive>\r\n <SheetOverlay />\r\n <SheetPopupPrimitive\r\n side={side}\r\n className={cn(\r\n 'fixed z-50 flex flex-col bg-bg-primary shadow-xp-lg',\r\n sideClasses[side],\r\n className,\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n {showCloseButton && (\r\n <SheetClosePrimitive\r\n className={cn(\r\n 'absolute top-4 right-4 rounded-xs transition-colors hover:text-text-error-primary-hover disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\"size-\"])]:size-4',\r\n closeClassName,\r\n )}\r\n >\r\n <XIcon />\r\n <span className=\"sr-only\">Close</span>\r\n </SheetClosePrimitive>\r\n )}\r\n </SheetPopupPrimitive>\r\n </SheetPortalPrimitive>\r\n );\r\n}\r\n\r\ntype SheetContentProps = SheetContentPrimitiveProps;\r\n\r\nfunction SheetContent({ className, ...props }: SheetContentProps) {\r\n return (\r\n <SheetContentPrimitive\r\n className={cn('flex-1 overflow-y-auto px-6 py-4', className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype SheetHeaderProps = SheetHeaderPrimitiveProps;\r\n\r\nfunction SheetHeader({ className, ...props }: SheetHeaderProps) {\r\n return (\r\n <SheetHeaderPrimitive\r\n className={cn(\r\n 'flex flex-col gap-1 border-b border-border-primary px-6 py-4',\r\n className,\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype SheetFooterProps = SheetFooterPrimitiveProps;\r\n\r\nfunction SheetFooter({ className, ...props }: SheetFooterProps) {\r\n return (\r\n <SheetFooterPrimitive\r\n className={cn(\r\n 'mt-auto flex items-center justify-end gap-2 border-t border-border-primary px-6 py-4',\r\n className,\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype SheetTitleProps = SheetTitlePrimitiveProps;\r\n\r\nfunction SheetTitle({ className, ...props }: SheetTitleProps) {\r\n return (\r\n <SheetTitlePrimitive\r\n className={cn('text-label-bold-2 text-text-primary', className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype SheetDescriptionProps = SheetDescriptionPrimitiveProps;\r\n\r\nfunction SheetDescription({ className, ...props }: SheetDescriptionProps) {\r\n return (\r\n <SheetDescriptionPrimitive\r\n className={cn('text-body-regular-3 text-text-secondary', className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nexport {\r\n Sheet,\r\n SheetTrigger,\r\n SheetClose,\r\n SheetOverlay,\r\n SheetPopup,\r\n SheetContent,\r\n SheetHeader,\r\n SheetFooter,\r\n SheetTitle,\r\n SheetDescription,\r\n type SheetProps,\r\n type SheetTriggerProps,\r\n type SheetCloseProps,\r\n type SheetOverlayProps,\r\n type SheetPopupProps,\r\n type SheetContentProps,\r\n type SheetHeaderProps,\r\n type SheetFooterProps,\r\n type SheetTitleProps,\r\n type SheetDescriptionProps,\r\n};\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-JWKTYYJB.js"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import*as l from'react';import {AlertDialog}from'@base-ui/react/alert-dialog';import {AnimatePresence,motion}from'motion/react';import {useControlledState}from'@xploreu/hooks/use-controlled-state';import {getStrictContext}from'@xploreu/lib/get-strict-context';import {cn}from'@xploreu/lib/cn';import {jsx}from'react/jsx-runtime';var [v,P]=getStrictContext("AlertDialogContext");function F(t){let[r,i]=useControlledState({value:t?.open,defaultValue:t?.defaultOpen,onChange:t?.onOpenChange});return jsx(v,{value:{open:r,setOpen:i},children:jsx(AlertDialog.Root,{"data-slot":"alert-dialog",...t,onOpenChange:i})})}function M(t){return jsx(AlertDialog.Trigger,{"data-slot":"alert-dialog-trigger",...t})}function H(t){let{open:r}=P();return jsx(AnimatePresence,{children:r&&jsx(AlertDialog.Portal,{"data-slot":"alert-dialog-portal",keepMounted:true,...t})})}function h({transition:t={duration:.2,ease:"easeInOut"},...r}){return jsx(AlertDialog.Backdrop,{"data-slot":"alert-dialog-backdrop",render:jsx(motion.div,{initial:{opacity:0,filter:"blur(4px)"},animate:{opacity:1,filter:"blur(0px)"},exit:{opacity:0,filter:"blur(4px)"},transition:t,...r},"alert-dialog-backdrop")})}function B({from:t="left",initialFocus:r,finalFocus:i,transition:d={type:"spring",stiffness:150,damping:25},className:D,...A}){let n=t==="bottom"||t==="left"?"20deg":"-20deg",a=t==="top"||t==="bottom"?"rotateX":"rotateY",[u,s]=l.useState(false),{open:g}=P();return l.useEffect(()=>{g||s(false);},[g]),jsx(AlertDialog.Popup,{initialFocus:r,finalFocus:i,render:jsx(motion.div,{"data-slot":"alert-dialog-popup","data-opened":u?"":void 0,className:cn("data-[opened]:!transform-none",D),animate:{opacity:1,filter:"blur(0px)",transform:`perspective(500px) ${a}(0deg) scale(1)`},exit:{opacity:0,filter:"blur(4px)",transform:`perspective(500px) ${a}(${n}) scale(0.8)`},initial:{opacity:0,filter:"blur(4px)",transform:`perspective(500px) ${a}(${n}) scale(0.8)`},transition:d,onAnimationComplete:p=>{typeof p=="object"&&"opacity"in p&&p.opacity!==1||requestAnimationFrame(()=>{s(true);});},...A},"alert-dialog-popup")})}function $(t){return jsx(AlertDialog.Close,{"data-slot":"alert-dialog-close",...t})}function L(t){return jsx("div",{"data-slot":"alert-dialog-header",...t})}function S(t){return jsx("div",{"data-slot":"alert-dialog-footer",...t})}function V(t){return jsx(AlertDialog.Title,{"data-slot":"alert-dialog-title",...t})}function q(t){return jsx(AlertDialog.Description,{"data-slot":"alert-dialog-description",...t})}export{P as a,F as b,M as c,H as d,h as e,B as f,$ as g,L as h,S as i,V as j,q as k};//# sourceMappingURL=chunk-RBLL355H.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-RBLL355H.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/primitives/alert-dialog.tsx"],"names":["AlertDialogProvider","useAlertDialog","getStrictContext","AlertDialog","props","open","setOpen","useControlledState","jsx","AlertDialogPrimitive","AlertDialogTrigger","AlertDialogPortal","AnimatePresence","AlertDialogBackdrop","transition","motion","AlertDialogPopup","from","initialFocus","finalFocus","className","initialRotation","rotateAxis","opened","setOpened","cn","latest","AlertDialogClose","AlertDialogHeader","AlertDialogFooter","AlertDialogTitle","AlertDialogDescription"],"mappings":"yUAeA,IAAM,CAACA,EAAqBC,CAAc,CAAA,CACxCC,gBAAAA,CAAyC,oBAAoB,EAI/D,SAASC,EAAYC,CAAAA,CAAyB,CAC5C,GAAM,CAACC,CAAAA,CAAMC,CAAO,CAAA,CAAIC,kBAAAA,CAAmB,CACzC,KAAA,CAAOH,CAAAA,EAAO,IAAA,CACd,aAAcA,CAAAA,EAAO,WAAA,CACrB,SAAUA,CAAAA,EAAO,YACnB,CAAC,CAAA,CAED,OACEI,GAAAA,CAACR,CAAAA,CAAA,CAAo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Z,oBAAsBY,CAAAA,EAAW,CAE7B,OAAOA,CAAAA,EAAW,QAAA,EAClB,YAAaA,CAAAA,EACbA,CAAAA,CAAO,UAAY,CAAA,EAIrB,qBAAA,CAAsB,IAAM,CAC1BF,CAAAA,CAAU,IAAI,EAChB,CAAC,EACH,EACC,GAAGpB,CAAAA,CAAAA,CAhCA,oBAiCN,CAAA,CAEJ,CAEJ,CAMA,SAASuB,CAAAA,CAAiBvB,CAAAA,CAA8B,CACtD,OACEI,GAAAA,CAACC,YAAqB,KAAA,CAArB,CAA2B,YAAU,oBAAA,CAAsB,GAAGL,EAAO,CAE1E,CAIA,SAASwB,CAAAA,CAAkBxB,CAAAA,CAA+B,CACxD,OAAOI,GAAAA,CAAC,KAAA,CAAA,CAAI,YAAU,qBAAA,CAAuB,GAAGJ,EAAO,CACzD,CAIA,SAASyB,CAAAA,CAAkBzB,CAAAA,CAA+B,CACxD,OAAOI,GAAAA,CAAC,KAAA,CAAA,CAAI,YAAU,qBAAA,CAAuB,GAAGJ,EAAO,CACzD,CAMA,SAAS0B,CAAAA,CAAiB1B,CAAAA,CAA8B,CACtD,OACEI,GAAAA,CAACC,WAAAA,CAAqB,MAArB,CAA2B,WAAA,CAAU,qBAAsB,GAAGL,CAAAA,CAAO,CAE1E,CAMA,SAAS2B,CAAAA,CAAuB3B,EAAoC,CAClE,OACEI,IAACC,WAAAA,CAAqB,WAAA,CAArB,CACC,WAAA,CAAU,0BAAA,CACT,GAAGL,CAAAA,CACN,CAEJ","file":"chunk-RBLL355H.js","sourcesContent":["'use client';\r\n\r\nimport * as React from 'react';\r\nimport { AlertDialog as AlertDialogPrimitive } from '@base-ui/react/alert-dialog';\r\nimport { AnimatePresence, motion, type HTMLMotionProps } from 'motion/react';\r\n\r\nimport { useControlledState } from '@xploreu/hooks/use-controlled-state';\r\nimport { getStrictContext } from '@xploreu/lib/get-strict-context';\r\nimport { cn } from '@xploreu/lib/cn';\r\n\r\ntype AlertDialogContextType = {\r\n open: boolean;\r\n setOpen: AlertDialogProps['onOpenChange'];\r\n};\r\n\r\nconst [AlertDialogProvider, useAlertDialog] =\r\n getStrictContext<AlertDialogContextType>('AlertDialogContext');\r\n\r\ntype AlertDialogProps = React.ComponentProps<typeof AlertDialogPrimitive.Root>;\r\n\r\nfunction AlertDialog(props: AlertDialogProps) {\r\n const [open, setOpen] = useControlledState({\r\n value: props?.open,\r\n defaultValue: props?.defaultOpen,\r\n onChange: props?.onOpenChange,\r\n });\r\n\r\n return (\r\n <AlertDialogProvider value={{ open, setOpen }}>\r\n <AlertDialogPrimitive.Root\r\n data-slot=\"alert-dialog\"\r\n {...props}\r\n onOpenChange={setOpen}\r\n />\r\n </AlertDialogProvider>\r\n );\r\n}\r\n\r\ntype AlertDialogTriggerProps = React.ComponentProps<\r\n typeof AlertDialogPrimitive.Trigger\r\n>;\r\n\r\nfunction AlertDialogTrigger(props: AlertDialogTriggerProps) {\r\n return (\r\n <AlertDialogPrimitive.Trigger data-slot=\"alert-dialog-trigger\" {...props} />\r\n );\r\n}\r\n\r\ntype AlertDialogPortalProps = Omit<\r\n React.ComponentProps<typeof AlertDialogPrimitive.Portal>,\r\n 'keepMounted'\r\n>;\r\n\r\nfunction AlertDialogPortal(props: AlertDialogPortalProps) {\r\n const { open } = useAlertDialog();\r\n\r\n return (\r\n <AnimatePresence>\r\n {open && (\r\n <AlertDialogPrimitive.Portal\r\n data-slot=\"alert-dialog-portal\"\r\n keepMounted\r\n {...props}\r\n />\r\n )}\r\n </AnimatePresence>\r\n );\r\n}\r\n\r\ntype AlertDialogBackdropProps = Omit<\r\n React.ComponentProps<typeof AlertDialogPrimitive.Backdrop>,\r\n 'render'\r\n> &\r\n HTMLMotionProps<'div'>;\r\n\r\nfunction AlertDialogBackdrop({\r\n transition = { duration: 0.2, ease: 'easeInOut' },\r\n ...props\r\n}: AlertDialogBackdropProps) {\r\n return (\r\n <AlertDialogPrimitive.Backdrop\r\n data-slot=\"alert-dialog-backdrop\"\r\n render={\r\n <motion.div\r\n key=\"alert-dialog-backdrop\"\r\n initial={{ opacity: 0, filter: 'blur(4px)' }}\r\n animate={{ opacity: 1, filter: 'blur(0px)' }}\r\n exit={{ opacity: 0, filter: 'blur(4px)' }}\r\n transition={transition}\r\n {...props}\r\n />\r\n }\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogFlipDirection = 'top' | 'bottom' | 'left' | 'right';\r\n\r\ntype AlertDialogPopupProps = Omit<\r\n React.ComponentProps<typeof AlertDialogPrimitive.Popup>,\r\n 'render'\r\n> &\r\n HTMLMotionProps<'div'> & {\r\n from?: AlertDialogFlipDirection;\r\n };\r\n\r\nfunction AlertDialogPopup({\r\n from = 'left',\r\n initialFocus,\r\n finalFocus,\r\n transition = { type: 'spring', stiffness: 150, damping: 25 },\r\n className,\r\n ...props\r\n}: AlertDialogPopupProps) {\r\n const initialRotation =\r\n from === 'bottom' || from === 'left' ? '20deg' : '-20deg';\r\n const isVertical = from === 'top' || from === 'bottom';\r\n const rotateAxis = isVertical ? 'rotateX' : 'rotateY';\r\n\r\n const [opened, setOpened] = React.useState(false);\r\n\r\n const { open } = useAlertDialog();\r\n\r\n React.useEffect(() => {\r\n if (open) return;\r\n\r\n setOpened(false);\r\n }, [open]);\r\n\r\n return (\r\n <AlertDialogPrimitive.Popup\r\n initialFocus={initialFocus}\r\n finalFocus={finalFocus}\r\n render={\r\n <motion.div\r\n key=\"alert-dialog-popup\"\r\n data-slot=\"alert-dialog-popup\"\r\n data-opened={opened ? '' : undefined}\r\n className={cn('data-[opened]:!transform-none', className)}\r\n animate={{\r\n opacity: 1,\r\n filter: 'blur(0px)',\r\n transform: `perspective(500px) ${rotateAxis}(0deg) scale(1)`,\r\n }}\r\n exit={{\r\n opacity: 0,\r\n filter: 'blur(4px)',\r\n transform: `perspective(500px) ${rotateAxis}(${initialRotation}) scale(0.8)`,\r\n }}\r\n initial={{\r\n opacity: 0,\r\n filter: 'blur(4px)',\r\n transform: `perspective(500px) ${rotateAxis}(${initialRotation}) scale(0.8)`,\r\n }}\r\n transition={transition}\r\n onAnimationComplete={(latest) => {\r\n if (\r\n typeof latest === 'object' &&\r\n 'opacity' in latest &&\r\n latest.opacity !== 1\r\n )\r\n return;\r\n\r\n requestAnimationFrame(() => {\r\n setOpened(true);\r\n });\r\n }}\r\n {...props}\r\n />\r\n }\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogCloseProps = React.ComponentProps<\r\n typeof AlertDialogPrimitive.Close\r\n>;\r\n\r\nfunction AlertDialogClose(props: AlertDialogCloseProps) {\r\n return (\r\n <AlertDialogPrimitive.Close data-slot=\"alert-dialog-close\" {...props} />\r\n );\r\n}\r\n\r\ntype AlertDialogHeaderProps = React.ComponentProps<'div'>;\r\n\r\nfunction AlertDialogHeader(props: AlertDialogHeaderProps) {\r\n return <div data-slot=\"alert-dialog-header\" {...props} />;\r\n}\r\n\r\ntype AlertDialogFooterProps = React.ComponentProps<'div'>;\r\n\r\nfunction AlertDialogFooter(props: AlertDialogFooterProps) {\r\n return <div data-slot=\"alert-dialog-footer\" {...props} />;\r\n}\r\n\r\ntype AlertDialogTitleProps = React.ComponentProps<\r\n typeof AlertDialogPrimitive.Title\r\n>;\r\n\r\nfunction AlertDialogTitle(props: AlertDialogTitleProps) {\r\n return (\r\n <AlertDialogPrimitive.Title data-slot=\"alert-dialog-title\" {...props} />\r\n );\r\n}\r\n\r\ntype AlertDialogDescriptionProps = React.ComponentProps<\r\n typeof AlertDialogPrimitive.Description\r\n>;\r\n\r\nfunction AlertDialogDescription(props: AlertDialogDescriptionProps) {\r\n return (\r\n <AlertDialogPrimitive.Description\r\n data-slot=\"alert-dialog-description\"\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nexport {\r\n AlertDialog,\r\n AlertDialogPortal,\r\n AlertDialogBackdrop,\r\n AlertDialogClose,\r\n AlertDialogTrigger,\r\n AlertDialogPopup,\r\n AlertDialogHeader,\r\n AlertDialogFooter,\r\n AlertDialogTitle,\r\n AlertDialogDescription,\r\n useAlertDialog,\r\n type AlertDialogProps,\r\n type AlertDialogTriggerProps,\r\n type AlertDialogPortalProps,\r\n type AlertDialogCloseProps,\r\n type AlertDialogBackdropProps,\r\n type AlertDialogPopupProps,\r\n type AlertDialogHeaderProps,\r\n type AlertDialogFooterProps,\r\n type AlertDialogTitleProps,\r\n type AlertDialogDescriptionProps,\r\n};\r\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {d as d$1,e,p,h,t as t$1,v,z}from'./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import {d as d$1,e,p,h,t as t$1,v,z}from'./chunk-ISGXRZLJ.js';import {a}from'./chunk-HUWF445V.js';import*as t from'react';import*as C from'react-phone-number-input';import Y from'react-phone-number-input/flags';import {cn}from'@xploreu/lib/cn';import'@base-ui/react/combobox';import {ChevronsUpDownIcon}from'lucide-react';import {jsx,jsxs}from'react/jsx-runtime';var R=({country:l,countryName:o})=>{let s=l?Y[l]:void 0;return jsx("span",{className:"flex h-4 w-6 shrink-0 overflow-hidden rounded-sm bg-fg-quaternary/20 [&_svg:not([class*='size-'])]:size-full",children:s&&jsx(s,{title:o})})},d=44,k=288,H=6;function D({disabled:l,value:o,options:s,onChange:i}){let[c,r]=t.useState(false),[b,g]=t.useState(""),[y,N]=t.useState(0),v$1=t.useRef(null),m=t.useMemo(()=>s.filter(e=>!!e.value),[s]),u=t.useMemo(()=>{let e=b.trim().toLowerCase();return e?m.filter(a=>{let f=C.getCountryCallingCode(a.value);return a.label.toLowerCase().includes(e)||a.value.toLowerCase().includes(e)||f.includes(e.replace(/^\+/,""))}):m},[b,m]),_=t.useMemo(()=>m.find(e=>e.value===o)??null,[m,o]);t.useEffect(()=>{N(0),v$1.current&&(v$1.current.scrollTop=0);},[b]);let z$1=Math.min(u.length*d,k),h$1=t.useMemo(()=>{let e=Math.floor(y/d),a=Math.max(0,e-H),f=Math.ceil(k/d),P=Math.min(u.length,e+f+H);return {startIndex:a,endIndex:P,items:u.slice(a,P)}},[u,y]),F=h$1.startIndex*d,U=Math.max(0,(u.length-h$1.endIndex)*d),q=t.useCallback(e=>{e?.value&&(i(e.value),g(""),r(false));},[i]);return jsxs(d$1,{behavior:"default",disabled:l,inputValue:b,items:u,open:c,value:_,virtualized:true,filter:null,isItemEqualToValue:(e,a)=>e.value===a.value,openOnInputClick:false,onValueChange:q,onInputValueChange:g,onOpenChange:e=>{r(e),e||g("");},children:[jsx(e,{render:jsxs("button",{type:"button",className:cn(a(),"h-11 w-18 shrink-0 justify-between gap-1 rounded-r-none border-r-0 px-3","hover:bg-bg-primary-hover focus-visible:z-10 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-brand","disabled:pointer-events-none disabled:opacity-50"),disabled:l,children:[jsxs("span",{className:"flex items-center gap-1.5 overflow-hidden",children:[jsx(R,{country:o,countryName:o}),o&&jsx("span",{className:"text-body-medium-3 text-text-primary",children:o})]}),jsx(ChevronsUpDownIcon,{className:"size-3.5 shrink-0 text-fg-quaternary"})]})}),jsxs(p,{className:"w-72",children:[jsx(h,{placeholder:"Search country...","aria-label":"Search country"}),jsx(t$1,{status:u.length===0?"empty":null}),jsx(v,{ref:v$1,className:"relative gap-0",style:{height:z$1},onScroll:e=>N(e.currentTarget.scrollTop),children:jsx("div",{className:"flex w-full shrink-0 flex-col",style:{paddingTop:F,paddingBottom:U},children:h$1.items.map((e,a)=>{let f=h$1.startIndex+a;return jsx(z,{index:f,value:e,children:jsxs("div",{className:"flex items-center gap-2 w-full min-w-0",children:[jsx(R,{country:e.value,countryName:e.label}),jsx("span",{className:"flex-1 text-sm truncate",children:e.label}),jsxs("span",{className:"text-sm text-text-tertiary shrink-0",children:["+",C.getCountryCallingCode(e.value)]})]})},e.value)})})})]})]})}var L=t.forwardRef(({className:l,onChange:o,...s},i)=>{let c=t.useCallback(r=>{r.currentTarget.value==="+"&&(r.currentTarget.value=""),o?.(r);},[o]);return jsx("input",{className:cn(a(),"h-11 flex-1 rounded-l-none text-body-regular-2",l),ref:i,type:"tel",onChange:c,...s})});L.displayName="InputComponent";var G=t.forwardRef(({className:l,onChange:o,value:s,...i},c)=>jsx(C.default,{ref:c,className:cn("flex w-full min-w-0 items-center",l),flagComponent:R,countrySelectComponent:D,inputComponent:L,smartCaret:false,value:s||void 0,onChange:r=>o?.(r||""),...i}));G.displayName="PhoneInput";export{G as a};//# sourceMappingURL=chunk-Y4HXGKZD.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-Y4HXGKZD.js.map
|