@henriquepetrelli/hp-design-system 1.1.4 → 1.1.5
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.
|
@@ -1290,7 +1290,7 @@
|
|
|
1290
1290
|
const ToggleSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-14c54b46"]]);
|
|
1291
1291
|
|
|
1292
1292
|
const _hoisted_1$4 = { class: "theme-switcher-container" };
|
|
1293
|
-
const _hoisted_2$4 = ["id", "aria-checked"];
|
|
1293
|
+
const _hoisted_2$4 = ["id", "checked", "aria-checked"];
|
|
1294
1294
|
const _hoisted_3$4 = ["for", "onKeydown"];
|
|
1295
1295
|
|
|
1296
1296
|
|
|
@@ -1328,37 +1328,6 @@
|
|
|
1328
1328
|
|
|
1329
1329
|
const isDarkMode = vue.ref(false);
|
|
1330
1330
|
|
|
1331
|
-
// Função para pegar variáveis CSS do projeto
|
|
1332
|
-
const getCSSVariable = (name, fallback) => {
|
|
1333
|
-
return (
|
|
1334
|
-
getComputedStyle(document.documentElement).getPropertyValue(name).trim() ||
|
|
1335
|
-
fallback
|
|
1336
|
-
)
|
|
1337
|
-
};
|
|
1338
|
-
|
|
1339
|
-
// Computed para cores do switcher
|
|
1340
|
-
const computedLightBackgroundColor = vue.computed(() => {
|
|
1341
|
-
return (
|
|
1342
|
-
props.lightBackgroundColor ||
|
|
1343
|
-
getCSSVariable('--color-background', '#96dcee')
|
|
1344
|
-
)
|
|
1345
|
-
});
|
|
1346
|
-
|
|
1347
|
-
const computedLightBorderColor = vue.computed(() => {
|
|
1348
|
-
return props.lightBorderColor || getCSSVariable('--color-primary', '#72cce3')
|
|
1349
|
-
});
|
|
1350
|
-
|
|
1351
|
-
const computedDarkBackgroundColor = vue.computed(() => {
|
|
1352
|
-
return (
|
|
1353
|
-
props.darkBackgroundColor || getCSSVariable('--color-background', '#1261a0')
|
|
1354
|
-
)
|
|
1355
|
-
});
|
|
1356
|
-
|
|
1357
|
-
const computedDarkBorderColor = vue.computed(() => {
|
|
1358
|
-
return props.darkBorderColor || getCSSVariable('--color-primary', '#072f5f')
|
|
1359
|
-
});
|
|
1360
|
-
|
|
1361
|
-
// Alterna tema baseado no valor atual de isDarkMode
|
|
1362
1331
|
const toggleTheme = () => {
|
|
1363
1332
|
if (isDarkMode.value) {
|
|
1364
1333
|
document.documentElement.classList.remove('light');
|
|
@@ -1371,13 +1340,11 @@
|
|
|
1371
1340
|
}
|
|
1372
1341
|
};
|
|
1373
1342
|
|
|
1374
|
-
// Alterna tema via teclado
|
|
1375
1343
|
const handleKeydown = () => {
|
|
1376
1344
|
isDarkMode.value = !isDarkMode.value;
|
|
1377
1345
|
toggleTheme();
|
|
1378
1346
|
};
|
|
1379
1347
|
|
|
1380
|
-
// Inicializa o tema baseado no localStorage ou preferência do sistema
|
|
1381
1348
|
vue.onMounted(() => {
|
|
1382
1349
|
const savedTheme =
|
|
1383
1350
|
localStorage.getItem('theme') ||
|
|
@@ -1391,6 +1358,22 @@
|
|
|
1391
1358
|
document.documentElement.classList.add('light');
|
|
1392
1359
|
}
|
|
1393
1360
|
});
|
|
1361
|
+
|
|
1362
|
+
const computedLightBorderColor = vue.computed(() => {
|
|
1363
|
+
return props.lightBorderColor || '#72cce3'
|
|
1364
|
+
});
|
|
1365
|
+
|
|
1366
|
+
const computedLightBackgroundColor = vue.computed(() => {
|
|
1367
|
+
return props.lightBackgroundColor || '#96dcee'
|
|
1368
|
+
});
|
|
1369
|
+
|
|
1370
|
+
const computedDarkBorderColor = vue.computed(() => {
|
|
1371
|
+
return props.darkBorderColor || '#072f5f'
|
|
1372
|
+
});
|
|
1373
|
+
|
|
1374
|
+
const computedDarkBackgroundColor = vue.computed(() => {
|
|
1375
|
+
return props.darkBackgroundColor || '#1261a0'
|
|
1376
|
+
});
|
|
1394
1377
|
|
|
1395
1378
|
return (_ctx, _cache) => {
|
|
1396
1379
|
return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [
|
|
@@ -1399,6 +1382,7 @@
|
|
|
1399
1382
|
id: __props.id,
|
|
1400
1383
|
class: "toggle--checkbox",
|
|
1401
1384
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((isDarkMode).value = $event)),
|
|
1385
|
+
checked: __props.modelValue,
|
|
1402
1386
|
onChange: toggleTheme,
|
|
1403
1387
|
role: "switch",
|
|
1404
1388
|
"aria-checked": isDarkMode.value,
|
|
@@ -1430,7 +1414,7 @@
|
|
|
1430
1414
|
}
|
|
1431
1415
|
|
|
1432
1416
|
};
|
|
1433
|
-
const ThemeSwitcher = /*#__PURE__*/_export_sfc(_sfc_main$4, [['__scopeId',"data-v-
|
|
1417
|
+
const ThemeSwitcher = /*#__PURE__*/_export_sfc(_sfc_main$4, [['__scopeId',"data-v-08fdca46"]]);
|
|
1434
1418
|
|
|
1435
1419
|
const _hoisted_1$3 = { class: "input__fieldset" };
|
|
1436
1420
|
const _hoisted_2$3 = {
|