@selectwin/kit 0.1.253 → 0.1.254

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 (38) hide show
  1. package/README.md +83 -69
  2. package/dist/SelectAttachMenu.d.ts +29 -0
  3. package/dist/SelectAttachMenu.js +167 -0
  4. package/dist/SelectAudioRecorder.d.ts +27 -0
  5. package/dist/SelectAudioRecorder.js +287 -0
  6. package/dist/SelectChatSendButton.d.ts +14 -0
  7. package/dist/SelectChatSendButton.js +25 -0
  8. package/dist/SelectConversation.d.ts +33 -2
  9. package/dist/SelectConversation.js +127 -83
  10. package/dist/SelectConversationQuote.d.ts +20 -0
  11. package/dist/SelectConversationQuote.js +87 -0
  12. package/dist/SelectConversationReactions.d.ts +31 -0
  13. package/dist/SelectConversationReactions.js +101 -0
  14. package/dist/SelectEmojiPicker.d.ts +12 -0
  15. package/dist/SelectEmojiPicker.js +178 -0
  16. package/dist/SelectIconTile.d.ts +2 -1
  17. package/dist/SelectLightbox.d.ts +32 -0
  18. package/dist/SelectLightbox.js +172 -0
  19. package/dist/SelectLocale.d.ts +68 -0
  20. package/dist/SelectLocale.js +140 -0
  21. package/dist/SelectMail.d.ts +3 -2
  22. package/dist/SelectMail.js +224 -244
  23. package/dist/SelectMessageCards.d.ts +150 -0
  24. package/dist/SelectMessageCards.js +429 -0
  25. package/dist/SelectMessageTicks.d.ts +7 -0
  26. package/dist/SelectMessageTicks.js +31 -0
  27. package/dist/SelectVoiceNote.d.ts +27 -0
  28. package/dist/SelectVoiceNote.js +245 -0
  29. package/dist/emojiData.d.ts +33 -0
  30. package/dist/emojiData.js +103 -0
  31. package/dist/icons.d.ts +22 -0
  32. package/dist/icons.js +89 -10
  33. package/dist/index.d.ts +23 -1
  34. package/dist/index.js +236 -224
  35. package/dist/internal/fileKind.d.ts +12 -0
  36. package/dist/internal/fileKind.js +44 -0
  37. package/dist/style.css +1 -1
  38. package/package.json +67 -67
