@bigpixelrocket/uiok 0.2.3 → 0.4.0

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.
Files changed (215) hide show
  1. package/CHANGELOG.md +48 -1
  2. package/dist/charts/Sparkline.d.ts +20 -0
  3. package/dist/charts/Sparkline.js +12 -0
  4. package/dist/charts/Sparkline.logic.d.ts +9 -0
  5. package/dist/charts/Sparkline.logic.js +27 -0
  6. package/dist/charts/charts.css +17 -0
  7. package/dist/charts/index.d.ts +2 -0
  8. package/dist/charts/index.js +2 -0
  9. package/dist/dialog/ConfirmDialog.d.ts +17 -1
  10. package/dist/dialog/ConfirmDialog.js +4 -3
  11. package/dist/dialog/ModalDialog.d.ts +8 -0
  12. package/dist/dialog/ModalDialog.js +4 -2
  13. package/dist/dialog/ProgressDialog.d.ts +40 -0
  14. package/dist/dialog/ProgressDialog.js +40 -0
  15. package/dist/dialog/TypedNameDialog.d.ts +44 -0
  16. package/dist/dialog/TypedNameDialog.js +17 -0
  17. package/dist/dialog/index.d.ts +5 -2
  18. package/dist/dialog/index.js +4 -1
  19. package/dist/field/Check.d.ts +9 -2
  20. package/dist/field/Check.js +5 -4
  21. package/dist/field/Controls.d.ts +198 -0
  22. package/dist/field/Controls.js +94 -0
  23. package/dist/field/FieldLayout.d.ts +126 -0
  24. package/dist/field/FieldLayout.js +89 -0
  25. package/dist/field/Switch.d.ts +26 -0
  26. package/dist/field/Switch.js +20 -0
  27. package/dist/field/index.d.ts +10 -6
  28. package/dist/field/index.js +10 -6
  29. package/dist/frame/AppRoot.d.ts +44 -0
  30. package/dist/frame/AppRoot.js +26 -0
  31. package/dist/frame/Dock.d.ts +88 -0
  32. package/dist/frame/Dock.js +129 -0
  33. package/dist/frame/FilterChips.d.ts +28 -0
  34. package/dist/frame/FilterChips.js +14 -0
  35. package/dist/frame/PageParts.d.ts +69 -0
  36. package/dist/frame/PageParts.js +60 -0
  37. package/dist/frame/PaneSplit.d.ts +74 -0
  38. package/dist/frame/PaneSplit.js +197 -0
  39. package/dist/frame/SidebarResizer.d.ts +35 -0
  40. package/dist/frame/SidebarResizer.js +43 -0
  41. package/dist/frame/StatusNotice.d.ts +20 -0
  42. package/dist/frame/StatusNotice.js +13 -0
  43. package/dist/frame/Tree.d.ts +147 -0
  44. package/dist/frame/Tree.js +164 -0
  45. package/dist/frame/TreeToggle.d.ts +18 -0
  46. package/dist/frame/TreeToggle.js +17 -0
  47. package/dist/frame/WindowFrame.d.ts +57 -0
  48. package/dist/frame/WindowFrame.js +19 -0
  49. package/dist/frame/frame.css +801 -0
  50. package/dist/frame/index.d.ts +22 -0
  51. package/dist/frame/index.js +22 -0
  52. package/dist/frame/sharedRef.d.ts +8 -0
  53. package/dist/frame/sharedRef.js +26 -0
  54. package/dist/index.d.ts +3 -0
  55. package/dist/index.js +3 -0
  56. package/dist/labels/UiokLabels.d.ts +6 -0
  57. package/dist/labels/UiokLabels.js +5 -1
  58. package/dist/labels/dialog.d.ts +12 -0
  59. package/dist/labels/dialog.js +7 -1
  60. package/dist/labels/index.d.ts +2 -0
  61. package/dist/labels/index.js +2 -0
  62. package/dist/labels/settings.d.ts +46 -0
  63. package/dist/labels/settings.js +29 -0
  64. package/dist/labels/viewer.d.ts +193 -0
  65. package/dist/labels/viewer.js +124 -0
  66. package/dist/listing/EmptyState.d.ts +40 -0
  67. package/dist/listing/EmptyState.js +14 -0
  68. package/dist/listing/PaneMessage.d.ts +28 -0
  69. package/dist/listing/PaneMessage.js +12 -0
  70. package/dist/listing/index.d.ts +5 -1
  71. package/dist/listing/index.js +5 -1
  72. package/dist/listing/listing.css +66 -2
  73. package/dist/log/LogWell.d.ts +34 -0
  74. package/dist/log/LogWell.js +39 -0
  75. package/dist/log/LogWell.logic.d.ts +16 -0
  76. package/dist/log/LogWell.logic.js +26 -0
  77. package/dist/log/index.d.ts +8 -0
  78. package/dist/log/index.js +8 -0
  79. package/dist/log/log.css +57 -0
  80. package/dist/pane/Pane.d.ts +49 -0
  81. package/dist/pane/Pane.js +17 -0
  82. package/dist/pane/PaneKeys.d.ts +10 -3
  83. package/dist/pane/PaneKeys.js +26 -7
  84. package/dist/pane/index.d.ts +4 -2
  85. package/dist/pane/index.js +4 -2
  86. package/dist/pane/usePaneKeys.js +9 -11
  87. package/dist/shell/AboutWindow.d.ts +21 -0
  88. package/dist/shell/AboutWindow.js +10 -0
  89. package/dist/shell/LanguageChoice.d.ts +27 -0
  90. package/dist/shell/LanguageChoice.js +17 -0
  91. package/dist/shell/LoadFailure.d.ts +22 -0
  92. package/dist/shell/LoadFailure.js +15 -0
  93. package/dist/shell/Lockup.d.ts +52 -0
  94. package/dist/shell/Lockup.js +30 -0
  95. package/dist/shell/SettingsDialog.d.ts +97 -0
  96. package/dist/shell/SettingsDialog.js +219 -0
  97. package/dist/shell/SettingsDialog.logic.d.ts +33 -0
  98. package/dist/shell/SettingsDialog.logic.js +42 -0
  99. package/dist/shell/SettingsFiles.d.ts +55 -0
  100. package/dist/shell/SettingsFiles.js +30 -0
  101. package/dist/shell/SettingsPageKeys.d.ts +42 -0
  102. package/dist/shell/SettingsPageKeys.js +70 -0
  103. package/dist/shell/SettingsSubsection.d.ts +34 -0
  104. package/dist/shell/SettingsSubsection.js +30 -0
  105. package/dist/shell/SignIn.d.ts +61 -0
  106. package/dist/shell/SignIn.js +36 -0
  107. package/dist/shell/ThemePicker.d.ts +74 -0
  108. package/dist/shell/ThemePicker.js +96 -0
  109. package/dist/shell/ThemePicker.logic.d.ts +13 -0
  110. package/dist/shell/ThemePicker.logic.js +26 -0
  111. package/dist/shell/TitleBar.d.ts +44 -0
  112. package/dist/shell/TitleBar.js +23 -0
  113. package/dist/shell/UpdatePill.d.ts +26 -0
  114. package/dist/shell/UpdatePill.js +17 -0
  115. package/dist/shell/Updates.d.ts +99 -0
  116. package/dist/shell/Updates.js +72 -0
  117. package/dist/shell/index.d.ts +27 -0
  118. package/dist/shell/index.js +27 -0
  119. package/dist/shell/shell.css +243 -4
  120. package/dist/styles.css +5 -0
  121. package/dist/surface/Card.d.ts +18 -0
  122. package/dist/surface/Card.js +10 -0
  123. package/dist/surface/Notice.d.ts +45 -0
  124. package/dist/surface/Notice.js +27 -0
  125. package/dist/surface/index.d.ts +5 -3
  126. package/dist/surface/index.js +5 -3
  127. package/dist/themes/catalog.js +4 -0
  128. package/dist/themes/themes.generated.css +245 -0
  129. package/dist/themes/tokens.d.ts +17 -5
  130. package/dist/themes/tokens.js +67 -1
  131. package/dist/tokens.css +11 -0
  132. package/dist/viewer/AudioView.d.ts +13 -0
  133. package/dist/viewer/AudioView.js +25 -0
  134. package/dist/viewer/HexJump.logic.d.ts +16 -0
  135. package/dist/viewer/HexJump.logic.js +27 -0
  136. package/dist/viewer/HexRows.logic.d.ts +55 -0
  137. package/dist/viewer/HexRows.logic.js +84 -0
  138. package/dist/viewer/HexSelection.logic.d.ts +57 -0
  139. package/dist/viewer/HexSelection.logic.js +68 -0
  140. package/dist/viewer/HexView.d.ts +10 -0
  141. package/dist/viewer/HexView.js +291 -0
  142. package/dist/viewer/HexViewport.logic.d.ts +61 -0
  143. package/dist/viewer/HexViewport.logic.js +79 -0
  144. package/dist/viewer/ImageView.d.ts +19 -0
  145. package/dist/viewer/ImageView.js +230 -0
  146. package/dist/viewer/ImageZoom.logic.d.ts +65 -0
  147. package/dist/viewer/ImageZoom.logic.js +119 -0
  148. package/dist/viewer/LatestRead.logic.d.ts +27 -0
  149. package/dist/viewer/LatestRead.logic.js +55 -0
  150. package/dist/viewer/MediaControls.d.ts +25 -0
  151. package/dist/viewer/MediaControls.js +183 -0
  152. package/dist/viewer/MediaPlayer.logic.d.ts +53 -0
  153. package/dist/viewer/MediaPlayer.logic.js +68 -0
  154. package/dist/viewer/PdfView.d.ts +23 -0
  155. package/dist/viewer/PdfView.js +25 -0
  156. package/dist/viewer/QuietFocus.d.ts +19 -0
  157. package/dist/viewer/QuietFocus.js +27 -0
  158. package/dist/viewer/ScaledScroll.logic.d.ts +30 -0
  159. package/dist/viewer/ScaledScroll.logic.js +28 -0
  160. package/dist/viewer/ScaledScrollbar.d.ts +19 -0
  161. package/dist/viewer/ScaledScrollbar.js +71 -0
  162. package/dist/viewer/SyntaxHighlighter.d.ts +29 -0
  163. package/dist/viewer/SyntaxHighlighter.js +144 -0
  164. package/dist/viewer/SyntaxLanguage.logic.d.ts +110 -0
  165. package/dist/viewer/SyntaxLanguage.logic.js +283 -0
  166. package/dist/viewer/SyntaxService.d.ts +75 -0
  167. package/dist/viewer/SyntaxService.js +49 -0
  168. package/dist/viewer/SyntaxSession.logic.d.ts +78 -0
  169. package/dist/viewer/SyntaxSession.logic.js +221 -0
  170. package/dist/viewer/SyntaxWorker.d.ts +6 -0
  171. package/dist/viewer/SyntaxWorker.js +8 -0
  172. package/dist/viewer/TextEncoding.logic.d.ts +35 -0
  173. package/dist/viewer/TextEncoding.logic.js +58 -0
  174. package/dist/viewer/TextRows.logic.d.ts +86 -0
  175. package/dist/viewer/TextRows.logic.js +241 -0
  176. package/dist/viewer/TextSelection.logic.d.ts +97 -0
  177. package/dist/viewer/TextSelection.logic.js +139 -0
  178. package/dist/viewer/TextView.d.ts +13 -0
  179. package/dist/viewer/TextView.js +448 -0
  180. package/dist/viewer/TextViewport.logic.d.ts +70 -0
  181. package/dist/viewer/TextViewport.logic.js +116 -0
  182. package/dist/viewer/VideoView.d.ts +18 -0
  183. package/dist/viewer/VideoView.js +53 -0
  184. package/dist/viewer/ViewerClipboard.d.ts +30 -0
  185. package/dist/viewer/ViewerClipboard.js +70 -0
  186. package/dist/viewer/ViewerFrame.logic.d.ts +61 -0
  187. package/dist/viewer/ViewerFrame.logic.js +130 -0
  188. package/dist/viewer/ViewerKeys.d.ts +16 -0
  189. package/dist/viewer/ViewerKeys.js +14 -0
  190. package/dist/viewer/ViewerScope.d.ts +12 -0
  191. package/dist/viewer/ViewerScope.js +22 -0
  192. package/dist/viewer/ViewerViews.d.ts +28 -0
  193. package/dist/viewer/ViewerViews.js +22 -0
  194. package/dist/viewer/ViewerWindow.d.ts +53 -0
  195. package/dist/viewer/ViewerWindow.js +219 -0
  196. package/dist/viewer/index.d.ts +12 -0
  197. package/dist/viewer/index.js +12 -0
  198. package/dist/viewer/types.d.ts +151 -0
  199. package/dist/viewer/types.js +26 -0
  200. package/dist/viewer/useElementHeight.d.ts +6 -0
  201. package/dist/viewer/useElementHeight.js +22 -0
  202. package/dist/viewer/useElementSize.d.ts +7 -0
  203. package/dist/viewer/useElementSize.js +24 -0
  204. package/dist/viewer/useEscapeToClear.d.ts +8 -0
  205. package/dist/viewer/useEscapeToClear.js +26 -0
  206. package/dist/viewer/useHexDocument.d.ts +41 -0
  207. package/dist/viewer/useHexDocument.js +144 -0
  208. package/dist/viewer/useMediaElement.d.ts +10 -0
  209. package/dist/viewer/useMediaElement.js +24 -0
  210. package/dist/viewer/useSyntaxHighlight.d.ts +24 -0
  211. package/dist/viewer/useSyntaxHighlight.js +133 -0
  212. package/dist/viewer/useTextDocument.d.ts +66 -0
  213. package/dist/viewer/useTextDocument.js +245 -0
  214. package/dist/viewer/viewer.css +645 -0
  215. package/package.json +7 -1
