@elevasis/ui 1.3.1 → 1.3.3

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 (272) hide show
  1. package/dist/api/index.js +1 -1
  2. package/dist/auth/guards/AdminGuard.d.ts +32 -0
  3. package/dist/auth/guards/AdminGuard.d.ts.map +1 -0
  4. package/dist/auth/guards/ProtectedRoute.d.ts +60 -0
  5. package/dist/auth/guards/ProtectedRoute.d.ts.map +1 -0
  6. package/dist/auth/guards/__tests__/AdminGuard.test.d.ts +12 -0
  7. package/dist/auth/guards/__tests__/AdminGuard.test.d.ts.map +1 -0
  8. package/dist/auth/guards/__tests__/ProtectedRoute.test.d.ts +14 -0
  9. package/dist/auth/guards/__tests__/ProtectedRoute.test.d.ts.map +1 -0
  10. package/dist/auth/index.d.ts +14 -174
  11. package/dist/auth/index.d.ts.map +1 -0
  12. package/dist/auth/index.js +1 -1
  13. package/dist/{chunk-A3MCANC6.js → chunk-6IX5JZEH.js} +110 -50
  14. package/dist/chunk-GIFAF5ZS.js +313 -0
  15. package/dist/chunk-JQLT6HBI.js +850 -0
  16. package/dist/chunk-LFYO3MDC.js +58 -0
  17. package/dist/{chunk-72HOBFMP.js → chunk-LTQAAIGE.js} +3 -3
  18. package/dist/{chunk-JBFFCZI4.js → chunk-U34YGJQB.js} +1 -93
  19. package/dist/components/index.d.ts +1 -1353
  20. package/dist/components/index.js +1 -20
  21. package/dist/components/navigation/index.d.ts +2 -32
  22. package/dist/components/navigation/index.js +1 -29
  23. package/dist/execution/index.d.ts +63 -231
  24. package/dist/execution/index.js +1 -4
  25. package/dist/graph/index.css +0 -1
  26. package/dist/graph/index.d.ts +4 -203
  27. package/dist/graph/index.js +1 -1
  28. package/dist/hooks/command-queue/index.d.ts +7 -0
  29. package/dist/hooks/command-queue/index.d.ts.map +1 -0
  30. package/dist/hooks/command-queue/useCommandQueue.d.ts +33 -0
  31. package/dist/hooks/command-queue/useCommandQueue.d.ts.map +1 -0
  32. package/dist/hooks/command-queue/useCommandQueueTotals.d.ts +17 -0
  33. package/dist/hooks/command-queue/useCommandQueueTotals.d.ts.map +1 -0
  34. package/dist/hooks/command-queue/useDeleteTask.d.ts +5 -0
  35. package/dist/hooks/command-queue/useDeleteTask.d.ts.map +1 -0
  36. package/dist/hooks/command-queue/usePatchTask.d.ts +6 -0
  37. package/dist/hooks/command-queue/usePatchTask.d.ts.map +1 -0
  38. package/dist/hooks/command-queue/useSubmitAction.d.ts +29 -0
  39. package/dist/hooks/command-queue/useSubmitAction.d.ts.map +1 -0
  40. package/dist/hooks/executions/index.d.ts +16 -0
  41. package/dist/hooks/executions/index.d.ts.map +1 -0
  42. package/dist/hooks/executions/useBulkDeleteExecutions.d.ts +15 -0
  43. package/dist/hooks/executions/useBulkDeleteExecutions.d.ts.map +1 -0
  44. package/dist/hooks/executions/useCancelExecution.d.ts +20 -0
  45. package/dist/hooks/executions/useCancelExecution.d.ts.map +1 -0
  46. package/dist/hooks/executions/useDeleteExecution.d.ts +13 -0
  47. package/dist/hooks/executions/useDeleteExecution.d.ts.map +1 -0
  48. package/dist/hooks/executions/useExecuteAsync.d.ts +21 -0
  49. package/dist/hooks/executions/useExecuteAsync.d.ts.map +1 -0
  50. package/dist/hooks/executions/useExecution.d.ts +10 -0
  51. package/dist/hooks/executions/useExecution.d.ts.map +1 -0
  52. package/dist/hooks/executions/useExecutions.d.ts +16 -0
  53. package/dist/hooks/executions/useExecutions.d.ts.map +1 -0
  54. package/dist/hooks/executions/useResourceDefinition.d.ts +9 -0
  55. package/dist/hooks/executions/useResourceDefinition.d.ts.map +1 -0
  56. package/dist/hooks/executions/useResources.d.ts +15 -0
  57. package/dist/hooks/executions/useResources.d.ts.map +1 -0
  58. package/dist/hooks/executions/useRetryExecution.d.ts +16 -0
  59. package/dist/hooks/executions/useRetryExecution.d.ts.map +1 -0
  60. package/dist/hooks/feature-access/createUseFeatureAccess.d.ts +44 -0
  61. package/dist/hooks/feature-access/createUseFeatureAccess.d.ts.map +1 -0
  62. package/dist/hooks/feature-access/index.d.ts +2 -0
  63. package/dist/hooks/feature-access/index.d.ts.map +1 -0
  64. package/dist/hooks/index.d.ts +11 -4554
  65. package/dist/hooks/index.d.ts.map +1 -0
  66. package/dist/hooks/index.js +2 -4
  67. package/dist/hooks/monitoring/index.d.ts +9 -0
  68. package/dist/hooks/monitoring/index.d.ts.map +1 -0
  69. package/dist/hooks/monitoring/useActivities.d.ts +52 -0
  70. package/dist/hooks/monitoring/useActivities.d.ts.map +1 -0
  71. package/dist/hooks/monitoring/useCostSummary.d.ts +7 -0
  72. package/dist/hooks/monitoring/useCostSummary.d.ts.map +1 -0
  73. package/dist/hooks/monitoring/useExecutionHealth.d.ts +10 -0
  74. package/dist/hooks/monitoring/useExecutionHealth.d.ts.map +1 -0
  75. package/dist/hooks/monitoring/useExecutionLogs.d.ts +56 -0
  76. package/dist/hooks/monitoring/useExecutionLogs.d.ts.map +1 -0
  77. package/dist/hooks/monitoring/useNotifications.d.ts +11 -0
  78. package/dist/hooks/monitoring/useNotifications.d.ts.map +1 -0
  79. package/dist/hooks/notifications/index.d.ts +8 -0
  80. package/dist/hooks/notifications/index.d.ts.map +1 -0
  81. package/dist/hooks/notifications/useMarkAllAsRead.d.ts +2 -0
  82. package/dist/hooks/notifications/useMarkAllAsRead.d.ts.map +1 -0
  83. package/dist/hooks/notifications/useMarkAsRead.d.ts +2 -0
  84. package/dist/hooks/notifications/useMarkAsRead.d.ts.map +1 -0
  85. package/dist/hooks/notifications/useNotificationCount.d.ts +8 -0
  86. package/dist/hooks/notifications/useNotificationCount.d.ts.map +1 -0
  87. package/dist/hooks/observability/index.d.ts +19 -0
  88. package/dist/hooks/observability/index.d.ts.map +1 -0
  89. package/dist/hooks/observability/useBusinessImpact.d.ts +9 -0
  90. package/dist/hooks/observability/useBusinessImpact.d.ts.map +1 -0
  91. package/dist/hooks/observability/useCostBreakdown.d.ts +10 -0
  92. package/dist/hooks/observability/useCostBreakdown.d.ts.map +1 -0
  93. package/dist/hooks/observability/useCostByModel.d.ts +3 -0
  94. package/dist/hooks/observability/useCostByModel.d.ts.map +1 -0
  95. package/dist/hooks/observability/useCostTrends.d.ts +3 -0
  96. package/dist/hooks/observability/useCostTrends.d.ts.map +1 -0
  97. package/dist/hooks/observability/useDashboardMetrics.d.ts +3 -0
  98. package/dist/hooks/observability/useDashboardMetrics.d.ts.map +1 -0
  99. package/dist/hooks/observability/useErrorAnalysis.d.ts +7 -0
  100. package/dist/hooks/observability/useErrorAnalysis.d.ts.map +1 -0
  101. package/dist/hooks/observability/useErrorDetails.d.ts +20 -0
  102. package/dist/hooks/observability/useErrorDetails.d.ts.map +1 -0
  103. package/dist/hooks/observability/useErrorDistribution.d.ts +12 -0
  104. package/dist/hooks/observability/useErrorDistribution.d.ts.map +1 -0
  105. package/dist/hooks/observability/useErrorTrends.d.ts +12 -0
  106. package/dist/hooks/observability/useErrorTrends.d.ts.map +1 -0
  107. package/dist/hooks/observability/useResolveError.d.ts +17 -0
  108. package/dist/hooks/observability/useResolveError.d.ts.map +1 -0
  109. package/dist/hooks/observability/useTopFailingResources.d.ts +13 -0
  110. package/dist/hooks/observability/useTopFailingResources.d.ts.map +1 -0
  111. package/dist/hooks/published.d.ts +19 -4279
  112. package/dist/hooks/published.d.ts.map +1 -0
  113. package/dist/hooks/published.js +367 -4
  114. package/dist/hooks/scheduling/index.d.ts +5 -0
  115. package/dist/hooks/scheduling/index.d.ts.map +1 -0
  116. package/dist/hooks/scheduling/useSchedules.d.ts +185 -0
  117. package/dist/hooks/scheduling/useSchedules.d.ts.map +1 -0
  118. package/dist/hooks/sessions/index.d.ts +8 -0
  119. package/dist/hooks/sessions/index.d.ts.map +1 -0
  120. package/dist/hooks/sessions/useSessionExecutions.d.ts +13 -0
  121. package/dist/hooks/sessions/useSessionExecutions.d.ts.map +1 -0
  122. package/dist/hooks/sessions/useSessionMessages.d.ts +7 -0
  123. package/dist/hooks/sessions/useSessionMessages.d.ts.map +1 -0
  124. package/dist/hooks/sessions/useSessions.d.ts +26 -0
  125. package/dist/hooks/sessions/useSessions.d.ts.map +1 -0
  126. package/dist/index.css +0 -118
  127. package/dist/index.d.ts +15 -7889
  128. package/dist/index.d.ts.map +1 -0
  129. package/dist/index.js +1119 -24
  130. package/dist/initialization/InitializationProvider.d.ts +48 -0
  131. package/dist/initialization/InitializationProvider.d.ts.map +1 -0
  132. package/dist/initialization/hooks/useAppInitialization.d.ts +32 -0
  133. package/dist/initialization/hooks/useAppInitialization.d.ts.map +1 -0
  134. package/dist/initialization/index.d.ts +22 -2361
  135. package/dist/initialization/index.d.ts.map +1 -0
  136. package/dist/initialization/index.js +1 -1
  137. package/dist/organization/context/OrganizationProvider.d.ts +20 -0
  138. package/dist/organization/context/OrganizationProvider.d.ts.map +1 -0
  139. package/dist/organization/hooks/useOrgInitialization.d.ts +56 -0
  140. package/dist/organization/hooks/useOrgInitialization.d.ts.map +1 -0
  141. package/dist/organization/index.d.ts +21 -283
  142. package/dist/organization/index.d.ts.map +1 -0
  143. package/dist/organization/index.js +3 -3
  144. package/dist/profile/context/ProfileProvider.d.ts +27 -0
  145. package/dist/profile/context/ProfileProvider.d.ts.map +1 -0
  146. package/dist/profile/hooks/useUserProfile.d.ts +31 -0
  147. package/dist/profile/hooks/useUserProfile.d.ts.map +1 -0
  148. package/dist/profile/index.d.ts +14 -2290
  149. package/dist/profile/index.d.ts.map +1 -0
  150. package/dist/provider/CoreAuthKitInner.d.ts +12 -0
  151. package/dist/provider/CoreAuthKitInner.d.ts.map +1 -0
  152. package/dist/provider/ElevasisCoreProvider.d.ts +39 -0
  153. package/dist/provider/ElevasisCoreProvider.d.ts.map +1 -0
  154. package/dist/provider/ElevasisServiceContext.d.ts +31 -0
  155. package/dist/provider/ElevasisServiceContext.d.ts.map +1 -0
  156. package/dist/provider/__tests__/CoreAuthKitInner.test.d.ts +2 -0
  157. package/dist/provider/__tests__/CoreAuthKitInner.test.d.ts.map +1 -0
  158. package/dist/provider/__tests__/ElevasisCoreProvider.test.d.ts +2 -0
  159. package/dist/provider/__tests__/ElevasisCoreProvider.test.d.ts.map +1 -0
  160. package/dist/provider/index.d.ts +7 -372
  161. package/dist/provider/index.d.ts.map +1 -0
  162. package/dist/provider/index.js +3 -12
  163. package/dist/provider/published.d.ts +9 -263
  164. package/dist/provider/published.d.ts.map +1 -0
  165. package/dist/provider/published.js +5 -5
  166. package/dist/provider/types.d.ts +143 -0
  167. package/dist/provider/types.d.ts.map +1 -0
  168. package/dist/provider/types.js +1 -0
  169. package/dist/sdk-barrel.d.ts +20 -0
  170. package/dist/sdk-barrel.d.ts.map +1 -0
  171. package/dist/supabase/index.d.ts +0 -255
  172. package/dist/theme/cssVariables.d.ts +12 -0
  173. package/dist/theme/cssVariables.d.ts.map +1 -0
  174. package/dist/theme/cssVariables.js +93 -0
  175. package/dist/theme/index.d.ts +4 -0
  176. package/dist/theme/index.d.ts.map +1 -0
  177. package/dist/theme/index.js +1 -0
  178. package/dist/theme/presets/__tests__/getPreset.test.d.ts +2 -0
  179. package/dist/theme/presets/__tests__/getPreset.test.d.ts.map +1 -0
  180. package/dist/theme/presets/abyss.d.ts +3 -0
  181. package/dist/theme/presets/abyss.d.ts.map +1 -0
  182. package/dist/theme/presets/abyss.js +54 -0
  183. package/dist/theme/presets/aurora.d.ts +8 -0
  184. package/dist/theme/presets/aurora.d.ts.map +1 -0
  185. package/dist/theme/presets/aurora.js +59 -0
  186. package/dist/theme/presets/canopy.d.ts +3 -0
  187. package/dist/theme/presets/canopy.d.ts.map +1 -0
  188. package/dist/theme/presets/canopy.js +58 -0
  189. package/dist/theme/presets/cyber-flux.d.ts +8 -0
  190. package/dist/theme/presets/cyber-flux.d.ts.map +1 -0
  191. package/dist/theme/presets/cyber-flux.js +66 -0
  192. package/dist/theme/presets/cyber-strike.d.ts +9 -0
  193. package/dist/theme/presets/cyber-strike.d.ts.map +1 -0
  194. package/dist/theme/presets/cyber-strike.js +62 -0
  195. package/dist/theme/presets/cyber-void.d.ts +8 -0
  196. package/dist/theme/presets/cyber-void.d.ts.map +1 -0
  197. package/dist/theme/presets/cyber-void.js +62 -0
  198. package/dist/theme/presets/cyber-volt.d.ts +8 -0
  199. package/dist/theme/presets/cyber-volt.d.ts.map +1 -0
  200. package/dist/theme/presets/cyber-volt.js +66 -0
  201. package/dist/theme/presets/default.d.ts +4 -0
  202. package/dist/theme/presets/default.d.ts.map +1 -0
  203. package/dist/theme/presets/ember.d.ts +8 -0
  204. package/dist/theme/presets/ember.d.ts.map +1 -0
  205. package/dist/theme/presets/ember.js +63 -0
  206. package/dist/theme/presets/honey.d.ts +3 -0
  207. package/dist/theme/presets/honey.d.ts.map +1 -0
  208. package/dist/theme/presets/honey.js +62 -0
  209. package/dist/theme/presets/index.d.ts +6 -0
  210. package/dist/theme/presets/index.d.ts.map +1 -0
  211. package/dist/theme/presets/index.js +39 -0
  212. package/dist/theme/presets/midnight.d.ts +8 -0
  213. package/dist/theme/presets/midnight.d.ts.map +1 -0
  214. package/dist/theme/presets/midnight.js +68 -0
  215. package/dist/theme/presets/obsidian.d.ts +3 -0
  216. package/dist/theme/presets/obsidian.d.ts.map +1 -0
  217. package/dist/theme/presets/obsidian.js +56 -0
  218. package/dist/theme/presets/regal.d.ts +8 -0
  219. package/dist/theme/presets/regal.d.ts.map +1 -0
  220. package/dist/theme/presets/regal.js +63 -0
  221. package/dist/theme/presets/rose-gold.d.ts +8 -0
  222. package/dist/theme/presets/rose-gold.d.ts.map +1 -0
  223. package/dist/theme/presets/rose-gold.js +63 -0
  224. package/dist/theme/presets/slate.d.ts +3 -0
  225. package/dist/theme/presets/slate.d.ts.map +1 -0
  226. package/dist/theme/presets/slate.js +56 -0
  227. package/dist/theme/presets/tactical.d.ts +8 -0
  228. package/dist/theme/presets/tactical.d.ts.map +1 -0
  229. package/dist/theme/presets/tactical.js +57 -0
  230. package/dist/theme/presets/types.d.ts +26 -0
  231. package/dist/theme/presets/types.d.ts.map +1 -0
  232. package/dist/theme/presets/types.js +1 -0
  233. package/dist/utils/index.d.ts +1 -22
  234. package/dist/utils/index.js +1 -1
  235. package/package.json +4 -52
  236. package/dist/chunk-3KMDHCAR.js +0 -52
  237. package/dist/chunk-6BJOYF6E.js +0 -8
  238. package/dist/chunk-BLO4SISK.js +0 -113
  239. package/dist/chunk-HUWJXLLF.js +0 -681
  240. package/dist/chunk-JVAZHVNV.js +0 -110
  241. package/dist/chunk-JYSYHVLU.js +0 -379
  242. package/dist/chunk-NE36BUGQ.js +0 -146
  243. package/dist/chunk-O3PY6B6E.js +0 -749
  244. package/dist/chunk-OXVOHOP3.js +0 -661
  245. package/dist/chunk-PSLKGOBZ.js +0 -58
  246. package/dist/chunk-RJCA5672.js +0 -1664
  247. package/dist/chunk-TMFCNFLW.js +0 -107
  248. package/dist/chunk-TN3PU2WK.js +0 -748
  249. package/dist/chunk-TZPAA4RC.js +0 -1461
  250. package/dist/chunk-W7ZBF5AA.js +0 -1
  251. package/dist/chunk-YZ6GTZXL.js +0 -48
  252. package/dist/components/command-queue/index.css +0 -53
  253. package/dist/components/command-queue/index.d.ts +0 -204
  254. package/dist/components/command-queue/index.js +0 -12
  255. package/dist/components/forms/index.d.ts +0 -56
  256. package/dist/components/forms/index.js +0 -2
  257. package/dist/components/index.css +0 -443
  258. package/dist/components/monitoring/index.d.ts +0 -66
  259. package/dist/components/monitoring/index.js +0 -2
  260. package/dist/components/notifications/index.d.ts +0 -52
  261. package/dist/components/notifications/index.js +0 -5
  262. package/dist/components/resource-definition/index.css +0 -388
  263. package/dist/components/resource-definition/index.d.ts +0 -301
  264. package/dist/components/resource-definition/index.js +0 -3
  265. package/dist/display/index.css +0 -53
  266. package/dist/display/index.d.ts +0 -606
  267. package/dist/display/index.js +0 -7
  268. package/dist/execution/index.css +0 -388
  269. package/dist/provider/index.css +0 -61
  270. package/dist/{chunk-TYV5NJV2.js → chunk-BUZONXAW.js} +0 -0
  271. package/dist/{chunk-UMXDDEAG.js → chunk-SFF5MJEI.js} +1 -1
  272. /package/dist/{chunk-NXHL23JW.js → chunk-XXDDMASA.js} +0 -0
