@epam/ai-dial-ui-kit 0.2.0-rc.3 → 0.2.0-rc.31

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.
Files changed (49) hide show
  1. package/dist/dial-ui-kit.cjs.js +1 -1
  2. package/dist/dial-ui-kit.es.js +1158 -322
  3. package/dist/index.css +2 -2
  4. package/dist/src/components/Alert/Alert.d.ts +6 -6
  5. package/dist/src/components/Alert/constants.d.ts +1 -1
  6. package/dist/src/components/AutocompleteInput/AutocompleteInput.d.ts +36 -0
  7. package/dist/src/components/AutocompleteInput/AutocompleteInputValue.d.ts +26 -0
  8. package/dist/src/components/Button/Button.d.ts +7 -2
  9. package/dist/src/components/Button/constants.d.ts +2 -0
  10. package/dist/src/components/Checkbox/Checkbox.d.ts +33 -0
  11. package/dist/src/components/CloseButton/CloseButton.d.ts +26 -0
  12. package/dist/src/components/CollapsibleSidebar/CollapsibleSidebar.d.ts +37 -0
  13. package/dist/src/components/ConfirmationPopup/ConfirmationPopup.d.ts +53 -0
  14. package/dist/src/components/ConfirmationPopup/constants.d.ts +11 -0
  15. package/dist/src/components/Input/Input.d.ts +4 -4
  16. package/dist/src/components/InputField/InputField.d.ts +4 -4
  17. package/dist/src/components/InputModal/InputModal.d.ts +47 -0
  18. package/dist/src/components/LabelledText/LabelledText.d.ts +25 -0
  19. package/dist/src/components/Loader/Loader.d.ts +32 -0
  20. package/dist/src/components/Loader/constants.d.ts +2 -0
  21. package/dist/src/components/NoDataContent/NoDataContent.d.ts +22 -0
  22. package/dist/src/components/PasswordInput/Icons/HideIcon.d.ts +16 -0
  23. package/dist/src/components/PasswordInput/Icons/ShowIcon.d.ts +16 -0
  24. package/dist/src/components/PasswordInput/PasswordInput.d.ts +24 -0
  25. package/dist/src/components/PasswordInput/PasswordInputField.d.ts +29 -0
  26. package/dist/src/components/Popup/Popup.d.ts +52 -0
  27. package/dist/src/components/Popup/constants.d.ts +6 -0
  28. package/dist/src/components/RadioButton/RadioButton.d.ts +46 -0
  29. package/dist/src/components/RadioGroup/RadioGroup.d.ts +47 -0
  30. package/dist/src/components/RadioGroup/constants.d.ts +5 -0
  31. package/dist/src/components/Search/Search.d.ts +42 -0
  32. package/dist/src/components/Search/constants.d.ts +14 -0
  33. package/dist/src/components/Steps/Step.d.ts +9 -0
  34. package/dist/src/components/Steps/Steps.d.ts +24 -0
  35. package/dist/src/components/Steps/tests/Steps.test.d.ts +1 -0
  36. package/dist/src/components/Steps/utils.d.ts +3 -0
  37. package/dist/src/components/Switch/Switch.d.ts +1 -1
  38. package/dist/src/components/TextAreaField/TextAreaField.d.ts +2 -2
  39. package/dist/src/constants/icon.d.ts +5 -0
  40. package/dist/src/index.d.ts +26 -1
  41. package/dist/src/models/field-control-props.d.ts +2 -2
  42. package/dist/src/models/radio.d.ts +6 -0
  43. package/dist/src/models/step.d.ts +9 -0
  44. package/dist/src/types/button.d.ts +6 -0
  45. package/dist/src/types/confirmation-popup.d.ts +4 -0
  46. package/dist/src/types/popup.d.ts +5 -0
  47. package/dist/src/types/radio-group.d.ts +4 -0
  48. package/dist/src/types/search.d.ts +4 -0
  49. package/package.json +11 -10
