@usableapp/cardds 0.7.14 → 0.7.16

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.
Files changed (59) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.md +6 -8
  3. package/css/actions.css +24 -1
  4. package/css/base.css +2 -2
  5. package/css/card.css +9 -13
  6. package/css/choice.css +2 -2
  7. package/css/journey.css +3 -3
  8. package/css/layover.css +5 -17
  9. package/css/media.css +6 -5
  10. package/css/numbers.css +4 -3
  11. package/css/palette.css +81 -40
  12. package/css/people.css +3 -2
  13. package/css/sheet.css +4 -6
  14. package/css/stack.css +6 -10
  15. package/css/step.css +3 -5
  16. package/css/theme.template.css +2 -1
  17. package/css/tokens.css +12 -1
  18. package/dist/actions/Dropdown.js +4 -5
  19. package/dist/cardds.css +164 -110
  20. package/dist/cards/Card.d.ts +3 -3
  21. package/dist/choice/Calendar.js +3 -5
  22. package/dist/choice/Mood.d.ts +10 -5
  23. package/dist/choice/Mood.js +4 -2
  24. package/dist/forms/Pin.js +7 -8
  25. package/dist/index.d.ts +1 -1
  26. package/dist/index.js +1 -1
  27. package/dist/lists/Row.d.ts +2 -1
  28. package/dist/lists/Row.js +2 -2
  29. package/dist/media/Postcard.js +3 -5
  30. package/dist/media/Tile.d.ts +1 -1
  31. package/dist/numbers/Band.d.ts +1 -1
  32. package/dist/numbers/Picker.js +4 -5
  33. package/dist/numbers/Track.d.ts +4 -2
  34. package/dist/numbers/Track.js +3 -3
  35. package/dist/people/AvatarPick.d.ts +3 -1
  36. package/dist/people/AvatarPick.js +2 -2
  37. package/dist/scaffold/Centre.d.ts +1 -1
  38. package/dist/scaffold/Centre.js +1 -1
  39. package/dist/scaffold/Screen.d.ts +1 -1
  40. package/dist/scaffold/Screen.js +3 -4
  41. package/dist/scaffold/TopBar.js +3 -5
  42. package/dist/sheets/Sheet.js +5 -7
  43. package/dist/sheets/SheetStack.js +4 -5
  44. package/dist/sheets/SheetSteps.js +5 -6
  45. package/dist/sheets/StackSheet.d.ts +1 -1
  46. package/dist/sheets/StackSheet.js +4 -5
  47. package/dist/state.d.ts +7 -0
  48. package/dist/state.js +17 -0
  49. package/dist/templates/CallSheet.js +3 -4
  50. package/dist/templates/Home.d.ts +1 -1
  51. package/dist/templates/Home.js +3 -4
  52. package/dist/templates/Splash.js +2 -1
  53. package/dist/templates/Walkthrough.js +4 -5
  54. package/dist/type/Icon.js +3 -5
  55. package/dist/type/textScale.d.ts +6 -0
  56. package/dist/type/textScale.js +12 -0
  57. package/package.json +1 -1
  58. package/dist/layover/Deck.d.ts +0 -9
  59. package/dist/layover/Deck.js +0 -10
package/css/step.css CHANGED
@@ -90,8 +90,6 @@
90
90
  .step:has(> .sheet--peek) > :is(.page, .pages) { padding-bottom: var(--sheet-peek); }
