@xploreu/components 0.4.23 → 0.4.24
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-3P3UZZ57.js +2 -0
- package/dist/{chunk-6RI2ROVI.js.map → chunk-3P3UZZ57.js.map} +1 -1
- package/dist/{chunk-GI2M7Q4F.js → chunk-5S2M7FXU.js} +2 -2
- package/dist/{chunk-GI2M7Q4F.js.map → chunk-5S2M7FXU.js.map} +1 -1
- package/dist/{chunk-DUSAF7E7.js → chunk-AE72UPV5.js} +2 -2
- package/dist/{chunk-DUSAF7E7.js.map → chunk-AE72UPV5.js.map} +1 -1
- package/dist/{chunk-IF2CKGBN.js → chunk-FF7XATMG.js} +2 -2
- package/dist/{chunk-IF2CKGBN.js.map → chunk-FF7XATMG.js.map} +1 -1
- package/dist/chunk-GWKUM5PE.js +2 -0
- package/dist/chunk-GWKUM5PE.js.map +1 -0
- package/dist/{chunk-U3IMR5VI.js → chunk-KJBLPFUU.js} +2 -2
- package/dist/{chunk-U3IMR5VI.js.map → chunk-KJBLPFUU.js.map} +1 -1
- package/dist/{chunk-3Q6I6MHN.js → chunk-P4CZSRQ7.js} +2 -2
- package/dist/{chunk-3Q6I6MHN.js.map → chunk-P4CZSRQ7.js.map} +1 -1
- package/dist/chunk-PBME4KQ4.js +2 -0
- package/dist/chunk-PBME4KQ4.js.map +1 -0
- package/dist/chunk-PHP3T7ZS.js +2 -0
- package/dist/chunk-PHP3T7ZS.js.map +1 -0
- package/dist/{chunk-22HCPCIZ.js → chunk-QOD2GBLQ.js} +2 -2
- package/dist/{chunk-22HCPCIZ.js.map → chunk-QOD2GBLQ.js.map} +1 -1
- package/dist/composites/combobox-chip-outside.js +1 -1
- package/dist/composites/combobox-chip.d.ts +7 -6
- package/dist/composites/combobox-chip.js +1 -1
- package/dist/composites/combobox-simple.js +1 -1
- package/dist/composites/filter-combobox.js +1 -1
- package/dist/composites/index.js +1 -1
- package/dist/composites/phone-input.js +1 -1
- package/dist/composites/profile-avatar.d.ts +1 -1
- package/dist/composites/profile-avatar.js +1 -1
- package/dist/primitives/combobox.js +1 -1
- package/dist/primitives/index.js +1 -1
- package/dist/ui/avatar.d.ts +1 -1
- package/dist/ui/badge.d.ts +1 -1
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/combobox.js +1 -1
- package/dist/ui/dialog.d.ts +1 -1
- package/dist/ui/dialog.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/ui/input.d.ts +1 -1
- package/dist/ui/pagination.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-6RI2ROVI.js +0 -2
- package/dist/chunk-AA2XSKFM.js +0 -2
- package/dist/chunk-AA2XSKFM.js.map +0 -1
- package/dist/chunk-JONVMB6C.js +0 -2
- package/dist/chunk-JONVMB6C.js.map +0 -1
- package/dist/chunk-ZNZVX4PT.js +0 -2
- package/dist/chunk-ZNZVX4PT.js.map +0 -1
package/dist/ui/pagination.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as Pagination}from'../chunk-
|
|
1
|
+
export{a as Pagination}from'../chunk-FF7XATMG.js';import'../chunk-AE72UPV5.js';import'../chunk-PHP3T7ZS.js';import'../chunk-TED2PUK6.js';import'../chunk-JH6RZ3QH.js';import'../chunk-2XZRLJCN.js';import'../chunk-XG3W7QMP.js';import'../chunk-DCH35MB4.js';import'../chunk-AUYPBFZJ.js';import'../chunk-4D2HXXN3.js';import'../chunk-S7ZMBRYT.js';import'../chunk-322IBGFZ.js';import'../chunk-QDCD6MNO.js';import'../chunk-SGJYHWYM.js';import'../chunk-QYGN3VYS.js';import'../chunk-LFQAJN4H.js';import'../chunk-BEJ2SIQP.js';import'../chunk-4PD3DZE6.js';import'../chunk-3RJED3RZ.js';import'../chunk-FKOYTHRM.js';import'../chunk-GJ5F6YBZ.js';import'../chunk-CKVTRZ3S.js';import'../chunk-YSG3MHTX.js';import'../chunk-TIVYCE4X.js';import'../chunk-RCP2CZRA.js';import'../chunk-AGKZWMW5.js';import'../chunk-YWG6HJAX.js';import'../chunk-NHQA6KSU.js';import'../chunk-DDCGJBN7.js';import'../chunk-7ECOWHUV.js';import'../chunk-IUPJTP3B.js';import'../chunk-ADC7WDF4.js';import'../chunk-ICQEZHVV.js';import'../chunk-PSHB2EQA.js';import'../chunk-JVBWH3DS.js';import'../chunk-EHRGIXKH.js';import'../chunk-CQC2IBSD.js';import'../chunk-2IOTGL4J.js';import'../chunk-NASTZUK6.js';import'../chunk-ZSYQCIYS.js';import'../chunk-4EYPU56T.js';import'../chunk-2JHFRTOZ.js';import'../chunk-FJTQQ4SC.js';import'../chunk-W2HFGSVH.js';import'../chunk-2GABMQSA.js';import'../chunk-XH22TH7N.js';import'../chunk-7LF2CJ3L.js';import'../chunk-KO4EAVJY.js';import'../chunk-PEHI6LCP.js';import'../chunk-3HUMZKFZ.js';import'../chunk-U5N2WWD3.js';import'../chunk-F2D445K4.js';import'../chunk-NUCPKDK5.js';import'../chunk-46KQF4UN.js';import'../chunk-556ANF7Z.js';import'../chunk-UKXYDUDY.js';import'../chunk-7YXRTIXL.js';import'../chunk-4NU44YPN.js';import'../chunk-3SQB2TJB.js';import'../chunk-L5AG5DTS.js';import'../chunk-EAF4H4YJ.js';import'../chunk-UCCQUPMT.js';import'../chunk-TMDCYGCN.js';import'../chunk-5ETIHFSE.js';import'../chunk-XJTOYNCA.js';import'../chunk-BZGVXBP3.js';import'../chunk-U6W5PRLZ.js';import'../chunk-JXTOUSXQ.js';import'../chunk-DRYKJQ72.js';import'../chunk-L73GMVVO.js';import'../chunk-OL4WHG4U.js';import'../chunk-V5WX4TSN.js';import'../chunk-Z22ALCLD.js';import'../chunk-IHTB4XCP.js';import'../chunk-5KMCPFGM.js';import'../chunk-6I4GG756.js';import'../chunk-4UC2VYI5.js';import'../chunk-6FL6AY4D.js';import'../chunk-3376QA4Q.js';import'../chunk-PDZ7VJPX.js';import'../chunk-Y72C3IVO.js';import'../chunk-5OQVCPXP.js';import'../chunk-LSW5TIYQ.js';import'../chunk-5YFGDOSH.js';import'../chunk-3NFGWKSO.js';import'../chunk-YFCBMUPK.js';import'../chunk-SLLTAQ22.js';import'../chunk-WMUM5NGX.js';import'../chunk-A2U6VIQW.js';import'../chunk-VZMFSH37.js';import'../chunk-ECVIBKDN.js';import'../chunk-MPD36YFP.js';import'../chunk-Z5GMQ477.js';import'../chunk-HM2QBLIL.js';import'../chunk-6IKHZM3V.js';import'../chunk-ZVCIT3QN.js';import'../chunk-UACQQO3I.js';import'../chunk-IHLMMP5Q.js';import'../chunk-LN37WPV7.js';import'../chunk-5NAO3POG.js';import'../chunk-JWAU7A2Q.js';import'../chunk-ZKFUHFBC.js';import'../chunk-CEYIRTZQ.js';import'../chunk-TORDOY73.js';import'../chunk-CAK44O3E.js';import'../chunk-MTWFWU3I.js';import'../chunk-NREZRMEX.js';import'../chunk-3SKJUZ5H.js';import'../chunk-EDXV6BE6.js';import'../chunk-4CBZOTZR.js';import'../chunk-XY4CWRWG.js';import'../chunk-2FGDZ6WR.js';import'../chunk-KHCZBVOK.js';import'../chunk-2TO4PAQM.js';import'../chunk-HSTY767P.js';import'../chunk-BKWINCGB.js';import'../chunk-VOTCMLJE.js';import'../chunk-AI5FYYCO.js';import'../chunk-UCQKCAYY.js';import'../chunk-HL32HBMO.js';import'../chunk-K7EZKYBC.js';import'../chunk-FIXJ55FT.js';import'../chunk-GDU3OVET.js';import'../chunk-3EU5QGAN.js';import'../chunk-6EMNBLEM.js';import'../chunk-NYSABCPP.js';import'../chunk-M5IVXDZ4.js';import'../chunk-2ZG2WNSI.js';import'../chunk-FBKS63GQ.js';import'../chunk-NUGYUIN6.js';import'../chunk-6KFTNJLJ.js';import'../chunk-C7GZULSV.js';import'../chunk-GGD2FGWK.js';import'../chunk-DQSDZXTX.js';import'../chunk-R33XCP5H.js';import'../chunk-SDKXW3R4.js';import'../chunk-EJ5XTT5H.js';import'../chunk-6FEBVO2P.js';import'../chunk-JCFEHT75.js';import'../chunk-5I545S2U.js';import'../chunk-V6YCCR75.js';import'../chunk-4JEHGT2R.js';import'../chunk-QNEJRZ4U.js';import'../chunk-SCPA3CM2.js';import'../chunk-2PQUW476.js';import'../chunk-HEKI5WR2.js';import'../chunk-TTZ2UE5L.js';import'../chunk-JZJHLBOV.js';import'../chunk-L6ZGEGUV.js';import'../chunk-5FALHJEA.js';import'../chunk-ICHHISXQ.js';import'../chunk-EERDL5XC.js';import'../chunk-GE3TPDYX.js';import'../chunk-RMGJAA2L.js';import'../chunk-Z7IOYXOK.js';import'../chunk-X2VRJLPR.js';import'../chunk-KPA4J3CC.js';import'../chunk-BKBLZKQ7.js';import'../chunk-3Q72MLBZ.js';import'../chunk-ZWZZVZOP.js';import'../chunk-VLSPFIZU.js';import'../chunk-BGSHHAM2.js';import'../chunk-SR76VRAC.js';import'../chunk-4GMRFP6B.js';import'../chunk-F5FFAJ6B.js';import'../chunk-3N22A4KQ.js';import'../chunk-F7KNYOYR.js';import'../chunk-IRRA2OTH.js';import'../chunk-QM2KF35E.js';import'../chunk-WI5V5Z76.js';import'../chunk-PCUUUW7T.js';import'../chunk-FELUIC3Z.js';import'../chunk-RUTYHOHT.js';import'../chunk-4FH2LYOC.js';import'../chunk-U27RVBYT.js';import'../chunk-SX54FORI.js';import'../chunk-XOIZGRZ6.js';import'../chunk-EY3W3WZX.js';import'../chunk-X2J6MJ6Y.js';import'../chunk-KCSDB6W4.js';import'../chunk-7TNSQNT7.js';import'../chunk-YTN4DVWB.js';import'../chunk-XNDNAHCC.js';import'../chunk-UESMX3LA.js';import'../chunk-33MUUBSB.js';import'../chunk-VK62KNI7.js';import'../chunk-OREIXD3L.js';import'../chunk-EYH5SNDK.js';import'../chunk-PFSN7DQX.js';import'../chunk-Y2R7ZZYY.js';import'../chunk-LYV7R7DB.js';import'../chunk-EKS6U6XR.js';import'../chunk-5LAJMBKN.js';import'../chunk-ZEONZS5N.js';import'../chunk-75BEGXGF.js';import'../chunk-CP6DGMEP.js';import'../chunk-NVVCGBML.js';import'../chunk-ZTCAXM77.js';import'../chunk-UVYYUEHO.js';import'../chunk-FFYGBVMN.js';import'../chunk-HJJ2VCYO.js';import'../chunk-KZMULPFK.js';import'../chunk-X5TJ3Z24.js';import'../chunk-J64EBQ23.js';import'../chunk-DNIYW2WB.js';import'../chunk-DVXIIACM.js';import'../chunk-ZPPUEK2E.js';import'../chunk-GOXCPAUM.js';import'../chunk-6L6HTR6E.js';import'../chunk-4VQUQ3NT.js';import'../chunk-MHRHCLIU.js';import'../chunk-V4VKQ2QF.js';import'../chunk-LHVBJHQZ.js';import'../chunk-2V46QEC7.js';import'../chunk-TJNOFRWB.js';import'../chunk-Y2TTBBRP.js';import'../chunk-NYQJHUKD.js';import'../chunk-6NPT5BJ7.js';import'../chunk-MYGQXM66.js';import'../chunk-ZY5FUK37.js';import'../chunk-QWFECUYL.js';import'../chunk-IPTGAZ37.js';import'../chunk-DEFVXH3J.js';import'../chunk-Y56EKYRN.js';import'../chunk-IW6VX3I7.js';import'../chunk-QWCYJC3T.js';import'../chunk-4S6MFDRP.js';import'../chunk-OE7VPOT4.js';import'../chunk-QH67MZKV.js';import'../chunk-O5CSN63E.js';import'../chunk-I2K2QQOA.js';import'../chunk-ZPKZLDR2.js';import'../chunk-EBXTHJF5.js';import'../chunk-ZXSIHT6V.js';import'../chunk-TJFA5O6Z.js';import'../chunk-KCCBSGT3.js';import'../chunk-CEY3P2QK.js';import'../chunk-E6ZLTD7K.js';import'../chunk-YWDIILO5.js';import'../chunk-WVOOXXON.js';import'../chunk-YRO736RI.js';import'../chunk-QBNIE5KZ.js';import'../chunk-4WDDWMBW.js';import'../chunk-24ZESL25.js';import'../chunk-ZMNFPSA3.js';import'../chunk-6C2TVGCV.js';import'../chunk-ZQWDYX2E.js';import'../chunk-JUM5W2FF.js';import'../chunk-MOH4SNJJ.js';import'../chunk-YFZPYFTS.js';import'../chunk-JSE2CMYN.js';import'../chunk-WSMQZH5E.js';import'../chunk-K3RU27VR.js';import'../chunk-CFKH5BM3.js';import'../chunk-OEEQX3JR.js';import'../chunk-ZT35KBQN.js';import'../chunk-T7HRX3EC.js';import'../chunk-C4ELFIL6.js';import'../chunk-UJRREWOA.js';import'../chunk-3KSOBU4X.js';import'../chunk-XFY6L3B6.js';import'../chunk-BNOMWF6G.js';import'../chunk-XQ5APSL5.js';import'../chunk-6UJXNDLR.js';import'../chunk-HG6NCRSN.js';import'../chunk-4TNLRALG.js';import'../chunk-WYRCNM2M.js';import'../chunk-EYKDAQEG.js';import'../chunk-A4G246BH.js';import'../chunk-WUGIELON.js';import'../chunk-GYYQR6WJ.js';import'../chunk-PEAZKA47.js';import'../chunk-XU65MB53.js';import'../chunk-JUY2JZGK.js';import'../chunk-CHPQMJNP.js';import'../chunk-CJSVB5XT.js';import'../chunk-NTXAFTKR.js';import'../chunk-MFV4KTCM.js';import'../chunk-I56A4HTS.js';import'../chunk-BM65PK4H.js';import'../chunk-3Q67KQWC.js';import'../chunk-CQEBQK7U.js';import'../chunk-HVR2PWQX.js';import'../chunk-JLZNZFOO.js';//# sourceMappingURL=pagination.js.map
|
|
2
2
|
//# sourceMappingURL=pagination.js.map
|
package/package.json
CHANGED
package/dist/chunk-6RI2ROVI.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-AGKZWMW5.js';import {a}from'./chunk-W2HFGSVH.js';import {b,c,d}from'./chunk-CQEBQK7U.js';import {b as b$1}from'./chunk-JLZNZFOO.js';import*as i from'react';import {Slot}from'@radix-ui/react-slot';import {cva}from'class-variance-authority';import {CircleIcon}from'lucide-react';import {cn}from'@xploreu/lib/cn';import {jsxs,jsx}from'react/jsx-runtime';var M=[{status:"open-to-all",label:"Open to All Opportunities",badgeColor:"gray"},{status:"open-to-work",label:"Open to Work",badgeColor:"success"},{status:"open-to-freelance",label:"Open to Freelance",badgeColor:"warning"},{status:"open-to-coach",label:"Open to Coach",badgeColor:"blue-light"}],S=cva("flex flex-col items-center relative",{variants:{size:{xs:"gap-0.5 w-6",sm:"gap-0.5 w-8",md:"gap-0.5 w-10",lg:"gap-1 w-12",xl:"gap-1 w-14","2xl":"gap-2 w-16","3xl":"gap-2 w-20"}},defaultVariants:{size:"sm"}}),E=cva(void 0,{variants:{size:{xs:"p-0.5 h-2 font-semibold text-[5px] leading-2",sm:"p-1 h-2.5 font-semibold text-[6px] leading-2.5",md:"px-1 h-3.5 font-semibold text-[6px] leading-2.5",lg:"px-1 h-4 text-body-semibold-caption",xl:"px-1 h-6 text-body-semibold-xs","2xl":"px-2 h-9 text-body-semibold-sm","3xl":"px-2 h-10 text-label-semibold-4"}},defaultVariants:{size:"sm"}}),W=cva(void 0,{variants:{size:{xs:"p-[1.5px]",sm:"p-xp-xxs",md:"p-[2.5px]",lg:"p-xp-xs",xl:"p-[3.5px]","2xl":"p-1","3xl":"p-1"}},defaultVariants:{size:"sm"}});function X({avatarClassName:N,badgeClassName:A,imageSrc:r,avatarImageClassName:z,imageAlt:f,className:w,status:a$2,size:l,isVerified:j,onEdit:v,onClickAvatar:P,variant:o="profile",isOnline:V,companyLogoSrc:s,bordered:n=true,badged:R=false,fallbackText:x,...O}){let d$1=i.useMemo(()=>M.find(q=>q.status===a$2),[a$2]),y=!!a$2,B=n&&y&&o==="profile"?"div":Slot,I=i.useMemo(()=>{switch(o){case "company":return "/images/fallback-company.jpeg";case "university":return "/images/fallback-university.jpeg";case "group":return "/images/fallback-user-group.jpeg";default:return "/images/fallback-user.jpeg"}},[o]),U=i.useMemo(()=>{if(r)return typeof r=="string"?r:URL.createObjectURL(r)},[r]),m=i.useMemo(()=>{if(s)return typeof s=="string"?s:URL.createObjectURL(s)},[s]);return jsxs("div",{className:cn(S({size:l,className:w})),"data-slot":"profile-avatar",...O,children:[jsx(B,{className:cn("rounded-xp-card-base",n?cn(a$2==="open-to-work"&&"bg-gradient-avatar-outline-opentowork",a$2==="open-to-freelance"&&"bg-gradient-avatar-outline-opentoprofesional",a$2==="open-to-coach"&&"bg-gradient-avatar-outline-opentocoach",a$2==="open-to-all"&&"bg-gradient-avatar-outline-opentowork",!a$2&&o==="profile"&&"bg-border-secondary"):void 0,n&&o==="profile"&&W({size:l})),children:jsxs("div",{className:"relative group",children:[jsxs(b,{className:cn(n&&y&&"border-0",N),size:l,onClick:P,children:[jsx(c,{alt:f,className:cn("bg-bg-primary object-cover",z),src:U}),x?jsx(d,{render:jsx("div",{className:"flex aspect-square size-full items-center justify-center rounded-xp-card-base-sm border-2 border-border-secondary bg-bg-tertiary text-label-semibold-2 text-text-quaternary",children:x})}):jsx(d,{render:jsx("img",{alt:f||"Avatar Fallback",className:"aspect-square size-full bg-bg-primary object-cover",src:I})})]}),v&&jsx("div",{className:"absolute inset-0 flex opacity-0 hover:opacity-100 hover:bg-background-primary-subtle-press/25 rounded-xp-card-base transition-opacity duration-200 items-center justify-center cursor-pointer",id:"avatar-upload-trigger",onClick:v,children:jsx("div",{className:"flex items-center p-2 hover:bg-background-primary-subtle-hover justify-center rounded-xp-card-base-sm bg-background-canvas-subtle",children:jsx(a,{className:"size-6"})})}),V&&!m&&jsx(CircleIcon,{className:"text-bg-primary-replace fill-fg-success-secondary size-[11.5px] absolute -bottom-[3.5px] -right-[3.5px]"}),m!==void 0&&jsxs(b,{className:"border border-bg-primary-replace size-[15px] rounded-xs absolute -bottom-[3.5px] -right-[3.5px]",children:[jsx(c,{alt:"Company Logo",className:"bg-bg-primary object-cover",src:m}),jsx(d,{render:jsx("img",{alt:"Company Logo Fallback",className:"aspect-square size-full bg-bg-primary object-cover",src:"/images/fallback-company.jpeg"})})]})]})}),R&&d$1&&jsx(b$1,{className:cn(E({size:l,className:A})),color:d$1.badgeColor,size:"sm",children:d$1.label}),j&&jsx("div",{className:"absolute -bottom-1 -right-1",children:jsx(a$1,{className:"size-4 text-[#068BEE]"})})]})}export{X as a};//# sourceMappingURL=chunk-6RI2ROVI.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-6RI2ROVI.js.map
|
package/dist/chunk-AA2XSKFM.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a}from'./chunk-6RI2ROVI.js';import {b,c,g,d,f,h,i,j as j$1,k as k$1,e}from'./chunk-2HZWQU6H.js';import'react';import {XIcon}from'lucide-react';import {cn}from'@xploreu/lib/cn';import {jsx,jsxs}from'react/jsx-runtime';function k(o){return jsx(b,{...o})}function A(o){return jsx(c,{...o})}function H(o){return jsx(g,{...o})}function _({className:o,...i}){return jsx(e,{className:cn("fixed inset-0 z-50 bg-black/50 backdrop-blur-sm",o),...i})}function B({className:o,children:i,showCloseButton:e=true,closeClassName:t,...l}){return jsxs(d,{children:[jsx(_,{}),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%] bg-bg-primary shadow-xp-lg rounded-xl overflow-hidden",o),...l,children:[i,e&&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",t),children:[jsx(XIcon,{}),jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function F({className:o,...i}){return jsx(h,{className:cn("relative px-4 py-3 flex flex-col bg-bg-primary border-b border-border-tertiary bg-radial-[100%_200%_at_0%_0%] from-modal-dialog-stop-0 to-bg-primary has-[[data-slot=dialog-icon]]:pl-16 has-[[data-slot=dialog-avatar]]:pl-16",o),...i})}function z({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 R({className:o,...i$1}){return jsx(i,{className:cn("flex gap-2 items-center justify-end bg-bg-primary border-t border-border-tertiary px-4 py-3 shadow-[0px_-1px_24px_0px_var(--color-shadow-xs)] peer-[[data-slot=dialog-content]]:border-0",o),...i$1})}function j({className:o,...i}){return jsx(j$1,{className:cn("text-label-bold-2 text-text-primary",o),...i})}function I({className:o,...i}){return jsx(k$1,{className:cn("mt-0.5 text-body-regular-3 text-text-secondary",o),...i})}function L({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})}function M({src:o,imageSrc:i,className:e,avatarClassName:t,imageAlt:l,variant:u="profile",...f}){return jsx("div",{"data-slot":"dialog-avatar",className:cn("absolute top-[13px] left-4 flex items-center justify-center size-9 rounded-lg overflow-hidden bg-bg-primary 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)]",e),children:jsx(a,{imageSrc:o??i,imageAlt:l,variant:u,bordered:false,badged:false,className:cn("size-full shrink-0",t),...f})})}export{k as a,A as b,H as c,B as d,F as e,z as f,R as g,j as h,I as i,L as j,M as k};//# sourceMappingURL=chunk-AA2XSKFM.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-AA2XSKFM.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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","DialogAvatar","src","imageSrc","avatarClassName","imageAlt","variant","ProfileAvatar"],"mappings":"iOA6BA,SAASA,EAAOC,CAAAA,CAAoB,CAClC,OAAOC,GAAAA,CAACF,EAAA,CAAiB,GAAGC,CAAAA,CAAO,CACrC,CAIA,SAASE,CAAAA,CAAcF,CAAAA,CAA2B,CAChD,OAAOC,GAAAA,CAACC,CAAA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CAAsB,CACpB,OACEC,IAAC,KAAA,CAAA,CACC,WAAA,CAAU,eAAA,CACV,SAAA,CAAWK,GACT,6PAAA,CACAD,CACF,CAAA,CAEA,QAAA,CAAAJ,IAACyB,CAAAA,CAAA,CACC,QAAA,CAAUL,CAAAA,EAAOC,EACjB,QAAA,CAAUE,CAAAA,CACV,OAAA,CAASC,CAAAA,CACT,SAAU,KAAA,CACV,MAAA,CAAQ,KAAA,CACR,SAAA,CAAWnB,GAAG,oBAAA,CAAsBiB,CAAe,EAClD,GAAGvB,CAAAA,CACN,EACF,CAEJ","file":"chunk-AA2XSKFM.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 { ProfileAvatar, type ProfileAvatarVariant } from '../composites/profile-avatar';\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%] bg-bg-primary shadow-xp-lg rounded-xl 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-tertiary bg-radial-[100%_200%_at_0%_0%] from-modal-dialog-stop-0 to-bg-primary has-[[data-slot=dialog-icon]]:pl-16 has-[[data-slot=dialog-avatar]]: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-tertiary px-4 py-3 shadow-[0px_-1px_24px_0px_var(--color-shadow-xs)] peer-[[data-slot=dialog-content]]:border-0\",\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\ntype DialogAvatarProps = Omit<React.ComponentProps<typeof ProfileAvatar>, \"size\" | \"bordered\" | \"badged\"> & {\r\n src?: string;\r\n imageAlt?: string;\r\n variant?: ProfileAvatarVariant;\r\n};\r\n\r\nfunction DialogAvatar({\r\n src,\r\n imageSrc,\r\n className,\r\n avatarClassName,\r\n imageAlt,\r\n variant = \"profile\",\r\n ...props\r\n}: DialogAvatarProps) {\r\n return (\r\n <div\r\n data-slot=\"dialog-avatar\"\r\n className={cn(\r\n \"absolute top-[13px] left-4 flex items-center justify-center size-9 rounded-lg overflow-hidden bg-bg-primary 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 >\r\n <ProfileAvatar\r\n imageSrc={src ?? imageSrc}\r\n imageAlt={imageAlt}\r\n variant={variant}\r\n bordered={false}\r\n badged={false}\r\n className={cn(\"size-full shrink-0\", avatarClassName)}\r\n {...props}\r\n />\r\n </div>\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 DialogAvatar,\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 type DialogAvatarProps,\r\n};"]}
|
package/dist/chunk-JONVMB6C.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a,j,i,k,l,m,q,s,w,A,x,H}from'./chunk-DUSAF7E7.js';import {f,g}from'./chunk-ZNZVX4PT.js';import {a as a$1}from'./chunk-JH6RZ3QH.js';import*as r from'react';import {cn}from'@xploreu/lib/cn';import {useControlledState}from'@xploreu/hooks/use-controlled-state';import {jsxs,jsx,Fragment}from'react/jsx-runtime';function $({multiple:G=true,inputPlaceholder:j$1="Search...",container:q$1,items:s$1,infiniteScroll:z,isPending:B,taggable:C=false,maxVisible:b,...m$1}){let[O,F]=useControlledState({value:m$1?.inputValue?.toString(),defaultValue:m$1?.defaultInputValue?.toString(),onChange:m$1?.onInputValueChange}),[i$1,g$1]=useControlledState({value:m$1?.value??[],defaultValue:m$1?.defaultValue??[],onChange:m$1?.onValueChange}),[I,V]=r.useState([]),p=r.useRef(new Set);r.useEffect(()=>{let e=new Set(i$1.map(a=>a.value));V(a=>{let l=a.filter(o=>e.has(o.value));return l.length===a.length?a:(p.current=new Set(l.map(o=>o.value)),l)});},[i$1]);let t=O?.toString().trim()??"",v=r.useMemo(()=>t?i$1.some(e=>e.value.toLowerCase()===t.toLowerCase()):false,[t,i$1]),c=r.useMemo(()=>!C||!t?false:!s$1?.some(e=>e.label.toLowerCase()===t.toLowerCase()),[C,t,s$1]),H$1=r.useMemo(()=>{let e=[...s$1??[],...I];return c?[...e,{label:t,value:t,tag:true}]:e},[s$1,I,c,t]);return jsxs(a,{...m$1,behavior:"chip-outside",multiple:true,items:C?H$1:s$1,isItemEqualToValue:(e,a)=>e.value===a.value,onValueChange:(e,a)=>{if(C){let l=e.filter(o=>o?.tag===true&&!p.current.has(o.value));if(l.length>0){for(let o of l)p.current.add(o.value);V(o=>[...o,...l]);}}g$1(G?e:[e[e.length-1]],a);},onInputValueChange:F,children:[jsx(f,{className:cn(a$1(),"h-auto min-h-13 flex flex-wrap items-center gap-1.5 px-3 py-1.5 cursor-text"),children:jsxs(j,{className:cn("contents",b!==void 0&&"flex-nowrap overflow-hidden"),children:[jsx(i,{children:e=>{let a=b!==void 0?e.slice(0,b):e,l$1=b!==void 0?e.length-b:0;return jsxs(Fragment,{children:[a?.map(o=>jsxs(k,{className:cn(b!==void 0&&"min-w-0 shrink"),children:[o?.image&&jsx("img",{src:o.image,alt:o?.label||"",className:"size-4 rounded-full object-cover shrink-0 mr-1"}),b!==void 0?jsx("span",{className:"truncate",children:o?.label||""}):o?.label||"",jsx(l,{})]},o?.value||"")),l$1>0&&jsxs(k,{className:"shrink-0",children:["+",l$1]})]})}}),jsx(g,{render:jsx("input",{className:"flex-1 min-w-[80px] bg-transparent outline-none text-body-regular-1 text-text-primary placeholder:text-text-placeholder",placeholder:i$1.length===0?j$1:void 0})})]})}),jsxs(m,{container:q$1,children:[jsx(q,{status:B||s$1===void 0?"pending":s$1?.length===0&&!c?"empty":null}),jsxs(s,{children:[s$1?.map(e=>jsxs(w,{value:e,children:[e.image!==void 0&&jsx(A,{src:e.image,fallbackText:[e.label?.[0],e.label?.split(" ")?.[1]?.[0]].filter(Boolean).join(""),imageAlt:e.label}),jsx(x,{children:e.label})]},e.value)),c&&jsxs(w,{value:{label:t,value:t,tag:true},children:[!v&&jsxs("span",{className:"text-text-secondary text-body-medium-3 col-start-2",children:["Create: ",t]}),v&&jsx(x,{children:t})]}),jsx(H,{...z})]})]})]})}export{$ as a};//# sourceMappingURL=chunk-JONVMB6C.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-JONVMB6C.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/composites/combobox-chip.tsx"],"names":["ComboboxChip","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","jsxs","Combobox","a","b","eventDetails","newTags","tag","jsx","ComboboxInputGroup","cn","inputVariants","ComboboxChips","ComboboxValue","visible","overflow","Fragment","ComboboxChipRemove","ComboboxInput","ComboboxPopup","ComboboxStatus","ComboboxList","ComboboxItem","ComboboxItemAvatar","ComboboxItemTitle","ComboboxInfiniteScroll"],"mappings":"2TA+CA,SAASA,CAAAA,CAAyF,CAChG,QAAA,CAAAC,CAAAA,CAAW,KACX,gBAAA,CAAAC,GAAAA,CAAmB,WAAA,CACnB,SAAA,CAAAC,GAAAA,CACA,KAAA,CAAAC,GAAAA,CACA,cAAA,CAAAC,EACA,SAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CAAW,KAAA,CACX,UAAA,CAAAC,CAAAA,CACA,GAAGC,GACL,CAAA,CAA6B,CAC3B,GAAM,CAACC,CAAAA,CAAYC,CAAa,CAAA,CAAIC,kBAAAA,CAAmB,CACrD,KAAA,CAAOH,GAAAA,EAAO,UAAA,EAAY,QAAA,EAAS,CACnC,YAAA,CAAcA,GAAAA,EAAO,iBAAA,EAAmB,UAAS,CACjD,QAAA,CAAUA,GAAAA,EAAO,kBACnB,CAAC,CAAA,CAEK,CAACI,GAAAA,CAAOC,GAAQ,EAAIF,kBAAAA,CAAmB,CAC3C,KAAA,CAAOH,GAAAA,EAAO,KAAA,EAAS,EAAC,CACxB,YAAA,CAAcA,KAAO,YAAA,EAAgB,EAAC,CACtC,QAAA,CAAUA,GAAAA,EAAO,aACnB,CAAC,CAAA,CAIK,CAACM,CAAAA,CAAcC,CAAe,CAAA,CAAU,CAAA,CAAA,QAAA,CAAkB,EAAE,CAAA,CAC5DC,CAAAA,CAAyB,SAAoB,IAAI,GAAK,CAAA,CAEtD,CAAA,CAAA,SAAA,CAAU,IAAM,CACpB,IAAMC,CAAAA,CAAgB,IAAI,GAAA,CAAIL,GAAAA,CAAM,GAAA,CAAKM,CAAAA,EAAMA,CAAAA,CAAE,KAAK,CAAC,CAAA,CACvDH,EAAiBI,CAAAA,EAAS,CACxB,IAAMC,CAAAA,CAAOD,CAAAA,CAAK,MAAA,CAAQE,CAAAA,EAASJ,CA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AAA,CAAK,SAAA,CAAU,qDAAqD,QAAA,CAAA,CAAA,UAAA,CAASL,CAAAA,CAAAA,CAAa,CAAA,CAE5FC,CAAAA,EACCW,GAAAA,CAACgB,CAAAA,CAAA,CAAmB,QAAA,CAAA5B,EAAa,CAAA,CAAA,CAErC,CAAA,CAEFY,GAAAA,CAACiB,CAAAA,CAAA,CAAwB,GAAG/C,CAAAA,CAAgB,CAAA,CAAA,CAC9C,CAAA,CAAA,CACF,GACF,CAEJ","file":"chunk-JONVMB6C.js","sourcesContent":["import * as React from \"react\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\nimport {\r\n ComboboxInput as ComboboxInputPrimitive,\r\n ComboboxInputGroup,\r\n} from \"../primitives/combobox\"\r\nimport {\r\n Combobox,\r\n ComboboxChip as ComboboxChipUI,\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 ComboboxValue,\r\n type ComboboxProps,\r\n ComboboxItemTitle,\r\n ComboboxItemAvatar\r\n} from \"../ui/combobox\"\r\nimport { useControlledState } from \"@xploreu/hooks/use-controlled-state\"\r\nimport { inputVariants } from \"../ui/input\"\r\n\r\ntype ComboboxChipProps<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; image?: 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 ComboboxChip<Value extends { label: string; value: string; image?: 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}: ComboboxChipProps<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 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\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 return [...base, { label: trimmedInput, value: trimmedInput, tag: true } as unknown as Value]\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 if (taggable) {\r\n const newTags = value.filter(\r\n (v) => v?.tag === true && !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) {\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 {/* Input box with chips inside */}\r\n <ComboboxInputGroup\r\n className={cn(\r\n inputVariants(),\r\n \"h-auto min-h-13 flex flex-wrap items-center gap-1.5 px-3 py-1.5 cursor-text\"\r\n )}\r\n >\r\n {/* Chips inside the input box */}\r\n <ComboboxChips\r\n className={cn(\r\n \"contents\",\r\n maxVisible !== undefined && \"flex-nowrap overflow-hidden\"\r\n )}\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 <ComboboxChipUI\r\n key={item?.value || \"\"}\r\n className={cn(maxVisible !== undefined && \"min-w-0 shrink\")}\r\n >\r\n {item?.image && (\r\n <img\r\n src={item.image}\r\n alt={item?.label || \"\"}\r\n className=\"size-4 rounded-full object-cover shrink-0 mr-1\"\r\n />\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 </ComboboxChipUI>\r\n ))}\r\n {overflow > 0 && (\r\n <ComboboxChipUI className=\"shrink-0\">\r\n +{overflow}\r\n </ComboboxChipUI>\r\n )}\r\n </>\r\n )\r\n }}\r\n </ComboboxValue>\r\n {/* Text input — shrinks to fit remaining space (inside Chips so backspace works) */}\r\n <ComboboxInputPrimitive\r\n render={\r\n <input\r\n className=\"flex-1 min-w-[80px] bg-transparent outline-none text-body-regular-1 text-text-primary placeholder:text-text-placeholder\"\r\n placeholder={value.length === 0 ? inputPlaceholder : undefined}\r\n />\r\n }\r\n />\r\n </ComboboxChips>\r\n </ComboboxInputGroup>\r\n\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={item as Value}\r\n >\r\n {(item.image !== undefined) && (\r\n <ComboboxItemAvatar\r\n src={item.image}\r\n fallbackText={[item.label?.[0], item.label?.split(\" \")?.[1]?.[0]].filter(Boolean).join(\"\")}\r\n imageAlt={item.label}\r\n />\r\n )}\r\n <ComboboxItemTitle>{item.label}</ComboboxItemTitle>\r\n </ComboboxItem>\r\n ))}\r\n {isCreatingItem && (\r\n <ComboboxItem\r\n value={{ label: trimmedInput, value: trimmedInput, tag: true }}\r\n >\r\n {!isInputSelected && (\r\n <span className=\"text-text-secondary text-body-medium-3 col-start-2\">Create: {trimmedInput}</span>\r\n )}\r\n {isInputSelected && (\r\n <ComboboxItemTitle>{trimmedInput}</ComboboxItemTitle>\r\n )}\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 { ComboboxChip }\r\nexport type { ComboboxChipProps }\r\n"]}
|
package/dist/chunk-ZNZVX4PT.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {b,c}from'./chunk-2XZRLJCN.js';import*as a from'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}from'react/jsx-runtime';var [R,g]=getStrictContext("ComboboxContext"),[L,y]=getStrictContext("ComboboxActiveValueContext");function A({behavior:o="default",...b}){let[r,i]=useControlledState({value:b?.open,defaultValue:b?.defaultOpen,onChange:b?.onOpenChange}),[u,l]=useControlledState({value:b?.inputValue?.toString(),defaultValue:b?.defaultInputValue?.toString(),onChange:b?.onInputValueChange}),[x,s]=a.useState(null);a.useEffect(()=>{r&&s(null);},[r]);let p=(C,m)=>{if(m.reason==="input-clear")return m.cancel();l(C,m);},n=(C,m)=>{let f=m.trigger?.dataset;if(o==="chip-outside"&&(m.reason==="trigger-press"&&f?.slot==="combobox-clear-input"&&!C||m.reason==="item-press"))return m.cancel();i(C,m);};return jsx(L,{value:{highlightedValue:x,setHighlightedValue:s},children:jsx(R,{value:{open:r,setOpen:i,inputValue:u,setInputValue:l},children:jsx(Combobox.Root,{"data-slot":"combobox",...b,onInputValueChange:p,onOpenChange:n})})})}function w(o){return jsx(Combobox.Trigger,{"data-slot":"combobox-trigger",...o})}function k(o){return jsx(Combobox.Label,{"data-slot":"combobox-label",...o})}function O(o){return jsx(Combobox.InputGroup,{"data-slot":"combobox-input-group",...o})}function B(o){return jsx(Combobox.Input,{"data-slot":"combobox-input",...o})}function F(o){return jsx(Combobox.Icon,{"data-slot":"combobox-icon",...o})}function q(o){return jsx(Combobox.Clear,{"data-slot":"combobox-clear",...o})}function z(o){return jsx(Combobox.Value,{"data-slot":"combobox-value",...o})}function J(o){return jsx(Combobox.Chips,{"data-slot":"combobox-chips",...o})}function K(o){return jsx(Combobox.Chip,{"data-slot":"combobox-chip",...o})}function N(o){return jsx(Combobox.ChipRemove,{"data-slot":"combobox-chip-remove",...o})}function Q(o){let{open:b}=g();return jsx(AnimatePresence,{children:b&&jsx(Combobox.Portal,{"data-slot":"combobox-portal",keepMounted:true,...o})})}function U(o){return jsx(Combobox.Positioner,{"data-slot":"combobox-positioner",...o})}function W({initialFocus:o,finalFocus:b,transition:r={type:"spring",stiffness:300,damping:25},...i}){return jsx(Combobox.Popup,{finalFocus:b,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:r,...i},"combobox-popup")})}function X(o){return jsx(Combobox.Backdrop,{"data-slot":"combobox-backdrop",...o})}function Y(o){return jsx(Combobox.Status,{"data-slot":"combobox-status",...o})}function Z(o){return jsx(Combobox.Empty,{"data-slot":"combobox-empty",...o})}function _(o){return jsx(Combobox.List,{"data-slot":"combobox-list",...o})}function $({transition:o={type:"spring",stiffness:350,damping:35},...b$1}){let{highlightedValue:r}=y();return jsx(b,{"data-slot":"combobox-highlight",click:false,controlledItems:true,transition:o,value:r,...b$1})}function j(o){return jsx(c,{"data-slot":"combobox-highlight-item",...o})}function D(o){return jsx(Combobox.Row,{"data-slot":"combobox-row",...o})}function oo(o){let{open:b}=g(),{setHighlightedValue:r}=y(),i=a.useRef(false);a.useEffect(()=>{b||(i.current=false);},[b]);let[,u]=useDataState("highlighted",void 0,s=>{if(s===true&&i.current){let p=u.current,n=p?.dataset.value||p?.id||null;n&&r(n);}}),l=s=>{i.current=true;let p=u.current,n=p?.dataset.value||p?.id||null;n&&r(n),o.onPointerEnter?.(s);},x=s=>{if(!i.current){i.current=true;let p=u.current,n=p?.dataset.value||p?.id||null;n&&r(n);}o.onPointerMove?.(s);};return jsx(Combobox.Item,{ref:u,"data-slot":"combobox-item",...o,onPointerEnter:l,onPointerMove:x})}function to(o){return jsx(Combobox.ItemIndicator,{"data-slot":"combobox-item-indicator",...o})}function eo(o){return jsx(Combobox.Separator,{"data-slot":"combobox-separator",...o})}function bo(o){return jsx(Combobox.Group,{"data-slot":"combobox-group",...o})}function ro(o){return jsx(Combobox.GroupLabel,{"data-slot":"combobox-group-label",...o})}function io(o){return jsx(Combobox.Collection,{"data-slot":"combobox-collection",...o})}function po(o){return jsx(Combobox.Arrow,{"data-slot":"combobox-arrow",...o})}export{bo as A,ro as B,io as C,po as D,g as a,y as b,A as c,w as d,k as e,O as f,B as g,F as h,q as i,z as j,J as k,K as l,N as m,Q as n,U as o,W as p,X as q,Y as r,Z as s,_ as t,$ as u,j as v,D as w,oo as x,to as y,eo as z};//# sourceMappingURL=chunk-ZNZVX4PT.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-ZNZVX4PT.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/primitives/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","hasInteractedRef","highlightedRef","useDataState","value","el","v","handlePointerEnter","e","handlePointerMove","ComboboxItemIndicator","ComboboxSeparator","ComboboxGroup","ComboboxGroupLabel","ComboboxCollection","ComboboxArrow"],"mappings":"gYAiCA,IAAM,CAACA,EAAkBC,CAAW,CAAA,CAClCC,gB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AA,CAAlB,CACN,YAAU,sBAAA,CACT,GAAGb,EACN,CACF,CAIA,SAASuD,EAAAA,CAAmBvD,CAAAA,CAAgC,CAC1D,OAAOY,GAAAA,CAACC,QAAAA,CAAkB,WAAlB,CACN,WAAA,CAAU,sBACT,GAAGb,CAAAA,CACN,CACF,CAIA,SAASwD,EAAAA,CAAcxD,EAA2B,CAChD,OAAOY,IAACC,QAAAA,CAAkB,KAAA,CAAlB,CACN,WAAA,CAAU,gBAAA,CACT,GAAGb,CAAAA,CACN,CACF","file":"chunk-ZNZVX4PT.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 = {\r\n open: boolean;\r\n setOpen: (open: boolean, eventDetails: ComboboxPrimitive.Root.ChangeEventDetails) => void;\r\n inputValue: string;\r\n setInputValue: (inputValue: string, eventDetails: ComboboxPrimitive.Root.ChangeEventDetails) => void;\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>(\"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 React.useEffect(() => {\r\n if (open) {\r\n setHighlightedValue(null)\r\n }\r\n }, [open])\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 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 data-slot=\"combobox-highlight\"\r\n click={false}\r\n controlledItems\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 { open } = useCombobox()\r\n const { setHighlightedValue } = useComboboxActiveValue()\r\n const hasInteractedRef = React.useRef(false)\r\n\r\n React.useEffect(() => {\r\n if (!open) {\r\n hasInteractedRef.current = false\r\n }\r\n }, [open])\r\n\r\n const [, highlightedRef] = useDataState<HTMLDivElement>(\r\n \"highlighted\",\r\n undefined,\r\n (value) => {\r\n if (value === true && hasInteractedRef.current) {\r\n const el = highlightedRef.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 const handlePointerEnter: ComboboxItemProps[\"onPointerEnter\"] = (e) => {\r\n hasInteractedRef.current = true\r\n const el = highlightedRef.current\r\n const v = el?.dataset.value || el?.id || null\r\n if (v) setHighlightedValue(v)\r\n props.onPointerEnter?.(e)\r\n }\r\n\r\n const handlePointerMove: ComboboxItemProps[\"onPointerMove\"] = (e) => {\r\n if (!hasInteractedRef.current) {\r\n hasInteractedRef.current = true\r\n const el = highlightedRef.current\r\n const v = el?.dataset.value || el?.id || null\r\n if (v) setHighlightedValue(v)\r\n }\r\n props.onPointerMove?.(e)\r\n }\r\n\r\n return <ComboboxPrimitive.Item\r\n ref={highlightedRef}\r\n data-slot=\"combobox-item\"\r\n {...props}\r\n onPointerEnter={handlePointerEnter}\r\n onPointerMove={handlePointerMove}\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}"]}
|