@elevasis/ui 1.4.0 → 1.5.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 +64 -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.5.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,22 @@
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"
45
61
  }
46
62
  },
47
63
  "publishConfig": {
@@ -53,7 +69,45 @@
53
69
  "@tanstack/react-router": "^1.131.28",
54
70
  "zod": "^4.1.0",
55
71
  "zustand": "^5.0.5",
56
- "immer": "^10.1.1"
72
+ "immer": "^10.1.1",
73
+ "@mantine/core": "8.2.7",
74
+ "@mantine/hooks": "8.2.7",
75
+ "@mantine/charts": "8.2.7",
76
+ "@mantine/notifications": "8.2.7",
77
+ "@mantine/form": "8.2.7",
78
+ "@tabler/icons-react": "^3.27.0",
79
+ "@xyflow/react": "^12.8.5",
80
+ "recharts": "^3.2.1",
81
+ "date-fns": "^4.1.0"
82
+ },
83
+ "peerDependenciesMeta": {
84
+ "@mantine/core": {
85
+ "optional": true
86
+ },
87
+ "@mantine/hooks": {
88
+ "optional": true
89
+ },
90
+ "@mantine/charts": {
91
+ "optional": true
92
+ },
93
+ "@mantine/notifications": {
94
+ "optional": true
95
+ },
96
+ "@mantine/form": {
97
+ "optional": true
98
+ },
99
+ "@tabler/icons-react": {
100
+ "optional": true
101
+ },
102
+ "@xyflow/react": {
103
+ "optional": true
104
+ },
105
+ "recharts": {
106
+ "optional": true
107
+ },
108
+ "date-fns": {
109
+ "optional": true
110
+ }
57
111
  }
58
112
  },
59
113
  "peerDependencies": {
@@ -62,6 +116,9 @@
62
116
  "@xyflow/react": "^12.8.5",
63
117
  "@mantine/core": "8.2.7",
64
118
  "@mantine/hooks": "8.2.7",
119
+ "@mantine/charts": "8.2.7",
120
+ "@mantine/notifications": "8.2.7",
121
+ "@mantine/form": "8.2.7",
65
122
  "@tabler/icons-react": "^3.27.0",
66
123
  "@tanstack/react-router": "^1.131.28",
67
124
  "@supabase/supabase-js": "^2.49.4",
@@ -70,12 +127,16 @@
70
127
  "zustand": "^5.0.5",
71
128
  "immer": "^10.1.1",
72
129
  "date-fns": "^4.1.0",
73
- "zod": "^4.1.0"
130
+ "zod": "^4.1.0",
131
+ "recharts": "^3.2.1"
74
132
  },
75
133
  "devDependencies": {
134
+ "@mantine/charts": "8.2.7",
135
+ "@mantine/notifications": "8.2.7",
76
136
  "@types/react": "^19.2.2",
77
137
  "@types/react-dom": "^19.1.9",
78
138
  "globals": "^16.3.0",
139
+ "recharts": "^3.2.1",
79
140
  "rollup": "^4.59.0",
80
141
  "rollup-plugin-dts": "^6.3.0",
81
142
  "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