@uipath/apollo-wind 0.9.0 → 0.10.0-pr257.13842f9

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 (145) hide show
  1. package/dist/components/forms/field-renderer.cjs +120 -69
  2. package/dist/components/forms/field-renderer.js +120 -69
  3. package/dist/components/forms/form-designer.cjs +2352 -1488
  4. package/dist/components/forms/form-designer.js +2353 -1489
  5. package/dist/components/forms/form-examples.cjs +10 -10
  6. package/dist/components/forms/form-examples.js +10 -10
  7. package/dist/components/forms/form-state-viewer.cjs +988 -433
  8. package/dist/components/forms/form-state-viewer.js +988 -433
  9. package/dist/components/forms/metadata-form.cjs +455 -185
  10. package/dist/components/forms/metadata-form.js +455 -185
  11. package/dist/components/forms/schema-viewer.cjs +173 -80
  12. package/dist/components/forms/schema-viewer.js +173 -80
  13. package/dist/components/ui/accordion.cjs +131 -27
  14. package/dist/components/ui/accordion.js +131 -27
  15. package/dist/components/ui/alert-dialog.cjs +273 -45
  16. package/dist/components/ui/alert-dialog.js +273 -45
  17. package/dist/components/ui/alert.cjs +106 -17
  18. package/dist/components/ui/alert.js +106 -17
  19. package/dist/components/ui/avatar.cjs +100 -15
  20. package/dist/components/ui/avatar.js +100 -15
  21. package/dist/components/ui/badge.cjs +36 -6
  22. package/dist/components/ui/badge.js +36 -6
  23. package/dist/components/ui/breadcrumb.cjs +258 -52
  24. package/dist/components/ui/breadcrumb.js +258 -52
  25. package/dist/components/ui/button-group.cjs +119 -19
  26. package/dist/components/ui/button-group.js +119 -19
  27. package/dist/components/ui/button.cjs +48 -8
  28. package/dist/components/ui/button.js +48 -8
  29. package/dist/components/ui/calendar.cjs +88 -30
  30. package/dist/components/ui/calendar.js +88 -30
  31. package/dist/components/ui/card.cjs +199 -30
  32. package/dist/components/ui/card.js +199 -30
  33. package/dist/components/ui/checkbox.cjs +42 -8
  34. package/dist/components/ui/checkbox.js +42 -8
  35. package/dist/components/ui/combobox.cjs +150 -53
  36. package/dist/components/ui/combobox.js +150 -53
  37. package/dist/components/ui/command.cjs +291 -53
  38. package/dist/components/ui/command.js +291 -53
  39. package/dist/components/ui/context-menu.cjs +370 -72
  40. package/dist/components/ui/context-menu.js +370 -72
  41. package/dist/components/ui/data-table.cjs +76 -39
  42. package/dist/components/ui/data-table.js +76 -39
  43. package/dist/components/ui/date-picker.cjs +179 -68
  44. package/dist/components/ui/date-picker.js +179 -68
  45. package/dist/components/ui/datetime-picker.cjs +225 -104
  46. package/dist/components/ui/datetime-picker.js +225 -104
  47. package/dist/components/ui/dialog.cjs +290 -78
  48. package/dist/components/ui/dialog.js +290 -78
  49. package/dist/components/ui/drawer.cjs +220 -39
  50. package/dist/components/ui/drawer.js +220 -39
  51. package/dist/components/ui/dropdown-menu.cjs +376 -73
  52. package/dist/components/ui/dropdown-menu.js +376 -73
  53. package/dist/components/ui/editable-cell.cjs +106 -42
  54. package/dist/components/ui/editable-cell.js +106 -42
  55. package/dist/components/ui/empty-state.cjs +106 -33
  56. package/dist/components/ui/empty-state.js +106 -33
  57. package/dist/components/ui/file-upload.cjs +405 -187
  58. package/dist/components/ui/file-upload.d.ts +3 -1
  59. package/dist/components/ui/file-upload.js +405 -187
  60. package/dist/components/ui/hover-card.cjs +46 -7
  61. package/dist/components/ui/hover-card.js +46 -7
  62. package/dist/components/ui/index.cjs +4 -4
  63. package/dist/components/ui/input.cjs +39 -6
  64. package/dist/components/ui/input.js +39 -6
  65. package/dist/components/ui/label.cjs +34 -5
  66. package/dist/components/ui/label.js +34 -5
  67. package/dist/components/ui/layout/column.cjs +209 -41
  68. package/dist/components/ui/layout/column.js +209 -41
  69. package/dist/components/ui/layout/grid.cjs +275 -60
  70. package/dist/components/ui/layout/grid.js +275 -60
  71. package/dist/components/ui/layout/row.cjs +209 -41
  72. package/dist/components/ui/layout/row.js +209 -41
  73. package/dist/components/ui/menubar.cjs +540 -106
  74. package/dist/components/ui/menubar.js +540 -106
  75. package/dist/components/ui/multi-select.cjs +289 -135
  76. package/dist/components/ui/multi-select.js +289 -135
  77. package/dist/components/ui/navigation-menu.cjs +244 -47
  78. package/dist/components/ui/navigation-menu.js +244 -47
  79. package/dist/components/ui/pagination.cjs +301 -65
  80. package/dist/components/ui/pagination.js +301 -65
  81. package/dist/components/ui/popover.cjs +48 -9
  82. package/dist/components/ui/popover.js +48 -9
  83. package/dist/components/ui/progress.cjs +48 -8
  84. package/dist/components/ui/progress.js +48 -8
  85. package/dist/components/ui/radio-group.cjs +74 -12
  86. package/dist/components/ui/radio-group.js +74 -12
  87. package/dist/components/ui/resizable.cjs +75 -10
  88. package/dist/components/ui/resizable.js +75 -10
  89. package/dist/components/ui/scroll-area.cjs +113 -21
  90. package/dist/components/ui/scroll-area.js +113 -21
  91. package/dist/components/ui/search.cjs +280 -98
  92. package/dist/components/ui/search.js +280 -98
  93. package/dist/components/ui/select.cjs +334 -68
  94. package/dist/components/ui/select.js +334 -68
  95. package/dist/components/ui/separator.cjs +48 -7
  96. package/dist/components/ui/separator.js +48 -7
  97. package/dist/components/ui/sheet.cjs +236 -50
  98. package/dist/components/ui/sheet.js +236 -50
  99. package/dist/components/ui/skeleton.cjs +31 -5
  100. package/dist/components/ui/skeleton.js +31 -5
  101. package/dist/components/ui/slider.cjs +71 -21
  102. package/dist/components/ui/slider.js +71 -21
  103. package/dist/components/ui/sonner.cjs +43 -15
  104. package/dist/components/ui/sonner.js +43 -15
  105. package/dist/components/ui/spinner.cjs +83 -21
  106. package/dist/components/ui/spinner.js +83 -21
  107. package/dist/components/ui/stats-card.cjs +169 -60
  108. package/dist/components/ui/stats-card.js +169 -60
  109. package/dist/components/ui/stepper.cjs +126 -57
  110. package/dist/components/ui/stepper.js +126 -57
  111. package/dist/components/ui/switch.cjs +42 -8
  112. package/dist/components/ui/switch.js +42 -8
  113. package/dist/components/ui/table.cjs +267 -42
  114. package/dist/components/ui/table.js +267 -42
  115. package/dist/components/ui/tabs.cjs +100 -15
  116. package/dist/components/ui/tabs.js +100 -15
  117. package/dist/components/ui/textarea.cjs +34 -5
  118. package/dist/components/ui/textarea.js +34 -5
  119. package/dist/components/ui/toggle-group.cjs +112 -19
  120. package/dist/components/ui/toggle-group.js +112 -19
  121. package/dist/components/ui/toggle.cjs +43 -6
  122. package/dist/components/ui/toggle.js +43 -6
  123. package/dist/components/ui/tooltip.cjs +40 -6
  124. package/dist/components/ui/tooltip.js +40 -6
  125. package/dist/examples/admin-layout-example.cjs +879 -347
  126. package/dist/examples/admin-layout-example.js +879 -347
  127. package/dist/examples/app-shell-example.cjs +14 -14
  128. package/dist/examples/app-shell-example.js +14 -14
  129. package/dist/examples/dashboard-example.cjs +495 -334
  130. package/dist/examples/dashboard-example.js +495 -334
  131. package/dist/examples/data-management-example.cjs +501 -303
  132. package/dist/examples/data-management-example.js +502 -304
  133. package/dist/examples/flow-editor-layout-example.cjs +435 -231
  134. package/dist/examples/flow-editor-layout-example.js +436 -232
  135. package/dist/examples/flow-start-example.cjs +508 -251
  136. package/dist/examples/flow-start-example.js +509 -252
  137. package/dist/examples/form-builder-example.cjs +1006 -602
  138. package/dist/examples/form-builder-example.js +1007 -603
  139. package/dist/examples/new-project-example.cjs +806 -474
  140. package/dist/examples/new-project-example.js +807 -475
  141. package/dist/examples/settings-example.cjs +792 -704
  142. package/dist/examples/settings-example.js +792 -704
  143. package/dist/examples/vscode-example.cjs +731 -236
  144. package/dist/examples/vscode-example.js +731 -236
  145. package/package.json +5 -1
