@elevasis/ui 2.25.5 → 2.26.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 (101) hide show
  1. package/dist/api/index.js +2 -2
  2. package/dist/app/index.css +18 -29
  3. package/dist/app/index.d.ts +118 -64
  4. package/dist/app/index.js +6 -5
  5. package/dist/charts/index.js +6 -5
  6. package/dist/chunk-3MEXPLWT.js +265 -0
  7. package/dist/{chunk-IS53MXE4.js → chunk-4KTLOK7K.js} +1 -1
  8. package/dist/{chunk-KMAXFJPH.js → chunk-CW3UNAF2.js} +5 -409
  9. package/dist/{chunk-HKBEURCV.js → chunk-G26INIF3.js} +1 -1
  10. package/dist/{chunk-NHHCUECV.js → chunk-G66QFZXD.js} +11 -214
  11. package/dist/{chunk-QIW6OCEI.js → chunk-HLFFKKT3.js} +27 -373
  12. package/dist/chunk-JDNEWB5F.js +10 -0
  13. package/dist/{chunk-VMAWXEVG.js → chunk-JKBGDFX2.js} +1136 -828
  14. package/dist/{chunk-MU4VPAMR.js → chunk-JPGX3533.js} +4 -3
  15. package/dist/chunk-KCGGA36K.js +73 -0
  16. package/dist/chunk-KEFWANZY.js +155 -0
  17. package/dist/chunk-LH4GPYDX.js +448 -0
  18. package/dist/{chunk-QNCVK3ZF.js → chunk-LWKZ3BCC.js} +5 -4
  19. package/dist/chunk-OGXKOMUT.js +412 -0
  20. package/dist/chunk-OHXU5WWK.js +3731 -0
  21. package/dist/chunk-ONFKASZI.js +2004 -0
  22. package/dist/{chunk-U36X6NZM.js → chunk-RIFTUOPE.js} +2 -14
  23. package/dist/{chunk-T6INEVX6.js → chunk-SGS4CQ2B.js} +1 -1
  24. package/dist/{chunk-KINQW4JT.js → chunk-UPMX5GJI.js} +5 -5
  25. package/dist/{chunk-N2AP4I5N.js → chunk-UY5I2KOZ.js} +223 -3857
  26. package/dist/{chunk-JMI7L7Y7.js → chunk-W2ZTLH7Y.js} +142 -4
  27. package/dist/{chunk-3KY2GNPE.js → chunk-WUVR4QY6.js} +9 -9
  28. package/dist/{chunk-Q5BEODAT.js → chunk-X2SUMO3P.js} +2 -1
  29. package/dist/{chunk-SNHGSCKH.js → chunk-XBMCDGHA.js} +1 -1
  30. package/dist/{chunk-N55DVMAG.js → chunk-XQQEKWTL.js} +2 -6
  31. package/dist/{chunk-F7JDHS2I.js → chunk-XZSEPJZQ.js} +5 -5
  32. package/dist/{chunk-5BJXMZN4.js → chunk-YHBPR67D.js} +438 -620
  33. package/dist/{chunk-FVKLHLF4.js → chunk-YO2YORW4.js} +4 -4
  34. package/dist/{chunk-TAIX4NO3.js → chunk-ZFLM2YVW.js} +2 -2
  35. package/dist/components/index.css +18 -29
  36. package/dist/components/index.d.ts +211 -383
  37. package/dist/components/index.js +43 -427
  38. package/dist/components/navigation/index.css +28 -39
  39. package/dist/execution/index.d.ts +0 -73
  40. package/dist/features/auth/index.css +28 -39
  41. package/dist/features/crm/index.css +28 -39
  42. package/dist/features/crm/index.d.ts +49 -49
  43. package/dist/features/crm/index.js +14 -14
  44. package/dist/features/dashboard/index.css +28 -39
  45. package/dist/features/dashboard/index.js +18 -15
  46. package/dist/features/delivery/index.css +18 -29
  47. package/dist/features/delivery/index.js +14 -14
  48. package/dist/features/knowledge/index.css +611 -0
  49. package/dist/features/knowledge/index.js +700 -1
  50. package/dist/features/lead-gen/index.css +28 -39
  51. package/dist/features/lead-gen/index.d.ts +212 -166
  52. package/dist/features/lead-gen/index.js +16 -15
  53. package/dist/features/monitoring/index.css +18 -29
  54. package/dist/features/monitoring/index.js +17 -16
  55. package/dist/features/monitoring/requests/index.css +28 -39
  56. package/dist/features/monitoring/requests/index.js +13 -13
  57. package/dist/features/operations/index.css +28 -39
  58. package/dist/features/operations/index.d.ts +16 -98
  59. package/dist/features/operations/index.js +26 -20
  60. package/dist/features/settings/index.css +28 -39
  61. package/dist/features/settings/index.d.ts +1 -0
  62. package/dist/features/settings/index.js +15 -15
  63. package/dist/hooks/delivery/index.css +28 -39
  64. package/dist/hooks/delivery/index.js +2 -2
  65. package/dist/hooks/index.css +18 -29
  66. package/dist/hooks/index.d.ts +180 -377
  67. package/dist/hooks/index.js +13 -13
  68. package/dist/hooks/published.css +18 -29
  69. package/dist/hooks/published.d.ts +180 -377
  70. package/dist/hooks/published.js +13 -13
  71. package/dist/index.css +18 -29
  72. package/dist/index.d.ts +1549 -946
  73. package/dist/index.js +15 -14
  74. package/dist/initialization/index.d.ts +1 -0
  75. package/dist/knowledge/index.d.ts +991 -41
  76. package/dist/knowledge/index.js +5469 -413
  77. package/dist/layout/index.d.ts +2 -0
  78. package/dist/layout/index.js +3 -2
  79. package/dist/organization/index.css +28 -39
  80. package/dist/organization/index.d.ts +1 -0
  81. package/dist/provider/index.css +28 -39
  82. package/dist/provider/index.d.ts +1147 -348
  83. package/dist/provider/index.js +11 -10
  84. package/dist/provider/published.css +28 -39
  85. package/dist/provider/published.d.ts +1146 -347
  86. package/dist/provider/published.js +8 -8
  87. package/dist/test-utils/index.js +2 -2
  88. package/dist/test-utils/setup.js +1 -1
  89. package/dist/theme/index.js +3 -2
  90. package/dist/theme/presets/index.d.ts +97 -0
  91. package/dist/theme/presets/index.js +3 -0
  92. package/dist/types/index.d.ts +71 -126
  93. package/dist/utils/index.js +1 -1
  94. package/dist/vite/index.d.ts +7 -0
  95. package/dist/vite/index.js +10 -0
  96. package/dist/vite-plugin-knowledge/index.d.ts +1 -33
  97. package/dist/vite-plugin-knowledge/index.js +1 -66
  98. package/package.json +46 -33
  99. package/src/knowledge/README.md +8 -8
  100. package/src/theme/presets/README.md +19 -0
  101. /package/dist/{chunk-SGXXJE52.js → chunk-QD4X4H5A.js} +0 -0
