@coolms/ui-react 0.1.0-alpha.37 → 0.1.0-alpha.39

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,24 @@
2
2
 
3
3
  All notable changes to `@coolms/ui-react` are listed here. Versions follow [semantic versioning](https://semver.org/).
4
4
 
5
+ ## 0.1.0-alpha.39 (2026-12-02)
6
+
7
+ A refused phone action says why on a press, and an avatar for no one shows no letters.
8
+
9
+ - `ScreenShell`: the phone screen's primary action can be refused (`offer`, as `SectionHeader`'s primary). It stays drawn, greyed as a whole by a surface wash, and never runs. Its reason is its description, shown above it on a press, keyboard focus and hover with a fine pointer; Escape hides it. A primary the server does not offer is not drawn. (#154)
10
+ - `Avatar`: `placeholder` marks a name that is the host's words for no one ("No recipient yet", "No sender", a call's status). It draws the neutral person icon, never initials of those words, which stay its accessible name. `MailRow` passes it as `fromPlaceholder`, `IncomingCall` as `namePlaceholder`. (#155)
11
+
12
+ Not in the package: the button-radius test lets a button's own `::before` or `::after` inherit its radius (#154). The demo's shell has a refused-primary screen (#154).
13
+
14
+ ## 0.1.0-alpha.38 (2026-12-02)
15
+
16
+ An action that cannot run says why on hover, on keyboard focus and on a press, and Escape hides that.
17
+
18
+ - `SectionHeader`: a refused action (the primary or a secondary) draws its reason instead of a native title, which only a mouse hover shows. The reason shows on hover with a fine pointer, on keyboard focus and after a press. It is the action's description, centred under the action and moved only as far as keeps it inside the header row, never wider than the row. A refused secondary is named by its label alone, and its reason keeps full contrast. (#149)
19
+ - `SectionHeader` and `PaneToolbar`: Escape hides a drawn reason whichever of hover, focus or a press showed it, until the pointer and the focus have left the action; a press shows it again (WCAG 1.4.13). (#149)
20
+
21
+ Not in the package: ws 8.23.1 in the lockfile clears GHSA-37g9-w4hg-h9qr; it is a development dependency only (#150). The demo's headers screen has a head in a real pane whose actions are refused (#149).
22
+
5
23
  ## 0.1.0-alpha.37 (2026-12-01)
6
24
 
7
25
  A list flung to its end on a phone stays there.
@@ -26,6 +26,8 @@ export declare const CALL_LABELS: CallLabels;
26
26
  export interface IncomingCallProps {
27
27
  /** Who is calling. */
28
28
  readonly name: string;
29
+ /** `name` is the host's words for no one (the call's status while the caller is unknown): a neutral person icon. */
30
+ readonly namePlaceholder?: boolean;
29
31
  readonly media: 'audio' | 'video';
30
32
  readonly onAccept: () => void;
31
33
  readonly onDecline: () => void;
@@ -33,7 +35,7 @@ export interface IncomingCallProps {
33
35
  readonly labels?: Partial<CallLabels>;
34
36
  }
35
37
  /** A call ringing on this device: who, and Accept or Decline. An alert dialog, so a screen reader announces it. */
36
- export declare function IncomingCall({ name, media, onAccept, onDecline, labels }: IncomingCallProps): ReactNode;
38
+ export declare function IncomingCall({ name, namePlaceholder, media, onAccept, onDecline, labels }: IncomingCallProps): ReactNode;
37
39
  export interface CallPanelProps {
38
40
  readonly name: string;
39
41
  /** How long the call has lasted ("04:12"). */
@@ -2,11 +2,17 @@ import { type ReactNode } from 'react';
2
2
  import { type MenuItem } from './Collections.js';
3
3
  import { type IconName } from './Icon.js';
4
4
  import { type ListFilter } from './FilterMenu.js';
5
- /** The screen's floating primary action: one action, or a menu of declared entries. */
5
+ import type { Offer } from '../server/capability.js';
6
+ /**
7
+ * The screen's floating primary action: one action, or a menu of declared entries. A single action carries the server's
8
+ * answer: not offered, it is not drawn; refused, it stays, greyed, and a press shows the server's sentence instead of
9
+ * running it.
10
+ */
6
11
  export type ScreenPrimary = {
7
12
  readonly label: string;
8
13
  readonly icon: IconName;
9
14
  readonly onPress: () => void;
15
+ readonly offer?: Offer;
10
16
  } | {
11
17
  readonly label: string;
12
18
  readonly icon: IconName;
@@ -17,6 +17,11 @@ export type SectionPrimary = {
17
17
  /** The split menu button's accessible name. */
18
18
  readonly menuLabel: string;
19
19
  };
20
+ /**
21
+ * Where a drawn reason starts in its row, in px from the row's left: centred on its action when the row has room, moved
22
+ * only as far as keeps it inside the row.
23
+ */
24
+ export declare function reasonLeft(anchorCentre: number, rowWidth: number, tipWidth: number): number;
20
25
  /** One of the section's other declared actions: a button in row 1 while it fits. */
21
26
  export interface SectionAction {
22
27
  readonly id: string;
@@ -51,6 +51,11 @@ export interface AvatarProps {
51
51
  };
52
52
  /** Their account is gone: a neutral person icon, never initials of the name stored for them. */
53
53
  readonly deleted?: boolean;
54
+ /**
55
+ * `name` is the host's words for no one ("No recipient yet", "No sender", a call's status), not a name: a neutral
56
+ * person icon, never initials of those words. They stay the accessible name.
57
+ */
58
+ readonly placeholder?: boolean;
54
59
  /**
55
60
  * The host's words for a person with no name to show (no name given, or one the viewer may not read), the same label
56
61
  * its lists use ("No name"): the accessible name when `name` is blank. "?" when left out. The avatar still shows "?".
@@ -70,4 +75,4 @@ export declare function initialsOf(name: string): string;
70
75
  /** Which of the six avatar tints a name takes: the same name always the same tint. */
71
76
  export declare function tintOf(name: string): number;
72
77
  /** A person or an account, by picture or initials (contract component `avatar`: picture, initials, presence). */
73
- export declare function Avatar({ name, pictureUrl, presence, connection, deleted, size, tintSeed, unnamedLabel }: AvatarProps): ReactNode;
78
+ export declare function Avatar({ name, pictureUrl, presence, connection, deleted, placeholder, size, tintSeed, unnamedLabel }: AvatarProps): ReactNode;
@@ -117,6 +117,11 @@ export declare function fitPanes(wanted: readonly PaneSize[], room: number, last
117
117
  export declare function SplitPanes({ panes, active, back, sizes, lastMin, onResize, storageKey }: SplitPanesProps): ReactNode;
118
118
  export interface MailRowProps {
119
119
  readonly from: string;
120
+ /**
121
+ * `from` is the host's words for no one ("No recipient yet" on a draft, "No sender"): the avatar is a neutral person
122
+ * icon, never initials of those words.
123
+ */
124
+ readonly fromPlaceholder?: boolean;
120
125
  readonly subject: string;
121
126
  readonly preview: string;
122
127
  /** When it arrived, as the reader reads it ("09:42", "Yesterday"). */
@@ -160,7 +165,7 @@ export declare const MAIL_ROW_LABELS: MailRowLabels;
160
165
  * selected), while checked, on keyboard focus within the row, and under a fine pointer's hover; the avatar otherwise,
161
166
  * so a touch screen with nothing selected shows every avatar. The avatar's top is on the sender line's top.
162
167
  */
163
- export declare function MailRow({ from, subject, preview, time, unread, hasAttachment, selected, onOpen, check, selecting, labels }: MailRowProps): ReactNode;
168
+ export declare function MailRow({ from, fromPlaceholder, subject, preview, time, unread, hasAttachment, selected, onOpen, check, selecting, labels }: MailRowProps): ReactNode;
164
169
  export interface ChatBubbleProps {
165
170
  /** Received from someone else, or sent by this account. */
166
171
  readonly direction: 'in' | 'out';
@@ -0,0 +1,14 @@
1
+ /**
2
+ * A drawn tip's dismissal (WCAG 1.4.13): Escape hides it whether hover, keyboard focus or a press showed it, and it
3
+ * stays hidden until both the pointer and the focus have left its control. A control is named by an id the caller
4
+ * gives; the control marks itself `data-tip-dismissed` while `dismissed(id)`, and the stylesheet shows no tip there.
5
+ */
6
+ export declare function useTipDismissal(): {
7
+ readonly dismissed: (id: string) => boolean;
8
+ readonly dismiss: (id: string) => void;
9
+ readonly show: (id: string) => void;
10
+ readonly pointerIn: (id: string) => void;
11
+ readonly pointerOut: (id: string) => void;
12
+ readonly focusIn: (id: string) => void;
13
+ readonly focusOut: (id: string) => void;
14
+ };