@memobit/libs 3.1.3 → 3.1.5

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,20 +1,21 @@
1
- import { Icon as g } from "../Icon/Icon2.js";
1
+ import { Icon as b } from "../Icon/Icon2.js";
2
2
  import { Button as C } from "../Button/Button2.js";
3
- import { Chip as A } from "../Chip/Chip2.js";
4
- import { InputNumber as b } from "../InputNumber/InputNumber2.js";
5
- import { InputText as k } from "../InputText/InputText2.js";
6
- import { DatePicker as w } from "../DatePicker/DatePicker2.js";
7
- import { Dropdown as R } from "../Dropdown/Dropdown2.js";
8
- import { InputDate as E } from "../InputDate/InputDate2.js";
9
- import { InputSearch as I } from "../InputSearch/InputSearch2.js";
10
- import { Rating as L } from "../Rating/Rating2.js";
11
- import { DEFAULT_DATE_RANGE_PRESETS as M } from "./ControlPanel.types.js";
12
- import { useEffect as P, useRef as T, useState as N } from "react";
3
+ import { Tooltip as k } from "../Tooltip/Tooltip2.js";
4
+ import { Chip as S } from "../Chip/Chip2.js";
5
+ import { InputNumber as x } from "../InputNumber/InputNumber2.js";
6
+ import { InputText as w } from "../InputText/InputText2.js";
7
+ import { DatePicker as R } from "../DatePicker/DatePicker2.js";
8
+ import { Dropdown as E } from "../Dropdown/Dropdown2.js";
9
+ import { InputDate as L } from "../InputDate/InputDate2.js";
10
+ import { InputSearch as D } from "../InputSearch/InputSearch2.js";
11
+ import { Rating as M } from "../Rating/Rating2.js";
12
+ import { DEFAULT_DATE_RANGE_PRESETS as T } from "./ControlPanel.types.js";
13
+ import { Fragment as P, useEffect as V, useRef as j, useState as A } from "react";
13
14
  import { jsx as n, jsxs as _ } from "react/jsx-runtime";
14
- var V = 3, D = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean" ? [] : [e], S = (e) => e.every((r) => typeof r == "number") ? e : e.map(String), x = 2, j = (e) => {
15
+ var H = 3, f = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean" ? [] : [e], I = (e) => e.every((r) => typeof r == "number") ? e : e.map(String), N = 2, U = (e) => {
15
16
  const r = e.options ?? [];
16
- return D(e.value).map((o) => r.find((t) => t.value === o)?.label ?? String(o));
17
- }, H = (e) => {
17
+ return f(e.value).map((o) => r.find((t) => t.value === o)?.label ?? String(o));
18
+ }, B = (e) => {
18
19
  const { type: r, value: o } = e;
19
20
  if (o == null || o === "") return;
20
21
  if (r === "checkbox") return o === !0 ? "On" : void 0;
@@ -28,15 +29,15 @@ var V = 3, D = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
28
29
  }
29
30
  if (r === "rating") return typeof o == "number" && o > 0 ? String(o) : void 0;
30
31
  if (r === "text" || r === "search" || r === "date" || r === "number") return String(o);
31
- const t = j(e);
32
+ const t = U(e);
32
33
  if (t.length !== 0)
33
- return t.length <= x ? t.join(", ") : `${t.slice(0, x).join(", ")} +${t.length - x}`;
34
- }, ne = ({ filter: e, collapsible: r = !1, onChange: o }) => {
35
- const t = r && e.type !== "checkbox", [s, d] = N(e.defaultExpanded ?? !1), a = e.summary ?? H(e), i = /* @__PURE__ */ _("span", {
34
+ return t.length <= N ? t.join(", ") : `${t.slice(0, N).join(", ")} +${t.length - N}`;
35
+ }, te = ({ filter: e, collapsible: r = !1, onChange: o }) => {
36
+ const t = r && e.type !== "checkbox", [s, d] = A(e.defaultExpanded ?? !1), a = e.summary ?? B(e), i = /* @__PURE__ */ _("span", {
36
37
  className: `control-panel__filter-title${e.isActive ? " control-panel__filter-title--active" : ""}`,
37
38
  children: [
38
39
  e.isActive && /* @__PURE__ */ n("span", { className: "control-panel__filter-active-dot" }),
39
- e.icon && /* @__PURE__ */ n(g, { name: e.icon }),
40
+ e.icon && /* @__PURE__ */ n(b, { name: e.icon }),
40
41
  e.label
41
42
  ]
42
43
  });
@@ -59,19 +60,19 @@ var V = 3, D = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
59
60
  }),
60
61
  /* @__PURE__ */ n("span", {
61
62
  className: "control-panel__filter-caret",
62
- children: /* @__PURE__ */ n(g, { name: s ? "caret-up" : "caret-down" })
63
+ children: /* @__PURE__ */ n(b, { name: s ? "caret-up" : "caret-down" })
63
64
  })
64
65
  ]
