@coolms/ui-react 0.1.0-alpha.30 → 0.1.0-alpha.32

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,31 @@
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.32 (2026-11-25)
6
+
7
+ The phone screen shell's More, Back's name giving way before the title, and design tokens v0.31.0.
8
+
9
+ - In the screen shell's bar Back's parent name gives way before the title, down to Back's icon, as the contract says; it kept its width while the title was cut. A name with no room for a readable piece (24px) is not drawn at all; it stays Back's accessible name.
10
+ - `ScreenShell` has More: `more` (the entries the section header shows under its own, in the tree's order) and `moreLabel`. More is an icon button in the bar, after the section's search and before the shell's own icons, opening the context menu with them; an action the server says cannot run now stays, with its sentence. With no entry shown there is no More, and while the section's search is open it gives way. The bar does not step out of view while the menu is open.
11
+ - The design-tokens copy is v0.31.0: the components contract 0.21.0, the phone screen shell's `with-more`.
12
+
13
+ ## 0.1.0-alpha.31 (2026-11-24)
14
+
15
+ The splitter, quiet and menu buttons, one control radius, no empty menus, filter chips that wrap whole, hover only where hover exists on a touch screen, and design tokens v0.30.0.
16
+
17
+ - `Splitter` is new: the components contract's `splitter`, the one handle between two columns. An 8px strip that draws nothing at rest, the accent line on hover and while dragged, and one line in the focus ring's colour with keyboard focus (no ring around the strip), with a col-resize pointer. A drag moves the leading column within `min` and `max`; on release the width is remembered on the device under `storageKey` (in `localStorage`, every read and write guarded, so it works without storage) and read back, within today's limits, the next time it is drawn; a double-click puts it back to `default` and forgets it. It is a focusable separator (`aria-valuenow`, `aria-valuemin`, `aria-valuemax`, named by `label`): Left and Right move it by `step` (16 by default, Shift 64), Home and End take it to its limits, and each key is remembered as a release is. `onChange(width, done)` reports each move. A width the host keeps that today's limits move (a minimum measured since) is handed back once, as `onChange(width, true)`.
18
+ - `SplitPanes` draws the kit's `Splitter` between its panes instead of a splitter of its own, with the same limits (each pane's own, and what leaves the last pane `lastMin`). The new `storageKey` lets the device remember the widths itself, one key per split (`${storageKey}:0`, `${storageKey}:1`); `sizes` and `onResize` work as before. Enter on a splitter no longer puts the pane back to its default width; a double-click does.
19
+ - `PaneToolbar` actions may carry `entries`, the action node's children: the action is then a menu button (`aria-haspopup="menu"`, `aria-expanded`, a chevron after it) that opens the context menu with its entries, each with its own state (disabled with its reason, danger), and choosing one says the entry's id. An action whose `entries` is empty is not drawn at all, so no empty menu is ever opened; one that is itself disabled keeps its reason and does not open. Menu buttons give way as any other action: their label hides, and behind More actions choosing one opens its entries there.
20
+ - `PaneToolbar`'s buttons are the contract's quiet buttons throughout: an action's and More's hover background is the button hover (`--cms-btn-hover-bg`).
21
+ - Every button the kit styles has the same corners, `--cms-radius-control`, whatever its style and size: `.cms-button`, icon buttons, the section head's More, the round Send (now a rounded square), the viewer's buttons and its previous and next, the call bar's buttons, the file picker's selection toggle and breadcrumbs, and the rest. The split primary's halves keep square corners where they join. Filter chips stay pills, the call buttons' discs stay circles, and the screen shell's floating primary stays the circle its contract draws.
22
+ - `SectionHeader` draws a plain primary, with no menu half, when its menu has no entry to show (empty, or every entry not offered).
23
+ - `FilterChips` never scroll sideways or fade at an edge any more: the group keeps its whole width beside what its row holds, and where it does not fit there it goes on its own line below (in a row that wraps), its chips wrapping onto the next line in turn, each chip whole, as the contract's `filter-chips` now says. The arrow keys move between them as before. The screen shell's filter row no longer scrolls sideways either.
24
+ - The `hash` icon (the number sign, for browsing channels) draws as the kit's new `hash` glyph.
25
+ - `Button` has the contract's `quiet` variant, an action bar's button: no border and no fill at rest, the button hover (`--cms-btn-hover-bg`) under the pointer.
26
+ - `ScreenShell` draws no floating primary when its menu has no entry to show (empty, or every entry not offered), so no empty menu is ever opened.
27
+ - List rows on a touch screen: a row's hover tint, and the mail row's checkbox in the avatar's place on hover, apply only where hover exists (`(hover: hover) and (pointer: fine)`); the checkbox shows on keyboard focus (`:focus-visible`), not on focus from a tap; so with nothing selected a touch screen shows every avatar, and a deselected row goes back to its avatar. The same holds for the icon buttons, the screen shell's Back, filter chips and the pane toolbar's actions, More and tooltip: their hover applies only where hover exists, so a tap leaves no tint or tooltip behind. The demo has a phone mailbox (`#shell/mail`) with rows to select and Compose floating over the list's end.
28
+ - The design-tokens copy is v0.30.0: the components contract with the quiet button, one control radius and the `splitter`, and the icon contract with `hash`. The kit declares the quiet state and the splitter.
29
+
5
30
  ## 0.1.0-alpha.30 (2026-11-24)
