@juninmd/sonido 1.0.0 → 1.0.1

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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 juninmd
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 juninmd
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,165 +1,165 @@
1
- <div align="center">
2
-
3
- <img src=".github/assets/hero.png" alt="Componentes do Sonido: céu animado do clima, alertas com cena, duelo de placar e balão de pensamento" width="100%" />
4
-
5
- # Sonido
6
-
7
- **O design system dos apps do juninmd, em React.**
8
- Escuro por padrão, vidro sobre um fundo atmosférico, cor com função e movimento que responde ao toque.
9
-
10
- [![npm](https://img.shields.io/npm/v/@juninmd/sonido?color=ff3d6e&label=npm)](https://www.npmjs.com/package/@juninmd/sonido)
11
- [![CI](https://github.com/juninmd/sonido/actions/workflows/ci.yml/badge.svg)](https://github.com/juninmd/sonido/actions/workflows/ci.yml)
12
- [![Docs](https://img.shields.io/badge/docs-ao%20vivo-7c5cff)](https://juninmd.github.io/sonido/)
13
- [![semantic-release](https://img.shields.io/badge/semantic--release-conventional-3fe3d3)](https://github.com/semantic-release/semantic-release)
14
- [![Licença MIT](https://img.shields.io/badge/licen%C3%A7a-MIT-f5b73d)](LICENSE)
15
-
16
- [**Documentação ao vivo**](https://juninmd.github.io/sonido/) · [Começar](#começar) · [Componentes](#componentes) · [Temas](#temas) · [Contribuir](#contribuir)
17
-
18
- </div>
19
-
20
- ---
21
-
22
- ## Por que Sonido
23
-
24
- | | |
25
- | --------------------------- | ------------------------------------------------------------------------------------------------- |
26
- | 🧩 **78 componentes** | De botão a céu animado do clima, todos com tipos, teclado e ARIA. |
27
- | 🎨 **8 temas** | Troque com um atributo: `data-theme="hueco-mundo"`. Tokens `--sn-*` em CSS e em JS. |
28
- | ✨ **Movimento com motivo** | Mola tátil, confete, cenas em canvas. Tudo desliga com `prefers-reduced-motion`. |
29
- | ♿ **Acessível** | Contraste AA nos 8 temas, auditado com axe. Alvos de 44px e foco visível. |
30
- | 🧪 **Teste ao vivo** | Cada página da documentação tem um editor: mude o código, veja o resultado, copie com os imports. |
31
- | 📦 **Leve** | Sem dependências além do React. ESM, tree-shakeable, CSS em um arquivo. |
32
-
33
- ## Começar
34
-
35
- ```bash
36
- npm install @juninmd/sonido
37
- ```
38
-
39
- ```tsx
40
- import { Button, Card, CardTitle, ProgressBar, burst } from "@juninmd/sonido";
41
- import "@juninmd/sonido/styles.css";
42
-
43
- export function Licao() {
44
- return (
45
- <Card>
46
- <CardTitle>Lição 12</CardTitle>
47
- <ProgressBar value={0.6} label="Meta do dia" />
48
- <Button press onClick={(e) => burst(e.currentTarget)}>
49
- Concluir lição
50
- </Button>
51
- </Card>
52
- );
53
- }
54
- ```
55
-
56
- Coloque `class="sn-body"` no `<body>` para herdar fonte, cor e fundo do tema.
57
-
58
- > 💡 Não sabe qual componente usar? Abra a [documentação](https://juninmd.github.io/sonido/), edite o exemplo e clique em **Copiar código**.
59
-
60
- ## Componentes
61
-
62
- | Grupo | Componentes |
63
- | --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
64
- | **Ações** | Button, ConfirmButton |
65
- | **Formulários** | Checkbox, FilterChips, RadioGroup, Rating, SearchField, Select, Slider, Switch, TextField, ToggleCard |
66
- | **Exibição** | Avatar, Badge, Kbd, Tooltip |
67
- | **Feedback** | Alert, EmptyState, LiveBadge, SaveIndicator, Skeleton, Spinner, Stamp, Toast |
68
- | **Superfícies** | Accordion, AmbientBackdrop, Artwork, Bento, Card, Carousel, Dialog, Hero, PageHeader |
69
- | **Navegação** | Breadcrumb, CommandPalette, Dock, Menu, NavRail, Pagination, Stepper, Tabs |
70
- | **Dados** | BarChart, CountUp, DataTable, Duel, Heatmap, MeterCard, Odometer, ProgressBar, ProgressRing, RadialClock, Sparkline, Stat, StatTile, Timeline |
71
- | **Widgets** | AgendaRail, AlertCard, RouteMap, WeatherIcon, WeatherSky |
72
- | **Assistente** | EmojiBurst, PresenceOrb, RadialMenu, SpeechBubble, ThinkingBubble |
73
- | **Movimento e temas** | Motion, ThemeSwitcher |
74
-
75
- Utilitários: `burst` (confete), `accentStyle(hue)` (cor por seção), `useReducedMotion`, `useCanvasLoop`, `hueFrom`, `initials`, `cx`.
76
-
77
- ## Ilhas vivas
78
-
79
- Pílulas escuras para atividades em andamento: chamada, timer, música, gravação, rota, cotação, clima e bateria. Ficam escuras em qualquer tema e usam a cor de destaque dele.
80
-
81
- <img src=".github/assets/islands.png" alt="Galeria de ilhas vivas: cotação, chamada, timer, navegação, player, gravação, clima por hora, progresso e bateria" width="100%" />
82
-
83
- ```tsx
84
- <IslandCall name="Ana Lima" subtitle="celular" onAccept={atender} onDecline={recusar} />
85
- <IslandTimer duration={25 * 60} label="Foco" onDone={tocar} />
86
- <IslandChip icon={<Bike />} value="2,0 km" tone="gold" label="Pedalada: 2 km" />
87
- ```
88
-
89
- ## Temas
90
-
91
- <img src=".github/assets/themes.png" alt="O mesmo card em seis temas: Sonido escuro, Sonido claro, Hueco Mundo, Canto, Drácula e Aurora" width="100%" />
92
-
93
- | Tema | Ativar |
94
- | ---------------------- | ------------------------------------------------- |
95
- | Sonido escuro (padrão) | nada, é o `:root` |
96
- | Sonido claro | `data-theme="light"` |
97
- | Hueco Mundo | `data-theme="hueco-mundo"` |
98
- | Canto · Canto claro | `data-theme="canto"` · `data-theme="canto-claro"` |
99
- | Drácula | `data-theme="dracula"` |
100
- | Glass | `data-theme="glass"` |
101
- | Aurora | `data-theme="aurora"` |
102
-
103
- ```ts
104
- document.documentElement.dataset.theme = "aurora";
105
- // ou <ThemeSwitcher value={tema} onChange={setTema} /> com a lavada circular
106
- ```
107
-
108
- Tokens em JS: `import { color, space, duration } from "@juninmd/sonido/tokens"`. Só as variáveis: `@juninmd/sonido/tokens.css`.
109
-
110
- ## De onde veio cada peça
111
-
112
- Sonido junta o melhor dos apps do juninmd:
113
-
114
- | Origem | O que trouxe |
115
- | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
116
- | games-gallery | Dock com ampliação, Hero, Card com tilt, AmbientBackdrop, ProgressRing, CountUp, Toast |
117
- | nerd-watch | Tokens base, CommandPalette, Carousel, NavRail, BarChart, Artwork, confete |
118
- | canto-widget | Tema Hueco Mundo e os 5 skins do canto, WeatherSky, AlertCard com 19 cenas, RouteMap, AgendaRail, Tabs, DataTable |
119
- | pobre-lingo | Botão tátil, curva de mola, Rating e ProgressBar gamificados |
120
- | mika | PresenceOrb, ThinkingBubble, SpeechBubble, RadialMenu, EmojiBurst, PageHeader, StatTile, ToggleCard, SaveIndicator, Bento |
121
- | ai-session-monitor | ThemeSwitcher, MeterCard |
122
- | franca-segura · eleicoes-radar · treta-aovivo | Heatmap, RadialClock, Odometer, Stamp, LiveBadge, Duel |
123
- | faxina | Release com semantic-release e commitlint |
124
-
125
- ## Desenvolvimento
126
-
127
- ```bash
128
- npm install
129
- npm run dev # Storybook em http://localhost:6006
130
- npm run check # lint + tipos + auditoria do design system + testes
131
- npm run build # pacote em dist/
132
- npm run build:docs # site estático em storybook-static/
133
- ```
134
-
135
- Os testes montam **todos os exemplos da documentação**, então o código que você copia da doc sempre funciona.
136
-
137
- ### Skills de auditoria
138
-
139
- Em `.claude/skills/` há três skills para o Claude Code:
140
-
141
- - **sonido-audit**: roda `npm run audit:ds`, lint, tipos e testes e corrige o que falhar.
142
- - **sonido-a11y**: axe-core nos 78 exemplos em todos os temas.
143
- - **sonido-component**: passo a passo para criar ou portar um componente.
144
-
145
- ## Releases
146
-
147
- Versões saem sozinhas a cada merge na `main`, pelo [semantic-release](https://github.com/semantic-release/semantic-release), a partir das mensagens de commit:
148
-
149
- | Commit | Versão |
150
- | ----------------------------- | ------------- |
151
- | `fix(button): foco no Safari` | patch `1.0.1` |
152
- | `feat(toast): ação desfazer` | minor `1.1.0` |
153
- | `feat!: remove a prop tone` | major `2.0.0` |
154
-
155
- O commitlint valida as mensagens no `commit-msg` (husky) e no CI.
156
-
157
- ## Contribuir
158
-
159
- 1. Crie uma branch, faça commits semânticos e abra um PR.
160
- 2. O CI roda lint, tipos, auditoria, testes, build do pacote e da documentação.
161
- 3. No merge, a `main` publica no npm e atualiza a documentação.
162
-
163
- ## Licença
164
-
165
- [MIT](LICENSE) © juninmd
1
+ <div align="center">
2
+
3
+ <img src=".github/assets/hero.png" alt="Componentes do Sonido: céu animado do clima, alertas com cena, duelo de placar e balão de pensamento" width="100%" />
4
+
5
+ # Sonido
6
+
7
+ **O design system dos apps do juninmd, em React.**
8
+ Escuro por padrão, vidro sobre um fundo atmosférico, cor com função e movimento que responde ao toque.
9
+
10
+ [![npm](https://img.shields.io/npm/v/@juninmd/sonido?color=ff3d6e&label=npm)](https://www.npmjs.com/package/@juninmd/sonido)
11
+ [![CI](https://github.com/juninmd/sonido/actions/workflows/ci.yml/badge.svg)](https://github.com/juninmd/sonido/actions/workflows/ci.yml)
12
+ [![Docs](https://img.shields.io/badge/docs-ao%20vivo-7c5cff)](https://juninmd.github.io/sonido/)
13
+ [![semantic-release](https://img.shields.io/badge/semantic--release-conventional-3fe3d3)](https://github.com/semantic-release/semantic-release)
14
+ [![Licença MIT](https://img.shields.io/badge/licen%C3%A7a-MIT-f5b73d)](LICENSE)
15
+
16
+ [**Documentação ao vivo**](https://juninmd.github.io/sonido/) · [Começar](#começar) · [Componentes](#componentes) · [Temas](#temas) · [Contribuir](#contribuir)
17
+
18
+ </div>
19
+
20
+ ---
21
+
22
+ ## Por que Sonido
23
+
24
+ | | |
25
+ | --------------------------- | ------------------------------------------------------------------------------------------------- |
26
+ | 🧩 **78 componentes** | De botão a céu animado do clima, todos com tipos, teclado e ARIA. |
27
+ | 🎨 **8 temas** | Troque com um atributo: `data-theme="hueco-mundo"`. Tokens `--sn-*` em CSS e em JS. |
28
+ | ✨ **Movimento com motivo** | Mola tátil, confete, cenas em canvas. Tudo desliga com `prefers-reduced-motion`. |
29
+ | ♿ **Acessível** | Contraste AA nos 8 temas, auditado com axe. Alvos de 44px e foco visível. |
30
+ | 🧪 **Teste ao vivo** | Cada página da documentação tem um editor: mude o código, veja o resultado, copie com os imports. |
31
+ | 📦 **Leve** | Sem dependências além do React. ESM, tree-shakeable, CSS em um arquivo. |
32
+
33
+ ## Começar
34
+
35
+ ```bash
36
+ npm install @juninmd/sonido
37
+ ```
38
+
39
+ ```tsx
40
+ import { Button, Card, CardTitle, ProgressBar, burst } from "@juninmd/sonido";
41
+ import "@juninmd/sonido/styles.css";
42
+
43
+ export function Licao() {
44
+ return (
45
+ <Card>
46
+ <CardTitle>Lição 12</CardTitle>
47
+ <ProgressBar value={0.6} label="Meta do dia" />
48
+ <Button press onClick={(e) => burst(e.currentTarget)}>
49
+ Concluir lição
50
+ </Button>
51
+ </Card>
52
+ );
53
+ }
54
+ ```
55
+
56
+ Coloque `class="sn-body"` no `<body>` para herdar fonte, cor e fundo do tema.
57
+
58
+ > 💡 Não sabe qual componente usar? Abra a [documentação](https://juninmd.github.io/sonido/), edite o exemplo e clique em **Copiar código**.
59
+
60
+ ## Componentes
61
+
62
+ | Grupo | Componentes |
63
+ | --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
64
+ | **Ações** | Button, ConfirmButton |
65
+ | **Formulários** | Checkbox, FilterChips, RadioGroup, Rating, SearchField, Select, Slider, Switch, TextField, ToggleCard |
66
+ | **Exibição** | Avatar, Badge, Kbd, Tooltip |
67
+ | **Feedback** | Alert, EmptyState, LiveBadge, SaveIndicator, Skeleton, Spinner, Stamp, Toast |
68
+ | **Superfícies** | Accordion, AmbientBackdrop, Artwork, Bento, Card, Carousel, Dialog, Hero, PageHeader |
69
+ | **Navegação** | Breadcrumb, CommandPalette, Dock, Menu, NavRail, Pagination, Stepper, Tabs |
70
+ | **Dados** | BarChart, CountUp, DataTable, Duel, Heatmap, MeterCard, Odometer, ProgressBar, ProgressRing, RadialClock, Sparkline, Stat, StatTile, Timeline |
71
+ | **Widgets** | AgendaRail, AlertCard, RouteMap, WeatherIcon, WeatherSky |
72
+ | **Assistente** | EmojiBurst, PresenceOrb, RadialMenu, SpeechBubble, ThinkingBubble |
73
+ | **Movimento e temas** | Motion, ThemeSwitcher |
74
+
75
+ Utilitários: `burst` (confete), `accentStyle(hue)` (cor por seção), `useReducedMotion`, `useCanvasLoop`, `hueFrom`, `initials`, `cx`.
76
+
77
+ ## Ilhas vivas
78
+
79
+ Pílulas escuras para atividades em andamento: chamada, timer, música, gravação, rota, cotação, clima e bateria. Ficam escuras em qualquer tema e usam a cor de destaque dele.
80
+
81
+ <img src=".github/assets/islands.png" alt="Galeria de ilhas vivas: cotação, chamada, timer, navegação, player, gravação, clima por hora, progresso e bateria" width="100%" />
82
+
83
+ ```tsx
84
+ <IslandCall name="Ana Lima" subtitle="celular" onAccept={atender} onDecline={recusar} />
85
+ <IslandTimer duration={25 * 60} label="Foco" onDone={tocar} />
86
+ <IslandChip icon={<Bike />} value="2,0 km" tone="gold" label="Pedalada: 2 km" />
87
+ ```
88
+
89
+ ## Temas
90
+
91
+ <img src=".github/assets/themes.png" alt="O mesmo card em seis temas: Sonido escuro, Sonido claro, Hueco Mundo, Canto, Drácula e Aurora" width="100%" />
92
+
93
+ | Tema | Ativar |
94
+ | ---------------------- | ------------------------------------------------- |
95
+ | Sonido escuro (padrão) | nada, é o `:root` |
96
+ | Sonido claro | `data-theme="light"` |
97
+ | Hueco Mundo | `data-theme="hueco-mundo"` |
98
+ | Canto · Canto claro | `data-theme="canto"` · `data-theme="canto-claro"` |
99
+ | Drácula | `data-theme="dracula"` |
100
+ | Glass | `data-theme="glass"` |
101
+ | Aurora | `data-theme="aurora"` |
102
+
103
+ ```ts
104
+ document.documentElement.dataset.theme = "aurora";
105
+ // ou <ThemeSwitcher value={tema} onChange={setTema} /> com a lavada circular
106
+ ```
107
+
108
+ Tokens em JS: `import { color, space, duration } from "@juninmd/sonido/tokens"`. Só as variáveis: `@juninmd/sonido/tokens.css`.
109
+
110
+ ## De onde veio cada peça
111
+
112
+ Sonido junta o melhor dos apps do juninmd:
113
+
114
+ | Origem | O que trouxe |
115
+ | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
116
+ | games-gallery | Dock com ampliação, Hero, Card com tilt, AmbientBackdrop, ProgressRing, CountUp, Toast |
117
+ | nerd-watch | Tokens base, CommandPalette, Carousel, NavRail, BarChart, Artwork, confete |
118
+ | canto-widget | Tema Hueco Mundo e os 5 skins do canto, WeatherSky, AlertCard com 19 cenas, RouteMap, AgendaRail, Tabs, DataTable |
119
+ | pobre-lingo | Botão tátil, curva de mola, Rating e ProgressBar gamificados |
120
+ | mika | PresenceOrb, ThinkingBubble, SpeechBubble, RadialMenu, EmojiBurst, PageHeader, StatTile, ToggleCard, SaveIndicator, Bento |
121
+ | ai-session-monitor | ThemeSwitcher, MeterCard |
122
+ | franca-segura · eleicoes-radar · treta-aovivo | Heatmap, RadialClock, Odometer, Stamp, LiveBadge, Duel |
123
+ | faxina | Release com semantic-release e commitlint |
124
+
125
+ ## Desenvolvimento
126
+
127
+ ```bash
128
+ npm install
129
+ npm run dev # Storybook em http://localhost:6006
130
+ npm run check # lint + tipos + auditoria do design system + testes
131
+ npm run build # pacote em dist/
132
+ npm run build:docs # site estático em storybook-static/
133
+ ```
134
+
135
+ Os testes montam **todos os exemplos da documentação**, então o código que você copia da doc sempre funciona.
136
+
137
+ ### Skills de auditoria
138
+
139
+ Em `.claude/skills/` há três skills para o Claude Code:
140
+
141
+ - **sonido-audit**: roda `npm run audit:ds`, lint, tipos e testes e corrige o que falhar.
142
+ - **sonido-a11y**: axe-core nos 78 exemplos em todos os temas.
143
+ - **sonido-component**: passo a passo para criar ou portar um componente.
144
+
145
+ ## Releases
146
+
147
+ Versões saem sozinhas a cada merge na `main`, pelo [semantic-release](https://github.com/semantic-release/semantic-release), a partir das mensagens de commit:
148
+
149
+ | Commit | Versão |
150
+ | ----------------------------- | ------------- |
151
+ | `fix(button): foco no Safari` | patch `1.0.1` |
152
+ | `feat(toast): ação desfazer` | minor `1.1.0` |
153
+ | `feat!: remove a prop tone` | major `2.0.0` |
154
+
155
+ O commitlint valida as mensagens no `commit-msg` (husky) e no CI.
156
+
157
+ ## Contribuir
158
+
159
+ 1. Crie uma branch, faça commits semânticos e abra um PR.
160
+ 2. O CI roda lint, tipos, auditoria, testes, build do pacote e da documentação.
161
+ 3. No merge, a `main` publica no npm e atualiza a documentação.
162
+
163
+ ## Licença
164
+
165
+ [MIT](LICENSE) © juninmd