@onpe/ui 1.1.4 → 1.1.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/dist/cli.esm.js +15 -0
- package/dist/cli.js +15 -0
- package/package.json +1 -1
package/dist/cli.esm.js
CHANGED
|
@@ -6387,6 +6387,21 @@ function personalizeComponent(code, componentName) {
|
|
|
6387
6387
|
personalizedCode = personalizedCode.replace(/from "\.\.\/onpe\/ui\/(Portal|Overlay)"/g, function (match, component) { return "from \"./".concat(component, "\""); });
|
|
6388
6388
|
personalizedCode = personalizedCode.replace(/from "\.\.\/onpe\/icons\/actions\/(IconClose)"/g, function (match, component) { return "from \"../icons/actions/".concat(component, "\""); });
|
|
6389
6389
|
}
|
|
6390
|
+
// Para iconos que necesitan SVGProps
|
|
6391
|
+
if (componentName.toLowerCase().startsWith("icon-")) {
|
|
6392
|
+
// Agregar importación de SVGProps si no existe
|
|
6393
|
+
if (personalizedCode.includes("SVGProps<SVGSVGElement>") && !personalizedCode.includes("import { SVGProps }")) {
|
|
6394
|
+
personalizedCode = personalizedCode.replace(/import React from "react";/, "import React, { SVGProps } from \"react\";");
|
|
6395
|
+
}
|
|
6396
|
+
// Arreglar interfaz vacía agregando propiedades opcionales comunes
|
|
6397
|
+
if (personalizedCode.includes("export interface") && personalizedCode.includes("extends SVGProps<SVGSVGElement>")) {
|
|
6398
|
+
personalizedCode = personalizedCode.replace(/export interface \w+Props extends SVGProps<SVGSVGElement> \{\}/, function (match) {
|
|
6399
|
+
var _a;
|
|
6400
|
+
var interfaceName = ((_a = match.match(/export interface (\w+Props)/)) === null || _a === void 0 ? void 0 : _a[1]) || "IconProps";
|
|
6401
|
+
return "export interface ".concat(interfaceName, " extends SVGProps<SVGSVGElement> {\n className?: string;\n size?: number | string;\n}");
|
|
6402
|
+
});
|
|
6403
|
+
}
|
|
6404
|
+
}
|
|
6390
6405
|
// Para otros componentes UI
|
|
6391
6406
|
if (!componentName.toLowerCase().startsWith("icon-") && !componentName.toLowerCase().startsWith("modal")) {
|
|
6392
6407
|
personalizedCode = personalizedCode.replace(/from "\.\.\/onpe\/ui\/([^"]+)"/g, function (match, component) { return "from \"./".concat(component, "\""); });
|
package/dist/cli.js
CHANGED
|
@@ -6387,6 +6387,21 @@ function personalizeComponent(code, componentName) {
|
|
|
6387
6387
|
personalizedCode = personalizedCode.replace(/from "\.\.\/onpe\/ui\/(Portal|Overlay)"/g, function (match, component) { return "from \"./".concat(component, "\""); });
|
|
6388
6388
|
personalizedCode = personalizedCode.replace(/from "\.\.\/onpe\/icons\/actions\/(IconClose)"/g, function (match, component) { return "from \"../icons/actions/".concat(component, "\""); });
|
|
6389
6389
|
}
|
|
6390
|
+
// Para iconos que necesitan SVGProps
|
|
6391
|
+
if (componentName.toLowerCase().startsWith("icon-")) {
|
|
6392
|
+
// Agregar importación de SVGProps si no existe
|
|
6393
|
+
if (personalizedCode.includes("SVGProps<SVGSVGElement>") && !personalizedCode.includes("import { SVGProps }")) {
|
|
6394
|
+
personalizedCode = personalizedCode.replace(/import React from "react";/, "import React, { SVGProps } from \"react\";");
|
|
6395
|
+
}
|
|
6396
|
+
// Arreglar interfaz vacía agregando propiedades opcionales comunes
|
|
6397
|
+
if (personalizedCode.includes("export interface") && personalizedCode.includes("extends SVGProps<SVGSVGElement>")) {
|
|
6398
|
+
personalizedCode = personalizedCode.replace(/export interface \w+Props extends SVGProps<SVGSVGElement> \{\}/, function (match) {
|
|
6399
|
+
var _a;
|
|
6400
|
+
var interfaceName = ((_a = match.match(/export interface (\w+Props)/)) === null || _a === void 0 ? void 0 : _a[1]) || "IconProps";
|
|
6401
|
+
return "export interface ".concat(interfaceName, " extends SVGProps<SVGSVGElement> {\n className?: string;\n size?: number | string;\n}");
|
|
6402
|
+
});
|
|
6403
|
+
}
|
|
6404
|
+
}
|
|
6390
6405
|
// Para otros componentes UI
|
|
6391
6406
|
if (!componentName.toLowerCase().startsWith("icon-") && !componentName.toLowerCase().startsWith("modal")) {
|
|
6392
6407
|
personalizedCode = personalizedCode.replace(/from "\.\.\/onpe\/ui\/([^"]+)"/g, function (match, component) { return "from \"./".concat(component, "\""); });
|