@mieweb/ui 0.7.3 → 0.8.0-dev.1

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 (355) hide show
  1. package/README.md +45 -24
  2. package/agent/README.md +20 -0
  3. package/agent/init-agent.mjs +61 -0
  4. package/agent/mieweb-ui.instructions.md +169 -0
  5. package/dist/ag-grid.cjs +11 -0
  6. package/dist/ag-grid.cjs.map +1 -1
  7. package/dist/ag-grid.d.cts +4 -0
  8. package/dist/ag-grid.d.ts +4 -0
  9. package/dist/ag-grid.js +11 -0
  10. package/dist/ag-grid.js.map +1 -1
  11. package/dist/brands/index.cjs +12 -12
  12. package/dist/brands/index.js +3 -3
  13. package/dist/{chunk-EGWWTIWS.js → chunk-2AB4PQYL.js} +126 -96
  14. package/dist/chunk-2AB4PQYL.js.map +1 -0
  15. package/dist/{chunk-NQ2D2V6O.cjs → chunk-2PEVRI26.cjs} +37 -37
  16. package/dist/{chunk-NQ2D2V6O.cjs.map → chunk-2PEVRI26.cjs.map} +1 -1
  17. package/dist/{chunk-6J7UGYT5.cjs → chunk-2SSAAE3I.cjs} +49 -9
  18. package/dist/chunk-2SSAAE3I.cjs.map +1 -0
  19. package/dist/chunk-3IMM2PM4.js +259 -0
  20. package/dist/chunk-3IMM2PM4.js.map +1 -0
  21. package/dist/{chunk-SYIFEJSF.cjs → chunk-3RADKLLD.cjs} +13 -13
  22. package/dist/{chunk-SYIFEJSF.cjs.map → chunk-3RADKLLD.cjs.map} +1 -1
  23. package/dist/chunk-3SHLOF4V.cjs +128 -0
  24. package/dist/chunk-3SHLOF4V.cjs.map +1 -0
  25. package/dist/chunk-3TXOFAXP.cjs +139 -0
  26. package/dist/chunk-3TXOFAXP.cjs.map +1 -0
  27. package/dist/{chunk-LJDBD2DD.cjs → chunk-5BPUZK2B.cjs} +386 -4
  28. package/dist/chunk-5BPUZK2B.cjs.map +1 -0
  29. package/dist/chunk-5JZIDILK.cjs +164 -0
  30. package/dist/chunk-5JZIDILK.cjs.map +1 -0
  31. package/dist/chunk-5MXO6PEV.cjs +78 -0
  32. package/dist/chunk-5MXO6PEV.cjs.map +1 -0
  33. package/dist/chunk-5QZ73PZC.js +62 -0
  34. package/dist/chunk-5QZ73PZC.js.map +1 -0
  35. package/dist/chunk-6GKX36JX.js +269 -0
  36. package/dist/chunk-6GKX36JX.js.map +1 -0
  37. package/dist/chunk-6NZXWKUE.js +3 -0
  38. package/dist/chunk-6NZXWKUE.js.map +1 -0
  39. package/dist/chunk-6SCQ7FKT.js +115 -0
  40. package/dist/chunk-6SCQ7FKT.js.map +1 -0
  41. package/dist/{chunk-KFLDXJEE.js → chunk-753Z3NXL.js} +46 -15
  42. package/dist/chunk-753Z3NXL.js.map +1 -0
  43. package/dist/{chunk-S3MKIDYG.cjs → chunk-7AECNMYV.cjs} +46 -15
  44. package/dist/chunk-7AECNMYV.cjs.map +1 -0
  45. package/dist/chunk-7IKLGH3Z.cjs +92 -0
  46. package/dist/chunk-7IKLGH3Z.cjs.map +1 -0
  47. package/dist/chunk-7RV6CAP6.cjs +106 -0
  48. package/dist/chunk-7RV6CAP6.cjs.map +1 -0
  49. package/dist/chunk-AHHFFXJR.cjs +230 -0
  50. package/dist/chunk-AHHFFXJR.cjs.map +1 -0
  51. package/dist/{chunk-HIDV32ZX.js → chunk-AHUYW673.js} +168 -9
  52. package/dist/chunk-AHUYW673.js.map +1 -0
  53. package/dist/{chunk-MYFZYUPR.cjs → chunk-AOHJILLU.cjs} +38 -3
  54. package/dist/chunk-AOHJILLU.cjs.map +1 -0
  55. package/dist/{chunk-DLBV42JD.js → chunk-ATOWMVZH.js} +157 -40
  56. package/dist/chunk-ATOWMVZH.js.map +1 -0
  57. package/dist/{chunk-WUNWHOLA.cjs → chunk-BSDBI6H7.cjs} +116 -26
  58. package/dist/chunk-BSDBI6H7.cjs.map +1 -0
  59. package/dist/chunk-CG4ZKJLE.js +84 -0
  60. package/dist/chunk-CG4ZKJLE.js.map +1 -0
  61. package/dist/{chunk-4PIW3Y5M.js → chunk-DJ4JPFWI.js} +3 -3
  62. package/dist/{chunk-4PIW3Y5M.js.map → chunk-DJ4JPFWI.js.map} +1 -1
  63. package/dist/{chunk-Z4PECE5S.js → chunk-DX64KLSN.js} +2 -2
  64. package/dist/{chunk-Z4PECE5S.js.map → chunk-DX64KLSN.js.map} +1 -1
  65. package/dist/{chunk-FDV7EQWH.js → chunk-EK6DYGFG.js} +3 -3
  66. package/dist/{chunk-FDV7EQWH.js.map → chunk-EK6DYGFG.js.map} +1 -1
  67. package/dist/{chunk-QUUBTNMH.js → chunk-EPSB4WTL.js} +45 -15
  68. package/dist/chunk-EPSB4WTL.js.map +1 -0
  69. package/dist/{chunk-KRGKPUJH.js → chunk-F2S6NV5N.js} +8 -8
  70. package/dist/{chunk-KRGKPUJH.js.map → chunk-F2S6NV5N.js.map} +1 -1
  71. package/dist/chunk-F57VRLKP.js +708 -0
  72. package/dist/chunk-F57VRLKP.js.map +1 -0
  73. package/dist/{chunk-26DPQUSB.cjs → chunk-G52YRAJC.cjs} +4 -4
  74. package/dist/{chunk-26DPQUSB.cjs.map → chunk-G52YRAJC.cjs.map} +1 -1
  75. package/dist/{chunk-5IDYOJHO.cjs → chunk-G7EQ3JPX.cjs} +45 -15
  76. package/dist/chunk-G7EQ3JPX.cjs.map +1 -0
  77. package/dist/{chunk-FKLUSYFP.cjs → chunk-GQVL2JKQ.cjs} +4 -4
  78. package/dist/{chunk-FKLUSYFP.cjs.map → chunk-GQVL2JKQ.cjs.map} +1 -1
  79. package/dist/{chunk-3D4ITDLO.js → chunk-GXODR6V4.js} +3 -3
  80. package/dist/{chunk-3D4ITDLO.js.map → chunk-GXODR6V4.js.map} +1 -1
  81. package/dist/{chunk-AFGADE3B.js → chunk-H3YO5GBM.js} +117 -27
  82. package/dist/chunk-H3YO5GBM.js.map +1 -0
  83. package/dist/chunk-HK3AMH3Q.cjs +151 -0
  84. package/dist/chunk-HK3AMH3Q.cjs.map +1 -0
  85. package/dist/chunk-HQ3XPCHG.js +114 -0
  86. package/dist/chunk-HQ3XPCHG.js.map +1 -0
  87. package/dist/chunk-I44YNYI6.cjs +4 -0
  88. package/dist/chunk-I44YNYI6.cjs.map +1 -0
  89. package/dist/chunk-JHZW3Y62.js +142 -0
  90. package/dist/chunk-JHZW3Y62.js.map +1 -0
  91. package/dist/{chunk-FTRGZOVJ.js → chunk-JQQABHDN.js} +3 -3
  92. package/dist/{chunk-FTRGZOVJ.js.map → chunk-JQQABHDN.js.map} +1 -1
  93. package/dist/chunk-JR4QIU54.cjs +291 -0
  94. package/dist/chunk-JR4QIU54.cjs.map +1 -0
  95. package/dist/{chunk-JDHIBJ5K.cjs → chunk-JWTCEWQ4.cjs} +2 -2
  96. package/dist/{chunk-JDHIBJ5K.cjs.map → chunk-JWTCEWQ4.cjs.map} +1 -1
  97. package/dist/{chunk-ZBI52NP2.cjs → chunk-K5GQPTTA.cjs} +158 -41
  98. package/dist/chunk-K5GQPTTA.cjs.map +1 -0
  99. package/dist/chunk-KFEN2SRZ.js +208 -0
  100. package/dist/chunk-KFEN2SRZ.js.map +1 -0
  101. package/dist/chunk-L6MDULYB.js +87 -0
  102. package/dist/chunk-L6MDULYB.js.map +1 -0
  103. package/dist/{chunk-RYQ3S3KO.cjs → chunk-LDCFNWJC.cjs} +5 -5
  104. package/dist/{chunk-RYQ3S3KO.cjs.map → chunk-LDCFNWJC.cjs.map} +1 -1
  105. package/dist/{chunk-LC7YHZXM.js → chunk-LDQ2T27A.js} +5 -5
  106. package/dist/{chunk-LC7YHZXM.js.map → chunk-LDQ2T27A.js.map} +1 -1
  107. package/dist/chunk-N5O47VGS.cjs +109 -0
  108. package/dist/chunk-N5O47VGS.cjs.map +1 -0
  109. package/dist/chunk-NGSDBWKA.cjs +84 -0
  110. package/dist/chunk-NGSDBWKA.cjs.map +1 -0
  111. package/dist/chunk-NMBYU7D7.cjs +31 -0
  112. package/dist/chunk-NMBYU7D7.cjs.map +1 -0
  113. package/dist/{chunk-SPWVKDGC.cjs → chunk-QMKYJ4AT.cjs} +4 -4
  114. package/dist/{chunk-SPWVKDGC.cjs.map → chunk-QMKYJ4AT.cjs.map} +1 -1
  115. package/dist/{chunk-RBS3GHDZ.cjs → chunk-QOJ4V7YX.cjs} +170 -10
  116. package/dist/chunk-QOJ4V7YX.cjs.map +1 -0
  117. package/dist/chunk-RUGHNFQG.js +28 -0
  118. package/dist/chunk-RUGHNFQG.js.map +1 -0
  119. package/dist/{chunk-P6L74SKG.js → chunk-SVZ4MQVQ.js} +48 -8
  120. package/dist/chunk-SVZ4MQVQ.js.map +1 -0
  121. package/dist/{chunk-URHXR5SC.cjs → chunk-TQZPYDUL.cjs} +7 -7
  122. package/dist/{chunk-URHXR5SC.cjs.map → chunk-TQZPYDUL.cjs.map} +1 -1
  123. package/dist/{chunk-MO65V64I.js → chunk-TXRQQMG5.js} +2 -2
  124. package/dist/{chunk-MO65V64I.js.map → chunk-TXRQQMG5.js.map} +1 -1
  125. package/dist/{chunk-EKRT7K2K.js → chunk-UJS3JTVT.js} +3 -3
  126. package/dist/{chunk-EKRT7K2K.js.map → chunk-UJS3JTVT.js.map} +1 -1
  127. package/dist/{chunk-6MMIWE7H.js → chunk-VQ5HJCTP.js} +386 -4
  128. package/dist/chunk-VQ5HJCTP.js.map +1 -0
  129. package/dist/chunk-WBGUYSWY.js +90 -0
  130. package/dist/chunk-WBGUYSWY.js.map +1 -0
  131. package/dist/{chunk-LJBWCUKP.cjs → chunk-WIYQI35R.cjs} +2 -2
  132. package/dist/{chunk-LJBWCUKP.cjs.map → chunk-WIYQI35R.cjs.map} +1 -1
  133. package/dist/chunk-WKSUL2ZN.js +56 -0
  134. package/dist/chunk-WKSUL2ZN.js.map +1 -0
  135. package/dist/{chunk-BOOJDRJO.js → chunk-WSNMQQ4P.js} +38 -3
  136. package/dist/chunk-WSNMQQ4P.js.map +1 -0
  137. package/dist/chunk-X5ZPYYMS.js +105 -0
  138. package/dist/chunk-X5ZPYYMS.js.map +1 -0
  139. package/dist/{chunk-XB54G7WS.cjs → chunk-XJTFZLWH.cjs} +2 -86
  140. package/dist/chunk-XJTFZLWH.cjs.map +1 -0
  141. package/dist/{chunk-GTHNWP4P.js → chunk-XUVEF2RQ.js} +4 -87
  142. package/dist/chunk-XUVEF2RQ.js.map +1 -0
  143. package/dist/chunk-Y6YSJPVC.js +129 -0
  144. package/dist/chunk-Y6YSJPVC.js.map +1 -0
  145. package/dist/{chunk-OAHORW4N.cjs → chunk-YRLCR76L.cjs} +129 -99
  146. package/dist/chunk-YRLCR76L.cjs.map +1 -0
  147. package/dist/chunk-YVIH26FG.cjs +736 -0
  148. package/dist/chunk-YVIH26FG.cjs.map +1 -0
  149. package/dist/chunk-Z5S5JEJD.cjs +286 -0
  150. package/dist/chunk-Z5S5JEJD.cjs.map +1 -0
  151. package/dist/chunk-ZO4L6C2Y.cjs +137 -0
  152. package/dist/chunk-ZO4L6C2Y.cjs.map +1 -0
  153. package/dist/{collabKit-QZL4P5T5.js → collabKit-A643VH2I.js} +7 -3
  154. package/dist/collabKit-A643VH2I.js.map +1 -0
  155. package/dist/{collabKit-UF7E6V3N.cjs → collabKit-Q4A36LDA.cjs} +7 -3
  156. package/dist/collabKit-Q4A36LDA.cjs.map +1 -0
  157. package/dist/components/Accordion/index.cjs +13 -0
  158. package/dist/components/Accordion/index.cjs.map +1 -0
  159. package/dist/components/Accordion/index.d.cts +50 -0
  160. package/dist/components/Accordion/index.d.ts +50 -0
  161. package/dist/components/Accordion/index.js +4 -0
  162. package/dist/components/Accordion/index.js.map +1 -0
  163. package/dist/components/Alert/index.d.cts +1 -1
  164. package/dist/components/Alert/index.d.ts +1 -1
  165. package/dist/components/Autocomplete/index.cjs +5 -4
  166. package/dist/components/Autocomplete/index.d.cts +20 -3
  167. package/dist/components/Autocomplete/index.d.ts +20 -3
  168. package/dist/components/Autocomplete/index.js +4 -3
  169. package/dist/components/Badge/index.d.cts +1 -1
  170. package/dist/components/Badge/index.d.ts +1 -1
  171. package/dist/components/Card/index.d.cts +1 -1
  172. package/dist/components/Card/index.d.ts +1 -1
  173. package/dist/components/Checkbox/index.cjs +5 -4
  174. package/dist/components/Checkbox/index.d.cts +9 -1
  175. package/dist/components/Checkbox/index.d.ts +9 -1
  176. package/dist/components/Checkbox/index.js +2 -1
  177. package/dist/components/ClampedText/index.cjs +13 -0
  178. package/dist/components/ClampedText/index.cjs.map +1 -0
  179. package/dist/components/ClampedText/index.d.cts +33 -0
  180. package/dist/components/ClampedText/index.d.ts +33 -0
  181. package/dist/components/ClampedText/index.js +4 -0
  182. package/dist/components/ClampedText/index.js.map +1 -0
  183. package/dist/components/CopyButton/index.cjs +13 -0
  184. package/dist/components/CopyButton/index.cjs.map +1 -0
  185. package/dist/components/CopyButton/index.d.cts +29 -0
  186. package/dist/components/CopyButton/index.d.ts +29 -0
  187. package/dist/components/CopyButton/index.js +4 -0
  188. package/dist/components/CopyButton/index.js.map +1 -0
  189. package/dist/components/CountryCodeDropdown/index.cjs +5 -5
  190. package/dist/components/CountryCodeDropdown/index.js +2 -2
  191. package/dist/components/CustomizableDashboard/index.cjs +43 -0
  192. package/dist/components/CustomizableDashboard/index.cjs.map +1 -0
  193. package/dist/components/CustomizableDashboard/index.d.cts +195 -0
  194. package/dist/components/CustomizableDashboard/index.d.ts +195 -0
  195. package/dist/components/CustomizableDashboard/index.js +10 -0
  196. package/dist/components/CustomizableDashboard/index.js.map +1 -0
  197. package/dist/components/DateInput/index.cjs +5 -4
  198. package/dist/components/DateInput/index.d.cts +1 -0
  199. package/dist/components/DateInput/index.d.ts +1 -0
  200. package/dist/components/DateInput/index.js +4 -3
  201. package/dist/components/Dropdown/index.cjs +14 -9
  202. package/dist/components/Dropdown/index.d.cts +38 -2
  203. package/dist/components/Dropdown/index.d.ts +38 -2
  204. package/dist/components/Dropdown/index.js +4 -3
  205. package/dist/components/FilterSummaryBar/index.cjs +13 -0
  206. package/dist/components/FilterSummaryBar/index.cjs.map +1 -0
  207. package/dist/components/FilterSummaryBar/index.d.cts +53 -0
  208. package/dist/components/FilterSummaryBar/index.d.ts +53 -0
  209. package/dist/components/FilterSummaryBar/index.js +4 -0
  210. package/dist/components/FilterSummaryBar/index.js.map +1 -0
  211. package/dist/components/FreshnessBadge/index.cjs +25 -0
  212. package/dist/components/FreshnessBadge/index.cjs.map +1 -0
  213. package/dist/components/FreshnessBadge/index.d.cts +49 -0
  214. package/dist/components/FreshnessBadge/index.d.ts +49 -0
  215. package/dist/components/FreshnessBadge/index.js +4 -0
  216. package/dist/components/FreshnessBadge/index.js.map +1 -0
  217. package/dist/components/GlossaryTooltip/index.cjs +15 -0
  218. package/dist/components/GlossaryTooltip/index.cjs.map +1 -0
  219. package/dist/components/GlossaryTooltip/index.d.cts +64 -0
  220. package/dist/components/GlossaryTooltip/index.d.ts +64 -0
  221. package/dist/components/GlossaryTooltip/index.js +6 -0
  222. package/dist/components/GlossaryTooltip/index.js.map +1 -0
  223. package/dist/components/Input/index.cjs +20 -3
  224. package/dist/components/Input/index.d.cts +37 -2
  225. package/dist/components/Input/index.d.ts +37 -2
  226. package/dist/components/Input/index.js +2 -1
  227. package/dist/components/KeyboardShortcutsOverlay/index.cjs +21 -0
  228. package/dist/components/KeyboardShortcutsOverlay/index.cjs.map +1 -0
  229. package/dist/components/KeyboardShortcutsOverlay/index.d.cts +54 -0
  230. package/dist/components/KeyboardShortcutsOverlay/index.d.ts +54 -0
  231. package/dist/components/KeyboardShortcutsOverlay/index.js +8 -0
  232. package/dist/components/KeyboardShortcutsOverlay/index.js.map +1 -0
  233. package/dist/components/Markdown/index.cjs +10 -10
  234. package/dist/components/Markdown/index.js +2 -2
  235. package/dist/components/MediaEditor/index.cjs +11 -10
  236. package/dist/components/MediaEditor/index.js +6 -5
  237. package/dist/components/PhoneInput/index.cjs +5 -4
  238. package/dist/components/PhoneInput/index.js +3 -2
  239. package/dist/components/Progress/index.d.cts +1 -1
  240. package/dist/components/Progress/index.d.ts +1 -1
  241. package/dist/components/Radio/index.cjs +5 -4
  242. package/dist/components/Radio/index.d.cts +9 -1
  243. package/dist/components/Radio/index.d.ts +9 -1
  244. package/dist/components/Radio/index.js +2 -1
  245. package/dist/components/ReadingProgressBar/index.cjs +13 -0
  246. package/dist/components/ReadingProgressBar/index.cjs.map +1 -0
  247. package/dist/components/ReadingProgressBar/index.d.cts +20 -0
  248. package/dist/components/ReadingProgressBar/index.d.ts +20 -0
  249. package/dist/components/ReadingProgressBar/index.js +4 -0
  250. package/dist/components/ReadingProgressBar/index.js.map +1 -0
  251. package/dist/components/RichTextEditor/index.cjs +8 -7
  252. package/dist/components/RichTextEditor/index.js +5 -4
  253. package/dist/components/SectionSpyNav/index.cjs +15 -0
  254. package/dist/components/SectionSpyNav/index.cjs.map +1 -0
  255. package/dist/components/SectionSpyNav/index.d.cts +63 -0
  256. package/dist/components/SectionSpyNav/index.d.ts +63 -0
  257. package/dist/components/SectionSpyNav/index.js +6 -0
  258. package/dist/components/SectionSpyNav/index.js.map +1 -0
  259. package/dist/components/Select/index.cjs +6 -4
  260. package/dist/components/Select/index.d.cts +56 -9
  261. package/dist/components/Select/index.d.ts +56 -9
  262. package/dist/components/Select/index.js +4 -2
  263. package/dist/components/Slider/index.d.cts +2 -2
  264. package/dist/components/Slider/index.d.ts +2 -2
  265. package/dist/components/SourceTip/index.cjs +15 -0
  266. package/dist/components/SourceTip/index.cjs.map +1 -0
  267. package/dist/components/SourceTip/index.d.cts +58 -0
  268. package/dist/components/SourceTip/index.d.ts +58 -0
  269. package/dist/components/SourceTip/index.js +6 -0
  270. package/dist/components/SourceTip/index.js.map +1 -0
  271. package/dist/components/Sparkline/index.cjs +13 -0
  272. package/dist/components/Sparkline/index.cjs.map +1 -0
  273. package/dist/components/Sparkline/index.d.cts +53 -0
  274. package/dist/components/Sparkline/index.d.ts +53 -0
  275. package/dist/components/Sparkline/index.js +4 -0
  276. package/dist/components/Sparkline/index.js.map +1 -0
  277. package/dist/components/Spinner/index.d.cts +1 -1
  278. package/dist/components/Spinner/index.d.ts +1 -1
  279. package/dist/components/SuperChat/index.cjs +252 -93
  280. package/dist/components/SuperChat/index.cjs.map +1 -1
  281. package/dist/components/SuperChat/index.d.cts +13 -5
  282. package/dist/components/SuperChat/index.d.ts +13 -5
  283. package/dist/components/SuperChat/index.js +249 -90
  284. package/dist/components/SuperChat/index.js.map +1 -1
  285. package/dist/components/SuperChat/plugins/index.cjs +6 -26
  286. package/dist/components/SuperChat/plugins/index.cjs.map +1 -1
  287. package/dist/components/SuperChat/plugins/index.d.cts +2 -2
  288. package/dist/components/SuperChat/plugins/index.d.ts +2 -2
  289. package/dist/components/SuperChat/plugins/index.js +4 -24
  290. package/dist/components/SuperChat/plugins/index.js.map +1 -1
  291. package/dist/components/Text/index.d.cts +1 -1
  292. package/dist/components/Text/index.d.ts +1 -1
  293. package/dist/components/Textarea/index.cjs +5 -3
  294. package/dist/components/Textarea/index.d.cts +19 -1
  295. package/dist/components/Textarea/index.d.ts +19 -1
  296. package/dist/components/Textarea/index.js +3 -1
  297. package/dist/datavis.cjs +1 -1
  298. package/dist/datavis.js +1 -1
  299. package/dist/esheet.cjs +12 -11
  300. package/dist/esheet.cjs.map +1 -1
  301. package/dist/esheet.js +9 -8
  302. package/dist/esheet.js.map +1 -1
  303. package/dist/hooks/index.cjs +29 -19
  304. package/dist/hooks/index.d.cts +17 -2
  305. package/dist/hooks/index.d.ts +17 -2
  306. package/dist/hooks/index.js +4 -2
  307. package/dist/index.cjs +2965 -2043
  308. package/dist/index.cjs.map +1 -1
  309. package/dist/index.d.cts +193 -48
  310. package/dist/index.d.ts +193 -48
  311. package/dist/index.js +2135 -1330
  312. package/dist/index.js.map +1 -1
  313. package/dist/kerebron.cjs +200 -68
  314. package/dist/kerebron.cjs.map +1 -1
  315. package/dist/kerebron.css +129 -0
  316. package/dist/kerebron.d.cts +52 -3
  317. package/dist/kerebron.d.ts +52 -3
  318. package/dist/kerebron.js +201 -69
  319. package/dist/kerebron.js.map +1 -1
  320. package/dist/styles.css +1 -1
  321. package/dist/tailwind-preset.cjs +4 -4
  322. package/dist/tailwind-preset.js +1 -1
  323. package/dist/{types-BoTeTPdH.d.ts → types-9vK_YdEb.d.ts} +12 -1
  324. package/dist/{types-DyIB9HYT.d.cts → types-DZDroUW8.d.cts} +12 -1
  325. package/dist/{useAnchoredPosition-C7PNglzD.d.cts → useAnchoredPosition-CKwLSQW8.d.cts} +10 -3
  326. package/dist/{useAnchoredPosition-C7PNglzD.d.ts → useAnchoredPosition-CKwLSQW8.d.ts} +10 -3
  327. package/dist/utils/index.cjs +9 -9
  328. package/dist/utils/index.js +1 -1
  329. package/package.json +13 -4
  330. package/dist/chunk-5IDYOJHO.cjs.map +0 -1
  331. package/dist/chunk-6ECKH4DJ.cjs +0 -147
  332. package/dist/chunk-6ECKH4DJ.cjs.map +0 -1
  333. package/dist/chunk-6J7UGYT5.cjs.map +0 -1
  334. package/dist/chunk-6MMIWE7H.js.map +0 -1
  335. package/dist/chunk-AFGADE3B.js.map +0 -1
  336. package/dist/chunk-BOOJDRJO.js.map +0 -1
  337. package/dist/chunk-DLBV42JD.js.map +0 -1
  338. package/dist/chunk-EGWWTIWS.js.map +0 -1
  339. package/dist/chunk-GTHNWP4P.js.map +0 -1
  340. package/dist/chunk-HIDV32ZX.js.map +0 -1
  341. package/dist/chunk-KFLDXJEE.js.map +0 -1
  342. package/dist/chunk-LJDBD2DD.cjs.map +0 -1
  343. package/dist/chunk-MYFZYUPR.cjs.map +0 -1
  344. package/dist/chunk-OAHORW4N.cjs.map +0 -1
  345. package/dist/chunk-P6L74SKG.js.map +0 -1
  346. package/dist/chunk-QUUBTNMH.js.map +0 -1
  347. package/dist/chunk-RBS3GHDZ.cjs.map +0 -1
  348. package/dist/chunk-S3MKIDYG.cjs.map +0 -1
  349. package/dist/chunk-WUNWHOLA.cjs.map +0 -1
  350. package/dist/chunk-XB54G7WS.cjs.map +0 -1
  351. package/dist/chunk-YXCE2HSK.js +0 -124
  352. package/dist/chunk-YXCE2HSK.js.map +0 -1
  353. package/dist/chunk-ZBI52NP2.cjs.map +0 -1
  354. package/dist/collabKit-QZL4P5T5.js.map +0 -1
  355. package/dist/collabKit-UF7E6V3N.cjs.map +0 -1
