@schemavaults/ui 0.11.128

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 (509) hide show
  1. package/README.md +58 -0
  2. package/dist/components/error/ErrorPage/ErrorPage.d.ts +9 -0
  3. package/dist/components/error/ErrorPage/ErrorPage.js +25 -0
  4. package/dist/components/error/ErrorPage/ErrorPage.js.map +1 -0
  5. package/dist/components/error/ErrorPage/index.d.ts +3 -0
  6. package/dist/components/error/ErrorPage/index.js +3 -0
  7. package/dist/components/error/ErrorPage/index.js.map +1 -0
  8. package/dist/components/error/index.d.ts +2 -0
  9. package/dist/components/error/index.js +2 -0
  10. package/dist/components/error/index.js.map +1 -0
  11. package/dist/components/hoc/any-position-context-menu-hoc.d.ts +24 -0
  12. package/dist/components/hoc/any-position-context-menu-hoc.js +118 -0
  13. package/dist/components/hoc/any-position-context-menu-hoc.js.map +1 -0
  14. package/dist/components/hoc/index.d.ts +2 -0
  15. package/dist/components/hoc/index.js +2 -0
  16. package/dist/components/hoc/index.js.map +1 -0
  17. package/dist/components/hooks/index.d.ts +4 -0
  18. package/dist/components/hooks/index.js +3 -0
  19. package/dist/components/hooks/index.js.map +1 -0
  20. package/dist/components/hooks/use-debug.d.ts +2 -0
  21. package/dist/components/hooks/use-debug.js +23 -0
  22. package/dist/components/hooks/use-debug.js.map +1 -0
  23. package/dist/components/hooks/use-mobile.d.ts +2 -0
  24. package/dist/components/hooks/use-mobile.js +18 -0
  25. package/dist/components/hooks/use-mobile.js.map +1 -0
  26. package/dist/components/hooks/use-toast.d.ts +44 -0
  27. package/dist/components/hooks/use-toast.js +129 -0
  28. package/dist/components/hooks/use-toast.js.map +1 -0
  29. package/dist/components/layout/dashboard-layout/DashboardLayoutProps.d.ts +17 -0
  30. package/dist/components/layout/dashboard-layout/DashboardLayoutProps.js +2 -0
  31. package/dist/components/layout/dashboard-layout/DashboardLayoutProps.js.map +1 -0
  32. package/dist/components/layout/dashboard-layout/customizable-dashboard-component-type.d.ts +11 -0
  33. package/dist/components/layout/dashboard-layout/customizable-dashboard-component-type.js +2 -0
  34. package/dist/components/layout/dashboard-layout/customizable-dashboard-component-type.js.map +1 -0
  35. package/dist/components/layout/dashboard-layout/dashboard-layout-main-content-container.d.ts +5 -0
  36. package/dist/components/layout/dashboard-layout/dashboard-layout-main-content-container.js +15 -0
  37. package/dist/components/layout/dashboard-layout/dashboard-layout-main-content-container.js.map +1 -0
  38. package/dist/components/layout/dashboard-layout/dashboard-layout.d.ts +11 -0
  39. package/dist/components/layout/dashboard-layout/dashboard-layout.js +30 -0
  40. package/dist/components/layout/dashboard-layout/dashboard-layout.js.map +1 -0
  41. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-layout-sidebar-trigger.d.ts +3 -0
  42. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-layout-sidebar-trigger.js +18 -0
  43. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-layout-sidebar-trigger.js.map +1 -0
  44. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-admin-only-items-context.d.ts +1 -0
  45. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-admin-only-items-context.js +5 -0
  46. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-admin-only-items-context.js.map +1 -0
  47. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-content.d.ts +7 -0
  48. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-content.js +25 -0
  49. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-content.js.map +1 -0
  50. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-context-provider.d.ts +11 -0
  51. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-context-provider.js +10 -0
  52. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-context-provider.js.map +1 -0
  53. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-footer.d.ts +9 -0
  54. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-footer.js +10 -0
  55. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-footer.js.map +1 -0
  56. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-header.d.ts +10 -0
  57. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-header.js +39 -0
  58. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-header.js.map +1 -0
  59. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-item-definition.d.ts +11 -0
  60. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-item-definition.js +2 -0
  61. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-item-definition.js.map +1 -0
  62. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-item-group-renderer.d.ts +8 -0
  63. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-item-group-renderer.js +57 -0
  64. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-item-group-renderer.js.map +1 -0
  65. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-item-group.d.ts +7 -0
  66. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-item-group.js +2 -0
  67. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-item-group.js.map +1 -0
  68. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-item-renderer.d.ts +8 -0
  69. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-item-renderer.js +64 -0
  70. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-item-renderer.js.map +1 -0
  71. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-items-and-groups-context.d.ts +4 -0
  72. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-items-and-groups-context.js +4 -0
  73. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-items-and-groups-context.js.map +1 -0
  74. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-layout.d.ts +13 -0
  75. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-layout.js +30 -0
  76. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-layout.js.map +1 -0
  77. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-open-state-provider.d.ts +7 -0
  78. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-open-state-provider.js +31 -0
  79. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-open-state-provider.js.map +1 -0
  80. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-open-state.d.ts +7 -0
  81. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-open-state.js +8 -0
  82. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-open-state.js.map +1 -0
  83. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-sizing.d.ts +37 -0
  84. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-sizing.js +21 -0
  85. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar-sizing.js.map +1 -0
  86. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar.d.ts +4 -0
  87. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar.js +27 -0
  88. package/dist/components/layout/dashboard-layout/dashboard-sidebar/dashboard-sidebar.js.map +1 -0
  89. package/dist/components/layout/dashboard-layout/dashboard-sidebar/index.d.ts +12 -0
  90. package/dist/components/layout/dashboard-layout/dashboard-sidebar/index.js +8 -0
  91. package/dist/components/layout/dashboard-layout/dashboard-sidebar/index.js.map +1 -0
  92. package/dist/components/layout/dashboard-layout/dashboard-sidebar/useCloseDashboardSidebarOnRouteChange.d.ts +2 -0
  93. package/dist/components/layout/dashboard-layout/dashboard-sidebar/useCloseDashboardSidebarOnRouteChange.js +21 -0
  94. package/dist/components/layout/dashboard-layout/dashboard-sidebar/useCloseDashboardSidebarOnRouteChange.js.map +1 -0
  95. package/dist/components/layout/dashboard-layout/dashboard-sidebar/useDashboardSidebarItemsAndGroups.d.ts +3 -0
  96. package/dist/components/layout/dashboard-layout/dashboard-sidebar/useDashboardSidebarItemsAndGroups.js +11 -0
  97. package/dist/components/layout/dashboard-layout/dashboard-sidebar/useDashboardSidebarItemsAndGroups.js.map +1 -0
  98. package/dist/components/layout/dashboard-layout/dashboard-sidebar/useDashboardSidebarOpenState.d.ts +3 -0
  99. package/dist/components/layout/dashboard-layout/dashboard-sidebar/useDashboardSidebarOpenState.js +12 -0
  100. package/dist/components/layout/dashboard-layout/dashboard-sidebar/useDashboardSidebarOpenState.js.map +1 -0
  101. package/dist/components/layout/dashboard-layout/dashboard-sidebar/useDashboardSidebarOpenStateDispatch.d.ts +3 -0
  102. package/dist/components/layout/dashboard-layout/dashboard-sidebar/useDashboardSidebarOpenStateDispatch.js +9 -0
  103. package/dist/components/layout/dashboard-layout/dashboard-sidebar/useDashboardSidebarOpenStateDispatch.js.map +1 -0
  104. package/dist/components/layout/dashboard-layout/dashboard-sidebar/useDashboardSidebarSizing.d.ts +3 -0
  105. package/dist/components/layout/dashboard-layout/dashboard-sidebar/useDashboardSidebarSizing.js +8 -0
  106. package/dist/components/layout/dashboard-layout/dashboard-sidebar/useDashboardSidebarSizing.js.map +1 -0
  107. package/dist/components/layout/dashboard-layout/index.d.ts +6 -0
  108. package/dist/components/layout/dashboard-layout/index.js +4 -0
  109. package/dist/components/layout/dashboard-layout/index.js.map +1 -0
  110. package/dist/components/layout/dashboard-layout/toggle-dashboard-layout-collapsed-transition-time.d.ts +3 -0
  111. package/dist/components/layout/dashboard-layout/toggle-dashboard-layout-collapsed-transition-time.js +4 -0
  112. package/dist/components/layout/dashboard-layout/toggle-dashboard-layout-collapsed-transition-time.js.map +1 -0
  113. package/dist/components/layout/index.d.ts +6 -0
  114. package/dist/components/layout/index.js +4 -0
  115. package/dist/components/layout/index.js.map +1 -0
  116. package/dist/components/layout/page-column-container/index.d.ts +3 -0
  117. package/dist/components/layout/page-column-container/index.js +3 -0
  118. package/dist/components/layout/page-column-container/index.js.map +1 -0
  119. package/dist/components/layout/page-column-container/page-column-container.d.ts +12 -0
  120. package/dist/components/layout/page-column-container/page-column-container.js +14 -0
  121. package/dist/components/layout/page-column-container/page-column-container.js.map +1 -0
  122. package/dist/components/layout/themed-page-container/index.d.ts +3 -0
  123. package/dist/components/layout/themed-page-container/index.js +3 -0
  124. package/dist/components/layout/themed-page-container/index.js.map +1 -0
  125. package/dist/components/layout/themed-page-container/themed-page-container.d.ts +18 -0
  126. package/dist/components/layout/themed-page-container/themed-page-container.js +21 -0
  127. package/dist/components/layout/themed-page-container/themed-page-container.js.map +1 -0
  128. package/dist/components/navigation/back-button.d.ts +6 -0
  129. package/dist/components/navigation/back-button.js +8 -0
  130. package/dist/components/navigation/back-button.js.map +1 -0
  131. package/dist/components/navigation/index.d.ts +2 -0
  132. package/dist/components/navigation/index.js +2 -0
  133. package/dist/components/navigation/index.js.map +1 -0
  134. package/dist/components/ui/alert/alert.d.ts +29 -0
  135. package/dist/components/ui/alert/alert.js +35 -0
  136. package/dist/components/ui/alert/alert.js.map +1 -0
  137. package/dist/components/ui/alert/index.d.ts +2 -0
  138. package/dist/components/ui/alert/index.js +2 -0
  139. package/dist/components/ui/alert/index.js.map +1 -0
  140. package/dist/components/ui/background-blur/background-blur.d.ts +10 -0
  141. package/dist/components/ui/background-blur/background-blur.js +45 -0
  142. package/dist/components/ui/background-blur/background-blur.js.map +1 -0
  143. package/dist/components/ui/background-blur/index.d.ts +2 -0
  144. package/dist/components/ui/background-blur/index.js +2 -0
  145. package/dist/components/ui/background-blur/index.js.map +1 -0
  146. package/dist/components/ui/badge/badge-variants.d.ts +2 -0
  147. package/dist/components/ui/badge/badge-variants.js +7 -0
  148. package/dist/components/ui/badge/badge-variants.js.map +1 -0
  149. package/dist/components/ui/badge/badge.d.ts +10 -0
  150. package/dist/components/ui/badge/badge.js +24 -0
  151. package/dist/components/ui/badge/badge.js.map +1 -0
  152. package/dist/components/ui/badge/index.d.ts +2 -0
  153. package/dist/components/ui/badge/index.js +2 -0
  154. package/dist/components/ui/badge/index.js.map +1 -0
  155. package/dist/components/ui/button/button.d.ts +15 -0
  156. package/dist/components/ui/button/button.js +41 -0
  157. package/dist/components/ui/button/button.js.map +1 -0
  158. package/dist/components/ui/button/index.d.ts +3 -0
  159. package/dist/components/ui/button/index.js +3 -0
  160. package/dist/components/ui/button/index.js.map +1 -0
  161. package/dist/components/ui/card/card.d.ts +26 -0
  162. package/dist/components/ui/card/card.js +17 -0
  163. package/dist/components/ui/card/card.js.map +1 -0
  164. package/dist/components/ui/card/index.d.ts +2 -0
  165. package/dist/components/ui/card/index.js +2 -0
  166. package/dist/components/ui/card/index.js.map +1 -0
  167. package/dist/components/ui/checkbox/checkbox.d.ts +9 -0
  168. package/dist/components/ui/checkbox/checkbox.js +10 -0
  169. package/dist/components/ui/checkbox/checkbox.js.map +1 -0
  170. package/dist/components/ui/checkbox/index.d.ts +3 -0
  171. package/dist/components/ui/checkbox/index.js +3 -0
  172. package/dist/components/ui/checkbox/index.js.map +1 -0
  173. package/dist/components/ui/command/command.d.ts +39 -0
  174. package/dist/components/ui/command/command.js +29 -0
  175. package/dist/components/ui/command/command.js.map +1 -0
  176. package/dist/components/ui/command/index.d.ts +2 -0
  177. package/dist/components/ui/command/index.js +2 -0
  178. package/dist/components/ui/command/index.js.map +1 -0
  179. package/dist/components/ui/context-menu/context-menu.d.ts +25 -0
  180. package/dist/components/ui/context-menu/context-menu.js +52 -0
  181. package/dist/components/ui/context-menu/context-menu.js.map +1 -0
  182. package/dist/components/ui/context-menu/index.d.ts +2 -0
  183. package/dist/components/ui/context-menu/index.js +2 -0
  184. package/dist/components/ui/context-menu/index.js.map +1 -0
  185. package/dist/components/ui/datatable/datatable.d.ts +10 -0
  186. package/dist/components/ui/datatable/datatable.js +48 -0
  187. package/dist/components/ui/datatable/datatable.js.map +1 -0
  188. package/dist/components/ui/datatable/index.d.ts +2 -0
  189. package/dist/components/ui/datatable/index.js +2 -0
  190. package/dist/components/ui/datatable/index.js.map +1 -0
  191. package/dist/components/ui/dialog/dialog.d.ts +31 -0
  192. package/dist/components/ui/dialog/dialog.js +23 -0
  193. package/dist/components/ui/dialog/dialog.js.map +1 -0
  194. package/dist/components/ui/dialog/index.d.ts +2 -0
  195. package/dist/components/ui/dialog/index.js +2 -0
  196. package/dist/components/ui/dialog/index.js.map +1 -0
  197. package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +51 -0
  198. package/dist/components/ui/dropdown-menu/dropdown-menu.js +36 -0
  199. package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -0
  200. package/dist/components/ui/dropdown-menu/index.d.ts +2 -0
  201. package/dist/components/ui/dropdown-menu/index.js +2 -0
  202. package/dist/components/ui/dropdown-menu/index.js.map +1 -0
  203. package/dist/components/ui/file-input/FileInput.d.ts +17 -0
  204. package/dist/components/ui/file-input/FileInput.js +101 -0
  205. package/dist/components/ui/file-input/FileInput.js.map +1 -0
  206. package/dist/components/ui/file-input/fileToBuffer.d.ts +3 -0
  207. package/dist/components/ui/file-input/fileToBuffer.js +62 -0
  208. package/dist/components/ui/file-input/fileToBuffer.js.map +1 -0
  209. package/dist/components/ui/file-input/index.d.ts +2 -0
  210. package/dist/components/ui/file-input/index.js +2 -0
  211. package/dist/components/ui/file-input/index.js.map +1 -0
  212. package/dist/components/ui/file-input/serializeFile.d.ts +3 -0
  213. package/dist/components/ui/file-input/serializeFile.js +26 -0
  214. package/dist/components/ui/file-input/serializeFile.js.map +1 -0
  215. package/dist/components/ui/file-input/useDoesFilenameHaveValidFileExtension.d.ts +3 -0
  216. package/dist/components/ui/file-input/useDoesFilenameHaveValidFileExtension.js +27 -0
  217. package/dist/components/ui/file-input/useDoesFilenameHaveValidFileExtension.js.map +1 -0
  218. package/dist/components/ui/form.d.ts +41 -0
  219. package/dist/components/ui/form.js +65 -0
  220. package/dist/components/ui/form.js.map +1 -0
  221. package/dist/components/ui/fullscreen-image/fullscreen-image.d.ts +47 -0
  222. package/dist/components/ui/fullscreen-image/fullscreen-image.js +77 -0
  223. package/dist/components/ui/fullscreen-image/fullscreen-image.js.map +1 -0
  224. package/dist/components/ui/fullscreen-image/index.d.ts +3 -0
  225. package/dist/components/ui/fullscreen-image/index.js +3 -0
  226. package/dist/components/ui/fullscreen-image/index.js.map +1 -0
  227. package/dist/components/ui/hover-card/hover-card.d.ts +9 -0
  228. package/dist/components/ui/hover-card/hover-card.js +10 -0
  229. package/dist/components/ui/hover-card/hover-card.js.map +1 -0
  230. package/dist/components/ui/hover-card/index.d.ts +2 -0
  231. package/dist/components/ui/hover-card/index.js +2 -0
  232. package/dist/components/ui/hover-card/index.js.map +1 -0
  233. package/dist/components/ui/icon/DefaultIconSize.d.ts +2 -0
  234. package/dist/components/ui/icon/DefaultIconSize.js +3 -0
  235. package/dist/components/ui/icon/DefaultIconSize.js.map +1 -0
  236. package/dist/components/ui/icon/Icon.d.ts +4 -0
  237. package/dist/components/ui/icon/Icon.js +5 -0
  238. package/dist/components/ui/icon/Icon.js.map +1 -0
  239. package/dist/components/ui/icon/IconFacade.d.ts +4 -0
  240. package/dist/components/ui/icon/IconFacade.js +63 -0
  241. package/dist/components/ui/icon/IconFacade.js.map +1 -0
  242. package/dist/components/ui/icon/IconFromSvgDataUrl.d.ts +7 -0
  243. package/dist/components/ui/icon/IconFromSvgDataUrl.js +31 -0
  244. package/dist/components/ui/icon/IconFromSvgDataUrl.js.map +1 -0
  245. package/dist/components/ui/icon/IconFromSvgFilepath.d.ts +7 -0
  246. package/dist/components/ui/icon/IconFromSvgFilepath.js +43 -0
  247. package/dist/components/ui/icon/IconFromSvgFilepath.js.map +1 -0
  248. package/dist/components/ui/icon/IconFromUtf8XmlSvg.d.ts +6 -0
  249. package/dist/components/ui/icon/IconFromUtf8XmlSvg.js +18 -0
  250. package/dist/components/ui/icon/IconFromUtf8XmlSvg.js.map +1 -0
  251. package/dist/components/ui/icon/IconProps.d.ts +7 -0
  252. package/dist/components/ui/icon/IconProps.js +3 -0
  253. package/dist/components/ui/icon/IconProps.js.map +1 -0
  254. package/dist/components/ui/icon/IconSkeleton.d.ts +4 -0
  255. package/dist/components/ui/icon/IconSkeleton.js +8 -0
  256. package/dist/components/ui/icon/IconSkeleton.js.map +1 -0
  257. package/dist/components/ui/icon/LazySvgIcon.d.ts +7 -0
  258. package/dist/components/ui/icon/LazySvgIcon.js +10 -0
  259. package/dist/components/ui/icon/LazySvgIcon.js.map +1 -0
  260. package/dist/components/ui/icon/LoadedSvgIcon.d.ts +8 -0
  261. package/dist/components/ui/icon/LoadedSvgIcon.js +8 -0
  262. package/dist/components/ui/icon/LoadedSvgIcon.js.map +1 -0
  263. package/dist/components/ui/icon/RenderSvg.d.ts +7 -0
  264. package/dist/components/ui/icon/RenderSvg.js +24 -0
  265. package/dist/components/ui/icon/RenderSvg.js.map +1 -0
  266. package/dist/components/ui/icon/SvgDataUrl.d.ts +4 -0
  267. package/dist/components/ui/icon/SvgDataUrl.js +16 -0
  268. package/dist/components/ui/icon/SvgDataUrl.js.map +1 -0
  269. package/dist/components/ui/icon/index.d.ts +3 -0
  270. package/dist/components/ui/icon/index.js +3 -0
  271. package/dist/components/ui/icon/index.js.map +1 -0
  272. package/dist/components/ui/icon/parseSvgIcon.d.ts +8 -0
  273. package/dist/components/ui/icon/parseSvgIcon.js +27 -0
  274. package/dist/components/ui/icon/parseSvgIcon.js.map +1 -0
  275. package/dist/components/ui/icon/toReactSvgTransform.d.ts +2 -0
  276. package/dist/components/ui/icon/toReactSvgTransform.js +12 -0
  277. package/dist/components/ui/icon/toReactSvgTransform.js.map +1 -0
  278. package/dist/components/ui/index.d.ts +86 -0
  279. package/dist/components/ui/index.js +44 -0
  280. package/dist/components/ui/index.js.map +1 -0
  281. package/dist/components/ui/inline-menu.d.ts +21 -0
  282. package/dist/components/ui/inline-menu.js +28 -0
  283. package/dist/components/ui/inline-menu.js.map +1 -0
  284. package/dist/components/ui/input/index.d.ts +3 -0
  285. package/dist/components/ui/input/index.js +3 -0
  286. package/dist/components/ui/input/index.js.map +1 -0
  287. package/dist/components/ui/input/input.d.ts +9 -0
  288. package/dist/components/ui/input/input.js +10 -0
  289. package/dist/components/ui/input/input.js.map +1 -0
  290. package/dist/components/ui/key-value-with-skeleton/index.d.ts +3 -0
  291. package/dist/components/ui/key-value-with-skeleton/index.js +3 -0
  292. package/dist/components/ui/key-value-with-skeleton/index.js.map +1 -0
  293. package/dist/components/ui/key-value-with-skeleton/key-value-with-skeleton.d.ts +7 -0
  294. package/dist/components/ui/key-value-with-skeleton/key-value-with-skeleton.js +55 -0
  295. package/dist/components/ui/key-value-with-skeleton/key-value-with-skeleton.js.map +1 -0
  296. package/dist/components/ui/label/index.d.ts +3 -0
  297. package/dist/components/ui/label/index.js +3 -0
  298. package/dist/components/ui/label/index.js.map +1 -0
  299. package/dist/components/ui/label/label.d.ts +9 -0
  300. package/dist/components/ui/label/label.js +11 -0
  301. package/dist/components/ui/label/label.js.map +1 -0
  302. package/dist/components/ui/loading-page/index.d.ts +3 -0
  303. package/dist/components/ui/loading-page/index.js +3 -0
  304. package/dist/components/ui/loading-page/index.js.map +1 -0
  305. package/dist/components/ui/loading-page/loading-page.d.ts +5 -0
  306. package/dist/components/ui/loading-page/loading-page.js +7 -0
  307. package/dist/components/ui/loading-page/loading-page.js.map +1 -0
  308. package/dist/components/ui/navigation-menu/index.d.ts +2 -0
  309. package/dist/components/ui/navigation-menu/index.js +2 -0
  310. package/dist/components/ui/navigation-menu/index.js.map +1 -0
  311. package/dist/components/ui/navigation-menu/navigation-menu.d.ts +14 -0
  312. package/dist/components/ui/navigation-menu/navigation-menu.js +33 -0
  313. package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -0
  314. package/dist/components/ui/popover/index.d.ts +2 -0
  315. package/dist/components/ui/popover/index.js +2 -0
  316. package/dist/components/ui/popover/index.js.map +1 -0
  317. package/dist/components/ui/popover/popover.d.ts +9 -0
  318. package/dist/components/ui/popover/popover.js +10 -0
  319. package/dist/components/ui/popover/popover.js.map +1 -0
  320. package/dist/components/ui/radio-group/index.d.ts +2 -0
  321. package/dist/components/ui/radio-group/index.js +2 -0
  322. package/dist/components/ui/radio-group/index.js.map +1 -0
  323. package/dist/components/ui/radio-group/radio-group.d.ts +11 -0
  324. package/dist/components/ui/radio-group/radio-group.js +16 -0
  325. package/dist/components/ui/radio-group/radio-group.js.map +1 -0
  326. package/dist/components/ui/scroll-area/index.d.ts +1 -0
  327. package/dist/components/ui/scroll-area/index.js +2 -0
  328. package/dist/components/ui/scroll-area/index.js.map +1 -0
  329. package/dist/components/ui/scroll-area/scroll-area.d.ts +5 -0
  330. package/dist/components/ui/scroll-area/scroll-area.js +14 -0
  331. package/dist/components/ui/scroll-area/scroll-area.js.map +1 -0
  332. package/dist/components/ui/select/index.d.ts +2 -0
  333. package/dist/components/ui/select/index.js +2 -0
  334. package/dist/components/ui/select/index.js.map +1 -0
  335. package/dist/components/ui/select/select.d.ts +15 -0
  336. package/dist/components/ui/select/select.js +39 -0
  337. package/dist/components/ui/select/select.js.map +1 -0
  338. package/dist/components/ui/separator/index.d.ts +2 -0
  339. package/dist/components/ui/separator/index.js +2 -0
  340. package/dist/components/ui/separator/index.js.map +1 -0
  341. package/dist/components/ui/separator/separator.d.ts +9 -0
  342. package/dist/components/ui/separator/separator.js +11 -0
  343. package/dist/components/ui/separator/separator.js.map +1 -0
  344. package/dist/components/ui/sheet/index.d.ts +2 -0
  345. package/dist/components/ui/sheet/index.js +2 -0
  346. package/dist/components/ui/sheet/index.js.map +1 -0
  347. package/dist/components/ui/sheet/sheet.d.ts +13 -0
  348. package/dist/components/ui/sheet/sheet.js +41 -0
  349. package/dist/components/ui/sheet/sheet.js.map +1 -0
  350. package/dist/components/ui/skeleton/index.d.ts +3 -0
  351. package/dist/components/ui/skeleton/index.js +3 -0
  352. package/dist/components/ui/skeleton/index.js.map +1 -0
  353. package/dist/components/ui/skeleton/skeleton.d.ts +3 -0
  354. package/dist/components/ui/skeleton/skeleton.js +8 -0
  355. package/dist/components/ui/skeleton/skeleton.js.map +1 -0
  356. package/dist/components/ui/slider/index.d.ts +2 -0
  357. package/dist/components/ui/slider/index.js +2 -0
  358. package/dist/components/ui/slider/index.js.map +1 -0
  359. package/dist/components/ui/slider/slider.d.ts +11 -0
  360. package/dist/components/ui/slider/slider.js +11 -0
  361. package/dist/components/ui/slider/slider.js.map +1 -0
  362. package/dist/components/ui/split-pane/index.d.ts +3 -0
  363. package/dist/components/ui/split-pane/index.js +2 -0
  364. package/dist/components/ui/split-pane/index.js.map +1 -0
  365. package/dist/components/ui/split-pane/split-pane-acceptable-split-range.d.ts +3 -0
  366. package/dist/components/ui/split-pane/split-pane-acceptable-split-range.js +4 -0
  367. package/dist/components/ui/split-pane/split-pane-acceptable-split-range.js.map +1 -0
  368. package/dist/components/ui/split-pane/split-pane-directions.d.ts +3 -0
  369. package/dist/components/ui/split-pane/split-pane-directions.js +6 -0
  370. package/dist/components/ui/split-pane/split-pane-directions.js.map +1 -0
  371. package/dist/components/ui/split-pane/split-pane.d.ts +13 -0
  372. package/dist/components/ui/split-pane/split-pane.js +95 -0
  373. package/dist/components/ui/split-pane/split-pane.js.map +1 -0
  374. package/dist/components/ui/split-pane/useSplitPaneDirectionOrDefault.d.ts +3 -0
  375. package/dist/components/ui/split-pane/useSplitPaneDirectionOrDefault.js +25 -0
  376. package/dist/components/ui/split-pane/useSplitPaneDirectionOrDefault.js.map +1 -0
  377. package/dist/components/ui/status-blinker/index.d.ts +2 -0
  378. package/dist/components/ui/status-blinker/index.js +2 -0
  379. package/dist/components/ui/status-blinker/index.js.map +1 -0
  380. package/dist/components/ui/status-blinker/status-blinker.d.ts +8 -0
  381. package/dist/components/ui/status-blinker/status-blinker.js +24 -0
  382. package/dist/components/ui/status-blinker/status-blinker.js.map +1 -0
  383. package/dist/components/ui/stepper/base-stepper-state-type.d.ts +1 -0
  384. package/dist/components/ui/stepper/base-stepper-state-type.js +2 -0
  385. package/dist/components/ui/stepper/base-stepper-state-type.js.map +1 -0
  386. package/dist/components/ui/stepper/index.d.ts +2 -0
  387. package/dist/components/ui/stepper/index.js +2 -0
  388. package/dist/components/ui/stepper/index.js.map +1 -0
  389. package/dist/components/ui/stepper/step_definition.d.ts +25 -0
  390. package/dist/components/ui/stepper/step_definition.js +2 -0
  391. package/dist/components/ui/stepper/step_definition.js.map +1 -0
  392. package/dist/components/ui/stepper/stepper-body.d.ts +2 -0
  393. package/dist/components/ui/stepper/stepper-body.js +28 -0
  394. package/dist/components/ui/stepper/stepper-body.js.map +1 -0
  395. package/dist/components/ui/stepper/stepper-context-type.d.ts +9 -0
  396. package/dist/components/ui/stepper/stepper-context-type.js +2 -0
  397. package/dist/components/ui/stepper/stepper-context-type.js.map +1 -0
  398. package/dist/components/ui/stepper/stepper-context.d.ts +2 -0
  399. package/dist/components/ui/stepper/stepper-context.js +3 -0
  400. package/dist/components/ui/stepper/stepper-context.js.map +1 -0
  401. package/dist/components/ui/stepper/stepper-footer.d.ts +10 -0
  402. package/dist/components/ui/stepper/stepper-footer.js +89 -0
  403. package/dist/components/ui/stepper/stepper-footer.js.map +1 -0
  404. package/dist/components/ui/stepper/stepper-provider.d.ts +11 -0
  405. package/dist/components/ui/stepper/stepper-provider.js +38 -0
  406. package/dist/components/ui/stepper/stepper-provider.js.map +1 -0
  407. package/dist/components/ui/stepper/stepper-types.d.ts +21 -0
  408. package/dist/components/ui/stepper/stepper-types.js +2 -0
  409. package/dist/components/ui/stepper/stepper-types.js.map +1 -0
  410. package/dist/components/ui/stepper/stepper.d.ts +5 -0
  411. package/dist/components/ui/stepper/stepper.js +28 -0
  412. package/dist/components/ui/stepper/stepper.js.map +1 -0
  413. package/dist/components/ui/stepper/steps-indicator.d.ts +5 -0
  414. package/dist/components/ui/stepper/steps-indicator.js +36 -0
  415. package/dist/components/ui/stepper/steps-indicator.js.map +1 -0
  416. package/dist/components/ui/stepper/useStepperContext.d.ts +4 -0
  417. package/dist/components/ui/stepper/useStepperContext.js +13 -0
  418. package/dist/components/ui/stepper/useStepperContext.js.map +1 -0
  419. package/dist/components/ui/table.d.ts +34 -0
  420. package/dist/components/ui/table.js +21 -0
  421. package/dist/components/ui/table.js.map +1 -0
  422. package/dist/components/ui/tabs/Tabs.d.ts +23 -0
  423. package/dist/components/ui/tabs/Tabs.js +19 -0
  424. package/dist/components/ui/tabs/Tabs.js.map +1 -0
  425. package/dist/components/ui/tabs/index.d.ts +2 -0
  426. package/dist/components/ui/tabs/index.js +2 -0
  427. package/dist/components/ui/tabs/index.js.map +1 -0
  428. package/dist/components/ui/textarea/index.d.ts +3 -0
  429. package/dist/components/ui/textarea/index.js +3 -0
  430. package/dist/components/ui/textarea/index.js.map +1 -0
  431. package/dist/components/ui/textarea/textarea.d.ts +9 -0
  432. package/dist/components/ui/textarea/textarea.js +10 -0
  433. package/dist/components/ui/textarea/textarea.js.map +1 -0
  434. package/dist/components/ui/themed-page-background/index.d.ts +3 -0
  435. package/dist/components/ui/themed-page-background/index.js +3 -0
  436. package/dist/components/ui/themed-page-background/index.js.map +1 -0
  437. package/dist/components/ui/themed-page-background/themed-page-background.d.ts +16 -0
  438. package/dist/components/ui/themed-page-background/themed-page-background.js +23 -0
  439. package/dist/components/ui/themed-page-background/themed-page-background.js.map +1 -0
  440. package/dist/components/ui/toast/index.d.ts +2 -0
  441. package/dist/components/ui/toast/index.js +2 -0
  442. package/dist/components/ui/toast/index.js.map +1 -0
  443. package/dist/components/ui/toast/toast-variants.d.ts +2 -0
  444. package/dist/components/ui/toast/toast-variants.js +6 -0
  445. package/dist/components/ui/toast/toast-variants.js.map +1 -0
  446. package/dist/components/ui/toast/toast.d.ts +33 -0
  447. package/dist/components/ui/toast/toast.js +35 -0
  448. package/dist/components/ui/toast/toast.js.map +1 -0
  449. package/dist/components/ui/toaster/index.d.ts +3 -0
  450. package/dist/components/ui/toaster/index.js +3 -0
  451. package/dist/components/ui/toaster/index.js.map +1 -0
  452. package/dist/components/ui/toaster/toaster.d.ts +2 -0
  453. package/dist/components/ui/toaster/toaster.js +12 -0
  454. package/dist/components/ui/toaster/toaster.js.map +1 -0
  455. package/dist/components/ui/tooltip/index.d.ts +2 -0
  456. package/dist/components/ui/tooltip/index.js +2 -0
  457. package/dist/components/ui/tooltip/index.js.map +1 -0
  458. package/dist/components/ui/tooltip/tooltip.d.ts +14 -0
  459. package/dist/components/ui/tooltip/tooltip.js +15 -0
  460. package/dist/components/ui/tooltip/tooltip.js.map +1 -0
  461. package/dist/components/ui/typewriter-effect/cursor-blinker.d.ts +5 -0
  462. package/dist/components/ui/typewriter-effect/cursor-blinker.js +26 -0
  463. package/dist/components/ui/typewriter-effect/cursor-blinker.js.map +1 -0
  464. package/dist/components/ui/typewriter-effect/index.d.ts +2 -0
  465. package/dist/components/ui/typewriter-effect/index.js +2 -0
  466. package/dist/components/ui/typewriter-effect/index.js.map +1 -0
  467. package/dist/components/ui/typewriter-effect/typewriter-effect.d.ts +10 -0
  468. package/dist/components/ui/typewriter-effect/typewriter-effect.js +76 -0
  469. package/dist/components/ui/typewriter-effect/typewriter-effect.js.map +1 -0
  470. package/dist/components/ui/visually-hidden/index.d.ts +3 -0
  471. package/dist/components/ui/visually-hidden/index.js +3 -0
  472. package/dist/components/ui/visually-hidden/index.js.map +1 -0
  473. package/dist/components/ui/visually-hidden/visually-hidden.d.ts +2 -0
  474. package/dist/components/ui/visually-hidden/visually-hidden.js +3 -0
  475. package/dist/components/ui/visually-hidden/visually-hidden.js.map +1 -0
  476. package/dist/components/ui/wordmark/index.d.ts +3 -0
  477. package/dist/components/ui/wordmark/index.js +3 -0
  478. package/dist/components/ui/wordmark/index.js.map +1 -0
  479. package/dist/components/ui/wordmark/wordmark.d.ts +6 -0
  480. package/dist/components/ui/wordmark/wordmark.js +8 -0
  481. package/dist/components/ui/wordmark/wordmark.js.map +1 -0
  482. package/dist/framer-motion.d.ts +2 -0
  483. package/dist/framer-motion.js +3 -0
  484. package/dist/framer-motion.js.map +1 -0
  485. package/dist/index.d.ts +18 -0
  486. package/dist/index.js +20 -0
  487. package/dist/index.js.map +1 -0
  488. package/dist/lib/getTailwindThemeScreenBreakpoint.d.ts +2 -0
  489. package/dist/lib/getTailwindThemeScreenBreakpoint.js +5 -0
  490. package/dist/lib/getTailwindThemeScreenBreakpoint.js.map +1 -0
  491. package/dist/lib/utils.d.ts +2 -0
  492. package/dist/lib/utils.js +6 -0
  493. package/dist/lib/utils.js.map +1 -0
  494. package/dist/providers/brightness-theme/brightness-theme.d.ts +11 -0
  495. package/dist/providers/brightness-theme/brightness-theme.js +15 -0
  496. package/dist/providers/brightness-theme/brightness-theme.js.map +1 -0
  497. package/dist/providers/brightness-theme/index.d.ts +2 -0
  498. package/dist/providers/brightness-theme/index.js +2 -0
  499. package/dist/providers/brightness-theme/index.js.map +1 -0
  500. package/dist/providers/index.d.ts +4 -0
  501. package/dist/providers/index.js +4 -0
  502. package/dist/providers/index.js.map +1 -0
  503. package/dist/providers/lazy_framer.d.ts +6 -0
  504. package/dist/providers/lazy_framer.js +8 -0
  505. package/dist/providers/lazy_framer.js.map +1 -0
  506. package/dist/types/Link.d.ts +9 -0
  507. package/dist/types/Link.js +2 -0
  508. package/dist/types/Link.js.map +1 -0
  509. package/package.json +128 -0
