@wrrdev/fenix-ui 1.0.6 → 1.0.8
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 +314 -314
- package/dist/.nojekyll +0 -0
- package/dist/components/accordion/accordion.d.ts +72 -0
- package/dist/components/accordion/accordion.d.ts.map +1 -0
- package/dist/components/accordion/accordion.js +277 -0
- package/dist/components/accordion/accordion.js.map +1 -0
- package/dist/components/accordion/index.d.ts +2 -0
- package/dist/components/accordion/index.d.ts.map +1 -0
- package/dist/components/accordion/index.js +9 -0
- package/dist/components/accordion/index.js.map +1 -0
- package/dist/components/calendar/calendar.d.ts +2 -2
- package/dist/components/calendar/calendar.d.ts.map +1 -1
- package/dist/components/calendar/calendar.js +187 -89
- package/dist/components/calendar/calendar.js.map +1 -1
- package/dist/components/dropdown/dropdown.d.ts.map +1 -1
- package/dist/components/dropdown/dropdown.js +1 -1
- package/dist/components/dropdown/dropdown.js.map +1 -1
- package/dist/components/knob/index.d.ts +8 -0
- package/dist/components/knob/index.d.ts.map +1 -0
- package/dist/components/knob/index.js +7 -0
- package/dist/components/knob/index.js.map +1 -0
- package/dist/components/knob/knob.d.ts +51 -0
- package/dist/components/knob/knob.d.ts.map +1 -0
- package/dist/components/knob/knob.js +323 -0
- package/dist/components/knob/knob.js.map +1 -0
- package/dist/components/orderlist/index.d.ts +3 -0
- package/dist/components/orderlist/index.d.ts.map +1 -0
- package/dist/components/orderlist/index.js +7 -0
- package/dist/components/orderlist/index.js.map +1 -0
- package/dist/components/orderlist/orderlist.d.ts +78 -0
- package/dist/components/orderlist/orderlist.d.ts.map +1 -0
- package/dist/components/orderlist/orderlist.js +666 -0
- package/dist/components/orderlist/orderlist.js.map +1 -0
- package/dist/components/picklist/index.d.ts +3 -0
- package/dist/components/picklist/index.d.ts.map +1 -0
- package/dist/components/picklist/index.js +7 -0
- package/dist/components/picklist/index.js.map +1 -0
- package/dist/components/picklist/picklist.d.ts +102 -0
- package/dist/components/picklist/picklist.d.ts.map +1 -0
- package/dist/components/picklist/picklist.js +749 -0
- package/dist/components/picklist/picklist.js.map +1 -0
- package/dist/components/tooltip/directive.d.ts +31 -0
- package/dist/components/tooltip/directive.d.ts.map +1 -0
- package/dist/components/tooltip/directive.js +294 -0
- package/dist/components/tooltip/directive.js.map +1 -0
- package/dist/components/tooltip/index.d.ts +2 -1
- package/dist/components/tooltip/index.d.ts.map +1 -1
- package/dist/components/tooltip/index.js +4 -1
- package/dist/components/tooltip/index.js.map +1 -1
- package/dist/core/presets.d.ts.map +1 -1
- package/dist/core/presets.js +48 -9
- package/dist/core/presets.js.map +1 -1
- package/dist/core/tokens.d.ts.map +1 -1
- package/dist/core/tokens.js +4 -4
- package/dist/core/tokens.js.map +1 -1
- package/dist/docs/app.d.ts +3 -25
- package/dist/docs/app.d.ts.map +1 -1
- package/dist/docs/componentes/accordion.doc.d.ts +8 -0
- package/dist/docs/componentes/accordion.doc.d.ts.map +1 -0
- package/dist/docs/componentes/alert.doc.d.ts +8 -0
- package/dist/docs/componentes/alert.doc.d.ts.map +1 -0
- package/dist/docs/componentes/autocomplete.doc.d.ts +8 -0
- package/dist/docs/componentes/autocomplete.doc.d.ts.map +1 -0
- package/dist/docs/componentes/badge.doc.d.ts +8 -0
- package/dist/docs/componentes/badge.doc.d.ts.map +1 -0
- package/dist/docs/componentes/button.doc.d.ts +8 -0
- package/dist/docs/componentes/button.doc.d.ts.map +1 -0
- package/dist/docs/componentes/calendar.doc.d.ts +8 -0
- package/dist/docs/componentes/calendar.doc.d.ts.map +1 -0
- package/dist/docs/componentes/checkbox.doc.d.ts +8 -0
- package/dist/docs/componentes/checkbox.doc.d.ts.map +1 -0
- package/dist/docs/componentes/datepicker.doc.d.ts +8 -0
- package/dist/docs/componentes/datepicker.doc.d.ts.map +1 -0
- package/dist/docs/componentes/dialog.doc.d.ts +8 -0
- package/dist/docs/componentes/dialog.doc.d.ts.map +1 -0
- package/dist/docs/componentes/drawer.doc.d.ts +8 -0
- package/dist/docs/componentes/drawer.doc.d.ts.map +1 -0
- package/dist/docs/componentes/dropdown.doc.d.ts +8 -0
- package/dist/docs/componentes/dropdown.doc.d.ts.map +1 -0
- package/dist/docs/componentes/floatlabel.doc.d.ts +8 -0
- package/dist/docs/componentes/floatlabel.doc.d.ts.map +1 -0
- package/dist/docs/componentes/index.d.ts +10 -0
- package/dist/docs/componentes/index.d.ts.map +1 -0
- package/dist/docs/componentes/input.doc.d.ts +8 -0
- package/dist/docs/componentes/input.doc.d.ts.map +1 -0
- package/dist/docs/componentes/knob.doc.d.ts +8 -0
- package/dist/docs/componentes/knob.doc.d.ts.map +1 -0
- package/dist/docs/componentes/multiselect.doc.d.ts +8 -0
- package/dist/docs/componentes/multiselect.doc.d.ts.map +1 -0
- package/dist/docs/componentes/orderlist.doc.d.ts +8 -0
- package/dist/docs/componentes/orderlist.doc.d.ts.map +1 -0
- package/dist/docs/componentes/pagination.doc.d.ts +8 -0
- package/dist/docs/componentes/pagination.doc.d.ts.map +1 -0
- package/dist/docs/componentes/picklist.doc.d.ts +8 -0
- package/dist/docs/componentes/picklist.doc.d.ts.map +1 -0
- package/dist/docs/componentes/progress.doc.d.ts +8 -0
- package/dist/docs/componentes/progress.doc.d.ts.map +1 -0
- package/dist/docs/componentes/radio.doc.d.ts +8 -0
- package/dist/docs/componentes/radio.doc.d.ts.map +1 -0
- package/dist/docs/componentes/select.doc.d.ts +8 -0
- package/dist/docs/componentes/select.doc.d.ts.map +1 -0
- package/dist/docs/componentes/skeleton.doc.d.ts +8 -0
- package/dist/docs/componentes/skeleton.doc.d.ts.map +1 -0
- package/dist/docs/componentes/spinner.doc.d.ts +8 -0
- package/dist/docs/componentes/spinner.doc.d.ts.map +1 -0
- package/dist/docs/componentes/switch.doc.d.ts +8 -0
- package/dist/docs/componentes/switch.doc.d.ts.map +1 -0
- package/dist/docs/componentes/table.doc.d.ts +8 -0
- package/dist/docs/componentes/table.doc.d.ts.map +1 -0
- package/dist/docs/componentes/tabs.doc.d.ts +8 -0
- package/dist/docs/componentes/tabs.doc.d.ts.map +1 -0
- package/dist/docs/componentes/textarea.doc.d.ts +8 -0
- package/dist/docs/componentes/textarea.doc.d.ts.map +1 -0
- package/dist/docs/componentes/toast.doc.d.ts +8 -0
- package/dist/docs/componentes/toast.doc.d.ts.map +1 -0
- package/dist/docs/componentes/tooltip.doc.d.ts +25 -0
- package/dist/docs/componentes/tooltip.doc.d.ts.map +1 -0
- package/dist/docs/shared.d.ts +9 -0
- package/dist/docs/shared.d.ts.map +1 -0
- package/dist/docs/types.d.ts +47 -0
- package/dist/docs/types.d.ts.map +1 -0
- package/dist/fenix-ui.umd.min.js +815 -157
- package/dist/fenix-ui2.esm.js +2522 -103
- package/dist/fenix-ui2.esm.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -1
- package/package.json +212 -196
package/README.md
CHANGED
|
@@ -1,314 +1,314 @@
|
|
|
1
|
-
# FenixUI
|
|
2
|
-
|
|
3
|
-
Design System Web **nativo** — Web Components + Shadow DOM + Design Tokens.
|
|
4
|
-
Independente de framework: funciona em Vue, React, Angular, Svelte, HTML puro, Java/JSP, PHP, .NET.
|
|
5
|
-
|
|
6
|
-
## Instalação
|
|
7
|
-
|
|
8
|
-
```bash
|
|
9
|
-
npm i @wrrdev/fenix-ui
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
O pacote expõe **subpaths** por componente — importe apenas o que usa e o bundler aplica tree-shaking automático:
|
|
13
|
-
|
|
14
|
-
```ts
|
|
15
|
-
import '@wrrdev/fenix-ui/button'; // registra <fx-button>
|
|
16
|
-
import { FenixUI } from '@wrrdev/fenix-ui'; // API de tema/tokens (índice)
|
|
17
|
-
|
|
18
|
-
FenixUI.theme('dark');
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
> 📦 npm: [`@wrrdev/fenix-ui`](https://www.npmjs.com/package/@wrrdev/fenix-ui) — **v1.0.
|
|
22
|
-
> Subpaths disponíveis: `./theme`, `./tokens`, `./jsx`, `./vue`, `./button`, `./badge`, `./spinner`, `./select`, `./input`, `./switch`, `./textarea`, `./checkbox`, `./radio`, `./calendar`, `./datepicker`, `./multiselect`, `./table`, `./floatlabel`, `./dialog`, `./toast`, `./tooltip`, `./tabs`, `./progress`, `./skeleton`, `./alert`, `./drawer`, `./dropdown`, `./sidebar`, `./pagination`, `./autocomplete`, `./auto-import` e o curinga `./components/*`.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
## Consumo
|
|
26
|
-
|
|
27
|
-
### npm + bundler (recomendado — tree-shaking automático)
|
|
28
|
-
|
|
29
|
-
```ts
|
|
30
|
-
import '@wrrdev/fenix-ui/button';
|
|
31
|
-
import '@wrrdev/fenix-ui/badge';
|
|
32
|
-
|
|
33
|
-
const el = document.createElement('fx-button');
|
|
34
|
-
el.setAttribute('variant', 'primary');
|
|
35
|
-
el.textContent = 'Salvar';
|
|
36
|
-
document.body.append(el);
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
### CDN / HTML puro / JSP / .NET
|
|
40
|
-
|
|
41
|
-
Carregue o bundle **UMD** único: ele registra todos os componentes e expõe os globals
|
|
42
|
-
`FenixUI` (API de tema/tokens) e `FenixToast` (toasts imperativos).
|
|
43
|
-
|
|
44
|
-
```html
|
|
45
|
-
<!-- jsDelivr (recomendado) — link direto para uso -->
|
|
46
|
-
<script src="https://cdn.jsdelivr.net/npm/@wrrdev/fenix-ui@latest/dist/fenix-ui.umd.min.js"></script>
|
|
47
|
-
|
|
48
|
-
<!-- alternativa: unpkg -->
|
|
49
|
-
<!-- <script src="https://unpkg.com/@wrrdev/fenix-ui@latest/dist/fenix-ui.umd.min.js"></script> -->
|
|
50
|
-
|
|
51
|
-
<!-- ou a última versão publicada -->
|
|
52
|
-
<script src="https://cdn.jsdelivr.net/npm/@wrrdev/fenix-ui/dist/fenix-ui.umd.min.js"></script>
|
|
53
|
-
|
|
54
|
-
<script>
|
|
55
|
-
// tema claro/escuro em runtime (reflete em todos os componentes, incl. Shadow DOM)
|
|
56
|
-
FenixUI.theme('dark');
|
|
57
|
-
|
|
58
|
-
// toasts imperativo via global
|
|
59
|
-
FenixToast.success('Salvo!', 'Registro atualizado.');
|
|
60
|
-
</script>
|
|
61
|
-
|
|
62
|
-
<!-- pronto: estas tags já funcionam -->
|
|
63
|
-
<fx-button variant="danger" size="sm">Excluir</fx-button>
|
|
64
|
-
<fx-badge variant="success">Aprovado</fx-badge>
|
|
65
|
-
<fx-toast></fx-toast>
|
|
66
|
-
|
|
67
|
-
<!--
|
|
68
|
-
🔗 Links diretos para CDN (versão 1.0.
|
|
69
|
-
• https://cdn.jsdelivr.net/npm/@wrrdev/fenix-ui@latest/dist/fenix-ui.umd.min.js
|
|
70
|
-
• https://unpkg.com/@wrrdev/fenix-ui@latest/dist/fenix-ui.umd.min.js
|
|
71
|
-
-->
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
### Auto Import (plugin Vite/Rollup)
|
|
75
|
-
|
|
76
|
-
Cansado de importar componente por componente? O plugin `FenixAutoImport` percorre seus arquivos
|
|
77
|
-
(`.ts`, `.js`, `.tsx`, `.jsx`, `.vue`, `.html`, `.svelte`) em busca de tags `fx-*` conhecidas e injeta
|
|
78
|
-
o `import` do subpath de cada componente **automaticamente** — mantendo o tree-shaking: só entra no
|
|
79
|
-
bundle o que é usado, e ele não duplica imports já existentes.
|
|
80
|
-
|
|
81
|
-
### Instale
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
npm i @wrrdev/fenix-ui
|
|
85
|
-
npm i -D vite # ou rollup/webpack
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
### Configure no build
|
|
89
|
-
|
|
90
|
-
```ts
|
|
91
|
-
// vite.config.ts
|
|
92
|
-
import { defineConfig } from 'vite';
|
|
93
|
-
import { FenixAutoImport } from '@wrrdev/fenix-ui/auto-import';
|
|
94
|
-
|
|
95
|
-
export default defineConfig({
|
|
96
|
-
plugins: [FenixAutoImport()],
|
|
97
|
-
});
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
> Opcional: `FenixAutoImport({ packageName: '@minha-empresa/ui' })` reescreve todos os subpaths
|
|
101
|
-
> para apontar a outro escopo (útil em monorepos/forks). O padrão é `@wrrdev/fenix-ui`.
|
|
102
|
-
|
|
103
|
-
### Use sem importar
|
|
104
|
-
|
|
105
|
-
```html
|
|
106
|
-
<!-- Vue / React / Svelte / HTML -->
|
|
107
|
-
<fx-button variant="primary">Salvar</fx-button>
|
|
108
|
-
<fx-select clearable>
|
|
109
|
-
<option value="sp">São Paulo</option>
|
|
110
|
-
</fx-select>
|
|
111
|
-
|
|
112
|
-
<!-- O plugin injeta estes imports por você: -->
|
|
113
|
-
<!-- import '@wrrdev/fenix-ui/button'; -->
|
|
114
|
-
<!-- import '@wrrdev/fenix-ui/select'; -->
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
### Componentes suportados
|
|
118
|
-
|
|
119
|
-
| Tag | Subpath injetado |
|
|
120
|
-
|-----|------------------|
|
|
121
|
-
| `fx-button` | `@wrrdev/fenix-ui/button` |
|
|
122
|
-
| `fx-badge` | `@wrrdev/fenix-ui/badge` |
|
|
123
|
-
| `fx-spinner` | `@wrrdev/fenix-ui/spinner` |
|
|
124
|
-
| `fx-select` | `@wrrdev/fenix-ui/select` |
|
|
125
|
-
| `fx-multiselect` | `@wrrdev/fenix-ui/multiselect` |
|
|
126
|
-
| `fx-input` | `@wrrdev/fenix-ui/input` |
|
|
127
|
-
| `fx-switch` | `@wrrdev/fenix-ui/switch` |
|
|
128
|
-
| `fx-calendar` | `@wrrdev/fenix-ui/calendar` |
|
|
129
|
-
| `fx-datepicker` | `@wrrdev/fenix-ui/datepicker` |
|
|
130
|
-
| `fx-checkbox` | `@wrrdev/fenix-ui/checkbox` |
|
|
131
|
-
| `fx-radio` | `@wrrdev/fenix-ui/radio` |
|
|
132
|
-
| `fx-table` | `@wrrdev/fenix-ui/table` |
|
|
133
|
-
| `fx-floatlabel` | `@wrrdev/fenix-ui/floatlabel` |
|
|
134
|
-
| `fx-textarea` | `@wrrdev/fenix-ui/textarea` |
|
|
135
|
-
| `fx-dialog` | `@wrrdev/fenix-ui/dialog` |
|
|
136
|
-
| `fx-drawer` | `@wrrdev/fenix-ui/drawer` |
|
|
137
|
-
| `fx-toast` | `@wrrdev/fenix-ui/toast` |
|
|
138
|
-
| `fx-tooltip` | `@wrrdev/fenix-ui/tooltip` |
|
|
139
|
-
| `fx-tabs` | `@wrrdev/fenix-ui/tabs` |
|
|
140
|
-
| `fx-tab-panel` | `@wrrdev/fenix-ui/tabs` |
|
|
141
|
-
| `fx-progress` | `@wrrdev/fenix-ui/progress` |
|
|
142
|
-
| `fx-skeleton` | `@wrrdev/fenix-ui/skeleton` |
|
|
143
|
-
| `fx-alert` | `@wrrdev/fenix-ui/alert` |
|
|
144
|
-
| `fx-dropdown` | `@wrrdev/fenix-ui/dropdown` |
|
|
145
|
-
| `fx-dropdown-item` | `@wrrdev/fenix-ui/dropdown` |
|
|
146
|
-
| `fx-pagination` | `@wrrdev/fenix-ui/pagination` |
|
|
147
|
-
| `fx-autocomplete` | `@wrrdev/fenix-ui/autocomplete` |
|
|
148
|
-
|
|
149
|
-
### Compatibilidade com frameworks
|
|
150
|
-
|
|
151
|
-
| Framework | Suporte |
|
|
152
|
-
|-----------|---------|
|
|
153
|
-
| Vue 3 / Nuxt | ✅ via Vite/Rollup (inclusive SFC) |
|
|
154
|
-
| React / Next | ✅ via Vite/Rollup/Webpack (transform genérico) |
|
|
155
|
-
| HTML puro / JSP / .NET / PHP | ✅ use o bundle CDN (`fenix-ui.umd.min.js`) que registra tudo |
|
|
156
|
-
|
|
157
|
-
## Temas em runtime (sem recompilar)
|
|
158
|
-
|
|
159
|
-
```ts
|
|
160
|
-
FenixUI.theme('dark'); // claro | escuro
|
|
161
|
-
FenixUI.setTokens({ color: { primary: '#0d9488' } }); // override parcial profundo
|
|
162
|
-
FenixUI.resetTheme();
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
Os tokens viram CSS Custom Properties (`--fx-color-primary`, `--fx-radius-md`, …) no `:root`,
|
|
166
|
-
atravessando o Shadow DOM. Todo componente reage automaticamente.
|
|
167
|
-
|
|
168
|
-
### Configuração completa (`FenixUI.configure`)
|
|
169
|
-
|
|
170
|
-
Alternativa a chamar `theme()`/`setTokens()` separadamente — define tema e tokens numa chamada só:
|
|
171
|
-
|
|
172
|
-
```ts
|
|
173
|
-
import { FenixUI } from '@wrrdev/fenix-ui';
|
|
174
|
-
|
|
175
|
-
FenixUI.configure({
|
|
176
|
-
theme: 'light', // 'light' | 'dark'
|
|
177
|
-
tokens: {
|
|
178
|
-
color: {
|
|
179
|
-
primary: '#0d9488', // sobrescreve apenas o primary (merge profundo)
|
|
180
|
-
},
|
|
181
|
-
effect: {
|
|
182
|
-
ripple: '1', // '0' desativa o ripple do fx-button
|
|
183
|
-
'focus-ring': 'none', // campos sem anel de foco/sobra
|
|
184
|
-
},
|
|
185
|
-
},
|
|
186
|
-
});
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
Grupos de tokens disponíveis: `color`, `surface`, `text`, `border`, `font`, `space`,
|
|
190
|
-
`radius`, `size`, `shadow`, `motion`, `effect` e `z` (veja `@wrrdev/fenix-ui/tokens`).
|
|
191
|
-
|
|
192
|
-
### Presets prontos (temas padrão)
|
|
193
|
-
|
|
194
|
-
O FenixUI já vem com temas prontos — **não é preciso definir nada**. Basta aplicar:
|
|
195
|
-
|
|
196
|
-
```ts
|
|
197
|
-
import { applyPreset } from '@wrrdev/fenix-ui';
|
|
198
|
-
|
|
199
|
-
applyPreset('seiya'); // aplica o preset Seiya em modo claro
|
|
200
|
-
applyPreset('shiryu', 'dark'); // preset + modo escuro
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
Presets disponíveis: `fenix` (padrão), `seiya`, `shiryu`, `hyoga`, `shun`, `ikki`, `aiolia`.
|
|
204
|
-
|
|
205
|
-
```ts
|
|
206
|
-
import { listPresets } from '@wrrdev/fenix-ui';
|
|
207
|
-
|
|
208
|
-
listPresets(); // [{ name, label, tokens }, ...] — inclui os presets customizados
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
**Criando seu próprio preset** (fica registrado junto aos padrões):
|
|
212
|
-
|
|
213
|
-
```ts
|
|
214
|
-
import { defineCustomPreset, applyPreset } from '@wrrdev/fenix-ui';
|
|
215
|
-
|
|
216
|
-
defineCustomPreset('minha-marca', 'Minha Marca', {
|
|
217
|
-
color: { primary: '#7c3aed', secondary: '#a78bfa' },
|
|
218
|
-
radius: { md: '14px' },
|
|
219
|
-
});
|
|
220
|
-
|
|
221
|
-
applyPreset('minha-marca'); // ✅ disponível como qualquer preset nativo
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
**Sobrescrevendo apenas uma config de um preset** (merge profundo — o restante herda):
|
|
225
|
-
|
|
226
|
-
```ts
|
|
227
|
-
import { applyPreset, FenixUI } from '@wrrdev/fenix-ui';
|
|
228
|
-
|
|
229
|
-
applyPreset('shiryu', 'dark'); // aplica o tema base
|
|
230
|
-
FenixUI.setTokens({ color: { primary: '#0ea5e9' } }); // sobrescreve só o primary
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
> Presets sobrescrevem **apenas** os tokens informados — o restante herda do tema base (claro/escuro).
|
|
234
|
-
|
|
235
|
-
### Tipagem / autocomplete no TypeScript
|
|
236
|
-
|
|
237
|
-
A partir da v1.x, importar a lib (ou o subpath `@wrrdev/fenix-ui/jsx`) habilita no TypeScript:
|
|
238
|
-
|
|
239
|
-
- **autocomplete + validação de atributos** de `fx-*` em TSX/JSX (React, Preact, Vue JSX);
|
|
240
|
-
- tipos nomeados por componente (`FxButtonProps`, `FxInputProps`, …) e uniões (`FxSize`, `FxButtonVariant`, …);
|
|
241
|
-
- tipagem imperativa de `document.createElement('fx-button')` via `HTMLElementTagNameMap`.
|
|
242
|
-
|
|
243
|
-
```tsx
|
|
244
|
-
import '@wrrdev/fenix-ui'; // registra componentes + habilita as tipagens JSX
|
|
245
|
-
|
|
246
|
-
<fx-button variant="primary" size="lg" loading>Salvar</fx-button>
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
Se o autocomplete ainda não aparecer, garanta que o `tsconfig` do seu projeto tem
|
|
250
|
-
`"moduleResolution": "bundler"` (ou `"node16"`/`"nodenext"`) para resolver os `exports` do pacote.
|
|
251
|
-
|
|
252
|
-
#### Vue 3 (templates SFC / Volar)
|
|
253
|
-
|
|
254
|
-
No Vue, o autocomplete dos atributos `fx-*` nos templates é habilitado por um módulo próprio.
|
|
255
|
-
Importe o subpath `./vue` **uma única vez** no `main.ts`:
|
|
256
|
-
|
|
257
|
-
```ts
|
|
258
|
-
import '@wrrdev/fenix-ui/vue'; // habilita autocomplete de fx-* nos templates SFC
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
Requisitos:
|
|
262
|
-
|
|
263
|
-
- `vue` ≥ 3.5 (usa `IntrinsicElementAttributes`);
|
|
264
|
-
- Volar / vue-tsc (já incluído no `@vue/language-tools` usado pelo VS Code + Volar);
|
|
265
|
-
- no `tsconfig`, `"moduleResolution": "bundler"`.
|
|
266
|
-
|
|
267
|
-
Com isso o editor mostra as propriedades de cada componente (`variant`, `size`, `loading`, …)
|
|
268
|
-
nos templates. Para além do autocomplete, **validar** valores inválidos (ex.: `variant="foo"`),
|
|
269
|
-
ative o modo estrito do Volar no `tsconfig.json`:
|
|
270
|
-
|
|
271
|
-
```jsonc
|
|
272
|
-
{
|
|
273
|
-
"vueCompilerOptions": {
|
|
274
|
-
"strictTemplates": true
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
> Sem `strictTemplates`, o Vue não reporta atributos desconhecidos de elementos nativos
|
|
280
|
-
> (comportamento padrão do Volar) — mas o autocomplete das propriedades continua funcionando.
|
|
281
|
-
|
|
282
|
-
## Componentes (fase 1)
|
|
283
|
-
|
|
284
|
-
| Elemento | Atributos principais | Slots |
|
|
285
|
-
|--------------|-----------------------------------------------|--------------|
|
|
286
|
-
| `fx-button` | `variant` (primary/secondary/success/warning/danger/ghost/outline), `size`, `disabled`, `loading`, `type`, `full` | default, `icon` |
|
|
287
|
-
| `fx-badge` | `variant` (default/primary/success/warning/danger/info), `round` | default |
|
|
288
|
-
| `fx-input` | `type` (text/number/email/password/search/tel/url), `value`, `size`, `placeholder`, `disabled`, `readonly`, `min/max/step` | — |
|
|
289
|
-
| `fx-select` | `value`, `size` (sm/md/lg), `disabled`, `placeholder` — filhos `<option>` nativos | `(padrão)` |
|
|
290
|
-
| `fx-switch` | `checked`, `disabled`, `size` (sm/md/lg) | `(padrão)` |
|
|
291
|
-
| `fx-spinner` | `size` (sm/md/lg) | — |
|
|
292
|
-
|
|
293
|
-
Todos os componentes com tamanho usam **`md` como padrão** (valores inválidos caem para `md`).
|
|
294
|
-
Escala alinhada ao mercado (Material/Ant): **sm ≈ 32px · md ≈ 40px (padrão) · lg ≈ 48px**.
|
|
295
|
-
|
|
296
|
-
Eventos usam o nativo `click` no botão; `input`, `change` e o `change` do select são
|
|
297
|
-
`CustomEvent`s **composed** com `detail: { value }` (atravessam o Shadow DOM).
|
|
298
|
-
|
|
299
|
-
### Tokens de efeito (configuráveis por preset)
|
|
300
|
-
|
|
301
|
-
```ts
|
|
302
|
-
FenixUI.setTokens({
|
|
303
|
-
effect: {
|
|
304
|
-
ripple: '0', // desativa o efeito ripple do fx-button
|
|
305
|
-
'focus-ring': 'none', // campos sem anel de foco/sobra
|
|
306
|
-
},
|
|
307
|
-
});
|
|
308
|
-
```
|
|
309
|
-
|
|
310
|
-
Presets sobrescrevem **apenas** os tokens informados — o restante herda do tema base (claro/escuro).
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
> 📏 Convenções: elemento `fx-{component}` · token `--fx-{grupo}-{chave}` · tema `light | dark`
|
|
314
|
-
> Sem dependência de Tailwind/Vue/React; acessibilidade desde a primeira implementação.
|
|
1
|
+
# FenixUI
|
|
2
|
+
|
|
3
|
+
Design System Web **nativo** — Web Components + Shadow DOM + Design Tokens.
|
|
4
|
+
Independente de framework: funciona em Vue, React, Angular, Svelte, HTML puro, Java/JSP, PHP, .NET.
|
|
5
|
+
|
|
6
|
+
## Instalação
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm i @wrrdev/fenix-ui
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
O pacote expõe **subpaths** por componente — importe apenas o que usa e o bundler aplica tree-shaking automático:
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import '@wrrdev/fenix-ui/button'; // registra <fx-button>
|
|
16
|
+
import { FenixUI } from '@wrrdev/fenix-ui'; // API de tema/tokens (índice)
|
|
17
|
+
|
|
18
|
+
FenixUI.theme('dark');
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
> 📦 npm: [`@wrrdev/fenix-ui`](https://www.npmjs.com/package/@wrrdev/fenix-ui) — **v1.0.8**, acesso público.
|
|
22
|
+
> Subpaths disponíveis: `./theme`, `./tokens`, `./jsx`, `./vue`, `./button`, `./badge`, `./spinner`, `./select`, `./input`, `./switch`, `./textarea`, `./checkbox`, `./radio`, `./calendar`, `./datepicker`, `./multiselect`, `./table`, `./floatlabel`, `./dialog`, `./toast`, `./tooltip`, `./tabs`, `./progress`, `./skeleton`, `./alert`, `./drawer`, `./dropdown`, `./sidebar`, `./pagination`, `./autocomplete`, `./auto-import` e o curinga `./components/*`.
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## Consumo
|
|
26
|
+
|
|
27
|
+
### npm + bundler (recomendado — tree-shaking automático)
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import '@wrrdev/fenix-ui/button';
|
|
31
|
+
import '@wrrdev/fenix-ui/badge';
|
|
32
|
+
|
|
33
|
+
const el = document.createElement('fx-button');
|
|
34
|
+
el.setAttribute('variant', 'primary');
|
|
35
|
+
el.textContent = 'Salvar';
|
|
36
|
+
document.body.append(el);
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### CDN / HTML puro / JSP / .NET
|
|
40
|
+
|
|
41
|
+
Carregue o bundle **UMD** único: ele registra todos os componentes e expõe os globals
|
|
42
|
+
`FenixUI` (API de tema/tokens) e `FenixToast` (toasts imperativos).
|
|
43
|
+
|
|
44
|
+
```html
|
|
45
|
+
<!-- jsDelivr (recomendado) — link direto para uso -->
|
|
46
|
+
<script src="https://cdn.jsdelivr.net/npm/@wrrdev/fenix-ui@latest/dist/fenix-ui.umd.min.js"></script>
|
|
47
|
+
|
|
48
|
+
<!-- alternativa: unpkg -->
|
|
49
|
+
<!-- <script src="https://unpkg.com/@wrrdev/fenix-ui@latest/dist/fenix-ui.umd.min.js"></script> -->
|
|
50
|
+
|
|
51
|
+
<!-- ou a última versão publicada -->
|
|
52
|
+
<script src="https://cdn.jsdelivr.net/npm/@wrrdev/fenix-ui/dist/fenix-ui.umd.min.js"></script>
|
|
53
|
+
|
|
54
|
+
<script>
|
|
55
|
+
// tema claro/escuro em runtime (reflete em todos os componentes, incl. Shadow DOM)
|
|
56
|
+
FenixUI.theme('dark');
|
|
57
|
+
|
|
58
|
+
// toasts imperativo via global
|
|
59
|
+
FenixToast.success('Salvo!', 'Registro atualizado.');
|
|
60
|
+
</script>
|
|
61
|
+
|
|
62
|
+
<!-- pronto: estas tags já funcionam -->
|
|
63
|
+
<fx-button variant="danger" size="sm">Excluir</fx-button>
|
|
64
|
+
<fx-badge variant="success">Aprovado</fx-badge>
|
|
65
|
+
<fx-toast></fx-toast>
|
|
66
|
+
|
|
67
|
+
<!--
|
|
68
|
+
🔗 Links diretos para CDN (versão 1.0.8):
|
|
69
|
+
• https://cdn.jsdelivr.net/npm/@wrrdev/fenix-ui@latest/dist/fenix-ui.umd.min.js
|
|
70
|
+
• https://unpkg.com/@wrrdev/fenix-ui@latest/dist/fenix-ui.umd.min.js
|
|
71
|
+
-->
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Auto Import (plugin Vite/Rollup)
|
|
75
|
+
|
|
76
|
+
Cansado de importar componente por componente? O plugin `FenixAutoImport` percorre seus arquivos
|
|
77
|
+
(`.ts`, `.js`, `.tsx`, `.jsx`, `.vue`, `.html`, `.svelte`) em busca de tags `fx-*` conhecidas e injeta
|
|
78
|
+
o `import` do subpath de cada componente **automaticamente** — mantendo o tree-shaking: só entra no
|
|
79
|
+
bundle o que é usado, e ele não duplica imports já existentes.
|
|
80
|
+
|
|
81
|
+
### Instale
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
npm i @wrrdev/fenix-ui
|
|
85
|
+
npm i -D vite # ou rollup/webpack
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Configure no build
|
|
89
|
+
|
|
90
|
+
```ts
|
|
91
|
+
// vite.config.ts
|
|
92
|
+
import { defineConfig } from 'vite';
|
|
93
|
+
import { FenixAutoImport } from '@wrrdev/fenix-ui/auto-import';
|
|
94
|
+
|
|
95
|
+
export default defineConfig({
|
|
96
|
+
plugins: [FenixAutoImport()],
|
|
97
|
+
});
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
> Opcional: `FenixAutoImport({ packageName: '@minha-empresa/ui' })` reescreve todos os subpaths
|
|
101
|
+
> para apontar a outro escopo (útil em monorepos/forks). O padrão é `@wrrdev/fenix-ui`.
|
|
102
|
+
|
|
103
|
+
### Use sem importar
|
|
104
|
+
|
|
105
|
+
```html
|
|
106
|
+
<!-- Vue / React / Svelte / HTML -->
|
|
107
|
+
<fx-button variant="primary">Salvar</fx-button>
|
|
108
|
+
<fx-select clearable>
|
|
109
|
+
<option value="sp">São Paulo</option>
|
|
110
|
+
</fx-select>
|
|
111
|
+
|
|
112
|
+
<!-- O plugin injeta estes imports por você: -->
|
|
113
|
+
<!-- import '@wrrdev/fenix-ui/button'; -->
|
|
114
|
+
<!-- import '@wrrdev/fenix-ui/select'; -->
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Componentes suportados
|
|
118
|
+
|
|
119
|
+
| Tag | Subpath injetado |
|
|
120
|
+
|-----|------------------|
|
|
121
|
+
| `fx-button` | `@wrrdev/fenix-ui/button` |
|
|
122
|
+
| `fx-badge` | `@wrrdev/fenix-ui/badge` |
|
|
123
|
+
| `fx-spinner` | `@wrrdev/fenix-ui/spinner` |
|
|
124
|
+
| `fx-select` | `@wrrdev/fenix-ui/select` |
|
|
125
|
+
| `fx-multiselect` | `@wrrdev/fenix-ui/multiselect` |
|
|
126
|
+
| `fx-input` | `@wrrdev/fenix-ui/input` |
|
|
127
|
+
| `fx-switch` | `@wrrdev/fenix-ui/switch` |
|
|
128
|
+
| `fx-calendar` | `@wrrdev/fenix-ui/calendar` |
|
|
129
|
+
| `fx-datepicker` | `@wrrdev/fenix-ui/datepicker` |
|
|
130
|
+
| `fx-checkbox` | `@wrrdev/fenix-ui/checkbox` |
|
|
131
|
+
| `fx-radio` | `@wrrdev/fenix-ui/radio` |
|
|
132
|
+
| `fx-table` | `@wrrdev/fenix-ui/table` |
|
|
133
|
+
| `fx-floatlabel` | `@wrrdev/fenix-ui/floatlabel` |
|
|
134
|
+
| `fx-textarea` | `@wrrdev/fenix-ui/textarea` |
|
|
135
|
+
| `fx-dialog` | `@wrrdev/fenix-ui/dialog` |
|
|
136
|
+
| `fx-drawer` | `@wrrdev/fenix-ui/drawer` |
|
|
137
|
+
| `fx-toast` | `@wrrdev/fenix-ui/toast` |
|
|
138
|
+
| `fx-tooltip` | `@wrrdev/fenix-ui/tooltip` |
|
|
139
|
+
| `fx-tabs` | `@wrrdev/fenix-ui/tabs` |
|
|
140
|
+
| `fx-tab-panel` | `@wrrdev/fenix-ui/tabs` |
|
|
141
|
+
| `fx-progress` | `@wrrdev/fenix-ui/progress` |
|
|
142
|
+
| `fx-skeleton` | `@wrrdev/fenix-ui/skeleton` |
|
|
143
|
+
| `fx-alert` | `@wrrdev/fenix-ui/alert` |
|
|
144
|
+
| `fx-dropdown` | `@wrrdev/fenix-ui/dropdown` |
|
|
145
|
+
| `fx-dropdown-item` | `@wrrdev/fenix-ui/dropdown` |
|
|
146
|
+
| `fx-pagination` | `@wrrdev/fenix-ui/pagination` |
|
|
147
|
+
| `fx-autocomplete` | `@wrrdev/fenix-ui/autocomplete` |
|
|
148
|
+
|
|
149
|
+
### Compatibilidade com frameworks
|
|
150
|
+
|
|
151
|
+
| Framework | Suporte |
|
|
152
|
+
|-----------|---------|
|
|
153
|
+
| Vue 3 / Nuxt | ✅ via Vite/Rollup (inclusive SFC) |
|
|
154
|
+
| React / Next | ✅ via Vite/Rollup/Webpack (transform genérico) |
|
|
155
|
+
| HTML puro / JSP / .NET / PHP | ✅ use o bundle CDN (`fenix-ui.umd.min.js`) que registra tudo |
|
|
156
|
+
|
|
157
|
+
## Temas em runtime (sem recompilar)
|
|
158
|
+
|
|
159
|
+
```ts
|
|
160
|
+
FenixUI.theme('dark'); // claro | escuro
|
|
161
|
+
FenixUI.setTokens({ color: { primary: '#0d9488' } }); // override parcial profundo
|
|
162
|
+
FenixUI.resetTheme();
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Os tokens viram CSS Custom Properties (`--fx-color-primary`, `--fx-radius-md`, …) no `:root`,
|
|
166
|
+
atravessando o Shadow DOM. Todo componente reage automaticamente.
|
|
167
|
+
|
|
168
|
+
### Configuração completa (`FenixUI.configure`)
|
|
169
|
+
|
|
170
|
+
Alternativa a chamar `theme()`/`setTokens()` separadamente — define tema e tokens numa chamada só:
|
|
171
|
+
|
|
172
|
+
```ts
|
|
173
|
+
import { FenixUI } from '@wrrdev/fenix-ui';
|
|
174
|
+
|
|
175
|
+
FenixUI.configure({
|
|
176
|
+
theme: 'light', // 'light' | 'dark'
|
|
177
|
+
tokens: {
|
|
178
|
+
color: {
|
|
179
|
+
primary: '#0d9488', // sobrescreve apenas o primary (merge profundo)
|
|
180
|
+
},
|
|
181
|
+
effect: {
|
|
182
|
+
ripple: '1', // '0' desativa o ripple do fx-button
|
|
183
|
+
'focus-ring': 'none', // campos sem anel de foco/sobra
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
});
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Grupos de tokens disponíveis: `color`, `surface`, `text`, `border`, `font`, `space`,
|
|
190
|
+
`radius`, `size`, `shadow`, `motion`, `effect` e `z` (veja `@wrrdev/fenix-ui/tokens`).
|
|
191
|
+
|
|
192
|
+
### Presets prontos (temas padrão)
|
|
193
|
+
|
|
194
|
+
O FenixUI já vem com temas prontos — **não é preciso definir nada**. Basta aplicar:
|
|
195
|
+
|
|
196
|
+
```ts
|
|
197
|
+
import { applyPreset } from '@wrrdev/fenix-ui';
|
|
198
|
+
|
|
199
|
+
applyPreset('seiya'); // aplica o preset Seiya em modo claro
|
|
200
|
+
applyPreset('shiryu', 'dark'); // preset + modo escuro
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Presets disponíveis: `fenix` (padrão), `seiya`, `shiryu`, `hyoga`, `shun`, `ikki`, `aiolia`.
|
|
204
|
+
|
|
205
|
+
```ts
|
|
206
|
+
import { listPresets } from '@wrrdev/fenix-ui';
|
|
207
|
+
|
|
208
|
+
listPresets(); // [{ name, label, tokens }, ...] — inclui os presets customizados
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
**Criando seu próprio preset** (fica registrado junto aos padrões):
|
|
212
|
+
|
|
213
|
+
```ts
|
|
214
|
+
import { defineCustomPreset, applyPreset } from '@wrrdev/fenix-ui';
|
|
215
|
+
|
|
216
|
+
defineCustomPreset('minha-marca', 'Minha Marca', {
|
|
217
|
+
color: { primary: '#7c3aed', secondary: '#a78bfa' },
|
|
218
|
+
radius: { md: '14px' },
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
applyPreset('minha-marca'); // ✅ disponível como qualquer preset nativo
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
**Sobrescrevendo apenas uma config de um preset** (merge profundo — o restante herda):
|
|
225
|
+
|
|
226
|
+
```ts
|
|
227
|
+
import { applyPreset, FenixUI } from '@wrrdev/fenix-ui';
|
|
228
|
+
|
|
229
|
+
applyPreset('shiryu', 'dark'); // aplica o tema base
|
|
230
|
+
FenixUI.setTokens({ color: { primary: '#0ea5e9' } }); // sobrescreve só o primary
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
> Presets sobrescrevem **apenas** os tokens informados — o restante herda do tema base (claro/escuro).
|
|
234
|
+
|
|
235
|
+
### Tipagem / autocomplete no TypeScript
|
|
236
|
+
|
|
237
|
+
A partir da v1.x, importar a lib (ou o subpath `@wrrdev/fenix-ui/jsx`) habilita no TypeScript:
|
|
238
|
+
|
|
239
|
+
- **autocomplete + validação de atributos** de `fx-*` em TSX/JSX (React, Preact, Vue JSX);
|
|
240
|
+
- tipos nomeados por componente (`FxButtonProps`, `FxInputProps`, …) e uniões (`FxSize`, `FxButtonVariant`, …);
|
|
241
|
+
- tipagem imperativa de `document.createElement('fx-button')` via `HTMLElementTagNameMap`.
|
|
242
|
+
|
|
243
|
+
```tsx
|
|
244
|
+
import '@wrrdev/fenix-ui'; // registra componentes + habilita as tipagens JSX
|
|
245
|
+
|
|
246
|
+
<fx-button variant="primary" size="lg" loading>Salvar</fx-button>
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
Se o autocomplete ainda não aparecer, garanta que o `tsconfig` do seu projeto tem
|
|
250
|
+
`"moduleResolution": "bundler"` (ou `"node16"`/`"nodenext"`) para resolver os `exports` do pacote.
|
|
251
|
+
|
|
252
|
+
#### Vue 3 (templates SFC / Volar)
|
|
253
|
+
|
|
254
|
+
No Vue, o autocomplete dos atributos `fx-*` nos templates é habilitado por um módulo próprio.
|
|
255
|
+
Importe o subpath `./vue` **uma única vez** no `main.ts`:
|
|
256
|
+
|
|
257
|
+
```ts
|
|
258
|
+
import '@wrrdev/fenix-ui/vue'; // habilita autocomplete de fx-* nos templates SFC
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Requisitos:
|
|
262
|
+
|
|
263
|
+
- `vue` ≥ 3.5 (usa `IntrinsicElementAttributes`);
|
|
264
|
+
- Volar / vue-tsc (já incluído no `@vue/language-tools` usado pelo VS Code + Volar);
|
|
265
|
+
- no `tsconfig`, `"moduleResolution": "bundler"`.
|
|
266
|
+
|
|
267
|
+
Com isso o editor mostra as propriedades de cada componente (`variant`, `size`, `loading`, …)
|
|
268
|
+
nos templates. Para além do autocomplete, **validar** valores inválidos (ex.: `variant="foo"`),
|
|
269
|
+
ative o modo estrito do Volar no `tsconfig.json`:
|
|
270
|
+
|
|
271
|
+
```jsonc
|
|
272
|
+
{
|
|
273
|
+
"vueCompilerOptions": {
|
|
274
|
+
"strictTemplates": true
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
> Sem `strictTemplates`, o Vue não reporta atributos desconhecidos de elementos nativos
|
|
280
|
+
> (comportamento padrão do Volar) — mas o autocomplete das propriedades continua funcionando.
|
|
281
|
+
|
|
282
|
+
## Componentes (fase 1)
|
|
283
|
+
|
|
284
|
+
| Elemento | Atributos principais | Slots |
|
|
285
|
+
|--------------|-----------------------------------------------|--------------|
|
|
286
|
+
| `fx-button` | `variant` (primary/secondary/success/warning/danger/ghost/outline), `size`, `disabled`, `loading`, `type`, `full` | default, `icon` |
|
|
287
|
+
| `fx-badge` | `variant` (default/primary/success/warning/danger/info), `round` | default |
|
|
288
|
+
| `fx-input` | `type` (text/number/email/password/search/tel/url), `value`, `size`, `placeholder`, `disabled`, `readonly`, `min/max/step` | — |
|
|
289
|
+
| `fx-select` | `value`, `size` (sm/md/lg), `disabled`, `placeholder` — filhos `<option>` nativos | `(padrão)` |
|
|
290
|
+
| `fx-switch` | `checked`, `disabled`, `size` (sm/md/lg) | `(padrão)` |
|
|
291
|
+
| `fx-spinner` | `size` (sm/md/lg) | — |
|
|
292
|
+
|
|
293
|
+
Todos os componentes com tamanho usam **`md` como padrão** (valores inválidos caem para `md`).
|
|
294
|
+
Escala alinhada ao mercado (Material/Ant): **sm ≈ 32px · md ≈ 40px (padrão) · lg ≈ 48px**.
|
|
295
|
+
|
|
296
|
+
Eventos usam o nativo `click` no botão; `input`, `change` e o `change` do select são
|
|
297
|
+
`CustomEvent`s **composed** com `detail: { value }` (atravessam o Shadow DOM).
|
|
298
|
+
|
|
299
|
+
### Tokens de efeito (configuráveis por preset)
|
|
300
|
+
|
|
301
|
+
```ts
|
|
302
|
+
FenixUI.setTokens({
|
|
303
|
+
effect: {
|
|
304
|
+
ripple: '0', // desativa o efeito ripple do fx-button
|
|
305
|
+
'focus-ring': 'none', // campos sem anel de foco/sobra
|
|
306
|
+
},
|
|
307
|
+
});
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
Presets sobrescrevem **apenas** os tokens informados — o restante herda do tema base (claro/escuro).
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
> 📏 Convenções: elemento `fx-{component}` · token `--fx-{grupo}-{chave}` · tema `light | dark`
|
|
314
|
+
> Sem dependência de Tailwind/Vue/React; acessibilidade desde a primeira implementação.
|
package/dist/.nojekyll
ADDED
|
File without changes
|