@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.
@@ -1328,7 +1328,36 @@
1328
1328
 
1329
1329
  const isDarkMode = vue.ref(false);
1330
1330
 
1331
+ const getCSSVariable = (name, fallback) => {
1332
+ return (
1333
+ getComputedStyle(document.documentElement).getPropertyValue(name).trim() ||
1334
+ fallback
1335
+ )
1336
+ };
1337
+
1338
+ const computedLightBackgroundColor = vue.computed(() => {
1339
+ return (
1340
+ props.lightBackgroundColor ||
1341
+ getCSSVariable('--color-background', '#96dcee')
1342
+ )
1343
+ });
1344
+
1345
+ const computedLightBorderColor = vue.computed(() => {
1346
+ return props.lightBorderColor || getCSSVariable('--color-primary', '#72cce3')
1347
+ });
1348
+
1349
+ const computedDarkBackgroundColor = vue.computed(() => {
1350
+ return (
1351
+ props.darkBackgroundColor || getCSSVariable('--color-background', '#1261a0')
1352
+ )
1353
+ });
1354
+
1355
+ const computedDarkBorderColor = vue.computed(() => {
1356
+ return props.darkBorderColor || getCSSVariable('--color-primary', '#072f5f')
1357
+ });
1358
+
1331
1359
  const toggleTheme = () => {
1360
+ isDarkMode.value = !isDarkMode.value;
1332
1361
  if (isDarkMode.value) {
1333
1362
  document.documentElement.classList.remove('light');
1334
1363
  document.documentElement.classList.add('dark');
@@ -1341,7 +1370,6 @@
1341
1370
  };
1342
1371
 
1343
1372
  const handleKeydown = () => {
1344
- isDarkMode.value = !isDarkMode.value;
1345
1373
  toggleTheme();
1346
1374
  };
1347
1375
 
@@ -1358,22 +1386,6 @@
1358
1386
  document.documentElement.classList.add('light');
1359
1387
  }
1360
1388
  });
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
- });
1377
1389
 
1378
1390
  return (_ctx, _cache) => {
1379
1391
  return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [
@@ -1414,7 +1426,7 @@
1414
1426
  }
1415
1427
 
1416
1428
  };
1417
- const ThemeSwitcher = /*#__PURE__*/_export_sfc(_sfc_main$4, [['__scopeId',"data-v-08fdca46"]]);
1429
+ const ThemeSwitcher = /*#__PURE__*/_export_sfc(_sfc_main$4, [['__scopeId',"data-v-74ce4ef8"]]);
1418
1430
 
1419
1431
  const _hoisted_1$3 = { class: "input__fieldset" };
1420
1432
  const _hoisted_2$3 = {