@uipath/apollo-wind 0.7.2-pr188.4865fad

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 (254) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +188 -0
  3. package/dist/components/forms/data-fetcher.cjs +250 -0
  4. package/dist/components/forms/data-fetcher.d.ts +173 -0
  5. package/dist/components/forms/data-fetcher.js +207 -0
  6. package/dist/components/forms/demo-mocks.cjs +1031 -0
  7. package/dist/components/forms/demo-mocks.d.ts +10 -0
  8. package/dist/components/forms/demo-mocks.js +997 -0
  9. package/dist/components/forms/field-renderer.cjs +595 -0
  10. package/dist/components/forms/field-renderer.d.ts +14 -0
  11. package/dist/components/forms/field-renderer.js +561 -0
  12. package/dist/components/forms/form-designer.cjs +2314 -0
  13. package/dist/components/forms/form-designer.d.ts +1 -0
  14. package/dist/components/forms/form-designer.js +2280 -0
  15. package/dist/components/forms/form-examples.cjs +962 -0
  16. package/dist/components/forms/form-examples.d.ts +46 -0
  17. package/dist/components/forms/form-examples.js +907 -0
  18. package/dist/components/forms/form-plugins.cjs +225 -0
  19. package/dist/components/forms/form-plugins.d.ts +11 -0
  20. package/dist/components/forms/form-plugins.js +176 -0
  21. package/dist/components/forms/form-schema.cjs +56 -0
  22. package/dist/components/forms/form-schema.d.ts +324 -0
  23. package/dist/components/forms/form-schema.js +13 -0
  24. package/dist/components/forms/form-state-viewer.cjs +498 -0
  25. package/dist/components/forms/form-state-viewer.d.ts +15 -0
  26. package/dist/components/forms/form-state-viewer.js +464 -0
  27. package/dist/components/forms/index.cjs +103 -0
  28. package/dist/components/forms/index.d.ts +13 -0
  29. package/dist/components/forms/index.js +9 -0
  30. package/dist/components/forms/metadata-form.cjs +400 -0
  31. package/dist/components/forms/metadata-form.d.ts +16 -0
  32. package/dist/components/forms/metadata-form.js +366 -0
  33. package/dist/components/forms/rules-engine.cjs +343 -0
  34. package/dist/components/forms/rules-engine.d.ts +99 -0
  35. package/dist/components/forms/rules-engine.js +293 -0
  36. package/dist/components/forms/schema-serializer.cjs +250 -0
  37. package/dist/components/forms/schema-serializer.d.ts +27 -0
  38. package/dist/components/forms/schema-serializer.js +213 -0
  39. package/dist/components/forms/schema-viewer.cjs +157 -0
  40. package/dist/components/forms/schema-viewer.d.ts +29 -0
  41. package/dist/components/forms/schema-viewer.js +117 -0
  42. package/dist/components/forms/validation-converter.cjs +154 -0
  43. package/dist/components/forms/validation-converter.d.ts +42 -0
  44. package/dist/components/forms/validation-converter.js +114 -0
  45. package/dist/components/ui/accordion.cjs +82 -0
  46. package/dist/components/ui/accordion.d.ts +7 -0
  47. package/dist/components/ui/accordion.js +39 -0
  48. package/dist/components/ui/alert-dialog.cjs +126 -0
  49. package/dist/components/ui/alert-dialog.d.ts +20 -0
  50. package/dist/components/ui/alert-dialog.js +62 -0
  51. package/dist/components/ui/alert.cjs +77 -0
  52. package/dist/components/ui/alert.d.ts +8 -0
  53. package/dist/components/ui/alert.js +37 -0
  54. package/dist/components/ui/aspect-ratio.cjs +38 -0
  55. package/dist/components/ui/aspect-ratio.d.ts +3 -0
  56. package/dist/components/ui/aspect-ratio.js +4 -0
  57. package/dist/components/ui/avatar.cjs +63 -0
  58. package/dist/components/ui/avatar.d.ts +6 -0
  59. package/dist/components/ui/avatar.js +23 -0
  60. package/dist/components/ui/badge.cjs +63 -0
  61. package/dist/components/ui/badge.d.ts +9 -0
  62. package/dist/components/ui/badge.js +26 -0
  63. package/dist/components/ui/breadcrumb.cjs +118 -0
  64. package/dist/components/ui/breadcrumb.d.ts +19 -0
  65. package/dist/components/ui/breadcrumb.js +66 -0
  66. package/dist/components/ui/button-group.cjs +68 -0
  67. package/dist/components/ui/button-group.d.ts +14 -0
  68. package/dist/components/ui/button-group.js +28 -0
  69. package/dist/components/ui/button.cjs +78 -0
  70. package/dist/components/ui/button.d.ts +11 -0
  71. package/dist/components/ui/button.js +41 -0
  72. package/dist/components/ui/calendar.cjs +144 -0
  73. package/dist/components/ui/calendar.d.ts +8 -0
  74. package/dist/components/ui/calendar.js +107 -0
  75. package/dist/components/ui/card.cjs +89 -0
  76. package/dist/components/ui/card.d.ts +8 -0
  77. package/dist/components/ui/card.js +40 -0
  78. package/dist/components/ui/checkbox.cjs +52 -0
  79. package/dist/components/ui/checkbox.d.ts +6 -0
  80. package/dist/components/ui/checkbox.js +18 -0
  81. package/dist/components/ui/collapsible.cjs +45 -0
  82. package/dist/components/ui/collapsible.d.ts +5 -0
  83. package/dist/components/ui/collapsible.js +5 -0
  84. package/dist/components/ui/combobox.cjs +102 -0
  85. package/dist/components/ui/combobox.d.ts +15 -0
  86. package/dist/components/ui/combobox.js +68 -0
  87. package/dist/components/ui/command.cjs +131 -0
  88. package/dist/components/ui/command.d.ts +80 -0
  89. package/dist/components/ui/command.js +73 -0
  90. package/dist/components/ui/context-menu.cjs +173 -0
  91. package/dist/components/ui/context-menu.d.ts +27 -0
  92. package/dist/components/ui/context-menu.js +97 -0
  93. package/dist/components/ui/data-table.cjs +292 -0
  94. package/dist/components/ui/data-table.d.ts +23 -0
  95. package/dist/components/ui/data-table.js +252 -0
  96. package/dist/components/ui/date-picker.cjs +118 -0
  97. package/dist/components/ui/date-picker.d.ts +21 -0
  98. package/dist/components/ui/date-picker.js +81 -0
  99. package/dist/components/ui/datetime-picker.cjs +154 -0
  100. package/dist/components/ui/datetime-picker.d.ts +9 -0
  101. package/dist/components/ui/datetime-picker.js +120 -0
  102. package/dist/components/ui/dialog.cjs +159 -0
  103. package/dist/components/ui/dialog.d.ts +15 -0
  104. package/dist/components/ui/dialog.js +98 -0
  105. package/dist/components/ui/drawer.cjs +116 -0
  106. package/dist/components/ui/drawer.d.ts +18 -0
  107. package/dist/components/ui/drawer.js +55 -0
  108. package/dist/components/ui/dropdown-menu.cjs +174 -0
  109. package/dist/components/ui/dropdown-menu.d.ts +27 -0
  110. package/dist/components/ui/dropdown-menu.js +98 -0
  111. package/dist/components/ui/editable-cell.cjs +256 -0
  112. package/dist/components/ui/editable-cell.d.ts +24 -0
  113. package/dist/components/ui/editable-cell.js +219 -0
  114. package/dist/components/ui/empty-state.cjs +73 -0
  115. package/dist/components/ui/empty-state.d.ts +16 -0
  116. package/dist/components/ui/empty-state.js +39 -0
  117. package/dist/components/ui/file-upload.cjs +236 -0
  118. package/dist/components/ui/file-upload.d.ts +10 -0
  119. package/dist/components/ui/file-upload.js +202 -0
  120. package/dist/components/ui/hover-card.cjs +55 -0
  121. package/dist/components/ui/hover-card.d.ts +6 -0
  122. package/dist/components/ui/hover-card.js +15 -0
  123. package/dist/components/ui/index.cjs +546 -0
  124. package/dist/components/ui/index.d.ts +55 -0
  125. package/dist/components/ui/index.js +55 -0
  126. package/dist/components/ui/input.cjs +45 -0
  127. package/dist/components/ui/input.d.ts +5 -0
  128. package/dist/components/ui/input.js +11 -0
  129. package/dist/components/ui/label.cjs +47 -0
  130. package/dist/components/ui/label.d.ts +7 -0
  131. package/dist/components/ui/label.js +13 -0
  132. package/dist/components/ui/layout/column.cjs +84 -0
  133. package/dist/components/ui/layout/column.d.ts +21 -0
  134. package/dist/components/ui/layout/column.js +50 -0
  135. package/dist/components/ui/layout/grid.cjs +101 -0
  136. package/dist/components/ui/layout/grid.d.ts +22 -0
  137. package/dist/components/ui/layout/grid.js +67 -0
  138. package/dist/components/ui/layout/index.cjs +44 -0
  139. package/dist/components/ui/layout/index.d.ts +7 -0
  140. package/dist/components/ui/layout/index.js +4 -0
  141. package/dist/components/ui/layout/row.cjs +84 -0
  142. package/dist/components/ui/layout/row.d.ts +21 -0
  143. package/dist/components/ui/layout/row.js +50 -0
  144. package/dist/components/ui/layout/types.cjs +18 -0
  145. package/dist/components/ui/layout/types.d.ts +149 -0
  146. package/dist/components/ui/layout/types.js +0 -0
  147. package/dist/components/ui/layout/utils.cjs +324 -0
  148. package/dist/components/ui/layout/utils.d.ts +76 -0
  149. package/dist/components/ui/layout/utils.js +239 -0
  150. package/dist/components/ui/menubar.cjs +210 -0
  151. package/dist/components/ui/menubar.d.ts +28 -0
  152. package/dist/components/ui/menubar.js +131 -0
  153. package/dist/components/ui/multi-select.cjs +187 -0
  154. package/dist/components/ui/multi-select.d.ts +18 -0
  155. package/dist/components/ui/multi-select.js +153 -0
  156. package/dist/components/ui/navigation-menu.cjs +122 -0
  157. package/dist/components/ui/navigation-menu.d.ts +12 -0
  158. package/dist/components/ui/navigation-menu.js +64 -0
  159. package/dist/components/ui/pagination.cjs +131 -0
  160. package/dist/components/ui/pagination.d.ts +28 -0
  161. package/dist/components/ui/pagination.js +79 -0
  162. package/dist/components/ui/popover.cjs +61 -0
  163. package/dist/components/ui/popover.d.ts +7 -0
  164. package/dist/components/ui/popover.js +18 -0
  165. package/dist/components/ui/progress.cjs +51 -0
  166. package/dist/components/ui/progress.d.ts +4 -0
  167. package/dist/components/ui/progress.js +17 -0
  168. package/dist/components/ui/radio-group.cjs +61 -0
  169. package/dist/components/ui/radio-group.d.ts +5 -0
  170. package/dist/components/ui/radio-group.js +24 -0
  171. package/dist/components/ui/resizable.cjs +60 -0
  172. package/dist/components/ui/resizable.d.ts +23 -0
  173. package/dist/components/ui/resizable.js +20 -0
  174. package/dist/components/ui/scroll-area.cjs +67 -0
  175. package/dist/components/ui/scroll-area.d.ts +5 -0
  176. package/dist/components/ui/scroll-area.js +30 -0
  177. package/dist/components/ui/search.cjs +153 -0
  178. package/dist/components/ui/search.d.ts +19 -0
  179. package/dist/components/ui/search.js +116 -0
  180. package/dist/components/ui/select.cjs +151 -0
  181. package/dist/components/ui/select.d.ts +13 -0
  182. package/dist/components/ui/select.js +90 -0
  183. package/dist/components/ui/separator.cjs +47 -0
  184. package/dist/components/ui/separator.d.ts +4 -0
  185. package/dist/components/ui/separator.js +13 -0
  186. package/dist/components/ui/sheet.cjs +142 -0
  187. package/dist/components/ui/sheet.d.ts +25 -0
  188. package/dist/components/ui/sheet.js +81 -0
  189. package/dist/components/ui/skeleton.cjs +43 -0
  190. package/dist/components/ui/skeleton.d.ts +2 -0
  191. package/dist/components/ui/skeleton.js +9 -0
  192. package/dist/components/ui/slider.cjs +63 -0
  193. package/dist/components/ui/slider.d.ts +4 -0
  194. package/dist/components/ui/slider.js +29 -0
  195. package/dist/components/ui/sonner.cjs +76 -0
  196. package/dist/components/ui/sonner.d.ts +4 -0
  197. package/dist/components/ui/sonner.js +39 -0
  198. package/dist/components/ui/spinner.cjs +78 -0
  199. package/dist/components/ui/spinner.d.ts +11 -0
  200. package/dist/components/ui/spinner.js +41 -0
  201. package/dist/components/ui/stats-card.cjs +102 -0
  202. package/dist/components/ui/stats-card.d.ts +15 -0
  203. package/dist/components/ui/stats-card.js +68 -0
  204. package/dist/components/ui/stepper.cjs +99 -0
  205. package/dist/components/ui/stepper.d.ts +14 -0
  206. package/dist/components/ui/stepper.js +65 -0
  207. package/dist/components/ui/switch.cjs +48 -0
  208. package/dist/components/ui/switch.d.ts +4 -0
  209. package/dist/components/ui/switch.js +14 -0
  210. package/dist/components/ui/table.cjs +110 -0
  211. package/dist/components/ui/table.d.ts +10 -0
  212. package/dist/components/ui/table.js +55 -0
  213. package/dist/components/ui/tabs.cjs +67 -0
  214. package/dist/components/ui/tabs.d.ts +7 -0
  215. package/dist/components/ui/tabs.js +24 -0
  216. package/dist/components/ui/textarea.cjs +44 -0
  217. package/dist/components/ui/textarea.d.ts +4 -0
  218. package/dist/components/ui/textarea.js +10 -0
  219. package/dist/components/ui/toggle-group.cjs +73 -0
  220. package/dist/components/ui/toggle-group.d.ts +12 -0
  221. package/dist/components/ui/toggle-group.js +36 -0
  222. package/dist/components/ui/toggle.cjs +71 -0
  223. package/dist/components/ui/toggle.d.ts +12 -0
  224. package/dist/components/ui/toggle.js +34 -0
  225. package/dist/components/ui/tooltip.cjs +58 -0
  226. package/dist/components/ui/tooltip.d.ts +7 -0
  227. package/dist/components/ui/tooltip.js +15 -0
  228. package/dist/examples/admin-layout-example.d.ts +92 -0
  229. package/dist/examples/app-shell-example.d.ts +52 -0
  230. package/dist/examples/dashboard-example.d.ts +11 -0
  231. package/dist/examples/data-management-example.d.ts +1 -0
  232. package/dist/examples/flow-editor-layout-example.d.ts +22 -0
  233. package/dist/examples/flow-start-example.d.ts +30 -0
  234. package/dist/examples/form-builder-example.d.ts +1 -0
  235. package/dist/examples/new-project-example.d.ts +30 -0
  236. package/dist/examples/settings-example.d.ts +1 -0
  237. package/dist/examples/vscode-example.d.ts +80 -0
  238. package/dist/index.cjs +830 -0
  239. package/dist/index.d.ts +86 -0
  240. package/dist/index.js +67 -0
  241. package/dist/lib/index.cjs +42 -0
  242. package/dist/lib/index.d.ts +1 -0
  243. package/dist/lib/index.js +2 -0
  244. package/dist/lib/utils.cjs +70 -0
  245. package/dist/lib/utils.d.ts +14 -0
  246. package/dist/lib/utils.js +30 -0
  247. package/dist/postcss.config.export.cjs +43 -0
  248. package/dist/postcss.config.export.js +9 -0
  249. package/dist/styles.css +6868 -0
  250. package/dist/tailwind.css +239 -0
  251. package/dist/tailwind.preset.cjs +77 -0
  252. package/dist/tailwind.preset.js +43 -0
  253. package/package.json +157 -0
  254. package/postcss.config.export.js +9 -0
