@stackframe/stack-ui 2.8.61 → 2.8.62

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 (386) hide show
  1. package/dist/components/action-dialog.js +130 -36
  2. package/dist/components/action-dialog.js.map +1 -0
  3. package/dist/components/brand-icons.js +413 -93
  4. package/dist/components/brand-icons.js.map +1 -0
  5. package/dist/components/browser-frame/index.js +63 -8
  6. package/dist/components/browser-frame/index.js.map +1 -0
  7. package/dist/components/copy-button.js +56 -17
  8. package/dist/components/copy-button.js.map +1 -0
  9. package/dist/components/copy-field.js +68 -12
  10. package/dist/components/copy-field.js.map +1 -0
  11. package/dist/components/data-table/cells.js +121 -50
  12. package/dist/components/data-table/cells.js.map +1 -0
  13. package/dist/components/data-table/column-header.js +62 -7
  14. package/dist/components/data-table/column-header.js.map +1 -0
  15. package/dist/components/data-table/data-table.js +263 -93
  16. package/dist/components/data-table/data-table.js.map +1 -0
  17. package/dist/components/data-table/faceted-filter.js +133 -25
  18. package/dist/components/data-table/faceted-filter.js.map +1 -0
  19. package/dist/components/data-table/index.js +41 -9
  20. package/dist/components/data-table/index.js.map +1 -0
  21. package/dist/components/data-table/pagination.js +89 -9
  22. package/dist/components/data-table/pagination.js.map +1 -0
  23. package/dist/components/data-table/toolbar-items.js +42 -4
  24. package/dist/components/data-table/toolbar-items.js.map +1 -0
  25. package/dist/components/data-table/toolbar.js +114 -44
  26. package/dist/components/data-table/toolbar.js.map +1 -0
  27. package/dist/components/data-table/utils.js +36 -4
  28. package/dist/components/data-table/utils.js.map +1 -0
  29. package/dist/components/data-table/view-options.js +70 -10
  30. package/dist/components/data-table/view-options.js.map +1 -0
  31. package/dist/components/simple-tooltip.js +45 -13
  32. package/dist/components/simple-tooltip.js.map +1 -0
  33. package/dist/components/ui/accordion.js +85 -10
  34. package/dist/components/ui/accordion.js.map +1 -0
  35. package/dist/components/ui/alert.js +75 -17
  36. package/dist/components/ui/alert.js.map +1 -0
  37. package/dist/components/ui/aspect-ratio.js +43 -3
  38. package/dist/components/ui/aspect-ratio.js.map +1 -0
  39. package/dist/components/ui/avatar.js +79 -8
  40. package/dist/components/ui/avatar.js.map +1 -0
  41. package/dist/components/ui/badge.js +51 -17
  42. package/dist/components/ui/badge.js.map +1 -0
  43. package/dist/components/ui/breadcrumb.js +118 -15
  44. package/dist/components/ui/breadcrumb.js.map +1 -0
  45. package/dist/components/ui/button.js +98 -39
  46. package/dist/components/ui/button.js.map +1 -0
  47. package/dist/components/ui/calendar.js +93 -39
  48. package/dist/components/ui/calendar.js.map +1 -0
  49. package/dist/components/ui/card.js +97 -11
  50. package/dist/components/ui/card.js.map +1 -0
  51. package/dist/components/ui/checkbox.js +64 -7
  52. package/dist/components/ui/checkbox.js.map +1 -0
  53. package/dist/components/ui/collapsible.js +49 -5
  54. package/dist/components/ui/collapsible.js.map +1 -0
  55. package/dist/components/ui/command.js +147 -25
  56. package/dist/components/ui/command.js.map +1 -0
  57. package/dist/components/ui/context-menu.js +196 -24
  58. package/dist/components/ui/context-menu.js.map +1 -0
  59. package/dist/components/ui/dialog.js +151 -17
  60. package/dist/components/ui/dialog.js.map +1 -0
  61. package/dist/components/ui/dropdown-menu.js +237 -55
  62. package/dist/components/ui/dropdown-menu.js.map +1 -0
  63. package/dist/components/ui/form.js +142 -53
  64. package/dist/components/ui/form.js.map +1 -0
  65. package/dist/components/ui/hover-card.js +64 -8
  66. package/dist/components/ui/hover-card.js.map +1 -0
  67. package/dist/components/ui/inline-code.js +62 -25
  68. package/dist/components/ui/inline-code.js.map +1 -0
  69. package/dist/components/ui/input-otp.js +87 -14
  70. package/dist/components/ui/input-otp.js.map +1 -0
  71. package/dist/components/ui/input.js +86 -22
  72. package/dist/components/ui/input.js.map +1 -0
  73. package/dist/components/ui/label.js +67 -9
  74. package/dist/components/ui/label.js.map +1 -0
  75. package/dist/components/ui/menubar.js +224 -24
  76. package/dist/components/ui/menubar.js.map +1 -0
  77. package/dist/components/ui/navigation-menu.js +149 -20
  78. package/dist/components/ui/navigation-menu.js.map +1 -0
  79. package/dist/components/ui/password-input.js +79 -11
  80. package/dist/components/ui/password-input.js.map +1 -0
  81. package/dist/components/ui/popover.js +67 -9
  82. package/dist/components/ui/popover.js.map +1 -0
  83. package/dist/components/ui/progress.js +63 -6
  84. package/dist/components/ui/progress.js.map +1 -0
  85. package/dist/components/ui/radio-group.js +70 -10
  86. package/dist/components/ui/radio-group.js.map +1 -0
  87. package/dist/components/ui/resizable.js +78 -8
  88. package/dist/components/ui/resizable.js.map +1 -0
  89. package/dist/components/ui/scroll-area.js +75 -9
  90. package/dist/components/ui/scroll-area.js.map +1 -0
  91. package/dist/components/ui/select.js +166 -20
  92. package/dist/components/ui/select.js.map +1 -0
  93. package/dist/components/ui/separator.js +61 -6
  94. package/dist/components/ui/separator.js.map +1 -0
  95. package/dist/components/ui/sheet.js +153 -27
  96. package/dist/components/ui/sheet.js.map +1 -0
  97. package/dist/components/ui/skeleton.js +46 -5
  98. package/dist/components/ui/skeleton.js.map +1 -0
  99. package/dist/components/ui/slider.js +60 -6
  100. package/dist/components/ui/slider.js.map +1 -0
  101. package/dist/components/ui/spinner.js +36 -6
  102. package/dist/components/ui/spinner.js.map +1 -0
  103. package/dist/components/ui/switch.js +92 -21
  104. package/dist/components/ui/switch.js.map +1 -0
  105. package/dist/components/ui/table.js +117 -12
  106. package/dist/components/ui/table.js.map +1 -0
  107. package/dist/components/ui/tabs.js +85 -9
  108. package/dist/components/ui/tabs.js.map +1 -0
  109. package/dist/components/ui/textarea.js +47 -6
  110. package/dist/components/ui/textarea.js.map +1 -0
  111. package/dist/components/ui/toast.js +135 -25
  112. package/dist/components/ui/toast.js.map +1 -0
  113. package/dist/components/ui/toaster.js +49 -8
  114. package/dist/components/ui/toaster.js.map +1 -0
  115. package/dist/components/ui/toggle-group.js +78 -17
  116. package/dist/components/ui/toggle-group.js.map +1 -0
  117. package/dist/components/ui/toggle.js +73 -21
  118. package/dist/components/ui/toggle.js.map +1 -0
  119. package/dist/components/ui/tooltip.js +72 -9
  120. package/dist/components/ui/tooltip.js.map +1 -0
  121. package/dist/components/ui/typography.js +69 -31
  122. package/dist/components/ui/typography.js.map +1 -0
  123. package/dist/components/ui/use-toast.js +151 -116
  124. package/dist/components/ui/use-toast.js.map +1 -0
  125. package/dist/esm/components/action-dialog.js +97 -0
  126. package/dist/esm/components/action-dialog.js.map +1 -0
  127. package/dist/esm/components/brand-icons.js +390 -0
  128. package/dist/esm/components/brand-icons.js.map +1 -0
  129. package/dist/esm/components/browser-frame/index.js +43 -0
  130. package/dist/esm/components/browser-frame/index.js.map +1 -0
  131. package/dist/esm/components/copy-button.js +35 -0
  132. package/dist/esm/components/copy-button.js.map +1 -0
  133. package/dist/esm/components/copy-field.js +44 -0
  134. package/dist/esm/components/copy-field.js.map +1 -0
  135. package/dist/esm/components/data-table/cells.js +88 -0
  136. package/dist/esm/components/data-table/cells.js.map +1 -0
  137. package/dist/esm/components/data-table/column-header.js +40 -0
  138. package/dist/esm/components/data-table/column-header.js.map +1 -0
  139. package/dist/esm/components/data-table/data-table.js +249 -0
  140. package/dist/esm/components/data-table/data-table.js.map +1 -0
  141. package/dist/esm/components/data-table/faceted-filter.js +117 -0
  142. package/dist/esm/components/data-table/faceted-filter.js.map +1 -0
  143. package/dist/esm/components/data-table/index.js +11 -0
  144. package/dist/esm/components/data-table/index.js.map +1 -0
  145. package/dist/esm/components/data-table/pagination.js +71 -0
  146. package/dist/esm/components/data-table/pagination.js.map +1 -0
  147. package/dist/esm/components/data-table/toolbar-items.js +18 -0
  148. package/dist/esm/components/data-table/toolbar-items.js.map +1 -0
  149. package/dist/esm/components/data-table/toolbar.js +92 -0
  150. package/dist/esm/components/data-table/toolbar.js.map +1 -0
  151. package/dist/esm/components/data-table/utils.js +12 -0
  152. package/dist/esm/components/data-table/utils.js.map +1 -0
  153. package/dist/esm/components/data-table/view-options.js +55 -0
  154. package/dist/esm/components/data-table/view-options.js.map +1 -0
  155. package/dist/esm/components/simple-tooltip.js +21 -0
  156. package/dist/esm/components/simple-tooltip.js.map +1 -0
  157. package/dist/esm/components/ui/accordion.js +52 -0
  158. package/dist/esm/components/ui/accordion.js.map +1 -0
  159. package/dist/esm/components/ui/alert.js +54 -0
  160. package/dist/esm/components/ui/alert.js.map +1 -0
  161. package/dist/esm/components/ui/aspect-ratio.js +10 -0
  162. package/dist/esm/components/ui/aspect-ratio.js.map +1 -0
  163. package/dist/esm/components/ui/avatar.js +47 -0
  164. package/dist/esm/components/ui/avatar.js.map +1 -0
  165. package/dist/esm/components/ui/badge.js +30 -0
  166. package/dist/esm/components/ui/badge.js.map +1 -0
  167. package/dist/esm/components/ui/breadcrumb.js +95 -0
  168. package/dist/esm/components/ui/breadcrumb.js.map +1 -0
  169. package/dist/esm/components/ui/button.js +79 -0
  170. package/dist/esm/components/ui/button.js.map +1 -0
  171. package/dist/esm/components/ui/calendar.js +72 -0
  172. package/dist/esm/components/ui/calendar.js.map +1 -0
  173. package/dist/esm/components/ui/card.js +72 -0
  174. package/dist/esm/components/ui/card.js.map +1 -0
  175. package/dist/esm/components/ui/checkbox.js +32 -0
  176. package/dist/esm/components/ui/checkbox.js.map +1 -0
  177. package/dist/esm/components/ui/collapsible.js +14 -0
  178. package/dist/esm/components/ui/collapsible.js.map +1 -0
  179. package/dist/esm/components/ui/command.js +119 -0
  180. package/dist/esm/components/ui/command.js.map +1 -0
  181. package/dist/esm/components/ui/context-menu.js +162 -0
  182. package/dist/esm/components/ui/context-menu.js.map +1 -0
  183. package/dist/esm/components/ui/dialog.js +114 -0
  184. package/dist/esm/components/ui/dialog.js.map +1 -0
  185. package/dist/esm/components/ui/dropdown-menu.js +200 -0
  186. package/dist/esm/components/ui/dropdown-menu.js.map +1 -0
  187. package/dist/esm/components/ui/form.js +118 -0
  188. package/dist/esm/components/ui/form.js.map +1 -0
  189. package/dist/esm/components/ui/hover-card.js +30 -0
  190. package/dist/esm/components/ui/hover-card.js.map +1 -0
  191. package/dist/esm/components/ui/inline-code.js +42 -0
  192. package/dist/esm/components/ui/inline-code.js.map +1 -0
  193. package/dist/esm/components/ui/input-otp.js +56 -0
  194. package/dist/esm/components/ui/input-otp.js.map +1 -0
  195. package/dist/esm/components/ui/input.js +57 -0
  196. package/dist/esm/components/ui/input.js.map +1 -0
  197. package/dist/esm/components/ui/label.js +35 -0
  198. package/dist/esm/components/ui/label.js.map +1 -0
  199. package/dist/esm/components/ui/menubar.js +192 -0
  200. package/dist/esm/components/ui/menubar.js.map +1 -0
  201. package/dist/esm/components/ui/navigation-menu.js +112 -0
  202. package/dist/esm/components/ui/navigation-menu.js.map +1 -0
  203. package/dist/esm/components/ui/password-input.js +58 -0
  204. package/dist/esm/components/ui/password-input.js.map +1 -0
  205. package/dist/esm/components/ui/popover.js +32 -0
  206. package/dist/esm/components/ui/popover.js.map +1 -0
  207. package/dist/esm/components/ui/progress.js +31 -0
  208. package/dist/esm/components/ui/progress.js.map +1 -0
  209. package/dist/esm/components/ui/radio-group.js +40 -0
  210. package/dist/esm/components/ui/radio-group.js.map +1 -0
  211. package/dist/esm/components/ui/resizable.js +43 -0
  212. package/dist/esm/components/ui/resizable.js.map +1 -0
  213. package/dist/esm/components/ui/scroll-area.js +43 -0
  214. package/dist/esm/components/ui/scroll-area.js.map +1 -0
  215. package/dist/esm/components/ui/select.js +135 -0
  216. package/dist/esm/components/ui/select.js.map +1 -0
  217. package/dist/esm/components/ui/separator.js +29 -0
  218. package/dist/esm/components/ui/separator.js.map +1 -0
  219. package/dist/esm/components/ui/sheet.js +120 -0
  220. package/dist/esm/components/ui/sheet.js.map +1 -0
  221. package/dist/esm/components/ui/skeleton.js +24 -0
  222. package/dist/esm/components/ui/skeleton.js.map +1 -0
  223. package/dist/esm/components/ui/slider.js +28 -0
  224. package/dist/esm/components/ui/slider.js.map +1 -0
  225. package/dist/esm/components/ui/spinner.js +13 -0
  226. package/dist/esm/components/ui/spinner.js.map +1 -0
  227. package/dist/esm/components/ui/switch.js +62 -0
  228. package/dist/esm/components/ui/switch.js.map +1 -0
  229. package/dist/esm/components/ui/table.js +93 -0
  230. package/dist/esm/components/ui/table.js.map +1 -0
  231. package/dist/esm/components/ui/tabs.js +52 -0
  232. package/dist/esm/components/ui/tabs.js.map +1 -0
  233. package/dist/esm/components/ui/textarea.js +24 -0
  234. package/dist/esm/components/ui/textarea.js.map +1 -0
  235. package/dist/esm/components/ui/toast.js +105 -0
  236. package/dist/esm/components/ui/toast.js.map +1 -0
  237. package/dist/esm/components/ui/toaster.js +34 -0
  238. package/dist/esm/components/ui/toaster.js.map +1 -0
  239. package/dist/esm/components/ui/toggle-group.js +48 -0
  240. package/dist/esm/components/ui/toggle-group.js.map +1 -0
  241. package/dist/esm/components/ui/toggle.js +43 -0
  242. package/dist/esm/components/ui/toggle.js.map +1 -0
  243. package/dist/esm/components/ui/tooltip.js +38 -0
  244. package/dist/esm/components/ui/tooltip.js.map +1 -0
  245. package/dist/esm/components/ui/typography.js +47 -0
  246. package/dist/esm/components/ui/typography.js.map +1 -0
  247. package/dist/esm/components/ui/use-toast.js +130 -0
  248. package/dist/esm/components/ui/use-toast.js.map +1 -0
  249. package/dist/esm/index.js +59 -0
  250. package/dist/esm/index.js.map +1 -0
  251. package/dist/esm/lib/utils.js +10 -0
  252. package/dist/esm/lib/utils.js.map +1 -0
  253. package/dist/index.d.mts +967 -0
  254. package/dist/index.d.ts +967 -54
  255. package/dist/index.js +147 -53
  256. package/dist/index.js.map +1 -0
  257. package/dist/lib/utils.js +34 -4
  258. package/dist/lib/utils.js.map +1 -0
  259. package/package.json +10 -5
  260. package/dist/components/action-dialog.d.ts +0 -28
  261. package/dist/components/action-dialog.d.ts.map +0 -1
  262. package/dist/components/brand-icons.d.ts +0 -43
  263. package/dist/components/brand-icons.d.ts.map +0 -1
  264. package/dist/components/browser-frame/index.d.ts +0 -10
  265. package/dist/components/browser-frame/index.d.ts.map +0 -1
  266. package/dist/components/copy-button.d.ts +0 -17
  267. package/dist/components/copy-button.d.ts.map +0 -1
  268. package/dist/components/copy-field.d.ts +0 -13
  269. package/dist/components/copy-field.d.ts.map +0 -1
  270. package/dist/components/data-table/cells.d.ts +0 -31
  271. package/dist/components/data-table/cells.d.ts.map +0 -1
  272. package/dist/components/data-table/column-header.d.ts +0 -8
  273. package/dist/components/data-table/column-header.d.ts.map +0 -1
  274. package/dist/components/data-table/data-table.d.ts +0 -36
  275. package/dist/components/data-table/data-table.d.ts.map +0 -1
  276. package/dist/components/data-table/faceted-filter.d.ts +0 -16
  277. package/dist/components/data-table/faceted-filter.d.ts.map +0 -1
  278. package/dist/components/data-table/index.d.ts +0 -10
  279. package/dist/components/data-table/index.d.ts.map +0 -1
  280. package/dist/components/data-table/pagination.d.ts +0 -7
  281. package/dist/components/data-table/pagination.d.ts.map +0 -1
  282. package/dist/components/data-table/toolbar-items.d.ts +0 -8
  283. package/dist/components/data-table/toolbar-items.d.ts.map +0 -1
  284. package/dist/components/data-table/toolbar.d.ts +0 -12
  285. package/dist/components/data-table/toolbar.d.ts.map +0 -1
  286. package/dist/components/data-table/utils.d.ts +0 -3
  287. package/dist/components/data-table/utils.d.ts.map +0 -1
  288. package/dist/components/data-table/view-options.d.ts +0 -7
  289. package/dist/components/data-table/view-options.d.ts.map +0 -1
  290. package/dist/components/simple-tooltip.d.ts +0 -9
  291. package/dist/components/simple-tooltip.d.ts.map +0 -1
  292. package/dist/components/ui/accordion.d.ts +0 -14
  293. package/dist/components/ui/accordion.d.ts.map +0 -1
  294. package/dist/components/ui/alert.d.ts +0 -15
  295. package/dist/components/ui/alert.d.ts.map +0 -1
  296. package/dist/components/ui/aspect-ratio.d.ts +0 -4
  297. package/dist/components/ui/aspect-ratio.d.ts.map +0 -1
  298. package/dist/components/ui/avatar.d.ts +0 -13
  299. package/dist/components/ui/avatar.d.ts.map +0 -1
  300. package/dist/components/ui/badge.d.ts +0 -13
  301. package/dist/components/ui/badge.d.ts.map +0 -1
  302. package/dist/components/ui/breadcrumb.d.ts +0 -30
  303. package/dist/components/ui/breadcrumb.d.ts.map +0 -1
  304. package/dist/components/ui/button.d.ts +0 -28
  305. package/dist/components/ui/button.d.ts.map +0 -1
  306. package/dist/components/ui/calendar.d.ts +0 -9
  307. package/dist/components/ui/calendar.d.ts.map +0 -1
  308. package/dist/components/ui/card.d.ts +0 -23
  309. package/dist/components/ui/card.d.ts.map +0 -1
  310. package/dist/components/ui/checkbox.d.ts +0 -7
  311. package/dist/components/ui/checkbox.d.ts.map +0 -1
  312. package/dist/components/ui/collapsible.d.ts +0 -6
  313. package/dist/components/ui/collapsible.d.ts.map +0 -1
  314. package/dist/components/ui/command.d.ts +0 -18
  315. package/dist/components/ui/command.d.ts.map +0 -1
  316. package/dist/components/ui/context-menu.d.ts +0 -44
  317. package/dist/components/ui/context-menu.d.ts.map +0 -1
  318. package/dist/components/ui/dialog.d.ts +0 -34
  319. package/dist/components/ui/dialog.d.ts.map +0 -1
  320. package/dist/components/ui/dropdown-menu.d.ts +0 -47
  321. package/dist/components/ui/dropdown-menu.d.ts.map +0 -1
  322. package/dist/components/ui/form.d.ts +0 -34
  323. package/dist/components/ui/form.d.ts.map +0 -1
  324. package/dist/components/ui/hover-card.d.ts +0 -9
  325. package/dist/components/ui/hover-card.d.ts.map +0 -1
  326. package/dist/components/ui/inline-code.d.ts +0 -6
  327. package/dist/components/ui/inline-code.d.ts.map +0 -1
  328. package/dist/components/ui/input-otp.d.ts +0 -17
  329. package/dist/components/ui/input-otp.d.ts.map +0 -1
  330. package/dist/components/ui/input.d.ts +0 -20
  331. package/dist/components/ui/input.d.ts.map +0 -1
  332. package/dist/components/ui/label.d.ts +0 -11
  333. package/dist/components/ui/label.d.ts.map +0 -1
  334. package/dist/components/ui/menubar.d.ts +0 -31
  335. package/dist/components/ui/menubar.d.ts.map +0 -1
  336. package/dist/components/ui/navigation-menu.d.ts +0 -25
  337. package/dist/components/ui/navigation-menu.d.ts.map +0 -1
  338. package/dist/components/ui/password-input.d.ts +0 -7
  339. package/dist/components/ui/password-input.d.ts.map +0 -1
  340. package/dist/components/ui/popover.d.ts +0 -10
  341. package/dist/components/ui/popover.d.ts.map +0 -1
  342. package/dist/components/ui/progress.d.ts +0 -7
  343. package/dist/components/ui/progress.d.ts.map +0 -1
  344. package/dist/components/ui/radio-group.d.ts +0 -10
  345. package/dist/components/ui/radio-group.d.ts.map +0 -1
  346. package/dist/components/ui/resizable.d.ts +0 -37
  347. package/dist/components/ui/resizable.d.ts.map +0 -1
  348. package/dist/components/ui/scroll-area.d.ts +0 -10
  349. package/dist/components/ui/scroll-area.d.ts.map +0 -1
  350. package/dist/components/ui/select.d.ts +0 -30
  351. package/dist/components/ui/select.d.ts.map +0 -1
  352. package/dist/components/ui/separator.d.ts +0 -7
  353. package/dist/components/ui/separator.d.ts.map +0 -1
  354. package/dist/components/ui/sheet.d.ts +0 -33
  355. package/dist/components/ui/sheet.d.ts.map +0 -1
  356. package/dist/components/ui/skeleton.d.ts +0 -4
  357. package/dist/components/ui/skeleton.d.ts.map +0 -1
  358. package/dist/components/ui/slider.d.ts +0 -7
  359. package/dist/components/ui/slider.d.ts.map +0 -1
  360. package/dist/components/ui/spinner.d.ts +0 -7
  361. package/dist/components/ui/spinner.d.ts.map +0 -1
  362. package/dist/components/ui/switch.d.ts +0 -11
  363. package/dist/components/ui/switch.d.ts.map +0 -1
  364. package/dist/components/ui/table.d.ts +0 -27
  365. package/dist/components/ui/table.d.ts.map +0 -1
  366. package/dist/components/ui/tabs.d.ts +0 -14
  367. package/dist/components/ui/tabs.d.ts.map +0 -1
  368. package/dist/components/ui/textarea.d.ts +0 -7
  369. package/dist/components/ui/textarea.d.ts.map +0 -1
  370. package/dist/components/ui/toast.d.ts +0 -28
  371. package/dist/components/ui/toast.d.ts.map +0 -1
  372. package/dist/components/ui/toaster.d.ts +0 -2
  373. package/dist/components/ui/toaster.d.ts.map +0 -1
  374. package/dist/components/ui/toggle-group.d.ts +0 -17
  375. package/dist/components/ui/toggle-group.d.ts.map +0 -1
  376. package/dist/components/ui/toggle.d.ts +0 -15
  377. package/dist/components/ui/toggle.d.ts.map +0 -1
  378. package/dist/components/ui/tooltip.d.ts +0 -12
  379. package/dist/components/ui/tooltip.d.ts.map +0 -1
  380. package/dist/components/ui/typography.d.ts +0 -10
  381. package/dist/components/ui/typography.d.ts.map +0 -1
  382. package/dist/components/ui/use-toast.d.ts +0 -45
  383. package/dist/components/ui/use-toast.d.ts.map +0 -1
  384. package/dist/index.d.ts.map +0 -1
  385. package/dist/lib/utils.d.ts +0 -3
  386. package/dist/lib/utils.d.ts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/data-table/index.tsx"],"sourcesContent":["export * from \"./cells\";\nexport * from \"./column-header\";\nexport * from \"./data-table\";\nexport * from \"./faceted-filter\";\nexport * from \"./pagination\";\nexport * from \"./toolbar-items\";\nexport * from \"./toolbar\";\nexport * from \"./utils\";\nexport * from \"./view-options\";\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,+BAAc,uBAAd;AACA,+BAAc,+BADd;AAEA,+BAAc,4BAFd;AAGA,+BAAc,gCAHd;AAIA,+BAAc,4BAJd;AAKA,+BAAc,+BALd;AAMA,+BAAc,yBANd;AAOA,+BAAc,uBAPd;AAQA,+BAAc,8BARd;","names":[]}
