@klodd/ds 3.13.0 → 3.14.1

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.
@@ -433,6 +433,8 @@
433
433
  ==== PWA / SAFE AREA
434
434
  env(safe-area-inset-*) anvands for iOS-notch/home-indicator.
435
435
  Touch-min 44px ar Apples HIG-rekommendation.
436
+ --viewport-height defaultar till 100vh - reserverat for framtida
437
+ JS-driven viewport-hojd-konsument (ofarlig om oanvand).
436
438
  ================================================================ */
437
439
  :root {
438
440
  --safe-top: env(safe-area-inset-top, 0px);
@@ -440,6 +442,8 @@
440
442
  --safe-left: env(safe-area-inset-left, 0px);
441
443
  --safe-right: env(safe-area-inset-right, 0px);
442
444
 
445
+ --viewport-height: 100vh;
446
+
443
447
  --touch-min: 44px;
444
448
 
445
449
  /* Bottom-nav-tokens lever i 10-semantic.css som calc-baserade
@@ -61,6 +61,24 @@
61
61
  });
62
62
  }
63
63
 
64
+ /*------------------------------------------------------------
65
+ Safe-area cold-start-fix (iOS PWA + Safari)
66
+ iOS Safari beraknar env(safe-area-inset-bottom) felaktigt vid
67
+ forsta render - .bottom-nav landar pa fel position. Att lasa
68
+ computed style pa .bottom-nav tvingar WebKit att resolva
69
+ env-varden i layout-passet, vilket retroaktivt korrigerar
70
+ pilen-positionen.
71
+
72
+ Trippel-event-binding tacker alla cold-start-cases:
73
+ - DOMContentLoaded: tidigt efter document parsing
74
+ - load: efter att alla resurser (font, splash, etc.) laddats
75
+ - pageshow: iOS bfcache-restore (back/forward, switch tabs)
76
+ ------------------------------------------------------------*/
77
+ function forceSafeAreaOnNav() {
78
+ const nav = doc.querySelector('.bottom-nav');
79
+ if (nav) void getComputedStyle(nav).bottom;
80
+ }
81
+
64
82
  /*------------------------------------------------------------
65
83
  Public API. Anvand KloddPWA.init({...}) FORE script-laddning av
66
84
  denna fil (sa _cfg ar satt nar getCfg() koras), eller bara lat
@@ -71,4 +89,8 @@
71
89
  root.KloddPWA.config = cfg;
72
90
 
73
91
  registerSW(cfg);
92
+
93
+ doc.addEventListener('DOMContentLoaded', forceSafeAreaOnNav);
94
+ root.addEventListener('load', forceSafeAreaOnNav);
95
+ root.addEventListener('pageshow', forceSafeAreaOnNav);
74
96
  })(typeof window !== 'undefined' ? window : globalThis, document);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@klodd/ds",
3
- "version": "3.13.0",
3
+ "version": "3.14.1",
4
4
  "description": "Klodd shared design system - tokens, components, JS",
5
5
  "main": "css/index.css",
6
6
  "bin": {
@@ -191,8 +191,8 @@ För varje entry gäller:
191
191
  - **INTE:** Vanlig `<h1>` (anvand `.heading-1`)
192
192
 
193
193
  ### chip (`chip.css`)
194
- - **Blocks:** `.chip`, `.chip-list` (sibling-wrapper for chips i rad), `.brand-pill`, `.month-pill`, `.install-chip` (PWA install-prompt)
195
- - **Element:** `.chip-list__item`, `.chip-list__text`, `.chip-list__form`, `.chip-list__delete`, `.chip-list__add`, `.install-chip__text`, `.install-chip__install`, `.install-chip__dismiss`
194
+ - **Blocks:** `.chip`, `.chip-list` (sibling-wrapper for chips i rad), `.brand-pill`, `.month-pill`
195
+ - **Element:** `.chip-list__item`, `.chip-list__text`, `.chip-list__form`, `.chip-list__delete`, `.chip-list__add`
196
196
  - **Modifiers:** `.chip--accent/-positive/-negative/-warning/-faint`
197
197
  - **Anvand:** Kort-format pills med dot-prefix (status, kategori, count)
198
198
  - **INTE:** Form-inputs (anvand `.input`)