birus-ui 0.0.0-stage → 0.3.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.
Files changed (44) hide show
  1. package/README.md +232 -2
  2. package/dist/birus-ui.js +6919 -0
  3. package/dist/birus-ui.umd.cjs +10 -0
  4. package/dist/style.css +1 -0
  5. package/dist/tailwind-preset.js +70 -0
  6. package/dist/themes.css +217 -0
  7. package/package.json +41 -4
  8. package/src/components/BirusAccordion.vue +112 -0
  9. package/src/components/BirusAlert.vue +114 -0
  10. package/src/components/BirusAvatar.vue +67 -0
  11. package/src/components/BirusBadge.vue +64 -0
  12. package/src/components/BirusBreadcrumb.vue +61 -0
  13. package/src/components/BirusButton.vue +84 -0
  14. package/src/components/BirusCard.vue +89 -0
  15. package/src/components/BirusCheckbox.vue +106 -0
  16. package/src/components/BirusDialog.vue +127 -0
  17. package/src/components/BirusDrawer.vue +158 -0
  18. package/src/components/BirusDropdownMenu.vue +184 -0
  19. package/src/components/BirusEmptyState.vue +64 -0
  20. package/src/components/BirusHeading.vue +70 -0
  21. package/src/components/BirusInput.vue +197 -0
  22. package/src/components/BirusKbd.vue +43 -0
  23. package/src/components/BirusPagination.vue +132 -0
  24. package/src/components/BirusProgress.vue +70 -0
  25. package/src/components/BirusRadioGroup.vue +157 -0
  26. package/src/components/BirusSelect.vue +272 -0
  27. package/src/components/BirusSeparator.vue +72 -0
  28. package/src/components/BirusSkeleton.vue +46 -0
  29. package/src/components/BirusSlider.vue +96 -0
  30. package/src/components/BirusStatCard.vue +106 -0
  31. package/src/components/BirusStepper.vue +114 -0
  32. package/src/components/BirusSwitch.vue +76 -0
  33. package/src/components/BirusTable.vue +126 -0
  34. package/src/components/BirusTabs.vue +121 -0
  35. package/src/components/BirusText.vue +74 -0
  36. package/src/components/BirusTextarea.vue +84 -0
  37. package/src/components/BirusTimeline.vue +61 -0
  38. package/src/components/BirusToaster.vue +130 -0
  39. package/src/components/BirusTooltip.vue +63 -0
  40. package/src/composables/useBirusTheme.js +144 -0
  41. package/src/composables/useToast.js +63 -0
  42. package/src/index.js +116 -0
  43. package/src/lib-entry.js +3 -0
  44. package/src/style.css +5 -0
