@juninmd/sonido 1.0.1 → 1.1.0
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 +2 -2
- package/dist/components/BlackHole/BlackHole.d.ts +19 -0
- package/dist/components/BlackHole/index.d.ts +1 -0
- package/dist/components/ScanProgress/ScanProgress.d.ts +29 -0
- package/dist/components/ScanProgress/index.d.ts +1 -0
- package/dist/components/Sunburst/Sunburst.d.ts +18 -0
- package/dist/components/Sunburst/index.d.ts +1 -0
- package/dist/components/Tray/Tray.d.ts +32 -0
- package/dist/components/Tray/index.d.ts +1 -0
- package/dist/components/Treemap/Treemap.d.ts +23 -0
- package/dist/components/Treemap/index.d.ts +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +1650 -1063
- package/dist/index.js.map +1 -1
- package/dist/sonido.css +1 -1
- package/dist/utils/ease.d.ts +4 -0
- package/dist/utils/flyTo.d.ts +15 -0
- package/dist/utils/format.d.ts +12 -0
- package/dist/utils/squarify.d.ts +9 -0
- package/dist/utils/tree.d.ts +28 -0
- package/dist/utils/useMotionPref.d.ts +18 -0
- package/dist/utils/useSize.d.ts +6 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ Escuro por padrão, vidro sobre um fundo atmosférico, cor com função e movime
|
|
|
23
23
|
|
|
24
24
|
| | |
|
|
25
25
|
| --------------------------- | ------------------------------------------------------------------------------------------------- |
|
|
26
|
-
| 🧩 **
|
|
26
|
+
| 🧩 **83 componentes** | De botão a céu animado do clima, todos com tipos, teclado e ARIA. |
|
|
27
27
|
| 🎨 **8 temas** | Troque com um atributo: `data-theme="hueco-mundo"`. Tokens `--sn-*` em CSS e em JS. |
|
|
28
28
|
| ✨ **Movimento com motivo** | Mola tátil, confete, cenas em canvas. Tudo desliga com `prefers-reduced-motion`. |
|
|
29
29
|
| ♿ **Acessível** | Contraste AA nos 8 temas, auditado com axe. Alvos de 44px e foco visível. |
|
|
@@ -139,7 +139,7 @@ Os testes montam **todos os exemplos da documentação**, então o código que v
|
|
|
139
139
|
Em `.claude/skills/` há três skills para o Claude Code:
|
|
140
140
|
|
|
141
141
|
- **sonido-audit**: roda `npm run audit:ds`, lint, tipos e testes e corrige o que falhar.
|
|
142
|
-
- **sonido-a11y**: axe-core nos
|
|
142
|
+
- **sonido-a11y**: axe-core nos exemplos em todos os temas.
|
|
143
143
|
- **sonido-component**: passo a passo para criar ou portar um componente.
|
|
144
144
|
|
|
145
145
|
## Releases
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import "./BlackHole.css";
|
|
2
|
+
export interface BlackHoleProps {
|
|
3
|
+
/** Quanto saiu. null enquanto a remoção roda: o buraco gira rápido. */
|
|
4
|
+
freed: number | null;
|
|
5
|
+
/** Rótulo acima do número. */
|
|
6
|
+
label?: string;
|
|
7
|
+
/** Formata o total (padrão: bytes). */
|
|
8
|
+
formatValue?: (value: number) => string;
|
|
9
|
+
/** Altura em px. */
|
|
10
|
+
height?: number;
|
|
11
|
+
/** Duração da contagem final em ms. */
|
|
12
|
+
duration?: number;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Buraco negro em canvas (faxina): partículas caem em espiral enquanto algo é apagado e o total
|
|
17
|
+
* conta até o valor final. Sem animação mostra um quadro parado e o número direto.
|
|
18
|
+
*/
|
|
19
|
+
export declare function BlackHole({ freed, label, formatValue, height, duration, className, }: BlackHoleProps): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./BlackHole";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import "./ScanProgress.css";
|
|
2
|
+
export type ScanState = "running" | "stopping" | "done" | "cancelled";
|
|
3
|
+
export interface ScanProgressProps {
|
|
4
|
+
/** Itens vistos até agora. */
|
|
5
|
+
count: number;
|
|
6
|
+
/** Segundos desde o início. */
|
|
7
|
+
elapsed: number;
|
|
8
|
+
/** Itens por segundo; sem ele usa count / elapsed. */
|
|
9
|
+
rate?: number;
|
|
10
|
+
/** Item atual (caminho, URL...). */
|
|
11
|
+
current?: string;
|
|
12
|
+
state?: ScanState;
|
|
13
|
+
/** Mostra o botão de cancelar enquanto roda. */
|
|
14
|
+
onCancel?: () => void;
|
|
15
|
+
/** Mostra o botão de recomeçar quando termina ou é cancelado. */
|
|
16
|
+
onRestart?: () => void;
|
|
17
|
+
/** Nomes das três medidas. */
|
|
18
|
+
labels?: {
|
|
19
|
+
count?: string;
|
|
20
|
+
rate?: string;
|
|
21
|
+
elapsed?: string;
|
|
22
|
+
};
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Números ao vivo de uma tarefa longa (faxina): quantos itens, ritmo e tempo, com o item atual.
|
|
27
|
+
* "stopping" cobre o intervalo entre o clique em cancelar e a parada real.
|
|
28
|
+
*/
|
|
29
|
+
export declare function ScanProgress({ count, elapsed, rate, current, state, onCancel, onRestart, labels, className, }: ScanProgressProps): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ScanProgress";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type TreeNode } from "../../utils/tree";
|
|
2
|
+
import "./Sunburst.css";
|
|
3
|
+
export interface SunburstProps {
|
|
4
|
+
data: TreeNode;
|
|
5
|
+
/** Nome acessível do gráfico. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Diâmetro máximo em px. */
|
|
8
|
+
size?: number;
|
|
9
|
+
/** Quantos anéis desenhar abaixo do nó aberto. */
|
|
10
|
+
depth?: number;
|
|
11
|
+
/** Formata o valor do centro e das dicas (padrão: bytes). */
|
|
12
|
+
formatValue?: (value: number) => string;
|
|
13
|
+
/** Chamado ao entrar num anel. */
|
|
14
|
+
onOpen?: (node: TreeNode) => void;
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
/** Anéis hierárquicos (faxina): clique num anel para entrar e no centro para voltar. */
|
|
18
|
+
export declare function Sunburst({ data, label, size, depth, formatValue, onOpen, className, }: SunburstProps): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Sunburst";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import "./Tray.css";
|
|
3
|
+
export interface TrayItem {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
value: number;
|
|
7
|
+
/** Cor CSS da marca do item. */
|
|
8
|
+
color?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface TrayProps {
|
|
11
|
+
items: TrayItem[];
|
|
12
|
+
/** Título acima do total. */
|
|
13
|
+
title?: string;
|
|
14
|
+
/** Formata valores e total (padrão: bytes). */
|
|
15
|
+
formatValue?: (value: number) => string;
|
|
16
|
+
/** Tira um item da bandeja. */
|
|
17
|
+
onRemove?: (id: string) => void;
|
|
18
|
+
/** Ação única para tudo o que está na bandeja. */
|
|
19
|
+
onConfirm?: () => void;
|
|
20
|
+
/** Texto do botão; recebe a quantidade. */
|
|
21
|
+
confirmLabel?: (count: number) => string;
|
|
22
|
+
/** Texto quando a bandeja está vazia. */
|
|
23
|
+
empty?: ReactNode;
|
|
24
|
+
/** Tom do botão de confirmar. */
|
|
25
|
+
tone?: "danger" | "accent";
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Bandeja (faxina "Órbita"): junta itens marcados em qualquer lugar da tela, mostra o total e
|
|
30
|
+
* confirma tudo com um botão só. É alvo do `flyTo()` e pulsa quando chega item novo.
|
|
31
|
+
*/
|
|
32
|
+
export declare function Tray({ items, title, formatValue, onRemove, onConfirm, confirmLabel, empty, tone, className, }: TrayProps): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Tray";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type TreeNode } from "../../utils/tree";
|
|
2
|
+
import "./Treemap.css";
|
|
3
|
+
export interface TreemapProps {
|
|
4
|
+
data: TreeNode;
|
|
5
|
+
/** Nome acessível do mapa. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Altura em px. */
|
|
8
|
+
height?: number;
|
|
9
|
+
/** Formata o valor de cada bloco (padrão: bytes). */
|
|
10
|
+
formatValue?: (value: number) => string;
|
|
11
|
+
/** Chamado ao abrir uma pasta (navegação). */
|
|
12
|
+
onOpen?: (node: TreeNode) => void;
|
|
13
|
+
/** Chamado ao clicar numa folha (sem filhos). */
|
|
14
|
+
onSelect?: (node: TreeNode) => void;
|
|
15
|
+
/** Mostra o caminho com links para voltar. */
|
|
16
|
+
breadcrumb?: boolean;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Mapa de blocos proporcional ao tamanho (faxina). Clique abre a pasta; setas movem o foco
|
|
21
|
+
* para o vizinho na direção, Enter abre e Backspace volta. Passar o mouse acende o caminho.
|
|
22
|
+
*/
|
|
23
|
+
export declare function Treemap({ data, label, height, formatValue, onOpen, onSelect, breadcrumb, className, }: TreemapProps): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Treemap";
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export * from "./components/Badge";
|
|
|
12
12
|
export * from "./components/BarChart";
|
|
13
13
|
export * from "./components/BatteryMeter";
|
|
14
14
|
export * from "./components/Bento";
|
|
15
|
+
export * from "./components/BlackHole";
|
|
15
16
|
export * from "./components/Breadcrumb";
|
|
16
17
|
export * from "./components/Button";
|
|
17
18
|
export * from "./components/Card";
|
|
@@ -49,6 +50,7 @@ export * from "./components/RadioGroup";
|
|
|
49
50
|
export * from "./components/Rating";
|
|
50
51
|
export * from "./components/RouteMap";
|
|
51
52
|
export * from "./components/SaveIndicator";
|
|
53
|
+
export * from "./components/ScanProgress";
|
|
52
54
|
export * from "./components/SearchField";
|
|
53
55
|
export * from "./components/Select";
|
|
54
56
|
export * from "./components/Skeleton";
|
|
@@ -60,6 +62,7 @@ export * from "./components/Stamp";
|
|
|
60
62
|
export * from "./components/Stat";
|
|
61
63
|
export * from "./components/StatTile";
|
|
62
64
|
export * from "./components/Stepper";
|
|
65
|
+
export * from "./components/Sunburst";
|
|
63
66
|
export * from "./components/Switch";
|
|
64
67
|
export * from "./components/Tabs";
|
|
65
68
|
export * from "./components/TextField";
|
|
@@ -69,11 +72,20 @@ export * from "./components/Timeline";
|
|
|
69
72
|
export * from "./components/Toast";
|
|
70
73
|
export * from "./components/ToggleCard";
|
|
71
74
|
export * from "./components/Tooltip";
|
|
75
|
+
export * from "./components/Tray";
|
|
76
|
+
export * from "./components/Treemap";
|
|
72
77
|
export * from "./components/WeatherIcon";
|
|
73
78
|
export * from "./components/WeatherSky";
|
|
74
79
|
export { accentStyle } from "./utils/accent";
|
|
75
80
|
export { burst } from "./utils/confetti";
|
|
76
81
|
export { cx } from "./utils/cx";
|
|
82
|
+
export { countValue, easeOutCubic } from "./utils/ease";
|
|
83
|
+
export { type FlyToOptions, flyTo } from "./utils/flyTo";
|
|
84
|
+
export { baseName, formatAge, formatBytes, formatCount, formatElapsed, splitBytes } from "./utils/format";
|
|
77
85
|
export { hueFrom, initials } from "./utils/hue";
|
|
86
|
+
export { squarify, type TileRect } from "./utils/squarify";
|
|
87
|
+
export { isRelated, type SizedNode, sizeTree, type TreeNode } from "./utils/tree";
|
|
78
88
|
export { useCanvasLoop } from "./utils/useCanvasLoop";
|
|
89
|
+
export { getMotionPref, MOTION_PREF_LABELS, type MotionPref, setMotionPref, shouldAnimate, useMotionPref, } from "./utils/useMotionPref";
|
|
79
90
|
export { useReducedMotion } from "./utils/useReducedMotion";
|
|
91
|
+
export { type Size, useSize } from "./utils/useSize";
|