@elevasis/ui 1.3.1 → 1.3.2

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 (261) 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 +6 -6
  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 +190 -0
  167. package/dist/provider/types.d.ts.map +1 -0
  168. package/dist/sdk-barrel.d.ts +20 -0
  169. package/dist/sdk-barrel.d.ts.map +1 -0
  170. package/dist/supabase/index.d.ts +0 -255
  171. package/dist/theme/cssVariables.d.ts +12 -0
  172. package/dist/theme/cssVariables.d.ts.map +1 -0
  173. package/dist/theme/index.d.ts +4 -0
  174. package/dist/theme/index.d.ts.map +1 -0
  175. package/dist/theme/presets/__tests__/getPreset.test.d.ts +2 -0
  176. package/dist/theme/presets/__tests__/getPreset.test.d.ts.map +1 -0
  177. package/dist/theme/presets/abyss.d.ts +3 -0
  178. package/dist/theme/presets/abyss.d.ts.map +1 -0
  179. package/dist/theme/presets/abyss.js +54 -0
  180. package/dist/theme/presets/aurora.d.ts +8 -0
  181. package/dist/theme/presets/aurora.d.ts.map +1 -0
  182. package/dist/theme/presets/aurora.js +59 -0
  183. package/dist/theme/presets/canopy.d.ts +3 -0
  184. package/dist/theme/presets/canopy.d.ts.map +1 -0
  185. package/dist/theme/presets/canopy.js +58 -0
  186. package/dist/theme/presets/cyber-flux.d.ts +8 -0
  187. package/dist/theme/presets/cyber-flux.d.ts.map +1 -0
  188. package/dist/theme/presets/cyber-strike.d.ts +9 -0
  189. package/dist/theme/presets/cyber-strike.d.ts.map +1 -0
  190. package/dist/theme/presets/cyber-void.d.ts +8 -0
  191. package/dist/theme/presets/cyber-void.d.ts.map +1 -0
  192. package/dist/theme/presets/cyber-volt.d.ts +8 -0
  193. package/dist/theme/presets/cyber-volt.d.ts.map +1 -0
  194. package/dist/theme/presets/default.d.ts +4 -0
  195. package/dist/theme/presets/default.d.ts.map +1 -0
  196. package/dist/theme/presets/ember.d.ts +8 -0
  197. package/dist/theme/presets/ember.d.ts.map +1 -0
  198. package/dist/theme/presets/ember.js +63 -0
  199. package/dist/theme/presets/honey.d.ts +3 -0
  200. package/dist/theme/presets/honey.d.ts.map +1 -0
  201. package/dist/theme/presets/honey.js +62 -0
  202. package/dist/theme/presets/index.d.ts +6 -0
  203. package/dist/theme/presets/index.d.ts.map +1 -0
  204. package/dist/theme/presets/midnight.d.ts +8 -0
  205. package/dist/theme/presets/midnight.d.ts.map +1 -0
  206. package/dist/theme/presets/midnight.js +68 -0
  207. package/dist/theme/presets/obsidian.d.ts +3 -0
  208. package/dist/theme/presets/obsidian.d.ts.map +1 -0
  209. package/dist/theme/presets/obsidian.js +56 -0
  210. package/dist/theme/presets/regal.d.ts +8 -0
  211. package/dist/theme/presets/regal.d.ts.map +1 -0
  212. package/dist/theme/presets/rose-gold.d.ts +8 -0
  213. package/dist/theme/presets/rose-gold.d.ts.map +1 -0
  214. package/dist/theme/presets/slate.d.ts +3 -0
  215. package/dist/theme/presets/slate.d.ts.map +1 -0
  216. package/dist/theme/presets/slate.js +56 -0
  217. package/dist/theme/presets/tactical.d.ts +8 -0
  218. package/dist/theme/presets/tactical.d.ts.map +1 -0
  219. package/dist/theme/presets/types.d.ts +26 -0
  220. package/dist/theme/presets/types.d.ts.map +1 -0
  221. package/dist/theme/presets/types.js +1 -0
  222. package/dist/utils/index.d.ts +1 -22
  223. package/dist/utils/index.js +1 -1
  224. package/package.json +67 -51
  225. package/dist/chunk-3KMDHCAR.js +0 -52
  226. package/dist/chunk-6BJOYF6E.js +0 -8
  227. package/dist/chunk-BLO4SISK.js +0 -113
  228. package/dist/chunk-HUWJXLLF.js +0 -681
  229. package/dist/chunk-JVAZHVNV.js +0 -110
  230. package/dist/chunk-JYSYHVLU.js +0 -379
  231. package/dist/chunk-NE36BUGQ.js +0 -146
  232. package/dist/chunk-O3PY6B6E.js +0 -749
  233. package/dist/chunk-OXVOHOP3.js +0 -661
  234. package/dist/chunk-PSLKGOBZ.js +0 -58
  235. package/dist/chunk-RJCA5672.js +0 -1664
  236. package/dist/chunk-TMFCNFLW.js +0 -107
  237. package/dist/chunk-TN3PU2WK.js +0 -748
  238. package/dist/chunk-TZPAA4RC.js +0 -1461
  239. package/dist/chunk-W7ZBF5AA.js +0 -1
  240. package/dist/chunk-YZ6GTZXL.js +0 -48
  241. package/dist/components/command-queue/index.css +0 -53
  242. package/dist/components/command-queue/index.d.ts +0 -204
  243. package/dist/components/command-queue/index.js +0 -12
  244. package/dist/components/forms/index.d.ts +0 -56
  245. package/dist/components/forms/index.js +0 -2
  246. package/dist/components/index.css +0 -443
  247. package/dist/components/monitoring/index.d.ts +0 -66
  248. package/dist/components/monitoring/index.js +0 -2
  249. package/dist/components/notifications/index.d.ts +0 -52
  250. package/dist/components/notifications/index.js +0 -5
  251. package/dist/components/resource-definition/index.css +0 -388
  252. package/dist/components/resource-definition/index.d.ts +0 -301
  253. package/dist/components/resource-definition/index.js +0 -3
  254. package/dist/display/index.css +0 -53
  255. package/dist/display/index.d.ts +0 -606
  256. package/dist/display/index.js +0 -7
  257. package/dist/execution/index.css +0 -388
  258. package/dist/provider/index.css +0 -61
  259. package/dist/{chunk-TYV5NJV2.js → chunk-BUZONXAW.js} +0 -0
  260. package/dist/{chunk-UMXDDEAG.js → chunk-SFF5MJEI.js} +1 -1
  261. /package/dist/{chunk-NXHL23JW.js → chunk-XXDDMASA.js} +0 -0
