@aiquants/console-ui 0.4.3 → 0.5.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.
package/dist/core.d.cts CHANGED
@@ -1,4 +1,7 @@
1
1
  declare const formatCount: (value: number, formatLocale: string) => string;
2
+ declare const readDecimalText: (text: string) => number | null;
3
+ declare const readIntegerText: (text: string) => number | null;
4
+ declare const isReadableText: (text: string) => boolean;
2
5
  type ZonedTimeErrorReason = "malformed" | "subsecond" | "nonexistent" | "ambiguous";
3
6
  declare class ZonedTimeError extends RangeError {
4
7
  readonly reason: ZonedTimeErrorReason;
@@ -30,117 +33,6 @@ type ConsoleUiLabels = {
30
33
  declare const reasonAside: (reason: string) => string;
31
34
  declare const CONSOLE_UI_LABEL_CATALOGS: Readonly<Record<ConsoleUiLocale, ConsoleUiLabels>>;
32
35
  declare const resolveConsoleUiLabels: (locale: string) => ConsoleUiLabels;
33
- type MasterDetailOptions = {
34
- readonly masterMinPx: number;
35
- readonly detailMinPx: number;
36
- readonly gapPx: number;
37
- };
38
- type MasterDetailPlan = {
39
- readonly sideBySide: boolean;
40
- readonly sideBySideFromPx: number;
41
- readonly masterInlinePx: number;
42
- readonly detailInlinePx: number;
43
- };
44
- declare const masterDetailPlan: (containerPx: number, options: MasterDetailOptions) => MasterDetailPlan;
45
- type ColumnWidth = {
46
- readonly fixedPx: number;
47
- readonly minPx?: never;
48
- } | {
49
- readonly minPx: number;
50
- readonly fixedPx?: never;
51
- };
52
- type ColumnWidthSource = {
53
- readonly width: ColumnWidth;
54
- };
55
- declare const tableMinInlinePx: (columns: readonly ColumnWidthSource[]) => number;
56
- declare const textWidthEm: (text: string) => number;
57
- declare const monoTextWidthEm: (text: string) => number;
58
- declare const ceil8: (px: number) => number;
59
- type TileGridStep = {
60
- readonly columns: number;
61
- readonly minContainerPx: number;
62
- };
63
- type TileGridPlan = {
64
- readonly key: string;
65
- readonly steps: readonly TileGridStep[];
66
- readonly css: string;
67
- };
68
- declare const tileGridPlan: (count: number, minInlinePx: number, gapPx: number) => TileGridPlan;
69
- declare const HTTP_FORBIDDEN = 403;
70
- type ResourceOutcome<T> = {
71
- readonly ok: true;
72
- readonly value: T;
73
- } | {
74
- readonly ok: false;
75
- readonly status: number | null;
76
- readonly reason: string;
77
- };
78
- type CommandOutcome<T, R> = {
79
- readonly ok: true;
80
- readonly value: T;
81
- } | {
82
- readonly ok: false;
83
- readonly status: number | null;
84
- readonly reason: string;
85
- readonly rejection: R | null;
86
- };
87
- declare const mapOutcome: <T, U>(outcome: ResourceOutcome<T>, map: (value: T) => U) => ResourceOutcome<U>;
88
- declare const flatMapOutcome: <T, U>(outcome: ResourceOutcome<T>, map: (value: T) => ResourceOutcome<U>) => ResourceOutcome<U>;
89
- type ResourceFailure = {
90
- readonly status: number | null;
91
- readonly reason: string;
92
- readonly occurrence: number;
93
- readonly retrying: boolean;
94
- };
95
- type ResourceState<T> = {
96
- readonly kind: "idle";
97
- } | {
98
- readonly kind: "loading";
99
- } | ({
100
- readonly kind: "failed";
101
- } & ResourceFailure) | {
102
- readonly kind: "ready";
103
- readonly value: T;
104
- readonly refreshing: boolean;
105
- readonly refreshFailure: {
106
- readonly status: number | null;
107
- readonly reason: string;
108
- } | null;
109
- };
110
- type ReloadCause = "reload" | "revision";
111
- declare const beginReload: <T>(state: ResourceState<T>, cause: ReloadCause) => ResourceState<T>;
112
- declare const keepLastGood: <T>(state: ResourceState<T>, outcome: ResourceOutcome<T>) => ResourceState<T>;
113
- type KeysetPage<T, C, M> = {
114
- readonly rows: readonly T[];
115
- readonly next: C | null;
116
- readonly meta: M;
117
- };
118
- type NextPage<T, C> = {
119
- readonly rows: readonly T[];
120
- readonly next: C | null;
121
- readonly meta?: never;
122
- };
123
- type PageFailure = {
124
- readonly reason: string;
125
- readonly occurrence: number;
126
- };
127
- type PagedValue<T, C, M> = {
128
- readonly rows: readonly T[];
129
- readonly next: C | null;
130
- readonly meta: M;
131
- readonly loadingMore: boolean;
132
- readonly moreFailure: PageFailure | null;
133
- };
134
- type PagedContent<T, M> = {
135
- readonly rows: readonly T[];
136
- readonly meta: M;
137
- };
138
- type PagedState<T, C, M> = ResourceState<PagedValue<T, C, M>>;
139
- declare const beginPagedReload: <T, C, M>(state: PagedState<T, C, M>, cause: ReloadCause) => PagedState<T, C, M>;
140
- declare const settleFirstPage: <T, C, M>(state: PagedState<T, C, M>, outcome: ResourceOutcome<KeysetPage<T, C, M>>) => PagedState<T, C, M>;
141
- declare const beginPage: <T, C, M>(state: PagedState<T, C, M>) => PagedState<T, C, M>;
142
- declare const settlePage: <T, C, M>(state: PagedState<T, C, M>, cursor: C, outcome: ResourceOutcome<NextPage<T, C>>) => PagedState<T, C, M>;
143
- declare const mapPagedList: <T, C, M>(state: PagedState<T, C, M>, map: (content: PagedContent<T, M>) => PagedContent<T, M>) => PagedState<T, C, M>;
144
36
  declare const LATTICE_PX = 4;
145
37
  declare const SPACE_MULTIPLIERS: readonly [
146
38
  1,
@@ -169,12 +61,13 @@ declare const MOTION_STEPS: readonly [
169
61
  declare const ceilToLattice: (px: number) => number;
170
62
  declare const TARGET_PX: number;
171
63
  declare const ROW_WITH_CONTROL_PX: number;
64
+ declare const COMPACT_ROW_PX: number;
172
65
  type SpaceToken = `space-${(typeof SPACE_MULTIPLIERS)[number]}`;
173
66
  type TypeToken = keyof typeof TYPE_STEPS | "prose";
174
67
  type MotionToken = `motion-${(typeof MOTION_STEPS)[number]}`;
175
68
  type WeightToken = "regular" | "medium" | "bold";
176
69
  type RadiusToken = "radius-control" | "radius-item" | "radius-container" | "radius-pill";
177
- type SizeToken = "size-control" | "size-row" | "size-row-control" | "size-target";
70
+ type SizeToken = "size-control" | "size-row" | "size-row-compact" | "size-row-control" | "size-target";
178
71
  type StrokeToken = "border-width" | "focus-width" | "focus-offset" | "marker-width";
179
72
  type SchemeColor = {
180
73
  readonly light: string;
@@ -311,6 +204,176 @@ type SurfaceRole = "surface" | "subtle" | "sunken" | "danger-tint" | "warning-ti
311
204
  type AccentRole = "danger-accent" | "warning-accent" | "success-accent" | "info-accent";
312
205
  type TokenName = SpaceToken | `font-size-${TypeToken}` | `line-height-${TypeToken}` | `font-weight-${WeightToken}` | RadiusToken | SizeToken | StrokeToken | MotionToken | ColorToken;
313
206
  declare const cssVar: (name: TokenName) => string;
207
+ type TextFace = "sans" | "mono";
208
+ declare const textWidthEm: (text: string) => number;
209
+ declare const monoTextWidthEm: (text: string) => number;
210
+ declare const ceil8: (px: number) => number;
211
+ type CellContent = {
212
+ readonly kind: "text";
213
+ readonly texts: readonly string[];
214
+ readonly face: TextFace;
215
+ readonly type: TypeToken;
216
+ } | {
217
+ readonly kind: "measured";
218
+ readonly texts: readonly string[];
219
+ } | {
220
+ readonly kind: "pill";
221
+ readonly labels: readonly string[];
222
+ } | {
223
+ readonly kind: "button";
224
+ readonly labels: readonly string[];
225
+ } | {
226
+ readonly kind: "link";
227
+ readonly labels: readonly string[];
228
+ } | {
229
+ readonly kind: "switch";
230
+ readonly labelHidden: true;
231
+ readonly labels?: never;
232
+ } | {
233
+ readonly kind: "switch";
234
+ readonly labelHidden: false;
235
+ readonly labels: readonly string[];
236
+ } | {
237
+ readonly kind: "cluster";
238
+ readonly gap: SpaceToken;
239
+ readonly items: readonly CellContent[];
240
+ };
241
+ type ColumnHeaderText = {
242
+ readonly header: string;
243
+ readonly note?: readonly string[];
244
+ };
245
+ declare const cellContentInlinePx: (content: CellContent) => number;
246
+ declare const fixedColumnPx: (column: ColumnHeaderText, contents: readonly CellContent[]) => number;
247
+ declare const FLEXIBLE_COLUMN_MIN_PX: number;
248
+ declare const comparisonAttributePx: (labels: readonly string[]) => number;
249
+ declare const instantSampleText: (formatLocale: string, timeZone: string) => string;
250
+ declare const countSampleText: (formatLocale: string, unit?: string) => string;
251
+ declare const tileMinInlinePx: (captions: readonly string[], values: readonly string[]) => number;
252
+ declare const spacedTextWidthEm: (text: string, face: TextFace) => number;
253
+ type FigureBoxLines = {
254
+ readonly name: string;
255
+ readonly notes: readonly string[];
256
+ };
257
+ type FigureBoxPlan = {
258
+ readonly minWidthPx: number;
259
+ readonly heightPx: number;
260
+ };
261
+ declare const figureBoxPlan: (lines: FigureBoxLines) => FigureBoxPlan;
262
+ type FigureDiscLabelPlan = {
263
+ readonly widthPx: number;
264
+ readonly extentBelowPx: number;
265
+ };
266
+ declare const figureDiscLabelPlan: (label: string | null, radiusPx: number) => FigureDiscLabelPlan;
267
+ declare const FIGURE_RING_REACH_PX: number;
268
+ type MasterDetailOptions = {
269
+ readonly masterMinPx: number;
270
+ readonly detailMinPx: number;
271
+ readonly gapPx: number;
272
+ };
273
+ type MasterDetailPlan = {
274
+ readonly sideBySide: boolean;
275
+ readonly sideBySideFromPx: number;
276
+ readonly masterInlinePx: number;
277
+ readonly detailInlinePx: number;
278
+ };
279
+ declare const masterDetailPlan: (containerPx: number, options: MasterDetailOptions) => MasterDetailPlan;
280
+ type ColumnWidth = {
281
+ readonly fixedPx: number;
282
+ readonly minPx?: never;
283
+ } | {
284
+ readonly minPx: number;
285
+ readonly fixedPx?: never;
286
+ };
287
+ type ColumnWidthSource = {
288
+ readonly width: ColumnWidth;
289
+ };
290
+ declare const tableMinInlinePx: (columns: readonly ColumnWidthSource[]) => number;
291
+ declare const tableFrameMinInlinePx: (columns: readonly ColumnWidthSource[]) => number;
292
+ type TileGridStep = {
293
+ readonly columns: number;
294
+ readonly minContainerPx: number;
295
+ };
296
+ type TileGridPlan = {
297
+ readonly key: string;
298
+ readonly steps: readonly TileGridStep[];
299
+ readonly css: string;
300
+ };
301
+ declare const tileGridPlan: (count: number, minInlinePx: number, gapPx: number) => TileGridPlan;
302
+ declare const HTTP_FORBIDDEN = 403;
303
+ type ResourceOutcome<T> = {
304
+ readonly ok: true;
305
+ readonly value: T;
306
+ } | {
307
+ readonly ok: false;
308
+ readonly status: number | null;
309
+ readonly reason: string;
310
+ };
311
+ type CommandOutcome<T, R> = {
312
+ readonly ok: true;
313
+ readonly value: T;
314
+ } | {
315
+ readonly ok: false;
316
+ readonly status: number | null;
317
+ readonly reason: string;
318
+ readonly rejection: R | null;
319
+ };
320
+ declare const mapOutcome: <T, U>(outcome: ResourceOutcome<T>, map: (value: T) => U) => ResourceOutcome<U>;
321
+ declare const flatMapOutcome: <T, U>(outcome: ResourceOutcome<T>, map: (value: T) => ResourceOutcome<U>) => ResourceOutcome<U>;
322
+ type ResourceFailure = {
323
+ readonly status: number | null;
324
+ readonly reason: string;
325
+ readonly occurrence: number;
326
+ readonly retrying: boolean;
327
+ };
328
+ type ResourceState<T> = {
329
+ readonly kind: "idle";
330
+ } | {
331
+ readonly kind: "loading";
332
+ } | ({
333
+ readonly kind: "failed";
334
+ } & ResourceFailure) | {
335
+ readonly kind: "ready";
336
+ readonly value: T;
337
+ readonly refreshing: boolean;
338
+ readonly refreshFailure: {
339
+ readonly status: number | null;
340
+ readonly reason: string;
341
+ } | null;
342
+ };
343
+ type ReloadCause = "reload" | "revision";
344
+ declare const beginReload: <T>(state: ResourceState<T>, cause: ReloadCause) => ResourceState<T>;
345
+ declare const keepLastGood: <T>(state: ResourceState<T>, outcome: ResourceOutcome<T>) => ResourceState<T>;
346
+ type KeysetPage<T, C, M> = {
347
+ readonly rows: readonly T[];
348
+ readonly next: C | null;
349
+ readonly meta: M;
350
+ };
351
+ type NextPage<T, C> = {
352
+ readonly rows: readonly T[];
353
+ readonly next: C | null;
354
+ readonly meta?: never;
355
+ };
356
+ type PageFailure = {
357
+ readonly reason: string;
358
+ readonly occurrence: number;
359
+ };
360
+ type PagedValue<T, C, M> = {
361
+ readonly rows: readonly T[];
362
+ readonly next: C | null;
363
+ readonly meta: M;
364
+ readonly loadingMore: boolean;
365
+ readonly moreFailure: PageFailure | null;
366
+ };
367
+ type PagedContent<T, M> = {
368
+ readonly rows: readonly T[];
369
+ readonly meta: M;
370
+ };
371
+ type PagedState<T, C, M> = ResourceState<PagedValue<T, C, M>>;
372
+ declare const beginPagedReload: <T, C, M>(state: PagedState<T, C, M>, cause: ReloadCause) => PagedState<T, C, M>;
373
+ declare const settleFirstPage: <T, C, M>(state: PagedState<T, C, M>, outcome: ResourceOutcome<KeysetPage<T, C, M>>) => PagedState<T, C, M>;
374
+ declare const beginPage: <T, C, M>(state: PagedState<T, C, M>) => PagedState<T, C, M>;
375
+ declare const settlePage: <T, C, M>(state: PagedState<T, C, M>, cursor: C, outcome: ResourceOutcome<NextPage<T, C>>) => PagedState<T, C, M>;
376
+ declare const mapPagedList: <T, C, M>(state: PagedState<T, C, M>, map: (content: PagedContent<T, M>) => PagedContent<T, M>) => PagedState<T, C, M>;
314
377
  type Srgb = readonly [
315
378
  red: number,
316
379
  green: number,
@@ -487,4 +550,4 @@ declare const CONTRAST_PAIRS: {
487
550
  };
488
551
  };
489
552
  };
490
- export { type AccentRole, CONSOLE_UI_LABEL_CATALOGS, CONTRAST_MINIMUM, CONTRAST_PAIRS, type ColorScheme, type ColorToken, type ColumnWidth, type ColumnWidthSource, type CommandOutcome, type ConsoleUiLabels, type ConsoleUiLocale, type ConsoleUiTokens, type ContrastRole, type FgRole, HTTP_FORBIDDEN, type KeysetPage, LATTICE_PX, type MasterDetailOptions, type MasterDetailPlan, type MotionToken, type NextPage, type PageFailure, type PagedContent, type PagedState, type PagedValue, ROW_WITH_CONTROL_PX, type RadiusToken, type ReloadCause, type ResourceFailure, type ResourceOutcome, type ResourceState, type SchemeColor, type SizeToken, type SpaceToken, type Srgb, type StrokeToken, type SurfaceRole, TARGET_PX, TOKENS, type TileGridPlan, type TileGridStep, type TokenName, type TypeToken, type WeightToken, ZonedTimeError, type ZonedTimeErrorReason, beginPage, beginPagedReload, beginReload, ceil8, ceilToLattice, contrastRatio, cssVar, flatMapOutcome, formatCount, formatInstant, hexToSrgb, keepLastGood, mapOutcome, mapPagedList, masterDetailPlan, monoTextWidthEm, reasonAside, resolveConsoleUiLabels, settleFirstPage, settlePage, tableMinInlinePx, textWidthEm, tileGridPlan, toOffsetIso, toWallTime };
553
+ export { type AccentRole, COMPACT_ROW_PX, CONSOLE_UI_LABEL_CATALOGS, CONTRAST_MINIMUM, CONTRAST_PAIRS, type CellContent, type ColorScheme, type ColorToken, type ColumnHeaderText, type ColumnWidth, type ColumnWidthSource, type CommandOutcome, type ConsoleUiLabels, type ConsoleUiLocale, type ConsoleUiTokens, type ContrastRole, FIGURE_RING_REACH_PX, FLEXIBLE_COLUMN_MIN_PX, type FgRole, type FigureBoxLines, type FigureBoxPlan, type FigureDiscLabelPlan, HTTP_FORBIDDEN, type KeysetPage, LATTICE_PX, type MasterDetailOptions, type MasterDetailPlan, type MotionToken, type NextPage, type PageFailure, type PagedContent, type PagedState, type PagedValue, ROW_WITH_CONTROL_PX, type RadiusToken, type ReloadCause, type ResourceFailure, type ResourceOutcome, type ResourceState, type SchemeColor, type SizeToken, type SpaceToken, type Srgb, type StrokeToken, type SurfaceRole, TARGET_PX, TOKENS, type TextFace, type TileGridPlan, type TileGridStep, type TokenName, type TypeToken, type WeightToken, ZonedTimeError, type ZonedTimeErrorReason, beginPage, beginPagedReload, beginReload, ceil8, ceilToLattice, cellContentInlinePx, comparisonAttributePx, contrastRatio, countSampleText, cssVar, figureBoxPlan, figureDiscLabelPlan, fixedColumnPx, flatMapOutcome, formatCount, formatInstant, hexToSrgb, instantSampleText, isReadableText, keepLastGood, mapOutcome, mapPagedList, masterDetailPlan, monoTextWidthEm, readDecimalText, readIntegerText, reasonAside, resolveConsoleUiLabels, settleFirstPage, settlePage, spacedTextWidthEm, tableFrameMinInlinePx, tableMinInlinePx, textWidthEm, tileGridPlan, tileMinInlinePx, toOffsetIso, toWallTime };
package/dist/core.d.ts CHANGED
@@ -1,4 +1,7 @@
1
1
  declare const formatCount: (value: number, formatLocale: string) => string;
2
+ declare const readDecimalText: (text: string) => number | null;
3
+ declare const readIntegerText: (text: string) => number | null;
4
+ declare const isReadableText: (text: string) => boolean;
2
5
  type ZonedTimeErrorReason = "malformed" | "subsecond" | "nonexistent" | "ambiguous";
3
6
  declare class ZonedTimeError extends RangeError {
4
7
  readonly reason: ZonedTimeErrorReason;
@@ -30,117 +33,6 @@ type ConsoleUiLabels = {
30
33
  declare const reasonAside: (reason: string) => string;
31
34
  declare const CONSOLE_UI_LABEL_CATALOGS: Readonly<Record<ConsoleUiLocale, ConsoleUiLabels>>;
32
35
  declare const resolveConsoleUiLabels: (locale: string) => ConsoleUiLabels;
33
- type MasterDetailOptions = {
34
- readonly masterMinPx: number;
35
- readonly detailMinPx: number;
36
- readonly gapPx: number;
37
- };
38
- type MasterDetailPlan = {
39
- readonly sideBySide: boolean;
40
- readonly sideBySideFromPx: number;
41
- readonly masterInlinePx: number;
42
- readonly detailInlinePx: number;
43
- };
44
- declare const masterDetailPlan: (containerPx: number, options: MasterDetailOptions) => MasterDetailPlan;
45
- type ColumnWidth = {
46
- readonly fixedPx: number;
47
- readonly minPx?: never;
48
- } | {
49
- readonly minPx: number;
50
- readonly fixedPx?: never;
51
- };
52
- type ColumnWidthSource = {
53
- readonly width: ColumnWidth;
54
- };
55
- declare const tableMinInlinePx: (columns: readonly ColumnWidthSource[]) => number;
56
- declare const textWidthEm: (text: string) => number;
57
- declare const monoTextWidthEm: (text: string) => number;
58
- declare const ceil8: (px: number) => number;
59
- type TileGridStep = {
60
- readonly columns: number;
61
- readonly minContainerPx: number;
62
- };
63
- type TileGridPlan = {
64
- readonly key: string;
65
- readonly steps: readonly TileGridStep[];
66
- readonly css: string;
67
- };
68
- declare const tileGridPlan: (count: number, minInlinePx: number, gapPx: number) => TileGridPlan;
69
- declare const HTTP_FORBIDDEN = 403;
70
- type ResourceOutcome<T> = {
71
- readonly ok: true;
72
- readonly value: T;
73
- } | {
74
- readonly ok: false;
75
- readonly status: number | null;
76
- readonly reason: string;
77
- };
78
- type CommandOutcome<T, R> = {
79
- readonly ok: true;
80
- readonly value: T;
81
- } | {
82
- readonly ok: false;
83
- readonly status: number | null;
84
- readonly reason: string;
85
- readonly rejection: R | null;
86
- };
87
- declare const mapOutcome: <T, U>(outcome: ResourceOutcome<T>, map: (value: T) => U) => ResourceOutcome<U>;
88
- declare const flatMapOutcome: <T, U>(outcome: ResourceOutcome<T>, map: (value: T) => ResourceOutcome<U>) => ResourceOutcome<U>;
89
- type ResourceFailure = {
90
- readonly status: number | null;
91
- readonly reason: string;
92
- readonly occurrence: number;
93
- readonly retrying: boolean;
94
- };
95
- type ResourceState<T> = {
96
- readonly kind: "idle";
97
- } | {
98
- readonly kind: "loading";
99
- } | ({
100
- readonly kind: "failed";
101
- } & ResourceFailure) | {
102
- readonly kind: "ready";
103
- readonly value: T;
104
- readonly refreshing: boolean;
105
- readonly refreshFailure: {
106
- readonly status: number | null;
107
- readonly reason: string;
108
- } | null;
109
- };
110
- type ReloadCause = "reload" | "revision";
111
- declare const beginReload: <T>(state: ResourceState<T>, cause: ReloadCause) => ResourceState<T>;
112
- declare const keepLastGood: <T>(state: ResourceState<T>, outcome: ResourceOutcome<T>) => ResourceState<T>;
113
- type KeysetPage<T, C, M> = {
114
- readonly rows: readonly T[];
115
- readonly next: C | null;
116
- readonly meta: M;
117
- };
118
- type NextPage<T, C> = {
119
- readonly rows: readonly T[];
120
- readonly next: C | null;
121
- readonly meta?: never;
122
- };
123
- type PageFailure = {
124
- readonly reason: string;
125
- readonly occurrence: number;
126
- };
127
- type PagedValue<T, C, M> = {
128
- readonly rows: readonly T[];
129
- readonly next: C | null;
130
- readonly meta: M;
131
- readonly loadingMore: boolean;
132
- readonly moreFailure: PageFailure | null;
133
- };
134
- type PagedContent<T, M> = {
135
- readonly rows: readonly T[];
136
- readonly meta: M;
137
- };
138
- type PagedState<T, C, M> = ResourceState<PagedValue<T, C, M>>;
139
- declare const beginPagedReload: <T, C, M>(state: PagedState<T, C, M>, cause: ReloadCause) => PagedState<T, C, M>;
140
- declare const settleFirstPage: <T, C, M>(state: PagedState<T, C, M>, outcome: ResourceOutcome<KeysetPage<T, C, M>>) => PagedState<T, C, M>;
141
- declare const beginPage: <T, C, M>(state: PagedState<T, C, M>) => PagedState<T, C, M>;
142
- declare const settlePage: <T, C, M>(state: PagedState<T, C, M>, cursor: C, outcome: ResourceOutcome<NextPage<T, C>>) => PagedState<T, C, M>;
143
- declare const mapPagedList: <T, C, M>(state: PagedState<T, C, M>, map: (content: PagedContent<T, M>) => PagedContent<T, M>) => PagedState<T, C, M>;
144
36
  declare const LATTICE_PX = 4;
145
37
  declare const SPACE_MULTIPLIERS: readonly [
146
38
  1,
@@ -169,12 +61,13 @@ declare const MOTION_STEPS: readonly [
169
61
  declare const ceilToLattice: (px: number) => number;
170
62
  declare const TARGET_PX: number;
171
63
  declare const ROW_WITH_CONTROL_PX: number;
64
+ declare const COMPACT_ROW_PX: number;
172
65
  type SpaceToken = `space-${(typeof SPACE_MULTIPLIERS)[number]}`;
173
66
  type TypeToken = keyof typeof TYPE_STEPS | "prose";
174
67
  type MotionToken = `motion-${(typeof MOTION_STEPS)[number]}`;
175
68
  type WeightToken = "regular" | "medium" | "bold";
176
69
  type RadiusToken = "radius-control" | "radius-item" | "radius-container" | "radius-pill";
177
- type SizeToken = "size-control" | "size-row" | "size-row-control" | "size-target";
70
+ type SizeToken = "size-control" | "size-row" | "size-row-compact" | "size-row-control" | "size-target";
178
71
  type StrokeToken = "border-width" | "focus-width" | "focus-offset" | "marker-width";
179
72
  type SchemeColor = {
180
73
  readonly light: string;
@@ -311,6 +204,176 @@ type SurfaceRole = "surface" | "subtle" | "sunken" | "danger-tint" | "warning-ti
311
204
  type AccentRole = "danger-accent" | "warning-accent" | "success-accent" | "info-accent";
312
205
  type TokenName = SpaceToken | `font-size-${TypeToken}` | `line-height-${TypeToken}` | `font-weight-${WeightToken}` | RadiusToken | SizeToken | StrokeToken | MotionToken | ColorToken;
313
206
  declare const cssVar: (name: TokenName) => string;
207
+ type TextFace = "sans" | "mono";
208
+ declare const textWidthEm: (text: string) => number;
209
+ declare const monoTextWidthEm: (text: string) => number;
210
+ declare const ceil8: (px: number) => number;
211
+ type CellContent = {
212
+ readonly kind: "text";
213
+ readonly texts: readonly string[];
214
+ readonly face: TextFace;
215
+ readonly type: TypeToken;
216
+ } | {
217
+ readonly kind: "measured";
218
+ readonly texts: readonly string[];
219
+ } | {
220
+ readonly kind: "pill";
221
+ readonly labels: readonly string[];
222
+ } | {
223
+ readonly kind: "button";
224
+ readonly labels: readonly string[];
225
+ } | {
226
+ readonly kind: "link";
227
+ readonly labels: readonly string[];
228
+ } | {
229
+ readonly kind: "switch";
230
+ readonly labelHidden: true;
231
+ readonly labels?: never;
232
+ } | {
233
+ readonly kind: "switch";
234
+ readonly labelHidden: false;
235
+ readonly labels: readonly string[];
236
+ } | {
237
+ readonly kind: "cluster";
238
+ readonly gap: SpaceToken;
239
+ readonly items: readonly CellContent[];
240
+ };
241
+ type ColumnHeaderText = {
242
+ readonly header: string;
243
+ readonly note?: readonly string[];
244
+ };
245
+ declare const cellContentInlinePx: (content: CellContent) => number;
246
+ declare const fixedColumnPx: (column: ColumnHeaderText, contents: readonly CellContent[]) => number;
247
+ declare const FLEXIBLE_COLUMN_MIN_PX: number;
248
+ declare const comparisonAttributePx: (labels: readonly string[]) => number;
249
+ declare const instantSampleText: (formatLocale: string, timeZone: string) => string;
250
+ declare const countSampleText: (formatLocale: string, unit?: string) => string;
251
+ declare const tileMinInlinePx: (captions: readonly string[], values: readonly string[]) => number;
252
+ declare const spacedTextWidthEm: (text: string, face: TextFace) => number;
253
+ type FigureBoxLines = {
254
+ readonly name: string;
255
+ readonly notes: readonly string[];
256
+ };
257
+ type FigureBoxPlan = {
258
+ readonly minWidthPx: number;
259
+ readonly heightPx: number;
260
+ };
261
+ declare const figureBoxPlan: (lines: FigureBoxLines) => FigureBoxPlan;
262
+ type FigureDiscLabelPlan = {
263
+ readonly widthPx: number;
264
+ readonly extentBelowPx: number;
265
+ };
266
+ declare const figureDiscLabelPlan: (label: string | null, radiusPx: number) => FigureDiscLabelPlan;
267
+ declare const FIGURE_RING_REACH_PX: number;
268
+ type MasterDetailOptions = {
269
+ readonly masterMinPx: number;
270
+ readonly detailMinPx: number;
271
+ readonly gapPx: number;
272
+ };
273
+ type MasterDetailPlan = {
274
+ readonly sideBySide: boolean;
275
+ readonly sideBySideFromPx: number;
276
+ readonly masterInlinePx: number;
277
+ readonly detailInlinePx: number;
278
+ };
279
+ declare const masterDetailPlan: (containerPx: number, options: MasterDetailOptions) => MasterDetailPlan;
280
+ type ColumnWidth = {
281
+ readonly fixedPx: number;
282
+ readonly minPx?: never;
283
+ } | {
284
+ readonly minPx: number;
285
+ readonly fixedPx?: never;
286
+ };
287
+ type ColumnWidthSource = {
288
+ readonly width: ColumnWidth;
289
+ };
290
+ declare const tableMinInlinePx: (columns: readonly ColumnWidthSource[]) => number;
291
+ declare const tableFrameMinInlinePx: (columns: readonly ColumnWidthSource[]) => number;
292
+ type TileGridStep = {
293
+ readonly columns: number;
294
+ readonly minContainerPx: number;
295
+ };
296
+ type TileGridPlan = {
297
+ readonly key: string;
298
+ readonly steps: readonly TileGridStep[];
299
+ readonly css: string;
300
+ };
301
+ declare const tileGridPlan: (count: number, minInlinePx: number, gapPx: number) => TileGridPlan;
302
+ declare const HTTP_FORBIDDEN = 403;
303
+ type ResourceOutcome<T> = {
304
+ readonly ok: true;
305
+ readonly value: T;
306
+ } | {
307
+ readonly ok: false;
308
+ readonly status: number | null;
309
+ readonly reason: string;
310
+ };
311
+ type CommandOutcome<T, R> = {
312
+ readonly ok: true;
313
+ readonly value: T;
314
+ } | {
315
+ readonly ok: false;
316
+ readonly status: number | null;
317
+ readonly reason: string;
318
+ readonly rejection: R | null;
319
+ };
320
+ declare const mapOutcome: <T, U>(outcome: ResourceOutcome<T>, map: (value: T) => U) => ResourceOutcome<U>;
321
+ declare const flatMapOutcome: <T, U>(outcome: ResourceOutcome<T>, map: (value: T) => ResourceOutcome<U>) => ResourceOutcome<U>;
322
+ type ResourceFailure = {
323
+ readonly status: number | null;
324
+ readonly reason: string;
325
+ readonly occurrence: number;
326
+ readonly retrying: boolean;
327
+ };
328
+ type ResourceState<T> = {
329
+ readonly kind: "idle";
330
+ } | {
331
+ readonly kind: "loading";
332
+ } | ({
333
+ readonly kind: "failed";
334
+ } & ResourceFailure) | {
335
+ readonly kind: "ready";
336
+ readonly value: T;
337
+ readonly refreshing: boolean;
338
+ readonly refreshFailure: {
339
+ readonly status: number | null;
340
+ readonly reason: string;
341
+ } | null;
342
+ };
343
+ type ReloadCause = "reload" | "revision";
344
+ declare const beginReload: <T>(state: ResourceState<T>, cause: ReloadCause) => ResourceState<T>;
345
+ declare const keepLastGood: <T>(state: ResourceState<T>, outcome: ResourceOutcome<T>) => ResourceState<T>;
346
+ type KeysetPage<T, C, M> = {
347
+ readonly rows: readonly T[];
348
+ readonly next: C | null;
349
+ readonly meta: M;
350
+ };
351
+ type NextPage<T, C> = {
352
+ readonly rows: readonly T[];
353
+ readonly next: C | null;
354
+ readonly meta?: never;
355
+ };
356
+ type PageFailure = {
357
+ readonly reason: string;
358
+ readonly occurrence: number;
359
+ };
360
+ type PagedValue<T, C, M> = {
361
+ readonly rows: readonly T[];
362
+ readonly next: C | null;
363
+ readonly meta: M;
364
+ readonly loadingMore: boolean;
365
+ readonly moreFailure: PageFailure | null;
366
+ };
367
+ type PagedContent<T, M> = {
368
+ readonly rows: readonly T[];
369
+ readonly meta: M;
370
+ };
371
+ type PagedState<T, C, M> = ResourceState<PagedValue<T, C, M>>;
372
+ declare const beginPagedReload: <T, C, M>(state: PagedState<T, C, M>, cause: ReloadCause) => PagedState<T, C, M>;
373
+ declare const settleFirstPage: <T, C, M>(state: PagedState<T, C, M>, outcome: ResourceOutcome<KeysetPage<T, C, M>>) => PagedState<T, C, M>;
374
+ declare const beginPage: <T, C, M>(state: PagedState<T, C, M>) => PagedState<T, C, M>;
375
+ declare const settlePage: <T, C, M>(state: PagedState<T, C, M>, cursor: C, outcome: ResourceOutcome<NextPage<T, C>>) => PagedState<T, C, M>;
376
+ declare const mapPagedList: <T, C, M>(state: PagedState<T, C, M>, map: (content: PagedContent<T, M>) => PagedContent<T, M>) => PagedState<T, C, M>;
314
377
  type Srgb = readonly [
315
378
  red: number,
316
379
  green: number,
@@ -487,4 +550,4 @@ declare const CONTRAST_PAIRS: {
487
550
  };
488
551
  };
489
552
  };
490
- export { type AccentRole, CONSOLE_UI_LABEL_CATALOGS, CONTRAST_MINIMUM, CONTRAST_PAIRS, type ColorScheme, type ColorToken, type ColumnWidth, type ColumnWidthSource, type CommandOutcome, type ConsoleUiLabels, type ConsoleUiLocale, type ConsoleUiTokens, type ContrastRole, type FgRole, HTTP_FORBIDDEN, type KeysetPage, LATTICE_PX, type MasterDetailOptions, type MasterDetailPlan, type MotionToken, type NextPage, type PageFailure, type PagedContent, type PagedState, type PagedValue, ROW_WITH_CONTROL_PX, type RadiusToken, type ReloadCause, type ResourceFailure, type ResourceOutcome, type ResourceState, type SchemeColor, type SizeToken, type SpaceToken, type Srgb, type StrokeToken, type SurfaceRole, TARGET_PX, TOKENS, type TileGridPlan, type TileGridStep, type TokenName, type TypeToken, type WeightToken, ZonedTimeError, type ZonedTimeErrorReason, beginPage, beginPagedReload, beginReload, ceil8, ceilToLattice, contrastRatio, cssVar, flatMapOutcome, formatCount, formatInstant, hexToSrgb, keepLastGood, mapOutcome, mapPagedList, masterDetailPlan, monoTextWidthEm, reasonAside, resolveConsoleUiLabels, settleFirstPage, settlePage, tableMinInlinePx, textWidthEm, tileGridPlan, toOffsetIso, toWallTime };
553
+ export { type AccentRole, COMPACT_ROW_PX, CONSOLE_UI_LABEL_CATALOGS, CONTRAST_MINIMUM, CONTRAST_PAIRS, type CellContent, type ColorScheme, type ColorToken, type ColumnHeaderText, type ColumnWidth, type ColumnWidthSource, type CommandOutcome, type ConsoleUiLabels, type ConsoleUiLocale, type ConsoleUiTokens, type ContrastRole, FIGURE_RING_REACH_PX, FLEXIBLE_COLUMN_MIN_PX, type FgRole, type FigureBoxLines, type FigureBoxPlan, type FigureDiscLabelPlan, HTTP_FORBIDDEN, type KeysetPage, LATTICE_PX, type MasterDetailOptions, type MasterDetailPlan, type MotionToken, type NextPage, type PageFailure, type PagedContent, type PagedState, type PagedValue, ROW_WITH_CONTROL_PX, type RadiusToken, type ReloadCause, type ResourceFailure, type ResourceOutcome, type ResourceState, type SchemeColor, type SizeToken, type SpaceToken, type Srgb, type StrokeToken, type SurfaceRole, TARGET_PX, TOKENS, type TextFace, type TileGridPlan, type TileGridStep, type TokenName, type TypeToken, type WeightToken, ZonedTimeError, type ZonedTimeErrorReason, beginPage, beginPagedReload, beginReload, ceil8, ceilToLattice, cellContentInlinePx, comparisonAttributePx, contrastRatio, countSampleText, cssVar, figureBoxPlan, figureDiscLabelPlan, fixedColumnPx, flatMapOutcome, formatCount, formatInstant, hexToSrgb, instantSampleText, isReadableText, keepLastGood, mapOutcome, mapPagedList, masterDetailPlan, monoTextWidthEm, readDecimalText, readIntegerText, reasonAside, resolveConsoleUiLabels, settleFirstPage, settlePage, spacedTextWidthEm, tableFrameMinInlinePx, tableMinInlinePx, textWidthEm, tileGridPlan, tileMinInlinePx, toOffsetIso, toWallTime };
package/dist/core.js CHANGED
@@ -1 +1 @@
1
- import{A as w,B as x,C,D,E,F,G,H,a,b,c,d,e,f,g,h,k as i,l as j,m as k,n as l,o as m,q as n,s as o,t as p,u as q,v as r,w as s,x as t,y as u,z as v}from"./chunk-BUX2DNVR.js";import{a as y,b as z,c as A,d as B}from"./chunk-BMGBEN26.js";export{l as CONSOLE_UI_LABEL_CATALOGS,A as CONTRAST_MINIMUM,B as CONTRAST_PAIRS,f as HTTP_FORBIDDEN,C as LATTICE_PX,F as ROW_WITH_CONTROL_PX,E as TARGET_PX,G as TOKENS,b as ZonedTimeError,v as beginPage,t as beginPagedReload,i as beginReload,r as ceil8,D as ceilToLattice,z as contrastRatio,H as cssVar,h as flatMapOutcome,a as formatCount,e as formatInstant,y as hexToSrgb,j as keepLastGood,g as mapOutcome,x as mapPagedList,n as masterDetailPlan,q as monoTextWidthEm,k as reasonAside,m as resolveConsoleUiLabels,u as settleFirstPage,w as settlePage,o as tableMinInlinePx,p as textWidthEm,s as tileGridPlan,c as toOffsetIso,d as toWallTime};
1
+ import{A as x,B as y,C as z,D as A,E as B,F as C,G as D,H as E,I as F,J as G,K as H,L as I,N as J,O as K,R as L,T as M,U as N,V as O,W as P,X as Q,Y as R,Z as S,_ as T,a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,o as l,p as m,q as n,r as o,s as p,t as q,u as r,v as s,w as t,x as u,y as v,z as w}from"./chunk-34QJXV5R.js";import{a as U,b as V,c as W,d as X}from"./chunk-FXEGLGL7.js";export{u as COMPACT_ROW_PX,o as CONSOLE_UI_LABEL_CATALOGS,W as CONTRAST_MINIMUM,X as CONTRAST_PAIRS,K as FIGURE_RING_REACH_PX,C as FLEXIBLE_COLUMN_MIN_PX,i as HTTP_FORBIDDEN,q as LATTICE_PX,t as ROW_WITH_CONTROL_PX,s as TARGET_PX,v as TOKENS,e as ZonedTimeError,R as beginPage,P as beginPagedReload,l as beginReload,z as ceil8,r as ceilToLattice,A as cellContentInlinePx,D as comparisonAttributePx,V as contrastRatio,F as countSampleText,w as cssVar,I as figureBoxPlan,J as figureDiscLabelPlan,B as fixedColumnPx,k as flatMapOutcome,a as formatCount,h as formatInstant,U as hexToSrgb,E as instantSampleText,d as isReadableText,m as keepLastGood,j as mapOutcome,T as mapPagedList,L as masterDetailPlan,y as monoTextWidthEm,b as readDecimalText,c as readIntegerText,n as reasonAside,p as resolveConsoleUiLabels,Q as settleFirstPage,S as settlePage,H as spacedTextWidthEm,N as tableFrameMinInlinePx,M as tableMinInlinePx,x as textWidthEm,O as tileGridPlan,G as tileMinInlinePx,f as toOffsetIso,g as toWallTime};