@xploreu/components 0.4.41 → 0.4.43

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 (102) hide show
  1. package/dist/{chunk-3QGG35QR.js → chunk-5VZ6QNBI.js} +2 -2
  2. package/dist/{chunk-3QGG35QR.js.map → chunk-5VZ6QNBI.js.map} +1 -1
  3. package/dist/chunk-A5644ETE.js +2 -0
  4. package/dist/chunk-A5644ETE.js.map +1 -0
  5. package/dist/{chunk-77T5FOYW.js → chunk-C675EWZW.js} +2 -2
  6. package/dist/{chunk-77T5FOYW.js.map → chunk-C675EWZW.js.map} +1 -1
  7. package/dist/chunk-DL6MI55G.js +2 -0
  8. package/dist/chunk-DL6MI55G.js.map +1 -0
  9. package/dist/chunk-DNAWFZ7O.js +2 -0
  10. package/dist/chunk-DNAWFZ7O.js.map +1 -0
  11. package/dist/chunk-F56BLRF2.js +2 -0
  12. package/dist/{chunk-UR3YD2QR.js.map → chunk-F56BLRF2.js.map} +1 -1
  13. package/dist/{chunk-WWCXHCNU.js → chunk-F77XVICY.js} +2 -2
  14. package/dist/{chunk-WWCXHCNU.js.map → chunk-F77XVICY.js.map} +1 -1
  15. package/dist/{chunk-YB74L6RO.js → chunk-H6ETV455.js} +2 -2
  16. package/dist/{chunk-YB74L6RO.js.map → chunk-H6ETV455.js.map} +1 -1
  17. package/dist/{chunk-IT4LPPTN.js → chunk-HGLHAEGH.js} +2 -2
  18. package/dist/{chunk-IT4LPPTN.js.map → chunk-HGLHAEGH.js.map} +1 -1
  19. package/dist/{chunk-UBTCCHVI.js → chunk-KUOFW7JO.js} +2 -2
  20. package/dist/{chunk-UBTCCHVI.js.map → chunk-KUOFW7JO.js.map} +1 -1
  21. package/dist/chunk-MO7LQLS4.js +2 -0
  22. package/dist/chunk-MO7LQLS4.js.map +1 -0
  23. package/dist/{chunk-EE5QQGMX.js → chunk-NFLQZ5NB.js} +2 -2
  24. package/dist/{chunk-EE5QQGMX.js.map → chunk-NFLQZ5NB.js.map} +1 -1
  25. package/dist/chunk-OHLNKXSV.js +2 -0
  26. package/dist/chunk-OHLNKXSV.js.map +1 -0
  27. package/dist/{chunk-WV5OCKQK.js → chunk-RAVBRPQS.js} +2 -2
  28. package/dist/{chunk-WV5OCKQK.js.map → chunk-RAVBRPQS.js.map} +1 -1
  29. package/dist/{chunk-IZQFTYJD.js → chunk-RHWRIE3E.js} +2 -2
  30. package/dist/{chunk-IZQFTYJD.js.map → chunk-RHWRIE3E.js.map} +1 -1
  31. package/dist/chunk-UINS73U7.js +2 -0
  32. package/dist/chunk-UINS73U7.js.map +1 -0
  33. package/dist/{chunk-VHPUQQ6L.js → chunk-V2PW53KI.js} +2 -2
  34. package/dist/{chunk-VHPUQQ6L.js.map → chunk-V2PW53KI.js.map} +1 -1
  35. package/dist/chunk-VIBM666E.js +2 -0
  36. package/dist/chunk-VIBM666E.js.map +1 -0
  37. package/dist/{chunk-CDHMNEJ5.js → chunk-WN22TTEL.js} +2 -2
  38. package/dist/{chunk-CDHMNEJ5.js.map → chunk-WN22TTEL.js.map} +1 -1
  39. package/dist/{chunk-AVJU2H5V.js → chunk-XIZN73T3.js} +2 -2
  40. package/dist/{chunk-AVJU2H5V.js.map → chunk-XIZN73T3.js.map} +1 -1
  41. package/dist/chunk-Y6TKCAAJ.js +2 -0
  42. package/dist/chunk-Y6TKCAAJ.js.map +1 -0
  43. package/dist/{chunk-ON7PUZWI.js → chunk-YNJZ2P52.js} +2 -2
  44. package/dist/{chunk-ON7PUZWI.js.map → chunk-YNJZ2P52.js.map} +1 -1
  45. package/dist/{chunk-LFNLGW5G.js → chunk-YPV6XEV4.js} +2 -2
  46. package/dist/{chunk-LFNLGW5G.js.map → chunk-YPV6XEV4.js.map} +1 -1
  47. package/dist/{chunk-KL2GG3KE.js → chunk-ZK7MHZFG.js} +2 -2
  48. package/dist/{chunk-KL2GG3KE.js.map → chunk-ZK7MHZFG.js.map} +1 -1
  49. package/dist/composites/combobox-chip-outside.js +1 -1
  50. package/dist/composites/combobox-chip.js +1 -1
  51. package/dist/composites/combobox-simple.js +1 -1
  52. package/dist/composites/filter-combobox.js +1 -1
  53. package/dist/composites/index.js +1 -1
  54. package/dist/composites/phone-input.js +1 -1
  55. package/dist/form/form-input.d.ts +3 -3
  56. package/dist/form/form-input.js +1 -1
  57. package/dist/form/form-textarea.d.ts +5 -3
  58. package/dist/form/form-textarea.js +1 -1
  59. package/dist/form/form.d.ts +1 -1
  60. package/dist/form/form.js +1 -1
  61. package/dist/form/index.js +1 -1
  62. package/dist/ui/alert-dialog.js +1 -1
  63. package/dist/ui/alert.d.ts +1 -1
  64. package/dist/ui/alerter.js +1 -1
  65. package/dist/ui/badge.d.ts +2 -2
  66. package/dist/ui/button.d.ts +1 -1
  67. package/dist/ui/button.js +1 -1
  68. package/dist/ui/calendar.js +1 -1
  69. package/dist/ui/carousel.js +1 -1
  70. package/dist/ui/combobox.js +1 -1
  71. package/dist/ui/date-multiple-picker.js +1 -1
  72. package/dist/ui/date-picker.js +1 -1
  73. package/dist/ui/date-range-picker.js +1 -1
  74. package/dist/ui/index.d.ts +2 -2
  75. package/dist/ui/index.js +1 -1
  76. package/dist/ui/input.d.ts +1 -1
  77. package/dist/ui/input.js +1 -1
  78. package/dist/ui/label.d.ts +2 -2
  79. package/dist/ui/label.js +1 -1
  80. package/dist/ui/pagination.js +1 -1
  81. package/dist/ui/tabs.js +1 -1
  82. package/dist/ui/textarea.d.ts +7 -2
  83. package/dist/ui/textarea.js +1 -1
  84. package/dist/ui/toast.js +1 -1
  85. package/package.json +1 -1
  86. package/dist/chunk-3ASGRRVT.js +0 -2
  87. package/dist/chunk-3ASGRRVT.js.map +0 -1
  88. package/dist/chunk-4PIKXPNO.js +0 -2
  89. package/dist/chunk-4PIKXPNO.js.map +0 -1
  90. package/dist/chunk-G6HDEOYZ.js +0 -2
  91. package/dist/chunk-G6HDEOYZ.js.map +0 -1
  92. package/dist/chunk-JH6RZ3QH.js +0 -2
  93. package/dist/chunk-JH6RZ3QH.js.map +0 -1
  94. package/dist/chunk-K2BMQ2TN.js +0 -2
  95. package/dist/chunk-K2BMQ2TN.js.map +0 -1
  96. package/dist/chunk-K7GGFR7W.js +0 -2
  97. package/dist/chunk-K7GGFR7W.js.map +0 -1
  98. package/dist/chunk-PJYKUR4F.js +0 -2
  99. package/dist/chunk-PJYKUR4F.js.map +0 -1
  100. package/dist/chunk-UR3YD2QR.js +0 -2
  101. package/dist/chunk-VNAMAKPG.js +0 -2
  102. package/dist/chunk-VNAMAKPG.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/form/form.tsx"],"names":["Form","FormProvider","FormFieldContext","FormField","props","jsx","Controller","useFormField","fieldContext","itemContext","FormItemContext","context","useFormContext","formState","useFormState","fieldState","id","FormItem","className","cn","FormLabel","size","error","formItemId","Label","FormControl","formDescriptionId","formMessageId","Slot","formInformationVariants","cva","FormDescription","jsxs","InfoIcon","FormMessage","body"],"mappings":"+UAmBA,IAAMA,CAAAA,CAAOC,YAAAA,CASPC,CAAAA,CAAyB,CAAA,CAAA,aAAA,CAC7B,EACF,CAAA,CAEMC,CAAAA,CAAY,CAGhB,CACA,GAAGC,CACL,CAAA,GAEIC,GAAAA,CAACH,CAAAA,CAAiB,QAAA,CAAjB,CAA0B,KAAA,CAAO,CAAE,IAAA,CAAME,CAAAA,CAAM,IAAK,CAAA,CACnD,QAAA,CAAAC,IAACC,UAAAA,CAAA,CAAY,GAAGF,CAAAA,CAAO,CAAA,CACzB,CAAA,CAIEG,EAAe,IAAM,CACzB,IAAMC,CAAAA,CAAqB,CAAA,CAAA,UAAA,CAAWN,CAAgB,EAChDO,CAAAA,CAAoB,CAAA,CAAA,UAAA,CAAWC,CAAe,CAAA,CAC9CC,CAAAA,CAAUC,cAAAA,GACVC,CAAAA,CAAYC,YAAAA,CAAa,CAAE,IAAA,CAAMN,CAAAA,CAAa,IAAK,CAAC,CAAA,CAE1D,GAAI,CAACA,CAAAA,CACH,M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EAAAA,CAAGU,CAAAA,CAAwB,CAAE,IAAA,CAAAR,CAAK,CAAC,CAAA,CAAGH,CAAS,CAAA,CAC7D,UAAAb,GAAAA,CAAC4B,QAAAA,CAAA,EAAS,CAAA,CACV5B,GAAAA,CAAC,KACC,WAAA,CAAU,kBAAA,CACV,EAAA,CAAIqB,CAAAA,CACH,GAAGtB,CAAAA,CACN,GACF,CAAA,CAXO,IAaX,CAEA,SAAS8B,CAAAA,CAAY,CAAE,UAAAhB,CAAAA,CAAW,IAAA,CAAAG,CAAAA,CAAM,GAAGjB,CAAM,CAAA,CAE/C,CACA,GAAM,CAAE,MAAAkB,CAAAA,CAAO,aAAA,CAAAK,CAAc,CAAA,CAAIpB,CAAAA,EAAa,CACxC4B,CAAAA,CAAOb,CAAAA,CAAQ,MAAA,CAAOA,GAAO,OAAA,EAAW,EAAE,CAAA,CAAIlB,CAAAA,CAAM,QAAA,CAE1D,OAAK+B,EAKHH,IAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAWb,EAAAA,CAAGU,CAAAA,CAAwB,CAAE,KAAAR,CAAAA,CAAM,KAAA,CAAO,QAAS,CAAC,CAAA,CAAGH,CAAS,CAAA,CAC9E,QAAA,CAAA,CAAAb,GAAAA,CAAC4B,QAAAA,CAAA,EAAS,CAAA,CACV5B,IAAC,GAAA,CAAA,CACC,WAAA,CAAU,cAAA,CACV,EAAA,CAAIsB,CAAAA,CACH,GAAGvB,EAEH,QAAA,CAAA+B,CAAAA,CACH,CAAA,CAAA,CACF,CAAA,CAbO,IAeX","file":"chunk-OHLNKXSV.js","sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\nimport { Slot } from \"@radix-ui/react-slot\"\r\nimport { cva, type VariantProps } from \"class-variance-authority\"\r\nimport { InfoIcon } from \"lucide-react\"\r\nimport {\r\n Controller,\r\n type ControllerProps,\r\n type FieldPath,\r\n type FieldValues,\r\n FormProvider,\r\n useFormContext,\r\n useFormState,\r\n} from \"react-hook-form\"\r\n\r\nimport { Label } from \"../ui/label\"\r\nimport { cn } from \"@xploreu/lib/cn\"\r\n\r\nconst Form = FormProvider\r\n\r\ntype FormFieldContextValue<\r\n TFieldValues extends FieldValues = FieldValues,\r\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\r\n> = {\r\n name: TName\r\n}\r\n\r\nconst FormFieldContext = React.createContext<FormFieldContextValue>(\r\n {} as FormFieldContextValue\r\n)\r\n\r\nconst FormField = <\r\n TFieldValues extends FieldValues = FieldValues,\r\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\r\n>({\r\n ...props\r\n}: ControllerProps<TFieldValues, TName>) => {\r\n return (\r\n <FormFieldContext.Provider value={{ name: props.name }}>\r\n <Controller {...props} />\r\n </FormFieldContext.Provider>\r\n )\r\n}\r\n\r\nconst useFormField = () => {\r\n const fieldContext = React.useContext(FormFieldContext)\r\n const itemContext = React.useContext(FormItemContext)\r\n const context = useFormContext()\r\n const formState = useFormState({ name: fieldContext.name })\r\n\r\n if (!fieldContext) {\r\n throw new Error(\"useFormField should be used within <FormField>\")\r\n }\r\n\r\n const fieldState = context ? context.getFieldState(fieldContext.name, formState) : { error: undefined, invalid: false, isDirty: false, isTouched: false }\r\n const { id } = itemContext\r\n\r\n return {\r\n id,\r\n name: fieldContext.name,\r\n formItemId: `${id}-form-item`,\r\n formDescriptionId: `${id}-form-item-description`,\r\n formMessageId: `${id}-form-item-message`,\r\n ...fieldState,\r\n }\r\n}\r\n\r\ntype FormItemContextValue = {\r\n id: string\r\n}\r\n\r\nconst FormItemContext = React.createContext<FormItemContextValue>(\r\n {} as FormItemContextValue\r\n)\r\n\r\nfunction FormItem({ className, ...props }: React.ComponentProps<\"div\">) {\r\n const id = React.useId()\r\n\r\n return (\r\n <FormItemContext.Provider value={{ id }}>\r\n <div\r\n className={cn(\"grid gap-1\", className)}\r\n data-slot=\"form-item\"\r\n {...props}\r\n />\r\n </FormItemContext.Provider>\r\n )\r\n}\r\n\r\nfunction FormLabel({\r\n className,\r\n size,\r\n ...props\r\n}: React.ComponentProps<typeof Label>) {\r\n const { error, formItemId } = useFormField()\r\n\r\n return (\r\n <Label\r\n className={cn(\"data-[error=true]:text-text-error-primary\", className)}\r\n data-error={!!error}\r\n data-slot=\"form-label\"\r\n htmlFor={formItemId}\r\n size={size}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\nfunction FormControl({ ...props }: React.ComponentProps<typeof Slot>) {\r\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField()\r\n\r\n return (\r\n <Slot\r\n aria-describedby={\r\n !error\r\n ? `${formDescriptionId}`\r\n : `${formDescriptionId} ${formMessageId}`\r\n }\r\n aria-invalid={!!error}\r\n data-slot=\"form-control\"\r\n id={formItemId}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\nconst formInformationVariants = cva(\"inline-flex items-center gap-1 w-full [&>svg]:min-w-min\", {\r\n variants: {\r\n color: {\r\n default: \"text-text-disabled\",\r\n danger: \"text-text-error-primary\",\r\n },\r\n size: {\r\n \"3xs\": \"text-label-regular-4 [&>svg]:size-2.5\",\r\n \"2xs\": \"text-label-regular-4 [&>svg]:size-2.5\",\r\n xs: \"text-body-regular-3 [&>svg]:size-2.5\",\r\n sm: \"text-body-regular-3 [&>svg]:size-2.5\",\r\n md: \"text-body-regular-3 [&>svg]:size-3\",\r\n lg: \"text-body-regular-2 [&>svg]:size-3.5\",\r\n xl: \"text-body-regular-2 [&>svg]:size-3.5\",\r\n },\r\n },\r\n defaultVariants: {\r\n color: \"default\",\r\n size: \"md\",\r\n }\r\n})\r\n\r\nfunction FormDescription({ className, size, ...props }: React.ComponentProps<\"p\"> &\r\n VariantProps<typeof formInformationVariants>\r\n) {\r\n const { formDescriptionId } = useFormField()\r\n\r\n if (!props.children) {\r\n return null\r\n }\r\n\r\n return (\r\n <div className={cn(formInformationVariants({ size }), className)}>\r\n <InfoIcon />\r\n <p\r\n data-slot=\"form-description\"\r\n id={formDescriptionId}\r\n {...props}\r\n />\r\n </div>\r\n )\r\n}\r\n\r\nfunction FormMessage({ className, size, ...props }: React.ComponentProps<\"p\"> &\r\n VariantProps<typeof formInformationVariants>\r\n) {\r\n const { error, formMessageId } = useFormField()\r\n const body = error ? String(error?.message ?? \"\") : props.children\r\n\r\n if (!body) {\r\n return null\r\n }\r\n\r\n return (\r\n <div className={cn(formInformationVariants({ size, color: \"danger\" }), className)}>\r\n <InfoIcon />\r\n <p\r\n data-slot=\"form-message\"\r\n id={formMessageId}\r\n {...props}\r\n >\r\n {body}\r\n </p>\r\n </div>\r\n )\r\n}\r\n\r\nexport {\r\n Form,\r\n FormControl,\r\n FormDescription,\r\n FormField,\r\n FormItem,\r\n FormLabel,\r\n FormMessage,\r\n useFormField,\r\n}\r\n"]}
