@elevasis/ui 1.19.0 → 1.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/dist/api/index.js +2 -2
  2. package/dist/auth/index.js +3 -3
  3. package/dist/charts/index.css +14 -0
  4. package/dist/charts/index.js +8 -6
  5. package/dist/{chunk-7ATCF6UL.js → chunk-3DIU726S.js} +11 -4
  6. package/dist/chunk-4SY4EQSK.js +68 -0
  7. package/dist/{chunk-2Z7LYTIX.js → chunk-AQ5MQDSS.js} +30 -17
  8. package/dist/chunk-AWMZCYKH.js +639 -0
  9. package/dist/{chunk-BVNAC4SQ.js → chunk-C7AD6N23.js} +38 -48
  10. package/dist/{chunk-ZFCG5SHW.js → chunk-COTI2QPO.js} +1 -1
  11. package/dist/{chunk-WAPZN2U3.js → chunk-EMN755L5.js} +7 -41
  12. package/dist/{chunk-LBY7FVFD.js → chunk-ERVB3QJQ.js} +31 -715
  13. package/dist/chunk-GBMNCNHX.js +105 -0
  14. package/dist/{chunk-MBZDE6UT.js → chunk-IOKL7BKE.js} +9 -1
  15. package/dist/{chunk-35UWYH2A.js → chunk-JFRG2JJE.js} +8 -2
  16. package/dist/chunk-JIABC3AE.js +2622 -0
  17. package/dist/chunk-JZEXFQ6N.js +671 -0
  18. package/dist/chunk-LGKLC5MG.js +44 -0
  19. package/dist/chunk-MG3NF7QL.js +63 -0
  20. package/dist/{chunk-KBLGVZBD.js → chunk-NNKKBSJN.js} +2 -22
  21. package/dist/{chunk-JNBHUCKW.js → chunk-NVOCKXUQ.js} +1 -1
  22. package/dist/chunk-OFAXUZPZ.js +2411 -0
  23. package/dist/chunk-PDHTXPSF.js +12 -0
  24. package/dist/chunk-QJ2S46NI.js +23 -0
  25. package/dist/{chunk-NUULWBAD.js → chunk-R3R367QY.js} +1 -1
  26. package/dist/{chunk-UANJP5P7.js → chunk-R7WLWGPO.js} +5 -5
  27. package/dist/{chunk-CC3SDRIF.js → chunk-RWQIFKMJ.js} +1 -1
  28. package/dist/chunk-UMFPUM7Q.js +1281 -0
  29. package/dist/{chunk-KNJKCD73.js → chunk-VLTVZXP6.js} +4 -4
  30. package/dist/chunk-WWEMNIHW.js +37 -0
  31. package/dist/{chunk-UTWJZEOJ.js → chunk-XOTN3X3Z.js} +3 -3
  32. package/dist/components/index.css +14 -0
  33. package/dist/components/index.d.ts +41 -7
  34. package/dist/components/index.js +564 -5023
  35. package/dist/components/navigation/index.js +2 -63
  36. package/dist/features/auth/index.css +579 -0
  37. package/dist/features/auth/index.d.ts +2557 -0
  38. package/dist/features/auth/index.js +125 -0
  39. package/dist/features/dashboard/index.css +579 -0
  40. package/dist/features/dashboard/index.d.ts +244 -0
  41. package/dist/features/dashboard/index.js +650 -0
  42. package/dist/features/monitoring/index.css +579 -0
  43. package/dist/features/monitoring/index.d.ts +121 -0
  44. package/dist/features/monitoring/index.js +538 -0
  45. package/dist/features/operations/index.css +14 -0
  46. package/dist/features/operations/index.d.ts +1675 -2
  47. package/dist/features/operations/index.js +2148 -28
  48. package/dist/features/settings/index.css +579 -0
  49. package/dist/features/settings/index.d.ts +2589 -0
  50. package/dist/features/settings/index.js +1437 -0
  51. package/dist/hooks/index.css +14 -0
  52. package/dist/hooks/index.d.ts +29 -11
  53. package/dist/hooks/index.js +13 -13
  54. package/dist/hooks/published.css +14 -0
  55. package/dist/hooks/published.d.ts +29 -11
  56. package/dist/hooks/published.js +12 -12
  57. package/dist/index.css +14 -0
  58. package/dist/index.d.ts +41 -12
  59. package/dist/index.js +15 -15
  60. package/dist/initialization/index.js +2 -2
  61. package/dist/layout/index.d.ts +7 -1
  62. package/dist/layout/index.js +7 -5
  63. package/dist/organization/index.js +2 -2
  64. package/dist/provider/index.css +14 -0
  65. package/dist/provider/index.d.ts +1 -1
  66. package/dist/provider/index.js +10 -10
  67. package/dist/provider/published.d.ts +1 -1
  68. package/dist/provider/published.js +6 -6
  69. package/dist/theme/index.d.ts +1 -1
  70. package/dist/theme/index.js +3 -3
  71. package/dist/theme/presets/__tests__/getPreset.test.d.ts +2 -0
  72. package/dist/theme/presets/__tests__/getPreset.test.d.ts.map +1 -0
  73. package/dist/theme/presets/__tests__/getPreset.test.js +92 -0
  74. package/dist/theme/presets/cyber-volt.d.ts +12 -0
  75. package/dist/theme/presets/cyber-volt.d.ts.map +1 -0
  76. package/dist/theme/presets/cyber-volt.js +70 -0
  77. package/dist/theme/presets/regal.d.ts +8 -0
  78. package/dist/theme/presets/regal.d.ts.map +1 -0
  79. package/dist/theme/presets/regal.js +69 -0
  80. package/dist/theme/presets/rose-gold.d.ts +12 -0
  81. package/dist/theme/presets/rose-gold.d.ts.map +1 -0
  82. package/dist/theme/presets/rose-gold.js +76 -0
  83. package/dist/types/index.d.ts +1 -1
  84. package/dist/utils/index.d.ts +12 -1
  85. package/dist/utils/index.js +1 -1
  86. package/dist/zustand/index.d.ts +80 -0
  87. package/dist/zustand/index.js +105 -0
  88. package/package.json +55 -4
  89. package/dist/chunk-2YW3LDFT.js +0 -1542
  90. package/dist/theme/presets/cyber-void.d.ts +0 -12
  91. package/dist/theme/presets/cyber-void.d.ts.map +0 -1
  92. package/dist/theme/presets/cyber-void.js +0 -75
  93. package/dist/{chunk-DVKEEY5J.js → chunk-TUXTSEAF.js} +1 -1
  94. package/dist/{chunk-U2522LSW.js → chunk-V7XHGJQZ.js} +1 -1
