@xploreu/components 0.4.4 → 0.4.7

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 (198) hide show
  1. package/dist/chunk-3XWZPMXH.js +2 -0
  2. package/dist/chunk-3XWZPMXH.js.map +1 -0
  3. package/dist/chunk-4WDDWMBW.js +3 -0
  4. package/dist/chunk-4WDDWMBW.js.map +1 -0
  5. package/dist/chunk-5ETIHFSE.js +3 -0
  6. package/dist/chunk-5ETIHFSE.js.map +1 -0
  7. package/dist/chunk-77T5FOYW.js +2 -0
  8. package/dist/chunk-77T5FOYW.js.map +1 -0
  9. package/dist/chunk-7WQRDDWL.js +2 -0
  10. package/dist/chunk-7WQRDDWL.js.map +1 -0
  11. package/dist/chunk-AKTRVGKT.js +2 -0
  12. package/dist/{chunk-DSH6THYW.js.map → chunk-AKTRVGKT.js.map} +1 -1
  13. package/dist/chunk-AUYPBFZJ.js +2 -0
  14. package/dist/chunk-AUYPBFZJ.js.map +1 -0
  15. package/dist/chunk-BRZUHQYB.js +2 -0
  16. package/dist/chunk-BRZUHQYB.js.map +1 -0
  17. package/dist/chunk-BX7TD4RH.js +2 -0
  18. package/dist/chunk-BX7TD4RH.js.map +1 -0
  19. package/dist/chunk-CHN5ZCUY.js +2 -0
  20. package/dist/chunk-CHN5ZCUY.js.map +1 -0
  21. package/dist/chunk-DCH35MB4.js +3 -0
  22. package/dist/chunk-DCH35MB4.js.map +1 -0
  23. package/dist/chunk-EE5QQGMX.js +2 -0
  24. package/dist/chunk-EE5QQGMX.js.map +1 -0
  25. package/dist/chunk-ITR3T6UB.js +2 -0
  26. package/dist/chunk-ITR3T6UB.js.map +1 -0
  27. package/dist/chunk-JP737TCG.js +2 -0
  28. package/dist/chunk-JP737TCG.js.map +1 -0
  29. package/dist/chunk-KT5JRJJR.js +2 -0
  30. package/dist/chunk-KT5JRJJR.js.map +1 -0
  31. package/dist/chunk-MXDNSGGI.js +2 -0
  32. package/dist/chunk-MXDNSGGI.js.map +1 -0
  33. package/dist/chunk-NKQ3MFRE.js +2 -0
  34. package/dist/chunk-NKQ3MFRE.js.map +1 -0
  35. package/dist/chunk-NY57FUA3.js +2 -0
  36. package/dist/{chunk-2TQHUVNP.js.map → chunk-NY57FUA3.js.map} +1 -1
  37. package/dist/chunk-OF4LN45Z.js +2 -0
  38. package/dist/chunk-OF4LN45Z.js.map +1 -0
  39. package/dist/chunk-P2DJG2OD.js +2 -0
  40. package/dist/chunk-P2DJG2OD.js.map +1 -0
  41. package/dist/{chunk-NTQ2FXS7.js → chunk-P6Y4P5QT.js} +2 -2
  42. package/dist/{chunk-NTQ2FXS7.js.map → chunk-P6Y4P5QT.js.map} +1 -1
  43. package/dist/{chunk-VE5ZAJ35.js → chunk-QV2OO65X.js} +2 -2
  44. package/dist/{chunk-VE5ZAJ35.js.map → chunk-QV2OO65X.js.map} +1 -1
  45. package/dist/chunk-QWCYJC3T.js +3 -0
  46. package/dist/chunk-QWCYJC3T.js.map +1 -0
  47. package/dist/chunk-RCA6JRHN.js +2 -0
  48. package/dist/chunk-RCA6JRHN.js.map +1 -0
  49. package/dist/chunk-RN6CYJKG.js +2 -0
  50. package/dist/chunk-RN6CYJKG.js.map +1 -0
  51. package/dist/chunk-S4IFBDOJ.js +2 -0
  52. package/dist/chunk-S4IFBDOJ.js.map +1 -0
  53. package/dist/chunk-TES3PKRE.js +2 -0
  54. package/dist/chunk-TES3PKRE.js.map +1 -0
  55. package/dist/chunk-UBTCCHVI.js +2 -0
  56. package/dist/chunk-UBTCCHVI.js.map +1 -0
  57. package/dist/chunk-UCCQUPMT.js +3 -0
  58. package/dist/chunk-UCCQUPMT.js.map +1 -0
  59. package/dist/chunk-WWCXHCNU.js +2 -0
  60. package/dist/chunk-WWCXHCNU.js.map +1 -0
  61. package/dist/chunk-XG3W7QMP.js +2 -0
  62. package/dist/chunk-XG3W7QMP.js.map +1 -0
  63. package/dist/chunk-XJTOYNCA.js +3 -0
  64. package/dist/chunk-XJTOYNCA.js.map +1 -0
  65. package/dist/chunk-XLACGAIR.js +2 -0
  66. package/dist/chunk-XLACGAIR.js.map +1 -0
  67. package/dist/{chunk-NG3NFI2B.js → chunk-XZKSYHE5.js} +2 -2
  68. package/dist/{chunk-NG3NFI2B.js.map → chunk-XZKSYHE5.js.map} +1 -1
  69. package/dist/{chunk-746IQSMF.js → chunk-YB5ZNOPP.js} +2 -2
  70. package/dist/{chunk-746IQSMF.js.map → chunk-YB5ZNOPP.js.map} +1 -1
  71. package/dist/chunk-YKX7SKZA.js +2 -0
  72. package/dist/chunk-YKX7SKZA.js.map +1 -0
  73. package/dist/{chunk-IXWAWSD4.js → chunk-YZNI5HEX.js} +2 -2
  74. package/dist/{chunk-IXWAWSD4.js.map → chunk-YZNI5HEX.js.map} +1 -1
  75. package/dist/chunk-ZP4ZPH65.js +2 -0
  76. package/dist/chunk-ZP4ZPH65.js.map +1 -0
  77. package/dist/chunk-ZQWDYX2E.js +3 -0
  78. package/dist/chunk-ZQWDYX2E.js.map +1 -0
  79. package/dist/composites/combobox-chip-outside.js +1 -1
  80. package/dist/composites/combobox-chip.d.ts +42 -0
  81. package/dist/composites/combobox-chip.js +2 -0
  82. package/dist/composites/combobox-chip.js.map +1 -0
  83. package/dist/composites/combobox-simple.d.ts +33 -0
  84. package/dist/composites/combobox-simple.js +2 -0
  85. package/dist/composites/combobox-simple.js.map +1 -0
  86. package/dist/composites/filter-combobox.d.ts +42 -0
  87. package/dist/composites/filter-combobox.js +2 -0
  88. package/dist/composites/filter-combobox.js.map +1 -0
  89. package/dist/composites/index.d.ts +9 -114
  90. package/dist/composites/index.js +1 -1
  91. package/dist/composites/index.js.map +1 -1
  92. package/dist/composites/phone-input.js +1 -1
  93. package/dist/composites/profile-avatar.d.ts +28 -0
  94. package/dist/composites/profile-avatar.js +2 -0
  95. package/dist/composites/profile-avatar.js.map +1 -0
  96. package/dist/form/form-input.js +1 -1
  97. package/dist/form/index.js +1 -1
  98. package/dist/icons/check-square-icon.d.ts +6 -0
  99. package/dist/icons/check-square-icon.js +2 -0
  100. package/dist/icons/check-square-icon.js.map +1 -0
  101. package/dist/icons/close-square-icon.d.ts +6 -0
  102. package/dist/icons/close-square-icon.js +2 -0
  103. package/dist/icons/close-square-icon.js.map +1 -0
  104. package/dist/icons/danger-triangle-icon.d.ts +6 -0
  105. package/dist/icons/danger-triangle-icon.js +2 -0
  106. package/dist/icons/danger-triangle-icon.js.map +1 -0
  107. package/dist/icons/index.d.ts +7 -1
  108. package/dist/icons/index.js +1 -1
  109. package/dist/icons/sort-ascending-icon.d.ts +6 -0
  110. package/dist/icons/sort-ascending-icon.js +2 -0
  111. package/dist/icons/sort-ascending-icon.js.map +1 -0
  112. package/dist/icons/sort-default-icon.d.ts +6 -0
  113. package/dist/icons/sort-default-icon.js +2 -0
  114. package/dist/icons/sort-default-icon.js.map +1 -0
  115. package/dist/icons/sort-descending-icon.d.ts +6 -0
  116. package/dist/icons/sort-descending-icon.js +2 -0
  117. package/dist/icons/sort-descending-icon.js.map +1 -0
  118. package/dist/primitives/accordion.d.ts +33 -0
  119. package/dist/primitives/accordion.js +2 -0
  120. package/dist/primitives/accordion.js.map +1 -0
  121. package/dist/primitives/checkbox.d.ts +16 -0
  122. package/dist/primitives/checkbox.js +2 -0
  123. package/dist/primitives/checkbox.js.map +1 -0
  124. package/dist/primitives/collapsible.d.ts +22 -0
  125. package/dist/primitives/collapsible.js +2 -0
  126. package/dist/primitives/collapsible.js.map +1 -0
  127. package/dist/primitives/index.d.ts +16 -19
  128. package/dist/primitives/index.js +1 -1
  129. package/dist/primitives/menu.d.ts +61 -0
  130. package/dist/primitives/menu.js +2 -0
  131. package/dist/primitives/menu.js.map +1 -0
  132. package/dist/primitives/slider.d.ts +18 -0
  133. package/dist/primitives/slider.js +2 -0
  134. package/dist/primitives/slider.js.map +1 -0
  135. package/dist/primitives/toast.d.ts +27 -0
  136. package/dist/primitives/toast.js +2 -0
  137. package/dist/primitives/toast.js.map +1 -0
  138. package/dist/primitives/tooltip.d.ts +18 -0
  139. package/dist/primitives/tooltip.js +2 -0
  140. package/dist/primitives/tooltip.js.map +1 -0
  141. package/dist/ui/accordion.d.ts +20 -0
  142. package/dist/ui/accordion.js +2 -0
  143. package/dist/ui/accordion.js.map +1 -0
  144. package/dist/ui/alert-dialog.js +1 -1
  145. package/dist/ui/badge.d.ts +2 -2
  146. package/dist/ui/button.d.ts +1 -1
  147. package/dist/ui/calendar.d.ts +40 -0
  148. package/dist/ui/calendar.js +2 -0
  149. package/dist/ui/calendar.js.map +1 -0
  150. package/dist/ui/carousel.d.ts +35 -0
  151. package/dist/ui/carousel.js +2 -0
  152. package/dist/ui/carousel.js.map +1 -0
  153. package/dist/ui/checkbox.d.ts +16 -0
  154. package/dist/ui/checkbox.js +2 -0
  155. package/dist/ui/checkbox.js.map +1 -0
  156. package/dist/ui/collapsible.d.ts +15 -0
  157. package/dist/ui/collapsible.js +2 -0
  158. package/dist/ui/collapsible.js.map +1 -0
  159. package/dist/ui/combobox.js +1 -1
  160. package/dist/ui/date-multiple-picker.d.ts +26 -0
  161. package/dist/ui/date-multiple-picker.js +2 -0
  162. package/dist/ui/date-multiple-picker.js.map +1 -0
  163. package/dist/ui/date-picker.d.ts +23 -0
  164. package/dist/ui/date-picker.js +2 -0
  165. package/dist/ui/date-picker.js.map +1 -0
  166. package/dist/ui/date-range-picker.d.ts +23 -0
  167. package/dist/ui/date-range-picker.js +2 -0
  168. package/dist/ui/date-range-picker.js.map +1 -0
  169. package/dist/ui/dialog.js +1 -1
  170. package/dist/ui/index.d.ts +31 -113
  171. package/dist/ui/index.js +1 -1
  172. package/dist/ui/input.js +1 -1
  173. package/dist/ui/menu.d.ts +48 -0
  174. package/dist/ui/menu.js +2 -0
  175. package/dist/ui/menu.js.map +1 -0
  176. package/dist/ui/pagination.d.ts +15 -0
  177. package/dist/ui/pagination.js +2 -0
  178. package/dist/ui/pagination.js.map +1 -0
  179. package/dist/ui/sheet.js +1 -1
  180. package/dist/ui/slider.d.ts +14 -0
  181. package/dist/ui/slider.js +2 -0
  182. package/dist/ui/slider.js.map +1 -0
  183. package/dist/ui/table.d.ts +24 -0
  184. package/dist/ui/table.js +2 -0
  185. package/dist/ui/table.js.map +1 -0
  186. package/dist/ui/toast.d.ts +28 -0
  187. package/dist/ui/toast.js +2 -0
  188. package/dist/ui/toast.js.map +1 -0
  189. package/dist/ui/tooltip.d.ts +19 -0
  190. package/dist/ui/tooltip.js +2 -0
  191. package/dist/ui/tooltip.js.map +1 -0
  192. package/package.json +15 -13
  193. package/dist/chunk-2TQHUVNP.js +0 -2
  194. package/dist/chunk-DSH6THYW.js +0 -2
  195. package/dist/chunk-DXI32G2S.js +0 -2
  196. package/dist/chunk-DXI32G2S.js.map +0 -1
  197. package/dist/chunk-MAY6ICTE.js +0 -2
  198. package/dist/chunk-MAY6ICTE.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ import {d,e,p,h,t,v,G as G$1,x,z,c}from'./chunk-YB5ZNOPP.js';import*as l from'react';import {ChevronDownIcon,CheckCircle2Icon}from'lucide-react';import {cn}from'@xploreu/lib/cn';import {jsxs,jsx,Fragment}from'react/jsx-runtime';function W({checked:o}){return jsx("span",{"data-checked":o?"":void 0,className:cn("flex size-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors",o?"border-border-brand bg-bg-brand-solid text-white":"border-border-primary bg-bg-primary"),children:o&&jsx("svg",{viewBox:"0 0 12 12",className:"size-3",fill:"none",children:jsx("path",{d:"M2.5 6L4.75 8.25L9.5 3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})}function w({...o}){return jsx(x,{children:jsx(z,{...o,withIndicator:false})})}function G(o){return jsx(c,{...o})}function oe(o){let{items:s,placeholder:b="Select",icon:h$1,container:R,isPending:y,className:L,triggerClassName:z,contentClassName:$,disabled:q,infiniteScroll:I}=o,r=o.multiple===true,c=l.useMemo(()=>{if(r)return o.value;let e=o.value;return e?[e]:[]},[r,o.value,o.value]),A=l.useMemo(()=>{if(r)return o.defaultValue??[];let e=o.defaultValue;return e?[e]:[]},[r,o.defaultValue,o.defaultValue]),[B,p$1]=l.useState(()=>(c!==void 0?c:A)??[]);l.useEffect(()=>{c!==void 0&&p$1(c);},[c]);let m=B??[],i=m.length>0,[x,j]=l.useState(""),v$1=l.useMemo(()=>{if(!x.trim())return s;let e=x.toLowerCase();return s?.filter(a=>a.label.toLowerCase().includes(e)||a.value.toLowerCase().includes(e))},[s,x]),T=e=>{let a=e;if(r)p$1(a),o.onValueChange?.(a);else {let d=a.length>0?a[a.length-1]:null;p$1(d?[d]:[]),o.onValueChange?.(d);}},E=()=>{p$1([]),r?o.onValueChange?.([]):o.onValueChange?.(null);},H=l.useMemo(()=>i?r?`${b} (${m.length})`:m[0]?.label??b:r?`All ${b}`:b,[i,r,b,m]);return jsxs(d,{multiple:true,items:s,value:m,onValueChange:T,isItemEqualToValue:(e,a)=>e.value===a.value,disabled:q,children:[jsxs(e,{className:cn("group flex h-9 w-fit max-w-[220px] items-center gap-2 rounded-xp-card-base border bg-bg-primary px-3 text-body-medium-3 transition-colors","border-border-primary text-text-secondary hover:bg-bg-primary-hover",i&&"border-border-brand bg-bg-brand-primary text-text-brand-secondary","disabled:pointer-events-none disabled:opacity-50","data-[popup-open]:border-border-brand data-[popup-open]:bg-bg-brand-primary data-[popup-open]:text-text-brand-secondary",z,L),children:[h$1&&jsx("span",{className:cn("size-4 shrink-0",i?"text-fg-brand-primary":"text-fg-quaternary"),children:h$1}),jsx("span",{className:"truncate",children:H}),jsx(ChevronDownIcon,{className:cn("size-4 shrink-0 transition-transform group-data-[popup-open]:rotate-180",i?"text-fg-brand-primary":"text-fg-quaternary")})]}),jsx(p,{container:R,className:cn("w-72",$),align:"start",sideOffset:8,children:r?jsxs("div",{className:"flex flex-col",children:[jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border-primary",children:[jsx("span",{className:"text-label-semibold-3 text-text-primary",children:b}),jsxs("button",{type:"button",disabled:!i,onClick:E,className:cn("text-body-medium-3 transition-colors",i?"cursor-pointer text-text-brand-secondary hover:text-text-brand-secondary-hover":"cursor-not-allowed text-text-disabled"),children:["Clear",i?` (${m.length})`:""]})]}),jsx(h,{value:x,onChange:e=>j(e.target.value),placeholder:`Search ${b.toLowerCase()}...`}),jsx(t,{status:y||s===void 0?"pending":v$1?.length===0?"empty":null}),jsxs(v,{children:[v$1?.map(e=>{let a=m.some(d=>d.value===e.value);return jsxs(w,{value:e,children:[jsx(W,{checked:a}),jsx("span",{className:"truncate",children:e.label})]},e.value)}),jsx(G$1,{...I})]})]}):jsxs(Fragment,{children:[jsx(t,{status:y||s===void 0?"pending":s?.length===0?"empty":null}),jsxs(v,{children:[s?.map(e=>jsxs(w,{value:e,className:"justify-between",children:[jsx("span",{className:"truncate",children:e.label}),jsx(G,{children:jsx(CheckCircle2Icon,{className:"size-5 shrink-0 text-fg-brand-primary"})})]},e.value)),jsx(G$1,{...I})]})]})})]})}export{oe as a};//# sourceMappingURL=chunk-MXDNSGGI.js.map