@@ -0,0 +1,23 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as DialogPrimitive from "@radix-ui/react-dialog";
4
+ import { X } from "lucide-react";
5
+ import { cn } from "../../../lib/utils";
6
+ const Dialog = DialogPrimitive.Root;
7
+ const DialogTrigger = DialogPrimitive.Trigger;
8
+ const DialogPortal = DialogPrimitive.Portal;
9
+ const DialogClose = DialogPrimitive.Close;
10
+ const DialogOverlay = ({ className, ...props }) => (_jsx(DialogPrimitive.Overlay, { className: cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className), ...props }));
11
+ DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
12
+ const DialogContent = ({ className, children, ...props }) => (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { className: cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", className), ...props, children: [children, _jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [_jsx(X, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "Close" })] })] })] }));
13
+ DialogContent.displayName = DialogPrimitive.Content.displayName;
14
+ const DialogHeader = ({ className, ...props }) => (_jsx("div", { className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className), ...props }));
15
+ DialogHeader.displayName = "DialogHeader";
16
+ const DialogFooter = ({ className, ...props }) => (_jsx("div", { className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className), ...props }));
17
+ DialogFooter.displayName = "DialogFooter";
18
+ const DialogTitle = ({ className, ...props }) => (_jsx(DialogPrimitive.Title, { className: cn("text-lg font-semibold leading-none tracking-tight", className), ...props }));
19
+ DialogTitle.displayName = DialogPrimitive.Title.displayName;
20
+ const DialogDescription = ({ className, ...props }) => (_jsx(DialogPrimitive.Description, { className: cn("text-sm text-muted-foreground", className), ...props }));
21
+ DialogDescription.displayName = DialogPrimitive.Description.displayName;
22
+ export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
23
+ //# sourceMappingURL=dialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../../../src/components/ui/dialog/dialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAEjC,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEjC,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,CAAC;AAEpC,MAAM,aAAa,GAAG,eAAe,CAAC,OAAO,CAAC;AAE9C,MAAM,YAAY,GAAG,eAAe,CAAC,MAAM,CAAC;AAE5C,MAAM,WAAW,GAAG,eAAe,CAAC,KAAK,CAAC;AAE1C,MAAM,aAAa,GAAG,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACiD,EAAE,EAAE,CAAC,CAC9D,KAAC,eAAe,CAAC,OAAO,IACtB,SAAS,EAAE,EAAE,CACX,yJAAyJ,EACzJ,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC;AACF,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC,OAAO,CAAC,WAAW,CAAC;AAEhE,MAAM,aAAa,GAAG,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACiD,EAAE,EAAE,CAAC,CAC9D,MAAC,YAAY,eACX,KAAC,aAAa,KAAG,EACjB,MAAC,eAAe,CAAC,OAAO,IACtB,S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AAC,WAAW,CAAC,WAAW,CAAC;AAExE,OAAO,EACL,MAAM,EACN,YAAY,EACZ,aAAa,EACb,WAAW,EACX,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,GAClB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./dialog";
2
+ export type * from "./dialog";
@@ -0,0 +1,2 @@
1
+ export * from "./dialog";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/ui/dialog/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
@@ -0,0 +1,51 @@
1
+ import type { ReactElement, ComponentPropsWithoutRef, HTMLAttributes } from "react";
2
+ import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
3
+ declare const DropdownMenu: import("react").FC<DropdownMenuPrimitive.DropdownMenuProps>;
4
+ declare const DropdownMenuTrigger: import("react").ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
5
+ declare const DropdownMenuGroup: import("react").ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & import("react").RefAttributes<HTMLDivElement>>;
6
+ declare const DropdownMenuPortal: import("react").FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
7
+ declare const DropdownMenuSub: import("react").FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
8
+ declare const DropdownMenuRadioGroup: import("react").ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & import("react").RefAttributes<HTMLDivElement>>;
9
+ declare const DropdownMenuSubTrigger: {
10
+ ({ className, inset, children, ...props }: ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
11
+ inset?: string;
12
+ }): ReactElement;
13
+ displayName: string | undefined;
14
+ };
15
+ declare const DropdownMenuSubContent: {
16
+ ({ className, ...props }: ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>): ReactElement;
17
+ displayName: string | undefined;
18
+ };
19
+ declare const DropdownMenuContent: {
20
+ ({ className, sideOffset, ...props }: ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>): ReactElement;
21
+ displayName: string | undefined;
22
+ };
23
+ declare const DropdownMenuItem: {
24
+ ({ className, inset, ...props }: ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.DropdownMenuItem> & {
25
+ inset?: string;
26
+ }): ReactElement;
27
+ displayName: string | undefined;
28
+ };
29
+ declare const DropdownMenuCheckboxItem: {
30
+ ({ className, children, checked, ...props }: ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>): ReactElement;
31
+ displayName: string | undefined;
32
+ };
33
+ declare const DropdownMenuRadioItem: {
34
+ ({ className, children, ...props }: ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>): ReactElement;
35
+ displayName: string | undefined;
36
+ };
37
+ declare const DropdownMenuLabel: {
38
+ ({ className, inset, ...props }: ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
39
+ inset?: string;
40
+ }): import("react/jsx-runtime").JSX.Element;
41
+ displayName: string | undefined;
42
+ };
43
+ declare const DropdownMenuSeparator: {
44
+ ({ className, ...props }: ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>): ReactElement;
45
+ displayName: string | undefined;
46
+ };
47
+ declare const DropdownMenuShortcut: {
48
+ ({ className, ...props }: HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
49
+ displayName: string;
50
+ };
51
+ export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };
@@ -0,0 +1,36 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
4
+ import { Check, ChevronRight, Circle } from "lucide-react";
5
+ import { cn } from "../../../lib/utils";
6
+ const DropdownMenu = DropdownMenuPrimitive.Root;
7
+ const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
8
+ const DropdownMenuGroup = DropdownMenuPrimitive.Group;
9
+ const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
10
+ const DropdownMenuSub = DropdownMenuPrimitive.Sub;
11
+ const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
12
+ const DropdownMenuSubTrigger = ({ className, inset, children, ...props }) => (_jsxs(DropdownMenuPrimitive.SubTrigger, { className: cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent", inset && "pl-8", className), ...props, children: [children, _jsx(ChevronRight, { className: "ml-auto h-4 w-4" })] }));
13
+ DropdownMenuSubTrigger.displayName =
14
+ DropdownMenuPrimitive.SubTrigger.displayName;
15
+ const DropdownMenuSubContent = ({ className, ...props }) => (_jsx(DropdownMenuPrimitive.SubContent, { className: cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className), ...props }));
16
+ DropdownMenuSubContent.displayName =
17
+ DropdownMenuPrimitive.SubContent.displayName;
18
+ const DropdownMenuContent = ({ className, sideOffset = 4, ...props }) => (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { sideOffset: sideOffset, className: cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className), ...props }) }));
19
+ DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
20
+ const DropdownMenuItem = ({ className, inset, ...props }) => (_jsx(DropdownMenuPrimitive.Item, { className: cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled='true']:pointer-events-none data-[disabled='true']:opacity-50", inset && "pl-8", className), ...props }));
21
+ DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
22
+ const DropdownMenuCheckboxItem = ({ className, children, checked, ...props }) => (_jsxs(DropdownMenuPrimitive.CheckboxItem, { className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled='true']:pointer-events-none data-[disabled='true']:opacity-50", className), checked: checked, ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Check, { className: "h-4 w-4" }) }) }), children] }));
23
+ DropdownMenuCheckboxItem.displayName =
24
+ DropdownMenuPrimitive.CheckboxItem.displayName;
25
+ const DropdownMenuRadioItem = ({ className, children, ...props }) => (_jsxs(DropdownMenuPrimitive.RadioItem, { className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled='true']:pointer-events-none data-[disabled='true']:opacity-50", className), ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Circle, { className: "h-2 w-2 fill-current" }) }) }), children] }));
26
+ DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
27
+ const DropdownMenuLabel = ({ className, inset, ...props }) => (_jsx(DropdownMenuPrimitive.Label, { className: cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className), ...props }));
28
+ DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
29
+ const DropdownMenuSeparator = ({ className, ...props }) => (_jsx(DropdownMenuPrimitive.Separator, { className: cn("-mx-1 my-1 h-px bg-muted", className), ...props }));
30
+ DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
31
+ const DropdownMenuShortcut = ({ className, ...props }) => {
32
+ return (_jsx("span", { className: cn("ml-auto text-xs tracking-widest opacity-60", className), ...props }));
33
+ };
34
+ DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
35
+ export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };
36
+ //# sourceMappingURL=dropdown-menu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dropdown-menu.js","sourceRoot":"","sources":["../../../../src/components/ui/dropdown-menu/dropdown-menu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAGZ,OAAO,KAAK,qBAAqB,MAAM,+BAA+B,CAAA;AACtE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE1D,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAEhC,MAAM,YAAY,GAAG,qBAAqB,CAAC,IAAI,CAAA;AAE/C,MAAM,mBAAmB,GAAG,qBAAqB,CAAC,OAAO,CAAA;AAEzD,MAAM,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,EAGT,EACD,EAAE,CAAC,CAAC,KAAC,qBAAqB,CAAC,KAAK,IAChC,SAAS,EAAE,EAAE,CACX,mCAAmC,EACnC,KAAK,IAAI,MAAM,EACf,SAAS,CACV,KACG,KAAK,GACT,CAAC,CAAA;AACH,iBAAiB,CAAC,WAAW,GAAG,qBAAqB,CAAC,KAAK,CAAC,WAAW,CAAA;AAEvE,MAAM,qBAAqB,GAAG,CAC5B,EACE,SAAS,EACT,GAAG,KAAK,EACyD,EACrD,EAAE,CAAC,CAAC,KAAC,qBAAqB,CAAC,SAAS,IAClD,SAAS,EAAE,EAAE,CAAC,0BAA0B,EAAE,SAAS,CAAC,KAChD,KAAK,GACT,CAAC,CAAA;AACH,qBAAqB,CAAC,WAAW,GAAG,qBAAqB,CAAC,SAAS,CAAC,WAAW,CAAA;AAE/E,MAAM,oBAAoB,GAAG,CAAC,EAC5B,SAAS,EACT,GAAG,KAAK,EACwB,EAAE,EAAE;IACpC,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CAAC,4CAA4C,EAAE,SAAS,CAAC,KAClE,KAAK,GACT,CACH,CAAA;AACH,CAAC,CAAA;AACD,oBAAoB,CAAC,WAAW,GAAG,sBAAsB,CAAA;AAEzD,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,GACvB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from "./dropdown-menu";
2
+ export type * from "./dropdown-menu";
@@ -0,0 +1,2 @@
1
+ export * from "./dropdown-menu";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/ui/dropdown-menu/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { type ReactElement } from "react";
2
+ export interface FileInputProps<SerializedFileType = string> {
3
+ id: string;
4
+ disabled?: boolean;
5
+ onBlur?: () => void;
6
+ setValue: (serialized_file: SerializedFileType) => void;
7
+ expectedFileExtensions?: readonly `.${string}`[];
8
+ debug?: boolean;
9
+ serialize: (buf: Buffer, debug?: boolean) => SerializedFileType;
10
+ }
11
+ /**
12
+ *
13
+ * @param param0 FileInputProps
14
+ * @returns FileInput component. Calls 'setValue' with the selected file
15
+ */
16
+ export declare function FileInput<SerializedFileType = string>({ id, disabled, onBlur, setValue, ...props }: FileInputProps<SerializedFileType>): ReactElement;
17
+ export default FileInput;
@@ -0,0 +1,101 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useDoesFilenameHaveValidFileExtension } from "./useDoesFilenameHaveValidFileExtension";
4
+ import fileToBase64UrlEncoded from "./serializeFile";
5
+ import { cn } from "../../../lib/utils";
6
+ import { Input } from "../../ui/input";
7
+ import { useToast } from "../../hooks/use-toast";
8
+ import { useCallback, useMemo, } from "react";
9
+ /**
10
+ *
11
+ * @param param0 FileInputProps
12
+ * @returns FileInput component. Calls 'setValue' with the selected file
13
+ */
14
+ export function FileInput({ id, disabled, onBlur, setValue, ...props }) {
15
+ const debug = props.debug ?? false;
16
+ const { toast } = useToast();
17
+ const hasValidFileExtensionsExplicitlyDefined = useMemo(() => {
18
+ return (Array.isArray(props.expectedFileExtensions) &&
19
+ props.expectedFileExtensions.length >= 1);
20
+ }, [props.expectedFileExtensions]);
21
+ const doesFilenameHaveValidFileExtension = useDoesFilenameHaveValidFileExtension({
22
+ expectedFileExtensions: props.expectedFileExtensions,
23
+ });
24
+ const onFileChange = useCallback(async (e) => {
25
+ if (debug) {
26
+ console.log("[FileInput] onChange()");
27
+ }
28
+ const files = e.target.files;
29
+ if (!files || !(files instanceof FileList)) {
30
+ toast({
31
+ variant: "destructive",
32
+ title: "Failed to parse data from file input",
33
+ description: "Event did not contain a files list.",
34
+ });
35
+ return;
36
+ }
37
+ if (files.length < 1) {
38
+ console.error("Expected at least one file in the files list, but received: ", files.length);
39
+ toast({
40
+ variant: "destructive",
41
+ title: "Failed to parse data from file input",
42
+ description: "Expected at least one file in the files list",
43
+ });
44
+ return;
45
+ }
46
+ const file = files[0];
47
+ if (!file) {
48
+ throw new Error("Expected at least one file, index 0 is null");
49
+ }
50
+ console.assert(!!file, file instanceof File, "Expected 'file' to be truthy and an instance of 'File' if this point was reached!");
51
+ const filename = file.name;
52
+ if (hasValidFileExtensionsExplicitlyDefined) {
53
+ if (debug) {
54
+ console.log("[FileInput] Validating that uploaded file meets explicitly defined file extension requirements: ", props.expectedFileExtensions);
55
+ }
56
+ if (!Array.isArray(props.expectedFileExtensions)) {
57
+ throw new Error("Expected at least 1 valid file extension to have been defined if this point was reached!");
58
+ }
59
+ const exts = props.expectedFileExtensions;
60
+ if (!doesFilenameHaveValidFileExtension(filename)) {
61
+ const errMsg = exts.length === 1
62
+ ? `Expected file name to end in: '${exts[0]}'`
63
+ : `Expected file name to end in one of: ${exts.map((ext) => `'${ext}'`).join(",")}`;
64
+ console.error(errMsg);
65
+ toast({
66
+ variant: "destructive",
67
+ title: "Error saving file(s) uploaded via file input",
68
+ description: errMsg,
69
+ });
70
+ return;
71
+ }
72
+ }
73
+ if (typeof props.serialize !== "function") {
74
+ throw new Error("FileInput component expected to receive a 'bufferToBase64Url' function!");
75
+ }
76
+ if (debug) {
77
+ console.log(`[FileInput] Attempting to base64url-encode file '${file.name}'...`);
78
+ }
79
+ let base64url_encoded;
80
+ try {
81
+ base64url_encoded = await fileToBase64UrlEncoded(file, props.serialize, debug);
82
+ }
83
+ catch (e) {
84
+ console.error("Failed to encode data from uploaded file for uploading: ", e);
85
+ toast({
86
+ variant: "destructive",
87
+ title: "Failed to encode data from uploaded file for uploading!",
88
+ description: e instanceof Error ? e.message : "An unknown error has occurred!",
89
+ });
90
+ return;
91
+ }
92
+ if (debug) {
93
+ console.log("[FileInput] Successfully encoded file data as base64url: ", base64url_encoded);
94
+ }
95
+ setValue(base64url_encoded);
96
+ return;
97
+ }, [debug, toast, props.serialize, setValue]);
98
+ return (_jsx("div", { className: "w-full p-2", children: _jsx(Input, { id: id, type: "file", disabled: disabled, onBlur: onBlur, onChange: onFileChange, className: cn(disabled ? "hover:cursor-not-allowed" : "hover:cursor-pointer") }) }));
99
+ }
100
+ export default FileInput;
101
+ //# sourceMappingURL=FileInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileInput.js","sourceRoot":"","sources":["../../../../src/components/ui/file-input/FileInput.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,qCAAqC,EAAE,MAAM,yCAAyC,CAAC;AAChG,OAAO,sBAAsB,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EACL,WAAW,EACX,OAAO,GAGR,MAAM,OAAO,CAAC;AAYf;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAA8B,EACrD,EAAE,EACF,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,GAAG,KAAK,EAC2B;IACnC,MAAM,KAAK,GAAY,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC;IAC5C,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAC;IAE7B,MAAM,uCAAuC,GAC3C,OAAO,CAAC,GAAY,EAAE;QACpB,OAAO,CACL,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,sBAAsB,CAAC;YAC3C,KAAK,CAAC,sBAAsB,CAAC,MAAM,IAAI,CAAC,CACzC,CAAC;IACJ,CAAC,EAAE,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,CAAC;IAErC,MAAM,kCAAkC,G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;gBACtB,KAAK,EAAE,yDAAyD;gBAChE,WAAW,EACT,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,gCAAgC;aACpE,CAAC,CAAC;YACH,OAAO;QACT,CAAC;QAED,IAAI,KAAK,EAAE,CAAC;YACV,OAAO,CAAC,GAAG,CACT,2DAA2D,EAC3D,iBAAiB,CAClB,CAAC;QACJ,CAAC;QAED,QAAQ,CAAC,iBAAiB,CAAC,CAAC;QAE5B,OAAO;IACT,CAAC,EACD,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,SAAS,EAAE,QAAQ,CAAC,CAC1C,CAAC;IAEF,OAAO,CACL,cAAK,SAAS,EAAC,YAAY,YACzB,KAAC,KAAK,IACJ,EAAE,EAAE,EAAE,EACN,IAAI,EAAC,MAAM,EACX,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,EAAE,CACX,QAAQ,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,sBAAsB,CAC/D,GACD,GACE,CACP,CAAC;AACJ,CAAC;AAED,eAAe,SAAS,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Buffer } from "buffer";
2
+ export declare function bufferFromFile(file: File, debug?: boolean): Promise<Buffer>;
3
+ export default bufferFromFile;
@@ -0,0 +1,62 @@
1
+ import { Buffer } from "buffer";
2
+ export async function bufferFromFile(file, debug = false) {
3
+ if (debug) {
4
+ console.log(`[bufferFromFile] Attempting to extract file data from file '${file.name}'...`);
5
+ }
6
+ if (typeof file !== "object") {
7
+ throw new Error(`Expected 'file' to have 'typeof' result equal to 'object'! Received: '${typeof file}'`);
8
+ }
9
+ if (!(file instanceof File)) {
10
+ throw new Error(`Expected input object to encode as base64url to be a 'File' instance, received value of type '${typeof file}'!`);
11
+ }
12
+ if ((file.hasOwnProperty("bytes") || "bytes" in file) &&
13
+ typeof file.bytes === "function") {
14
+ if (debug) {
15
+ console.log("[bufferFromFile] File reference has 'bytes' method for extracting data! Attempting to use .bytes()...");
16
+ }
17
+ return Buffer.from(await file.bytes());
18
+ }
19
+ else if ((file.hasOwnProperty("arrayBuffer") || "arrayBuffer" in file) &&
20
+ typeof file.arrayBuffer === "function") {
21
+ if (debug) {
22
+ console.log("[bufferFromFile] File reference has 'arrayBuffer' method for extracting data! Attempting to use .arrayBuffer()...");
23
+ }
24
+ const arrayBuffer = await file.arrayBuffer();
25
+ if (debug) {
26
+ console.log("[bufferFromFile] Sucessfully used .arrayBuffer() to extract file data!");
27
+ }
28
+ return Buffer.from(arrayBuffer);
29
+ }
30
+ else {
31
+ if (debug) {
32
+ console.log("[bufferFromFile] File reference does not appear to have 'bytes' or 'arrayBuffer' methods for extracting data! Attempting to use 'FileReader' approach...");
33
+ }
34
+ try {
35
+ return new Promise((resolve, reject) => {
36
+ const reader = new FileReader();
37
+ reader.onload = () => {
38
+ const result = reader.result;
39
+ if (typeof result === "string" || !result) {
40
+ reject("FileReader failed to extract data buffer from input File!");
41
+ return;
42
+ }
43
+ resolve(Buffer.from(result));
44
+ return;
45
+ };
46
+ reader.onerror = (e) => {
47
+ console.error("Error reading file contents with FileReader: ", e);
48
+ reject("Error reading file contents with FileReader!");
49
+ };
50
+ reader.readAsArrayBuffer(file);
51
+ });
52
+ }
53
+ catch (e) {
54
+ console.error("Failed to read file data buffer using 'FileReader' instance: ", e);
55
+ throw new Error("Failed to read file data buffer using 'FileReader' instance!");
56
+ }
57
+ console.warn("'File' interface does not appear to have 'bytes' or 'arrayBuffer' methods!");
58
+ throw new Error("Failed to extract file data from 'File' instance!");
59
+ }
60
+ }
61
+ export default bufferFromFile;
62
+ //# sourceMappingURL=fileToBuffer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fileToBuffer.js","sourceRoot":"","sources":["../../../../src/components/ui/file-input/fileToBuffer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,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C;QACN,IAAI,KAAK,EAAE,CAAC;YACV,OAAO,CAAC,GAAG,CACT,0JAA0J,CAC3J,CAAC;QACJ,CAAC;QAED,IAAI,CAAC;YACH,OAAO,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;gBAC7C,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;gBAChC,MAAM,CAAC,MAAM,GAAG,GAAG,EAAE;oBACnB,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;oBAC7B,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,MAAM,EAAE,CAAC;wBAC1C,MAAM,CAAC,2DAA2D,CAAC,CAAC;wBACpE,OAAO;oBACT,CAAC;oBACD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;oBAC7B,OAAO;gBACT,CAAC,CAAC;gBACF,MAAM,CAAC,OAAO,GAAG,CAAC,CAAU,EAAE,EAAE;oBAC9B,OAAO,CAAC,KAAK,CAAC,+CAA+C,EAAE,CAAC,CAAC,CAAC;oBAClE,MAAM,CAAC,8CAA8C,CAAC,CAAC;gBACzD,CAAC,CAAC;gBACF,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;YACjC,CAAC,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,CAAU,EAAE,CAAC;YACpB,OAAO,CAAC,KAAK,CACX,+DAA+D,EAC/D,CAAC,CACF,CAAC;YACF,MAAM,IAAI,KAAK,CACb,8DAA8D,CAC/D,CAAC;QACJ,CAAC;QAED,OAAO,CAAC,IAAI,CACV,4EAA4E,CAC7E,CAAC;QACF,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACvE,CAAC;AACH,CAAC;AAED,eAAe,cAAc,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { FileInput, FileInput as default } from "./FileInput";
2
+ export type { FileInputProps } from "./FileInput";
@@ -0,0 +1,2 @@
1
+ export { FileInput, FileInput as default } from "./FileInput";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/ui/file-input/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,IAAI,OAAO,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Buffer } from "buffer";
2
+ export declare function serializeFile<SerializedFileType = string>(file: File, serializeFromBuffer: (buf: Buffer, debug: boolean) => SerializedFileType, debug?: boolean): Promise<SerializedFileType>;
3
+ export default serializeFile;
@@ -0,0 +1,26 @@
1
+ import bufferFromFile from "./fileToBuffer";
2
+ export async function serializeFile(file, serializeFromBuffer, debug = false) {
3
+ if (debug) {
4
+ console.log(`[fileToBase64UrlEncoded] Attempting to extract buffer from file '${file.name}'...`);
5
+ }
6
+ let file_buffer;
7
+ try {
8
+ file_buffer = await bufferFromFile(file, debug);
9
+ }
10
+ catch (e) {
11
+ console.error(`[fileToBase64UrlEncoded] Failed to load input file '${file.name}' into data buffer: `, e);
12
+ throw new Error(`Failed to load input file '${file.name}' into data buffer!`);
13
+ }
14
+ if (debug) {
15
+ console.log(`[fileToBase64UrlEncoded] Successfully loaded file data into buffer! Size: '${file_buffer.length} bytes'`);
16
+ }
17
+ try {
18
+ return serializeFromBuffer(file_buffer, debug);
19
+ }
20
+ catch (e) {
21
+ console.error(`Failed to encode input file '${file.name}' into: `, e);
22
+ throw new Error(`Failed to encode input file '${file.name}' as 'base64url'!`);
23
+ }
24
+ }
25
+ export default serializeFile;
26
+ //# sourceMappingURL=serializeFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serializeFile.js","sourceRoot":"","sources":["../../../../src/components/ui/file-input/serializeFile.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,gBAAgB,CAAC;AAG5C,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,IAAU,EACV,mBAAwE,EACxE,QAAiB,KAAK;IAEtB,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,CAAC,GAAG,CACT,oEAAoE,IAAI,CAAC,IAAI,MAAM,CACpF,CAAC;IACJ,CAAC;IAED,IAAI,WAAmB,CAAC;IACxB,IAAI,CAAC;QACH,WAAW,GAAG,MAAM,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAClD,CAAC;IAAC,OAAO,CAAU,EAAE,CAAC;QACpB,OAAO,CAAC,KAAK,CACX,uDAAuD,IAAI,CAAC,IAAI,sBAAsB,EACtF,CAAC,CACF,CAAC;QACF,MAAM,IAAI,KAAK,CACb,8BAA8B,IAAI,CAAC,IAAI,qBAAqB,CAC7D,CAAC;IACJ,CAAC;IAED,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,CAAC,GAAG,CACT,8EAA8E,WAAW,CAAC,MAAM,SAAS,CAC1G,CAAC;IACJ,CAAC;IAED,IAAI,CAAC;QACH,OAAO,mBAAmB,CAAC,WAA4B,EAAE,KAAK,CAAC,CAAC;IAClE,CAAC;IAAC,OAAO,CAAU,EAAE,CAAC;QACpB,OAAO,CAAC,KAAK,CAAC,gCAAgC,IAAI,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC,CAAC;QACtE,MAAM,IAAI,KAAK,CACb,gCAAgC,IAAI,CAAC,IAAI,mBAAmB,CAC7D,CAAC;IACJ,CAAC;AACH,CAAC;AAED,eAAe,aAAa,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare function useDoesFilenameHaveValidFileExtension(opts: {
2
+ expectedFileExtensions?: readonly `.${string}`[];
3
+ }): (filename: string) => boolean;
@@ -0,0 +1,27 @@
1
+ "use client";
2
+ import { useCallback } from "react";
3
+ export function useDoesFilenameHaveValidFileExtension(opts) {
4
+ const doesFilenameHaveValidFileExtension = useCallback((filename) => {
5
+ if (typeof opts.expectedFileExtensions === "undefined" ||
6
+ !opts.expectedFileExtensions) {
7
+ return true;
8
+ }
9
+ if (!Array.isArray(opts.expectedFileExtensions)) {
10
+ throw new Error("Expected there to be a list of valid file extensions if this point was reached!");
11
+ }
12
+ else if (opts.expectedFileExtensions.length === 0) {
13
+ throw new Error("Expected 'expectedFileExtensions' to be non-empty, if supplied!");
14
+ }
15
+ if (!opts.expectedFileExtensions.every((ext) => ext.startsWith("."))) {
16
+ throw new Error("Expected every file extension in 'expectedFileExtensions' to start with a '.'!");
17
+ }
18
+ if (opts.expectedFileExtensions.some((ext) => {
19
+ return filename.endsWith(ext);
20
+ })) {
21
+ return true;
22
+ }
23
+ return false;
24
+ }, [opts.expectedFileExtensions]);
25
+ return doesFilenameHaveValidFileExtension;
26
+ }
27
+ //# sourceMappingURL=useDoesFilenameHaveValidFileExtension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDoesFilenameHaveValidFileExtension.js","sourceRoot":"","sources":["../../../../src/components/ui/file-input/useDoesFilenameHaveValidFileExtension.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,MAAM,UAAU,qCAAqC,CAAC,IAErD;IACC,MAAM,kCAAkC,GAAG,WAAW,CACpD,CAAC,QAAgB,EAAE,EAAE;QACnB,IACE,OAAO,IAAI,CAAC,sBAAsB,KAAK,WAAW;YAClD,CAAC,IAAI,CAAC,sBAAsB,EAC5B,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,EAAE,CAAC;YAChD,MAAM,IAAI,KAAK,CACb,iFAAiF,CAClF,CAAC;QACJ,CAAC;aAAM,IAAI,IAAI,CAAC,sBAAsB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACpD,MAAM,IAAI,KAAK,CACb,iEAAiE,CAClE,CAAC;QACJ,CAAC;QAED,IACE,CAAC,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EACxE,CAAC;YACD,MAAM,IAAI,KAAK,CACb,gFAAgF,CACjF,CAAC;QACJ,CAAC;QAED,IACE,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC,GAAW,EAAE,EAAE;YAC/C,OAAO,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QAChC,CAAC,CAAC,EACF,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC,EACD,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAC9B,CAAC;IAEF,OAAO,kCAAkC,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,41 @@
1
+ export { useForm, useFormContext, useFormState } from "react-hook-form";
2
+ export type { UseFormReturn, ControllerRenderProps as FormControllerRenderProps, FieldPath as FormFieldPath, FieldValues as FormFieldValues, FieldPathValue as FormFieldPathValue, FieldArrayPath as FormFieldArrayPath, FieldPathByValue as FormFieldPathByValue, FormState, FormSubmitHandler, FieldName as FormFieldName, FieldArray as FormFieldArray, FieldError as FormFieldError, } from "react-hook-form";
3
+ import { type ReactElement, type HTMLAttributes, type ComponentPropsWithoutRef, type ReactNode } from "react";
4
+ import * as LabelPrimitive from "@radix-ui/react-label";
5
+ import { Slot } from "@radix-ui/react-slot";
6
+ import { type ControllerProps, type FieldPath, type FieldValues } from "react-hook-form";
7
+ declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: import("react-hook-form").FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
8
+ declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => ReactElement;
9
+ declare const useFormField: () => {
10
+ invalid: boolean;
11
+ isDirty: boolean;
12
+ isTouched: boolean;
13
+ isValidating: boolean;
14
+ error?: import("react-hook-form").FieldError;
15
+ id: string;
16
+ name: string;
17
+ formItemId: string;
18
+ formDescriptionId: string;
19
+ formMessageId: string;
20
+ };
21
+ declare const FormItem: {
22
+ ({ className, ...props }: HTMLAttributes<HTMLDivElement>): ReactElement;
23
+ displayName: string;
24
+ };
25
+ declare const FormLabel: {
26
+ ({ className, ...props }: ComponentPropsWithoutRef<typeof LabelPrimitive.Root>): ReactElement;
27
+ displayName: string;
28
+ };
29
+ declare const FormControl: {
30
+ (props: ComponentPropsWithoutRef<typeof Slot>): ReactElement;
31
+ displayName: string;
32
+ };
33
+ declare const FormDescription: {
34
+ ({ className, ...props }: HTMLAttributes<HTMLParagraphElement>): ReactElement;
35
+ displayName: string;
36
+ };
37
+ declare const FormMessage: {
38
+ ({ className, children, ...props }: HTMLAttributes<HTMLParagraphElement>): ReactNode;
39
+ displayName: string;
40
+ };
41
+ export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, };
@@ -0,0 +1,65 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ export { useForm, useFormContext, useFormState } from "react-hook-form";
4
+ import { createContext, useContext, useId, } from "react";
5
+ import { Slot } from "@radix-ui/react-slot";
6
+ import { Controller, FormProvider, useFormContext, } from "react-hook-form";
7
+ import { cn } from "../../lib/utils";
8
+ import { Label } from "../ui/label";
9
+ const Form = FormProvider;
10
+ const FormFieldContext = createContext({});
11
+ const FormField = ({ ...props }) => {
12
+ return (_jsx(FormFieldContext.Provider, { value: { name: props.name }, children: _jsx(Controller, { ...props }) }));
13
+ };
14
+ const useFormField = () => {
15
+ const fieldContext = useContext(FormFieldContext);
16
+ const itemContext = useContext(FormItemContext);
17
+ const { getFieldState, formState } = useFormContext();
18
+ const fieldState = getFieldState(fieldContext.name, formState);
19
+ if (!fieldContext) {
20
+ throw new Error("useFormField should be used within <FormField>");
21
+ }
22
+ const { id } = itemContext;
23
+ return {
24
+ id,
25
+ name: fieldContext.name,
26
+ formItemId: `${id}-form-item`,
27
+ formDescriptionId: `${id}-form-item-description`,
28
+ formMessageId: `${id}-form-item-message`,
29
+ ...fieldState,
30
+ };
31
+ };
32
+ const FormItemContext = createContext({});
33
+ const FormItem = ({ className, ...props }) => {
34
+ const id = useId();
35
+ return (_jsx(FormItemContext.Provider, { value: { id }, children: _jsx("div", { className: cn("space-y-2", className), ...props }) }));
36
+ };
37
+ FormItem.displayName = "FormItem";
38
+ const FormLabel = ({ className, ...props }) => {
39
+ const { error, formItemId } = useFormField();
40
+ return (_jsx(Label, { className: cn(error && "text-destructive", className), htmlFor: formItemId, ...props }));
41
+ };
42
+ FormLabel.displayName = "FormLabel";
43
+ const FormControl = (props) => {
44
+ const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
45
+ return (_jsx(Slot, { id: formItemId, "aria-describedby": !error
46
+ ? `${formDescriptionId}`
47
+ : `${formDescriptionId} ${formMessageId}`, "aria-invalid": !!error, ...props }));
48
+ };
49
+ FormControl.displayName = "FormControl";
50
+ const FormDescription = ({ className, ...props }) => {
51
+ const { formDescriptionId } = useFormField();
52
+ return (_jsx("p", { id: formDescriptionId, className: cn("text-sm text-muted-foreground", className), ...props }));
53
+ };
54
+ FormDescription.displayName = "FormDescription";
55
+ const FormMessage = ({ className, children, ...props }) => {
56
+ const { error, formMessageId } = useFormField();
57
+ const body = error ? String(error?.message) : children;
58
+ if (!body) {
59
+ return null;
60
+ }
61
+ return (_jsx("p", { id: formMessageId, className: cn("text-sm font-medium text-destructive", className), ...props, children: body }));
62
+ };
63
+ FormMessage.displayName = "FormMessage";
64
+ export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, };
65
+ //# sourceMappingURL=form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form.js","sourceRoot":"","sources":["../../../src/components/ui/form.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAgBxE,OAAO,EAEL,aAAa,EAEb,UAA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AM,eAAe,GAAG,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EAC6B,EAAgB,EAAE;IACvD,MAAM,EAAE,iBAAiB,EAAE,GAAG,YAAY,EAAE,CAAC;IAE7C,OAAO,CACL,YACE,EAAE,EAAE,iBAAiB,EACrB,SAAS,EAAE,EAAE,CAAC,+BAA+B,EAAE,SAAS,CAAC,KACrD,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC;AAEhD,MAAM,WAAW,GAAG,CAAC,EACnB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EAC6B,EAAa,EAAE;IACpD,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,YAAY,EAAE,CAAC;IAChD,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IAEvD,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,YACE,EAAE,EAAE,aAAa,EACjB,SAAS,EAAE,EAAE,CAAC,sCAAsC,EAAE,SAAS,CAAC,KAC5D,KAAK,YAER,IAAI,GACH,CACL,CAAC;AACJ,CAAC,CAAC;AACF,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC;AAExC,OAAO,EACL,YAAY,EACZ,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,WAAW,EACX,eAAe,EACf,WAAW,EACX,SAAS,GACV,CAAC"}
@@ -0,0 +1,47 @@
1
+ import type { ComponentProps, ComponentPropsWithoutRef, ComponentType, ReactElement, ReactNode } from "react";
2
+ export interface BaseImageComponentForFullscreenImageProps {
3
+ src: string;
4
+ alt: string;
5
+ className?: string;
6
+ }
7
+ type DefaultImageComponentProps = ComponentProps<"img"> & BaseImageComponentForFullscreenImageProps;
8
+ export interface FullscreenImageProps<P extends BaseImageComponentForFullscreenImageProps = DefaultImageComponentProps> extends Omit<ComponentPropsWithoutRef<"img">, "onClick"> {
9
+ /** Image source for the thumbnail/regular view */
10
+ src: string;
11
+ /** Alt text for the image */
12
+ alt: string;
13
+ /** Optional high-resolution image source for fullscreen view */
14
+ fullscreenSrc?: string;
15
+ /** Optional Next.js Image component for advanced image handling */
16
+ ImageComponent?: ComponentType<P>;
17
+ /** Props to pass to the Next.js Image component */
18
+ imageProps?: Partial<P>;
19
+ /** Props to pass to the fullscreen Next.js Image component */
20
+ fullscreenImageProps?: Partial<P>;
21
+ /** Custom thumbnail content instead of default image */
22
+ thumbnail?: ReactNode;
23
+ /** Custom className for the thumbnail container */
24
+ thumbnailClassName?: string;
25
+ /** Custom className for the fullscreen image */
26
+ fullscreenClassName?: string;
27
+ /** Custom className for the fullscreen image's container */
28
+ fullscreenContainerClassName?: string;
29
+ /** Disable the zoom cursor on hover */
30
+ disableZoomCursor?: boolean;
31
+ /** Custom loading component */
32
+ loadingComponent?: ReactNode;
33
+ /** Callback fired when fullscreen opens */
34
+ onOpen?: () => void;
35
+ /** Callback fired when fullscreen closes */
36
+ onClose?: () => void;
37
+ }
38
+ /**
39
+ * @name FullscreenImage
40
+ *
41
+ * @returns A React component that displays an enlargeable image. Click the normal/inline image to view it within a fullscreen modal.
42
+ */
43
+ declare function FullscreenImage<P extends BaseImageComponentForFullscreenImageProps = DefaultImageComponentProps>({ src, alt, fullscreenSrc, ImageComponent, imageProps, fullscreenImageProps, thumbnail, thumbnailClassName, fullscreenClassName, disableZoomCursor, loadingComponent, onOpen, onClose, className, ...props }: FullscreenImageProps<P>): ReactElement;
44
+ declare namespace FullscreenImage {
45
+ var displayName: string;
46
+ }
47
+ export { FullscreenImage };