@object-ui/components 0.3.0 → 0.5.0

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 (423) hide show
  1. package/.turbo/turbo-build.log +47 -0
  2. package/CHANGELOG.md +10 -0
  3. package/README.md +32 -1
  4. package/README_SHADCN_SYNC.md +281 -0
  5. package/TESTING.md +335 -0
  6. package/dist/index.css +1 -1
  7. package/dist/index.js +45067 -34357
  8. package/dist/index.umd.cjs +54 -42
  9. package/dist/src/SchemaRenderer.d.ts +3 -0
  10. package/dist/src/{ui → custom}/button-group.d.ts +1 -1
  11. package/dist/src/custom/combobox.d.ts +22 -0
  12. package/dist/src/custom/date-picker.d.ts +15 -0
  13. package/dist/src/custom/field.d.ts +19 -0
  14. package/dist/src/{ui → custom}/filter-builder.d.ts +7 -0
  15. package/dist/src/custom/index.d.ts +12 -0
  16. package/dist/src/custom/input-group.d.ts +14 -0
  17. package/dist/src/{ui → custom}/item.d.ts +8 -1
  18. package/dist/src/{ui → custom}/kbd.d.ts +7 -0
  19. package/dist/src/custom/native-select.d.ts +12 -0
  20. package/dist/src/custom/sort-builder.d.ts +22 -0
  21. package/dist/src/custom/spinner.d.ts +10 -0
  22. package/dist/src/hooks/use-mobile.d.ts +7 -0
  23. package/dist/src/index.d.ts +5 -1
  24. package/dist/src/renderers/basic/button-group.d.ts +8 -0
  25. package/dist/src/renderers/basic/div.d.ts +7 -0
  26. package/dist/src/renderers/basic/html.d.ts +7 -0
  27. package/dist/src/renderers/basic/icon.d.ts +7 -0
  28. package/dist/src/renderers/basic/image.d.ts +7 -0
  29. package/dist/src/renderers/basic/navigation-menu.d.ts +8 -0
  30. package/dist/src/renderers/basic/pagination.d.ts +8 -0
  31. package/dist/src/renderers/basic/separator.d.ts +7 -0
  32. package/dist/src/renderers/basic/span.d.ts +7 -0
  33. package/dist/src/renderers/basic/text.d.ts +7 -0
  34. package/dist/src/renderers/complex/carousel.d.ts +7 -0
  35. package/dist/src/renderers/complex/data-table.d.ts +7 -0
  36. package/dist/src/renderers/complex/filter-builder.d.ts +7 -0
  37. package/dist/src/renderers/complex/resizable.d.ts +7 -0
  38. package/dist/src/renderers/complex/scroll-area.d.ts +7 -0
  39. package/dist/src/renderers/complex/table.d.ts +7 -0
  40. package/dist/src/renderers/data-display/alert.d.ts +7 -0
  41. package/dist/src/renderers/data-display/avatar.d.ts +7 -0
  42. package/dist/src/renderers/data-display/badge.d.ts +7 -0
  43. package/dist/src/renderers/data-display/breadcrumb.d.ts +8 -0
  44. package/dist/src/renderers/data-display/kbd.d.ts +8 -0
  45. package/dist/src/renderers/data-display/list.d.ts +7 -0
  46. package/dist/src/renderers/data-display/statistic.d.ts +7 -0
  47. package/dist/src/renderers/data-display/table.d.ts +8 -0
  48. package/dist/src/renderers/data-display/tree-view.d.ts +7 -0
  49. package/dist/src/renderers/disclosure/accordion.d.ts +7 -0
  50. package/dist/src/renderers/disclosure/collapsible.d.ts +7 -0
  51. package/dist/src/renderers/disclosure/toggle-group.d.ts +8 -0
  52. package/dist/src/renderers/feedback/empty.d.ts +8 -0
  53. package/dist/src/renderers/feedback/loading.d.ts +7 -0
  54. package/dist/src/renderers/feedback/progress.d.ts +7 -0
  55. package/dist/src/renderers/feedback/skeleton.d.ts +7 -0
  56. package/dist/src/renderers/feedback/sonner.d.ts +8 -0
  57. package/dist/src/renderers/feedback/spinner.d.ts +8 -0
  58. package/dist/src/renderers/feedback/toast.d.ts +8 -0
  59. package/dist/src/renderers/feedback/toaster.d.ts +7 -0
  60. package/dist/src/renderers/form/button.d.ts +7 -0
  61. package/dist/src/renderers/form/calendar.d.ts +7 -0
  62. package/dist/src/renderers/form/checkbox.d.ts +7 -0
  63. package/dist/src/renderers/form/combobox.d.ts +8 -0
  64. package/dist/src/renderers/form/command.d.ts +8 -0
  65. package/dist/src/renderers/form/date-picker.d.ts +7 -0
  66. package/dist/src/renderers/form/file-upload.d.ts +7 -0
  67. package/dist/src/renderers/form/form.d.ts +7 -0
  68. package/dist/src/renderers/form/input-otp.d.ts +7 -0
  69. package/dist/src/renderers/form/input.d.ts +7 -0
  70. package/dist/src/renderers/form/label.d.ts +7 -0
  71. package/dist/src/renderers/form/radio-group.d.ts +7 -0
  72. package/dist/src/renderers/form/select.d.ts +7 -0
  73. package/dist/src/renderers/form/slider.d.ts +7 -0
  74. package/dist/src/renderers/form/switch.d.ts +7 -0
  75. package/dist/src/renderers/form/textarea.d.ts +7 -0
  76. package/dist/src/renderers/form/toggle.d.ts +7 -0
  77. package/dist/src/renderers/layout/aspect-ratio.d.ts +8 -0
  78. package/dist/src/renderers/layout/card.d.ts +7 -0
  79. package/dist/src/renderers/layout/container.d.ts +7 -0
  80. package/dist/src/renderers/layout/flex.d.ts +7 -0
  81. package/dist/src/renderers/layout/grid.d.ts +7 -0
  82. package/dist/src/renderers/layout/page.d.ts +1 -1
  83. package/dist/src/renderers/layout/semantic.d.ts +7 -0
  84. package/dist/src/renderers/layout/stack.d.ts +7 -0
  85. package/dist/src/renderers/layout/tabs.d.ts +7 -0
  86. package/dist/src/renderers/navigation/header-bar.d.ts +7 -0
  87. package/dist/src/renderers/navigation/sidebar.d.ts +7 -0
  88. package/dist/src/renderers/overlay/alert-dialog.d.ts +7 -0
  89. package/dist/src/renderers/overlay/context-menu.d.ts +7 -0
  90. package/dist/src/renderers/overlay/dialog.d.ts +7 -0
  91. package/dist/src/renderers/overlay/drawer.d.ts +7 -0
  92. package/dist/src/renderers/overlay/dropdown-menu.d.ts +7 -0
  93. package/dist/src/renderers/overlay/hover-card.d.ts +7 -0
  94. package/dist/src/renderers/overlay/menubar.d.ts +8 -0
  95. package/dist/src/renderers/overlay/popover.d.ts +7 -0
  96. package/dist/src/renderers/overlay/sheet.d.ts +7 -0
  97. package/dist/src/renderers/overlay/tooltip.d.ts +7 -0
  98. package/dist/src/renderers/placeholders.d.ts +9 -0
  99. package/dist/src/ui/accordion.d.ts +11 -4
  100. package/dist/src/ui/alert-dialog.d.ts +24 -11
  101. package/dist/src/ui/alert.d.ts +11 -5
  102. package/dist/src/ui/aspect-ratio.d.ts +8 -1
  103. package/dist/src/ui/avatar.d.ts +10 -3
  104. package/dist/src/ui/badge.d.ts +10 -3
  105. package/dist/src/ui/breadcrumb.d.ts +23 -8
  106. package/dist/src/ui/button.d.ts +10 -5
  107. package/dist/src/ui/calendar.d.ts +8 -1
  108. package/dist/src/ui/card.d.ts +14 -8
  109. package/dist/src/ui/carousel.d.ts +12 -6
  110. package/dist/src/ui/chart.d.ts +62 -0
  111. package/dist/src/ui/checkbox.d.ts +8 -1
  112. package/dist/src/ui/collapsible.d.ts +10 -3
  113. package/dist/src/ui/command.d.ts +85 -16
  114. package/dist/src/ui/context-menu.d.ts +21 -12
  115. package/dist/src/ui/dialog.d.ts +24 -13
  116. package/dist/src/ui/drawer.d.ts +26 -10
  117. package/dist/src/ui/dropdown-menu.d.ts +27 -18
  118. package/dist/src/ui/form.d.ts +13 -7
  119. package/dist/src/ui/hover-card.d.ts +10 -3
  120. package/dist/src/ui/index.d.ts +10 -11
  121. package/dist/src/ui/input-otp.d.ts +37 -7
  122. package/dist/src/ui/input.d.ts +7 -0
  123. package/dist/src/ui/label.d.ts +9 -1
  124. package/dist/src/ui/menubar.d.ts +26 -17
  125. package/dist/src/ui/navigation-menu.d.ts +16 -11
  126. package/dist/src/ui/pagination.d.ts +32 -10
  127. package/dist/src/ui/popover.d.ts +11 -5
  128. package/dist/src/ui/progress.d.ts +8 -1
  129. package/dist/src/ui/radio-group.d.ts +9 -2
  130. package/dist/src/ui/resizable.d.ts +12 -8
  131. package/dist/src/ui/scroll-area.d.ts +9 -2
  132. package/dist/src/ui/select.d.ts +18 -13
  133. package/dist/src/ui/separator.d.ts +7 -0
  134. package/dist/src/ui/sheet.d.ts +30 -11
  135. package/dist/src/ui/sidebar.d.ts +41 -38
  136. package/dist/src/ui/skeleton.d.ts +8 -1
  137. package/dist/src/ui/slider.d.ts +8 -1
  138. package/dist/src/ui/sonner.d.ts +2 -1
  139. package/dist/src/ui/switch.d.ts +9 -2
  140. package/dist/src/ui/table.d.ts +15 -8
  141. package/dist/src/ui/tabs.d.ts +8 -1
  142. package/dist/src/ui/textarea.d.ts +8 -1
  143. package/dist/src/ui/toast.d.ts +22 -0
  144. package/dist/src/ui/toggle-group.d.ts +15 -5
  145. package/dist/src/ui/toggle.d.ts +11 -1
  146. package/dist/src/ui/tooltip.d.ts +11 -4
  147. package/dist/src/ui/typography.d.ts +21 -0
  148. package/metadata/ObjectGrid.component.yml +72 -0
  149. package/package.json +35 -13
  150. package/postcss.config.js +9 -1
  151. package/shadcn-components.json +315 -0
  152. package/src/SchemaRenderer.tsx +28 -0
  153. package/src/__tests__/PageRendererRegions.test.tsx +59 -0
  154. package/src/__tests__/README.md +124 -0
  155. package/src/__tests__/Registry.test.ts +21 -0
  156. package/src/__tests__/basic-renderers.test.tsx +255 -0
  157. package/src/__tests__/complex-disclosure-renderers.test.tsx +302 -0
  158. package/src/__tests__/feedback-overlay-renderers.test.tsx +349 -0
  159. package/src/__tests__/form-renderers.test.tsx +364 -0
  160. package/src/__tests__/layout-data-renderers.test.tsx +340 -0
  161. package/src/__tests__/test-utils.tsx +190 -0
  162. package/src/{ui → custom}/button-group.tsx +9 -1
  163. package/src/custom/combobox.tsx +104 -0
  164. package/src/custom/date-picker.tsx +61 -0
  165. package/src/{ui → custom}/empty.tsx +8 -0
  166. package/src/custom/field.tsx +81 -0
  167. package/src/{ui → custom}/filter-builder.tsx +11 -3
  168. package/src/custom/index.ts +12 -0
  169. package/src/custom/input-group.tsx +53 -0
  170. package/src/{ui → custom}/item.tsx +9 -1
  171. package/src/{ui → custom}/kbd.tsx +8 -0
  172. package/src/custom/native-select.tsx +33 -0
  173. package/src/custom/sort-builder.tsx +129 -0
  174. package/src/custom/spinner.tsx +26 -0
  175. package/src/hooks/use-mobile.tsx +8 -0
  176. package/src/index.css +105 -54
  177. package/src/index.test.ts +8 -0
  178. package/src/index.ts +22 -1
  179. package/src/lib/utils.tsx +8 -0
  180. package/src/new-components.test.ts +8 -9
  181. package/src/renderers/basic/button-group.tsx +79 -0
  182. package/src/renderers/basic/div.tsx +21 -2
  183. package/src/renderers/basic/html.tsx +9 -0
  184. package/src/renderers/basic/icon.tsx +67 -3
  185. package/src/renderers/basic/image.tsx +13 -1
  186. package/src/renderers/basic/index.ts +11 -0
  187. package/src/renderers/basic/navigation-menu.tsx +81 -0
  188. package/src/renderers/basic/pagination.tsx +109 -0
  189. package/src/renderers/basic/separator.tsx +10 -1
  190. package/src/renderers/basic/span.tsx +21 -2
  191. package/src/renderers/basic/text.tsx +12 -2
  192. package/src/renderers/complex/__tests__/data-table.test.ts +8 -0
  193. package/src/renderers/complex/carousel.tsx +12 -3
  194. package/src/renderers/complex/data-table.tsx +150 -96
  195. package/src/renderers/complex/filter-builder.tsx +10 -1
  196. package/src/renderers/complex/index.ts +9 -3
  197. package/src/renderers/complex/resizable.tsx +10 -1
  198. package/src/renderers/complex/scroll-area.tsx +33 -7
  199. package/src/renderers/complex/table.tsx +11 -2
  200. package/src/renderers/data-display/alert.tsx +9 -0
  201. package/src/renderers/data-display/avatar.tsx +9 -0
  202. package/src/renderers/data-display/badge.tsx +9 -0
  203. package/src/renderers/data-display/breadcrumb.tsx +60 -0
  204. package/src/renderers/data-display/index.ts +12 -0
  205. package/src/renderers/data-display/kbd.tsx +50 -0
  206. package/src/renderers/data-display/list.tsx +29 -49
  207. package/src/renderers/data-display/statistic.tsx +45 -48
  208. package/src/renderers/data-display/table.tsx +78 -0
  209. package/src/renderers/data-display/tree-view.tsx +32 -37
  210. package/src/renderers/disclosure/accordion.tsx +9 -0
  211. package/src/renderers/disclosure/collapsible.tsx +9 -0
  212. package/src/renderers/disclosure/index.ts +9 -0
  213. package/src/renderers/disclosure/toggle-group.tsx +79 -0
  214. package/src/renderers/feedback/empty.tsx +49 -0
  215. package/src/renderers/feedback/index.ts +12 -0
  216. package/src/renderers/feedback/loading.tsx +10 -1
  217. package/src/renderers/feedback/progress.tsx +9 -0
  218. package/src/renderers/feedback/skeleton.tsx +9 -0
  219. package/src/renderers/feedback/sonner.tsx +56 -0
  220. package/src/renderers/feedback/spinner.tsx +55 -0
  221. package/src/renderers/feedback/toast.tsx +59 -0
  222. package/src/renderers/feedback/toaster.tsx +14 -17
  223. package/src/renderers/form/button.tsx +43 -1
  224. package/src/renderers/form/calendar.tsx +9 -0
  225. package/src/renderers/form/checkbox.tsx +46 -16
  226. package/src/renderers/form/combobox.tsx +48 -0
  227. package/src/renderers/form/command.tsx +58 -0
  228. package/src/renderers/form/date-picker.tsx +11 -2
  229. package/src/renderers/form/file-upload.tsx +11 -2
  230. package/src/renderers/form/form.tsx +104 -18
  231. package/src/renderers/form/index.ts +10 -0
  232. package/src/renderers/form/input-otp.tsx +35 -15
  233. package/src/renderers/form/input.tsx +92 -50
  234. package/src/renderers/form/label.tsx +9 -0
  235. package/src/renderers/form/radio-group.tsx +9 -0
  236. package/src/renderers/form/select.tsx +43 -15
  237. package/src/renderers/form/slider.tsx +17 -1
  238. package/src/renderers/form/switch.tsx +9 -0
  239. package/src/renderers/form/textarea.tsx +58 -27
  240. package/src/renderers/form/toggle.tsx +11 -45
  241. package/src/renderers/index.ts +8 -0
  242. package/src/renderers/layout/aspect-ratio.tsx +51 -0
  243. package/src/renderers/layout/card.tsx +18 -2
  244. package/src/renderers/layout/container.tsx +21 -12
  245. package/src/renderers/layout/flex.tsx +17 -8
  246. package/src/renderers/layout/grid.tsx +31 -8
  247. package/src/renderers/layout/index.ts +9 -0
  248. package/src/renderers/layout/page.tsx +44 -24
  249. package/src/renderers/layout/semantic.tsx +9 -0
  250. package/src/renderers/layout/stack.tsx +18 -9
  251. package/src/renderers/layout/tabs.tsx +51 -17
  252. package/src/renderers/navigation/header-bar.tsx +10 -1
  253. package/src/renderers/navigation/index.ts +8 -0
  254. package/src/renderers/navigation/sidebar.tsx +13 -0
  255. package/src/renderers/overlay/alert-dialog.tsx +9 -0
  256. package/src/renderers/overlay/context-menu.tsx +10 -1
  257. package/src/renderers/overlay/dialog.tsx +9 -0
  258. package/src/renderers/overlay/drawer.tsx +9 -0
  259. package/src/renderers/overlay/dropdown-menu.tsx +9 -0
  260. package/src/renderers/overlay/hover-card.tsx +9 -0
  261. package/src/renderers/overlay/index.ts +9 -0
  262. package/src/renderers/overlay/menubar.tsx +76 -0
  263. package/src/renderers/overlay/popover.tsx +9 -0
  264. package/src/renderers/overlay/sheet.tsx +9 -0
  265. package/src/renderers/overlay/tooltip.tsx +9 -0
  266. package/src/renderers/placeholders.tsx +107 -0
  267. package/src/stories/CRMApp.stories.tsx +706 -0
  268. package/src/stories/Guide.mdx +55 -0
  269. package/src/stories/Introduction.mdx +34 -0
  270. package/src/stories/MockedData.stories.tsx +71 -0
  271. package/src/stories/assets/accessibility.png +0 -0
  272. package/src/stories/assets/accessibility.svg +1 -0
  273. package/src/stories/assets/addon-library.png +0 -0
  274. package/src/stories/assets/assets.png +0 -0
  275. package/src/stories/assets/avif-test-image.avif +0 -0
  276. package/src/stories/assets/context.png +0 -0
  277. package/src/stories/assets/discord.svg +1 -0
  278. package/src/stories/assets/docs.png +0 -0
  279. package/src/stories/assets/figma-plugin.png +0 -0
  280. package/src/stories/assets/github.svg +1 -0
  281. package/src/stories/assets/share.png +0 -0
  282. package/src/stories/assets/styling.png +0 -0
  283. package/src/stories/assets/testing.png +0 -0
  284. package/src/stories/assets/theming.png +0 -0
  285. package/src/stories/assets/tutorials.svg +1 -0
  286. package/src/stories/assets/youtube.svg +1 -0
  287. package/src/stories/button.css +30 -0
  288. package/src/stories/header.css +32 -0
  289. package/src/stories/page.css +68 -0
  290. package/src/stories-json/accordion.stories.tsx +43 -0
  291. package/src/stories-json/aggrid.stories.tsx +103 -0
  292. package/src/stories-json/alert.stories.tsx +39 -0
  293. package/src/stories-json/aspect-ratio.stories.tsx +34 -0
  294. package/src/stories-json/avatar.stories.tsx +38 -0
  295. package/src/stories-json/badge.stories.tsx +53 -0
  296. package/src/stories-json/breadcrumb.stories.tsx +30 -0
  297. package/src/stories-json/button-group.stories.tsx +43 -0
  298. package/src/stories-json/button.stories.tsx +73 -0
  299. package/src/stories-json/calendar.stories.tsx +85 -0
  300. package/src/stories-json/card.stories.tsx +48 -0
  301. package/src/stories-json/carousel.stories.tsx +33 -0
  302. package/src/stories-json/charts.stories.tsx +195 -0
  303. package/src/stories-json/chatbot.stories.tsx +248 -0
  304. package/src/stories-json/code-editor.stories.tsx +92 -0
  305. package/src/stories-json/collapsible.stories.tsx +40 -0
  306. package/src/stories-json/controls.stories.tsx +36 -0
  307. package/src/stories-json/dashboard.stories.tsx +318 -0
  308. package/src/stories-json/data-table.stories.tsx +60 -0
  309. package/src/stories-json/data_display_extras.stories.tsx +102 -0
  310. package/src/stories-json/date-picker.stories.tsx +28 -0
  311. package/src/stories-json/detail-view.stories.tsx +258 -0
  312. package/src/stories-json/dialog.stories.tsx +43 -0
  313. package/src/stories-json/feedback_extras.stories.tsx +40 -0
  314. package/src/stories-json/feedback_others.stories.tsx +46 -0
  315. package/src/stories-json/form_advanced.stories.tsx +117 -0
  316. package/src/stories-json/form_extras.stories.tsx +123 -0
  317. package/src/stories-json/grid.stories.tsx +56 -0
  318. package/src/stories-json/icon.stories.tsx +36 -0
  319. package/src/stories-json/input.stories.tsx +52 -0
  320. package/src/stories-json/kanban.stories.tsx +295 -0
  321. package/src/stories-json/layout_extended.stories.tsx +76 -0
  322. package/src/stories-json/layout_flex.stories.tsx +107 -0
  323. package/src/stories-json/list-view.stories.tsx +97 -0
  324. package/src/stories-json/markdown.stories.tsx +129 -0
  325. package/src/stories-json/menus.stories.tsx +63 -0
  326. package/src/stories-json/metric-card.stories.tsx +143 -0
  327. package/src/stories-json/navigation-menu.stories.tsx +37 -0
  328. package/src/stories-json/object-aggrid.stories.tsx +252 -0
  329. package/src/stories-json/object-form.stories.tsx +130 -0
  330. package/src/stories-json/object-gantt.stories.tsx +114 -0
  331. package/src/stories-json/object-grid.stories.tsx +157 -0
  332. package/src/stories-json/object-map.stories.tsx +116 -0
  333. package/src/stories-json/object-view.stories.tsx +118 -0
  334. package/src/stories-json/overlay_extras.stories.tsx +113 -0
  335. package/src/stories-json/overlay_others.stories.tsx +76 -0
  336. package/src/stories-json/page.stories.tsx +55 -0
  337. package/src/stories-json/reports.stories.tsx +163 -0
  338. package/src/stories-json/resizable.stories.tsx +44 -0
  339. package/src/stories-json/select.stories.tsx +34 -0
  340. package/src/stories-json/separator.stories.tsx +41 -0
  341. package/src/stories-json/sidebar.stories.tsx +147 -0
  342. package/src/stories-json/statistic.stories.tsx +44 -0
  343. package/src/stories-json/tabs.stories.tsx +51 -0
  344. package/src/stories-json/timeline.stories.tsx +188 -0
  345. package/src/stories-json/typography.stories.tsx +45 -0
  346. package/src/ui/accordion.tsx +55 -53
  347. package/src/ui/alert-dialog.tsx +111 -117
  348. package/src/ui/alert.tsx +46 -57
  349. package/src/ui/aspect-ratio.tsx +9 -5
  350. package/src/ui/avatar.tsx +49 -42
  351. package/src/ui/badge.tsx +18 -20
  352. package/src/ui/breadcrumb.tsx +89 -75
  353. package/src/ui/button.tsx +38 -37
  354. package/src/ui/calendar.tsx +37 -53
  355. package/src/ui/card.tsx +59 -110
  356. package/src/ui/carousel.tsx +144 -113
  357. package/src/ui/chart.tsx +367 -0
  358. package/src/ui/checkbox.tsx +28 -22
  359. package/src/ui/collapsible.tsx +13 -25
  360. package/src/ui/command.tsx +114 -135
  361. package/src/ui/context-menu.tsx +77 -116
  362. package/src/ui/dialog.tsx +102 -113
  363. package/src/ui/drawer.tsx +90 -99
  364. package/src/ui/dropdown-menu.tsx +142 -188
  365. package/src/ui/form.tsx +59 -40
  366. package/src/ui/hover-card.tsx +26 -33
  367. package/src/ui/index.ts +11 -11
  368. package/src/ui/input-otp.tsx +53 -55
  369. package/src/ui/input.tsx +21 -15
  370. package/src/ui/label.tsx +25 -15
  371. package/src/ui/menubar.tsx +196 -206
  372. package/src/ui/navigation-menu.tsx +104 -136
  373. package/src/ui/pagination.tsx +94 -96
  374. package/src/ui/popover.tsx +29 -38
  375. package/src/ui/progress.tsx +29 -34
  376. package/src/ui/radio-group.tsx +27 -20
  377. package/src/ui/resizable.tsx +40 -42
  378. package/src/ui/scroll-area.tsx +46 -48
  379. package/src/ui/select.tsx +140 -160
  380. package/src/ui/separator.tsx +10 -2
  381. package/src/ui/sheet.tsx +118 -107
  382. package/src/ui/sidebar.tsx +471 -418
  383. package/src/ui/skeleton.tsx +14 -11
  384. package/src/ui/slider.tsx +27 -54
  385. package/src/ui/sonner.tsx +29 -19
  386. package/src/ui/switch.tsx +27 -21
  387. package/src/ui/table.tsx +102 -97
  388. package/src/ui/tabs.tsx +14 -37
  389. package/src/ui/textarea.tsx +16 -4
  390. package/src/ui/toast.tsx +137 -0
  391. package/src/ui/toggle-group.tsx +37 -55
  392. package/src/ui/toggle.tsx +30 -27
  393. package/src/ui/tooltip.tsx +29 -52
  394. package/src/ui/typography.tsx +85 -0
  395. package/tsconfig.json +2 -1
  396. package/vite.config.ts +20 -2
  397. package/vitest.config.ts +5 -0
  398. package/dist/src/index.test.d.ts +0 -1
  399. package/dist/src/new-components.test.d.ts +0 -1
  400. package/dist/src/renderers/complex/__tests__/data-table.test.d.ts +0 -0
  401. package/dist/src/renderers/complex/calendar-view.d.ts +0 -1
  402. package/dist/src/renderers/complex/chatbot.d.ts +0 -1
  403. package/dist/src/renderers/complex/chatbot.test.d.ts +0 -1
  404. package/dist/src/renderers/complex/timeline.d.ts +0 -1
  405. package/dist/src/ui/calendar-view.d.ts +0 -21
  406. package/dist/src/ui/chatbot.d.ts +0 -36
  407. package/dist/src/ui/field.d.ts +0 -24
  408. package/dist/src/ui/input-group.d.ts +0 -16
  409. package/dist/src/ui/spinner.d.ts +0 -3
  410. package/dist/src/ui/timeline.d.ts +0 -25
  411. package/metadata/ObjectTable.component.yml +0 -41
  412. package/src/renderers/complex/calendar-view.tsx +0 -219
  413. package/src/renderers/complex/chatbot.test.ts +0 -44
  414. package/src/renderers/complex/chatbot.tsx +0 -185
  415. package/src/renderers/complex/timeline.tsx +0 -466
  416. package/src/ui/calendar-view.tsx +0 -503
  417. package/src/ui/chatbot.tsx +0 -240
  418. package/src/ui/field.tsx +0 -246
  419. package/src/ui/input-group.tsx +0 -170
  420. package/src/ui/spinner.tsx +0 -38
  421. package/src/ui/timeline.tsx +0 -266
  422. package/tailwind.config.js +0 -75
  423. /package/dist/src/{ui → custom}/empty.d.ts +0 -0
