@elevasis/ui 1.4.0 → 1.6.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 (56) hide show
  1. package/dist/{CoreAuthKitInner-3J4RVQO6.js → CoreAuthKitInner-Y6LQYIPX.js} +1 -0
  2. package/dist/api/index.js +1 -0
  3. package/dist/auth/context.js +1 -0
  4. package/dist/auth/index.js +1 -0
  5. package/dist/charts/index.d.ts +96 -0
  6. package/dist/charts/index.js +384 -0
  7. package/dist/chunk-54S7KNJV.js +112 -0
  8. package/dist/{chunk-6IX5JZEH.js → chunk-G4TAF3T6.js} +166 -1
  9. package/dist/{chunk-Y2I5JJ3N.js → chunk-K3YVC5RW.js} +2 -2
  10. package/dist/chunk-KB5NKPTN.js +1455 -0
  11. package/dist/chunk-MLKGABMK.js +7 -0
  12. package/dist/{chunk-GIFAF5ZS.js → chunk-MS45MNFM.js} +6 -1
  13. package/dist/chunk-R56VC63S.js +129 -0
  14. package/dist/chunk-TYV5NJV2.js +1 -0
  15. package/dist/{chunk-JQLT6HBI.js → chunk-YJFTZUJJ.js} +22 -2
  16. package/dist/components/index.css +486 -0
  17. package/dist/components/index.d.ts +2047 -1
  18. package/dist/components/index.js +3350 -0
  19. package/dist/components/navigation/index.js +1 -0
  20. package/dist/execution/index.d.ts +15 -3
  21. package/dist/execution/index.js +2 -1
  22. package/dist/graph/index.js +2 -1
  23. package/dist/hooks/index.d.ts +270 -0
  24. package/dist/hooks/index.js +3 -2
  25. package/dist/hooks/published.d.ts +546 -2
  26. package/dist/hooks/published.js +3 -2
  27. package/dist/index.css +62 -0
  28. package/dist/index.d.ts +351 -4
  29. package/dist/index.js +12 -1038
  30. package/dist/initialization/index.d.ts +270 -0
  31. package/dist/initialization/index.js +1 -0
  32. package/dist/layout/index.css +44 -0
  33. package/dist/layout/index.d.ts +330 -0
  34. package/dist/layout/index.js +1440 -0
  35. package/dist/organization/index.js +1 -0
  36. package/dist/profile/index.d.ts +270 -0
  37. package/dist/profile/index.js +1 -0
  38. package/dist/provider/index.css +61 -0
  39. package/dist/provider/index.d.ts +54 -2
  40. package/dist/provider/index.js +5 -3
  41. package/dist/provider/published.d.ts +6 -0
  42. package/dist/provider/published.js +3 -2
  43. package/dist/router/context.js +1 -0
  44. package/dist/router/index.js +1 -0
  45. package/dist/sse/index.js +1 -1
  46. package/dist/supabase/index.d.ts +525 -0
  47. package/dist/supabase/index.js +1 -0
  48. package/dist/theme/index.d.ts +107 -0
  49. package/dist/theme/index.js +3 -0
  50. package/dist/typeform/index.js +1 -0
  51. package/dist/typeform/schemas.js +1 -0
  52. package/dist/types/index.d.ts +3636 -368
  53. package/dist/utils/index.js +1 -0
  54. package/package.json +96 -3
  55. package/dist/chunk-XXDDMASA.js +0 -170
  56. /package/dist/{chunk-BUZONXAW.js → chunk-ARQRKA6J.js} +0 -0
@@ -1,2 +1,3 @@
1
1
  export { formatDate, getResourceColor, getResourceIcon, validateEmail } from '../chunk-LFYO3MDC.js';
2
2
  export { APIClientError, formatErrorMessage, getErrorInfo, getErrorTitle, isAPIClientError } from '../chunk-4VGWQ5AN.js';
