@henriquepetrelli/hp-design-system 1.1.12 → 1.1.13

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.
@@ -23,8 +23,8 @@
23
23
  return ButtonSize2;
24
24
  })(ButtonSize || {});
25
25
 
26
- const _hoisted_1$f = ["xlink:href"];
27
- const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
26
+ const _hoisted_1$g = ["xlink:href"];
27
+ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
28
28
  __name: "Icon",
29
29
  props: {
30
30
  name: {
@@ -58,7 +58,7 @@
58
58
  }, [
59
59
  vue.createElementVNode("use", {
60
60
  "xlink:href": `#icon-${__props.name}`
61
- }, null, 8, _hoisted_1$f)
61
+ }, null, 8, _hoisted_1$g)
62
62
  ], 6);
63
63
  };
64
64
  }
@@ -72,10 +72,10 @@
72
72
  return target;
73
73
  };
74
74
 
75
- const HpIcon = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-0b477588"]]);
75
+ const HpIcon = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-0b477588"]]);
76
76
 
77
- const _hoisted_1$e = ["aria-label", "aria-disabled", "disabled"];
78
- const _hoisted_2$d = {
77
+ const _hoisted_1$f = ["aria-label", "aria-disabled", "disabled"];
78
+ const _hoisted_2$e = {
79
79
  key: 0,
80
80
  class: "button-primary__icon--left"
81
81
  };
@@ -83,7 +83,7 @@
83
83
  key: 1,
84
84
  class: "button-primary__icon--right"
85
85
  };
86
- const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
86
+ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
87
87
  __name: "ButtonPrimary",
88
88
  props: {
89
89
  label: {
@@ -156,7 +156,7 @@
156
156
  disabled: __props.disabled,
157
157
  onClick: handleClick
158
158
  }, [
159
- __props.icon && __props.iconPosition === vue.unref(IconPosition).LEFT ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$d, [
159
+ __props.icon && __props.iconPosition === vue.unref(IconPosition).LEFT ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$e, [
160
160
  vue.createVNode(HpIcon, {
161
161
  name: __props.icon,
162
162
  size: "sm",
@@ -174,15 +174,15 @@
174
174
  color: computedColor.value
175
175
  }, null, 8, ["name", "color"])
176
176
  ])) : vue.createCommentVNode("", true)
177
- ], 14, _hoisted_1$e);
177
+ ], 14, _hoisted_1$f);
178
178
  };
179
179
  }
180
180
  });
181
181
 
182
- const HpButtonPrimary = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-5c29dcce"]]);
182
+ const HpButtonPrimary = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-5c29dcce"]]);
183
183
 
184
- const _hoisted_1$d = ["aria-label", "aria-disabled", "disabled"];
185
- const _hoisted_2$c = {
184
+ const _hoisted_1$e = ["aria-label", "aria-disabled", "disabled"];
185
+ const _hoisted_2$d = {
186
186
  key: 0,
187
187
  class: "button-secondary__icon--left"
188
188
  };
@@ -191,7 +191,7 @@
191
191
  key: 1,
192
192
  class: "button-secondary__icon--right"
193
193
  };
194
- const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
194
+ const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
195
195
  __name: "ButtonSecondary",
196
196
  props: {
197
197
  label: {
@@ -249,7 +249,7 @@
249
249
  disabled: __props.disabled,
250
250
  onClick: handleClick
251
251
  }, [
252
- __props.icon && __props.iconPosition === vue.unref(IconPosition).LEFT ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$c, [
252
+ __props.icon && __props.iconPosition === vue.unref(IconPosition).LEFT ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$d, [
253
253
  vue.createVNode(HpIcon, {
254
254
  name: __props.icon,
255
255
  size: "sm"
@@ -262,15 +262,15 @@
262
262
  size: "sm"
263
263
  }, null, 8, ["name"])
264
264
  ])) : vue.createCommentVNode("", true)
265
- ], 14, _hoisted_1$d);
265
+ ], 14, _hoisted_1$e);
266
266
  };
