@henriquepetrelli/hp-design-system 1.1.19 → 1.1.21
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/hp-design-system.es.js +113 -52
- package/dist/hp-design-system.es.js.map +1 -1
- package/dist/hp-design-system.umd.js +113 -52
- package/dist/hp-design-system.umd.js.map +1 -1
- package/dist/style.css +55 -27
- package/package.json +1 -1
|
@@ -187,7 +187,7 @@
|
|
|
187
187
|
class: "button-secondary__icon--left"
|
|
188
188
|
};
|
|
189
189
|
const _hoisted_3$b = { class: "button-secondary__label" };
|
|
190
|
-
const _hoisted_4$
|
|
190
|
+
const _hoisted_4$8 = {
|
|
191
191
|
key: 1,
|
|
192
192
|
class: "button-secondary__icon--right"
|
|
193
193
|
};
|
|
@@ -256,7 +256,7 @@
|
|
|
256
256
|
}, null, 8, ["name"])
|
|
257
257
|
])) : vue.createCommentVNode("", true),
|
|
258
258
|
vue.createElementVNode("span", _hoisted_3$b, vue.toDisplayString(__props.label), 1),
|
|
259
|
-
__props.icon && __props.iconPosition === vue.unref(IconPosition).RIGHT ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$
|
|
259
|
+
__props.icon && __props.iconPosition === vue.unref(IconPosition).RIGHT ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$8, [
|
|
260
260
|
vue.createVNode(HpIcon, {
|
|
261
261
|
name: __props.icon,
|
|
262
262
|
size: "sm"
|
|
@@ -275,7 +275,7 @@
|
|
|
275
275
|
class: "button-tertiary__icon--left"
|
|
276
276
|
};
|
|
277
277
|
const _hoisted_3$a = { class: "button-tertiary__label" };
|
|
278
|
-
const _hoisted_4$
|
|
278
|
+
const _hoisted_4$7 = {
|
|
279
279
|
key: 1,
|
|
280
280
|
class: "button-tertiary__icon--right"
|
|
281
281
|
};
|
|
@@ -344,7 +344,7 @@
|
|
|
344
344
|
}, null, 8, ["name"])
|
|
345
345
|
])) : vue.createCommentVNode("", true),
|
|
346
346
|
vue.createElementVNode("span", _hoisted_3$a, vue.toDisplayString(__props.label), 1),
|
|
347
|
-
__props.icon && __props.iconPosition === vue.unref(IconPosition).RIGHT ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$
|
|
347
|
+
__props.icon && __props.iconPosition === vue.unref(IconPosition).RIGHT ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$7, [
|
|
348
348
|
vue.createVNode(HpIcon, {
|
|
349
349
|
name: __props.icon,
|
|
350
350
|
size: "sm"
|
|
@@ -705,11 +705,11 @@
|
|
|
705
705
|
key: 2,
|
|
706
706
|
class: "spinner-circle-3"
|
|
707
707
|
};
|
|
708
|
-
const _hoisted_4$
|
|
708
|
+
const _hoisted_4$6 = {
|
|
709
709
|
key: 3,
|
|
710
710
|
class: "spinner-circle-4"
|
|
711
711
|
};
|
|
712
|
-
const _hoisted_5$
|
|
712
|
+
const _hoisted_5$6 = {
|
|
713
713
|
key: 4,
|
|
714
714
|
class: "spinner-dot-1"
|
|
715
715
|
};
|
|
@@ -810,8 +810,8 @@
|
|
|
810
810
|
__props.type === "circle1" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$9)) : vue.createCommentVNode("", true),
|
|
811
811
|
__props.type === "circle2" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$9)) : vue.createCommentVNode("", true),
|
|
812
812
|
__props.type === "circle3" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$9)) : vue.createCommentVNode("", true),
|
|
813
|
-
__props.type === "circle4" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$
|
|
814
|
-
__props.type === "dot1" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$
|
|
813
|
+
__props.type === "circle4" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$6)) : vue.createCommentVNode("", true),
|
|
814
|
+
__props.type === "dot1" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$6, [
|
|
815
815
|
(vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(3, (i) => {
|
|
816
816
|
return vue.createElementVNode("div", {
|
|
817
817
|
key: `dot1-${i}`,
|
|
@@ -1159,11 +1159,11 @@
|
|
|
1159
1159
|
const _hoisted_1$6 = { class: "modal__header" };
|
|
1160
1160
|
const _hoisted_2$6 = { class: "modal__title" };
|
|
1161
1161
|
const _hoisted_3$6 = { class: "modal__content" };
|
|
1162
|
-
const _hoisted_4$
|
|
1162
|
+
const _hoisted_4$5 = {
|
|
1163
1163
|
key: 0,
|
|
1164
1164
|
class: "modal__footer"
|
|
1165
1165
|
};
|
|
1166
|
-
const _hoisted_5$
|
|
1166
|
+
const _hoisted_5$5 = {
|
|
1167
1167
|
key: 1,
|
|
1168
1168
|
class: "modal__footer"
|
|
1169
1169
|
};
|
|
@@ -1268,7 +1268,7 @@
|
|
|
1268
1268
|
vue.createElementVNode("div", _hoisted_3$6, [
|
|
1269
1269
|
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
1270
1270
|
]),
|
|
1271
|
-
__props.hasPrimaryButton || __props.hasSecondaryButton ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$
|
|
1271
|
+
__props.hasPrimaryButton || __props.hasSecondaryButton ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$5, [
|
|
1272
1272
|
__props.hasSecondaryButton ? (vue.openBlock(), vue.createBlock(vue.unref(HpButtonSecondary), {
|
|
1273
1273
|
key: 0,
|
|
1274
1274
|
label: __props.secondaryButtonLabel,
|
|
@@ -1282,7 +1282,7 @@
|
|
|
1282
1282
|
onClick: handleSecondaryButtonClick
|
|
1283
1283
|
}, null, 8, ["label", "backgroundColor"])) : vue.createCommentVNode("", true)
|
|
1284
1284
|
])) : vue.createCommentVNode("", true),
|
|
1285
|
-
!__props.hasPrimaryButton && !__props.hasSecondaryButton && _ctx.$slots.buttons ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$
|
|
1285
|
+
!__props.hasPrimaryButton && !__props.hasSecondaryButton && _ctx.$slots.buttons ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$5, [
|
|
1286
1286
|
vue.renderSlot(_ctx.$slots, "buttons", {}, void 0, true)
|
|
1287
1287
|
])) : vue.createCommentVNode("", true)
|
|
1288
1288
|
], 2)
|
|
@@ -1399,9 +1399,14 @@
|
|
|
1399
1399
|
|
|
1400
1400
|
const ToggleSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-14c54b46"]]);
|
|
1401
1401
|
|
|
1402
|
-
const _hoisted_1$4 = {
|
|
1403
|
-
const _hoisted_2$4 = ["
|
|
1404
|
-
const _hoisted_3$4 =
|
|
1402
|
+
const _hoisted_1$4 = { key: 0 };
|
|
1403
|
+
const _hoisted_2$4 = ["aria-checked", "onKeydown"];
|
|
1404
|
+
const _hoisted_3$4 = {
|
|
1405
|
+
key: 1,
|
|
1406
|
+
class: "theme-switcher-animation"
|
|
1407
|
+
};
|
|
1408
|
+
const _hoisted_4$4 = ["id", "aria-checked"];
|
|
1409
|
+
const _hoisted_5$4 = ["for", "onKeydown"];
|
|
1405
1410
|
|
|
1406
1411
|
|
|
1407
1412
|
const _sfc_main$4 = {
|
|
@@ -1415,10 +1420,24 @@
|
|
|
1415
1420
|
type: String,
|
|
1416
1421
|
default: () => `theme-${Math.random().toString(36).substring(2, 9)}`
|
|
1417
1422
|
},
|
|
1423
|
+
hasAnimation: {
|
|
1424
|
+
type: Boolean,
|
|
1425
|
+
default: true
|
|
1426
|
+
},
|
|
1427
|
+
|
|
1428
|
+
/* Toggle animado */
|
|
1418
1429
|
lightBorderColor: String,
|
|
1419
1430
|
lightBackgroundColor: String,
|
|
1420
1431
|
darkBorderColor: String,
|
|
1421
|
-
darkBackgroundColor: String
|
|
1432
|
+
darkBackgroundColor: String,
|
|
1433
|
+
|
|
1434
|
+
/* Ícone */
|
|
1435
|
+
lightIconColor: String,
|
|
1436
|
+
darkIconColor: String,
|
|
1437
|
+
|
|
1438
|
+
/* Hover */
|
|
1439
|
+
lightHoverBackgroundColor: String,
|
|
1440
|
+
darkHoverBackgroundColor: String
|
|
1422
1441
|
},
|
|
1423
1442
|
emits: ['update:modelValue'],
|
|
1424
1443
|
setup(__props, { emit: __emit }) {
|
|
@@ -1427,18 +1446,15 @@
|
|
|
1427
1446
|
|
|
1428
1447
|
const emit = __emit;
|
|
1429
1448
|
|
|
1430
|
-
const getStoredTheme = () => localStorage.getItem('theme');
|
|
1449
|
+
const getStoredTheme = () => localStorage.getItem('theme') || 'light';
|
|
1431
1450
|
const isStoredDark = () => getStoredTheme() === 'dark';
|
|
1432
1451
|
|
|
1433
1452
|
const isDarkMode = vue.ref(isStoredDark());
|
|
1434
1453
|
|
|
1435
1454
|
const applyTheme = (isDark) => {
|
|
1436
|
-
const
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
root.classList.remove('light'); // light é o default via :root
|
|
1440
|
-
|
|
1441
|
-
localStorage.setItem('theme', isDark ? 'dark' : 'light');
|
|
1455
|
+
const theme = isDark ? 'dark' : 'light';
|
|
1456
|
+
document.documentElement.setAttribute('data-theme', theme);
|
|
1457
|
+
localStorage.setItem('theme', theme);
|
|
1442
1458
|
};
|
|
1443
1459
|
|
|
1444
1460
|
const toggleTheme = () => {
|
|
@@ -1446,7 +1462,7 @@
|
|
|
1446
1462
|
emit('update:modelValue', isDarkMode.value);
|
|
1447
1463
|
};
|
|
1448
1464
|
|
|
1449
|
-
const
|
|
1465
|
+
const handleToggle = () => {
|
|
1450
1466
|
isDarkMode.value = !isDarkMode.value;
|
|
1451
1467
|
toggleTheme();
|
|
1452
1468
|
};
|
|
@@ -1468,6 +1484,25 @@
|
|
|
1468
1484
|
}
|
|
1469
1485
|
);
|
|
1470
1486
|
|
|
1487
|
+
/* 🎨 Ícone */
|
|
1488
|
+
const computedButtonIcon = vue.computed(() =>
|
|
1489
|
+
isDarkMode.value ? 'BE0130' : 'BE0140'
|
|
1490
|
+
);
|
|
1491
|
+
|
|
1492
|
+
const computedButtonIconColor = vue.computed(() =>
|
|
1493
|
+
isDarkMode.value
|
|
1494
|
+
? props.darkIconColor || '#f3c32e'
|
|
1495
|
+
: props.lightIconColor || '#000000'
|
|
1496
|
+
);
|
|
1497
|
+
|
|
1498
|
+
/* 🎯 Hover background */
|
|
1499
|
+
const computedButtonHoverBackgroundColor = vue.computed(() =>
|
|
1500
|
+
isDarkMode.value
|
|
1501
|
+
? props.darkHoverBackgroundColor || '#717171'
|
|
1502
|
+
: props.lightHoverBackgroundColor || 'rgba(0, 0, 0, 0.08)'
|
|
1503
|
+
);
|
|
1504
|
+
|
|
1505
|
+
/* 🎚 Toggle animado */
|
|
1471
1506
|
const computedLightBorderColor = vue.computed(
|
|
1472
1507
|
() => props.lightBorderColor || '#72cce3'
|
|
1473
1508
|
);
|
|
@@ -1485,43 +1520,69 @@
|
|
|
1485
1520
|
);
|
|
1486
1521
|
|
|
1487
1522
|
return (_ctx, _cache) => {
|
|
1488
|
-
return (
|
|
1489
|
-
vue.
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1523
|
+
return (!__props.hasAnimation)
|
|
1524
|
+
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [
|
|
1525
|
+
vue.createElementVNode("button", {
|
|
1526
|
+
class: "theme-switcher",
|
|
1527
|
+
type: "button",
|
|
1528
|
+
role: "switch",
|
|
1529
|
+
"aria-checked": isDarkMode.value,
|
|
1530
|
+
"aria-label": "Alternar entre tema claro e escuro",
|
|
1531
|
+
onClick: handleToggle,
|
|
1532
|
+
onKeydown: [
|
|
1533
|
+
vue.withKeys(vue.withModifiers(handleToggle, ["prevent"]), ["enter"]),
|
|
1534
|
+
vue.withKeys(vue.withModifiers(handleToggle, ["prevent"]), ["space"])
|
|
1535
|
+
],
|
|
1536
|
+
style: vue.normalizeStyle({
|
|
1537
|
+
'--hover-bg-color': computedButtonHoverBackgroundColor.value,
|
|
1538
|
+
'--icon-color': computedButtonIconColor.value
|
|
1539
|
+
})
|
|
1540
|
+
}, [
|
|
1541
|
+
vue.createVNode(vue.unref(HpIcon), {
|
|
1542
|
+
class: "theme-switcher__icon",
|
|
1543
|
+
name: computedButtonIcon.value,
|
|
1544
|
+
size: "sm",
|
|
1545
|
+
color: computedButtonIconColor.value
|
|
1546
|
+
}, null, 8, ["name", "color"])
|
|
1547
|
+
], 44, _hoisted_2$4)
|
|
1548
|
+
]))
|
|
1549
|
+
: (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$4, [
|
|
1550
|
+
vue.withDirectives(vue.createElementVNode("input", {
|
|
1551
|
+
type: "checkbox",
|
|
1552
|
+
id: __props.id,
|
|
1553
|
+
class: "toggle--checkbox",
|
|
1554
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((isDarkMode).value = $event)),
|
|
1555
|
+
onChange: toggleTheme,
|
|
1556
|
+
role: "switch",
|
|
1557
|
+
"aria-checked": isDarkMode.value,
|
|
1558
|
+
"aria-label": "Alternar entre tema claro e escuro",
|
|
1559
|
+
tabindex: "-1"
|
|
1560
|
+
}, null, 40, _hoisted_4$4), [
|
|
1561
|
+
[vue.vModelCheckbox, isDarkMode.value]
|
|
1562
|
+
]),
|
|
1563
|
+
vue.createElementVNode("label", {
|
|
1564
|
+
for: __props.id,
|
|
1565
|
+
class: "toggle--label",
|
|
1566
|
+
style: vue.normalizeStyle({
|
|
1506
1567
|
'--light-background-color': computedLightBackgroundColor.value,
|
|
1507
1568
|
'--light-border-color': computedLightBorderColor.value,
|
|
1508
1569
|
'--dark-background-color': computedDarkBackgroundColor.value,
|
|
1509
1570
|
'--dark-border-color': computedDarkBorderColor.value
|
|
1510
1571
|
}),
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1572
|
+
tabindex: "0",
|
|
1573
|
+
onKeydown: [
|
|
1574
|
+
vue.withKeys(vue.withModifiers(handleToggle, ["prevent"]), ["enter"]),
|
|
1575
|
+
vue.withKeys(vue.withModifiers(handleToggle, ["prevent"]), ["space"])
|
|
1576
|
+
]
|
|
1577
|
+
}, _cache[1] || (_cache[1] = [
|
|
1578
|
+
vue.createElementVNode("span", { class: "toggle--label-background" }, null, -1)
|
|
1579
|
+
]), 44, _hoisted_5$4)
|
|
1580
|
+
]))
|
|
1520
1581
|
}
|
|
1521
1582
|
}
|
|
1522
1583
|
|
|
1523
1584
|
};
|
|
1524
|
-
const ThemeSwitcher = /*#__PURE__*/_export_sfc(_sfc_main$4, [['__scopeId',"data-v-
|
|
1585
|
+
const ThemeSwitcher = /*#__PURE__*/_export_sfc(_sfc_main$4, [['__scopeId',"data-v-7efca676"]]);
|
|
1525
1586
|
|
|
1526
1587
|
const _hoisted_1$3 = { class: "input__fieldset" };
|
|
1527
1588
|
const _hoisted_2$3 = {
|