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