@elevasis/ui 1.0.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 (97) hide show
  1. package/dist/api/index.d.ts +87 -0
  2. package/dist/api/index.js +3 -0
  3. package/dist/auth/context.d.ts +19 -0
  4. package/dist/auth/context.js +1 -0
  5. package/dist/auth/index.d.ts +85 -0
  6. package/dist/auth/index.js +3 -0
  7. package/dist/chunk-3KMDHCAR.js +52 -0
  8. package/dist/chunk-5UWFGBFM.js +129 -0
  9. package/dist/chunk-6BJOYF6E.js +8 -0
  10. package/dist/chunk-6M6OLGQY.js +36 -0
  11. package/dist/chunk-7AI5ZYJ4.js +202 -0
  12. package/dist/chunk-7PLEQFHO.js +18 -0
  13. package/dist/chunk-GDV44UWF.js +138 -0
  14. package/dist/chunk-GEFB5YIR.js +338 -0
  15. package/dist/chunk-HBRMWW6V.js +43 -0
  16. package/dist/chunk-HUWJXLLF.js +681 -0
  17. package/dist/chunk-J3FALDQE.js +176 -0
  18. package/dist/chunk-JKERRYVS.js +109 -0
  19. package/dist/chunk-KA7LO7U5.js +28 -0
  20. package/dist/chunk-LHQTTUL2.js +27 -0
  21. package/dist/chunk-MAAS6CGR.js +1299 -0
  22. package/dist/chunk-NE36BUGQ.js +146 -0
  23. package/dist/chunk-NGXCFBCS.js +398 -0
  24. package/dist/chunk-OEYU5O27.js +235 -0
  25. package/dist/chunk-OUHGHTE7.js +748 -0
  26. package/dist/chunk-OXVOHOP3.js +661 -0
  27. package/dist/chunk-PSLKGOBZ.js +58 -0
  28. package/dist/chunk-PYL4XW6H.js +107 -0
  29. package/dist/chunk-Q47SPRY7.js +1 -0
  30. package/dist/chunk-Q7DJKLEN.js +18 -0
  31. package/dist/chunk-RJCA5672.js +1664 -0
  32. package/dist/chunk-S66I2PYB.js +748 -0
  33. package/dist/chunk-W7ZBF5AA.js +1 -0
  34. package/dist/chunk-WNWKOCGJ.js +1067 -0
  35. package/dist/chunk-XCYKC6OZ.js +1 -0
  36. package/dist/chunk-YULUKCS6.js +56 -0
  37. package/dist/chunk-YZ6GTZXL.js +48 -0
  38. package/dist/chunk-ZGHDPDTF.js +379 -0
  39. package/dist/components/command-queue/index.css +53 -0
  40. package/dist/components/command-queue/index.d.ts +204 -0
  41. package/dist/components/command-queue/index.js +10 -0
  42. package/dist/components/forms/index.d.ts +56 -0
  43. package/dist/components/forms/index.js +2 -0
  44. package/dist/components/index.css +443 -0
  45. package/dist/components/index.d.ts +1354 -0
  46. package/dist/components/index.js +18 -0
  47. package/dist/components/monitoring/index.d.ts +66 -0
  48. package/dist/components/monitoring/index.js +2 -0
  49. package/dist/components/navigation/index.d.ts +54 -0
  50. package/dist/components/navigation/index.js +91 -0
  51. package/dist/components/notifications/index.d.ts +52 -0
  52. package/dist/components/notifications/index.js +4 -0
  53. package/dist/components/resource-definition/index.css +388 -0
  54. package/dist/components/resource-definition/index.d.ts +301 -0
  55. package/dist/components/resource-definition/index.js +3 -0
  56. package/dist/display/index.css +53 -0
  57. package/dist/display/index.d.ts +606 -0
  58. package/dist/display/index.js +6 -0
  59. package/dist/execution/index.css +388 -0
  60. package/dist/execution/index.d.ts +1090 -0
  61. package/dist/execution/index.js +4 -0
  62. package/dist/graph/index.css +388 -0
  63. package/dist/graph/index.d.ts +429 -0
  64. package/dist/graph/index.js +1 -0
  65. package/dist/hooks/index.d.ts +1927 -0
  66. package/dist/hooks/index.js +6 -0
  67. package/dist/hooks/published.d.ts +1653 -0
  68. package/dist/hooks/published.js +4 -0
  69. package/dist/index.css +505 -0
  70. package/dist/index.d.ts +7284 -0
  71. package/dist/index.js +31 -0
  72. package/dist/initialization/index.d.ts +2325 -0
  73. package/dist/initialization/index.js +4 -0
  74. package/dist/organization/index.d.ts +225 -0
  75. package/dist/organization/index.js +4 -0
  76. package/dist/profile/index.d.ts +2265 -0
  77. package/dist/profile/index.js +3 -0
  78. package/dist/provider/index.css +61 -0
  79. package/dist/provider/index.d.ts +291 -0
  80. package/dist/provider/index.js +7 -0
  81. package/dist/provider/published.d.ts +198 -0
  82. package/dist/provider/published.js +6 -0
  83. package/dist/router/context.d.ts +19 -0
  84. package/dist/router/context.js +1 -0
  85. package/dist/router/index.d.ts +31 -0
  86. package/dist/router/index.js +2 -0
  87. package/dist/sse/index.d.ts +83 -0
  88. package/dist/sse/index.js +185 -0
  89. package/dist/supabase/index.d.ts +4289 -0
  90. package/dist/supabase/index.js +47 -0
  91. package/dist/typeform/index.d.ts +458 -0
  92. package/dist/typeform/index.js +1976 -0
  93. package/dist/typeform/schemas.d.ts +67 -0
  94. package/dist/typeform/schemas.js +1 -0
  95. package/dist/utils/index.d.ts +177 -0
  96. package/dist/utils/index.js +1 -0
  97. package/package.json +88 -0