@@ -1,10 +1,90 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { ChevronLeftIcon, ChevronRightIcon } from "@radix-ui/react-icons";
3
- import { Button, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@stackframe/stack-ui";
4
- export function DataTablePagination({ table, }) {
5
- return (_jsxs("div", { className: "flex items-center justify-between px-2 flex-col sm:flex-row gap-y-4 sm:gap-y-0", children: [_jsx("div", { className: "flex-1 text-sm text-muted-foreground", children: table.getFilteredSelectedRowModel().rows.length !== 0 ?
6
- `${table.getFilteredSelectedRowModel().rows.length} of ${table.getFilteredRowModel().rows.length} row(s) selected` :
7
- undefined }), _jsxs("div", { className: "flex items-center gap-x-6 lg:gap-x-8 flex-col sm:flex-row gap-y-4 sm:gap-y-0", children: [_jsxs("div", { className: "flex items-center space-x-2", children: [_jsx("p", { className: "text-sm font-medium", children: "Rows per page" }), _jsxs(Select, { value: `${table.getState().pagination.pageSize}`, onValueChange: (value) => {
8
- table.setPageSize(Number(value));
9
- }, children: [_jsx(SelectTrigger, { className: "h-8 w-[70px]", children: _jsx(SelectValue, { placeholder: table.getState().pagination.pageSize }) }), _jsx(SelectContent, { side: "top", children: [10, 20, 30, 40, 50].map((pageSize) => (_jsx(SelectItem, { value: `${pageSize}`, children: pageSize }, pageSize))) })] })] }), _jsxs("div", { className: "flex items-center gap-4", children: [_jsx("div", { className: "flex items-center justify-center text-sm font-medium", children: table.getState().pagination.pageIndex + 1 }), _jsxs("div", { className: "flex items-center space-x-2", children: [_jsxs(Button, { variant: "outline", className: "h-8 w-8 p-0", onClick: () => table.previousPage(), disabled: !table.getCanPreviousPage(), children: [_jsx("span", { className: "sr-only", children: "Go to previous page" }), _jsx(ChevronLeftIcon, { className: "h-4 w-4" })] }), _jsxs(Button, { variant: "outline", className: "h-8 w-8 p-0", onClick: () => table.nextPage(), disabled: !table.getCanNextPage(), children: [_jsx("span", { className: "sr-only", children: "Go to next page" }), _jsx(ChevronRightIcon, { className: "h-4 w-4" })] })] })] })] })] }));
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/components/data-table/pagination.tsx
21
+ var pagination_exports = {};
22
+ __export(pagination_exports, {
23
+ DataTablePagination: () => DataTablePagination
24
+ });
25
+ module.exports = __toCommonJS(pagination_exports);
26
+ var import_react_icons = require("@radix-ui/react-icons");
27
+ var import_button = require("../ui/button.js");
28
+ var import_select = require("../ui/select.js");
29
+ var import_jsx_runtime = require("react/jsx-runtime");
30
+ function DataTablePagination({
31
+ table
32
+ }) {
33
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between px-2 flex-col sm:flex-row gap-y-4 sm:gap-y-0", children: [
34
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex-1 text-sm text-muted-foreground", children: table.getFilteredSelectedRowModel().rows.length !== 0 ? `${table.getFilteredSelectedRowModel().rows.length} of ${table.getFilteredRowModel().rows.length} row(s) selected` : void 0 }),
35
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-x-6 lg:gap-x-8 flex-col sm:flex-row gap-y-4 sm:gap-y-0", children: [
36
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center space-x-2", children: [
37
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-medium", children: "Rows per page" }),
38
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
39
+ import_select.Select,
40
+ {
41
+ value: `${table.getState().pagination.pageSize}`,
42
+ onValueChange: (value) => {
43
+ table.setPageSize(Number(value));
44
+ },
45
+ children: [
46
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectTrigger, { className: "h-8 w-[70px]", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectValue, { placeholder: table.getState().pagination.pageSize }) }),
47
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectContent, { side: "top", children: [10, 20, 30, 40, 50].map((pageSize) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectItem, { value: `${pageSize}`, children: pageSize }, pageSize)) })
48
+ ]
49
+ }
50
+ )
51
+ ] }),
52
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-4", children: [
53
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex items-center justify-center text-sm font-medium", children: table.getState().pagination.pageIndex + 1 }),
54
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center space-x-2", children: [
55
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
56
+ import_button.Button,
57
+ {
58
+ variant: "outline",
59
+ className: "h-8 w-8 p-0",
60
+ onClick: () => table.previousPage(),
61
+ disabled: !table.getCanPreviousPage(),
62
+ children: [
63
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "sr-only", children: "Go to previous page" }),
64
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_icons.ChevronLeftIcon, { className: "h-4 w-4" })
65
+ ]
66
+ }
67
+ ),
68
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
69
+ import_button.Button,
70
+ {
71
+ variant: "outline",
72
+ className: "h-8 w-8 p-0",
73
+ onClick: () => table.nextPage(),
74
+ disabled: !table.getCanNextPage(),
75
+ children: [
76
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "sr-only", children: "Go to next page" }),
77
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_icons.ChevronRightIcon, { className: "h-4 w-4" })
78
+ ]
79
+ }
80
+ )
81
+ ] })
82
+ ] })
83
+ ] })
84
+ ] });
10
85
  }
