@selectwin/kit 0.1.232 → 0.1.234
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 +69 -58
- package/dist/SelectAppDock.d.ts +57 -0
- package/dist/SelectAppDock.js +182 -0
- package/dist/SelectCardGrid.js +1 -1
- package/dist/SelectDataTable.js +4 -3
- package/dist/SelectLocale.d.ts +5 -0
- package/dist/SelectLocale.js +8 -0
- package/dist/SelectTable.d.ts +1 -17
- package/dist/SelectTable.js +88 -115
- package/dist/SelectTableEmpty.d.ts +18 -0
- package/dist/SelectTableEmpty.js +36 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +153 -151
- package/dist/internal/dockPlacement.d.ts +47 -0
- package/dist/internal/dockPlacement.js +59 -0
- package/dist/style.css +1 -1
- package/package.json +67 -67
package/README.md
CHANGED
|
@@ -1,58 +1,69 @@
|
|
|
1
|
-
# @selectwin/kit
|
|
2
|
-
|
|
3
|
-
Design system da Selectwin — primitivos React, charts SVG (sem dependência de biblioteca de
|
|
4
|
-
gráficos) e tokens CSS, theme-aware (light/dark).
|
|
5
|
-
|
|
6
|
-
Uso interno da Selectwin. Publicado no npm para facilitar a distribuição entre os apps da casa;
|
|
7
|
-
não há suporte, documentação pública nem garantia de estabilidade de API para terceiros.
|
|
8
|
-
|
|
9
|
-
## Uso
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm i @selectwin/kit
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
```tsx
|
|
16
|
-
import '@selectwin/kit/styles.css'; // tokens + estilos (uma vez, no root)
|
|
17
|
-
import { SelectButton, SelectSection } from '@selectwin/kit';
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
Idioma (0.1.187): os textos próprios do kit ("Página anterior", "Mais filtros", "Fechar"…) e os números que ele
|
|
21
|
-
formata saem em português. Para inglês, envolva o app no `SelectLocaleProvider`:
|
|
22
|
-
|
|
23
|
-
```tsx
|
|
24
|
-
import { SelectLocaleProvider } from '@selectwin/kit';
|
|
25
|
-
|
|
26
|
-
<SelectLocaleProvider locale="en">{app}</SelectLocaleProvider>; // 'pt-BR' | 'en'
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
A prop de texto do componente (`confirmLabel`, `noun`…) sempre ganha do dicionário.
|
|
30
|
-
|
|
31
|
-
Tom corporativo (0.1.188; arredondado suave no botão desde a 0.1.192, em tudo desde a 0.1.193 e bem suave desde a
|
|
32
|
-
0.1.195): campo e botão com 1rem (`--select-radius`, `--select-radius-button`), card 1.5rem, caixa de dentro e menu
|
|
33
|
-
1rem, item de menu 0.75rem (`--select-radius-sm`); pílula só em selo. Rótulos de KPI
|
|
34
|
-
e cabeçalho de tabela em caixa-alta espaçada. Nos gráficos, cor é situação: verde `--select-chart-paid` = pago, dourado
|
|
35
|
-
`--select-chart-pending` (+ `-edge`) = pendente, `--select-chart-compare` = o período anterior, e os cinzas
|
|
36
|
-
`--select-chart-ramp-1..4` para categoria. O app que quer o visual antigo sobrescreve esses tokens.
|
|
37
|
-
|
|
38
|
-
O card mostra o dado; a explicação vai no tooltip (0.1.196). O "i" `help` está no `SelectSection`, no
|
|
39
|
-
`SelectDataTable`, no `SelectChartCard`, no `SelectKpiCard`, no `SelectListCard`, em cada número do `SelectMiniStats` e
|
|
40
|
-
em cada balde do `SelectBalanceCard`. Na `SelectShareBar`, cada faixa tem o seu tooltip, e a nota da parte vai em
|
|
41
|
-
`tip`; o que o clique faz vai em `selectHint`/`clearHint`, no lugar da linha `hint`.
|
|
42
|
-
|
|
43
|
-
O tutorial flutuante (0.1.232): o `SelectTutorial` é um cartão no canto de baixo à esquerda (o direito é do
|
|
44
|
-
`SelectAssistant`) que abre um vídeo curto, sempre no tema OPOSTO ao do painel, para se destacar — os tokens
|
|
45
|
-
`--select-tutorial-*`, invertidos no bloco do escuro. O vídeo expande para o centro da tela sem recomeçar, e o selo
|
|
46
|
-
"Visto" acende sozinho quando ele termina (`watched` manda, quando vem). Abrir, fechar de vez (`onDismiss`) e guardar o
|
|
47
|
-
que foi visto são de quem usa.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
1
|
+
# @selectwin/kit
|
|
2
|
+
|
|
3
|
+
Design system da Selectwin — primitivos React, charts SVG (sem dependência de biblioteca de
|
|
4
|
+
gráficos) e tokens CSS, theme-aware (light/dark).
|
|
5
|
+
|
|
6
|
+
Uso interno da Selectwin. Publicado no npm para facilitar a distribuição entre os apps da casa;
|
|
7
|
+
não há suporte, documentação pública nem garantia de estabilidade de API para terceiros.
|
|
8
|
+
|
|
9
|
+
## Uso
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm i @selectwin/kit
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import '@selectwin/kit/styles.css'; // tokens + estilos (uma vez, no root)
|
|
17
|
+
import { SelectButton, SelectSection } from '@selectwin/kit';
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Idioma (0.1.187): os textos próprios do kit ("Página anterior", "Mais filtros", "Fechar"…) e os números que ele
|
|
21
|
+
formata saem em português. Para inglês, envolva o app no `SelectLocaleProvider`:
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import { SelectLocaleProvider } from '@selectwin/kit';
|
|
25
|
+
|
|
26
|
+
<SelectLocaleProvider locale="en">{app}</SelectLocaleProvider>; // 'pt-BR' | 'en'
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
A prop de texto do componente (`confirmLabel`, `noun`…) sempre ganha do dicionário.
|
|
30
|
+
|
|
31
|
+
Tom corporativo (0.1.188; arredondado suave no botão desde a 0.1.192, em tudo desde a 0.1.193 e bem suave desde a
|
|
32
|
+
0.1.195): campo e botão com 1rem (`--select-radius`, `--select-radius-button`), card 1.5rem, caixa de dentro e menu
|
|
33
|
+
1rem, item de menu 0.75rem (`--select-radius-sm`); pílula só em selo. Rótulos de KPI
|
|
34
|
+
e cabeçalho de tabela em caixa-alta espaçada. Nos gráficos, cor é situação: verde `--select-chart-paid` = pago, dourado
|
|
35
|
+
`--select-chart-pending` (+ `-edge`) = pendente, `--select-chart-compare` = o período anterior, e os cinzas
|
|
36
|
+
`--select-chart-ramp-1..4` para categoria. O app que quer o visual antigo sobrescreve esses tokens.
|
|
37
|
+
|
|
38
|
+
O card mostra o dado; a explicação vai no tooltip (0.1.196). O "i" `help` está no `SelectSection`, no
|
|
39
|
+
`SelectDataTable`, no `SelectChartCard`, no `SelectKpiCard`, no `SelectListCard`, em cada número do `SelectMiniStats` e
|
|
40
|
+
em cada balde do `SelectBalanceCard`. Na `SelectShareBar`, cada faixa tem o seu tooltip, e a nota da parte vai em
|
|
41
|
+
`tip`; o que o clique faz vai em `selectHint`/`clearHint`, no lugar da linha `hint`.
|
|
42
|
+
|
|
43
|
+
O tutorial flutuante (0.1.232): o `SelectTutorial` é um cartão no canto de baixo à esquerda (o direito é do
|
|
44
|
+
`SelectAssistant`) que abre um vídeo curto, sempre no tema OPOSTO ao do painel, para se destacar — os tokens
|
|
45
|
+
`--select-tutorial-*`, invertidos no bloco do escuro. O vídeo expande para o centro da tela sem recomeçar, e o selo
|
|
46
|
+
"Visto" acende sozinho quando ele termina (`watched` manda, quando vem). Abrir, fechar de vez (`onDismiss`) e guardar o
|
|
47
|
+
que foi visto são de quem usa.
|
|
48
|
+
|
|
49
|
+
A dock da moldura (0.1.233): o `SelectAppDock`, com o `SelectAppDockItem` e o `SelectAppDockSeparator`, é a barra de baixo
|
|
50
|
+
do painel, a `AppDock` que o dashboard-web desenhou. O padrão é a aba que sobe da borda de baixo do painel;
|
|
51
|
+
`variant="floating"` a solta da borda, e `draggable` deixa o usuário levá-la para onde quiser dentro do palco (o ancestral
|
|
52
|
+
posicionado). Ela gruda no centro e nas bordas, a alça anda pelo teclado (as setas, e Home volta) e dois cliques a
|
|
53
|
+
devolvem ao centro de baixo. No celular, ela fica parada embaixo. A posição vem em frações do palco (`null` é a casa), e
|
|
54
|
+
guardar é de quem usa (`position` + `onPositionChange`). Cada item é o alvo inteiro, ícone e nome (`labels` mostra o nome
|
|
55
|
+
embaixo). O item aceso usa `--select-appdock-active` e `--select-appdock-active-ink`, que o app troca pela cor dele.
|
|
56
|
+
|
|
57
|
+
Peer deps: **react**, **react-dom** (obrigatórios); **gsap** (opcional — só componentes animados),
|
|
58
|
+
**react-router-dom** (opcional). Tematização = sobrescrever os tokens CSS `--select-*` / `--sw-*`.
|
|
59
|
+
|
|
60
|
+
O vazio das listas tem módulo próprio (0.1.234): o `SelectTableEmpty` só depende do React, e a `SelectCardGrid` não
|
|
61
|
+
leva mais a tabela nem o GSAP. O teste `SelectTableEmpty.test.ts` trava esse grafo de imports.
|
|
62
|
+
|
|
63
|
+
## Build
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
npm run build # → dist/index.js (o barril) + um módulo ESM por componente + dist/style.css + os .d.ts
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
`npm publish` roda `prepublishOnly` (= build) e publica só `dist/` (sem sourcemaps).
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, MouseEvent, ReactNode } from 'react';
|
|
2
|
+
import { SelectKitMessages } from './SelectLocale';
|
|
3
|
+
import { DockSpot } from './internal/dockPlacement';
|
|
4
|
+
/** A posição da dock solta: `x` e `y` de 0 a 1 dentro do espaço livre do palco. `null` = a casa (o centro de baixo). */
|
|
5
|
+
export type SelectAppDockPosition = DockSpot;
|
|
6
|
+
export interface SelectAppDockProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
7
|
+
/** O nome da navegação para o leitor de tela ("Navegação principal", "Barra de apps"). */
|
|
8
|
+
label: string;
|
|
9
|
+
/** O nome embaixo de cada ícone. Sem ele, o nome fica na dica. */
|
|
10
|
+
labels?: boolean;
|
|
11
|
+
/** `tab` (padrão): a aba que sobe da borda de baixo do painel. `floating`: solta, a um respiro das bordas. */
|
|
12
|
+
variant?: 'tab' | 'floating';
|
|
13
|
+
/** Só na `floating`: o usuário leva a dock para onde quiser no palco. No celular, ela fica parada embaixo. */
|
|
14
|
+
draggable?: boolean;
|
|
15
|
+
/** A posição (controlada). `null` = a casa. Só vale com `draggable`. */
|
|
16
|
+
position?: SelectAppDockPosition | null;
|
|
17
|
+
/** A posição inicial, quando a dock guarda sozinha. */
|
|
18
|
+
defaultPosition?: SelectAppDockPosition | null;
|
|
19
|
+
/** A dock foi solta num lugar novo (ou voltou para casa: `null`). Guardar é de quem usa. */
|
|
20
|
+
onPositionChange?: (position: SelectAppDockPosition | null) => void;
|
|
21
|
+
/** Os textos, por cima dos do kit (`appFrame.dock`). */
|
|
22
|
+
messages?: Partial<SelectKitMessages['appFrame']['dock']>;
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export declare function SelectAppDock({ label, labels, variant, draggable, position, defaultPosition, onPositionChange, messages, className, style, children, onPointerDown, onPointerMove, onPointerUp, onPointerCancel, ...rest }: SelectAppDockProps): import("react").JSX.Element;
|
|
26
|
+
export interface SelectAppDockItemProps {
|
|
27
|
+
/** O nome: embaixo do ícone (com `labels`), na dica e para o leitor de tela. */
|
|
28
|
+
label: string;
|
|
29
|
+
/** O que vai no botão redondo: o glifo, ou uma peça própria (a capa da aula com o anel do progresso). */
|
|
30
|
+
icon?: ReactNode;
|
|
31
|
+
/** Um link do roteador. */
|
|
32
|
+
to?: string;
|
|
33
|
+
/** Um link comum (passa pelo filtro de endereço do kit). */
|
|
34
|
+
href?: string;
|
|
35
|
+
/** Sem `to` nem `href`, o item é um botão. */
|
|
36
|
+
onClick?: (event: MouseEvent<HTMLElement>) => void;
|
|
37
|
+
/** A página em que o usuário está: o item acende (e é o `aria-current`). */
|
|
38
|
+
active?: boolean;
|
|
39
|
+
/** Um painel aberto por este item: o botão fica aceso e a dica sai (ela ficaria por cima do painel). */
|
|
40
|
+
open?: boolean;
|
|
41
|
+
/** A dica, quando ela diz mais que o nome ("Continuar: Aula 3"). Com uma dica própria, ela aparece também com os nomes à mostra. */
|
|
42
|
+
tip?: ReactNode;
|
|
43
|
+
/** Só num tamanho: `phone` (até 768 px) ou `desktop`. */
|
|
44
|
+
only?: 'phone' | 'desktop';
|
|
45
|
+
/** O nome para o leitor de tela, quando ele diz mais que o `label` ("Continuar: Aula 3, 40% assistido"). */
|
|
46
|
+
'aria-label'?: string;
|
|
47
|
+
/** Num item que abre um painel. */
|
|
48
|
+
'aria-haspopup'?: 'menu' | 'dialog' | 'listbox' | true;
|
|
49
|
+
'aria-expanded'?: boolean;
|
|
50
|
+
className?: string;
|
|
51
|
+
}
|
|
52
|
+
/** Um item da dock: o alvo inteiro é o botão redondo + o nome. */
|
|
53
|
+
export declare function SelectAppDockItem({ label, icon, to, href, onClick, active, open, tip, only, className, ...aria }: SelectAppDockItemProps): import("react").JSX.Element;
|
|
54
|
+
/** O traço entre grupos de itens. */
|
|
55
|
+
export declare function SelectAppDockSeparator({ only }: {
|
|
56
|
+
only?: 'phone' | 'desktop';
|
|
57
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { safeHref as e } from "./internal/safeHref.js";
|
|
2
|
+
import { GripIcon as t } from "./icons.js";
|
|
3
|
+
import { useSelectMessages as n } from "./SelectLocale.js";
|
|
4
|
+
import { useMatchMedia as r } from "./internal/useMatchMedia.js";
|
|
5
|
+
import { dockIsHigh as i, dockPointOf as a, dockSpotOf as o, nudgeDock as s, snapDockPoint as c } from "./internal/dockPlacement.js";
|
|
6
|
+
import { useCallback as l, useEffect as u, useId as d, useLayoutEffect as f, useRef as p, useState as m } from "react";
|
|
7
|
+
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
8
|
+
import { Link as v } from "react-router-dom";
|
|
9
|
+
//#region src/SelectAppDock.tsx
|
|
10
|
+
var y = (...e) => e.filter(Boolean).join(" "), ee = "(max-width: 48em)", te = 4, ne = 450, b = 350;
|
|
11
|
+
function x(e) {
|
|
12
|
+
let t = getComputedStyle(e).getPropertyValue("--select-appdock-inset").trim(), n = parseFloat(t);
|
|
13
|
+
return Number.isFinite(n) ? t.endsWith("rem") ? n * parseFloat(getComputedStyle(document.documentElement).fontSize || "16") : t.endsWith("em") ? n * parseFloat(getComputedStyle(e).fontSize || "16") : n : 0;
|
|
14
|
+
}
|
|
15
|
+
function re(e, t) {
|
|
16
|
+
return {
|
|
17
|
+
cw: t.clientWidth,
|
|
18
|
+
ch: t.clientHeight,
|
|
19
|
+
dw: e.offsetWidth,
|
|
20
|
+
dh: e.offsetHeight,
|
|
21
|
+
inset: x(e)
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
var S = (e, t) => !!e && e.cw === t.cw && e.ch === t.ch && e.dw === t.dw && e.dh === t.dh && e.inset === t.inset;
|
|
25
|
+
function C({ label: e, labels: v = !1, variant: x = "tab", draggable: C = !1, position: w, defaultPosition: T = null, onPositionChange: E, messages: ie, className: ae, style: D, children: oe, onPointerDown: O, onPointerMove: k, onPointerUp: A, onPointerCancel: j, ...se }) {
|
|
26
|
+
let M = {
|
|
27
|
+
...n().appFrame.dock,
|
|
28
|
+
...ie
|
|
29
|
+
}, ce = r(ee), N = x === "floating" && C && !ce, [P, le] = m(T), F = w !== void 0, I = N ? F ? w : P : null, L = p(null), [R, z] = m(null), [B, V] = m(null), [H, U] = m(!1), W = p(null), G = p(0), K = p(void 0), q = d();
|
|
30
|
+
f(() => {
|
|
31
|
+
let e = L.current, t = e == null ? void 0 : e.offsetParent;
|
|
32
|
+
if (!N || !e || !t) {
|
|
33
|
+
z(null);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
let n = () => {
|
|
37
|
+
let n = re(e, t);
|
|
38
|
+
z((e) => S(e, n) ? e : n);
|
|
39
|
+
};
|
|
40
|
+
if (n(), typeof ResizeObserver > "u") return;
|
|
41
|
+
let r = new ResizeObserver(n);
|
|
42
|
+
return r.observe(t), r.observe(e), () => r.disconnect();
|
|
43
|
+
}, [N]), u(() => () => clearTimeout(K.current), []);
|
|
44
|
+
let J = l((e, t) => {
|
|
45
|
+
t && (U(!0), clearTimeout(K.current), K.current = setTimeout(() => U(!1), ne)), F || le(e), E == null || E(e);
|
|
46
|
+
}, [F, E]), Y = N && R !== null, X = Y ? B ?? a(I, R) : null, Z = Y ? a(null, R) : null, ue = (e) => {
|
|
47
|
+
var t, n;
|
|
48
|
+
if (O == null || O(e), !Y || e.button !== 0 || e.defaultPrevented) return;
|
|
49
|
+
let r = e.target;
|
|
50
|
+
(r.closest(".select-appdock__grip") || !r.closest("a, button, input, select, textarea, [role=\"button\"]")) && (W.current = {
|
|
51
|
+
pointer: e.pointerId,
|
|
52
|
+
x: e.clientX,
|
|
53
|
+
y: e.clientY,
|
|
54
|
+
from: a(I, R),
|
|
55
|
+
at: null
|
|
56
|
+
}, (t = (n = e.currentTarget).setPointerCapture) == null || t.call(n, e.pointerId));
|
|
57
|
+
}, de = (e) => {
|
|
58
|
+
k == null || k(e);
|
|
59
|
+
let t = W.current;
|
|
60
|
+
if (!t || t.pointer !== e.pointerId || !R) return;
|
|
61
|
+
let n = e.clientX - t.x, r = e.clientY - t.y;
|
|
62
|
+
!t.at && Math.hypot(n, r) < te || (t.at = c({
|
|
63
|
+
left: t.from.left + n,
|
|
64
|
+
top: t.from.top + r
|
|
65
|
+
}, R), V(t.at));
|
|
66
|
+
}, Q = (e, t) => {
|
|
67
|
+
var n, r;
|
|
68
|
+
let i = W.current;
|
|
69
|
+
if (!i || i.pointer !== e.pointerId || (W.current = null, (n = (r = e.currentTarget).hasPointerCapture) != null && n.call(r, e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId), V(null), t || !R)) return;
|
|
70
|
+
if (i.at) {
|
|
71
|
+
G.current = 0, J(o(i.at, R), !1);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
let a = e.timeStamp;
|
|
75
|
+
G.current && a - G.current <= b ? (G.current = 0, J(null, !0)) : G.current = a;
|
|
76
|
+
}, fe = (e) => {
|
|
77
|
+
if (!R) return;
|
|
78
|
+
if (e.key === "Home") {
|
|
79
|
+
e.preventDefault(), J(null, !0);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
let t = e.shiftKey ? 96 : 24, n = {
|
|
83
|
+
ArrowLeft: [-t, 0],
|
|
84
|
+
ArrowRight: [t, 0],
|
|
85
|
+
ArrowUp: [0, -t],
|
|
86
|
+
ArrowDown: [0, t]
|
|
87
|
+
}[e.key];
|
|
88
|
+
n && (e.preventDefault(), J(s(I, n[0], n[1], R), !0));
|
|
89
|
+
}, $ = B !== null, pe = !!X && !!Z && Math.abs(X.left - Z.left) < .5 && Math.abs(X.top - Z.top) < .5, me = X ? {
|
|
90
|
+
...D,
|
|
91
|
+
left: X.left,
|
|
92
|
+
top: X.top
|
|
93
|
+
} : D;
|
|
94
|
+
return /* @__PURE__ */ _(h, { children: [$ && Z && R && /* @__PURE__ */ g("span", {
|
|
95
|
+
className: y("select-appdock__home", pe && "is-near"),
|
|
96
|
+
style: {
|
|
97
|
+
left: Z.left,
|
|
98
|
+
top: Z.top,
|
|
99
|
+
width: R.dw,
|
|
100
|
+
height: R.dh
|
|
101
|
+
},
|
|
102
|
+
"aria-hidden": "true"
|
|
103
|
+
}), /* @__PURE__ */ _("div", {
|
|
104
|
+
...se,
|
|
105
|
+
ref: L,
|
|
106
|
+
className: y("select-appdock", `select-appdock--${x}`, v && "is-labeled", N && "is-movable", Y && "is-placed", $ && "is-dragging", H && "is-settling", i(I) && "is-high", ae),
|
|
107
|
+
style: me,
|
|
108
|
+
onPointerDown: ue,
|
|
109
|
+
onPointerMove: de,
|
|
110
|
+
onPointerUp: (e) => {
|
|
111
|
+
A == null || A(e), Q(e, !1);
|
|
112
|
+
},
|
|
113
|
+
onPointerCancel: (e) => {
|
|
114
|
+
j == null || j(e), Q(e, !0);
|
|
115
|
+
},
|
|
116
|
+
children: [N && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("button", {
|
|
117
|
+
type: "button",
|
|
118
|
+
className: "select-appdock__grip",
|
|
119
|
+
"aria-label": M.move,
|
|
120
|
+
"aria-describedby": q,
|
|
121
|
+
onKeyDown: fe,
|
|
122
|
+
children: /* @__PURE__ */ g(t, {})
|
|
123
|
+
}), /* @__PURE__ */ g("span", {
|
|
124
|
+
id: q,
|
|
125
|
+
hidden: !0,
|
|
126
|
+
children: M.moveHint
|
|
127
|
+
})] }), /* @__PURE__ */ g("nav", {
|
|
128
|
+
className: "select-appdock__row",
|
|
129
|
+
"aria-label": e,
|
|
130
|
+
children: oe
|
|
131
|
+
})]
|
|
132
|
+
})] });
|
|
133
|
+
}
|
|
134
|
+
function w({ label: t, icon: n, to: r, href: i, onClick: a, active: o = !1, open: s = !1, tip: c, only: l, className: u, ...d }) {
|
|
135
|
+
let f = y("select-appdock__item", l && `select-appdock__item--${l}`, o && "is-current", s && "is-open", c !== void 0 && "has-tip", u), p = /* @__PURE__ */ _(h, { children: [
|
|
136
|
+
/* @__PURE__ */ g("span", {
|
|
137
|
+
className: "select-appdock__btn",
|
|
138
|
+
"aria-hidden": "true",
|
|
139
|
+
children: n
|
|
140
|
+
}),
|
|
141
|
+
/* @__PURE__ */ g("span", {
|
|
142
|
+
className: "select-appdock__cap",
|
|
143
|
+
children: t
|
|
144
|
+
}),
|
|
145
|
+
/* @__PURE__ */ g("span", {
|
|
146
|
+
className: "select-appdock__tip",
|
|
147
|
+
"aria-hidden": "true",
|
|
148
|
+
children: c ?? t
|
|
149
|
+
})
|
|
150
|
+
] }), m = o ? "page" : void 0;
|
|
151
|
+
return r === void 0 ? i === void 0 ? /* @__PURE__ */ g("button", {
|
|
152
|
+
type: "button",
|
|
153
|
+
className: f,
|
|
154
|
+
onClick: a,
|
|
155
|
+
...d,
|
|
156
|
+
children: p
|
|
157
|
+
}) : /* @__PURE__ */ g("a", {
|
|
158
|
+
href: e(i),
|
|
159
|
+
className: f,
|
|
160
|
+
"aria-current": m,
|
|
161
|
+
onClick: a,
|
|
162
|
+
...d,
|
|
163
|
+
children: p
|
|
164
|
+
}) : /* @__PURE__ */ g(v, {
|
|
165
|
+
to: r,
|
|
166
|
+
className: f,
|
|
167
|
+
"aria-current": m,
|
|
168
|
+
onClick: a,
|
|
169
|
+
...d,
|
|
170
|
+
children: p
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
function T({ only: e }) {
|
|
174
|
+
return /* @__PURE__ */ g("span", {
|
|
175
|
+
className: y("select-appdock__sep", e && `select-appdock__sep--${e}`),
|
|
176
|
+
"aria-hidden": "true"
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
//#endregion
|
|
180
|
+
export { C as SelectAppDock, w as SelectAppDockItem, T as SelectAppDockSeparator };
|
|
181
|
+
|
|
182
|
+
//# sourceMappingURL=SelectAppDock.js.map
|
package/dist/SelectCardGrid.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SelectListChrome as e, SelectListFooter as t, listChromeShape as n } from "./internal/listChrome.js";
|
|
2
|
-
import { SelectTableEmpty as r } from "./
|
|
2
|
+
import { SelectTableEmpty as r } from "./SelectTableEmpty.js";
|
|
3
3
|
import { SelectAddCard as i } from "./SelectAddCard.js";
|
|
4
4
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
5
|
//#region src/SelectCardGrid.tsx
|
package/dist/SelectDataTable.js
CHANGED
|
@@ -4,7 +4,8 @@ import { useMatchMedia as a } from "./internal/useMatchMedia.js";
|
|
|
4
4
|
import { SelectPopover as ee } from "./SelectPopover.js";
|
|
5
5
|
import { SelectIconButton as o } from "./SelectIconButton.js";
|
|
6
6
|
import { SelectListFooter as te } from "./internal/listChrome.js";
|
|
7
|
-
import {
|
|
7
|
+
import { SelectTableEmpty as ne } from "./SelectTableEmpty.js";
|
|
8
|
+
import { SelectTable as re, SelectTableCell as s, SelectTableRow as c } from "./SelectTable.js";
|
|
8
9
|
import { useMemo as l, useState as u } from "react";
|
|
9
10
|
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
10
11
|
//#region src/SelectDataTable.tsx
|
|
@@ -124,7 +125,7 @@ function C({ columns: p = [], items: m, getId: g, loading: y = !1, empty: x, pag
|
|
|
124
125
|
});
|
|
125
126
|
}, we = () => {
|
|
126
127
|
H({}), T && b(T, {});
|
|
127
|
-
}, Te = Object.keys(V).length > 0, Ee = !y && x ? /* @__PURE__ */ d(
|
|
128
|
+
}, Te = Object.keys(V).length > 0, Ee = !y && x ? /* @__PURE__ */ d(ne, {
|
|
128
129
|
icon: x.icon,
|
|
129
130
|
title: x.heading,
|
|
130
131
|
subtitle: x.text,
|
|
@@ -180,7 +181,7 @@ function C({ columns: p = [], items: m, getId: g, loading: y = !1, empty: x, pag
|
|
|
180
181
|
}) : null;
|
|
181
182
|
return /* @__PURE__ */ f("div", {
|
|
182
183
|
className: `select-datatable${M ? " select-datatable--flush" : ""}`,
|
|
183
|
-
children: [/* @__PURE__ */ d(
|
|
184
|
+
children: [/* @__PURE__ */ d(re, {
|
|
184
185
|
columns: Ce,
|
|
185
186
|
empty: Ee,
|
|
186
187
|
footer: j,
|
package/dist/SelectLocale.d.ts
CHANGED
|
@@ -174,6 +174,11 @@ export interface SelectKitMessages {
|
|
|
174
174
|
close: string;
|
|
175
175
|
};
|
|
176
176
|
};
|
|
177
|
+
/** 0.1.233: a dock (SelectAppDock): a alça da dock solta e o que ela faz. */
|
|
178
|
+
dock: {
|
|
179
|
+
move: string;
|
|
180
|
+
moveHint: string;
|
|
181
|
+
};
|
|
177
182
|
};
|
|
178
183
|
}
|
|
179
184
|
/** Os dicionários do kit, para quem quer conferir ou montar um texto do mesmo jeito. */
|
package/dist/SelectLocale.js
CHANGED
|
@@ -170,6 +170,10 @@ var r = {
|
|
|
170
170
|
open: "abrir",
|
|
171
171
|
close: "fechar"
|
|
172
172
|
}
|
|
173
|
+
},
|
|
174
|
+
dock: {
|
|
175
|
+
move: "Mover a barra",
|
|
176
|
+
moveHint: "Arraste para levar a barra a outro lugar, ou use as setas. Home ou dois cliques a devolvem ao centro de baixo."
|
|
173
177
|
}
|
|
174
178
|
}
|
|
175
179
|
},
|
|
@@ -342,6 +346,10 @@ var r = {
|
|
|
342
346
|
open: "open",
|
|
343
347
|
close: "close"
|
|
344
348
|
}
|
|
349
|
+
},
|
|
350
|
+
dock: {
|
|
351
|
+
move: "Move the bar",
|
|
352
|
+
moveHint: "Drag to move the bar, or use the arrow keys. Home or a double click puts it back at the bottom centre."
|
|
345
353
|
}
|
|
346
354
|
}
|
|
347
355
|
}
|
package/dist/SelectTable.d.ts
CHANGED
|
@@ -150,20 +150,4 @@ type SelectTableCellOwnProps = {
|
|
|
150
150
|
};
|
|
151
151
|
export type SelectTableCellProps = SelectTableCellOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectTableCellOwnProps>;
|
|
152
152
|
export declare const SelectTableCell: import('react').ForwardRefExoticComponent<SelectTableCellOwnProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof SelectTableCellOwnProps> & import('react').RefAttributes<HTMLDivElement>>;
|
|
153
|
-
type
|
|
154
|
-
icon?: ReactNode;
|
|
155
|
-
title: ReactNode;
|
|
156
|
-
subtitle?: ReactNode;
|
|
157
|
-
/** Optional CTA below the text (e.g. "Enable Billing") — for standalone empty cards. Várias ações ficam lado a lado. */
|
|
158
|
-
action?: ReactNode;
|
|
159
|
-
/** 0.1.207: o vazio que é um ERRO (a lista não carregou): o ícone no tom crítico. O `role="alert"` é de quem usa. */
|
|
160
|
-
tone?: 'critical';
|
|
161
|
-
/**
|
|
162
|
-
* 0.1.208: a altura mínima, com o texto centrado nela — o vazio que fica no LUGAR de um gráfico ocupa a altura do
|
|
163
|
-
* gráfico, e o cartão não encolhe quando o período não tem dado. Um comprimento CSS (`'11.25rem'`).
|
|
164
|
-
*/
|
|
165
|
-
minHeight?: string;
|
|
166
|
-
};
|
|
167
|
-
export type SelectTableEmptyProps = SelectTableEmptyOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectTableEmptyOwnProps>;
|
|
168
|
-
export declare const SelectTableEmpty: import('react').ForwardRefExoticComponent<SelectTableEmptyOwnProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof SelectTableEmptyOwnProps> & import('react').RefAttributes<HTMLDivElement>>;
|
|
169
|
-
export {};
|
|
153
|
+
export { SelectTableEmpty, type SelectTableEmptyProps } from './SelectTableEmpty';
|