@wrrdev/fenix-ui 1.0.2 → 1.0.4
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 +67 -48
- package/dist/core/jsx.d.ts +281 -0
- package/dist/core/jsx.d.ts.map +1 -0
- package/dist/core/jsx.js +5 -0
- package/dist/core/jsx.js.map +1 -0
- package/dist/core/types.d.ts +44 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/fenix-ui.esm.js +2 -0
- package/dist/fenix-ui.esm.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Independente de framework: funciona em Vue, React, Angular, Svelte, HTML puro, J
|
|
|
9
9
|
npm i @wrrdev/fenix-ui
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
O pacote expõe **subpaths** por componente — importe apenas o que usa e o bundler aplica tree-shaking
|
|
12
|
+
O pacote expõe **subpaths** por componente — importe apenas o que usa e o bundler aplica tree-shaking automático:
|
|
13
13
|
|
|
14
14
|
```ts
|
|
15
15
|
import '@wrrdev/fenix-ui/button'; // registra <fx-button>
|
|
@@ -18,39 +18,9 @@ import { FenixUI } from '@wrrdev/fenix-ui'; // API de tema/tokens (índice)
|
|
|
18
18
|
FenixUI.theme('dark');
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
> 📦
|
|
22
|
-
> Subpaths disponíveis: `./theme`, `./tokens`, `./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/*`.
|
|
21
|
+
> 📦 npm: [`@wrrdev/fenix-ui`](https://www.npmjs.com/package/@wrrdev/fenix-ui) — **v1.0.4**, acesso público.
|
|
22
|
+
> Subpaths disponíveis: `./theme`, `./tokens`, `./jsx`, `./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
23
|
|
|
24
|
-
## Arquitetura (por que tree-shaking de verdade)
|
|
25
|
-
|
|
26
|
-
```
|
|
27
|
-
src/
|
|
28
|
-
├── core/ # NÚCLEO compartilhado
|
|
29
|
-
│ ├── tokens.ts # Design Tokens (claro/escuro) → var(--fx-*)
|
|
30
|
-
│ ├── theme.ts # API global: FenixUI.configure/theme/setTokens/resetTheme
|
|
31
|
-
│ ├── base.ts # FxElement: classe-base (Shadow DOM + render)
|
|
32
|
-
│ ├── define.ts # registro seguro no CustomElementRegistry
|
|
33
|
-
│ └── css.ts # helpers CSS
|
|
34
|
-
└── components/
|
|
35
|
-
├── button/ # cada componente importa APENAS o core
|
|
36
|
-
├── badge/
|
|
37
|
-
└── spinner/
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
O build usa **Rollup `preserveModules`**: o `dist/` espelha o `src/`, um arquivo por módulo.
|
|
41
|
-
Quando o cliente importa apenas um componente, o bundler dele puxa **somente** esse módulo +
|
|
42
|
-
o core compartilhado — nunca a biblioteca inteira:
|
|
43
|
-
|
|
44
|
-
```ts
|
|
45
|
-
// O cliente compila apenas Button + core (~9 kB não-minificado).
|
|
46
|
-
import '@wrrdev/fenix-ui/button';
|
|
47
|
-
import { FenixUI } from '@wrrdev/fenix-ui/theme';
|
|
48
|
-
|
|
49
|
-
FenixUI.theme('dark');
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
> Verificação real: bundle de consumidor contendo apenas `fx-button` e o core;
|
|
53
|
-
> `fx-badge`/`fx-spinner` ficaram **fora** do output do cliente.
|
|
54
24
|
|
|
55
25
|
## Consumo
|
|
56
26
|
|
|
@@ -95,7 +65,7 @@ Carregue o bundle **UMD** único: ele registra todos os componentes e expõe os
|
|
|
95
65
|
<fx-toast></fx-toast>
|
|
96
66
|
|
|
97
67
|
<!--
|
|
98
|
-
🔗 Links diretos para CDN (versão 1.0.
|
|
68
|
+
🔗 Links diretos para CDN (versão 1.0.4):
|
|
99
69
|
• https://cdn.jsdelivr.net/npm/@wrrdev/fenix-ui@latest/dist/fenix-ui.umd.min.js
|
|
100
70
|
• https://unpkg.com/@wrrdev/fenix-ui@latest/dist/fenix-ui.umd.min.js
|
|
101
71
|
-->
|
|
@@ -195,6 +165,66 @@ FenixUI.resetTheme();
|
|
|
195
165
|
Os tokens viram CSS Custom Properties (`--fx-color-primary`, `--fx-radius-md`, …) no `:root`,
|
|
196
166
|
atravessando o Shadow DOM. Todo componente reage automaticamente.
|
|
197
167
|
|
|
168
|
+
### Presets prontos (temas padrão)
|
|
169
|
+
|
|
170
|
+
O FenixUI já vem com temas prontos — **não é preciso definir nada**. Basta aplicar:
|
|
171
|
+
|
|
172
|
+
```ts
|
|
173
|
+
import { applyPreset } from '@wrrdev/fenix-ui';
|
|
174
|
+
|
|
175
|
+
applyPreset('seiya'); // aplica o preset Seiya em modo claro
|
|
176
|
+
applyPreset('shiryu', 'dark'); // preset + modo escuro
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Presets disponíveis: `fenix` (padrão), `seiya`, `shiryu`, `hyoga`, `shun`, `ikki`, `aiolia`.
|
|
180
|
+
|
|
181
|
+
```ts
|
|
182
|
+
import { listPresets } from '@wrrdev/fenix-ui';
|
|
183
|
+
|
|
184
|
+
listPresets(); // [{ name, label, tokens }, ...] — inclui os presets customizados
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
**Criando seu próprio preset** (fica registrado junto aos padrões):
|
|
188
|
+
|
|
189
|
+
```ts
|
|
190
|
+
import { defineCustomPreset, applyPreset } from '@wrrdev/fenix-ui';
|
|
191
|
+
|
|
192
|
+
defineCustomPreset('minha-marca', 'Minha Marca', {
|
|
193
|
+
color: { primary: '#7c3aed', secondary: '#a78bfa' },
|
|
194
|
+
radius: { md: '14px' },
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
applyPreset('minha-marca'); // ✅ disponível como qualquer preset nativo
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
**Sobrescrevendo apenas uma config de um preset** (merge profundo — o restante herda):
|
|
201
|
+
|
|
202
|
+
```ts
|
|
203
|
+
import { applyPreset, FenixUI } from '@wrrdev/fenix-ui';
|
|
204
|
+
|
|
205
|
+
applyPreset('shiryu', 'dark'); // aplica o tema base
|
|
206
|
+
FenixUI.setTokens({ color: { primary: '#0ea5e9' } }); // sobrescreve só o primary
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
> Presets sobrescrevem **apenas** os tokens informados — o restante herda do tema base (claro/escuro).
|
|
210
|
+
|
|
211
|
+
### Tipagem / autocomplete no TypeScript
|
|
212
|
+
|
|
213
|
+
A partir da v1.x, importar a lib (ou o subpath `@wrrdev/fenix-ui/jsx`) habilita no TypeScript:
|
|
214
|
+
|
|
215
|
+
- **autocomplete + validação de atributos** de `fx-*` em TSX/JSX (React, Preact, Vue JSX);
|
|
216
|
+
- tipos nomeados por componente (`FxButtonProps`, `FxInputProps`, …) e uniões (`FxSize`, `FxButtonVariant`, …);
|
|
217
|
+
- tipagem imperativa de `document.createElement('fx-button')` via `HTMLElementTagNameMap`.
|
|
218
|
+
|
|
219
|
+
```tsx
|
|
220
|
+
import '@wrrdev/fenix-ui'; // registra componentes + habilita as tipagens JSX
|
|
221
|
+
|
|
222
|
+
<fx-button variant="primary" size="lg" loading>Salvar</fx-button>
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Se o autocomplete ainda não aparecer, garanta que o `tsconfig` do seu projeto tem
|
|
226
|
+
`"moduleResolution": "bundler"` (ou `"node16"`/`"nodenext"`) para resolver os `exports` do pacote.
|
|
227
|
+
|
|
198
228
|
## Componentes (fase 1)
|
|
199
229
|
|
|
200
230
|
| Elemento | Atributos principais | Slots |
|
|
@@ -223,19 +253,8 @@ FenixUI.setTokens({
|
|
|
223
253
|
});
|
|
224
254
|
```
|
|
225
255
|
|
|
226
|
-
Presets sobrescrevem **apenas** os tokens informados — o restante herda do tema
|
|
227
|
-
base (claro/escuro) via deep merge (`deepMerge`).
|
|
228
|
-
|
|
229
|
-
## Scripts
|
|
230
|
-
|
|
231
|
-
| Comando | Ação |
|
|
232
|
-
|----------------------|-------------------------------------------------------------|
|
|
233
|
-
| `npm run dev` | Playground local (`index.html`) |
|
|
234
|
-
| `npm run test` | Testes unitários (Vitest + jsdom) |
|
|
235
|
-
| `npm run typecheck` | TypeScript estrito |
|
|
236
|
-
| `npm run build` | ESM modular + `.d.ts` + bundle CDN UMD |
|
|
256
|
+
Presets sobrescrevem **apenas** os tokens informados — o restante herda do tema base (claro/escuro).
|
|
237
257
|
|
|
238
|
-
## Convenções
|
|
239
258
|
|
|
240
|
-
|
|
241
|
-
|
|
259
|
+
> 📏 Convenções: elemento `fx-{component}` · token `--fx-{grupo}-{chave}` · tema `light | dark`
|
|
260
|
+
> Sem dependência de Tailwind/Vue/React; acessibilidade desde a primeira implementação.
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tipagens de propriedades + augmentations JSX do FenixUI.
|
|
3
|
+
*
|
|
4
|
+
* Importar este módulo — diretamente (`@wrrdev/fenix-ui/jsx`) ou via o
|
|
5
|
+
* índice principal (`@wrrdev/fenix-ui`) — habilita, no TypeScript:
|
|
6
|
+
*
|
|
7
|
+
* 1. autocomplete + validação de atributos em templates JSX/TSX;
|
|
8
|
+
* 2. tipos nomeados (`FxButtonProps`, `FxInputProps`, …) para wrappers ou código imperativo.
|
|
9
|
+
*
|
|
10
|
+
* A biblioteca NÃO depende de React/Vue: os atributos comuns
|
|
11
|
+
* (`className`, `onClick`, `style`, `children`, …) são aceitos via assinatura
|
|
12
|
+
* de índice, funcionando com qualquer runtime JSX.
|
|
13
|
+
*/
|
|
14
|
+
import type { FxElementProps, FxSize } from './types';
|
|
15
|
+
/** Marcador de runtime: permite `import '@wrrdev/fenix-ui/jsx'` como side-effect import. */
|
|
16
|
+
export declare const FX_JSX_TYPES: true;
|
|
17
|
+
export type FxButtonVariant = 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'ghost' | 'outline';
|
|
18
|
+
export type FxBadgeVariant = 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info';
|
|
19
|
+
export type FxAlertVariant = 'info' | 'success' | 'warning' | 'danger';
|
|
20
|
+
export type FxProgressVariant = 'primary' | 'success' | 'warning' | 'danger';
|
|
21
|
+
export type FxSkeletonVariant = 'text' | 'circle' | 'rect';
|
|
22
|
+
export type FxFloatlabelVariant = 'on' | 'in' | 'over';
|
|
23
|
+
export type FxInputType = 'text' | 'number' | 'email' | 'password' | 'search' | 'tel' | 'url';
|
|
24
|
+
export type FxFieldStatus = 'error' | 'invalid' | 'success' | 'valid';
|
|
25
|
+
export type FxToastKind = 'success' | 'error' | 'info' | 'warning';
|
|
26
|
+
export type FxToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
27
|
+
export type FxTooltipPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
28
|
+
export type FxDrawerPosition = 'left' | 'right' | 'top' | 'bottom';
|
|
29
|
+
export type FxDropdownPosition = 'left' | 'center' | 'right' | 'bottom-left' | 'bottom-right';
|
|
30
|
+
export type FxPaginationPosition = 'left' | 'center' | 'right';
|
|
31
|
+
export interface FxButtonProps extends FxElementProps {
|
|
32
|
+
variant?: FxButtonVariant;
|
|
33
|
+
type?: 'button' | 'submit' | 'reset';
|
|
34
|
+
size?: FxSize;
|
|
35
|
+
loading?: boolean;
|
|
36
|
+
full?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface FxBadgeProps extends FxElementProps {
|
|
39
|
+
variant?: FxBadgeVariant;
|
|
40
|
+
round?: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface FxSpinnerProps extends FxElementProps {
|
|
43
|
+
size?: FxSize;
|
|
44
|
+
}
|
|
45
|
+
export interface FxInputProps extends FxElementProps {
|
|
46
|
+
type?: FxInputType;
|
|
47
|
+
size?: FxSize;
|
|
48
|
+
placeholder?: string;
|
|
49
|
+
readonly?: boolean;
|
|
50
|
+
min?: string | number;
|
|
51
|
+
max?: string | number;
|
|
52
|
+
step?: string | number;
|
|
53
|
+
clearable?: boolean;
|
|
54
|
+
error?: boolean;
|
|
55
|
+
invalid?: boolean;
|
|
56
|
+
success?: boolean;
|
|
57
|
+
valid?: boolean;
|
|
58
|
+
}
|
|
59
|
+
export interface FxSelectProps extends FxElementProps {
|
|
60
|
+
value?: string;
|
|
61
|
+
size?: FxSize;
|
|
62
|
+
placeholder?: string;
|
|
63
|
+
searchable?: boolean;
|
|
64
|
+
clearable?: boolean;
|
|
65
|
+
'search-placeholder'?: string;
|
|
66
|
+
'no-results'?: string;
|
|
67
|
+
error?: boolean;
|
|
68
|
+
invalid?: boolean;
|
|
69
|
+
success?: boolean;
|
|
70
|
+
valid?: boolean;
|
|
71
|
+
}
|
|
72
|
+
export interface FxSwitchProps extends FxElementProps {
|
|
73
|
+
checked?: boolean;
|
|
74
|
+
size?: FxSize;
|
|
75
|
+
}
|
|
76
|
+
export interface FxCheckboxProps extends FxElementProps {
|
|
77
|
+
checked?: boolean;
|
|
78
|
+
indeterminate?: boolean;
|
|
79
|
+
value?: string;
|
|
80
|
+
size?: FxSize;
|
|
81
|
+
}
|
|
82
|
+
export interface FxRadioProps extends FxElementProps {
|
|
83
|
+
checked?: boolean;
|
|
84
|
+
value?: string;
|
|
85
|
+
name?: string;
|
|
86
|
+
size?: FxSize;
|
|
87
|
+
}
|
|
88
|
+
export interface FxTextareaProps extends FxElementProps {
|
|
89
|
+
value?: string;
|
|
90
|
+
size?: FxSize;
|
|
91
|
+
placeholder?: string;
|
|
92
|
+
readonly?: boolean;
|
|
93
|
+
rows?: number;
|
|
94
|
+
maxlength?: number;
|
|
95
|
+
error?: boolean;
|
|
96
|
+
invalid?: boolean;
|
|
97
|
+
success?: boolean;
|
|
98
|
+
valid?: boolean;
|
|
99
|
+
}
|
|
100
|
+
export interface FxMultiselectProps extends FxElementProps {
|
|
101
|
+
values?: string;
|
|
102
|
+
size?: FxSize;
|
|
103
|
+
placeholder?: string;
|
|
104
|
+
searchable?: boolean;
|
|
105
|
+
clearable?: boolean;
|
|
106
|
+
open?: boolean;
|
|
107
|
+
error?: boolean;
|
|
108
|
+
invalid?: boolean;
|
|
109
|
+
success?: boolean;
|
|
110
|
+
valid?: boolean;
|
|
111
|
+
}
|
|
112
|
+
export interface FxCalendarProps extends FxElementProps {
|
|
113
|
+
value?: string;
|
|
114
|
+
start?: string;
|
|
115
|
+
end?: string;
|
|
116
|
+
min?: string;
|
|
117
|
+
max?: string;
|
|
118
|
+
mode?: 'single' | 'range' | 'multiple';
|
|
119
|
+
values?: string;
|
|
120
|
+
locale?: string;
|
|
121
|
+
disabled?: boolean;
|
|
122
|
+
}
|
|
123
|
+
export interface FxDatepickerProps extends FxElementProps {
|
|
124
|
+
value?: string;
|
|
125
|
+
start?: string;
|
|
126
|
+
end?: string;
|
|
127
|
+
values?: string;
|
|
128
|
+
mode?: 'single' | 'range' | 'multiple';
|
|
129
|
+
min?: string;
|
|
130
|
+
max?: string;
|
|
131
|
+
placeholder?: string;
|
|
132
|
+
size?: FxSize;
|
|
133
|
+
format?: string;
|
|
134
|
+
'show-time'?: boolean;
|
|
135
|
+
'free-text'?: boolean;
|
|
136
|
+
clearable?: boolean;
|
|
137
|
+
error?: boolean;
|
|
138
|
+
invalid?: boolean;
|
|
139
|
+
success?: boolean;
|
|
140
|
+
valid?: boolean;
|
|
141
|
+
}
|
|
142
|
+
export interface FxTableProps extends FxElementProps {
|
|
143
|
+
pagination?: boolean;
|
|
144
|
+
rows?: number;
|
|
145
|
+
'rows-options'?: string;
|
|
146
|
+
striped?: boolean;
|
|
147
|
+
'empty-message'?: string;
|
|
148
|
+
'pagination-position'?: FxPaginationPosition;
|
|
149
|
+
total?: number;
|
|
150
|
+
page?: number;
|
|
151
|
+
}
|
|
152
|
+
export interface FxFloatlabelProps extends FxElementProps {
|
|
153
|
+
variant?: FxFloatlabelVariant;
|
|
154
|
+
error?: boolean;
|
|
155
|
+
invalid?: boolean;
|
|
156
|
+
success?: boolean;
|
|
157
|
+
valid?: boolean;
|
|
158
|
+
active?: boolean;
|
|
159
|
+
'error-text'?: string;
|
|
160
|
+
}
|
|
161
|
+
export interface FxDialogProps extends FxElementProps {
|
|
162
|
+
open?: boolean;
|
|
163
|
+
size?: FxSize;
|
|
164
|
+
heading?: string;
|
|
165
|
+
}
|
|
166
|
+
export interface FxDrawerProps extends FxElementProps {
|
|
167
|
+
open?: boolean;
|
|
168
|
+
title?: string;
|
|
169
|
+
position?: FxDrawerPosition;
|
|
170
|
+
}
|
|
171
|
+
export interface FxToastProps extends FxElementProps {
|
|
172
|
+
kind?: FxToastKind;
|
|
173
|
+
title?: string;
|
|
174
|
+
message?: string;
|
|
175
|
+
duration?: number;
|
|
176
|
+
position?: FxToastPosition;
|
|
177
|
+
}
|
|
178
|
+
export interface FxTooltipProps extends FxElementProps {
|
|
179
|
+
content?: string;
|
|
180
|
+
position?: FxTooltipPosition;
|
|
181
|
+
}
|
|
182
|
+
export interface FxTabsProps extends FxElementProps {
|
|
183
|
+
value?: string;
|
|
184
|
+
}
|
|
185
|
+
export interface FxTabPanelProps extends FxElementProps {
|
|
186
|
+
tab?: string;
|
|
187
|
+
hidden?: boolean;
|
|
188
|
+
}
|
|
189
|
+
export interface FxProgressProps extends FxElementProps {
|
|
190
|
+
value?: number;
|
|
191
|
+
indeterminate?: boolean;
|
|
192
|
+
variant?: FxProgressVariant;
|
|
193
|
+
label?: string;
|
|
194
|
+
'hide-label'?: boolean;
|
|
195
|
+
size?: FxSize;
|
|
196
|
+
}
|
|
197
|
+
export interface FxSkeletonProps extends FxElementProps {
|
|
198
|
+
variant?: FxSkeletonVariant;
|
|
199
|
+
width?: string;
|
|
200
|
+
height?: string;
|
|
201
|
+
lines?: number;
|
|
202
|
+
}
|
|
203
|
+
export interface FxAlertProps extends FxElementProps {
|
|
204
|
+
variant?: FxAlertVariant;
|
|
205
|
+
title?: string;
|
|
206
|
+
dismissible?: boolean;
|
|
207
|
+
}
|
|
208
|
+
export interface FxDropdownProps extends FxElementProps {
|
|
209
|
+
label?: string;
|
|
210
|
+
position?: FxDropdownPosition;
|
|
211
|
+
open?: boolean;
|
|
212
|
+
}
|
|
213
|
+
export interface FxDropdownItemProps extends FxElementProps {
|
|
214
|
+
value?: string;
|
|
215
|
+
}
|
|
216
|
+
export interface FxPaginationProps extends FxElementProps {
|
|
217
|
+
page?: number;
|
|
218
|
+
total?: number;
|
|
219
|
+
rows?: number;
|
|
220
|
+
'rows-options'?: string;
|
|
221
|
+
position?: FxPaginationPosition;
|
|
222
|
+
}
|
|
223
|
+
export interface FxAutocompleteProps extends FxElementProps {
|
|
224
|
+
value?: string;
|
|
225
|
+
size?: FxSize;
|
|
226
|
+
placeholder?: string;
|
|
227
|
+
source?: string;
|
|
228
|
+
disabled?: boolean;
|
|
229
|
+
'min-chars'?: number;
|
|
230
|
+
}
|
|
231
|
+
declare global {
|
|
232
|
+
namespace JSX {
|
|
233
|
+
interface IntrinsicElements {
|
|
234
|
+
'fx-button': FxButtonProps;
|
|
235
|
+
'fx-badge': FxBadgeProps;
|
|
236
|
+
'fx-spinner': FxSpinnerProps;
|
|
237
|
+
'fx-input': FxInputProps;
|
|
238
|
+
'fx-select': FxSelectProps;
|
|
239
|
+
'fx-switch': FxSwitchProps;
|
|
240
|
+
'fx-checkbox': FxCheckboxProps;
|
|
241
|
+
'fx-radio': FxRadioProps;
|
|
242
|
+
'fx-textarea': FxTextareaProps;
|
|
243
|
+
'fx-multiselect': FxMultiselectProps;
|
|
244
|
+
'fx-calendar': FxCalendarProps;
|
|
245
|
+
'fx-datepicker': FxDatepickerProps;
|
|
246
|
+
'fx-table': FxTableProps;
|
|
247
|
+
'fx-floatlabel': FxFloatlabelProps;
|
|
248
|
+
'fx-dialog': FxDialogProps;
|
|
249
|
+
'fx-drawer': FxDrawerProps;
|
|
250
|
+
'fx-toast': FxToastProps;
|
|
251
|
+
'fx-tooltip': FxTooltipProps;
|
|
252
|
+
'fx-tabs': FxTabsProps;
|
|
253
|
+
'fx-tab-panel': FxTabPanelProps;
|
|
254
|
+
'fx-progress': FxProgressProps;
|
|
255
|
+
'fx-skeleton': FxSkeletonProps;
|
|
256
|
+
'fx-alert': FxAlertProps;
|
|
257
|
+
'fx-dropdown': FxDropdownProps;
|
|
258
|
+
'fx-dropdown-item': FxDropdownItemProps;
|
|
259
|
+
'fx-pagination': FxPaginationProps;
|
|
260
|
+
'fx-autocomplete': FxAutocompleteProps;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
declare global {
|
|
265
|
+
interface HTMLElementTagNameMap {
|
|
266
|
+
'fx-button': HTMLElement;
|
|
267
|
+
'fx-badge': HTMLElement;
|
|
268
|
+
'fx-spinner': HTMLElement;
|
|
269
|
+
'fx-input': HTMLElement;
|
|
270
|
+
'fx-select': HTMLElement;
|
|
271
|
+
'fx-switch': HTMLElement;
|
|
272
|
+
'fx-checkbox': HTMLElement;
|
|
273
|
+
'fx-radio': HTMLElement;
|
|
274
|
+
'fx-multiselect': HTMLElement;
|
|
275
|
+
'fx-calendar': HTMLElement;
|
|
276
|
+
'fx-datepicker': HTMLElement;
|
|
277
|
+
'fx-table': HTMLElement;
|
|
278
|
+
'fx-floatlabel': HTMLElement;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
//# sourceMappingURL=jsx.d.ts.map
|
|
@@ -0,0 +1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YAAY,CAAC;YACzB,YAAY,EAAE,cAAc,CAAC;YAC7B,SAAS,EAAE,WAAW,CAAC;YACvB,cAAc,EAAE,eAAe,CAAC;YAChC,aAAa,EAAE,eAAe,CAAC;YAC/B,aAAa,EAAE,eAAe,CAAC;YAC/B,UAAU,EAAE,YAAY,CAAC;YACzB,aAAa,EAAE,eAAe,CAAC;YAC/B,kBAAkB,EAAE,mBAAmB,CAAC;YACxC,eAAe,EAAE,iBAAiB,CAAC;YACnC,iBAAiB,EAAE,mBAAmB,CAAC;SACxC;KACF;CACF;AAOD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,WAAW,CAAC;QACzB,UAAU,EAAE,WAAW,CAAC;QACxB,YAAY,EAAE,WAAW,CAAC;QAC1B,UAAU,EAAE,WAAW,CAAC;QACxB,WAAW,EAAE,WAAW,CAAC;QACzB,WAAW,EAAE,WAAW,CAAC;QACzB,aAAa,EAAE,WAAW,CAAC;QAC3B,UAAU,EAAE,WAAW,CAAC;QACxB,gBAAgB,EAAE,WAAW,CAAC;QAC9B,aAAa,EAAE,WAAW,CAAC;QAC3B,eAAe,EAAE,WAAW,CAAC;QAC7B,UAAU,EAAE,WAAW,CAAC;QACxB,eAAe,EAAE,WAAW,CAAC;KAC9B;CACF"}
|
package/dist/core/jsx.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx.js","sources":["../../src/core/jsx.ts"],"sourcesContent":["/**\r\n * Tipagens de propriedades + augmentations JSX do FenixUI.\r\n *\r\n * Importar este módulo — diretamente (`@wrrdev/fenix-ui/jsx`) ou via o\r\n * índice principal (`@wrrdev/fenix-ui`) — habilita, no TypeScript:\r\n *\r\n * 1. autocomplete + validação de atributos em templates JSX/TSX;\r\n * 2. tipos nomeados (`FxButtonProps`, `FxInputProps`, …) para wrappers ou código imperativo.\r\n *\r\n * A biblioteca NÃO depende de React/Vue: os atributos comuns\r\n * (`className`, `onClick`, `style`, `children`, …) são aceitos via assinatura\r\n * de índice, funcionando com qualquer runtime JSX.\r\n */\r\n\r\nimport type { FxElementProps, FxSize } from './types';\r\n\r\n/** Marcador de runtime: permite `import '@wrrdev/fenix-ui/jsx'` como side-effect import. */\r\nexport const FX_JSX_TYPES = true as const;\r\n\r\n/* Uniões auxiliares (variants, enums) */\r\nexport type FxButtonVariant = 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'ghost' | 'outline';\r\nexport type FxBadgeVariant = 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info';\r\nexport type FxAlertVariant = 'info' | 'success' | 'warning' | 'danger';\r\nexport type FxProgressVariant = 'primary' | 'success' | 'warning' | 'danger';\r\nexport type FxSkeletonVariant = 'text' | 'circle' | 'rect';\r\nexport type FxFloatlabelVariant = 'on' | 'in' | 'over';\r\nexport type FxInputType = 'text' | 'number' | 'email' | 'password' | 'search' | 'tel' | 'url';\r\nexport type FxFieldStatus = 'error' | 'invalid' | 'success' | 'valid';\r\nexport type FxToastKind = 'success' | 'error' | 'info' | 'warning';\r\nexport type FxToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';\r\nexport type FxTooltipPosition = 'top' | 'bottom' | 'left' | 'right';\r\nexport type FxDrawerPosition = 'left' | 'right' | 'top' | 'bottom';\r\nexport type FxDropdownPosition = 'left' | 'center' | 'right' | 'bottom-left' | 'bottom-right';\r\nexport type FxPaginationPosition = 'left' | 'center' | 'right';\r\n\r\n/* Props por componente */\r\nexport interface FxButtonProps extends FxElementProps {\r\n variant?: FxButtonVariant;\r\n type?: 'button' | 'submit' | 'reset';\r\n size?: FxSize;\r\n loading?: boolean;\r\n full?: boolean;\r\n}\r\nexport interface FxBadgeProps extends FxElementProps {\r\n variant?: FxBadgeVariant;\r\n round?: boolean;\r\n}\r\nexport interface FxSpinnerProps extends FxElementProps { size?: FxSize; }\r\nexport interface FxInputProps extends FxElementProps {\r\n type?: FxInputType;\r\n size?: FxSize;\r\n placeholder?: string;\r\n readonly?: boolean;\r\n min?: string | number;\r\n max?: string | number;\r\n step?: string | number;\r\n clearable?: boolean;\r\n error?: boolean;\r\n invalid?: boolean;\r\n success?: boolean;\r\n valid?: boolean;\r\n}\r\nexport interface FxSelectProps extends FxElementProps {\r\n value?: string;\r\n size?: FxSize;\r\n placeholder?: string;\r\n searchable?: boolean;\r\n clearable?: boolean;\r\n 'search-placeholder'?: string;\r\n 'no-results'?: string;\r\n error?: boolean;\r\n invalid?: boolean;\r\n success?: boolean;\r\n valid?: boolean;\r\n}\r\nexport interface FxSwitchProps extends FxElementProps { checked?: boolean; size?: FxSize; }\r\nexport interface FxCheckboxProps extends FxElementProps {\r\n checked?: boolean;\r\n indeterminate?: boolean;\r\n value?: string;\r\n size?: FxSize;\r\n}\r\nexport interface FxRadioProps extends FxElementProps {\r\n checked?: boolean;\r\n value?: string;\r\n name?: string;\r\n size?: FxSize;\r\n}\r\nexport interface FxTextareaProps extends FxElementProps {\r\n value?: string;\r\n size?: FxSize;\r\n placeholder?: string;\r\n readonly?: boolean;\r\n rows?: number;\r\n maxlength?: number;\r\n error?: boolean;\r\n invalid?: boolean;\r\n success?: boolean;\r\n valid?: boolean;\r\n}\r\nexport interface FxMultiselectProps extends FxElementProps {\r\n values?: string;\r\n size?: FxSize;\r\n placeholder?: string;\r\n searchable?: boolean;\r\n clearable?: boolean;\r\n open?: boolean;\r\n error?: boolean;\r\n invalid?: boolean;\r\n success?: boolean;\r\n valid?: boolean;\r\n}\r\nexport interface FxCalendarProps extends FxElementProps {\r\n value?: string;\r\n start?: string;\r\n end?: string;\r\n min?: string;\r\n max?: string;\r\n mode?: 'single' | 'range' | 'multiple';\r\n values?: string;\r\n locale?: string;\r\n disabled?: boolean;\r\n}\r\nexport interface FxDatepickerProps extends FxElementProps {\r\n value?: string;\r\n start?: string;\r\n end?: string;\r\n values?: string;\r\n mode?: 'single' | 'range' | 'multiple';\r\n min?: string;\r\n max?: string;\r\n placeholder?: string;\r\n size?: FxSize;\r\n format?: string;\r\n 'show-time'?: boolean;\r\n 'free-text'?: boolean;\r\n clearable?: boolean;\r\n error?: boolean;\r\n invalid?: boolean;\r\n success?: boolean;\r\n valid?: boolean;\r\n}\r\nexport interface FxTableProps extends FxElementProps {\r\n pagination?: boolean;\r\n rows?: number;\r\n 'rows-options'?: string;\r\n striped?: boolean;\r\n 'empty-message'?: string;\r\n 'pagination-position'?: FxPaginationPosition;\r\n total?: number;\r\n page?: number;\r\n}\r\nexport interface FxFloatlabelProps extends FxElementProps {\r\n variant?: FxFloatlabelVariant;\r\n error?: boolean;\r\n invalid?: boolean;\r\n success?: boolean;\r\n valid?: boolean;\r\n active?: boolean;\r\n 'error-text'?: string;\r\n}\r\nexport interface FxDialogProps extends FxElementProps { open?: boolean; size?: FxSize; heading?: string; }\r\nexport interface FxDrawerProps extends FxElementProps { open?: boolean; title?: string; position?: FxDrawerPosition; }\r\nexport interface FxToastProps extends FxElementProps {\r\n kind?: FxToastKind;\r\n title?: string;\r\n message?: string;\r\n duration?: number;\r\n position?: FxToastPosition;\r\n}\r\nexport interface FxTooltipProps extends FxElementProps { content?: string; position?: FxTooltipPosition; }\r\nexport interface FxTabsProps extends FxElementProps { value?: string; }\r\nexport interface FxTabPanelProps extends FxElementProps { tab?: string; hidden?: boolean; }\r\nexport interface FxProgressProps extends FxElementProps {\r\n value?: number;\r\n indeterminate?: boolean;\r\n variant?: FxProgressVariant;\r\n label?: string;\r\n 'hide-label'?: boolean;\r\n size?: FxSize;\r\n}\r\nexport interface FxSkeletonProps extends FxElementProps {\r\n variant?: FxSkeletonVariant;\r\n width?: string;\r\n height?: string;\r\n lines?: number;\r\n}\r\nexport interface FxAlertProps extends FxElementProps { variant?: FxAlertVariant; title?: string; dismissible?: boolean; }\r\nexport interface FxDropdownProps extends FxElementProps { label?: string; position?: FxDropdownPosition; open?: boolean; }\r\nexport interface FxDropdownItemProps extends FxElementProps { value?: string; }\r\nexport interface FxPaginationProps extends FxElementProps {\r\n page?: number;\r\n total?: number;\r\n rows?: number;\r\n 'rows-options'?: string;\r\n position?: FxPaginationPosition;\r\n}\r\nexport interface FxAutocompleteProps extends FxElementProps {\r\n value?: string;\r\n size?: FxSize;\r\n placeholder?: string;\r\n source?: string;\r\n disabled?: boolean;\r\n 'min-chars'?: number;\r\n}\r\n/* Augmentation global de JSX (React/TSX, Preact, Vue JSX, …).\r\n Cada tag fx-* recebe autocomplete + validação de atributos. */\r\ndeclare global {\r\n namespace JSX {\r\n interface IntrinsicElements {\r\n 'fx-button': FxButtonProps;\r\n 'fx-badge': FxBadgeProps;\r\n 'fx-spinner': FxSpinnerProps;\r\n 'fx-input': FxInputProps;\r\n 'fx-select': FxSelectProps;\r\n 'fx-switch': FxSwitchProps;\r\n 'fx-checkbox': FxCheckboxProps;\r\n 'fx-radio': FxRadioProps;\r\n 'fx-textarea': FxTextareaProps;\r\n 'fx-multiselect': FxMultiselectProps;\r\n 'fx-calendar': FxCalendarProps;\r\n 'fx-datepicker': FxDatepickerProps;\r\n 'fx-table': FxTableProps;\r\n 'fx-floatlabel': FxFloatlabelProps;\r\n 'fx-dialog': FxDialogProps;\r\n 'fx-drawer': FxDrawerProps;\r\n 'fx-toast': FxToastProps;\r\n 'fx-tooltip': FxTooltipProps;\r\n 'fx-tabs': FxTabsProps;\r\n 'fx-tab-panel': FxTabPanelProps;\r\n 'fx-progress': FxProgressProps;\r\n 'fx-skeleton': FxSkeletonProps;\r\n 'fx-alert': FxAlertProps;\r\n 'fx-dropdown': FxDropdownProps;\r\n 'fx-dropdown-item': FxDropdownItemProps;\r\n 'fx-pagination': FxPaginationProps;\r\n 'fx-autocomplete': FxAutocompleteProps;\r\n }\r\n }\r\n}\r\n\r\n/* Tipagem imperativa: document.createElement('fx-...').\r\n As tags abaixo não declaradas nos próprios componentes ganham tipagem aqui;\r\n as demais (alert, dialog, drawer, dropdown, pagination, progress, skeleton,\r\n tabs, textarea, toast, tooltip, autocomplete) já são tipadas com a classe\r\n concreta nos respectivos index.ts. */\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n 'fx-button': HTMLElement;\r\n 'fx-badge': HTMLElement;\r\n 'fx-spinner': HTMLElement;\r\n 'fx-input': HTMLElement;\r\n 'fx-select': HTMLElement;\r\n 'fx-switch': HTMLElement;\r\n 'fx-checkbox': HTMLElement;\r\n 'fx-radio': HTMLElement;\r\n 'fx-multiselect': HTMLElement;\r\n 'fx-calendar': HTMLElement;\r\n 'fx-datepicker': HTMLElement;\r\n 'fx-table': HTMLElement;\r\n 'fx-floatlabel': HTMLElement;\r\n }\r\n}\r\n"],"names":[],"mappings":"AAiBO,MAAM,eAAe;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tipos e unions compartilhados do FenixUI.
|
|
3
|
+
*
|
|
4
|
+
* Estes tipos existem apenas em tempo de compilação — não geram código
|
|
5
|
+
* em runtime. São reexportados pelo índice principal
|
|
6
|
+
* (`import type { FxSize } from '@wrrdev/fenix-ui'`).
|
|
7
|
+
*/
|
|
8
|
+
/** Tema de cor suportado. */
|
|
9
|
+
export type FxTheme = 'light' | 'dark';
|
|
10
|
+
/** Tamanhos de controle suportados pela maioria dos componentes. */
|
|
11
|
+
export type FxSize = 'sm' | 'md' | 'lg';
|
|
12
|
+
/**
|
|
13
|
+
* Base de atributos comuns a praticamente todos os componentes FenixUI
|
|
14
|
+
* expostos via JSX/HTML.
|
|
15
|
+
*
|
|
16
|
+
* Possui uma assinatura de índice (`[key: string]: unknown`) para que
|
|
17
|
+
* atributos e eventos arbitrários — `className`, `onClick`, `style`, … —
|
|
18
|
+
* sejam aceitos sem erro em frameworks JSX (React/Preact/Vue), sem acoplar
|
|
19
|
+
* a biblioteca a nenhum deles. As propriedades explícitas abaixo são as que
|
|
20
|
+
* recebem autocomplete e validação.
|
|
21
|
+
*/
|
|
22
|
+
export interface FxElementProps {
|
|
23
|
+
/** Estado desativado (equivalente ao atributo `disabled`). */
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
/** Estado de carregamento (spinner) — onde aplicável. */
|
|
26
|
+
loading?: boolean;
|
|
27
|
+
/** Largura total (equivalente ao atributo `full`, onde aplicável). */
|
|
28
|
+
full?: boolean;
|
|
29
|
+
/** Texto/label do controle. */
|
|
30
|
+
label?: string;
|
|
31
|
+
/** Texto de apoio/placeholder. */
|
|
32
|
+
placeholder?: string;
|
|
33
|
+
/** Valor do controle (string ou número). */
|
|
34
|
+
value?: string | number;
|
|
35
|
+
/** Conteúdo do slot (equivalente a `children` em React). */
|
|
36
|
+
children?: unknown;
|
|
37
|
+
/** Classes CSS externas (React) — via índice também aceita `class`. */
|
|
38
|
+
className?: string;
|
|
39
|
+
/** Estilos inline. */
|
|
40
|
+
style?: string | Record<string, unknown>;
|
|
41
|
+
/** Atributos/eventos arbitrários são aceitos via índice. */
|
|
42
|
+
[key: string]: unknown;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,6BAA6B;AAC7B,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAEvC,oEAAoE;AACpE,MAAM,MAAM,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAExC;;;;;;;;;GASG;AACH,MAAM,WAAW,cAAc;IAC7B,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yDAAyD;IACzD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,sEAAsE;IACtE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,4DAA4D;IAC5D,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB"}
|
package/dist/fenix-ui.esm.js
CHANGED
|
@@ -266,6 +266,7 @@ function defineElement(tag, ctor) {
|
|
|
266
266
|
}
|
|
267
267
|
return customElements.get(tag) ?? ctor;
|
|
268
268
|
}
|
|
269
|
+
const FX_JSX_TYPES = true;
|
|
269
270
|
const _FxButton = class _FxButton extends FxElement {
|
|
270
271
|
constructor() {
|
|
271
272
|
super(...arguments);
|
|
@@ -4419,6 +4420,7 @@ function defineFxAutocomplete() {
|
|
|
4419
4420
|
}
|
|
4420
4421
|
defineFxAutocomplete();
|
|
4421
4422
|
export {
|
|
4423
|
+
FX_JSX_TYPES,
|
|
4422
4424
|
FenixToast,
|
|
4423
4425
|
FenixUI,
|
|
4424
4426
|
FxAlert,
|