86
+ // Annotate the CommonJS export names for ESM import in node:
87
+ 0 && (module.exports = {
88
+ DataTablePagination
89
+ });
90
+ //# sourceMappingURL=pagination.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/data-table/pagination.tsx"],"sourcesContent":["import { ChevronLeftIcon, ChevronRightIcon } from \"@radix-ui/react-icons\";\nimport { Button } from \"../ui/button\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"../ui/select\";\nimport { Table } from \"@tanstack/react-table\";\n\ntype DataTablePaginationProps<TData> = {\n table: Table<TData>,\n}\n\nexport function DataTablePagination<TData>({\n table,\n}: DataTablePaginationProps<TData>) {\n return (\n <div className=\"flex items-center justify-between px-2 flex-col sm:flex-row gap-y-4 sm:gap-y-0\">\n <div className=\"flex-1 text-sm text-muted-foreground\">\n {table.getFilteredSelectedRowModel().rows.length !== 0 ?\n `${table.getFilteredSelectedRowModel().rows.length} of ${table.getFilteredRowModel().rows.length} row(s) selected` :\n undefined}\n </div>\n <div className=\"flex items-center gap-x-6 lg:gap-x-8 flex-col sm:flex-row gap-y-4 sm:gap-y-0\">\n <div className=\"flex items-center space-x-2\">\n <p className=\"text-sm font-medium\">Rows per page</p>\n <Select\n value={`${table.getState().pagination.pageSize}`}\n onValueChange={(value) => {\n table.setPageSize(Number(value));\n }}\n >\n <SelectTrigger className=\"h-8 w-[70px]\">\n <SelectValue placeholder={table.getState().pagination.pageSize} />\n </SelectTrigger>\n <SelectContent side=\"top\">\n {[10, 20, 30, 40, 50].map((pageSize) => (\n <SelectItem key={pageSize} value={`${pageSize}`}>\n {pageSize}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div className=\"flex items-center gap-4\">\n <div className=\"flex items-center justify-center text-sm font-medium\">\n {table.getState().pagination.pageIndex + 1}\n {/* {\" / \"}{table.getPageCount()} */}\n </div>\n <div className=\"flex items-center space-x-2\">\n <Button\n variant=\"outline\"\n className=\"h-8 w-8 p-0\"\n onClick={() => table.previousPage()}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to previous page</span>\n <ChevronLeftIcon className=\"h-4 w-4\" />\n </Button>\n <Button\n variant=\"outline\"\n className=\"h-8 w-8 p-0\"\n onClick={() => table.nextPage()}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to next page</span>\n <ChevronRightIcon className=\"h-4 w-4\" />\n </Button>\n </div>\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAkD;AAClD,oBAAuB;AACvB,oBAMO;AAYD;AALC,SAAS,oBAA2B;AAAA,EACzC;AACF,GAAoC;AAClC,SACE,6CAAC,SAAI,WAAU,kFACb;AAAA,gDAAC,SAAI,WAAU,wCACZ,gBAAM,4BAA4B,EAAE,KAAK,WAAW,IACnD,GAAG,MAAM,4BAA4B,EAAE,KAAK,MAAM,OAAO,MAAM,oBAAoB,EAAE,KAAK,MAAM,qBAChG,QACJ;AAAA,IACA,6CAAC,SAAI,WAAU,gFACb;AAAA,mDAAC,SAAI,WAAU,+BACb;AAAA,oDAAC,OAAE,WAAU,uBAAsB,2BAAa;AAAA,QAChD;AAAA,UAAC;AAAA;AAAA,YACC,OAAO,GAAG,MAAM,SAAS,EAAE,WAAW,QAAQ;AAAA,YAC9C,eAAe,CAAC,UAAU;AACxB,oBAAM,YAAY,OAAO,KAAK,CAAC;AAAA,YACjC;AAAA,YAEA;AAAA,0DAAC,+BAAc,WAAU,gBACvB,sDAAC,6BAAY,aAAa,MAAM,SAAS,EAAE,WAAW,UAAU,GAClE;AAAA,cACA,4CAAC,+BAAc,MAAK,OACjB,WAAC,IAAI,IAAI,IAAI,IAAI,EAAE,EAAE,IAAI,CAAC,aACzB,4CAAC,4BAA0B,OAAO,GAAG,QAAQ,IAC1C,sBADc,QAEjB,CACD,GACH;AAAA;AAAA;AAAA,QACF;AAAA,SACF;AAAA,MACA,6CAAC,SAAI,WAAU,2BACb;AAAA,oDAAC,SAAI,WAAU,wDACZ,gBAAM,SAAS,EAAE,WAAW,YAAY,GAE3C;AAAA,QACA,6CAAC,SAAI,WAAU,+BACb;AAAA;AAAA,YAAC;AAAA;AAAA,cACC,SAAQ;AAAA,cACR,WAAU;AAAA,cACV,SAAS,MAAM,MAAM,aAAa;AAAA,cAClC,UAAU,CAAC,MAAM,mBAAmB;AAAA,cAEpC;AAAA,4DAAC,UAAK,WAAU,WAAU,iCAAmB;AAAA,gBAC7C,4CAAC,sCAAgB,WAAU,WAAU;AAAA;AAAA;AAAA,UACvC;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACC,SAAQ;AAAA,cACR,WAAU;AAAA,cACV,SAAS,MAAM,MAAM,SAAS;AAAA,cAC9B,UAAU,CAAC,MAAM,eAAe;AAAA,cAEhC;AAAA,4DAAC,UAAK,WAAU,WAAU,6BAAe;AAAA,gBACzC,4CAAC,uCAAiB,WAAU,WAAU;AAAA;AAAA;AAAA,UACxC;AAAA,WACF;AAAA,SACF;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
@@ -1,5 +1,43 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Input, cn } from "../..";
3
- export function SearchToolbarItem(props) {
4
- return (_jsx(Input, { placeholder: props.placeholder, value: props.keyName ? `${props.table.getColumn(props.keyName)?.getFilterValue() ?? ""}` : props.table.getState().globalFilter ?? "", onChange: (event) => props.keyName ? props.table.getColumn(props.keyName)?.setFilterValue(event.target.value) : props.table.setGlobalFilter(event.target.value), className: cn("h-8 w-[250px]", props.className) }));
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/components/data-table/toolbar-items.tsx
21
+ var toolbar_items_exports = {};
22
+ __export(toolbar_items_exports, {
23
+ SearchToolbarItem: () => SearchToolbarItem
24
+ });
25
+ module.exports = __toCommonJS(toolbar_items_exports);
26
+ var import__ = require("../../index.js");
27
+ var import_jsx_runtime = require("react/jsx-runtime");
28
+ function SearchToolbarItem(props) {
29
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
30
+ import__.Input,
31
+ {
32
+ placeholder: props.placeholder,
33
+ value: props.keyName ? `${props.table.getColumn(props.keyName)?.getFilterValue() ?? ""}` : props.table.getState().globalFilter ?? "",
34
+ onChange: (event) => props.keyName ? props.table.getColumn(props.keyName)?.setFilterValue(event.target.value) : props.table.setGlobalFilter(event.target.value),
35
+ className: (0, import__.cn)("h-8 w-[250px]", props.className)
36
+ }
37
+ );
5
38
  }
