@aiquants/console-ui 0.2.0 → 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.
package/dist/core.d.cts CHANGED
@@ -23,6 +23,9 @@ type ConsoleUiLabels = {
23
23
  readonly close: string;
24
24
  readonly cancel: string;
25
25
  readonly reload: string;
26
+ readonly breadcrumb: string;
27
+ readonly stepDone: string;
28
+ readonly stepPending: string;
26
29
  };
27
30
  declare const reasonAside: (reason: string) => string;
28
31
  declare const CONSOLE_UI_LABEL_CATALOGS: Readonly<Record<ConsoleUiLocale, ConsoleUiLabels>>;
@@ -138,95 +141,46 @@ declare const settleFirstPage: <T, C, M>(state: PagedState<T, C, M>, outcome: Re
138
141
  declare const beginPage: <T, C, M>(state: PagedState<T, C, M>) => PagedState<T, C, M>;
139
142
  declare const settlePage: <T, C, M>(state: PagedState<T, C, M>, cursor: C, outcome: ResourceOutcome<NextPage<T, C>>) => PagedState<T, C, M>;
140
143
  declare const mapPagedList: <T, C, M>(state: PagedState<T, C, M>, map: (content: PagedContent<T, M>) => PagedContent<T, M>) => PagedState<T, C, M>;
141
- declare const TOKENS: {
142
- readonly space: {
143
- readonly "space-1": 4;
144
- readonly "space-2": 8;
145
- readonly "space-3": 12;
146
- readonly "space-4": 16;
147
- readonly "space-6": 24;
148
- readonly "space-8": 32;
149
- readonly "space-12": 48;
150
- };
151
- readonly type: {
152
- readonly caption: {
153
- readonly size: 11;
154
- readonly lineHeight: 16;
155
- };
156
- readonly body: {
157
- readonly size: 13;
158
- readonly lineHeight: 20;
159
- };
160
- readonly prose: {
161
- readonly size: 13;
162
- readonly lineHeight: 24;
163
- };
164
- readonly title: {
165
- readonly size: 16;
166
- readonly lineHeight: 24;
167
- };
168
- readonly heading: {
169
- readonly size: 20;
170
- readonly lineHeight: 28;
171
- };
172
- readonly display: {
173
- readonly size: 25;
174
- readonly lineHeight: 32;
175
- };
176
- };
177
- readonly weight: {
178
- readonly regular: 400;
179
- readonly medium: 500;
180
- readonly bold: 700;
181
- };
182
- readonly radius: {
183
- readonly "radius-control": 4;
184
- readonly "radius-item": 8;
185
- readonly "radius-container": 12;
186
- readonly "radius-pill": 9999;
187
- };
188
- readonly size: {
189
- readonly "size-control": 32;
190
- readonly "size-row": 32;
191
- readonly "size-row-control": 40;
192
- readonly "size-target": 24;
193
- };
194
- readonly stroke: {
195
- readonly "border-width": 1;
196
- readonly "focus-width": 2;
197
- readonly "focus-offset": 2;
198
- };
199
- readonly color: {
200
- readonly fg: "#0f172b";
201
- readonly "fg-secondary": "#314158";
202
- readonly "fg-muted": "#45556c";
203
- readonly "danger-fg": "#9f0712";
204
- readonly "warning-fg": "#7b3306";
205
- readonly "success-fg": "#006045";
206
- readonly "info-fg": "#193cb8";
207
- readonly "on-solid": "#ffffff";
208
- readonly surface: "#ffffff";
209
- readonly subtle: "#f8fafc";
210
- readonly sunken: "#f1f5f9";
211
- readonly "danger-tint": "#fef2f2";
212
- readonly "warning-tint": "#fffbeb";
213
- readonly "success-tint": "#ecfdf5";
214
- readonly "info-tint": "#eff6ff";
215
- readonly "neutral-solid": "#314158";
216
- readonly "danger-solid": "#9f0712";
217
- readonly "success-solid": "#006045";
218
- readonly "info-solid": "#193cb8";
219
- readonly "warning-solid": "#7b3306";
220
- readonly "danger-accent": "#e7000b";
221
- readonly "warning-accent": "#bb4d00";
222
- readonly "success-accent": "#009966";
223
- readonly "info-accent": "#155dfc";
224
- readonly focus: "#155dfc";
225
- readonly "border-control": "#62748e";
226
- readonly "border-subtle": "#e2e8f0";
227
- };
144
+ declare const LATTICE_PX = 4;
145
+ declare const SPACE_MULTIPLIERS: readonly [
146
+ 1,
147
+ 2,
148
+ 3,
149
+ 4,
150
+ 6,
151
+ 8,
152
+ 12,
153
+ 16,
154
+ 24
155
+ ];
156
+ declare const TYPE_STEPS: {
157
+ readonly caption: -2;
158
+ readonly body: -1;
159
+ readonly title: 0;
160
+ readonly heading: 1;
161
+ readonly display: 2;
162
+ readonly "display-lg": 3;
163
+ };
164
+ declare const MOTION_STEPS: readonly [
165
+ 1,
166
+ 2,
167
+ 3
168
+ ];
169
+ declare const ceilToLattice: (px: number) => number;
170
+ declare const TARGET_PX: number;
171
+ declare const ROW_WITH_CONTROL_PX: number;
172
+ type SpaceToken = `space-${(typeof SPACE_MULTIPLIERS)[number]}`;
173
+ type TypeToken = keyof typeof TYPE_STEPS | "prose";
174
+ type MotionToken = `motion-${(typeof MOTION_STEPS)[number]}`;
175
+ type WeightToken = "regular" | "medium" | "bold";
176
+ type RadiusToken = "radius-control" | "radius-item" | "radius-container" | "radius-pill";
177
+ type SizeToken = "size-control" | "size-row" | "size-row-control" | "size-target";
178
+ type StrokeToken = "border-width" | "focus-width" | "focus-offset" | "marker-width";
179
+ type SchemeColor = {
180
+ readonly light: string;
181
+ readonly dark: string;
228
182
  };
229
- type ConsoleUiTokens = {
183
+ type ConsoleUiTokens$1<ColorToken extends string = string> = {
230
184
  readonly space: Readonly<Record<SpaceToken, number>>;
231
185
  readonly type: Readonly<Record<TypeToken, {
232
186
  readonly size: number;
@@ -236,110 +190,301 @@ type ConsoleUiTokens = {
236
190
  readonly radius: Readonly<Record<RadiusToken, number>>;
237
191
  readonly size: Readonly<Record<SizeToken, number>>;
238
192
  readonly stroke: Readonly<Record<StrokeToken, number>>;
239
- readonly color: Readonly<Record<ColorToken, string>>;
240
- };
241
- type SpaceToken = keyof typeof TOKENS.space;
242
- type TypeToken = keyof typeof TOKENS.type;
243
- type WeightToken = keyof typeof TOKENS.weight;
244
- type RadiusToken = keyof typeof TOKENS.radius;
245
- type SizeToken = keyof typeof TOKENS.size;
246
- type StrokeToken = keyof typeof TOKENS.stroke;
247
- type ColorToken = keyof typeof TOKENS.color;
248
- type FgRole = "fg" | "fg-secondary" | "fg-muted" | "danger-fg" | "warning-fg" | "success-fg" | "info-fg" | "on-solid";
249
- type SurfaceRole = "surface" | "subtle" | "sunken" | "danger-tint" | "warning-tint" | "success-tint" | "info-tint" | "neutral-solid" | "danger-solid" | "success-solid" | "info-solid" | "warning-solid";
250
- type AccentRole = "danger-accent" | "warning-accent" | "success-accent" | "info-accent";
251
- type TokenName = SpaceToken | `font-size-${TypeToken}` | `line-height-${TypeToken}` | `font-weight-${WeightToken}` | RadiusToken | SizeToken | StrokeToken | ColorToken;
252
- declare const cssVar: (name: TokenName) => string;
253
- type Srgb = readonly [
254
- red: number,
255
- green: number,
256
- blue: number
257
- ];
258
- declare const hexToSrgb: (hex: string) => Srgb;
259
- declare const contrastRatio: (first: Srgb, second: Srgb) => number;
260
- declare const CONTRAST_MINIMUM: {
261
- readonly text: 4.5;
262
- readonly nonText: 3;
193
+ readonly motion: Readonly<Record<MotionToken, number>>;
194
+ readonly color: Readonly<Record<ColorToken, SchemeColor>>;
263
195
  };
264
- type ContrastRole = FgRole | AccentRole | "focus" | "border-control";
265
- declare const CONTRAST_PAIRS: {
196
+ declare const CONSOLE_PALETTE: {
266
197
  readonly fg: {
267
- readonly surface: 17.83;
268
- readonly subtle: 17.04;
269
- readonly sunken: 16.28;
270
- readonly "danger-tint": 16.3;
271
- readonly "warning-tint": 17.19;
272
- readonly "success-tint": 16.93;
273
- readonly "info-tint": 16.38;
198
+ readonly light: "#0f172b";
199
+ readonly dark: "#f8fafc";
274
200
  };
275
201
  readonly "fg-secondary": {
276
- readonly surface: 10.36;
277
- readonly subtle: 9.9;
278
- readonly sunken: 9.45;
202
+ readonly light: "#314158";
203
+ readonly dark: "#e2e8f0";
279
204
  };
280
205
  readonly "fg-muted": {
281
- readonly surface: 7.58;
282
- readonly subtle: 7.25;
283
- readonly sunken: 6.92;
284
- readonly "danger-tint": 6.93;
285
- readonly "warning-tint": 7.31;
286
- readonly "info-tint": 6.97;
206
+ readonly light: "#44536a";
207
+ readonly dark: "#cad5e2";
287
208
  };
288
209
  readonly "danger-fg": {
289
- readonly surface: 8.36;
290
- readonly subtle: 7.99;
291
- readonly "danger-tint": 7.64;
210
+ readonly light: "#9f0712";
211
+ readonly dark: "#ffc9c9";
292
212
  };
293
213
  readonly "warning-fg": {
294
- readonly surface: 9.06;
295
- readonly subtle: 8.66;
296
- readonly "warning-tint": 8.73;
214
+ readonly light: "#7b3306";
215
+ readonly dark: "#fee685";
297
216
  };
298
217
  readonly "success-fg": {
299
- readonly surface: 7.61;
300
- readonly subtle: 7.27;
301
- readonly "success-tint": 7.23;
218
+ readonly light: "#006045";
219
+ readonly dark: "#a4f4cf";
302
220
  };
303
221
  readonly "info-fg": {
304
- readonly surface: 8.82;
305
- readonly "info-tint": 8.11;
306
- readonly subtle: 8.43;
222
+ readonly light: "#193cb8";
223
+ readonly dark: "#bedbff";
307
224
  };
308
225
  readonly "on-solid": {
309
- readonly "neutral-solid": 10.36;
310
- readonly "danger-solid": 8.36;
311
- readonly "success-solid": 7.61;
312
- readonly "info-solid": 8.82;
313
- readonly "warning-solid": 9.06;
226
+ readonly light: "#ffffff";
227
+ readonly dark: "#0f172b";
228
+ };
229
+ readonly surface: {
230
+ readonly light: "#ffffff";
231
+ readonly dark: "#0f172b";
232
+ };
233
+ readonly subtle: {
234
+ readonly light: "#f8fafc";
235
+ readonly dark: "#1d293d";
236
+ };
237
+ readonly sunken: {
238
+ readonly light: "#f1f5f9";
239
+ readonly dark: "#020618";
240
+ };
241
+ readonly "danger-tint": {
242
+ readonly light: "#fef2f2";
243
+ readonly dark: "#460809";
244
+ };
245
+ readonly "warning-tint": {
246
+ readonly light: "#fffbeb";
247
+ readonly dark: "#461901";
248
+ };
249
+ readonly "success-tint": {
250
+ readonly light: "#ecfdf5";
251
+ readonly dark: "#002c22";
252
+ };
253
+ readonly "info-tint": {
254
+ readonly light: "#eff6ff";
255
+ readonly dark: "#162456";
256
+ };
257
+ readonly "neutral-solid": {
258
+ readonly light: "#314158";
259
+ readonly dark: "#cad5e2";
260
+ };
261
+ readonly "danger-solid": {
262
+ readonly light: "#9f0712";
263
+ readonly dark: "#ffa2a2";
264
+ };
265
+ readonly "success-solid": {
266
+ readonly light: "#006045";
267
+ readonly dark: "#5ee9b5";
268
+ };
269
+ readonly "info-solid": {
270
+ readonly light: "#193cb8";
271
+ readonly dark: "#8ec5ff";
272
+ };
273
+ readonly "warning-solid": {
274
+ readonly light: "#7b3306";
275
+ readonly dark: "#ffd230";
314
276
  };
315
277
  readonly "danger-accent": {
316
- readonly surface: 4.77;
317
- readonly "danger-tint": 4.36;
278
+ readonly light: "#e7000b";
279
+ readonly dark: "#ff6467";
318
280
  };
319
281
  readonly "warning-accent": {
320
- readonly surface: 5.03;
321
- readonly "warning-tint": 4.85;
282
+ readonly light: "#bb4d00";
283
+ readonly dark: "#fcbb00";
322
284
  };
323
285
  readonly "success-accent": {
324
- readonly surface: 3.65;
325
- readonly "success-tint": 3.47;
286
+ readonly light: "#009966";
287
+ readonly dark: "#00d492";
326
288
  };
327
289
  readonly "info-accent": {
328
- readonly surface: 5.25;
329
- readonly subtle: 5.01;
330
- readonly sunken: 4.79;
331
- readonly "info-tint": 4.82;
290
+ readonly light: "#155dfc";
291
+ readonly dark: "#51a2ff";
332
292
  };
333
293
  readonly focus: {
334
- readonly surface: 5.25;
335
- readonly subtle: 5.01;
336
- readonly sunken: 4.79;
337
- readonly "info-tint": 4.82;
294
+ readonly light: "#155dfc";
295
+ readonly dark: "#51a2ff";
338
296
  };
339
297
  readonly "border-control": {
340
- readonly surface: 4.76;
341
- readonly subtle: 4.55;
342
- readonly sunken: 4.35;
298
+ readonly light: "#62748e";
299
+ readonly dark: "#90a1b9";
300
+ };
301
+ readonly "border-subtle": {
302
+ readonly light: "#e2e8f0";
303
+ readonly dark: "#314158";
304
+ };
305
+ };
306
+ type ColorToken = keyof typeof CONSOLE_PALETTE;
307
+ type ConsoleUiTokens = ConsoleUiTokens$1<ColorToken>;
308
+ declare const TOKENS: ConsoleUiTokens;
309
+ type FgRole = "fg" | "fg-secondary" | "fg-muted" | "danger-fg" | "warning-fg" | "success-fg" | "info-fg" | "on-solid";
310
+ type SurfaceRole = "surface" | "subtle" | "sunken" | "danger-tint" | "warning-tint" | "success-tint" | "info-tint" | "neutral-solid" | "danger-solid" | "success-solid" | "info-solid" | "warning-solid";
311
+ type AccentRole = "danger-accent" | "warning-accent" | "success-accent" | "info-accent";
312
+ type TokenName = SpaceToken | `font-size-${TypeToken}` | `line-height-${TypeToken}` | `font-weight-${WeightToken}` | RadiusToken | SizeToken | StrokeToken | MotionToken | ColorToken;
313
+ declare const cssVar: (name: TokenName) => string;
314
+ type Srgb = readonly [
315
+ red: number,
316
+ green: number,
317
+ blue: number
318
+ ];
319
+ declare const hexToSrgb: (hex: string) => Srgb;
320
+ declare const contrastRatio: (first: Srgb, second: Srgb) => number;
321
+ declare const CONTRAST_MINIMUM: {
322
+ readonly text: 7;
323
+ readonly largeText: 4.5;
324
+ readonly nonText: 3;
325
+ };
326
+ type ContrastRole = FgRole | AccentRole | "focus" | "border-control";
327
+ type ColorScheme = "light" | "dark";
328
+ declare const CONTRAST_PAIRS: {
329
+ readonly light: {
330
+ readonly fg: {
331
+ readonly surface: 17.83;
332
+ readonly subtle: 17.04;
333
+ readonly sunken: 16.28;
334
+ readonly "danger-tint": 16.3;
335
+ readonly "warning-tint": 17.19;
336
+ readonly "success-tint": 16.93;
337
+ readonly "info-tint": 16.38;
338
+ };
339
+ readonly "fg-secondary": {
340
+ readonly surface: 10.36;
341
+ readonly subtle: 9.9;
342
+ readonly sunken: 9.45;
343
+ };
344
+ readonly "fg-muted": {
345
+ readonly surface: 7.8;
346
+ readonly subtle: 7.46;
347
+ readonly sunken: 7.12;
348
+ readonly "danger-tint": 7.13;
349
+ readonly "warning-tint": 7.52;
350
+ readonly "info-tint": 7.17;
351
+ };
352
+ readonly "danger-fg": {
353
+ readonly surface: 8.36;
354
+ readonly subtle: 7.99;
355
+ readonly "danger-tint": 7.64;
356
+ };
357
+ readonly "warning-fg": {
358
+ readonly surface: 9.06;
359
+ readonly subtle: 8.66;
360
+ readonly "warning-tint": 8.73;
361
+ };
362
+ readonly "success-fg": {
363
+ readonly surface: 7.61;
364
+ readonly subtle: 7.27;
365
+ readonly "success-tint": 7.23;
366
+ };
367
+ readonly "info-fg": {
368
+ readonly surface: 8.82;
369
+ readonly "info-tint": 8.11;
370
+ readonly subtle: 8.43;
371
+ };
372
+ readonly "on-solid": {
373
+ readonly "neutral-solid": 10.36;
374
+ readonly "danger-solid": 8.36;
375
+ readonly "success-solid": 7.61;
376
+ readonly "info-solid": 8.82;
377
+ readonly "warning-solid": 9.06;
378
+ };
379
+ readonly "danger-accent": {
380
+ readonly surface: 4.77;
381
+ readonly "danger-tint": 4.36;
382
+ };
383
+ readonly "warning-accent": {
384
+ readonly surface: 5.03;
385
+ readonly "warning-tint": 4.85;
386
+ };
387
+ readonly "success-accent": {
388
+ readonly surface: 3.65;
389
+ readonly "success-tint": 3.47;
390
+ };
391
+ readonly "info-accent": {
392
+ readonly surface: 5.25;
393
+ readonly subtle: 5.01;
394
+ readonly sunken: 4.79;
395
+ readonly "info-tint": 4.82;
396
+ };
397
+ readonly focus: {
398
+ readonly surface: 5.25;
399
+ readonly subtle: 5.01;
400
+ readonly sunken: 4.79;
401
+ readonly "info-tint": 4.82;
402
+ };
403
+ readonly "border-control": {
404
+ readonly surface: 4.76;
405
+ readonly subtle: 4.55;
406
+ readonly sunken: 4.35;
407
+ };
408
+ };
409
+ readonly dark: {
410
+ readonly fg: {
411
+ readonly surface: 17.04;
412
+ readonly subtle: 13.97;
413
+ readonly sunken: 19.27;
414
+ readonly "danger-tint": 15.45;
415
+ readonly "warning-tint": 14.34;
416
+ readonly "success-tint": 14.51;
417
+ readonly "info-tint": 14.13;
418
+ };
419
+ readonly "fg-secondary": {
420
+ readonly surface: 14.46;
421
+ readonly subtle: 11.86;
422
+ readonly sunken: 16.35;
423
+ };
424
+ readonly "fg-muted": {
425
+ readonly surface: 12;
426
+ readonly subtle: 9.83;
427
+ readonly sunken: 13.56;
428
+ readonly "danger-tint": 10.87;
429
+ readonly "warning-tint": 10.09;
430
+ readonly "info-tint": 9.94;
431
+ };
432
+ readonly "danger-fg": {
433
+ readonly surface: 12.27;
434
+ readonly subtle: 10.06;
435
+ readonly "danger-tint": 11.12;
436
+ };
437
+ readonly "warning-fg": {
438
+ readonly surface: 14.33;
439
+ readonly subtle: 11.74;
440
+ readonly "warning-tint": 12.05;
441
+ };
442
+ readonly "success-fg": {
443
+ readonly surface: 13.94;
444
+ readonly subtle: 11.43;
445
+ readonly "success-tint": 11.87;
446
+ };
447
+ readonly "info-fg": {
448
+ readonly surface: 12.54;
449
+ readonly "info-tint": 10.39;
450
+ readonly subtle: 10.28;
451
+ };
452
+ readonly "on-solid": {
453
+ readonly "neutral-solid": 12;
454
+ readonly "danger-solid": 9.29;
455
+ readonly "success-solid": 11.72;
456
+ readonly "info-solid": 9.83;
457
+ readonly "warning-solid": 12.32;
458
+ };
459
+ readonly "danger-accent": {
460
+ readonly surface: 6.17;
461
+ readonly "danger-tint": 5.6;
462
+ };
463
+ readonly "warning-accent": {
464
+ readonly surface: 10.4;
465
+ readonly "warning-tint": 8.75;
466
+ };
467
+ readonly "success-accent": {
468
+ readonly surface: 9.2;
469
+ readonly "success-tint": 7.83;
470
+ };
471
+ readonly "info-accent": {
472
+ readonly surface: 6.76;
473
+ readonly subtle: 5.54;
474
+ readonly sunken: 7.64;
475
+ readonly "info-tint": 5.6;
476
+ };
477
+ readonly focus: {
478
+ readonly surface: 6.76;
479
+ readonly subtle: 5.54;
480
+ readonly sunken: 7.64;
481
+ readonly "info-tint": 5.6;
482
+ };
483
+ readonly "border-control": {
484
+ readonly surface: 6.78;
485
+ readonly subtle: 5.56;
486
+ readonly sunken: 7.66;
487
+ };
343
488
  };
344
489
  };
345
- export { type AccentRole, CONSOLE_UI_LABEL_CATALOGS, CONTRAST_MINIMUM, CONTRAST_PAIRS, type ColorToken, type ColumnWidth, type ColumnWidthSource, type CommandOutcome, type ConsoleUiLabels, type ConsoleUiLocale, type ConsoleUiTokens, type ContrastRole, type FgRole, HTTP_FORBIDDEN, type KeysetPage, type MasterDetailOptions, type MasterDetailPlan, type NextPage, type PageFailure, type PagedContent, type PagedState, type PagedValue, type RadiusToken, type ReloadCause, type ResourceFailure, type ResourceOutcome, type ResourceState, type SizeToken, type SpaceToken, type Srgb, type StrokeToken, type SurfaceRole, TOKENS, type TileGridPlan, type TileGridStep, type TokenName, type TypeToken, type WeightToken, ZonedTimeError, type ZonedTimeErrorReason, beginPage, beginPagedReload, beginReload, ceil8, contrastRatio, cssVar, flatMapOutcome, formatCount, formatInstant, hexToSrgb, keepLastGood, mapOutcome, mapPagedList, masterDetailPlan, monoTextWidthEm, reasonAside, resolveConsoleUiLabels, settleFirstPage, settlePage, tableMinInlinePx, textWidthEm, tileGridPlan, toOffsetIso, toWallTime };
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 };