package/dist/api/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import '../chunk-XCYKC6OZ.js';
2
- export { ApiClientProvider, useApiClient, useApiClientContext } from '../chunk-JNBHUCKW.js';
3
- import '../chunk-MBZDE6UT.js';
2
+ export { ApiClientProvider, useApiClient, useApiClientContext } from '../chunk-NVOCKXUQ.js';
3
+ import '../chunk-IOKL7BKE.js';
4
4
  import '../chunk-DD3CCMCZ.js';
@@ -1,6 +1,6 @@
1
- export { AdminGuard, ProtectedRoute, useSessionCheck as useRefocusSessionCheck, useSessionCheck } from '../chunk-CC3SDRIF.js';
1
+ export { AdminGuard, ProtectedRoute, useSessionCheck as useRefocusSessionCheck, useSessionCheck } from '../chunk-RWQIFKMJ.js';
2
2
  export { useStableAccessToken } from '../chunk-ALA56RGZ.js';
3
- import '../chunk-DVKEEY5J.js';
4
- import '../chunk-QEPXAWE2.js';
3
+ import '../chunk-TUXTSEAF.js';
5
4
  import '../chunk-DD3CCMCZ.js';
5
+ import '../chunk-QEPXAWE2.js';
6
6
  export { AuthProvider, useAuthContext } from '../chunk-BRJ3QZ4E.js';
@@ -91,6 +91,9 @@
91
91
  animation: chevronPulse 2s ease-in-out infinite;
92
92
  filter: drop-shadow(0 0 1.5px var(--loader-color));
93
93
  }
94
+ [data-mantine-color-scheme=light] .chevron {
95
+ filter: none;
96
+ }
94
97
  .c1 {
95
98
  animation-delay: 0s;
96
99
  }
@@ -110,3 +113,14 @@
110
113
  filter: drop-shadow(0 0 3px var(--loader-color));
111
114
  }
112
115
  }