39
+ // Annotate the CommonJS export names for ESM import in node:
40
+ 0 && (module.exports = {
41
+ SearchToolbarItem
42
+ });
43
+ //# sourceMappingURL=toolbar-items.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/data-table/toolbar-items.tsx"],"sourcesContent":["import { Input, cn } from \"../..\";\nimport { Table } from \"@tanstack/react-table\";\n\nexport function SearchToolbarItem<TData>(props: { table: Table<TData>, keyName?: string | null, placeholder: string, className?: string }) {\n return (\n <Input\n placeholder={props.placeholder}\n value={props.keyName ? `${props.table.getColumn(props.keyName)?.getFilterValue() ?? \"\"}` : props.table.getState().globalFilter ?? \"\"}\n onChange={(event) => props.keyName ? props.table.getColumn(props.keyName)?.setFilterValue(event.target.value) : props.table.setGlobalFilter(event.target.value)}\n className={cn(\"h-8 w-[250px]\", props.className)}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAA0B;AAKtB;AAFG,SAAS,kBAAyB,OAAkG;AACzI,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAa,MAAM;AAAA,MACnB,OAAO,MAAM,UAAU,GAAG,MAAM,MAAM,UAAU,MAAM,OAAO,GAAG,eAAe,KAAK,EAAE,KAAK,MAAM,MAAM,SAAS,EAAE,gBAAgB;AAAA,MAClI,UAAU,CAAC,UAAU,MAAM,UAAU,MAAM,MAAM,UAAU,MAAM,OAAO,GAAG,eAAe,MAAM,OAAO,KAAK,IAAI,MAAM,MAAM,gBAAgB,MAAM,OAAO,KAAK;AAAA,MAC9J,eAAW,aAAG,iBAAiB,MAAM,SAAS;AAAA;AAAA,EAChD;AAEJ;","names":[]}
@@ -1,46 +1,116 @@
1
1
  "use client";