267
267
  }
268
268
  });
269
269
 
270
- const HpButtonSecondary = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-ce9350e4"]]);
270
+ const HpButtonSecondary = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-ce9350e4"]]);
271
271
 
272
- const _hoisted_1$c = ["aria-label", "aria-disabled", "disabled"];
273
- const _hoisted_2$b = {
272
+ const _hoisted_1$d = ["aria-label", "aria-disabled", "disabled"];
273
+ const _hoisted_2$c = {
274
274
  key: 0,
275
275
  class: "button-tertiary__icon--left"
276
276
  };
@@ -279,7 +279,7 @@
279
279
  key: 1,
280
280
  class: "button-tertiary__icon--right"
281
281
  };
282
- const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
282
+ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
283
283
  __name: "ButtonTertiary",
284
284
  props: {
285
285
  label: {
@@ -337,7 +337,7 @@
337
337
  disabled: __props.disabled,
338
338
  onClick: handleClick
339
339
  }, [
340
- __props.icon && __props.iconPosition === vue.unref(IconPosition).LEFT ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$b, [
340
+ __props.icon && __props.iconPosition === vue.unref(IconPosition).LEFT ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$c, [
341
341
  vue.createVNode(HpIcon, {
342
342
  name: __props.icon,
343
343
  size: "sm"
@@ -350,12 +350,12 @@
350
350
  size: "sm"
351
351
  }, null, 8, ["name"])
352
352
  ])) : vue.createCommentVNode("", true)
353
- ], 14, _hoisted_1$c);
353
+ ], 14, _hoisted_1$d);
354
354
  };
355
355
  }
356
356
  });
357
357
 
358
- const ButtonTertiary = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-0401b00e"]]);
358
+ const ButtonTertiary = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-0401b00e"]]);
359
359
 
360
360
  var ButtonIconSize = /* @__PURE__ */ ((ButtonIconSize2) => {
361
361
  ButtonIconSize2["SMALL"] = "sm";
@@ -379,8 +379,8 @@
379
379
  return "0, 0, 0";
380
380
  };
381
381
 
382
- const _hoisted_1$b = ["aria-label", "tabindex", "aria-disabled", "disabled"];
383
- const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
382
+ const _hoisted_1$c = ["aria-label", "tabindex", "aria-disabled", "disabled"];
383
+ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
384
384
  __name: "ButtonIcon",
385
385
  props: {
386
386
  label: {
@@ -470,12 +470,113 @@
470
470
  size: __props.size,
471
471
  speed: 0.8
472
472
  }, null, 8, ["color", "secondaryColor", "size"]))
