@elevasis/ui 2.22.0 → 2.24.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-3HEUGBOT.js → chunk-2WZ635SS.js} +2 -2
  4. package/dist/{chunk-GJ7EIABJ.js → chunk-4NWNS7TX.js} +1 -1
  5. package/dist/{chunk-LKVBEE63.js → chunk-FUEXGRFR.js} +2 -2
  6. package/dist/{chunk-6IA2OMAE.js → chunk-HC2KV6BU.js} +9 -0
  7. package/dist/{chunk-IBUYJXA3.js → chunk-KCJ6VATY.js} +1133 -578
  8. package/dist/{chunk-WWJ6S2HQ.js → chunk-KLFIJDTD.js} +1 -1
  9. package/dist/{chunk-COG4ABRI.js → chunk-M2HWJY6O.js} +704 -375
  10. package/dist/{chunk-LVJGPE6H.js → chunk-MTR6AN2C.js} +3 -12
  11. package/dist/chunk-OWHQ65EQ.js +211 -0
  12. package/dist/{chunk-XOTJNW4Q.js → chunk-QIW6OCEI.js} +18 -1
  13. package/dist/{chunk-B4FHWKEF.js → chunk-QULLZ5PE.js} +193 -10
  14. package/dist/{chunk-QZJM3RYI.js → chunk-SNHGSCKH.js} +1 -1
  15. package/dist/{chunk-LVUCBY7X.js → chunk-UDJE54WN.js} +85 -3
  16. package/dist/{chunk-IOTLB6ND.js → chunk-VGNAV3TH.js} +406 -195
  17. package/dist/{chunk-BSZRKBAW.js → chunk-YBZT7MJR.js} +3 -3
  18. package/dist/{chunk-SQ5JGELM.js → chunk-ZDKQNQ4X.js} +19 -1
  19. package/dist/components/index.d.ts +500 -466
  20. package/dist/components/index.js +75 -32
  21. package/dist/components/navigation/index.js +2 -2
  22. package/dist/features/auth/index.d.ts +472 -389
  23. package/dist/features/crm/index.d.ts +468 -391
  24. package/dist/features/crm/index.js +8 -8
  25. package/dist/features/dashboard/index.js +8 -8
  26. package/dist/features/delivery/index.d.ts +466 -383
  27. package/dist/features/delivery/index.js +8 -8
  28. package/dist/features/lead-gen/index.d.ts +213 -65
  29. package/dist/features/lead-gen/index.js +9 -8
  30. package/dist/features/monitoring/index.js +9 -9
  31. package/dist/features/monitoring/requests/index.js +7 -7
  32. package/dist/features/operations/index.js +11 -10
  33. package/dist/features/settings/index.d.ts +472 -389
  34. package/dist/features/settings/index.js +9 -9
  35. package/dist/hooks/delivery/index.d.ts +466 -383
  36. package/dist/hooks/index.d.ts +967 -744
  37. package/dist/hooks/index.js +7 -7
  38. package/dist/hooks/published.d.ts +967 -744
  39. package/dist/hooks/published.js +7 -7
  40. package/dist/index.d.ts +1360 -1069
  41. package/dist/index.js +8 -8
  42. package/dist/initialization/index.d.ts +472 -389
  43. package/dist/organization/index.d.ts +11 -1
  44. package/dist/organization/index.js +2 -2
  45. package/dist/profile/index.d.ts +472 -389
  46. package/dist/provider/index.d.ts +3132 -169
  47. package/dist/provider/index.js +6 -6
  48. package/dist/provider/published.d.ts +3098 -168
  49. package/dist/provider/published.js +3 -3
  50. package/dist/supabase/index.d.ts +577 -413
  51. package/dist/test-utils/index.d.ts +21 -1
  52. package/dist/test-utils/index.js +13 -4
  53. package/dist/theme/index.js +2 -2
  54. package/dist/types/index.d.ts +472 -389
  55. package/package.json +2 -2
  56. package/src/test-utils/README.md +2 -0
  57. /package/dist/{chunk-ZBCTB5CA.js → chunk-EIOJNUPL.js} +0 -0
