@coolms/ui-react 0.1.0-alpha.1 → 0.1.0-alpha.10

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,9 +2,146 @@
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.10 (2026-11-10)
6
+
7
+ The row of actions at the top of a pane, drawn from the server's action nodes.
8
+
9
+ - `ContextMenu` takes `focus`, the item focused as it opens; `PaneToolbar`'s More opens its menu on the last item with Up.
10
+ - `PaneToolbar`, the contract's `pane-toolbar` (design-tokens develop): the one row of actions at the top of a pane, the
11
+ same height in every pane. It draws the actions it is given, as the server's action nodes give them (id, label, icon,
12
+ group, overflow priority, danger, disabled), and says which was chosen by its id. As the pane narrows every label
13
+ hides at once, then actions go behind More by their overflow priority, never one alone, a priority's actions together.
14
+ One Tab stop, a status at the end.
15
+ - Icons `forward` and `refresh`.
16
+
17
+ ## 0.1.0-alpha.9 (2026-11-09)
18
+
19
+ A quick reply that carries its own controls and decides when it may be sent.
20
+
21
+ - `Composer` takes `leading`, a quick reply's own controls at the start of its last row before Send, and `canSend`,
22
+ which decides whether Send sends in place of the text being non-empty.
23
+
24
+ ## 0.1.0-alpha.8 (2026-11-09)
25
+
26
+ Choosing files a person already has, and a file viewer that keeps to the screen.
27
+
28
+ - Added: `FilePicker`, for choosing files that already exist in the person's spaces, such as Drive, to attach them
29
+ without downloading and uploading them again (contract component `file-picker`). The kit knows no API: the host
30
+ gives the spaces, lists a folder page by page (`list(space, path, cursor?)`), and receives the chosen entries with
31
+ the space and path each was chosen in.
32
+ - The selection holds across folders and spaces; the footer counts all of it, and a chip lists it, with Remove and
33
+ Clear.
34
+ - An optional `budget` (`usedBytes`, `limitBytes`, `cost`) is counted here: what is left after the selection, and
35
+ a file that would go over is disabled with the host's words for it. `disabledReason` adds the host's own reasons.
36
+ Attach is disabled with nothing chosen and while over.
37
+ - A listbox with aria-multiselectable: Up, Down, Home and End move, Enter opens a folder, Space ticks a file,
38
+ Backspace goes up, Escape cancels. The breadcrumb is a navigation landmark. A page further is asked for near the
39
+ end of the list.
40
+ - Loading, empty and error with Retry through `State`; a folder the person may not open (`FilePickerDenied` from
41
+ `list`) is denied in place, the dialog staying open.
42
+ - A dialog of fixed height on a wide screen; the whole screen on a phone, its foot kept at the bottom.
43
+ - `kit.contract.json` does not declare it yet: no released design-tokens version has the entry.
44
+ - Fixed: the file viewer is never wider than the screen. A viewer bar wider than a phone widened the whole overlay;
45
+ now the overlay is one column the screen's width, and the bar scrolls sideways in its place, its controls centred
46
+ while they fit.
47
+ - `Modal` takes `initialFocus`, what takes the focus on opening when it is not the body's first control, and
48
+ `className`, for a component drawn in it that has a layout of its own.
49
+
50
+ ## 0.1.0-alpha.7 (2026-11-08)
51
+
52
+ An icon of its own for the important folder.
53
+
54
+ - Added: the `important` icon, a marker shaped as a label's chevron, for a mail client's important folder. The bell
55
+ stays for notifications alone. The demo's mail folders show it after Starred.
56
+
57
+ ## 0.1.0-alpha.6 (2026-11-08)
58
+
59
+ A file opens over the page, and every place that waits, finds nothing or is refused says so in one way.
60
+
61
+ - Added: `FileViewer`, the overlay a file's adapter goes inside. It draws no file itself.
62
+ - The top bar has Close, the type badge and the name, then the caller's actions (Download, Print, Open separately),
63
+ in a menu on a phone. Edit is there only when the caller passes it.
64
+ - Close leaves the viewer, asking the caller first when there is unsaved work; Done returns from editing.
65
+ Escape closes only while viewing.
66
+ - Focus starts on Close, stays among what is drawn, and returns to what opened the viewer. The page behind does not
67
+ scroll.
68
+ - Arrows, swipes and side buttons move through a set of files. A field, an editor, or anything marked
69
+ `data-viewer-keys` or `data-viewer-gestures` keeps its keys and gestures. A key held with Ctrl, Cmd or Alt is left
70
+ to the browser.
71
+ - Plus, minus and 0 call `onZoom`. The viewer bar, thumbnails and strip hold what the adapter gives.
72
+ - `download`, `print` and `open-separately` join the icons.
73
+ - `kit.contract.json` does not declare it yet: design-tokens v0.7.1 has no entry for it.
74
+ - Added: `State`, for loading, empty, error and denied, at a page's, a card's or a line's size, with the caller's
75
+ title, description and action. Loading shows nothing until `STATE_DELAY_MS` (the `state-delay` token) has passed.
76
+ `elevation-required` is declared not offered, since this kit's clients never elevate.
77
+ - Changed: the kit is checked against design-tokens v0.7.1, from v0.7.0.
78
+
79
+ ## 0.1.0-alpha.5 (2026-11-04)
80
+
81
+ A field is drawn once.
82
+
83
+ - Fixed: `SignInForm`'s inputs carried the class of a field's frame, `cms-field`, so their box (a border, a fixed
84
+ 44px height, padding and a background) fell on the frame of every `TextField`, `Select` and `Toggle` too: each field
85
+ drew two boxes, and its help text ran over the next label. The sign-in inputs are now `cms-signin-form__input`, and
86
+ the frame is a column of label, box and help only. A page that styled the sign-in inputs as `.cms-field` styles
87
+ them as `.cms-signin-form__input`.
88
+
89
+ ## 0.1.0-alpha.4 (2026-11-02)
90
+
91
+ The kit's words come from the app, and the composer leaves an input method's Enter alone.
92
+
93
+ - Added: every word a component says can be given in the app's language, English where it is not.
94
+ - `labels` on `IncomingCall`, `CallPanel` and `CallBar` (`CallLabels`, defaults `CALL_LABELS`);
95
+ - `labels` on `SignInForm` (`SignInLabels`, `SIGN_IN_LABELS`) and `MailRow` (`MailRowLabels`, `MAIL_ROW_LABELS`);
96
+ - `railLabel` on `AppShell`, `readLabel` on `ChatBubble`, `attachLabel` on `Composer`, `closeLabel` on `Modal`
97
+ and `ConfirmDialog`, `dismissLabel` on `Toast` and `retryLabel` on `ErrorBanner`.
98
+ The words that name someone or something take it as an argument (`onCallWith(name)`), so a language can place it.
99
+ - Changed: `AppShell`'s main area is a column: a section in it can fill the height (`flex: 1`), and a lone child does.
100
+ - Fixed: `Composer` no longer sends on Enter while an input method is composing (`isComposing`, or the composing key
101
+ 229 on browsers that do not set it). Typing Chinese, Japanese or Korean, Enter confirms the text.
102
+
103
+ ## 0.1.0-alpha.3 (2026-10-30)
104
+
105
+ The Workspace's components, on design-tokens 0.6.0.
106
+
107
+ - Added: `AppShell` (the dark rail of sections with counts, the top bar with the server, search and account),
108
+ `SearchField`, `Badge`, `FilterChips` (a radio group of pills), `SplitPanes` (two or three labelled panes),
109
+ `MailRow`, `ChatBubble`, `Composer` (chat and quick reply), `IncomingCall`, `CallPanel`, `CallBar`, `SignInLayout`
110
+ and `SignInForm`, and `Icon` with its set of 29 icons.
111
+ - Responsive by design, on the layout's tokens: desktop from 1200px (the full rail, three panes), tablet from 600px
112
+ (an icons-only rail with each section's name as its tooltip, two panes), phone below 600px (a bottom tab bar, one
113
+ pane at a time). `SplitPanes` takes `active`, the pane the person is in, and `back`, a link to the pane before
114
+ it, shown where that pane is hidden; with the selection in the address, the browser's Back agrees. Sign-in fits
115
+ every width, and every control is at least 44px at tablet and phone widths.
116
+ - A navy button keeps a visible 1px edge in dark (`button-chrome-border`).
117
+ - Changed: `Avatar` takes one of six tints from the name (`tintOf`), the same name always the same tint.
118
+ - Added: Inter (`./fonts.css`, SIL Open Font License 1.1) and the token file with the Workspace tokens, both from
119
+ design-tokens 0.6.0, as the lock records.
120
+ - The demo gains a Workspace page per screen (Mail, Chat, Calls, Sign in), light and dark: `demo/workspace.html`.
121
+ Mail shows the mailbox's folders as a tree, never labels. Each screen's place is in its address (`#mail/2` is
122
+ Mail with its third message open).
123
+ - Checks: `check-breakpoints` (every media query width is a breakpoint token) and `check-layout` (every demo screen
124
+ at 1440, 1024, 768 and 390px, light and dark, in headless Chrome: nothing passes the edge or scrolls sideways,
125
+ and no control at touch widths is under 44px).
126
+
127
+ ## 0.1.0-alpha.2 (2026-10-28)
128
+
129
+ The token file is CSS a browser keeps whole.
130
+
131
+ - Fixed: `tokens.css` was a copy of `coolms/design-tokens`' SCSS file. Its first line, a `//` comment, is a comment in
132
+ SCSS but not in CSS, so a browser dropped the whole light `:root` block behind it: in the light theme every
133
+ `--cms-*` token was undefined and the components lost their colours, spacing and radii. It is now a copy of
134
+ `dist/coolms-tokens.css`, the same blocks with a CSS comment header, from `coolms/design-tokens` v0.5.0, pinned in
135
+ `design-tokens.lock.json` with the tag's commit.
136
+ - Added: `tools/check-css.mjs`, copied from v0.5.0 and pinned the same way, runs on the token file in
137
+ `tokens:check`; `tools/check-css-teeth.mjs` makes sure it still fails a `//` header and a missing file.
138
+ - Changed: the README's install line names no version (it named 0.1.0-alpha.1), and says to use 0.1.0-alpha.2 or
139
+ later.
140
+
5
141
  ## 0.1.0-alpha.1 (2026-10-23)