@@ -0,0 +1,907 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { toast } from "sonner";
4
+ import { MetadataForm } from "./metadata-form.js";
5
+ import { RuleBuilder } from "./rules-engine.js";
6
+ import { Card, CardContent, CardHeader, CardTitle } from "../ui/card.js";
7
+ import { Badge } from "../ui/badge.js";
8
+ const cascadingDropdownsSchema = {
9
+ id: 'user-registration',
10
+ title: 'User Registration',
11
+ description: 'Create your account with location details',
12
+ sections: [
13
+ {
14
+ id: 'personal',
15
+ title: 'Personal Information',
16
+ fields: [
17
+ {
18
+ name: 'fullName',
19
+ type: 'text',
20
+ label: 'Full Name',
21
+ placeholder: 'John Doe',
22
+ validation: {
23
+ required: true,
24
+ minLength: 2,
25
+ messages: {
26
+ minLength: 'Name must be at least 2 characters'
27
+ }
28
+ }
29
+ },
30
+ {
31
+ name: 'email',
32
+ type: 'email',
33
+ label: 'Email Address',
34
+ placeholder: 'john@example.com',
35
+ validation: {
36
+ required: true,
37
+ email: true,
38
+ messages: {
39
+ email: 'Invalid email address'
40
+ }
41
+ }
42
+ }
43
+ ]
44
+ },
45
+ {
46
+ id: 'location',
47
+ title: 'Location Details',
48
+ description: 'Select your country, state, and city',
49
+ fields: [
50
+ {
51
+ name: 'country',
52
+ type: 'select',
53
+ label: 'Country',
54
+ placeholder: 'Select your country',
55
+ dataSource: {
56
+ type: 'fetch',
57
+ url: '/api/countries',
58
+ method: 'GET',
59
+ transform: 'data.map(c => ({ label: c.name, value: c.code }))'
60
+ },
61
+ validation: {
62
+ required: true,
63
+ messages: {
64
+ required: 'Country is required'
65
+ }
66
+ }
67
+ },
68
+ {
69
+ name: 'state',
70
+ type: 'select',
71
+ label: 'State/Province',
72
+ placeholder: 'Select your state',
73
+ dataSource: {
74
+ type: 'remote',
75
+ endpoint: '/api/states',
76
+ params: {
77
+ countryCode: '$country'
78
+ }
79
+ },
80
+ rules: [
81
+ new RuleBuilder('show-state-when-country-selected').when('country').isNot('').show().require().build()
82
+ ]
83
+ },
84
+ {
85
+ name: 'city',
86
+ type: 'select',
87
+ label: 'City',
88
+ placeholder: 'Select your city',
89
+ dataSource: {
90
+ type: 'remote',
91
+ endpoint: '/api/cities',
92
+ params: {
93
+ countryCode: '$country',
94
+ stateCode: '$state'
95
+ }
96
+ },
97
+ rules: [
98
+ new RuleBuilder('show-city-when-state-selected').when('state').isNot('').show().require().build()
99
+ ]
100
+ }
101
+ ]
102
+ }
103
+ ]
104
+ };
105
+ const computedFieldsSchema = {
106
+ id: 'product-configurator',
107
+ title: 'Product Configuration',
108
+ description: 'Customize your product',
109
+ sections: [
110
+ {
111
+ id: 'product-selection',
112
+ title: 'Select Your Product',
113
+ fields: [
114
+ {
115
+ name: 'category',
116
+ type: 'select',
117
+ label: 'Product Category',
118
+ dataSource: {
119
+ type: 'fetch',
120
+ url: '/api/product-categories',
121
+ method: 'GET',
122
+ transform: 'data.categories.map(c => ({ label: c.name, value: c.id }))'
123
+ }
124
+ },
125
+ {
126
+ name: 'product',
127
+ type: 'select',
128
+ label: 'Select Product',
129
+ dataSource: {
130
+ type: 'remote',
131
+ endpoint: '/api/products',
132
+ params: {
133
+ categoryId: '$category'
134
+ }
135
+ },
136
+ rules: [
137
+ new RuleBuilder('show-product-when-category-selected').when('category').isNot('').show().require().build()
138
+ ]
139
+ },
140
+ {
141
+ name: 'variant',
142
+ type: 'select',
143
+ label: 'Product Variant (includes price)',
144
+ dataSource: {
145
+ type: 'remote',
146
+ endpoint: '/api/product-variants',
147
+ params: {
148
+ productId: '$product'
149
+ }
150
+ },
151
+ rules: [
152
+ new RuleBuilder('show-variant-when-product-selected').when('product').isNot('').show().require().build()
153
+ ]
154
+ }
155
+ ]
156
+ },
157
+ {
158
+ id: 'order',
159
+ title: 'Order Details',
160
+ fields: [
161
+ {
162
+ name: 'quantity',
163
+ type: 'number',
164
+ label: 'Quantity',
165
+ placeholder: '1',
166
+ min: 1,
167
+ max: 100,
168
+ defaultValue: 1,
169
+ validation: {
170
+ required: true,
171
+ min: 1,
172
+ max: 100
173
+ }
174
+ },
175
+ {
176
+ name: 'notes',
177
+ type: 'textarea',
178
+ label: 'Order Notes',
179
+ placeholder: 'Any special instructions...'
180
+ }
181
+ ]
182
+ }
183
+ ]
184
+ };
185
+ const conditionalSectionsSchema = {
186
+ id: 'job-application',
187
+ title: 'Job Application',
188
+ description: 'Apply for a position at our company',
189
+ sections: [
190
+ {
191
+ id: 'basic-info',
192
+ title: 'Basic Information',
193
+ fields: [
194
+ {
195
+ name: 'firstName',
196
+ type: 'text',
197
+ label: 'First Name',
198
+ validation: {
199
+ required: true
200
+ }
201
+ },
202
+ {
203
+ name: 'lastName',
204
+ type: 'text',
205
+ label: 'Last Name',
206
+ validation: {
207
+ required: true
208
+ }
209
+ },
210
+ {
211
+ name: 'email',
212
+ type: 'email',
213
+ label: 'Email',
214
+ validation: {
215
+ required: true,
216
+ email: true
217
+ }
218
+ }
219
+ ]
220
+ },
221
+ {
222
+ id: 'position',
223
+ title: 'Position Details',
224
+ fields: [
225
+ {
226
+ name: 'department',
227
+ type: 'select',
228
+ label: 'Department',
229
+ dataSource: {
230
+ type: 'fetch',
231
+ url: '/api/departments',
232
+ method: 'GET',
233
+ transform: 'data.map(d => ({ label: d.name, value: d.id }))'
234
+ }
235
+ },
236
+ {
237
+ name: 'position',
238
+ type: 'select',
239
+ label: 'Position',
240
+ dataSource: {
241
+ type: 'remote',
242
+ endpoint: '/api/positions',
243
+ params: {
244
+ departmentId: '$department'
245
+ }
246
+ },
247
+ rules: [
248
+ new RuleBuilder('show-position').when('department').isNot('').show().require().build()
249
+ ]
250
+ },
251
+ {
252
+ name: 'experienceLevel',
253
+ type: 'select',
254
+ label: 'Experience Level',
255
+ options: [
256
+ {
257
+ label: 'Entry Level (0-2 years)',
258
+ value: 'entry'
259
+ },
260
+ {
261
+ label: 'Mid Level (3-5 years)',
262
+ value: 'mid'
263
+ },
264
+ {
265
+ label: 'Senior Level (6+ years)',
266
+ value: 'senior'
267
+ }
268
+ ]
269
+ }
270
+ ]
271
+ },
272
+ {
273
+ id: 'skills',
274
+ title: 'Technical Skills',
275
+ description: 'Select your relevant skills',
276
+ fields: [
277
+ {
278
+ name: 'primarySkills',
279
+ type: 'multiselect',
280
+ label: 'Primary Skills',
281
+ placeholder: 'Select your primary skills...',
282
+ validation: {
283
+ required: true,
284
+ minItems: 1,
285
+ messages: {
286
+ minItems: 'Select at least one skill'
287
+ }
288
+ },
289
+ options: [
290
+ {
291
+ label: 'JavaScript',
292
+ value: "javascript"
293
+ },
294
+ {
295
+ label: 'TypeScript',
296
+ value: "typescript"
297
+ },
298
+ {
299
+ label: 'Python',
300
+ value: 'python'
301
+ },
302
+ {
303
+ label: 'Java',
304
+ value: 'java'
305
+ },
306
+ {
307
+ label: 'C#',
308
+ value: 'csharp'
309
+ },
310
+ {
311
+ label: 'Go',
312
+ value: 'go'
313
+ },
314
+ {
315
+ label: 'React',
316
+ value: 'react'
317
+ },
318
+ {
319
+ label: 'Node.js',
320
+ value: 'nodejs'
321
+ }
322
+ ]
323
+ }
324
+ ]
325
+ },
326
+ {
327
+ id: 'experience',
328
+ title: 'Work Experience',
329
+ conditions: [
330
+ {
331
+ when: 'experienceLevel',
332
+ in: [
333
+ 'mid',
334
+ 'senior'
335
+ ]
336
+ }
337
+ ],
338
+ fields: [
339
+ {
340
+ name: 'currentCompany',
341
+ type: 'text',
342
+ label: 'Current Company'
343
+ },
344
+ {
345
+ name: 'yearsExperience',
346
+ type: 'number',
347
+ label: 'Years of Experience',
348
+ min: 0,
349
+ max: 50
350
+ },
351
+ {
352
+ name: 'references',
353
+ type: 'textarea',
354
+ label: 'Professional References',
355
+ placeholder: 'List 2-3 professional references',
356
+ rules: [
357
+ new RuleBuilder('require-references-senior').when('experienceLevel').is('senior').require().build()
358
+ ]
359
+ }
360
+ ]
361
+ }
362
+ ]
363
+ };
364
+ const conditionalQuestionsSchema = {
365
+ id: 'dynamic-survey',
366
+ title: 'Customer Satisfaction Survey',
367
+ description: 'Help us improve our service',
368
+ sections: [
369
+ {
370
+ id: 'satisfaction',
371
+ title: 'Overall Satisfaction',
372
+ fields: [
373
+ {
374
+ name: 'overallRating',
375
+ type: 'slider',
376
+ label: 'How satisfied are you with our service?',
377
+ min: 1,
378
+ max: 10,
379
+ step: 1,
380
+ defaultValue: 5
381
+ },
382
+ {
383
+ name: 'feedbackReason',
384
+ type: 'textarea',
385
+ label: 'What is the main reason for your rating?',
386
+ placeholder: 'Please tell us more...',
387
+ rules: [
388
+ new RuleBuilder('show-feedback-low').withCustomExpression('overallRating <= 6').show().require().build()
389
+ ]
390
+ }
391
+ ]
392
+ },
393
+ {
394
+ id: 'recommendations',
395
+ title: 'Recommendations',
396
+ fields: [
397
+ {
398
+ name: 'wouldRecommend',
399
+ type: 'radio',
400
+ label: 'Would you recommend us to others?',
401
+ options: [
402
+ {
403
+ label: 'Definitely Yes',
404
+ value: 'yes'
405
+ },
406
+ {
407
+ label: 'Probably Yes',
408
+ value: 'maybe-yes'
409
+ },
410
+ {
411
+ label: 'Not Sure',
412
+ value: 'unsure'
413
+ },
414
+ {
415
+ label: 'Probably Not',
416
+ value: 'maybe-no'
417
+ },
418
+ {
419
+ label: 'Definitely Not',
420
+ value: 'no'
421
+ }
422
+ ]
423
+ },
424
+ {
425
+ name: 'improvementSuggestions',
426
+ type: 'textarea',
427
+ label: 'How can we improve?',
428
+ placeholder: 'Your suggestions are valuable to us...',
429
+ rules: [
430
+ new RuleBuilder('show-improvements').when('wouldRecommend').in([
431
+ 'unsure',
432
+ 'maybe-no',
433
+ 'no'
434
+ ]).show().require().build()
435
+ ]
436
+ }
437
+ ]
438
+ }
439
+ ]
440
+ };
441
+ const automationJobSchema = {
442
+ id: 'automation-job-config',
443
+ title: 'Configure Automation Job',
444
+ description: 'Set up an automation process execution',
445
+ sections: [
446
+ {
447
+ id: 'process',
448
+ title: 'Process Selection',
449
+ fields: [
450
+ {
451
+ name: 'folder',
452
+ type: 'select',
453
+ label: 'Orchestrator Folder',
454
+ dataSource: {
455
+ type: 'fetch',
456
+ url: '/api/orchestrator/folders',
457
+ method: 'GET',
458
+ transform: 'data.value.map(f => ({ label: f.DisplayName, value: f.Id }))'
459
+ }
460
+ },
461
+ {
462
+ name: 'process',
463
+ type: 'select',
464
+ label: 'Process Package',
465
+ dataSource: {
466
+ type: 'remote',
467
+ endpoint: '/api/orchestrator/processes',
468
+ params: {
469
+ folderId: '$folder'
470
+ }
471
+ },
472
+ rules: [
473
+ new RuleBuilder('show-process').when('folder').isNot('').show().require().build()
474
+ ]
475
+ },
476
+ {
477
+ name: 'version',
478
+ type: 'select',
479
+ label: 'Package Version',
480
+ dataSource: {
481
+ type: 'remote',
482
+ endpoint: '/api/orchestrator/package-versions',
483
+ params: {
484
+ processKey: '$process'
485
+ }
486
+ },
487
+ rules: [
488
+ new RuleBuilder('show-version').when('process').isNot('').show().require().build()
489
+ ]
490
+ }
491
+ ]
492
+ },
493
+ {
494
+ id: 'execution',
495
+ title: 'Execution Settings',
496
+ fields: [
497
+ {
498
+ name: 'robot',
499
+ type: 'select',
500
+ label: 'Robot',
501
+ dataSource: {
502
+ type: 'remote',
503
+ endpoint: '/api/orchestrator/robots',
504
+ params: {
505
+ folderId: '$folder'
506
+ }
507
+ },
508
+ rules: [
509
+ new RuleBuilder('show-robot').when('folder').isNot('').show().require().build()
510
+ ]
511
+ },
512
+ {
513
+ name: 'priority',
514
+ type: 'select',
515
+ label: 'Priority',
516
+ options: [
517
+ {
518
+ label: 'Low',
519
+ value: 'Low'
520
+ },
521
+ {
522
+ label: 'Normal',
523
+ value: 'Normal'
524
+ },
525
+ {
526
+ label: 'High',
527
+ value: 'High'
528
+ }
529
+ ],
530
+ defaultValue: 'Normal'
531
+ },
532
+ {
533
+ name: 'inputArguments',
534
+ type: 'textarea',
535
+ label: 'Input Arguments (JSON)',
536
+ placeholder: '{"argument1": "value1"}'
537
+ }
538
+ ]
539
+ }
540
+ ]
541
+ };
542
+ const multiStepSchema = {
543
+ id: 'user-onboarding',
544
+ title: "Welcome! Let's set up your account",
545
+ description: 'Complete these steps to get started',
546
+ initialData: {
547
+ firstName: '',
548
+ lastName: '',
549
+ timezone: '',
550
+ emailNotifications: true,
551
+ notificationFrequency: 'daily',
552
+ acceptTerms: false
553
+ },
554
+ steps: [
555
+ {
556
+ id: 'personal',
557
+ title: 'Personal Information',
558
+ description: 'Tell us about yourself',
559
+ sections: [
560
+ {
561
+ id: 'basic',
562
+ fields: [
563
+ {
564
+ name: 'firstName',
565
+ type: 'text',
566
+ label: 'First Name',
567
+ validation: {
568
+ required: true
569
+ }
570
+ },
571
+ {
572
+ name: 'lastName',
573
+ type: 'text',
574
+ label: 'Last Name',
575
+ validation: {
576
+ required: true
577
+ }
578
+ },
579
+ {
580
+ name: 'timezone',
581
+ type: 'select',
582
+ label: 'Timezone',
583
+ dataSource: {
584
+ type: 'fetch',
585
+ url: '/api/timezones',
586
+ method: 'GET',
587
+ transform: 'data.map(tz => ({ label: tz.label, value: tz.value }))'
588
+ }
589
+ }
590
+ ]
591
+ }
592
+ ]
593
+ },
594
+ {
595
+ id: 'preferences',
596
+ title: 'Preferences',
597
+ description: 'Customize your experience',
598
+ sections: [
599
+ {
600
+ id: 'notifications',
601
+ fields: [
602
+ {
603
+ name: 'emailNotifications',
604
+ type: 'switch',
605
+ label: 'Email Notifications',
606
+ description: 'Receive updates via email',
607
+ defaultValue: true
608
+ },
609
+ {
610
+ name: 'notificationFrequency',
611
+ type: 'select',
612
+ label: 'Notification Frequency',
613
+ options: [
614
+ {
615
+ label: 'Real-time',
616
+ value: 'realtime'
617
+ },
618
+ {
619
+ label: 'Daily Digest',
620
+ value: 'daily'
621
+ },
622
+ {
623
+ label: 'Weekly Digest',
624
+ value: 'weekly'
625
+ }
626
+ ],
627
+ rules: [
628
+ new RuleBuilder('show-frequency').when('emailNotifications').is(true).show().require().build()
629
+ ]
630
+ }
631
+ ]
632
+ }
633
+ ]
634
+ },
635
+ {
636
+ id: 'complete',
637
+ title: 'All Set!',
638
+ description: 'Review and confirm your settings',
639
+ sections: [
640
+ {
641
+ id: 'summary',
642
+ fields: [
643
+ {
644
+ name: 'acceptTerms',
645
+ type: 'checkbox',
646
+ label: 'I accept the Terms of Service and Privacy Policy',
647
+ validation: {
648
+ required: true,
649
+ messages: {
650
+ required: 'You must accept the terms'
651
+ }
652
+ }
653
+ }
654
+ ]
655
+ }
656
+ ]
657
+ }
658
+ ]
659
+ };
660
+ const fileUploadSchema = {
661
+ id: 'document-upload',
662
+ title: 'Document Upload',
663
+ description: 'Upload your documents for processing',
664
+ sections: [
665
+ {
666
+ id: 'uploader-info',
667
+ title: 'Your Information',
668
+ fields: [
669
+ {
670
+ name: 'name',
671
+ type: 'text',
672
+ label: 'Full Name',
673
+ validation: {
674
+ required: true,
675
+ minLength: 2
676
+ }
677
+ },
678
+ {
679
+ name: 'email',
680
+ type: 'email',
681
+ label: 'Email',
682
+ validation: {
683
+ required: true,
684
+ email: true
685
+ }
686
+ },
687
+ {
688
+ name: 'department',
689
+ type: 'select',
690
+ label: 'Department',
691
+ options: [
692
+ {
693
+ label: 'Engineering',
694
+ value: 'engineering'
695
+ },
696
+ {
697
+ label: 'Design',
698
+ value: 'design'
699
+ },
700
+ {
701
+ label: 'Marketing',
702
+ value: 'marketing'
703
+ },
704
+ {
705
+ label: 'Sales',
706
+ value: 'sales'
707
+ },
708
+ {
709
+ label: 'HR',
710
+ value: 'hr'
711
+ }
712
+ ],
713
+ validation: {
714
+ required: true
715
+ }
716
+ }
717
+ ]
718
+ },
719
+ {
720
+ id: 'documents',
721
+ title: 'Documents',
722
+ fields: [
723
+ {
724
+ name: 'documentType',
725
+ type: 'select',
726
+ label: 'Document Type',
727
+ options: [
728
+ {
729
+ label: 'Invoice',
730
+ value: 'invoice'
731
+ },
732
+ {
733
+ label: 'Receipt',
734
+ value: 'receipt'
735
+ },
736
+ {
737
+ label: 'Contract',
738
+ value: 'contract'
739
+ },
740
+ {
741
+ label: 'Report',
742
+ value: 'report'
743
+ },
744
+ {
745
+ label: 'Other',
746
+ value: 'other'
747
+ }
748
+ ],
749
+ validation: {
750
+ required: true,
751
+ messages: {
752
+ required: 'Please select a document type'
753
+ }
754
+ }
755
+ },
756
+ {
757
+ name: 'files',
758
+ type: 'file',
759
+ label: 'Upload Files',
760
+ accept: '.pdf,.doc,.docx,.xls,.xlsx',
761
+ multiple: true,
762
+ maxSize: 10485760
763
+ },
764
+ {
765
+ name: 'notes',
766
+ type: 'textarea',
767
+ label: 'Additional Notes',
768
+ placeholder: 'Any special instructions or comments...'
769
+ }
770
+ ]
771
+ }
772
+ ]
773
+ };
774
+ function FileUploadExample() {
775
+ const [uploadProgress, setUploadProgress] = useState({});
776
+ const [uploadedFiles, setUploadedFiles] = useState([]);
777
+ const simulateFileUpload = async (file)=>{
778
+ const fileName = file.name;
779
+ const chunks = 20;
780
+ for(let i = 0; i <= chunks; i++){
781
+ await new Promise((resolve)=>setTimeout(resolve, 100));
782
+ setUploadProgress((prev)=>({
783
+ ...prev,
784
+ [fileName]: i / chunks * 100
785
+ }));
786
+ }
787
+ setUploadedFiles((prev)=>[
788
+ ...prev,
789
+ fileName
790
+ ]);
791
+ toast.success(`Uploaded ${fileName}`);
792
+ };
793
+ const handleSubmit = async (data)=>{
794
+ try {
795
+ const formData = data;
796
+ const files = formData.files;
797
+ if (files) {
798
+ const fileList = files instanceof FileList ? Array.from(files) : [
799
+ files
800
+ ];
801
+ const oversizedFiles = fileList.filter((f)=>f.size > 10485760);
802
+ if (oversizedFiles.length > 0) return void toast.error('Some files are too large', {
803
+ description: `Maximum size is 10MB. Remove: ${oversizedFiles.map((f)=>f.name).join(', ')}`
804
+ });
805
+ toast.info(`Uploading ${fileList.length} file(s)...`);
806
+ for (const file of fileList)await simulateFileUpload(file);
807
+ toast.success('All files uploaded successfully!', {
808
+ description: `${fileList.length} document(s) processed`
809
+ });
810
+ console.log('Upload complete:', {
811
+ ...formData,
812
+ fileNames: fileList.map((f)=>f.name)
813
+ });
814
+ setTimeout(()=>{
815
+ setUploadProgress({});
816
+ setUploadedFiles([]);
817
+ }, 3000);
818
+ }
819
+ } catch (error) {
820
+ toast.error('Upload failed', {
821
+ description: error instanceof Error ? error.message : 'Please try again'
822
+ });
823
+ }
824
+ };
825
+ return /*#__PURE__*/ jsxs("div", {
826
+ className: "max-w-2xl mx-auto p-6",
827
+ children: [
828
+ /*#__PURE__*/ jsx(MetadataForm, {
829
+ schema: fileUploadSchema,
830
+ onSubmit: handleSubmit
831
+ }),
832
+ Object.keys(uploadProgress).length > 0 && /*#__PURE__*/ jsxs(Card, {
833
+ className: "mt-6",
834
+ children: [
835
+ /*#__PURE__*/ jsx(CardHeader, {
836
+ children: /*#__PURE__*/ jsx(CardTitle, {
837
+ className: "text-sm",
838
+ children: "Upload Progress"
839
+ })
840
+ }),
841
+ /*#__PURE__*/ jsx(CardContent, {
842
+ className: "space-y-3",
843
+ children: Object.entries(uploadProgress).map(([fileName, progress])=>/*#__PURE__*/ jsxs("div", {
844
+ children: [
845
+ /*#__PURE__*/ jsxs("div", {
846
+ className: "flex items-center justify-between text-sm mb-1",
847
+ children: [
848
+ /*#__PURE__*/ jsx("span", {
849
+ className: "truncate flex-1",
850
+ children: fileName
851
+ }),
852
+ /*#__PURE__*/ jsxs("span", {
853
+ className: "ml-2 text-muted-foreground",
854
+ children: [
855
+ Math.round(progress),
856
+ "%"
857
+ ]
858
+ })
859
+ ]
860
+ }),
861
+ /*#__PURE__*/ jsx("div", {
862
+ className: "h-2 bg-secondary rounded-full overflow-hidden",
863
+ children: /*#__PURE__*/ jsx("div", {
864
+ className: "h-full bg-primary transition-all duration-300",
865
+ style: {
866
+ width: `${progress}%`
867
+ }
868
+ })
869
+ })
870
+ ]
871
+ }, fileName))
872
+ })
873
+ ]
874
+ }),
875
+ uploadedFiles.length > 0 && /*#__PURE__*/ jsxs(Card, {
876
+ className: "mt-6",
877
+ children: [
878
+ /*#__PURE__*/ jsx(CardHeader, {
879
+ children: /*#__PURE__*/ jsx(CardTitle, {
880
+ className: "text-sm",
881
+ children: "Uploaded Files"
882
+ })
883
+ }),
884
+ /*#__PURE__*/ jsx(CardContent, {
885
+ children: /*#__PURE__*/ jsx("ul", {
886
+ className: "space-y-2",
887
+ children: uploadedFiles.map((fileName, index)=>/*#__PURE__*/ jsxs("li", {
888
+ className: "flex items-center gap-2 text-sm",
889
+ children: [
890
+ /*#__PURE__*/ jsx(Badge, {
891
+ variant: "outline",
892
+ className: "bg-green-50 text-green-700 border-green-200",
893
+ children: "✓"
894
+ }),
895
+ /*#__PURE__*/ jsx("span", {
896
+ children: fileName
897
+ })
898
+ ]
899
+ }, index))
900
+ })
901
+ })
902
+ ]
903
+ })
904
+ ]
905
+ });
906
+ }
907
+ export { FileUploadExample, automationJobSchema, cascadingDropdownsSchema, computedFieldsSchema, conditionalQuestionsSchema, conditionalSectionsSchema, fileUploadSchema, multiStepSchema };