@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.
Files changed (48) hide show
  1. package/dist/chunk-3P3UZZ57.js +2 -0
  2. package/dist/{chunk-6RI2ROVI.js.map → chunk-3P3UZZ57.js.map} +1 -1
  3. package/dist/{chunk-GI2M7Q4F.js → chunk-5S2M7FXU.js} +2 -2
  4. package/dist/{chunk-GI2M7Q4F.js.map → chunk-5S2M7FXU.js.map} +1 -1
  5. package/dist/{chunk-DUSAF7E7.js → chunk-AE72UPV5.js} +2 -2
  6. package/dist/{chunk-DUSAF7E7.js.map → chunk-AE72UPV5.js.map} +1 -1
  7. package/dist/{chunk-IF2CKGBN.js → chunk-FF7XATMG.js} +2 -2
  8. package/dist/{chunk-IF2CKGBN.js.map → chunk-FF7XATMG.js.map} +1 -1
  9. package/dist/chunk-GWKUM5PE.js +2 -0
  10. package/dist/chunk-GWKUM5PE.js.map +1 -0
  11. package/dist/{chunk-U3IMR5VI.js → chunk-KJBLPFUU.js} +2 -2
  12. package/dist/{chunk-U3IMR5VI.js.map → chunk-KJBLPFUU.js.map} +1 -1
  13. package/dist/{chunk-3Q6I6MHN.js → chunk-P4CZSRQ7.js} +2 -2
  14. package/dist/{chunk-3Q6I6MHN.js.map → chunk-P4CZSRQ7.js.map} +1 -1
  15. package/dist/chunk-PBME4KQ4.js +2 -0
  16. package/dist/chunk-PBME4KQ4.js.map +1 -0
  17. package/dist/chunk-PHP3T7ZS.js +2 -0
  18. package/dist/chunk-PHP3T7ZS.js.map +1 -0
  19. package/dist/{chunk-22HCPCIZ.js → chunk-QOD2GBLQ.js} +2 -2
  20. package/dist/{chunk-22HCPCIZ.js.map → chunk-QOD2GBLQ.js.map} +1 -1
  21. package/dist/composites/combobox-chip-outside.js +1 -1
  22. package/dist/composites/combobox-chip.d.ts +7 -6
  23. package/dist/composites/combobox-chip.js +1 -1
  24. package/dist/composites/combobox-simple.js +1 -1
  25. package/dist/composites/filter-combobox.js +1 -1
  26. package/dist/composites/index.js +1 -1
  27. package/dist/composites/phone-input.js +1 -1
  28. package/dist/composites/profile-avatar.d.ts +1 -1
  29. package/dist/composites/profile-avatar.js +1 -1
  30. package/dist/primitives/combobox.js +1 -1
  31. package/dist/primitives/index.js +1 -1
  32. package/dist/ui/avatar.d.ts +1 -1
  33. package/dist/ui/badge.d.ts +1 -1
  34. package/dist/ui/button.d.ts +1 -1
  35. package/dist/ui/combobox.js +1 -1
  36. package/dist/ui/dialog.d.ts +1 -1
  37. package/dist/ui/dialog.js +1 -1
  38. package/dist/ui/index.js +1 -1
  39. package/dist/ui/input.d.ts +1 -1
  40. package/dist/ui/pagination.js +1 -1
  41. package/package.json +1 -1
  42. package/dist/chunk-6RI2ROVI.js +0 -2
  43. package/dist/chunk-AA2XSKFM.js +0 -2
  44. package/dist/chunk-AA2XSKFM.js.map +0 -1
  45. package/dist/chunk-JONVMB6C.js +0 -2
  46. package/dist/chunk-JONVMB6C.js.map +0 -1
  47. package/dist/chunk-ZNZVX4PT.js +0 -2
  48. package/dist/chunk-ZNZVX4PT.js.map +0 -1
