@usableapp/cardds 0.7.178 → 0.7.180
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 +38 -0
- package/bin/cardds.mjs +23 -3
- package/css/actions.css +11 -8
- package/css/base.css +13 -2
- package/css/card.css +39 -7
- package/css/layover.css +25 -16
- package/css/lists.css +58 -4
- package/css/media.css +33 -0
- package/css/parts.css +20 -2
- package/css/stack.css +43 -1
- package/css/tokens.css +4 -1
- package/dist/actions/Btn.d.ts +6 -2
- package/dist/actions/Btn.js +5 -2
- package/dist/cardds.css +246 -41
- package/dist/cards/Card.d.ts +1 -1
- package/dist/cards/Card.js +4 -1
- package/dist/cards/CardParts.d.ts +12 -5
- package/dist/cards/CardParts.js +8 -7
- package/dist/cards/FeedPost.d.ts +31 -0
- package/dist/cards/FeedPost.js +14 -0
- package/dist/catalog.json +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/layover/Popup.d.ts +2 -2
- package/dist/layover/Popup.js +1 -1
- package/dist/lists/Bubble.d.ts +25 -6
- package/dist/lists/Bubble.js +17 -8
- package/dist/lists/Row.d.ts +11 -2
- package/dist/lists/Row.js +4 -3
- package/dist/media/Mosaic.d.ts +4 -3
- package/dist/media/Mosaic.js +8 -4
- package/dist/media/Thumb.d.ts +14 -0
- package/dist/media/Thumb.js +12 -0
- package/dist/parts/Foot.d.ts +7 -2
- package/dist/parts/Foot.js +4 -3
- package/dist/parts/Head.d.ts +3 -1
- package/dist/parts/Head.js +3 -1
- package/dist/scaffold/Centre.d.ts +1 -1
- package/dist/scaffold/Centre.js +1 -1
- package/dist/scaffold/Panes.d.ts +1 -0
- package/dist/scaffold/Panes.js +1 -0
- package/dist/sheets/Modal.d.ts +1 -1
- package/dist/sheets/Modal.js +1 -1
- package/dist/sheets/SheetStack.d.ts +3 -1
- package/dist/sheets/SheetStack.js +2 -1
- package/dist/sheets/StackSheet.d.ts +6 -4
- package/dist/sheets/StackSheet.js +8 -3
- package/dist/sheets/stackCard.d.ts +2 -0
- package/dist/templates/Home.d.ts +3 -1
- package/dist/templates/Home.js +2 -2
- package/dist/templates/Splash.d.ts +1 -1
- package/dist/templates/Splash.js +1 -1
- package/dist/type/Icon.js +1 -1
- package/dist/type/Phrase.d.ts +9 -0
- package/dist/type/Phrase.js +11 -0
- package/dist/type/Strong.d.ts +7 -0
- package/dist/type/Strong.js +9 -0
- package/dist/type/Text.d.ts +5 -1
- package/dist/type/Text.js +7 -3
- package/dist/type/icons.d.ts +1 -1
- package/dist/type/icons.js +2 -2
- package/docs/reference.md +121 -8
- package/icons.svg +1 -0
- package/lib/audit.mjs +330 -0
- package/lib/guide.mjs +1 -1
- package/lib/mcp.mjs +13 -0
- package/lint/rules.mjs +2 -2
- package/package.json +1 -1
package/css/parts.css
CHANGED
|
@@ -51,7 +51,8 @@
|
|
|
51
51
|
}
|
|
52
52
|
.words__meta { font: var(--words-meta-font, var(--type-caption)); color: var(--words-meta-ink, var(--card-muted)); display: flex; align-items: center; gap: var(--words-meta-gap, var(--sp-1)); }
|
|
53
53
|
.row--lg > .words > .words__title { font: var(--fw-bold) var(--fs-lg) / round(down, calc(var(--lh-h1) * 1em), 1px) var(--font-display); }
|
|
54
|
-
.row--done > .words > .words__title { color: var(--card-muted); }
|
|
54
|
+
.row--done:not(.row--full-ink) > .words > .words__title { color: var(--card-muted); }
|
|
55
|
+
.row--todo > .words > :is(.words__title, .words__meta) { color: var(--_todo-ink); } /* a to-do line fades: title and second line (Row todo, cardds#223) */
|
|
55
56
|
|
|
56
57
|
/* ---- end: the value over its caption, right-aligned at the end of a line ---- */
|
|
57
58
|
.end { margin-left: auto; text-align: right; display: grid; gap: var(--end-gap, var(--sp-0)); justify-items: end; }
|
|
@@ -191,7 +192,10 @@
|
|
|
191
192
|
.head:has(> .tile-badge:first-child + .head__chips) { row-gap: var(--head-words-gap, var(--sp-1)); }
|
|
192
193
|
.head:has(> .tile-badge:first-child + .head__chips) > :is(.tile-badge:first-child, .head__chips) { margin-block-end: max(0rem, calc(var(--head-group-gap, var(--sp-5)) - var(--head-words-gap, var(--sp-1)))); } /* the date and its chips both keep it, so the stretched date stays as tall as the chips */
|
|
193
194
|
.head__chips { grid-column: 2; grid-row: 1; align-self: stretch; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: var(--head-chips-gap, var(--head-col-gap, var(--sp-3))); }
|
|
194
|
-
.head__chips-top { min-height: calc(round(down, calc(var(--fs-sm) * var(--chip-sm-line, var(--lh-body))), 1px) + 2 * var(--chip-sm-pad-y, var(--sp-0)) + 2 * var(--border-w)); } /* one small chip tall (actions.css: a head's chips) */
|
|
195
|
+
.head__chips-top, .head__fold { min-height: calc(round(down, calc(var(--fs-sm) * var(--chip-sm-line, var(--lh-body))), 1px) + 2 * var(--chip-sm-pad-y, var(--sp-0)) + 2 * var(--border-w)); } /* one small chip tall (actions.css: a head's chips) */
|
|
196
|
+
.head:has(> .tile-badge:first-child + :is(.chip-row, .head__chips)):has(> .head__fold) { grid-template-columns: auto minmax(0, 1fr) auto; }
|
|
197
|
+
.head:has(> .tile-badge:first-child + :is(.chip-row, .head__chips)) > .head__fold.head__fold { grid-column: 3; grid-row: 1; align-self: center; display: flex; align-items: center; }
|
|
198
|
+
.head:has(> .tile-badge:first-child + .head__chips) > .head__fold.head__fold { align-self: start; }
|
|
195
199
|
|
|
196
200
|
/* a head that LEADS with a person or a thing (Lh 2026-10-28, timebank's welcome card; re-laid for a phone's width the same day): a `Head` whose
|
|
197
201
|
first child is a `Lead`, an `Avatar` or an `AvatarStack` (a stamp in one) and whose second is the `Words` title. The lead at the left, as tall
|
|
@@ -622,3 +626,17 @@
|
|
|
622
626
|
:is(.sheet--peek, .sheet--away) > .foot { translate: 0 0; visibility: hidden; transition: translate var(--motion-sheet) var(--ease), visibility 0s var(--ease-linear) var(--motion-sheet); }
|
|
623
627
|
/* a paper sheet's foot is paper, as its body is: the words read the controls' side */
|
|
624
628
|
.sheet--paper > .foot { --card-bg: var(--action-bg); --dark: var(--action-dark); color: var(--foot-ink, var(--card-ink)); }
|
|
629
|
+
/* layer (Foot layer, cardds#214): the strip behind a sheet's foot — the foot's own height and the room round it, --_foot, the strip the body stops above —
|
|
630
|
+
has a ground of its own, edge to edge, so the foot reads as a layer apart from the words that scroll behind it. Painted on the foot's own layer, as the
|
|
631
|
+
strip is (above): no padding, margin or height is added, so the body stops where it did. The ground is the sheet's, a little darker (8% of the dark ink
|
|
632
|
+
over --card-bg: opaque, as the strip must be, and darker on a dark sheet too); the rule over it is the first --rule-w of the strip (a border would stand at the
|
|
633
|
+
top of the sheet-tall layer). What stands on the strip keeps its own look: a MessageBar's box is still the paper. Knobs --foot-layer-bg, --foot-layer-rule-ink */
|
|
634
|
+
.sheet > .foot.foot--layer {
|
|
635
|
+
--_layer-bg: color-mix(in srgb, var(--ink-onlight) 8%, var(--card-bg));
|
|
636
|
+
background-image:
|
|
637
|
+
linear-gradient(var(--foot-layer-rule-ink, var(--hairline)), var(--foot-layer-rule-ink, var(--hairline))),
|
|
638
|
+
linear-gradient(var(--foot-layer-bg, var(--_layer-bg)), var(--foot-layer-bg, var(--_layer-bg)));
|
|
639
|
+
background-position: left 0 bottom calc(var(--_foot) - var(--rule-w)), left 0 bottom 0;
|
|
640
|
+
background-size: 100% var(--rule-w), 100% var(--_foot);
|
|
641
|
+
background-repeat: no-repeat;
|
|
642
|
+
}
|
package/css/stack.css
CHANGED
|
@@ -301,7 +301,7 @@
|
|
|
301
301
|
border-color var(--motion-sheet) var(--ease),
|
|
302
302
|
box-shadow var(--motion-sheet) var(--ease);
|
|
303
303
|
}
|
|
304
|
-
.stack-sheet__tab > .stack-sheet__count { /* outranks .badge (numbers.css loads after this file) */
|
|
304
|
+
:is(.stack-sheet__tab, .stack-sheet__tab-icon) > .stack-sheet__count { /* outranks .badge (numbers.css loads after this file) */
|
|
305
305
|
position: absolute;
|
|
306
306
|
top: calc(-1 * var(--stack-sheet-count-out, var(--sp-2))); /* how far it stands OUT of the tab's corner, up and to the right: at sp-1 it
|
|
307
307
|
sat exactly on the chosen tab's disc edge — it reads as a mark beside the icon, not part of the disc (Lh 2026-10-01) */
|
|
@@ -329,6 +329,48 @@
|
|
|
329
329
|
sp-4 since Lh 2026-10-30 (was sp-2): the last tab's count badge still stood almost cropped by the corner */
|
|
330
330
|
.head > .stack-sheet__tabs { margin-right: var(--stack-sheet-tabs-end, var(--sp-4)); }
|
|
331
331
|
|
|
332
|
+
.stack-sheet__tabs--named { align-items: flex-start; gap: var(--stack-sheet-tabs-named-gap, var(--sp-3)); }
|
|
333
|
+
.head > .stack-sheet__tabs--named { margin-right: 0; }
|
|
334
|
+
.stack-sheet__tab.stack-sheet__tab--named {
|
|
335
|
+
flex: none;
|
|
336
|
+
display: grid;
|
|
337
|
+
justify-items: center;
|
|
338
|
+
gap: var(--stack-sheet-tab-gap, var(--sp-0));
|
|
339
|
+
width: auto;
|
|
340
|
+
height: auto;
|
|
341
|
+
margin: 0;
|
|
342
|
+
padding: var(--stack-sheet-tab-pad, var(--sp-2) var(--sp-2) var(--sp-1));
|
|
343
|
+
border: 0;
|
|
344
|
+
border-radius: var(--stack-sheet-tab-radius, var(--sp-4));
|
|
345
|
+
background: transparent;
|
|
346
|
+
box-shadow: none;
|
|
347
|
+
color: var(--stack-sheet-tab-ink, var(--card-muted));
|
|
348
|
+
font: var(--fw-caption) var(--fs-2xs) / var(--lh-label) var(--face-caption);
|
|
349
|
+
white-space: nowrap;
|
|
350
|
+
text-align: center;
|
|
351
|
+
cursor: pointer;
|
|
352
|
+
touch-action: manipulation;
|
|
353
|
+
}
|
|
354
|
+
.stack-sheet__tab-icon { position: relative; display: inline-flex; }
|
|
355
|
+
.stack-sheet__tab-name { display: block; }
|
|
356
|
+
.stack-sheet__tab-icon > .stack-sheet__count {
|
|
357
|
+
right: auto;
|
|
358
|
+
left: calc(100% - var(--sp-1) - var(--sp-0));
|
|
359
|
+
}
|
|
360
|
+
.stack-sheet__tab.stack-sheet__tab--named[aria-selected="true"] {
|
|
361
|
+
background: var(--icon-btn-invert-bg, var(--btn-primary-bg, var(--accent)));
|
|
362
|
+
color: var(--icon-btn-invert-ink, var(--btn-primary-ink, var(--on-accent)));
|
|
363
|
+
}
|
|
364
|
+
.stack-sheet__tab--named:active { scale: var(--press-scale); }
|
|
365
|
+
.stack-sheet__tab--named:focus-visible { outline: var(--focus); outline-offset: var(--sp-1); }
|
|
366
|
+
.sheet-stack--tap > .card:not(.is-open) > .head .stack-sheet__tab.stack-sheet__tab--named[aria-selected="true"] {
|
|
367
|
+
background: transparent;
|
|
368
|
+
color: var(--stack-sheet-tab-ink, var(--card-muted));
|
|
369
|
+
}
|
|
370
|
+
.sheet-stack:not(.sheet-stack--display, .sheet-stack--fanned):has(.head .stack-sheet__tab--named) {
|
|
371
|
+
--stack-step: calc(var(--card-pad-rest) + var(--tap) + var(--card-gap-rest) + var(--sp-6));
|
|
372
|
+
}
|
|
373
|
+
|
|
332
374
|
/* AT THE END (Lh 2026-09-29, the home): after the tabs, chevron down — the open sheet folds down. The head's end gives it its room
|
|
333
375
|
while open; the last tab then sits on the inset (no reach into the padding) */
|
|
334
376
|
:is(.sheet-stack--tap > .card, .sheet-stack--tap > :not(.card, .sheet-stack__base) > .card) > .head > .sheet-stack__back--end { left: auto; right: 0; } /* as specific as the rule that sets it at the start (above), so it wins: a shorter selector lost, and the back stood over the title */
|
package/css/tokens.css
CHANGED
|
@@ -15,7 +15,9 @@
|
|
|
15
15
|
--screen-w: 34.375rem; /* 550: the column's CAP — .screen, .action-bar, .sheet-stage. On a phone the screen is the device, edge to edge —
|
|
16
16
|
also a phone set to a small display size, a fold's outer screen (540 was seen, Lh 2026-10-01); the cap only keeps
|
|
17
17
|
a tablet / desktop window to a phone-sized column. Was 25rem (a 412px phone showed a strip each side), then 30rem */
|
|
18
|
-
--
|
|
18
|
+
--centre-at: 0.4; /* the human centre, as a share: 40% down a screen AND 40% down a box that stands on it (Lh, 2026-09-10, 2026-11-18) */
|
|
19
|
+
--screen-centre: calc(var(--centre-at) * 100%); /* the human centre of a screen: the middle of its top four fifths — the bottom fifth is the thumb's. A centred box's top is here */
|
|
20
|
+
--centre-lift: calc(-1 * var(--screen-centre)); /* a centred box's translate: its own 40% point (not its middle) lands on --screen-centre. A translate % is of the box's own height */
|
|
19
21
|
|
|
20
22
|
/* ---- the four bases: what a project retunes (Lh, 2026-09-20) ----
|
|
21
23
|
Every size token below is multiplier × its family's base. A project sets a BASE
|
|
@@ -345,6 +347,7 @@
|
|
|
345
347
|
/* derived tints — read the element's own ink, so they work on any slot */
|
|
346
348
|
--outline: var(--action-border); /* control edges (palette.css softens) */
|
|
347
349
|
--hairline: color-mix(in srgb, currentColor 18%, transparent); /* dividers inside cards */
|
|
350
|
+
--hairline-soft: color-mix(in srgb, currentColor 10%, transparent); /* a line that only has to be seen: the rule under a joined row */
|
|
348
351
|
--ink-tint: color-mix(in srgb, currentColor 12%, transparent); /* hover, rails, rests */
|
|
349
352
|
--unread-bg: color-mix(in srgb, currentColor 4%, transparent); /* a very light grey over any ground: a row never read (Row unread) */
|
|
350
353
|
--ink-rail: color-mix(in srgb, currentColor 30%, transparent); /* todo steps, ghost edges */
|
package/dist/actions/Btn.d.ts
CHANGED
|
@@ -25,6 +25,10 @@ interface BtnBase extends Omit<ComponentProps<'button'>, 'form' | 'children'> {
|
|
|
25
25
|
* be pressed (it is `disabled`, so it fades like one; `aria-busy`). CONTROLLED: the app turns it on at the press and off when the work is
|
|
26
26
|
* done. A round keeps its `label` as its spoken name and needs no `icon` while busy. Under reduced motion the ring stands still */
|
|
27
27
|
busy?: boolean;
|
|
28
|
+
/** DONE ALREADY (cardds#213): the move was made and cannot be made again — the button fades (`--off`), takes no press (no give, no dim) and
|
|
29
|
+
* never calls `onClick`, yet stays in the tab order and is read with its name (unlike `disabled`, which takes it out). In a `BtnGroup` with
|
|
30
|
+
* `select` its share is never switched by a press. The app says what was done in `label` ("Passed on") and may swap the icon (a check) */
|
|
31
|
+
'aria-disabled'?: boolean | 'true' | 'false';
|
|
28
32
|
}
|
|
29
33
|
export interface PillBtnProps extends BtnBase {
|
|
30
34
|
/** `pill` (default): the worded button, as wide as its words */
|
|
@@ -104,7 +108,6 @@ export declare function Btn(props: BtnProps): import("react").DetailedReactHTMLE
|
|
|
104
108
|
"aria-describedby"?: string | undefined | undefined;
|
|
105
109
|
"aria-description"?: string | undefined | undefined;
|
|
106
110
|
"aria-details"?: string | undefined | undefined;
|
|
107
|
-
"aria-disabled": (boolean | "true" | "false") | undefined;
|
|
108
111
|
"aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined | undefined;
|
|
109
112
|
"aria-errormessage"?: string | undefined | undefined;
|
|
110
113
|
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
@@ -227,7 +230,6 @@ export declare function Btn(props: BtnProps): import("react").DetailedReactHTMLE
|
|
|
227
230
|
onWaitingCapture?: import("react").ReactEventHandler<HTMLButtonElement> | undefined;
|
|
228
231
|
onAuxClick?: import("react").MouseEventHandler<HTMLButtonElement> | undefined;
|
|
229
232
|
onAuxClickCapture?: import("react").MouseEventHandler<HTMLButtonElement> | undefined;
|
|
230
|
-
onClick?: import("react").MouseEventHandler<HTMLButtonElement> | undefined;
|
|
231
233
|
onClickCapture?: import("react").MouseEventHandler<HTMLButtonElement> | undefined;
|
|
232
234
|
onContextMenu?: import("react").MouseEventHandler<HTMLButtonElement> | undefined;
|
|
233
235
|
onContextMenuCapture?: import("react").MouseEventHandler<HTMLButtonElement> | undefined;
|
|
@@ -363,6 +365,8 @@ export declare function Btn(props: BtnProps): import("react").DetailedReactHTMLE
|
|
|
363
365
|
href: string | undefined;
|
|
364
366
|
type: "button" | "reset" | "submit" | undefined;
|
|
365
367
|
disabled: boolean | undefined;
|
|
368
|
+
'aria-disabled': true | undefined;
|
|
369
|
+
onClick: import("react").MouseEventHandler<HTMLButtonElement> | undefined;
|
|
366
370
|
className: string;
|
|
367
371
|
}, HTMLButtonElement>;
|
|
368
372
|
export {};
|
package/dist/actions/Btn.js
CHANGED
|
@@ -12,7 +12,8 @@ import { Badge } from '../numbers/Badge.js';
|
|
|
12
12
|
* and render that `<Menu popover actions id>` wherever you like — the panel anchors to the button that opened it. To open anything else, `onClick`.
|
|
13
13
|
*/
|
|
14
14
|
export function Btn(props) {
|
|
15
|
-
const { shape, size, tone, href, sending, onSent, busy, disabled, onAnimationEnd, className, type, children, block, form, label, icon, count, ...rest } = props;
|
|
15
|
+
const { shape, size, tone, href, sending, onSent, busy, disabled, onAnimationEnd, className, type, children, block, form, label, icon, count, onClick, 'aria-disabled': done, ...rest } = props;
|
|
16
|
+
const off = done === true || done === 'true';
|
|
16
17
|
const ended = useSendOut(sending, onSent, onAnimationEnd);
|
|
17
18
|
const round = shape === 'round';
|
|
18
19
|
const base = round ? 'icon-btn' : 'btn';
|
|
@@ -26,7 +27,9 @@ export function Btn(props) {
|
|
|
26
27
|
href: busy ? undefined : href, // a busy link goes nowhere
|
|
27
28
|
type: href ? undefined : type ?? 'button',
|
|
28
29
|
disabled: href ? disabled : disabled || busy,
|
|
29
|
-
'aria-disabled': href && busy ? true : undefined,
|
|
30
|
+
'aria-disabled': off || (href && busy) ? true : undefined,
|
|
31
|
+
// done already: the press reaches nobody (a link goes nowhere either)
|
|
32
|
+
onClick: off ? (e) => e.preventDefault() : onClick,
|
|
30
33
|
'aria-busy': busy || undefined,
|
|
31
34
|
'aria-label': round ? (shown ? `${label} ${shown}` : label) : undefined,
|
|
32
35
|
className: cx(base, step, look, invert, shown && 'icon-btn--count', block && 'btn--block', form && 'btn--form', sending && 'is-sending', busy && 'is-busy', className),
|