2
+ //# sourceMappingURL=chunk-MXDNSGGI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/composites/filter-combobox.tsx"],"names":["MiniCheckbox","checked","jsx","cn","FilterItem","props","ComboboxHighlightItem","ComboboxItem","FilterItemIndicator","ComboboxItemIndicator","FilterCombobox","items","placeholder","icon","container","isPending","className","triggerClassName","contentClassName","disabled","infiniteScroll","isMultiple","controlledArray","single","defaultArray","internalValue","setInternalValue","valueArray","hasValue","search","setSearch","filteredItems","q","it","handleValueChange","next","arr","handleClear","triggerLabel","jsxs","Combobox","a","b","ComboboxTrigger","ChevronDownIcon","ComboboxPopup","ComboboxInput","ComboboxStatus","ComboboxList","item","v","ComboboxInfiniteScroll","Fragment","CheckCircle2Icon"],"mappings":"oOA6DA,SAASA,CAAAA,CAAa,CAAE,OAAA,CAAAC,CAAQ,EAAyB,CACvD,OACEC,GAAAA,CAAC,MAAA,CAAA,CACC,eAAc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BAAA,CAClD,QAAA,CAAA,CAAA/C,IAAC,MAAA,CAAA,CAAK,SAAA,CAAU,UAAA,CAAY,QAAA,CAAA+C,EAAK,KAAA,CAAM,CAAA,CACvC/C,GAAAA,CAACM,CAAAA,CAAA,CACC,QAAA,CAAAN,GAAAA,CAACmD,gBAAAA,CAAA,CAAiB,UAAU,uCAAA,CAAwC,CAAA,CACtE,CAAA,CAAA,CAAA,CAJeJ,CAAAA,CAAK,KAKtB,CACD,CAAA,CACD/C,GAAAA,CAACiD,GAAAA,CAAA,CAAwB,GAAG/B,CAAAA,CAAgB,GAC9C,CAAA,CAAA,CACF,CAAA,CAEJ,GACF,CAEJ","file":"chunk-MXDNSGGI.js","sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\nimport { CheckCircle2Icon, ChevronDownIcon, SearchIcon } from \"lucide-react\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\nimport {\r\n ComboboxItemIndicator as ComboboxItemIndicatorPrimitive\r\n} from \"../primitives/combobox\"\r\nimport { ComboboxHighlightItem, ComboboxItem } from \"../ui/combobox\"\r\nimport { Input } from \"../ui/input\"\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 type ComboboxProps,\r\n} from \"../ui/combobox\"\r\n\r\n// ─── Types ───\r\n\r\nexport type FilterComboboxItem = {\r\n label: string\r\n value: string\r\n}\r\n\r\ntype BaseProps = {\r\n items: FilterComboboxItem[] | undefined\r\n placeholder?: string\r\n icon?: React.ReactNode\r\n container?: React.ComponentProps<typeof ComboboxPortal>[\"container\"]\r\n isPending?: boolean\r\n className?: string\r\n triggerClassName?: string\r\n contentClassName?: string\r\n disabled?: boolean\r\n infiniteScroll?: React.ComponentProps<typeof ComboboxInfiniteScroll>\r\n}\r\n\r\ntype SingleProps = BaseProps & {\r\n multiple?: false\r\n value?: FilterComboboxItem | null\r\n defaultValue?: FilterComboboxItem | null\r\n onValueChange?: (value: FilterComboboxItem | null) => void\r\n}\r\n\r\ntype MultipleProps = BaseProps & {\r\n multiple: true\r\n value?: FilterComboboxItem[]\r\n defaultValue?: FilterComboboxItem[]\r\n onValueChange?: (value: FilterComboboxItem[]) => void\r\n}\r\n\r\nexport type FilterComboboxProps = SingleProps | MultipleProps\r\n\r\n// ─── Mini checkbox (no extra dep) ───\r\n\r\nfunction MiniCheckbox({ checked }: { checked: boolean }) {\r\n return (\r\n <span\r\n data-checked={checked ? \"\" : undefined}\r\n className={cn(\r\n \"flex size-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors\",\r\n checked\r\n ? \"border-border-brand bg-bg-brand-solid text-white\"\r\n : \"border-border-primary bg-bg-primary\"\r\n )}\r\n >\r\n {checked && (\r\n <svg viewBox=\"0 0 12 12\" className=\"size-3\" fill=\"none\">\r\n <path\r\n d=\"M2.5 6L4.75 8.25L9.5 3.5\"\r\n stroke=\"currentColor\"\r\n strokeWidth=\"1.5\"\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n />\r\n </svg>\r\n )}\r\n </span>\r\n )\r\n}\r\n\r\n// ─── Clean item without default indicator (fix double checkbox bug) ───\r\n\r\nfunction FilterItem({\r\n ...props\r\n}: React.ComponentProps<typeof ComboboxItem>) {\r\n return (\r\n <ComboboxHighlightItem>\r\n <ComboboxItem\r\n {...props}\r\n withIndicator={false}\r\n />\r\n </ComboboxHighlightItem>\r\n )\r\n}\r\n\r\nfunction FilterItemIndicator(props: React.ComponentProps<typeof ComboboxItemIndicatorPrimitive>) {\r\n return <ComboboxItemIndicatorPrimitive {...props} />\r\n}\r\n\r\n// ─── Component ───\r\n\r\nfunction FilterCombobox(props: FilterComboboxProps) {\r\n const {\r\n items,\r\n placeholder = \"Select\",\r\n icon,\r\n container,\r\n isPending,\r\n className,\r\n triggerClassName,\r\n contentClassName,\r\n disabled,\r\n infiniteScroll,\r\n } = props\r\n\r\n const isMultiple = props.multiple === true\r\n\r\n // Normalize controlled value to array for internal combobox (always multiple=true internally)\r\n const controlledArray = React.useMemo(() => {\r\n if (isMultiple) {\r\n return (props as MultipleProps).value\r\n }\r\n const single = (props as SingleProps).value\r\n return single ? [single] : []\r\n }, [isMultiple, (props as SingleProps).value, (props as MultipleProps).value])\r\n\r\n const defaultArray = React.useMemo(() => {\r\n if (isMultiple) {\r\n return (props as MultipleProps).defaultValue ?? []\r\n }\r\n const single = (props as SingleProps).defaultValue\r\n return single ? [single] : []\r\n }, [isMultiple, (props as SingleProps).defaultValue, (props as MultipleProps).defaultValue])\r\n\r\n const [internalValue, setInternalValue] = React.useState<FilterComboboxItem[]>(\r\n () =>\r\n (controlledArray !== undefined\r\n ? (controlledArray as FilterComboboxItem[])\r\n : (defaultArray as FilterComboboxItem[])) ?? []\r\n )\r\n\r\n // Sync when controlled value changes externally\r\n React.useEffect(() => {\r\n if (controlledArray !== undefined) {\r\n setInternalValue(controlledArray as FilterComboboxItem[])\r\n }\r\n }, [controlledArray])\r\n\r\n const valueArray = internalValue ?? []\r\n const hasValue = valueArray.length > 0\r\n\r\n // Search for multiple variant\r\n const [search, setSearch] = React.useState(\"\")\r\n\r\n const filteredItems = React.useMemo(() => {\r\n if (!search.trim()) return items\r\n const q = search.toLowerCase()\r\n return items?.filter(\r\n (it) => it.label.toLowerCase().includes(q) || it.value.toLowerCase().includes(q)\r\n )\r\n }, [items, search])\r\n\r\n const handleValueChange: ComboboxProps<FilterComboboxItem, boolean>[\"onValueChange\"] = (\r\n next\r\n ) => {\r\n const arr = next as FilterComboboxItem[]\r\n if (isMultiple) {\r\n setInternalValue(arr)\r\n ; (props as MultipleProps).onValueChange?.(arr)\r\n } else {\r\n // single: take last selected (base-ui gives array)\r\n const single = arr.length > 0 ? arr[arr.length - 1] : null\r\n const normalized = single ? [single] : []\r\n setInternalValue(normalized)\r\n ; (props as SingleProps).onValueChange?.(single)\r\n }\r\n }\r\n\r\n const handleClear = () => {\r\n setInternalValue([])\r\n if (isMultiple) {\r\n ; (props as MultipleProps).onValueChange?.([])\r\n } else {\r\n ; (props as SingleProps).onValueChange?.(null)\r\n }\r\n }\r\n\r\n // Trigger label\r\n const triggerLabel = React.useMemo(() => {\r\n if (!hasValue) {\r\n return isMultiple ? `All ${placeholder}` : placeholder\r\n }\r\n if (isMultiple) {\r\n return `${placeholder} (${valueArray.length})`\r\n }\r\n return valueArray[0]?.label ?? placeholder\r\n }, [hasValue, isMultiple, placeholder, valueArray])\r\n\r\n return (\r\n <Combobox\r\n multiple\r\n items={items}\r\n value={valueArray}\r\n onValueChange={handleValueChange}\r\n isItemEqualToValue={(a, b) => a.value === b.value}\r\n disabled={disabled}\r\n >\r\n <ComboboxTrigger\r\n className={cn(\r\n \"group flex h-9 w-fit max-w-[220px] items-center gap-2 rounded-xp-card-base border bg-bg-primary px-3 text-body-medium-3 transition-colors\",\r\n \"border-border-primary text-text-secondary hover:bg-bg-primary-hover\",\r\n hasValue && \"border-border-brand bg-bg-brand-primary text-text-brand-secondary\",\r\n \"disabled:pointer-events-none disabled:opacity-50\",\r\n \"data-[popup-open]:border-border-brand data-[popup-open]:bg-bg-brand-primary data-[popup-open]:text-text-brand-secondary\",\r\n triggerClassName,\r\n className\r\n )}\r\n >\r\n {icon && (\r\n <span\r\n className={cn(\r\n \"size-4 shrink-0\",\r\n hasValue ? \"text-fg-brand-primary\" : \"text-fg-quaternary\"\r\n )}\r\n >\r\n {icon}\r\n </span>\r\n )}\r\n <span className=\"truncate\">{triggerLabel}</span>\r\n <ChevronDownIcon\r\n className={cn(\r\n \"size-4 shrink-0 transition-transform group-data-[popup-open]:rotate-180\",\r\n hasValue ? \"text-fg-brand-primary\" : \"text-fg-quaternary\"\r\n )}\r\n />\r\n </ComboboxTrigger>\r\n\r\n <ComboboxPopup\r\n container={container}\r\n className={cn(\"w-72\", contentClassName)}\r\n align=\"start\"\r\n sideOffset={8}\r\n >\r\n {isMultiple ? (\r\n <div className=\"flex flex-col\">\r\n {/* Header: title + Clear (n) */}\r\n <div className=\"flex items-center justify-between px-3 py-2 border-b border-border-primary\">\r\n <span className=\"text-label-semibold-3 text-text-primary\">{placeholder}</span>\r\n <button\r\n type=\"button\"\r\n disabled={!hasValue}\r\n onClick={handleClear}\r\n className={cn(\r\n \"text-body-medium-3 transition-colors\",\r\n hasValue\r\n ? \"cursor-pointer text-text-brand-secondary hover:text-text-brand-secondary-hover\"\r\n : \"cursor-not-allowed text-text-disabled\"\r\n )}\r\n >\r\n Clear{hasValue ? ` (${valueArray.length})` : \"\"}\r\n </button>\r\n </div>\r\n\r\n {/* Search */}\r\n <ComboboxInput\r\n value={search}\r\n onChange={(e) => setSearch(e.target.value)}\r\n placeholder={`Search ${placeholder.toLowerCase()}...`}\r\n />\r\n\r\n {/* List */}\r\n <ComboboxStatus\r\n status={\r\n isPending || items === undefined\r\n ? \"pending\"\r\n : filteredItems?.length === 0\r\n ? \"empty\"\r\n : null\r\n }\r\n />\r\n <ComboboxList>\r\n {filteredItems?.map((item) => {\r\n const checked = valueArray.some((v) => v.value === item.value)\r\n return (\r\n <FilterItem key={item.value} value={item}>\r\n <MiniCheckbox checked={checked} />\r\n <span className=\"truncate\">{item.label}</span>\r\n </FilterItem>\r\n )\r\n })}\r\n <ComboboxInfiniteScroll {...infiniteScroll} />\r\n </ComboboxList>\r\n </div>\r\n ) : (\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 <FilterItem key={item.value} value={item} className=\"justify-between\">\r\n <span className=\"truncate\">{item.label}</span>\r\n <FilterItemIndicator>\r\n <CheckCircle2Icon className=\"size-5 shrink-0 text-fg-brand-primary\" />\r\n </FilterItemIndicator>\r\n </FilterItem>\r\n ))}\r\n <ComboboxInfiniteScroll {...infiniteScroll} />\r\n </ComboboxList>\r\n </>\r\n )}\r\n </ComboboxPopup>\r\n </Combobox>\r\n )\r\n}\r\n\r\nexport { FilterCombobox }\r\n"]}
@@ -0,0 +1,2 @@
1
+ import'react';import {Collapsible}from'@base-ui/react/collapsible';import {motion,AnimatePresence}from'motion/react';import {useControlledState}from'@xploreu/hooks/use-controlled-state';import {getStrictContext}from'@xploreu/lib/get-strict-context';import {jsx}from'react/jsx-runtime';var [d,m]=getStrictContext("CollapsibleContext");function f(e){let[o,a]=useControlledState({value:e?.open,defaultValue:e?.defaultOpen,onChange:e?.onOpenChange});return jsx(d,{value:{isOpen:o,setIsOpen:a},children:jsx(Collapsible.Root,{"data-slot":"collapsible",...e,onOpenChange:a})})}function h(e){return jsx(Collapsible.Trigger,{"data-slot":"collapsible-trigger",...e})}function k({transition:e={duration:.35,ease:"easeInOut"},hiddenUntilFound:o,keepRendered:a=false,...p}){let{isOpen:i}=m(),n=jsx(motion.div,{animate:i?{height:"auto",opacity:1,"--mask-stop":"100%",y:0}:{height:0,opacity:0,"--mask-stop":"0%",y:20},"data-slot":"collapsible-panel",exit:{height:0,opacity:0,"--mask-stop":"0%",y:20},initial:{height:0,opacity:0,"--mask-stop":"0%",y:20},style:{maskImage:"linear-gradient(black var(--mask-stop), transparent var(--mask-stop))",WebkitMaskImage:"linear-gradient(black var(--mask-stop), transparent var(--mask-stop))",overflow:"hidden"},transition:e,...p},"collapsible-panel");return jsx(AnimatePresence,{initial:false,children:a?jsx(Collapsible.Panel,{hidden:false,hiddenUntilFound:o,keepMounted:true,render:n}):i&&jsx(Collapsible.Panel,{hidden:false,hiddenUntilFound:o,keepMounted:true,render:n})})}export{m as a,f as b,h as c,k as d};//# sourceMappingURL=chunk-NKQ3MFRE.js.map
2
+ //# sourceMappingURL=chunk-NKQ3MFRE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/primitives/collapsible.tsx"],"names":["CollapsibleProvider","useCollapsible","getStrictContext","Collapsible","props","isOpen","setIsOpen","useControlledState","jsx","CollapsiblePrimitive","Coll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AAA,CAAS,CAAA,CAAG,aAAA,CAAe,IAAA,CAAM,CAAA,CAAG,EAAG,EAE1D,WAAA,CAAU,mBAAA,CACV,IAAA,CAAM,CAAE,MAAA,CAAQ,CAAA,CAAG,QAAS,CAAA,CAAG,aAAA,CAAe,IAAA,CAAM,CAAA,CAAG,EAAG,CAAA,CAC1D,QAAS,CAAE,MAAA,CAAQ,CAAA,CAAG,OAAA,CAAS,CAAA,CAAG,aAAA,CAAe,KAAM,CAAA,CAAG,EAAG,CAAA,CAC7D,KAAA,CAAO,CACL,SAAA,CACE,wEACF,eAAA,CACE,uEAAA,CACF,QAAA,CAAU,QACZ,CAAA,CACA,UAAA,CAAYO,EACX,GAAGR,CAAAA,CAAAA,CAjBA,mBAkBN,CAAA,CAGF,OACEI,GAAAA,CAACS,gBAAA,CAAgB,OAAA,CAAS,KAAA,CACvB,QAAA,CAAAH,CAAAA,CACCN,GAAAA,CAACC,YAAqB,KAAA,CAArB,CACC,MAAA,CAAQ,KAAA,CACR,gBAAA,CAAkBI,CAAAA,CAClB,YAAW,IAAA,CACX,MAAA,CAAQE,CAAAA,CACV,CAAA,CAEAV,CAAAA,EACEG,GAAAA,CAACC,YAAqB,KAAA,CAArB,CACC,MAAA,CAAQ,KAAA,CACR,gBAAA,CAAkBI,CAAAA,CAClB,YAAW,IAAA,CACX,MAAA,CAAQE,CAAAA,CACV,CAAA,CAGN,CAEJ","file":"chunk-NKQ3MFRE.js","sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\n\r\nimport { Collapsible as CollapsiblePrimitive } from \"@base-ui/react/collapsible\"\r\nimport { AnimatePresence, type HTMLMotionProps, motion } from \"motion/react\"\r\n\r\nimport { useControlledState } from \"@xploreu/hooks/use-controlled-state\"\r\nimport { getStrictContext } from \"@xploreu/lib/get-strict-context\"\r\n\r\ntype CollapsibleContextType = {\r\n isOpen: boolean;\r\n setIsOpen: CollapsibleProps[\"onOpenChange\"];\r\n}\r\n\r\nconst [CollapsibleProvider, useCollapsible] =\r\n getStrictContext<CollapsibleContextType>(\"CollapsibleContext\")\r\n\r\ntype CollapsibleProps = React.ComponentProps<typeof CollapsiblePrimitive.Root>\r\n\r\nfunction Collapsible(props: CollapsibleProps) {\r\n const [isOpen, setIsOpen] = useControlledState({\r\n value: props?.open,\r\n defaultValue: props?.defaultOpen,\r\n onChange: props?.onOpenChange,\r\n })\r\n\r\n return (\r\n <CollapsibleProvider value={{ isOpen, setIsOpen }}>\r\n <CollapsiblePrimitive.Root\r\n data-slot=\"collapsible\"\r\n {...props}\r\n onOpenChange={setIsOpen}\r\n />\r\n </CollapsibleProvider>\r\n )\r\n}\r\n\r\ntype CollapsibleTriggerProps = React.ComponentProps<\r\n typeof CollapsiblePrimitive.Trigger\r\n>\r\n\r\nfunction CollapsibleTrigger(props: CollapsibleTriggerProps) {\r\n return (\r\n <CollapsiblePrimitive.Trigger\r\n data-slot=\"collapsible-trigger\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype CollapsiblePanelProps = HTMLMotionProps<\"div\"> & {\r\n /** Whether to keep the panel mounted (hidden via animation only). Useful for SEO. */\r\n keepRendered?: boolean;\r\n /** Allows the browser's built-in page search to find and expand the panel contents. */\r\n hiddenUntilFound?: boolean;\r\n}\r\n\r\nfunction CollapsiblePanel({\r\n transition = { duration: 0.35, ease: \"easeInOut\" },\r\n hiddenUntilFound,\r\n keepRendered = false,\r\n ...props\r\n}: CollapsiblePanelProps) {\r\n const { isOpen } = useCollapsible()\r\n\r\n const panel = (\r\n <motion.div\r\n key=\"collapsible-panel\"\r\n animate={\r\n isOpen\r\n ? { height: \"auto\", opacity: 1, \"--mask-stop\": \"100%\", y: 0 }\r\n : { height: 0, opacity: 0, \"--mask-stop\": \"0%\", y: 20 }\r\n }\r\n data-slot=\"collapsible-panel\"\r\n exit={{ height: 0, opacity: 0, \"--mask-stop\": \"0%\", y: 20 }}\r\n initial={{ height: 0, opacity: 0, \"--mask-stop\": \"0%\", y: 20 }}\r\n style={{\r\n maskImage:\r\n \"linear-gradient(black var(--mask-stop), transparent var(--mask-stop))\",\r\n WebkitMaskImage:\r\n \"linear-gradient(black var(--mask-stop), transparent var(--mask-stop))\",\r\n overflow: \"hidden\",\r\n }}\r\n transition={transition}\r\n {...props}\r\n />\r\n )\r\n\r\n return (\r\n <AnimatePresence initial={false}>\r\n {keepRendered ? (\r\n <CollapsiblePrimitive.Panel\r\n hidden={false}\r\n hiddenUntilFound={hiddenUntilFound}\r\n keepMounted\r\n render={panel}\r\n />\r\n ) : (\r\n isOpen && (\r\n <CollapsiblePrimitive.Panel\r\n hidden={false}\r\n hiddenUntilFound={hiddenUntilFound}\r\n keepMounted\r\n render={panel}\r\n />\r\n )\r\n )}\r\n </AnimatePresence>\r\n )\r\n}\r\n\r\nexport {\r\n Collapsible,\r\n CollapsibleTrigger,\r\n CollapsiblePanel,\r\n useCollapsible,\r\n type CollapsibleProps,\r\n type CollapsibleTriggerProps,\r\n type CollapsiblePanelProps,\r\n type CollapsibleContextType,\r\n}\r\n"]}
@@ -0,0 +1,2 @@
1
+ import {b as b$1,c,g,d,f as f$1,j,k as k$1,e}from'./chunk-RBLL355H.js';import'react';import {cn}from'@xploreu/lib/cn';import {jsx,jsxs}from'react/jsx-runtime';function y(r){return jsx(b$1,{...r})}function v(r){return jsx(c,{...r})}function x(r){return jsx(g,{...r})}function n({className:r,...e$1}){return jsx(e,{className:cn("fixed inset-0 z-50 bg-black/50 backdrop-blur-sm",r),...e$1})}function f({className:r,children:e,...A}){return jsxs(d,{children:[jsx(n,{}),jsx(f$1,{className:cn("fixed left-[50%] top-[50%] z-50 grid w-[calc(100%-2rem)] max-w-md translate-x-[-50%] translate-y-[-50%] bg-bg-primary shadow-xp-lg rounded-xl overflow-hidden",r),...A,children:e})]})}function T({className:r,...e}){return jsx("div",{"data-slot":"alert-dialog-header",className:cn("relative px-4 py-3 flex flex-col bg-bg-primary has-[[data-slot=alert-dialog-icon]]:pl-16",r),...e})}function b({className:r,...e}){return jsx("div",{"data-slot":"alert-dialog-content",className:cn("px-4 py-4 max-h-[60vh] overflow-y-auto",r),...e})}function C({className:r,...e}){return jsx("div",{"data-slot":"alert-dialog-footer",className:cn("flex gap-2 items-center justify-end bg-bg-primary px-4 py-3",r),...e})}function _({className:r,...e}){return jsx(j,{className:cn("text-label-bold-2 text-text-primary",r),...e})}function h({className:r,...e}){return jsx(k$1,{className:cn("mt-0.5 text-body-regular-3 text-text-secondary",r),...e})}function k({className:r,...e}){return jsx("div",{"data-slot":"alert-dialog-icon",className:cn("absolute top-[13px] left-4 flex items-center justify-center rounded-lg bg-bg-primary p-2.5 [&_svg]:size-4 bg-bg-brand-solid text-fg-white shadow-[0px_1px_2px_-1px_var(--color-shadow-lg-01),0px_1px_3px_0px_var(--color-shadow-md-01),0px_0px_0px_4px_var(--color-focus-ring-secondary)]",r),...e})}export{y as a,v as b,x as c,f as d,T as e,b as f,C as g,_ as h,h as i,k as j};//# sourceMappingURL=chunk-NY57FUA3.js.map
2
+ //# sourceMappingURL=chunk-NY57FUA3.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ui/alert-dialog.tsx"],"names":["AlertDialog","props","jsx","AlertDialogTrigger","AlertDialogClose","AlertDialogBackdrop","className","cn","AlertDialogPopup","children","jsxs","AlertDialogPortal","AlertDialogHeader","AlertDialogContent","AlertDialogFooter","AlertDialogTitle","AlertDialogDescription","AlertDialogIcon"],"mappings":"+JAwBA,SAASA,CAAAA,CAAYC,CAAAA,CAAyB,CAC5C,OAAOC,GAAAA,CAACF,GAAAA,CAAA,CAAsB,GAAGC,CAAAA,CAAO,CAC1C,CAIA,SAASE,CAAAA,CAAmBF,CAAAA,CAAgC,CAC1D,OAAOC,GAAAA,CAACC,EAAA,CAA6B,GAAGF,CAAAA,CAAO,CACjD,CAIA,SAASG,CAAAA,CAAiBH,CAAAA,CAA8B,CACtD,OAAOC,GAAAA,CAACE,CAAAA,CAAA,CAA2B,GAAGH,EAAO,CAC/C,CAIA,SAASI,CAA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CAAAA,CACN,CAEJ,CAIA,SAASc,CAAAA,CAAiB,CAAE,SAAA,CAAAT,CAAAA,CAAW,GAAGL,CAAM,CAAA,CAA0B,CACxE,OACEC,GAAAA,CAACa,CAAAA,CAAA,CACC,SAAA,CAAWR,EAAAA,CAAG,qCAAA,CAAuCD,CAAS,CAAA,CAC7D,GAAGL,CAAAA,CACN,CAEJ,CAIA,SAASe,CAAAA,CAAuB,CAAE,SAAA,CAAAV,CAAAA,CAAW,GAAGL,CAAM,CAAA,CAAgC,CACpF,OACEC,GAAAA,CAACc,GAAAA,CAAA,CACC,SAAA,CAAWT,GAAG,gDAAA,CAAkDD,CAAS,CAAA,CACxE,GAAGL,CAAAA,CACN,CAEJ,CAIA,SAASgB,CAAAA,CAAgB,CAAE,SAAA,CAAAX,CAAAA,CAAW,GAAGL,CAAM,CAAA,CAAyB,CACtE,OACEC,GAAAA,CAAC,KAAA,CAAA,CACC,WAAA,CAAU,mBAAA,CACV,SAAA,CAAWK,EAAAA,CACT,2RAAA,CACAD,CACF,CAAA,CACC,GAAGL,CAAAA,CACN,CAEJ","file":"chunk-2TQHUVNP.js","sourcesContent":["import * as React from 'react';\r\n\r\nimport {\r\n AlertDialog as AlertDialogPrimitive,\r\n AlertDialogTrigger as AlertDialogTriggerPrimitive,\r\n AlertDialogPortal as AlertDialogPortalPrimitive,\r\n AlertDialogBackdrop as AlertDialogBackdropPrimitive,\r\n AlertDialogPopup as AlertDialogPopupPrimitive,\r\n AlertDialogClose as AlertDialogClosePrimitive,\r\n AlertDialogTitle as AlertDialogTitlePrimitive,\r\n AlertDialogDescription as AlertDialogDescriptionPrimitive,\r\n type AlertDialogProps as AlertDialogPrimitiveProps,\r\n type AlertDialogTriggerProps as AlertDialogTriggerPrimitiveProps,\r\n type AlertDialogPortalProps as AlertDialogPortalPrimitiveProps,\r\n type AlertDialogBackdropProps as AlertDialogBackdropPrimitiveProps,\r\n type AlertDialogPopupProps as AlertDialogPopupPrimitiveProps,\r\n type AlertDialogCloseProps as AlertDialogClosePrimitiveProps,\r\n type AlertDialogTitleProps as AlertDialogTitlePrimitiveProps,\r\n type AlertDialogDescriptionProps as AlertDialogDescriptionPrimitiveProps,\r\n} from '../primitives/alert-dialog';\r\nimport { cn } from '@xploreu/lib/cn';\r\n\r\ntype AlertDialogProps = AlertDialogPrimitiveProps;\r\n\r\nfunction AlertDialog(props: AlertDialogProps) {\r\n return <AlertDialogPrimitive {...props} />;\r\n}\r\n\r\ntype AlertDialogTriggerProps = AlertDialogTriggerPrimitiveProps;\r\n\r\nfunction AlertDialogTrigger(props: AlertDialogTriggerProps) {\r\n return <AlertDialogTriggerPrimitive {...props} />;\r\n}\r\n\r\ntype AlertDialogCloseProps = AlertDialogClosePrimitiveProps;\r\n\r\nfunction AlertDialogClose(props: AlertDialogCloseProps) {\r\n return <AlertDialogClosePrimitive {...props} />;\r\n}\r\n\r\ntype AlertDialogBackdropProps = AlertDialogBackdropPrimitiveProps;\r\n\r\nfunction AlertDialogBackdrop({ className, ...props }: AlertDialogBackdropProps) {\r\n return (\r\n <AlertDialogBackdropPrimitive\r\n className={cn('fixed inset-0 z-50 bg-black/50 backdrop-blur-sm', className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogPopupProps = AlertDialogPopupPrimitiveProps;\r\n\r\nfunction AlertDialogPopup({ className, children, ...props }: AlertDialogPopupProps) {\r\n return (\r\n <AlertDialogPortalPrimitive>\r\n <AlertDialogBackdrop />\r\n <AlertDialogPopupPrimitive\r\n className={cn(\r\n \"fixed left-[50%] top-[50%] z-50 grid w-[calc(100%-2rem)] max-w-md translate-x-[-50%] translate-y-[-50%] border border-border-primary bg-bg-primary shadow-xp-lg rounded-xp-card-base overflow-hidden\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n </AlertDialogPopupPrimitive>\r\n </AlertDialogPortalPrimitive>\r\n );\r\n}\r\n\r\ntype AlertDialogHeaderProps = React.HTMLAttributes<HTMLDivElement>;\r\n\r\nfunction AlertDialogHeader({ className, ...props }: AlertDialogHeaderProps) {\r\n return (\r\n <div\r\n data-slot=\"alert-dialog-header\"\r\n className={cn(\r\n \"relative px-4 py-3 flex flex-col bg-bg-primary has-[[data-slot=alert-dialog-icon]]:pl-16\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogContentProps = React.HTMLAttributes<HTMLDivElement>;\r\n\r\nfunction AlertDialogContent({ className, ...props }: AlertDialogContentProps) {\r\n return (\r\n <div\r\n data-slot=\"alert-dialog-content\"\r\n className={cn(\"px-4 py-4 max-h-[60vh] overflow-y-auto\", className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogFooterProps = React.HTMLAttributes<HTMLDivElement>;\r\n\r\nfunction AlertDialogFooter({ className, ...props }: AlertDialogFooterProps) {\r\n return (\r\n <div\r\n data-slot=\"alert-dialog-footer\"\r\n className={cn(\r\n \"flex gap-2 items-center justify-end bg-bg-primary px-4 py-3\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogTitleProps = AlertDialogTitlePrimitiveProps;\r\n\r\nfunction AlertDialogTitle({ className, ...props }: AlertDialogTitleProps) {\r\n return (\r\n <AlertDialogTitlePrimitive\r\n className={cn(\"text-label-bold-2 text-text-primary\", className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogDescriptionProps = AlertDialogDescriptionPrimitiveProps;\r\n\r\nfunction AlertDialogDescription({ className, ...props }: AlertDialogDescriptionProps) {\r\n return (\r\n <AlertDialogDescriptionPrimitive\r\n className={cn(\"mt-0.5 text-body-regular-3 text-text-secondary\", className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogIconProps = React.ComponentProps<\"div\">;\r\n\r\nfunction AlertDialogIcon({ className, ...props }: AlertDialogIconProps) {\r\n return (\r\n <div\r\n data-slot=\"alert-dialog-icon\"\r\n className={cn(\r\n \"absolute top-[13px] left-4 flex items-center justify-center rounded-lg bg-bg-primary p-2.5 [&_svg]:size-4 bg-bg-brand-solid text-fg-white shadow-[0px_1px_2px_-1px_var(--color-shadow-lg-01),0px_1px_3px_0px_var(--color-shadow-md-01),0px_0px_0px_4px_var(--color-focus-ring-secondary)]\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nexport {\r\n AlertDialog,\r\n AlertDialogTrigger,\r\n AlertDialogClose,\r\n AlertDialogPopup,\r\n AlertDialogHeader,\r\n AlertDialogContent,\r\n AlertDialogFooter,\r\n AlertDialogTitle,\r\n AlertDialogDescription,\r\n AlertDialogIcon,\r\n type AlertDialogProps,\r\n type AlertDialogTriggerProps,\r\n type AlertDialogCloseProps,\r\n type AlertDialogPopupProps,\r\n type AlertDialogHeaderProps,\r\n type AlertDialogContentProps,\r\n type AlertDialogFooterProps,\r\n type AlertDialogTitleProps,\r\n type AlertDialogDescriptionProps,\r\n};\r\n"]}
1
+ {"version":3,"sources":["../src/ui/alert-dialog.tsx"],"names":["AlertDialog","props","jsx","AlertDialogTrigger","AlertDialogClose","AlertDialogBackdrop","className","cn","AlertDialogPopup","children","jsxs","AlertDialogPortal","AlertDialogHeader","AlertDialogContent","AlertDialogFooter","AlertDialogTitle","AlertDialogDescription","AlertDialogIcon"],"mappings":"+JAwBA,SAASA,CAAAA,CAAYC,CAAAA,CAAyB,CAC5C,OAAOC,GAAAA,CAACF,GAAAA,CAAA,CAAsB,GAAGC,CAAAA,CAAO,CAC1C,CAIA,SAASE,CAAAA,CAAmBF,CAAAA,CAAgC,CAC1D,OAAOC,GAAAA,CAACC,EAAA,CAA6B,GAAGF,CAAAA,CAAO,CACjD,CAIA,SAASG,CAAAA,CAAiBH,CAAAA,CAA8B,CACtD,OAAOC,GAAAA,CAACE,CAAAA,CAAA,CAA2B,GAAGH,EAAO,CAC/C,CAIA,SAASI,CAAAA,CAAoB,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGL,GAAM,CAAA,CAA6B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AA,CAAW,GAAGL,CAAM,CAAA,CAA0B,CACxE,OACEC,GAAAA,CAACa,CAAAA,CAAA,CACC,SAAA,CAAWR,EAAAA,CAAG,qCAAA,CAAuCD,CAAS,CAAA,CAC7D,GAAGL,CAAAA,CACN,CAEJ,CAIA,SAASe,CAAAA,CAAuB,CAAE,SAAA,CAAAV,CAAAA,CAAW,GAAGL,CAAM,CAAA,CAAgC,CACpF,OACEC,GAAAA,CAACc,GAAAA,CAAA,CACC,SAAA,CAAWT,GAAG,gDAAA,CAAkDD,CAAS,CAAA,CACxE,GAAGL,CAAAA,CACN,CAEJ,CAIA,SAASgB,CAAAA,CAAgB,CAAE,SAAA,CAAAX,CAAAA,CAAW,GAAGL,CAAM,CAAA,CAAyB,CACtE,OACEC,GAAAA,CAAC,KAAA,CAAA,CACC,WAAA,CAAU,mBAAA,CACV,SAAA,CAAWK,EAAAA,CACT,2RAAA,CACAD,CACF,CAAA,CACC,GAAGL,CAAAA,CACN,CAEJ","file":"chunk-NY57FUA3.js","sourcesContent":["import * as React from 'react';\r\n\r\nimport {\r\n AlertDialog as AlertDialogPrimitive,\r\n AlertDialogTrigger as AlertDialogTriggerPrimitive,\r\n AlertDialogPortal as AlertDialogPortalPrimitive,\r\n AlertDialogBackdrop as AlertDialogBackdropPrimitive,\r\n AlertDialogPopup as AlertDialogPopupPrimitive,\r\n AlertDialogClose as AlertDialogClosePrimitive,\r\n AlertDialogTitle as AlertDialogTitlePrimitive,\r\n AlertDialogDescription as AlertDialogDescriptionPrimitive,\r\n type AlertDialogProps as AlertDialogPrimitiveProps,\r\n type AlertDialogTriggerProps as AlertDialogTriggerPrimitiveProps,\r\n type AlertDialogPortalProps as AlertDialogPortalPrimitiveProps,\r\n type AlertDialogBackdropProps as AlertDialogBackdropPrimitiveProps,\r\n type AlertDialogPopupProps as AlertDialogPopupPrimitiveProps,\r\n type AlertDialogCloseProps as AlertDialogClosePrimitiveProps,\r\n type AlertDialogTitleProps as AlertDialogTitlePrimitiveProps,\r\n type AlertDialogDescriptionProps as AlertDialogDescriptionPrimitiveProps,\r\n} from '../primitives/alert-dialog';\r\nimport { cn } from '@xploreu/lib/cn';\r\n\r\ntype AlertDialogProps = AlertDialogPrimitiveProps;\r\n\r\nfunction AlertDialog(props: AlertDialogProps) {\r\n return <AlertDialogPrimitive {...props} />;\r\n}\r\n\r\ntype AlertDialogTriggerProps = AlertDialogTriggerPrimitiveProps;\r\n\r\nfunction AlertDialogTrigger(props: AlertDialogTriggerProps) {\r\n return <AlertDialogTriggerPrimitive {...props} />;\r\n}\r\n\r\ntype AlertDialogCloseProps = AlertDialogClosePrimitiveProps;\r\n\r\nfunction AlertDialogClose(props: AlertDialogCloseProps) {\r\n return <AlertDialogClosePrimitive {...props} />;\r\n}\r\n\r\ntype AlertDialogBackdropProps = AlertDialogBackdropPrimitiveProps;\r\n\r\nfunction AlertDialogBackdrop({ className, ...props }: AlertDialogBackdropProps) {\r\n return (\r\n <AlertDialogBackdropPrimitive\r\n className={cn('fixed inset-0 z-50 bg-black/50 backdrop-blur-sm', className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogPopupProps = AlertDialogPopupPrimitiveProps;\r\n\r\nfunction AlertDialogPopup({ className, children, ...props }: AlertDialogPopupProps) {\r\n return (\r\n <AlertDialogPortalPrimitive>\r\n <AlertDialogBackdrop />\r\n <AlertDialogPopupPrimitive\r\n className={cn(\r\n \"fixed left-[50%] top-[50%] z-50 grid w-[calc(100%-2rem)] max-w-md translate-x-[-50%] translate-y-[-50%] bg-bg-primary shadow-xp-lg rounded-xl overflow-hidden\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n </AlertDialogPopupPrimitive>\r\n </AlertDialogPortalPrimitive>\r\n );\r\n}\r\n\r\ntype AlertDialogHeaderProps = React.HTMLAttributes<HTMLDivElement>;\r\n\r\nfunction AlertDialogHeader({ className, ...props }: AlertDialogHeaderProps) {\r\n return (\r\n <div\r\n data-slot=\"alert-dialog-header\"\r\n className={cn(\r\n \"relative px-4 py-3 flex flex-col bg-bg-primary has-[[data-slot=alert-dialog-icon]]:pl-16\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogContentProps = React.HTMLAttributes<HTMLDivElement>;\r\n\r\nfunction AlertDialogContent({ className, ...props }: AlertDialogContentProps) {\r\n return (\r\n <div\r\n data-slot=\"alert-dialog-content\"\r\n className={cn(\"px-4 py-4 max-h-[60vh] overflow-y-auto\", className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogFooterProps = React.HTMLAttributes<HTMLDivElement>;\r\n\r\nfunction AlertDialogFooter({ className, ...props }: AlertDialogFooterProps) {\r\n return (\r\n <div\r\n data-slot=\"alert-dialog-footer\"\r\n className={cn(\r\n \"flex gap-2 items-center justify-end bg-bg-primary px-4 py-3\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogTitleProps = AlertDialogTitlePrimitiveProps;\r\n\r\nfunction AlertDialogTitle({ className, ...props }: AlertDialogTitleProps) {\r\n return (\r\n <AlertDialogTitlePrimitive\r\n className={cn(\"text-label-bold-2 text-text-primary\", className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogDescriptionProps = AlertDialogDescriptionPrimitiveProps;\r\n\r\nfunction AlertDialogDescription({ className, ...props }: AlertDialogDescriptionProps) {\r\n return (\r\n <AlertDialogDescriptionPrimitive\r\n className={cn(\"mt-0.5 text-body-regular-3 text-text-secondary\", className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype AlertDialogIconProps = React.ComponentProps<\"div\">;\r\n\r\nfunction AlertDialogIcon({ className, ...props }: AlertDialogIconProps) {\r\n return (\r\n <div\r\n data-slot=\"alert-dialog-icon\"\r\n className={cn(\r\n \"absolute top-[13px] left-4 flex items-center justify-center rounded-lg bg-bg-primary p-2.5 [&_svg]:size-4 bg-bg-brand-solid text-fg-white shadow-[0px_1px_2px_-1px_var(--color-shadow-lg-01),0px_1px_3px_0px_var(--color-shadow-md-01),0px_0px_0px_4px_var(--color-focus-ring-secondary)]\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nexport {\r\n AlertDialog,\r\n AlertDialogTrigger,\r\n AlertDialogClose,\r\n AlertDialogPopup,\r\n AlertDialogHeader,\r\n AlertDialogContent,\r\n AlertDialogFooter,\r\n AlertDialogTitle,\r\n AlertDialogDescription,\r\n AlertDialogIcon,\r\n type AlertDialogProps,\r\n type AlertDialogTriggerProps,\r\n type AlertDialogCloseProps,\r\n type AlertDialogPopupProps,\r\n type AlertDialogHeaderProps,\r\n type AlertDialogContentProps,\r\n type AlertDialogFooterProps,\r\n type AlertDialogTitleProps,\r\n type AlertDialogDescriptionProps,\r\n};\r\n"]}
@@ -0,0 +1,2 @@
1
+ import {a,b,c,d,e}from'./chunk-P2DJG2OD.js';import {a as a$2}from'./chunk-XJTOYNCA.js';import {a as a$1}from'./chunk-UCCQUPMT.js';import {a as a$3}from'./chunk-5ETIHFSE.js';import'react';import {InfoIcon}from'lucide-react';import {cn}from'@xploreu/lib/cn';import {jsx,jsxs,Fragment}from'react/jsx-runtime';function A({className:t,...o}){return jsx("div",{className:"relative w-full overflow-x-auto","data-slot":"table-container",children:jsx("table",{className:cn("w-full caption-bottom text-body-regular-2",t),"data-slot":"table",...o})})}function _({className:t,...o}){return jsx("thead",{className:cn("bg-bg-secondary [&_tr]:border-b [&_tr]:border-border-primary",t),"data-slot":"table-header",...o})}function j({className:t,...o}){return jsx("tbody",{className:cn("[&_tr:last-child]:border-0",t),"data-slot":"table-body",...o})}function B({className:t,...o}){return jsx("tfoot",{className:cn("border-t border-border-primary bg-bg-secondary font-medium [&>tr]:last:border-b-0",t),"data-slot":"table-footer",...o})}function D({className:t,...o}){return jsx("tr",{className:cn("border-b border-border-secondary transition-colors hover:bg-bg-secondary data-[state=selected]:bg-bg-brand-primary/40",t),"data-slot":"table-row",...o})}function O({className:t,align:o,variant:c$1="string",tooltip:n,sortable:r,sortDirection:p,onSort:b$1,children:C,...R}){let s=o||(c$1==="number"?"end":"start"),i=!!(n||r),w=s==="end",m=n?jsxs(a,{children:[jsx(b,{render:jsx("button",{type:"button",className:"inline-flex items-center justify-center text-text-secondary hover:text-text-primary"}),children:jsx(InfoIcon,{className:"size-3.5"})}),jsx(c,{children:jsx(d,{side:"top",children:jsx(e,{children:n})})})]}):null,u=r?jsx("button",{type:"button",onClick:b$1,className:"inline-flex items-center text-text-secondary hover:text-text-primary focus:outline-none","aria-label":"Sort column",children:p==="asc"?jsx(a$1,{size:12}):p==="desc"?jsx(a$2,{size:12}):jsx(a$3,{size:12})}):null,d$1=jsx("span",{className:cn("truncate",r&&"cursor-pointer select-none"),onClick:r?b$1:void 0,children:C});return jsx("th",{className:cn("text-label-semibold-3 text-text-secondary h-10 px-4 py-3 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",!i&&s==="end"&&"text-right",!i&&s==="start"&&"text-left",!i&&s==="center"&&"text-center",t),"data-slot":"table-head",...R,children:i?jsx("div",{className:"flex w-full items-center justify-between gap-2",children:w?jsxs(Fragment,{children:[jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[m,u]}),jsx("div",{className:"flex items-center shrink-0 justify-end",children:d$1})]}):jsxs(Fragment,{children:[d$1,jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[m,u]})]})}):d$1})}function F({className:t,align:o,variant:c="string",...n}){let r=o||(c==="number"?"end":"start");return jsx("td",{className:cn("text-text-primary px-4 py-3 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",r==="end"&&"text-right",r==="start"&&"text-left",r==="center"&&"text-center",t),"data-slot":"table-cell",...n})}function q({className:t,...o}){return jsx("caption",{className:cn("text-text-secondary mt-4 text-body-regular-2",t),"data-slot":"table-caption",...o})}export{A as a,_ as b,j as c,B as d,D as e,O as f,F as g,q as h};//# sourceMappingURL=chunk-OF4LN45Z.js.map
2
+ //# sourceMappingURL=chunk-OF4LN45Z.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ui/table.tsx"],"names":["Table","className","props","jsx","cn","TableHeader","TableBody","TableFooter","TableRow","TableHead","align","variant","tooltip","sortable","sortDirection","onSort","children","effectiveAlign","hasControls","isEnd","tooltipElement","jsxs","Tooltip","TooltipTrigger","InfoIcon","TooltipPortal","TooltipPositioner","TooltipPopup","sortElement","sort_ascending_icon_default","sort_descending_icon_default","sort_default_icon_default","titleElement","Fragment","TableCell","TableCaption"],"mappings":"kTAaA,SAASA,CAAAA,CAAM,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGC,CAAM,EAAkC,CACrE,OACEC,IAAC,KAAA,CAAA,CACC,SAAA,CAAU,kCACV,WAAA,CAAU,iBAAA,CAEV,QAAA,CAAAA,GAAAA,CAAC,OAAA,CAAA,CACC,SAAA,CAAWC,GAAG,2CAAA,CAA6CH,CAAS,EACpE,WAAA,CAAU,OAAA,CACT,GAAGC,CAAAA,CACN,CAAA,CACF,CAEJ,CAEA,SAASG,CAAAA,CAAY,CAAE,SAAA,CAAAJ,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAkC,CAC3E,OACEC,GAAAA,CAAC,OAAA,CAAA,CACC,SAAA,CAAWC,EAAAA,CACT,8DAAA,CACAH,CACF,CAAA,CACA,WAAA,CAAU,eACT,GAAGC,CAAAA,CACN,CAEJ,CAEA,SAASI,CAAAA,CAAU,CAAE,SAAA,CAAAL,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAkC,CACzE,OACEC,GAAAA,CAAC,SACC,SAAA,CAAWC,EAAAA,CAAG,4BAAA,CAA8BH,CAAS,CAAA,CACrD,WAAA,CAAU,aACT,GAAGC,CAAAA,CACN,CAEJ,CAEA,SAASK,EAAY,CAAE,SAAA,CAAAN,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAkC,CAC3E,OACEC,GAAAA,CAAC,SACC,SAAA,CAAWC,EAAAA,CACT,oFACAH,C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A,CAAU,oCAAA,CACZ,UAAAD,CAAAA,CACAQ,CAAAA,CAAAA,CACH,GACF,CAAA,CAEJ,CAAA,CAEAI,GAAAA,CAEJ,CAEJ,CAOA,SAASE,EAAU,CACjB,SAAA,CAAAjC,EACA,KAAA,CAAAS,CAAAA,CACA,QAAAC,CAAAA,CAAU,QAAA,CACV,GAAGT,CACL,CAAA,CAAmB,CACjB,IAAMe,CAAAA,CAAiBP,CAAAA,GAAUC,IAAY,QAAA,CAAW,KAAA,CAAQ,SAEhE,OACER,GAAAA,CAAC,IAAA,CAAA,CACC,SAAA,CAAWC,EAAAA,CACT,0FAAA,CACAa,IAAmB,KAAA,EAAS,YAAA,CAC5BA,IAAmB,OAAA,EAAW,WAAA,CAC9BA,IAAmB,QAAA,EAAY,aAAA,CAC/BhB,CACF,CAAA,CACA,WAAA,CAAU,YAAA,CACT,GAAGC,CAAAA,CACN,CAEJ,CAEA,SAASiC,CAAAA,CAAa,CACpB,SAAA,CAAAlC,CAAAA,CACA,GAAGC,CACL,CAAA,CAAoC,CAClC,OACEC,GAAAA,CAAC,SAAA,CAAA,CACC,SAAA,CAAWC,EAAAA,CAAG,8CAAA,CAAgDH,CAAS,EACvE,WAAA,CAAU,eAAA,CACT,GAAGC,CAAAA,CACN,CAEJ","file":"chunk-OF4LN45Z.js","sourcesContent":["import * as React from \"react\"\r\nimport { InfoIcon } from \"lucide-react\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\nimport { SortAscendingIcon, SortDefaultIcon, SortDescendingIcon } from \"../icons\"\r\nimport {\r\n Tooltip,\r\n TooltipPopup,\r\n TooltipPortal,\r\n TooltipPositioner,\r\n TooltipTrigger,\r\n} from \"./tooltip\"\r\n\r\nfunction Table({ className, ...props }: React.ComponentProps<\"table\">) {\r\n return (\r\n <div\r\n className=\"relative w-full overflow-x-auto\"\r\n data-slot=\"table-container\"\r\n >\r\n <table\r\n className={cn(\"w-full caption-bottom text-body-regular-2\", className)}\r\n data-slot=\"table\"\r\n {...props}\r\n />\r\n </div>\r\n )\r\n}\r\n\r\nfunction TableHeader({ className, ...props }: React.ComponentProps<\"thead\">) {\r\n return (\r\n <thead\r\n className={cn(\r\n \"bg-bg-secondary [&_tr]:border-b [&_tr]:border-border-primary\",\r\n className\r\n )}\r\n data-slot=\"table-header\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\nfunction TableBody({ className, ...props }: React.ComponentProps<\"tbody\">) {\r\n return (\r\n <tbody\r\n className={cn(\"[&_tr:last-child]:border-0\", className)}\r\n data-slot=\"table-body\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\nfunction TableFooter({ className, ...props }: React.ComponentProps<\"tfoot\">) {\r\n return (\r\n <tfoot\r\n className={cn(\r\n \"border-t border-border-primary bg-bg-secondary font-medium [&>tr]:last:border-b-0\",\r\n className\r\n )}\r\n data-slot=\"table-footer\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\nfunction TableRow({ className, ...props }: React.ComponentProps<\"tr\">) {\r\n return (\r\n <tr\r\n className={cn(\r\n \"border-b border-border-secondary transition-colors hover:bg-bg-secondary data-[state=selected]:bg-bg-brand-primary/40\",\r\n className\r\n )}\r\n data-slot=\"table-row\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ninterface TableHeadProps extends Omit<React.ComponentProps<\"th\">, \"align\"> {\r\n align?: \"start\" | \"end\" | \"center\"\r\n variant?: \"string\" | \"number\"\r\n tooltip?: React.ReactNode\r\n sortable?: boolean\r\n sortDirection?: \"asc\" | \"desc\" | false | null\r\n onSort?: () => void\r\n}\r\n\r\nfunction TableHead({\r\n className,\r\n align,\r\n variant = \"string\",\r\n tooltip,\r\n sortable,\r\n sortDirection,\r\n onSort,\r\n children,\r\n ...props\r\n}: TableHeadProps) {\r\n const effectiveAlign = align || (variant === \"number\" ? \"end\" : \"start\")\r\n const hasControls = Boolean(tooltip || sortable)\r\n const isEnd = effectiveAlign === \"end\"\r\n\r\n const tooltipElement = tooltip ? (\r\n <Tooltip>\r\n <TooltipTrigger\r\n render={\r\n <button\r\n type=\"button\"\r\n className=\"inline-flex items-center justify-center text-text-secondary hover:text-text-primary\"\r\n />\r\n }\r\n >\r\n <InfoIcon className=\"size-3.5\" />\r\n </TooltipTrigger>\r\n <TooltipPortal>\r\n <TooltipPositioner side=\"top\">\r\n <TooltipPopup>{tooltip}</TooltipPopup>\r\n </TooltipPositioner>\r\n </TooltipPortal>\r\n </Tooltip>\r\n ) : null\r\n\r\n const sortElement = sortable ? (\r\n <button\r\n type=\"button\"\r\n onClick={onSort}\r\n className=\"inline-flex items-center text-text-secondary hover:text-text-primary focus:outline-none\"\r\n aria-label=\"Sort column\"\r\n >\r\n {sortDirection === \"asc\" ? (\r\n <SortAscendingIcon size={12} />\r\n ) : sortDirection === \"desc\" ? (\r\n <SortDescendingIcon size={12} />\r\n ) : (\r\n <SortDefaultIcon size={12} />\r\n )}\r\n </button>\r\n ) : null\r\n\r\n const titleElement = (\r\n <span\r\n className={cn(\"truncate\", sortable && \"cursor-pointer select-none\")}\r\n onClick={sortable ? onSort : undefined}\r\n >\r\n {children}\r\n </span>\r\n )\r\n\r\n return (\r\n <th\r\n className={cn(\r\n \"text-label-semibold-3 text-text-secondary h-10 px-4 py-3 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0\",\r\n !hasControls && effectiveAlign === \"end\" && \"text-right\",\r\n !hasControls && effectiveAlign === \"start\" && \"text-left\",\r\n !hasControls && effectiveAlign === \"center\" && \"text-center\",\r\n className\r\n )}\r\n data-slot=\"table-head\"\r\n {...props}\r\n >\r\n {hasControls ? (\r\n <div className=\"flex w-full items-center justify-between gap-2\">\r\n {isEnd ? (\r\n <>\r\n <div className=\"flex items-center gap-1.5 shrink-0\">\r\n {tooltipElement}\r\n {sortElement}\r\n </div>\r\n <div className=\"flex items-center shrink-0 justify-end\">\r\n {titleElement}\r\n </div>\r\n </>\r\n ) : (\r\n <>\r\n {titleElement}\r\n <div className=\"flex items-center gap-1.5 shrink-0\">\r\n {tooltipElement}\r\n {sortElement}\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n ) : (\r\n titleElement\r\n )}\r\n </th>\r\n )\r\n}\r\n\r\ninterface TableCellProps extends Omit<React.ComponentProps<\"td\">, \"align\"> {\r\n align?: \"start\" | \"end\" | \"center\"\r\n variant?: \"string\" | \"number\"\r\n}\r\n\r\nfunction TableCell({\r\n className,\r\n align,\r\n variant = \"string\",\r\n ...props\r\n}: TableCellProps) {\r\n const effectiveAlign = align || (variant === \"number\" ? \"end\" : \"start\")\r\n\r\n return (\r\n <td\r\n className={cn(\r\n \"text-text-primary px-4 py-3 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0\",\r\n effectiveAlign === \"end\" && \"text-right\",\r\n effectiveAlign === \"start\" && \"text-left\",\r\n effectiveAlign === \"center\" && \"text-center\",\r\n className\r\n )}\r\n data-slot=\"table-cell\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\nfunction TableCaption({\r\n className,\r\n ...props\r\n}: React.ComponentProps<\"caption\">) {\r\n return (\r\n <caption\r\n className={cn(\"text-text-secondary mt-4 text-body-regular-2\", className)}\r\n data-slot=\"table-caption\"\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\nexport {\r\n Table,\r\n TableBody,\r\n TableCaption,\r\n TableCell,\r\n TableFooter,\r\n TableHead,\r\n TableHeader,\r\n TableRow,\r\n type TableCellProps,\r\n type TableHeadProps,\r\n}"]}
@@ -0,0 +1,2 @@
1
+ import {a,b as b$1,c,d as d$1,e,f as f$1}from'./chunk-P6Y4P5QT.js';import'react';import {cn}from'@xploreu/lib/cn';import {jsx,jsxs}from'react/jsx-runtime';function d(o){return jsx(a,{...o})}function v(o){return jsx(b$1,{...o})}function x(o){return jsx(c,{...o})}function f({sideOffset:o=8,...t}){return jsx(d$1,{sideOffset:o,...t})}function b({className:o,children:t,withArrow:T=true,...a}){return jsxs(e,{className:cn("z-50 w-fit text-balance rounded-xp-tooltip bg-bg-primary-solid px-xp-lg py-xp-md text-body-regular-3 text-text-white",o),...a,children:[t,T&&jsx(f$1,{className:"z-50 size-2.5 rotate-45 rounded-xp-card-base-xxs bg-bg-primary-solid fill-primary data-[side=bottom]:-top-[5px] data-[side=top]:-bottom-[5px] data-[side=right]:-left-[5px] data-[side=left]:-right-[5px]"})]})}export{d as a,v as b,x as c,f as d,b as e};//# sourceMappingURL=chunk-P2DJG2OD.js.map
2
+ //# sourceMappingURL=chunk-P2DJG2OD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ui/tooltip.tsx"],"names":["Tooltip","props","jsx","TooltipTrigger","TooltipPortal","TooltipPositioner","sideOffset","TooltipPopup","className","children","withArrow","jsxs","cn","TooltipArrow"],"mappings":"2JAoBA,SAASA,EAAQC,CAAAA,CAAqB,CACpC,OAAOC,GAAAA,CAACF,CAAAA,CAAA,CAAkB,GAAGC,CAAAA,CAAO,CACtC,CAIA,SAASE,CAAAA,CAAeF,EAA4B,CAClD,OAAOC,IAACC,GAAAA,CAAA,CAAyB,GAAGF,CAAAA,CAAO,CAC7C,CAIA,SAASG,CAAAA,CAAcH,CAAAA,CAA2B,CAChD,OAAOC,GAAAA,CAACE,EAAA,CAAwB,GAAGH,EAAO,CAC5C,CAIA,SAASI,CAAAA,CAAkB,CAAE,UAAA,CAAAC,EAAa,CAAA,CAAG,GAAGL,CAAM,CAAA,CAA2B,CAC/E,OAAOC,GAAAA,CAACG,GAAAA,CAAA,CAA2B,UAAA,CAAYC,CAAAA,CAAa,GAAGL,EAAO,CACxE,CAMA,SAASM,CAAAA,CAAa,CACpB,UAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CAAY,IAAA,CACZ,GAAGT,CACL,CAAA,CAAsB,CACpB,OACEU,IAAAA,CAACJ,EAAA,CACC,SAAA,CAAWK,EAAAA,CACT,sHAAA,CACAJ,CACF,CAAA,CACC,GAAGP,CAAAA,CAEH,QAAA,CAAA,CAAAQ,EACAC,CAAAA,EACCR,GAAAA,CAACW,IAAA,CAAsB,SAAA,CAAU,2MAAA,CAA4M,CAAA,CAAA,CAEjP,CAEJ","file":"chunk-P2DJG2OD.js","sourcesContent":["import * as React from 'react';\r\n\r\nimport {\r\n Tooltip as TooltipPrimitive,\r\n TooltipTrigger as TooltipTriggerPrimitive,\r\n TooltipPortal as TooltipPortalPrimitive,\r\n TooltipPositioner as TooltipPositionerPrimitive,\r\n TooltipPopup as TooltipPopupPrimitive,\r\n TooltipArrow as TooltipArrowPrimitive,\r\n type TooltipProps as TooltipPrimitiveProps,\r\n type TooltipTriggerProps as TooltipTriggerPrimitiveProps,\r\n type TooltipPortalProps as TooltipPortalPrimitiveProps,\r\n type TooltipPositionerProps as TooltipPositionerPrimitiveProps,\r\n type TooltipPopupProps as TooltipPopupPrimitiveProps,\r\n type TooltipArrowProps as TooltipArrowPrimitiveProps,\r\n} from '../primitives/tooltip';\r\nimport { cn } from '@xploreu/lib/cn';\r\n\r\ntype TooltipProps = TooltipPrimitiveProps;\r\n\r\nfunction Tooltip(props: TooltipProps) {\r\n return <TooltipPrimitive {...props} />;\r\n}\r\n\r\ntype TooltipTriggerProps = TooltipTriggerPrimitiveProps;\r\n\r\nfunction TooltipTrigger(props: TooltipTriggerProps) {\r\n return <TooltipTriggerPrimitive {...props} />;\r\n}\r\n\r\ntype TooltipPortalProps = TooltipPortalPrimitiveProps;\r\n\r\nfunction TooltipPortal(props: TooltipPortalProps) {\r\n return <TooltipPortalPrimitive {...props} />;\r\n}\r\n\r\ntype TooltipPositionerProps = TooltipPositionerPrimitiveProps;\r\n\r\nfunction TooltipPositioner({ sideOffset = 8, ...props }: TooltipPositionerProps) {\r\n return <TooltipPositionerPrimitive sideOffset={sideOffset} {...props} />;\r\n}\r\n\r\ntype TooltipPopupProps = TooltipPopupPrimitiveProps & {\r\n withArrow?: boolean;\r\n};\r\n\r\nfunction TooltipPopup({\r\n className,\r\n children,\r\n withArrow = true,\r\n ...props\r\n}: TooltipPopupProps) {\r\n return (\r\n <TooltipPopupPrimitive\r\n className={cn(\r\n 'z-50 w-fit text-balance rounded-xp-tooltip bg-bg-primary-solid px-xp-lg py-xp-md text-body-regular-3 text-text-white',\r\n className\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n {withArrow && (\r\n <TooltipArrowPrimitive className=\"z-50 size-2.5 rotate-45 rounded-xp-card-base-xxs bg-bg-primary-solid fill-primary data-[side=bottom]:-top-[5px] data-[side=top]:-bottom-[5px] data-[side=right]:-left-[5px] data-[side=left]:-right-[5px]\" />\r\n )}\r\n </TooltipPopupPrimitive>\r\n );\r\n}\r\n\r\nexport {\r\n Tooltip,\r\n TooltipTrigger,\r\n TooltipPortal,\r\n TooltipPositioner,\r\n TooltipPopup,\r\n type TooltipProps,\r\n type TooltipTriggerProps,\r\n type TooltipPortalProps,\r\n type TooltipPositionerProps,\r\n type TooltipPopupProps,\r\n};\r\n"]}
@@ -1,2 +1,2 @@
1
- import'react';import {Tooltip}from'@base-ui/react/tooltip';import {AnimatePresence,motion}from'motion/react';import {useControlledState}from'@xploreu/hooks/use-controlled-state';import {getStrictContext}from'@xploreu/lib/get-strict-context';import {jsx}from'react/jsx-runtime';var[P,a]=getStrictContext("TooltipContext");function f(o){let[i,e]=useControlledState({value:o?.open,defaultValue:o?.defaultOpen,onChange:o?.onOpenChange});return jsx(P,{value:{open:i,setOpen:e},children:jsx(Tooltip.Root,{"data-slot":"tooltip",...o,onOpenChange:e})})}function g(o){return jsx(Tooltip.Trigger,{"data-slot":"tooltip-trigger",...o})}function d(o){let{open:i}=a();return jsx(AnimatePresence,{children:i&&jsx(Tooltip.Portal,{"data-slot":"tooltip-portal",keepMounted:true,...o})})}function C(o){return jsx(Tooltip.Positioner,{"data-slot":"tooltip-positioner",...o})}function v({transition:o={type:"spring",stiffness:300,damping:25},...i}){return jsx(Tooltip.Popup,{"data-slot":"tooltip-popup",render:jsx(motion.div,{animate:{opacity:1,scale:1},exit:{opacity:0,scale:.5},initial:{opacity:0,scale:.5},transition:o,...i},"tooltip-popup")})}function R(o){return jsx(Tooltip.Arrow,{"data-slot":"tooltip-arrow",...o})}export{f as a,g as b,d as c,C as d,v as e,R as f};//# sourceMappingURL=chunk-NTQ2FXS7.js.map
2
- //# sourceMappingURL=chunk-NTQ2FXS7.js.map
1
+ import'react';import {Tooltip}from'@base-ui/react/tooltip';import {AnimatePresence,motion}from'motion/react';import {useControlledState}from'@xploreu/hooks/use-controlled-state';import {getStrictContext}from'@xploreu/lib/get-strict-context';import {jsx}from'react/jsx-runtime';var[P,a]=getStrictContext("TooltipContext");function f(o){let[i,e]=useControlledState({value:o?.open,defaultValue:o?.defaultOpen,onChange:o?.onOpenChange});return jsx(P,{value:{open:i,setOpen:e},children:jsx(Tooltip.Root,{"data-slot":"tooltip",...o,onOpenChange:e})})}function g(o){return jsx(Tooltip.Trigger,{"data-slot":"tooltip-trigger",...o})}function d(o){let{open:i}=a();return jsx(AnimatePresence,{children:i&&jsx(Tooltip.Portal,{"data-slot":"tooltip-portal",keepMounted:true,...o})})}function C(o){return jsx(Tooltip.Positioner,{"data-slot":"tooltip-positioner",...o})}function v({transition:o={type:"spring",stiffness:300,damping:25},...i}){return jsx(Tooltip.Popup,{"data-slot":"tooltip-popup",render:jsx(motion.div,{animate:{opacity:1,scale:1},exit:{opacity:0,scale:.5},initial:{opacity:0,scale:.5},transition:o,...i},"tooltip-popup")})}function R(o){return jsx(Tooltip.Arrow,{"data-slot":"tooltip-arrow",...o})}export{f as a,g as b,d as c,C as d,v as e,R as f};//# sourceMappingURL=chunk-P6Y4P5QT.js.map
2
+ //# sourceMappingURL=chunk-P6Y4P5QT.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/primitives/tooltip.tsx"],"names":["TooltipProvider","useTooltip","getStrictContext","Tooltip","props","open","setOpen","useControlledState","jsx","TooltipPrimitive","TooltipTrigger","TooltipPortal","AnimatePresence","TooltipPositioner","TooltipPopup","transition","motion","TooltipArrow"],"mappings":"qRAcA,GAAM,CAACA,EA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AAG,CAAA,CAC3D,GAAGX,CACL,CAAA,CAAsB,CACpB,OACEI,GAAAA,CAACC,OAAAA,CAAiB,MAAjB,CACC,WAAA,CAAU,gBACV,MAAA,CACED,GAAAA,CAACQ,OAAO,GAAA,CAAP,CAEC,OAAA,CAAS,CAAE,OAAA,CAAS,CAAA,CAAG,MAAO,CAAE,CAAA,CAChC,KAAM,CAAE,OAAA,CAAS,EAAG,KAAA,CAAO,EAAI,CAAA,CAC/B,OAAA,CAAS,CAAE,OAAA,CAAS,EAAG,KAAA,CAAO,EAAI,EAClC,UAAA,CAAYD,CAAAA,CACX,GAAGX,CAAAA,CAAAA,CALA,eAMN,CAAA,CAEJ,CAEJ,CAIA,SAASa,EAAab,CAAAA,CAA0B,CAC9C,OAAOI,GAAAA,CAACC,OAAAA,CAAiB,KAAA,CAAjB,CAAuB,WAAA,CAAU,eAAA,CAAiB,GAAGL,CAAAA,CAAO,CACtE","file":"chunk-NTQ2FXS7.js","sourcesContent":["'use client';\r\n\r\nimport * as React from 'react';\r\nimport { Tooltip as TooltipPrimitive } from '@base-ui/react/tooltip';\r\nimport { AnimatePresence, motion, type HTMLMotionProps } from 'motion/react';\r\n\r\nimport { useControlledState } from '@xploreu/hooks/use-controlled-state';\r\nimport { getStrictContext } from '@xploreu/lib/get-strict-context';\r\n\r\ntype TooltipContextType = {\r\n open: boolean;\r\n setOpen: TooltipProps['onOpenChange'];\r\n};\r\n\r\nconst [TooltipProvider, useTooltip] =\r\n getStrictContext<TooltipContextType>('TooltipContext');\r\n\r\ntype TooltipProps = React.ComponentProps<typeof TooltipPrimitive.Root>;\r\n\r\nfunction Tooltip(props: TooltipProps) {\r\n const [open, setOpen] = useControlledState({\r\n value: props?.open,\r\n defaultValue: props?.defaultOpen,\r\n onChange: props?.onOpenChange,\r\n });\r\n\r\n return (\r\n <TooltipProvider value={{ open, setOpen }}>\r\n <TooltipPrimitive.Root\r\n data-slot=\"tooltip\"\r\n {...props}\r\n onOpenChange={setOpen}\r\n />\r\n </TooltipProvider>\r\n );\r\n}\r\n\r\ntype TooltipTriggerProps = React.ComponentProps<typeof TooltipPrimitive.Trigger>;\r\n\r\nfunction TooltipTrigger(props: TooltipTriggerProps) {\r\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />;\r\n}\r\n\r\ntype TooltipPortalProps = Omit<\r\n React.ComponentProps<typeof TooltipPrimitive.Portal>,\r\n 'keepMounted'\r\n>;\r\n\r\nfunction TooltipPortal(props: TooltipPortalProps) {\r\n const { open } = useTooltip();\r\n\r\n return (\r\n <AnimatePresence>\r\n {open && (\r\n <TooltipPrimitive.Portal\r\n data-slot=\"tooltip-portal\"\r\n keepMounted\r\n {...props}\r\n />\r\n )}\r\n </AnimatePresence>\r\n );\r\n}\r\n\r\ntype TooltipPositionerProps = React.ComponentProps<typeof TooltipPrimitive.Positioner>;\r\n\r\nfunction TooltipPositioner(props: TooltipPositionerProps) {\r\n return <TooltipPrimitive.Positioner data-slot=\"tooltip-positioner\" {...props} />;\r\n}\r\n\r\ntype TooltipPopupProps = Omit<\r\n React.ComponentProps<typeof TooltipPrimitive.Popup>,\r\n 'render'\r\n> &\r\n HTMLMotionProps<'div'>;\r\n\r\nfunction TooltipPopup({\r\n transition = { type: 'spring', stiffness: 300, damping: 25 },\r\n ...props\r\n}: TooltipPopupProps) {\r\n return (\r\n <TooltipPrimitive.Popup\r\n data-slot=\"tooltip-popup\"\r\n render={\r\n <motion.div\r\n key=\"tooltip-popup\"\r\n animate={{ opacity: 1, scale: 1 }}\r\n exit={{ opacity: 0, scale: 0.5 }}\r\n initial={{ opacity: 0, scale: 0.5 }}\r\n transition={transition}\r\n {...props}\r\n />\r\n }\r\n />\r\n );\r\n}\r\n\r\ntype TooltipArrowProps = React.ComponentProps<typeof TooltipPrimitive.Arrow>;\r\n\r\nfunction TooltipArrow(props: TooltipArrowProps) {\r\n return <TooltipPrimitive.Arrow data-slot=\"tooltip-arrow\" {...props} />;\r\n}\r\n\r\nexport {\r\n Tooltip,\r\n TooltipTrigger,\r\n TooltipPortal,\r\n TooltipPositioner,\r\n TooltipPopup,\r\n TooltipArrow,\r\n type TooltipProps,\r\n type TooltipTriggerProps,\r\n type TooltipPortalProps,\r\n type TooltipPositionerProps,\r\n type TooltipPopupProps,\r\n type TooltipArrowProps,\r\n};\r\n"]}
1
+ {"version":3,"sources":["../src/primitives/tooltip.tsx"],"names":["TooltipProvider","useTooltip","getStrictContext","Tooltip","props","open","setOpen","useControlledState","jsx","TooltipPrimitive","TooltipTrigger","TooltipPortal","AnimatePresence","TooltipPositioner","TooltipPopup","transition","motion","TooltipArrow"],"mappings":"qRAcA,GAAM,CAACA,EAAiBC,CAAU,CAAA,CAChCC,iBAAqC,gBAAgB,CAAA,CAIvD,SAASC,CAAAA,CAAQC,CAAAA,CAAqB,CACpC,GAAM,CAACC,CAAAA,CAAMC,CAAO,CAAA,CAAIC,kBAAAA,CAAmB,CACzC,KAAA,CAAOH,CAAAA,EAAO,IAAA,CACd,aAAcA,CAAAA,EAAO,WAAA,CACrB,QAAA,CAAUA,CAAAA,EAAO,YACnB,CAAC,EAED,OACEI,GAAAA,CAACR,EAAA,CAAgB,KAAA,CAAO,CAAE,IAAA,CAAAK,CAAAA,CAAM,OAAA,CAAAC,CAAQ,CAAA,CACtC,QAAA,CAAAE,IAACC,OAAAA,CAAiB,IAAA,CAAjB,CACC,WAAA,CAAU,SAAA,CACT,GAAGL,CAAAA,CACJ,YAAA,CAAcE,CAAAA,CAChB,CAAA,CACF,CAEJ,CAIA,SAASI,CAAAA,CAAeN,CAAAA,CAA4B,CAClD,OAAOI,GAAAA,CAACC,QAAiB,OAAA,CAAjB,CAAyB,WAAA,CAAU,iBAAA,CAAmB,GAAGL,CAAAA,CAAO,CAC1E,CAOA,SAASO,CAAAA,CAAcP,CAAAA,CAA2B,CAChD,GAAM,CAAE,IAAA,CAAAC,CAAK,CAAA,CAAIJ,CAAAA,EAAW,CAE5B,OACEO,IAACI,eAAAA,CAAA,CACE,SAAAP,CAAAA,EACCG,GAAAA,CAACC,QAAiB,MAAA,CAAjB,CACC,WAAA,CAAU,gBAAA,CACV,WAAA,CAAW,IAAA,CACV,GAAGL,CAAAA,CACN,CAAA,CAEJ,CAEJ,CAIA,SAASS,EAAkBT,CAAAA,CAA+B,CACxD,OAAOI,GAAAA,CAACC,OAAAA,CAAiB,UAAA,CAAjB,CAA4B,WAAA,CAAU,oBAAA,CAAsB,GAAGL,CAAAA,CAAO,CAChF,CAQA,SAASU,CAAAA,CAAa,CACpB,UAAA,CAAAC,CAAAA,CAAa,CAAE,KAAM,QAAA,CAAU,SAAA,CAAW,GAAA,CAAK,OAAA,CAAS,EAAG,CAAA,CAC3D,GAAGX,CACL,CAAA,CAAsB,CACpB,OACEI,GAAAA,CAACC,OAAAA,CAAiB,MAAjB,CACC,WAAA,CAAU,gBACV,MAAA,CACED,GAAAA,CAACQ,OAAO,GAAA,CAAP,CAEC,OAAA,CAAS,CAAE,OAAA,CAAS,CAAA,CAAG,MAAO,CAAE,CAAA,CAChC,KAAM,CAAE,OAAA,CAAS,EAAG,KAAA,CAAO,EAAI,CAAA,CAC/B,OAAA,CAAS,CAAE,OAAA,CAAS,EAAG,KAAA,CAAO,EAAI,EAClC,UAAA,CAAYD,CAAAA,CACX,GAAGX,CAAAA,CAAAA,CALA,eAMN,CAAA,CAEJ,CAEJ,CAIA,SAASa,EAAab,CAAAA,CAA0B,CAC9C,OAAOI,GAAAA,CAACC,OAAAA,CAAiB,KAAA,CAAjB,CAAuB,WAAA,CAAU,eAAA,CAAiB,GAAGL,CAAAA,CAAO,CACtE","file":"chunk-P6Y4P5QT.js","sourcesContent":["'use client';\r\n\r\nimport * as React from 'react';\r\nimport { Tooltip as TooltipPrimitive } from '@base-ui/react/tooltip';\r\nimport { AnimatePresence, motion, type HTMLMotionProps } from 'motion/react';\r\n\r\nimport { useControlledState } from '@xploreu/hooks/use-controlled-state';\r\nimport { getStrictContext } from '@xploreu/lib/get-strict-context';\r\n\r\ntype TooltipContextType = {\r\n open: boolean;\r\n setOpen: TooltipProps['onOpenChange'];\r\n};\r\n\r\nconst [TooltipProvider, useTooltip] =\r\n getStrictContext<TooltipContextType>('TooltipContext');\r\n\r\ntype TooltipProps = React.ComponentProps<typeof TooltipPrimitive.Root>;\r\n\r\nfunction Tooltip(props: TooltipProps) {\r\n const [open, setOpen] = useControlledState({\r\n value: props?.open,\r\n defaultValue: props?.defaultOpen,\r\n onChange: props?.onOpenChange,\r\n });\r\n\r\n return (\r\n <TooltipProvider value={{ open, setOpen }}>\r\n <TooltipPrimitive.Root\r\n data-slot=\"tooltip\"\r\n {...props}\r\n onOpenChange={setOpen}\r\n />\r\n </TooltipProvider>\r\n );\r\n}\r\n\r\ntype TooltipTriggerProps = React.ComponentProps<typeof TooltipPrimitive.Trigger>;\r\n\r\nfunction TooltipTrigger(props: TooltipTriggerProps) {\r\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />;\r\n}\r\n\r\ntype TooltipPortalProps = Omit<\r\n React.ComponentProps<typeof TooltipPrimitive.Portal>,\r\n 'keepMounted'\r\n>;\r\n\r\nfunction TooltipPortal(props: TooltipPortalProps) {\r\n const { open } = useTooltip();\r\n\r\n return (\r\n <AnimatePresence>\r\n {open && (\r\n <TooltipPrimitive.Portal\r\n data-slot=\"tooltip-portal\"\r\n keepMounted\r\n {...props}\r\n />\r\n )}\r\n </AnimatePresence>\r\n );\r\n}\r\n\r\ntype TooltipPositionerProps = React.ComponentProps<typeof TooltipPrimitive.Positioner>;\r\n\r\nfunction TooltipPositioner(props: TooltipPositionerProps) {\r\n return <TooltipPrimitive.Positioner data-slot=\"tooltip-positioner\" {...props} />;\r\n}\r\n\r\ntype TooltipPopupProps = Omit<\r\n React.ComponentProps<typeof TooltipPrimitive.Popup>,\r\n 'render'\r\n> &\r\n HTMLMotionProps<'div'>;\r\n\r\nfunction TooltipPopup({\r\n transition = { type: 'spring', stiffness: 300, damping: 25 },\r\n ...props\r\n}: TooltipPopupProps) {\r\n return (\r\n <TooltipPrimitive.Popup\r\n data-slot=\"tooltip-popup\"\r\n render={\r\n <motion.div\r\n key=\"tooltip-popup\"\r\n animate={{ opacity: 1, scale: 1 }}\r\n exit={{ opacity: 0, scale: 0.5 }}\r\n initial={{ opacity: 0, scale: 0.5 }}\r\n transition={transition}\r\n {...props}\r\n />\r\n }\r\n />\r\n );\r\n}\r\n\r\ntype TooltipArrowProps = React.ComponentProps<typeof TooltipPrimitive.Arrow>;\r\n\r\nfunction TooltipArrow(props: TooltipArrowProps) {\r\n return <TooltipPrimitive.Arrow data-slot=\"tooltip-arrow\" {...props} />;\r\n}\r\n\r\nexport {\r\n Tooltip,\r\n TooltipTrigger,\r\n TooltipPortal,\r\n TooltipPositioner,\r\n TooltipPopup,\r\n TooltipArrow,\r\n type TooltipProps,\r\n type TooltipTriggerProps,\r\n type TooltipPortalProps,\r\n type TooltipPositionerProps,\r\n type TooltipPopupProps,\r\n type TooltipArrowProps,\r\n};\r\n"]}
@@ -1,2 +1,2 @@
1
- import {d as d$1,e,p,h,t as t$1,v,z}from'./chunk-746IQSMF.js';import {a}from'./chunk-JH6RZ3QH.js';import*as t from'react';import*as C from'react-phone-number-input';import Y from'react-phone-number-input/flags';import {cn}from'@xploreu/lib/cn';import'@base-ui/react/combobox';import {ChevronsUpDownIcon}from'lucide-react';import {jsx,jsxs}from'react/jsx-runtime';var R=({country:l,countryName:o})=>{let s=l?Y[l]:void 0;return jsx("span",{className:"flex h-4 w-6 shrink-0 overflow-hidden rounded-sm bg-fg-quaternary/20 [&_svg:not([class*='size-'])]:size-full",children:s&&jsx(s,{title:o})})},d=44,k=288,H=6;function D({disabled:l,value:o,options:s,onChange:i}){let[c,r]=t.useState(false),[b,g]=t.useState(""),[y,N]=t.useState(0),v$1=t.useRef(null),m=t.useMemo(()=>s.filter(e=>!!e.value),[s]),u=t.useMemo(()=>{let e=b.trim().toLowerCase();return e?m.filter(a=>{let f=C.getCountryCallingCode(a.value);return a.label.toLowerCase().includes(e)||a.value.toLowerCase().includes(e)||f.includes(e.replace(/^\+/,""))}):m},[b,m]),_=t.useMemo(()=>m.find(e=>e.value===o)??null,[m,o]);t.useEffect(()=>{N(0),v$1.current&&(v$1.current.scrollTop=0);},[b]);let z$1=Math.min(u.length*d,k),h$1=t.useMemo(()=>{let e=Math.floor(y/d),a=Math.max(0,e-H),f=Math.ceil(k/d),P=Math.min(u.length,e+f+H);return {startIndex:a,endIndex:P,items:u.slice(a,P)}},[u,y]),F=h$1.startIndex*d,U=Math.max(0,(u.length-h$1.endIndex)*d),q=t.useCallback(e=>{e?.value&&(i(e.value),g(""),r(false));},[i]);return jsxs(d$1,{behavior:"default",disabled:l,inputValue:b,items:u,open:c,value:_,virtualized:true,filter:null,isItemEqualToValue:(e,a)=>e.value===a.value,openOnInputClick:false,onValueChange:q,onInputValueChange:g,onOpenChange:e=>{r(e),e||g("");},children:[jsx(e,{render:jsxs("button",{type:"button",className:cn(a(),"h-11 w-18 shrink-0 justify-between gap-1 rounded-r-none border-r-0 px-3","hover:bg-bg-primary-hover focus-visible:z-10 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-brand","disabled:pointer-events-none disabled:opacity-50"),disabled:l,children:[jsxs("span",{className:"flex items-center gap-1.5 overflow-hidden",children:[jsx(R,{country:o,countryName:o}),o&&jsx("span",{className:"text-body-medium-3 text-text-primary",children:o})]}),jsx(ChevronsUpDownIcon,{className:"size-3.5 shrink-0 text-fg-quaternary"})]})}),jsxs(p,{className:"w-72",children:[jsx(h,{placeholder:"Search country...","aria-label":"Search country"}),jsx(t$1,{status:u.length===0?"empty":null}),jsx(v,{ref:v$1,className:"relative gap-0",style:{height:z$1},onScroll:e=>N(e.currentTarget.scrollTop),children:jsx("div",{className:"flex w-full shrink-0 flex-col",style:{paddingTop:F,paddingBottom:U},children:h$1.items.map((e,a)=>{let f=h$1.startIndex+a;return jsx(z,{index:f,value:e,children:jsxs("div",{className:"flex items-center gap-2 w-full min-w-0",children:[jsx(R,{country:e.value,countryName:e.label}),jsx("span",{className:"flex-1 text-sm truncate",children:e.label}),jsxs("span",{className:"text-sm text-text-tertiary shrink-0",children:["+",C.getCountryCallingCode(e.value)]})]})},e.value)})})})]})]})}var L=t.forwardRef(({className:l,onChange:o,...s},i)=>{let c=t.useCallback(r=>{r.currentTarget.value==="+"&&(r.currentTarget.value=""),o?.(r);},[o]);return jsx("input",{className:cn(a(),"h-11 flex-1 rounded-l-none text-body-regular-2",l),ref:i,type:"tel",onChange:c,...s})});L.displayName="InputComponent";var G=t.forwardRef(({className:l,onChange:o,value:s,...i},c)=>jsx(C.default,{ref:c,className:cn("flex w-full min-w-0 items-center",l),flagComponent:R,countrySelectComponent:D,inputComponent:L,smartCaret:false,value:s||void 0,onChange:r=>o?.(r||""),...i}));G.displayName="PhoneInput";export{G as a};//# sourceMappingURL=chunk-VE5ZAJ35.js.map
2
- //# sourceMappingURL=chunk-VE5ZAJ35.js.map
1
+ import {d as d$1,e,p,h,t as t$1,v,z}from'./chunk-YB5ZNOPP.js';import {a}from'./chunk-JH6RZ3QH.js';import*as t from'react';import*as C from'react-phone-number-input';import Y from'react-phone-number-input/flags';import {cn}from'@xploreu/lib/cn';import'@base-ui/react/combobox';import {ChevronsUpDownIcon}from'lucide-react';import {jsx,jsxs}from'react/jsx-runtime';var R=({country:l,countryName:o})=>{let s=l?Y[l]:void 0;return jsx("span",{className:"flex h-4 w-6 shrink-0 overflow-hidden rounded-sm bg-fg-quaternary/20 [&_svg:not([class*='size-'])]:size-full",children:s&&jsx(s,{title:o})})},d=44,k=288,H=6;function D({disabled:l,value:o,options:s,onChange:i}){let[c,r]=t.useState(false),[b,g]=t.useState(""),[y,N]=t.useState(0),v$1=t.useRef(null),m=t.useMemo(()=>s.filter(e=>!!e.value),[s]),u=t.useMemo(()=>{let e=b.trim().toLowerCase();return e?m.filter(a=>{let f=C.getCountryCallingCode(a.value);return a.label.toLowerCase().includes(e)||a.value.toLowerCase().includes(e)||f.includes(e.replace(/^\+/,""))}):m},[b,m]),_=t.useMemo(()=>m.find(e=>e.value===o)??null,[m,o]);t.useEffect(()=>{N(0),v$1.current&&(v$1.current.scrollTop=0);},[b]);let z$1=Math.min(u.length*d,k),h$1=t.useMemo(()=>{let e=Math.floor(y/d),a=Math.max(0,e-H),f=Math.ceil(k/d),P=Math.min(u.length,e+f+H);return {startIndex:a,endIndex:P,items:u.slice(a,P)}},[u,y]),F=h$1.startIndex*d,U=Math.max(0,(u.length-h$1.endIndex)*d),q=t.useCallback(e=>{e?.value&&(i(e.value),g(""),r(false));},[i]);return jsxs(d$1,{behavior:"default",disabled:l,inputValue:b,items:u,open:c,value:_,virtualized:true,filter:null,isItemEqualToValue:(e,a)=>e.value===a.value,openOnInputClick:false,onValueChange:q,onInputValueChange:g,onOpenChange:e=>{r(e),e||g("");},children:[jsx(e,{render:jsxs("button",{type:"button",className:cn(a(),"h-11 w-18 shrink-0 justify-between gap-1 rounded-r-none border-r-0 px-3","hover:bg-bg-primary-hover focus-visible:z-10 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-brand","disabled:pointer-events-none disabled:opacity-50"),disabled:l,children:[jsxs("span",{className:"flex items-center gap-1.5 overflow-hidden",children:[jsx(R,{country:o,countryName:o}),o&&jsx("span",{className:"text-body-medium-3 text-text-primary",children:o})]}),jsx(ChevronsUpDownIcon,{className:"size-3.5 shrink-0 text-fg-quaternary"})]})}),jsxs(p,{className:"w-72",children:[jsx(h,{placeholder:"Search country...","aria-label":"Search country"}),jsx(t$1,{status:u.length===0?"empty":null}),jsx(v,{ref:v$1,className:"relative gap-0",style:{height:z$1},onScroll:e=>N(e.currentTarget.scrollTop),children:jsx("div",{className:"flex w-full shrink-0 flex-col",style:{paddingTop:F,paddingBottom:U},children:h$1.items.map((e,a)=>{let f=h$1.startIndex+a;return jsx(z,{index:f,value:e,children:jsxs("div",{className:"flex items-center gap-2 w-full min-w-0",children:[jsx(R,{country:e.value,countryName:e.label}),jsx("span",{className:"flex-1 text-sm truncate",children:e.label}),jsxs("span",{className:"text-sm text-text-tertiary shrink-0",children:["+",C.getCountryCallingCode(e.value)]})]})},e.value)})})})]})]})}var L=t.forwardRef(({className:l,onChange:o,...s},i)=>{let c=t.useCallback(r=>{r.currentTarget.value==="+"&&(r.currentTarget.value=""),o?.(r);},[o]);return jsx("input",{className:cn(a(),"h-11 flex-1 rounded-l-none text-body-regular-2",l),ref:i,type:"tel",onChange:c,...s})});L.displayName="InputComponent";var G=t.forwardRef(({className:l,onChange:o,value:s,...i},c)=>jsx(C.default,{ref:c,className:cn("flex w-full min-w-0 items-center",l),flagComponent:R,countrySelectComponent:D,inputComponent:L,smartCaret:false,value:s||void 0,onChange:r=>o?.(r||""),...i}));G.displayName="PhoneInput";export{G as a};//# sourceMappingURL=chunk-QV2OO65X.js.map
2
+ //# sourceMappingURL=chunk-QV2OO65X.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/composites/phone-input.tsx"],"names":["FlagComponent","country","countryName","Flag","flags","jsx","COUNTRY_ROW_HEIGHT","COUNTRY_LIST_HEIGHT","COUNTRY_OVERSCAN","CountrySelect","disabled","selectedCountry","countryList","onChange","open","setOpen","inputValue","setInputValue","scrollTop","setScrollTop","listRef","items","item","filteredItems","search","callingCode","value","listHeight","virtualRange","visibleStartIndex","startIndex","visibleCount","endIndex","paddingTop","paddingBottom","handleValueChange","jsxs","Combobox","a","b","ComboboxTrigger","cn","inputVariants","ChevronsUpDownIcon","ComboboxPopup","ComboboxInput","ComboboxStatus","ComboboxList","event","virtualIndex","index","ComboboxItem","InputComponent","className","props","ref","handleChange","PhoneInput"],"mappings":"2WAoCA,IAAMA,EAAgB,CAAC,CAAE,OAAA,CAAAC,CAAAA,CAAS,YAAAC,CAAY,CAAA,GAA0B,CACtE,IAAMC,EAAOF,CAAAA,CAAUG,CAAAA,CAAMH,CAAO,CAAA,CAAI,MAAA,CAExC,OACEI,GAAAA,CAAC,MAAA,CAAA,CAAK,UAAU,8GAAA,CACb,QAAA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A,CAAAA,EAAUb,CAAAA,GAAWa,CAAAA,EAAU,EAAqB,EAC9D,GAAG4B,CAAAA,CACN,CAEH,EACHG,EAAW,WAAA,CAAc,YAAA","file":"chunk-VE5ZAJ35.js","sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\nimport * as RPNInput from \"react-phone-number-input\"\r\nimport flags from \"react-phone-number-input/flags\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\nimport { Combobox as ComboboxPrimitive } from \"@base-ui/react/combobox\"\r\nimport {\r\n Combobox,\r\n ComboboxInput,\r\n ComboboxItem,\r\n ComboboxList,\r\n ComboboxPopup,\r\n ComboboxStatus,\r\n ComboboxTrigger,\r\n} from \"../ui/combobox\"\r\nimport { inputVariants } from \"../ui/input\"\r\nimport { ChevronsUpDownIcon } from \"lucide-react\"\r\n\r\n// ---------------------------------------------------------------------------\r\n// Types\r\n// ---------------------------------------------------------------------------\r\n\r\ntype PhoneInputProps = Omit<\r\n React.ComponentProps<\"input\">,\r\n \"onChange\" | \"value\" | \"ref\"\r\n> &\r\n Omit<RPNInput.Props<typeof RPNInput.default>, \"onChange\"> & {\r\n onChange?: (value: RPNInput.Value) => void\r\n }\r\n\r\n// ---------------------------------------------------------------------------\r\n// Flag\r\n// ---------------------------------------------------------------------------\r\n\r\nconst FlagComponent = ({ country, countryName }: RPNInput.FlagProps) => {\r\n const Flag = country ? flags[country] : undefined\r\n\r\n return (\r\n <span className=\"flex h-4 w-6 shrink-0 overflow-hidden rounded-sm bg-fg-quaternary/20 [&_svg:not([class*='size-'])]:size-full\">\r\n {Flag && <Flag title={countryName} />}\r\n </span>\r\n )\r\n}\r\n\r\n// ---------------------------------------------------------------------------\r\n// Country Select — uses base-ui Combobox\r\n// ---------------------------------------------------------------------------\r\n\r\ntype CountryEntry = { label: string; value: RPNInput.Country | undefined }\r\ntype CountryItem = { label: string; value: RPNInput.Country }\r\n\r\nconst COUNTRY_ROW_HEIGHT = 44\r\nconst COUNTRY_LIST_HEIGHT = 288\r\nconst COUNTRY_OVERSCAN = 6\r\n\r\ntype CountrySelectProps = {\r\n disabled?: boolean\r\n value: RPNInput.Country\r\n options: CountryEntry[]\r\n onChange: (country: RPNInput.Country) => void\r\n}\r\n\r\nfunction CountrySelect({\r\n disabled,\r\n value: selectedCountry,\r\n options: countryList,\r\n onChange,\r\n}: CountrySelectProps) {\r\n const [open, setOpen] = React.useState(false)\r\n const [inputValue, setInputValue] = React.useState(\"\")\r\n const [scrollTop, setScrollTop] = React.useState(0)\r\n const listRef = React.useRef<HTMLDivElement>(null)\r\n\r\n const items = React.useMemo(\r\n () => countryList.filter((item): item is CountryItem => Boolean(item.value)),\r\n [countryList]\r\n )\r\n\r\n const filteredItems = React.useMemo(() => {\r\n const search = inputValue.trim().toLowerCase()\r\n\r\n if (!search) return items\r\n\r\n return items.filter((item) => {\r\n const callingCode = RPNInput.getCountryCallingCode(item.value)\r\n\r\n return item.label.toLowerCase().includes(search)\r\n || item.value.toLowerCase().includes(search)\r\n || callingCode.includes(search.replace(/^\\+/, \"\"))\r\n })\r\n }, [inputValue, items])\r\n\r\n const value = React.useMemo(\r\n () => items.find((item) => item.value === selectedCountry) ?? null,\r\n [items, selectedCountry]\r\n )\r\n\r\n React.useEffect(() => {\r\n setScrollTop(0)\r\n if (listRef.current) listRef.current.scrollTop = 0\r\n }, [inputValue])\r\n\r\n const listHeight = Math.min(\r\n filteredItems.length * COUNTRY_ROW_HEIGHT,\r\n COUNTRY_LIST_HEIGHT\r\n )\r\n\r\n const virtualRange = React.useMemo(() => {\r\n const visibleStartIndex = Math.floor(scrollTop / COUNTRY_ROW_HEIGHT)\r\n const startIndex = Math.max(\r\n 0,\r\n visibleStartIndex - COUNTRY_OVERSCAN\r\n )\r\n const visibleCount = Math.ceil(COUNTRY_LIST_HEIGHT / COUNTRY_ROW_HEIGHT)\r\n const endIndex = Math.min(\r\n filteredItems.length,\r\n visibleStartIndex + visibleCount + COUNTRY_OVERSCAN\r\n )\r\n\r\n return {\r\n startIndex,\r\n endIndex,\r\n items: filteredItems.slice(startIndex, endIndex),\r\n }\r\n }, [filteredItems, scrollTop])\r\n\r\n const paddingTop = virtualRange.startIndex * COUNTRY_ROW_HEIGHT\r\n const paddingBottom = Math.max(\r\n 0,\r\n (filteredItems.length - virtualRange.endIndex) * COUNTRY_ROW_HEIGHT\r\n )\r\n\r\n const handleValueChange = React.useCallback(\r\n (item: CountryItem | null) => {\r\n if (!item?.value) return\r\n\r\n onChange(item.value)\r\n setInputValue(\"\")\r\n setOpen(false)\r\n },\r\n [onChange]\r\n )\r\n\r\n return (\r\n <Combobox\r\n behavior=\"default\"\r\n disabled={disabled}\r\n inputValue={inputValue}\r\n items={filteredItems}\r\n open={open}\r\n value={value}\r\n virtualized\r\n filter={null}\r\n isItemEqualToValue={(a, b) => a.value === b.value}\r\n openOnInputClick={false}\r\n onValueChange={handleValueChange}\r\n onInputValueChange={setInputValue}\r\n onOpenChange={(open) => {\r\n setOpen(open)\r\n if (!open) setInputValue(\"\")\r\n }}\r\n >\r\n {/* Visible trigger button styled as part of the input */}\r\n <ComboboxTrigger\r\n render={\r\n <button\r\n type=\"button\"\r\n className={cn(\r\n inputVariants(),\r\n \"h-11 w-18 shrink-0 justify-between gap-1 rounded-r-none border-r-0 px-3\",\r\n \"hover:bg-bg-primary-hover focus-visible:z-10 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-brand\",\r\n \"disabled:pointer-events-none disabled:opacity-50\"\r\n )}\r\n disabled={disabled}\r\n >\r\n <span className=\"flex items-center gap-1.5 overflow-hidden\">\r\n <FlagComponent\r\n country={selectedCountry}\r\n countryName={selectedCountry}\r\n />\r\n {selectedCountry && (\r\n <span className=\"text-body-medium-3 text-text-primary\">\r\n {selectedCountry}\r\n </span>\r\n )}\r\n </span>\r\n <ChevronsUpDownIcon className=\"size-3.5 shrink-0 text-fg-quaternary\" />\r\n </button>\r\n }\r\n />\r\n\r\n {/* Dropdown content */}\r\n <ComboboxPopup className=\"w-72\">\r\n <ComboboxInput\r\n placeholder=\"Search country...\"\r\n aria-label=\"Search country\"\r\n />\r\n <ComboboxStatus status={filteredItems.length === 0 ? \"empty\" : null} />\r\n <ComboboxList\r\n ref={listRef}\r\n className=\"relative gap-0\"\r\n style={{ height: listHeight }}\r\n onScroll={(event) => setScrollTop(event.currentTarget.scrollTop)}\r\n >\r\n <div\r\n className=\"flex w-full shrink-0 flex-col\"\r\n style={{ paddingTop, paddingBottom }}\r\n >\r\n {virtualRange.items.map((item, virtualIndex) => {\r\n const index = virtualRange.startIndex + virtualIndex\r\n\r\n return (\r\n <ComboboxItem\r\n key={item.value}\r\n index={index}\r\n value={item}\r\n >\r\n <div className=\"flex items-center gap-2 w-full min-w-0\">\r\n <FlagComponent country={item.value} countryName={item.label} />\r\n <span className=\"flex-1 text-sm truncate\">{item.label}</span>\r\n <span className=\"text-sm text-text-tertiary shrink-0\">\r\n +{RPNInput.getCountryCallingCode(item.value)}\r\n </span>\r\n </div>\r\n </ComboboxItem>\r\n )\r\n })}\r\n </div>\r\n </ComboboxList>\r\n </ComboboxPopup>\r\n </Combobox >\r\n )\r\n}\r\n\r\n// ---------------------------------------------------------------------------\r\n// Input Component\r\n// ---------------------------------------------------------------------------\r\n\r\nconst InputComponent = React.forwardRef<\r\n HTMLInputElement,\r\n React.ComponentProps<\"input\">\r\n>(({ className, onChange, ...props }, ref) => {\r\n const handleChange = React.useCallback(\r\n (event: React.ChangeEvent<HTMLInputElement>) => {\r\n if (event.currentTarget.value === \"+\") {\r\n event.currentTarget.value = \"\"\r\n }\r\n\r\n onChange?.(event)\r\n },\r\n [onChange]\r\n )\r\n\r\n return (\r\n <input\r\n className={cn(\r\n inputVariants(),\r\n \"h-11 flex-1 rounded-l-none text-body-regular-2\",\r\n className\r\n )}\r\n ref={ref}\r\n type=\"tel\"\r\n onChange={handleChange}\r\n {...props}\r\n />\r\n )\r\n})\r\nInputComponent.displayName = \"InputComponent\"\r\n\r\n// ---------------------------------------------------------------------------\r\n// Phone Input\r\n// ---------------------------------------------------------------------------\r\n\r\nconst PhoneInput: React.ForwardRefExoticComponent<PhoneInputProps> =\r\n React.forwardRef<\r\n React.ElementRef<typeof RPNInput.default>,\r\n PhoneInputProps\r\n >(({\r\n className,\r\n onChange,\r\n value,\r\n ...props\r\n }, ref) => {\r\n return (\r\n <RPNInput.default\r\n ref={ref}\r\n className={cn(\r\n \"flex w-full min-w-0 items-center\",\r\n className\r\n )}\r\n flagComponent={FlagComponent}\r\n countrySelectComponent={CountrySelect}\r\n inputComponent={InputComponent}\r\n smartCaret={false}\r\n value={value || undefined}\r\n onChange={(value) => onChange?.(value || (\"\" as RPNInput.Value))}\r\n {...props}\r\n />\r\n )\r\n })\r\nPhoneInput.displayName = \"PhoneInput\"\r\n\r\nexport { PhoneInput, type PhoneInputProps }\r\n"]}
1
+ {"version":3,"sources":["../src/composites/phone-input.tsx"],"names":["FlagComponent","country","countryName","Flag","flags","jsx","COUNTRY_ROW_HEIGHT","COUNTRY_LIST_HEIGHT","COUNTRY_OVERSCAN","CountrySelect","disabled","selectedCountry","countryList","onChange","open","setOpen","inputValue","setInputValue","scrollTop","setScrollTop","listRef","items","item","filteredItems","search","callingCode","value","listHeight","virtualRange","visibleStartIndex","startIndex","visibleCount","endIndex","paddingTop","paddingBottom","handleValueChange","jsxs","Combobox","a","b","ComboboxTrigger","cn","inputVariants","ChevronsUpDownIcon","ComboboxPopup","ComboboxInput","ComboboxStatus","ComboboxList","event","virtualIndex","index","ComboboxItem","InputComponent","className","props","ref","handleChange","PhoneInput"],"mappings":"2WAoCA,IAAMA,EAAgB,CAAC,CAAE,OAAA,CAAAC,CAAAA,CAAS,YAAAC,CAAY,CAAA,GAA0B,CACtE,IAAMC,EAAOF,CAAAA,CAAUG,CAAAA,CAAMH,CAAO,CAAA,CAAI,MAAA,CAExC,OACEI,GAAAA,CAAC,MAAA,CAAA,CAAK,UAAU,8GAAA,CACb,QAAA,CAAAF,CAAAA,EAAQE,GAAAA,CAACF,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A,EAAU,EAAqB,EAC9D,GAAG4B,CAAAA,CACN,CAEH,EACHG,EAAW,WAAA,CAAc,YAAA","file":"chunk-QV2OO65X.js","sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\nimport * as RPNInput from \"react-phone-number-input\"\r\nimport flags from \"react-phone-number-input/flags\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\nimport { Combobox as ComboboxPrimitive } from \"@base-ui/react/combobox\"\r\nimport {\r\n Combobox,\r\n ComboboxInput,\r\n ComboboxItem,\r\n ComboboxList,\r\n ComboboxPopup,\r\n ComboboxStatus,\r\n ComboboxTrigger,\r\n} from \"../ui/combobox\"\r\nimport { inputVariants } from \"../ui/input\"\r\nimport { ChevronsUpDownIcon } from \"lucide-react\"\r\n\r\n// ---------------------------------------------------------------------------\r\n// Types\r\n// ---------------------------------------------------------------------------\r\n\r\ntype PhoneInputProps = Omit<\r\n React.ComponentProps<\"input\">,\r\n \"onChange\" | \"value\" | \"ref\"\r\n> &\r\n Omit<RPNInput.Props<typeof RPNInput.default>, \"onChange\"> & {\r\n onChange?: (value: RPNInput.Value) => void\r\n }\r\n\r\n// ---------------------------------------------------------------------------\r\n// Flag\r\n// ---------------------------------------------------------------------------\r\n\r\nconst FlagComponent = ({ country, countryName }: RPNInput.FlagProps) => {\r\n const Flag = country ? flags[country] : undefined\r\n\r\n return (\r\n <span className=\"flex h-4 w-6 shrink-0 overflow-hidden rounded-sm bg-fg-quaternary/20 [&_svg:not([class*='size-'])]:size-full\">\r\n {Flag && <Flag title={countryName} />}\r\n </span>\r\n )\r\n}\r\n\r\n// ---------------------------------------------------------------------------\r\n// Country Select — uses base-ui Combobox\r\n// ---------------------------------------------------------------------------\r\n\r\ntype CountryEntry = { label: string; value: RPNInput.Country | undefined }\r\ntype CountryItem = { label: string; value: RPNInput.Country }\r\n\r\nconst COUNTRY_ROW_HEIGHT = 44\r\nconst COUNTRY_LIST_HEIGHT = 288\r\nconst COUNTRY_OVERSCAN = 6\r\n\r\ntype CountrySelectProps = {\r\n disabled?: boolean\r\n value: RPNInput.Country\r\n options: CountryEntry[]\r\n onChange: (country: RPNInput.Country) => void\r\n}\r\n\r\nfunction CountrySelect({\r\n disabled,\r\n value: selectedCountry,\r\n options: countryList,\r\n onChange,\r\n}: CountrySelectProps) {\r\n const [open, setOpen] = React.useState(false)\r\n const [inputValue, setInputValue] = React.useState(\"\")\r\n const [scrollTop, setScrollTop] = React.useState(0)\r\n const listRef = React.useRef<HTMLDivElement>(null)\r\n\r\n const items = React.useMemo(\r\n () => countryList.filter((item): item is CountryItem => Boolean(item.value)),\r\n [countryList]\r\n )\r\n\r\n const filteredItems = React.useMemo(() => {\r\n const search = inputValue.trim().toLowerCase()\r\n\r\n if (!search) return items\r\n\r\n return items.filter((item) => {\r\n const callingCode = RPNInput.getCountryCallingCode(item.value)\r\n\r\n return item.label.toLowerCase().includes(search)\r\n || item.value.toLowerCase().includes(search)\r\n || callingCode.includes(search.replace(/^\\+/, \"\"))\r\n })\r\n }, [inputValue, items])\r\n\r\n const value = React.useMemo(\r\n () => items.find((item) => item.value === selectedCountry) ?? null,\r\n [items, selectedCountry]\r\n )\r\n\r\n React.useEffect(() => {\r\n setScrollTop(0)\r\n if (listRef.current) listRef.current.scrollTop = 0\r\n }, [inputValue])\r\n\r\n const listHeight = Math.min(\r\n filteredItems.length * COUNTRY_ROW_HEIGHT,\r\n COUNTRY_LIST_HEIGHT\r\n )\r\n\r\n const virtualRange = React.useMemo(() => {\r\n const visibleStartIndex = Math.floor(scrollTop / COUNTRY_ROW_HEIGHT)\r\n const startIndex = Math.max(\r\n 0,\r\n visibleStartIndex - COUNTRY_OVERSCAN\r\n )\r\n const visibleCount = Math.ceil(COUNTRY_LIST_HEIGHT / COUNTRY_ROW_HEIGHT)\r\n const endIndex = Math.min(\r\n filteredItems.length,\r\n visibleStartIndex + visibleCount + COUNTRY_OVERSCAN\r\n )\r\n\r\n return {\r\n startIndex,\r\n endIndex,\r\n items: filteredItems.slice(startIndex, endIndex),\r\n }\r\n }, [filteredItems, scrollTop])\r\n\r\n const paddingTop = virtualRange.startIndex * COUNTRY_ROW_HEIGHT\r\n const paddingBottom = Math.max(\r\n 0,\r\n (filteredItems.length - virtualRange.endIndex) * COUNTRY_ROW_HEIGHT\r\n )\r\n\r\n const handleValueChange = React.useCallback(\r\n (item: CountryItem | null) => {\r\n if (!item?.value) return\r\n\r\n onChange(item.value)\r\n setInputValue(\"\")\r\n setOpen(false)\r\n },\r\n [onChange]\r\n )\r\n\r\n return (\r\n <Combobox\r\n behavior=\"default\"\r\n disabled={disabled}\r\n inputValue={inputValue}\r\n items={filteredItems}\r\n open={open}\r\n value={value}\r\n virtualized\r\n filter={null}\r\n isItemEqualToValue={(a, b) => a.value === b.value}\r\n openOnInputClick={false}\r\n onValueChange={handleValueChange}\r\n onInputValueChange={setInputValue}\r\n onOpenChange={(open) => {\r\n setOpen(open)\r\n if (!open) setInputValue(\"\")\r\n }}\r\n >\r\n {/* Visible trigger button styled as part of the input */}\r\n <ComboboxTrigger\r\n render={\r\n <button\r\n type=\"button\"\r\n className={cn(\r\n inputVariants(),\r\n \"h-11 w-18 shrink-0 justify-between gap-1 rounded-r-none border-r-0 px-3\",\r\n \"hover:bg-bg-primary-hover focus-visible:z-10 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-brand\",\r\n \"disabled:pointer-events-none disabled:opacity-50\"\r\n )}\r\n disabled={disabled}\r\n >\r\n <span className=\"flex items-center gap-1.5 overflow-hidden\">\r\n <FlagComponent\r\n country={selectedCountry}\r\n countryName={selectedCountry}\r\n />\r\n {selectedCountry && (\r\n <span className=\"text-body-medium-3 text-text-primary\">\r\n {selectedCountry}\r\n </span>\r\n )}\r\n </span>\r\n <ChevronsUpDownIcon className=\"size-3.5 shrink-0 text-fg-quaternary\" />\r\n </button>\r\n }\r\n />\r\n\r\n {/* Dropdown content */}\r\n <ComboboxPopup className=\"w-72\">\r\n <ComboboxInput\r\n placeholder=\"Search country...\"\r\n aria-label=\"Search country\"\r\n />\r\n <ComboboxStatus status={filteredItems.length === 0 ? \"empty\" : null} />\r\n <ComboboxList\r\n ref={listRef}\r\n className=\"relative gap-0\"\r\n style={{ height: listHeight }}\r\n onScroll={(event) => setScrollTop(event.currentTarget.scrollTop)}\r\n >\r\n <div\r\n className=\"flex w-full shrink-0 flex-col\"\r\n style={{ paddingTop, paddingBottom }}\r\n >\r\n {virtualRange.items.map((item, virtualIndex) => {\r\n const index = virtualRange.startIndex + virtualIndex\r\n\r\n return (\r\n <ComboboxItem\r\n key={item.value}\r\n index={index}\r\n value={item}\r\n >\r\n <div className=\"flex items-center gap-2 w-full min-w-0\">\r\n <FlagComponent country={item.value} countryName={item.label} />\r\n <span className=\"flex-1 text-sm truncate\">{item.label}</span>\r\n <span className=\"text-sm text-text-tertiary shrink-0\">\r\n +{RPNInput.getCountryCallingCode(item.value)}\r\n </span>\r\n </div>\r\n </ComboboxItem>\r\n )\r\n })}\r\n </div>\r\n </ComboboxList>\r\n </ComboboxPopup>\r\n </Combobox >\r\n )\r\n}\r\n\r\n// ---------------------------------------------------------------------------\r\n// Input Component\r\n// ---------------------------------------------------------------------------\r\n\r\nconst InputComponent = React.forwardRef<\r\n HTMLInputElement,\r\n React.ComponentProps<\"input\">\r\n>(({ className, onChange, ...props }, ref) => {\r\n const handleChange = React.useCallback(\r\n (event: React.ChangeEvent<HTMLInputElement>) => {\r\n if (event.currentTarget.value === \"+\") {\r\n event.currentTarget.value = \"\"\r\n }\r\n\r\n onChange?.(event)\r\n },\r\n [onChange]\r\n )\r\n\r\n return (\r\n <input\r\n className={cn(\r\n inputVariants(),\r\n \"h-11 flex-1 rounded-l-none text-body-regular-2\",\r\n className\r\n )}\r\n ref={ref}\r\n type=\"tel\"\r\n onChange={handleChange}\r\n {...props}\r\n />\r\n )\r\n})\r\nInputComponent.displayName = \"InputComponent\"\r\n\r\n// ---------------------------------------------------------------------------\r\n// Phone Input\r\n// ---------------------------------------------------------------------------\r\n\r\nconst PhoneInput: React.ForwardRefExoticComponent<PhoneInputProps> =\r\n React.forwardRef<\r\n React.ElementRef<typeof RPNInput.default>,\r\n PhoneInputProps\r\n >(({\r\n className,\r\n onChange,\r\n value,\r\n ...props\r\n }, ref) => {\r\n return (\r\n <RPNInput.default\r\n ref={ref}\r\n className={cn(\r\n \"flex w-full min-w-0 items-center\",\r\n className\r\n )}\r\n flagComponent={FlagComponent}\r\n countrySelectComponent={CountrySelect}\r\n inputComponent={InputComponent}\r\n smartCaret={false}\r\n value={value || undefined}\r\n onChange={(value) => onChange?.(value || (\"\" as RPNInput.Value))}\r\n {...props}\r\n />\r\n )\r\n })\r\nPhoneInput.displayName = \"PhoneInput\"\r\n\r\nexport { PhoneInput, type PhoneInputProps }\r\n"]}
@@ -0,0 +1,3 @@
1
+ import {jsx}from'react/jsx-runtime';function t({color:l="currentColor",size:o=24,strokeWidth:C=0,absoluteStrokeWidth:n,...r}){return jsx("svg",{fill:"none",height:o,viewBox:"0 0 24 24",width:o,xmlns:"http://www.w3.org/2000/svg",...r,children:jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.31171 10.7615C8.23007 5.58716 9.68925 3 12 3C14.3107 3 15.7699 5.58716 18.6883 10.7615L19.0519 11.4063C21.4771 15.7061 22.6897 17.856 21.5937 19.428C20.4978 21 17.7864 21 12.3637 21H11.6363C6.21356 21 3.50217 21 2.40626 19.428C1.31034 17.856 2.52291 15.7061 4.94805 11.4063L5.31171 10.7615ZM12 7.25C12.4142 7.25 12.75 7.58579 12.75 8V13C12.75 13.4142 12.4142 13.75 12 13.75C11.5858 13.75 11.25 13.4142 11.25 13V8C11.25 7.58579 11.5858 7.25 12 7.25ZM12 17C12.5523 17 13 16.5523 13 16C13 15.4477 12.5523 15 12 15C11.4477 15 11 15.4477 11 16C11 16.5523 11.4477 17 12 17Z",fill:"currentColor"})})}var i=t;
2
+ export{t as a,i as b};//# sourceMappingURL=chunk-QWCYJC3T.js.map
3
+ //# sourceMappingURL=chunk-QWCYJC3T.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/icons/danger-triangle-icon.tsx"],"names":["DangerTriangleIcon","color","size","strokeWidth","absoluteStrokeWidth","props","jsx","danger_triangle_icon_default"],"mappings":"oCAIA,SAASA,CAAAA,CAAmB,CAC1B,KAAA,CAAAC,CAAAA,CAAQ,cAAA,CACR,IAAA,CAAAC,CAAAA,CAAO,EAAA,CACP,YAAAC,CAAAA,CAAc,CAAA,CACd,mBAAA,CAAAC,CAAAA,CACA,GAAGC,CACL,EAAc,CACZ,OACEC,GAAAA,CAAC,KAAA,CAAA,CACC,IAAA,CAAK,MAAA,CACL,OAAQJ,CAAAA,CACR,OAAA,CAAQ,YACR,KAAA,CAAOA,CAAAA,CACP,MAAM,4BAAA,CACL,GAAGG,CAAAA,CAEJ,QAAA,CAAAC,GAAAA,CAAC,MAAA,CAAA,CAAK,SAAS,SAAA,CAAU,QAAA,CAAS,SAAA,CAAU,CAAA,CAAE,4jBAAA,CAA6jB,IAAA,CAAK,eAAc,CAAA,CAChoB,CAEJ,CAEA,IAAOC,CAAAA,CAAQP","file":"chunk-QWCYJC3T.js","sourcesContent":["\"use client\";\r\n\r\nimport { type IconProps } from \"../types\";\r\n\r\nfunction DangerTriangleIcon({\r\n color = \"currentColor\",\r\n size = 24,\r\n strokeWidth = 0,\r\n absoluteStrokeWidth,\r\n ...props\r\n}: IconProps) {\r\n return (\r\n <svg\r\n fill=\"none\"\r\n height={size}\r\n viewBox=\"0 0 24 24\"\r\n width={size}\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n {...props}\r\n >\r\n <path fillRule=\"evenodd\" clipRule=\"evenodd\" d=\"M5.31171 10.7615C8.23007 5.58716 9.68925 3 12 3C14.3107 3 15.7699 5.58716 18.6883 10.7615L19.0519 11.4063C21.4771 15.7061 22.6897 17.856 21.5937 19.428C20.4978 21 17.7864 21 12.3637 21H11.6363C6.21356 21 3.50217 21 2.40626 19.428C1.31034 17.856 2.52291 15.7061 4.94805 11.4063L5.31171 10.7615ZM12 7.25C12.4142 7.25 12.75 7.58579 12.75 8V13C12.75 13.4142 12.4142 13.75 12 13.75C11.5858 13.75 11.25 13.4142 11.25 13V8C11.25 7.58579 11.5858 7.25 12 7.25ZM12 17C12.5523 17 13 16.5523 13 16C13 15.4477 12.5523 15 12 15C11.4477 15 11 15.4477 11 16C11 16.5523 11.4477 17 12 17Z\" fill=\"currentColor\"/>\r\n </svg>\r\n );\r\n}\r\n\r\nexport default DangerTriangleIcon;\r\nexport { DangerTriangleIcon };\r\n"]}
@@ -0,0 +1,2 @@
1
+ import {c,d,e,f,g,m,h,i,n,o,p,q as q$1,r,s,t,j as j$1,k,l,u,v}from'./chunk-JP737TCG.js';import'react';import {cn}from'@xploreu/lib/cn';import {CheckIcon,CircleIcon,ChevronRightIcon}from'lucide-react';import {jsx,jsxs}from'react/jsx-runtime';function O(e){return jsx(c,{...e})}function j(e){return jsx(d,{...e})}function T(e$1){return jsx(e,{...e$1})}function q({className:e,finalFocus:t,id:i,children:n,sideOffset:o=4,transition:a={duration:.2},...p}){return jsx(T,{children:jsx(f,{className:"z-50",sideOffset:o,...p,children:jsx(g,{finalFocus:t,id:i,transition:a,className:cn("bg-bg-primary text-text-primary max-h-(--available-height) min-w-[8rem] origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md border border-border-primary p-1 shadow-xp-lg outline-hidden",e),children:jsx(m,{className:"absolute inset-0 z-0 rounded-sm bg-bg-primary-hover",children:n})})})})}function B(e){return jsx(h,{...e})}function D({className:e,inset:t,...i$1}){return jsx(i,{"data-inset":t,className:cn("px-2 py-1.5 text-label-semibold-4 text-text-secondary data-[inset]:pl-8",e),...i$1})}function E({className:e,inset:t,variant:i="default",disabled:n$1,...o$1}){return jsx(n,{activeClassName:i==="destructive"?"bg-bg-error-primary":"",disabled:n$1,children:jsx(o,{disabled:n$1,"data-inset":t,"data-variant":i,className:cn("focus:text-text-primary data-[variant=destructive]:text-text-error-primary data-[variant=destructive]:focus:text-text-error-primary data-[variant=destructive]:*:[svg]:!text-fg-error-primary [&_svg:not([class*='text-'])]:text-fg-secondary relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-body-regular-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...o$1})})}function J({className:e,children:t,checked:i,disabled:n$1,...o}){return jsx(n,{disabled:n$1,children:jsxs(p,{disabled:n$1,className:cn("focus:text-text-primary relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-body-regular outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:i,...o,children:[jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:jsx(q$1,{animate:{opacity:1,scale:1},initial:{opacity:0,scale:.5},children:jsx(CheckIcon,{className:"size-4"})})}),t]})})}function K(e){return jsx(r,{...e})}function Q({className:e,children:t$1,disabled:i,...n$1}){return jsx(n,{disabled:i,children:jsxs(s,{disabled:i,className:cn("focus:text-text-primary relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-body-regular outline-hidden select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n$1,children:[jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:jsx(t,{layoutId:"menu-item-indicator-radio",children:jsx(CircleIcon,{className:"size-2 fill-current"})})}),t$1]})})}function U({className:e,...t}){return jsx(j$1,{className:cn("-mx-1 my-1 h-px bg-border-primary",e),...t})}function V({className:e,...t}){return jsx(k,{className:cn("text-text-quaternary ml-auto text-body-regular-xs tracking-widest",e),...t})}function W(e){return jsx(l,{...e})}function X(e){return jsx(u,{...e})}function Y({disabled:e,className:t,inset:i,children:n$1,...o}){return jsx(n,{disabled:e,children:jsxs(v,{disabled:e,"data-inset":i,className:cn("focus:text-text-primary data-[state=open]:text-text-primary flex cursor-default items-center rounded-sm px-2 py-1.5 text-body-regular outline-hidden select-none data-[inset]:pl-8","aria-[expanded=true]:[&_[data-slot=chevron]]:rotate-90 [&_[data-slot=chevron]]:transition-transform [&_[data-slot=chevron]]:duration-300 [&_[data-slot=chevron]]:ease-in-out",t),...o,children:[n$1,jsx(ChevronRightIcon,{"data-slot":"chevron",className:"ml-auto size-4"})]})})}function Z({className:e,finalFocus:t,id:i,children:n,sideOffset:o=4,transition:a={duration:.2},...p}){return jsx(T,{children:jsx(f,{className:"z-50",sideOffset:o,...p,children:jsx(g,{finalFocus:t,id:i,transition:a,className:cn("bg-bg-primary text-text-primary max-h-(--available-height) min-w-[8rem] origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md border border-border-primary p-1 shadow-xp-lg",e),children:n})})})}export{O as a,j as b,T as c,q as d,B as e,D as f,E as g,J as h,K as i,Q as j,U as k,V as l,W as m,X as n,Y as o,Z as p};//# sourceMappingURL=chunk-RCA6JRHN.js.map
2
+ //# sourceMappingURL=chunk-RCA6JRHN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ui/menu.tsx"],"names":["Menu","props","jsx","MenuTrigger","MenuPortal","MenuPanel","className","finalFocus","id","children","sideOffset","transition","MenuPositioner","MenuPopup","cn","MenuHighlight","MenuGroup","MenuGroupLabel","inset","MenuItem","variant","disabled","MenuHighlightItem","MenuCheckboxItem","checked","jsxs","MenuCheckboxItemIndicator","CheckIcon","MenuRadioGroup","MenuRadioItem","MenuRadioItemIndicator","CircleIcon","MenuSeparator","MenuShortcut","MenuArrow","MenuSubmenu","MenuSubmenuTrigger","ChevronRightIcon","MenuSubmenuPanel"],"mappings":"iPAmDA,SAASA,CAAAA,CAAKC,CAAAA,CAAkB,CAC9B,OAAOC,GAAAA,CAACF,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AC7B,GAAGV,CACL,CAAA,CAA0B,CACxB,OACEC,GAAAA,CAACE,CAAAA,CAAA,CACC,QAAA,CAAAF,GAAAA,CAACU,CAAAA,CAAA,CACC,SAAA,CAAU,MAAA,CACV,UAAA,CAAYF,CAAAA,CACX,GAAGT,CAAAA,CAEJ,QAAA,CAAAC,GAAAA,CAACW,CAAAA,CAAA,CACC,UAAA,CAAYN,CAAAA,CACZ,EAAA,CAAIC,CAAAA,CACJ,UAAA,CAAYG,CAAAA,CACZ,SAAA,CAAWG,EAAAA,CACT,gMAAA,CACAR,CACF,CAAA,CAEC,QAAA,CAAAG,CAAAA,CACH,CAAA,CACF,EACF,CAEJ","file":"chunk-RCA6JRHN.js","sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\n\r\nimport {\r\n Menu as MenuPrimitive,\r\n MenuArrow as MenuArrowPrimitive,\r\n MenuCheckboxItem as MenuCheckboxItemPrimitive,\r\n MenuCheckboxItemIndicator as MenuCheckboxItemIndicatorPrimitive,\r\n MenuGroup as MenuGroupPrimitive,\r\n MenuGroupLabel as MenuGroupLabelPrimitive,\r\n MenuHighlight as MenuHighlightPrimitive,\r\n MenuHighlightItem as MenuHighlightItemPrimitive,\r\n MenuItem as MenuItemPrimitive,\r\n MenuPortal as MenuPortalPrimitive,\r\n MenuPopup as MenuPopupPrimitive,\r\n MenuPositioner as MenuPositionerPrimitive,\r\n MenuRadioGroup as MenuRadioGroupPrimitive,\r\n MenuRadioItem as MenuRadioItemPrimitive,\r\n MenuRadioItemIndicator as MenuRadioItemIndicatorPrimitive,\r\n MenuSeparator as MenuSeparatorPrimitive,\r\n MenuShortcut as MenuShortcutPrimitive,\r\n MenuSubmenu as MenuSubmenuPrimitive,\r\n MenuSubmenuTrigger as MenuSubmenuTriggerPrimitive,\r\n MenuTrigger as MenuTriggerPrimitive,\r\n type MenuArrowProps as MenuArrowPrimitiveProps,\r\n type MenuCheckboxItemIndicatorProps as MenuCheckboxItemIndicatorPrimitiveProps,\r\n type MenuCheckboxItemProps as MenuCheckboxItemPrimitiveProps,\r\n type MenuGroupLabelProps as MenuGroupLabelPrimitiveProps,\r\n type MenuGroupProps as MenuGroupPrimitiveProps,\r\n type MenuHighlightItemProps as MenuHighlightItemPrimitiveProps,\r\n type MenuHighlightProps as MenuHighlightPrimitiveProps,\r\n type MenuItemProps as MenuItemPrimitiveProps,\r\n type MenuPopupProps as MenuPopupPrimitiveProps,\r\n type MenuPortalProps as MenuPortalPrimitiveProps,\r\n type MenuPositionerProps as MenuPositionerPrimitiveProps,\r\n type MenuProps as MenuPrimitiveProps,\r\n type MenuRadioGroupProps as MenuRadioGroupPrimitiveProps,\r\n type MenuRadioItemProps as MenuRadioItemPrimitiveProps,\r\n type MenuRadioItemIndicatorProps as MenuRadioItemIndicatorPrimitiveProps,\r\n type MenuSeparatorProps as MenuSeparatorPrimitiveProps,\r\n type MenuShortcutProps as MenuShortcutPrimitiveProps,\r\n type MenuSubmenuProps as MenuSubmenuPrimitiveProps,\r\n type MenuSubmenuTriggerProps as MenuSubmenuTriggerPrimitiveProps,\r\n type MenuTriggerProps as MenuTriggerPrimitiveProps,\r\n} from \"../primitives/menu\"\r\nimport { cn } from \"@xploreu/lib/cn\"\r\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from \"lucide-react\"\r\n\r\ntype MenuProps = MenuPrimitiveProps\r\n\r\nfunction Menu(props: MenuProps) {\r\n return <MenuPrimitive {...props} />\r\n}\r\n\r\ntype MenuTriggerProps = MenuTriggerPrimitiveProps\r\n\r\nfunction MenuTrigger(props: MenuTriggerProps) {\r\n return <MenuTriggerPrimitive {...props} />\r\n}\r\n\r\ntype MenuPortalProps = MenuPortalPrimitiveProps\r\n\r\nfunction MenuPortal(props: MenuPortalProps) {\r\n return <MenuPortalPrimitive {...props} />\r\n}\r\n\r\ntype MenuPanelProps = MenuPopupPrimitiveProps & MenuPositionerPrimitiveProps\r\n\r\nfunction MenuPanel({\r\n className,\r\n finalFocus,\r\n id,\r\n children,\r\n sideOffset = 4,\r\n transition = { duration: 0.2 },\r\n ...props\r\n}: MenuPanelProps) {\r\n return (\r\n <MenuPortal>\r\n <MenuPositionerPrimitive\r\n className=\"z-50\"\r\n sideOffset={sideOffset}\r\n {...props}\r\n >\r\n <MenuPopupPrimitive\r\n finalFocus={finalFocus}\r\n id={id}\r\n transition={transition}\r\n className={cn(\r\n \"bg-bg-primary text-text-primary max-h-(--available-height) min-w-[8rem] origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md border border-border-primary p-1 shadow-xp-lg outline-hidden\",\r\n className,\r\n )}\r\n >\r\n <MenuHighlightPrimitive className=\"absolute inset-0 z-0 rounded-sm bg-bg-primary-hover\">\r\n {children}\r\n </MenuHighlightPrimitive>\r\n </MenuPopupPrimitive>\r\n </MenuPositionerPrimitive>\r\n </MenuPortal>\r\n )\r\n}\r\n\r\ntype MenuGroupProps = MenuGroupPrimitiveProps\r\n\r\nfunction MenuGroup(props: MenuGroupProps) {\r\n return <MenuGroupPrimitive {...props} />\r\n}\r\n\r\ntype MenuGroupLabelProps = MenuGroupLabelPrimitiveProps & {\r\n inset?: boolean;\r\n}\r\n\r\nfunction MenuGroupLabel({ className, inset, ...props }: MenuGroupLabelProps) {\r\n return (\r\n <MenuGroupLabelPrimitive\r\n data-inset={inset}\r\n className={cn(\r\n \"px-2 py-1.5 text-label-semibold-4 text-text-secondary data-[inset]:pl-8\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype MenuItemProps = MenuItemPrimitiveProps & {\r\n inset?: boolean;\r\n variant?: \"default\" | \"destructive\";\r\n}\r\n\r\nfunction MenuItem({\r\n className,\r\n inset,\r\n variant = \"default\",\r\n disabled,\r\n ...props\r\n}: MenuItemProps) {\r\n return (\r\n <MenuHighlightItemPrimitive\r\n activeClassName={\r\n variant === \"destructive\" ? \"bg-bg-error-primary\" : \"\"\r\n }\r\n disabled={disabled}\r\n >\r\n <MenuItemPrimitive\r\n disabled={disabled}\r\n data-inset={inset}\r\n data-variant={variant}\r\n className={cn(\r\n \"focus:text-text-primary data-[variant=destructive]:text-text-error-primary data-[variant=destructive]:focus:text-text-error-primary data-[variant=destructive]:*:[svg]:!text-fg-error-primary [&_svg:not([class*='text-'])]:text-fg-secondary relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-body-regular-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n </MenuHighlightItemPrimitive>\r\n )\r\n}\r\n\r\ntype MenuCheckboxItemProps = MenuCheckboxItemPrimitiveProps\r\n\r\nfunction MenuCheckboxItem({\r\n className,\r\n children,\r\n checked,\r\n disabled,\r\n ...props\r\n}: MenuCheckboxItemProps) {\r\n return (\r\n <MenuHighlightItemPrimitive disabled={disabled}>\r\n <MenuCheckboxItemPrimitive\r\n disabled={disabled}\r\n className={cn(\r\n \"focus:text-text-primary relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-body-regular outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\r\n className,\r\n )}\r\n checked={checked}\r\n {...props}\r\n >\r\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\r\n <MenuCheckboxItemIndicatorPrimitive\r\n animate={{ opacity: 1, scale: 1 }}\r\n initial={{ opacity: 0, scale: 0.5 }}\r\n >\r\n <CheckIcon className=\"size-4\" />\r\n </MenuCheckboxItemIndicatorPrimitive>\r\n </span>\r\n {children}\r\n </MenuCheckboxItemPrimitive>\r\n </MenuHighlightItemPrimitive>\r\n )\r\n}\r\n\r\ntype MenuRadioGroupProps = MenuRadioGroupPrimitiveProps\r\n\r\nfunction MenuRadioGroup(props: MenuRadioGroupProps) {\r\n return <MenuRadioGroupPrimitive {...props} />\r\n}\r\n\r\ntype MenuRadioItemProps = MenuRadioItemPrimitiveProps\r\n\r\nfunction MenuRadioItem({\r\n className,\r\n children,\r\n disabled,\r\n ...props\r\n}: MenuRadioItemProps) {\r\n return (\r\n <MenuHighlightItemPrimitive disabled={disabled}>\r\n <MenuRadioItemPrimitive\r\n disabled={disabled}\r\n className={cn(\r\n \"focus:text-text-primary relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-body-regular outline-hidden select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\r\n <MenuRadioItemIndicatorPrimitive layoutId=\"menu-item-indicator-radio\">\r\n <CircleIcon className=\"size-2 fill-current\" />\r\n </MenuRadioItemIndicatorPrimitive>\r\n </span>\r\n {children}\r\n </MenuRadioItemPrimitive>\r\n </MenuHighlightItemPrimitive>\r\n )\r\n}\r\n\r\ntype MenuSeparatorProps = MenuSeparatorPrimitiveProps\r\n\r\nfunction MenuSeparator({ className, ...props }: MenuSeparatorProps) {\r\n return (\r\n <MenuSeparatorPrimitive\r\n className={cn(\"-mx-1 my-1 h-px bg-border-primary\", className)}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype MenuShortcutProps = MenuShortcutPrimitiveProps\r\n\r\nfunction MenuShortcut({ className, ...props }: MenuShortcutProps) {\r\n return (\r\n <MenuShortcutPrimitive\r\n className={cn(\r\n \"text-text-quaternary ml-auto text-body-regular-xs tracking-widest\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype MenuArrowProps = MenuArrowPrimitiveProps\r\n\r\nfunction MenuArrow(props: MenuArrowProps) {\r\n return <MenuArrowPrimitive {...props} />\r\n}\r\n\r\ntype MenuSubmenuProps = MenuSubmenuPrimitiveProps\r\n\r\nfunction MenuSubmenu(props: MenuSubmenuProps) {\r\n return <MenuSubmenuPrimitive {...props} />\r\n}\r\n\r\ntype MenuSubmenuTriggerProps = MenuSubmenuTriggerPrimitiveProps & {\r\n inset?: boolean;\r\n children?: React.ReactNode;\r\n}\r\n\r\nfunction MenuSubmenuTrigger({\r\n disabled,\r\n className,\r\n inset,\r\n children,\r\n ...props\r\n}: MenuSubmenuTriggerProps) {\r\n return (\r\n <MenuHighlightItemPrimitive disabled={disabled}>\r\n <MenuSubmenuTriggerPrimitive\r\n disabled={disabled}\r\n data-inset={inset}\r\n className={cn(\r\n \"focus:text-text-primary data-[state=open]:text-text-primary flex cursor-default items-center rounded-sm px-2 py-1.5 text-body-regular outline-hidden select-none data-[inset]:pl-8\",\r\n \"aria-[expanded=true]:[&_[data-slot=chevron]]:rotate-90 [&_[data-slot=chevron]]:transition-transform [&_[data-slot=chevron]]:duration-300 [&_[data-slot=chevron]]:ease-in-out\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n <ChevronRightIcon\r\n data-slot=\"chevron\"\r\n className=\"ml-auto size-4\"\r\n />\r\n </MenuSubmenuTriggerPrimitive>\r\n </MenuHighlightItemPrimitive>\r\n )\r\n}\r\n\r\ntype MenuSubmenuPanelProps = MenuPopupPrimitiveProps &\r\n MenuPositionerPrimitiveProps\r\n\r\nfunction MenuSubmenuPanel({\r\n className,\r\n finalFocus,\r\n id,\r\n children,\r\n sideOffset = 4,\r\n transition = { duration: 0.2 },\r\n ...props\r\n}: MenuSubmenuPanelProps) {\r\n return (\r\n <MenuPortal>\r\n <MenuPositionerPrimitive\r\n className=\"z-50\"\r\n sideOffset={sideOffset}\r\n {...props}\r\n >\r\n <MenuPopupPrimitive\r\n finalFocus={finalFocus}\r\n id={id}\r\n transition={transition}\r\n className={cn(\r\n \"bg-bg-primary text-text-primary max-h-(--available-height) min-w-[8rem] origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md border border-border-primary p-1 shadow-xp-lg\",\r\n className,\r\n )}\r\n >\r\n {children}\r\n </MenuPopupPrimitive>\r\n </MenuPositionerPrimitive>\r\n </MenuPortal>\r\n )\r\n}\r\n\r\nexport {\r\n Menu,\r\n MenuTrigger,\r\n MenuPortal,\r\n MenuPanel,\r\n MenuGroup,\r\n MenuGroupLabel,\r\n MenuItem,\r\n MenuCheckboxItem,\r\n MenuRadioGroup,\r\n MenuRadioItem,\r\n MenuSeparator,\r\n MenuShortcut,\r\n MenuArrow,\r\n MenuSubmenu,\r\n MenuSubmenuTrigger,\r\n MenuSubmenuPanel,\r\n type MenuProps,\r\n type MenuTriggerProps,\r\n type MenuPortalProps,\r\n type MenuPanelProps,\r\n type MenuGroupProps,\r\n type MenuGroupLabelProps,\r\n type MenuItemProps,\r\n type MenuCheckboxItemProps,\r\n type MenuRadioGroupProps,\r\n type MenuRadioItemProps,\r\n type MenuSeparatorProps,\r\n type MenuShortcutProps,\r\n type MenuArrowProps,\r\n type MenuSubmenuProps,\r\n type MenuSubmenuTriggerProps,\r\n type MenuSubmenuPanelProps,\r\n}"]}
@@ -0,0 +1,2 @@
1
+ import {a,b,c,e,d,f as f$1}from'./chunk-TES3PKRE.js';import*as f from'react';import {cn}from'@xploreu/lib/cn';import {jsx,jsxs}from'react/jsx-runtime';function A({className:g,defaultValue:o,value:a$1,min:l=0,max:h=100,showTooltip:y=false,formatTooltip:s,thumbClassName:P,trackClassName:S,indicatorClassName:x,...N}){let n=f.useMemo(()=>{let e=a$1??o;return Array.isArray(e)?e:e!==void 0?[e]:[l]},[a$1,o,l]);return jsx(a,{className:cn("relative flex w-full items-center",g),defaultValue:o,max:h,min:l,value:a$1,...N,children:jsxs(b,{className:"relative flex h-full w-full touch-none items-center select-none",children:[jsx(c,{className:cn("bg-bg-quaternary relative grow overflow-hidden rounded-xp-full h-1.5",S),children:jsx(e,{className:cn("bg-fg-brand-primary absolute h-full",x)})}),Array.from({length:n.length},(e,i)=>jsx(d,{index:i,className:cn("border-slider-handle-border border-[0.5px] bg-slider-handle-bg rounded-xp-full shadow-xp-md size-4 relative group hover:ring-1 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50 transition-[color,box-shadow]",P),children:y&&jsx(f$1,{className:"absolute bottom-full mb-2.5 left-1/2 -translate-x-1/2 bg-bg-primary border border-border-primary rounded-xp-card-base-sm px-2.5 py-1.5 text-label-medium-3 text-text-primary whitespace-nowrap z-100 opacity-0 pointer-events-none group-hover:opacity-100 group-data-[dragging]:opacity-100 group-focus-visible:opacity-100 transition-opacity duration-150",children:(R,w)=>{let d=w[i]??n[i]??0;return s?s(d):d}})},i))]})})}export{A as a};//# sourceMappingURL=chunk-RN6CYJKG.js.map
2
+ //# sourceMappingURL=chunk-RN6CYJKG.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ui/slider.tsx"],"names":["Slider","className","defaultValue","value","min","max","showTooltip","formatTooltip","thumbClassName","trackClassName","indicatorClassName","props","_values","v","jsx","cn","jsxs","Control","Track","Indicator","_","index","Thumb","Value","_formattedValues","values","val"],"mappings":"uJAuBA,SAASA,EAAO,CACd,SAAA,CAAAC,EACA,YAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,GAAAA,CACA,IAAAC,CAAAA,CAAM,CAAA,CACN,IAAAC,CAAAA,CAAM,GAAA,CACN,YAAAC,CAAAA,CAAc,KAAA,CACd,aAAA,CAAAC,CAAAA,CACA,eAAAC,CAAAA,CACA,cAAA,CAAAC,EACA,kBAAA,CAAAC,CAAAA,CACA,GAAGC,CACL,CAAA,CAAgB,CACd,IAAMC,EAAgB,CAAA,CAAA,OAAA,CAAQ,IAAM,CAClC,IAAMC,EAAIV,GAAAA,EAASD,CAAAA,CACnB,OAAI,KAAA,CAAM,QAAQW,CAAC,CAAA,CAAUA,EAEtBA,CAAAA,GAAM,MAAA,CAAY,CAACA,CAAC,CAAA,CAAI,CAACT,CAAG,CACrC,CAAA,CAAG,CAACD,IAAOD,CAAAA,CAAcE,CAAG,CAAC,CAAA,CAE7B,OACEU,GAAAA,CAACd,CAAAA,CAAA,CACC,SAAA,CAAWe,EAAAA,CAAG,oCAAqCd,CAAS,CAAA,CAC5D,aAAcC,CAAAA,CACd,GAAA,CAAKG,CAAAA,CACL,GAAA,CAAKD,EACL,KAAA,CAAOD,GAAAA,CACN,GAAGQ,CAAAA,CAEJ,SAAAK,IAAAA,CAACC,CAAAA,CAAA,CACC,SAAA,CAAU,kEAEV,QAAA,CAAA,CAAAH,GAAAA,CAACI,EAAA,CACC,SAAA,CAAWH,GAAG,sEAAA,CAAwEN,CAAc,CAAA,CAEpG,QAAA,CAAAK,IAACK,CAAAA,CAAA,CAAyB,UAAWJ,EAAAA,CAAG,qCAAA,CAAuCL,CAAkB,CAAA,CAAG,CAAA,CACtG,CAAA,CAEC,KAAA,CAAM,KAAK,CAAE,MAAA,CAAQE,EAAQ,MAAO,CAAA,CAAG,CAACQ,CAAAA,CAAGC,CAAAA,GAExCP,GAAAA,CAACQ,CAAAA,CAAA,CAEC,KAAA,CAAOD,CAAAA,CACP,UAAWN,EAAAA,CACT,iQAAA,CACAP,CACF,CAAA,CAEC,QAAA,CAAAF,CAAAA,EACCQ,GAAAA,CAACS,IAAA,CACC,SAAA,CAAU,+VAET,QAAA,CAAA,CAACC,CAAAA,CAAkBC,IAAW,CAC7B,IAAMC,CAAAA,CAAMD,CAAAA,CAAOJ,CAAK,CAAA,EAAKT,CAAAA,CAAQS,CAAK,CAAA,EAAK,CAAA,CAC/C,OAAOd,CAAAA,CAAgBA,CAAAA,CAAcmB,CAAG,CAAA,CAAIA,CAC9C,CAAA,CACF,CAAA,CAAA,CAfGL,CAiBP,CAEH,CAAA,CAAA,CACH,EACF,CAEJ","file":"chunk-RN6CYJKG.js","sourcesContent":["'use client'\r\n\r\nimport * as React from 'react'\r\n\r\nimport {\r\n SliderPrimitive,\r\n SliderControlPrimitive,\r\n SliderTrackPrimitive,\r\n SliderThumbPrimitive,\r\n SliderIndicatorPrimitive,\r\n SliderValuePrimitive,\r\n} from '../primitives/slider'\r\n\r\nimport { cn } from '@xploreu/lib/cn'\r\n\r\ninterface SliderProps extends React.ComponentProps<typeof SliderPrimitive> {\r\n showTooltip?: boolean\r\n formatTooltip?: (value: number) => React.ReactNode\r\n thumbClassName?: string\r\n trackClassName?: string\r\n indicatorClassName?: string\r\n}\r\n\r\nfunction Slider({\r\n className,\r\n defaultValue,\r\n value,\r\n min = 0,\r\n max = 100,\r\n showTooltip = false,\r\n formatTooltip,\r\n thumbClassName,\r\n trackClassName,\r\n indicatorClassName,\r\n ...props\r\n}: SliderProps) {\r\n const _values = React.useMemo(() => {\r\n const v = value ?? defaultValue\r\n if (Array.isArray(v)) return v\r\n // Single-value slider: value/defaultValue is a number → one thumb.\r\n return v !== undefined ? [v] : [min]\r\n }, [value, defaultValue, min])\r\n\r\n return (\r\n <SliderPrimitive\r\n className={cn('relative flex w-full items-center', className)}\r\n defaultValue={defaultValue}\r\n max={max}\r\n min={min}\r\n value={value}\r\n {...props}\r\n >\r\n <SliderControlPrimitive\r\n className=\"relative flex h-full w-full touch-none items-center select-none\"\r\n >\r\n <SliderTrackPrimitive\r\n className={cn('bg-bg-quaternary relative grow overflow-hidden rounded-xp-full h-1.5', trackClassName)}\r\n >\r\n <SliderIndicatorPrimitive className={cn('bg-fg-brand-primary absolute h-full', indicatorClassName)} />\r\n </SliderTrackPrimitive>\r\n\r\n {Array.from({ length: _values.length }, (_, index) => {\r\n return (\r\n <SliderThumbPrimitive\r\n key={index}\r\n index={index}\r\n className={cn(\r\n 'border-slider-handle-border border-[0.5px] bg-slider-handle-bg rounded-xp-full shadow-xp-md size-4 relative group hover:ring-1 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50 transition-[color,box-shadow]',\r\n thumbClassName\r\n )}\r\n >\r\n {showTooltip && (\r\n <SliderValuePrimitive\r\n className=\"absolute bottom-full mb-2.5 left-1/2 -translate-x-1/2 bg-bg-primary border border-border-primary rounded-xp-card-base-sm px-2.5 py-1.5 text-label-medium-3 text-text-primary whitespace-nowrap z-100 opacity-0 pointer-events-none group-hover:opacity-100 group-data-[dragging]:opacity-100 group-focus-visible:opacity-100 transition-opacity duration-150\"\r\n >\r\n {(_formattedValues, values) => {\r\n const val = values[index] ?? _values[index] ?? 0\r\n return formatTooltip ? formatTooltip(val) : val\r\n }}\r\n </SliderValuePrimitive>\r\n )}\r\n </SliderThumbPrimitive>\r\n )\r\n })}\r\n </SliderControlPrimitive>\r\n </SliderPrimitive>\r\n )\r\n}\r\n\r\nexport { Slider }\r\n\r\nexport type { SliderProps }\r\n"]}
@@ -0,0 +1,2 @@
1
+ import {d,a,m,l,n,o,b,p,t,v,z,G}from'./chunk-YB5ZNOPP.js';import {a as a$1}from'./chunk-JH6RZ3QH.js';import*as u 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 Z({multiple:z$1=true,inputPlaceholder:E="Search...",container:G$1,items:s,infiniteScroll:T,isPending:j,taggable:c=false,maxVisible:i,...m$1}){let[q,O]=useControlledState({value:m$1?.inputValue?.toString(),defaultValue:m$1?.defaultInputValue?.toString(),onChange:m$1?.onInputValueChange}),[b$1,g]=useControlledState({value:m$1?.value??[],defaultValue:m$1?.defaultValue??[],onChange:m$1?.onValueChange}),[h,V]=u.useState([]),C=u.useRef(new Set);u.useEffect(()=>{let e=new Set(b$1.map(n=>n.value));V(n=>{let l=n.filter(o=>e.has(o.value));return l.length===n.length?n:(C.current=new Set(l.map(o=>o.value)),l)});},[b$1]);let a$2=q?.toString().trim()??"",A=u.useMemo(()=>a$2?b$1.some(e=>e.value.toLowerCase()===a$2.toLowerCase()):false,[a$2,b$1]),p$1=u.useMemo(()=>!c||!a$2?false:!s?.some(e=>e.label.toLowerCase()===a$2.toLowerCase()),[c,a$2,s]),B=u.useMemo(()=>{let e=[...s??[],...h];return p$1?[...e,{label:a$2,value:a$2,tag:true}]:e},[s,h,p$1,a$2]);return jsxs(d,{...m$1,behavior:"chip-outside",multiple:true,items:c?B:s,isItemEqualToValue:(e,n)=>e.value===n.value,onValueChange:(e,n)=>{if(c){let l=e.filter(o=>o?.tag===true&&!C.current.has(o.value));if(l.length>0){for(let o of l)C.current.add(o.value);V(o=>[...o,...l]);}}g(z$1?e:[e[e.length-1]],n);},onInputValueChange:O,children:[jsx(a,{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(m,{className:cn("contents",i!==void 0&&"flex-nowrap overflow-hidden"),children:[jsx(l,{children:e=>{let n$1=i!==void 0?e.slice(0,i):e,l=i!==void 0?e.length-i:0;return jsxs(Fragment,{children:[n$1?.map(o$1=>jsxs(n,{className:cn(i!==void 0&&"min-w-0 shrink"),children:[o$1?.image&&jsx("img",{src:o$1.image,alt:o$1?.label||"",className:"size-4 rounded-full object-cover shrink-0 mr-1"}),i!==void 0?jsx("span",{className:"truncate",children:o$1?.label||""}):o$1?.label||"",jsx(o,{})]},o$1?.value||"")),l>0&&jsxs(n,{className:"shrink-0",children:["+",l]})]})}}),jsx(b,{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:b$1.length===0?E:void 0})})]})}),jsxs(p,{container:G$1,children:[jsx(t,{status:j||s===void 0?"pending":s?.length===0&&!p$1?"empty":null}),jsxs(v,{children:[s?.map(e=>jsx(z,{value:e,children:jsxs("div",{className:"flex items-center gap-2 w-full min-w-0",children:[e.image&&jsx("img",{src:e.image,alt:e.label,className:"size-6 rounded-full object-cover shrink-0"}),jsx("span",{className:"truncate",children:e.label})]})},e.value)),p$1&&jsx(z,{value:{label:a$2,value:a$2,tag:true},children:jsxs("div",{className:"flex items-center gap-1.5 w-full min-w-0",children:[!A&&jsx("span",{className:"text-text-secondary",children:"Create:"}),jsx("span",{className:"font-medium text-text-primary truncate",children:a$2})]})}),jsx(G,{...T})]})]})]})}export{Z as a};//# sourceMappingURL=chunk-S4IFBDOJ.js.map
2
+ //# sourceMappingURL=chunk-S4IFBDOJ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/composites/combobox-chip.tsx"],"names":["ComboboxChip","multiple","inputPlaceholder","container","items","infiniteScroll","isPending","taggable","maxVisible","props","inputValue","setInputValue","useControlledState","value","setValue","createdItems","setCreatedItems","createdValuesRef","currentValues","v","prev","next","item","trimmedInput","isInputSelected","isCreatingItem","combinedItems","base","jsxs","Combobox","a","b","eventDetails","newTags","tag","jsx","ComboboxInputGroup","cn","inputVariants","ComboboxChips","ComboboxValue","visible","overflow","Fragment","ComboboxChipRemove","ComboboxInput","ComboboxPopup","ComboboxStatus","ComboboxList","ComboboxItem","ComboboxInfiniteScroll"],"mappings":"qRA6CA,SAASA,CAAAA,CAAyF,CAChG,QAAA,CAAAC,IAAW,IAAA,CACX,gBAAA,CAAAC,CAAAA,CAAmB,WAAA,CACnB,SAAA,CAAAC,GAAAA,CACA,KAAA,CAAAC,CAAAA,CACA,eAAAC,CAAAA,CACA,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,mBAAmB,CACrD,KAAA,CAAOH,GAAAA,EAAO,UAAA,EAAY,QAAA,EAAS,CACnC,YAAA,CAAcA,GAAAA,EAAO,mBAAmB,QAAA,EAAS,CACjD,QAAA,CAAUA,GAAAA,EAAO,kBACnB,CAAC,CAAA,CAEK,CAACI,IAAOC,CAAQ,CAAA,CAAIF,kBAAAA,CAAmB,CAC3C,KAAA,CAAOH,GAAAA,EAAO,KAAA,EAAS,GACvB,YAAA,CAAcA,GAAAA,EAAO,YAAA,EAAgB,EAAC,CACtC,QAAA,CAAUA,GAAAA,EAAO,aACnB,CAAC,CAAA,CAIK,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AA,CAZKA,CAAAA,CAAK,KAaZ,CACD,CAAA,CACAG,GAAAA,EACCU,GAAAA,CAACc,CAAAA,CAAA,CACC,KAAA,CAAO,CAAE,MAAO1B,GAAAA,CAAc,KAAA,CAAOA,GAAAA,CAAc,GAAA,CAAK,IAAK,CAAA,CAE7D,QAAA,CAAAK,IAAAA,CAAC,OAAI,SAAA,CAAU,0CAAA,CACZ,QAAA,CAAA,CAAA,CAACJ,CAAAA,EACAW,GAAAA,CAAC,MAAA,CAAA,CAAK,SAAA,CAAU,qBAAA,CAAsB,mBAAO,CAAA,CAE/CA,GAAAA,CAAC,MAAA,CAAA,CAAK,SAAA,CAAU,wCAAA,CACb,QAAA,CAAAZ,GAAAA,CACH,CAAA,CAAA,CACF,EACF,CAAA,CAEFY,GAAAA,CAACe,CAAAA,CAAA,CAAwB,GAAG7C,CAAAA,CAAgB,CAAA,CAAA,CAC9C,CAAA,CAAA,CACF,GACF,CAEJ","file":"chunk-S4IFBDOJ.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} from \"../ui/combobox\"\r\nimport { useControlledState } from \"@xploreu/hooks/use-controlled-state\"\r\nimport { inputVariants } from \"../ui/input\"\r\n\r\ntype ComboboxChipProps<Value> = Omit<ComboboxProps<Value, true>, \"multiple\"> & {\r\n multiple?: boolean\r\n inputPlaceholder?: string\r\n container?: React.ComponentProps<typeof ComboboxPortal>[\"container\"]\r\n items: ({ label: string; value: string; image?: string }[]) | undefined\r\n infiniteScroll?: React.ComponentProps<typeof ComboboxInfiniteScroll>\r\n isPending?: boolean\r\n /**\r\n * When true, enables creatable / taggable mode.\r\n * If the typed value has no exact match in the current item list,\r\n * a \"Create \\\"…\\\"\" option is shown at the top of the dropdown.\r\n * Created items are appended to the value with `{ label, value, tag: true }`.\r\n */\r\n taggable?: boolean\r\n /**\r\n * Maximum number of chips to show before collapsing the rest into a \"+N\" chip.\r\n * When undefined, all chips are shown.\r\n */\r\n maxVisible?: number\r\n}\r\n\r\nfunction ComboboxChip<Value extends { label: string; value: string; image?: string; tag?: true }>({\r\n multiple = true,\r\n inputPlaceholder = \"Search...\",\r\n container,\r\n items,\r\n infiniteScroll,\r\n isPending,\r\n taggable = false,\r\n maxVisible,\r\n ...props\r\n}: ComboboxChipProps<Value>) {\r\n const [inputValue, setInputValue] = useControlledState({\r\n value: props?.inputValue?.toString(),\r\n defaultValue: props?.defaultInputValue?.toString(),\r\n onChange: props?.onInputValueChange,\r\n })\r\n\r\n const [value, setValue] = useControlledState({\r\n value: props?.value ?? [],\r\n defaultValue: props?.defaultValue ?? [],\r\n onChange: props?.onValueChange,\r\n })\r\n\r\n // Track items created via taggable mode\r\n // Sync with value to avoid stale tags when controlled value is reset from outside\r\n const [createdItems, setCreatedItems] = React.useState<Value[]>([])\r\n const createdValuesRef = React.useRef<Set<string>>(new Set())\r\n\r\n React.useEffect(() => {\r\n const currentValues = new Set(value.map((v) => v.value))\r\n setCreatedItems((prev) => {\r\n const next = prev.filter((item) => currentValues.has(item.value))\r\n if (next.length === prev.length) return prev\r\n createdValuesRef.current = new Set(next.map((v) => v.value))\r\n return next\r\n })\r\n }, [value])\r\n\r\n const trimmedInput = inputValue?.toString().trim() ?? \"\"\r\n const isInputSelected = React.useMemo(() => {\r\n if (!trimmedInput) return false\r\n return value.some(\r\n (item) => item.value.toLowerCase() === trimmedInput.toLowerCase()\r\n )\r\n }, [trimmedInput, value])\r\n\r\n // true = show the taggable item in dropdown (either as \"Create:\" or as checked item)\r\n const isCreatingItem = React.useMemo(() => {\r\n if (!taggable || !trimmedInput) return false\r\n return !items?.some(\r\n (item) => item.label.toLowerCase() === trimmedInput.toLowerCase()\r\n )\r\n }, [taggable, trimmedInput, items])\r\n\r\n // Merge server items with locally created tags + the \"Create\" placeholder\r\n const combinedItems = React.useMemo(() => {\r\n const base: Value[] = [\r\n ...items ?? [],\r\n ...createdItems,\r\n ]\r\n\r\n if (isCreatingItem) {\r\n return [...base, { label: trimmedInput, value: trimmedInput, tag: true } as unknown as Value]\r\n }\r\n\r\n return base\r\n }, [items, createdItems, isCreatingItem, trimmedInput])\r\n\r\n const handleValueChange: ComboboxProps<Value, true>[\"onValueChange\"] = (value, eventDetails) => {\r\n if (taggable) {\r\n const newTags = value.filter(\r\n (v) => v?.tag === true && !createdValuesRef.current.has(v.value)\r\n )\r\n if (newTags.length > 0) {\r\n for (const tag of newTags) {\r\n createdValuesRef.current.add(tag.value)\r\n }\r\n setCreatedItems((prev) => [...prev, ...newTags])\r\n }\r\n }\r\n\r\n if (!multiple) {\r\n setValue([value[value.length - 1]], eventDetails)\r\n } else {\r\n setValue(value, eventDetails)\r\n }\r\n }\r\n\r\n return (\r\n <Combobox\r\n {...props}\r\n behavior=\"chip-outside\"\r\n multiple\r\n items={taggable ? combinedItems : items}\r\n isItemEqualToValue={(a, b) => a.value === b.value}\r\n onValueChange={handleValueChange}\r\n onInputValueChange={setInputValue}\r\n >\r\n {/* Input box with chips inside */}\r\n <ComboboxInputGroup\r\n className={cn(\r\n inputVariants(),\r\n \"h-auto min-h-13 flex flex-wrap items-center gap-1.5 px-3 py-1.5 cursor-text\"\r\n )}\r\n >\r\n {/* Chips inside the input box */}\r\n <ComboboxChips\r\n className={cn(\r\n \"contents\",\r\n maxVisible !== undefined && \"flex-nowrap overflow-hidden\"\r\n )}\r\n >\r\n <ComboboxValue>\r\n {(value: Value[]) => {\r\n const visible = maxVisible !== undefined ? value.slice(0, maxVisible) : value\r\n const overflow = maxVisible !== undefined ? value.length - maxVisible : 0\r\n return (\r\n <>\r\n {visible?.map((item) => (\r\n <ComboboxChipUI\r\n key={item?.value || \"\"}\r\n className={cn(maxVisible !== undefined && \"min-w-0 shrink\")}\r\n >\r\n {item?.image && (\r\n <img\r\n src={item.image}\r\n alt={item?.label || \"\"}\r\n className=\"size-4 rounded-full object-cover shrink-0 mr-1\"\r\n />\r\n )}\r\n {maxVisible !== undefined\r\n ? <span className=\"truncate\">{item?.label || \"\"}</span>\r\n : (item?.label || \"\")\r\n }\r\n <ComboboxChipRemove />\r\n </ComboboxChipUI>\r\n ))}\r\n {overflow > 0 && (\r\n <ComboboxChipUI className=\"shrink-0\">\r\n +{overflow}\r\n </ComboboxChipUI>\r\n )}\r\n </>\r\n )\r\n }}\r\n </ComboboxValue>\r\n {/* Text input — shrinks to fit remaining space (inside Chips so backspace works) */}\r\n <ComboboxInputPrimitive\r\n render={\r\n <input\r\n className=\"flex-1 min-w-[80px] bg-transparent outline-none text-body-regular-1 text-text-primary placeholder:text-text-placeholder\"\r\n placeholder={value.length === 0 ? inputPlaceholder : undefined}\r\n />\r\n }\r\n />\r\n </ComboboxChips>\r\n </ComboboxInputGroup>\r\n\r\n <ComboboxPopup container={container}>\r\n <ComboboxStatus\r\n status={\r\n isPending || items === undefined\r\n ? \"pending\"\r\n : items?.length === 0 && !isCreatingItem\r\n ? \"empty\"\r\n : null\r\n }\r\n />\r\n <ComboboxList>\r\n {items?.map((item) => (\r\n <ComboboxItem\r\n key={item.value}\r\n value={item as Value}\r\n >\r\n <div className=\"flex items-center gap-2 w-full min-w-0\">\r\n {item.image && (\r\n <img\r\n src={item.image}\r\n alt={item.label}\r\n className=\"size-6 rounded-full object-cover shrink-0\"\r\n />\r\n )}\r\n <span className=\"truncate\">{item.label}</span>\r\n </div>\r\n </ComboboxItem>\r\n ))}\r\n {isCreatingItem && (\r\n <ComboboxItem\r\n value={{ label: trimmedInput, value: trimmedInput, tag: true }}\r\n >\r\n <div className=\"flex items-center gap-1.5 w-full min-w-0\">\r\n {!isInputSelected && (\r\n <span className=\"text-text-secondary\">Create:</span>\r\n )}\r\n <span className=\"font-medium text-text-primary truncate\">\r\n {trimmedInput}\r\n </span>\r\n </div>\r\n </ComboboxItem>\r\n )}\r\n <ComboboxInfiniteScroll {...infiniteScroll} />\r\n </ComboboxList>\r\n </ComboboxPopup>\r\n </Combobox>\r\n )\r\n}\r\n\r\nexport { ComboboxChip }\r\nexport type { ComboboxChipProps }\r\n"]}
@@ -0,0 +1,2 @@
1
+ import'react';import {Slider}from'@base-ui/react/slider';import {jsx}from'react/jsx-runtime';function l(r){return jsx(Slider.Root,{"data-slot":"slider",...r})}function a(r){return jsx(Slider.Control,{"data-slot":"slider-control",...r})}function p(r){return jsx(Slider.Track,{"data-slot":"slider-track",...r})}function d(r){return jsx(Slider.Thumb,{"data-slot":"slider-thumb",...r})}function n(r){return jsx(Slider.Indicator,{"data-slot":"slider-indicator",...r})}function s(r){return jsx(Slider.Value,{"data-slot":"slider-value",...r})}export{l as a,a as b,p as c,d,n as e,s as f};//# sourceMappingURL=chunk-TES3PKRE.js.map
2
+ //# sourceMappingURL=chunk-TES3PKRE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/primitives/slider.tsx"],"names":["Slider","props","jsx","SliderPrimitive","Control","Track","Thumb","Indicator","Value"],"mappings":"6FAOA,SAASA,CAAAA,CAAOC,EAA0D,CACxE,OAAOC,IAACC,MAAAA,CAAgB,IAAA,CAAhB,CAAqB,WAAA,CAAU,QAAA,CAAU,GAAGF,CAAAA,CAAO,CAC7D,CAEA,SAASG,CAAAA,CAAQH,CAAAA,CAA6D,CAC5E,OAAOC,GAAAA,CAACC,OAAgB,OAAA,CAAhB,CAAwB,YAAU,gBAAA,CAAkB,GAAGF,EAAO,CACxE,CAEA,SAASI,CAAAA,CAAMJ,CAAAA,CAA2D,CACxE,OAAOC,GAAAA,CAACC,MAAAA,CAAgB,KAAA,CAAhB,CAAsB,WAAA,CAAU,eAAgB,GAAGF,CAAAA,CAAO,CACpE,CAEA,SAASK,EAAML,CAAAA,CAA2D,CACxE,OAAOC,GAAAA,CAACC,MAAAA,CAAgB,MAAhB,CAAsB,WAAA,CAAU,eAAgB,GAAGF,CAAAA,CAAO,CACpE,CAEA,SAASM,CAAAA,CAAUN,CAAAA,CAA+D,CAChF,OAAOC,IAACC,MAAAA,CAAgB,SAAA,CAAhB,CAA0B,WAAA,CAAU,kBAAA,CAAoB,GAAGF,CAAAA,CAAO,CAC5E,CAEA,SAASO,CAAAA,CAAMP,EAA2D,CACxE,OAAOC,IAACC,MAAAA,CAAgB,KAAA,CAAhB,CAAsB,WAAA,CAAU,cAAA,CAAgB,GAAGF,CAAAA,CAAO,CACpE","file":"chunk-TES3PKRE.js","sourcesContent":["'use client'\r\n\r\nimport * as React from 'react'\r\n\r\nimport { Slider as SliderPrimitive } from '@base-ui/react/slider'\r\n\r\n// Lightweight primitive wrappers that add consistent data-slot attributes\r\nfunction Slider(props: React.ComponentProps<typeof SliderPrimitive.Root>) {\r\n return <SliderPrimitive.Root data-slot=\"slider\" {...props} />\r\n}\r\n\r\nfunction Control(props: React.ComponentProps<typeof SliderPrimitive.Control>) {\r\n return <SliderPrimitive.Control data-slot=\"slider-control\" {...props} />\r\n}\r\n\r\nfunction Track(props: React.ComponentProps<typeof SliderPrimitive.Track>) {\r\n return <SliderPrimitive.Track data-slot=\"slider-track\" {...props} />\r\n}\r\n\r\nfunction Thumb(props: React.ComponentProps<typeof SliderPrimitive.Thumb>) {\r\n return <SliderPrimitive.Thumb data-slot=\"slider-thumb\" {...props} />\r\n}\r\n\r\nfunction Indicator(props: React.ComponentProps<typeof SliderPrimitive.Indicator>) {\r\n return <SliderPrimitive.Indicator data-slot=\"slider-indicator\" {...props} />\r\n}\r\n\r\nfunction Value(props: React.ComponentProps<typeof SliderPrimitive.Value>) {\r\n return <SliderPrimitive.Value data-slot=\"slider-value\" {...props} />\r\n}\r\n\r\nexport {\r\n Slider as SliderPrimitive,\r\n Control as SliderControlPrimitive,\r\n Track as SliderTrackPrimitive,\r\n Thumb as SliderThumbPrimitive,\r\n Indicator as SliderIndicatorPrimitive,\r\n Value as SliderValuePrimitive,\r\n}\r\n\r\nexport type {\r\n SliderProps as SliderPrimitiveProps,\r\n SliderControlProps as SliderControlPrimitiveProps,\r\n SliderTrackProps as SliderTrackPrimitiveProps,\r\n SliderThumbProps as SliderThumbPrimitiveProps,\r\n SliderIndicatorProps as SliderIndicatorPrimitiveProps,\r\n SliderValueProps as SliderValuePrimitiveProps,\r\n}\r\n\r\ntype SliderProps = React.ComponentProps<typeof SliderPrimitive.Root>\r\ntype SliderControlProps = React.ComponentProps<typeof SliderPrimitive.Control>\r\ntype SliderTrackProps = React.ComponentProps<typeof SliderPrimitive.Track>\r\ntype SliderThumbProps = React.ComponentProps<typeof SliderPrimitive.Thumb>\r\ntype SliderIndicatorProps = React.ComponentProps<typeof SliderPrimitive.Indicator>\r\ntype SliderValueProps = React.ComponentProps<typeof SliderPrimitive.Value>\r\n"]}
@@ -0,0 +1,2 @@
1
+ import {b}from'./chunk-VNAMAKPG.js';import*as o from'react';import w from'embla-carousel-react';import {ArrowLeft,ArrowRight}from'lucide-react';import {cn}from'@xploreu/lib/cn';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var R=o.createContext(null);function m(){let r=o.useContext(R);if(!r)throw new Error("useCarousel must be used within a <Carousel />");return r}function T({orientation:r="horizontal",opts:a,setApi:t,plugins:l,className:i,children:n,...v}){let[C,e]=w({...a,axis:r==="horizontal"?"x":"y"},l),[c,p]=o.useState(false),[S,h]=o.useState(false),f=o.useCallback(u=>{u&&(p(u.canScrollPrev()),h(u.canScrollNext()));},[]),y=o.useCallback(()=>{e?.scrollPrev();},[e]),P=o.useCallback(()=>{e?.scrollNext();},[e]),g=o.useCallback(u=>{u.key==="ArrowLeft"?(u.preventDefault(),y()):u.key==="ArrowRight"&&(u.preventDefault(),P());},[y,P]);return o.useEffect(()=>{!e||!t||t(e);},[e,t]),o.useEffect(()=>{if(e)return f(e),e.on("reInit",f),e.on("select",f),()=>{e?.off("select",f);}},[e,f]),jsx(R.Provider,{value:{carouselRef:C,api:e,opts:a,orientation:r||(a?.axis==="y"?"vertical":"horizontal"),scrollPrev:y,scrollNext:P,canScrollPrev:c,canScrollNext:S},children:jsx("div",{"aria-roledescription":"carousel",className:cn("relative",i),"data-slot":"carousel",role:"region",onKeyDownCapture:g,...v,children:n})})}function B({className:r,...a}){let{carouselRef:t}=m();return jsx("div",{ref:t,className:"overflow-hidden","data-slot":"carousel-content",children:jsx("div",{className:cn("flex",r),...a})})}function U({className:r,...a}){return jsx("div",{"aria-roledescription":"slide",className:cn("min-w-0 shrink-0 grow-0 basis-full",r),"data-slot":"carousel-item",role:"group",...a})}function L({className:r,children:a,...t}){let{orientation:l,scrollPrev:i,canScrollPrev:n}=m();return jsx(b,{"aria-label":"Previous slide",className:cn("absolute size-9 rounded-full p-0 data-[icon]:size-9 [&_svg]:size-4","transition-all duration-200 hover:scale-105","disabled:cursor-not-allowed disabled:hover:scale-100",l==="horizontal"?"top-1/2 left-6 -translate-y-1/2":"top-6 left-1/2 -translate-x-1/2 rotate-90",r),"data-slot":"carousel-previous",disabled:!n,icon:true,onClick:i,size:"md",variant:"secondary",...t,children:a||jsxs(Fragment,{children:[jsx(ArrowLeft,{}),jsx("span",{className:"sr-only",children:"Previous slide"})]})})}function K({className:r,children:a,...t}){let{orientation:l,scrollNext:i,canScrollNext:n}=m();return jsx(b,{"aria-label":"Next slide",className:cn("absolute size-9 rounded-full p-0 data-[icon]:size-9 [&_svg]:size-4","transition-all duration-200 hover:scale-105","disabled:cursor-not-allowed disabled:hover:scale-100",l==="horizontal"?"top-1/2 right-6 -translate-y-1/2":"bottom-6 left-1/2 -translate-x-1/2 rotate-90",r),"data-slot":"carousel-next",disabled:!n,icon:true,onClick:i,size:"md",variant:"secondary",...t,children:a||jsxs(Fragment,{children:[jsx(ArrowRight,{}),jsx("span",{className:"sr-only",children:"Next slide"})]})})}function _({className:r,...a}){let{api:t}=m(),[l,i]=o.useState(0),[n,v]=o.useState([]),C=o.useCallback(c=>{c&&v(c.scrollSnapList());},[]),e=o.useCallback(c=>{c&&i(c.selectedScrollSnap());},[]);return o.useEffect(()=>{if(t)return C(t),e(t),t.on("reInit",C),t.on("reInit",e),t.on("select",e),()=>{t?.off("select",e);}},[t,C,e]),n.length<=1?null:jsx("div",{className:cn("flex items-center justify-center gap-1.5",r),...a,children:n.map((c,p)=>jsx("button",{"aria-label":`Go to slide ${p+1}`,className:cn("h-1 rounded-full transition-all duration-300",p===l?"w-4 bg-fg-primary":"w-2 bg-fg-tertiary hover:bg-fg-secondary"),"data-selected":p===l,"data-slot":"carousel-dot",onClick:()=>t?.scrollTo(p)},p))})}export{T as a,B as b,U as c,L as d,K as e,_ as f};//# sourceMappingURL=chunk-UBTCCHVI.js.map
2
+ //# sourceMappingURL=chunk-UBTCCHVI.js.map