3
+ import '../chunk-MLKGABMK.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elevasis/ui",
3
- "version": "1.4.0",
3
+ "version": "1.6.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",
@@ -42,6 +42,54 @@
42
42
  "./types": {
43
43
  "types": "./dist/types/index.d.ts",
44
44
  "import": "./dist/types/index.js"
45
+ },
46
+ "./components": {
47
+ "types": "./dist/components/index.d.ts",
48
+ "import": "./dist/components/index.js"
49
+ },
50
+ "./layout": {
51
+ "types": "./dist/layout/index.d.ts",
52
+ "import": "./dist/layout/index.js"
53
+ },
54
+ "./charts": {
55
+ "types": "./dist/charts/index.d.ts",
56
+ "import": "./dist/charts/index.js"
57
+ },
58
+ "./theme": {
59
+ "types": "./dist/theme/index.d.ts",
60
+ "import": "./dist/theme/index.js"
61
+ },
62
+ "./api": {
63
+ "types": "./dist/api/index.d.ts",
64
+ "import": "./dist/api/index.js"
65
+ },
66
+ "./utils": {
67
+ "types": "./dist/utils/index.d.ts",
68
+ "import": "./dist/utils/index.js"
69
+ },
70
+ "./graph": {
71
+ "types": "./dist/graph/index.d.ts",
72
+ "import": "./dist/graph/index.js"
73
+ },
74
+ "./execution": {
75
+ "types": "./dist/execution/index.d.ts",
76
+ "import": "./dist/execution/index.js"
77
+ },
78
+ "./router": {
79
+ "types": "./dist/router/index.d.ts",
80
+ "import": "./dist/router/index.js"
81
+ },
82
+ "./router/context": {
83
+ "types": "./dist/router/context.d.ts",
84
+ "import": "./dist/router/context.js"
85
+ },
86
+ "./auth/context": {
87
+ "types": "./dist/auth/context.d.ts",
88
+ "import": "./dist/auth/context.js"
89
+ },
90
+ "./components/navigation": {
91
+ "types": "./dist/components/navigation/index.d.ts",
92
+ "import": "./dist/components/navigation/index.js"
45
93
  }
46
94
  },
47
95
  "publishConfig": {
@@ -53,7 +101,45 @@
53
101
  "@tanstack/react-router": "^1.131.28",
54
102
  "zod": "^4.1.0",
55
103
  "zustand": "^5.0.5",
56
- "immer": "^10.1.1"
104
+ "immer": "^10.1.1",
105
+ "@mantine/core": "8.2.7",
106
+ "@mantine/hooks": "8.2.7",
107
+ "@mantine/charts": "8.2.7",
108
+ "@mantine/notifications": "8.2.7",
109
+ "@mantine/form": "8.2.7",
110
+ "@tabler/icons-react": "^3.27.0",
111
+ "@xyflow/react": "^12.8.5",
112
+ "recharts": "^3.2.1",
113
+ "date-fns": "^4.1.0"
114
+ },
115
+ "peerDependenciesMeta": {
116
+ "@mantine/core": {
117
+ "optional": true
118
+ },
119
+ "@mantine/hooks": {
120
+ "optional": true
121
+ },
122
+ "@mantine/charts": {
123
+ "optional": true
124
+ },
125
+ "@mantine/notifications": {
126
+ "optional": true
127
+ },
128
+ "@mantine/form": {
129
+ "optional": true
130
+ },
131
+ "@tabler/icons-react": {
132
+ "optional": true
133
+ },
134
+ "@xyflow/react": {
135
+ "optional": true
136
+ },
137
+ "recharts": {
138
+ "optional": true
139
+ },
140
+ "date-fns": {
141
+ "optional": true
142
+ }
57
143
  }
58
144
  },