@@ -0,0 +1,198 @@
1
+ import type { LucideIcon } from 'lucide-react';
2
+ import type { ChangeEvent, ComponentPropsWithRef, ReactElement, ReactNode } from 'react';
3
+ /**
4
+ * A field's height by where it stands: `md` (28px) in a dialog or a single
5
+ * prompt, `sm` (24px) in a page form, a toolbar, or a settings row, `xs`
6
+ * (20px) inside a row or a path bar.
7
+ */
8
+ export type FieldSize = 'md' | 'sm' | 'xs';
9
+ /**
10
+ * A field's width: `full`, its column's (the default); `short`, eight
11
+ * characters for a port or a code; `count`, a few digits; `countOrWord`, a
12
+ * count whose empty field reads as a word ("No limit").
13
+ */
14
+ export type FieldWidth = 'full' | 'short' | 'count' | 'countOrWord';
15
+ /**
16
+ * A field's tone: `warning` a value that works but needs a second look,
17
+ * `accent` a value changed from its default. A problem wins over either.
18
+ */
19
+ export type FieldTone = 'warning' | 'accent';
20
+ /** The props every field shares, beside its element's own. */
21
+ interface FieldLook {
22
+ /** Its height by place; `md` unless given. */
23
+ readonly size?: FieldSize;
24
+ /** Outlines it in the danger tone; a `FieldRow` with a problem sets it on its own. */
25
+ readonly invalid?: boolean;
26
+ /** A warning or a changed value. */
27
+ readonly tone?: FieldTone;
28
+ }
29
+ /** Props for {@link TextField}: an input's own, but its class, style, and change handler. */
30
+ export interface TextFieldProps extends FieldLook, Omit<ComponentPropsWithRef<'input'>, 'className' | 'style' | 'size' | 'onChange' | 'value' | 'defaultValue'> {
31
+ /** The text it holds. */
32
+ readonly value: string;
33
+ /** Hears the text as typed. */
34
+ readonly onChange?: (value: string, event: ChangeEvent<HTMLInputElement>) => void;
35
+ /** Its width; its column's unless given. */
36
+ readonly width?: FieldWidth;
37
+ /**
38
+ * The field holds no value (SQL NULL): its placeholder shows in the
39
+ * missing value's dim italic.
40
+ */
41
+ readonly nullValue?: boolean;
42
+ }
43
+ /**
44
+ * A text, number, password, or search field in the shared well, its value in
45
+ * the code face. A number field draws the stepper cap. In a `FieldRow` it
46
+ * takes the row's label, note, problem, and help. Draws `input.field`.
47
+ */
48
+ export declare function TextField({ value, onChange, size, width, invalid, tone, nullValue, id, 'aria-describedby': describedBy, type, ...props }: TextFieldProps): ReactElement;
49
+ /** Props for {@link TextArea}: a textarea's own, but its class, style, and change handler. */
50
+ export interface TextAreaProps extends FieldLook, Omit<ComponentPropsWithRef<'textarea'>, 'className' | 'style' | 'onChange' | 'value' | 'defaultValue'> {
51
+ /** The text it holds. */
52
+ readonly value: string;
53
+ /** Hears the text as typed. */
54
+ readonly onChange?: (value: string, event: ChangeEvent<HTMLTextAreaElement>) => void;
55
+ }
56
+ /**
57
+ * Text of several lines in the shared well, with no corner grip: its pane or
58
+ * dialog sizes it (`rows`). In a `FieldRow` it takes the row's wiring.
59
+ * Draws `textarea.field`.
60
+ */
61
+ export declare function TextArea({ value, onChange, size, invalid, tone, id, 'aria-describedby': describedBy, ...props }: TextAreaProps): ReactElement;
62
+ /** One item of a `Select`. */
63
+ export interface SelectOption {
64
+ /** What `onChange` hears when it is chosen. */
65
+ readonly value: string;
66
+ /** Its words in the list. */
67
+ readonly label: string;
68
+ readonly disabled?: boolean;
69
+ }
70
+ /** A named run of a `Select`'s items. */
71
+ export interface SelectOptionGroup {
72
+ /** The run's heading in the list. */
73
+ readonly group: string;
74
+ readonly options: readonly SelectOption[];
75
+ }
76
+ /** Props for {@link Select}: a select's own, but its class, style, children, and change handler. */
77
+ export interface SelectProps extends FieldLook, Omit<ComponentPropsWithRef<'select'>, 'className' | 'style' | 'onChange' | 'value' | 'defaultValue' | 'children' | 'multiple' | 'size'> {
78
+ /** The chosen item's value. */
79
+ readonly value: string;
80
+ /** Its items, plain or in named runs. */
81
+ readonly options: readonly (SelectOption | SelectOptionGroup)[];
82
+ /** Hears the value chosen. */
83
+ readonly onChange: (value: string, event: ChangeEvent<HTMLSelectElement>) => void;
84
+ }
85
+ /**
86
+ * A pop-up of items in the shared well with an up and down chevron pair; in
87
+ * a `FieldRow` it is as wide as its longest item. Draws `select.field`.
88
+ */
89
+ export declare function Select({ value, options, onChange, size, invalid, tone, id, 'aria-describedby': describedBy, ...props }: SelectProps): ReactElement;
90
+ /** Props for {@link FieldBox}: a text field with a glyph before it. */
91
+ export interface FieldBoxProps extends Omit<TextFieldProps, 'width' | 'nullValue' | 'tone'> {
92
+ /** The glyph before the text (a magnifier for a filter). */
93
+ readonly glyph: LucideIcon;
94
+ }
95
+ /**
96
+ * The field's frame round a leading glyph and its text: a filter or search
97
+ * box. Draws `.field-box` round a bare input.
98
+ */
99
+ export declare function FieldBox({ glyph: Glyph, value, onChange, size, invalid, id, 'aria-describedby': describedBy, type, ...props }: FieldBoxProps): ReactElement;
100
+ /** Props for {@link FieldEditor}. */
101
+ export interface FieldEditorProps {
102
+ /** The editor the app brings (CodeMirror, Monaco), given its height. */
103
+ readonly children: ReactNode;
104
+ /** Outlines it in the danger tone. */
105
+ readonly invalid?: boolean;
106
+ /** Marks a value changed from its default. */
107
+ readonly changed?: boolean;
108
+ /** Recesses its ground and draws no focus edge: a value to read, not edit. */
109
+ readonly readOnly?: boolean;
110
+ }
111
+ /**
112
+ * A code editor standing in a form as a field: the field's well, hover,
113
+ * focus edge, and tones on its container, clipped to the field's corners.
114
+ * Draws `.field-editor`.
115
+ */
116
+ export declare function FieldEditor({ children, invalid, changed, readOnly }: FieldEditorProps): ReactElement;
117
+ /** Props for {@link Radio}. */
118
+ export interface RadioProps {
119
+ /** The group it belongs to: every radio of one choice shares it. */
120
+ readonly name: string;
121
+ /** What `onChange` hears when it is chosen. */
122
+ readonly value: string;
123
+ /** Whether it is the chosen one. */
124
+ readonly checked: boolean;
125
+ /** Hears its value when it is chosen. */
126
+ readonly onChange: (value: string) => void;
127
+ /** Its words, beside it; the whole label is its target. */
128
+ readonly label: ReactNode;
129
+ /** A choice whose effect is destructive (`danger`) or needs care (`warning`). */
130
+ readonly tone?: 'danger' | 'warning';
131
+ /** Marks the choice wrong. */
132
+ readonly invalid?: boolean;
133
+ readonly disabled?: boolean;
134
+ }
135
+ /**
136
+ * One choice of several, a disc in the shared `.check` look with its words
137
+ * in a `field-choice` label. Put a run of them in a `FieldGroup`.
138
+ */
139
+ export declare function Radio({ name, value, checked, onChange, label, tone, invalid, disabled }: RadioProps): ReactElement;
140
+ /** Props for {@link Range}. */
141
+ export interface RangeProps {
142
+ /** Where the knob stands. */
143
+ readonly value: number;
144
+ /** Hears the value as the knob moves. */
145
+ readonly onChange: (value: number) => void;
146
+ /** The smallest value; 0 unless given. */
147
+ readonly min?: number;
148
+ /** The largest value; 100 unless given. */
149
+ readonly max?: number;
150
+ /** The step between values; any value unless given. */
151
+ readonly step?: number | 'any';
152
+ /** Its accessible name ("Volume") outside a `FieldRow`; in one, the row's label names it instead. */
153
+ readonly label?: string;
154
+ /** The value as words, read by assistive technology ("1:05 of 3:20"). */
155
+ readonly valueText?: string;
156
+ readonly disabled?: boolean;
157
+ }
158
+ /**
159
+ * A slider: a trough filled in the accent up to the knob. In a `FieldRow` it
160
+ * takes the row's label and description. Draws `input.range` with
161
+ * `--range-fill` set from the value.
162
+ */
163
+ export declare function Range({ value, onChange, min, max, step, label, valueText, disabled }: RangeProps): ReactElement;
164
+ /** Props for {@link Meter}. */
165
+ export interface MeterProps {
166
+ /** The measure (a password's strength, a quota used). */
167
+ readonly value: number;
168
+ readonly min?: number;
169
+ readonly max?: number;
170
+ /** Where the low range ends. */
171
+ readonly low: number;
172
+ /** Where the high range starts. */
173
+ readonly high: number;
174
+ /** A value in the range that is good: low, middle, or high. */
175
+ readonly optimum: number;
176
+ /** Its accessible name ("Strength") outside a `FieldRow`; in one, the row's label names it instead. */
177
+ readonly label?: string;
178
+ }
179
+ /**
180
+ * A measure in a pill trough, filled in the success tone in its optimum
181
+ * range, the warning tone one range away, and the danger tone at the least
182
+ * good. In a `FieldRow` it takes the row's label and description. Draws a
183
+ * themed `<meter>`.
184
+ */
185
+ export declare function Meter({ value, min, max, low, high, optimum, label }: MeterProps): ReactElement;
186
+ /** Props for {@link RestoreDefault}. */
187
+ export interface RestoreDefaultProps {
188
+ /** Its words: "Restore Default". */
189
+ readonly children: string;
190
+ /** Sets the setting back to its default. */
191
+ readonly onClick: () => void;
192
+ }
193
+ /**
194
+ * The dim link-like button beside a setting changed from its default that
195
+ * sets it back. Draws `.text-link.settings-restore`.
196
+ */
197
+ export declare function RestoreDefault({ children, onClick }: RestoreDefaultProps): ReactElement;
198
+ export {};
@@ -0,0 +1,94 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ICON_SM } from '../icon/sizes.js';
3
+ import { useFieldWiring } from './FieldLayout.js';
4
+ const SIZE_CLASS = { md: '', sm: 'field-sm', xs: 'field-xs' };
5
+ const WIDTH_CLASS = {
6
+ full: '',
7
+ short: 'field-short',
8
+ count: 'settings-count',
9
+ countOrWord: 'settings-count-or-word'
10
+ };
11
+ const classes = (...names) => names.filter(Boolean).join(' ');
12
+ /**
13
+ * A text, number, password, or search field in the shared well, its value in
14
+ * the code face. A number field draws the stepper cap. In a `FieldRow` it
15
+ * takes the row's label, note, problem, and help. Draws `input.field`.
16
+ */
17
+ export function TextField({ value, onChange, size = 'md', width = 'full', invalid, tone, nullValue = false, id, 'aria-describedby': describedBy, type = 'text', ...props }) {
18
+ const wiring = useFieldWiring({ id, describedBy, invalid });
19
+ return (_jsx("input", { ...props, ...wiring, className: classes('field', SIZE_CLASS[size], WIDTH_CLASS[width], nullValue && 'value-null'), "data-tone": tone, onChange: onChange === undefined ? undefined : (event) => onChange(event.target.value, event), readOnly: props.readOnly ?? onChange === undefined, type: type, value: value }));
20
+ }
21
+ /**
22
+ * Text of several lines in the shared well, with no corner grip: its pane or
23
+ * dialog sizes it (`rows`). In a `FieldRow` it takes the row's wiring.
24
+ * Draws `textarea.field`.
25
+ */
26
+ export function TextArea({ value, onChange, size = 'md', invalid, tone, id, 'aria-describedby': describedBy, ...props }) {
27
+ const wiring = useFieldWiring({ id, describedBy, invalid });
28
+ return (_jsx("textarea", { ...props, ...wiring, className: classes('field', SIZE_CLASS[size]), "data-tone": tone, onChange: onChange === undefined ? undefined : (event) => onChange(event.target.value, event), readOnly: props.readOnly ?? onChange === undefined, value: value }));
29
+ }
30
+ const optionElement = (option) => (_jsx("option", { disabled: option.disabled, value: option.value, children: option.label }, option.value));
31
+ /**
32
+ * A pop-up of items in the shared well with an up and down chevron pair; in
33
+ * a `FieldRow` it is as wide as its longest item. Draws `select.field`.
34
+ */
35
+ export function Select({ value, options, onChange, size = 'md', invalid, tone, id, 'aria-describedby': describedBy, ...props }) {
36
+ const wiring = useFieldWiring({ id, describedBy, invalid });
37
+ return (_jsx("select", { ...props, ...wiring, className: classes('field', SIZE_CLASS[size]), "data-tone": tone, onChange: (event) => onChange(event.target.value, event), value: value, children: options.map((entry) => 'group' in entry ? (_jsx("optgroup", { label: entry.group, children: entry.options.map(optionElement) }, `group:${entry.group}`)) : (optionElement(entry))) }));
38
+ }
39
+ /**
40
+ * The field's frame round a leading glyph and its text: a filter or search
41
+ * box. Draws `.field-box` round a bare input.
42
+ */
43
+ export function FieldBox({ glyph: Glyph, value, onChange, size = 'md', invalid, id, 'aria-describedby': describedBy, type = 'text', ...props }) {
44
+ const wiring = useFieldWiring({ id, describedBy, invalid });
45
+ // The frame draws the danger outline; the input is what a screen reader
46
+ // hears as invalid.
47
+ return (_jsxs("label", { "aria-invalid": wiring['aria-invalid'], className: classes('field-box', SIZE_CLASS[size]), children: [_jsx(Glyph, { "aria-hidden": true, size: ICON_SM }), _jsx("input", { ...props, ...wiring, onChange: onChange === undefined ? undefined : (event) => onChange(event.target.value, event), readOnly: props.readOnly ?? onChange === undefined, type: type, value: value })] }));
48
+ }
49
+ /**
50
+ * A code editor standing in a form as a field: the field's well, hover,
51
+ * focus edge, and tones on its container, clipped to the field's corners.
52
+ * Draws `.field-editor`.
53
+ */
54
+ export function FieldEditor({ children, invalid = false, changed = false, readOnly = false }) {
55
+ return (_jsx("div", { "aria-invalid": invalid ? true : undefined, className: readOnly ? 'field-editor read-only' : 'field-editor', "data-tone": changed ? 'accent' : undefined, children: children }));
56
+ }
57
+ /**
58
+ * One choice of several, a disc in the shared `.check` look with its words
59
+ * in a `field-choice` label. Put a run of them in a `FieldGroup`.
60
+ */
61
+ export function Radio({ name, value, checked, onChange, label, tone, invalid = false, disabled = false }) {
62
+ return (_jsxs("label", { className: "field-choice", children: [_jsx("input", { "aria-invalid": invalid ? true : undefined, checked: checked, className: "check", "data-tone": tone, disabled: disabled, name: name, onChange: () => onChange(value), type: "radio", value: value }), label] }));
63
+ }
64
+ /**
65
+ * A slider: a trough filled in the accent up to the knob. In a `FieldRow` it
66
+ * takes the row's label and description. Draws `input.range` with
67
+ * `--range-fill` set from the value.
68
+ */
69
+ export function Range({ value, onChange, min = 0, max = 100, step = 'any', label, valueText, disabled = false }) {
70
+ const span = max - min;
71
+ const fill = span > 0 ? Math.min(100, Math.max(0, ((value - min) / span) * 100)) : 0;
72
+ const wiring = useFieldWiring({});
73
+ // In a row its label names it; an aria-label would override that.
74
+ const inRow = wiring.id !== undefined;
75
+ return (_jsx("input", { ...wiring, "aria-label": inRow ? undefined : label, "aria-valuetext": valueText, className: "range", disabled: disabled, max: max, min: min, onChange: (event) => onChange(Number(event.target.value)), step: step, style: { '--range-fill': `${fill}%` }, type: "range", value: value }));
76
+ }
77
+ /**
78
+ * A measure in a pill trough, filled in the success tone in its optimum
79
+ * range, the warning tone one range away, and the danger tone at the least
80
+ * good. In a `FieldRow` it takes the row's label and description. Draws a
81
+ * themed `<meter>`.
82
+ */
83
+ export function Meter({ value, min = 0, max = 1, low, high, optimum, label }) {
84
+ const { id, 'aria-describedby': describedBy } = useFieldWiring({});
85
+ // In a row its label names it; an aria-label would override that.
86
+ return (_jsx("meter", { "aria-describedby": describedBy, "aria-label": id === undefined ? label : undefined, id: id, high: high, low: low, max: max, min: min, optimum: optimum, value: value }));
87
+ }
88
+ /**
89
+ * The dim link-like button beside a setting changed from its default that
90
+ * sets it back. Draws `.text-link.settings-restore`.
91
+ */
92
+ export function RestoreDefault({ children, onClick }) {
93
+ return (_jsx("button", { className: "text-link settings-restore", onClick: onClick, type: "button", children: _jsx("span", { className: "text-link-words", children: children }) }));
94
+ }
@@ -0,0 +1,126 @@
1
+ import { type ReactElement, type ReactNode } from 'react';
2
+ /**
3
+ * What a `FieldRow` tells the one control it holds: the id its label names,
4
+ * the ids of what describes it (the problem, the note, and the help a
5
+ * screen reader reads as the control takes focus), and whether its value is
6
+ * wrong.
7
+ */
8
+ export interface FieldRowWiring {
9
+ readonly id: string;
10
+ readonly describedBy: string | undefined;
11
+ readonly invalid: boolean;
12
+ }
13
+ /**
14
+ * The attributes a control takes from the `FieldRow` it stands in, with
15
+ * any it sets itself: its id (the row's, which its label names, so in a row
16
+ * give the id to `FieldRow`), `aria-describedby` (its own ids first), and
17
+ * `aria-invalid`.
18
+ */
19
+ export declare function useFieldWiring(own: {
20
+ readonly id?: string | undefined;
21
+ readonly describedBy?: string | undefined;
22
+ readonly invalid?: boolean | undefined;
23
+ }): {
24
+ readonly id: string | undefined;
25
+ readonly 'aria-describedby': string | undefined;
26
+ readonly 'aria-invalid': true | undefined;
27
+ };
28
+ /** Props for {@link FieldGrid}. */
29
+ export interface FieldGridProps {
30
+ /** Its rows: `FieldRow`s, and any `FieldGroup` or line that spans both columns. */
31
+ readonly children: ReactNode;
32
+ /**
33
+ * The label column's width (`136px`, `12em`); by default as wide as the
34
+ * longest label, capped at 40% of the form.
35
+ */
36
+ readonly labelWidth?: string;
37
+ }
38
+ /**
39
+ * A form laid out as rows of a label and its value on one label column,
40
+ * each label centred on its control's first line. Draws `.field-grid`.
41
+ */
42
+ export declare function FieldGrid({ children, labelWidth }: FieldGridProps): ReactElement;
43
+ /** Props for {@link FieldRow}. */
44
+ export interface FieldRowProps {
45
+ /** What the field is for: "Host". */
46
+ readonly label: ReactNode;
47
+ /** A quieter second line under the label (which of two bands is in use). */
48
+ readonly labelDetail?: ReactNode;
49
+ /**
50
+ * What the control is for, as the label's tooltip and the control's
51
+ * accessible description (`labelHelp`); the label shows a dashed cue.
52
+ */
53
+ readonly help?: string;
54
+ /**
55
+ * The value: one control (`TextField`, `Select`, …), which takes the
56
+ * row's id, note, problem, and help on its own, or `FieldOption` lines.
57
+ */
58
+ readonly children: ReactNode;
59
+ /** One short line under the control on what the current choice does. */
60
+ readonly note?: ReactNode;
61
+ /** What is wrong with the value; marks the control invalid while set. */
62
+ readonly problem?: ReactNode;
63
+ /**
64
+ * Names a group of controls (radios, checks) rather than one: the label
65
+ * becomes the group's name, not a `<label>` for one control.
66
+ */
67
+ readonly group?: boolean;
68
+ /**
69
+ * The control's id, when the app must know it; one is made otherwise. The
70
+ * row's id wins over one the control sets, so its label always names it.
71
+ */
72
+ readonly id?: string;
73
+ }
74
+ /**
75
+ * One row of a `FieldGrid`: the label, then the value with its note and
76
+ * problem under it. The one control inside takes the label's id, the
77
+ * problem, note, and help as its description, and `aria-invalid` while a
78
+ * problem stands, with no wiring by the app. Draws
79
+ * `.field-label` and `.field-value` with `.field-note` and `.field-problem`.
80
+ */
81
+ export declare function FieldRow({ label, labelDetail, help, children, note, problem, group, id }: FieldRowProps): ReactElement;
82
+ /** Props for {@link FieldOption}. */
83
+ export interface FieldOptionProps {
84
+ /** Choices or a field and its words, on one wrapping line. */
85
+ readonly children: ReactNode;
86
+ }
87
+ /** One line of a row's value (a field and a choice beside it), at least a control high. Draws `.field-option`. */
88
+ export declare function FieldOption({ children }: FieldOptionProps): ReactElement;
89
+ /** Props for {@link FieldNote} and {@link FieldProblem}. */
90
+ export interface FieldMessageProps {
91
+ /** Its words. */
92
+ readonly children: ReactNode;
93
+ /** Its id, for a control's `aria-describedby`. */
94
+ readonly id?: string;
95
+ }
96
+ /**
97
+ * One short line under a control on what the current choice does ("Worn
98
+ * while the system is light."). Draws `.field-note`.
99
+ */
100
+ export declare function FieldNote({ children, id }: FieldMessageProps): ReactElement;
101
+ /**
102
+ * What is wrong with a value, as a status line led by the danger glyph.
103
+ * Name it in the control's `aria-describedby` (`FieldRow` does). Draws
104
+ * `.field-problem`.
105
+ */
106
+ export declare function FieldProblem({ children, id }: FieldMessageProps): ReactElement;
107
+ /** Props for {@link FieldGroup}. */
108
+ export interface FieldGroupProps {
109
+ /** The group's name, as its legend: "Show". */
110
+ readonly legend: ReactNode;
111
+ /** Speaks the legend without drawing it, for a group a row's label already names. */
112
+ readonly legendHidden?: boolean;
113
+ /** Its choices: `Check`s or `Radio`s with their labels. */
114
+ readonly children: ReactNode;
115
+ /** Lays the choices in this many columns of equal width, filled row by row. */
116
+ readonly columns?: number;
117
+ /** One short line under the choices. */
118
+ readonly note?: ReactNode;
119
+ /** What is wrong with the choice. */
120
+ readonly problem?: ReactNode;
121
+ }
122
+ /**
123
+ * A group of choices under its legend, 4px apart, or in `columns`. Draws
124
+ * `fieldset.field-group` (`.field-columns`).
125
+ */
126
+ export declare function FieldGroup({ legend, legendHidden, children, columns, note, problem }: FieldGroupProps): ReactElement;
@@ -0,0 +1,89 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { createContext, use, useId } from 'react';
3
+ import { VisuallyHidden } from '../VisuallyHidden.js';
4
+ import { labelHelp } from './labelHelp.js';
5
+ /** The wiring of the row a control stands in; null outside a `FieldRow`. */
6
+ const FieldRowContext = createContext(null);
7
+ /**
8
+ * The attributes a control takes from the `FieldRow` it stands in, with
9
+ * any it sets itself: its id (the row's, which its label names, so in a row
10
+ * give the id to `FieldRow`), `aria-describedby` (its own ids first), and
11
+ * `aria-invalid`.
12
+ */
13
+ export function useFieldWiring(own) {
14
+ const row = use(FieldRowContext);
15
+ const describedBy = [own.describedBy, row?.describedBy].filter(Boolean).join(' ');
16
+ const invalid = own.invalid ?? row?.invalid ?? false;
17
+ return {
18
+ id: row?.id ?? own.id,
19
+ 'aria-describedby': describedBy === '' ? undefined : describedBy,
20
+ 'aria-invalid': invalid ? true : undefined
21
+ };
22
+ }
23
+ /**
24
+ * A form laid out as rows of a label and its value on one label column,
25
+ * each label centred on its control's first line. Draws `.field-grid`.
26
+ */
27
+ export function FieldGrid({ children, labelWidth }) {
28
+ return (_jsx("div", { className: "field-grid", style: labelWidth === undefined
29
+ ? undefined
30
+ : { '--field-label-width': labelWidth }, children: children }));
31
+ }
32
+ /**
33
+ * One row of a `FieldGrid`: the label, then the value with its note and
34
+ * problem under it. The one control inside takes the label's id, the
35
+ * problem, note, and help as its description, and `aria-invalid` while a
36
+ * problem stands, with no wiring by the app. Draws
37
+ * `.field-label` and `.field-value` with `.field-note` and `.field-problem`.
38
+ */
39
+ export function FieldRow({ label, labelDetail, help, children, note, problem, group = false, id }) {
40
+ const made = useId();
41
+ const controlId = id ?? `${made}-control`;
42
+ const labelId = `${made}-label`;
43
+ const noteId = `${made}-note`;
44
+ const problemId = `${made}-problem`;
45
+ const helpId = `${made}-help`;
46
+ const hasNote = note !== undefined && note !== null && note !== false;
47
+ const hasProblem = problem !== undefined && problem !== null && problem !== false;
48
+ const helpParts = labelHelp(help);
49
+ // The help is read through aria-describedby with the note and problem, not
50
+ // as aria-description, which aria-describedby would override.
51
+ const describedBy = [hasProblem ? problemId : '', hasNote ? noteId : '', help ? helpId : '']
52
+ .filter(Boolean)
53
+ .join(' ');
54
+ const wiring = {
55
+ id: controlId,
56
+ describedBy: describedBy === '' ? undefined : describedBy,
57
+ invalid: hasProblem
58
+ };
59
+ const labelBody = (_jsxs(_Fragment, { children: [label, labelDetail === undefined ? null : (_jsx("span", { className: "settings-label-detail", children: labelDetail }))] }));
60
+ return (_jsxs(_Fragment, { children: [group ? (_jsx("span", { className: "field-label", id: labelId, ...helpParts.label, children: labelBody })) : (_jsx("label", { className: "field-label", htmlFor: controlId, id: labelId, ...helpParts.label, children: labelBody })), _jsxs("div", { "aria-describedby": group ? wiring.describedBy : undefined, "aria-labelledby": group ? labelId : undefined, className: "field-value", role: group ? 'group' : undefined, children: [_jsx(FieldRowContext, { value: group ? null : wiring, children: children }), hasProblem ? _jsx(FieldProblem, { id: problemId, children: problem }) : null, hasNote ? _jsx(FieldNote, { id: noteId, children: note }) : null, help ? _jsx(VisuallyHidden, { id: helpId, children: help }) : null] })] }));
61
+ }
62
+ /** One line of a row's value (a field and a choice beside it), at least a control high. Draws `.field-option`. */
63
+ export function FieldOption({ children }) {
64
+ return _jsx("div", { className: "field-option", children: children });
65
+ }
66
+ /**
67
+ * One short line under a control on what the current choice does ("Worn
68
+ * while the system is light."). Draws `.field-note`.
69
+ */
70
+ export function FieldNote({ children, id }) {
71
+ return (_jsx("p", { className: "field-note", id: id, children: children }));
72
+ }
73
+ /**
74
+ * What is wrong with a value, as a status line led by the danger glyph.
75
+ * Name it in the control's `aria-describedby` (`FieldRow` does). Draws
76
+ * `.field-problem`.
77
+ */
78
+ export function FieldProblem({ children, id }) {
79
+ return (_jsx("p", { className: "field-problem", id: id, children: children }));
80
+ }
81
+ /**
82
+ * A group of choices under its legend, 4px apart, or in `columns`. Draws
83
+ * `fieldset.field-group` (`.field-columns`).
84
+ */
85
+ export function FieldGroup({ legend, legendHidden = false, children, columns, note, problem }) {
86
+ const made = useId();
87
+ const hasProblem = problem !== undefined && problem !== null && problem !== false;
88
+ return (_jsxs("fieldset", { "aria-describedby": hasProblem ? `${made}-problem` : undefined, className: columns === undefined ? 'field-group' : 'field-group field-columns', style: columns === undefined ? undefined : { '--field-columns': columns }, children: [_jsx("legend", { className: legendHidden ? 'visually-hidden' : undefined, children: legend }), children, hasProblem ? _jsx(FieldProblem, { id: `${made}-problem`, children: problem }) : null, note === undefined || note === null ? null : _jsx(FieldNote, { children: note })] }));
89
+ }
@@ -0,0 +1,26 @@
1
+ import type { ReactElement } from 'react';
2
+ import { type ControlVerb } from '../pane/PaneActions.js';
3
+ /** Props for {@link Switch}. */
4
+ export interface SwitchProps {
5
+ /** Whether the thing it stands for is on. */
6
+ readonly checked: boolean;
7
+ /** Hears the state a press asks for. */
8
+ readonly onChange: (checked: boolean) => void;
9
+ /** Its words ("Sharing"), beside it, or its accessible name alone with `labelHidden`. */
10
+ readonly label: string;
11
+ /** Speaks the label without drawing it: a switch in a row whose name says what it turns on. */
12
+ readonly labelHidden?: boolean;
13
+ readonly disabled?: boolean;
14
+ /** The verb the row's keys run it for (`data-verb`), as a row's other controls carry. */
15
+ readonly verb?: ControlVerb;
16
+ }
17
+ /**
18
+ * A switch for a running thing turned on or off at once (a service,
19
+ * sharing), in the shared `.switch` look on a native checkbox with
20
+ * `role="switch"`; a setting is a check, not a switch. With its label drawn
21
+ * it stands in a `field-choice` label, the whole label its target. In a
22
+ * listing row it leaves the Tab order, as a row's other controls do, since
23
+ * the cursor row's keys run it, and a press toggles it without opening the
24
+ * row.
25
+ */
26
+ export declare function Switch({ checked, onChange, label, labelHidden, disabled, verb }: SwitchProps): ReactElement;
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useInRow } from '../pane/PaneActions.js';
3
+ /** A press on the switch or its words toggles it alone, never also opening the row it stands in. */
4
+ const keepToSelf = (event) => event.stopPropagation();
5
+ /**
6
+ * A switch for a running thing turned on or off at once (a service,
7
+ * sharing), in the shared `.switch` look on a native checkbox with
8
+ * `role="switch"`; a setting is a check, not a switch. With its label drawn
9
+ * it stands in a `field-choice` label, the whole label its target. In a
10
+ * listing row it leaves the Tab order, as a row's other controls do, since
11
+ * the cursor row's keys run it, and a press toggles it without opening the
12
+ * row.
13
+ */
14
+ export function Switch({ checked, onChange, label, labelHidden = false, disabled = false, verb }) {
15
+ const inRow = useInRow();
16
+ const control = (_jsx("input", { "aria-label": labelHidden ? label : undefined, checked: checked, className: "switch", "data-verb": verb, disabled: disabled, onChange: (event) => onChange(event.currentTarget.checked), onClick: keepToSelf, role: "switch", tabIndex: inRow ? -1 : undefined, type: "checkbox" }));
17
+ if (labelHidden)
18
+ return control;
19
+ return (_jsxs("label", { className: "field-choice", onClick: keepToSelf, children: [control, label] }));
20
+ }
@@ -1,10 +1,14 @@
1
1
  /**
2
- * Form controls. The look is class-based on native elements (`field.css`:
3
- * `.field`, `.check`, `.switch`, `.field-label`, `.field-note`,
4
- * `.field-problem`, `.field-group`, `.field-choice`, `.field-grid`), so most
5
- * forms need no component; `Check` adds the mixed state a checkbox can only
6
- * reach from script, and `labelHelp` puts a control's help in its label's
7
- * tooltip.
2
+ * Form controls as components over the shared field look (`field.css`):
3
+ * `TextField`, `TextArea`, `Select`, `FieldBox`, and `FieldEditor` in the
4
+ * field's well; `Check`, `Radio`, and `Switch`; `Range` and `Meter`; and the
5
+ * form's layout, `FieldGrid` of `FieldRow`s (label, value, note, problem,
6
+ * wired to the control on their own), `FieldOption`, `FieldGroup`,
7
+ * `FieldNote`, and `FieldProblem`. `labelHelp` puts a control's help in its
8
+ * label's tooltip; `RestoreDefault` sets a changed setting back.
8
9
  */
