@apexcura/ui-components 0.0.14-Beta46 → 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 +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +22 -24
- package/dist/index.mjs +22 -24
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -60,6 +60,7 @@ type ElementType = {
|
|
|
60
60
|
containerClassName?: string;
|
|
61
61
|
selectBefore?: any[];
|
|
62
62
|
selectAfter?: any[];
|
|
63
|
+
isSVGStylesOverride?: boolean;
|
|
63
64
|
};
|
|
64
65
|
|
|
65
66
|
declare const TextElement: (props: ElementType) => React$1.JSX.Element;
|
|
@@ -85,7 +86,7 @@ declare const SingleSelectElement: (props: ElementType) => React$1.JSX.Element;
|
|
|
85
86
|
|
|
86
87
|
declare const MultipleSelectElement: (props: ElementType) => React$1.JSX.Element;
|
|
87
88
|
|
|
88
|
-
declare const ButtonElement: (props:
|
|
89
|
+
declare const ButtonElement: (props: ElementType) => React$1.JSX.Element;
|
|
89
90
|
|
|
90
91
|
declare const AddMoreTable: (props: ElementType) => React$1.JSX.Element;
|
|
91
92
|
|
package/dist/index.d.ts
CHANGED
|
@@ -60,6 +60,7 @@ type ElementType = {
|
|
|
60
60
|
containerClassName?: string;
|
|
61
61
|
selectBefore?: any[];
|
|
62
62
|
selectAfter?: any[];
|
|
63
|
+
isSVGStylesOverride?: boolean;
|
|
63
64
|
};
|
|
64
65
|
|
|
65
66
|
declare const TextElement: (props: ElementType) => React$1.JSX.Element;
|
|
@@ -85,7 +86,7 @@ declare const SingleSelectElement: (props: ElementType) => React$1.JSX.Element;
|
|
|
85
86
|
|
|
86
87
|
declare const MultipleSelectElement: (props: ElementType) => React$1.JSX.Element;
|
|
87
88
|
|
|
88
|
-
declare const ButtonElement: (props:
|
|
89
|
+
declare const ButtonElement: (props: ElementType) => React$1.JSX.Element;
|
|
89
90
|
|
|
90
91
|
declare const AddMoreTable: (props: ElementType) => React$1.JSX.Element;
|
|
91
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
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
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
|
|
416
|
+
}, [props.icon, props.className]);
|
|
419
417
|
const handleMouseEnter = () => {
|
|
420
|
-
if (props.
|
|
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.
|
|
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:
|
|
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
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
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
|
|
357
|
+
}, [props.icon, props.className]);
|
|
360
358
|
const handleMouseEnter = () => {
|
|
361
|
-
if (props.
|
|
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.
|
|
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:
|
|
381
|
+
onClick: props.onClick,
|
|
384
382
|
className: `${props.className ? props.className : ""}`,
|
|
385
383
|
onMouseEnter: handleMouseEnter,
|
|
386
384
|
onMouseLeave: handleMouseLeave
|