@usableapp/cardds 0.7.140 → 0.7.142
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 +21 -0
- package/css/parts.css +2 -2
- package/css/stamp.css +21 -5
- package/dist/cardds.css +23 -7
- package/dist/catalog.json +1 -1
- package/dist/parts/Words.d.ts +5 -2
- package/dist/parts/Words.js +6 -5
- package/dist/scaffold/AppBar.d.ts +1 -1
- package/docs/reference.md +7 -3
- package/package.json +1 -1
package/dist/parts/Words.d.ts
CHANGED
|
@@ -4,10 +4,13 @@ export interface WordsProps extends Omit<ComponentProps<'span'>, 'title'> {
|
|
|
4
4
|
title?: ReactNode;
|
|
5
5
|
/** the caption under it (may hold a Dot); on an option row, only the difference that decides, one line, on every option of the list or on none */
|
|
6
6
|
meta?: ReactNode;
|
|
7
|
+
/** the caption OVER the title (who asks, over the ask): it and the title stand together as one block, so beside a `Stamp` both lines take the
|
|
8
|
+
* words' column and the title wraps there as it does without it */
|
|
9
|
+
over?: ReactNode;
|
|
7
10
|
/** the title as a heading element in that type level; without it the title is a span in title type. In a `Head` the title is always a heading: `h2` unless this says otherwise (`h1` for the one-feature page) */
|
|
8
11
|
level?: 'h1' | 'h2' | 'display';
|
|
9
12
|
}
|
|
10
|
-
/** Words — the words of a line, filling the room between the lead and the end: a `title` over a `meta` caption;
|
|
13
|
+
/** Words — the words of a line, filling the room between the lead and the end: a `title` over a `meta` caption, maybe under an `over` caption;
|
|
11
14
|
* its children come under them, or instead of them (a Wave for a voice note). In a `Head` there is no box round them: the title and the meta
|
|
12
15
|
* stand in the head, and a `className`, an `id` or any other attribute goes on the title. */
|
|
13
|
-
export declare function Words({ title, meta, level, className, children, ...rest }: WordsProps): import("react").JSX.Element;
|
|
16
|
+
export declare function Words({ title, meta, over, level, className, children, ...rest }: WordsProps): import("react").JSX.Element;
|
package/dist/parts/Words.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useContext } from 'react';
|
|
3
3
|
import { cx } from '../cx.js';
|
|
4
4
|
import { HeadCtx, onTitleKey } from './headCtx.js';
|
|
5
|
-
/** Words — the words of a line, filling the room between the lead and the end: a `title` over a `meta` caption;
|
|
5
|
+
/** Words — the words of a line, filling the room between the lead and the end: a `title` over a `meta` caption, maybe under an `over` caption;
|
|
6
6
|
* its children come under them, or instead of them (a Wave for a voice note). In a `Head` there is no box round them: the title and the meta
|
|
7
7
|
* stand in the head, and a `className`, an `id` or any other attribute goes on the title. */
|
|
8
|
-
export function Words({ title, meta, level, className, children, ...rest }) {
|
|
8
|
+
export function Words({ title, meta, over, level, className, children, ...rest }) {
|
|
9
9
|
const head = useContext(HeadCtx);
|
|
10
10
|
if (head) {
|
|
11
11
|
const as = level ?? 'h2';
|
|
@@ -13,8 +13,9 @@ export function Words({ title, meta, level, className, children, ...rest }) {
|
|
|
13
13
|
const { onKeyDown, ...own } = rest;
|
|
14
14
|
const attrs = head.tab != null ? { tabIndex: head.tab, onKeyDown: (e) => { onKeyDown?.(e); if (!e.defaultPrevented)
|
|
15
15
|
onTitleKey(e); } } : { onKeyDown };
|
|
16
|
-
|
|
16
|
+
const titled = title != null && _jsx(Title, { className: cx('words__title', `t-${as}`, head.long && 'is-long', className), ...own, ...attrs, children: title });
|
|
17
|
+
return (_jsxs(_Fragment, { children: [over != null ? _jsxs("div", { className: "words__over-title", children: [_jsx("span", { className: "words__over t-caption", children: over }), titled] }) : titled, meta != null && _jsx("span", { className: "words__meta t-caption t-muted", children: meta }), children] }));
|
|
17
18
|
}
|
|
18
19
|
const Title = level === 'h1' ? 'h1' : level ? 'h2' : 'span';
|
|
19
|
-
return (_jsxs("span", { className: cx('words', className), ...rest, children: [title != null && _jsx(Title, { className: cx('words__title', level && `t-${level}`), children: title }), meta != null && _jsx("span", { className: "words__meta", children: meta }), children] }));
|
|
20
|
+
return (_jsxs("span", { className: cx('words', className), ...rest, children: [over != null && _jsx("span", { className: "words__over t-caption", children: over }), title != null && _jsx(Title, { className: cx('words__title', level && `t-${level}`), children: title }), meta != null && _jsx("span", { className: "words__meta", children: meta }), children] }));
|
|
20
21
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ComponentProps, ReactNode } from 'react';
|
|
2
2
|
export interface AppBarProps extends Omit<ComponentProps<'header'>, 'title'> {
|
|
3
|
-
/** the app or brand mark on the left (an Icon) */
|
|
3
|
+
/** the app or brand mark on the left (an Icon, an Avatar, or a `Stamp`: a stamp here is the bar's inner height tall, `--appbar-stamp-size`) */
|
|
4
4
|
icon?: ReactNode;
|
|
5
5
|
/** the context: which app, which place, which account */
|
|
6
6
|
title: ReactNode;
|
package/docs/reference.md
CHANGED
|
@@ -847,6 +847,8 @@ it up. cardds draws the paper; the pictures, their words and which stamp a membe
|
|
|
847
847
|
stamp in an `AvatarStack` are `--stamp-sm-size` wide (one tap: 48 × 60), on any surface and in any row. And the inline
|
|
848
848
|
one: `Stamp xs` stands beside a status line's words (a card's `Foot`: the stamp, "X took it", a round button), one
|
|
849
849
|
`Chip xs` tall, `--stamp-xs-size` (18.7 × 23.4, on `--fs-base`); always bare, flat but for the contact shadow, its teeth fewer and larger.
|
|
850
|
+
A `Stamp` as an `AppBar`'s `icon` is the bar's inner height tall (`--header-h` less the bar's block padding: 35 × 44), so it reads
|
|
851
|
+
bigger than the title and its second line and the fixed bar never grows; bare and flat whatever it is handed. Knob `--appbar-stamp-size`.
|
|
850
852
|
Several lap in an `AvatarStack` with `more` ("+8"), the count then at the chip's scale. In a card's head band the stamp keeps the head's padding below it as well as above (`--card-pad`, not the seam), so the head is never shorter
|
|
851
853
|
than the stamp plus its padding, plain or `under`. A stamp the app is not ready to show yet is `held`: it keeps its box, draws nothing,
|
|
852
854
|
is hidden from screen readers, and appears in the same box when `held` turns false, so nothing beside it moves (any size). The stamps in
|
|
@@ -854,7 +856,8 @@ it up. cardds draws the paper; the pictures, their words and which stamp a membe
|
|
|
854
856
|
the postcard's own size, 72 × 90 (`--post-corner-stamp-w`), in neither. `words` is not drawn on a stamp 96 wide or
|
|
855
857
|
narrower, so at the standard size only `name` shows, and it is larger.
|
|
856
858
|
- **Every stamp has a thin contact shadow** (2026-10-26): at every size, `xs` and a `StampOn` too, on a card or off it — paper a hair off
|
|
857
|
-
its ground, so its edge shows on any ground, a white one included (
|
|
859
|
+
its ground, so its edge shows on any ground, a white one included (knob `--stamp-shadow`, a hair lighter than `--shadow-contact`). By default it is
|
|
860
|
+
the only shadow a stamp has (Lh 2026-10-26: contact only); `--stamp-drop` adds a lift off a card, none by default. What follows is where a stamp gets more.
|
|
858
861
|
- **A stamp on a card lies flat** (Lh 2026-10-24): no lift, only the contact shadow, at every size — a `FeedCard`'s lead, a
|
|
859
862
|
`Foot` row's, `xs`. A stamp in a card's head is glued down (Lh 2026-10-25): plain, `under` or `sm`, a hair of shadow
|
|
860
863
|
under paper (`--shadow-glued`, knob `--stamp-under-drop`); `bare` and `xs` stay flat (contact shadow only). One rule by where it stands (`stamp.css`), nothing to pass. A stamp off a card keeps its shadow: the
|
|
@@ -875,7 +878,8 @@ it up. cardds draws the paper; the pictures, their words and which stamp a membe
|
|
|
875
878
|
middle and the words and link under it centre. In a card's head — `<Card foot={<Btn primary block>…</Btn>}><Head><Words title={name} meta={greeting} /><Stamp bare …/></Head></Card>` — the words stand at the left and the stamp at the right,
|
|
876
879
|
beside both lines (`Stamp under`: the words keep no room for it, they run the head's whole width over the stamp, which lies under them in
|
|
877
880
|
its place and size — for a long title); in a head that leads with a date (a `JourneyBadge`, then a `ChipRow`) it stands on a row of its own under the
|
|
878
|
-
date and the chips, in the order given.
|
|
881
|
+
date and the chips, in the order given. Who asks over the ask is `Words over`: `<Head><Words level="h1" over="Somsri asks for help" title={ask} /><Stamp …/></Head>`
|
|
882
|
+
— the caption over the title, the two one block beside the stamp, the title wrapping there. The card's one button presses it whole. In an `AvatarStack` it is a head, the small size
|
|
879
883
|
(`more="+9"` for the count).
|
|
880
884
|
- **`StampOn`** — a stamp stuck on a surface. `at` is the stamp's middle as a share of the surface (`{ x, y }`, 0 to 1),
|
|
881
885
|
`turn` its angle in degrees. With `onAtChange` the member drags it (the arrow keys move it too) and it asks with the
|
|
@@ -1315,7 +1319,7 @@ reads every value from a token in `css/tokens.css` (or a palette, a finish, a pr
|
|
|
1315
1319
|
- **type**: the eight kinds (display, h1, h2, title, body, label, caption, stat) each have `--face-<kind>`, `--fw-<kind>`,
|
|
1316
1320
|
`--fs-<kind>`, `--lh-<kind>` and `--track-<kind>`, and `--type-<kind>` is made of them. A piece set on a size outside the
|
|
1317
1321
|
kinds composes its `font:` from the scales: `--fs-*`, weight `--fw-regular` … `--fw-black`, leading `--lh-mark` … `--lh-ruled`.
|
|
1318
|
-
Gallery `Text · Kinds` shows them resolved. An h1's caption, over it or under it, keeps to the heading's leading
|
|
1322
|
+
Gallery `Text · Kinds` shows them resolved. An h1's caption, over it (`Words over`) or under it (`Words meta`), keeps to the heading's leading
|
|
1319
1323
|
(`--lh-h1-caption`); a caption over an h1 that wraps starts where a one-line one does, its next line goes down and the
|
|
1320
1324
|
h1 with it (gallery `Text · HeadingWraps`).
|
|
1321
1325
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usableapp/cardds",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.142",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "card-first mobile design system, React-first: the components in src/ are thin wrappers over the CSS contract (css/*.css stays the only truth); gallery/ shows every story live (npm run dev).",
|