@@ -1,182 +1,227 @@
1
- import { jsx as t, jsxs as p, Fragment as _ } from "react/jsx-runtime";
2
- import u from "classnames";
3
- import { IconCircleCheck as K, IconAlertTriangle as V, IconAlertCircle as B, IconInfoCircle as G, IconX as O } from "@tabler/icons-react";
4
- import { useFloating as $, offset as X, flip as Y, shift as Z, arrow as q, autoUpdate as J, useHover as Q, useFocus as ee, useDismiss as re, useRole as ne, useInteractions as te, useMergeRefs as E, FloatingPortal as se, FloatingArrow as oe } from "@floating-ui/react";
5
- import { createContext as le, useState as ae, useRef as ie, useMemo as ce, useContext as ue, forwardRef as P, isValidElement as de, cloneElement as pe, useCallback as me } from "react";
6
- const C = ({ icon: e, className: r }) => e ? /* @__PURE__ */ t("span", { className: u("flex-shrink-0", r), children: e }) : null, fe = ({
1
+ import { jsx as r, jsxs as p, Fragment as _ } from "react/jsx-runtime";
2
+ import i from "classnames";
3
+ import { IconCircleCheck as de, IconAlertTriangle as ue, IconAlertCircle as pe, IconInfoCircle as me, IconX as $, IconMinus as fe, IconCheck as G, IconExclamationCircle as he, IconClipboardX as xe, IconChevronsLeft as ge, IconChevronsRight as Ce, IconEyeOff as ye, IconEye as be, IconSearch as we } from "@tabler/icons-react";
4
+ import * as w from "react";
5
+ import { createContext as ve, useState as T, useRef as Ne, useMemo as ke, useContext as De, forwardRef as X, isValidElement as Ie, cloneElement as Le, useCallback as I, useEffect as Se } from "react";
6
+ import { useFloating as q, offset as Ee, flip as Re, shift as Fe, arrow as Te, autoUpdate as Me, useHover as je, useFocus as Ve, useDismiss as Q, useRole as Y, useInteractions as J, useMergeRefs as ee, FloatingPortal as re, FloatingArrow as Pe, FloatingOverlay as Ae, FloatingFocusManager as Be } from "@floating-ui/react";
7
+ import { createPortal as Oe } from "react-dom";
8
+ const z = ({ errorText: e }) => e && /* @__PURE__ */ r("span", { className: "text-error dial-tiny mt-1", children: e }), H = ({
9
+ fieldTitle: e,
10
+ htmlFor: t,
11
+ optional: n,
12
+ optionalText: a,
13
+ cssClass: s
14
+ }) => e ? /* @__PURE__ */ p(
15
+ "label",
16
+ {
17
+ className: i(
18
+ "dial-tiny text-secondary",
19
+ s,
20
+ !s?.includes("mb") && "mb-2"
21
+ ),
22
+ htmlFor: t,
23
+ children: [
24
+ /* @__PURE__ */ r("span", { className: "min-h-4", children: e }),
25
+ n && /* @__PURE__ */ r("span", { className: "ml-1", children: a ?? "(Optional)" })
26
+ ]
27
+ }
28
+ ) : null, N = ({ icon: e, className: t }) => e ? /* @__PURE__ */ r("span", { className: i("flex-shrink-0", t), children: e }) : null;
29
+ var v = /* @__PURE__ */ ((e) => (e.Primary = "primary", e.Secondary = "secondary", e.Tertiary = "tertiary", e.Danger = "danger", e))(v || {});
30
+ const We = {
31
+ [v.Primary]: "dial-primary-button",
32
+ [v.Secondary]: "dial-secondary-button",
33
+ [v.Tertiary]: "dial-tertiary-button",
34
+ [v.Danger]: "dial-danger-button"
35
+ }, V = ({
7
36
  title: e,
8
- cssClass: r,
9
- ref: n,
10
- onClick: s,
11
- disable: o,
12
- iconAfter: l,
13
- iconBefore: a,
37
+ variant: t,
38
+ cssClass: n,
39
+ textCssClass: a,
40
+ ref: s,
41
+ onClick: o,
42
+ disable: l,
43
+ iconAfter: u,
44
+ iconBefore: d,
14
45
  hideTitleOnMobile: c,
15
- ariaLabel: i
46
+ ariaLabel: m
16
47
  }) => {
17
- const m = u(
48
+ const f = i(
18
49
  "dial-small-semi",
19
- l ? "mr-2" : "",
20
- a ? "ml-2" : "",
21
- c ? "hidden sm:inline" : "inline"
22
- ), d = u(
23
- r,
50
+ u ? "mr-2" : "",
51
+ d ? "ml-2" : "",
52
+ c ? "hidden sm:inline" : "inline",
53
+ a
54
+ ), x = i(
55
+ t && We[t],
56
+ n,
24
57
  "focus-visible:outline outline-offset-0"
25
58
  );
26
59
  return /* @__PURE__ */ p(
27
60
  "button",
28
61
  {
29
- ref: n,
62
+ ref: s,
30
63
  type: "button",
31
- className: d,
32
- onClick: (f) => s?.(f),
33
- disabled: o,
34
- "aria-label": e || i,
64
+ className: x,
65
+ onClick: (h) => o?.(h),
66
+ disabled: l,
67
+ "aria-label": e || m,
35
68
  children: [
36
- /* @__PURE__ */ t(C, { icon: a }),
37
- e && /* @__PURE__ */ t("span", { className: m, children: e }),
38
- /* @__PURE__ */ t(C, { icon: l })
69
+ /* @__PURE__ */ r(N, { icon: d }),
70
+ e && /* @__PURE__ */ r("span", { className: f, children: e }),
71
+ /* @__PURE__ */ r(N, { icon: u })
39
72
  ]
40
73
  }
41
74
  );
42
- }, S = ({ errorText: e }) => e && /* @__PURE__ */ t("span", { className: "text-error dial-tiny mt-1", children: e }), z = ({
43
- fieldTitle: e,
44
- htmlFor: r,
45
- optional: n,
46
- optionalText: s,
47
- cssClass: o
48
- }) => e ? /* @__PURE__ */ p(
49
- "label",
50
- {
51
- className: u(
52
- "dial-tiny text-secondary",
53
- o,
54
- !o?.includes("mb") && "mb-2"
55
- ),
56
- htmlFor: r,
57
- children: [
58
- /* @__PURE__ */ t("span", { className: "min-h-4", children: e }),
59
- n && /* @__PURE__ */ t("span", { className: "ml-1", children: s ?? "(Optional)" })
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,
75
+ };
76
+ var E = /* @__PURE__ */ ((e) => (e.Info = "info", e.Success = "success", e.Warning = "warning", e.Error = "error", e))(E || {});
77
+ const ze = {
78
+ info: /* @__PURE__ */ r(me, { size: 24, stroke: 2 }),
79
+ error: /* @__PURE__ */ r(pe, { size: 24, stroke: 2 }),
80
+ warning: /* @__PURE__ */ r(ue, { size: 24, stroke: 2 }),
81
+ success: /* @__PURE__ */ r(de, { size: 24, stroke: 2 })
82
+ }, He = {
83
+ [E.Info]: "bg-info border-info text-info",
84
+ [E.Success]: "bg-success border-success text-success",
85
+ [E.Warning]: "bg-warning border-warning text-warning",
86
+ [E.Error]: "bg-error border-error text-error"
87
+ }, _e = "items-center justify-between gap-2 p-3 border border-solid dial-small-150 rounded flex", jr = ({
88
+ variant: e = E.Info,
89
+ message: t,
77
90
  cssClass: n,
78
- closable: s = !0,
79
- onClose: o
91
+ closable: a = !1,
92
+ onClose: s
80
93
  }) => /* @__PURE__ */ p(
81
94
  "div",
82
95
  {
83
96
  role: "alert",
84
- className: u(
85
- be,
86
- he[e],
97
+ className: i(
98
+ _e,
99
+ He[e],
87
100
  n
88
101
  ),
89
102
  children: [
90
103
  /* @__PURE__ */ p("div", { className: "flex items-center gap-2", children: [
91
- /* @__PURE__ */ t(C, { icon: ge[e] }),
92
- /* @__PURE__ */ t("div", { className: "text-primary", children: r })
104
+ /* @__PURE__ */ r(N, { icon: ze[e] }),
105
+ /* @__PURE__ */ r("div", { className: "text-primary", children: t })
93
106
  ] }),
94
- s && /* @__PURE__ */ t(
95
- fe,
107
+ a && /* @__PURE__ */ r(
108
+ V,
96
109
  {
97
- cssClass: "ml-2 text-secondary hover:text-primary ml-2 text-secondary hover:text-primary ",
110
+ cssClass: "ml-2 text-secondary hover:text-primary",
98
111
  ariaLabel: "Close alert",
99
- iconBefore: /* @__PURE__ */ t(O, { size: 16 }),
100
- onClick: (l) => o?.(l)
112
+ iconBefore: /* @__PURE__ */ r($, { size: 16 }),
113
+ onClick: (o) => s?.(o)
101
114
  }
102
115
  )
103
116
  ]
104
117
  }
105
- ), xe = 7, Ne = 2, A = le(null), W = () => {
106
- const e = ue(A);
118
+ ), Ze = "flex items-center justify-center text-secondary", $e = "shrink-0 grow-0 basis-auto animate-spin-steps", Ke = (e) => /* @__PURE__ */ w.createElement("svg", { viewBox: "0 0 48 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ w.createElement("path", { d: "M24 39V46.5", stroke: "currentColor", strokeWidth: 3, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ w.createElement("path", { opacity: 0.4, d: "M9 24H1.5", stroke: "currentColor", strokeWidth: 3, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ w.createElement("path", { opacity: 0.5, d: "M8.0918 8.0918L13.3994 13.3994", stroke: "currentColor", strokeWidth: 3, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ w.createElement("path", { opacity: 0.6, d: "M24 1.5V9", stroke: "currentColor", strokeWidth: 3, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ w.createElement("path", { opacity: 0.7, d: "M39.9121 8.08594L37.2607 10.7373L34.6094 13.3887", stroke: "currentColor", strokeWidth: 3, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ w.createElement("path", { opacity: 0.8, d: "M46.5 24H39", stroke: "currentColor", strokeWidth: 3, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ w.createElement("path", { opacity: 0.9, d: "M34.6055 34.6055L39.9082 39.9082", stroke: "currentColor", strokeWidth: 3, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ w.createElement("path", { opacity: 0.3, d: "M13.3936 34.6055L8.08594 39.9131", stroke: "currentColor", strokeWidth: 3, strokeLinecap: "round", strokeLinejoin: "round" })), Ue = ({
119
+ size: e = 18,
120
+ cssClass: t,
121
+ iconClass: n,
122
+ fullWidth: a = !0,
123
+ ariaLabel: s = "Loading"
124
+ }) => /* @__PURE__ */ r(
125
+ "div",
126
+ {
127
+ role: "status",
128
+ "aria-label": s,
129
+ name: "loader",
130
+ className: i({
131
+ [Ze]: !0,
132
+ "w-full h-full": a,
133
+ [t || ""]: !!t
134
+ }),
135
+ children: /* @__PURE__ */ r(
136
+ N,
137
+ {
138
+ icon: /* @__PURE__ */ r(
139
+ Ke,
140
+ {
141
+ width: e,
142
+ height: e,
143
+ className: i($e, n),
144
+ role: "img"
145
+ }
146
+ )
147
+ }
148
+ )
149
+ }
150
+ ), Ge = 7, Xe = 2, te = ve(null), ne = () => {
151
+ const e = De(te);
107
152
  if (e == null)
108
153
  throw new Error("Tooltip components must be wrapped in <Tooltip />");
109
154
  return e;
110
- }, ve = ({
155
+ }, qe = ({
111
156
  initialOpen: e = !1,
112
- placement: r = "bottom",
157
+ placement: t = "bottom",
113
158
  isTriggerClickable: n = !1,
114
- open: s,
115
- onOpenChange: o
159
+ open: a,
160
+ onOpenChange: s
116
161
  } = {}) => {
117
- const [l, a] = ae(e), c = ie(null), i = s ?? l, m = o ?? a, d = $({
118
- placement: r,
119
- open: i,
120
- onOpenChange: m,
121
- whileElementsMounted: J,
162
+ const [o, l] = T(e), u = Ne(null), d = a ?? o, c = s ?? l, m = q({
163
+ placement: t,
164
+ open: d,
165
+ onOpenChange: c,
166
+ whileElementsMounted: Me,
122
167
  middleware: [
123
- X(xe + Ne),
124
- Y({
125
- crossAxis: r.includes("-"),
168
+ Ee(Ge + Xe),
169
+ Re({
170
+ crossAxis: t.includes("-"),
126
171
  fallbackAxisSideDirection: "start",
127
172
  padding: 5
128
173
  }),
129
- Z({ padding: 5 }),
130
- q({
131
- element: c
174
+ Fe({ padding: 5 }),
175
+ Te({
176
+ element: u
132
177
  })
133
178
  ]
134
- }), f = Q(d.context, {
179
+ }), f = je(m.context, {
135
180
  move: !1,
136
- enabled: s == null,
181
+ enabled: a == null,
137
182
  mouseOnly: n,
138
183
  delay: { open: 500, close: 0 }
139
- }), T = ee(d.context, {
140
- enabled: s == null
141
- }), k = re(d.context), h = ne(d.context, { role: "tooltip" }), g = te([f, T, k, h]);
142
- return ce(
184
+ }), x = Ve(m.context, {
185
+ enabled: a == null
186
+ }), h = Q(m.context), C = Y(m.context, { role: "tooltip" }), g = J([f, x, h, C]);
187
+ return ke(
143
188
  () => ({
144
- open: i,
145
- setOpen: m,
146
- arrowRef: c,
189
+ open: d,
190
+ setOpen: c,
191
+ arrowRef: u,
147
192
  ...g,
148
- ...d
193
+ ...m
149
194
  }),
150
- [i, m, g, d]
195
+ [d, c, g, m]
151
196
  );
152
- }, we = ({
197
+ }, Qe = ({
153
198
  children: e,
154
- ...r
199
+ ...t
155
200
  }) => {
156
- const n = ve(r);
157
- return /* @__PURE__ */ t(A.Provider, { value: n, children: e });
158
- }, Ce = P(function({ style: r, ...n }, s) {
159
- const o = W(), l = E([o.refs.setFloating, s]);
160
- return o.open ? /* @__PURE__ */ t(se, { id: "tooltip-portal", children: /* @__PURE__ */ p(
201
+ const n = qe(t);
202
+ return /* @__PURE__ */ r(te.Provider, { value: n, children: e });
203
+ }, Ye = X(function({ style: t, ...n }, a) {
204
+ const s = ne(), o = ee([s.refs.setFloating, a]);
205
+ return s.open ? /* @__PURE__ */ r(re, { id: "tooltip-portal", children: /* @__PURE__ */ p(
161
206
  "div",
162
207
  {
163
- ref: l,
208
+ ref: o,
164
209
  style: {
165
- ...o.floatingStyles,
166
- ...r
210
+ ...s.floatingStyles,
211
+ ...t
167
212
  },
168
- ...o.getFloatingProps(n),
169
- className: u(
170
- "z-[55] whitespace-pre-wrap rounded border border-primary bg-blackout px-2 py-1 dial-tiny shadow max-w-[300px]",
171
- o.getFloatingProps(n).className
213
+ ...s.getFloatingProps(n),
214
+ className: i(
215
+ "z-[55] whitespace-pre-wrap break-words rounded border border-primary bg-blackout px-2 py-1 dial-tiny shadow max-w-[300px]",
216
+ s.getFloatingProps(n).className
172
217
  ),
173
218
  children: [
174
219
  n.children,
175
- /* @__PURE__ */ t(
176
- oe,
220
+ /* @__PURE__ */ r(
221
+ Pe,
177
222
  {
178
- ref: o.arrowRef,
179
- context: o.context,
223
+ ref: s.arrowRef,
224
+ context: s.context,
180
225
  fill: "currentColor",
181
226
  strokeWidth: 1,
182
227
  className: "stroke-primary w-2 text-[var(--bg-layer-0,_#000000)]"
@@ -185,71 +230,393 @@ const ge = {
185
230
  ]
186
231
  }
187
232
  ) }) : null;
188
- }), ye = P(function({ children: r, asChild: n = !1, ...s }, o) {
189
- const l = W(), c = r && typeof r == "object" && "ref" in r && r.ref !== void 0 ? r.ref : void 0, i = E([l.refs.setReference, o, c]);
190
- return n && de(r) ? pe(
191
- r,
192
- l.getReferenceProps({
193
- ref: i,
194
- ...s,
195
- ...r.props
233
+ }), Je = X(function({ children: t, asChild: n = !1, ...a }, s) {
234
+ const o = ne(), u = t && typeof t == "object" && "ref" in t && t.ref !== void 0 ? t.ref : void 0, d = ee([o.refs.setReference, s, u]);
235
+ return n && Ie(t) ? Le(
236
+ t,
237
+ o.getReferenceProps({
238
+ ref: d,
239
+ ...a,
240
+ ...t.props
196
241
  })
197
- ) : /* @__PURE__ */ t(
242
+ ) : /* @__PURE__ */ r(
198
243
  "span",
199
244
  {
200
- ref: i,
201
- ...l.getReferenceProps(s),
202
- className: s.className ?? "dial-tooltip-trigger text-left",
203
- children: r
245
+ ref: d,
246
+ ...o.getReferenceProps(a),
247
+ className: a.className ?? "dial-tooltip-trigger text-left",
248
+ children: t
204
249
  }
205
250
  );
206
- }), D = ({
251
+ }), S = ({
207
252
  hideTooltip: e,
208
- tooltip: r,
253
+ tooltip: t,
209
254
  children: n,
210
- triggerClassName: s,
211
- contentClassName: o,
212
- ...l
213
- }) => e || !r ? /* @__PURE__ */ t("span", { className: s, children: n }) : /* @__PURE__ */ p(we, { ...l, children: [
214
- /* @__PURE__ */ t(ye, { className: u(s, "truncate"), children: n }),
215
- /* @__PURE__ */ t(
216
- Ce,
255
+ triggerClassName: a,
256
+ contentClassName: s,
257
+ ...o
258
+ }) => /* @__PURE__ */ p(Qe, { ...o, children: [
259
+ /* @__PURE__ */ r(Je, { className: i(a, "truncate"), children: n }),
260
+ /* @__PURE__ */ r(
261
+ Ye,
217
262
  {
218
- className: u(
263
+ className: i(
219
264
  "text-primary",
220
- o,
265
+ s,
221
266
  "max-w-[300px]",
222
- (e || !r) && "hidden"
267
+ (e || !t) && "hidden"
223
268
  ),
224
- children: r
269
+ children: t
225
270
  }
226
271
  )
227
- ] }), De = ({
272
+ ] }), R = 18, M = {
273
+ size: R,
274
+ stroke: 2
275
+ }, Vr = ({
276
+ label: e,
277
+ id: t,
278
+ checked: n,
279
+ indeterminate: a,
280
+ disabled: s,
281
+ ariaLabel: o,
282
+ onChange: l
283
+ }) => {
284
+ const u = I(
285
+ (m) => {
286
+ m.stopPropagation(), l?.(m.target.checked, t);
287
+ },
288
+ [l, t]
289
+ ), d = i(
290
+ "flex flex-row items-center cursor-pointer text-accent-primary small-medium flex-1 min-w-0",
291
+ `${n ? "" : 'before:content-[""] before:inline-block before:w-[18px] before:h-[18px] before:border before:border-hover before:rounded before:mr-2'}`,
292
+ s ? "pointer-events-none text-secondary before:border-icon-secondary before:bg-layer-4" : ""
293
+ ), c = i(
294
+ "mr-2 border rounded",
295
+ s ? "bg-layer-4 border-icon-secondary" : ""
296
+ );
297
+ return /* @__PURE__ */ p("label", { className: d, htmlFor: t, children: [
298
+ n && (a ? /* @__PURE__ */ r(fe, { className: c, ...M }) : /* @__PURE__ */ r(G, { className: c, ...M })),
299
+ e && /* @__PURE__ */ r(S, { tooltip: e, triggerClassName: "flex-1 min-w-0", children: /* @__PURE__ */ r("p", { className: "text-primary w-full truncate", children: e }) }),
300
+ /* @__PURE__ */ r(
301
+ "input",
302
+ {
303
+ type: "checkbox",
304
+ onChange: u,
305
+ id: t,
306
+ checked: n,
307
+ "aria-checked": a ? "mixed" : n,
308
+ "aria-disabled": s || void 0,
309
+ "aria-label": e ? void 0 : o,
310
+ className: "invisible w-0 h-0"
311
+ }
312
+ )
313
+ ] });
314
+ };
315
+ var b = /* @__PURE__ */ ((e) => (e.VALID = "valid", e.ERROR = "error", e))(b || {});
316
+ const er = (e, t) => {
317
+ if (t === e.id)
318
+ switch (e.status) {
319
+ case b.VALID:
320
+ return "border-accent-secondary text-primary";
321
+ case b.ERROR:
322
+ return "border-red-900 text-primary";
323
+ default:
324
+ return "border-accent-primary text-primary";
325
+ }
326
+ switch (e.status) {
327
+ case b.VALID:
328
+ return "border-primary text-white";
329
+ case b.ERROR:
330
+ return "border-red-900 text-error";
331
+ default:
332
+ return "border-primary text-secondary";
333
+ }
334
+ }, rr = (e, t) => {
335
+ if (t === e.id)
336
+ switch (e.status) {
337
+ case b.VALID:
338
+ return "bg-accent-secondary";
339
+ case b.ERROR:
340
+ return "bg-red-400";
341
+ default:
342
+ return "bg-accent-primary";
343
+ }
344
+ switch (e.status) {
345
+ case b.VALID:
346
+ return "bg-accent-secondary";
347
+ case b.ERROR:
348
+ return "bg-red-400";
349
+ default:
350
+ return "bg-layer-4";
351
+ }
352
+ }, tr = ({
353
+ step: e,
354
+ index: t,
355
+ currentStep: n,
356
+ onChangeStep: a
357
+ }) => {
358
+ const s = "h-[32px] flex flex-1 min-w-[180px] items-center dial-tiny border-t-2 cursor-pointer", o = "w-[22px] h-[22px] flex justify-center items-center mr-2 rounded-full text-white", l = () => n === e.id && e.status === b.ERROR ? /* @__PURE__ */ r(he, { stroke: 2, size: 16 }) : n !== e.id && e.status === b.VALID ? /* @__PURE__ */ r(G, { stroke: 2, size: 16 }) : t + 1;
359
+ return /* @__PURE__ */ p(
360
+ "button",
361
+ {
362
+ className: i(s, er(e, n)),
363
+ onClick: () => a(e.id),
364
+ children: [
365
+ /* @__PURE__ */ r(
366
+ "span",
367
+ {
368
+ className: i(o, rr(e, n)),
369
+ children: l()
370
+ }
371
+ ),
372
+ /* @__PURE__ */ r("span", { children: e.name })
373
+ ]
374
+ }
375
+ );
376
+ }, Pr = ({
377
+ steps: e,
378
+ currentStep: t,
379
+ onChangeStep: n
380
+ }) => {
381
+ const a = (s) => {
382
+ const o = e.findIndex((u) => u.id === t), l = e.findIndex((u) => u.id === s);
383
+ (s !== t && e[o].status === b.VALID || l < o) && n(s);
384
+ };
385
+ return /* @__PURE__ */ r("div", { id: "steps", className: "flex gap-x-3", children: e.map((s, o) => /* @__PURE__ */ r(
386
+ tr,
387
+ {
388
+ currentStep: t,
389
+ onChangeStep: a,
390
+ step: s,
391
+ index: o
392
+ },
393
+ s.id
394
+ )) });
395
+ }, nr = ({
396
+ name: e,
397
+ value: t,
398
+ title: n,
399
+ description: a,
400
+ checked: s = !1,
401
+ inputId: o,
402
+ cssClass: l,
403
+ labelCssClass: u,
404
+ disabled: d,
405
+ onChange: c,
406
+ descriptionCssClass: m
407
+ }) => {
408
+ const f = `${o}-desc`, x = i(
409
+ "dial-small cursor-pointer",
410
+ d ? "text-secondary" : "text-primary",
411
+ u
412
+ ), h = i(
413
+ "cursor-pointer dial-input-radio",
414
+ n && "mr-2",
415
+ l
416
+ ), C = i("flex flex-col", !!a && "mb-2"), g = i(
417
+ "dial-tiny mt-2 ml-[26px] text-secondary",
418
+ m
419
+ );
420
+ return /* @__PURE__ */ p("div", { className: C, children: [
421
+ /* @__PURE__ */ p("div", { className: "flex flex-row items-center", children: [
422
+ /* @__PURE__ */ r(
423
+ "input",
424
+ {
425
+ type: "radio",
426
+ id: o,
427
+ name: e,
428
+ value: t,
429
+ checked: s,
430
+ disabled: d,
431
+ "aria-describedby": s && a ? f : void 0,
432
+ className: h,
433
+ onChange: (D) => {
434
+ d || D.target.checked && c?.(t);
435
+ }
436
+ }
437
+ ),
438
+ n ? /* @__PURE__ */ r("label", { className: x, htmlFor: o, children: n }) : null
439
+ ] }),
440
+ s && a && /* @__PURE__ */ r("div", { id: f, className: g, children: a })
441
+ ] });
442
+ };
443
+ var Z = /* @__PURE__ */ ((e) => (e.Row = "Row", e.Column = "Column", e))(Z || {});
444
+ const ar = "flex flex-col gap-2", sr = "flex", or = "pb-1 mt-2", lr = {
445
+ [Z.Column]: "flex-col gap-y-3",
446
+ [Z.Row]: "flex-row gap-x-6"
447
+ }, Ar = ({
448
+ fieldTitle: e,
449
+ radioCssClass: t,
450
+ labelCssClass: n,
451
+ disabled: a,
452
+ elementId: s,
453
+ radioButtons: o,
454
+ activeRadioButton: l,
455
+ orientation: u,
456
+ onChange: d
457
+ }) => /* @__PURE__ */ p("div", { className: ar, children: [
458
+ e && /* @__PURE__ */ r(H, { fieldTitle: e, htmlFor: s }),
459
+ /* @__PURE__ */ r(
460
+ "div",
461
+ {
462
+ role: "radiogroup",
463
+ "aria-label": e,
464
+ "aria-disabled": a || void 0,
465
+ className: i(
466
+ sr,
467
+ lr[u]
468
+ ),
469
+ children: o.map((c) => /* @__PURE__ */ p("div", { className: "flex flex-col", children: [
470
+ /* @__PURE__ */ r(
471
+ nr,
472
+ {
473
+ name: s,
474
+ value: c.id,
475
+ inputId: c.id,
476
+ disabled: a,
477
+ cssClass: t,
478
+ labelCssClass: n,
479
+ title: c.name,
480
+ checked: c.id === l,
481
+ onChange: () => d(c.id)
482
+ }
483
+ ),
484
+ c.id === l && c.content ? /* @__PURE__ */ r("div", { className: or, children: c.content }) : null
485
+ ] }, c.id))
486
+ }
487
+ )
488
+ ] }), Br = ({
489
+ icon: e,
490
+ title: t,
491
+ description: n
492
+ }) => /* @__PURE__ */ p("div", { className: "h-full w-full flex flex-col items-center justify-center text-secondary", children: [
493
+ e || /* @__PURE__ */ r(xe, { width: 60, height: 60 }),
494
+ /* @__PURE__ */ r("span", { className: "small mt-2 text-primary", children: t }),
495
+ n && /* @__PURE__ */ r("span", { className: "mt-1 text-primary", children: n })
496
+ ] }), ir = 60, Or = ({
497
+ containerCssClass: e,
498
+ children: t,
499
+ width: n,
500
+ title: a,
501
+ iconSize: s = R,
502
+ titleCssClass: o,
503
+ additionalButtons: l
504
+ }) => {
505
+ const [u, d] = T(n), [c, m] = T(!0), f = i([
506
+ "transform rotate-180 [writing-mode:tb-rl]",
507
+ c && "hidden",
508
+ o
509
+ ]), x = i([
510
+ "flex flex-row gap-2 cursor-pointer text-secondary",
511
+ c ? "justify-end" : "justify-center"
512
+ ]), h = () => {
513
+ d(c ? ir : n), m(!c);
514
+ };
515
+ return /* @__PURE__ */ p(
516
+ "div",
517
+ {
518
+ className: i([
519
+ "rounded p-4 flex flex-col justify-between overflow-y-auto flex-shrink-0",
520
+ e
521
+ ]),
522
+ style: { width: `${u}px` },
523
+ children: [
524
+ /* @__PURE__ */ r(
525
+ "div",
526
+ {
527
+ className: i([
528
+ "flex-1 min-h-0 overflow-auto",
529
+ !c && "hidden"
530
+ ]),
531
+ children: t
532
+ }
533
+ ),
534
+ /* @__PURE__ */ r("div", { className: f, children: a }),
535
+ /* @__PURE__ */ p("div", { className: x, children: [
536
+ c && l,
537
+ /* @__PURE__ */ r(
538
+ V,
539
+ {
540
+ cssClass: "hover:text-icon-accent-primary",
541
+ onClick: h,
542
+ iconBefore: c ? /* @__PURE__ */ r(
543
+ ge,
544
+ {
545
+ size: s,
546
+ stroke: M.stroke
547
+ }
548
+ ) : /* @__PURE__ */ r(
549
+ Ce,
550
+ {
551
+ size: s,
552
+ stroke: M.stroke
553
+ }
554
+ )
555
+ }
556
+ )
557
+ ] })
558
+ ]
559
+ }
560
+ );
561
+ }, Wr = ({
562
+ label: e,
563
+ text: t,
564
+ children: n,
565
+ postfix: a
566
+ }) => /* @__PURE__ */ p(
567
+ "div",
568
+ {
569
+ className: i(
570
+ "flex flex-col text-secondary",
571
+ n ? "" : "max-w-[200px]"
572
+ ),
573
+ children: [
574
+ /* @__PURE__ */ r("label", { className: "dial-tiny mb-2", children: e }),
575
+ n || /* @__PURE__ */ p("div", { className: "flex flex-row items-center", children: [
576
+ /* @__PURE__ */ r(S, { triggerClassName: "text-primary", tooltip: t, children: t }),
577
+ a || null
578
+ ] })
579
+ ]
580
+ }
581
+ ), cr = ({
582
+ ariaLabel: e,
583
+ cssClass: t,
584
+ size: n = 24,
585
+ onClose: a
586
+ }) => /* @__PURE__ */ r(
587
+ V,
588
+ {
589
+ ariaLabel: e,
590
+ cssClass: i("text-secondary hover:text-accent-primary", t),
591
+ onClick: a,
592
+ iconBefore: /* @__PURE__ */ r($, { size: n })
593
+ }
594
+ ), dr = ({
228
595
  value: e,
229
- textareaId: r,
596
+ textareaId: t,
230
597
  placeholder: n,
231
- cssClass: s = "",
232
- disabled: o,
233
- invalid: l,
234
- readonly: a,
235
- onChange: c
236
- }) => /* @__PURE__ */ t(D, { tooltip: e, triggerClassName: "flex", children: /* @__PURE__ */ t(
598
+ cssClass: a = "",
599
+ disabled: s,
600
+ invalid: o,
601
+ readonly: l,
602
+ onChange: u
603
+ }) => /* @__PURE__ */ r(S, { tooltip: e, triggerClassName: "flex", children: /* @__PURE__ */ r(
237
604
  "textarea",
238
605
  {
239
- id: r,
606
+ id: t,
240
607
  placeholder: n,
241
608
  value: e || "",
242
- disabled: o,
243
- className: u(
244
- "dial-textarea dial-input",
245
- l ? "dial-input-error" : "",
246
- o && "dial-input-disable",
247
- a && "dial-input-readonly",
248
- s
609
+ disabled: s,
610
+ className: i(
611
+ "dial-textarea dial-input px-3 py-2",
612
+ o ? "dial-input-error" : "",
613
+ s && "dial-input-disable",
614
+ l && "dial-input-readonly",
615
+ a
249
616
  ),
250
- onChange: (i) => !a && c?.(i.currentTarget.value)
617
+ onChange: (d) => !l && u?.(d.currentTarget.value)
251
618
  }
252
- ) }), Te = [
619
+ ) }), ur = [
253
620
  "ArrowLeft",
254
621
  "ArrowRight",
255
622
  "ArrowUp",
@@ -261,271 +628,740 @@ const ge = {
261
628
  "Escape",
262
629
  "Home",
263
630
  "End"
264
- ], ke = (e, r, n, s) => {
265
- if ((r === "number" || n !== void 0 || s !== void 0) && !Te.includes(e.key) && !(e.key === "-" && e.currentTarget.selectionStart === 0 && (n === void 0 || n < 0)) && !(e.key === "." && r === "number" && !e.currentTarget.value.includes("."))) {
631
+ ], pr = (e, t, n, a) => {
632
+ if ((t === "number" || n !== void 0 || a !== void 0) && !ur.includes(e.key) && !(e.key === "-" && e.currentTarget.selectionStart === 0 && (n === void 0 || n < 0)) && !(e.key === "." && t === "number" && !e.currentTarget.value.includes("."))) {
266
633
  if (!/^[0-9]$/.test(e.key)) {
267
634
  e.preventDefault();
268
635
  return;
269
636
  }
270
- if (n !== void 0 || s !== void 0) {
271
- const l = e.currentTarget.value, a = e.currentTarget.selectionStart || 0, c = l.slice(0, a) + e.key + l.slice(a), i = parseFloat(c);
272
- if (!isNaN(i)) {
273
- if (n !== void 0 && i < n) {
637
+ if (n !== void 0 || a !== void 0) {
638
+ const o = e.currentTarget.value, l = e.currentTarget.selectionStart || 0, u = o.slice(0, l) + e.key + o.slice(l), d = parseFloat(u);
639
+ if (!isNaN(d)) {
640
+ if (n !== void 0 && d < n) {
274
641
  e.preventDefault();
275
642
  return;
276
643
  }
277
- if (s !== void 0 && i > s) {
644
+ if (a !== void 0 && d > a) {
278
645
  e.preventDefault();
279
646
  return;
280
647
  }
281
648
  }
282
649
  }
283
650
  }
284
- }, F = ({
285
- iconBeforeInput: e,
286
- iconAfterInput: r,
651
+ }, B = ({
652
+ iconBefore: e,
653
+ iconAfter: t,
287
654
  hideBorder: n,
288
- value: s,
289
- elementId: o,
290
- placeholder: l = "",
291
- cssClass: a = "",
292
- containerCssClass: c,
293
- tooltipTriggerClassName: i,
294
- type: m = "text",
295
- disabled: d,
655
+ value: a,
656
+ elementId: s,
657
+ placeholder: o = "",
658
+ cssClass: l = "",
659
+ containerCssClass: u,
660
+ tooltipTriggerClassName: d,
661
+ type: c = "text",
662
+ disabled: m,
296
663
  readonly: f,
297
- invalid: T,
298
- onChange: k,
299
- min: h,
664
+ invalid: x,
665
+ onChange: h,
666
+ min: C,
300
667
  max: g,
301
- prefix: I,
302
- suffix: R,
303
- textBeforeInput: N,
304
- textAfterInput: v
668
+ prefix: k,
669
+ suffix: D,
670
+ textBeforeInput: y,
671
+ textAfterInput: P
305
672
  }) => {
306
- const L = (b) => b.target.blur(), H = m === "number" || h !== void 0 || g !== void 0, M = (b) => {
307
- ke(b, m, h, g);
308
- }, U = (b) => {
309
- const w = b.currentTarget.value;
310
- if (H && w !== "") {
311
- const y = parseFloat(w);
312
- if (isNaN(y) && w !== "-" && w !== "." || !isNaN(y) && (h !== void 0 && y < h || g !== void 0 && y > g))
673
+ const oe = (L) => L.target.blur(), le = c === "number" || C !== void 0 || g !== void 0, ie = (L) => {
674
+ pr(L, c, C, g);
675
+ }, ce = (L) => {
676
+ const j = L.currentTarget.value;
677
+ if (le && j !== "") {
678
+ const A = parseFloat(j);
679
+ if (isNaN(A) && j !== "-" && j !== "." || !isNaN(A) && (C !== void 0 && A < C || g !== void 0 && A > g))
313
680
  return;
314
681
  }
315
- k?.(w);
682
+ h?.(j);
316
683
  };
317
684
  return /* @__PURE__ */ p(
318
685
  "div",
319
686
  {
320
- className: u(
321
- "dial-input-field flex flex-row items-center justify-between",
687
+ className: i(
688
+ "dial-input-field flex flex-row items-center justify-between py-2",
322
689
  n ? "dial-input-no-border" : "dial-input",
323
- T && "dial-input-error",
324
- d && "dial-input-disable",
690
+ x && "dial-input-error",
691
+ m && "dial-input-disable",
325
692
  f && "dial-input-readonly",
326
- !N && "pl-1",
327
- !v && "pr-1",
328
- c
693
+ !y && "pl-3",
694
+ !P && "pr-3",
695
+ u
329
696
  ),
330
697
  children: [
331
- N && /* @__PURE__ */ t(D, { tooltip: N, children: /* @__PURE__ */ t(
332
- F,
698
+ y && /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
699
+ B,
333
700
  {
334
701
  hideBorder: !0,
335
702
  containerCssClass: "rounded-r-none border-r-0",
336
- cssClass: "px-2 overflow-hidden overflow-ellipsis dial-small",
337
- value: N,
703
+ cssClass: "overflow-hidden overflow-ellipsis dial-small",
704
+ value: y,
338
705
  disabled: !0,
339
- elementId: N + "textBefore"
706
+ elementId: y + "textBefore"
340
707
  }
341
708
  ) }),
342
- I && /* @__PURE__ */ p("p", { className: "text-secondary dial-small pl-2", children: [
709
+ k && /* @__PURE__ */ p("p", { className: "text-secondary dial-small", children: [
343
710
  " ",
344
- I
711
+ k
345
712
  ] }),
346
- /* @__PURE__ */ t(C, { icon: e, className: "pl-2" }),
347
- /* @__PURE__ */ t(D, { tooltip: s, triggerClassName: i, children: /* @__PURE__ */ t(
348
- "input",
713
+ /* @__PURE__ */ r(N, { icon: e }),
714
+ /* @__PURE__ */ r(
715
+ S,
349
716
  {
350
- type: m,
351
- autoComplete: "off",
352
- id: o,
353
- placeholder: l,
354
- value: s ?? "",
355
- title: s ? String(s) : "",
356
- disabled: d,
357
- className: u("border-0 bg-transparent px-2", a),
358
- onChange: (b) => !f && U?.(b),
359
- onKeyDown: M,
360
- onWheel: L,
361
- min: h,
362
- max: g
717
+ tooltip: a,
718
+ triggerClassName: i(d, "flex-1"),
719
+ children: /* @__PURE__ */ r(
720
+ "input",
721
+ {
722
+ type: c,
723
+ autoComplete: "off",
724
+ id: s,
725
+ placeholder: o,
726
+ value: a ?? "",
727
+ disabled: m,
728
+ className: i("border-0 bg-transparent", l),
729
+ onChange: (L) => !f && ce?.(L),
730
+ onKeyDown: ie,
731
+ onWheel: oe,
732
+ min: C,
733
+ max: g
734
+ }
735
+ )
363
736
  }
364
- ) }),
365
- /* @__PURE__ */ t(C, { icon: r, className: "pr-2" }),
366
- R && /* @__PURE__ */ p("p", { className: "text-secondary dial-small pr-2", children: [
737
+ ),
738
+ /* @__PURE__ */ r(N, { icon: t }),
739
+ D && /* @__PURE__ */ p("p", { className: "text-secondary dial-small", children: [
367
740
  " ",
368
- R
741
+ D
369
742
  ] }),
370
- v && /* @__PURE__ */ t(D, { tooltip: v, children: /* @__PURE__ */ t(
371
- F,
743
+ P && /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
744
+ B,
372
745
  {
373
746
  hideBorder: !0,
374
747
  containerCssClass: "rounded-l-none border-l-0",
375
- cssClass: "px-2",
376
- value: v,
748
+ value: P,
377
749
  disabled: !0,
378
- elementId: v + "textAfter"
750
+ elementId: P + "textAfter"
379
751
  }
380
752
  ) })
381
753
  ]
382
754
  }
383
755
  );
384
- }, Fe = /^0+\.(\d+)?$/, Ie = /^0+/, j = ({
756
+ }, mr = /^0+\.(\d+)?$/, fr = /^0+/, ae = ({
385
757
  fieldTitle: e,
386
- errorText: r,
758
+ errorText: t,
387
759
  optional: n,
388
- elementCssClass: s,
389
- elementContainerCssClass: o,
390
- elementId: l,
391
- containerCssClass: a,
392
- readonly: c,
393
- defaultEmptyText: i,
394
- min: m,
395
- max: d,
760
+ elementCssClass: a,
761
+ elementContainerCssClass: s,
762
+ elementId: o,
763
+ containerCssClass: l,
764
+ readonly: u,
765
+ defaultEmptyText: d,
766
+ min: c,
767
+ max: m,
396
768
  ...f
397
- }) => /* @__PURE__ */ p("div", { className: u("flex flex-col", a), children: [
398
- /* @__PURE__ */ t(
399
- z,
769
+ }) => /* @__PURE__ */ p("div", { className: i("flex flex-col", l), children: [
770
+ /* @__PURE__ */ r(
771
+ H,
400
772
  {
401
773
  fieldTitle: e,
402
774
  optional: n,
403
- htmlFor: l
775
+ htmlFor: o
404
776
  }
405
777
  ),
406
- c ? /* @__PURE__ */ t("span", { children: f.value || (i ?? "None") }) : /* @__PURE__ */ p(_, { children: [
407
- /* @__PURE__ */ t(
408
- F,
778
+ u ? /* @__PURE__ */ r("span", { children: f.value || (d ?? "None") }) : /* @__PURE__ */ p(_, { children: [
779
+ /* @__PURE__ */ r(
780
+ B,
409
781
  {
410
- elementId: l,
411
- cssClass: s,
412
- containerCssClass: o,
413
- invalid: r != null,
414
- min: m,
415
- max: d,
782
+ elementId: o,
783
+ cssClass: a,
784
+ containerCssClass: s,
785
+ invalid: t != null,
786
+ min: c,
787
+ max: m,
416
788
  ...f
417
789
  }
418
790
  ),
419
- /* @__PURE__ */ t(S, { errorText: r })
791
+ /* @__PURE__ */ r(z, { errorText: t })
420
792
  ] })
421
- ] }), We = ({
793
+ ] }), zr = ({
422
794
  onChange: e,
423
- value: r,
795
+ value: t,
424
796
  min: n,
425
- max: s,
426
- ...o
797
+ max: a,
798
+ ...s
427
799
  }) => {
428
- const l = (a) => String(a)?.match(Fe) ? String(a)?.replace(Ie, "0") : Number(a);
429
- return /* @__PURE__ */ t(
430
- j,
800
+ const o = (l) => String(l)?.match(mr) ? String(l)?.replace(fr, "0") : Number(l);
801
+ return /* @__PURE__ */ r(
802
+ ae,
431
803
  {
432
804
  type: "number",
433
- onChange: (a) => e?.(l(a)),
434
- value: r,
805
+ onChange: (l) => e?.(o(l)),
806
+ value: t,
435
807
  min: n,
436
- max: s,
437
- ...o
808
+ max: a,
809
+ ...s
438
810
  }
439
811
  );
440
- }, je = ({
812
+ }, Hr = ({
441
813
  onChange: e,
442
- ...r
443
- }) => /* @__PURE__ */ t(
444
- j,
814
+ ...t
815
+ }) => /* @__PURE__ */ r(
816
+ ae,
445
817
  {
446
818
  type: "text",
447
819
  onChange: (n) => e?.(n),
448
- ...r
820
+ ...t
449
821
  }
450
- ), Le = ({
822
+ ), _r = ({
451
823
  fieldTitle: e,
452
- optional: r,
824
+ optional: t,
453
825
  elementId: n,
454
- elementCssClass: s,
455
- errorText: o,
456
- ...l
826
+ elementCssClass: a,
827
+ errorText: s,
828
+ ...o
457
829
  }) => /* @__PURE__ */ p("div", { className: "flex flex-col", children: [
458
- /* @__PURE__ */ t(
459
- z,
830
+ /* @__PURE__ */ r(
831
+ H,
460
832
  {
461
833
  fieldTitle: e,
462
- optional: r,
834
+ optional: t,
463
835
  htmlFor: n
464
836
  }
465
837
  ),
466
- /* @__PURE__ */ t(
467
- De,
838
+ /* @__PURE__ */ r(
839
+ dr,
468
840
  {
469
841
  textareaId: n,
470
- cssClass: s,
471
- ...l
842
+ cssClass: a,
843
+ ...o
472
844
  }
473
845
  ),
474
- /* @__PURE__ */ t(S, { errorText: o })
475
- ] }), He = ({
846
+ /* @__PURE__ */ r(z, { errorText: s })
847
+ ] }), Zr = ({
476
848
  title: e,
477
- switchId: r,
849
+ switchId: t,
478
850
  isOn: n = !1,
479
- disabled: s,
480
- onChange: o
851
+ disabled: a,
852
+ onChange: s
481
853
  }) => {
482
- const l = u(
483
- "flex w-[36px] h-[18px] cursor-pointer items-center gap-1 rounded-full p-0.5 transition-all duration-200",
854
+ const o = i(
855
+ "flex w-[36px] h-[18px] cursor-pointer items-center gap-1 rounded-full p-0.5 transition-all duration-200",
484
856
  n ? "flex-row-reverse" : "flex-row",
485
- s ? "pointer-events-none" : "",
486
- s ? n ? "bg-controls-disable" : "bg-layer-4" : n ? "bg-accent-primary" : "bg-layer-4"
487
- ), a = me(
488
- (c) => {
489
- c.stopPropagation(), o?.(!n);
857
+ a ? "pointer-events-none" : "",
858
+ a ? n ? "bg-controls-disable" : "bg-layer-4" : n ? "bg-accent-primary" : "bg-layer-4"
859
+ ), l = I(
860
+ (u) => {
861
+ u.stopPropagation(), s?.(!n);
490
862
  },
491
- [o, n]
863
+ [s, n]
492
864
  );
493
865
  return /* @__PURE__ */ p("div", { className: "flex flex-row items-center", children: [
494
- /* @__PURE__ */ t(
866
+ /* @__PURE__ */ r(
495
867
  "input",
496
868
  {
497
869
  type: "checkbox",
498
- onChange: a,
499
- id: r,
500
- disabled: s,
870
+ onChange: l,
871
+ id: t,
872
+ disabled: a,
501
873
  className: "invisible w-0 h-0",
502
874
  checked: n
503
875
  }
504
876
  ),
505
- /* @__PURE__ */ t("label", { htmlFor: r, className: l, children: /* @__PURE__ */ t(
877
+ /* @__PURE__ */ r("label", { htmlFor: t, className: o, children: /* @__PURE__ */ r(
506
878
  "span",
507
879
  {
508
- className: u(
880
+ className: i(
509
881
  "size-3 rounded-full",
510
- s ? n ? "bg-controls-disable" : "bg-layer-4" : "bg-controls-enable-primary"
882
+ a ? n ? "bg-layer-4" : "bg-controls-disable" : "bg-controls-enable-primary"
511
883
  )
512
884
  }
513
885
  ) }),
514
- e && /* @__PURE__ */ t("span", { className: "h-[14px] pl-2 small text-primary", children: e })
886
+ e && /* @__PURE__ */ r("span", { className: "pl-2 dial-small text-primary", children: e })
515
887
  ] });
516
888
  };
889
+ var F = /* @__PURE__ */ ((e) => (e.Sm = "sm", e.Md = "md", e.Lg = "lg", e))(F || {});
890
+ const hr = "z-[52] flex items-center justify-center bg-blackout md:p-4", xr = "relative max-h-full rounded bg-layer-3 flex flex-col shadow w-full h-full md:h-auto", gr = "divide-tertiary divide-y", Cr = "flex flex-row justify-between py-4 px-6 items-center", yr = {
891
+ [F.Sm]: "max-w-full md:max-w-[400px]",
892
+ [F.Md]: "max-w-full md:max-w-[800px]",
893
+ [F.Lg]: "max-w-full md:max-w-[1200px]"
894
+ }, br = ({
895
+ open: e = !1,
896
+ title: t,
897
+ portalId: n,
898
+ cssClass: a,
899
+ overlayClass: s,
900
+ headingClass: o,
901
+ dividers: l = !0,
902
+ children: u,
903
+ footer: d,
904
+ onClose: c,
905
+ size: m = F.Md
906
+ }) => {
907
+ const { refs: f, context: x } = q({
908
+ open: e,
909
+ onOpenChange: (y) => {
910
+ y || c?.(null);
911
+ }
912
+ }), h = Y(x, { role: "dialog" }), C = Q(x, { outsidePress: !0 }), { getFloatingProps: g } = J([h, C]);
913
+ if (!e) return null;
914
+ const k = typeof t == "string" ? "dial-popup-heading" : void 0, D = (y) => y ? typeof y == "string" ? /* @__PURE__ */ r(
915
+ "h3",
916
+ {
917
+ id: k,
918
+ className: i(
919
+ "flex-1 min-w-0 mr-3 truncate dial-h3 text-primary",
920
+ o
921
+ ),
922
+ children: /* @__PURE__ */ r(S, { tooltip: y, children: y })
923
+ }
924
+ ) : y : /* @__PURE__ */ r("span", {});
925
+ return /* @__PURE__ */ r(re, { id: n, children: /* @__PURE__ */ r(Ae, { className: i(hr, s), children: /* @__PURE__ */ r(Be, { context: x, children: /* @__PURE__ */ p(
926
+ "div",
927
+ {
928
+ ref: f.setFloating,
929
+ ...g(),
930
+ role: "dialog",
931
+ "aria-modal": "true",
932
+ "aria-labelledby": k,
933
+ className: i(
934
+ xr,
935
+ yr[m],
936
+ l && gr,
937
+ a
938
+ ),
939
+ children: [
940
+ /* @__PURE__ */ p("div", { className: Cr, children: [
941
+ D(t),
942
+ /* @__PURE__ */ r(
943
+ cr,
944
+ {
945
+ ariaLabel: "Close dialog",
946
+ onClose: (y) => c?.(y)
947
+ }
948
+ )
949
+ ] }),
950
+ /* @__PURE__ */ r("div", { className: "flex-grow overflow-auto", children: u }),
951
+ d
952
+ ]
953
+ }
954
+ ) }) }) });
955
+ };
956
+ var O = /* @__PURE__ */ ((e) => (e.Info = "info", e.Danger = "danger", e))(O || {});
957
+ const wr = "flex justify-end gap-2 px-6 py-4", vr = "text-secondary dial-small-150 px-6 py-4", Nr = "Cancel", K = {
958
+ [O.Info]: {
959
+ confirmVariant: v.Primary,
960
+ cancelVariant: v.Secondary
961
+ },
962
+ [O.Danger]: {
963
+ container: "border-t-4 border-error",
964
+ confirmVariant: v.Danger,
965
+ cancelVariant: v.Secondary
966
+ }
967
+ }, $r = ({
968
+ title: e,
969
+ description: t,
970
+ descriptionCssClass: n,
971
+ open: a = !1,
972
+ confirmLabel: s,
973
+ cancelLabel: o = Nr,
974
+ isLoading: l = !1,
975
+ disableConfirmButton: u = !1,
976
+ cssClass: d,
977
+ confirmClassName: c,
978
+ onClose: m,
979
+ onConfirm: f,
980
+ onCancel: x,
981
+ children: h,
982
+ dividers: C = !1,
983
+ variant: g = O.Info,
984
+ size: k = F.Sm
985
+ }) => {
986
+ const D = l ? null : /* @__PURE__ */ p("div", { className: wr, children: [
987
+ /* @__PURE__ */ r(
988
+ V,
989
+ {
990
+ variant: v.Secondary,
991
+ title: o,
992
+ onClick: () => x ? x() : m?.()
993
+ }
994
+ ),
995
+ /* @__PURE__ */ r(
996
+ V,
997
+ {
998
+ variant: K[g].confirmVariant,
999
+ cssClass: c,
1000
+ title: s,
1001
+ disable: u,
1002
+ onClick: () => f()
1003
+ }
1004
+ )
1005
+ ] }), y = I(() => l ? /* @__PURE__ */ r("div", { className: "px-6 py-4 h-[120px]", children: /* @__PURE__ */ r(Ue, { size: 50 }) }) : h ?? (t ? /* @__PURE__ */ r(
1006
+ "div",
1007
+ {
1008
+ className: i(vr, n),
1009
+ children: t
1010
+ }
1011
+ ) : null), [h, t, l, n]);
1012
+ return /* @__PURE__ */ r(
1013
+ br,
1014
+ {
1015
+ open: a,
1016
+ title: e,
1017
+ cssClass: i(K[g].container, d),
1018
+ dividers: C,
1019
+ onClose: () => m?.(),
1020
+ footer: D,
1021
+ size: k,
1022
+ children: y()
1023
+ }
1024
+ );
1025
+ }, kr = ({ onClick: e }) => /* @__PURE__ */ r(
1026
+ ye,
1027
+ {
1028
+ ...M,
1029
+ className: "text-primary",
1030
+ onClick: e
1031
+ }
1032
+ ), Dr = ({ onClick: e }) => /* @__PURE__ */ r(be, { ...M, className: "text-primary", onClick: e }), Ir = ({ ...e }) => {
1033
+ const [t, n] = T(!1), a = I((s) => {
1034
+ n(s);
1035
+ }, []);
1036
+ return /* @__PURE__ */ r(
1037
+ B,
1038
+ {
1039
+ type: t ? "text" : "password",
1040
+ ...e,
1041
+ iconAfter: t ? /* @__PURE__ */ r(kr, { onClick: () => a(!1) }) : /* @__PURE__ */ r(Dr, { onClick: () => a(!0) })
1042
+ }
1043
+ );
1044
+ }, Kr = ({
1045
+ fieldTitle: e,
1046
+ optional: t,
1047
+ elementCssClass: n,
1048
+ elementId: a,
1049
+ errorText: s,
1050
+ ...o
1051
+ }) => /* @__PURE__ */ p("div", { className: "flex flex-col", children: [
1052
+ /* @__PURE__ */ r(
1053
+ H,
1054
+ {
1055
+ fieldTitle: e,
1056
+ optional: t,
1057
+ htmlFor: a
1058
+ }
1059
+ ),
1060
+ /* @__PURE__ */ r(
1061
+ Ir,
1062
+ {
1063
+ cssClass: n,
1064
+ elementId: a,
1065
+ invalid: !!s,
1066
+ ...o
1067
+ }
1068
+ ),
1069
+ /* @__PURE__ */ r(z, { errorText: s })
1070
+ ] });
1071
+ var W = /* @__PURE__ */ ((e) => (e.Small = "small", e.Base = "base", e))(W || {});
1072
+ const Lr = {
1073
+ [W.Small]: {
1074
+ textClass: "text-xs px-1",
1075
+ containerClass: "px-[6px] py-1 h-[22px]",
1076
+ iconSize: 10,
1077
+ iconStroke: 1
1078
+ },
1079
+ [W.Base]: {
1080
+ textClass: "text-sm px-2",
1081
+ containerClass: "px-3 py-2 h-[38px]",
1082
+ iconSize: 18,
1083
+ iconStroke: 1.5
1084
+ }
1085
+ }, Ur = ({
1086
+ elementId: e,
1087
+ value: t,
1088
+ placeholder: n,
1089
+ disabled: a,
1090
+ readonly: s,
1091
+ invalid: o,
1092
+ cssClass: l,
1093
+ containerCssClass: u,
1094
+ onChange: d,
1095
+ size: c = W.Base
1096
+ }) => {
1097
+ const [m, f] = T(t || "");
1098
+ Se(() => {
1099
+ f(t || "");
1100
+ }, [t]);
1101
+ const x = I(
1102
+ (g) => {
1103
+ f(g), d?.(g);
1104
+ },
1105
+ [d]
1106
+ ), h = Lr[c], C = I(() => {
1107
+ x("");
1108
+ }, [x]);
1109
+ return /* @__PURE__ */ p(
1110
+ "div",
1111
+ {
1112
+ className: i(
1113
+ "dial-input flex flex-row items-center justify-between",
1114
+ o && "dial-input-error",
1115
+ a && "dial-input-disable",
1116
+ s && "dial-input-readonly",
1117
+ h.containerClass,
1118
+ u
1119
+ ),
1120
+ children: [
1121
+ /* @__PURE__ */ r(
1122
+ N,
1123
+ {
1124
+ className: i(a ? "text-secondary" : "text-primary"),
1125
+ icon: /* @__PURE__ */ r(
1126
+ we,
1127
+ {
1128
+ size: h.iconSize,
1129
+ stroke: h.iconStroke
1130
+ }
1131
+ )
1132
+ }
1133
+ ),
1134
+ /* @__PURE__ */ r(
1135
+ "input",
1136
+ {
1137
+ id: e,
1138
+ type: "text",
1139
+ autoComplete: "off",
1140
+ placeholder: n,
1141
+ value: m ?? "",
1142
+ disabled: a,
1143
+ readOnly: s,
1144
+ className: i(
1145
+ "border-0 bg-transparent w-full",
1146
+ l,
1147
+ h.textClass
1148
+ ),
1149
+ onChange: (g) => !s && x(g.currentTarget.value)
1150
+ }
1151
+ ),
1152
+ m && !s && !a && /* @__PURE__ */ r(
1153
+ N,
1154
+ {
1155
+ className: "text-primary cursor-pointer",
1156
+ icon: /* @__PURE__ */ r(
1157
+ $,
1158
+ {
1159
+ size: h.iconSize,
1160
+ stroke: h.iconStroke,
1161
+ onClick: C,
1162
+ "aria-label": "Clear search",
1163
+ role: "button"
1164
+ }
1165
+ )
1166
+ }
1167
+ )
1168
+ ]
1169
+ }
1170
+ );
1171
+ }, se = ({ selectedItems: e, listCssClass: t, listElementCssClass: n }) => !!e?.length && /* @__PURE__ */ r(
1172
+ "ul",
1173
+ {
1174
+ className: i(
1175
+ "flex-row items-center truncate flex-wrap",
1176
+ "flex gap-x-2 gap-y-1",
1177
+ t
1178
+ ),
1179
+ children: e?.map((a) => /* @__PURE__ */ r(
1180
+ "li",
1181
+ {
1182
+ className: i([
1183
+ "tiny bg-layer-3 rounded p-1 border border-primary max-w-[200px] truncate",
1184
+ n
1185
+ ]),
1186
+ children: /* @__PURE__ */ r(S, { tooltip: a, children: /* @__PURE__ */ r(
1187
+ "button",
1188
+ {
1189
+ "aria-label": "autocomplete-action",
1190
+ type: "button",
1191
+ className: "truncate w-full",
1192
+ children: a
1193
+ }
1194
+ ) })
1195
+ },
1196
+ a
1197
+ ))
1198
+ }
1199
+ ), U = (e) => /* @__PURE__ */ w.createElement("svg", { width: 18, height: 18, viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ w.createElement("path", { d: "M2.25 13.5V12C2.25 11.5858 2.58579 11.25 3 11.25C3.41421 11.25 3.75 11.5858 3.75 12V13.5C3.75 13.6989 3.82907 13.8896 3.96973 14.0303C4.11038 14.1709 4.30109 14.25 4.5 14.25H6C6.41421 14.25 6.75 14.5858 6.75 15C6.75 15.4142 6.41421 15.75 6 15.75H4.5C3.90326 15.75 3.33114 15.5128 2.90918 15.0908C2.48722 14.6689 2.25 14.0967 2.25 13.5ZM14.25 6V4.5C14.25 4.30109 14.1709 4.11038 14.0303 3.96973C13.8896 3.82907 13.6989 3.75 13.5 3.75H12C11.5858 3.75 11.25 3.41421 11.25 3C11.25 2.58579 11.5858 2.25 12 2.25H13.5C14.0967 2.25 14.6689 2.48722 15.0908 2.90918C15.5128 3.33114 15.75 3.90326 15.75 4.5V6C15.75 6.41421 15.4142 6.75 15 6.75C14.5858 6.75 14.25 6.41421 14.25 6Z", fill: "currentColor" })), Gr = ({
1200
+ children: e,
1201
+ open: t,
1202
+ readonly: n,
1203
+ selectedValue: a,
1204
+ valueCssClasses: s,
1205
+ inputCssClasses: o,
1206
+ onOpen: l,
1207
+ elementId: u,
1208
+ errorText: d,
1209
+ emptyValueText: c
1210
+ }) => {
1211
+ const m = Array.isArray(a) && a.length > 0, f = typeof a == "string" && !!a.trim(), x = m || f ? a : c, h = n ? void 0 : l;
1212
+ return /* @__PURE__ */ p(_, { children: [
1213
+ m ? /* @__PURE__ */ r("div", { className: "w-full", onClick: h, children: /* @__PURE__ */ p(
1214
+ "div",
1215
+ {
1216
+ className: i(
1217
+ "dial-input px-3 py-2 flex flex-row items-center w-full justify-between",
1218
+ n && "dial-input-disable"
1219
+ ),
1220
+ children: [
1221
+ /* @__PURE__ */ r(se, { selectedItems: x }),
1222
+ !n && /* @__PURE__ */ r("div", { className: "ml-1", children: /* @__PURE__ */ r(
1223
+ N,
1224
+ {
1225
+ icon: /* @__PURE__ */ r(
1226
+ U,
1227
+ {
1228
+ role: "img",
1229
+ width: R,
1230
+ height: R
1231
+ }
1232
+ )
1233
+ }
1234
+ ) })
1235
+ ]
1236
+ }
1237
+ ) }) : /* @__PURE__ */ p(_, { children: [
1238
+ /* @__PURE__ */ r(
1239
+ "button",
1240
+ {
1241
+ type: "button",
1242
+ className: "w-full",
1243
+ onClick: h,
1244
+ "aria-label": "open-popup",
1245
+ id: u,
1246
+ children: /* @__PURE__ */ p(
1247
+ "div",
1248
+ {
1249
+ className: i(
1250
+ "dial-input px-3 py-2 dial-input-field flex flex-row items-center w-full justify-between",
1251
+ o,
1252
+ n && "dial-input-disable",
1253
+ d && "dial-input-error"
1254
+ ),
1255
+ children: [
1256
+ /* @__PURE__ */ r(S, { tooltip: String(x), children: /* @__PURE__ */ r("span", { className: s, children: x }) }),
1257
+ !n && /* @__PURE__ */ r("div", { className: "flex-shrink-0", children: /* @__PURE__ */ r(
1258
+ N,
1259
+ {
1260
+ icon: /* @__PURE__ */ r(
1261
+ U,
1262
+ {
1263
+ role: "img",
1264
+ width: R,
1265
+ height: R
1266
+ }
1267
+ )
1268
+ }
1269
+ ) })
1270
+ ]
1271
+ }
1272
+ )
1273
+ }
1274
+ ),
1275
+ d && /* @__PURE__ */ r(z, { errorText: d })
1276
+ ] }),
1277
+ t && Oe(e, document.body)
1278
+ ] });
1279
+ }, Xr = ({
1280
+ placeholder: e = "",
1281
+ selectedItems: t = [],
1282
+ updateSelected: n,
1283
+ listCssClass: a,
1284
+ listElementCssClass: s,
1285
+ containerCssClass: o,
1286
+ inputCssClass: l
1287
+ }) => {
1288
+ const [u, d] = T(""), c = I(
1289
+ (f) => {
1290
+ f.key === "Enter" && (n([...t, f.currentTarget.value]), d("")), (f.key === "Backspace" || f.key === "Delete") && t.length && !u && n(t.slice(0, -1));
1291
+ },
1292
+ [t, n, u]
1293
+ ), m = I(
1294
+ (f) => {
1295
+ d(f.target.value);
1296
+ },
1297
+ [d]
1298
+ );
1299
+ return /* @__PURE__ */ p(
1300
+ "div",
1301
+ {
1302
+ className: i([
1303
+ "dial-input px-3 py-2 flex flex-row items-center flex-wrap w-fit gap-2",
1304
+ o
1305
+ ]),
1306
+ children: [
1307
+ /* @__PURE__ */ r(
1308
+ se,
1309
+ {
1310
+ selectedItems: t,
1311
+ listCssClass: a,
1312
+ listElementCssClass: s
1313
+ }
1314
+ ),
1315
+ /* @__PURE__ */ r(
1316
+ "input",
1317
+ {
1318
+ type: "text",
1319
+ value: u,
1320
+ className: i(["border-0 bg-transparent p-0", l]),
1321
+ placeholder: t?.length ? "" : e,
1322
+ onKeyDown: c,
1323
+ onChange: m
1324
+ }
1325
+ )
1326
+ ]
1327
+ }
1328
+ );
1329
+ };
517
1330
  export {
518
- x as AlertVariant,
519
- Ae as DialAlert,
520
- fe as DialButton,
521
- S as DialErrorText,
522
- z as DialFieldLabel,
523
- C as DialIcon,
524
- F as DialInput,
525
- We as DialNumberInputField,
526
- He as DialSwitch,
527
- Le as DialTextAreaField,
528
- je as DialTextInputField,
529
- De as DialTextarea,
530
- D as DialTooltip
1331
+ E as AlertVariant,
1332
+ v as ButtonVariant,
1333
+ O as ConfirmationPopupVariant,
1334
+ jr as DialAlert,
1335
+ Xr as DialAutocompleteInput,
1336
+ se as DialAutocompleteInputValue,
1337
+ V as DialButton,
1338
+ Vr as DialCheckbox,
1339
+ cr as DialCloseButton,
1340
+ Or as DialCollapsibleSidebar,
1341
+ $r as DialConfirmationPopup,
1342
+ z as DialErrorText,
1343
+ H as DialFieldLabel,
1344
+ N as DialIcon,
1345
+ B as DialInput,
1346
+ Gr as DialInputModal,
1347
+ Wr as DialLabelledText,
1348
+ Ue as DialLoader,
1349
+ Br as DialNoDataContent,
1350
+ zr as DialNumberInputField,
1351
+ Ir as DialPasswordInput,
1352
+ Kr as DialPasswordInputField,
1353
+ br as DialPopup,
1354
+ nr as DialRadioButton,
1355
+ Ar as DialRadioGroup,
1356
+ Ur as DialSearch,
1357
+ Pr as DialSteps,
1358
+ Zr as DialSwitch,
1359
+ _r as DialTextAreaField,
1360
+ Hr as DialTextInputField,
1361
+ dr as DialTextarea,
1362
+ S as DialTooltip,
1363
+ F as PopupSize,
1364
+ Z as RadioGroupOrientation,
1365
+ W as SearchSize,
1366
+ b as StepStatus
531
1367
  };