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

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