@@ -0,0 +1,736 @@
1
+ 'use strict';
2
+
3
+ var chunkPLMXN23Q_cjs = require('./chunk-PLMXN23Q.cjs');
4
+ var chunkRS5VA6QU_cjs = require('./chunk-RS5VA6QU.cjs');
5
+ var chunkRDGRKYQ5_cjs = require('./chunk-RDGRKYQ5.cjs');
6
+ var chunkS5RVSXDV_cjs = require('./chunk-S5RVSXDV.cjs');
7
+ var React2 = require('react');
8
+ var reactDom = require('react-dom');
9
+ var core = require('@dnd-kit/core');
10
+ var sortable = require('@dnd-kit/sortable');
11
+ var utilities = require('@dnd-kit/utilities');
12
+ var lucideReact = require('lucide-react');
13
+ var jsxRuntime = require('react/jsx-runtime');
14
+
15
+ function _interopNamespace(e) {
16
+ if (e && e.__esModule) return e;
17
+ var n = Object.create(null);
18
+ if (e) {
19
+ Object.keys(e).forEach(function (k) {
20
+ if (k !== 'default') {
21
+ var d = Object.getOwnPropertyDescriptor(e, k);
22
+ Object.defineProperty(n, k, d.get ? d : {
23
+ enumerable: true,
24
+ get: function () { return e[k]; }
25
+ });
26
+ }
27
+ });
28
+ }
29
+ n.default = e;
30
+ return Object.freeze(n);
31
+ }
32
+
33
+ var React2__namespace = /*#__PURE__*/_interopNamespace(React2);
34
+
35
+ function DashboardCustomizePanel({
36
+ open,
37
+ onOpenChange,
38
+ widgets,
39
+ hiddenIds,
40
+ onToggleWidget,
41
+ onReset,
42
+ title = "Customize dashboard",
43
+ description = "Choose which widgets appear on this dashboard. Drag a widget by its handle to rearrange it."
44
+ }) {
45
+ const hidden = React2__namespace.useMemo(() => new Set(hiddenIds), [hiddenIds]);
46
+ const groups = React2__namespace.useMemo(() => {
47
+ const map = /* @__PURE__ */ new Map();
48
+ for (const w of widgets) {
49
+ const key = w.category ?? "";
50
+ const list = map.get(key);
51
+ if (list) list.push(w);
52
+ else map.set(key, [w]);
53
+ }
54
+ return Array.from(map.entries());
55
+ }, [widgets]);
56
+ const visibleCount = widgets.length - hidden.size;
57
+ return /* @__PURE__ */ jsxRuntime.jsxs(
58
+ chunkRS5VA6QU_cjs.Sheet,
59
+ {
60
+ open,
61
+ onOpenChange,
62
+ side: "end",
63
+ "aria-label": title,
64
+ children: [
65
+ /* @__PURE__ */ jsxRuntime.jsx(chunkRS5VA6QU_cjs.SheetHeader, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1.5", children: [
66
+ /* @__PURE__ */ jsxRuntime.jsx(chunkRS5VA6QU_cjs.SheetTitle, { children: title }),
67
+ /* @__PURE__ */ jsxRuntime.jsx(chunkRS5VA6QU_cjs.SheetDescription, { children: description })
68
+ ] }) }),
69
+ /* @__PURE__ */ jsxRuntime.jsxs(chunkRS5VA6QU_cjs.SheetBody, { className: "flex flex-col gap-5", children: [
70
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-muted-foreground text-xs font-medium", children: [
71
+ visibleCount,
72
+ " of ",
73
+ widgets.length,
74
+ " widgets shown"
75
+ ] }),
76
+ groups.map(([category, items]) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [
77
+ category && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-muted-foreground pb-1 text-xs font-semibold tracking-wide uppercase", children: category }),
78
+ /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "flex list-none flex-col gap-1 p-0", children: items.map((widget) => {
79
+ const isVisible = !hidden.has(widget.id);
80
+ return /* @__PURE__ */ jsxRuntime.jsxs(
81
+ "li",
82
+ {
83
+ className: chunkS5RVSXDV_cjs.cn(
84
+ "border-border flex items-center gap-3 rounded-lg border p-3 transition-colors",
85
+ isVisible ? "bg-card" : "bg-muted/50"
86
+ ),
87
+ children: [
88
+ widget.icon && /* @__PURE__ */ jsxRuntime.jsx(
89
+ "span",
90
+ {
91
+ className: chunkS5RVSXDV_cjs.cn(
92
+ "shrink-0",
93
+ isVisible ? "text-primary-600 dark:text-primary-400" : "text-muted-foreground"
94
+ ),
95
+ children: widget.icon
96
+ }
97
+ ),
98
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 flex-1 flex-col", children: [
99
+ /* @__PURE__ */ jsxRuntime.jsx(
100
+ "span",
101
+ {
102
+ className: chunkS5RVSXDV_cjs.cn(
103
+ "truncate text-sm font-medium",
104
+ isVisible ? "text-foreground" : "text-muted-foreground"
105
+ ),
106
+ children: widget.title
107
+ }
108
+ ),
109
+ widget.description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground truncate text-xs", children: widget.description })
110
+ ] }),
111
+ /* @__PURE__ */ jsxRuntime.jsx(
112
+ chunkPLMXN23Q_cjs.Switch,
113
+ {
114
+ checked: isVisible,
115
+ onCheckedChange: (checked) => onToggleWidget(widget.id, checked),
116
+ "aria-label": `Show ${widget.title}`
117
+ }
118
+ )
119
+ ]
120
+ },
121
+ widget.id
122
+ );
123
+ }) })
124
+ ] }, category || "general"))
125
+ ] }),
126
+ onReset && /* @__PURE__ */ jsxRuntime.jsx(chunkRS5VA6QU_cjs.SheetFooter, { children: /* @__PURE__ */ jsxRuntime.jsx(
127
+ chunkRDGRKYQ5_cjs.Button,
128
+ {
129
+ variant: "outline",
130
+ size: "sm",
131
+ onClick: onReset,
132
+ leftIcon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RotateCcw, { "aria-hidden": "true", className: "h-4 w-4" }),
133
+ children: "Reset layout"
134
+ }
135
+ ) })
136
+ ]
137
+ }
138
+ );
139
+ }
140
+ var COL_IDS = ["column-0", "column-1", "column-2"];
141
+ var DEFAULT_HANDLE_SELECTOR = '[data-slot="dashboard-widget-header"]';
142
+ var HEADER_LAYOUT_CLASSES = [
143
+ "flex",
144
+ "flex-row",
145
+ "flex-nowrap",
146
+ "items-center",
147
+ "[&>:nth-child(2)]:ms-auto"
148
+ ];
149
+ function orderStorageKey(base) {
150
+ return `${base}-portlet-order`;
151
+ }
152
+ function layoutStorageKey(base) {
153
+ return `${base}-dashboard-layout`;
154
+ }
155
+ function hiddenStorageKey(base) {
156
+ return `${base}-dashboard-hidden`;
157
+ }
158
+ function loadHidden(base) {
159
+ if (!base) return null;
160
+ try {
161
+ const raw = localStorage.getItem(hiddenStorageKey(base));
162
+ const parsed = raw ? JSON.parse(raw) : null;
163
+ return Array.isArray(parsed) ? parsed.filter((v) => typeof v === "string") : null;
164
+ } catch {
165
+ return null;
166
+ }
167
+ }
168
+ function saveHidden(base, ids) {
169
+ if (!base) return;
170
+ try {
171
+ localStorage.setItem(hiddenStorageKey(base), JSON.stringify(ids));
172
+ } catch {
173
+ }
174
+ }
175
+ function loadLayout(base) {
176
+ if (!base) return null;
177
+ try {
178
+ const raw = localStorage.getItem(layoutStorageKey(base));
179
+ const val = raw ? Number(raw) : null;
180
+ return val === 1 || val === 2 || val === 3 ? val : null;
181
+ } catch {
182
+ return null;
183
+ }
184
+ }
185
+ function saveLayout(base, mode) {
186
+ if (!base) return;
187
+ try {
188
+ localStorage.setItem(layoutStorageKey(base), String(mode));
189
+ } catch {
190
+ }
191
+ }
192
+ function sanitizeSlot(value) {
193
+ return Array.isArray(value) ? value.filter((v) => typeof v === "string") : [];
194
+ }
195
+ function loadOrder(base) {
196
+ if (!base) return null;
197
+ try {
198
+ const raw = localStorage.getItem(orderStorageKey(base));
199
+ if (!raw) return null;
200
+ const parsed = JSON.parse(raw);
201
+ return [
202
+ sanitizeSlot(parsed[0]),
203
+ sanitizeSlot(parsed[1]),
204
+ sanitizeSlot(parsed[2])
205
+ ];
206
+ } catch {
207
+ return null;
208
+ }
209
+ }
210
+ function saveOrder(base, order) {
211
+ if (!base) return;
212
+ try {
213
+ const record = {};
214
+ order.forEach((ids, i) => {
215
+ record[i] = ids;
216
+ });
217
+ localStorage.setItem(orderStorageKey(base), JSON.stringify(record));
218
+ } catch {
219
+ }
220
+ }
221
+ function mergeColumnOrder(columns, saved) {
222
+ const allIds = new Set(
223
+ [...columns[0], ...columns[1], ...columns[2]].map((p) => p.id)
224
+ );
225
+ const result = [[], [], []];
226
+ const placed = /* @__PURE__ */ new Set();
227
+ for (let i = 0; i < 3; i++) {
228
+ for (const id of saved?.[i] ?? []) {
229
+ if (allIds.has(id) && !placed.has(id)) {
230
+ result[i].push(id);
231
+ placed.add(id);
232
+ }
233
+ }
234
+ }
235
+ for (let i = 0; i < 3; i++) {
236
+ for (const item of columns[i]) {
237
+ if (!placed.has(item.id)) {
238
+ result[i].push(item.id);
239
+ placed.add(item.id);
240
+ }
241
+ }
242
+ }
243
+ return result;
244
+ }
245
+ function buildItemMap(columns) {
246
+ const map = /* @__PURE__ */ new Map();
247
+ for (const col of columns) {
248
+ for (const item of col) map.set(item.id, item);
249
+ }
250
+ return map;
251
+ }
252
+ function findColumn(colOrder, itemId) {
253
+ return colOrder.findIndex((ids) => ids.includes(itemId));
254
+ }
255
+ function moveAcrossColumns(order, activeId, overId) {
256
+ const colIdx = COL_IDS.indexOf(overId);
257
+ const sourceCol = findColumn(order, activeId);
258
+ if (sourceCol === -1) return order;
259
+ const targetCol = colIdx !== -1 ? colIdx : findColumn(order, overId);
260
+ if (targetCol === -1 || sourceCol === targetCol) return order;
261
+ const next = order.map((col) => [...col]);
262
+ next[sourceCol] = next[sourceCol].filter((id) => id !== activeId);
263
+ const overIdx = colIdx !== -1 ? -1 : next[targetCol].indexOf(overId);
264
+ if (overIdx === -1) {
265
+ next[targetCol].push(activeId);
266
+ } else {
267
+ next[targetCol].splice(overIdx, 0, activeId);
268
+ }
269
+ return next;
270
+ }
271
+ function reorderOnDrop(order, activeId, overId, crossedColumns) {
272
+ const isColumnTarget = COL_IDS.indexOf(overId) !== -1;
273
+ if (isColumnTarget || overId === activeId) return order;
274
+ const col = findColumn(order, activeId);
275
+ if (col === -1 || findColumn(order, overId) !== col) return order;
276
+ const oldIdx = order[col].indexOf(activeId);
277
+ const newIdx = order[col].indexOf(overId);
278
+ if (oldIdx === -1 || newIdx === -1) return order;
279
+ if (crossedColumns && newIdx === oldIdx + 1) return order;
280
+ const next = order.map((c) => [...c]);
281
+ next[col] = sortable.arrayMove(next[col], oldIdx, newIdx);
282
+ return next;
283
+ }
284
+ function consolidateColumns(order, mode) {
285
+ if (mode >= 3 || requiredColumns(order) <= mode) return order;
286
+ if (mode === 1) return [[...order[0], ...order[1], ...order[2]], [], []];
287
+ return [[...order[0]], [...order[1], ...order[2]], []];
288
+ }
289
+ function requiredColumns(order) {
290
+ return Math.max(
291
+ 1,
292
+ ...order.map((ids, i) => ids.length > 0 ? i + 1 : 0)
293
+ );
294
+ }
295
+ var collisionDetection = (args) => {
296
+ const pw = core.pointerWithin(args);
297
+ if (pw.length > 0) return pw;
298
+ const cc = core.closestCenter(args);
299
+ if (cc.length > 0) return cc;
300
+ return core.rectIntersection(args);
301
+ };
302
+ function SortablePortlet({
303
+ id,
304
+ handleSelector,
305
+ children
306
+ }) {
307
+ const {
308
+ attributes,
309
+ listeners,
310
+ setNodeRef,
311
+ transform,
312
+ transition,
313
+ isDragging
314
+ } = sortable.useSortable({ id });
315
+ const wrapperRef = React2__namespace.useRef(null);
316
+ const [headerEl, setHeaderEl] = React2__namespace.useState(null);
317
+ const [searched, setSearched] = React2__namespace.useState(false);
318
+ const style = {
319
+ transform: utilities.CSS.Transform.toString(transform),
320
+ transition,
321
+ opacity: isDragging ? 0.4 : 1
322
+ };
323
+ React2__namespace.useEffect(() => {
324
+ const container = wrapperRef.current;
325
+ if (!container) return;
326
+ let rafId = 0;
327
+ const findHeader = () => {
328
+ const header = container.querySelector(handleSelector);
329
+ if (header instanceof HTMLElement) {
330
+ header.classList.add(...HEADER_LAYOUT_CLASSES);
331
+ setHeaderEl(header);
332
+ observer.disconnect();
333
+ } else {
334
+ setHeaderEl(null);
335
+ }
336
+ setSearched(true);
337
+ };
338
+ const observer = new MutationObserver(() => {
339
+ cancelAnimationFrame(rafId);
340
+ rafId = requestAnimationFrame(findHeader);
341
+ });
342
+ findHeader();
343
+ observer.observe(container, { childList: true, subtree: true });
344
+ return () => {
345
+ cancelAnimationFrame(rafId);
346
+ observer.disconnect();
347
+ };
348
+ }, [handleSelector]);
349
+ const handle = /* @__PURE__ */ jsxRuntime.jsx(
350
+ "button",
351
+ {
352
+ type: "button",
353
+ className: chunkS5RVSXDV_cjs.cn(
354
+ "inline-flex h-7 w-6 shrink-0 cursor-grab touch-none items-center justify-center rounded border-none bg-transparent",
355
+ "text-muted-foreground hover:bg-muted hover:text-foreground active:cursor-grabbing",
356
+ "opacity-40 transition-opacity group-hover/portlet:opacity-100 focus-visible:opacity-100",
357
+ "[@media(hover:none)]:opacity-100",
358
+ !headerEl && "bg-card/80 absolute end-2 top-2 z-10 shadow-sm"
359
+ ),
360
+ "aria-label": "Drag to reorder",
361
+ ...attributes,
362
+ ...listeners,
363
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.GripVertical, { "aria-hidden": "true", className: "h-4 w-4" })
364
+ }
365
+ );
366
+ return /* @__PURE__ */ jsxRuntime.jsxs(
367
+ "div",
368
+ {
369
+ ref: (node) => {
370
+ setNodeRef(node);
371
+ wrapperRef.current = node;
372
+ },
373
+ style,
374
+ className: "group/portlet relative min-w-0",
375
+ children: [
376
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full min-w-0", children }),
377
+ headerEl ? reactDom.createPortal(handle, headerEl) : searched ? handle : null
378
+ ]
379
+ }
380
+ );
381
+ }
382
+ function DroppableColumn({
383
+ id,
384
+ items,
385
+ columnIndex,
386
+ handleSelector,
387
+ flatten,
388
+ dragActive
389
+ }) {
390
+ const { setNodeRef, isOver } = core.useDroppable({ id });
391
+ const ids = items.map((p) => p.id);
392
+ return /* @__PURE__ */ jsxRuntime.jsx(sortable.SortableContext, { items: ids, strategy: sortable.verticalListSortingStrategy, children: /* @__PURE__ */ jsxRuntime.jsxs(
393
+ "div",
394
+ {
395
+ ref: setNodeRef,
396
+ className: chunkS5RVSXDV_cjs.cn(
397
+ "flex min-h-16 min-w-0 flex-col gap-3",
398
+ flatten && "max-lg:contents"
399
+ ),
400
+ role: "group",
401
+ "aria-label": `Dashboard column ${columnIndex + 1}`,
402
+ children: [
403
+ items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
404
+ SortablePortlet,
405
+ {
406
+ id: item.id,
407
+ handleSelector,
408
+ children: item.node
409
+ },
410
+ item.id
411
+ )),
412
+ items.length === 0 && dragActive && /* @__PURE__ */ jsxRuntime.jsx(
413
+ "div",
414
+ {
415
+ "aria-hidden": "true",
416
+ className: chunkS5RVSXDV_cjs.cn(
417
+ "border-border text-muted-foreground flex min-h-32 items-center justify-center rounded-lg border-2 border-dashed text-sm font-medium transition-colors",
418
+ isOver && "border-primary-500 bg-primary-500/10 text-primary-600"
419
+ ),
420
+ children: "Drop here"
421
+ }
422
+ )
423
+ ]
424
+ }
425
+ ) });
426
+ }
427
+ var CustomizableDashboard = React2__namespace.forwardRef(function CustomizableDashboard2({
428
+ columns,
429
+ title,
430
+ storageKey,
431
+ ariaLabel,
432
+ toolbarSlot,
433
+ defaultOrder,
434
+ order: controlledOrder,
435
+ onOrderChange,
436
+ defaultLayout = 3,
437
+ layout: controlledLayout,
438
+ onLayoutChange,
439
+ dragHandleSelector = DEFAULT_HANDLE_SELECTOR,
440
+ widgets,
441
+ defaultHiddenIds,
442
+ hiddenIds: controlledHidden,
443
+ onHiddenChange,
444
+ customizeLabel = "Customize",
445
+ className
446
+ }, ref) {
447
+ const itemMap = React2__namespace.useMemo(() => buildItemMap(columns), [columns]);
448
+ const [internalLayout, setInternalLayout] = React2__namespace.useState(defaultLayout);
449
+ const layoutMode = controlledLayout ?? internalLayout;
450
+ const [colOrder, setColOrder] = React2__namespace.useState(
451
+ () => consolidateColumns(
452
+ mergeColumnOrder(columns, controlledOrder ?? defaultOrder ?? null),
453
+ controlledLayout ?? defaultLayout
454
+ )
455
+ );
456
+ const [activeId, setActiveId] = React2__namespace.useState(null);
457
+ const [internalHidden, setInternalHidden] = React2__namespace.useState(
458
+ () => defaultHiddenIds ?? []
459
+ );
460
+ const hiddenList = controlledHidden ?? internalHidden;
461
+ const hiddenSet = React2__namespace.useMemo(() => new Set(hiddenList), [hiddenList]);
462
+ const [panelOpen, setPanelOpen] = React2__namespace.useState(false);
463
+ const prevColOrder = React2__namespace.useRef(colOrder);
464
+ const layoutModeRef = React2__namespace.useRef(layoutMode);
465
+ layoutModeRef.current = layoutMode;
466
+ const colOrderRef = React2__namespace.useRef(colOrder);
467
+ colOrderRef.current = colOrder;
468
+ const columnsRef = React2__namespace.useRef(columns);
469
+ columnsRef.current = columns;
470
+ const draggingRef = React2__namespace.useRef(false);
471
+ React2__namespace.useEffect(() => {
472
+ if (!storageKey) return;
473
+ if (controlledLayout === void 0) {
474
+ const savedLayout = loadLayout(storageKey);
475
+ if (savedLayout !== null) setInternalLayout(savedLayout);
476
+ }
477
+ if (controlledOrder === void 0) {
478
+ const savedOrder = loadOrder(storageKey);
479
+ if (savedOrder) {
480
+ setColOrder(mergeColumnOrder(columnsRef.current, savedOrder));
481
+ }
482
+ }
483
+ if (controlledHidden === void 0) {
484
+ const savedHidden = loadHidden(storageKey);
485
+ if (savedHidden) setInternalHidden(savedHidden);
486
+ }
487
+ }, [storageKey]);
488
+ React2__namespace.useEffect(() => {
489
+ if (draggingRef.current) return;
490
+ setColOrder((prev) => {
491
+ const next = consolidateColumns(
492
+ mergeColumnOrder(columns, controlledOrder ?? prev),
493
+ layoutMode
494
+ );
495
+ return JSON.stringify(next) === JSON.stringify(prev) ? prev : next;
496
+ });
497
+ }, [columns, controlledOrder, layoutMode]);
498
+ const setLayout = React2__namespace.useCallback(
499
+ (mode) => {
500
+ if (controlledLayout === void 0) setInternalLayout(mode);
501
+ saveLayout(storageKey, mode);
502
+ onLayoutChange?.(mode);
503
+ },
504
+ [controlledLayout, storageKey, onLayoutChange]
505
+ );
506
+ const commitOrder = React2__namespace.useCallback(
507
+ (next) => {
508
+ saveOrder(storageKey, next);
509
+ onOrderChange?.(next);
510
+ const occupied = requiredColumns(next);
511
+ if (occupied < layoutModeRef.current) {
512
+ setLayout(occupied);
513
+ }
514
+ },
515
+ [storageKey, onOrderChange, setLayout]
516
+ );
517
+ const handleLayoutChange = React2__namespace.useCallback(
518
+ (mode) => {
519
+ setLayout(mode);
520
+ const next = consolidateColumns(colOrderRef.current, mode);
521
+ if (next !== colOrderRef.current) {
522
+ setColOrder(next);
523
+ saveOrder(storageKey, next);
524
+ onOrderChange?.(next);
525
+ }
526
+ },
527
+ [setLayout, storageKey, onOrderChange]
528
+ );
529
+ const sensors = core.useSensors(
530
+ core.useSensor(core.PointerSensor, { activationConstraint: { distance: 5 } }),
531
+ core.useSensor(core.KeyboardSensor, { coordinateGetter: sortable.sortableKeyboardCoordinates })
532
+ );
533
+ const resolve = (ids) => ids.filter((id) => !hiddenSet.has(id)).map((id) => itemMap.get(id)).filter(Boolean);
534
+ const handleDragStart = React2__namespace.useCallback(
535
+ (event) => {
536
+ prevColOrder.current = colOrder;
537
+ draggingRef.current = true;
538
+ setActiveId(String(event.active.id));
539
+ },
540
+ [colOrder]
541
+ );
542
+ const handleDragOver = React2__namespace.useCallback((event) => {
543
+ const { active, over } = event;
544
+ if (!over) return;
545
+ const next = moveAcrossColumns(
546
+ colOrderRef.current,
547
+ String(active.id),
548
+ String(over.id)
549
+ );
550
+ if (next !== colOrderRef.current) setColOrder(next);
551
+ }, []);
552
+ const handleDragEnd = React2__namespace.useCallback(
553
+ (event) => {
554
+ const { active, over } = event;
555
+ draggingRef.current = false;
556
+ setActiveId(null);
557
+ if (!over) {
558
+ setColOrder(prevColOrder.current);
559
+ return;
560
+ }
561
+ const activeItemId = String(active.id);
562
+ const crossedColumns = findColumn(prevColOrder.current, activeItemId) !== findColumn(colOrderRef.current, activeItemId);
563
+ const next = reorderOnDrop(
564
+ colOrderRef.current,
565
+ activeItemId,
566
+ String(over.id),
567
+ crossedColumns
568
+ );
569
+ if (next !== colOrderRef.current) setColOrder(next);
570
+ if (JSON.stringify(next) !== JSON.stringify(prevColOrder.current)) {
571
+ commitOrder(next);
572
+ }
573
+ },
574
+ [commitOrder]
575
+ );
576
+ const handleDragCancel = React2__namespace.useCallback(() => {
577
+ draggingRef.current = false;
578
+ setActiveId(null);
579
+ setColOrder(prevColOrder.current);
580
+ }, []);
581
+ const setHidden = React2__namespace.useCallback(
582
+ (ids) => {
583
+ if (controlledHidden === void 0) setInternalHidden(ids);
584
+ saveHidden(storageKey, ids);
585
+ onHiddenChange?.(ids);
586
+ },
587
+ [controlledHidden, storageKey, onHiddenChange]
588
+ );
589
+ const handleToggleWidget = React2__namespace.useCallback(
590
+ (id, visible) => {
591
+ setHidden(
592
+ visible ? hiddenList.filter((h) => h !== id) : [...hiddenList, id]
593
+ );
594
+ },
595
+ [hiddenList, setHidden]
596
+ );
597
+ const handleReset = React2__namespace.useCallback(() => {
598
+ if (storageKey) {
599
+ try {
600
+ localStorage.removeItem(orderStorageKey(storageKey));
601
+ localStorage.removeItem(layoutStorageKey(storageKey));
602
+ localStorage.removeItem(hiddenStorageKey(storageKey));
603
+ } catch {
604
+ }
605
+ }
606
+ const next = mergeColumnOrder(columns, defaultOrder ?? null);
607
+ setColOrder(next);
608
+ onOrderChange?.(next);
609
+ if (controlledLayout === void 0) setInternalLayout(defaultLayout);
610
+ onLayoutChange?.(defaultLayout);
611
+ const hidden = defaultHiddenIds ?? [];
612
+ if (controlledHidden === void 0) setInternalHidden(hidden);
613
+ onHiddenChange?.(hidden);
614
+ }, [
615
+ storageKey,
616
+ columns,
617
+ defaultOrder,
618
+ onOrderChange,
619
+ controlledLayout,
620
+ defaultLayout,
621
+ onLayoutChange,
622
+ defaultHiddenIds,
623
+ controlledHidden,
624
+ onHiddenChange
625
+ ]);
626
+ const cols = [
627
+ resolve(colOrder[0]),
628
+ resolve(colOrder[1]),
629
+ resolve(colOrder[2])
630
+ ];
631
+ const visibleCols = layoutMode === 1 ? [cols[0]] : layoutMode === 2 ? [cols[0], cols[1]] : cols;
632
+ const toolbar = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-end gap-3 pb-2", children: [
633
+ title && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-foreground me-auto text-lg font-semibold", children: title }),
634
+ widgets && widgets.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
635
+ chunkRDGRKYQ5_cjs.Button,
636
+ {
637
+ variant: "outline",
638
+ size: "sm",
639
+ onClick: () => setPanelOpen(true),
640
+ "aria-haspopup": "dialog",
641
+ leftIcon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SlidersHorizontal, { "aria-hidden": "true", className: "h-4 w-4" }),
642
+ children: customizeLabel
643
+ }
644
+ ),
645
+ /* @__PURE__ */ jsxRuntime.jsx(
646
+ "div",
647
+ {
648
+ className: "border-border bg-muted flex gap-0.5 rounded-md border p-0.5 max-md:hidden",
649
+ role: "radiogroup",
650
+ "aria-label": "Column layout",
651
+ children: [3, 2, 1].map((mode) => {
652
+ const Icon = mode === 3 ? lucideReact.Columns3 : mode === 2 ? lucideReact.Columns2 : lucideReact.Square;
653
+ return /* @__PURE__ */ jsxRuntime.jsx(
654
+ "button",
655
+ {
656
+ type: "button",
657
+ className: chunkS5RVSXDV_cjs.cn(
658
+ "flex h-7 w-7 items-center justify-center rounded transition-colors",
659
+ layoutMode === mode ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:bg-background hover:text-foreground"
660
+ ),
661
+ onClick: () => handleLayoutChange(mode),
662
+ role: "radio",
663
+ "aria-checked": layoutMode === mode,
664
+ "aria-label": `${mode} column layout`,
665
+ title: `${mode} column${mode > 1 ? "s" : ""}`,
666
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { "aria-hidden": "true", className: "h-4 w-4" })
667
+ },
668
+ mode
669
+ );
670
+ })
671
+ }
672
+ )
673
+ ] });
674
+ return /* @__PURE__ */ jsxRuntime.jsxs(
675
+ core.DndContext,
676
+ {
677
+ sensors,
678
+ collisionDetection,
679
+ onDragStart: handleDragStart,
680
+ onDragOver: handleDragOver,
681
+ onDragEnd: handleDragEnd,
682
+ onDragCancel: handleDragCancel,
683
+ children: [
684
+ toolbarSlot ? reactDom.createPortal(toolbar, toolbarSlot) : toolbar,
685
+ /* @__PURE__ */ jsxRuntime.jsx(
686
+ "div",
687
+ {
688
+ ref,
689
+ className: chunkS5RVSXDV_cjs.cn(
690
+ "grid items-start gap-3",
691
+ layoutMode === 3 && "grid-cols-1 md:grid-cols-2 lg:grid-cols-3",
692
+ layoutMode === 2 && "grid-cols-1 md:grid-cols-2",
693
+ layoutMode === 1 && "grid-cols-1",
694
+ className
695
+ ),
696
+ role: "region",
697
+ "aria-label": ariaLabel ?? "Dashboard",
698
+ children: visibleCols.map((col, i) => /* @__PURE__ */ jsxRuntime.jsx(
699
+ DroppableColumn,
700
+ {
701
+ id: COL_IDS[i],
702
+ items: col,
703
+ columnIndex: i,
704
+ handleSelector: dragHandleSelector,
705
+ flatten: layoutMode === 3,
706
+ dragActive: activeId !== null
707
+ },
708
+ COL_IDS[i]
709
+ ))
710
+ }
711
+ ),
712
+ widgets && widgets.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
713
+ DashboardCustomizePanel,
714
+ {
715
+ open: panelOpen,
716
+ onOpenChange: setPanelOpen,
717
+ widgets,
718
+ hiddenIds: hiddenList,
719
+ onToggleWidget: handleToggleWidget,
720
+ onReset: handleReset
721
+ }
722
+ )
723
+ ]
724
+ }
725
+ );
726
+ });
727
+
728
+ exports.CustomizableDashboard = CustomizableDashboard;
729
+ exports.DashboardCustomizePanel = DashboardCustomizePanel;
730
+ exports.consolidateColumns = consolidateColumns;
731
+ exports.mergeColumnOrder = mergeColumnOrder;
732
+ exports.moveAcrossColumns = moveAcrossColumns;
733
+ exports.reorderOnDrop = reorderOnDrop;
734
+ exports.requiredColumns = requiredColumns;
735
+ //# sourceMappingURL=chunk-YVIH26FG.cjs.map
736
+ //# sourceMappingURL=chunk-YVIH26FG.cjs.map