@epam/ai-dial-ui-kit 0.1.0-rc
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.
- package/LICENSE +201 -0
- package/README.md +292 -0
- package/dist/dial-ui-kit.cjs.js +22 -0
- package/dist/dial-ui-kit.es.js +778 -0
- package/dist/index.css +2 -0
- package/dist/src/__mocks__/monaco-editor.d.ts +13 -0
- package/dist/src/components/Button/Button.d.ts +36 -0
- package/dist/src/components/ErrorText/ErrorText.d.ts +15 -0
- package/dist/src/components/Field/Field.d.ts +24 -0
- package/dist/src/components/Icon/Icon.d.ts +18 -0
- package/dist/src/components/Input/Input.d.ts +44 -0
- package/dist/src/components/InputField/InputField.d.ts +92 -0
- package/dist/src/components/JsonEditor/JsonEditor.d.ts +24 -0
- package/dist/src/components/TextAreaField/TextAreaField.d.ts +39 -0
- package/dist/src/components/Textarea/Textarea.d.ts +34 -0
- package/dist/src/components/Tooltip/Tooltip.d.ts +31 -0
- package/dist/src/components/Tooltip/TooltipContainer.d.ts +18 -0
- package/dist/src/components/Tooltip/TooltipContent.d.ts +8 -0
- package/dist/src/components/Tooltip/TooltipContext.d.ts +105 -0
- package/dist/src/components/Tooltip/TooltipTrigger.d.ts +10 -0
- package/dist/src/constants/editor.d.ts +2 -0
- package/dist/src/index.d.ts +11 -0
- package/dist/src/models/field-control-props.d.ts +21 -0
- package/dist/src/types/editor.d.ts +10 -0
- package/package.json +113 -0
|
@@ -0,0 +1,778 @@
|
|
|
1
|
+
import me, { createContext as pe, useState as be, useRef as ge, useMemo as xe, useContext as ve, forwardRef as Q, isValidElement as je, cloneElement as he } from "react";
|
|
2
|
+
import j from "classnames";
|
|
3
|
+
import { useFloating as Ee, offset as ke, flip as Re, shift as Te, arrow as _e, autoUpdate as Ne, useHover as we, useFocus as Ce, useDismiss as ye, useRole as Se, useInteractions as Oe, useMergeRefs as K, FloatingPortal as Ae, FloatingArrow as Fe } from "@floating-ui/react";
|
|
4
|
+
import "monaco-editor";
|
|
5
|
+
import { Editor as Pe } from "@monaco-editor/react";
|
|
6
|
+
var O = { exports: {} }, C = {};
|
|
7
|
+
/**
|
|
8
|
+
* @license React
|
|
9
|
+
* react-jsx-runtime.production.js
|
|
10
|
+
*
|
|
11
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
12
|
+
*
|
|
13
|
+
* This source code is licensed under the MIT license found in the
|
|
14
|
+
* LICENSE file in the root directory of this source tree.
|
|
15
|
+
*/
|
|
16
|
+
var V;
|
|
17
|
+
function De() {
|
|
18
|
+
if (V) return C;
|
|
19
|
+
V = 1;
|
|
20
|
+
var r = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
|
|
21
|
+
function a(l, n, i) {
|
|
22
|
+
var c = null;
|
|
23
|
+
if (i !== void 0 && (c = "" + i), n.key !== void 0 && (c = "" + n.key), "key" in n) {
|
|
24
|
+
i = {};
|
|
25
|
+
for (var d in n)
|
|
26
|
+
d !== "key" && (i[d] = n[d]);
|
|
27
|
+
} else i = n;
|
|
28
|
+
return n = i.ref, {
|
|
29
|
+
$$typeof: r,
|
|
30
|
+
type: l,
|
|
31
|
+
key: c,
|
|
32
|
+
ref: n !== void 0 ? n : null,
|
|
33
|
+
props: i
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return C.Fragment = t, C.jsx = a, C.jsxs = a, C;
|
|
37
|
+
}
|
|
38
|
+
var y = {};
|
|
39
|
+
/**
|
|
40
|
+
* @license React
|
|
41
|
+
* react-jsx-runtime.development.js
|
|
42
|
+
*
|
|
43
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
44
|
+
*
|
|
45
|
+
* This source code is licensed under the MIT license found in the
|
|
46
|
+
* LICENSE file in the root directory of this source tree.
|
|
47
|
+
*/
|
|
48
|
+
var H;
|
|
49
|
+
function Le() {
|
|
50
|
+
return H || (H = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
51
|
+
function r(e) {
|
|
52
|
+
if (e == null) return null;
|
|
53
|
+
if (typeof e == "function")
|
|
54
|
+
return e.$$typeof === ue ? null : e.displayName || e.name || null;
|
|
55
|
+
if (typeof e == "string") return e;
|
|
56
|
+
switch (e) {
|
|
57
|
+
case h:
|
|
58
|
+
return "Fragment";
|
|
59
|
+
case R:
|
|
60
|
+
return "Profiler";
|
|
61
|
+
case S:
|
|
62
|
+
return "StrictMode";
|
|
63
|
+
case ae:
|
|
64
|
+
return "Suspense";
|
|
65
|
+
case le:
|
|
66
|
+
return "SuspenseList";
|
|
67
|
+
case ce:
|
|
68
|
+
return "Activity";
|
|
69
|
+
}
|
|
70
|
+
if (typeof e == "object")
|
|
71
|
+
switch (typeof e.tag == "number" && console.error(
|
|
72
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
73
|
+
), e.$$typeof) {
|
|
74
|
+
case w:
|
|
75
|
+
return "Portal";
|
|
76
|
+
case F:
|
|
77
|
+
return (e.displayName || "Context") + ".Provider";
|
|
78
|
+
case T:
|
|
79
|
+
return (e._context.displayName || "Context") + ".Consumer";
|
|
80
|
+
case se:
|
|
81
|
+
var s = e.render;
|
|
82
|
+
return e = e.displayName, e || (e = s.displayName || s.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
83
|
+
case ie:
|
|
84
|
+
return s = e.displayName || null, s !== null ? s : r(e.type) || "Memo";
|
|
85
|
+
case B:
|
|
86
|
+
s = e._payload, e = e._init;
|
|
87
|
+
try {
|
|
88
|
+
return r(e(s));
|
|
89
|
+
} catch {
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
function t(e) {
|
|
95
|
+
return "" + e;
|
|
96
|
+
}
|
|
97
|
+
function a(e) {
|
|
98
|
+
try {
|
|
99
|
+
t(e);
|
|
100
|
+
var s = !1;
|
|
101
|
+
} catch {
|
|
102
|
+
s = !0;
|
|
103
|
+
}
|
|
104
|
+
if (s) {
|
|
105
|
+
s = console;
|
|
106
|
+
var u = s.error, p = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
107
|
+
return u.call(
|
|
108
|
+
s,
|
|
109
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
110
|
+
p
|
|
111
|
+
), t(e);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
function l(e) {
|
|
115
|
+
if (e === h) return "<>";
|
|
116
|
+
if (typeof e == "object" && e !== null && e.$$typeof === B)
|
|
117
|
+
return "<...>";
|
|
118
|
+
try {
|
|
119
|
+
var s = r(e);
|
|
120
|
+
return s ? "<" + s + ">" : "<...>";
|
|
121
|
+
} catch {
|
|
122
|
+
return "<...>";
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
function n() {
|
|
126
|
+
var e = P.A;
|
|
127
|
+
return e === null ? null : e.getOwner();
|
|
128
|
+
}
|
|
129
|
+
function i() {
|
|
130
|
+
return Error("react-stack-top-frame");
|
|
131
|
+
}
|
|
132
|
+
function c(e) {
|
|
133
|
+
if (W.call(e, "key")) {
|
|
134
|
+
var s = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
135
|
+
if (s && s.isReactWarning) return !1;
|
|
136
|
+
}
|
|
137
|
+
return e.key !== void 0;
|
|
138
|
+
}
|
|
139
|
+
function d(e, s) {
|
|
140
|
+
function u() {
|
|
141
|
+
U || (U = !0, console.error(
|
|
142
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
143
|
+
s
|
|
144
|
+
));
|
|
145
|
+
}
|
|
146
|
+
u.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
147
|
+
get: u,
|
|
148
|
+
configurable: !0
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
function f() {
|
|
152
|
+
var e = r(this.type);
|
|
153
|
+
return z[e] || (z[e] = !0, console.error(
|
|
154
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
155
|
+
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
156
|
+
}
|
|
157
|
+
function g(e, s, u, p, k, v, L, Y) {
|
|
158
|
+
return u = v.ref, e = {
|
|
159
|
+
$$typeof: _,
|
|
160
|
+
type: e,
|
|
161
|
+
key: s,
|
|
162
|
+
props: v,
|
|
163
|
+
_owner: k
|
|
164
|
+
}, (u !== void 0 ? u : null) !== null ? Object.defineProperty(e, "ref", {
|
|
165
|
+
enumerable: !1,
|
|
166
|
+
get: f
|
|
167
|
+
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
168
|
+
configurable: !1,
|
|
169
|
+
enumerable: !1,
|
|
170
|
+
writable: !0,
|
|
171
|
+
value: 0
|
|
172
|
+
}), Object.defineProperty(e, "_debugInfo", {
|
|
173
|
+
configurable: !1,
|
|
174
|
+
enumerable: !1,
|
|
175
|
+
writable: !0,
|
|
176
|
+
value: null
|
|
177
|
+
}), Object.defineProperty(e, "_debugStack", {
|
|
178
|
+
configurable: !1,
|
|
179
|
+
enumerable: !1,
|
|
180
|
+
writable: !0,
|
|
181
|
+
value: L
|
|
182
|
+
}), Object.defineProperty(e, "_debugTask", {
|
|
183
|
+
configurable: !1,
|
|
184
|
+
enumerable: !1,
|
|
185
|
+
writable: !0,
|
|
186
|
+
value: Y
|
|
187
|
+
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
188
|
+
}
|
|
189
|
+
function m(e, s, u, p, k, v, L, Y) {
|
|
190
|
+
var b = s.children;
|
|
191
|
+
if (b !== void 0)
|
|
192
|
+
if (p)
|
|
193
|
+
if (de(b)) {
|
|
194
|
+
for (p = 0; p < b.length; p++)
|
|
195
|
+
x(b[p]);
|
|
196
|
+
Object.freeze && Object.freeze(b);
|
|
197
|
+
} else
|
|
198
|
+
console.error(
|
|
199
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
200
|
+
);
|
|
201
|
+
else x(b);
|
|
202
|
+
if (W.call(s, "key")) {
|
|
203
|
+
b = r(e);
|
|
204
|
+
var N = Object.keys(s).filter(function(fe) {
|
|
205
|
+
return fe !== "key";
|
|
206
|
+
});
|
|
207
|
+
p = 0 < N.length ? "{key: someKey, " + N.join(": ..., ") + ": ...}" : "{key: someKey}", J[b + p] || (N = 0 < N.length ? "{" + N.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
208
|
+
`A props object containing a "key" prop is being spread into JSX:
|
|
209
|
+
let props = %s;
|
|
210
|
+
<%s {...props} />
|
|
211
|
+
React keys must be passed directly to JSX without using spread:
|
|
212
|
+
let props = %s;
|
|
213
|
+
<%s key={someKey} {...props} />`,
|
|
214
|
+
p,
|
|
215
|
+
b,
|
|
216
|
+
N,
|
|
217
|
+
b
|
|
218
|
+
), J[b + p] = !0);
|
|
219
|
+
}
|
|
220
|
+
if (b = null, u !== void 0 && (a(u), b = "" + u), c(s) && (a(s.key), b = "" + s.key), "key" in s) {
|
|
221
|
+
u = {};
|
|
222
|
+
for (var I in s)
|
|
223
|
+
I !== "key" && (u[I] = s[I]);
|
|
224
|
+
} else u = s;
|
|
225
|
+
return b && d(
|
|
226
|
+
u,
|
|
227
|
+
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
228
|
+
), g(
|
|
229
|
+
e,
|
|
230
|
+
b,
|
|
231
|
+
v,
|
|
232
|
+
k,
|
|
233
|
+
n(),
|
|
234
|
+
u,
|
|
235
|
+
L,
|
|
236
|
+
Y
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
function x(e) {
|
|
240
|
+
typeof e == "object" && e !== null && e.$$typeof === _ && e._store && (e._store.validated = 1);
|
|
241
|
+
}
|
|
242
|
+
var E = me, _ = Symbol.for("react.transitional.element"), w = Symbol.for("react.portal"), h = Symbol.for("react.fragment"), S = Symbol.for("react.strict_mode"), R = Symbol.for("react.profiler"), T = Symbol.for("react.consumer"), F = Symbol.for("react.context"), se = Symbol.for("react.forward_ref"), ae = Symbol.for("react.suspense"), le = Symbol.for("react.suspense_list"), ie = Symbol.for("react.memo"), B = Symbol.for("react.lazy"), ce = Symbol.for("react.activity"), ue = Symbol.for("react.client.reference"), P = E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, W = Object.prototype.hasOwnProperty, de = Array.isArray, D = console.createTask ? console.createTask : function() {
|
|
243
|
+
return null;
|
|
244
|
+
};
|
|
245
|
+
E = {
|
|
246
|
+
react_stack_bottom_frame: function(e) {
|
|
247
|
+
return e();
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
var U, z = {}, q = E.react_stack_bottom_frame.bind(
|
|
251
|
+
E,
|
|
252
|
+
i
|
|
253
|
+
)(), G = D(l(i)), J = {};
|
|
254
|
+
y.Fragment = h, y.jsx = function(e, s, u, p, k) {
|
|
255
|
+
var v = 1e4 > P.recentlyCreatedOwnerStacks++;
|
|
256
|
+
return m(
|
|
257
|
+
e,
|
|
258
|
+
s,
|
|
259
|
+
u,
|
|
260
|
+
!1,
|
|
261
|
+
p,
|
|
262
|
+
k,
|
|
263
|
+
v ? Error("react-stack-top-frame") : q,
|
|
264
|
+
v ? D(l(e)) : G
|
|
265
|
+
);
|
|
266
|
+
}, y.jsxs = function(e, s, u, p, k) {
|
|
267
|
+
var v = 1e4 > P.recentlyCreatedOwnerStacks++;
|
|
268
|
+
return m(
|
|
269
|
+
e,
|
|
270
|
+
s,
|
|
271
|
+
u,
|
|
272
|
+
!0,
|
|
273
|
+
p,
|
|
274
|
+
k,
|
|
275
|
+
v ? Error("react-stack-top-frame") : q,
|
|
276
|
+
v ? D(l(e)) : G
|
|
277
|
+
);
|
|
278
|
+
};
|
|
279
|
+
})()), y;
|
|
280
|
+
}
|
|
281
|
+
var X;
|
|
282
|
+
function Ye() {
|
|
283
|
+
return X || (X = 1, process.env.NODE_ENV === "production" ? O.exports = De() : O.exports = Le()), O.exports;
|
|
284
|
+
}
|
|
285
|
+
var o = Ye();
|
|
286
|
+
const A = ({ icon: r, className: t }) => r ? /* @__PURE__ */ o.jsx("span", { className: j("flex-shrink-0", t), children: r }) : null, Ke = ({
|
|
287
|
+
title: r,
|
|
288
|
+
cssClass: t,
|
|
289
|
+
ref: a,
|
|
290
|
+
onClick: l,
|
|
291
|
+
disable: n,
|
|
292
|
+
iconAfter: i,
|
|
293
|
+
iconBefore: c,
|
|
294
|
+
hideTitleOnMobile: d,
|
|
295
|
+
ariaLabel: f
|
|
296
|
+
}) => {
|
|
297
|
+
const g = j(
|
|
298
|
+
"dial-small-semi",
|
|
299
|
+
i ? "mr-2" : "",
|
|
300
|
+
c ? "ml-2" : "",
|
|
301
|
+
d ? "hidden sm:inline" : "inline"
|
|
302
|
+
), m = j(
|
|
303
|
+
t,
|
|
304
|
+
"focus-visible:outline outline-offset-0"
|
|
305
|
+
);
|
|
306
|
+
return /* @__PURE__ */ o.jsxs(
|
|
307
|
+
"button",
|
|
308
|
+
{
|
|
309
|
+
ref: a,
|
|
310
|
+
type: "button",
|
|
311
|
+
className: m,
|
|
312
|
+
onClick: (x) => l?.(x),
|
|
313
|
+
disabled: n,
|
|
314
|
+
"aria-label": r || f,
|
|
315
|
+
children: [
|
|
316
|
+
/* @__PURE__ */ o.jsx(A, { icon: c }),
|
|
317
|
+
r && /* @__PURE__ */ o.jsx("span", { className: g, children: r }),
|
|
318
|
+
/* @__PURE__ */ o.jsx(A, { icon: i })
|
|
319
|
+
]
|
|
320
|
+
}
|
|
321
|
+
);
|
|
322
|
+
}, ee = ({ errorText: r }) => r && /* @__PURE__ */ o.jsx("span", { className: "text-error dial-tiny mt-1", children: r }), re = ({
|
|
323
|
+
fieldTitle: r,
|
|
324
|
+
htmlFor: t,
|
|
325
|
+
optional: a,
|
|
326
|
+
optionalText: l,
|
|
327
|
+
cssClass: n
|
|
328
|
+
}) => r ? /* @__PURE__ */ o.jsxs(
|
|
329
|
+
"label",
|
|
330
|
+
{
|
|
331
|
+
className: j(
|
|
332
|
+
"dial-tiny text-secondary",
|
|
333
|
+
n,
|
|
334
|
+
!n?.includes("mb") && "mb-2"
|
|
335
|
+
),
|
|
336
|
+
htmlFor: t,
|
|
337
|
+
children: [
|
|
338
|
+
/* @__PURE__ */ o.jsx("span", { className: "min-h-4", children: r }),
|
|
339
|
+
a && /* @__PURE__ */ o.jsx("span", { className: "ml-1", children: l ?? "(Optional)" })
|
|
340
|
+
]
|
|
341
|
+
}
|
|
342
|
+
) : null, Ie = ({
|
|
343
|
+
value: r,
|
|
344
|
+
textareaId: t,
|
|
345
|
+
placeholder: a,
|
|
346
|
+
cssClass: l = "",
|
|
347
|
+
disabled: n,
|
|
348
|
+
invalid: i,
|
|
349
|
+
readonly: c,
|
|
350
|
+
onChange: d
|
|
351
|
+
}) => /* @__PURE__ */ o.jsx(
|
|
352
|
+
"textarea",
|
|
353
|
+
{
|
|
354
|
+
id: t,
|
|
355
|
+
placeholder: a,
|
|
356
|
+
value: r,
|
|
357
|
+
disabled: n,
|
|
358
|
+
className: j(
|
|
359
|
+
"dial-textarea dial-input",
|
|
360
|
+
i ? "dial-input-error" : "",
|
|
361
|
+
n && "dial-input-disable",
|
|
362
|
+
c && "dial-input-readonly",
|
|
363
|
+
l
|
|
364
|
+
),
|
|
365
|
+
onChange: (f) => !c && d?.(f.currentTarget.value)
|
|
366
|
+
}
|
|
367
|
+
), Me = 7, $e = 2, te = pe(null), ne = () => {
|
|
368
|
+
const r = ve(te);
|
|
369
|
+
if (r == null)
|
|
370
|
+
throw new Error("Tooltip components must be wrapped in <Tooltip />");
|
|
371
|
+
return r;
|
|
372
|
+
}, Be = ({
|
|
373
|
+
initialOpen: r = !1,
|
|
374
|
+
placement: t = "bottom",
|
|
375
|
+
isTriggerClickable: a = !1,
|
|
376
|
+
open: l,
|
|
377
|
+
onOpenChange: n
|
|
378
|
+
} = {}) => {
|
|
379
|
+
const [i, c] = be(r), d = ge(null), f = l ?? i, g = n ?? c, m = Ee({
|
|
380
|
+
placement: t,
|
|
381
|
+
open: f,
|
|
382
|
+
onOpenChange: g,
|
|
383
|
+
whileElementsMounted: Ne,
|
|
384
|
+
middleware: [
|
|
385
|
+
ke(Me + $e),
|
|
386
|
+
Re({
|
|
387
|
+
crossAxis: t.includes("-"),
|
|
388
|
+
fallbackAxisSideDirection: "start",
|
|
389
|
+
padding: 5
|
|
390
|
+
}),
|
|
391
|
+
Te({ padding: 5 }),
|
|
392
|
+
_e({
|
|
393
|
+
element: d
|
|
394
|
+
})
|
|
395
|
+
]
|
|
396
|
+
}), x = we(m.context, {
|
|
397
|
+
move: !1,
|
|
398
|
+
enabled: l == null,
|
|
399
|
+
mouseOnly: a,
|
|
400
|
+
delay: { open: 500, close: 0 }
|
|
401
|
+
}), E = Ce(m.context, {
|
|
402
|
+
enabled: l == null
|
|
403
|
+
}), _ = ye(m.context), w = Se(m.context, { role: "tooltip" }), h = Oe([x, E, _, w]);
|
|
404
|
+
return xe(
|
|
405
|
+
() => ({
|
|
406
|
+
open: f,
|
|
407
|
+
setOpen: g,
|
|
408
|
+
arrowRef: d,
|
|
409
|
+
...h,
|
|
410
|
+
...m
|
|
411
|
+
}),
|
|
412
|
+
[f, g, h, m]
|
|
413
|
+
);
|
|
414
|
+
}, We = ({
|
|
415
|
+
children: r,
|
|
416
|
+
...t
|
|
417
|
+
}) => {
|
|
418
|
+
const a = Be(t);
|
|
419
|
+
return /* @__PURE__ */ o.jsx(te.Provider, { value: a, children: r });
|
|
420
|
+
}, Ue = Q(function({ style: t, ...a }, l) {
|
|
421
|
+
const n = ne(), i = K([n.refs.setFloating, l]);
|
|
422
|
+
return n.open ? /* @__PURE__ */ o.jsx(Ae, { id: "tooltip-portal", children: /* @__PURE__ */ o.jsxs(
|
|
423
|
+
"div",
|
|
424
|
+
{
|
|
425
|
+
ref: i,
|
|
426
|
+
style: {
|
|
427
|
+
...n.floatingStyles,
|
|
428
|
+
...t
|
|
429
|
+
},
|
|
430
|
+
...n.getFloatingProps(a),
|
|
431
|
+
className: j(
|
|
432
|
+
"z-[55] whitespace-pre-wrap rounded border border-primary bg-blackout px-2 py-1 dial-tiny shadow max-w-[300px]",
|
|
433
|
+
n.getFloatingProps(a).className
|
|
434
|
+
),
|
|
435
|
+
children: [
|
|
436
|
+
a.children,
|
|
437
|
+
/* @__PURE__ */ o.jsx(
|
|
438
|
+
Fe,
|
|
439
|
+
{
|
|
440
|
+
ref: n.arrowRef,
|
|
441
|
+
context: n.context,
|
|
442
|
+
fill: "currentColor",
|
|
443
|
+
strokeWidth: 1,
|
|
444
|
+
className: "stroke-primary w-2 text-[var(--bg-layer-0,_#000000)]"
|
|
445
|
+
}
|
|
446
|
+
)
|
|
447
|
+
]
|
|
448
|
+
}
|
|
449
|
+
) }) : null;
|
|
450
|
+
}), ze = Q(function({ children: t, asChild: a = !1, ...l }, n) {
|
|
451
|
+
const i = ne(), d = t && typeof t == "object" && "ref" in t && t.ref !== void 0 ? t.ref : void 0, f = K([i.refs.setReference, n, d]);
|
|
452
|
+
return a && je(t) ? he(
|
|
453
|
+
t,
|
|
454
|
+
i.getReferenceProps({
|
|
455
|
+
ref: f,
|
|
456
|
+
...l,
|
|
457
|
+
...t.props
|
|
458
|
+
})
|
|
459
|
+
) : /* @__PURE__ */ o.jsx(
|
|
460
|
+
"span",
|
|
461
|
+
{
|
|
462
|
+
ref: f,
|
|
463
|
+
...i.getReferenceProps(l),
|
|
464
|
+
className: l.className ?? "dial-tooltip-trigger text-left",
|
|
465
|
+
children: t
|
|
466
|
+
}
|
|
467
|
+
);
|
|
468
|
+
}), Z = ({
|
|
469
|
+
hideTooltip: r,
|
|
470
|
+
tooltip: t,
|
|
471
|
+
children: a,
|
|
472
|
+
triggerClassName: l,
|
|
473
|
+
contentClassName: n,
|
|
474
|
+
...i
|
|
475
|
+
}) => r || !t ? /* @__PURE__ */ o.jsx("span", { className: l, children: a }) : /* @__PURE__ */ o.jsxs(We, { ...i, children: [
|
|
476
|
+
/* @__PURE__ */ o.jsx(ze, { className: l, children: a }),
|
|
477
|
+
/* @__PURE__ */ o.jsx(
|
|
478
|
+
Ue,
|
|
479
|
+
{
|
|
480
|
+
className: j("text-primary", n),
|
|
481
|
+
children: t
|
|
482
|
+
}
|
|
483
|
+
)
|
|
484
|
+
] }), M = ({
|
|
485
|
+
iconBeforeInput: r,
|
|
486
|
+
iconAfterInput: t,
|
|
487
|
+
hideBorder: a,
|
|
488
|
+
value: l,
|
|
489
|
+
elementId: n,
|
|
490
|
+
placeholder: i = "",
|
|
491
|
+
cssClass: c = "",
|
|
492
|
+
containerCssClass: d,
|
|
493
|
+
type: f = "text",
|
|
494
|
+
disabled: g,
|
|
495
|
+
readonly: m,
|
|
496
|
+
invalid: x,
|
|
497
|
+
onChange: E,
|
|
498
|
+
min: _,
|
|
499
|
+
max: w,
|
|
500
|
+
prefix: h,
|
|
501
|
+
suffix: S,
|
|
502
|
+
textBeforeInput: R,
|
|
503
|
+
textAfterInput: T
|
|
504
|
+
}) => /* @__PURE__ */ o.jsxs(
|
|
505
|
+
"div",
|
|
506
|
+
{
|
|
507
|
+
className: j(
|
|
508
|
+
"dial-input-field flex flex-row items-center justify-between",
|
|
509
|
+
a ? "dial-input-no-border" : "dial-input",
|
|
510
|
+
x && "dial-input-error",
|
|
511
|
+
g && "dial-input-disable",
|
|
512
|
+
m && "dial-input-readonly",
|
|
513
|
+
!R && "pl-1",
|
|
514
|
+
!T && "pr-1",
|
|
515
|
+
d
|
|
516
|
+
),
|
|
517
|
+
children: [
|
|
518
|
+
R && /* @__PURE__ */ o.jsx(Z, { tooltip: R, children: /* @__PURE__ */ o.jsx(
|
|
519
|
+
M,
|
|
520
|
+
{
|
|
521
|
+
hideBorder: !0,
|
|
522
|
+
containerCssClass: "rounded-r-none border-r-0",
|
|
523
|
+
cssClass: "px-2 overflow-hidden overflow-ellipsis dial-small",
|
|
524
|
+
value: R,
|
|
525
|
+
disabled: !0,
|
|
526
|
+
elementId: R + "textBefore"
|
|
527
|
+
}
|
|
528
|
+
) }),
|
|
529
|
+
h && /* @__PURE__ */ o.jsxs("p", { className: "text-secondary dial-small pl-2", children: [
|
|
530
|
+
" ",
|
|
531
|
+
h
|
|
532
|
+
] }),
|
|
533
|
+
/* @__PURE__ */ o.jsx(A, { icon: r, className: "pl-2" }),
|
|
534
|
+
/* @__PURE__ */ o.jsx(
|
|
535
|
+
"input",
|
|
536
|
+
{
|
|
537
|
+
type: f,
|
|
538
|
+
autoComplete: "new-password",
|
|
539
|
+
id: n,
|
|
540
|
+
placeholder: i,
|
|
541
|
+
value: l ?? "",
|
|
542
|
+
title: l ? String(l) : "",
|
|
543
|
+
disabled: g,
|
|
544
|
+
min: _,
|
|
545
|
+
max: w,
|
|
546
|
+
className: j("border-0 bg-transparent px-2", c),
|
|
547
|
+
onChange: (F) => !m && E?.(F.currentTarget.value)
|
|
548
|
+
}
|
|
549
|
+
),
|
|
550
|
+
/* @__PURE__ */ o.jsx(A, { icon: t, className: "pr-2" }),
|
|
551
|
+
S && /* @__PURE__ */ o.jsxs("p", { className: "text-secondary dial-small pr-2", children: [
|
|
552
|
+
" ",
|
|
553
|
+
S
|
|
554
|
+
] }),
|
|
555
|
+
T && /* @__PURE__ */ o.jsx(Z, { tooltip: T, children: /* @__PURE__ */ o.jsx(
|
|
556
|
+
M,
|
|
557
|
+
{
|
|
558
|
+
hideBorder: !0,
|
|
559
|
+
containerCssClass: "rounded-l-none border-l-0",
|
|
560
|
+
cssClass: "px-2",
|
|
561
|
+
value: T,
|
|
562
|
+
disabled: !0,
|
|
563
|
+
elementId: T + "textAfter"
|
|
564
|
+
}
|
|
565
|
+
) })
|
|
566
|
+
]
|
|
567
|
+
}
|
|
568
|
+
), qe = /^0+\.(\d+)?$/, Ge = /^0+/, oe = ({
|
|
569
|
+
fieldTitle: r,
|
|
570
|
+
errorText: t,
|
|
571
|
+
optional: a,
|
|
572
|
+
elementCssClass: l,
|
|
573
|
+
elementContainerCssClass: n,
|
|
574
|
+
elementId: i,
|
|
575
|
+
containerCssClass: c,
|
|
576
|
+
readonly: d,
|
|
577
|
+
defaultEmptyText: f,
|
|
578
|
+
min: g,
|
|
579
|
+
max: m,
|
|
580
|
+
...x
|
|
581
|
+
}) => /* @__PURE__ */ o.jsxs("div", { className: j("flex flex-col", c), children: [
|
|
582
|
+
/* @__PURE__ */ o.jsx(
|
|
583
|
+
re,
|
|
584
|
+
{
|
|
585
|
+
fieldTitle: r,
|
|
586
|
+
optional: a,
|
|
587
|
+
htmlFor: i
|
|
588
|
+
}
|
|
589
|
+
),
|
|
590
|
+
d ? /* @__PURE__ */ o.jsx("span", { children: x.value || (f ?? "None") }) : /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
591
|
+
/* @__PURE__ */ o.jsx(
|
|
592
|
+
M,
|
|
593
|
+
{
|
|
594
|
+
elementId: i,
|
|
595
|
+
cssClass: l,
|
|
596
|
+
containerCssClass: n,
|
|
597
|
+
invalid: t != null,
|
|
598
|
+
min: g,
|
|
599
|
+
max: m,
|
|
600
|
+
...x
|
|
601
|
+
}
|
|
602
|
+
),
|
|
603
|
+
/* @__PURE__ */ o.jsx(ee, { errorText: t })
|
|
604
|
+
] })
|
|
605
|
+
] }), er = ({
|
|
606
|
+
onChange: r,
|
|
607
|
+
value: t,
|
|
608
|
+
min: a,
|
|
609
|
+
max: l,
|
|
610
|
+
...n
|
|
611
|
+
}) => {
|
|
612
|
+
const i = (c) => String(c)?.match(qe) ? String(c)?.replace(Ge, "0") : Number(c);
|
|
613
|
+
return /* @__PURE__ */ o.jsx(
|
|
614
|
+
oe,
|
|
615
|
+
{
|
|
616
|
+
type: "number",
|
|
617
|
+
onChange: (c) => r?.(i(c)),
|
|
618
|
+
value: t,
|
|
619
|
+
min: a,
|
|
620
|
+
max: l,
|
|
621
|
+
...n
|
|
622
|
+
}
|
|
623
|
+
);
|
|
624
|
+
}, rr = ({
|
|
625
|
+
onChange: r,
|
|
626
|
+
...t
|
|
627
|
+
}) => /* @__PURE__ */ o.jsx(
|
|
628
|
+
oe,
|
|
629
|
+
{
|
|
630
|
+
type: "text",
|
|
631
|
+
onChange: (a) => r?.(a),
|
|
632
|
+
...t
|
|
633
|
+
}
|
|
634
|
+
), tr = ({
|
|
635
|
+
fieldTitle: r,
|
|
636
|
+
optional: t,
|
|
637
|
+
elementId: a,
|
|
638
|
+
elementCssClass: l,
|
|
639
|
+
errorText: n,
|
|
640
|
+
...i
|
|
641
|
+
}) => /* @__PURE__ */ o.jsxs("div", { className: "flex flex-col", children: [
|
|
642
|
+
/* @__PURE__ */ o.jsx(
|
|
643
|
+
re,
|
|
644
|
+
{
|
|
645
|
+
fieldTitle: r,
|
|
646
|
+
optional: t,
|
|
647
|
+
htmlFor: a
|
|
648
|
+
}
|
|
649
|
+
),
|
|
650
|
+
/* @__PURE__ */ o.jsx(
|
|
651
|
+
Ie,
|
|
652
|
+
{
|
|
653
|
+
textareaId: a,
|
|
654
|
+
cssClass: l,
|
|
655
|
+
...i
|
|
656
|
+
}
|
|
657
|
+
),
|
|
658
|
+
/* @__PURE__ */ o.jsx(ee, { errorText: n })
|
|
659
|
+
] });
|
|
660
|
+
var $ = /* @__PURE__ */ ((r) => (r.dark = "dark", r.light = "light", r))($ || {});
|
|
661
|
+
const Je = {
|
|
662
|
+
[$.dark]: {
|
|
663
|
+
base: "vs-dark",
|
|
664
|
+
inherit: !1,
|
|
665
|
+
rules: [
|
|
666
|
+
{ token: "string.key.json", foreground: "#37BABC" },
|
|
667
|
+
{ token: "string.value.json", foreground: "#5C8DEA" },
|
|
668
|
+
{ token: "number", foreground: "#D97C27" },
|
|
669
|
+
{ token: "keyword.json", foreground: "#F4CE46" },
|
|
670
|
+
{ token: "delimiter", foreground: "#F3F4F6" },
|
|
671
|
+
{ token: "delimiter.bracket.json", foreground: "#A972FF" },
|
|
672
|
+
{ token: "delimiter.parenthesis", foreground: "#A972FF" }
|
|
673
|
+
],
|
|
674
|
+
colors: {
|
|
675
|
+
"editor.foreground": "#F76464",
|
|
676
|
+
"editor.background": "#141A23",
|
|
677
|
+
"editorCursor.foreground": "#F3F4F6",
|
|
678
|
+
"editor.selectionBackground": "#5C8DEA2B",
|
|
679
|
+
"editorLineNumber.foreground": "#333942",
|
|
680
|
+
"scrollbarSlider.background": "#333942",
|
|
681
|
+
"scrollbarSlider.hoverBackground": "#333942",
|
|
682
|
+
"scrollbarSlider.activeBackground": "#333942"
|
|
683
|
+
}
|
|
684
|
+
},
|
|
685
|
+
[$.light]: {
|
|
686
|
+
base: "vs",
|
|
687
|
+
inherit: !1,
|
|
688
|
+
rules: [
|
|
689
|
+
{ token: "string.key.json", foreground: "#009D9F" },
|
|
690
|
+
{ token: "string.value.json", foreground: "#2764D9" },
|
|
691
|
+
{ token: "number", foreground: "#B25500" },
|
|
692
|
+
{ token: "keyword.json", foreground: "#3F3D25" },
|
|
693
|
+
{ token: "delimiter", foreground: "#141A23" },
|
|
694
|
+
{ token: "delimiter.bracket.json", foreground: "#843EF3" },
|
|
695
|
+
{ token: "delimiter.parenthesis", foreground: "#843EF3" }
|
|
696
|
+
],
|
|
697
|
+
colors: {
|
|
698
|
+
"editor.foreground": "#AE2F2F",
|
|
699
|
+
"editor.background": "#F3F4F6",
|
|
700
|
+
"editorCursor.foreground": "#141A23",
|
|
701
|
+
"editor.selectionBackground": "#5C8DEA2B",
|
|
702
|
+
"editorLineNumber.foreground": "#333942",
|
|
703
|
+
"scrollbarSlider.background": "#333942",
|
|
704
|
+
"scrollbarSlider.hoverBackground": "#333942",
|
|
705
|
+
"scrollbarSlider.activeBackground": "#333942"
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
}, nr = ({
|
|
709
|
+
value: r,
|
|
710
|
+
onChange: t,
|
|
711
|
+
onValidateJSON: a,
|
|
712
|
+
options: l,
|
|
713
|
+
currentTheme: n,
|
|
714
|
+
themesConfig: i = Je
|
|
715
|
+
}) => {
|
|
716
|
+
function c(d) {
|
|
717
|
+
d?.editor?.defineTheme(
|
|
718
|
+
n,
|
|
719
|
+
i[n]
|
|
720
|
+
), d.languages.json.jsonDefaults.setDiagnosticsOptions({
|
|
721
|
+
validate: !0,
|
|
722
|
+
enableSchemaRequest: !1,
|
|
723
|
+
schemas: [
|
|
724
|
+
{
|
|
725
|
+
uri: "http://custom-schema/object-required.json",
|
|
726
|
+
fileMatch: ["*"],
|
|
727
|
+
schema: {
|
|
728
|
+
type: "object",
|
|
729
|
+
description: "Top-level value must be an object",
|
|
730
|
+
additionalProperties: !0
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
]
|
|
734
|
+
});
|
|
735
|
+
}
|
|
736
|
+
return /* @__PURE__ */ o.jsx(
|
|
737
|
+
Pe,
|
|
738
|
+
{
|
|
739
|
+
beforeMount: c,
|
|
740
|
+
height: "100%",
|
|
741
|
+
defaultLanguage: "json",
|
|
742
|
+
value: r,
|
|
743
|
+
onChange: t,
|
|
744
|
+
theme: n,
|
|
745
|
+
onValidate: a,
|
|
746
|
+
options: {
|
|
747
|
+
minimap: { enabled: !1 },
|
|
748
|
+
formatOnType: !0,
|
|
749
|
+
formatOnPaste: !0,
|
|
750
|
+
selectOnLineNumbers: !1,
|
|
751
|
+
automaticLayout: !0,
|
|
752
|
+
scrollBeyondLastLine: !1,
|
|
753
|
+
wordWrap: "on",
|
|
754
|
+
smoothScrolling: !0,
|
|
755
|
+
overviewRulerLanes: 0,
|
|
756
|
+
scrollbar: {
|
|
757
|
+
horizontal: "hidden",
|
|
758
|
+
verticalScrollbarSize: 4,
|
|
759
|
+
verticalSliderSize: 4
|
|
760
|
+
},
|
|
761
|
+
...l ?? {}
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
);
|
|
765
|
+
};
|
|
766
|
+
export {
|
|
767
|
+
Ke as DialButton,
|
|
768
|
+
ee as DialErrorText,
|
|
769
|
+
re as DialFieldLabel,
|
|
770
|
+
A as DialIcon,
|
|
771
|
+
M as DialInput,
|
|
772
|
+
nr as DialJsonEditor,
|
|
773
|
+
er as DialNumberInputField,
|
|
774
|
+
tr as DialTextAreaField,
|
|
775
|
+
rr as DialTextInputField,
|
|
776
|
+
Ie as DialTextarea,
|
|
777
|
+
Z as DialTooltip
|
|
778
|
+
};
|