@usableapp/cardds 0.7.156 → 0.7.158
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 +32 -0
- package/css/actions.css +33 -4
- package/css/base.css +8 -0
- package/css/card.css +5 -0
- package/css/forms.css +14 -1
- package/css/lists.css +4 -0
- package/css/parts.css +33 -1
- package/css/sheet.css +5 -2
- package/css/stamp.css +2 -0
- package/css/tokens.css +1 -0
- package/dist/actions/Btn.d.ts +12 -3
- package/dist/actions/Btn.js +6 -3
- package/dist/actions/BtnRow.d.ts +6 -2
- package/dist/actions/BtnRow.js +3 -3
- package/dist/actions/IconBtn.d.ts +8 -2
- package/dist/actions/IconBtn.js +4 -2
- package/dist/actions/LinkBlock.d.ts +9 -0
- package/dist/actions/LinkBlock.js +8 -0
- package/dist/actions/useSendOut.d.ts +4 -0
- package/dist/actions/useSendOut.js +15 -0
- package/dist/cardds.css +105 -8
- package/dist/cards/Card.d.ts +8 -1
- package/dist/cards/CardParts.d.ts +8 -0
- package/dist/cards/CardParts.js +5 -0
- package/dist/catalog.json +1 -1
- package/dist/forms/MessageBar.d.ts +9 -2
- package/dist/forms/MessageBar.js +6 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/lists/Bubble.d.ts +859 -4
- package/dist/lists/Bubble.js +18 -4
- package/dist/lists/Row.d.ts +4 -0
- package/dist/media/MapArea.d.ts +7 -1
- package/dist/media/MapArea.js +5 -3
- package/dist/parts/Foot.d.ts +8 -2
- package/dist/parts/Foot.js +4 -3
- package/dist/parts/Head.d.ts +1 -0
- package/dist/parts/Head.js +1 -0
- package/dist/stamp/Stamp.d.ts +1 -0
- package/dist/stamp/Stamp.js +1 -0
- package/dist/state.d.ts +2 -2
- package/dist/state.js +4 -4
- package/dist/type/Text.d.ts +5 -1
- package/dist/type/Text.js +3 -2
- package/dist/type/icons.d.ts +1 -1
- package/dist/type/icons.js +2 -2
- package/docs/reference.md +56 -5
- package/icons.svg +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,38 @@
|
|
|
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.158 — 2026-10-28
|
|
6
|
+
|
|
7
|
+
The home-feed cards without hand CSS: wrap buttons, a small Btn, words cut at N lines, a picture beside words, a pressed and a highlighted Bubble, a reply-to quote, a send-out on a button, a link block, a still map's media corner, a stamp place at a lead's size.
|
|
8
|
+
|
|
9
|
+
Components: all
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- **`Foot wrap` / `BtnRow wrap`, with `end`** (timebank, Lh 2026-10-28). Before → after: a foot's Btns shared the line → `<Foot wrap end>`: each Btn as wide as its words, its own side padding, wrapping, at the end. Stories `Foot · Wrap`, `BtnRow · Wrap`.
|
|
13
|
+
- **`--foot-crowd-pad-x`**: the side padding a foot of three or more Btns narrows to (was fixed at `--sp-2`, still the default; a `wrap` foot never narrows).
|
|
14
|
+
- **`Btn sm`**: one small tap tall (44, the floor), the small words — a worded move at a head's end. Knobs `--btn-sm-size`, `--btn-sm-pad-x`, `--btn-sm-font-size`. Story `Btn · Small`.
|
|
15
|
+
- **`Text lines={1…6}`**: words cut at N lines, no chevron, no tap. Story `Text · Lines`.
|
|
16
|
+
- **`MediaBeside`**: words with a small square picture at their end (`media`). Knobs `--media-beside-size`, `--media-beside-gap`. Story `MediaBeside · Default`.
|
|
17
|
+
- **`Bubble href` / `onClick`** (a link, or role=button with Enter/Space; both dim under the finger) and **`Bubble highlighted`** (a ring round the message looked at, knob `--bubble-highlighted-ink`). Story `Bubble · Pressed`.
|
|
18
|
+
- **Icon `reply`** (Lucide's).
|
|
19
|
+
- **`MessageBar quote` + `onQuoteClose` + `quoteCloseLabel`**: a reply-to line over the box with a ✕, controlled. Knobs `--message-bar-quote-ink`, `--message-bar-quote-rule-ink`. Story `MessageBar · ReplyTo`.
|
|
20
|
+
- **`Btn sending` / `IconBtn sending` + `onSent`**: something goes out from the button (icon tips forward, two rings spread; token `--motion-send` 0.7s, knob `--btn-sending-ink`); `onSent` once at the end, at once under reduced motion. Stories `IconBtn · Sending`, `Btn · Sending`.
|
|
21
|
+
- **`LinkBlock`**: a few pieces of a card's content as one link (a still map and its place row) — not a card, not a row; the card's gap, no frame, dims under the finger. Knob `--link-block-gap`. Story `LinkBlock · PlaceInCard`.
|
|
22
|
+
- **`MapArea still`**: a still preview of one point — no gesture owned, no touch taken; the mark centred and named. `Card` and `Row` take `target` / `rel` beside `href`. Story `MapArea · Still`.
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
- **`MapArea inline`'s corner**: `--map-radius` falls back to `--r-media` (was the pill's `--r-chip`). A theme that wants the pill sets `--map-radius: var(--r-chip)`.
|
|
26
|
+
- **`StampPlace` at a lead's place** (in an `AvatarStack`, a FeedCard's `lead`) is the small stamp's size, 48 × 60 (was the full 96). Story `Stamp · PlaceAsLead`.
|
|
27
|
+
|
|
28
|
+
## 0.7.157 — 2026-10-28
|
|
29
|
+
|
|
30
|
+
A `Head` that leads with a `Lead`, an `Avatar` or an `AvatarStack`, then `Words`, draws as a FeedCard's head.
|
|
31
|
+
|
|
32
|
+
Components: Head
|
|
33
|
+
|
|
34
|
+
### Changed
|
|
35
|
+
- **A `Head` that leads with a `Lead`, an `Avatar` or an `AvatarStack`, then `Words`** draws as a FeedCard's head (timebank, Lh 2026-10-28). Before → after: the meta took a full-width row under the lead, and with no end the title stood at the far right → the lead at the left, the title (card heading size) over its meta as one left-aligned block beside it, the end (`End`, `IconBtn`) at the right centred to the block. New knob `--head-meta-lines` (default not cut) beside `--head-title-lines`. A head with no lead before its title is unchanged. Story `Head · HeadLeadWords`.
|
|
36
|
+
|
|
5
37
|
## 0.7.156 — 2026-10-28
|
|
6
38
|
|
|
7
39
|
A chat opens as a Sheet: the `MessageBar` stands as a sheet's `Foot`, a `StickyAnswer` works as a sheet's last child, and a sheet pins a row under its head (`topRow`).
|
package/css/actions.css
CHANGED
|
@@ -156,17 +156,44 @@
|
|
|
156
156
|
.btn--warn { --dark: var(--action-dark); color: var(--btn-warn-ink, var(--signal-warn)); } /* a move to think twice about ("cancel the request"): the signal set's warning, on the button's own paper — its side, not the card's */
|
|
157
157
|
.btn--block { width: 100%; }
|
|
158
158
|
.btn--form { justify-self: center; align-self: center; margin-inline: auto; padding-inline: var(--btn-form-pad-x, calc(var(--sp-base) * 14.5)); /* 58px: "ส่งรหัส OTP" at 213px, 20% longer than at 40px sides (Lh 2026-09-25) */ } /* a form's button: its words + wide sides, centred in a grid (a step) or a block (Lh 2026-09-25) */
|
|
159
|
+
/* sm (Btn sm, Lh 2026-10-28): one small tap tall (the touch floor, 44), the small words, closer sides — a worded move at a card head's end */
|
|
160
|
+
.btn--sm { min-height: var(--btn-sm-size, var(--form-tap-sm)); padding-block: var(--sp-1); padding-inline: var(--btn-sm-pad-x, var(--sp-4)); font-size: var(--btn-sm-font-size, var(--fs-sm)); }
|
|
159
161
|
/* xl: the one giant call to action in a tinted card ("Taxi!") */
|
|
160
162
|
.btn--xl { min-height: var(--btn-xl-h); font: var(--fw-heavy) var(--fs-3xl) / var(--lh-solid) var(--font-display); letter-spacing: var(--track-h1); border-radius: var(--r-card); padding-inline: var(--sp-8); }
|
|
161
163
|
/* disabled keeps the slot — a control that vanishes moves everything else,
|
|
162
164
|
and a pager whose "previous" disappeared on page one would shift the bar
|
|
163
165
|
under the thumb on every page */
|
|
166
|
+
/* SENDING (Btn / IconBtn sending, Lh 2026-10-28): something goes OUT from the button — for --motion-send its icon swells and tips forward,
|
|
167
|
+
and two rings spread from its edge one after the other (--btn-sending-ink, the accent); then the app swaps the icon or puts the sent thing in.
|
|
168
|
+
Under reduced motion nothing moves (the app is told at once) */
|
|
169
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
170
|
+
:is(.btn, .icon-btn).is-sending { animation: send-out var(--motion-send) var(--ease-out); }
|
|
171
|
+
:is(.btn, .icon-btn).is-sending > .icon { animation: send-out-call var(--motion-send) ease-in-out; }
|
|
172
|
+
}
|
|
173
|
+
@keyframes send-out {
|
|
174
|
+
from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--btn-sending-ink, var(--accent)) 45%, transparent), 0 0 0 0 color-mix(in srgb, var(--btn-sending-ink, var(--accent)) 30%, transparent); }
|
|
175
|
+
60% { box-shadow: 0 0 0 var(--sp-3) transparent, 0 0 0 var(--sp-1) color-mix(in srgb, var(--btn-sending-ink, var(--accent)) 30%, transparent); }
|
|
176
|
+
to { box-shadow: 0 0 0 var(--sp-5) transparent, 0 0 0 var(--sp-4) transparent; }
|
|
177
|
+
}
|
|
178
|
+
@keyframes send-out-call {
|
|
179
|
+
0% { transform: none; }
|
|
180
|
+
30% { transform: scale(1.35) rotate(-14deg); }
|
|
181
|
+
55% { transform: translateX(var(--sp-1)) scale(1.15) rotate(-8deg); opacity: 0.5; }
|
|
182
|
+
100% { transform: none; opacity: 1; }
|
|
183
|
+
}
|
|
184
|
+
/* link block (LinkBlock, Lh 2026-10-28): a few pieces of a card's content as one link — stacked with the card's gap, the holder's ink, no underline,
|
|
185
|
+
no frame, no padding; the DIM press answer (below) */
|
|
186
|
+
.link-block { display: grid; gap: var(--link-block-gap, var(--card-gap)); color: inherit; text-decoration: none; }
|
|
164
187
|
/* a row of buttons sharing the width (twin CTAs inside a card) */
|
|
165
188
|
.btn-row { display: flex; gap: var(--btn-row-gap, var(--sp-2)); }
|
|
166
189
|
/* round (BtnRow round, Lh 2026-10-24): a few round IconBtns as one group in the middle of a card's content, a fixed gap apart — Foot round's look,
|
|
167
190
|
so a card's foot stays its status line */
|
|
168
191
|
.btn-row--round { justify-content: center; align-items: center; gap: var(--btn-row-gap, var(--sp-6)); }
|
|
169
192
|
.btn-row > .btn { flex: 1; min-width: 0; }
|
|
193
|
+
/* wrap (BtnRow wrap): each Btn as wide as its words, wrapping; end: they stand at the row's end */
|
|
194
|
+
.btn-row--wrap { flex-wrap: wrap; }
|
|
195
|
+
.btn-row--wrap > .btn { flex: 0 0 auto; }
|
|
196
|
+
.btn-row--end { justify-content: flex-end; }
|
|
170
197
|
/* joined (BtnRow round joined, Foot round joined — Lh 2026-10-24, was BtnTrio): a dotted link between each two round buttons, a closer gap */
|
|
171
198
|
.btn-row--joined { gap: var(--btn-trio-gap, var(--sp-3)); }
|
|
172
199
|
.btn-trio__dots {
|
|
@@ -436,7 +463,9 @@
|
|
|
436
463
|
button (src/cards/cardGo.ts). It is in the DIM pointer and :active lists only — the focus ring and the disabled look stay the
|
|
437
464
|
button's, the card itself is never focused or disabled.
|
|
438
465
|
.t-expand--more (Lh 2026-10-25) = a `Text expand` that does not fit: the whole box opens or folds. It is WORDS, so it neither
|
|
439
|
-
dims nor gives: its ink never changes under the finger (Lh 2026-10-25), the opening is the answer. Pointer only (below).
|
|
466
|
+
dims nor gives: its ink never changes under the finger (Lh 2026-10-25), the opening is the answer. Pointer only (below).
|
|
467
|
+
.bubble--press (Lh 2026-10-28) = a chat `Bubble` that is a link (`href`) or pressed (`onClick`): a message is as wide as a row, so it DIMS.
|
|
468
|
+
.link-block (Lh 2026-10-28) = a `LinkBlock`, a few pieces of a card's content as one link: as wide as the card, it DIMS. */
|
|
440
469
|
:where(.btn, .icon-btn, .link, a.chip, button.chip, .chip--pick, a.tile, button.tile, .tile--pick, .day, .segment__item, .calendar__day,
|
|
441
470
|
.float-bar__item, .avatar-pick__item, .add-row, .picker__item, .dropdown__btn, .appbar__who, .check, .toggle, .mood__opt, .sheet__handle,
|
|
442
471
|
a.avatar, button.avatar, .menu__item, button.snackbar__body, .stamp--tap, button.stamp-cell, button.stamp-place, .post-letter__turn, .post-desk__slot, .post-desk__pick, .post-desk__reach, .stamp-on__remove, .map-pick, .count-in__cancel) {
|
|
@@ -444,7 +473,7 @@
|
|
|
444
473
|
touch-action: manipulation;
|
|
445
474
|
transition: scale var(--motion-press) var(--ease-out);
|
|
446
475
|
}
|
|
447
|
-
:where(a.row, button.row, label.row, .row-expand > summary, .banner__summary, a.card, label.card, .card--go, .feed-card--small, .toggle-field, .post-box__edge) {
|
|
476
|
+
:where(a.row, button.row, label.row, .row-expand > summary, .banner__summary, a.card, label.card, .card--go, .feed-card--small, .toggle-field, .post-box__edge, .bubble--press, .link-block) {
|
|
448
477
|
cursor: pointer;
|
|
449
478
|
touch-action: manipulation;
|
|
450
479
|
transition: opacity var(--motion-press) var(--ease-out);
|
|
@@ -460,7 +489,7 @@
|
|
|
460
489
|
:where(.btn, .icon-btn, .link, a.chip, button.chip, .chip--pick, a.tile, button.tile, .tile--pick, .day, .segment__item, .calendar__day,
|
|
461
490
|
.float-bar__item, .avatar-pick__item, .add-row, .picker__item, .dropdown__btn, .appbar__who, .check, .toggle, .mood__opt, .sheet__handle,
|
|
462
491
|
a.avatar, button.avatar, .menu__item, button.snackbar__body, .stamp--tap, button.stamp-cell, button.stamp-place, .post-letter__turn, .post-desk__slot, .post-desk__pick, .post-desk__reach, .stamp-on__remove, .map-pick):active:not(:disabled, [aria-disabled="true"], :has(:disabled)) { scale: var(--press-scale); }
|
|
463
|
-
:where(a.row, button.row, label.row, .row-expand > summary, .banner__summary, a.card, label.card, .card--go, .feed-card--small, .toggle-field, .post-box__edge):active:not([aria-disabled="true"], :has(:disabled)) { opacity: var(--press-dim); }
|
|
492
|
+
:where(a.row, button.row, label.row, .row-expand > summary, .banner__summary, a.card, label.card, .card--go, .feed-card--small, .toggle-field, .post-box__edge, .bubble--press, .link-block):active:not([aria-disabled="true"], :has(:disabled)) { opacity: var(--press-dim); }
|
|
464
493
|
/* SHADE — what has something BEHIND it (a peeked sheet over the pile, a postcard's face over its back, a post letter's sheet over the other) must not turn see-through:
|
|
465
494
|
it darkens a touch instead (--press-shade) */
|
|
466
495
|
:where(.sheet-stack--tap > .card:not(.is-open), .postcard__turn, .post-letter__sheet:not(:has(.icon-btn:active))) { cursor: pointer; touch-action: manipulation; transition: filter var(--motion-press) var(--ease-out); }
|
|
@@ -470,7 +499,7 @@
|
|
|
470
499
|
.float-bar__item, .avatar-pick__item, .add-row, .picker__item, .dropdown__btn, .appbar__who, .check, .toggle, .mood__opt, .sheet__handle,
|
|
471
500
|
a.avatar, button.avatar, .menu__item, button.snackbar__body, .stamp--tap, button.stamp-cell, button.stamp-place, .post-letter__turn, .post-desk__slot, .post-desk__pick, .post-desk__reach, .stamp-on__remove):focus-visible,
|
|
472
501
|
:where(.chip--pick, .tile--pick, label.btn, label.row, .toggle-field):has(:focus-visible), :where(label.card:has(> input[type="radio"]:focus-visible)) { outline: var(--focus); outline-offset: var(--sp-1); }
|
|
473
|
-
:where(a.row, button.row, label.row, .row-expand > summary, .banner__summary, a.card, label.card, .feed-card--small, .toggle-field, .post-box__edge, .t-expand--more):not(label, .toggle-field):focus-visible { outline: var(--focus); outline-offset: var(--sp-1); }
|
|
502
|
+
:where(a.row, button.row, label.row, .row-expand > summary, .banner__summary, a.card, label.card, .feed-card--small, .toggle-field, .post-box__edge, .t-expand--more, .bubble--press, .link-block):not(label, .toggle-field):focus-visible { outline: var(--focus); outline-offset: var(--sp-1); }
|
|
474
503
|
/* disabled: no pointer anywhere; a control fades (a link and a row keep their own muted look) */
|
|
475
504
|
:where(.btn, .icon-btn, .link, a.chip, button.chip, .chip--pick, a.tile, button.tile, .tile--pick, .day, .segment__item, .calendar__day,
|
|
476
505
|
.float-bar__item, .avatar-pick__item, .add-row, .picker__item, .dropdown__btn, .appbar__who, .check, .toggle, .mood__opt, .sheet__handle,
|
package/css/base.css
CHANGED
|
@@ -164,6 +164,14 @@ button:enabled { cursor: pointer; } /* a disabled one keeps the arrow */
|
|
|
164
164
|
.t-title { font: var(--type-title); margin: 0; --fs-self: var(--fs-title); }
|
|
165
165
|
.t-body { font: var(--type-body); margin: 0; }
|
|
166
166
|
.t-scroll { --_t-scroll-max: calc(var(--text-scroll-lines, 3.6) * 1lh); height: var(--text-scroll-size, auto); max-height: var(--text-scroll-size, var(--_t-scroll-max)); overflow: hidden; } /* the cut box of `Text expand`: plain, no border, no ground, no scroll; lh = the body's own line */
|
|
167
|
+
/* cut at N lines (Text lines, Lh 2026-10-28): no chevron, no tap, the words stop at the last line's end */
|
|
168
|
+
.t-lines { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
|
|
169
|
+
.t-lines--1 { -webkit-line-clamp: 1; line-clamp: 1; }
|
|
170
|
+
.t-lines--2 { -webkit-line-clamp: 2; line-clamp: 2; }
|
|
171
|
+
.t-lines--3 { -webkit-line-clamp: 3; line-clamp: 3; }
|
|
172
|
+
.t-lines--4 { -webkit-line-clamp: 4; line-clamp: 4; }
|
|
173
|
+
.t-lines--5 { -webkit-line-clamp: 5; line-clamp: 5; }
|
|
174
|
+
.t-lines--6 { -webkit-line-clamp: 6; line-clamp: 6; }
|
|
167
175
|
.t-expand { display: grid; } /* the box, and under it the chevron when the text does not fit */
|
|
168
176
|
.t-expand.is-open > .t-scroll { height: auto; max-height: none; } /* open: the whole text in place */
|
|
169
177
|
.t-expand__sign { justify-self: center; } /* the chevron: down = there is more, up = fold it */
|
package/css/card.css
CHANGED
|
@@ -45,6 +45,11 @@
|
|
|
45
45
|
|
|
46
46
|
.card__media { border-radius: var(--card-media-radius, var(--r-media)); overflow: hidden; position: relative; } /* relative: corner badges */
|
|
47
47
|
.card__media > img { width: 100%; height: auto; object-fit: cover; }
|
|
48
|
+
/* media beside (MediaBeside, Lh 2026-10-28): the words, and at their end a small square picture, the media's corner, cropped to fill it */
|
|
49
|
+
.media-beside { display: grid; grid-template-columns: minmax(0, 1fr) var(--media-beside-size, calc(var(--tap) * 3 / 2)); gap: var(--media-beside-gap, var(--sp-3)); align-items: start; }
|
|
50
|
+
.media-beside__words { display: grid; gap: var(--sp-1); min-width: 0; }
|
|
51
|
+
.media-beside__pic { aspect-ratio: 1; border-radius: var(--r-media); overflow: hidden; }
|
|
52
|
+
.media-beside__pic > * { width: 100%; height: 100%; min-height: 0; object-fit: cover; }
|
|
48
53
|
|
|
49
54
|
/* a JourneyBadge at the edge of the card's own first head (the date box in the top-left or top-right corner) keeps its corner concentric
|
|
50
55
|
with the card's: the card's corner (--r-card) less the room the padding leaves round it. journey.css reads it behind the theme's --tile-badge-radius,
|
package/css/forms.css
CHANGED
|
@@ -139,7 +139,20 @@
|
|
|
139
139
|
it rides with the bar above the keyboard. A written name is one piece: .mention-under is a copy of the words in the textarea's
|
|
140
140
|
own cell and class (same font, padding, wrap), its ink clear, drawn BEHIND the transparent textarea; only the names' marks show. */
|
|
141
141
|
.mention-list { flex: 0 0 100%; order: -1; max-height: calc(var(--tap) * 4.5); /* the fifth name shows half: the list scrolls */ }
|
|
142
|
-
.message-bar:has(> .mention-list) { flex-wrap: wrap; }
|
|
142
|
+
.message-bar:has(> :is(.mention-list, .message-bar__quote)) { flex-wrap: wrap; }
|
|
143
|
+
/* the reply-to quote (MessageBar quote, Lh 2026-10-28): a line of its own over the box, a rule at its start, cut at one line, its ✕ at the end */
|
|
144
|
+
.message-bar__quote {
|
|
145
|
+
flex: 0 0 100%;
|
|
146
|
+
order: -1;
|
|
147
|
+
display: flex;
|
|
148
|
+
align-items: center;
|
|
149
|
+
gap: var(--sp-2);
|
|
150
|
+
padding-inline-start: var(--sp-3);
|
|
151
|
+
border-inline-start: var(--sp-1) solid var(--message-bar-quote-rule-ink, var(--accent));
|
|
152
|
+
font: var(--type-caption);
|
|
153
|
+
color: var(--message-bar-quote-ink, var(--card-muted)); /* the muted words of whatever it stands on, as .t-muted */
|
|
154
|
+
}
|
|
155
|
+
.message-bar__quote-words { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
143
156
|
.mention-box { display: grid; }
|
|
144
157
|
.mention-box > * { grid-area: 1 / 1; }
|
|
145
158
|
.mention-under {
|
package/css/lists.css
CHANGED
|
@@ -125,6 +125,10 @@
|
|
|
125
125
|
.bubble__meta { display: flex; align-items: center; gap: var(--bubble-meta-gap, var(--sp-1)); font: var(--bubble-meta-font, var(--type-caption)); color: var(--bubble-meta-ink, var(--card-muted)); }
|
|
126
126
|
.bubble--right > .bubble__meta { justify-self: end; }
|
|
127
127
|
.bubble__meta > .icon { --icon-ink: var(--bubble-meta-icon-ink, var(--accent-ink)); }
|
|
128
|
+
/* a bubble that is a link or is pressed (Bubble href / onClick, Lh 2026-10-28): the press answer is the DIM (actions.css), no underline */
|
|
129
|
+
a.bubble { color: inherit; text-decoration: none; }
|
|
130
|
+
/* highlighted (Bubble highlighted): the message the member is looking at, a ring a hair outside its body */
|
|
131
|
+
.bubble--highlighted > .bubble__body { outline: var(--sp-0) solid var(--bubble-highlighted-ink, var(--accent)); outline-offset: var(--sp-0); }
|
|
128
132
|
|
|
129
133
|
/* ---- timeline: a hairline with date chips, entries to the right ----
|
|
130
134
|
<ol class="timeline"><li class="timeline__item"><span class="timeline__mark">Wed 14</span><p class="t-body">…</p></li>…</ol> */
|
package/css/parts.css
CHANGED
|
@@ -153,6 +153,34 @@
|
|
|
153
153
|
}
|
|
154
154
|
.head:has(> .tile-badge:first-child + .chip-row) > :nth-child(n + 3) { grid-column: 1 / -1; grid-row: auto; }
|
|
155
155
|
|
|
156
|
+
/* a head that LEADS with a person or a thing (Lh 2026-10-28, timebank's welcome card): a `Head` whose first child is a `Lead`, an `Avatar` or an
|
|
157
|
+
`AvatarStack` (a stamp in one) and whose second is the `Words` title. The lead stands at the left; beside it, left-aligned, ONE block — the title
|
|
158
|
+
at the card heading's size over its meta — as a FeedCard's head draws it; whatever follows (an `End`, an `IconBtn`) stands at the right, centred to
|
|
159
|
+
the block. A title without a meta is centred to the lead. The title is cut at --head-title-lines (above), the meta at --head-meta-lines (none).
|
|
160
|
+
A head with no lead before its title is untouched.
|
|
161
|
+
<div class="head"><span class="avatar-stack">…</span><h2 class="words__title t-h2">…</h2><span class="words__meta t-caption t-muted">…</span><span class="end">…</span></div> */
|
|
162
|
+
.head:not(.head--centre):has(> :is(.lead, .avatar, .avatar-stack):first-child + :is(.words__title, .words__over-title)) {
|
|
163
|
+
display: grid;
|
|
164
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
165
|
+
grid-auto-columns: auto;
|
|
166
|
+
align-items: center;
|
|
167
|
+
}
|
|
168
|
+
.head:not(.head--centre):has(> :is(.lead, .avatar, .avatar-stack):first-child + :is(.words__title, .words__over-title)) > :first-child { grid-column: 1; grid-row: 1 / 3; }
|
|
169
|
+
.head:not(.head--centre):has(> :is(.lead, .avatar, .avatar-stack):first-child + :is(.words__title, .words__over-title)) > :nth-child(2) { grid-column: 2; grid-row: 1; align-self: end; }
|
|
170
|
+
.head:not(.head--centre):has(> :is(.lead, .avatar, .avatar-stack):first-child + :is(.words__title, .words__over-title)) > :nth-child(2):not(:has(+ .words__meta)) { grid-row: 1 / 3; align-self: center; }
|
|
171
|
+
.head:not(.head--centre):has(> :is(.lead, .avatar, .avatar-stack):first-child + :is(.words__title, .words__over-title)) > .words__meta:nth-child(3) {
|
|
172
|
+
grid-column: 2; grid-row: 2; align-self: start;
|
|
173
|
+
overflow-wrap: anywhere;
|
|
174
|
+
display: -webkit-box;
|
|
175
|
+
-webkit-box-orient: vertical;
|
|
176
|
+
-webkit-line-clamp: var(--head-meta-lines, none);
|
|
177
|
+
line-clamp: var(--head-meta-lines, none);
|
|
178
|
+
overflow: hidden;
|
|
179
|
+
padding-block: 0.2em 0.15em; /* room for a Thai mark inside the clip, given back outside (as the title's, above) */
|
|
180
|
+
margin-block: -0.2em -0.15em;
|
|
181
|
+
}
|
|
182
|
+
.head:not(.head--centre):has(> :is(.lead, .avatar, .avatar-stack):first-child + :is(.words__title, .words__over-title)) > :nth-child(n + 3):not(.words__meta) { grid-row: 1 / 3; }
|
|
183
|
+
|
|
156
184
|
/* in a card with paper bands: the head and the foot are paper bands edge to edge, one look */
|
|
157
185
|
:is(.card--bands, .card--bands > .card__face) > :is(.head, .foot) {
|
|
158
186
|
--card-bg: var(--card-1-bg);
|
|
@@ -394,7 +422,11 @@
|
|
|
394
422
|
Knobs --foot-gap, --foot-ink, --foot-link-gap. An outer governs a foot through those knobs or a selector naming both, written
|
|
395
423
|
below under the outer's name (Lh 2026-10-21). ---- */
|
|
396
424
|
.foot { display: flex; gap: var(--foot-gap, var(--sp-2)); align-items: center; color: var(--foot-ink, inherit); }
|
|
397
|
-
.foot:has(> :nth-child(3)) > .btn { --btn-pad-x: var(--sp-2); }
|
|
425
|
+
.foot:not(.foot--wrap):has(> :nth-child(3)) > .btn { --btn-pad-x: var(--foot-crowd-pad-x, var(--sp-2)); } /* knob: a theme that keeps one pill shape sets it to the Btn's own side padding */
|
|
426
|
+
/* wrap (Foot wrap): each Btn as wide as its words, its own side padding, from the start, wrapping; end (Foot end): they stand at the foot's end */
|
|
427
|
+
.foot--wrap { flex-wrap: wrap; justify-content: flex-start; row-gap: var(--foot-gap, var(--sp-2)); }
|
|
428
|
+
.foot--wrap > .btn { flex: 0 0 auto; }
|
|
429
|
+
.foot--end { justify-content: flex-end; }
|
|
398
430
|
/* a small link under the buttons (Foot link — Lh 2026-09-23, as the ActionBar's ctaLink): the row wraps, the link takes a
|
|
399
431
|
whole short row of its own, centred — it never shares the buttons' line */
|
|
400
432
|
.foot--link { flex-wrap: wrap; align-content: end; row-gap: var(--foot-link-gap, var(--sp-1)); }
|
package/css/sheet.css
CHANGED
|
@@ -354,14 +354,17 @@
|
|
|
354
354
|
--_band-centre: 50%;
|
|
355
355
|
position: relative;
|
|
356
356
|
min-height: var(--map-inline-h, calc(var(--map-ring) * 3 / 2));
|
|
357
|
-
/* a thin grey frame, the joined BtnGroup look="choice"'s edge (actions.css .segment--choice): its width, its ink
|
|
357
|
+
/* a thin grey frame, the joined BtnGroup look="choice"'s edge (actions.css .segment--choice): its width, its ink; the media's corner; the map clipped to it */
|
|
358
358
|
border: var(--border-w) solid var(--map-area-edge-ink, var(--outline));
|
|
359
|
-
border-radius: var(--map-radius, var(--r-
|
|
359
|
+
border-radius: var(--map-radius, var(--r-media)); /* the media corner, as a picture in a card (Lh 2026-10-28: was the pill's) */
|
|
360
360
|
overflow: clip;
|
|
361
361
|
}
|
|
362
362
|
.map--bleed { margin-inline: calc(-1 * var(--card-pad, 0rem)); border-radius: 0; border-inline: 0; } /* edge to edge is a band, and a band has no corner; --map-radius is for the box in the inset */
|
|
363
363
|
/* a map that is a body's only child fills it; the body turns to a column for it (parts.css) */
|
|
364
364
|
.body > .map--inline:only-child { flex: 1 0 auto; }
|
|
365
|
+
/* a STILL map (`.map--still`): a preview of one point, not a place to choose — it owns no gesture (no data-gestures="own", so the page's
|
|
366
|
+
own touch-action) and takes no touch: a finger on it scrolls the page, a tap is a tap on what holds it (a card that links out). The mark keeps its name */
|
|
367
|
+
.map--still, .map--still * { pointer-events: none; }
|
|
365
368
|
|
|
366
369
|
/* ---- map pick: a place on the map the member taps to choose it (Lh 2026-10-17) ----
|
|
367
370
|
<label class="map-pick" style="top: 30%; left: 40%"><input type="radio" name="meet" value="library">
|
package/css/stamp.css
CHANGED
|
@@ -247,6 +247,8 @@
|
|
|
247
247
|
/* the SMALL stamp, 48 × 60 whatever its holder's size, in the three places that hold it: stuck on a surface (a note), lapped in an avatar stack,
|
|
248
248
|
leading a feed card's head. The stamp carries the size and the `.stamp-on` box is as wide as its stamp */
|
|
249
249
|
.stamp-on > .stamp, .avatar-stack > .stamp, .feed-card__lead > .stamp { width: var(--stamp-sm-size, var(--tap)); }
|
|
250
|
+
/* the empty PLACE for a stamp at a lead's size (Lh 2026-10-28): in an avatar stack or a feed card's lead it is the small stamp's size too, an Icon inside */
|
|
251
|
+
.avatar-stack > .stamp-place, .feed-card__lead > .stamp-place { width: var(--stamp-sm-size, var(--tap)); flex: none; margin-inline: 0; }
|
|
250
252
|
.stamp-on > .stamp { max-width: none; }
|
|
251
253
|
/* --main: the same stuck stamp at the stamp's MAIN size, 96 × 120 (--stamp-size), to cover what it lies on (the owner's call, 2026-10-11: the home's note).
|
|
252
254
|
After the rule above, at the same weight: `main` is the one place a stuck stamp reads --stamp-size. */
|
package/css/tokens.css
CHANGED
|
@@ -142,6 +142,7 @@
|
|
|
142
142
|
--ease-linear: linear;
|
|
143
143
|
--ease-settle: cubic-bezier(0.2, 0.8, 0.2, 1);
|
|
144
144
|
--ease-step: steps(1); /* on or off with nothing between: a code cell's caret blinking, a secret digit before its dot */
|
|
145
|
+
--motion-send: 0.7s; /* something going OUT from a button (Btn / IconBtn sending, actions.css): the icon tips forward, two rings spread */
|
|
145
146
|
--motion-press: 0.12s; /* a control giving under the finger and springing back (actions.css PRESS) */
|
|
146
147
|
--press-scale: 0.96; /* how far a finger-sized control gives — a share of its size */
|
|
147
148
|
--scale-lift: 1.06; /* a stamp lifted off the paper while the finger holds it */
|
package/dist/actions/Btn.d.ts
CHANGED
|
@@ -14,14 +14,23 @@ export interface BtnProps extends Omit<ComponentProps<'button'>, 'form'> {
|
|
|
14
14
|
form?: boolean;
|
|
15
15
|
/** the one giant call to action in a tinted card ("Taxi!") */
|
|
16
16
|
xl?: boolean;
|
|
17
|
+
/** SMALL: one small tap tall (`--form-tap-sm`, 44 — the touch floor; knob `--btn-sm-size`), the small words (`--fs-sm`, knob `--btn-sm-font-size`),
|
|
18
|
+
* closer sides (knob `--btn-sm-pad-x`) — a worded move at a card head's end, beside the title, where an `IconBtn sm` would stand */
|
|
19
|
+
sm?: boolean;
|
|
17
20
|
/** a link styled as a button */
|
|
18
21
|
href?: string;
|
|
22
|
+
/** SENDING: something goes OUT from the button — its icon swells and tips forward, two rings spread from it (`--motion-send`, 0.7 s; knob
|
|
23
|
+
* `--btn-sending-ink`, default the accent). CONTROLLED: the app turns it on at the press and off after `onSent` (and swaps the icon for a check,
|
|
24
|
+
* or puts the sent thing in). Under reduced motion nothing moves */
|
|
25
|
+
sending?: boolean;
|
|
26
|
+
/** the send-out has ended (once per `sending`; at once where motion is off): the app does what follows */
|
|
27
|
+
onSent?: () => void;
|
|
19
28
|
}
|
|
20
29
|
/**
|
|
21
|
-
* Btn — the pill button (48px+ tall). Plain by default; `primary` for the one move; `quiet` on tinted cards.
|
|
30
|
+
* Btn — the pill button (48px+ tall; `sm` 44, for a head's end). Plain by default; `primary` for the one move; `quiet` on tinted cards.
|
|
22
31
|
* In a Foot up to four share the line; in an ActionBar it takes the width. An Icon xs may lead or trail the label.
|
|
23
32
|
*/
|
|
24
|
-
export declare function Btn({ primary, quiet, warn, block, form, xl, href, className, type, ...rest }: BtnProps): import("react").DetailedReactHTMLElement<{
|
|
33
|
+
export declare function Btn({ primary, quiet, warn, block, form, xl, sm, href, sending, onSent, onAnimationEnd, className, type, ...rest }: BtnProps): import("react").DetailedReactHTMLElement<{
|
|
25
34
|
translate?: "yes" | "no" | undefined | undefined;
|
|
26
35
|
onChange?: import("react").ChangeEventHandler<HTMLButtonElement, Element> | undefined;
|
|
27
36
|
slot?: string | undefined | undefined;
|
|
@@ -247,7 +256,6 @@ export declare function Btn({ primary, quiet, warn, block, form, xl, href, class
|
|
|
247
256
|
onWheelCapture?: import("react").WheelEventHandler<HTMLButtonElement> | undefined;
|
|
248
257
|
onAnimationStart?: import("react").AnimationEventHandler<HTMLButtonElement> | undefined;
|
|
249
258
|
onAnimationStartCapture?: import("react").AnimationEventHandler<HTMLButtonElement> | undefined;
|
|
250
|
-
onAnimationEnd?: import("react").AnimationEventHandler<HTMLButtonElement> | undefined;
|
|
251
259
|
onAnimationEndCapture?: import("react").AnimationEventHandler<HTMLButtonElement> | undefined;
|
|
252
260
|
onAnimationIteration?: import("react").AnimationEventHandler<HTMLButtonElement> | undefined;
|
|
253
261
|
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLButtonElement> | undefined;
|
|
@@ -311,6 +319,7 @@ export declare function Btn({ primary, quiet, warn, block, form, xl, href, class
|
|
|
311
319
|
formMethod?: string | undefined | undefined;
|
|
312
320
|
formNoValidate?: boolean | undefined | undefined;
|
|
313
321
|
formTarget?: string | undefined | undefined;
|
|
322
|
+
onAnimationEnd: (e: import("react").AnimationEvent<HTMLButtonElement>) => void;
|
|
314
323
|
href: string | undefined;
|
|
315
324
|
type: "reset" | "submit" | "button" | undefined;
|
|
316
325
|
className: string;
|
package/dist/actions/Btn.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { createElement } from 'react';
|
|
2
|
+
import { useSendOut } from './useSendOut.js';
|
|
2
3
|
import { cx } from '../cx.js';
|
|
3
4
|
/**
|
|
4
|
-
* Btn — the pill button (48px+ tall). Plain by default; `primary` for the one move; `quiet` on tinted cards.
|
|
5
|
+
* Btn — the pill button (48px+ tall; `sm` 44, for a head's end). Plain by default; `primary` for the one move; `quiet` on tinted cards.
|
|
5
6
|
* In a Foot up to four share the line; in an ActionBar it takes the width. An Icon xs may lead or trail the label.
|
|
6
7
|
*/
|
|
7
|
-
export function Btn({ primary, quiet, warn, block, form, xl, href, className, type, ...rest }) {
|
|
8
|
+
export function Btn({ primary, quiet, warn, block, form, xl, sm, href, sending, onSent, onAnimationEnd, className, type, ...rest }) {
|
|
9
|
+
const ended = useSendOut(sending, onSent, onAnimationEnd);
|
|
8
10
|
return createElement(href ? 'a' : 'button', {
|
|
11
|
+
onAnimationEnd: ended,
|
|
9
12
|
href,
|
|
10
13
|
type: href ? undefined : type ?? 'button',
|
|
11
|
-
className: cx('btn', primary && 'btn--primary', quiet && 'btn--quiet', warn && 'btn--warn', block && 'btn--block', form && 'btn--form', xl && 'btn--xl', className),
|
|
14
|
+
className: cx('btn', primary && 'btn--primary', quiet && 'btn--quiet', warn && 'btn--warn', block && 'btn--block', form && 'btn--form', xl && 'btn--xl', sm && 'btn--sm', sending && 'is-sending', className),
|
|
12
15
|
...rest,
|
|
13
16
|
});
|
|
14
17
|
}
|
package/dist/actions/BtnRow.d.ts
CHANGED
|
@@ -6,7 +6,11 @@ export interface BtnRowProps extends ComponentProps<'div'> {
|
|
|
6
6
|
/** with `round`: a dotted link between each two buttons and a closer gap (× · ? · ✓ — the answers of a `ModalAsk`; was `BtnTrio`).
|
|
7
7
|
* Knobs `--btn-trio-gap`, `--btn-trio-dots-w`, `--btn-trio-dots-h` */
|
|
8
8
|
joined?: boolean;
|
|
9
|
+
/** WRAP: each `Btn` as wide as its words, from the start, wrapping to a new line when they do not fit — instead of sharing the width */
|
|
10
|
+
wrap?: boolean;
|
|
11
|
+
/** the buttons stand at the END of the row (the right, in a left-to-right script) — with `wrap` */
|
|
12
|
+
end?: boolean;
|
|
9
13
|
}
|
|
10
14
|
/** BtnRow — twin CTAs inside a card's content sharing the width (Log time · Offer), or with `round` a group of round IconBtns there
|
|
11
|
-
* (`round joined`: linked by dots, the answers of a `ModalAsk`). In a foot use Foot instead. */
|
|
12
|
-
export declare function BtnRow({ round, joined, className, children, ...rest }: BtnRowProps): import("react").JSX.Element;
|
|
15
|
+
* (`round joined`: linked by dots, the answers of a `ModalAsk`); `wrap` (`wrap end`) each Btn as wide as its words, wrapping (at the end). In a foot use Foot instead. */
|
|
16
|
+
export declare function BtnRow({ round, joined, wrap, end, className, children, ...rest }: BtnRowProps): import("react").JSX.Element;
|
package/dist/actions/BtnRow.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { cx } from '../cx.js';
|
|
3
3
|
import { joinDots } from './joined.js';
|
|
4
4
|
/** BtnRow — twin CTAs inside a card's content sharing the width (Log time · Offer), or with `round` a group of round IconBtns there
|
|
5
|
-
* (`round joined`: linked by dots, the answers of a `ModalAsk`). In a foot use Foot instead. */
|
|
6
|
-
export function BtnRow({ round, joined, className, children, ...rest }) {
|
|
7
|
-
return _jsx("div", { className: cx('btn-row', round && 'btn-row--round', joined && 'btn-row--joined', className), ...rest, children: joined ? joinDots(children) : children });
|
|
5
|
+
* (`round joined`: linked by dots, the answers of a `ModalAsk`); `wrap` (`wrap end`) each Btn as wide as its words, wrapping (at the end). In a foot use Foot instead. */
|
|
6
|
+
export function BtnRow({ round, joined, wrap, end, className, children, ...rest }) {
|
|
7
|
+
return _jsx("div", { className: cx('btn-row', round && 'btn-row--round', joined && 'btn-row--joined', wrap && 'btn-row--wrap', end && 'btn-row--end', className), ...rest, children: joined ? joinDots(children) : children });
|
|
8
8
|
}
|
|
@@ -18,13 +18,19 @@ export interface IconBtnProps extends ComponentProps<'button'> {
|
|
|
18
18
|
primary?: boolean;
|
|
19
19
|
/** a link styled as a round button */
|
|
20
20
|
href?: string;
|
|
21
|
+
/** SENDING: something goes OUT from the button — its icon swells and tips forward, two rings spread from it (`--motion-send`, 0.7 s; knob
|
|
22
|
+
* `--btn-sending-ink`, default the accent). CONTROLLED: the app turns it on at the press and off after `onSent` (and swaps the icon for a check,
|
|
23
|
+
* or puts the sent thing in). Under reduced motion nothing moves */
|
|
24
|
+
sending?: boolean;
|
|
25
|
+
/** the send-out has ended (once per `sending`; at once where motion is off): the app does what follows */
|
|
26
|
+
onSent?: () => void;
|
|
21
27
|
}
|
|
22
28
|
/** IconBtn — the round icon button: `sm` in heads and bars, full size in rows and composers, `invert` for the one filled move, `primary` for the
|
|
23
29
|
* primary fill. `size="lg"` / `"xl"` are the big rounds (the foot of a few round answers: `<Foot round>`); a short WORD may stand in one
|
|
24
30
|
* as its child (`<IconBtn size="xl" primary label="ช่วยเหลือ">ช่วย</IconBtn>`): it grows with the member's text size up to the circle's share.
|
|
25
31
|
* It is a button and nothing more: to open a Menu, give it the platform's `popoverTarget={the Menu's id}` and render that `<Menu popover actions id>`
|
|
26
32
|
* wherever you like — the panel anchors to the button that opened it. To open anything else, `onClick`. */
|
|
27
|
-
export declare function IconBtn({ label, icon, sm, size, invert, primary, href, className, type, children, ...rest }: IconBtnProps): import("react").DetailedReactHTMLElement<{
|
|
33
|
+
export declare function IconBtn({ label, icon, sm, size, invert, primary, href, sending, onSent, onAnimationEnd, className, type, children, ...rest }: IconBtnProps): import("react").DetailedReactHTMLElement<{
|
|
28
34
|
ref?: import("react").Ref<HTMLButtonElement> | undefined;
|
|
29
35
|
key?: import("react").Key | null | undefined;
|
|
30
36
|
disabled?: boolean | undefined;
|
|
@@ -300,7 +306,6 @@ export declare function IconBtn({ label, icon, sm, size, invert, primary, href,
|
|
|
300
306
|
onWheelCapture?: import("react").WheelEventHandler<HTMLButtonElement> | undefined;
|
|
301
307
|
onAnimationStart?: import("react").AnimationEventHandler<HTMLButtonElement> | undefined;
|
|
302
308
|
onAnimationStartCapture?: import("react").AnimationEventHandler<HTMLButtonElement> | undefined;
|
|
303
|
-
onAnimationEnd?: import("react").AnimationEventHandler<HTMLButtonElement> | undefined;
|
|
304
309
|
onAnimationEndCapture?: import("react").AnimationEventHandler<HTMLButtonElement> | undefined;
|
|
305
310
|
onAnimationIteration?: import("react").AnimationEventHandler<HTMLButtonElement> | undefined;
|
|
306
311
|
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLButtonElement> | undefined;
|
|
@@ -316,5 +321,6 @@ export declare function IconBtn({ label, icon, sm, size, invert, primary, href,
|
|
|
316
321
|
onTransitionStartCapture?: import("react").TransitionEventHandler<HTMLButtonElement> | undefined;
|
|
317
322
|
href: string | undefined;
|
|
318
323
|
type: "reset" | "submit" | "button" | undefined;
|
|
324
|
+
onAnimationEnd: (e: import("react").AnimationEvent<HTMLButtonElement>) => void;
|
|
319
325
|
className: string;
|
|
320
326
|
}, HTMLButtonElement>;
|
package/dist/actions/IconBtn.js
CHANGED
|
@@ -3,15 +3,17 @@ import { createElement } from 'react';
|
|
|
3
3
|
import { cx } from '../cx.js';
|
|
4
4
|
import { warnOnce } from '../state.js';
|
|
5
5
|
import { Icon } from '../type/Icon.js';
|
|
6
|
+
import { useSendOut } from './useSendOut.js';
|
|
6
7
|
/** IconBtn — the round icon button: `sm` in heads and bars, full size in rows and composers, `invert` for the one filled move, `primary` for the
|
|
7
8
|
* primary fill. `size="lg"` / `"xl"` are the big rounds (the foot of a few round answers: `<Foot round>`); a short WORD may stand in one
|
|
8
9
|
* as its child (`<IconBtn size="xl" primary label="ช่วยเหลือ">ช่วย</IconBtn>`): it grows with the member's text size up to the circle's share.
|
|
9
10
|
* It is a button and nothing more: to open a Menu, give it the platform's `popoverTarget={the Menu's id}` and render that `<Menu popover actions id>`
|
|
10
11
|
* wherever you like — the panel anchors to the button that opened it. To open anything else, `onClick`. */
|
|
11
|
-
export function IconBtn({ label, icon, sm, size, invert, primary, href, className, type, children, ...rest }) {
|
|
12
|
+
export function IconBtn({ label, icon, sm, size, invert, primary, href, sending, onSent, onAnimationEnd, className, type, children, ...rest }) {
|
|
13
|
+
const ended = useSendOut(sending, onSent, onAnimationEnd);
|
|
12
14
|
if (invert && primary)
|
|
13
15
|
warnOnce('icon-btn-fill', 'cardds IconBtn: `invert` and `primary` together — two fills for one button; `primary` is drawn');
|
|
14
16
|
const step = size ?? (sm ? 'sm' : undefined);
|
|
15
|
-
const btn = createElement(href ? 'a' : 'button', { href, type: href ? undefined : type ?? 'button', 'aria-label': label, className: cx('icon-btn', step && `icon-btn--${step}`, invert && 'icon-btn--invert', primary && 'icon-btn--primary', className), ...rest }, icon ? _jsx(Icon, { name: icon, size: step === 'sm' ? 'sm' : 'md' }) : children);
|
|
17
|
+
const btn = createElement(href ? 'a' : 'button', { href, type: href ? undefined : type ?? 'button', 'aria-label': label, onAnimationEnd: ended, className: cx('icon-btn', step && `icon-btn--${step}`, invert && 'icon-btn--invert', primary && 'icon-btn--primary', sending && 'is-sending', className), ...rest }, icon ? _jsx(Icon, { name: icon, size: step === 'sm' ? 'sm' : 'md' }) : children);
|
|
16
18
|
return btn;
|
|
17
19
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
export interface LinkBlockProps extends ComponentProps<'a'> {
|
|
3
|
+
/** where it goes — a link block is always a link */
|
|
4
|
+
href: string;
|
|
5
|
+
}
|
|
6
|
+
/** LinkBlock — a link that is neither a card nor a row: a few pieces of a card's content (a still `MapArea` and the `Row` naming the place) as ONE
|
|
7
|
+
* `<a>`, stacked with the card's gap, in the ink of what holds it, no underline, no frame and no padding of its own; it dims under the finger.
|
|
8
|
+
* Name it with `aria-label` when it leaves the app (`target="_blank"`). Nothing that can be pressed goes inside. Knob `--link-block-gap`. */
|
|
9
|
+
export declare function LinkBlock({ className, ...rest }: LinkBlockProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cx } from '../cx.js';
|
|
3
|
+
/** LinkBlock — a link that is neither a card nor a row: a few pieces of a card's content (a still `MapArea` and the `Row` naming the place) as ONE
|
|
4
|
+
* `<a>`, stacked with the card's gap, in the ink of what holds it, no underline, no frame and no padding of its own; it dims under the finger.
|
|
5
|
+
* Name it with `aria-label` when it leaves the app (`target="_blank"`). Nothing that can be pressed goes inside. Knob `--link-block-gap`. */
|
|
6
|
+
export function LinkBlock({ className, ...rest }) {
|
|
7
|
+
return _jsx("a", { className: cx('link-block', className), ...rest });
|
|
8
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type AnimationEvent } from 'react';
|
|
2
|
+
/** a button that is `sending`: its send-out plays, and `onSent` comes once when it ends — at once where motion is off. Returns the button's
|
|
3
|
+
* `onAnimationEnd` (it calls the caller's first) */
|
|
4
|
+
export declare function useSendOut<E extends Element>(sending: boolean | undefined, onSent: (() => void) | undefined, onAnimationEnd?: (e: AnimationEvent<E>) => void): (e: AnimationEvent<E>) => void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { reducedMotion, useLatest } from '../state.js';
|
|
3
|
+
const SEND_OUT = 'send-out'; // css/actions.css — the rings that go out from a sending button
|
|
4
|
+
/** a button that is `sending`: its send-out plays, and `onSent` comes once when it ends — at once where motion is off. Returns the button's
|
|
5
|
+
* `onAnimationEnd` (it calls the caller's first) */
|
|
6
|
+
export function useSendOut(sending, onSent, onAnimationEnd) {
|
|
7
|
+
const told = useLatest(onSent);
|
|
8
|
+
useEffect(() => { if (sending && reducedMotion())
|
|
9
|
+
told.current?.(); }, [sending]); // nothing plays: nothing to wait for
|
|
10
|
+
return (e) => {
|
|
11
|
+
onAnimationEnd?.(e);
|
|
12
|
+
if (sending && e.target === e.currentTarget && e.animationName === SEND_OUT)
|
|
13
|
+
told.current?.();
|
|
14
|
+
};
|
|
15
|
+
}
|