@visio-io/design-system 1.7.0 → 1.8.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/README.md +242 -0
- package/dist/index.cjs.js +77 -77
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +8909 -8886
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/components/CameraCard/CameraCard.stories.d.ts +3 -0
- package/dist/types/components/VideoPlayer/components/ControlMenu.d.ts +4 -1
- package/dist/types/components/VideoPlayer/components/Timestamp.d.ts +3 -0
- package/dist/types/components/VideoPlayer/icons/Seek.d.ts +6 -0
- package/dist/types/components/VideoPlayer/icons/SeekForward.d.ts +6 -0
- package/package.json +84 -85
- package/src/styles/tokens/colors.scss +53 -53
- package/src/styles/tokens/colors.ts +53 -53
- package/src/styles/tokens/css-variables.scss +190 -190
- package/src/styles/tokens/index.ts +4 -4
- package/src/styles/tokens/radii.ts +7 -7
- package/src/styles/tokens/spacing.ts +10 -10
- package/src/styles/tokens/typography.ts +22 -22
package/README.md
ADDED
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
# Visio Design System
|
|
2
|
+
|
|
3
|
+
Sistema de design unificado da Visio com componentes React reutilizáveis.
|
|
4
|
+
|
|
5
|
+
## 📦 Instalação
|
|
6
|
+
|
|
7
|
+
### Usando Yalc (desenvolvimento local)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# No diretório do design system
|
|
11
|
+
pnpm build
|
|
12
|
+
yalc push
|
|
13
|
+
|
|
14
|
+
# No projeto que vai consumir
|
|
15
|
+
yalc add @visio-io/design-system
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Usando npm/pnpm (produção)
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install @visio-io/design-system
|
|
22
|
+
# ou
|
|
23
|
+
pnpm add @visio-io/design-system
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## 🚀 Uso básico
|
|
27
|
+
|
|
28
|
+
### 1. Importar o CSS global
|
|
29
|
+
|
|
30
|
+
No arquivo principal da aplicação (ex: `layout.tsx`, `_app.tsx`, `main.tsx`):
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
import "@visio-io/design-system/style.css";
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**⚠️ Importante:** Use `@visio-io/design-system/style.css` (sem `/dist`) porque o `package.json` já mapeia o caminho corretamente.
|
|
37
|
+
|
|
38
|
+
### 2. Importar componentes
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
import { Button, VideoPlayer, SearchBar } from "@visio-io/design-system";
|
|
42
|
+
|
|
43
|
+
function App() {
|
|
44
|
+
return (
|
|
45
|
+
<div>
|
|
46
|
+
<Button>Click me</Button>
|
|
47
|
+
<VideoPlayer availableQualities={[...]} />
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 3. Usar tokens de design (opcional)
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
import { lightColors, darkColors, spacingTokens } from "@visio-io/design-system/tokens";
|
|
57
|
+
|
|
58
|
+
// Use os tokens nos seus estilos customizados
|
|
59
|
+
const myStyle = {
|
|
60
|
+
color: lightColors.primary,
|
|
61
|
+
padding: spacingTokens.md,
|
|
62
|
+
};
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## 📚 Componentes disponíveis
|
|
66
|
+
|
|
67
|
+
- **Button** - Botão customizável com variantes
|
|
68
|
+
- **VideoPlayer** - Player de vídeo com suporte a WebRTC, controles completos e responsivo
|
|
69
|
+
- **SearchBar** - Barra de busca com autocomplete e filtros
|
|
70
|
+
- **ModuleMenu** - Menu de módulos com estados expandido/colapsado
|
|
71
|
+
- **SidebarMenu** - Menu lateral com subitens
|
|
72
|
+
- **GoogleMap** - Integração com Google Maps
|
|
73
|
+
- **MapSpot** - Marcadores customizados para mapas
|
|
74
|
+
- **CountCard** - Cartão para exibir contadores
|
|
75
|
+
- **FilterButton** - Botão com dropdown de filtros
|
|
76
|
+
- **NotFoundContent** - Tela de conteúdo não encontrado
|
|
77
|
+
- **ZoomControls** - Controles de zoom para mapas
|
|
78
|
+
|
|
79
|
+
## 🎨 Tema e estilização
|
|
80
|
+
|
|
81
|
+
O design system usa Material-UI como base. Para personalizar o tema:
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
import { ThemeProvider, createTheme } from '@mui/material/styles';
|
|
85
|
+
import { lightTheme, darkTheme } from '@visio-io/design-system';
|
|
86
|
+
|
|
87
|
+
// Use o tema padrão
|
|
88
|
+
<ThemeProvider theme={lightTheme}>
|
|
89
|
+
<App />
|
|
90
|
+
</ThemeProvider>
|
|
91
|
+
|
|
92
|
+
// Ou customize
|
|
93
|
+
const customTheme = createTheme({
|
|
94
|
+
...lightTheme,
|
|
95
|
+
palette: {
|
|
96
|
+
...lightTheme.palette,
|
|
97
|
+
primary: {
|
|
98
|
+
main: '#your-color',
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
});
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## 🔧 Desenvolvimento
|
|
105
|
+
|
|
106
|
+
### Executar Storybook
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
pnpm dev
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Acesse: http://localhost:6006
|
|
113
|
+
|
|
114
|
+
### Build
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
pnpm build
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Publicar (yalc)
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
pnpm build && yalc push
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## 📖 Documentação
|
|
127
|
+
|
|
128
|
+
Acesse o Storybook para ver a documentação completa de cada componente com exemplos interativos:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
pnpm dev
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## 🐛 Troubleshooting
|
|
135
|
+
|
|
136
|
+
### Erro: "Module not found: Can't resolve '@visio-io/design-system/dist/style.css'"
|
|
137
|
+
|
|
138
|
+
**Causa:** Import incorreto do CSS.
|
|
139
|
+
|
|
140
|
+
**Solução:** Use `@visio-io/design-system/style.css` (sem `/dist`):
|
|
141
|
+
|
|
142
|
+
```tsx
|
|
143
|
+
// ❌ Errado
|
|
144
|
+
import "@visio-io/design-system/dist/style.css";
|
|
145
|
+
|
|
146
|
+
// ✅ Correto
|
|
147
|
+
import "@visio-io/design-system/style.css";
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Erro: "Cannot find module '@visio-io/design-system'"
|
|
151
|
+
|
|
152
|
+
**Causa:** Pacote não instalado.
|
|
153
|
+
|
|
154
|
+
**Solução:** Execute `yalc add @visio-io/design-system` no projeto receptor.
|
|
155
|
+
|
|
156
|
+
### Estilos não aplicados
|
|
157
|
+
|
|
158
|
+
**Causa:** CSS não importado ou ordem de importação incorreta.
|
|
159
|
+
|
|
160
|
+
**Solução:**
|
|
161
|
+
1. Certifique-se de importar o CSS antes dos componentes
|
|
162
|
+
2. Verifique se o CSS está sendo importado no arquivo raiz da aplicação
|
|
163
|
+
|
|
164
|
+
```tsx
|
|
165
|
+
// ✅ Ordem correta
|
|
166
|
+
import "@/app/styles/globals.css";
|
|
167
|
+
import "@visio-io/design-system/style.css";
|
|
168
|
+
import { Button } from "@visio-io/design-system";
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## 📝 Estrutura de exports
|
|
172
|
+
|
|
173
|
+
O `package.json` exporta:
|
|
174
|
+
|
|
175
|
+
```json
|
|
176
|
+
{
|
|
177
|
+
".": "./dist/index.es.js", // Componentes
|
|
178
|
+
"./style.css": "./dist/style.css", // Estilos
|
|
179
|
+
"./tokens": "./src/styles/tokens" // Tokens de design
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## 🤝 Contribuindo
|
|
184
|
+
|
|
185
|
+
1. Clone o repositório
|
|
186
|
+
2. Instale as dependências: `pnpm install`
|
|
187
|
+
3. Faça suas alterações
|
|
188
|
+
4. Execute o Storybook: `pnpm dev`
|
|
189
|
+
5. Build: `pnpm build`
|
|
190
|
+
6. Teste localmente com yalc: `yalc push`
|
|
191
|
+
|
|
192
|
+
## 📦 Publicando nova versão
|
|
193
|
+
|
|
194
|
+
### Usando Changesets (recomendado)
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
# 1. Criar um changeset documentando as mudanças
|
|
198
|
+
pnpm changeset
|
|
199
|
+
|
|
200
|
+
# 2. Atualizar versão e CHANGELOG
|
|
201
|
+
pnpm changeset version
|
|
202
|
+
|
|
203
|
+
# 3. Build e publicar
|
|
204
|
+
pnpm release
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Publicação manual
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
# 1. Atualizar versão no package.json
|
|
211
|
+
# Edite manualmente ou use:
|
|
212
|
+
npm version patch # 1.0.1 -> 1.0.2
|
|
213
|
+
npm version minor # 1.0.1 -> 1.1.0
|
|
214
|
+
npm version major # 1.0.1 -> 2.0.0
|
|
215
|
+
|
|
216
|
+
# 2. Build
|
|
217
|
+
pnpm build
|
|
218
|
+
|
|
219
|
+
# 3. Publicar no npm
|
|
220
|
+
npm publish --access public
|
|
221
|
+
|
|
222
|
+
# 4. Push das tags
|
|
223
|
+
git push --follow-tags
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### Versionamento semântico
|
|
227
|
+
|
|
228
|
+
- **PATCH** (1.0.x): Correções de bugs, pequenas melhorias
|
|
229
|
+
- **MINOR** (1.x.0): Novas funcionalidades, backward compatible
|
|
230
|
+
- **MAJOR** (x.0.0): Breaking changes
|
|
231
|
+
|
|
232
|
+
### ⚠️ Antes de publicar
|
|
233
|
+
|
|
234
|
+
- ✅ Certifique-se de estar autenticado no npm: `npm login`
|
|
235
|
+
- ✅ Verifique se tem permissões no package `@visio-io/design-system`
|
|
236
|
+
- ✅ Atualize o CHANGELOG.md com as mudanças
|
|
237
|
+
- ✅ Teste a build localmente: `pnpm build`
|
|
238
|
+
- ✅ Verifique os arquivos que serão publicados: `npm pack --dry-run`
|
|
239
|
+
|
|
240
|
+
## 📄 Licença
|
|
241
|
+
|
|
242
|
+
Proprietary - Visio.io
|