@wrrdev/fenix-ui 1.0.16 → 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.
- package/README.md +2 -2
- package/dist/_virtual/preload-helper.js +68 -0
- package/dist/_virtual/preload-helper.js.map +1 -0
- package/dist/assets/base-css-BifSeW2H.js +31 -0
- package/dist/assets/base-css-BifSeW2H.js.map +1 -0
- package/dist/components/alert/alert.d.ts +2 -1
- package/dist/components/alert/alert.d.ts.map +1 -1
- package/dist/components/alert/alert.js +10 -2
- package/dist/components/alert/alert.js.map +1 -1
- package/dist/components/avatar/avatar.d.ts +21 -0
- package/dist/components/avatar/avatar.d.ts.map +1 -0
- package/dist/components/avatar/avatar.js +91 -0
- package/dist/components/avatar/avatar.js.map +1 -0
- package/dist/components/avatar/index.d.ts +8 -0
- package/dist/components/avatar/index.d.ts.map +1 -0
- package/dist/components/avatar/index.js +7 -0
- package/dist/components/avatar/index.js.map +1 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +35 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -0
- package/dist/components/breadcrumb/breadcrumb.js +113 -0
- package/dist/components/breadcrumb/breadcrumb.js.map +1 -0
- package/dist/components/breadcrumb/index.d.ts +8 -0
- package/dist/components/breadcrumb/index.d.ts.map +1 -0
- package/dist/components/breadcrumb/index.js +7 -0
- package/dist/components/breadcrumb/index.js.map +1 -0
- package/dist/components/card/card.d.ts +15 -0
- package/dist/components/card/card.d.ts.map +1 -0
- package/dist/components/card/card.js +80 -0
- package/dist/components/card/card.js.map +1 -0
- package/dist/components/card/index.d.ts +8 -0
- package/dist/components/card/index.d.ts.map +1 -0
- package/dist/components/card/index.js +7 -0
- package/dist/components/card/index.js.map +1 -0
- package/dist/components/carousel/carousel.d.ts +28 -0
- package/dist/components/carousel/carousel.d.ts.map +1 -0
- package/dist/components/carousel/carousel.js +176 -0
- package/dist/components/carousel/carousel.js.map +1 -0
- package/dist/components/carousel/index.d.ts +8 -0
- package/dist/components/carousel/index.d.ts.map +1 -0
- package/dist/components/carousel/index.js +7 -0
- package/dist/components/carousel/index.js.map +1 -0
- package/dist/components/chip/chip.d.ts +19 -0
- package/dist/components/chip/chip.d.ts.map +1 -0
- package/dist/components/chip/chip.js +126 -0
- package/dist/components/chip/chip.js.map +1 -0
- package/dist/components/chip/index.d.ts +8 -0
- package/dist/components/chip/index.d.ts.map +1 -0
- package/dist/components/chip/index.js +7 -0
- package/dist/components/chip/index.js.map +1 -0
- package/dist/components/confirmpopup/confirmpopup.d.ts +44 -0
- package/dist/components/confirmpopup/confirmpopup.d.ts.map +1 -0
- package/dist/components/confirmpopup/confirmpopup.js +233 -0
- package/dist/components/confirmpopup/confirmpopup.js.map +1 -0
- package/dist/components/confirmpopup/index.d.ts +8 -0
- package/dist/components/confirmpopup/index.d.ts.map +1 -0
- package/dist/components/confirmpopup/index.js +7 -0
- package/dist/components/confirmpopup/index.js.map +1 -0
- package/dist/components/empty-state/empty-state.d.ts +14 -0
- package/dist/components/empty-state/empty-state.d.ts.map +1 -0
- package/dist/components/empty-state/empty-state.js +71 -0
- package/dist/components/empty-state/empty-state.js.map +1 -0
- package/dist/components/empty-state/index.d.ts +8 -0
- package/dist/components/empty-state/index.d.ts.map +1 -0
- package/dist/components/empty-state/index.js +7 -0
- package/dist/components/empty-state/index.js.map +1 -0
- package/dist/components/fileupload/fileupload.d.ts +42 -0
- package/dist/components/fileupload/fileupload.d.ts.map +1 -0
- package/dist/components/fileupload/fileupload.js +284 -0
- package/dist/components/fileupload/fileupload.js.map +1 -0
- package/dist/components/fileupload/index.d.ts +8 -0
- package/dist/components/fileupload/index.d.ts.map +1 -0
- package/dist/components/fileupload/index.js +7 -0
- package/dist/components/fileupload/index.js.map +1 -0
- package/dist/components/menu/index.d.ts +8 -0
- package/dist/components/menu/index.d.ts.map +1 -0
- package/dist/components/menu/index.js +7 -0
- package/dist/components/menu/index.js.map +1 -0
- package/dist/components/menu/menu.d.ts +23 -0
- package/dist/components/menu/menu.d.ts.map +1 -0
- package/dist/components/menu/menu.js +155 -0
- package/dist/components/menu/menu.js.map +1 -0
- package/dist/components/orderlist/orderlist.d.ts +1 -1
- package/dist/components/orderlist/orderlist.d.ts.map +1 -1
- package/dist/components/orderlist/orderlist.js +2 -2
- package/dist/components/orderlist/orderlist.js.map +1 -1
- package/dist/components/password-strength/index.d.ts +8 -0
- package/dist/components/password-strength/index.d.ts.map +1 -0
- package/dist/components/password-strength/index.js +7 -0
- package/dist/components/password-strength/index.js.map +1 -0
- package/dist/components/password-strength/password-strength.d.ts +23 -0
- package/dist/components/password-strength/password-strength.d.ts.map +1 -0
- package/dist/components/password-strength/password-strength.js +109 -0
- package/dist/components/password-strength/password-strength.js.map +1 -0
- package/dist/components/picklist/picklist.d.ts +1 -1
- package/dist/components/picklist/picklist.d.ts.map +1 -1
- package/dist/components/picklist/picklist.js +2 -2
- package/dist/components/picklist/picklist.js.map +1 -1
- package/dist/components/popover/index.d.ts +8 -0
- package/dist/components/popover/index.d.ts.map +1 -0
- package/dist/components/popover/index.js +7 -0
- package/dist/components/popover/index.js.map +1 -0
- package/dist/components/popover/popover.d.ts +39 -0
- package/dist/components/popover/popover.d.ts.map +1 -0
- package/dist/components/popover/popover.js +228 -0
- package/dist/components/popover/popover.js.map +1 -0
- package/dist/components/rating/index.d.ts +8 -0
- package/dist/components/rating/index.d.ts.map +1 -0
- package/dist/components/rating/index.js +7 -0
- package/dist/components/rating/index.js.map +1 -0
- package/dist/components/rating/rating.d.ts +25 -0
- package/dist/components/rating/rating.d.ts.map +1 -0
- package/dist/components/rating/rating.js +119 -0
- package/dist/components/rating/rating.js.map +1 -0
- package/dist/components/slider/index.d.ts +8 -0
- package/dist/components/slider/index.d.ts.map +1 -0
- package/dist/components/slider/index.js +7 -0
- package/dist/components/slider/index.js.map +1 -0
- package/dist/components/slider/slider.d.ts +33 -0
- package/dist/components/slider/slider.d.ts.map +1 -0
- package/dist/components/slider/slider.js +260 -0
- package/dist/components/slider/slider.js.map +1 -0
- package/dist/components/stepper/index.d.ts +8 -0
- package/dist/components/stepper/index.d.ts.map +1 -0
- package/dist/components/stepper/index.js +7 -0
- package/dist/components/stepper/index.js.map +1 -0
- package/dist/components/stepper/stepper.d.ts +33 -0
- package/dist/components/stepper/stepper.d.ts.map +1 -0
- package/dist/components/stepper/stepper.js +162 -0
- package/dist/components/stepper/stepper.js.map +1 -0
- package/dist/components/timeline/index.d.ts +8 -0
- package/dist/components/timeline/index.d.ts.map +1 -0
- package/dist/components/timeline/index.js +7 -0
- package/dist/components/timeline/index.js.map +1 -0
- package/dist/components/timeline/timeline.d.ts +30 -0
- package/dist/components/timeline/timeline.d.ts.map +1 -0
- package/dist/components/timeline/timeline.js +146 -0
- package/dist/components/timeline/timeline.js.map +1 -0
- package/dist/components/toast/toast.d.ts.map +1 -1
- package/dist/components/toast/toast.js +21 -2
- package/dist/components/toast/toast.js.map +1 -1
- package/dist/components/toggle-button-group/index.d.ts +8 -0
- package/dist/components/toggle-button-group/index.d.ts.map +1 -0
- package/dist/components/toggle-button-group/index.js +7 -0
- package/dist/components/toggle-button-group/index.js.map +1 -0
- package/dist/components/toggle-button-group/toggle-button-group.d.ts +21 -0
- package/dist/components/toggle-button-group/toggle-button-group.d.ts.map +1 -0
- package/dist/components/toggle-button-group/toggle-button-group.js +103 -0
- package/dist/components/toggle-button-group/toggle-button-group.js.map +1 -0
- package/dist/components/tree/index.d.ts +8 -0
- package/dist/components/tree/index.d.ts.map +1 -0
- package/dist/components/tree/index.js +7 -0
- package/dist/components/tree/index.js.map +1 -0
- package/dist/components/tree/tree.d.ts +34 -0
- package/dist/components/tree/tree.d.ts.map +1 -0
- package/dist/components/tree/tree.js +149 -0
- package/dist/components/tree/tree.js.map +1 -0
- package/dist/core/base.d.ts +1 -1
- package/dist/core/base.d.ts.map +1 -1
- package/dist/core/base.js +1 -1
- package/dist/core/base.js.map +1 -1
- package/dist/docs/app.d.ts.map +1 -1
- package/dist/docs/componentes/avatar.doc.d.ts +6 -0
- package/dist/docs/componentes/avatar.doc.d.ts.map +1 -0
- package/dist/docs/componentes/breadcrumb.doc.d.ts +6 -0
- package/dist/docs/componentes/breadcrumb.doc.d.ts.map +1 -0
- package/dist/docs/componentes/card.doc.d.ts +6 -0
- package/dist/docs/componentes/card.doc.d.ts.map +1 -0
- package/dist/docs/componentes/carousel.doc.d.ts +6 -0
- package/dist/docs/componentes/carousel.doc.d.ts.map +1 -0
- package/dist/docs/componentes/chip.doc.d.ts +6 -0
- package/dist/docs/componentes/chip.doc.d.ts.map +1 -0
- package/dist/docs/componentes/confirmpopup.doc.d.ts +6 -0
- package/dist/docs/componentes/confirmpopup.doc.d.ts.map +1 -0
- package/dist/docs/componentes/empty-state.doc.d.ts +6 -0
- package/dist/docs/componentes/empty-state.doc.d.ts.map +1 -0
- package/dist/docs/componentes/fileupload.doc.d.ts +6 -0
- package/dist/docs/componentes/fileupload.doc.d.ts.map +1 -0
- package/dist/docs/componentes/index.d.ts.map +1 -1
- package/dist/docs/componentes/menu.doc.d.ts +6 -0
- package/dist/docs/componentes/menu.doc.d.ts.map +1 -0
- package/dist/docs/componentes/password-strength.doc.d.ts +6 -0
- package/dist/docs/componentes/password-strength.doc.d.ts.map +1 -0
- package/dist/docs/componentes/popover.doc.d.ts +6 -0
- package/dist/docs/componentes/popover.doc.d.ts.map +1 -0
- package/dist/docs/componentes/rating.doc.d.ts +6 -0
- package/dist/docs/componentes/rating.doc.d.ts.map +1 -0
- package/dist/docs/componentes/slider.doc.d.ts +6 -0
- package/dist/docs/componentes/slider.doc.d.ts.map +1 -0
- package/dist/docs/componentes/stepper.doc.d.ts +6 -0
- package/dist/docs/componentes/stepper.doc.d.ts.map +1 -0
- package/dist/docs/componentes/timeline.doc.d.ts +6 -0
- package/dist/docs/componentes/timeline.doc.d.ts.map +1 -0
- package/dist/docs/componentes/toggle-button-group.doc.d.ts +6 -0
- package/dist/docs/componentes/toggle-button-group.doc.d.ts.map +1 -0
- package/dist/docs/componentes/tree.doc.d.ts +6 -0
- package/dist/docs/componentes/tree.doc.d.ts.map +1 -0
- package/dist/fenix-icons.woff2 +0 -0
- package/dist/fenix-ui.umd.min.js +1317 -160
- package/dist/fenix-ui2.esm.js +4317 -7816
- package/dist/fenix-ui2.esm.js.map +1 -1
- package/dist/fenix-ui3.esm.js +10396 -84
- package/dist/fenix-ui3.esm.js.map +1 -1
- package/dist/fenix-ui4.esm.js +110 -0
- package/dist/fenix-ui4.esm.js.map +1 -0
- package/dist/icons/base-css.d.ts +21 -0
- package/dist/icons/base-css.d.ts.map +1 -0
- package/dist/icons/base-css.js +32 -0
- package/dist/icons/base-css.js.map +1 -0
- package/dist/icons/fenix-icons.woff2 +0 -0
- package/dist/icons/index.d.ts +31 -0
- package/dist/icons/index.d.ts.map +1 -0
- package/dist/icons/index.js +47 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/icons/names.d.ts +11 -0
- package/dist/icons/names.d.ts.map +1 -0
- package/dist/icons/names.js +4283 -0
- package/dist/icons/names.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -1
- package/dist/plugins/auto-import.d.ts +2 -0
- package/dist/plugins/auto-import.d.ts.map +1 -1
- package/dist/plugins/auto-import.js +23 -0
- package/dist/plugins/auto-import.js.map +1 -1
- package/package.json +74 -1
|
@@ -14,6 +14,23 @@ const fenixComponentMap = {
|
|
|
14
14
|
"fx-floatlabel": "@wrrdev/fenix-ui/floatlabel",
|
|
15
15
|
"fx-textarea": "@wrrdev/fenix-ui/textarea",
|
|
16
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",
|
|
17
34
|
"fx-drawer": "@wrrdev/fenix-ui/drawer",
|
|
18
35
|
"fx-toast": "@wrrdev/fenix-ui/toast",
|
|
19
36
|
"fx-tooltip": "@wrrdev/fenix-ui/tooltip",
|
|
@@ -34,6 +51,7 @@ const fenixComponentMap = {
|
|
|
34
51
|
"fx-column": "@wrrdev/fenix-ui/table"
|
|
35
52
|
};
|
|
36
53
|
const TAG_RE = /<(fx-[a-z][a-z-]*)(?=[\s/>])/g;
|
|
54
|
+
const FENIX_ICON_CLASS_RE = /\bfx-icon(?:-[a-z0-9_]+)*\b/;
|
|
37
55
|
function transformSource(code, options = {}) {
|
|
38
56
|
const pkg = options.packageName ?? "@wrrdev/fenix-ui";
|
|
39
57
|
const resolve = (sub) => pkg === "@wrrdev/fenix-ui" ? sub : sub.replace("@wrrdev/fenix-ui", pkg);
|
|
@@ -47,6 +65,10 @@ function transformSource(code, options = {}) {
|
|
|
47
65
|
}
|
|
48
66
|
}
|
|
49
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
|
+
}
|
|
50
72
|
if (!needed.size) return code;
|
|
51
73
|
const lines = [...needed].map((s) => `import '${s}';`);
|
|
52
74
|
const vueScript = /(<script[^>]*>)\n/.exec(code);
|
|
@@ -68,6 +90,7 @@ function shouldTransform(id) {
|
|
|
68
90
|
return !id.includes("node_modules") && !id.endsWith(".d.ts") && !id.endsWith(".css") && /\.(ts|js|tsx|jsx|vue|html|svelte)$/.test(id);
|
|
69
91
|
}
|
|
70
92
|
export {
|
|
93
|
+
FENIX_ICON_CLASS_RE,
|
|
71
94
|
fenixComponentMap,
|
|
72
95
|
shouldTransform,
|
|
73
96
|
transformSource
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-import.js","sources":["../../src/plugins/auto-import.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-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\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 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"],"names":[],"mappings":"AAKO,MAAM,oBAA4C;AAAA,EACvD,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,aAAa;AAAA,EACb,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,oBAAoB;AAAA,EACpB,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,sBAAsB;AAAA,EACtB,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,aAAa;AACf;AAEA,MAAM,SAAS;
|
|
1
|
+
{"version":3,"file":"auto-import.js","sources":["../../src/plugins/auto-import.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"],"names":[],"mappings":"AAKO,MAAM,oBAA4C;AAAA,EACvD,aAAa;AAAA,EACb,YAAY;AAAA,EACZ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
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "FenixUI Design System Web nativo (Web Components + Shadow DOM + Design Tokens) com tree-shaking por componente.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "ISC",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"test": "vitest run",
|
|
43
43
|
"test:watch": "vitest",
|
|
44
44
|
"prepack": "node scripts/update-readme-version.cjs",
|
|
45
|
+
"icons:generate": "node scripts/generate-icons.mjs",
|
|
45
46
|
"publish": "npm publish --access public --tag latest"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
@@ -122,6 +123,74 @@
|
|
|
122
123
|
"types": "./dist/components/dialog/index.d.ts",
|
|
123
124
|
"import": "./dist/components/dialog/index.js"
|
|
124
125
|
},
|
|
126
|
+
"./confirmpopup": {
|
|
127
|
+
"types": "./dist/components/confirmpopup/index.d.ts",
|
|
128
|
+
"import": "./dist/components/confirmpopup/index.js"
|
|
129
|
+
},
|
|
130
|
+
"./fileupload": {
|
|
131
|
+
"types": "./dist/components/fileupload/index.d.ts",
|
|
132
|
+
"import": "./dist/components/fileupload/index.js"
|
|
133
|
+
},
|
|
134
|
+
"./slider": {
|
|
135
|
+
"types": "./dist/components/slider/index.d.ts",
|
|
136
|
+
"import": "./dist/components/slider/index.js"
|
|
137
|
+
},
|
|
138
|
+
"./chip": {
|
|
139
|
+
"types": "./dist/components/chip/index.d.ts",
|
|
140
|
+
"import": "./dist/components/chip/index.js"
|
|
141
|
+
},
|
|
142
|
+
"./avatar": {
|
|
143
|
+
"types": "./dist/components/avatar/index.d.ts",
|
|
144
|
+
"import": "./dist/components/avatar/index.js"
|
|
145
|
+
},
|
|
146
|
+
"./card": {
|
|
147
|
+
"types": "./dist/components/card/index.d.ts",
|
|
148
|
+
"import": "./dist/components/card/index.js"
|
|
149
|
+
},
|
|
150
|
+
"./breadcrumb": {
|
|
151
|
+
"types": "./dist/components/breadcrumb/index.d.ts",
|
|
152
|
+
"import": "./dist/components/breadcrumb/index.js"
|
|
153
|
+
},
|
|
154
|
+
"./popover": {
|
|
155
|
+
"types": "./dist/components/popover/index.d.ts",
|
|
156
|
+
"import": "./dist/components/popover/index.js"
|
|
157
|
+
},
|
|
158
|
+
"./stepper": {
|
|
159
|
+
"types": "./dist/components/stepper/index.d.ts",
|
|
160
|
+
"import": "./dist/components/stepper/index.js"
|
|
161
|
+
},
|
|
162
|
+
"./rating": {
|
|
163
|
+
"types": "./dist/components/rating/index.d.ts",
|
|
164
|
+
"import": "./dist/components/rating/index.js"
|
|
165
|
+
},
|
|
166
|
+
"./menu": {
|
|
167
|
+
"types": "./dist/components/menu/index.d.ts",
|
|
168
|
+
"import": "./dist/components/menu/index.js"
|
|
169
|
+
},
|
|
170
|
+
"./toggle-button-group": {
|
|
171
|
+
"types": "./dist/components/toggle-button-group/index.d.ts",
|
|
172
|
+
"import": "./dist/components/toggle-button-group/index.js"
|
|
173
|
+
},
|
|
174
|
+
"./empty-state": {
|
|
175
|
+
"types": "./dist/components/empty-state/index.d.ts",
|
|
176
|
+
"import": "./dist/components/empty-state/index.js"
|
|
177
|
+
},
|
|
178
|
+
"./password-strength": {
|
|
179
|
+
"types": "./dist/components/password-strength/index.d.ts",
|
|
180
|
+
"import": "./dist/components/password-strength/index.js"
|
|
181
|
+
},
|
|
182
|
+
"./timeline": {
|
|
183
|
+
"types": "./dist/components/timeline/index.d.ts",
|
|
184
|
+
"import": "./dist/components/timeline/index.js"
|
|
185
|
+
},
|
|
186
|
+
"./carousel": {
|
|
187
|
+
"types": "./dist/components/carousel/index.d.ts",
|
|
188
|
+
"import": "./dist/components/carousel/index.js"
|
|
189
|
+
},
|
|
190
|
+
"./tree": {
|
|
191
|
+
"types": "./dist/components/tree/index.d.ts",
|
|
192
|
+
"import": "./dist/components/tree/index.js"
|
|
193
|
+
},
|
|
125
194
|
"./toast": {
|
|
126
195
|
"types": "./dist/components/toast/index.d.ts",
|
|
127
196
|
"import": "./dist/components/toast/index.js"
|
|
@@ -191,6 +260,10 @@
|
|
|
191
260
|
"types": "./dist/components/multiselect/index.d.ts",
|
|
192
261
|
"import": "./dist/components/multiselect/index.js"
|
|
193
262
|
},
|
|
263
|
+
"./icons": {
|
|
264
|
+
"types": "./dist/icons/index.d.ts",
|
|
265
|
+
"import": "./dist/icons/index.js"
|
|
266
|
+
},
|
|
194
267
|
"./auto-import": {
|
|
195
268
|
"types": "./dist/plugins/index.d.ts",
|
|
196
269
|
"import": "./dist/plugins/index.js"
|