@usableapp/cardds 0.7.161 → 0.7.163
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 +41 -0
- package/css/actions.css +30 -45
- package/css/base.css +8 -5
- package/css/card.css +5 -5
- package/css/journey.css +5 -7
- package/css/layover.css +0 -1
- package/css/lists.css +2 -2
- package/css/media.css +5 -0
- package/css/numbers.css +1 -1
- package/css/palette.css +1 -1
- package/css/parts.css +73 -55
- package/css/sheet.css +1 -1
- package/css/stack.css +13 -5
- package/css/stamp.css +30 -30
- package/css/tokens.css +37 -4
- package/dist/actions/Btn.d.ts +69 -30
- package/dist/actions/Btn.js +22 -6
- package/dist/actions/BtnGroup.d.ts +3 -3
- package/dist/actions/BtnGroup.js +2 -2
- package/dist/actions/BtnRow.d.ts +2 -2
- package/dist/actions/BtnRow.js +1 -1
- package/dist/actions/Chip.d.ts +1 -1
- package/dist/actions/Fab.d.ts +11 -7
- package/dist/actions/Fab.js +6 -5
- package/dist/actions/LinkBlock.d.ts +2 -1
- package/dist/actions/LinkBlock.js +2 -1
- package/dist/cardds.css +211 -162
- package/dist/cards/CardParts.d.ts +1 -1
- package/dist/cards/CardParts.js +1 -1
- package/dist/catalog.json +1 -1
- package/dist/choice/Calendar.js +2 -2
- package/dist/forms/Composer.d.ts +2 -2
- package/dist/forms/Field.d.ts +1 -1
- package/dist/forms/Field.js +1 -1
- package/dist/forms/FileBtn.d.ts +8 -7
- package/dist/forms/FileBtn.js +3 -3
- package/dist/forms/MessageBar.d.ts +2 -2
- package/dist/forms/MessageBar.js +4 -4
- package/dist/forms/Pin.js +2 -3
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/journey/JourneyBadge.d.ts +7 -4
- package/dist/journey/JourneyBadge.js +3 -3
- package/dist/lists/Bubble.d.ts +6 -6
- package/dist/media/Postcard.d.ts +1 -1
- package/dist/media/Postcard.js +2 -2
- package/dist/media/Tile.d.ts +4 -6
- package/dist/media/Tile.js +2 -2
- package/dist/parts/End.d.ts +1 -1
- package/dist/parts/End.js +1 -1
- package/dist/parts/Foot.d.ts +3 -3
- package/dist/parts/Foot.js +1 -1
- package/dist/parts/Head.d.ts +3 -2
- package/dist/parts/Head.js +3 -2
- package/dist/parts/Words.d.ts +3 -2
- package/dist/parts/Words.js +11 -6
- package/dist/parts/endRoom.d.ts +6 -4
- package/dist/parts/endRoom.js +13 -8
- package/dist/post/PostDesk.js +2 -3
- package/dist/post/PostLetter.js +2 -2
- package/dist/scaffold/ActionBar.d.ts +4 -4
- package/dist/scaffold/ActionBar.js +3 -3
- package/dist/scaffold/AppBar.d.ts +1 -1
- package/dist/scaffold/FloatBar.d.ts +1 -1
- package/dist/scaffold/TopBar.d.ts +2 -2
- package/dist/sheets/Modal.d.ts +2 -2
- package/dist/sheets/Modal.js +2 -2
- package/dist/sheets/Sheet.d.ts +1 -1
- package/dist/sheets/Sheet.js +1 -1
- package/dist/sheets/SheetStack.js +3 -4
- package/dist/sheets/StackBack.d.ts +1 -1
- package/dist/sheets/StackBack.js +2 -3
- package/dist/sheets/StackSheet.d.ts +1 -1
- package/dist/sheets/StackSheet.js +2 -3
- package/dist/sheets/sheetDrag.js +2 -2
- package/dist/sheets/stackCard.js +5 -6
- package/dist/stamp/Stamp.d.ts +4 -2
- package/dist/stamp/Stamp.js +2 -2
- package/dist/state.d.ts +2 -0
- package/dist/state.js +9 -0
- package/dist/sticky/Sticky.d.ts +1 -1
- package/dist/sticky/StickyAnswer.d.ts +1 -1
- package/dist/sticky/StickyHeading.d.ts +2 -2
- package/dist/templates/CallSheet.js +1 -1
- package/dist/templates/Walkthrough.js +2 -2
- package/dist/type/Icon.d.ts +1 -1
- package/dist/type/Icon.js +1 -1
- package/dist/type/textScale.d.ts +4 -3
- package/dist/type/textScale.js +4 -3
- package/docs/reference.md +49 -25
- package/lint/rules.mjs +7 -7
- package/package.json +3 -1
- package/scripts/codemod-parts.mjs +1 -1
- package/dist/actions/IconBtn.d.ts +0 -326
- package/dist/actions/IconBtn.js +0 -19
package/dist/actions/Btn.d.ts
CHANGED
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
import { type ComponentProps } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
xl?: boolean;
|
|
17
|
-
/** SMALL: one small tap tall (`--form-tap-sm`, 44 — the touch floor; knob `--btn-sm-size`), the small words (`--fs-sm`, knob `--btn-sm-font-size`),
|
|
18
|
-
* closer sides (knob `--btn-sm-pad-x`) — a worded move at a card head's end, beside the title, where an `IconBtn sm` would stand */
|
|
19
|
-
sm?: boolean;
|
|
1
|
+
import { type ComponentProps, type ReactNode } from 'react';
|
|
2
|
+
import { type IconName } from '../type/Icon.js';
|
|
3
|
+
/** the ONE size ladder of every button, a pill and a round of one step the same height so either stands in for the other in a row:
|
|
4
|
+
* `sm` one small tap (`--tap-sm`, 44 — the touch floor) · `md` one tap (`--btn-h` = `--tap`, 48) · `lg` the hero control (`--tap-lg`, 56) ·
|
|
5
|
+
* `xl` the biggest, NOT swap-equal (Lh 2026-10-29: at xl the two shapes are too different to be one step): a pill `--btn-xl-h`, 88, the one
|
|
6
|
+
* giant call to action; a round `--tap-xl`, 68, a foot of a few big round answers */
|
|
7
|
+
export type BtnSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
8
|
+
/** what the button says about its move: `default` plain · `primary` the filled one forward move (the palette's primary, `--btn-primary-bg`) ·
|
|
9
|
+
* `quiet` ink on whatever it sits on, a faint outline · `warn` the warning ink (`--signal-warn`, knob `--btn-warn-ink`), a move to think twice about */
|
|
10
|
+
export type BtnTone = 'default' | 'primary' | 'quiet' | 'warn';
|
|
11
|
+
interface BtnBase extends Omit<ComponentProps<'button'>, 'form' | 'children'> {
|
|
12
|
+
/** the step on the one size ladder, both shapes alike (default `md`) */
|
|
13
|
+
size?: BtnSize;
|
|
14
|
+
/** what it says about its move (default `default`) */
|
|
15
|
+
tone?: BtnTone;
|
|
20
16
|
/** a link styled as a button */
|
|
21
17
|
href?: string;
|
|
22
18
|
/** SENDING: something goes OUT from the button — its icon swells and tips forward, two rings spread from it (`--motion-send`, 0.7 s; knob
|
|
@@ -25,20 +21,62 @@ export interface BtnProps extends Omit<ComponentProps<'button'>, 'form'> {
|
|
|
25
21
|
sending?: boolean;
|
|
26
22
|
/** the send-out has ended (once per `sending`; at once where motion is off): the app does what follows */
|
|
27
23
|
onSent?: () => void;
|
|
24
|
+
/** BUSY: the press is being carried out — a turning ring stands where the icon would be (a pill: before its words), and the button cannot
|
|
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
|
+
* done. A round keeps its `label` as its spoken name and needs no `icon` while busy. Under reduced motion the ring stands still */
|
|
27
|
+
busy?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface PillBtnProps extends BtnBase {
|
|
30
|
+
/** `pill` (default): the worded button, as wide as its words */
|
|
31
|
+
shape?: 'pill';
|
|
32
|
+
/** the words; an Icon xs may lead or trail them */
|
|
33
|
+
children?: ReactNode;
|
|
34
|
+
/** full width */
|
|
35
|
+
block?: boolean;
|
|
36
|
+
/** a form's button: sized to its words with wide side padding, centred on its own row — it reads as part of the form above it,
|
|
37
|
+
* not a page CTA (Lh 2026-09-25). In a card's foot (`Foot`, `FeedCard foot`) it keeps that size instead of
|
|
38
|
+
* filling the row. Replaces the native `form` attribute (a button outside its <form> — not a cardds pattern). */
|
|
39
|
+
form?: boolean;
|
|
40
|
+
icon?: never;
|
|
41
|
+
label?: never;
|
|
42
|
+
}
|
|
43
|
+
interface RoundBase extends BtnBase {
|
|
44
|
+
/** `round`: the round button, as wide as it is tall */
|
|
45
|
+
shape: 'round';
|
|
46
|
+
/** the accessible name — required, the button shows no words of its own */
|
|
47
|
+
label: string;
|
|
48
|
+
block?: never;
|
|
49
|
+
form?: never;
|
|
28
50
|
}
|
|
51
|
+
/** a round button shows its `icon` (sized to the button; anything else it holds — a Badge, a word in a `BtnGroup` frame — follows the icon),
|
|
52
|
+
* or, with no icon, a short WORD (`lg` / `xl`: it grows with the member's text size up to the circle's share) */
|
|
53
|
+
export type RoundBtnProps = RoundBase & ({
|
|
54
|
+
icon: IconName;
|
|
55
|
+
children?: ReactNode;
|
|
56
|
+
} | {
|
|
57
|
+
icon?: never;
|
|
58
|
+
children: string;
|
|
59
|
+
} | {
|
|
60
|
+
busy: true;
|
|
61
|
+
icon?: IconName;
|
|
62
|
+
children?: ReactNode;
|
|
63
|
+
});
|
|
64
|
+
export type BtnProps = PillBtnProps | RoundBtnProps;
|
|
29
65
|
/**
|
|
30
|
-
* Btn —
|
|
31
|
-
*
|
|
66
|
+
* Btn — THE button (Lh 2026-10-29: one component, so any button swaps for another). `shape`: a `pill` of words (default) or a `round` of an
|
|
67
|
+
* icon; `size` one ladder for both (`sm` 44 · `md` 48 · `lg` 56, a pill and a round one height; `xl` each shape its own, not swap-equal); `tone` `primary` for the one move, `quiet` on tinted cards, `warn`.
|
|
68
|
+
* In a Foot up to four share the line; in an ActionBar it takes the width. A round `sm` stands in heads and bars, `xl` in a foot of a few
|
|
69
|
+
* big round answers (`<Foot round>`). It is a button and nothing more: to open a Menu, give it the platform's `popoverTarget={the Menu's id}`
|
|
70
|
+
* and render that `<Menu popover actions id>` wherever you like — the panel anchors to the button that opened it. To open anything else, `onClick`.
|
|
32
71
|
*/
|
|
33
|
-
export declare function Btn(
|
|
34
|
-
translate?: "yes" | "no" | undefined | undefined;
|
|
35
|
-
onChange?: import("react").ChangeEventHandler<HTMLButtonElement, Element> | undefined;
|
|
72
|
+
export declare function Btn(props: BtnProps): import("react").DetailedReactHTMLElement<{
|
|
36
73
|
slot?: string | undefined | undefined;
|
|
37
74
|
style?: import("react").CSSProperties | undefined;
|
|
38
75
|
title?: string | undefined | undefined;
|
|
76
|
+
translate?: "yes" | "no" | undefined | undefined;
|
|
77
|
+
onChange?: import("react").ChangeEventHandler<HTMLButtonElement, Element> | undefined;
|
|
39
78
|
dir?: string | undefined | undefined;
|
|
40
79
|
name?: string | undefined | undefined;
|
|
41
|
-
children?: import("react").ReactNode;
|
|
42
80
|
suppressHydrationWarning?: boolean | undefined | undefined;
|
|
43
81
|
color?: string | undefined | undefined;
|
|
44
82
|
id?: string | undefined | undefined;
|
|
@@ -52,7 +90,7 @@ export declare function Btn({ primary, quiet, warn, block, form, xl, sm, href, s
|
|
|
52
90
|
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined | undefined;
|
|
53
91
|
"aria-braillelabel"?: string | undefined | undefined;
|
|
54
92
|
"aria-brailleroledescription"?: string | undefined | undefined;
|
|
55
|
-
"aria-busy"
|
|
93
|
+
"aria-busy": (boolean | "true" | "false") | undefined;
|
|
56
94
|
"aria-checked"?: boolean | "false" | "mixed" | "true" | undefined | undefined;
|
|
57
95
|
"aria-colcount"?: number | undefined | undefined;
|
|
58
96
|
"aria-colindex"?: number | undefined | undefined;
|
|
@@ -63,7 +101,7 @@ export declare function Btn({ primary, quiet, warn, block, form, xl, sm, href, s
|
|
|
63
101
|
"aria-describedby"?: string | undefined | undefined;
|
|
64
102
|
"aria-description"?: string | undefined | undefined;
|
|
65
103
|
"aria-details"?: string | undefined | undefined;
|
|
66
|
-
"aria-disabled"
|
|
104
|
+
"aria-disabled": (boolean | "true" | "false") | undefined;
|
|
67
105
|
"aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined | undefined;
|
|
68
106
|
"aria-errormessage"?: string | undefined | undefined;
|
|
69
107
|
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
@@ -73,7 +111,7 @@ export declare function Btn({ primary, quiet, warn, block, form, xl, sm, href, s
|
|
|
73
111
|
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
74
112
|
"aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined | undefined;
|
|
75
113
|
"aria-keyshortcuts"?: string | undefined | undefined;
|
|
76
|
-
"aria-label"
|
|
114
|
+
"aria-label": string | undefined;
|
|
77
115
|
"aria-labelledby"?: string | undefined | undefined;
|
|
78
116
|
"aria-level"?: number | undefined | undefined;
|
|
79
117
|
"aria-live"?: "off" | "assertive" | "polite" | undefined | undefined;
|
|
@@ -312,7 +350,6 @@ export declare function Btn({ primary, quiet, warn, block, form, xl, sm, href, s
|
|
|
312
350
|
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined | undefined;
|
|
313
351
|
is?: string | undefined | undefined;
|
|
314
352
|
exportparts?: string | undefined | undefined;
|
|
315
|
-
disabled?: boolean | undefined | undefined;
|
|
316
353
|
value?: string | number | readonly string[] | undefined;
|
|
317
354
|
formAction?: string | ((formData: FormData) => void | Promise<void>) | undefined;
|
|
318
355
|
formEncType?: string | undefined | undefined;
|
|
@@ -321,6 +358,8 @@ export declare function Btn({ primary, quiet, warn, block, form, xl, sm, href, s
|
|
|
321
358
|
formTarget?: string | undefined | undefined;
|
|
322
359
|
onAnimationEnd: (e: import("react").AnimationEvent<HTMLButtonElement>) => void;
|
|
323
360
|
href: string | undefined;
|
|
324
|
-
type: "
|
|
361
|
+
type: "button" | "reset" | "submit" | undefined;
|
|
362
|
+
disabled: boolean | undefined;
|
|
325
363
|
className: string;
|
|
326
364
|
}, HTMLButtonElement>;
|
|
365
|
+
export {};
|
package/dist/actions/Btn.js
CHANGED
|
@@ -1,17 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { createElement } from 'react';
|
|
2
3
|
import { useSendOut } from './useSendOut.js';
|
|
3
4
|
import { cx } from '../cx.js';
|
|
5
|
+
import { Icon } from '../type/Icon.js';
|
|
4
6
|
/**
|
|
5
|
-
* Btn —
|
|
6
|
-
*
|
|
7
|
+
* Btn — THE button (Lh 2026-10-29: one component, so any button swaps for another). `shape`: a `pill` of words (default) or a `round` of an
|
|
8
|
+
* icon; `size` one ladder for both (`sm` 44 · `md` 48 · `lg` 56, a pill and a round one height; `xl` each shape its own, not swap-equal); `tone` `primary` for the one move, `quiet` on tinted cards, `warn`.
|
|
9
|
+
* In a Foot up to four share the line; in an ActionBar it takes the width. A round `sm` stands in heads and bars, `xl` in a foot of a few
|
|
10
|
+
* big round answers (`<Foot round>`). It is a button and nothing more: to open a Menu, give it the platform's `popoverTarget={the Menu's id}`
|
|
11
|
+
* and render that `<Menu popover actions id>` wherever you like — the panel anchors to the button that opened it. To open anything else, `onClick`.
|
|
7
12
|
*/
|
|
8
|
-
export function Btn(
|
|
13
|
+
export function Btn(props) {
|
|
14
|
+
const { shape, size, tone, href, sending, onSent, busy, disabled, onAnimationEnd, className, type, children, block, form, label, icon, ...rest } = props;
|
|
9
15
|
const ended = useSendOut(sending, onSent, onAnimationEnd);
|
|
16
|
+
const round = shape === 'round';
|
|
17
|
+
const base = round ? 'icon-btn' : 'btn';
|
|
18
|
+
const step = size && size !== 'md' ? `${base}--${size}` : undefined;
|
|
19
|
+
const look = tone && tone !== 'default' ? `${base}--${tone}` : undefined;
|
|
20
|
+
const ring = busy && _jsx(Icon, { name: "loader-circle", className: "btn__busy", size: round ? (size === 'sm' ? 'sm' : 'md') : 'xs' });
|
|
21
|
+
const invert = round && tone === 'primary' && 'icon-btn--invert'; // the round primary's old class name too: a theme's `.icon-btn--invert` rule still hits it
|
|
10
22
|
return createElement(href ? 'a' : 'button', {
|
|
11
23
|
onAnimationEnd: ended,
|
|
12
|
-
href,
|
|
24
|
+
href: busy ? undefined : href, // a busy link goes nowhere
|
|
13
25
|
type: href ? undefined : type ?? 'button',
|
|
14
|
-
|
|
26
|
+
disabled: href ? disabled : disabled || busy,
|
|
27
|
+
'aria-disabled': href && busy ? true : undefined,
|
|
28
|
+
'aria-busy': busy || undefined,
|
|
29
|
+
'aria-label': round ? label : undefined,
|
|
30
|
+
className: cx(base, step, look, invert, block && 'btn--block', form && 'btn--form', sending && 'is-sending', busy && 'is-busy', className),
|
|
15
31
|
...rest,
|
|
16
|
-
});
|
|
32
|
+
}, round ? (ring ? _jsxs(_Fragment, { children: [ring, icon ? children : null] }) : icon ? _jsxs(_Fragment, { children: [_jsx(Icon, { name: icon, size: size === 'sm' ? 'sm' : 'md' }), children] }) : children) : _jsxs(_Fragment, { children: [ring, children] }));
|
|
17
33
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ComponentProps } from 'react';
|
|
2
2
|
type Picked = string | null | string[];
|
|
3
3
|
export interface BtnGroupProps extends Omit<ComponentProps<'div'>, 'onChange' | 'defaultValue'> {
|
|
4
|
-
/** how the buttons stand (Lh 2026-10-24: one panel of buttons, two looks): `frame` — up to FOUR `
|
|
4
|
+
/** how the buttons stand (Lh 2026-10-24: one panel of buttons, two looks): `frame` — up to FOUR round `Btn`s in ONE frame, sharing its
|
|
5
5
|
* width, a rule between them (a card's or a sheet's foot) · `strip` — `BtnGroupItem`s of words a small gap apart, sharing the width,
|
|
6
6
|
* the picked one filled (a tab strip, a day picker; as many as fit) · `choice` (Lh 2026-10-24) — `BtnGroupItem`s of words that READ
|
|
7
7
|
* AS BUTTONS: joined in ONE frame like `frame`'s, a full tap tall, a rule between them, the picked one a solid brand fill with its ink (a pick of
|
|
@@ -34,8 +34,8 @@ export interface BtnGroupProps extends Omit<ComponentProps<'div'>, 'onChange' |
|
|
|
34
34
|
labelled?: boolean;
|
|
35
35
|
}
|
|
36
36
|
/** BtnGroup — a panel of buttons, one job in two looks (`look`). `frame` (default): up to FOUR icon buttons in ONE frame, sharing its
|
|
37
|
-
* width, a rule between them in the frame's colour (Lh 2026-09-29). Each is
|
|
38
|
-
* stand beside the icon as its child (`<
|
|
37
|
+
* width, a rule between them in the frame's colour (Lh 2026-09-29). Each is a round `Btn` (its `label` is its spoken name); a WORD may
|
|
38
|
+
* stand beside the icon as its child (`<Btn shape="round" icon="man" label="ชาย">ชาย</Btn>`) — two named sides of a `Panes`. At home
|
|
39
39
|
* in a card's or a sheet's foot; `vertical` at a row's end; `form` as a small control of its own in the middle of a `Page` or a `Centre`
|
|
40
40
|
* (`<BtnGroup form labelled label="เปลี่ยนสีพื้น">` = the words, then the narrow panel, both centred). `strip`: `BtnGroupItem`s of words
|
|
41
41
|
* sharing the width (a tab strip, a day picker), a tablist. Plain: each button does its own thing on its onClick. With `select`, a pressed
|
package/dist/actions/BtnGroup.js
CHANGED
|
@@ -3,8 +3,8 @@ import { Children, cloneElement, isValidElement, useId } from 'react';
|
|
|
3
3
|
import { cx } from '../cx.js';
|
|
4
4
|
import { useControlled, warnOnce } from '../state.js';
|
|
5
5
|
/** BtnGroup — a panel of buttons, one job in two looks (`look`). `frame` (default): up to FOUR icon buttons in ONE frame, sharing its
|
|
6
|
-
* width, a rule between them in the frame's colour (Lh 2026-09-29). Each is
|
|
7
|
-
* stand beside the icon as its child (`<
|
|
6
|
+
* width, a rule between them in the frame's colour (Lh 2026-09-29). Each is a round `Btn` (its `label` is its spoken name); a WORD may
|
|
7
|
+
* stand beside the icon as its child (`<Btn shape="round" icon="man" label="ชาย">ชาย</Btn>`) — two named sides of a `Panes`. At home
|
|
8
8
|
* in a card's or a sheet's foot; `vertical` at a row's end; `form` as a small control of its own in the middle of a `Page` or a `Centre`
|
|
9
9
|
* (`<BtnGroup form labelled label="เปลี่ยนสีพื้น">` = the words, then the narrow panel, both centred). `strip`: `BtnGroupItem`s of words
|
|
10
10
|
* sharing the width (a tab strip, a day picker), a tablist. Plain: each button does its own thing on its onClick. With `select`, a pressed
|
package/dist/actions/BtnRow.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ComponentProps } from 'react';
|
|
2
2
|
export interface BtnRowProps extends ComponentProps<'div'> {
|
|
3
|
-
/** a few big round `
|
|
3
|
+
/** a few big round `Btn`s (`size="xl"`), each its own size, as ONE group in the middle a fixed gap apart — the look of `Foot round`, in a card's
|
|
4
4
|
* content, so the card's `Foot` stays free for its status line. Knob `--btn-row-gap` (default `--sp-6` here, `--sp-2` for Btns) */
|
|
5
5
|
round?: boolean;
|
|
6
6
|
/** with `round`: a dotted link between each two buttons and a closer gap (× · ? · ✓ — the answers of a `ModalAsk`; was `BtnTrio`).
|
|
@@ -11,6 +11,6 @@ export interface BtnRowProps extends ComponentProps<'div'> {
|
|
|
11
11
|
/** the buttons stand at the END of the row (the right, in a left-to-right script) — with `wrap` */
|
|
12
12
|
end?: boolean;
|
|
13
13
|
}
|
|
14
|
-
/** BtnRow — twin CTAs inside a card's content sharing the width (Log time · Offer), or with `round` a group of round
|
|
14
|
+
/** BtnRow — twin CTAs inside a card's content sharing the width (Log time · Offer), or with `round` a group of round Btns there
|
|
15
15
|
* (`round joined`: linked by dots, the answers of a `ModalAsk`); `wrap` (`wrap end`) each Btn as wide as its words, wrapping (at the end). In a foot use Foot instead. */
|
|
16
16
|
export declare function BtnRow({ round, joined, wrap, end, className, children, ...rest }: BtnRowProps): import("react").JSX.Element;
|
package/dist/actions/BtnRow.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cx } from '../cx.js';
|
|
3
3
|
import { joinDots } from './joined.js';
|
|
4
|
-
/** BtnRow — twin CTAs inside a card's content sharing the width (Log time · Offer), or with `round` a group of round
|
|
4
|
+
/** BtnRow — twin CTAs inside a card's content sharing the width (Log time · Offer), or with `round` a group of round Btns there
|
|
5
5
|
* (`round joined`: linked by dots, the answers of a `ModalAsk`); `wrap` (`wrap end`) each Btn as wide as its words, wrapping (at the end). In a foot use Foot instead. */
|
|
6
6
|
export function BtnRow({ round, joined, wrap, end, className, children, ...rest }) {
|
|
7
7
|
return _jsx("div", { className: cx('btn-row', round && 'btn-row--round', joined && 'btn-row--joined', wrap && 'btn-row--wrap', end && 'btn-row--end', className), ...rest, children: joined ? joinDots(children) : children });
|
package/dist/actions/Chip.d.ts
CHANGED
|
@@ -359,7 +359,7 @@ export interface ChipChoiceProps extends Omit<ComponentProps<'div'>, 'defaultVal
|
|
|
359
359
|
onValueChange?: (value: string[]) => void;
|
|
360
360
|
/** the group's accessible name (it has no visible label of its own: the heading above it is the app's) */
|
|
361
361
|
label: string;
|
|
362
|
-
/** a control standing FIRST in the row, before the chips — the "+" that adds a choice (`<
|
|
362
|
+
/** a control standing FIRST in the row, before the chips — the "+" that adds a choice (`<Btn shape="round" size="sm" icon="plus" …>`); what it does is the app's */
|
|
363
363
|
add?: ReactNode;
|
|
364
364
|
/** a wrapping row instead of the one-line strip that runs to its holder's edges and scrolls sideways (the default) */
|
|
365
365
|
wrap?: boolean;
|
package/dist/actions/Fab.d.ts
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import type { ComponentProps } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import type { IconName } from '../type/Icon.js';
|
|
3
|
+
import { type BtnTone } from './Btn.js';
|
|
4
|
+
export interface FabProps extends Omit<ComponentProps<'button'>, 'form' | 'children'> {
|
|
4
5
|
/** the accessible name — required, the button has no text */
|
|
5
6
|
label: string;
|
|
6
|
-
/** the icon (default plus);
|
|
7
|
+
/** the icon (default plus); a word child replaces it */
|
|
7
8
|
icon?: IconName;
|
|
8
|
-
/**
|
|
9
|
-
|
|
9
|
+
/** a short word in place of the icon */
|
|
10
|
+
children?: string;
|
|
11
|
+
/** a Btn's tone (default `primary`, filled); `default` for a plain one */
|
|
12
|
+
tone?: BtnTone;
|
|
10
13
|
}
|
|
11
|
-
/** Fab — the square floating action at the bottom-right of a stage or screen (above the bar):
|
|
12
|
-
|
|
14
|
+
/** Fab — the square floating action at the bottom-right of a stage or screen (above the bar): a round Btn with the fab's place and its
|
|
15
|
+
* own size (`--fab`, so it takes no `size`). */
|
|
16
|
+
export declare function Fab({ label, icon, tone, className, children, ...rest }: FabProps): import("react").JSX.Element;
|
package/dist/actions/Fab.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cx } from '../cx.js';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export function Fab({ label, icon = 'plus',
|
|
7
|
-
|
|
3
|
+
import { Btn } from './Btn.js';
|
|
4
|
+
/** Fab — the square floating action at the bottom-right of a stage or screen (above the bar): a round Btn with the fab's place and its
|
|
5
|
+
* own size (`--fab`, so it takes no `size`). */
|
|
6
|
+
export function Fab({ label, icon = 'plus', tone = 'primary', className, children, ...rest }) {
|
|
7
|
+
const own = { label, tone, className: cx('fab', className), ...rest };
|
|
8
|
+
return children ? _jsx(Btn, { shape: "round", ...own, children: children }) : _jsx(Btn, { shape: "round", icon: icon, ...own });
|
|
8
9
|
}
|
|
@@ -6,5 +6,6 @@ export interface LinkBlockProps extends ComponentProps<'a'> {
|
|
|
6
6
|
/** LinkBlock — a link that is neither a card nor a row: a few pieces of a card's content (a still `MapArea` and the `Row` naming the place) as ONE
|
|
7
7
|
* `<a>`, stacked with the card's gap, in the ink of what holds it, no underline, no frame and no padding of its own; it dims under the finger.
|
|
8
8
|
* Name it with `aria-label` when it leaves the app (`target="_blank"`). Nothing that can be pressed goes inside. Knob `--link-block-gap`.
|
|
9
|
-
* A `Row` in it with a lead and a meta
|
|
9
|
+
* A `Row` in it with a lead and a meta is a led line: its end (`<End caption="Maps"><Icon name="arrow-up-right" /></End>`, the words and their arrow
|
|
10
|
+
* as one) at the top right, its centre on the title's first line's x-height middle; the title and the meta flow round it and under it. */
|
|
10
11
|
export declare function LinkBlock({ className, children, ...rest }: LinkBlockProps): import("react").JSX.Element;
|
|
@@ -4,7 +4,8 @@ import { RowEndRoomCtx } from '../parts/endRoom.js';
|
|
|
4
4
|
/** LinkBlock — a link that is neither a card nor a row: a few pieces of a card's content (a still `MapArea` and the `Row` naming the place) as ONE
|
|
5
5
|
* `<a>`, stacked with the card's gap, in the ink of what holds it, no underline, no frame and no padding of its own; it dims under the finger.
|
|
6
6
|
* Name it with `aria-label` when it leaves the app (`target="_blank"`). Nothing that can be pressed goes inside. Knob `--link-block-gap`.
|
|
7
|
-
* A `Row` in it with a lead and a meta
|
|
7
|
+
* A `Row` in it with a lead and a meta is a led line: its end (`<End caption="Maps"><Icon name="arrow-up-right" /></End>`, the words and their arrow
|
|
8
|
+
* as one) at the top right, its centre on the title's first line's x-height middle; the title and the meta flow round it and under it. */
|
|
8
9
|
export function LinkBlock({ className, children, ...rest }) {
|
|
9
10
|
return _jsx("a", { className: cx('link-block', className), ...rest, children: _jsx(RowEndRoomCtx.Provider, { value: true, children: children }) });
|
|
10
11
|
}
|