@coolms/ui-react 0.1.0-alpha.13 → 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,21 @@
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
+
12
+ ## 0.1.0-alpha.14 (2026-11-18)
13
+
14
+ Number, date and time fields, and a field of several lines, for forms the server declares.
15
+
16
+ - `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.
17
+ - `writtenOut(type, value, locale)`: the same writing out, for a host.
18
+ - `TextArea`: several lines in the text field's frame and states, with `rows`, `minLength`, `maxLength`, `required` and `locale`.
19
+
5
20
  ## 0.1.0-alpha.13 (2026-11-17)
6
21
 
7
22
  The viewer's side arrows say where they go, and the next one stands clear of the scrollbar.
@@ -9,11 +9,32 @@ interface FieldFrame {
9
9
  /** Shown, focusable and copyable, but not changed here. */
10
10
  readonly readOnly?: boolean;
11
11
  }
12
- export interface TextFieldProps extends FieldFrame {
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?: 'text' | 'email' | 'url' | 'search' | 'tel' | 'password';
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
- /** One line of text (contract component `text-field`: default, focused, disabled, read-only, invalid, pinned). */
25
- export declare function TextField({ label, help, error, disabled, readOnly, pinned, value, onChange, placeholder, type, name }: TextFieldProps): ReactNode;
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;
@@ -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
@@ -1,5 +1,5 @@
1
1
  export { Button, type ButtonProps } from './components/Button';
2
- export { TextField, Select, Toggle, type TextFieldProps, type SelectProps, type SelectOption, type ToggleProps } from './components/Fields';
2
+ export { TextField, TextArea, Select, Toggle, writtenOut, type TextFieldProps, type TextFieldType, type TextAreaProps, 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
5
  export { State, STATE_DELAY_MS, type StateKind, type StatePlacement, type StateProps } from './components/State';
@@ -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';