@onpe/ui 1.1.5 → 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 +8 -0
- package/dist/cli.js +8 -0
- package/package.json +1 -1
package/dist/cli.esm.js
CHANGED
|
@@ -6393,6 +6393,14 @@ function personalizeComponent(code, componentName) {
|
|
|
6393
6393
|
if (personalizedCode.includes("SVGProps<SVGSVGElement>") && !personalizedCode.includes("import { SVGProps }")) {
|
|
6394
6394
|
personalizedCode = personalizedCode.replace(/import React from "react";/, "import React, { SVGProps } from \"react\";");
|
|
6395
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
|
+
}
|
|
6396
6404
|
}
|
|
6397
6405
|
// Para otros componentes UI
|
|
6398
6406
|
if (!componentName.toLowerCase().startsWith("icon-") && !componentName.toLowerCase().startsWith("modal")) {
|
package/dist/cli.js
CHANGED
|
@@ -6393,6 +6393,14 @@ function personalizeComponent(code, componentName) {
|
|
|
6393
6393
|
if (personalizedCode.includes("SVGProps<SVGSVGElement>") && !personalizedCode.includes("import { SVGProps }")) {
|
|
6394
6394
|
personalizedCode = personalizedCode.replace(/import React from "react";/, "import React, { SVGProps } from \"react\";");
|
|
6395
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
|
+
}
|
|
6396
6404
|
}
|
|
6397
6405
|
// Para otros componentes UI
|
|
6398
6406
|
if (!componentName.toLowerCase().startsWith("icon-") && !componentName.toLowerCase().startsWith("modal")) {
|