@usableapp/cardds 0.7.128 → 0.7.130

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.
@@ -1,4 +1,5 @@
1
1
  import { createElement, useEffect, useRef } from 'react';
2
+ import { createPortal } from 'react-dom';
2
3
  import { setRefs, warnOnce, watchSize } from '../state.js';
3
4
  import { cx } from '../cx.js';
4
5
  /**
@@ -39,5 +40,10 @@ export function Screen({ fill, palette, as = 'div', top, bottom, ready = true, c
39
40
  }
40
41
  return watchSize([lead], () => el.style.setProperty('--top-h', `${lead.offsetHeight}px`));
41
42
  }, [top, ready]);
42
- return createElement(as, { className: cx('screen', fill && 'screen--fill', top === 'lead' && 'screen--lead', className), 'data-palette': palette, 'data-pending': ready ? undefined : '', 'aria-busy': ready ? undefined : true, ref: setRefs(own, ref), ...rest }, ready && top !== 'lead' ? top : null, ready ? children : null, ready ? bottom : null);
43
+ /* the safe-top strip (base.css .safe-top): a fill screen renders it from the first frame, into <body> — inside .screen its
44
+ container-type would hold the fixed strip and its z-index to the screen. Shown only on iOS from the home screen, by css */
45
+ const strip = fill && typeof document !== 'undefined'
46
+ ? createPortal(createElement('div', { className: 'safe-top', 'aria-hidden': true, 'data-palette': palette }), document.body)
47
+ : null;
48
+ return createElement(as, { className: cx('screen', fill && 'screen--fill', top === 'lead' && 'screen--lead', className), 'data-palette': palette, 'data-pending': ready ? undefined : '', 'aria-busy': ready ? undefined : true, ref: setRefs(own, ref), ...rest }, ready && top !== 'lead' ? top : null, ready ? children : null, ready ? bottom : null, strip);
43
49
  }
package/docs/reference.md CHANGED
@@ -55,7 +55,11 @@ import './theme.css'; // the project's own look, after the system's — see "A
55
55
  `viewport-fit=cover` = the app runs edge to edge under the phone's own bars; cardds publishes their room as
56
56
  `--safe-top` / `--safe-bottom` (from `env(safe-area-inset-*)`, 0 without cover) and keeps what the member reads or taps
57
57
  clear of them — the bottom bar's buttons, a sheet's peeked head, its foot and the end of its body, the float bar, the FAB,
58
- a stage's foot; a fill `Screen` starts under the status bar — while every ground still runs to the edge. A
58
+ a stage's foot; a fill `Screen` starts under the status bar — while every ground still runs to the edge. A fill
59
+ `Screen` also renders a `.safe-top` strip into `<body>`, over every layer (`--z-ceiling`), shown only on iOS run from the home
60
+ screen: iOS 26 blurs the top of a home-screen web app with Liquid Glass, and an opaque fixed box topmost there turns the blur
61
+ off, so a sheet's grab handle stays in sight. What shows is the `--safe-top` room in the screen's ground (`--safe-top-bg`,
62
+ default `--surface`; set it in `:root`, the strip is outside the screen); where `--safe-top` is 0 nothing shows. Nothing to add. A
59
63
  component of the app's own pinned to an edge reads the same two tokens. `interactive-widget=resizes-content` =
60
64
  Android shrinks the page for the keyboard (`--kb` stays 0 there; iOS publishes it).
61
65
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usableapp/cardds",
3
- "version": "0.7.128",
3
+ "version": "0.7.130",
4
4
  "license": "UNLICENSED",
5
5
  "type": "module",
6
6
  "description": "card-first mobile design system, React-first: the components in src/ are thin wrappers over the CSS contract (css/*.css stays the only truth); gallery/ shows every story live (npm run dev), tests/ measures the geometry.",