@@ -0,0 +1,8 @@
1
+ import type { ThemePreset } from './types';
2
+ /**
3
+ * Regal preset — luxurious, commanding, distinguished.
4
+ * Design: deep black base, rich gold accent, elegant serif headings.
5
+ * Evokes: royal courts, gilt architecture, fine craftsmanship.
6
+ */
7
+ export declare const regalPreset: ThemePreset;
8
+ //# sourceMappingURL=regal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regal.d.ts","sourceRoot":"","sources":["../../../src/theme/presets/regal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,WA2DzB,CAAA"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Regal preset — luxurious, commanding, distinguished.
3
+ * Design: deep black base, rich gold accent, elegant serif headings.
4
+ * Evokes: royal courts, gilt architecture, fine craftsmanship.
5
+ */
6
+ export const regalPreset = {
7
+ light: {
8
+ primary: '#B8922F',
9
+ primaryContrast: '#ffffff',
10
+ background: '#F0F0F2',
11
+ surface: '#F7F7F8',
12
+ surfaceHover: '#E9E9EB',
13
+ text: '#2E2E30',
14
+ textDimmed: '#50505A',
15
+ textSubtle: '#8E8E96',
16
+ border: '#CCCCD2',
17
+ error: '#A83232',
18
+ warning: '#B87A1A',
19
+ success: '#3A7A3A',
20
+ glassBackground: 'rgba(247, 247, 248, 0.6)',
21
+ glassBlur: 'blur(12px)',
22
+ shadow: '0px 2px 6px -2px rgba(20, 20, 20, 0.12)',
23
+ cardShadow: 'inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 2px 4px rgba(20, 20, 20, 0.06), 0 4px 8px rgba(20, 20, 20, 0.04)',
24
+ durationFast: '180ms',
25
+ durationNormal: '320ms',
26
+ easing: 'cubic-bezier(0.25, 0.1, 0.25, 1)'
27
+ },
28
+ dark: {
29
+ primary: '#D4A843',
30
+ primaryContrast: '#1A1400',
31
+ background: '#000000',
32
+ surface: '#0E0E0E',
33
+ surfaceHover: '#181818',
34
+ text: '#F5EEE0',
35
+ textDimmed: '#C8BA98',
36
+ textSubtle: '#A89880',
37
+ border: '#1D1D1D',
38
+ error: '#E05252',
39
+ warning: '#D4943C',
40
+ success: '#4AA84A',
41
+ glassBackground: 'rgba(14, 14, 14, 0.6)',
42
+ glassBlur: 'blur(14px)',
43
+ shadow: '0px 3px 8px -2px rgba(0, 0, 0, 0.95)',
44
+ cardShadow: 'inset 0 1px 0 rgba(212, 168, 67, 0.04), 0 2px 4px rgba(0, 0, 0, 0.2), 0 4px 10px rgba(0, 0, 0, 0.3), 0 8px 20px rgba(0, 0, 0, 0.2)',
45
+ durationFast: '180ms',
46
+ durationNormal: '320ms',
47
+ easing: 'cubic-bezier(0.25, 0.1, 0.25, 1)'
48
+ },
49
+ subtitleFontFamily: '"Raleway", sans-serif',
50
+ framework: {
51
+ defaultRadius: 'xs',
52
+ fontFamily: '"Inter", sans-serif',
53
+ headings: {
54
+ fontFamily: '"Cinzel", serif',
55
+ fontWeight: '600'
56
+ }
57
+ },
58
+ fontImports: [
59
+ 'https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&display=swap',
60
+ 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap',
61
+ 'https://fonts.googleapis.com/css2?family=Raleway:wght@400;500;600;700&display=swap'
62
+ ]
63
+ };
@@ -0,0 +1,8 @@
1
+ import type { ThemePreset } from './types';
2
+ /**
3
+ * Rose Gold preset — warm luxury, muted elegance, refined.
4
+ * Design: blush-pink base, copper-rose accent, soft warm neutrals.
5
+ * Evokes: boutique brands, editorial design, premium consumer products.
6
+ */
7
+ export declare const roseGoldPreset: ThemePreset;
8
+ //# sourceMappingURL=rose-gold.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rose-gold.d.ts","sourceRoot":"","sources":["../../../src/theme/presets/rose-gold.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,WA2D5B,CAAA"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Rose Gold preset — warm luxury, muted elegance, refined.
3
+ * Design: blush-pink base, copper-rose accent, soft warm neutrals.
4
+ * Evokes: boutique brands, editorial design, premium consumer products.
5
+ */
6
+ export const roseGoldPreset = {
7
+ light: {
8
+ primary: '#A8695E',
9
+ primaryContrast: '#ffffff',
10
+ background: '#F4F0EE',
11
+ surface: '#FAF6F5',
12
+ surfaceHover: '#EDE6E4',
13
+ text: '#2D2325',
14
+ textDimmed: '#5A4448',
15
+ textSubtle: '#9A848A',
16
+ border: '#DDD0CC',
17
+ error: '#C62828',
18
+ warning: '#E65100',
19
+ success: '#2E7D32',
20
+ glassBackground: 'rgba(250, 246, 245, 0.6)',
21
+ glassBlur: 'blur(12px)',
22
+ shadow: '0px 2px 6px -2px rgba(192, 122, 110, 0.1)',
23
+ cardShadow: 'inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 2px 4px rgba(45, 35, 37, 0.05), 0 4px 8px rgba(45, 35, 37, 0.04)',
24
+ durationFast: '160ms',
25
+ durationNormal: '300ms',
26
+ easing: 'cubic-bezier(0.25, 0.1, 0.25, 1)'
27
+ },
28
+ dark: {
29
+ primary: '#C8897C',
30
+ primaryContrast: '#2D1A16',
31
+ background: '#070405',
32
+ surface: '#161011',
33
+ surfaceHover: '#221A1C',
34
+ text: '#F5E8E6',
35
+ textDimmed: '#D8B8B2',
36
+ textSubtle: '#B89A94',
37
+ border: '#2A1E20',
38
+ error: '#EF5350',
39
+ warning: '#FF8A65',
40
+ success: '#66BB6A',
41
+ glassBackground: 'rgba(22, 16, 17, 0.65)',
42
+ glassBlur: 'blur(14px)',
43
+ shadow: '0px 3px 8px -2px rgba(0, 0, 0, 0.95)',
44
+ cardShadow: 'inset 0 1px 0 rgba(232, 165, 152, 0.04), 0 2px 4px rgba(0, 0, 0, 0.2), 0 4px 10px rgba(0, 0, 0, 0.3), 0 8px 20px rgba(0, 0, 0, 0.2)',
45
+ durationFast: '160ms',
46
+ durationNormal: '300ms',
47
+ easing: 'cubic-bezier(0.25, 0.1, 0.25, 1)'
48
+ },
49
+ subtitleFontFamily: '"Lora", serif',
50
+ framework: {
51
+ defaultRadius: 'sm',
52
+ fontFamily: '"DM Sans", sans-serif',
53
+ headings: {
54
+ fontFamily: '"Playfair Display", serif',
55
+ fontWeight: '600'
56
+ }
57
+ },
58
+ fontImports: [
59
+ 'https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&display=swap',
60
+ 'https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap',
61
+ 'https://fonts.googleapis.com/css2?family=Lora:wght@400;500;600;700&display=swap'
62
+ ]
63
+ };
@@ -0,0 +1,3 @@
1
+ import type { ThemePreset } from './types';
2
+ export declare const slatePreset: ThemePreset;
3
+ //# sourceMappingURL=slate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slate.d.ts","sourceRoot":"","sources":["../../../src/theme/presets/slate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,eAAO,MAAM,WAAW,EAAE,WAyDzB,CAAA"}
@@ -0,0 +1,56 @@
1
+ export const slatePreset = {
2
+ light: {
3
+ primary: '#4A6E8E',
4
+ primaryContrast: '#ffffff',
5
+ background: '#ECEEF0',
6
+ surface: '#F3F4F6',
7
+ surfaceHover: '#E0E3E7',
8
+ text: '#161C22',
9
+ textDimmed: '#404C58',
10
+ textSubtle: '#6A7A88',
11
+ border: '#C8D0D8',
12
+ error: '#D32F2F',
13
+ warning: '#F57C00',
14
+ success: '#388E3C',
15
+ glassBackground: 'rgba(243, 244, 246, 0.6)',
16
+ glassBlur: 'blur(10px)',
17
+ shadow: '0px 2px 4px -2px rgba(74, 110, 142, 0.08)',
18
+ cardShadow: 'inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 2px 4px rgba(22, 28, 34, 0.05), 0 4px 8px rgba(22, 28, 34, 0.04)',
19
+ durationFast: '110ms',
20
+ durationNormal: '200ms',
21
+ easing: 'cubic-bezier(0.22, 0, 0.1, 1)'
22
+ },
23
+ dark: {
24
+ primary: '#6A8FAD',
25
+ primaryContrast: '#0E1218',
26
+ background: '#010305',
27
+ surface: '#0E1218',
28
+ surfaceHover: '#1C2830',
29
+ text: '#E8F0F8',
30
+ textDimmed: '#A8C4DC',
31
+ textSubtle: '#80A0B0',
32
+ border: '#182028',
33
+ error: '#FF5252',
34
+ warning: '#FFB74D',
35
+ success: '#69F0AE',
36
+ glassBackground: 'rgba(12, 16, 22, 0.65)',
37
+ glassBlur: 'blur(14px)',
38
+ shadow: '0px 3px 6px -2px rgba(0, 0, 0, 0.9)',
39
+ cardShadow: 'inset 0 1px 0 rgba(123, 158, 188, 0.04), 0 2px 4px rgba(0, 0, 0, 0.2), 0 4px 8px rgba(0, 0, 0, 0.25), 0 8px 16px rgba(0, 0, 0, 0.18)',
40
+ durationFast: '110ms',
41
+ durationNormal: '200ms',
42
+ easing: 'cubic-bezier(0.22, 0, 0.1, 1)'
43
+ },
44
+ subtitleFontFamily: '"Quantico", sans-serif',
45
+ framework: {
46
+ fontFamily: '"IBM Plex Sans", sans-serif',
47
+ headings: {
48
+ fontFamily: '"Quantico", sans-serif',
49
+ fontWeight: '600'
50
+ }
51
+ },
52
+ fontImports: [
53
+ 'https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&display=swap',
54
+ 'https://fonts.googleapis.com/css2?family=Quantico:ital,wght@0,400;0,700;1,400;1,700&display=swap'
55
+ ]
56
+ };
@@ -0,0 +1,8 @@
1
+ import type { ThemePreset } from './types';
2
+ /**
3
+ * Tactical preset — tactical, modern, sleek.
4
+ * Design: dark navy-charcoal base, cool blue accent, gunmetal tones.
5
+ * Evokes: command centers, heads-up displays, defense tech interfaces.
6
+ */
7
+ export declare const tacticalPreset: ThemePreset;
8
+ //# sourceMappingURL=tactical.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tactical.d.ts","sourceRoot":"","sources":["../../../src/theme/presets/tactical.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,WAqD5B,CAAA"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Tactical preset — tactical, modern, sleek.
3
+ * Design: dark navy-charcoal base, cool blue accent, gunmetal tones.
4
+ * Evokes: command centers, heads-up displays, defense tech interfaces.
5
+ */
6
+ export const tacticalPreset = {
7
+ light: {
8
+ primary: '#0099ff',
9
+ primaryContrast: '#ffffff',
10
+ background: '#EAEBEE',
11
+ surface: '#F3F3F6',
12
+ surfaceHover: '#DFDFE4',
13
+ text: '#0F1319',
14
+ textDimmed: '#3B4559',
15
+ textSubtle: '#5D677B',
16
+ border: '#C5CCD6',
17
+ error: '#D32F2F',
18
+ warning: '#ED6C02',
19
+ success: '#2E7D32',
20
+ glassBackground: 'rgba(243, 243, 246, 0.6)',
21
+ glassBlur: 'blur(14px)',
22
+ shadow: '0px 2px 4px -2px rgba(15, 19, 25, 0.12)',
23
+ cardShadow: 'inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 1px 3px rgba(15, 19, 25, 0.06), 0 4px 8px rgba(15, 19, 25, 0.04)',
24
+ durationFast: '100ms',
25
+ durationNormal: '180ms',
26
+ easing: 'cubic-bezier(0.22, 0, 0.1, 1)'
27
+ },
28
+ dark: {
29
+ primary: '#0099ff',
30
+ primaryContrast: '#ffffff',
31
+ background: '#020305',
32
+ surface: '#0E0F14',
33
+ surfaceHover: '#16171D',
34
+ text: '#EFF2F7',
35
+ textDimmed: '#B0BCD2',
36
+ textSubtle: '#8898AE',
37
+ border: '#181C2D',
38
+ error: '#FF4757',
39
+ warning: '#FFA502',
40
+ success: '#2ED573',
41
+ glassBackground: 'rgba(13, 14, 18, 0.58)',
42
+ glassBlur: 'blur(16px)',
43
+ shadow: '0px 2px 6px -2px rgba(0, 0, 0, 0.9)',
44
+ cardShadow: 'inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 1px 3px rgba(0, 0, 0, 0.2), 0 4px 8px rgba(0, 0, 0, 0.28), 0 8px 16px rgba(0, 0, 0, 0.18)',
45
+ durationFast: '100ms',
46
+ durationNormal: '180ms',
47
+ easing: 'cubic-bezier(0.22, 0, 0.1, 1)'
48
+ },
49
+ subtitleFontFamily: '"Chakra Petch", sans-serif',
50
+ framework: {
51
+ fontFamily: '"Chakra Petch", sans-serif',
52
+ headings: {
53
+ fontFamily: '"Chakra Petch", sans-serif'
54
+ }
55
+ },
56
+ fontImports: ['https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;500;600;700&display=swap']
57
+ };
@@ -0,0 +1,26 @@
1
+ import type { ElevasisTokenOverrides } from '../../provider/types';
2
+ /** Framework-agnostic theme overrides bundled with a preset (fonts, radius, component styles). */
3
+ export interface FrameworkThemeOverrides {
4
+ fontFamily?: string;
5
+ defaultRadius?: string;
6
+ headings?: {
7
+ fontFamily?: string;
8
+ fontWeight?: string;
9
+ };
10
+ components?: Record<string, unknown>;
11
+ }
12
+ export interface ThemePreset {
13
+ light: Required<ElevasisTokenOverrides>;
14
+ dark: Required<ElevasisTokenOverrides>;
15
+ /** Optional framework theme overrides bundled with this preset (fonts, radius, etc.). */
16
+ framework?: FrameworkThemeOverrides;
17
+ /**
18
+ * Subtitle font family — used for card names, section labels, and nav items.
19
+ * Sits between heading and body in the typographic hierarchy.
20
+ */
21
+ subtitleFontFamily?: string;
22
+ /** Google Fonts URLs to load when this preset is active. */
23
+ fontImports?: string[];
24
+ }
25
+ export type PresetName = 'default' | 'tactical' | 'regal' | 'cyber-volt' | 'aurora' | 'rose-gold' | 'midnight' | 'ember' | 'obsidian' | 'honey' | 'abyss' | 'canopy' | 'slate' | 'cyber-strike' | 'cyber-flux' | 'cyber-void';
26
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/theme/presets/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAElE,kGAAkG;AAClG,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,EAAE;QACT,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,UAAU,CAAC,EAAE,MAAM,CAAA;KACpB,CAAA;IACD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACrC;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAA;IACvC,IAAI,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAA;IACtC,yFAAyF;IACzF,SAAS,CAAC,EAAE,uBAAuB,CAAA;IACnC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;CACvB;AAED,MAAM,MAAM,UAAU,GAClB,SAAS,GACT,UAAU,GACV,OAAO,GACP,YAAY,GACZ,QAAQ,GACR,WAAW,GACX,UAAU,GACV,OAAO,GACP,UAAU,GACV,OAAO,GACP,OAAO,GACP,QAAQ,GACR,OAAO,GACP,cAAc,GACd,YAAY,GACZ,YAAY,CAAA"}
@@ -0,0 +1 @@
1
+ export {};
@@ -1,26 +1,5 @@
1
1
  import { IconBrain } from '@tabler/icons-react';
