@epam/ai-dial-ui-kit 0.3.0-rc.1 → 0.3.0-rc.3

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,226 +1,226 @@
1
- import { jsx as r, jsxs as m, Fragment as Z } from "react/jsx-runtime";
2
- import i from "classnames";
3
- import { IconCircleCheck as me, IconAlertTriangle as fe, IconAlertCircle as he, IconInfoCircle as xe, IconX as $, IconMinus as ge, IconCheck as Y, IconExclamationCircle as ye, IconClipboardX as Ce, IconChevronsLeft as be, IconChevronsRight as ve, IconEyeOff as we, IconEye as Ne, IconSearch as ke } from "@tabler/icons-react";
4
- import * as N from "react";
5
- import { createContext as De, useState as S, useRef as J, useMemo as Ie, useContext as Re, forwardRef as ee, isValidElement as Se, cloneElement as Ee, useCallback as E, useEffect as re } from "react";
6
- import { useFloating as te, offset as Le, flip as Te, shift as Fe, arrow as Ve, autoUpdate as Ae, useHover as je, useFocus as Me, useDismiss as ne, useRole as ae, useInteractions as se, useMergeRefs as oe, FloatingPortal as le, FloatingArrow as Pe, FloatingOverlay as Oe, FloatingFocusManager as We } from "@floating-ui/react";
7
- import { createPortal as ze } from "react-dom";
8
- const W = ({ errorText: e }) => e && /* @__PURE__ */ r("span", { className: "text-error dial-tiny mt-1", children: e }), z = ({
1
+ import { jsx as r, jsxs as p, Fragment as Z } from "react/jsx-runtime";
2
+ import l from "classnames";
3
+ import { IconCircleCheck as Ae, IconAlertTriangle as Ve, IconAlertCircle as Oe, IconInfoCircle as je, IconX as J, IconMinus as We, IconCheck as ce, IconExclamationCircle as Be, IconClipboardX as ze, IconChevronsLeft as He, IconChevronsRight as _e, IconEyeOff as $e, IconEye as Ge, IconSearch as Ke } from "@tabler/icons-react";
4
+ import * as L from "react";
5
+ import { createContext as Ue, useState as F, useRef as de, useMemo as Ze, useContext as Xe, forwardRef as ue, isValidElement as qe, cloneElement as Qe, useCallback as R, useEffect as ee, useId as Ye } from "react";
6
+ import { useFloating as re, offset as pe, flip as fe, shift as me, arrow as Je, autoUpdate as he, useHover as xe, useFocus as er, useDismiss as ne, useRole as te, useInteractions as se, useMergeRefs as ge, FloatingPortal as ae, FloatingArrow as rr, FloatingOverlay as nr, FloatingFocusManager as Ce, autoPlacement as tr, size as sr, useClick as ar } from "@floating-ui/react";
7
+ import { createPortal as or } from "react-dom";
8
+ const K = ({ errorText: e }) => e && /* @__PURE__ */ r("span", { className: "text-error dial-tiny mt-1", children: e }), $ = ({
9
9
  fieldTitle: e,
10
- htmlFor: t,
11
- optional: n,
12
- optionalText: a,
13
- cssClass: s
14
- }) => e ? /* @__PURE__ */ m(
10
+ htmlFor: n,
11
+ optional: t,
12
+ optionalText: s,
13
+ cssClass: a
14
+ }) => e ? /* @__PURE__ */ p(
15
15
  "label",
16
16
  {
17
- className: i(
17
+ className: l(
18
18
  "dial-tiny text-secondary",
19
- s,
20
- !s?.includes("mb") && "mb-2"
19
+ a,
20
+ !a?.includes("mb") && "mb-2"
21
21
  ),
22
- htmlFor: t,
22
+ htmlFor: n,
23
23
  children: [
24
24
  /* @__PURE__ */ r("span", { className: "min-h-4", children: e }),
25
- n && /* @__PURE__ */ r("span", { className: "ml-1", children: a ?? "(Optional)" })
25
+ t && /* @__PURE__ */ r("span", { className: "ml-1", children: s ?? "(Optional)" })
26
26
  ]
27
27
  }
28
- ) : null, R = ({ icon: e, className: t }) => e ? /* @__PURE__ */ r("span", { className: i("flex-shrink-0", t), children: e }) : null;
29
- var I = /* @__PURE__ */ ((e) => (e.Primary = "primary", e.Secondary = "secondary", e.Tertiary = "tertiary", e.Danger = "danger", e))(I || {});
30
- const Be = {
31
- [I.Primary]: "dial-primary-button",
32
- [I.Secondary]: "dial-secondary-button",
33
- [I.Tertiary]: "dial-tertiary-button",
34
- [I.Danger]: "dial-danger-button"
35
- }, j = ({
28
+ ) : null, M = ({ icon: e, className: n }) => e ? /* @__PURE__ */ r("span", { className: l("flex-shrink-0", n), children: e }) : null;
29
+ var D = /* @__PURE__ */ ((e) => (e.Primary = "primary", e.Secondary = "secondary", e.Tertiary = "tertiary", e.Danger = "danger", e))(D || {});
30
+ const lr = {
31
+ [D.Primary]: "dial-primary-button",
32
+ [D.Secondary]: "dial-secondary-button",
33
+ [D.Tertiary]: "dial-tertiary-button",
34
+ [D.Danger]: "dial-danger-button"
35
+ }, V = ({
36
36
  title: e,
37
- variant: t,
38
- cssClass: n,
39
- textCssClass: a,
40
- ref: s,
37
+ variant: n,
38
+ cssClass: t,
39
+ textCssClass: s,
40
+ ref: a,
41
41
  onClick: o,
42
42
  disable: c,
43
43
  iconAfter: u,
44
44
  iconBefore: d,
45
- hideTitleOnMobile: l,
46
- ariaLabel: p
45
+ hideTitleOnMobile: i,
46
+ ariaLabel: f
47
47
  }) => {
48
- const f = i(
48
+ const m = l(
49
49
  "dial-small-semi",
50
50
  u ? "mr-2" : "",
51
51
  d ? "ml-2" : "",
52
- l ? "hidden sm:inline" : "inline",
53
- a
54
- ), x = i(
55
- t && Be[t],
56
- n,
52
+ i ? "hidden sm:inline" : "inline",
53
+ s
54
+ ), g = l(
55
+ n && lr[n],
56
+ t,
57
57
  "focus-visible:outline outline-offset-0"
58
58
  );
59
- return /* @__PURE__ */ m(
59
+ return /* @__PURE__ */ p(
60
60
  "button",
61
61
  {
62
- ref: s,
62
+ ref: a,
63
63
  type: "button",
64
- className: x,
65
- onClick: (h) => o?.(h),
64
+ className: g,
65
+ onClick: (x) => o?.(x),
66
66
  disabled: c,
67
- "aria-label": e || p,
67
+ "aria-label": e || f,
68
68
  children: [
69
- /* @__PURE__ */ r(R, { icon: d }),
70
- e && /* @__PURE__ */ r("span", { className: f, children: e }),
71
- /* @__PURE__ */ r(R, { icon: u })
69
+ /* @__PURE__ */ r(M, { icon: d }),
70
+ e && /* @__PURE__ */ r("span", { className: m, children: e }),
71
+ /* @__PURE__ */ r(M, { icon: u })
72
72
  ]
73
73
  }
74
74
  );
75
75
  };
76
- var F = /* @__PURE__ */ ((e) => (e.Info = "info", e.Success = "success", e.Warning = "warning", e.Error = "error", e))(F || {});
77
- const He = {
78
- info: /* @__PURE__ */ r(xe, { size: 24, stroke: 2 }),
79
- error: /* @__PURE__ */ r(he, { size: 24, stroke: 2 }),
80
- warning: /* @__PURE__ */ r(fe, { size: 24, stroke: 2 }),
81
- success: /* @__PURE__ */ r(me, { size: 24, stroke: 2 })
82
- }, _e = {
83
- [F.Info]: "bg-info border-info text-info",
84
- [F.Success]: "bg-success border-success text-success",
85
- [F.Warning]: "bg-warning border-warning text-warning",
86
- [F.Error]: "bg-error border-error text-error"
87
- }, Ke = "items-center justify-between gap-2 p-3 border border-solid dial-small-150 rounded flex", Mr = ({
88
- variant: e = F.Info,
89
- message: t,
90
- cssClass: n,
91
- closable: a = !1,
92
- onClose: s
93
- }) => /* @__PURE__ */ m(
76
+ var B = /* @__PURE__ */ ((e) => (e.Info = "info", e.Success = "success", e.Warning = "warning", e.Error = "error", e))(B || {});
77
+ const ir = {
78
+ info: /* @__PURE__ */ r(je, { size: 24, stroke: 2 }),
79
+ error: /* @__PURE__ */ r(Oe, { size: 24, stroke: 2 }),
80
+ warning: /* @__PURE__ */ r(Ve, { size: 24, stroke: 2 }),
81
+ success: /* @__PURE__ */ r(Ae, { size: 24, stroke: 2 })
82
+ }, cr = {
83
+ [B.Info]: "bg-info border-info text-info",
84
+ [B.Success]: "bg-success border-success text-success",
85
+ [B.Warning]: "bg-warning border-warning text-warning",
86
+ [B.Error]: "bg-error border-error text-error"
87
+ }, dr = "items-center justify-between gap-2 p-3 border border-solid dial-small-150 rounded flex", dn = ({
88
+ variant: e = B.Info,
89
+ message: n,
90
+ cssClass: t,
91
+ closable: s = !1,
92
+ onClose: a
93
+ }) => /* @__PURE__ */ p(
94
94
  "div",
95
95
  {
96
96
  role: "alert",
97
- className: i(
98
- Ke,
99
- _e[e],
100
- n
97
+ className: l(
98
+ dr,
99
+ cr[e],
100
+ t
101
101
  ),
102
102
  children: [
103
- /* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
104
- /* @__PURE__ */ r(R, { icon: He[e] }),
105
- /* @__PURE__ */ r("div", { className: "text-primary", children: t })
103
+ /* @__PURE__ */ p("div", { className: "flex items-center gap-2", children: [
104
+ /* @__PURE__ */ r(M, { icon: ir[e] }),
105
+ /* @__PURE__ */ r("div", { className: "text-primary", children: n })
106
106
  ] }),
107
- a && /* @__PURE__ */ r(
108
- j,
107
+ s && /* @__PURE__ */ r(
108
+ V,
109
109
  {
110
110
  cssClass: "ml-2 text-secondary hover:text-primary",
111
111
  ariaLabel: "Close alert",
112
- iconBefore: /* @__PURE__ */ r($, { size: 16 }),
113
- onClick: (o) => s?.(o)
112
+ iconBefore: /* @__PURE__ */ r(J, { size: 16 }),
113
+ onClick: (o) => a?.(o)
114
114
  }
115
115
  )
116
116
  ]
117
117
  }
118
- ), $e = "flex items-center justify-center text-secondary", Ge = "shrink-0 grow-0 basis-auto animate-spin-steps", Ze = (e) => /* @__PURE__ */ N.createElement("svg", { viewBox: "0 0 48 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ N.createElement("path", { d: "M24 39V46.5", stroke: "currentColor", strokeWidth: 3, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ N.createElement("path", { opacity: 0.4, d: "M9 24H1.5", stroke: "currentColor", strokeWidth: 3, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ N.createElement("path", { opacity: 0.5, d: "M8.0918 8.0918L13.3994 13.3994", stroke: "currentColor", strokeWidth: 3, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ N.createElement("path", { opacity: 0.6, d: "M24 1.5V9", stroke: "currentColor", strokeWidth: 3, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ N.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__ */ N.createElement("path", { opacity: 0.8, d: "M46.5 24H39", stroke: "currentColor", strokeWidth: 3, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ N.createElement("path", { opacity: 0.9, d: "M34.6055 34.6055L39.9082 39.9082", stroke: "currentColor", strokeWidth: 3, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ N.createElement("path", { opacity: 0.3, d: "M13.3936 34.6055L8.08594 39.9131", stroke: "currentColor", strokeWidth: 3, strokeLinecap: "round", strokeLinejoin: "round" })), Ue = ({
118
+ ), ur = "flex items-center justify-center text-secondary", pr = "shrink-0 grow-0 basis-auto animate-spin-steps", fr = (e) => /* @__PURE__ */ L.createElement("svg", { viewBox: "0 0 48 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ L.createElement("path", { d: "M24 39V46.5", stroke: "currentColor", strokeWidth: 3, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ L.createElement("path", { opacity: 0.4, d: "M9 24H1.5", stroke: "currentColor", strokeWidth: 3, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ L.createElement("path", { opacity: 0.5, d: "M8.0918 8.0918L13.3994 13.3994", stroke: "currentColor", strokeWidth: 3, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ L.createElement("path", { opacity: 0.6, d: "M24 1.5V9", stroke: "currentColor", strokeWidth: 3, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ L.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__ */ L.createElement("path", { opacity: 0.8, d: "M46.5 24H39", stroke: "currentColor", strokeWidth: 3, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ L.createElement("path", { opacity: 0.9, d: "M34.6055 34.6055L39.9082 39.9082", stroke: "currentColor", strokeWidth: 3, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ L.createElement("path", { opacity: 0.3, d: "M13.3936 34.6055L8.08594 39.9131", stroke: "currentColor", strokeWidth: 3, strokeLinecap: "round", strokeLinejoin: "round" })), mr = ({
119
119
  size: e = 18,
120
- cssClass: t,
121
- iconClass: n,
122
- fullWidth: a = !0,
123
- ariaLabel: s = "Loading"
120
+ cssClass: n,
121
+ iconClass: t,
122
+ fullWidth: s = !0,
123
+ ariaLabel: a = "Loading"
124
124
  }) => /* @__PURE__ */ r(
125
125
  "div",
126
126
  {
127
127
  role: "status",
128
- "aria-label": s,
129
- className: i({
130
- [$e]: !0,
131
- "w-full h-full": a,
132
- [t || ""]: !!t
128
+ "aria-label": a,
129
+ className: l({
130
+ [ur]: !0,
131
+ "w-full h-full": s,
132
+ [n || ""]: !!n
133
133
  }),
134
134
  children: /* @__PURE__ */ r(
135
- R,
135
+ M,
136
136
  {
137
137
  icon: /* @__PURE__ */ r(
138
- Ze,
138
+ fr,
139
139
  {
140
140
  width: e,
141
141
  height: e,
142
- className: i(Ge, n),
142
+ className: l(pr, t),
143
143
  role: "img"
144
144
  }
145
145
  )
146
146
  }
147
147
  )
148
148
  }
149
- ), Xe = 7, qe = 2, ie = De(null), ce = () => {
150
- const e = Re(ie);
149
+ ), hr = 7, xr = 2, ye = Ue(null), be = () => {
150
+ const e = Xe(ye);
151
151
  if (e == null)
152
152
  throw new Error("Tooltip components must be wrapped in <Tooltip />");
153
153
  return e;
154
- }, Qe = ({
154
+ }, gr = ({
155
155
  initialOpen: e = !1,
156
- placement: t = "bottom",
157
- isTriggerClickable: n = !1,
158
- open: a,
159
- onOpenChange: s
156
+ placement: n = "bottom",
157
+ isTriggerClickable: t = !1,
158
+ open: s,
159
+ onOpenChange: a
160
160
  } = {}) => {
161
- const [o, c] = S(e), u = J(null), d = a ?? o, l = s ?? c, p = te({
162
- placement: t,
161
+ const [o, c] = F(e), u = de(null), d = s ?? o, i = a ?? c, f = re({
162
+ placement: n,
163
163
  open: d,
164
- onOpenChange: l,
165
- whileElementsMounted: Ae,
164
+ onOpenChange: i,
165
+ whileElementsMounted: he,
166
166
  middleware: [
167
- Le(Xe + qe),
168
- Te({
169
- crossAxis: t.includes("-"),
167
+ pe(hr + xr),
168
+ fe({
169
+ crossAxis: n.includes("-"),
170
170
  fallbackAxisSideDirection: "start",
171
171
  padding: 5
172
172
  }),
173
- Fe({ padding: 5 }),
174
- Ve({
173
+ me({ padding: 5 }),
174
+ Je({
175
175
  element: u
176
176
  })
177
177
  ]
178
- }), f = je(p.context, {
178
+ }), m = xe(f.context, {
179
179
  move: !1,
180
- enabled: a == null,
181
- mouseOnly: n,
180
+ enabled: s == null,
181
+ mouseOnly: t,
182
182
  delay: { open: 500, close: 0 }
183
- }), x = Me(p.context, {
184
- enabled: a == null
185
- }), h = ne(p.context), C = ae(p.context, { role: "tooltip" }), g = se([f, x, h, C]);
186
- return Ie(
183
+ }), g = er(f.context, {
184
+ enabled: s == null
185
+ }), x = ne(f.context), v = te(f.context, { role: "tooltip" }), y = se([m, g, x, v]);
186
+ return Ze(
187
187
  () => ({
188
188
  open: d,
189
- setOpen: l,
189
+ setOpen: i,
190
190
  arrowRef: u,
191
- ...g,
192
- ...p
191
+ ...y,
192
+ ...f
193
193
  }),
194
- [d, l, g, p]
194
+ [d, i, y, f]
195
195
  );
196
- }, Ye = ({
196
+ }, Cr = ({
197
197
  children: e,
198
- ...t
198
+ ...n
199
199
  }) => {
200
- const n = Qe(t);
201
- return /* @__PURE__ */ r(ie.Provider, { value: n, children: e });
202
- }, Je = ee(function({ style: t, ...n }, a) {
203
- const s = ce(), o = oe([s.refs.setFloating, a]);
204
- return s.open ? /* @__PURE__ */ r(le, { id: "tooltip-portal", children: /* @__PURE__ */ m(
200
+ const t = gr(n);
201
+ return /* @__PURE__ */ r(ye.Provider, { value: t, children: e });
202
+ }, yr = ue(function({ style: n, ...t }, s) {
203
+ const a = be(), o = ge([a.refs.setFloating, s]);
204
+ return a.open ? /* @__PURE__ */ r(ae, { id: "tooltip-portal", children: /* @__PURE__ */ p(
205
205
  "div",
206
206
  {
207
207
  ref: o,
208
208
  style: {
209
- ...s.floatingStyles,
210
- ...t
209
+ ...a.floatingStyles,
210
+ ...n
211
211
  },
212
- ...s.getFloatingProps(n),
213
- className: i(
212
+ ...a.getFloatingProps(t),
213
+ className: l(
214
214
  "z-[55] whitespace-pre-wrap break-words rounded border border-primary bg-blackout px-2 py-1 dial-tiny shadow max-w-[300px]",
215
- s.getFloatingProps(n).className
215
+ a.getFloatingProps(t).className
216
216
  ),
217
217
  children: [
218
- n.children,
218
+ t.children,
219
219
  /* @__PURE__ */ r(
220
- Pe,
220
+ rr,
221
221
  {
222
- ref: s.arrowRef,
223
- context: s.context,
222
+ ref: a.arrowRef,
223
+ context: a.context,
224
224
  fill: "currentColor",
225
225
  strokeWidth: 1,
226
226
  className: "stroke-primary w-2 text-[var(--bg-layer-0,_#000000)]"
@@ -229,142 +229,144 @@ const He = {
229
229
  ]
230
230
  }
231
231
  ) }) : null;
232
- }), er = ee(function({ children: t, asChild: n = !1, ...a }, s) {
233
- const o = ce(), u = t && typeof t == "object" && "ref" in t && t.ref !== void 0 ? t.ref : void 0, d = oe([o.refs.setReference, s, u]);
234
- return n && Se(t) ? Ee(
235
- t,
232
+ }), br = ue(function({ children: n, asChild: t = !1, ...s }, a) {
233
+ const o = be(), u = n && typeof n == "object" && "ref" in n && n.ref !== void 0 ? n.ref : void 0, d = ge([o.refs.setReference, a, u]);
234
+ return t && qe(n) ? Qe(
235
+ n,
236
236
  o.getReferenceProps({
237
237
  ref: d,
238
- ...a,
239
- ...t.props
238
+ ...s,
239
+ ...n.props
240
240
  })
241
241
  ) : /* @__PURE__ */ r(
242
242
  "span",
243
243
  {
244
244
  ref: d,
245
- ...o.getReferenceProps(a),
246
- className: a.className ?? "dial-tooltip-trigger text-left",
247
- children: t
245
+ ...o.getReferenceProps(s),
246
+ className: s.className ?? "dial-tooltip-trigger text-left",
247
+ children: n
248
248
  }
249
249
  );
250
- }), T = ({
250
+ }), O = ({
251
251
  hideTooltip: e,
252
- tooltip: t,
253
- children: n,
254
- triggerClassName: a,
255
- contentClassName: s,
252
+ tooltip: n,
253
+ children: t,
254
+ triggerClassName: s,
255
+ contentClassName: a,
256
256
  ...o
257
- }) => /* @__PURE__ */ m(Ye, { ...o, children: [
258
- /* @__PURE__ */ r(er, { className: i(a, "truncate"), children: n }),
257
+ }) => /* @__PURE__ */ p(Cr, { ...o, children: [
258
+ /* @__PURE__ */ r(br, { className: l(s, "truncate"), children: t }),
259
259
  /* @__PURE__ */ r(
260
- Je,
260
+ yr,
261
261
  {
262
- className: i(
262
+ className: l(
263
263
  "text-primary",
264
- s,
264
+ a,
265
265
  "max-w-[300px]",
266
- (e || !t) && "hidden"
266
+ (e || !n) && "hidden"
267
267
  ),
268
- children: t
268
+ children: n
269
269
  }
270
270
  )
271
- ] }), V = 18, M = {
272
- size: V,
271
+ ] }), z = 18, _ = {
272
+ size: z,
273
273
  stroke: 2
274
- }, Pr = ({
274
+ }, un = ({
275
275
  label: e,
276
- id: t,
277
- checked: n,
278
- indeterminate: a,
279
- disabled: s,
276
+ id: n,
277
+ checked: t,
278
+ indeterminate: s,
279
+ disabled: a,
280
280
  ariaLabel: o,
281
281
  onChange: c
282
282
  }) => {
283
- const u = E(
284
- (p) => {
285
- p.stopPropagation(), c?.(p.target.checked, t);
283
+ const u = R(
284
+ (m) => {
285
+ c?.(m.target.checked, n);
286
286
  },
287
- [c, t]
288
- ), d = i(
287
+ [c, n]
288
+ ), d = l(
289
289
  "flex flex-row items-center cursor-pointer text-accent-primary small-medium flex-1 min-w-0",
290
- `${n ? "" : 'before:content-[""] before:inline-block before:w-[18px] before:h-[18px] before:border before:border-hover before:rounded before:mr-2'}`,
291
- s ? "pointer-events-none text-secondary before:border-icon-secondary before:bg-layer-4" : ""
292
- ), l = i(
290
+ `${t || s ? "" : 'before:content-[""] before:inline-block before:w-[18px] before:h-[18px] before:border before:border-hover before:rounded before:mr-2'}`,
291
+ a ? "pointer-events-none text-secondary before:border-icon-secondary before:bg-layer-4" : ""
292
+ ), i = l(
293
293
  "mr-2 border rounded",
294
- s ? "bg-layer-4 border-icon-secondary" : ""
294
+ a ? "bg-layer-4 border-icon-secondary" : ""
295
295
  );
296
- return /* @__PURE__ */ m("label", { className: d, htmlFor: t, children: [
297
- n && (a ? /* @__PURE__ */ r(ge, { className: l, ...M }) : /* @__PURE__ */ r(Y, { className: l, ...M })),
298
- e && /* @__PURE__ */ r(T, { tooltip: e, triggerClassName: "flex-1 min-w-0", children: /* @__PURE__ */ r("p", { className: "text-primary w-full truncate", children: e }) }),
296
+ return /* @__PURE__ */ p("label", { className: d, htmlFor: n, children: [
297
+ s ? /* @__PURE__ */ r(We, { className: i, ..._ }) : t ? /* @__PURE__ */ r(ce, { className: i, ..._ }) : null,
298
+ e && /* @__PURE__ */ r(O, { tooltip: e, triggerClassName: "flex-1 min-w-0", children: /* @__PURE__ */ r("p", { className: "text-primary w-full truncate", children: e }) }),
299
299
  /* @__PURE__ */ r(
300
300
  "input",
301
301
  {
302
302
  type: "checkbox",
303
+ role: "checkbox",
304
+ name: n,
303
305
  onChange: u,
304
- id: t,
305
- checked: n,
306
- "aria-checked": a ? "mixed" : n,
307
- "aria-disabled": s || void 0,
306
+ id: n,
307
+ checked: t,
308
+ "aria-checked": s ? "mixed" : t,
309
+ "aria-disabled": a || void 0,
308
310
  "aria-label": e ? void 0 : o,
309
311
  className: "invisible w-0 h-0"
310
312
  }
311
313
  )
312
314
  ] });
313
315
  };
314
- var w = /* @__PURE__ */ ((e) => (e.VALID = "valid", e.ERROR = "error", e))(w || {});
315
- const rr = (e, t) => {
316
- if (t === e.id)
316
+ var I = /* @__PURE__ */ ((e) => (e.VALID = "valid", e.ERROR = "error", e))(I || {});
317
+ const vr = (e, n) => {
318
+ if (n === e.id)
317
319
  switch (e.status) {
318
- case w.VALID:
320
+ case I.VALID:
319
321
  return "border-accent-secondary text-primary";
320
- case w.ERROR:
322
+ case I.ERROR:
321
323
  return "border-red-900 text-primary";
322
324
  default:
323
325
  return "border-accent-primary text-primary";
324
326
  }
325
327
  switch (e.status) {
326
- case w.VALID:
328
+ case I.VALID:
327
329
  return "border-primary text-white";
328
- case w.ERROR:
330
+ case I.ERROR:
329
331
  return "border-red-900 text-error";
330
332
  default:
331
333
  return "border-primary text-secondary";
332
334
  }
333
- }, tr = (e, t) => {
334
- if (t === e.id)
335
+ }, wr = (e, n) => {
336
+ if (n === e.id)
335
337
  switch (e.status) {
336
- case w.VALID:
338
+ case I.VALID:
337
339
  return "bg-accent-secondary";
338
- case w.ERROR:
340
+ case I.ERROR:
339
341
  return "bg-red-400";
340
342
  default:
341
343
  return "bg-accent-primary";
342
344
  }
343
345
  switch (e.status) {
344
- case w.VALID:
346
+ case I.VALID:
345
347
  return "bg-accent-secondary";
346
- case w.ERROR:
348
+ case I.ERROR:
347
349
  return "bg-red-400";
348
350
  default:
349
351
  return "bg-layer-4";
350
352
  }
351
- }, nr = ({
353
+ }, Nr = ({
352
354
  step: e,
353
- index: t,
354
- currentStep: n,
355
- onChangeStep: a
355
+ index: n,
356
+ currentStep: t,
357
+ onChangeStep: s
356
358
  }) => {
357
- 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", c = () => n === e.id && e.status === w.ERROR ? /* @__PURE__ */ r(ye, { stroke: 2, size: 16 }) : n !== e.id && e.status === w.VALID ? /* @__PURE__ */ r(Y, { stroke: 2, size: 16 }) : t + 1;
358
- return /* @__PURE__ */ m(
359
+ 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", c = () => t === e.id && e.status === I.ERROR ? /* @__PURE__ */ r(Be, { stroke: 2, size: 16 }) : t !== e.id && e.status === I.VALID ? /* @__PURE__ */ r(ce, { stroke: 2, size: 16 }) : n + 1;
360
+ return /* @__PURE__ */ p(
359
361
  "button",
360
362
  {
361
- className: i(s, rr(e, n)),
362
- onClick: () => a(e.id),
363
+ className: l(a, vr(e, t)),
364
+ onClick: () => s(e.id),
363
365
  children: [
364
366
  /* @__PURE__ */ r(
365
367
  "span",
366
368
  {
367
- className: i(o, tr(e, n)),
369
+ className: l(o, wr(e, t)),
368
370
  children: c()
369
371
  }
370
372
  ),
@@ -372,149 +374,149 @@ const rr = (e, t) => {
372
374
  ]
373
375
  }
374
376
  );
375
- }, Or = ({
377
+ }, pn = ({
376
378
  steps: e,
377
- currentStep: t,
378
- onChangeStep: n
379
+ currentStep: n,
380
+ onChangeStep: t
379
381
  }) => {
380
- const a = (s) => {
381
- const o = e.findIndex((u) => u.id === t), c = e.findIndex((u) => u.id === s);
382
- (s !== t && e[o].status === w.VALID || c < o) && n(s);
382
+ const s = (a) => {
383
+ const o = e.findIndex((u) => u.id === n), c = e.findIndex((u) => u.id === a);
384
+ (a !== n && e[o].status === I.VALID || c < o) && t(a);
383
385
  };
384
- return /* @__PURE__ */ r("div", { id: "steps", className: "flex gap-x-3", children: e.map((s, o) => /* @__PURE__ */ r(
385
- nr,
386
+ return /* @__PURE__ */ r("div", { id: "steps", className: "flex gap-x-3", children: e.map((a, o) => /* @__PURE__ */ r(
387
+ Nr,
386
388
  {
387
- currentStep: t,
388
- onChangeStep: a,
389
- step: s,
389
+ currentStep: n,
390
+ onChangeStep: s,
391
+ step: a,
390
392
  index: o
391
393
  },
392
- s.id
394
+ a.id
393
395
  )) });
394
- }, ar = ({
396
+ }, kr = ({
395
397
  name: e,
396
- value: t,
397
- title: n,
398
- description: a,
399
- checked: s = !1,
398
+ value: n,
399
+ title: t,
400
+ description: s,
401
+ checked: a = !1,
400
402
  inputId: o,
401
403
  cssClass: c,
402
404
  labelCssClass: u,
403
405
  disabled: d,
404
- onChange: l,
405
- descriptionCssClass: p
406
+ onChange: i,
407
+ descriptionCssClass: f
406
408
  }) => {
407
- const f = `${o}-desc`, x = i(
409
+ const m = `${o}-desc`, g = l(
408
410
  "dial-small cursor-pointer",
409
411
  d ? "text-secondary" : "text-primary",
410
412
  u
411
- ), h = i(
413
+ ), x = l(
412
414
  "cursor-pointer dial-input-radio",
413
- n && "mr-2",
415
+ t && "mr-2",
414
416
  c
415
- ), C = i("flex flex-col", !!a && "mb-2"), g = i(
417
+ ), v = l("flex flex-col", !!s && "mb-2"), y = l(
416
418
  "dial-tiny mt-2 ml-[26px] text-secondary",
417
- p
419
+ f
418
420
  );
419
- return /* @__PURE__ */ m("div", { className: C, children: [
420
- /* @__PURE__ */ m("div", { className: "flex flex-row items-center", children: [
421
+ return /* @__PURE__ */ p("div", { className: v, children: [
422
+ /* @__PURE__ */ p("div", { className: "flex flex-row items-center", children: [
421
423
  /* @__PURE__ */ r(
422
424
  "input",
423
425
  {
424
426
  type: "radio",
425
427
  id: o,
426
428
  name: e,
427
- value: t,
428
- checked: s,
429
+ value: n,
430
+ checked: a,
429
431
  disabled: d,
430
- "aria-describedby": s && a ? f : void 0,
431
- className: h,
432
- onChange: (D) => {
433
- d || D.target.checked && l?.(t);
432
+ "aria-describedby": a && s ? m : void 0,
433
+ className: x,
434
+ onChange: (N) => {
435
+ d || N.target.checked && i?.(n);
434
436
  }
435
437
  }
436
438
  ),
437
- n ? /* @__PURE__ */ r("label", { className: x, htmlFor: o, children: n }) : null
439
+ t ? /* @__PURE__ */ r("label", { className: g, htmlFor: o, children: t }) : null
438
440
  ] }),
439
- s && a && /* @__PURE__ */ r("div", { id: f, className: g, children: a })
441
+ a && s && /* @__PURE__ */ r("div", { id: m, className: y, children: s })
440
442
  ] });
441
443
  };
442
- var U = /* @__PURE__ */ ((e) => (e.Row = "Row", e.Column = "Column", e))(U || {});
443
- const sr = "flex flex-col gap-2", or = "flex", lr = "pb-1 mt-2", ir = {
444
- [U.Column]: "flex-col gap-y-3",
445
- [U.Row]: "flex-row gap-x-6"
446
- }, Wr = ({
444
+ var X = /* @__PURE__ */ ((e) => (e.Row = "Row", e.Column = "Column", e))(X || {});
445
+ const Dr = "flex flex-col gap-2", Ir = "flex", Rr = "pb-1 mt-2", Er = {
446
+ [X.Column]: "flex-col gap-y-3",
447
+ [X.Row]: "flex-row gap-x-6"
448
+ }, Sr = ({
447
449
  fieldTitle: e,
448
- radioCssClass: t,
449
- labelCssClass: n,
450
- disabled: a,
451
- elementId: s,
450
+ radioCssClass: n,
451
+ labelCssClass: t,
452
+ disabled: s,
453
+ elementId: a,
452
454
  radioButtons: o,
453
455
  activeRadioButton: c,
454
456
  orientation: u,
455
457
  onChange: d
456
- }) => /* @__PURE__ */ m("div", { className: sr, children: [
457
- e && /* @__PURE__ */ r(z, { fieldTitle: e, htmlFor: s }),
458
+ }) => /* @__PURE__ */ p("div", { className: Dr, children: [
459
+ e && /* @__PURE__ */ r($, { fieldTitle: e, htmlFor: a }),
458
460
  /* @__PURE__ */ r(
459
461
  "div",
460
462
  {
461
463
  role: "radiogroup",
462
464
  "aria-label": e,
463
- "aria-disabled": a || void 0,
464
- className: i(
465
- or,
466
- ir[u]
465
+ "aria-disabled": s || void 0,
466
+ className: l(
467
+ Ir,
468
+ Er[u]
467
469
  ),
468
- children: o.map((l) => /* @__PURE__ */ m("div", { className: "flex flex-col", children: [
470
+ children: o.map((i) => /* @__PURE__ */ p("div", { className: "flex flex-col", children: [
469
471
  /* @__PURE__ */ r(
470
- ar,
472
+ kr,
471
473
  {
472
- name: s,
473
- value: l.id,
474
- inputId: l.id,
475
- disabled: a,
476
- cssClass: t,
477
- labelCssClass: n,
478
- title: l.name,
479
- checked: l.id === c,
480
- onChange: () => d(l.id)
474
+ name: a,
475
+ value: i.id,
476
+ inputId: i.id,
477
+ disabled: s,
478
+ cssClass: n,
479
+ labelCssClass: t,
480
+ title: i.name,
481
+ checked: i.id === c,
482
+ onChange: () => d(i.id)
481
483
  }
482
484
  ),
483
- l.id === c && l.content ? /* @__PURE__ */ r("div", { className: lr, children: l.content }) : null
484
- ] }, l.id))
485
+ i.id === c && i.content ? /* @__PURE__ */ r("div", { className: Rr, children: i.content }) : null
486
+ ] }, i.id))
485
487
  }
486
488
  )
487
- ] }), zr = ({
489
+ ] }), fn = ({
488
490
  icon: e,
489
- title: t,
490
- description: n
491
- }) => /* @__PURE__ */ m("div", { className: "h-full w-full flex flex-col items-center justify-center text-secondary", children: [
492
- e || /* @__PURE__ */ r(Ce, { width: 60, height: 60 }),
493
- /* @__PURE__ */ r("span", { className: "small mt-2 text-primary", children: t }),
494
- n && /* @__PURE__ */ r("span", { className: "mt-1 text-primary", children: n })
495
- ] }), cr = 60, Br = ({
491
+ title: n,
492
+ description: t
493
+ }) => /* @__PURE__ */ p("div", { className: "h-full w-full flex flex-col items-center justify-center text-secondary", children: [
494
+ e || /* @__PURE__ */ r(ze, { width: 60, height: 60 }),
495
+ /* @__PURE__ */ r("span", { className: "small mt-2 text-primary", children: n }),
496
+ t && /* @__PURE__ */ r("span", { className: "mt-1 text-primary", children: t })
497
+ ] }), Lr = 60, mn = ({
496
498
  containerCssClass: e,
497
- children: t,
498
- width: n,
499
- title: a,
500
- iconSize: s = V,
499
+ children: n,
500
+ width: t,
501
+ title: s,
502
+ iconSize: a = z,
501
503
  titleCssClass: o,
502
504
  additionalButtons: c
503
505
  }) => {
504
- const [u, d] = S(n), [l, p] = S(!0), f = i([
506
+ const [u, d] = F(t), [i, f] = F(!0), m = l([
505
507
  "transform rotate-180 [writing-mode:tb-rl]",
506
- l && "hidden",
508
+ i && "hidden",
507
509
  o
508
- ]), x = i([
510
+ ]), g = l([
509
511
  "flex flex-row gap-2 cursor-pointer text-secondary",
510
- l ? "justify-end" : "justify-center"
511
- ]), h = () => {
512
- d(l ? cr : n), p(!l);
512
+ i ? "justify-end" : "justify-center"
513
+ ]), x = () => {
514
+ d(i ? Lr : t), f(!i);
513
515
  };
514
- return /* @__PURE__ */ m(
516
+ return /* @__PURE__ */ p(
515
517
  "div",
516
518
  {
517
- className: i([
519
+ className: l([
518
520
  "rounded p-4 flex flex-col justify-between overflow-y-auto flex-shrink-0",
519
521
  e
520
522
  ]),
@@ -523,32 +525,32 @@ const sr = "flex flex-col gap-2", or = "flex", lr = "pb-1 mt-2", ir = {
523
525
  /* @__PURE__ */ r(
524
526
  "div",
525
527
  {
526
- className: i([
528
+ className: l([
527
529
  "flex-1 min-h-0 overflow-auto",
528
- !l && "hidden"
530
+ !i && "hidden"
529
531
  ]),
530
- children: t
532
+ children: n
531
533
  }
532
534
  ),
533
- /* @__PURE__ */ r("div", { className: f, children: a }),
534
- /* @__PURE__ */ m("div", { className: x, children: [
535
- l && c,
535
+ /* @__PURE__ */ r("div", { className: m, children: s }),
536
+ /* @__PURE__ */ p("div", { className: g, children: [
537
+ i && c,
536
538
  /* @__PURE__ */ r(
537
- j,
539
+ V,
538
540
  {
539
541
  cssClass: "hover:text-icon-accent-primary",
540
- onClick: h,
541
- iconBefore: l ? /* @__PURE__ */ r(
542
- be,
542
+ onClick: x,
543
+ iconBefore: i ? /* @__PURE__ */ r(
544
+ He,
543
545
  {
544
- size: s,
545
- stroke: M.stroke
546
+ size: a,
547
+ stroke: _.stroke
546
548
  }
547
549
  ) : /* @__PURE__ */ r(
548
- ve,
550
+ _e,
549
551
  {
550
- size: s,
551
- stroke: M.stroke
552
+ size: a,
553
+ stroke: _.stroke
552
554
  }
553
555
  )
554
556
  }
@@ -557,85 +559,85 @@ const sr = "flex flex-col gap-2", or = "flex", lr = "pb-1 mt-2", ir = {
557
559
  ]
558
560
  }
559
561
  );
560
- }, Hr = ({
562
+ }, hn = ({
561
563
  label: e,
562
- text: t,
563
- children: n,
564
- postfix: a
565
- }) => /* @__PURE__ */ m(
564
+ text: n,
565
+ children: t,
566
+ postfix: s
567
+ }) => /* @__PURE__ */ p(
566
568
  "div",
567
569
  {
568
- className: i(
570
+ className: l(
569
571
  "flex flex-col text-secondary",
570
- n ? "" : "max-w-[200px]"
572
+ t ? "" : "max-w-[200px]"
571
573
  ),
572
574
  children: [
573
575
  /* @__PURE__ */ r("label", { className: "dial-tiny mb-2", children: e }),
574
- n || /* @__PURE__ */ m("div", { className: "flex flex-row items-center", children: [
575
- /* @__PURE__ */ r(T, { triggerClassName: "text-primary", tooltip: t, children: t }),
576
- a || null
576
+ t || /* @__PURE__ */ p("div", { className: "flex flex-row items-center", children: [
577
+ /* @__PURE__ */ r(O, { triggerClassName: "text-primary", tooltip: n, children: n }),
578
+ s || null
577
579
  ] })
578
580
  ]
579
581
  }
580
582
  );
581
- var X = /* @__PURE__ */ ((e) => (e.Default = "default", e))(X || {});
582
- const dr = {
583
- [X.Default]: "border-icon-secondary bg-layer-3"
583
+ var oe = /* @__PURE__ */ ((e) => (e.Default = "default", e))(oe || {});
584
+ const Fr = {
585
+ [oe.Default]: "border-icon-secondary bg-layer-3"
584
586
  // TODO: Add other variants here once they are finalized with the UI/UX team
585
- }, ur = ({
587
+ }, Mr = ({
586
588
  tag: e,
587
- cssClass: t,
588
- remove: n,
589
- variant: a = X.Default
589
+ cssClass: n,
590
+ remove: t,
591
+ variant: s = oe.Default
590
592
  }) => {
591
- const s = dr[a], o = i(
593
+ const a = Fr[s], o = l(
592
594
  "flex items-center gap-1 tiny border rounded p-1 h-[22px] text-primary",
593
- t,
594
- s
595
+ n,
596
+ a
595
597
  );
596
- return /* @__PURE__ */ m("div", { className: o, children: [
598
+ return /* @__PURE__ */ p("div", { className: o, children: [
597
599
  /* @__PURE__ */ r("span", { children: e }),
598
- n && /* @__PURE__ */ r(j, { iconAfter: /* @__PURE__ */ r($, { size: 16 }), onClick: n })
600
+ t && /* @__PURE__ */ r(V, { iconAfter: /* @__PURE__ */ r(J, { size: 16 }), onClick: t })
599
601
  ] }, e);
600
- }, pr = ({
602
+ }, ve = ({
601
603
  ariaLabel: e,
602
- cssClass: t,
603
- size: n = 24,
604
- onClose: a
604
+ cssClass: n,
605
+ size: t = 24,
606
+ onClose: s
605
607
  }) => /* @__PURE__ */ r(
606
- j,
608
+ V,
607
609
  {
608
610
  ariaLabel: e,
609
- cssClass: i("text-secondary hover:text-accent-primary", t),
610
- onClick: a,
611
- iconBefore: /* @__PURE__ */ r($, { size: n })
611
+ cssClass: l("text-secondary hover:text-accent-primary", n),
612
+ onClick: s,
613
+ iconBefore: /* @__PURE__ */ r(J, { size: t })
612
614
  }
613
- ), mr = ({
615
+ ), Pr = ({
614
616
  value: e,
615
- textareaId: t,
616
- placeholder: n,
617
- cssClass: a = "",
618
- disabled: s,
617
+ textareaId: n,
618
+ placeholder: t,
619
+ cssClass: s = "",
620
+ disabled: a,
619
621
  invalid: o,
620
622
  readonly: c,
621
623
  onChange: u
622
- }) => /* @__PURE__ */ r(T, { tooltip: e, triggerClassName: "flex", children: /* @__PURE__ */ r(
624
+ }) => /* @__PURE__ */ r(O, { tooltip: e, triggerClassName: "flex", children: /* @__PURE__ */ r(
623
625
  "textarea",
624
626
  {
625
- id: t,
626
- placeholder: n,
627
+ id: n,
628
+ placeholder: t,
627
629
  value: e || "",
628
- disabled: s,
629
- className: i(
630
+ disabled: a,
631
+ className: l(
630
632
  "dial-textarea dial-input px-3 py-2",
631
633
  o ? "dial-input-error" : "",
632
- s && "dial-input-disable",
634
+ a && "dial-input-disable",
633
635
  c && "dial-input-readonly",
634
- a
636
+ s
635
637
  ),
636
638
  onChange: (d) => !c && u?.(d.currentTarget.value)
637
639
  }
638
- ) }), fr = [
640
+ ) }), Tr = [
639
641
  "ArrowLeft",
640
642
  "ArrowRight",
641
643
  "ArrowUp",
@@ -647,75 +649,75 @@ const dr = {
647
649
  "Escape",
648
650
  "Home",
649
651
  "End"
650
- ], hr = (e, t, n, a) => {
651
- if ((t === "number" || n !== void 0 || a !== void 0) && !fr.includes(e.key) && !(e.key === "-" && e.currentTarget.selectionStart === 0 && (n === void 0 || n < 0)) && !(e.key === "." && t === "number" && !e.currentTarget.value.includes("."))) {
652
+ ], Ar = (e, n, t, s) => {
653
+ if ((n === "number" || t !== void 0 || s !== void 0) && !Tr.includes(e.key) && !(e.key === "-" && e.currentTarget.selectionStart === 0 && (t === void 0 || t < 0)) && !(e.key === "." && n === "number" && !e.currentTarget.value.includes("."))) {
652
654
  if (!/^[0-9]$/.test(e.key)) {
653
655
  e.preventDefault();
654
656
  return;
655
657
  }
656
- if (n !== void 0 || a !== void 0) {
658
+ if (t !== void 0 || s !== void 0) {
657
659
  const o = e.currentTarget.value, c = e.currentTarget.selectionStart || 0, u = o.slice(0, c) + e.key + o.slice(c), d = parseFloat(u);
658
660
  if (!isNaN(d)) {
659
- if (n !== void 0 && d < n) {
661
+ if (t !== void 0 && d < t) {
660
662
  e.preventDefault();
661
663
  return;
662
664
  }
663
- if (a !== void 0 && d > a) {
665
+ if (s !== void 0 && d > s) {
664
666
  e.preventDefault();
665
667
  return;
666
668
  }
667
669
  }
668
670
  }
669
671
  }
670
- }, H = ({
672
+ }, q = ({
671
673
  iconBefore: e,
672
- iconAfter: t,
673
- hideBorder: n,
674
- value: a,
675
- elementId: s,
674
+ iconAfter: n,
675
+ hideBorder: t,
676
+ value: s,
677
+ elementId: a,
676
678
  placeholder: o = "",
677
679
  cssClass: c = "",
678
680
  containerCssClass: u,
679
681
  tooltipTriggerClassName: d,
680
- type: l = "text",
681
- disabled: p,
682
- readonly: f,
683
- invalid: x,
684
- onChange: h,
685
- min: C,
686
- max: g,
682
+ type: i = "text",
683
+ disabled: f,
684
+ readonly: m,
685
+ invalid: g,
686
+ onChange: x,
687
+ min: v,
688
+ max: y,
687
689
  prefix: k,
688
- suffix: D,
690
+ suffix: N,
689
691
  textBeforeInput: b,
690
- textAfterInput: y
692
+ textAfterInput: C
691
693
  }) => {
692
- const v = (L) => L.target.blur(), P = l === "number" || C !== void 0 || g !== void 0, G = (L) => {
693
- hr(L, l, C, g);
694
- }, pe = (L) => {
695
- const O = L.currentTarget.value;
696
- if (P && O !== "") {
697
- const B = parseFloat(O);
698
- if (isNaN(B) && O !== "-" && O !== "." || !isNaN(B) && (C !== void 0 && B < C || g !== void 0 && B > g))
694
+ const w = (E) => E.target.blur(), A = i === "number" || v !== void 0 || y !== void 0, P = (E) => {
695
+ Ar(E, i, v, y);
696
+ }, j = (E) => {
697
+ const S = E.currentTarget.value;
698
+ if (A && S !== "") {
699
+ const W = parseFloat(S);
700
+ if (isNaN(W) && S !== "-" && S !== "." || !isNaN(W) && (v !== void 0 && W < v || y !== void 0 && W > y))
699
701
  return;
700
702
  }
701
- h?.(O);
703
+ x?.(S);
702
704
  };
703
- return /* @__PURE__ */ m(
705
+ return /* @__PURE__ */ p(
704
706
  "div",
705
707
  {
706
- className: i(
708
+ className: l(
707
709
  "dial-input-field flex flex-row items-center justify-between py-2",
708
- n ? "dial-input-no-border" : "dial-input",
709
- x && "dial-input-error",
710
- p && "dial-input-disable",
711
- f && "dial-input-readonly",
710
+ t ? "dial-input-no-border" : "dial-input",
711
+ g && "dial-input-error",
712
+ f && "dial-input-disable",
713
+ m && "dial-input-readonly",
712
714
  !b && "pl-3",
713
- !y && "pr-3",
715
+ !C && "pr-3",
714
716
  u
715
717
  ),
716
718
  children: [
717
719
  b && /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
718
- H,
720
+ q,
719
721
  {
720
722
  hideBorder: !0,
721
723
  containerCssClass: "rounded-r-none border-r-0",
@@ -725,244 +727,244 @@ const dr = {
725
727
  elementId: b + "textBefore"
726
728
  }
727
729
  ) }),
728
- k && /* @__PURE__ */ m("p", { className: "text-secondary dial-small", children: [
730
+ k && /* @__PURE__ */ p("p", { className: "text-secondary dial-small", children: [
729
731
  " ",
730
732
  k
731
733
  ] }),
732
- /* @__PURE__ */ r(R, { icon: e }),
734
+ /* @__PURE__ */ r(M, { icon: e }),
733
735
  /* @__PURE__ */ r(
734
- T,
736
+ O,
735
737
  {
736
- tooltip: a,
737
- triggerClassName: i(d, "flex-1"),
738
+ tooltip: s,
739
+ triggerClassName: l(d, "flex-1"),
738
740
  children: /* @__PURE__ */ r(
739
741
  "input",
740
742
  {
741
- type: l,
743
+ type: i,
742
744
  autoComplete: "off",
743
- id: s,
745
+ id: a,
744
746
  placeholder: o,
745
- value: a ?? "",
746
- disabled: p,
747
- className: i("border-0 bg-transparent", c),
748
- onChange: (L) => !f && pe?.(L),
749
- onKeyDown: G,
750
- onWheel: v,
751
- min: C,
752
- max: g
747
+ value: s ?? "",
748
+ disabled: f,
749
+ className: l("border-0 bg-transparent", c),
750
+ onChange: (E) => !m && j?.(E),
751
+ onKeyDown: P,
752
+ onWheel: w,
753
+ min: v,
754
+ max: y
753
755
  }
754
756
  )
755
757
  }
756
758
  ),
757
- /* @__PURE__ */ r(R, { icon: t }),
758
- D && /* @__PURE__ */ m("p", { className: "text-secondary dial-small", children: [
759
+ /* @__PURE__ */ r(M, { icon: n }),
760
+ N && /* @__PURE__ */ p("p", { className: "text-secondary dial-small", children: [
759
761
  " ",
760
- D
762
+ N
761
763
  ] }),
762
- y && /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
763
- H,
764
+ C && /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
765
+ q,
764
766
  {
765
767
  hideBorder: !0,
766
768
  containerCssClass: "rounded-l-none border-l-0",
767
- value: y,
769
+ value: C,
768
770
  disabled: !0,
769
- elementId: y + "textAfter"
771
+ elementId: C + "textAfter"
770
772
  }
771
773
  ) })
772
774
  ]
773
775
  }
774
776
  );
775
- }, xr = /^0+\.(\d+)?$/, gr = /^0+/, de = ({
777
+ }, Vr = /^0+\.(\d+)?$/, Or = /^0+/, we = ({
776
778
  fieldTitle: e,
777
- errorText: t,
778
- optional: n,
779
- elementCssClass: a,
780
- elementContainerCssClass: s,
779
+ errorText: n,
780
+ optional: t,
781
+ elementCssClass: s,
782
+ elementContainerCssClass: a,
781
783
  elementId: o,
782
784
  containerCssClass: c,
783
785
  readonly: u,
784
786
  defaultEmptyText: d,
785
- min: l,
786
- max: p,
787
- ...f
788
- }) => /* @__PURE__ */ m("div", { className: i("flex flex-col", c), children: [
787
+ min: i,
788
+ max: f,
789
+ ...m
790
+ }) => /* @__PURE__ */ p("div", { className: l("flex flex-col", c), children: [
789
791
  /* @__PURE__ */ r(
790
- z,
792
+ $,
791
793
  {
792
794
  fieldTitle: e,
793
- optional: n,
795
+ optional: t,
794
796
  htmlFor: o
795
797
  }
796
798
  ),
797
- u ? /* @__PURE__ */ r("span", { children: f.value || (d ?? "None") }) : /* @__PURE__ */ m(Z, { children: [
799
+ u ? /* @__PURE__ */ r("span", { children: m.value || (d ?? "None") }) : /* @__PURE__ */ p(Z, { children: [
798
800
  /* @__PURE__ */ r(
799
- H,
801
+ q,
800
802
  {
801
803
  elementId: o,
802
- cssClass: a,
803
- containerCssClass: s,
804
- invalid: t != null,
805
- min: l,
806
- max: p,
807
- ...f
804
+ cssClass: s,
805
+ containerCssClass: a,
806
+ invalid: n != null,
807
+ min: i,
808
+ max: f,
809
+ ...m
808
810
  }
809
811
  ),
810
- /* @__PURE__ */ r(W, { errorText: t })
812
+ /* @__PURE__ */ r(K, { errorText: n })
811
813
  ] })
812
- ] }), _r = ({
814
+ ] }), xn = ({
813
815
  onChange: e,
814
- value: t,
815
- min: n,
816
- max: a,
817
- ...s
816
+ value: n,
817
+ min: t,
818
+ max: s,
819
+ ...a
818
820
  }) => {
819
- const o = (c) => String(c)?.match(xr) ? String(c)?.replace(gr, "0") : Number(c);
821
+ const o = (c) => String(c)?.match(Vr) ? String(c)?.replace(Or, "0") : Number(c);
820
822
  return /* @__PURE__ */ r(
821
- de,
823
+ we,
822
824
  {
823
825
  type: "number",
824
826
  onChange: (c) => e?.(o(c)),
825
- value: t,
826
- min: n,
827
- max: a,
828
- ...s
827
+ value: n,
828
+ min: t,
829
+ max: s,
830
+ ...a
829
831
  }
830
832
  );
831
- }, Kr = ({
833
+ }, gn = ({
832
834
  onChange: e,
833
- ...t
835
+ ...n
834
836
  }) => /* @__PURE__ */ r(
835
- de,
837
+ we,
836
838
  {
837
839
  type: "text",
838
- onChange: (n) => e?.(n),
839
- ...t
840
+ onChange: (t) => e?.(t),
841
+ ...n
840
842
  }
841
- ), $r = ({
843
+ ), Cn = ({
842
844
  fieldTitle: e,
843
- optional: t,
844
- elementId: n,
845
- elementCssClass: a,
846
- errorText: s,
845
+ optional: n,
846
+ elementId: t,
847
+ elementCssClass: s,
848
+ errorText: a,
847
849
  ...o
848
- }) => /* @__PURE__ */ m("div", { className: "flex flex-col", children: [
850
+ }) => /* @__PURE__ */ p("div", { className: "flex flex-col", children: [
849
851
  /* @__PURE__ */ r(
850
- z,
852
+ $,
851
853
  {
852
854
  fieldTitle: e,
853
- optional: t,
854
- htmlFor: n
855
+ optional: n,
856
+ htmlFor: t
855
857
  }
856
858
  ),
857
859
  /* @__PURE__ */ r(
858
- mr,
860
+ Pr,
859
861
  {
860
- textareaId: n,
861
- cssClass: a,
862
+ textareaId: t,
863
+ cssClass: s,
862
864
  ...o
863
865
  }
864
866
  ),
865
- /* @__PURE__ */ r(W, { errorText: s })
866
- ] }), Gr = ({
867
+ /* @__PURE__ */ r(K, { errorText: a })
868
+ ] }), yn = ({
867
869
  title: e,
868
- switchId: t,
869
- isOn: n = !1,
870
- disabled: a,
871
- onChange: s
870
+ switchId: n,
871
+ isOn: t = !1,
872
+ disabled: s,
873
+ onChange: a
872
874
  }) => {
873
- const o = i(
875
+ const o = l(
874
876
  "flex w-[36px] h-[18px] cursor-pointer items-center gap-1 rounded-full p-0.5 transition-all duration-200",
875
- n ? "flex-row-reverse" : "flex-row",
876
- a ? "pointer-events-none" : "",
877
- a ? n ? "bg-controls-disable" : "bg-layer-4" : n ? "bg-accent-primary" : "bg-layer-4"
878
- ), c = E(
877
+ t ? "flex-row-reverse" : "flex-row",
878
+ s ? "pointer-events-none" : "",
879
+ s ? t ? "bg-controls-disable" : "bg-layer-4" : t ? "bg-accent-primary" : "bg-layer-4"
880
+ ), c = R(
879
881
  (u) => {
880
- u.stopPropagation(), s?.(!n);
882
+ u.stopPropagation(), a?.(!t);
881
883
  },
882
- [s, n]
884
+ [a, t]
883
885
  );
884
- return /* @__PURE__ */ m("div", { className: "flex flex-row items-center", children: [
886
+ return /* @__PURE__ */ p("div", { className: "flex flex-row items-center", children: [
885
887
  /* @__PURE__ */ r(
886
888
  "input",
887
889
  {
888
890
  type: "checkbox",
889
891
  onChange: c,
890
- id: t,
891
- disabled: a,
892
+ id: n,
893
+ disabled: s,
892
894
  className: "invisible w-0 h-0",
893
- checked: n
895
+ checked: t
894
896
  }
895
897
  ),
896
- /* @__PURE__ */ r("label", { htmlFor: t, className: o, children: /* @__PURE__ */ r(
898
+ /* @__PURE__ */ r("label", { htmlFor: n, className: o, children: /* @__PURE__ */ r(
897
899
  "span",
898
900
  {
899
- className: i(
901
+ className: l(
900
902
  "size-3 rounded-full",
901
- a ? n ? "bg-layer-4" : "bg-controls-disable" : "bg-controls-enable-primary"
903
+ s ? t ? "bg-layer-4" : "bg-controls-disable" : "bg-controls-enable-primary"
902
904
  )
903
905
  }
904
906
  ) }),
905
907
  e && /* @__PURE__ */ r("span", { className: "pl-2 dial-small text-primary", children: e })
906
908
  ] });
907
909
  };
908
- var A = /* @__PURE__ */ ((e) => (e.Sm = "sm", e.Md = "md", e.Lg = "lg", e))(A || {});
909
- const yr = "z-[52] flex items-center justify-center bg-blackout md:p-4", Cr = "divide-tertiary divide-y", br = "flex flex-row justify-between py-4 px-6 items-center", vr = {
910
- [A.Sm]: "dial-sm-popup",
911
- [A.Md]: "dial-md-popup",
912
- [A.Lg]: "dial-lg-popup"
913
- }, wr = ({
910
+ var H = /* @__PURE__ */ ((e) => (e.Sm = "sm", e.Md = "md", e.Lg = "lg", e))(H || {});
911
+ const jr = "z-[52] flex items-center justify-center bg-blackout md:p-4", Wr = "divide-tertiary divide-y", Br = "flex flex-row justify-between py-4 px-6 items-center", zr = {
912
+ [H.Sm]: "dial-sm-popup",
913
+ [H.Md]: "dial-md-popup",
914
+ [H.Lg]: "dial-lg-popup"
915
+ }, Ne = ({
914
916
  open: e = !1,
915
- title: t,
916
- portalId: n,
917
- cssClass: a,
918
- overlayClass: s,
917
+ title: n,
918
+ portalId: t,
919
+ cssClass: s,
920
+ overlayClass: a,
919
921
  headingClass: o,
920
922
  dividers: c = !0,
921
923
  children: u,
922
924
  footer: d,
923
- onClose: l,
924
- size: p = A.Md
925
+ onClose: i,
926
+ size: f = H.Md
925
927
  }) => {
926
- const { refs: f, context: x } = te({
928
+ const { refs: m, context: g } = re({
927
929
  open: e,
928
930
  onOpenChange: (b) => {
929
- b || l?.(null);
931
+ b || i?.(null);
930
932
  }
931
- }), h = ae(x, { role: "dialog" }), C = ne(x, { outsidePress: !0 }), { getFloatingProps: g } = se([h, C]);
933
+ }), x = te(g, { role: "dialog" }), v = ne(g, { outsidePress: !0 }), { getFloatingProps: y } = se([x, v]);
932
934
  if (!e) return null;
933
- const k = typeof t == "string" ? "dial-popup-heading" : void 0, D = (b) => b ? typeof b == "string" ? /* @__PURE__ */ r(
935
+ const k = typeof n == "string" ? "dial-popup-heading" : void 0, N = (b) => b ? typeof b == "string" ? /* @__PURE__ */ r(
934
936
  "h3",
935
937
  {
936
938
  id: k,
937
- className: i(
939
+ className: l(
938
940
  "flex-1 min-w-0 mr-3 truncate dial-h3 text-primary",
939
941
  o
940
942
  ),
941
- children: /* @__PURE__ */ r(T, { tooltip: b, children: b })
943
+ children: /* @__PURE__ */ r(O, { tooltip: b, children: b })
942
944
  }
943
945
  ) : b : /* @__PURE__ */ r("span", {});
944
- return /* @__PURE__ */ r(le, { id: n, children: /* @__PURE__ */ r(Oe, { className: i(yr, s), children: /* @__PURE__ */ r(We, { context: x, children: /* @__PURE__ */ m(
946
+ return /* @__PURE__ */ r(ae, { id: t, children: /* @__PURE__ */ r(nr, { className: l(jr, a), children: /* @__PURE__ */ r(Ce, { context: g, children: /* @__PURE__ */ p(
945
947
  "div",
946
948
  {
947
- ref: f.setFloating,
948
- ...g(),
949
+ ref: m.setFloating,
950
+ ...y(),
949
951
  role: "dialog",
950
952
  "aria-modal": "true",
951
953
  "aria-labelledby": k,
952
- className: i(
954
+ className: l(
953
955
  "dial-popup",
954
- vr[p],
955
- c && Cr,
956
- a
956
+ zr[f],
957
+ c && Wr,
958
+ s
957
959
  ),
958
960
  children: [
959
- /* @__PURE__ */ m("div", { className: br, children: [
960
- D(t),
961
+ /* @__PURE__ */ p("div", { className: Br, children: [
962
+ N(n),
961
963
  /* @__PURE__ */ r(
962
- pr,
964
+ ve,
963
965
  {
964
966
  ariaLabel: "Close dialog",
965
- onClose: (b) => l?.(b)
967
+ onClose: (b) => i?.(b)
966
968
  }
967
969
  )
968
970
  ] }),
@@ -972,180 +974,370 @@ const yr = "z-[52] flex items-center justify-center bg-blackout md:p-4", Cr = "d
972
974
  }
973
975
  ) }) }) });
974
976
  };
975
- var _ = /* @__PURE__ */ ((e) => (e.Info = "info", e.Danger = "danger", e))(_ || {});
976
- const Nr = "flex justify-end gap-2 px-6 py-4", kr = "text-secondary dial-small-150 px-6 py-4", Dr = "Cancel", q = {
977
- [_.Info]: {
978
- confirmVariant: I.Primary,
979
- cancelVariant: I.Secondary
977
+ var Q = /* @__PURE__ */ ((e) => (e.Info = "info", e.Danger = "danger", e))(Q || {});
978
+ const Hr = "flex justify-end gap-2 px-6 py-4", _r = "text-secondary dial-small-150 px-6 py-4", $r = "Cancel", le = {
979
+ [Q.Info]: {
980
+ confirmVariant: D.Primary,
981
+ cancelVariant: D.Secondary
980
982
  },
981
- [_.Danger]: {
983
+ [Q.Danger]: {
982
984
  container: "border-t-4 border-error",
983
- confirmVariant: I.Danger,
984
- cancelVariant: I.Secondary
985
+ confirmVariant: D.Danger,
986
+ cancelVariant: D.Secondary
985
987
  }
986
- }, Zr = ({
988
+ }, bn = ({
987
989
  title: e,
988
- description: t,
989
- descriptionCssClass: n,
990
- open: a = !1,
991
- confirmLabel: s,
992
- cancelLabel: o = Dr,
990
+ description: n,
991
+ descriptionCssClass: t,
992
+ open: s = !1,
993
+ confirmLabel: a,
994
+ cancelLabel: o = $r,
993
995
  isLoading: c = !1,
994
996
  disableConfirmButton: u = !1,
995
997
  cssClass: d,
996
- confirmClassName: l,
997
- onClose: p,
998
- onConfirm: f,
999
- onCancel: x,
1000
- children: h,
1001
- dividers: C = !1,
1002
- variant: g = _.Info,
1003
- size: k = A.Sm
998
+ confirmClassName: i,
999
+ onClose: f,
1000
+ onConfirm: m,
1001
+ onCancel: g,
1002
+ children: x,
1003
+ dividers: v = !1,
1004
+ variant: y = Q.Info,
1005
+ size: k = H.Sm
1004
1006
  }) => {
1005
- const D = c ? null : /* @__PURE__ */ m("div", { className: Nr, children: [
1007
+ const N = c ? null : /* @__PURE__ */ p("div", { className: Hr, children: [
1006
1008
  /* @__PURE__ */ r(
1007
- j,
1009
+ V,
1008
1010
  {
1009
- variant: I.Secondary,
1011
+ variant: D.Secondary,
1010
1012
  title: o,
1011
- onClick: () => x ? x() : p?.()
1013
+ onClick: () => g ? g() : f?.()
1012
1014
  }
1013
1015
  ),
1014
1016
  /* @__PURE__ */ r(
1015
- j,
1017
+ V,
1016
1018
  {
1017
- variant: q[g].confirmVariant,
1018
- cssClass: l,
1019
- title: s,
1019
+ variant: le[y].confirmVariant,
1020
+ cssClass: i,
1021
+ title: a,
1020
1022
  disable: u,
1021
- onClick: () => f()
1023
+ onClick: () => m()
1022
1024
  }
1023
1025
  )
1024
- ] }), b = E(() => c ? /* @__PURE__ */ r("div", { className: "px-6 py-4 h-[120px]", children: /* @__PURE__ */ r(Ue, { size: 50 }) }) : h ?? (t ? /* @__PURE__ */ r(
1026
+ ] }), b = R(() => c ? /* @__PURE__ */ r("div", { className: "px-6 py-4 h-[120px]", children: /* @__PURE__ */ r(mr, { size: 50 }) }) : x ?? (n ? /* @__PURE__ */ r(
1025
1027
  "div",
1026
1028
  {
1027
- className: i(kr, n),
1028
- children: t
1029
+ className: l(_r, t),
1030
+ children: n
1029
1031
  }
1030
- ) : null), [h, t, c, n]);
1032
+ ) : null), [x, n, c, t]);
1031
1033
  return /* @__PURE__ */ r(
1032
- wr,
1034
+ Ne,
1033
1035
  {
1034
- open: a,
1036
+ open: s,
1035
1037
  title: e,
1036
- cssClass: i(q[g].container, d),
1037
- dividers: C,
1038
- onClose: () => p?.(),
1039
- footer: D,
1038
+ cssClass: l(le[y].container, d),
1039
+ dividers: v,
1040
+ onClose: () => f?.(),
1041
+ footer: N,
1040
1042
  size: k,
1041
1043
  children: b()
1042
1044
  }
1043
1045
  );
1044
- }, Ir = ({ onClick: e }) => /* @__PURE__ */ r(
1045
- we,
1046
+ }, ke = ({ selectedItems: e, listCssClass: n, listElementCssClass: t }) => !!e?.length && /* @__PURE__ */ r(
1047
+ "ul",
1046
1048
  {
1047
- ...M,
1049
+ className: l(
1050
+ "flex-row items-center truncate flex-wrap",
1051
+ "flex gap-x-2 gap-y-1",
1052
+ n
1053
+ ),
1054
+ children: e?.map((s) => /* @__PURE__ */ r(
1055
+ "li",
1056
+ {
1057
+ className: l([
1058
+ "tiny bg-layer-3 rounded p-1 border border-primary max-w-[200px] truncate",
1059
+ t
1060
+ ]),
1061
+ children: /* @__PURE__ */ r(O, { tooltip: s, children: /* @__PURE__ */ r(
1062
+ "button",
1063
+ {
1064
+ "aria-label": "autocomplete-action",
1065
+ type: "button",
1066
+ className: "truncate w-full",
1067
+ children: s
1068
+ }
1069
+ ) })
1070
+ },
1071
+ s
1072
+ ))
1073
+ }
1074
+ ), ie = (e) => /* @__PURE__ */ L.createElement("svg", { width: 18, height: 18, viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ L.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 = ({
1075
+ children: e,
1076
+ open: n,
1077
+ readonly: t,
1078
+ selectedValue: s,
1079
+ valueCssClasses: a,
1080
+ inputCssClasses: o,
1081
+ onOpen: c,
1082
+ elementId: u,
1083
+ errorText: d,
1084
+ emptyValueText: i
1085
+ }) => {
1086
+ const f = Array.isArray(s) && s.length > 0, m = typeof s == "string" && !!s.trim(), g = f || m ? s : i, x = t ? void 0 : c;
1087
+ return /* @__PURE__ */ p(Z, { children: [
1088
+ f ? /* @__PURE__ */ r("div", { className: "w-full", onClick: x, children: /* @__PURE__ */ p(
1089
+ "div",
1090
+ {
1091
+ className: l(
1092
+ "dial-input px-3 py-2 flex flex-row items-center w-full justify-between",
1093
+ t && "dial-input-disable"
1094
+ ),
1095
+ children: [
1096
+ /* @__PURE__ */ r(ke, { selectedItems: g }),
1097
+ !t && /* @__PURE__ */ r("div", { className: "ml-1", children: /* @__PURE__ */ r(
1098
+ M,
1099
+ {
1100
+ icon: /* @__PURE__ */ r(
1101
+ ie,
1102
+ {
1103
+ role: "img",
1104
+ width: z,
1105
+ height: z
1106
+ }
1107
+ )
1108
+ }
1109
+ ) })
1110
+ ]
1111
+ }
1112
+ ) }) : /* @__PURE__ */ p(Z, { children: [
1113
+ /* @__PURE__ */ r(
1114
+ "button",
1115
+ {
1116
+ type: "button",
1117
+ className: "w-full",
1118
+ onClick: x,
1119
+ "aria-label": "open-popup",
1120
+ id: u,
1121
+ children: /* @__PURE__ */ p(
1122
+ "div",
1123
+ {
1124
+ className: l(
1125
+ "dial-input px-3 py-2 dial-input-field flex flex-row items-center w-full justify-between",
1126
+ o,
1127
+ t && "dial-input-disable",
1128
+ d && "dial-input-error"
1129
+ ),
1130
+ children: [
1131
+ /* @__PURE__ */ r(O, { tooltip: String(g), children: /* @__PURE__ */ r("span", { className: a, children: g }) }),
1132
+ !t && /* @__PURE__ */ r("div", { className: "flex-shrink-0", children: /* @__PURE__ */ r(
1133
+ M,
1134
+ {
1135
+ icon: /* @__PURE__ */ r(
1136
+ ie,
1137
+ {
1138
+ role: "img",
1139
+ width: z,
1140
+ height: z
1141
+ }
1142
+ )
1143
+ }
1144
+ ) })
1145
+ ]
1146
+ }
1147
+ )
1148
+ }
1149
+ ),
1150
+ d && /* @__PURE__ */ r(K, { errorText: d })
1151
+ ] }),
1152
+ n && or(e, document.body)
1153
+ ] });
1154
+ }, vn = ({
1155
+ fieldTitle: e,
1156
+ htmlFor: n,
1157
+ readonly: t,
1158
+ selectedValue: s,
1159
+ radioButtons: a,
1160
+ customInputValue: o,
1161
+ valueCssClasses: c,
1162
+ inputCssClasses: u,
1163
+ emptyValueText: d,
1164
+ onClose: i,
1165
+ title: f,
1166
+ portalId: m,
1167
+ onApply: g,
1168
+ cancelButtonTitle: x = "Cancel",
1169
+ applyButtonTitle: v = "Apply",
1170
+ isValid: y,
1171
+ selectedRadioValue: k,
1172
+ onChangeRadioField: N,
1173
+ id: b
1174
+ }) => {
1175
+ const [C, w] = F(!1), A = R(() => {
1176
+ t || w(!0);
1177
+ }, [t]), P = R(() => {
1178
+ w(!1), i?.();
1179
+ }, [i]), j = R(() => {
1180
+ g(), P();
1181
+ }, [g, P]);
1182
+ return /* @__PURE__ */ p("div", { className: "flex flex-col", children: [
1183
+ /* @__PURE__ */ r($, { fieldTitle: e, htmlFor: n }),
1184
+ /* @__PURE__ */ r(
1185
+ Gr,
1186
+ {
1187
+ readonly: t,
1188
+ open: C,
1189
+ selectedValue: o ?? a.find((E) => E.id === s)?.name,
1190
+ valueCssClasses: c,
1191
+ inputCssClasses: l(u, "py-2", "px-3"),
1192
+ emptyValueText: d,
1193
+ onOpen: A,
1194
+ children: /* @__PURE__ */ r(
1195
+ Ne,
1196
+ {
1197
+ open: C,
1198
+ onClose: P,
1199
+ title: f,
1200
+ portalId: m,
1201
+ footer: /* @__PURE__ */ p("div", { className: "flex flex-row items-center justify-end gap-2 px-6 py-4", children: [
1202
+ /* @__PURE__ */ r(
1203
+ V,
1204
+ {
1205
+ variant: D.Secondary,
1206
+ title: x,
1207
+ onClick: P
1208
+ }
1209
+ ),
1210
+ /* @__PURE__ */ r(
1211
+ V,
1212
+ {
1213
+ variant: D.Primary,
1214
+ title: v,
1215
+ onClick: j,
1216
+ disable: !y
1217
+ }
1218
+ )
1219
+ ] }),
1220
+ children: /* @__PURE__ */ r("div", { className: "px-6 py-4", children: /* @__PURE__ */ r(
1221
+ Sr,
1222
+ {
1223
+ radioButtons: a,
1224
+ labelCssClass: "dial-small",
1225
+ activeRadioButton: k,
1226
+ onChange: N,
1227
+ elementId: b,
1228
+ orientation: X.Column
1229
+ }
1230
+ ) })
1231
+ }
1232
+ )
1233
+ }
1234
+ )
1235
+ ] });
1236
+ }, Kr = ({ onClick: e }) => /* @__PURE__ */ r(
1237
+ $e,
1238
+ {
1239
+ ..._,
1048
1240
  className: "text-primary",
1049
1241
  onClick: e
1050
1242
  }
1051
- ), Rr = ({ onClick: e }) => /* @__PURE__ */ r(Ne, { ...M, className: "text-primary", onClick: e }), Sr = ({ ...e }) => {
1052
- const [t, n] = S(!1), a = E((s) => {
1053
- n(s);
1243
+ ), Ur = ({ onClick: e }) => /* @__PURE__ */ r(Ge, { ..._, className: "text-primary", onClick: e }), Zr = ({ ...e }) => {
1244
+ const [n, t] = F(!1), s = R((a) => {
1245
+ t(a);
1054
1246
  }, []);
1055
1247
  return /* @__PURE__ */ r(
1056
- H,
1248
+ q,
1057
1249
  {
1058
- type: t ? "text" : "password",
1250
+ type: n ? "text" : "password",
1059
1251
  ...e,
1060
- iconAfter: t ? /* @__PURE__ */ r(Ir, { onClick: () => a(!1) }) : /* @__PURE__ */ r(Rr, { onClick: () => a(!0) })
1252
+ iconAfter: n ? /* @__PURE__ */ r(Kr, { onClick: () => s(!1) }) : /* @__PURE__ */ r(Ur, { onClick: () => s(!0) })
1061
1253
  }
1062
1254
  );
1063
- }, Ur = ({
1255
+ }, wn = ({
1064
1256
  fieldTitle: e,
1065
- optional: t,
1066
- elementCssClass: n,
1067
- elementId: a,
1068
- errorText: s,
1257
+ optional: n,
1258
+ elementCssClass: t,
1259
+ elementId: s,
1260
+ errorText: a,
1069
1261
  ...o
1070
- }) => /* @__PURE__ */ m("div", { className: "flex flex-col", children: [
1262
+ }) => /* @__PURE__ */ p("div", { className: "flex flex-col", children: [
1071
1263
  /* @__PURE__ */ r(
1072
- z,
1264
+ $,
1073
1265
  {
1074
1266
  fieldTitle: e,
1075
- optional: t,
1076
- htmlFor: a
1267
+ optional: n,
1268
+ htmlFor: s
1077
1269
  }
1078
1270
  ),
1079
1271
  /* @__PURE__ */ r(
1080
- Sr,
1272
+ Zr,
1081
1273
  {
1082
- cssClass: n,
1083
- elementId: a,
1084
- invalid: !!s,
1274
+ cssClass: t,
1275
+ elementId: s,
1276
+ invalid: !!a,
1085
1277
  ...o
1086
1278
  }
1087
1279
  ),
1088
- /* @__PURE__ */ r(W, { errorText: s })
1280
+ /* @__PURE__ */ r(K, { errorText: a })
1089
1281
  ] });
1090
- var K = /* @__PURE__ */ ((e) => (e.Small = "small", e.Base = "base", e))(K || {});
1091
- const Er = {
1092
- [K.Small]: {
1282
+ var Y = /* @__PURE__ */ ((e) => (e.Small = "small", e.Base = "base", e))(Y || {});
1283
+ const Xr = {
1284
+ [Y.Small]: {
1093
1285
  textClass: "text-xs px-1",
1094
1286
  containerClass: "px-[6px] py-1 h-[22px]",
1095
1287
  iconSize: 10,
1096
1288
  iconStroke: 1
1097
1289
  },
1098
- [K.Base]: {
1290
+ [Y.Base]: {
1099
1291
  textClass: "text-sm px-2",
1100
1292
  containerClass: "px-3 py-2 h-[38px]",
1101
1293
  iconSize: 18,
1102
1294
  iconStroke: 1.5
1103
1295
  }
1104
- }, Xr = ({
1296
+ }, Nn = ({
1105
1297
  elementId: e,
1106
- value: t,
1107
- placeholder: n,
1108
- disabled: a,
1109
- readonly: s,
1298
+ value: n,
1299
+ placeholder: t,
1300
+ disabled: s,
1301
+ readonly: a,
1110
1302
  invalid: o,
1111
1303
  cssClass: c,
1112
1304
  containerCssClass: u,
1113
1305
  onChange: d,
1114
- size: l = K.Base
1306
+ size: i = Y.Base
1115
1307
  }) => {
1116
- const [p, f] = S(t || "");
1117
- re(() => {
1118
- f(t || "");
1119
- }, [t]);
1120
- const x = E(
1121
- (g) => {
1122
- f(g), d?.(g);
1308
+ const [f, m] = F(n || "");
1309
+ ee(() => {
1310
+ m(n || "");
1311
+ }, [n]);
1312
+ const g = R(
1313
+ (y) => {
1314
+ m(y), d?.(y);
1123
1315
  },
1124
1316
  [d]
1125
- ), h = Er[l], C = E(() => {
1126
- x("");
1127
- }, [x]);
1128
- return /* @__PURE__ */ m(
1317
+ ), x = Xr[i], v = R(() => {
1318
+ g("");
1319
+ }, [g]);
1320
+ return /* @__PURE__ */ p(
1129
1321
  "div",
1130
1322
  {
1131
- className: i(
1323
+ className: l(
1132
1324
  "dial-input flex flex-row items-center justify-between",
1133
1325
  o && "dial-input-error",
1134
- a && "dial-input-disable",
1135
- s && "dial-input-readonly",
1136
- h.containerClass,
1326
+ s && "dial-input-disable",
1327
+ a && "dial-input-readonly",
1328
+ x.containerClass,
1137
1329
  u
1138
1330
  ),
1139
1331
  children: [
1140
1332
  /* @__PURE__ */ r(
1141
- R,
1333
+ M,
1142
1334
  {
1143
- className: i(a ? "text-secondary" : "text-primary"),
1335
+ className: l(s ? "text-secondary" : "text-primary"),
1144
1336
  icon: /* @__PURE__ */ r(
1145
- ke,
1337
+ Ke,
1146
1338
  {
1147
- size: h.iconSize,
1148
- stroke: h.iconStroke
1339
+ size: x.iconSize,
1340
+ stroke: x.iconStroke
1149
1341
  }
1150
1342
  )
1151
1343
  }
@@ -1156,28 +1348,28 @@ const Er = {
1156
1348
  id: e,
1157
1349
  type: "text",
1158
1350
  autoComplete: "off",
1159
- placeholder: n,
1160
- value: p ?? "",
1161
- disabled: a,
1162
- readOnly: s,
1163
- className: i(
1351
+ placeholder: t,
1352
+ value: f ?? "",
1353
+ disabled: s,
1354
+ readOnly: a,
1355
+ className: l(
1164
1356
  "border-0 bg-transparent w-full",
1165
1357
  c,
1166
- h.textClass
1358
+ x.textClass
1167
1359
  ),
1168
- onChange: (g) => !s && x(g.currentTarget.value)
1360
+ onChange: (y) => !a && g(y.currentTarget.value)
1169
1361
  }
1170
1362
  ),
1171
- p && !s && !a && /* @__PURE__ */ r(
1172
- R,
1363
+ f && !a && !s && /* @__PURE__ */ r(
1364
+ M,
1173
1365
  {
1174
1366
  className: "text-primary cursor-pointer",
1175
1367
  icon: /* @__PURE__ */ r(
1176
- $,
1368
+ J,
1177
1369
  {
1178
- size: h.iconSize,
1179
- stroke: h.iconStroke,
1180
- onClick: C,
1370
+ size: x.iconSize,
1371
+ stroke: x.iconStroke,
1372
+ onClick: v,
1181
1373
  "aria-label": "Clear search",
1182
1374
  role: "button"
1183
1375
  }
@@ -1187,148 +1379,40 @@ const Er = {
1187
1379
  ]
1188
1380
  }
1189
1381
  );
1190
- }, ue = ({ selectedItems: e, listCssClass: t, listElementCssClass: n }) => !!e?.length && /* @__PURE__ */ r(
1191
- "ul",
1192
- {
1193
- className: i(
1194
- "flex-row items-center truncate flex-wrap",
1195
- "flex gap-x-2 gap-y-1",
1196
- t
1197
- ),
1198
- children: e?.map((a) => /* @__PURE__ */ r(
1199
- "li",
1200
- {
1201
- className: i([
1202
- "tiny bg-layer-3 rounded p-1 border border-primary max-w-[200px] truncate",
1203
- n
1204
- ]),
1205
- children: /* @__PURE__ */ r(T, { tooltip: a, children: /* @__PURE__ */ r(
1206
- "button",
1207
- {
1208
- "aria-label": "autocomplete-action",
1209
- type: "button",
1210
- className: "truncate w-full",
1211
- children: a
1212
- }
1213
- ) })
1214
- },
1215
- a
1216
- ))
1217
- }
1218
- ), Q = (e) => /* @__PURE__ */ N.createElement("svg", { width: 18, height: 18, viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ N.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" })), qr = ({
1219
- children: e,
1220
- open: t,
1221
- readonly: n,
1222
- selectedValue: a,
1223
- valueCssClasses: s,
1224
- inputCssClasses: o,
1225
- onOpen: c,
1226
- elementId: u,
1227
- errorText: d,
1228
- emptyValueText: l
1229
- }) => {
1230
- const p = Array.isArray(a) && a.length > 0, f = typeof a == "string" && !!a.trim(), x = p || f ? a : l, h = n ? void 0 : c;
1231
- return /* @__PURE__ */ m(Z, { children: [
1232
- p ? /* @__PURE__ */ r("div", { className: "w-full", onClick: h, children: /* @__PURE__ */ m(
1233
- "div",
1234
- {
1235
- className: i(
1236
- "dial-input px-3 py-2 flex flex-row items-center w-full justify-between",
1237
- n && "dial-input-disable"
1238
- ),
1239
- children: [
1240
- /* @__PURE__ */ r(ue, { selectedItems: x }),
1241
- !n && /* @__PURE__ */ r("div", { className: "ml-1", children: /* @__PURE__ */ r(
1242
- R,
1243
- {
1244
- icon: /* @__PURE__ */ r(
1245
- Q,
1246
- {
1247
- role: "img",
1248
- width: V,
1249
- height: V
1250
- }
1251
- )
1252
- }
1253
- ) })
1254
- ]
1255
- }
1256
- ) }) : /* @__PURE__ */ m(Z, { children: [
1257
- /* @__PURE__ */ r(
1258
- "button",
1259
- {
1260
- type: "button",
1261
- className: "w-full",
1262
- onClick: h,
1263
- "aria-label": "open-popup",
1264
- id: u,
1265
- children: /* @__PURE__ */ m(
1266
- "div",
1267
- {
1268
- className: i(
1269
- "dial-input px-3 py-2 dial-input-field flex flex-row items-center w-full justify-between",
1270
- o,
1271
- n && "dial-input-disable",
1272
- d && "dial-input-error"
1273
- ),
1274
- children: [
1275
- /* @__PURE__ */ r(T, { tooltip: String(x), children: /* @__PURE__ */ r("span", { className: s, children: x }) }),
1276
- !n && /* @__PURE__ */ r("div", { className: "flex-shrink-0", children: /* @__PURE__ */ r(
1277
- R,
1278
- {
1279
- icon: /* @__PURE__ */ r(
1280
- Q,
1281
- {
1282
- role: "img",
1283
- width: V,
1284
- height: V
1285
- }
1286
- )
1287
- }
1288
- ) })
1289
- ]
1290
- }
1291
- )
1292
- }
1293
- ),
1294
- d && /* @__PURE__ */ r(W, { errorText: d })
1295
- ] }),
1296
- t && ze(e, document.body)
1297
- ] });
1298
- }, Qr = ({
1382
+ }, kn = ({
1299
1383
  placeholder: e = "",
1300
- selectedItems: t = [],
1301
- updateSelected: n,
1302
- listCssClass: a,
1303
- listElementCssClass: s,
1384
+ selectedItems: n = [],
1385
+ updateSelected: t,
1386
+ listCssClass: s,
1387
+ listElementCssClass: a,
1304
1388
  containerCssClass: o,
1305
1389
  inputCssClass: c
1306
1390
  }) => {
1307
- const [u, d] = S(""), l = E(
1308
- (f) => {
1309
- f.key === "Enter" && (n([...t, f.currentTarget.value]), d("")), (f.key === "Backspace" || f.key === "Delete") && t.length && !u && n(t.slice(0, -1));
1391
+ const [u, d] = F(""), i = R(
1392
+ (m) => {
1393
+ m.key === "Enter" && (t([...n, m.currentTarget.value]), d("")), (m.key === "Backspace" || m.key === "Delete") && n.length && !u && t(n.slice(0, -1));
1310
1394
  },
1311
- [t, n, u]
1312
- ), p = E(
1313
- (f) => {
1314
- d(f.target.value);
1395
+ [n, t, u]
1396
+ ), f = R(
1397
+ (m) => {
1398
+ d(m.target.value);
1315
1399
  },
1316
1400
  [d]
1317
1401
  );
1318
- return /* @__PURE__ */ m(
1402
+ return /* @__PURE__ */ p(
1319
1403
  "div",
1320
1404
  {
1321
- className: i([
1405
+ className: l([
1322
1406
  "dial-input px-3 py-2 flex flex-row items-center flex-wrap w-fit gap-2",
1323
1407
  o
1324
1408
  ]),
1325
1409
  children: [
1326
1410
  /* @__PURE__ */ r(
1327
- ue,
1411
+ ke,
1328
1412
  {
1329
- selectedItems: t,
1330
- listCssClass: a,
1331
- listElementCssClass: s
1413
+ selectedItems: n,
1414
+ listCssClass: s,
1415
+ listElementCssClass: a
1332
1416
  }
1333
1417
  ),
1334
1418
  /* @__PURE__ */ r(
@@ -1336,91 +1420,91 @@ const Er = {
1336
1420
  {
1337
1421
  type: "text",
1338
1422
  value: u,
1339
- className: i(["border-0 bg-transparent p-0", c]),
1340
- placeholder: t?.length ? "" : e,
1341
- onKeyDown: l,
1342
- onChange: p
1423
+ className: l(["border-0 bg-transparent p-0", c]),
1424
+ placeholder: n?.length ? "" : e,
1425
+ onKeyDown: i,
1426
+ onChange: f
1343
1427
  }
1344
1428
  )
1345
1429
  ]
1346
1430
  }
1347
1431
  );
1348
- }, Yr = ({
1432
+ }, Dn = ({
1349
1433
  initialTags: e = [],
1350
- fieldTitle: t,
1351
- optional: n,
1352
- elementId: a,
1353
- placeholder: s,
1434
+ fieldTitle: n,
1435
+ optional: t,
1436
+ elementId: s,
1437
+ placeholder: a,
1354
1438
  errorText: o,
1355
1439
  invalid: c,
1356
1440
  disabled: u,
1357
1441
  onChange: d
1358
1442
  }) => {
1359
- const l = J(null), [p, f] = S(e), [x, h] = S(""), [C, g] = S(!1), k = (y) => {
1360
- const v = y.trim().replace(/,$/, "");
1361
- if (v && !p.includes(v)) {
1362
- const P = [v, ...p];
1363
- f(P), d?.(P);
1443
+ const i = de(null), [f, m] = F(e), [g, x] = F(""), [v, y] = F(!1), k = (C) => {
1444
+ const w = C.trim().replace(/,$/, "");
1445
+ if (w && !f.includes(w)) {
1446
+ const A = [w, ...f];
1447
+ m(A), d?.(A);
1364
1448
  }
1365
- }, D = (y) => {
1366
- (y.key === "," || y.key === "Enter") && (y.preventDefault(), k(x), h(""));
1367
- }, b = (y) => {
1368
- const v = p.filter((P, G) => G !== y);
1369
- f(v), d?.(v);
1449
+ }, N = (C) => {
1450
+ (C.key === "," || C.key === "Enter") && (C.preventDefault(), k(g), x(""));
1451
+ }, b = (C) => {
1452
+ const w = f.filter((A, P) => P !== C);
1453
+ m(w), d?.(w);
1370
1454
  };
1371
- return re(() => {
1372
- const y = new ResizeObserver(() => {
1373
- if (l.current) {
1374
- const v = l.current.scrollHeight > l.current.clientHeight + 10;
1375
- g(v);
1455
+ return ee(() => {
1456
+ const C = new ResizeObserver(() => {
1457
+ if (i.current) {
1458
+ const w = i.current.scrollHeight > i.current.clientHeight + 10;
1459
+ y(w);
1376
1460
  }
1377
1461
  });
1378
- return l.current && y.observe(l.current), () => y.disconnect();
1379
- }, [p]), /* @__PURE__ */ m("div", { className: i("flex flex-col w-full"), children: [
1462
+ return i.current && C.observe(i.current), () => C.disconnect();
1463
+ }, [f]), /* @__PURE__ */ p("div", { className: l("flex flex-col w-full"), children: [
1380
1464
  /* @__PURE__ */ r(
1381
- z,
1465
+ $,
1382
1466
  {
1383
- fieldTitle: t,
1384
- optional: n,
1385
- htmlFor: a
1467
+ fieldTitle: n,
1468
+ optional: t,
1469
+ htmlFor: s
1386
1470
  }
1387
1471
  ),
1388
1472
  /* @__PURE__ */ r(
1389
1473
  "div",
1390
1474
  {
1391
- className: i(
1475
+ className: l(
1392
1476
  "dial-input min-h-[38px] p-[6px]",
1393
1477
  c && "dial-input-error",
1394
1478
  u && "dial-input-disable"
1395
1479
  ),
1396
- children: /* @__PURE__ */ m(
1480
+ children: /* @__PURE__ */ p(
1397
1481
  "div",
1398
1482
  {
1399
- ref: l,
1400
- className: i(
1483
+ ref: i,
1484
+ className: l(
1401
1485
  "flex flex-wrap gap-2 items-center",
1402
- C ? "flex-col-reverse" : "flex-row"
1486
+ v ? "flex-col-reverse" : "flex-row"
1403
1487
  ),
1404
1488
  children: [
1405
- p.map((y, v) => /* @__PURE__ */ r(
1406
- ur,
1489
+ f.map((C, w) => /* @__PURE__ */ r(
1490
+ Mr,
1407
1491
  {
1408
- tag: y,
1409
- remove: u ? void 0 : () => b(v)
1492
+ tag: C,
1493
+ remove: u ? void 0 : () => b(w)
1410
1494
  },
1411
- y + v
1495
+ C + w
1412
1496
  )),
1413
1497
  /* @__PURE__ */ r(
1414
1498
  "input",
1415
1499
  {
1416
1500
  type: "text",
1417
- value: x,
1418
- onChange: (y) => h(y.target.value),
1419
- onKeyDown: D,
1420
- className: i(
1501
+ value: g,
1502
+ onChange: (C) => x(C.target.value),
1503
+ onKeyDown: N,
1504
+ className: l(
1421
1505
  "dial-input-no-border outline-none border-none w-full min-w-[100px] flex-1 p-1"
1422
1506
  ),
1423
- placeholder: s,
1507
+ placeholder: a,
1424
1508
  disabled: u
1425
1509
  }
1426
1510
  )
@@ -1429,47 +1513,232 @@ const Er = {
1429
1513
  )
1430
1514
  }
1431
1515
  ),
1432
- /* @__PURE__ */ r(W, { errorText: o })
1516
+ /* @__PURE__ */ r(K, { errorText: o })
1517
+ ] });
1518
+ };
1519
+ var qr = /* @__PURE__ */ ((e) => (e.Dropdown = "dropdown", e.Menu = "menu", e))(qr || {}), G = /* @__PURE__ */ ((e) => (e.Click = "click", e.Hover = "hover", e.ContextMenu = "contextMenu", e))(G || {}), De = /* @__PURE__ */ ((e) => (e.Item = "item", e.Divider = "divider", e))(De || {});
1520
+ const Qr = l(
1521
+ "inline-flex items-center gap-2 align-middle",
1522
+ "h-auto px-0 bg-transparent border-0"
1523
+ ), Yr = l(
1524
+ "z-[53] overflow-auto rounded bg-layer-0 text-primary shadow focus-visible:outline-none",
1525
+ "w-max"
1526
+ ), Jr = l(
1527
+ "flex w-full cursor-pointer items-center gap-3",
1528
+ "focus-visible:border-none focus-visible:outline-none",
1529
+ "hover:bg-accent-primary-alpha px-3",
1530
+ "dial-small h-[34px] rounded text-primary"
1531
+ ), en = "opacity-75 !cursor-not-allowed", rn = "text-error", nn = "my-1 border-t border-hover", U = 8, In = ({
1532
+ children: e,
1533
+ menu: n,
1534
+ renderOverlay: t,
1535
+ trigger: s = [G.Click],
1536
+ placement: a,
1537
+ disabled: o = !1,
1538
+ open: c,
1539
+ defaultOpen: u = !1,
1540
+ onOpenChange: d,
1541
+ closable: i = !1,
1542
+ onClose: f,
1543
+ cssClass: m,
1544
+ listClassName: g,
1545
+ outsidePressIgnoreRef: x,
1546
+ outsideClosable: v = !0
1547
+ }) => {
1548
+ const [y, k] = F(u), N = c !== void 0, b = N ? !!c : y, C = R(
1549
+ (h) => {
1550
+ N || k(h), d?.(h);
1551
+ },
1552
+ [N, d]
1553
+ ), w = Ye(), A = (h) => h ? "clientWidth" in h ? h.clientWidth : h.getBoundingClientRect?.()?.width ?? 0 : 0, P = a === void 0, { refs: j, floatingStyles: E, context: S } = re({
1554
+ placement: a,
1555
+ open: b,
1556
+ onOpenChange: C,
1557
+ whileElementsMounted: he,
1558
+ middleware: [
1559
+ pe({ mainAxis: U, crossAxis: 0 }),
1560
+ P ? tr({
1561
+ alignment: "start",
1562
+ crossAxis: !0,
1563
+ padding: U
1564
+ }) : fe({ padding: U }),
1565
+ me({ padding: U }),
1566
+ sr({
1567
+ apply({ availableWidth: h, elements: T }) {
1568
+ const Te = A(T.reference);
1569
+ T.floating.style.setProperty(
1570
+ "--reference-width",
1571
+ `${Te}px`
1572
+ ), T.floating.style.maxWidth = `${h}px`;
1573
+ }
1574
+ })
1575
+ ]
1576
+ }), W = ar(S, {
1577
+ enabled: s.includes(G.Click) && !o
1578
+ }), Ie = xe(S, {
1579
+ enabled: s.includes(G.Hover) && !o,
1580
+ move: !1,
1581
+ restMs: 40,
1582
+ delay: { open: 80, close: 80 }
1583
+ }), Re = ne(S, {
1584
+ bubbles: !0,
1585
+ referencePress: !1,
1586
+ outsidePress: (h) => {
1587
+ if (!v) return !1;
1588
+ const T = h.target;
1589
+ return !(x?.current && T instanceof Node && x.current.contains(T));
1590
+ }
1591
+ }), Ee = te(S, { role: "menu" }), { getReferenceProps: Se, getFloatingProps: Le } = se([
1592
+ W,
1593
+ Ie,
1594
+ Re,
1595
+ Ee
1596
+ ]), Fe = (h) => {
1597
+ !s.includes(G.ContextMenu) || o || (h.preventDefault(), C(!0));
1598
+ };
1599
+ ee(() => {
1600
+ o && b && C(!1);
1601
+ }, [o, b, C]);
1602
+ const Me = (h) => (T) => {
1603
+ h.disabled || (h.onClick?.({ key: h.key, domEvent: T }), n?.onClick?.({ key: h.key, domEvent: T }), C(!1));
1604
+ }, Pe = t ? t() : n && /* @__PURE__ */ r("div", { role: "none", className: "py-1", children: n.items.map((h) => h.type === De.Divider ? /* @__PURE__ */ r(
1605
+ "div",
1606
+ {
1607
+ role: "separator",
1608
+ className: nn
1609
+ },
1610
+ h.key
1611
+ ) : /* @__PURE__ */ p(
1612
+ "button",
1613
+ {
1614
+ role: "menuitem",
1615
+ type: "button",
1616
+ "aria-disabled": !!h.disabled,
1617
+ className: l(
1618
+ Jr,
1619
+ h.disabled && en,
1620
+ h.danger && rn
1621
+ ),
1622
+ disabled: h.disabled,
1623
+ onClick: Me(h),
1624
+ children: [
1625
+ h.icon && /* @__PURE__ */ r(
1626
+ "span",
1627
+ {
1628
+ className: l(
1629
+ h.danger && "text-error",
1630
+ h.disabled && "text-secondary"
1631
+ ),
1632
+ children: /* @__PURE__ */ r(M, { icon: h.icon })
1633
+ }
1634
+ ),
1635
+ /* @__PURE__ */ r(
1636
+ "span",
1637
+ {
1638
+ className: l(
1639
+ "flex-1 truncate text-left",
1640
+ h.danger && "text-error",
1641
+ h.disabled && "text-secondary"
1642
+ ),
1643
+ children: h.label
1644
+ }
1645
+ )
1646
+ ]
1647
+ },
1648
+ h.key
1649
+ )) });
1650
+ return /* @__PURE__ */ p(Z, { children: [
1651
+ /* @__PURE__ */ r(
1652
+ "span",
1653
+ {
1654
+ ref: j.setReference,
1655
+ className: l(
1656
+ Qr,
1657
+ o && "!cursor-not-allowed opacity-75",
1658
+ m
1659
+ ),
1660
+ "aria-haspopup": "menu",
1661
+ "aria-expanded": b,
1662
+ "aria-controls": w,
1663
+ onContextMenu: Fe,
1664
+ ...Se(),
1665
+ children: e
1666
+ }
1667
+ ),
1668
+ b && /* @__PURE__ */ r(ae, { children: /* @__PURE__ */ r(
1669
+ Ce,
1670
+ {
1671
+ context: S,
1672
+ modal: !1,
1673
+ initialFocus: -1,
1674
+ returnFocus: !0,
1675
+ children: /* @__PURE__ */ p(
1676
+ "div",
1677
+ {
1678
+ id: w,
1679
+ ref: j.setFloating,
1680
+ style: E,
1681
+ className: l(Yr, g),
1682
+ ...Le(),
1683
+ children: [
1684
+ i && /* @__PURE__ */ r("div", { className: "flex items-center justify-between px-2 pt-2", children: /* @__PURE__ */ r(
1685
+ ve,
1686
+ {
1687
+ ariaLabel: "Close dropdown",
1688
+ onClose: (h) => {
1689
+ f?.(h), C(!1);
1690
+ }
1691
+ }
1692
+ ) }),
1693
+ Pe
1694
+ ]
1695
+ }
1696
+ )
1697
+ }
1698
+ ) })
1433
1699
  ] });
1434
1700
  };
1435
1701
  export {
1436
- F as AlertVariant,
1437
- I as ButtonVariant,
1438
- _ as ConfirmationPopupVariant,
1439
- Mr as DialAlert,
1440
- Qr as DialAutocompleteInput,
1441
- ue as DialAutocompleteInputValue,
1442
- j as DialButton,
1443
- Pr as DialCheckbox,
1444
- pr as DialCloseButton,
1445
- Br as DialCollapsibleSidebar,
1446
- Zr as DialConfirmationPopup,
1447
- W as DialErrorText,
1448
- z as DialFieldLabel,
1449
- R as DialIcon,
1450
- H as DialInput,
1451
- qr as DialInputPopup,
1452
- Hr as DialLabelledText,
1453
- Ue as DialLoader,
1454
- zr as DialNoDataContent,
1455
- _r as DialNumberInputField,
1456
- Sr as DialPasswordInput,
1457
- Ur as DialPasswordInputField,
1458
- wr as DialPopup,
1459
- ar as DialRadioButton,
1460
- Wr as DialRadioGroup,
1461
- Xr as DialSearch,
1462
- Or as DialSteps,
1463
- Gr as DialSwitch,
1464
- ur as DialTag,
1465
- Yr as DialTagInput,
1466
- $r as DialTextAreaField,
1467
- Kr as DialTextInputField,
1468
- mr as DialTextarea,
1469
- T as DialTooltip,
1470
- A as PopupSize,
1471
- U as RadioGroupOrientation,
1472
- K as SearchSize,
1473
- w as StepStatus,
1474
- X as TagVariant
1702
+ B as AlertVariant,
1703
+ D as ButtonVariant,
1704
+ Q as ConfirmationPopupVariant,
1705
+ dn as DialAlert,
1706
+ kn as DialAutocompleteInput,
1707
+ ke as DialAutocompleteInputValue,
1708
+ V as DialButton,
1709
+ un as DialCheckbox,
1710
+ ve as DialCloseButton,
1711
+ mn as DialCollapsibleSidebar,
1712
+ bn as DialConfirmationPopup,
1713
+ In as DialDropdown,
1714
+ K as DialErrorText,
1715
+ $ as DialFieldLabel,
1716
+ M as DialIcon,
1717
+ q as DialInput,
1718
+ Gr as DialInputPopup,
1719
+ hn as DialLabelledText,
1720
+ mr as DialLoader,
1721
+ fn as DialNoDataContent,
1722
+ xn as DialNumberInputField,
1723
+ Zr as DialPasswordInput,
1724
+ wn as DialPasswordInputField,
1725
+ Ne as DialPopup,
1726
+ kr as DialRadioButton,
1727
+ Sr as DialRadioGroup,
1728
+ vn as DialRadioGroupPopupField,
1729
+ Nn as DialSearch,
1730
+ pn as DialSteps,
1731
+ yn as DialSwitch,
1732
+ Mr as DialTag,
1733
+ Dn as DialTagInput,
1734
+ Cn as DialTextAreaField,
1735
+ gn as DialTextInputField,
1736
+ Pr as DialTextarea,
1737
+ O as DialTooltip,
1738
+ qr as DropdownType,
1739
+ H as PopupSize,
1740
+ X as RadioGroupOrientation,
1741
+ Y as SearchSize,
1742
+ I as StepStatus,
1743
+ oe as TagVariant
1475
1744
  };