@elevasis/ui 1.7.5 → 1.8.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 (43) hide show
  1. package/dist/api/index.js +2 -3
  2. package/dist/auth/index.js +3 -4
  3. package/dist/charts/index.js +6 -8
  4. package/dist/{chunk-SFF5MJEI.js → chunk-2YBPRE6H.js} +1 -2
  5. package/dist/{chunk-U34YGJQB.js → chunk-3I2LOKQU.js} +1 -1
  6. package/dist/{chunk-PVVQTENF.js → chunk-3PURTICE.js} +1 -1
  7. package/dist/{chunk-2JBWPFHF.js → chunk-6TMW6VQ2.js} +1 -1
  8. package/dist/{chunk-6HZAMY6T.js → chunk-ARZM3OTI.js} +6 -2
  9. package/dist/{chunk-OK3XFSJJ.js → chunk-BWZMI4KP.js} +963 -10
  10. package/dist/{chunk-4KPI7YCY.js → chunk-EHXOR5LA.js} +2 -3
  11. package/dist/{chunk-Y7UY3HI4.js → chunk-ESOQEOOX.js} +2 -2
  12. package/dist/{chunk-L2CM2CUA.js → chunk-GZVH423C.js} +26 -3
  13. package/dist/{chunk-Y6DNK5ZD.js → chunk-JRJW2H57.js} +35 -9
  14. package/dist/{chunk-LBPALY25.js → chunk-JUPCUF77.js} +2 -2
  15. package/dist/chunk-QWYJHM3S.js +1068 -0
  16. package/dist/{chunk-NEK6JKPW.js → chunk-WUQWCUCB.js} +1 -1
  17. package/dist/chunk-Z4TPHMRD.js +231 -0
  18. package/dist/components/index.css +65 -0
  19. package/dist/components/index.d.ts +261 -2
  20. package/dist/components/index.js +1136 -80
  21. package/dist/hooks/index.css +452 -0
  22. package/dist/hooks/index.d.ts +1831 -13
  23. package/dist/hooks/index.js +15 -6
  24. package/dist/hooks/published.css +452 -0
  25. package/dist/hooks/published.d.ts +866 -6
  26. package/dist/hooks/published.js +15 -370
  27. package/dist/index.css +3 -0
  28. package/dist/index.d.ts +1665 -2
  29. package/dist/index.js +14 -17
  30. package/dist/initialization/index.js +3 -4
  31. package/dist/organization/index.js +3 -4
  32. package/dist/profile/index.js +1 -2
  33. package/dist/provider/index.css +3 -0
  34. package/dist/provider/index.js +7 -10
  35. package/dist/provider/published.js +6 -9
  36. package/dist/utils/index.d.ts +92 -1
  37. package/dist/utils/index.js +1 -2
  38. package/package.json +7 -3
  39. package/dist/chunk-4VGWQ5AN.js +0 -91
  40. package/dist/chunk-KA7LO7U5.js +0 -28
  41. package/dist/chunk-LFYO3MDC.js +0 -58
  42. package/dist/chunk-TIRMFDM4.js +0 -33
  43. package/dist/chunk-TYV5NJV2.js +0 -1
@@ -1,7 +1,6 @@
1
- import { getTimeRangeLabel, getTimeRangeDates, useErrorTrends, formatBucketTime } from './chunk-6HZAMY6T.js';
1
+ import { getTimeRangeLabel, getTimeRangeDates, useErrorTrends, formatBucketTime } from './chunk-ARZM3OTI.js';
2
2
  import { ResourceStatusColors } from './chunk-YZ6GTZXL.js';
3
- import { getResourceIcon } from './chunk-LFYO3MDC.js';
4
- import { getErrorInfo, getErrorTitle } from './chunk-4VGWQ5AN.js';
3
+ import { getErrorInfo, getErrorTitle, getResourceIcon } from './chunk-Z4TPHMRD.js';
5
4
  import { useAuthContext } from './chunk-7PLEQFHO.js';
6
5
  import { useRouterContext } from './chunk-Q7DJKLEN.js';
7
6
  import { useMemo, useState, useEffect, useCallback } from 'react';
@@ -1,6 +1,6 @@
1
1
  import { getPreset, generateShades, mantineThemeOverride, createCssVariablesResolver } from './chunk-KB5NKPTN.js';
2
- import { ElevasisCoreProvider } from './chunk-Y6DNK5ZD.js';
3
- import { getErrorInfo, formatErrorMessage, getErrorTitle } from './chunk-4VGWQ5AN.js';
2
+ import { ElevasisCoreProvider } from './chunk-JRJW2H57.js';
3
+ import { getErrorInfo, formatErrorMessage, getErrorTitle } from './chunk-Z4TPHMRD.js';
4
4
  import { useMemo, useEffect } from 'react';
5
5
  import { mergeThemeOverrides, MantineProvider } from '@mantine/core';
6
6
  import '@mantine/core/styles.css';
@@ -1,6 +1,29 @@
1
- import { useElevasisServices } from './chunk-KA7LO7U5.js';
2
1
  import { useAuthContext } from './chunk-7PLEQFHO.js';
