@layers-app/shared 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/components/AppContainer/AppContainer.d.ts +1 -1
  2. package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
  3. package/dist/components/AppContainer/AppContainer.js +31 -23
  4. package/dist/components/AppContainer/hooks/useAppContainerStore.d.ts.map +1 -1
  5. package/dist/components/AppContainer/hooks/useAppContainerStore.js +12 -9
  6. package/dist/components/AppContainer/types.d.ts +1 -0
  7. package/dist/components/AppContainer/types.d.ts.map +1 -1
  8. package/dist/components/EmojiPicker/EmojiPanel.d.ts.map +1 -1
  9. package/dist/components/EmojiPicker/EmojiPanel.js +50 -49
  10. package/dist/components/EmojiPicker/IconsPanel.d.ts.map +1 -1
  11. package/dist/components/EmojiPicker/IconsPanel.js +79 -78
  12. package/dist/components/FilePicker/FilePicker.d.ts +2 -3
  13. package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
  14. package/dist/components/FilePicker/FilePicker.js +88 -122
  15. package/dist/components/FilePicker/FilePickerGiphy.d.ts +1 -3
  16. package/dist/components/FilePicker/FilePickerGiphy.d.ts.map +1 -1
  17. package/dist/components/FilePicker/FilePickerGiphy.js +43 -44
  18. package/dist/components/FilePicker/FilePickerLink.d.ts +2 -3
  19. package/dist/components/FilePicker/FilePickerLink.d.ts.map +1 -1
  20. package/dist/components/FilePicker/FilePickerLink.js +21 -21
  21. package/dist/components/FilePicker/FilePickerUnsplash.d.ts +1 -3
  22. package/dist/components/FilePicker/FilePickerUnsplash.d.ts.map +1 -1
  23. package/dist/components/FilePicker/FilePickerUnsplash.js +45 -46
  24. package/dist/components/FilePicker/FilePickerUpload.d.ts +3 -3
  25. package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
  26. package/dist/components/FilePicker/FilePickerUpload.js +49 -43
  27. package/dist/components/NavMenu/components/NavMenuItem.d.ts.map +1 -1
  28. package/dist/components/NavMenu/components/NavMenuItem.js +6 -5
  29. package/dist/components/WorkspaceMenu/WorkspaceMenu.d.ts +2 -2
  30. package/dist/components/WorkspaceMenu/WorkspaceMenu.d.ts.map +1 -1
  31. package/dist/components/WorkspaceMenu/WorkspaceMenu.js +100 -103
  32. package/dist/lang/locales/ui_en.json.js +20 -12
  33. package/dist/lang/locales/ui_es.json.js +18 -10
  34. package/dist/lang/locales/ui_ru.json.js +24 -16
  35. package/package.json +1 -1
@@ -5,7 +5,7 @@ declare global {
5
5
  preSignMode?: boolean;
6
6
  }
7
7
  }
