@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/index.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export * from './type/Icon.js';
|
|
|
5
5
|
export { ICON_NAMES } from './type/icons.js';
|
|
6
6
|
export * from './type/Text.js';
|
|
7
7
|
export * from './type/Mark.js';
|
|
8
|
+
export * from './type/Strong.js';
|
|
9
|
+
export * from './type/Phrase.js';
|
|
8
10
|
export { setTextScale, controlsFor } from './type/textScale.js';
|
|
9
11
|
export { setWords, word, type WordKey } from './words.js';
|
|
10
12
|
export * from './scaffold/Screen.js';
|
|
@@ -26,6 +28,7 @@ export * from './cards/inkGrounds.js';
|
|
|
26
28
|
export * from './cards/CardParts.js';
|
|
27
29
|
export * from './cards/CardFeed.js';
|
|
28
30
|
export * from './cards/FeedEnd.js';
|
|
31
|
+
export * from './cards/FeedPost.js';
|
|
29
32
|
export * from './cards/Placeholder.js';
|
|
30
33
|
export * from './sheets/SheetStack.js';
|
|
31
34
|
export * from './sheets/StackBack.js';
|
|
@@ -106,6 +109,7 @@ export * from './media/MapArea.js';
|
|
|
106
109
|
export * from './media/MapPick.js';
|
|
107
110
|
export * from './media/Tile.js';
|
|
108
111
|
export * from './media/Mosaic.js';
|
|
112
|
+
export * from './media/Thumb.js';
|
|
109
113
|
export * from './layover/Banner.js';
|
|
110
114
|
export * from './layover/Popup.js';
|
|
111
115
|
export * from './layover/Callout.js';
|
package/dist/index.js
CHANGED
|
@@ -9,6 +9,8 @@ export * from './type/Icon.js';
|
|
|
9
9
|
export { ICON_NAMES } from './type/icons.js';
|
|
10
10
|
export * from './type/Text.js';
|
|
11
11
|
export * from './type/Mark.js';
|
|
12
|
+
export * from './type/Strong.js';
|
|
13
|
+
export * from './type/Phrase.js';
|
|
12
14
|
export { setTextScale, controlsFor } from './type/textScale.js';
|
|
13
15
|
export { setWords, word } from './words.js';
|
|
14
16
|
export * from './scaffold/Screen.js';
|
|
@@ -30,6 +32,7 @@ export * from './cards/inkGrounds.js';
|
|
|
30
32
|
export * from './cards/CardParts.js';
|
|
31
33
|
export * from './cards/CardFeed.js';
|
|
32
34
|
export * from './cards/FeedEnd.js';
|
|
35
|
+
export * from './cards/FeedPost.js';
|
|
33
36
|
export * from './cards/Placeholder.js';
|
|
34
37
|
export * from './sheets/SheetStack.js';
|
|
35
38
|
export * from './sheets/StackBack.js';
|
|
@@ -108,6 +111,7 @@ export * from './media/MapArea.js';
|
|
|
108
111
|
export * from './media/MapPick.js';
|
|
109
112
|
export * from './media/Tile.js';
|
|
110
113
|
export * from './media/Mosaic.js';
|
|
114
|
+
export * from './media/Thumb.js';
|
|
111
115
|
export * from './layover/Banner.js';
|
|
112
116
|
export * from './layover/Popup.js';
|
|
113
117
|
export * from './layover/Callout.js';
|
package/dist/layover/Popup.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export interface PopupProps extends Omit<ComponentProps<'div'>, 'popover' | 'tit
|
|
|
8
8
|
meta?: ReactNode;
|
|
9
9
|
/** the ONE `Btn` at the head's right (read all). Give a small one (`size="sm"`); the head holds no second control */
|
|
10
10
|
action?: ReactNode;
|
|
11
|
-
/** the opening button sits at the screen's right: the popup's right edge is the button's and it grows leftwards (default:
|
|
11
|
+
/** the opening button sits at the screen's right: the popup's right edge is `--sp-2` in from the button's and it grows leftwards (default: its left edge is `--sp-2` in from the button's and it grows rightwards). Never wider than the room it has: `--sp-2` in from the card's edge on the button's side, `--sp-6` on the far side */
|
|
12
12
|
end?: boolean;
|
|
13
13
|
/** what the popup lists: `Rows joined`, flush to its left and right edges. They scroll under the head */
|
|
14
14
|
children?: ReactNode;
|
|
@@ -16,7 +16,7 @@ export interface PopupProps extends Omit<ComponentProps<'div'>, 'popover' | 'tit
|
|
|
16
16
|
/**
|
|
17
17
|
* Popup — a panel hung under the button that opens it: a head (a `title`, a `meta` line, one `action` Btn at the right) and a list of `Rows joined` flush to
|
|
18
18
|
* its edges. A NATIVE popover like a `Menu popover`: any button with `popoverTarget={its id}` opens it, a tap outside or Esc closes it, and it knows nothing of
|
|
19
|
-
* the button. It
|
|
19
|
+
* the button. It stands narrower than the cards under it (`--sp-2` in on the button's side, `--sp-6` on the far side) and `--popup-w` caps it; too tall for the room under the button, the list scrolls
|
|
20
20
|
* inside it and the head stays at the top. Where the browser cannot anchor it to the button (iOS before 26) it hangs under the top bar instead.
|
|
21
21
|
* For a list read and then left (notifications), not a value to pick (that is a `Menu`) and not a page or a sheet of its own.
|
|
22
22
|
*/
|
package/dist/layover/Popup.js
CHANGED
|
@@ -5,7 +5,7 @@ import { Words } from '../parts/Words.js';
|
|
|
5
5
|
/**
|
|
6
6
|
* Popup — a panel hung under the button that opens it: a head (a `title`, a `meta` line, one `action` Btn at the right) and a list of `Rows joined` flush to
|
|
7
7
|
* its edges. A NATIVE popover like a `Menu popover`: any button with `popoverTarget={its id}` opens it, a tap outside or Esc closes it, and it knows nothing of
|
|
8
|
-
* the button. It
|
|
8
|
+
* the button. It stands narrower than the cards under it (`--sp-2` in on the button's side, `--sp-6` on the far side) and `--popup-w` caps it; too tall for the room under the button, the list scrolls
|
|
9
9
|
* inside it and the head stays at the top. Where the browser cannot anchor it to the button (iOS before 26) it hangs under the top bar instead.
|
|
10
10
|
* For a list read and then left (notifications), not a value to pick (that is a `Menu`) and not a page or a sheet of its own.
|
|
11
11
|
*/
|
package/dist/lists/Bubble.d.ts
CHANGED
|
@@ -13,14 +13,32 @@ export interface ThreadProps extends ComponentProps<'div'> {
|
|
|
13
13
|
* at the bottom when its scroller or its words resize (the keyboard comes up, the MessageBar grows, a message is added). Scrolled up
|
|
14
14
|
* away from the end, a round `Btn` (arrow-down, 48px) stands at the bottom corner and slides back to the last words; at the end it is
|
|
15
15
|
* gone. The thread ends with room (`--thread-end-size`) so the last bubble and its `meta` clear the bar under it. `authors` says where a
|
|
16
|
-
* Bubble's `author` shows (default nowhere: the head already names the person).
|
|
16
|
+
* Bubble's `author` shows (default nowhere: the head already names the person). Standing ALONE as a child of a `CardList` (a feed, between two
|
|
17
|
+
* cards) it has the same room over it and under it instead (`--thread-room-size`, default `--sp-4`): a bubble is no card and must not crowd the cards
|
|
18
|
+
* beside it; there pass `jumpLabel={false}`, a feed has no last words to jump to.
|
|
17
19
|
*/
|
|
18
20
|
export declare function Thread({ authors, days, jumpLabel, className, children, ref, ...rest }: ThreadProps): import("react").JSX.Element;
|
|
19
21
|
export interface BubbleProps extends Omit<ComponentProps<'div'>, 'onClick'> {
|
|
20
22
|
/** whose: theirs on the left (default), mine on the right */
|
|
21
23
|
side?: 'left' | 'right';
|
|
22
|
-
/** the caption under the message — a time, a tick (an Icon) */
|
|
24
|
+
/** the caption under the message — a time, a tick (an Icon). With `metaAbove`, over it */
|
|
23
25
|
meta?: ReactNode;
|
|
26
|
+
/** the caption line stands OVER the message, not under it: who sent it is read before the words (a comment list from several people). The line is
|
|
27
|
+
* `lead` · `author` (bold) · `day` · `meta` (small, after a "·"), on one line; the bubble stands under it from the start edge, as wide as its words
|
|
28
|
+
* up to the bubble's own cap (`--bubble-max-w`), `--sp-2` below the line (`--bubble-meta-above-gap`). Mine (`side="right"`): the line at the right, over
|
|
29
|
+
* the bubble — usually just the time. Left off (default) the caption stays under the message, as before */
|
|
30
|
+
metaAbove?: boolean;
|
|
31
|
+
/** with `metaAbove`: the picture of who sent it, before `author` on the line, at its own size (an `AvatarStack` holding a `Stamp bare`, an `Avatar`). It shows
|
|
32
|
+
* where `author` does (the Thread's `authors`, or `showAuthor`), never alone */
|
|
33
|
+
lead?: ReactNode;
|
|
34
|
+
/** the line of the message this one answers, at the top inside the bubble over its words: one line cut with "…", a rule at its start like the `quote` of a
|
|
35
|
+
* `MessageBar`, small and fainter than the words (`--bubble-quote-ink`, `--bubble-quote-rule-ink`); on a theirs and a mine bubble alike. Part of the bubble, so
|
|
36
|
+
* `onClick`, `href` and `highlighted` take it with the words. Pass the words only ("Noi: Are you free?"), the rule is drawn */
|
|
37
|
+
quote?: ReactNode;
|
|
38
|
+
/** ONE round `Btn` of the app standing beside the message (delete mine, reply), centred on its height: after theirs, before mine (`side="right"`), `--bubble-action-gap`
|
|
39
|
+
* from it. The bubble's cap holds both. Not with `href` or `onClick` (a button inside a link is a nested control): the button is ignored and a warning says so —
|
|
40
|
+
* a pressed message with its button beside it stands in a `Row` instead (story `FeedReply`) */
|
|
41
|
+
action?: ReactNode;
|
|
24
42
|
/** who sent it ("Noi", "You"): shown at the start of the `meta` line where the Thread's `authors` says (default nowhere). Compared by
|
|
25
43
|
* value with the bubble before, so pass a string */
|
|
26
44
|
author?: ReactNode;
|
|
@@ -44,11 +62,12 @@ export interface BubbleProps extends Omit<ComponentProps<'div'>, 'onClick'> {
|
|
|
44
62
|
}
|
|
45
63
|
/**
|
|
46
64
|
* Bubble — a chat message: a rounded block, its corner nearest the sender squared (bottom-left for theirs, bottom-right
|
|
47
|
-
* for mine), no tail. `meta` sits under it on the sender's side, led by `author` where the Thread's `authors` allows
|
|
48
|
-
*
|
|
49
|
-
*
|
|
65
|
+
* for mine), no tail. `meta` sits under it on the sender's side, led by `author` where the Thread's `authors` allows; with `metaAbove` that
|
|
66
|
+
* line stands over the message (`lead` · `author` · `meta`), for a list of comments from several people, and `action` puts one round `Btn` beside the
|
|
67
|
+
* message; `quote` is the line of the message it answers, at the top inside the bubble. Stack them in a Thread. `href` makes it a link, `onClick` a pressed one (both dim under the finger); `highlighted` rings the message the
|
|
68
|
+
* member is looking at (the one a reply points at).
|
|
50
69
|
*/
|
|
51
|
-
export declare function Bubble({ side, meta, author, showAuthor, day, showDay, href, target, rel, onClick, highlighted, className, children, onKeyDown, ...rest }: BubbleProps): import("react").DetailedReactHTMLElement<{
|
|
70
|
+
export declare function Bubble({ side, meta, metaAbove, lead, action, quote, author, showAuthor, day, showDay, href, target, rel, onClick, highlighted, className, children, onKeyDown, ...rest }: BubbleProps): import("react").DetailedReactHTMLElement<{
|
|
52
71
|
className: string;
|
|
53
72
|
href: string;
|
|
54
73
|
target: string | undefined;
|
package/dist/lists/Bubble.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Children, cloneElement, createElement, isValidElement, useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { cx } from '../cx.js';
|
|
4
|
-
import { reducedMotion, setRefs, watchSize } from '../state.js';
|
|
4
|
+
import { reducedMotion, setRefs, warnOnce, watchSize } from '../state.js';
|
|
5
5
|
import { word } from '../words.js';
|
|
6
6
|
import { Btn } from '../actions/Btn.js';
|
|
7
7
|
/* the scroller a thread reads in: the nearest ancestor that scrolls (a Sheet's Body, a Page) */
|
|
@@ -17,7 +17,9 @@ const AT_END = 8; // px of slack: a scroll that stops a hair short of the end is
|
|
|
17
17
|
* at the bottom when its scroller or its words resize (the keyboard comes up, the MessageBar grows, a message is added). Scrolled up
|
|
18
18
|
* away from the end, a round `Btn` (arrow-down, 48px) stands at the bottom corner and slides back to the last words; at the end it is
|
|
19
19
|
* gone. The thread ends with room (`--thread-end-size`) so the last bubble and its `meta` clear the bar under it. `authors` says where a
|
|
20
|
-
* Bubble's `author` shows (default nowhere: the head already names the person).
|
|
20
|
+
* Bubble's `author` shows (default nowhere: the head already names the person). Standing ALONE as a child of a `CardList` (a feed, between two
|
|
21
|
+
* cards) it has the same room over it and under it instead (`--thread-room-size`, default `--sp-4`): a bubble is no card and must not crowd the cards
|
|
22
|
+
* beside it; there pass `jumpLabel={false}`, a feed has no last words to jump to.
|
|
21
23
|
*/
|
|
22
24
|
export function Thread({ authors = 'none', days = 'change', jumpLabel, className, children, ref, ...rest }) {
|
|
23
25
|
const own = useRef(null);
|
|
@@ -65,14 +67,21 @@ export function Thread({ authors = 'none', days = 'change', jumpLabel, className
|
|
|
65
67
|
}
|
|
66
68
|
/**
|
|
67
69
|
* Bubble — a chat message: a rounded block, its corner nearest the sender squared (bottom-left for theirs, bottom-right
|
|
68
|
-
* for mine), no tail. `meta` sits under it on the sender's side, led by `author` where the Thread's `authors` allows
|
|
69
|
-
*
|
|
70
|
-
*
|
|
70
|
+
* for mine), no tail. `meta` sits under it on the sender's side, led by `author` where the Thread's `authors` allows; with `metaAbove` that
|
|
71
|
+
* line stands over the message (`lead` · `author` · `meta`), for a list of comments from several people, and `action` puts one round `Btn` beside the
|
|
72
|
+
* message; `quote` is the line of the message it answers, at the top inside the bubble. Stack them in a Thread. `href` makes it a link, `onClick` a pressed one (both dim under the finger); `highlighted` rings the message the
|
|
73
|
+
* member is looking at (the one a reply points at).
|
|
71
74
|
*/
|
|
72
|
-
export function Bubble({ side = 'left', meta, author, showAuthor, day, showDay, href, target, rel, onClick, highlighted, className, children, onKeyDown, ...rest }) {
|
|
75
|
+
export function Bubble({ side = 'left', meta, metaAbove, lead, action, quote, author, showAuthor, day, showDay, href, target, rel, onClick, highlighted, className, children, onKeyDown, ...rest }) {
|
|
73
76
|
const press = href == null && onClick != null;
|
|
74
77
|
const named = showAuthor === true && author != null;
|
|
75
78
|
const dated = showDay !== false && day != null;
|
|
79
|
+
const above = metaAbove === true;
|
|
80
|
+
const beside = action != null && href == null && !press;
|
|
81
|
+
if (action != null && !beside)
|
|
82
|
+
warnOnce('bubble-action', 'cardds Bubble: `action` is a button beside the message and cannot stand inside a link or a pressed Bubble (a button in a button). Ignored: put a pressed message and its button side by side in a Row.');
|
|
83
|
+
const body = _jsxs("p", { className: "bubble__body", children: [quote != null && _jsx("span", { className: "bubble__quote", children: quote }), children] });
|
|
84
|
+
const line = (meta != null || named || dated) && (_jsxs("span", { className: "bubble__meta", children: [above && named && lead != null && _jsx("span", { className: "bubble__lead", children: lead }), named && _jsx("span", { className: "bubble__author", children: author }), dated && _jsx("span", { className: "bubble__day", children: day }), above && meta != null ? _jsx("span", { className: "bubble__time", children: meta }) : meta] }));
|
|
76
85
|
const keys = (e) => {
|
|
77
86
|
onKeyDown?.(e);
|
|
78
87
|
if (e.defaultPrevented || (e.key !== 'Enter' && e.key !== ' '))
|
|
@@ -83,6 +92,6 @@ export function Bubble({ side = 'left', meta, author, showAuthor, day, showDay,
|
|
|
83
92
|
return createElement(href != null ? 'a' : 'div', {
|
|
84
93
|
...rest,
|
|
85
94
|
...(href != null ? { href, target, rel, onClick } : press ? { role: 'button', tabIndex: 0, onClick, onKeyDown: keys } : { onKeyDown }),
|
|
86
|
-
className: cx('bubble', side === 'right' && 'bubble--right', (href != null || press) && 'bubble--press', highlighted && 'bubble--highlighted', className),
|
|
87
|
-
},
|
|
95
|
+
className: cx('bubble', side === 'right' && 'bubble--right', above && 'bubble--meta-above', (href != null || press) && 'bubble--press', highlighted && 'bubble--highlighted', className),
|
|
96
|
+
}, above && line, beside ? _jsxs("div", { className: "bubble__row", children: [body, _jsx("span", { className: "bubble__action", children: action })] }) : body, !above && line);
|
|
88
97
|
}
|
package/dist/lists/Row.d.ts
CHANGED
|
@@ -4,10 +4,18 @@ export interface RowProps extends Omit<ComponentProps<'div'>, 'title'> {
|
|
|
4
4
|
lg?: boolean;
|
|
5
5
|
/** a finished checklist item: muted words, a filled tick at the end, no longer a tap target (aria-disabled) — give it no control at the end */
|
|
6
6
|
done?: boolean;
|
|
7
|
+
/** with `done`: the words keep the card's ink, beside the tick — not muted. Off, a `done` row is as before (title muted) */
|
|
8
|
+
fullInk?: boolean;
|
|
9
|
+
/** a checklist item still TO DO and open to press: where a `done` row has its tick, an empty dashed circle, and the words (title and second line) in a faded ink (`--row-todo-ink`), so the list reads: faded and dashed = not done yet, press to go and do it. The row is a link or a button (`href`, `as="a"` + the app's `onClick`) and the whole row is the target; the circle is only drawn, the app's words name the row. Drop `todo` and give `done` once it is done. Ignored with `done` */
|
|
10
|
+
todo?: boolean;
|
|
7
11
|
/** not yet seen (a notification never tapped): the whole row takes a very light grey fill (`--row-unread-bg`, default the token `--unread-bg`), so it reads apart from the ground it stands on; a screen reader hears "unread" (`unreadLabel` says it another way). Drop it once the member has read it */
|
|
8
12
|
unread?: boolean;
|
|
9
13
|
/** the words a screen reader hears for an `unread` row; default cardds's own, in the page's language */
|
|
10
14
|
unreadLabel?: string;
|
|
15
|
+
/** the lead (an `AvatarStack` holding a `Stamp bare`, or a `Lead`) stands as tall as this many lines (1 to 3) of the words beside it: the stamp that tall at its 4:5 shape, a `Lead` a square as wide as that stamp, in the middle of the height. The line is the text level's (`leadText`), so it follows the text size */
|
|
16
|
+
leadLines?: 1 | 2 | 3;
|
|
17
|
+
/** with `leadLines`: the type level of the words in the row, whose line the lead is counted in — `body` (default) or `caption` */
|
|
18
|
+
leadText?: 'body' | 'caption';
|
|
11
19
|
/** div (default), a link, a label wrapping a Check/Toggle, li */
|
|
12
20
|
as?: 'div' | 'a' | 'label' | 'li';
|
|
13
21
|
/** with `as="label"`: the `id` of the control the row presses (its `Check`). Needed when a button stands BEFORE the check (a picked row's own move, "open the map"): a label presses the first control inside it, so without this a touch on the row's words would press that button */
|
|
@@ -32,11 +40,12 @@ export interface RowProps extends Omit<ComponentProps<'div'>, 'title'> {
|
|
|
32
40
|
* The lead is a `Lead` box, or a bare Avatar / AvatarStack; the words are a `Words`; the end is an `End` (a value and its caption)
|
|
33
41
|
* or a bare control (two side by side).
|
|
34
42
|
* Several go in Rows (hairlines between). A row that IS a card is `Card row`.
|
|
35
|
-
* `done` is the checklist's finished line: ticked, muted, not tappable any more. `unread` is its opposite for a notification: a very light grey fill over the whole row (it is never tapped yet).
|
|
43
|
+
* `done` is the checklist's finished line: ticked, muted (`fullInk` keeps the ink), not tappable any more. `todo` is its open line: an empty dashed circle where the tick would be, faded words, pressable (it takes the member where the thing is done). `unread` is its opposite for a notification: a very light grey fill over the whole row (it is never tapped yet).
|
|
44
|
+
* `leadLines` makes the lead as tall as that many lines of the row's words (a notification: a stamp as tall as its three lines of `Text`).
|
|
36
45
|
* `more` makes it expand: the row is the summary of a `<details class="row-expand">`, `more` comes out under it; `open` + `onOpenChange`, or `defaultOpen`.
|
|
37
46
|
* A chevron at the end turns when it is open — the app fetches whatever `more` lists; the row only shows it.
|
|
38
47
|
*/
|
|
39
|
-
export declare function Row({ lg, done, unread, unreadLabel, as, href, more, open, defaultOpen, onOpenChange, className, children, ...rest }: RowProps): import("react").JSX.Element;
|
|
48
|
+
export declare function Row({ lg, done, fullInk, todo, unread, unreadLabel, leadLines, leadText, as, href, more, open, defaultOpen, onOpenChange, className, children, ...rest }: RowProps): import("react").JSX.Element;
|
|
40
49
|
export interface RowsProps extends ComponentProps<'div'> {
|
|
41
50
|
/** the group's name, above its rows (Today · Tomorrow · Later): a long list is GROUPED, not spaced out — several Rows one after another.
|
|
42
51
|
* Words = the small label; an ELEMENT (`<Text level="title" as="h3">`) is used as the heading itself — the group is labelled by it. */
|
package/dist/lists/Row.js
CHANGED
|
@@ -11,15 +11,16 @@ import { word } from '../words.js';
|
|
|
11
11
|
* The lead is a `Lead` box, or a bare Avatar / AvatarStack; the words are a `Words`; the end is an `End` (a value and its caption)
|
|
12
12
|
* or a bare control (two side by side).
|
|
13
13
|
* Several go in Rows (hairlines between). A row that IS a card is `Card row`.
|
|
14
|
-
* `done` is the checklist's finished line: ticked, muted, not tappable any more. `unread` is its opposite for a notification: a very light grey fill over the whole row (it is never tapped yet).
|
|
14
|
+
* `done` is the checklist's finished line: ticked, muted (`fullInk` keeps the ink), not tappable any more. `todo` is its open line: an empty dashed circle where the tick would be, faded words, pressable (it takes the member where the thing is done). `unread` is its opposite for a notification: a very light grey fill over the whole row (it is never tapped yet).
|
|
15
|
+
* `leadLines` makes the lead as tall as that many lines of the row's words (a notification: a stamp as tall as its three lines of `Text`).
|
|
15
16
|
* `more` makes it expand: the row is the summary of a `<details class="row-expand">`, `more` comes out under it; `open` + `onOpenChange`, or `defaultOpen`.
|
|
16
17
|
* A chevron at the end turns when it is open — the app fetches whatever `more` lists; the row only shows it.
|
|
17
18
|
*/
|
|
18
|
-
export function Row({ lg, done, unread, unreadLabel, as, href, more, open, defaultOpen, onOpenChange, className, children, ...rest }) {
|
|
19
|
+
export function Row({ lg, done, fullInk, todo, unread, unreadLabel, leadLines, leadText = 'body', as, href, more, open, defaultOpen, onOpenChange, className, children, ...rest }) {
|
|
19
20
|
const disclosure = useDisclosure(open, defaultOpen, onOpenChange);
|
|
20
21
|
const kids = (useContext(RowEndRoomCtx) && withEndRoom(children, Words)) || children; // in a LinkBlock: the title's later lines run under the ends
|
|
21
22
|
const el = more !== undefined ? 'summary' : as ?? (href ? 'a' : 'div');
|
|
22
|
-
const row = createElement(el, { href, className: cx('row', lg && 'row--lg', done && 'row--done', unread && 'row--unread', className), 'aria-disabled': done || undefined, ...(more === undefined ? rest : {}) }, unread && _jsx("span", { className: "t-sr", children: unreadLabel ?? word('unread') }), kids, done && _jsx("span", { className: "row__done", children: _jsx(Icon, { name: "check", size: "sm" }) }));
|
|
23
|
+
const row = createElement(el, { href, className: cx('row', lg && 'row--lg', done && 'row--done', done && fullInk && 'row--full-ink', todo && !done && 'row--todo', unread && 'row--unread', leadLines && `row--lead-lines row--lead-${leadLines}`, leadLines && leadText === 'caption' && 'row--lead-caption', className), 'aria-disabled': done || undefined, ...(more === undefined ? rest : {}) }, unread && _jsx("span", { className: "t-sr", children: unreadLabel ?? word('unread') }), kids, done && _jsx("span", { className: "row__done", children: _jsx(Icon, { name: "check", size: "sm" }) }), todo && !done && _jsx("span", { className: "row__todo", "aria-hidden": "true" }));
|
|
23
24
|
if (more === undefined)
|
|
24
25
|
return row;
|
|
25
26
|
return (_jsxs("details", { className: "row-expand", ...rest, ...disclosure, children: [row, _jsx("div", { className: "row-expand__more", children: more })] }));
|
package/dist/media/Mosaic.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ComponentProps } from 'react';
|
|
2
2
|
export interface MosaicProps extends ComponentProps<'div'> {
|
|
3
3
|
/** the photos' one accessible name — the mosaic is a single `img` (default "Photos", by `<html lang>`) */
|
|
4
4
|
label?: string;
|
|
5
5
|
}
|
|
6
|
-
/** Mosaic —
|
|
7
|
-
|
|
6
|
+
/** Mosaic — 2 to 10 photos in a card (Placeholders or imgs). Two stand side by side, equally tall. Three: one big photo left, two small right. From four up it
|
|
7
|
+
* shows the first three the same way and the small lower one is darkened with `+n`, n the photos not shown (those children are not drawn). One accessible name for all (`label`). */
|
|
8
|
+
export declare function Mosaic({ label, className, children, ...rest }: MosaicProps): import("react").JSX.Element;
|
|
8
9
|
export interface WaveProps extends ComponentProps<'span'> {
|
|
9
10
|
/** the waveform's accessible name (default "Voice note", by `<html lang>`) */
|
|
10
11
|
label?: string;
|
package/dist/media/Mosaic.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Children } from 'react';
|
|
2
3
|
import { cx } from '../cx.js';
|
|
3
4
|
import { word } from '../words.js';
|
|
4
|
-
/** Mosaic —
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
/** Mosaic — 2 to 10 photos in a card (Placeholders or imgs). Two stand side by side, equally tall. Three: one big photo left, two small right. From four up it
|
|
6
|
+
* shows the first three the same way and the small lower one is darkened with `+n`, n the photos not shown (those children are not drawn). One accessible name for all (`label`). */
|
|
7
|
+
export function Mosaic({ label = word('photos'), className, children, ...rest }) {
|
|
8
|
+
const photos = Children.toArray(children);
|
|
9
|
+
const more = photos.length - 3;
|
|
10
|
+
return (_jsx("div", { className: cx('mosaic', photos.length === 2 && 'mosaic--2', className), role: "img", "aria-label": label, ...rest, children: more > 0 ? [photos[0], photos[1], _jsxs("div", { className: "mosaic__more-cell", children: [photos[2], _jsxs("span", { className: "mosaic__more", "aria-hidden": "true", children: ["+", more] })] }, "more")] : photos }));
|
|
7
11
|
}
|
|
8
12
|
/* a MOCK voice shape (Lh 2026-09-23): short and tall rounded bars, loud in bursts, quiet between — not a real recording */
|
|
9
13
|
const MOCK = [0.25, 0.45, 0.3, 0.6, 0.4, 0.2, 0.5, 0.85, 0.35, 0.7, 1, 0.55, 0.3, 0.75, 0.9, 0.45, 0.25, 0.6, 0.8, 0.4,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
export interface ThumbProps extends Omit<ComponentProps<'button'>, 'children'> {
|
|
3
|
+
/** the photo's address; without it the square holds a `Placeholder`'s crossed box (a photo not there yet) */
|
|
4
|
+
src?: string;
|
|
5
|
+
/** the button's accessible name — the app's words, the square shows only the photo ("Photo 3, tap to remove") */
|
|
6
|
+
label: string;
|
|
7
|
+
}
|
|
8
|
+
/** Thumb — one small square photo that can be pressed: the photo fills the square (`object-fit: cover`), no words over or under it, corner `--r-control`.
|
|
9
|
+
* The whole square is the button (`onClick` the app's: open it, ask before removing it) and `label` its spoken name. Stand them in a `ThumbGrid`. */
|
|
10
|
+
export declare function Thumb({ src, label, className, type, ...rest }: ThumbProps): import("react").JSX.Element;
|
|
11
|
+
export type ThumbGridProps = ComponentProps<'div'>;
|
|
12
|
+
/** ThumbGrid — the squares of `Thumb`s, five to a row (`--thumb-grid-cols`), as wide as the box they stand in, each as big as its share of that width,
|
|
13
|
+
* the rows a gap apart (`--thumb-grid-gap`). Ten photos are two full rows. */
|
|
14
|
+
export declare function ThumbGrid({ className, ...rest }: ThumbGridProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cx } from '../cx.js';
|
|
3
|
+
/** Thumb — one small square photo that can be pressed: the photo fills the square (`object-fit: cover`), no words over or under it, corner `--r-control`.
|
|
4
|
+
* The whole square is the button (`onClick` the app's: open it, ask before removing it) and `label` its spoken name. Stand them in a `ThumbGrid`. */
|
|
5
|
+
export function Thumb({ src, label, className, type = 'button', ...rest }) {
|
|
6
|
+
return (_jsx("button", { type: type, className: cx('thumb', className), ...rest, "aria-label": label, children: src ? _jsx("img", { src: src, alt: "" }) : _jsx("span", { className: "ph", "aria-hidden": "true" }) }));
|
|
7
|
+
}
|
|
8
|
+
/** ThumbGrid — the squares of `Thumb`s, five to a row (`--thumb-grid-cols`), as wide as the box they stand in, each as big as its share of that width,
|
|
9
|
+
* the rows a gap apart (`--thumb-grid-gap`). Ten photos are two full rows. */
|
|
10
|
+
export function ThumbGrid({ className, ...rest }) {
|
|
11
|
+
return _jsx("div", { className: cx('thumb-grid', className), ...rest });
|
|
12
|
+
}
|
package/dist/parts/Foot.d.ts
CHANGED
|
@@ -23,6 +23,10 @@ export interface FootProps extends ComponentProps<'div'> {
|
|
|
23
23
|
wrap?: boolean;
|
|
24
24
|
/** the buttons stand at the END of the foot (the right, in a left-to-right script) — with `wrap` */
|
|
25
25
|
end?: boolean;
|
|
26
|
+
/** in a `Sheet`: the foot's strip (the room the body stops above) has a GROUND OF ITS OWN — edge to edge, a rule over it, the sheet's colour a little darker — so the foot
|
|
27
|
+
* reads as a layer apart from the words scrolling behind it; what stands on it (a `MessageBar`'s box) keeps its paper. Off (default) the strip is the sheet's colour, as
|
|
28
|
+
* before. Nothing on a `Card` (its `paper="bands"` is the card's own). Knobs `--foot-layer-bg`, `--foot-layer-rule-ink` */
|
|
29
|
+
layer?: boolean;
|
|
26
30
|
}
|
|
27
31
|
/** Foot — the last row of a card, a sheet or a stack sheet: what the member can do next, its buttons on one line. One takes the width, up to
|
|
28
32
|
* four share it evenly. Btns only in the row; a small link goes in `link`, under it. A `Btn form` keeps its own size here: as wide as its words,
|
|
@@ -30,6 +34,7 @@ export interface FootProps extends ComponentProps<'div'> {
|
|
|
30
34
|
* `primary` with a word, the others with icons): one centred group, a fixed gap between them. With `split` it is two small `Link`s (or `Btn`s) that are the
|
|
31
35
|
* card's foot, each half its width, edge to edge on its bottom edge, a rule between (the member's own item: Edit · Cancel). With `wrap` each Btn is as
|
|
32
36
|
* wide as its words and they wrap (`wrap end`: at the foot's end). In a `Sheet` it stands on the box's bottom edge
|
|
33
|
-
* at every state; a chat in a sheet puts its `MessageBar` there instead of Btns (`<Foot><MessageBar…/></Foot>`), the bar alone on the line
|
|
37
|
+
* at every state; a chat in a sheet puts its `MessageBar` there instead of Btns (`<Foot><MessageBar…/></Foot>`), the bar alone on the line; `layer` gives that
|
|
38
|
+
* strip a ground of its own (`<Foot layer><MessageBar…/></Foot>`). A `Card` finds its `Foot` by type (a turning card draws it on both faces), so a consumer's own component that wraps a `Foot`
|
|
34
39
|
* is not found. */
|
|
35
|
-
export declare function Foot({ link, round, joined, split, wrap, end, className, children, ...rest }: FootProps): import("react").JSX.Element;
|
|
40
|
+
export declare function Foot({ link, round, joined, split, wrap, end, layer, className, children, ...rest }: FootProps): import("react").JSX.Element;
|
package/dist/parts/Foot.js
CHANGED
|
@@ -7,8 +7,9 @@ import { joinDots } from '../actions/joined.js';
|
|
|
7
7
|
* `primary` with a word, the others with icons): one centred group, a fixed gap between them. With `split` it is two small `Link`s (or `Btn`s) that are the
|
|
8
8
|
* card's foot, each half its width, edge to edge on its bottom edge, a rule between (the member's own item: Edit · Cancel). With `wrap` each Btn is as
|
|
9
9
|
* wide as its words and they wrap (`wrap end`: at the foot's end). In a `Sheet` it stands on the box's bottom edge
|
|
10
|
-
* at every state; a chat in a sheet puts its `MessageBar` there instead of Btns (`<Foot><MessageBar…/></Foot>`), the bar alone on the line
|
|
10
|
+
* at every state; a chat in a sheet puts its `MessageBar` there instead of Btns (`<Foot><MessageBar…/></Foot>`), the bar alone on the line; `layer` gives that
|
|
11
|
+
* strip a ground of its own (`<Foot layer><MessageBar…/></Foot>`). A `Card` finds its `Foot` by type (a turning card draws it on both faces), so a consumer's own component that wraps a `Foot`
|
|
11
12
|
* is not found. */
|
|
12
|
-
export function Foot({ link, round, joined, split, wrap, end, className, children, ...rest }) {
|
|
13
|
-
return (_jsxs("div", { className: cx('foot', link != null && 'foot--link', round && 'foot--round', joined && 'foot--joined', split && 'foot--split', wrap && 'foot--wrap', end && 'foot--end', className), ...rest, children: [joined ? joinDots(children) : children, link != null && _jsx("div", { className: "foot__link", children: link })] }));
|
|
13
|
+
export function Foot({ link, round, joined, split, wrap, end, layer, className, children, ...rest }) {
|
|
14
|
+
return (_jsxs("div", { className: cx('foot', link != null && 'foot--link', round && 'foot--round', joined && 'foot--joined', split && 'foot--split', wrap && 'foot--wrap', end && 'foot--end', layer && 'foot--layer', className), ...rest, children: [joined ? joinDots(children) : children, link != null && _jsx("div", { className: "foot__link", children: link })] }));
|
|
14
15
|
}
|
|
@@ -6,7 +6,7 @@ export interface CentreProps extends ComponentProps<'div'> {
|
|
|
6
6
|
* card: an EmptyState; a Card with its quiet second Btn and the Pager under it.
|
|
7
7
|
* On a plain `Screen` (the usual case, Lh 2026-09-12) it is in flow: the column is one phone tall, the group takes
|
|
8
8
|
* the room after the TopBar and centres a short card; a long card makes the page longer and scrolls up under the
|
|
9
|
-
* bar — nothing is capped, nothing shrinks. On a `Screen fill` it floats at 40% down (`--screen-centre`), capped
|
|
9
|
+
* bar — nothing is capped, nothing shrinks. On a `Screen fill` it floats with its own 40% point at 40% down (`--screen-centre`), capped
|
|
10
10
|
* and scrolling inside, for a screen that must never scroll. Its children stack at the screen's rhythm.
|
|
11
11
|
* Put it after the TopBar; the ActionBar, if any, is the Screen's `bottom`.
|
|
12
12
|
*/
|
package/dist/scaffold/Centre.js
CHANGED
|
@@ -6,7 +6,7 @@ import { cx } from '../cx.js';
|
|
|
6
6
|
* card: an EmptyState; a Card with its quiet second Btn and the Pager under it.
|
|
7
7
|
* On a plain `Screen` (the usual case, Lh 2026-09-12) it is in flow: the column is one phone tall, the group takes
|
|
8
8
|
* the room after the TopBar and centres a short card; a long card makes the page longer and scrolls up under the
|
|
9
|
-
* bar — nothing is capped, nothing shrinks. On a `Screen fill` it floats at 40% down (`--screen-centre`), capped
|
|
9
|
+
* bar — nothing is capped, nothing shrinks. On a `Screen fill` it floats with its own 40% point at 40% down (`--screen-centre`), capped
|
|
10
10
|
* and scrolling inside, for a screen that must never scroll. Its children stack at the screen's rhythm.
|
|
11
11
|
* Put it after the TopBar; the ActionBar, if any, is the Screen's `bottom`.
|
|
12
12
|
*/
|
package/dist/scaffold/Panes.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export interface PanesProps extends Omit<ComponentProps<'div'>, 'onChange'> {
|
|
|
15
15
|
* Panes — a few panes side by side INSIDE a card or a sheet, one in sight: the member swipes left / right to the next, the dots
|
|
16
16
|
* under them say where (Lh 2026-10-02). Children are `Pane`s. It holds a number, controlled like an input: `at` + `onAtChange`, or
|
|
17
17
|
* `defaultAt` — so a `BtnGroup` over it (the app's wiring) names the panes and moves to one by a tap; the swipe is never the only way.
|
|
18
|
+
* A SLIDE SHOW of photos on a full screen is the same thing: in a `Page`, one `Pane` per photo (a `CardMedia full`), up to 10 — the dots stand on one line at 375px.
|
|
18
19
|
* Not a walk: pages of words on the base are `Pages`. The panes out of sight are `inert`.
|
|
19
20
|
*/
|
|
20
21
|
export declare function Panes({ at, defaultAt, onAtChange, dots, label, className, children, ...rest }: PanesProps): import("react").JSX.Element;
|
package/dist/scaffold/Panes.js
CHANGED
|
@@ -7,6 +7,7 @@ import { Pager } from './Pager.js';
|
|
|
7
7
|
* Panes — a few panes side by side INSIDE a card or a sheet, one in sight: the member swipes left / right to the next, the dots
|
|
8
8
|
* under them say where (Lh 2026-10-02). Children are `Pane`s. It holds a number, controlled like an input: `at` + `onAtChange`, or
|
|
9
9
|
* `defaultAt` — so a `BtnGroup` over it (the app's wiring) names the panes and moves to one by a tap; the swipe is never the only way.
|
|
10
|
+
* A SLIDE SHOW of photos on a full screen is the same thing: in a `Page`, one `Pane` per photo (a `CardMedia full`), up to 10 — the dots stand on one line at 375px.
|
|
10
11
|
* Not a walk: pages of words on the base are `Pages`. The panes out of sight are `inert`.
|
|
11
12
|
*/
|
|
12
13
|
export function Panes({ at, defaultAt = 0, onAtChange, dots = true, label, className, children, ...rest }) {
|
package/dist/sheets/Modal.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export interface ModalProps extends ComponentProps<'article'> {
|
|
|
10
10
|
onDismiss?: (reason: 'scrim' | 'escape') => void;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* Modal — the ask: ONE card at the centre of a `SheetStage dim
|
|
13
|
+
* Modal — the ask: ONE card at the centre of a `SheetStage dim` (its own 40% point on the stage's 40% line, as a `Card centre`), two parts — a `Body` (the thing being asked about, light, scrolls
|
|
14
14
|
* when tall) and a `ModalAsk` (the dark end that asks). No border. Two beats on appearing: drops in from above, then the ModalAsk comes
|
|
15
15
|
* out below while the Body moves up.
|
|
16
16
|
* A COMPONENT, not a wiring: it does not know its buttons. They are plain round `Btn`s / `Btn`s with the app's `onClick` — the app
|
package/dist/sheets/Modal.js
CHANGED
|
@@ -4,7 +4,7 @@ import { focusWhenActive, useLatest } from '../state.js';
|
|
|
4
4
|
import { cx } from '../cx.js';
|
|
5
5
|
import { HeadCloseCtx } from '../parts/headCtx.js';
|
|
6
6
|
/**
|
|
7
|
-
* Modal — the ask: ONE card at the centre of a `SheetStage dim
|
|
7
|
+
* Modal — the ask: ONE card at the centre of a `SheetStage dim` (its own 40% point on the stage's 40% line, as a `Card centre`), two parts — a `Body` (the thing being asked about, light, scrolls
|
|
8
8
|
* when tall) and a `ModalAsk` (the dark end that asks). No border. Two beats on appearing: drops in from above, then the ModalAsk comes
|
|
9
9
|
* out below while the Body moves up.
|
|
10
10
|
* A COMPONENT, not a wiring: it does not know its buttons. They are plain round `Btn`s / `Btn`s with the app's `onClick` — the app
|
|
@@ -13,7 +13,7 @@ export interface SplashProps extends Omit<ComponentProps<typeof Screen>, 'childr
|
|
|
13
13
|
onLeft?: () => void;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
* Splash — the screen an app shows while it boots: the app's mark (and a line) at the human centre
|
|
16
|
+
* Splash — the screen an app shows while it boots: the app's mark (and a line) at the human centre: the group's own 40% point on `--screen-centre` (40% down),
|
|
17
17
|
* nothing else. A TEMPLATE: cardds does the place, the line, the timing and the fade; the mark is the app's (a Lottie it loads and
|
|
18
18
|
* plays, or a still) — cardds has no animation library. The app says when it is ready (`done`); `min` keeps a fast boot from
|
|
19
19
|
* flashing it. Each lottie is its own size: knobs `--splash-mark-w` (the box's width), `--splash-mark-x` / `--splash-mark-y` (nudge the
|
package/dist/templates/Splash.js
CHANGED
|
@@ -4,7 +4,7 @@ import { reducedMotion, sheetMs, useLatest } from '../state.js';
|
|
|
4
4
|
import { Screen } from '../scaffold/Screen.js';
|
|
5
5
|
import { cx } from '../cx.js';
|
|
6
6
|
/**
|
|
7
|
-
* Splash — the screen an app shows while it boots: the app's mark (and a line) at the human centre
|
|
7
|
+
* Splash — the screen an app shows while it boots: the app's mark (and a line) at the human centre: the group's own 40% point on `--screen-centre` (40% down),
|
|
8
8
|
* nothing else. A TEMPLATE: cardds does the place, the line, the timing and the fade; the mark is the app's (a Lottie it loads and
|
|
9
9
|
* plays, or a still) — cardds has no animation library. The app says when it is ready (`done`); `min` keeps a fast boot from
|
|
10
10
|
* flashing it. Each lottie is its own size: knobs `--splash-mark-w` (the box's width), `--splash-mark-x` / `--splash-mark-y` (nudge the
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
export type PhraseProps = ComponentProps<'span'>;
|
|
3
|
+
/**
|
|
4
|
+
* Phrase — a few words that stay on ONE line: the line breaks before the phrase or after it, never inside it. Thai has no spaces between words, so a line
|
|
5
|
+
* is cut wherever it runs out (a chip in a sentence, then the word after it split in two); wrap the words that belong together: `<Text level="body">…
|
|
6
|
+
* <Chip sm>Hello</Chip> <Phrase>ของเพื่อนบ้านทุกคน</Phrase></Text>`. Inline, in any `Text` level, a `ModalAsk` caption or beside a `Chip`. A phrase longer than
|
|
7
|
+
* the room it has breaks inside itself, never out of the box.
|
|
8
|
+
*/
|
|
9
|
+
export declare function Phrase({ className, ...rest }: PhraseProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cx } from '../cx.js';
|
|
3
|
+
/**
|
|
4
|
+
* Phrase — a few words that stay on ONE line: the line breaks before the phrase or after it, never inside it. Thai has no spaces between words, so a line
|
|
5
|
+
* is cut wherever it runs out (a chip in a sentence, then the word after it split in two); wrap the words that belong together: `<Text level="body">…
|
|
6
|
+
* <Chip sm>Hello</Chip> <Phrase>ของเพื่อนบ้านทุกคน</Phrase></Text>`. Inline, in any `Text` level, a `ModalAsk` caption or beside a `Chip`. A phrase longer than
|
|
7
|
+
* the room it has breaks inside itself, never out of the box.
|
|
8
|
+
*/
|
|
9
|
+
export function Phrase({ className, ...rest }) {
|
|
10
|
+
return _jsx("span", { className: cx('phrase', className), ...rest });
|
|
11
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
export type StrongProps = ComponentProps<'strong'>;
|
|
3
|
+
/**
|
|
4
|
+
* Strong — some words made heavy INSIDE running text (the sender's name at the start of a notification). The size, the ink and the line stay the text's;
|
|
5
|
+
* only the weight changes, to `--strong-weight` (default `--fw-bold`: clearly heavier than every level's own, caption included). Information, not a control.
|
|
6
|
+
*/
|
|
7
|
+
export declare function Strong({ className, ...rest }: StrongProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cx } from '../cx.js';
|
|
3
|
+
/**
|
|
4
|
+
* Strong — some words made heavy INSIDE running text (the sender's name at the start of a notification). The size, the ink and the line stay the text's;
|
|
5
|
+
* only the weight changes, to `--strong-weight` (default `--fw-bold`: clearly heavier than every level's own, caption included). Information, not a control.
|
|
6
|
+
*/
|
|
7
|
+
export function Strong({ className, ...rest }) {
|
|
8
|
+
return _jsx("strong", { className: cx('strong', className), ...rest });
|
|
9
|
+
}
|
package/dist/type/Text.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
1
2
|
export type TextLevel = 'display' | 'h1' | 'h2' | 'title' | 'body' | 'label' | 'caption' | 'stat';
|
|
2
3
|
export interface TextProps extends React.HTMLAttributes<HTMLElement> {
|
|
3
4
|
/** the element it renders (React 19 passes `ref` as a prop) */
|
|
@@ -27,6 +28,8 @@ export interface TextProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
27
28
|
/** CUT at this many lines (1 to 6), no chevron, no tap: the words stop at the last line's end — a note's, a message's, a post's words
|
|
28
29
|
* in a feed, where the whole text is a tap away elsewhere. Any level; not with `expand` (that one opens in place) */
|
|
29
30
|
lines?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
31
|
+
/** one short word (a time) at the top end of the words, in the muted ink at the text's own size: the first line runs round it, the lines after it are the full width; with `lines` the cut counts only the visible lines. Not with `expand` */
|
|
32
|
+
corner?: ReactNode;
|
|
30
33
|
/** CONTROLLED (`expand`): the whole text shows — pair it with `onOpenChange`. The app owns it */
|
|
31
34
|
open?: boolean;
|
|
32
35
|
/** UNCONTROLLED (`expand`): it starts open (default false) */
|
|
@@ -42,5 +45,6 @@ export interface TextProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
42
45
|
* Everything scales from the root font-size, so there are no pixel sizes to pick.
|
|
43
46
|
* `expand` (body): a long text is cut under a chevron and opens in place on a tap; a text that fits is only read.
|
|
44
47
|
* `lines`: the words are cut at that many lines, nothing to open.
|
|
48
|
+
* `corner`: one short word (the time) at the top end of the words, the first line running round it.
|
|
45
49
|
*/
|
|
46
|
-
export declare function Text({ level, xl, mono, muted, caps, grow, sr, selectable, expand, lines, open, defaultOpen, onOpenChange, as, className, ...rest }: TextProps): import("react").JSX.Element;
|
|
50
|
+
export declare function Text({ level, xl, mono, muted, caps, grow, sr, selectable, expand, lines, corner, open, defaultOpen, onOpenChange, as, className, ...rest }: TextProps): import("react").JSX.Element;
|
package/dist/type/Text.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { createElement, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
3
3
|
import { cx } from '../cx.js';
|
|
4
4
|
import { useControlled, useLatest } from '../state.js';
|
|
@@ -12,12 +12,16 @@ const DEFAULT_AS = {
|
|
|
12
12
|
* Everything scales from the root font-size, so there are no pixel sizes to pick.
|
|
13
13
|
* `expand` (body): a long text is cut under a chevron and opens in place on a tap; a text that fits is only read.
|
|
14
14
|
* `lines`: the words are cut at that many lines, nothing to open.
|
|
15
|
+
* `corner`: one short word (the time) at the top end of the words, the first line running round it.
|
|
15
16
|
*/
|
|
16
|
-
export function Text({ level, xl, mono, muted, caps, grow, sr, selectable, expand, lines, open, defaultOpen = false, onOpenChange, as, className, ...rest }) {
|
|
17
|
+
export function Text({ level, xl, mono, muted, caps, grow, sr, selectable, expand, lines, corner, open, defaultOpen = false, onOpenChange, as, className, ...rest }) {
|
|
17
18
|
const words = cx(`t-${level}`, level === 'stat' && xl && 't-stat--xl', level === 'stat' && mono && 't-stat--mono', muted && 't-muted', caps && 't-caps', grow && 'grow', sr && 't-sr', selectable && 't-select', lines && !expand && `t-lines t-lines--${lines}`);
|
|
18
19
|
if (expand && level === 'body')
|
|
19
20
|
return _jsx(Expand, { ...rest, words: words, as: as ?? 'p', open: open, defaultOpen: defaultOpen, onOpenChange: onOpenChange, className: className });
|
|
20
|
-
|
|
21
|
+
const { children, ...props } = rest;
|
|
22
|
+
/* the corner word is the first thing in a block of its own, so the float stays inside the cut (a `-webkit-box` makes its direct children flex items, and a float on one is ignored) */
|
|
23
|
+
const flow = corner != null ? _jsxs("span", { className: "t-corner-flow", children: [_jsx("span", { className: "t-corner", children: corner }), children] }) : children;
|
|
24
|
+
return createElement(as ?? DEFAULT_AS[level] ?? 'span', { className: cx(words, className), ...props }, flow);
|
|
21
25
|
}
|
|
22
26
|
/* the cut text: the box is measured while it is closed (every render, and when its width changes); only a text that does not fit is a control */
|
|
23
27
|
function Expand({ words, as, open, defaultOpen = false, onOpenChange, className, children, onClick, onKeyDown, ...rest }) {
|
package/dist/type/icons.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type IconName = "arrow-down" | "arrow-left" | "arrow-right" | "arrow-up" | "arrow-up-right" | "bell" | "briefcase" | "calendar-days" | "car" | "check" | "chevron-down" | "chevron-left" | "chevron-right" | "chevron-up" | "circle-alert" | "circle-help" | "clock" | "droplet" | "ellipsis" | "file-text" | "gift" | "handshake" | "heart" | "hourglass" | "house" | "id-card" | "image" | "keyboard" | "layout-grid" | "lightbulb" | "loader-circle" | "log-out" | "luggage" | "man" | "map" | "map-pin" | "megaphone" | "menu" | "message-circle" | "mic" | "music" | "package" | "pause" | "pencil" | "percent" | "phone-call" | "plane" | "play" | "plus" | "reply" | "search" | "share" | "shopping-bag" | "siren" | "sliders" | "stamp" | "star" | "store" | "sun" | "thermometer" | "ticket" | "trash" | "truck" | "upload" | "user" | "users" | "wallet" | "woman" | "x";
|
|
1
|
+
export type IconName = "arrow-down" | "arrow-left" | "arrow-right" | "arrow-up" | "arrow-up-right" | "bell" | "briefcase" | "calendar-days" | "car" | "check" | "chevron-down" | "chevron-left" | "chevron-right" | "chevron-up" | "circle-alert" | "circle-help" | "clock" | "droplet" | "ellipsis" | "file-text" | "flag" | "gift" | "handshake" | "heart" | "hourglass" | "house" | "id-card" | "image" | "keyboard" | "layout-grid" | "lightbulb" | "loader-circle" | "log-out" | "luggage" | "man" | "map" | "map-pin" | "megaphone" | "menu" | "message-circle" | "mic" | "music" | "package" | "pause" | "pencil" | "percent" | "phone-call" | "plane" | "play" | "plus" | "reply" | "search" | "share" | "shopping-bag" | "siren" | "sliders" | "stamp" | "star" | "store" | "sun" | "thermometer" | "ticket" | "trash" | "truck" | "upload" | "user" | "users" | "wallet" | "woman" | "x";
|
|
2
2
|
export declare const ICON_NAMES: readonly IconName[];
|
|
3
3
|
export declare const ICONS: Record<IconName, {
|
|
4
4
|
attrs: Record<string, string>;
|