@@ -27,12 +27,13 @@ __webpack_require__.d(__webpack_exports__, {
27
27
  MetadataForm: ()=>MetadataForm
28
28
  });
29
29
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
30
+ const external_react_compiler_runtime_namespaceObject = require("react-compiler-runtime");
31
+ const standard_schema_namespaceObject = require("@hookform/resolvers/standard-schema");
30
32
  const external_react_namespaceObject = require("react");
31
33
  const external_react_hook_form_namespaceObject = require("react-hook-form");
32
34
  const v4_namespaceObject = require("zod/v4");
33
35
  const accordion_cjs_namespaceObject = require("../ui/accordion.cjs");
34
36
  const button_cjs_namespaceObject = require("../ui/button.cjs");
35
- const standard_schema_namespaceObject = require("@hookform/resolvers/standard-schema");
36
37
  const external_data_fetcher_cjs_namespaceObject = require("./data-fetcher.cjs");
37
38
  const external_field_renderer_cjs_namespaceObject = require("./field-renderer.cjs");
38
39
  const external_rules_engine_cjs_namespaceObject = require("./rules-engine.cjs");
@@ -52,8 +53,7 @@ function MetadataForm({ schema, plugins = DEFAULT_PLUGINS, onSubmit, className,
52
53
  });
53
54
  const { watch, handleSubmit, reset } = form;