6
142
 
7
- The first pre-release.
143
+ The first pre-release. Published from `develop` at 91f0db3, which has no tag; the package already carries
144
+ `design-tokens.lock.json` (#1).
8
145
 
9
146
  - The 15 components of the CoolMS UI contract, each in every state the contract names. `elevation-required` is not
10
147
  offered.
package/README.md CHANGED
@@ -13,9 +13,13 @@ server helpers are how a React client reads it.
13
13
  ## Install
14
14
 
15
15
  ```bash
16
- npm install @coolms/ui-react@0.1.0-alpha.1
16
+ npm install @coolms/ui-react@VERSION
17
17
  ```
18
18
 
19
+ Replace `VERSION` with the exact version you test with, and pin it; the versions are listed on npm. Use
20
+ `0.1.0-alpha.2` or later: in `0.1.0-alpha.1` the token file's first line is not CSS, so a browser drops its light
21
+ theme and the components lose their colours, spacing and radii.
22
+
19
23
  React 19.2 or later is a peer dependency.
20
24
 
21
25
  ```tsx
@@ -77,8 +81,9 @@ npm run verify
77
81
 
78
82
  runs, in order:
79
83
 
80
- - `tokens:check`: the token file, the contract and its checker are the copies `design-tokens.lock.json` pins, and
81
- every token `kit.css` reads is defined.
84
+ - `tokens:check`: the token file, the contract and the checkers are the copies `design-tokens.lock.json` pins; the
85
+ token file is CSS a browser keeps whole, and the check still fails a `//` header; and every token `kit.css` reads is
86
+ defined.
82
87
  - `check`: `kit.contract.json` covers the contract, and the components and files it names exist.
83
88
  - `typecheck` and `test`.
84
89
  - `build`, then `check:built`: the published module loads, exports every declared component, and every target the
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "repository": "coolms/design-tokens",
3
- "tag": "v0.4.0",
4
- "commit": "c73ce8d220c5b9c821e20646110d6d29a0a077c9",
3
+ "tag": "v0.7.1",
4
+ "commit": "0167cfcaf665e4f785910e7c309ef18fedf61c52",
5
5
  "files": {
6
- "dist/coolms-tokens.scss": {
6
+ "dist/coolms-tokens.css": {
7
7
  "to": "src/tokens/coolms-tokens.css",
8
- "sha256": "d47285d2faea3bb0bd88d8a2c447b4d045535e3f3ba0dcda5d23e7aeb2c47f8b"
8
+ "sha256": "e0b01973324f21b32dc89907d379f3380c47f740e152e471ea4287efee652cc0"
9
9
  },
10
10
  "contract/components.json": {
11
11
  "to": "contract/components.json",
12
- "sha256": "3a21896076d70e96658033eb85173b1a0fc745151a7d4d5c070d882ec7605658"
12
+ "sha256": "61c8d3610cdf9a7685576d8ab891f3be8d3b55bc73716172da15e2ca8b889bd0"
13
13
  },
14
14
  "contract/server-states.json": {
15
15
  "to": "contract/server-states.json",
@@ -17,7 +17,31 @@
17
17
  },
18
18
  "tools/check-kit.mjs": {
19
19
  "to": "tools/check-kit.mjs",
20
- "sha256": "f8407f6accd55eb666eb6bbfe629a10f959c3bf6c62fe8ef2f1fe06a48471a8c"
20
+ "sha256": "c48ac67d267aec11698ab362a8095a355eea8c8775c313d4261be2c60b65d0bb"
21
+ },
22
+ "tools/check-css.mjs": {
23
+ "to": "tools/check-css.mjs",
24
+ "sha256": "231ca006b6e949f9882c98186527e2a974efb5acd60bfb8d05a37d82eae6a678"
25
+ },
26
+ "fonts/inter.css": {
27
+ "to": "src/fonts/inter.css",
28
+ "sha256": "78bea3ce5f8e0209ec80162fd692c138a5628ae37c69b2362a49ba755540b2b1"
29
+ },
30
+ "fonts/inter-latin.woff2": {
31
+ "to": "src/fonts/inter-latin.woff2",
32
+ "sha256": "3100e775e8616cd2611beecfa23a4263d7037586789b43f035236a2e6fbd4c62"
33
+ },
34
+ "fonts/inter-latin-ext.woff2": {
35
+ "to": "src/fonts/inter-latin-ext.woff2",
36
+ "sha256": "34b9c504cab7a73e37b746343a449132e56cf7b5481af2cb81dc74dcff25c956"
37
+ },
38
+ "fonts/inter-cyrillic.woff2": {
39
+ "to": "src/fonts/inter-cyrillic.woff2",
40
+ "sha256": "71d5ee93cc1e9f1d520a3a8b66456de18c7879d8df09d57fcd2eaff75fef0075"
41
+ },
42
+ "fonts/OFL.txt": {
43
+ "to": "src/fonts/OFL.txt",
44
+ "sha256": "262481e844521b326f5ecd053e59b98c8b2da78c8ee1bdbb6e8174305e54935a"
21
45
  }
22
46
  }
23
47
  }
@@ -0,0 +1,71 @@
1
+ import type { ReactNode } from 'react';
2
+ /** The words a call's components say, in the app's language; English by default. */
3
+ export interface CallLabels {
4
+ readonly incomingAudio: string;
5
+ readonly incomingVideo: string;
6
+ /** The incoming card's name for a screen reader: what is ringing, and who calls. */
7
+ readonly incomingFrom: (what: string, name: string) => string;
8
+ readonly accept: string;
9
+ readonly decline: string;
10
+ readonly callWith: (name: string) => string;
11
+ readonly callTime: (duration: string) => string;
12
+ readonly goodConnection: string;
13
+ readonly poorConnection: string;
14
+ readonly you: string;
15
+ readonly speaking: string;
16
+ readonly mute: string;
17
+ readonly unmute: string;
18
+ readonly speaker: string;
19
+ readonly addPerson: string;
20
+ readonly chat: string;
21
+ readonly hangUp: string;
22
+ readonly onCallWith: (name: string) => string;
23
+ readonly returnToCall: string;
24
+ }
25
+ export declare const CALL_LABELS: CallLabels;
26
+ export interface IncomingCallProps {
27
+ /** Who is calling. */
28
+ readonly name: string;
29
+ readonly media: 'audio' | 'video';
30
+ readonly onAccept: () => void;
31
+ readonly onDecline: () => void;
32
+ /** Its words, in the app's language; each left out is English. */
33
+ readonly labels?: Partial<CallLabels>;
34
+ }
35
+ /** 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;
37
+ export interface CallPanelProps {
38
+ readonly name: string;
39
+ /** How long the call has lasted ("04:12"). */
40
+ readonly duration: string;
41
+ /** What the call's statistics say of the connection. */
42
+ readonly connection: 'good' | 'poor';
43
+ /** This account, in the call: its name and whether it is speaking. */
44
+ readonly you: {
45
+ readonly name: string;
46
+ readonly speaking: boolean;
47
+ };
48
+ readonly muted: boolean;
49
+ readonly speaker: boolean;
50
+ readonly onToggleMute: () => void;
51
+ readonly onToggleSpeaker: () => void;
52
+ readonly onAddPerson?: () => void;
53
+ readonly onChat?: () => void;
54
+ readonly onHangUp: () => void;
55
+ /** Its words, in the app's language; each left out is English. */
56
+ readonly labels?: Partial<CallLabels>;
57
+ }
58
+ /** A call in progress: who, how long, how the connection is, and its controls. */
59
+ export declare function CallPanel({ name, duration, connection, you, muted, speaker, onToggleMute, onToggleSpeaker, onAddPerson, onChat, onHangUp, labels }: CallPanelProps): ReactNode;
60
+ export interface CallBarProps {
61
+ readonly name: string;
62
+ readonly duration: string;
63
+ readonly muted: boolean;
64
+ readonly onToggleMute: () => void;
65
+ readonly onReturn: () => void;
66
+ readonly onHangUp: () => void;
67
+ /** Its words, in the app's language; each left out is English. */
68
+ readonly labels?: Partial<CallLabels>;
69
+ }
70
+ /** The call, kept in view while another section is open: who, how long, mute, back to it, hang up. */
71
+ export declare function CallBar({ name, duration, muted, onToggleMute, onReturn, onHangUp, labels }: CallBarProps): ReactNode;
@@ -53,10 +53,12 @@ export interface ContextMenuProps {
53
53
  readonly items: readonly MenuItem[];
54
54
  readonly onClose: () => void;
55
55
  readonly label?: string;
56
+ /** The item focused as it opens: the first, or the last (a menu button opened with Up). */
57
+ readonly focus?: 'first' | 'last';
56
58
  }
