@usableapp/cardds 0.7.142 → 0.7.143
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/CHANGELOG.md +12 -0
- package/css/forms.css +54 -0
- package/css/sticky.css +4 -3
- package/dist/cardds.css +58 -3
- package/dist/catalog.json +1 -1
- package/dist/forms/MessageBar.d.ts +31 -0
- package/dist/forms/MessageBar.js +23 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/scaffold/Screen.d.ts +1 -1
- package/dist/scaffold/Screen.js +1 -1
- package/docs/reference.md +8 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
> For: a project that consumes `@usableapp/cardds` and its AI — what changed between versions, written as before → after, so a screen can be brought up to date without reading the source. Newest first. A consumer never edits cardds; if something here leaves you without a way to do what you did before, report the gap. Each release section after 0.7.97 carries one `Components:` line, written by `node scripts/components-changed.mjs <previous tag>`: the components the release changed, or `all` when a file changed that any component can read (a token, the build), or `none`; check only the screens that import those.
|
|
4
4
|
|
|
5
|
+
## 0.7.143 — 2026-10-26
|
|
6
|
+
|
|
7
|
+
A sticky note's shadow is lighter and closer. A chat of bubbles has its message box: `MessageBar`.
|
|
8
|
+
|
|
9
|
+
Components: Sticky, MessageBar, Screen
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
- **A sticky note's shadow is lighter and closer** (Lh 2026-10-26: too dark for paper barely off the page). Before → after: 28% ink, set `--sp-1` down → 14% ink, a hair down, showing only a hairline below the note. `--sticky-shadow-bg` and `--sticky-shadow-blur` still retune it. Nothing to change in a screen.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
- **`MessageBar`**: the box a chat's message is typed in, at the foot of a `Thread` of `Bubble`s — `lead` (an extra `IconBtn`) · the box · an `IconBtn invert` send, off while the box holds only blanks. The box starts one line tall, grows to five (`--message-bar-input-max-h`), then scrolls. Controlled like an input (`value` + `onValueChange`, or `defaultValue`); `onSend(words)` hands the words over and asks for an empty box; the cursor stays in the box. Put it in `Screen`'s `bottom` (`<Screen fill bottom={<MessageBar sendLabel="ส่ง" …/>}>`): Screen measures it into `--bottom-h` as it does an `ActionBar`, and it rides above the keyboard (`--kb`). Before → after: a bubble chat had no box to type in → `MessageBar`. Stories `MessageBar`, `Bubble · WithMessageBar`.
|
|
16
|
+
|
|
5
17
|
## 0.7.142 — 2026-10-26
|
|
6
18
|
|
|
7
19
|
A stamp's shadow is its contact shadow only, lighter. A `Stamp` in an `AppBar`'s `icon` is the bar's inner height tall.
|
package/css/forms.css
CHANGED
|
@@ -83,3 +83,57 @@
|
|
|
83
83
|
.form-note { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); margin: 0; font: var(--form-note-font, var(--type-caption)); color: var(--form-note-ink, var(--card-muted)); text-align: center; }
|
|
84
84
|
.form-note--error { color: var(--form-note-error-ink, var(--signal-error)); }
|
|
85
85
|
@media (prefers-reduced-motion: no-preference) { .form-note--busy > .icon { --icon-spin: turn var(--motion-spin) var(--ease-linear) infinite; } } /* `turn`: tokens.css */
|
|
86
|
+
|
|
87
|
+
/* ---- message bar: the box a chat's message is typed in, at the conversation's foot (MessageBar) ----
|
|
88
|
+
lead · the box · send. The box grows with the words: a hidden copy of them (::after, from data-value) shares the textarea's grid
|
|
89
|
+
cell and font, so the cell is as tall as the words — up to --message-bar-input-max-h (five lines), then the textarea scrolls.
|
|
90
|
+
content-box: the cap counts lines, the padding comes on top. The buttons stay on the last line's row (flex-end).
|
|
91
|
+
<div class="message-bar"><button class="icon-btn">…</button>
|
|
92
|
+
<div class="message-bar__box" data-value="…"><textarea class="message-bar__input" rows="1"></textarea></div>
|
|
93
|
+
<button class="icon-btn icon-btn--invert" disabled>…</button></div> */
|
|
94
|
+
.message-bar {
|
|
95
|
+
display: flex;
|
|
96
|
+
align-items: flex-end;
|
|
97
|
+
gap: var(--message-bar-gap, var(--sp-2));
|
|
98
|
+
padding: var(--sp-3) var(--sp-4) calc(var(--sp-3) + var(--_safe-b-open)); /* its ground runs under the phone's gesture bar, the box stands above it */
|
|
99
|
+
background: var(--message-bar-bg, var(--surface));
|
|
100
|
+
}
|
|
101
|
+
.message-bar > .icon-btn { flex: none; }
|
|
102
|
+
.message-bar__box {
|
|
103
|
+
flex: 1;
|
|
104
|
+
min-width: 0;
|
|
105
|
+
display: grid;
|
|
106
|
+
align-content: center;
|
|
107
|
+
min-height: var(--form-tap);
|
|
108
|
+
border: var(--border-w) solid var(--message-bar-box-border, var(--action-border));
|
|
109
|
+
border-radius: var(--message-bar-box-radius, var(--r-control));
|
|
110
|
+
background: var(--message-bar-box-bg, var(--action-bg));
|
|
111
|
+
color: var(--message-bar-box-ink, var(--action-ink));
|
|
112
|
+
}
|
|
113
|
+
.message-bar__box:has(:focus) { border-color: var(--message-bar-box-active-border, currentColor); } /* the box the cursor is in: its edge goes full ink, as a Field's */
|
|
114
|
+
.message-bar__input,
|
|
115
|
+
.message-bar__box::after {
|
|
116
|
+
grid-area: 1 / 1;
|
|
117
|
+
box-sizing: content-box;
|
|
118
|
+
max-height: var(--message-bar-input-max-h, 5lh);
|
|
119
|
+
margin: 0;
|
|
120
|
+
padding: var(--message-bar-input-pad-y, var(--sp-2)) var(--message-bar-input-pad-x, var(--sp-4));
|
|
121
|
+
border: 0;
|
|
122
|
+
font: var(--message-bar-input-font, var(--fw-regular) var(--fs-lg) / var(--lh-field) var(--font-ui)); /* the words being typed read as a Field's */
|
|
123
|
+
white-space: pre-wrap;
|
|
124
|
+
overflow-wrap: anywhere;
|
|
125
|
+
}
|
|
126
|
+
.message-bar__box::after { content: attr(data-value) " "; visibility: hidden; overflow: hidden; } /* the trailing space: a last empty line still counts */
|
|
127
|
+
.message-bar__input {
|
|
128
|
+
resize: none;
|
|
129
|
+
overflow-y: auto;
|
|
130
|
+
background: transparent;
|
|
131
|
+
color: inherit;
|
|
132
|
+
outline: none; /* the box itself tells focus */
|
|
133
|
+
caret-color: currentColor;
|
|
134
|
+
}
|
|
135
|
+
.message-bar__input::placeholder { color: inherit; opacity: var(--fade-hint); }
|
|
136
|
+
/* the Screen's BOTTOM: in a .screen--fill a layer over the content's foot, as the .action-bar is (actions.css) — Screen measures it
|
|
137
|
+
into --bottom-h, so a Page's last words scroll clear; on a scrolling screen its sticky last row. Both ride above the keyboard (--kb) */
|
|
138
|
+
.screen--fill > .message-bar { position: absolute; inset-inline: 0; bottom: var(--kb, 0rem); z-index: var(--z-bar); }
|
|
139
|
+
.screen:not(.screen--fill) > .message-bar:last-child { position: sticky; bottom: var(--kb, 0rem); z-index: var(--z-bar); margin: 0 calc(-1 * var(--screen-pad)); }
|
package/css/sticky.css
CHANGED
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
/* the edge and the shadow: two layers UNDER the paper, each drawn in the note's own shape by a gradient — never a filter on the
|
|
36
36
|
note (Safari repainted a filtered note as a hard grey band once a stamp on it had moved; Lh 2026-10-07).
|
|
37
37
|
::after is the EDGE: the shape one hairline larger all round, so a pale note still ends somewhere on a pale ground.
|
|
38
|
-
::before is the SHADOW: the shape set a
|
|
38
|
+
::before is the SHADOW: the shape set a hair down and in, pale and softened on its own layer — paper lying almost flat on the page,
|
|
39
|
+
so it shows only a hairline below the note (Lh 2026-10-26: the old one was too dark for something barely off the page). */
|
|
39
40
|
.sticky::before, .sticky::after {
|
|
40
41
|
content: "";
|
|
41
42
|
position: absolute;
|
|
@@ -46,8 +47,8 @@
|
|
|
46
47
|
}
|
|
47
48
|
.sticky::after { --_ink: var(--sticky-edge-bg, color-mix(in srgb, var(--ink-onlight) 14%, transparent)); inset: calc(-1 * var(--border-w)); }
|
|
48
49
|
.sticky::before {
|
|
49
|
-
--_ink: var(--sticky-shadow-bg, color-mix(in srgb, var(--ink-onlight)
|
|
50
|
-
inset: var(--sp-
|
|
50
|
+
--_ink: var(--sticky-shadow-bg, color-mix(in srgb, var(--ink-onlight) 14%, transparent));
|
|
51
|
+
inset: var(--sp-0) var(--sp-0) calc(-1 * var(--px)) var(--sp-0);
|
|
51
52
|
filter: blur(var(--sticky-shadow-blur, var(--sp-0)));
|
|
52
53
|
}
|
|
53
54
|
.sticky--flat::before, .sticky--flat::after { background: var(--_ink); }
|
package/dist/cardds.css
CHANGED
|
@@ -2608,6 +2608,60 @@ button:enabled { cursor: pointer; } /* a disabled one keeps the arrow */
|
|
|
2608
2608
|
.form-note--error { color: var(--form-note-error-ink, var(--signal-error)); }
|
|
2609
2609
|
@media (prefers-reduced-motion: no-preference) { .form-note--busy > .icon { --icon-spin: turn var(--motion-spin) var(--ease-linear) infinite; } } /* `turn`: tokens.css */
|
|
2610
2610
|
|
|
2611
|
+
/* ---- message bar: the box a chat's message is typed in, at the conversation's foot (MessageBar) ----
|
|
2612
|
+
lead · the box · send. The box grows with the words: a hidden copy of them (::after, from data-value) shares the textarea's grid
|
|
2613
|
+
cell and font, so the cell is as tall as the words — up to --message-bar-input-max-h (five lines), then the textarea scrolls.
|
|
2614
|
+
content-box: the cap counts lines, the padding comes on top. The buttons stay on the last line's row (flex-end).
|
|
2615
|
+
<div class="message-bar"><button class="icon-btn">…</button>
|
|
2616
|
+
<div class="message-bar__box" data-value="…"><textarea class="message-bar__input" rows="1"></textarea></div>
|
|
2617
|
+
<button class="icon-btn icon-btn--invert" disabled>…</button></div> */
|
|
2618
|
+
.message-bar {
|
|
2619
|
+
display: flex;
|
|
2620
|
+
align-items: flex-end;
|
|
2621
|
+
gap: var(--message-bar-gap, var(--sp-2));
|
|
2622
|
+
padding: var(--sp-3) var(--sp-4) calc(var(--sp-3) + var(--_safe-b-open)); /* its ground runs under the phone's gesture bar, the box stands above it */
|
|
2623
|
+
background: var(--message-bar-bg, var(--surface));
|
|
2624
|
+
}
|
|
2625
|
+
.message-bar > .icon-btn { flex: none; }
|
|
2626
|
+
.message-bar__box {
|
|
2627
|
+
flex: 1;
|
|
2628
|
+
min-width: 0;
|
|
2629
|
+
display: grid;
|
|
2630
|
+
align-content: center;
|
|
2631
|
+
min-height: var(--form-tap);
|
|
2632
|
+
border: var(--border-w) solid var(--message-bar-box-border, var(--action-border));
|
|
2633
|
+
border-radius: var(--message-bar-box-radius, var(--r-control));
|
|
2634
|
+
background: var(--message-bar-box-bg, var(--action-bg));
|
|
2635
|
+
color: var(--message-bar-box-ink, var(--action-ink));
|
|
2636
|
+
}
|
|
2637
|
+
.message-bar__box:has(:focus) { border-color: var(--message-bar-box-active-border, currentColor); } /* the box the cursor is in: its edge goes full ink, as a Field's */
|
|
2638
|
+
.message-bar__input,
|
|
2639
|
+
.message-bar__box::after {
|
|
2640
|
+
grid-area: 1 / 1;
|
|
2641
|
+
box-sizing: content-box;
|
|
2642
|
+
max-height: var(--message-bar-input-max-h, 5lh);
|
|
2643
|
+
margin: 0;
|
|
2644
|
+
padding: var(--message-bar-input-pad-y, var(--sp-2)) var(--message-bar-input-pad-x, var(--sp-4));
|
|
2645
|
+
border: 0;
|
|
2646
|
+
font: var(--message-bar-input-font, var(--fw-regular) var(--fs-lg) / var(--lh-field) var(--font-ui)); /* the words being typed read as a Field's */
|
|
2647
|
+
white-space: pre-wrap;
|
|
2648
|
+
overflow-wrap: anywhere;
|
|
2649
|
+
}
|
|
2650
|
+
.message-bar__box::after { content: attr(data-value) " "; visibility: hidden; overflow: hidden; } /* the trailing space: a last empty line still counts */
|
|
2651
|
+
.message-bar__input {
|
|
2652
|
+
resize: none;
|
|
2653
|
+
overflow-y: auto;
|
|
2654
|
+
background: transparent;
|
|
2655
|
+
color: inherit;
|
|
2656
|
+
outline: none; /* the box itself tells focus */
|
|
2657
|
+
caret-color: currentColor;
|
|
2658
|
+
}
|
|
2659
|
+
.message-bar__input::placeholder { color: inherit; opacity: var(--fade-hint); }
|
|
2660
|
+
/* the Screen's BOTTOM: in a .screen--fill a layer over the content's foot, as the .action-bar is (actions.css) — Screen measures it
|
|
2661
|
+
into --bottom-h, so a Page's last words scroll clear; on a scrolling screen its sticky last row. Both ride above the keyboard (--kb) */
|
|
2662
|
+
.screen--fill > .message-bar { position: absolute; inset-inline: 0; bottom: var(--kb, 0rem); z-index: var(--z-bar); }
|
|
2663
|
+
.screen:not(.screen--fill) > .message-bar:last-child { position: sticky; bottom: var(--kb, 0rem); z-index: var(--z-bar); margin: 0 calc(-1 * var(--screen-pad)); }
|
|
2664
|
+
|
|
2611
2665
|
/* ---- css/journey.css — route, tile badge, note row ---- */
|
|
2612
2666
|
/* ============================================================
|
|
2613
2667
|
cardds/journey.css — trip/status primitives inside cards:
|
|
@@ -4768,7 +4822,8 @@ button.calendar__label:focus-visible { outline: var(--focus); outline-offset: va
|
|
|
4768
4822
|
/* the edge and the shadow: two layers UNDER the paper, each drawn in the note's own shape by a gradient — never a filter on the
|
|
4769
4823
|
note (Safari repainted a filtered note as a hard grey band once a stamp on it had moved; Lh 2026-10-07).
|
|
4770
4824
|
::after is the EDGE: the shape one hairline larger all round, so a pale note still ends somewhere on a pale ground.
|
|
4771
|
-
::before is the SHADOW: the shape set a
|
|
4825
|
+
::before is the SHADOW: the shape set a hair down and in, pale and softened on its own layer — paper lying almost flat on the page,
|
|
4826
|
+
so it shows only a hairline below the note (Lh 2026-10-26: the old one was too dark for something barely off the page). */
|
|
4772
4827
|
.sticky::before, .sticky::after {
|
|
4773
4828
|
content: "";
|
|
4774
4829
|
position: absolute;
|
|
@@ -4779,8 +4834,8 @@ button.calendar__label:focus-visible { outline: var(--focus); outline-offset: va
|
|
|
4779
4834
|
}
|
|
4780
4835
|
.sticky::after { --_ink: var(--sticky-edge-bg, color-mix(in srgb, var(--ink-onlight) 14%, transparent)); inset: calc(-1 * var(--border-w)); }
|
|
4781
4836
|
.sticky::before {
|
|
4782
|
-
--_ink: var(--sticky-shadow-bg, color-mix(in srgb, var(--ink-onlight)
|
|
4783
|
-
inset: var(--sp-
|
|
4837
|
+
--_ink: var(--sticky-shadow-bg, color-mix(in srgb, var(--ink-onlight) 14%, transparent));
|
|
4838
|
+
inset: var(--sp-0) var(--sp-0) calc(-1 * var(--px)) var(--sp-0);
|
|
4784
4839
|
filter: blur(var(--sticky-shadow-blur, var(--sp-0)));
|
|
4785
4840
|
}
|
|
4786
4841
|
.sticky--flat::before, .sticky--flat::after { background: var(--_ink); }
|