54
55
  const valuesRef = (0, external_react_namespaceObject.useRef)({});
55
- const watchedValues = watch();
56
- valuesRef.current = watchedValues;
56
+ watch();
57
57
  const context = (0, external_react_namespaceObject.useMemo)(()=>({
58
58
  schema,
59
59
  form,
@@ -87,7 +87,22 @@ function MetadataForm({ schema, plugins = DEFAULT_PLUGINS, onSubmit, className,
87
87
  currentStep
88
88
  ]);
89
89
  const contextRef = (0, external_react_namespaceObject.useRef)(context);
90
- contextRef.current = context;
90
+ (0, external_react_namespaceObject.useEffect)(()=>{
91
+ contextRef.current = context;
92
+ });
93
+ (0, external_react_namespaceObject.useEffect)(()=>{
94
+ const subscription = watch((value, { name: name_0 })=>{
95
+ valuesRef.current = value;
96
+ if (isInitialized && name_0) plugins.forEach((plugin)=>{
97
+ plugin.onValueChange?.(name_0, value[name_0], contextRef.current);
98
+ });
99
+ });
100
+ return ()=>subscription.unsubscribe();
101
+ }, [
102
+ watch,
103
+ isInitialized,
104
+ plugins
105
+ ]);
91
106
  (0, external_react_namespaceObject.useEffect)(()=>{
92
107
  if (isInitialized) return;
93
108
  const initializeForm = async ()=>{
@@ -95,32 +110,16 @@ function MetadataForm({ schema, plugins = DEFAULT_PLUGINS, onSubmit, className,
95
110
  const data = await loadInitialData(schema.initialData, contextRef.current);
96
111
  reset(data);
97
112
  }
98
- for (const plugin of plugins)await plugin.onFormInit?.(contextRef.current);
113
+ for (const plugin_0 of plugins)await plugin_0.onFormInit?.(contextRef.current);
99
114
  setIsInitialized(true);
100
115
  };
101
116
  initializeForm();
102
117
  }, [
103
118
  isInitialized
104
119
  ]);
105
- (0, external_react_namespaceObject.useEffect)(()=>{
106
- if (!isInitialized) return;
107
- const subscription = watch((value, { name })=>{
108
- if (name) {
109
- valuesRef.current = value;
110
- plugins.forEach((plugin)=>{
111
- plugin.onValueChange?.(name, value[name], contextRef.current);
112
- });
113
- }
114
- });
115
- return ()=>subscription.unsubscribe();
116
- }, [
117
- watch,
118
- isInitialized,
119
- plugins
120
- ]);
121
- const handleFormSubmit = handleSubmit(async (data)=>{
122
- let finalData = data;
123
- for (const plugin of plugins)if (plugin.onSubmit) finalData = await plugin.onSubmit(finalData, context) || finalData;
120
+ const handleFormSubmit = handleSubmit(async (data_0)=>{
121
+ let finalData = data_0;
122
+ for (const plugin_1 of plugins)if (plugin_1.onSubmit) finalData = await plugin_1.onSubmit(finalData, context) || finalData;
124
123
  if (onSubmit) await onSubmit(finalData);
125
124
  });
126
125
  const renderContent = ()=>{
@@ -156,188 +155,459 @@ function MetadataForm({ schema, plugins = DEFAULT_PLUGINS, onSubmit, className,
156
155
  })
157
156
  });
158
157
  }
159
- function SinglePageForm({ schema, context, customComponents, disabled }) {
160
- const sections = schema.sections || [];
161
- const visibleSections = sections.filter((section)=>!section.conditions || context.evaluateConditions(section.conditions));
162
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
163
- className: "space-y-2",
164
- children: visibleSections.map((section)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(FormSection, {
165
- section: section,
166
- context: context,
167
- customComponents: customComponents,
168
- disabled: disabled
169
- }, section.id))
170
- });
158
+ function SinglePageForm(t0) {
159
+ const $ = (0, external_react_compiler_runtime_namespaceObject.c)(15);
160
+ const { schema, context, customComponents, disabled } = t0;
161
+ let t1;
162
+ let t2;
163
+ if ($[0] !== context || $[1] !== customComponents || $[2] !== disabled || $[3] !== schema.sections) {
164
+ const sections = schema.sections || [];
165
+ let t3;
166
+ if ($[6] !== context) {
167
+ t3 = (section)=>!section.conditions || context.evaluateConditions(section.conditions);
168
+ $[6] = context;
169
+ $[7] = t3;
170
+ } else t3 = $[7];
171
+ const visibleSections = sections.filter(t3);
172
+ t1 = "space-y-2";
173
+ let t4;
174
+ if ($[8] !== context || $[9] !== customComponents || $[10] !== disabled) {
175
+ t4 = (section_0)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(FormSection, {
176
+ section: section_0,
177
+ context: context,
178
+ customComponents: customComponents,
179
+ disabled: disabled
180
+ }, section_0.id);
181
+ $[8] = context;
182
+ $[9] = customComponents;
183
+ $[10] = disabled;
184
+ $[11] = t4;
185
+ } else t4 = $[11];
186
+ t2 = visibleSections.map(t4);
187
+ $[0] = context;
188
+ $[1] = customComponents;
189
+ $[2] = disabled;
190
+ $[3] = schema.sections;
191
+ $[4] = t1;
192
+ $[5] = t2;
193
+ } else {
194
+ t1 = $[4];
195
+ t2 = $[5];
196
+ }
197
+ let t3;
198
+ if ($[12] !== t1 || $[13] !== t2) {
199
+ t3 = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
200
+ className: t1,
201
+ children: t2
202
+ });
203
+ $[12] = t1;
204
+ $[13] = t2;
205
+ $[14] = t3;
206
+ } else t3 = $[14];
207
+ return t3;
171
208
  }
172
- function MultiStepForm({ schema, context, currentStep, setCurrentStep, customComponents, disabled }) {
173
- const steps = schema.steps || [];
209
+ function MultiStepForm(t0) {
210
+ const $ = (0, external_react_compiler_runtime_namespaceObject.c)(43);
211
+ const { schema, context, currentStep, setCurrentStep, customComponents, disabled } = t0;
212
+ let t1;
213
+ if ($[0] !== schema.steps) {
214
+ t1 = schema.steps || [];
215
+ $[0] = schema.steps;
216
+ $[1] = t1;
217
+ } else t1 = $[1];
218
+ const steps = t1;
174
219
  const step = steps[currentStep];
175
220
  if (!step) return null;
176
221
  if (step.conditions && !context.evaluateConditions(step.conditions)) {
177
222
  if (currentStep < steps.length - 1) setCurrentStep(currentStep + 1);
178
223
  return null;
179
224
  }
180
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
181
- className: "space-y-6",
182
- children: [
183
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
184
- className: "flex items-center justify-between",
185
- children: [
186
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
187
- children: [
188
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("h2", {
189
- className: "text-2xl font-semibold",
190
- children: step.title
191
- }),
192
- step.description && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("p", {
193
- className: "text-muted-foreground mt-1",
194
- children: step.description
195
- })
196
- ]
197
- }),
198
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
199
- className: "text-sm text-muted-foreground",
200
- children: [
201
- "Step ",
202
- currentStep + 1,
203
- " of ",
204
- steps.length
205
- ]
206
- })
207
- ]
208
- }),
209
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
210
- className: "space-y-2",
211
- children: step.sections.map((section)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(FormSection, {
212
- section: section,
213
- context: context,
214
- customComponents: customComponents,
215
- disabled: disabled
216
- }, section.id))
217
- }),
218
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
219
- className: "flex justify-between pt-6",
220
- children: [
221
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(button_cjs_namespaceObject.Button, {
222
- type: "button",
223
- onClick: ()=>setCurrentStep(Math.max(0, currentStep - 1)),
224
- disabled: 0 === currentStep,
225
- variant: "secondary",
226
- children: "Previous"
227
- }),
228
- currentStep < steps.length - 1 ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(button_cjs_namespaceObject.Button, {
229
- type: "button",
230
- onClick: ()=>setCurrentStep(currentStep + 1),
231
- variant: "default",
232
- children: "Next"
233
- }) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(button_cjs_namespaceObject.Button, {
234
- type: "submit",
235
- variant: "default",
236
- children: "Submit"
237
- })
238
- ]
239
- })
240
- ]
241
- });
225
+ let t2;
226
+ if ($[2] !== step.title) {
227
+ t2 = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("h2", {
228
+ className: "text-2xl font-semibold",
229
+ children: step.title
230
+ });
231
+ $[2] = step.title;
232
+ $[3] = t2;
233
+ } else t2 = $[3];
234
+ let t3;
235
+ if ($[4] !== step.description) {
236
+ t3 = step.description && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("p", {
237
+ className: "text-muted-foreground mt-1",
238
+ children: step.description
239
+ });
240
+ $[4] = step.description;
241
+ $[5] = t3;
242
+ } else t3 = $[5];
243
+ let t4;
244
+ if ($[6] !== t2 || $[7] !== t3) {
245
+ t4 = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
246
+ children: [
247
+ t2,
248
+ t3
249
+ ]
250
+ });
251
+ $[6] = t2;
252
+ $[7] = t3;
253
+ $[8] = t4;
254
+ } else t4 = $[8];
255
+ const t5 = currentStep + 1;
256
+ let t6;
257
+ if ($[9] !== steps.length || $[10] !== t5) {
258
+ t6 = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
259
+ className: "text-sm text-muted-foreground",
260
+ children: [
261
+ "Step ",
262
+ t5,
263
+ " of ",
264
+ steps.length
265
+ ]
266
+ });
267
+ $[9] = steps.length;
268
+ $[10] = t5;
269
+ $[11] = t6;
270
+ } else t6 = $[11];
271
+ let t7;
272
+ if ($[12] !== t4 || $[13] !== t6) {
273
+ t7 = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
274
+ className: "flex items-center justify-between",
275
+ children: [
276
+ t4,
277
+ t6
278
+ ]
279
+ });
280
+ $[12] = t4;
281
+ $[13] = t6;
282
+ $[14] = t7;
283
+ } else t7 = $[14];
284
+ let t8;
285
+ if ($[15] !== context || $[16] !== customComponents || $[17] !== disabled || $[18] !== step.sections) {
286
+ let t9;
287
+ if ($[20] !== context || $[21] !== customComponents || $[22] !== disabled) {
288
+ t9 = (section)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(FormSection, {
289
+ section: section,
290
+ context: context,
291
+ customComponents: customComponents,
292
+ disabled: disabled
293
+ }, section.id);
294
+ $[20] = context;
295
+ $[21] = customComponents;
296
+ $[22] = disabled;
297
+ $[23] = t9;
298
+ } else t9 = $[23];
299
+ t8 = step.sections.map(t9);
300
+ $[15] = context;
301
+ $[16] = customComponents;
302
+ $[17] = disabled;
303
+ $[18] = step.sections;
304
+ $[19] = t8;
305
+ } else t8 = $[19];
306
+ let t9;
307
+ if ($[24] !== t8) {
308
+ t9 = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
309
+ className: "space-y-2",
310
+ children: t8
311
+ });
312
+ $[24] = t8;
313
+ $[25] = t9;
314
+ } else t9 = $[25];
315
+ let t10;
316
+ if ($[26] !== currentStep || $[27] !== setCurrentStep) {
317
+ t10 = ()=>setCurrentStep(Math.max(0, currentStep - 1));
318
+ $[26] = currentStep;
319
+ $[27] = setCurrentStep;
320
+ $[28] = t10;
321
+ } else t10 = $[28];
322
+ const t11 = 0 === currentStep;
323
+ let t12;
324
+ if ($[29] !== t10 || $[30] !== t11) {
325
+ t12 = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(button_cjs_namespaceObject.Button, {
326
+ type: "button",
327
+ onClick: t10,
328
+ disabled: t11,
329
+ variant: "secondary",
330
+ children: "Previous"
331
+ });
332
+ $[29] = t10;
333
+ $[30] = t11;
334
+ $[31] = t12;
335
+ } else t12 = $[31];
336
+ let t13;
337
+ if ($[32] !== currentStep || $[33] !== setCurrentStep || $[34] !== steps.length) {
338
+ t13 = currentStep < steps.length - 1 ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(button_cjs_namespaceObject.Button, {
339
+ type: "button",
340
+ onClick: ()=>setCurrentStep(currentStep + 1),
341
+ variant: "default",
342
+ children: "Next"
343
+ }) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(button_cjs_namespaceObject.Button, {
344
+ type: "submit",
345
+ variant: "default",
346
+ children: "Submit"
347
+ });
348
+ $[32] = currentStep;
349
+ $[33] = setCurrentStep;
350
+ $[34] = steps.length;
351
+ $[35] = t13;
352
+ } else t13 = $[35];
353
+ let t14;
354
+ if ($[36] !== t12 || $[37] !== t13) {
355
+ t14 = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
356
+ className: "flex justify-between pt-6",
357
+ children: [
358
+ t12,
359
+ t13
360
+ ]
361
+ });
362
+ $[36] = t12;
363
+ $[37] = t13;
364
+ $[38] = t14;
365
+ } else t14 = $[38];
366
+ let t15;
367
+ if ($[39] !== t14 || $[40] !== t7 || $[41] !== t9) {
368
+ t15 = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
369
+ className: "space-y-6",
370
+ children: [
371
+ t7,
372
+ t9,
373
+ t14
374
+ ]
375
+ });
376
+ $[39] = t14;
377
+ $[40] = t7;
378
+ $[41] = t9;
379
+ $[42] = t15;
380
+ } else t15 = $[42];
381
+ return t15;
242
382
  }