2
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { Cross2Icon } from "@radix-ui/react-icons";
4
- import { deepPlainEquals } from "@stackframe/stack-shared/dist/utils/objects";
5
- import { Button } from "@stackframe/stack-ui";
6
- import { download, generateCsv, mkConfig } from 'export-to-csv';
7
- import { DownloadIcon } from "lucide-react";
8
- import { DataTableViewOptions } from "./view-options";
9
- export function DataTableToolbar({ table, toolbarRender, showDefaultToolbar, defaultColumnFilters, defaultSorting, showResetFilters = true, }) {
10
- const isFiltered = !deepPlainEquals(table.getState().columnFilters, defaultColumnFilters);
11
- const isSorted = !deepPlainEquals(table.getState().sorting, defaultSorting);
12
- return (_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { className: "flex items-center gap-2 flex-wrap flex-1 stack-scope", children: [toolbarRender?.(table), showResetFilters && (isFiltered || isSorted) && (_jsxs(Button, { variant: "ghost", onClick: () => {
13
- table.setColumnFilters(defaultColumnFilters);
14
- table.setSorting(defaultSorting);
15
- }, className: "h-8 px-2 lg:px-3", children: ["Reset filters", _jsx(Cross2Icon, { className: "ml-2 h-4 w-4" })] }))] }), showDefaultToolbar && (_jsx(_Fragment, { children: _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [_jsx(DataTableViewOptions, { table: table }), _jsxs(Button, { variant: "outline", size: "sm", className: "ml-auto hidden h-8 lg:flex", onClick: () => {
16
- const csvConfig = mkConfig({
17
- fieldSeparator: ',',
18
- filename: 'data',
19
- decimalSeparator: '.',
20
- useKeysAsHeaders: true,
21
- });
22
- const renderCellValue = (cell) => {
23
- const rendered = cell.renderValue();
24
- if (rendered === null) {
25
- return undefined;
26
- }
27
- if (['string', 'number', 'boolean', 'undefined'].includes(typeof rendered)) {
28
- return rendered;
29
- }
30
- if (rendered instanceof Date) {
31
- return rendered.toISOString();
32
- }
33
- if (typeof rendered === 'object') {
34
- return JSON.stringify(rendered);
35
- }
36
- };
37
- const rowModel = table.getCoreRowModel();
38
- const rows = rowModel.rows.map(row => Object.fromEntries(row.getAllCells().map(c => [c.column.id, renderCellValue(c)]).filter(([_, v]) => v !== undefined)));
39
- if (rows.length === 0) {
40
- alert("No data to export");
41
- return;
42
- }
43
- const csv = generateCsv(csvConfig)(rows);
44
- download(csvConfig)(csv);
45
- }, children: [_jsx(DownloadIcon, { className: "mr-2 h-4 w-4" }), "Export CSV"] })] }) }))] }));
2
+ "use strict";
3
+ "use client";
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+
22
+ // src/components/data-table/toolbar.tsx
23
+ var toolbar_exports = {};
24
+ __export(toolbar_exports, {
25
+ DataTableToolbar: () => DataTableToolbar
26
+ });
27
+ module.exports = __toCommonJS(toolbar_exports);
28
+ var import_react_icons = require("@radix-ui/react-icons");
29
+ var import_objects = require("@stackframe/stack-shared/dist/utils/objects");
30
+ var import_button = require("../ui/button.js");
31
+ var import_export_to_csv = require("export-to-csv");
32
+ var import_lucide_react = require("lucide-react");
33
+ var import_view_options = require("./view-options.js");
34
+ var import_jsx_runtime = require("react/jsx-runtime");
35
+ function DataTableToolbar({
36
+ table,
37
+ toolbarRender,
38
+ showDefaultToolbar,
39
+ defaultColumnFilters,
40
+ defaultSorting,
41
+ showResetFilters = true
42
+ }) {
43
+ const isFiltered = !(0, import_objects.deepPlainEquals)(table.getState().columnFilters, defaultColumnFilters);
44
+ const isSorted = !(0, import_objects.deepPlainEquals)(table.getState().sorting, defaultSorting);
45
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between", children: [
46
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 flex-wrap flex-1 stack-scope", children: [
47
+ toolbarRender?.(table),
48
+ showResetFilters && (isFiltered || isSorted) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
49
+ import_button.Button,
50
+ {
51
+ variant: "ghost",
52
+ onClick: () => {
53
+ table.setColumnFilters(defaultColumnFilters);
54
+ table.setSorting(defaultSorting);
55
+ },
56
+ className: "h-8 px-2 lg:px-3",
57
+ children: [
58
+ "Reset filters",
59
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_icons.Cross2Icon, { className: "ml-2 h-4 w-4" })
60
+ ]
61
+ }
62
+ )
63
+ ] }),
64
+ showDefaultToolbar && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 flex-wrap", children: [
65
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_view_options.DataTableViewOptions, { table }),
66
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
67
+ import_button.Button,
68
+ {
69
+ variant: "outline",
70
+ size: "sm",
71
+ className: "ml-auto hidden h-8 lg:flex",
72
+ onClick: () => {
73
+ const csvConfig = (0, import_export_to_csv.mkConfig)({
74
+ fieldSeparator: ",",
75
+ filename: "data",
76
+ decimalSeparator: ".",
77
+ useKeysAsHeaders: true
78
+ });
79
+ const renderCellValue = (cell) => {
80
+ const rendered = cell.renderValue();
81
+ if (rendered === null) {
82
+ return void 0;
83
+ }
84
+ if (["string", "number", "boolean", "undefined"].includes(typeof rendered)) {
85
+ return rendered;
86
+ }
87
+ if (rendered instanceof Date) {
88
+ return rendered.toISOString();
89
+ }
90
+ if (typeof rendered === "object") {
91
+ return JSON.stringify(rendered);
92
+ }
93
+ };
94
+ const rowModel = table.getCoreRowModel();
95
+ const rows = rowModel.rows.map((row) => Object.fromEntries(row.getAllCells().map((c) => [c.column.id, renderCellValue(c)]).filter(([_, v]) => v !== void 0)));
96
+ if (rows.length === 0) {
97
+ alert("No data to export");
98
+ return;
99
+ }
100
+ const csv = (0, import_export_to_csv.generateCsv)(csvConfig)(rows);
101
+ (0, import_export_to_csv.download)(csvConfig)(csv);
102
+ },
103
+ children: [
104
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.DownloadIcon, { className: "mr-2 h-4 w-4" }),
105
+ "Export CSV"
106
+ ]
107
+ }
108
+ )
109
+ ] }) })
110
+ ] });
46
111
  }