116
+ [data-mantine-color-scheme=light] .chevron {
117
+ animation-name: chevronPulseLight;
118
+ }
119
+ @keyframes chevronPulseLight {
120
+ 0%, 100% {
121
+ opacity: 0.2;
122
+ }
123
+ 40%, 60% {
124
+ opacity: 1;
125
+ }
126
+ }
@@ -1,14 +1,16 @@
1
- export { ActivityTrendChart, ChartFrame, CombinedTrendChart, CostTrendChart, CyberAreaChart, CyberDonut, CyberDonutTooltip, CyberLegendItem, HeroStatsRow, getSeriesColor, useCyberColors } from '../chunk-LBY7FVFD.js';
2
- import '../chunk-KBLGVZBD.js';
1
+ export { ActivityTrendChart, ChartFrame, CombinedTrendChart, CostTrendChart, CyberAreaChart, CyberDonut, CyberDonutTooltip, CyberLegendItem, HeroStatsRow, getSeriesColor, useCyberColors } from '../chunk-ERVB3QJQ.js';
2
+ import '../chunk-AWMZCYKH.js';
3
+ import '../chunk-NNKKBSJN.js';
4
+ import '../chunk-QJ2S46NI.js';
3
5
  import '../chunk-LXHZYSMQ.js';
4
6
  import '../chunk-MHW43EOH.js';
5
7
  import '../chunk-ELJIFLCB.js';
6
8
  import '../chunk-SZHARWKU.js';
7
- import '../chunk-MBZDE6UT.js';
8
- import '../chunk-CC3SDRIF.js';
9
+ import '../chunk-IOKL7BKE.js';
10
+ import '../chunk-RWQIFKMJ.js';
9
11
  import '../chunk-ALA56RGZ.js';
10
- import '../chunk-DVKEEY5J.js';
11
- import '../chunk-QEPXAWE2.js';
12
+ import '../chunk-TUXTSEAF.js';
12
13
  import '../chunk-DD3CCMCZ.js';
14
+ import '../chunk-QEPXAWE2.js';
13
15
  import '../chunk-BRJ3QZ4E.js';
14
16
  import '../chunk-Q7DJKLEN.js';
@@ -2,12 +2,18 @@ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
2
  import { useComputedColorScheme } from '@mantine/core';
3
3
 
4
4
  // src/components/layout/backgrounds/PerspectiveGrid.tsx