3
- import { createContext, useState, useEffect, useContext, createElement } from 'react';
2
+ import { createContext, useContext, useMemo, useState, useEffect, createElement } from 'react';
3
+ import { jsx } from 'react/jsx-runtime';
4
+
5
+ var ElevasisServiceContext = createContext(null);
6
+ function useElevasisServices() {
7
+ const ctx = useContext(ElevasisServiceContext);
8
+ if (!ctx) {
9
+ throw new Error(
10
+ "useElevasisServices must be used within an ElevasisServiceProvider or an ElevasisProvider with apiUrl configured."
11
+ );
12
+ }
13
+ return ctx;
14
+ }
15
+ function ElevasisServiceProvider({
16
+ apiRequest,
17
+ organizationId,
18
+ isReady,
19
+ children
20
+ }) {
21
+ const value = useMemo(
22
+ () => ({ apiRequest, organizationId, isReady }),
23
+ [apiRequest, organizationId, isReady]
24
+ );
25
+ return /* @__PURE__ */ jsx(ElevasisServiceContext.Provider, { value, children });
26
+ }
4
27
 
5
28
  // src/profile/services/UserProfileService.ts
6
29
  var UserProfileService = class {
@@ -138,4 +161,4 @@ function ProfileProvider({ children }) {
138
161
  return createElement(ProfileContext.Provider, { value }, children);
139
162
  }
140
163
 
141
- export { ProfileProvider, UserProfileService, useProfile, useUserProfile };
164
+ export { ElevasisServiceProvider, ProfileProvider, UserProfileService, useElevasisServices, useProfile, useUserProfile };
@@ -1,15 +1,41 @@
1
- import { OrganizationProvider } from './chunk-SFF5MJEI.js';
2
- import { ApiClientProvider, useApiClient } from './chunk-LBPALY25.js';
3
- import { NotificationProvider } from './chunk-TIRMFDM4.js';
4
- import { InitializationProvider } from './chunk-NEK6JKPW.js';
5
- import { ProfileProvider } from './chunk-L2CM2CUA.js';
6
- import { ElevasisServiceProvider, useElevasisServices } from './chunk-KA7LO7U5.js';
1
+ import { OrganizationProvider } from './chunk-2YBPRE6H.js';
2
+ import { ApiClientProvider, useApiClient } from './chunk-JUPCUF77.js';
3
+ import { getErrorInfo, getErrorTitle, formatErrorMessage } from './chunk-Z4TPHMRD.js';
4
+ import { InitializationProvider } from './chunk-WUQWCUCB.js';
5
+ import { ElevasisServiceProvider, ProfileProvider, useElevasisServices } from './chunk-GZVH423C.js';
7
6
  import { useOrganization } from './chunk-DD3CCMCZ.js';
8
7
  import { useAuthContext } from './chunk-7PLEQFHO.js';
9
- import { lazy, Suspense, useRef } from 'react';
10
- import { QueryClientProvider, QueryClient } from '@tanstack/react-query';
8
+ import { createContext, lazy, useContext, Suspense, useRef } from 'react';
11
9
  import { jsx, Fragment } from 'react/jsx-runtime';
10
+ import { QueryClientProvider, QueryClient } from '@tanstack/react-query';
12
11
 
12
+ var consoleAdapter = {
13
+ success(title, message) {
14
+ console.log(`[Notification][Success] ${title}: ${message}`);
15
+ },
16
+ error(title, message) {
17
+ console.warn(`[Notification][Error] ${title}: ${message}`);
18
+ },
19
+ info(title, message) {
20
+ console.log(`[Notification][Info] ${title}: ${message}`);
21
+ },
22
+ warning(title, message) {
23
+ console.warn(`[Notification][Warning] ${title}: ${message}`);
24
+ },
25
+ apiError(error) {
26
+ const { message, code, requestId, fields, retryAfter } = getErrorInfo(error);
27
+ const title = getErrorTitle(code);
28
+ const formatted = formatErrorMessage(message, requestId, fields, retryAfter);
29
+ console.warn(`[Notification][API Error] ${title}: ${formatted}`);
30
+ }
31
+ };
32
+ var NotificationContext = createContext(consoleAdapter);
33
+ function NotificationProvider({ adapter, children }) {
34
+ return /* @__PURE__ */ jsx(NotificationContext.Provider, { value: adapter, children });
35
+ }
36
+ function useNotificationAdapter() {
37
+ return useContext(NotificationContext);
38
+ }
13
39
  var LazyCoreAuthKitInner = lazy(() => import('./CoreAuthKitInner-3J4RVQO6.js').then((m) => ({ default: m.CoreAuthKitInner })));
14
40
  var defaultQueryClient = null;
15
41
  function getDefaultQueryClient() {
@@ -84,4 +110,4 @@ function CoreNotificationLayer({
84
110
  return /* @__PURE__ */ jsx(Fragment, { children });
85
111
  }
86
112
 
87
- export { ElevasisCoreProvider };
113
+ export { ElevasisCoreProvider, NotificationProvider, useNotificationAdapter };
@@ -1,4 +1,4 @@
1
- import { APIClientError } from './chunk-4VGWQ5AN.js';
1
+ import { APIClientError } from './chunk-Z4TPHMRD.js';
2
2
  import { OrganizationContext } from './chunk-DD3CCMCZ.js';
3
3
  import { createContext, useContext, useMemo, useCallback } from 'react';
4
4
  import { jsx } from 'react/jsx-runtime';
@@ -153,4 +153,4 @@ function useApiClient(apiUrl) {
153
153
  };
154
154
  }
155
155
 
156
- export { ApiClientProvider, useApiClient, useApiClientContext };
156
+ export { ApiClientProvider, HTTP_HEADERS, useApiClient, useApiClientContext };