@@ -1,749 +0,0 @@
1
- import { StyledMarkdown } from './chunk-3KMDHCAR.js';
2
- import { ResourceStatusColors } from './chunk-YZ6GTZXL.js';
3
- import { getResourceIcon } from './chunk-JVAZHVNV.js';
4
- import { getErrorInfo, getErrorTitle } from './chunk-4VGWQ5AN.js';
5
- import { useAuthContext } from './chunk-7PLEQFHO.js';
6
- import { useRouterContext } from './chunk-Q7DJKLEN.js';
7
- import { Alert, Text, Code, Group, Badge, Collapse, ScrollArea, Center, Stack, Title, Button, UnstyledButton, Box, ThemeIcon, Card, Skeleton, Paper, Loader, Select, Grid, Space } from '@mantine/core';
8
- import { IconAlertCircle, IconChevronUp, IconChevronDown, IconChevronRight, IconInfoCircle, IconClock, IconMinus, IconTrendingUp, IconTrendingDown } from '@tabler/icons-react';
9
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
10
- import { useState } from 'react';
11
- import { Prism } from 'react-syntax-highlighter';
12
- import { oneDark } from 'react-syntax-highlighter/dist/esm/styles/prism';
13
-
14
- function APIErrorAlert({
15
- error,
16
- title,
17
- showRequestId = true,
18
- icon = /* @__PURE__ */ jsx(IconAlertCircle, {}),
19
- color = "red"
20
- }) {
21
- const { message, code, requestId, retryAfter } = getErrorInfo(error);
22
- const alertTitle = title || getErrorTitle(code);
23
- return /* @__PURE__ */ jsxs(
24
- Alert,
25
- {
26
- icon,
27
- title: alertTitle,
28
- color,
29
- variant: "light",
30
- children: [
31
- /* @__PURE__ */ jsx(Text, { size: "sm", children: message }),
32
- retryAfter && /* @__PURE__ */ jsxs(Text, { size: "sm", mt: "xs", children: [
33
- "Please wait ",
34
- retryAfter,
35
- " seconds before retrying."
36
- ] }),
37
- showRequestId && requestId && /* @__PURE__ */ jsxs(Text, { size: "xs", c: "dimmed", mt: "xs", children: [
38
- "Request ID: ",
39
- /* @__PURE__ */ jsx(Code, { children: requestId })
40
- ] })
41
- ]
42
- }
43
- );
44
- }
45
- function CollapsibleSection({
46
- title,
47
- count,
48
- countLabel,
49
- children,
50
- emptyMessage,
51
- defaultExpanded = true,
52
- maxHeight = 300
53
- }) {
54
- const [expanded, setExpanded] = useState(defaultExpanded);
55
- const isEmpty = count === 0;
56
- return /* @__PURE__ */ jsxs(
57
- "div",
58
- {
59
- style: {
60
- borderRadius: "8px",
61
- padding: "8px",
62
- border: "1px solid var(--color-border)",
63
- boxShadow: "var(--standard-box-shadow)"
64
- },
65
- children: [
66
- /* @__PURE__ */ jsxs(
67
- Group,
68
- {
69
- gap: "xs",
70
- mb: expanded ? "xs" : 0,
71
- justify: "space-between",
72
- align: "center",
73
- style: { cursor: "pointer" },
74
- onClick: () => setExpanded(!expanded),
75
- children: [
76
- /* @__PURE__ */ jsxs(Group, { gap: "xs", align: "center", style: { flex: 1 }, children: [
77
- typeof title === "string" ? /* @__PURE__ */ jsx(
78
- Text,
79
- {
80
- fw: 600,
81
- size: "sm",
82
- c: "var(--color-text)",
83
- style: { fontFamily: "var(--elevasis-font-family-subtitle)" },
84
- children: title
85
- }
86
- ) : title,
87
- count !== void 0 && countLabel && /* @__PURE__ */ jsxs(Badge, { size: "sm", variant: "light", color: "gray", children: [
88
- count,
89
- " ",
90
- count === 1 ? countLabel.replace(/s$/, "") : countLabel
91
- ] })
92
- ] }),
93
- expanded ? /* @__PURE__ */ jsx(IconChevronUp, { size: 16 }) : /* @__PURE__ */ jsx(IconChevronDown, { size: 16 })
94
- ]
95
- }
96
- ),
97
- /* @__PURE__ */ jsx(Collapse, { in: expanded, children: isEmpty && emptyMessage ? /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: emptyMessage }) : /* @__PURE__ */ jsx(ScrollArea, { h: maxHeight, type: "scroll", offsetScrollbars: true, children }) })
98
- ]
99
- }
100
- );
101
- }
102
- function EmptyState({ icon: Icon, title, description, action, py = "xl" }) {
103
- return /* @__PURE__ */ jsx(Center, { py, children: /* @__PURE__ */ jsxs(Stack, { align: "center", gap: "xs", children: [
104
- /* @__PURE__ */ jsx(Icon, { size: 48, style: { opacity: 0.5 } }),
105
- /* @__PURE__ */ jsx(Title, { order: 4, children: title }),
106
- description && /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", ta: "center", children: description }),
107
- action && /* @__PURE__ */ jsx(Button, { variant: "light", onClick: action.onClick, leftSection: action.icon, mt: "sm", children: action.label })
108
- ] }) });
109
- }
110
- var NavigationButton = ({
111
- icon: Icon,
112
- label,
113
- isCollapsed = false,
114
- hasSubItems = false,
115
- isExpanded = false,
116
- isActive = false,
117
- hasActiveBackground = false,
118
- onClick,
119
- style,
120
- transitionDuration = 200
121
- }) => {
122
- const activeColor = "var(--color-primary)";
123
- const textColor = isActive ? activeColor : "var(--color-text)";
124
- const bgColor = hasActiveBackground ? `color-mix(in srgb, ${activeColor} 10%, transparent)` : "transparent";
125
- return /* @__PURE__ */ jsx(
126
- UnstyledButton,
127
- {
128
- onClick: (event) => {
129
- event.preventDefault();
130
- event.stopPropagation();
131
- onClick?.();
132
- },
133
- style: {
134
- height: 46,
135
- display: "flex",
136
- alignItems: "center",
137
- width: "100%",
138
- padding: "var(--mantine-spacing-xs)",
139
- color: textColor,
140
- backgroundColor: bgColor,
141
- transition: `all var(--duration-fast) var(--easing)`,
142
- cursor: "pointer",
143
- overflow: "hidden",
144
- borderRadius: "var(--mantine-radius-default)",
145
- ...style
146
- },
147
- onMouseEnter: (e) => {
148
- if (!hasActiveBackground) {
149
- e.currentTarget.style.backgroundColor = "var(--color-surface-hover)";
150
- }
151
- },
152
- onMouseLeave: (e) => {
153
- if (!hasActiveBackground) {
154
- e.currentTarget.style.backgroundColor = "transparent";
155
- }
156
- },
157
- children: /* @__PURE__ */ jsxs(Group, { justify: "space-between", gap: 0, style: { width: "100%", overflow: "hidden" }, children: [
158
- /* @__PURE__ */ jsxs(
159
- Box,
160
- {
161
- style: {
162
- display: "flex",
163
- alignItems: "center",
164
- justifyContent: "flex-start",
165
- flex: hasSubItems && !isCollapsed ? 1 : "initial",
166
- minWidth: 0,
167
- overflow: "hidden"
168
- },
169
- children: [
170
- /* @__PURE__ */ jsx(
171
- ThemeIcon,
172
- {
173
- variant: "light",
174
- size: 30,
175
- style: {
176
- backgroundColor: isActive ? activeColor : "var(--color-surface)",
177
- color: isActive ? "white" : activeColor,
178
- marginRight: isCollapsed ? 0 : "var(--mantine-spacing-sm)",
179
- transition: `margin ${transitionDuration}ms var(--easing)`,
180
- flexShrink: 0
181
- },
182
- children: /* @__PURE__ */ jsx(Icon, { size: 18, stroke: 1.5 })
183
- }
184
- ),
185
- !isCollapsed && /* @__PURE__ */ jsx(
186
- Box,
187
- {
188
- style: {
189
- fontFamily: "var(--elevasis-font-family-subtitle)",
190
- fontSize: "var(--mantine-font-size-md)",
191
- fontWeight: isActive ? 600 : 500,
192
- color: textColor,
193
- transition: `opacity ${transitionDuration}ms var(--easing)`,
194
- whiteSpace: "nowrap",
195
- overflow: "hidden",
196
- textOverflow: "ellipsis"
197
- },
198
- children: label
199
- }
200
- )
201
- ]
202
- }
203
- ),
204
- hasSubItems && !isCollapsed && /* @__PURE__ */ jsx(
205
- IconChevronRight,
206
- {
207
- size: 14,
208
- stroke: 1.5,
209
- style: {
210
- transform: isExpanded ? "rotate(90deg)" : "rotate(0deg)",
211
- transition: `transform var(--duration-fast) var(--easing)`,
212
- color: "var(--color-text-subtle)",
213
- flexShrink: 0,
214
- marginLeft: "auto"
215
- }
216
- }
217
- )
218
- ] })
219
- }
220
- );
221
- };
222
- function PageNotFound() {
223
- const { currentPath, navigate } = useRouterContext();
224
- const { user, isLoading } = useAuthContext();
225
- const isAuthPage = currentPath === "/login" || currentPath === "/auth-redirect";
226
- const shouldShowSidebar = user && !isLoading && !isAuthPage;
227
- const height = shouldShowSidebar ? "100%" : "100vh";
228
- return /* @__PURE__ */ jsx(Center, { h: height, bg: "var(--color-background)", children: /* @__PURE__ */ jsxs(Stack, { align: "center", justify: "center", children: [
229
- /* @__PURE__ */ jsx(IconInfoCircle, { size: 60, color: "var(--color-text-subtle)" }),
230
- /* @__PURE__ */ jsx(Title, { order: 1, children: "Page Not Found" }),
231
- /* @__PURE__ */ jsx(Text, { c: "dimmed", size: "lg", children: "The page you are looking for does not exist." }),
232
- /* @__PURE__ */ jsx(Group, { justify: "center", children: /* @__PURE__ */ jsx(Button, { size: "md", onClick: () => navigate("/"), children: "Go Home" }) })
233
- ] }) });
234
- }
235
- var PageTitleCaption = ({ title, caption, rightSection }) => {
236
- const renderCaption = () => {
237
- if (!caption) return null;
238
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Text, { c: "dimmed", style: { fontFamily: "var(--elevasis-font-family-subtitle)" }, children: caption }) });
239
- };
240
- const titleContent = /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column" }, children: [
241
- /* @__PURE__ */ jsx(Title, { order: 1, children: title }),
242
- /* @__PURE__ */ jsx(Space, { h: "4" }),
243
- renderCaption()
244
- ] });
245
- if (!rightSection) {
246
- return titleContent;
247
- }
248
- return /* @__PURE__ */ jsxs(Group, { justify: "space-between", align: "end", children: [
249
- titleContent,
250
- rightSection
251
- ] });
252
- };
253
- function StatsCardSkeleton({ chartHeight = 120, withChart = true, statCount = 3 }) {
254
- return /* @__PURE__ */ jsxs(Card, { withBorder: true, children: [
255
- /* @__PURE__ */ jsx(Skeleton, { height: 24, width: 150, mb: "md" }),
256
- /* @__PURE__ */ jsxs(Group, { justify: "space-between", mb: "xl", children: [
257
- /* @__PURE__ */ jsx(Skeleton, { height: 60, width: 100 }),
258
- statCount >= 2 && /* @__PURE__ */ jsx(Skeleton, { height: 60, width: 100 }),
259
- /* @__PURE__ */ jsx(Skeleton, { height: 40, circle: true })
260
- ] }),
261
- withChart && /* @__PURE__ */ jsx(Skeleton, { height: chartHeight })
262
- ] });
263
- }
264
- function ListSkeleton({ rows = 3, rowHeight = 50 }) {
265
- return /* @__PURE__ */ jsx(Stack, { gap: "xs", children: Array.from({ length: rows }, (_, i) => /* @__PURE__ */ jsx(Skeleton, { height: rowHeight }, i)) });
266
- }
267
- function DetailCardSkeleton({ rows = 3 }) {
268
- return /* @__PURE__ */ jsxs(Card, { withBorder: true, children: [
269
- /* @__PURE__ */ jsx(Skeleton, { height: 24, width: 150, mb: "md" }),
270
- /* @__PURE__ */ jsxs(Group, { justify: "space-between", mb: "lg", children: [
271
- /* @__PURE__ */ jsx(Skeleton, { height: 80, width: 100 }),
272
- /* @__PURE__ */ jsx(Skeleton, { height: 80, width: 100 }),
273
- /* @__PURE__ */ jsx(Skeleton, { height: 40, circle: true })
274
- ] }),
275
- /* @__PURE__ */ jsx(Stack, { gap: "xs", children: Array.from({ length: rows }, (_, i) => /* @__PURE__ */ jsx(Skeleton, { height: 60 }, i)) })
276
- ] });
277
- }
278
-
279
- // src/components/display/StatCard.module.css
280
- var StatCard_default = {};
281
- function StatCard(props) {
282
- if (props.variant === "hero") {
283
- return /* @__PURE__ */ jsx(HeroStatCard, { ...props });
284
- }
285
- const { label, value, icon: IconComponent, color } = props;
286
- return /* @__PURE__ */ jsx(Card, { withBorder: true, children: /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
287
- /* @__PURE__ */ jsx(ThemeIcon, { size: "lg", variant: "light", color, children: /* @__PURE__ */ jsx(IconComponent, { size: 18 }) }),
288
- /* @__PURE__ */ jsxs("div", { children: [
289
- /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: label }),
290
- /* @__PURE__ */ jsx(Text, { size: "lg", fw: 600, style: { fontFamily: "var(--elevasis-font-family-subtitle)" }, children: value })
291
- ] })
292
- ] }) });
293
- }
294
- function HeroStatCard({
295
- icon: IconComponent,
296
- value,
297
- label,
298
- valueColor,
299
- isLoading,
300
- size = "sm",
301
- children
302
- }) {
303
- const sm = size === "sm";
304
- const iconSize = sm ? 36 : 46;
305
- if (isLoading) {
306
- return /* @__PURE__ */ jsx(Paper, { p: sm ? "md" : "lg", className: StatCard_default.heroCard, children: /* @__PURE__ */ jsxs(Group, { gap: sm ? "sm" : "md", wrap: "nowrap", children: [
307
- /* @__PURE__ */ jsx(Skeleton, { circle: true, height: iconSize }),
308
- /* @__PURE__ */ jsxs(Stack, { gap: 4, children: [
309
- /* @__PURE__ */ jsx(Skeleton, { height: sm ? 24 : 32, width: 60 }),
310
- /* @__PURE__ */ jsx(Skeleton, { height: 12, width: 80 })
311
- ] })
312
- ] }) });
313
- }
314
- return /* @__PURE__ */ jsx(Paper, { p: sm ? "md" : "lg", className: StatCard_default.heroCard, children: /* @__PURE__ */ jsxs(Group, { gap: sm ? "sm" : "md", wrap: "nowrap", children: [
315
- /* @__PURE__ */ jsx("div", { className: sm ? StatCard_default.iconRingSm : StatCard_default.iconRing, children: /* @__PURE__ */ jsx(IconComponent, { size: sm ? 18 : 22 }) }),
316
- /* @__PURE__ */ jsxs(Stack, { gap: 2, style: { flex: children ? 1 : void 0 }, children: [
317
- /* @__PURE__ */ jsx(
318
- "span",
319
- {
320
- className: sm ? StatCard_default.heroValueSm : StatCard_default.heroValue,
321
- style: valueColor ? { color: valueColor } : void 0,
322
- children: value
323
- }
324
- ),
325
- children ? /* @__PURE__ */ jsxs(Group, { gap: "sm", wrap: "nowrap", style: { flex: 1 }, children: [
326
- /* @__PURE__ */ jsx("span", { className: sm ? StatCard_default.heroLabelSm : StatCard_default.heroLabel, children: label }),
327
- /* @__PURE__ */ jsx("div", { style: { flex: 1 }, children })
328
- ] }) : /* @__PURE__ */ jsx("span", { className: sm ? StatCard_default.heroLabelSm : StatCard_default.heroLabel, children: label })
329
- ] })
330
- ] }) });
331
- }
332
- function StatCardSkeleton() {
333
- return /* @__PURE__ */ jsx(Card, { withBorder: true, children: /* @__PURE__ */ jsx(Skeleton, { height: 60 }) });
334
- }
335
- function TabCountBadge({ count, isLoading }) {
336
- return /* @__PURE__ */ jsx(Box, { miw: 20, h: 20, style: { display: "flex", alignItems: "center", justifyContent: "center" }, children: isLoading ? /* @__PURE__ */ jsx(Loader, { size: 12 }) : /* @__PURE__ */ jsx(Badge, { size: "sm", variant: "light", circle: count < 10, children: count }) });
337
- }
338
- function CustomSelector({
339
- value,
340
- onChange,
341
- data,
342
- leftSection,
343
- placeholder,
344
- w,
345
- withCheckIcon = false,
346
- disabled
347
- }) {
348
- return /* @__PURE__ */ jsx(
349
- Select,
350
- {
351
- value,
352
- onChange,
353
- data,
354
- leftSection,
355
- placeholder,
356
- w,
357
- size: "xs",
358
- variant: "unstyled",
359
- withCheckIcon,
360
- disabled,
361
- styles: {
362
- wrapper: {
363
- border: "1px solid var(--color-border)",
364
- borderRadius: "var(--mantine-radius-default)",
365
- backgroundColor: "var(--color-surface)",
366
- transition: "border-color 150ms ease, background-color 150ms ease",
367
- "&:hover": {
368
- borderColor: "var(--color-border-hover, var(--mantine-color-dark-3))"
369
- }
370
- },
371
- input: {
372
- fontSize: "var(--mantine-font-size-xs)",
373
- fontWeight: 500,
374
- height: "30px",
375
- minHeight: "30px",
376
- paddingLeft: leftSection ? "30px" : void 0,
377
- borderRadius: "var(--mantine-radius-default)",
378
- cursor: "pointer"
379
- },
380
- section: {
381
- color: "var(--color-text-subtle)"
382
- },
383
- dropdown: {
384
- border: "1px solid var(--color-border)",
385
- backgroundColor: "var(--color-surface)",
386
- boxShadow: "var(--card-shadow)"
387
- },
388
- option: {
389
- fontSize: "var(--mantine-font-size-xs)"
390
- }
391
- }
392
- }
393
- );
394
- }
395
- var TIME_RANGE_OPTIONS = [
396
- { value: "1h", label: "Last 1 hour" },
397
- { value: "24h", label: "Last 24 hours" },
398
- { value: "7d", label: "Last 7 days" },
399
- { value: "30d", label: "Last 30 days" }
400
- ];
401
- function TimeRangeSelector({ value, onChange, width = 180 }) {
402
- return /* @__PURE__ */ jsx(
403
- CustomSelector,
404
- {
405
- value,
406
- onChange: (newValue) => newValue && onChange(newValue),
407
- data: TIME_RANGE_OPTIONS,
408
- leftSection: /* @__PURE__ */ jsx(IconClock, { size: 16, color: "var(--color-text-subtle)" }),
409
- w: width,
410
- withCheckIcon: true
411
- }
412
- );
413
- }
414
- function TrendIndicator({ current, previous, inverse }) {
415
- const change = previous === 0 ? 0 : (current - previous) / previous * 100;
416
- const isPositive = inverse ? change < 0 : change > 0;
417
- const isFlat = Math.abs(change) < 0.1;
418
- const color = isFlat ? "gray" : isPositive ? "green" : "red";
419
- const Icon = isFlat ? IconMinus : change > 0 ? IconTrendingUp : IconTrendingDown;
420
- return /* @__PURE__ */ jsxs(Group, { gap: 4, children: [
421
- /* @__PURE__ */ jsx(Icon, { size: 12 }),
422
- /* @__PURE__ */ jsx(Badge, { size: "sm", color, variant: "light", children: isFlat ? "No change" : `${isPositive ? "+" : ""}${Math.abs(change).toFixed(1)}%` })
423
- ] });
424
- }
425
- var subtleMarkdownComponents = {
426
- p: ({ children }) => /* @__PURE__ */ jsx(Text, { size: "sm", m: 0, c: "var(--color-text-subtle)", style: { whiteSpace: "pre-wrap" }, children })
427
- };
428
- var subtleMarkdownWrapperStyle = {
429
- display: "flex",
430
- flexDirection: "column",
431
- gap: 8
432
- };
433
- function ContextViewer({ data }) {
434
- return /* @__PURE__ */ jsx(ContextNode, { data, depth: 0 });
435
- }
436
- function ContextNode({ data, depth }) {
437
- if (data === null || data === void 0) {
438
- return /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", fs: "italic", children: "No context provided" });
439
- }
440
- if (typeof data === "string") {
441
- return /* @__PURE__ */ jsx(StyledMarkdown, { components: subtleMarkdownComponents, style: subtleMarkdownWrapperStyle, children: data });
442
- }
443
- if (typeof data === "number" || typeof data === "boolean") {
444
- return /* @__PURE__ */ jsx(Text, { size: "sm", children: String(data) });
445
- }
446
- if (Array.isArray(data)) {
447
- return /* @__PURE__ */ jsx(ArrayView, { items: data, depth });
448
- }
449
- if (typeof data === "object") {
450
- return /* @__PURE__ */ jsx(ObjectView, { data, depth });
451
- }
452
- return /* @__PURE__ */ jsx(Text, { size: "sm", children: String(data) });
453
- }
454
- function formatLabel(key) {
455
- return key.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[_-]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
456
- }
457
- function hasMarkdown(value) {
458
- return /(\*\*.+\*\*|^#{1,6}\s|^\s*[-*]\s|\[.+\]\(.+\)|^\|.+\|$|^>\s|```)/.test(value);
459
- }
460
- function NestedSection({ title, children }) {
461
- const [expanded, setExpanded] = useState(true);
462
- return /* @__PURE__ */ jsxs(Stack, { gap: 6, children: [
463
- /* @__PURE__ */ jsxs(Group, { gap: 4, style: { cursor: "pointer", userSelect: "none" }, onClick: () => setExpanded((v) => !v), children: [
464
- /* @__PURE__ */ jsx(
465
- IconChevronRight,
466
- {
467
- size: 14,
468
- color: "var(--color-primary)",
469
- style: {
470
- transition: "transform 150ms ease",
471
- transform: expanded ? "rotate(90deg)" : "rotate(0deg)",
472
- flexShrink: 0
473
- }
474
- }
475
- ),
476
- /* @__PURE__ */ jsx(Text, { size: "sm", fw: 600, style: { fontFamily: "var(--mantine-font-family-headings)" }, children: title })
477
- ] }),
478
- expanded && /* @__PURE__ */ jsx(Box, { pl: "sm", style: { borderLeft: "2px solid var(--color-border)" }, children })
479
- ] });
480
- }
481
- function PrimitiveValue({ value }) {
482
- if (value === null || value === void 0) {
483
- return /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", fs: "italic", children: "\u2014" });
484
- }
485
- if (typeof value === "boolean") {
486
- return /* @__PURE__ */ jsx(Text, { size: "sm", m: 0, children: value ? "Yes" : "No" });
487
- }
488
- if (typeof value === "number") {
489
- return /* @__PURE__ */ jsx(Text, { size: "sm", m: 0, children: value.toLocaleString() });
490
- }
491
- const str = String(value);
492
- if (hasMarkdown(str)) {
493
- return /* @__PURE__ */ jsx(StyledMarkdown, { components: subtleMarkdownComponents, children: str });
494
- }
495
- return /* @__PURE__ */ jsx(Text, { size: "sm", m: 0, c: "var(--color-text-subtle)", style: { whiteSpace: "pre-wrap" }, children: str });
496
- }
497
- function ArrayView({ items, depth }) {
498
- if (items.length === 0) {
499
- return /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", fs: "italic", children: "Empty list" });
500
- }
501
- const allPrimitive = items.every((item) => typeof item !== "object" || item === null);
502
- if (allPrimitive) {
503
- return /* @__PURE__ */ jsx(Stack, { gap: 2, children: items.map((item, i) => /* @__PURE__ */ jsxs(Group, { gap: "xs", align: "flex-start", children: [
504
- /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", style: { userSelect: "none" }, children: "\u2022" }),
505
- /* @__PURE__ */ jsx(PrimitiveValue, { value: item })
506
- ] }, i)) });
507
- }
508
- return /* @__PURE__ */ jsx(Stack, { gap: "sm", children: items.map((item, i) => /* @__PURE__ */ jsx(Paper, { p: "sm", style: { border: "1px solid var(--color-border)" }, children: /* @__PURE__ */ jsx(ContextNode, { data: item, depth: depth + 1 }) }, i)) });
509
- }
510
- function ObjectView({ data, depth }) {
511
- const entries = Object.entries(data);
512
- if (entries.length === 0) {
513
- return /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", fs: "italic", children: "Empty" });
514
- }
515
- const simpleEntries = [];
516
- const complexEntries = [];
517
- for (const [key, value] of entries) {
518
- if (value === null || value === void 0 || typeof value === "boolean" || typeof value === "number") {
519
- simpleEntries.push([key, value]);
520
- } else if (typeof value === "string") {
521
- if (hasMarkdown(value) || value.length > 120) {
522
- complexEntries.push([key, value]);
523
- } else {
524
- simpleEntries.push([key, value]);
525
- }
526
- } else {
527
- complexEntries.push([key, value]);
528
- }
529
- }
530
- return /* @__PURE__ */ jsxs(Stack, { gap: 10, children: [
531
- simpleEntries.length > 0 && /* @__PURE__ */ jsx(Stack, { gap: 6, children: simpleEntries.map(([key, value]) => /* @__PURE__ */ jsxs(Group, { gap: "sm", align: "flex-start", wrap: "nowrap", children: [
532
- /* @__PURE__ */ jsx(
533
- Text,
534
- {
535
- size: "sm",
536
- style: { minWidth: 140, flexShrink: 0, fontFamily: "var(--mantine-font-family-headings)" },
537
- children: formatLabel(key)
538
- }
539
- ),
540
- /* @__PURE__ */ jsx(PrimitiveValue, { value })
541
- ] }, key)) }),
542
- complexEntries.map(([key, value]) => /* @__PURE__ */ jsx(NestedSection, { title: formatLabel(key), children: /* @__PURE__ */ jsx(ContextNode, { data: value, depth: depth + 1 }) }, key))
543
- ] });
544
- }
545
- var jsonTheme = Object.fromEntries(
546
- Object.entries(oneDark).map(([key, value]) => [
547
- key,
548
- typeof value === "object" && value !== null ? { ...value, background: "none", backgroundColor: "none" } : value
549
- ])
550
- );
551
- function JsonViewer({ data, maxHeight, fontSize = "0.8rem" }) {
552
- const jsonString = typeof data === "string" ? data : JSON.stringify(data, null, 2);
553
- return /* @__PURE__ */ jsx(
554
- Prism,
555
- {
556
- language: "json",
557
- style: jsonTheme,
558
- customStyle: {
559
- margin: 0,
560
- fontSize,
561
- maxHeight,
562
- overflow: maxHeight ? "auto" : void 0,
563
- overflowX: "auto"
564
- },
565
- children: jsonString
566
- }
567
- );
568
- }
569
- function ResourceCard({
570
- resource,
571
- onClick,
572
- layout = "stack",
573
- rightSection,
574
- topSection,
575
- lastRunLabel,
576
- style,
577
- ...rest
578
- }) {
579
- const Icon = getResourceIcon(resource.type);
580
- if (!Icon) {
581
- return /* @__PURE__ */ jsx(Card, { shadow: "sm", withBorder: true, children: /* @__PURE__ */ jsxs(Text, { children: [
582
- "Invalid resource type: ",
583
- resource.type
584
- ] }) });
585
- }
586
- const cardStyle = {
587
- cursor: "pointer",
588
- ...layout === "grid" || layout === "card" ? { transition: "box-shadow var(--duration-fast) var(--easing)" } : {},
589
- ...style
590
- };
591
- const iconSize = layout === "grid" ? 28 : 20;
592
- const details = /* @__PURE__ */ jsxs(Group, { gap: "sm", wrap: "nowrap", children: [
593
- /* @__PURE__ */ jsx(Icon, { size: iconSize, color: "var(--color-primary)" }),
594
- /* @__PURE__ */ jsxs(Stack, { gap: 4, style: { flex: 1, minWidth: 0 }, children: [
595
- /* @__PURE__ */ jsxs(Group, { gap: "xs", align: "center", children: [
596
- /* @__PURE__ */ jsx(
597
- Text,
598
- {
599
- fw: 600,
600
- size: "sm",
601
- style: { fontFamily: "var(--elevasis-font-family-subtitle)" },
602
- ...layout === "stack" ? { lineClamp: 1 } : { truncate: true },
603
- children: resource.name
604
- }
605
- ),
606
- /* @__PURE__ */ jsx(Badge, { variant: "light", size: layout === "grid" ? "xs" : "sm", children: resource.type })
607
- ] }),
608
- resource.description && /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", ...layout === "stack" ? { lineClamp: 1 } : { truncate: true }, children: resource.description }),
609
- /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
610
- resource.version && /* @__PURE__ */ jsxs(Badge, { variant: "outline", size: "xs", children: [
611
- "v",
612
- resource.version
613
- ] }),
614
- /* @__PURE__ */ jsx(Badge, { color: ResourceStatusColors[resource.status], variant: "outline", size: layout === "grid" ? "xs" : "sm", children: resource.status.toUpperCase() })
615
- ] }),
616
- lastRunLabel && /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: lastRunLabel }),
617
- /* @__PURE__ */ jsx(Text, { size: layout === "grid" ? "sm" : "xs", c: "dimmed", ff: "monospace", children: resource.resourceId })
618
- ] })
619
- ] });
620
- if (layout === "card") {
621
- return /* @__PURE__ */ jsx(
622
- Card,
623
- {
624
- withBorder: true,
625
- padding: 0,
626
- style: cardStyle,
627
- onClick: () => onClick(resource),
628
- "data-resource-id": rest["data-resource-id"],
629
- children: /* @__PURE__ */ jsxs(Stack, { gap: 8, p: "sm", pb: "xs", children: [
630
- /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", justify: "space-between", children: [
631
- /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", style: { minWidth: 0 }, children: [
632
- /* @__PURE__ */ jsx(Icon, { size: 20, color: "var(--color-primary)", style: { flexShrink: 0 } }),
633
- /* @__PURE__ */ jsx(Text, { fw: 600, size: "md", style: { fontFamily: "var(--elevasis-font-family-subtitle)" }, truncate: true, children: resource.name })
634
- ] }),
635
- /* @__PURE__ */ jsxs(Group, { gap: 6, wrap: "nowrap", style: { flexShrink: 0 }, children: [
636
- resource.version && /* @__PURE__ */ jsxs(Badge, { variant: "light", size: "sm", children: [
637
- "v",
638
- resource.version
639
- ] }),
640
- /* @__PURE__ */ jsx(Badge, { color: ResourceStatusColors[resource.status], variant: "light", size: "sm", children: resource.status.toUpperCase() })
641
- ] })
642
- ] }),
643
- resource.description && /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", truncate: true, children: resource.description }),
644
- /* @__PURE__ */ jsxs(Group, { gap: "xs", justify: "space-between", wrap: "nowrap", children: [
645
- rightSection || /* @__PURE__ */ jsx("span", {}),
646
- lastRunLabel && /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", style: { whiteSpace: "nowrap" }, children: lastRunLabel })
647
- ] }),
648
- topSection
649
- ] })
650
- }
651
- );
652
- }
653
- if (layout === "row") {
654
- const [hovered, setHovered] = useState(false);
655
- return /* @__PURE__ */ jsx(
656
- Card,
657
- {
658
- padding: 0,
659
- style: {
660
- cursor: "pointer",
661
- border: "1px solid var(--color-border)",
662
- transition: "background 150ms ease",
663
- background: hovered ? "var(--active-background)" : "var(--glass-background)",
664
- ...style
665
- },
666
- onClick: () => onClick(resource),
667
- onMouseEnter: () => setHovered(true),
668
- onMouseLeave: () => setHovered(false),
669
- "data-resource-id": rest["data-resource-id"],
670
- children: /* @__PURE__ */ jsxs(
671
- "div",
672
- {
673
- style: {
674
- display: "grid",
675
- gridTemplateColumns: "18px 200px 120px 1fr 180px 140px 14px",
676
- alignItems: "center",
677
- gap: "var(--mantine-spacing-sm)"
678
- },
679
- children: [
680
- /* @__PURE__ */ jsx(Icon, { size: 18, color: "var(--color-primary)" }),
681
- /* @__PURE__ */ jsx(Text, { fw: 600, size: "md", truncate: true, style: { fontFamily: "var(--elevasis-font-family-subtitle)" }, children: resource.name }),
682
- /* @__PURE__ */ jsxs(Group, { gap: 6, wrap: "nowrap", children: [
683
- resource.version && /* @__PURE__ */ jsxs(Badge, { variant: "light", size: "sm", children: [
684
- "v",
685
- resource.version
686
- ] }),
687
- /* @__PURE__ */ jsx(Badge, { color: ResourceStatusColors[resource.status], variant: "light", size: "sm", children: resource.status.toUpperCase() })
688
- ] }),
689
- /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", truncate: true, style: { minWidth: 0 }, children: resource.description || "" }),
690
- /* @__PURE__ */ jsx("div", { style: { whiteSpace: "nowrap" }, children: rightSection }),
691
- /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", style: { whiteSpace: "nowrap", textAlign: "right" }, children: lastRunLabel || "" }),
692
- /* @__PURE__ */ jsx(
693
- IconChevronRight,
694
- {
695
- size: 14,
696
- style: {
697
- opacity: hovered ? 0.7 : 0,
698
- transition: "opacity 150ms ease"
699
- }
700
- }
701
- )
702
- ]
703
- }
704
- )
705
- }
706
- );
707
- }
708
- if (layout === "grid") {
709
- return /* @__PURE__ */ jsx(
710
- Card,
711
- {
712
- withBorder: true,
713
- padding: "sm",
714
- style: cardStyle,
715
- onClick: () => onClick(resource),
716
- "data-resource-id": rest["data-resource-id"],
717
- children: /* @__PURE__ */ jsxs(Grid, { gutter: "sm", align: "center", children: [
718
- /* @__PURE__ */ jsx(Grid.Col, { span: 8, children: details }),
719
- rightSection && /* @__PURE__ */ jsx(Grid.Col, { span: 4, children: /* @__PURE__ */ jsx(Group, { justify: "flex-end", gap: "md", wrap: "nowrap", children: rightSection }) })
720
- ] })
721
- }
722
- );
723
- }
724
- return /* @__PURE__ */ jsx(
725
- Card,
726
- {
727
- shadow: "sm",
728
- withBorder: true,
729
- style: cardStyle,
730
- onClick: () => onClick(resource),
731
- "data-resource-id": rest["data-resource-id"],
732
- children: /* @__PURE__ */ jsx(Stack, { children: details })
733
- }
734
- );
735
- }
736
-
737
- // src/components/display/ResourceCardAdapters.ts
738
- function catalogItemToResourceDefinition(item) {
739
- return {
740
- resourceId: item.resourceId,
741
- name: item.resourceName,
742
- description: item.description || "",
743
- version: item.version,
744
- type: item.resourceType,
745
- status: item.status
746
- };
747
- }
748
-
749
- export { APIErrorAlert, CollapsibleSection, ContextViewer, CustomSelector, DetailCardSkeleton, EmptyState, JsonViewer, ListSkeleton, NavigationButton, PageNotFound, PageTitleCaption, ResourceCard, StatCard, StatCardSkeleton, StatsCardSkeleton, TabCountBadge, TimeRangeSelector, TrendIndicator, catalogItemToResourceDefinition };