@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,150 @@
1
+ import { ReactNode } from 'react';
2
+ export interface SelectLocationCardProps {
3
+ /** O nome do lugar ("Casa da Mariana"). */
4
+ name?: ReactNode;
5
+ /** O endereço ("Rua Harmonia, 412 · Vila Madalena"). */
6
+ address?: ReactNode;
7
+ /** O link do mapa ("https://maps.google.com/?q=-23.55,-46.69"), aberto em outra aba. */
8
+ href?: string;
9
+ /** O texto do link (padrão: "Abrir no mapa"). */
10
+ linkLabel?: string;
11
+ /** O mapa (a imagem do mapa estático). Sem ele, o lugar do mapa com o alfinete. */
12
+ map?: ReactNode;
13
+ }
14
+ export declare function SelectLocationCard({ name, address, href, linkLabel, map }: SelectLocationCardProps): import("react").JSX.Element;
15
+ export interface SelectContactCardAction {
16
+ label: string;
17
+ onClick?: () => void;
18
+ /** Um link no lugar do clique (`tel:`, o endereço da conversa). */
19
+ href?: string;
20
+ }
21
+ export interface SelectContactCardProps {
22
+ /** O nome do contato — vira as iniciais. */
23
+ name: string;
24
+ /** O telefone, já formatado ("+55 11 97777-0000"). */
25
+ phone?: ReactNode;
26
+ /** Depois do telefone, o que mais veio no cartão ("marido", a empresa). */
27
+ detail?: ReactNode;
28
+ /** A foto, quando o cartão traz. */
29
+ avatarSrc?: string;
30
+ /** Até duas ações, lado a lado embaixo ("Conversar", "Copiar o número"). */
31
+ actions?: SelectContactCardAction[];
32
+ }
33
+ export declare function SelectContactCard({ name, phone, detail, avatarSrc, actions }: SelectContactCardProps): import("react").JSX.Element;
34
+ export type SelectTemplateButtonKind = 'url' | 'reply' | 'copy' | 'call';
35
+ export interface SelectTemplateButton {
36
+ /** `url` = o link (a seta para fora); `reply` = a resposta rápida; `copy` = copiar (o cupom, o código); `call` = ligar. */
37
+ kind: SelectTemplateButtonKind;
38
+ label: string;
39
+ /** O link (`url`) ou o `tel:` (`call`). */
40
+ href?: string;
41
+ /** O que o `copy` copia (o kit copia e diz "Copiado"), ou o número do `call`. */
42
+ value?: string;
43
+ onClick?: () => void;
44
+ }
45
+ export interface SelectTemplateMessageProps {
46
+ /** O nome do modelo ("pedido_enviado"), na faixa de cima: "Modelo · pedido_enviado". */
47
+ name?: ReactNode;
48
+ /** A categoria ("Utilidade", "Marketing", "Autenticação"), à direita da faixa. */
49
+ category?: ReactNode;
50
+ /** A mídia do cabeçalho (a imagem, o vídeo, o documento), de ponta a ponta no topo do cartão. */
51
+ header?: ReactNode;
52
+ /** O cabeçalho de texto, em negrito. */
53
+ title?: ReactNode;
54
+ /** O texto: uma string com `{{1}}` ou `{{nome}}` (preenchidos por `values`, em destaque) ou o texto já montado. */
55
+ body: ReactNode;
56
+ /** Os valores das variáveis: `['Mariana', '48213']` (o `{{1}}` é o primeiro) ou `{ nome: 'Mariana' }`. */
57
+ values?: readonly ReactNode[] | Record<string, ReactNode>;
58
+ /** O rodapé, menor ("Loja Bela Casa · responda SAIR para não receber"). */
59
+ footer?: ReactNode;
60
+ /** Os botões, empilhados embaixo. */
61
+ buttons?: SelectTemplateButton[];
62
+ }
63
+ /** Uma variável do modelo, em destaque no texto. `empty` = ainda sem valor (o `{{1}}` tracejado). */
64
+ export declare function SelectTemplateVar({ children, empty }: {
65
+ children: ReactNode;
66
+ empty?: boolean;
67
+ }): import("react").JSX.Element;
68
+ /** O texto do modelo com as variáveis trocadas pelos valores, em destaque. */
69
+ export declare function renderTemplateText(text: string, values?: readonly ReactNode[] | Record<string, ReactNode>): ReactNode[];
70
+ export declare function SelectTemplateMessage({ name, category, header, title, body, values, footer, buttons }: SelectTemplateMessageProps): import("react").JSX.Element;
71
+ export interface SelectInteractiveListRow {
72
+ id: string;
73
+ title: ReactNode;
74
+ description?: ReactNode;
75
+ }
76
+ export interface SelectInteractiveListSection {
77
+ title?: ReactNode;
78
+ rows: SelectInteractiveListRow[];
79
+ }
80
+ export interface SelectInteractiveListSheetProps {
81
+ /** O título da folha ("Horários"). */
82
+ title?: ReactNode;
83
+ sections: SelectInteractiveListSection[];
84
+ /** A linha escolhida (a bolinha cheia). */
85
+ selected?: string | null;
86
+ /** Escolher uma linha. Sem ele, a folha só mostra (a prévia do que o cliente vê). */
87
+ onSelect?: (id: string) => void;
88
+ /** A nota miúda embaixo ("O que o cliente vê ao tocar em 'Ver horários'"). */
89
+ note?: ReactNode;
90
+ 'aria-label'?: string;
91
+ }
92
+ /** A folha da lista: o título, as seções (em caixa-alta) e as linhas com a bolinha de escolher. */
93
+ export declare function SelectInteractiveListSheet({ title, sections, selected, onSelect, note, 'aria-label': ariaLabel }: SelectInteractiveListSheetProps): import("react").JSX.Element;
94
+ export interface SelectInteractiveButton {
95
+ id?: string;
96
+ label: string;
97
+ onClick?: () => void;
98
+ }
99
+ export interface SelectInteractiveMessageProps {
100
+ /** O título, em negrito ("Confirma a entrega?"). */
101
+ header?: ReactNode;
102
+ /** O texto. */
103
+ body: ReactNode;
104
+ /** O rodapé, menor ("Loja Bela Casa"). */
105
+ footer?: ReactNode;
106
+ /** Até 3 botões de resposta, empilhados. */
107
+ buttons?: SelectInteractiveButton[];
108
+ /** A lista: o texto do botão ("Ver horários") e a folha que ele abre. */
109
+ list?: Omit<SelectInteractiveListSheetProps, 'aria-label'> & {
110
+ button: string;
111
+ };
112
+ /** A folha da lista já aberta. */
113
+ defaultListOpen?: boolean;
114
+ /** O botão com link ("Ver o boleto"). */
115
+ cta?: {
116
+ label: string;
117
+ href?: string;
118
+ };
119
+ }
120
+ export declare function SelectInteractiveMessage({ header, body, footer, buttons, list, defaultListOpen, cta }: SelectInteractiveMessageProps): import("react").JSX.Element;
121
+ export interface SelectDocumentCardProps {
122
+ /** O nome do arquivo ("Proposta-troca-48213.pdf") — o tipo sai da extensão. */
123
+ name: string;
124
+ /** A linha de baixo ("2 páginas · 184 KB", "Planilha · 48 KB"). */
125
+ meta?: ReactNode;
126
+ /** A 1ª página, em cima (a imagem). `true` desenha o lugar dela (as linhas de uma página). */
127
+ preview?: ReactNode | true;
128
+ /** O link do arquivo: o baixar vira um link (`download`). */
129
+ href?: string;
130
+ /** Ou o clique, quando o link é gerado na hora (o link assinado). */
131
+ onDownload?: () => void;
132
+ /** Gerando o link: o baixar fica ocupado. */
133
+ busy?: boolean;
134
+ /** O nome do baixar (padrão: "Baixar <nome>"). */
135
+ downloadLabel?: string;
136
+ }
137
+ export declare function SelectDocumentCard({ name, meta, preview, href, onDownload, busy, downloadLabel }: SelectDocumentCardProps): import("react").JSX.Element;
138
+ export interface SelectMediaAlbumItem {
139
+ src: string;
140
+ /** O que a foto mostra. */
141
+ alt?: string;
142
+ /** `video` = a miniatura com o ▶. */
143
+ kind?: 'image' | 'video';
144
+ }
145
+ export interface SelectMediaAlbumProps {
146
+ items: SelectMediaAlbumItem[];
147
+ /** Abrir a foto (o `SelectLightbox` no índice). Sem ele, as fotos só mostram. */
148
+ onOpen?: (index: number) => void;
149
+ }
150
+ export declare function SelectMediaAlbum({ items, onOpen }: SelectMediaAlbumProps): import("react").JSX.Element;
@@ -0,0 +1,429 @@
1
+ /* empty css */
2
+ import { safeHref as e } from "./internal/safeHref.js";
3
+ import { CallIcon as t, CopyIcon as n, DownloadIcon as r, ExternalLinkIcon as i, ListBulletIcon as a, LocationIcon as o, PlayIcon as s, ReplyIcon as c } from "./icons.js";
4
+ import { useSelectMessages as l } from "./SelectLocale.js";
5
+ import { SelectAvatar as u } from "./SelectAvatar.js";
6
+ import { useClipboard as d } from "./internal/clipboard.js";
7
+ import { attachmentExt as f, documentBadge as p, documentTone as m } from "./internal/fileKind.js";
8
+ import { useId as h, useState as g } from "react";
9
+ import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
10
+ //#region src/SelectMessageCards.tsx
11
+ var b = (...e) => e.filter(Boolean).join(" ");
12
+ function x({ name: t, address: n, href: r, linkLabel: i, map: a }) {
13
+ let s = l().chat, c = e(r);
14
+ return /* @__PURE__ */ y("div", {
15
+ className: "select-loccard",
16
+ children: [
17
+ /* @__PURE__ */ v("div", {
18
+ className: "select-loccard__map",
19
+ children: a ?? /* @__PURE__ */ v("span", {
20
+ className: "select-loccard__pin",
21
+ "aria-hidden": "true",
22
+ children: /* @__PURE__ */ v(o, {})
23
+ })
24
+ }),
25
+ t != null || n != null ? /* @__PURE__ */ y("div", {
26
+ className: "select-loccard__text",
27
+ children: [t == null ? null : /* @__PURE__ */ v("span", {
28
+ className: "select-loccard__name",
29
+ children: t
30
+ }), n == null ? null : /* @__PURE__ */ v("span", {
31
+ className: "select-loccard__address",
32
+ children: n
33
+ })]
34
+ }) : null,
35
+ c === void 0 ? null : /* @__PURE__ */ v("a", {
36
+ className: "select-loccard__link",
37
+ href: c,
38
+ target: "_blank",
39
+ rel: "noopener noreferrer",
40
+ children: i ?? s.openMap
41
+ })
42
+ ]
43
+ });
44
+ }
45
+ function S({ name: t, phone: n, detail: r, avatarSrc: i, actions: a }) {
46
+ let o = (a ?? []).slice(0, 2);
47
+ return /* @__PURE__ */ y("div", {
48
+ className: "select-contactcard",
49
+ children: [/* @__PURE__ */ y("div", {
50
+ className: "select-contactcard__head",
51
+ children: [/* @__PURE__ */ v(u, {
52
+ name: t,
53
+ src: i,
54
+ initials: 2,
55
+ tone: "accent",
56
+ className: "select-contactcard__avatar"
57
+ }), /* @__PURE__ */ y("span", {
58
+ className: "select-contactcard__text",
59
+ children: [/* @__PURE__ */ v("span", {
60
+ className: "select-contactcard__name",
61
+ children: t
62
+ }), n != null || r != null ? /* @__PURE__ */ y("span", {
63
+ className: "select-contactcard__phone",
64
+ children: [
65
+ n,
66
+ n != null && r != null ? " · " : null,
67
+ r
68
+ ]
69
+ }) : null]
70
+ })]
71
+ }), o.length ? /* @__PURE__ */ v("div", {
72
+ className: b("select-contactcard__actions", o.length === 1 && "is-single"),
73
+ children: o.map((t) => {
74
+ let n = e(t.href);
75
+ return n === void 0 ? /* @__PURE__ */ v("button", {
76
+ type: "button",
77
+ className: "select-contactcard__action",
78
+ onClick: t.onClick,
79
+ children: t.label
80
+ }, t.label) : /* @__PURE__ */ v("a", {
81
+ className: "select-contactcard__action",
82
+ href: n,
83
+ children: t.label
84
+ }, t.label);
85
+ })
86
+ }) : null]
87
+ });
88
+ }
89
+ function C({ children: e, empty: t = !1 }) {
90
+ return /* @__PURE__ */ v("span", {
91
+ className: b("select-tplvar", t && "is-empty"),
92
+ children: e
93
+ });
94
+ }
95
+ var w = /\{\{\s*([\w.-]+)\s*\}\}/g;
96
+ function T(e, t) {
97
+ let n = [], r = 0, i = 0;
98
+ for (let a of e.matchAll(w)) {
99
+ let o = a.index ?? 0;
100
+ o > r && n.push(e.slice(r, o));
101
+ let s = a[1] ?? "", c = Array.isArray(t) ? /^\d+$/.test(s) ? t[Number(s) - 1] : void 0 : t == null ? void 0 : t[s], l = c != null && c !== "";
102
+ n.push(/* @__PURE__ */ v(C, {
103
+ empty: !l,
104
+ children: l ? c : a[0]
105
+ }, `v${i++}`)), r = o + a[0].length;
106
+ }
107
+ return r < e.length && n.push(e.slice(r)), n;
108
+ }
109
+ function E({ kind: e }) {
110
+ return v(e === "url" ? i : e === "copy" ? n : e === "call" ? t : c, {});
111
+ }
112
+ function D({ button: t }) {
113
+ let n = l().chat, { state: r, copy: i } = d(), a = t.kind === "call" ? e(t.href ?? (t.value ? `tel:${t.value.replace(/[^\d+]/g, "")}` : void 0)) : e(t.href), o = /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("span", {
114
+ className: "select-tplmsg__btnicon",
115
+ "aria-hidden": "true",
116
+ children: /* @__PURE__ */ v(E, { kind: t.kind })
117
+ }), /* @__PURE__ */ v("span", { children: t.kind === "copy" && r === "copied" ? n.copied : t.label })] });
118
+ if (t.onClick) return /* @__PURE__ */ v("button", {
119
+ type: "button",
120
+ className: "select-tplmsg__btn",
121
+ onClick: t.onClick,
122
+ children: o
123
+ });
124
+ if (t.kind === "copy" && t.value) {
125
+ let e = t.value;
126
+ return /* @__PURE__ */ y("button", {
127
+ type: "button",
128
+ className: "select-tplmsg__btn",
129
+ onClick: (t) => void i(e, t.currentTarget),
130
+ children: [o, /* @__PURE__ */ v("span", {
131
+ className: "select-visually-hidden",
132
+ "aria-live": "polite",
133
+ children: r === "copied" ? n.copied : ""
134
+ })]
135
+ });
136
+ }
137
+ return (t.kind === "url" || t.kind === "call") && a !== void 0 ? /* @__PURE__ */ v("a", {
138
+ className: "select-tplmsg__btn",
139
+ href: a,
140
+ ...t.kind === "url" ? {
141
+ target: "_blank",
142
+ rel: "noopener noreferrer"
143
+ } : {},
144
+ children: o
145
+ }) : /* @__PURE__ */ v("span", {
146
+ className: "select-tplmsg__btn is-static",
147
+ children: o
148
+ });
149
+ }
150
+ function O({ name: e, category: t, header: n, title: r, body: i, values: a, footer: o, buttons: s }) {
151
+ let c = l().chat;
152
+ return /* @__PURE__ */ y("div", {
153
+ className: "select-tplmsg",
154
+ children: [e != null || t != null ? /* @__PURE__ */ y("div", {
155
+ className: "select-tplmsg__strip",
156
+ children: [/* @__PURE__ */ y("span", {
157
+ className: "select-tplmsg__name",
158
+ children: [c.template, e == null ? null : /* @__PURE__ */ y(_, { children: [" · ", e] })]
159
+ }), t == null ? null : /* @__PURE__ */ v("span", {
160
+ className: "select-tplmsg__category",
161
+ children: t
162
+ })]
163
+ }) : null, /* @__PURE__ */ y("div", {
164
+ className: "select-tplmsg__card",
165
+ children: [
166
+ n == null ? null : /* @__PURE__ */ v("div", {
167
+ className: "select-tplmsg__header",
168
+ children: n
169
+ }),
170
+ /* @__PURE__ */ y("div", {
171
+ className: "select-tplmsg__body",
172
+ children: [
173
+ r == null ? null : /* @__PURE__ */ v("span", {
174
+ className: "select-tplmsg__title",
175
+ children: r
176
+ }),
177
+ /* @__PURE__ */ v("span", {
178
+ className: "select-tplmsg__text",
179
+ children: typeof i == "string" ? T(i, a) : i
180
+ }),
181
+ o == null ? null : /* @__PURE__ */ v("span", {
182
+ className: "select-tplmsg__footer",
183
+ children: o
184
+ })
185
+ ]
186
+ }),
187
+ s != null && s.length ? /* @__PURE__ */ v("div", {
188
+ className: "select-tplmsg__buttons",
189
+ children: s.map((e, t) => /* @__PURE__ */ v(D, { button: e }, `${e.kind}-${e.label}-${t}`))
190
+ }) : null
191
+ ]
192
+ })]
193
+ });
194
+ }
195
+ function k({ title: e, sections: t, selected: n, onSelect: r, note: i, "aria-label": a }) {
196
+ let o = l().chat, s = h();
197
+ return /* @__PURE__ */ y("div", {
198
+ className: "select-listsheet",
199
+ children: [
200
+ e == null ? null : /* @__PURE__ */ v("div", {
201
+ className: "select-listsheet__title",
202
+ id: s,
203
+ children: e
204
+ }),
205
+ /* @__PURE__ */ v("div", {
206
+ className: "select-listsheet__options",
207
+ role: "radiogroup",
208
+ "aria-label": e == null ? a ?? o.listOptions : void 0,
209
+ "aria-labelledby": e == null ? void 0 : s,
210
+ onKeyDown: r ? (e) => {
211
+ let t = e.key === "ArrowDown" || e.key === "ArrowRight" ? 1 : e.key === "ArrowUp" || e.key === "ArrowLeft" ? -1 : 0;
212
+ if (!t) return;
213
+ e.preventDefault();
214
+ let n = Array.from(e.currentTarget.querySelectorAll("[role=\"radio\"]")), i = n[(n.indexOf(document.activeElement) + t + n.length) % n.length];
215
+ i == null || i.focus();
216
+ let a = i == null ? void 0 : i.getAttribute("data-row-id");
217
+ a != null && r(a);
218
+ } : void 0,
219
+ children: t.map((e, t) => /* @__PURE__ */ y("div", {
220
+ className: "select-listsheet__section",
221
+ children: [e.title == null ? null : /* @__PURE__ */ v("div", {
222
+ className: "select-listsheet__heading",
223
+ children: e.title
224
+ }), e.rows.map((i) => {
225
+ let a = n === i.id;
226
+ return /* @__PURE__ */ y("button", {
227
+ type: "button",
228
+ role: "radio",
229
+ "data-row-id": i.id,
230
+ "aria-checked": a,
231
+ "aria-disabled": !r || void 0,
232
+ tabIndex: r && (a || n == null && t === 0 && i === e.rows[0]) ? 0 : -1,
233
+ className: b("select-listsheet__row", a && "is-selected"),
234
+ onClick: r ? () => r(i.id) : void 0,
235
+ children: [/* @__PURE__ */ y("span", {
236
+ className: "select-listsheet__text",
237
+ children: [/* @__PURE__ */ v("span", {
238
+ className: "select-listsheet__rowtitle",
239
+ children: i.title
240
+ }), i.description == null ? null : /* @__PURE__ */ v("span", {
241
+ className: "select-listsheet__desc",
242
+ children: i.description
243
+ })]
244
+ }), /* @__PURE__ */ v("span", {
245
+ className: "select-listsheet__radio",
246
+ "aria-hidden": "true"
247
+ })]
248
+ }, i.id);
249
+ })]
250
+ }, t))
251
+ }),
252
+ i == null ? null : /* @__PURE__ */ v("div", {
253
+ className: "select-listsheet__note",
254
+ children: i
255
+ })
256
+ ]
257
+ });
258
+ }
259
+ function A({ header: t, body: n, footer: r, buttons: o, list: s, defaultListOpen: c = !1, cta: l }) {
260
+ let [u, d] = g(c), f = h(), p = l ? e(l.href) : void 0;
261
+ return /* @__PURE__ */ y("div", {
262
+ className: "select-imsg",
263
+ children: [
264
+ t == null ? null : /* @__PURE__ */ v("span", {
265
+ className: "select-imsg__header",
266
+ children: t
267
+ }),
268
+ /* @__PURE__ */ v("span", {
269
+ className: "select-imsg__body",
270
+ children: n
271
+ }),
272
+ r == null ? null : /* @__PURE__ */ v("span", {
273
+ className: "select-imsg__footer",
274
+ children: r
275
+ }),
276
+ o != null && o.length ? /* @__PURE__ */ v("div", {
277
+ className: "select-imsg__buttons",
278
+ children: o.slice(0, 3).map((e, t) => e.onClick ? /* @__PURE__ */ v("button", {
279
+ type: "button",
280
+ className: "select-imsg__btn",
281
+ onClick: e.onClick,
282
+ children: e.label
283
+ }, e.id ?? `${e.label}-${t}`) : /* @__PURE__ */ v("span", {
284
+ className: "select-imsg__btn is-static",
285
+ children: e.label
286
+ }, e.id ?? `${e.label}-${t}`))
287
+ }) : null,
288
+ s ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ y("button", {
289
+ type: "button",
290
+ className: "select-imsg__btn",
291
+ "aria-expanded": u,
292
+ "aria-controls": f,
293
+ onClick: () => d((e) => !e),
294
+ children: [/* @__PURE__ */ v("span", {
295
+ className: "select-imsg__btnicon",
296
+ "aria-hidden": "true",
297
+ children: /* @__PURE__ */ v(a, {})
298
+ }), s.button]
299
+ }), u ? /* @__PURE__ */ v("div", {
300
+ id: f,
301
+ className: "select-imsg__sheet",
302
+ children: /* @__PURE__ */ v(k, {
303
+ title: s.title,
304
+ sections: s.sections,
305
+ selected: s.selected,
306
+ onSelect: s.onSelect,
307
+ note: s.note
308
+ })
309
+ }) : null] }) : null,
310
+ l ? p === void 0 ? /* @__PURE__ */ y("span", {
311
+ className: "select-imsg__btn is-static",
312
+ children: [/* @__PURE__ */ v("span", {
313
+ className: "select-imsg__btnicon",
314
+ "aria-hidden": "true",
315
+ children: /* @__PURE__ */ v(i, {})
316
+ }), l.label]
317
+ }) : /* @__PURE__ */ y("a", {
318
+ className: "select-imsg__btn",
319
+ href: p,
320
+ target: "_blank",
321
+ rel: "noopener noreferrer",
322
+ children: [/* @__PURE__ */ v("span", {
323
+ className: "select-imsg__btnicon",
324
+ "aria-hidden": "true",
325
+ children: /* @__PURE__ */ v(i, {})
326
+ }), l.label]
327
+ }) : null
328
+ ]
329
+ });
330
+ }
331
+ function j({ name: t, meta: n, preview: i, href: a, onDownload: o, busy: s = !1, downloadLabel: c }) {
332
+ let u = l().chat, d = f(t), h = e(a), g = c ?? u.download(t);
333
+ return /* @__PURE__ */ y("div", {
334
+ className: b("select-doccard", i != null && i !== !1 && "has-preview"),
335
+ children: [i === !0 ? /* @__PURE__ */ y("div", {
336
+ className: "select-doccard__preview select-doccard__preview--lines",
337
+ "aria-hidden": "true",
338
+ children: [
339
+ /* @__PURE__ */ v("span", {}),
340
+ /* @__PURE__ */ v("span", {}),
341
+ /* @__PURE__ */ v("span", {}),
342
+ /* @__PURE__ */ v("span", {})
343
+ ]
344
+ }) : i == null ? null : /* @__PURE__ */ v("div", {
345
+ className: "select-doccard__preview",
346
+ children: i
347
+ }), /* @__PURE__ */ y("div", {
348
+ className: "select-doccard__row",
349
+ children: [
350
+ /* @__PURE__ */ v("span", {
351
+ className: `select-doccard__ext select-doccard__ext--${m(d)}`,
352
+ "aria-hidden": "true",
353
+ children: p(d)
354
+ }),
355
+ /* @__PURE__ */ y("span", {
356
+ className: "select-doccard__text",
357
+ children: [/* @__PURE__ */ v("span", {
358
+ className: "select-doccard__name",
359
+ title: t,
360
+ children: t
361
+ }), n == null ? null : /* @__PURE__ */ v("span", {
362
+ className: "select-doccard__meta",
363
+ children: n
364
+ })]
365
+ }),
366
+ h !== void 0 && !s ? /* @__PURE__ */ v("a", {
367
+ className: "select-doccard__download",
368
+ href: h,
369
+ download: t,
370
+ target: "_blank",
371
+ rel: "noopener noreferrer",
372
+ "aria-label": g,
373
+ title: g,
374
+ children: /* @__PURE__ */ v(r, {})
375
+ }) : o || s ? /* @__PURE__ */ v("button", {
376
+ type: "button",
377
+ className: "select-doccard__download",
378
+ onClick: o,
379
+ "aria-label": g,
380
+ title: g,
381
+ "aria-busy": s || void 0,
382
+ disabled: s,
383
+ children: /* @__PURE__ */ v(r, {})
384
+ }) : null
385
+ ]
386
+ })]
387
+ });
388
+ }
389
+ function M({ items: e, onOpen: t }) {
390
+ let n = l().chat, r = e.slice(0, 4), i = e.length - r.length;
391
+ return /* @__PURE__ */ v("div", {
392
+ className: `select-album select-album--n${r.length}`,
393
+ role: "group",
394
+ "aria-label": n.album(e.length),
395
+ children: r.map((a, o) => {
396
+ let c = o === r.length - 1 && i > 0, l = /* @__PURE__ */ y(_, { children: [
397
+ /* @__PURE__ */ v("img", {
398
+ src: a.src,
399
+ alt: a.alt ?? "",
400
+ loading: "lazy"
401
+ }),
402
+ a.kind === "video" ? /* @__PURE__ */ v("span", {
403
+ className: "select-album__play",
404
+ "aria-hidden": "true",
405
+ children: /* @__PURE__ */ v(s, {})
406
+ }) : null,
407
+ c ? /* @__PURE__ */ y("span", {
408
+ className: "select-album__more",
409
+ "aria-hidden": "true",
410
+ children: ["+", i]
411
+ }) : null
412
+ ] }), u = `${n.openMedia(o + 1, e.length)}${a.alt ? `: ${a.alt}` : ""}${c ? ` (${n.moreMedia(i)})` : ""}`;
413
+ return t ? /* @__PURE__ */ v("button", {
414
+ type: "button",
415
+ className: "select-album__tile",
416
+ onClick: () => t(o),
417
+ "aria-label": u,
418
+ children: l
419
+ }, `${a.src}-${o}`) : /* @__PURE__ */ v("span", {
420
+ className: "select-album__tile",
421
+ children: l
422
+ }, `${a.src}-${o}`);
423
+ })
424
+ });
425
+ }
426
+ //#endregion
427
+ export { S as SelectContactCard, j as SelectDocumentCard, k as SelectInteractiveListSheet, A as SelectInteractiveMessage, x as SelectLocationCard, M as SelectMediaAlbum, O as SelectTemplateMessage, C as SelectTemplateVar, T as renderTemplateText };
428
+
429
+ //# sourceMappingURL=SelectMessageCards.js.map
@@ -0,0 +1,7 @@
1
+ export type SelectMessageStatus = 'queued' | 'sent' | 'delivered' | 'read' | 'failed';
2
+ export interface SelectMessageTicksProps {
3
+ status: SelectMessageStatus;
4
+ /** O nome para o leitor de tela e a dica do mouse (padrão: "Na fila", "Enviada", "Entregue", "Lida", "Não entregue"). */
5
+ label?: string;
6
+ }
7
+ export declare function SelectMessageTicks({ status, label }: SelectMessageTicksProps): import("react").JSX.Element;
@@ -0,0 +1,31 @@
1
+ /* empty css */
2
+ import { ClockIcon as e, TickDoubleIcon as t, WarningIcon as n } from "./icons.js";
3
+ import { useSelectMessages as r } from "./SelectLocale.js";
4
+ import { jsx as i } from "react/jsx-runtime";
5
+ //#region src/SelectMessageTicks.tsx
6
+ function a() {
7
+ return /* @__PURE__ */ i("svg", {
8
+ viewBox: "0 0 24 24",
9
+ fill: "none",
10
+ stroke: "currentColor",
11
+ strokeWidth: "2",
12
+ strokeLinecap: "round",
13
+ strokeLinejoin: "round",
14
+ "aria-hidden": "true",
15
+ children: /* @__PURE__ */ i("path", { d: "M5 12.5 9.5 17 18 7" })
16
+ });
17
+ }
18
+ function o({ status: o, label: s }) {
19
+ let c = r().chat, l = s ?? c.status[o];
20
+ return /* @__PURE__ */ i("span", {
21
+ className: `select-ticks select-ticks--${o}`,
22
+ role: "img",
23
+ "aria-label": l,
24
+ title: l,
25
+ children: i(o === "queued" ? e : o === "sent" ? a : o === "failed" ? n : t, {})
26
+ });
27
+ }
28
+ //#endregion
29
+ export { o as SelectMessageTicks };
30
+
31
+ //# sourceMappingURL=SelectMessageTicks.js.map
@@ -0,0 +1,27 @@
1
+ import { ReactNode } from 'react';
2
+ export interface SelectVoiceNoteProps {
3
+ /** O endereço do áudio (ogg/opus, mp3, m4a…). */
4
+ src: string;
5
+ /** A duração em segundos, conhecida antes de o arquivo carregar. */
6
+ duration?: number;
7
+ /** As alturas da onda, de 0 a 1. */
8
+ peaks?: readonly number[];
9
+ /** Quantas barras a onda tem (padrão: 30). */
10
+ bars?: number;
11
+ /** A foto ou as iniciais de quem gravou (`SelectAvatar`), com o selo do microfone. */
12
+ avatar?: ReactNode;
13
+ /** No canto de baixo à direita: a hora e o estado (`SelectMessageTicks`). */
14
+ stamp?: ReactNode;
15
+ /** As velocidades do botão, na ordem (padrão: 1, 1,5 e 2). `[]` tira o botão. */
16
+ speeds?: readonly number[];
17
+ /** O nome do grupo para o leitor de tela (padrão: "Mensagem de voz"). */
18
+ label?: string;
19
+ /** O primeiro play (quem usa marca como ouvida). */
20
+ onPlay?: () => void;
21
+ onError?: () => void;
22
+ }
23
+ /** "0:42", "12:05". */
24
+ export declare function formatVoiceTime(seconds: number): string;
25
+ /** Uma onda fixa para quem não tem os picos: tirada do texto (o endereço), sempre a mesma para o mesmo texto. */
26
+ export declare function voiceNotePeaks(seed: string, count?: number): number[];
27
+ export declare function SelectVoiceNote({ src, duration, peaks, bars, avatar, stamp, speeds, label, onPlay, onError, }: SelectVoiceNoteProps): import("react").JSX.Element;