91
91
  .step > :is(.page, .pages) {
92
92
  flex: 0 1 auto;
93
- }
94
- .step > :is(.page, .pages) {
95
93
  min-height: 0;
96
94
  margin: var(--_lead, 0) var(--screen-pad) 0; /* the screen's gap, moved in here from above the step; the inset, taken back from the bleed */
97
95
  overflow-y: auto;
@@ -103,12 +101,12 @@
103
101
  padding above AND below — so the words begin near the middle and, when a big text size runs them long, scroll up clear.
104
102
  The walk shows no scrollbar. */
105
103
  .step > .pages { margin: 0; scrollbar-width: none; touch-action: pan-y; } /* pan-y: the walk scrolls itself up and down; a sideways swipe is the Walkthrough's (it turns the page) */ /* the scrolling box is the whole content: from the step's top edge, edge to edge — no margin (Lh 2026-09-23) */
106
- .step > .pages > .page { padding-inline: var(--screen-pad); } /* the words keep the inset INSIDE it */
107
- .step > .pages > .page { margin-top: var(--_lead, 0rem); } /* the lead is each PAGE's margin (15% with no top, the screen's gap under a bar): the words start there and scroll up to the box's edge */
108
- .step > .pages::-webkit-scrollbar { display: none; }
109
104
  .step > .pages > .page {
105
+ padding-inline: var(--screen-pad); /* the words keep the inset INSIDE it */
106
+ margin-top: var(--_lead, 0rem); /* the lead is each PAGE's margin (15% with no top, the screen's gap under a bar): the words start there and scroll up to the box's edge */
110
107
  padding-bottom: var(--bottom-h, 0rem); /* exactly the bottom layer (measured by Screen): a page scrolls ONLY when the layer would cover its words, and then just far enough to clear them — at 100% nothing scrolls (Lh 2026-09-23) */
111
108
  }
109
+ .step > .pages::-webkit-scrollbar { display: none; }
112
110
 
113
111
  /* ============================================================
114
112
  TOP + CONTENT in one flex column; BOTTOM is a LAYER over them (Lh 2026-09-23, second call — replaces "the bar is a row"):
@@ -48,5 +48,6 @@
48
48
  --card-1-bg --card-1-ink --card-2-bg --card-2-ink --card-3-bg --card-3-ink (three card tones)
49
49
  --card-border --card-muted --card-2-muted
50
50
  --accent --on-accent --action-bg --action-ink --action-border
51
- --pos --neg --dot-a --dot-b */
51
+ --pos --neg --dot-a --dot-b
52
+ --dim (0.7: how far secondary words fade on a dark card, a drawer, a tile's sub line — one share for all) */
52
53
  }
package/css/tokens.css CHANGED
@@ -48,7 +48,7 @@
48
48
  --btn-h: calc(var(--tap-base) * 13 / 12); /* 52 button height */
49
49
  --btn-xl-h: calc(var(--tap-base) * 11 / 6); /* 88 the one giant CTA */
50
50
  --chip-h: calc(var(--tap-base) * 19 / 24); /* 38 chip height */
51
- --bar-h: calc(var(--tap-base) * 4 / 3); /* 64 float bar, day cell, deck actions */
51
+ --bar-h: calc(var(--tap-base) * 4 / 3); /* 64 float bar, day cell */
52
52
  --header-h: calc(var(--tap-base) * 5 / 4); /* 60 top bar — .topbar and .appbar alike */
53
53
  --card-pad-rest: var(--sp-5); /* 20 a card's padding before any variant — .card publishes it as --card-pad; the sheet's peek strip is built from it where no card is in scope */
54
54
  --card-gap-rest: var(--sp-4); /* 16 …and its gap */
@@ -95,6 +95,9 @@
95
95
  --motion-sheet: 0.35s;
96
96
  --motion-slide: 0.22s; /* a centred card sliding out and the next in (card.css) — quick, a page turn (Lh, 2026-09-12) */
97
97
  --motion-flip: 0.45s; /* a postcard turning over (media.css) — slow enough to read as a card in the hand */
98
+ --dim: 0.7; /* secondary words dimmed on a ground whose muted ink does not fit (the dark card --3, a drawer, a tile's sub line): ONE share for all */
99
+ --motion-press: 0.12s; /* a control giving under the finger and springing back (actions.css PRESS) */
100
+ --press-scale: 0.96; /* how far it gives — a share of its size */
98
101
 
99
102
  /* ---- typography: one scale, rem so it follows the root ---- */
100
103
  --font-ui: "PK Nonthaburi", -apple-system, system-ui, sans-serif; /* fonts.css ships it; the rest is the fallback while it loads */
@@ -167,6 +170,9 @@
167
170
  --card-1-bg: var(--color-paper, #ffffff); --card-1-ink: var(--color-ink, #141414);
168
171
  --card-2-bg: var(--_tone-2, #e6e6e3); --card-2-ink: var(--color-ink, #141414);
169
172
  --card-3-bg: var(--color-brand, #141414); --card-3-ink: var(--color-on-brand, #ffffff);
173
+ /* tones 4 · 5 (Lh 2026-09-25): more card colours for a palette that has them — the wireframe keeps them grey */
174
+ --card-4-bg: #d4d4d0; --card-4-ink: var(--color-ink, #141414); --card-4-muted: #555555;
175
+ --card-5-bg: #3d3d3d; --card-5-ink: #ffffff; --card-5-muted: #c4c4c4;
170
176
 
171
177
  --card-border: #141414; /* wireframe: visible outline; palettes may set transparent */
172
178
  --card-muted: var(--_muted-on-paper, #6b6b6b); /* secondary text inside cards (the default, tone-1 card) */
@@ -187,6 +193,11 @@
187
193
  --neg: #3d3d3d;
188
194
  --dot-a: var(--color-brand, #141414);
189
195
  --dot-b: #8a8a8a;
196
+ --signal-warn: #8a6d00; /* the full signal set (Lh 2026-09-25): error · warn · ok · info — each with an icon and words */
197
+ --signal-ok: #2e7d32;
198
+ --signal-info: #2f5f9e;
199
+ /* highlights (Lh 2026-09-25): four atmosphere colours a palette may set for decoration — a count, a mark, a chart dot; the wireframe keeps them grey */
200
+ --highlight-1: #3d3d3d; --highlight-2: #8a8a8a; --highlight-3: #5f5f5f; --highlight-4: #b0b0b0;
190
201
  --signal-error: #c62828; /* the ONE colour in the wireframe (Lh 2026-09-24): something went wrong — a field's edge, the words that say what. Always with an icon and words, never the colour alone */
191
202
 
192
203
  /* derived tints — read the element's own ink, so they work on any slot */
@@ -1,15 +1,14 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Children, createContext, isValidElement, useContext, useRef, useState } from 'react';
2
+ import { Children, createContext, isValidElement, useContext, useRef } from 'react';
3
+ import { useControlled } from '../state.js';
3
4
  import { cx } from '../cx.js';
4
5
  import { Icon } from '../type/Icon.js';
5
6
  /* what a Menu tells its items: the value it holds (so the matching item marks itself current) and how to pick one */
6
7
  const MenuContext = createContext(null);
7
8
  /* a menu's value is controlled (`value` + `onChange`) or its own (`defaultValue`) — like an input */
8
9
  function useValue(value, defaultValue, onChange) {
9
- const [inner, setInner] = useState(defaultValue);
10
- const current = value ?? inner;
11
- const pick = (next) => { if (value === undefined)
12
- setInner(next); if (next !== current)
10
+ const [current, setOwn] = useControlled(value, defaultValue);
11
+ const pick = (next) => { setOwn(next); if (next !== current)
13
12
  onChange?.(next); };
14
13
  return [current, pick];
15
14
  }