package/README.md CHANGED
@@ -1,3 +1,233 @@
1
- # Temporary Holding Version
1
+ # birusUI — Design System & Component Library (Vue 3)
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ **32 componentes reutilizáveis e acessíveis construídos do zero em JavaScript puro para Vue 3.**
4
+ Temas reativos em tempo real • Escala tipográfica modular • Zero dependências headless externas • Fácil customização
5
+
6
+ [![Buy Me a Coffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-Apoiar%20o%20Projeto-BD5FFF?style=for-the-badge&logo=buy-me-a-coffee&logoColor=FFDD00)](https://www.buymeacoffee.com/gabrielreis)
7
+ ![Vue 3](https://img.shields.io/badge/Vue-3.4+-4FC08D?style=for-the-badge&logo=vuedotjs&logoColor=white)
8
+ ![Pure JS](https://img.shields.io/badge/JavaScript-ES%20Modules-F7DF1E?style=for-the-badge&logo=javascript&logoColor=black)
9
+ ![MIT License](https://img.shields.io/badge/License-MIT-7C3AED?style=for-the-badge)
10
+
11
+ ---
12
+
13
+ ## 1. Instalação & Configuração Rápida
14
+
15
+ ```bash
16
+ npm install birus-ui
17
+ ```
18
+
19
+ ### Opção A: Registro Global (`main.js`)
20
+ Disponibiliza todas as 32 tags `<Birus... />` automaticamente na sua aplicação:
21
+
22
+ ```js
23
+ import { createApp } from 'vue';
24
+ import App from './App.vue';
25
+
26
+ // 1. Importe o pacote e o CSS pré-compilado (funciona mesmo sem Tailwind!)
27
+ import BirusUI, { initBirusTheme } from 'birus-ui';
28
+ import 'birus-ui/style.css';
29
+
30
+ // 2. (Opcional) Inicialize o tema da sua aplicação
31
+ initBirusTheme({
32
+ palette: 'birus', // 'birus' | 'emerald' | 'ocean' | 'rose' | 'amber' | 'zinc'
33
+ mode: 'dark', // 'dark' | 'light'
34
+ radius: 'md', // 'none' | 'sm' | 'md' | 'lg' | 'full'
35
+ font: 'inter', // 'inter' | 'jakarta' | 'grotesk' | 'editorial' | 'mono'
36
+ });
37
+
38
+ const app = createApp(App);
39
+ app.use(BirusUI);
40
+ app.mount('#app');
41
+ ```
42
+
43
+ ### Opção B: Importação Individual (Tree-Shaking por componente)
44
+
45
+ ```vue
46
+ <script setup>
47
+ import 'birus-ui/style.css';
48
+ import { BirusButton, BirusCard, BirusBadge } from 'birus-ui';
49
+ </script>
50
+
51
+ <template>
52
+ <BirusCard title="Bem-vindo ao birusUI" badge="v0.3">
53
+ <BirusButton variant="glow">Começar Agora</BirusButton>
54
+ </BirusCard>
55
+ </template>
56
+ ```
57
+
58
+ ---
59
+
60
+ ## 2. Como Customizar Temas, Cores, Fontes e Bordas (4 Níveis)
61
+
62
+ ### Nível 1: Trocar Tema em Tempo Real com `useBirusTheme()`
63
+
64
+ ```vue
65
+ <script setup>
66
+ import { useBirusTheme } from 'birus-ui';
67
+
68
+ const {
69
+ theme, // Estado reativo atual: { palette, mode, radius, font, tokens }
70
+ palettes, // Lista das 6 paletas disponíveis
71
+ fonts, // Lista das 5 famílias de fontes
72
+ radii, // Lista dos 5 tamanhos de arredondamento
73
+ setPalette, // Ex: setPalette('emerald')
74
+ setMode, // Ex: setMode('light') ou setMode('dark')
75
+ toggleMode, // Alterna entre 'dark' e 'light'
76
+ setRadius, // Ex: setRadius('lg')
77
+ setFont, // Ex: setFont('editorial')
78
+ setCustomTokens, // Sobrescreve cores em tempo real usando HEX ou HSL
79
+ resetTheme, // Restaura para o padrão
80
+ } = useBirusTheme();
81
+ </script>
82
+
83
+ <template>
84
+ <BirusButton variant="outline" @click="toggleMode">
85
+ Modo atual: {{ theme.mode }}
86
+ </BirusButton>
87
+ </template>
88
+ ```
89
+
90
+ ### Nível 2: Passar Suas Próprias Cores em HEX (`#RRGGBB`) via JavaScript
91
+
92
+ ```js
93
+ import { initBirusTheme } from 'birus-ui';
94
+
95
+ initBirusTheme({
96
+ palette: 'birus',
97
+ mode: 'dark',
98
+ radius: 'lg',
99
+ tokens: {
100
+ primary: '#BD5FFF', // Aceita HEX diretamente!
101
+ primaryFg: '#FFFFFF',
102
+ info: '#38BDF8',
103
+ success: '#10B981',
104
+ warning: '#F59E0B',
105
+ destructive: '#EF4444',
106
+ radius: '14px',
107
+ },
108
+ });
109
+ ```
110
+
111
+ ### Nível 3: Registrar uma Nova Paleta Completa (`registerBirusPalette`)
112
+
113
+ ```js
114
+ import { registerBirusPalette, initBirusTheme, hexToHslChannels } from 'birus-ui';
115
+
116
+ registerBirusPalette('minha-marca', {
117
+ name: 'Minha Marca',
118
+ description: 'Identidade visual corporativa',
119
+ swatchHex: '#FF3366',
120
+ dark: {
121
+ primary: hexToHslChannels('#FF3366'),
122
+ primaryFg: hexToHslChannels('#FFFFFF'),
123
+ ring: hexToHslChannels('#FF3366'),
124
+ },
125
+ light: {
126
+ primary: hexToHslChannels('#E11D48'),
127
+ primaryFg: hexToHslChannels('#FFFFFF'),
128
+ ring: hexToHslChannels('#E11D48'),
129
+ },
130
+ });
131
+
132
+ initBirusTheme({ palette: 'minha-marca', mode: 'dark' });
133
+ ```
134
+
135
+ ### Nível 4: Sobrescrever Estilo de Qualquer Componente com a Prop `class`
136
+
137
+ Todos os 32 componentes usam `cn()` (`clsx` + `tailwind-merge`), permitindo sobrescrever qualquer classe utilitária sem conflito:
138
+
139
+ ```vue
140
+ <BirusButton class="bg-pink-600 hover:bg-pink-500 rounded-none px-10 shadow-xl">
141
+ Botão Customizado
142
+ </BirusButton>
143
+ ```
144
+
145
+ #### (Opcional) Preset para Tailwind CSS
146
+
147
+ ```js
148
+ // tailwind.config.js
149
+ import { birusTailwindPreset } from 'birus-ui/tailwind-preset';
150
+
151
+ export default {
152
+ presets: [birusTailwindPreset],
153
+ content: [
154
+ './index.html',
155
+ './src/**/*.{vue,js,jsx}',
156
+ './node_modules/birus-ui/dist/**/*.js',
157
+ ],
158
+ };
159
+ ```
160
+
161
+ ---
162
+
163
+ ## 3. Catálogo dos 32 Componentes
164
+
165
+ ### Tipografia & Fundações (3)
166
+ | Componente | Descrição | Props Principais |
167
+ | :--- | :--- | :--- |
168
+ | `<BirusHeading>` | Títulos semânticos (`h1`–`h6`) com escala modular | `as`, `size` (`'xs'`..`'display'`), `weight`, `gradient`, `accentLine`, `align` |
169
+ | `<BirusText>` | Corpo de texto, leads, legendas, citações e código | `variant` (`'body'`, `'lead'`, `'small'`, `'overline'`, `'quote'`, `'code'`), `tone`, `clamp` |
170
+ | `<BirusSeparator>` | Divisor horizontal ou vertical com rótulo opcional | `orientation`, `variant` (`'solid'`, `'dashed'`, `'gradient'`), `label` |
171
+
172
+ ### Ações & Feedback (5)
173
+ | Componente | Descrição | Props Principais |
174
+ | :--- | :--- | :--- |
175
+ | `<BirusButton>` | Botão com 8 variantes, loading, ícones e atalho | `variant` (`'default'`, `'secondary'`, `'outline'`, `'ghost'`, `'destructive'`, `'success'`, `'link'`, `'glow'`), `size`, `loading`, `pill`, `block`, `shortcut` |
176
+ | `<BirusBadge>` | Etiqueta de status com indicador dot e botão remover | `variant`, `size`, `dot`, `removable` (`@remove`) |
177
+ | `<BirusAlert>` | Caixa de alerta semântica com suporte a fechamento | `variant` (`'info'`, `'success'`, `'warning'`, `'destructive'`), `title`, `description`, `dismissible` |
178
+ | `<BirusToaster>` | Sistema global de notificações Toast via `useToast()` | `position` (`'bottom-right'`, `'top-right'`, `'bottom-left'`, `'top-center'`) |
179
+ | `<BirusKbd>` | Visualizador de teclas e atalhos de teclado | `keys` (`'Ctrl + K'`), `variant`, `size` |
180
+
181
+ ### Formulários & Inputs (7)
182
+ | Componente | Descrição | Props Principais |
183
+ | :--- | :--- | :--- |
184
+ | `<BirusInput>` | Campo de texto com prefixo, sufixo, limpar e senha | `v-model`, `type`, `label`, `hint`, `errorMessage`, `state`, `prefixText`, `suffixText`, `clearable` |
185
+ | `<BirusTextarea>` | Área de texto com auto-resize e contador | `v-model`, `label`, `rows`, `maxlength`, `autoResize`, `state` |
186
+ | `<BirusSelect>` | Dropdown customizado com busca embutida e teclado | `v-model`, `options` (`[{ value, label, description }]`), `searchable`, `clearable` |
187
+ | `<BirusRadioGroup>` | Seleção única em formato de cartões ricos ou lista | `v-model`, `options` (`[{ value, label, badge, description }]`), `variant` (`'cards'` \| `'list'`) |
188
+ | `<BirusSlider>` | Controle deslizante com barra preenchida e sufixo | `v-model`, `min`, `max`, `step`, `variant`, `valueSuffix` |
189
+ | `<BirusSwitch>` | Interruptor acessível (`role="switch"`) | `v-model`, `label`, `description`, `size`, `disabled` |
190
+ | `<BirusCheckbox>` | Caixa de seleção com suporte a `indeterminate` | `v-model`, `indeterminate`, `label`, `description`, `size` |
191
+
192
+ ### Layout & Conteúdo (3)
193
+ | Componente | Descrição | Props Principais |
194
+ | :--- | :--- | :--- |
195
+ | `<BirusCard>` | Container modular com 6 superfícies e slots | `variant` (`'default'`, `'elevated'`, `'glass'`, `'interactive'`, `'outline'`, `'featured'`), `accentTop`, `title`, `description`, `badge` |
196
+ | `<BirusAccordion>` | Seções expansíveis no modo único ou múltiplo | `items` (`[{ id, title, subtitle, content }]`), `type` (`'single'` \| `'multiple'`), `variant` |
197
+ | `<BirusEmptyState>` | Placeholder estruturado para listas ou buscas vazias | `title`, `description`, `variant` (`'default'`, `'dashed'`, `'compact'`), slots `#icon`, `#actions` |
198
+
199
+ ### Sobreposição & Navegação (8)
200
+ | Componente | Descrição | Props Principais |
201
+ | :--- | :--- | :--- |
202
+ | `<BirusDialog>` | Janela modal Teleportada com bloqueio de scroll | `v-model`, `size` (`'sm'`..`'xl'`), `title`, `description`, `closeOnOverlay` |
203
+ | `<BirusDrawer>` | Painel lateral/superior/inferior deslizante (Sheet) | `v-model`, `side` (`'right'`, `'left'`, `'top'`, `'bottom'`), `size`, `title` |
204
+ | `<BirusDropdownMenu>` | Menu contextual com cabeçalhos, divisores e atalhos | `items`, `align`, `triggerLabel`, `@select` |
205
+ | `<BirusTabs>` | Abas WAI-ARIA com navegação por setas do teclado | `v-model`, `tabs` (`[{ value, label, badge }]`), `variant` (`'segmented'`, `'underline'`, `'pills'`) |
206
+ | `<BirusStepper>` | Indicador de passos sequenciais (Wizard) | `v-model` (índice `0..N`), `steps` (`[{ title, description }]`), `orientation`, `clickable` |
207
+ | `<BirusBreadcrumb>` | Trilha de navegação hierárquica | `items` (`[{ label, value, current }]`), `separator` (`'chevron'`, `'slash'`, `'dot'`) |
208
+ | `<BirusPagination>` | Paginação com truncamento inteligente | `v-model`, `totalPages`, `siblingCount`, `variant` |
209
+ | `<BirusTooltip>` | Dica flutuante ativada por hover e foco | `content`, `position` (`'top'`, `'bottom'`, `'left'`, `'right'`) |
210
+
211
+ ### Dados & Carregamento (6)
212
+ | Componente | Descrição | Props Principais |
213
+ | :--- | :--- | :--- |
214
+ | `<BirusStatCard>` | Cartão executivo de KPI com tendência e meta | `label`, `value`, `trend` (`'+18%'`), `trendDirection` (`'up'`, `'down'`, `'neutral'`), `progress`, `caption` |
215
+ | `<BirusTable>` | Tabela de dados com ordenação por coluna e slots | `columns` (`[{ key, label, sortable }]`), `rows`, `density`, `striped`, slot `#cell-<key>` |
216
+ | `<BirusTimeline>` | Linha do tempo cronológica com status semânticos | `items` (`[{ title, description, time, badge, status }]`) |
217
+ | `<BirusAvatar>` | Avatar com fallback de iniciais e presença | `src`, `name`, `size` (`'xs'`..`'xl'`), `shape`, `status` (`'online'`, `'busy'`, `'away'`, `'offline'`) |
218
+ | `<BirusProgress>` | Barra de progresso determinada ou indeterminada | `value`, `max`, `variant`, `indeterminate`, `label`, `showValue` |
219
+ | `<BirusSkeleton>` | Placeholders pulsantes para carregamento | `variant` (`'text'`, `'circle'`, `'rect'`, `'card'`), `lines` |
220
+
221
+ ---
222
+
223
+ ## 4. Apoie o Projeto (Buy Me a Coffee) ☕
224
+
225
+ Criado por **Gabriel Reis**. Se o **birusUI** ajudou no seu projeto ou economizou horas de desenvolvimento, considere apoiar com um café:
226
+
227
+ 👉 **[https://www.buymeacoffee.com/gabrielreis](https://www.buymeacoffee.com/gabrielreis)**
228
+
229
+ ---
230
+
231
+ ## Licença
232
+
233
+ MIT © Gabriel Reis