@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
package/src/ui/card.tsx CHANGED
@@ -1,138 +1,87 @@
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
 
3
11
  import { cn } from "../lib/utils"
4
12
 
5
13
  const Card = React.forwardRef<
6
14
  HTMLDivElement,
7
- React.ComponentProps<"div">
8
- >(({ className, ...props }, ref) => {
9
- return (
10
- <div
11
- ref={ref}
12
- data-slot="card"
13
- className={cn(
14
- "bg-card/90 dark:bg-card/40 backdrop-blur-md text-card-foreground flex flex-col gap-6 rounded-xl border border-cyan-500/20 py-6 shadow-[0_0_30px_-10px_rgba(6,182,212,0.15)] transition-all duration-300 hover:shadow-[0_0_40px_-10px_rgba(6,182,212,0.3)] hover:border-cyan-500/40 relative overflow-hidden",
15
- className
16
- )}
17
- {...props}
18
- >
19
- {/* Decorative corner accents */}
20
- <div className="absolute top-0 left-0 w-2 h-2 border-t border-l border-cyan-500/50 rounded-tl-sm" />
21
- <div className="absolute top-0 right-0 w-2 h-2 border-t border-r border-cyan-500/50 rounded-tr-sm" />
22
- <div className="absolute bottom-0 left-0 w-2 h-2 border-b border-l border-cyan-500/50 rounded-bl-sm" />
23
- <div className="absolute bottom-0 right-0 w-2 h-2 border-b border-r border-cyan-500/50 rounded-br-sm" />
24
-
25
- {/* Content */}
26
- <div className="relative z-10 flex flex-col gap-6 h-full">
27
- {props.children}
28
- </div>
29
- </div>
30
- )
31
- })
15
+ React.HTMLAttributes<HTMLDivElement>
16
+ >(({ className, ...props }, ref) => (
17
+ <div
18
+ ref={ref}
19
+ className={cn(
20
+ "rounded-lg border bg-card text-card-foreground shadow-sm",
21
+ className
22
+ )}
23
+ {...props}
24
+ />
25
+ ))
32
26
  Card.displayName = "Card"
33
27
 
34
28
  const CardHeader = React.forwardRef<
35
29
  HTMLDivElement,
36
- React.ComponentProps<"div">
37
- >(({ className, ...props }, ref) => {
38
- return (
39
- <div
40
- ref={ref}
41
- data-slot="card-header"
42
- className={cn(
43
- "@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
44
- className
45
- )}
46
- {...props}
47
- />
48
- )
49
- })
30
+ React.HTMLAttributes<HTMLDivElement>
31
+ >(({ className, ...props }, ref) => (
32
+ <div
33
+ ref={ref}
34
+ className={cn("flex flex-col space-y-1.5 p-6", className)}
35
+ {...props}
36
+ />
37
+ ))
50
38
  CardHeader.displayName = "CardHeader"
51
39
 
52
40
  const CardTitle = React.forwardRef<
53
41
  HTMLDivElement,
54
- React.ComponentProps<"div">
55
- >(({ className, ...props }, ref) => {
56
- return (
57
- <div
58
- ref={ref}
59
- data-slot="card-title"
60
- className={cn("leading-none font-semibold", className)}
61
- {...props}
62
- />
63
- )
64
- })
42
+ React.HTMLAttributes<HTMLDivElement>
43
+ >(({ className, ...props }, ref) => (
44
+ <div
45
+ ref={ref}
46
+ className={cn(
47
+ "text-2xl font-semibold leading-none tracking-tight",
48
+ className
49
+ )}
50
+ {...props}
51
+ />
52
+ ))
65
53
  CardTitle.displayName = "CardTitle"
66
54
 
67
55
  const CardDescription = React.forwardRef<
68
56
  HTMLDivElement,
69
- React.ComponentProps<"div">
70
- >(({ className, ...props }, ref) => {
71
- return (
72
- <div
73
- ref={ref}
74
- data-slot="card-description"
75
- className={cn("text-muted-foreground text-sm", className)}
76
- {...props}
77
- />
78
- )
79
- })
57
+ React.HTMLAttributes<HTMLDivElement>
58
+ >(({ className, ...props }, ref) => (
59
+ <div
60
+ ref={ref}
61
+ className={cn("text-sm text-muted-foreground", className)}
62
+ {...props}
63
+ />
64
+ ))
80
65
  CardDescription.displayName = "CardDescription"
