@wrrdev/fenix-ui 1.0.4 → 1.0.6

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 CHANGED
@@ -18,8 +18,8 @@ import { FenixUI } from '@wrrdev/fenix-ui'; // API de tema/tokens (índice)
18
18
  FenixUI.theme('dark');
19
19
  ```
20
20
 
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/*`.
21
+ > 📦 npm: [`@wrrdev/fenix-ui`](https://www.npmjs.com/package/@wrrdev/fenix-ui) — **v1.0.6**, 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
23
 
24
24
 
25
25
  ## Consumo
@@ -65,7 +65,7 @@ Carregue o bundle **UMD** único: ele registra todos os componentes e expõe os
65
65
  <fx-toast></fx-toast>
66
66
 
67
67
  <!--
68
- 🔗 Links diretos para CDN (versão 1.0.4):
68
+ 🔗 Links diretos para CDN (versão 1.0.6):
69
69
  • https://cdn.jsdelivr.net/npm/@wrrdev/fenix-ui@latest/dist/fenix-ui.umd.min.js
70
70
  • https://unpkg.com/@wrrdev/fenix-ui@latest/dist/fenix-ui.umd.min.js
71
71
  -->
@@ -165,6 +165,30 @@ FenixUI.resetTheme();
165
165
  Os tokens viram CSS Custom Properties (`--fx-color-primary`, `--fx-radius-md`, …) no `:root`,
166
166
  atravessando o Shadow DOM. Todo componente reage automaticamente.
167
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
+
168
192
  ### Presets prontos (temas padrão)
169
193
 
170
194
  O FenixUI já vem com temas prontos — **não é preciso definir nada**. Basta aplicar:
@@ -225,6 +249,36 @@ import '@wrrdev/fenix-ui'; // registra componentes + habilita as tipagens JSX
225
249
  Se o autocomplete ainda não aparecer, garanta que o `tsconfig` do seu projeto tem
226
250
  `"moduleResolution": "bundler"` (ou `"node16"`/`"nodenext"`) para resolver os `exports` do pacote.
227
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
+
228
282
  ## Componentes (fase 1)
229
283
 
230
284
  | Elemento | Atributos principais | Slots |
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Tipagem de componentes <fx-*> para Vue 3 (Volar / vue-tsc).
3
+ *
4
+ * Este módulo é OPT-IN: importe `@wrrdev/fenix-ui/vue` uma única vez
5
+ * (ex.: no `main.ts`) para habilitar autocomplete + validação de atributos
6
+ * dos elementos `fx-*` nos templates SFC.
7
+ *
8
+ * - `IntrinsicElementAttributes` (Vue 3.5+): ponto oficial de extensão para
9
+ * elementos nativos/custom — alimenta `NativeElements` e o
10
+ * `JSX.IntrinsicElements` usado pelo Volar para tags com hífen.
11
+ * - `GlobalComponents`: registro adicional como componentes globais.
12
+ */
13
+ import type { FxAutocompleteProps, FxAlertProps, FxBadgeProps, FxButtonProps, FxCalendarProps, FxCheckboxProps, FxDatepickerProps, FxDialogProps, FxDropdownItemProps, FxDropdownProps, FxDrawerProps, FxFloatlabelProps, FxInputProps, FxMultiselectProps, FxPaginationProps, FxProgressProps, FxRadioProps, FxSelectProps, FxSkeletonProps, FxSpinnerProps, FxSwitchProps, FxTableProps, FxTabPanelProps, FxTabsProps, FxTextareaProps, FxToastProps, FxTooltipProps } from './jsx';
14
+ type FxComp<P> = import('vue').FunctionalComponent<P>;
15
+ declare module '@vue/runtime-core' {
16
+ interface GlobalComponents {
17
+ 'fx-button': FxComp<FxButtonProps>;
18
+ 'fx-badge': FxComp<FxBadgeProps>;
19
+ 'fx-spinner': FxComp<FxSpinnerProps>;
20
+ 'fx-input': FxComp<FxInputProps>;
21
+ 'fx-select': FxComp<FxSelectProps>;
22
+ 'fx-switch': FxComp<FxSwitchProps>;
23
+ 'fx-checkbox': FxComp<FxCheckboxProps>;
24
+ 'fx-radio': FxComp<FxRadioProps>;
25
+ 'fx-textarea': FxComp<FxTextareaProps>;
26
+ 'fx-multiselect': FxComp<FxMultiselectProps>;
27
+ 'fx-calendar': FxComp<FxCalendarProps>;
28
+ 'fx-datepicker': FxComp<FxDatepickerProps>;
29
+ 'fx-table': FxComp<FxTableProps>;
30
+ 'fx-floatlabel': FxComp<FxFloatlabelProps>;
31
+ 'fx-dialog': FxComp<FxDialogProps>;
32
+ 'fx-drawer': FxComp<FxDrawerProps>;
33
+ 'fx-toast': FxComp<FxToastProps>;
34
+ 'fx-tooltip': FxComp<FxTooltipProps>;
35
+ 'fx-tabs': FxComp<FxTabsProps>;
36
+ 'fx-tab-panel': FxComp<FxTabPanelProps>;
37
+ 'fx-progress': FxComp<FxProgressProps>;
38
+ 'fx-skeleton': FxComp<FxSkeletonProps>;
39
+ 'fx-alert': FxComp<FxAlertProps>;
40
+ 'fx-dropdown': FxComp<FxDropdownProps>;
41
+ 'fx-dropdown-item': FxComp<FxDropdownItemProps>;
42
+ 'fx-pagination': FxComp<FxPaginationProps>;
43
+ 'fx-autocomplete': FxComp<FxAutocompleteProps>;
44
+ }
45
+ }
46
+ declare module '@vue/runtime-dom' {
47
+ interface IntrinsicElementAttributes {
48
+ 'fx-button': FxButtonProps;
49
+ 'fx-badge': FxBadgeProps;
50
+ 'fx-spinner': FxSpinnerProps;
51
+ 'fx-input': FxInputProps;
52
+ 'fx-select': FxSelectProps;
53
+ 'fx-switch': FxSwitchProps;
54
+ 'fx-checkbox': FxCheckboxProps;
55
+ 'fx-radio': FxRadioProps;
56
+ 'fx-textarea': FxTextareaProps;
57
+ 'fx-multiselect': FxMultiselectProps;
58
+ 'fx-calendar': FxCalendarProps;
59
+ 'fx-datepicker': FxDatepickerProps;
60
+ 'fx-table': FxTableProps;
61
+ 'fx-floatlabel': FxFloatlabelProps;
62
+ 'fx-dialog': FxDialogProps;
63
+ 'fx-drawer': FxDrawerProps;
64
+ 'fx-toast': FxToastProps;
65
+ 'fx-tooltip': FxTooltipProps;
66
+ 'fx-tabs': FxTabsProps;
67
+ 'fx-tab-panel': FxTabPanelProps;
68
+ 'fx-progress': FxProgressProps;
69
+ 'fx-skeleton': FxSkeletonProps;
70
+ 'fx-alert': FxAlertProps;
71
+ 'fx-dropdown': FxDropdownProps;
72
+ 'fx-dropdown-item': FxDropdownItemProps;
73
+ 'fx-pagination': FxPaginationProps;
74
+ 'fx-autocomplete': FxAutocompleteProps;
75
+ }
76
+ }
77
+ /** Marcador para `import '@wrrdev/fenix-ui/vue'` funcionar como side-effect import. */
78
+ export declare const FX_VUE_TYPES: true;
79
+ export {};
80
+ //# sourceMappingURL=vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vue.d.ts","sourceRoot":"","sources":["../../src/core/vue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,aAAa,EACb,eAAe,EACf,cAAc,EACd,aAAa,EACb,YAAY,EACZ,eAAe,EACf,WAAW,EACX,eAAe,EACf,YAAY,EACZ,cAAc,EACf,MAAM,OAAO,CAAC;AAIf,KAAK,MAAM,CAAC,CAAC,IAAI,O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
3
+ FX_VUE_TYPES
4
+ };
5
+ //# sourceMappingURL=vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vue.js","sources":["../../src/core/vue.ts"],"sourcesContent":["/**\n * Tipagem de componentes <fx-*> para Vue 3 (Volar / vue-tsc).\n *\n * Este módulo é OPT-IN: importe `@wrrdev/fenix-ui/vue` uma única vez\n * (ex.: no `main.ts`) para habilitar autocomplete + validação de atributos\n * dos elementos `fx-*` nos templates SFC.\n *\n * - `IntrinsicElementAttributes` (Vue 3.5+): ponto oficial de extensão para\n * elementos nativos/custom — alimenta `NativeElements` e o\n * `JSX.IntrinsicElements` usado pelo Volar para tags com hífen.\n * - `GlobalComponents`: registro adicional como componentes globais.\n */\nimport type {\n FxAutocompleteProps,\n FxAlertProps,\n FxBadgeProps,\n FxButtonProps,\n FxCalendarProps,\n FxCheckboxProps,\n FxDatepickerProps,\n FxDialogProps,\n FxDropdownItemProps,\n FxDropdownProps,\n FxDrawerProps,\n FxFloatlabelProps,\n FxInputProps,\n FxMultiselectProps,\n FxPaginationProps,\n FxProgressProps,\n FxRadioProps,\n FxSelectProps,\n FxSkeletonProps,\n FxSpinnerProps,\n FxSwitchProps,\n FxTableProps,\n FxTabPanelProps,\n FxTabsProps,\n FxTextareaProps,\n FxToastProps,\n FxTooltipProps,\n} from './jsx';\n\nimport type {} from '@vue/runtime-dom';\r\n\r\ntype FxComp<P> = import('vue').FunctionalComponent<P>;\n\ndeclare module '@vue/runtime-core' {\r\n interface GlobalComponents {\r\n 'fx-button': FxComp<FxButtonProps>;\r\n 'fx-badge': FxComp<FxBadgeProps>;\r\n 'fx-spinner': FxComp<FxSpinnerProps>;\r\n 'fx-input': FxComp<FxInputProps>;\r\n 'fx-select': FxComp<FxSelectProps>;\r\n 'fx-switch': FxComp<FxSwitchProps>;\r\n 'fx-checkbox': FxComp<FxCheckboxProps>;\r\n 'fx-radio': FxComp<FxRadioProps>;\r\n 'fx-textarea': FxComp<FxTextareaProps>;\r\n 'fx-multiselect': FxComp<FxMultiselectProps>;\r\n 'fx-calendar': FxComp<FxCalendarProps>;\r\n 'fx-datepicker': FxComp<FxDatepickerProps>;\r\n 'fx-table': FxComp<FxTableProps>;\r\n 'fx-floatlabel': FxComp<FxFloatlabelProps>;\r\n 'fx-dialog': FxComp<FxDialogProps>;\r\n 'fx-drawer': FxComp<FxDrawerProps>;\r\n 'fx-toast': FxComp<FxToastProps>;\r\n 'fx-tooltip': FxComp<FxTooltipProps>;\r\n 'fx-tabs': FxComp<FxTabsProps>;\r\n 'fx-tab-panel': FxComp<FxTabPanelProps>;\r\n 'fx-progress': FxComp<FxProgressProps>;\r\n 'fx-skeleton': FxComp<FxSkeletonProps>;\r\n 'fx-alert': FxComp<FxAlertProps>;\r\n 'fx-dropdown': FxComp<FxDropdownProps>;\r\n 'fx-dropdown-item': FxComp<FxDropdownItemProps>;\r\n 'fx-pagination': FxComp<FxPaginationProps>;\r\n 'fx-autocomplete': FxComp<FxAutocompleteProps>;\r\n }\r\n}\r\n\r\ndeclare module '@vue/runtime-dom' {\n interface IntrinsicElementAttributes {\n 'fx-button': FxButtonProps;\n 'fx-badge': FxBadgeProps;\n 'fx-spinner': FxSpinnerProps;\n 'fx-input': FxInputProps;\n 'fx-select': FxSelectProps;\n 'fx-switch': FxSwitchProps;\n 'fx-checkbox': FxCheckboxProps;\n 'fx-radio': FxRadioProps;\n 'fx-textarea': FxTextareaProps;\n 'fx-multiselect': FxMultiselectProps;\n 'fx-calendar': FxCalendarProps;\n 'fx-datepicker': FxDatepickerProps;\n 'fx-table': FxTableProps;\n 'fx-floatlabel': FxFloatlabelProps;\n 'fx-dialog': FxDialogProps;\n 'fx-drawer': FxDrawerProps;\n 'fx-toast': FxToastProps;\n 'fx-tooltip': FxTooltipProps;\n 'fx-tabs': FxTabsProps;\n 'fx-tab-panel': FxTabPanelProps;\n 'fx-progress': FxProgressProps;\n 'fx-skeleton': FxSkeletonProps;\n 'fx-alert': FxAlertProps;\n 'fx-dropdown': FxDropdownProps;\n 'fx-dropdown-item': FxDropdownItemProps;\n 'fx-pagination': FxPaginationProps;\n 'fx-autocomplete': FxAutocompleteProps;\n }\n}\n\n/** Marcador para `import '@wrrdev/fenix-ui/vue'` funcionar como side-effect import. */\nexport const FX_VUE_TYPES = true as const;\n\n"],"names":[],"mappings":"AA+GO,MAAM,eAAe;"}