@usableapp/cardds 0.7.103 → 0.7.105
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 +43 -0
- package/css/actions.css +112 -37
- package/css/base.css +139 -15
- package/css/card.css +331 -86
- package/css/choice.css +25 -33
- package/css/finish.css +29 -28
- package/css/forms.css +6 -14
- package/css/journey.css +8 -6
- package/css/layover.css +26 -24
- package/css/lists.css +8 -6
- package/css/media.css +13 -74
- package/css/numbers.css +37 -32
- package/css/palette.css +2 -2
- package/css/people.css +3 -8
- package/css/post.css +23 -19
- package/css/sheet.css +84 -56
- package/css/stack.css +40 -216
- package/css/stamp.css +41 -29
- package/css/step.css +1 -107
- package/css/sticky.css +43 -41
- package/css/theme.template.css +12 -0
- package/css/tokens.css +101 -26
- package/dist/actions/Chip.d.ts +1 -1
- package/dist/actions/Chip.js +3 -2
- package/dist/actions/IconBtn.d.ts +12 -3
- package/dist/actions/IconBtn.js +9 -3
- package/dist/cardds.css +1094 -881
- package/dist/cards/Card.d.ts +8 -6
- package/dist/cards/Card.js +4 -4
- package/dist/cards/CardFeed.js +7 -9
- package/dist/cards/CardFoot.d.ts +7 -2
- package/dist/cards/CardFoot.js +4 -3
- package/dist/catalog.json +1 -1
- package/dist/journey/JourneyBadge.d.ts +1 -1
- package/dist/journey/JourneyBadge.js +1 -1
- package/dist/layover/Snackbar.js +2 -2
- package/dist/lists/Bubble.d.ts +1 -1
- package/dist/lists/Bubble.js +1 -1
- package/dist/lists/Row.js +5 -7
- package/dist/numbers/Picker.js +11 -18
- package/dist/people/Avatar.d.ts +1 -1
- package/dist/people/Avatar.js +3 -2
- package/dist/post/PostDesk.js +6 -9
- package/dist/post/PostLetter.js +4 -4
- package/dist/pressable.d.ts +9 -0
- package/dist/pressable.js +6 -0
- package/dist/room.d.ts +5 -0
- package/dist/room.js +9 -0
- package/dist/scaffold/Panes.js +8 -14
- package/dist/sheets/Sheet.d.ts +1 -1
- package/dist/sheets/Sheet.js +2 -3
- package/dist/sheets/SheetSteps.js +3 -3
- package/dist/sheets/StackSheet.d.ts +1 -1
- package/dist/sheets/sheetStepsPile.js +2 -3
- package/dist/sheets/stackCard.js +67 -115
- package/dist/state.d.ts +21 -0
- package/dist/state.js +28 -1
- package/dist/sticky/Sticky.js +3 -7
- package/dist/templates/Home.d.ts +1 -1
- package/dist/templates/Splash.js +2 -2
- package/dist/templates/Walkthrough.js +4 -5
- package/docs/reference.md +76 -12
- package/lib/catalog.mjs +23 -7
- package/lint/rules.mjs +7 -5
- package/lint/values.mjs +144 -0
- package/package.json +6 -4
|
@@ -5,17 +5,26 @@ export interface IconBtnProps extends ComponentProps<'button'> {
|
|
|
5
5
|
label: string;
|
|
6
6
|
/** the icon to show (sized to the button); or pass an Icon as children */
|
|
7
7
|
icon?: IconName;
|
|
8
|
-
/** 40px, for a card head or a top bar; default 48px */
|
|
8
|
+
/** 40px, for a card head or a top bar; default 48px (the short form of `size="sm"`) */
|
|
9
9
|
sm?: boolean;
|
|
10
|
+
/** the round sizes, all on `--tap-base`: `sm` (44) · default (48) · `lg` (56, the hero control) · `xl` (68, the biggest — a card foot of a few big
|
|
11
|
+
* round buttons). In `lg` and `xl` the icon is a share of the circle (knob `--icon-btn-icon`) and a word child keeps inside it
|
|
12
|
+
* (knob `--icon-btn-word-max`). Each size has its knob: `--icon-btn-lg-size`, `--icon-btn-xl-size` */
|
|
13
|
+
size?: 'sm' | 'lg' | 'xl';
|
|
10
14
|
/** filled accent (the forward arrow, the send button) */
|
|
11
15
|
invert?: boolean;
|
|
16
|
+
/** filled with the primary Btn's fill (the palette's primary, `--btn-primary-bg`): the one answer, on a card whose foot is round buttons.
|
|
17
|
+
* `invert` is the accent, `primary` the primary — the same fill on the wireframe, two on a palette that gives them two colours */
|
|
18
|
+
primary?: boolean;
|
|
12
19
|
/** a link styled as a round button */
|
|
13
20
|
href?: string;
|
|
14
21
|
}
|
|
15
|
-
/** IconBtn — the round icon button: `sm` in heads and bars, full size in rows and composers, `invert` for the one filled move
|
|
22
|
+
/** IconBtn — the round icon button: `sm` in heads and bars, full size in rows and composers, `invert` for the one filled move, `primary` for the
|
|
23
|
+
* primary fill. `size="lg"` / `"xl"` are the big rounds (the foot of a few round answers: `<CardFoot round>`); a short WORD may stand in one
|
|
24
|
+
* as its child (`<IconBtn size="xl" primary label="ช่วยเหลือ">ช่วย</IconBtn>`): it grows with the member's text size up to the circle's share.
|
|
16
25
|
* It is a button and nothing more: to open a Menu, give it the platform's `popoverTarget={the Menu's id}` and render that `<Menu popover actions id>`
|
|
17
26
|
* wherever you like — the panel anchors to the button that opened it. To open anything else, `onClick`. */
|
|
18
|
-
export declare function IconBtn({ label, icon, sm, invert, href, className, type, children, ...rest }: IconBtnProps): import("react").DetailedReactHTMLElement<{
|
|
27
|
+
export declare function IconBtn({ label, icon, sm, size, invert, primary, href, className, type, children, ...rest }: IconBtnProps): import("react").DetailedReactHTMLElement<{
|
|
19
28
|
ref?: import("react").Ref<HTMLButtonElement> | undefined;
|
|
20
29
|
key?: import("react").Key | null | undefined;
|
|
21
30
|
disabled?: boolean | undefined;
|
package/dist/actions/IconBtn.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createElement } from 'react';
|
|
3
3
|
import { cx } from '../cx.js';
|
|
4
|
+
import { warnOnce } from '../state.js';
|
|
4
5
|
import { Icon } from '../type/Icon.js';
|
|
5
|
-
/** IconBtn — the round icon button: `sm` in heads and bars, full size in rows and composers, `invert` for the one filled move
|
|
6
|
+
/** IconBtn — the round icon button: `sm` in heads and bars, full size in rows and composers, `invert` for the one filled move, `primary` for the
|
|
7
|
+
* primary fill. `size="lg"` / `"xl"` are the big rounds (the foot of a few round answers: `<CardFoot round>`); a short WORD may stand in one
|
|
8
|
+
* as its child (`<IconBtn size="xl" primary label="ช่วยเหลือ">ช่วย</IconBtn>`): it grows with the member's text size up to the circle's share.
|
|
6
9
|
* It is a button and nothing more: to open a Menu, give it the platform's `popoverTarget={the Menu's id}` and render that `<Menu popover actions id>`
|
|
7
10
|
* wherever you like — the panel anchors to the button that opened it. To open anything else, `onClick`. */
|
|
8
|
-
export function IconBtn({ label, icon, sm, invert, href, className, type, children, ...rest }) {
|
|
9
|
-
|
|
11
|
+
export function IconBtn({ label, icon, sm, size, invert, primary, href, className, type, children, ...rest }) {
|
|
12
|
+
if (invert && primary)
|
|
13
|
+
warnOnce('icon-btn-fill', 'cardds IconBtn: `invert` and `primary` together — two fills for one button; `primary` is drawn');
|
|
14
|
+
const step = size ?? (sm ? 'sm' : undefined);
|
|
15
|
+
const btn = createElement(href ? 'a' : 'button', { href, type: href ? undefined : type ?? 'button', 'aria-label': label, className: cx('icon-btn', step && `icon-btn--${step}`, invert && 'icon-btn--invert', primary && 'icon-btn--primary', className), ...rest }, icon ? _jsx(Icon, { name: icon, size: step === 'sm' ? 'sm' : 'md' }) : children);
|
|
10
16
|
return btn;
|
|
11
17
|
}
|