@usableapp/cardds 0.7.110 → 0.7.112
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 +22 -0
- package/css/actions.css +4 -1
- package/css/base.css +1 -1
- package/css/journey.css +6 -2
- package/css/parts.css +7 -1
- package/dist/actions/BtnRow.d.ts +5 -2
- package/dist/actions/BtnRow.js +3 -3
- package/dist/cardds.css +18 -5
- package/dist/catalog.json +1 -1
- package/dist/journey/JourneyBadge.d.ts +1 -1
- package/dist/journey/JourneyBadge.js +3 -2
- package/dist/type/Text.d.ts +2 -1
- package/docs/reference.md +2 -1
- package/lib/catalog.mjs +4 -4
- package/package.json +1 -1
|
@@ -16,4 +16,4 @@ export interface JourneyBadgeProps extends ComponentProps<'span'> {
|
|
|
16
16
|
stretch?: boolean;
|
|
17
17
|
}
|
|
18
18
|
/** JourneyBadge — a tiny label over a big value: gate, seat, date, rating. `stretch`: a date in a head that takes its form from the title's height, no taller than its own three lines. */
|
|
19
|
-
export declare function JourneyBadge({ label, value, sub, plain, corner, stretch, className, ...rest }: JourneyBadgeProps): import("react").JSX.Element;
|
|
19
|
+
export declare function JourneyBadge({ label, value, sub, plain, corner, stretch, className, style, ...rest }: JourneyBadgeProps): import("react").JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cx } from '../cx.js';
|
|
3
3
|
/** JourneyBadge — a tiny label over a big value: gate, seat, date, rating. `stretch`: a date in a head that takes its form from the title's height, no taller than its own three lines. */
|
|
4
|
-
export function JourneyBadge({ label, value, sub, plain, corner, stretch, className, ...rest }) {
|
|
5
|
-
|
|
4
|
+
export function JourneyBadge({ label, value, sub, plain, corner, stretch, className, style, ...rest }) {
|
|
5
|
+
const chars = typeof value === 'string' ? value.length + (typeof sub === 'string' ? sub.length / 2 : 0) : 0; // shortcut: words that are not plain strings fall back to the knob
|
|
6
|
+
return (_jsxs("span", { className: cx('tile-badge', plain && 'tile-badge--plain', corner && 'tile-badge--corner', stretch && 'tile-badge--stretch', className), style: stretch && chars ? { '--_badge-chars': chars, ...style } : style, ...rest, children: [_jsx("span", { className: "tile-badge__label", children: label }), _jsx("span", { className: "tile-badge__value", children: value }), sub != null && _jsx("span", { className: "tile-badge__label", children: sub })] }));
|
|
6
7
|
}
|
package/dist/type/Text.d.ts
CHANGED
|
@@ -19,7 +19,8 @@ export interface TextProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
19
19
|
/** the member may select and copy these words (a code, an address, a reference number) — everything else in a Screen is not
|
|
20
20
|
* selectable, like a native app (Lh 2026-09-25) */
|
|
21
21
|
selectable?: boolean;
|
|
22
|
-
/** body only: the words show `--text-scroll-lines` lines (knob, default 3) in a plain box with no border, and the rest scrolls inside the box — a long reason in a card. A scroll never turns a turning card
|
|
22
|
+
/** body only: the words show `--text-scroll-lines` lines (knob, default 3) in a plain box with no border, and the rest scrolls inside the box — a long reason in a card. A scroll never turns a turning card.
|
|
23
|
+
* `--text-scroll-size` (knob, a length) makes the box ALWAYS that tall: a short text keeps the room, a long one scrolls in it (the lines knob is then unused) */
|
|
23
24
|
scroll?: boolean;
|
|
24
25
|
/** the element; defaults per level (h2 for display/h1/h2, p for title/body/stat, span for the rest) */
|
|
25
26
|
as?: 'h1' | 'h2' | 'h3' | 'p' | 'span' | 'strong' | 'div';
|
package/docs/reference.md
CHANGED
|
@@ -746,7 +746,8 @@ it up. cardds draws the paper; the pictures, their words and which stamp a membe
|
|
|
746
746
|
at 375 a stamp is 103.67 × 129.58. A `false` or `null` child holds no place.
|
|
747
747
|
- A stamp stands for a person in three more places. In a `Centre` — a `Stamp` or a `StampPlace` — it stands in the
|
|
748
748
|
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,
|
|
749
|
-
beside both lines;
|
|
749
|
+
beside both lines; in a head that leads with a date (a `JourneyBadge`, then a `ChipRow`) it stands on a row of its own under the
|
|
750
|
+
date and the chips, in the order given. The card's one button presses it whole. In an `AvatarStack` it is a head, the small size
|
|
750
751
|
(`more="+9"` for the count).
|
|
751
752
|
- **`StampOn`** — a stamp stuck on a surface. `at` is the stamp's middle as a share of the surface (`{ x, y }`, 0 to 1),
|
|
752
753
|
`turn` its angle in degrees. With `onAtChange` the member drags it (the arrow keys move it too) and it asks with the
|
package/lib/catalog.mjs
CHANGED
|
@@ -150,7 +150,7 @@ export function find(cat, query, axes = {}) {
|
|
|
150
150
|
// every three words of the request in a row, function words kept: a note that says "a or b" or "at a glance" as asked is the piece the request describes
|
|
151
151
|
const all = words(String(query));
|
|
152
152
|
const phrases = all.slice(2).map((w, i) => ` ${all[i]} ${all[i + 1]} ${w} `);
|
|
153
|
-
const rank = (items, fields, level, said = () => 0, saysIt = () => '') => { // a field is [text, weight, match = hits]; saysIt is the text whose phrases count
|
|
153
|
+
const rank = (items, fields, level, said = () => 0, saysIt = () => '', variant = () => 0) => { // a field is [text, weight, match = hits]; saysIt is the text whose phrases count
|
|
154
154
|
const scored = items.map((item) => {
|
|
155
155
|
let matched = 0, score = 0;
|
|
156
156
|
for (const t of toks) {
|
|
@@ -159,9 +159,9 @@ export function find(cat, query, axes = {}) {
|
|
|
159
159
|
}
|
|
160
160
|
const own = ` ${words(saysIt(item)).join(' ')} `;
|
|
161
161
|
score += 3 * phrases.filter((p) => own.includes(p)).length;
|
|
162
|
-
return { item, matched, score, level: active ? level(item) : 0, said: active ? said(item) : 0 };
|
|
162
|
+
return { item, matched, score, level: active ? level(item) : 0, said: active ? said(item) : 0, variant: variant(item) };
|
|
163
163
|
});
|
|
164
|
-
const byWords = (a, b) => b.matched - a.matched || b.score - a.score;
|
|
164
|
+
const byWords = (a, b) => b.matched - a.matched || b.score - a.score || a.variant - b.variant; // equal words: the picture that is another's again with one thing changed goes last
|
|
165
165
|
const byAxes = (a, b) => b.said - a.said || b.level - a.level; // among equal words: the screen that says the axes itself, then one component over several
|
|
166
166
|
return { axis: scored.filter((r) => r.level).sort((a, b) => byWords(a, b) || byAxes(a, b)), rest: scored.filter((r) => r.matched && !r.level).sort(byWords) };
|
|
167
167
|
};
|
|
@@ -174,7 +174,7 @@ export function find(cat, query, axes = {}) {
|
|
|
174
174
|
return !matchesUnion(parts, asked.want) ? 0 : parts.some((r) => matches(r, asked.want)) ? 2 : 1; // `none` is about the whole screen: one show-only part is not enough
|
|
175
175
|
};
|
|
176
176
|
const said = (s) => axisWords.filter((v) => hits(s.description, v)).length;
|
|
177
|
-
const [screenAxis, screenRest] = tier(rank(screens, (s) => [[s.id, 5], [s.description, 3], [s.uses.join(' '), 1]], level, said), TOP);
|
|
177
|
+
const [screenAxis, screenRest] = tier(rank(screens, (s) => [[s.id, 5], [s.description, 3], [s.uses.join(' '), 1]], level, said, undefined, (s) => Number(screens.some((o) => o !== s && s.id.startsWith(o.id)))), TOP);
|
|
178
178
|
// a component is found by its name (the name that IS the word counts as much again as one that contains it: "card" is Card before FeedCard, whatever
|
|
179
179
|
// their other words say), its description, its role's note (what it is FOR, in the words of a request: "a setting turned on or off"), the values of its role
|
|
180
180
|
// a word says ("choose" → pick, "number"), what it stands in for, then its prop names
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usableapp/cardds",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.112",
|
|
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), tests/ measures the geometry.",
|