@usableapp/cardds 0.7.177 → 0.7.179
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 +45 -0
- package/css/actions.css +11 -8
- package/css/base.css +13 -2
- package/css/card.css +39 -7
- package/css/layover.css +87 -10
- package/css/lists.css +69 -3
- package/css/media.css +33 -0
- package/css/palette.css +7 -0
- package/css/parts.css +27 -1
- package/css/tokens.css +9 -2
- package/dist/actions/Btn.d.ts +6 -2
- package/dist/actions/Btn.js +5 -2
- package/dist/cardds.css +295 -33
- 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/cards/inkGrounds.js +1 -1
- package/dist/catalog.json +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/layover/Popup.d.ts +23 -0
- package/dist/layover/Popup.js +15 -0
- package/dist/lists/Bubble.d.ts +25 -6
- package/dist/lists/Bubble.js +17 -8
- package/dist/lists/Row.d.ts +19 -4
- package/dist/lists/Row.js +8 -6
- 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/Lead.d.ts +7 -1
- package/dist/parts/Lead.js +3 -2
- 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/templates/Splash.d.ts +1 -1
- package/dist/templates/Splash.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 +101 -4
- package/icons.svg +1 -0
- package/lib/catalog.mjs +1 -1
- package/lint/rules.mjs +2 -2
- package/package.json +1 -1
package/css/parts.css
CHANGED
|
@@ -26,6 +26,17 @@
|
|
|
26
26
|
}
|
|
27
27
|
.feed-card > .head:has(> .t-caption) > .lead { grid-row: span 2; }
|
|
28
28
|
|
|
29
|
+
/* a filled lead (`Lead tone`, cardds#219): one colour of the set (tokens.css greys, palette.css colours), no outline (its border colour is clear, in a row card too), the ondark ink on it. It declares its side (dark)
|
|
30
|
+
so inkGrounds() reads it as a dark ground, and names the ink itself: its ground is its own fill, not the card's */
|
|
31
|
+
.lead--tone, :is(.card--row, .feed-card > .head) > .lead--tone { border-color: transparent; }
|
|
32
|
+
.lead--tone { --dark: 1; background: var(--lead-bg, var(--_lead-fill)); color: var(--lead-ink, var(--ink-ondark)); }
|
|
33
|
+
.lead--blue { --_lead-fill: var(--tone-blue); }
|
|
34
|
+
.lead--green { --_lead-fill: var(--tone-green); }
|
|
35
|
+
.lead--amber { --_lead-fill: var(--tone-amber); }
|
|
36
|
+
.lead--red { --_lead-fill: var(--tone-red); }
|
|
37
|
+
.lead--pink { --_lead-fill: var(--tone-pink); }
|
|
38
|
+
.lead--violet { --_lead-fill: var(--tone-violet); }
|
|
39
|
+
|
|
29
40
|
/* ---- words: the title over its meta, taking the room between the lead and the end ---- */
|
|
30
41
|
.words { flex: 1; display: grid; gap: var(--words-gap, var(--sp-0)); }
|
|
31
42
|
.row > .words { min-width: 0; }
|
|
@@ -40,7 +51,8 @@
|
|
|
40
51
|
}
|
|
41
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)); }
|
|
42
53
|
.row--lg > .words > .words__title { font: var(--fw-bold) var(--fs-lg) / round(down, calc(var(--lh-h1) * 1em), 1px) var(--font-display); }
|
|
43
|
-
.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) */
|
|
44
56
|
|
|
45
57
|
/* ---- end: the value over its caption, right-aligned at the end of a line ---- */
|
|
46
58
|
.end { margin-left: auto; text-align: right; display: grid; gap: var(--end-gap, var(--sp-0)); justify-items: end; }
|
|
@@ -611,3 +623,17 @@
|
|
|
611
623
|
: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); }
|
|
612
624
|
/* a paper sheet's foot is paper, as its body is: the words read the controls' side */
|
|
613
625
|
.sheet--paper > .foot { --card-bg: var(--action-bg); --dark: var(--action-dark); color: var(--foot-ink, var(--card-ink)); }
|
|
626
|
+
/* 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 —
|
|
627
|
+
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
|
|
628
|
+
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
|
|
629
|
+
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
|
|
630
|
+
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 */
|
|
631
|
+
.sheet > .foot.foot--layer {
|
|
632
|
+
--_layer-bg: color-mix(in srgb, var(--ink-onlight) 8%, var(--card-bg));
|
|
633
|
+
background-image:
|
|
634
|
+
linear-gradient(var(--foot-layer-rule-ink, var(--hairline)), var(--foot-layer-rule-ink, var(--hairline))),
|
|
635
|
+
linear-gradient(var(--foot-layer-bg, var(--_layer-bg)), var(--foot-layer-bg, var(--_layer-bg)));
|
|
636
|
+
background-position: left 0 bottom calc(var(--_foot) - var(--rule-w)), left 0 bottom 0;
|
|
637
|
+
background-size: 100% var(--rule-w), 100% var(--_foot);
|
|
638
|
+
background-repeat: no-repeat;
|
|
639
|
+
}
|
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
|
|
@@ -334,6 +336,9 @@
|
|
|
334
336
|
--signal-info-onlight: #2e5c98;
|
|
335
337
|
/* 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 */
|
|
336
338
|
--highlight-1: #3d3d3d; --highlight-2: #8a8a8a; --highlight-3: #5f5f5f; --highlight-4: #b0b0b0;
|
|
339
|
+
/* tones (cardds#219): six fills for a small box that carries the ondark ink (a `Lead tone`), to tell kinds of thing apart. Colour lives in palette.css only, so the
|
|
340
|
+
wireframe keeps six greys — darkened so white holds 4.5:1 on each (a project's theme may set them) */
|
|
341
|
+
--tone-blue: #111111; --tone-green: #2b2b2b; --tone-amber: #444444; --tone-red: #595959; --tone-pink: #666666; --tone-violet: #737373;
|
|
337
342
|
--signal-error-onlight: #af2525; /* something went wrong — a field's edge, the words that say what */
|
|
338
343
|
/* on a dark ground no shade of one hue holds 4.5:1 on every palette's dark fill and stays itself: a signal there is the ondark ink,
|
|
339
344
|
and the icon and the words carry the meaning. A palette may give its own (orchard) */
|
|
@@ -342,7 +347,9 @@
|
|
|
342
347
|
/* derived tints — read the element's own ink, so they work on any slot */
|
|
343
348
|
--outline: var(--action-border); /* control edges (palette.css softens) */
|
|
344
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 */
|
|
345
351
|
--ink-tint: color-mix(in srgb, currentColor 12%, transparent); /* hover, rails, rests */
|
|
352
|
+
--unread-bg: color-mix(in srgb, currentColor 4%, transparent); /* a very light grey over any ground: a row never read (Row unread) */
|
|
346
353
|
--ink-rail: color-mix(in srgb, currentColor 30%, transparent); /* todo steps, ghost edges */
|
|
347
354
|
--accent-soft: color-mix(in srgb, var(--accent) 22%, transparent); /* calendar marks */
|
|
348
355
|
--accent-wash: color-mix(in srgb, var(--accent) 22%, var(--action-bg)); /* the same wash laid on the paper of fields and buttons, opaque: a soft chip reads the same on any card (Chip soft) */
|
|
@@ -413,7 +420,7 @@
|
|
|
413
420
|
tile) takes its ground's side: `--dark: inherit`. inkGrounds() measures it; docs/reference.md "Ink follows its ground" */
|
|
414
421
|
:where(body, [data-palette], [data-mode], .card, .tile, .modal__drawer, .postcard__front, .postcard__back, .sticky, .post-paper,
|
|
415
422
|
.float-bar__pill, .snackbar__body, .track, .tile-badge, .avatar, .bubble__body, .map__hint, .map__pin, .sheet--paper > :is(.body, .foot),
|
|
416
|
-
.postcard__band, .track__step, .toggle, .chip, .btn--warn, .card__face, .card--bands > :is(.head, .foot), .card--bands > .card__face > :is(.head, .foot)) {
|
|
423
|
+
.postcard__band, .track__step, .toggle, .chip, .btn--warn, .card__face, .card--bands > :is(.head, .foot), .card--bands > .card__face > :is(.head, .foot), .popup) {
|
|
417
424
|
--card-ink: color-mix(in srgb, var(--ink-ondark) calc(var(--dark) * 100%), var(--ink-onlight));
|
|
418
425
|
--card-muted: color-mix(in srgb, var(--ink-ondark-muted) calc(var(--dark) * 100%), var(--ink-onlight-muted));
|
|
419
426
|
--on-accent: color-mix(in srgb, var(--ink-ondark) calc(var(--accent-dark) * 100%), var(--ink-onlight));
|
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),
|