2
2
 
3
- declare const showInfoNotification: (message: string) => void;
4
- declare const showSuccessNotification: (message: string) => void;
5
- declare const showErrorNotification: (error: Error | string) => void;
6
- declare const showWarningNotification: (message: string) => void;
7
- /**
8
- * Show API error notification with type-safe error handling
9
- * Automatically extracts error code, message, and request ID
10
- *
11
- * @param error - Any error (APIClientError, Error, or unknown)
12
- *
13
- * @example
14
- * ```typescript
15
- * import { showApiErrorNotification } from '@repo/ui/utils'
16
- *
17
- * onError: (error) => {
18
- * showApiErrorNotification(error)
19
- * }
20
- * ```
21
- */
22
- declare const showApiErrorNotification: (error: unknown) => void;
23
-
24
3
  declare const formatDate: (dateString: string) => string;
25
4
 
26
5
  declare const validateEmail: (email: string) => boolean;
@@ -173,5 +152,5 @@ type TablerIcon = typeof IconBrain;
173
152
  */
174
153
  declare function getResourceIcon(type: ResourceDefinitionType): TablerIcon;
175
154
 
176
- export { APIClientError, formatDate, formatErrorMessage, getErrorInfo, getErrorTitle, getResourceColor, getResourceIcon, isAPIClientError, showApiErrorNotification, showErrorNotification, showInfoNotification, showSuccessNotification, showWarningNotification, validateEmail };
155
+ export { APIClientError, formatDate, formatErrorMessage, getErrorInfo, getErrorTitle, getResourceColor, getResourceIcon, isAPIClientError, validateEmail };
177
156
  export type { TablerIcon };
