@coolms/ui-react 0.1.0-alpha.5 → 0.1.0-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,35 @@
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.7 (2026-11-08)
6
+
7
+ An icon of its own for the important folder.
8
+
9
+ - Added: the `important` icon, a marker shaped as a label's chevron, for a mail client's important folder. The bell
10
+ stays for notifications alone. The demo's mail folders show it after Starred.
11
+
12
+ ## 0.1.0-alpha.6 (2026-11-08)
13
+
14
+ A file opens over the page, and every place that waits, finds nothing or is refused says so in one way.
15
+
16
+ - Added: `FileViewer`, the overlay a file's adapter goes inside. It draws no file itself.
17
+ - The top bar has Close, the type badge and the name, then the caller's actions (Download, Print, Open separately),
18
+ in a menu on a phone. Edit is there only when the caller passes it.
19
+ - Close leaves the viewer, asking the caller first when there is unsaved work; Done returns from editing.
20
+ Escape closes only while viewing.
21
+ - Focus starts on Close, stays among what is drawn, and returns to what opened the viewer. The page behind does not
22
+ scroll.
23
+ - Arrows, swipes and side buttons move through a set of files. A field, an editor, or anything marked
24
+ `data-viewer-keys` or `data-viewer-gestures` keeps its keys and gestures. A key held with Ctrl, Cmd or Alt is left
25
+ to the browser.
26
+ - Plus, minus and 0 call `onZoom`. The viewer bar, thumbnails and strip hold what the adapter gives.
27
+ - `download`, `print` and `open-separately` join the icons.
28
+ - `kit.contract.json` does not declare it yet: design-tokens v0.7.1 has no entry for it.
29
+ - Added: `State`, for loading, empty, error and denied, at a page's, a card's or a line's size, with the caller's
30
+ title, description and action. Loading shows nothing until `STATE_DELAY_MS` (the `state-delay` token) has passed.
31
+ `elevation-required` is declared not offered, since this kit's clients never elevate.
32
+ - Changed: the kit is checked against design-tokens v0.7.1, from v0.7.0.
33
+
5
34
  ## 0.1.0-alpha.5 (2026-11-04)
6
35
 
7
36
  A field is drawn once.
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "repository": "coolms/design-tokens",
3
- "tag": "v0.6.0",
4
- "commit": "0dd27d145de67936bde4b6dd4d904a9d8df63211",
3
+ "tag": "v0.7.1",
4
+ "commit": "0167cfcaf665e4f785910e7c309ef18fedf61c52",
5
5
  "files": {
6
6
  "dist/coolms-tokens.css": {
7
7
  "to": "src/tokens/coolms-tokens.css",
8
- "sha256": "670c856f8473924fe07b735b39ddd0d14afa0f648373bd4d8b906309fd49a08e"
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,7 @@
17
17
  },
18
18
  "tools/check-kit.mjs": {
19
19
  "to": "tools/check-kit.mjs",
20
- "sha256": "f8407f6accd55eb666eb6bbfe629a10f959c3bf6c62fe8ef2f1fe06a48471a8c"
20
+ "sha256": "c48ac67d267aec11698ab362a8095a355eea8c8775c313d4261be2c60b65d0bb"
21
21
  },
22
22
  "tools/check-css.mjs": {
23
23
  "to": "tools/check-css.mjs",
@@ -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;
@@ -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';
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';
4
4
  export interface IconProps {
5
5
  readonly name: IconName;
6
6
  readonly size?: number;
@@ -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;
package/dist/index.d.ts CHANGED
@@ -2,6 +2,8 @@ export { Button, type ButtonProps } from './components/Button';
2
2
  export { TextField, Select, Toggle, type TextFieldProps, type SelectProps, type SelectOption, type ToggleProps } from './components/Fields';
3
3
  export { Modal, ConfirmDialog, MODAL_CLOSE_MS, type ModalProps, type ConfirmDialogProps } from './components/Dialogs';
4
4
  export { Toast, ToastRegion, Loading, EmptyState, ErrorBanner, type ToastProps, type LoadingProps, type EmptyStateProps, type ErrorBannerProps } from './components/Status';
5
+ export { State, STATE_DELAY_MS, type StateKind, type StatePlacement, type StateProps } from './components/State';
6
+ export { FileViewer, type FileViewerAction, type FileViewerEditing, type FileViewerProps, type FileViewerSiblings } from './components/FileViewer';
5
7
  export { PageHeader, TabStrip, Avatar, initialsOf, tintOf, type PageHeaderProps, type Tab, type TabStripProps, type AvatarProps } from './components/Structure';
6
8
  export { Icon, ICON_NAMES, type IconName, type IconProps } from './components/Icon';
7
9
  export { AppShell, Badge, SearchField, FilterChips, SplitPanes, MailRow, ChatBubble, Composer, MAIL_ROW_LABELS, type MailRowLabels, type AppShellProps, type RailItem, type BadgeProps, type SearchFieldProps, type FilterChipsProps, type FilterOption, type SplitPanesProps, type Pane, type MailRowProps, type ChatBubbleProps, type ComposerProps } from './components/Workspace';