@vuer-ai/vuer-uikit 0.0.98 → 0.0.100

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 (78) hide show
  1. package/dist/SyncScroll/SyncScroll.cjs +9 -9
  2. package/dist/SyncScroll/SyncScroll.mjs +2 -2
  3. package/dist/SyncScroll/index.cjs +9 -9
  4. package/dist/SyncScroll/index.mjs +2 -2
  5. package/dist/chunk-AIYM5PFP.cjs +66 -0
  6. package/dist/chunk-OWEYAVGT.mjs +62 -0
  7. package/dist/{chunk-7GWDO25E.cjs → chunk-XBTBTLID.cjs} +2 -2
  8. package/dist/{chunk-TTYSYGVE.mjs → chunk-XGXWOY3U.mjs} +2 -2
  9. package/dist/dial/DialPanel.cjs +23 -22
  10. package/dist/dial/DialPanel.mjs +22 -21
  11. package/dist/dial/index.cjs +39 -38
  12. package/dist/dial/index.mjs +22 -21
  13. package/dist/dial/wrapped-inputs/ControlledInputs.cjs +26 -25
  14. package/dist/dial/wrapped-inputs/ControlledInputs.mjs +22 -21
  15. package/dist/dial/wrapped-inputs/DialInputs.cjs +33 -32
  16. package/dist/dial/wrapped-inputs/DialInputs.mjs +22 -21
  17. package/dist/dial/wrapped-inputs/DialVectorInput.cjs +23 -22
  18. package/dist/dial/wrapped-inputs/DialVectorInput.mjs +22 -21
  19. package/dist/dial/wrapped-inputs/index.cjs +38 -37
  20. package/dist/dial/wrapped-inputs/index.mjs +22 -21
  21. package/dist/highlight-cursor/cursor-provider.cjs +3 -3
  22. package/dist/highlight-cursor/cursor-provider.mjs +2 -2
  23. package/dist/highlight-cursor/enhanced-components.cjs +1 -1
  24. package/dist/highlight-cursor/enhanced-components.mjs +1 -1
  25. package/dist/highlight-cursor/index.cjs +3 -3
  26. package/dist/highlight-cursor/index.mjs +2 -2
  27. package/dist/index.cjs +151 -138
  28. package/dist/index.css +7 -1
  29. package/dist/index.d.cts +1 -0
  30. package/dist/index.d.ts +1 -0
  31. package/dist/index.mjs +22 -21
  32. package/dist/ui/DialBadge.cjs +28 -0
  33. package/dist/ui/DialBadge.d.cts +33 -0
  34. package/dist/ui/DialBadge.d.ts +33 -0
  35. package/dist/ui/DialBadge.mjs +11 -0
  36. package/dist/ui/UIKitBadge.cjs +5 -5
  37. package/dist/ui/UIKitBadge.mjs +1 -1
  38. package/dist/ui/badge.d.cts +1 -1
  39. package/dist/ui/badge.d.ts +1 -1
  40. package/dist/ui/index.cjs +77 -64
  41. package/dist/ui/index.d.cts +1 -0
  42. package/dist/ui/index.d.ts +1 -0
  43. package/dist/ui/index.mjs +18 -17
  44. package/dist/ui/inputs/index.cjs +15 -15
  45. package/dist/ui/inputs/index.mjs +3 -3
  46. package/dist/ui/inputs/input.d.cts +1 -1
  47. package/dist/ui/inputs/input.d.ts +1 -1
  48. package/dist/ui/inputs/number-inputs/index.cjs +10 -10
  49. package/dist/ui/inputs/number-inputs/index.mjs +2 -2
  50. package/dist/ui/select.d.cts +1 -1
  51. package/dist/ui/select.d.ts +1 -1
  52. package/dist/ui/textarea.d.cts +1 -1
  53. package/dist/ui/textarea.d.ts +1 -1
  54. package/dist/ui/tree-view-legacy.cjs +8 -8
  55. package/dist/ui/tree-view-legacy.mjs +4 -4
  56. package/dist/ui/waterfall/index.cjs +6 -6
  57. package/dist/ui/waterfall/index.mjs +5 -5
  58. package/package.json +2 -7
  59. package/src/ui/DialBadge.tsx +97 -0
  60. package/src/ui/index.ts +1 -0
  61. package/cli/dial-cli.js +0 -833
  62. package/dist/chunk-4KWGGESI.cjs +0 -494
  63. package/dist/chunk-A5LCX2UQ.cjs +0 -208
  64. package/dist/chunk-BEJIZ56L.mjs +0 -300
  65. package/dist/chunk-C7VGRU3O.mjs +0 -283
  66. package/dist/chunk-O66RESRR.cjs +0 -285
  67. package/dist/chunk-VA3PEYFM.mjs +0 -489
  68. package/dist/chunk-VBBJSIY7.cjs +0 -308
  69. package/dist/chunk-WWGF6TBZ.mjs +0 -206
  70. package/dist/chunk-ZGN4UEJR.cjs +0 -679
  71. package/dist/chunk-ZQLRMOUW.mjs +0 -661
  72. package/src/cli/dial-cli.ts +0 -1133
  73. package/dist/{chunk-XMUP5MIM.mjs → chunk-G3EIVAVR.mjs} +0 -0
  74. package/dist/{chunk-7IS37C3P.cjs → chunk-K4I4YU6N.cjs} +1 -1
  75. package/dist/{chunk-OX2U5RAG.cjs → chunk-KFPS5CCR.cjs} +0 -0
  76. package/dist/{chunk-2OZK5DY5.mjs → chunk-KXKEZ3MH.mjs} +1 -1
  77. package/dist/{chunk-LJMNHTTG.cjs → chunk-OEI7NCF6.cjs} +4 -4
  78. package/dist/{chunk-W4JCKCW7.mjs → chunk-QHPFLC2O.mjs} +4 -4
