@selectwin/kit 0.1.259 → 0.1.260
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.
- package/README.md +16 -0
- package/dist/SelectComposerNotice.d.ts +14 -0
- package/dist/SelectComposerNotice.js +37 -0
- package/dist/SelectMail.d.ts +43 -7
- package/dist/SelectMail.js +108 -62
- package/dist/SelectSegmented.d.ts +11 -0
- package/dist/SelectSegmented.js +87 -68
- package/dist/SelectTabs.d.ts +5 -8
- package/dist/SelectTabs.js +24 -55
- package/dist/index.d.ts +2 -0
- package/dist/index.js +183 -182
- package/dist/internal/scrollReveal.d.ts +19 -0
- package/dist/internal/scrollReveal.js +38 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -174,6 +174,22 @@ leitor de tela na célula de cabeçalho da linha); a seção que recolhe com a a
|
|
|
174
174
|
com `help` e `action`: o título de verdade com o botão dentro, a ação à direita, a seta no fim); e o "(opcional)" do
|
|
175
175
|
`SelectCombobox` (`optional`). Os textos novos estão no `SelectLocale`, em pt-BR e en.
|
|
176
176
|
|
|
177
|
+
O Chat das pranchas (0.1.260: "O WhatsApp em Conexões e o Chat" e "Inbox do WhatsApp"). Tudo opcional, a 0.1.259 segue
|
|
178
|
+
igual. A caixa: `SelectInbox` com `listWidth` e `asideWidth` (a largura das colunas por fora; as pranchas, `18.75rem` e
|
|
179
|
+
`16.25rem`; os tokens `--select-inbox-list-w` e `--select-inbox-aside-w`), a `toolbar` agora opcional e o `listHeader`, o
|
|
180
|
+
topo preso da coluna da lista (a busca e as fichas dos filtros). O cabeçalho da conversa numa linha
|
|
181
|
+
(`SelectMailReader variant="chat" avatar={<SelectAvatar … />}`: o rosto, o nome com as reticências, a janela e os ícones
|
|
182
|
+
ao lado). O compositor de uma linha (`SelectMailComposer variant="chat"` com `start`, `end`, `hint` e `hintEnd`, e o
|
|
183
|
+
`SelectMailComposerBody autoGrow minRows={1}` no meio; a dica fica embaixo, fora da caixa). A faixa no lugar do
|
|
184
|
+
compositor (`SelectComposerNotice title action`, o texto como filho: "A janela de 24 h fechou há 2 dias" e o "Escolher
|
|
185
|
+
um modelo" à direita; `icon={false}` tira o cadeado). As fichas que rolam de lado (`SelectSegmented variant="chips"
|
|
186
|
+
scroll`, com a marcada à vista e o degradê na ponta; com `size="sm"`, as fichas pequenas da prancha e o número em texto;
|
|
187
|
+
com `selected="solid"`, a marcada preenchida no primário, com o número dentro).
|
|
188
|
+
E os consertos: o balão que encolhe com o cartão de largura fixa (o modelo, o documento), a barra de ações do balão que
|
|
189
|
+
fica dentro da conversa estreita (abaixo de 32rem, em cima do balão), o cartão (`SelectSection`) que recorta sem
|
|
190
|
+
prender o `sticky` da barra do lote, o pé da conversa com um piso em tela baixa (`--select-mailreader-footer-min`) e o
|
|
191
|
+
rótulo da lista empilhada na folha lateral com a altura do texto.
|
|
192
|
+
|
|
177
193
|
## Build
|
|
178
194
|
|
|
179
195
|
```bash
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
type SelectComposerNoticeOwnProps = {
|
|
3
|
+
/** O que aconteceu ("A janela de 24 h fechou há 2 dias"). */
|
|
4
|
+
title: ReactNode;
|
|
5
|
+
/** O que fazer agora ("Para voltar a falar com Thiago, mande um modelo aprovado pela Meta."). */
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
/** O ícone do quadrado (padrão: o cadeado); `false` tira. */
|
|
8
|
+
icon?: ReactNode;
|
|
9
|
+
/** A ação, à direita (o botão do kit: "Escolher um modelo"). */
|
|
10
|
+
action?: ReactNode;
|
|
11
|
+
};
|
|
12
|
+
export type SelectComposerNoticeProps = SelectComposerNoticeOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectComposerNoticeOwnProps>;
|
|
13
|
+
export declare const SelectComposerNotice: import('react').ForwardRefExoticComponent<SelectComposerNoticeOwnProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof SelectComposerNoticeOwnProps> & import('react').RefAttributes<HTMLDivElement>>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { LockIcon as e } from "./icons.js";
|
|
2
|
+
import { forwardRef as t } from "react";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
//#region src/SelectComposerNotice.tsx
|
|
5
|
+
var i = t(function({ title: t, children: i, icon: a, action: o, className: s, ...c }, l) {
|
|
6
|
+
let u = a === void 0 ? /* @__PURE__ */ n(e, {}) : a;
|
|
7
|
+
return /* @__PURE__ */ r("div", {
|
|
8
|
+
ref: l,
|
|
9
|
+
...c,
|
|
10
|
+
className: `select-composer-notice${s ? " " + s : ""}`,
|
|
11
|
+
children: [
|
|
12
|
+
u != null && u !== !1 ? /* @__PURE__ */ n("span", {
|
|
13
|
+
className: "select-composer-notice__icon",
|
|
14
|
+
"aria-hidden": "true",
|
|
15
|
+
children: u
|
|
16
|
+
}) : null,
|
|
17
|
+
/* @__PURE__ */ r("div", {
|
|
18
|
+
className: "select-composer-notice__body",
|
|
19
|
+
children: [/* @__PURE__ */ n("p", {
|
|
20
|
+
className: "select-composer-notice__title",
|
|
21
|
+
children: t
|
|
22
|
+
}), i != null && i !== !1 ? /* @__PURE__ */ n("p", {
|
|
23
|
+
className: "select-composer-notice__text",
|
|
24
|
+
children: i
|
|
25
|
+
}) : null]
|
|
26
|
+
}),
|
|
27
|
+
o != null && o !== !1 ? /* @__PURE__ */ n("div", {
|
|
28
|
+
className: "select-composer-notice__action",
|
|
29
|
+
children: o
|
|
30
|
+
}) : null
|
|
31
|
+
]
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
//#endregion
|
|
35
|
+
export { i as SelectComposerNotice };
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=SelectComposerNotice.js.map
|
package/dist/SelectMail.d.ts
CHANGED
|
@@ -7,7 +7,24 @@ export interface SelectMailAddress {
|
|
|
7
7
|
/** "Ana Souza" ou, sem nome, o endereço. */
|
|
8
8
|
export declare function mailName(a: SelectMailAddress | null | undefined): string;
|
|
9
9
|
export interface SelectInboxProps {
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* A barra de ponta a ponta, em cima da lista e da conversa. 0.1.260: opcional — sem ela (ou vazia), nada de barra, e o
|
|
12
|
+
* cabeçalho da conversa começa no topo da caixa (as pranchas do Chat põem a busca e os filtros no `listHeader`).
|
|
13
|
+
*/
|
|
14
|
+
toolbar?: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* 0.1.260: o topo da coluna da lista (a busca e as fichas dos filtros, as pranchas do Chat): preso em cima enquanto a
|
|
17
|
+
* lista rola por baixo. No celular, sai junto com a lista quando a conversa abre.
|
|
18
|
+
*/
|
|
19
|
+
listHeader?: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* 0.1.260: a largura da coluna da lista e a da coluna do contato, de fora a fora (um comprimento CSS, com a borda e o
|
|
22
|
+
* respiro dentro; o padrão é a largura de antes). As pranchas do Chat: a lista com 18,75rem (300 px) e o contato com
|
|
23
|
+
* 16,25rem (260 px). Os tokens `--select-inbox-list-w` e `--select-inbox-aside-w` fazem o mesmo pelo CSS. No celular,
|
|
24
|
+
* a lista ocupa a tela, como antes.
|
|
25
|
+
*/
|
|
26
|
+
listWidth?: string;
|
|
27
|
+
asideWidth?: string;
|
|
11
28
|
/** Sob a barra, a largura toda (ex.: "a senha da sua caixa deixou de valer"). */
|
|
12
29
|
banner?: ReactNode;
|
|
13
30
|
list?: ReactNode;
|
|
@@ -36,7 +53,7 @@ export interface SelectInboxProps {
|
|
|
36
53
|
'aria-label'?: string;
|
|
37
54
|
}
|
|
38
55
|
/** A caixa de entrada em tela cheia: preenche a altura do pai e cada coluna rola por dentro. */
|
|
39
|
-
export declare function SelectInbox({ toolbar, banner, list, reader, readerOpen, children, fullBody, aside, asideLabel, listLabel, readerLabel, framed, 'aria-label': ariaLabel, }: SelectInboxProps): import("react").JSX.Element;
|
|
56
|
+
export declare function SelectInbox({ toolbar, listHeader, listWidth, asideWidth, banner, list, reader, readerOpen, children, fullBody, aside, asideLabel, listLabel, readerLabel, framed, 'aria-label': ariaLabel, }: SelectInboxProps): import("react").JSX.Element;
|
|
40
57
|
/** A faixa de aviso sob a barra, de ponta a ponta (ex.: "a senha da sua caixa deixou de valer"). */
|
|
41
58
|
export declare function SelectInboxBanner({ tone, children, action }: {
|
|
42
59
|
tone?: 'warning' | 'critical' | 'info';
|
|
@@ -134,8 +151,13 @@ export interface SelectMailReaderProps {
|
|
|
134
151
|
footer?: ReactNode;
|
|
135
152
|
/** 0.1.159: `chat` = uma conversa de mensagens curtas (`SelectConversation`), sobre o fundo tingido. */
|
|
136
153
|
variant?: 'mail' | 'chat';
|
|
154
|
+
/**
|
|
155
|
+
* 0.1.260: o rosto de quem está na conversa, antes do nome (o `SelectAvatar`, as pranchas do Chat). Fica fora da
|
|
156
|
+
* leitura do título: o nome já diz quem é.
|
|
157
|
+
*/
|
|
158
|
+
avatar?: ReactNode;
|
|
137
159
|
}
|
|
138
|
-
export declare function SelectMailReader({ title, meta, actions, tools, onBack, children, footer, variant }: SelectMailReaderProps): import("react").JSX.Element;
|
|
160
|
+
export declare function SelectMailReader({ title, meta, actions, tools, onBack, children, footer, variant, avatar }: SelectMailReaderProps): import("react").JSX.Element;
|
|
139
161
|
export interface SelectMailMessageProps {
|
|
140
162
|
from: SelectMailAddress | null;
|
|
141
163
|
to?: SelectMailAddress[];
|
|
@@ -202,8 +224,21 @@ export declare function SelectLeadChip({ children, onClick, variant, title, }: {
|
|
|
202
224
|
title?: string;
|
|
203
225
|
}): import("react").JSX.Element;
|
|
204
226
|
export interface SelectMailComposerProps {
|
|
205
|
-
/**
|
|
206
|
-
|
|
227
|
+
/**
|
|
228
|
+
* Na conversa (`inline`) ou numa janela encaixada no canto da tela (`dock`). 0.1.260: `chat` é o compositor de UMA
|
|
229
|
+
* linha das pranchas do Chat — o `start` (o emoji, o anexar, as respostas rápidas) à esquerda, o campo no meio (que
|
|
230
|
+
* cresce: o `SelectMailComposerBody autoGrow`), o `end` (o "Modelo", o enviar) à direita; e a dica embaixo, fora da
|
|
231
|
+
* caixa (`hint` à esquerda, `hintEnd` à direita).
|
|
232
|
+
*/
|
|
233
|
+
variant?: 'inline' | 'dock' | 'chat';
|
|
234
|
+
/** 0.1.260, no `chat`: o que vem antes do campo, na mesma linha (os botões de ícone). */
|
|
235
|
+
start?: ReactNode;
|
|
236
|
+
/** 0.1.260, no `chat`: o que vem depois do campo, na mesma linha (o "Modelo", o enviar que grava áudio sem texto). */
|
|
237
|
+
end?: ReactNode;
|
|
238
|
+
/** 0.1.260, no `chat`: a dica embaixo, fora da caixa, à esquerda ("Enter envia · Shift + Enter quebra a linha"). */
|
|
239
|
+
hint?: ReactNode;
|
|
240
|
+
/** 0.1.260, no `chat`: a dica da direita ("Texto livre até amanhã, 14:32"). */
|
|
241
|
+
hintEnd?: ReactNode;
|
|
207
242
|
/** O título da janela (`dock`): o assunto, ou "Nova mensagem". */
|
|
208
243
|
title?: ReactNode;
|
|
209
244
|
/** A janela recolhida: só o título. */
|
|
@@ -221,11 +256,12 @@ export interface SelectMailComposerProps {
|
|
|
221
256
|
onFiles?: (files: File[]) => void;
|
|
222
257
|
/** O que aparece enquanto o arquivo passa por cima. */
|
|
223
258
|
dropLabel?: ReactNode;
|
|
224
|
-
|
|
259
|
+
/** O rodapé (o anexar, a nota e o enviar). 0.1.260: opcional — no `chat`, o `start` e o `end` ficam na linha do campo. */
|
|
260
|
+
footer?: ReactNode;
|
|
225
261
|
children: ReactNode;
|
|
226
262
|
'aria-label'?: string;
|
|
227
263
|
}
|
|
228
|
-
export declare function SelectMailComposer({ variant, title, minimized, onToggleMinimize, onClose, closeLabel, error, attachments, onFiles, dropLabel, footer, children, 'aria-label': ariaLabel, }: SelectMailComposerProps): import("react").JSX.Element;
|
|
264
|
+
export declare function SelectMailComposer({ variant, title, minimized, onToggleMinimize, onClose, closeLabel, error, attachments, onFiles, dropLabel, footer, start, end, hint, hintEnd, children, 'aria-label': ariaLabel, }: SelectMailComposerProps): import("react").JSX.Element;
|
|
229
265
|
/** Uma linha do compositor: o rótulo ("Para", "Cc", "Assunto"), o campo e uma ação à direita ("Cc"). */
|
|
230
266
|
export declare function SelectMailComposerRow({ label, children, action }: {
|
|
231
267
|
label?: ReactNode;
|
package/dist/SelectMail.js
CHANGED
|
@@ -13,41 +13,48 @@ function O(e) {
|
|
|
13
13
|
return e ? ((t = e.name) == null ? void 0 : t.trim()) || e.address : "Remetente desconhecido";
|
|
14
14
|
}
|
|
15
15
|
var k = (...e) => e.filter(Boolean).join(" ");
|
|
16
|
-
function A({ toolbar: e,
|
|
17
|
-
let
|
|
16
|
+
function A({ toolbar: e, listHeader: t, listWidth: n, asideWidth: r, banner: i, list: a, reader: o, readerOpen: s = !1, children: c, fullBody: l, aside: u, asideLabel: d, listLabel: f, readerLabel: p, framed: m = !1, "aria-label": g }) {
|
|
17
|
+
let _ = h().inbox, v = n || r ? {
|
|
18
|
+
...n ? { "--select-inbox-list-w": n } : {},
|
|
19
|
+
...r ? { "--select-inbox-aside-w": r } : {}
|
|
20
|
+
} : void 0;
|
|
18
21
|
return /* @__PURE__ */ D("div", {
|
|
19
|
-
className: k("select-inbox",
|
|
20
|
-
"aria-label":
|
|
22
|
+
className: k("select-inbox", m && "select-inbox--framed", s && "is-reading"),
|
|
23
|
+
"aria-label": g,
|
|
24
|
+
style: v,
|
|
21
25
|
children: [
|
|
22
|
-
/* @__PURE__ */ E("div", {
|
|
26
|
+
e != null && e !== !1 ? /* @__PURE__ */ E("div", {
|
|
23
27
|
className: "select-inbox__toolbar",
|
|
24
28
|
children: e
|
|
25
|
-
}),
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
}) : null,
|
|
30
|
+
i,
|
|
31
|
+
l ? /* @__PURE__ */ E("div", {
|
|
28
32
|
className: "select-inbox__body select-inbox__body--full",
|
|
29
|
-
children:
|
|
33
|
+
children: l
|
|
30
34
|
}) : /* @__PURE__ */ D("div", {
|
|
31
35
|
className: "select-inbox__body",
|
|
32
36
|
children: [
|
|
33
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ D("section", {
|
|
34
38
|
className: "select-inbox__list",
|
|
35
|
-
"aria-label":
|
|
36
|
-
children:
|
|
39
|
+
"aria-label": f ?? _.list,
|
|
40
|
+
children: [t != null && t !== !1 ? /* @__PURE__ */ E("div", {
|
|
41
|
+
className: "select-inbox__listhead",
|
|
42
|
+
children: t
|
|
43
|
+
}) : null, a]
|
|
37
44
|
}),
|
|
38
45
|
/* @__PURE__ */ E("section", {
|
|
39
46
|
className: "select-inbox__reader",
|
|
40
|
-
"aria-label":
|
|
41
|
-
children:
|
|
47
|
+
"aria-label": p ?? _.reader,
|
|
48
|
+
children: o
|
|
42
49
|
}),
|
|
43
|
-
|
|
50
|
+
u ? /* @__PURE__ */ E("aside", {
|
|
44
51
|
className: "select-inbox__aside",
|
|
45
|
-
"aria-label":
|
|
46
|
-
children:
|
|
52
|
+
"aria-label": d ?? _.aside,
|
|
53
|
+
children: u
|
|
47
54
|
}) : null
|
|
48
55
|
]
|
|
49
56
|
}),
|
|
50
|
-
|
|
57
|
+
c
|
|
51
58
|
]
|
|
52
59
|
});
|
|
53
60
|
}
|
|
@@ -135,14 +142,14 @@ function P({ icon: e, title: t, children: n, details: r, action: i, tone: a = "n
|
|
|
135
142
|
]
|
|
136
143
|
});
|
|
137
144
|
}
|
|
138
|
-
function
|
|
145
|
+
function F({ children: e, "aria-label": t }) {
|
|
139
146
|
return /* @__PURE__ */ E("div", {
|
|
140
147
|
className: "select-maillist",
|
|
141
148
|
"aria-label": t,
|
|
142
149
|
children: e
|
|
143
150
|
});
|
|
144
151
|
}
|
|
145
|
-
function
|
|
152
|
+
function I({ label: e, children: t }) {
|
|
146
153
|
return /* @__PURE__ */ D("div", {
|
|
147
154
|
className: "select-maillist__group",
|
|
148
155
|
role: "group",
|
|
@@ -157,7 +164,7 @@ function te({ label: e, children: t }) {
|
|
|
157
164
|
})]
|
|
158
165
|
});
|
|
159
166
|
}
|
|
160
|
-
function
|
|
167
|
+
function L({ from: e, avatar: t, subject: n, snippet: r, date: i, count: a, attachments: o, active: s = !1, unread: l = !1, flagged: u = !1, unreadCount: d, onClick: p }) {
|
|
161
168
|
let m = h().inbox, g = d != null && d > 0, _ = l || g, y = t === !1 ? void 0 : t ?? (typeof e == "string" ? e : void 0);
|
|
162
169
|
return /* @__PURE__ */ D("button", {
|
|
163
170
|
type: "button",
|
|
@@ -227,7 +234,7 @@ function F({ from: e, avatar: t, subject: n, snippet: r, date: i, count: a, atta
|
|
|
227
234
|
})]
|
|
228
235
|
});
|
|
229
236
|
}
|
|
230
|
-
function
|
|
237
|
+
function R({ rows: e = 6 }) {
|
|
231
238
|
return /* @__PURE__ */ E("div", {
|
|
232
239
|
className: "select-maillist__skeleton",
|
|
233
240
|
"aria-hidden": "true",
|
|
@@ -246,14 +253,14 @@ function I({ rows: e = 6 }) {
|
|
|
246
253
|
}, t))
|
|
247
254
|
});
|
|
248
255
|
}
|
|
249
|
-
function
|
|
256
|
+
function z({ children: e, tone: t = "muted" }) {
|
|
250
257
|
return /* @__PURE__ */ E("div", {
|
|
251
258
|
className: `select-maillist__note select-maillist__note--${t}`,
|
|
252
259
|
children: e
|
|
253
260
|
});
|
|
254
261
|
}
|
|
255
|
-
function
|
|
256
|
-
let
|
|
262
|
+
function B({ title: t, meta: n, actions: r, tools: i, onBack: a, children: o, footer: s, variant: c = "mail", avatar: l }) {
|
|
263
|
+
let u = h().inbox;
|
|
257
264
|
return /* @__PURE__ */ D("div", {
|
|
258
265
|
className: k("select-mailreader", c === "chat" && "select-mailreader--chat"),
|
|
259
266
|
children: [
|
|
@@ -264,11 +271,16 @@ function R({ title: t, meta: n, actions: r, tools: i, onBack: a, children: o, fo
|
|
|
264
271
|
className: "select-mailreader__back",
|
|
265
272
|
children: /* @__PURE__ */ E(_, {
|
|
266
273
|
icon: /* @__PURE__ */ E(e, {}),
|
|
267
|
-
label:
|
|
274
|
+
label: u.back,
|
|
268
275
|
size: "sm",
|
|
269
276
|
onClick: a
|
|
270
277
|
})
|
|
271
278
|
}) : null,
|
|
279
|
+
l != null && l !== !1 ? /* @__PURE__ */ E("span", {
|
|
280
|
+
className: "select-mailreader__avatar",
|
|
281
|
+
"aria-hidden": "true",
|
|
282
|
+
children: l
|
|
283
|
+
}) : null,
|
|
272
284
|
/* @__PURE__ */ D("div", {
|
|
273
285
|
className: "select-mailreader__titles",
|
|
274
286
|
children: [/* @__PURE__ */ E("h2", {
|
|
@@ -290,7 +302,7 @@ function R({ title: t, meta: n, actions: r, tools: i, onBack: a, children: o, fo
|
|
|
290
302
|
i ? /* @__PURE__ */ E("span", {
|
|
291
303
|
className: "select-mailreader__tools",
|
|
292
304
|
role: "group",
|
|
293
|
-
"aria-label":
|
|
305
|
+
"aria-label": u.tools,
|
|
294
306
|
children: i
|
|
295
307
|
}) : null
|
|
296
308
|
]
|
|
@@ -308,7 +320,7 @@ function R({ title: t, meta: n, actions: r, tools: i, onBack: a, children: o, fo
|
|
|
308
320
|
]
|
|
309
321
|
});
|
|
310
322
|
}
|
|
311
|
-
function
|
|
323
|
+
function V({ from: e, to: t, cc: n, bcc: i, selfAddress: a, date: o, dateTitle: s, actions: l, notice: u, text: d, children: f, attachments: p, collapsed: m = !1, snippet: h, hasAttachments: g = !1, onToggle: y }) {
|
|
312
324
|
let b = (e) => !!e && !!a && e.address.toLowerCase() === a.toLowerCase(), x = (e) => (e ?? []).map((e) => b(e) ? "você" : O(e)).join(", "), S = O(e);
|
|
313
325
|
if (m) return /* @__PURE__ */ D("button", {
|
|
314
326
|
type: "button",
|
|
@@ -412,7 +424,7 @@ function z({ from: e, to: t, cc: n, bcc: i, selfAddress: a, date: o, dateTitle:
|
|
|
412
424
|
]
|
|
413
425
|
});
|
|
414
426
|
}
|
|
415
|
-
function
|
|
427
|
+
function H({ tone: e = "info", icon: t, children: n }) {
|
|
416
428
|
return /* @__PURE__ */ D("div", {
|
|
417
429
|
className: `select-mailnotice select-mailnotice--${e}`,
|
|
418
430
|
children: [/* @__PURE__ */ E("span", {
|
|
@@ -422,7 +434,7 @@ function B({ tone: e = "info", icon: t, children: n }) {
|
|
|
422
434
|
}), /* @__PURE__ */ E("span", { children: n })]
|
|
423
435
|
});
|
|
424
436
|
}
|
|
425
|
-
function
|
|
437
|
+
function U({ name: e, size: t, state: n = "idle", onClick: r, loadingLabel: i, readyLabel: s, failedLabel: c }) {
|
|
426
438
|
let l = h().inbox, u = y(e), d = n === "loading" ? i ?? l.attachmentLoading : n === "ready" ? s ?? l.attachmentReady : n === "failed" ? c ?? l.attachmentFailed : t, f = n === "ready" ? l.attachmentOpen(e) : n === "loading" ? l.attachmentBusy(e) : l.attachmentGet(e);
|
|
427
439
|
return /* @__PURE__ */ D("button", {
|
|
428
440
|
type: "button",
|
|
@@ -454,7 +466,7 @@ function V({ name: e, size: t, state: n = "idle", onClick: r, loadingLabel: i, r
|
|
|
454
466
|
]
|
|
455
467
|
});
|
|
456
468
|
}
|
|
457
|
-
function
|
|
469
|
+
function W({ children: e, onClick: n, variant: r = "link", title: i }) {
|
|
458
470
|
return /* @__PURE__ */ D("button", {
|
|
459
471
|
type: "button",
|
|
460
472
|
className: `select-leadchip select-leadchip--${r}`,
|
|
@@ -478,35 +490,34 @@ function H({ children: e, onClick: n, variant: r = "link", title: i }) {
|
|
|
478
490
|
]
|
|
479
491
|
});
|
|
480
492
|
}
|
|
481
|
-
var
|
|
493
|
+
var G = (e) => {
|
|
482
494
|
var t;
|
|
483
495
|
return Array.from(((t = e.dataTransfer) == null ? void 0 : t.types) ?? []).includes("Files");
|
|
484
496
|
};
|
|
485
|
-
function
|
|
486
|
-
let
|
|
497
|
+
function K({ variant: e = "inline", title: t, minimized: a = !1, onToggleMinimize: o, onClose: l, closeLabel: u, error: d, attachments: f, onFiles: p, dropLabel: m, footer: g, start: v, end: y, hint: b, hintEnd: x, children: S, "aria-label": O }) {
|
|
498
|
+
let A = h().inbox, j = e === "dock", M = e === "chat", [N, P] = w(!1), F = C(0), I = p ? {
|
|
487
499
|
onDragEnter: (e) => {
|
|
488
|
-
|
|
500
|
+
G(e) && (e.preventDefault(), F.current += 1, P(!0));
|
|
489
501
|
},
|
|
490
502
|
onDragOver: (e) => {
|
|
491
|
-
|
|
503
|
+
G(e) && e.preventDefault();
|
|
492
504
|
},
|
|
493
505
|
onDragLeave: (e) => {
|
|
494
|
-
|
|
506
|
+
G(e) && (F.current = Math.max(0, F.current - 1), F.current === 0 && P(!1));
|
|
495
507
|
},
|
|
496
508
|
onDrop: (e) => {
|
|
497
|
-
if (!
|
|
498
|
-
e.preventDefault(),
|
|
509
|
+
if (!G(e)) return;
|
|
510
|
+
e.preventDefault(), F.current = 0, P(!1);
|
|
499
511
|
let t = Array.from(e.dataTransfer.files);
|
|
500
512
|
t.length && p(t);
|
|
501
513
|
}
|
|
502
|
-
} : {}
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
...j,
|
|
514
|
+
} : {}, L = /* @__PURE__ */ D("div", {
|
|
515
|
+
className: k("select-mailcomposer", `select-mailcomposer--${e}`, a && "is-minimized", N && "is-dragging"),
|
|
516
|
+
role: j ? "dialog" : "group",
|
|
517
|
+
"aria-label": O,
|
|
518
|
+
...I,
|
|
508
519
|
children: [
|
|
509
|
-
|
|
520
|
+
j ? /* @__PURE__ */ D("div", {
|
|
510
521
|
className: "select-mailcomposer__bar",
|
|
511
522
|
children: [
|
|
512
523
|
/* @__PURE__ */ E("span", {
|
|
@@ -515,27 +526,58 @@ function W({ variant: e = "inline", title: t, minimized: a = !1, onToggleMinimiz
|
|
|
515
526
|
}),
|
|
516
527
|
o ? /* @__PURE__ */ E(_, {
|
|
517
528
|
icon: E(a ? r : n, {}),
|
|
518
|
-
label: a ?
|
|
529
|
+
label: a ? A.open : A.minimize,
|
|
519
530
|
size: "sm",
|
|
520
531
|
onClick: o
|
|
521
532
|
}) : null,
|
|
522
533
|
l ? /* @__PURE__ */ E(_, {
|
|
523
534
|
icon: /* @__PURE__ */ E(i, {}),
|
|
524
|
-
label: u ??
|
|
535
|
+
label: u ?? A.close,
|
|
525
536
|
size: "sm",
|
|
526
537
|
onClick: l
|
|
527
538
|
}) : null
|
|
528
539
|
]
|
|
529
540
|
}) : null,
|
|
530
|
-
|
|
541
|
+
N && !a ? /* @__PURE__ */ D("div", {
|
|
531
542
|
className: "select-mailcomposer__drop",
|
|
532
543
|
"aria-hidden": "true",
|
|
533
|
-
children: [/* @__PURE__ */ E(c, {}), /* @__PURE__ */ E("span", { children: m ??
|
|
544
|
+
children: [/* @__PURE__ */ E(c, {}), /* @__PURE__ */ E("span", { children: m ?? A.drop })]
|
|
534
545
|
}) : null,
|
|
535
|
-
a ? null : /* @__PURE__ */ D(T, { children: [
|
|
546
|
+
a ? null : M ? /* @__PURE__ */ D(T, { children: [
|
|
547
|
+
f,
|
|
548
|
+
d ? /* @__PURE__ */ D("div", {
|
|
549
|
+
className: "select-mailcomposer__error",
|
|
550
|
+
role: "alert",
|
|
551
|
+
children: [/* @__PURE__ */ E("span", {
|
|
552
|
+
"aria-hidden": "true",
|
|
553
|
+
children: /* @__PURE__ */ E(s, {})
|
|
554
|
+
}), /* @__PURE__ */ E("span", { children: d })]
|
|
555
|
+
}) : null,
|
|
556
|
+
/* @__PURE__ */ D("div", {
|
|
557
|
+
className: "select-mailcomposer__line",
|
|
558
|
+
children: [
|
|
559
|
+
v != null && v !== !1 ? /* @__PURE__ */ E("div", {
|
|
560
|
+
className: "select-mailcomposer__start",
|
|
561
|
+
children: v
|
|
562
|
+
}) : null,
|
|
563
|
+
/* @__PURE__ */ E("div", {
|
|
564
|
+
className: "select-mailcomposer__fields",
|
|
565
|
+
children: S
|
|
566
|
+
}),
|
|
567
|
+
y != null && y !== !1 ? /* @__PURE__ */ E("div", {
|
|
568
|
+
className: "select-mailcomposer__end",
|
|
569
|
+
children: y
|
|
570
|
+
}) : null
|
|
571
|
+
]
|
|
572
|
+
}),
|
|
573
|
+
g != null && g !== !1 ? /* @__PURE__ */ E("div", {
|
|
574
|
+
className: "select-mailcomposer__footer",
|
|
575
|
+
children: g
|
|
576
|
+
}) : null
|
|
577
|
+
] }) : /* @__PURE__ */ D(T, { children: [
|
|
536
578
|
/* @__PURE__ */ E("div", {
|
|
537
579
|
className: "select-mailcomposer__fields",
|
|
538
|
-
children:
|
|
580
|
+
children: S
|
|
539
581
|
}),
|
|
540
582
|
f,
|
|
541
583
|
d ? /* @__PURE__ */ D("div", {
|
|
@@ -553,8 +595,12 @@ function W({ variant: e = "inline", title: t, minimized: a = !1, onToggleMinimiz
|
|
|
553
595
|
] })
|
|
554
596
|
]
|
|
555
597
|
});
|
|
598
|
+
return !M || (b == null || b === !1) && (x == null || x === !1) ? L : /* @__PURE__ */ D(T, { children: [L, /* @__PURE__ */ D("div", {
|
|
599
|
+
className: "select-mailcomposer__hint",
|
|
600
|
+
children: [/* @__PURE__ */ E("span", { children: b }), x != null && x !== !1 ? /* @__PURE__ */ E("span", { children: x }) : null]
|
|
601
|
+
})] });
|
|
556
602
|
}
|
|
557
|
-
function
|
|
603
|
+
function q({ label: e, children: t, action: n }) {
|
|
558
604
|
return /* @__PURE__ */ D("div", {
|
|
559
605
|
className: "select-mailcomposer__row",
|
|
560
606
|
children: [
|
|
@@ -573,7 +619,7 @@ function G({ label: e, children: t, action: n }) {
|
|
|
573
619
|
]
|
|
574
620
|
});
|
|
575
621
|
}
|
|
576
|
-
function
|
|
622
|
+
function J({ value: e, onChange: t, placeholder: n, "aria-label": r, maxLength: i }) {
|
|
577
623
|
return /* @__PURE__ */ E("input", {
|
|
578
624
|
className: "select-mailcomposer__input",
|
|
579
625
|
value: e,
|
|
@@ -583,19 +629,19 @@ function K({ value: e, onChange: t, placeholder: n, "aria-label": r, maxLength:
|
|
|
583
629
|
maxLength: i
|
|
584
630
|
});
|
|
585
631
|
}
|
|
586
|
-
function
|
|
632
|
+
function Y(e, t, n) {
|
|
587
633
|
let r = getComputedStyle(e), i = parseFloat(r.lineHeight) || 22, a = (parseFloat(r.paddingTop) || 0) + (parseFloat(r.paddingBottom) || 0) + (parseFloat(r.borderTopWidth) || 0) + (parseFloat(r.borderBottomWidth) || 0), o = i * t + a, s = i * n + a;
|
|
588
634
|
e.style.height = "auto";
|
|
589
635
|
let c = e.scrollHeight + (parseFloat(r.borderTopWidth) || 0) + (parseFloat(r.borderBottomWidth) || 0);
|
|
590
636
|
e.style.height = `${Math.round(Math.min(s, Math.max(o, c)))}px`, e.style.overflowY = c > s ? "auto" : "hidden";
|
|
591
637
|
}
|
|
592
|
-
function
|
|
638
|
+
function X({ value: e, onChange: t, placeholder: n, rows: r = 6, autoGrow: i = !1, minRows: a = 3, maxRows: o = 12, "aria-label": s, maxLength: c, onEnter: l, id: u, textareaRef: d, onKeyDown: f, onSelect: p, fieldProps: m }) {
|
|
593
639
|
let g = h().inbox, _ = C(null), v = x((e) => {
|
|
594
640
|
_.current = e, typeof d == "function" ? d(e) : d && (d.current = e);
|
|
595
641
|
}, [d]);
|
|
596
642
|
return S(() => {
|
|
597
643
|
let e = _.current;
|
|
598
|
-
i && e &&
|
|
644
|
+
i && e && Y(e, a, o);
|
|
599
645
|
}, [
|
|
600
646
|
i,
|
|
601
647
|
e,
|
|
@@ -605,7 +651,7 @@ function J({ value: e, onChange: t, placeholder: n, rows: r = 6, autoGrow: i = !
|
|
|
605
651
|
let e = _.current;
|
|
606
652
|
if (!i || !e || typeof ResizeObserver > "u") return;
|
|
607
653
|
let t = e.clientWidth, n = new ResizeObserver(() => {
|
|
608
|
-
e.clientWidth !== t && (t = e.clientWidth,
|
|
654
|
+
e.clientWidth !== t && (t = e.clientWidth, Y(e, a, o));
|
|
609
655
|
});
|
|
610
656
|
return n.observe(e), () => n.disconnect();
|
|
611
657
|
}, [
|
|
@@ -629,7 +675,7 @@ function J({ value: e, onChange: t, placeholder: n, rows: r = 6, autoGrow: i = !
|
|
|
629
675
|
maxLength: c
|
|
630
676
|
});
|
|
631
677
|
}
|
|
632
|
-
function
|
|
678
|
+
function Z({ onFiles: e, accept: t, multiple: n = !0, disabled: r = !1, label: i = "Anexar arquivo" }) {
|
|
633
679
|
let a = C(null);
|
|
634
680
|
return /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(_, {
|
|
635
681
|
icon: /* @__PURE__ */ E(c, {}),
|
|
@@ -654,7 +700,7 @@ function Y({ onFiles: e, accept: t, multiple: n = !0, disabled: r = !1, label: i
|
|
|
654
700
|
}
|
|
655
701
|
})] });
|
|
656
702
|
}
|
|
657
|
-
function
|
|
703
|
+
function ee({ children: e, note: t }) {
|
|
658
704
|
return /* @__PURE__ */ D("div", {
|
|
659
705
|
className: "select-mailcomposer__attachments",
|
|
660
706
|
role: "list",
|
|
@@ -665,7 +711,7 @@ function X({ children: e, note: t }) {
|
|
|
665
711
|
}) : null]
|
|
666
712
|
});
|
|
667
713
|
}
|
|
668
|
-
function
|
|
714
|
+
function te({ name: e, size: t, state: n = "done", progress: r, error: a, onRemove: o, onRetry: s }) {
|
|
669
715
|
let c = y(e), l = r == null ? null : Math.round(Math.min(1, Math.max(0, r)) * 100), d = n === "uploading" ? l == null ? "Subindo…" : `Subindo… ${l}%` : n === "failed" ? a ?? "Não subiu" : t;
|
|
670
716
|
return /* @__PURE__ */ D("span", {
|
|
671
717
|
className: `select-mailupload select-mailupload--${n}`,
|
|
@@ -828,6 +874,6 @@ function ae({ open: e, onClose: t, activator: n, templates: r, onPick: i, hint:
|
|
|
828
874
|
});
|
|
829
875
|
}
|
|
830
876
|
//#endregion
|
|
831
|
-
export { A as SelectInbox, j as SelectInboxBanner, P as SelectInboxEmpty, M as SelectInboxToolbar,
|
|
877
|
+
export { A as SelectInbox, j as SelectInboxBanner, P as SelectInboxEmpty, M as SelectInboxToolbar, W as SelectLeadChip, Z as SelectMailAttachButton, U as SelectMailAttachment, K as SelectMailComposer, ee as SelectMailComposerAttachments, X as SelectMailComposerBody, ne as SelectMailComposerFooter, J as SelectMailComposerInput, q as SelectMailComposerRow, F as SelectMailList, I as SelectMailListGroup, L as SelectMailListItem, z as SelectMailListNote, R as SelectMailListSkeleton, V as SelectMailMessage, H as SelectMailNotice, B as SelectMailReader, te as SelectMailUpload, N as SelectMailboxStatus, ie as SelectRecipientInput, ae as SelectTemplateMenu, y as attachmentExt, $ as isMailAddress, O as mailName };
|
|
832
878
|
|
|
833
879
|
//# sourceMappingURL=SelectMail.js.map
|
|
@@ -36,6 +36,17 @@ type SelectSegmentedOwnProps = {
|
|
|
36
36
|
* quebram a linha — e, sem `semantics`, a escolha única de um grupo de rádio.
|
|
37
37
|
*/
|
|
38
38
|
variant?: 'track' | 'chips';
|
|
39
|
+
/**
|
|
40
|
+
* 0.1.260, com `chips`: as fichas numa linha só, que rola de lado (a prancha da lista do Chat no celular), no lugar de
|
|
41
|
+
* quebrar a linha. A ficha marcada vem para a vista, e a ponta que esconde fichas some num degradê.
|
|
42
|
+
*/
|
|
43
|
+
scroll?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* 0.1.260, com `chips`: como a ficha marcada se desenha. `outline` (o padrão, a 0.1.258) é o filete e o texto no
|
|
46
|
+
* primário sobre o tom dele; `solid` é a ficha PREENCHIDA no primário, com o texto que lê sobre ele e o número dentro (a
|
|
47
|
+
* prancha da lista do Chat). As outras fichas seguem com o filete.
|
|
48
|
+
*/
|
|
49
|
+
selected?: 'outline' | 'solid';
|
|
39
50
|
};
|
|
40
51
|
export type SelectSegmentedProps = SelectSegmentedOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectSegmentedOwnProps>;
|
|
41
52
|
export declare const SelectSegmented: import('react').ForwardRefExoticComponent<SelectSegmentedOwnProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof SelectSegmentedOwnProps> & import('react').RefAttributes<HTMLDivElement>>;
|