package/dist/api/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import '../chunk-XCYKC6OZ.js';
2
- export { ApiClientProvider, useApiClient, useApiClientContext } from '../chunk-T6INEVX6.js';
3
- import '../chunk-SGXXJE52.js';
2
+ export { ApiClientProvider, useApiClient, useApiClientContext } from '../chunk-SGS4CQ2B.js';
3
+ import '../chunk-QD4X4H5A.js';
4
4
  import '../chunk-KRWALB24.js';
5
5
  import '../chunk-DD3CCMCZ.js';
6
6
  import '../chunk-I2KLQ2HA.js';
@@ -11,14 +11,14 @@
11
11
  }
12
12
  .lead-gen-build-action-button:disabled,
13
13
  .lead-gen-build-action-button[data-disabled] {
14
- background-color: color-mix(in srgb, var(--mantine-color-gray-8) 48%, var(--color-surface) 52%) !important;
15
- border-color: color-mix(in srgb, var(--mantine-color-gray-8) 58%, var(--color-surface) 42%) !important;
14
+ background-color: var(--surface-primary-muted) !important;
15
+ border-color: var(--border-primary-subtle) !important;
16
16
  color: color-mix(in srgb, var(--color-text-subtle) 88%, var(--color-text-dimmed) 12%) !important;
17
17
  opacity: 0.78;
18
18
  }
19
19
  .lead-gen-build-action-button:disabled:hover,
20
20
  .lead-gen-build-action-button[data-disabled]:hover {
21
- background-color: color-mix(in srgb, var(--mantine-color-gray-8) 48%, var(--color-surface) 52%) !important;
21
+ background-color: var(--surface-primary-muted) !important;
22
22
  }
