@epam/ai-dial-ui-kit 0.2.0-rc.12 → 0.2.0-rc.14

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