@usableapp/cardds 0.7.162 → 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 CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  > For: a project that consumes `@usableapp/cardds` and its AI — what changed between versions, written as before → after, so a screen can be brought up to date without reading the source. Newest first. A consumer never edits cardds; if something here leaves you without a way to do what you did before, report the gap. Each release section after 0.7.97 carries one `Components:` line, written by `node scripts/components-changed.mjs <previous tag>`: the components the release changed, or `all` when a file changed that any component can read (a token, the build), or `none`; check only the screens that import those.
4
4
 
5
+ ## 0.7.163 — 2026-10-29
6
+
7
+ `Btn busy`: a button whose press is being carried out.
8
+
9
+ Components: Btn
10
+
11
+ ### Added
12
+ - **`Btn busy`** (timebank, 2026-10-29): a turning ring stands where the icon would be (a pill: before its words), the button is `disabled` (it fades like one) and `aria-busy`; under reduced motion the ring stands still. A round keeps its `label` as its spoken name and needs no `icon` while busy. Before → after: `<Btn shape="round" size="xl" label="…" disabled><Spinner size="xs"/></Btn>` (no longer type-checks since 0.7.162) → `<Btn shape="round" size="xl" busy label="…" />`; a pill `<Btn disabled><Spinner …/> Sending…</Btn>` → `<Btn busy>Sending…</Btn>`. Story `Btn · Busy`.
13
+
5
14
  ## 0.7.162 — 2026-10-29
6
15
 
7
16
  One `Btn` for every button; a led line's title and meta flow round its ends; `TileGrid cols`; tokens only.
package/css/actions.css CHANGED
@@ -178,6 +178,9 @@
178
178
  :is(.btn, .icon-btn).is-sending { animation: send-out var(--motion-send) var(--ease-out); }
179
179
  :is(.btn, .icon-btn).is-sending > .icon { animation: send-out-call var(--motion-send) ease-in-out; }
180
180
  }
181
+ /* BUSY (Btn busy, 2026-10-29): the press is being carried out — a ring turns where the icon stands (a pill: before its words); the button is
182
+ disabled meanwhile, so it fades like one. Under reduced motion the ring stands still */
183
+ @media (prefers-reduced-motion: no-preference) { :is(.btn, .icon-btn).is-busy > .btn__busy { --icon-spin: turn var(--motion-spin) var(--ease-linear) infinite; } } /* `turn`: tokens.css */
181
184
  @keyframes send-out {
182
185
  from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--btn-sending-ink, var(--accent)) 45%, transparent), 0 0 0 0 color-mix(in srgb, var(--btn-sending-ink, var(--accent)) 30%, transparent); }
183
186
  60% { box-shadow: 0 0 0 var(--sp-3) transparent, 0 0 0 var(--sp-1) color-mix(in srgb, var(--btn-sending-ink, var(--accent)) 30%, transparent); }
@@ -21,6 +21,10 @@ interface BtnBase extends Omit<ComponentProps<'button'>, 'form' | 'children'> {
21
21
  sending?: boolean;
22
22
  /** the send-out has ended (once per `sending`; at once where motion is off): the app does what follows */
23
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;
24
28
  }