9
10
  export { Check, type CheckProps } from './Check.js';
11
+ export { FieldBox, FieldEditor, Meter, Radio, Range, RestoreDefault, Select, TextArea, TextField, type FieldBoxProps, type FieldEditorProps, type FieldSize, type FieldTone, type FieldWidth, type MeterProps, type RadioProps, type RangeProps, type RestoreDefaultProps, type SelectOption, type SelectOptionGroup, type SelectProps, type TextAreaProps, type TextFieldProps } from './Controls.js';
12
+ export { FieldGrid, FieldGroup, FieldNote, FieldOption, FieldProblem, FieldRow, useFieldWiring, type FieldGridProps, type FieldGroupProps, type FieldMessageProps, type FieldOptionProps, type FieldRowProps, type FieldRowWiring } from './FieldLayout.js';
10
13
  export { labelHelp, type LabelHelp } from './labelHelp.js';
14
+ export { Switch, type SwitchProps } from './Switch.js';
@@ -1,10 +1,14 @@
1
1
  /**
2
- * Form controls. The look is class-based on native elements (`field.css`:
3
- * `.field`, `.check`, `.switch`, `.field-label`, `.field-note`,
4
- * `.field-problem`, `.field-group`, `.field-choice`, `.field-grid`), so most
5
- * forms need no component; `Check` adds the mixed state a checkbox can only
6
- * reach from script, and `labelHelp` puts a control's help in its label's
7
- * tooltip.
2
+ * Form controls as components over the shared field look (`field.css`):
3
+ * `TextField`, `TextArea`, `Select`, `FieldBox`, and `FieldEditor` in the
4
+ * field's well; `Check`, `Radio`, and `Switch`; `Range` and `Meter`; and the
5
+ * form's layout, `FieldGrid` of `FieldRow`s (label, value, note, problem,
6
+ * wired to the control on their own), `FieldOption`, `FieldGroup`,
7
+ * `FieldNote`, and `FieldProblem`. `labelHelp` puts a control's help in its
8
+ * label's tooltip; `RestoreDefault` sets a changed setting back.
8
9
  */