243
- function FormSection({ section, context, customComponents, disabled }) {
383
+ function FormSection(t0) {
384
+ const $ = (0, external_react_compiler_runtime_namespaceObject.c)(41);
385
+ const { section, context, customComponents, disabled } = t0;
244
386
  const gridColumns = context.schema.layout?.columns || 1;
245
387
  const gap = context.schema.layout?.gap || 4;
246
- const fieldsGrid = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
247
- className: "grid",
248
- style: {
249
- gridTemplateColumns: `repeat(${gridColumns}, minmax(0, 1fr))`,
250
- gap: `${0.25 * gap}rem`
251
- },
252
- children: section.fields.map((field)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_field_renderer_cjs_namespaceObject.FormFieldRenderer, {
253
- field: field,
254
- context: context,
255
- customComponents: customComponents,
256
- disabled: disabled
257
- }, field.name))
258
- });
388
+ const t1 = `repeat(${gridColumns}, minmax(0, 1fr))`;
389
+ const t2 = `${0.25 * gap}rem`;
390
+ let t3;
391
+ if ($[0] !== t1 || $[1] !== t2) {
392
+ t3 = {
393
+ gridTemplateColumns: t1,
394
+ gap: t2
395
+ };
396
+ $[0] = t1;
397
+ $[1] = t2;
398
+ $[2] = t3;
399
+ } else t3 = $[2];
400
+ let t4;
401
+ if ($[3] !== context || $[4] !== customComponents || $[5] !== disabled || $[6] !== section.fields) {
402
+ let t5;
403
+ if ($[8] !== context || $[9] !== customComponents || $[10] !== disabled) {
404
+ t5 = (field)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_field_renderer_cjs_namespaceObject.FormFieldRenderer, {
405
+ field: field,
406
+ context: context,
407
+ customComponents: customComponents,
408
+ disabled: disabled
409
+ }, field.name);
410
+ $[8] = context;
411
+ $[9] = customComponents;
412
+ $[10] = disabled;
413
+ $[11] = t5;
414
+ } else t5 = $[11];
415
+ t4 = section.fields.map(t5);
416
+ $[3] = context;
417
+ $[4] = customComponents;
418
+ $[5] = disabled;
419
+ $[6] = section.fields;
420
+ $[7] = t4;
421
+ } else t4 = $[7];
422
+ let t5;
423
+ if ($[12] !== t3 || $[13] !== t4) {
424
+ t5 = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
425
+ className: "grid",
426
+ style: t3,
427
+ children: t4
428
+ });
429
+ $[12] = t3;
430
+ $[13] = t4;
431
+ $[14] = t5;
432
+ } else t5 = $[14];
433
+ const fieldsGrid = t5;
259
434
  if (!section.title) return fieldsGrid;