112
+ // Annotate the CommonJS export names for ESM import in node:
113
+ 0 && (module.exports = {
114
+ DataTableToolbar
115
+ });
116
+ //# sourceMappingURL=toolbar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/data-table/toolbar.tsx"],"sourcesContent":["\"use client\";\n\nimport { Cross2Icon } from \"@radix-ui/react-icons\";\nimport { deepPlainEquals } from \"@stackframe/stack-shared/dist/utils/objects\";\nimport { Button } from \"../ui/button\";\nimport { Cell, ColumnFiltersState, SortingState, Table } from \"@tanstack/react-table\";\nimport { download, generateCsv, mkConfig } from 'export-to-csv';\nimport { DownloadIcon } from \"lucide-react\";\nimport { DataTableViewOptions } from \"./view-options\";\n\ntype DataTableToolbarProps<TData> = {\n table: Table<TData>,\n toolbarRender?: (table: Table<TData>) => React.ReactNode,\n showDefaultToolbar?: boolean,\n defaultColumnFilters: ColumnFiltersState,\n defaultSorting: SortingState,\n showResetFilters?: boolean,\n}\n\nexport function DataTableToolbar<TData>({\n table,\n toolbarRender,\n showDefaultToolbar,\n defaultColumnFilters,\n defaultSorting,\n showResetFilters = true,\n}: DataTableToolbarProps<TData>) {\n const isFiltered = !deepPlainEquals(table.getState().columnFilters, defaultColumnFilters);\n const isSorted = !deepPlainEquals(table.getState().sorting, defaultSorting);\n\n return (\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-2 flex-wrap flex-1 stack-scope\">\n {toolbarRender?.(table)}\n {showResetFilters && (isFiltered || isSorted) && (\n <Button\n variant=\"ghost\"\n onClick={() => {\n table.setColumnFilters(defaultColumnFilters);\n table.setSorting(defaultSorting);\n }}\n className=\"h-8 px-2 lg:px-3\"\n >\n Reset filters\n <Cross2Icon className=\"ml-2 h-4 w-4\" />\n </Button>\n )}\n </div>\n {showDefaultToolbar && (\n <>\n <div className=\"flex items-center gap-2 flex-wrap\">\n <DataTableViewOptions table={table} />\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"ml-auto hidden h-8 lg:flex\"\n onClick={() => {\n const csvConfig = mkConfig({\n fieldSeparator: ',',\n filename: 'data',\n decimalSeparator: '.',\n useKeysAsHeaders: true,\n });\n\n const renderCellValue = (cell: Cell<TData, unknown>) => {\n const rendered = cell.renderValue();\n if (rendered === null) {\n return undefined;\n }\n if (['string', 'number', 'boolean', 'undefined'].includes(typeof rendered)) {\n return rendered;\n }\n if (rendered instanceof Date) {\n return rendered.toISOString();\n }\n if (typeof rendered === 'object') {\n return JSON.stringify(rendered);\n }\n };\n\n\n const rowModel = table.getCoreRowModel();\n const rows = rowModel.rows.map(row => Object.fromEntries(row.getAllCells().map(c => [c.column.id, renderCellValue(c)]).filter(([_, v]) => v !== undefined)));\n if (rows.length === 0) {\n alert(\"No data to export\");\n return;\n }\n const csv = generateCsv(csvConfig)(rows as any);\n download(csvConfig)(csv);\n }}\n >\n <DownloadIcon className=\"mr-2 h-4 w-4\" />\n Export CSV\n </Button>\n </div>\n </>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,yBAA2B;AAC3B,qBAAgC;AAChC,oBAAuB;AAEvB,2BAAgD;AAChD,0BAA6B;AAC7B,0BAAqC;AA2B3B;AAhBH,SAAS,iBAAwB;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,mBAAmB;AACrB,GAAiC;AAC/B,QAAM,aAAa,KAAC,gCAAgB,MAAM,SAAS,EAAE,eAAe,oBAAoB;AACxF,QAAM,WAAW,KAAC,gCAAgB,MAAM,SAAS,EAAE,SAAS,cAAc;AAE1E,SACE,6CAAC,SAAI,WAAU,qCACb;AAAA,iDAAC,SAAI,WAAU,wDACZ;AAAA,sBAAgB,KAAK;AAAA,MACrB,qBAAqB,cAAc,aAClC;AAAA,QAAC;AAAA;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,MAAM;AACb,kBAAM,iBAAiB,oBAAoB;AAC3C,kBAAM,WAAW,cAAc;AAAA,UACjC;AAAA,UACA,WAAU;AAAA,UACX;AAAA;AAAA,YAEC,4CAAC,iCAAW,WAAU,gBAAe;AAAA;AAAA;AAAA,MACvC;AAAA,OAEJ;AAAA,IACC,sBACC,2EACE,uDAAC,SAAI,WAAU,qCACb;AAAA,kDAAC,4CAAqB,OAAc;AAAA,MACpC;AAAA,QAAC;AAAA;AAAA,UACC,SAAQ;AAAA,UACR,MAAK;AAAA,UACL,WAAU;AAAA,UACV,SAAS,MAAM;AACb,kBAAM,gBAAY,+BAAS;AAAA,cACzB,gBAAgB;AAAA,cAChB,UAAU;AAAA,cACV,kBAAkB;AAAA,cAClB,kBAAkB;AAAA,YACpB,CAAC;AAED,kBAAM,kBAAkB,CAAC,SAA+B;AACtD,oBAAM,WAAW,KAAK,YAAY;AAClC,kBAAI,aAAa,MAAM;AACrB,uBAAO;AAAA,cACT;AACA,kBAAI,CAAC,UAAU,UAAU,WAAW,WAAW,EAAE,SAAS,OAAO,QAAQ,GAAG;AAC1E,uBAAO;AAAA,cACT;AACA,kBAAI,oBAAoB,MAAM;AAC5B,uBAAO,SAAS,YAAY;AAAA,cAC9B;AACA,kBAAI,OAAO,aAAa,UAAU;AAChC,uBAAO,KAAK,UAAU,QAAQ;AAAA,cAChC;AAAA,YACF;AAGA,kBAAM,WAAW,MAAM,gBAAgB;AACvC,kBAAM,OAAO,SAAS,KAAK,IAAI,SAAO,OAAO,YAAY,IAAI,YAAY,EAAE,IAAI,OAAK,CAAC,EAAE,OAAO,IAAI,gBAAgB,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,GAAG,CAAC,MAAM,MAAM,MAAS,CAAC,CAAC;AAC3J,gBAAI,KAAK,WAAW,GAAG;AACrB,oBAAM,mBAAmB;AACzB;AAAA,YACF;AACA,kBAAM,UAAM,kCAAY,SAAS,EAAE,IAAW;AAC9C,+CAAS,SAAS,EAAE,GAAG;AAAA,UACzB;AAAA,UAEA;AAAA,wDAAC,oCAAa,WAAU,gBAAe;AAAA,YAAE;AAAA;AAAA;AAAA,MAE3C;AAAA,OACF,GACF;AAAA,KAEJ;AAEJ;","names":[]}
@@ -1,6 +1,38 @@
1
- export function standardFilterFn(row, id, value) {
2
- return value.includes(row.getValue(id));
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/components/data-table/utils.tsx
21
+ var utils_exports = {};
22
+ __export(utils_exports, {
23
+ arrayFilterFn: () => arrayFilterFn,
24
+ standardFilterFn: () => standardFilterFn
25
+ });
26
+ module.exports = __toCommonJS(utils_exports);
27
+ function standardFilterFn(row, id, value) {
28
+ return value.includes(row.getValue(id));
3
29
  }
4
- export function arrayFilterFn(row, id, value) {
5
- return value.some((v) => row.getValue(id).includes(v));
30
+ function arrayFilterFn(row, id, value) {
31
+ return value.some((v) => row.getValue(id).includes(v));
6
32
  }
33
+ // Annotate the CommonJS export names for ESM import in node:
34
+ 0 && (module.exports = {
35
+ arrayFilterFn,
36
+ standardFilterFn
37
+ });
38
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/data-table/utils.tsx"],"sourcesContent":["export function standardFilterFn (row: any, id: string, value: any) {\n return value.includes(row.getValue(id));\n}\n\nexport function arrayFilterFn (row: any, id: string, value: any) {\n return value.some((v: any) => row.getValue(id).includes(v));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,SAAS,iBAAkB,KAAU,IAAY,OAAY;AAClE,SAAO,MAAM,SAAS,IAAI,SAAS,EAAE,CAAC;AACxC;AAEO,SAAS,cAAe,KAAU,IAAY,OAAY;AAC/D,SAAO,MAAM,KAAK,CAAC,MAAW,IAAI,SAAS,EAAE,EAAE,SAAS,CAAC,CAAC;AAC5D;","names":[]}
@@ -1,12 +1,72 @@
1
1
  "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { MixerHorizontalIcon } from "@radix-ui/react-icons";
4
- import { Button, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from "@stackframe/stack-ui";
5
- export function DataTableViewOptions({ table, }) {
6
- return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { variant: "outline", size: "sm", className: "ml-auto hidden h-8 lg:flex", children: [_jsx(MixerHorizontalIcon, { className: "mr-2 h-4 w-4" }), "View"] }) }), _jsxs(DropdownMenuContent, { align: "end", children: [_jsx(DropdownMenuLabel, { children: "Toggle columns" }), _jsx(DropdownMenuSeparator, {}), table
7
- .getAllColumns()
8
- .filter((column) => typeof column.accessorFn !== "undefined" && column.getCanHide())
9
- .map((column) => {
10
- return (_jsx(DropdownMenuCheckboxItem, { className: "capitalize", checked: column.getIsVisible(), onCheckedChange: (value) => column.toggleVisibility(!!value), children: column.id }, column.id));
11
- })] })] }));
2
+ "use strict";
3
+ "use client";
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+
22
+ // src/components/data-table/view-options.tsx
23
+ var view_options_exports = {};
24
+ __export(view_options_exports, {
25
+ DataTableViewOptions: () => DataTableViewOptions
26
+ });
27
+ module.exports = __toCommonJS(view_options_exports);
28
+ var import_react_icons = require("@radix-ui/react-icons");
29
+ var import_button = require("../ui/button.js");
30
+ var import_dropdown_menu = require("../ui/dropdown-menu.js");
31
+ var import_jsx_runtime = require("react/jsx-runtime");
32
+ function DataTableViewOptions({
33
+ table
34
+ }) {
35
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dropdown_menu.DropdownMenu, { children: [
36
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dropdown_menu.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
37
+ import_button.Button,
38
+ {
39
+ variant: "outline",
40
+ size: "sm",
41
+ className: "ml-auto hidden h-8 lg:flex",
42
+ children: [
43
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_icons.MixerHorizontalIcon, { className: "mr-2 h-4 w-4" }),
44
+ "View"
45
+ ]
46
+ }
47
+ ) }),
48
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dropdown_menu.DropdownMenuContent, { align: "end", children: [
49
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dropdown_menu.DropdownMenuLabel, { children: "Toggle columns" }),
50
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dropdown_menu.DropdownMenuSeparator, {}),
51
+ table.getAllColumns().filter(
52
+ (column) => typeof column.accessorFn !== "undefined" && column.getCanHide()
53
+ ).map((column) => {
54
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
55
+ import_dropdown_menu.DropdownMenuCheckboxItem,
56
+ {
57
+ className: "capitalize",
58
+ checked: column.getIsVisible(),
59
+ onCheckedChange: (value) => column.toggleVisibility(!!value),
60
+ children: column.id
61
+ },
62
+ column.id
63
+ );
64
+ })
65
+ ] })
66
+ ] });
12
67
  }