@@ -1,679 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkCWAVHHJA_cjs = require('./chunk-CWAVHHJA.cjs');
4
- var chunkDVKONMS7_cjs = require('./chunk-DVKONMS7.cjs');
5
- var chunkGDUVAZDW_cjs = require('./chunk-GDUVAZDW.cjs');
6
- var chunk7RIGSS5X_cjs = require('./chunk-7RIGSS5X.cjs');
7
- var chunk7YMH34JL_cjs = require('./chunk-7YMH34JL.cjs');
8
- var chunkOTR4SFDC_cjs = require('./chunk-OTR4SFDC.cjs');
9
- var chunkMUQYO2G3_cjs = require('./chunk-MUQYO2G3.cjs');
10
- var chunkBMJX3SEO_cjs = require('./chunk-BMJX3SEO.cjs');
11
- var chunkYUHHUSIO_cjs = require('./chunk-YUHHUSIO.cjs');
12
- var chunkHKJCPZZG_cjs = require('./chunk-HKJCPZZG.cjs');
13
- var chunkFFCQKAQA_cjs = require('./chunk-FFCQKAQA.cjs');
14
- var chunkEKPJUR3U_cjs = require('./chunk-EKPJUR3U.cjs');
15
- var chunkVJN3GGLZ_cjs = require('./chunk-VJN3GGLZ.cjs');
16
- var chunkUASPJ57U_cjs = require('./chunk-UASPJ57U.cjs');
17
- var chunkM4IHJGJE_cjs = require('./chunk-M4IHJGJE.cjs');
18
- var chunkYMSWUGHW_cjs = require('./chunk-YMSWUGHW.cjs');
19
- var chunk3UEVUYFQ_cjs = require('./chunk-3UEVUYFQ.cjs');
20
- var chunkRMK6W774_cjs = require('./chunk-RMK6W774.cjs');
21
- var jsxRuntime = require('react/jsx-runtime');
22
-
23
- var DialInputWrapper = ({ label, children }) => {
24
- if (!label) {
25
- return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
26
- }
27
- return /* @__PURE__ */ jsxRuntime.jsxs(chunkUASPJ57U_cjs.FormLayout, { orientation: "label-top", children: [
28
- /* @__PURE__ */ jsxRuntime.jsx(chunkM4IHJGJE_cjs.Label, { size: "sm", children: label }),
29
- children
30
- ] });
31
- };
32
- var DialVec3Input = ({
33
- name,
34
- label,
35
- size = "sm",
36
- step,
37
- labelPosition
38
- }) => {
39
- const { getValue, setValue } = chunkRMK6W774_cjs.useDialSchema();
40
- const value = getValue(name) ?? [0, 0, 0];
41
- if (labelPosition === "inline") {
42
- return /* @__PURE__ */ jsxRuntime.jsx(
43
- chunk7RIGSS5X_cjs.Vec3Input,
44
- {
45
- value,
46
- onValuesChange: (val) => setValue(name, val),
47
- size,
48
- step,
49
- prefix: label ? [label, "", ""] : void 0
50
- }
51
- );
52
- } else {
53
- return /* @__PURE__ */ jsxRuntime.jsx(DialInputWrapper, { label, children: /* @__PURE__ */ jsxRuntime.jsx(
54
- chunk7RIGSS5X_cjs.Vec3Input,
55
- {
56
- value,
57
- onValuesChange: (val) => setValue(name, val),
58
- size,
59
- step
60
- }
61
- ) });
62
- }
63
- };
64
- var DialEulerInput = ({
65
- name,
66
- label,
67
- size = "sm",
68
- step,
69
- labelPosition
70
- }) => {
71
- const { getValue, setValue } = chunkRMK6W774_cjs.useDialSchema();
72
- const value = getValue(name) ?? [0, 0, 0];
73
- if (labelPosition === "inline") {
74
- return /* @__PURE__ */ jsxRuntime.jsx(
75
- chunkBMJX3SEO_cjs.EulerInput,
76
- {
77
- value,
78
- onValuesChange: (val) => setValue(name, val),
79
- size,
80
- step,
81
- prefix: label ? [label, "", ""] : void 0
82
- }
83
- );
84
- } else {
85
- return /* @__PURE__ */ jsxRuntime.jsx(DialInputWrapper, { label, children: /* @__PURE__ */ jsxRuntime.jsx(
86
- chunkBMJX3SEO_cjs.EulerInput,
87
- {
88
- value,
89
- onValuesChange: (val) => setValue(name, val),
90
- size,
91
- step
92
- }
93
- ) });
94
- }
95
- };
96
- var DialEulerDegInput = ({
97
- name,
98
- label,
99
- size = "sm",
100
- step,
101
- labelPosition
102
- }) => {
103
- const { getValue, setValue } = chunkRMK6W774_cjs.useDialSchema();
104
- const value = getValue(name) ?? [0, 0, 0];
105
- if (labelPosition === "inline") {
106
- return /* @__PURE__ */ jsxRuntime.jsx(
107
- chunkMUQYO2G3_cjs.EulerDegInput,
108
- {
109
- value,
110
- onValuesChange: (val) => setValue(name, val),
111
- size,
112
- step,
113
- prefix: label ? [label, "", ""] : void 0
114
- }
115
- );
116
- } else {
117
- return /* @__PURE__ */ jsxRuntime.jsx(DialInputWrapper, { label, children: /* @__PURE__ */ jsxRuntime.jsx(
118
- chunkMUQYO2G3_cjs.EulerDegInput,
119
- {
120
- value,
121
- onValuesChange: (val) => setValue(name, val),
122
- size,
123
- step
124
- }
125
- ) });
126
- }
127
- };
128
- var DialQuaternionInput = ({
129
- name,
130
- label,
131
- size = "sm",
132
- step,
133
- labelPosition
134
- }) => {
135
- const { getValue, setValue } = chunkRMK6W774_cjs.useDialSchema();
136
- const value = getValue(name) ?? [1, 0, 0, 0];
137
- if (labelPosition === "inline") {
138
- return /* @__PURE__ */ jsxRuntime.jsx(
139
- chunkCWAVHHJA_cjs.QuaternionInput,
140
- {
141
- value,
142
- onValuesChange: (val) => setValue(name, val),
143
- size,
144
- step,
145
- prefix: label ? [label, "", "", ""] : void 0
146
- }
147
- );
148
- } else {
149
- return /* @__PURE__ */ jsxRuntime.jsx(DialInputWrapper, { label, children: /* @__PURE__ */ jsxRuntime.jsx(
150
- chunkCWAVHHJA_cjs.QuaternionInput,
151
- {
152
- value,
153
- onValuesChange: (val) => setValue(name, val),
154
- size,
155
- step
156
- }
157
- ) });
158
- }
159
- };
160
- var DialVectorInput = ({
161
- name,
162
- label,
163
- size = "sm",
164
- step,
165
- dimensions = 3,
166
- labelPosition
167
- }) => {
168
- const { getValue, setValue } = chunkRMK6W774_cjs.useDialSchema();
169
- const value = getValue(name) ?? new Array(dimensions).fill(0);
170
- if (labelPosition === "inline") {
171
- return /* @__PURE__ */ jsxRuntime.jsx(
172
- chunkFFCQKAQA_cjs.VectorInput,
173
- {
174
- value,
175
- onValuesChange: (val) => setValue(name, val),
176
- size,
177
- step,
178
- prefix: label ? [label, ...new Array(value.length - 1).fill("")] : void 0
179
- }
180
- );
181
- } else {
182
- return /* @__PURE__ */ jsxRuntime.jsx(DialInputWrapper, { label, children: /* @__PURE__ */ jsxRuntime.jsx(
183
- chunkFFCQKAQA_cjs.VectorInput,
184
- {
185
- value,
186
- onValuesChange: (val) => setValue(name, val),
187
- size,
188
- step
189
- }
190
- ) });
191
- }
192
- };
193
- var DialIntInput = ({
194
- name,
195
- label,
196
- size = "sm",
197
- step = 1,
198
- labelPosition
199
- }) => {
200
- const { getValue, setValue } = chunkRMK6W774_cjs.useDialSchema();
201
- const value = getValue(name) ?? 0;
202
- if (labelPosition === "inline") {
203
- return /* @__PURE__ */ jsxRuntime.jsx(
204
- chunkHKJCPZZG_cjs.IntInput,
205
- {
206
- value,
207
- prefix: label ? [label] : void 0,
208
- onChange: (val) => setValue(name, val),
209
- size,
210
- step
211
- }
212
- );
213
- } else {
214
- return /* @__PURE__ */ jsxRuntime.jsx(DialInputWrapper, { label, children: /* @__PURE__ */ jsxRuntime.jsx(chunkHKJCPZZG_cjs.IntInput, { value, onChange: (val) => setValue(name, val), size, step }) });
215
- }
216
- };
217
- var DialDegInput = ({
218
- name,
219
- label,
220
- size = "sm",
221
- step,
222
- labelPosition
223
- }) => {
224
- const { getValue, setValue } = chunkRMK6W774_cjs.useDialSchema();
225
- const value = getValue(name) ?? 0;
226
- if (labelPosition === "inline") {
227
- return /* @__PURE__ */ jsxRuntime.jsx(
228
- chunkOTR4SFDC_cjs.DegInput,
229
- {
230
- value,
231
- onChange: (val) => setValue(name, val),
232
- size,
233
- step,
234
- prefix: label ? [label] : void 0
235
- }
236
- );
237
- } else {
238
- return /* @__PURE__ */ jsxRuntime.jsx(DialInputWrapper, { label, children: /* @__PURE__ */ jsxRuntime.jsx(chunkOTR4SFDC_cjs.DegInput, { value, onChange: (val) => setValue(name, val), size, step }) });
239
- }
240
- };
241
- var DialRadInput = ({
242
- name,
243
- label,
244
- size = "sm",
245
- step,
246
- labelPosition
247
- }) => {
248
- const { getValue, setValue } = chunkRMK6W774_cjs.useDialSchema();
249
- const value = getValue(name) ?? 0;
250
- if (labelPosition === "inline") {
251
- return /* @__PURE__ */ jsxRuntime.jsx(
252
- chunkDVKONMS7_cjs.RadInput,
253
- {
254
- value,
255
- onChange: (val) => setValue(name, val),
256
- size,
257
- step,
258
- prefix: label ? [label] : void 0
259
- }
260
- );
261
- } else {
262
- return /* @__PURE__ */ jsxRuntime.jsx(DialInputWrapper, { label, children: /* @__PURE__ */ jsxRuntime.jsx(chunkDVKONMS7_cjs.RadInput, { value, onChange: (val) => setValue(name, val), size, step }) });
263
- }
264
- };
265
- var DialCmInput = ({
266
- name,
267
- label,
268
- size = "sm",
269
- step,
270
- labelPosition
271
- }) => {
272
- const { getValue, setValue } = chunkRMK6W774_cjs.useDialSchema();
273
- const value = getValue(name) ?? 0;
274
- if (labelPosition === "inline") {
275
- return /* @__PURE__ */ jsxRuntime.jsx(
276
- chunk7YMH34JL_cjs.CmInput,
277
- {
278
- value,
279
- onChange: (val) => setValue(name, val),
280
- size,
281
- step,
282
- prefix: label ? [label] : void 0
283
- }
284
- );
285
- } else {
286
- return /* @__PURE__ */ jsxRuntime.jsx(DialInputWrapper, { label, children: /* @__PURE__ */ jsxRuntime.jsx(chunk7YMH34JL_cjs.CmInput, { value, onChange: (val) => setValue(name, val), size, step }) });
287
- }
288
- };
289
- var DialInchInput = ({
290
- name,
291
- label,
292
- size = "sm",
293
- step,
294
- labelPosition
295
- }) => {
296
- const { getValue, setValue } = chunkRMK6W774_cjs.useDialSchema();
297
- const value = getValue(name) ?? 0;
298
- if (labelPosition === "inline") {
299
- return /* @__PURE__ */ jsxRuntime.jsx(
300
- chunkYUHHUSIO_cjs.InchInput,
301
- {
302
- value,
303
- onChange: (val) => setValue(name, val),
304
- size,
305
- step,
306
- prefix: label ? [label] : void 0
307
- }
308
- );
309
- } else {
310
- return /* @__PURE__ */ jsxRuntime.jsx(DialInputWrapper, { label, children: /* @__PURE__ */ jsxRuntime.jsx(chunkYUHHUSIO_cjs.InchInput, { value, onChange: (val) => setValue(name, val), size, step }) });
311
- }
312
- };
313
- var DialTimeInput = ({
314
- name,
315
- label,
316
- size = "sm",
317
- step,
318
- labelPosition
319
- }) => {
320
- const { getValue, setValue } = chunkRMK6W774_cjs.useDialSchema();
321
- const value = getValue(name) ?? 0;
322
- if (labelPosition === "inline") {
323
- return /* @__PURE__ */ jsxRuntime.jsx(
324
- chunkGDUVAZDW_cjs.TimeInput,
325
- {
326
- value,
327
- onChange: (val) => setValue(name, val),
328
- size,
329
- step,
330
- prefix: label ? [label] : void 0
331
- }
332
- );
333
- } else {
334
- return /* @__PURE__ */ jsxRuntime.jsx(DialInputWrapper, { label, children: /* @__PURE__ */ jsxRuntime.jsx(chunkGDUVAZDW_cjs.TimeInput, { value, onChange: (val) => setValue(name, val), size, step }) });
335
- }
336
- };
337
- var DialVectorInput2 = ({
338
- name,
339
- label,
340
- size = "sm"
341
- }) => {
342
- const { getValue, setValue, schemas } = chunkRMK6W774_cjs.useDialSchema();
343
- const schema = schemas.find((s) => s.name === name);
344
- if (!schema) {
345
- return null;
346
- }
347
- const value = getValue(name) || [];
348
- const dimensions = schema.dimensions || schema.placeholders?.length || schema.dtypes?.length || (Array.isArray(value) ? value.length : 6);
349
- const placeholders = schema.placeholders || [];
350
- const dtypes = schema.dtypes || [];
351
- const steps = schema.steps || [];
352
- const tags = schema.tags || {};
353
- let gridAutoFlow;
354
- let gridColumns;
355
- let gridRows;
356
- if (typeof tags.col === "number") {
357
- gridAutoFlow = "column";
358
- gridRows = tags.col;
359
- gridColumns = void 0;
360
- } else if (typeof tags.row === "number") {
361
- gridAutoFlow = "row";
362
- gridColumns = tags.row;
363
- gridRows = void 0;
364
- } else {
365
- gridAutoFlow = "row";
366
- gridColumns = void 0;
367
- gridRows = void 0;
368
- }
369
- console.log("the grid-flow is", gridAutoFlow, gridColumns, gridRows);
370
- const vectorValue = Array.isArray(value) ? value.concat(Array(Math.max(0, dimensions - value.length)).fill(0)) : Array(dimensions).fill(0);
371
- const inputSteps = Array.from({ length: dimensions }, (_, i) => {
372
- if (steps[i] !== void 0) {
373
- return steps[i];
374
- }
375
- const dtype = dtypes[i];
376
- return dtype === "number-int" ? 1 : 1e-3;
377
- });
378
- const labels = placeholders.length > 0 ? placeholders.map((p) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs", children: p })) : void 0;
379
- const handleValuesChange = (newValues) => {
380
- setValue(name, newValues);
381
- };
382
- const inputComponent = /* @__PURE__ */ jsxRuntime.jsx(
383
- chunkFFCQKAQA_cjs.VectorInput,
384
- {
385
- value: vectorValue,
386
- onValuesChange: handleValuesChange,
387
- size,
388
- step: inputSteps,
389
- labels,
390
- gridAutoFlow,
391
- columns: gridColumns,
392
- rows: gridRows
393
- }
394
- );
395
- if (!label) {
396
- return inputComponent;
397
- }
398
- return /* @__PURE__ */ jsxRuntime.jsxs(chunkUASPJ57U_cjs.FormLayout, { orientation: "label-top", children: [
399
- /* @__PURE__ */ jsxRuntime.jsx(chunkM4IHJGJE_cjs.Label, { size: "sm", children: label }),
400
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row items-center gap-2", children: [
401
- schema.helpText && /* @__PURE__ */ jsxRuntime.jsx(
402
- "span",
403
- {
404
- className: "text-text-secondary cursor-help text-xs",
405
- title: schema.helpText,
406
- children: "\u24D8"
407
- }
408
- ),
409
- inputComponent
410
- ] })
411
- ] });
412
- };
413
- var DialPanel = ({ schemas, groups: groupConfigs }) => {
414
- const groupConfigMap = {};
415
- if (groupConfigs) {
416
- groupConfigs.forEach((config) => {
417
- groupConfigMap[config.name] = config;
418
- });
419
- }
420
- schemas.forEach((schema) => {
421
- const grouping = schema.tags?.grouping;
422
- if (grouping && !groupConfigMap[grouping]) {
423
- groupConfigMap[grouping] = { name: grouping };
424
- }
425
- if (grouping && schema.tags?.noWrap && groupConfigMap[grouping]) {
426
- groupConfigMap[grouping].noWrap = true;
427
- }
428
- });
429
- const groupedSchemas = {};
430
- const ungrouped = [];
431
- schemas.forEach((schema) => {
432
- const grouping = schema.tags?.grouping;
433
- if (grouping) {
434
- if (!groupedSchemas[grouping]) {
435
- groupedSchemas[grouping] = [];
436
- }
437
- groupedSchemas[grouping].push(schema);
438
- } else {
439
- ungrouped.push(schema);
440
- }
441
- });
442
- const renderSchemaInput = (schema) => {
443
- const { name, dtype, min, max, step, options, tags } = schema;
444
- const labelPosition = tags?.labelPosition;
445
- const label = name.charAt(0).toUpperCase() + name.slice(1);
446
- switch (dtype) {
447
- case "vector3":
448
- return /* @__PURE__ */ jsxRuntime.jsx(
449
- DialVec3Input,
450
- {
451
- name,
452
- label,
453
- step,
454
- labelPosition
455
- },
456
- name
457
- );
458
- case "euler":
459
- return /* @__PURE__ */ jsxRuntime.jsx(
460
- DialEulerDegInput,
461
- {
462
- name,
463
- label,
464
- step,
465
- labelPosition
466
- },
467
- name
468
- );
469
- case "vector":
470
- case "vector-6":
471
- case "number-group":
472
- return /* @__PURE__ */ jsxRuntime.jsx(DialVectorInput2, { name, label }, name);
473
- case "boolean":
474
- return /* @__PURE__ */ jsxRuntime.jsx(DialBooleanInput, { name, label, labelPosition }, name);
475
- case "number-int":
476
- return /* @__PURE__ */ jsxRuntime.jsx(
477
- DialIntInput,
478
- {
479
- name,
480
- label,
481
- step: step || 1,
482
- labelPosition
483
- },
484
- name
485
- );
486
- case "number":
487
- if (min !== void 0 && max !== void 0 && !options) {
488
- return /* @__PURE__ */ jsxRuntime.jsx(
489
- DialSliderInput,
490
- {
491
- name,
492
- label,
493
- min,
494
- max,
495
- step,
496
- labelPosition
497
- },
498
- name
499
- );
500
- }
501
- if (options && options.length > 0) {
502
- return /* @__PURE__ */ jsxRuntime.jsx(
503
- DialSelectInput,
504
- {
505
- name,
506
- label,
507
- options,
508
- labelPosition
509
- },
510
- name
511
- );
512
- }
513
- return /* @__PURE__ */ jsxRuntime.jsx(
514
- DialNumberInput,
515
- {
516
- name,
517
- label,
518
- min,
519
- max,
520
- step,
521
- labelPosition
522
- },
523
- name
524
- );
525
- case "string":
526
- if (options && options.length > 0) {
527
- return /* @__PURE__ */ jsxRuntime.jsx(
528
- DialSelectInput,
529
- {
530
- name,
531
- label,
532
- options,
533
- labelPosition
534
- },
535
- name
536
- );
537
- }
538
- return null;
539
- default:
540
- return null;
541
- }
542
- };
543
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "dial-schema-renderer space-y-4", children: [
544
- Object.entries(groupedSchemas).map(([name, schemaList]) => {
545
- const groupConfig = groupConfigMap[name];
546
- const hasNoWrap = groupConfig?.noWrap;
547
- const wrapClass = hasNoWrap ? "" : "flex-wrap";
548
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "dial-group", children: [
549
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-text-primary mb-2 font-medium", children: name }),
550
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: `dial-row flex flex-row ${wrapClass} gap-4`, children: schemaList.map(renderSchemaInput) })
551
- ] }, name);
552
- }),
553
- ungrouped.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "dial-group", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "dial-row flex flex-row flex-wrap gap-4", children: ungrouped.map(renderSchemaInput) }) })
554
- ] });
555
- };
556
- var DialInputWrapper2 = ({ label, children }) => {
557
- if (!label) {
558
- return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
559
- }
560
- return /* @__PURE__ */ jsxRuntime.jsxs(chunkUASPJ57U_cjs.FormLayout, { orientation: "label-top", children: [
561
- /* @__PURE__ */ jsxRuntime.jsx(chunkM4IHJGJE_cjs.Label, { size: "sm", children: label }),
562
- children
563
- ] });
564
- };
565
- var DialNumberInput = ({
566
- name,
567
- min,
568
- max,
569
- step = 1,
570
- label,
571
- labelPosition,
572
- size = "sm"
573
- }) => {
574
- const { getValue, setValue } = chunkRMK6W774_cjs.useDialSchema();
575
- const value = getValue(name) ?? 0;
576
- const inputProps = {
577
- type: "number",
578
- value,
579
- min,
580
- max,
581
- step,
582
- onChange: (e) => setValue(name, parseFloat(e.target.value)),
583
- size
584
- };
585
- if (labelPosition === "inline") {
586
- return /* @__PURE__ */ jsxRuntime.jsx(chunk3UEVUYFQ_cjs.InputRoot, { ...inputProps, children: label ? /* @__PURE__ */ jsxRuntime.jsx(chunk3UEVUYFQ_cjs.InputSlot, { side: "left", children: label }) : null });
587
- } else {
588
- return /* @__PURE__ */ jsxRuntime.jsx(DialInputWrapper2, { label, children: /* @__PURE__ */ jsxRuntime.jsx(chunk3UEVUYFQ_cjs.InputRoot, { ...inputProps }) });
589
- }
590
- };
591
- var DialBooleanInput = ({ name, label, labelPosition }) => {
592
- const { getValue, setValue } = chunkRMK6W774_cjs.useDialSchema();
593
- const value = getValue(name) ?? false;
594
- const switchProps = {
595
- checked: value,
596
- onCheckedChange: (checked) => setValue(name, checked)
597
- };
598
- if (!label) {
599
- return /* @__PURE__ */ jsxRuntime.jsx(chunkVJN3GGLZ_cjs.Switch, { ...switchProps });
600
- }
601
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row items-center gap-2", children: [
602
- /* @__PURE__ */ jsxRuntime.jsx(chunkM4IHJGJE_cjs.Label, { size: "sm", children: label }),
603
- /* @__PURE__ */ jsxRuntime.jsx(chunkVJN3GGLZ_cjs.Switch, { ...switchProps })
604
- ] });
605
- };
606
- var DialSelectInput = ({
607
- name,
608
- options = [],
609
- label,
610
- labelPosition,
611
- size = "sm"
612
- }) => {
613
- const { getValue, setValue } = chunkRMK6W774_cjs.useDialSchema();
614
- const value = getValue(name);
615
- const selectComponent = /* @__PURE__ */ jsxRuntime.jsxs(
616
- chunkYMSWUGHW_cjs.Select,
617
- {
618
- value: String(value),
619
- onValueChange: (val) => {
620
- const parsed = !isNaN(Number(val)) ? Number(val) : val;
621
- setValue(name, parsed);
622
- },
623
- children: [
624
- /* @__PURE__ */ jsxRuntime.jsx(chunkYMSWUGHW_cjs.SelectTrigger, { size, children: /* @__PURE__ */ jsxRuntime.jsx(chunkYMSWUGHW_cjs.SelectValue, { placeholder: "Select an option" }) }),
625
- /* @__PURE__ */ jsxRuntime.jsx(chunkYMSWUGHW_cjs.SelectContent, { children: options.map((opt, i) => /* @__PURE__ */ jsxRuntime.jsx(chunkYMSWUGHW_cjs.SelectItem, { value: String(opt), children: String(opt) }, i)) })
626
- ]
627
- }
628
- );
629
- if (!label) {
630
- return selectComponent;
631
- }
632
- return /* @__PURE__ */ jsxRuntime.jsx(DialInputWrapper2, { label, children: selectComponent });
633
- };
634
- var DialSliderInput = ({
635
- name,
636
- min = 0,
637
- max = 100,
638
- step = 1,
639
- label,
640
- labelPosition,
641
- size = "sm"
642
- }) => {
643
- const { getValue, setValue } = chunkRMK6W774_cjs.useDialSchema();
644
- const value = getValue(name) ?? min;
645
- const sliderProps = {
646
- value: [value],
647
- onValueChange: ([val]) => setValue(name, val),
648
- min,
649
- max,
650
- step,
651
- className: "flex-1"
652
- };
653
- const sliderComponent = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-1 items-center gap-2", children: [
654
- /* @__PURE__ */ jsxRuntime.jsx(chunkEKPJUR3U_cjs.Slider, { ...sliderProps }),
655
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-text-secondary w-12 text-right text-sm", children: value })
656
- ] });
657
- if (!label) {
658
- return sliderComponent;
659
- }
660
- return /* @__PURE__ */ jsxRuntime.jsx(DialInputWrapper2, { label, children: sliderComponent });
661
- };
662
-
663
- exports.DialBooleanInput = DialBooleanInput;
664
- exports.DialCmInput = DialCmInput;
665
- exports.DialDegInput = DialDegInput;
666
- exports.DialEulerDegInput = DialEulerDegInput;
667
- exports.DialEulerInput = DialEulerInput;
668
- exports.DialInchInput = DialInchInput;
669
- exports.DialIntInput = DialIntInput;
670
- exports.DialNumberInput = DialNumberInput;
671
- exports.DialPanel = DialPanel;
672
- exports.DialQuaternionInput = DialQuaternionInput;
673
- exports.DialRadInput = DialRadInput;
674
- exports.DialSelectInput = DialSelectInput;
675
- exports.DialSliderInput = DialSliderInput;
676
- exports.DialTimeInput = DialTimeInput;
677
- exports.DialVec3Input = DialVec3Input;
678
- exports.DialVectorInput = DialVectorInput;
679
- exports.DialVectorInput2 = DialVectorInput2;