@elevasis/ui 1.26.1 → 1.27.0
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.
- package/dist/charts/index.js +2 -2
- package/dist/{chunk-AWT255UH.js → chunk-2IJCM3VQ.js} +37 -37
- package/dist/chunk-5COLSYBE.js +199 -0
- package/dist/{chunk-RMPXGBNI.js → chunk-5JSR6TL5.js} +2 -2
- package/dist/chunk-BAGYETKM.js +635 -0
- package/dist/{chunk-L3GVDMCA.js → chunk-C27LLJM6.js} +3 -195
- package/dist/{chunk-O4UB5DQQ.js → chunk-F2J7675J.js} +1 -1
- package/dist/chunk-ITCEULI5.js +238 -0
- package/dist/{chunk-4WKWLFBZ.js → chunk-P5EWG45B.js} +1 -1
- package/dist/{chunk-BS4J2LAW.js → chunk-QTD5HPKD.js} +1 -1
- package/dist/{chunk-ZVJKIJFG.js → chunk-RCQPWA5X.js} +13 -42
- package/dist/chunk-TLAIQC7B.js +6382 -0
- package/dist/{chunk-FEZZ3IDU.js → chunk-TXPUIHX2.js} +10 -10
- package/dist/{chunk-L4XXM55J.js → chunk-W4VYXIN7.js} +142 -3
- package/dist/chunk-WJ7W7JU4.js +2115 -0
- package/dist/{chunk-YNGQ7U5H.js → chunk-WLNEJ6JJ.js} +2 -2
- package/dist/{chunk-4INR75ZS.js → chunk-Y2SYGFRF.js} +589 -65
- package/dist/components/index.d.ts +333 -73
- package/dist/components/index.js +838 -686
- package/dist/features/auth/index.d.ts +125 -0
- package/dist/features/auth/index.js +2 -2
- package/dist/features/dashboard/index.d.ts +28 -2
- package/dist/features/dashboard/index.js +21 -635
- package/dist/features/monitoring/index.d.ts +28 -1
- package/dist/features/monitoring/index.js +19 -529
- package/dist/features/operations/index.d.ts +51 -8
- package/dist/features/operations/index.js +25 -3760
- package/dist/features/settings/index.d.ts +153 -1
- package/dist/features/settings/index.js +19 -1438
- package/dist/hooks/index.d.ts +262 -25
- package/dist/hooks/index.js +12 -8
- package/dist/hooks/published.d.ts +137 -25
- package/dist/hooks/published.js +11 -7
- package/dist/index.d.ts +310 -28
- package/dist/index.js +12 -11
- package/dist/initialization/index.d.ts +125 -0
- package/dist/layout/index.d.ts +2 -0
- package/dist/layout/index.js +6 -5
- package/dist/organization/index.js +1 -2
- package/dist/profile/index.d.ts +125 -0
- package/dist/provider/index.d.ts +48 -3
- package/dist/provider/index.js +10 -4
- package/dist/provider/published.d.ts +48 -3
- package/dist/provider/published.js +8 -2
- package/dist/supabase/index.d.ts +242 -0
- package/dist/theme/index.js +2 -2
- package/dist/types/index.d.ts +126 -1
- package/package.json +3 -3
- package/dist/chunk-LR4WVA7W.js +0 -682
- package/dist/chunk-R7WLWGPO.js +0 -126
- package/dist/chunk-TCKIAHDC.js +0 -2626
- package/dist/chunk-V7XHGJQZ.js +0 -145
- package/dist/{chunk-WWEMNIHW.js → chunk-YYBM5LNJ.js} +1 -1
|
@@ -1265,7 +1265,7 @@ var cyberChromePreset = {
|
|
|
1265
1265
|
background: createElement(
|
|
1266
1266
|
Fragment,
|
|
1267
1267
|
null,
|
|
1268
|
-
createElement(CyberBackground, { variant: "chrome", perspectiveGridRadialGlowIntensity:
|
|
1268
|
+
createElement(CyberBackground, { variant: "chrome", perspectiveGridRadialGlowIntensity: 12 }),
|
|
1269
1269
|
createElement(AmbientBloomGrid, { intensity: 0.08, size: 1.2 })
|
|
1270
1270
|
),
|
|
1271
1271
|
light: {
|
|
@@ -1342,7 +1342,7 @@ var cyberVoidPreset = {
|
|
|
1342
1342
|
Fragment,
|
|
1343
1343
|
null,
|
|
1344
1344
|
createElement(CyberBackground, { variant: "void", perspectiveGridRadialGlowIntensity: 16 }),
|
|
1345
|
-
createElement(AmbientBloomGrid, { intensity: 0.
|
|
1345
|
+
createElement(AmbientBloomGrid, { intensity: 0.08, size: 1.2 })
|
|
1346
1346
|
),
|
|
1347
1347
|
light: {
|
|
1348
1348
|
primary: "#2468E0",
|
|
@@ -1359,7 +1359,7 @@ var cyberVoidPreset = {
|
|
|
1359
1359
|
warning: "#FF9100",
|
|
1360
1360
|
success: "#00E676",
|
|
1361
1361
|
glassBackground: "rgba(245, 248, 253, 0.28)",
|
|
1362
|
-
glassBlur: "blur(
|
|
1362
|
+
glassBlur: "blur(10px) saturate(185%)",
|
|
1363
1363
|
shadow: "0px 2px 6px rgba(0, 0, 0, 0.05), 0px 20px 48px -8px rgba(0, 0, 0, 0.14)",
|
|
1364
1364
|
cardShadow: "inset 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.4), 0 1px 3px rgba(0, 0, 0, 0.03), 0 8px 24px -8px rgba(0, 0, 0, 0.06), 0 20px 48px -16px rgba(0, 0, 0, 0.04)",
|
|
1365
1365
|
durationFast: "80ms",
|
|
@@ -1372,7 +1372,7 @@ var cyberVoidPreset = {
|
|
|
1372
1372
|
dark: {
|
|
1373
1373
|
primary: "#2468E0",
|
|
1374
1374
|
primaryContrast: "#ffffff",
|
|
1375
|
-
background: "#
|
|
1375
|
+
background: "#040608",
|
|
1376
1376
|
surface: "transparent",
|
|
1377
1377
|
surfaceHover: "rgba(36, 104, 224, 0.08)",
|
|
1378
1378
|
elevatedSurface: "rgba(16, 19, 24, 0.85)",
|
|
@@ -1384,7 +1384,7 @@ var cyberVoidPreset = {
|
|
|
1384
1384
|
warning: "#FF9100",
|
|
1385
1385
|
success: "#00E676",
|
|
1386
1386
|
glassBackground: "rgba(17, 19, 19, 0.2)",
|
|
1387
|
-
glassBlur: "blur(8px) saturate(
|
|
1387
|
+
glassBlur: "blur(8px) saturate(160%)",
|
|
1388
1388
|
shadow: "0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3), 0 16px 36px -14px rgba(0, 0, 0, 0.4)",
|
|
1389
1389
|
cardShadow: "inset 0 1px 0 rgba(255, 255, 255, 0.04), inset 0 0 0 1px rgba(36, 104, 224, 0.06), 0 4px 4px rgba(0, 0, 0, 0.3), 0 4px 10px rgba(0, 0, 0, 0.35), 0 14px 28px -10px rgba(0, 0, 0, 0.45), 0 24px 20px -16px rgba(0, 0, 0, 0.05)",
|
|
1390
1390
|
durationFast: "80ms",
|
|
@@ -1436,10 +1436,10 @@ var nirvanaPreset = {
|
|
|
1436
1436
|
error: "#cf2e2e",
|
|
1437
1437
|
warning: "#ff6900",
|
|
1438
1438
|
success: "#28a745",
|
|
1439
|
-
glassBackground: "rgba(255, 255, 255, 0.
|
|
1440
|
-
glassBlur: "blur(
|
|
1441
|
-
shadow: "0px 1px 2px rgba(0, 0, 0, 0.
|
|
1442
|
-
cardShadow: "inset 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.4), 0 1px 2px rgba(0, 0, 0, 0.
|
|
1439
|
+
glassBackground: "rgba(255, 255, 255, 0.7)",
|
|
1440
|
+
glassBlur: "blur(20px) saturate(180%)",
|
|
1441
|
+
shadow: "0px 1px 2px rgba(0, 0, 0, 0.64), 0px 8px 24px -8px rgba(242, 56, 1, 0.12)",
|
|
1442
|
+
cardShadow: "inset 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.4), 0 1px 2px rgba(0, 0, 0, 0.15), 0 8px 24px -8px rgba(242, 56, 1, 0.12), 0 24px 48px -16px rgba(242, 56, 1, 0.08)",
|
|
1443
1443
|
durationFast: "150ms",
|
|
1444
1444
|
durationNormal: "250ms",
|
|
1445
1445
|
easing: "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
@@ -1464,7 +1464,7 @@ var nirvanaPreset = {
|
|
|
1464
1464
|
glassBackground: "rgba(26, 26, 28, 0.28)",
|
|
1465
1465
|
glassBlur: "blur(18px) saturate(187%)",
|
|
1466
1466
|
shadow: "0px 1px 2px rgba(0, 0, 0, 0.5), 0px 12px 32px -8px rgba(0, 0, 0, 0.6)",
|
|
1467
|
-
cardShadow: "inset 0 1px 0 rgba(255, 255, 255, 0.03), inset 0 0 0 1px rgba(255, 255, 255, 0.02), 0 4px 14px -2px rgba(0, 0, 0, 0.
|
|
1467
|
+
cardShadow: "inset 0 1px 0 rgba(255, 255, 255, 0.03), inset 0 0 0 1px rgba(255, 255, 255, 0.02), 0 4px 14px -2px rgba(0, 0, 0, 0.5), 0 12px 32px -8px rgba(0, 0, 0, 0.3), 0 32px 64px -16px rgba(0, 0, 0, 0.2)",
|
|
1468
1468
|
durationFast: "150ms",
|
|
1469
1469
|
durationNormal: "250ms",
|
|
1470
1470
|
easing: "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
@@ -1,10 +1,149 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OrganizationContext } from './chunk-DD3CCMCZ.js';
|
|
2
|
+
import { useProfile, useUserProfile } from './chunk-QEPXAWE2.js';
|
|
2
3
|
import { useAuthContext } from './chunk-BRJ3QZ4E.js';
|
|
3
|
-
import { useState, useRef, useEffect, useCallback } from 'react';
|
|
4
|
+
import { useState, useRef, useEffect, useCallback, createElement } from 'react';
|
|
5
|
+
import { useQueryClient } from '@tanstack/react-query';
|
|
4
6
|
import { Button, Loader, Menu, Text, Badge } from '@mantine/core';
|
|
5
7
|
import { IconChevronDown, IconBuilding, IconCheck } from '@tabler/icons-react';
|
|
6
8
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
9
|
|
|
10
|
+
function OrganizationProvider({ apiRequest, children }) {
|
|
11
|
+
const { user, organizationId: workosOrgId } = useAuthContext();
|
|
12
|
+
const { profile } = useProfile();
|
|
13
|
+
const queryClient = useQueryClient();
|
|
14
|
+
const [memberships, setMemberships] = useState([]);
|
|
15
|
+
const [currentWorkOSOrganizationId, setCurrentWorkOSOrganizationId] = useState(null);
|
|
16
|
+
const [currentSupabaseOrganizationId, setCurrentSupabaseOrganizationId] = useState(null);
|
|
17
|
+
const [currentMembership, setCurrentMembership] = useState(null);
|
|
18
|
+
const [isInitializing, setIsInitializing] = useState(true);
|
|
19
|
+
const [isOrgRefreshing, setIsOrgRefreshing] = useState(false);
|
|
20
|
+
const [error, setError] = useState(null);
|
|
21
|
+
const hasInitializedRef = useRef(false);
|
|
22
|
+
const [profileLoaded, setProfileLoaded] = useState(false);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
if (profile !== void 0 && profile !== null) {
|
|
25
|
+
setProfileLoaded(true);
|
|
26
|
+
}
|
|
27
|
+
}, [profile]);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (!user) {
|
|
30
|
+
setMemberships([]);
|
|
31
|
+
setCurrentWorkOSOrganizationId(null);
|
|
32
|
+
setCurrentSupabaseOrganizationId(null);
|
|
33
|
+
setCurrentMembership(null);
|
|
34
|
+
setIsInitializing(false);
|
|
35
|
+
setIsOrgRefreshing(false);
|
|
36
|
+
setError(null);
|
|
37
|
+
hasInitializedRef.current = false;
|
|
38
|
+
setProfileLoaded(false);
|
|
39
|
+
}
|
|
40
|
+
}, [user]);
|
|
41
|
+
const applyMembership = useCallback((membership) => {
|
|
42
|
+
setCurrentMembership(membership);
|
|
43
|
+
setCurrentSupabaseOrganizationId(membership?.organization?.id ?? null);
|
|
44
|
+
setCurrentWorkOSOrganizationId(membership?.organization?.workos_org_id ?? null);
|
|
45
|
+
}, []);
|
|
46
|
+
const selectOrganization = useCallback(
|
|
47
|
+
(data) => {
|
|
48
|
+
let selected = null;
|
|
49
|
+
if (profile?.last_visited_org) {
|
|
50
|
+
selected = data.find((m) => m.organizationId === profile.last_visited_org) ?? null;
|
|
51
|
+
}
|
|
52
|
+
if (!selected && workosOrgId) {
|
|
53
|
+
selected = data.find((m) => m.organization?.workos_org_id === workosOrgId) ?? null;
|
|
54
|
+
}
|
|
55
|
+
if (!selected && data.length > 0) {
|
|
56
|
+
selected = data[0];
|
|
57
|
+
}
|
|
58
|
+
if (selected) {
|
|
59
|
+
applyMembership(selected);
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
[profile?.last_visited_org, workosOrgId, applyMembership]
|
|
63
|
+
);
|
|
64
|
+
const fetchAndInitialize = useCallback(async () => {
|
|
65
|
+
if (!user?.id || !profileLoaded) return;
|
|
66
|
+
setError(null);
|
|
67
|
+
if (memberships.length === 0) {
|
|
68
|
+
setIsInitializing(true);
|
|
69
|
+
} else {
|
|
70
|
+
setIsOrgRefreshing(true);
|
|
71
|
+
}
|
|
72
|
+
try {
|
|
73
|
+
const data = await apiRequest("/memberships/my-memberships");
|
|
74
|
+
if (!Array.isArray(data)) {
|
|
75
|
+
throw new Error("Invalid memberships response");
|
|
76
|
+
}
|
|
77
|
+
setMemberships(data);
|
|
78
|
+
if (data.length === 0) {
|
|
79
|
+
hasInitializedRef.current = true;
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (!currentWorkOSOrganizationId) {
|
|
83
|
+
selectOrganization(data);
|
|
84
|
+
} else {
|
|
85
|
+
const stillPresent = data.find((m) => m.organization?.workos_org_id === currentWorkOSOrganizationId);
|
|
86
|
+
if (!stillPresent) {
|
|
87
|
+
applyMembership(data[0] ?? null);
|
|
88
|
+
} else if (stillPresent.id !== currentMembership?.id) {
|
|
89
|
+
applyMembership(stillPresent);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
hasInitializedRef.current = true;
|
|
93
|
+
} catch (err) {
|
|
94
|
+
setError(err instanceof Error ? err.message : "Failed to load organizations");
|
|
95
|
+
} finally {
|
|
96
|
+
setIsInitializing(false);
|
|
97
|
+
setIsOrgRefreshing(false);
|
|
98
|
+
}
|
|
99
|
+
}, [
|
|
100
|
+
user?.id,
|
|
101
|
+
profileLoaded,
|
|
102
|
+
memberships.length,
|
|
103
|
+
apiRequest,
|
|
104
|
+
currentWorkOSOrganizationId,
|
|
105
|
+
currentMembership?.id,
|
|
106
|
+
selectOrganization,
|
|
107
|
+
applyMembership
|
|
108
|
+
]);
|
|
109
|
+
useEffect(() => {
|
|
110
|
+
if (!user?.id || !profileLoaded || hasInitializedRef.current) return;
|
|
111
|
+
fetchAndInitialize();
|
|
112
|
+
}, [user?.id, profileLoaded, fetchAndInitialize]);
|
|
113
|
+
const switchOrganization = useCallback(
|
|
114
|
+
(workosOrgId2) => {
|
|
115
|
+
const target = memberships.find((m) => m.organization?.workos_org_id === workosOrgId2);
|
|
116
|
+
if (!target) return;
|
|
117
|
+
applyMembership(target);
|
|
118
|
+
void queryClient.invalidateQueries();
|
|
119
|
+
void apiRequest("/users/me", {
|
|
120
|
+
method: "PATCH",
|
|
121
|
+
headers: { "Content-Type": "application/json" },
|
|
122
|
+
body: JSON.stringify({ last_visited_org: target.organizationId })
|
|
123
|
+
}).catch((err) => {
|
|
124
|
+
console.warn("Failed to persist last_visited_org preference:", err);
|
|
125
|
+
});
|
|
126
|
+
},
|
|
127
|
+
[memberships, applyMembership, queryClient, apiRequest]
|
|
128
|
+
);
|
|
129
|
+
const retry = useCallback(async () => {
|
|
130
|
+
hasInitializedRef.current = false;
|
|
131
|
+
setError(null);
|
|
132
|
+
await fetchAndInitialize();
|
|
133
|
+
}, [fetchAndInitialize]);
|
|
134
|
+
const value = {
|
|
135
|
+
currentWorkOSOrganizationId,
|
|
136
|
+
currentSupabaseOrganizationId,
|
|
137
|
+
currentMembership,
|
|
138
|
+
memberships,
|
|
139
|
+
isInitializing,
|
|
140
|
+
isOrgRefreshing,
|
|
141
|
+
error,
|
|
142
|
+
switchOrganization,
|
|
143
|
+
retry
|
|
144
|
+
};
|
|
145
|
+
return createElement(OrganizationContext.Provider, { value }, children);
|
|
146
|
+
}
|
|
8
147
|
function OrganizationSwitcher({
|
|
9
148
|
currentOrganization,
|
|
10
149
|
memberships,
|
|
@@ -346,4 +485,4 @@ function createUseOrgInitialization(useOrganizations, useApiClient) {
|
|
|
346
485
|
};
|
|
347
486
|
}
|
|
348
487
|
|
|
349
|
-
export { OrganizationSwitcher, createOrganizationsSlice, createUseOrgInitialization, createUseOrganizations };
|
|
488
|
+
export { OrganizationProvider, OrganizationSwitcher, createOrganizationsSlice, createUseOrgInitialization, createUseOrganizations };
|