@coolms/ui-react 0.1.0-alpha.14 → 0.1.0-alpha.15

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,13 @@
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.15 (2026-11-18)
6
+
7
+ Resizable panes.
8
+
9
+ - `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.
10
+ - `fitPanes(sizes, room, lastMin)`: the widths the panes take in a given room, as `SplitPanes` lays them out.
11
+
5
12
  ## 0.1.0-alpha.14 (2026-11-18)
6
13
 
7
14
  Number, date and time fields, and a field of several lines, for forms the server declares.
@@ -70,6 +70,16 @@ export interface Pane {
70
70
  readonly label: string;
71
71
  readonly content: ReactNode;
72
72
  }
73
+ /** A pane the person may make wider or narrower, in px: where it is, its limits, its default, and its splitter's name. */
74
+ export interface PaneSize {
75
+ readonly width: number;
76
+ readonly min: number;
77
+ readonly max: number;
78
+ /** The width a double-click or Enter on its splitter puts it back to. */
79
+ readonly reset: number;
80
+ /** The splitter's name, in the app's language ("Resize folders"). */
81
+ readonly label: string;
82
+ }
73
83
  export interface SplitPanesProps {
74
84
  /** Two panes (a list and what is open) or three (navigation, a list, what is open). */
75
85
  readonly panes: readonly [Pane, Pane] | readonly [Pane, Pane, Pane];
@@ -86,12 +96,32 @@ export interface SplitPanesProps {
86
96
  readonly label: string;
87
97
  readonly href: string;
88
98
  };
99
+ /**
100
+ * Sizes for the panes before the last, by index: each one given draws a splitter after its pane where every pane
101
+ * shows (the desktop grid). The caller keeps the widths; the last pane takes the rest.
102
+ */
103
+ readonly sizes?: readonly (PaneSize | undefined)[];
104
+ /** The last pane's least width while splitters move and the window narrows (360 by default). */
105
+ readonly lastMin?: number;
106
+ /**
107
+ * A splitter moved pane `index` to `width`: while it is dragged (`done` false), and once more when the drag or the
108
+ * key ends (`done` true), which is when a width is worth keeping.
109
+ */
110
+ readonly onResize?: (index: number, width: number, done: boolean) => void;
89
111
  }
90
112
  /**
91
- * A section's panes: side by side on desktop, the active pane and the one before it on tablet, the active pane alone
92
- * on phone, with Back to the one before it. The last visible pane takes the rest of the width.
113
+ * The widths the panes take in `room` px: each as wanted within its limits; when the last pane would be under its
114
+ * least width, the pane nearest it gives way first, down to its own least, then the one before.
115
+ */
116
+ export declare function fitPanes(wanted: readonly PaneSize[], room: number, lastMin: number): number[];
117
+ /**
118
+ * Two or three panes side by side (contract `split-panes`), showing fewer as the window narrows. With `sizes`, the
119
+ * panes before the last are resizable where all of them show (contract `pane splitter`): each has a splitter, a
120
+ * separator dragged by mouse or touch, moved 16 px by the arrow keys, taken to its limits by Home and End, and put back
121
+ * by a double-click or Enter. The last pane is never narrower than `lastMin`; as the window narrows the pane nearest it
122
+ * gives way first.
93
123
  */
94
- export declare function SplitPanes({ panes, active, back }: SplitPanesProps): ReactNode;
124
+ export declare function SplitPanes({ panes, active, back, sizes, lastMin, onResize }: SplitPanesProps): ReactNode;
95
125
  export interface MailRowProps {
96
126
  readonly from: string;
97
127
  readonly subject: string;
package/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@ export { FileViewer, type FileViewerAction, type FileViewerEditing, type FileVie
7
7
  export { FilePicker, FilePickerDenied, type FilePickerBudget, type FilePickerChoice, type FilePickerEntry, type FilePickerLabels, type FilePickerPage, type FilePickerProps, type FilePickerSpace } from './components/FilePicker';
8
8
  export { PageHeader, TabStrip, Avatar, initialsOf, tintOf, type PageHeaderProps, type Tab, type TabStripProps, type AvatarProps } from './components/Structure';
9
9
  export { Icon, ICON_NAMES, BOOTSTRAP_ICONS, iconForName, type IconName, type IconProps } from './components/Icon';
10
- 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';
10
+ export { AppShell, Badge, SearchField, FilterChips, SplitPanes, fitPanes, MailRow, ChatBubble, Composer, MAIL_ROW_LABELS, type MailRowLabels, type AppShellProps, type RailItem, type BadgeProps, type SearchFieldProps, type FilterChipsProps, type FilterOption, type SplitPanesProps, type PaneSize, type Pane, type MailRowProps, type ChatBubbleProps, type ComposerProps } from './components/Workspace';
11
11
  export { IncomingCall, CallPanel, CallBar, CALL_LABELS, type CallLabels, type IncomingCallProps, type CallPanelProps, type CallBarProps } from './components/Call';
12
12
  export { SignInLayout, SignInForm, SIGN_IN_LABELS, type SignInLabels, type SignInLayoutProps, type SignInFormProps, type SignInFeature } from './components/SignIn';
13
13
  export { List, ContextMenu, type ListRow, type ListProps, type MenuItem, type ContextMenuProps } from './components/Collections';