5
+ var SUBTLE_DEFAULT_GLOW = "color-mix(in srgb, color-mix(in srgb, var(--color-primary) 20%, var(--color-border)) 30%, transparent)";
6
+ var PROMINENT_DEFAULT_GLOW = "color-mix(in srgb, var(--color-primary) 22%, transparent)";
5
7
  function PerspectiveGrid({
6
- glowColor = "color-mix(in srgb, color-mix(in srgb, var(--color-primary) 20%, var(--color-border)) 30%, transparent)",
8
+ glowColor: glowColorProp,
7
9
  lineColor: lineColorProp,
10
+ prominentGlow = false,
8
11
  className
9
12
  }) {
10
13
  const lineColor = lineColorProp ?? "color-mix(in srgb, var(--color-border) 50%, transparent)";
14
+ const glowColor = glowColorProp ?? (prominentGlow ? PROMINENT_DEFAULT_GLOW : SUBTLE_DEFAULT_GLOW);
15
+ const glowHeight = prominentGlow ? "70%" : "60%";
16
+ const glowGradient = prominentGlow ? `radial-gradient(ellipse 100% 80% at 50% 110%, ${glowColor} -10%, transparent 50%)` : `radial-gradient(ellipse 90% 75% at 50% 112%, ${glowColor} -15%, transparent 45%)`;
11
17
  return /* @__PURE__ */ jsxs(
12
18
  "div",
13
19
  {
@@ -29,8 +35,8 @@ function PerspectiveGrid({
29
35
  left: "50%",
30
36
  transform: "translateX(-50%)",
31
37
  width: "100%",
32
- height: "60%",
33
- background: `radial-gradient(ellipse 90% 75% at 50% 112%, ${glowColor} -15%, transparent 45%)`,
38
+ height: glowHeight,
39
+ background: glowGradient,
34
40
  pointerEvents: "none"
35
41
  }
36
42
  }
@@ -477,8 +483,9 @@ function CyberParticles({ variant: _variant, className }) {
477
483
  );
478
484
  }
479
485
  function CyberBackground({ variant }) {
486
+ const glowColor = variant === "volt" ? "color-mix(in srgb, var(--color-primary) 12%, transparent)" : void 0;
480
487
  return /* @__PURE__ */ jsxs(Fragment, { children: [
481
- /* @__PURE__ */ jsx(PerspectiveGrid, { lineColor: "var(--color-border)" }),
488
+ /* @__PURE__ */ jsx(PerspectiveGrid, { lineColor: "var(--color-border)", prominentGlow: true, glowColor }),
482
489
  /* @__PURE__ */ jsx(RadiantGlow, {}),
483
490
  /* @__PURE__ */ jsx(FloatingOrbs, {}),
484
491
  /* @__PURE__ */ jsx(CyberParticles, { variant }),
@@ -0,0 +1,68 @@
1
+ import { useCyberColors, CyberLegendItem, CyberAreaChart } from './chunk-ERVB3QJQ.js';
2
+ import { CardHeader, EmptyState } from './chunk-AWMZCYKH.js';
3
+ import { useResourcesHealth } from './chunk-AQ5MQDSS.js';
4
+ import { getTimeRangeDates, formatBucketTime } from './chunk-LXHZYSMQ.js';
5
+ import { Paper, Center, Loader, Group } from '@mantine/core';
6
+ import { IconActivity, IconChartBar } from '@tabler/icons-react';
7
+ import { useMemo } from 'react';
8
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
9
+
10
+ function ResourceHealthPanel({ resourceId, resourceType, timeRange }) {
11
+ const colors = useCyberColors();
12
+ const { startDate, endDate } = useMemo(() => getTimeRangeDates(timeRange), [timeRange]);
13
+ const granularity = ["1h", "24h"].includes(timeRange) ? "hour" : "day";
14
+ const { data, isLoading } = useResourcesHealth({
15
+ resources: [{ entityType: resourceType, entityId: resourceId }],
16
+ startDate,
17
+ endDate,
18
+ granularity
19
+ });
20
+ const resourceHealth = data?.resources?.[0];
21
+ const chartData = useMemo(() => {
22
+ if (!resourceHealth?.trendData) return [];
23
+ return resourceHealth.trendData.map((point) => ({
24
+ time: point.time,
25
+ Success: (point.success || 0) - (point.warning || 0),
26
+ Warning: point.warning || 0,
27
+ Failed: point.failure || 0
28
+ }));
29
+ }, [resourceHealth?.trendData]);
30
+ const xTickFormatter = useMemo(() => (value) => formatBucketTime(value, granularity), [granularity]);
31
+ if (isLoading) {
32
+ return /* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Loader, {}) }) });
33
+ }
34
+ const summary = resourceHealth?.summary;
35
+ return /* @__PURE__ */ jsxs(Paper, { withBorder: true, children: [
36
+ /* @__PURE__ */ jsx(
37
+ CardHeader,
38
+ {
39
+ icon: /* @__PURE__ */ jsx(IconActivity, { size: 18 }),
40
+ title: "Execution Health",
41
+ subtitle: `${summary?.total || 0} executions, ${summary?.successRate?.toFixed(1) || 0}% success rate`
42
+ }
43
+ ),
44
+ chartData.length === 0 ? /* @__PURE__ */ jsx(EmptyState, { icon: IconChartBar, title: "No execution data for this time range" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
45
+ /* @__PURE__ */ jsxs(Group, { gap: "lg", justify: "center", mb: "xs", h: 24, align: "center", children: [
46
+ /* @__PURE__ */ jsx(CyberLegendItem, { color: colors.green, label: "Success" }),
47
+ /* @__PURE__ */ jsx(CyberLegendItem, { color: colors.yellow, label: "Warning" }),
48
+ /* @__PURE__ */ jsx(CyberLegendItem, { color: colors.red, label: "Failed" })
49
+ ] }),
50
+ /* @__PURE__ */ jsx(
51
+ CyberAreaChart,
52
+ {
53
+ data: chartData,
54
+ series: [
55
+ { dataKey: "Success", color: "green", name: "Success" },
56
+ { dataKey: "Warning", color: "yellow", name: "Warning" },
57
+ { dataKey: "Failed", color: "red", name: "Failed" }
58
+ ],
59
+ height: 200,
60
+ yDomain: [0, "auto"],
61
+ xTickFormatter
62
+ }
63
+ )
64
+ ] })
65
+ ] });
66
+ }
67
+
68
+ export { ResourceHealthPanel };
@@ -1,12 +1,12 @@
1
- import { getTimeRangeDates, observabilityKeys } from './chunk-LXHZYSMQ.js';
2
1
  import { useSupabase } from './chunk-NJJ3NQ7B.js';
2
+ import { getTimeRangeDates, observabilityKeys } from './chunk-LXHZYSMQ.js';
3
3
  import { GRAPH_CONSTANTS } from './chunk-F6RBK7NJ.js';
4
- import { useNotificationAdapter } from './chunk-UANJP5P7.js';
5
- import { HTTP_HEADERS } from './chunk-JNBHUCKW.js';
6
- import { STALE_TIME_MONITORING, REFETCH_INTERVAL_DASHBOARD, REFETCH_INTERVAL_RUNNING, WS_MAX_RETRIES_BEFORE_ERROR, WS_RECONNECT_BASE_DELAY, WS_RECONNECT_MAX_DELAY, STALE_TIME_DEFAULT, STALE_TIME_ADMIN } from './chunk-MBZDE6UT.js';
4
+ import { useNotificationAdapter } from './chunk-R7WLWGPO.js';
5
+ import { HTTP_HEADERS } from './chunk-NVOCKXUQ.js';
6
+ import { STALE_TIME_MONITORING, REFETCH_INTERVAL_DASHBOARD, REFETCH_INTERVAL_RUNNING, WS_MAX_RETRIES_BEFORE_ERROR, WS_RECONNECT_BASE_DELAY, WS_RECONNECT_MAX_DELAY, STALE_TIME_DEFAULT, STALE_TIME_ADMIN } from './chunk-IOKL7BKE.js';
7
7
  import { useStableAccessToken } from './chunk-ALA56RGZ.js';
8
- import { useElevasisServices } from './chunk-QEPXAWE2.js';
9
8
  import { useOrganization } from './chunk-DD3CCMCZ.js';
9
+ import { useElevasisServices } from './chunk-QEPXAWE2.js';
10
10
  import { useAuthContext } from './chunk-BRJ3QZ4E.js';
11
11
  import { useQuery, useQueryClient, useMutation, useQueries } from '@tanstack/react-query';
12
12
  import { z } from 'zod';
@@ -891,6 +891,31 @@ function useExecutionHealth({ timeRange }) {
891
891
  // 30s monitoring stale time
892
892
  });
893
893
  }
894
+ function useNotificationCount(args) {
895
+ const { notificationCount, notificationConnected, notificationError } = args;
896
+ const { apiRequest, isReady, organizationId } = useElevasisServices();
897
+ const query = useQuery({
898
+ queryKey: ["notifications", "unread-count", organizationId],
899
+ queryFn: async () => {
900
+ const response = await apiRequest("/notifications/unread-count");
901
+ return response.count;
902
+ },
903
+ enabled: isReady,
904
+ staleTime: Infinity
905
+ // SSE will keep it updated
906
+ });
907
+ return {
908
+ data: notificationCount !== null && notificationCount !== void 0 ? notificationCount : query.data,
909
+ isLoading: query.isLoading,
910
+ isError: query.isError,
911
+ error: query.error,
912
+ isSuccess: query.isSuccess,
913
+ status: query.status,
914
+ refetch: query.refetch,
915
+ sseConnected: notificationConnected,
916
+ sseError: notificationError
917
+ };
918
+ }
894
919
  function useMarkAsRead() {
895
920
  const queryClient = useQueryClient();
896
921
  const { apiRequest } = useElevasisServices();
@@ -928,18 +953,6 @@ function useMarkAllAsRead() {
928
953
  }
929
954
  });
930
955
  }
931
- function useNotificationCount() {
932
- const { apiRequest, isReady, organizationId } = useElevasisServices();
933
- return useQuery({
934
- queryKey: ["notifications", "unread-count", organizationId],
935
- queryFn: async () => {
936
- const response = await apiRequest("/notifications/unread-count");
937
- return response.count;
938
- },
939
- enabled: isReady,
940
- staleTime: 3e4
941
- });
942
- }
943
956
  function useErrorNotification() {
944
957
  const adapter = useNotificationAdapter();
945
958
  return useCallback(