@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 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
- let modifiedData = data.replace(/<svg/g, `<svg class="${props.iconsClassName || ""}"`);
385
- setSvgContent(modifiedData);
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
- let modifiedData = data.replace(/<svg/g, `<svg class="${props.iconsClassName || ""}"`);
326
- setSvgContent(modifiedData);
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 }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.14-Beta37",
3
+ "version": "0.0.14-Beta38",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",