@@ -1,2 +1,2 @@
1
- export { formatDate, getResourceColor, getResourceIcon, showApiErrorNotification, showErrorNotification, showInfoNotification, showSuccessNotification, showWarningNotification, validateEmail } from '../chunk-JVAZHVNV.js';
1
+ export { formatDate, getResourceColor, getResourceIcon, validateEmail } from '../chunk-LFYO3MDC.js';
2
2
  export { APIClientError, formatErrorMessage, getErrorInfo, getErrorTitle, isAPIClientError } from '../chunk-4VGWQ5AN.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elevasis/ui",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
4
4
  "description": "UI components and platform-aware hooks for building custom frontends on the Elevasis platform",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -40,62 +40,14 @@
40
40
  "import": "./dist/organization/index.js"
41
41
  }
42
42
  },
43
- "publishConfig": {
44
- "name": "@elevasis/ui",
45
- "peerDependencies": {
46
- "react": "^19.2.0",
47
- "react-dom": "^19.2.0",
48
- "@tanstack/react-query": "^5.76.2",
49
- "@tanstack/react-router": "^1.131.28"
50
- }
51
- },
52
43
  "peerDependencies": {
53
44
  "react": "^19.2.0",
54
45
  "react-dom": "^19.2.0",
55
- "@xyflow/react": "^12.8.5",
56
- "@mantine/core": "8.2.7",
57
- "@mantine/form": "8.2.7",
58
- "@mantine/hooks": "8.2.7",
59
- "@mantine/charts": "8.2.7",
60
- "@mantine/notifications": "8.2.7",
61
- "@tabler/icons-react": "^3.27.0",
62
- "@tanstack/react-router": "^1.131.28",
63
- "react-markdown": "^10.1.0",
64
- "react-syntax-highlighter": "^16.1.0",
65
- "@supabase/supabase-js": "^2.49.4",
66
- "@workos-inc/authkit-react": "^0.11.0",
67
46
  "@tanstack/react-query": "^5.76.2",
68
- "zustand": "^5.0.5",
69
- "immer": "^10.1.1",
70
- "date-fns": "^4.1.0",
71
- "zod": "^4.1.0"
72
- },
73
- "devDependencies": {
74
- "@types/react": "^19.2.2",
75
- "@types/react-dom": "^19.1.9",
76
- "globals": "^16.3.0",
77
- "rollup": "^4.59.0",
78
- "rollup-plugin-dts": "^6.3.0",
79
- "tsup": "^8.0.0",
80
- "typescript": "5.9.2",
81
- "vite": "^7.0.0",
82
- "@repo/core": "0.0.0",
83
- "@repo/eslint-config": "0.0.0",
84
- "@repo/typescript-config": "0.0.0"
47
+ "@tanstack/react-router": "^1.131.28"
85
48
  },
