@layers-app/shared 0.3.5 → 0.3.6

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.
@@ -3,6 +3,7 @@ import { ColorPickerList } from './ColorPickerList';
3
3
  import type { ColorItem } from './types';
4
4
  interface ColorCircleProps extends Omit<ColorSwatchProps, 'color'>, Omit<React.ComponentPropsWithoutRef<'div'>, keyof Omit<ColorSwatchProps, 'color'>> {
5
5
  value?: string | null;
6
+ label?: string;
6
7
  isActive?: boolean;
7
8
  swatchShape?: 'circle' | 'square';
8
9
  swatchVariant?: 'filled' | 'outline';
@@ -1 +1 @@
1
- {"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPicker.tsx"],"names":[],"mappings":"AAIA,OAAO,EAIL,gBAAgB,EAEhB,SAAS,EAKV,MAAM,eAAe,CAAC;AAMvB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAgHzC,UAAU,gBACR,SAAQ,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,EACrC,IAAI,CACF,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EACrC,MAAM,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,CACtC;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAClC,aAAa,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,WAAW,6GAmDvB,CAAC;AASF,eAAO,MAAM,WAAW;YAvLd,MAAM,GAAG,IAAI;eACV,CA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@@
1
- import { jsx as e, jsxs as f } from "react/jsx-runtime";
2
- import { forwardRef as g, useState as b } from "react";
3
- import { Tick02Icon as $ } from "@hugeicons/core-free-icons";
4
- import { HugeiconsIcon as j } from "@hugeicons/react";
5
- import { useMantineTheme as y, getThemeColor as A, Flex as h, Tooltip as E, ColorSwatch as R, parseThemeColor as D, ColorInput as F, ActionIcon as x } from "@mantine/core";
6
- import { IconPalette as H, IconPencil as M } from "@tabler/icons-react";
7
- import U from "styled-components";
8
- import { DEFAULT_VALUES as v } from "../../constants.js";
9
- import { ColorPickerToolbar as V } from "./ColorPickerToolbar.js";
10
- import { ColorPickerList as q } from "./ColorPickerList.js";
11
- import { normalizeColorItem as _ } from "./types.js";
12
- const B = g(
1
+ import { jsx as e, jsxs as h } from "react/jsx-runtime";
2
+ import { forwardRef as y, useState as x } from "react";
3
+ import { Tick02Icon as j } from "@hugeicons/core-free-icons";
4
+ import { HugeiconsIcon as A } from "@hugeicons/react";
5
+ import { useMantineTheme as w, getThemeColor as E, Flex as C, Tooltip as R, ColorSwatch as D, parseThemeColor as F, ColorInput as H, ActionIcon as v } from "@mantine/core";
6
+ import { IconPalette as M, IconPencil as U } from "@tabler/icons-react";
7
+ import V from "styled-components";
8
+ import { DEFAULT_VALUES as g } from "../../constants.js";
9
+ import { ColorPickerToolbar as q } from "./ColorPickerToolbar.js";
10
+ import { ColorPickerList as _ } from "./ColorPickerList.js";
11
+ import { normalizeColorItem as B } from "./types.js";
12
+ const G = y(
13
13
  ({
14
14
  value: o,
15
- onChange: i,
15
+ onChange: l,
16
16
  allowCustomColor: n,
17
- colors: c,
17
+ colors: s,
18
18
  swatchShape: a = "circle",
19
19
  swatchVariant: m = "filled",
20
20
  withTick: d = !1,
21
- fullWidth: l = !1,
22
- swatchSize: p = 30,
21
+ fullWidth: p = !1,
22
+ swatchSize: i = 30,
23
23
  ...u
24
- }, r) => {
25
- const t = y(), k = D({
26
- color: o || v.COLORS[0],
27
- theme: t
28
- }), [z, I] = b(k.value), [O, C] = b(!1);
29
- return O ? /* @__PURE__ */ f(h, { align: "center", mih: 30, children: [
24
+ }, f) => {
25
+ const r = w(), t = F({
26
+ color: o || g.COLORS[0],
27
+ theme: r
28
+ }), [z, I] = x(t.value), [O, b] = x(!1);
29
+ return O ? /* @__PURE__ */ h(C, { align: "center", mih: 30, children: [
30
30
  /* @__PURE__ */ e(
31
- F,
31
+ H,
32
32
  {
33
33
  w: "100%",
34
34
  popoverProps: {
@@ -40,54 +40,55 @@ const B = g(
40
40
  size: "xs",
41
41
  value: z,
42
42
  onChange: I,
43
- onChangeEnd: i,
43
+ onChangeEnd: l,
44
44
  placeholder: "Select custom color"
45
45
  }
46
46
  ),
47
47
  /* @__PURE__ */ e(
48
- x,
48
+ v,
49
49
  {
50
50
  radius: "xl",
51
51
  variant: "default",
52
52
  color: "gray",
53
- onClick: () => C(!1),
54
- children: /* @__PURE__ */ e(H, { size: 16 })
53
+ onClick: () => b(!1),
54
+ children: /* @__PURE__ */ e(M, { size: 16 })
55
55
  }
56
56
  )
57
- ] }, 1) : /* @__PURE__ */ f(
58
- h,
57
+ ] }, 1) : /* @__PURE__ */ h(
58
+ C,
59
59
  {
60
- ref: r,
60
+ ref: f,
61
61
  ...u,
62
- justify: l ? "space-between" : "flex-start",
62
+ justify: p ? "space-between" : "flex-start",
63
63
  align: "center",
64
64
  children: [
65
- (c || v.COLORS).map((P, S) => {
66
- const { value: s, border: T, bg: L } = _(P);
65
+ (s || g.COLORS).map((P, S) => {
66
+ const { value: c, border: T, bg: L, label: $ } = B(P);
67
67
  return /* @__PURE__ */ e(
68
- G,
68
+ J,
69
69
  {
70
- value: s,
71
- isActive: s === o,
72
- size: p - 4,
70
+ value: c,
71
+ label: $,
72
+ isActive: c === o,
73
+ size: i - 4,
73
74
  swatchShape: a,
74
75
  swatchVariant: m,
75
76
  withTick: d,
76
77
  borderColor: T,
77
78
  bgColor: L,
78
- onClick: () => i?.(s)
79
+ onClick: () => l?.(c)
79
80
  },
80
- s || S
81
+ c || S
81
82
  );
82
83
  }),
83
84
  n && /* @__PURE__ */ e(
84
- x,
85
+ v,
85
86
  {
86
87
  radius: "xl",
87
88
  variant: "default",
88
89
  color: "gray",
89
- onClick: () => C(!0),
90
- children: /* @__PURE__ */ e(M, { size: 16 })
90
+ onClick: () => b(!0),
91
+ children: /* @__PURE__ */ e(U, { size: 16 })
91
92
  }
92
93
  )
93
94
  ]
@@ -95,15 +96,15 @@ const B = g(
95
96
  2
96
97
  );
97
98
  }
98
- ), w = g(
99
- ({ value: o, isActive: i, swatchShape: n, swatchVariant: c = "filled", withTick: a, borderColor: m, bgColor: d, ...l }, p) => {
100
- const u = y(), r = o ? A(o, u) : "", t = c === "outline";
101
- return /* @__PURE__ */ e(h, { w: l.size || 24, h: l.size || 24, justify: "center", align: "center", style: { position: "relative" }, children: /* @__PURE__ */ e(E, { label: o || "", withArrow: !0, children: /* @__PURE__ */ f(
102
- R,
99
+ ), k = y(
100
+ ({ value: o, label: l, isActive: n, swatchShape: s, swatchVariant: a = "filled", withTick: m, borderColor: d, bgColor: p, ...i }, u) => {
101
+ const f = w(), r = o ? E(o, f) : "", t = a === "outline";
102
+ return /* @__PURE__ */ e(C, { w: i.size || 24, h: i.size || 24, justify: "center", align: "center", style: { position: "relative" }, children: /* @__PURE__ */ e(R, { label: l || o || "", withArrow: !0, children: /* @__PURE__ */ h(
103
+ D,
103
104
  {
104
- ref: p,
105
+ ref: u,
105
106
  color: t ? "transparent" : r,
106
- radius: n === "circle" ? "xl" : "sm",
107
+ radius: s === "circle" ? "xl" : "sm",
107
108
  styles: t ? {
108
109
  alphaOverlay: { display: "none" },
109
110
  shadowOverlay: { display: "none" }
@@ -111,12 +112,12 @@ const B = g(
111
112
  style: {
112
113
  cursor: "pointer",
113
114
  color: "var(--mantine-color-white)",
114
- background: t ? d || `var(--mantine-color-${o}-light, ${r}20)` : void 0,
115
- border: t ? `2px solid ${m || `var(--mantine-color-${o}-outline, ${r})`}` : void 0
115
+ background: t ? p || `var(--mantine-color-${o}-light, ${r}20)` : void 0,
116
+ border: t ? `2px solid ${d || `var(--mantine-color-${o}-outline, ${r})`}` : void 0
116
117
  },
117
- ...l,
118
+ ...i,
118
119
  children: [
119
- i && /* @__PURE__ */ e(
120
+ n && /* @__PURE__ */ e(
120
121
  "span",
121
122
  {
122
123
  style: {
@@ -126,27 +127,27 @@ const B = g(
126
127
  right: -4,
127
128
  bottom: -4,
128
129
  border: `2px solid ${r}`,
129
- borderRadius: n === "circle" ? "var(--mantine-radius-xl)" : "var(--mantine-radius-sm)",
130
+ borderRadius: s === "circle" ? "var(--mantine-radius-xl)" : "var(--mantine-radius-sm)",
130
131
  pointerEvents: "none",
131
132
  boxSizing: "border-box"
132
133
  }
133
134
  }
134
135
  ),
135
- a && i && /* @__PURE__ */ e(j, { size: 20, icon: $ })
136
+ m && n && /* @__PURE__ */ e(A, { size: 20, icon: j })
136
137
  ]
137
138
  }
138
139
  ) }) });
139
140
  }
140
- ), G = U(w)`
141
+ ), J = V(k)`
141
142
  .mantine-ColorSwatch-colorOverlay {
142
143
  border-radius: ${({ swatchShape: o }) => o === "square" ? "3px" : "50%"};
143
144
  }
144
- `, io = Object.assign(B, {
145
- ColorCircle: w,
146
- List: q,
147
- Toolbar: V
145
+ `, lo = Object.assign(G, {
146
+ ColorCircle: k,
147
+ List: _,
148
+ Toolbar: q
148
149
  });
149
150
  export {
150
- w as ColorCircle,
151
- io as ColorPicker
151
+ k as ColorCircle,
152
+ lo as ColorPicker
152
153
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ColorPickerToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPickerToolbar.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAMjE;6DAC6D;AAC7D,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AA4BD,eAAO,MAAM,kBAAkB,oHAuJ7B,CAAC"}
1
+ {"version":3,"file":"ColorPickerToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPickerToolbar.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAMjE;6DAC6D;AAC7D,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAsCD,eAAO,MAAM,kBAAkB,oHA2K7B,CAAC"}
@@ -1,121 +1,138 @@
1
- import { jsxs as C, jsx as o } from "react/jsx-runtime";
2
- import { forwardRef as D, useState as M, useCallback as w, useMemo as T } from "react";
3
- import { useMantineColorScheme as z, Box as u, Flex as x, UnstyledButton as H } from "@mantine/core";
4
- import { TextColorIcon as F, HighlightSwatch as N } from "./icons.js";
5
- import { isDefaultColor as I, normalizeColorItem as L } from "./types.js";
6
- import { useRecentColors as j } from "./useRecentColors.js";
7
- import t from "./ColorPicker.module.css.js";
1
+ import { jsxs as S, jsx as r } from "react/jsx-runtime";
2
+ import { forwardRef as z, useState as H, useCallback as w, useMemo as I } from "react";
3
+ import { useMantineColorScheme as j, Box as h, Flex as B, Tooltip as P, UnstyledButton as U } from "@mantine/core";
4
+ import { TextColorIcon as K, HighlightSwatch as D } from "./icons.js";
5
+ import { normalizeColorItem as $, isDefaultColor as q } from "./types.js";
6
+ import { useRecentColors as E } from "./useRecentColors.js";
7
+ import c from "./ColorPicker.module.css.js";
8
8
  function k({
9
- isActive: i,
9
+ isActive: s,
10
10
  round: m,
11
- disabled: a,
12
- onClick: h,
13
- children: c
11
+ disabled: u,
12
+ onClick: d,
13
+ children: i,
14
+ tooltipLabel: f
14
15
  }) {
15
- return /* @__PURE__ */ o(
16
- H,
16
+ const v = /* @__PURE__ */ r(
17
+ U,
17
18
  {
18
19
  type: "button",
19
- className: `${t.inlineSwatch}${m ? ` ${t.inlineSwatchRound}` : ""}${i ? ` ${t.inlineSwatchActive}` : ""}`,
20
- onMouseDown: (p) => p.preventDefault(),
21
- onClick: h,
22
- disabled: a,
23
- children: c
20
+ className: `${c.inlineSwatch}${m ? ` ${c.inlineSwatchRound}` : ""}${s ? ` ${c.inlineSwatchActive}` : ""}`,
21
+ onMouseDown: (C) => C.preventDefault(),
22
+ onClick: d,
23
+ disabled: u,
24
+ children: i
24
25
  }
25
26
  );
27
+ return f ? /* @__PURE__ */ r(P, { label: f, withArrow: !0, children: v }) : v;
26
28
  }
27
- const Q = D(({ sections: i, onChange: m, withRecentColors: a, maxRecentColors: h = 9, disabled: c, recentColorsLabel: p = "Recently used" }, R) => {
28
- const { colorScheme: y } = z(), S = y === "dark", { recentColors: B, addRecent: g } = j({ maxItems: h }), [v, K] = M(B), d = w(
29
- (e, r, n) => {
30
- a && (g(e, r, n), K((l) => {
31
- const f = l.filter(
32
- (s) => !(s.value === e && s.sectionKey === r)
29
+ const Y = z(({ sections: s, onChange: m, withRecentColors: u, maxRecentColors: d = 9, disabled: i, recentColorsLabel: f = "Recently used" }, v) => {
30
+ const { colorScheme: C } = j(), x = C === "dark", { recentColors: M, addRecent: F } = E({ maxItems: d }), [L, T] = H(M), p = w(
31
+ (e, o, t) => {
32
+ u && (F(e, o, t), T((l) => {
33
+ const n = l.filter(
34
+ (a) => !(a.value === e && a.sectionKey === o)
33
35
  );
34
- return [{ value: e, sectionKey: r, border: n }, ...f].slice(0, h);
35
- })), m(e, r);
36
+ return [{ value: e, sectionKey: o, border: t }, ...n].slice(0, d);
37
+ })), m(e, o);
36
38
  },
37
- [m, a, g]
38
- ), A = T(() => {
39
+ [m, u, F]
40
+ ), g = I(() => {
39
41
  const e = {};
40
- for (const r of i) e[r.key] = r;
42
+ for (const o of s) e[o.key] = o;
41
43
  return e;
42
- }, [i]), b = w(
43
- (e) => I(e) ? S ? "#FFFFFF" : "#000000" : e,
44
- [S]
44
+ }, [s]), y = w(
45
+ (e, o) => {
46
+ if (!o) return;
47
+ const t = g[o];
48
+ if (!t) return;
49
+ const l = t.colors.find((b) => $(b).value === e);
50
+ if (!l) return;
51
+ const { label: n, value: a } = $(l);
52
+ return n || a;
53
+ },
54
+ [g]
55
+ ), N = w(
56
+ (e) => q(e) ? x ? "#FFFFFF" : "#000000" : e,
57
+ [x]
45
58
  );
46
- return /* @__PURE__ */ C(u, { ref: R, children: [
47
- a && v.length > 0 && /* @__PURE__ */ C(u, { className: t.inlineSection, children: [
48
- /* @__PURE__ */ o(u, { className: t.inlineSectionLabel, children: p }),
49
- /* @__PURE__ */ o(x, { className: t.inlineRow, gap: 2, children: v.map((e, r) => {
50
- const n = e.sectionKey ? A[e.sectionKey] : void 0;
51
- return n?.key === "textColor" || n?.key === "color" || e.sectionKey === "color" ? /* @__PURE__ */ o(
59
+ return /* @__PURE__ */ S(h, { ref: v, children: [
60
+ u && L.length > 0 && /* @__PURE__ */ S(h, { className: c.inlineSection, children: [
61
+ /* @__PURE__ */ r(h, { className: c.inlineSectionLabel, children: f }),
62
+ /* @__PURE__ */ r(B, { className: c.inlineRow, gap: 2, children: L.map((e, o) => {
63
+ const t = e.sectionKey ? g[e.sectionKey] : void 0, l = t?.key === "textColor" || t?.key === "color" || e.sectionKey === "color", n = y(e.value, e.sectionKey);
64
+ return l ? /* @__PURE__ */ r(
52
65
  k,
53
66
  {
54
67
  isActive: !1,
55
- disabled: c,
56
- onClick: () => d(e.value, e.sectionKey ?? ""),
57
- children: /* @__PURE__ */ o(
58
- F,
68
+ disabled: i,
69
+ tooltipLabel: n,
70
+ onClick: () => p(e.value, e.sectionKey ?? ""),
71
+ children: /* @__PURE__ */ r(
72
+ K,
59
73
  {
60
74
  size: 20,
61
- color: b(e.value),
75
+ color: N(e.value),
62
76
  showBorder: !0
63
77
  }
64
78
  )
65
79
  },
66
- `${e.sectionKey}-${e.value}-${r}`
67
- ) : /* @__PURE__ */ o(
80
+ `${e.sectionKey}-${e.value}-${o}`
81
+ ) : /* @__PURE__ */ r(
68
82
  k,
69
83
  {
70
84
  isActive: !1,
71
85
  round: !0,
72
- disabled: c,
73
- onClick: () => d(e.value, e.sectionKey ?? ""),
74
- children: /* @__PURE__ */ o(
75
- N,
86
+ disabled: i,
87
+ tooltipLabel: n,
88
+ onClick: () => p(e.value, e.sectionKey ?? ""),
89
+ children: /* @__PURE__ */ r(
90
+ D,
76
91
  {
77
92
  bgColor: e.value,
78
93
  borderColor: e.border || "var(--mantine-color-default-border)"
79
94
  }
80
95
  )
81
96
  },
82
- `${e.sectionKey}-${e.value}-${r}`
97
+ `${e.sectionKey}-${e.value}-${o}`
83
98
  );
84
99
  }) })
85
100
  ] }),
86
- i.map((e) => {
87
- const r = e.key === "highlight" || e.key === "background" || e.key === "textHighlight";
88
- return /* @__PURE__ */ C(u, { className: t.inlineSection, children: [
89
- e.label && /* @__PURE__ */ o(u, { className: t.inlineSectionLabel, children: e.label }),
90
- /* @__PURE__ */ o(x, { className: t.inlineRow, gap: 2, children: e.colors.map((n) => {
91
- const { value: l, border: f } = L(n), s = l === e.value, $ = b(l);
92
- return r ? /* @__PURE__ */ o(
101
+ s.map((e) => {
102
+ const o = e.key === "highlight" || e.key === "background" || e.key === "textHighlight";
103
+ return /* @__PURE__ */ S(h, { className: c.inlineSection, children: [
104
+ e.label && /* @__PURE__ */ r(h, { className: c.inlineSectionLabel, children: e.label }),
105
+ /* @__PURE__ */ r(B, { className: c.inlineRow, gap: 2, children: e.colors.map((t) => {
106
+ const { value: l, border: n, label: a } = $(t), b = l === e.value, R = N(l), A = a || l;
107
+ return o ? /* @__PURE__ */ r(
93
108
  k,
94
109
  {
95
- isActive: s,
110
+ isActive: b,
96
111
  round: !0,
97
- disabled: c,
98
- onClick: () => d(l, e.key, f),
99
- children: /* @__PURE__ */ o(
100
- N,
112
+ disabled: i,
113
+ tooltipLabel: A,
114
+ onClick: () => p(l, e.key, n),
115
+ children: /* @__PURE__ */ r(
116
+ D,
101
117
  {
102
118
  bgColor: l,
103
- borderColor: f || $
119
+ borderColor: n || R
104
120
  }
105
121
  )
106
122
  },
107
123
  l
108
- ) : /* @__PURE__ */ o(
124
+ ) : /* @__PURE__ */ r(
109
125
  k,
110
126
  {
111
- isActive: s,
112
- disabled: c,
113
- onClick: () => d(l, e.key),
114
- children: /* @__PURE__ */ o(
115
- F,
127
+ isActive: b,
128
+ disabled: i,
129
+ tooltipLabel: A,
130
+ onClick: () => p(l, e.key),
131
+ children: /* @__PURE__ */ r(
132
+ K,
116
133
  {
117
134
  size: 20,
118
- color: $,
135
+ color: R,
119
136
  showBorder: !0
120
137
  }
121
138
  )
@@ -128,5 +145,5 @@ const Q = D(({ sections: i, onChange: m, withRecentColors: a, maxRecentColors: h
128
145
  ] });
129
146
  });
130
147
  export {
131
- Q as ColorPickerToolbar
148
+ Y as ColorPickerToolbar
132
149
  };
@@ -1 +1 @@
1
- {"version":3,"file":"EmojiPanel.d.ts","sourceRoot":"","sources":["../../../src/components/EmojiPicker/EmojiPanel.tsx"],"names":[],"mappings":"AAyCA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAsBjD,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
+ {"version":3,"file":"EmojiPanel.d.ts","sourceRoot":"","sources":["../../../src/components/EmojiPicker/EmojiPanel.tsx"],"names":[],"mappings":"AAyCA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAsBjD,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,4CAgTA,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { jsxs as y, jsx as t } from "react/jsx-runtime";
2
- import { useState as u, useRef as d, useEffect as R, useCallback as K } from "react";
2
+ import { useState as d, useRef as m, 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";
@@ -27,17 +27,17 @@ const he = [
27
27
  { i: "symbols", icon: /* @__PURE__ */ t(c, { size: 20, icon: oe }) },
28
28
  { i: "flags", icon: /* @__PURE__ */ t(c, { size: 20, icon: re }) }
29
29
  ], Re = ({
30
- locales: m,
30
+ locales: u,
31
31
  onChange: C,
32
32
  onClose: M,
33
33
  setRandomIcon: P,
34
34
  querySearch: p
35
35
  }) => {
36
- const [b, k] = u("frequent"), x = d("frequent"), h = d({}), I = d(null), [w, S] = u(""), [Q, O] = u([]), [a, B] = u(null), [E, j] = u([]), { t: G } = L(), g = d(!1), l = d(null);
36
+ const [b, k] = d("frequent"), x = m("frequent"), h = m({}), I = m(null), [S, w] = d(""), [Q, O] = d([]), [a, B] = d(null), [E, j] = d([]), { t: G } = L(), g = m(!1), l = m(null);
37
37
  R(() => {
38
38
  if (typeof p == "string") {
39
39
  const e = p.slice(1);
40
- if (S(e), a) {
40
+ if (w(e), a) {
41
41
  const o = a.search(e);
42
42
  j(o.map((r) => r.item.e));
43
43
  }
@@ -74,7 +74,7 @@ const he = [
74
74
  const H = K(
75
75
  (e) => {
76
76
  const o = e.currentTarget.value;
77
- if (S(o), a) {
77
+ if (w(o), a) {
78
78
  const r = a.search(o);
79
79
  j(r.map((s) => s.item.e));
80
80
  }
@@ -128,8 +128,8 @@ const he = [
128
128
  ie,
129
129
  {
130
130
  leftSection: /* @__PURE__ */ t(c, { size: 16, icon: U }),
131
- value: w,
132
- placeholder: `${m?.search}...`,
131
+ value: S,
132
+ placeholder: `${u?.search}...`,
133
133
  "data-autofocus": !0,
134
134
  styles: {
135
135
  input: {
@@ -142,7 +142,7 @@ const he = [
142
142
  radius: "var(--mantine-radius-default)"
143
143
  }
144
144
  ),
145
- /* @__PURE__ */ t(ce, { withArrow: !0, label: G("random"), children: /* @__PURE__ */ t(
145
+ /* @__PURE__ */ t(ce, { withArrow: !0, label: u?.random || G("random"), children: /* @__PURE__ */ t(
146
146
  A,
147
147
  {
148
148
  h: 36,
@@ -175,7 +175,7 @@ const he = [
175
175
  },
176
176
  ref: I,
177
177
  onScroll: $,
178
- children: w ? /* @__PURE__ */ y(v, { flex: 1, align: "stretch", children: [
178
+ children: S ? /* @__PURE__ */ y(v, { flex: 1, align: "stretch", children: [
179
179
  !J && /* @__PURE__ */ t(
180
180
  F,
181
181
  {
@@ -185,7 +185,7 @@ const he = [
185
185
  top: -1,
186
186
  style: { zIndex: 1 },
187
187
  bg: "light-dark(var(--mantine-color-white), var(--mantine-color-dark-6))",
188
- children: /* @__PURE__ */ t(q, { fz: "sm", c: "dimmed", children: m?.searchResults })
188
+ children: /* @__PURE__ */ t(q, { fz: "sm", c: "dimmed", children: u?.searchResults })
189
189
  }
190
190
  ),
191
191
  E.length ? /* @__PURE__ */ t(N, { cols: 10, spacing: 0, children: E.map((e) => /* @__PURE__ */ t(
@@ -201,7 +201,7 @@ const he = [
201
201
  ue,
202
202
  {
203
203
  size: 100,
204
- description: m?.searchNoResults,
204
+ description: u?.searchNoResults,
205
205
  descriptionProps: {
206
206
  fz: "sm"
207
207
  }
@@ -217,14 +217,13 @@ const he = [
217
217
  /* @__PURE__ */ t(
218
218
  F,
219
219
  {
220
- bg: "light-dark(var(--mantine-color-white), var(--mantine-color-dark-6))",
221
220
  py: 2,
222
221
  px: 6,
223
222
  pos: "sticky",
224
223
  top: -1,
225
224
  h: 23,
226
225
  style: { zIndex: 1 },
227
- children: /* @__PURE__ */ t(q, { fz: "xs", c: "dimmed", children: m?.emojiCategory?.[e.i] })
226
+ children: /* @__PURE__ */ t(q, { fz: "xs", c: "dimmed", children: u?.emojiCategory?.[e.i] })
228
227
  }
229
228
  ),
230
229
  /* @__PURE__ */ t(N, { cols: 10, spacing: 0, children: e.e.map((o) => /* @__PURE__ */ t(
@@ -31,6 +31,7 @@ export type EmojiPickerLocales = {
31
31
  searchNoResults?: string;
32
32
  remove?: string;
33
33
  icons?: string;
34
+ random?: string;
34
35
  emojiCategory?: Record<string, string>;
35
36
  };
36
37
  export declare const EmojiPicker: ({ project, value, querySearch, children, onChange, position, popoverProps, showIcons, showColors, defaultActiveTab, showEmojis, withinPortal, locales: _locales, openWhen, triggerRegex, typingSeq, showRemoveButton, keepOpenOnRandom, }: PropsWithChildren<EmojiPickerProps>) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"EmojiPicker.d.ts","sourceRoot":"","sources":["../../../src/components/EmojiPicker/EmojiPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAgC,MAAM,OAAO,CAAC;AAGxE,OAAO,EAIL,gBAAgB,EAEhB,YAAY,EAEb,MAAM,eAAe,CAAC;AAQvB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,CAAC,EAAE,MAAM,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C;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,2OAmBzB,iBAAiB,CAAC,gBAAgB,CAAC,4CAiNrC,CAAC"}
@@ -30,6 +30,7 @@ const ee = ({
30
30
  emojis: e("emojis"),
31
31
  remove: e("remove"),
32
32
  search: e("search"),
33
+ random: e("random"),
33
34
  searchResults: e("emojiPicker.searchResults"),
34
35
  icons: e("emojiPicker.icons"),
35
36
  searchNoResults: e("emojiPicker.searchNoResults"),