@elevasis/ui 2.23.0 → 2.25.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.
Files changed (57) hide show
  1. package/dist/app/index.d.ts +2915 -0
  2. package/dist/app/index.js +5 -4
  3. package/dist/{chunk-7PGEGSUM.js → chunk-7D2HSSIW.js} +2 -2
  4. package/dist/{chunk-YU6MBDVO.js → chunk-ABV5LDDC.js} +4 -68
  5. package/dist/chunk-AZXSFDG2.js +474 -0
  6. package/dist/{chunk-6IA2OMAE.js → chunk-HC2KV6BU.js} +9 -0
  7. package/dist/{chunk-PXGSJNBH.js → chunk-HVC2BTFO.js} +783 -374
  8. package/dist/{chunk-3HEUGBOT.js → chunk-LK4MPIMK.js} +2 -2
  9. package/dist/{chunk-XOTJNW4Q.js → chunk-QIW6OCEI.js} +18 -1
  10. package/dist/{chunk-GUJUK6EH.js → chunk-QJLRDTYS.js} +198 -2
  11. package/dist/{chunk-QZJM3RYI.js → chunk-SNHGSCKH.js} +1 -1
  12. package/dist/{chunk-FXWETLEB.js → chunk-V3UOW2HG.js} +1 -1
  13. package/dist/{chunk-N6WLOWOD.js → chunk-WSC5LU3U.js} +3 -12
  14. package/dist/{chunk-EPV7NU2E.js → chunk-WWVSPOJY.js} +385 -188
  15. package/dist/{chunk-SQ5JGELM.js → chunk-ZDKQNQ4X.js} +19 -1
  16. package/dist/{chunk-PTUOINQ2.js → chunk-ZGZZIR6K.js} +3 -3
  17. package/dist/{chunk-D3KQAABP.js → chunk-ZMXZ476Y.js} +1 -1
  18. package/dist/components/index.d.ts +488 -452
  19. package/dist/components/index.js +127 -22
  20. package/dist/components/navigation/index.js +2 -2
  21. package/dist/features/auth/index.d.ts +463 -377
  22. package/dist/features/crm/index.d.ts +459 -379
  23. package/dist/features/crm/index.js +8 -8
  24. package/dist/features/dashboard/index.js +8 -8
  25. package/dist/features/delivery/index.d.ts +457 -371
  26. package/dist/features/delivery/index.js +8 -8
  27. package/dist/features/lead-gen/index.d.ts +225 -65
  28. package/dist/features/lead-gen/index.js +8 -8
  29. package/dist/features/monitoring/index.js +9 -9
  30. package/dist/features/monitoring/requests/index.js +7 -7
  31. package/dist/features/operations/index.js +10 -10
  32. package/dist/features/settings/index.d.ts +463 -377
  33. package/dist/features/settings/index.js +9 -9
  34. package/dist/hooks/delivery/index.d.ts +457 -371
  35. package/dist/hooks/index.d.ts +957 -718
  36. package/dist/hooks/index.js +7 -7
  37. package/dist/hooks/published.d.ts +957 -718
  38. package/dist/hooks/published.js +7 -7
  39. package/dist/index.d.ts +1327 -1020
  40. package/dist/index.js +8 -8
  41. package/dist/initialization/index.d.ts +463 -377
  42. package/dist/organization/index.d.ts +11 -1
  43. package/dist/organization/index.js +2 -2
  44. package/dist/profile/index.d.ts +463 -377
  45. package/dist/provider/index.d.ts +3132 -169
  46. package/dist/provider/index.js +6 -6
  47. package/dist/provider/published.d.ts +3098 -168
  48. package/dist/provider/published.js +3 -3
  49. package/dist/supabase/index.d.ts +559 -389
  50. package/dist/test-utils/index.d.ts +21 -1
  51. package/dist/test-utils/index.js +13 -4
  52. package/dist/theme/index.js +2 -2
  53. package/dist/types/index.d.ts +463 -377
  54. package/package.json +2 -2
  55. package/src/test-utils/README.md +2 -0
  56. package/dist/chunk-LVUCBY7X.js +0 -127
  57. /package/dist/{chunk-ZBCTB5CA.js → chunk-EIOJNUPL.js} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elevasis/ui",