25
29
  export interface PillBtnProps extends BtnBase {
26
30
  /** `pill` (default): the worded button, as wide as its words */
@@ -52,6 +56,10 @@ export type RoundBtnProps = RoundBase & ({
52
56
  } | {
53
57
  icon?: never;
54
58
  children: string;
59
+ } | {
60
+ busy: true;
61
+ icon?: IconName;
62
+ children?: ReactNode;
55
63
  });
56
64
  export type BtnProps = PillBtnProps | RoundBtnProps;
57
65
  /**
@@ -82,7 +90,7 @@ export declare function Btn(props: BtnProps): import("react").DetailedReactHTMLE
82
90
  "aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined | undefined;
83
91
  "aria-braillelabel"?: string | undefined | undefined;
84
92
  "aria-brailleroledescription"?: string | undefined | undefined;
85
- "aria-busy"?: (boolean | "true" | "false") | undefined;
93
+ "aria-busy": (boolean | "true" | "false") | undefined;
86
94
  "aria-checked"?: boolean | "false" | "mixed" | "true" | undefined | undefined;
87
95
  "aria-colcount"?: number | undefined | undefined;
88
96
  "aria-colindex"?: number | undefined | undefined;
@@ -93,7 +101,7 @@ export declare function Btn(props: BtnProps): import("react").DetailedReactHTMLE
93
101
  "aria-describedby"?: string | undefined | undefined;
94
102
  "aria-description"?: string | undefined | undefined;
95
103
  "aria-details"?: string | undefined | undefined;
96
- "aria-disabled"?: (boolean | "true" | "false") | undefined;
104
+ "aria-disabled": (boolean | "true" | "false") | undefined;
97
105
  "aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined | undefined;
98
106
  "aria-errormessage"?: string | undefined | undefined;
99
107
  "aria-expanded"?: (boolean | "true" | "false") | undefined;
@@ -343,7 +351,6 @@ export declare function Btn(props: BtnProps): import("react").DetailedReactHTMLE
343
351
  is?: string | undefined | undefined;
344
352
  exportparts?: string | undefined | undefined;
345
353
  value?: string | number | readonly string[] | undefined;
346
- disabled?: boolean | undefined | undefined;
347
354
  formAction?: string | ((formData: FormData) => void | Promise<void>) | undefined;
348
355
  formEncType?: string | undefined | undefined;
349
356
  formMethod?: string | undefined | undefined;
@@ -352,6 +359,7 @@ export declare function Btn(props: BtnProps): import("react").DetailedReactHTMLE
352
359
  onAnimationEnd: (e: import("react").AnimationEvent<HTMLButtonElement>) => void;
353
360
  href: string | undefined;
354
361
  type: "button" | "reset" | "submit" | undefined;
362
+ disabled: boolean | undefined;
355
363
  className: string;
356
364
  }, HTMLButtonElement>;
357
365
  export {};
@@ -11,19 +11,23 @@ import { Icon } from '../type/Icon.js';
11
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`.
12
12
  */
13
13
  export function Btn(props) {
14
- const { shape, size, tone, href, sending, onSent, onAnimationEnd, className, type, children, block, form, label, icon, ...rest } = props;
14
+ const { shape, size, tone, href, sending, onSent, busy, disabled, onAnimationEnd, className, type, children, block, form, label, icon, ...rest } = props;
15
15
  const ended = useSendOut(sending, onSent, onAnimationEnd);
16
16
  const round = shape === 'round';
17
17
  const base = round ? 'icon-btn' : 'btn';
18
18
  const step = size && size !== 'md' ? `${base}--${size}` : undefined;
19
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' });
20
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
21
22
  return createElement(href ? 'a' : 'button', {
22
23
  onAnimationEnd: ended,
23
- href,
24
+ href: busy ? undefined : href, // a busy link goes nowhere
24
25
  type: href ? undefined : type ?? 'button',
26
+ disabled: href ? disabled : disabled || busy,
27
+ 'aria-disabled': href && busy ? true : undefined,
28
+ 'aria-busy': busy || undefined,
25
29
  'aria-label': round ? label : undefined,
26
- className: cx(base, step, look, invert, block && 'btn--block', form && 'btn--form', sending && 'is-sending', className),
30
+ className: cx(base, step, look, invert, block && 'btn--block', form && 'btn--form', sending && 'is-sending', busy && 'is-busy', className),
27
31
  ...rest,
28
- }, round && icon ? _jsxs(_Fragment, { children: [_jsx(Icon, { name: icon, size: size === 'sm' ? 'sm' : 'md' }), children] }) : children);
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] }));
29
33
  }
package/dist/cardds.css CHANGED
@@ -3103,6 +3103,9 @@ button:enabled { cursor: pointer; } /* a disabled one keeps the arrow */
3103
3103
  :is(.btn, .icon-btn).is-sending { animation: send-out var(--motion-send) var(--ease-out); }
3104
3104
  :is(.btn, .icon-btn).is-sending > .icon { animation: send-out-call var(--motion-send) ease-in-out; }
3105
3105
  }
3106
+ /* BUSY (Btn busy, 2026-10-29): the press is being carried out — a ring turns where the icon stands (a pill: before its words); the button is
3107
+ disabled meanwhile, so it fades like one. Under reduced motion the ring stands still */
3108
+ @media (prefers-reduced-motion: no-preference) { :is(.btn, .icon-btn).is-busy > .btn__busy { --icon-spin: turn var(--motion-spin) var(--ease-linear) infinite; } } /* `turn`: tokens.css */
3106
3109
  @keyframes send-out {
3107
3110
  from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--btn-sending-ink, var(--accent)) 45%, transparent), 0 0 0 0 color-mix(in srgb, var(--btn-sending-ink, var(--accent)) 30%, transparent); }
3108
3111
  60% { box-shadow: 0 0 0 var(--sp-3) transparent, 0 0 0 var(--sp-1) color-mix(in srgb, var(--btn-sending-ink, var(--accent)) 30%, transparent); }