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