3
- "version": "2.23.0",
3
+ "version": "2.25.0",
4
4
  "description": "UI components and platform-aware hooks for building custom frontends on the Elevasis platform",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -225,7 +225,7 @@
225
225
  "@testing-library/jest-dom": "^6.9.1",
226
226
  "msw": "^2.11.0",
227
227
  "vitest": "^3.2.4",
228
- "@repo/core": "0.13.0",
228
+ "@repo/core": "0.15.0",
229
229
  "@repo/typescript-config": "0.0.0",
230
230
  "@repo/eslint-config": "0.0.0"
231
231
  },
@@ -3,3 +3,5 @@
3
3
  Published test helpers for consumers that test Elevasis UI composition.
4
4
 
5
5
  Use `@elevasis/ui/test-utils` for provider-aware React rendering, WorkOS auth mocks, MSW handlers, and test query clients. Use `@elevasis/ui/test-utils/setup` or `@elevasis/ui/test-utils/setup-integration` from Vitest `setupFiles` when a consumer wants the shared browser and auth mocks.
6
+
7
+ `renderWithProviders`, `renderHookWithProviders`, and `createTestWrapper` include `ApiClientProvider`, `ElevasisServiceProvider`, `QueryClientProvider`, and `MantineProvider` by default. Tests can override `queryClient`, `getAccessToken`, `organizationId`, `isOrganizationReady`, `apiRequest`, and `isServiceReady` per render.
@@ -1,127 +0,0 @@
1
- import { ApiClientProvider, useApiClient } from './chunk-T6INEVX6.js';
2
- import { OrganizationProvider } from './chunk-6IA2OMAE.js';
3
- import { getErrorInfo, getErrorTitle, formatErrorMessage } from './chunk-SGXXJE52.js';
4
- import { InitializationProvider } from './chunk-DK2HVHCY.js';
5
- import { useOrganization } from './chunk-DD3CCMCZ.js';
6
- import { ProfileProvider } from './chunk-QHSW4WHM.js';
7
- import { ElevasisServiceProvider } from './chunk-IRW7JMQ4.js';
8
- import { useAuthContext } from './chunk-BRJ3QZ4E.js';
9
- import { createContext, lazy, useContext, Suspense, useRef } from 'react';
10
- import { jsx } from 'react/jsx-runtime';
11
- import { QueryClientProvider, QueryClient } from '@tanstack/react-query';
12
-
13
- var consoleAdapter = {
14
- success(title, message) {
15
- console.log(`[Notification][Success] ${title}: ${message}`);
16
- },
17
- error(title, message) {
18
- console.warn(`[Notification][Error] ${title}: ${message}`);
19
- },
20
- info(title, message) {
21
- console.log(`[Notification][Info] ${title}: ${message}`);
22
- },
23
- warning(title, message) {
24
- console.warn(`[Notification][Warning] ${title}: ${message}`);
25
- },
26
- apiError(error) {
27
- const { message, code, requestId, fields, retryAfter } = getErrorInfo(error);
28
- const title = getErrorTitle(code);
29
- const formatted = formatErrorMessage(message, requestId, fields, retryAfter);
30
- console.warn(`[Notification][API Error] ${title}: ${formatted}`);
31
- }
32
- };
33
- var NotificationContext = createContext(consoleAdapter);
34
- function NotificationProvider({ adapter, children }) {
35
- return /* @__PURE__ */ jsx(NotificationContext.Provider, { value: adapter, children });
36
- }
37
- function useNotificationAdapter() {
38
- return useContext(NotificationContext);
39
- }
40
- var LazyCoreAuthKitInner = lazy(() => import('./CoreAuthKitInner-QC62UHTZ.js').then((m) => ({ default: m.CoreAuthKitInner })));
41
- var defaultQueryClient = null;
42
- function getDefaultQueryClient() {
43
- if (!defaultQueryClient) {
44
- defaultQueryClient = new QueryClient({
45
- defaultOptions: { queries: { retry: 1 } }
46
- });
47
- }
48
- return defaultQueryClient;
49
- }
50
- var consoleNotificationAdapter = {
51
- success(title, message) {
52
- console.log(`[Notification][Success] ${title}: ${message}`);
53
- },
54
- error(title, message) {
55
- console.warn(`[Notification][Error] ${title}: ${message}`);
56
- },
57
- info(title, message) {
58
- console.log(`[Notification][Info] ${title}: ${message}`);
59
- },
60
- warning(title, message) {
61
- console.warn(`[Notification][Warning] ${title}: ${message}`);
62
- },
63
- apiError(error) {
64
- console.warn(`[Notification][API Error]`, error);
65
- }
66
- };
67
- function ElevasisCoreProvider({
68
- auth,
69
- queryClient,
70
- apiUrl,
71
- onError,
72
- notifications,
73
- children
74
- }) {
75
- if (auth.mode === "apiKey") {
76
- throw new Error(
77
- `ElevasisCoreProvider: auth mode 'apiKey' is not yet implemented. Only 'authkit' mode is supported.`
78
- );
79
- }
80
- const resolvedQueryClient = queryClient ?? getDefaultQueryClient();
81
- const content = apiUrl ? /* @__PURE__ */ jsx(ServiceStack, { apiUrl, onError, notifications, children }) : children;
82
- const AuthInner = /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyCoreAuthKitInner, { auth, children: content }) });
83
- return /* @__PURE__ */ jsx(QueryClientProvider, { client: resolvedQueryClient, children: AuthInner });
84
- }
85
- function ServiceStack({
86
- apiUrl,
87
- onError,
88
- notifications,
89
- children
90
- }) {
91
- const { getAccessToken } = useAuthContext();
92
- const orgIdRef = useRef(null);
93
- const getOrganizationId = useRef(() => orgIdRef.current).current;
94
- return /* @__PURE__ */ jsx(
95
- ApiClientProvider,
96
- {
97
- getAccessToken,
98
- getOrganizationId,
99
- isOrganizationReady: false,
100
- onError,
101
- children: /* @__PURE__ */ jsx(ServiceStackInner, { apiUrl, orgIdRef, notifications, children })
102
- }
103
- );
104
- }
105
- function ServiceStackInner({
106
- apiUrl,
107
- orgIdRef,
108
- notifications,
109
- children
110
- }) {
111
- const { apiRequest } = useApiClient(apiUrl);
112
- const resolvedNotifications = notifications ?? consoleNotificationAdapter;
113
- return /* @__PURE__ */ jsx(ProfileProvider, { apiRequest, children: /* @__PURE__ */ jsx(OrganizationProvider, { apiRequest, children: /* @__PURE__ */ jsx(OrgServiceBridge, { orgIdRef, apiRequest, notifications: resolvedNotifications, children }) }) });
114
- }
115
- function OrgServiceBridge({
116
- orgIdRef,
117
- apiRequest,
118
- notifications,
119
- children
120
- }) {
121
- const { currentWorkOSOrganizationId, isInitializing, isOrgRefreshing } = useOrganization();
122
- orgIdRef.current = currentWorkOSOrganizationId;
123
- const isReady = !!currentWorkOSOrganizationId && !isInitializing && !isOrgRefreshing;
124
- return /* @__PURE__ */ jsx(ElevasisServiceProvider, { apiRequest, organizationId: currentWorkOSOrganizationId, isReady, children: /* @__PURE__ */ jsx(NotificationProvider, { adapter: notifications, children: /* @__PURE__ */ jsx(InitializationProvider, { children }) }) });
125
- }
126
-
127
- export { ElevasisCoreProvider, NotificationProvider, useNotificationAdapter };
File without changes