@klodd/ds 3.13.0 → 3.14.0

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,10 @@
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, overrideas av JS
437
+ (pwa-register.js syncViewport) via visualViewport.height -
438
+ fungerar som iOS-cold-start-fix (lasningen tvingar WebKit
439
+ att stabilisera viewport-geometri).
436
440
  ================================================================ */
437
441
  :root {
438
442
  --safe-top: env(safe-area-inset-top, 0px);
@@ -440,6 +444,8 @@
440
444
  --safe-left: env(safe-area-inset-left, 0px);
441
445
  --safe-right: env(safe-area-inset-right, 0px);
442
446
 
447
+ --viewport-height: 100vh;
448
+
443
449
  --touch-min: 44px;
444
450
 
445
451
  /* Bottom-nav-tokens lever i 10-semantic.css som calc-baserade
@@ -61,6 +61,26 @@
61
61
  });
62
62
  }
63
63
 
64
+ /*------------------------------------------------------------
65
+ Viewport-sync (iOS PWA cold-start fix)
66
+ iOS Safari beraknar env(safe-area-inset-bottom) felaktigt vid
67
+ forsta render i PWA-standalone. Att tidigt lasa
68
+ visualViewport.height + skriva till en CSS-custom-property
69
+ tvingar WebKit att stabilisera sin viewport-geometri innan
70
+ layout-pass kor klart.
71
+
72
+ --viewport-height-tokenet ar tillagg for framtida konsumenter
73
+ som behover en JS-driven viewport-hojd. Defaulter till 100vh
74
+ i 00-primitives.css.
75
+ ------------------------------------------------------------*/
76
+ function syncViewport() {
77
+ if (!root.visualViewport) return;
78
+ doc.documentElement.style.setProperty(
79
+ '--viewport-height',
80
+ root.visualViewport.height + 'px'
81
+ );
82
+ }
83
+
64
84
  /*------------------------------------------------------------
65
85
  Public API. Anvand KloddPWA.init({...}) FORE script-laddning av
66
86
  denna fil (sa _cfg ar satt nar getCfg() koras), eller bara lat
@@ -71,4 +91,9 @@
71
91
  root.KloddPWA.config = cfg;
72
92
 
73
93
  registerSW(cfg);
94
+
95
+ if (root.visualViewport) {
96
+ root.visualViewport.addEventListener('resize', syncViewport);
97
+ }
98
+ syncViewport();
74
99
  })(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.0",
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`)