260
- const innerContent = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
261
- className: "flex flex-col gap-4",
262
- children: [
263
- section.description && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("p", {
264
- className: "text-sm text-muted-foreground",
265
- children: section.description
266
- }),
267
- fieldsGrid
268
- ]
269
- });
435
+ let t6;
436
+ if ($[15] !== section.description) {
437
+ t6 = section.description && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("p", {
438
+ className: "text-sm text-muted-foreground",
439
+ children: section.description
440
+ });
441
+ $[15] = section.description;
442
+ $[16] = t6;
443
+ } else t6 = $[16];
444
+ let t7;
445
+ if ($[17] !== fieldsGrid || $[18] !== t6) {
446
+ t7 = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
447
+ className: "flex flex-col gap-4",
448
+ children: [
449
+ t6,
450
+ fieldsGrid
451
+ ]
452
+ });
453
+ $[17] = fieldsGrid;
454
+ $[18] = t6;
455
+ $[19] = t7;
456
+ } else t7 = $[19];
457
+ const innerContent = t7;
270
458
  if (section.collapsible) {
271
- const defaultValue = false !== section.defaultExpanded ? [
272
- section.id
273
- ] : [];
274
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(accordion_cjs_namespaceObject.Accordion, {
275
- type: "multiple",
276
- defaultValue: defaultValue,
277
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(accordion_cjs_namespaceObject.AccordionItem, {
459
+ let t8;
460
+ if ($[20] !== section.defaultExpanded || $[21] !== section.id) {
461
+ t8 = false !== section.defaultExpanded ? [
462
+ section.id
463
+ ] : [];
464
+ $[20] = section.defaultExpanded;
465
+ $[21] = section.id;
466
+ $[22] = t8;
467
+ } else t8 = $[22];
468
+ const defaultValue = t8;
469
+ let t9;
470
+ if ($[23] !== section.title) {
471
+ t9 = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(accordion_cjs_namespaceObject.AccordionTrigger, {
472
+ className: "text-sm font-medium",
473
+ children: section.title
474
+ });
475
+ $[23] = section.title;
476
+ $[24] = t9;
477
+ } else t9 = $[24];
478
+ let t10;
479
+ if ($[25] !== innerContent) {
480
+ t10 = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(accordion_cjs_namespaceObject.AccordionContent, {
481
+ children: innerContent
482
+ });
483
+ $[25] = innerContent;
484
+ $[26] = t10;
485
+ } else t10 = $[26];
486
+ let t11;
487
+ if ($[27] !== section.id || $[28] !== t10 || $[29] !== t9) {
488
+ t11 = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(accordion_cjs_namespaceObject.AccordionItem, {
278
489
  value: section.id,
279
490
  className: "border rounded-lg px-3",
280
491
  children: [
281
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(accordion_cjs_namespaceObject.AccordionTrigger, {
282
- className: "text-sm font-medium",
283
- children: section.title
284
- }),
285
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(accordion_cjs_namespaceObject.AccordionContent, {
286
- children: innerContent
287
- })
492
+ t9,
493
+ t10
288
494
  ]
495
+ });
496
+ $[27] = section.id;
497
+ $[28] = t10;
498
+ $[29] = t9;
499
+ $[30] = t11;
500
+ } else t11 = $[30];
501
+ let t12;
502
+ if ($[31] !== defaultValue || $[32] !== t11) {
503
+ t12 = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(accordion_cjs_namespaceObject.Accordion, {
504
+ type: "multiple",
505
+ defaultValue: defaultValue,
506
+ children: t11
507
+ });
508
+ $[31] = defaultValue;
509
+ $[32] = t11;
510
+ $[33] = t12;
511
+ } else t12 = $[33];
512
+ return t12;
513
+ }
514
+ let t8;
515
+ if ($[34] !== section.title) {
516
+ t8 = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
517
+ className: "flex",
518
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
519
+ className: "flex flex-1 items-center justify-between py-4 text-sm font-medium",
520
+ children: section.title
289
521
  })
290
522
  });
291
- }
292
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
293
- className: "border rounded-lg px-3",
294
- children: [
295
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
296
- className: "flex",
297
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
298
- className: "flex flex-1 items-center justify-between py-4 text-sm font-medium",
299
- children: section.title
300
- })
301
- }),
302
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
303
- className: "text-sm",
304
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
305
- className: "pb-4 pt-0",
306
- children: innerContent
307
- })
523
+ $[34] = section.title;
524
+ $[35] = t8;
525
+ } else t8 = $[35];
526
+ let t9;
527
+ if ($[36] !== innerContent) {
528
+ t9 = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
529
+ className: "text-sm",
530
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
531
+ className: "pb-4 pt-0",
532
+ children: innerContent
308
533
  })