473
+ ], 14, _hoisted_1$c);
474
+ };
475
+ }
476
+ });
477
+
478
+ const HpButtonIcon = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-32ab443d"]]);
479
+
480
+ var ButtonLetterSize = /* @__PURE__ */ ((ButtonLetterSize2) => {
481
+ ButtonLetterSize2["SMALL"] = "sm";
482
+ ButtonLetterSize2["REGULAR"] = "md";
483
+ ButtonLetterSize2["LARGE"] = "lg";
484
+ return ButtonLetterSize2;
485
+ })(ButtonLetterSize || {});
486
+
487
+ const _hoisted_1$b = ["aria-label", "tabindex", "aria-disabled", "disabled"];
488
+ const _hoisted_2$b = { key: 0 };
489
+ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
490
+ __name: "ButtonLetter",
491
+ props: {
492
+ label: {
493
+ type: String,
494
+ required: true
495
+ },
496
+ letter: {
497
+ type: String,
498
+ required: true
499
+ },
500
+ hasBackground: {
501
+ type: Boolean,
502
+ default: false
503
+ },
504
+ backgroundColor: {
505
+ type: String,
506
+ default: ""
507
+ },
508
+ letterColor: {
509
+ type: String,
510
+ default: ""
511
+ },
512
+ disabled: {
513
+ type: Boolean,
514
+ default: false
515
+ },
516
+ tabindex: {
517
+ type: Number,
518
+ default: 0
519
+ },
520
+ isLoading: {
521
+ type: Boolean,
522
+ defualt: false
523
+ },
524
+ size: {
525
+ type: String,
526
+ default: ButtonLetterSize.REGULAR
527
+ }
528
+ },
529
+ emits: ["action:click"],
530
+ setup(__props, { emit: __emit }) {
531
+ const props = __props;
532
+ const emit = __emit;
533
+ const handleClick = (event) => {
534
+ if (!props.disabled) {
535
+ emit("action:click", event);
536
+ }
537
+ };
538
+ const computedLetterColor = vue.computed(() => {
539
+ if (props.backgroundColor || props.hasBackground)
540
+ return props.letterColor || "#fff";
541
+ else return props.letterColor || "var(--color-primary)";
542
+ });
543
+ const computedBackgroundColor = vue.computed(() => {
544
+ if (props.backgroundColor) return props.backgroundColor;
545
+ if (props.hasBackground) return "var(--color-primary)";
546
+ return "transparent";
547
+ });
548
+ return (_ctx, _cache) => {
549
+ return vue.openBlock(), vue.createElementBlock("button", {
550
+ onClick: handleClick,
551
+ "aria-label": __props.label,
552
+ tabindex: __props.tabindex,
553
+ class: vue.normalizeClass(["button-letter", {
554
+ "button-letter--sm": __props.size === vue.unref(ButtonLetterSize).SMALL,
555
+ "button-letter--lg": __props.size === vue.unref(ButtonLetterSize).LARGE,
556
+ "button-letter--disabled": __props.disabled,
557
+ "button-letter--is-loading": __props.isLoading
558
+ }]),
559
+ style: vue.normalizeStyle({
560
+ "--background-color": computedBackgroundColor.value,
561
+ "--letter-color": vue.unref(convertHexToRgb)(computedLetterColor.value)
562
+ }),
563
+ "aria-disabled": __props.disabled || __props.isLoading,
564
+ disabled: __props.disabled || __props.isLoading
565
+ }, [
566
+ !__props.isLoading ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$b, vue.toDisplayString(__props.letter), 1)) : (vue.openBlock(), vue.createBlock(vue.unref(_sfc_main$b), {
567
+ key: 1,
568
+ type: "circle1",
569
+ color: computedLetterColor.value || "var(--color-primary)",
570
+ secondaryColor: computedBackgroundColor.value,
571
+ size: __props.size,
572
+ speed: 0.8
573
+ }, null, 8, ["color", "secondaryColor", "size"]))
473
574
  ], 14, _hoisted_1$b);
474
575
  };
475
576
  }
476
577
  });
477
578
 
478
- const HpButtonIcon = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-32ab443d"]]);
579
+ const ButtonLetter = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-4df7cc96"]]);
479
580
 
480
581
  var AlertType = /* @__PURE__ */ ((AlertType2) => {
481
582
  AlertType2["WARNING"] = "warning";
@@ -2593,6 +2694,7 @@
2593
2694
  __proto__: null,
2594
2695
  HpAlert: Alert,
2595
2696
  HpButtonIcon,
2697
+ HpButtonLetter: ButtonLetter,
2596
2698
  HpButtonPrimary,
2597
2699
  HpButtonSecondary,
2598
2700
  HpButtonTertiary: ButtonTertiary,
@@ -2648,6 +2750,7 @@
2648
2750
 
2649
2751
  exports.HpAlert = Alert;
2650
2752
  exports.HpButtonIcon = HpButtonIcon;
2753
+ exports.HpButtonLetter = ButtonLetter;
2651
2754
  exports.HpButtonPrimary = HpButtonPrimary;
2652
2755
  exports.HpButtonSecondary = HpButtonSecondary;
2653
2756
  exports.HpButtonTertiary = ButtonTertiary;