@epam/ai-dial-ui-kit 0.2.0-rc.11 → 0.2.0-rc.13

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