@goplusvn/core 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (369) hide show
  1. package/package.json +2 -1
  2. package/src/assets/erp_wallpaper.png +0 -0
  3. package/src/assets/goeat_logo.png +0 -0
  4. package/src/audit/audit-manager.ts +139 -0
  5. package/src/audit/index.ts +11 -0
  6. package/src/audit/memory-audit-logger.ts +86 -0
  7. package/src/audit/types.ts +50 -0
  8. package/src/auth/auth-service.ts +97 -0
  9. package/src/auth/index.ts +266 -0
  10. package/src/code-generation/index.ts +69 -0
  11. package/src/configs/auth-routes.ts +17 -0
  12. package/src/configs/crud.ts +136 -0
  13. package/src/configs/data/navigations.ts +781 -0
  14. package/src/configs/data/oauth-links.ts +10 -0
  15. package/src/configs/entities/material-categories.config.ts +125 -0
  16. package/src/configs/i18n.ts +12 -0
  17. package/src/configs/index.ts +26 -0
  18. package/src/configs/status.ts +25 -0
  19. package/src/configs/themes.ts +100 -0
  20. package/src/crud/components/crud-bulk-actions.tsx +91 -0
  21. package/src/crud/components/crud-card-view.tsx +241 -0
  22. package/src/crud/components/crud-context.tsx +122 -0
  23. package/src/crud/components/crud-delete-dialog.tsx +145 -0
  24. package/src/crud/components/crud-dialog.tsx +406 -0
  25. package/src/crud/components/crud-empty-state.tsx +104 -0
  26. package/src/crud/components/crud-export-button.tsx +170 -0
  27. package/src/crud/components/crud-field-renderer.tsx +653 -0
  28. package/src/crud/components/crud-filter-chips.tsx +102 -0
  29. package/src/crud/components/crud-filters/checkbox-filter.tsx +97 -0
  30. package/src/crud/components/crud-filters/datetime-filter.tsx +83 -0
  31. package/src/crud/components/crud-filters/filter-builder.tsx +66 -0
  32. package/src/crud/components/crud-filters/index.tsx +76 -0
  33. package/src/crud/components/crud-filters/radio-filter.tsx +86 -0
  34. package/src/crud/components/crud-filters/select-filter.tsx +141 -0
  35. package/src/crud/components/crud-filters/text-filter.tsx +86 -0
  36. package/src/crud/components/crud-form.tsx +642 -0
  37. package/src/crud/components/crud-import-dialog.tsx +440 -0
  38. package/src/crud/components/crud-infinite-scroll.tsx +116 -0
  39. package/src/crud/components/crud-page.tsx +1017 -0
  40. package/src/crud/components/crud-provider.tsx +277 -0
  41. package/src/crud/components/crud-row-actions.tsx +189 -0
  42. package/src/crud/components/crud-search.tsx +82 -0
  43. package/src/crud/components/crud-sheet.tsx +336 -0
  44. package/src/crud/components/crud-table-skeleton.tsx +26 -0
  45. package/src/crud/components/crud-table-toolbar.tsx +91 -0
  46. package/src/crud/components/crud-table.tsx +352 -0
  47. package/src/crud/components/crud-virtual-table.tsx +55 -0
  48. package/src/crud/components/index.tsx +20 -0
  49. package/src/crud/crud-filters/checkbox-filter.tsx +87 -0
  50. package/src/crud/crud-filters/datetime-filter.tsx +82 -0
  51. package/src/crud/crud-filters/filter-builder.tsx +64 -0
  52. package/src/crud/crud-filters/index.tsx +78 -0
  53. package/src/crud/crud-filters/radio-filter.tsx +79 -0
  54. package/src/crud/crud-filters/select-filter.tsx +148 -0
  55. package/src/crud/crud-filters/text-filter.tsx +81 -0
  56. package/src/crud/index.ts +43 -0
  57. package/src/crud/lib/crud-service.test.ts +334 -0
  58. package/src/crud/lib/crud-service.ts +358 -0
  59. package/src/crud/lib/crud-utils.test.ts +354 -0
  60. package/src/crud/lib/crud-utils.ts +299 -0
  61. package/src/crud/lib/crud-validator.ts +247 -0
  62. package/src/crud/lib/data-loader.ts +234 -0
  63. package/src/crud/lib/field-calculator.ts +241 -0
  64. package/src/crud/lib/field-formatter.ts +240 -0
  65. package/src/crud/lib/import-export-service.test.ts +290 -0
  66. package/src/crud/lib/import-export-service.ts +352 -0
  67. package/src/crud/lib/import-server-utils.ts +109 -0
  68. package/src/crud/lib/lazy-loader.ts +241 -0
  69. package/src/crud/lib/parse-filters.ts +85 -0
  70. package/src/crud/lib/permissions.ts +52 -0
  71. package/src/crud/lib/serialize-config.ts +60 -0
  72. package/src/crud/lib/stream-loader.ts +145 -0
  73. package/src/crud/lib/translate-config.ts +335 -0
  74. package/src/crud/lib/types.ts +11 -0
  75. package/src/crud/pages/entity-crud-page.tsx +144 -0
  76. package/src/crud/server.ts +8 -0
  77. package/src/home/constants.tsx +142 -0
  78. package/src/home/feature-showcase.tsx +171 -0
  79. package/src/home/home-page.tsx +191 -0
  80. package/src/home/hooks/index.ts +1 -0
  81. package/src/home/hooks/useWidgetPreferences.ts +167 -0
  82. package/src/home/index.ts +33 -0
  83. package/src/home/quick-access-dialog.tsx +271 -0
  84. package/src/home/quick-access-menu.tsx +267 -0
  85. package/src/home/types.ts +140 -0
  86. package/src/home/welcome-card.tsx +92 -0
  87. package/src/home/widget-container.tsx +258 -0
  88. package/src/home/widgets/base-widget.tsx +200 -0
  89. package/src/home/widgets/customers-widget.tsx +74 -0
  90. package/src/home/widgets/index.ts +6 -0
  91. package/src/home/widgets/orders-widget.tsx +87 -0
  92. package/src/home/widgets/revenue-widget.tsx +71 -0
  93. package/src/home/widgets/stock-widget.tsx +109 -0
  94. package/src/hooks/index.tsx +598 -0
  95. package/src/hooks/use-tenant.test.tsx +30 -0
  96. package/src/hooks/use-tenant.ts +5 -0
  97. package/src/index.ts +17 -0
  98. package/src/infrastructure/__tests__/architecture-verification.spec.ts +103 -0
  99. package/src/infrastructure/api-service.ts +317 -0
  100. package/src/infrastructure/cache/cache-manager.ts +107 -0
  101. package/src/infrastructure/cache/cache.ts +120 -0
  102. package/src/infrastructure/cache/index.ts +8 -0
  103. package/src/infrastructure/cache/types.ts +48 -0
  104. package/src/infrastructure/cron/cron-manager.ts +239 -0
  105. package/src/infrastructure/cron/index.ts +6 -0
  106. package/src/infrastructure/cron/types.ts +41 -0
  107. package/src/infrastructure/event-bus/event-bus.ts +145 -0
  108. package/src/infrastructure/event-bus/index.ts +2 -0
  109. package/src/infrastructure/event-bus/types.ts +22 -0
  110. package/src/infrastructure/index.ts +32 -0
  111. package/src/infrastructure/lock/decorators.ts +67 -0
  112. package/src/infrastructure/lock/index.ts +2 -0
  113. package/src/infrastructure/lock/lock-manager.ts +33 -0
  114. package/src/infrastructure/logger/index.ts +2 -0
  115. package/src/infrastructure/logger/logger.ts +96 -0
  116. package/src/infrastructure/logger/types.ts +25 -0
  117. package/src/layout/index.tsx +185 -0
  118. package/src/navigation/index.ts +91 -0
  119. package/src/notification/index.ts +14 -0
  120. package/src/notification/notification-service.ts +120 -0
  121. package/src/notification/storage/in-memory.ts +56 -0
  122. package/src/notification/storage/index.ts +1 -0
  123. package/src/notification/types.ts +51 -0
  124. package/src/organization/branch-service.ts +299 -0
  125. package/src/organization/branches.config.ts +154 -0
  126. package/src/organization/index.ts +5 -0
  127. package/src/plugin/apps-registry.ts +97 -0
  128. package/src/plugin/index.ts +5 -0
  129. package/src/plugin/types.ts +41 -0
  130. package/src/providers/index.tsx +109 -0
  131. package/src/providers/tenant-provider.tsx +45 -0
  132. package/src/rbac/components/roles/role-card.tsx +158 -0
  133. package/src/rbac/components/roles/role-stats-cards.tsx +29 -0
  134. package/src/rbac/components/roles/role-toolbar.tsx +123 -0
  135. package/src/rbac/hooks/use-role-operations.ts +159 -0
  136. package/src/rbac/hooks/use-roles-data.ts +59 -0
  137. package/src/rbac/index.ts +297 -0
  138. package/src/rbac/lib/permission-helpers.ts +63 -0
  139. package/src/rbac/pages/action-list-page.tsx +25 -0
  140. package/src/rbac/pages/resource-list-page.tsx +25 -0
  141. package/src/rbac/pages/role-list-page.tsx +378 -0
  142. package/src/rbac/permission-service.ts +140 -0
  143. package/src/rbac/permissions.ts +135 -0
  144. package/src/rbac/resource-service.ts +115 -0
  145. package/src/rbac/resource-validator.ts +119 -0
  146. package/src/rbac/role-service.ts +165 -0
  147. package/src/rbac/server.ts +16 -0
  148. package/src/rbac/types.ts +38 -0
  149. package/src/schemas/action.schema.ts +66 -0
  150. package/src/schemas/branch.schema.ts +52 -0
  151. package/src/schemas/coming-soon-schema.ts +9 -0
  152. package/src/schemas/company.schema.ts +44 -0
  153. package/src/schemas/forgot-passward-schema.ts +9 -0
  154. package/src/schemas/index.ts +30 -0
  155. package/src/schemas/material-category.schema.ts +43 -0
  156. package/src/schemas/material-pricing.schema.ts +74 -0
  157. package/src/schemas/material.schema.ts +76 -0
  158. package/src/schemas/materials.ts +52 -0
  159. package/src/schemas/new-passward-schema.ts +15 -0
  160. package/src/schemas/partner-company.schema.ts +149 -0
  161. package/src/schemas/register-schema.ts +36 -0
  162. package/src/schemas/resource.schema.ts +133 -0
  163. package/src/schemas/role.schema.ts +11 -0
  164. package/src/schemas/sign-in-schema.ts +24 -0
  165. package/src/schemas/supplier-pricing.schema.ts +15 -0
  166. package/src/schemas/supplier.schema.ts +120 -0
  167. package/src/schemas/system-category-group.schema.ts +67 -0
  168. package/src/schemas/system-category.schema.ts +77 -0
  169. package/src/schemas/system-config.schema.ts +118 -0
  170. package/src/schemas/uom.schema.ts +75 -0
  171. package/src/schemas/user-supplier.schema.ts +179 -0
  172. package/src/schemas/user.schema.ts +18 -0
  173. package/src/schemas/verify-email-schema.ts +9 -0
  174. package/src/schemas/warehouse.schema.ts +49 -0
  175. package/src/system/components/categories/category-list.tsx +529 -0
  176. package/src/system/components/categories/category-manager.tsx +89 -0
  177. package/src/system/components/categories/group-sidebar.tsx +308 -0
  178. package/src/system/components/settings/setting-dialogs.tsx +197 -0
  179. package/src/system/components/settings/setting-field.tsx +291 -0
  180. package/src/system/components/settings/setting-form-dialog.tsx +308 -0
  181. package/src/system/components/settings/settings-groups.ts +80 -0
  182. package/src/system/components/settings/settings-search.tsx +71 -0
  183. package/src/system/components/settings/settings-section.tsx +74 -0
  184. package/src/system/components/settings/settings-sidebar.tsx +81 -0
  185. package/src/system/constants.ts +3 -0
  186. package/src/system/index.ts +150 -0
  187. package/src/system/job-manager.ts +176 -0
  188. package/src/system/pages/components/categories/category-list.tsx +537 -0
  189. package/src/system/pages/components/categories/category-manager.tsx +90 -0
  190. package/src/system/pages/components/categories/group-sidebar.tsx +311 -0
  191. package/src/system/pages/components/settings/sales-rules-settings.tsx +222 -0
  192. package/src/system/pages/components/settings/setting-dialogs.tsx +197 -0
  193. package/src/system/pages/components/settings/setting-field.tsx +292 -0
  194. package/src/system/pages/components/settings/setting-form-dialog.tsx +308 -0
  195. package/src/system/pages/components/settings/settings-groups.ts +87 -0
  196. package/src/system/pages/components/settings/settings-page.tsx +372 -0
  197. package/src/system/pages/components/settings/settings-search.tsx +71 -0
  198. package/src/system/pages/components/settings/settings-section.tsx +74 -0
  199. package/src/system/pages/components/settings/settings-sidebar.tsx +81 -0
  200. package/src/system/pages/components/settings/system-settings.tsx +244 -0
  201. package/src/system/pages/system-category-page.tsx +15 -0
  202. package/src/system/pages/system-settings-page.tsx +380 -0
  203. package/src/system/schemas/system-category-group.schema.ts +46 -0
  204. package/src/system/schemas/system-category.schema.ts +56 -0
  205. package/src/system/services/settings-service.ts +127 -0
  206. package/src/system/services/system-category-service.ts +63 -0
  207. package/src/system/types.ts +45 -0
  208. package/src/types/index.ts +703 -0
  209. package/src/ui/auth/auth-layout.tsx +135 -0
  210. package/src/ui/auth/forgot-password-form.tsx +98 -0
  211. package/src/ui/auth/index.tsx +7 -0
  212. package/src/ui/auth/new-password-form.tsx +107 -0
  213. package/src/ui/auth/oauth-links.tsx +30 -0
  214. package/src/ui/auth/register-form.tsx +202 -0
  215. package/src/ui/auth/sign-in-form.tsx +238 -0
  216. package/src/ui/auth/verify-email-form.tsx +104 -0
  217. package/src/ui/crud/index.tsx +10 -0
  218. package/src/ui/data-display/accordion.tsx +65 -0
  219. package/src/ui/data-display/aspect-ratio.tsx +11 -0
  220. package/src/ui/data-display/avatar.tsx +163 -0
  221. package/src/ui/data-display/bento-grid.tsx +77 -0
  222. package/src/ui/data-display/carousel.tsx +249 -0
  223. package/src/ui/data-display/chart.tsx +363 -0
  224. package/src/ui/data-display/code-block-highlight.tsx +54 -0
  225. package/src/ui/data-display/collapsible.tsx +42 -0
  226. package/src/ui/data-display/compact-stat-bar.tsx +149 -0
  227. package/src/ui/data-display/data-table/data-table-context.tsx +255 -0
  228. package/src/ui/data-display/data-table/data-table-empty-state.tsx +133 -0
  229. package/src/ui/data-display/data-table/data-table-skeleton.tsx +145 -0
  230. package/src/ui/data-display/data-table/data-table-toolbar.tsx +353 -0
  231. package/src/ui/data-display/data-table/data-table.tsx +597 -0
  232. package/src/ui/data-display/data-table/index.ts +44 -0
  233. package/src/ui/data-display/data-table-column-header.tsx +75 -0
  234. package/src/ui/data-display/data-table-pagination.tsx +130 -0
  235. package/src/ui/data-display/data-table-view-options.tsx +59 -0
  236. package/src/ui/data-display/formatted-number-input.tsx +210 -0
  237. package/src/ui/data-display/highlight.tsx +20 -0
  238. package/src/ui/data-display/hover-card.tsx +48 -0
  239. package/src/ui/data-display/index.tsx +50 -0
  240. package/src/ui/data-display/iphone-15-pro.tsx +114 -0
  241. package/src/ui/data-display/kanban/index.ts +4 -0
  242. package/src/ui/data-display/kanban/kanban-board.tsx +192 -0
  243. package/src/ui/data-display/kanban/kanban-column.tsx +74 -0
  244. package/src/ui/data-display/kanban/kanban-item.tsx +50 -0
  245. package/src/ui/data-display/kanban/kanban-types.ts +21 -0
  246. package/src/ui/data-display/kpi-card.tsx +68 -0
  247. package/src/ui/data-display/media-grid.tsx +110 -0
  248. package/src/ui/data-display/safari.tsx +175 -0
  249. package/src/ui/data-display/show-more-text.tsx +55 -0
  250. package/src/ui/data-display/tabs.tsx +68 -0
  251. package/src/ui/data-display/timeline.tsx +256 -0
  252. package/src/ui/feedback/alert.tsx +60 -0
  253. package/src/ui/feedback/context-menu.tsx +245 -0
  254. package/src/ui/feedback/drawer.tsx +132 -0
  255. package/src/ui/feedback/error-dialog.tsx +273 -0
  256. package/src/ui/feedback/index.tsx +183 -0
  257. package/src/ui/feedback/progress.tsx +32 -0
  258. package/src/ui/feedback/sheet.tsx +148 -0
  259. package/src/ui/feedback/sonner.tsx +36 -0
  260. package/src/ui/forms/command.tsx +157 -0
  261. package/src/ui/forms/date-picker.tsx +73 -0
  262. package/src/ui/forms/date-range-picker.tsx +76 -0
  263. package/src/ui/forms/date-time-picker.tsx +109 -0
  264. package/src/ui/forms/editor/editor-menu-bar.tsx +394 -0
  265. package/src/ui/forms/editor/index.tsx +130 -0
  266. package/src/ui/forms/editor/multi-select-example.tsx +1234 -0
  267. package/src/ui/forms/emoji-picker.tsx +109 -0
  268. package/src/ui/forms/file-dropzone.tsx +169 -0
  269. package/src/ui/forms/file-thumbnail.tsx +29 -0
  270. package/src/ui/forms/index.tsx +201 -0
  271. package/src/ui/forms/input-file.tsx +99 -0
  272. package/src/ui/forms/input-group.tsx +46 -0
  273. package/src/ui/forms/input-otp.tsx +81 -0
  274. package/src/ui/forms/input-phone.tsx +172 -0
  275. package/src/ui/forms/input-spin.tsx +116 -0
  276. package/src/ui/forms/input-tags.tsx +219 -0
  277. package/src/ui/forms/input-time.tsx +42 -0
  278. package/src/ui/forms/multi-select.tsx +629 -0
  279. package/src/ui/forms/multiple-date-picker.tsx +74 -0
  280. package/src/ui/forms/radio-group.tsx +42 -0
  281. package/src/ui/forms/rating.tsx +158 -0
  282. package/src/ui/forms/time-picker.tsx +57 -0
  283. package/src/ui/index.tsx +17 -0
  284. package/src/ui/layout/animated-list.tsx +77 -0
  285. package/src/ui/layout/animated-sidebar.tsx +294 -0
  286. package/src/ui/layout/command-menu.tsx +355 -0
  287. package/src/ui/layout/customizer.tsx +324 -0
  288. package/src/ui/layout/footer.tsx +43 -0
  289. package/src/ui/layout/full-screen-toggle.tsx +52 -0
  290. package/src/ui/layout/header-breadcrumb.tsx +77 -0
  291. package/src/ui/layout/horizontal-layout-header.tsx +83 -0
  292. package/src/ui/layout/horizontal-layout.tsx +50 -0
  293. package/src/ui/layout/index.tsx +25 -0
  294. package/src/ui/layout/language-dropdown.tsx +103 -0
  295. package/src/ui/layout/logo.tsx +63 -0
  296. package/src/ui/layout/main-layout.tsx +57 -0
  297. package/src/ui/layout/mode-dropdown.tsx +58 -0
  298. package/src/ui/layout/notification-dropdown.tsx +127 -0
  299. package/src/ui/layout/page-tabs.tsx +306 -0
  300. package/src/ui/layout/route-cache.tsx +214 -0
  301. package/src/ui/layout/sidebar-group-icon-menu.tsx +195 -0
  302. package/src/ui/layout/sidebar.tsx +279 -0
  303. package/src/ui/layout/tab-content-cache.tsx +201 -0
  304. package/src/ui/layout/tab-navigation-provider.tsx +536 -0
  305. package/src/ui/layout/toggle-mobile-sidebar.tsx +33 -0
  306. package/src/ui/layout/top-bar-header-menubar.tsx +412 -0
  307. package/src/ui/layout/user-dropdown.tsx +188 -0
  308. package/src/ui/layout/vertical-layout-header.tsx +65 -0
  309. package/src/ui/layout/vertical-layout.tsx +47 -0
  310. package/src/ui/management/audit-log-page.tsx +209 -0
  311. package/src/ui/management/cache-management.tsx +349 -0
  312. package/src/ui/management/index.ts +3 -0
  313. package/src/ui/management/job-management.tsx +308 -0
  314. package/src/ui/pages/not-found.tsx +30 -0
  315. package/src/ui/primitives/badge.tsx +66 -0
  316. package/src/ui/primitives/breadcrumb.tsx +103 -0
  317. package/src/ui/primitives/button.tsx +129 -0
  318. package/src/ui/primitives/calendar.tsx +74 -0
  319. package/src/ui/primitives/card.tsx +86 -0
  320. package/src/ui/primitives/checkbox.tsx +31 -0
  321. package/src/ui/primitives/client.ts +30 -0
  322. package/src/ui/primitives/combobox.tsx +290 -0
  323. package/src/ui/primitives/dialog.tsx +121 -0
  324. package/src/ui/primitives/dropdown-menu.tsx +239 -0
  325. package/src/ui/primitives/dynamic-icon.tsx +24 -0
  326. package/src/ui/primitives/index.tsx +134 -0
  327. package/src/ui/primitives/input-number.tsx +131 -0
  328. package/src/ui/primitives/input.tsx +22 -0
  329. package/src/ui/primitives/keyboard.tsx +23 -0
  330. package/src/ui/primitives/label.tsx +24 -0
  331. package/src/ui/primitives/menubar.tsx +262 -0
  332. package/src/ui/primitives/navigation-menu.tsx +157 -0
  333. package/src/ui/primitives/pagination.tsx +118 -0
  334. package/src/ui/primitives/popover.tsx +56 -0
  335. package/src/ui/primitives/prefetch-link.tsx +60 -0
  336. package/src/ui/primitives/resizable.tsx +59 -0
  337. package/src/ui/primitives/scroll-area.tsx +63 -0
  338. package/src/ui/primitives/select.tsx +172 -0
  339. package/src/ui/primitives/separator.tsx +51 -0
  340. package/src/ui/primitives/sidebar.tsx +844 -0
  341. package/src/ui/primitives/slider.tsx +27 -0
  342. package/src/ui/primitives/status-badge.tsx +47 -0
  343. package/src/ui/primitives/sticky-layout.tsx +50 -0
  344. package/src/ui/primitives/switch.tsx +29 -0
  345. package/src/ui/primitives/table.tsx +116 -0
  346. package/src/ui/primitives/tabs.tsx +55 -0
  347. package/src/ui/primitives/toggle-group.tsx +70 -0
  348. package/src/ui/primitives/toggle.tsx +47 -0
  349. package/src/ui/primitives/tooltip.tsx +59 -0
  350. package/src/user/components/dangerous-zone.tsx +34 -0
  351. package/src/user/components/delete-account-form.tsx +40 -0
  352. package/src/user/components/index.ts +4 -0
  353. package/src/user/components/profile-info-form.tsx +390 -0
  354. package/src/user/components/profile-info.tsx +32 -0
  355. package/src/user/components/unified-profile-dialog.tsx +1019 -0
  356. package/src/user/components/user-stats.tsx +27 -0
  357. package/src/user/components/user-toolbar.tsx +137 -0
  358. package/src/user/components/users-card-view.tsx +253 -0
  359. package/src/user/index.ts +11 -0
  360. package/src/user/pages/user-list-page.tsx +234 -0
  361. package/src/user/pages/users-client-page.tsx +385 -0
  362. package/src/user/profile-page.tsx +19 -0
  363. package/src/user/schemas.ts +68 -0
  364. package/src/user/types.ts +34 -0
  365. package/src/user/user-service.ts +538 -0
  366. package/src/utils/index.ts +906 -0
  367. package/src/workflow/activity-timeline.tsx +412 -0
  368. package/src/workflow/approval-workflow.tsx +31 -0
  369. package/src/workflow/index.ts +2 -0
