@wrrdev/fenix-ui 1.0.17 → 1.1.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 (226) hide show
  1. package/README.md +2 -2
  2. package/dist/_virtual/preload-helper.js +68 -0
  3. package/dist/_virtual/preload-helper.js.map +1 -0
  4. package/dist/assets/base-css-BifSeW2H.js +31 -0
  5. package/dist/assets/base-css-BifSeW2H.js.map +1 -0
  6. package/dist/components/alert/alert.d.ts +2 -1
  7. package/dist/components/alert/alert.d.ts.map +1 -1
  8. package/dist/components/alert/alert.js +10 -2
  9. package/dist/components/alert/alert.js.map +1 -1
  10. package/dist/components/avatar/avatar.d.ts +21 -0
  11. package/dist/components/avatar/avatar.d.ts.map +1 -0
  12. package/dist/components/avatar/avatar.js +91 -0
  13. package/dist/components/avatar/avatar.js.map +1 -0
  14. package/dist/components/avatar/index.d.ts +8 -0
  15. package/dist/components/avatar/index.d.ts.map +1 -0
  16. package/dist/components/avatar/index.js +7 -0
  17. package/dist/components/avatar/index.js.map +1 -0
  18. package/dist/components/breadcrumb/breadcrumb.d.ts +35 -0
  19. package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -0
  20. package/dist/components/breadcrumb/breadcrumb.js +113 -0
  21. package/dist/components/breadcrumb/breadcrumb.js.map +1 -0
  22. package/dist/components/breadcrumb/index.d.ts +8 -0
  23. package/dist/components/breadcrumb/index.d.ts.map +1 -0
  24. package/dist/components/breadcrumb/index.js +7 -0
  25. package/dist/components/breadcrumb/index.js.map +1 -0
  26. package/dist/components/card/card.d.ts +15 -0
  27. package/dist/components/card/card.d.ts.map +1 -0
  28. package/dist/components/card/card.js +80 -0
  29. package/dist/components/card/card.js.map +1 -0
  30. package/dist/components/card/index.d.ts +8 -0
  31. package/dist/components/card/index.d.ts.map +1 -0
  32. package/dist/components/card/index.js +7 -0
  33. package/dist/components/card/index.js.map +1 -0
  34. package/dist/components/carousel/carousel.d.ts +28 -0
  35. package/dist/components/carousel/carousel.d.ts.map +1 -0
  36. package/dist/components/carousel/carousel.js +176 -0
  37. package/dist/components/carousel/carousel.js.map +1 -0
  38. package/dist/components/carousel/index.d.ts +8 -0
  39. package/dist/components/carousel/index.d.ts.map +1 -0
  40. package/dist/components/carousel/index.js +7 -0
  41. package/dist/components/carousel/index.js.map +1 -0
  42. package/dist/components/chip/chip.d.ts +19 -0
  43. package/dist/components/chip/chip.d.ts.map +1 -0
  44. package/dist/components/chip/chip.js +126 -0
  45. package/dist/components/chip/chip.js.map +1 -0
  46. package/dist/components/chip/index.d.ts +8 -0
  47. package/dist/components/chip/index.d.ts.map +1 -0
  48. package/dist/components/chip/index.js +7 -0
  49. package/dist/components/chip/index.js.map +1 -0
  50. package/dist/components/confirmpopup/confirmpopup.d.ts +44 -0
  51. package/dist/components/confirmpopup/confirmpopup.d.ts.map +1 -0
  52. package/dist/components/confirmpopup/confirmpopup.js +233 -0
  53. package/dist/components/confirmpopup/confirmpopup.js.map +1 -0
  54. package/dist/components/confirmpopup/index.d.ts +8 -0
  55. package/dist/components/confirmpopup/index.d.ts.map +1 -0
  56. package/dist/components/confirmpopup/index.js +7 -0
  57. package/dist/components/confirmpopup/index.js.map +1 -0
  58. package/dist/components/empty-state/empty-state.d.ts +14 -0
  59. package/dist/components/empty-state/empty-state.d.ts.map +1 -0
  60. package/dist/components/empty-state/empty-state.js +71 -0
  61. package/dist/components/empty-state/empty-state.js.map +1 -0
  62. package/dist/components/empty-state/index.d.ts +8 -0
  63. package/dist/components/empty-state/index.d.ts.map +1 -0
  64. package/dist/components/empty-state/index.js +7 -0
  65. package/dist/components/empty-state/index.js.map +1 -0
  66. package/dist/components/fileupload/fileupload.d.ts +42 -0
  67. package/dist/components/fileupload/fileupload.d.ts.map +1 -0
  68. package/dist/components/fileupload/fileupload.js +284 -0
  69. package/dist/components/fileupload/fileupload.js.map +1 -0
  70. package/dist/components/fileupload/index.d.ts +8 -0
  71. package/dist/components/fileupload/index.d.ts.map +1 -0
  72. package/dist/components/fileupload/index.js +7 -0
  73. package/dist/components/fileupload/index.js.map +1 -0
  74. package/dist/components/menu/index.d.ts +8 -0
  75. package/dist/components/menu/index.d.ts.map +1 -0
  76. package/dist/components/menu/index.js +7 -0
  77. package/dist/components/menu/index.js.map +1 -0
  78. package/dist/components/menu/menu.d.ts +23 -0
  79. package/dist/components/menu/menu.d.ts.map +1 -0
  80. package/dist/components/menu/menu.js +155 -0
  81. package/dist/components/menu/menu.js.map +1 -0
  82. package/dist/components/orderlist/orderlist.d.ts +1 -1
  83. package/dist/components/orderlist/orderlist.d.ts.map +1 -1
  84. package/dist/components/orderlist/orderlist.js +2 -2
  85. package/dist/components/orderlist/orderlist.js.map +1 -1
  86. package/dist/components/password-strength/index.d.ts +8 -0
  87. package/dist/components/password-strength/index.d.ts.map +1 -0
  88. package/dist/components/password-strength/index.js +7 -0
  89. package/dist/components/password-strength/index.js.map +1 -0
  90. package/dist/components/password-strength/password-strength.d.ts +23 -0
  91. package/dist/components/password-strength/password-strength.d.ts.map +1 -0
  92. package/dist/components/password-strength/password-strength.js +109 -0
  93. package/dist/components/password-strength/password-strength.js.map +1 -0
  94. package/dist/components/picklist/picklist.d.ts +1 -1
  95. package/dist/components/picklist/picklist.d.ts.map +1 -1
  96. package/dist/components/picklist/picklist.js +2 -2
  97. package/dist/components/picklist/picklist.js.map +1 -1
  98. package/dist/components/popover/index.d.ts +8 -0
  99. package/dist/components/popover/index.d.ts.map +1 -0
  100. package/dist/components/popover/index.js +7 -0
  101. package/dist/components/popover/index.js.map +1 -0
  102. package/dist/components/popover/popover.d.ts +39 -0
  103. package/dist/components/popover/popover.d.ts.map +1 -0
  104. package/dist/components/popover/popover.js +228 -0
  105. package/dist/components/popover/popover.js.map +1 -0
  106. package/dist/components/rating/index.d.ts +8 -0
  107. package/dist/components/rating/index.d.ts.map +1 -0
  108. package/dist/components/rating/index.js +7 -0
  109. package/dist/components/rating/index.js.map +1 -0
  110. package/dist/components/rating/rating.d.ts +25 -0
  111. package/dist/components/rating/rating.d.ts.map +1 -0
  112. package/dist/components/rating/rating.js +119 -0
  113. package/dist/components/rating/rating.js.map +1 -0
  114. package/dist/components/slider/index.d.ts +8 -0
  115. package/dist/components/slider/index.d.ts.map +1 -0
  116. package/dist/components/slider/index.js +7 -0
  117. package/dist/components/slider/index.js.map +1 -0
  118. package/dist/components/slider/slider.d.ts +33 -0
  119. package/dist/components/slider/slider.d.ts.map +1 -0
  120. package/dist/components/slider/slider.js +260 -0
  121. package/dist/components/slider/slider.js.map +1 -0
  122. package/dist/components/stepper/index.d.ts +8 -0
  123. package/dist/components/stepper/index.d.ts.map +1 -0
  124. package/dist/components/stepper/index.js +7 -0
  125. package/dist/components/stepper/index.js.map +1 -0
  126. package/dist/components/stepper/stepper.d.ts +33 -0
  127. package/dist/components/stepper/stepper.d.ts.map +1 -0
  128. package/dist/components/stepper/stepper.js +162 -0
  129. package/dist/components/stepper/stepper.js.map +1 -0
  130. package/dist/components/timeline/index.d.ts +8 -0
  131. package/dist/components/timeline/index.d.ts.map +1 -0
  132. package/dist/components/timeline/index.js +7 -0
  133. package/dist/components/timeline/index.js.map +1 -0
  134. package/dist/components/timeline/timeline.d.ts +30 -0
  135. package/dist/components/timeline/timeline.d.ts.map +1 -0
  136. package/dist/components/timeline/timeline.js +146 -0
  137. package/dist/components/timeline/timeline.js.map +1 -0
  138. package/dist/components/toast/toast.d.ts.map +1 -1
  139. package/dist/components/toast/toast.js +21 -2
  140. package/dist/components/toast/toast.js.map +1 -1
  141. package/dist/components/toggle-button-group/index.d.ts +8 -0
  142. package/dist/components/toggle-button-group/index.d.ts.map +1 -0
  143. package/dist/components/toggle-button-group/index.js +7 -0
  144. package/dist/components/toggle-button-group/index.js.map +1 -0
  145. package/dist/components/toggle-button-group/toggle-button-group.d.ts +21 -0
  146. package/dist/components/toggle-button-group/toggle-button-group.d.ts.map +1 -0
  147. package/dist/components/toggle-button-group/toggle-button-group.js +103 -0
  148. package/dist/components/toggle-button-group/toggle-button-group.js.map +1 -0
  149. package/dist/components/tree/index.d.ts +8 -0
  150. package/dist/components/tree/index.d.ts.map +1 -0
  151. package/dist/components/tree/index.js +7 -0
  152. package/dist/components/tree/index.js.map +1 -0
  153. package/dist/components/tree/tree.d.ts +34 -0
  154. package/dist/components/tree/tree.d.ts.map +1 -0
  155. package/dist/components/tree/tree.js +149 -0
  156. package/dist/components/tree/tree.js.map +1 -0
  157. package/dist/core/base.d.ts +1 -1
  158. package/dist/core/base.d.ts.map +1 -1
  159. package/dist/core/base.js +1 -1
  160. package/dist/core/base.js.map +1 -1
  161. package/dist/docs/app.d.ts.map +1 -1
  162. package/dist/docs/componentes/avatar.doc.d.ts +6 -0
  163. package/dist/docs/componentes/avatar.doc.d.ts.map +1 -0
  164. package/dist/docs/componentes/breadcrumb.doc.d.ts +6 -0
  165. package/dist/docs/componentes/breadcrumb.doc.d.ts.map +1 -0
  166. package/dist/docs/componentes/card.doc.d.ts +6 -0
  167. package/dist/docs/componentes/card.doc.d.ts.map +1 -0
  168. package/dist/docs/componentes/carousel.doc.d.ts +6 -0
  169. package/dist/docs/componentes/carousel.doc.d.ts.map +1 -0
  170. package/dist/docs/componentes/chip.doc.d.ts +6 -0
  171. package/dist/docs/componentes/chip.doc.d.ts.map +1 -0
  172. package/dist/docs/componentes/confirmpopup.doc.d.ts +6 -0
  173. package/dist/docs/componentes/confirmpopup.doc.d.ts.map +1 -0
  174. package/dist/docs/componentes/empty-state.doc.d.ts +6 -0
  175. package/dist/docs/componentes/empty-state.doc.d.ts.map +1 -0
  176. package/dist/docs/componentes/fileupload.doc.d.ts +6 -0
  177. package/dist/docs/componentes/fileupload.doc.d.ts.map +1 -0
  178. package/dist/docs/componentes/index.d.ts.map +1 -1
  179. package/dist/docs/componentes/menu.doc.d.ts +6 -0
  180. package/dist/docs/componentes/menu.doc.d.ts.map +1 -0
  181. package/dist/docs/componentes/password-strength.doc.d.ts +6 -0
  182. package/dist/docs/componentes/password-strength.doc.d.ts.map +1 -0
  183. package/dist/docs/componentes/popover.doc.d.ts +6 -0
  184. package/dist/docs/componentes/popover.doc.d.ts.map +1 -0
  185. package/dist/docs/componentes/rating.doc.d.ts +6 -0
  186. package/dist/docs/componentes/rating.doc.d.ts.map +1 -0
  187. package/dist/docs/componentes/slider.doc.d.ts +6 -0
  188. package/dist/docs/componentes/slider.doc.d.ts.map +1 -0
  189. package/dist/docs/componentes/stepper.doc.d.ts +6 -0
  190. package/dist/docs/componentes/stepper.doc.d.ts.map +1 -0
  191. package/dist/docs/componentes/timeline.doc.d.ts +6 -0
  192. package/dist/docs/componentes/timeline.doc.d.ts.map +1 -0
  193. package/dist/docs/componentes/toggle-button-group.doc.d.ts +6 -0
  194. package/dist/docs/componentes/toggle-button-group.doc.d.ts.map +1 -0
  195. package/dist/docs/componentes/tree.doc.d.ts +6 -0
  196. package/dist/docs/componentes/tree.doc.d.ts.map +1 -0
  197. package/dist/fenix-icons.woff2 +0 -0
  198. package/dist/fenix-ui.umd.min.js +1317 -160
  199. package/dist/fenix-ui2.esm.js +4317 -7816
  200. package/dist/fenix-ui2.esm.js.map +1 -1
  201. package/dist/fenix-ui3.esm.js +10396 -84
  202. package/dist/fenix-ui3.esm.js.map +1 -1
  203. package/dist/fenix-ui4.esm.js +110 -0
  204. package/dist/fenix-ui4.esm.js.map +1 -0
  205. package/dist/icons/base-css.d.ts +21 -0
  206. package/dist/icons/base-css.d.ts.map +1 -0
  207. package/dist/icons/base-css.js +32 -0
  208. package/dist/icons/base-css.js.map +1 -0
  209. package/dist/icons/fenix-icons.woff2 +0 -0
  210. package/dist/icons/index.d.ts +31 -0
  211. package/dist/icons/index.d.ts.map +1 -0
  212. package/dist/icons/index.js +47 -0
  213. package/dist/icons/index.js.map +1 -0
  214. package/dist/icons/names.d.ts +11 -0
  215. package/dist/icons/names.d.ts.map +1 -0
  216. package/dist/icons/names.js +4283 -0
  217. package/dist/icons/names.js.map +1 -0
  218. package/dist/index.d.ts +17 -0
  219. package/dist/index.d.ts.map +1 -1
  220. package/dist/index.js +51 -0
  221. package/dist/index.js.map +1 -1
  222. package/dist/plugins/auto-import.d.ts +2 -0
  223. package/dist/plugins/auto-import.d.ts.map +1 -1
  224. package/dist/plugins/auto-import.js +23 -0
  225. package/dist/plugins/auto-import.js.map +1 -1
  226. package/package.json +74 -1
