@usableapp/cardds 0.7.178 → 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 +31 -0
- 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 +16 -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 +199 -39
- 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/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 +84 -6
- package/icons.svg +1 -0
- package/lint/rules.mjs +2 -2
- package/package.json +1 -1
package/dist/cards/CardParts.js
CHANGED
|
@@ -2,9 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useLayoutEffect, useRef } from 'react';
|
|
3
3
|
import { cx } from '../cx.js';
|
|
4
4
|
/** CardMedia — rounded media inside a card (a Placeholder or img); a corner JourneyBadge pins to it: the badge on the corner of a picture is the paper,
|
|
5
|
-
* its corner concentric with the media's; a theme's `--tile-badge-bg` / `--tile-badge-radius` still win. Ruled (Lh 2026-10-21). */
|
|
6
|
-
export function CardMedia({ className, ...rest }) {
|
|
7
|
-
return _jsx("div", { className: cx('card__media', className), ...rest });
|
|
5
|
+
* its corner concentric with the media's; a theme's `--tile-badge-bg` / `--tile-badge-radius` still win. Ruled (Lh 2026-10-21). `full`: the same media outside a card, edge to edge, the picture's own ratio up to 4:5. */
|
|
6
|
+
export function CardMedia({ full, className, ...rest }) {
|
|
7
|
+
return _jsx("div", { className: cx('card__media', full && 'card__media--full', className), ...rest });
|
|
8
8
|
}
|
|
9
9
|
/** MediaBeside — words with a small square picture at their END (a post's photo beside its words): the words take the room, the picture its own small square,
|
|
10
10
|
* both from the top. In a card's content; a full-width picture is `CardMedia`. Knobs `--media-beside-size`, `--media-beside-gap`. */
|
|
@@ -12,10 +12,11 @@ export function MediaBeside({ media, className, children, ...rest }) {
|
|
|
12
12
|
return (_jsxs("div", { className: cx('media-beside', className), ...rest, children: [_jsx("div", { className: "media-beside__words", children: children }), _jsx("div", { className: "media-beside__pic", children: media })] }));
|
|
13
13
|
}
|
|
14
14
|
/** CardList — a stack of `Card row`s, each its own boundary: a list of things to open or to pick (past requests to reuse). It stands on the base or straight in a sheet's
|
|
15
|
-
* body and scrolls with it; never inside a card (a card never wraps a card — `cardds check` rule `card-in-card`). Rows inside a card are `Rows`.
|
|
15
|
+
* body and scrolls with it; never inside a card (a card never wraps a card — `cardds check` rule `card-in-card`). Rows inside a card are `Rows`. A `Thread` may stand in it between two cards (a feed): it takes its own room over and under it (`--thread-room-size`).
|
|
16
16
|
* A SHORT WINDOW of past entries under a form (`show={2.5}`): the list scrolls in itself, a few rows in sight; each row a `Card row as="label"` round a radio
|
|
17
|
-
* (pick one) with `onRemove` for its corner cross (take it off the list) — the app owns the list, the picked one and what a removal does.
|
|
18
|
-
|
|
17
|
+
* (pick one) with `onRemove` for its corner cross (take it off the list) — the app owns the list, the picked one and what a removal does.
|
|
18
|
+
* A FEED of posts and cards (`thin`): every card in it thinner, so a screen holds more of them. */
|
|
19
|
+
export function CardList({ show, thin, className, style, ref, ...rest }) {
|
|
19
20
|
const own = useRef(null);
|
|
20
21
|
useLayoutEffect(() => {
|
|
21
22
|
const list = own.current;
|
|
@@ -51,7 +52,7 @@ export function CardList({ show, className, style, ref, ...rest }) {
|
|
|
51
52
|
else if (passed)
|
|
52
53
|
passed.current = node;
|
|
53
54
|
};
|
|
54
|
-
return _jsx("div", { ref: setRef, className: cx('card-list', show != null && 'card-list--window', className), style: style, ...rest });
|
|
55
|
+
return _jsx("div", { ref: setRef, className: cx('card-list', show != null && 'card-list--window', thin && 'card-list--thin', className), style: style, ...rest });
|
|
55
56
|
}
|
|
56
57
|
/** IconRow — a trailing cluster of Icons in a card or stack head. */
|
|
57
58
|
export function IconRow({ className, ...rest }) {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
export interface FeedPostProps extends Omit<ComponentProps<'article'>, 'title'> {
|
|
3
|
+
/** who wrote it, at the head's start: an `Avatar`, or a `Stamp bare` in an `AvatarStack` — the lead of a `Head variant="lead"`, at its size */
|
|
4
|
+
lead: ReactNode;
|
|
5
|
+
/** who wrote it, in words: bold, the head's first line */
|
|
6
|
+
author: ReactNode;
|
|
7
|
+
/** when, after the author on the same line, small and muted (` · 40 min`): the app's own words for it */
|
|
8
|
+
time?: ReactNode;
|
|
9
|
+
/** the line under the author, small and muted — how it came to the member (who passed it on, who mentioned them). Leave it out when it came straight */
|
|
10
|
+
via?: ReactNode;
|
|
11
|
+
/** the round button at the head's top right — a `Btn shape="round" size="sm"` (a flag to report it); the member's own post has none. Drawn as the `Head`'s `end` */
|
|
12
|
+
end?: ReactNode;
|
|
13
|
+
/** a picture (an `img`, a `Placeholder`) FULL WIDTH under the words, the media's corner (`--r-media`), at its own shape up to the tallest the
|
|
14
|
+
* post allows (knob `--feed-post-media-ratio`, width / height, default `4 / 3`: a taller picture is cut in its middle). Leave it out for words alone */
|
|
15
|
+
media?: ReactNode;
|
|
16
|
+
/** the row of moves under it all: a `BtnGroup` frame of round `Btn`s, an icon and a number each (♡ 5 · 💬 6 · ↪) — see `BtnGroup` */
|
|
17
|
+
actions?: ReactNode;
|
|
18
|
+
/** the post is pressed WHOLE (opens it): a touch anywhere off its buttons and links calls this; theirs stay their own — `Card onPress` */
|
|
19
|
+
onPress?: () => void;
|
|
20
|
+
/** the spoken name of the unseen press button — REQUIRED with `onPress` ("Open Somsri's post") */
|
|
21
|
+
pressLabel?: string;
|
|
22
|
+
/** the words — a `Text` (`expand` or `lines` to cut a long one), or a voice row. Leave it out for a picture alone */
|
|
23
|
+
children?: ReactNode;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* FeedPost — ONE post in a feed, a card of its own: the head (who · when on one line, how it came under them, a flag at the top right), the
|
|
27
|
+
* words, a picture full width, and the row of moves. The lines of the head stand `--sp-1` apart, the post's parts `--sp-5` (knob
|
|
28
|
+
* `--feed-post-gap`). Pressed whole with `onPress` (its buttons keep their own press). In a `CardList thin` with the feed's other cards.
|
|
29
|
+
* `<FeedPost lead={<Avatar>SS</Avatar>} author="Somsri" time="40 min" end={flag} actions={moves} onPress={open} pressLabel="Open the post"><Text level="body" expand>…</Text></FeedPost>`
|
|
30
|
+
*/
|
|
31
|
+
export declare function FeedPost({ lead, author, time, via, end, media, actions, onPress, pressLabel, className, children, ...rest }: FeedPostProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsxs as _jsxs, Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cx } from '../cx.js';
|
|
3
|
+
import { Card } from './Card.js';
|
|
4
|
+
import { Head } from '../parts/Head.js';
|
|
5
|
+
/**
|
|
6
|
+
* FeedPost — ONE post in a feed, a card of its own: the head (who · when on one line, how it came under them, a flag at the top right), the
|
|
7
|
+
* words, a picture full width, and the row of moves. The lines of the head stand `--sp-1` apart, the post's parts `--sp-5` (knob
|
|
8
|
+
* `--feed-post-gap`). Pressed whole with `onPress` (its buttons keep their own press). In a `CardList thin` with the feed's other cards.
|
|
9
|
+
* `<FeedPost lead={<Avatar>SS</Avatar>} author="Somsri" time="40 min" end={flag} actions={moves} onPress={open} pressLabel="Open the post"><Text level="body" expand>…</Text></FeedPost>`
|
|
10
|
+
*/
|
|
11
|
+
export function FeedPost({ lead, author, time, via, end, media, actions, onPress, pressLabel, className, children, ...rest }) {
|
|
12
|
+
const title = _jsxs(_Fragment, { children: [author, time != null && _jsxs("span", { className: "feed-post__time", children: [" \u00B7 ", time] })] });
|
|
13
|
+
return (_jsxs(Card, { className: cx('feed-post', className), onPress: onPress, pressLabel: pressLabel, ...rest, children: [_jsx(Head, { variant: "lead", lead: lead, title: title, meta: via, end: end }), children, media != null && _jsx("div", { className: "feed-post__media", children: media }), actions] }));
|
|
14
|
+
}
|