@coolms/ui-react 0.1.0-alpha.29 → 0.1.0-alpha.30
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 +10 -0
- package/design-tokens.lock.json +4 -4
- package/dist/components/FilePicker.d.ts +8 -0
- package/dist/components/Icon.d.ts +1 -1
- package/dist/components/SectionHeader.d.ts +42 -0
- package/dist/components/Workspace.d.ts +26 -4
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1231 -1104
- package/kit.contract.json +1 -0
- package/package.json +1 -1
- package/src/kit.css +30 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
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.30 (2026-11-24)
|
|
6
|
+
|
|
7
|
+
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.
|
|
8
|
+
|
|
9
|
+
- `SectionHeader` draws the components contract's `section-header` (design tokens v0.23.0, contract 0.16.0): the head of a section from tablet width up. Row 1: the declared title, then the primary action (icon and label, always shown; a split button with a menu when it has entries) and More for the section's other actions, a refused one kept with the server's reason. Row 2: the context (a mailbox card, filters, breadcrumbs), only when given. No divider lines; `fullWidth` spans a one-column page.
|
|
10
|
+
- `FilePicker` restarts a folder whose page link is no longer valid (contract 0.15.0, `file-picker`): `list` throws the new `FilePickerRestart` for the server's declared problem (`/errors/page-link-invalid`, 409), and the picker reads the folder's first page again, once, the selection kept. A second restart before a next page is read is the error with Retry, so a server that keeps refusing cannot loop. Any other refusal is as before.
|
|
11
|
+
- `MailRow` carries the components contract's avatar checkbox (`list`, part avatar checkbox): with `check`, the avatar is the row's checkbox (`cms-mail-row__check`), shown as the checkbox while the pointer is over the row or the focus is within it, while `selecting` and while checked; a real checkbox named by `check.label`, whose click, tap or Space calls `check.onCheck` with Shift and Ctrl/Cmd and never opens the row. The row is now a container (`cms-mail-row`, carrying is-unread, is-selected, is-selecting, is-checked) holding the open button (`cms-mail-row__open`, aria-current when selected). Without `check`, the avatar alone, as before.
|
|
12
|
+
- `MailRow`'s unread dot never shrinks beside a long subject.
|
|
13
|
+
- Design tokens v0.24.0 (icon contract 0.9.0): the `plus-lg`, `gear` and `upload` icons draw as `plus`, the new `settings` glyph and `upload`.
|
|
14
|
+
|
|
5
15
|
## 0.1.0-alpha.29 (2026-11-23)
|
|
6
16
|
|
|
7
17
|
Filter chips on one line with a fade while more is past the edge; check:package in the release checks.
|
package/design-tokens.lock.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"repository": "coolms/design-tokens",
|
|
3
|
-
"tag": "v0.
|
|
4
|
-
"commit": "
|
|
3
|
+
"tag": "v0.24.0",
|
|
4
|
+
"commit": "cc021e696d1b109703ef02c766cf1b42528580b4",
|
|
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": "
|
|
12
|
+
"sha256": "e76e4f7a20d91215e5277bde3c02ecc7a620a965a713870786ba1fcf8810a281"
|
|
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": "
|
|
48
|
+
"sha256": "86c7c3074922b99fc2b398fe14ac3a1ed5efe74446acb2ffd578b7e0409dafa0"
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -32,6 +32,14 @@ export interface FilePickerBudget {
|
|
|
32
32
|
export declare class FilePickerDenied extends Error {
|
|
33
33
|
constructor(message?: string);
|
|
34
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* A next page the server refused because its page link is no longer valid (its declared problem,
|
|
37
|
+
* /errors/page-link-invalid, 409): thrown by `list`, the folder is read again from its first page, once, the selection
|
|
38
|
+
* kept. Throw it for that problem only; any other refusal is an error.
|
|
39
|
+
*/
|
|
40
|
+
export declare class FilePickerRestart extends Error {
|
|
41
|
+
constructor(message?: string);
|
|
42
|
+
}
|
|
35
43
|
/** The picker's words, in the host's language. */
|
|
36
44
|
export interface FilePickerLabels {
|
|
37
45
|
readonly title: string;
|
|
@@ -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';
|
|
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';
|
|
4
4
|
export interface IconProps {
|
|
5
5
|
readonly name: IconName;
|
|
6
6
|
readonly size?: number;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type MenuItem } from './Collections.js';
|
|
3
|
+
import { type IconName } from './Icon.js';
|
|
4
|
+
import type { Offer } from '../server/capability.js';
|
|
5
|
+
/** The section's primary action: one action, or a split button whose menu lists the action's declared entries. */
|
|
6
|
+
export type SectionPrimary = {
|
|
7
|
+
readonly label: string;
|
|
8
|
+
readonly icon: IconName;
|
|
9
|
+
readonly onPress: () => void;
|
|
10
|
+
readonly offer?: Offer;
|
|
11
|
+
} | {
|
|
12
|
+
readonly label: string;
|
|
13
|
+
readonly icon: IconName;
|
|
14
|
+
readonly onPress: () => void;
|
|
15
|
+
readonly offer?: Offer;
|
|
16
|
+
readonly menu: readonly MenuItem[];
|
|
17
|
+
/** The split menu button's accessible name. */
|
|
18
|
+
readonly menuLabel: string;
|
|
19
|
+
};
|
|
20
|
+
export interface SectionHeaderProps {
|
|
21
|
+
/** The section's declared title. */
|
|
22
|
+
readonly title: string;
|
|
23
|
+
/** An icon before the title. */
|
|
24
|
+
readonly icon?: IconName;
|
|
25
|
+
/** Given only when the section declares one. */
|
|
26
|
+
readonly primary?: SectionPrimary;
|
|
27
|
+
/** The section's other declared actions, in the tree's order; a refused one stays, with the server's reason. */
|
|
28
|
+
readonly more?: readonly MenuItem[];
|
|
29
|
+
/** More's accessible name and tooltip, from the host's catalogue. */
|
|
30
|
+
readonly moreLabel: string;
|
|
31
|
+
/** Row 2: the section's context (a mailbox card, filters, breadcrumbs); with none, no row 2. */
|
|
32
|
+
readonly context?: ReactNode;
|
|
33
|
+
/** The header spans a one-column page. */
|
|
34
|
+
readonly fullWidth?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The head of a section from tablet width up (contract component `section-header`: default, with-primary,
|
|
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.
|
|
41
|
+
*/
|
|
42
|
+
export declare function SectionHeader({ title, icon, primary, more, moreLabel, context, fullWidth }: SectionHeaderProps): ReactNode;
|
|
@@ -135,6 +135,25 @@ export interface MailRowProps {
|
|
|
135
135
|
readonly hasAttachment?: boolean;
|
|
136
136
|
readonly selected?: boolean;
|
|
137
137
|
readonly onOpen: () => void;
|
|
138
|
+
/**
|
|
139
|
+
* The row's checkbox, in the avatar's place (contract list, part avatar checkbox); with none, the avatar alone (a
|
|
140
|
+
* row the host does not let be checked). `label` is its accessible name, in the host's
|
|
141
|
+
* words: "Select: {sender}, {subject}". `onCheck` is called for a click, a tap and Space alike, with Shift and with
|
|
142
|
+
* Ctrl/Cmd (`toggle`), and the row is never opened by it. `pending`: the check is on its way, the box busy and not
|
|
143
|
+
* pressable; `disabled`: it cannot be checked now.
|
|
144
|
+
*/
|
|
145
|
+
readonly check?: {
|
|
146
|
+
readonly checked: boolean;
|
|
147
|
+
readonly onCheck: (e: {
|
|
148
|
+
readonly shift: boolean;
|
|
149
|
+
readonly toggle: boolean;
|
|
150
|
+
}) => void;
|
|
151
|
+
readonly label: string;
|
|
152
|
+
readonly pending?: boolean;
|
|
153
|
+
readonly disabled?: boolean;
|
|
154
|
+
};
|
|
155
|
+
/** Something in the list is checked: every row shows its checkbox, until nothing is. */
|
|
156
|
+
readonly selecting?: boolean;
|
|
138
157
|
/** Its words for assistive technology, in the app's language; each left out is English. */
|
|
139
158
|
readonly labels?: Partial<MailRowLabels>;
|
|
140
159
|
}
|
|
@@ -144,11 +163,14 @@ export interface MailRowLabels {
|
|
|
144
163
|
}
|
|
145
164
|
export declare const MAIL_ROW_LABELS: MailRowLabels;
|
|
146
165
|
/**
|
|
147
|
-
* One message in a mailbox's list: who, what, the start of it, when; unread in bold with its dot.
|
|
148
|
-
*
|
|
149
|
-
*
|
|
166
|
+
* 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
|
+
* width: the sender and the time, the subject, the preview. The row (`cms-mail-row`, carrying is-unread and
|
|
168
|
+
* 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.
|
|
150
172
|
*/
|
|
151
|
-
export declare function MailRow({ from, subject, preview, time, unread, hasAttachment, selected, onOpen, labels }: MailRowProps): ReactNode;
|
|
173
|
+
export declare function MailRow({ from, subject, preview, time, unread, hasAttachment, selected, onOpen, check, selecting, labels }: MailRowProps): ReactNode;
|
|
152
174
|
export interface ChatBubbleProps {
|
|
153
175
|
/** Received from someone else, or sent by this account. */
|
|
154
176
|
readonly direction: 'in' | 'out';
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,8 @@ export { Modal, ConfirmDialog, MODAL_CLOSE_MS, type ModalProps, type ConfirmDial
|
|
|
4
4
|
export { Toast, ToastRegion, Loading, EmptyState, ErrorBanner, type ToastProps, type LoadingProps, type EmptyStateProps, type ErrorBannerProps } from './components/Status.js';
|
|
5
5
|
export { State, STATE_DELAY_MS, type StateKind, type StatePlacement, type StateProps } from './components/State.js';
|
|
6
6
|
export { FileViewer, type FileViewerAction, type FileViewerConflict, type FileViewerEditing, type FileViewerProps, type FileViewerSiblings, type FileViewerState } from './components/FileViewer.js';
|
|
7
|
-
export { FilePicker, FilePickerDenied, type FilePickerBudget, type FilePickerChoice, type FilePickerEntry, type FilePickerLabels, type FilePickerPage, type FilePickerProps, type FilePickerSpace } from './components/FilePicker.js';
|
|
7
|
+
export { FilePicker, FilePickerDenied, FilePickerRestart, type FilePickerBudget, type FilePickerChoice, type FilePickerEntry, type FilePickerLabels, type FilePickerPage, type FilePickerProps, type FilePickerSpace } from './components/FilePicker.js';
|
|
8
|
+
export { SectionHeader, type SectionHeaderProps, type SectionPrimary } from './components/SectionHeader.js';
|
|
8
9
|
export { PageHeader, TabStrip, Avatar, initialsOf, tintOf, type PageHeaderProps, type Tab, type TabStripProps, type AvatarProps, type AvatarPresence, type AvatarConnection } from './components/Structure.js';
|
|
9
10
|
export { Icon, ICON_NAMES, BOOTSTRAP_ICONS, NamedIcon, iconForName, type IconName, type IconProps } from './components/Icon.js';
|
|
10
11
|
export { AppShell, Badge, SearchField, FilterChips, SplitPanes, fitPanes, MailRow, ChatBubble, Composer, MAIL_ROW_LABELS, type MailRowLabels, type AppShellProps, type RailItem, type BadgeProps, type SearchFieldProps, type FilterChipsProps, type FilterOption, type SplitPanesProps, type PaneSize, type Pane, type MailRowProps, type ChatBubbleProps, type ComposerProps } from './components/Workspace.js';
|