@apexcura/ui-components 0.0.14-Beta37 → 0.0.14-Beta38
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/index.js +8 -3
- package/dist/index.mjs +8 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -381,8 +381,14 @@ var ButtonElement = (props) => {
|
|
|
381
381
|
(0, import_react11.useEffect)(() => {
|
|
382
382
|
if (props.icon) {
|
|
383
383
|
fetch(props.icon).then((response) => response.text()).then((data) => {
|
|
384
|
-
|
|
385
|
-
|
|
384
|
+
const parser = new DOMParser();
|
|
385
|
+
const svgDocument = parser.parseFromString(data, "image/svg+xml");
|
|
386
|
+
const pathElement = svgDocument.querySelector("path");
|
|
387
|
+
if (pathElement) {
|
|
388
|
+
pathElement.setAttribute("fill", props.iconsClassName || "#A3A3A3");
|
|
389
|
+
}
|
|
390
|
+
const modifiedSvg = new XMLSerializer().serializeToString(svgDocument);
|
|
391
|
+
setSvgContent(modifiedSvg);
|
|
386
392
|
}).catch((error) => console.error("Error fetching SVG:", error));
|
|
387
393
|
}
|
|
388
394
|
}, [props.icon]);
|
|
@@ -395,7 +401,6 @@ var ButtonElement = (props) => {
|
|
|
395
401
|
svgContent ? /* @__PURE__ */ import_react11.default.createElement(
|
|
396
402
|
"span",
|
|
397
403
|
{
|
|
398
|
-
className: props.iconsClassName,
|
|
399
404
|
dangerouslySetInnerHTML: { __html: svgContent }
|
|
400
405
|
}
|
|
401
406
|
) : props.icon && /* @__PURE__ */ import_react11.default.createElement("img", { className: props.iconsClassName, src: props.icon }),
|
package/dist/index.mjs
CHANGED
|
@@ -322,8 +322,14 @@ var ButtonElement = (props) => {
|
|
|
322
322
|
useEffect(() => {
|
|
323
323
|
if (props.icon) {
|
|
324
324
|
fetch(props.icon).then((response) => response.text()).then((data) => {
|
|
325
|
-
|
|
326
|
-
|
|
325
|
+
const parser = new DOMParser();
|
|
326
|
+
const svgDocument = parser.parseFromString(data, "image/svg+xml");
|
|
327
|
+
const pathElement = svgDocument.querySelector("path");
|
|
328
|
+
if (pathElement) {
|
|
329
|
+
pathElement.setAttribute("fill", props.iconsClassName || "#A3A3A3");
|
|
330
|
+
}
|
|
331
|
+
const modifiedSvg = new XMLSerializer().serializeToString(svgDocument);
|
|
332
|
+
setSvgContent(modifiedSvg);
|
|
327
333
|
}).catch((error) => console.error("Error fetching SVG:", error));
|
|
328
334
|
}
|
|
329
335
|
}, [props.icon]);
|
|
@@ -336,7 +342,6 @@ var ButtonElement = (props) => {
|
|
|
336
342
|
svgContent ? /* @__PURE__ */ React11.createElement(
|
|
337
343
|
"span",
|
|
338
344
|
{
|
|
339
|
-
className: props.iconsClassName,
|
|
340
345
|
dangerouslySetInnerHTML: { __html: svgContent }
|
|
341
346
|
}
|
|
342
347
|
) : props.icon && /* @__PURE__ */ React11.createElement("img", { className: props.iconsClassName, src: props.icon }),
|