@henriquepetrelli/hp-design-system 1.1.2 → 1.1.3
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.
|
@@ -1324,7 +1324,36 @@ const props = __props;
|
|
|
1324
1324
|
|
|
1325
1325
|
const isDarkMode = ref(false);
|
|
1326
1326
|
|
|
1327
|
+
const getCSSVariable = (name, fallback) => {
|
|
1328
|
+
return (
|
|
1329
|
+
getComputedStyle(document.documentElement).getPropertyValue(name).trim() ||
|
|
1330
|
+
fallback
|
|
1331
|
+
)
|
|
1332
|
+
};
|
|
1333
|
+
|
|
1334
|
+
const computedLightBackgroundColor = computed(() => {
|
|
1335
|
+
return (
|
|
1336
|
+
props.lightBackgroundColor ||
|
|
1337
|
+
getCSSVariable('--color-background', '#96dcee')
|
|
1338
|
+
)
|
|
1339
|
+
});
|
|
1340
|
+
|
|
1341
|
+
const computedLightBorderColor = computed(() => {
|
|
1342
|
+
return props.lightBorderColor || getCSSVariable('--color-primary', '#72cce3')
|
|
1343
|
+
});
|
|
1344
|
+
|
|
1345
|
+
const computedDarkBackgroundColor = computed(() => {
|
|
1346
|
+
return (
|
|
1347
|
+
props.darkBackgroundColor || getCSSVariable('--color-background', '#1261a0')
|
|
1348
|
+
)
|
|
1349
|
+
});
|
|
1350
|
+
|
|
1351
|
+
const computedDarkBorderColor = computed(() => {
|
|
1352
|
+
return props.darkBorderColor || getCSSVariable('--color-primary', '#072f5f')
|
|
1353
|
+
});
|
|
1354
|
+
|
|
1327
1355
|
const toggleTheme = () => {
|
|
1356
|
+
isDarkMode.value = !isDarkMode.value;
|
|
1328
1357
|
if (isDarkMode.value) {
|
|
1329
1358
|
document.documentElement.classList.remove('light');
|
|
1330
1359
|
document.documentElement.classList.add('dark');
|
|
@@ -1337,7 +1366,6 @@ const toggleTheme = () => {
|
|
|
1337
1366
|
};
|
|
1338
1367
|
|
|
1339
1368
|
const handleKeydown = () => {
|
|
1340
|
-
isDarkMode.value = !isDarkMode.value;
|
|
1341
1369
|
toggleTheme();
|
|
1342
1370
|
};
|
|
1343
1371
|
|
|
@@ -1354,22 +1382,6 @@ onMounted(() => {
|
|
|
1354
1382
|
document.documentElement.classList.add('light');
|
|
1355
1383
|
}
|
|
1356
1384
|
});
|
|
1357
|
-
|
|
1358
|
-
const computedLightBorderColor = computed(() => {
|
|
1359
|
-
return props.lightBorderColor || '#72cce3'
|
|
1360
|
-
});
|
|
1361
|
-
|
|
1362
|
-
const computedLightBackgroundColor = computed(() => {
|
|
1363
|
-
return props.lightBackgroundColor || '#96dcee'
|
|
1364
|
-
});
|
|
1365
|
-
|
|
1366
|
-
const computedDarkBorderColor = computed(() => {
|
|
1367
|
-
return props.darkBorderColor || '#072f5f'
|
|
1368
|
-
});
|
|
1369
|
-
|
|
1370
|
-
const computedDarkBackgroundColor = computed(() => {
|
|
1371
|
-
return props.darkBackgroundColor || '#1261a0'
|
|
1372
|
-
});
|
|
1373
1385
|
|
|
1374
1386
|
return (_ctx, _cache) => {
|
|
1375
1387
|
return (openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
@@ -1410,7 +1422,7 @@ return (_ctx, _cache) => {
|
|
|
1410
1422
|
}
|
|
1411
1423
|
|
|
1412
1424
|
};
|
|
1413
|
-
const ThemeSwitcher = /*#__PURE__*/_export_sfc(_sfc_main$4, [['__scopeId',"data-v-
|
|
1425
|
+
const ThemeSwitcher = /*#__PURE__*/_export_sfc(_sfc_main$4, [['__scopeId',"data-v-74ce4ef8"]]);
|
|
1414
1426
|
|
|
1415
1427
|
const _hoisted_1$3 = { class: "input__fieldset" };
|
|
1416
1428
|
const _hoisted_2$3 = {
|