23
23
  .mantine-Accordion-control:hover {
24
24
  background-color: var(--color-surface-hover);
@@ -26,35 +26,24 @@
26
26
  .mantine-Menu-item:hover:not([data-disabled]) {
27
27
  background-color: var(--color-surface-hover);
28
28
  }
29
- .mantine-Select-option:hover {
30
- background-color: var(--color-surface-hover) !important;
29
+ .mantine-Select-option:hover,
30
+ .mantine-MultiSelect-option:hover,
31
+ .mantine-TagsInput-option:hover,
32
+ .mantine-Combobox-option:hover {
33
+ background-color: var(--surface-primary-muted) !important;
34
+ }
35
+ .mantine-Select-option[data-combobox-selected],
36
+ .mantine-MultiSelect-option[data-combobox-selected],
37
+ .mantine-TagsInput-option[data-combobox-selected],
38
+ .mantine-Combobox-option[data-combobox-selected] {
39
+ background-color: var(--surface-primary-subtle) !important;
40
+ color: var(--color-text);
31
41
  }
32
- [data-mantine-color-scheme] .mantine-Tabs-root {
33
- --tabs-color: var(--color-primary);
42
+ [data-mantine-color-scheme=dark] .mantine-Tabs-root {
34
43
  --tab-border-color: var(--color-border);
35
- --tab-hover-color: color-mix(in srgb, var(--color-surface-hover) 70%, transparent);
36
- }
37
- [data-mantine-color-scheme] .mantine-Tabs-list::before {
38
- border-color: var(--color-border);
39
44
  }
40
- [data-mantine-color-scheme] .mantine-Tabs-tab {
41
- color: var(--color-text);
42
- border-color: transparent;
43
- background-color: transparent;
44
- transition:
45
- background-color var(--duration-fast) var(--easing),
46
- border-color var(--duration-fast) var(--easing),
47
- color var(--duration-fast) var(--easing);
48
- }
49
- [data-mantine-color-scheme] .mantine-Tabs-tab:not([data-active]):hover {
50
- background-color: var(--tab-hover-color);
51
- border-color: var(--color-border);
52
- }
53
- [data-mantine-color-scheme] .mantine-Tabs-tab[data-active],
54
- [data-mantine-color-scheme] .mantine-Tabs-tab[data-active]:hover {
55
- color: var(--color-text);
56
- background-color: transparent;
57
- border-color: var(--color-primary);
45
+ .mantine-Tabs-tab:hover {
46
+ background-color: var(--color-surface-hover);
58
47
  }
59
48
  .mantine-Pagination-control:not([data-active]) {
60
49
  background: var(--color-surface);
@@ -1,7 +1,8 @@
1
1
  import { ReactNode, ComponentType } from 'react';
2
2
  import { AnyRouter } from '@tanstack/react-router';
3
3
  import { QueryClient } from '@tanstack/react-query';
4
- import { z } from 'zod';
4
+ import * as z from 'zod';
5
+ import { z as z$1 } from 'zod';
5
6
  import { MantineThemeOverride } from '@mantine/core';
6
7
 
7
8
  type Json = string | number | boolean | null | {
@@ -2911,87 +2912,87 @@ type Database = {
2911
2912
  };
2912
2913
  };
2913
2914
 
2914
- /** Raw database row type for acq_deals table */
2915
- type AcqDealRow = Database['public']['Tables']['acq_deals']['Row'];
2916
-
2917
2915
  /**
2918
2916
  * Single list as returned by /api/acquisition/lists/:id etc.
2919
2917
  * Camel-cased domain shape matching AcqList in types.ts.
2920
2918
  */
2921
- declare const AcqListResponseSchema: z.ZodObject<{
2922
- id: z.ZodString;
2923
- organizationId: z.ZodString;
2924
- name: z.ZodString;
2925
- description: z.ZodNullable<z.ZodString>;
2926
- batchIds: z.ZodArray<z.ZodString>;
2927
- instantlyCampaignId: z.ZodNullable<z.ZodString>;
2928
- status: z.ZodEnum<{
2919
+ declare const AcqListResponseSchema: z$1.ZodObject<{
2920
+ id: z$1.ZodString;
2921
+ organizationId: z$1.ZodString;
2922
+ name: z$1.ZodString;
2923
+ description: z$1.ZodNullable<z$1.ZodString>;
2924
+ batchIds: z$1.ZodArray<z$1.ZodString>;
2925
+ instantlyCampaignId: z$1.ZodNullable<z$1.ZodString>;
2926
+ status: z$1.ZodEnum<{
2929
2927
  closing: "closing";
2930
2928
  draft: "draft";
2931
2929
  enriching: "enriching";
2932
2930
  launched: "launched";
2933
2931
  archived: "archived";
2934
2932
  }>;
2935
- metadata: z.ZodObject<{
2936
- buildPlanSnapshot: z.ZodOptional<z.ZodObject<{
2937
- templateId: z.ZodString;
2938
- templateLabel: z.ZodString;
2939
- steps: z.ZodArray<z.ZodObject<{
2940
- id: z.ZodString;
2941
- label: z.ZodString;
2942
- description: z.ZodOptional<z.ZodString>;
2943
- primaryEntity: z.ZodEnum<{
2933
+ metadata: z$1.ZodObject<{
2934
+ buildPlanSnapshot: z$1.ZodOptional<z$1.ZodObject<{
2935
+ templateId: z$1.ZodString;
2936
+ templateLabel: z$1.ZodString;
2937
+ steps: z$1.ZodArray<z$1.ZodObject<{
2938
+ id: z$1.ZodString;
2939
+ label: z$1.ZodString;
2940
+ description: z$1.ZodOptional<z$1.ZodString>;
2941
+ primaryEntity: z$1.ZodEnum<{
2944
2942
  company: "company";
2945
2943
  contact: "contact";
2946
2944
  }>;
2947
- outputs: z.ZodArray<z.ZodEnum<{
2945
+ outputs: z$1.ZodArray<z$1.ZodEnum<{
2948
2946
  company: "company";
2949
2947
  contact: "contact";
2950
2948
  export: "export";
2951
2949
  }>>;
2952
- stageKey: z.ZodString;
2953
- dependsOn: z.ZodOptional<z.ZodArray<z.ZodString>>;
2954
- dependencyMode: z.ZodLiteral<"per-record-eligibility">;
2955
- capabilityKey: z.ZodString;
2956
- defaultBatchSize: z.ZodNumber;
2957
- maxBatchSize: z.ZodNumber;
2958
- }, z.core.$strip>>;
2959
- }, z.core.$strip>>;
2960
- }, z.core.$catchall<z.ZodUnknown>>;
2961
- launchedAt: z.ZodNullable<z.ZodString>;
2962
- completedAt: z.ZodNullable<z.ZodString>;
2963
- createdAt: z.ZodString;
2964
- scrapingConfig: z.ZodObject<{
2965
- vertical: z.ZodOptional<z.ZodString>;
2966
- geography: z.ZodOptional<z.ZodString>;
2967
- size: z.ZodOptional<z.ZodString>;
2968
- apifyInput: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2969
- }, z.core.$strip>;
2970
- icp: z.ZodObject<{
2971
- qualificationRubricKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2972
- targetDescription: z.ZodOptional<z.ZodString>;
2973
- minReviewCount: z.ZodOptional<z.ZodNumber>;
2974
- minRating: z.ZodOptional<z.ZodNumber>;
2975
- excludeFranchises: z.ZodOptional<z.ZodBoolean>;
2976
- customRules: z.ZodOptional<z.ZodString>;
2977
- }, z.core.$strip>;
2978
- pipelineConfig: z.ZodObject<{
2979
- stages: z.ZodOptional<z.ZodArray<z.ZodObject<{
2980
- key: z.ZodString;
2981
- label: z.ZodOptional<z.ZodString>;
2982
- enabled: z.ZodOptional<z.ZodBoolean>;
2983
- order: z.ZodOptional<z.ZodNumber>;
2984
- }, z.core.$strip>>>;
2985
- }, z.core.$strip>;
2986
- }, z.core.$strip>;
2987
- type AcqListResponse = z.infer<typeof AcqListResponseSchema>;
2950
+ stageKey: z$1.ZodString;
2951
+ dependsOn: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
2952
+ dependencyMode: z$1.ZodLiteral<"per-record-eligibility">;
2953
+ capabilityKey: z$1.ZodString;
2954
+ defaultBatchSize: z$1.ZodNumber;
2955
+ maxBatchSize: z$1.ZodNumber;
2956
+ }, z$1.core.$strip>>;
2957
+ }, z$1.core.$strip>>;
2958
+ }, z$1.core.$catchall<z$1.ZodUnknown>>;
2959
+ launchedAt: z$1.ZodNullable<z$1.ZodString>;
2960
+ completedAt: z$1.ZodNullable<z$1.ZodString>;
2961
+ createdAt: z$1.ZodString;
2962
+ scrapingConfig: z$1.ZodObject<{
2963
+ vertical: z$1.ZodOptional<z$1.ZodString>;
2964
+ geography: z$1.ZodOptional<z$1.ZodString>;
2965
+ size: z$1.ZodOptional<z$1.ZodString>;
2966
+ apifyInput: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
2967
+ }, z$1.core.$strip>;
2968
+ icp: z$1.ZodObject<{
2969
+ qualificationRubricKey: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
2970
+ targetDescription: z$1.ZodOptional<z$1.ZodString>;
2971
+ minReviewCount: z$1.ZodOptional<z$1.ZodNumber>;
2972
+ minRating: z$1.ZodOptional<z$1.ZodNumber>;
2973
+ excludeFranchises: z$1.ZodOptional<z$1.ZodBoolean>;
2974
+ customRules: z$1.ZodOptional<z$1.ZodString>;
2975
+ }, z$1.core.$strip>;
2976
+ pipelineConfig: z$1.ZodObject<{
2977
+ stages: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
2978
+ key: z$1.ZodString;
2979
+ label: z$1.ZodOptional<z$1.ZodString>;
2980
+ enabled: z$1.ZodOptional<z$1.ZodBoolean>;
2981
+ order: z$1.ZodOptional<z$1.ZodNumber>;
2982
+ }, z$1.core.$strip>>>;
2983
+ }, z$1.core.$strip>;
2984
+ }, z$1.core.$strip>;
2985
+ type AcqListResponse = z$1.infer<typeof AcqListResponseSchema>;
2986
+
2987
+ /** Raw database row type for acq_deals table */
2988
+ type AcqDealRow = Database['public']['Tables']['acq_deals']['Row'];
2988
2989
 
2989
2990
  interface ActionDef {
2990
2991
  key: string;
2991
2992
  label: string;
2992
2993
  isAvailableFor: (deal: AcqDealRow) => boolean;
2993
2994
  workflowId: string;
2994
- payloadSchema?: z.ZodTypeAny;
2995
+ payloadSchema?: z$1.ZodTypeAny;
2995
2996
  }
2996
2997
 
2997
2998
  interface ApiErrorDetails {
@@ -3043,13 +3044,65 @@ interface ThemePreset {
3043
3044
  }
3044
3045
  type PresetName = 'default' | 'tactical' | 'regal' | 'cyber-volt' | 'aurora' | 'rose-gold' | 'midnight' | 'titanium' | 'canopy' | 'slate' | 'cyber-strike' | 'cyber-chrome' | 'cyber-void' | 'nirvana' | 'wave' | 'synapse' | 'cortex' | 'helios' | 'graphite' | 'quarry';
3045
3046
 
3047
+ /**
3048
+ * All valid dotted paths into T.
3049
+ * Arrays of primitives are treated as leaf (return K only).
3050
+ * Arrays of objects are also treated as leaf (no drilling into element shape).
3051
+ * Optional fields are unwrapped via NonNullable before recursing.
3052
+ */
3053
+ type FieldPath<T> = T extends object ? {
3054
+ [K in keyof T & string]: T[K] extends ReadonlyArray<unknown> | unknown[] ? K : T[K] extends object | undefined ? K | `${K}.${FieldPath<NonNullable<T[K]>>}` : K;
3055
+ }[keyof T & string] : never;
3056
+ /** Discriminated string union of supported Mantine components. */
3057
+ type StepConfigComponent = 'segmented' | 'tags' | 'multiselect' | 'select' | 'textinput' | 'textarea' | 'numberinput' | 'switch' | 'json';
3058
+ /** Rendering hint for a single field within a section. */
3059
+ interface StepConfigFieldHint<T> {
3060
+ /** Typed dotted path into T — typo = TS error. */
3061
+ path: FieldPath<T>;
3062
+ /** Mantine component to render for this field. */
3063
+ component: StepConfigComponent;
3064
+ /** Overrides the field label derived from Zod .describe() or the key name. */
3065
+ label?: string;
3066
+ /** Help text shown below the field; overrides Zod .describe(). */
3067
+ description?: string;
3068
+ placeholder?: string;
3069
+ /** Required for 'segmented', 'select', 'multiselect'; ignored for others. */
3070
+ options?: ReadonlyArray<{
3071
+ value: string;
3072
+ label: string;
3073
+ }>;
3074
+ /** Minimum value — applies to 'numberinput'. */
3075
+ min?: number;
3076
+ /** Maximum value — applies to 'numberinput'. */
3077
+ max?: number;
3078
+ /** Stepper increment — applies to 'numberinput'. */
3079
+ step?: number;
3080
+ /** Per-field conditional visibility, evaluated against current form values. */
3081
+ when?: (values: T) => boolean;
3082
+ }
3083
+ /** An ordered group of fields, optionally shown conditionally. */
3084
+ interface StepConfigSection<T> {
3085
+ /** Stable key used for React rendering. */
3086
+ id: string;
3087
+ /** Section heading; omit for the top-level (untitled) section. */
3088
+ title?: string;
3089
+ description?: string;
3090
+ /** Section-level conditional visibility predicate. */
3091
+ when?: (values: T) => boolean;
3092
+ /** Fields rendered in order within this section. */
3093
+ fields: StepConfigFieldHint<T>[];
3094
+ }
3095
+ /** Top-level layout descriptor supplied by a per-integration registry entry. */
3096
+ interface StepConfigLayout<T> {
3097
+ /** Ordered top-level sections of the form. */
3098
+ sections: StepConfigSection<T>[];
3099
+ /** Optional single Advanced collapse rendered below all sections. */
3100
+ advanced?: StepConfigSection<T>;
3101
+ }
3102
+
3046
3103
  type ListBuilderWorkflowCategory = 'build' | 'enrich' | 'qualify' | 'scrape' | 'utility';
3047
3104
  type LeadGenStageKey = string;
3048
3105
  type LeadGenCapabilityKey = string;
3049
- interface ListBuilderWorkflowFormProps {
3050
- list: AcqListResponse;
3051
- onSubmit: (input: unknown) => void | Promise<void>;
3052
- }
3053
3106
  interface ListBuilderWorkflow {
3054
3107
  resourceId: string;
3055
3108
  workflowId?: string;
@@ -3058,7 +3111,8 @@ interface ListBuilderWorkflow {
3058
3111
  description: string;
3059
3112
  category: ListBuilderWorkflowCategory;
3060
3113
  stagesAffected: readonly LeadGenStageKey[];
3061
- inputForm?: ComponentType<ListBuilderWorkflowFormProps>;
3114
+ schema: z.ZodTypeAny;
3115
+ layout: StepConfigLayout<any>;
3062
3116
  defaultInput?: (list: AcqListResponse) => unknown;
3063
3117
  }
3064
3118
  type ListBuilderRegistry = readonly ListBuilderWorkflow[];
package/dist/app/index.js CHANGED
@@ -1,12 +1,13 @@
1
- import { ElevasisUIProvider } from '../chunk-MU4VPAMR.js';
2
- import '../chunk-QIW6OCEI.js';
1
+ import { ElevasisUIProvider } from '../chunk-JPGX3533.js';
2
+ import '../chunk-LH4GPYDX.js';
3
+ import '../chunk-HLFFKKT3.js';
3
4
  import '../chunk-WLOQ4IBG.js';
4
- import '../chunk-JMI7L7Y7.js';
5
+ import '../chunk-W2ZTLH7Y.js';
5
6
  import '../chunk-SZHARWKU.js';
6
- import '../chunk-T6INEVX6.js';
7
+ import '../chunk-SGS4CQ2B.js';
7
8
  import '../chunk-HOIT677G.js';
8
9
  import '../chunk-E565XMTQ.js';
9
- import '../chunk-SGXXJE52.js';
10
+ import '../chunk-QD4X4H5A.js';
10
11
  import '../chunk-KRWALB24.js';
11
12
  import { useInitialization } from '../chunk-WKJ47GIW.js';
12
13
  import '../chunk-DD3CCMCZ.js';
@@ -1,13 +1,14 @@
1
- export { ActivityTrendChart, ChartFrame, CombinedTrendChart, CostTrendChart, CyberAreaChart, CyberDonut, CyberDonutTooltip, CyberLegendItem, HeroStatsRow, getSeriesColor, useCyberColors } from '../chunk-KMAXFJPH.js';
1
+ export { ActivityTrendChart, ChartFrame, CombinedTrendChart, CostTrendChart, HeroStatsRow } from '../chunk-OGXKOMUT.js';
2
+ export { CyberAreaChart, CyberDonut, CyberDonutTooltip, CyberLegendItem, getSeriesColor, useCyberColors } from '../chunk-CW3UNAF2.js';
2
3
  import '../chunk-VKMNWHTL.js';
3
- import '../chunk-U36X6NZM.js';
4
- import '../chunk-NYBEU5TE.js';
5
- import '../chunk-SZHARWKU.js';
4
+ import '../chunk-RIFTUOPE.js';
6
5
  import '../chunk-3KMDHCAR.js';
6
+ import '../chunk-SZHARWKU.js';
7
+ import '../chunk-NYBEU5TE.js';
7
8
  import '../chunk-2IFYDILW.js';
8
9
  import '../chunk-Q7DJKLEN.js';
9
10
  import '../chunk-DT3QYZVU.js';
10
- import '../chunk-SGXXJE52.js';
11
+ import '../chunk-QD4X4H5A.js';
11
12
  import '../chunk-KRWALB24.js';
12
13
  import '../chunk-WFTNY755.js';
13
14
  import '../chunk-WKJ47GIW.js';
@@ -0,0 +1,265 @@
1
+ import { TextInput, Textarea, Radio, Stack, Checkbox, Select, NumberInput, Button } from '@mantine/core';
2
+ import { useForm } from '@mantine/form';
3
+ import { jsx, jsxs } from 'react/jsx-runtime';
4
+ import { z } from 'zod';
5
+
6
+ // src/components/forms/ZodFormRenderer.tsx
7
+ function FormFieldRenderer({ field, form, richTextRenderer }) {
8
+ const commonProps = {
9
+ label: field.label,
10
+ description: field.description,
11
+ placeholder: field.placeholder,
12
+ required: field.required,
13
+ ...form.getInputProps(field.name)
14
+ };
15
+ switch (field.type) {
16
+ case "text":
17
+ return /* @__PURE__ */ jsx(TextInput, { ...commonProps });
18
+ case "textarea":
19
+ return /* @__PURE__ */ jsx(Textarea, { ...commonProps, minRows: 3, autosize: true });
20
+ case "number":
21
+ return /* @__PURE__ */ jsx(NumberInput, { ...commonProps, min: field.min, max: field.max });
22
+ case "select":
23
+ return /* @__PURE__ */ jsx(
24
+ Select,
25
+ {
26
+ ...commonProps,
27
+ data: field.options?.map((opt) => ({
28
+ label: opt.label,
29
+ value: String(opt.value)
30
+ })) || []
31
+ }
32
+ );
33
+ case "checkbox":
34
+ return /* @__PURE__ */ jsx(Checkbox, { ...commonProps, ...form.getInputProps(field.name, { type: "checkbox" }) });
35
+ case "radio":
36
+ return /* @__PURE__ */ jsx(Radio.Group, { ...commonProps, children: /* @__PURE__ */ jsx(Stack, { gap: "xs", children: field.options?.map((opt) => /* @__PURE__ */ jsx(Radio, { value: String(opt.value), label: opt.label }, opt.value)) }) });
37
+ case "richtext": {
38
+ const inputProps = form.getInputProps(field.name);
39
+ if (richTextRenderer) {
40
+ return richTextRenderer({
41
+ content: inputProps.value || "",
42
+ onChange: (content) => form.setFieldValue(field.name, content),
43
+ placeholder: field.placeholder
44
+ });
45
+ }
46
+ return /* @__PURE__ */ jsx(Textarea, { ...commonProps, minRows: 5, autosize: true });
47
+ }
48
+ default:
49
+ return /* @__PURE__ */ jsx(TextInput, { ...commonProps });
50
+ }
51
+ }
52
+ function toJsonSchema(zodSchema) {
53
+ return z.toJSONSchema(zodSchema);
54
+ }
55
+ function humanizeKey(name) {
56
+ return name.replace(/([A-Z])/g, " $1").replace(/^./, (s) => s.toUpperCase());
57
+ }
58
+ function unwrapNullable(schema) {
59
+ if (Array.isArray(schema.anyOf)) {
60
+ const nonNull = schema.anyOf.filter((s) => s.type !== "null");
61
+ if (nonNull.length === 1) return { ...nonNull[0], description: schema.description ?? nonNull[0].description };
62
+ }
63
+ return schema;
64
+ }
65
+ function defaultForLeaf(schema) {
66
+ if (schema.default !== void 0) return schema.default;
67
+ if (Array.isArray(schema.enum) && schema.enum.length > 0) return schema.enum[0];
68
+ switch (schema.type) {
69
+ case "string":
70
+ return "";
71
+ case "integer":
72
+ case "number":
73
+ return 0;
74
+ case "boolean":
75
+ return false;
76
+ case "array":
77
+ return [];
78
+ case "object":
79
+ return schema.properties ? extractDefaults(schema) : {};
80
+ default:
81
+ return void 0;
82
+ }
83
+ }
84
+ function extractDefaults(jsonSchema) {
85
+ if (jsonSchema.type !== "object" || !jsonSchema.properties) return {};
86
+ const result = {};
87
+ for (const [key, propSchema] of Object.entries(jsonSchema.properties)) {
88
+ result[key] = defaultForLeaf(unwrapNullable(propSchema));
89
+ }
90
+ return result;
91
+ }
92
+ function propSchemaToFormField(name, raw, required) {
93
+ const schema = unwrapNullable(raw);
94
+ const label = humanizeKey(name);
95
+ const description = schema.description ?? "";
96
+ if (Array.isArray(schema.enum) && schema.enum.length > 0) {
97
+ const values = schema.enum.filter((v) => typeof v === "string" || typeof v === "number");
98
+ return {
99
+ name,
100
+ label,
101
+ type: "select",
102
+ required,
103
+ placeholder: "",
104
+ description,
105
+ options: values.map((v) => ({ label: String(v), value: typeof v === "number" ? v : String(v) })),
106
+ defaultValue: schema.default ?? values[0]
107
+ };
108
+ }
109
+ switch (schema.type) {
110
+ case "string": {
111
+ const isLong = (schema.maxLength ?? 0) > 200;
112
+ return {
113
+ name,
114
+ label,
115
+ type: isLong ? "textarea" : "text",
116
+ required,
117
+ placeholder: "",
118
+ description,
119
+ defaultValue: schema.default ?? ""
120
+ };
121
+ }
122
+ case "number":
123
+ case "integer": {
124
+ const field = {
125
+ name,
126
+ label,
127
+ type: "number",
128
+ required,
129
+ placeholder: "",
130
+ description,
131
+ defaultValue: schema.default ?? 0
132
+ };
133
+ if (typeof schema.minimum === "number" && schema.minimum > Number.MIN_SAFE_INTEGER) field.min = schema.minimum;
134
+ if (typeof schema.maximum === "number" && schema.maximum < Number.MAX_SAFE_INTEGER) field.max = schema.maximum;
135
+ return field;
136
+ }
137
+ case "boolean":
138
+ return {
139
+ name,
140
+ label,
141
+ type: "checkbox",
142
+ required,
143
+ placeholder: "",
144
+ description,
145
+ defaultValue: schema.default ?? false
146
+ };
147
+ default:
148
+ return null;
149
+ }
150
+ }
151
+ function jsonSchemaToFormFields(jsonSchema) {
152
+ const fields = [];
153
+ const initialValues = {};
154
+ if (jsonSchema.type !== "object" || !jsonSchema.properties) {
155
+ fields.push({ name: "__input__", label: "Input (JSON)", fallback: true });
156
+ initialValues["__input__"] = jsonSchema.default !== void 0 ? JSON.stringify(jsonSchema.default, null, 2) : "";
157
+ return { fields, initialValues, isObject: false };
158
+ }
159
+ const required = new Set(jsonSchema.required ?? []);
160
+ for (const [name, propSchemaRaw] of Object.entries(jsonSchema.properties)) {
161
+ const propSchema = unwrapNullable(propSchemaRaw);
162
+ const isRequired = required.has(name) && propSchema.default === void 0;
163
+ const formField = propSchemaToFormField(name, propSchema, isRequired);
164
+ if (formField) {
165
+ fields.push(formField);
166
+ initialValues[name] = propSchema.default ?? formField.defaultValue;
167
+ } else {
168
+ fields.push({ name, label: humanizeKey(name), fallback: true });
169
+ initialValues[name] = propSchema.default !== void 0 ? JSON.stringify(propSchema.default, null, 2) : "";
170
+ }
171
+ }
172
+ return { fields, initialValues, isObject: true };
173
+ }
174
+ function sanitizeInput(schema, value) {
175
+ const jsonSchema = toJsonSchema(schema);
176
+ const emptyParse = schema.safeParse({});
177
+ const baseDefaults = emptyParse.success && emptyParse.data && typeof emptyParse.data === "object" && !Array.isArray(emptyParse.data) ? emptyParse.data : extractDefaults(jsonSchema);
178
+ if (value === null || value === void 0 || typeof value !== "object" || Array.isArray(value)) {
179
+ return baseDefaults;
180
+ }
181
+ if (jsonSchema.type !== "object" || !jsonSchema.properties) {
182
+ const parsed = schema.safeParse(value);
183
+ return parsed.success && parsed.data && typeof parsed.data === "object" && !Array.isArray(parsed.data) ? parsed.data : baseDefaults;
184
+ }
185
+ const raw = value;
186
+ const result = { ...baseDefaults };
187
+ if (schema instanceof z.ZodObject) {
188
+ const shape = schema.shape;
189
+ for (const key of Object.keys(jsonSchema.properties)) {
190
+ if (key in raw && shape[key]) {
191
+ const fieldParsed = shape[key].safeParse(raw[key]);
192
+ if (fieldParsed.success) {
193
+ result[key] = fieldParsed.data;
194
+ }
195
+ }
196
+ }
197
+ }
198
+ return result;
199
+ }
200
+ function ZodFormRenderer({
201
+ schema,
202
+ defaults,
203
+ onSubmit,
204
+ submitLabel = "Submit",
205
+ isPending = false
206
+ }) {
207
+ const jsonSchema = toJsonSchema(schema);
208
+ const { fields, initialValues, isObject } = jsonSchemaToFormFields(jsonSchema);
209
+ const mergedInitialValues = { ...initialValues };
210
+ if (isObject && defaults) {
211
+ for (const [key, value] of Object.entries(defaults)) {
212
+ if (value !== void 0) mergedInitialValues[key] = value;
213
+ }
214
+ } else if (!isObject && defaults !== void 0) {
215
+ mergedInitialValues["__input__"] = JSON.stringify(defaults, null, 2);
216
+ }
217
+ const form = useForm({ initialValues: mergedInitialValues });
218
+ const handleSubmit = (values) => {
219
+ const coerced = {};
220
+ for (const field of fields) {
221
+ const raw = values[field.name];
222
+ if ("fallback" in field) {
223
+ try {
224
+ coerced[field.name] = raw !== "" && raw !== void 0 ? JSON.parse(raw) : void 0;
225
+ } catch {
226
+ coerced[field.name] = raw;
227
+ }
228
+ } else {
229
+ coerced[field.name] = raw;
230
+ }
231
+ }
232
+ const payload = isObject ? coerced : coerced["__input__"] ?? coerced;
233
+ const parsed = schema.safeParse(payload);
234
+ if (!parsed.success) {
235
+ for (const issue of parsed.error.issues) {
236
+ const path = issue.path.join(".");
237
+ if (path) form.setFieldError(path, issue.message);
238
+ }
239
+ return;
240
+ }
241
+ void onSubmit(parsed.data);
242
+ };
243
+ return /* @__PURE__ */ jsx("form", { onSubmit: form.onSubmit(handleSubmit), children: /* @__PURE__ */ jsxs(Stack, { children: [
244
+ fields.map((field) => {
245
+ if ("fallback" in field) {
246
+ return /* @__PURE__ */ jsx(
247
+ Textarea,
248
+ {
249
+ label: field.label,
250
+ placeholder: "Enter JSON value",
251
+ minRows: 3,
252
+ autosize: true,
253
+ ...form.getInputProps(field.name),
254
+ error: form.errors[field.name]
255
+ },
256
+ field.name
257
+ );
258
+ }
259
+ return /* @__PURE__ */ jsx(FormFieldRenderer, { field, form }, field.name);
260
+ }),
261
+ /* @__PURE__ */ jsx(Button, { type: "submit", loading: isPending, fullWidth: true, children: submitLabel })
262
+ ] }) });
263
+ }
264
+
265
+ export { FormFieldRenderer, ZodFormRenderer, sanitizeInput };
@@ -1,4 +1,4 @@
1
- import { DisplayMetadataSchema, ModelIdSchema, DescriptionSchema } from './chunk-JMI7L7Y7.js';
1
+ import { DisplayMetadataSchema, ModelIdSchema, DescriptionSchema } from './chunk-W2ZTLH7Y.js';
2
2
  import { z } from 'zod';
3
3
 
4
4
  var ProspectingLifecycleStageSchema = DisplayMetadataSchema.extend({