9
10
  export { Check } from './Check.js';
11
+ export { FieldBox, FieldEditor, Meter, Radio, Range, RestoreDefault, Select, TextArea, TextField } from './Controls.js';
12
+ export { FieldGrid, FieldGroup, FieldNote, FieldOption, FieldProblem, FieldRow, useFieldWiring } from './FieldLayout.js';
10
13
  export { labelHelp } from './labelHelp.js';
14
+ export { Switch } from './Switch.js';
@@ -0,0 +1,44 @@
1
+ import type { ReactElement, ReactNode, Ref } from 'react';
2
+ import type { RegionHandlers } from '../pane/Pane.js';
3
+ /** Props for {@link AppRoot}. */
4
+ export interface AppRootProps {
5
+ /**
6
+ * The release channel the window wears (`data-channel`), which colours
7
+ * its `ChannelMarker` and channel tags; none on the release.
8
+ */
9
+ readonly channel?: string | null;
10
+ /** The window's content: a `SpacePanel`, or the frame itself. */
11
+ readonly children: ReactNode;
12
+ }
13
+ /**
14
+ * The app window's root: one column the window's height holding its
15
+ * content, which owns the whole window, its top band included. A window
16
+ * that wears it sets the interface face and the body's ground and text, and
17
+ * keeps every dialog clear of its top band (`--dialog-inset-top`).
18
+ */
19
+ export declare function AppRoot({ channel, children }: AppRootProps): ReactElement;
20
+ /** Props for {@link SpacePanel}. */
21
+ export interface SpacePanelProps extends RegionHandlers {
22
+ readonly ref?: Ref<HTMLDivElement>;
23
+ /** The space's frame (`WindowFrame`). */
24
+ readonly children: ReactNode;
25
+ }
26
+ /**
27
+ * The panel the content's keyboard commands work in, inside `AppRoot`: a
28
+ * focus boundary the host's key handlers hang on, focusable by script and
29
+ * out of the Tab order, never a control, so it draws no ring.
30
+ */
31
+ export declare function SpacePanel({ ref, children, ...handlers }: SpacePanelProps): ReactElement;
32
+ /** Props for {@link PageSlot}. */
33
+ export interface PageSlotProps {
34
+ /** The page is the front tab's; false keeps it mounted out of sight. */
35
+ readonly shown: boolean;
36
+ /** The page (`PanePage`). */
37
+ readonly children: ReactNode;
38
+ }
39
+ /**
40
+ * One page of the main pane: the front tab's page lays out as the pane's
41
+ * own child, and a held page (a background tab with unsaved changes) stays
42
+ * mounted and hidden, so it keeps its state.
43
+ */
44
+ export declare function PageSlot({ shown, children }: PageSlotProps): ReactElement;