@liorian/sdk 0.28.0-alpha.56010ca

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 (362) hide show
  1. package/README.md +483 -0
  2. package/package.json +94 -0
  3. package/schemas/module.schema.json +818 -0
  4. package/src/application/index.ts +3 -0
  5. package/src/application/module-instance.ts +36 -0
  6. package/src/application/service/auth-api-service.ts +291 -0
  7. package/src/application/service/auth-user.service.ts +108 -0
  8. package/src/application/service/index.ts +12 -0
  9. package/src/application/service/module-activation-api.service.ts +105 -0
  10. package/src/application/service/notifications-api-service.ts +38 -0
  11. package/src/application/service/notifications-push.service.ts +299 -0
  12. package/src/application/service/notifications-socket-service.ts +76 -0
  13. package/src/application/service/organizations-api-service.ts +104 -0
  14. package/src/application/service/otp-api-service.ts +11 -0
  15. package/src/application/service/storage-api-service.ts +77 -0
  16. package/src/application/service/storefront-api.service.ts +72 -0
  17. package/src/application/service/user-preferences-api.service.ts +57 -0
  18. package/src/domain/config/app.config.ts +35 -0
  19. package/src/domain/config/auth.config.ts +30 -0
  20. package/src/domain/config/index.ts +4 -0
  21. package/src/domain/config/logo.config.ts +17 -0
  22. package/src/domain/entities/activities.interface.ts +18 -0
  23. package/src/domain/entities/catalog.interface.ts +96 -0
  24. package/src/domain/entities/index.ts +13 -0
  25. package/src/domain/entities/media.ts +22 -0
  26. package/src/domain/entities/module-activation.interface.ts +173 -0
  27. package/src/domain/entities/module.interface.ts +101 -0
  28. package/src/domain/entities/notification.interface.ts +23 -0
  29. package/src/domain/entities/objectable.type.ts +3 -0
  30. package/src/domain/entities/organization.interface.ts +81 -0
  31. package/src/domain/entities/user-auth.interface.ts +17 -0
  32. package/src/domain/entities/user-phone.interface.ts +11 -0
  33. package/src/domain/entities/user-profile.interface.ts +23 -0
  34. package/src/domain/entities/user.interface.ts +79 -0
  35. package/src/domain/enums/coloring.enum.ts +6 -0
  36. package/src/domain/enums/domains.enum.ts +282 -0
  37. package/src/domain/enums/index.ts +8 -0
  38. package/src/domain/enums/module-category.enum.ts +57 -0
  39. package/src/domain/enums/module.enum.ts +97 -0
  40. package/src/domain/enums/routine.enum.ts +12 -0
  41. package/src/domain/enums/user-profile.enum.ts +25 -0
  42. package/src/domain/enums/user-status.enum.ts +7 -0
  43. package/src/domain/index.ts +6 -0
  44. package/src/domain/typing/auth-caches.ts +12 -0
  45. package/src/domain/typing/auth-oauth.types.ts +172 -0
  46. package/src/domain/typing/devise.ts +2 -0
  47. package/src/domain/typing/index.ts +10 -0
  48. package/src/domain/typing/response.ts +30 -0
  49. package/src/domain/typing/routine.types.ts +113 -0
  50. package/src/domain/typing/session.interface.ts +28 -0
  51. package/src/domain/typing/statisticals.ts +11 -0
  52. package/src/domain/typing/user-media-upload.ts +9 -0
  53. package/src/domain/typing/values.ts +6 -0
  54. package/src/index.tsx +168 -0
  55. package/src/infrastructure/capabilities/cache-storage/capability.ts +129 -0
  56. package/src/infrastructure/capabilities/cache-storage/enum.ts +5 -0
  57. package/src/infrastructure/capabilities/cache-storage/index.ts +4 -0
  58. package/src/infrastructure/capabilities/cache-storage/types.ts +13 -0
  59. package/src/infrastructure/capabilities/index.ts +3 -0
  60. package/src/infrastructure/capabilities/stackable/capability.ts +55 -0
  61. package/src/infrastructure/capabilities/stackable/index.ts +3 -0
  62. package/src/infrastructure/capabilities/stackable/types.ts +24 -0
  63. package/src/infrastructure/common-classname.constant.ts +4 -0
  64. package/src/infrastructure/data/countries.ts +208 -0
  65. package/src/infrastructure/data/gender.ts +5 -0
  66. package/src/infrastructure/data/index.ts +3 -0
  67. package/src/infrastructure/dataset/index.ts +3 -0
  68. package/src/infrastructure/dataset/sign-in.dataset.ts +21 -0
  69. package/src/infrastructure/dataset/sign-up.dataset.ts +64 -0
  70. package/src/infrastructure/hooks/index.ts +10 -0
  71. package/src/infrastructure/hooks/use-activity-lock-draft.ts +69 -0
  72. package/src/infrastructure/hooks/use-auth.ts +24 -0
  73. package/src/infrastructure/hooks/use-elastic-interaction.ts +180 -0
  74. package/src/infrastructure/hooks/use-is-desktop.ts +25 -0
  75. package/src/infrastructure/hooks/use-is-tauri.ts +17 -0
  76. package/src/infrastructure/hooks/use-mobile.ts +19 -0
  77. package/src/infrastructure/hooks/use-notifications.ts +128 -0
  78. package/src/infrastructure/hooks/use-recent-colors.ts +113 -0
  79. package/src/infrastructure/hooks/use-recent-modules.ts +76 -0
  80. package/src/infrastructure/index.tsx +11 -0
  81. package/src/infrastructure/library/design-system.ts +95 -0
  82. package/src/infrastructure/library/index.tsx +5 -0
  83. package/src/infrastructure/library/motion-utils.ts +77 -0
  84. package/src/infrastructure/library/motion.tsx +31 -0
  85. package/src/infrastructure/library/scroll-progress.tsx +93 -0
  86. package/src/infrastructure/providers/auth-guard.provider.tsx +47 -0
  87. package/src/infrastructure/providers/auth.provider.tsx +168 -0
  88. package/src/infrastructure/providers/index.tsx +8 -0
  89. package/src/infrastructure/providers/module-usage.provider.tsx +95 -0
  90. package/src/infrastructure/providers/modules-guard.provider.tsx +64 -0
  91. package/src/infrastructure/providers/modules-routines.provider.tsx +33 -0
  92. package/src/infrastructure/providers/modules-switcher.provider.tsx +25 -0
  93. package/src/infrastructure/providers/query.provider.tsx +27 -0
  94. package/src/infrastructure/routines/__tests__/routine.test.ts +368 -0
  95. package/src/infrastructure/routines/index.tsx +3 -0
  96. package/src/infrastructure/routines/routine.hook.ts +121 -0
  97. package/src/infrastructure/routines/routine.ts +283 -0
  98. package/src/infrastructure/routines/routine.tsx +283 -0
  99. package/src/infrastructure/stores/activity-lock.store.ts +22 -0
  100. package/src/infrastructure/stores/auth-user-connected.store.ts +24 -0
  101. package/src/infrastructure/stores/dataset.store.ts +106 -0
  102. package/src/infrastructure/stores/index.ts +6 -0
  103. package/src/infrastructure/stores/module.store.ts +266 -0
  104. package/src/infrastructure/stores/upload.store.ts +198 -0
  105. package/src/infrastructure/utilities/access-label.util.ts +158 -0
  106. package/src/infrastructure/utilities/activities.util.tsx +54 -0
  107. package/src/infrastructure/utilities/activity-lock.service.ts +263 -0
  108. package/src/infrastructure/utilities/activity-tracker.service.ts +205 -0
  109. package/src/infrastructure/utilities/api-service.ts +237 -0
  110. package/src/infrastructure/utilities/auth-logout.util.ts +23 -0
  111. package/src/infrastructure/utilities/classname.util.ts +7 -0
  112. package/src/infrastructure/utilities/encryption.service.ts +125 -0
  113. package/src/infrastructure/utilities/form-snapshot.service.ts +304 -0
  114. package/src/infrastructure/utilities/format.util.ts +40 -0
  115. package/src/infrastructure/utilities/index.tsx +23 -0
  116. package/src/infrastructure/utilities/media-label.service.ts +47 -0
  117. package/src/infrastructure/utilities/modules.ts +11 -0
  118. package/src/infrastructure/utilities/permission.util.ts +22 -0
  119. package/src/infrastructure/utilities/push-permission.util.ts +43 -0
  120. package/src/infrastructure/utilities/route-access.ts +38 -0
  121. package/src/infrastructure/utilities/socket-service.ts +123 -0
  122. package/src/infrastructure/utilities/sso-auth.util.ts +188 -0
  123. package/src/infrastructure/utilities/stringable.util.ts +16 -0
  124. package/src/infrastructure/utilities/strings.util.ts +18 -0
  125. package/src/infrastructure/utilities/tauri.util.ts +15 -0
  126. package/src/infrastructure/utilities/utils.ts +6 -0
  127. package/src/infrastructure/utilities/values.ts +5 -0
  128. package/src/presentation/8starlabs-ui/button.tsx +94 -0
  129. package/src/presentation/8starlabs-ui/flip-clock.tsx +368 -0
  130. package/src/presentation/8starlabs-ui/heatmap.tsx +430 -0
  131. package/src/presentation/8starlabs-ui/hooks/index.tsx +2 -0
  132. package/src/presentation/8starlabs-ui/hooks/use-mobile.ts +21 -0
  133. package/src/presentation/8starlabs-ui/index.tsx +20 -0
  134. package/src/presentation/8starlabs-ui/json-viewer.tsx +972 -0
  135. package/src/presentation/8starlabs-ui/marquee.tsx +134 -0
  136. package/src/presentation/8starlabs-ui/partition-bar.tsx +198 -0
  137. package/src/presentation/8starlabs-ui/scroll-fade.tsx +158 -0
  138. package/src/presentation/8starlabs-ui/status-indicator.tsx +86 -0
  139. package/src/presentation/8starlabs-ui/system-banner.tsx +50 -0
  140. package/src/presentation/8starlabs-ui/timeline.tsx +576 -0
  141. package/src/presentation/8starlabs-ui/transport-badge.tsx +249 -0
  142. package/src/presentation/8starlabs-ui/ui/copy-button.tsx +60 -0
  143. package/src/presentation/8starlabs-ui/ui/index.tsx +2 -0
  144. package/src/presentation/analytics-section.tsx +85 -0
  145. package/src/presentation/app-sidebar.tsx +234 -0
  146. package/src/presentation/charts/area-widget.chart-skeleton.tsx +61 -0
  147. package/src/presentation/charts/area-widget.chart.tsx +128 -0
  148. package/src/presentation/charts/chart-widgets.types.ts +81 -0
  149. package/src/presentation/charts/index.tsx +16 -0
  150. package/src/presentation/charts/line-widget.chart-skeleton.tsx +64 -0
  151. package/src/presentation/charts/line-widget.chart.tsx +105 -0
  152. package/src/presentation/charts/pie-widget.chart-skeleton.tsx +56 -0
  153. package/src/presentation/charts/pie-widget.chart.tsx +168 -0
  154. package/src/presentation/charts/radar-widget.chart-skeleton.tsx +67 -0
  155. package/src/presentation/charts/radar-widget.chart.tsx +80 -0
  156. package/src/presentation/charts/radial-stacked-widget.chart-skeleton.tsx +66 -0
  157. package/src/presentation/charts/radial-stacked-widget.chart.tsx +120 -0
  158. package/src/presentation/charts/radial-widget.chart-skeleton.tsx +61 -0
  159. package/src/presentation/charts/radial-widget.chart.tsx +87 -0
  160. package/src/presentation/charts/tooltip-widget.chart-skeleton.tsx +64 -0
  161. package/src/presentation/charts/tooltip-widget.chart.tsx +89 -0
  162. package/src/presentation/components/activity-actions.tsx +20 -0
  163. package/src/presentation/components/activity-container.tsx +55 -0
  164. package/src/presentation/components/activity-content.tsx +20 -0
  165. package/src/presentation/components/activity-descriptor-parser.tsx +37 -0
  166. package/src/presentation/components/activity-header.tsx +20 -0
  167. package/src/presentation/components/activity-loader.tsx +19 -0
  168. package/src/presentation/components/activity-title.tsx +32 -0
  169. package/src/presentation/components/activity.tsx +22 -0
  170. package/src/presentation/components/auth/index.tsx +4 -0
  171. package/src/presentation/components/auth/sso-callback.view.tsx +44 -0
  172. package/src/presentation/components/auth/sso-disconnect.view.tsx +41 -0
  173. package/src/presentation/components/auth/sso-sign-in.view.tsx +29 -0
  174. package/src/presentation/components/auth-lock-screen.tsx +309 -0
  175. package/src/presentation/components/auth-session.view.tsx +17 -0
  176. package/src/presentation/components/data-table.tsx +814 -0
  177. package/src/presentation/components/dynamic-icon.tsx +16 -0
  178. package/src/presentation/components/floating-upload.tsx +291 -0
  179. package/src/presentation/components/index.tsx +40 -0
  180. package/src/presentation/components/local-time.tsx +170 -0
  181. package/src/presentation/components/markdown-parser.tsx +201 -0
  182. package/src/presentation/components/message-scroller.tsx +131 -0
  183. package/src/presentation/components/module-first-access-config.view.tsx +181 -0
  184. package/src/presentation/components/module-first-access-pending.view.tsx +38 -0
  185. package/src/presentation/components/module-guard.tsx +34 -0
  186. package/src/presentation/components/modules-first-access.guard.tsx +88 -0
  187. package/src/presentation/components/modules-guard-forbidden.tsx +46 -0
  188. package/src/presentation/components/notification-details.modal.tsx +145 -0
  189. package/src/presentation/components/notification-item.tsx +127 -0
  190. package/src/presentation/components/notifications-popover.tsx +128 -0
  191. package/src/presentation/components/push-notifications.provider.tsx +65 -0
  192. package/src/presentation/components/upload-progress-dialog.tsx +140 -0
  193. package/src/presentation/components/waiting-bar.tsx +22 -0
  194. package/src/presentation/components/waiting-section.tsx +15 -0
  195. package/src/presentation/components/waiting.tsx +14 -0
  196. package/src/presentation/data-grid/data-grid-empty.tsx +24 -0
  197. package/src/presentation/data-grid/data-grid-search-engine.tsx +32 -0
  198. package/src/presentation/data-grid/data-grid.tsx +892 -0
  199. package/src/presentation/data-grid/index.tsx +4 -0
  200. package/src/presentation/form-screen.tsx +95 -0
  201. package/src/presentation/icons/custom.tsx +20 -0
  202. package/src/presentation/icons/glyphIcons.tsx +53 -0
  203. package/src/presentation/icons/icons.enum.ts +4 -0
  204. package/src/presentation/icons/icons.util.ts +6 -0
  205. package/src/presentation/icons/index.tsx +8 -0
  206. package/src/presentation/icons/lucide.tsx +17 -0
  207. package/src/presentation/icons/remix.tsx +33 -0
  208. package/src/presentation/icons/types.ts +27 -0
  209. package/src/presentation/index.tsx +45 -0
  210. package/src/presentation/modals/components/ModalBox.tsx +74 -0
  211. package/src/presentation/modals/components/ModalPortal.tsx +31 -0
  212. package/src/presentation/modals/components/ModalStepper.tsx +319 -0
  213. package/src/presentation/modals/components/ModalWrapper.tsx +65 -0
  214. package/src/presentation/modals/components/index.tsx +5 -0
  215. package/src/presentation/modals/hooks/index.ts +2 -0
  216. package/src/presentation/modals/hooks/useModal.ts +38 -0
  217. package/src/presentation/modals/index.tsx +5 -0
  218. package/src/presentation/modals/stores/index.ts +2 -0
  219. package/src/presentation/modals/stores/useModalStore.ts +90 -0
  220. package/src/presentation/modals/types/index.ts +2 -0
  221. package/src/presentation/modals/types/modal.type.ts +33 -0
  222. package/src/presentation/module-menubar.tsx +300 -0
  223. package/src/presentation/module-widget.tsx +233 -0
  224. package/src/presentation/nav-documents.tsx +89 -0
  225. package/src/presentation/nav-main.tsx +62 -0
  226. package/src/presentation/nav-secondary.tsx +41 -0
  227. package/src/presentation/nav-user.tsx +109 -0
  228. package/src/presentation/permission-action-badge.tsx +35 -0
  229. package/src/presentation/reui/index.tsx +3 -0
  230. package/src/presentation/reui/stepper.tsx +508 -0
  231. package/src/presentation/reui/timeline.tsx +226 -0
  232. package/src/presentation/sheets/index.tsx +2 -0
  233. package/src/presentation/sheets/legacy-sheet-header.tsx +0 -0
  234. package/src/presentation/sheets/legacy-sheet.tsx +37 -0
  235. package/src/presentation/size.enum.ts +19 -0
  236. package/src/presentation/system/index.tsx +3 -0
  237. package/src/presentation/system/logo.theme.tsx +21 -0
  238. package/src/presentation/system/types.ts +10 -0
  239. package/src/presentation/theme/index.tsx +6 -0
  240. package/src/presentation/theme/prefer-color-scheme.tsx +50 -0
  241. package/src/presentation/theme/switch-color-scheme.tsx +16 -0
  242. package/src/presentation/theme/theme-switcher-button.tsx +20 -0
  243. package/src/presentation/theme/theme.enum.ts +4 -0
  244. package/src/presentation/theme/theme.store.ts +87 -0
  245. package/src/presentation/themes/index.tsx +2 -0
  246. package/src/presentation/themes/katon/dashboard-layout.tsx +1080 -0
  247. package/src/presentation/themes/katon/edge-section.tsx +19 -0
  248. package/src/presentation/themes/katon/header-menubar.tsx +270 -0
  249. package/src/presentation/themes/katon/header-modules-available.tsx +44 -0
  250. package/src/presentation/themes/katon/header-modules-recents.tsx +52 -0
  251. package/src/presentation/themes/katon/header-modules-store.tsx +25 -0
  252. package/src/presentation/themes/katon/header-options.tsx +13 -0
  253. package/src/presentation/themes/katon/header-organization-select.tsx +146 -0
  254. package/src/presentation/themes/katon/header-routines.tsx +74 -0
  255. package/src/presentation/themes/katon/header-tasks-connected-user.tsx +150 -0
  256. package/src/presentation/themes/katon/index.tsx +16 -0
  257. package/src/presentation/themes/katon/main-wrapper.tsx +34 -0
  258. package/src/presentation/themes/katon/module-item-link.tsx +32 -0
  259. package/src/presentation/themes/katon/view-frame.tsx +25 -0
  260. package/src/presentation/themes/katon/view-helmet.tsx +53 -0
  261. package/src/presentation/themes/katon/view-status.tsx +32 -0
  262. package/src/presentation/themes/katon/view-wrapper.tsx +15 -0
  263. package/src/presentation/themes/katon/view.tsx +42 -0
  264. package/src/presentation/ui/accordion-multiselect.tsx +206 -0
  265. package/src/presentation/ui/accordion.tsx +81 -0
  266. package/src/presentation/ui/alert-dialog.tsx +199 -0
  267. package/src/presentation/ui/alert.tsx +76 -0
  268. package/src/presentation/ui/aspect-ratio.tsx +11 -0
  269. package/src/presentation/ui/attachment.tsx +204 -0
  270. package/src/presentation/ui/avatar.tsx +112 -0
  271. package/src/presentation/ui/badge.tsx +49 -0
  272. package/src/presentation/ui/breadcrumb.tsx +122 -0
  273. package/src/presentation/ui/bubble.tsx +125 -0
  274. package/src/presentation/ui/button-group.tsx +83 -0
  275. package/src/presentation/ui/button.tsx +87 -0
  276. package/src/presentation/ui/calendar.tsx +222 -0
  277. package/src/presentation/ui/card.tsx +106 -0
  278. package/src/presentation/ui/carousel.tsx +242 -0
  279. package/src/presentation/ui/chart.tsx +373 -0
  280. package/src/presentation/ui/checkbox.tsx +33 -0
  281. package/src/presentation/ui/clickable.tsx +58 -0
  282. package/src/presentation/ui/collapsible.tsx +33 -0
  283. package/src/presentation/ui/color-swatch-selector.tsx +81 -0
  284. package/src/presentation/ui/combobox.tsx +299 -0
  285. package/src/presentation/ui/command.tsx +195 -0
  286. package/src/presentation/ui/context-menu.tsx +263 -0
  287. package/src/presentation/ui/dialog.tsx +168 -0
  288. package/src/presentation/ui/direction.tsx +22 -0
  289. package/src/presentation/ui/drawer.tsx +134 -0
  290. package/src/presentation/ui/dropdown-menu.tsx +269 -0
  291. package/src/presentation/ui/empty.tsx +104 -0
  292. package/src/presentation/ui/field.tsx +238 -0
  293. package/src/presentation/ui/granularity-selector.tsx +58 -0
  294. package/src/presentation/ui/hover-card.tsx +44 -0
  295. package/src/presentation/ui/index.tsx +74 -0
  296. package/src/presentation/ui/input-group.tsx +156 -0
  297. package/src/presentation/ui/input-otp.tsx +87 -0
  298. package/src/presentation/ui/input.tsx +19 -0
  299. package/src/presentation/ui/item.tsx +196 -0
  300. package/src/presentation/ui/kpi-card.tsx +203 -0
  301. package/src/presentation/ui/label-selector.tsx +100 -0
  302. package/src/presentation/ui/label.tsx +24 -0
  303. package/src/presentation/ui/legacy-birth-date-input.tsx +43 -0
  304. package/src/presentation/ui/legacy-color-picker/index.tsx +42 -0
  305. package/src/presentation/ui/legacy-color-picker/legacy-color-picker.content.tsx +37 -0
  306. package/src/presentation/ui/legacy-color-picker/legacy-color-picker.context.tsx +42 -0
  307. package/src/presentation/ui/legacy-color-picker/legacy-color-picker.hex-input.tsx +97 -0
  308. package/src/presentation/ui/legacy-color-picker/legacy-color-picker.picker.tsx +266 -0
  309. package/src/presentation/ui/legacy-color-picker/legacy-color-picker.presets.ts +22 -0
  310. package/src/presentation/ui/legacy-color-picker/legacy-color-picker.quick-list.tsx +49 -0
  311. package/src/presentation/ui/legacy-color-picker/legacy-color-picker.recent.tsx +43 -0
  312. package/src/presentation/ui/legacy-color-picker/legacy-color-picker.swatches.tsx +111 -0
  313. package/src/presentation/ui/legacy-color-picker/legacy-color-picker.trigger.tsx +128 -0
  314. package/src/presentation/ui/legacy-color-picker/legacy-color-picker.tsx +110 -0
  315. package/src/presentation/ui/legacy-color-picker/legacy-color-picker.types.ts +1 -0
  316. package/src/presentation/ui/legacy-color-picker/legacy-color-picker.utils.ts +114 -0
  317. package/src/presentation/ui/legacy-country-input.tsx +171 -0
  318. package/src/presentation/ui/legacy-gender-input.tsx +22 -0
  319. package/src/presentation/ui/legacy-input.tsx +106 -0
  320. package/src/presentation/ui/legacy-phone-input.tsx +213 -0
  321. package/src/presentation/ui/legacy-select-input.tsx +114 -0
  322. package/src/presentation/ui/legacy-text-area.tsx +111 -0
  323. package/src/presentation/ui/list-items.tsx +59 -0
  324. package/src/presentation/ui/marker.tsx +69 -0
  325. package/src/presentation/ui/media-player/index.tsx +12 -0
  326. package/src/presentation/ui/media-player/media-player.context.tsx +36 -0
  327. package/src/presentation/ui/media-player/media-player.tsx +167 -0
  328. package/src/presentation/ui/media-player/player-controls.tsx +207 -0
  329. package/src/presentation/ui/media-player/players/audio-player.tsx +78 -0
  330. package/src/presentation/ui/media-player/players/index.tsx +4 -0
  331. package/src/presentation/ui/media-player/players/video-player.tsx +193 -0
  332. package/src/presentation/ui/media-player/players/voice-note-player.tsx +108 -0
  333. package/src/presentation/ui/media-player/use-media-player.hook.ts +263 -0
  334. package/src/presentation/ui/menubar.tsx +281 -0
  335. package/src/presentation/ui/message.tsx +92 -0
  336. package/src/presentation/ui/navigation-menu.tsx +172 -0
  337. package/src/presentation/ui/pagination.tsx +129 -0
  338. package/src/presentation/ui/popover.tsx +89 -0
  339. package/src/presentation/ui/progress.tsx +31 -0
  340. package/src/presentation/ui/resizable.tsx +50 -0
  341. package/src/presentation/ui/select.tsx +192 -0
  342. package/src/presentation/ui/separator.tsx +28 -0
  343. package/src/presentation/ui/sheet.tsx +147 -0
  344. package/src/presentation/ui/sidebar.tsx +702 -0
  345. package/src/presentation/ui/skeleton.tsx +13 -0
  346. package/src/presentation/ui/slide-to-confirm.tsx +129 -0
  347. package/src/presentation/ui/slider.tsx +59 -0
  348. package/src/presentation/ui/sonner.tsx +58 -0
  349. package/src/presentation/ui/switch.tsx +33 -0
  350. package/src/presentation/ui/table.tsx +116 -0
  351. package/src/presentation/ui/tabs.tsx +90 -0
  352. package/src/presentation/ui/text-gradient.tsx +84 -0
  353. package/src/presentation/ui/textarea.tsx +18 -0
  354. package/src/presentation/ui/timeline-steps.tsx +235 -0
  355. package/src/presentation/ui/toggle-group.tsx +89 -0
  356. package/src/presentation/ui/toggle.tsx +47 -0
  357. package/src/presentation/ui/tooltip.tsx +57 -0
  358. package/src/presentation/uploading/index.tsx +3 -0
  359. package/src/presentation/uploading/media-upload-field.tsx +152 -0
  360. package/src/presentation/uploading/storage-media.tsx +210 -0
  361. package/src/styles.css +403 -0
  362. package/src/themes.css +1038 -0
