@epam/statgpt-ui-components 0.2.0-rc.2 → 0.2.0-rc.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.mjs CHANGED
@@ -1,188 +1,218 @@
1
- import { jsx as t, jsxs as l, Fragment as Y } from "react/jsx-runtime";
2
- import { useEffect as k, useRef as j, useCallback as C, useState as P, useMemo as z } from "react";
3
- import h from "classnames";
4
- import { IconX as X, IconCalendarEvent as Z, IconChevronDown as B } from "@tabler/icons-react";
5
- import J from "react-flatpickr";
6
- import { CalendarResolution as S } from "@epam/statgpt-shared-toolkit";
7
- import { useFloating as I, useRole as K, useDismiss as G, useInteractions as H, FloatingPortal as V, FloatingOverlay as D, FloatingFocusManager as M, autoUpdate as nn, offset as en, flip as rn, shift as cn, useClick as tn } from "@floating-ui/react";
8
- const q = () => /* @__PURE__ */ t("div", { className: "flex items-center justify-center h-full", children: /* @__PURE__ */ t("div", { className: "loader" }) }), T = ({
1
+ import { jsx as t, jsxs as d, Fragment as G } from "react/jsx-runtime";
2
+ import { useEffect as Y, useState as I, useRef as $, useCallback as L, useMemo as X } from "react";
3
+ import f from "classnames";
4
+ import { IconX as Z, IconCalendarEvent as J, IconChevronDown as K } from "@tabler/icons-react";
5
+ import V from "react-flatpickr";
6
+ import { CalendarResolution as R } from "@epam/statgpt-shared-toolkit";
7
+ import { useFloating as g, useRole as D, useDismiss as H, useInteractions as A, FloatingPortal as M, FloatingOverlay as nn, FloatingFocusManager as rn, autoUpdate as en, offset as cn, flip as tn, shift as on, useClick as an } from "@floating-ui/react";
8
+ const T = () => /* @__PURE__ */ t("div", { className: "flex items-center justify-center h-full", children: /* @__PURE__ */ t("div", { className: "loader" }) }), q = ({
9
9
  title: n,
10
- btnClassNames: e,
10
+ btnClassNames: r,
11
11
  iconWidth: c,
12
- iconHeight: r,
12
+ iconHeight: e,
13
13
  onClick: o
14
14
  }) => /* @__PURE__ */ t(
15
15
  "button",
16
16
  {
17
17
  type: "button",
18
18
  "aria-label": "button",
19
- className: e,
19
+ className: r,
20
20
  title: n,
21
21
  onClick: o,
22
- children: /* @__PURE__ */ t(X, { height: r || 20, width: c || 20 })
22
+ children: /* @__PURE__ */ t(Z, { height: e || 20, width: c || 20 })
23
23
  }
24
24
  );
25
- var E = /* @__PURE__ */ ((n) => (n.ERROR = "error", n.SUCCESS = "success", n.IN_PROGRESS = "in_progress", n))(E || {});
26
- const bn = ({
25
+ var C = /* @__PURE__ */ ((n) => (n.ERROR = "error", n.SUCCESS = "success", n.IN_PROGRESS = "in_progress", n))(C || {});
26
+ const wn = ({
27
27
  alertDetails: n,
28
- successIcon: e,
28
+ successIcon: r,
29
29
  errorIcon: c,
30
- onClose: r,
30
+ onClose: e,
31
31
  closeButtonTitle: o
32
32
  }) => {
33
- const a = () => (n == null ? void 0 : n.type) === E.IN_PROGRESS ? "alert-in-progress" : (n == null ? void 0 : n.type) === E.SUCCESS ? "alert-success" : "alert-error";
34
- return k(() => {
35
- (n == null ? void 0 : n.type) !== E.IN_PROGRESS && setTimeout(() => {
36
- r == null || r();
33
+ const a = () => (n == null ? void 0 : n.type) === C.IN_PROGRESS ? "alert-in-progress" : (n == null ? void 0 : n.type) === C.SUCCESS ? "alert-success" : "alert-error";
34
+ return Y(() => {
35
+ (n == null ? void 0 : n.type) !== C.IN_PROGRESS && setTimeout(() => {
36
+ e == null || e();
37
37
  }, 5e3);
38
- }, [n == null ? void 0 : n.type, r]), /* @__PURE__ */ t(
38
+ }, [n == null ? void 0 : n.type, e]), /* @__PURE__ */ t(
39
39
  "div",
40
40
  {
41
- className: h(
41
+ className: f(
42
42
  "alert alert-shadow fixed bottom-3 right-3 z-10",
43
43
  a()
44
44
  ),
45
- children: /* @__PURE__ */ l("div", { className: "alert-content flex items-start", children: [
46
- /* @__PURE__ */ t("div", { className: "alert-icon", children: (n == null ? void 0 : n.type) === E.IN_PROGRESS ? /* @__PURE__ */ t(q, {}) : (n == null ? void 0 : n.type) === E.SUCCESS ? e : c }),
47
- /* @__PURE__ */ l("div", { className: "flex flex-col gap-2 max-w-[300px]", children: [
45
+ children: /* @__PURE__ */ d("div", { className: "alert-content flex items-start", children: [
46
+ /* @__PURE__ */ t("div", { className: "alert-icon", children: (n == null ? void 0 : n.type) === C.IN_PROGRESS ? /* @__PURE__ */ t(T, {}) : (n == null ? void 0 : n.type) === C.SUCCESS ? r : c }),
47
+ /* @__PURE__ */ d("div", { className: "flex flex-col gap-2 max-w-[300px]", children: [
48
48
  /* @__PURE__ */ t("h3", { className: "truncate", children: n == null ? void 0 : n.title }),
49
49
  (n == null ? void 0 : n.text) && /* @__PURE__ */ t("div", { className: "alert-text truncate", title: n == null ? void 0 : n.text, children: n == null ? void 0 : n.text })
50
50
  ] }),
51
- /* @__PURE__ */ t(T, { title: o, onClick: r })
51
+ /* @__PURE__ */ t(q, { title: o, onClick: e })
52
52
  ] })
53
53
  }
54
54
  );
55
- }, xn = ({
55
+ }, vn = ({
56
56
  buttonClassName: n,
57
- isLoading: e = !1,
57
+ isLoading: r = !1,
58
58
  title: c,
59
- disabled: r,
59
+ disabled: e,
60
60
  iconAfter: o,
61
61
  iconBefore: a,
62
62
  onClick: u,
63
- isSmallButton: d
63
+ isSmallButton: p
64
64
  }) => {
65
- const s = h(
66
- d ? "font-semibold" : "",
65
+ const h = f(
66
+ p ? "font-semibold" : "",
67
67
  o ? "mr-2" : "",
68
68
  a ? "ml-2" : ""
69
69
  );
70
- return /* @__PURE__ */ l(
70
+ return /* @__PURE__ */ d(
71
71
  "button",
72
72
  {
73
73
  type: "button",
74
- className: h(
74
+ className: f(
75
75
  "base-button",
76
76
  n,
77
- d ? "small-button" : ""
77
+ p ? "small-button" : ""
78
78
  ),
79
- disabled: r || e,
79
+ disabled: e || r,
80
80
  "aria-label": "button",
81
81
  onClick: (m) => u == null ? void 0 : u(m),
82
82
  title: c,
83
83
  children: [
84
84
  a,
85
- e && /* @__PURE__ */ t(q, {}),
86
- c ? d ? /* @__PURE__ */ t("h4", { className: s, children: c }) : /* @__PURE__ */ t("h3", { className: s, children: c }) : null,
85
+ r && /* @__PURE__ */ t(T, {}),
86
+ c ? p ? /* @__PURE__ */ t("h4", { className: h, children: c }) : /* @__PURE__ */ t("h3", { className: h, children: c }) : null,
87
87
  o
88
88
  ]
89
89
  }
90
90
  );
91
- }, Nn = ({
91
+ };
92
+ function ln(n = 719) {
93
+ const [r, c] = I(
94
+ () => typeof window < "u" ? window.innerWidth < n : !1
95
+ );
96
+ return Y(() => {
97
+ const e = window.matchMedia(`(max-width: ${n}px)`), o = (a) => {
98
+ c(a.matches);
99
+ };
100
+ return c(e.matches), e.addEventListener("change", o), () => e.removeEventListener("change", o);
101
+ }, [n]), r;
102
+ }
103
+ function En(n, r) {
104
+ const c = $(null);
105
+ return L(
106
+ (...o) => {
107
+ c.current && clearTimeout(c.current), c.current = setTimeout(() => {
108
+ n(...o);
109
+ }, r);
110
+ },
111
+ [n, r]
112
+ );
113
+ }
114
+ const Fn = 24, Cn = 24, j = 1e3, dn = 24, Rn = ({
92
115
  label: n,
93
- onChange: e,
116
+ onChange: r,
94
117
  value: c,
95
- options: r,
96
- calendarResolution: o = S.DAY,
118
+ options: e,
119
+ calendarResolution: o = R.DAY,
97
120
  id: a,
98
- icon: u
121
+ icon: u,
122
+ isEndDate: p
99
123
  }) => {
100
- var N;
101
- const d = j(null);
102
- k(() => {
103
- var w;
104
- const b = d == null ? void 0 : d.current;
105
- b && ((w = b.querySelector("input")) == null || w.setAttribute("aria-label", n));
124
+ var E;
125
+ const h = $(null), m = ln();
126
+ Y(() => {
127
+ var i;
128
+ const b = h == null ? void 0 : h.current;
129
+ b && ((i = b.querySelector("input")) == null || i.setAttribute("aria-label", n));
106
130
  }, [n]);
107
- const s = {
108
- ...r,
109
- defaultDate: o === S.MONTH ? new Date(c.getFullYear(), c.getMonth()) : c
110
- }, m = (b, w, y) => {
111
- const x = `calendar__${o === S.MONTH ? "month" : "day"}`;
112
- y.calendarContainer && y.calendarContainer.classList.add(x);
113
- }, i = (b, w, y) => {
114
- if (o === S.MONTH && b.length > 0) {
115
- const x = r.minDate, p = r.maxDate, f = b[0].getFullYear(), F = y.calendarContainer, _ = "flatpickr-disabled", $ = F.querySelectorAll(
131
+ const x = {
132
+ ...e,
133
+ disableMobile: !0,
134
+ defaultDate: o === R.MONTH ? new Date(c.getFullYear(), c.getMonth()) : c
135
+ }, y = (b, i, s) => {
136
+ const l = `calendar__${o === R.MONTH ? "month" : "day"}`;
137
+ s.calendarContainer && s.calendarContainer.classList.add(l);
138
+ }, v = (b, i, s) => {
139
+ if (o === R.MONTH && b.length > 0) {
140
+ const l = e.minDate, N = e.maxDate, w = b[0].getFullYear(), O = s.calendarContainer, _ = "flatpickr-disabled", W = O.querySelectorAll(
116
141
  ".flatpickr-monthSelect-month"
117
- ), A = F.querySelectorAll(
142
+ ), Q = O.querySelectorAll(
118
143
  ".flatpickr-next-month"
119
- )[0], W = F.querySelectorAll(
144
+ )[0], B = O.querySelectorAll(
120
145
  ".flatpickr-prev-month"
121
146
  )[0];
122
- f === p.getFullYear() && A.classList.add(_), f === x.getFullYear() && W.classList.add(_), (f === x.getFullYear() || f === p.getFullYear()) && $.forEach((L) => {
123
- L.classList.remove(_);
124
- const v = new Date(L.getAttribute("aria-label")), Q = v.getFullYear() === x.getFullYear() && v.getMonth() === x.getMonth(), U = v.getFullYear() === p.getFullYear() && v.getMonth() === p.getMonth();
125
- Q || U || (v < x || v > p) && L.classList.add(_);
147
+ w === N.getFullYear() && Q.classList.add(_), w === l.getFullYear() && B.classList.add(_), (w === l.getFullYear() || w === N.getFullYear()) && W.forEach((k) => {
148
+ k.classList.remove(_);
149
+ const F = new Date(k.getAttribute("aria-label")), U = F.getFullYear() === l.getFullYear() && F.getMonth() === l.getMonth(), z = F.getFullYear() === N.getFullYear() && F.getMonth() === N.getMonth();
150
+ U || z || (F < l || F > N) && k.classList.add(_);
126
151
  });
127
152
  }
153
+ setTimeout(() => {
154
+ var w;
155
+ const l = s.calendarContainer, N = (w = s._input) == null ? void 0 : w.getBoundingClientRect();
156
+ l && (l.style.top = `${N.top - l.offsetHeight - 8}px`, l.style.width = `${l.style.width}px`, p ? (l.style.right = `${window.innerWidth - N.right - (m ? dn : 0)}px`, l.style.left = "auto") : l.style.left = `${N.left}px`);
157
+ }, 0);
128
158
  };
129
- return /* @__PURE__ */ l("div", { className: "relative calendar", ref: d, children: [
159
+ return /* @__PURE__ */ d("div", { className: "relative calendar", ref: h, children: [
130
160
  /* @__PURE__ */ t("div", { className: "mb-1 calendar-title", children: n }),
131
161
  /* @__PURE__ */ t(
132
162
  "label",
133
163
  {
134
164
  htmlFor: a,
135
165
  className: "absolute cursor-pointer right-[11px] top-[29px]",
136
- children: u || /* @__PURE__ */ t(Z, {})
166
+ children: u || /* @__PURE__ */ t(J, {})
137
167
  }
138
168
  ),
139
169
  /* @__PURE__ */ t(
140
- J,
170
+ V,
141
171
  {
142
- defaultValue: (N = o === S.MONTH ? new Date(c.getFullYear(), c.getMonth()) : c) == null ? void 0 : N.toDateString(),
143
- options: s,
172
+ defaultValue: (E = o === R.MONTH ? new Date(c.getFullYear(), c.getMonth()) : c) == null ? void 0 : E.toDateString(),
173
+ options: x,
144
174
  onChange: (b) => {
145
- e(b[0]);
175
+ r(b[0]);
146
176
  },
147
- onOpen: [i],
148
- onReady: [m],
177
+ onOpen: [v],
178
+ onReady: [y],
149
179
  id: a
150
180
  }
151
181
  )
152
182
  ] });
153
- }, wn = ({
183
+ }, Sn = ({
154
184
  label: n,
155
- id: e,
185
+ id: r,
156
186
  checked: c,
157
- checkboxIcon: r,
187
+ checkboxIcon: e,
158
188
  onChange: o
159
189
  }) => {
160
- const a = C(
190
+ const a = L(
161
191
  (u) => {
162
- u.stopPropagation(), o == null || o(e, u.target.checked);
192
+ u.stopPropagation(), o == null || o(r, u.target.checked);
163
193
  },
164
- [o, e]
194
+ [o, r]
165
195
  );
166
- return /* @__PURE__ */ l(
196
+ return /* @__PURE__ */ d(
167
197
  "label",
168
198
  {
169
199
  className: "flex items-center cursor-pointer min-w-0 py-1",
170
- htmlFor: e,
200
+ htmlFor: r,
171
201
  children: [
172
202
  /* @__PURE__ */ t(
173
203
  "span",
174
204
  {
175
- className: h(
205
+ className: f(
176
206
  "flex justify-center items-center w-4 h-4 mr-2 relative",
177
207
  "checkbox-button"
178
208
  ),
179
- children: c && r
209
+ children: c && e
180
210
  }
181
211
  ),
182
212
  n && /* @__PURE__ */ t(
183
213
  "p",
184
214
  {
185
- className: h(
215
+ className: f(
186
216
  "text-neutrals-1000 flex-1 min-w-0 truncate pr-2",
187
217
  "checkbox-button-text"
188
218
  ),
@@ -195,7 +225,7 @@ const bn = ({
195
225
  {
196
226
  type: "checkbox",
197
227
  onChange: a,
198
- id: e,
228
+ id: r,
199
229
  checked: c,
200
230
  className: "hidden"
201
231
  }
@@ -203,28 +233,28 @@ const bn = ({
203
233
  ]
204
234
  }
205
235
  );
206
- }, yn = ({
236
+ }, _n = ({
207
237
  title: n,
208
- icon: e,
238
+ icon: r,
209
239
  children: c,
210
- value: r
240
+ value: e
211
241
  }) => {
212
- const [o, a] = P(!1);
213
- return /* @__PURE__ */ l(
242
+ const [o, a] = I(!1);
243
+ return /* @__PURE__ */ d(
214
244
  "div",
215
245
  {
216
246
  className: `collapsible-block flex flex-col border-t-2 border-neutrals-600 ${o ? "collapsible-block-open" : ""}`,
217
247
  children: [
218
- /* @__PURE__ */ l(
248
+ /* @__PURE__ */ d(
219
249
  "div",
220
250
  {
221
251
  className: "collapsible-block-title flex cursor-pointer items-center py-4",
222
252
  onClick: () => a(!o),
223
253
  children: [
224
- /* @__PURE__ */ t("div", { className: `${o ? "rotate-180" : ""} transition-transform`, children: e || /* @__PURE__ */ t(B, { className: "w-5 h-5 mr-3" }) }),
225
- /* @__PURE__ */ l("div", { className: "flex flex-1 items-center justify-between", children: [
254
+ /* @__PURE__ */ t("div", { className: `${o ? "rotate-180" : ""} transition-transform`, children: r || /* @__PURE__ */ t(K, { className: "w-5 h-5 mr-3" }) }),
255
+ /* @__PURE__ */ d("div", { className: "flex flex-1 items-center justify-between", children: [
226
256
  /* @__PURE__ */ t("span", { children: n }),
227
- r && /* @__PURE__ */ t("p", { className: "body-1 text-neutrals-800", children: r })
257
+ e && /* @__PURE__ */ t("p", { className: "body-1 text-neutrals-800", children: e })
228
258
  ] })
229
259
  ]
230
260
  }
@@ -233,76 +263,76 @@ const bn = ({
233
263
  ]
234
264
  }
235
265
  );
236
- }, vn = ({ text: n, highlightText: e }) => {
237
- const c = z(() => {
266
+ }, Ln = ({ text: n, highlightText: r }) => {
267
+ const c = X(() => {
238
268
  var u;
239
- const r = [];
240
- if (!e)
269
+ const e = [];
270
+ if (!r)
241
271
  return [{ id: 0, text: n, highlight: !1 }];
242
- const o = (e == null ? void 0 : e.toLowerCase()) || "", a = ((u = n == null ? void 0 : n.toLowerCase()) == null ? void 0 : u.split(o)) || "";
243
- for (let d = 0, s = 0; d < (a == null ? void 0 : a.length); d++) {
244
- const m = a == null ? void 0 : a[d], i = m.length;
245
- m !== "" && r.push({
246
- id: r.length,
272
+ const o = (r == null ? void 0 : r.toLowerCase()) || "", a = ((u = n == null ? void 0 : n.toLowerCase()) == null ? void 0 : u.split(o)) || "";
273
+ for (let p = 0, h = 0; p < (a == null ? void 0 : a.length); p++) {
274
+ const m = a == null ? void 0 : a[p], x = m.length;
275
+ m !== "" && e.push({
276
+ id: e.length,
247
277
  highlight: !1,
248
278
  text: n == null ? void 0 : n.substring(
249
- s,
250
- s + i
279
+ h,
280
+ h + x
251
281
  )
252
- }), s += i, d !== (a == null ? void 0 : a.length) - 1 && (r.push({
253
- id: r.length,
282
+ }), h += x, p !== (a == null ? void 0 : a.length) - 1 && (e.push({
283
+ id: e.length,
254
284
  highlight: !0,
255
285
  text: n == null ? void 0 : n.substring(
256
- s,
257
- s + e.length
286
+ h,
287
+ h + r.length
258
288
  )
259
- }), s += e.length);
289
+ }), h += r.length);
260
290
  }
261
- return r;
262
- }, [e, n]);
263
- return /* @__PURE__ */ t(Y, { children: c.map((r) => /* @__PURE__ */ t(
291
+ return e;
292
+ }, [r, n]);
293
+ return /* @__PURE__ */ t(G, { children: c.map((e) => /* @__PURE__ */ t(
264
294
  "span",
265
295
  {
266
- className: h((r == null ? void 0 : r.highlight) && "bg-highlight"),
267
- children: r == null ? void 0 : r.text
296
+ className: f((e == null ? void 0 : e.highlight) && "bg-highlight"),
297
+ children: e == null ? void 0 : e.text
268
298
  },
269
- r == null ? void 0 : r.id
299
+ e == null ? void 0 : e.id
270
300
  )) });
271
- }, En = ({
301
+ }, On = ({
272
302
  icon: n,
273
- onClick: e,
303
+ onClick: r,
274
304
  buttonClassName: c,
275
- disabled: r,
305
+ disabled: e,
276
306
  title: o,
277
307
  isBaseIconStyles: a = !0
278
308
  }) => /* @__PURE__ */ t(
279
309
  "button",
280
310
  {
281
311
  type: "button",
282
- className: h(
312
+ className: f(
283
313
  a && "base-icon-button",
284
314
  c
285
315
  ),
286
- onClick: (u) => e == null ? void 0 : e(u),
287
- disabled: r,
316
+ onClick: (u) => r == null ? void 0 : r(u),
317
+ disabled: e,
288
318
  title: o,
289
319
  "aria-label": "button",
290
320
  children: n
291
321
  }
292
- ), on = ({
322
+ ), un = ({
293
323
  value: n,
294
- inputId: e,
324
+ inputId: r,
295
325
  placeholder: c = "",
296
- cssClass: r = "",
326
+ cssClass: e = "",
297
327
  type: o = "text",
298
328
  disabled: a,
299
329
  readonly: u,
300
- onChange: d,
301
- onKeyDown: s
330
+ onChange: p,
331
+ onKeyDown: h
302
332
  }) => {
303
- const m = h(
333
+ const m = f(
304
334
  "truncate outline-none shadow-none body-1",
305
- r,
335
+ e,
306
336
  u ? "pointer-events-none" : ""
307
337
  );
308
338
  return /* @__PURE__ */ t(
@@ -310,100 +340,100 @@ const bn = ({
310
340
  {
311
341
  type: o,
312
342
  autoComplete: "off",
313
- id: e,
343
+ id: r,
314
344
  placeholder: c,
315
345
  value: n || "",
316
346
  title: n ? String(n) : "",
317
347
  disabled: a,
318
348
  className: m,
319
- onKeyDown: s,
320
- onChange: (i) => d == null ? void 0 : d(i.currentTarget.value)
349
+ onKeyDown: h,
350
+ onChange: (x) => p == null ? void 0 : p(x.currentTarget.value)
321
351
  }
322
352
  );
323
- }, Fn = ({
353
+ }, kn = ({
324
354
  iconBeforeInput: n,
325
- iconAfterInput: e,
355
+ iconAfterInput: r,
326
356
  containerClasses: c,
327
- cssClass: r,
357
+ cssClass: e,
328
358
  ...o
329
- }) => /* @__PURE__ */ l("div", { className: h("input w-full flex flex-row", c), children: [
359
+ }) => /* @__PURE__ */ d("div", { className: f("input w-full flex flex-row", c), children: [
330
360
  n,
331
361
  /* @__PURE__ */ t(
332
- on,
362
+ un,
333
363
  {
334
- cssClass: h(
364
+ cssClass: f(
335
365
  "border-0 bg-transparent p-0 h-full shadow-none flex-1 min-w-0 rounded-none",
336
- r
366
+ e
337
367
  ),
338
368
  ...o
339
369
  }
340
370
  ),
341
- e
342
- ] }), Sn = ({
371
+ r
372
+ ] }), Pn = ({
343
373
  url: n,
344
- title: e,
374
+ title: r,
345
375
  linkClassName: c = "",
346
- iconBefore: r,
376
+ iconBefore: e,
347
377
  iconAfter: o
348
378
  }) => {
349
- const a = h(
379
+ const a = f(
350
380
  o ? "mr-2" : "",
351
- r ? "ml-2" : ""
381
+ e ? "ml-2" : ""
352
382
  );
353
- return /* @__PURE__ */ l(
383
+ return /* @__PURE__ */ d(
354
384
  "a",
355
385
  {
356
386
  href: n,
357
387
  target: "_blank",
358
388
  rel: "noopener noreferrer",
359
- className: h("base-link", c),
360
- title: e,
389
+ className: f("base-link", c),
390
+ title: r,
361
391
  children: [
362
- r,
363
- /* @__PURE__ */ t("span", { className: a, children: e }),
392
+ e,
393
+ /* @__PURE__ */ t("span", { className: a, children: r }),
364
394
  o
365
395
  ]
366
396
  }
367
397
  );
368
- }, Rn = ({ title: n, text: e, onClick: c }) => /* @__PURE__ */ t(
398
+ }, Yn = ({ title: n, text: r, onClick: c }) => /* @__PURE__ */ t(
369
399
  "button",
370
400
  {
371
401
  type: "button",
372
402
  className: "tag flex items-center justify-center",
373
- onClick: () => c == null ? void 0 : c(e || n),
403
+ onClick: () => c == null ? void 0 : c(r || n),
374
404
  "aria-label": "button",
375
405
  children: /* @__PURE__ */ t("h4", { children: n })
376
406
  }
377
- ), _n = ({
407
+ ), In = ({
378
408
  label: n,
379
- id: e,
409
+ id: r,
380
410
  checked: c,
381
- radioIcon: r,
411
+ radioIcon: e,
382
412
  description: o,
383
413
  onChange: a
384
414
  }) => {
385
- const u = C(
386
- (d) => {
387
- d.stopPropagation(), a == null || a(e, d.target.checked);
415
+ const u = L(
416
+ (p) => {
417
+ p.stopPropagation(), a == null || a(r, p.target.checked);
388
418
  },
389
- [a, e]
419
+ [a, r]
390
420
  );
391
- return /* @__PURE__ */ l(
421
+ return /* @__PURE__ */ d(
392
422
  "label",
393
423
  {
394
424
  className: "flex flex-col cursor-pointer min-w-0 py-[6px]",
395
- htmlFor: e,
425
+ htmlFor: r,
396
426
  children: [
397
- /* @__PURE__ */ l("p", { className: "radio-label flex items-center min-w-0", children: [
427
+ /* @__PURE__ */ d("p", { className: "radio-label flex items-center min-w-0", children: [
398
428
  /* @__PURE__ */ t(
399
429
  "span",
400
430
  {
401
- className: h(
431
+ className: f(
402
432
  "flex justify-center items-center w-4 h-4 mr-2 relative",
403
433
  "radio-button",
404
434
  c ? "radio-button-active" : ""
405
435
  ),
406
- children: c && r
436
+ children: c && e
407
437
  }
408
438
  ),
409
439
  n && /* @__PURE__ */ t(
@@ -428,7 +458,7 @@ const bn = ({
428
458
  {
429
459
  type: "radio",
430
460
  onChange: u,
431
- id: e,
461
+ id: r,
432
462
  checked: c,
433
463
  className: "hidden"
434
464
  }
@@ -437,242 +467,257 @@ const bn = ({
437
467
  }
438
468
  );
439
469
  };
440
- var R = /* @__PURE__ */ ((n) => (n.Closed = "Closed", n.Opened = "Opened", n))(R || {}), O = /* @__PURE__ */ ((n) => (n.LG = "Large", n.SM = "Small", n))(O || {});
441
- const an = ({
470
+ var S = /* @__PURE__ */ ((n) => (n.Closed = "Closed", n.Opened = "Opened", n))(S || {}), P = /* @__PURE__ */ ((n) => (n.LG = "Large", n.SM = "Small", n))(P || {});
471
+ const pn = ({
442
472
  portalId: n,
443
- state: e = R.Opened,
473
+ state: r = S.Opened,
444
474
  heading: c,
445
- size: r,
475
+ size: e,
446
476
  onClose: o,
447
477
  children: a,
448
478
  overlayClassName: u,
449
- containerClassName: d,
450
- dividers: s = !0,
479
+ containerClassName: p,
480
+ dividers: h = !0,
451
481
  closeButtonTitle: m
452
482
  }) => {
453
- const { refs: i, context: N } = I({
454
- open: e !== R.Closed && !!e,
483
+ const { refs: x, context: y } = g({
484
+ open: r !== S.Closed && !!r,
455
485
  onOpenChange: o
456
- }), b = K(N, { role: "dialog" }), w = G(N, { outsidePress: !0 }), { getFloatingProps: y } = H([b, w]), x = C(
457
- (p) => {
458
- p == null || p.preventDefault(), p == null || p.stopPropagation(), o();
486
+ }), v = D(y, { role: "dialog" }), E = H(y, { outsidePress: !0 }), { getFloatingProps: b } = A([v, E]), i = L(
487
+ (s) => {
488
+ s == null || s.preventDefault(), s == null || s.stopPropagation(), o();
459
489
  },
460
490
  [o]
461
491
  );
462
- return /* @__PURE__ */ t(V, { id: n, children: e !== R.Closed && /* @__PURE__ */ t(
463
- D,
492
+ return /* @__PURE__ */ t(M, { id: n, children: r !== S.Closed && /* @__PURE__ */ t(
493
+ nn,
464
494
  {
465
- className: h(
495
+ className: f(
466
496
  "z-modal flex items-center justify-center bg-blackout p-4",
467
497
  u
468
498
  ),
469
- children: /* @__PURE__ */ t(M, { context: N, children: /* @__PURE__ */ l(
499
+ children: /* @__PURE__ */ t(rn, { context: y, children: /* @__PURE__ */ d(
470
500
  "div",
471
501
  {
472
- className: h(
502
+ className: f(
473
503
  "relative max-h-full modal rounded bg-white flex flex-col shadow w-full",
474
- r === O.LG && "max-w-[65%]",
475
- r === O.SM && "max-w-[30%]",
476
- s && "divide-neutrals-400 divide-y",
477
- d,
504
+ e === P.LG && "max-w-[65%]",
505
+ e === P.SM && "max-w-[30%]",
506
+ h && "divide-neutrals-400 divide-y",
507
+ p,
478
508
  "sm:w-full sm:max-w-full sm:px-4 sm:py-6"
479
509
  ),
480
- ref: i.setFloating,
481
- ...y({
482
- onClick(p) {
483
- p.stopPropagation();
510
+ ref: x.setFloating,
511
+ ...b({
512
+ onClick(s) {
513
+ s.stopPropagation();
484
514
  }
485
515
  }),
486
516
  children: [
487
- /* @__PURE__ */ l("div", { className: "flex flex-row justify-between py-3 px-6 items-center mb-2 modal-heading sm:p-0 sm:pb-2", children: [
517
+ /* @__PURE__ */ d("div", { className: "flex flex-row justify-between py-3 px-6 items-center mb-2 modal-heading sm:p-0 sm:pb-2", children: [
488
518
  c && (typeof c == "string" ? /* @__PURE__ */ t("h2", { className: "flex-1 min-w-0 mr-3 modal-heading-title sm:h3", children: c }) : c),
489
519
  /* @__PURE__ */ t(
490
- T,
520
+ q,
491
521
  {
492
522
  title: m,
493
- onClick: x,
523
+ onClick: i,
494
524
  btnClassNames: "sm:h-[24px] sm:w-[24px] sm:top-4"
495
525
  }
496
526
  )
497
527
  ] }),
498
- a.map((p) => p)
528
+ a.map((s) => s)
499
529
  ]
500
530
  }
501
531
  ) })
502
532
  }
503
533
  ) });
504
- }, Cn = (n) => n.state === R.Closed ? null : /* @__PURE__ */ t(an, { ...n }), Ln = ({
534
+ }, jn = (n) => n.state === S.Closed ? null : /* @__PURE__ */ t(pn, { ...n }), Gn = ({
505
535
  triggerButton: n,
506
- options: e,
536
+ options: r,
507
537
  content: c,
508
- selectedOption: r,
538
+ selectedOption: e,
509
539
  disabled: o,
510
540
  containerClassName: a,
511
541
  openedClassName: u,
512
- onOptionSelect: d
542
+ onOptionSelect: p
513
543
  }) => {
514
- const [s, m] = P(!1), { refs: i, floatingStyles: N, context: b } = I({
515
- open: s,
544
+ const [h, m] = I(!1), { refs: x, floatingStyles: y, context: v } = g({
545
+ open: h,
516
546
  onOpenChange: o ? void 0 : m,
517
547
  placement: "bottom-end",
518
- middleware: [en(8), rn(), cn()],
519
- whileElementsMounted: nn
520
- }), w = tn(b), y = G(b, { outsidePress: !0 }), { getReferenceProps: x, getFloatingProps: p } = H([
521
- w,
522
- y
548
+ middleware: [cn(8), tn(), on()],
549
+ whileElementsMounted: en
550
+ }), E = an(v), b = H(v, { outsidePress: !0 }), { getReferenceProps: i, getFloatingProps: s } = A([
551
+ E,
552
+ b
523
553
  ]);
524
- return /* @__PURE__ */ l(Y, { children: [
554
+ return /* @__PURE__ */ d(G, { children: [
525
555
  /* @__PURE__ */ t(
526
556
  "div",
527
557
  {
528
- ref: i.setReference,
529
- ...x({
530
- onClick(f) {
531
- f.stopPropagation();
558
+ ref: x.setReference,
559
+ ...i({
560
+ onClick(l) {
561
+ l.stopPropagation();
532
562
  }
533
563
  }),
534
- className: h(a, s && u),
564
+ className: f(a, h && u),
535
565
  children: n
536
566
  }
537
567
  ),
538
- s && /* @__PURE__ */ l(
568
+ h && /* @__PURE__ */ d(
539
569
  "div",
540
570
  {
541
- ref: i.setFloating,
542
- style: N,
571
+ ref: x.setFloating,
572
+ style: y,
543
573
  className: "flex flex-col z-10 dropdown-menu-shadow bg-white dropdown-container rounded",
544
- ...p(),
574
+ ...s(),
545
575
  children: [
546
576
  c && c,
547
- e && e.map((f) => /* @__PURE__ */ t(
577
+ r && r.map((l) => /* @__PURE__ */ t(
548
578
  "div",
549
579
  {
550
- onClick: (F) => {
551
- F.stopPropagation(), d == null || d(f.key), m(!1);
580
+ onClick: (N) => {
581
+ N.stopPropagation(), p == null || p(l.key), m(!1);
552
582
  },
553
- className: h(
583
+ className: f(
554
584
  "text-neutrals-900 body-3 cursor-pointer dropdown-item min-w-[200px]",
555
- r === f.key && "bg-hues-100"
585
+ e === l.key && "bg-hues-100"
556
586
  ),
557
- children: /* @__PURE__ */ l(
587
+ children: /* @__PURE__ */ d(
558
588
  "div",
559
589
  {
560
590
  className: "p-2 hover:bg-hues-100 h-full dropdown-item-text flex items-center gap-x-2",
561
- title: f.title,
591
+ title: l.title,
562
592
  children: [
563
- f.icon ? f.icon : null,
564
- /* @__PURE__ */ t("p", { children: f == null ? void 0 : f.title })
593
+ l.icon ? l.icon : null,
594
+ /* @__PURE__ */ t("p", { children: l == null ? void 0 : l.title })
565
595
  ]
566
596
  }
567
597
  )
568
598
  },
569
- f.key
599
+ l.key
570
600
  ))
571
601
  ]
572
602
  }
573
603
  )
574
604
  ] });
575
- }, On = ({ limitMessages: n, query: e }) => /* @__PURE__ */ l("div", { className: "bg-hues-100 px-2 py-1 flex justify-between flex-wrap items-center", children: [
576
- /* @__PURE__ */ t("div", { className: "flex gap-x-[4px]", children: /* @__PURE__ */ t("div", { className: "flex flex-col", children: /* @__PURE__ */ l("div", { className: "flex gap-x-[4px]", children: [
577
- /* @__PURE__ */ l("span", { className: "text-primary h5", children: [
605
+ }, $n = ({ limitMessages: n, query: r }) => /* @__PURE__ */ d("div", { className: "bg-hues-100 px-2 py-1 flex justify-between flex-wrap items-center", children: [
606
+ /* @__PURE__ */ t("div", { className: "flex gap-x-[4px]", children: /* @__PURE__ */ t("div", { className: "flex flex-col", children: /* @__PURE__ */ d("div", { className: "flex gap-x-[4px]", children: [
607
+ /* @__PURE__ */ d("span", { className: "text-primary h5", children: [
578
608
  n == null ? void 0 : n.excelFormatTitle,
579
609
  " "
580
610
  ] }),
581
611
  /* @__PURE__ */ t("span", { className: "text-neutrals-800 body-3", children: n == null ? void 0 : n.excelFormatText })
582
612
  ] }) }) }),
583
- /* @__PURE__ */ t("a", { href: e, target: "_blank", children: /* @__PURE__ */ l("span", { className: "flex gap-x-[4px] body-3 cursor-pointer items-center", children: [
613
+ /* @__PURE__ */ t("a", { href: r, target: "_blank", children: /* @__PURE__ */ d("span", { className: "flex gap-x-[4px] body-3 cursor-pointer items-center", children: [
584
614
  n == null ? void 0 : n.dataExplorerIcon,
585
615
  n == null ? void 0 : n.dataExplorer
586
616
  ] }) })
587
- ] }), g = 1e3, kn = ({
617
+ ] }), gn = ({
588
618
  limitMessages: n,
589
- isDownload: e,
619
+ isDownload: r,
590
620
  showAdvancedViewButton: c,
591
- onAdvancedViewClick: r,
621
+ onAdvancedViewClick: e,
592
622
  query: o
593
623
  }) => {
594
624
  var a, u;
595
- return /* @__PURE__ */ l("div", { className: "bg-accent-300 px-2 py-1 flex justify-between flex-wrap items-center", children: [
596
- /* @__PURE__ */ l("div", { className: "flex gap-x-[4px]", children: [
597
- /* @__PURE__ */ t("span", { children: n == null ? void 0 : n.warningIcon }),
598
- /* @__PURE__ */ l("div", { className: "flex flex-col", children: [
599
- /* @__PURE__ */ l("div", { className: "flex gap-x-[4px]", children: [
600
- /* @__PURE__ */ l("span", { className: "text-primary h5", children: [
601
- n == null ? void 0 : n.largeQuery,
602
- ":",
603
- " "
604
- ] }),
605
- /* @__PURE__ */ t("span", { className: "text-neutrals-800 body-3", children: e ? (a = n == null ? void 0 : n.downloadMessage) == null ? void 0 : a.call(n, g) : (u = n == null ? void 0 : n.showingLimit) == null ? void 0 : u.call(n, g) })
625
+ return /* @__PURE__ */ d(
626
+ "div",
627
+ {
628
+ className: f(
629
+ "bg-semantic-warning-light px-2 py-1 flex justify-between flex-wrap items-center",
630
+ n == null ? void 0 : n.containerClassName
631
+ ),
632
+ children: [
633
+ /* @__PURE__ */ d("div", { className: "flex gap-x-2 items-center", children: [
634
+ /* @__PURE__ */ t("span", { children: n == null ? void 0 : n.warningIcon }),
635
+ /* @__PURE__ */ d("div", { className: "flex flex-col gap-1", children: [
636
+ /* @__PURE__ */ d("div", { className: "flex gap-x-[4px]", children: [
637
+ /* @__PURE__ */ d(
638
+ "span",
639
+ {
640
+ className: f(
641
+ "text-primary h5",
642
+ n == null ? void 0 : n.largeQueryClassName
643
+ ),
644
+ children: [
645
+ n == null ? void 0 : n.largeQuery,
646
+ ":",
647
+ " "
648
+ ]
649
+ }
650
+ ),
651
+ /* @__PURE__ */ t(
652
+ "span",
653
+ {
654
+ className: f(
655
+ "text-neutrals-800 body-3",
656
+ n == null ? void 0 : n.limitMessageClassName
657
+ ),
658
+ children: r ? (a = n == null ? void 0 : n.downloadMessage) == null ? void 0 : a.call(n, j) : (u = n == null ? void 0 : n.showingLimit) == null ? void 0 : u.call(n, j)
659
+ }
660
+ )
661
+ ] }),
662
+ r && /* @__PURE__ */ t(
663
+ "span",
664
+ {
665
+ className: f(
666
+ "text-neutrals-800 body-3",
667
+ n == null ? void 0 : n.limitMessageClassName
668
+ ),
669
+ children: n == null ? void 0 : n.fullLimitMessage
670
+ }
671
+ )
672
+ ] })
606
673
  ] }),
607
- e && /* @__PURE__ */ t("span", { className: "text-neutrals-800 body-3", children: n == null ? void 0 : n.fullLimitMessage })
608
- ] })
609
- ] }),
610
- c && /* @__PURE__ */ l(
611
- "span",
612
- {
613
- onClick: () => r == null ? void 0 : r(),
614
- className: "flex gap-x-[4px] body-3 cursor-pointer items-center",
615
- children: [
616
- n == null ? void 0 : n.editIcon,
617
- n == null ? void 0 : n.refineInAdvancedView
618
- ]
619
- }
620
- ),
621
- e && /* @__PURE__ */ t("a", { href: o || "", target: "_blank", children: /* @__PURE__ */ l("span", { className: "flex gap-x-[4px] body-3 cursor-pointer items-center", children: [
622
- n == null ? void 0 : n.dataExplorerIcon,
623
- n == null ? void 0 : n.dataExplorer
624
- ] }) })
625
- ] });
626
- }, Pn = 24, gn = 24;
627
- function Yn(n = 719) {
628
- const [e, c] = P(
629
- () => typeof window < "u" ? window.innerWidth < n : !1
630
- );
631
- return k(() => {
632
- const r = window.matchMedia(`(max-width: ${n}px)`), o = (a) => {
633
- c(a.matches);
634
- };
635
- return c(r.matches), r.addEventListener("change", o), () => r.removeEventListener("change", o);
636
- }, [n]), e;
637
- }
638
- function jn(n, e) {
639
- const c = j(null);
640
- return C(
641
- (...o) => {
642
- c.current && clearTimeout(c.current), c.current = setTimeout(() => {
643
- n(...o);
644
- }, e);
645
- },
646
- [n, e]
674
+ c && /* @__PURE__ */ d(
675
+ "span",
676
+ {
677
+ onClick: () => e == null ? void 0 : e(),
678
+ className: "flex gap-x-[4px] h4 cursor-pointer items-center text-primary",
679
+ children: [
680
+ n == null ? void 0 : n.editIcon,
681
+ n == null ? void 0 : n.refineInAdvancedView
682
+ ]
683
+ }
684
+ ),
685
+ r && /* @__PURE__ */ t("a", { href: o || "", target: "_blank", children: /* @__PURE__ */ d("span", { className: "flex gap-x-[4px] body-3 cursor-pointer items-center", children: [
686
+ n == null ? void 0 : n.dataExplorerIcon,
687
+ n == null ? void 0 : n.dataExplorer
688
+ ] }) })
689
+ ]
690
+ }
647
691
  );
648
- }
649
- var ln = /* @__PURE__ */ ((n) => (n.Enter = "Enter", n))(ln || {});
692
+ };
693
+ var hn = /* @__PURE__ */ ((n) => (n.Enter = "Enter", n))(hn || {});
650
694
  export {
651
- bn as Alert,
652
- E as AlertType,
653
- xn as Button,
654
- Nn as Calendar,
655
- wn as Checkbox,
656
- T as CloseButton,
657
- yn as CollapsibleBlock,
658
- On as DownloadFormatMessage,
659
- Ln as Dropdown,
660
- vn as HighlightText,
661
- En as IconButton,
662
- on as Input,
663
- Fn as InputWithIcon,
664
- ln as KeyboardKey,
665
- Sn as Link,
666
- q as Loader,
667
- O as PopUpSize,
668
- R as PopUpState,
669
- Cn as Popup,
670
- _n as Radio,
671
- kn as RequestLimitMessage,
672
- g as SERIES_LIMIT,
673
- Pn as TREE_NODE_ARROW_SIZE,
674
- gn as TREE_NODE_PADDING,
675
- Rn as Tag,
676
- jn as useDebounce,
677
- Yn as useIsMobile
695
+ wn as Alert,
696
+ C as AlertType,
697
+ vn as Button,
698
+ dn as CALENDAR_MOBILE_PADDING,
699
+ Rn as Calendar,
700
+ Sn as Checkbox,
701
+ q as CloseButton,
702
+ _n as CollapsibleBlock,
703
+ $n as DownloadFormatMessage,
704
+ Gn as Dropdown,
705
+ Ln as HighlightText,
706
+ On as IconButton,
707
+ un as Input,
708
+ kn as InputWithIcon,
709
+ hn as KeyboardKey,
710
+ Pn as Link,
711
+ T as Loader,
712
+ P as PopUpSize,
713
+ S as PopUpState,
714
+ jn as Popup,
715
+ In as Radio,
716
+ gn as RequestLimitMessage,
717
+ j as SERIES_LIMIT,
718
+ Fn as TREE_NODE_ARROW_SIZE,
719
+ Cn as TREE_NODE_PADDING,
720
+ Yn as Tag,
721
+ En as useDebounce,
722
+ ln as useIsMobile
678
723
  };