81
66
 
82
- const CardAction = React.forwardRef<
83
- HTMLDivElement,
84
- React.ComponentProps<"div">
85
- >(({ className, ...props }, ref) => {
86
- return (
87
- <div
88
- ref={ref}
89
- data-slot="card-action"
90
- className={cn(
91
- "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
92
- className
93
- )}
94
- {...props}
95
- />
96
- )
97
- })
98
- CardAction.displayName = "CardAction"
99
-
100
67
  const CardContent = React.forwardRef<
101
68
  HTMLDivElement,
102
- React.ComponentProps<"div">
103
- >(({ className, ...props }, ref) => {
104
- return (
105
- <div
106
- ref={ref}
107
- data-slot="card-content"
108
- className={cn("px-6", className)}
109
- {...props}
110
- />
111
- )
112
- })
69
+ React.HTMLAttributes<HTMLDivElement>
70
+ >(({ className, ...props }, ref) => (
71
+ <div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
72
+ ))
113
73
  CardContent.displayName = "CardContent"
114
74
 
115
75
  const CardFooter = React.forwardRef<
116
76
  HTMLDivElement,
117
- React.ComponentProps<"div">
118
- >(({ className, ...props }, ref) => {
119
- return (
120
- <div
121
- ref={ref}
122
- data-slot="card-footer"
123
- className={cn("flex items-center px-6 [.border-t]:pt-6", className)}
124
- {...props}
125
- />
126
- )
127
- })
77
+ React.HTMLAttributes<HTMLDivElement>
78
+ >(({ className, ...props }, ref) => (
79
+ <div
80
+ ref={ref}
81
+ className={cn("flex items-center p-6 pt-0", className)}
82
+ {...props}
83
+ />
84
+ ))
128
85
  CardFooter.displayName = "CardFooter"
129
86
 