68
+ // Annotate the CommonJS export names for ESM import in node:
69
+ 0 && (module.exports = {
70
+ DataTableViewOptions
71
+ });
72
+ //# sourceMappingURL=view-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/data-table/view-options.tsx"],"sourcesContent":["\"use client\";\n\nimport { MixerHorizontalIcon } from \"@radix-ui/react-icons\";\nimport { Button } from \"../ui/button\";\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from \"../ui/dropdown-menu\";\nimport { Table } from \"@tanstack/react-table\";\n\ntype DataTableViewOptionsProps<TData> = {\n table: Table<TData>,\n}\n\nexport function DataTableViewOptions<TData>({\n table,\n}: DataTableViewOptionsProps<TData>) {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"ml-auto hidden h-8 lg:flex\"\n >\n <MixerHorizontalIcon className=\"mr-2 h-4 w-4\" />\n View\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n <DropdownMenuLabel>Toggle columns</DropdownMenuLabel>\n <DropdownMenuSeparator />\n {table\n .getAllColumns()\n .filter(\n (column) =>\n typeof column.accessorFn !== \"undefined\" && column.getCanHide()\n )\n .map((column) => {\n return (\n <DropdownMenuCheckboxItem\n key={column.id}\n className=\"capitalize\"\n checked={column.getIsVisible()}\n onCheckedChange={(value) => column.toggleVisibility(!!value)}\n >\n {column.id}\n </DropdownMenuCheckboxItem>\n );\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,yBAAoC;AACpC,oBAAuB;AACvB,2BAOO;AAaC;AAND,SAAS,qBAA4B;AAAA,EAC1C;AACF,GAAqC;AACnC,SACE,6CAAC,qCACC;AAAA,gDAAC,4CAAoB,SAAO,MAC1B;AAAA,MAAC;AAAA;AAAA,QACC,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,WAAU;AAAA,QAEV;AAAA,sDAAC,0CAAoB,WAAU,gBAAe;AAAA,UAAE;AAAA;AAAA;AAAA,IAElD,GACF;AAAA,IACA,6CAAC,4CAAoB,OAAM,OACzB;AAAA,kDAAC,0CAAkB,4BAAc;AAAA,MACjC,4CAAC,8CAAsB;AAAA,MACtB,MACE,cAAc,EACd;AAAA,QACC,CAAC,WACC,OAAO,OAAO,eAAe,eAAe,OAAO,WAAW;AAAA,MAClE,EACC,IAAI,CAAC,WAAW;AACf,eACE;AAAA,UAAC;AAAA;AAAA,YAEC,WAAU;AAAA,YACV,SAAS,OAAO,aAAa;AAAA,YAC7B,iBAAiB,CAAC,UAAU,OAAO,iBAAiB,CAAC,CAAC,KAAK;AAAA,YAE1D,iBAAO;AAAA;AAAA,UALH,OAAO;AAAA,QAMd;AAAA,MAEJ,CAAC;AAAA,OACL;AAAA,KACF;AAEJ;","names":[]}
@@ -1,14 +1,46 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { TooltipPortal } from "@radix-ui/react-tooltip";
3
- import { CircleAlert, Info } from "lucide-react";
4
- import { Tooltip, TooltipContent, TooltipTrigger, cn } from "..";
5
- export function SimpleTooltip(props) {
6
- const iconClassName = cn("w-4 h-4 text-muted-foreground", props.inline && "inline");
7
- const icon = props.type === 'warning' ?
8
- _jsx(CircleAlert, { className: iconClassName }) :
9
- props.type === 'info' ?
10
- _jsx(Info, { className: iconClassName }) :
11
- null;
12
- const trigger = (_jsxs(_Fragment, { children: [icon, props.children] }));
13
- return (_jsxs(Tooltip, { open: props.disabled ? false : undefined, children: [_jsx(TooltipTrigger, { asChild: true, children: props.inline ? (_jsx("span", { className: cn(props.className), children: trigger })) : (_jsx("div", { className: cn("flex items-center gap-1", props.className), children: trigger })) }), props.tooltip && _jsx(TooltipPortal, { children: _jsx(TooltipContent, { children: _jsx("div", { className: "max-w-60 text-center text-wrap whitespace-pre-wrap", children: props.tooltip }) }) })] }));
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/components/simple-tooltip.tsx
21
+ var simple_tooltip_exports = {};
22
+ __export(simple_tooltip_exports, {
23
+ SimpleTooltip: () => SimpleTooltip
24
+ });
25
+ module.exports = __toCommonJS(simple_tooltip_exports);
26
+ var import_react_tooltip = require("@radix-ui/react-tooltip");
27
+ var import_lucide_react = require("lucide-react");
28
+ var import__ = require("../index.js");
29
+ var import_jsx_runtime = require("react/jsx-runtime");
30
+ function SimpleTooltip(props) {
31
+ const iconClassName = (0, import__.cn)("w-4 h-4 text-muted-foreground", props.inline && "inline");
32
+ const icon = props.type === "warning" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.CircleAlert, { className: iconClassName }) : props.type === "info" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Info, { className: iconClassName }) : null;
33
+ const trigger = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
34
+ icon,
35
+ props.children
36
+ ] });
37
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import__.Tooltip, { open: props.disabled ? false : void 0, children: [
38
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.TooltipTrigger, { asChild: true, children: props.inline ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: (0, import__.cn)(props.className), children: trigger }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import__.cn)("flex items-center gap-1", props.className), children: trigger }) }),
39
+ props.tooltip && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_tooltip.TooltipPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.TooltipContent, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "max-w-60 text-center text-wrap whitespace-pre-wrap", children: props.tooltip }) }) })
40
+ ] });
14
41
  }
