@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
@@ -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';