86
49
  "dependencies": {
87
50
  "@dagrejs/dagre": "^1.1.4",
88
- "@mdx-js/mdx": "^3.1.0",
89
- "@microsoft/fetch-event-source": "^2.0.1",
90
- "react-json-pretty": "^2.2.0"
91
- },
92
- "scripts": {
93
- "build": "tsc",
94
- "build:publish": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.core-dts.json && tsc -p tsconfig.build.json && tsup && rollup -c rollup.dts.config.mjs && node -e \"require('fs').rmSync('dist/types',{recursive:true,force:true})\"",
95
- "dev": "tsc --watch",
96
- "lint": "eslint src --max-warnings 0",
97
- "check-types": "tsc --noEmit",
98
- "test": "vitest run --passWithNoTests",
99
- "test:watch": "vitest watch"
51
+ "@microsoft/fetch-event-source": "^2.0.1"
100
52
  }
101
- }
53
+ }
@@ -1,52 +0,0 @@
1
- import { Text, Box, Code, Title } from '@mantine/core';
2
- import Markdown from 'react-markdown';
3
- import { Prism } from 'react-syntax-highlighter';
4
- import { oneDark } from 'react-syntax-highlighter/dist/esm/styles/prism';
5
- import { jsx, Fragment } from 'react/jsx-runtime';
6
-
7
- // src/components/display/StyledMarkdown.tsx
8
- var customCodeTheme = Object.fromEntries(
9
- Object.entries(oneDark).map(([key, value]) => [
10
- key,
11
- typeof value === "object" && value !== null ? { ...value, background: "none", backgroundColor: "none" } : value
12
- ])
13
- );
14
- var defaultComponents = {
15
- h1: ({ children }) => /* @__PURE__ */ jsx(Title, { order: 3, c: "var(--color-primary)", mb: "xs", mt: "md", children }),
16
- h2: ({ children }) => /* @__PURE__ */ jsx(Title, { order: 4, c: "var(--color-primary)", mb: "xs", mt: "sm", children }),
17
- ul: ({ children }) => /* @__PURE__ */ jsx("ul", { style: { margin: "0.5rem 0", paddingLeft: "1.5rem" }, children }),
18
- ol: ({ children }) => /* @__PURE__ */ jsx("ol", { style: { margin: "0.5rem 0", paddingLeft: "1.5rem" }, children }),
19
- li: ({ children }) => /* @__PURE__ */ jsx("li", { style: { marginBottom: "0.25rem", fontSize: "var(--mantine-font-size-sm)" }, children }),
20
- code: ({ className, children, ...props }) => {
21
- const match = /language-(\w+)/.exec(className || "");
22
- const codeString = String(children).replace(/\n$/, "");
23
- if (match) {
24
- return /* @__PURE__ */ jsx(
25
- Prism,
26
- {
27
- style: customCodeTheme,
28
- language: match[1],
29
- PreTag: "div",
30
- customStyle: {
31
- margin: "0.5rem 0",
32
- borderRadius: "var(--mantine-radius-default)",
33
- fontSize: "0.8rem"
34
- },
35
- children: codeString
36
- }
37
- );
38
- }
39
- return /* @__PURE__ */ jsx(Code, { ...props, children });
40
- },
41
- pre: ({ children }) => /* @__PURE__ */ jsx(Fragment, { children }),
42
- blockquote: ({ children }) => /* @__PURE__ */ jsx(Box, { pl: "sm", my: "xs", style: { borderLeft: "2px solid var(--color-border)" }, children }),
43
- p: ({ children }) => /* @__PURE__ */ jsx(Text, { size: "sm", m: 0, children }),
44
- strong: ({ children }) => /* @__PURE__ */ jsx(Text, { component: "span", fw: 700, children }),
45
- em: ({ children }) => /* @__PURE__ */ jsx(Text, { component: "span", fs: "italic", children })
46
- };
47
- function StyledMarkdown({ children, components, className, style }) {
48
- const mergedComponents = components ? { ...defaultComponents, ...components } : defaultComponents;
49
- return /* @__PURE__ */ jsx("div", { className, style, children: /* @__PURE__ */ jsx(Markdown, { components: mergedComponents, children }) });
50
- }
51
-
52
- export { StyledMarkdown };
@@ -1,8 +0,0 @@
1
- // src/execution/utils/formatDuration.ts
2
- function formatDuration(ms) {
3
- if (!ms) return "0ms";
4
- if (ms < 1e3) return `${ms}ms`;
5
- return `${(ms / 1e3).toFixed(2)}s`;
6
- }
7
-
8
- export { formatDuration };
@@ -1,113 +0,0 @@
1
- import { useNotificationAdapter } from './chunk-TIRMFDM4.js';
2
- import { useElevasisServices } from './chunk-KA7LO7U5.js';
3
- import { useQueryClient, useMutation, useQuery } from '@tanstack/react-query';
4
- import { z } from 'zod';
5
-
6
- var UuidSchema = z.string().uuid();
7
- var NonEmptyStringSchema = z.string().trim().min(1).max(1e3);
8
- var ResourceTypeSchema = z.enum(["agent", "workflow"]);
9
- var OriginResourceTypeSchema = z.enum(["agent", "workflow", "scheduler", "api"]);
10
- z.string().trim().toLowerCase().min(1, "Credential name required").max(100, "Credential name too long (max 100 chars)").regex(
11
- /^[a-z0-9]+(-[a-z0-9]+)+$/,
12
- "Credential name must be lowercase letters, numbers, and hyphens in format: service-environment (e.g., gmail-prod, attio-dev)"
13
- );
14
- z.enum(["google-sheets", "dropbox"]);
15
- z.string().min(10, "Authorization code too short").max(1e3, "Authorization code too long");
16
- z.string().min(10, "State parameter too short").max(2048, "State parameter too long");
17
- z.string().trim().transform((str) => str.replace(/[<>'"]/g, ""));
18
- z.string().email();
19
- z.string().url();
20
- z.object({
21
- limit: z.coerce.number().int().min(1).max(100).default(20),
22
- offset: z.coerce.number().int().min(0).default(0)
23
- });
24
- z.string().datetime();
25
- z.object({
26
- startDate: z.string().datetime(),
27
- endDate: z.string().datetime()
28
- });
29
-
30
- // ../core/src/operations/notifications/api-schemas.ts
31
- var NotificationCategorySchema = z.enum(["info", "queue", "alert", "error", "system"]);
32
- var GetNotificationsQuerySchema = z.object({
33
- limit: z.coerce.number().int().min(1).max(100).default(50),
34
- offset: z.coerce.number().int().min(0).default(0)
35
- });
36
- var MarkAsReadParamsSchema = z.object({
37
- id: UuidSchema
38
- });
39
- z.object({
40
- userId: UuidSchema,
41
- organizationId: UuidSchema,
42
- category: NotificationCategorySchema,
43
- title: z.string().trim().min(1).max(200),
44
- message: z.string().trim().min(1).max(1e3),
45
- actionUrl: z.string().url().optional()
46
- }).strict();
47
-
48
- // src/hooks/notifications/useMarkAsRead.ts
49
- function useMarkAsRead() {
50
- const queryClient = useQueryClient();
51
- const { apiRequest } = useElevasisServices();
52
- const notify = useNotificationAdapter();
53
- return useMutation({
54
- mutationFn: async (notificationId) => {
55
- MarkAsReadParamsSchema.parse({ id: notificationId });
56
- await apiRequest(`/notifications/${notificationId}/read`, {
57
- method: "PATCH"
58
- });
59
- },
60
- onSuccess: () => {
61
- queryClient.invalidateQueries({ queryKey: ["notifications"] });
62
- },
63
- onError: (error) => {
64
- notify.apiError(error);
65
- }
66
- });
67
- }
68
- function useMarkAllAsRead() {
69
- const queryClient = useQueryClient();
70
- const { apiRequest } = useElevasisServices();
71
- const notify = useNotificationAdapter();
72
- return useMutation({
73
- mutationFn: async () => {
74
- await apiRequest("/notifications/mark-all-read", {
75
- method: "PATCH"
76
- });
77
- },
78
- onSuccess: () => {
79
- queryClient.invalidateQueries({ queryKey: ["notifications"] });
80
- },
81
- onError: (error) => {
82
- notify.apiError(error);
83
- }
84
- });
85
- }
86
- function useNotifications({ limit = 20, offset = 0 } = {}) {
87
- const { apiRequest, isReady, organizationId } = useElevasisServices();
88
- return useQuery({
89
- queryKey: ["notifications", organizationId, { limit, offset }],
90
- queryFn: async () => {
91
- const params = GetNotificationsQuerySchema.parse({ limit, offset });
92
- const response = await apiRequest(
93
- `/notifications?limit=${params.limit}&offset=${params.offset}`
94
- );
95
- return response;
96
- },
97
- enabled: isReady
98
- });
99
- }
100
- function useNotificationCount() {
101
- const { apiRequest, isReady, organizationId } = useElevasisServices();
102
- return useQuery({
103
- queryKey: ["notifications", "unread-count", organizationId],
104
- queryFn: async () => {
105
- const response = await apiRequest("/notifications/unread-count");
106
- return response.count;
107
- },
108
- enabled: isReady,
109
- staleTime: 3e4
110
- });
111
- }
112
-
113
- export { NonEmptyStringSchema, OriginResourceTypeSchema, ResourceTypeSchema, UuidSchema, useMarkAllAsRead, useMarkAsRead, useNotificationCount, useNotifications };