6
31
 
7
32
  The section head, the file picker restarting on a page link no longer valid, the mail row's avatar checkbox, and design tokens v0.24.0.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "repository": "coolms/design-tokens",
3
- "tag": "v0.24.0",
4
- "commit": "cc021e696d1b109703ef02c766cf1b42528580b4",
3
+ "tag": "v0.31.0",
4
+ "commit": "c0b6b2345ed93e1d63f233f09df96e22002dd790",
5
5
  "files": {
6
6
  "dist/coolms-tokens.css": {
7
7
  "to": "src/tokens/coolms-tokens.css",
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "contract/components.json": {
11
11
  "to": "contract/components.json",
12
- "sha256": "e76e4f7a20d91215e5277bde3c02ecc7a620a965a713870786ba1fcf8810a281"
12
+ "sha256": "fe34761d5e16de3dd9c32cb5d15da5a2e04144c2da4a5df2893ccb6611b10b11"
13
13
  },
14
14
  "contract/server-states.json": {
15
15
  "to": "contract/server-states.json",
@@ -45,7 +45,7 @@
45
45
  },
46
46
  "contract/icons.json": {
47
47
  "to": "contract/icons.json",
48
- "sha256": "86c7c3074922b99fc2b398fe14ac3a1ed5efe74446acb2ffd578b7e0409dafa0"
48
+ "sha256": "bf8856c702f5c989b1878b96e534dbffb24a4d831adcf81236db324c2f5f5d19"
49
49
  }
50
50
  }
51
51
  }
@@ -1,7 +1,10 @@
1
1
  import type { ButtonHTMLAttributes, ReactNode } from 'react';
2
2
  export interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
3
- /** secondary (the default), primary -- one per view -- or danger, for an action that destroys or cannot be undone. */
4
- readonly variant?: 'secondary' | 'primary' | 'danger';
3
+ /**
4
+ * secondary (the default); primary, the filled one, at most one per screen; danger, for an action that destroys or
5
+ * cannot be undone; quiet, an action bar's: no border and no fill at rest.
6
+ */
7
+ readonly variant?: 'secondary' | 'primary' | 'danger' | 'quiet';
5
8
  /** The action is running: the button keeps its place, says so, and cannot be pressed twice. */
6
9
  readonly busy?: boolean;
7
10
  /** What the button says while busy; defaults to its own label. */
@@ -15,7 +18,7 @@ export interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement
15
18
  readonly children: ReactNode;
16
19
  }
17
20
  /**
18
- * An action (contract component `button`: default, primary, danger, disabled, busy, locked). A busy button is not
21
+ * An action (contract component `button`: default, primary, danger, disabled, busy, locked, quiet). A busy button is not
19
22
  * disabled to assistive technology's eyes alone: `aria-busy` says why it does nothing now. A locked one stays
20
23
  * pressable -- the press is how the person asks for elevation -- and names why it is locked.
21
24
  */