@@ -0,0 +1,74 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import { ChevronLeft, ChevronRight } from "lucide-react";
5
+ import { DayPicker } from "react-day-picker";
6
+
7
+ import { cn } from "../../utils";
8
+ import { buttonVariants } from "./button";
9
+
10
+ export type CalendarProps = React.ComponentProps<typeof DayPicker>;
11
+
12
+ function Calendar({
13
+ className,
14
+ classNames,
15
+ showOutsideDays = true,
16
+ ...props
17
+ }: CalendarProps) {
18
+ return (
19
+ <DayPicker
20
+ showOutsideDays={showOutsideDays}
21
+ className={cn("p-3", className)}
22
+ classNames={{
23
+ month: "space-y-4",
24
+ month_caption: "flex justify-center pt-1 items-center",
25
+ caption_label: "text-sm font-medium",
26
+ nav: "relative gap-x-1 flex items-center",
27
+ button_previous: cn(
28
+ buttonVariants({ variant: "outline" }),
29
+ "absolute top-0 start-0 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100",
30
+ ),
31
+ button_next: cn(
32
+ buttonVariants({ variant: "outline" }),
33
+ "absolute top-0 end-0 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100",
34
+ ),
35
+ month_grid: "w-full border-collapse space-y-1",
36
+ weekdays: "flex",
37
+ weekday:
38
+ "text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",
39
+ week: "flex w-full mt-2",
40
+ day: cn(
41
+ buttonVariants({ variant: "ghost" }),
42
+ "relative h-8 w-8 p-0 font-normal text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-e-md",
43
+ ),
44
+ day_button: "cursor-pointer h-full w-full aria-selected:opacity-100",
45
+ range_start: "rounded-md!",
46
+ range_end: "rounded-md!",
47
+ selected: cn(
48
+ "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
49
+ props.mode === "range" && "rounded-none",
50
+ ),
51
+ today: "bg-accent text-accent-foreground",
52
+ outside:
53
+ "day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",
54
+ disabled: "text-muted-foreground opacity-50",
55
+ range_middle:
56
+ "aria-selected:bg-accent aria-selected:text-accent-foreground",
57
+ hidden: "invisible",
58
+ ...classNames,
59
+ }}
60
+ components={{
61
+ Chevron: (props) => {
62
+ if (props.orientation === "left") {
63
+ return <ChevronLeft className="h-4 w-4" />;
64
+ }
65
+ return <ChevronRight className="h-4 w-4" />;
66
+ },
67
+ }}
68
+ {...props}
69
+ />
70
+ );
71
+ }
72
+ Calendar.displayName = "Calendar";
73
+
74
+ export { Calendar };
@@ -0,0 +1,86 @@
1
+ import * as React from "react";
2
+
3
+ import { cn } from "../../utils";
4
+
5
+ const Card = React.forwardRef<
6
+ HTMLDivElement,
7
+ React.HTMLAttributes<HTMLDivElement>
8
+ >(({ className, ...props }, ref) => (
9
+ <div
10
+ ref={ref}
11
+ className={cn(
12
+ "rounded-lg border bg-card text-card-foreground shadow-sm",
13
+ className,
14
+ )}
15
+ {...props}
16
+ />
17
+ ));
18
+ Card.displayName = "Card";
19
+
20
+ const CardHeader = React.forwardRef<
21
+ HTMLDivElement,
22
+ React.HTMLAttributes<HTMLDivElement>
23
+ >(({ className, ...props }, ref) => (
24
+ <div
25
+ ref={ref}
26
+ className={cn("flex flex-col space-y-1.5 p-6", className)}
27
+ {...props}
28
+ />
29
+ ));
30
+ CardHeader.displayName = "CardHeader";
31
+
32
+ const CardTitle = React.forwardRef<
33
+ HTMLParagraphElement,
34
+ React.HTMLAttributes<HTMLHeadingElement>
35
+ >(({ className, ...props }, ref) => (
36
+ <h3
37
+ ref={ref}
38
+ className={cn(
39
+ "text-2xl font-semibold leading-none tracking-tight",
40
+ className,
41
+ )}
42
+ {...props}
43
+ />
44
+ ));
45
+ CardTitle.displayName = "CardTitle";
46
+
47
+ const CardDescription = React.forwardRef<
48
+ HTMLParagraphElement,
49
+ React.HTMLAttributes<HTMLParagraphElement>
50
+ >(({ className, ...props }, ref) => (
51
+ <p
52
+ ref={ref}
53
+ className={cn("text-sm text-muted-foreground", className)}
54
+ {...props}
55
+ />
56
+ ));
57
+ CardDescription.displayName = "CardDescription";
58
+
59
+ const CardContent = React.forwardRef<
60
+ HTMLDivElement,
61
+ React.HTMLAttributes<HTMLDivElement>
62
+ >(({ className, ...props }, ref) => (
63
+ <div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
64
+ ));
65
+ CardContent.displayName = "CardContent";
66
+
67
+ const CardFooter = React.forwardRef<
68
+ HTMLDivElement,
69
+ React.HTMLAttributes<HTMLDivElement>
70
+ >(({ className, ...props }, ref) => (
71
+ <div
72
+ ref={ref}
73
+ className={cn("flex items-center p-6 pt-0", className)}
74
+ {...props}
75
+ />
76
+ ));
77
+ CardFooter.displayName = "CardFooter";
78
+
79
+ export {
80
+ Card,
81
+ CardHeader,
82
+ CardFooter,
83
+ CardTitle,
84
+ CardDescription,
85
+ CardContent,
86
+ };
@@ -0,0 +1,31 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import type { ComponentProps } from "react";
5
+ import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
6
+ import { Check } from "lucide-react";
7
+ import { cn } from "../../utils";
8
+
9
+ export interface CheckboxProps
10
+ extends ComponentProps<typeof CheckboxPrimitive.Root> {}
11
+
12
+ export const Checkbox = React.forwardRef<
13
+ React.ElementRef<typeof CheckboxPrimitive.Root>,
14
+ CheckboxProps
15
+ >(({ className, ...props }, ref) => (
16
+ <CheckboxPrimitive.Root
17
+ ref={ref}
18
+ className={cn(
19
+ "peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
20
+ className,
21
+ )}
22
+ {...props}
23
+ >
24
+ <CheckboxPrimitive.Indicator
25
+ className={cn("flex items-center justify-center text-current")}
26
+ >
27
+ <Check className="h-4 w-4" />
28
+ </CheckboxPrimitive.Indicator>
29
+ </CheckboxPrimitive.Root>
30
+ ));
31
+ Checkbox.displayName = CheckboxPrimitive.Root.displayName;
@@ -0,0 +1,30 @@
1
+ "use client";
2
+
3
+ export * from "./calendar";
4
+ export * from "./combobox";
5
+ export * from "./scroll-area";
6
+ export * from "./select";
7
+ export * from "./popover";
8
+ export * from "./dropdown-menu";
9
+ export * from "./switch";
10
+ export * from "./checkbox";
11
+ export * from "./label";
12
+ export * from "./tooltip";
13
+ export * from "./sidebar";
14
+ export * from "./resizable";
15
+ export * from "./slider";
16
+ export * from "./toggle";
17
+ export * from "./toggle-group";
18
+ export * from "./menubar";
19
+ export * from "./navigation-menu";
20
+ export * from "./sticky-layout";
21
+ export * from "./prefetch-link";
22
+ export * from "./dynamic-icon";
23
+ export * from "./input-number";
24
+
25
+ // Feedback Client Components
26
+ export * from "../feedback/sheet";
27
+ export * from "../feedback/context-menu";
28
+ export * from "../feedback/drawer";
29
+ export * from "../feedback/progress";
30
+ export * from "../feedback/sonner";
@@ -0,0 +1,290 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
5
+ import { Check, ChevronsUpDown, Search, X } from "lucide-react";
6
+
7
+ import { cn } from "../../utils";
8
+ import { Button } from "./button";
9
+ import { Input } from "./input";
10
+ import { ScrollArea } from "./scroll-area";
11
+
12
+ export interface ComboboxOption {
13
+ value: string | number | boolean;
14
+ label: string;
15
+ }
16
+
17
+ interface ComboboxProps {
18
+ options: ComboboxOption[];
19
+ value?: string | number | boolean;
20
+ onValueChange?: (value: string | number | boolean | undefined) => void;
21
+ placeholder?: string;
22
+ searchPlaceholder?: string;
23
+ emptyText?: string;
24
+ disabled?: boolean;
25
+ className?: string;
26
+ id?: string;
27
+ }
28
+
29
+ export function Combobox({
30
+ options,
31
+ value,
32
+ onValueChange,
33
+ placeholder = "Select option...",
34
+ searchPlaceholder = "Search...",
35
+ emptyText = "No option found.",
36
+ disabled = false,
37
+ className,
38
+ id,
39
+ }: ComboboxProps) {
40
+ const [open, setOpen] = useState(false);
41
+ const [searchValue, setSearchValue] = useState("");
42
+ const containerRef = useRef<HTMLDivElement>(null);
43
+ const searchInputRef = useRef<HTMLInputElement>(null);
44
+ const dropdownRef = useRef<HTMLDivElement>(null);
45
+
46
+ const selectedOption = options.find(
47
+ (option) => String(option.value) === String(value),
48
+ );
49
+
50
+ // Filter options based on search value
51
+ const filteredOptions = useMemo(() => {
52
+ if (!searchValue.trim()) {
53
+ return options;
54
+ }
55
+ const searchLower = searchValue.toLowerCase();
56
+ return options.filter(
57
+ (option) =>
58
+ option.label.toLowerCase().includes(searchLower) ||
59
+ String(option.value).toLowerCase().includes(searchLower),
60
+ );
61
+ }, [options, searchValue]);
62
+
63
+ // Reset search when dropdown closes
64
+ useEffect(() => {
65
+ if (!open) {
66
+ setSearchValue("");
67
+ }
68
+ }, [open]);
69
+
70
+ // Focus search input when dropdown opens
71
+ useEffect(() => {
72
+ if (open && searchInputRef.current) {
73
+ // Small delay to ensure dropdown is rendered
74
+ setTimeout(() => {
75
+ searchInputRef.current?.focus();
76
+ }, 50);
77
+ }
78
+ }, [open]);
79
+
80
+ // Close dropdown when clicking outside
81
+ useEffect(() => {
82
+ if (!open) return;
83
+
84
+ const handleClickOutside = (event: MouseEvent) => {
85
+ const target = event.target as HTMLElement;
86
+ if (
87
+ containerRef.current &&
88
+ !containerRef.current.contains(target) &&
89
+ dropdownRef.current &&
90
+ !dropdownRef.current.contains(target)
91
+ ) {
92
+ // Don't close if clicking inside dialog
93
+ if (target.closest('[data-slot="dialog-content"]')) {
94
+ return;
95
+ }
96
+ setOpen(false);
97
+ }
98
+ };
99
+
100
+ const handleEscape = (event: KeyboardEvent) => {
101
+ if (event.key === "Escape" && open) {
102
+ event.stopPropagation();
103
+ setOpen(false);
104
+ }
105
+ };
106
+
107
+ // Use capture phase to catch events before Dialog
108
+ document.addEventListener("mousedown", handleClickOutside, true);
109
+ document.addEventListener("keydown", handleEscape, true);
110
+
111
+ return () => {
112
+ document.removeEventListener("mousedown", handleClickOutside, true);
113
+ document.removeEventListener("keydown", handleEscape, true);
114
+ };
115
+ }, [open]);
116
+
117
+ const handleSelect = useCallback(
118
+ (optionValue: string | number | boolean) => {
119
+ if (onValueChange) {
120
+ onValueChange(optionValue);
121
+ setOpen(false);
122
+ }
123
+ },
124
+ [onValueChange],
125
+ );
126
+
127
+ const handleClear = useCallback(
128
+ (e: React.MouseEvent) => {
129
+ e.preventDefault();
130
+ e.stopPropagation();
131
+ if (onValueChange) {
132
+ // Pass undefined instead of empty string to indicate no selection
133
+ onValueChange(undefined);
134
+ }
135
+ },
136
+ [onValueChange],
137
+ );
138
+
139
+ return (
140
+ <div ref={containerRef} className="relative w-full">
141
+ <Button
142
+ type="button"
143
+ variant="outline"
144
+ role="combobox"
145
+ aria-expanded={open}
146
+ disabled={disabled}
147
+ className={cn("w-full justify-between", className)}
148
+ id={id}
149
+ onClick={(e) => {
150
+ e.stopPropagation();
151
+ setOpen(!open);
152
+ }}
153
+ >
154
+ <span className="truncate">
155
+ {selectedOption ? selectedOption.label : placeholder}
156
+ </span>
157
+ <div className="ml-2 flex items-center gap-1 shrink-0">
158
+ {selectedOption && (
159
+ <div
160
+ role="button"
161
+ tabIndex={0}
162
+ className="h-4 w-4 p-0 hover:bg-transparent cursor-pointer flex items-center justify-center"
163
+ onClick={handleClear}
164
+ onKeyDown={(e) => {
165
+ if (e.key === "Enter" || e.key === " ") {
166
+ e.preventDefault();
167
+ e.stopPropagation();
168
+ handleClear(e as any);
169
+ }
170
+ }}
171
+ >
172
+ <X className="h-3.5 w-3.5 text-red-500 hover:text-red-600" />
173
+ </div>
174
+ )}
175
+ <ChevronsUpDown className="h-4 w-4 opacity-50" />
176
+ </div>
177
+ </Button>
178
+
179
+ {open && (
180
+ <div
181
+ ref={dropdownRef}
182
+ className="absolute z-[100] mt-1 w-full rounded-md border bg-popover text-popover-foreground shadow-md"
183
+ style={{
184
+ top: "100%",
185
+ left: 0,
186
+ }}
187
+ >
188
+ <div className="flex flex-col">
189
+ {/* Search Input */}
190
+ <div className="flex items-center border-b px-3 py-2">
191
+ <Search className="mr-2 h-4 w-4 shrink-0 opacity-50" />
192
+ <Input
193
+ ref={searchInputRef}
194
+ placeholder={searchPlaceholder}
195
+ value={searchValue}
196
+ onChange={(e) => {
197
+ e.stopPropagation();
198
+ setSearchValue(e.target.value);
199
+ }}
200
+ onKeyDown={(e) => {
201
+ // Prevent Dialog from intercepting keyboard events
202
+ e.stopPropagation();
203
+ // Close dropdown on Escape
204
+ if (e.key === "Escape") {
205
+ e.preventDefault();
206
+ setOpen(false);
207
+ }
208
+ // Select first filtered option on Enter
209
+ if (e.key === "Enter") {
210
+ e.preventDefault();
211
+ if (filteredOptions.length > 0) {
212
+ handleSelect(filteredOptions[0].value);
213
+ }
214
+ }
215
+ }}
216
+ onClick={(e) => {
217
+ e.stopPropagation();
218
+ }}
219
+ onFocus={(e) => {
220
+ e.stopPropagation();
221
+ }}
222
+ className="border-0 focus-visible:ring-0 focus-visible:ring-offset-0 h-9 bg-transparent px-0"
223
+ />
224
+ {searchValue && (
225
+ <Button
226
+ type="button"
227
+ variant="ghost"
228
+ size="sm"
229
+ className="h-6 w-6 p-0"
230
+ onClick={(e) => {
231
+ e.stopPropagation();
232
+ setSearchValue("");
233
+ searchInputRef.current?.focus();
234
+ }}
235
+ >
236
+ <X className="h-3 w-3" />
237
+ </Button>
238
+ )}
239
+ </div>
240
+
241
+ {/* Options List */}
242
+ <ScrollArea className="max-h-[300px]">
243
+ {filteredOptions.length === 0 ? (
244
+ <div className="py-6 text-center text-sm text-muted-foreground">
245
+ {emptyText}
246
+ </div>
247
+ ) : (
248
+ <div className="p-1">
249
+ {filteredOptions.map((option) => {
250
+ const isSelected = String(value) === String(option.value);
251
+ return (
252
+ <div
253
+ key={String(option.value)}
254
+ role="option"
255
+ aria-selected={isSelected}
256
+ className={cn(
257
+ "relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none",
258
+ "hover:bg-accent hover:text-accent-foreground",
259
+ isSelected && "bg-accent text-accent-foreground",
260
+ )}
261
+ onMouseDown={(e) => {
262
+ e.preventDefault();
263
+ e.stopPropagation();
264
+ handleSelect(option.value);
265
+ }}
266
+ onClick={(e) => {
267
+ e.preventDefault();
268
+ e.stopPropagation();
269
+ handleSelect(option.value);
270
+ }}
271
+ >
272
+ <Check
273
+ className={cn(
274
+ "mr-2 h-4 w-4 shrink-0",
275
+ isSelected ? "opacity-100" : "opacity-0",
276
+ )}
277
+ />
278
+ <span className="flex-1 truncate">{option.label}</span>
279
+ </div>
280
+ );
281
+ })}
282
+ </div>
283
+ )}
284
+ </ScrollArea>
285
+ </div>
286
+ </div>
287
+ )}
288
+ </div>
289
+ );
290
+ }
@@ -0,0 +1,121 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import * as DialogPrimitive from "@radix-ui/react-dialog";
5
+ import { X } from "lucide-react";
6
+ import { cn } from "../../utils";
7
+
8
+ const Dialog = DialogPrimitive.Root;
9
+
10
+ const DialogTrigger = DialogPrimitive.Trigger;
11
+
12
+ const DialogPortal = DialogPrimitive.Portal;
13
+
14
+ const DialogClose = DialogPrimitive.Close;
15
+
16
+ const DialogOverlay = React.forwardRef<
17
+ React.ElementRef<typeof DialogPrimitive.Overlay>,
18
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
19
+ >(({ className, ...props }, ref) => (
20
+ <DialogPrimitive.Overlay
21
+ ref={ref}
22
+ className={cn(
23
+ "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",
24
+ className,
25
+ )}
26
+ {...props}
27
+ />
28
+ ));
29
+ DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
30
+
31
+ const DialogContent = React.forwardRef<
32
+ React.ElementRef<typeof DialogPrimitive.Content>,
33
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
34
+ >(({ className, children, ...props }, ref) => (
35
+ <DialogPortal>
36
+ <DialogOverlay />
37
+ <DialogPrimitive.Content
38
+ ref={ref}
39
+ className={cn(
40
+ "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",
41
+ className,
42
+ )}
43
+ {...props}
44
+ >
45
+ {children}
46
+ <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">
47
+ <X className="h-4 w-4" />
48
+ <span className="sr-only">Close</span>
49
+ </DialogPrimitive.Close>
50
+ </DialogPrimitive.Content>
51
+ </DialogPortal>
52
+ ));
53
+ DialogContent.displayName = DialogPrimitive.Content.displayName;
54
+
55
+ const DialogHeader = ({
56
+ className,
57
+ ...props
58
+ }: React.HTMLAttributes<HTMLDivElement>) => (
59
+ <div
60
+ className={cn(
61
+ "flex flex-col space-y-1.5 text-center sm:text-left",
62
+ className,
63
+ )}
64
+ {...props}
65
+ />
66
+ );
67
+ DialogHeader.displayName = "DialogHeader";
68
+
69
+ const DialogFooter = ({
70
+ className,
71
+ ...props
72
+ }: React.HTMLAttributes<HTMLDivElement>) => (
73
+ <div
74
+ className={cn(
75
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
76
+ className,
77
+ )}
78
+ {...props}
79
+ />
80
+ );
81
+ DialogFooter.displayName = "DialogFooter";
82
+
83
+ const DialogTitle = React.forwardRef<
84
+ React.ElementRef<typeof DialogPrimitive.Title>,
85
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
86
+ >(({ className, ...props }, ref) => (
87
+ <DialogPrimitive.Title
88
+ ref={ref}
89
+ className={cn(
90
+ "text-lg font-semibold leading-none tracking-tight",
91
+ className,
92
+ )}
93
+ {...props}
94
+ />
95
+ ));
96
+ DialogTitle.displayName = DialogPrimitive.Title.displayName;
97
+
98
+ const DialogDescription = React.forwardRef<
99
+ React.ElementRef<typeof DialogPrimitive.Description>,
100
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
101
+ >(({ className, ...props }, ref) => (
102
+ <DialogPrimitive.Description
103
+ ref={ref}
104
+ className={cn("text-sm text-muted-foreground", className)}
105
+ {...props}
106
+ />
107
+ ));
108
+ DialogDescription.displayName = DialogPrimitive.Description.displayName;
109
+
110
+ export {
111
+ Dialog,
112
+ DialogPortal,
113
+ DialogOverlay,
114
+ DialogClose,
115
+ DialogTrigger,
116
+ DialogContent,
117
+ DialogHeader,
118
+ DialogFooter,
119
+ DialogTitle,
120
+ DialogDescription,
121
+ };