@usableapp/cardds 0.7.146 → 0.7.148

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.
@@ -9,6 +9,9 @@ export interface ScreenProps extends ComponentProps<'div'> {
9
9
  as?: 'div' | 'main' | 'section';
10
10
  /** TOP: a `TopBar` / `AppBar`, or `"lead"` — no bar, the content starts `--screen-lead` (15% of the screen) down */
11
11
  top?: ReactNode | 'lead';
12
+ /** a ROW PINNED under the top (a `Row`: the request a chat is about, its time, an arrow to its card) — it never scrolls away;
13
+ * the content starts under it, however tall it grows. Edge to edge on the screen's ground, touching the top bar */
14
+ topRow?: ReactNode;
12
15
  /** BOTTOM: an `ActionBar` (or a `FloatBar`, or a chat's `MessageBar`) — a LAYER over the content's foot, as tall as its rows need.
13
16
  * Never with a `Sheet` in the content: a sheet finishes on its own foot (warns once). */
14
17
  bottom?: ReactNode;
@@ -20,13 +23,13 @@ export interface ScreenProps extends ComponentProps<'div'> {
20
23
  /**
21
24
  * Screen — the mobile screen in THREE parts: **top** and **content** (the children) in one flex column, the content down to the
22
25
  * screen's foot; **bottom** a LAYER over it there (Lh 2026-09-23). Top = `TopBar` / `AppBar`, or `top="lead"` (no bar, the words start
23
- * 15% down). Content = a box of components one after another — a `Step` (`Pages` of `Page`s / a `Page` [+ `Sheet`]), a `Centre`, a
26
+ * 15% down), and under it `topRow`, a row pinned there (it never scrolls away). Content = a box of components one after another — a `Step` (`Pages` of `Page`s / a `Page` [+ `Sheet`]), a `Centre`, a
24
27
  * `SheetStack`… Bottom = an `ActionBar` (the walk's `Pager` its first row) or a `FloatBar`, covering the content's foot on purpose. Max 34.375rem (550px) wide, the standard inset, no vertical padding. A plain Screen (no `fill`) scrolls.
25
28
  * ONE OUTCOME, DRAWN ONCE (Lh 2026-10-01): a screen that can come out more than one way is not drawn until the app knows which —
26
29
  * `ready={false}` until then.
27
30
  * The slots set the order; children laid by hand in the same order still work.
28
31
  */
29
- export declare function Screen({ fill, palette, as, top, bottom, ready, className, children, ref, ...rest }: ScreenProps): import("react").DetailedReactHTMLElement<{
32
+ export declare function Screen({ fill, palette, as, top, topRow, bottom, ready, className, children, ref, ...rest }: ScreenProps): import("react").DetailedReactHTMLElement<{
30
33
  key?: import("react").Key | null | undefined;
31
34
  defaultChecked?: boolean | undefined;
32
35
  defaultValue?: string | number | readonly string[] | undefined;
@@ -4,13 +4,13 @@ import { cx } from '../cx.js';
4
4
  /**
5
5
  * Screen — the mobile screen in THREE parts: **top** and **content** (the children) in one flex column, the content down to the
6
6
  * screen's foot; **bottom** a LAYER over it there (Lh 2026-09-23). Top = `TopBar` / `AppBar`, or `top="lead"` (no bar, the words start
7
- * 15% down). Content = a box of components one after another — a `Step` (`Pages` of `Page`s / a `Page` [+ `Sheet`]), a `Centre`, a
7
+ * 15% down), and under it `topRow`, a row pinned there (it never scrolls away). Content = a box of components one after another — a `Step` (`Pages` of `Page`s / a `Page` [+ `Sheet`]), a `Centre`, a
8
8
  * `SheetStack`… Bottom = an `ActionBar` (the walk's `Pager` its first row) or a `FloatBar`, covering the content's foot on purpose. Max 34.375rem (550px) wide, the standard inset, no vertical padding. A plain Screen (no `fill`) scrolls.
9
9
  * ONE OUTCOME, DRAWN ONCE (Lh 2026-10-01): a screen that can come out more than one way is not drawn until the app knows which —
10
10
  * `ready={false}` until then.
11
11
  * The slots set the order; children laid by hand in the same order still work.
12
12
  */
13
- export function Screen({ fill, palette, as = 'div', top, bottom, ready = true, className, children, ref, ...rest }) {
13
+ export function Screen({ fill, palette, as = 'div', top, topRow, bottom, ready = true, className, children, ref, ...rest }) {
14
14
  const own = useRef(null);
15
15
  useEffect(() => {
16
16
  const el = own.current;
@@ -39,5 +39,5 @@ export function Screen({ fill, palette, as = 'div', top, bottom, ready = true, c
39
39
  }
40
40
  return watchSize([lead], () => el.style.setProperty('--top-h', `${lead.offsetHeight}px`));
41
41
  }, [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);
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 && topRow != null ? createElement('div', { className: 'screen__top-row' }, topRow) : null, ready ? children : null, ready ? bottom : null);
43
43
  }
package/docs/reference.md CHANGED
@@ -327,6 +327,7 @@ of `Screen`:
327
327
  | Part | Prop | What fills it |
328
328
  |---|---|---|
329
329
  | **top** | `top` | `TopBar` · `AppBar` · `"lead"` (no bar: the content starts `--screen-lead`, 15% of the screen, down) |
330
+ | **top row** | `topRow` | one `Row` pinned under the top (a chat's request: icon · words · arrow to its card) · nothing |
330
331
  | **content** | children | a `Step` (`Pages` · `Page` · `Page` + `Sheet`) · `Centre` · `SheetStack` … |
331
332
  | **bottom** | `bottom` | `ActionBar` (rows: `controls` · the one `cta` row — the pager bar ← → or one wide button · a `ctaLink`) · `FloatBar` · `MessageBar` (a chat) · nothing |
332
333
 
@@ -348,6 +349,9 @@ of `Screen`:
348
349
  `defaultValue`); `onSend(words)` hands them to the app, then the bar asks for an empty box; the cursor stays in the box, so
349
350
  the keyboard stays up. It is a layer like the `ActionBar`: measured into `--bottom-h`, lifted by `--kb`. It is not the
350
351
  `Composer` (the one big write-in on a sheet) and not a sheet's form: a message is sent from where it is read.
352
+ - **A row pinned under the top is `topRow`** (Lh 2026-10-26) — `<Screen fill top={<TopBar…/>} topRow={<Row>…</Row>}>`: a row
353
+ of the column, so it never scrolls away and the content starts under it at its real height; it touches the bar, edge to
354
+ edge, on the screen's ground (`--top-row-bg`). On a scrolling screen it sticks to the top once the bar has gone.
351
355
  - **A screen with a `Sheet` has no bottom.** The sheet finishes on its own `Foot`; `Screen` warns once when both
352
356
  are there.
353
357
  - **Templates** are `Screen`s with the three parts filled (`Walkthrough` = top `lead` · content `Pages` · bottom
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usableapp/cardds",
3
- "version": "0.7.146",
3
+ "version": "0.7.148",
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).",