@@ -1,6 +1,6 @@
1
1
  import type { ReactNode } from 'react';
2
2
  /** The icons the Workspace draws: one stroke style, 24 units, coloured by the text around them. */
3
- export type IconName = 'mail' | 'chat' | 'phone' | 'calendar' | 'file' | 'image' | 'search' | 'bell' | 'pencil' | 'star' | 'send' | 'inbox' | 'archive' | 'trash' | 'paperclip' | 'mic' | 'speaker' | 'user-plus' | 'phone-off' | 'video' | 'info' | 'chevron-down' | 'chevron-left' | 'plus' | 'folder' | 'check' | 'server' | 'reply' | 'more' | 'download' | 'print' | 'open-separately' | 'important' | 'forward' | 'refresh' | 'file-code' | 'mail-open' | 'copy' | 'user' | 'folder-plus' | 'folder-x' | 'user-check' | 'user-x' | 'upload' | 'users' | 'settings';
3
+ export type IconName = 'mail' | 'chat' | 'phone' | 'calendar' | 'file' | 'image' | 'search' | 'bell' | 'pencil' | 'star' | 'send' | 'inbox' | 'archive' | 'trash' | 'paperclip' | 'mic' | 'speaker' | 'user-plus' | 'phone-off' | 'video' | 'info' | 'chevron-down' | 'chevron-left' | 'plus' | 'folder' | 'check' | 'server' | 'reply' | 'more' | 'download' | 'print' | 'open-separately' | 'important' | 'forward' | 'refresh' | 'file-code' | 'mail-open' | 'copy' | 'user' | 'folder-plus' | 'folder-x' | 'user-check' | 'user-x' | 'upload' | 'users' | 'settings' | 'hash';
4
4
  export interface IconProps {
5
5
  readonly name: IconName;
6
6
  readonly size?: number;
@@ -1,4 +1,15 @@
1
1
  import { type ReactNode } from 'react';
2
+ /** One entry of a menu button's menu: a child of the action's node, as the host resolved it. */
3
+ export interface PaneToolbarEntry {
4
+ readonly id: string;
5
+ readonly label: string;
6
+ /** Its icon by its Bootstrap Icons name; one the kit's table lacks leaves its label alone. */
7
+ readonly icon?: string;
8
+ /** Shown, and doing nothing when chosen; `reason` is said beside it. */
9
+ readonly disabled?: boolean;
10
+ readonly reason?: string;
11
+ readonly danger?: boolean;
12
+ }
2
13
  /**
3
14
  * One action of a pane's row, as the server's action node gives it: which actions exist, their order, groups, icons and
4
15
  * danger are the server's; the row draws them and says which was chosen.
@@ -24,6 +35,11 @@ export interface PaneToolbarAction {
24
35
  readonly busy?: boolean;
25
36
  /** The delete kind: drawn as danger, the only action that is. */
26
37
  readonly danger?: boolean;
38
+ /**
39
+ * A menu button (New with its chevron): its node's children, in the tree's order, as its menu's entries. The action
40
+ * opens the menu, and choosing an entry says the entry's id. With no entry to show the action is not drawn at all.
41
+ */
42
+ readonly entries?: readonly PaneToolbarEntry[];
27
43
  }
