@visio-io/design-system 1.0.2 → 1.2.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 +90 -181
- package/dist/index.cjs.js +43 -43
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +5088 -6102
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/components/DisplayTypes/DisplayTypes.d.ts +5 -0
- package/dist/types/components/DisplayTypes/DisplayTypes.stories.d.ts +10 -0
- package/dist/types/components/DisplayTypes/index.d.ts +2 -0
- package/dist/types/components/DisplayTypes/types.d.ts +10 -0
- package/dist/types/components/index.d.ts +2 -6
- package/dist/types/index.d.ts +0 -2
- package/dist/types/styles/tokens/spacing.d.ts +0 -1
- package/dist/types/theme/theme.d.ts +0 -1
- package/package.json +1 -1
- package/src/styles/tokens/css-variables.scss +27 -0
- package/src/styles/tokens/spacing.ts +0 -1
- package/dist/types/components/ModuleMenu/ModuleMenu.d.ts +0 -5
- package/dist/types/components/ModuleMenu/ModuleMenu.stories.d.ts +0 -7
- package/dist/types/components/ModuleMenu/index.d.ts +0 -2
- package/dist/types/components/ModuleMenu/types.d.ts +0 -25
- package/dist/types/components/ModuleMenu/useModuleMenu.d.ts +0 -12
- package/dist/types/components/SidebarMenu/SidebarMenu.d.ts +0 -5
- package/dist/types/components/SidebarMenu/SidebarMenu.stories.d.ts +0 -8
- package/dist/types/components/SidebarMenu/index.d.ts +0 -2
- package/dist/types/components/SidebarMenu/types.d.ts +0 -25
- package/dist/types/components/SidebarMenu/useSidebarMenu.d.ts +0 -19
- package/dist/types/components/VideoPlayer/VideoPlayer.d.ts +0 -5
- package/dist/types/components/VideoPlayer/VideoPlayer.stories.d.ts +0 -21
- package/dist/types/components/VideoPlayer/components/ControlMenu.d.ts +0 -16
- package/dist/types/components/VideoPlayer/handlers.d.ts +0 -9
- package/dist/types/components/VideoPlayer/index.d.ts +0 -3
- package/dist/types/components/VideoPlayer/types.d.ts +0 -28
- package/dist/types/components/VideoPlayer/useVideoPlayer.d.ts +0 -21
- package/dist/types/components/VideoPlayer/utils.d.ts +0 -2
- package/dist/types/theme/VisioThemeProvider.d.ts +0 -18
package/README.md
CHANGED
|
@@ -1,242 +1,151 @@
|
|
|
1
1
|
# Visio Design System
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Biblioteca de componentes de design system baseada em React e Material-UI.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Instalação
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Como repositório privado (GitHub/GitLab)
|
|
8
8
|
|
|
9
|
-
|
|
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)
|
|
9
|
+
Para usar este repositório como biblioteca privada diretamente do Git:
|
|
19
10
|
|
|
20
11
|
```bash
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
|
12
|
+
# Com pnpm
|
|
13
|
+
pnpm add git+https://github.com/USUARIO/visio-design-system.git
|
|
14
|
+
# ou com branch/tag específica
|
|
15
|
+
pnpm add git+https://github.com/USUARIO/visio-design-system.git#main
|
|
78
16
|
|
|
79
|
-
|
|
17
|
+
# Com npm
|
|
18
|
+
npm install git+https://github.com/USUARIO/visio-design-system.git
|
|
80
19
|
|
|
81
|
-
|
|
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
|
-
});
|
|
20
|
+
# Com yarn
|
|
21
|
+
yarn add git+https://github.com/USUARIO/visio-design-system.git
|
|
102
22
|
```
|
|
103
23
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
### Executar Storybook
|
|
24
|
+
**Para repositórios privados**, você precisará configurar autenticação:
|
|
107
25
|
|
|
26
|
+
1. **Usando SSH** (recomendado):
|
|
108
27
|
```bash
|
|
109
|
-
pnpm
|
|
28
|
+
pnpm add git+ssh://git@github.com/USUARIO/visio-design-system.git
|
|
110
29
|
```
|
|
111
30
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
### Build
|
|
115
|
-
|
|
31
|
+
2. **Usando token de acesso pessoal**:
|
|
116
32
|
```bash
|
|
117
|
-
pnpm
|
|
33
|
+
pnpm add git+https://SEU_TOKEN@github.com/USUARIO/visio-design-system.git
|
|
118
34
|
```
|
|
119
35
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
36
|
+
3. **Configurando no `.npmrc`** do projeto que vai usar a lib:
|
|
37
|
+
```
|
|
38
|
+
@visio-io:registry=https://npm.pkg.github.com
|
|
39
|
+
//npm.pkg.github.com/:_authToken=SEU_TOKEN
|
|
124
40
|
```
|
|
125
41
|
|
|
126
|
-
|
|
42
|
+
**Nota:** O script `prepare` executa automaticamente o build quando o pacote é instalado via Git.
|
|
127
43
|
|
|
128
|
-
|
|
44
|
+
## Dependências Peer
|
|
129
45
|
|
|
130
|
-
|
|
131
|
-
pnpm dev
|
|
132
|
-
```
|
|
46
|
+
Este pacote requer as seguintes dependências no seu projeto:
|
|
133
47
|
|
|
134
|
-
|
|
48
|
+
- `react` ^19.0.0
|
|
49
|
+
- `react-dom` ^19.0.0
|
|
50
|
+
- `@mui/material` ^5.0.0
|
|
51
|
+
- `@emotion/react` ^11.0.0
|
|
52
|
+
- `@emotion/styled` ^11.0.0
|
|
135
53
|
|
|
136
|
-
|
|
54
|
+
## Uso
|
|
137
55
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
**Solução:** Use `@visio-io/design-system/style.css` (sem `/dist`):
|
|
56
|
+
### Importar componentes
|
|
141
57
|
|
|
142
58
|
```tsx
|
|
143
|
-
|
|
144
|
-
import "@visio-io/design-system/dist/style.css";
|
|
59
|
+
import { Button } from "@visio-io/design-system";
|
|
145
60
|
|
|
146
|
-
|
|
147
|
-
|
|
61
|
+
function App() {
|
|
62
|
+
return <Button variant="contained">Clique aqui</Button>;
|
|
63
|
+
}
|
|
148
64
|
```
|
|
149
65
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
**Causa:** Pacote não instalado.
|
|
66
|
+
**Nota:** Os estilos CSS são incluídos automaticamente quando você importa qualquer componente. Não é necessário importar o CSS manualmente.
|
|
153
67
|
|
|
154
|
-
|
|
68
|
+
### Importar temas
|
|
155
69
|
|
|
156
|
-
|
|
70
|
+
```tsx
|
|
71
|
+
import { ThemeProvider } from "@mui/material/styles";
|
|
72
|
+
import { lightTheme, darkTheme } from "@visio-io/design-system";
|
|
157
73
|
|
|
158
|
-
|
|
74
|
+
function App() {
|
|
75
|
+
return (
|
|
76
|
+
<ThemeProvider theme={lightTheme}>
|
|
77
|
+
{/* Seus componentes aqui */}
|
|
78
|
+
</ThemeProvider>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
```
|
|
159
82
|
|
|
160
|
-
|
|
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
|
|
83
|
+
### Importar tokens
|
|
163
84
|
|
|
164
85
|
```tsx
|
|
165
|
-
|
|
166
|
-
import "@/app/styles/globals.css";
|
|
167
|
-
import "@visio-io/design-system/style.css";
|
|
168
|
-
import { Button } from "@visio-io/design-system";
|
|
86
|
+
import { spacingTokens, colorsTokens } from "@visio-io/design-system/tokens";
|
|
169
87
|
```
|
|
170
88
|
|
|
171
|
-
##
|
|
89
|
+
## Desenvolvimento
|
|
172
90
|
|
|
173
|
-
|
|
91
|
+
```bash
|
|
92
|
+
# Instalar dependências
|
|
93
|
+
pnpm install
|
|
174
94
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
95
|
+
# Executar Storybook
|
|
96
|
+
pnpm dev
|
|
97
|
+
|
|
98
|
+
# Build da biblioteca
|
|
99
|
+
pnpm build
|
|
100
|
+
|
|
101
|
+
# Verificar tipos
|
|
102
|
+
pnpm type-check
|
|
181
103
|
```
|
|
182
104
|
|
|
183
|
-
##
|
|
105
|
+
## Publicação
|
|
184
106
|
|
|
185
|
-
|
|
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`
|
|
107
|
+
O projeto usa [Changesets](https://github.com/changesets/changesets) para gerenciamento de versões e é publicado no GitHub Packages.
|
|
191
108
|
|
|
192
|
-
|
|
109
|
+
### Publicação Automática (Recomendado)
|
|
193
110
|
|
|
194
|
-
|
|
111
|
+
O projeto possui um workflow do GitHub Actions que publica automaticamente quando há changesets no branch `main` ou `master`.
|
|
195
112
|
|
|
113
|
+
1. Crie um changeset:
|
|
196
114
|
```bash
|
|
197
|
-
# 1. Criar um changeset documentando as mudanças
|
|
198
115
|
pnpm changeset
|
|
116
|
+
```
|
|
199
117
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
118
|
+
2. Commit e push:
|
|
119
|
+
```bash
|
|
120
|
+
git add .
|
|
121
|
+
git commit -m "feat: nova funcionalidade"
|
|
122
|
+
git push
|
|
205
123
|
```
|
|
206
124
|
|
|
207
|
-
|
|
125
|
+
3. O workflow irá:
|
|
126
|
+
- Detectar o changeset
|
|
127
|
+
- Criar um PR com a atualização de versão
|
|
128
|
+
- Após merge, publicar automaticamente no GitHub Packages
|
|
208
129
|
|
|
209
|
-
|
|
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
|
|
130
|
+
### Publicação Manual
|
|
215
131
|
|
|
216
|
-
|
|
132
|
+
```bash
|
|
133
|
+
# Build do projeto
|
|
217
134
|
pnpm build
|
|
218
135
|
|
|
219
|
-
#
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
# 4. Push das tags
|
|
223
|
-
git push --follow-tags
|
|
136
|
+
# Publicar no GitHub Packages
|
|
137
|
+
pnpm publish
|
|
224
138
|
```
|
|
225
139
|
|
|
226
|
-
|
|
140
|
+
**Nota:** Você precisará configurar autenticação. Veja o arquivo `TUTORIAL_GITHUB_PACKAGES.md` para instruções completas.
|
|
227
141
|
|
|
228
|
-
|
|
229
|
-
- **MINOR** (1.x.0): Novas funcionalidades, backward compatible
|
|
230
|
-
- **MAJOR** (x.0.0): Breaking changes
|
|
142
|
+
### Instalação do Pacote Publicado
|
|
231
143
|
|
|
232
|
-
|
|
144
|
+
Para instalar o pacote publicado no GitHub Packages:
|
|
233
145
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
## 📄 Licença
|
|
146
|
+
1. Configure autenticação (veja `TUTORIAL_GITHUB_PACKAGES.md`)
|
|
147
|
+
2. Instale o pacote:
|
|
148
|
+
```bash
|
|
149
|
+
pnpm add @visio-io/design-system
|
|
150
|
+
```
|
|
241
151
|
|
|
242
|
-
Proprietary - Visio.io
|