@henriquepetrelli/hp-design-system 1.1.15 → 1.1.16

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.
@@ -1423,12 +1423,19 @@ const props = __props;
1423
1423
 
1424
1424
  const emit = __emit;
1425
1425
 
1426
- const isDarkMode = ref(localStorage.getItem('theme') === 'dark');
1426
+ const isDarkMode = ref(
1427
+ typeof window !== 'undefined' && localStorage.getItem('theme') === 'dark'
1428
+ );
1427
1429
 
1428
1430
  const applyTheme = (isDark) => {
1429
- document.documentElement.classList.toggle('dark', isDark);
1430
- document.documentElement.classList.toggle('light', !isDark);
1431
- localStorage.setItem('theme', isDark ? 'dark' : 'light');
1431
+ if (typeof document === 'undefined') return
1432
+
1433
+ const theme = isDark ? 'dark' : 'light';
1434
+
1435
+ document.documentElement.classList.remove('dark', 'light');
1436
+ document.documentElement.classList.add(theme);
1437
+
1438
+ localStorage.setItem('theme', theme);
1432
1439
  };
1433
1440
 
1434
1441
  const toggleTheme = () => {
@@ -1441,10 +1448,6 @@ const handleKeydown = () => {
1441
1448
  toggleTheme();
1442
1449
  };
1443
1450
 
1444
- onMounted(() => {
1445
- applyTheme(isDarkMode.value);
1446
- });
1447
-
1448
1451
  watch(
1449
1452
  () => props.modelValue,
1450
1453
  (value) => {
@@ -1507,7 +1510,7 @@ return (_ctx, _cache) => {
1507
1510
  }
1508
1511
 
1509
1512
  };
1510
- const ThemeSwitcher = /*#__PURE__*/_export_sfc(_sfc_main$4, [['__scopeId',"data-v-e4250caa"]]);
1513
+ const ThemeSwitcher = /*#__PURE__*/_export_sfc(_sfc_main$4, [['__scopeId',"data-v-ba2225dd"]]);
1511
1514
 
1512
1515
  const _hoisted_1$3 = { class: "input__fieldset" };
1513
1516
  const _hoisted_2$3 = {