42
+ // Annotate the CommonJS export names for ESM import in node:
43
+ 0 && (module.exports = {
44
+ SimpleTooltip
45
+ });
46
+ //# sourceMappingURL=simple-tooltip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/simple-tooltip.tsx"],"sourcesContent":["import { TooltipPortal } from \"@radix-ui/react-tooltip\";\nimport { CircleAlert, Info } from \"lucide-react\";\nimport { Tooltip, TooltipContent, TooltipTrigger, cn } from \"..\";\n\nexport function SimpleTooltip(props: {\n tooltip: React.ReactNode,\n children?: React.ReactNode,\n type?: 'info' | 'warning',\n inline?: boolean,\n className?: string,\n disabled?: boolean,\n}) {\n const iconClassName = cn(\"w-4 h-4 text-muted-foreground\", props.inline && \"inline\");\n const icon = props.type === 'warning' ?\n <CircleAlert className={iconClassName} /> :\n props.type === 'info' ?\n <Info className={iconClassName} /> :\n null;\n\n const trigger = (\n <>{icon}{props.children}</>\n );\n\n return (\n <Tooltip open={props.disabled ? false : undefined}>\n <TooltipTrigger asChild>\n {props.inline ? (\n <span className={cn(props.className)}>\n {trigger}\n </span>\n ) : (\n <div className={cn(\"flex items-center gap-1\", props.className)}>\n {trigger}\n </div>\n )}\n </TooltipTrigger>\n {props.tooltip && <TooltipPortal>\n <TooltipContent>\n <div className=\"max-w-60 text-center text-wrap whitespace-pre-wrap\">\n {props.tooltip}\n </div>\n </TooltipContent>\n </TooltipPortal>}\n </Tooltip>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAA8B;AAC9B,0BAAkC;AAClC,eAA4D;AAYxD;AAVG,SAAS,cAAc,OAO3B;AACD,QAAM,oBAAgB,aAAG,iCAAiC,MAAM,UAAU,QAAQ;AAClF,QAAM,OAAO,MAAM,SAAS,YAC1B,4CAAC,mCAAY,WAAW,eAAe,IACvC,MAAM,SAAS,SACb,4CAAC,4BAAK,WAAW,eAAe,IAChC;AAEJ,QAAM,UACJ,4EAAG;AAAA;AAAA,IAAM,MAAM;AAAA,KAAS;AAG1B,SACE,6CAAC,oBAAQ,MAAM,MAAM,WAAW,QAAQ,QACtC;AAAA,gDAAC,2BAAe,SAAO,MACpB,gBAAM,SACL,4CAAC,UAAK,eAAW,aAAG,MAAM,SAAS,GAChC,mBACH,IAEA,4CAAC,SAAI,eAAW,aAAG,2BAA2B,MAAM,SAAS,GAC1D,mBACH,GAEJ;AAAA,IACC,MAAM,WAAW,4CAAC,sCACjB,sDAAC,2BACC,sDAAC,SAAI,WAAU,sDACZ,gBAAM,SACT,GACF,GACF;AAAA,KACF;AAEJ;","names":[]}