@usableapp/cardds 0.2.1 → 0.2.2

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.
package/README.md CHANGED
@@ -49,8 +49,9 @@ inlines the 56 symbols of `icons.svg` at build time, so no sprite file ships.
49
49
  aliased to `src/`, so the gallery and the package share one truth with no build between them.
50
50
  `/` every story of every component, `/:Name` one component — each `.design-sync/previews/<Name>.tsx`
51
51
  story live in a 375×812 phone cell, grouped by `src/<group>/`, searchable; switches for the palette
52
- (`own` = a colour well per colour base), inspect (box outlines + dimensions), text size, and a slider
53
- per size base. Nothing is hand-listed: add a preview file or a story and it shows.
52
+ (`own` = a colour well per colour base), inspect (box outlines + dimensions), a mock keyboard (focus a field:
53
+ it comes up over the phone cell and publishes `--kb` there — to SEE what a keyboard leaves of the screen; it
54
+ types nothing), text size, and a slider per size base. Nothing is hand-listed: add a preview file or a story and it shows.
54
55
 
55
56
  **CSS only** (no React, no build):
56
57
 
@@ -233,6 +234,11 @@ whose markup has rules, because the sheet's box is the step itself:
233
234
  - **The bar is outside the step**, after it. `.step` reads the bar's room
234
235
  from `--bar-reserve`; any parent that hosts the `.action-bar` counts
235
236
  (`<body>`, an app shell, a demo frame).
237
+ - **Every sheet has one shape** (Lh 2026-09-21): the handle and the head stay at the top and never scroll · the
238
+ foot's button stands at the bottom — above the keyboard when there is one (`--kb`: a step gives the keyboard
239
+ its room, a stage sheet gives it up itself as `--_lift`) · everything between them scrolls, as far as it
240
+ needs to: the body's bottom padding is the part that slid under (`--_cover`), so the last row comes up to
241
+ the button at half and 3q as it does at full.
236
242
  - **Layers: the base, the sheet over it, the top bar** (Lh 2026-09-20). The `.action-bar` belongs to the
237
243
  BASE — the move of a page of words (a pager, or one wide button). It is never in front of a sheet. A
238
244
  screen with a sheet finishes ON the sheet: a `.card__foot`, the sheet's last child — ONE row, the page's
package/cardds.js CHANGED
@@ -420,6 +420,10 @@ document.addEventListener('click', e => {
420
420
  });
421
421
  });
422
422
 
423
+ /* the two calls an app makes are on window: a bundler loads this file as a module, where a top-level
424
+ function is not a global — and README has always said "call carddsSheetSet(sheet, state)". */
425
+ if (typeof window !== 'undefined') Object.assign(window, { carddsSheetSet, carddsSheetReveal });
426
+
423
427
  /* ---- called sheets (sheet.css): a button in a step's words names a sheet with aria-controls ----
424
428
  (The base offers ways in — sign in · new phone · join — each sheet holds that way's whole form and
425
429
  its own submit on its foot.) A tap on it sends every other sheet of that step away and raises its own to the top state it snaps
package/css/sheet.css CHANGED
@@ -125,6 +125,12 @@
125
125
  the cut. A length from the box's container units (--_box), since the
126
126
  cut is a share of the SHEET's height, not of the body's. */
127
127
  scroll-padding-bottom: var(--_cover);
128
+ /* …and its content has to be able to LEAVE that part: the same length as bottom padding, so the last row
129
+ scrolls up to the visible edge at half and 3q as it does at full — everything between the head and the
130
+ foot can be reached at any state (Lh, 2026-09-21). Padding, not a shorter box: nothing that shows moves
131
+ when the state changes, only how far the body scrolls; a child that fills the body (a composer) fills
132
+ the part that shows. */
133
+ padding-bottom: var(--_cover);
128
134
  }
129
135
  /* ---- the sheet's foot: the button that FINISHES the sheet, on the sheet (Lh, 2026-09-20) ----
130
136
  A screen with a sheet has no bar in front of it: the button that completes what the sheet asks — the
@@ -151,8 +157,13 @@
151
157
  .sheet:has(> .card__foot) > .sheet__body { margin-bottom: calc(var(--_foot) - var(--card-pad)); } /* the body stops above the strip (the card's own padding is the rest) */
152
158
  .sheet.is-dragging > .card__foot { transition: none; }
153
159
  :is(.sheet--peek, .sheet--away) > .card__foot { opacity: 0; visibility: hidden; transition: translate var(--motion-sheet) ease, opacity var(--motion-sheet) ease, visibility 0s linear var(--motion-sheet); }
160
+ /* that padding can be taller than the body's own box (a short box: a small phone with the keyboard up) and a
161
+ box is never smaller than its padding — so the pinned parts must not give way to it: the body runs past
162
+ the sheet's clipped edge instead, where nothing shows anyway. At peek and away no part of the body shows. */
163
+ .sheet > :not(.sheet__body) { flex-shrink: 0; }
164
+ :is(.sheet--peek, .sheet--away) > .sheet__body { padding-bottom: 0; }
154
165
  .sheet__body > * { min-width: 0; } /* as .card > *: children shrink to the track, never widen it */
155
- .sheet__body:last-child { margin-bottom: calc(-1 * var(--card-pad)); padding-bottom: var(--card-pad); }
166
+ .sheet__body:last-child { margin-bottom: calc(-1 * var(--card-pad)); padding-bottom: calc(var(--card-pad) + var(--_cover)); }
156
167
 
