@elevasis/ui 1.0.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/api/index.d.ts +87 -0
- package/dist/api/index.js +3 -0
- package/dist/auth/context.d.ts +19 -0
- package/dist/auth/context.js +1 -0
- package/dist/auth/index.d.ts +85 -0
- package/dist/auth/index.js +3 -0
- package/dist/chunk-3KMDHCAR.js +52 -0
- package/dist/chunk-5UWFGBFM.js +129 -0
- package/dist/chunk-6BJOYF6E.js +8 -0
- package/dist/chunk-6M6OLGQY.js +36 -0
- package/dist/chunk-7AI5ZYJ4.js +202 -0
- package/dist/chunk-7PLEQFHO.js +18 -0
- package/dist/chunk-GDV44UWF.js +138 -0
- package/dist/chunk-GEFB5YIR.js +338 -0
- package/dist/chunk-HBRMWW6V.js +43 -0
- package/dist/chunk-HUWJXLLF.js +681 -0
- package/dist/chunk-J3FALDQE.js +176 -0
- package/dist/chunk-JKERRYVS.js +109 -0
- package/dist/chunk-KA7LO7U5.js +28 -0
- package/dist/chunk-LHQTTUL2.js +27 -0
- package/dist/chunk-MAAS6CGR.js +1299 -0
- package/dist/chunk-NE36BUGQ.js +146 -0
- package/dist/chunk-NGXCFBCS.js +398 -0
- package/dist/chunk-OEYU5O27.js +235 -0
- package/dist/chunk-OUHGHTE7.js +748 -0
- package/dist/chunk-OXVOHOP3.js +661 -0
- package/dist/chunk-PSLKGOBZ.js +58 -0
- package/dist/chunk-PYL4XW6H.js +107 -0
- package/dist/chunk-Q47SPRY7.js +1 -0
- package/dist/chunk-Q7DJKLEN.js +18 -0
- package/dist/chunk-RJCA5672.js +1664 -0
- package/dist/chunk-S66I2PYB.js +748 -0
- package/dist/chunk-W7ZBF5AA.js +1 -0
- package/dist/chunk-WNWKOCGJ.js +1067 -0
- package/dist/chunk-XCYKC6OZ.js +1 -0
- package/dist/chunk-YULUKCS6.js +56 -0
- package/dist/chunk-YZ6GTZXL.js +48 -0
- package/dist/chunk-ZGHDPDTF.js +379 -0
- package/dist/components/command-queue/index.css +53 -0
- package/dist/components/command-queue/index.d.ts +204 -0
- package/dist/components/command-queue/index.js +10 -0
- package/dist/components/forms/index.d.ts +56 -0
- package/dist/components/forms/index.js +2 -0
- package/dist/components/index.css +443 -0
- package/dist/components/index.d.ts +1354 -0
- package/dist/components/index.js +18 -0
- package/dist/components/monitoring/index.d.ts +66 -0
- package/dist/components/monitoring/index.js +2 -0
- package/dist/components/navigation/index.d.ts +54 -0
- package/dist/components/navigation/index.js +91 -0
- package/dist/components/notifications/index.d.ts +52 -0
- package/dist/components/notifications/index.js +4 -0
- package/dist/components/resource-definition/index.css +388 -0
- package/dist/components/resource-definition/index.d.ts +301 -0
- package/dist/components/resource-definition/index.js +3 -0
- package/dist/display/index.css +53 -0
- package/dist/display/index.d.ts +606 -0
- package/dist/display/index.js +6 -0
- package/dist/execution/index.css +388 -0
- package/dist/execution/index.d.ts +1090 -0
- package/dist/execution/index.js +4 -0
- package/dist/graph/index.css +388 -0
- package/dist/graph/index.d.ts +429 -0
- package/dist/graph/index.js +1 -0
- package/dist/hooks/index.d.ts +1927 -0
- package/dist/hooks/index.js +6 -0
- package/dist/hooks/published.d.ts +1653 -0
- package/dist/hooks/published.js +4 -0
- package/dist/index.css +505 -0
- package/dist/index.d.ts +7284 -0
- package/dist/index.js +31 -0
- package/dist/initialization/index.d.ts +2325 -0
- package/dist/initialization/index.js +4 -0
- package/dist/organization/index.d.ts +225 -0
- package/dist/organization/index.js +4 -0
- package/dist/profile/index.d.ts +2265 -0
- package/dist/profile/index.js +3 -0
- package/dist/provider/index.css +61 -0
- package/dist/provider/index.d.ts +291 -0
- package/dist/provider/index.js +7 -0
- package/dist/provider/published.d.ts +198 -0
- package/dist/provider/published.js +6 -0
- package/dist/router/context.d.ts +19 -0
- package/dist/router/context.js +1 -0
- package/dist/router/index.d.ts +31 -0
- package/dist/router/index.js +2 -0
- package/dist/sse/index.d.ts +83 -0
- package/dist/sse/index.js +185 -0
- package/dist/supabase/index.d.ts +4289 -0
- package/dist/supabase/index.js +47 -0
- package/dist/typeform/index.d.ts +458 -0
- package/dist/typeform/index.js +1976 -0
- package/dist/typeform/schemas.d.ts +67 -0
- package/dist/typeform/schemas.js +1 -0
- package/dist/utils/index.d.ts +177 -0
- package/dist/utils/index.js +1 -0
- package/package.json +88 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/* src/theme/custom.css */
|
|
2
|
+
.mantine-Accordion-control:hover {
|
|
3
|
+
background-color: var(--color-surface-hover);
|
|
4
|
+
}
|
|
5
|
+
.mantine-Menu-item:hover:not([data-disabled]) {
|
|
6
|
+
background-color: var(--color-surface-hover);
|
|
7
|
+
}
|
|
8
|
+
.mantine-Select-option:hover {
|
|
9
|
+
background-color: var(--color-surface-hover) !important;
|
|
10
|
+
}
|
|
11
|
+
.mantine-Tabs-tab:hover {
|
|
12
|
+
background-color: var(--color-surface-hover);
|
|
13
|
+
}
|
|
14
|
+
.mantine-Pagination-control:not([data-active]) {
|
|
15
|
+
background: var(--color-surface);
|
|
16
|
+
}
|
|
17
|
+
::-webkit-scrollbar {
|
|
18
|
+
width: 5px;
|
|
19
|
+
height: 5px;
|
|
20
|
+
}
|
|
21
|
+
::-webkit-scrollbar-track {
|
|
22
|
+
background: transparent;
|
|
23
|
+
}
|
|
24
|
+
::-webkit-scrollbar-thumb {
|
|
25
|
+
background: color-mix(in srgb, var(--color-text-subtle) 50%, var(--color-border));
|
|
26
|
+
border-radius: 4px;
|
|
27
|
+
}
|
|
28
|
+
::-webkit-scrollbar-thumb:hover {
|
|
29
|
+
background: var(--color-text-subtle);
|
|
30
|
+
}
|
|
31
|
+
.mantine-Skeleton-root[data-visible]::after {
|
|
32
|
+
background-color: color-mix(in srgb, var(--color-text-subtle) 30%, var(--color-surface)) !important;
|
|
33
|
+
}
|
|
34
|
+
.mantine-Checkbox-input {
|
|
35
|
+
background-color: var(--color-surface);
|
|
36
|
+
border-color: var(--color-border);
|
|
37
|
+
}
|
|
38
|
+
.mantine-Checkbox-input:checked {
|
|
39
|
+
background-color: var(--color-primary);
|
|
40
|
+
border-color: var(--color-primary);
|
|
41
|
+
}
|
|
42
|
+
.mantine-Switch-root:has(input:not(:checked)) .mantine-Switch-track {
|
|
43
|
+
background-color: var(--color-surface-hover);
|
|
44
|
+
border-color: var(--color-border);
|
|
45
|
+
}
|
|
46
|
+
.mantine-Timeline-root {
|
|
47
|
+
--tl-color: var(--color-primary);
|
|
48
|
+
}
|
|
49
|
+
.mantine-Timeline-item {
|
|
50
|
+
--item-border-color: var(--color-border);
|
|
51
|
+
}
|
|
52
|
+
.mantine-Timeline-itemBullet {
|
|
53
|
+
border-color: var(--color-border);
|
|
54
|
+
}
|
|
55
|
+
.mantine-Timeline-itemBullet:where([data-with-child]) {
|
|
56
|
+
background-color: var(--color-primary);
|
|
57
|
+
border-color: var(--color-primary);
|
|
58
|
+
}
|
|
59
|
+
.recharts-surface:focus {
|
|
60
|
+
outline: none;
|
|
61
|
+
}
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { MantineThemeOverride } from '@mantine/core';
|
|
3
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
|
|
6
|
+
type PresetName = 'default' | 'tactical' | 'regal' | 'cyber-volt' | 'aurora' | 'rose-gold' | 'midnight' | 'ember' | 'obsidian' | 'honey' | 'abyss' | 'canopy' | 'slate' | 'cyber-strike' | 'cyber-flux' | 'cyber-void';
|
|
7
|
+
|
|
8
|
+
interface ApiErrorDetails {
|
|
9
|
+
method: string;
|
|
10
|
+
statusCode: number;
|
|
11
|
+
requestId?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** Flat + per-scheme override pattern. Flat values apply to both; `light`/`dark` win over flat. */
|
|
15
|
+
type WithSchemes<T> = T & {
|
|
16
|
+
light?: T;
|
|
17
|
+
dark?: T;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Theme token overrides. Each key maps 1:1 to a CSS variable.
|
|
21
|
+
* All optional — defaults come from Elevasis design system.
|
|
22
|
+
*/
|
|
23
|
+
interface ElevasisTokenOverrides {
|
|
24
|
+
primary?: string;
|
|
25
|
+
/** Text color that contrasts with `primary`. Defaults to '#fff'. */
|
|
26
|
+
primaryContrast?: string;
|
|
27
|
+
background?: string;
|
|
28
|
+
surface?: string;
|
|
29
|
+
surfaceHover?: string;
|
|
30
|
+
text?: string;
|
|
31
|
+
textDimmed?: string;
|
|
32
|
+
textSubtle?: string;
|
|
33
|
+
border?: string;
|
|
34
|
+
error?: string;
|
|
35
|
+
warning?: string;
|
|
36
|
+
success?: string;
|
|
37
|
+
glassBackground?: string;
|
|
38
|
+
glassBlur?: string;
|
|
39
|
+
shadow?: string;
|
|
40
|
+
cardShadow?: string;
|
|
41
|
+
durationFast?: string;
|
|
42
|
+
durationNormal?: string;
|
|
43
|
+
easing?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Core theme config — Mantine-free.
|
|
47
|
+
* Used by ElevasisCoreProvider and as the base for ElevasisThemeConfig.
|
|
48
|
+
*/
|
|
49
|
+
interface ElevasisCoreThemeConfig {
|
|
50
|
+
/** Color scheme: 'light', 'dark', or 'auto'. Defaults to 'dark'. */
|
|
51
|
+
colorScheme?: 'light' | 'dark' | 'auto';
|
|
52
|
+
/** Named preset — bundles light/dark token defaults. Defaults to 'default'. */
|
|
53
|
+
preset?: PresetName;
|
|
54
|
+
/**
|
|
55
|
+
* Semantic token overrides fed into CSS variables.
|
|
56
|
+
* Flat values apply to both schemes. `light`/`dark` nested values win over flat.
|
|
57
|
+
*/
|
|
58
|
+
tokens?: WithSchemes<ElevasisTokenOverrides>;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Theme config passed to ElevasisProvider's `theme` prop.
|
|
62
|
+
*
|
|
63
|
+
* Three levels of customization:
|
|
64
|
+
* 1. `tokens.primary` — most consumers only need this
|
|
65
|
+
* 2. `tokens.*` — override any semantic token, with optional per-scheme values
|
|
66
|
+
* 3. `mantine` — full Mantine theme escape hatch (fonts, spacing, component styles)
|
|
67
|
+
*/
|
|
68
|
+
interface ElevasisThemeConfig extends ElevasisCoreThemeConfig {
|
|
69
|
+
/** Full Mantine theme override — merged on top of Elevasis defaults. */
|
|
70
|
+
mantine?: MantineThemeOverride;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Auth configuration union.
|
|
74
|
+
* 'authkit' (WorkOS AuthKit) and 'oauth' (WorkOS Connect) are implemented.
|
|
75
|
+
* 'apiKey' is defined for forward type compatibility but will throw at runtime.
|
|
76
|
+
*/
|
|
77
|
+
type AuthConfig = AuthKitConfig | OAuthConfig | ApiKeyConfig;
|
|
78
|
+
interface AuthKitConfig {
|
|
79
|
+
mode: 'authkit';
|
|
80
|
+
clientId: string;
|
|
81
|
+
/** AuthKit API hostname. Defaults to 'api.workos.com'. */
|
|
82
|
+
apiHostname?: string;
|
|
83
|
+
/** Redirect URI after auth. */
|
|
84
|
+
redirectUri?: string;
|
|
85
|
+
/** Keep refresh tokens in localStorage. Defaults to false. */
|
|
86
|
+
devMode?: boolean;
|
|
87
|
+
}
|
|
88
|
+
/** OAuth config for "Sign in with Elevasis" via WorkOS Connect. */
|
|
89
|
+
interface OAuthConfig {
|
|
90
|
+
mode: 'oauth';
|
|
91
|
+
clientId: string;
|
|
92
|
+
redirectUri: string;
|
|
93
|
+
/** Persist tokens in sessionStorage. Default is memory-only. */
|
|
94
|
+
tokenStorage?: 'session';
|
|
95
|
+
/** Pre-select organization in WorkOS flow. */
|
|
96
|
+
organizationId?: string;
|
|
97
|
+
}
|
|
98
|
+
/** Deferred -- will throw at runtime. */
|
|
99
|
+
interface ApiKeyConfig {
|
|
100
|
+
mode: 'apiKey';
|
|
101
|
+
key: string;
|
|
102
|
+
}
|
|
103
|
+
interface ElevasisCoreProviderProps {
|
|
104
|
+
/** Auth configuration. Supports 'authkit' and 'oauth' modes. */
|
|
105
|
+
auth: AuthConfig;
|
|
106
|
+
/**
|
|
107
|
+
* Elevasis core theme configuration (Mantine-free).
|
|
108
|
+
* Set `colorScheme` ('light', 'dark', 'auto') and override `tokens` (design tokens).
|
|
109
|
+
* Defaults: colorScheme='dark', Elevasis design system tokens.
|
|
110
|
+
*/
|
|
111
|
+
theme?: ElevasisCoreThemeConfig;
|
|
112
|
+
/**
|
|
113
|
+
* Override organization ID resolution.
|
|
114
|
+
* Command-center passes Zustand-managed org ID here.
|
|
115
|
+
* SDK consumers typically omit this (auto-resolved from JWT/API key).
|
|
116
|
+
*/
|
|
117
|
+
organizationId?: string | null;
|
|
118
|
+
/** Custom QueryClient. If omitted, a default is created internally. */
|
|
119
|
+
queryClient?: QueryClient;
|
|
120
|
+
/**
|
|
121
|
+
* API base URL (e.g., 'https://api.elevasis.com' or 'http://localhost:5170').
|
|
122
|
+
* When provided, ElevasisCoreProvider composes ApiClientProvider + ElevasisServiceProvider internally.
|
|
123
|
+
* When omitted, no service context is provided (theme-only mode).
|
|
124
|
+
*/
|
|
125
|
+
apiUrl?: string;
|
|
126
|
+
/**
|
|
127
|
+
* Error callback for API responses with status >= 500.
|
|
128
|
+
* Only used when apiUrl is provided.
|
|
129
|
+
*/
|
|
130
|
+
onError?: (endpoint: string, error: Error, details?: ApiErrorDetails) => void;
|
|
131
|
+
/**
|
|
132
|
+
* Override organization readiness check.
|
|
133
|
+
* Defaults to `!!organizationId` if not provided.
|
|
134
|
+
* Command-center passes `!!currentMembership` for its stricter readiness requirement.
|
|
135
|
+
*/
|
|
136
|
+
isOrganizationReady?: boolean;
|
|
137
|
+
children: ReactNode;
|
|
138
|
+
}
|
|
139
|
+
interface ElevasisProviderProps {
|
|
140
|
+
/** Auth configuration. Supports 'authkit' and 'oauth' modes. */
|
|
141
|
+
auth: AuthConfig;
|
|
142
|
+
/**
|
|
143
|
+
* Elevasis theme configuration.
|
|
144
|
+
* Set `colorScheme` ('light', 'dark', 'auto') and override `tokens` (design tokens).
|
|
145
|
+
* Defaults: colorScheme='auto', Elevasis design system tokens.
|
|
146
|
+
*/
|
|
147
|
+
theme?: ElevasisThemeConfig;
|
|
148
|
+
/**
|
|
149
|
+
* Override organization ID resolution.
|
|
150
|
+
* Command-center passes Zustand-managed org ID here.
|
|
151
|
+
* SDK consumers typically omit this (auto-resolved from JWT/API key).
|
|
152
|
+
*/
|
|
153
|
+
organizationId?: string | null;
|
|
154
|
+
/** Custom QueryClient. If omitted, a default is created internally. */
|
|
155
|
+
queryClient?: QueryClient;
|
|
156
|
+
/**
|
|
157
|
+
* API base URL (e.g., 'https://api.elevasis.com' or 'http://localhost:5170').
|
|
158
|
+
* When provided, ElevasisProvider composes ApiClientProvider + ElevasisServiceProvider internally.
|
|
159
|
+
* When omitted, no service context is provided (theme-only mode).
|
|
160
|
+
*/
|
|
161
|
+
apiUrl?: string;
|
|
162
|
+
/**
|
|
163
|
+
* Error callback for API responses with status >= 500.
|
|
164
|
+
* Only used when apiUrl is provided.
|
|
165
|
+
*/
|
|
166
|
+
onError?: (endpoint: string, error: Error, details?: ApiErrorDetails) => void;
|
|
167
|
+
/**
|
|
168
|
+
* Override organization readiness check.
|
|
169
|
+
* Defaults to `!!organizationId` if not provided.
|
|
170
|
+
* Command-center passes `!!currentMembership` for its stricter readiness requirement.
|
|
171
|
+
*/
|
|
172
|
+
isOrganizationReady?: boolean;
|
|
173
|
+
children: ReactNode;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Service context value exposed by ElevasisServiceProvider.
|
|
177
|
+
* Provides a ready-to-use apiRequest function and organization state.
|
|
178
|
+
*
|
|
179
|
+
* For standalone usage (testing, embedding), use ElevasisServiceProvider directly.
|
|
180
|
+
* For standard SDK usage, ElevasisProvider composes this automatically when apiUrl is provided.
|
|
181
|
+
*/
|
|
182
|
+
interface ElevasisServiceContextValue {
|
|
183
|
+
apiRequest: <T>(endpoint: string, options?: RequestInit) => Promise<T>;
|
|
184
|
+
organizationId: string | null;
|
|
185
|
+
isReady: boolean;
|
|
186
|
+
}
|
|
187
|
+
interface ElevasisServiceProviderProps {
|
|
188
|
+
apiRequest: <T>(endpoint: string, options?: RequestInit) => Promise<T>;
|
|
189
|
+
organizationId: string | null;
|
|
190
|
+
isReady: boolean;
|
|
191
|
+
children: ReactNode;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* UI provider for Elevasis-powered applications. Includes Mantine theme integration.
|
|
196
|
+
*
|
|
197
|
+
* Composes: MantineThemeProvider + QueryClientProvider + auth provider +
|
|
198
|
+
* auth bridge. When apiUrl is provided, also composes
|
|
199
|
+
* ApiClientProvider + ElevasisServiceProvider.
|
|
200
|
+
*
|
|
201
|
+
* Supports authkit and oauth modes. apiKey mode will throw until implemented.
|
|
202
|
+
*
|
|
203
|
+
* @example Command-center (dogfooding)
|
|
204
|
+
* ```tsx
|
|
205
|
+
* <ElevasisUIProvider
|
|
206
|
+
* auth={{ mode: 'authkit', clientId: '...', redirectUri: '/auth-redirect' }}
|
|
207
|
+
* organizationId={currentWorkOSOrganizationId}
|
|
208
|
+
* isOrganizationReady={!!currentMembership}
|
|
209
|
+
* apiUrl={import.meta.env.VITE_API_SERVER}
|
|
210
|
+
* onError={handleApiError}
|
|
211
|
+
* queryClient={queryClient}
|
|
212
|
+
* >
|
|
213
|
+
* <AuthenticatedApp />
|
|
214
|
+
* </ElevasisUIProvider>
|
|
215
|
+
* ```
|
|
216
|
+
*
|
|
217
|
+
* @example SDK consumer (simple)
|
|
218
|
+
* ```tsx
|
|
219
|
+
* <ElevasisUIProvider
|
|
220
|
+
* auth={{ mode: 'authkit', clientId: '...', redirectUri: '/' }}
|
|
221
|
+
* apiUrl="https://api.elevasis.com"
|
|
222
|
+
* >
|
|
223
|
+
* <Dashboard />
|
|
224
|
+
* </ElevasisUIProvider>
|
|
225
|
+
* ```
|
|
226
|
+
*
|
|
227
|
+
* @example Theme-only mode (no API)
|
|
228
|
+
* ```tsx
|
|
229
|
+
* <ElevasisUIProvider auth={{ mode: 'authkit', clientId: '...' }}>
|
|
230
|
+
* <ThemedContent />
|
|
231
|
+
* </ElevasisUIProvider>
|
|
232
|
+
* ```
|
|
233
|
+
*/
|
|
234
|
+
declare function ElevasisUIProvider({ auth, theme, organizationId, queryClient, apiUrl, onError, isOrganizationReady, children }: ElevasisProviderProps): react_jsx_runtime.JSX.Element;
|
|
235
|
+
/** @deprecated Use ElevasisUIProvider instead. Alias kept for backwards compatibility. */
|
|
236
|
+
declare const ElevasisProvider: typeof ElevasisUIProvider;
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Headless root provider for Elevasis-powered applications.
|
|
240
|
+
*
|
|
241
|
+
* Same capabilities as ElevasisUIProvider but without any Mantine dependency.
|
|
242
|
+
* Injects CSS variables via a `<style>` tag and sets `data-elevasis-scheme`
|
|
243
|
+
* on the `<html>` element.
|
|
244
|
+
*
|
|
245
|
+
* Composes: QueryClientProvider + auth provider + auth bridge.
|
|
246
|
+
* When apiUrl is provided, also composes ApiClientProvider + ElevasisServiceProvider.
|
|
247
|
+
*
|
|
248
|
+
* @example Headless SDK consumer
|
|
249
|
+
* ```tsx
|
|
250
|
+
* <ElevasisCoreProvider
|
|
251
|
+
* auth={{ mode: 'authkit', clientId: '...', redirectUri: '/' }}
|
|
252
|
+
* theme={{ colorScheme: 'dark', preset: 'default' }}
|
|
253
|
+
* apiUrl="https://api.elevasis.com"
|
|
254
|
+
* >
|
|
255
|
+
* <Dashboard />
|
|
256
|
+
* </ElevasisCoreProvider>
|
|
257
|
+
* ```
|
|
258
|
+
*/
|
|
259
|
+
declare function ElevasisCoreProvider({ auth, theme, organizationId, queryClient, apiUrl, onError, isOrganizationReady, children }: ElevasisCoreProviderProps): react_jsx_runtime.JSX.Element;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Hook to access the ElevasisServiceProvider context.
|
|
263
|
+
* Provides apiRequest, organizationId, and isReady.
|
|
264
|
+
*
|
|
265
|
+
* Throws if used outside of an ElevasisServiceProvider or ElevasisProvider (with apiUrl).
|
|
266
|
+
*/
|
|
267
|
+
declare function useElevasisServices(): ElevasisServiceContextValue;
|
|
268
|
+
/**
|
|
269
|
+
* Standalone service provider for testing, embedding, or advanced consumers.
|
|
270
|
+
*
|
|
271
|
+
* Accepts apiRequest, organizationId, and isReady directly as props.
|
|
272
|
+
* ElevasisProvider composes this internally when apiUrl is provided.
|
|
273
|
+
*
|
|
274
|
+
* @example Testing
|
|
275
|
+
* ```tsx
|
|
276
|
+
* <ElevasisServiceProvider apiRequest={mockApiRequest} organizationId="org-1" isReady={true}>
|
|
277
|
+
* <ComponentUnderTest />
|
|
278
|
+
* </ElevasisServiceProvider>
|
|
279
|
+
* ```
|
|
280
|
+
*
|
|
281
|
+
* @example Embedding
|
|
282
|
+
* ```tsx
|
|
283
|
+
* <ElevasisServiceProvider apiRequest={myFetcher} organizationId={orgId} isReady={!!orgId}>
|
|
284
|
+
* <CommandQueuePanel />
|
|
285
|
+
* </ElevasisServiceProvider>
|
|
286
|
+
* ```
|
|
287
|
+
*/
|
|
288
|
+
declare function ElevasisServiceProvider({ apiRequest, organizationId, isReady, children }: ElevasisServiceProviderProps): react_jsx_runtime.JSX.Element;
|
|
289
|
+
|
|
290
|
+
export { ElevasisCoreProvider, ElevasisProvider, ElevasisServiceProvider, ElevasisUIProvider, useElevasisServices };
|
|
291
|
+
export type { ApiKeyConfig, AuthConfig, AuthKitConfig, ElevasisCoreProviderProps, ElevasisCoreThemeConfig, ElevasisProviderProps, ElevasisServiceContextValue, ElevasisServiceProviderProps, ElevasisThemeConfig, ElevasisTokenOverrides, OAuthConfig, PresetName, WithSchemes };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { ElevasisProvider, ElevasisUIProvider } from '../chunk-NGXCFBCS.js';
|
|
2
|
+
export { ElevasisCoreProvider } from '../chunk-MAAS6CGR.js';
|
|
3
|
+
import '../chunk-GDV44UWF.js';
|
|
4
|
+
export { ElevasisServiceProvider, useElevasisServices } from '../chunk-KA7LO7U5.js';
|
|
5
|
+
import '../chunk-7AI5ZYJ4.js';
|
|
6
|
+
import '../chunk-OEYU5O27.js';
|
|
7
|
+
import '../chunk-7PLEQFHO.js';
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
|
|
5
|
+
type PresetName = 'default' | 'tactical' | 'regal' | 'cyber-volt' | 'aurora' | 'rose-gold' | 'midnight' | 'ember' | 'obsidian' | 'honey' | 'abyss' | 'canopy' | 'slate' | 'cyber-strike' | 'cyber-flux' | 'cyber-void';
|
|
6
|
+
|
|
7
|
+
interface ApiErrorDetails {
|
|
8
|
+
method: string;
|
|
9
|
+
statusCode: number;
|
|
10
|
+
requestId?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Flat + per-scheme override pattern. Flat values apply to both; `light`/`dark` win over flat. */
|
|
14
|
+
type WithSchemes<T> = T & {
|
|
15
|
+
light?: T;
|
|
16
|
+
dark?: T;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Theme token overrides. Each key maps 1:1 to a CSS variable.
|
|
20
|
+
* All optional — defaults come from Elevasis design system.
|
|
21
|
+
*/
|
|
22
|
+
interface ElevasisTokenOverrides {
|
|
23
|
+
primary?: string;
|
|
24
|
+
/** Text color that contrasts with `primary`. Defaults to '#fff'. */
|
|
25
|
+
primaryContrast?: string;
|
|
26
|
+
background?: string;
|
|
27
|
+
surface?: string;
|
|
28
|
+
surfaceHover?: string;
|
|
29
|
+
text?: string;
|
|
30
|
+
textDimmed?: string;
|
|
31
|
+
textSubtle?: string;
|
|
32
|
+
border?: string;
|
|
33
|
+
error?: string;
|
|
34
|
+
warning?: string;
|
|
35
|
+
success?: string;
|
|
36
|
+
glassBackground?: string;
|
|
37
|
+
glassBlur?: string;
|
|
38
|
+
shadow?: string;
|
|
39
|
+
cardShadow?: string;
|
|
40
|
+
durationFast?: string;
|
|
41
|
+
durationNormal?: string;
|
|
42
|
+
easing?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Core theme config — Mantine-free.
|
|
46
|
+
* Used by ElevasisCoreProvider and as the base for ElevasisThemeConfig.
|
|
47
|
+
*/
|
|
48
|
+
interface ElevasisCoreThemeConfig {
|
|
49
|
+
/** Color scheme: 'light', 'dark', or 'auto'. Defaults to 'dark'. */
|
|
50
|
+
colorScheme?: 'light' | 'dark' | 'auto';
|
|
51
|
+
/** Named preset — bundles light/dark token defaults. Defaults to 'default'. */
|
|
52
|
+
preset?: PresetName;
|
|
53
|
+
/**
|
|
54
|
+
* Semantic token overrides fed into CSS variables.
|
|
55
|
+
* Flat values apply to both schemes. `light`/`dark` nested values win over flat.
|
|
56
|
+
*/
|
|
57
|
+
tokens?: WithSchemes<ElevasisTokenOverrides>;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Auth configuration union.
|
|
61
|
+
* 'authkit' (WorkOS AuthKit) and 'oauth' (WorkOS Connect) are implemented.
|
|
62
|
+
* 'apiKey' is defined for forward type compatibility but will throw at runtime.
|
|
63
|
+
*/
|
|
64
|
+
type AuthConfig = AuthKitConfig | OAuthConfig | ApiKeyConfig;
|
|
65
|
+
interface AuthKitConfig {
|
|
66
|
+
mode: 'authkit';
|
|
67
|
+
clientId: string;
|
|
68
|
+
/** AuthKit API hostname. Defaults to 'api.workos.com'. */
|
|
69
|
+
apiHostname?: string;
|
|
70
|
+
/** Redirect URI after auth. */
|
|
71
|
+
redirectUri?: string;
|
|
72
|
+
/** Keep refresh tokens in localStorage. Defaults to false. */
|
|
73
|
+
devMode?: boolean;
|
|
74
|
+
}
|
|
75
|
+
/** OAuth config for "Sign in with Elevasis" via WorkOS Connect. */
|
|
76
|
+
interface OAuthConfig {
|
|
77
|
+
mode: 'oauth';
|
|
78
|
+
clientId: string;
|
|
79
|
+
redirectUri: string;
|
|
80
|
+
/** Persist tokens in sessionStorage. Default is memory-only. */
|
|
81
|
+
tokenStorage?: 'session';
|
|
82
|
+
/** Pre-select organization in WorkOS flow. */
|
|
83
|
+
organizationId?: string;
|
|
84
|
+
}
|
|
85
|
+
/** Deferred -- will throw at runtime. */
|
|
86
|
+
interface ApiKeyConfig {
|
|
87
|
+
mode: 'apiKey';
|
|
88
|
+
key: string;
|
|
89
|
+
}
|
|
90
|
+
interface ElevasisCoreProviderProps {
|
|
91
|
+
/** Auth configuration. Supports 'authkit' and 'oauth' modes. */
|
|
92
|
+
auth: AuthConfig;
|
|
93
|
+
/**
|
|
94
|
+
* Elevasis core theme configuration (Mantine-free).
|
|
95
|
+
* Set `colorScheme` ('light', 'dark', 'auto') and override `tokens` (design tokens).
|
|
96
|
+
* Defaults: colorScheme='dark', Elevasis design system tokens.
|
|
97
|
+
*/
|
|
98
|
+
theme?: ElevasisCoreThemeConfig;
|
|
99
|
+
/**
|
|
100
|
+
* Override organization ID resolution.
|
|
101
|
+
* Command-center passes Zustand-managed org ID here.
|
|
102
|
+
* SDK consumers typically omit this (auto-resolved from JWT/API key).
|
|
103
|
+
*/
|
|
104
|
+
organizationId?: string | null;
|
|
105
|
+
/** Custom QueryClient. If omitted, a default is created internally. */
|
|
106
|
+
queryClient?: QueryClient;
|
|
107
|
+
/**
|
|
108
|
+
* API base URL (e.g., 'https://api.elevasis.com' or 'http://localhost:5170').
|
|
109
|
+
* When provided, ElevasisCoreProvider composes ApiClientProvider + ElevasisServiceProvider internally.
|
|
110
|
+
* When omitted, no service context is provided (theme-only mode).
|
|
111
|
+
*/
|
|
112
|
+
apiUrl?: string;
|
|
113
|
+
/**
|
|
114
|
+
* Error callback for API responses with status >= 500.
|
|
115
|
+
* Only used when apiUrl is provided.
|
|
116
|
+
*/
|
|
117
|
+
onError?: (endpoint: string, error: Error, details?: ApiErrorDetails) => void;
|
|
118
|
+
/**
|
|
119
|
+
* Override organization readiness check.
|
|
120
|
+
* Defaults to `!!organizationId` if not provided.
|
|
121
|
+
* Command-center passes `!!currentMembership` for its stricter readiness requirement.
|
|
122
|
+
*/
|
|
123
|
+
isOrganizationReady?: boolean;
|
|
124
|
+
children: ReactNode;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Service context value exposed by ElevasisServiceProvider.
|
|
128
|
+
* Provides a ready-to-use apiRequest function and organization state.
|
|
129
|
+
*
|
|
130
|
+
* For standalone usage (testing, embedding), use ElevasisServiceProvider directly.
|
|
131
|
+
* For standard SDK usage, ElevasisProvider composes this automatically when apiUrl is provided.
|
|
132
|
+
*/
|
|
133
|
+
interface ElevasisServiceContextValue {
|
|
134
|
+
apiRequest: <T>(endpoint: string, options?: RequestInit) => Promise<T>;
|
|
135
|
+
organizationId: string | null;
|
|
136
|
+
isReady: boolean;
|
|
137
|
+
}
|
|
138
|
+
interface ElevasisServiceProviderProps {
|
|
139
|
+
apiRequest: <T>(endpoint: string, options?: RequestInit) => Promise<T>;
|
|
140
|
+
organizationId: string | null;
|
|
141
|
+
isReady: boolean;
|
|
142
|
+
children: ReactNode;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Headless root provider for Elevasis-powered applications.
|
|
147
|
+
*
|
|
148
|
+
* Same capabilities as ElevasisUIProvider but without any Mantine dependency.
|
|
149
|
+
* Injects CSS variables via a `<style>` tag and sets `data-elevasis-scheme`
|
|
150
|
+
* on the `<html>` element.
|
|
151
|
+
*
|
|
152
|
+
* Composes: QueryClientProvider + auth provider + auth bridge.
|
|
153
|
+
* When apiUrl is provided, also composes ApiClientProvider + ElevasisServiceProvider.
|
|
154
|
+
*
|
|
155
|
+
* @example Headless SDK consumer
|
|
156
|
+
* ```tsx
|
|
157
|
+
* <ElevasisCoreProvider
|
|
158
|
+
* auth={{ mode: 'authkit', clientId: '...', redirectUri: '/' }}
|
|
159
|
+
* theme={{ colorScheme: 'dark', preset: 'default' }}
|
|
160
|
+
* apiUrl="https://api.elevasis.com"
|
|
161
|
+
* >
|
|
162
|
+
* <Dashboard />
|
|
163
|
+
* </ElevasisCoreProvider>
|
|
164
|
+
* ```
|
|
165
|
+
*/
|
|
166
|
+
declare function ElevasisCoreProvider({ auth, theme, organizationId, queryClient, apiUrl, onError, isOrganizationReady, children }: ElevasisCoreProviderProps): react_jsx_runtime.JSX.Element;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Hook to access the ElevasisServiceProvider context.
|
|
170
|
+
* Provides apiRequest, organizationId, and isReady.
|
|
171
|
+
*
|
|
172
|
+
* Throws if used outside of an ElevasisServiceProvider or ElevasisProvider (with apiUrl).
|
|
173
|
+
*/
|
|
174
|
+
declare function useElevasisServices(): ElevasisServiceContextValue;
|
|
175
|
+
/**
|
|
176
|
+
* Standalone service provider for testing, embedding, or advanced consumers.
|
|
177
|
+
*
|
|
178
|
+
* Accepts apiRequest, organizationId, and isReady directly as props.
|
|
179
|
+
* ElevasisProvider composes this internally when apiUrl is provided.
|
|
180
|
+
*
|
|
181
|
+
* @example Testing
|
|
182
|
+
* ```tsx
|
|
183
|
+
* <ElevasisServiceProvider apiRequest={mockApiRequest} organizationId="org-1" isReady={true}>
|
|
184
|
+
* <ComponentUnderTest />
|
|
185
|
+
* </ElevasisServiceProvider>
|
|
186
|
+
* ```
|
|
187
|
+
*
|
|
188
|
+
* @example Embedding
|
|
189
|
+
* ```tsx
|
|
190
|
+
* <ElevasisServiceProvider apiRequest={myFetcher} organizationId={orgId} isReady={!!orgId}>
|
|
191
|
+
* <CommandQueuePanel />
|
|
192
|
+
* </ElevasisServiceProvider>
|
|
193
|
+
* ```
|
|
194
|
+
*/
|
|
195
|
+
declare function ElevasisServiceProvider({ apiRequest, organizationId, isReady, children }: ElevasisServiceProviderProps): react_jsx_runtime.JSX.Element;
|
|
196
|
+
|
|
197
|
+
export { ElevasisCoreProvider, ElevasisServiceProvider, useElevasisServices };
|
|
198
|
+
export type { ApiKeyConfig, AuthConfig, AuthKitConfig, ElevasisCoreProviderProps, ElevasisCoreThemeConfig, ElevasisServiceContextValue, ElevasisServiceProviderProps, ElevasisTokenOverrides, OAuthConfig, WithSchemes };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { ElevasisCoreProvider } from '../chunk-MAAS6CGR.js';
|
|
2
|
+
import '../chunk-GDV44UWF.js';
|
|
3
|
+
export { ElevasisServiceProvider, useElevasisServices } from '../chunk-KA7LO7U5.js';
|
|
4
|
+
import '../chunk-7AI5ZYJ4.js';
|
|
5
|
+
import '../chunk-OEYU5O27.js';
|
|
6
|
+
import '../chunk-7PLEQFHO.js';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { AnchorHTMLAttributes, ElementType, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
5
|
+
to: string;
|
|
6
|
+
}
|
|
7
|
+
interface RouterAdapter {
|
|
8
|
+
currentPath: string;
|
|
9
|
+
navigate: (to: string) => void;
|
|
10
|
+
Link: ElementType<LinkProps>;
|
|
11
|
+
}
|
|
12
|
+
declare function useRouterContext(): RouterAdapter;
|
|
13
|
+
declare function RouterProvider({ value, children }: {
|
|
14
|
+
value: RouterAdapter;
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
}): react.FunctionComponentElement<react.ProviderProps<RouterAdapter | null>>;
|
|
17
|
+
|
|
18
|
+
export { RouterProvider, useRouterContext };
|
|
19
|
+
export type { LinkProps, RouterAdapter };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RouterProvider, useRouterContext } from '../chunk-Q7DJKLEN.js';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { AnchorHTMLAttributes, ElementType, ReactNode } from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
6
|
+
to: string;
|
|
7
|
+
}
|
|
8
|
+
interface RouterAdapter {
|
|
9
|
+
currentPath: string;
|
|
10
|
+
navigate: (to: string) => void;
|
|
11
|
+
Link: ElementType<LinkProps>;
|
|
12
|
+
}
|
|
13
|
+
declare function useRouterContext(): RouterAdapter;
|
|
14
|
+
declare function RouterProvider({ value, children }: {
|
|
15
|
+
value: RouterAdapter;
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
}): react.FunctionComponentElement<react.ProviderProps<RouterAdapter | null>>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Bridge component that reads TanStack Router state and provides it
|
|
21
|
+
* via the generic RouterContext. Place inside TanStack's RouterProvider.
|
|
22
|
+
*
|
|
23
|
+
* Uses useMemo to stabilize the adapter value and prevent unnecessary
|
|
24
|
+
* re-renders in downstream components.
|
|
25
|
+
*/
|
|
26
|
+
declare function TanStackRouterBridge({ children }: {
|
|
27
|
+
children: ReactNode;
|
|
28
|
+
}): react_jsx_runtime.JSX.Element;
|
|
29
|
+
|
|
30
|
+
export { RouterProvider, TanStackRouterBridge, useRouterContext };
|
|
31
|
+
export type { LinkProps, RouterAdapter };
|