@epam/ai-dial-ui-kit 0.2.0-rc.16 → 0.2.0-rc.18
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/dist/dial-ui-kit.cjs.js +1 -1
- package/dist/dial-ui-kit.es.js +438 -352
- package/dist/index.css +1 -1
- package/dist/src/components/Button/Button.d.ts +2 -2
- package/dist/src/components/CloseButton/CloseButton.d.ts +26 -0
- package/dist/src/components/Popup/Popup.d.ts +52 -0
- package/dist/src/components/Popup/constants.d.ts +6 -0
- package/dist/src/index.d.ts +5 -1
- package/dist/src/types/popup.d.ts +5 -0
- package/package.json +1 -1
package/dist/dial-ui-kit.es.js
CHANGED
|
@@ -1,33 +1,53 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { IconCircleCheck as
|
|
4
|
-
import { createContext as
|
|
5
|
-
import { useFloating as
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
1
|
+
import { jsx as r, jsxs as m, Fragment as ne } from "react/jsx-runtime";
|
|
2
|
+
import d from "classnames";
|
|
3
|
+
import { IconCircleCheck as te, IconAlertTriangle as se, IconAlertCircle as ae, IconInfoCircle as oe, IconX as M, IconLoader as le, IconMinus as ie, IconCheck as j, IconExclamationCircle as ce, IconEyeOff as de, IconEye as ue } from "@tabler/icons-react";
|
|
4
|
+
import { createContext as me, useState as W, useRef as pe, useMemo as fe, useContext as he, forwardRef as _, isValidElement as xe, cloneElement as ge, useCallback as B } from "react";
|
|
5
|
+
import { useFloating as H, offset as be, flip as ye, shift as Ce, arrow as we, autoUpdate as ve, useHover as Ne, useFocus as De, useDismiss as U, useRole as $, useInteractions as K, useMergeRefs as G, FloatingPortal as Z, FloatingArrow as Ie, FloatingOverlay as Re, FloatingFocusManager as ke } from "@floating-ui/react";
|
|
6
|
+
const V = ({ errorText: e }) => e && /* @__PURE__ */ r("span", { className: "text-error dial-tiny mt-1", children: e }), A = ({
|
|
7
|
+
fieldTitle: e,
|
|
8
|
+
htmlFor: n,
|
|
9
|
+
optional: t,
|
|
10
|
+
optionalText: s,
|
|
11
|
+
cssClass: a
|
|
12
|
+
}) => e ? /* @__PURE__ */ m(
|
|
13
|
+
"label",
|
|
14
|
+
{
|
|
15
|
+
className: d(
|
|
16
|
+
"dial-tiny text-secondary",
|
|
17
|
+
a,
|
|
18
|
+
!a?.includes("mb") && "mb-2"
|
|
19
|
+
),
|
|
20
|
+
htmlFor: n,
|
|
21
|
+
children: [
|
|
22
|
+
/* @__PURE__ */ r("span", { className: "min-h-4", children: e }),
|
|
23
|
+
t && /* @__PURE__ */ r("span", { className: "ml-1", children: s ?? "(Optional)" })
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
) : null, R = ({ icon: e, className: n }) => e ? /* @__PURE__ */ r("span", { className: d("flex-shrink-0", n), children: e }) : null;
|
|
27
|
+
var S = /* @__PURE__ */ ((e) => (e.Primary = "primary", e.Secondary = "secondary", e.Tertiary = "tertiary", e))(S || {});
|
|
28
|
+
const Fe = {
|
|
29
|
+
[S.Primary]: "dial-primary-button",
|
|
30
|
+
[S.Secondary]: "dial-secondary-button",
|
|
31
|
+
[S.Tertiary]: "dial-tertiary-button"
|
|
32
|
+
}, z = ({
|
|
13
33
|
title: e,
|
|
14
|
-
variant:
|
|
34
|
+
variant: n,
|
|
15
35
|
cssClass: t,
|
|
16
36
|
ref: s,
|
|
17
37
|
onClick: a,
|
|
18
38
|
disable: o,
|
|
19
39
|
iconAfter: l,
|
|
20
40
|
iconBefore: i,
|
|
21
|
-
hideTitleOnMobile:
|
|
22
|
-
ariaLabel:
|
|
41
|
+
hideTitleOnMobile: u,
|
|
42
|
+
ariaLabel: c
|
|
23
43
|
}) => {
|
|
24
|
-
const p =
|
|
44
|
+
const p = d(
|
|
25
45
|
"dial-small-semi",
|
|
26
46
|
l ? "mr-2" : "",
|
|
27
47
|
i ? "ml-2" : "",
|
|
28
|
-
|
|
29
|
-
),
|
|
30
|
-
|
|
48
|
+
u ? "hidden sm:inline" : "inline"
|
|
49
|
+
), h = d(
|
|
50
|
+
n && Fe[n],
|
|
31
51
|
t,
|
|
32
52
|
"focus-visible:outline outline-offset-0"
|
|
33
53
|
);
|
|
@@ -36,52 +56,32 @@ const De = {
|
|
|
36
56
|
{
|
|
37
57
|
ref: s,
|
|
38
58
|
type: "button",
|
|
39
|
-
className:
|
|
40
|
-
onClick: (
|
|
59
|
+
className: h,
|
|
60
|
+
onClick: (b) => a?.(b),
|
|
41
61
|
disabled: o,
|
|
42
|
-
"aria-label": e ||
|
|
62
|
+
"aria-label": e || c,
|
|
43
63
|
children: [
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
e && /* @__PURE__ */
|
|
46
|
-
/* @__PURE__ */
|
|
64
|
+
/* @__PURE__ */ r(R, { icon: i }),
|
|
65
|
+
e && /* @__PURE__ */ r("span", { className: p, children: e }),
|
|
66
|
+
/* @__PURE__ */ r(R, { icon: l })
|
|
47
67
|
]
|
|
48
68
|
}
|
|
49
69
|
);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
children: [
|
|
66
|
-
/* @__PURE__ */ n("span", { className: "min-h-4", children: e }),
|
|
67
|
-
t && /* @__PURE__ */ n("span", { className: "ml-1", children: s ?? "(Optional)" })
|
|
68
|
-
]
|
|
69
|
-
}
|
|
70
|
-
) : null;
|
|
71
|
-
var y = /* @__PURE__ */ ((e) => (e.Info = "info", e.Success = "success", e.Warning = "warning", e.Error = "error", e))(y || {});
|
|
72
|
-
const Re = {
|
|
73
|
-
info: /* @__PURE__ */ n(J, { size: 24, stroke: 2 }),
|
|
74
|
-
error: /* @__PURE__ */ n(q, { size: 24, stroke: 2 }),
|
|
75
|
-
warning: /* @__PURE__ */ n(Y, { size: 24, stroke: 2 }),
|
|
76
|
-
success: /* @__PURE__ */ n(X, { size: 24, stroke: 2 })
|
|
77
|
-
}, ke = {
|
|
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
|
-
}, Ee = "items-center justify-between gap-2 p-3 border border-solid dial-small-150 rounded flex", ar = ({
|
|
83
|
-
variant: e = y.Info,
|
|
84
|
-
message: r,
|
|
70
|
+
};
|
|
71
|
+
var D = /* @__PURE__ */ ((e) => (e.Info = "info", e.Success = "success", e.Warning = "warning", e.Error = "error", e))(D || {});
|
|
72
|
+
const Te = {
|
|
73
|
+
info: /* @__PURE__ */ r(oe, { size: 24, stroke: 2 }),
|
|
74
|
+
error: /* @__PURE__ */ r(ae, { size: 24, stroke: 2 }),
|
|
75
|
+
warning: /* @__PURE__ */ r(se, { size: 24, stroke: 2 }),
|
|
76
|
+
success: /* @__PURE__ */ r(te, { size: 24, stroke: 2 })
|
|
77
|
+
}, Ee = {
|
|
78
|
+
[D.Info]: "bg-info border-info text-info",
|
|
79
|
+
[D.Success]: "bg-success border-success text-success",
|
|
80
|
+
[D.Warning]: "bg-warning border-warning text-warning",
|
|
81
|
+
[D.Error]: "bg-error border-error text-error"
|
|
82
|
+
}, Se = "items-center justify-between gap-2 p-3 border border-solid dial-small-150 rounded flex", pr = ({
|
|
83
|
+
variant: e = D.Info,
|
|
84
|
+
message: n,
|
|
85
85
|
cssClass: t,
|
|
86
86
|
closable: s = !1,
|
|
87
87
|
onClose: a
|
|
@@ -89,129 +89,129 @@ const Re = {
|
|
|
89
89
|
"div",
|
|
90
90
|
{
|
|
91
91
|
role: "alert",
|
|
92
|
-
className:
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
className: d(
|
|
93
|
+
Se,
|
|
94
|
+
Ee[e],
|
|
95
95
|
t
|
|
96
96
|
),
|
|
97
97
|
children: [
|
|
98
98
|
/* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
-
/* @__PURE__ */
|
|
99
|
+
/* @__PURE__ */ r(R, { icon: Te[e] }),
|
|
100
|
+
/* @__PURE__ */ r("div", { className: "text-primary", children: n })
|
|
101
101
|
] }),
|
|
102
|
-
s && /* @__PURE__ */
|
|
103
|
-
|
|
102
|
+
s && /* @__PURE__ */ r(
|
|
103
|
+
z,
|
|
104
104
|
{
|
|
105
105
|
cssClass: "ml-2 text-secondary hover:text-primary",
|
|
106
106
|
ariaLabel: "Close alert",
|
|
107
|
-
iconBefore: /* @__PURE__ */
|
|
107
|
+
iconBefore: /* @__PURE__ */ r(M, { size: 16 }),
|
|
108
108
|
onClick: (o) => a?.(o)
|
|
109
109
|
}
|
|
110
110
|
)
|
|
111
111
|
]
|
|
112
112
|
}
|
|
113
|
-
),
|
|
113
|
+
), Pe = "flex items-center justify-center text-secondary", Le = "shrink-0 grow-0 basis-auto animate-spin-steps", fr = ({
|
|
114
114
|
size: e = 18,
|
|
115
|
-
cssClass:
|
|
115
|
+
cssClass: n,
|
|
116
116
|
iconClass: t,
|
|
117
117
|
fullWidth: s = !0,
|
|
118
118
|
ariaLabel: a = "Loading"
|
|
119
|
-
}) => /* @__PURE__ */
|
|
119
|
+
}) => /* @__PURE__ */ r(
|
|
120
120
|
"div",
|
|
121
121
|
{
|
|
122
122
|
role: "status",
|
|
123
123
|
"aria-label": a,
|
|
124
|
-
className:
|
|
125
|
-
[
|
|
124
|
+
className: d({
|
|
125
|
+
[Pe]: !0,
|
|
126
126
|
"w-full h-full": s,
|
|
127
|
-
[
|
|
127
|
+
[n || ""]: !!n
|
|
128
128
|
}),
|
|
129
|
-
children: /* @__PURE__ */
|
|
130
|
-
|
|
129
|
+
children: /* @__PURE__ */ r(
|
|
130
|
+
R,
|
|
131
131
|
{
|
|
132
|
-
icon: /* @__PURE__ */
|
|
133
|
-
|
|
132
|
+
icon: /* @__PURE__ */ r(
|
|
133
|
+
le,
|
|
134
134
|
{
|
|
135
135
|
width: e,
|
|
136
136
|
height: e,
|
|
137
|
-
className:
|
|
137
|
+
className: d(Le, t)
|
|
138
138
|
}
|
|
139
139
|
)
|
|
140
140
|
}
|
|
141
141
|
)
|
|
142
142
|
}
|
|
143
|
-
),
|
|
144
|
-
const e =
|
|
143
|
+
), Ae = 7, Oe = 2, X = me(null), Y = () => {
|
|
144
|
+
const e = he(X);
|
|
145
145
|
if (e == null)
|
|
146
146
|
throw new Error("Tooltip components must be wrapped in <Tooltip />");
|
|
147
147
|
return e;
|
|
148
|
-
},
|
|
148
|
+
}, Me = ({
|
|
149
149
|
initialOpen: e = !1,
|
|
150
|
-
placement:
|
|
150
|
+
placement: n = "bottom",
|
|
151
151
|
isTriggerClickable: t = !1,
|
|
152
152
|
open: s,
|
|
153
153
|
onOpenChange: a
|
|
154
154
|
} = {}) => {
|
|
155
|
-
const [o, l] = W(e), i =
|
|
156
|
-
placement:
|
|
157
|
-
open:
|
|
158
|
-
onOpenChange:
|
|
159
|
-
whileElementsMounted:
|
|
155
|
+
const [o, l] = W(e), i = pe(null), u = s ?? o, c = a ?? l, p = H({
|
|
156
|
+
placement: n,
|
|
157
|
+
open: u,
|
|
158
|
+
onOpenChange: c,
|
|
159
|
+
whileElementsMounted: ve,
|
|
160
160
|
middleware: [
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
crossAxis:
|
|
161
|
+
be(Ae + Oe),
|
|
162
|
+
ye({
|
|
163
|
+
crossAxis: n.includes("-"),
|
|
164
164
|
fallbackAxisSideDirection: "start",
|
|
165
165
|
padding: 5
|
|
166
166
|
}),
|
|
167
|
-
|
|
168
|
-
|
|
167
|
+
Ce({ padding: 5 }),
|
|
168
|
+
we({
|
|
169
169
|
element: i
|
|
170
170
|
})
|
|
171
171
|
]
|
|
172
|
-
}),
|
|
172
|
+
}), h = Ne(p.context, {
|
|
173
173
|
move: !1,
|
|
174
174
|
enabled: s == null,
|
|
175
175
|
mouseOnly: t,
|
|
176
176
|
delay: { open: 500, close: 0 }
|
|
177
|
-
}),
|
|
177
|
+
}), b = De(p.context, {
|
|
178
178
|
enabled: s == null
|
|
179
|
-
}),
|
|
180
|
-
return
|
|
179
|
+
}), C = U(p.context), y = $(p.context, { role: "tooltip" }), x = K([h, b, C, y]);
|
|
180
|
+
return fe(
|
|
181
181
|
() => ({
|
|
182
|
-
open:
|
|
183
|
-
setOpen:
|
|
182
|
+
open: u,
|
|
183
|
+
setOpen: c,
|
|
184
184
|
arrowRef: i,
|
|
185
185
|
...x,
|
|
186
186
|
...p
|
|
187
187
|
}),
|
|
188
|
-
[
|
|
188
|
+
[u, c, x, p]
|
|
189
189
|
);
|
|
190
|
-
},
|
|
190
|
+
}, Be = ({
|
|
191
191
|
children: e,
|
|
192
|
-
...
|
|
192
|
+
...n
|
|
193
193
|
}) => {
|
|
194
|
-
const t =
|
|
195
|
-
return /* @__PURE__ */
|
|
196
|
-
},
|
|
197
|
-
const a =
|
|
198
|
-
return a.open ? /* @__PURE__ */
|
|
194
|
+
const t = Me(n);
|
|
195
|
+
return /* @__PURE__ */ r(X.Provider, { value: t, children: e });
|
|
196
|
+
}, Ve = _(function({ style: n, ...t }, s) {
|
|
197
|
+
const a = Y(), o = G([a.refs.setFloating, s]);
|
|
198
|
+
return a.open ? /* @__PURE__ */ r(Z, { id: "tooltip-portal", children: /* @__PURE__ */ m(
|
|
199
199
|
"div",
|
|
200
200
|
{
|
|
201
201
|
ref: o,
|
|
202
202
|
style: {
|
|
203
203
|
...a.floatingStyles,
|
|
204
|
-
...
|
|
204
|
+
...n
|
|
205
205
|
},
|
|
206
206
|
...a.getFloatingProps(t),
|
|
207
|
-
className:
|
|
207
|
+
className: d(
|
|
208
208
|
"z-[55] whitespace-pre-wrap rounded border border-primary bg-blackout px-2 py-1 dial-tiny shadow max-w-[300px]",
|
|
209
209
|
a.getFloatingProps(t).className
|
|
210
210
|
),
|
|
211
211
|
children: [
|
|
212
212
|
t.children,
|
|
213
|
-
/* @__PURE__ */
|
|
214
|
-
|
|
213
|
+
/* @__PURE__ */ r(
|
|
214
|
+
Ie,
|
|
215
215
|
{
|
|
216
216
|
ref: a.arrowRef,
|
|
217
217
|
context: a.context,
|
|
@@ -223,79 +223,79 @@ const Re = {
|
|
|
223
223
|
]
|
|
224
224
|
}
|
|
225
225
|
) }) : null;
|
|
226
|
-
}),
|
|
227
|
-
const o =
|
|
228
|
-
return t &&
|
|
229
|
-
|
|
226
|
+
}), ze = _(function({ children: n, asChild: t = !1, ...s }, a) {
|
|
227
|
+
const o = Y(), i = n && typeof n == "object" && "ref" in n && n.ref !== void 0 ? n.ref : void 0, u = G([o.refs.setReference, a, i]);
|
|
228
|
+
return t && xe(n) ? ge(
|
|
229
|
+
n,
|
|
230
230
|
o.getReferenceProps({
|
|
231
|
-
ref:
|
|
231
|
+
ref: u,
|
|
232
232
|
...s,
|
|
233
|
-
...
|
|
233
|
+
...n.props
|
|
234
234
|
})
|
|
235
|
-
) : /* @__PURE__ */
|
|
235
|
+
) : /* @__PURE__ */ r(
|
|
236
236
|
"span",
|
|
237
237
|
{
|
|
238
|
-
ref:
|
|
238
|
+
ref: u,
|
|
239
239
|
...o.getReferenceProps(s),
|
|
240
240
|
className: s.className ?? "dial-tooltip-trigger text-left",
|
|
241
|
-
children:
|
|
241
|
+
children: n
|
|
242
242
|
}
|
|
243
243
|
);
|
|
244
|
-
}),
|
|
244
|
+
}), I = ({
|
|
245
245
|
hideTooltip: e,
|
|
246
|
-
tooltip:
|
|
246
|
+
tooltip: n,
|
|
247
247
|
children: t,
|
|
248
248
|
triggerClassName: s,
|
|
249
249
|
contentClassName: a,
|
|
250
250
|
...o
|
|
251
|
-
}) => /* @__PURE__ */ m(
|
|
252
|
-
/* @__PURE__ */
|
|
253
|
-
/* @__PURE__ */
|
|
254
|
-
|
|
251
|
+
}) => /* @__PURE__ */ m(Be, { ...o, children: [
|
|
252
|
+
/* @__PURE__ */ r(ze, { className: d(s, "truncate"), children: t }),
|
|
253
|
+
/* @__PURE__ */ r(
|
|
254
|
+
Ve,
|
|
255
255
|
{
|
|
256
|
-
className:
|
|
256
|
+
className: d(
|
|
257
257
|
"text-primary",
|
|
258
258
|
a,
|
|
259
259
|
"max-w-[300px]",
|
|
260
|
-
(e || !
|
|
260
|
+
(e || !n) && "hidden"
|
|
261
261
|
),
|
|
262
|
-
children:
|
|
262
|
+
children: n
|
|
263
263
|
}
|
|
264
264
|
)
|
|
265
|
-
] }),
|
|
266
|
-
size:
|
|
265
|
+
] }), je = 18, P = {
|
|
266
|
+
size: je,
|
|
267
267
|
stroke: 2
|
|
268
|
-
},
|
|
268
|
+
}, hr = ({
|
|
269
269
|
label: e,
|
|
270
|
-
id:
|
|
270
|
+
id: n,
|
|
271
271
|
checked: t,
|
|
272
272
|
indeterminate: s,
|
|
273
273
|
disabled: a,
|
|
274
274
|
ariaLabel: o,
|
|
275
275
|
onChange: l
|
|
276
276
|
}) => {
|
|
277
|
-
const i =
|
|
277
|
+
const i = B(
|
|
278
278
|
(p) => {
|
|
279
|
-
p.stopPropagation(), l?.(p.target.checked,
|
|
279
|
+
p.stopPropagation(), l?.(p.target.checked, n);
|
|
280
280
|
},
|
|
281
|
-
[l,
|
|
282
|
-
),
|
|
281
|
+
[l, n]
|
|
282
|
+
), u = d(
|
|
283
283
|
"flex flex-row items-center cursor-pointer text-accent-primary small-medium flex-1 min-w-0",
|
|
284
284
|
`${t ? "" : 'before:content-[""] before:inline-block before:w-[18px] before:h-[18px] before:border before:border-hover before:rounded before:mr-2'}`,
|
|
285
285
|
a ? "pointer-events-none text-secondary before:border-icon-secondary before:bg-layer-4" : ""
|
|
286
|
-
),
|
|
286
|
+
), c = d(
|
|
287
287
|
"mr-2 border rounded",
|
|
288
288
|
a ? "bg-layer-4 border-icon-secondary" : ""
|
|
289
289
|
);
|
|
290
|
-
return /* @__PURE__ */ m("label", { className:
|
|
291
|
-
t && (s ? /* @__PURE__ */
|
|
292
|
-
e && /* @__PURE__ */
|
|
293
|
-
/* @__PURE__ */
|
|
290
|
+
return /* @__PURE__ */ m("label", { className: u, htmlFor: n, children: [
|
|
291
|
+
t && (s ? /* @__PURE__ */ r(ie, { className: c, ...P }) : /* @__PURE__ */ r(j, { className: c, ...P })),
|
|
292
|
+
e && /* @__PURE__ */ r(I, { tooltip: e, triggerClassName: "flex-1 min-w-0", children: /* @__PURE__ */ r("p", { className: "text-primary w-full truncate", children: e }) }),
|
|
293
|
+
/* @__PURE__ */ r(
|
|
294
294
|
"input",
|
|
295
295
|
{
|
|
296
296
|
type: "checkbox",
|
|
297
297
|
onChange: i,
|
|
298
|
-
id:
|
|
298
|
+
id: n,
|
|
299
299
|
checked: t,
|
|
300
300
|
"aria-checked": s ? "mixed" : t,
|
|
301
301
|
"aria-disabled": a || void 0,
|
|
@@ -305,205 +305,218 @@ const Re = {
|
|
|
305
305
|
)
|
|
306
306
|
] });
|
|
307
307
|
};
|
|
308
|
-
var
|
|
309
|
-
const We = (e,
|
|
310
|
-
if (
|
|
308
|
+
var g = /* @__PURE__ */ ((e) => (e.VALID = "valid", e.ERROR = "error", e))(g || {});
|
|
309
|
+
const We = (e, n) => {
|
|
310
|
+
if (n === e.id)
|
|
311
311
|
switch (e.status) {
|
|
312
|
-
case
|
|
312
|
+
case g.VALID:
|
|
313
313
|
return "border-accent-secondary text-primary";
|
|
314
|
-
case
|
|
314
|
+
case g.ERROR:
|
|
315
315
|
return "border-red-900 text-primary";
|
|
316
316
|
default:
|
|
317
317
|
return "border-accent-primary text-primary";
|
|
318
318
|
}
|
|
319
319
|
switch (e.status) {
|
|
320
|
-
case
|
|
320
|
+
case g.VALID:
|
|
321
321
|
return "border-primary text-white";
|
|
322
|
-
case
|
|
322
|
+
case g.ERROR:
|
|
323
323
|
return "border-red-900 text-error";
|
|
324
324
|
default:
|
|
325
325
|
return "border-primary text-secondary";
|
|
326
326
|
}
|
|
327
|
-
}, _e = (e,
|
|
328
|
-
if (
|
|
327
|
+
}, _e = (e, n) => {
|
|
328
|
+
if (n === e.id)
|
|
329
329
|
switch (e.status) {
|
|
330
|
-
case
|
|
330
|
+
case g.VALID:
|
|
331
331
|
return "bg-accent-secondary";
|
|
332
|
-
case
|
|
332
|
+
case g.ERROR:
|
|
333
333
|
return "bg-red-400";
|
|
334
334
|
default:
|
|
335
335
|
return "bg-accent-primary";
|
|
336
336
|
}
|
|
337
337
|
switch (e.status) {
|
|
338
|
-
case
|
|
338
|
+
case g.VALID:
|
|
339
339
|
return "bg-accent-secondary";
|
|
340
|
-
case
|
|
340
|
+
case g.ERROR:
|
|
341
341
|
return "bg-red-400";
|
|
342
342
|
default:
|
|
343
343
|
return "bg-layer-4";
|
|
344
344
|
}
|
|
345
|
-
},
|
|
345
|
+
}, He = ({
|
|
346
346
|
step: e,
|
|
347
|
-
index:
|
|
347
|
+
index: n,
|
|
348
348
|
currentStep: t,
|
|
349
349
|
onChangeStep: s
|
|
350
350
|
}) => {
|
|
351
|
-
const a = "h-[32px] flex flex-1 min-w-[180px] items-center dial-tiny border-t-2 cursor-pointer", o = "w-[22px] h-[22px] flex justify-center items-center mr-2 rounded-full text-white", l = () => t === e.id && e.status ===
|
|
351
|
+
const a = "h-[32px] flex flex-1 min-w-[180px] items-center dial-tiny border-t-2 cursor-pointer", o = "w-[22px] h-[22px] flex justify-center items-center mr-2 rounded-full text-white", l = () => t === e.id && e.status === g.ERROR ? /* @__PURE__ */ r(ce, { stroke: 2, size: 16 }) : t !== e.id && e.status === g.VALID ? /* @__PURE__ */ r(j, { stroke: 2, size: 16 }) : n + 1;
|
|
352
352
|
return /* @__PURE__ */ m(
|
|
353
353
|
"button",
|
|
354
354
|
{
|
|
355
|
-
className:
|
|
355
|
+
className: d(a, We(e, t)),
|
|
356
356
|
onClick: () => s(e.id),
|
|
357
357
|
children: [
|
|
358
|
-
/* @__PURE__ */
|
|
358
|
+
/* @__PURE__ */ r(
|
|
359
359
|
"span",
|
|
360
360
|
{
|
|
361
|
-
className:
|
|
361
|
+
className: d(o, _e(e, t)),
|
|
362
362
|
children: l()
|
|
363
363
|
}
|
|
364
364
|
),
|
|
365
|
-
/* @__PURE__ */
|
|
365
|
+
/* @__PURE__ */ r("span", { children: e.name })
|
|
366
366
|
]
|
|
367
367
|
}
|
|
368
368
|
);
|
|
369
|
-
},
|
|
369
|
+
}, xr = ({
|
|
370
370
|
steps: e,
|
|
371
|
-
currentStep:
|
|
371
|
+
currentStep: n,
|
|
372
372
|
onChangeStep: t
|
|
373
373
|
}) => {
|
|
374
374
|
const s = (a) => {
|
|
375
|
-
const o = e.findIndex((i) => i.id ===
|
|
376
|
-
(a !==
|
|
375
|
+
const o = e.findIndex((i) => i.id === n), l = e.findIndex((i) => i.id === a);
|
|
376
|
+
(a !== n && e[o].status === g.VALID || l < o) && t(a);
|
|
377
377
|
};
|
|
378
|
-
return /* @__PURE__ */
|
|
379
|
-
|
|
378
|
+
return /* @__PURE__ */ r("div", { id: "steps", className: "flex gap-x-3", children: e.map((a, o) => /* @__PURE__ */ r(
|
|
379
|
+
He,
|
|
380
380
|
{
|
|
381
|
-
currentStep:
|
|
381
|
+
currentStep: n,
|
|
382
382
|
onChangeStep: s,
|
|
383
383
|
step: a,
|
|
384
384
|
index: o
|
|
385
385
|
},
|
|
386
386
|
a.id
|
|
387
387
|
)) });
|
|
388
|
-
},
|
|
388
|
+
}, Ue = ({
|
|
389
389
|
name: e,
|
|
390
|
-
value:
|
|
390
|
+
value: n,
|
|
391
391
|
title: t,
|
|
392
392
|
description: s,
|
|
393
393
|
checked: a = !1,
|
|
394
394
|
inputId: o,
|
|
395
395
|
cssClass: l,
|
|
396
396
|
labelCssClass: i,
|
|
397
|
-
disabled:
|
|
398
|
-
onChange:
|
|
397
|
+
disabled: u,
|
|
398
|
+
onChange: c,
|
|
399
399
|
descriptionCssClass: p
|
|
400
400
|
}) => {
|
|
401
|
-
const
|
|
401
|
+
const h = `${o}-desc`, b = d(
|
|
402
402
|
"dial-small cursor-pointer",
|
|
403
|
-
|
|
403
|
+
u ? "text-secondary" : "text-primary",
|
|
404
404
|
i
|
|
405
|
-
),
|
|
405
|
+
), C = d(
|
|
406
406
|
"cursor-pointer dial-input-radio",
|
|
407
407
|
t && "mr-2",
|
|
408
408
|
l
|
|
409
|
-
),
|
|
409
|
+
), y = d("flex flex-col", !!s && "mb-2"), x = d(
|
|
410
410
|
"dial-tiny mt-2 ml-[26px] text-secondary",
|
|
411
411
|
p
|
|
412
412
|
);
|
|
413
|
-
return /* @__PURE__ */ m("div", { className:
|
|
413
|
+
return /* @__PURE__ */ m("div", { className: y, children: [
|
|
414
414
|
/* @__PURE__ */ m("div", { className: "flex flex-row items-center", children: [
|
|
415
|
-
/* @__PURE__ */
|
|
415
|
+
/* @__PURE__ */ r(
|
|
416
416
|
"input",
|
|
417
417
|
{
|
|
418
418
|
type: "radio",
|
|
419
419
|
id: o,
|
|
420
420
|
name: e,
|
|
421
|
-
value:
|
|
421
|
+
value: n,
|
|
422
422
|
checked: a,
|
|
423
|
-
disabled:
|
|
424
|
-
"aria-describedby": a && s ?
|
|
425
|
-
className:
|
|
426
|
-
onChange: (
|
|
427
|
-
|
|
423
|
+
disabled: u,
|
|
424
|
+
"aria-describedby": a && s ? h : void 0,
|
|
425
|
+
className: C,
|
|
426
|
+
onChange: (N) => {
|
|
427
|
+
u || N.target.checked && c?.(n);
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
430
|
),
|
|
431
|
-
t ? /* @__PURE__ */
|
|
431
|
+
t ? /* @__PURE__ */ r("label", { className: b, htmlFor: o, children: t }) : null
|
|
432
432
|
] }),
|
|
433
|
-
a && s && /* @__PURE__ */
|
|
433
|
+
a && s && /* @__PURE__ */ r("div", { id: h, className: x, children: s })
|
|
434
434
|
] });
|
|
435
435
|
};
|
|
436
|
-
var
|
|
437
|
-
const
|
|
438
|
-
[
|
|
439
|
-
[
|
|
440
|
-
},
|
|
436
|
+
var O = /* @__PURE__ */ ((e) => (e.Row = "Row", e.Column = "Column", e))(O || {});
|
|
437
|
+
const $e = "flex flex-col gap-2", Ke = "flex", Ge = "pb-1 mt-2", Ze = {
|
|
438
|
+
[O.Column]: "flex-col gap-y-3",
|
|
439
|
+
[O.Row]: "flex-row gap-x-6"
|
|
440
|
+
}, gr = ({
|
|
441
441
|
fieldTitle: e,
|
|
442
|
-
radioCssClass:
|
|
442
|
+
radioCssClass: n,
|
|
443
443
|
labelCssClass: t,
|
|
444
444
|
disabled: s,
|
|
445
445
|
elementId: a,
|
|
446
446
|
radioButtons: o,
|
|
447
447
|
activeRadioButton: l,
|
|
448
448
|
orientation: i,
|
|
449
|
-
onChange:
|
|
450
|
-
}) => /* @__PURE__ */ m("div", { className:
|
|
451
|
-
e && /* @__PURE__ */
|
|
452
|
-
/* @__PURE__ */
|
|
449
|
+
onChange: u
|
|
450
|
+
}) => /* @__PURE__ */ m("div", { className: $e, children: [
|
|
451
|
+
e && /* @__PURE__ */ r(A, { fieldTitle: e, htmlFor: a }),
|
|
452
|
+
/* @__PURE__ */ r(
|
|
453
453
|
"div",
|
|
454
454
|
{
|
|
455
455
|
role: "radiogroup",
|
|
456
456
|
"aria-label": e,
|
|
457
457
|
"aria-disabled": s || void 0,
|
|
458
|
-
className:
|
|
459
|
-
|
|
460
|
-
|
|
458
|
+
className: d(
|
|
459
|
+
Ke,
|
|
460
|
+
Ze[i]
|
|
461
461
|
),
|
|
462
|
-
children: o.map((
|
|
463
|
-
/* @__PURE__ */
|
|
464
|
-
|
|
462
|
+
children: o.map((c) => /* @__PURE__ */ m("div", { className: "flex flex-col", children: [
|
|
463
|
+
/* @__PURE__ */ r(
|
|
464
|
+
Ue,
|
|
465
465
|
{
|
|
466
466
|
name: a,
|
|
467
|
-
value:
|
|
468
|
-
inputId:
|
|
467
|
+
value: c.id,
|
|
468
|
+
inputId: c.id,
|
|
469
469
|
disabled: s,
|
|
470
|
-
cssClass:
|
|
470
|
+
cssClass: n,
|
|
471
471
|
labelCssClass: t,
|
|
472
|
-
title:
|
|
473
|
-
checked:
|
|
474
|
-
onChange: () => c
|
|
472
|
+
title: c.name,
|
|
473
|
+
checked: c.id === l,
|
|
474
|
+
onChange: () => u(c.id)
|
|
475
475
|
}
|
|
476
476
|
),
|
|
477
|
-
|
|
478
|
-
] },
|
|
477
|
+
c.id === l && c.content ? /* @__PURE__ */ r("div", { className: Ge, children: c.content }) : null
|
|
478
|
+
] }, c.id))
|
|
479
479
|
}
|
|
480
480
|
)
|
|
481
|
-
] }),
|
|
481
|
+
] }), br = ({
|
|
482
|
+
ariaLabel: e,
|
|
483
|
+
cssClass: n,
|
|
484
|
+
size: t = 24,
|
|
485
|
+
onClose: s
|
|
486
|
+
}) => /* @__PURE__ */ r(
|
|
487
|
+
z,
|
|
488
|
+
{
|
|
489
|
+
ariaLabel: e,
|
|
490
|
+
cssClass: d("text-secondary hover:text-accent-primary", n),
|
|
491
|
+
onClick: s,
|
|
492
|
+
iconBefore: /* @__PURE__ */ r(M, { size: t })
|
|
493
|
+
}
|
|
494
|
+
), Xe = ({
|
|
482
495
|
value: e,
|
|
483
|
-
textareaId:
|
|
496
|
+
textareaId: n,
|
|
484
497
|
placeholder: t,
|
|
485
498
|
cssClass: s = "",
|
|
486
499
|
disabled: a,
|
|
487
500
|
invalid: o,
|
|
488
501
|
readonly: l,
|
|
489
502
|
onChange: i
|
|
490
|
-
}) => /* @__PURE__ */
|
|
503
|
+
}) => /* @__PURE__ */ r(I, { tooltip: e, triggerClassName: "flex", children: /* @__PURE__ */ r(
|
|
491
504
|
"textarea",
|
|
492
505
|
{
|
|
493
|
-
id:
|
|
506
|
+
id: n,
|
|
494
507
|
placeholder: t,
|
|
495
508
|
value: e || "",
|
|
496
509
|
disabled: a,
|
|
497
|
-
className:
|
|
510
|
+
className: d(
|
|
498
511
|
"dial-textarea dial-input",
|
|
499
512
|
o ? "dial-input-error" : "",
|
|
500
513
|
a && "dial-input-disable",
|
|
501
514
|
l && "dial-input-readonly",
|
|
502
515
|
s
|
|
503
516
|
),
|
|
504
|
-
onChange: (
|
|
517
|
+
onChange: (u) => !l && i?.(u.currentTarget.value)
|
|
505
518
|
}
|
|
506
|
-
) }),
|
|
519
|
+
) }), Ye = [
|
|
507
520
|
"ArrowLeft",
|
|
508
521
|
"ArrowRight",
|
|
509
522
|
"ArrowUp",
|
|
@@ -515,295 +528,364 @@ const Be = "flex flex-col gap-2", He = "flex", Ue = "pb-1 mt-2", $e = {
|
|
|
515
528
|
"Escape",
|
|
516
529
|
"Home",
|
|
517
530
|
"End"
|
|
518
|
-
],
|
|
519
|
-
if ((
|
|
531
|
+
], qe = (e, n, t, s) => {
|
|
532
|
+
if ((n === "number" || t !== void 0 || s !== void 0) && !Ye.includes(e.key) && !(e.key === "-" && e.currentTarget.selectionStart === 0 && (t === void 0 || t < 0)) && !(e.key === "." && n === "number" && !e.currentTarget.value.includes("."))) {
|
|
520
533
|
if (!/^[0-9]$/.test(e.key)) {
|
|
521
534
|
e.preventDefault();
|
|
522
535
|
return;
|
|
523
536
|
}
|
|
524
537
|
if (t !== void 0 || s !== void 0) {
|
|
525
|
-
const o = e.currentTarget.value, l = e.currentTarget.selectionStart || 0, i = o.slice(0, l) + e.key + o.slice(l),
|
|
526
|
-
if (!isNaN(
|
|
527
|
-
if (t !== void 0 &&
|
|
538
|
+
const o = e.currentTarget.value, l = e.currentTarget.selectionStart || 0, i = o.slice(0, l) + e.key + o.slice(l), u = parseFloat(i);
|
|
539
|
+
if (!isNaN(u)) {
|
|
540
|
+
if (t !== void 0 && u < t) {
|
|
528
541
|
e.preventDefault();
|
|
529
542
|
return;
|
|
530
543
|
}
|
|
531
|
-
if (s !== void 0 &&
|
|
544
|
+
if (s !== void 0 && u > s) {
|
|
532
545
|
e.preventDefault();
|
|
533
546
|
return;
|
|
534
547
|
}
|
|
535
548
|
}
|
|
536
549
|
}
|
|
537
550
|
}
|
|
538
|
-
},
|
|
551
|
+
}, L = ({
|
|
539
552
|
iconBeforeInput: e,
|
|
540
|
-
iconAfterInput:
|
|
553
|
+
iconAfterInput: n,
|
|
541
554
|
hideBorder: t,
|
|
542
555
|
value: s,
|
|
543
556
|
elementId: a,
|
|
544
557
|
placeholder: o = "",
|
|
545
558
|
cssClass: l = "",
|
|
546
559
|
containerCssClass: i,
|
|
547
|
-
tooltipTriggerClassName:
|
|
548
|
-
type:
|
|
560
|
+
tooltipTriggerClassName: u,
|
|
561
|
+
type: c = "text",
|
|
549
562
|
disabled: p,
|
|
550
|
-
readonly:
|
|
551
|
-
invalid:
|
|
552
|
-
onChange:
|
|
553
|
-
min:
|
|
563
|
+
readonly: h,
|
|
564
|
+
invalid: b,
|
|
565
|
+
onChange: C,
|
|
566
|
+
min: y,
|
|
554
567
|
max: x,
|
|
555
|
-
prefix:
|
|
556
|
-
suffix:
|
|
557
|
-
textBeforeInput:
|
|
558
|
-
textAfterInput:
|
|
568
|
+
prefix: v,
|
|
569
|
+
suffix: N,
|
|
570
|
+
textBeforeInput: f,
|
|
571
|
+
textAfterInput: k
|
|
559
572
|
}) => {
|
|
560
|
-
const
|
|
561
|
-
|
|
562
|
-
},
|
|
563
|
-
const
|
|
564
|
-
if (
|
|
565
|
-
const E = parseFloat(
|
|
566
|
-
if (isNaN(E) &&
|
|
573
|
+
const J = (w) => w.target.blur(), Q = c === "number" || y !== void 0 || x !== void 0, ee = (w) => {
|
|
574
|
+
qe(w, c, y, x);
|
|
575
|
+
}, re = (w) => {
|
|
576
|
+
const F = w.currentTarget.value;
|
|
577
|
+
if (Q && F !== "") {
|
|
578
|
+
const E = parseFloat(F);
|
|
579
|
+
if (isNaN(E) && F !== "-" && F !== "." || !isNaN(E) && (y !== void 0 && E < y || x !== void 0 && E > x))
|
|
567
580
|
return;
|
|
568
581
|
}
|
|
569
|
-
|
|
582
|
+
C?.(F);
|
|
570
583
|
};
|
|
571
584
|
return /* @__PURE__ */ m(
|
|
572
585
|
"div",
|
|
573
586
|
{
|
|
574
|
-
className:
|
|
587
|
+
className: d(
|
|
575
588
|
"dial-input-field flex flex-row items-center justify-between",
|
|
576
589
|
t ? "dial-input-no-border" : "dial-input",
|
|
577
|
-
|
|
590
|
+
b && "dial-input-error",
|
|
578
591
|
p && "dial-input-disable",
|
|
579
|
-
|
|
580
|
-
!
|
|
581
|
-
!
|
|
592
|
+
h && "dial-input-readonly",
|
|
593
|
+
!f && "pl-1",
|
|
594
|
+
!k && "pr-1",
|
|
582
595
|
i
|
|
583
596
|
),
|
|
584
597
|
children: [
|
|
585
|
-
|
|
586
|
-
|
|
598
|
+
f && /* @__PURE__ */ r(I, { tooltip: f, children: /* @__PURE__ */ r(
|
|
599
|
+
L,
|
|
587
600
|
{
|
|
588
601
|
hideBorder: !0,
|
|
589
602
|
containerCssClass: "rounded-r-none border-r-0",
|
|
590
603
|
cssClass: "px-2 overflow-hidden overflow-ellipsis dial-small",
|
|
591
|
-
value:
|
|
604
|
+
value: f,
|
|
592
605
|
disabled: !0,
|
|
593
|
-
elementId:
|
|
606
|
+
elementId: f + "textBefore"
|
|
594
607
|
}
|
|
595
608
|
) }),
|
|
596
|
-
|
|
609
|
+
v && /* @__PURE__ */ m("p", { className: "text-secondary dial-small pl-2", children: [
|
|
597
610
|
" ",
|
|
598
|
-
|
|
611
|
+
v
|
|
599
612
|
] }),
|
|
600
|
-
/* @__PURE__ */
|
|
601
|
-
/* @__PURE__ */
|
|
613
|
+
/* @__PURE__ */ r(R, { icon: e }),
|
|
614
|
+
/* @__PURE__ */ r(I, { tooltip: s, triggerClassName: u, children: /* @__PURE__ */ r(
|
|
602
615
|
"input",
|
|
603
616
|
{
|
|
604
|
-
type:
|
|
617
|
+
type: c,
|
|
605
618
|
autoComplete: "off",
|
|
606
619
|
id: a,
|
|
607
620
|
placeholder: o,
|
|
608
621
|
value: s ?? "",
|
|
609
622
|
title: s ? String(s) : "",
|
|
610
623
|
disabled: p,
|
|
611
|
-
className:
|
|
612
|
-
onChange: (
|
|
613
|
-
onKeyDown:
|
|
614
|
-
onWheel:
|
|
615
|
-
min:
|
|
624
|
+
className: d("border-0 bg-transparent px-2", l),
|
|
625
|
+
onChange: (w) => !h && re?.(w),
|
|
626
|
+
onKeyDown: ee,
|
|
627
|
+
onWheel: J,
|
|
628
|
+
min: y,
|
|
616
629
|
max: x
|
|
617
630
|
}
|
|
618
631
|
) }),
|
|
619
|
-
/* @__PURE__ */
|
|
620
|
-
|
|
632
|
+
/* @__PURE__ */ r(R, { icon: n }),
|
|
633
|
+
N && /* @__PURE__ */ m("p", { className: "text-secondary dial-small pr-2", children: [
|
|
621
634
|
" ",
|
|
622
|
-
|
|
635
|
+
N
|
|
623
636
|
] }),
|
|
624
|
-
|
|
625
|
-
|
|
637
|
+
k && /* @__PURE__ */ r(I, { tooltip: k, children: /* @__PURE__ */ r(
|
|
638
|
+
L,
|
|
626
639
|
{
|
|
627
640
|
hideBorder: !0,
|
|
628
641
|
containerCssClass: "rounded-l-none border-l-0",
|
|
629
642
|
cssClass: "px-2",
|
|
630
|
-
value:
|
|
643
|
+
value: k,
|
|
631
644
|
disabled: !0,
|
|
632
|
-
elementId:
|
|
645
|
+
elementId: k + "textAfter"
|
|
633
646
|
}
|
|
634
647
|
) })
|
|
635
648
|
]
|
|
636
649
|
}
|
|
637
650
|
);
|
|
638
|
-
},
|
|
651
|
+
}, Je = /^0+\.(\d+)?$/, Qe = /^0+/, q = ({
|
|
639
652
|
fieldTitle: e,
|
|
640
|
-
errorText:
|
|
653
|
+
errorText: n,
|
|
641
654
|
optional: t,
|
|
642
655
|
elementCssClass: s,
|
|
643
656
|
elementContainerCssClass: a,
|
|
644
657
|
elementId: o,
|
|
645
658
|
containerCssClass: l,
|
|
646
659
|
readonly: i,
|
|
647
|
-
defaultEmptyText:
|
|
648
|
-
min:
|
|
660
|
+
defaultEmptyText: u,
|
|
661
|
+
min: c,
|
|
649
662
|
max: p,
|
|
650
|
-
...
|
|
651
|
-
}) => /* @__PURE__ */ m("div", { className:
|
|
652
|
-
/* @__PURE__ */
|
|
653
|
-
|
|
663
|
+
...h
|
|
664
|
+
}) => /* @__PURE__ */ m("div", { className: d("flex flex-col", l), children: [
|
|
665
|
+
/* @__PURE__ */ r(
|
|
666
|
+
A,
|
|
654
667
|
{
|
|
655
668
|
fieldTitle: e,
|
|
656
669
|
optional: t,
|
|
657
670
|
htmlFor: o
|
|
658
671
|
}
|
|
659
672
|
),
|
|
660
|
-
i ? /* @__PURE__ */
|
|
661
|
-
/* @__PURE__ */
|
|
662
|
-
|
|
673
|
+
i ? /* @__PURE__ */ r("span", { children: h.value || (u ?? "None") }) : /* @__PURE__ */ m(ne, { children: [
|
|
674
|
+
/* @__PURE__ */ r(
|
|
675
|
+
L,
|
|
663
676
|
{
|
|
664
677
|
elementId: o,
|
|
665
678
|
cssClass: s,
|
|
666
679
|
containerCssClass: a,
|
|
667
|
-
invalid:
|
|
668
|
-
min:
|
|
680
|
+
invalid: n != null,
|
|
681
|
+
min: c,
|
|
669
682
|
max: p,
|
|
670
|
-
...
|
|
683
|
+
...h
|
|
671
684
|
}
|
|
672
685
|
),
|
|
673
|
-
/* @__PURE__ */
|
|
686
|
+
/* @__PURE__ */ r(V, { errorText: n })
|
|
674
687
|
] })
|
|
675
|
-
] }),
|
|
688
|
+
] }), yr = ({
|
|
676
689
|
onChange: e,
|
|
677
|
-
value:
|
|
690
|
+
value: n,
|
|
678
691
|
min: t,
|
|
679
692
|
max: s,
|
|
680
693
|
...a
|
|
681
694
|
}) => {
|
|
682
|
-
const o = (l) => String(l)?.match(
|
|
683
|
-
return /* @__PURE__ */
|
|
684
|
-
|
|
695
|
+
const o = (l) => String(l)?.match(Je) ? String(l)?.replace(Qe, "0") : Number(l);
|
|
696
|
+
return /* @__PURE__ */ r(
|
|
697
|
+
q,
|
|
685
698
|
{
|
|
686
699
|
type: "number",
|
|
687
700
|
onChange: (l) => e?.(o(l)),
|
|
688
|
-
value:
|
|
701
|
+
value: n,
|
|
689
702
|
min: t,
|
|
690
703
|
max: s,
|
|
691
704
|
...a
|
|
692
705
|
}
|
|
693
706
|
);
|
|
694
|
-
},
|
|
707
|
+
}, Cr = ({
|
|
695
708
|
onChange: e,
|
|
696
|
-
...
|
|
697
|
-
}) => /* @__PURE__ */
|
|
698
|
-
|
|
709
|
+
...n
|
|
710
|
+
}) => /* @__PURE__ */ r(
|
|
711
|
+
q,
|
|
699
712
|
{
|
|
700
713
|
type: "text",
|
|
701
714
|
onChange: (t) => e?.(t),
|
|
702
|
-
...
|
|
715
|
+
...n
|
|
703
716
|
}
|
|
704
|
-
),
|
|
717
|
+
), wr = ({
|
|
705
718
|
fieldTitle: e,
|
|
706
|
-
optional:
|
|
719
|
+
optional: n,
|
|
707
720
|
elementId: t,
|
|
708
721
|
elementCssClass: s,
|
|
709
722
|
errorText: a,
|
|
710
723
|
...o
|
|
711
724
|
}) => /* @__PURE__ */ m("div", { className: "flex flex-col", children: [
|
|
712
|
-
/* @__PURE__ */
|
|
713
|
-
|
|
725
|
+
/* @__PURE__ */ r(
|
|
726
|
+
A,
|
|
714
727
|
{
|
|
715
728
|
fieldTitle: e,
|
|
716
|
-
optional:
|
|
729
|
+
optional: n,
|
|
717
730
|
htmlFor: t
|
|
718
731
|
}
|
|
719
732
|
),
|
|
720
|
-
/* @__PURE__ */
|
|
721
|
-
|
|
733
|
+
/* @__PURE__ */ r(
|
|
734
|
+
Xe,
|
|
722
735
|
{
|
|
723
736
|
textareaId: t,
|
|
724
737
|
cssClass: s,
|
|
725
738
|
...o
|
|
726
739
|
}
|
|
727
740
|
),
|
|
728
|
-
/* @__PURE__ */
|
|
729
|
-
] }),
|
|
741
|
+
/* @__PURE__ */ r(V, { errorText: a })
|
|
742
|
+
] }), vr = ({
|
|
730
743
|
title: e,
|
|
731
|
-
switchId:
|
|
744
|
+
switchId: n,
|
|
732
745
|
isOn: t = !1,
|
|
733
746
|
disabled: s,
|
|
734
747
|
onChange: a
|
|
735
748
|
}) => {
|
|
736
|
-
const o =
|
|
749
|
+
const o = d(
|
|
737
750
|
"flex w-[36px] h-[18px] cursor-pointer items-center gap-1 rounded-full p-0.5 transition-all duration-200",
|
|
738
751
|
t ? "flex-row-reverse" : "flex-row",
|
|
739
752
|
s ? "pointer-events-none" : "",
|
|
740
753
|
s ? t ? "bg-controls-disable" : "bg-layer-4" : t ? "bg-accent-primary" : "bg-layer-4"
|
|
741
|
-
), l =
|
|
754
|
+
), l = B(
|
|
742
755
|
(i) => {
|
|
743
756
|
i.stopPropagation(), a?.(!t);
|
|
744
757
|
},
|
|
745
758
|
[a, t]
|
|
746
759
|
);
|
|
747
760
|
return /* @__PURE__ */ m("div", { className: "flex flex-row items-center", children: [
|
|
748
|
-
/* @__PURE__ */
|
|
761
|
+
/* @__PURE__ */ r(
|
|
749
762
|
"input",
|
|
750
763
|
{
|
|
751
764
|
type: "checkbox",
|
|
752
765
|
onChange: l,
|
|
753
|
-
id:
|
|
766
|
+
id: n,
|
|
754
767
|
disabled: s,
|
|
755
768
|
className: "invisible w-0 h-0",
|
|
756
769
|
checked: t
|
|
757
770
|
}
|
|
758
771
|
),
|
|
759
|
-
/* @__PURE__ */
|
|
772
|
+
/* @__PURE__ */ r("label", { htmlFor: n, className: o, children: /* @__PURE__ */ r(
|
|
760
773
|
"span",
|
|
761
774
|
{
|
|
762
|
-
className:
|
|
775
|
+
className: d(
|
|
763
776
|
"size-3 rounded-full",
|
|
764
777
|
s ? t ? "bg-layer-4" : "bg-controls-disable" : "bg-controls-enable-primary"
|
|
765
778
|
)
|
|
766
779
|
}
|
|
767
780
|
) }),
|
|
768
|
-
e && /* @__PURE__ */
|
|
781
|
+
e && /* @__PURE__ */ r("span", { className: "pl-2 dial-small text-primary", children: e })
|
|
769
782
|
] });
|
|
770
|
-
}
|
|
771
|
-
|
|
783
|
+
};
|
|
784
|
+
var T = /* @__PURE__ */ ((e) => (e.Sm = "sm", e.Md = "md", e.Lg = "lg", e))(T || {});
|
|
785
|
+
const er = "z-[52] flex items-center justify-center bg-blackout md:p-4", rr = "relative max-h-full rounded bg-layer-3 flex flex-col shadow w-full h-full md:h-auto", nr = "divide-tertiary divide-y", tr = "flex flex-row justify-between py-4 px-6 items-center", sr = {
|
|
786
|
+
[T.Sm]: "max-w-full md:max-w-[400px]",
|
|
787
|
+
[T.Md]: "max-w-full md:max-w-[800px]",
|
|
788
|
+
[T.Lg]: "max-w-full md:max-w-[1200px]"
|
|
789
|
+
}, Nr = ({
|
|
790
|
+
open: e = !1,
|
|
791
|
+
title: n,
|
|
792
|
+
portalId: t,
|
|
793
|
+
cssClass: s,
|
|
794
|
+
overlayClass: a,
|
|
795
|
+
headingClass: o,
|
|
796
|
+
dividers: l = !0,
|
|
797
|
+
children: i,
|
|
798
|
+
footer: u,
|
|
799
|
+
onClose: c,
|
|
800
|
+
size: p = T.Md
|
|
801
|
+
}) => {
|
|
802
|
+
const { refs: h, context: b } = H({
|
|
803
|
+
open: e,
|
|
804
|
+
onOpenChange: (f) => {
|
|
805
|
+
f || c?.(null);
|
|
806
|
+
}
|
|
807
|
+
}), C = $(b, { role: "dialog" }), y = U(b, { outsidePress: !0 }), { getFloatingProps: x } = K([C, y]);
|
|
808
|
+
if (!e) return null;
|
|
809
|
+
const v = typeof n == "string" ? "dial-popup-heading" : void 0, N = (f) => f ? typeof f == "string" ? /* @__PURE__ */ r(
|
|
810
|
+
"h3",
|
|
811
|
+
{
|
|
812
|
+
id: v,
|
|
813
|
+
className: d(
|
|
814
|
+
"flex-1 min-w-0 mr-3 truncate dial-h3 text-primary",
|
|
815
|
+
o
|
|
816
|
+
),
|
|
817
|
+
children: /* @__PURE__ */ r(I, { tooltip: f, children: f })
|
|
818
|
+
}
|
|
819
|
+
) : f : /* @__PURE__ */ r("span", {});
|
|
820
|
+
return /* @__PURE__ */ r(Z, { id: t, children: /* @__PURE__ */ r(Re, { className: d(er, a), children: /* @__PURE__ */ r(ke, { context: b, children: /* @__PURE__ */ m(
|
|
821
|
+
"div",
|
|
822
|
+
{
|
|
823
|
+
ref: h.setFloating,
|
|
824
|
+
...x(),
|
|
825
|
+
role: "dialog",
|
|
826
|
+
"aria-modal": "true",
|
|
827
|
+
"aria-labelledby": v,
|
|
828
|
+
className: d(
|
|
829
|
+
rr,
|
|
830
|
+
sr[p],
|
|
831
|
+
l && nr,
|
|
832
|
+
s
|
|
833
|
+
),
|
|
834
|
+
children: [
|
|
835
|
+
/* @__PURE__ */ m("div", { className: tr, children: [
|
|
836
|
+
N(n),
|
|
837
|
+
/* @__PURE__ */ r(
|
|
838
|
+
z,
|
|
839
|
+
{
|
|
840
|
+
cssClass: "text-secondary hover:text-accent-primary",
|
|
841
|
+
ariaLabel: "Close dialog",
|
|
842
|
+
iconBefore: /* @__PURE__ */ r(M, { size: 18 }),
|
|
843
|
+
onClick: (f) => c?.(f)
|
|
844
|
+
}
|
|
845
|
+
)
|
|
846
|
+
] }),
|
|
847
|
+
/* @__PURE__ */ r("div", { className: "flex-grow overflow-auto", children: i }),
|
|
848
|
+
u
|
|
849
|
+
]
|
|
850
|
+
}
|
|
851
|
+
) }) }) });
|
|
852
|
+
}, ar = ({ onClick: e }) => /* @__PURE__ */ r(
|
|
853
|
+
de,
|
|
772
854
|
{
|
|
773
|
-
...
|
|
855
|
+
...P,
|
|
774
856
|
className: "text-primary",
|
|
775
857
|
onClick: e
|
|
776
858
|
}
|
|
777
|
-
),
|
|
778
|
-
const [
|
|
859
|
+
), or = ({ onClick: e }) => /* @__PURE__ */ r(ue, { ...P, className: "text-primary", onClick: e }), lr = ({ ...e }) => {
|
|
860
|
+
const [n, t] = W(!1), s = B((a) => {
|
|
779
861
|
t(a);
|
|
780
862
|
}, []);
|
|
781
|
-
return /* @__PURE__ */
|
|
782
|
-
|
|
863
|
+
return /* @__PURE__ */ r(
|
|
864
|
+
L,
|
|
783
865
|
{
|
|
784
|
-
type:
|
|
866
|
+
type: n ? "text" : "password",
|
|
785
867
|
...e,
|
|
786
|
-
iconAfterInput:
|
|
868
|
+
iconAfterInput: n ? /* @__PURE__ */ r(ar, { onClick: () => s(!1) }) : /* @__PURE__ */ r(or, { onClick: () => s(!0) })
|
|
787
869
|
}
|
|
788
870
|
);
|
|
789
|
-
},
|
|
871
|
+
}, Dr = ({
|
|
790
872
|
fieldTitle: e,
|
|
791
|
-
optional:
|
|
873
|
+
optional: n,
|
|
792
874
|
elementCssClass: t,
|
|
793
875
|
elementId: s,
|
|
794
876
|
errorText: a,
|
|
795
877
|
...o
|
|
796
878
|
}) => /* @__PURE__ */ m("div", { className: "flex flex-col", children: [
|
|
797
|
-
/* @__PURE__ */
|
|
798
|
-
|
|
879
|
+
/* @__PURE__ */ r(
|
|
880
|
+
A,
|
|
799
881
|
{
|
|
800
882
|
fieldTitle: e,
|
|
801
|
-
optional:
|
|
883
|
+
optional: n,
|
|
802
884
|
htmlFor: s
|
|
803
885
|
}
|
|
804
886
|
),
|
|
805
|
-
/* @__PURE__ */
|
|
806
|
-
|
|
887
|
+
/* @__PURE__ */ r(
|
|
888
|
+
lr,
|
|
807
889
|
{
|
|
808
890
|
cssClass: t,
|
|
809
891
|
elementId: s,
|
|
@@ -811,29 +893,33 @@ const Be = "flex flex-col gap-2", He = "flex", Ue = "pb-1 mt-2", $e = {
|
|
|
811
893
|
...o
|
|
812
894
|
}
|
|
813
895
|
),
|
|
814
|
-
/* @__PURE__ */
|
|
896
|
+
/* @__PURE__ */ r(V, { errorText: a })
|
|
815
897
|
] });
|
|
816
898
|
export {
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
899
|
+
D as AlertVariant,
|
|
900
|
+
S as ButtonVariant,
|
|
901
|
+
pr as DialAlert,
|
|
902
|
+
z as DialButton,
|
|
903
|
+
hr as DialCheckbox,
|
|
904
|
+
br as DialCloseButton,
|
|
822
905
|
V as DialErrorText,
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
906
|
+
A as DialFieldLabel,
|
|
907
|
+
R as DialIcon,
|
|
908
|
+
L as DialInput,
|
|
909
|
+
fr as DialLoader,
|
|
910
|
+
yr as DialNumberInputField,
|
|
911
|
+
lr as DialPasswordInput,
|
|
912
|
+
Dr as DialPasswordInputField,
|
|
913
|
+
Nr as DialPopup,
|
|
914
|
+
Ue as DialRadioButton,
|
|
915
|
+
gr as DialRadioGroup,
|
|
916
|
+
xr as DialSteps,
|
|
917
|
+
vr as DialSwitch,
|
|
918
|
+
wr as DialTextAreaField,
|
|
919
|
+
Cr as DialTextInputField,
|
|
920
|
+
Xe as DialTextarea,
|
|
921
|
+
I as DialTooltip,
|
|
922
|
+
T as PopupSize,
|
|
923
|
+
O as RadioGroupOrientation,
|
|
924
|
+
g as StepStatus
|
|
839
925
|
};
|