65
- }) : e.type !== "checkbox" && i, (!t || s) && /* @__PURE__ */ n(B, {
66
+ }) : e.type !== "checkbox" && i, (!t || s) && /* @__PURE__ */ n(z, {
66
67
  filter: e,
67
68
  onChange: o
68
69
  })]
69
70
  });
70
- }, U = ({ placeholder: e, value: r, onChange: o }) => {
71
- const [t, s] = N(r), d = T(r);
72
- return P(() => {
71
+ }, Y = ({ placeholder: e, value: r, onChange: o }) => {
72
+ const [t, s] = A(r), d = j(r);
73
+ return V(() => {
73
74
  r !== d.current && (d.current = r, s(r));
74
- }, [r]), /* @__PURE__ */ n(I, {
75
+ }, [r]), /* @__PURE__ */ n(D, {
75
76
  className: "control-panel__filter-search",
76
77
  onChange: (a) => {
77
78
  d.current = a, s(a), o(a);
@@ -79,9 +80,9 @@ var V = 3, D = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
79
80
  placeholder: e,
80
81
  value: t
81
82
  });
82
- }, B = ({ filter: e, onChange: r }) => {
83
- const o = D(e.value), t = e.options ?? [], [s, d] = N("");
84
- if (e.type === "checkbox") return /* @__PURE__ */ n(A, {
83
+ }, z = ({ filter: e, onChange: r }) => {
84
+ const o = f(e.value), t = e.options ?? [], [s, d] = A("");
85
+ if (e.type === "checkbox") return /* @__PURE__ */ n(S, {
85
86
  count: e.count,
86
87
  selected: e.value === !0,
87
88
  onClick: () => r({
@@ -91,7 +92,7 @@ var V = 3, D = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
91
92
  }),
92
93
  children: e.label
93
94
  });
94
- if (e.type === "date") return /* @__PURE__ */ n(E, {
95
+ if (e.type === "date") return /* @__PURE__ */ n(L, {
95
96
  min: e.minDate,
96
97
  max: e.maxDate,
97
98
  value: typeof e.value == "string" ? e.value : "",
@@ -103,7 +104,7 @@ var V = 3, D = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
103
104
  });
104
105
  if (e.type === "text") return /* @__PURE__ */ n("div", {
105
106
  className: "control-panel__filter-text",
106
- children: /* @__PURE__ */ n(k, {
107
+ children: /* @__PURE__ */ n(w, {
107
108
  onChange: (a) => r({
108
109
  filterId: e.id,
109
110
  type: e.type,
@@ -113,7 +114,7 @@ var V = 3, D = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
113
114
  value: typeof e.value == "string" ? e.value : ""
114
115
  })
115
116
  });
116
- if (e.type === "search") return /* @__PURE__ */ n(U, {
117
+ if (e.type === "search") return /* @__PURE__ */ n(Y, {
117
118
  placeholder: e.placeholder,
118
119
  value: typeof e.value == "string" ? e.value : "",
119
120
  onChange: (a) => r({
@@ -124,7 +125,7 @@ var V = 3, D = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
124
125
  });
125
126
  if (e.type === "number") return /* @__PURE__ */ n("div", {
126
127
  className: "control-panel__filter-number",
127
- children: /* @__PURE__ */ n(b, {
128
+ children: /* @__PURE__ */ n(x, {
128
129
  min: e.min,
129
130
  max: e.max,
130
131
  step: e.step,
@@ -137,7 +138,7 @@ var V = 3, D = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
137
138
  })
138
139
  })
139
140
  });
140
- if (e.type === "rating") return /* @__PURE__ */ n(L, {
141
+ if (e.type === "rating") return /* @__PURE__ */ n(M, {
141
142
  selectable: !0,
142
143
  icon: e.ratingIcon ?? "star",
143
144
  maxRate: e.maxRate ?? 10,
@@ -158,7 +159,7 @@ var V = 3, D = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
158
159
  return /* @__PURE__ */ _("div", {
159
160
  className: "control-panel__filter-range",
160
161
  children: [
161
- /* @__PURE__ */ n(b, {
162
+ /* @__PURE__ */ n(x, {
162
163
  min: e.min,
163
164
  max: e.max,
164
165
  step: e.step,
@@ -171,7 +172,7 @@ var V = 3, D = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
171
172
  className: "control-panel__filter-range-sep",
172
173
  children: "—"
173
174
  }),
174
- /* @__PURE__ */ n(b, {
175
+ /* @__PURE__ */ n(x, {
175
176
  min: e.min,
176
177
  max: e.max,
177
178
  step: e.step,
@@ -184,19 +185,19 @@ var V = 3, D = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
184
185
  });
185
186
  }
186
187
  if (e.type === "date-range") {
187
- const a = Array.isArray(e.value) ? e.value : [], i = a[0] || void 0, l = a[1] || void 0, m = e.presets ?? M, p = (c) => {
188
+ const a = Array.isArray(e.value) ? e.value : [], i = a[0] || void 0, l = a[1] || void 0, m = e.presets ?? T, p = (c) => {
188
189
  if (!c) return;
189
- const [h, y, $] = c.split("-").map(Number);
190
- return new Date(h, y - 1, $);
190
+ const [h, g, $] = c.split("-").map(Number);
191
+ return new Date(h, g - 1, $);
191
192
  }, u = (c) => `${c.getFullYear()}-${String(c.getMonth() + 1).padStart(2, "0")}-${String(c.getDate()).padStart(2, "0")}`, v = (c, h) => r({
192
193
  filterId: e.id,
193
194
  type: e.type,
194
195
  value: [c ?? "", h ?? ""]
195
- }), f = (c) => {
196
+ }), y = (c) => {
196
197
  const h = e.maxDate ? p(e.maxDate) : /* @__PURE__ */ new Date();
197
198
  if (!h) return;
198
- const y = new Date(h);
199
- y.setDate(y.getDate() - c), v(u(y), u(h));
199
+ const g = new Date(h);
200
+ g.setDate(g.getDate() - c), v(u(g), u(h));
200
201
  };
201
202
  return /* @__PURE__ */ _("div", {
202
203
  className: "control-panel__filter-date-range",
@@ -205,10 +206,10 @@ var V = 3, D = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
205
206
  children: m.map((c) => /* @__PURE__ */ n(C, {
206
207
  size: "small",
207
208
  variant: "default",
208
- onClick: () => f(c.days),
209
+ onClick: () => y(c.days),
209
210
  children: c.label
210
211
  }, c.days))
211
- }), /* @__PURE__ */ n(w, {
212
+ }), /* @__PURE__ */ n(R, {
212
213
  mode: "range",
213
214
  minDate: p(e.minDate),
214
215
  maxDate: p(e.maxDate),
@@ -228,7 +229,7 @@ var V = 3, D = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
228
229
  });
229
230
  }
230
231
  if (e.type === "dropdown")
231
- return !e.multiple && t.length > 0 && t.length <= V ? /* @__PURE__ */ n("div", {
232
+ return !e.multiple && t.length > 0 && t.length <= H ? /* @__PURE__ */ n("div", {
232
233
  className: `control-panel__filter-list ${e.inline ? "control-panel__filter-list--inline" : ""}`,
233
234
  children: t.map((a) => {
234
235
  const i = e.value === a.value;
@@ -255,7 +256,7 @@ var V = 3, D = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
255
256
  className: "control-panel__filter-swatch",
256
257
  style: { backgroundColor: a.color }
257
258
  }),
258
- a.icon && /* @__PURE__ */ n(g, { name: a.icon }),
259
+ a.icon && /* @__PURE__ */ n(b, { name: a.icon }),
259
260
  /* @__PURE__ */ n("span", {
260
261
  className: "control-panel__filter-label",
261
262
  children: a.label
@@ -268,7 +269,7 @@ var V = 3, D = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
268
269
  })
269
270
  }, a.value);
270
271
  })
271
- }) : /* @__PURE__ */ n(R, {
272
+ }) : /* @__PURE__ */ n(E, {
272
273
  className: "control-panel__filter-dropdown",
273
274
  multiple: e.multiple,
274
275
  name: e.id,
@@ -277,7 +278,7 @@ var V = 3, D = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
277
278
  r({
278
279
  filterId: e.id,
279
280
  type: e.type,
280
- value: Array.isArray(a) ? S(a.map((l) => l.value)) : a?.value ?? null,
281
+ value: Array.isArray(a) ? I(a.map((l) => l.value)) : a?.value ?? null,
281
282
  option: Array.isArray(a) ? null : a,
282
283
  options: i
283
284
  });
@@ -293,7 +294,7 @@ var V = 3, D = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
293
294
  const a = s.trim().toLowerCase(), i = e.searchable && a ? t.filter((l) => l.label.toLowerCase().includes(a)) : t;
294
295
  return /* @__PURE__ */ _("div", {
295
296
  className: "control-panel__filter-chips-wrap",
296
- children: [e.searchable && t.length > 0 && /* @__PURE__ */ n(I, {
297
+ children: [e.searchable && t.length > 0 && /* @__PURE__ */ n(D, {
297
298
  className: "control-panel__filter-chip-search",
298
299
  value: s,
299
300
  onChange: d,
@@ -305,23 +306,21 @@ var V = 3, D = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
305
306
  overflowY: "auto"
306
307
  } : void 0,
307
308
  children: i.map((l) => {
308
- const m = o.includes(l.value);
309
- return /* @__PURE__ */ _(A, {
309
+ const m = o.includes(l.value), p = /* @__PURE__ */ _(S, {
310
310
  color: l.color,
311
311
  count: l.count,
312
312
  disabled: l.disabled,
313
313
  icon: l.icon,
314
- title: l.tooltip,
315
314
  selected: m,
316
315
  onClick: () => {
317
316
  if (l.disabled) return;
318
- const p = e.multiple === !1, u = p ? m ? [] : [l.value] : m ? o.filter((v) => v !== l.value) : [...o, l.value];
317
+ const u = e.multiple === !1, v = u ? m ? [] : [l.value] : m ? o.filter((y) => y !== l.value) : [...o, l.value];
319
318
  r({
320
319
  filterId: e.id,
321
320
  type: e.type,
322
- value: p ? u[0] ?? null : S(u),
321
+ value: u ? v[0] ?? null : I(v),
323
322
  option: l,
324
- options: t.filter((v) => u.includes(v.value))
323
+ options: t.filter((y) => v.includes(y.value))
325
324
  });
326
325
  },
327
326
  children: [l.imageUrl && /* @__PURE__ */ n("img", {
@@ -329,7 +328,11 @@ var V = 3, D = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
329
328
  src: l.imageUrl,
330
329
  alt: ""
331
330
  }), l.label]
332
- }, l.value);
331
+ });
332
+ return l.tooltip ? /* @__PURE__ */ n(k, {
333
+ title: l.tooltip,
334
+ children: p
335
+ }, l.value) : /* @__PURE__ */ n(P, { children: p }, l.value);
333
336
  })
334
337
  })]
335
338
  });
@@ -363,7 +366,7 @@ var V = 3, D = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
363
366
  className: "control-panel__filter-swatch",
364
367
  style: { backgroundColor: a.color }
365
368
  }),
366
- a.icon && /* @__PURE__ */ n(g, {
369
+ a.icon && /* @__PURE__ */ n(b, {
367
370
  className: "control-panel__filter-icon",
368
371
  name: a.icon
369
372
  }),
@@ -382,5 +385,5 @@ var V = 3, D = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
382
385
  });
383
386
  };
384
387
  export {
385
- ne as ControlPanelFilterItem
388
+ te as ControlPanelFilterItem
386
389
  };
@@ -1,63 +1,74 @@
1
1
  import './Drawer.css';
2
- import { Icon as A } from "../Icon/Icon2.js";
3
- import { useBodyScrollLock as T } from "../../hooks/useBodyScrollLock.js";
4
- import { Button as i } from "../Button/Button2.js";
5
- import { Tooltip as w } from "../Tooltip/Tooltip2.js";
2
+ import { Icon as T } from "../Icon/Icon2.js";
3
+ import { useBodyScrollLock as Z } from "../../hooks/useBodyScrollLock.js";
4
+ import { Button as l } from "../Button/Button2.js";
5
+ import { Tooltip as v } from "../Tooltip/Tooltip2.js";
6
6
  /* empty css */
7
- import Z, { useEffect as k, useState as V } from "react";
8
- import { Fragment as W, jsx as r, jsxs as l } from "react/jsx-runtime";
9
- var X = 1e3, x = 0, Q = ({ isOpen: d, onClose: n, position: b = "left", width: N = "320px", maxWidth: C = "none", margin: I = 0, borderRadius: g = 0, shadow: E = "none", children: p, title: s, icon: c, className: z = "", showOverlay: S = !0, lockScroll: j = !0, hideClose: F = !1, actions: _ = [], onBack: v, backLabel: $ = "Back", primary: t, secondary: a, footer: m }) => {
10
- T(d && j);
11
- const [B, D] = V(0);
12
- if (k(() => {
13
- d && (x += 1, D(x));
14
- }, [d]), k(() => {
15
- const e = (o) => {
16
- o.key === "Escape" && d && n();
7
+ import V, { useEffect as b, useState as W } from "react";
8
+ import { Fragment as X, jsx as r, jsxs as i } from "react/jsx-runtime";
9
+ var q = 1e3, N = 0, o = [], U = ({ isOpen: n, onClose: s, position: p = "left", width: g = "320px", maxWidth: C = "none", margin: I = 0, borderRadius: E = 0, shadow: z = "none", children: S, title: c, icon: m, className: j = "", showOverlay: D = !0, lockScroll: F = !0, hideClose: $ = !1, actions: _ = [], onBack: f, backLabel: B = "Back", primary: t, secondary: a, footer: h }) => {
10
+ Z(n && F);
11
+ const [w, L] = W(0);
12
+ if (b(() => {
13
+ if (!n) return;
14
+ N += 1;
15
+ const e = N;
16
+ return L(e), o.push(e), () => {
17
+ const d = o.indexOf(e);
18
+ d !== -1 && o.splice(d, 1);
19
+ };
20
+ }, [n]), b(() => {
21
+ if (!n) return;
22
+ const e = (d) => {
23
+ d.key !== "Escape" || o[o.length - 1] !== w || s();
17
24
  };
18
25
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
19
- }, [d, n]), !d) return null;
20
- const h = (e) => typeof e == "number" ? `${e}px` : e, f = X + B * 2, L = {
21
- "--drawer-width": N,
22
- "--drawer-max-width": h(C),
23
- "--drawer-margin": h(I),
24
- "--drawer-border-radius": h(g),
25
- "--drawer-shadow": E,
26
- zIndex: f + 1
27
- }, R = m || t || a;
28
- return /* @__PURE__ */ l(W, { children: [S && /* @__PURE__ */ r("div", {
26
+ }, [
27
+ n,
28
+ s,
29
+ w
30
+ ]), !n) return null;
31
+ const u = (e) => typeof e == "number" ? `${e}px` : e, k = q + w * 2, R = {
32
+ "--drawer-width": g,
33
+ "--drawer-max-width": u(C),
34
+ "--drawer-margin": u(I),
35
+ "--drawer-border-radius": u(E),
36
+ "--drawer-shadow": z,
37
+ zIndex: k + 1
38
+ }, A = h || t || a;
39
+ return /* @__PURE__ */ i(X, { children: [D && /* @__PURE__ */ r("div", {
29
40
  className: "drawer-overlay",
30
- onClick: n,
31
- style: { zIndex: f }
32
- }), /* @__PURE__ */ l("div", {
33
- className: `drawer drawer--${b} ${z}`,
34
- style: L,
41
+ onClick: s,
42
+ style: { zIndex: k }
43
+ }), /* @__PURE__ */ i("div", {
44
+ className: `drawer drawer--${p} ${j}`,
45
+ style: R,
35
46
  children: [
36
- /* @__PURE__ */ l("div", {
47
+ /* @__PURE__ */ i("div", {
37
48
  className: "drawer__header",
38
49
  children: [
39
- v && /* @__PURE__ */ r(w, {
40
- title: $,
50
+ f && /* @__PURE__ */ r(v, {
51
+ title: B,
41
52
  position: "bottom",
42
- children: /* @__PURE__ */ r(i, {
53
+ children: /* @__PURE__ */ r(l, {
43
54
  className: "drawer__back",
44
- onClick: v,
55
+ onClick: f,
45
56
  size: "small",
46
57
  variant: "ghost",
47
58
  icon: "arrow-left"
48
59
  })
49
60
  }),
50
- (s || c) && /* @__PURE__ */ l("h2", {
61
+ (c || m) && /* @__PURE__ */ i("h2", {
51
62
  className: "drawer__title",
52
- children: [c && /* @__PURE__ */ r(A, { name: c }), s && /* @__PURE__ */ r("span", {
63
+ children: [m && /* @__PURE__ */ r(T, { name: m }), c && /* @__PURE__ */ r("span", {
53
64
  className: "drawer__title-text",
54
- children: s
65
+ children: c
55
66
  })]
56
67
  }),
57
68
  _.length > 0 && /* @__PURE__ */ r("div", {
58
69
  className: "drawer__header-actions",
59
70
  children: _.map((e) => {
60
- const o = /* @__PURE__ */ r(i, {
71
+ const d = /* @__PURE__ */ r(l, {
61
72
  disabled: e.disabled,
62
73
  onClick: e.onClick,
63
74
  icon: e.icon,
@@ -65,20 +76,20 @@ var X = 1e3, x = 0, Q = ({ isOpen: d, onClose: n, position: b = "left", width: N
65
76
  size: e.size ?? "small",
66
77
  variant: e.variant ?? "ghost",
67
78
  children: e.label
68
- }), u = e.title ?? e.label;
69
- return u ? /* @__PURE__ */ r(w, {
70
- title: u,
79
+ }), x = e.title ?? e.label;
80
+ return x ? /* @__PURE__ */ r(v, {
81
+ title: x,
71
82
  position: "bottom",
72
- children: o
73
- }, e.id) : /* @__PURE__ */ r(Z.Fragment, { children: o }, e.id);
83
+ children: d
84
+ }, e.id) : /* @__PURE__ */ r(V.Fragment, { children: d }, e.id);
74
85
  })
75
86
  }),
76
- !F && /* @__PURE__ */ r(w, {
87
+ !$ && /* @__PURE__ */ r(v, {
77
88
  title: "Close drawer",
78
- children: /* @__PURE__ */ r(i, {
89
+ children: /* @__PURE__ */ r(l, {
79
90
  className: "drawer__close",
80
91
  icon: "clear",
81
- onClick: n,
92
+ onClick: s,
82
93
  size: "medium",
83
94
  variant: "ghost"
84
95
  })
@@ -87,22 +98,22 @@ var X = 1e3, x = 0, Q = ({ isOpen: d, onClose: n, position: b = "left", width: N
87
98
  }),
88
99
  /* @__PURE__ */ r("div", {
89
100
  className: "drawer__content",
90
- children: p
101
+ children: S
91
102
  }),
92
- R && /* @__PURE__ */ l("div", {
103
+ A && /* @__PURE__ */ i("div", {
93
104
  className: "drawer__footer",
94
- children: [m && /* @__PURE__ */ r("div", {
105
+ children: [h && /* @__PURE__ */ r("div", {
95
106
  className: "drawer__footer-content",
96
- children: m
97
- }), (t || a) && /* @__PURE__ */ l("div", {
107
+ children: h
108
+ }), (t || a) && /* @__PURE__ */ i("div", {
98
109
  className: "drawer__footer-actions",
99
- children: [a && /* @__PURE__ */ r(i, {
110
+ children: [a && /* @__PURE__ */ r(l, {
100
111
  variant: a.variant || "default",
101
112
  icon: a.icon,
102
113
  disabled: a.disabled,
103
114
  onClick: a.onClick,
104
115
  children: a.text
105
- }), t && /* @__PURE__ */ r(i, {
116
+ }), t && /* @__PURE__ */ r(l, {
106
117
  variant: t.variant || "info",
107
118
  icon: t.icon,
108
119
  disabled: t.disabled,
@@ -115,5 +126,5 @@ var X = 1e3, x = 0, Q = ({ isOpen: d, onClose: n, position: b = "left", width: N
115
126
  })] });
116
127
  };
117
128
  export {
118
- Q as Drawer
129
+ U as Drawer
119
130
  };
@@ -1,9 +1,10 @@
1
1
  import './EmojiPicker.css';
2
- import { InputSearch as h } from "../InputSearch/InputSearch2.js";
3
- import { EMOJI_KEYWORDS as v } from "./emojiKeywords/index.js";
2
+ import { Tooltip as h } from "../Tooltip/Tooltip2.js";
3
+ import { InputSearch as v } from "../InputSearch/InputSearch2.js";
4
+ import { EMOJI_KEYWORDS as _ } from "./emojiKeywords/index.js";
4
5
  /* empty css */
5
- import { useMemo as _, useState as n } from "react";
6
- import { jsx as i, jsxs as f } from "react/jsx-runtime";
6
+ import { useMemo as f, useState as a } from "react";
7
+ import { jsx as i, jsxs as k } from "react/jsx-runtime";
7
8
  var m = [
8
9
  {
9
10
  id: "smileys",
@@ -743,18 +744,18 @@ var m = [
743
744
  "🈲"
744
745
  ]
745
746
  }
746
- ], E = ({ value: t, onChange: l }) => {
747
- const [o, d] = n(""), [r, j] = n(m[0].id), c = _(() => {
747
+ ], A = ({ value: n, onChange: l }) => {
748
+ const [o, d] = a(""), [r, p] = a(m[0].id), c = f(() => {
748
749
  if (!o.trim()) return null;
749
750
  const e = o.toLowerCase();
750
- return m.flatMap((s) => s.emojis.filter((p) => v[p]?.some((u) => u.includes(e)) || s.name.toLowerCase().includes(e)));
751
- }, [o]), a = c ?? m.find((e) => e.id === r)?.emojis ?? [];
752
- return /* @__PURE__ */ f("div", {
751
+ return m.flatMap((s) => s.emojis.filter((j) => _[j]?.some((u) => u.includes(e)) || s.name.toLowerCase().includes(e)));
752
+ }, [o]), t = c ?? m.find((e) => e.id === r)?.emojis ?? [];
753
+ return /* @__PURE__ */ k("div", {
753
754
  className: "emoji-picker",
754
755
  children: [
755
756
  /* @__PURE__ */ i("div", {
756
757
  className: "emoji-picker__search",
757
- children: /* @__PURE__ */ i(h, {
758
+ children: /* @__PURE__ */ i(v, {
758
759
  placeholder: "Search emoji...",
759
760
  value: o,
760
761
  onChange: d,
@@ -763,20 +764,22 @@ var m = [
763
764
  }),
764
765
  !c && /* @__PURE__ */ i("div", {
765
766
  className: "emoji-picker__categories",
766
- children: m.map((e) => /* @__PURE__ */ i("button", {
767
- className: `emoji-picker__cat-btn${r === e.id ? " is-active" : ""}`,
767
+ children: m.map((e) => /* @__PURE__ */ i(h, {
768
768
  title: e.name,
769
- onClick: () => j(e.id),
770
- children: e.icon
769
+ children: /* @__PURE__ */ i("button", {
770
+ className: `emoji-picker__cat-btn${r === e.id ? " is-active" : ""}`,
771
+ onClick: () => p(e.id),
772
+ children: e.icon
773
+ })
771
774
  }, e.id))
772
775
  }),
773
776
  /* @__PURE__ */ i("div", {
774
777
  className: "emoji-picker__grid",
775
- children: a.length === 0 ? /* @__PURE__ */ i("p", {
778
+ children: t.length === 0 ? /* @__PURE__ */ i("p", {
776
779
  className: "emoji-picker__empty",
777
780
  children: "No results"
778
- }) : a.map((e, s) => /* @__PURE__ */ i("button", {
779
- className: `emoji-picker__emoji${t === e ? " is-selected" : ""}`,
781
+ }) : t.map((e, s) => /* @__PURE__ */ i("button", {
782
+ className: `emoji-picker__emoji${n === e ? " is-selected" : ""}`,
780
783
  onClick: () => l?.(e),
781
784
  children: e
782
785
  }, s))
@@ -785,5 +788,5 @@ var m = [
785
788
  });
786
789
  };
787
790
  export {
788
- E as EmojiPicker
791
+ A as EmojiPicker
789
792
  };