@epam/ai-dial-ui-kit 0.2.0-rc.0 → 0.2.0-rc.10
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/README.md +12 -12
- package/dist/dial-ui-kit.cjs.js +1 -1
- package/dist/dial-ui-kit.es.js +489 -277
- package/dist/index.css +2 -2
- package/dist/src/components/Alert/Alert.d.ts +42 -0
- package/dist/src/components/Alert/constants.d.ts +5 -0
- package/dist/src/components/Button/Button.d.ts +3 -0
- package/dist/src/components/Button/constants.d.ts +2 -0
- package/dist/src/components/Checkbox/Checkbox.d.ts +33 -0
- package/dist/src/components/Loader/Loader.d.ts +32 -0
- package/dist/src/components/Loader/constants.d.ts +2 -0
- package/dist/src/components/Steps/Step.d.ts +9 -0
- package/dist/src/components/Steps/Steps.d.ts +24 -0
- package/dist/src/components/Steps/tests/Steps.test.d.ts +1 -0
- package/dist/src/components/Steps/utils.d.ts +3 -0
- package/dist/src/components/Switch/Switch.d.ts +1 -1
- package/dist/src/components/Tooltip/TooltipContext.d.ts +4 -4
- package/dist/src/constants/icon.d.ts +5 -0
- package/dist/src/index.d.ts +8 -0
- package/dist/src/models/step.d.ts +9 -0
- package/dist/src/types/alert.d.ts +6 -0
- package/dist/src/types/button.d.ts +5 -0
- package/package.json +1 -1
package/dist/dial-ui-kit.es.js
CHANGED
|
@@ -1,138 +1,220 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as n, jsxs as m, Fragment as $ } from "react/jsx-runtime";
|
|
2
2
|
import d from "classnames";
|
|
3
|
-
import {
|
|
4
|
-
import { createContext as
|
|
5
|
-
|
|
3
|
+
import { IconCircleCheck as G, IconAlertTriangle as Z, IconAlertCircle as X, IconInfoCircle as Y, IconX as q, IconLoader as J, IconMinus as Q, IconCheck as A, IconExclamationCircle as ee } from "@tabler/icons-react";
|
|
4
|
+
import { createContext as re, useState as te, useRef as ne, useMemo as se, useContext as oe, forwardRef as L, isValidElement as ae, cloneElement as le, useCallback as O } from "react";
|
|
5
|
+
import { useFloating as ie, offset as ce, flip as de, shift as ue, arrow as me, autoUpdate as fe, useHover as pe, useFocus as be, useDismiss as he, useRole as ge, useInteractions as xe, useMergeRefs as z, FloatingPortal as ye, FloatingArrow as Ne } from "@floating-ui/react";
|
|
6
|
+
const N = ({ icon: e, className: r }) => e ? /* @__PURE__ */ n("span", { className: d("flex-shrink-0", r), children: e }) : null;
|
|
7
|
+
var k = /* @__PURE__ */ ((e) => (e.Primary = "primary", e.Secondary = "secondary", e.Tertiary = "tertiary", e))(k || {});
|
|
8
|
+
const Ce = {
|
|
9
|
+
[k.Primary]: "dial-primary-button",
|
|
10
|
+
[k.Secondary]: "dial-secondary-button",
|
|
11
|
+
[k.Tertiary]: "dial-tertiary-button"
|
|
12
|
+
}, we = ({
|
|
6
13
|
title: e,
|
|
14
|
+
variant: r,
|
|
7
15
|
cssClass: t,
|
|
8
|
-
ref:
|
|
9
|
-
onClick:
|
|
10
|
-
disable:
|
|
11
|
-
iconAfter:
|
|
12
|
-
iconBefore:
|
|
16
|
+
ref: s,
|
|
17
|
+
onClick: o,
|
|
18
|
+
disable: a,
|
|
19
|
+
iconAfter: l,
|
|
20
|
+
iconBefore: i,
|
|
13
21
|
hideTitleOnMobile: c,
|
|
14
|
-
ariaLabel:
|
|
22
|
+
ariaLabel: f
|
|
15
23
|
}) => {
|
|
16
|
-
const
|
|
24
|
+
const u = d(
|
|
17
25
|
"dial-small-semi",
|
|
18
|
-
|
|
19
|
-
|
|
26
|
+
l ? "mr-2" : "",
|
|
27
|
+
i ? "ml-2" : "",
|
|
20
28
|
c ? "hidden sm:inline" : "inline"
|
|
21
|
-
),
|
|
29
|
+
), b = d(
|
|
30
|
+
r && Ce[r],
|
|
22
31
|
t,
|
|
23
32
|
"focus-visible:outline outline-offset-0"
|
|
24
33
|
);
|
|
25
34
|
return /* @__PURE__ */ m(
|
|
26
35
|
"button",
|
|
27
36
|
{
|
|
28
|
-
ref:
|
|
37
|
+
ref: s,
|
|
29
38
|
type: "button",
|
|
30
|
-
className:
|
|
31
|
-
onClick: (
|
|
32
|
-
disabled:
|
|
33
|
-
"aria-label": e ||
|
|
39
|
+
className: b,
|
|
40
|
+
onClick: (C) => o?.(C),
|
|
41
|
+
disabled: a,
|
|
42
|
+
"aria-label": e || f,
|
|
34
43
|
children: [
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
e && /* @__PURE__ */
|
|
37
|
-
/* @__PURE__ */
|
|
44
|
+
/* @__PURE__ */ n(N, { icon: i }),
|
|
45
|
+
e && /* @__PURE__ */ n("span", { className: u, children: e }),
|
|
46
|
+
/* @__PURE__ */ n(N, { icon: l })
|
|
38
47
|
]
|
|
39
48
|
}
|
|
40
49
|
);
|
|
41
|
-
},
|
|
50
|
+
}, V = ({ errorText: e }) => e && /* @__PURE__ */ n("span", { className: "text-error dial-tiny mt-1", children: e }), _ = ({
|
|
42
51
|
fieldTitle: e,
|
|
43
|
-
htmlFor:
|
|
44
|
-
optional:
|
|
45
|
-
optionalText:
|
|
46
|
-
cssClass:
|
|
52
|
+
htmlFor: r,
|
|
53
|
+
optional: t,
|
|
54
|
+
optionalText: s,
|
|
55
|
+
cssClass: o
|
|
47
56
|
}) => e ? /* @__PURE__ */ m(
|
|
48
57
|
"label",
|
|
49
58
|
{
|
|
50
59
|
className: d(
|
|
51
60
|
"dial-tiny text-secondary",
|
|
52
|
-
|
|
53
|
-
!
|
|
61
|
+
o,
|
|
62
|
+
!o?.includes("mb") && "mb-2"
|
|
54
63
|
),
|
|
55
|
-
htmlFor:
|
|
64
|
+
htmlFor: r,
|
|
56
65
|
children: [
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
|
|
66
|
+
/* @__PURE__ */ n("span", { className: "min-h-4", children: e }),
|
|
67
|
+
t && /* @__PURE__ */ n("span", { className: "ml-1", children: s ?? "(Optional)" })
|
|
59
68
|
]
|
|
60
69
|
}
|
|
61
|
-
) : null
|
|
62
|
-
|
|
70
|
+
) : null;
|
|
71
|
+
var y = /* @__PURE__ */ ((e) => (e.Info = "info", e.Success = "success", e.Warning = "warning", e.Error = "error", e))(y || {});
|
|
72
|
+
const ve = {
|
|
73
|
+
info: /* @__PURE__ */ n(Y, { size: 24, stroke: 2 }),
|
|
74
|
+
error: /* @__PURE__ */ n(X, { size: 24, stroke: 2 }),
|
|
75
|
+
warning: /* @__PURE__ */ n(Z, { size: 24, stroke: 2 }),
|
|
76
|
+
success: /* @__PURE__ */ n(G, { size: 24, stroke: 2 })
|
|
77
|
+
}, De = {
|
|
78
|
+
[y.Info]: "bg-info border-info text-info",
|
|
79
|
+
[y.Success]: "bg-success border-success text-success",
|
|
80
|
+
[y.Warning]: "bg-warning border-warning text-warning",
|
|
81
|
+
[y.Error]: "bg-error border-error text-error"
|
|
82
|
+
}, Ie = "items-center justify-between gap-2 p-3 border border-solid dial-small-150 rounded flex", Ze = ({
|
|
83
|
+
variant: e = y.Info,
|
|
84
|
+
message: r,
|
|
85
|
+
cssClass: t,
|
|
86
|
+
closable: s = !1,
|
|
87
|
+
onClose: o
|
|
88
|
+
}) => /* @__PURE__ */ m(
|
|
89
|
+
"div",
|
|
90
|
+
{
|
|
91
|
+
role: "alert",
|
|
92
|
+
className: d(
|
|
93
|
+
Ie,
|
|
94
|
+
De[e],
|
|
95
|
+
t
|
|
96
|
+
),
|
|
97
|
+
children: [
|
|
98
|
+
/* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
|
|
99
|
+
/* @__PURE__ */ n(N, { icon: ve[e] }),
|
|
100
|
+
/* @__PURE__ */ n("div", { className: "text-primary", children: r })
|
|
101
|
+
] }),
|
|
102
|
+
s && /* @__PURE__ */ n(
|
|
103
|
+
we,
|
|
104
|
+
{
|
|
105
|
+
cssClass: "ml-2 text-secondary hover:text-primary",
|
|
106
|
+
ariaLabel: "Close alert",
|
|
107
|
+
iconBefore: /* @__PURE__ */ n(q, { size: 16 }),
|
|
108
|
+
onClick: (a) => o?.(a)
|
|
109
|
+
}
|
|
110
|
+
)
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
), Re = "flex items-center justify-center text-secondary", ke = "shrink-0 grow-0 basis-auto animate-spin-steps", Xe = ({
|
|
114
|
+
size: e = 18,
|
|
115
|
+
cssClass: r,
|
|
116
|
+
iconClass: t,
|
|
117
|
+
fullWidth: s = !0,
|
|
118
|
+
ariaLabel: o = "Loading"
|
|
119
|
+
}) => /* @__PURE__ */ n(
|
|
120
|
+
"div",
|
|
121
|
+
{
|
|
122
|
+
role: "status",
|
|
123
|
+
"aria-label": o,
|
|
124
|
+
className: d({
|
|
125
|
+
[Re]: !0,
|
|
126
|
+
"w-full h-full": s,
|
|
127
|
+
[r || ""]: !!r
|
|
128
|
+
}),
|
|
129
|
+
children: /* @__PURE__ */ n(
|
|
130
|
+
N,
|
|
131
|
+
{
|
|
132
|
+
icon: /* @__PURE__ */ n(
|
|
133
|
+
J,
|
|
134
|
+
{
|
|
135
|
+
width: e,
|
|
136
|
+
height: e,
|
|
137
|
+
className: d(ke, t)
|
|
138
|
+
}
|
|
139
|
+
)
|
|
140
|
+
}
|
|
141
|
+
)
|
|
142
|
+
}
|
|
143
|
+
), Te = 7, Ee = 2, j = re(null), W = () => {
|
|
144
|
+
const e = oe(j);
|
|
63
145
|
if (e == null)
|
|
64
146
|
throw new Error("Tooltip components must be wrapped in <Tooltip />");
|
|
65
147
|
return e;
|
|
66
|
-
},
|
|
148
|
+
}, Fe = ({
|
|
67
149
|
initialOpen: e = !1,
|
|
68
|
-
placement:
|
|
69
|
-
isTriggerClickable:
|
|
70
|
-
open:
|
|
71
|
-
onOpenChange:
|
|
150
|
+
placement: r = "bottom",
|
|
151
|
+
isTriggerClickable: t = !1,
|
|
152
|
+
open: s,
|
|
153
|
+
onOpenChange: o
|
|
72
154
|
} = {}) => {
|
|
73
|
-
const [
|
|
74
|
-
placement:
|
|
75
|
-
open:
|
|
76
|
-
onOpenChange:
|
|
77
|
-
whileElementsMounted:
|
|
155
|
+
const [a, l] = te(e), i = ne(null), c = s ?? a, f = o ?? l, u = ie({
|
|
156
|
+
placement: r,
|
|
157
|
+
open: c,
|
|
158
|
+
onOpenChange: f,
|
|
159
|
+
whileElementsMounted: fe,
|
|
78
160
|
middleware: [
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
crossAxis:
|
|
161
|
+
ce(Te + Ee),
|
|
162
|
+
de({
|
|
163
|
+
crossAxis: r.includes("-"),
|
|
82
164
|
fallbackAxisSideDirection: "start",
|
|
83
165
|
padding: 5
|
|
84
166
|
}),
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
element:
|
|
167
|
+
ue({ padding: 5 }),
|
|
168
|
+
me({
|
|
169
|
+
element: i
|
|
88
170
|
})
|
|
89
171
|
]
|
|
90
|
-
}),
|
|
172
|
+
}), b = pe(u.context, {
|
|
91
173
|
move: !1,
|
|
92
|
-
enabled:
|
|
93
|
-
mouseOnly:
|
|
174
|
+
enabled: s == null,
|
|
175
|
+
mouseOnly: t,
|
|
94
176
|
delay: { open: 500, close: 0 }
|
|
95
|
-
}),
|
|
96
|
-
enabled:
|
|
97
|
-
}), T =
|
|
98
|
-
return
|
|
177
|
+
}), C = be(u.context, {
|
|
178
|
+
enabled: s == null
|
|
179
|
+
}), T = he(u.context), g = ge(u.context, { role: "tooltip" }), h = xe([b, C, T, g]);
|
|
180
|
+
return se(
|
|
99
181
|
() => ({
|
|
100
|
-
open:
|
|
101
|
-
setOpen:
|
|
102
|
-
arrowRef:
|
|
182
|
+
open: c,
|
|
183
|
+
setOpen: f,
|
|
184
|
+
arrowRef: i,
|
|
103
185
|
...h,
|
|
104
186
|
...u
|
|
105
187
|
}),
|
|
106
|
-
[
|
|
188
|
+
[c, f, h, u]
|
|
107
189
|
);
|
|
108
|
-
},
|
|
190
|
+
}, Pe = ({
|
|
109
191
|
children: e,
|
|
110
|
-
...
|
|
192
|
+
...r
|
|
111
193
|
}) => {
|
|
112
|
-
const
|
|
113
|
-
return /* @__PURE__ */
|
|
114
|
-
},
|
|
115
|
-
const
|
|
116
|
-
return
|
|
194
|
+
const t = Fe(r);
|
|
195
|
+
return /* @__PURE__ */ n(j.Provider, { value: t, children: e });
|
|
196
|
+
}, Se = L(function({ style: r, ...t }, s) {
|
|
197
|
+
const o = W(), a = z([o.refs.setFloating, s]);
|
|
198
|
+
return o.open ? /* @__PURE__ */ n(ye, { id: "tooltip-portal", children: /* @__PURE__ */ m(
|
|
117
199
|
"div",
|
|
118
200
|
{
|
|
119
|
-
ref:
|
|
201
|
+
ref: a,
|
|
120
202
|
style: {
|
|
121
|
-
...
|
|
122
|
-
...
|
|
203
|
+
...o.floatingStyles,
|
|
204
|
+
...r
|
|
123
205
|
},
|
|
124
|
-
...
|
|
206
|
+
...o.getFloatingProps(t),
|
|
125
207
|
className: d(
|
|
126
208
|
"z-[55] whitespace-pre-wrap rounded border border-primary bg-blackout px-2 py-1 dial-tiny shadow max-w-[300px]",
|
|
127
|
-
|
|
209
|
+
o.getFloatingProps(t).className
|
|
128
210
|
),
|
|
129
211
|
children: [
|
|
130
|
-
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
|
|
212
|
+
t.children,
|
|
213
|
+
/* @__PURE__ */ n(
|
|
214
|
+
Ne,
|
|
133
215
|
{
|
|
134
|
-
ref:
|
|
135
|
-
context:
|
|
216
|
+
ref: o.arrowRef,
|
|
217
|
+
context: o.context,
|
|
136
218
|
fill: "currentColor",
|
|
137
219
|
strokeWidth: 1,
|
|
138
220
|
className: "stroke-primary w-2 text-[var(--bg-layer-0,_#000000)]"
|
|
@@ -141,71 +223,194 @@ const y = ({ icon: e, className: t }) => e ? /* @__PURE__ */ l("span", { classNa
|
|
|
141
223
|
]
|
|
142
224
|
}
|
|
143
225
|
) }) : null;
|
|
144
|
-
}),
|
|
145
|
-
const
|
|
146
|
-
return
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
ref:
|
|
150
|
-
...
|
|
151
|
-
...
|
|
226
|
+
}), Ae = L(function({ children: r, asChild: t = !1, ...s }, o) {
|
|
227
|
+
const a = W(), i = r && typeof r == "object" && "ref" in r && r.ref !== void 0 ? r.ref : void 0, c = z([a.refs.setReference, o, i]);
|
|
228
|
+
return t && ae(r) ? le(
|
|
229
|
+
r,
|
|
230
|
+
a.getReferenceProps({
|
|
231
|
+
ref: c,
|
|
232
|
+
...s,
|
|
233
|
+
...r.props
|
|
152
234
|
})
|
|
153
|
-
) : /* @__PURE__ */
|
|
235
|
+
) : /* @__PURE__ */ n(
|
|
154
236
|
"span",
|
|
155
237
|
{
|
|
156
|
-
ref:
|
|
157
|
-
...
|
|
158
|
-
className:
|
|
159
|
-
children:
|
|
238
|
+
ref: c,
|
|
239
|
+
...a.getReferenceProps(s),
|
|
240
|
+
className: s.className ?? "dial-tooltip-trigger text-left",
|
|
241
|
+
children: r
|
|
160
242
|
}
|
|
161
243
|
);
|
|
162
|
-
}),
|
|
244
|
+
}), I = ({
|
|
163
245
|
hideTooltip: e,
|
|
164
|
-
tooltip:
|
|
165
|
-
children:
|
|
166
|
-
triggerClassName:
|
|
167
|
-
contentClassName:
|
|
168
|
-
...
|
|
169
|
-
}) => e || !
|
|
170
|
-
/* @__PURE__ */
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
-
|
|
246
|
+
tooltip: r,
|
|
247
|
+
children: t,
|
|
248
|
+
triggerClassName: s,
|
|
249
|
+
contentClassName: o,
|
|
250
|
+
...a
|
|
251
|
+
}) => e || !r ? /* @__PURE__ */ n("span", { className: s, children: t }) : /* @__PURE__ */ m(Pe, { ...a, children: [
|
|
252
|
+
/* @__PURE__ */ n(Ae, { className: d(s, "truncate"), children: t }),
|
|
253
|
+
/* @__PURE__ */ n(
|
|
254
|
+
Se,
|
|
173
255
|
{
|
|
174
256
|
className: d(
|
|
175
257
|
"text-primary",
|
|
176
|
-
|
|
258
|
+
o,
|
|
177
259
|
"max-w-[300px]",
|
|
178
|
-
(e || !
|
|
260
|
+
(e || !r) && "hidden"
|
|
179
261
|
),
|
|
180
|
-
children:
|
|
262
|
+
children: r
|
|
181
263
|
}
|
|
182
264
|
)
|
|
183
|
-
] }),
|
|
265
|
+
] }), Le = 18, S = {
|
|
266
|
+
size: Le,
|
|
267
|
+
stroke: 2
|
|
268
|
+
}, Ye = ({
|
|
269
|
+
label: e,
|
|
270
|
+
id: r,
|
|
271
|
+
checked: t,
|
|
272
|
+
indeterminate: s,
|
|
273
|
+
disabled: o,
|
|
274
|
+
ariaLabel: a,
|
|
275
|
+
onChange: l
|
|
276
|
+
}) => {
|
|
277
|
+
const i = O(
|
|
278
|
+
(u) => {
|
|
279
|
+
u.stopPropagation(), l?.(u.target.checked, r);
|
|
280
|
+
},
|
|
281
|
+
[l, r]
|
|
282
|
+
), c = d(
|
|
283
|
+
"flex flex-row items-center cursor-pointer text-accent-primary small-medium flex-1 min-w-0",
|
|
284
|
+
`${t ? "" : 'before:content-[""] before:inline-block before:w-[18px] before:h-[18px] before:border before:border-hover before:rounded before:mr-2'}`,
|
|
285
|
+
o ? "pointer-events-none text-secondary before:border-icon-secondary before:bg-layer-4" : ""
|
|
286
|
+
), f = d(
|
|
287
|
+
"mr-2 border rounded",
|
|
288
|
+
o ? "bg-layer-4 border-icon-secondary" : ""
|
|
289
|
+
);
|
|
290
|
+
return /* @__PURE__ */ m("label", { className: c, htmlFor: r, children: [
|
|
291
|
+
t && (s ? /* @__PURE__ */ n(Q, { className: f, ...S }) : /* @__PURE__ */ n(A, { className: f, ...S })),
|
|
292
|
+
e && /* @__PURE__ */ n(I, { tooltip: e, triggerClassName: "flex-1 min-w-0", children: /* @__PURE__ */ n("p", { className: "text-primary w-full truncate", children: e }) }),
|
|
293
|
+
/* @__PURE__ */ n(
|
|
294
|
+
"input",
|
|
295
|
+
{
|
|
296
|
+
type: "checkbox",
|
|
297
|
+
onChange: i,
|
|
298
|
+
id: r,
|
|
299
|
+
checked: t,
|
|
300
|
+
"aria-checked": s ? "mixed" : t,
|
|
301
|
+
"aria-disabled": o || void 0,
|
|
302
|
+
"aria-label": e ? void 0 : a,
|
|
303
|
+
className: "invisible w-0 h-0"
|
|
304
|
+
}
|
|
305
|
+
)
|
|
306
|
+
] });
|
|
307
|
+
};
|
|
308
|
+
var p = /* @__PURE__ */ ((e) => (e.VALID = "valid", e.ERROR = "error", e))(p || {});
|
|
309
|
+
const Oe = (e, r) => {
|
|
310
|
+
if (r === e.id)
|
|
311
|
+
switch (e.status) {
|
|
312
|
+
case p.VALID:
|
|
313
|
+
return "border-accent-secondary text-primary";
|
|
314
|
+
case p.ERROR:
|
|
315
|
+
return "border-red-900 text-primary";
|
|
316
|
+
default:
|
|
317
|
+
return "border-accent-primary text-primary";
|
|
318
|
+
}
|
|
319
|
+
switch (e.status) {
|
|
320
|
+
case p.VALID:
|
|
321
|
+
return "border-primary text-white";
|
|
322
|
+
case p.ERROR:
|
|
323
|
+
return "border-red-900 text-error";
|
|
324
|
+
default:
|
|
325
|
+
return "border-primary text-secondary";
|
|
326
|
+
}
|
|
327
|
+
}, ze = (e, r) => {
|
|
328
|
+
if (r === e.id)
|
|
329
|
+
switch (e.status) {
|
|
330
|
+
case p.VALID:
|
|
331
|
+
return "bg-accent-secondary";
|
|
332
|
+
case p.ERROR:
|
|
333
|
+
return "bg-red-400";
|
|
334
|
+
default:
|
|
335
|
+
return "bg-accent-primary";
|
|
336
|
+
}
|
|
337
|
+
switch (e.status) {
|
|
338
|
+
case p.VALID:
|
|
339
|
+
return "bg-accent-secondary";
|
|
340
|
+
case p.ERROR:
|
|
341
|
+
return "bg-red-400";
|
|
342
|
+
default:
|
|
343
|
+
return "bg-layer-4";
|
|
344
|
+
}
|
|
345
|
+
}, Ve = ({
|
|
346
|
+
step: e,
|
|
347
|
+
index: r,
|
|
348
|
+
currentStep: t,
|
|
349
|
+
handleStepChange: s
|
|
350
|
+
}) => {
|
|
351
|
+
const o = "h-[32px] flex flex-1 min-w-[180px] items-center dial-tiny border-t-2 cursor-pointer", a = "w-[22px] h-[22px] flex justify-center items-center mr-2 rounded-full text-white", l = () => t === e.id && e.status === p.ERROR ? /* @__PURE__ */ n(ee, { stroke: 2, size: 16 }) : t !== e.id && e.status === p.VALID ? /* @__PURE__ */ n(A, { stroke: 2, size: 16 }) : r + 1;
|
|
352
|
+
return /* @__PURE__ */ m(
|
|
353
|
+
"button",
|
|
354
|
+
{
|
|
355
|
+
className: d(o, Oe(e, t)),
|
|
356
|
+
onClick: () => s(e.id),
|
|
357
|
+
children: [
|
|
358
|
+
/* @__PURE__ */ n(
|
|
359
|
+
"span",
|
|
360
|
+
{
|
|
361
|
+
className: d(a, ze(e, t)),
|
|
362
|
+
children: l()
|
|
363
|
+
}
|
|
364
|
+
),
|
|
365
|
+
/* @__PURE__ */ n("span", { children: e.name })
|
|
366
|
+
]
|
|
367
|
+
}
|
|
368
|
+
);
|
|
369
|
+
}, qe = ({
|
|
370
|
+
steps: e,
|
|
371
|
+
currentStep: r,
|
|
372
|
+
setCurrentStep: t
|
|
373
|
+
}) => {
|
|
374
|
+
const s = (o) => {
|
|
375
|
+
const a = e.findIndex((i) => i.id === r), l = e.findIndex((i) => i.id === o);
|
|
376
|
+
(o !== r && e[a].status === p.VALID || l < a) && t(o);
|
|
377
|
+
};
|
|
378
|
+
return /* @__PURE__ */ n("div", { id: "steps", className: "flex gap-x-3", children: e.map((o, a) => /* @__PURE__ */ n(
|
|
379
|
+
Ve,
|
|
380
|
+
{
|
|
381
|
+
currentStep: r,
|
|
382
|
+
handleStepChange: s,
|
|
383
|
+
step: o,
|
|
384
|
+
index: a
|
|
385
|
+
},
|
|
386
|
+
o.id
|
|
387
|
+
)) });
|
|
388
|
+
}, _e = ({
|
|
184
389
|
value: e,
|
|
185
|
-
textareaId:
|
|
186
|
-
placeholder:
|
|
187
|
-
cssClass:
|
|
188
|
-
disabled:
|
|
189
|
-
invalid:
|
|
190
|
-
readonly:
|
|
191
|
-
onChange:
|
|
192
|
-
}) => /* @__PURE__ */
|
|
390
|
+
textareaId: r,
|
|
391
|
+
placeholder: t,
|
|
392
|
+
cssClass: s = "",
|
|
393
|
+
disabled: o,
|
|
394
|
+
invalid: a,
|
|
395
|
+
readonly: l,
|
|
396
|
+
onChange: i
|
|
397
|
+
}) => /* @__PURE__ */ n(I, { tooltip: e, triggerClassName: "flex", children: /* @__PURE__ */ n(
|
|
193
398
|
"textarea",
|
|
194
399
|
{
|
|
195
|
-
id:
|
|
196
|
-
placeholder:
|
|
400
|
+
id: r,
|
|
401
|
+
placeholder: t,
|
|
197
402
|
value: e || "",
|
|
198
|
-
disabled:
|
|
403
|
+
disabled: o,
|
|
199
404
|
className: d(
|
|
200
405
|
"dial-textarea dial-input",
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
406
|
+
a ? "dial-input-error" : "",
|
|
407
|
+
o && "dial-input-disable",
|
|
408
|
+
l && "dial-input-readonly",
|
|
409
|
+
s
|
|
205
410
|
),
|
|
206
|
-
onChange: (
|
|
411
|
+
onChange: (c) => !l && i?.(c.currentTarget.value)
|
|
207
412
|
}
|
|
208
|
-
) }),
|
|
413
|
+
) }), je = [
|
|
209
414
|
"ArrowLeft",
|
|
210
415
|
"ArrowRight",
|
|
211
416
|
"ArrowUp",
|
|
@@ -217,269 +422,276 @@ const y = ({ icon: e, className: t }) => e ? /* @__PURE__ */ l("span", { classNa
|
|
|
217
422
|
"Escape",
|
|
218
423
|
"Home",
|
|
219
424
|
"End"
|
|
220
|
-
],
|
|
221
|
-
if ((
|
|
425
|
+
], We = (e, r, t, s) => {
|
|
426
|
+
if ((r === "number" || t !== void 0 || s !== void 0) && !je.includes(e.key) && !(e.key === "-" && e.currentTarget.selectionStart === 0 && (t === void 0 || t < 0)) && !(e.key === "." && r === "number" && !e.currentTarget.value.includes("."))) {
|
|
222
427
|
if (!/^[0-9]$/.test(e.key)) {
|
|
223
428
|
e.preventDefault();
|
|
224
429
|
return;
|
|
225
430
|
}
|
|
226
|
-
if (
|
|
227
|
-
const
|
|
228
|
-
if (!isNaN(
|
|
229
|
-
if (
|
|
431
|
+
if (t !== void 0 || s !== void 0) {
|
|
432
|
+
const a = e.currentTarget.value, l = e.currentTarget.selectionStart || 0, i = a.slice(0, l) + e.key + a.slice(l), c = parseFloat(i);
|
|
433
|
+
if (!isNaN(c)) {
|
|
434
|
+
if (t !== void 0 && c < t) {
|
|
230
435
|
e.preventDefault();
|
|
231
436
|
return;
|
|
232
437
|
}
|
|
233
|
-
if (
|
|
438
|
+
if (s !== void 0 && c > s) {
|
|
234
439
|
e.preventDefault();
|
|
235
440
|
return;
|
|
236
441
|
}
|
|
237
442
|
}
|
|
238
443
|
}
|
|
239
444
|
}
|
|
240
|
-
},
|
|
445
|
+
}, E = ({
|
|
241
446
|
iconBeforeInput: e,
|
|
242
|
-
iconAfterInput:
|
|
243
|
-
hideBorder:
|
|
244
|
-
value:
|
|
245
|
-
elementId:
|
|
246
|
-
placeholder:
|
|
247
|
-
cssClass:
|
|
248
|
-
containerCssClass:
|
|
249
|
-
tooltipTriggerClassName:
|
|
250
|
-
type:
|
|
447
|
+
iconAfterInput: r,
|
|
448
|
+
hideBorder: t,
|
|
449
|
+
value: s,
|
|
450
|
+
elementId: o,
|
|
451
|
+
placeholder: a = "",
|
|
452
|
+
cssClass: l = "",
|
|
453
|
+
containerCssClass: i,
|
|
454
|
+
tooltipTriggerClassName: c,
|
|
455
|
+
type: f = "text",
|
|
251
456
|
disabled: u,
|
|
252
|
-
readonly:
|
|
253
|
-
invalid:
|
|
457
|
+
readonly: b,
|
|
458
|
+
invalid: C,
|
|
254
459
|
onChange: T,
|
|
255
460
|
min: g,
|
|
256
461
|
max: h,
|
|
257
|
-
prefix:
|
|
258
|
-
suffix:
|
|
259
|
-
textBeforeInput:
|
|
260
|
-
textAfterInput:
|
|
462
|
+
prefix: F,
|
|
463
|
+
suffix: P,
|
|
464
|
+
textBeforeInput: w,
|
|
465
|
+
textAfterInput: v
|
|
261
466
|
}) => {
|
|
262
|
-
const
|
|
263
|
-
|
|
264
|
-
},
|
|
265
|
-
const
|
|
266
|
-
if (H &&
|
|
267
|
-
const
|
|
268
|
-
if (isNaN(
|
|
467
|
+
const B = (x) => x.target.blur(), H = f === "number" || g !== void 0 || h !== void 0, U = (x) => {
|
|
468
|
+
We(x, f, g, h);
|
|
469
|
+
}, K = (x) => {
|
|
470
|
+
const D = x.currentTarget.value;
|
|
471
|
+
if (H && D !== "") {
|
|
472
|
+
const R = parseFloat(D);
|
|
473
|
+
if (isNaN(R) && D !== "-" && D !== "." || !isNaN(R) && (g !== void 0 && R < g || h !== void 0 && R > h))
|
|
269
474
|
return;
|
|
270
475
|
}
|
|
271
|
-
T?.(
|
|
476
|
+
T?.(D);
|
|
272
477
|
};
|
|
273
478
|
return /* @__PURE__ */ m(
|
|
274
479
|
"div",
|
|
275
480
|
{
|
|
276
481
|
className: d(
|
|
277
482
|
"dial-input-field flex flex-row items-center justify-between",
|
|
278
|
-
|
|
279
|
-
|
|
483
|
+
t ? "dial-input-no-border" : "dial-input",
|
|
484
|
+
C && "dial-input-error",
|
|
280
485
|
u && "dial-input-disable",
|
|
281
|
-
|
|
282
|
-
!
|
|
283
|
-
!
|
|
284
|
-
|
|
486
|
+
b && "dial-input-readonly",
|
|
487
|
+
!w && "pl-1",
|
|
488
|
+
!v && "pr-1",
|
|
489
|
+
i
|
|
285
490
|
),
|
|
286
491
|
children: [
|
|
287
|
-
|
|
288
|
-
|
|
492
|
+
w && /* @__PURE__ */ n(I, { tooltip: w, children: /* @__PURE__ */ n(
|
|
493
|
+
E,
|
|
289
494
|
{
|
|
290
495
|
hideBorder: !0,
|
|
291
496
|
containerCssClass: "rounded-r-none border-r-0",
|
|
292
497
|
cssClass: "px-2 overflow-hidden overflow-ellipsis dial-small",
|
|
293
|
-
value:
|
|
498
|
+
value: w,
|
|
294
499
|
disabled: !0,
|
|
295
|
-
elementId:
|
|
500
|
+
elementId: w + "textBefore"
|
|
296
501
|
}
|
|
297
502
|
) }),
|
|
298
|
-
|
|
503
|
+
F && /* @__PURE__ */ m("p", { className: "text-secondary dial-small pl-2", children: [
|
|
299
504
|
" ",
|
|
300
|
-
|
|
505
|
+
F
|
|
301
506
|
] }),
|
|
302
|
-
/* @__PURE__ */
|
|
303
|
-
/* @__PURE__ */
|
|
507
|
+
/* @__PURE__ */ n(N, { icon: e, className: "pl-2" }),
|
|
508
|
+
/* @__PURE__ */ n(I, { tooltip: s, triggerClassName: c, children: /* @__PURE__ */ n(
|
|
304
509
|
"input",
|
|
305
510
|
{
|
|
306
|
-
type:
|
|
511
|
+
type: f,
|
|
307
512
|
autoComplete: "off",
|
|
308
|
-
id:
|
|
309
|
-
placeholder:
|
|
310
|
-
value:
|
|
311
|
-
title:
|
|
513
|
+
id: o,
|
|
514
|
+
placeholder: a,
|
|
515
|
+
value: s ?? "",
|
|
516
|
+
title: s ? String(s) : "",
|
|
312
517
|
disabled: u,
|
|
313
|
-
className: d("border-0 bg-transparent px-2",
|
|
314
|
-
onChange: (
|
|
315
|
-
onKeyDown:
|
|
316
|
-
onWheel:
|
|
518
|
+
className: d("border-0 bg-transparent px-2", l),
|
|
519
|
+
onChange: (x) => !b && K?.(x),
|
|
520
|
+
onKeyDown: U,
|
|
521
|
+
onWheel: B,
|
|
317
522
|
min: g,
|
|
318
523
|
max: h
|
|
319
524
|
}
|
|
320
525
|
) }),
|
|
321
|
-
/* @__PURE__ */
|
|
322
|
-
|
|
526
|
+
/* @__PURE__ */ n(N, { icon: r, className: "pr-2" }),
|
|
527
|
+
P && /* @__PURE__ */ m("p", { className: "text-secondary dial-small pr-2", children: [
|
|
323
528
|
" ",
|
|
324
|
-
|
|
529
|
+
P
|
|
325
530
|
] }),
|
|
326
|
-
|
|
327
|
-
|
|
531
|
+
v && /* @__PURE__ */ n(I, { tooltip: v, children: /* @__PURE__ */ n(
|
|
532
|
+
E,
|
|
328
533
|
{
|
|
329
534
|
hideBorder: !0,
|
|
330
535
|
containerCssClass: "rounded-l-none border-l-0",
|
|
331
536
|
cssClass: "px-2",
|
|
332
|
-
value:
|
|
537
|
+
value: v,
|
|
333
538
|
disabled: !0,
|
|
334
|
-
elementId:
|
|
539
|
+
elementId: v + "textAfter"
|
|
335
540
|
}
|
|
336
541
|
) })
|
|
337
542
|
]
|
|
338
543
|
}
|
|
339
544
|
);
|
|
340
|
-
},
|
|
545
|
+
}, Me = /^0+\.(\d+)?$/, Be = /^0+/, M = ({
|
|
341
546
|
fieldTitle: e,
|
|
342
|
-
errorText:
|
|
343
|
-
optional:
|
|
344
|
-
elementCssClass:
|
|
345
|
-
elementContainerCssClass:
|
|
346
|
-
elementId:
|
|
347
|
-
containerCssClass:
|
|
348
|
-
readonly:
|
|
349
|
-
defaultEmptyText:
|
|
350
|
-
min:
|
|
547
|
+
errorText: r,
|
|
548
|
+
optional: t,
|
|
549
|
+
elementCssClass: s,
|
|
550
|
+
elementContainerCssClass: o,
|
|
551
|
+
elementId: a,
|
|
552
|
+
containerCssClass: l,
|
|
553
|
+
readonly: i,
|
|
554
|
+
defaultEmptyText: c,
|
|
555
|
+
min: f,
|
|
351
556
|
max: u,
|
|
352
|
-
...
|
|
353
|
-
}) => /* @__PURE__ */ m("div", { className: d("flex flex-col",
|
|
354
|
-
/* @__PURE__ */
|
|
355
|
-
|
|
557
|
+
...b
|
|
558
|
+
}) => /* @__PURE__ */ m("div", { className: d("flex flex-col", l), children: [
|
|
559
|
+
/* @__PURE__ */ n(
|
|
560
|
+
_,
|
|
356
561
|
{
|
|
357
562
|
fieldTitle: e,
|
|
358
|
-
optional:
|
|
359
|
-
htmlFor:
|
|
563
|
+
optional: t,
|
|
564
|
+
htmlFor: a
|
|
360
565
|
}
|
|
361
566
|
),
|
|
362
|
-
|
|
363
|
-
/* @__PURE__ */
|
|
364
|
-
|
|
567
|
+
i ? /* @__PURE__ */ n("span", { children: b.value || (c ?? "None") }) : /* @__PURE__ */ m($, { children: [
|
|
568
|
+
/* @__PURE__ */ n(
|
|
569
|
+
E,
|
|
365
570
|
{
|
|
366
|
-
elementId:
|
|
367
|
-
cssClass:
|
|
368
|
-
containerCssClass:
|
|
369
|
-
invalid:
|
|
370
|
-
min:
|
|
571
|
+
elementId: a,
|
|
572
|
+
cssClass: s,
|
|
573
|
+
containerCssClass: o,
|
|
574
|
+
invalid: r != null,
|
|
575
|
+
min: f,
|
|
371
576
|
max: u,
|
|
372
|
-
...
|
|
577
|
+
...b
|
|
373
578
|
}
|
|
374
579
|
),
|
|
375
|
-
/* @__PURE__ */
|
|
580
|
+
/* @__PURE__ */ n(V, { errorText: r })
|
|
376
581
|
] })
|
|
377
|
-
] }),
|
|
582
|
+
] }), Je = ({
|
|
378
583
|
onChange: e,
|
|
379
|
-
value:
|
|
380
|
-
min:
|
|
381
|
-
max:
|
|
382
|
-
...
|
|
584
|
+
value: r,
|
|
585
|
+
min: t,
|
|
586
|
+
max: s,
|
|
587
|
+
...o
|
|
383
588
|
}) => {
|
|
384
|
-
const
|
|
385
|
-
return /* @__PURE__ */
|
|
386
|
-
|
|
589
|
+
const a = (l) => String(l)?.match(Me) ? String(l)?.replace(Be, "0") : Number(l);
|
|
590
|
+
return /* @__PURE__ */ n(
|
|
591
|
+
M,
|
|
387
592
|
{
|
|
388
593
|
type: "number",
|
|
389
|
-
onChange: (
|
|
390
|
-
value:
|
|
391
|
-
min:
|
|
392
|
-
max:
|
|
393
|
-
...
|
|
594
|
+
onChange: (l) => e?.(a(l)),
|
|
595
|
+
value: r,
|
|
596
|
+
min: t,
|
|
597
|
+
max: s,
|
|
598
|
+
...o
|
|
394
599
|
}
|
|
395
600
|
);
|
|
396
|
-
},
|
|
601
|
+
}, Qe = ({
|
|
397
602
|
onChange: e,
|
|
398
|
-
...
|
|
399
|
-
}) => /* @__PURE__ */
|
|
400
|
-
|
|
603
|
+
...r
|
|
604
|
+
}) => /* @__PURE__ */ n(
|
|
605
|
+
M,
|
|
401
606
|
{
|
|
402
607
|
type: "text",
|
|
403
|
-
onChange: (
|
|
404
|
-
...
|
|
608
|
+
onChange: (t) => e?.(t),
|
|
609
|
+
...r
|
|
405
610
|
}
|
|
406
|
-
),
|
|
611
|
+
), er = ({
|
|
407
612
|
fieldTitle: e,
|
|
408
|
-
optional:
|
|
409
|
-
elementId:
|
|
410
|
-
elementCssClass:
|
|
411
|
-
errorText:
|
|
412
|
-
...
|
|
613
|
+
optional: r,
|
|
614
|
+
elementId: t,
|
|
615
|
+
elementCssClass: s,
|
|
616
|
+
errorText: o,
|
|
617
|
+
...a
|
|
413
618
|
}) => /* @__PURE__ */ m("div", { className: "flex flex-col", children: [
|
|
414
|
-
/* @__PURE__ */
|
|
415
|
-
|
|
619
|
+
/* @__PURE__ */ n(
|
|
620
|
+
_,
|
|
416
621
|
{
|
|
417
622
|
fieldTitle: e,
|
|
418
|
-
optional:
|
|
419
|
-
htmlFor:
|
|
623
|
+
optional: r,
|
|
624
|
+
htmlFor: t
|
|
420
625
|
}
|
|
421
626
|
),
|
|
422
|
-
/* @__PURE__ */
|
|
423
|
-
|
|
627
|
+
/* @__PURE__ */ n(
|
|
628
|
+
_e,
|
|
424
629
|
{
|
|
425
|
-
textareaId:
|
|
426
|
-
cssClass:
|
|
427
|
-
...
|
|
630
|
+
textareaId: t,
|
|
631
|
+
cssClass: s,
|
|
632
|
+
...a
|
|
428
633
|
}
|
|
429
634
|
),
|
|
430
|
-
/* @__PURE__ */
|
|
431
|
-
] }),
|
|
635
|
+
/* @__PURE__ */ n(V, { errorText: o })
|
|
636
|
+
] }), rr = ({
|
|
432
637
|
title: e,
|
|
433
|
-
switchId:
|
|
434
|
-
isOn:
|
|
435
|
-
disabled:
|
|
436
|
-
onChange:
|
|
638
|
+
switchId: r,
|
|
639
|
+
isOn: t = !1,
|
|
640
|
+
disabled: s,
|
|
641
|
+
onChange: o
|
|
437
642
|
}) => {
|
|
438
|
-
const
|
|
439
|
-
"flex w-[36px] h-[18px]
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
),
|
|
444
|
-
(
|
|
445
|
-
|
|
643
|
+
const a = d(
|
|
644
|
+
"flex w-[36px] h-[18px] cursor-pointer items-center gap-1 rounded-full p-0.5 transition-all duration-200",
|
|
645
|
+
t ? "flex-row-reverse" : "flex-row",
|
|
646
|
+
s ? "pointer-events-none" : "",
|
|
647
|
+
s ? t ? "bg-controls-disable" : "bg-layer-4" : t ? "bg-accent-primary" : "bg-layer-4"
|
|
648
|
+
), l = O(
|
|
649
|
+
(i) => {
|
|
650
|
+
i.stopPropagation(), o?.(!t);
|
|
446
651
|
},
|
|
447
|
-
[
|
|
652
|
+
[o, t]
|
|
448
653
|
);
|
|
449
654
|
return /* @__PURE__ */ m("div", { className: "flex flex-row items-center", children: [
|
|
450
|
-
/* @__PURE__ */
|
|
655
|
+
/* @__PURE__ */ n(
|
|
451
656
|
"input",
|
|
452
657
|
{
|
|
453
658
|
type: "checkbox",
|
|
454
|
-
onChange:
|
|
455
|
-
id:
|
|
456
|
-
disabled:
|
|
659
|
+
onChange: l,
|
|
660
|
+
id: r,
|
|
661
|
+
disabled: s,
|
|
457
662
|
className: "invisible w-0 h-0",
|
|
458
|
-
checked:
|
|
663
|
+
checked: t
|
|
459
664
|
}
|
|
460
665
|
),
|
|
461
|
-
/* @__PURE__ */
|
|
666
|
+
/* @__PURE__ */ n("label", { htmlFor: r, className: a, children: /* @__PURE__ */ n(
|
|
462
667
|
"span",
|
|
463
668
|
{
|
|
464
669
|
className: d(
|
|
465
670
|
"size-3 rounded-full",
|
|
466
|
-
|
|
671
|
+
s ? t ? "bg-layer-4" : "bg-controls-disable" : "bg-controls-enable-primary"
|
|
467
672
|
)
|
|
468
673
|
}
|
|
469
674
|
) }),
|
|
470
|
-
e && /* @__PURE__ */
|
|
675
|
+
e && /* @__PURE__ */ n("span", { className: "pl-2 dial-small text-primary", children: e })
|
|
471
676
|
] });
|
|
472
677
|
};
|
|
473
678
|
export {
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
679
|
+
y as AlertVariant,
|
|
680
|
+
k as ButtonVariant,
|
|
681
|
+
Ze as DialAlert,
|
|
682
|
+
we as DialButton,
|
|
683
|
+
Ye as DialCheckbox,
|
|
684
|
+
V as DialErrorText,
|
|
685
|
+
_ as DialFieldLabel,
|
|
686
|
+
N as DialIcon,
|
|
687
|
+
E as DialInput,
|
|
688
|
+
Xe as DialLoader,
|
|
689
|
+
Je as DialNumberInputField,
|
|
690
|
+
qe as DialSteps,
|
|
691
|
+
rr as DialSwitch,
|
|
692
|
+
er as DialTextAreaField,
|
|
693
|
+
Qe as DialTextInputField,
|
|
694
|
+
_e as DialTextarea,
|
|
695
|
+
I as DialTooltip,
|
|
696
|
+
p as StepStatus
|
|
485
697
|
};
|