@@ -7,6 +7,20 @@ import * as vitest from 'vitest';
7
7
  import * as msw_node from 'msw/node';
8
8
  import * as msw from 'msw';
9
9
 
10
+ /**
11
+ * Service context value exposed by ElevasisServiceProvider.
12
+ * Provides a ready-to-use apiRequest function and organization state.
13
+ *
14
+ * For standalone usage (testing, embedding), use ElevasisServiceProvider directly.
15
+ * For standard SDK usage, ElevasisUIProvider composes this automatically when apiUrl is provided.
16
+ */
17
+ interface ElevasisServiceContextValue {
18
+ apiRequest: <T>(endpoint: string, options?: RequestInit) => Promise<T>;
19
+ organizationId: string | null;
20
+ isReady: boolean;
21
+ }
22
+
23
+ type ApiRequest = ElevasisServiceContextValue['apiRequest'];
10
24
  declare function createTestQueryClient(): QueryClient;
11
25
  interface TestProvidersProps {
12
26
  children: ReactNode;
@@ -14,13 +28,17 @@ interface TestProvidersProps {
14
28
  getAccessToken?: () => Promise<string | undefined>;
15
29
  organizationId?: string | null;
16
30
  isOrganizationReady?: boolean;
31
+ apiRequest?: ApiRequest;
32
+ isServiceReady?: boolean;
17
33
  }
18
- declare function TestProviders({ children, queryClient, getAccessToken, organizationId, isOrganizationReady }: TestProvidersProps): react_jsx_runtime.JSX.Element;
34
+ declare function TestProviders({ children, queryClient, getAccessToken, organizationId, isOrganizationReady, apiRequest, isServiceReady }: TestProvidersProps): react_jsx_runtime.JSX.Element;
19
35
  interface CustomRenderOptions extends Omit<RenderOptions, 'wrapper'> {
20
36
  queryClient?: QueryClient;
21
37
  getAccessToken?: () => Promise<string | undefined>;
22
38
  organizationId?: string | null;
23
39
  isOrganizationReady?: boolean;
40
+ apiRequest?: ApiRequest;
41
+ isServiceReady?: boolean;
24
42
  }
25
43
  declare function renderWithProviders(ui: ReactElement, options?: CustomRenderOptions): ReturnType<typeof render>;
26
44
  interface CustomRenderHookOptions<TProps> extends Omit<RenderHookOptions<TProps>, 'wrapper'> {
@@ -28,6 +46,8 @@ interface CustomRenderHookOptions<TProps> extends Omit<RenderHookOptions<TProps>
28
46
  getAccessToken?: () => Promise<string | undefined>;
29
47
  organizationId?: string | null;
30
48
  isOrganizationReady?: boolean;
49
+ apiRequest?: ApiRequest;
50
+ isServiceReady?: boolean;
31
51
  }
32
52
  declare function renderHookWithProviders<TResult, TProps>(hook: (props: TProps) => TResult, options?: CustomRenderHookOptions<TProps>): ReturnType<typeof renderHook<TResult, TProps>>;
33
53
  declare function createTestWrapper(options?: Omit<TestProvidersProps, 'children'>): ({ children }: {
@@ -7,6 +7,7 @@ import { ApiClientProvider } from '../chunk-T6INEVX6.js';
7
7
  import '../chunk-SGXXJE52.js';
8
8
  import '../chunk-KRWALB24.js';
9
9
  import '../chunk-DD3CCMCZ.js';
10
+ import { ElevasisServiceProvider } from '../chunk-IRW7JMQ4.js';
10
11
  import { __export, __reExport } from '../chunk-I2KLQ2HA.js';
11
12
  import { MantineProvider } from '@mantine/core';
12
13
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
@@ -52,6 +53,7 @@ __export(render_exports, {
52
53
  renderWithProviders: () => renderWithProviders
53
54
  });
54
55
  __reExport(render_exports, react_star);
56
+ var mockApiRequest = async () => ({});
55
57
  function createTestQueryClient() {
56
58
  return new QueryClient({
57
59
  defaultOptions: {
@@ -72,9 +74,12 @@ function TestProviders({
72
74
  queryClient,
73
75
  getAccessToken = mockGetAccessToken,
74
76
  organizationId = "test-org-id",
75
- isOrganizationReady = true
77
+ isOrganizationReady = true,
78
+ apiRequest = mockApiRequest,
79
+ isServiceReady
76
80
  }) {
77
81
  const client = queryClient ?? createTestQueryClient();
82
+ const serviceReady = isServiceReady ?? isOrganizationReady;
78
83
  return /* @__PURE__ */ jsx(MantineProvider, { children: /* @__PURE__ */ jsx(QueryClientProvider, { client, children: /* @__PURE__ */ jsx(
79
84
  ApiClientProvider,
80
85
  {
@@ -82,12 +87,12 @@ function TestProviders({
82
87
  getOrganizationId: () => organizationId ?? null,
83
88
  organizationId,
84
89
  isOrganizationReady,
85
- children
90
+ children: /* @__PURE__ */ jsx(ElevasisServiceProvider, { apiRequest, organizationId: organizationId ?? null, isReady: serviceReady, children })
86
91
  }
87
92
  ) }) });
88
93
  }
89
94
  function renderWithProviders(ui, options) {
90
- const { queryClient, getAccessToken, organizationId, isOrganizationReady, ...renderOptions } = options ?? {};
95
+ const { queryClient, getAccessToken, organizationId, isOrganizationReady, apiRequest, isServiceReady, ...renderOptions } = options ?? {};
91
96
  return render(ui, {
92
97
  wrapper: ({ children }) => /* @__PURE__ */ jsx(
93
98
  TestProviders,
@@ -96,6 +101,8 @@ function renderWithProviders(ui, options) {
96
101
  getAccessToken,
97
102
  organizationId,
98
103
  isOrganizationReady,
104
+ apiRequest,
105
+ isServiceReady,
99
106
  children
100
107
  }
101
108
  ),
@@ -103,7 +110,7 @@ function renderWithProviders(ui, options) {
103
110
  });
104
111
  }
105
112
  function renderHookWithProviders(hook, options) {
106
- const { queryClient, getAccessToken, organizationId, isOrganizationReady, ...renderHookOptions } = options ?? {};
113
+ const { queryClient, getAccessToken, organizationId, isOrganizationReady, apiRequest, isServiceReady, ...renderHookOptions } = options ?? {};
107
114
  return renderHook(hook, {
108
115
  wrapper: ({ children }) => /* @__PURE__ */ jsx(
109
116
  TestProviders,
@@ -112,6 +119,8 @@ function renderHookWithProviders(hook, options) {
112
119
  getAccessToken,
113
120
  organizationId,
114
121
  isOrganizationReady,
122
+ apiRequest,
123
+ isServiceReady,
115
124
  children
116
125
  }
117
126
  ),
@@ -1,4 +1,4 @@
1
- export { useAvailablePresets } from '../chunk-QZJM3RYI.js';
2
- export { PresetsProvider, TOKEN_VAR_MAP, componentThemes, createCssVariablesResolver, generateShades, getPreset, mantineThemeOverride, PRESETS as presets, usePresetsContext } from '../chunk-XOTJNW4Q.js';
1
+ export { useAvailablePresets } from '../chunk-SNHGSCKH.js';
2
+ export { PresetsProvider, TOKEN_VAR_MAP, componentThemes, createCssVariablesResolver, generateShades, getPreset, mantineThemeOverride, PRESETS as presets, usePresetsContext } from '../chunk-QIW6OCEI.js';
3
3
  import '../chunk-WLOQ4IBG.js';
4
4
  import '../chunk-I2KLQ2HA.js';