@@ -0,0 +1,1080 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { cn } from "../../../infrastructure/utilities/utils"
5
+
6
+ /* -------------------------------------------------------------------------- */
7
+ /* DashboardLayout */
8
+ /* -------------------------------------------------------------------------- */
9
+
10
+ export interface DashboardLayoutProps extends React.HTMLAttributes<HTMLDivElement> {
11
+ children?: React.ReactNode
12
+ className?: string
13
+ maxWidth?: "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "default"
14
+ hasBackgroundEffects?: boolean
15
+ }
16
+
17
+ function getLayoutMaxWidth(maxWidth?: DashboardLayoutProps["maxWidth"]) {
18
+ switch (maxWidth) {
19
+ case "sm":
20
+ return "max-w-screen-sm"
21
+ case "md":
22
+ return "max-w-screen-md"
23
+ case "lg":
24
+ return "max-w-screen-lg"
25
+ case "xl":
26
+ return "max-w-screen-xl"
27
+ case "2xl":
28
+ return "max-w-screen-2xl"
29
+ case "full":
30
+ return "max-w-full"
31
+ case "default":
32
+ default:
33
+ return "max-w-7xl"
34
+ }
35
+ }
36
+
37
+ export function DashboardLayoutRoot({
38
+ children,
39
+ className,
40
+ maxWidth = "default",
41
+ hasBackgroundEffects = false,
42
+ ...props
43
+ }: DashboardLayoutProps) {
44
+ const maxW = getLayoutMaxWidth(maxWidth)
45
+
46
+ return (
47
+ <div
48
+ data-slot="dashboard-layout"
49
+ className={cn(
50
+ "relative w-full min-h-screen flex flex-col gap-6 p-4 sm:p-6 md:p-8 mx-auto text-foreground antialiased",
51
+ maxW,
52
+ className
53
+ )}
54
+ {...props}
55
+ >
56
+ {hasBackgroundEffects && (
57
+ <div className="fixed inset-0 z-0 overflow-hidden pointer-events-none" aria-hidden="true">
58
+ <div className="absolute aspect-square -top-[10%] -left-[5%] w-[35%] rounded-full bg-primary/10 blur-[130px]" />
59
+ <div className="absolute aspect-square top-[30%] -right-[15%] w-[35%] rounded-full bg-primary/10 blur-[150px]" />
60
+ <div className="absolute aspect-square -bottom-[10%] left-[20%] w-[30%] rounded-full bg-primary/15 blur-[160px]" />
61
+ </div>
62
+ )}
63
+ <div className="relative z-1 flex flex-col gap-6 w-full flex-1">{children}</div>
64
+ </div>
65
+ )
66
+ }
67
+
68
+ /* -------------------------------------------------------------------------- */
69
+ /* Header & Subcomponents */
70
+ /* -------------------------------------------------------------------------- */
71
+
72
+ export interface DashboardHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
73
+ children?: React.ReactNode
74
+ className?: string
75
+ }
76
+
77
+ export function DashboardHeader({ children, className, ...props}: DashboardHeaderProps) {
78
+ return (
79
+ <header
80
+ data-slot="dashboard-header"
81
+ className={cn("flex flex-col gap-4 w-full", className)}
82
+ {...props}
83
+ >
84
+ {children}
85
+ </header>
86
+ )
87
+ }
88
+
89
+ export interface DashboardHeaderTopProps extends React.HTMLAttributes<HTMLDivElement> {
90
+ children?: React.ReactNode
91
+ className?: string
92
+ }
93
+
94
+ export function DashboardHeaderTop({ children, className, ...props }: DashboardHeaderTopProps) {
95
+ return (
96
+ <div
97
+ data-slot="dashboard-header-top"
98
+ className={cn("flex items-center justify-between gap-4 flex-wrap", className)}
99
+ {...props}
100
+ >
101
+ {children}
102
+ </div>
103
+ )
104
+ }
105
+
106
+ export interface DashboardHeaderStartProps extends React.HTMLAttributes<HTMLDivElement> {
107
+ children?: React.ReactNode
108
+ className?: string
109
+ }
110
+
111
+ export function DashboardHeaderStart({ children, className, ...props }: DashboardHeaderStartProps) {
112
+ return (
113
+ <div
114
+ data-slot="dashboard-header-start"
115
+ className={cn("flex items-center gap-3 min-w-0", className)}
116
+ {...props}
117
+ >
118
+ {children}
119
+ </div>
120
+ )
121
+ }
122
+
123
+ export interface DashboardIconProps extends React.HTMLAttributes<HTMLDivElement> {
124
+ children?: React.ReactNode
125
+ className?: string
126
+ size?: "sm" | "md" | "lg"
127
+ }
128
+
129
+ export function DashboardIcon({ children, className, size = "md", ...props }: DashboardIconProps) {
130
+ const sizeClasses = {
131
+ sm: "w-7 h-7 text-xs rounded-lg",
132
+ md: "w-9 h-9 text-base rounded-xl",
133
+ lg: "w-11 h-11 text-lg rounded-2xl",
134
+ }[size]
135
+
136
+ return (
137
+ <div
138
+ data-slot="dashboard-icon"
139
+ className={cn(
140
+ "flex shrink-0 items-center justify-center bg-primary/15 text-primary border border-primary/20 backdrop-blur-md shadow-xs",
141
+ sizeClasses,
142
+ className
143
+ )}
144
+ {...props}
145
+ >
146
+ {children}
147
+ </div>
148
+ )
149
+ }
150
+
151
+ export interface DashboardTitleProps extends React.HTMLAttributes<HTMLHeadingElement> {
152
+ children?: React.ReactNode
153
+ className?: string
154
+ }
155
+
156
+ export function DashboardTitle({ children, className, ...props }: DashboardTitleProps) {
157
+ return (
158
+ <h1
159
+ data-slot="dashboard-title"
160
+ className={cn(
161
+ "text-xl sm:text-2xl font-semibold tracking-tight text-foreground flex items-center gap-2 truncate",
162
+ className
163
+ )}
164
+ {...props}
165
+ >
166
+ {children}
167
+ </h1>
168
+ )
169
+ }
170
+
171
+ export interface DashboardDescriptionProps extends React.HTMLAttributes<HTMLParagraphElement> {
172
+ children?: React.ReactNode
173
+ className?: string
174
+ }
175
+
176
+ export function DashboardDescription({ children, className, ...props }: DashboardDescriptionProps) {
177
+ return (
178
+ <p
179
+ data-slot="dashboard-description"
180
+ className={cn("text-xs sm:text-sm text-muted-foreground", className)}
181
+ {...props}
182
+ >
183
+ {children}
184
+ </p>
185
+ )
186
+ }
187
+
188
+ export interface DashboardActionsProps extends React.HTMLAttributes<HTMLDivElement> {
189
+ children?: React.ReactNode
190
+ className?: string
191
+ }
192
+
193
+ export function DashboardActions({ children, className, ...props }: DashboardActionsProps) {
194
+ return (
195
+ <div
196
+ data-slot="dashboard-actions"
197
+ className={cn("flex items-center gap-2 shrink-0 ml-auto", className)}
198
+ {...props}
199
+ >
200
+ {children}
201
+ </div>
202
+ )
203
+ }
204
+
205
+ /* -------------------------------------------------------------------------- */
206
+ /* Quick Metrics / Stat Tabs */
207
+ /* -------------------------------------------------------------------------- */
208
+
209
+ export interface DashboardMetricsProps extends React.HTMLAttributes<HTMLDivElement> {
210
+ children?: React.ReactNode
211
+ className?: string
212
+ cols?: 1 | 2 | 3 | 4 | 5 | 6 | "auto"
213
+ }
214
+
215
+ export function DashboardMetrics({
216
+ children,
217
+ className,
218
+ cols = "auto",
219
+ ...props
220
+ }: DashboardMetricsProps) {
221
+ const colClasses = {
222
+ 1: "grid-cols-1",
223
+ 2: "grid-cols-2",
224
+ 3: "grid-cols-2 sm:grid-cols-3",
225
+ 4: "grid-cols-2 sm:grid-cols-4",
226
+ 5: "grid-cols-2 sm:grid-cols-3 md:grid-cols-5",
227
+ 6: "grid-cols-2 sm:grid-cols-3 md:grid-cols-6",
228
+ auto: "grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5",
229
+ }[cols]
230
+
231
+ return (
232
+ <div
233
+ data-slot="dashboard-metrics"
234
+ className={cn("grid gap-2.5 sm:gap-3 w-full", colClasses, className)}
235
+ {...props}
236
+ >
237
+ {children}
238
+ </div>
239
+ )
240
+ }
241
+
242
+ export interface DashboardMetricCardProps extends React.HTMLAttributes<HTMLDivElement> {
243
+ label: React.ReactNode
244
+ value?: React.ReactNode
245
+ icon?: React.ReactNode
246
+ badge?: React.ReactNode
247
+ active?: boolean
248
+ onClick?: () => void
249
+ children?: React.ReactNode
250
+ className?: string
251
+ }
252
+
253
+ export function DashboardMetricCard({
254
+ label,
255
+ value,
256
+ icon,
257
+ badge,
258
+ active = false,
259
+ onClick,
260
+ children,
261
+ className,
262
+ ...props
263
+ }: DashboardMetricCardProps) {
264
+ const isClickable = !!onClick
265
+
266
+ return (
267
+ <div
268
+ data-slot="dashboard-metric-card"
269
+ data-active={active}
270
+ onClick={onClick}
271
+ className={cn(
272
+ "group relative flex flex-col justify-between gap-2 rounded-xl p-3 sm:p-3.5 transition-all duration-200 backdrop-blur-xl select-none",
273
+ "bg-card/60 dark:bg-card/40 border border-border/40 hover:border-border/80 shadow-xs",
274
+ active && "border-primary/50 bg-primary/10 shadow-primary/5 ring-1 ring-primary/30",
275
+ isClickable && "cursor-pointer hover:bg-card/80 dark:hover:bg-card/60",
276
+ className
277
+ )}
278
+ {...props}
279
+ >
280
+ <div className="flex items-center justify-between gap-2">
281
+ <span className="text-xs font-medium text-muted-foreground group-hover:text-foreground transition-colors truncate">
282
+ {label}
283
+ </span>
284
+ {badge && <span className="shrink-0 text-[10px]">{badge}</span>}
285
+ </div>
286
+
287
+ {(value || icon || children) && (
288
+ <div className="flex items-center gap-2 mt-0.5">
289
+ {icon && (
290
+ <span className="shrink-0 text-muted-foreground/80 group-hover:text-primary transition-colors">
291
+ {icon}
292
+ </span>
293
+ )}
294
+ {value && (
295
+ <span className="text-sm sm:text-base font-semibold tracking-tight text-foreground truncate">
296
+ {value}
297
+ </span>
298
+ )}
299
+ {children}
300
+ </div>
301
+ )}
302
+ </div>
303
+ )
304
+ }
305
+
306
+ /* -------------------------------------------------------------------------- */
307
+ /* Content & Grid */
308
+ /* -------------------------------------------------------------------------- */
309
+
310
+ export interface DashboardBodyProps extends React.HTMLAttributes<HTMLDivElement> {
311
+ children?: React.ReactNode
312
+ className?: string
313
+ }
314
+
315
+ export function DashboardBody({ children, className, ...props }: DashboardBodyProps) {
316
+ return (
317
+ <div
318
+ data-slot="dashboard-body"
319
+ className={cn("flex flex-col gap-6 w-full flex-1", className)}
320
+ {...props}
321
+ >
322
+ {children}
323
+ </div>
324
+ )
325
+ }
326
+
327
+ export interface DashboardGridProps extends React.HTMLAttributes<HTMLDivElement> {
328
+ children?: React.ReactNode
329
+ className?: string
330
+ cols?: 1 | 2 | 3 | 4 | 12
331
+ }
332
+
333
+ export function DashboardGrid({ children, className, cols = 12, ...props }: DashboardGridProps) {
334
+ const colClasses = {
335
+ 1: "grid-cols-1",
336
+ 2: "grid-cols-1 md:grid-cols-2",
337
+ 3: "grid-cols-1 md:grid-cols-3",
338
+ 4: "grid-cols-1 md:grid-cols-2 lg:grid-cols-4",
339
+ 12: "grid-cols-1 lg:grid-cols-12",
340
+ }[cols]
341
+
342
+ return (
343
+ <div
344
+ data-slot="dashboard-grid"
345
+ className={cn("grid gap-5 sm:gap-6 w-full", colClasses, className)}
346
+ {...props}
347
+ >
348
+ {children}
349
+ </div>
350
+ )
351
+ }
352
+
353
+ export interface DashboardColProps extends React.HTMLAttributes<HTMLDivElement> {
354
+ children?: React.ReactNode
355
+ className?: string
356
+ span?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
357
+ }
358
+
359
+ export function DashboardCol({ children, className, span = 6, ...props }: DashboardColProps) {
360
+ const spanClasses = {
361
+ 1: "lg:col-span-1",
362
+ 2: "lg:col-span-2",
363
+ 3: "lg:col-span-3",
364
+ 4: "lg:col-span-4",
365
+ 5: "lg:col-span-5",
366
+ 6: "lg:col-span-6",
367
+ 7: "lg:col-span-7",
368
+ 8: "lg:col-span-8",
369
+ 9: "lg:col-span-9",
370
+ 10: "lg:col-span-10",
371
+ 11: "lg:col-span-11",
372
+ 12: "lg:col-span-12",
373
+ }[span]
374
+
375
+ return (
376
+ <div
377
+ data-slot="dashboard-col"
378
+ className={cn("flex flex-col gap-5 sm:gap-6 min-w-0", spanClasses, className)}
379
+ {...props}
380
+ >
381
+ {children}
382
+ </div>
383
+ )
384
+ }
385
+
386
+ /* -------------------------------------------------------------------------- */
387
+ /* Section */
388
+ /* -------------------------------------------------------------------------- */
389
+
390
+ export interface DashboardSectionProps extends React.HTMLAttributes<HTMLDivElement> {
391
+ children?: React.ReactNode
392
+ className?: string
393
+ }
394
+
395
+ export function DashboardSection({ children, className, ...props }: DashboardSectionProps) {
396
+ return (
397
+ <section
398
+ data-slot="dashboard-section"
399
+ className={cn("flex flex-col gap-3.5 w-full", className)}
400
+ {...props}
401
+ >
402
+ {children}
403
+ </section>
404
+ )
405
+ }
406
+
407
+ export interface DashboardSectionHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
408
+ children?: React.ReactNode
409
+ className?: string
410
+ }
411
+
412
+ export function DashboardSectionHeader({
413
+ children,
414
+ className,
415
+ ...props
416
+ }: DashboardSectionHeaderProps) {
417
+ return (
418
+ <div
419
+ data-slot="dashboard-section-header"
420
+ className={cn("flex items-center justify-between gap-3 flex-wrap", className)}
421
+ {...props}
422
+ >
423
+ {children}
424
+ </div>
425
+ )
426
+ }
427
+
428
+ export interface DashboardSectionTitleProps extends React.HTMLAttributes<HTMLHeadingElement> {
429
+ children?: React.ReactNode
430
+ className?: string
431
+ icon?: React.ReactNode
432
+ }
433
+
434
+ export function DashboardSectionTitle({
435
+ children,
436
+ className,
437
+ icon,
438
+ ...props
439
+ }: DashboardSectionTitleProps) {
440
+ return (
441
+ <h2
442
+ data-slot="dashboard-section-title"
443
+ className={cn(
444
+ "text-sm sm:text-base font-medium tracking-tight text-foreground/90 flex items-center gap-2",
445
+ className
446
+ )}
447
+ {...props}
448
+ >
449
+ {icon && <span className="text-muted-foreground shrink-0">{icon}</span>}
450
+ <span>{children}</span>
451
+ </h2>
452
+ )
453
+ }
454
+
455
+ export interface DashboardSectionDescriptionProps
456
+ extends React.HTMLAttributes<HTMLParagraphElement> {
457
+ children?: React.ReactNode
458
+ className?: string
459
+ }
460
+
461
+ export function DashboardSectionDescription({
462
+ children,
463
+ className,
464
+ ...props
465
+ }: DashboardSectionDescriptionProps) {
466
+ return (
467
+ <p
468
+ data-slot="dashboard-section-description"
469
+ className={cn("text-xs text-muted-foreground", className)}
470
+ {...props}
471
+ >
472
+ {children}
473
+ </p>
474
+ )
475
+ }
476
+
477
+ export interface DashboardSectionActionsProps extends React.HTMLAttributes<HTMLDivElement> {
478
+ children?: React.ReactNode
479
+ className?: string
480
+ }
481
+
482
+ export function DashboardSectionActions({
483
+ children,
484
+ className,
485
+ ...props
486
+ }: DashboardSectionActionsProps) {
487
+ return (
488
+ <div
489
+ data-slot="dashboard-section-actions"
490
+ className={cn("flex items-center gap-2 ml-auto shrink-0", className)}
491
+ {...props}
492
+ >
493
+ {children}
494
+ </div>
495
+ )
496
+ }
497
+
498
+ export interface DashboardSectionContentProps extends React.HTMLAttributes<HTMLDivElement> {
499
+ children?: React.ReactNode
500
+ className?: string
501
+ }
502
+
503
+ export function DashboardSectionContent({
504
+ children,
505
+ className,
506
+ ...props
507
+ }: DashboardSectionContentProps) {
508
+ return (
509
+ <div
510
+ data-slot="dashboard-section-content"
511
+ className={cn("flex flex-col gap-3 w-full", className)}
512
+ {...props}
513
+ >
514
+ {children}
515
+ </div>
516
+ )
517
+ }
518
+
519
+ /* -------------------------------------------------------------------------- */
520
+ /* Card */
521
+ /* -------------------------------------------------------------------------- */
522
+
523
+ export interface DashboardCardProps extends React.HTMLAttributes<HTMLDivElement> {
524
+ children?: React.ReactNode
525
+ className?: string
526
+ variant?: "default" | "subtle" | "ghost" | "bordered"
527
+ clickable?: boolean
528
+ }
529
+
530
+ export function DashboardCard({
531
+ children,
532
+ className,
533
+ variant = "default",
534
+ clickable = false,
535
+ ...props
536
+ }: DashboardCardProps) {
537
+ const variantClasses = {
538
+ default: "bg-card/50 dark:bg-card/30 border border-border/40 backdrop-blur-xl shadow-xs",
539
+ subtle: "bg-card/30 dark:bg-muted/15 border border-border/20 backdrop-blur-md",
540
+ ghost: "bg-transparent border-0",
541
+ bordered: "bg-transparent border border-border/50",
542
+ }[variant]
543
+
544
+ return (
545
+ <div
546
+ data-slot="dashboard-card"
547
+ className={cn(
548
+ "relative rounded-2xl p-4 sm:p-5 flex flex-col gap-3.5 transition-all duration-200",
549
+ variantClasses,
550
+ clickable && "cursor-pointer hover:border-border/80 hover:bg-card/60 dark:hover:bg-card/40",
551
+ className
552
+ )}
553
+ {...props}
554
+ >
555
+ {children}
556
+ </div>
557
+ )
558
+ }
559
+
560
+ export interface DashboardCardHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
561
+ children?: React.ReactNode
562
+ className?: string
563
+ }
564
+
565
+ export function DashboardCardHeader({ children, className, ...props }: DashboardCardHeaderProps) {
566
+ return (
567
+ <div
568
+ data-slot="dashboard-card-header"
569
+ className={cn("flex items-center justify-between gap-2 flex-wrap", className)}
570
+ {...props}
571
+ >
572
+ {children}
573
+ </div>
574
+ )
575
+ }
576
+
577
+ export interface DashboardCardTitleProps extends React.HTMLAttributes<HTMLHeadingElement> {
578
+ children?: React.ReactNode
579
+ className?: string
580
+ }
581
+
582
+ export function DashboardCardTitle({ children, className, ...props }: DashboardCardTitleProps) {
583
+ return (
584
+ <h3
585
+ data-slot="dashboard-card-title"
586
+ className={cn("text-sm sm:text-base font-medium text-foreground tracking-tight", className)}
587
+ {...props}
588
+ >
589
+ {children}
590
+ </h3>
591
+ )
592
+ }
593
+
594
+ export interface DashboardCardDescriptionProps extends React.HTMLAttributes<HTMLParagraphElement> {
595
+ children?: React.ReactNode
596
+ className?: string
597
+ }
598
+
599
+ export function DashboardCardDescription({
600
+ children,
601
+ className,
602
+ ...props
603
+ }: DashboardCardDescriptionProps) {
604
+ return (
605
+ <p
606
+ data-slot="dashboard-card-description"
607
+ className={cn("text-xs text-muted-foreground", className)}
608
+ {...props}
609
+ >
610
+ {children}
611
+ </p>
612
+ )
613
+ }
614
+
615
+ export interface DashboardCardContentProps extends React.HTMLAttributes<HTMLDivElement> {
616
+ children?: React.ReactNode
617
+ className?: string
618
+ }
619
+
620
+ export function DashboardCardContent({
621
+ children,
622
+ className,
623
+ ...props
624
+ }: DashboardCardContentProps) {
625
+ return (
626
+ <div
627
+ data-slot="dashboard-card-content"
628
+ className={cn("flex flex-col gap-2.5 w-full", className)}
629
+ {...props}
630
+ >
631
+ {children}
632
+ </div>
633
+ )
634
+ }
635
+
636
+ export interface DashboardCardFooterProps extends React.HTMLAttributes<HTMLDivElement> {
637
+ children?: React.ReactNode
638
+ className?: string
639
+ }
640
+
641
+ export function DashboardCardFooter({
642
+ children,
643
+ className,
644
+ ...props
645
+ }: DashboardCardFooterProps) {
646
+ return (
647
+ <div
648
+ data-slot="dashboard-card-footer"
649
+ className={cn("flex items-center justify-between gap-2 pt-2 border-t border-border/20 text-xs text-muted-foreground", className)}
650
+ {...props}
651
+ >
652
+ {children}
653
+ </div>
654
+ )
655
+ }
656
+
657
+ /* -------------------------------------------------------------------------- */
658
+ /* Stat Grid & Item / Budget Cards */
659
+ /* -------------------------------------------------------------------------- */
660
+
661
+ export interface DashboardStatGridProps extends React.HTMLAttributes<HTMLDivElement> {
662
+ children?: React.ReactNode
663
+ className?: string
664
+ cols?: 1 | 2 | 3 | 4
665
+ }
666
+
667
+ export function DashboardStatGrid({
668
+ children,
669
+ className,
670
+ cols = 2,
671
+ ...props
672
+ }: DashboardStatGridProps) {
673
+ const colClasses = {
674
+ 1: "grid-cols-1",
675
+ 2: "grid-cols-1 sm:grid-cols-2",
676
+ 3: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3",
677
+ 4: "grid-cols-1 sm:grid-cols-2 md:grid-cols-4",
678
+ }[cols]
679
+
680
+ return (
681
+ <div
682
+ data-slot="dashboard-stat-grid"
683
+ className={cn("grid gap-3 w-full", colClasses, className)}
684
+ {...props}
685
+ >
686
+ {children}
687
+ </div>
688
+ )
689
+ }
690
+
691
+ export interface DashboardItemCardProps
692
+ extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
693
+ title: React.ReactNode
694
+ amount?: React.ReactNode
695
+ subtitle?: React.ReactNode
696
+ badge?: React.ReactNode
697
+ badgeVariant?: "default" | "success" | "warning" | "destructive" | "info"
698
+ icon?: React.ReactNode
699
+ actionIcon?: React.ReactNode
700
+ clickable?: boolean
701
+ onClick?: () => void
702
+ children?: React.ReactNode
703
+ className?: string
704
+ }
705
+
706
+ export function DashboardItemCard({
707
+ title,
708
+ amount,
709
+ subtitle,
710
+ badge,
711
+ badgeVariant = "default",
712
+ icon,
713
+ actionIcon,
714
+ clickable = false,
715
+ onClick,
716
+ children,
717
+ className,
718
+ ...props
719
+ }: DashboardItemCardProps) {
720
+ const isClickable = clickable || !!onClick
721
+
722
+ const badgeVariantClasses = {
723
+ default: "bg-secondary text-secondary-foreground border-border/30",
724
+ success: "bg-emerald-500/15 text-emerald-400 border-emerald-500/30",
725
+ warning: "bg-amber-500/15 text-amber-400 border-amber-500/30",
726
+ destructive: "bg-rose-500/15 text-rose-400 border-rose-500/30",
727
+ info: "bg-sky-500/15 text-sky-400 border-sky-500/30",
728
+ }[badgeVariant]
729
+
730
+ return (
731
+ <div
732
+ data-slot="dashboard-item-card"
733
+ onClick={onClick}
734
+ className={cn(
735
+ "group relative flex flex-col justify-between gap-3 p-3.5 sm:p-4 rounded-xl transition-all duration-200",
736
+ "bg-card/45 dark:bg-card/25 border border-border/30 hover:border-border/60 backdrop-blur-md shadow-xs",
737
+ isClickable && "cursor-pointer hover:bg-card/70 dark:hover:bg-card/40",
738
+ className
739
+ )}
740
+ {...props}
741
+ >
742
+ <div className="flex items-center justify-between gap-2">
743
+ <div className="flex items-center gap-2 min-w-0">
744
+ {icon && <span className="text-muted-foreground shrink-0">{icon}</span>}
745
+ <span className="text-xs sm:text-sm font-medium text-foreground truncate">{title}</span>
746
+ </div>
747
+ {actionIcon && (
748
+ <span className="text-muted-foreground/60 group-hover:text-foreground transition-colors shrink-0">
749
+ {actionIcon}
750
+ </span>
751
+ )}
752
+ </div>
753
+
754
+ {(amount || subtitle || badge || children) && (
755
+ <div className="flex items-center justify-between gap-2 flex-wrap pt-0.5">
756
+ <div className="flex flex-col min-w-0">
757
+ {amount && (
758
+ <span className="text-xs font-semibold text-foreground/90 tracking-tight truncate">
759
+ {amount}
760
+ </span>
761
+ )}
762
+ {subtitle && (
763
+ <span className="text-[11px] text-muted-foreground truncate">{subtitle}</span>
764
+ )}
765
+ </div>
766
+
767
+ {badge && (
768
+ <span
769
+ className={cn(
770
+ "inline-flex items-center px-2 py-0.5 rounded-full text-[10px] font-medium border shrink-0",
771
+ badgeVariantClasses
772
+ )}
773
+ >
774
+ {badge}
775
+ </span>
776
+ )}
777
+
778
+ {children}
779
+ </div>
780
+ )}
781
+ </div>
782
+ )
783
+ }
784
+
785
+ /* -------------------------------------------------------------------------- */
786
+ /* Action Pill */
787
+ /* -------------------------------------------------------------------------- */
788
+
789
+ export interface DashboardActionPillProps
790
+ extends React.ButtonHTMLAttributes<HTMLButtonElement> {
791
+ icon?: React.ReactNode
792
+ label?: React.ReactNode
793
+ children?: React.ReactNode
794
+ variant?: "default" | "primary" | "secondary" | "outline" | "ghost"
795
+ size?: "sm" | "md"
796
+ }
797
+
798
+ export function DashboardActionPill({
799
+ icon,
800
+ label,
801
+ children,
802
+ variant = "default",
803
+ size = "md",
804
+ className,
805
+ ...props
806
+ }: DashboardActionPillProps) {
807
+ const variantClasses = {
808
+ default:
809
+ "bg-card/60 dark:bg-card/40 text-foreground border border-border/40 hover:bg-card/90 dark:hover:bg-card/60",
810
+ primary:
811
+ "bg-primary/15 text-primary border border-primary/30 hover:bg-primary/25",
812
+ secondary:
813
+ "bg-secondary/60 text-secondary-foreground border border-border/30 hover:bg-secondary/90",
814
+ outline:
815
+ "bg-transparent border border-border/50 text-foreground hover:bg-card/40",
816
+ ghost:
817
+ "bg-transparent border-0 text-muted-foreground hover:text-foreground hover:bg-card/30",
818
+ }[variant]
819
+
820
+ const sizeClasses = {
821
+ sm: "h-7 px-2.5 text-[11px] gap-1.5 rounded-full",
822
+ md: "h-8 px-3.5 text-xs gap-2 rounded-full",
823
+ }[size]
824
+
825
+ return (
826
+ <button
827
+ type="button"
828
+ data-slot="dashboard-action-pill"
829
+ className={cn(
830
+ "inline-flex items-center justify-center font-medium transition-all duration-150 backdrop-blur-md cursor-pointer select-none",
831
+ sizeClasses,
832
+ variantClasses,
833
+ className
834
+ )}
835
+ {...props}
836
+ >
837
+ {icon && <span className="shrink-0">{icon}</span>}
838
+ {label && <span>{label}</span>}
839
+ {children}
840
+ </button>
841
+ )
842
+ }
843
+
844
+ /* -------------------------------------------------------------------------- */
845
+ /* Data Table */
846
+ /* -------------------------------------------------------------------------- */
847
+
848
+ export interface DashboardTableProps extends React.HTMLAttributes<HTMLTableElement> {
849
+ children?: React.ReactNode
850
+ className?: string
851
+ }
852
+
853
+ export function DashboardTable({ children, className, ...props }: DashboardTableProps) {
854
+ return (
855
+ <div className="w-full overflow-x-auto rounded-xl border border-border/30 bg-card/40 dark:bg-card/20 backdrop-blur-md">
856
+ <table
857
+ data-slot="dashboard-table"
858
+ className={cn("w-full text-left text-xs sm:text-sm border-collapse", className)}
859
+ {...props}
860
+ >
861
+ {children}
862
+ </table>
863
+ </div>
864
+ )
865
+ }
866
+
867
+ export interface DashboardTableHeaderProps
868
+ extends React.HTMLAttributes<HTMLTableSectionElement> {
869
+ children?: React.ReactNode
870
+ className?: string
871
+ }
872
+
873
+ export function DashboardTableHeader({
874
+ children,
875
+ className,
876
+ ...props
877
+ }: DashboardTableHeaderProps) {
878
+ return (
879
+ <thead
880
+ data-slot="dashboard-table-header"
881
+ className={cn("border-b border-border/30 bg-muted/20 text-muted-foreground text-[11px] uppercase tracking-wider font-medium", className)}
882
+ {...props}
883
+ >
884
+ {children}
885
+ </thead>
886
+ )
887
+ }
888
+
889
+ export interface DashboardTableBodyProps
890
+ extends React.HTMLAttributes<HTMLTableSectionElement> {
891
+ children?: React.ReactNode
892
+ className?: string
893
+ }
894
+
895
+ export function DashboardTableBody({ children, className, ...props }: DashboardTableBodyProps) {
896
+ return (
897
+ <tbody
898
+ data-slot="dashboard-table-body"
899
+ className={cn("divide-y divide-border/20 text-foreground/90", className)}
900
+ {...props}
901
+ >
902
+ {children}
903
+ </tbody>
904
+ )
905
+ }
906
+
907
+ export interface DashboardTableRowProps extends React.HTMLAttributes<HTMLTableRowElement> {
908
+ children?: React.ReactNode
909
+ className?: string
910
+ clickable?: boolean
911
+ }
912
+
913
+ export function DashboardTableRow({
914
+ children,
915
+ className,
916
+ clickable = false,
917
+ ...props
918
+ }: DashboardTableRowProps) {
919
+ return (
920
+ <tr
921
+ data-slot="dashboard-table-row"
922
+ className={cn(
923
+ "transition-colors duration-150",
924
+ clickable && "cursor-pointer hover:bg-card/50 dark:hover:bg-card/30",
925
+ className
926
+ )}
927
+ {...props}
928
+ >
929
+ {children}
930
+ </tr>
931
+ )
932
+ }
933
+
934
+ export interface DashboardTableHeadProps
935
+ extends React.ThHTMLAttributes<HTMLTableCellElement> {
936
+ children?: React.ReactNode
937
+ className?: string
938
+ }
939
+
940
+ export function DashboardTableHead({ children, className, ...props }: DashboardTableHeadProps) {
941
+ return (
942
+ <th
943
+ data-slot="dashboard-table-head"
944
+ className={cn("px-3.5 py-2.5 font-medium", className)}
945
+ {...props}
946
+ >
947
+ {children}
948
+ </th>
949
+ )
950
+ }
951
+
952
+ export interface DashboardTableCellProps
953
+ extends React.TdHTMLAttributes<HTMLTableCellElement> {
954
+ children?: React.ReactNode
955
+ className?: string
956
+ }
957
+
958
+ export function DashboardTableCell({ children, className, ...props }: DashboardTableCellProps) {
959
+ return (
960
+ <td
961
+ data-slot="dashboard-table-cell"
962
+ className={cn("px-3.5 py-2.5 whitespace-nowrap", className)}
963
+ {...props}
964
+ >
965
+ {children}
966
+ </td>
967
+ )
968
+ }
969
+
970
+ /* -------------------------------------------------------------------------- */
971
+ /* Bottom Bar */
972
+ /* -------------------------------------------------------------------------- */
973
+
974
+ export interface DashboardBottomBarProps
975
+ extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
976
+ icon?: React.ReactNode
977
+ title?: React.ReactNode
978
+ description?: React.ReactNode
979
+ action?: React.ReactNode
980
+ children?: React.ReactNode
981
+ className?: string
982
+ onClick?: () => void
983
+ }
984
+
985
+ export function DashboardBottomBar({
986
+ icon,
987
+ title,
988
+ description,
989
+ action,
990
+ children,
991
+ className,
992
+ onClick,
993
+ ...props
994
+ }: DashboardBottomBarProps) {
995
+ const isClickable = !!onClick
996
+
997
+ return (
998
+ <div
999
+ data-slot="dashboard-bottom-bar"
1000
+ onClick={onClick}
1001
+ className={cn(
1002
+ "flex items-center justify-between gap-3 p-3.5 sm:p-4 rounded-xl",
1003
+ "bg-card/50 dark:bg-card/30 border border-border/40 backdrop-blur-xl shadow-xs transition-all duration-200",
1004
+ isClickable && "cursor-pointer hover:bg-card/70 dark:hover:bg-card/50 hover:border-border/70",
1005
+ className
1006
+ )}
1007
+ {...props}
1008
+ >
1009
+ <div className="flex items-center gap-3 min-w-0">
1010
+ {icon && (
1011
+ <div className="shrink-0 w-7 h-7 rounded-lg bg-primary/15 text-primary flex items-center justify-center text-xs">
1012
+ {icon}
1013
+ </div>
1014
+ )}
1015
+ <div className="flex flex-col min-w-0">
1016
+ {title && <span className="text-xs sm:text-sm font-medium text-foreground truncate">{title}</span>}
1017
+ {description && <span className="text-[11px] text-muted-foreground truncate">{description}</span>}
1018
+ </div>
1019
+ {children}
1020
+ </div>
1021
+
1022
+ {action && <div className="shrink-0 ml-auto">{action}</div>}
1023
+ </div>
1024
+ )
1025
+ }
1026
+
1027
+ /* -------------------------------------------------------------------------- */
1028
+ /* Compound Export Object */
1029
+ /* -------------------------------------------------------------------------- */
1030
+
1031
+ export const DashboardLayout = Object.assign(DashboardLayoutRoot, {
1032
+ Header: DashboardHeader,
1033
+ HeaderTop: DashboardHeaderTop,
1034
+ HeaderStart: DashboardHeaderStart,
1035
+ Icon: DashboardIcon,
1036
+ Title: DashboardTitle,
1037
+ Description: DashboardDescription,
1038
+ Subtitle: DashboardDescription,
1039
+ Actions: DashboardActions,
1040
+ Metrics: DashboardMetrics,
1041
+ MetricCard: DashboardMetricCard,
1042
+ Metric: DashboardMetricCard,
1043
+ StatTabs: DashboardMetrics,
1044
+ StatTab: DashboardMetricCard,
1045
+ Body: DashboardBody,
1046
+ Content: DashboardBody,
1047
+ Grid: DashboardGrid,
1048
+ Col: DashboardCol,
1049
+ Column: DashboardCol,
1050
+ Section: DashboardSection,
1051
+ SectionHeader: DashboardSectionHeader,
1052
+ SectionTitle: DashboardSectionTitle,
1053
+ SectionDescription: DashboardSectionDescription,
1054
+ SectionSubtitle: DashboardSectionDescription,
1055
+ SectionActions: DashboardSectionActions,
1056
+ SectionContent: DashboardSectionContent,
1057
+ SectionBody: DashboardSectionContent,
1058
+ Card: DashboardCard,
1059
+ CardHeader: DashboardCardHeader,
1060
+ CardTitle: DashboardCardTitle,
1061
+ CardDescription: DashboardCardDescription,
1062
+ CardContent: DashboardCardContent,
1063
+ CardFooter: DashboardCardFooter,
1064
+ StatGrid: DashboardStatGrid,
1065
+ BudgetGrid: DashboardStatGrid,
1066
+ ItemCard: DashboardItemCard,
1067
+ BudgetCard: DashboardItemCard,
1068
+ ActionPill: DashboardActionPill,
1069
+ Pill: DashboardActionPill,
1070
+ Table: DashboardTable,
1071
+ TableHeader: DashboardTableHeader,
1072
+ TableBody: DashboardTableBody,
1073
+ TableRow: DashboardTableRow,
1074
+ TableHead: DashboardTableHead,
1075
+ TableCell: DashboardTableCell,
1076
+ BottomBar: DashboardBottomBar,
1077
+ FooterBar: DashboardBottomBar,
1078
+ })
1079
+
1080
+ export default DashboardLayout