@@ -1,161 +1,130 @@
1
+ /**
2
+ * ObjectUI
3
+ * Copyright (c) 2024-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  import * as React from "react"
2
10
  import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu"
3
11
  import { cva } from "class-variance-authority"
4
- import { ChevronDownIcon } from "lucide-react"
12
+ import { ChevronDown } from "lucide-react"
5
13
 
6
14
  import { cn } from "../lib/utils"
7
15
 
8
- function NavigationMenu({
9
- className,
10
- children,
11
- viewport = true,
12
- ...props
13
- }: React.ComponentProps<typeof NavigationMenuPrimitive.Root> & {
14
- viewport?: boolean
15
- }) {
16
- return (
17
- <NavigationMenuPrimitive.Root
18
- data-slot="navigation-menu"
19
- data-viewport={viewport}
20
- className={cn(
21
- "group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",
22
- className
23
- )}
24
- {...props}
25
- >
26
- {children}
27
- {viewport && <NavigationMenuViewport />}
28
- </NavigationMenuPrimitive.Root>
29
- )
30
- }
16
+ const NavigationMenu = React.forwardRef<
17
+ React.ElementRef<typeof NavigationMenuPrimitive.Root>,
18
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>
19
+ >(({ className, children, ...props }, ref) => (
20
+ <NavigationMenuPrimitive.Root
21
+ ref={ref}
22
+ className={cn(
23
+ "relative z-10 flex max-w-max flex-1 items-center justify-center",
24
+ className
25
+ )}
26
+ {...props}
27
+ >
28
+ {children}
29
+ <NavigationMenuViewport />
30
+ </NavigationMenuPrimitive.Root>
31
+ ))
32
+ NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName
31
33
 
32
- function NavigationMenuList({
33
- className,
34
- ...props
35
- }: React.ComponentProps<typeof NavigationMenuPrimitive.List>) {
36
- return (
37
- <NavigationMenuPrimitive.List
38
- data-slot="navigation-menu-list"
39
- className={cn(
40
- "group flex flex-1 list-none items-center justify-center gap-1",
41
- className
42
- )}
43
- {...props}
44
- />
45
- )
46
- }
34
+ const NavigationMenuList = React.forwardRef<
35
+ React.ElementRef<typeof NavigationMenuPrimitive.List>,
36
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>
37
+ >(({ className, ...props }, ref) => (
38
+ <NavigationMenuPrimitive.List
39
+ ref={ref}
40
+ className={cn(
41
+ "group flex flex-1 list-none items-center justify-center space-x-1",
42
+ className
43
+ )}
44
+ {...props}
45
+ />
46
+ ))
47
+ NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName
47
48
 
48
- function NavigationMenuItem({
49
- className,
50
- ...props
51
- }: React.ComponentProps<typeof NavigationMenuPrimitive.Item>) {
52
- return (
53
- <NavigationMenuPrimitive.Item
54
- data-slot="navigation-menu-item"
55
- className={cn("relative", className)}
56
- {...props}
57
- />
58
- )
59
- }
49
+ const NavigationMenuItem = NavigationMenuPrimitive.Item
60
50
 
61
51
  const navigationMenuTriggerStyle = cva(
62
- "group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-ring/50 outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1"
52
+ "group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:text-accent-foreground data-[state=open]:bg-accent/50 data-[state=open]:hover:bg-accent data-[state=open]:focus:bg-accent"
63
53
  )
64
54
 
65
- function NavigationMenuTrigger({
66
- className,
67
- children,
68
- ...props
69
- }: React.ComponentProps<typeof NavigationMenuPrimitive.Trigger>) {
70
- return (
71
- <NavigationMenuPrimitive.Trigger
72
- data-slot="navigation-menu-trigger"
73
- className={cn(navigationMenuTriggerStyle(), "group", className)}
74
- {...props}
75
- >
76
- {children}{" "}
77
- <ChevronDownIcon
78
- className="relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180"
79
- aria-hidden="true"
80
- />
81
- </NavigationMenuPrimitive.Trigger>
82
- )
83
- }
84
-
85
- function NavigationMenuContent({
86
- className,
87
- ...props
88
- }: React.ComponentProps<typeof NavigationMenuPrimitive.Content>) {
89
- return (
90
- <NavigationMenuPrimitive.Content
91
- data-slot="navigation-menu-content"
92
- className={cn(
93
- "data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 top-0 left-0 w-full p-2 pr-2.5 md:absolute md:w-auto",
94
- "group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none",
95
- className
96
- )}
97
- {...props}
55
+ const NavigationMenuTrigger = React.forwardRef<
56
+ React.ElementRef<typeof NavigationMenuPrimitive.Trigger>,
57
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>
58
+ >(({ className, children, ...props }, ref) => (
59
+ <NavigationMenuPrimitive.Trigger
60
+ ref={ref}
61
+ className={cn(navigationMenuTriggerStyle(), "group", className)}
62
+ {...props}
63
+ >
64
+ {children}{" "}
65
+ <ChevronDown
66
+ className="relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180"
67
+ aria-hidden="true"
98
68
  />
99
- )
100
- }
69
+ </NavigationMenuPrimitive.Trigger>
70
+ ))
71
+ NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName
101
72
 
102
- function NavigationMenuViewport({
103
- className,
104
- ...props
105
- }: React.ComponentProps<typeof NavigationMenuPrimitive.Viewport>) {
106
- return (
107
- <div
108
- className={cn(
109
- "absolute top-full left-0 isolate z-50 flex justify-center"
110
- )}
111
- >
112
- <NavigationMenuPrimitive.Viewport
113
- data-slot="navigation-menu-viewport"
114
- className={cn(
115
- "origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",
116
- className
117
- )}
118
- {...props}
119
- />
120
- </div>
121
- )
122
- }
73
+ const NavigationMenuContent = React.forwardRef<
74
+ React.ElementRef<typeof NavigationMenuPrimitive.Content>,
75
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>
76
+ >(({ className, ...props }, ref) => (
77
+ <NavigationMenuPrimitive.Content
78
+ ref={ref}
79
+ className={cn(
80
+ "left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ",
81
+ className
82
+ )}
83
+ {...props}
84
+ />
85
+ ))
86
+ NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName
87
+
88
+ const NavigationMenuLink = NavigationMenuPrimitive.Link
123
89
 
124
- function NavigationMenuLink({
125
- className,
126
- ...props
127
- }: React.ComponentProps<typeof NavigationMenuPrimitive.Link>) {
128
- return (
129
- <NavigationMenuPrimitive.Link
130
- data-slot="navigation-menu-link"
90
+ const NavigationMenuViewport = React.forwardRef<
91
+ React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,
92
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>
93
+ >(({ className, ...props }, ref) => (
94
+ <div className={cn("absolute left-0 top-full flex justify-center")}>
95
+ <NavigationMenuPrimitive.Viewport
131
96
  className={cn(
132
- "data-[active=true]:focus:bg-accent data-[active=true]:hover:bg-accent data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",
97
+ "origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",
133
98
  className
134
99
  )}
100
+ ref={ref}
135
101
  {...props}
136
102
  />
137
- )
138
- }
103
+ </div>
104
+ ))
105
+ NavigationMenuViewport.displayName =
106
+ NavigationMenuPrimitive.Viewport.displayName
139
107
 
140
- function NavigationMenuIndicator({
141
- className,
142
- ...props
143
- }: React.ComponentProps<typeof NavigationMenuPrimitive.Indicator>) {
144
- return (
145
- <NavigationMenuPrimitive.Indicator
146
- data-slot="navigation-menu-indicator"
147
- className={cn(
148
- "data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden",
149
- className
150
- )}
151
- {...props}
152
- >
153
- <div className="bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md" />
154
- </NavigationMenuPrimitive.Indicator>
155
- )
156
- }
108
+ const NavigationMenuIndicator = React.forwardRef<
109
+ React.ElementRef<typeof NavigationMenuPrimitive.Indicator>,
110
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>
111
+ >(({ className, ...props }, ref) => (
112
+ <NavigationMenuPrimitive.Indicator
113
+ ref={ref}
114
+ className={cn(
115
+ "top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",
116
+ className
117
+ )}
118
+ {...props}
119
+ >
120
+ <div className="relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" />
121
+ </NavigationMenuPrimitive.Indicator>
122
+ ))
123
+ NavigationMenuIndicator.displayName =
124
+ NavigationMenuPrimitive.Indicator.displayName
157
125
 
158
126
  export {
127
+ navigationMenuTriggerStyle,
159
128
  NavigationMenu,
160
129
  NavigationMenuList,
161
130
  NavigationMenuItem,
@@ -164,5 +133,4 @@ export {
164
133
  NavigationMenuLink,
165
134
  NavigationMenuIndicator,
166
135
  NavigationMenuViewport,
167
- navigationMenuTriggerStyle,
168
136
  }
@@ -1,127 +1,125 @@
1
+ /**
2
+ * ObjectUI
3
+ * Copyright (c) 2024-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  import * as React from "react"
2
- import {
3
- ChevronLeftIcon,
4
- ChevronRightIcon,
5
- MoreHorizontalIcon,
6
- } from "lucide-react"
10
+ import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react"
7
11
 
8
12
  import { cn } from "../lib/utils"
9
- import { buttonVariants, type Button } from "./button"
13
+ import { ButtonProps, buttonVariants } from "./button"
10
14
 
11
- function Pagination({ className, ...props }: React.ComponentProps<"nav">) {
12
- return (
13
- <nav
14
- role="navigation"
15
- aria-label="pagination"
16
- data-slot="pagination"
17
- className={cn("mx-auto flex w-full justify-center", className)}
18
- {...props}
19
- />
20
- )
21
- }
15
+ const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => (
16
+ <nav
17
+ role="navigation"
18
+ aria-label="pagination"
19
+ className={cn("mx-auto flex w-full justify-center", className)}
20
+ {...props}
21
+ />
22
+ )
23
+ Pagination.displayName = "Pagination"
22
24
 
23
- function PaginationContent({
24
- className,
25
- ...props
26
- }: React.ComponentProps<"ul">) {
27
- return (
28
- <ul
29
- data-slot="pagination-content"
30
- className={cn("flex flex-row items-center gap-1", className)}
31
- {...props}
32
- />
33
- )
34
- }
25
+ const PaginationContent = React.forwardRef<
26
+ HTMLUListElement,
27
+ React.ComponentProps<"ul">
28
+ >(({ className, ...props }, ref) => (
29
+ <ul
30
+ ref={ref}
31
+ className={cn("flex flex-row items-center gap-1", className)}
32
+ {...props}
33
+ />
34
+ ))
35
+ PaginationContent.displayName = "PaginationContent"
35
36
 
36
- function PaginationItem({ ...props }: React.ComponentProps<"li">) {
37
- return <li data-slot="pagination-item" {...props} />
38
- }
37
+ const PaginationItem = React.forwardRef<
38
+ HTMLLIElement,
39
+ React.ComponentProps<"li">
40
+ >(({ className, ...props }, ref) => (
41
+ <li ref={ref} className={cn("", className)} {...props} />
42
+ ))
43
+ PaginationItem.displayName = "PaginationItem"
39
44
 
40
45
  type PaginationLinkProps = {
41
46
  isActive?: boolean
42
- } & Pick<React.ComponentProps<typeof Button>, "size"> &
47
+ } & Pick<ButtonProps, "size"> &
43
48
  React.ComponentProps<"a">
44
49
 
45
- function PaginationLink({
50
+ const PaginationLink = ({
46
51
  className,
47
52
  isActive,
48
53
  size = "icon",
49
54
  ...props
50
- }: PaginationLinkProps) {
51
- return (
52
- <a
53
- aria-current={isActive ? "page" : undefined}
54
- data-slot="pagination-link"
55
- data-active={isActive}
56
- className={cn(
57
- buttonVariants({
58
- variant: isActive ? "outline" : "ghost",
59
- size,
60
- }),
61
- className
62
- )}
63
- {...props}
64
- />
65
- )
66
- }
55
+ }: PaginationLinkProps) => (
56
+ <a
57
+ aria-current={isActive ? "page" : undefined}
58
+ className={cn(
59
+ buttonVariants({
60
+ variant: isActive ? "outline" : "ghost",
61
+ size,
62
+ }),
63
+ className
64
+ )}
65
+ {...props}
66
+ />
67
+ )
68
+ PaginationLink.displayName = "PaginationLink"
67
69
 
68
- function PaginationPrevious({
70
+ const PaginationPrevious = ({
69
71
  className,
70
72
  ...props
71
- }: React.ComponentProps<typeof PaginationLink>) {
72
- return (
73
- <PaginationLink
74
- aria-label="Go to previous page"
75
- size="default"
76
- className={cn("gap-1 px-2.5 sm:pl-2.5", className)}
77
- {...props}
78
- >
79
- <ChevronLeftIcon />
80
- <span className="hidden sm:block">Previous</span>
81
- </PaginationLink>
82
- )
83
- }
73
+ }: React.ComponentProps<typeof PaginationLink>) => (
74
+ <PaginationLink
75
+ aria-label="Go to previous page"
76
+ size="default"
77
+ className={cn("gap-1 pl-2.5", className)}
78
+ {...props}
79
+ >
80
+ <ChevronLeft className="h-4 w-4" />
81
+ <span>Previous</span>
82
+ </PaginationLink>
83
+ )
84
+ PaginationPrevious.displayName = "PaginationPrevious"
84
85
 
85
- function PaginationNext({
86
+ const PaginationNext = ({
86
87
  className,
87
88
  ...props
88
- }: React.ComponentProps<typeof PaginationLink>) {
89
- return (
90
- <PaginationLink
91
- aria-label="Go to next page"
92
- size="default"
93
- className={cn("gap-1 px-2.5 sm:pr-2.5", className)}
94
- {...props}
95
- >
96
- <span className="hidden sm:block">Next</span>
97
- <ChevronRightIcon />
98
- </PaginationLink>
99
- )
100
- }
89
+ }: React.ComponentProps<typeof PaginationLink>) => (
90
+ <PaginationLink
91
+ aria-label="Go to next page"
92
+ size="default"
93
+ className={cn("gap-1 pr-2.5", className)}
94
+ {...props}
95
+ >
96
+ <span>Next</span>
97
+ <ChevronRight className="h-4 w-4" />
98
+ </PaginationLink>
99
+ )
100
+ PaginationNext.displayName = "PaginationNext"
101
101
 
102
- function PaginationEllipsis({
102
+ const PaginationEllipsis = ({
103
103
  className,
104
104
  ...props
105
- }: React.ComponentProps<"span">) {
106
- return (
107
- <span
108
- aria-hidden
109
- data-slot="pagination-ellipsis"
110
- className={cn("flex size-9 items-center justify-center", className)}
111
- {...props}
112
- >
113
- <MoreHorizontalIcon className="size-4" />
114
- <span className="sr-only">More pages</span>
115
- </span>
116
- )
117
- }
105
+ }: React.ComponentProps<"span">) => (
106
+ <span
107
+ aria-hidden
108
+ className={cn("flex h-9 w-9 items-center justify-center", className)}
109
+ {...props}
110
+ >
111
+ <MoreHorizontal className="h-4 w-4" />
112
+ <span className="sr-only">More pages</span>
113
+ </span>
114
+ )
115
+ PaginationEllipsis.displayName = "PaginationEllipsis"
118
116
 
119
117
  export {
120
118
  Pagination,
121
119
  PaginationContent,
122
- PaginationLink,
120
+ PaginationEllipsis,
123
121
  PaginationItem,
124
- PaginationPrevious,
122
+ PaginationLink,
125
123
  PaginationNext,
126
- PaginationEllipsis,
124
+ PaginationPrevious,
127
125
  }
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectUI
3
+ * Copyright (c) 2024-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  "use client"
2
10
 
3
11
  import * as React from "react"
@@ -5,44 +13,27 @@ import * as PopoverPrimitive from "@radix-ui/react-popover"
5
13
 
6
14
  import { cn } from "../lib/utils"
7
15
 
8
- function Popover({
9
- ...props
10
- }: React.ComponentProps<typeof PopoverPrimitive.Root>) {
11
- return <PopoverPrimitive.Root data-slot="popover" {...props} />
12
- }
13
-
14
- function PopoverTrigger({
15
- ...props
16
- }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
17
- return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
18
- }
16
+ const Popover = PopoverPrimitive.Root
19
17
 
20
- function PopoverContent({
21
- className,
22
- align = "center",
23
- sideOffset = 4,
24
- ...props
25
- }: React.ComponentProps<typeof PopoverPrimitive.Content>) {
26
- return (
27
- <PopoverPrimitive.Portal>
28
- <PopoverPrimitive.Content
29
- data-slot="popover-content"
30
- align={align}
31
- sideOffset={sideOffset}
32
- className={cn(
33
- "bg-slate-950/90 backdrop-blur-xl border border-cyan-500/30 text-cyan-100 shadow-[0_0_20px_-5px_rgba(6,182,212,0.3)] 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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md p-4 outline-hidden",
34
- className
35
- )}
36
- {...props}
37
- />
38
- </PopoverPrimitive.Portal>
39
- )
40
- }
18
+ const PopoverTrigger = PopoverPrimitive.Trigger
41
19
 
42
- function PopoverAnchor({
43
- ...props
44
- }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
45
- return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />
46
- }
20
+ const PopoverContent = React.forwardRef<
21
+ React.ElementRef<typeof PopoverPrimitive.Content>,
22
+ React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
23
+ >(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
24
+ <PopoverPrimitive.Portal>
25
+ <PopoverPrimitive.Content
26
+ ref={ref}
27
+ align={align}
28
+ sideOffset={sideOffset}
29
+ className={cn(
30
+ "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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 origin-[--radix-popover-content-transform-origin]",
31
+ className
32
+ )}
33
+ {...props}
34
+ />
35
+ </PopoverPrimitive.Portal>
36
+ ))
37
+ PopoverContent.displayName = PopoverPrimitive.Content.displayName
47
38
 
48
- export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor }
39
+ export { Popover, PopoverTrigger, PopoverContent }
@@ -1,41 +1,36 @@
1
+ /**
2
+ * ObjectUI
3
+ * Copyright (c) 2024-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
9
+ "use client"
10
+
1
11
  import * as React from "react"
2
12
  import * as ProgressPrimitive from "@radix-ui/react-progress"
3
13
 
4
14
  import { cn } from "../lib/utils"
5
15
 
6
- function Progress({
7
- className,
8
- value,
9
- ...props
10
- }: React.ComponentProps<typeof ProgressPrimitive.Root>) {
11
- return (
12
- <ProgressPrimitive.Root
13
- data-slot="progress"
14
- className={cn(
15
- "relative h-3 w-full overflow-hidden rounded-sm bg-slate-950/60 border border-slate-800/60 shadow-inner",
16
- className
17
- )}
18
- {...props}
19
- >
20
- {/* Background Grid Pattern for empty track */}
21
- <div className="absolute inset-0 bg-[linear-gradient(90deg,transparent_2px,rgba(6,182,212,0.1)_2px),linear-gradient(0deg,transparent_2px,rgba(6,182,212,0.1)_2px)] bg-[size:10px_10px] opacity-20" />
22
-
23
- <ProgressPrimitive.Indicator
24
- data-slot="progress-indicator"
25
- className="h-full w-full flex-1 transition-all bg-cyan-500 relative shadow-[0_0_15px_cyan]"
26
- style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
27
- >
28
- {/* Pulse / Flow Effect Overlay */}
29
- <div className="absolute inset-0 bg-linear-to-r from-transparent via-white/30 to-transparent -translate-x-full animate-[shimmer_1.5s_infinite_linear]" />
30
-
31
- {/* Leading Edge Hotspot */}
32
- <div className="absolute right-0 top-0 bottom-0 w-0.5 bg-white shadow-[0_0_10px_2px_white] z-10" />
33
-
34
- {/* Scanlines on the bar */}
35
- <div className="absolute inset-0 bg-[linear-gradient(transparent_50%,rgba(0,0,0,0.2)_50%)] bg-[size:4px_4px]" />
36
- </ProgressPrimitive.Indicator>
37
- </ProgressPrimitive.Root>
38
- )
39
- }
16
+ const Progress = React.forwardRef<
17
+ React.ElementRef<typeof ProgressPrimitive.Root>,
18
+ React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>
19
+ >(({ className, value, ...props }, ref) => (
20
+ <ProgressPrimitive.Root
21
+ ref={ref}
22
+ className={cn(
23
+ "relative h-4 w-full overflow-hidden rounded-full bg-secondary",
24
+ className
25
+ )}
26
+ {...props}
27
+ >
28
+ <ProgressPrimitive.Indicator
29
+ className="h-full w-full flex-1 bg-primary transition-all"
30
+ style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
31
+ />
32
+ </ProgressPrimitive.Root>
33
+ ))
34
+ Progress.displayName = ProgressPrimitive.Root.displayName
40
35
 
41
36
  export { Progress }