@@ -0,0 +1,14 @@
1
+ import { ComponentPropsWithoutRef } from 'react';
2
+ type SelectChatSendButtonOwnProps = {
3
+ /** `send` = o avião (enviar); `record` = o microfone (gravar áudio). */
4
+ mode?: 'send' | 'record';
5
+ onClick?: () => void;
6
+ disabled?: boolean;
7
+ /** Enviando: o botão fica parado e diz que está ocupado. */
8
+ busy?: boolean;
9
+ /** O nome para o leitor de tela e a dica (padrão: "Enviar" ou "Gravar áudio"). */
10
+ label?: string;
11
+ };
12
+ export type SelectChatSendButtonProps = SelectChatSendButtonOwnProps & Omit<ComponentPropsWithoutRef<'button'>, keyof SelectChatSendButtonOwnProps | 'type' | 'children'>;
13
+ export declare const SelectChatSendButton: import('react').ForwardRefExoticComponent<SelectChatSendButtonOwnProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "type" | "children" | keyof SelectChatSendButtonOwnProps> & import('react').RefAttributes<HTMLButtonElement>>;
14
+ export {};
@@ -0,0 +1,25 @@
1
+ /* empty css */
2
+ import { MicrophoneIcon as e, SendIcon as t } from "./icons.js";
3
+ import { useSelectMessages as n } from "./SelectLocale.js";
4
+ import { forwardRef as r } from "react";
5
+ import { jsx as i } from "react/jsx-runtime";
6
+ //#region src/SelectChatSendButton.tsx
7
+ var a = r(function({ mode: r = "send", onClick: a, disabled: o = !1, busy: s = !1, label: c, className: l, ...u }, d) {
8
+ let f = n().chat, p = c ?? (r === "record" ? f.record : f.send);
9
+ return /* @__PURE__ */ i("button", {
10
+ ref: d,
11
+ ...u,
12
+ type: "button",
13
+ className: `select-chatsend select-chatsend--${r}${l ? " " + l : ""}`,
14
+ "aria-label": p,
15
+ title: p,
16
+ "aria-busy": s || void 0,
17
+ disabled: o || s,
18
+ onClick: a,
19
+ children: i(r === "record" ? e : t, {})
20
+ });
21
+ });
22
+ //#endregion
23
+ export { a as SelectChatSendButton };
24
+
25
+ //# sourceMappingURL=SelectChatSendButton.js.map
@@ -12,6 +12,14 @@ export declare function SelectConversation({ children, 'aria-label': ariaLabel,
12
12
  export declare function SelectConversationDay({ children }: {
13
13
  children: ReactNode;
14
14
  }): import("react").JSX.Element;
15
+ /**
16
+ * 0.1.254: o filete "2 mensagens novas" — onde começa o que chegou desde a última leitura. `count` escreve a frase na
17
+ * língua do kit; `children` troca o texto.
18
+ */
19
+ export declare function SelectUnreadDivider({ count, children }: {
20
+ count?: number;
21
+ children?: ReactNode;
22
+ }): import("react").JSX.Element;
15
23
  /** Um fato da conversa, no meio dela: assumiu, passou, escolheu o setor, encerrou. */
16
24
  export declare function SelectConversationEvent({ children, time }: {
17
25
  children: ReactNode;
@@ -50,19 +58,42 @@ export interface SelectConversationBubbleProps {
50
58
  to?: string;
51
59
  href?: string;
52
60
  onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
61
+ /** 0.1.254: a mensagem citada, no topo do balão (o `SelectConversationQuote`). Não junte com `to`/`href`. */
62
+ quote?: ReactNode;
63
+ /**
64
+ * 0.1.254: a hora e o estado DENTRO do balão, no canto de baixo à direita ("14:04" e o `SelectMessageTicks`). O `meta`
65
+ * segue embaixo, fora do balão, para quem já o usa.
66
+ */
67
+ stamp?: ReactNode;
68
+ /** 0.1.254: as reações, presas na borda de baixo do balão (o `SelectConversationReactions`). */
69
+ reactions?: ReactNode;
70
+ /**
71
+ * 0.1.254: a barra de ações da mensagem (responder, reagir, copiar, mais) — `SelectIconButton`s. Aparece com o mouse em
72
+ * cima ou o foco dentro, ao lado do balão (no celular, em cima dele); `actionsOpen` a deixa à vista (o toque longo).
73
+ */
74
+ actions?: ReactNode;
75
+ actionsOpen?: boolean;
76
+ /** 0.1.254: o tom do que não saiu — `critical` (não entregue), `warning` (retida), `muted` (não enviada, não suportada). */
77
+ tone?: 'critical' | 'warning' | 'muted';
78
+ /** 0.1.254: a borda fina (4 px) em volta da mídia e dos cartões (o álbum, o documento, o modelo, a localização). */
79
+ flush?: boolean;
53
80
  }
54
- export declare function SelectConversationBubble({ direction, author, label, attachment, meta, metaTone, children, avatar, time, media, fresh, to, href, onClick, }: SelectConversationBubbleProps): import("react").JSX.Element;
81
+ export declare function SelectConversationBubble({ direction, author, label, attachment, meta, metaTone, children, avatar, time, media, fresh, to, href, onClick, quote, stamp, reactions, actions, actionsOpen, tone, flush, }: SelectConversationBubbleProps): import("react").JSX.Element;
55
82
  /**
56
83
  * 0.1.221: a mídia de uma mensagem, dentro do balão — a foto, a figurinha (sem fundo, menor), o vídeo e o áudio (com os
57
84
  * controles do navegador). Nada é baixado antes de aparecer (`loading="lazy"`, `preload="none"`). Quando o arquivo não
58
85
  * abre (o link da mídia expirou), `onError` avisa quem usa, que troca pela nota.
59
86
  */
60
- export declare function SelectConversationMedia({ kind, src, alt, onError, }: {
87
+ export declare function SelectConversationMedia({ kind, src, alt, onError, onOpen, openLabel, }: {
61
88
  kind: 'image' | 'sticker' | 'video' | 'audio';
62
89
  src: string;
63
90
  /** O que a imagem mostra (a legenda, ou "Imagem"). */
64
91
  alt?: string;
65
92
  onError?: () => void;
93
+ /** 0.1.254: a foto vira um botão que a abre grande (o `SelectLightbox`). Só na foto e na figurinha. */
94
+ onOpen?: () => void;
95
+ /** O nome desse botão (padrão: "Abrir a foto"). */
96
+ openLabel?: string;
66
97
  }): import("react").JSX.Element;
67
98
  /**
68
99
  * 0.1.222: o "N novos ↓" — o que chegou enquanto quem lê estava acima, num botão que fica no pé da caixa que rola. O
@@ -1,156 +1,200 @@
1
1
  import { safeHref as e } from "./internal/safeHref.js";
2
- import { useEffect as t, useLayoutEffect as n, useRef as r } from "react";
3
- import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
4
- import { Link as s } from "react-router-dom";
2
+ import { useSelectMessages as t } from "./SelectLocale.js";
3
+ import { useEffect as n, useLayoutEffect as r, useRef as i } from "react";
4
+ import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
5
+ import { Link as c } from "react-router-dom";
5
6
  //#region src/SelectConversation.tsx
6
- var c = (...e) => e.filter(Boolean).join(" "), l = 48;
7
- function u(e) {
7
+ var l = (...e) => e.filter(Boolean).join(" "), u = 48;
8
+ function d(e) {
8
9
  for (let t = (e == null ? void 0 : e.parentElement) ?? null; t; t = t.parentElement) {
9
10
  let { overflowY: e } = getComputedStyle(t);
10
11
  if (e === "auto" || e === "scroll") return t;
11
12
  }
12
13
  return null;
13
14
  }
14
- function d({ children: e, "aria-label": i, onPinnedChange: o }) {
15
- let s = r(null), c = r(!0), d = r(o);
16
- return d.current = o, t(() => {
17
- let e = u(s.current);
15
+ function f({ children: e, "aria-label": t, onPinnedChange: a }) {
16
+ let s = i(null), c = i(!0), l = i(a);
17
+ return l.current = a, n(() => {
18
+ let e = d(s.current);
18
19
  if (!e) return;
19
20
  let t = () => {
20
21
  var t;
21
- let n = e.scrollHeight - e.scrollTop - e.clientHeight <= l;
22
- n !== c.current && ((t = d.current) == null || t.call(d, n)), c.current = n;
22
+ let n = e.scrollHeight - e.scrollTop - e.clientHeight <= u;
23
+ n !== c.current && ((t = l.current) == null || t.call(l, n)), c.current = n;
23
24
  };
24
25
  return e.addEventListener("scroll", t, { passive: !0 }), () => e.removeEventListener("scroll", t);
25
- }, []), n(() => {
26
+ }, []), r(() => {
26
27
  if (!c.current) return;
27
- let e = u(s.current);
28
+ let e = d(s.current);
28
29
  e && (e.scrollTop = e.scrollHeight);
29
- }), t(() => {
30
- let e = s.current, t = u(e);
30
+ }), n(() => {
31
+ let e = s.current, t = d(e);
31
32
  if (!e || !t || typeof ResizeObserver > "u") return;
32
33
  let n = new ResizeObserver(() => {
33
34
  c.current && (t.scrollTop = t.scrollHeight);
34
35
  });
35
36
  return n.observe(e), () => n.disconnect();
36
- }, []), /* @__PURE__ */ a("div", {
37
+ }, []), /* @__PURE__ */ o("div", {
37
38
  ref: s,
38
39
  className: "select-convo",
39
40
  role: "log",
40
41
  "aria-live": "polite",
41
- "aria-label": i,
42
+ "aria-label": t,
42
43
  children: e
43
44
  });
44
45
  }
45
- function f({ children: e }) {
46
- return /* @__PURE__ */ a("div", {
46
+ function p({ children: e }) {
47
+ return /* @__PURE__ */ o("div", {
47
48
  className: "select-convo__day",
48
49
  role: "separator",
49
50
  "aria-label": typeof e == "string" ? e : void 0,
50
51
  children: e
51
52
  });
52
53
  }
53
- function p({ children: e, time: t }) {
54
+ function m({ count: e, children: n }) {
55
+ let r = t().chat, i = n ?? (e == null ? null : r.unread(e));
54
56
  return /* @__PURE__ */ o("div", {
57
+ className: "select-convo__unread",
58
+ role: "separator",
59
+ "aria-label": typeof i == "string" ? i : void 0,
60
+ children: /* @__PURE__ */ o("span", {
61
+ className: "select-convo__unread-text",
62
+ children: i
63
+ })
64
+ });
65
+ }
66
+ function h({ children: e, time: t }) {
67
+ return /* @__PURE__ */ s("div", {
55
68
  className: "select-convo__event",
56
- children: [e, t ? /* @__PURE__ */ o("span", {
69
+ children: [e, t ? /* @__PURE__ */ s("span", {
57
70
  className: "select-convo__event-time",
58
71
  children: [" · ", t]
59
72
  }) : null]
60
73
  });
61
74
  }
62
- function m({ direction: t, author: n, label: r, attachment: l, meta: u, metaTone: d, children: f, avatar: p, time: m, media: h, fresh: g = !1, to: _, href: v, onClick: y }) {
63
- let b = f != null && f !== "", x = b || !!r || h != null, S = _ != null || v != null ? e(_ ?? v) : void 0, C = c("select-convo__bubble", S !== void 0 && "select-convo__bubble--link"), w = /* @__PURE__ */ o(i, { children: [
64
- r ? /* @__PURE__ */ a("span", {
75
+ function g({ direction: n, author: r, label: i, attachment: u, meta: d, metaTone: f, children: p, avatar: m, time: h, media: g, fresh: _ = !1, to: v, href: y, onClick: b, quote: x, stamp: S, reactions: C, actions: w, actionsOpen: T = !1, tone: E, flush: D = !1 }) {
76
+ let O = t().chat, k = p != null && p !== "", A = S != null && S !== "", j = k || !!i || g != null || x != null || A, M = v != null || y != null ? e(v ?? y) : void 0, N = l("select-convo__bubble", M !== void 0 && "select-convo__bubble--link", D && "select-convo__bubble--flush", E && `select-convo__bubble--${E}`), P = /* @__PURE__ */ s(a, { children: [
77
+ i ? /* @__PURE__ */ o("span", {
65
78
  className: "select-convo__label",
66
- children: r
79
+ children: i
67
80
  }) : null,
68
- h == null ? null : /* @__PURE__ */ a("div", {
81
+ x == null ? null : /* @__PURE__ */ o("div", {
82
+ className: "select-convo__quote",
83
+ children: x
84
+ }),
85
+ g == null ? null : /* @__PURE__ */ o("div", {
69
86
  className: "select-convo__media",
70
- children: h
87
+ children: g
71
88
  }),
72
- b ? /* @__PURE__ */ a("div", {
89
+ k ? /* @__PURE__ */ o("div", {
73
90
  className: "select-convo__text",
74
- children: f
91
+ children: p
92
+ }) : null,
93
+ A ? /* @__PURE__ */ o("div", {
94
+ className: "select-convo__stamp",
95
+ children: S
75
96
  }) : null
76
- ] }), T = /* @__PURE__ */ o(i, { children: [
77
- n || m ? /* @__PURE__ */ o("span", {
97
+ ] }), F = /* @__PURE__ */ s(a, { children: [
98
+ r || h ? /* @__PURE__ */ s("span", {
78
99
  className: "select-convo__author",
79
- children: [n, m ? /* @__PURE__ */ a("span", {
100
+ children: [r, h ? /* @__PURE__ */ o("span", {
80
101
  className: "select-convo__time",
81
- children: m
102
+ children: h
82
103
  }) : null]
83
104
  }) : null,
84
- x ? S !== void 0 && _ != null ? /* @__PURE__ */ a(s, {
85
- to: S,
86
- className: C,
87
- onClick: y,
88
- children: w
89
- }) : S === void 0 ? /* @__PURE__ */ a("div", {
90
- className: C,
91
- children: w
92
- }) : /* @__PURE__ */ a("a", {
93
- href: S,
94
- className: C,
95
- onClick: y,
96
- children: w
105
+ j ? M !== void 0 && v != null ? /* @__PURE__ */ o(c, {
106
+ to: M,
107
+ className: N,
108
+ onClick: b,
109
+ children: P
110
+ }) : M === void 0 ? /* @__PURE__ */ o("div", {
111
+ className: N,
112
+ children: P
113
+ }) : /* @__PURE__ */ o("a", {
114
+ href: M,
115
+ className: N,
116
+ onClick: b,
117
+ children: P
97
118
  }) : null,
98
- l ? /* @__PURE__ */ a("div", {
99
- className: "select-convo__attachment",
100
- children: l
119
+ C ? /* @__PURE__ */ o("div", {
120
+ className: "select-convo__reactions",
121
+ children: C
101
122
  }) : null,
102
- u ? /* @__PURE__ */ a("span", {
103
- className: c("select-convo__meta", d && `select-convo__meta--${d}`),
123
+ u ? /* @__PURE__ */ o("div", {
124
+ className: "select-convo__attachment",
104
125
  children: u
126
+ }) : null,
127
+ d ? /* @__PURE__ */ o("span", {
128
+ className: l("select-convo__meta", f && `select-convo__meta--${f}`),
129
+ children: d
105
130
  }) : null
106
- ] });
107
- return p ? /* @__PURE__ */ o("div", {
108
- className: c("select-convo__msg", `select-convo__msg--${t}`, "select-convo__msg--avatar", g && "is-fresh"),
109
- children: [/* @__PURE__ */ a("span", {
110
- className: "select-convo__avatar",
111
- "aria-hidden": "true",
112
- children: p
113
- }), /* @__PURE__ */ a("div", {
114
- className: "select-convo__stack",
115
- children: T
116
- })]
117
- }) : /* @__PURE__ */ a("div", {
118
- className: c("select-convo__msg", `select-convo__msg--${t}`, g && "is-fresh"),
119
- children: T
131
+ ] }), I = w ? /* @__PURE__ */ o("div", {
132
+ className: l("select-convo__actions", T && "is-open"),
133
+ role: "toolbar",
134
+ "aria-label": O.messageActions,
135
+ children: w
136
+ }) : null, L = (e) => l("select-convo__msg", `select-convo__msg--${n}`, e, _ && "is-fresh", C != null && "has-reactions", w != null && "has-actions");
137
+ return m ? /* @__PURE__ */ s("div", {
138
+ className: L("select-convo__msg--avatar"),
139
+ children: [
140
+ /* @__PURE__ */ o("span", {
141
+ className: "select-convo__avatar",
142
+ "aria-hidden": "true",
143
+ children: m
144
+ }),
145
+ /* @__PURE__ */ o("div", {
146
+ className: "select-convo__stack",
147
+ children: F
148
+ }),
149
+ I
150
+ ]
151
+ }) : /* @__PURE__ */ s("div", {
152
+ className: L(),
153
+ children: [F, I]
120
154
  });
121
155
  }
122
- function h({ kind: e, src: t, alt: n, onError: r }) {
123
- return e === "audio" ? /* @__PURE__ */ a("audio", {
156
+ function _({ kind: e, src: n, alt: r, onError: i, onOpen: a, openLabel: s }) {
157
+ let c = t().chat;
158
+ if (e === "audio") return /* @__PURE__ */ o("audio", {
124
159
  className: "select-convo__audio",
125
160
  controls: !0,
126
161
  preload: "none",
127
- src: t,
128
- onError: r
129
- }) : e === "video" ? /* @__PURE__ */ a("video", {
162
+ src: n,
163
+ onError: i
164
+ });
165
+ if (e === "video") return /* @__PURE__ */ o("video", {
130
166
  className: "select-convo__video",
131
167
  controls: !0,
132
168
  preload: "none",
133
- src: t,
134
- onError: r
135
- }) : /* @__PURE__ */ a("img", {
169
+ src: n,
170
+ onError: i
171
+ });
172
+ let l = /* @__PURE__ */ o("img", {
136
173
  className: `select-convo__image${e === "sticker" ? " select-convo__image--sticker" : ""}`,
137
- src: t,
138
- alt: n ?? "",
174
+ src: n,
175
+ alt: r ?? "",
139
176
  loading: "lazy",
140
- onError: r
177
+ onError: i
141
178
  });
179
+ return a ? /* @__PURE__ */ o("button", {
180
+ type: "button",
181
+ className: "select-convo__open",
182
+ onClick: a,
183
+ "aria-label": s ?? (r ? `${c.openPhoto}: ${r}` : c.openPhoto),
184
+ children: l
185
+ }) : l;
142
186
  }
143
- function g({ children: e, onClick: t }) {
144
- let n = r(null);
145
- return /* @__PURE__ */ o("button", {
187
+ function v({ children: e, onClick: t }) {
188
+ let n = i(null);
189
+ return /* @__PURE__ */ s("button", {
146
190
  ref: n,
147
191
  type: "button",
148
192
  className: "select-convo__newer",
149
193
  onClick: () => {
150
- let e = u(n.current);
194
+ let e = d(n.current);
151
195
  e && (e.scrollTop = e.scrollHeight), t == null || t();
152
196
  },
153
- children: [/* @__PURE__ */ a("svg", {
197
+ children: [/* @__PURE__ */ o("svg", {
154
198
  viewBox: "0 0 20 20",
155
199
  width: "16",
156
200
  height: "16",
@@ -160,11 +204,11 @@ function g({ children: e, onClick: t }) {
160
204
  strokeLinecap: "round",
161
205
  strokeLinejoin: "round",
162
206
  "aria-hidden": "true",
163
- children: /* @__PURE__ */ a("path", { d: "M5 8l5 5 5-5" })
207
+ children: /* @__PURE__ */ o("path", { d: "M5 8l5 5 5-5" })
164
208
  }), e]
165
209
  });
166
210
  }
167
211
  //#endregion
168
- export { d as SelectConversation, m as SelectConversationBubble, f as SelectConversationDay, p as SelectConversationEvent, h as SelectConversationMedia, g as SelectConversationNewer };
212
+ export { f as SelectConversation, g as SelectConversationBubble, p as SelectConversationDay, h as SelectConversationEvent, _ as SelectConversationMedia, v as SelectConversationNewer, m as SelectUnreadDivider };
169
213
 
170
214
  //# sourceMappingURL=SelectConversation.js.map
@@ -0,0 +1,20 @@
1
+ import { ReactNode } from 'react';
2
+ export interface SelectConversationQuoteProps {
3
+ /** Quem escreveu a citada ("Você", "Mariana Costa", "Respondeu ao botão"). */
4
+ author: ReactNode;
5
+ /** O trecho, numa linha só (o resto vira reticências). */
6
+ children?: ReactNode;
7
+ /** Antes do trecho: o glifo do tipo (a câmera da foto, o microfone do áudio). */
8
+ icon?: ReactNode;
9
+ /** A miniatura da mídia citada: a URL da imagem, ou o nó pronto. */
10
+ thumbnail?: string | ReactNode;
11
+ /** `bubble` = dentro do balão; `composer` = a faixa "Respondendo a…" sobre o campo. */
12
+ variant?: 'bubble' | 'composer';
13
+ /** No balão: o clique leva à mensagem citada (o bloco vira um botão). */
14
+ onClick?: () => void;
15
+ /** No compositor: o ✕ que cancela a resposta. */
16
+ onCancel?: () => void;
17
+ /** O nome do ✕ (padrão: "Cancelar a resposta"). */
18
+ cancelLabel?: string;
19
+ }
20
+ export declare function SelectConversationQuote({ author, children, icon, thumbnail, variant, onClick, onCancel, cancelLabel, }: SelectConversationQuoteProps): import("react").JSX.Element;
@@ -0,0 +1,87 @@
1
+ /* empty css */
2
+ import { CloseIcon as e, ReplyIcon as t } from "./icons.js";
3
+ import { useSelectMessages as n } from "./SelectLocale.js";
4
+ import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
5
+ //#region src/SelectConversationQuote.tsx
6
+ var o = (...e) => e.filter(Boolean).join(" ");
7
+ function s({ author: s, children: c, icon: l, thumbnail: u, variant: d = "bubble", onClick: f, onCancel: p, cancelLabel: m }) {
8
+ let h = n().chat, g = u == null || u === "" ? null : /* @__PURE__ */ i("span", {
9
+ className: "select-chatquote__thumb",
10
+ "aria-hidden": "true",
11
+ children: typeof u == "string" ? /* @__PURE__ */ i("img", {
12
+ src: u,
13
+ alt: "",
14
+ loading: "lazy"
15
+ }) : u
16
+ }), _ = c != null && c !== "" ? /* @__PURE__ */ a("span", {
17
+ className: "select-chatquote__snippet",
18
+ children: [l ? /* @__PURE__ */ i("span", {
19
+ className: "select-chatquote__icon",
20
+ "aria-hidden": "true",
21
+ children: l
22
+ }) : null, /* @__PURE__ */ i("span", {
23
+ className: "select-chatquote__text",
24
+ children: c
25
+ })]
26
+ }) : null;
27
+ if (d === "composer") return /* @__PURE__ */ a("div", {
28
+ className: "select-chatquote select-chatquote--composer",
29
+ role: "group",
30
+ "aria-label": h.quote,
31
+ children: [
32
+ /* @__PURE__ */ i("span", {
33
+ className: "select-chatquote__lead",
34
+ "aria-hidden": "true",
35
+ children: /* @__PURE__ */ i(t, {})
36
+ }),
37
+ /* @__PURE__ */ a("span", {
38
+ className: "select-chatquote__body",
39
+ children: [/* @__PURE__ */ a("span", {
40
+ className: "select-chatquote__author",
41
+ children: [
42
+ h.replyingTo,
43
+ " ",
44
+ s
45
+ ]
46
+ }), _]
47
+ }),
48
+ g,
49
+ p ? /* @__PURE__ */ i("button", {
50
+ type: "button",
51
+ className: "select-chatquote__cancel",
52
+ onClick: p,
53
+ "aria-label": m ?? h.cancelReply,
54
+ title: m ?? h.cancelReply,
55
+ children: /* @__PURE__ */ i(e, {})
56
+ }) : null
57
+ ]
58
+ });
59
+ let v = /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ a("span", {
60
+ className: "select-chatquote__body",
61
+ children: [
62
+ /* @__PURE__ */ a("span", {
63
+ className: "select-visually-hidden",
64
+ children: [h.quote, ": "]
65
+ }),
66
+ /* @__PURE__ */ i("span", {
67
+ className: "select-chatquote__author",
68
+ children: s
69
+ }),
70
+ _
71
+ ]
72
+ }), g] });
73
+ return f ? /* @__PURE__ */ i("button", {
74
+ type: "button",
75
+ className: o("select-chatquote", "select-chatquote--link"),
76
+ onClick: f,
77
+ title: h.quoteJump,
78
+ children: v
79
+ }) : /* @__PURE__ */ i("div", {
80
+ className: "select-chatquote",
81
+ children: v
82
+ });
83
+ }
84
+ //#endregion
85
+ export { s as SelectConversationQuote };
86
+
87
+ //# sourceMappingURL=SelectConversationQuote.js.map
@@ -0,0 +1,31 @@
1
+ export interface SelectReaction {
2
+ emoji: string;
3
+ /** Quem reagiu ("Você", "Mariana Costa"). Sem ele, a ficha mostra quantos. */
4
+ who?: string;
5
+ /** Quantas pessoas reagiram com este emoji (padrão: 1). */
6
+ count?: number;
7
+ /** A reação é de quem lê: a ficha marcada. */
8
+ mine?: boolean;
9
+ }
10
+ export interface SelectConversationReactionsProps {
11
+ reactions: SelectReaction[];
12
+ /** Tocar na ficha: quem usa põe ou tira a reação de quem lê. Sem ele, as fichas só mostram. */
13
+ onToggle?: (emoji: string) => void;
14
+ }
15
+ /** As 6 reações rápidas do WhatsApp, na ordem dele. */
16
+ export declare const SELECT_QUICK_REACTIONS: readonly string[];
17
+ export declare function SelectConversationReactions({ reactions, onToggle }: SelectConversationReactionsProps): import("react").JSX.Element | null;
18
+ export interface SelectReactionPickerProps {
19
+ /** O emoji escolhido — o mesmo da reação atual quer dizer "tirar". */
20
+ onPick: (emoji: string) => void;
21
+ /** A reação atual de quem lê (o botão marcado). */
22
+ selected?: string | null;
23
+ /** As rápidas (padrão: 👍 ❤️ 😂 😮 😢 🙏). */
24
+ emojis?: readonly string[];
25
+ /** O "+" que abre o seletor completo (padrão: sim). */
26
+ more?: boolean;
27
+ /** Os recentes do seletor completo. */
28
+ recent?: string[];
29
+ 'aria-label'?: string;
30
+ }
31
+ export declare function SelectReactionPicker({ onPick, selected, emojis, more, recent, 'aria-label': ariaLabel }: SelectReactionPickerProps): import("react").JSX.Element;
@@ -0,0 +1,101 @@
1
+ /* empty css */
2
+ import { CloseIcon as e, PlusIcon as t } from "./icons.js";
3
+ import { useSelectMessages as n } from "./SelectLocale.js";
4
+ import { SelectEmojiPicker as r } from "./SelectEmojiPicker.js";
5
+ import { useRef as i, useState as a } from "react";
6
+ import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
7
+ //#region src/SelectConversationReactions.tsx
8
+ var l = (...e) => e.filter(Boolean).join(" "), u = [
9
+ "👍",
10
+ "❤️",
11
+ "😂",
12
+ "😮",
13
+ "😢",
14
+ "🙏"
15
+ ];
16
+ function d({ reactions: e, onToggle: t }) {
17
+ let r = n().chat;
18
+ return e.length ? /* @__PURE__ */ s("div", {
19
+ className: "select-chatreacts",
20
+ role: "group",
21
+ "aria-label": r.reactions,
22
+ children: e.map((e) => {
23
+ let n = e.count ?? 1, i = e.who ? r.reactedWith(e.who, e.emoji) : r.reactionCount(e.emoji, n), a = /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s("span", {
24
+ className: "select-chatreacts__emoji",
25
+ "aria-hidden": "true",
26
+ children: e.emoji
27
+ }), /* @__PURE__ */ s("span", {
28
+ className: "select-chatreacts__who",
29
+ "aria-hidden": "true",
30
+ children: e.who ?? n
31
+ })] }), u = l("select-chatreacts__chip", e.mine && "is-mine");
32
+ return t ? /* @__PURE__ */ s("button", {
33
+ type: "button",
34
+ className: u,
35
+ "aria-label": i,
36
+ "aria-pressed": !!e.mine,
37
+ title: i,
38
+ onClick: () => t(e.emoji),
39
+ children: a
40
+ }, e.emoji) : /* @__PURE__ */ s("span", {
41
+ className: u,
42
+ role: "img",
43
+ "aria-label": i,
44
+ title: i,
45
+ children: a
46
+ }, e.emoji);
47
+ })
48
+ }) : null;
49
+ }
50
+ function f({ onPick: o, selected: d, emojis: f = u, more: p = !0, recent: m, "aria-label": h }) {
51
+ let g = n().chat, [_, v] = a(!1), [y, b] = a(0), x = i(null), S = f.length + +!!p;
52
+ return /* @__PURE__ */ c("div", {
53
+ className: "select-reactpicker",
54
+ children: [/* @__PURE__ */ c("div", {
55
+ ref: x,
56
+ className: "select-reactpicker__row",
57
+ role: "toolbar",
58
+ "aria-label": h ?? g.reactionPicker,
59
+ onKeyDown: (e) => {
60
+ var t;
61
+ let n = e.key === "ArrowRight" ? 1 : e.key === "ArrowLeft" ? -1 : 0, r = e.key === "Home" ? 0 : e.key === "End" ? S - 1 : null;
62
+ if (!n && r == null) return;
63
+ e.preventDefault();
64
+ let i = r ?? (y + n + S) % S;
65
+ b(i), (t = x.current) == null || (t = t.querySelectorAll("button")[i]) == null || t.focus();
66
+ },
67
+ children: [f.map((e, t) => {
68
+ let n = d === e;
69
+ return /* @__PURE__ */ s("button", {
70
+ type: "button",
71
+ className: l("select-reactpicker__btn", n && "is-selected"),
72
+ tabIndex: t === y ? 0 : -1,
73
+ "aria-label": n ? g.unreact(e) : g.react(e),
74
+ "aria-pressed": n,
75
+ title: n ? g.unreact(e) : g.react(e),
76
+ onFocus: () => b(t),
77
+ onClick: () => o(e),
78
+ children: e
79
+ }, e);
80
+ }), p ? /* @__PURE__ */ s("button", {
81
+ type: "button",
82
+ className: "select-reactpicker__btn select-reactpicker__more",
83
+ tabIndex: y === f.length ? 0 : -1,
84
+ "aria-label": _ ? g.lessEmoji : g.moreEmoji,
85
+ "aria-expanded": _,
86
+ title: _ ? g.lessEmoji : g.moreEmoji,
87
+ onFocus: () => b(f.length),
88
+ onClick: () => v((e) => !e),
89
+ children: s(_ ? e : t, {})
90
+ }) : null]
91
+ }), _ ? /* @__PURE__ */ s(r, {
92
+ autoFocus: !0,
93
+ recent: m,
94
+ onPick: o
95
+ }) : null]
96
+ });
97
+ }
98
+ //#endregion
99
+ export { u as SELECT_QUICK_REACTIONS, d as SelectConversationReactions, f as SelectReactionPicker };
100
+
101
+ //# sourceMappingURL=SelectConversationReactions.js.map
@@ -0,0 +1,12 @@
1
+ export interface SelectEmojiPickerProps {
2
+ /** O emoji escolhido (o caractere pronto para ir na mensagem). */
3
+ onPick: (emoji: string) => void;
4
+ /** Os usados por último, na categoria "Recentes" (os primeiros da lista primeiro). */
5
+ recent?: string[];
6
+ /** Quantos por linha (padrão: 8). */
7
+ columns?: number;
8
+ /** O foco vai para a busca ao aparecer (o seletor que abre num popover). */
9
+ autoFocus?: boolean;
10
+ 'aria-label'?: string;
11
+ }
12
+ export declare function SelectEmojiPicker({ onPick, recent, columns, autoFocus, 'aria-label': ariaLabel }: SelectEmojiPickerProps): import("react").JSX.Element;