309
- ]
310
- });
534
+ });
535
+ $[36] = innerContent;
536
+ $[37] = t9;
537
+ } else t9 = $[37];
538
+ let t10;
539
+ if ($[38] !== t8 || $[39] !== t9) {
540
+ t10 = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
541
+ className: "border rounded-lg px-3",
542
+ children: [
543
+ t8,
544
+ t9
545
+ ]
546
+ });
547
+ $[38] = t8;
548
+ $[39] = t9;
549
+ $[40] = t10;
550
+ } else t10 = $[40];
551
+ return t10;
311
552
  }
312
- function FormActions({ schema, context, onReset }) {
313
- const actions = schema.actions || [
314
- {
315
- id: 'submit',
316
- type: 'submit',
317
- label: 'Submit',
318
- variant: 'default'
319
- }
320
- ];
553
+ function FormActions(t0) {
554
+ const $ = (0, external_react_compiler_runtime_namespaceObject.c)(11);
555
+ const { schema, context, onReset } = t0;
556
+ let t1;
557
+ if ($[0] !== schema.actions) {
558
+ t1 = schema.actions || [
559
+ {
560
+ id: "submit",
561
+ type: "submit",
562
+ label: "Submit",
563
+ variant: "default"
564
+ }
565
+ ];
566
+ $[0] = schema.actions;
567
+ $[1] = t1;
568
+ } else t1 = $[1];
569
+ const actions = t1;
321
570
  if (0 === actions.length) return null;
322
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
323
- className: "flex gap-2 pt-6",
324
- children: actions.map((action)=>{
325
- if (action.conditions && !context.evaluateConditions(action.conditions)) return null;
326
- if ('reset' === action.type) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(button_cjs_namespaceObject.Button, {
327
- type: "button",
328
- onClick: onReset,
329
- variant: action.variant || 'secondary',
330
- disabled: action.disabled,
331
- children: action.label
332
- }, action.id);
333
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(button_cjs_namespaceObject.Button, {
334
- type: 'submit' === action.type ? 'submit' : 'button',
335
- variant: action.variant || 'default',
336
- disabled: action.disabled || 'submit' === action.type && context.isSubmitting,
337
- children: action.loading && context.isSubmitting ? 'Loading...' : action.label
338
- }, action.id);
339
- })
340
- });
571
+ let t2;
572
+ if ($[2] !== actions || $[3] !== context || $[4] !== onReset) {
573
+ let t3;
574
+ if ($[6] !== context || $[7] !== onReset) {
575
+ t3 = (action)=>{
576
+ if (action.conditions && !context.evaluateConditions(action.conditions)) return null;
577
+ if ("reset" === action.type) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(button_cjs_namespaceObject.Button, {
578
+ type: "button",
579
+ onClick: onReset,
580
+ variant: action.variant || "secondary",
581
+ disabled: action.disabled,
582
+ children: action.label
583
+ }, action.id);
584
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(button_cjs_namespaceObject.Button, {
585
+ type: "submit" === action.type ? "submit" : "button",
586
+ variant: action.variant || "default",
587
+ disabled: action.disabled || "submit" === action.type && context.isSubmitting,
588
+ children: action.loading && context.isSubmitting ? "Loading..." : action.label
589
+ }, action.id);
590
+ };
591
+ $[6] = context;
592
+ $[7] = onReset;
593
+ $[8] = t3;
594
+ } else t3 = $[8];
595
+ t2 = actions.map(t3);
596
+ $[2] = actions;
597
+ $[3] = context;
598
+ $[4] = onReset;
599
+ $[5] = t2;
600
+ } else t2 = $[5];
601
+ let t3;
602
+ if ($[9] !== t2) {
603
+ t3 = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
604
+ className: "flex gap-2 pt-6",
605
+ children: t2
606
+ });
607
+ $[9] = t2;
608
+ $[10] = t3;
609
+ } else t3 = $[10];
610
+ return t3;
341
611
  }
342
612
  function buildZodSchema(schema) {
343
613
  const shape = {};