@apexcura/ui-components 0.0.14-Beta47 → 0.0.14-Beta48

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.d.mts CHANGED
@@ -86,7 +86,7 @@ declare const SingleSelectElement: (props: ElementType) => React$1.JSX.Element;
86
86
 
87
87
  declare const MultipleSelectElement: (props: ElementType) => React$1.JSX.Element;
88
88
 
89
- declare const ButtonElement: (props: any) => React$1.JSX.Element;
89
+ declare const ButtonElement: (props: ElementType) => React$1.JSX.Element;
90
90
 
91
91
  declare const AddMoreTable: (props: ElementType) => React$1.JSX.Element;
92
92
 
package/dist/index.d.ts CHANGED
@@ -86,7 +86,7 @@ declare const SingleSelectElement: (props: ElementType) => React$1.JSX.Element;
86
86
 
87
87
  declare const MultipleSelectElement: (props: ElementType) => React$1.JSX.Element;
88
88
 
89
- declare const ButtonElement: (props: any) => React$1.JSX.Element;
89
+ declare const ButtonElement: (props: ElementType) => React$1.JSX.Element;
90
90
 
91
91
  declare const AddMoreTable: (props: ElementType) => React$1.JSX.Element;
92
92
 
package/dist/index.js CHANGED
@@ -386,26 +386,24 @@ var ButtonElement = (props) => {
386
386
  tempDiv.innerHTML = data;
387
387
  const svgElement = tempDiv.querySelector("svg");
388
388
  if (svgElement) {
389
- if (props.svgoverride) {
390
- const textColorClass = props.className.match(/text-[\w-]+/g)?.[0];
391
- const hoverColorClass = props.className.match(/hover:text-[\w-]+/g)?.[0];
392
- if (textColorClass) {
393
- const tempSpan = document.createElement("span");
394
- tempSpan.className = textColorClass;
395
- document.body.appendChild(tempSpan);
396
- const computedColor = getComputedStyle(tempSpan).color;
397
- document.body.removeChild(tempSpan);
398
- const paths = svgElement.querySelectorAll("path");
399
- paths.forEach((path) => path.setAttribute("fill", computedColor));
400
- }
401
- if (hoverColorClass) {
402
- const tempSpan = document.createElement("span");
403
- tempSpan.className = hoverColorClass.replace("hover:", "");
404
- document.body.appendChild(tempSpan);
405
- const computedHoverColor = getComputedStyle(tempSpan).color;
406
- document.body.removeChild(tempSpan);
407
- setHoverColor(computedHoverColor);
408
- }
389
+ const textColorClass = props.className?.match(/text-[\w-]+/g)?.[0];
390
+ const hoverColorClass = props.className?.match(/hover:text-[\w-]+/g)?.[0];
391
+ if (textColorClass) {
392
+ const tempSpan = document.createElement("span");
393
+ tempSpan.className = textColorClass;
394
+ document.body.appendChild(tempSpan);
395
+ const computedColor = getComputedStyle(tempSpan).color;
396
+ document.body.removeChild(tempSpan);
397
+ const paths = svgElement.querySelectorAll("path");
398
+ paths.forEach((path) => path.setAttribute("fill", computedColor));
399
+ }
400
+ if (hoverColorClass) {
401
+ const tempSpan = document.createElement("span");
402
+ tempSpan.className = hoverColorClass.replace("hover:", "");
403
+ document.body.appendChild(tempSpan);
404
+ const computedHoverColor = getComputedStyle(tempSpan).color;
405
+ document.body.removeChild(tempSpan);
406
+ setHoverColor(computedHoverColor);
409
407
  }
410
408
  svgElement.setAttribute(
411
409
  "class",
@@ -415,9 +413,9 @@ var ButtonElement = (props) => {
415
413
  }
416
414
  }).catch((error) => console.error("Error fetching SVG:", error));
417
415
  }
418
- }, [props.icon, props.className, props.svgoverride]);
416
+ }, [props.icon, props.className]);
419
417
  const handleMouseEnter = () => {
420
- if (props.svgoverride && hoverColor && svgContent) {
418
+ if (props.isSVGStylesOverride && hoverColor && svgContent) {
421
419
  const tempDiv = document.createElement("div");
422
420
  tempDiv.innerHTML = svgContent;
423
421
  const svgElement = tempDiv.querySelector("svg");
@@ -427,7 +425,7 @@ var ButtonElement = (props) => {
427
425
  }
428
426
  };
429
427
  const handleMouseLeave = () => {
430
- if (props.svgoverride && svgContent) {
428
+ if (props.isSVGStylesOverride && svgContent) {
431
429
  const tempDiv = document.createElement("div");
432
430
  tempDiv.innerHTML = svgContent;
433
431
  const svgElement = tempDiv.querySelector("svg");
@@ -439,7 +437,7 @@ var ButtonElement = (props) => {
439
437
  return /* @__PURE__ */ import_react11.default.createElement(
440
438
  "button",
441
439
  {
442
- onClick: () => props.onClick && props.onClick(),
440
+ onClick: props.onClick,
443
441
  className: `${props.className ? props.className : ""}`,
444
442
  onMouseEnter: handleMouseEnter,
445
443
  onMouseLeave: handleMouseLeave
package/dist/index.mjs CHANGED
@@ -327,26 +327,24 @@ var ButtonElement = (props) => {
327
327
  tempDiv.innerHTML = data;
328
328
  const svgElement = tempDiv.querySelector("svg");
329
329
  if (svgElement) {
330
- if (props.svgoverride) {
331
- const textColorClass = props.className.match(/text-[\w-]+/g)?.[0];
332
- const hoverColorClass = props.className.match(/hover:text-[\w-]+/g)?.[0];
333
- if (textColorClass) {
334
- const tempSpan = document.createElement("span");
335
- tempSpan.className = textColorClass;
336
- document.body.appendChild(tempSpan);
337
- const computedColor = getComputedStyle(tempSpan).color;
338
- document.body.removeChild(tempSpan);
339
- const paths = svgElement.querySelectorAll("path");
340
- paths.forEach((path) => path.setAttribute("fill", computedColor));
341
- }
342
- if (hoverColorClass) {
343
- const tempSpan = document.createElement("span");
344
- tempSpan.className = hoverColorClass.replace("hover:", "");
345
- document.body.appendChild(tempSpan);
346
- const computedHoverColor = getComputedStyle(tempSpan).color;
347
- document.body.removeChild(tempSpan);
348
- setHoverColor(computedHoverColor);
349
- }
330
+ const textColorClass = props.className?.match(/text-[\w-]+/g)?.[0];
331
+ const hoverColorClass = props.className?.match(/hover:text-[\w-]+/g)?.[0];
332
+ if (textColorClass) {
333
+ const tempSpan = document.createElement("span");
334
+ tempSpan.className = textColorClass;
335
+ document.body.appendChild(tempSpan);
336
+ const computedColor = getComputedStyle(tempSpan).color;
337
+ document.body.removeChild(tempSpan);
338
+ const paths = svgElement.querySelectorAll("path");
339
+ paths.forEach((path) => path.setAttribute("fill", computedColor));
340
+ }
341
+ if (hoverColorClass) {
342
+ const tempSpan = document.createElement("span");
343
+ tempSpan.className = hoverColorClass.replace("hover:", "");
344
+ document.body.appendChild(tempSpan);
345
+ const computedHoverColor = getComputedStyle(tempSpan).color;
346
+ document.body.removeChild(tempSpan);
347
+ setHoverColor(computedHoverColor);
350
348
  }
351
349
  svgElement.setAttribute(
352
350
  "class",
@@ -356,9 +354,9 @@ var ButtonElement = (props) => {
356
354
  }
357
355
  }).catch((error) => console.error("Error fetching SVG:", error));
358
356
  }
359
- }, [props.icon, props.className, props.svgoverride]);
357
+ }, [props.icon, props.className]);
360
358
  const handleMouseEnter = () => {
361
- if (props.svgoverride && hoverColor && svgContent) {
359
+ if (props.isSVGStylesOverride && hoverColor && svgContent) {
362
360
  const tempDiv = document.createElement("div");
363
361
  tempDiv.innerHTML = svgContent;
364
362
  const svgElement = tempDiv.querySelector("svg");
@@ -368,7 +366,7 @@ var ButtonElement = (props) => {
368
366
  }
369
367
  };
370
368
  const handleMouseLeave = () => {
371
- if (props.svgoverride && svgContent) {
369
+ if (props.isSVGStylesOverride && svgContent) {
372
370
  const tempDiv = document.createElement("div");
373
371
  tempDiv.innerHTML = svgContent;
374
372
  const svgElement = tempDiv.querySelector("svg");
@@ -380,7 +378,7 @@ var ButtonElement = (props) => {
380
378
  return /* @__PURE__ */ React11.createElement(
381
379
  "button",
382
380
  {
383
- onClick: () => props.onClick && props.onClick(),
381
+ onClick: props.onClick,
384
382
  className: `${props.className ? props.className : ""}`,
385
383
  onMouseEnter: handleMouseEnter,
386
384
  onMouseLeave: handleMouseLeave
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.14-Beta47",
3
+ "version": "0.0.14-Beta48",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",