@@ -0,0 +1,110 @@
1
+ const fenixComponentMap = {
2
+ "fx-button": "@wrrdev/fenix-ui/button",
3
+ "fx-badge": "@wrrdev/fenix-ui/badge",
4
+ "fx-spinner": "@wrrdev/fenix-ui/spinner",
5
+ "fx-select": "@wrrdev/fenix-ui/select",
6
+ "fx-multiselect": "@wrrdev/fenix-ui/multiselect",
7
+ "fx-input": "@wrrdev/fenix-ui/input",
8
+ "fx-switch": "@wrrdev/fenix-ui/switch",
9
+ "fx-calendar": "@wrrdev/fenix-ui/calendar",
10
+ "fx-datepicker": "@wrrdev/fenix-ui/datepicker",
11
+ "fx-checkbox": "@wrrdev/fenix-ui/checkbox",
12
+ "fx-radio": "@wrrdev/fenix-ui/radio",
13
+ "fx-table": "@wrrdev/fenix-ui/table",
14
+ "fx-floatlabel": "@wrrdev/fenix-ui/floatlabel",
15
+ "fx-textarea": "@wrrdev/fenix-ui/textarea",
16
+ "fx-dialog": "@wrrdev/fenix-ui/dialog",
17
+ "fx-confirmpopup": "@wrrdev/fenix-ui/confirmpopup",
18
+ "fx-fileupload": "@wrrdev/fenix-ui/fileupload",
19
+ "fx-slider": "@wrrdev/fenix-ui/slider",
20
+ "fx-chip": "@wrrdev/fenix-ui/chip",
21
+ "fx-avatar": "@wrrdev/fenix-ui/avatar",
22
+ "fx-card": "@wrrdev/fenix-ui/card",
23
+ "fx-breadcrumb": "@wrrdev/fenix-ui/breadcrumb",
24
+ "fx-popover": "@wrrdev/fenix-ui/popover",
25
+ "fx-stepper": "@wrrdev/fenix-ui/stepper",
26
+ "fx-rating": "@wrrdev/fenix-ui/rating",
27
+ "fx-menu": "@wrrdev/fenix-ui/menu",
28
+ "fx-toggle-button-group": "@wrrdev/fenix-ui/toggle-button-group",
29
+ "fx-empty-state": "@wrrdev/fenix-ui/empty-state",
30
+ "fx-password-strength": "@wrrdev/fenix-ui/password-strength",
31
+ "fx-timeline": "@wrrdev/fenix-ui/timeline",
32
+ "fx-carousel": "@wrrdev/fenix-ui/carousel",
33
+ "fx-tree": "@wrrdev/fenix-ui/tree",
34
+ "fx-drawer": "@wrrdev/fenix-ui/drawer",
35
+ "fx-toast": "@wrrdev/fenix-ui/toast",
36
+ "fx-tooltip": "@wrrdev/fenix-ui/tooltip",
37
+ "fx-tabs": "@wrrdev/fenix-ui/tabs",
38
+ "fx-tab-panel": "@wrrdev/fenix-ui/tabs",
39
+ "fx-progress": "@wrrdev/fenix-ui/progress",
40
+ "fx-skeleton": "@wrrdev/fenix-ui/skeleton",
41
+ "fx-alert": "@wrrdev/fenix-ui/alert",
42
+ "fx-dropdown": "@wrrdev/fenix-ui/dropdown",
43
+ "fx-dropdown-item": "@wrrdev/fenix-ui/dropdown",
44
+ "fx-pagination": "@wrrdev/fenix-ui/pagination",
45
+ "fx-autocomplete": "@wrrdev/fenix-ui/autocomplete",
46
+ "fx-knob": "@wrrdev/fenix-ui/knob",
47
+ "fx-accordion": "@wrrdev/fenix-ui/accordion",
48
+ "fx-accordion-panel": "@wrrdev/fenix-ui/accordion",
49
+ "fx-orderlist": "@wrrdev/fenix-ui/orderlist",
50
+ "fx-picklist": "@wrrdev/fenix-ui/picklist",
51
+ "fx-column": "@wrrdev/fenix-ui/table"
52
+ };
53
+ const TAG_RE = /<(fx-[a-z][a-z-]*)(?=[\s/>])/g;
54
+ const FENIX_ICON_CLASS_RE = /\bfx-icon(?:-[a-z0-9_]+)*\b/;
55
+ function transformSource(code, options = {}) {
56
+ const pkg = options.packageName ?? "@wrrdev/fenix-ui";
57
+ const resolve = (sub) => pkg === "@wrrdev/fenix-ui" ? sub : sub.replace("@wrrdev/fenix-ui", pkg);
58
+ const needed = /* @__PURE__ */ new Set();
59
+ for (const m of code.matchAll(TAG_RE)) {
60
+ const sub = fenixComponentMap[m[1]];
61
+ if (sub) {
62
+ const target = resolve(sub);
63
+ if (!code.includes(`'${target}'`) && !code.includes(`"${target}"`)) {
64
+ needed.add(target);
65
+ }
66
+ }
67
+ }
68
+ const iconsSub = resolve("@wrrdev/fenix-ui/icons");
69
+ if (FENIX_ICON_CLASS_RE.test(code) && !code.includes(`'${iconsSub}'`) && !code.includes(`"${iconsSub}"`)) {
70
+ needed.add(iconsSub);
71
+ }
72
+ if (!needed.size) return code;
73
+ const lines = [...needed].map((s) => `import '${s}';`);
74
+ const vueScript = /(<script[^>]*>)\n/.exec(code);
75
+ if (vueScript) {
76
+ return code.replace(vueScript[0], `${vueScript[1]}
77
+ ${lines.join("\n")}
78
+ `);
79
+ }
80
+ let lastEnd = -1;
81
+ for (const m of code.matchAll(/^[ \t]*import\b[^;]*?['"][^'"]+['"];?[^\S\n]*$/gm)) {
82
+ lastEnd = Math.max(lastEnd, m.index + m[0].length);
83
+ }
84
+ if (lastEnd === -1) return `${lines.join("\n")}
85
+ ${code}`;
86
+ return `${code.slice(0, lastEnd)}
87
+ ${lines.join("\n")}${code.slice(lastEnd)}`;
88
+ }
89
+ function shouldTransform(id) {
90
+ return !id.includes("node_modules") && !id.endsWith(".d.ts") && !id.endsWith(".css") && /\.(ts|js|tsx|jsx|vue|html|svelte)$/.test(id);
91
+ }
92
+ function FenixAutoImport(options = {}) {
93
+ return {
94
+ name: "fenix-ui-auto-import",
95
+ enforce: "pre",
96
+ transform(code, id) {
97
+ if (!shouldTransform(id)) return void 0;
98
+ const result = transformSource(code, options);
99
+ if (result === code) return void 0;
100
+ return { code: result, map: null };
101
+ }
102
+ };
103
+ }
104
+ export {
105
+ FenixAutoImport,
106
+ fenixComponentMap,
107
+ shouldTransform,
108
+ transformSource
109
+ };
110
+ //# sourceMappingURL=fenix-ui4.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fenix-ui4.esm.js","sources":["../src/plugins/auto-import.ts","../src/plugins/index.ts"],"sourcesContent":["/**\n * Registro de tags → subpaths para o auto-import.\n * Mantido em um módulo próprio (sem depender de DOM) para ser usado\n * também no build do cliente via plugin.\n */\nexport const fenixComponentMap: Record<string, string> = {\n 'fx-button': '@wrrdev/fenix-ui/button',\n 'fx-badge': '@wrrdev/fenix-ui/badge',\n 'fx-spinner': '@wrrdev/fenix-ui/spinner',\n 'fx-select': '@wrrdev/fenix-ui/select',\n 'fx-multiselect': '@wrrdev/fenix-ui/multiselect',\n 'fx-input': '@wrrdev/fenix-ui/input',\n 'fx-switch': '@wrrdev/fenix-ui/switch',\n 'fx-calendar': '@wrrdev/fenix-ui/calendar',\n 'fx-datepicker': '@wrrdev/fenix-ui/datepicker',\n 'fx-checkbox': '@wrrdev/fenix-ui/checkbox',\n 'fx-radio': '@wrrdev/fenix-ui/radio',\n 'fx-table': '@wrrdev/fenix-ui/table',\n 'fx-floatlabel': '@wrrdev/fenix-ui/floatlabel',\n 'fx-textarea': '@wrrdev/fenix-ui/textarea',\n 'fx-dialog': '@wrrdev/fenix-ui/dialog',\n 'fx-confirmpopup': '@wrrdev/fenix-ui/confirmpopup',\n 'fx-fileupload': '@wrrdev/fenix-ui/fileupload',\n 'fx-slider': '@wrrdev/fenix-ui/slider',\n 'fx-chip': '@wrrdev/fenix-ui/chip',\n 'fx-avatar': '@wrrdev/fenix-ui/avatar',\n 'fx-card': '@wrrdev/fenix-ui/card',\n 'fx-breadcrumb': '@wrrdev/fenix-ui/breadcrumb',\n 'fx-popover': '@wrrdev/fenix-ui/popover',\n 'fx-stepper': '@wrrdev/fenix-ui/stepper',\n 'fx-rating': '@wrrdev/fenix-ui/rating',\n 'fx-menu': '@wrrdev/fenix-ui/menu',\n 'fx-toggle-button-group': '@wrrdev/fenix-ui/toggle-button-group',\n 'fx-empty-state': '@wrrdev/fenix-ui/empty-state',\n 'fx-password-strength': '@wrrdev/fenix-ui/password-strength',\n 'fx-timeline': '@wrrdev/fenix-ui/timeline',\n 'fx-carousel': '@wrrdev/fenix-ui/carousel',\n 'fx-tree': '@wrrdev/fenix-ui/tree',\n 'fx-drawer': '@wrrdev/fenix-ui/drawer',\n 'fx-toast': '@wrrdev/fenix-ui/toast',\n 'fx-tooltip': '@wrrdev/fenix-ui/tooltip',\n 'fx-tabs': '@wrrdev/fenix-ui/tabs',\n 'fx-tab-panel': '@wrrdev/fenix-ui/tabs',\n 'fx-progress': '@wrrdev/fenix-ui/progress',\n 'fx-skeleton': '@wrrdev/fenix-ui/skeleton',\n 'fx-alert': '@wrrdev/fenix-ui/alert',\n 'fx-dropdown': '@wrrdev/fenix-ui/dropdown',\n 'fx-dropdown-item': '@wrrdev/fenix-ui/dropdown',\n 'fx-pagination': '@wrrdev/fenix-ui/pagination',\n 'fx-autocomplete': '@wrrdev/fenix-ui/autocomplete',\n 'fx-knob': '@wrrdev/fenix-ui/knob',\n 'fx-accordion': '@wrrdev/fenix-ui/accordion',\n 'fx-accordion-panel': '@wrrdev/fenix-ui/accordion',\n 'fx-orderlist': '@wrrdev/fenix-ui/orderlist',\n 'fx-picklist': '@wrrdev/fenix-ui/picklist',\n 'fx-column': '@wrrdev/fenix-ui/table',\n};\n\nconst TAG_RE = /<(fx-[a-z][a-z-]*)(?=[\\s/>])/g;\n\n/** Detecta uso da biblioteca de ícones por classe (fx-icon / fx-icon-home etc.). */\nexport const FENIX_ICON_CLASS_RE = /\\bfx-icon(?:-[a-z0-9_]+)*\\b/;\n\nexport interface AutoImportOptions {\n /** Prefixo do pacote (padrão '@wrrdev/fenix-ui'). */\n packageName?: string;\n}\n\n/**\n * Injeta `import '<subpath>'` para cada componente fx-* usado no código\n * que ainda não foi importado. Retorna o código transformado ou o original.\n */\nexport function transformSource(code: string, options: AutoImportOptions = {}): string {\n const pkg = options.packageName ?? '@wrrdev/fenix-ui';\n // Subpaths do mapa são reescritos quando um pacote custom é informado.\n const resolve = (sub: string): string =>\n pkg === '@wrrdev/fenix-ui' ? sub : sub.replace('@wrrdev/fenix-ui', pkg);\n\n // Componentes usados e ainda não importados explicitamente.\n const needed = new Set<string>();\n for (const m of code.matchAll(TAG_RE)) {\n const sub = fenixComponentMap[m[1]];\n if (sub) {\n const target = resolve(sub);\n if (!code.includes(`'${target}'`) && !code.includes(`\"${target}\"`)) {\n needed.add(target);\n }\n }\n }\n // Biblioteca de ícones: classes fx-icon / fx-icon-<nome> injetam o subpath /icons.\n const iconsSub = resolve('@wrrdev/fenix-ui/icons');\n if (FENIX_ICON_CLASS_RE.test(code) && !code.includes(`'${iconsSub}'`) && !code.includes(`\"${iconsSub}\"`)) {\n needed.add(iconsSub);\n }\n if (!needed.size) return code;\n\n const lines = [...needed].map((s) => `import '${s}';`);\n\n // Arquivo único (.vue): injeta logo após a abertura do <script>.\n const vueScript = /(<script[^>]*>)\\n/.exec(code);\n if (vueScript) {\n return code.replace(vueScript[0], `${vueScript[1]}\\n${lines.join('\\n')}\\n`);\n }\n\n // TS/JS: injeta após o último import existente (ou no topo).\n let lastEnd = -1;\n for (const m of code.matchAll(/^[ \\t]*import\\b[^;]*?['\"][^'\"]+['\"];?[^\\S\\n]*$/gm)) {\n lastEnd = Math.max(lastEnd, m.index + m[0].length);\n }\n if (lastEnd === -1) return `${lines.join('\\n')}\\n${code}`;\n return `${code.slice(0, lastEnd)}\\n${lines.join('\\n')}${code.slice(lastEnd)}`;\n}\n\n/** Verifica se o arquivo deve ser transformado. */\nexport function shouldTransform(id: string): boolean {\n return (\n !id.includes('node_modules') &&\n !id.endsWith('.d.ts') &&\n !id.endsWith('.css') &&\n /\\.(ts|js|tsx|jsx|vue|html|svelte)$/.test(id)\n );\n}\n\n","/**\n * Plugin de AUTO-IMPORT para Vite/Rollup.\n *\n * O usuário escreve apenas `<fx-button>`, `<fx-select>` etc. no template/código;\n * este plugin detecta as tags em tempo de build e injeta os imports dos\n * subpaths correspondentes — mantendo o tree-shaking (só entra no bundle\n * o que é usado).\n *\n * Uso no projeto do cliente (vite.config.ts):\n * import { FenixAutoImport } from '@wrrdev/fenix-ui/auto-import';\n * export default { plugins: [FenixAutoImport()] };\n */\nimport {\n transformSource,\n shouldTransform,\n type AutoImportOptions,\n} from './auto-import';\n\nexport interface FenixPlugin {\n name: string;\n enforce: 'pre';\n transform: (\n code: string,\n id: string,\n ) => { code: string; map: null } | undefined;\n}\n\nexport function FenixAutoImport(options: AutoImportOptions = {}): FenixPlugin {\n return {\n name: 'fenix-ui-auto-import',\n enforce: 'pre',\n transform(code, id) {\n if (!shouldTransform(id)) return undefined;\n const result = transformSource(code, options);\n if (result === code) return undefined;\n return { code: result, map: null };\n },\n };\n}\n\nexport { transformSource, shouldTransform, fenixComponentMap } from './auto-import';\nexport type { AutoImportOptions } from './auto-import';\n"],"names":[],"mappings":"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"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * CSS base da biblioteca de ícones — módulo LEVE (não importa a lista de nomes
3
+ * nem dispara o carregamento da fonte). Usado dentro dos Shadow DOMs dos
4
+ * componentes que suportam o atributo `icon`.
5
+ *
6
+ * O @font-face em si é injetado no <head> por `@wrrdev/fenix-ui/icons`
7
+ * (ver ./index.ts) — @font-face registrado no documento também se aplica
8
+ * dentro dos Shadow DOMs.
9
+ */
10
+ /** Nome da família de fontes dos ícones (self-hosted, sem dependência externa). */
11
+ export declare const FENIX_ICON_FONT_FAMILY = "Fenix Icons";
12
+ /** Família configurável via CSS custom property (fallback para o nome padrão). */
13
+ export declare const FENIX_ICON_FONT_VAR = "var(--fx-icon-font, Fenix Icons)";
14
+ /**
15
+ * Regras da classe `.fx-icon` para uso DENTRO de Shadow DOM
16
+ * (concatene às `static styles` do componente).
17
+ */
18
+ export declare const FENIX_ICON_BASE_CSS = "\n.fx-icon {\n font-family: var(--fx-icon-font, Fenix Icons);\n font-weight: normal;\n font-style: normal;\n line-height: 1;\n letter-spacing: normal;\n text-transform: none;\n display: inline-block;\n white-space: nowrap;\n word-wrap: normal;\n direction: ltr;\n font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;\n -webkit-font-smoothing: antialiased;\n text-rendering: optimizeLegibility;\n user-select: none;\n}\n.fx-icon.fx-icon-fill { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }\n.fx-icon.fx-icon-bold { font-variation-settings: 'FILL' 0, 'wght' 600, 'GRAD' 0, 'opsz' 24; }\n";
19
+ /** Verifica se o valor parece um nome de ícone da Fenix Icons (e não emoji/texto livre). */
20
+ export declare function isFenixIconName(value: string): boolean;
21
+ //# sourceMappingURL=base-css.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-css.d.ts","sourceRoot":"","sources":["../../src/icons/base-css.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,mFAAmF;AACnF,eAAO,MAAM,sBAAsB,gBAAgB,CAAC;AAEpD,kFAAkF;AAClF,eAAO,MAAM,mBAAmB,qCAAmD,CAAC;AAEpF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,moBAmB/B,CAAC;AAEF,4FAA4F;AAC5F,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEtD"}
@@ -0,0 +1,32 @@
1
+ const FENIX_ICON_FONT_FAMILY = "Fenix Icons";
2
+ const FENIX_ICON_FONT_VAR = `var(--fx-icon-font, ${FENIX_ICON_FONT_FAMILY})`;
3
+ const FENIX_ICON_BASE_CSS = `
4
+ .fx-icon {
5
+ font-family: ${FENIX_ICON_FONT_VAR};
6
+ font-weight: normal;
7
+ font-style: normal;
8
+ line-height: 1;
9
+ letter-spacing: normal;
10
+ text-transform: none;
11
+ display: inline-block;
12
+ white-space: nowrap;
13
+ word-wrap: normal;
14
+ direction: ltr;
15
+ font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
16
+ -webkit-font-smoothing: antialiased;
17
+ text-rendering: optimizeLegibility;
18
+ user-select: none;
19
+ }
20
+ .fx-icon.fx-icon-fill { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
21
+ .fx-icon.fx-icon-bold { font-variation-settings: 'FILL' 0, 'wght' 600, 'GRAD' 0, 'opsz' 24; }
22
+ `;
23
+ function isFenixIconName(value) {
24
+ return /^[a-z][a-z0-9_]*$/.test(value.trim());
25
+ }
26
+ export {
27
+ FENIX_ICON_BASE_CSS,
28
+ FENIX_ICON_FONT_FAMILY,
29
+ FENIX_ICON_FONT_VAR,
30
+ isFenixIconName
31
+ };
32
+ //# sourceMappingURL=base-css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-css.js","sources":["../../src/icons/base-css.ts"],"sourcesContent":["/**\n * CSS base da biblioteca de ícones — módulo LEVE (não importa a lista de nomes\n * nem dispara o carregamento da fonte). Usado dentro dos Shadow DOMs dos\n * componentes que suportam o atributo `icon`.\n *\n * O @font-face em si é injetado no <head> por `@wrrdev/fenix-ui/icons`\n * (ver ./index.ts) — @font-face registrado no documento também se aplica\n * dentro dos Shadow DOMs.\n */\n\n/** Nome da família de fontes dos ícones (self-hosted, sem dependência externa). */\nexport const FENIX_ICON_FONT_FAMILY = 'Fenix Icons';\n\n/** Família configurável via CSS custom property (fallback para o nome padrão). */\nexport const FENIX_ICON_FONT_VAR = `var(--fx-icon-font, ${FENIX_ICON_FONT_FAMILY})`;\n\n/**\n * Regras da classe `.fx-icon` para uso DENTRO de Shadow DOM\n * (concatene às `static styles` do componente).\n */\nexport const FENIX_ICON_BASE_CSS = `\n.fx-icon {\n font-family: ${FENIX_ICON_FONT_VAR};\n font-weight: normal;\n font-style: normal;\n line-height: 1;\n letter-spacing: normal;\n text-transform: none;\n display: inline-block;\n white-space: nowrap;\n word-wrap: normal;\n direction: ltr;\n font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;\n -webkit-font-smoothing: antialiased;\n text-rendering: optimizeLegibility;\n user-select: none;\n}\n.fx-icon.fx-icon-fill { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }\n.fx-icon.fx-icon-bold { font-variation-settings: 'FILL' 0, 'wght' 600, 'GRAD' 0, 'opsz' 24; }\n`;\n\n/** Verifica se o valor parece um nome de ícone da Fenix Icons (e não emoji/texto livre). */\nexport function isFenixIconName(value: string): boolean {\n return /^[a-z][a-z0-9_]*$/.test(value.trim());\n}\n"],"names":[],"mappings":"AAWO,MAAM,yBAAyB;AAG/B,MAAM,sBAAsB,uBAAuB,sBAAsB;AAMzE,MAAM,sBAAsB;AAAA;AAAA,iBAElB,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoB7B,SAAS,gBAAgB,OAAwB;AACtD,SAAO,oBAAoB,KAAK,MAAM,KAAA,CAAM;AAC9C;"}
Binary file
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Fenix Icons — biblioteca de ícones padrão do FenixUI.
3
+ *
4
+ * Fonte self-hosted (`fenix-icons.woff2`, Material Symbols Rounded, Apache 2.0)
5
+ * com TODOS os ícones embarcados — nenhuma requisição externa, nenhum CDN.
6
+ *
7
+ * Uso geral (basta importar `@wrrdev/fenix-ui/icons` UMA vez — o auto-import
8
+ * faz isso automaticamente quando detecta `fx-icon` no código):
9
+ *
10
+ * <i class="fx-icon fx-icon-home"></i>
11
+ * <span class="fx-icon">settings</span> (nome do ícone como conteúdo)
12
+ *
13
+ * Modificadores: fx-icon-fill (preenchido), fx-icon-bold (peso maior).
14
+ * Tamanho via font-size, cor via currentColor.
15
+ */
16
+ export { FENIX_ICON_NAMES } from './names';
17
+ export type { FenixIconName } from './names';
18
+ export { FENIX_ICON_BASE_CSS, FENIX_ICON_FONT_FAMILY, isFenixIconName } from './base-css';
19
+ /** CSS base compartilhado (usado também dentro dos Shadow DOMs dos componentes). */
20
+ export declare const FENIX_ICON_DOC_BASE_CSS = "\n.fx-icon {\n font-family: var(--fx-icon-font, Fenix Icons);\n font-weight: normal;\n font-style: normal;\n line-height: 1;\n letter-spacing: normal;\n text-transform: none;\n display: inline-block;\n white-space: nowrap;\n word-wrap: normal;\n direction: ltr;\n font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;\n -webkit-font-smoothing: antialiased;\n text-rendering: optimizeLegibility;\n user-select: none;\n}\n.fx-icon.fx-icon-fill { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }\n.fx-icon.fx-icon-bold { font-variation-settings: 'FILL' 0, 'wght' 600, 'GRAD' 0, 'opsz' 24; }\n";
21
+ /** Monta o CSS completo (@font-face + base + classes por ícone). */
22
+ export declare function buildFenixIconsCss(): string;
23
+ /**
24
+ * Injeta o CSS dos ícones no `<head>` do documento (idempotente).
25
+ * Chamado automaticamente ao importar `@wrrdev/fenix-ui/icons`.
26
+ * O `@font-face` registrado no documento também vale dentro dos Shadow DOMs.
27
+ */
28
+ export declare function loadFenixIcons(target?: Document | undefined): void;
29
+ /** Reseta o estado de injeção (uso interno/testes). */
30
+ export declare function __resetFenixIconsInjection(): void;
31
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/icons/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAkB1F,oFAAoF;AACpF,eAAO,MAAM,uBAAuB,moBAAsB,CAAC;AAW3D,oEAAoE;AACpE,wBAAgB,kBAAkB,IAAI,MAAM,CAO3C;AAID;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,GAAE,QAAQ,GAAG,SAAkE,GAAG,IAAI,CAO1H;AAED,uDAAuD;AACvD,wBAAgB,0BAA0B,IAAI,IAAI,CAEjD"}
@@ -0,0 +1,47 @@
1
+ import { FENIX_ICON_NAMES } from "./names.js";
2
+ import { FENIX_ICON_FONT_FAMILY, FENIX_ICON_BASE_CSS } from "./base-css.js";
3
+ import { isFenixIconName } from "./base-css.js";
4
+ function resolveFontUrl() {
5
+ if (typeof __FENIX_ICONS_FONT_URL__ !== "undefined" && __FENIX_ICONS_FONT_URL__) {
6
+ return __FENIX_ICONS_FONT_URL__;
7
+ }
8
+ const moduleUrl = import.meta.url;
9
+ return new URL("./fenix-icons.woff2", moduleUrl).toString();
10
+ }
11
+ const FONT_URL = resolveFontUrl();
12
+ const STYLE_ID = "fenix-icons";
13
+ const FENIX_ICON_DOC_BASE_CSS = FENIX_ICON_BASE_CSS;
14
+ function buildClassRules() {
15
+ let rules = "";
16
+ for (const name of FENIX_ICON_NAMES) {
17
+ rules += `.fx-icon-${name}::before{content:"${name}"}`;
18
+ }
19
+ return rules;
20
+ }
21
+ function buildFenixIconsCss() {
22
+ return `@font-face{font-family:'${FENIX_ICON_FONT_FAMILY}';font-style:normal;font-weight:100 700;font-display:block;src:url('${FONT_URL}') format('woff2');}` + FENIX_ICON_DOC_BASE_CSS + buildClassRules();
23
+ }
24
+ let injected = false;
25
+ function loadFenixIcons(target = typeof document !== "undefined" ? document : void 0) {
26
+ if (injected || !target) return;
27
+ const style = target.createElement("style");
28
+ style.id = STYLE_ID;
29
+ style.textContent = buildFenixIconsCss();
30
+ target.head.appendChild(style);
31
+ injected = true;
32
+ }
33
+ function __resetFenixIconsInjection() {
34
+ injected = false;
35
+ }
36
+ loadFenixIcons();
37
+ export {
38
+ FENIX_ICON_BASE_CSS,
39
+ FENIX_ICON_DOC_BASE_CSS,
40
+ FENIX_ICON_FONT_FAMILY,
41
+ FENIX_ICON_NAMES,
42
+ __resetFenixIconsInjection,
43
+ buildFenixIconsCss,
44
+ isFenixIconName,
45
+ loadFenixIcons
46
+ };
47
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/icons/index.ts"],"sourcesContent":["/**\n * Fenix Icons — biblioteca de ícones padrão do FenixUI.\n *\n * Fonte self-hosted (`fenix-icons.woff2`, Material Symbols Rounded, Apache 2.0)\n * com TODOS os ícones embarcados — nenhuma requisição externa, nenhum CDN.\n *\n * Uso geral (basta importar `@wrrdev/fenix-ui/icons` UMA vez — o auto-import\n * faz isso automaticamente quando detecta `fx-icon` no código):\n *\n * <i class=\"fx-icon fx-icon-home\"></i>\n * <span class=\"fx-icon\">settings</span> (nome do ícone como conteúdo)\n *\n * Modificadores: fx-icon-fill (preenchido), fx-icon-bold (peso maior).\n * Tamanho via font-size, cor via currentColor.\n */\n\nimport { FENIX_ICON_NAMES } from './names';\nimport { FENIX_ICON_BASE_CSS, FENIX_ICON_FONT_FAMILY } from './base-css';\n\nexport { FENIX_ICON_NAMES } from './names';\nexport type { FenixIconName } from './names';\nexport { FENIX_ICON_BASE_CSS, FENIX_ICON_FONT_FAMILY, isFenixIconName } from './base-css';\n\n/** URL da fonte woff2: no build ESM a fonte vive na mesma pasta do módulo (dist/icons). */\ndeclare const __FENIX_ICONS_FONT_URL__: string | undefined;\n\nfunction resolveFontUrl(): string {\n if (typeof __FENIX_ICONS_FONT_URL__ !== 'undefined' && __FENIX_ICONS_FONT_URL__) {\n return __FENIX_ICONS_FONT_URL__;\n }\n // Indireção proposital: impede que o bundler reescreva para um caminho absoluto.\n const moduleUrl = import.meta.url;\n return new URL('./fenix-icons.woff2', moduleUrl).toString();\n}\n\nconst FONT_URL = resolveFontUrl();\n\nconst STYLE_ID = 'fenix-icons';\n\n/** CSS base compartilhado (usado também dentro dos Shadow DOMs dos componentes). */\nexport const FENIX_ICON_DOC_BASE_CSS = FENIX_ICON_BASE_CSS;\n\n/** Gera as regras `fx-icon-<nome>::before { content: '<nome>' }` (via ligaduras). */\nfunction buildClassRules(): string {\n let rules = '';\n for (const name of FENIX_ICON_NAMES) {\n rules += `.fx-icon-${name}::before{content:\"${name}\"}`;\n }\n return rules;\n}\n\n/** Monta o CSS completo (@font-face + base + classes por ícone). */\nexport function buildFenixIconsCss(): string {\n return (\n `@font-face{font-family:'${FENIX_ICON_FONT_FAMILY}';font-style:normal;font-weight:100 700;` +\n `font-display:block;src:url('${FONT_URL}') format('woff2');}` +\n FENIX_ICON_DOC_BASE_CSS +\n buildClassRules()\n );\n}\n\nlet injected = false;\n\n/**\n * Injeta o CSS dos ícones no `<head>` do documento (idempotente).\n * Chamado automaticamente ao importar `@wrrdev/fenix-ui/icons`.\n * O `@font-face` registrado no documento também vale dentro dos Shadow DOMs.\n */\nexport function loadFenixIcons(target: Document | undefined = typeof document !== 'undefined' ? document : undefined): void {\n if (injected || !target) return;\n const style = target.createElement('style');\n style.id = STYLE_ID;\n style.textContent = buildFenixIconsCss();\n target.head.appendChild(style);\n injected = true;\n}\n\n/** Reseta o estado de injeção (uso interno/testes). */\nexport function __resetFenixIconsInjection(): void {\n injected = false;\n}\n\n// Import com efeito colateral: `import '@wrrdev/fenix-ui/icons'` já carrega tudo.\nloadFenixIcons();\n"],"names":[],"mappings":";;;AA0BA,SAAS,iBAAyB;AAChC,MAAI,OAAO,6BAA6B,eAAe,0BAA0B;AAC/E,WAAO;AAAA,EACT;AAEA,QAAM,YAAY,YAAY;AAC9B,SAAO,IAAI,IAAI,uBAAuB,SAAS,EAAE,SAAA;AACnD;AAEA,MAAM,WAAW,eAAA;AAEjB,MAAM,WAAW;AAGV,MAAM,0BAA0B;AAGvC,SAAS,kBAA0B;AACjC,MAAI,QAAQ;AACZ,aAAW,QAAQ,kBAAkB;AACnC,aAAS,YAAY,IAAI,qBAAqB,IAAI;AAAA,EACpD;AACA,SAAO;AACT;AAGO,SAAS,qBAA6B;AAC3C,SACE,2BAA2B,sBAAsB,uEAClB,QAAQ,yBACvC,0BACA,gBAAA;AAEJ;AAEA,IAAI,WAAW;AAOR,SAAS,eAAe,SAA+B,OAAO,aAAa,cAAc,WAAW,QAAiB;AAC1H,MAAI,YAAY,CAAC,OAAQ;AACzB,QAAM,QAAQ,OAAO,cAAc,OAAO;AAC1C,QAAM,KAAK;AACX,QAAM,cAAc,mBAAA;AACpB,SAAO,KAAK,YAAY,KAAK;AAC7B,aAAW;AACb;AAGO,SAAS,6BAAmC;AACjD,aAAW;AACb;AAGA,eAAA;"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * GERADO AUTOMATICAMENTE por scripts/generate-icons.mjs — não editar manualmente.
3
+ * Fonte dos nomes: Material Symbols Rounded (Apache 2.0).
4
+ */
5
+ /**
6
+ * Todos os nomes de ícones disponíveis na fonte Fenix Icons.
7
+ * Uso: <i class="fx-icon fx-icon-10k"></i> ou <i class="fx-icon">10k</i>
8
+ */
9
+ export declare const FENIX_ICON_NAMES: readonly string[];
10
+ export type FenixIconName = (typeof FENIX_ICON_NAMES)[number];
11
+ //# sourceMappingURL=names.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"names.d.ts","sourceRoot":"","sources":["../../src/icons/names.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EAsrI7C,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC"}