59
145
  "peerDependencies": {
@@ -62,6 +148,9 @@
62
148
  "@xyflow/react": "^12.8.5",
63
149
  "@mantine/core": "8.2.7",
64
150
  "@mantine/hooks": "8.2.7",
151
+ "@mantine/charts": "8.2.7",
152
+ "@mantine/notifications": "8.2.7",
153
+ "@mantine/form": "8.2.7",
65
154
  "@tabler/icons-react": "^3.27.0",
66
155
  "@tanstack/react-router": "^1.131.28",
67
156
  "@supabase/supabase-js": "^2.49.4",
@@ -70,12 +159,16 @@
70
159
  "zustand": "^5.0.5",
71
160
  "immer": "^10.1.1",
72
161
  "date-fns": "^4.1.0",
73
- "zod": "^4.1.0"
162
+ "zod": "^4.1.0",
163
+ "recharts": "^3.2.1"
74
164
  },
75
165
  "devDependencies": {
166
+ "@mantine/charts": "8.2.7",
167
+ "@mantine/notifications": "8.2.7",
76
168
  "@types/react": "^19.2.2",
77
169
  "@types/react-dom": "^19.1.9",
78
170
  "globals": "^16.3.0",
171
+ "recharts": "^3.2.1",
79
172
  "rollup": "^4.59.0",
80
173
  "rollup-plugin-dts": "^6.3.0",
81
174
  "tsup": "^8.0.0",
@@ -1,170 +0,0 @@
1
- import { useNotificationAdapter } from './chunk-TIRMFDM4.js';
2
- import { useElevasisServices } from './chunk-KA7LO7U5.js';
3
- import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
4
-
5
- function useCommandQueue({
6
- status,
7
- limit,
8
- offset,
9
- humanCheckpoint,
10
- timeRange,
11
- priorityMin,
12
- priorityMax
13
- } = {}) {
14
- const { apiRequest, isReady, organizationId } = useElevasisServices();
15
- return useQuery({
16
- queryKey: ["command-queue", "list", organizationId, status, humanCheckpoint, timeRange, priorityMin, priorityMax, limit, offset],
17
- queryFn: async () => {
18
- const params = new URLSearchParams();
19
- if (status) params.set("status", status);
20
- if (humanCheckpoint) params.set("humanCheckpoint", humanCheckpoint);
21
- if (timeRange) params.set("timeRange", timeRange);
22
- if (priorityMin !== void 0) params.set("priorityMin", String(priorityMin));
23
- if (priorityMax !== void 0) params.set("priorityMax", String(priorityMax));
24
- if (limit !== void 0) params.set("limit", String(limit));
25
- if (offset !== void 0) params.set("offset", String(offset));
26
- const response = await apiRequest(
27
- `/command-queue?${params.toString()}`
28
- );
29
- return response.tasks.map((task) => ({
30
- ...task,
31
- createdAt: new Date(task.createdAt),
32
- completedAt: task.completedAt ? new Date(task.completedAt) : void 0,
33
- expiresAt: task.expiresAt ? new Date(task.expiresAt) : void 0
34
- }));
35
- },
36
- enabled: isReady
37
- });
38
- }
39
- function useSubmitAction() {
40
- const { apiRequest } = useElevasisServices();
41
- const queryClient = useQueryClient();
42
- return useMutation({
43
- mutationFn: async ({ taskId, actionId, payload, notes }) => {
44
- const response = await apiRequest(`/command-queue/${taskId}/action`, {
45
- method: "POST",
46
- body: JSON.stringify({
47
- actionId,
48
- payload,
49
- notes
50
- })
51
- });
52
- return response;
53
- },
54
- onMutate: async ({ taskId }) => {
55
- await queryClient.cancelQueries({ queryKey: ["command-queue", "list"] });
56
- const previousData = /* @__PURE__ */ new Map();
57
- const queries = queryClient.getQueriesData({ queryKey: ["command-queue", "list"] });
58
- for (const [queryKey, data] of queries) {
59
- previousData.set(queryKey, data);
60
- if (data) {
61
- queryClient.setQueryData(
62
- queryKey,
63
- (old) => old?.map((task) => task.id === taskId ? { ...task, status: "processing" } : task)
64
- );
65
- }
66
- }
67
- return { previousData };
68
- },
69
- onSuccess: () => {
70
- queryClient.invalidateQueries({ queryKey: ["command-queue"] });
71
- },
72
- onError: (_error, _variables, context) => {
73
- if (context?.previousData) {
74
- for (const [queryKey, data] of context.previousData) {
75
- queryClient.setQueryData(queryKey, data);
76
- }
77
- }
78
- }
79
- });
80
- }
81
- function useDeleteTask() {
82
- const { apiRequest } = useElevasisServices();
83
- const queryClient = useQueryClient();
84
- const notify = useNotificationAdapter();
85
- return useMutation({
86
- mutationFn: async (taskId) => {
87
- await apiRequest(`/command-queue/${taskId}`, {
88
- method: "DELETE"
89
- });
90
- },
91
- onMutate: async (taskId) => {
92
- await queryClient.cancelQueries({ queryKey: ["command-queue", "list"] });
93
- const previousData = /* @__PURE__ */ new Map();
94
- const queries = queryClient.getQueriesData({ queryKey: ["command-queue", "list"] });
95
- for (const [queryKey, data] of queries) {
96
- previousData.set(queryKey, data);
97
- if (data) {
98
- queryClient.setQueryData(queryKey, (old) => old?.filter((task) => task.id !== taskId));
99
- }
100
- }
101
- return { previousData };
102
- },
103
- onSuccess: () => {
104
- notify.success("Task Deleted", "Task has been removed");
105
- queryClient.invalidateQueries({ queryKey: ["command-queue"] });
106
- },
107
- onError: (error, _taskId, context) => {
108
- if (context?.previousData) {
109
- for (const [queryKey, data] of context.previousData) {
110
- queryClient.setQueryData(queryKey, data);
111
- }
112
- }
113
- notify.apiError(error);
114
- }
115
- });
116
- }
117
- function useCommandQueueTotals({
118
- timeRange = "24h",
119
- priorityMin,
120
- priorityMax,
121
- status
122
- } = {}) {
123
- const { apiRequest, isReady, organizationId } = useElevasisServices();
124
- return useQuery({
125
- queryKey: ["command-queue", "checkpoints", organizationId, timeRange, priorityMin, priorityMax, status],
126
- queryFn: async () => {
127
- const params = new URLSearchParams();
128
- params.set("timeRange", timeRange);
129
- if (priorityMin !== void 0) params.set("priorityMin", String(priorityMin));
130
- if (priorityMax !== void 0) params.set("priorityMax", String(priorityMax));
131
- if (status) params.set("status", status);
132
- return apiRequest(`/command-queue/checkpoints?${params.toString()}`);
133
- },
134
- enabled: isReady,
135
- staleTime: 3e4
136
- // 30s monitoring stale time
137
- });
138
- }
139
- function usePatchTask() {
140
- const { apiRequest } = useElevasisServices();
141
- const queryClient = useQueryClient();
142
- const notify = useNotificationAdapter();
143
- return useMutation({
144
- mutationFn: async ({ taskId, params }) => {
145
- const response = await apiRequest(`/command-queue/${taskId}`, {
146
- method: "PATCH",
147
- headers: { "Content-Type": "application/json" },
148
- body: JSON.stringify(params)
149
- });
150
- return response.task;
151
- },
152
- onSuccess: (updatedTask) => {
153
- const deserialized = {
154
- ...updatedTask,
155
- createdAt: new Date(updatedTask.createdAt),
156
- completedAt: updatedTask.completedAt ? new Date(updatedTask.completedAt) : void 0,
157
- expiresAt: updatedTask.expiresAt ? new Date(updatedTask.expiresAt) : void 0
158
- };
159
- queryClient.setQueriesData(
160
- { queryKey: ["command-queue", "list"] },
161
- (old) => old?.map((t) => t.id === deserialized.id ? { ...t, ...deserialized } : t)
162
- );
163
- },
164
- onError: (error) => {
165
- notify.apiError(error);
166
- }
167
- });
168
- }
169
-
170
- export { useCommandQueue, useCommandQueueTotals, useDeleteTask, usePatchTask, useSubmitAction };
File without changes