@coolms/ui-react 0.1.0-alpha.3 → 0.1.0-alpha.31
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 +282 -4
- package/design-tokens.lock.json +10 -6
- package/dist/components/Button.d.ts +6 -3
- package/dist/components/Call.d.ts +33 -3
- package/dist/components/Collections.d.ts +15 -6
- package/dist/components/Dialogs.d.ts +11 -3
- package/dist/components/Fields.d.ts +48 -4
- package/dist/components/FilePicker.d.ts +91 -0
- package/dist/components/FileViewer.d.ts +106 -0
- package/dist/components/Icon.d.ts +18 -1
- package/dist/components/Notification.d.ts +38 -0
- package/dist/components/PaneToolbar.d.ts +77 -0
- package/dist/components/ScreenShell.d.ts +71 -0
- package/dist/components/SectionHeader.d.ts +43 -0
- package/dist/components/SignIn.d.ts +18 -2
- package/dist/components/Splitter.d.ts +38 -0
- package/dist/components/State.d.ts +33 -0
- package/dist/components/Status.d.ts +6 -2
- package/dist/components/Structure.d.ts +22 -4
- package/dist/components/Workspace.d.ts +102 -11
- package/dist/components/internal.d.ts +2 -0
- package/dist/components/pull.d.ts +21 -0
- package/dist/index.d.ts +24 -15
- package/dist/index.js +1993 -678
- package/kit.contract.json +15 -5
- package/package.json +9 -5
- package/src/kit.css +314 -34
- package/src/tokens/coolms-tokens.css +24 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,286 @@
|
|
|
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.31 (2026-11-24)
|
|
6
|
+
|
|
7
|
+
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.
|
|
8
|
+
|
|
9
|
+
- `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)`.
|
|
10
|
+
- `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.
|
|
11
|
+
- `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.
|
|
12
|
+
- `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`).
|
|
13
|
+
- 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.
|
|
14
|
+
- `SectionHeader` draws a plain primary, with no menu half, when its menu has no entry to show (empty, or every entry not offered).
|
|
15
|
+
- `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.
|
|
16
|
+
- The `hash` icon (the number sign, for browsing channels) draws as the kit's new `hash` glyph.
|
|
17
|
+
- `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.
|
|
18
|
+
- `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.
|
|
19
|
+
- 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.
|
|
20
|
+
- 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.
|
|
21
|
+
|
|
22
|
+
## 0.1.0-alpha.30 (2026-11-24)
|
|
23
|
+
|
|
24
|
+
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.
|
|
25
|
+
|
|
26
|
+
- `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.
|
|
27
|
+
- `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.
|
|
28
|
+
- `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.
|
|
29
|
+
- `MailRow`'s unread dot never shrinks beside a long subject.
|
|
30
|
+
- 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`.
|
|
31
|
+
|
|
32
|
+
## 0.1.0-alpha.29 (2026-11-23)
|
|
33
|
+
|
|
34
|
+
Filter chips on one line with a fade while more is past the edge; check:package in the release checks.
|
|
35
|
+
|
|
36
|
+
- `FilterChips` draws the components contract's `filter-chips` entry (design tokens v0.20.0, contract 0.13.0): chips that do not fit stay on one line and scroll sideways, the scrollbar hidden; the clipped edge fades at the start and at the end only while there is more past it, measured from the scroll; a chip reached by key, or chosen while partly clipped, scrolls fully into view. Before, the chips wrapped onto more lines.
|
|
37
|
+
- Design tokens v0.20.0.
|
|
38
|
+
|
|
39
|
+
- `check:package`, in `verify` after `check:types-resolution`: the package as it would be published (packed without scripts), read by Are The Types Wrong (`@arethetypeswrong/cli`, its esm-only profile, the three stylesheet exports left out) and `publint` (strict); a problem either reports fails it. Both are dev dependencies, pinned.
|
|
40
|
+
- The repository url in `package.json` is the full git url (`git+https://`), as publint suggests.
|
|
41
|
+
|
|
42
|
+
## 0.1.0-alpha.28 (2026-11-23)
|
|
43
|
+
|
|
44
|
+
Declarations that resolve under node16 and nodenext.
|
|
45
|
+
|
|
46
|
+
- The published declarations resolve under `moduleResolution` `node16` and `nodenext`: the declaration build uses NodeNext, so every relative import in the `.d.ts` files carries its `.js` extension. Before, an ESM project with nodenext resolution got every export as `any` (#53).
|
|
47
|
+
- `check:types-resolution`, in `verify`: the built package read by an ESM project with nodenext resolution and its declarations checked; any error, or an export that comes through as `any`, fails it.
|
|
48
|
+
|
|
49
|
+
## 0.1.0-alpha.27 (2026-11-23)
|
|
50
|
+
|
|
51
|
+
Design tokens v0.19.0: two icon names drawn for the workspace, and the empty pane's icon.
|
|
52
|
+
|
|
53
|
+
- `State`: the empty kind takes an optional `icon` (a name from the icon list, as the server's nodes give it), drawn above the title, decorative, 32px on a page and 24px elsewhere; a name the kit does not draw leaves no box.
|
|
54
|
+
- Design tokens v0.19.0: the icon list 0.8.0 names `chat-dots` and `folder2-open` for the workspace too, and the kit draws them as `chat` and `folder`; the components contract 0.12.0 (pane header row, list selection), with `settings-shell` not offered until a screen of the kit draws a settings layout.
|
|
55
|
+
|
|
56
|
+
## 0.1.0-alpha.26 (2026-11-23)
|
|
57
|
+
|
|
58
|
+
Mail rows back to three lines at every width, on design tokens v0.14.0.
|
|
59
|
+
|
|
60
|
+
- Design tokens v0.14.0 (#102): `--cms-list-row-height-three-line` (84px), and the `state` entry's optional icon and empty pane part.
|
|
61
|
+
- `MailRow` back to three lines at every width (the sender and the time; the subject, with the unread dot; the preview), at least `--cms-list-row-height-three-line` (84px): .875, .8125 and .75rem at line-height 1.5, 2px apart, 10px above and below. The compact density heights stay for the other lists. The two-line desktop row and the phone's own rule of alpha.25 are gone.
|
|
62
|
+
|
|
63
|
+
## 0.1.0-alpha.25 (2026-11-22)
|
|
64
|
+
|
|
65
|
+
Mail rows at the list density tokens: two lines from tablet width up, three on a phone.
|
|
66
|
+
|
|
67
|
+
- `MailRow` by the list density rule: from tablet width up two lines (the sender and the time; the subject, then the muted preview on one cut line) at `--cms-list-row-height-two-line`; on a phone three lines from `--cms-list-row-height-phone-two-line`. The row's height is the token's, its padding only centres it.
|
|
68
|
+
|
|
69
|
+
## 0.1.0-alpha.24 (2026-11-22)
|
|
70
|
+
|
|
71
|
+
Design tokens v0.13.0: the list density tokens, the list's density and columns parts, and the served icon list 0.7.0, every Workspace name in it drawn by the kit.
|
|
72
|
+
|
|
73
|
+
- Design tokens v0.13.0 (a3767861cd02baaf26980596179bab8815e7a66a), from v0.11.0: the list density tokens (`list-row-height` 40px and `list-row-height-two-line` 52px from tablet width up, `list-row-height-phone` 48px and `list-row-height-phone-two-line` 60px at phone width), the list contract's `density` and `columns` parts, and `contract/icons.json` 0.7.0 (111 names, 31 for the Workspace).
|
|
74
|
+
- `iconForName`: the names the Drive sections and the Chat composer trees add for the Workspace (icons list 0.7.0): `file-earmark-text` (file), `folder2` (folder), `images` (image) and `paperclip`.
|
|
75
|
+
|
|
76
|
+
## 0.1.0-alpha.23 (2026-11-21)
|
|
77
|
+
|
|
78
|
+
A tap that opens a view no longer folds the screen shell's bar.
|
|
79
|
+
|
|
80
|
+
- `ScreenShell` `bar-hidden`: a reader's input counts only for a scroll of the element it was aimed at (its target inside it, or a key aimed at the whole page). A tap that opens a view, such as a conversation that then scrolls to its latest message, no longer folds the bar.
|
|
81
|
+
|
|
82
|
+
## 0.1.0-alpha.22 (2026-11-21)
|
|
83
|
+
|
|
84
|
+
The screen shell's bar steps aside only for the reader's own scroll, never for a scroll the host makes, and never moves with motion when reduced motion is set.
|
|
85
|
+
|
|
86
|
+
- `ScreenShell` `bar-hidden`: only a scroll that follows the reader's own input (a wheel, a touch, a key, a press on a scrollbar) moves the bar. A scroll the host makes itself, such as a conversation opening at its latest message, keeps it in view.
|
|
87
|
+
- `ScreenShell`: the bar's show and hide never animate when the reader prefers reduced motion.
|
|
88
|
+
|
|
89
|
+
## 0.1.0-alpha.21 (2026-11-21)
|
|
90
|
+
|
|
91
|
+
The kit on design tokens v0.11.0 (contract 0.6.0, with the served icon list): the screen shell steps its bar out of the way while scrolling down, one header at phone width, and the Workspace's served icon names.
|
|
92
|
+
|
|
93
|
+
- Tokens: the copy is design-tokens v0.11.0 (eea2e13), contract 0.6.0, and `contract/icons.json` is copied and pinned with it: the icon names the server's navigation trees use, each with the interfaces whose trees use it.
|
|
94
|
+
- `ScreenShell`: `bar-hidden` (contract 0.6.0). The bar and the filters step out of view while the content, or any pane in it that scrolls on its own, scrolls down past 48px, and come back on any scroll up, at the top, or when focus moves into the bar; never while searching, pulling or refreshing. `barHidden` hands the decision to the host. Collapsed rather than removed, so focus can still reach the bar.
|
|
95
|
+
- `AppShell` at phone width: while a screen shell is drawn in it, its own top bar gives way, so the screen's bar is the only header (contract 0.6.0: one header at phone width). A host no longer needs its own rule for it.
|
|
96
|
+
- `iconForName`: the served names the Workspace's trees use since the Chat and Drive trees: `arrow-left` (chevron-left), `pencil-square` (pencil), `cloud-upload` (the new `upload` icon), `people` (the new `users` icon), `file-earmark-word` and `file-earmark-spreadsheet` (file). A test reads `contract/icons.json` and fails, naming it, for any name listed for the Workspace that has no icon.
|
|
97
|
+
- `ScreenShell` / `usePull`: a pull starts only when every region that scrolls under the finger, up to the shell's content, is at its top. A list that scrolls in its own box inside the shell, scrolled down, takes a downward drag as its own scroll, not as a refresh.
|
|
98
|
+
|
|
99
|
+
## 0.1.0-alpha.20 (2026-11-20)
|
|
100
|
+
|
|
101
|
+
The server's icon names the folder menu and the image bar use, and a space kept for a name the kit does not know.
|
|
102
|
+
|
|
103
|
+
- `Icon`: `folder-plus`, `folder-x`, `user-check` and `user-x`, in the set's stroke style.
|
|
104
|
+
- `BOOTSTRAP_ICONS` / `iconForName`: `pencil` is `pencil`, `trash3` is `trash`, `folder-plus` and `folder-x` are themselves, `image` is `image`, `person-check` is `user-check`, and `person-x` is `user-x`.
|
|
105
|
+
- `NamedIcon` (new): a server's icon by its name, 18px by default, for a row of items. A name the table does not hold draws an empty space of the same size, so the labels beside it line up, and says so once per name in the console outside production. No name draws nothing.
|
|
106
|
+
|
|
107
|
+
## 0.1.0-alpha.19 (2026-11-20)
|
|
108
|
+
|
|
109
|
+
The screen shell at phone width, on design tokens 0.10.0 (contract 0.5.0).
|
|
110
|
+
|
|
111
|
+
- `ScreenShell` (contract `screen-shell`): one screen of a section at phone width. One bar: the section's navigation at its root, or Back named by the parent on a nested screen; the title; the section's search, then the shell's own icons (the bell, the avatar). Optional filter chips under it, exactly one selected. The content scrolls on its own and refreshes by a pull from its top (`onRefresh`, 64px); the primary action floats at the bottom right as one button or a menu of declared entries, and the content ends with room for it. While the section's search is open (`searching`), the bar is Close and the host's search field.
|
|
112
|
+
- `usePull`, `PULL_AT`, `usePullState`: the pull, shared; a `List` inside a shell draws it (state `pulled`) with the sync time, then the refreshing state.
|
|
113
|
+
- `List`: one row anatomy, flat on one surface with light separators, no border or card; a row may be `unread` (the title semibold) and carry a `count` under its meta.
|
|
114
|
+
- `Avatar`: `connection` (on one's own avatar, the live connection as its dot, said in words as its name and tooltip), `deleted` (a neutral person icon, never initials), and presence `busy`, drawn as away.
|
|
115
|
+
- Icons: `user`, a person.
|
|
116
|
+
- Tokens: the copy is design-tokens v0.10.0 (a075e93); only the components contract changed (the screen shell, its search part, the list's row and the avatar's states).
|
|
117
|
+
|
|
118
|
+
## 0.1.0-alpha.18 (2026-11-20)
|
|
119
|
+
|
|
120
|
+
A sender's own initials when a service sent on their behalf.
|
|
121
|
+
|
|
122
|
+
- `Avatar` / `initialsOf`: a trailing "via <service>" is left out before the initials are taken, so a message sent on someone's behalf shows the sender's own: "Valentina Zagnetova via LinkedIn" is VZ, not VL. Only a lowercase "via", as relays write it: "Maria Via Rossi" stays MR. Each initial is the word's first letter or digit, so a name in quotes ("'Anna Kowalska' via Partners") is AK.
|
|
123
|
+
|
|
124
|
+
## 0.1.0-alpha.17 (2026-11-19)
|
|
125
|
+
|
|
126
|
+
The pane toolbar always reaches More, and two icons of their own.
|
|
127
|
+
|
|
128
|
+
- `PaneToolbar`: More is always reached. In a row too narrow for its pinned actions and More, after the overflow, the pinned go behind More too, from the end of the row, and its menu lists them after the overflow; no action is cut off at the row's edge. One action alone goes behind More when no other can go with it and that alone lets the row fit (one keeping its label, without an icon).
|
|
129
|
+
- Icons: `envelope-open` draws an open envelope (`mail-open`), apart from `envelope`, and `clipboard` draws a clipboard (`copy`), so Show message and Copy source have their own icons.
|
|
130
|
+
|
|
131
|
+
## 0.1.0-alpha.16 (2026-11-19)
|
|
132
|
+
|
|
133
|
+
The design tokens 0.8.0 with their control heights, and the kit covering every entry of their contract 0.3.0.
|
|
134
|
+
|
|
135
|
+
- Tokens: the copy is design-tokens v0.8.0, with `--cms-control-height-sm` (32px), `-md` (40px; 44px on a coarse pointer) and `-lg` (44px). `tools/check-css.mjs` is its copy that keeps the coarse-pointer block.
|
|
136
|
+
- Control heights: a button, a text field and a select are `--cms-control-height-md`: 40px with a mouse, 44px on a touch screen, as the token says. A button's height is no longer set again by the window's width.
|
|
137
|
+
- `Notification`: one notification in a list (contract `notification`: unread, read, collapsed, expanded, with-action, row-action). Pressing the row reads it and follows only a row action the host can follow; a button action goes only from its button, after the text; the chevron opens the body and reads it.
|
|
138
|
+
- `FileViewer`: `state` draws loading, an error (Retry only when the caller gives it) or no preview (Download as its action) inside the content, the top bar staying; `editing.conflict` asks, above the editor, whether to overwrite the other version or keep both, and saves nothing on its own.
|
|
139
|
+
- `ContextMenu`: a refused or disabled item is described by its reason (`aria-describedby`), as the pane toolbar's disabled action is (contract `item-disabled`); an item's icon and words share one line.
|
|
140
|
+
- The kit declares `file-viewer`, `file-picker`, `pane-toolbar` and `notification` against the contract, state by state.
|
|
141
|
+
- `tools/check-layout.mjs`: below the desktop width the browser is a touch screen's (a coarse pointer, no hover), so a control's touch height is the one measured; the demo has a notifications screen.
|
|
142
|
+
|
|
143
|
+
## 0.1.0-alpha.15 (2026-11-18)
|
|
144
|
+
|
|
145
|
+
Resizable panes.
|
|
146
|
+
|
|
147
|
+
- `SplitPanes`: `sizes` gives the panes before the last a width, limits, a width to put back and a splitter's name; where every pane shows, a splitter is drawn after each. A splitter is a vertical separator with its width and limits, dragged by mouse, touch or pen, moved 16 px by the arrow keys, taken to its limits by Home and End, and put back by a double-click or Enter. `onResize` reports a move while it is dragged and once more when the drag or the key ends. The last pane is never narrower than `lastMin` (360 by default); as the window narrows the pane nearest it gives way first. Where fewer panes show, there is no splitter.
|
|
148
|
+
- `fitPanes(sizes, room, lastMin)`: the widths the panes take in a given room, as `SplitPanes` lays them out.
|
|
149
|
+
|
|
150
|
+
## 0.1.0-alpha.14 (2026-11-18)
|
|
151
|
+
|
|
152
|
+
Number, date and time fields, and a field of several lines, for forms the server declares.
|
|
153
|
+
|
|
154
|
+
- `TextField`: `type` adds `number`, `date`, `time` and `datetime-local`, native inputs, so a phone shows its own keyboard or picker and assistive technology reads them as what they are. The server's constraints are the input's own: `min`, `max`, `step`, `minLength`, `maxLength` and `required`. A number with a fractional or `any` step asks for the decimal keyboard. `locale` (the person's) is the input's language, and a read-only or pinned date or time is written out in it as the wall-clock value it is, with its ISO value in `data-value`; a value naming no real date or time is shown as given. While a date or time is edited, the device's picker shows the browser's own format.
|
|
155
|
+
- `writtenOut(type, value, locale)`: the same writing out, for a host.
|
|
156
|
+
- `TextArea`: several lines in the text field's frame and states, with `rows`, `minLength`, `maxLength`, `required` and `locale`.
|
|
157
|
+
|
|
158
|
+
## 0.1.0-alpha.13 (2026-11-17)
|
|
159
|
+
|
|
160
|
+
The viewer's side arrows say where they go, and the next one stands clear of the scrollbar.
|
|
161
|
+
|
|
162
|
+
- `FileViewer`: each side arrow's label (`siblings.previousLabel` / `nextLabel`) is also its tooltip, so the caller's words ("Next attachment: Receipt.pdf") show on hover. The next arrow stands 20px further in from the content's right edge, clear of the content's own vertical scrollbar.
|
|
163
|
+
|
|
164
|
+
## 0.1.0-alpha.12 (2026-11-16)
|
|
165
|
+
|
|
166
|
+
A disabled action's reason is read out with it, and a press shows it.
|
|
167
|
+
|
|
168
|
+
- `PaneToolbar`: a disabled action's reason describes it (`aria-describedby`), so it is read out with the action, and a press shows it as hover and focus do, until focus leaves or Escape. A press still runs nothing.
|
|
169
|
+
|
|
170
|
+
## 0.1.0-alpha.11 (2026-11-15)
|
|
171
|
+
|
|
172
|
+
Show original stays in More, and a toolbar's labels give way one by one.
|
|
173
|
+
|
|
174
|
+
- `PaneToolbar`: as the pane narrows, labels hide one by one, in the overflow order (lower priority first, a
|
|
175
|
+
priority's actions together), then the pinned actions' from the end of the row; only once every label is hidden do
|
|
176
|
+
actions go behind More, in the same order, never one alone. They come back in the reverse order. An action hiding its
|
|
177
|
+
label keeps it as its tooltip. The row is marked `cms-pane-toolbar--labels-partly-hidden` between the two, the
|
|
178
|
+
contract's new `labels-partly-hidden` state.
|
|
179
|
+
- `PaneToolbar`: the classes named as the contract names them. An action whose label is hidden is
|
|
180
|
+
`cms-pane-toolbar__action--bare` (renamed `--icon` to `--bare`), and an action drawn without an icon is
|
|
181
|
+
`cms-pane-toolbar__action--text`, the same in both kits.
|
|
182
|
+
- `PaneToolbar`: `overflow: 0` means menu only. The action is never drawn in the row, at any width, and always sits behind
|
|
183
|
+
More, first in its menu. More is drawn for it even when it is alone. Its label takes no part in the giving way, and the
|
|
184
|
+
rule that one action never goes behind More alone counts only the actions that could have stayed in the row.
|
|
185
|
+
- `Icon`: `file-code`, a file with code's angle brackets, for the server's `file-earmark-code` (Show original).
|
|
186
|
+
|
|
187
|
+
## 0.1.0-alpha.10 (2026-11-10)
|
|
188
|
+
|
|
189
|
+
The row of actions at the top of a pane, drawn from the server's action nodes.
|
|
190
|
+
|
|
191
|
+
- `ContextMenu` takes `focus`, the item focused as it opens; `PaneToolbar`'s More opens its menu on the last item with Up.
|
|
192
|
+
- `PaneToolbar`, the contract's `pane-toolbar`: the one row of actions at the top of a pane, the
|
|
193
|
+
same height in every pane. It draws the actions it is given, as the server's action nodes give them (id, label, icon,
|
|
194
|
+
group, overflow priority, danger, disabled), and says which was chosen by its id. As the pane narrows every label
|
|
195
|
+
hides at once, then actions go behind More by their overflow priority, never one alone, a priority's actions together.
|
|
196
|
+
One Tab stop, a status at the end.
|
|
197
|
+
- Icons `forward` and `refresh`.
|
|
198
|
+
|
|
199
|
+
## 0.1.0-alpha.9 (2026-11-09)
|
|
200
|
+
|
|
201
|
+
A quick reply that carries its own controls and decides when it may be sent.
|
|
202
|
+
|
|
203
|
+
- `Composer` takes `leading`, a quick reply's own controls at the start of its last row before Send, and `canSend`,
|
|
204
|
+
which decides whether Send sends in place of the text being non-empty.
|
|
205
|
+
|
|
206
|
+
## 0.1.0-alpha.8 (2026-11-09)
|
|
207
|
+
|
|
208
|
+
Choosing files a person already has, and a file viewer that keeps to the screen.
|
|
209
|
+
|
|
210
|
+
- Added: `FilePicker`, for choosing files that already exist in the person's spaces, such as Drive, to attach them
|
|
211
|
+
without downloading and uploading them again (contract component `file-picker`). The kit knows no API: the host
|
|
212
|
+
gives the spaces, lists a folder page by page (`list(space, path, cursor?)`), and receives the chosen entries with
|
|
213
|
+
the space and path each was chosen in.
|
|
214
|
+
- The selection holds across folders and spaces; the footer counts all of it, and a chip lists it, with Remove and
|
|
215
|
+
Clear.
|
|
216
|
+
- An optional `budget` (`usedBytes`, `limitBytes`, `cost`) is counted here: what is left after the selection, and
|
|
217
|
+
a file that would go over is disabled with the host's words for it. `disabledReason` adds the host's own reasons.
|
|
218
|
+
Attach is disabled with nothing chosen and while over.
|
|
219
|
+
- A listbox with aria-multiselectable: Up, Down, Home and End move, Enter opens a folder, Space ticks a file,
|
|
220
|
+
Backspace goes up, Escape cancels. The breadcrumb is a navigation landmark. A page further is asked for near the
|
|
221
|
+
end of the list.
|
|
222
|
+
- Loading, empty and error with Retry through `State`; a folder the person may not open (`FilePickerDenied` from
|
|
223
|
+
`list`) is denied in place, the dialog staying open.
|
|
224
|
+
- A dialog of fixed height on a wide screen; the whole screen on a phone, its foot kept at the bottom.
|
|
225
|
+
- `kit.contract.json` does not declare it yet: no released design-tokens version has the entry.
|
|
226
|
+
- Fixed: the file viewer is never wider than the screen. A viewer bar wider than a phone widened the whole overlay;
|
|
227
|
+
now the overlay is one column the screen's width, and the bar scrolls sideways in its place, its controls centred
|
|
228
|
+
while they fit.
|
|
229
|
+
- `Modal` takes `initialFocus`, what takes the focus on opening when it is not the body's first control, and
|
|
230
|
+
`className`, for a component drawn in it that has a layout of its own.
|
|
231
|
+
|
|
232
|
+
## 0.1.0-alpha.7 (2026-11-08)
|
|
233
|
+
|
|
234
|
+
An icon of its own for the important folder.
|
|
235
|
+
|
|
236
|
+
- Added: the `important` icon, a marker shaped as a label's chevron, for a mail client's important folder. The bell
|
|
237
|
+
stays for notifications alone. The demo's mail folders show it after Starred.
|
|
238
|
+
|
|
239
|
+
## 0.1.0-alpha.6 (2026-11-08)
|
|
240
|
+
|
|
241
|
+
A file opens over the page, and every place that waits, finds nothing or is refused says so in one way.
|
|
242
|
+
|
|
243
|
+
- Added: `FileViewer`, the overlay a file's adapter goes inside. It draws no file itself.
|
|
244
|
+
- The top bar has Close, the type badge and the name, then the caller's actions (Download, Print, Open separately),
|
|
245
|
+
in a menu on a phone. Edit is there only when the caller passes it.
|
|
246
|
+
- Close leaves the viewer, asking the caller first when there is unsaved work; Done returns from editing.
|
|
247
|
+
Escape closes only while viewing.
|
|
248
|
+
- Focus starts on Close, stays among what is drawn, and returns to what opened the viewer. The page behind does not
|
|
249
|
+
scroll.
|
|
250
|
+
- Arrows, swipes and side buttons move through a set of files. A field, an editor, or anything marked
|
|
251
|
+
`data-viewer-keys` or `data-viewer-gestures` keeps its keys and gestures. A key held with Ctrl, Cmd or Alt is left
|
|
252
|
+
to the browser.
|
|
253
|
+
- Plus, minus and 0 call `onZoom`. The viewer bar, thumbnails and strip hold what the adapter gives.
|
|
254
|
+
- `download`, `print` and `open-separately` join the icons.
|
|
255
|
+
- `kit.contract.json` does not declare it yet: design-tokens v0.7.1 has no entry for it.
|
|
256
|
+
- Added: `State`, for loading, empty, error and denied, at a page's, a card's or a line's size, with the caller's
|
|
257
|
+
title, description and action. Loading shows nothing until `STATE_DELAY_MS` (the `state-delay` token) has passed.
|
|
258
|
+
`elevation-required` is declared not offered, since this kit's clients never elevate.
|
|
259
|
+
- Changed: the kit is checked against design-tokens v0.7.1, from v0.7.0.
|
|
260
|
+
|
|
261
|
+
## 0.1.0-alpha.5 (2026-11-04)
|
|
262
|
+
|
|
263
|
+
A field is drawn once.
|
|
264
|
+
|
|
265
|
+
- Fixed: `SignInForm`'s inputs carried the class of a field's frame, `cms-field`, so their box (a border, a fixed
|
|
266
|
+
44px height, padding and a background) fell on the frame of every `TextField`, `Select` and `Toggle` too: each field
|
|
267
|
+
drew two boxes, and its help text ran over the next label. The sign-in inputs are now `cms-signin-form__input`, and
|
|
268
|
+
the frame is a column of label, box and help only. A page that styled the sign-in inputs as `.cms-field` styles
|
|
269
|
+
them as `.cms-signin-form__input`.
|
|
270
|
+
|
|
271
|
+
## 0.1.0-alpha.4 (2026-11-02)
|
|
272
|
+
|
|
273
|
+
The kit's words come from the app, and the composer leaves an input method's Enter alone.
|
|
274
|
+
|
|
275
|
+
- Added: every word a component says can be given in the app's language, English where it is not.
|
|
276
|
+
- `labels` on `IncomingCall`, `CallPanel` and `CallBar` (`CallLabels`, defaults `CALL_LABELS`);
|
|
277
|
+
- `labels` on `SignInForm` (`SignInLabels`, `SIGN_IN_LABELS`) and `MailRow` (`MailRowLabels`, `MAIL_ROW_LABELS`);
|
|
278
|
+
- `railLabel` on `AppShell`, `readLabel` on `ChatBubble`, `attachLabel` on `Composer`, `closeLabel` on `Modal`
|
|
279
|
+
and `ConfirmDialog`, `dismissLabel` on `Toast` and `retryLabel` on `ErrorBanner`.
|
|
280
|
+
The words that name someone or something take it as an argument (`onCallWith(name)`), so a language can place it.
|
|
281
|
+
- Changed: `AppShell`'s main area is a column: a section in it can fill the height (`flex: 1`), and a lone child does.
|
|
282
|
+
- Fixed: `Composer` no longer sends on Enter while an input method is composing (`isComposing`, or the composing key
|
|
283
|
+
229 on browsers that do not set it). Typing Chinese, Japanese or Korean, Enter confirms the text.
|
|
284
|
+
|
|
5
285
|
## 0.1.0-alpha.3 (2026-10-30)
|
|
6
286
|
|
|
7
287
|
The Workspace's components, on design-tokens 0.6.0.
|
|
@@ -37,13 +317,11 @@ The token file is CSS a browser keeps whole.
|
|
|
37
317
|
`design-tokens.lock.json` with the tag's commit.
|
|
38
318
|
- Added: `tools/check-css.mjs`, copied from v0.5.0 and pinned the same way, runs on the token file in
|
|
39
319
|
`tokens:check`; `tools/check-css-teeth.mjs` makes sure it still fails a `//` header and a missing file.
|
|
40
|
-
- Changed: the README's install line names no version
|
|
41
|
-
later.
|
|
320
|
+
- Changed: the README's install line names no version, and says to use 0.1.0-alpha.2 or later.
|
|
42
321
|
|
|
43
322
|
## 0.1.0-alpha.1 (2026-10-23)
|
|
44
323
|
|
|
45
|
-
The first pre-release.
|
|
46
|
-
`design-tokens.lock.json` (#1).
|
|
324
|
+
The first pre-release. The package carries `design-tokens.lock.json` (#1).
|
|
47
325
|
|
|
48
326
|
- The 15 components of the CoolMS UI contract, each in every state the contract names. `elevation-required` is not
|
|
49
327
|
offered.
|
package/design-tokens.lock.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"repository": "coolms/design-tokens",
|
|
3
|
-
"tag": "v0.
|
|
4
|
-
"commit": "
|
|
3
|
+
"tag": "v0.30.0",
|
|
4
|
+
"commit": "63726333f5b20a53a6c17663672b9c5bd94ff903",
|
|
5
5
|
"files": {
|
|
6
6
|
"dist/coolms-tokens.css": {
|
|
7
7
|
"to": "src/tokens/coolms-tokens.css",
|
|
8
|
-
"sha256": "
|
|
8
|
+
"sha256": "8913f190633292fd3e991bfacd3ed9e0927c98c2c46f533161cc4adebd948a21"
|
|
9
9
|
},
|
|
10
10
|
"contract/components.json": {
|
|
11
11
|
"to": "contract/components.json",
|
|
12
|
-
"sha256": "
|
|
12
|
+
"sha256": "b1bc1cae5e1e4797f07252503f5838712f06345e6e9a409a56d5873e3b9b9606"
|
|
13
13
|
},
|
|
14
14
|
"contract/server-states.json": {
|
|
15
15
|
"to": "contract/server-states.json",
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
},
|
|
18
18
|
"tools/check-kit.mjs": {
|
|
19
19
|
"to": "tools/check-kit.mjs",
|
|
20
|
-
"sha256": "
|
|
20
|
+
"sha256": "c48ac67d267aec11698ab362a8095a355eea8c8775c313d4261be2c60b65d0bb"
|
|
21
21
|
},
|
|
22
22
|
"tools/check-css.mjs": {
|
|
23
23
|
"to": "tools/check-css.mjs",
|
|
24
|
-
"sha256": "
|
|
24
|
+
"sha256": "aad1b7d00c46577346b4fc38ddfe0047633a61f4eebe39959918811eb134fd12"
|
|
25
25
|
},
|
|
26
26
|
"fonts/inter.css": {
|
|
27
27
|
"to": "src/fonts/inter.css",
|
|
@@ -42,6 +42,10 @@
|
|
|
42
42
|
"fonts/OFL.txt": {
|
|
43
43
|
"to": "src/fonts/OFL.txt",
|
|
44
44
|
"sha256": "262481e844521b326f5ecd053e59b98c8b2da78c8ee1bdbb6e8174305e54935a"
|
|
45
|
+
},
|
|
46
|
+
"contract/icons.json": {
|
|
47
|
+
"to": "contract/icons.json",
|
|
48
|
+
"sha256": "bf8856c702f5c989b1878b96e534dbffb24a4d831adcf81236db324c2f5f5d19"
|
|
45
49
|
}
|
|
46
50
|
}
|
|
47
51
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
export interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
|
|
3
|
-
/**
|
|
4
|
-
|
|
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,13 +1,39 @@
|
|
|
1
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;
|
|
2
26
|
export interface IncomingCallProps {
|
|
3
27
|
/** Who is calling. */
|
|
4
28
|
readonly name: string;
|
|
5
29
|
readonly media: 'audio' | 'video';
|
|
6
30
|
readonly onAccept: () => void;
|
|
7
31
|
readonly onDecline: () => void;
|
|
32
|
+
/** Its words, in the app's language; each left out is English. */
|
|
33
|
+
readonly labels?: Partial<CallLabels>;
|
|
8
34
|
}
|
|
9
35
|
/** A call ringing on this device: who, and Accept or Decline. An alert dialog, so a screen reader announces it. */
|
|
10
|
-
export declare function IncomingCall({ name, media, onAccept, onDecline }: IncomingCallProps): ReactNode;
|
|
36
|
+
export declare function IncomingCall({ name, media, onAccept, onDecline, labels }: IncomingCallProps): ReactNode;
|
|
11
37
|
export interface CallPanelProps {
|
|
12
38
|
readonly name: string;
|
|
13
39
|
/** How long the call has lasted ("04:12"). */
|
|
@@ -26,9 +52,11 @@ export interface CallPanelProps {
|
|
|
26
52
|
readonly onAddPerson?: () => void;
|
|
27
53
|
readonly onChat?: () => void;
|
|
28
54
|
readonly onHangUp: () => void;
|
|
55
|
+
/** Its words, in the app's language; each left out is English. */
|
|
56
|
+
readonly labels?: Partial<CallLabels>;
|
|
29
57
|
}
|
|
30
58
|
/** A call in progress: who, how long, how the connection is, and its controls. */
|
|
31
|
-
export declare function CallPanel({ name, duration, connection, you, muted, speaker, onToggleMute, onToggleSpeaker, onAddPerson, onChat, onHangUp }: CallPanelProps): ReactNode;
|
|
59
|
+
export declare function CallPanel({ name, duration, connection, you, muted, speaker, onToggleMute, onToggleSpeaker, onAddPerson, onChat, onHangUp, labels }: CallPanelProps): ReactNode;
|
|
32
60
|
export interface CallBarProps {
|
|
33
61
|
readonly name: string;
|
|
34
62
|
readonly duration: string;
|
|
@@ -36,6 +64,8 @@ export interface CallBarProps {
|
|
|
36
64
|
readonly onToggleMute: () => void;
|
|
37
65
|
readonly onReturn: () => void;
|
|
38
66
|
readonly onHangUp: () => void;
|
|
67
|
+
/** Its words, in the app's language; each left out is English. */
|
|
68
|
+
readonly labels?: Partial<CallLabels>;
|
|
39
69
|
}
|
|
40
70
|
/** The call, kept in view while another section is open: who, how long, mute, back to it, hang up. */
|
|
41
|
-
export declare function CallBar({ name, duration, muted, onToggleMute, onReturn, onHangUp }: CallBarProps): ReactNode;
|
|
71
|
+
export declare function CallBar({ name, duration, muted, onToggleMute, onReturn, onHangUp, labels }: CallBarProps): ReactNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import type { Offer } from '../server/capability';
|
|
2
|
+
import type { Offer } from '../server/capability.js';
|
|
3
3
|
export interface ListRow {
|
|
4
4
|
readonly id: string;
|
|
5
5
|
readonly primary: ReactNode;
|
|
@@ -8,6 +8,10 @@ export interface ListRow {
|
|
|
8
8
|
readonly lead?: ReactNode;
|
|
9
9
|
/** Trailing text: a date, a size. */
|
|
10
10
|
readonly meta?: ReactNode;
|
|
11
|
+
/** Not read yet: the title in semibold. */
|
|
12
|
+
readonly unread?: boolean;
|
|
13
|
+
/** A count under the meta (unread messages in a conversation). */
|
|
14
|
+
readonly count?: number;
|
|
11
15
|
}
|
|
12
16
|
export interface ListProps {
|
|
13
17
|
/** What the rows are, for a screen reader ("Messages"). */
|
|
@@ -31,7 +35,9 @@ export interface ListProps {
|
|
|
31
35
|
}
|
|
32
36
|
/**
|
|
33
37
|
* Rows of objects, each opened by a press; a row's other actions in its menu (contract component `list`: loading,
|
|
34
|
-
* empty, populated, selected, error). Up and Down move between rows; Enter opens one.
|
|
38
|
+
* empty, populated, selected, error, pulled). Up and Down move between rows; Enter opens one. Every row has one anatomy:
|
|
39
|
+
* a leading icon or avatar, a title (semibold while unread), a secondary line, the meta with a count under it; rows sit
|
|
40
|
+
* on one surface, never cards. Inside a screen that takes a pull, the list draws it at its top (pulled).
|
|
35
41
|
*/
|
|
36
42
|
export declare function List({ label, rows, error, onRetry, loadingText, emptyTitle, emptyHint, selected, onOpen, onRowMenu }: ListProps): ReactNode;
|
|
37
43
|
export interface MenuItem {
|
|
@@ -53,10 +59,13 @@ export interface ContextMenuProps {
|
|
|
53
59
|
readonly items: readonly MenuItem[];
|
|
54
60
|
readonly onClose: () => void;
|
|
55
61
|
readonly label?: string;
|
|
62
|
+
/** The item focused as it opens: the first, or the last (a menu button opened with Up). */
|
|
63
|
+
readonly focus?: 'first' | 'last';
|
|
56
64
|
}
|
|
57
65
|
/**
|
|
58
|
-
* The selected object's actions (contract component `context-menu`: open, item-danger, item-locked, item-refused
|
|
59
|
-
* An item the server withheld is not drawn; a locked one carries its lock; a refused
|
|
60
|
-
*
|
|
66
|
+
* The selected object's actions (contract component `context-menu`: open, item-danger, item-locked, item-refused,
|
|
67
|
+
* item-disabled). An item the server withheld is not drawn; a locked one carries its lock; a refused or disabled one
|
|
68
|
+
* stays in the menu, reached by the arrow keys, aria-disabled, with the server's reason under its label and as its
|
|
69
|
+
* description; choosing it does nothing and the menu stays open. Escape, a press outside, or a choice closes it, and focus goes back where it was.
|
|
61
70
|
*/
|
|
62
|
-
export declare function ContextMenu({ at, items, onClose, label }: ContextMenuProps): ReactNode;
|
|
71
|
+
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;
|
|
@@ -9,11 +9,32 @@ interface FieldFrame {
|
|
|
9
9
|
/** Shown, focusable and copyable, but not changed here. */
|
|
10
10
|
readonly readOnly?: boolean;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
/** The native kinds of one line: each brings the device's own keyboard or picker and its accessibility. */
|
|
13
|
+
export type TextFieldType = 'text' | 'email' | 'url' | 'search' | 'tel' | 'password' | 'number' | 'date' | 'time' | 'datetime-local';
|
|
14
|
+
/** What the server declares about a value: its bounds, its step and its length. */
|
|
15
|
+
interface Constraints {
|
|
16
|
+
/** The least value: a number, or an ISO date or time for the date and time types. */
|
|
17
|
+
readonly min?: string | number;
|
|
18
|
+
/** The greatest value, as `min`. */
|
|
19
|
+
readonly max?: string | number;
|
|
20
|
+
/** The step between values (`any` for none): seconds for `time` and `datetime-local`, days for `date`. */
|
|
21
|
+
readonly step?: number | 'any';
|
|
22
|
+
readonly minLength?: number;
|
|
23
|
+
readonly maxLength?: number;
|
|
24
|
+
/** A value is needed: marked for assistive technology, and checked by the browser on submit. */
|
|
25
|
+
readonly required?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface TextFieldProps extends FieldFrame, Constraints {
|
|
28
|
+
/** The value as the input holds it: digits for `number`, ISO for the date and time types (`2026-11-18`, `14:30`, `2026-11-18T14:30`). */
|
|
13
29
|
readonly value: string;
|
|
14
30
|
readonly onChange?: (value: string) => void;
|
|
15
31
|
readonly placeholder?: string;
|
|
16
|
-
readonly type?:
|
|
32
|
+
readonly type?: TextFieldType;
|
|
33
|
+
/**
|
|
34
|
+
* The person's locale (BCP 47, from their settings): the field's language, and how a read-only or pinned date or
|
|
35
|
+
* time is written out. An editable date or time is the device's own picker.
|
|
36
|
+
*/
|
|
37
|
+
readonly locale?: string;
|
|
17
38
|
/**
|
|
18
39
|
* The value is set by the environment, not here (a pinned setting): shown read-only with why, the way the admin
|
|
19
40
|
* shows a key the deployment pins.
|
|
@@ -21,8 +42,31 @@ export interface TextFieldProps extends FieldFrame {
|
|
|
21
42
|
readonly pinned?: ReactNode;
|
|
22
43
|
readonly name?: string;
|
|
23
44
|
}
|
|
24
|
-
/**
|
|
25
|
-
|
|
45
|
+
/**
|
|
46
|
+
* A date or time value written out in a locale, as the wall-clock value it is (no time zone is applied); the value
|
|
47
|
+
* itself when it is not one the type holds, or names no real date or time (a 30 February, a 25th hour).
|
|
48
|
+
*/
|
|
49
|
+
export declare function writtenOut(type: TextFieldType, value: string, locale: string | undefined): string;
|
|
50
|
+
/**
|
|
51
|
+
* One line of text (contract component `text-field`: default, focused, disabled, read-only, invalid, pinned), of any
|
|
52
|
+
* native kind: a number, a date, a time or both bring the device's keyboard or picker. The server's constraints are the
|
|
53
|
+
* input's own (`min`, `max`, `step`, `minlength`, `maxlength`, `required`). A date or time that is read-only or pinned
|
|
54
|
+
* is written out in the person's locale, and keeps its ISO value in `data-value`.
|
|
55
|
+
*/
|
|
56
|
+
export declare function TextField({ label, help, error, disabled, readOnly, pinned, value, onChange, placeholder, type, name, locale, min, max, step, minLength, maxLength, required }: TextFieldProps): ReactNode;
|
|
57
|
+
export interface TextAreaProps extends FieldFrame, Pick<Constraints, 'minLength' | 'maxLength' | 'required'> {
|
|
58
|
+
readonly value: string;
|
|
59
|
+
readonly onChange?: (value: string) => void;
|
|
60
|
+
readonly placeholder?: string;
|
|
61
|
+
/** The lines it shows before it scrolls (4 by default); the person may make it taller. */
|
|
62
|
+
readonly rows?: number;
|
|
63
|
+
/** The person's locale (BCP 47): the field's language, for spelling and the input method. */
|
|
64
|
+
readonly locale?: string;
|
|
65
|
+
readonly pinned?: ReactNode;
|
|
66
|
+
readonly name?: string;
|
|
67
|
+
}
|
|
68
|
+
/** Several lines of text: the text field's frame and states (`text-field`), with the server's length and need. */
|
|
69
|
+
export declare function TextArea({ label, help, error, disabled, readOnly, pinned, value, onChange, placeholder, rows, name, locale, minLength, maxLength, required }: TextAreaProps): ReactNode;
|
|
26
70
|
export interface SelectOption {
|
|
27
71
|
readonly value: string;
|
|
28
72
|
readonly label: string;
|