57
59
  /**
58
60
  * The selected object's actions (contract component `context-menu`: open, item-danger, item-locked, item-refused).
59
61
  * An item the server withheld is not drawn; a locked one carries its lock; a refused one is shown disabled with the
60
62
  * server's refusal. Escape, a press outside, or a choice closes it, and focus goes back where it was.
61
63
  */
62
- export declare function ContextMenu({ at, items, onClose, label }: ContextMenuProps): ReactNode;
64
+ export declare function ContextMenu({ at, items, onClose, label, focus }: ContextMenuProps): ReactNode;
@@ -1,4 +1,4 @@
1
- import { type ReactNode } from 'react';
1
+ import { type ReactNode, type RefObject } from 'react';
2
2
  /** How long the closing state is drawn before the dialog leaves the page. */
3
3
  export declare const MODAL_CLOSE_MS = 150;
4
4
  export interface ModalProps {
@@ -15,12 +15,18 @@ export interface ModalProps {
15
15
  readonly children: ReactNode;
16
16
  /** The dialog's actions, at its foot. */
17
17
  readonly footer?: ReactNode;
18
+ /** The close button's name, in the app's language ("Close"). */
19
+ readonly closeLabel?: string;
20
+ /** What takes the focus on opening, when it is not the body's first control (a list, say). */
21
+ readonly initialFocus?: RefObject<HTMLElement | null>;
22
+ /** A class for the dialog itself, for a component drawn in it that has a layout of its own. */
23
+ readonly className?: string;
18
24
  }
19
25
  /**
20
26
  * A dialog over the page (contract component `modal`: open, closing, dirty). Focus moves into it on open and back to
21
27
  * where it was on close; Tab stays inside while it is open.
22
28
  */
23
- export declare function Modal({ open, title, onClose, dirty, onDirtyClose, children, footer }: ModalProps): ReactNode;
29
+ export declare function Modal({ open, title, onClose, dirty, onDirtyClose, children, footer, closeLabel, initialFocus, className }: ModalProps): ReactNode;
24
30
  export interface ConfirmDialogProps {
25
31
  readonly open: boolean;
26
32
  readonly title: ReactNode;
@@ -33,8 +39,10 @@ export interface ConfirmDialogProps {
33
39
  /** The confirming button names the outcome ("Delete 3 messages"), never "OK". */
34
40
  readonly confirmLabel?: ReactNode;
35
41
  readonly cancelLabel?: ReactNode;
42
+ /** The close button's name for a screen reader, in the app's language; "Close" where none is given. */
43
+ readonly closeLabel?: string;
36
44
  readonly onConfirm: () => void;
37
45
  readonly onCancel: () => void;
38
46
  }
39
47
  /** A question before a destructive or irreversible action (contract component `confirm-dialog`: default, danger, discard-changes). */
40
- export declare function ConfirmDialog({ open, title, message, kind, confirmLabel, cancelLabel, onConfirm, onCancel }: ConfirmDialogProps): ReactNode;
48
+ export declare function ConfirmDialog({ open, title, message, kind, confirmLabel, cancelLabel, closeLabel, onConfirm, onCancel }: ConfirmDialogProps): ReactNode;
@@ -0,0 +1,83 @@
1
+ import { type ReactNode } from 'react';
2
+ /** A space the person may read, such as their Drive or a shared space. */
3
+ export interface FilePickerSpace {
4
+ readonly id: string;
5
+ readonly name: string;
6
+ }
7
+ /** One entry of a folder, as the host lists it: a folder opens, a file can be chosen. */
8
+ export interface FilePickerEntry {
9
+ readonly id: string;
10
+ readonly name: string;
11
+ readonly kind: 'folder' | 'file';
12
+ readonly size?: number | null;
13
+ readonly mimeType?: string | null;
14
+ }
15
+ /** One page of a folder; `next` when more follow. */
16
+ export interface FilePickerPage {
17
+ readonly entries: readonly FilePickerEntry[];
18
+ readonly next?: string | null;
19
+ }
20
+ /** A chosen file, with the space and folder it was chosen in, so the host needs no second lookup. */
21
+ export interface FilePickerChoice extends FilePickerEntry {
22
+ readonly space: string;
23
+ readonly path: string;
24
+ }
25
+ /** What the host has spent of a limit before this choice; `cost` is what a file adds against it, its size by default. */
26
+ export interface FilePickerBudget {
27
+ readonly usedBytes: number;
28
+ readonly limitBytes: number;
29
+ readonly cost?: (entry: FilePickerEntry) => number;
30
+ }
31
+ /** A folder the person may not open: thrown by `list`, it is shown as denied in place. Anything else is an error. */
32
+ export declare class FilePickerDenied extends Error {
33
+ constructor(message?: string);
34
+ }
35
+ /** The picker's words, in the host's language. */
36
+ export interface FilePickerLabels {
37
+ readonly title: string;
38
+ readonly close: string;
39
+ readonly cancel: string;
40
+ /** The confirm action, carrying the count: "Attach 3 files". */
41
+ readonly confirm: (count: number) => string;
42
+ readonly space: string;
43
+ readonly path: string;
44
+ readonly up: string;
45
+ readonly files: string;
46
+ /** "3 selected", on the chip that lists the selection. */
47
+ readonly selected: (count: number) => string;
48
+ readonly clear: string;
49
+ readonly remove: (name: string) => string;
50
+ /** The whole selection: "3 files, 2.1 MB". */
51
+ readonly total: (count: number, size: string) => string;
52
+ /** With a budget: "1.2 MB of 25 MB left after these". */
53
+ readonly left: (left: string, limit: string) => string;
54
+ /** Why a file is not offered, or the selection cannot be sent: it would go over the limit. */
55
+ readonly overBudget: string;
56
+ readonly loading: string;
57
+ readonly empty: string;
58
+ readonly error: string;
59
+ readonly retry: string;
60
+ readonly denied: string;
61
+ }
62
+ export interface FilePickerProps {
63
+ readonly open: boolean;
64
+ /** The spaces the person may read, in the host's order; the first is shown first. With one, no switch is drawn. */
65
+ readonly spaces: readonly FilePickerSpace[];
66
+ /** One page of a folder of a space, in the host's order. Throws FilePickerDenied for a folder the person may not open. */
67
+ readonly list: (space: string, path: string, cursor?: string) => Promise<FilePickerPage>;
68
+ /** The host's own reason a file cannot be chosen (not readable, a type it will not send), or nothing. */
69
+ readonly disabledReason?: (entry: FilePickerEntry) => string | null | undefined;
70
+ readonly budget?: FilePickerBudget;
71
+ /** A size as the host says it, in the person's language. */
72
+ readonly formatSize: (bytes: number) => string;
73
+ readonly labels: FilePickerLabels;
74
+ readonly onConfirm: (chosen: readonly FilePickerChoice[]) => void;
75
+ readonly onCancel: () => void;
76
+ }
77
+ /**
78
+ * Choosing files a person already has, in their spaces (contract component `file-picker`). The kit knows no API: the
79
+ * host lists folders page by page and receives the chosen entries. The selection holds across folders and spaces; a
80
+ * budget, when given, is counted here, so every host disables the same files. Enter opens a folder, Space ticks a file,
81
+ * Backspace goes up, Escape cancels.
82
+ */
83
+ export declare function FilePicker(props: FilePickerProps): ReactNode;
@@ -0,0 +1,63 @@
1
+ import { type ReactNode } from 'react';
2
+ /** One of the top bar's file actions, as Download, Print and Open separately are: the caller's words and handler. */
3
+ export interface FileViewerAction {
4
+ readonly label: string;
5
+ readonly icon: ReactNode;
6
+ readonly onSelect: () => void;
7
+ }
8
+ /** The other files of a set, for previous and next. A side with no handler is that end of the list. */
9
+ export interface FileViewerSiblings {
10
+ readonly position: string;
11
+ readonly index: number;
12
+ readonly total: number;
13
+ readonly previousLabel: string;
14
+ readonly nextLabel: string;
15
+ readonly onPrevious?: () => void;
16
+ readonly onNext?: () => void;
17
+ }
18
+ /** The editing state: the content hosts the type's own editor, and the viewer has none of its own. */
19
+ export interface FileViewerEditing {
20
+ readonly status: ReactNode;
21
+ readonly doneLabel: string;
22
+ readonly onDone: () => void;
23
+ /** It holds unsaved work: Close calls onDirtyClose, which asks the person, rather than closing. */
24
+ readonly dirty?: boolean;
25
+ readonly onDirtyClose: () => void;
26
+ }
27
+ export interface FileViewerProps {
28
+ /** The file's name: the dialog's name, truncated where it does not fit, with the whole of it available. */
29
+ readonly name: string;
30
+ /** The file type's badge. */
31
+ readonly badge: ReactNode;
32
+ readonly closeLabel: string;
33
+ readonly onClose: () => void;
34
+ /** Download, Print and Open separately, as the file allows, in that order. */
35
+ readonly actions?: readonly FileViewerAction[];
36
+ /** The name of the menu holding the actions on a phone. */
37
+ readonly moreLabel?: string;
38
+ /** Only with the server's write permission for this file: absent, never disabled, without it. */
39
+ readonly edit?: {
40
+ readonly label: string;
41
+ readonly icon: ReactNode;
42
+ readonly onEdit: () => void;
43
+ };
44
+ readonly editing?: FileViewerEditing;
45
+ readonly siblings?: FileViewerSiblings;
46
+ /** What the viewer bar holds, from the adapter: page, zoom, fit. It never holds a file action. */
47
+ readonly bar?: ReactNode;
48
+ /** A paged file's pages, at a wide width. */
49
+ readonly thumbnails?: ReactNode;
50
+ /** A set of attachments, along the foot above the viewer bar at a wide width. */
51
+ readonly strip?: ReactNode;
52
+ /** Plus, minus and 0, where the adapter has zoom. */
53
+ readonly onZoom?: (how: 'in' | 'out' | 'reset') => void;
54
+ /** The adapter: it scrolls inside itself, and the overlay never scrolls as a document. */
55
+ readonly children: ReactNode;
56
+ }
57
+ /**
58
+ * One way to look at a file (contract component `file-viewer`): over the page, dark whatever the scheme, with an
59
+ * adapter in the content. Close leaves the whole viewer, asking first with unsaved changes; Done returns from editing
60
+ * to viewing. Escape closes only while viewing: while editing it belongs to the editor. Focus starts on Close, stays
61
+ * inside, and returns to what opened it.
62
+ */
63
+ export declare function FileViewer(props: FileViewerProps): ReactNode;
@@ -0,0 +1,19 @@
1
+ import type { ReactNode } from 'react';
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';
4
+ export interface IconProps {
5
+ readonly name: IconName;
6
+ readonly size?: number;
7
+ /** Only for an icon that stands alone and carries meaning; an icon beside its text is decorative. */
8
+ readonly label?: string;
9
+ }
10
+ /** An icon from the Workspace's set; decorative unless given a label. */
11
+ export declare function Icon({ name, size, label }: IconProps): ReactNode;
12
+ export declare const ICON_NAMES: readonly IconName[];
13
+ /**
14
+ * The server's action icons, named as Bootstrap Icons names them, to the kit's own: the one table that turns a node's
15
+ * icon into what the kit draws. A name not here has no icon, and its action shows its label alone.
16
+ */
17
+ export declare const BOOTSTRAP_ICONS: Readonly<Record<string, IconName>>;
18
+ /** The kit's icon for a server's (Bootstrap Icons) name; null for a name the table does not hold. */
19
+ export declare function iconForName(name: string): IconName | null;
@@ -0,0 +1,48 @@
1
+ import { type ReactNode } from 'react';
2
+ /**
3
+ * One action of a pane's row, as the server's action node gives it: which actions exist, their order, groups, icons and
4
+ * danger are the server's; the row draws them and says which was chosen.
5
+ */
6
+ export interface PaneToolbarAction {
7
+ readonly id: string;
8
+ /** Its icon by its Bootstrap Icons name, as the server names it; one the kit's table lacks leaves its label alone. */
9
+ readonly icon: string;
10
+ /** Its accessible name always, its tooltip once labels hide. */
11
+ readonly label: string;
12
+ /** Actions of one group sit together, groups in the order their first action comes; a separator between two. */
13
+ readonly group: string;
14
+ /**
15
+ * When it goes behind ... as the row narrows: lower first; actions of the same priority go together (a toggle's
16
+ * pair). Without one it is pinned: it never goes behind ....
17
+ */
18
+ readonly overflow?: number;
19
+ /** Shown, kept in the focus order, and doing nothing when chosen; `reason` is its tooltip. */
20
+ readonly disabled?: boolean;
21
+ readonly reason?: string;
22
+ /** Its work is under way: a spinner in its icon's place after a moment, and a second press runs nothing. */
23
+ readonly busy?: boolean;
24
+ /** The delete kind: drawn as danger, the only action that is. */
25
+ readonly danger?: boolean;
26
+ }
27
+ export interface PaneToolbarProps {
28
+ /** The toolbar's accessible name, in the host's words ("Message actions"). */
29
+ readonly label: string;
30
+ /** The actions in their order; the host passes only those it has a handler for. */
31
+ readonly actions: readonly PaneToolbarAction[];
32
+ /** An action was chosen, in the row or behind ...; never for a disabled or busy one. */
33
+ readonly onAction: (id: string) => void;
34
+ /** The trailing status, formatted by the host ("Synced at 14:32"); truncated with its whole text as its title. */
35
+ readonly status?: string;
36
+ /** The ... button's accessible name and tooltip, from the host's catalogue ("More actions"). */
37
+ readonly moreLabel: string;
38
+ /** Navigation that leads the row where one pane shows at a time (Back): before the first group, never behind .... */
39
+ readonly leading?: ReactNode;
40
+ }
41
+ /**
42
+ * The one row of actions at the top of a pane (contract component `pane-toolbar`: default, labels-hidden, overflowing,
43
+ * menu-open, with-status, action-disabled, action-busy, phone). It is measured on its own width as its pane resizes:
44
+ * every label shows while all fit; then every label hides at once; then actions go behind ... in the overflow order,
45
+ * the fewest that let the rest and ... fit, never one alone; they come back in the reverse order, and the labels once
46
+ * every action is back and all of them fit. One Tab stop; Left and Right, Home and End move inside it.
47
+ */
48
+ export declare function PaneToolbar({ label, actions, onAction, status, moreLabel, leading }: PaneToolbarProps): ReactNode;
@@ -0,0 +1,46 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type IconName } from './Icon';
3
+ export interface SignInFeature {
4
+ readonly icon: IconName;
5
+ readonly label: string;
6
+ }
7
+ export interface SignInLayoutProps {
8
+ /** The brand mark: one letter, or an image. */
9
+ readonly mark: ReactNode;
10
+ readonly product: string;
11
+ readonly headline: string;
12
+ readonly lead: string;
13
+ readonly features?: readonly SignInFeature[];
14
+ /** The form, on the light side. */
15
+ readonly children: ReactNode;
16
+ }
17
+ /** The one sign-in page of the admin and the Workspace: the brand on the dark side, the form on the light side. */
18
+ export declare function SignInLayout({ mark, product, headline, lead, features, children }: SignInLayoutProps): ReactNode;
19
+ export interface SignInFormProps {
20
+ /** The server signed in to, as its host. */
21
+ readonly server: string;
22
+ readonly onSubmit: (identifier: string, password: string) => void;
23
+ readonly forgotHref?: string;
24
+ readonly createHref?: string;
25
+ /** The server's refusal, in its words. */
26
+ readonly error?: string;
27
+ readonly busy?: boolean;
28
+ /** Its words, in the app's language; each left out is English. */
29
+ readonly labels?: Partial<SignInLabels>;
30
+ }
31
+ /** The words the sign-in form says, in the app's language; English by default. */
32
+ export interface SignInLabels {
33
+ readonly title: string;
34
+ readonly identifier: string;
35
+ readonly identifierPlaceholder: string;
36
+ readonly password: string;
37
+ readonly show: string;
38
+ readonly hide: string;
39
+ readonly forgot: string;
40
+ readonly submit: string;
41
+ readonly newHere: string;
42
+ readonly create: string;
43
+ }
44
+ export declare const SIGN_IN_LABELS: SignInLabels;
45
+ /** Signing in with an identifier and a password; the password can be shown while typed. */
46
+ export declare function SignInForm({ server, onSubmit, forgotHref, createHref, error, busy, labels }: SignInFormProps): ReactNode;
@@ -0,0 +1,31 @@
1
+ import { type ReactNode } from 'react';
2
+ /**
3
+ * What a page, a card or a line of text shows instead of its content. `elevation-required` is not offered here: the
4
+ * clients this kit serves never elevate (kit.contract.json, notOffered).
5
+ */
6
+ export type StateKind = 'loading' | 'empty' | 'error' | 'denied';
7
+ /** page: centred in the content area; block: centred in its card; inline: small, beside text. */
8
+ export type StatePlacement = 'page' | 'block' | 'inline';
9
+ export interface StateProps {
10
+ readonly kind: StateKind;
11
+ /** What the state is, in the caller's words. */
12
+ readonly title: string;
13
+ /** Why, or what to do, in the caller's words. */
14
+ readonly description?: string;
15
+ /** One thing to do about it: Retry for an error, say. Its label is the caller's word too. A refusal offers none. */
16
+ readonly action?: {
17
+ readonly label: string;
18
+ readonly onAction: () => void;
19
+ };
20
+ readonly placement?: StatePlacement;
21
+ }
22
+ /** How long a loading state shows nothing, so a read answered sooner does not flash: the `state-delay` token. */
23
+ export declare const STATE_DELAY_MS = 300;
24
+ /**
25
+ * One component for every state instead of content (contract component `state`: loading, empty, error, denied, page,
26
+ * block, inline, with-action, delayed). It shows the caller's title and description as given and adds no words of
27
+ * its own beyond its action's label. Every kind is a polite status; loading shows nothing at all -- neither spinner
28
+ * nor title -- until the state delay has passed, then both together, while its title is in the live region from the
29
+ * start, visually hidden.
30
+ */
31
+ export declare function State({ kind, title, description, action, placement }: StateProps): ReactNode;