130
- export {
131
- Card,
132
- CardHeader,
133
- CardFooter,
134
- CardTitle,
135
- CardAction,
136
- CardDescription,
137
- CardContent,
138
- }
87
+ export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
@@ -1,3 +1,13 @@
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 useEmblaCarousel, {
3
13
  type UseEmblaCarouselType,
@@ -40,106 +50,124 @@ function useCarousel() {
40
50
  return context
41
51
  }
42
52
 
43
- function Carousel({
44
- orientation = "horizontal",
45
- opts,
46
- setApi,
47
- plugins,
48
- className,
49
- children,
50
- ...props
51
- }: React.ComponentProps<"div"> & CarouselProps) {
52
- const [carouselRef, api] = useEmblaCarousel(
53
+ const Carousel = React.forwardRef<
54
+ HTMLDivElement,
55
+ React.HTMLAttributes<HTMLDivElement> & CarouselProps
56
+ >(
57
+ (
53
58
  {
54
- ...opts,
55
- axis: orientation === "horizontal" ? "x" : "y",
59
+ orientation = "horizontal",
60
+ opts,
61
+ setApi,
62
+ plugins,
63
+ className,
64
+ children,
65
+ ...props
56
66
  },
57
- plugins
58
- )
59
- const [canScrollPrev, setCanScrollPrev] = React.useState(false)
60
- const [canScrollNext, setCanScrollNext] = React.useState(false)
61
-
62
- const onSelect = React.useCallback((api: CarouselApi) => {
63
- if (!api) return
64
- setCanScrollPrev(api.canScrollPrev())
65
- setCanScrollNext(api.canScrollNext())
66
- }, [])
67
-
68
- const scrollPrev = React.useCallback(() => {
69
- api?.scrollPrev()
70
- }, [api])
71
-
72
- const scrollNext = React.useCallback(() => {
73
- api?.scrollNext()
74
- }, [api])
75
-
76
- const handleKeyDown = React.useCallback(
77
- (event: React.KeyboardEvent<HTMLDivElement>) => {
78
- if (event.key === "ArrowLeft") {
79
- event.preventDefault()
80
- scrollPrev()
81
- } else if (event.key === "ArrowRight") {
82
- event.preventDefault()
83
- scrollNext()
67
+ ref
68
+ ) => {
69
+ const [carouselRef, api] = useEmblaCarousel(
70
+ {
71
+ ...opts,
72
+ axis: orientation === "horizontal" ? "x" : "y",
73
+ },
74
+ plugins
75
+ )
76
+ const [canScrollPrev, setCanScrollPrev] = React.useState(false)
77
+ const [canScrollNext, setCanScrollNext] = React.useState(false)
78
+
79
+ const onSelect = React.useCallback((api: CarouselApi) => {
80
+ if (!api) {
81
+ return
84
82
  }
85
- },
86
- [scrollPrev, scrollNext]
87
- )
88
83
 
89
- React.useEffect(() => {
90
- if (!api || !setApi) return
91
- setApi(api)
92
- }, [api, setApi])
84
+ setCanScrollPrev(api.canScrollPrev())
85
+ setCanScrollNext(api.canScrollNext())
86
+ }, [])
93
87
 
94
- React.useEffect(() => {
95
- if (!api) return
96
- onSelect(api)
97
- api.on("reInit", onSelect)
98
- api.on("select", onSelect)
88
+ const scrollPrev = React.useCallback(() => {
89
+ api?.scrollPrev()
90
+ }, [api])
99
91
 
100
- return () => {
101
- api?.off("select", onSelect)
102
- }
103
- }, [api, onSelect])
92
+ const scrollNext = React.useCallback(() => {
93
+ api?.scrollNext()
94
+ }, [api])
104
95
 
105
- return (
106
- <CarouselContext.Provider
107
- value={{
108
- carouselRef,
109
- api: api,
110
- opts,
111
- orientation:
112
- orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
113
- scrollPrev,
114
- scrollNext,
115
- canScrollPrev,
116
- canScrollNext,
117
- }}
118
- >
119
- <div
120
- onKeyDownCapture={handleKeyDown}
121
- className={cn("relative", className)}
122
- role="region"
123
- aria-roledescription="carousel"
124
- data-slot="carousel"
125
- {...props}
96
+ const handleKeyDown = React.useCallback(
97
+ (event: React.KeyboardEvent<HTMLDivElement>) => {
98
+ if (event.key === "ArrowLeft") {
99
+ event.preventDefault()
100
+ scrollPrev()
101
+ } else if (event.key === "ArrowRight") {
102
+ event.preventDefault()
103
+ scrollNext()
104
+ }
105
+ },
106
+ [scrollPrev, scrollNext]
107
+ )
108
+
109
+ React.useEffect(() => {
110
+ if (!api || !setApi) {
111
+ return
112
+ }
113
+
114
+ setApi(api)
115
+ }, [api, setApi])
116
+
117
+ React.useEffect(() => {
118
+ if (!api) {
119
+ return
120
+ }
121
+
122
+ onSelect(api)
123
+ api.on("reInit", onSelect)
124
+ api.on("select", onSelect)
125
+
126
+ return () => {
127
+ api?.off("select", onSelect)
128
+ }
129
+ }, [api, onSelect])
130
+
131
+ return (
132
+ <CarouselContext.Provider
133
+ value={{
134
+ carouselRef,
135
+ api: api,
136
+ opts,
137
+ orientation:
138
+ orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
139
+ scrollPrev,
140
+ scrollNext,
141
+ canScrollPrev,
142
+ canScrollNext,
143
+ }}
126
144
  >
127
- {children}
128
- </div>
129
- </CarouselContext.Provider>
130
- )
131
- }
145
+ <div
146
+ ref={ref}
147
+ onKeyDownCapture={handleKeyDown}
148
+ className={cn("relative", className)}
149
+ role="region"
150
+ aria-roledescription="carousel"
151
+ {...props}
152
+ >
153
+ {children}
154
+ </div>
155
+ </CarouselContext.Provider>
156
+ )
157
+ }
158
+ )
159
+ Carousel.displayName = "Carousel"
132
160
 
133
- function CarouselContent({ className, ...props }: React.ComponentProps<"div">) {
161
+ const CarouselContent = React.forwardRef<
162
+ HTMLDivElement,
163
+ React.HTMLAttributes<HTMLDivElement>
164
+ >(({ className, ...props }, ref) => {
134
165
  const { carouselRef, orientation } = useCarousel()
135
166
 
136
167
  return (
137
- <div
138
- ref={carouselRef}
139
- className="overflow-hidden"
140
- data-slot="carousel-content"
141
- >
168
+ <div ref={carouselRef} className="overflow-hidden">
142
169
  <div
170
+ ref={ref}
143
171
  className={cn(
144
172
  "flex",
145
173
  orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col",
@@ -149,16 +177,20 @@ function CarouselContent({ className, ...props }: React.ComponentProps<"div">) {
149
177
  />
150
178
  </div>
151
179
  )
152
- }
180
+ })
181
+ CarouselContent.displayName = "CarouselContent"
153
182
 
154
- function CarouselItem({ className, ...props }: React.ComponentProps<"div">) {
183
+ const CarouselItem = React.forwardRef<
184
+ HTMLDivElement,
185
+ React.HTMLAttributes<HTMLDivElement>
186
+ >(({ className, ...props }, ref) => {
155
187
  const { orientation } = useCarousel()
156
188
 
157
189
  return (
158
190
  <div
191
+ ref={ref}
159
192
  role="group"
160
193
  aria-roledescription="slide"
161
- data-slot="carousel-item"
162
194
  className={cn(
163
195
  "min-w-0 shrink-0 grow-0 basis-full",
164
196
  orientation === "horizontal" ? "pl-4" : "pt-4",
@@ -167,25 +199,24 @@ function CarouselItem({ className, ...props }: React.ComponentProps<"div">) {
167
199
  {...props}
168
200
  />
169
201
  )
170
- }
202
+ })
203
+ CarouselItem.displayName = "CarouselItem"
171
204
 
172
- function CarouselPrevious({
173
- className,
174
- variant = "outline",
175
- size = "icon",
176
- ...props
177
- }: React.ComponentProps<typeof Button>) {
205
+ const CarouselPrevious = React.forwardRef<
206
+ HTMLButtonElement,
207
+ React.ComponentProps<typeof Button>
208
+ >(({ className, variant = "outline", size = "icon", ...props }, ref) => {
178
209
  const { orientation, scrollPrev, canScrollPrev } = useCarousel()
179
210
 
180
211
  return (
181
212
  <Button
182
- data-slot="carousel-previous"
213
+ ref={ref}
183
214
  variant={variant}
184
215
  size={size}
185
216
  className={cn(
186
- "absolute size-8 rounded-full",
217
+ "absolute h-8 w-8 rounded-full",
187
218
  orientation === "horizontal"
188
- ? "top-1/2 -left-12 -translate-y-1/2"
219
+ ? "-left-12 top-1/2 -translate-y-1/2"
189
220
  : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
190
221
  className
191
222
  )}
@@ -193,29 +224,28 @@ function CarouselPrevious({
193
224
  onClick={scrollPrev}
194
225
  {...props}
195
226
  >
196
- <ArrowLeft />
227
+ <ArrowLeft className="h-4 w-4" />
197
228
  <span className="sr-only">Previous slide</span>
198
229
  </Button>
199
230
  )
200
- }
231
+ })
232
+ CarouselPrevious.displayName = "CarouselPrevious"
201
233
 
202
- function CarouselNext({
203
- className,
204
- variant = "outline",
205
- size = "icon",
206
- ...props
207
- }: React.ComponentProps<typeof Button>) {
234
+ const CarouselNext = React.forwardRef<
235
+ HTMLButtonElement,
236
+ React.ComponentProps<typeof Button>
237
+ >(({ className, variant = "outline", size = "icon", ...props }, ref) => {
208
238
  const { orientation, scrollNext, canScrollNext } = useCarousel()
209
239
 
210
240
  return (
211
241
  <Button
212
- data-slot="carousel-next"
242
+ ref={ref}
213
243
  variant={variant}
214
244
  size={size}
215
245
  className={cn(
216
- "absolute size-8 rounded-full",
246
+ "absolute h-8 w-8 rounded-full",
217
247
  orientation === "horizontal"
218
- ? "top-1/2 -right-12 -translate-y-1/2"
248
+ ? "-right-12 top-1/2 -translate-y-1/2"
219
249
  : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
220
250
  className
221
251
  )}
@@ -223,11 +253,12 @@ function CarouselNext({
223
253
  onClick={scrollNext}
224
254
  {...props}
225
255
  >
226
- <ArrowRight />
256
+ <ArrowRight className="h-4 w-4" />
227
257
  <span className="sr-only">Next slide</span>
228
258
  </Button>
229
259
  )
230
- }
260
+ })
261
+ CarouselNext.displayName = "CarouselNext"
231
262
 
232
263
  export {
233
264
  type CarouselApi,