@@ -1,2 +1,2 @@
1
- import {a,j,i,k,l,m,q,s,w,A,x,H}from'./chunk-IZQFTYJD.js';import {f,g}from'./chunk-HHG7BSWN.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-WV5OCKQK.js.map
2
- //# sourceMappingURL=chunk-WV5OCKQK.js.map
1
+ import {a,j,i,k,l,m,q,s,w,A,x,H}from'./chunk-RHWRIE3E.js';import {f,g}from'./chunk-HHG7BSWN.js';import {a as a$1}from'./chunk-Y6TKCAAJ.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-RAVBRPQS.js.map
2
+ //# sourceMappingURL=chunk-RAVBRPQS.js.map
@@ -1 +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,gBAAA,CAAAC,GAAAA,CAAmB,WAAA,CACnB,SAAA,CAAAC,GAAAA,CACA,KAAA,CAAAC,GAAAA,CACA,cAAA,CAAAC,EACA,SAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CAAW,KAAA,CACX,UAAA,CAAAC,CAAAA,CACA,GAAGC,GACL,CAAA,CAA6B,CAC3B,GAAM,CAACC,CAAAA,CAAYC,CAAa,CAAA,CAAIC,kBAAAA,CAAmB,CACrD,KAAA,CAAOH,GAAAA,EAAO,UAAA,EAAY,QAAA,EAAS,CACnC,YAAA,CAAcA,GAAAA,EAAO,iBAAA,EAAmB,UAAS,CACjD,QAAA,CAAUA,GAAAA,EAAO,kBACnB,CAAC,CAAA,CAEK,CAACI,GAAAA,CAAOC,CAAQ,EAAIF,kBAAAA,CAAmB,CAC3C,KAAA,CAAOH,GAAAA,EAAO,KAAA,EAAS,EAAC,CACxB,YAAA,CAAcA,KAAO,YAAA,EAAgB,EAAC,CACtC,QAAA,CAAUA,GAAAA,EAAO,aACnB,CAAC,CAAA,CAIK,CAACM,CAAAA,CAAcC,CAAe,CAAA,CAAU,CAAA,CAAA,QAAA,CAAkB,EAAE,CAAA,CAC5DC,CAAAA,CAAyB,SAAoB,IAAI,GAAK,CAAA,CAEtD,CAAA,CAAA,SAAA,CAAU,IAAM,CACpB,IAAMC,CAAAA,CAAgB,IAAI,GAAA,CAAIL,GAAAA,CAAM,GAAA,CAAKM,CAAAA,EAAMA,CAAAA,CAAE,KAAK,CAAC,CAAA,CACvDH,EAAiBI,CAAA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K,IAAK,CAAA,CAE5D,QAAA,CAAA,CAAA,CAACC,CAAAA,EACAI,IAAAA,CAAC,MAAA,CAAA,CAAK,SAAA,CAAU,qDAAqD,QAAA,CAAA,CAAA,UAAA,CAASL,CAAAA,CAAAA,CAAa,CAAA,CAE5FC,CAAAA,EACCW,GAAAA,CAACgB,CAAAA,CAAA,CAAmB,QAAA,CAAA5B,EAAa,CAAA,CAAA,CAErC,CAAA,CAEFY,GAAAA,CAACiB,CAAAA,CAAA,CAAwB,GAAG/C,CAAAA,CAAgB,CAAA,CAAA,CAC9C,CAAA,CAAA,CACF,GACF,CAEJ","file":"chunk-WV5OCKQK.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
+ {"version":3,"sources":["../src/composites/combobox-chip.tsx"],"names":["ComboboxChip","multiple","inputPlaceholder","container","items","infiniteScroll","isPending","taggable","maxVisible","props","inputValue","setInputValue","useControlledState","value","setValue","createdItems","setCreatedItems","createdValuesRef","currentValues","v","prev","next","item","trimmedInput","isInputSelected","isCreatingItem","combinedItems","base","jsxs","Combobox","a","b","eventDetails","newTags","tag","jsx","ComboboxInputGroup","cn","inputVariants","ComboboxChips","ComboboxValue","visible","overflow","Fragment","ComboboxChipRemove","ComboboxInput","ComboboxPopup","ComboboxStatus","ComboboxList","ComboboxItem","ComboboxItemAvatar","ComboboxItemTitle","ComboboxInfiniteScroll"],"mappings":"2TA+CA,SAASA,CAAAA,CAAyF,CAChG,QAAA,CAAAC,CAAAA,CAAW,KACX,gBAAA,CAAAC,GAAAA,CAAmB,WAAA,CACnB,SAAA,CAAAC,GAAAA,CACA,KAAA,CAAAC,GAAAA,CACA,cAAA,CAAAC,EACA,SAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CAAW,KAAA,CACX,UAAA,CAAAC,CAAAA,CACA,GAAGC,GACL,CAAA,CAA6B,CAC3B,GAAM,CAACC,CAAAA,CAAYC,CAAa,CAAA,CAAIC,kBAAAA,CAAmB,CACrD,KAAA,CAAOH,GAAAA,EAAO,UAAA,EAAY,QAAA,EAAS,CACnC,YAAA,CAAcA,GAAAA,EAAO,iBAAA,EAAmB,UAAS,CACjD,QAAA,CAAUA,GAAAA,EAAO,kBACnB,CAAC,CAAA,CAEK,CAACI,GAAAA,CAAOC,CAAQ,EAAIF,kBAAAA,CAAmB,CAC3C,KAAA,CAAOH,GAAAA,EAAO,KAAA,EAAS,EAAC,CACxB,YAAA,CAAcA,KAAO,YAAA,EAAgB,EAAC,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MAAA,CAAO,OAAO,CAAA,CAAE,KAAK,EAAE,CAAA,CACzF,QAAA,CAAUA,CAAAA,CAAK,KAAA,CACjB,CAAA,CAEFa,GAAAA,CAACgB,CAAAA,CAAA,CAAmB,QAAA,CAAA7B,CAAAA,CAAK,KAAA,CAAM,CAAA,CAAA,CAAA,CAV1BA,CAAAA,CAAK,KAWZ,CACD,CAAA,CACAG,GACCG,IAAAA,CAACqB,CAAAA,CAAA,CACC,KAAA,CAAO,CAAE,KAAA,CAAO1B,CAAAA,CAAc,KAAA,CAAOA,EAAc,GAAA,CAAK,IAAK,CAAA,CAE5D,QAAA,CAAA,CAAA,CAACC,CAAAA,EACAI,IAAAA,CAAC,MAAA,CAAA,CAAK,SAAA,CAAU,qDAAqD,QAAA,CAAA,CAAA,UAAA,CAASL,CAAAA,CAAAA,CAAa,CAAA,CAE5FC,CAAAA,EACCW,GAAAA,CAACgB,CAAAA,CAAA,CAAmB,QAAA,CAAA5B,EAAa,CAAA,CAAA,CAErC,CAAA,CAEFY,GAAAA,CAACiB,CAAAA,CAAA,CAAwB,GAAG/C,CAAAA,CAAgB,CAAA,CAAA,CAC9C,CAAA,CAAA,CACF,GACF,CAEJ","file":"chunk-RAVBRPQS.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 {c,d,e,f,g,a,h,i,j,k,l,m,n,o,p,q,r,s,E,t,u,v,w,x,y,z,A,B,C,D}from'./chunk-HHG7BSWN.js';import {a as a$3}from'./chunk-TED2PUK6.js';import {b}from'./chunk-JH6RZ3QH.js';import {a as a$1}from'./chunk-7P4PFMCM.js';import {a as a$2}from'./chunk-XG3W7QMP.js';import {b as b$2,c as c$1,d as d$1}from'./chunk-BES6JPWQ.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 No(o){return jsx(c,{...o})}function bo(o){let{className:t,...r}=o;return jsx(d,{className:cn("group/combobox-trigger flex items-center gap-2",t),...r})}function wo(o){let{className:t,...r}=o;return jsx(e,{className:cn("text-label-semibold-2 text-text-secondary",t),...r})}function ko(o){let{className:t,...r}=o;return jsx(f,{className:cn("flex w-full items-center gap-2",t),...r})}function Lo({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 Ro({className:o,displayValueKey:t={label:"label",value:"value"},placeholder:r="Search and Select Company",inputProps:m,...i}){let{inputValue:s,setInputValue:p}=a(),{className:n,startContent:x,...to}=m||{};return jsx("div",{className:cn("flex flex-col gap-2",o),children:jsxs(mo,{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(bo,{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":!s,"data-slot":"combobox-clear-input",onClick:C=>{p("",{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"}),...to}),...i}),jsx(io,{children:C=>C?.map(y=>jsxs(so,{children:[y?.[t.label]||"",jsx(po,{})]},y?.[t.value]||""))})]})})}function So(o){let{className:t,...r}=o;return jsx(h,{className:cn("text-text-secondary",t),...r})}function Go(o){return jsx(i,{render:jsx(XIcon,{}),...o})}function io(o){return jsx(j,{...o})}function mo({className:o,...t}){return jsx(k,{className:cn("flex flex-wrap gap-2",o),...t})}function so({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 po({className:o,...t}){return jsx(e$1,{className:cn("text-fg-quaternary",o),render:jsx(m,{...t})})}function Ao({className:o$1,align:t="start",sideOffset:r=4,container:m,initialFocus:i,finalFocus:s,style:p$1,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:s,initialFocus:i,style:p$1,children:jsx(ao,{children:n$1})})})})}function Ho(o){return jsx(n,{...o})}function Vo(o$1){return jsx(o,{...o$1})}function To(o){let{className:t,...r}=o;return jsx(q,{className:cn("bg-black/30",t),...r})}function zo({className:o,status:t,...r$1}){let{inputValue:m}=a(),i=m?.toString().trim(),p=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",!p&&"hidden",o),...r$1,children:p})}function Bo({className:o,...t}){return jsx(s,{className:cn("px-3 py-2 text-body-regular-2 text-text-secondary",o),...t})}function Eo({className:o,children:t$1,...r}){let m=E();return jsx(a$1,{size:"sm",viewportRender:jsx(t,{className:cn("max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] flex flex-col p-1 focus-visible:outline-none data-[empty]:hidden",o),...r,children:typeof t$1=="function"?(i,s)=>t$1(i,s,m.length):t$1})})}function ao(o){let{className:t,...r}=o;return jsx(u,{className:cn("absolute inset-0 bg-bg-primary-hover",t),...r})}function no(o){return jsx(v,{...o})}function Fo(o){let{className:t,...r}=o;return jsx(w,{className:cn("group/combobox-row",t),...r})}function Mo({className:o,children:t,indicator:r="check-circle",...m}){let{disabled:i}=m;return jsx(no,{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(xo,{className:"absolute group-data-[indicator=check-circle]/combobox-item:right-2 group-data-[indicator=checkbox]/combobox-item:left-2",keepMounted:r==="checkbox",render:(s,p)=>jsxs("span",{...s,children:[r==="check-circle"&&jsx(CheckCircle2Icon,{className:"size-4 text-fg-brand-primary shrink-0"}),r==="checkbox"&&jsx(a$2,{checked:p.selected})]})})]})})}function Do({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 Oo({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 qo({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 _o({src:o,imageSrc:t,className:r,avatarClassName:m,imageAlt:i,fallbackText:s,children:p,...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:s??p})]})})}function xo(o){return jsx(y,{...o})}function jo(o){let{className:t,...r}=o;return jsx(z,{className:cn("my-1 h-px bg-border-primary",t),...r})}function Uo(o){let{className:t,...r}=o;return jsx(A,{className:cn("py-1",t),...r})}function Xo(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 $o(o){return jsx(C,{...o})}function Jo(o){let{className:t,...r}=o;return jsx(D,{className:cn("fill-bg-primary",t),...r})}function Ko({hasMore:o,threshold:t=.5,...r}){return jsx(a$3,{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{_o as A,xo as B,jo as C,Uo as D,Xo as E,$o as F,Jo as G,Ko as H,No as a,bo as b,wo as c,ko as d,Lo as e,Ro as f,So as g,Go as h,io as i,mo as j,so as k,po as l,Ao as m,Ho as n,Vo as o,To as p,zo as q,Bo as r,Eo as s,ao as t,no as u,Fo as v,Mo as w,Do as x,Oo as y,qo as z};//# sourceMappingURL=chunk-IZQFTYJD.js.map
2
- //# sourceMappingURL=chunk-IZQFTYJD.js.map
1
+ import {c,d,e,f,g,a,h,i,j,k,l,m,n,o,p,q,r,s,E,t,u,v,w,x,y,z,A,B,C,D}from'./chunk-HHG7BSWN.js';import {a as a$3}from'./chunk-TED2PUK6.js';import {b}from'./chunk-Y6TKCAAJ.js';import {a as a$1}from'./chunk-7P4PFMCM.js';import {a as a$2}from'./chunk-XG3W7QMP.js';import {b as b$2,c as c$1,d as d$1}from'./chunk-BES6JPWQ.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 No(o){return jsx(c,{...o})}function bo(o){let{className:t,...r}=o;return jsx(d,{className:cn("group/combobox-trigger flex items-center gap-2",t),...r})}function wo(o){let{className:t,...r}=o;return jsx(e,{className:cn("text-label-semibold-2 text-text-secondary",t),...r})}function ko(o){let{className:t,...r}=o;return jsx(f,{className:cn("flex w-full items-center gap-2",t),...r})}function Lo({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 Ro({className:o,displayValueKey:t={label:"label",value:"value"},placeholder:r="Search and Select Company",inputProps:m,...i}){let{inputValue:s,setInputValue:p}=a(),{className:n,startContent:x,...to}=m||{};return jsx("div",{className:cn("flex flex-col gap-2",o),children:jsxs(mo,{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(bo,{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":!s,"data-slot":"combobox-clear-input",onClick:C=>{p("",{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"}),...to}),...i}),jsx(io,{children:C=>C?.map(y=>jsxs(so,{children:[y?.[t.label]||"",jsx(po,{})]},y?.[t.value]||""))})]})})}function So(o){let{className:t,...r}=o;return jsx(h,{className:cn("text-text-secondary",t),...r})}function Go(o){return jsx(i,{render:jsx(XIcon,{}),...o})}function io(o){return jsx(j,{...o})}function mo({className:o,...t}){return jsx(k,{className:cn("flex flex-wrap gap-2",o),...t})}function so({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 po({className:o,...t}){return jsx(e$1,{className:cn("text-fg-quaternary",o),render:jsx(m,{...t})})}function Ao({className:o$1,align:t="start",sideOffset:r=4,container:m,initialFocus:i,finalFocus:s,style:p$1,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:s,initialFocus:i,style:p$1,children:jsx(ao,{children:n$1})})})})}function Ho(o){return jsx(n,{...o})}function Vo(o$1){return jsx(o,{...o$1})}function To(o){let{className:t,...r}=o;return jsx(q,{className:cn("bg-black/30",t),...r})}function zo({className:o,status:t,...r$1}){let{inputValue:m}=a(),i=m?.toString().trim(),p=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",!p&&"hidden",o),...r$1,children:p})}function Bo({className:o,...t}){return jsx(s,{className:cn("px-3 py-2 text-body-regular-2 text-text-secondary",o),...t})}function Eo({className:o,children:t$1,...r}){let m=E();return jsx(a$1,{size:"sm",viewportRender:jsx(t,{className:cn("max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] flex flex-col p-1 focus-visible:outline-none data-[empty]:hidden",o),...r,children:typeof t$1=="function"?(i,s)=>t$1(i,s,m.length):t$1})})}function ao(o){let{className:t,...r}=o;return jsx(u,{className:cn("absolute inset-0 bg-bg-primary-hover",t),...r})}function no(o){return jsx(v,{...o})}function Fo(o){let{className:t,...r}=o;return jsx(w,{className:cn("group/combobox-row",t),...r})}function Mo({className:o,children:t,indicator:r="check-circle",...m}){let{disabled:i}=m;return jsx(no,{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(xo,{className:"absolute group-data-[indicator=check-circle]/combobox-item:right-2 group-data-[indicator=checkbox]/combobox-item:left-2",keepMounted:r==="checkbox",render:(s,p)=>jsxs("span",{...s,children:[r==="check-circle"&&jsx(CheckCircle2Icon,{className:"size-4 text-fg-brand-primary shrink-0"}),r==="checkbox"&&jsx(a$2,{checked:p.selected})]})})]})})}function Do({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 Oo({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 qo({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 _o({src:o,imageSrc:t,className:r,avatarClassName:m,imageAlt:i,fallbackText:s,children:p,...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:s??p})]})})}function xo(o){return jsx(y,{...o})}function jo(o){let{className:t,...r}=o;return jsx(z,{className:cn("my-1 h-px bg-border-primary",t),...r})}function Uo(o){let{className:t,...r}=o;return jsx(A,{className:cn("py-1",t),...r})}function Xo(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 $o(o){return jsx(C,{...o})}function Jo(o){let{className:t,...r}=o;return jsx(D,{className:cn("fill-bg-primary",t),...r})}function Ko({hasMore:o,threshold:t=.5,...r}){return jsx(a$3,{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{_o as A,xo as B,jo as C,Uo as D,Xo as E,$o as F,Jo as G,Ko as H,No as a,bo as b,wo as c,ko as d,Lo as e,Ro as f,So as g,Go as h,io as i,mo as j,so as k,po as l,Ao as m,Ho as n,Vo as o,To as p,zo as q,Bo as r,Eo as s,ao as t,no as u,Fo as v,Mo as w,Do as x,Oo as y,qo as z};//# sourceMappingURL=chunk-RHWRIE3E.js.map
2
+ //# sourceMappingURL=chunk-RHWRIE3E.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","items","useFilteredItems","ScrollArea","index","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":"8hBAgFA,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,GAAAA,CAACC,EAAA,CACN,SAAA,CAAWG,EAAAA,CACT,gDAAA,CACAF,CACF,CAAA,CACC,GAAGC,CAAAA,CACN,CACF,CAIA,SAASE,EAA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AA,CAAuB,CAC9B,OAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CAAY,EAAA,CACZ,GAAGzF,CACL,CAAA,CAAkE,CAChE,OACEC,GAAAA,CAACyF,GAAAA,CAAA,CACC,OAAA,CAASF,CAAAA,CACT,SAAA,CAAWC,CAAAA,CACV,GAAGzF,CAAAA,CAEH,QAAA,CAAAwF,CAAAA,EACClE,IAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,4EAAA,CACb,QAAA,CAAA,CAAArB,IAACoD,WAAAA,CAAA,CAAY,SAAA,CAAU,qBAAA,CAAsB,EAC7CpD,GAAAA,CAAC,MAAA,CAAA,CAAK,QAAA,CAAA,iBAAA,CAEN,CAAA,CAAA,CACF,EAEJ,CAEJ","file":"chunk-IZQFTYJD.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 useFilteredItems,\r\n} from \"../primitives/combobox\"\r\nimport { cn } from \"@xploreu/lib/cn\"\r\n\r\nimport { ScrollArea } from \"./scroll-area\"\r\nimport { Badge, BadgeButton } from \"./badge\"\r\nimport { InfiniteScroll } from \"./infinite-scroll\"\r\nimport { Input } 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 = Omit<ComboboxListPrimitiveProps, \"children\"> & {\r\n children: React.ReactNode | ((item: any, index: number, itemsLength: number) => React.ReactNode)\r\n}\r\n\r\nfunction ComboboxList({\r\n className,\r\n children,\r\n ...props\r\n}: ComboboxListProps) {\r\n const items = useFilteredItems()\r\n\r\n return (\r\n <ScrollArea\r\n size=\"sm\"\r\n viewportRender={(\r\n <ComboboxListPrimitive\r\n className={cn(\"max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] flex flex-col p-1 focus-visible:outline-none data-[empty]:hidden\", className)}\r\n {...props}\r\n >\r\n {\r\n typeof children === \"function\"\r\n ? (item, index) => (\r\n children(item, index, items.length)\r\n )\r\n : children\r\n }\r\n </ComboboxListPrimitive>\r\n )}\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","items","useFilteredItems","ScrollArea","index","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":"8hBAgFA,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,GAAAA,CAACC,EAAA,CACN,SAAA,CAAWG,EAAAA,CACT,gDAAA,CACAF,CACF,CAAA,CACC,GAAGC,CAAAA,CACN,CACF,CAIA,SAASE,EAAAA,CAAcN,CAAAA,CAA2B,CAChD,GAAM,CAAE,SAAA,CAAAG,EAAW,GAAGC,CAAK,CAAA,CAAIJ,CAAAA,CAE/B,OAAOC,GAAAA,CAACK,CAAAA,CAAA,CACN,UAAWD,EAAAA,CACT,2CAAA,CACAF,CACF,CAAA,CACC,GAAGC,CAAAA,CACN,CACF,CAIA,SAASG,EAAAA,CAAmBP,CAAAA,CAAgC,CAC1D,GAAM,CAAE,SAAA,CAAAG,CAAAA,CAAW,GAAGC,CAAK,CAAA,CAAIJ,CAAAA,CAE/B,OAAOC,GAAAA,CAACM,CAAAA,CAAA,CACN,SAAA,CAAWF,EAAAA,CACT,iCACAF,CACF,CAAA,C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AA,iBAAA,CAEN,CAAA,CAAA,CACF,EAEJ,CAEJ","file":"chunk-RHWRIE3E.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 useFilteredItems,\r\n} from \"../primitives/combobox\"\r\nimport { cn } from \"@xploreu/lib/cn\"\r\n\r\nimport { ScrollArea } from \"./scroll-area\"\r\nimport { Badge, BadgeButton } from \"./badge\"\r\nimport { InfiniteScroll } from \"./infinite-scroll\"\r\nimport { Input } 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 = Omit<ComboboxListPrimitiveProps, \"children\"> & {\r\n children: React.ReactNode | ((item: any, index: number, itemsLength: number) => React.ReactNode)\r\n}\r\n\r\nfunction ComboboxList({\r\n className,\r\n children,\r\n ...props\r\n}: ComboboxListProps) {\r\n const items = useFilteredItems()\r\n\r\n return (\r\n <ScrollArea\r\n size=\"sm\"\r\n viewportRender={(\r\n <ComboboxListPrimitive\r\n className={cn(\"max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] flex flex-col p-1 focus-visible:outline-none data-[empty]:hidden\", className)}\r\n {...props}\r\n >\r\n {\r\n typeof children === \"function\"\r\n ? (item, index) => (\r\n children(item, index, items.length)\r\n )\r\n : children\r\n }\r\n </ComboboxListPrimitive>\r\n )}\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}"]}
@@ -0,0 +1,2 @@
1
+ import {cva}from'class-variance-authority';import {Loader2}from'lucide-react';import {Button}from'@base-ui/react/button';import {cn}from'@xploreu/lib/cn';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var m=cva(cn("group relative inline-flex h-max w-fit cursor-pointer items-center justify-center whitespace-nowrap outline-brand transition duration-100 ease-linear before:absolute focus-visible:outline-2 focus-visible:outline-offset-2 rounded-xp-buttons [&_svg]:shrink-0","disabled:cursor-not-allowed"),{variants:{color:{default:"focus-visible:outline-focus-ring",destructive:"focus-visible:outline-focus-ring-error","gradient-ai":"focus-visible:outline-focus-ring","linear-green":"focus-visible:outline-focus-ring-success","linear-overlay":"focus-visible:outline-focus-ring","linear-destructive":"focus-visible:outline-focus-ring-error"},variant:{primary:"before:rounded-lg before:absolute before:inset-0 before:border-1 before:border-white/12 before:mask-b-from-0% after:absolute after:inset-0 after:rounded-xp-buttons hover:after:bg-alpha-gray-20 after:bg-transparent after:transition-colors disabled:text-fg-disabled disabled:bg-none disabled:bg-bg-disabled disabled:hover:after:bg-transparent disabled:before:border-border-disabled disabled:before:mask-none disabled:before:border-1 shadow-xp-md hover:shadow-xp-brand ",secondary:"border-1 shadow-xp-md hover:shadow-xp-brand disabled:bg-bg-disabled disabled:text-fg-disabled disabled:[&_svg]:text-fg-disabled-subtle disabled:border-border-disabled disabled:hover:text-fg-disabled disabled:hover:[&_svg]:text-fg-disabled-subtle","secondary-accent":"disabled:border-border-disabled disabled:bg-bg-disabled disabled:text-fg-disabled",tertiary:"disabled:bg-bg-disabled disabled:text-fg-disabled disabled:[&_svg]:text-bg-disabled","tertiary-accent":"disabled:bg-bg-disabled disabled:text-fg-disabled disabled:[&_svg]:text-fg-disabled-subtle",link:"underline decoration-transparent hover:decoration-inherit transition-colors disabled:bg-bg-disabled disabled:text-fg-disabled disabled:[&_svg]:text-fg-disabled-subtle disabled:hover:no-underline"},icon:{true:void 0,false:void 0},size:{"3xs":"text-label-semibold-4 px-xp-sm gap-xp-xs h-6 data-[icon]:size-6 data-[variant=link]:h-4 data-[variant=link]:px-0 [&_svg]:size-3.5","2xs":"text-label-semibold-4 px-xp-md gap-xp-xs h-7 data-[icon]:size-7 data-[variant=link]:h-4 data-[variant=link]:px-0 [&_svg]:size-4",xs:"text-label-semibold-3 px-2.5 gap-xp-sm h-8 data-[icon]:size-8 data-[variant=link]:h-5 data-[variant=link]:px-0 [&_svg]:size-4",sm:"text-label-semibold-3 px-xp-lg gap-xp-sm h-9 data-[icon]:size-9 data-[variant=link]:h-5 data-[variant=link]:px-0 [&_svg]:size-5",md:"text-label-semibold-3 px-3.5 gap-xp-sm h-10 data-[icon]:size-10 data-[variant=link]:h-5 data-[variant=link]:px-0 [&_svg]:size-5",lg:"text-label-semibold-2 px-xp-xl gap-xp-md h-11 data-[icon]:size-11 data-[variant=link]:h-[22px] data-[variant=link]:px-0 [&_svg]:size-5",xl:"text-label-semibold-2 px-4.5 gap-xp-md h-12 data-[icon]:size-12 data-[variant=link]:h-[22px] data-[variant=link]:px-0 [&_svg]:size-5"}},compoundVariants:[{variant:"primary",color:"default",className:"bg-gradient-buttons-gradient-blue text-text-primary-on-brand"},{variant:"secondary",color:"default",className:"bg-bg-primary text-text-secondary [&_svg]:text-fg-secondary border-border-primary-icon hover:bg-bg-brand-solid hover:border-border-white hover:text-text-primary-on-brand hover:[&_svg]:text-fg-white"},{variant:"secondary-accent",color:"default",className:"border-1 border-border-primary-icon text-fg-primary hover:bg-bg-brand-primary"},{variant:"tertiary",color:"default",className:"text-text-tertiary [&_svg]:text-fg-quaternary hover:bg-bg-primary-hover hover:text-text-tertiary-hover hover:[&_svg]:text-fg-quaternary-hover"},{variant:"tertiary-accent",color:"default",className:"bg-bg-brand-primary text-text-brand-tertiary [&_svg]:text-fg-brand-secondary hover:bg-bg-brand-secondary hover:text-text-brand-tertiary hover:[&_svg]:text-fg-brand-secondary-hover"},{variant:"link",color:"default",className:"text-text-brand-secondary [&_svg]:text-fg-brand-secondary-alt hover:text-text-brand-secondary-hover hover:[&_svg]:text-fg-brand-secondary-hover"},{variant:"primary",color:"destructive",className:"bg-bg-error-solid text-text-primary-on-brand"},{variant:"secondary",color:"destructive",className:"bg-bg-primary text-text-error-primary [&_svg]:text-fg-error-secondary border-border-error hover:bg-bg-error-primary hover:text-text-error-primary-hover hover:[&_svg]:text-fg-error-secondary"},{variant:"secondary-accent",color:"destructive",className:"border-1 border-border-error text-fg-error-primary hover:bg-bg-error-primary"},{variant:"tertiary",color:"destructive",className:"text-text-error-primary [&_svg]:text-fg-error-secondary hover:bg-bg-error-primary hover:text-text-error-primary-hover hover:[&_svg]:text-fg-error-primary"},{variant:"tertiary-accent",color:"destructive",className:"bg-bg-error-primary text-text-error-tertiary [&_svg]:text-fg-error-secondary hover:bg-bg-error-secondary hover:text-text-error-tertiary hover:[&_svg]:text-fg-error-secondary-hover"},{variant:"link",color:"destructive",className:"text-text-error-secondary [&_svg]:text-fg-error-secondary hover:text-text-error-primary-hover hover:[&_svg]:text-fg-error-primary"},{variant:"primary",color:"gradient-ai",className:"bg-gradient-buttons-button-ai text-text-primary-on-brand"},{variant:"secondary",color:"gradient-ai",className:"relative shadow-transparent border-transparent hover:bg-bg-primary bg-[linear-gradient(90deg,var(--color-bg-primary),var(--color-bg-primary)),var(--gradient-buttons-button-ai)] [background-clip:padding-box,border-box] [background-origin:padding-box,border-box] [&>span]:bg-gradient-buttons-button-ai [&>span]:bg-clip-text [&>span]:text-transparent after:absolute after:inset-0 after:rounded-md hover:after:bg-gradient-buttons-button-ai hover:after:opacity-10 disabled:hover:after:bg-transparent disabled:after:opacity-0 disabled:[&>span]:bg-none disabled:[&>span]:text-fg-disabled"},{variant:"secondary-accent",color:"gradient-ai",className:"border-1 border-border-brand text-fg-brand-primary hover:bg-bg-brand-primary"},{variant:"tertiary",color:"gradient-ai",className:"relative [&>span]:bg-gradient-buttons-button-ai [&>span]:bg-clip-text [&>span]:text-transparent after:absolute after:inset-0 after:rounded-md hover:after:bg-gradient-buttons-button-ai hover:after:opacity-10 disabled:hover:after:bg-transparent disabled:after:opacity-0 disabled:[&>span]:bg-none disabled:[&>span]:text-fg-disabled"},{variant:"tertiary-accent",color:"gradient-ai",className:"bg-bg-brand-primary text-text-brand-tertiary [&_svg]:text-fg-brand-secondary hover:bg-bg-brand-secondary hover:text-text-brand-tertiary hover:[&_svg]:text-fg-brand-secondary-hover"},{variant:"link",color:"gradient-ai",className:"text-text-brand-secondary [&_svg]:text-fg-brand-secondary-alt hover:text-text-brand-secondary-hover hover:[&_svg]:text-fg-brand-secondary-hover"},{variant:"primary",color:"linear-green",className:"bg-gradient-buttons-gradient-green text-text-primary-on-brand"},{variant:"secondary",color:"linear-green",className:"bg-bg-primary text-text-secondary [&_svg]:text-green-500 border-border-primary hover:text-text-secondary-hover hover:[&_svg]:text-green-900"},{variant:"secondary-accent",color:"linear-green",className:"border-1 border-border-primary text-fg-primary hover:bg-bg-primary"},{variant:"tertiary",color:"linear-green",className:"text-text-success-primary [&_svg]:text-green-500 hover:bg-bg-success-primary hover:[&_svg]:text-green-900"},{variant:"tertiary-accent",color:"linear-green",className:"bg-bg-success-primary text-text-success-tertiary [&_svg]:text-fg-success-secondary hover:bg-bg-success-secondary hover:text-text-success-tertiary hover:[&_svg]:text-fg-success-secondary-hover"},{variant:"link",color:"linear-green",className:"text-text-success-secondary [&_svg]:text-fg-success-secondary hover:text-text-success-primary-hover hover:[&_svg]:text-fg-success-primary"},{variant:"primary",color:"linear-overlay",className:"relative bg-bg-brand-solid text-text-primary-on-brand [&_svg]:text-button-primary-icon hover:[&_svg]:text-button-primary-icon-hover after:absolute after:inset-0 after:rounded-xp-buttons after:bg-gradient-skuemorphic-gradient-border after:hover:bg-gradient-skuemorphic-gradient-border"},{variant:"secondary",color:"linear-overlay",className:"bg-bg-brand-solid-hover text-text-secondary [&_svg]:text-fg-quaternary border-border-primary hover:bg-bg-primary-hover hover:text-text-secondary-hover hover:[&_svg]:text-text-quaternary-hover"},{variant:"secondary-accent",color:"linear-overlay",className:"border-1 border-border-brand text-fg-brand-primary hover:bg-bg-brand-primary"},{variant:"tertiary",color:"linear-overlay",className:"text-text-tertiary [&_svg]:text-fg-quaternary hover:bg-bg-primary-hover hover:text-text-tertiary-hover hover:[&_svg]:text-fg-quaternary-hover"},{variant:"tertiary-accent",color:"linear-overlay",className:"bg-bg-brand-primary text-text-brand-tertiary [&_svg]:text-fg-brand-secondary hover:bg-bg-brand-secondary hover:text-text-brand-tertiary hover:[&_svg]:text-fg-brand-secondary-hover"},{variant:"link",color:"linear-overlay",className:"text-text-brand-secondary [&_svg]:text-fg-brand-secondary-alt hover:text-text-brand-secondary-hover hover:[&_svg]:text-fg-brand-secondary-hover"},{variant:"primary",color:"linear-destructive",className:"relative bg-bg-error-solid text-text-primary-on-brand [&_svg]:text-button-destructive-primary-icon hover:[&_svg]:text-button-destructive-primary-icon-hover after:absolute after:inset-0 after:rounded-xp-buttons after:bg-gradient-skuemorphic-gradient-border after:hover:bg-gradient-skuemorphic-gradient-border"},{variant:"secondary",color:"linear-destructive",className:"bg-bg-error-solid-hover text-text-secondary [&_svg]:text-fg-quaternary border-border-primary hover:bg-bg-primary-hover hover:text-text-secondary-hover hover:[&_svg]:text-text-quaternary-hover"},{variant:"secondary-accent",color:"linear-destructive",className:"border-1 border-border-error text-fg-error-primary hover:bg-bg-error-primary"},{variant:"tertiary",color:"linear-destructive",className:"text-text-error-primary [&_svg]:text-fg-error-secondary hover:bg-bg-error-primary hover:text-text-tertiary-hover hover:[&_svg]:text-fg-error-secondary"},{variant:"tertiary-accent",color:"linear-destructive",className:"bg-bg-error-primary text-text-error-tertiary [&_svg]:text-fg-error-secondary hover:bg-bg-error-secondary hover:text-text-error-tertiary hover:[&_svg]:text-fg-error-secondary-hover"},{variant:"link",color:"linear-destructive",className:"text-text-error-primary [&_svg]:text-fg-error-secondary hover:text-text-error-primary-hover hover:[&_svg]:text-fg-error-primary"}],defaultVariants:{variant:"primary",color:"default",size:"sm"}});function z({className:i,color:s,variant:e,size:n,loading:t=false,children:d,disabled:b,icon:g,nativeButton:l,render:a,...v}){let c=a!=null?false:l;return jsx(Button,{className:cn(m({color:s,variant:e,size:n,className:i})),"data-icon":g?"":void 0,"data-variant":e,disabled:b||t,nativeButton:c,render:a,...v,children:t?jsxs(Fragment,{children:[jsx(Loader2,{className:"size-4 animate-spin"}),jsx("span",{children:"Loading..."})]}):d})}export{m as a,z as b};//# sourceMappingURL=chunk-UINS73U7.js.map
2
+ //# sourceMappingURL=chunk-UINS73U7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ui/button.tsx"],"names":["buttonVariants","cva","cn","Button","className","color","variant","size","loading","children","disabled","icon","nativeButton","render","props","resolvedNativeButton","jsx","ButtonPrimitive","jsxs","Fragment","Loader2"],"mappings":"4MAMA,IAAMA,CAAAA,CAAiBC,GAAAA,CACrBC,EAAAA,CACE,kQAAA,CACA,6BACF,CAAA,CACA,CACE,QAAA,CAAU,CACR,KAAA,CAAO,CACL,OAAA,CAAS,kCAAA,CACT,WAAA,CAAa,wCAAA,CACb,aAAA,CAAe,kCAAA,CACf,cAAA,CAAgB,0CAAA,CAChB,iBAAkB,kCAAA,CAClB,oBAAA,CAAsB,wCACxB,CAAA,CACA,OAAA,CAAS,CACP,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AA,CAAO,KAAA,CAAQD,CAAAA,CAEtD,OACEI,GAAAA,CAACC,MAAAA,CAAA,CACC,SAAA,CAAWf,EAAAA,CAAGF,CAAAA,CAAe,CAAE,KAAA,CAAAK,EAAO,OAAA,CAAAC,CAAAA,CAAS,IAAA,CAAAC,CAAAA,CAAM,SAAA,CAAAH,CAAU,CAAC,CAAC,CAAA,CACjE,WAAA,CAAWO,CAAAA,CAAO,EAAA,CAAK,MAAA,CACvB,cAAA,CAAcL,EACd,QAAA,CAAUI,CAAAA,EAAYF,CAAAA,CACtB,YAAA,CAAcO,CAAAA,CACd,MAAA,CAAQF,CAAAA,CACP,GAAGC,CAAAA,CAEH,QAAA,CAAAN,CAAAA,CACCU,IAAAA,CAAAC,QAAAA,CAAA,CACE,UAAAH,GAAAA,CAACI,OAAAA,CAAA,CAAQ,SAAA,CAAU,qBAAA,CAAsB,CAAA,CACzCJ,GAAAA,CAAC,MAAA,CAAA,CAAK,QAAA,CAAA,YAAA,CAAU,CAAA,CAAA,CAClB,CAAA,CAEAP,CAAAA,CAEJ,CAEJ","file":"chunk-UINS73U7.js","sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\"\r\nimport { Loader2 } from \"lucide-react\"\r\n\r\nimport { Button as ButtonPrimitive } from \"@base-ui/react/button\"\r\nimport { cn } from \"@xploreu/lib/cn\"\r\n\r\nconst buttonVariants = cva(\r\n cn(\r\n \"group relative inline-flex h-max w-fit cursor-pointer items-center justify-center whitespace-nowrap outline-brand transition duration-100 ease-linear before:absolute focus-visible:outline-2 focus-visible:outline-offset-2 rounded-xp-buttons [&_svg]:shrink-0\",\r\n \"disabled:cursor-not-allowed\",\r\n ),\r\n {\r\n variants: {\r\n color: {\r\n default: \"focus-visible:outline-focus-ring\",\r\n destructive: \"focus-visible:outline-focus-ring-error\",\r\n \"gradient-ai\": \"focus-visible:outline-focus-ring\",\r\n \"linear-green\": \"focus-visible:outline-focus-ring-success\",\r\n \"linear-overlay\": \"focus-visible:outline-focus-ring\",\r\n \"linear-destructive\": \"focus-visible:outline-focus-ring-error\",\r\n },\r\n variant: {\r\n primary: \"before:rounded-lg before:absolute before:inset-0 before:border-1 before:border-white/12 before:mask-b-from-0% after:absolute after:inset-0 after:rounded-xp-buttons hover:after:bg-alpha-gray-20 after:bg-transparent after:transition-colors disabled:text-fg-disabled disabled:bg-none disabled:bg-bg-disabled disabled:hover:after:bg-transparent disabled:before:border-border-disabled disabled:before:mask-none disabled:before:border-1 shadow-xp-md hover:shadow-xp-brand \",\r\n secondary: \"border-1 shadow-xp-md hover:shadow-xp-brand disabled:bg-bg-disabled disabled:text-fg-disabled disabled:[&_svg]:text-fg-disabled-subtle disabled:border-border-disabled disabled:hover:text-fg-disabled disabled:hover:[&_svg]:text-fg-disabled-subtle\",\r\n \"secondary-accent\": \"disabled:border-border-disabled disabled:bg-bg-disabled disabled:text-fg-disabled\",\r\n tertiary: \"disabled:bg-bg-disabled disabled:text-fg-disabled disabled:[&_svg]:text-bg-disabled\",\r\n \"tertiary-accent\": \"disabled:bg-bg-disabled disabled:text-fg-disabled disabled:[&_svg]:text-fg-disabled-subtle\",\r\n link: \"underline decoration-transparent hover:decoration-inherit transition-colors disabled:bg-bg-disabled disabled:text-fg-disabled disabled:[&_svg]:text-fg-disabled-subtle disabled:hover:no-underline\",\r\n },\r\n icon: {\r\n true: undefined,\r\n false: undefined\r\n },\r\n size: {\r\n \"3xs\": \"text-label-semibold-4 px-xp-sm gap-xp-xs h-6 data-[icon]:size-6 data-[variant=link]:h-4 data-[variant=link]:px-0 [&_svg]:size-3.5\",\r\n \"2xs\": \"text-label-semibold-4 px-xp-md gap-xp-xs h-7 data-[icon]:size-7 data-[variant=link]:h-4 data-[variant=link]:px-0 [&_svg]:size-4\",\r\n xs: \"text-label-semibold-3 px-2.5 gap-xp-sm h-8 data-[icon]:size-8 data-[variant=link]:h-5 data-[variant=link]:px-0 [&_svg]:size-4\",\r\n sm: \"text-label-semibold-3 px-xp-lg gap-xp-sm h-9 data-[icon]:size-9 data-[variant=link]:h-5 data-[variant=link]:px-0 [&_svg]:size-5\",\r\n md: \"text-label-semibold-3 px-3.5 gap-xp-sm h-10 data-[icon]:size-10 data-[variant=link]:h-5 data-[variant=link]:px-0 [&_svg]:size-5\",\r\n lg: \"text-label-semibold-2 px-xp-xl gap-xp-md h-11 data-[icon]:size-11 data-[variant=link]:h-[22px] data-[variant=link]:px-0 [&_svg]:size-5\",\r\n xl: \"text-label-semibold-2 px-4.5 gap-xp-md h-12 data-[icon]:size-12 data-[variant=link]:h-[22px] data-[variant=link]:px-0 [&_svg]:size-5\",\r\n }\r\n },\r\n compoundVariants: [\r\n // Default Color Variants\r\n {\r\n variant: \"primary\",\r\n color: \"default\",\r\n className: \"bg-gradient-buttons-gradient-blue text-text-primary-on-brand\"\r\n },\r\n {\r\n variant: \"secondary\",\r\n color: \"default\",\r\n className: \"bg-bg-primary text-text-secondary [&_svg]:text-fg-secondary border-border-primary-icon hover:bg-bg-brand-solid hover:border-border-white hover:text-text-primary-on-brand hover:[&_svg]:text-fg-white\"\r\n },\r\n {\r\n variant: \"secondary-accent\",\r\n color: \"default\",\r\n className: \"border-1 border-border-primary-icon text-fg-primary hover:bg-bg-brand-primary\"\r\n },\r\n {\r\n variant: \"tertiary\",\r\n color: \"default\",\r\n className: \"text-text-tertiary [&_svg]:text-fg-quaternary hover:bg-bg-primary-hover hover:text-text-tertiary-hover hover:[&_svg]:text-fg-quaternary-hover\"\r\n },\r\n {\r\n variant: \"tertiary-accent\",\r\n color: \"default\",\r\n className: \"bg-bg-brand-primary text-text-brand-tertiary [&_svg]:text-fg-brand-secondary hover:bg-bg-brand-secondary hover:text-text-brand-tertiary hover:[&_svg]:text-fg-brand-secondary-hover\"\r\n },\r\n {\r\n variant: \"link\",\r\n color: \"default\",\r\n className: \"text-text-brand-secondary [&_svg]:text-fg-brand-secondary-alt hover:text-text-brand-secondary-hover hover:[&_svg]:text-fg-brand-secondary-hover\"\r\n },\r\n\r\n // Destructive Color Variants\r\n {\r\n variant: \"primary\",\r\n color: \"destructive\",\r\n className: \"bg-bg-error-solid text-text-primary-on-brand\"\r\n },\r\n {\r\n variant: \"secondary\",\r\n color: \"destructive\",\r\n className: \"bg-bg-primary text-text-error-primary [&_svg]:text-fg-error-secondary border-border-error hover:bg-bg-error-primary hover:text-text-error-primary-hover hover:[&_svg]:text-fg-error-secondary\"\r\n },\r\n {\r\n // Not existing in design system yet\r\n variant: \"secondary-accent\",\r\n color: \"destructive\",\r\n className: \"border-1 border-border-error text-fg-error-primary hover:bg-bg-error-primary\"\r\n },\r\n {\r\n variant: \"tertiary\",\r\n color: \"destructive\",\r\n className: \"text-text-error-primary [&_svg]:text-fg-error-secondary hover:bg-bg-error-primary hover:text-text-error-primary-hover hover:[&_svg]:text-fg-error-primary\"\r\n },\r\n {\r\n // Not existing in design system yet\r\n variant: \"tertiary-accent\",\r\n color: \"destructive\",\r\n className: \"bg-bg-error-primary text-text-error-tertiary [&_svg]:text-fg-error-secondary hover:bg-bg-error-secondary hover:text-text-error-tertiary hover:[&_svg]:text-fg-error-secondary-hover\"\r\n },\r\n {\r\n variant: \"link\",\r\n color: \"destructive\",\r\n className: \"text-text-error-secondary [&_svg]:text-fg-error-secondary hover:text-text-error-primary-hover hover:[&_svg]:text-fg-error-primary\"\r\n },\r\n\r\n // Gradient AI\r\n {\r\n variant: \"primary\",\r\n color: \"gradient-ai\",\r\n className: \"bg-gradient-buttons-button-ai text-text-primary-on-brand\"\r\n },\r\n {\r\n variant: \"secondary\",\r\n color: \"gradient-ai\",\r\n className: \"relative shadow-transparent border-transparent hover:bg-bg-primary bg-[linear-gradient(90deg,var(--color-bg-primary),var(--color-bg-primary)),var(--gradient-buttons-button-ai)] [background-clip:padding-box,border-box] [background-origin:padding-box,border-box] [&>span]:bg-gradient-buttons-button-ai [&>span]:bg-clip-text [&>span]:text-transparent after:absolute after:inset-0 after:rounded-md hover:after:bg-gradient-buttons-button-ai hover:after:opacity-10 disabled:hover:after:bg-transparent disabled:after:opacity-0 disabled:[&>span]:bg-none disabled:[&>span]:text-fg-disabled\"\r\n },\r\n {\r\n // Not existing in design system yet\r\n variant: \"secondary-accent\",\r\n color: \"gradient-ai\",\r\n className: \"border-1 border-border-brand text-fg-brand-primary hover:bg-bg-brand-primary\"\r\n },\r\n {\r\n variant: \"tertiary\",\r\n color: \"gradient-ai\",\r\n className: \"relative [&>span]:bg-gradient-buttons-button-ai [&>span]:bg-clip-text [&>span]:text-transparent after:absolute after:inset-0 after:rounded-md hover:after:bg-gradient-buttons-button-ai hover:after:opacity-10 disabled:hover:after:bg-transparent disabled:after:opacity-0 disabled:[&>span]:bg-none disabled:[&>span]:text-fg-disabled\"\r\n },\r\n {\r\n // Not existing in design system yet\r\n variant: \"tertiary-accent\",\r\n color: \"gradient-ai\",\r\n className: \"bg-bg-brand-primary text-text-brand-tertiary [&_svg]:text-fg-brand-secondary hover:bg-bg-brand-secondary hover:text-text-brand-tertiary hover:[&_svg]:text-fg-brand-secondary-hover\"\r\n },\r\n {\r\n // Not existing in design system yet\r\n variant: \"link\",\r\n color: \"gradient-ai\",\r\n className: \"text-text-brand-secondary [&_svg]:text-fg-brand-secondary-alt hover:text-text-brand-secondary-hover hover:[&_svg]:text-fg-brand-secondary-hover\"\r\n },\r\n\r\n // Linear Green Color Variants\r\n {\r\n variant: \"primary\",\r\n color: \"linear-green\",\r\n className: \"bg-gradient-buttons-gradient-green text-text-primary-on-brand\"\r\n },\r\n {\r\n variant: \"secondary\",\r\n color: \"linear-green\",\r\n className: \"bg-bg-primary text-text-secondary [&_svg]:text-green-500 border-border-primary hover:text-text-secondary-hover hover:[&_svg]:text-green-900\"\r\n },\r\n {\r\n // Not existing in design system yet\r\n variant: \"secondary-accent\",\r\n color: \"linear-green\",\r\n className: \"border-1 border-border-primary text-fg-primary hover:bg-bg-primary\"\r\n },\r\n {\r\n variant: \"tertiary\",\r\n color: \"linear-green\",\r\n className: \"text-text-success-primary [&_svg]:text-green-500 hover:bg-bg-success-primary hover:[&_svg]:text-green-900\"\r\n },\r\n {\r\n // Not existing in design system yet\r\n variant: \"tertiary-accent\",\r\n color: \"linear-green\",\r\n className: \"bg-bg-success-primary text-text-success-tertiary [&_svg]:text-fg-success-secondary hover:bg-bg-success-secondary hover:text-text-success-tertiary hover:[&_svg]:text-fg-success-secondary-hover\"\r\n },\r\n {\r\n // Not existing in design system yet\r\n variant: \"link\",\r\n color: \"linear-green\",\r\n className: \"text-text-success-secondary [&_svg]:text-fg-success-secondary hover:text-text-success-primary-hover hover:[&_svg]:text-fg-success-primary\"\r\n },\r\n\r\n // Linear Overlay Color Variants\r\n {\r\n variant: \"primary\",\r\n color: \"linear-overlay\",\r\n className: \"relative bg-bg-brand-solid text-text-primary-on-brand [&_svg]:text-button-primary-icon hover:[&_svg]:text-button-primary-icon-hover after:absolute after:inset-0 after:rounded-xp-buttons after:bg-gradient-skuemorphic-gradient-border after:hover:bg-gradient-skuemorphic-gradient-border\"\r\n },\r\n {\r\n variant: \"secondary\",\r\n color: \"linear-overlay\",\r\n className: \"bg-bg-brand-solid-hover text-text-secondary [&_svg]:text-fg-quaternary border-border-primary hover:bg-bg-primary-hover hover:text-text-secondary-hover hover:[&_svg]:text-text-quaternary-hover\"\r\n },\r\n {\r\n variant: \"secondary-accent\",\r\n color: \"linear-overlay\",\r\n className: \"border-1 border-border-brand text-fg-brand-primary hover:bg-bg-brand-primary\"\r\n },\r\n {\r\n variant: \"tertiary\",\r\n color: \"linear-overlay\",\r\n className: \"text-text-tertiary [&_svg]:text-fg-quaternary hover:bg-bg-primary-hover hover:text-text-tertiary-hover hover:[&_svg]:text-fg-quaternary-hover\"\r\n },\r\n {\r\n variant: \"tertiary-accent\",\r\n color: \"linear-overlay\",\r\n className: \"bg-bg-brand-primary text-text-brand-tertiary [&_svg]:text-fg-brand-secondary hover:bg-bg-brand-secondary hover:text-text-brand-tertiary hover:[&_svg]:text-fg-brand-secondary-hover\"\r\n },\r\n {\r\n variant: \"link\",\r\n color: \"linear-overlay\",\r\n className: \"text-text-brand-secondary [&_svg]:text-fg-brand-secondary-alt hover:text-text-brand-secondary-hover hover:[&_svg]:text-fg-brand-secondary-hover\"\r\n },\r\n\r\n // Linear Destructive Color Variants\r\n {\r\n variant: \"primary\",\r\n color: \"linear-destructive\",\r\n className: \"relative bg-bg-error-solid text-text-primary-on-brand [&_svg]:text-button-destructive-primary-icon hover:[&_svg]:text-button-destructive-primary-icon-hover after:absolute after:inset-0 after:rounded-xp-buttons after:bg-gradient-skuemorphic-gradient-border after:hover:bg-gradient-skuemorphic-gradient-border\"\r\n },\r\n {\r\n variant: \"secondary\",\r\n color: \"linear-destructive\",\r\n className: \"bg-bg-error-solid-hover text-text-secondary [&_svg]:text-fg-quaternary border-border-primary hover:bg-bg-primary-hover hover:text-text-secondary-hover hover:[&_svg]:text-text-quaternary-hover\"\r\n },\r\n {\r\n // Not existing in design system yet\r\n variant: \"secondary-accent\",\r\n color: \"linear-destructive\",\r\n className: \"border-1 border-border-error text-fg-error-primary hover:bg-bg-error-primary\"\r\n },\r\n {\r\n variant: \"tertiary\",\r\n color: \"linear-destructive\",\r\n className: \"text-text-error-primary [&_svg]:text-fg-error-secondary hover:bg-bg-error-primary hover:text-text-tertiary-hover hover:[&_svg]:text-fg-error-secondary\"\r\n },\r\n {\r\n // Not existing in design system yet\r\n variant: \"tertiary-accent\",\r\n color: \"linear-destructive\",\r\n className: \"bg-bg-error-primary text-text-error-tertiary [&_svg]:text-fg-error-secondary hover:bg-bg-error-secondary hover:text-text-error-tertiary hover:[&_svg]:text-fg-error-secondary-hover\"\r\n },\r\n {\r\n variant: \"link\",\r\n color: \"linear-destructive\",\r\n className: \"text-text-error-primary [&_svg]:text-fg-error-secondary hover:text-text-error-primary-hover hover:[&_svg]:text-fg-error-primary\"\r\n },\r\n ],\r\n defaultVariants: {\r\n variant: \"primary\",\r\n color: \"default\",\r\n size: \"sm\",\r\n },\r\n }\r\n)\r\n\r\nfunction Button({\r\n className,\r\n color,\r\n variant,\r\n size,\r\n loading = false,\r\n children,\r\n disabled,\r\n icon,\r\n nativeButton,\r\n render,\r\n ...props\r\n}: ButtonPrimitive.Props &\r\n VariantProps<typeof buttonVariants> & {\r\n loading?: boolean\r\n }) {\r\n // ponytail: auto-detect nativeButton when render is provided\r\n const resolvedNativeButton = render != null ? false : nativeButton\r\n\r\n return (\r\n <ButtonPrimitive\r\n className={cn(buttonVariants({ color, variant, size, className }))}\r\n data-icon={icon ? \"\" : undefined}\r\n data-variant={variant}\r\n disabled={disabled || loading}\r\n nativeButton={resolvedNativeButton}\r\n render={render}\r\n {...props}\r\n >\r\n {loading ? (\r\n <>\r\n <Loader2 className=\"size-4 animate-spin\" />\r\n <span>Loading...</span>\r\n </>\r\n ) : (\r\n children\r\n )}\r\n </ButtonPrimitive>\r\n )\r\n}\r\n\r\nexport { Button, buttonVariants }"]}
@@ -1,2 +1,2 @@
1
- import*as i from'react';import {mergeProps}from'@base-ui/react/merge-props';import {useRender}from'@base-ui/react/use-render';import {cva}from'class-variance-authority';import {ArrowRightIcon}from'lucide-react';import {cn}from'@xploreu/lib/cn';import {jsx}from'react/jsx-runtime';var u=cva("inline-flex items-center size-max whitespace-nowrap shrink-0 overflow-hidden transition-colors cursor-pointer group/badge-group gap-2",{variants:{theme:{light:"rounded-xp-full ring-1 ring-inset",modern:"rounded-xp-card-base-md bg-bg-primary text-text-secondary ring-1 ring-inset ring-border-primary shadow-xp-xs hover:bg-bg-secondary"},color:{brand:"",gray:"",error:"",warning:"",success:""},size:{md:"text-body-medium-3",lg:"text-body-medium-2"},align:{leading:"",trailing:""}},compoundVariants:[{theme:"light",color:"brand",className:"bg-utility-brand-50 text-utility-brand-700 ring-utility-brand-200 hover:bg-utility-brand-100"},{theme:"light",color:"gray",className:"bg-utility-gray-50 text-utility-gray-700 ring-utility-gray-200 hover:bg-utility-gray-100"},{theme:"light",color:"error",className:"bg-utility-error-50 text-utility-error-700 ring-utility-error-200 hover:bg-utility-error-100"},{theme:"light",color:"warning",className:"bg-utility-warning-50 text-utility-warning-700 ring-utility-warning-200 hover:bg-utility-warning-100"},{theme:"light",color:"success",className:"bg-utility-success-50 text-utility-success-700 ring-utility-success-200 hover:bg-utility-success-100"},{align:"leading",size:"md",className:"py-1 pl-1 pr-2"},{align:"leading",size:"lg",className:"py-1 pl-1 pr-2.5"},{align:"trailing",size:"md",className:"py-1 pl-2 pr-1"},{align:"trailing",size:"lg",className:"py-1 pl-2.5 pr-1"}],defaultVariants:{theme:"light",color:"brand",size:"md",align:"leading"}}),g=i.createContext({theme:"light",color:"brand",size:"md"});function f({className:a,theme:t="light",color:e="brand",size:r="md",align:o="leading",render:p,children:s,...d}){let c={"data-slot":"badge-group","data-theme":t,"data-color":e,"data-size":r,"data-align":o,className:cn(u({theme:t,color:e,size:r,align:o}),a),children:s};return jsx(g.Provider,{value:{theme:t??"light",color:e??"brand",size:r??"md"},children:useRender({defaultTagName:"div",props:mergeProps(c,d),render:p,state:{slot:"badge-group",theme:t,color:e,size:r,align:o}})})}function P({className:a,children:t,...e}){let{theme:r,color:o,size:p}=i.useContext(g),s={brand:"ring-utility-brand-200 text-utility-brand-700",gray:"ring-utility-gray-200 text-utility-gray-700",error:"ring-utility-error-200 text-utility-error-700",warning:"ring-utility-warning-200 text-utility-warning-700",success:"ring-utility-success-200 text-utility-success-700"},d=cn("inline-flex items-center justify-center font-medium shrink-0",r==="light"&&["rounded-xp-full bg-bg-primary ring-1 ring-inset",s[o]||s.brand,p==="md"?"px-2 py-0.5":"px-2.5 py-0.5"],r==="modern"&&["rounded-xp-card-base-sm bg-bg-primary shadow-xp-xs ring-1 ring-inset ring-border-primary text-text-secondary",p==="md"?"gap-1 px-1.5 py-0.5":"gap-1.5 px-2 py-0.5"],a);return jsx("span",{"data-slot":"badge-group-addon",className:d,...e,children:t})}function h({className:a,children:t=jsx(ArrowRightIcon,{}),...e}){let{color:r}=i.useContext(g),o={brand:"text-utility-brand-500",gray:"text-utility-gray-500",error:"text-utility-error-500",warning:"text-utility-warning-500",success:"text-utility-success-500"};return jsx("span",{"data-slot":"badge-group-icon",className:cn("inline-flex items-center justify-center shrink-0 [&>svg]:size-4 [&>svg]:stroke-[2px] pointer-events-none transition-transform group-hover/badge-group:translate-x-0.5",o[r]||o.brand,a),...e,children:t})}function B({className:a,...t}){let{color:e}=i.useContext(g),r={brand:"bg-utility-brand-500 outline-utility-brand-100",gray:"bg-utility-gray-500 outline-utility-gray-100",error:"bg-utility-error-500 outline-utility-error-100",warning:"bg-utility-warning-500 outline-utility-warning-100",success:"bg-utility-success-500 outline-utility-success-100"};return jsx("span",{"data-slot":"badge-group-dot",className:cn("inline-block size-1.5 shrink-0 rounded-xp-full outline-2 -outline-offset-1",r[e]||r.brand,a),...t})}export{u as a,f as b,P as c,h as d,B as e};//# sourceMappingURL=chunk-VHPUQQ6L.js.map
2
- //# sourceMappingURL=chunk-VHPUQQ6L.js.map
1
+ import*as i from'react';import {mergeProps}from'@base-ui/react/merge-props';import {useRender}from'@base-ui/react/use-render';import {cva}from'class-variance-authority';import {ArrowRightIcon}from'lucide-react';import {cn}from'@xploreu/lib/cn';import {jsx}from'react/jsx-runtime';var u=cva("inline-flex items-center size-max whitespace-nowrap shrink-0 overflow-hidden transition-colors cursor-pointer group/badge-group gap-2",{variants:{theme:{light:"rounded-xp-full ring-1 ring-inset",modern:"rounded-xp-card-base-md bg-bg-primary text-text-secondary ring-1 ring-inset ring-border-primary shadow-xp-xs hover:bg-bg-secondary"},color:{brand:"",gray:"",error:"",warning:"",success:""},size:{md:"text-body-medium-3",lg:"text-body-medium-2"},align:{leading:"",trailing:""}},compoundVariants:[{theme:"light",color:"brand",className:"bg-utility-brand-50 text-utility-brand-700 ring-utility-brand-200 hover:bg-utility-brand-100"},{theme:"light",color:"gray",className:"bg-utility-gray-50 text-utility-gray-700 ring-utility-gray-200 hover:bg-utility-gray-100"},{theme:"light",color:"error",className:"bg-utility-error-50 text-utility-error-700 ring-utility-error-200 hover:bg-utility-error-100"},{theme:"light",color:"warning",className:"bg-utility-warning-50 text-utility-warning-700 ring-utility-warning-200 hover:bg-utility-warning-100"},{theme:"light",color:"success",className:"bg-utility-success-50 text-utility-success-700 ring-utility-success-200 hover:bg-utility-success-100"},{align:"leading",size:"md",className:"py-1 pl-1 pr-2"},{align:"leading",size:"lg",className:"py-1 pl-1 pr-2.5"},{align:"trailing",size:"md",className:"py-1 pl-2 pr-1"},{align:"trailing",size:"lg",className:"py-1 pl-2.5 pr-1"}],defaultVariants:{theme:"light",color:"brand",size:"md",align:"leading"}}),g=i.createContext({theme:"light",color:"brand",size:"md"});function f({className:a,theme:t="light",color:e="brand",size:r="md",align:o="leading",render:s,children:p,...d}){let c={"data-slot":"badge-group","data-theme":t,"data-color":e,"data-size":r,"data-align":o,className:cn(u({theme:t,color:e,size:r,align:o}),a),children:p};return jsx(g.Provider,{value:{theme:t??"light",color:e??"brand",size:r??"md"},children:useRender({defaultTagName:"div",props:mergeProps(c,d),render:s,state:{slot:"badge-group",theme:t,color:e,size:r,align:o}})})}function P({className:a,children:t,...e}){let{theme:r,color:o,size:s}=i.useContext(g),p={brand:"ring-utility-brand-200 text-utility-brand-700",gray:"ring-utility-gray-200 text-utility-gray-700",error:"ring-utility-error-200 text-utility-error-700",warning:"ring-utility-warning-200 text-utility-warning-700",success:"ring-utility-success-200 text-utility-success-700"},d=cn("inline-flex items-center justify-center font-medium shrink-0",r==="light"&&["rounded-xp-full bg-bg-primary ring-1 ring-inset",p[o]||p.brand,s==="md"?"px-2 py-0.5":"px-2.5 py-0.5"],r==="modern"&&["rounded-xp-card-base-sm bg-bg-primary shadow-xp-xs ring-1 ring-inset ring-border-primary text-text-secondary",s==="md"?"gap-1 px-1.5 py-0.5":"gap-1.5 px-2 py-0.5"],a);return jsx("span",{"data-slot":"badge-group-addon",className:d,...e,children:t})}function h({className:a,children:t=jsx(ArrowRightIcon,{}),...e}){let{color:r}=i.useContext(g),o={brand:"text-utility-brand-500",gray:"text-utility-gray-500",error:"text-utility-error-500",warning:"text-utility-warning-500",success:"text-utility-success-500"};return jsx("span",{"data-slot":"badge-group-icon",className:cn("inline-flex items-center justify-center shrink-0 [&>svg]:size-4 [&>svg]:stroke-[2px] pointer-events-none transition-transform group-hover/badge-group:translate-x-0.5",o[r]||o.brand,a),...e,children:t})}function B({className:a,...t}){let{color:e}=i.useContext(g),r={brand:"bg-utility-brand-500 outline-utility-brand-100",gray:"bg-utility-gray-500 outline-utility-gray-100",error:"bg-utility-error-500 outline-utility-error-100",warning:"bg-utility-warning-500 outline-utility-warning-100",success:"bg-utility-success-500 outline-utility-success-100"};return jsx("span",{"data-slot":"badge-group-dot",className:cn("inline-block size-1.5 shrink-0 rounded-xp-full outline-2 -outline-offset-1",r[e]||r.brand,a),...t})}export{u as a,f as b,P as c,h as d,B as e};//# sourceMappingURL=chunk-V2PW53KI.js.map
2
+ //# sourceMappingURL=chunk-V2PW53KI.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ui/badge-group.tsx"],"names":["badgeGroupVariants","cva","badgeGroupContext","BadgeGroup","className","theme","color","size","align","render","children","props","defaultProps","cn","jsx","useRender","mergeProps","BadgeGroupAddon","colorAddonMap","addonClasses","BadgeGroupIcon","ArrowRightIcon","iconColorMap","BadgeGroupDot","dotColorMap"],"mappings":"wRASA,IAAMA,EAAqBC,GAAAA,CACzB,uIAAA,CACA,CACE,QAAA,CAAU,CACR,KAAA,CAAO,CACL,KAAA,CAAO,mCAAA,CACP,MAAA,CAAQ,oIACV,CAAA,CACA,KAAA,CAAO,CACL,KAAA,CAAO,EAAA,CACP,IAAA,CAAM,EAAA,CACN,KAAA,CAAO,EAAA,CACP,QAAS,EAAA,CACT,OAAA,CAAS,EACX,CAAA,CACA,IAAA,CAAM,CACJ,GAAI,oBAAA,CACJ,EAAA,CAAI,oBACN,CAAA,CACA,KAAA,CAAO,CACL,QAAS,EAAA,CACT,QAAA,CAAU,EACZ,CACF,CAAA,CACA,gBAAA,CAAkB,CAEhB,CACE,KAAA,CAAO,OAAA,CAC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AAS,oDACX,CAAA,CAEA,OACEV,GAAAA,CAAC,MAAA,CAAA,CACC,WAAA,CAAU,kBACV,SAAA,CAAWD,EAAAA,CACT,4EAAA,CACAW,CAAAA,CAAYlB,CAAK,CAAA,EAAKkB,CAAAA,CAAY,KAAA,CAClCpB,CACF,CAAA,CACC,GAAGO,CAAAA,CACN,CAEJ","file":"chunk-VHPUQQ6L.js","sourcesContent":["import * as React from \"react\"\r\n\r\nimport { mergeProps } from \"@base-ui/react/merge-props\"\r\nimport { useRender } from \"@base-ui/react/use-render\"\r\nimport { cva, type VariantProps } from \"class-variance-authority\"\r\nimport { ArrowRightIcon } from \"lucide-react\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\n\r\nconst badgeGroupVariants = cva(\r\n \"inline-flex items-center size-max whitespace-nowrap shrink-0 overflow-hidden transition-colors cursor-pointer group/badge-group gap-2\",\r\n {\r\n variants: {\r\n theme: {\r\n light: \"rounded-xp-full ring-1 ring-inset\",\r\n modern: \"rounded-xp-card-base-md bg-bg-primary text-text-secondary ring-1 ring-inset ring-border-primary shadow-xp-xs hover:bg-bg-secondary\",\r\n },\r\n color: {\r\n brand: \"\",\r\n gray: \"\",\r\n error: \"\",\r\n warning: \"\",\r\n success: \"\",\r\n },\r\n size: {\r\n md: \"text-body-medium-3\",\r\n lg: \"text-body-medium-2\",\r\n },\r\n align: {\r\n leading: \"\",\r\n trailing: \"\",\r\n },\r\n },\r\n compoundVariants: [\r\n // Light theme colors\r\n {\r\n theme: \"light\",\r\n color: \"brand\",\r\n className: \"bg-utility-brand-50 text-utility-brand-700 ring-utility-brand-200 hover:bg-utility-brand-100\",\r\n },\r\n {\r\n theme: \"light\",\r\n color: \"gray\",\r\n className: \"bg-utility-gray-50 text-utility-gray-700 ring-utility-gray-200 hover:bg-utility-gray-100\",\r\n },\r\n {\r\n theme: \"light\",\r\n color: \"error\",\r\n className: \"bg-utility-error-50 text-utility-error-700 ring-utility-error-200 hover:bg-utility-error-100\",\r\n },\r\n {\r\n theme: \"light\",\r\n color: \"warning\",\r\n className: \"bg-utility-warning-50 text-utility-warning-700 ring-utility-warning-200 hover:bg-utility-warning-100\",\r\n },\r\n {\r\n theme: \"light\",\r\n color: \"success\",\r\n className: \"bg-utility-success-50 text-utility-success-700 ring-utility-success-200 hover:bg-utility-success-100\",\r\n },\r\n\r\n // Size & Align combinations (Root padding matching exact Figma values)\r\n // Leading: Addon on the left\r\n {\r\n align: \"leading\",\r\n size: \"md\",\r\n className: \"py-1 pl-1 pr-2\",\r\n },\r\n {\r\n align: \"leading\",\r\n size: \"lg\",\r\n className: \"py-1 pl-1 pr-2.5\",\r\n },\r\n // Trailing: Addon on the right\r\n {\r\n align: \"trailing\",\r\n size: \"md\",\r\n className: \"py-1 pl-2 pr-1\",\r\n },\r\n {\r\n align: \"trailing\",\r\n size: \"lg\",\r\n className: \"py-1 pl-2.5 pr-1\",\r\n },\r\n ],\r\n defaultVariants: {\r\n theme: \"light\",\r\n color: \"brand\",\r\n size: \"md\",\r\n align: \"leading\",\r\n },\r\n }\r\n)\r\n\r\nconst badgeGroupContext = React.createContext<{\r\n theme: \"light\" | \"modern\"\r\n color: \"brand\" | \"gray\" | \"error\" | \"warning\" | \"success\"\r\n size: \"md\" | \"lg\"\r\n}>({\r\n theme: \"light\",\r\n color: \"brand\",\r\n size: \"md\",\r\n})\r\n\r\nexport interface BadgeGroupProps\r\n extends Omit<React.ComponentProps<\"div\">, \"color\">,\r\n VariantProps<typeof badgeGroupVariants> {\r\n}\r\n\r\nfunction BadgeGroup({\r\n className,\r\n theme = \"light\",\r\n color = \"brand\",\r\n size = \"md\",\r\n align = \"leading\",\r\n render,\r\n children,\r\n ...props\r\n}: BadgeGroupProps & useRender.ComponentProps<\"div\">) {\r\n const defaultProps = {\r\n \"data-slot\": \"badge-group\",\r\n \"data-theme\": theme,\r\n \"data-color\": color,\r\n \"data-size\": size,\r\n \"data-align\": align,\r\n className: cn(badgeGroupVariants({ theme, color, size, align }), className),\r\n children,\r\n }\r\n\r\n return (\r\n <badgeGroupContext.Provider value={{ theme: theme ?? \"light\", color: color ?? \"brand\", size: size ?? \"md\" }}>\r\n {useRender({\r\n defaultTagName: \"div\",\r\n props: mergeProps(defaultProps, props),\r\n render,\r\n state: {\r\n slot: \"badge-group\",\r\n theme,\r\n color,\r\n size,\r\n align,\r\n },\r\n })}\r\n </badgeGroupContext.Provider>\r\n )\r\n}\r\n\r\nexport interface BadgeGroupAddonProps extends React.ComponentProps<\"span\"> {\r\n children?: React.ReactNode\r\n}\r\n\r\nfunction BadgeGroupAddon({\r\n className,\r\n children,\r\n ...props\r\n}: BadgeGroupAddonProps) {\r\n const { theme, color, size } = React.useContext(badgeGroupContext)\r\n\r\n const colorAddonMap: Record<string, string> = {\r\n brand: \"ring-utility-brand-200 text-utility-brand-700\",\r\n gray: \"ring-utility-gray-200 text-utility-gray-700\",\r\n error: \"ring-utility-error-200 text-utility-error-700\",\r\n warning: \"ring-utility-warning-200 text-utility-warning-700\",\r\n success: \"ring-utility-success-200 text-utility-success-700\",\r\n }\r\n\r\n const addonClasses = cn(\r\n \"inline-flex items-center justify-center font-medium shrink-0\",\r\n theme === \"light\" && [\r\n \"rounded-xp-full bg-bg-primary ring-1 ring-inset\",\r\n colorAddonMap[color] || colorAddonMap.brand,\r\n size === \"md\" ? \"px-2 py-0.5\" : \"px-2.5 py-0.5\",\r\n ],\r\n theme === \"modern\" && [\r\n \"rounded-xp-card-base-sm bg-bg-primary shadow-xp-xs ring-1 ring-inset ring-border-primary text-text-secondary\",\r\n size === \"md\" ? \"gap-1 px-1.5 py-0.5\" : \"gap-1.5 px-2 py-0.5\",\r\n ],\r\n className\r\n )\r\n\r\n return (\r\n <span data-slot=\"badge-group-addon\" className={addonClasses} {...props}>\r\n {children}\r\n </span>\r\n )\r\n}\r\n\r\nexport interface BadgeGroupIconProps extends React.ComponentProps<\"span\"> {\r\n children?: React.ReactNode\r\n}\r\n\r\nfunction BadgeGroupIcon({\r\n className,\r\n children = <ArrowRightIcon />,\r\n ...props\r\n}: BadgeGroupIconProps) {\r\n const { color } = React.useContext(badgeGroupContext)\r\n\r\n const iconColorMap: Record<string, string> = {\r\n brand: \"text-utility-brand-500\",\r\n gray: \"text-utility-gray-500\",\r\n error: \"text-utility-error-500\",\r\n warning: \"text-utility-warning-500\",\r\n success: \"text-utility-success-500\",\r\n }\r\n\r\n return (\r\n <span\r\n data-slot=\"badge-group-icon\"\r\n className={cn(\r\n \"inline-flex items-center justify-center shrink-0 [&>svg]:size-4 [&>svg]:stroke-[2px] pointer-events-none transition-transform group-hover/badge-group:translate-x-0.5\",\r\n iconColorMap[color] || iconColorMap.brand,\r\n className\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n </span>\r\n )\r\n}\r\n\r\nexport interface BadgeGroupDotProps extends React.ComponentProps<\"span\"> {\r\n}\r\n\r\nfunction BadgeGroupDot({\r\n className,\r\n ...props\r\n}: BadgeGroupDotProps) {\r\n const { color } = React.useContext(badgeGroupContext)\r\n\r\n const dotColorMap: Record<string, string> = {\r\n brand: \"bg-utility-brand-500 outline-utility-brand-100\",\r\n gray: \"bg-utility-gray-500 outline-utility-gray-100\",\r\n error: \"bg-utility-error-500 outline-utility-error-100\",\r\n warning: \"bg-utility-warning-500 outline-utility-warning-100\",\r\n success: \"bg-utility-success-500 outline-utility-success-100\",\r\n }\r\n\r\n return (\r\n <span\r\n data-slot=\"badge-group-dot\"\r\n className={cn(\r\n \"inline-block size-1.5 shrink-0 rounded-xp-full outline-2 -outline-offset-1\",\r\n dotColorMap[color] || dotColorMap.brand,\r\n className\r\n )}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\nexport {\r\n BadgeGroup,\r\n BadgeGroupAddon,\r\n BadgeGroupIcon,\r\n BadgeGroupDot,\r\n badgeGroupVariants,\r\n}\r\n"]}
1
+ {"version":3,"sources":["../src/ui/badge-group.tsx"],"names":["badgeGroupVariants","cva","badgeGroupContext","BadgeGroup","className","theme","color","size","align","render","children","props","defaultProps","cn","jsx","useRender","mergeProps","BadgeGroupAddon","colorAddonMap","addonClasses","BadgeGroupIcon","ArrowRightIcon","iconColorMap","BadgeGroupDot","dotColorMap"],"mappings":"wRASA,IAAMA,EAAqBC,GAAAA,CACzB,uIAAA,CACA,CACE,QAAA,CAAU,CACR,KAAA,CAAO,CACL,KAAA,CAAO,mCAAA,CACP,MAAA,CAAQ,oIACV,CAAA,CACA,KAAA,CAAO,CACL,KAAA,CAAO,EAAA,CACP,IAAA,CAAM,EAAA,CACN,KAAA,CAAO,EAAA,CACP,QAAS,EAAA,CACT,OAAA,CAAS,EACX,CAAA,CACA,IAAA,CAAM,CACJ,GAAI,oBAAA,CACJ,EAAA,CAAI,oBACN,CAAA,CACA,KAAA,CAAO,CACL,QAAS,EAAA,CACT,QAAA,CAAU,EACZ,CACF,CAAA,CACA,gBAAA,CAAkB,CAEhB,CACE,KAAA,CAAO,OAAA,CACP,KAAA,CAAO,OAAA,CACP,SAAA,CAAW,8FACb,CAAA,CACA,CACE,KAAA,CAAO,OAAA,CACP,KAAA,CAAO,MAAA,CACP,UAAW,0FACb,CAAA,CACA,CACE,KAAA,CAAO,OAAA,CACP,KAAA,CAAO,QACP,SAAA,CAAW,8FACb,CAAA,CACA,CACE,KAAA,CAAO,OAAA,CACP,MAAO,SAAA,CACP,SAAA,CAAW,sGACb,CAAA,CACA,CACE,KAAA,CAAO,OAAA,CACP,KAAA,CAAO,SAAA,CACP,SAAA,CAAW,sGACb,CAAA,CAIA,CACE,KAAA,CAAO,UACP,IAAA,CAAM,IAAA,CACN,SAAA,CAAW,gBACb,CAAA,CACA,CACE,MAAO,SAAA,CACP,IAAA,CAAM,IAAA,CACN,SAAA,CAAW,kBACb,CAAA,CAEA,CACE,KAAA,CAAO,UAAA,CACP,IAAA,CAAM,IAAA,CACN,SAAA,CAAW,gBACb,EACA,CACE,KAAA,CAAO,UAAA,CACP,IAAA,CAAM,IAAA,CACN,SAAA,CAAW,kBACb,CACF,CAAA,CACA,eAAA,CAAi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S,0BAAA,CACT,OAAA,CAAS,0BACX,CAAA,CAEA,OACER,GAAAA,CAAC,MAAA,CAAA,CACC,WAAA,CAAU,kBAAA,CACV,SAAA,CAAWD,EAAAA,CACT,uKAAA,CACAS,CAAAA,CAAahB,CAAK,CAAA,EAAKgB,CAAAA,CAAa,KAAA,CACpClB,CACF,CAAA,CACC,GAAGO,CAAAA,CAEH,QAAA,CAAAD,CAAAA,CACH,CAEJ,CAKA,SAASa,CAAAA,CAAc,CACrB,SAAA,CAAAnB,CAAAA,CACA,GAAGO,CACL,CAAA,CAAuB,CACrB,GAAM,CAAE,KAAA,CAAAL,CAAM,EAAU,CAAA,CAAA,UAAA,CAAWJ,CAAiB,CAAA,CAE9CsB,CAAAA,CAAsC,CAC1C,KAAA,CAAO,iDACP,IAAA,CAAM,8CAAA,CACN,KAAA,CAAO,gDAAA,CACP,OAAA,CAAS,oDAAA,CACT,QAAS,oDACX,CAAA,CAEA,OACEV,GAAAA,CAAC,MAAA,CAAA,CACC,WAAA,CAAU,kBACV,SAAA,CAAWD,EAAAA,CACT,4EAAA,CACAW,CAAAA,CAAYlB,CAAK,CAAA,EAAKkB,CAAAA,CAAY,KAAA,CAClCpB,CACF,CAAA,CACC,GAAGO,CAAAA,CACN,CAEJ","file":"chunk-V2PW53KI.js","sourcesContent":["import * as React from \"react\"\r\n\r\nimport { mergeProps } from \"@base-ui/react/merge-props\"\r\nimport { useRender } from \"@base-ui/react/use-render\"\r\nimport { cva, type VariantProps } from \"class-variance-authority\"\r\nimport { ArrowRightIcon } from \"lucide-react\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\n\r\nconst badgeGroupVariants = cva(\r\n \"inline-flex items-center size-max whitespace-nowrap shrink-0 overflow-hidden transition-colors cursor-pointer group/badge-group gap-2\",\r\n {\r\n variants: {\r\n theme: {\r\n light: \"rounded-xp-full ring-1 ring-inset\",\r\n modern: \"rounded-xp-card-base-md bg-bg-primary text-text-secondary ring-1 ring-inset ring-border-primary shadow-xp-xs hover:bg-bg-secondary\",\r\n },\r\n color: {\r\n brand: \"\",\r\n gray: \"\",\r\n error: \"\",\r\n warning: \"\",\r\n success: \"\",\r\n },\r\n size: {\r\n md: \"text-body-medium-3\",\r\n lg: \"text-body-medium-2\",\r\n },\r\n align: {\r\n leading: \"\",\r\n trailing: \"\",\r\n },\r\n },\r\n compoundVariants: [\r\n // Light theme colors\r\n {\r\n theme: \"light\",\r\n color: \"brand\",\r\n className: \"bg-utility-brand-50 text-utility-brand-700 ring-utility-brand-200 hover:bg-utility-brand-100\",\r\n },\r\n {\r\n theme: \"light\",\r\n color: \"gray\",\r\n className: \"bg-utility-gray-50 text-utility-gray-700 ring-utility-gray-200 hover:bg-utility-gray-100\",\r\n },\r\n {\r\n theme: \"light\",\r\n color: \"error\",\r\n className: \"bg-utility-error-50 text-utility-error-700 ring-utility-error-200 hover:bg-utility-error-100\",\r\n },\r\n {\r\n theme: \"light\",\r\n color: \"warning\",\r\n className: \"bg-utility-warning-50 text-utility-warning-700 ring-utility-warning-200 hover:bg-utility-warning-100\",\r\n },\r\n {\r\n theme: \"light\",\r\n color: \"success\",\r\n className: \"bg-utility-success-50 text-utility-success-700 ring-utility-success-200 hover:bg-utility-success-100\",\r\n },\r\n\r\n // Size & Align combinations (Root padding matching exact Figma values)\r\n // Leading: Addon on the left\r\n {\r\n align: \"leading\",\r\n size: \"md\",\r\n className: \"py-1 pl-1 pr-2\",\r\n },\r\n {\r\n align: \"leading\",\r\n size: \"lg\",\r\n className: \"py-1 pl-1 pr-2.5\",\r\n },\r\n // Trailing: Addon on the right\r\n {\r\n align: \"trailing\",\r\n size: \"md\",\r\n className: \"py-1 pl-2 pr-1\",\r\n },\r\n {\r\n align: \"trailing\",\r\n size: \"lg\",\r\n className: \"py-1 pl-2.5 pr-1\",\r\n },\r\n ],\r\n defaultVariants: {\r\n theme: \"light\",\r\n color: \"brand\",\r\n size: \"md\",\r\n align: \"leading\",\r\n },\r\n }\r\n)\r\n\r\nconst badgeGroupContext = React.createContext<{\r\n theme: \"light\" | \"modern\"\r\n color: \"brand\" | \"gray\" | \"error\" | \"warning\" | \"success\"\r\n size: \"md\" | \"lg\"\r\n}>({\r\n theme: \"light\",\r\n color: \"brand\",\r\n size: \"md\",\r\n})\r\n\r\nexport interface BadgeGroupProps\r\n extends Omit<React.ComponentProps<\"div\">, \"color\">,\r\n VariantProps<typeof badgeGroupVariants> {\r\n}\r\n\r\nfunction BadgeGroup({\r\n className,\r\n theme = \"light\",\r\n color = \"brand\",\r\n size = \"md\",\r\n align = \"leading\",\r\n render,\r\n children,\r\n ...props\r\n}: BadgeGroupProps & useRender.ComponentProps<\"div\">) {\r\n const defaultProps = {\r\n \"data-slot\": \"badge-group\",\r\n \"data-theme\": theme,\r\n \"data-color\": color,\r\n \"data-size\": size,\r\n \"data-align\": align,\r\n className: cn(badgeGroupVariants({ theme, color, size, align }), className),\r\n children,\r\n }\r\n\r\n return (\r\n <badgeGroupContext.Provider value={{ theme: theme ?? \"light\", color: color ?? \"brand\", size: size ?? \"md\" }}>\r\n {useRender({\r\n defaultTagName: \"div\",\r\n props: mergeProps(defaultProps, props),\r\n render,\r\n state: {\r\n slot: \"badge-group\",\r\n theme,\r\n color,\r\n size,\r\n align,\r\n },\r\n })}\r\n </badgeGroupContext.Provider>\r\n )\r\n}\r\n\r\nexport interface BadgeGroupAddonProps extends React.ComponentProps<\"span\"> {\r\n children?: React.ReactNode\r\n}\r\n\r\nfunction BadgeGroupAddon({\r\n className,\r\n children,\r\n ...props\r\n}: BadgeGroupAddonProps) {\r\n const { theme, color, size } = React.useContext(badgeGroupContext)\r\n\r\n const colorAddonMap: Record<string, string> = {\r\n brand: \"ring-utility-brand-200 text-utility-brand-700\",\r\n gray: \"ring-utility-gray-200 text-utility-gray-700\",\r\n error: \"ring-utility-error-200 text-utility-error-700\",\r\n warning: \"ring-utility-warning-200 text-utility-warning-700\",\r\n success: \"ring-utility-success-200 text-utility-success-700\",\r\n }\r\n\r\n const addonClasses = cn(\r\n \"inline-flex items-center justify-center font-medium shrink-0\",\r\n theme === \"light\" && [\r\n \"rounded-xp-full bg-bg-primary ring-1 ring-inset\",\r\n colorAddonMap[color] || colorAddonMap.brand,\r\n size === \"md\" ? \"px-2 py-0.5\" : \"px-2.5 py-0.5\",\r\n ],\r\n theme === \"modern\" && [\r\n \"rounded-xp-card-base-sm bg-bg-primary shadow-xp-xs ring-1 ring-inset ring-border-primary text-text-secondary\",\r\n size === \"md\" ? \"gap-1 px-1.5 py-0.5\" : \"gap-1.5 px-2 py-0.5\",\r\n ],\r\n className\r\n )\r\n\r\n return (\r\n <span data-slot=\"badge-group-addon\" className={addonClasses} {...props}>\r\n {children}\r\n </span>\r\n )\r\n}\r\n\r\nexport interface BadgeGroupIconProps extends React.ComponentProps<\"span\"> {\r\n children?: React.ReactNode\r\n}\r\n\r\nfunction BadgeGroupIcon({\r\n className,\r\n children = <ArrowRightIcon />,\r\n ...props\r\n}: BadgeGroupIconProps) {\r\n const { color } = React.useContext(badgeGroupContext)\r\n\r\n const iconColorMap: Record<string, string> = {\r\n brand: \"text-utility-brand-500\",\r\n gray: \"text-utility-gray-500\",\r\n error: \"text-utility-error-500\",\r\n warning: \"text-utility-warning-500\",\r\n success: \"text-utility-success-500\",\r\n }\r\n\r\n return (\r\n <span\r\n data-slot=\"badge-group-icon\"\r\n className={cn(\r\n \"inline-flex items-center justify-center shrink-0 [&>svg]:size-4 [&>svg]:stroke-[2px] pointer-events-none transition-transform group-hover/badge-group:translate-x-0.5\",\r\n iconColorMap[color] || iconColorMap.brand,\r\n className\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n </span>\r\n )\r\n}\r\n\r\nexport interface BadgeGroupDotProps extends React.ComponentProps<\"span\"> {\r\n}\r\n\r\nfunction BadgeGroupDot({\r\n className,\r\n ...props\r\n}: BadgeGroupDotProps) {\r\n const { color } = React.useContext(badgeGroupContext)\r\n\r\n const dotColorMap: Record<string, string> = {\r\n brand: \"bg-utility-brand-500 outline-utility-brand-100\",\r\n gray: \"bg-utility-gray-500 outline-utility-gray-100\",\r\n error: \"bg-utility-error-500 outline-utility-error-100\",\r\n warning: \"bg-utility-warning-500 outline-utility-warning-100\",\r\n success: \"bg-utility-success-500 outline-utility-success-100\",\r\n }\r\n\r\n return (\r\n <span\r\n data-slot=\"badge-group-dot\"\r\n className={cn(\r\n \"inline-block size-1.5 shrink-0 rounded-xp-full outline-2 -outline-offset-1\",\r\n dotColorMap[color] || dotColorMap.brand,\r\n className\r\n )}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\nexport {\r\n BadgeGroup,\r\n BadgeGroupAddon,\r\n BadgeGroupIcon,\r\n BadgeGroupDot,\r\n badgeGroupVariants,\r\n}\r\n"]}
@@ -0,0 +1,2 @@
1
+ import {a,b,i,m,e,q,s,w,x,H}from'./chunk-RHWRIE3E.js';import {a as a$1}from'./chunk-Y6TKCAAJ.js';import'react';import {ChevronDownIcon}from'lucide-react';import'class-variance-authority';import {cn}from'@xploreu/lib/cn';import {jsxs,jsx}from'react/jsx-runtime';var y={"3xs":"size-3","2xs":"size-3.5",xs:"size-3.5",sm:"size-4",md:"size-4",lg:"size-4.5",xl:"size-5"},D={"3xs":"gap-1.5 pr-2","2xs":"gap-1.5 pr-2.5",xs:"gap-2 pr-2.5",sm:"gap-2 pr-3",md:"gap-2 pr-3",lg:"gap-2.5 pr-3.5",xl:"gap-2.5 pr-4"};function K({items:t,value:I,defaultValue:h,onValueChange:z,placeholder:m$1="Select",searchPlaceholder:N,icon:n,container:V,isPending:v,className:R,triggerClassName:T,contentClassName:k,disabled:q$1,size:a$2="md",infiniteScroll:w$1,showSearch:p=false,filter:l,...L}){return jsxs(a,{items:t,value:I,defaultValue:h,onValueChange:z,filter:l===null||!p?null:l,isItemEqualToValue:(e,B)=>e.value===B.value,disabled:q$1,...L,children:[jsxs(b,{className:cn(a$1({size:a$2}),"group flex cursor-pointer items-center text-left",D[a$2??"md"]??"gap-2 pr-3",T,R),children:[n&&jsx("span",{className:cn(y[a$2??"md"]??"size-4","shrink-0 text-fg-quaternary [&_svg]:size-full"),children:n}),jsx("span",{className:"flex-1 truncate",children:jsx(i,{children:e=>jsx("span",{className:e?"text-text-primary":"text-text-placeholder",children:e?.label??m$1})})}),jsx(ChevronDownIcon,{className:cn(y[a$2??"md"]??"size-4","shrink-0 text-fg-quaternary transition-transform group-data-[popup-open]:rotate-180")})]}),jsxs(m,{container:V,className:cn("w-72",k),align:"start",sideOffset:8,children:[p&&jsx(e,{placeholder:N??`Search ${m$1.toLowerCase()}...`}),jsx(q,{status:v||t===void 0?"pending":t.length===0?"empty":null}),jsxs(s,{children:[t?.map(e=>jsx(w,{value:e,children:jsx(x,{children:e.label})},e.value)),jsx(H,{...w$1})]})]})]})}export{K as a};//# sourceMappingURL=chunk-VIBM666E.js.map
2
+ //# sourceMappingURL=chunk-VIBM666E.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/composites/combobox-simple.tsx"],"names":["comboboxSimpleIconSizes","comboboxSimpleTriggerPaddings","ComboboxSimple","items","value","defaultValue","onValueChange","placeholder","searchPlaceholder","icon","container","isPending","className","triggerClassName","contentClassName","disabled","size","infiniteScroll","showSearch","filter","props","jsxs","Combobox","a","b","ComboboxTrigger","cn","inputVariants","jsx","ComboboxValue","item","ChevronDownIcon","ComboboxPopup","ComboboxInput","ComboboxStatus","ComboboxList","ComboboxItem","ComboboxItemTitle","ComboboxInfiniteScroll"],"mappings":"qQA8CA,IAAMA,CAAAA,CAAkD,CACtD,KAAA,CAAO,QAAA,CACP,KAAA,CAAO,UAAA,CACP,EAAA,CAAI,UAAA,CACJ,EAAA,CAAI,QAAA,CACJ,EAAA,CAAI,SACJ,EAAA,CAAI,UAAA,CACJ,EAAA,CAAI,QACN,CAAA,CAEMC,CAAAA,CAAwD,CAC5D,KAAA,CAAO,cAAA,CACP,KAAA,CAAO,gBAAA,CACP,EAAA,CAAI,cAAA,CACJ,EAAA,CAAI,YAAA,CACJ,EAAA,CAAI,aACJ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AAA,CACpC,QAAA,CAAAF,IAACS,CAAAA,CAAA,CACE,QAAA,CAAAP,CAAAA,CAAK,KAAA,CACR,CAAA,CAAA,CAHiBA,CAAAA,CAAK,KAIxB,CACD,CAAA,CACDF,GAAAA,CAACU,CAAAA,CAAA,CAAwB,GAAGrB,GAAAA,CAAgB,CAAA,CAAA,CAC9C,CAAA,CAAA,CACF,GACF,CAEJ","file":"chunk-VIBM666E.js","sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\nimport { ChevronDownIcon } from \"lucide-react\"\r\nimport { type VariantProps } from \"class-variance-authority\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\nimport { inputVariants } from \"../ui/input\"\r\nimport { ComboboxItem, ComboboxItemTitle, type ComboboxProps } 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 ComboboxValue,\r\n} from \"../ui/combobox\"\r\n\r\n// ─── Types ───\r\n\r\nexport type ComboboxSimpleItem = {\r\n label: string\r\n value: string\r\n}\r\n\r\ntype BaseProps = {\r\n items: ComboboxSimpleItem[] | undefined\r\n placeholder?: string\r\n searchPlaceholder?: 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 size?: VariantProps<typeof inputVariants>[\"size\"]\r\n infiniteScroll?: React.ComponentProps<typeof ComboboxInfiniteScroll>\r\n showSearch?: boolean\r\n}\r\n\r\nexport type ComboboxSimpleProps = Omit<ComboboxProps<ComboboxSimpleItem, false>, \"multiple\" | \"items\"> & BaseProps\r\n\r\nconst comboboxSimpleIconSizes: Record<string, string> = {\r\n \"3xs\": \"size-3\",\r\n \"2xs\": \"size-3.5\",\r\n xs: \"size-3.5\",\r\n sm: \"size-4\",\r\n md: \"size-4\",\r\n lg: \"size-4.5\",\r\n xl: \"size-5\",\r\n}\r\n\r\nconst comboboxSimpleTriggerPaddings: Record<string, string> = {\r\n \"3xs\": \"gap-1.5 pr-2\",\r\n \"2xs\": \"gap-1.5 pr-2.5\",\r\n xs: \"gap-2 pr-2.5\",\r\n sm: \"gap-2 pr-3\",\r\n md: \"gap-2 pr-3\",\r\n lg: \"gap-2.5 pr-3.5\",\r\n xl: \"gap-2.5 pr-4\",\r\n}\r\n\r\n// ─── Component ───\r\n\r\nfunction ComboboxSimple({\r\n items,\r\n value,\r\n defaultValue,\r\n onValueChange,\r\n placeholder = \"Select\",\r\n searchPlaceholder,\r\n icon,\r\n container,\r\n isPending,\r\n className,\r\n triggerClassName,\r\n contentClassName,\r\n disabled,\r\n size = \"md\",\r\n infiniteScroll,\r\n showSearch = false,\r\n filter,\r\n ...props\r\n}: ComboboxSimpleProps) {\r\n return (\r\n <Combobox\r\n items={items}\r\n value={value}\r\n defaultValue={defaultValue}\r\n onValueChange={onValueChange}\r\n filter={filter === null || !showSearch ? null : filter}\r\n isItemEqualToValue={(a, b) => a.value === b.value}\r\n disabled={disabled}\r\n {...props}\r\n >\r\n <ComboboxTrigger\r\n className={cn(\r\n inputVariants({ size }),\r\n \"group flex cursor-pointer items-center text-left\",\r\n comboboxSimpleTriggerPaddings[size ?? \"md\"] ?? \"gap-2 pr-3\",\r\n triggerClassName,\r\n className\r\n )}\r\n >\r\n {icon && (\r\n <span className={cn(comboboxSimpleIconSizes[size ?? \"md\"] ?? \"size-4\", \"shrink-0 text-fg-quaternary [&_svg]:size-full\")}>\r\n {icon}\r\n </span>\r\n )}\r\n <span className=\"flex-1 truncate\">\r\n <ComboboxValue>\r\n {(item) => (\r\n <span className={item ? \"text-text-primary\" : \"text-text-placeholder\"}>\r\n {item?.label ?? placeholder}\r\n </span>\r\n )}\r\n </ComboboxValue>\r\n </span>\r\n <ChevronDownIcon\r\n className={cn(\r\n comboboxSimpleIconSizes[size ?? \"md\"] ?? \"size-4\",\r\n \"shrink-0 text-fg-quaternary transition-transform group-data-[popup-open]:rotate-180\"\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 {showSearch && (\r\n <ComboboxInput placeholder={searchPlaceholder ?? `Search ${placeholder.toLowerCase()}...`} />\r\n )}\r\n <ComboboxStatus\r\n status={\r\n isPending || items === undefined\r\n ? \"pending\"\r\n : items.length === 0\r\n ? \"empty\"\r\n : null\r\n }\r\n />\r\n <ComboboxList>\r\n {items?.map((item) => (\r\n <ComboboxItem key={item.value} value={item}>\r\n <ComboboxItemTitle>\r\n {item.label}\r\n </ComboboxItemTitle>\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 { ComboboxSimple }\r\n"]}