28
44
  export interface PaneToolbarProps {
29
45
  /** The toolbar's accessible name, in the host's words ("Message actions"). */
@@ -53,5 +69,9 @@ export interface PaneToolbarProps {
53
69
  * Menu-only actions (overflow 0) are behind ... at every width, first in its menu, and take no part in the giving way:
54
70
  * their labels are not counted, and "never one alone" counts only the actions that could have stayed in the row. ...
55
71
  * is drawn for them even when one is alone.
72
+ *
73
+ * An action with `entries` is a menu button: its chevron after it, it opens the kit's context menu with its entries,
74
+ * each disabled with its own reason as the server says, and it gives way as any other action does (behind ..., choosing
75
+ * it opens its entries there). One whose entries are empty is not drawn; one that is itself disabled does not open.
56
76
  */
57
- export declare function PaneToolbar({ label, actions, onAction, status, moreLabel, leading }: PaneToolbarProps): ReactNode;
77
+ export declare function PaneToolbar({ label, actions: given, onAction, status, moreLabel, leading }: PaneToolbarProps): ReactNode;
@@ -37,6 +37,13 @@ export interface ScreenShellProps {
37
37
  readonly closeLabel: string;
38
38
  readonly onClose: () => void;
39
39
  };
40
+ /**
41
+ * The section's secondary actions, the entries the section header shows under its More, in the tree's order; a
42
+ * refused one stays, with the server's reason. With none shown, no More; never on an item's own screen.
43
+ */
44
+ readonly more?: readonly MenuItem[];
45
+ /** More's accessible name and tooltip, from the host's catalogue. */
46
+ readonly moreLabel?: string;
40
47
  /** The shell's own icons, the same in every section: the bell, then the person's avatar. */
41
48
  readonly globals?: ReactNode;
42
49
  /** The place's filters, as chips under the bar, exactly one selected. */
@@ -63,9 +70,9 @@ export interface ScreenShellProps {
63
70
  }
64
71
  /**
65
72
  * One screen of a section at phone width (contract component `screen-shell`: root, nested, with-filters,
66
- * with-primary-action, with-primary-menu, pulling, refreshing, searching, bar-hidden). One bar: the section's navigation or Back
73
+ * with-primary-action, with-primary-menu, with-more, pulling, refreshing, searching, bar-hidden). One bar: the section's navigation or Back
67
74
  * with the parent's name, the title, then search and the shell's own icons, or while searching, Close and the field; the filters under it; the content, which
68
75
  * scrolls on its own and refreshes by a pull from its top; the primary action floating at the bottom right, its menu
69
76
  * opening above it. What fills each slot is the host's, from the server's declared nodes.
70
77
  */
71
- export declare function ScreenShell({ title, back, navigation, search, searching, globals, filters, primary, onRefresh, pullText, barHidden, children }: ScreenShellProps): ReactNode;
78
+ export declare function ScreenShell({ title, back, navigation, search, searching, more, moreLabel, globals, filters, primary: declared, onRefresh, pullText, barHidden, children }: ScreenShellProps): ReactNode;
@@ -36,7 +36,8 @@ export interface SectionHeaderProps {
36
36
  /**
37
37
  * The head of a section from tablet width up (contract component `section-header`: default, with-primary,
38
38
  * with-primary-menu, with-more, action-disabled, with-context, full-width). Row 1: the title, then the primary action
39
- * (icon and label, always shown; a split button when it has entries) and More for the other actions. Row 2: the
40
- * context, only when given. No divider lines. Below tablet width the host draws the screen shell instead.
39
+ * (icon and label, always shown; a split button while it has an entry to show, a plain button with none) and More for
40
+ * the other actions. Row 2: the context, only when given. No divider lines. Below tablet width the host draws the
41
+ * screen shell instead.
41
42
  */
42
43
  export declare function SectionHeader({ title, icon, primary, more, moreLabel, context, fullWidth }: SectionHeaderProps): ReactNode;
@@ -0,0 +1,38 @@
1
+ import { type CSSProperties, type ReactNode } from 'react';
2
+ export interface SplitterProps {
3
+ /**
4
+ * Where the width is remembered on this device (the screen and the split, such as "mail:folders"); never sent
5
+ * anywhere. Without one, nothing is remembered.
6
+ */
7
+ readonly storageKey?: string;
8
+ /** The leading column's width in px, when the host keeps it; without one the splitter keeps it itself. */
9
+ readonly value?: number;
10
+ /** The leading column's default width in px: what a double-click puts it back to. */
11
+ readonly default: number;
12
+ /** The leading column's least width in px. */
13
+ readonly min: number;
14
+ /** The leading column's greatest width in px (or the width that leaves the trailing column its least). */
15
+ readonly max: number;
16
+ /** How far an arrow key moves it, in px; Shift with an arrow moves it 64. */
17
+ readonly step?: number;
18
+ /** The handle's accessible name, naming the columns it resizes ("Resize the folder list"). */
19
+ readonly label: string;
20
+ /**
21
+ * The new width: while it is dragged (`done` false), and once more when the drag ends, on each key, on a
22
+ * double-click and when a remembered width is read back (`done` true).
23
+ */
24
+ readonly onChange: (width: number, done: boolean) => void;
25
+ readonly className?: string;
26
+ readonly style?: CSSProperties;
27
+ }
28
+ /** The width remembered on this device under `storageKey`, or null: none, or storage that cannot be read. */
29
+ export declare function readSplitterWidth(storageKey: string): number | null;
30
+ /**
31
+ * The handle between two columns (contract component `splitter`: default, hover, dragging, focused, at-min, at-max).
32
+ * A vertical strip at least 8px wide that draws nothing at rest and the accent line on hover, while dragged and with
33
+ * focus. A drag moves the leading column within min and max and remembers its width on release; a double-click puts it
34
+ * back to its default and forgets it. It is a focusable separator: Left and Right move it by step (Shift: 64), Home and
35
+ * End take it to min and max, Enter and Escape leave it; each key is remembered as a release is. A remembered width is
36
+ * read back, within today's limits, when it is first drawn.
37
+ */
38
+ export declare function Splitter({ storageKey, value, default: initial, min, max, step, label, onChange, className, style }: SplitterProps): ReactNode;
@@ -64,8 +64,8 @@ export interface FilterChipsProps {
64
64
  readonly label: string;
65
65
  }
66
66
  /**
67
- * One of a few filters, as pills; arrow keys move between them, as a radio group does. Chips that do not fit stay on one
68
- * line and scroll sideways; the clipped edge fades, at the start and at the end, only while there is more past it.
67
+ * One of a few filters, as pills; arrow keys move between them, as a radio group does. Chips are never cut off: those
68
+ * that do not fit the row wrap onto the next line, each chip whole.
69
69
  */
70
70
  export declare function FilterChips({ options, value, onChange, label }: FilterChipsProps): ReactNode;
71
71
  export interface Pane {
@@ -78,7 +78,7 @@ export interface PaneSize {
78
78
  readonly width: number;
79
79
  readonly min: number;
80
80
  readonly max: number;
81
- /** The width a double-click or Enter on its splitter puts it back to. */
81
+ /** The width a double-click on its splitter puts it back to. */
82
82
  readonly reset: number;
83
83
  /** The splitter's name, in the app's language ("Resize folders"). */
84
84
  readonly label: string;
@@ -101,7 +101,8 @@ export interface SplitPanesProps {
101
101
  };
102
102
  /**
103
103
  * Sizes for the panes before the last, by index: each one given draws a splitter after its pane where every pane
104
- * shows (the desktop grid). The caller keeps the widths; the last pane takes the rest.
104
+ * shows (the desktop grid). The caller keeps the widths (or the device does, with `storageKey`); the last pane takes
105
+ * the rest.
105
106
  */
106
107
  readonly sizes?: readonly (PaneSize | undefined)[];
107
108
  /** The last pane's least width while splitters move and the window narrows (360 by default). */
@@ -111,6 +112,11 @@ export interface SplitPanesProps {
111
112
  * key ends (`done` true), which is when a width is worth keeping.
112
113
  */
113
114
  readonly onResize?: (index: number, width: number, done: boolean) => void;
115
+ /**
116
+ * Where the widths are remembered on this device (the screen, such as "mail"): each splitter keeps its own under
117
+ * `${storageKey}:${index}`, and the panes open at the widths remembered there. Without one, the caller keeps them.
118
+ */
119
+ readonly storageKey?: string;
114
120
  }
115
121
  /**
116
122
  * The widths the panes take in `room` px: each as wanted within its limits; when the last pane would be under its
@@ -119,12 +125,12 @@ export interface SplitPanesProps {
119
125
  export declare function fitPanes(wanted: readonly PaneSize[], room: number, lastMin: number): number[];
120
126
  /**
121
127
  * Two or three panes side by side (contract `split-panes`), showing fewer as the window narrows. With `sizes`, the
122
- * panes before the last are resizable where all of them show (contract `pane splitter`): each has a splitter, a
123
- * separator dragged by mouse or touch, moved 16 px by the arrow keys, taken to its limits by Home and End, and put back
124
- * by a double-click or Enter. The last pane is never narrower than `lastMin`; as the window narrows the pane nearest it
125
- * gives way first.
128
+ * panes before the last are resizable where all of them show (contract `pane splitter`): each has the kit's one
129
+ * Splitter after it, within the pane's limits and never leaving the last pane under `lastMin`. The last pane is never
130
+ * narrower than `lastMin`; as the window narrows the pane nearest it gives way first. With `storageKey` the widths are
131
+ * remembered on the device; the caller still hears each move through `onResize`.
126
132
  */
127
- export declare function SplitPanes({ panes, active, back, sizes, lastMin, onResize }: SplitPanesProps): ReactNode;
133
+ export declare function SplitPanes({ panes, active, back, sizes, lastMin, onResize, storageKey }: SplitPanesProps): ReactNode;
128
134
  export interface MailRowProps {
129
135
  readonly from: string;
130
136
  readonly subject: string;
@@ -166,9 +172,9 @@ export declare const MAIL_ROW_LABELS: MailRowLabels;
166
172
  * One message in a mailbox's list: who, what, the start of it, when; unread in bold with its dot. Three lines at every
167
173
  * width: the sender and the time, the subject, the preview. The row (`cms-mail-row`, carrying is-unread and
168
174
  * is-selected) holds the open button (`cms-mail-row__open`, aria-current when selected) and, with `check`, the
169
- * checkbox in the avatar's place (`cms-mail-row__check`): shown as the checkbox while the pointer is over the row or
170
- * the focus is within it, while `selecting`, and while checked; the avatar otherwise. The avatar's top is on the
171
- * sender line's top.
175
+ * checkbox in the avatar's place (`cms-mail-row__check`): shown as the checkbox while `selecting` (something is
176
+ * selected), while checked, on keyboard focus within the row, and under a fine pointer's hover; the avatar otherwise,
177
+ * so a touch screen with nothing selected shows every avatar. The avatar's top is on the sender line's top.
172
178
  */
173
179
  export declare function MailRow({ from, subject, preview, time, unread, hasAttachment, selected, onOpen, check, selecting, labels }: MailRowProps): ReactNode;
174
180
  export interface ChatBubbleProps {
package/dist/index.d.ts CHANGED
@@ -12,7 +12,8 @@ export { AppShell, Badge, SearchField, FilterChips, SplitPanes, fitPanes, MailRo
12
12
  export { IncomingCall, CallPanel, CallBar, CALL_LABELS, type CallLabels, type IncomingCallProps, type CallPanelProps, type CallBarProps } from './components/Call.js';
13
13
  export { SignInLayout, SignInForm, SIGN_IN_LABELS, type SignInLabels, type SignInLayoutProps, type SignInFormProps, type SignInFeature } from './components/SignIn.js';
14
14
  export { List, ContextMenu, type ListRow, type ListProps, type MenuItem, type ContextMenuProps } from './components/Collections.js';
15
- export { PaneToolbar, type PaneToolbarAction, type PaneToolbarProps } from './components/PaneToolbar.js';
15
+ export { PaneToolbar, type PaneToolbarAction, type PaneToolbarEntry, type PaneToolbarProps } from './components/PaneToolbar.js';
16
+ export { Splitter, type SplitterProps } from './components/Splitter.js';
16
17
  export { Notification, type NotificationAction, type NotificationProps } from './components/Notification.js';
17
18
  export { offerFor, isCapability, type Capability, type Offer, type OfferOptions } from './server/capability.js';
18
19
  export { readRefusal, refusalText, type Refusal } from './server/refusal.js';