@@ -0,0 +1,2 @@
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 l 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:i,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=l.useMemo(()=>M.find(q=>q.status===a$2),[a$2]),y=!!a$2,B=n&&y&&o==="profile"?"div":Slot,I=l.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=l.useMemo(()=>{if(r)return typeof r=="string"?r:URL.createObjectURL(r)},[r]),m=l.useMemo(()=>{if(s)return typeof s=="string"?s:URL.createObjectURL(s)},[s]);return jsxs("div",{className:cn(S({size:i,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:i})),children:jsxs("div",{className:"relative group size-full",children:[jsxs(b,{className:cn(n&&y&&"border-0",N),size:i,onClick:P,children:[jsx(c,{alt:f,className:cn("size-full 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:i,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-3P3UZZ57.js.map
2
+ //# sourceMappingURL=chunk-3P3UZZ57.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/composites/profile-avatar.tsx"],"names":["profileAvatarStatus","profileAvatarVariants","cva","profileAvatarBadgeVariants","profileAvatarPaddingVariants","ProfileAvatar","avatarClassName","badgeClassName","imageSrc","avatarImageClassName","imageAlt","className","status","size","isVerified","onEdit","onClickAvatar","variant","isOnline","companyLogoSrc","bordered","badged","fallbackText","props","activeStatus","s","hasActiveStatus","Comp","Slot","fallbackImage","normalizedImageSrc","normalizedCompanyLogoSrc","jsxs","cn","jsx","Avatar","AvatarImage","AvatarFallback","upload_pictures_on_profile_icon_default","CircleIcon","Badge","verified_icon_default"],"mappings":"6XAuBA,IAAMA,CAAAA,CAIA,CACF,CACE,MAAA,CAAQ,aAAA,CACR,KAAA,CAAO,2BAAA,CACP,UAAA,CAAY,MACd,CAAA,CACA,CACE,MAAA,CAAQ,cAAA,CACR,KAAA,CAAO,cAAA,CACP,UAAA,CAAY,SACd,CAAA,CACA,CACE,MAAA,CAAQ,mBAAA,CACR,KAAA,CAAO,mBAAA,CACP,UAAA,CAAY,SACd,CAAA,CACA,CACE,MAAA,CAAQ,eAAA,CACR,KAAA,CAAO,eAAA,CACP,UAAA,CAAY,YACd,CACF,CAAA,CAEIC,CAAAA,CAAwBC,GAAAA,CAAI,qCAAA,CAAuC,CACvE,QAAA,CAAU,CACR,IAAA,CAAM,CACJ,EAAA,CAAI,aAAA,CACJ,EAAA,CAAI,aAAA,CACJ,EAAA,CAAI,cAAA,CACJ,EAAA,CAAI,YAAA,CACJ,EAAA,CAAI,YAAA,CACJ,KAAA,CAAO,YAAA,CACP,KAAA,CAAO,YACT,CACF,CAAA,CACA,eAAA,CAAiB,CACf,IAAA,CAAM,IACR,CACF,CAAC,CAAA,CAEKC,CAAAA,CAA6BD,GAAAA,CAAI,MAAA,CAAW,CAChD,QAAA,CAAU,CACR,IAAA,CAAM,CACJ,EAAA,CAAI,8CAAA,CACJ,EAAA,CAAI,gDAAA,CACJ,EAAA,CAAI,iDAAA,CACJ,EAAA,CAAI,qCAAA,CACJ,EAAA,CAAI,gCAAA,CACJ,KAAA,CAAO,gCAAA,CACP,KAA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A,CAACK,UAAAA,CAAA,CAAW,SAAA,CAAU,yGAAA,CAA0G,CAAA,CAEjIR,CAAAA,GAA6B,MAAA,EAC5BC,IAAAA,CAACG,CAAAA,CAAA,CAAO,SAAA,CAAU,iGAAA,CAChB,UAAAD,GAAAA,CAACE,CAAAA,CAAA,CACC,GAAA,CAAI,cAAA,CACJ,SAAA,CAAU,4BAAA,CACV,GAAA,CAAKL,CAAAA,CACP,CAAA,CACAG,GAAAA,CAACG,CAAAA,CAAA,CACC,MAAA,CAEEH,GAAAA,CAAC,KAAA,CAAA,CACC,GAAA,CAAI,uBAAA,CACJ,SAAA,CAAU,oDAAA,CACV,GAAA,CAAI,+BAAA,CACN,CAAA,CAEJ,CAAA,CAAA,CACF,CAAA,CAAA,CAEJ,CAAA,CACF,CAAA,CACCb,CAAAA,EACCG,GAAAA,EACEU,GAAAA,CAACM,GAAAA,CAAA,CACC,SAAA,CAAWP,EAAAA,CAAG9B,CAAAA,CAA2B,CAAE,IAAA,CAAAU,CAAAA,CAAM,SAAA,CAAWN,CAAe,CAAC,CAAC,CAAA,CAC7E,KAAA,CAAOiB,GAAAA,CAAa,UAAA,CACpB,IAAA,CAAK,IAAA,CAEJ,QAAA,CAAAA,GAAAA,CAAa,KAAA,CAChB,CAAA,CAGHV,CAAAA,EACCoB,GAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,6BAAA,CACb,QAAA,CAAAA,GAAAA,CAACO,GAAAA,CAAA,CAAa,SAAA,CAAU,uBAAA,CAAwB,CAAA,CAClD,GAEJ,CAEJ","file":"chunk-6RI2ROVI.js","sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\n\r\nimport { Slot } from \"@radix-ui/react-slot\"\r\nimport { cva, type VariantProps } from \"class-variance-authority\"\r\nimport { CircleIcon } from \"lucide-react\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\n\r\nimport { UploadPicturesOnProfileIcon, VerifiedIcon } from \"../icons\"\r\nimport { Avatar, AvatarFallback, AvatarImage } from \"../ui/avatar\"\r\nimport { Badge } from \"../ui/badge\"\r\n\r\nexport type ProfileAvatarStatus =\r\n | \"open-to-all\"\r\n | \"open-to-work\"\r\n | \"open-to-freelance\"\r\n | \"open-to-coach\"\r\n | undefined\r\n\r\nexport type ProfileAvatarVariant = \"profile\" | \"company\" | \"university\" | \"group\"\r\n\r\nconst profileAvatarStatus: {\r\n status: ProfileAvatarStatus\r\n label: string\r\n badgeColor?: React.ComponentProps<typeof Badge>[\"color\"]\r\n}[] = [\r\n {\r\n status: \"open-to-all\",\r\n label: \"Open to All Opportunities\",\r\n badgeColor: \"gray\",\r\n },\r\n {\r\n status: \"open-to-work\",\r\n label: \"Open to Work\",\r\n badgeColor: \"success\",\r\n },\r\n {\r\n status: \"open-to-freelance\",\r\n label: \"Open to Freelance\",\r\n badgeColor: \"warning\",\r\n },\r\n {\r\n status: \"open-to-coach\",\r\n label: \"Open to Coach\",\r\n badgeColor: \"blue-light\",\r\n },\r\n ]\r\n\r\nconst profileAvatarVariants = cva(\"flex flex-col items-center relative\", {\r\n variants: {\r\n size: {\r\n xs: \"gap-0.5 w-6\",\r\n sm: \"gap-0.5 w-8\",\r\n md: \"gap-0.5 w-10\",\r\n lg: \"gap-1 w-12\",\r\n xl: \"gap-1 w-14\",\r\n \"2xl\": \"gap-2 w-16\",\r\n \"3xl\": \"gap-2 w-20\",\r\n },\r\n },\r\n defaultVariants: {\r\n size: \"sm\",\r\n },\r\n})\r\n\r\nconst profileAvatarBadgeVariants = cva(undefined, {\r\n variants: {\r\n size: {\r\n xs: \"p-0.5 h-2 font-semibold text-[5px] leading-2\",\r\n sm: \"p-1 h-2.5 font-semibold text-[6px] leading-2.5\",\r\n md: \"px-1 h-3.5 font-semibold text-[6px] leading-2.5\",\r\n lg: \"px-1 h-4 text-body-semibold-caption\",\r\n xl: \"px-1 h-6 text-body-semibold-xs\",\r\n \"2xl\": \"px-2 h-9 text-body-semibold-sm\",\r\n \"3xl\": \"px-2 h-10 text-label-semibold-4\",\r\n },\r\n },\r\n defaultVariants: {\r\n size: \"sm\",\r\n },\r\n})\r\n\r\nconst profileAvatarPaddingVariants = cva(undefined, {\r\n variants: {\r\n size: {\r\n xs: \"p-[1.5px]\",\r\n sm: \"p-xp-xxs\",\r\n md: \"p-[2.5px]\",\r\n lg: \"p-xp-xs\",\r\n xl: \"p-[3.5px]\",\r\n \"2xl\": \"p-1\",\r\n \"3xl\": \"p-1\",\r\n },\r\n },\r\n defaultVariants: {\r\n size: \"sm\",\r\n },\r\n})\r\n\r\nfunction ProfileAvatar({\r\n avatarClassName,\r\n badgeClassName,\r\n imageSrc,\r\n avatarImageClassName,\r\n imageAlt,\r\n className,\r\n status,\r\n size,\r\n isVerified,\r\n onEdit,\r\n onClickAvatar,\r\n variant = \"profile\",\r\n isOnline,\r\n companyLogoSrc,\r\n bordered = true,\r\n badged = false,\r\n fallbackText,\r\n ...props\r\n}: React.ComponentProps<\"div\"> & {\r\n avatarClassName?: string\r\n badgeClassName?: string\r\n imageSrc?: string | Blob\r\n imageAlt?: string\r\n isVerified?: boolean\r\n avatarImageClassName?: string\r\n size?: VariantProps<typeof profileAvatarVariants>[\"size\"]\r\n status?: ProfileAvatarStatus\r\n onEdit?: () => void\r\n onClickAvatar?: () => void\r\n variant?: ProfileAvatarVariant\r\n isOnline?: boolean\r\n companyLogoSrc?: string | Blob\r\n bordered?: boolean\r\n badged?: boolean\r\n fallbackText?: string\r\n}) {\r\n const activeStatus = React.useMemo(() => {\r\n return profileAvatarStatus.find((s) => s.status === status)\r\n }, [status])\r\n\r\n const hasActiveStatus = !!status\r\n const Comp = bordered && hasActiveStatus && variant === \"profile\" ? \"div\" : Slot\r\n\r\n const fallbackImage = React.useMemo(() => {\r\n switch (variant) {\r\n case \"company\":\r\n return \"/images/fallback-company.jpeg\"\r\n case \"university\":\r\n return \"/images/fallback-university.jpeg\"\r\n case \"group\":\r\n return \"/images/fallback-user-group.jpeg\"\r\n default:\r\n return \"/images/fallback-user.jpeg\"\r\n }\r\n }, [variant])\r\n\r\n const normalizedImageSrc = React.useMemo(() => {\r\n if (!imageSrc) return undefined\r\n if (typeof imageSrc === \"string\") return imageSrc\r\n return URL.createObjectURL(imageSrc)\r\n }, [imageSrc])\r\n\r\n const normalizedCompanyLogoSrc = React.useMemo(() => {\r\n if (!companyLogoSrc) return undefined\r\n if (typeof companyLogoSrc === \"string\") return companyLogoSrc\r\n return URL.createObjectURL(companyLogoSrc)\r\n }, [companyLogoSrc])\r\n\r\n return (\r\n <div\r\n className={cn(profileAvatarVariants({ size, className }))}\r\n data-slot=\"profile-avatar\"\r\n {...props}\r\n >\r\n <Comp\r\n className={cn(\r\n \"rounded-xp-card-base\",\r\n bordered\r\n ? cn(\r\n status === \"open-to-work\" && \"bg-gradient-avatar-outline-opentowork\",\r\n status === \"open-to-freelance\" && \"bg-gradient-avatar-outline-opentoprofesional\",\r\n status === \"open-to-coach\" && \"bg-gradient-avatar-outline-opentocoach\",\r\n status === \"open-to-all\" && \"bg-gradient-avatar-outline-opentowork\",\r\n !status && variant === \"profile\" && \"bg-border-secondary\"\r\n )\r\n : undefined,\r\n bordered && variant === \"profile\" && profileAvatarPaddingVariants({ size })\r\n )}\r\n >\r\n <div className=\"relative group\">\r\n <Avatar\r\n className={cn(\r\n bordered && hasActiveStatus && \"border-0\",\r\n avatarClassName\r\n )}\r\n size={size}\r\n onClick={onClickAvatar}\r\n >\r\n <AvatarImage\r\n alt={imageAlt}\r\n className={cn(\"bg-bg-primary object-cover\", avatarImageClassName)}\r\n src={normalizedImageSrc}\r\n />\r\n {fallbackText ? (\r\n <AvatarFallback\r\n render={\r\n <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\">\r\n {fallbackText}\r\n </div>\r\n }\r\n />\r\n ) : (\r\n <AvatarFallback\r\n render={\r\n // eslint-disable-next-line @next/next/no-img-element\r\n <img\r\n alt={imageAlt || \"Avatar Fallback\"}\r\n className=\"aspect-square size-full bg-bg-primary object-cover\"\r\n src={fallbackImage}\r\n />\r\n }\r\n />\r\n )}\r\n </Avatar>\r\n\r\n {onEdit && (\r\n <div\r\n 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\"\r\n id=\"avatar-upload-trigger\"\r\n onClick={onEdit}\r\n >\r\n <div className=\"flex items-center p-2 hover:bg-background-primary-subtle-hover justify-center rounded-xp-card-base-sm bg-background-canvas-subtle\">\r\n <UploadPicturesOnProfileIcon className=\"size-6\" />\r\n </div>\r\n </div>\r\n )}\r\n {isOnline && !normalizedCompanyLogoSrc && (\r\n <CircleIcon className=\"text-bg-primary-replace fill-fg-success-secondary size-[11.5px] absolute -bottom-[3.5px] -right-[3.5px]\" />\r\n )}\r\n {normalizedCompanyLogoSrc !== undefined && (\r\n <Avatar className=\"border border-bg-primary-replace size-[15px] rounded-xs absolute -bottom-[3.5px] -right-[3.5px]\">\r\n <AvatarImage\r\n alt=\"Company Logo\"\r\n className=\"bg-bg-primary object-cover\"\r\n src={normalizedCompanyLogoSrc}\r\n />\r\n <AvatarFallback\r\n render={\r\n // eslint-disable-next-line @next/next/no-img-element\r\n <img\r\n alt=\"Company Logo Fallback\"\r\n className=\"aspect-square size-full bg-bg-primary object-cover\"\r\n src=\"/images/fallback-company.jpeg\"\r\n />\r\n }\r\n />\r\n </Avatar>\r\n )}\r\n </div>\r\n </Comp>\r\n {badged &&\r\n activeStatus && (\r\n <Badge\r\n className={cn(profileAvatarBadgeVariants({ size, className: badgeClassName }))}\r\n color={activeStatus.badgeColor}\r\n size=\"sm\"\r\n >\r\n {activeStatus.label}\r\n </Badge>\r\n )}\r\n\r\n {isVerified && (\r\n <div className=\"absolute -bottom-1 -right-1\">\r\n <VerifiedIcon className=\"size-4 text-[#068BEE]\" />\r\n </div>\r\n )}\r\n </div>\r\n )\r\n}\r\n\r\nexport { ProfileAvatar }\r\n"]}
1
+ {"version":3,"sources":["../src/composites/profile-avatar.tsx"],"names":["profileAvatarStatus","profileAvatarVariants","cva","profileAvatarBadgeVariants","profileAvatarPaddingVariants","ProfileAvatar","avatarClassName","badgeClassName","imageSrc","avatarImageClassName","imageAlt","className","status","size","isVerified","onEdit","onClickAvatar","variant","isOnline","companyLogoSrc","bordered","badged","fallbackText","props","activeStatus","s","hasActiveStatus","Comp","Slot","fallbackImage","normalizedImageSrc","normalizedCompanyLogoSrc","jsxs","cn","jsx","Avatar","AvatarImage","AvatarFallback","upload_pictures_on_profile_icon_default","CircleIcon","Badge","verified_icon_default"],"mappings":"6XAuBA,IAAMA,CAAAA,CAIA,CACF,CACE,MAAA,CAAQ,aAAA,CACR,KAAA,CAAO,2BAAA,CACP,UAAA,CAAY,MACd,CAAA,CACA,CACE,MAAA,CAAQ,cAAA,CACR,KAAA,CAAO,cAAA,CACP,UAAA,CAAY,SACd,CAAA,CACA,CACE,MAAA,CAAQ,mBAAA,CACR,KAAA,CAAO,mBAAA,CACP,UAAA,CAAY,SACd,CAAA,CACA,CACE,MAAA,CAAQ,eAAA,CACR,KAAA,CAAO,eAAA,CACP,UAAA,CAAY,YACd,CACF,CAAA,CAEIC,CAAAA,CAAwBC,GAAAA,CAAI,qCAAA,CAAuC,CACvE,QAAA,CAAU,CACR,IAAA,CAAM,CACJ,EAAA,CAAI,aAAA,CACJ,EAAA,CAAI,aAAA,CACJ,EAAA,CAAI,cAAA,CACJ,EAAA,CAAI,YAAA,CACJ,EAAA,CAAI,YAAA,CACJ,KAAA,CAAO,YAAA,CACP,KAAA,CAAO,YACT,CACF,CAAA,CACA,eAAA,CAAiB,CACf,IAAA,CAAM,IACR,CACF,CAAC,CAAA,CAEKC,CAAAA,CAA6BD,GAAAA,CAAI,MAAA,CAAW,CAChD,QAAA,CAAU,CACR,IAAA,CAAM,CACJ,EAAA,CAAI,8CAAA,CACJ,EAAA,CAAI,gDAAA,CACJ,EAAA,CAAI,i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AAU,QAAA,CAAS,CAAA,CAClD,CAAA,CACF,CAAA,CAEDpB,CAAAA,EAAY,CAACa,CAAAA,EACZG,GAAAA,CAACK,UAAAA,CAAA,CAAW,SAAA,CAAU,yGAAA,CAA0G,CAAA,CAEjIR,CAAAA,GAA6B,MAAA,EAC5BC,IAAAA,CAACG,CAAAA,CAAA,CAAO,SAAA,CAAU,iGAAA,CAChB,UAAAD,GAAAA,CAACE,CAAAA,CAAA,CACC,GAAA,CAAI,cAAA,CACJ,SAAA,CAAU,4BAAA,CACV,GAAA,CAAKL,CAAAA,CACP,CAAA,CACAG,GAAAA,CAACG,CAAAA,CAAA,CACC,MAAA,CAEEH,GAAAA,CAAC,KAAA,CAAA,CACC,GAAA,CAAI,uBAAA,CACJ,SAAA,CAAU,oDAAA,CACV,GAAA,CAAI,+BAAA,CACN,CAAA,CAEJ,CAAA,CAAA,CACF,CAAA,CAAA,CAEJ,CAAA,CACF,CAAA,CACCb,CAAAA,EACCG,GAAAA,EACEU,GAAAA,CAACM,GAAAA,CAAA,CACC,SAAA,CAAWP,EAAAA,CAAG9B,CAAAA,CAA2B,CAAE,IAAA,CAAAU,CAAAA,CAAM,SAAA,CAAWN,CAAe,CAAC,CAAC,CAAA,CAC7E,KAAA,CAAOiB,GAAAA,CAAa,UAAA,CACpB,IAAA,CAAK,IAAA,CAEJ,QAAA,CAAAA,GAAAA,CAAa,KAAA,CAChB,CAAA,CAGHV,CAAAA,EACCoB,GAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,6BAAA,CACb,QAAA,CAAAA,GAAAA,CAACO,GAAAA,CAAA,CAAa,SAAA,CAAU,uBAAA,CAAwB,CAAA,CAClD,GAEJ,CAEJ","file":"chunk-3P3UZZ57.js","sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\n\r\nimport { Slot } from \"@radix-ui/react-slot\"\r\nimport { cva, type VariantProps } from \"class-variance-authority\"\r\nimport { CircleIcon } from \"lucide-react\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\n\r\nimport { UploadPicturesOnProfileIcon, VerifiedIcon } from \"../icons\"\r\nimport { Avatar, AvatarFallback, AvatarImage } from \"../ui/avatar\"\r\nimport { Badge } from \"../ui/badge\"\r\n\r\nexport type ProfileAvatarStatus =\r\n | \"open-to-all\"\r\n | \"open-to-work\"\r\n | \"open-to-freelance\"\r\n | \"open-to-coach\"\r\n | undefined\r\n\r\nexport type ProfileAvatarVariant = \"profile\" | \"company\" | \"university\" | \"group\"\r\n\r\nconst profileAvatarStatus: {\r\n status: ProfileAvatarStatus\r\n label: string\r\n badgeColor?: React.ComponentProps<typeof Badge>[\"color\"]\r\n}[] = [\r\n {\r\n status: \"open-to-all\",\r\n label: \"Open to All Opportunities\",\r\n badgeColor: \"gray\",\r\n },\r\n {\r\n status: \"open-to-work\",\r\n label: \"Open to Work\",\r\n badgeColor: \"success\",\r\n },\r\n {\r\n status: \"open-to-freelance\",\r\n label: \"Open to Freelance\",\r\n badgeColor: \"warning\",\r\n },\r\n {\r\n status: \"open-to-coach\",\r\n label: \"Open to Coach\",\r\n badgeColor: \"blue-light\",\r\n },\r\n ]\r\n\r\nconst profileAvatarVariants = cva(\"flex flex-col items-center relative\", {\r\n variants: {\r\n size: {\r\n xs: \"gap-0.5 w-6\",\r\n sm: \"gap-0.5 w-8\",\r\n md: \"gap-0.5 w-10\",\r\n lg: \"gap-1 w-12\",\r\n xl: \"gap-1 w-14\",\r\n \"2xl\": \"gap-2 w-16\",\r\n \"3xl\": \"gap-2 w-20\",\r\n },\r\n },\r\n defaultVariants: {\r\n size: \"sm\",\r\n },\r\n})\r\n\r\nconst profileAvatarBadgeVariants = cva(undefined, {\r\n variants: {\r\n size: {\r\n xs: \"p-0.5 h-2 font-semibold text-[5px] leading-2\",\r\n sm: \"p-1 h-2.5 font-semibold text-[6px] leading-2.5\",\r\n md: \"px-1 h-3.5 font-semibold text-[6px] leading-2.5\",\r\n lg: \"px-1 h-4 text-body-semibold-caption\",\r\n xl: \"px-1 h-6 text-body-semibold-xs\",\r\n \"2xl\": \"px-2 h-9 text-body-semibold-sm\",\r\n \"3xl\": \"px-2 h-10 text-label-semibold-4\",\r\n },\r\n },\r\n defaultVariants: {\r\n size: \"sm\",\r\n },\r\n})\r\n\r\nconst profileAvatarPaddingVariants = cva(undefined, {\r\n variants: {\r\n size: {\r\n xs: \"p-[1.5px]\",\r\n sm: \"p-xp-xxs\",\r\n md: \"p-[2.5px]\",\r\n lg: \"p-xp-xs\",\r\n xl: \"p-[3.5px]\",\r\n \"2xl\": \"p-1\",\r\n \"3xl\": \"p-1\",\r\n },\r\n },\r\n defaultVariants: {\r\n size: \"sm\",\r\n },\r\n})\r\n\r\nfunction ProfileAvatar({\r\n avatarClassName,\r\n badgeClassName,\r\n imageSrc,\r\n avatarImageClassName,\r\n imageAlt,\r\n className,\r\n status,\r\n size,\r\n isVerified,\r\n onEdit,\r\n onClickAvatar,\r\n variant = \"profile\",\r\n isOnline,\r\n companyLogoSrc,\r\n bordered = true,\r\n badged = false,\r\n fallbackText,\r\n ...props\r\n}: React.ComponentProps<\"div\"> & {\r\n avatarClassName?: string\r\n badgeClassName?: string\r\n imageSrc?: string | Blob\r\n imageAlt?: string\r\n isVerified?: boolean\r\n avatarImageClassName?: string\r\n size?: VariantProps<typeof profileAvatarVariants>[\"size\"]\r\n status?: ProfileAvatarStatus\r\n onEdit?: () => void\r\n onClickAvatar?: () => void\r\n variant?: ProfileAvatarVariant\r\n isOnline?: boolean\r\n companyLogoSrc?: string | Blob\r\n bordered?: boolean\r\n badged?: boolean\r\n fallbackText?: string\r\n}) {\r\n const activeStatus = React.useMemo(() => {\r\n return profileAvatarStatus.find((s) => s.status === status)\r\n }, [status])\r\n\r\n const hasActiveStatus = !!status\r\n const Comp = bordered && hasActiveStatus && variant === \"profile\" ? \"div\" : Slot\r\n\r\n const fallbackImage = React.useMemo(() => {\r\n switch (variant) {\r\n case \"company\":\r\n return \"/images/fallback-company.jpeg\"\r\n case \"university\":\r\n return \"/images/fallback-university.jpeg\"\r\n case \"group\":\r\n return \"/images/fallback-user-group.jpeg\"\r\n default:\r\n return \"/images/fallback-user.jpeg\"\r\n }\r\n }, [variant])\r\n\r\n const normalizedImageSrc = React.useMemo(() => {\r\n if (!imageSrc) return undefined\r\n if (typeof imageSrc === \"string\") return imageSrc\r\n return URL.createObjectURL(imageSrc)\r\n }, [imageSrc])\r\n\r\n const normalizedCompanyLogoSrc = React.useMemo(() => {\r\n if (!companyLogoSrc) return undefined\r\n if (typeof companyLogoSrc === \"string\") return companyLogoSrc\r\n return URL.createObjectURL(companyLogoSrc)\r\n }, [companyLogoSrc])\r\n\r\n return (\r\n <div\r\n className={cn(profileAvatarVariants({ size, className }))}\r\n data-slot=\"profile-avatar\"\r\n {...props}\r\n >\r\n <Comp\r\n className={cn(\r\n \"rounded-xp-card-base\",\r\n bordered\r\n ? cn(\r\n status === \"open-to-work\" && \"bg-gradient-avatar-outline-opentowork\",\r\n status === \"open-to-freelance\" && \"bg-gradient-avatar-outline-opentoprofesional\",\r\n status === \"open-to-coach\" && \"bg-gradient-avatar-outline-opentocoach\",\r\n status === \"open-to-all\" && \"bg-gradient-avatar-outline-opentowork\",\r\n !status && variant === \"profile\" && \"bg-border-secondary\"\r\n )\r\n : undefined,\r\n bordered && variant === \"profile\" && profileAvatarPaddingVariants({ size })\r\n )}\r\n >\r\n <div className=\"relative group size-full\">\r\n <Avatar\r\n className={cn(\r\n bordered && hasActiveStatus && \"border-0\",\r\n avatarClassName\r\n )}\r\n size={size}\r\n onClick={onClickAvatar}\r\n >\r\n <AvatarImage\r\n alt={imageAlt}\r\n className={cn(\"size-full bg-bg-primary object-cover\", avatarImageClassName)}\r\n src={normalizedImageSrc}\r\n />\r\n {fallbackText ? (\r\n <AvatarFallback\r\n render={\r\n <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\">\r\n {fallbackText}\r\n </div>\r\n }\r\n />\r\n ) : (\r\n <AvatarFallback\r\n render={\r\n // eslint-disable-next-line @next/next/no-img-element\r\n <img\r\n alt={imageAlt || \"Avatar Fallback\"}\r\n className=\"aspect-square size-full bg-bg-primary object-cover\"\r\n src={fallbackImage}\r\n />\r\n }\r\n />\r\n )}\r\n </Avatar>\r\n\r\n {onEdit && (\r\n <div\r\n 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\"\r\n id=\"avatar-upload-trigger\"\r\n onClick={onEdit}\r\n >\r\n <div className=\"flex items-center p-2 hover:bg-background-primary-subtle-hover justify-center rounded-xp-card-base-sm bg-background-canvas-subtle\">\r\n <UploadPicturesOnProfileIcon className=\"size-6\" />\r\n </div>\r\n </div>\r\n )}\r\n {isOnline && !normalizedCompanyLogoSrc && (\r\n <CircleIcon className=\"text-bg-primary-replace fill-fg-success-secondary size-[11.5px] absolute -bottom-[3.5px] -right-[3.5px]\" />\r\n )}\r\n {normalizedCompanyLogoSrc !== undefined && (\r\n <Avatar className=\"border border-bg-primary-replace size-[15px] rounded-xs absolute -bottom-[3.5px] -right-[3.5px]\">\r\n <AvatarImage\r\n alt=\"Company Logo\"\r\n className=\"bg-bg-primary object-cover\"\r\n src={normalizedCompanyLogoSrc}\r\n />\r\n <AvatarFallback\r\n render={\r\n // eslint-disable-next-line @next/next/no-img-element\r\n <img\r\n alt=\"Company Logo Fallback\"\r\n className=\"aspect-square size-full bg-bg-primary object-cover\"\r\n src=\"/images/fallback-company.jpeg\"\r\n />\r\n }\r\n />\r\n </Avatar>\r\n )}\r\n </div>\r\n </Comp>\r\n {badged &&\r\n activeStatus && (\r\n <Badge\r\n className={cn(profileAvatarBadgeVariants({ size, className: badgeClassName }))}\r\n color={activeStatus.badgeColor}\r\n size=\"sm\"\r\n >\r\n {activeStatus.label}\r\n </Badge>\r\n )}\r\n\r\n {isVerified && (\r\n <div className=\"absolute -bottom-1 -right-1\">\r\n <VerifiedIcon className=\"size-4 text-[#068BEE]\" />\r\n </div>\r\n )}\r\n </div>\r\n )\r\n}\r\n\r\nexport { ProfileAvatar }\r\n"]}
@@ -1,2 +1,2 @@
1
- import {a,b,m,e,q,s,w,x,H}from'./chunk-DUSAF7E7.js';import*as d from'react';import {ChevronDownIcon}from'lucide-react';import {cn}from'@xploreu/lib/cn';import {useControlledState}from'@xploreu/hooks/use-controlled-state';import {jsxs,jsx}from'react/jsx-runtime';function U({multiple:c,items:t,placeholder:a$1="Select",icon:C,container:N,isPending:T,className:L,triggerClassName:R,contentClassName:k,disabled:A,infiniteScroll:q$1,...n}){let r=c===true,M=n.showTitle??r,b$1=n.showSearch??r,[i,g]=useControlledState({value:n.value,defaultValue:n.defaultValue??(r?[]:null),onChange:n.onValueChange}),[u,$]=d.useState(""),x$1=Array.isArray(i)?i:i?[i]:[],l=x$1.length>0,B=x$1.length,z=l?r?`${a$1} (${B})`:x$1[0]?.label??a$1:r?`All ${a$1}`:a$1,D=()=>{g(r?[]:null);},f=d.useMemo(()=>{if(!b$1||!u.trim())return t;let o=u.toLowerCase();return t?.filter(p=>p.label.toLowerCase().includes(o)||p.value.toLowerCase().includes(o))},[t,u,b$1]);return jsxs(a,{items:t,multiple:c,value:i,onValueChange:g,isItemEqualToValue:(o,p)=>o.value===p.value,disabled:A,children:[jsxs(b,{className:cn("group flex h-9 w-fit max-w-[220px] items-center gap-2 rounded-xp-card-base border bg-bg-primary px-3 text-body-medium-3 transition-colors","border-border-primary text-text-secondary hover:bg-bg-primary-hover",l&&"border-border-brand bg-bg-brand-primary text-text-brand-secondary hover:bg-bg-brand-primary-hover-alt","disabled:pointer-events-none disabled:opacity-50","data-[popup-open]:border-border-brand data-[popup-open]:bg-bg-brand-primary data-[popup-open]:text-text-brand-secondary",R,L),children:[C&&jsx("span",{className:cn("size-4 shrink-0 group-data-[popup-open]:text-fg-brand-primary",l?"text-fg-brand-primary":"text-fg-quaternary"),children:C}),jsx("span",{className:"truncate",children:z}),jsx(ChevronDownIcon,{className:cn("size-4 shrink-0 transition-transform group-data-[popup-open]:rotate-180 group-data-[popup-open]:text-fg-brand-primary",l?"text-fg-brand-primary":"text-fg-quaternary")})]}),jsx(m,{container:N,className:cn("w-72",k),align:"start",sideOffset:8,children:jsxs("div",{className:"flex flex-col",children:[M&&jsxs("div",{className:"flex items-center justify-between p-3 border-b border-border-primary",children:[jsx("span",{className:"text-label-semibold-3 text-text-primary",children:a$1}),jsx("button",{type:"button",disabled:!l,onClick:D,className:cn("text-label-semibold-3 transition-colors",l?"cursor-pointer text-text-error-primary hover:text-text-error-primary-hover":"cursor-not-allowed text-text-disabled"),children:"Clear All"})]}),b$1&&jsx(e,{value:u,onChange:o=>$(o.target.value),placeholder:`Search ${a$1.toLowerCase()}...`}),jsx(q,{status:T||t===void 0?"pending":(b$1?f:t)?.length===0?"empty":null}),jsxs(s,{children:[(b$1?f:t)?.map(o=>jsx(w,{indicator:r?"checkbox":void 0,value:o,children:jsx(x,{children:o.label})},o.value)),jsx(H,{...q$1})]})]})})]})}export{U as a};//# sourceMappingURL=chunk-GI2M7Q4F.js.map
2
- //# sourceMappingURL=chunk-GI2M7Q4F.js.map
1
+ import {a,b,m,e,q,s,w,x,H}from'./chunk-AE72UPV5.js';import*as d from'react';import {ChevronDownIcon}from'lucide-react';import {cn}from'@xploreu/lib/cn';import {useControlledState}from'@xploreu/hooks/use-controlled-state';import {jsxs,jsx}from'react/jsx-runtime';function U({multiple:c,items:t,placeholder:a$1="Select",icon:C,container:N,isPending:T,className:L,triggerClassName:R,contentClassName:k,disabled:A,infiniteScroll:q$1,...n}){let r=c===true,M=n.showTitle??r,b$1=n.showSearch??r,[i,g]=useControlledState({value:n.value,defaultValue:n.defaultValue??(r?[]:null),onChange:n.onValueChange}),[u,$]=d.useState(""),x$1=Array.isArray(i)?i:i?[i]:[],l=x$1.length>0,B=x$1.length,z=l?r?`${a$1} (${B})`:x$1[0]?.label??a$1:r?`All ${a$1}`:a$1,D=()=>{g(r?[]:null);},f=d.useMemo(()=>{if(!b$1||!u.trim())return t;let o=u.toLowerCase();return t?.filter(p=>p.label.toLowerCase().includes(o)||p.value.toLowerCase().includes(o))},[t,u,b$1]);return jsxs(a,{items:t,multiple:c,value:i,onValueChange:g,isItemEqualToValue:(o,p)=>o.value===p.value,disabled:A,children:[jsxs(b,{className:cn("group flex h-9 w-fit max-w-[220px] items-center gap-2 rounded-xp-card-base border bg-bg-primary px-3 text-body-medium-3 transition-colors","border-border-primary text-text-secondary hover:bg-bg-primary-hover",l&&"border-border-brand bg-bg-brand-primary text-text-brand-secondary hover:bg-bg-brand-primary-hover-alt","disabled:pointer-events-none disabled:opacity-50","data-[popup-open]:border-border-brand data-[popup-open]:bg-bg-brand-primary data-[popup-open]:text-text-brand-secondary",R,L),children:[C&&jsx("span",{className:cn("size-4 shrink-0 group-data-[popup-open]:text-fg-brand-primary",l?"text-fg-brand-primary":"text-fg-quaternary"),children:C}),jsx("span",{className:"truncate",children:z}),jsx(ChevronDownIcon,{className:cn("size-4 shrink-0 transition-transform group-data-[popup-open]:rotate-180 group-data-[popup-open]:text-fg-brand-primary",l?"text-fg-brand-primary":"text-fg-quaternary")})]}),jsx(m,{container:N,className:cn("w-72",k),align:"start",sideOffset:8,children:jsxs("div",{className:"flex flex-col",children:[M&&jsxs("div",{className:"flex items-center justify-between p-3 border-b border-border-primary",children:[jsx("span",{className:"text-label-semibold-3 text-text-primary",children:a$1}),jsx("button",{type:"button",disabled:!l,onClick:D,className:cn("text-label-semibold-3 transition-colors",l?"cursor-pointer text-text-error-primary hover:text-text-error-primary-hover":"cursor-not-allowed text-text-disabled"),children:"Clear All"})]}),b$1&&jsx(e,{value:u,onChange:o=>$(o.target.value),placeholder:`Search ${a$1.toLowerCase()}...`}),jsx(q,{status:T||t===void 0?"pending":(b$1?f:t)?.length===0?"empty":null}),jsxs(s,{children:[(b$1?f:t)?.map(o=>jsx(w,{indicator:r?"checkbox":void 0,value:o,children:jsx(x,{children:o.label})},o.value)),jsx(H,{...q$1})]})]})})]})}export{U as a};//# sourceMappingURL=chunk-5S2M7FXU.js.map
2
+ //# sourceMappingURL=chunk-5S2M7FXU.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/composites/filter-combobox.tsx"],"names":["FilterCombobox","multiple","items","placeholder","icon","container","isPending","className","triggerClassName","contentClassName","disabled","infiniteScroll","props","isMultiple","showTitle","showSearch","value","setValue","useControlledState","search","setSearch","valueArray","hasValue","count","triggerLabel","handleClear","filteredItems","q","it","jsxs","Combobox","a","b","ComboboxTrigger","cn","jsx","ChevronDownIcon","ComboboxPopup","ComboboxInput","e","ComboboxStatus","ComboboxList","item","ComboboxItem","ComboboxItemTitle","ComboboxInfiniteScroll"],"mappings":"sQA6DA,SAASA,EAAe,CACtB,QAAA,CAAAC,EACA,KAAA,CAAAC,CAAAA,CACA,YAAAC,GAAAA,CAAc,QAAA,CACd,KAAAC,CAAAA,CACA,SAAA,CAAAC,EACA,SAAA,CAAAC,CAAAA,CACA,UAAAC,CAAAA,CACA,gBAAA,CAAAC,EACA,gBAAA,CAAAC,CAAAA,CACA,SAAAC,CAAAA,CACA,cAAA,CAAAC,IACA,GAAGC,CACL,EAAwB,CAEtB,IAAMC,EAAaZ,CAAAA,GAAa,IAAA,CAC1Ba,EAAYF,CAAAA,CAAM,SAAA,EAAaC,EAC/BE,GAAAA,CAAaH,CAAAA,CAAM,YAAcC,CAAAA,CAEjC,CAACG,EAAOC,CAAQ,CAAA,CAAIC,mBAAwC,CAChE,KAAA,CAAON,EAAM,KAAA,CACb,YAAA,CAAcA,EAAM,YAAA,GAAiBC,CAAAA,CAAa,EAAC,CAAI,IAAA,CAAA,CACvD,SAAUD,CAAAA,CAAM,aAClB,CAAC,CAAA,CAEK,CAACO,EAAQC,CAAS,CAAA,CAAU,WAAS,EAAE,CAAA,CAGvCC,IAAa,KAAA,CAAM,OAAA,CAAQL,CAAK,CAAA,CAAIA,CAAAA,CAAQA,EAAQ,C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CAEV,EACA2B,IAAAA,CAACY,CAAAA,CAAA,CACG,QAAA,CAAA,CAAA,CAAA1B,GAAAA,CAAaW,EAAgBxB,CAAAA,GAAQ,GAAA,CAAKwC,GAC1CP,GAAAA,CAACQ,CAAAA,CAAA,CACC,SAAA,CAAW9B,CAAAA,CAAa,WAAa,MAAA,CAErC,KAAA,CAAO6B,EAEP,QAAA,CAAAP,GAAAA,CAACS,EAAA,CAAmB,QAAA,CAAAF,EAAK,KAAA,CAAM,CAAA,CAAA,CAH1BA,EAAK,KAIZ,CACD,EACDP,GAAAA,CAACU,CAAAA,CAAA,CAAwB,GAAGlC,GAAAA,CAAgB,GAC9C,CAAA,CAAA,CACF,CAAA,CACF,GACF,CAEJ","file":"chunk-GI2M7Q4F.js","sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\nimport { ChevronDownIcon } from \"lucide-react\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\nimport { useControlledState } from \"@xploreu/hooks/use-controlled-state\"\r\nimport { ComboboxItem, ComboboxItemTitle } from \"../ui/combobox\"\r\nimport {\r\n Combobox,\r\n ComboboxInfiniteScroll,\r\n ComboboxInput,\r\n ComboboxList,\r\n ComboboxPopup,\r\n ComboboxPortal,\r\n ComboboxStatus,\r\n ComboboxTrigger\r\n} from \"../ui/combobox\"\r\n\r\n// ─── Types ───\r\n\r\nexport type FilterComboboxItem = {\r\n label: string\r\n value: string\r\n}\r\n\r\ntype FilterComboboxValue = FilterComboboxItem | FilterComboboxItem[] | null\r\n\r\ntype BaseProps = {\r\n items: FilterComboboxItem[] | undefined\r\n placeholder?: string\r\n icon?: React.ReactNode\r\n container?: React.ComponentProps<typeof ComboboxPortal>[\"container\"]\r\n isPending?: boolean\r\n className?: string\r\n triggerClassName?: string\r\n contentClassName?: string\r\n disabled?: boolean\r\n infiniteScroll?: React.ComponentProps<typeof ComboboxInfiniteScroll>\r\n showTitle?: boolean\r\n showSearch?: boolean\r\n}\r\n\r\ntype SingleProps = BaseProps & {\r\n multiple?: false\r\n value?: FilterComboboxItem | null\r\n defaultValue?: FilterComboboxItem | null\r\n onValueChange?: (value: FilterComboboxItem | null) => void\r\n}\r\n\r\ntype MultipleProps = BaseProps & {\r\n multiple: true\r\n value?: FilterComboboxItem[]\r\n defaultValue?: FilterComboboxItem[]\r\n onValueChange?: (value: FilterComboboxItem[]) => void\r\n}\r\n\r\nexport type FilterComboboxProps = SingleProps | MultipleProps\r\n\r\n// ─── Component ───\r\n\r\nfunction FilterCombobox({\r\n multiple,\r\n items,\r\n placeholder = \"Select\",\r\n icon,\r\n container,\r\n isPending,\r\n className,\r\n triggerClassName,\r\n contentClassName,\r\n disabled,\r\n infiniteScroll,\r\n ...props\r\n}: FilterComboboxProps) {\r\n\r\n const isMultiple = multiple === true\r\n const showTitle = props.showTitle ?? isMultiple\r\n const showSearch = props.showSearch ?? isMultiple\r\n\r\n const [value, setValue] = useControlledState<FilterComboboxValue>({\r\n value: props.value,\r\n defaultValue: props.defaultValue ?? (isMultiple ? [] : null),\r\n onChange: props.onValueChange as (value: FilterComboboxValue) => void,\r\n })\r\n\r\n const [search, setSearch] = React.useState(\"\")\r\n\r\n // Normalize value to array for label & clear logic\r\n const valueArray = Array.isArray(value) ? value : value ? [value] : []\r\n const hasValue = valueArray.length > 0\r\n const count = valueArray.length\r\n\r\n const triggerLabel = !hasValue\r\n ? isMultiple\r\n ? `All ${placeholder}`\r\n : placeholder\r\n : isMultiple\r\n ? `${placeholder} (${count})`\r\n : valueArray[0]?.label ?? placeholder\r\n\r\n const handleClear = () => {\r\n setValue(isMultiple ? [] : null)\r\n }\r\n\r\n // Filter items when showSearch is enabled\r\n const filteredItems = React.useMemo(() => {\r\n if (!showSearch || !search.trim()) return items\r\n const q = search.toLowerCase()\r\n return items?.filter(\r\n (it) => it.label.toLowerCase().includes(q) || it.value.toLowerCase().includes(q)\r\n )\r\n }, [items, search, showSearch])\r\n\r\n return (\r\n <Combobox\r\n items={items}\r\n multiple={multiple}\r\n value={value}\r\n onValueChange={setValue}\r\n isItemEqualToValue={(a, b) => a.value === b.value}\r\n disabled={disabled}\r\n >\r\n <ComboboxTrigger\r\n className={cn(\r\n \"group flex h-9 w-fit max-w-[220px] items-center gap-2 rounded-xp-card-base border bg-bg-primary px-3 text-body-medium-3 transition-colors\",\r\n \"border-border-primary text-text-secondary hover:bg-bg-primary-hover\",\r\n hasValue && \"border-border-brand bg-bg-brand-primary text-text-brand-secondary hover:bg-bg-brand-primary-hover-alt\",\r\n \"disabled:pointer-events-none disabled:opacity-50\",\r\n \"data-[popup-open]:border-border-brand data-[popup-open]:bg-bg-brand-primary data-[popup-open]:text-text-brand-secondary\",\r\n triggerClassName,\r\n className\r\n )}\r\n >\r\n {icon && (\r\n <span\r\n className={cn(\r\n \"size-4 shrink-0 group-data-[popup-open]:text-fg-brand-primary\",\r\n hasValue ? \"text-fg-brand-primary\" : \"text-fg-quaternary\"\r\n )}\r\n >\r\n {icon}\r\n </span>\r\n )}\r\n <span className=\"truncate\">{triggerLabel}</span>\r\n <ChevronDownIcon\r\n className={cn(\r\n \"size-4 shrink-0 transition-transform group-data-[popup-open]:rotate-180 group-data-[popup-open]:text-fg-brand-primary\",\r\n hasValue ? \"text-fg-brand-primary\" : \"text-fg-quaternary\"\r\n )}\r\n />\r\n </ComboboxTrigger>\r\n\r\n <ComboboxPopup\r\n container={container}\r\n className={cn(\"w-72\", contentClassName)}\r\n align=\"start\"\r\n sideOffset={8}\r\n >\r\n <div className=\"flex flex-col\">\r\n {showTitle && (\r\n <div className=\"flex items-center justify-between p-3 border-b border-border-primary\">\r\n <span className=\"text-label-semibold-3 text-text-primary\">{placeholder}</span>\r\n <button\r\n type=\"button\"\r\n disabled={!hasValue}\r\n onClick={handleClear}\r\n className={cn(\r\n \"text-label-semibold-3 transition-colors\",\r\n hasValue\r\n ? \"cursor-pointer text-text-error-primary hover:text-text-error-primary-hover\"\r\n : \"cursor-not-allowed text-text-disabled\"\r\n )}\r\n >\r\n Clear All\r\n </button>\r\n </div>\r\n )}\r\n\r\n {showSearch && (\r\n <ComboboxInput\r\n value={search}\r\n onChange={(e) => setSearch(e.target.value)}\r\n placeholder={`Search ${placeholder.toLowerCase()}...`}\r\n />\r\n )}\r\n\r\n <ComboboxStatus\r\n status={\r\n isPending || items === undefined\r\n ? \"pending\"\r\n : (showSearch ? filteredItems : items)?.length === 0\r\n ? \"empty\"\r\n : null\r\n }\r\n />\r\n <ComboboxList>\r\n {(showSearch ? filteredItems : items)?.map((item) => (\r\n <ComboboxItem\r\n indicator={isMultiple ? \"checkbox\" : undefined}\r\n key={item.value}\r\n value={item}\r\n >\r\n <ComboboxItemTitle>{item.label}</ComboboxItemTitle>\r\n </ComboboxItem>\r\n ))}\r\n <ComboboxInfiniteScroll {...infiniteScroll} />\r\n </ComboboxList>\r\n </div>\r\n </ComboboxPopup>\r\n </Combobox>\r\n )\r\n}\r\n\r\nexport { FilterCombobox }\r\n"]}
1
+ {"version":3,"sources":["../src/composites/filter-combobox.tsx"],"names":["FilterCombobox","multiple","items","placeholder","icon","container","isPending","className","triggerClassName","contentClassName","disabled","infiniteScroll","props","isMultiple","showTitle","showSearch","value","setValue","useControlledState","search","setSearch","valueArray","hasValue","count","triggerLabel","handleClear","filteredItems","q","it","jsxs","Combobox","a","b","ComboboxTrigger","cn","jsx","ChevronDownIcon","ComboboxPopup","ComboboxInput","e","ComboboxStatus","ComboboxList","item","ComboboxItem","ComboboxItemTitle","ComboboxInfiniteScroll"],"mappings":"sQA6DA,SAASA,EAAe,CACtB,QAAA,CAAAC,EACA,KAAA,CAAAC,CAAAA,CACA,YAAAC,GAAAA,CAAc,QAAA,CACd,KAAAC,CAAAA,CACA,SAAA,CAAAC,EACA,SAAA,CAAAC,CAAAA,CACA,UAAAC,CAAAA,CACA,gBAAA,CAAAC,EACA,gBAAA,CAAAC,CAAAA,CACA,SAAAC,CAAAA,CACA,cAAA,CAAAC,IACA,GAAGC,CACL,EAAwB,CAEtB,IAAMC,EAAaZ,CAA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A,CACA,uCACN,EACD,QAAA,CAAA,WAAA,CAED,CAAA,CAAA,CACF,EAGDP,GAAAA,EACCoB,GAAAA,CAACG,EAAA,CACC,KAAA,CAAOnB,EACP,QAAA,CAAWoB,CAAAA,EAAMnB,EAAUmB,CAAAA,CAAE,MAAA,CAAO,KAAK,CAAA,CACzC,WAAA,CAAa,UAAUpC,GAAAA,CAAY,WAAA,EAAa,CAAA,GAAA,CAAA,CAClD,CAAA,CAGFgC,IAACK,CAAAA,CAAA,CACC,OACElC,CAAAA,EAAaJ,CAAAA,GAAU,OACnB,SAAA,CAAA,CACCa,GAAAA,CAAaW,EAAgBxB,CAAAA,GAAQ,MAAA,GAAW,EAC/C,OAAA,CACA,IAAA,CAEV,EACA2B,IAAAA,CAACY,CAAAA,CAAA,CACG,QAAA,CAAA,CAAA,CAAA1B,GAAAA,CAAaW,EAAgBxB,CAAAA,GAAQ,GAAA,CAAKwC,GAC1CP,GAAAA,CAACQ,CAAAA,CAAA,CACC,SAAA,CAAW9B,CAAAA,CAAa,WAAa,MAAA,CAErC,KAAA,CAAO6B,EAEP,QAAA,CAAAP,GAAAA,CAACS,EAAA,CAAmB,QAAA,CAAAF,EAAK,KAAA,CAAM,CAAA,CAAA,CAH1BA,EAAK,KAIZ,CACD,EACDP,GAAAA,CAACU,CAAAA,CAAA,CAAwB,GAAGlC,GAAAA,CAAgB,GAC9C,CAAA,CAAA,CACF,CAAA,CACF,GACF,CAEJ","file":"chunk-5S2M7FXU.js","sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\nimport { ChevronDownIcon } from \"lucide-react\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\nimport { useControlledState } from \"@xploreu/hooks/use-controlled-state\"\r\nimport { ComboboxItem, ComboboxItemTitle } from \"../ui/combobox\"\r\nimport {\r\n Combobox,\r\n ComboboxInfiniteScroll,\r\n ComboboxInput,\r\n ComboboxList,\r\n ComboboxPopup,\r\n ComboboxPortal,\r\n ComboboxStatus,\r\n ComboboxTrigger\r\n} from \"../ui/combobox\"\r\n\r\n// ─── Types ───\r\n\r\nexport type FilterComboboxItem = {\r\n label: string\r\n value: string\r\n}\r\n\r\ntype FilterComboboxValue = FilterComboboxItem | FilterComboboxItem[] | null\r\n\r\ntype BaseProps = {\r\n items: FilterComboboxItem[] | undefined\r\n placeholder?: string\r\n icon?: React.ReactNode\r\n container?: React.ComponentProps<typeof ComboboxPortal>[\"container\"]\r\n isPending?: boolean\r\n className?: string\r\n triggerClassName?: string\r\n contentClassName?: string\r\n disabled?: boolean\r\n infiniteScroll?: React.ComponentProps<typeof ComboboxInfiniteScroll>\r\n showTitle?: boolean\r\n showSearch?: boolean\r\n}\r\n\r\ntype SingleProps = BaseProps & {\r\n multiple?: false\r\n value?: FilterComboboxItem | null\r\n defaultValue?: FilterComboboxItem | null\r\n onValueChange?: (value: FilterComboboxItem | null) => void\r\n}\r\n\r\ntype MultipleProps = BaseProps & {\r\n multiple: true\r\n value?: FilterComboboxItem[]\r\n defaultValue?: FilterComboboxItem[]\r\n onValueChange?: (value: FilterComboboxItem[]) => void\r\n}\r\n\r\nexport type FilterComboboxProps = SingleProps | MultipleProps\r\n\r\n// ─── Component ───\r\n\r\nfunction FilterCombobox({\r\n multiple,\r\n items,\r\n placeholder = \"Select\",\r\n icon,\r\n container,\r\n isPending,\r\n className,\r\n triggerClassName,\r\n contentClassName,\r\n disabled,\r\n infiniteScroll,\r\n ...props\r\n}: FilterComboboxProps) {\r\n\r\n const isMultiple = multiple === true\r\n const showTitle = props.showTitle ?? isMultiple\r\n const showSearch = props.showSearch ?? isMultiple\r\n\r\n const [value, setValue] = useControlledState<FilterComboboxValue>({\r\n value: props.value,\r\n defaultValue: props.defaultValue ?? (isMultiple ? [] : null),\r\n onChange: props.onValueChange as (value: FilterComboboxValue) => void,\r\n })\r\n\r\n const [search, setSearch] = React.useState(\"\")\r\n\r\n // Normalize value to array for label & clear logic\r\n const valueArray = Array.isArray(value) ? value : value ? [value] : []\r\n const hasValue = valueArray.length > 0\r\n const count = valueArray.length\r\n\r\n const triggerLabel = !hasValue\r\n ? isMultiple\r\n ? `All ${placeholder}`\r\n : placeholder\r\n : isMultiple\r\n ? `${placeholder} (${count})`\r\n : valueArray[0]?.label ?? placeholder\r\n\r\n const handleClear = () => {\r\n setValue(isMultiple ? [] : null)\r\n }\r\n\r\n // Filter items when showSearch is enabled\r\n const filteredItems = React.useMemo(() => {\r\n if (!showSearch || !search.trim()) return items\r\n const q = search.toLowerCase()\r\n return items?.filter(\r\n (it) => it.label.toLowerCase().includes(q) || it.value.toLowerCase().includes(q)\r\n )\r\n }, [items, search, showSearch])\r\n\r\n return (\r\n <Combobox\r\n items={items}\r\n multiple={multiple}\r\n value={value}\r\n onValueChange={setValue}\r\n isItemEqualToValue={(a, b) => a.value === b.value}\r\n disabled={disabled}\r\n >\r\n <ComboboxTrigger\r\n className={cn(\r\n \"group flex h-9 w-fit max-w-[220px] items-center gap-2 rounded-xp-card-base border bg-bg-primary px-3 text-body-medium-3 transition-colors\",\r\n \"border-border-primary text-text-secondary hover:bg-bg-primary-hover\",\r\n hasValue && \"border-border-brand bg-bg-brand-primary text-text-brand-secondary hover:bg-bg-brand-primary-hover-alt\",\r\n \"disabled:pointer-events-none disabled:opacity-50\",\r\n \"data-[popup-open]:border-border-brand data-[popup-open]:bg-bg-brand-primary data-[popup-open]:text-text-brand-secondary\",\r\n triggerClassName,\r\n className\r\n )}\r\n >\r\n {icon && (\r\n <span\r\n className={cn(\r\n \"size-4 shrink-0 group-data-[popup-open]:text-fg-brand-primary\",\r\n hasValue ? \"text-fg-brand-primary\" : \"text-fg-quaternary\"\r\n )}\r\n >\r\n {icon}\r\n </span>\r\n )}\r\n <span className=\"truncate\">{triggerLabel}</span>\r\n <ChevronDownIcon\r\n className={cn(\r\n \"size-4 shrink-0 transition-transform group-data-[popup-open]:rotate-180 group-data-[popup-open]:text-fg-brand-primary\",\r\n hasValue ? \"text-fg-brand-primary\" : \"text-fg-quaternary\"\r\n )}\r\n />\r\n </ComboboxTrigger>\r\n\r\n <ComboboxPopup\r\n container={container}\r\n className={cn(\"w-72\", contentClassName)}\r\n align=\"start\"\r\n sideOffset={8}\r\n >\r\n <div className=\"flex flex-col\">\r\n {showTitle && (\r\n <div className=\"flex items-center justify-between p-3 border-b border-border-primary\">\r\n <span className=\"text-label-semibold-3 text-text-primary\">{placeholder}</span>\r\n <button\r\n type=\"button\"\r\n disabled={!hasValue}\r\n onClick={handleClear}\r\n className={cn(\r\n \"text-label-semibold-3 transition-colors\",\r\n hasValue\r\n ? \"cursor-pointer text-text-error-primary hover:text-text-error-primary-hover\"\r\n : \"cursor-not-allowed text-text-disabled\"\r\n )}\r\n >\r\n Clear All\r\n </button>\r\n </div>\r\n )}\r\n\r\n {showSearch && (\r\n <ComboboxInput\r\n value={search}\r\n onChange={(e) => setSearch(e.target.value)}\r\n placeholder={`Search ${placeholder.toLowerCase()}...`}\r\n />\r\n )}\r\n\r\n <ComboboxStatus\r\n status={\r\n isPending || items === undefined\r\n ? \"pending\"\r\n : (showSearch ? filteredItems : items)?.length === 0\r\n ? \"empty\"\r\n : null\r\n }\r\n />\r\n <ComboboxList>\r\n {(showSearch ? filteredItems : items)?.map((item) => (\r\n <ComboboxItem\r\n indicator={isMultiple ? \"checkbox\" : undefined}\r\n key={item.value}\r\n value={item}\r\n >\r\n <ComboboxItemTitle>{item.label}</ComboboxItemTitle>\r\n </ComboboxItem>\r\n ))}\r\n <ComboboxInfiniteScroll {...infiniteScroll} />\r\n </ComboboxList>\r\n </div>\r\n </ComboboxPopup>\r\n </Combobox>\r\n )\r\n}\r\n\r\nexport { FilterCombobox }\r\n"]}
@@ -1,2 +1,2 @@
1
- import {c,d,e,f,g,a,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D}from'./chunk-ZNZVX4PT.js';import {a as a$2}from'./chunk-TED2PUK6.js';import {b}from'./chunk-JH6RZ3QH.js';import {a as a$1}from'./chunk-XG3W7QMP.js';import {b as b$2,c as c$1,d as d$1}from'./chunk-CQEBQK7U.js';import {b as b$1,e as e$1}from'./chunk-JLZNZFOO.js';import'react';import {SearchIcon,XIcon,Loader2Icon,CheckCircle2Icon}from'lucide-react';import {cn}from'@xploreu/lib/cn';import {jsx,jsxs,Fragment}from'react/jsx-runtime';function fo(o){return jsx(c,{...o})}function to(o){let{className:t,...r}=o;return jsx(d,{className:cn("group/combobox-trigger flex items-center gap-2",t),...r})}function Io(o){let{className:t,...r}=o;return jsx(e,{className:cn("text-label-semibold-2 text-text-secondary",t),...r})}function No(o){let{className:t,...r}=o;return jsx(f,{className:cn("flex w-full items-center gap-2",t),...r})}function wo({className:o,wrapperClassName:t,...r}){return jsx("div",{className:cn("p-3 border-b border-border-primary",t),children:jsx(g,{className:o,render:jsx(b,{size:"sm",startContent:jsx(SearchIcon,{})}),...r})})}function ko({className:o,displayValueKey:t={label:"label",value:"value"},placeholder:r="Search and Select Company",inputProps:m,...i}){let{inputValue:p,setInputValue:s}=a(),{className:n,startContent:x,...oo}=m||{};return jsx("div",{className:cn("flex flex-col gap-2",o),children:jsxs(bo,{onMouseDown:C=>C.preventBaseUIHandler(),className:"flex-col",children:[jsx(g,{render:jsx(b,{className:cn("h-9 text-body-regular-3 pl-9 pr-7",n),endContent:jsx(to,{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":!p,"data-slot":"combobox-clear-input",onClick:C=>{s("",{reason:"none",event:C.nativeEvent,cancel:()=>{},allowPropagation:()=>{},isCanceled:false,isPropagationAllowed:true,trigger:void 0});}})}),placeholder:r,startContent:x??jsx(SearchIcon,{className:"!size-4 !text-fg-tertiary-hover"}),...oo}),...i}),jsx(ro,{children:C=>C?.map(y=>jsxs(io,{children:[y?.[t.label]||"",jsx(mo,{})]},y?.[t.value]||""))})]})})}function Lo(o){let{className:t,...r}=o;return jsx(h,{className:cn("text-text-secondary",t),...r})}function So(o){return jsx(i,{render:jsx(XIcon,{}),...o})}function ro(o){return jsx(j,{...o})}function bo({className:o,...t}){return jsx(k,{className:cn("flex flex-wrap gap-2",o),...t})}function io({className:o,...t}){return jsx(b$1,{className:cn("ring-1 ring-border-brand text-body-medium-3",o),color:"brand",render:jsx(l,{...t}),size:"lg"})}function mo({className:o,...t}){return jsx(e$1,{className:cn("text-fg-quaternary",o),render:jsx(m,{...t})})}function Go({className:o$1,align:t="start",sideOffset:r=4,container:m,initialFocus:i,finalFocus:p$1,style:s,children:n$1,...x}){return jsx(n,{container:m,children:jsx(o,{align:t,className:"isolate z-50",sideOffset:r,...x,children:jsx(p,{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$1),finalFocus:p$1,initialFocus:i,style:s,children:jsx(so,{children:n$1})})})})}function Ro(o){return jsx(n,{...o})}function Ao(o$1){return jsx(o,{...o$1})}function Ho(o){let{className:t,...r}=o;return jsx(q,{className:cn("bg-black/30",t),...r})}function Vo({className:o,status:t,...r$1}){let{inputValue:m}=a(),i=m?.toString().trim(),s=t==="empty"&&i?`No matches for "${i}".`:t==="empty"&&!i?"No results.":t==="pending"?jsxs(Fragment,{children:[jsx(Loader2Icon,{className:"animate-spin size-4"}),jsx("span",{children:"Searching..."})]}):null;return jsx(r,{className:cn("px-2 py-2.5 text-body-regular-2 text-text-disabled flex items-center gap-2",!s&&"hidden",o),...r$1,children:s})}function To({className:o,...t}){return jsx(s,{className:cn("px-3 py-2 text-body-regular-2 text-text-secondary",o),...t})}function Bo({className:o,...t$1}){return jsx(t,{className:cn("max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] overflow-auto scrollbar-thin flex flex-col p-1 focus-visible:outline-none data-[empty]:hidden",o),...t$1})}function so(o){let{className:t,...r}=o;return jsx(u,{className:cn("absolute inset-0 bg-bg-primary-hover",t),...r})}function po(o){return jsx(v,{...o})}function zo(o){let{className:t,...r}=o;return jsx(w,{className:cn("group/combobox-row",t),...r})}function Eo({className:o,children:t,indicator:r="check-circle",...m}){let{disabled:i}=m;return jsx(po,{activeClassName:"bg-bg-primary-hover rounded-md",disabled:i,children:jsxs(x,{"data-indicator":r,className:cn("group/combobox-item relative grid grid-cols-[auto_1fr] items-center gap-x-2 my-px p-xp-md cursor-default outline-none select-none [[data-indicator=check-circle][data-selected]]:pr-8 data-[indicator=checkbox]:pl-8",o),...m,children:[t,jsx(ao,{className:"absolute group-data-[indicator=check-circle]/combobox-item:right-2 group-data-[indicator=checkbox]/combobox-item:left-2",keepMounted:r==="checkbox",render:(p,s)=>jsxs("span",{...p,children:[r==="check-circle"&&jsx(CheckCircle2Icon,{className:"size-4 text-fg-brand-primary shrink-0"}),r==="checkbox"&&jsx(a$1,{checked:s.selected})]})})]})})}function Mo({className:o,...t}){return jsx("span",{"data-slot":"combobox-item-title",className:cn("col-start-2 text-body-medium-3 text-text-primary truncate row-span-2 group-has-[[data-slot=combobox-item-description]]/combobox-item:row-span-1",o),...t})}function Do({className:o,...t}){return jsx("span",{"data-slot":"combobox-item-description",className:cn("col-start-2 text-body-regular-3 text-text-secondary truncate",o),...t})}function Fo({className:o,...t}){return jsx("div",{"data-slot":"combobox-item-icon",className:cn("row-span-2 col-start-1 flex items-center justify-center size-6 rounded-md bg-bg-brand-solid text-fg-white shrink-0 [&_svg]:size-3.5",o),...t})}function qo({src:o,imageSrc:t,className:r,avatarClassName:m,imageAlt:i,fallbackText:p,children:s,...n}){let x=o??t;return jsx("div",{"data-slot":"combobox-item-avatar",className:cn("row-span-2 col-start-1 size-6 rounded-full overflow-hidden shrink-0",r),children:jsxs(b$2,{className:cn("size-full shrink-0",m),...n,children:[jsx(c$1,{alt:i,src:x}),jsx(d$1,{className:"flex aspect-square size-full items-center justify-center bg-bg-tertiary text-label-semibold-2 text-text-quaternary",children:p??s})]})})}function ao(o){return jsx(y,{...o})}function Oo(o){let{className:t,...r}=o;return jsx(z,{className:cn("my-1 h-px bg-border-primary",t),...r})}function _o(o){let{className:t,...r}=o;return jsx(A,{className:cn("py-1",t),...r})}function jo(o){let{className:t,...r}=o;return jsx(B,{className:cn("px-3 py-1 text-body-semibold-sm text-text-secondary",t),...r})}function Uo(o){return jsx(C,{...o})}function Xo(o){let{className:t,...r}=o;return jsx(D,{className:cn("fill-bg-primary",t),...r})}function $o({hasMore:o,threshold:t=.5,...r}){return jsx(a$2,{hasMore:o,threshold:t,...r,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{qo as A,ao as B,Oo as C,_o as D,jo as E,Uo as F,Xo as G,$o as H,fo as a,to as b,Io as c,No as d,wo as e,ko as f,Lo as g,So as h,ro as i,bo as j,io as k,mo as l,Go as m,Ro as n,Ao as o,Ho as p,Vo as q,To as r,Bo as s,so as t,po as u,zo as v,Eo as w,Mo as x,Do as y,Fo as z};//# sourceMappingURL=chunk-DUSAF7E7.js.map
2
- //# sourceMappingURL=chunk-DUSAF7E7.js.map
1
+ import {c,d,e,f,g,a,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D}from'./chunk-PHP3T7ZS.js';import {a as a$2}from'./chunk-TED2PUK6.js';import {b}from'./chunk-JH6RZ3QH.js';import {a as a$1}from'./chunk-XG3W7QMP.js';import {b as b$2,c as c$1,d as d$1}from'./chunk-CQEBQK7U.js';import {b as b$1,e as e$1}from'./chunk-JLZNZFOO.js';import'react';import {SearchIcon,XIcon,Loader2Icon,CheckCircle2Icon}from'lucide-react';import {cn}from'@xploreu/lib/cn';import {jsx,jsxs,Fragment}from'react/jsx-runtime';function fo(o){return jsx(c,{...o})}function to(o){let{className:t,...r}=o;return jsx(d,{className:cn("group/combobox-trigger flex items-center gap-2",t),...r})}function Io(o){let{className:t,...r}=o;return jsx(e,{className:cn("text-label-semibold-2 text-text-secondary",t),...r})}function No(o){let{className:t,...r}=o;return jsx(f,{className:cn("flex w-full items-center gap-2",t),...r})}function wo({className:o,wrapperClassName:t,...r}){return jsx("div",{className:cn("p-3 border-b border-border-primary",t),children:jsx(g,{className:o,render:jsx(b,{size:"sm",startContent:jsx(SearchIcon,{})}),...r})})}function ko({className:o,displayValueKey:t={label:"label",value:"value"},placeholder:r="Search and Select Company",inputProps:m,...i}){let{inputValue:p,setInputValue:s}=a(),{className:n,startContent:x,...oo}=m||{};return jsx("div",{className:cn("flex flex-col gap-2",o),children:jsxs(bo,{onMouseDown:C=>C.preventBaseUIHandler(),className:"flex-col",children:[jsx(g,{render:jsx(b,{className:cn("h-9 text-body-regular-3 pl-9 pr-7",n),endContent:jsx(to,{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":!p,"data-slot":"combobox-clear-input",onClick:C=>{s("",{reason:"none",event:C.nativeEvent,cancel:()=>{},allowPropagation:()=>{},isCanceled:false,isPropagationAllowed:true,trigger:void 0});}})}),placeholder:r,startContent:x??jsx(SearchIcon,{className:"!size-4 !text-fg-tertiary-hover"}),...oo}),...i}),jsx(ro,{children:C=>C?.map(y=>jsxs(io,{children:[y?.[t.label]||"",jsx(mo,{})]},y?.[t.value]||""))})]})})}function Lo(o){let{className:t,...r}=o;return jsx(h,{className:cn("text-text-secondary",t),...r})}function So(o){return jsx(i,{render:jsx(XIcon,{}),...o})}function ro(o){return jsx(j,{...o})}function bo({className:o,...t}){return jsx(k,{className:cn("flex flex-wrap gap-2",o),...t})}function io({className:o,...t}){return jsx(b$1,{className:cn("ring-1 ring-border-brand text-body-medium-3",o),color:"brand",render:jsx(l,{...t}),size:"lg"})}function mo({className:o,...t}){return jsx(e$1,{className:cn("text-fg-quaternary",o),render:jsx(m,{...t})})}function Go({className:o$1,align:t="start",sideOffset:r=4,container:m,initialFocus:i,finalFocus:p$1,style:s,children:n$1,...x}){return jsx(n,{container:m,children:jsx(o,{align:t,className:"isolate z-50",sideOffset:r,...x,children:jsx(p,{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$1),finalFocus:p$1,initialFocus:i,style:s,children:jsx(so,{children:n$1})})})})}function Ro(o){return jsx(n,{...o})}function Ao(o$1){return jsx(o,{...o$1})}function Ho(o){let{className:t,...r}=o;return jsx(q,{className:cn("bg-black/30",t),...r})}function Vo({className:o,status:t,...r$1}){let{inputValue:m}=a(),i=m?.toString().trim(),s=t==="empty"&&i?`No matches for "${i}".`:t==="empty"&&!i?"No results.":t==="pending"?jsxs(Fragment,{children:[jsx(Loader2Icon,{className:"animate-spin size-4"}),jsx("span",{children:"Searching..."})]}):null;return jsx(r,{className:cn("px-2 py-2.5 text-body-regular-2 text-text-disabled flex items-center gap-2",!s&&"hidden",o),...r$1,children:s})}function To({className:o,...t}){return jsx(s,{className:cn("px-3 py-2 text-body-regular-2 text-text-secondary",o),...t})}function Bo({className:o,...t$1}){return jsx(t,{className:cn("max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] overflow-auto scrollbar-thin flex flex-col p-1 focus-visible:outline-none data-[empty]:hidden",o),...t$1})}function so(o){let{className:t,...r}=o;return jsx(u,{className:cn("absolute inset-0 bg-bg-primary-hover",t),...r})}function po(o){return jsx(v,{...o})}function zo(o){let{className:t,...r}=o;return jsx(w,{className:cn("group/combobox-row",t),...r})}function Eo({className:o,children:t,indicator:r="check-circle",...m}){let{disabled:i}=m;return jsx(po,{activeClassName:"bg-bg-primary-hover rounded-md",disabled:i,children:jsxs(x,{"data-indicator":r,className:cn("group/combobox-item relative grid grid-cols-[auto_1fr] items-center gap-x-2 my-px p-xp-md cursor-default outline-none select-none [[data-indicator=check-circle][data-selected]]:pr-8 data-[indicator=checkbox]:pl-8",o),...m,children:[t,jsx(ao,{className:"absolute group-data-[indicator=check-circle]/combobox-item:right-2 group-data-[indicator=checkbox]/combobox-item:left-2",keepMounted:r==="checkbox",render:(p,s)=>jsxs("span",{...p,children:[r==="check-circle"&&jsx(CheckCircle2Icon,{className:"size-4 text-fg-brand-primary shrink-0"}),r==="checkbox"&&jsx(a$1,{checked:s.selected})]})})]})})}function Mo({className:o,...t}){return jsx("span",{"data-slot":"combobox-item-title",className:cn("col-start-2 text-body-medium-3 text-text-primary truncate row-span-2 group-has-[[data-slot=combobox-item-description]]/combobox-item:row-span-1",o),...t})}function Do({className:o,...t}){return jsx("span",{"data-slot":"combobox-item-description",className:cn("col-start-2 text-body-regular-3 text-text-secondary truncate",o),...t})}function Fo({className:o,...t}){return jsx("div",{"data-slot":"combobox-item-icon",className:cn("row-span-2 col-start-1 flex items-center justify-center size-6 rounded-md bg-bg-brand-solid text-fg-white shrink-0 [&_svg]:size-3.5",o),...t})}function qo({src:o,imageSrc:t,className:r,avatarClassName:m,imageAlt:i,fallbackText:p,children:s,...n}){let x=o??t;return jsx("div",{"data-slot":"combobox-item-avatar",className:cn("row-span-2 col-start-1 size-6 rounded-full overflow-hidden shrink-0",r),children:jsxs(b$2,{className:cn("size-full shrink-0",m),...n,children:[jsx(c$1,{alt:i,src:x}),jsx(d$1,{className:"flex aspect-square size-full items-center justify-center bg-bg-tertiary text-label-semibold-2 text-text-quaternary",children:p??s})]})})}function ao(o){return jsx(y,{...o})}function Oo(o){let{className:t,...r}=o;return jsx(z,{className:cn("my-1 h-px bg-border-primary",t),...r})}function _o(o){let{className:t,...r}=o;return jsx(A,{className:cn("py-1",t),...r})}function jo(o){let{className:t,...r}=o;return jsx(B,{className:cn("px-3 py-1 text-body-semibold-sm text-text-secondary",t),...r})}function Uo(o){return jsx(C,{...o})}function Xo(o){let{className:t,...r}=o;return jsx(D,{className:cn("fill-bg-primary",t),...r})}function $o({hasMore:o,threshold:t=.5,...r}){return jsx(a$2,{hasMore:o,threshold:t,...r,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{qo as A,ao as B,Oo as C,_o as D,jo as E,Uo as F,Xo as G,$o as H,fo as a,to as b,Io as c,No as d,wo as e,ko as f,Lo as g,So as h,ro as i,bo as j,io as k,mo as l,Go as m,Ro as n,Ao as o,Ho as p,Vo as q,To as r,Bo as s,so as t,po as u,zo as v,Eo as w,Mo as x,Do as y,Fo as z};//# sourceMappingURL=chunk-AE72UPV5.js.map
2
+ //# sourceMappingURL=chunk-AE72UPV5.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ui/combobox.tsx"],"names":["Combobox","props","jsx","ComboboxTrigger","className","rest","cn","ComboboxLabel","ComboboxInputGroup","ComboboxInput","wrapperClassName","Input","SearchIcon","ComboboxInputFilter","displayValueKey","placeholder","inputProps","inputValue","setInputValue","useCombobox","inputClassName","startContent","restInputProps","jsxs","ComboboxChips","e","XIcon","event","ComboboxValue","value","item","ComboboxChip","ComboboxChipRemove","ComboboxIcon","ComboboxClear","Badge","BadgeButton","ComboboxPopup","align","sideOffset","container","initialFocus","finalFocus","style","children","ComboboxPortal","ComboboxPositioner","ComboboxHighlight","ComboboxBackdrop","ComboboxStatus","status","trimmedInputValue","text","Fragment","Loader2Icon","ComboboxEmpty","ComboboxList","ComboboxHighlightItem","ComboboxRow","ComboboxItem","indicator","disabled","ComboboxItemIndicator","state","CheckCircle2Icon","Checkbox","ComboboxItemTitle","ComboboxItemDescription","ComboboxItemIcon","ComboboxItemAvatar","src","imageSrc","avatarClassName","imageAlt","fallbackText","finalSrc","Avatar","AvatarImage","AvatarFallback","ComboboxSeparator","ComboboxGroup","ComboboxGroupLabel","ComboboxCollection","ComboboxArrow","ComboboxInfiniteScroll","hasMore","threshold","InfiniteScroll"],"mappings":"ifA8EA,SAASA,EAAAA,CAA8DC,CAAAA,CAAuC,CAC5G,OACEC,GAAA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AAS+E,EAAAA,CAAuB,CAC9B,QAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CAAY,EAAA,CACZ,GAAGrF,CACL,CAAA,CAAkE,CAChE,OACEC,GAAAA,CAACqF,GAAAA,CAAA,CACC,OAAA,CAASF,CAAAA,CACT,SAAA,CAAWC,CAAAA,CACV,GAAGrF,EAEH,QAAA,CAAAoF,CAAAA,EACC9D,IAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,4EAAA,CACb,QAAA,CAAA,CAAArB,GAAAA,CAACoD,YAAA,CAAY,SAAA,CAAU,qBAAA,CAAsB,CAAA,CAC7CpD,GAAAA,CAAC,MAAA,CAAA,CAAK,QAAA,CAAA,iBAAA,CAEN,CAAA,CAAA,CACF,EAEJ,CAEJ","file":"chunk-DUSAF7E7.js","sourcesContent":["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\nimport { Checkbox } from \"./checkbox\"\r\nimport { Avatar, AvatarFallback, AvatarImage } from \"./avatar\"\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(\"p-3 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 p-1 focus-visible:outline-none data-[empty]:hidden\", 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 indicator?: \"check-circle\" | \"checkbox\"\r\n}\r\n\r\nfunction ComboboxItem({\r\n className,\r\n children,\r\n indicator = \"check-circle\",\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 rounded-md\"\r\n disabled={disabled}\r\n >\r\n <ComboboxItemPrimitive\r\n data-indicator={indicator}\r\n className={cn(\r\n \"group/combobox-item relative grid grid-cols-[auto_1fr] items-center gap-x-2 my-px p-xp-md cursor-default outline-none select-none [[data-indicator=check-circle][data-selected]]:pr-8 data-[indicator=checkbox]:pl-8\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n <ComboboxItemIndicator\r\n className=\"absolute group-data-[indicator=check-circle]/combobox-item:right-2 group-data-[indicator=checkbox]/combobox-item:left-2\"\r\n keepMounted={indicator === \"checkbox\"}\r\n render={(props, state) => (\r\n <span {...props}>\r\n {indicator === \"check-circle\" && (\r\n <CheckCircle2Icon className=\"size-4 text-fg-brand-primary shrink-0\" />\r\n )}\r\n\r\n {indicator === \"checkbox\" && (\r\n <Checkbox checked={state.selected} />\r\n )}\r\n </span>\r\n )}\r\n />\r\n </ComboboxItemPrimitive>\r\n </ComboboxHighlightItem>\r\n )\r\n}\r\n\r\ntype ComboboxItemTitleProps = React.ComponentProps<\"span\">\r\n\r\nfunction ComboboxItemTitle({\r\n className,\r\n ...props\r\n}: ComboboxItemTitleProps) {\r\n return (\r\n <span\r\n data-slot=\"combobox-item-title\"\r\n className={cn(\r\n \"col-start-2 text-body-medium-3 text-text-primary truncate row-span-2 group-has-[[data-slot=combobox-item-description]]/combobox-item:row-span-1\",\r\n className\r\n )}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxItemDescriptionProps = React.ComponentProps<\"span\">\r\n\r\nfunction ComboboxItemDescription({\r\n className,\r\n ...props\r\n}: ComboboxItemDescriptionProps) {\r\n return (\r\n <span\r\n data-slot=\"combobox-item-description\"\r\n className={cn(\r\n \"col-start-2 text-body-regular-3 text-text-secondary truncate\",\r\n className\r\n )}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\nfunction ComboboxItemIcon({ className, ...props }: React.ComponentProps<\"div\">) {\r\n return (\r\n <div\r\n data-slot=\"combobox-item-icon\"\r\n className={cn(\r\n \"row-span-2 col-start-1 flex items-center justify-center size-6 rounded-md bg-bg-brand-solid text-fg-white shrink-0 [&_svg]:size-3.5\",\r\n className\r\n )}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxItemAvatarProps = React.ComponentProps<typeof Avatar> & {\r\n src?: string\r\n imageSrc?: string\r\n imageAlt?: string\r\n avatarClassName?: string\r\n fallbackText?: string\r\n}\r\n\r\nfunction ComboboxItemAvatar({\r\n src,\r\n imageSrc,\r\n className,\r\n avatarClassName,\r\n imageAlt,\r\n fallbackText,\r\n children,\r\n ...props\r\n}: ComboboxItemAvatarProps) {\r\n const finalSrc = src ?? imageSrc\r\n\r\n return (\r\n <div\r\n data-slot=\"combobox-item-avatar\"\r\n className={cn(\r\n \"row-span-2 col-start-1 size-6 rounded-full overflow-hidden shrink-0\",\r\n className\r\n )}\r\n >\r\n <Avatar\r\n className={cn(\"size-full shrink-0\", avatarClassName)}\r\n {...props}\r\n >\r\n <AvatarImage alt={imageAlt} src={finalSrc} />\r\n <AvatarFallback className=\"flex aspect-square size-full items-center justify-center bg-bg-tertiary text-label-semibold-2 text-text-quaternary\">\r\n {fallbackText ?? children}\r\n </AvatarFallback>\r\n </Avatar>\r\n </div>\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 ComboboxItemTitle,\r\n type ComboboxItemTitleProps,\r\n ComboboxItemDescription,\r\n type ComboboxItemDescriptionProps,\r\n ComboboxItemIcon,\r\n ComboboxItemAvatar,\r\n type ComboboxItemAvatarProps,\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/ui/combobox.tsx"],"names":["Combobox","props","jsx","ComboboxTrigger","className","rest","cn","ComboboxLabel","ComboboxInputGroup","ComboboxInput","wrapperClassName","Input","SearchIcon","ComboboxInputFilter","displayValueKey","placeholder","inputProps","inputValue","setInputValue","useCombobox","inputClassName","startContent","restInputProps","jsxs","ComboboxChips","e","XIcon","event","ComboboxValue","value","item","ComboboxChip","ComboboxChipRemove","ComboboxIcon","ComboboxClear","Badge","BadgeButton","ComboboxPopup","align","sideOffset","container","initialFocus","finalFocus","style","children","ComboboxPortal","ComboboxPositioner","ComboboxHighlight","ComboboxBackdrop","ComboboxStatus","status","trimmedInputValue","text","Fragment","Loader2Icon","ComboboxEmpty","ComboboxList","ComboboxHighlightItem","ComboboxRow","ComboboxItem","indicator","disabled","ComboboxItemIndicator","state","CheckCircle2Icon","Checkbox","ComboboxItemTitle","ComboboxItemDescription","ComboboxItemIcon","ComboboxItemAvatar","src","imageSrc","avatarClassName","imageAlt","fallbackText","finalSrc","Avatar","AvatarImage","AvatarFallback","ComboboxSeparator","ComboboxGroup","ComboboxGroupLabel","ComboboxCollection","ComboboxArrow","ComboboxInfiniteScroll","hasMore","threshold","InfiniteScroll"],"mappings":"ifA8EA,SAASA,EAAAA,CAA8DC,CAAAA,CAAuC,CAC5G,OACEC,GAAAA,CAACF,CAAAA,CAAA,CAAmB,GAAGC,CAAAA,CAAO,CAElC,CAIA,SAASE,EAAAA,CAAgBF,CAAAA,CAA6B,CACpD,GAAM,CAAE,SAAA,CAAAG,CAAAA,CAAW,GAAGC,CAAK,CAAA,CAAIJ,CAAAA,CAE/B,OAAOC,IAACC,CAAAA,CAAA,CACN,SAAA,CAAWG,EAAAA,CACT,gDAAA,CACAF,CACF,CAAA,CACC,GAAGC,EACN,CACF,CAIA,SAASE,EAAAA,CAAcN,CAAAA,CAA2B,CAChD,GAAM,CAAE,UAAAG,CAAAA,CAAW,GAAGC,CAAK,CAAA,CAAIJ,CAAAA,CAE/B,OAAOC,GAAAA,CAACK,CAAAA,CAAA,CACN,SAAA,CAAWD,EAAAA,CACT,2CAAA,CACAF,CACF,CAAA,CACC,GAAGC,CAAAA,CACN,CACF,CAIA,SAASG,EAAAA,CAAmBP,CAAAA,CAAgC,CAC1D,GAAM,CAAE,SAAA,CAAAG,EAAW,GAAGC,CAAK,CAAA,CAAIJ,CAAAA,CAE/B,OAAOC,GAAAA,CAACM,CAAAA,CAAA,CACN,UAAWF,EAAAA,CACT,gCAAA,CACAF,CACF,CAAA,CACC,GAAGC,CAAAA,CACN,CACF,CAMA,SAASI,EAAAA,CAAc,CACrB,SAAA,CAAAL,CAAAA,CACA,gBAAA,CAAAM,CAAAA,CACA,GAAGT,CACL,EAAuB,CAErB,OACEC,GAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAWI,EAAAA,CAAG,oCAAA,CAAsCI,CAAgB,EACvE,QAAA,CAAAR,GAAAA,CAACO,CAAAA,CAAA,CACC,SAAA,CAAWL,CAAAA,CACX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AM,CAAE,SAAA,CAAAG,CAAAA,CAAW,GAAGC,CAAK,EAAIJ,CAAAA,CAE/B,OAAOC,GAAAA,CAACiF,CAAAA,CAAA,CACN,SAAA,CAAW7E,EAAAA,CAAG,iBAAA,CAAmBF,CAAS,CAAA,CACzC,GAAGC,CAAAA,CACN,CACF,CAEA,SAAS+E,EAAAA,CAAuB,CAC9B,QAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CAAY,EAAA,CACZ,GAAGrF,CACL,CAAA,CAAkE,CAChE,OACEC,GAAAA,CAACqF,GAAAA,CAAA,CACC,OAAA,CAASF,CAAAA,CACT,SAAA,CAAWC,CAAAA,CACV,GAAGrF,EAEH,QAAA,CAAAoF,CAAAA,EACC9D,IAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,4EAAA,CACb,QAAA,CAAA,CAAArB,GAAAA,CAACoD,YAAA,CAAY,SAAA,CAAU,qBAAA,CAAsB,CAAA,CAC7CpD,GAAAA,CAAC,MAAA,CAAA,CAAK,QAAA,CAAA,iBAAA,CAEN,CAAA,CAAA,CACF,EAEJ,CAEJ","file":"chunk-AE72UPV5.js","sourcesContent":["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\nimport { Checkbox } from \"./checkbox\"\r\nimport { Avatar, AvatarFallback, AvatarImage } from \"./avatar\"\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(\"p-3 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 p-1 focus-visible:outline-none data-[empty]:hidden\", 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 indicator?: \"check-circle\" | \"checkbox\"\r\n}\r\n\r\nfunction ComboboxItem({\r\n className,\r\n children,\r\n indicator = \"check-circle\",\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 rounded-md\"\r\n disabled={disabled}\r\n >\r\n <ComboboxItemPrimitive\r\n data-indicator={indicator}\r\n className={cn(\r\n \"group/combobox-item relative grid grid-cols-[auto_1fr] items-center gap-x-2 my-px p-xp-md cursor-default outline-none select-none [[data-indicator=check-circle][data-selected]]:pr-8 data-[indicator=checkbox]:pl-8\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n <ComboboxItemIndicator\r\n className=\"absolute group-data-[indicator=check-circle]/combobox-item:right-2 group-data-[indicator=checkbox]/combobox-item:left-2\"\r\n keepMounted={indicator === \"checkbox\"}\r\n render={(props, state) => (\r\n <span {...props}>\r\n {indicator === \"check-circle\" && (\r\n <CheckCircle2Icon className=\"size-4 text-fg-brand-primary shrink-0\" />\r\n )}\r\n\r\n {indicator === \"checkbox\" && (\r\n <Checkbox checked={state.selected} />\r\n )}\r\n </span>\r\n )}\r\n />\r\n </ComboboxItemPrimitive>\r\n </ComboboxHighlightItem>\r\n )\r\n}\r\n\r\ntype ComboboxItemTitleProps = React.ComponentProps<\"span\">\r\n\r\nfunction ComboboxItemTitle({\r\n className,\r\n ...props\r\n}: ComboboxItemTitleProps) {\r\n return (\r\n <span\r\n data-slot=\"combobox-item-title\"\r\n className={cn(\r\n \"col-start-2 text-body-medium-3 text-text-primary truncate row-span-2 group-has-[[data-slot=combobox-item-description]]/combobox-item:row-span-1\",\r\n className\r\n )}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxItemDescriptionProps = React.ComponentProps<\"span\">\r\n\r\nfunction ComboboxItemDescription({\r\n className,\r\n ...props\r\n}: ComboboxItemDescriptionProps) {\r\n return (\r\n <span\r\n data-slot=\"combobox-item-description\"\r\n className={cn(\r\n \"col-start-2 text-body-regular-3 text-text-secondary truncate\",\r\n className\r\n )}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\nfunction ComboboxItemIcon({ className, ...props }: React.ComponentProps<\"div\">) {\r\n return (\r\n <div\r\n data-slot=\"combobox-item-icon\"\r\n className={cn(\r\n \"row-span-2 col-start-1 flex items-center justify-center size-6 rounded-md bg-bg-brand-solid text-fg-white shrink-0 [&_svg]:size-3.5\",\r\n className\r\n )}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype ComboboxItemAvatarProps = React.ComponentProps<typeof Avatar> & {\r\n src?: string\r\n imageSrc?: string\r\n imageAlt?: string\r\n avatarClassName?: string\r\n fallbackText?: string\r\n}\r\n\r\nfunction ComboboxItemAvatar({\r\n src,\r\n imageSrc,\r\n className,\r\n avatarClassName,\r\n imageAlt,\r\n fallbackText,\r\n children,\r\n ...props\r\n}: ComboboxItemAvatarProps) {\r\n const finalSrc = src ?? imageSrc\r\n\r\n return (\r\n <div\r\n data-slot=\"combobox-item-avatar\"\r\n className={cn(\r\n \"row-span-2 col-start-1 size-6 rounded-full overflow-hidden shrink-0\",\r\n className\r\n )}\r\n >\r\n <Avatar\r\n className={cn(\"size-full shrink-0\", avatarClassName)}\r\n {...props}\r\n >\r\n <AvatarImage alt={imageAlt} src={finalSrc} />\r\n <AvatarFallback className=\"flex aspect-square size-full items-center justify-center bg-bg-tertiary text-label-semibold-2 text-text-quaternary\">\r\n {fallbackText ?? children}\r\n </AvatarFallback>\r\n </Avatar>\r\n </div>\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 ComboboxItemTitle,\r\n type ComboboxItemTitleProps,\r\n ComboboxItemDescription,\r\n type ComboboxItemDescriptionProps,\r\n ComboboxItemIcon,\r\n ComboboxItemAvatar,\r\n type ComboboxItemAvatarProps,\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,2 +1,2 @@
1
- import {a,b,i,m,s,w}from'./chunk-DUSAF7E7.js';import*as l from'react';import {ChevronDownIcon,ChevronLeftIcon,ChevronRightIcon}from'lucide-react';import {cn}from'@xploreu/lib/cn';import {jsxs,Fragment,jsx}from'react/jsx-runtime';function j({page:r,pageSize:a$1,total:i$1,onPageChange:b$1,onPageSizeChange:n,pageSizeOptions:m$1=[10,20,50,100],showPageSize:c=true,showRange:d=true,className:C,...N}){let u=Math.max(1,Math.ceil(i$1/a$1)),h=i$1===0?0:(r-1)*a$1+1,P=Math.min(r*a$1,i$1),s$1=l.useMemo(()=>m$1.map(e=>({label:String(e),value:e})),[m$1]),I=l.useMemo(()=>s$1.find(e=>e.value===a$1)??s$1[0],[s$1,a$1]);return jsxs("div",{className:cn("flex w-full flex-col-reverse gap-3 mt-4 sm:flex-row sm:items-center sm:justify-between border-t border-border-primary pt-3 text-body-regular-2 text-text-secondary",C),"data-slot":"pagination",...N,children:[jsxs("div",{className:"flex items-center gap-2",children:[c&&n&&jsxs(Fragment,{children:[jsx("span",{className:"text-label-regular-3 text-text-tertiary",children:"Rows per page"}),jsxs(a,{items:s$1,value:I,onValueChange:e=>{e&&n&&n(e.value);},isItemEqualToValue:(e,w)=>e.value===w.value,children:[jsxs(b,{className:"h-8 gap-2 rounded-lg border border-border-primary bg-bg-primary px-3 text-label-semibold-3 text-text-primary hover:bg-bg-secondary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border-brand-primary","aria-label":"Rows per page",children:[jsx(i,{children:e=>e?e.label:String(a$1)}),jsx(ChevronDownIcon,{className:"size-3.5 text-text-tertiary"})]}),jsx(m,{className:"w-24",children:jsx(s,{children:s$1.map(e=>jsx(w,{value:e,children:e.label},e.value))})})]})]}),c&&d&&jsx("span",{className:"text-text-tertiary",children:"\xB7"}),d&&jsxs("span",{className:"text-label-regular-3 text-text-tertiary",children:[h,"\u2013",P," of ",i$1]})]}),jsxs("div",{className:"flex items-center gap-1",children:[jsx("button",{type:"button",disabled:r<=1,onClick:()=>b$1(r-1),className:"inline-flex size-8 cursor-pointer items-center justify-center rounded-lg border border-border-primary bg-bg-primary text-text-secondary transition-colors hover:bg-bg-secondary hover:text-text-primary disabled:cursor-not-allowed disabled:opacity-40","aria-label":"Previous page",children:jsx(ChevronLeftIcon,{className:"size-4"})}),jsxs("span",{className:"px-2 text-label-semibold-3 text-text-primary",children:["Page ",r," / ",u]}),jsx("button",{type:"button",disabled:r>=u,onClick:()=>b$1(r+1),className:"inline-flex size-8 cursor-pointer items-center justify-center rounded-lg border border-border-primary bg-bg-primary text-text-secondary transition-colors hover:bg-bg-secondary hover:text-text-primary disabled:cursor-not-allowed disabled:opacity-40","aria-label":"Next page",children:jsx(ChevronRightIcon,{className:"size-4"})})]})]})}export{j as a};//# sourceMappingURL=chunk-IF2CKGBN.js.map
2
- //# sourceMappingURL=chunk-IF2CKGBN.js.map
1
+ import {a,b,i,m,s,w}from'./chunk-AE72UPV5.js';import*as l from'react';import {ChevronDownIcon,ChevronLeftIcon,ChevronRightIcon}from'lucide-react';import {cn}from'@xploreu/lib/cn';import {jsxs,Fragment,jsx}from'react/jsx-runtime';function j({page:r,pageSize:a$1,total:i$1,onPageChange:b$1,onPageSizeChange:n,pageSizeOptions:m$1=[10,20,50,100],showPageSize:c=true,showRange:d=true,className:C,...N}){let u=Math.max(1,Math.ceil(i$1/a$1)),h=i$1===0?0:(r-1)*a$1+1,P=Math.min(r*a$1,i$1),s$1=l.useMemo(()=>m$1.map(e=>({label:String(e),value:e})),[m$1]),I=l.useMemo(()=>s$1.find(e=>e.value===a$1)??s$1[0],[s$1,a$1]);return jsxs("div",{className:cn("flex w-full flex-col-reverse gap-3 mt-4 sm:flex-row sm:items-center sm:justify-between border-t border-border-primary pt-3 text-body-regular-2 text-text-secondary",C),"data-slot":"pagination",...N,children:[jsxs("div",{className:"flex items-center gap-2",children:[c&&n&&jsxs(Fragment,{children:[jsx("span",{className:"text-label-regular-3 text-text-tertiary",children:"Rows per page"}),jsxs(a,{items:s$1,value:I,onValueChange:e=>{e&&n&&n(e.value);},isItemEqualToValue:(e,w)=>e.value===w.value,children:[jsxs(b,{className:"h-8 gap-2 rounded-lg border border-border-primary bg-bg-primary px-3 text-label-semibold-3 text-text-primary hover:bg-bg-secondary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border-brand-primary","aria-label":"Rows per page",children:[jsx(i,{children:e=>e?e.label:String(a$1)}),jsx(ChevronDownIcon,{className:"size-3.5 text-text-tertiary"})]}),jsx(m,{className:"w-24",children:jsx(s,{children:s$1.map(e=>jsx(w,{value:e,children:e.label},e.value))})})]})]}),c&&d&&jsx("span",{className:"text-text-tertiary",children:"\xB7"}),d&&jsxs("span",{className:"text-label-regular-3 text-text-tertiary",children:[h,"\u2013",P," of ",i$1]})]}),jsxs("div",{className:"flex items-center gap-1",children:[jsx("button",{type:"button",disabled:r<=1,onClick:()=>b$1(r-1),className:"inline-flex size-8 cursor-pointer items-center justify-center rounded-lg border border-border-primary bg-bg-primary text-text-secondary transition-colors hover:bg-bg-secondary hover:text-text-primary disabled:cursor-not-allowed disabled:opacity-40","aria-label":"Previous page",children:jsx(ChevronLeftIcon,{className:"size-4"})}),jsxs("span",{className:"px-2 text-label-semibold-3 text-text-primary",children:["Page ",r," / ",u]}),jsx("button",{type:"button",disabled:r>=u,onClick:()=>b$1(r+1),className:"inline-flex size-8 cursor-pointer items-center justify-center rounded-lg border border-border-primary bg-bg-primary text-text-secondary transition-colors hover:bg-bg-secondary hover:text-text-primary disabled:cursor-not-allowed disabled:opacity-40","aria-label":"Next page",children:jsx(ChevronRightIcon,{className:"size-4"})})]})]})}export{j as a};//# sourceMappingURL=chunk-FF7XATMG.js.map
2
+ //# sourceMappingURL=chunk-FF7XATMG.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ui/pagination.tsx"],"names":["Pagination","page","pageSize","total","onPageChange","onPageSizeChange","pageSizeOptions","showPageSize","showRange","className","props","totalPages","startItem","endItem","items","opt","selectedItem","item","jsxs","cn","Fragment","jsx","Combobox","a","b","ComboboxTrigger","ComboboxValue","val","ChevronDownIcon","ComboboxPopup","ComboboxList","ComboboxItem","ChevronLeftIcon","ChevronRightIcon"],"mappings":"qOA6BO,SAASA,CAAAA,CAAW,CACzB,KAAAC,CAAAA,CACA,QAAA,CAAAC,GAAAA,CACA,KAAA,CAAAC,IACA,YAAA,CAAAC,GAAAA,CACA,gBAAA,CAAAC,CAAAA,CACA,gBAAAC,GAAAA,CAAkB,CAAC,EAAA,CAAI,EAAA,CAAI,GAAI,GAAG,CAAA,CAClC,YAAA,CAAAC,CAAAA,CAAe,KACf,SAAA,CAAAC,CAAAA,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AA,CAAS,IAAMG,IAAaH,CAAAA,CAAO,CAAC,CAAA,CACpC,SAAA,CAAU,0PACV,YAAA,CAAW,eAAA,CAEX,QAAA,CAAAoB,GAAAA,CAACW,gBAAA,CAAgB,SAAA,CAAU,QAAA,CAAS,CAAA,CACtC,EAEAd,IAAAA,CAAC,MAAA,CAAA,CAAK,SAAA,CAAU,8CAAA,CAA+C,kBACvDjB,CAAAA,CAAK,KAAA,CAAIU,CAAAA,CAAAA,CACjB,CAAA,CAEAU,IAAC,QAAA,CAAA,CACC,IAAA,CAAK,QAAA,CACL,QAAA,CAAUpB,GAAQU,CAAAA,CAClB,OAAA,CAAS,IAAMP,GAAAA,CAAaH,EAAO,CAAC,CAAA,CACpC,SAAA,CAAU,yPAAA,CACV,aAAW,WAAA,CAEX,QAAA,CAAAoB,GAAAA,CAACY,gBAAAA,CAAA,CAAiB,SAAA,CAAU,QAAA,CAAS,CAAA,CACvC,CAAA,CAAA,CACF,GACF,CAEJ","file":"chunk-IF2CKGBN.js","sourcesContent":["import * as React from \"react\"\r\nimport { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from \"lucide-react\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\nimport {\r\n Combobox,\r\n ComboboxItem,\r\n ComboboxList,\r\n ComboboxPopup,\r\n ComboboxTrigger,\r\n ComboboxValue,\r\n} from \"./combobox\"\r\n\r\nexport interface PaginationProps extends React.ComponentProps<\"div\"> {\r\n page: number\r\n pageSize: number\r\n total: number\r\n onPageChange: (page: number) => void\r\n onPageSizeChange?: (pageSize: number) => void\r\n pageSizeOptions?: number[]\r\n showPageSize?: boolean\r\n showRange?: boolean\r\n}\r\n\r\ntype PageSizeOptionItem = {\r\n label: string\r\n value: number\r\n}\r\n\r\nexport function Pagination({\r\n page,\r\n pageSize,\r\n total,\r\n onPageChange,\r\n onPageSizeChange,\r\n pageSizeOptions = [10, 20, 50, 100],\r\n showPageSize = true,\r\n showRange = true,\r\n className,\r\n ...props\r\n}: PaginationProps) {\r\n const totalPages = Math.max(1, Math.ceil(total / pageSize))\r\n const startItem = total === 0 ? 0 : (page - 1) * pageSize + 1\r\n const endItem = Math.min(page * pageSize, total)\r\n\r\n const items: PageSizeOptionItem[] = React.useMemo(\r\n () => pageSizeOptions.map((opt) => ({ label: String(opt), value: opt })),\r\n [pageSizeOptions]\r\n )\r\n\r\n const selectedItem = React.useMemo(\r\n () => items.find((item) => item.value === pageSize) ?? items[0],\r\n [items, pageSize]\r\n )\r\n\r\n return (\r\n <div\r\n className={cn(\r\n \"flex w-full flex-col-reverse gap-3 mt-4 sm:flex-row sm:items-center sm:justify-between border-t border-border-primary pt-3 text-body-regular-2 text-text-secondary\",\r\n className\r\n )}\r\n data-slot=\"pagination\"\r\n {...props}\r\n >\r\n {/* Left: Rows per page & range */}\r\n <div className=\"flex items-center gap-2\">\r\n {showPageSize && onPageSizeChange && (\r\n <>\r\n <span className=\"text-label-regular-3 text-text-tertiary\">\r\n Rows per page\r\n </span>\r\n <Combobox<PageSizeOptionItem>\r\n items={items}\r\n value={selectedItem}\r\n onValueChange={(item) => {\r\n if (item && onPageSizeChange) {\r\n onPageSizeChange(item.value)\r\n }\r\n }}\r\n isItemEqualToValue={(a, b) => a.value === b.value}\r\n >\r\n <ComboboxTrigger\r\n className=\"h-8 gap-2 rounded-lg border border-border-primary bg-bg-primary px-3 text-label-semibold-3 text-text-primary hover:bg-bg-secondary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border-brand-primary\"\r\n aria-label=\"Rows per page\"\r\n >\r\n <ComboboxValue>\r\n {(val) => (val ? val.label : String(pageSize))}\r\n </ComboboxValue>\r\n <ChevronDownIcon className=\"size-3.5 text-text-tertiary\" />\r\n </ComboboxTrigger>\r\n\r\n <ComboboxPopup className=\"w-24\">\r\n <ComboboxList>\r\n {items.map((item) => (\r\n <ComboboxItem\r\n key={item.value}\r\n value={item}\r\n >\r\n {item.label}\r\n </ComboboxItem>\r\n ))}\r\n </ComboboxList>\r\n </ComboboxPopup>\r\n </Combobox>\r\n </>\r\n )}\r\n\r\n {showPageSize && showRange && (\r\n <span className=\"text-text-tertiary\">·</span>\r\n )}\r\n\r\n {showRange && (\r\n <span className=\"text-label-regular-3 text-text-tertiary\">\r\n {startItem}–{endItem} of {total}\r\n </span>\r\n )}\r\n </div>\r\n\r\n {/* Right: Page controls */}\r\n <div className=\"flex items-center gap-1\">\r\n <button\r\n type=\"button\"\r\n disabled={page <= 1}\r\n onClick={() => onPageChange(page - 1)}\r\n className=\"inline-flex size-8 cursor-pointer items-center justify-center rounded-lg border border-border-primary bg-bg-primary text-text-secondary transition-colors hover:bg-bg-secondary hover:text-text-primary disabled:cursor-not-allowed disabled:opacity-40\"\r\n aria-label=\"Previous page\"\r\n >\r\n <ChevronLeftIcon className=\"size-4\" />\r\n </button>\r\n\r\n <span className=\"px-2 text-label-semibold-3 text-text-primary\">\r\n Page {page} / {totalPages}\r\n </span>\r\n\r\n <button\r\n type=\"button\"\r\n disabled={page >= totalPages}\r\n onClick={() => onPageChange(page + 1)}\r\n className=\"inline-flex size-8 cursor-pointer items-center justify-center rounded-lg border border-border-primary bg-bg-primary text-text-secondary transition-colors hover:bg-bg-secondary hover:text-text-primary disabled:cursor-not-allowed disabled:opacity-40\"\r\n aria-label=\"Next page\"\r\n >\r\n <ChevronRightIcon className=\"size-4\" />\r\n </button>\r\n </div>\r\n </div>\r\n )\r\n}\r\n"]}
1
+ {"version":3,"sources":["../src/ui/pagination.tsx"],"names":["Pagination","page","pageSize","total","onPageChange","onPageSizeChange","pageSizeOptions","showPageSize","showRange","className","props","totalPages","startItem","endItem","items","opt","selectedItem","item","jsxs","cn","Fragment","jsx","Combobox","a","b","ComboboxTrigger","ComboboxValue","val","ChevronDownIcon","ComboboxPopup","ComboboxList","ComboboxItem","ChevronLeftIcon","ChevronRightIcon"],"mappings":"qOA6BO,SAASA,CAAAA,CAAW,CACzB,KAAAC,CAAAA,CACA,QAAA,CAAAC,GAAAA,CACA,KAAA,CAA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A,CAC5B,CAAA,CAAA,CAEJ,EAGAe,IAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,yBAAA,CACb,UAAAG,GAAAA,CAAC,QAAA,CAAA,CACC,IAAA,CAAK,QAAA,CACL,SAAUpB,CAAAA,EAAQ,CAAA,CAClB,OAAA,CAAS,IAAMG,IAAaH,CAAAA,CAAO,CAAC,CAAA,CACpC,SAAA,CAAU,0PACV,YAAA,CAAW,eAAA,CAEX,QAAA,CAAAoB,GAAAA,CAACW,gBAAA,CAAgB,SAAA,CAAU,QAAA,CAAS,CAAA,CACtC,EAEAd,IAAAA,CAAC,MAAA,CAAA,CAAK,SAAA,CAAU,8CAAA,CAA+C,kBACvDjB,CAAAA,CAAK,KAAA,CAAIU,CAAAA,CAAAA,CACjB,CAAA,CAEAU,IAAC,QAAA,CAAA,CACC,IAAA,CAAK,QAAA,CACL,QAAA,CAAUpB,GAAQU,CAAAA,CAClB,OAAA,CAAS,IAAMP,GAAAA,CAAaH,EAAO,CAAC,CAAA,CACpC,SAAA,CAAU,yPAAA,CACV,aAAW,WAAA,CAEX,QAAA,CAAAoB,GAAAA,CAACY,gBAAAA,CAAA,CAAiB,SAAA,CAAU,QAAA,CAAS,CAAA,CACvC,CAAA,CAAA,CACF,GACF,CAEJ","file":"chunk-FF7XATMG.js","sourcesContent":["import * as React from \"react\"\r\nimport { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from \"lucide-react\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\nimport {\r\n Combobox,\r\n ComboboxItem,\r\n ComboboxList,\r\n ComboboxPopup,\r\n ComboboxTrigger,\r\n ComboboxValue,\r\n} from \"./combobox\"\r\n\r\nexport interface PaginationProps extends React.ComponentProps<\"div\"> {\r\n page: number\r\n pageSize: number\r\n total: number\r\n onPageChange: (page: number) => void\r\n onPageSizeChange?: (pageSize: number) => void\r\n pageSizeOptions?: number[]\r\n showPageSize?: boolean\r\n showRange?: boolean\r\n}\r\n\r\ntype PageSizeOptionItem = {\r\n label: string\r\n value: number\r\n}\r\n\r\nexport function Pagination({\r\n page,\r\n pageSize,\r\n total,\r\n onPageChange,\r\n onPageSizeChange,\r\n pageSizeOptions = [10, 20, 50, 100],\r\n showPageSize = true,\r\n showRange = true,\r\n className,\r\n ...props\r\n}: PaginationProps) {\r\n const totalPages = Math.max(1, Math.ceil(total / pageSize))\r\n const startItem = total === 0 ? 0 : (page - 1) * pageSize + 1\r\n const endItem = Math.min(page * pageSize, total)\r\n\r\n const items: PageSizeOptionItem[] = React.useMemo(\r\n () => pageSizeOptions.map((opt) => ({ label: String(opt), value: opt })),\r\n [pageSizeOptions]\r\n )\r\n\r\n const selectedItem = React.useMemo(\r\n () => items.find((item) => item.value === pageSize) ?? items[0],\r\n [items, pageSize]\r\n )\r\n\r\n return (\r\n <div\r\n className={cn(\r\n \"flex w-full flex-col-reverse gap-3 mt-4 sm:flex-row sm:items-center sm:justify-between border-t border-border-primary pt-3 text-body-regular-2 text-text-secondary\",\r\n className\r\n )}\r\n data-slot=\"pagination\"\r\n {...props}\r\n >\r\n {/* Left: Rows per page & range */}\r\n <div className=\"flex items-center gap-2\">\r\n {showPageSize && onPageSizeChange && (\r\n <>\r\n <span className=\"text-label-regular-3 text-text-tertiary\">\r\n Rows per page\r\n </span>\r\n <Combobox<PageSizeOptionItem>\r\n items={items}\r\n value={selectedItem}\r\n onValueChange={(item) => {\r\n if (item && onPageSizeChange) {\r\n onPageSizeChange(item.value)\r\n }\r\n }}\r\n isItemEqualToValue={(a, b) => a.value === b.value}\r\n >\r\n <ComboboxTrigger\r\n className=\"h-8 gap-2 rounded-lg border border-border-primary bg-bg-primary px-3 text-label-semibold-3 text-text-primary hover:bg-bg-secondary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border-brand-primary\"\r\n aria-label=\"Rows per page\"\r\n >\r\n <ComboboxValue>\r\n {(val) => (val ? val.label : String(pageSize))}\r\n </ComboboxValue>\r\n <ChevronDownIcon className=\"size-3.5 text-text-tertiary\" />\r\n </ComboboxTrigger>\r\n\r\n <ComboboxPopup className=\"w-24\">\r\n <ComboboxList>\r\n {items.map((item) => (\r\n <ComboboxItem\r\n key={item.value}\r\n value={item}\r\n >\r\n {item.label}\r\n </ComboboxItem>\r\n ))}\r\n </ComboboxList>\r\n </ComboboxPopup>\r\n </Combobox>\r\n </>\r\n )}\r\n\r\n {showPageSize && showRange && (\r\n <span className=\"text-text-tertiary\">·</span>\r\n )}\r\n\r\n {showRange && (\r\n <span className=\"text-label-regular-3 text-text-tertiary\">\r\n {startItem}–{endItem} of {total}\r\n </span>\r\n )}\r\n </div>\r\n\r\n {/* Right: Page controls */}\r\n <div className=\"flex items-center gap-1\">\r\n <button\r\n type=\"button\"\r\n disabled={page <= 1}\r\n onClick={() => onPageChange(page - 1)}\r\n className=\"inline-flex size-8 cursor-pointer items-center justify-center rounded-lg border border-border-primary bg-bg-primary text-text-secondary transition-colors hover:bg-bg-secondary hover:text-text-primary disabled:cursor-not-allowed disabled:opacity-40\"\r\n aria-label=\"Previous page\"\r\n >\r\n <ChevronLeftIcon className=\"size-4\" />\r\n </button>\r\n\r\n <span className=\"px-2 text-label-semibold-3 text-text-primary\">\r\n Page {page} / {totalPages}\r\n </span>\r\n\r\n <button\r\n type=\"button\"\r\n disabled={page >= totalPages}\r\n onClick={() => onPageChange(page + 1)}\r\n className=\"inline-flex size-8 cursor-pointer items-center justify-center rounded-lg border border-border-primary bg-bg-primary text-text-secondary transition-colors hover:bg-bg-secondary hover:text-text-primary disabled:cursor-not-allowed disabled:opacity-40\"\r\n aria-label=\"Next page\"\r\n >\r\n <ChevronRightIcon className=\"size-4\" />\r\n </button>\r\n </div>\r\n </div>\r\n )\r\n}\r\n"]}
@@ -0,0 +1,2 @@
1
+ import {a,j,i,k,l,m,q,s,w,A,x,H}from'./chunk-AE72UPV5.js';import {f,g}from'./chunk-PHP3T7ZS.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,h]=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]);}}h(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-GWKUM5PE.js.map
2
+ //# sourceMappingURL=chunk-GWKUM5PE.js.map
@@ -0,0 +1 @@
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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CAEFY,GAAAA,CAACiB,CAAAA,CAAA,CAAwB,GAAG/C,CAAAA,CAAgB,CAAA,CAAA,CAC9C,CAAA,CAAA,CACF,GACF,CAEJ","file":"chunk-GWKUM5PE.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 extends { label: string; value: string; image?: string; tag?: true }> = Omit<ComboboxProps<Value, true>, \"multiple\" | \"items\"> & {\r\n multiple?: boolean\r\n inputPlaceholder?: string\r\n container?: React.ComponentProps<typeof ComboboxPortal>[\"container\"]\r\n items?: Value[] | 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"]}
@@ -1,2 +1,2 @@
1
- import {a,b as b$1,j as j$1,i,k,l,m,q,s,w,H}from'./chunk-DUSAF7E7.js';import {g}from'./chunk-ZNZVX4PT.js';import {b}from'./chunk-JH6RZ3QH.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=true,inputPlaceholder:B="Search...",container:q$1,items:u,infiniteScroll:A,isPending:H$1,taggable:c=false,maxVisible:i$1,...m$1}){let[h,g$1]=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,I]=r.useState([]),d=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.current=new Set(l.map(a=>a.value)),l)});},[b$2]);let n=h?.toString().trim()??"",U=r.useMemo(()=>n?b$2.some(e=>e.value.toLowerCase()===n.toLowerCase()):false,[n,b$2]),p=r.useMemo(()=>!c||!n?false:!u?.some(e=>e.label.toLowerCase()===n.toLowerCase()),[c,n,u]),X=r.useMemo(()=>{let e=[...u??[],...v];if(p){let t={label:n,value:n,tag:true};return [...e,t]}return e},[u,v,p,n]);return jsxs(a,{...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.current.has(a.value));if(l.length>0){for(let a of l)d.current.add(a.value);I(a=>[...a,...l]);}}x(z?e:[e[e.length-1]],t);},onInputValueChange:g$1,children:[jsxs("div",{className:"flex flex-col gap-2",children:[jsx(g,{render:jsx(b,{className:"h-9 text-body-regular-3 pl-9 pr-7",endContent:jsx(b$1,{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$1("",{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(j$1,{className:cn(i$1!==void 0&&"flex-nowrap overflow-hidden"),onMouseDown:e=>e.preventBaseUIHandler(),children:jsx(i,{children:e=>{let t=i$1!==void 0?e.slice(0,i$1):e,l$1=i$1!==void 0?e.length-i$1:0;return jsxs(Fragment,{children:[t?.map(a=>jsxs(k,{className:cn(i$1!==void 0&&"min-w-0 shrink"),children:[i$1!==void 0?jsx("span",{className:"truncate",children:a?.label||""}):a?.label||"",jsx(l,{})]},a?.value||"")),l$1>0&&jsxs(k,{className:"shrink-0",children:["+",l$1]})]})}})})]}),jsxs(m,{container:q$1,children:[jsx(q,{status:H$1||u===void 0?"pending":u?.length===0&&!p?"empty":null}),jsxs(s,{children:[u?.map(e=>jsx(w,{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&&jsx(w,{value:{label:n,value:n,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})]})}),jsx(H,{...A})]})]})]})}export{j as a};//# sourceMappingURL=chunk-U3IMR5VI.js.map
2
- //# sourceMappingURL=chunk-U3IMR5VI.js.map
1
+ import {a,b as b$1,j as j$1,i,k,l,m,q,s,w,H}from'./chunk-AE72UPV5.js';import {g}from'./chunk-PHP3T7ZS.js';import {b}from'./chunk-JH6RZ3QH.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=true,inputPlaceholder:B="Search...",container:q$1,items:u,infiniteScroll:A,isPending:H$1,taggable:c=false,maxVisible:i$1,...m$1}){let[h,g$1]=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,I]=r.useState([]),d=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.current=new Set(l.map(a=>a.value)),l)});},[b$2]);let n=h?.toString().trim()??"",U=r.useMemo(()=>n?b$2.some(e=>e.value.toLowerCase()===n.toLowerCase()):false,[n,b$2]),p=r.useMemo(()=>!c||!n?false:!u?.some(e=>e.label.toLowerCase()===n.toLowerCase()),[c,n,u]),X=r.useMemo(()=>{let e=[...u??[],...v];if(p){let t={label:n,value:n,tag:true};return [...e,t]}return e},[u,v,p,n]);return jsxs(a,{...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.current.has(a.value));if(l.length>0){for(let a of l)d.current.add(a.value);I(a=>[...a,...l]);}}x(z?e:[e[e.length-1]],t);},onInputValueChange:g$1,children:[jsxs("div",{className:"flex flex-col gap-2",children:[jsx(g,{render:jsx(b,{className:"h-9 text-body-regular-3 pl-9 pr-7",endContent:jsx(b$1,{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$1("",{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(j$1,{className:cn(i$1!==void 0&&"flex-nowrap overflow-hidden"),onMouseDown:e=>e.preventBaseUIHandler(),children:jsx(i,{children:e=>{let t=i$1!==void 0?e.slice(0,i$1):e,l$1=i$1!==void 0?e.length-i$1:0;return jsxs(Fragment,{children:[t?.map(a=>jsxs(k,{className:cn(i$1!==void 0&&"min-w-0 shrink"),children:[i$1!==void 0?jsx("span",{className:"truncate",children:a?.label||""}):a?.label||"",jsx(l,{})]},a?.value||"")),l$1>0&&jsxs(k,{className:"shrink-0",children:["+",l$1]})]})}})})]}),jsxs(m,{container:q$1,children:[jsx(q,{status:H$1||u===void 0?"pending":u?.length===0&&!p?"empty":null}),jsxs(s,{children:[u?.map(e=>jsx(w,{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&&jsx(w,{value:{label:n,value:n,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})]})}),jsx(H,{...A})]})]})]})}export{j as a};//# sourceMappingURL=chunk-KJBLPFUU.js.map
2
+ //# sourceMappingURL=chunk-KJBLPFUU.js.map