@@ -0,0 +1,67 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * Zod schemas for Typeform answer validation.
5
+ * Separated from types.ts to avoid Next.js server/client boundary issues.
6
+ */
7
+
8
+ /**
9
+ * Zod schema for a single AnswerValue (preset or custom).
10
+ */
11
+ declare const answerValueSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
12
+ type: z.ZodLiteral<"preset">;
13
+ value: z.ZodString;
14
+ }, z.core.$strip>, z.ZodObject<{
15
+ type: z.ZodLiteral<"custom">;
16
+ value: z.ZodString;
17
+ }, z.core.$strip>], "type">;
18
+ /**
19
+ * Zod schema for MultiAnswerValue (array of AnswerValue).
20
+ */
21
+ declare const multiAnswerValueSchema: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
22
+ type: z.ZodLiteral<"preset">;
23
+ value: z.ZodString;
24
+ }, z.core.$strip>, z.ZodObject<{
25
+ type: z.ZodLiteral<"custom">;
26
+ value: z.ZodString;
27
+ }, z.core.$strip>], "type">>;
28
+ /**
29
+ * Create a Zod schema for a radio field with "Other" option.
30
+ * Accepts either a preset value from the enum OR a custom value.
31
+ *
32
+ * @param presetValues - Array of valid preset values (e.g., ['hubspot', 'salesforce'])
33
+ * @returns Zod schema that validates AnswerValue with preset constraint
34
+ *
35
+ * @example
36
+ * const crmSchema = radioWithOtherSchema(['hubspot', 'salesforce', 'pipedrive'])
37
+ * // Accepts: { type: 'preset', value: 'hubspot' }
38
+ * // Accepts: { type: 'custom', value: 'Freshsales' }
39
+ * // Rejects: { type: 'preset', value: 'invalid' }
40
+ */
41
+ declare function radioWithOtherSchema<T extends string>(presetValues: readonly T[]): z.ZodDiscriminatedUnion<[z.ZodObject<{
42
+ type: z.ZodLiteral<"preset">;
43
+ value: z.ZodEnum<{ [k_1 in T]: k_1; } extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never>;
44
+ }, z.core.$strip>, z.ZodObject<{
45
+ type: z.ZodLiteral<"custom">;
46
+ value: z.ZodString;
47
+ }, z.core.$strip>], "type">;
48
+ /**
49
+ * Create a Zod schema for a checkbox field with "Other" option.
50
+ * Each selected value is either a preset or custom AnswerValue.
51
+ *
52
+ * @param presetValues - Array of valid preset values
53
+ * @returns Zod schema that validates MultiAnswerValue with preset constraint
54
+ *
55
+ * @example
56
+ * const toolsSchema = checkboxWithOtherSchema(['zapier', 'make', 'n8n'])
57
+ * // Accepts: [{ type: 'preset', value: 'zapier' }, { type: 'custom', value: 'Tray.io' }]
58
+ */
59
+ declare function checkboxWithOtherSchema<T extends string>(presetValues: readonly T[]): z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
60
+ type: z.ZodLiteral<"preset">;
61
+ value: z.ZodEnum<{ [k_1 in T]: k_1; } extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never>;
62
+ }, z.core.$strip>, z.ZodObject<{
63
+ type: z.ZodLiteral<"custom">;
64
+ value: z.ZodString;
65
+ }, z.core.$strip>], "type">>;
66
+
67
+ export { answerValueSchema, checkboxWithOtherSchema, multiAnswerValueSchema, radioWithOtherSchema };
@@ -0,0 +1 @@
1
+ export { answerValueSchema, checkboxWithOtherSchema, multiAnswerValueSchema, radioWithOtherSchema } from '../chunk-6M6OLGQY.js';
@@ -0,0 +1,177 @@
1
+ import { IconBrain } from '@tabler/icons-react';
2
+
3
+ declare const showInfoNotification: (message: string) => void;
4
+ declare const showSuccessNotification: (message: string) => void;
5
+ declare const showErrorNotification: (error: Error | string) => void;
6
+ declare const showWarningNotification: (message: string) => void;
7
+ /**
8
+ * Show API error notification with type-safe error handling
9
+ * Automatically extracts error code, message, and request ID
10
+ *
11
+ * @param error - Any error (APIClientError, Error, or unknown)
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * import { showApiErrorNotification } from '@repo/ui/utils'
16
+ *
17
+ * onError: (error) => {
18
+ * showApiErrorNotification(error)
19
+ * }
20
+ * ```
21
+ */
22
+ declare const showApiErrorNotification: (error: unknown) => void;
23
+
24
+ declare const formatDate: (dateString: string) => string;
25
+
26
+ declare const validateEmail: (email: string) => boolean;
27
+
28
+ /**
29
+ * Resource Registry type definitions
30
+ */
31
+
32
+ /**
33
+ * Environment/deployment status for resources
34
+ */
35
+ type ResourceStatus = 'dev' | 'prod';
36
+ /**
37
+ * All resource types in the platform
38
+ * Used as the discriminator field in ResourceDefinition
39
+ */
40
+ type ResourceType = 'agent' | 'workflow' | 'trigger' | 'integration' | 'external' | 'human';
41
+ /**
42
+ * Base interface for ALL platform resources
43
+ * Shared by both executable (agents, workflows) and non-executable (triggers, integrations, etc.) resources
44
+ */
45
+ interface ResourceDefinition {
46
+ /** Unique resource identifier */
47
+ resourceId: string;
48
+ /** Display name */
49
+ name: string;
50
+ /** Purpose and functionality description */
51
+ description: string;
52
+ /** Version for change tracking and evolution */
53
+ version: string;
54
+ /** Resource type discriminator */
55
+ type: ResourceType;
56
+ /** Environment/deployment status */
57
+ status: ResourceStatus;
58
+ /** Domain tags for filtering and organization */
59
+ domains?: ResourceDomain[];
60
+ /** Whether the agent supports multi-turn sessions (agents only) */
61
+ sessionCapable?: boolean;
62
+ /** Whether the resource is local (monorepo) or remote (externally deployed) */
63
+ origin?: 'local' | 'remote';
64
+ /** Whether this resource is archived and should be excluded from registration and deployment */
65
+ archived?: boolean;
66
+ }
67
+
68
+ /**
69
+ * Standard Domain Definitions
70
+ * Centralized domain constants and definitions for all organization resources.
71
+ */
72
+
73
+ declare const DOMAINS: {
74
+ readonly INBOUND_PIPELINE: "inbound-pipeline";
75
+ readonly LEAD_GEN_PIPELINE: "lead-gen-pipeline";
76
+ readonly SUPPORT: "support";
77
+ readonly CLIENT_SUPPORT: "client-support";
78
+ readonly DELIVERY: "delivery";
79
+ readonly OPERATIONS: "operations";
80
+ readonly FINANCE: "finance";
81
+ readonly EXECUTIVE: "executive";
82
+ readonly INSTANTLY: "instantly";
83
+ readonly TESTING: "testing";
84
+ readonly INTERNAL: "internal";
85
+ readonly INTEGRATION: "integration";
86
+ readonly UTILITY: "utility";
87
+ readonly DIAGNOSTIC: "diagnostic";
88
+ };
89
+ /**
90
+ * ResourceDomain - Strongly typed domain identifier
91
+ * Use this type for all domain references to ensure compile-time validation.
92
+ */
93
+ type ResourceDomain = (typeof DOMAINS)[keyof typeof DOMAINS];
94
+
95
+ /**
96
+ * Resource Type Metadata
97
+ *
98
+ * Centralized metadata for ResourceDefinition types including icon names and colors.
99
+ * Icon names reference @tabler/icons-react - UI layer maps these to actual components.
100
+ */
101
+
102
+ /**
103
+ * All valid resource types from ResourceDefinition
104
+ * Derived from the base interface to ensure consistency
105
+ */
106
+ type ResourceDefinitionType = ResourceDefinition['type'];
107
+ /**
108
+ * Node color types for graph visualization
109
+ * Used by both @repo/core (metadata) and @repo/ui (components)
110
+ */
111
+ type NodeColorType = 'violet' | 'blue' | 'orange' | 'teal' | 'gray' | 'yellow';
112
+ /**
113
+ * Get color for a resource type
114
+ */
115
+ declare function getResourceColor(type: ResourceDefinitionType): NodeColorType;
116
+
117
+ /**
118
+ * Type-safe error codes
119
+ * MUST match API_ERROR_CODES in apps/api/src/errors/error-codes.ts
120
+ */
121
+ type APIErrorCode = 'VALIDATION_ERROR' | 'AUTHENTICATION_FAILED' | 'FORBIDDEN' | 'NOT_FOUND' | 'CONFLICT' | 'RATE_LIMIT_EXCEEDED' | 'INTERNAL_SERVER_ERROR' | 'SERVICE_UNAVAILABLE';
122
+
123
+ /**
124
+ * API Client Error class for type-safe error handling
125
+ * Used by API clients to provide structured error information
126
+ */
127
+ declare class APIClientError extends Error {
128
+ readonly statusCode: number;
129
+ readonly code: APIErrorCode;
130
+ readonly requestId?: string;
131
+ readonly fields?: Record<string, string[]>;
132
+ readonly retryAfter?: number;
133
+ constructor(message: string, code: APIErrorCode, statusCode: number, requestId?: string, fields?: Record<string, string[]>, retryAfter?: number);
134
+ }
135
+ /**
136
+ * Type guard to check if an error is an APIClientError
137
+ */
138
+ declare function isAPIClientError(error: unknown): error is APIClientError;
139
+ /**
140
+ * Extract error information from any error type
141
+ * Handles both APIClientError and generic Error instances
142
+ */
143
+ declare function getErrorInfo(error: unknown): {
144
+ message: string;
145
+ code?: APIErrorCode;
146
+ requestId?: string;
147
+ statusCode?: number;
148
+ fields?: Record<string, string[]>;
149
+ retryAfter?: number;
150
+ };
151
+ /**
152
+ * Get user-friendly error title based on error code
153
+ */
154
+ declare function getErrorTitle(code?: APIErrorCode): string;
155
+ /**
156
+ * Format error message with field errors and request ID if available
157
+ */
158
+ declare function formatErrorMessage(message: string, requestId?: string, fields?: Record<string, string[]>, retryAfter?: number): string;
159
+
160
+ /**
161
+ * Resource Icon Resolver
162
+ *
163
+ * Maps icon name strings from @repo/core to actual React icon components.
164
+ * This allows @repo/core to define icon metadata without React dependencies.
165
+ */
166
+
167
+ /**
168
+ * Tabler icon component type
169
+ */
170
+ type TablerIcon = typeof IconBrain;
171
+ /**
172
+ * Get icon component for a resource type
173
+ */
174
+ declare function getResourceIcon(type: ResourceDefinitionType): TablerIcon;
175
+
176
+ export { APIClientError, formatDate, formatErrorMessage, getErrorInfo, getErrorTitle, getResourceColor, getResourceIcon, isAPIClientError, showApiErrorNotification, showErrorNotification, showInfoNotification, showSuccessNotification, showWarningNotification, validateEmail };
177
+ export type { TablerIcon };
@@ -0,0 +1 @@
1
+ export { APIClientError, formatDate, formatErrorMessage, getErrorInfo, getErrorTitle, getResourceColor, getResourceIcon, isAPIClientError, showApiErrorNotification, showErrorNotification, showInfoNotification, showSuccessNotification, showWarningNotification, validateEmail } from '../chunk-7AI5ZYJ4.js';
package/package.json ADDED
@@ -0,0 +1,88 @@
1
+ {
2
+ "name": "@elevasis/ui",
3
+ "version": "1.0.0",
4
+ "description": "UI components and platform-aware hooks for building custom frontends on the Elevasis platform",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "sideEffects": [
8
+ "**/*.css"
9
+ ],
10
+ "files": [
11
+ "dist"
12
+ ],
13
+ "exports": {
14
+ "./provider": {
15
+ "types": "./dist/provider/published.d.ts",
16
+ "import": "./dist/provider/published.js"
17
+ },
18
+ "./auth": {
19
+ "types": "./dist/auth/index.d.ts",
20
+ "import": "./dist/auth/index.js"
21
+ },
22
+ "./hooks": {
23
+ "types": "./dist/hooks/published.d.ts",
24
+ "import": "./dist/hooks/published.js"
25
+ },
26
+ "./sse": {
27
+ "types": "./dist/sse/index.d.ts",
28
+ "import": "./dist/sse/index.js"
29
+ }
30
+ },
31
+ "publishConfig": {
32
+ "name": "@elevasis/ui",
33
+ "peerDependencies": {
34
+ "react": "^19.2.0",
35
+ "react-dom": "^19.2.0",
36
+ "@tanstack/react-query": "^5.76.2"
37
+ }
38
+ },
39
+ "peerDependencies": {
40
+ "react": "^19.2.0",
41
+ "react-dom": "^19.2.0",
42
+ "@xyflow/react": "^12.8.5",
43
+ "@mantine/core": "8.2.7",
44
+ "@mantine/form": "8.2.7",
45
+ "@mantine/hooks": "8.2.7",
46
+ "@mantine/charts": "8.2.7",
47
+ "@mantine/notifications": "8.2.7",
48
+ "@tabler/icons-react": "^3.27.0",
49
+ "@tanstack/react-router": "^1.131.28",
50
+ "react-markdown": "^10.1.0",
51
+ "react-syntax-highlighter": "^16.1.0",
52
+ "@supabase/supabase-js": "^2.49.4",
53
+ "@workos-inc/authkit-react": "^0.11.0",
54
+ "@tanstack/react-query": "^5.76.2",
55
+ "zustand": "^5.0.5",
56
+ "immer": "^10.1.1",
57
+ "date-fns": "^4.1.0",
58
+ "zod": "^4.1.0"
59
+ },
60
+ "devDependencies": {
61
+ "@types/react": "^19.2.2",
62
+ "@types/react-dom": "^19.1.9",
63
+ "globals": "^16.3.0",
64
+ "rollup": "^4.59.0",
65
+ "rollup-plugin-dts": "^6.3.0",
66
+ "tsup": "^8.0.0",
67
+ "typescript": "5.9.2",
68
+ "vite": "^7.0.0",
69
+ "@repo/core": "0.0.0",
70
+ "@repo/typescript-config": "0.0.0",
71
+ "@repo/eslint-config": "0.0.0"
72
+ },
73
+ "dependencies": {
74
+ "@dagrejs/dagre": "^1.1.4",
75
+ "@mdx-js/mdx": "^3.1.0",
76
+ "@microsoft/fetch-event-source": "^2.0.1",
77
+ "react-json-pretty": "^2.2.0"
78
+ },
79
+ "scripts": {
80
+ "build": "tsc",
81
+ "build:publish": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.core-dts.json && tsc -p tsconfig.build.json && tsup && rollup -c rollup.dts.config.mjs && node -e \"require('fs').rmSync('dist/types',{recursive:true,force:true})\"",
82
+ "dev": "tsc --watch",
83
+ "lint": "eslint src --max-warnings 0",
84
+ "check-types": "tsc --noEmit",
85
+ "test": "vitest run --passWithNoTests",
86
+ "test:watch": "vitest watch"
87
+ }
88
+ }