157
168
  /* grab handle — first child of the sheet. Drawn as a small bar, but it is
158
169
  the thumb's grab area for the whole strip above the title: a pseudo widens
@@ -313,6 +324,12 @@
313
324
  /* raised: the sheet floats above a footnote strip on the scrim. Its bottom
314
325
  edge shows, so it gets its corners and border back; full still stops at
315
326
  the top bar's line, because the top edge never moved. */
327
+ /* EVERY sheet has one shape (Lh, 2026-09-21): the handle and the head stay at the top and never scroll · the
328
+ foot's button stands at the bottom, and ABOVE the keyboard when there is one · everything between them
329
+ scrolls, as far as it needs to. In a .step the keyboard's room is the step's (--kb, step.css); on a stage
330
+ the sheet gives it up itself, as --_lift — the same token a raised sheet floats on. */
331
+ .sheet-stage > .sheet { --_lift: var(--kb, 0rem); bottom: var(--_lift); }
332
+ .sheet-stage > .sheet--raised { --_lift: calc(var(--tap-lg) + var(--kb, 0rem)); }
316
333
  .sheet--raised { --_lift: var(--tap-lg); bottom: var(--_lift); border-radius: var(--r-card); border-bottom: var(--border-w) solid var(--card-border); }
317
334
  .sheet-stage__foot {
318
335
  position: absolute;
package/dist/cardds.css CHANGED
@@ -1202,6 +1202,12 @@ button { font: inherit; cursor: pointer; }
1202
1202
  the cut. A length from the box's container units (--_box), since the
1203
1203
  cut is a share of the SHEET's height, not of the body's. */
1204
1204
  scroll-padding-bottom: var(--_cover);
1205
+ /* …and its content has to be able to LEAVE that part: the same length as bottom padding, so the last row
1206
+ scrolls up to the visible edge at half and 3q as it does at full — everything between the head and the
1207
+ foot can be reached at any state (Lh, 2026-09-21). Padding, not a shorter box: nothing that shows moves
1208
+ when the state changes, only how far the body scrolls; a child that fills the body (a composer) fills
1209
+ the part that shows. */
1210
+ padding-bottom: var(--_cover);
1205
1211
  }
1206
1212
  /* ---- the sheet's foot: the button that FINISHES the sheet, on the sheet (Lh, 2026-09-20) ----
1207
1213
  A screen with a sheet has no bar in front of it: the button that completes what the sheet asks — the
@@ -1228,8 +1234,13 @@ button { font: inherit; cursor: pointer; }
1228
1234
  .sheet:has(> .card__foot) > .sheet__body { margin-bottom: calc(var(--_foot) - var(--card-pad)); } /* the body stops above the strip (the card's own padding is the rest) */
1229
1235
  .sheet.is-dragging > .card__foot { transition: none; }
1230
1236
  :is(.sheet--peek, .sheet--away) > .card__foot { opacity: 0; visibility: hidden; transition: translate var(--motion-sheet) ease, opacity var(--motion-sheet) ease, visibility 0s linear var(--motion-sheet); }
1237
+ /* that padding can be taller than the body's own box (a short box: a small phone with the keyboard up) and a
1238
+ box is never smaller than its padding — so the pinned parts must not give way to it: the body runs past
1239
+ the sheet's clipped edge instead, where nothing shows anyway. At peek and away no part of the body shows. */
1240
+ .sheet > :not(.sheet__body) { flex-shrink: 0; }
1241
+ :is(.sheet--peek, .sheet--away) > .sheet__body { padding-bottom: 0; }
1231
1242
  .sheet__body > * { min-width: 0; } /* as .card > *: children shrink to the track, never widen it */
1232
- .sheet__body:last-child { margin-bottom: calc(-1 * var(--card-pad)); padding-bottom: var(--card-pad); }
1243
+ .sheet__body:last-child { margin-bottom: calc(-1 * var(--card-pad)); padding-bottom: calc(var(--card-pad) + var(--_cover)); }
1233
1244
 
1234
1245
  /* grab handle — first child of the sheet. Drawn as a small bar, but it is
1235
1246
  the thumb's grab area for the whole strip above the title: a pseudo widens
@@ -1390,6 +1401,12 @@ button { font: inherit; cursor: pointer; }
1390
1401
  /* raised: the sheet floats above a footnote strip on the scrim. Its bottom
1391
1402
  edge shows, so it gets its corners and border back; full still stops at
1392
1403
  the top bar's line, because the top edge never moved. */
1404
+ /* EVERY sheet has one shape (Lh, 2026-09-21): the handle and the head stay at the top and never scroll · the
1405
+ foot's button stands at the bottom, and ABOVE the keyboard when there is one · everything between them
1406
+ scrolls, as far as it needs to. In a .step the keyboard's room is the step's (--kb, step.css); on a stage
1407
+ the sheet gives it up itself, as --_lift — the same token a raised sheet floats on. */
1408
+ .sheet-stage > .sheet { --_lift: var(--kb, 0rem); bottom: var(--_lift); }
1409
+ .sheet-stage > .sheet--raised { --_lift: calc(var(--tap-lg) + var(--kb, 0rem)); }
1393
1410
  .sheet--raised { --_lift: var(--tap-lg); bottom: var(--_lift); border-radius: var(--r-card); border-bottom: var(--border-w) solid var(--card-border); }
1394
1411
  .sheet-stage__foot {
1395
1412
  position: absolute;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usableapp/cardds",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
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.",