@aiquants/console-ui 0.1.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.
@@ -0,0 +1,338 @@
1
+ declare const formatCount: (value: number, formatLocale: string) => string;
2
+ type ZonedTimeErrorReason = "malformed" | "subsecond" | "nonexistent" | "ambiguous";
3
+ declare class ZonedTimeError extends RangeError {
4
+ readonly reason: ZonedTimeErrorReason;
5
+ constructor(reason: ZonedTimeErrorReason, message: string);
6
+ }
7
+ declare const toOffsetIso: (wallTime: string, timeZone: string) => string;
8
+ declare const toWallTime: (offsetIso: string, timeZone: string) => string;
9
+ declare const formatInstant: (instant: string, formatLocale: string, timeZone: string) => string;
10
+ type ConsoleUiLocale = "en" | "ja";
11
+ type ConsoleUiLabels = {
12
+ readonly unmeasured: string;
13
+ readonly loading: string;
14
+ readonly loadFailed: (reason: string) => string;
15
+ readonly refreshFailed: (reason: string) => string;
16
+ readonly loadMore: (limit: string) => string;
17
+ readonly endOfRecords: string;
18
+ readonly close: string;
19
+ readonly cancel: string;
20
+ readonly reload: string;
21
+ };
22
+ declare const CONSOLE_UI_LABEL_CATALOGS: Readonly<Record<ConsoleUiLocale, ConsoleUiLabels>>;
23
+ declare const resolveConsoleUiLabels: (locale: string) => ConsoleUiLabels;
24
+ type MasterDetailOptions = {
25
+ readonly masterMinPx: number;
26
+ readonly detailMinPx: number;
27
+ readonly gapPx: number;
28
+ };
29
+ type MasterDetailPlan = {
30
+ readonly sideBySide: boolean;
31
+ readonly sideBySideFromPx: number;
32
+ readonly masterInlinePx: number;
33
+ readonly detailInlinePx: number;
34
+ };
35
+ declare const masterDetailPlan: (containerPx: number, options: MasterDetailOptions) => MasterDetailPlan;
36
+ type ColumnWidth = {
37
+ readonly fixedPx: number;
38
+ readonly minPx?: never;
39
+ } | {
40
+ readonly minPx: number;
41
+ readonly fixedPx?: never;
42
+ };
43
+ type ColumnWidthSource = {
44
+ readonly width: ColumnWidth;
45
+ };
46
+ declare const tableMinInlinePx: (columns: readonly ColumnWidthSource[]) => number;
47
+ declare const textWidthEm: (text: string) => number;
48
+ declare const monoTextWidthEm: (text: string) => number;
49
+ declare const ceil8: (px: number) => number;
50
+ type TileGridStep = {
51
+ readonly columns: number;
52
+ readonly minContainerPx: number;
53
+ };
54
+ type TileGridPlan = {
55
+ readonly key: string;
56
+ readonly steps: readonly TileGridStep[];
57
+ readonly css: string;
58
+ };
59
+ declare const tileGridPlan: (count: number, minInlinePx: number, gapPx: number) => TileGridPlan;
60
+ type ResourceOutcome<T> = {
61
+ readonly ok: true;
62
+ readonly value: T;
63
+ } | {
64
+ readonly ok: false;
65
+ readonly status: number | null;
66
+ readonly reason: string;
67
+ };
68
+ type CommandOutcome<T, R> = {
69
+ readonly ok: true;
70
+ readonly value: T;
71
+ } | {
72
+ readonly ok: false;
73
+ readonly status: number | null;
74
+ readonly reason: string;
75
+ readonly rejection: R | null;
76
+ };
77
+ declare const mapOutcome: <T, U>(outcome: ResourceOutcome<T>, map: (value: T) => U) => ResourceOutcome<U>;
78
+ declare const flatMapOutcome: <T, U>(outcome: ResourceOutcome<T>, map: (value: T) => ResourceOutcome<U>) => ResourceOutcome<U>;
79
+ type ResourceFailure = {
80
+ readonly status: number | null;
81
+ readonly reason: string;
82
+ readonly occurrence: number;
83
+ readonly retrying: boolean;
84
+ };
85
+ type ResourceState<T> = {
86
+ readonly kind: "idle";
87
+ } | {
88
+ readonly kind: "loading";
89
+ } | ({
90
+ readonly kind: "failed";
91
+ } & ResourceFailure) | {
92
+ readonly kind: "ready";
93
+ readonly value: T;
94
+ readonly refreshing: boolean;
95
+ readonly refreshFailure: {
96
+ readonly status: number | null;
97
+ readonly reason: string;
98
+ } | null;
99
+ };
100
+ type ReloadCause = "reload" | "revision";
101
+ declare const beginReload: <T>(state: ResourceState<T>, cause: ReloadCause) => ResourceState<T>;
102
+ declare const keepLastGood: <T>(state: ResourceState<T>, outcome: ResourceOutcome<T>) => ResourceState<T>;
103
+ type KeysetPage<T, C, M> = {
104
+ readonly rows: readonly T[];
105
+ readonly next: C | null;
106
+ readonly meta: M;
107
+ };
108
+ type NextPage<T, C> = {
109
+ readonly rows: readonly T[];
110
+ readonly next: C | null;
111
+ readonly meta?: never;
112
+ };
113
+ type PageFailure = {
114
+ readonly reason: string;
115
+ readonly occurrence: number;
116
+ };
117
+ type PagedValue<T, C, M> = {
118
+ readonly rows: readonly T[];
119
+ readonly next: C | null;
120
+ readonly meta: M;
121
+ readonly loadingMore: boolean;
122
+ readonly moreFailure: PageFailure | null;
123
+ };
124
+ type PagedContent<T, M> = {
125
+ readonly rows: readonly T[];
126
+ readonly meta: M;
127
+ };
128
+ type PagedState<T, C, M> = ResourceState<PagedValue<T, C, M>>;
129
+ declare const beginPagedReload: <T, C, M>(state: PagedState<T, C, M>, cause: ReloadCause) => PagedState<T, C, M>;
130
+ declare const settleFirstPage: <T, C, M>(state: PagedState<T, C, M>, outcome: ResourceOutcome<KeysetPage<T, C, M>>) => PagedState<T, C, M>;
131
+ declare const beginPage: <T, C, M>(state: PagedState<T, C, M>) => PagedState<T, C, M>;
132
+ declare const settlePage: <T, C, M>(state: PagedState<T, C, M>, cursor: C, outcome: ResourceOutcome<NextPage<T, C>>) => PagedState<T, C, M>;
133
+ declare const mapPagedList: <T, C, M>(state: PagedState<T, C, M>, map: (content: PagedContent<T, M>) => PagedContent<T, M>) => PagedState<T, C, M>;
134
+ declare const TOKENS: {
135
+ readonly space: {
136
+ readonly "space-1": 4;
137
+ readonly "space-2": 8;
138
+ readonly "space-3": 12;
139
+ readonly "space-4": 16;
140
+ readonly "space-6": 24;
141
+ readonly "space-8": 32;
142
+ readonly "space-12": 48;
143
+ };
144
+ readonly type: {
145
+ readonly caption: {
146
+ readonly size: 11;
147
+ readonly lineHeight: 16;
148
+ };
149
+ readonly body: {
150
+ readonly size: 13;
151
+ readonly lineHeight: 20;
152
+ };
153
+ readonly prose: {
154
+ readonly size: 13;
155
+ readonly lineHeight: 24;
156
+ };
157
+ readonly title: {
158
+ readonly size: 16;
159
+ readonly lineHeight: 24;
160
+ };
161
+ readonly heading: {
162
+ readonly size: 20;
163
+ readonly lineHeight: 28;
164
+ };
165
+ readonly display: {
166
+ readonly size: 25;
167
+ readonly lineHeight: 32;
168
+ };
169
+ };
170
+ readonly weight: {
171
+ readonly regular: 400;
172
+ readonly medium: 500;
173
+ readonly bold: 700;
174
+ };
175
+ readonly radius: {
176
+ readonly "radius-control": 4;
177
+ readonly "radius-item": 8;
178
+ readonly "radius-container": 12;
179
+ readonly "radius-pill": 9999;
180
+ };
181
+ readonly size: {
182
+ readonly "size-control": 32;
183
+ readonly "size-row": 32;
184
+ readonly "size-row-control": 40;
185
+ readonly "size-target": 24;
186
+ };
187
+ readonly stroke: {
188
+ readonly "border-width": 1;
189
+ readonly "focus-width": 2;
190
+ readonly "focus-offset": 2;
191
+ };
192
+ readonly color: {
193
+ readonly fg: "#0f172b";
194
+ readonly "fg-secondary": "#314158";
195
+ readonly "fg-muted": "#45556c";
196
+ readonly "danger-fg": "#9f0712";
197
+ readonly "warning-fg": "#7b3306";
198
+ readonly "success-fg": "#006045";
199
+ readonly "info-fg": "#193cb8";
200
+ readonly "on-solid": "#ffffff";
201
+ readonly surface: "#ffffff";
202
+ readonly subtle: "#f8fafc";
203
+ readonly sunken: "#f1f5f9";
204
+ readonly "danger-tint": "#fef2f2";
205
+ readonly "warning-tint": "#fffbeb";
206
+ readonly "success-tint": "#ecfdf5";
207
+ readonly "info-tint": "#eff6ff";
208
+ readonly "neutral-solid": "#314158";
209
+ readonly "danger-solid": "#9f0712";
210
+ readonly "success-solid": "#006045";
211
+ readonly "info-solid": "#193cb8";
212
+ readonly "warning-solid": "#7b3306";
213
+ readonly "danger-accent": "#e7000b";
214
+ readonly "warning-accent": "#bb4d00";
215
+ readonly "success-accent": "#009966";
216
+ readonly "info-accent": "#155dfc";
217
+ readonly focus: "#155dfc";
218
+ readonly "border-control": "#62748e";
219
+ readonly "border-subtle": "#e2e8f0";
220
+ };
221
+ };
222
+ type ConsoleUiTokens = {
223
+ readonly space: Readonly<Record<SpaceToken, number>>;
224
+ readonly type: Readonly<Record<TypeToken, {
225
+ readonly size: number;
226
+ readonly lineHeight: number;
227
+ }>>;
228
+ readonly weight: Readonly<Record<WeightToken, number>>;
229
+ readonly radius: Readonly<Record<RadiusToken, number>>;
230
+ readonly size: Readonly<Record<SizeToken, number>>;
231
+ readonly stroke: Readonly<Record<StrokeToken, number>>;
232
+ readonly color: Readonly<Record<ColorToken, string>>;
233
+ };
234
+ type SpaceToken = keyof typeof TOKENS.space;
235
+ type TypeToken = keyof typeof TOKENS.type;
236
+ type WeightToken = keyof typeof TOKENS.weight;
237
+ type RadiusToken = keyof typeof TOKENS.radius;
238
+ type SizeToken = keyof typeof TOKENS.size;
239
+ type StrokeToken = keyof typeof TOKENS.stroke;
240
+ type ColorToken = keyof typeof TOKENS.color;
241
+ type FgRole = "fg" | "fg-secondary" | "fg-muted" | "danger-fg" | "warning-fg" | "success-fg" | "info-fg" | "on-solid";
242
+ type SurfaceRole = "surface" | "subtle" | "sunken" | "danger-tint" | "warning-tint" | "success-tint" | "info-tint" | "neutral-solid" | "danger-solid" | "success-solid" | "info-solid" | "warning-solid";
243
+ type AccentRole = "danger-accent" | "warning-accent" | "success-accent" | "info-accent";
244
+ type TokenName = SpaceToken | `font-size-${TypeToken}` | `line-height-${TypeToken}` | `font-weight-${WeightToken}` | RadiusToken | SizeToken | StrokeToken | ColorToken;
245
+ declare const cssVar: (name: TokenName) => string;
246
+ type Srgb = readonly [
247
+ red: number,
248
+ green: number,
249
+ blue: number
250
+ ];
251
+ declare const hexToSrgb: (hex: string) => Srgb;
252
+ declare const contrastRatio: (first: Srgb, second: Srgb) => number;
253
+ declare const CONTRAST_MINIMUM: {
254
+ readonly text: 4.5;
255
+ readonly nonText: 3;
256
+ };
257
+ type ContrastRole = FgRole | AccentRole | "focus" | "border-control";
258
+ declare const CONTRAST_PAIRS: {
259
+ readonly fg: {
260
+ readonly surface: 17.83;
261
+ readonly subtle: 17.04;
262
+ readonly sunken: 16.28;
263
+ readonly "danger-tint": 16.3;
264
+ readonly "warning-tint": 17.19;
265
+ readonly "success-tint": 16.93;
266
+ readonly "info-tint": 16.38;
267
+ };
268
+ readonly "fg-secondary": {
269
+ readonly surface: 10.36;
270
+ readonly subtle: 9.9;
271
+ readonly sunken: 9.45;
272
+ };
273
+ readonly "fg-muted": {
274
+ readonly surface: 7.58;
275
+ readonly subtle: 7.25;
276
+ readonly sunken: 6.92;
277
+ readonly "danger-tint": 6.93;
278
+ readonly "warning-tint": 7.31;
279
+ readonly "info-tint": 6.97;
280
+ };
281
+ readonly "danger-fg": {
282
+ readonly surface: 8.36;
283
+ readonly subtle: 7.99;
284
+ readonly "danger-tint": 7.64;
285
+ };
286
+ readonly "warning-fg": {
287
+ readonly surface: 9.06;
288
+ readonly subtle: 8.66;
289
+ readonly "warning-tint": 8.73;
290
+ };
291
+ readonly "success-fg": {
292
+ readonly surface: 7.61;
293
+ readonly subtle: 7.27;
294
+ readonly "success-tint": 7.23;
295
+ };
296
+ readonly "info-fg": {
297
+ readonly surface: 8.82;
298
+ readonly "info-tint": 8.11;
299
+ readonly subtle: 8.43;
300
+ };
301
+ readonly "on-solid": {
302
+ readonly "neutral-solid": 10.36;
303
+ readonly "danger-solid": 8.36;
304
+ readonly "success-solid": 7.61;
305
+ readonly "info-solid": 8.82;
306
+ readonly "warning-solid": 9.06;
307
+ };
308
+ readonly "danger-accent": {
309
+ readonly surface: 4.77;
310
+ readonly "danger-tint": 4.36;
311
+ };
312
+ readonly "warning-accent": {
313
+ readonly surface: 5.03;
314
+ readonly "warning-tint": 4.85;
315
+ };
316
+ readonly "success-accent": {
317
+ readonly surface: 3.65;
318
+ readonly "success-tint": 3.47;
319
+ };
320
+ readonly "info-accent": {
321
+ readonly surface: 5.25;
322
+ readonly subtle: 5.01;
323
+ readonly sunken: 4.79;
324
+ readonly "info-tint": 4.82;
325
+ };
326
+ readonly focus: {
327
+ readonly surface: 5.25;
328
+ readonly subtle: 5.01;
329
+ readonly sunken: 4.79;
330
+ readonly "info-tint": 4.82;
331
+ };
332
+ readonly "border-control": {
333
+ readonly surface: 4.76;
334
+ readonly subtle: 4.55;
335
+ readonly sunken: 4.35;
336
+ };
337
+ };
338
+ 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, 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, resolveConsoleUiLabels, settleFirstPage, settlePage, tableMinInlinePx, textWidthEm, tileGridPlan, toOffsetIso, toWallTime };
package/dist/core.d.ts ADDED
@@ -0,0 +1,338 @@
1
+ declare const formatCount: (value: number, formatLocale: string) => string;
2
+ type ZonedTimeErrorReason = "malformed" | "subsecond" | "nonexistent" | "ambiguous";
3
+ declare class ZonedTimeError extends RangeError {
4
+ readonly reason: ZonedTimeErrorReason;
5
+ constructor(reason: ZonedTimeErrorReason, message: string);
6
+ }
7
+ declare const toOffsetIso: (wallTime: string, timeZone: string) => string;
8
+ declare const toWallTime: (offsetIso: string, timeZone: string) => string;
9
+ declare const formatInstant: (instant: string, formatLocale: string, timeZone: string) => string;
10
+ type ConsoleUiLocale = "en" | "ja";
11
+ type ConsoleUiLabels = {
12
+ readonly unmeasured: string;
13
+ readonly loading: string;
14
+ readonly loadFailed: (reason: string) => string;
15
+ readonly refreshFailed: (reason: string) => string;
16
+ readonly loadMore: (limit: string) => string;
17
+ readonly endOfRecords: string;
18
+ readonly close: string;
19
+ readonly cancel: string;
20
+ readonly reload: string;
21
+ };
22
+ declare const CONSOLE_UI_LABEL_CATALOGS: Readonly<Record<ConsoleUiLocale, ConsoleUiLabels>>;
23
+ declare const resolveConsoleUiLabels: (locale: string) => ConsoleUiLabels;
24
+ type MasterDetailOptions = {
25
+ readonly masterMinPx: number;
26
+ readonly detailMinPx: number;
27
+ readonly gapPx: number;
28
+ };
29
+ type MasterDetailPlan = {
30
+ readonly sideBySide: boolean;
31
+ readonly sideBySideFromPx: number;
32
+ readonly masterInlinePx: number;
33
+ readonly detailInlinePx: number;
34
+ };
35
+ declare const masterDetailPlan: (containerPx: number, options: MasterDetailOptions) => MasterDetailPlan;
36
+ type ColumnWidth = {
37
+ readonly fixedPx: number;
38
+ readonly minPx?: never;
39
+ } | {
40
+ readonly minPx: number;
41
+ readonly fixedPx?: never;
42
+ };
43
+ type ColumnWidthSource = {
44
+ readonly width: ColumnWidth;
45
+ };
46
+ declare const tableMinInlinePx: (columns: readonly ColumnWidthSource[]) => number;
47
+ declare const textWidthEm: (text: string) => number;
48
+ declare const monoTextWidthEm: (text: string) => number;
49
+ declare const ceil8: (px: number) => number;
50
+ type TileGridStep = {
51
+ readonly columns: number;
52
+ readonly minContainerPx: number;
53
+ };
54
+ type TileGridPlan = {
55
+ readonly key: string;
56
+ readonly steps: readonly TileGridStep[];
57
+ readonly css: string;
58
+ };
59
+ declare const tileGridPlan: (count: number, minInlinePx: number, gapPx: number) => TileGridPlan;
60
+ type ResourceOutcome<T> = {
61
+ readonly ok: true;
62
+ readonly value: T;
63
+ } | {
64
+ readonly ok: false;
65
+ readonly status: number | null;
66
+ readonly reason: string;
67
+ };
68
+ type CommandOutcome<T, R> = {
69
+ readonly ok: true;
70
+ readonly value: T;
71
+ } | {
72
+ readonly ok: false;
73
+ readonly status: number | null;
74
+ readonly reason: string;
75
+ readonly rejection: R | null;
76
+ };
77
+ declare const mapOutcome: <T, U>(outcome: ResourceOutcome<T>, map: (value: T) => U) => ResourceOutcome<U>;
78
+ declare const flatMapOutcome: <T, U>(outcome: ResourceOutcome<T>, map: (value: T) => ResourceOutcome<U>) => ResourceOutcome<U>;
79
+ type ResourceFailure = {
80
+ readonly status: number | null;
81
+ readonly reason: string;
82
+ readonly occurrence: number;
83
+ readonly retrying: boolean;
84
+ };
85
+ type ResourceState<T> = {
86
+ readonly kind: "idle";
87
+ } | {
88
+ readonly kind: "loading";
89
+ } | ({
90
+ readonly kind: "failed";
91
+ } & ResourceFailure) | {
92
+ readonly kind: "ready";
93
+ readonly value: T;
94
+ readonly refreshing: boolean;
95
+ readonly refreshFailure: {
96
+ readonly status: number | null;
97
+ readonly reason: string;
98
+ } | null;
99
+ };
100
+ type ReloadCause = "reload" | "revision";
101
+ declare const beginReload: <T>(state: ResourceState<T>, cause: ReloadCause) => ResourceState<T>;
102
+ declare const keepLastGood: <T>(state: ResourceState<T>, outcome: ResourceOutcome<T>) => ResourceState<T>;
103
+ type KeysetPage<T, C, M> = {
104
+ readonly rows: readonly T[];
105
+ readonly next: C | null;
106
+ readonly meta: M;
107
+ };
108
+ type NextPage<T, C> = {
109
+ readonly rows: readonly T[];
110
+ readonly next: C | null;
111
+ readonly meta?: never;
112
+ };
113
+ type PageFailure = {
114
+ readonly reason: string;
115
+ readonly occurrence: number;
116
+ };
117
+ type PagedValue<T, C, M> = {
118
+ readonly rows: readonly T[];
119
+ readonly next: C | null;
120
+ readonly meta: M;
121
+ readonly loadingMore: boolean;
122
+ readonly moreFailure: PageFailure | null;
123
+ };
124
+ type PagedContent<T, M> = {
125
+ readonly rows: readonly T[];
126
+ readonly meta: M;
127
+ };
128
+ type PagedState<T, C, M> = ResourceState<PagedValue<T, C, M>>;
129
+ declare const beginPagedReload: <T, C, M>(state: PagedState<T, C, M>, cause: ReloadCause) => PagedState<T, C, M>;
130
+ declare const settleFirstPage: <T, C, M>(state: PagedState<T, C, M>, outcome: ResourceOutcome<KeysetPage<T, C, M>>) => PagedState<T, C, M>;
131
+ declare const beginPage: <T, C, M>(state: PagedState<T, C, M>) => PagedState<T, C, M>;
132
+ declare const settlePage: <T, C, M>(state: PagedState<T, C, M>, cursor: C, outcome: ResourceOutcome<NextPage<T, C>>) => PagedState<T, C, M>;
133
+ declare const mapPagedList: <T, C, M>(state: PagedState<T, C, M>, map: (content: PagedContent<T, M>) => PagedContent<T, M>) => PagedState<T, C, M>;
134
+ declare const TOKENS: {
135
+ readonly space: {
136
+ readonly "space-1": 4;
137
+ readonly "space-2": 8;
138
+ readonly "space-3": 12;
139
+ readonly "space-4": 16;
140
+ readonly "space-6": 24;
141
+ readonly "space-8": 32;
142
+ readonly "space-12": 48;
143
+ };
144
+ readonly type: {
145
+ readonly caption: {
146
+ readonly size: 11;
147
+ readonly lineHeight: 16;
148
+ };
149
+ readonly body: {
150
+ readonly size: 13;
151
+ readonly lineHeight: 20;
152
+ };
153
+ readonly prose: {
154
+ readonly size: 13;
155
+ readonly lineHeight: 24;
156
+ };
157
+ readonly title: {
158
+ readonly size: 16;
159
+ readonly lineHeight: 24;
160
+ };
161
+ readonly heading: {
162
+ readonly size: 20;
163
+ readonly lineHeight: 28;
164
+ };
165
+ readonly display: {
166
+ readonly size: 25;
167
+ readonly lineHeight: 32;
168
+ };
169
+ };
170
+ readonly weight: {
171
+ readonly regular: 400;
172
+ readonly medium: 500;
173
+ readonly bold: 700;
174
+ };
175
+ readonly radius: {
176
+ readonly "radius-control": 4;
177
+ readonly "radius-item": 8;
178
+ readonly "radius-container": 12;
179
+ readonly "radius-pill": 9999;
180
+ };
181
+ readonly size: {
182
+ readonly "size-control": 32;
183
+ readonly "size-row": 32;
184
+ readonly "size-row-control": 40;
185
+ readonly "size-target": 24;
186
+ };
187
+ readonly stroke: {
188
+ readonly "border-width": 1;
189
+ readonly "focus-width": 2;
190
+ readonly "focus-offset": 2;
191
+ };
192
+ readonly color: {
193
+ readonly fg: "#0f172b";
194
+ readonly "fg-secondary": "#314158";
195
+ readonly "fg-muted": "#45556c";
196
+ readonly "danger-fg": "#9f0712";
197
+ readonly "warning-fg": "#7b3306";
198
+ readonly "success-fg": "#006045";
199
+ readonly "info-fg": "#193cb8";
200
+ readonly "on-solid": "#ffffff";
201
+ readonly surface: "#ffffff";
202
+ readonly subtle: "#f8fafc";
203
+ readonly sunken: "#f1f5f9";
204
+ readonly "danger-tint": "#fef2f2";
205
+ readonly "warning-tint": "#fffbeb";
206
+ readonly "success-tint": "#ecfdf5";
207
+ readonly "info-tint": "#eff6ff";
208
+ readonly "neutral-solid": "#314158";
209
+ readonly "danger-solid": "#9f0712";
210
+ readonly "success-solid": "#006045";
211
+ readonly "info-solid": "#193cb8";
212
+ readonly "warning-solid": "#7b3306";
213
+ readonly "danger-accent": "#e7000b";
214
+ readonly "warning-accent": "#bb4d00";
215
+ readonly "success-accent": "#009966";
216
+ readonly "info-accent": "#155dfc";
217
+ readonly focus: "#155dfc";
218
+ readonly "border-control": "#62748e";
219
+ readonly "border-subtle": "#e2e8f0";
220
+ };
221
+ };
222
+ type ConsoleUiTokens = {
223
+ readonly space: Readonly<Record<SpaceToken, number>>;
224
+ readonly type: Readonly<Record<TypeToken, {
225
+ readonly size: number;
226
+ readonly lineHeight: number;
227
+ }>>;
228
+ readonly weight: Readonly<Record<WeightToken, number>>;
229
+ readonly radius: Readonly<Record<RadiusToken, number>>;
230
+ readonly size: Readonly<Record<SizeToken, number>>;
231
+ readonly stroke: Readonly<Record<StrokeToken, number>>;
232
+ readonly color: Readonly<Record<ColorToken, string>>;
233
+ };
234
+ type SpaceToken = keyof typeof TOKENS.space;
235
+ type TypeToken = keyof typeof TOKENS.type;
236
+ type WeightToken = keyof typeof TOKENS.weight;
237
+ type RadiusToken = keyof typeof TOKENS.radius;
238
+ type SizeToken = keyof typeof TOKENS.size;
239
+ type StrokeToken = keyof typeof TOKENS.stroke;
240
+ type ColorToken = keyof typeof TOKENS.color;
241
+ type FgRole = "fg" | "fg-secondary" | "fg-muted" | "danger-fg" | "warning-fg" | "success-fg" | "info-fg" | "on-solid";
242
+ type SurfaceRole = "surface" | "subtle" | "sunken" | "danger-tint" | "warning-tint" | "success-tint" | "info-tint" | "neutral-solid" | "danger-solid" | "success-solid" | "info-solid" | "warning-solid";
243
+ type AccentRole = "danger-accent" | "warning-accent" | "success-accent" | "info-accent";
244
+ type TokenName = SpaceToken | `font-size-${TypeToken}` | `line-height-${TypeToken}` | `font-weight-${WeightToken}` | RadiusToken | SizeToken | StrokeToken | ColorToken;
245
+ declare const cssVar: (name: TokenName) => string;
246
+ type Srgb = readonly [
247
+ red: number,
248
+ green: number,
249
+ blue: number
250
+ ];
251
+ declare const hexToSrgb: (hex: string) => Srgb;
252
+ declare const contrastRatio: (first: Srgb, second: Srgb) => number;
253
+ declare const CONTRAST_MINIMUM: {
254
+ readonly text: 4.5;
255
+ readonly nonText: 3;
256
+ };
257
+ type ContrastRole = FgRole | AccentRole | "focus" | "border-control";
258
+ declare const CONTRAST_PAIRS: {
259
+ readonly fg: {
260
+ readonly surface: 17.83;
261
+ readonly subtle: 17.04;
262
+ readonly sunken: 16.28;
263
+ readonly "danger-tint": 16.3;
264
+ readonly "warning-tint": 17.19;
265
+ readonly "success-tint": 16.93;
266
+ readonly "info-tint": 16.38;
267
+ };
268
+ readonly "fg-secondary": {
269
+ readonly surface: 10.36;
270
+ readonly subtle: 9.9;
271
+ readonly sunken: 9.45;
272
+ };
273
+ readonly "fg-muted": {
274
+ readonly surface: 7.58;
275
+ readonly subtle: 7.25;
276
+ readonly sunken: 6.92;
277
+ readonly "danger-tint": 6.93;
278
+ readonly "warning-tint": 7.31;
279
+ readonly "info-tint": 6.97;
280
+ };
281
+ readonly "danger-fg": {
282
+ readonly surface: 8.36;
283
+ readonly subtle: 7.99;
284
+ readonly "danger-tint": 7.64;
285
+ };
286
+ readonly "warning-fg": {
287
+ readonly surface: 9.06;
288
+ readonly subtle: 8.66;
289
+ readonly "warning-tint": 8.73;
290
+ };
291
+ readonly "success-fg": {
292
+ readonly surface: 7.61;
293
+ readonly subtle: 7.27;
294
+ readonly "success-tint": 7.23;
295
+ };
296
+ readonly "info-fg": {
297
+ readonly surface: 8.82;
298
+ readonly "info-tint": 8.11;
299
+ readonly subtle: 8.43;
300
+ };
301
+ readonly "on-solid": {
302
+ readonly "neutral-solid": 10.36;
303
+ readonly "danger-solid": 8.36;
304
+ readonly "success-solid": 7.61;
305
+ readonly "info-solid": 8.82;
306
+ readonly "warning-solid": 9.06;
307
+ };
308
+ readonly "danger-accent": {
309
+ readonly surface: 4.77;
310
+ readonly "danger-tint": 4.36;
311
+ };
312
+ readonly "warning-accent": {
313
+ readonly surface: 5.03;
314
+ readonly "warning-tint": 4.85;
315
+ };
316
+ readonly "success-accent": {
317
+ readonly surface: 3.65;
318
+ readonly "success-tint": 3.47;
319
+ };
320
+ readonly "info-accent": {
321
+ readonly surface: 5.25;
322
+ readonly subtle: 5.01;
323
+ readonly sunken: 4.79;
324
+ readonly "info-tint": 4.82;
325
+ };
326
+ readonly focus: {
327
+ readonly surface: 5.25;
328
+ readonly subtle: 5.01;
329
+ readonly sunken: 4.79;
330
+ readonly "info-tint": 4.82;
331
+ };
332
+ readonly "border-control": {
333
+ readonly surface: 4.76;
334
+ readonly subtle: 4.55;
335
+ readonly sunken: 4.35;
336
+ };
337
+ };
338
+ 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, 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, resolveConsoleUiLabels, settleFirstPage, settlePage, tableMinInlinePx, textWidthEm, tileGridPlan, toOffsetIso, toWallTime };
package/dist/core.js ADDED
@@ -0,0 +1 @@
1
+ import{A,B,a,b,c,d,e,f,g,i as h,k as i,l as j,m as k,n as l,o as m,p as n,q 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-4F6Q2VL5.js";import{a as w,b as x,c as y,d as z}from"./chunk-MYMCHY7C.js";export{f as CONSOLE_UI_LABEL_CATALOGS,y as CONTRAST_MINIMUM,z as CONTRAST_PAIRS,A as TOKENS,b as ZonedTimeError,t as beginPage,r as beginPagedReload,p as beginReload,l as ceil8,x as contrastRatio,B as cssVar,o as flatMapOutcome,a as formatCount,e as formatInstant,w as hexToSrgb,q as keepLastGood,n as mapOutcome,v as mapPagedList,h as masterDetailPlan,k as monoTextWidthEm,g as resolveConsoleUiLabels,s as settleFirstPage,u as settlePage,i as tableMinInlinePx,j as textWidthEm,m as tileGridPlan,c as toOffsetIso,d as toWallTime};