@coolms/ui-react 0.1.0-alpha.34 → 0.1.0-alpha.36
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 +34 -0
- package/design-tokens.lock.json +8 -4
- package/dist/components/Column.d.ts +21 -0
- package/dist/components/PaneToolbar.d.ts +18 -12
- package/dist/components/SectionHeader.d.ts +53 -6
- package/dist/components/Structure.d.ts +6 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1669 -1456
- package/kit.contract.json +2 -2
- package/package.json +3 -2
- package/src/kit.css +33 -7
- package/src/tokens/coolms-tokens.css +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,40 @@
|
|
|
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.36 (2026-11-29)
|
|
6
|
+
|
|
7
|
+
Header and toolbar actions give way in steps, and only the last reaches More; an avatar for a person with no name says the host's label; design tokens v0.36.0.
|
|
8
|
+
|
|
9
|
+
- `SectionHeader` takes `secondary` (`SectionAction[]`): the section's other actions as quiet buttons in row 1 while they fit, by their icon and `overflow`. `more` (menu items) is still read for one release, as secondary actions. Row 1 is left to right: the secondary actions (a single menu-only one among them, last), the primary, the last action on the right, then More. (#140)
|
|
10
|
+
- `SectionHeader` is measured on its own width, and again once the web fonts are in, and gives way in the contract's order:
|
|
11
|
+
1. the description hides;
|
|
12
|
+
2. the chips said elsewhere hide;
|
|
13
|
+
3. the secondary actions drop their labels, one by one (a single menu-only button's first);
|
|
14
|
+
4. the primary drops its label, keeping its colour;
|
|
15
|
+
5. the secondary actions move into More;
|
|
16
|
+
6. the primary moves into More;
|
|
17
|
+
7. only then is the title cut, down to 64px;
|
|
18
|
+
8. last, the chips that are the only place their fact appears are cut.
|
|
19
|
+
|
|
20
|
+
`description` and `meta` (`SectionMeta[]`) are new. Its actions are one toolbar named by the title. (#140)
|
|
21
|
+
- `PaneToolbar` takes `primary` on an action: it keeps its label longest and goes behind More last. (#140)
|
|
22
|
+
- Both: More never holds one action. The first move takes two, or one beside a menu-only action; where only one could go, it stays as its icon. More's menu lists the primary first, then the actions that gave way, then the menu-only ones. (#140)
|
|
23
|
+
- Both: an action is a 44px touch target where the pointer is coarse, at any width. A desktop browser in a narrow window keeps desktop-size buttons, so a row gives way the same at 768px as at 1440px. (#140)
|
|
24
|
+
- `Avatar` has `unnamedLabel`: the host's words for a person with no name to show ("No name"), the avatar's accessible name for a blank name, with any presence after it. Left out, "?" as before. (#139)
|
|
25
|
+
- Design tokens v0.36.0 (contract 0.26.0). The contract's fixture `contract/fixtures/header-give-way.json` (served heads and the row each draws at each width) is pinned with the tokens and runs against `SectionHeader`. (#140)
|
|
26
|
+
|
|
27
|
+
Not in the package: the layout check finds any part of a row of actions past its own row's edge, reads touch from the pointer, and with `--pointer=fine` reads every width with a mouse (#140).
|
|
28
|
+
|
|
29
|
+
## 0.1.0-alpha.35 (2026-11-27)
|
|
30
|
+
|
|
31
|
+
A column's head stays at the top while its list scrolls.
|
|
32
|
+
|
|
33
|
+
- `Column` is new: a head that stays at the top (a section header, a pane toolbar, a list's head) and a body that is the column's one scroll region, filling the rest of its height, as the components contract's grid asks. The host gets the scroll region itself: `scrollRef`, `onScroll` and `bodyProps`, for a list that reads more as the person nears its end. (#135)
|
|
34
|
+
- A pane of `SplitPanes` lays its content out as a column at every width, so a `Column` in it fills its height; content that is not a `Column` scrolls with the pane as before. (#135)
|
|
35
|
+
- In a screen shell (a phone) the shell's bar is the head that stays and its content the one scroll region, which pull to refresh reads, so a `Column` there grows with its list. (#135)
|
|
36
|
+
|
|
37
|
+
Not in the package: the kit's checks find a dash used as a separator in its words (`check:ui-text`, a list of grandfathered texts that may only shrink, empty today) (#136); the layout check measures a page only once its stylesheets are in, and finds a `Column` whose head moves when its list scrolls (#135).
|
|
38
|
+
|
|
5
39
|
## 0.1.0-alpha.34 (2026-11-27)
|
|
6
40
|
|
|
7
41
|
An avatar with no letter to show says "?", and its tint can come from a stable id.
|
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.36.0",
|
|
4
|
+
"commit": "f6c0293f514a51a6adc1d98cc4c56273a99eafab",
|
|
5
5
|
"files": {
|
|
6
6
|
"dist/coolms-tokens.css": {
|
|
7
7
|
"to": "src/tokens/coolms-tokens.css",
|
|
8
|
-
"sha256": "
|
|
8
|
+
"sha256": "2c9304e54dd7692ddd7987f01b0c26bc866152a09b52ee34c78ebccaf0fc90e8"
|
|
9
9
|
},
|
|
10
10
|
"contract/components.json": {
|
|
11
11
|
"to": "contract/components.json",
|
|
12
|
-
"sha256": "
|
|
12
|
+
"sha256": "cec38a4c7f47a12a2796be7e7ffcf15a337c3cd9165b713765b28717a488d532"
|
|
13
13
|
},
|
|
14
14
|
"contract/server-states.json": {
|
|
15
15
|
"to": "contract/server-states.json",
|
|
@@ -46,6 +46,10 @@
|
|
|
46
46
|
"contract/icons.json": {
|
|
47
47
|
"to": "contract/icons.json",
|
|
48
48
|
"sha256": "bf8856c702f5c989b1878b96e534dbffb24a4d831adcf81236db324c2f5f5d19"
|
|
49
|
+
},
|
|
50
|
+
"contract/fixtures/header-give-way.json": {
|
|
51
|
+
"to": "contract/fixtures/header-give-way.json",
|
|
52
|
+
"sha256": "b43ddaf8cff636ce3d06a7cee8bfa5e3142f62021eba8af4573ddb24cd5d7b19"
|
|
49
53
|
}
|
|
50
54
|
}
|
|
51
55
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode, Ref, UIEventHandler } from 'react';
|
|
2
|
+
export interface ColumnProps {
|
|
3
|
+
/** What stays at the column's top and never scrolls: its section header, a pane toolbar, a list's head. */
|
|
4
|
+
readonly head?: ReactNode;
|
|
5
|
+
/** The column's list or content, in its one scroll region. */
|
|
6
|
+
readonly children?: ReactNode;
|
|
7
|
+
readonly className?: string;
|
|
8
|
+
/** The scroll region itself, for a host that reads more as the person scrolls. */
|
|
9
|
+
readonly scrollRef?: Ref<HTMLDivElement>;
|
|
10
|
+
readonly onScroll?: UIEventHandler<HTMLDivElement>;
|
|
11
|
+
/** Further attributes of the scroll region (a `data-list` name, an accessible name). */
|
|
12
|
+
readonly bodyProps?: Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'onScroll'> & {
|
|
13
|
+
readonly [data: `data-${string}`]: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A column of a fill layout (contract `split-panes`, grid: each pane has exactly one scroll region): a head that stays at
|
|
18
|
+
* the top, and under it a body that scrolls on its own and fills the rest of the column's height. In a pane of
|
|
19
|
+
* SplitPanes, in a screen shell or in any box of a definite height, the head and its primary action never scroll away.
|
|
20
|
+
*/
|
|
21
|
+
export declare function Column({ head, children, className, scrollRef, onScroll, bodyProps }: ColumnProps): ReactNode;
|
|
@@ -25,9 +25,15 @@ export interface PaneToolbarAction {
|
|
|
25
25
|
/**
|
|
26
26
|
* When it goes behind ... as the row narrows: lower first; actions of the same priority go together (a toggle's
|
|
27
27
|
* pair). Without one it is pinned: it goes behind ... only in a row too narrow to hold it with the rest, the last in
|
|
28
|
-
* the row first, so that nothing is cut off. 0: menu only, behind ... at every width and never in the row
|
|
28
|
+
* the row first, so that nothing is cut off. 0: menu only, behind ... at every width and never in the row, unless it
|
|
29
|
+
* is the only action behind ...: then it is a button at the end of the row.
|
|
29
30
|
*/
|
|
30
31
|
readonly overflow?: number;
|
|
32
|
+
/**
|
|
33
|
+
* The row's declared primary (a folder's Upload): it keeps its label longest and goes behind ... last, first in its
|
|
34
|
+
* menu. One per row: where more than one says so, the first is.
|
|
35
|
+
*/
|
|
36
|
+
readonly primary?: boolean;
|
|
31
37
|
/** Shown, kept in the focus order, and doing nothing when chosen; `reason` is its tooltip. */
|
|
32
38
|
readonly disabled?: boolean;
|
|
33
39
|
readonly reason?: string;
|
|
@@ -57,18 +63,18 @@ export interface PaneToolbarProps {
|
|
|
57
63
|
}
|
|
58
64
|
/**
|
|
59
65
|
* The one row of actions at the top of a pane (contract component `pane-toolbar`: default, labels-partly-hidden,
|
|
60
|
-
* labels-hidden, overflowing, menu-open, with-status, action-disabled, action-busy, phone). It is
|
|
61
|
-
* width as its pane resizes:
|
|
62
|
-
* every label shows while all fit; then labels
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* inside it.
|
|
66
|
+
* labels-hidden, overflowing, menu-open, with-status, action-disabled, action-busy, phone, lone-menu-only). It is
|
|
67
|
+
* measured on its own width as its pane resizes, and gives way in this order:
|
|
68
|
+
* every label shows while all fit; then the labels of the actions that are not the primary hide one by one in the
|
|
69
|
+
* giving-way order (by overflow, lower first, a priority's actions together; then the pinned, from the end of the row
|
|
70
|
+
* back); then the primary's label; only once every label is hidden do actions go behind ..., in the same order, the
|
|
71
|
+
* fewest that let the rest and ... fit, and the primary last. No action is ever cut off, and ... is always reached.
|
|
72
|
+
* They come back in the reverse order. One Tab stop; Left and Right, Home and End move inside it.
|
|
68
73
|
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
74
|
+
* ... never holds one action: the first move into it takes two, or one beside a menu-only action, and where only one
|
|
75
|
+
* could go, it stays in the row at its icon width. Its menu lists the primary first, then those that gave way, in their
|
|
76
|
+
* order, then the menu-only actions (overflow 0) last. Menu-only actions are behind ... at every width, except a single
|
|
77
|
+
* one with nothing else behind ...: that one is a button at the end of the row, giving way first.
|
|
72
78
|
*
|
|
73
79
|
* An action with `entries` is a menu button: its chevron after it, it opens the kit's context menu with its entries,
|
|
74
80
|
* each disabled with its own reason as the server says, and it gives way as any other action does (behind ..., choosing
|
|
@@ -17,14 +17,50 @@ export type SectionPrimary = {
|
|
|
17
17
|
/** The split menu button's accessible name. */
|
|
18
18
|
readonly menuLabel: string;
|
|
19
19
|
};
|
|
20
|
+
/** One of the section's other declared actions: a button in row 1 while it fits. */
|
|
21
|
+
export interface SectionAction {
|
|
22
|
+
readonly id: string;
|
|
23
|
+
/** Its accessible name always, and its tooltip once it shows as its icon. */
|
|
24
|
+
readonly label: string;
|
|
25
|
+
/** Its icon by its Bootstrap Icons name, as the server names it; without one (or one the kit lacks) it keeps its label. */
|
|
26
|
+
readonly icon?: string;
|
|
27
|
+
/**
|
|
28
|
+
* When it gives way: lower first, actions sharing a number together; without one, after every numbered one, from
|
|
29
|
+
* the end of the row back. 0: menu only, in More at every width (a single one alone is a button at the row's end).
|
|
30
|
+
*/
|
|
31
|
+
readonly overflow?: number;
|
|
32
|
+
readonly danger?: boolean;
|
|
33
|
+
/** The server's answer (R3); not offered = not drawn; a refusal = shown disabled, with the server's sentence. */
|
|
34
|
+
readonly offer?: Offer;
|
|
35
|
+
readonly onPress: () => void;
|
|
36
|
+
}
|
|
37
|
+
/** A chip after the title: a slug, a state, a count. */
|
|
38
|
+
export interface SectionMeta {
|
|
39
|
+
readonly id: string;
|
|
40
|
+
/** The chip as the host draws it. */
|
|
41
|
+
readonly content: ReactNode;
|
|
42
|
+
/** Its whole text: its tooltip and accessible name once it is cut. */
|
|
43
|
+
readonly text: string;
|
|
44
|
+
/** The page says it elsewhere too: it may hide. Not set, it is the only place its fact appears and never hides. */
|
|
45
|
+
readonly elsewhere?: boolean;
|
|
46
|
+
}
|
|
20
47
|
export interface SectionHeaderProps {
|
|
21
48
|
/** The section's declared title. */
|
|
22
49
|
readonly title: string;
|
|
23
50
|
/** An icon before the title. */
|
|
24
51
|
readonly icon?: IconName;
|
|
52
|
+
/** One line saying what the section is for, after the title; the first to hide. */
|
|
53
|
+
readonly description?: string;
|
|
54
|
+
/** Chips after the title. */
|
|
55
|
+
readonly meta?: readonly SectionMeta[];
|
|
25
56
|
/** Given only when the section declares one. */
|
|
26
57
|
readonly primary?: SectionPrimary;
|
|
27
|
-
/** The section's other declared actions, in the tree's order
|
|
58
|
+
/** The section's other declared actions, in the tree's order: buttons while they fit, then in More. */
|
|
59
|
+
readonly secondary?: readonly SectionAction[];
|
|
60
|
+
/**
|
|
61
|
+
* Deprecated, read as `secondary` for one release: other actions as menu items. They have no icon or priority of
|
|
62
|
+
* their own, so each keeps its label until it moves into More, from the end of the row back.
|
|
63
|
+
*/
|
|
28
64
|
readonly more?: readonly MenuItem[];
|
|
29
65
|
/** More's accessible name and tooltip, from the host's catalogue. */
|
|
30
66
|
readonly moreLabel: string;
|
|
@@ -35,9 +71,20 @@ export interface SectionHeaderProps {
|
|
|
35
71
|
}
|
|
36
72
|
/**
|
|
37
73
|
* The head of a section from tablet width up (contract component `section-header`: default, with-primary,
|
|
38
|
-
* with-primary-menu, with-more,
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
74
|
+
* with-primary-menu, with-more, with-secondary, secondary-icon, secondary-in-more, lone-menu-only, action-disabled,
|
|
75
|
+
* with-context, with-description, meta-hidden, meta-cut, primary-icon, primary-in-more, full-width).
|
|
76
|
+
*
|
|
77
|
+
* Row 1, on one line at every width: the title, its description and chips, then the secondary actions as quiet
|
|
78
|
+
* buttons (a single menu-only one among them, last), the primary, the last action on the right, and More after it. It is measured on its own width and gives way in this order: the description hides;
|
|
79
|
+
* the chips the page says elsewhere hide; the secondary actions drop their labels one by one (lower overflow first, then
|
|
80
|
+
* those with none from the end back); the primary drops its label, keeping its colour; the secondary actions move into
|
|
81
|
+
* More in the same order; the primary moves into More last; only then is the title cut, down to 64px (the actions give
|
|
82
|
+
* way before the title, never the title before them); and last the chips that are the only place their fact appears
|
|
83
|
+
* are cut, the last first. More never holds one action: the first move
|
|
84
|
+
* takes two, or one beside a menu-only action, and where only one could go it stays, at its icon width. More lists the
|
|
85
|
+
* primary first, then those that gave way, then the menu-only last.
|
|
86
|
+
*
|
|
87
|
+
* Its actions are one toolbar named by the title: one Tab stop; Left and Right, Home and End move inside it. Row 2:
|
|
88
|
+
* the context, only when given. No divider lines. Below tablet width the host draws the screen shell instead.
|
|
42
89
|
*/
|
|
43
|
-
export declare function SectionHeader({ title, icon, primary, more, moreLabel, context, fullWidth }: SectionHeaderProps): ReactNode;
|
|
90
|
+
export declare function SectionHeader({ title, icon, description, meta, primary, secondary, more, moreLabel, context, fullWidth }: SectionHeaderProps): ReactNode;
|
|
@@ -51,6 +51,11 @@ export interface AvatarProps {
|
|
|
51
51
|
};
|
|
52
52
|
/** Their account is gone: a neutral person icon, never initials of the name stored for them. */
|
|
53
53
|
readonly deleted?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* The host's words for a person with no name to show (no name given, or one the viewer may not read), the same label
|
|
56
|
+
* its lists use ("No name"): the accessible name when `name` is blank. "?" when left out. The avatar still shows "?".
|
|
57
|
+
*/
|
|
58
|
+
readonly unnamedLabel?: string;
|
|
54
59
|
readonly size?: number;
|
|
55
60
|
/** What the tint is chosen from: an id that stays the same (a user's, a conversation's). The name when left out. */
|
|
56
61
|
readonly tintSeed?: string;
|
|
@@ -65,4 +70,4 @@ export declare function initialsOf(name: string): string;
|
|
|
65
70
|
/** Which of the six avatar tints a name takes: the same name always the same tint. */
|
|
66
71
|
export declare function tintOf(name: string): number;
|
|
67
72
|
/** A person or an account, by picture or initials (contract component `avatar`: picture, initials, presence). */
|
|
68
|
-
export declare function Avatar({ name, pictureUrl, presence, connection, deleted, size, tintSeed }: AvatarProps): ReactNode;
|
|
73
|
+
export declare function Avatar({ name, pictureUrl, presence, connection, deleted, size, tintSeed, unnamedLabel }: AvatarProps): ReactNode;
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,8 @@ export { Toast, ToastRegion, Loading, EmptyState, ErrorBanner, type ToastProps,
|
|
|
5
5
|
export { State, STATE_DELAY_MS, type StateKind, type StatePlacement, type StateProps } from './components/State.js';
|
|
6
6
|
export { FileViewer, type FileViewerAction, type FileViewerConflict, type FileViewerEditing, type FileViewerProps, type FileViewerSiblings, type FileViewerState } from './components/FileViewer.js';
|
|
7
7
|
export { FilePicker, FilePickerDenied, FilePickerRestart, type FilePickerBudget, type FilePickerChoice, type FilePickerEntry, type FilePickerLabels, type FilePickerPage, type FilePickerProps, type FilePickerSpace } from './components/FilePicker.js';
|
|
8
|
-
export { SectionHeader, type SectionHeaderProps, type SectionPrimary } from './components/SectionHeader.js';
|
|
8
|
+
export { SectionHeader, type SectionAction, type SectionHeaderProps, type SectionMeta, type SectionPrimary } from './components/SectionHeader.js';
|
|
9
|
+
export { Column, type ColumnProps } from './components/Column.js';
|
|
9
10
|
export { PageHeader, TabStrip, Avatar, initialsOf, tintOf, type PageHeaderProps, type Tab, type TabStripProps, type AvatarProps, type AvatarPresence, type AvatarConnection } from './components/Structure.js';
|
|
10
11
|
export { Icon, ICON_NAMES, BOOTSTRAP_ICONS, NamedIcon, iconForName, type IconName, type IconProps } from './components/Icon.js';
|
|
11
12
|
export { AppShell, Badge, SearchField, SplitPanes, fitPanes, MailRow, ChatBubble, Composer, MAIL_ROW_LABELS, type MailRowLabels, type AppShellProps, type RailItem, type BadgeProps, type SearchFieldProps, type SplitPanesProps, type PaneSize, type Pane, type MailRowProps, type ChatBubbleProps, type ComposerProps } from './components/Workspace.js';
|