8
- export declare const AppContainer: (({ header, content, toolbar, navbarTitle, footer, onTitleChange, trashMenu, rightbar, onInviteClick, showAppsSidebar, }: AppContainerProps) => import("react/jsx-runtime").JSX.Element) & {
8
+ export declare const AppContainer: (({ header, content, toolbar, navbarTitle, footer, onTitleChange, trashMenu, rightbar, onInviteClick, showAppsSidebar, headerBorderless, }: AppContainerProps) => import("react/jsx-runtime").JSX.Element) & {
9
9
  NavbarContent: ({ children }: import("react").PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
10
10
  NewButton: ({ children, ...props }: import("@mantine/core").PolymorphicComponentProps<"button", import("@mantine/core").ButtonProps>) => import("react/jsx-runtime").JSX.Element;
11
11
  };
@@ -1 +1 @@
1
- {"version":3,"file":"AppContainer.d.ts","sourceRoot":"","sources":["../../../src/components/AppContainer/AppContainer.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,WAAW,CAAC,EAAE,OAAO,CAAC;KACvB;CACF;AAqED,eAAO,MAAM,YAAY,4HAxDtB,iBAAiB;;;CA2DlB,CAAC"}
1
+ {"version":3,"file":"AppContainer.d.ts","sourceRoot":"","sources":["../../../src/components/AppContainer/AppContainer.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,WAAW,CAAC,EAAE,OAAO,CAAC;KACvB;CACF;AAyED,eAAO,MAAM,YAAY,8IA3DtB,iBAAiB;;;CA8DlB,CAAC"}
@@ -1,42 +1,50 @@
1
1
  import { jsxs as o, jsx as r } from "react/jsx-runtime";
2
- import { useEffect as C } from "react";
3
- import { useMantineColorScheme as y, Stack as A, Flex as j } from "@mantine/core";
2
+ import { useEffect as y } from "react";
3
+ import { useMantineColorScheme as v, Stack as A, Flex as j } from "@mantine/core";
4
4
  import { useQueryParam as k } from "../../hooks/useNumberQueryParam.js";
5
5
  import { AppShell as e } from "../AppShell/AppShell.js";
6
- import { AppsSidebar as v } from "./components/AppsSidebar/AppsSidebar.js";
6
+ import { AppsSidebar as B } from "./components/AppsSidebar/AppsSidebar.js";
7
7
  import { Header as H } from "./components/Header.js";
8
8
  import { Main as N } from "./components/Main.js";
9
9
  import T from "./components/NavbarContent.js";
10
10
  import { RightSidebar as W } from "./components/RightSidebar.js";
11
- import { ToolSidebar as B } from "./components/ToolSidebar.js";
12
- import { ToolbarNewButton as M } from "./components/ToolbarNewButton.js";
13
- import { appContainerStore as P } from "./hooks/useAppContainerStore.js";
14
- const $ = ({
11
+ import { ToolSidebar as M } from "./components/ToolSidebar.js";
12
+ import { ToolbarNewButton as P } from "./components/ToolbarNewButton.js";
13
+ import { appContainerStore as $ } from "./hooks/useAppContainerStore.js";
14
+ const E = ({
15
15
  header: h,
16
16
  content: l,
17
17
  toolbar: i,
18
- navbarTitle: c,
18
+ navbarTitle: d,
19
19
  footer: n,
20
- onTitleChange: d,
21
- trashMenu: s,
20
+ onTitleChange: s,
21
+ trashMenu: c,
22
22
  rightbar: m,
23
23
  onInviteClick: f,
24
- showAppsSidebar: u = !0
24
+ showAppsSidebar: b = !0,
25
+ headerBorderless: u = !1
25
26
  }) => {
26
- const { toolbarWidth: S, rightbarWidth: b, layout: a } = P.useStore(), { setColorScheme: p } = y(), t = k("theme");
27
- C(() => {
27
+ const { toolbarWidth: S, rightbarWidth: x, layout: a } = $.useStore(), { setColorScheme: p } = v(), t = k("theme");
28
+ y(() => {
28
29
  (t === "dark" || t === "light") && p(t);
29
30
  }, [t, p]);
30
- const x = {
31
+ const w = {
31
32
  "--toolbar-width": `${S}px`,
32
- "--rightbar-width": `${b}px`
33
- }, w = a !== "nothing", g = a === "default" && i;
34
- return /* @__PURE__ */ o(e, { style: x, children: [
35
- u && /* @__PURE__ */ r(e.Section, { w: "var(--apps-sidebar-width)", children: /* @__PURE__ */ r(v, { onInviteClick: f, trashMenu: s }) }),
33
+ "--rightbar-width": `${x}px`
34
+ }, g = a !== "nothing", C = a === "default" && i;
35
+ return /* @__PURE__ */ o(e, { style: w, children: [
36
+ b && /* @__PURE__ */ r(e.Section, { w: "var(--apps-sidebar-width)", children: /* @__PURE__ */ r(B, { onInviteClick: f, trashMenu: c }) }),
36
37
  /* @__PURE__ */ o(e.Section, { flex: 1, display: "flex", pos: "relative", children: [
37
- g && /* @__PURE__ */ r(B, { onTitleChange: d, navbarTitle: c, children: i }),
38
+ C && /* @__PURE__ */ r(M, { onTitleChange: s, navbarTitle: d, children: i }),
38
39
  /* @__PURE__ */ o(A, { mih: 0, gap: 0, h: "100%", flex: 2, miw: 0, children: [
39
- w && /* @__PURE__ */ r(e.Header, { px: "sm", children: /* @__PURE__ */ r(H, { children: h }) }),
40
+ g && /* @__PURE__ */ r(
41
+ e.Header,
42
+ {
43
+ px: "sm",
44
+ style: u ? { borderBottom: "none" } : void 0,
45
+ children: /* @__PURE__ */ r(H, { children: h })
46
+ }
47
+ ),
40
48
  /* @__PURE__ */ o(j, { mih: 0, gap: 0, h: "100%", children: [
41
49
  /* @__PURE__ */ r(e.WorkContent, { children: /* @__PURE__ */ o(N, { children: [
42
50
  l,
@@ -47,10 +55,10 @@ const $ = ({
47
55
  ] })
48
56
  ] })
49
57
  ] });
50
- }, L = Object.assign($, {
58
+ }, U = Object.assign(E, {
51
59
  NavbarContent: T,
52
- NewButton: M
60
+ NewButton: P
53
61
  });
54
62
  export {
55
- L as AppContainer
63
+ U as AppContainer
56
64
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useAppContainerStore.d.ts","sourceRoot":"","sources":["../../../../src/components/AppContainer/hooks/useAppContainerStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAU,MAAM,SAAS,CAAC;AAI1D,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AA+GjE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;iCA9CI,OAAO;iCAIP,MAAM;kCAIL,MAAM;mCAKL,MAAM;4BASb,kBAAkB;0BAIpB,MAAM;;CAoByB,CAAC"}
1
+ {"version":3,"file":"useAppContainerStore.d.ts","sourceRoot":"","sources":["../../../../src/components/AppContainer/hooks/useAppContainerStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAU,MAAM,SAAS,CAAC;AAI1D,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAyHjE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;iCA9CI,OAAO;iCAIP,MAAM;kCAIL,MAAM;mCAKL,MAAM;4BASb,kBAAkB;0BAIpB,MAAM;;CAoByB,CAAC"}
@@ -1,13 +1,13 @@
1
1
  import { create as l } from "zustand";
2
2
  import { persist as n, createJSONStorage as g } from "zustand/middleware";
3
- import { DEFAULT_COLOR_SCHEME as r, isValidColorScheme as b } from "../../../constants.js";
4
- const i = 338, c = () => {
3
+ import { DEFAULT_COLOR_SCHEME as i, isValidColorScheme as b } from "../../../constants.js";
4
+ const r = 338, d = () => typeof window > "u" ? !0 : !window.matchMedia("(max-width: 992px)").matches, c = () => {
5
5
  const o = l(
6
6
  n(
7
7
  () => ({
8
8
  layout: "default",
9
- showToolbar: !0,
10
- theme: r,
9
+ showToolbar: d(),
10
+ theme: i,
11
11
  hiddenTools: [],
12
12
  toolbarWidth: 280,
13
13
  isTourPassed: !1,
@@ -19,10 +19,13 @@ const i = 338, c = () => {
19
19
  version: 3,
20
20
  storage: g(() => localStorage),
21
21
  migrate: (e) => {
22
- const s = typeof e?.theme == "string" && b(e.theme) ? e.theme : r;
22
+ const s = typeof e?.theme == "string" && b(e.theme) ? e.theme : i;
23
23
  return {
24
24
  ...e,
25
- rightbarWidth: Math.max(e?.rightbarWidth || 0, i),
25
+ rightbarWidth: Math.max(
26
+ e?.rightbarWidth || 0,
27
+ r
28
+ ),
26
29
  theme: s
27
30
  };
28
31
  }
@@ -51,7 +54,7 @@ const i = 338, c = () => {
51
54
  o.setState({ toolbarWidth: t });
52
55
  },
53
56
  setRightbarWidth: (t) => {
54
- const a = Math.max(t, i);
57
+ const a = Math.max(t, r);
55
58
  o.setState({ rightbarWidth: a });
56
59
  },
57
60
  toggleToolVisibility: (t) => {
@@ -66,7 +69,7 @@ const i = 338, c = () => {
66
69
  setTheme: (t) => {
67
70
  o.setState({ theme: t });
68
71
  }
69
- }), M = c();
72
+ }), I = c();
70
73
  export {
71
- M as appContainerStore
74
+ I as appContainerStore
72
75
  };
@@ -15,6 +15,7 @@ export type ToolDef = {
15
15
  };
16
16
  export type AppContainerProps = {
17
17
  showAppsSidebar?: boolean;
18
+ headerBorderless?: boolean;
18
19
  content?: ReactNode;
19
20
  toolbar?: ReactNode;
20
21
  rightbar?: ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/AppContainer/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAs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ojiPanel.d.ts","sourceRoot":"","sources":["../../../src/components/EmojiPicker/EmojiPanel.tsx"],"names":[],"mappings":"AAyCA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAqBjD,eAAO,MAAM,UAAU,GAAI,6DAMxB,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,aAAa,CAAC,GAAG;IAC5E,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC,4CAmTA,CAAC"}
@@ -1,23 +1,23 @@
1
- import { jsxs as v, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as y, jsx as t } from "react/jsx-runtime";
2
2
  import { useState as u, useRef as d, useEffect as R, useCallback as K } from "react";
3
3
  import { useTranslation as L } from "react-i18next";
4
4
  import { Search01Icon as U, ShuffleIcon as V, Clock01Icon as W, SmileIcon as X, Pizza01Icon as Z, FootballIcon as _, Airplane01Icon as ee, BulbIcon as te, Asterisk02Icon as oe, Flag02Icon as re } from "@hugeicons/core-free-icons";
5
5
  import { HugeiconsIcon as c } from "@hugeicons/react";
6
- import { Stack as z, FocusTrap as ne, Flex as j, TextInput as ie, Tooltip as ce, ActionIcon as A, Paper as F, Text as q, SimpleGrid as N, Box as se } from "@mantine/core";
7
- import { useEvent as ae } from "draggable-ui";
8
- import le from "fuse.js";
9
- import fe from "../../assets/svg/dog.svg.js";
10
- import { pickRandomEmoji as ue } from "../../helpers/pickRandomEmoji.js";
11
- import { NoData as de } from "../NoData/NoData.js";
12
- import { IconEntity as me } from "../ProjectIcon/ProjectIcon.js";
13
- import { frequentEmoji as pe } from "./constants.js";
6
+ import { Stack as v, FocusTrap as ne, Flex as x, TextInput as ie, Tooltip as ce, ActionIcon as A, Paper as F, Text as q, SimpleGrid as N } from "@mantine/core";
7
+ import { useEvent as se } from "draggable-ui";
8
+ import ae from "fuse.js";
9
+ import le from "../../assets/svg/dog.svg.js";
10
+ import { pickRandomEmoji as fe } from "../../helpers/pickRandomEmoji.js";
11
+ import { NoData as ue } from "../NoData/NoData.js";
12
+ import { IconEntity as de } from "../ProjectIcon/ProjectIcon.js";
13
+ import { frequentEmoji as me } from "./constants.js";
14
14
  import T from "./EmojiPicker.module.css.js";
15
- const he = [
15
+ const pe = [
16
16
  { i: "frequent", icon: /* @__PURE__ */ t(c, { size: 20, icon: W }) },
17
17
  { i: "people", icon: /* @__PURE__ */ t(c, { size: 20, icon: X }) },
18
18
  {
19
19
  i: "nature",
20
- icon: /* @__PURE__ */ t(fe, { width: 20, height: 20 })
20
+ icon: /* @__PURE__ */ t(le, { width: 20, height: 20 })
21
21
  },
22
22
  { i: "foods", icon: /* @__PURE__ */ t(c, { size: 20, icon: Z }) },
23
23
  { i: "activity", icon: /* @__PURE__ */ t(c, { size: 20, icon: _ }) },
@@ -25,18 +25,18 @@ const he = [
25
25
  { i: "objects", icon: /* @__PURE__ */ t(c, { size: 20, icon: te }) },
26
26
  { i: "symbols", icon: /* @__PURE__ */ t(c, { size: 20, icon: oe }) },
27
27
  { i: "flags", icon: /* @__PURE__ */ t(c, { size: 20, icon: re }) }
28
- ], Re = ({
28
+ ], Ee = ({
29
29
  locales: m,
30
- onChange: x,
30
+ onChange: C,
31
31
  onClose: M,
32
32
  setRandomIcon: P,
33
33
  querySearch: p
34
34
  }) => {
35
- const [y, b] = u("frequent"), k = d("frequent"), h = d({}), I = d(null), [C, w] = u(""), [Q, B] = u([]), [a, O] = u(null), [S, E] = u([]), { t: G } = L(), g = d(!1), l = d(null);
35
+ const [b, k] = u("frequent"), I = d("frequent"), h = d({}), z = d(null), [w, S] = u(""), [Q, O] = u([]), [a, B] = u(null), [D, E] = u([]), { t: G } = L(), g = d(!1), l = d(null);
36
36
  R(() => {
37
37
  if (typeof p == "string") {
38
38
  const e = p.slice(1);
39
- if (w(e), a) {
39
+ if (S(e), a) {
40
40
  const o = a.search(e);
41
41
  E(o.map((r) => r.item.e));
42
42
  }
@@ -50,11 +50,11 @@ const he = [
50
50
  k: n.k
51
51
  // категория
52
52
  }))
53
- ), s = pe.map(
53
+ ), s = me.map(
54
54
  (i) => r.find((n) => n.e === i)
55
55
  );
56
- B([{ i: "frequent", e: s }, ...o]);
57
- const f = new le(
56
+ O([{ i: "frequent", e: s }, ...o]);
57
+ const f = new ae(
58
58
  o.flatMap(
59
59
  (i) => i.e.map((n) => ({
60
60
  e: n.e,
@@ -67,40 +67,40 @@ const he = [
67
67
  threshold: 0.3
68
68
  }
69
69
  );
70
- O(f);
70
+ B(f);
71
71
  })();
72
72
  }, []);
73
73
  const H = K(
74
74
  (e) => {
75
75
  const o = e.currentTarget.value;
76
- if (w(o), a) {
76
+ if (S(o), a) {
77
77
  const r = a.search(o);
78
78
  E(r.map((s) => s.item.e));
79
79
  }
80
80
  },
81
81
  [a]
82
- ), D = ae((e) => {
82
+ ), j = se((e) => {
83
83
  const o = e.currentTarget.getAttribute("data-icon");
84
- o && (x?.(
85
- me.stringify({
84
+ o && (C?.(
85
+ de.stringify({
86
86
  emoji: o.replace("e:", "")
87
87
  })
88
88
  ), M());
89
89
  }), Y = (e) => {
90
- const o = I.current, r = h.current[e.i];
90
+ const o = z.current, r = h.current[e.i];
91
91
  if (!o || !r) return;
92
- g.current = !0, l.current = e.i, b(e.i);
92
+ g.current = !0, l.current = e.i, k(e.i);
93
93
  const s = r.offsetTop - o.offsetTop;
94
94
  o.scrollTo({ top: s, behavior: "smooth" });
95
95
  }, $ = () => {
96
- const e = I.current;
96
+ const e = z.current;
97
97
  if (!e) return;
98
98
  const o = e.scrollTop;
99
99
  if (g.current && l.current) {
100
100
  const f = h.current[l.current];
101
101
  if (f) {
102
102
  const i = f.offsetTop - e.offsetTop;
103
- Math.abs(i - o) < 12 && (g.current = !1, k.current = l.current, b(l.current), l.current = null);
103
+ Math.abs(i - o) < 12 && (g.current = !1, I.current = l.current, k(l.current), l.current = null);
104
104
  }
105
105
  if (g.current) return;
106
106
  }
@@ -110,11 +110,11 @@ const he = [
110
110
  const n = Math.abs(i.offsetTop - e.offsetTop - o);
111
111
  n < s && (s = n, r = f);
112
112
  }
113
- }), r !== k.current && (k.current = r, b(r));
113
+ }), r !== I.current && (I.current = r, k(r));
114
114
  }, J = typeof p == "string";
115
- return /* @__PURE__ */ v(z, { gap: 0, h: "100%", children: [
116
- /* @__PURE__ */ t(ne, { active: !0, children: /* @__PURE__ */ v(
117
- j,
115
+ return /* @__PURE__ */ y(v, { gap: 0, h: "100%", children: [
116
+ /* @__PURE__ */ t(ne, { active: !0, children: /* @__PURE__ */ y(
117
+ x,
118
118
  {
119
119
  my: "sm",
120
120
  justify: "space-between",
@@ -127,7 +127,7 @@ const he = [
127
127
  ie,
128
128
  {
129
129
  leftSection: /* @__PURE__ */ t(c, { size: 16, icon: U }),
130
- value: C,
130
+ value: w,
131
131
  placeholder: `${m?.search}...`,
132
132
  "data-autofocus": !0,
133
133
  styles: {
@@ -148,7 +148,7 @@ const he = [
148
148
  w: 36,
149
149
  variant: "outline",
150
150
  color: "var(--mantine-color-default-border)",
151
- onClick: () => ue(P, x),
151
+ onClick: () => fe(P, C),
152
152
  className: T.randomIcon,
153
153
  children: /* @__PURE__ */ t(
154
154
  c,
@@ -163,8 +163,8 @@ const he = [
163
163
  ]
164
164
  }
165
165
  ) }),
166
- /* @__PURE__ */ t(z, { pl: 8, h: "230px", children: /* @__PURE__ */ t(
167
- z,
166
+ /* @__PURE__ */ t(v, { pl: 8, h: "230px", children: /* @__PURE__ */ t(
167
+ v,
168
168
  {
169
169
  gap: "xs",
170
170
  h: "100%",
@@ -172,9 +172,9 @@ const he = [
172
172
  style: {
173
173
  overflowY: "auto"
174
174
  },
175
- ref: I,
175
+ ref: z,
176
176
  onScroll: $,
177
- children: C ? /* @__PURE__ */ v("div", { children: [
177
+ children: w ? /* @__PURE__ */ y(v, { flex: 1, justify: "center", align: "stretch", children: [
178
178
  !J && /* @__PURE__ */ t(
179
179
  F,
180
180
  {
@@ -186,18 +186,19 @@ const he = [
186
186
  children: /* @__PURE__ */ t(q, { fz: "sm", c: "dimmed", children: m?.searchResults })
187
187
  }
188
188
  ),
189
- S.length ? /* @__PURE__ */ t(N, { cols: 10, spacing: 0, children: S.map((e) => /* @__PURE__ */ t(
189
+ D.length ? /* @__PURE__ */ t(N, { cols: 10, spacing: 0, children: D.map((e) => /* @__PURE__ */ t(
190
190
  "div",
191
191
  {
192
192
  className: T.item,
193
193
  "data-icon": e,
194
- onClick: D,
194
+ onClick: j,
195
195
  children: e
196
196
  },
197
197
  e
198
- )) }) : /* @__PURE__ */ t(se, { children: /* @__PURE__ */ t(
199
- de,
198
+ )) }) : /* @__PURE__ */ t(x, { flex: 1, justify: "center", align: "stretch", children: /* @__PURE__ */ t(
199
+ ue,
200
200
  {
201
+ showDots: !1,
201
202
  size: 100,
202
203
  description: m?.searchNoResults,
203
204
  descriptionProps: {
@@ -205,7 +206,7 @@ const he = [
205
206
  }
206
207
  }
207
208
  ) })
208
- ] }) : Q.map((e) => /* @__PURE__ */ v(
209
+ ] }) : Q.map((e) => /* @__PURE__ */ y(
209
210
  "div",
210
211
  {
211
212
  ref: (o) => {
@@ -229,7 +230,7 @@ const he = [
229
230
  {
230
231
  className: T.item,
231
232
  "data-icon": o.e,
232
- onClick: D,
233
+ onClick: j,
233
234
  children: o.e
234
235
  },
235
236
  o.e
@@ -241,7 +242,7 @@ const he = [
241
242
  }
242
243
  ) }),
243
244
  /* @__PURE__ */ t(
244
- j,
245
+ x,
245
246
  {
246
247
  style: {
247
248
  borderTop: "1px solid var(--tab-border-color)"
@@ -249,15 +250,15 @@ const he = [
249
250
  justify: "space-between",
250
251
  h: "56px",
251
252
  px: 8,
252
- children: he.map((e) => /* @__PURE__ */ t(
253
+ children: pe.map((e) => /* @__PURE__ */ t(
253
254
  A,
254
255
  {
255
- variant: y === e.i ? "light" : "subtle",
256
- color: y === e.i ? "var(--mantine-color-default-color)" : "var(--mantine-color-dimmed)",
256
+ variant: b === e.i ? "light" : "subtle",
257
+ color: b === e.i ? "var(--mantine-color-default-color)" : "var(--mantine-color-dimmed)",
257
258
  radius: "default",
258
259
  size: 32,
259
260
  onClick: () => Y(e),
260
- "data-active": y === e.i,
261
+ "data-active": b === e.i,
261
262
  children: e.icon
262
263
  },
263
264
  e.i
@@ -267,5 +268,5 @@ const he = [
267
268
  ] });
268
269
  };
269
270
  export {
270
- Re as EmojiPanel
271
+ Ee as EmojiPanel
271
272
  };
@@ -1 +1 @@
1
- {"version":3,"file":"IconsPanel.d.ts","sourceRoot":"","sources":["../../../src/components/EmojiPicker/IconsPanel.tsx"],"names":[],"mappings":"AAoCA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AA2BjD,eAAO,MAAM,UAAU,oGAQlB,IAAI,CACL,gBAAgB,EAChB,SAAS,GAAG,YAAY,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAC5D,GAAG;IACF,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,6CAsSF,CAAC"}
1
+ {"version":3,"file":"IconsPanel.d.ts","sourceRoot":"","sources":["../../../src/components/EmojiPicker/IconsPanel.tsx"],"names":[],"mappings":"AAoCA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AA2BjD,eAAO,MAAM,UAAU,oGAQlB,IAAI,CACL,gBAAgB,EAChB,SAAS,GAAG,YAAY,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAC5D,GAAG;IACF,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,6CAuSF,CAAC"}