@henriquepetrelli/hp-design-system 1.1.13 → 1.1.14
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.
|
@@ -361,7 +361,10 @@ var ButtonIconSize = /* @__PURE__ */ ((ButtonIconSize2) => {
|
|
|
361
361
|
})(ButtonIconSize || {});
|
|
362
362
|
|
|
363
363
|
const convertHexToRgb = (color) => {
|
|
364
|
-
if (color
|
|
364
|
+
if (!color) return "";
|
|
365
|
+
if (color.startsWith("var(")) {
|
|
366
|
+
return color;
|
|
367
|
+
}
|
|
365
368
|
if (color.startsWith("#")) {
|
|
366
369
|
const hex = color.replace("#", "");
|
|
367
370
|
const r = parseInt(hex.substring(0, 2), 16);
|
|
@@ -369,10 +372,10 @@ const convertHexToRgb = (color) => {
|
|
|
369
372
|
const b = parseInt(hex.substring(4, 6), 16);
|
|
370
373
|
return `${r}, ${g}, ${b}`;
|
|
371
374
|
}
|
|
372
|
-
if (color.
|
|
375
|
+
if (color.startsWith("rgb")) {
|
|
373
376
|
return color.replace(/rgba?\(|\s|\)/g, "").split(",").slice(0, 3).join(", ");
|
|
374
377
|
}
|
|
375
|
-
return "
|
|
378
|
+
return "";
|
|
376
379
|
};
|
|
377
380
|
|
|
378
381
|
const _hoisted_1$c = ["aria-label", "tabindex", "aria-disabled", "disabled"];
|
|
@@ -427,7 +430,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
427
430
|
};
|
|
428
431
|
const computedIconColor = computed(() => {
|
|
429
432
|
if (props.backgroundColor || props.hasBackground)
|
|
430
|
-
return props.iconColor || "#
|
|
433
|
+
return props.iconColor || "#000000";
|
|
431
434
|
else return props.iconColor || "var(--color-primary)";
|
|
432
435
|
});
|
|
433
436
|
const computedBackgroundColor = computed(() => {
|
|
@@ -461,7 +464,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
461
464
|
}, null, 8, ["name", "size", "color"])) : (openBlock(), createBlock(unref(_sfc_main$b), {
|
|
462
465
|
key: 1,
|
|
463
466
|
type: "circle1",
|
|
464
|
-
color: computedIconColor.value || "
|
|
467
|
+
color: computedIconColor.value || "#000",
|
|
465
468
|
secondaryColor: computedBackgroundColor.value,
|
|
466
469
|
size: __props.size,
|
|
467
470
|
speed: 0.8
|
|
@@ -471,7 +474,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
471
474
|
}
|
|
472
475
|
});
|
|
473
476
|
|
|
474
|
-
const HpButtonIcon = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-
|
|
477
|
+
const HpButtonIcon = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-8cf8a123"]]);
|
|
475
478
|
|
|
476
479
|
var ButtonLetterSize = /* @__PURE__ */ ((ButtonLetterSize2) => {
|
|
477
480
|
ButtonLetterSize2["SMALL"] = "sm";
|
|
@@ -480,7 +483,7 @@ var ButtonLetterSize = /* @__PURE__ */ ((ButtonLetterSize2) => {
|
|
|
480
483
|
return ButtonLetterSize2;
|
|
481
484
|
})(ButtonLetterSize || {});
|
|
482
485
|
|
|
483
|
-
const _hoisted_1$b = ["aria-label", "
|
|
486
|
+
const _hoisted_1$b = ["aria-label", "aria-disabled", "disabled", "tabindex"];
|
|
484
487
|
const _hoisted_2$b = { key: 0 };
|
|
485
488
|
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
486
489
|
__name: "ButtonLetter",
|
|
@@ -515,7 +518,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
515
518
|
},
|
|
516
519
|
isLoading: {
|
|
517
520
|
type: Boolean,
|
|
518
|
-
|
|
521
|
+
default: false
|
|
519
522
|
},
|
|
520
523
|
size: {
|
|
521
524
|
type: String,
|
|
@@ -527,25 +530,32 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
527
530
|
const props = __props;
|
|
528
531
|
const emit = __emit;
|
|
529
532
|
const handleClick = (event) => {
|
|
530
|
-
if (!props.disabled) {
|
|
533
|
+
if (!props.disabled && !props.isLoading) {
|
|
531
534
|
emit("action:click", event);
|
|
532
535
|
}
|
|
533
536
|
};
|
|
534
537
|
const computedLetterColor = computed(() => {
|
|
535
|
-
if (props.
|
|
536
|
-
return props.letterColor || "#
|
|
537
|
-
|
|
538
|
+
if (props.hasBackground || props.backgroundColor) {
|
|
539
|
+
return props.letterColor || "#000000";
|
|
540
|
+
}
|
|
541
|
+
return props.letterColor || "var(--color-primary)";
|
|
538
542
|
});
|
|
539
543
|
const computedBackgroundColor = computed(() => {
|
|
540
544
|
if (props.backgroundColor) return props.backgroundColor;
|
|
541
545
|
if (props.hasBackground) return "var(--color-primary)";
|
|
542
546
|
return "transparent";
|
|
543
547
|
});
|
|
548
|
+
const letterColorRgb = computed(() => {
|
|
549
|
+
const color = computedLetterColor.value;
|
|
550
|
+
return color ? convertHexToRgb(color) : "";
|
|
551
|
+
});
|
|
544
552
|
return (_ctx, _cache) => {
|
|
545
553
|
return openBlock(), createElementBlock("button", {
|
|
546
554
|
onClick: handleClick,
|
|
547
555
|
"aria-label": __props.label,
|
|
548
|
-
|
|
556
|
+
"aria-disabled": __props.disabled || __props.isLoading,
|
|
557
|
+
disabled: __props.disabled || __props.isLoading,
|
|
558
|
+
tabindex: __props.disabled ? -1 : 0,
|
|
549
559
|
class: normalizeClass(["button-letter", {
|
|
550
560
|
"button-letter--sm": __props.size === unref(ButtonLetterSize).SMALL,
|
|
551
561
|
"button-letter--lg": __props.size === unref(ButtonLetterSize).LARGE,
|
|
@@ -554,10 +564,9 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
554
564
|
}]),
|
|
555
565
|
style: normalizeStyle({
|
|
556
566
|
"--background-color": computedBackgroundColor.value,
|
|
557
|
-
"--letter-color":
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
disabled: __props.disabled || __props.isLoading
|
|
567
|
+
"--letter-color-rgb": letterColorRgb.value,
|
|
568
|
+
color: computedLetterColor.value
|
|
569
|
+
})
|
|
561
570
|
}, [
|
|
562
571
|
!__props.isLoading ? (openBlock(), createElementBlock("span", _hoisted_2$b, toDisplayString(__props.letter), 1)) : (openBlock(), createBlock(unref(_sfc_main$b), {
|
|
563
572
|
key: 1,
|
|
@@ -572,7 +581,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
572
581
|
}
|
|
573
582
|
});
|
|
574
583
|
|
|
575
|
-
const ButtonLetter = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-
|
|
584
|
+
const ButtonLetter = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-13b75270"]]);
|
|
576
585
|
|
|
577
586
|
var AlertType = /* @__PURE__ */ ((AlertType2) => {
|
|
578
587
|
AlertType2["WARNING"] = "warning";
|