@rtkelly-labs/design-system 0.17.0 → 0.19.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/CHANGELOG.md +29 -0
- package/README.md +1 -1
- package/dist/components/DataTable.js +135 -52
- package/dist/components/DataTable.js.map +1 -1
- package/dist/components/InlineAction.js +58 -0
- package/dist/components/InlineAction.js.map +1 -0
- package/dist/components/ResourceState.js +55 -0
- package/dist/components/ResourceState.js.map +1 -0
- package/dist/components/docs/figures/ChangeSummary.js +5 -5
- package/dist/components/docs/figures/ChangeSummary.js.map +1 -1
- package/dist/components/docs/figures/DrawingSheet.js +4 -1
- package/dist/components/docs/figures/DrawingSheet.js.map +1 -1
- package/dist/components/docs/figures/FigureSurfaceContext.js +9 -0
- package/dist/components/docs/figures/FigureSurfaceContext.js.map +1 -0
- package/dist/components/docs/figures/FileChangeTree.js +4 -4
- package/dist/components/docs/figures/FileChangeTree.js.map +1 -1
- package/dist/components/docs/figures/IndexedSection.js +8 -2
- package/dist/components/docs/figures/IndexedSection.js.map +1 -1
- package/dist/components/docs/figures/index.js.map +1 -1
- package/dist/hooks/usePolledResource.js +98 -0
- package/dist/hooks/usePolledResource.js.map +1 -0
- package/dist/index.d.ts +303 -5
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/theme.js +12 -0
- package/dist/lib/theme.js.map +1 -1
- package/dist/lib/units.js +25 -0
- package/dist/lib/units.js.map +1 -0
- package/dist/theme/contrast.js +15 -0
- package/dist/theme/contrast.js.map +1 -1
- package/dist/theme/levels.js +31 -0
- package/dist/theme/levels.js.map +1 -1
- package/dist/theme.css +30 -0
- package/package.json +2 -2
- package/tokens/palette.midnight.tokens.json +50 -0
- package/tokens/palette.sketch.tokens.json +50 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import react__default, { ReactNode, DetailedHTMLProps, ButtonHTMLAttributes, AnchorHTMLAttributes, HTMLAttributes, ElementType, MouseEventHandler, InputHTMLAttributes, TextareaHTMLAttributes, TableHTMLAttributes, TdHTMLAttributes, ThHTMLAttributes, RefObject, ReactElement, SVGProps } from 'react';
|
|
2
|
+
import react__default, { ReactNode, DetailedHTMLProps, ButtonHTMLAttributes, AnchorHTMLAttributes, HTMLAttributes, ElementType, MouseEventHandler, InputHTMLAttributes, TextareaHTMLAttributes, TableHTMLAttributes, TdHTMLAttributes, ThHTMLAttributes, RefObject, ReactElement, SVGProps, RefAttributes } from 'react';
|
|
3
3
|
import { Table as Table$1, ColumnDef } from '@tanstack/react-table';
|
|
4
4
|
import { RegisterableHotkey } from '@tanstack/react-hotkeys';
|
|
5
5
|
export { ParentSize as ResponsiveChartContainer } from '@visx/responsive';
|
|
@@ -30,6 +30,14 @@ type Emphasis = 'primary' | 'secondary' | 'tertiary' | 'quiet';
|
|
|
30
30
|
* when their hues are not.
|
|
31
31
|
*/
|
|
32
32
|
type Intent = 'info' | 'success' | 'warning' | 'danger';
|
|
33
|
+
/**
|
|
34
|
+
* Change, as a comparison reports it. Use for diff signs, change counts and
|
|
35
|
+
* change bars — never for whether the change is acceptable, which is an
|
|
36
|
+
* {@link Intent}. Red text on a removed line says *removed*, not *wrong*.
|
|
37
|
+
*/
|
|
38
|
+
type Delta = 'added' | 'removed' | 'moved';
|
|
39
|
+
/** The grounds a diff paints behind its rows. `hunk` sits behind a hunk header. */
|
|
40
|
+
type DeltaGround = 'added' | 'removed' | 'hunk';
|
|
33
41
|
/**
|
|
34
42
|
* Background elevation. `base` is the page, `raised` sits above it (cards,
|
|
35
43
|
* header, drawers), `sunken` is inset (code wells), `overlay` is modal.
|
|
@@ -108,6 +116,8 @@ declare const HEADING_EMPHASIS: Record<1 | 2 | 3 | 4 | 5 | 6, Emphasis>;
|
|
|
108
116
|
declare const semanticTokens: {
|
|
109
117
|
readonly accent: Record<Emphasis, string>;
|
|
110
118
|
readonly intent: Record<Intent, string>;
|
|
119
|
+
readonly delta: Record<Delta, string>;
|
|
120
|
+
readonly deltaGround: Record<DeltaGround, string>;
|
|
111
121
|
readonly surface: Record<Surface, string>;
|
|
112
122
|
readonly text: Record<TextTone, string>;
|
|
113
123
|
readonly border: Record<BorderTone, string>;
|
|
@@ -160,7 +170,7 @@ declare const semanticTokens: {
|
|
|
160
170
|
* hold at the light end — `border-subtle` at 28% is a visible hairline on
|
|
161
171
|
* black and invisible on paper. Literals also make the ladder *checkable*:
|
|
162
172
|
* `pnpm check:contrast` can compute every text-on-surface ratio without a
|
|
163
|
-
* browser —
|
|
173
|
+
* browser — 296 pairs, 148 per Level, including every Hue against every
|
|
164
174
|
* ground, which is what makes hand-tuned literals sustainable rather than
|
|
165
175
|
* twenty times the manual review. Stated per Level deliberately: 440 was
|
|
166
176
|
* written here in the commit that collapsed four Levels to two, so the total
|
|
@@ -230,6 +240,23 @@ interface LevelDefinition {
|
|
|
230
240
|
readonly border: Readonly<Record<BorderTone, string>>;
|
|
231
241
|
readonly accent: Readonly<Record<Emphasis, string>>;
|
|
232
242
|
readonly intent: Readonly<Record<Intent, string>>;
|
|
243
|
+
/**
|
|
244
|
+
* Change, as a comparison reports it: a line or record added, removed, or
|
|
245
|
+
* moved. Separate from `intent` on purpose. An added line is not a success
|
|
246
|
+
* and a removed one is not a danger; whether a change is acceptable is a
|
|
247
|
+
* policy's call, and a renderer that paints it green or red has made that
|
|
248
|
+
* call for the reader. The two groups may share a Hue, as `added` and
|
|
249
|
+
* `intent.success` do, and still diverge where the meanings would clash:
|
|
250
|
+
* `midnight`'s `removed` is red while its `danger` is pink.
|
|
251
|
+
*/
|
|
252
|
+
readonly delta: Readonly<Record<Delta, string>>;
|
|
253
|
+
/**
|
|
254
|
+
* The grounds a diff paints behind changed rows, and behind a hunk header.
|
|
255
|
+
* Literal tints rather than `color-mix()` for the reason given in the
|
|
256
|
+
* module header. `text.primary` and the matching `delta` role must both
|
|
257
|
+
* clear the text floor on each, which `check:contrast` asserts.
|
|
258
|
+
*/
|
|
259
|
+
readonly deltaGround: Readonly<Record<DeltaGround, string>>;
|
|
233
260
|
/**
|
|
234
261
|
* The Hue vocabulary — appearance, not job. Declared *below* the Roles above
|
|
235
262
|
* and referenced by them, never derived from them. Only a Target with no
|
|
@@ -258,6 +285,8 @@ interface LevelDefinition {
|
|
|
258
285
|
readonly accentHue: Readonly<Record<Emphasis, HueRef>>;
|
|
259
286
|
/** As `accentHue`, for the meaning Roles. */
|
|
260
287
|
readonly intentHue: Readonly<Record<Intent, HueRef>>;
|
|
288
|
+
/** As `accentHue`, for the change Roles. */
|
|
289
|
+
readonly deltaHue: Readonly<Record<Delta, HueRef>>;
|
|
261
290
|
/** Colour of the hard offset shadows. Normally tracks `border.strong`. */
|
|
262
291
|
readonly shadow: string;
|
|
263
292
|
}
|
|
@@ -926,6 +955,49 @@ declare class Slugger {
|
|
|
926
955
|
*/
|
|
927
956
|
declare function childrenToText(node: unknown): string;
|
|
928
957
|
|
|
958
|
+
/**
|
|
959
|
+
* Quantities with a unit ladder: a byte count written in the largest unit that
|
|
960
|
+
* keeps it under the next one.
|
|
961
|
+
*
|
|
962
|
+
* Everything here is pure and React-free, so a server component or a script
|
|
963
|
+
* can call it.
|
|
964
|
+
*/
|
|
965
|
+
/** Options for {@link formatBytes}. */
|
|
966
|
+
interface FormatBytesOptions {
|
|
967
|
+
/**
|
|
968
|
+
* The step between units. `1024` (the default) labels them with IEC binary
|
|
969
|
+
* prefixes — `KiB`, `MiB`, `GiB`; `1000` with SI decimal prefixes — `kB`,
|
|
970
|
+
* `MB`, `GB`.
|
|
971
|
+
*/
|
|
972
|
+
base?: 1024 | 1000;
|
|
973
|
+
}
|
|
974
|
+
/**
|
|
975
|
+
* `512 B`, `1.5 KiB`, `20 MiB`, `3.2 TiB`: a byte count in the largest unit
|
|
976
|
+
* that keeps it below the next one, whole for bytes and to one decimal above
|
|
977
|
+
* them, with a trailing `.0` dropped as `formatShare` and `formatTraceDuration`
|
|
978
|
+
* do. A space separates number and unit, as the SI and IEC conventions write
|
|
979
|
+
* them.
|
|
980
|
+
*
|
|
981
|
+
* **Binary by default, and labelled as binary.** The counts this formats come
|
|
982
|
+
* from the file system, memory and process accounting, which count in powers
|
|
983
|
+
* of two — and Windows and most dashboards already divide by 1024. What they
|
|
984
|
+
* get wrong is the label: `KB` for 1024 bytes is the JEDEC usage SI reserves
|
|
985
|
+
* for 1000, so the same string means two numbers 2.4% apart at `KB` and 10%
|
|
986
|
+
* apart at `TB`. `KiB` cannot be misread. Pass `{ base: 1000 }` for sizes
|
|
987
|
+
* that are decimal by nature — network transfer, storage as a vendor states it
|
|
988
|
+
* — and the labels become `kB`, `MB`, `GB`.
|
|
989
|
+
*
|
|
990
|
+
* The unit is chosen *after* rounding, so a value that would round up to the
|
|
991
|
+
* base moves to the next unit: 1023.96 KiB is `1 MiB`, never `1024 KiB`, and
|
|
992
|
+
* 1023.6 B is `1 KiB`. Petabytes are the top of the ladder; anything larger
|
|
993
|
+
* stays in them (`2048 PiB`).
|
|
994
|
+
*
|
|
995
|
+
* A negative count — a size delta — keeps its sign (`-1.5 KiB`); `-0` is
|
|
996
|
+
* `0 B`. `NaN` and `±Infinity` are `—`, as the other formatters here write a
|
|
997
|
+
* value they cannot.
|
|
998
|
+
*/
|
|
999
|
+
declare function formatBytes(bytes: number, options?: FormatBytesOptions): string;
|
|
1000
|
+
|
|
929
1001
|
interface UseCopyToClipboardResult {
|
|
930
1002
|
/** True for `resetAfter` ms following a successful copy. */
|
|
931
1003
|
copied: boolean;
|
|
@@ -1020,6 +1092,65 @@ interface TraceReplay {
|
|
|
1020
1092
|
*/
|
|
1021
1093
|
declare function useTraceReplay(duration: number, { autoPlay, loop, speed: initialSpeed, loopDelay }?: UseTraceReplayOptions): TraceReplay;
|
|
1022
1094
|
|
|
1095
|
+
interface UsePolledResourceOptions {
|
|
1096
|
+
/**
|
|
1097
|
+
* What is being loaded — an id, a filter, a page number. A change of key
|
|
1098
|
+
* drops the previous key's data and loads afresh. The load function itself is
|
|
1099
|
+
* read through a ref, so a new closure on every render reloads nothing; the
|
|
1100
|
+
* key is what says the question changed.
|
|
1101
|
+
*/
|
|
1102
|
+
key?: string | number;
|
|
1103
|
+
/**
|
|
1104
|
+
* Milliseconds between loads, counted from when the previous one settled.
|
|
1105
|
+
* Default `30_000`. Zero or less loads once and never polls.
|
|
1106
|
+
*/
|
|
1107
|
+
intervalMs?: number;
|
|
1108
|
+
/** Load and poll while true. Default true. While false nothing loads, and `reload` does nothing. */
|
|
1109
|
+
enabled?: boolean;
|
|
1110
|
+
}
|
|
1111
|
+
interface UsePolledResourceResult<T> {
|
|
1112
|
+
/** The last good answer for the current key, kept when a later load fails. */
|
|
1113
|
+
data: T | undefined;
|
|
1114
|
+
/** Why the latest load failed, as a message; cleared by the next success. */
|
|
1115
|
+
error: string | undefined;
|
|
1116
|
+
/** True while a load for the current key is in flight. */
|
|
1117
|
+
loading: boolean;
|
|
1118
|
+
/** When `data` was last loaded, as epoch milliseconds — what `FreshnessIndicator` takes as `updatedAt`. */
|
|
1119
|
+
updatedAt: number | undefined;
|
|
1120
|
+
/** Load now, superseding any load in flight, and restart the poll from when it settles. */
|
|
1121
|
+
reload: () => void;
|
|
1122
|
+
}
|
|
1123
|
+
/**
|
|
1124
|
+
* Data that refreshes itself while someone is looking at it.
|
|
1125
|
+
*
|
|
1126
|
+
* Loads once on mount, then again `intervalMs` after each load settles — but
|
|
1127
|
+
* only while `document.visibilityState` is `visible`. A background tab costs
|
|
1128
|
+
* nothing. A tick that falls due while the tab is hidden is remembered, and the
|
|
1129
|
+
* load happens the moment the tab is shown again, so a reader returning after
|
|
1130
|
+
* ten minutes sees fresh data at once rather than ten-minute-old data for up to
|
|
1131
|
+
* another interval. A tab that is hidden and shown again *before* a tick fell
|
|
1132
|
+
* due does not load, so switching back and forth does not hammer the source.
|
|
1133
|
+
*
|
|
1134
|
+
* Counting the interval from when a load settles, not on a fixed clock, means a
|
|
1135
|
+
* load slower than the interval is never cut off by the next tick.
|
|
1136
|
+
*
|
|
1137
|
+
* ## What it guarantees
|
|
1138
|
+
*
|
|
1139
|
+
* - **The newest request wins.** Every load takes a generation number, and an
|
|
1140
|
+
* answer that arrives after a newer request was made is discarded. A slow
|
|
1141
|
+
* response for an old key can never overwrite a fast one for the new key.
|
|
1142
|
+
* - **A failure keeps the last good answer.** `data` survives a failed load and
|
|
1143
|
+
* `error` says why, so a view can show what it had with a stale warning —
|
|
1144
|
+
* which is what `ResourceState` renders.
|
|
1145
|
+
* - **A new key starts empty.** Changing `key` clears `data`, `error` and
|
|
1146
|
+
* `updatedAt` in the same render, so the previous key's answer is never
|
|
1147
|
+
* shown as though it belonged to the new one.
|
|
1148
|
+
*
|
|
1149
|
+
* Errors are normalised to a message string: the one thing a view does with a
|
|
1150
|
+
* failure is show it, and doing that once here saves every caller doing it.
|
|
1151
|
+
*/
|
|
1152
|
+
declare function usePolledResource<T>(load: () => Promise<T>, { key, intervalMs, enabled }?: UsePolledResourceOptions): UsePolledResourceResult<T>;
|
|
1153
|
+
|
|
1023
1154
|
interface ButtonOwnProps {
|
|
1024
1155
|
/**
|
|
1025
1156
|
* The label. Written in caps at the call site rather than upper-cased in
|
|
@@ -1159,6 +1290,81 @@ type ButtonProps = ButtonElementProps | ButtonLinkProps;
|
|
|
1159
1290
|
*/
|
|
1160
1291
|
declare const Button: react.ForwardRefExoticComponent<(Omit<ButtonElementProps, "ref"> | Omit<ButtonLinkProps, "ref">) & react.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
|
|
1161
1292
|
|
|
1293
|
+
interface InlineActionOwnProps {
|
|
1294
|
+
/**
|
|
1295
|
+
* The words, in the case the surrounding text is written in. Unlike
|
|
1296
|
+
* `Button`'s label this is read as part of a sentence or a cell, so it is
|
|
1297
|
+
* not written in caps — `view output`, `retry`, `all alerts →`.
|
|
1298
|
+
*/
|
|
1299
|
+
children: ReactNode;
|
|
1300
|
+
/**
|
|
1301
|
+
* How loudly it reads against the text around it. `accent` is the primary
|
|
1302
|
+
* accent ink with a solid underline — the one to reach for, and what a link
|
|
1303
|
+
* in a row of data looks like. `quiet` is secondary ink with a dotted
|
|
1304
|
+
* underline, for a housekeeping action beside the content it acts on —
|
|
1305
|
+
* `clear`, `reset`, `show all` — that should not compete with it.
|
|
1306
|
+
* Omitted, the tone is `accent`.
|
|
1307
|
+
*/
|
|
1308
|
+
tone?: InlineActionTone;
|
|
1309
|
+
/**
|
|
1310
|
+
* Merged into the recipe's own classes. Reach for it to set the typeface or
|
|
1311
|
+
* size where the surrounding text does not — `font-mono` in a table of ids —
|
|
1312
|
+
* rather than to recolour it.
|
|
1313
|
+
*/
|
|
1314
|
+
className?: string;
|
|
1315
|
+
}
|
|
1316
|
+
/** The inks an `InlineAction` may take. Named for emphasis, not for a hue. */
|
|
1317
|
+
type InlineActionTone = 'accent' | 'quiet';
|
|
1318
|
+
/**
|
|
1319
|
+
* The `<button>` form: an action on the current page. `href?: never` is what
|
|
1320
|
+
* lets the union below discriminate, exactly as it does on `Button`.
|
|
1321
|
+
*/
|
|
1322
|
+
type InlineActionButtonProps = InlineActionOwnProps & Omit<DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, 'children'> & {
|
|
1323
|
+
href?: never;
|
|
1324
|
+
};
|
|
1325
|
+
/**
|
|
1326
|
+
* The `<a>` form: the same ink on something that navigates. Rendered through
|
|
1327
|
+
* `LinkProvider`, so an app's router handles an internal href.
|
|
1328
|
+
*/
|
|
1329
|
+
type InlineActionLinkProps = InlineActionOwnProps & Omit<DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, 'children'> & {
|
|
1330
|
+
/**
|
|
1331
|
+
* Where it navigates — and the discriminant. Supplying it renders a link
|
|
1332
|
+
* through the `LinkProvider`'s component; omit it for anything that acts
|
|
1333
|
+
* on the current page.
|
|
1334
|
+
*/
|
|
1335
|
+
href: string;
|
|
1336
|
+
/**
|
|
1337
|
+
* Not offered on the anchor form. `disabled` does nothing on an `<a>`, and
|
|
1338
|
+
* a link that cannot be followed is text, not a link.
|
|
1339
|
+
*/
|
|
1340
|
+
disabled?: never;
|
|
1341
|
+
};
|
|
1342
|
+
type InlineActionProps = InlineActionButtonProps | InlineActionLinkProps;
|
|
1343
|
+
/**
|
|
1344
|
+
* An action that reads as a link: underlined text inside a sentence or a table
|
|
1345
|
+
* cell, with no box, padding or press of its own.
|
|
1346
|
+
*
|
|
1347
|
+
* `Button` is the control a screen is built around — bordered, filled, caps,
|
|
1348
|
+
* a 44px hit area. In a table row that is too much: one per row is a column of
|
|
1349
|
+
* buttons, and the row's data is lost behind them. This is the same decision
|
|
1350
|
+
* in the weight of the text around it, and like `Button` the element follows
|
|
1351
|
+
* the job rather than the look: without `href` it is a `<button type="button">`
|
|
1352
|
+
* that runs `onClick`; with `href` it is a link, through `LinkProvider`.
|
|
1353
|
+
*
|
|
1354
|
+
* It takes the surrounding font and size, so it is mono in a mono cell and
|
|
1355
|
+
* prose in a paragraph; there is no `size`. An inline target is exempt from
|
|
1356
|
+
* the WCAG 2.5.8 target-size minimum because its size is set by the line it
|
|
1357
|
+
* sits in — which is also why it belongs inline, not standing on its own as a
|
|
1358
|
+
* page's action.
|
|
1359
|
+
*
|
|
1360
|
+
* ```tsx
|
|
1361
|
+
* <InlineAction onClick={() => openRun(run.id)}>view output</InlineAction>
|
|
1362
|
+
* <InlineAction href={`/runs/${run.id}`}>open run</InlineAction>
|
|
1363
|
+
* <InlineAction tone="quiet" onClick={clear}>clear</InlineAction>
|
|
1364
|
+
* ```
|
|
1365
|
+
*/
|
|
1366
|
+
declare const InlineAction: react.ForwardRefExoticComponent<(Omit<InlineActionButtonProps, "ref"> | Omit<InlineActionLinkProps, "ref">) & react.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
|
|
1367
|
+
|
|
1162
1368
|
/**
|
|
1163
1369
|
* The two shapes a `Card` renders.
|
|
1164
1370
|
*
|
|
@@ -2646,6 +2852,37 @@ type DataTableSharedProps<T> = {
|
|
|
2646
2852
|
* dataset to assistive tech, through `aria-rowcount` and `aria-rowindex`.
|
|
2647
2853
|
*/
|
|
2648
2854
|
virtualize?: boolean | DataTableVirtualization;
|
|
2855
|
+
/**
|
|
2856
|
+
* The keys of the selected rows, as `keyExtractor` produces them (numbers
|
|
2857
|
+
* are compared as strings). Controlled: the table never changes it, it
|
|
2858
|
+
* reports the next set through `onSelectionChange`. Because selection is
|
|
2859
|
+
* keyed rather than positional it survives a sort, a page change and a
|
|
2860
|
+
* windowed scroll. Without a `keyExtractor` the key is TanStack's row id,
|
|
2861
|
+
* which is the row's index in `data` and does not follow a row when
|
|
2862
|
+
* `data` changes — pass one.
|
|
2863
|
+
*/
|
|
2864
|
+
selectedKeys?: ReadonlySet<string>;
|
|
2865
|
+
/**
|
|
2866
|
+
* Turns selection on: a leading column of checkboxes, one per row, and one
|
|
2867
|
+
* in the header. Called with the whole next selection on every toggle.
|
|
2868
|
+
* The set it reports holds only keys of rows that are still in the data
|
|
2869
|
+
* and still selectable, so a key whose row has gone, or has become
|
|
2870
|
+
* unselectable, drops out on the next change rather than lingering.
|
|
2871
|
+
*/
|
|
2872
|
+
onSelectionChange?: (keys: Set<string>) => void;
|
|
2873
|
+
/**
|
|
2874
|
+
* Whether a row may be selected. `false` disables its checkbox; a string
|
|
2875
|
+
* disables it *and* says why, as the checkbox's accessible description and
|
|
2876
|
+
* as a tooltip on hover. Every row is selectable when omitted.
|
|
2877
|
+
*/
|
|
2878
|
+
isRowSelectable?: (row: T) => boolean | string;
|
|
2879
|
+
/**
|
|
2880
|
+
* The accessible name of a row's checkbox. Defaults to "Select" followed by
|
|
2881
|
+
* the row-header column's value (`rowHeader` / `meta.rowHeader`), or by
|
|
2882
|
+
* the row's key when there is no row header — so mark a row header, or
|
|
2883
|
+
* pass this, or every checkbox is named by an id.
|
|
2884
|
+
*/
|
|
2885
|
+
selectionLabel?: (row: T) => string;
|
|
2649
2886
|
};
|
|
2650
2887
|
type DataTableProps<T> = DataTableSharedProps<T> & ({
|
|
2651
2888
|
/** Pre-configured TanStack table instance */
|
|
@@ -2667,7 +2904,7 @@ type DataTableProps<T> = DataTableSharedProps<T> & ({
|
|
|
2667
2904
|
* column, a real sort button per sortable header, an optional `caption`, and a
|
|
2668
2905
|
* true row count when the body is windowed.
|
|
2669
2906
|
*/
|
|
2670
|
-
declare function DataTable<T>({ table: providedTable, columns, data, keyExtractor, caption, appearance, density, emptyText, className, containerClassName, virtualize, ...rest }: DataTableProps<T>): react.JSX.Element;
|
|
2907
|
+
declare function DataTable<T>({ table: providedTable, columns, data, keyExtractor, caption, appearance, density, emptyText, className, containerClassName, virtualize, selectedKeys, onSelectionChange, isRowSelectable, selectionLabel, ...rest }: DataTableProps<T>): react.JSX.Element;
|
|
2671
2908
|
|
|
2672
2909
|
interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'children' | 'className'> {
|
|
2673
2910
|
isOpen: boolean;
|
|
@@ -6350,6 +6587,57 @@ declare function formatAge(ms: number): string;
|
|
|
6350
6587
|
*/
|
|
6351
6588
|
declare const FreshnessIndicator: react.ForwardRefExoticComponent<FreshnessIndicatorProps & react.RefAttributes<HTMLSpanElement>>;
|
|
6352
6589
|
|
|
6590
|
+
/** Which of the four states a `ResourceState` is showing. */
|
|
6591
|
+
type ResourceStatus = 'loading' | 'failed' | 'stale' | 'ready';
|
|
6592
|
+
/**
|
|
6593
|
+
* What `ResourceState` reads. `usePolledResource`'s result fits as it is; so
|
|
6594
|
+
* does any `{ data, error }` from another loader.
|
|
6595
|
+
*/
|
|
6596
|
+
interface ResourceStateValue<T> {
|
|
6597
|
+
/** The last good answer, or `undefined` before there is one. */
|
|
6598
|
+
data: T | undefined;
|
|
6599
|
+
/** Why the latest load failed, or `undefined` when it did not. */
|
|
6600
|
+
error: string | undefined;
|
|
6601
|
+
/** A load is in flight. Sets `aria-busy` on the region; absent reads as loading while there is no data. */
|
|
6602
|
+
loading?: boolean;
|
|
6603
|
+
}
|
|
6604
|
+
interface ResourceStateProps<T> extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
6605
|
+
/** The resource to render — `usePolledResource`'s result, or any structurally compatible `{ data, error }`. */
|
|
6606
|
+
state: ResourceStateValue<T>;
|
|
6607
|
+
/** Renders the data once there is some. Called with the data, never with `undefined`. */
|
|
6608
|
+
children: (data: T) => ReactNode;
|
|
6609
|
+
/** Shown while there is no data and no error. Default one block `Skeleton`; pass the shape of the real content to keep the page still when it lands. */
|
|
6610
|
+
loading?: ReactNode;
|
|
6611
|
+
/** The warning title when the load failed and there is nothing to show. Default `Could not load`. */
|
|
6612
|
+
errorTitle?: string;
|
|
6613
|
+
/** The warning title above data kept from an earlier load after a later one failed. Default `Showing the last good data`. */
|
|
6614
|
+
staleTitle?: string;
|
|
6615
|
+
}
|
|
6616
|
+
/** `forwardRef` erases a generic; this restores it, so `children` is typed by `state`. */
|
|
6617
|
+
type ResourceStateComponent = (<T>(props: ResourceStateProps<T> & RefAttributes<HTMLDivElement>) => ReactElement | null) & {
|
|
6618
|
+
displayName?: string;
|
|
6619
|
+
};
|
|
6620
|
+
/**
|
|
6621
|
+
* The loading, failed and stale states around a view of loaded data, so every
|
|
6622
|
+
* panel says them the same way.
|
|
6623
|
+
*
|
|
6624
|
+
* - **Loading** — no data yet and no error: the `loading` slot, a `Skeleton`
|
|
6625
|
+
* unless overridden.
|
|
6626
|
+
* - **Failed** — no data and an error: a `NoteBlock` warning, in the danger
|
|
6627
|
+
* role, carrying the error message under `errorTitle`.
|
|
6628
|
+
* - **Stale** — data from an earlier load, and a later load failed: a
|
|
6629
|
+
* `NoteBlock` in the warning role, under `staleTitle`, then the data. The data
|
|
6630
|
+
* stays because an older answer is more use than none, and the note stays
|
|
6631
|
+
* because an older answer shown as current is a lie.
|
|
6632
|
+
* - **Ready** — data and no error: `children(data)`.
|
|
6633
|
+
*
|
|
6634
|
+
* The region carries `aria-busy` while a load is in flight and `data-state`
|
|
6635
|
+
* naming the state. Pair it with `usePolledResource`, and put a
|
|
6636
|
+
* `FreshnessIndicator` fed its `updatedAt` near the view, to say how old the
|
|
6637
|
+
* data on screen is as well as whether it is.
|
|
6638
|
+
*/
|
|
6639
|
+
declare const ResourceState: ResourceStateComponent;
|
|
6640
|
+
|
|
6353
6641
|
/** The visible part of an id: its first `count` characters and `…`, or all of it. */
|
|
6354
6642
|
declare function truncateId(value: string, count?: number): string;
|
|
6355
6643
|
|
|
@@ -7366,7 +7654,10 @@ interface ChangeSummaryProps extends react.HTMLAttributes<HTMLDivElement> {
|
|
|
7366
7654
|
footer?: DiffRow;
|
|
7367
7655
|
/** Markdown list or `<Line>` content used to derive rows. */
|
|
7368
7656
|
children?: ReactNode;
|
|
7369
|
-
/**
|
|
7657
|
+
/**
|
|
7658
|
+
* Accepted for symmetry with the other figures and ignored: additions and removals take the
|
|
7659
|
+
* `delta` roles, so a summary reads the same in a `multi` figure as in a `mono` one.
|
|
7660
|
+
*/
|
|
7370
7661
|
palette?: FigurePalette$1;
|
|
7371
7662
|
/** Additional classes for this summary. */
|
|
7372
7663
|
className?: string;
|
|
@@ -7560,6 +7851,11 @@ interface IndexedSectionProps extends Omit<react.HTMLAttributes<HTMLElement>, 't
|
|
|
7560
7851
|
headingLevel?: 2 | 3 | 4;
|
|
7561
7852
|
/** Controls drawn at the right of the header, such as a comment button. */
|
|
7562
7853
|
actions?: ReactNode;
|
|
7854
|
+
/**
|
|
7855
|
+
* Surface elevation rung for the section background.
|
|
7856
|
+
* If omitted, defaults to `'raised'` when nested in a `DrawingSheet`, or `'base'` standalone.
|
|
7857
|
+
*/
|
|
7858
|
+
surface?: 'base' | 'raised' | 'transparent';
|
|
7563
7859
|
/** Section content. */
|
|
7564
7860
|
children?: ReactNode;
|
|
7565
7861
|
/** Additional classes for the root. */
|
|
@@ -7571,6 +7867,8 @@ interface IndexedSectionProps extends Omit<react.HTMLAttributes<HTMLElement>, 't
|
|
|
7571
7867
|
*/
|
|
7572
7868
|
declare const IndexedSection: react.ForwardRefExoticComponent<IndexedSectionProps & react.RefAttributes<HTMLElement>>;
|
|
7573
7869
|
|
|
7870
|
+
type FigureSurface = 'base' | 'sheet';
|
|
7871
|
+
|
|
7574
7872
|
/**
|
|
7575
7873
|
* Adapted from mdxcn by Keshav Bagaade, MIT licensed.
|
|
7576
7874
|
* Source: https://github.com/keshav-exe/mdxcn/blob/2928126ba146ebbae9c2351deca27d27bb40e744/registry/default/graph-activity/graph-activity.tsx
|
|
@@ -7952,4 +8250,4 @@ declare const mdxComponents: {
|
|
|
7952
8250
|
};
|
|
7953
8251
|
type MdxComponents = typeof mdxComponents;
|
|
7954
8252
|
|
|
7955
|
-
export { ALERT_STATE_ORDER, ANSI_SLOTS, type AccentToken, type ActivityDay, ActivityGrid, type ActivityGridProps, type Alert, AlertDialog, type AlertDialogProps, AlertList, type AlertListProps, type AlertSeverity, type AlertState, AnchorHeading, type AnchorHeadingProps, type AnsiChrome, type AnsiHue, type AnsiScheme, type AnsiSlot, AppMain, type AppMainProps, type AppNavItem, AppShell, type AppShellProps, AppSidebar, AppSidebarNav, type AppSidebarNavProps, type AppSidebarProps, AppTopbar, type AppTopbarProps, AsciiDivider, type AsciiDividerProps, AsciiGauge, type AsciiGaugeProps, type AsciiGaugeVariant, Avatar, type AvatarProps, Badge, type BadgeProps, BarChart, type BarChartDatum, type BarChartProps, BeforeAfter, type BeforeAfterProps, type BlogAuthor, BlogPost, type BlogPostProps, BlueskyIcon, type BorderTone, BracketText, type BracketTextProps, Breadcrumbs, type BreadcrumbsProps, type BrutalistTheme, type BuildTraceOptions, BulletChart, type BulletChartProps, Button, type ButtonElementProps, type ButtonLinkProps, type ButtonProps, type ButtonVariant, CSS_MEDIUM, CTASection, type CTASectionAccent, type CTASectionProps, Card, type CardProps, type CardVariant, ChangeSummary, type ChangeSummaryProps, ChartTooltip, type ChartTooltipProps, Checkbox, type CheckboxProps, type ClassInput, CodeBlock, CodeBlockAttachment, type CodeBlockProps, CodeTab, type CodeTabProps, CodeTabs, type CodeTabsProps, type CodeTabsVariant, ColophonCard, type ColophonCardProps, type ColophonLink, type Column, type ContrastCheck, type ContrastFloor, type Crumb, DEFAULT_DEPLOY_LOG, DEFAULT_EXPERIMENTS, DEFAULT_LEVEL, DEFAULT_PRICING_TIERS, DIVIDER_PATTERNS, DataTable, type DataTableProps, type DataTableVirtualization, Decision, type DecisionOption, type DecisionProps, DesignSandbox, type DiffLineProps, type DiffRow, type DiffSign, Divider, type DividerProps, type DividerVariant, DocPager, type DocPagerProps, type DocPagerTarget, DocsHeader, type DocsHeaderProps, DocsLayout, type DocsLayoutProps, DocsLink, type DocsLinkProps, DocsLinkProvider, type DocsLinkProviderProps, type DocsNavItem, type DocsNavNode, DocsSidebar, type DocsSidebarProps, Drawer, type DrawerPlacement, type DrawerProps, DrawingSheet, type DrawingSheetProps, type Emphasis, EmptyState, type EmptyStateProps, ErrorSummary, type ErrorSummaryError, type ErrorSummaryProps, Event, type ExperimentItem, ExperimentsView, type ExperimentsViewProps, FILTER_OPERATORS, FILTER_OPERATOR_LABELS, FIXED_COLOURS, FREE_TEXT_KEY, Feature, FeatureGrid, type FeatureGridProps, type FeatureProps, Fieldset, type FieldsetProps, FigureFrame, type FigureFrameProps, type FileChange, type FileChangeNode, FileChangeTree, type FileChangeTreeProps, type FileChangeView, type Filter, FilterBar, type FilterBarField, type FilterBarProps, type FilterOperator, type FilterParseResult, type Finding, type FixedColour, FlowDiagram, type FlowDiagramProps, type FlowNode, type FlowPathProps, type FlowRow, type FlowTone, FreshnessIndicator, type FreshnessIndicatorProps, type FreshnessState, GanttChart, type GanttChartProps, type GanttItem, GitHubIcon, Glyph, type GlyphProps, HEADING_EMPHASIS, type HeadingLevel, Hero, type HeroProps, type Hue, type HueAgreementCheck, type HueRef, INK_WEIGHT, IdChip, type IdChipProps, type IncidentEvent, type IncidentEventKind, type IncidentSummary, IncidentTimeline, type IncidentTimelineProps, IndexedSection, type IndexedSectionProps, Input, type InputProps, type IntensityScale, type Intent, LATENCY_HEATMAP_VARIANTS, LATENCY_HISTOGRAM_VARIANTS, LEVELS, LOG_SEVERITIES, type LatencyBucket, type LatencyCell, type LatencyGrid, LatencyHeatmap, type LatencyHeatmapProps, LatencyHistogram, type LatencyHistogramProps, type LatencyPoint, type LatencySlo, Legend, type LegendProps, type LevelDefinition, Line, type LinkComponentProps, LinkProvider, type LinkProviderProps, LinkedInIcon, type LogEntry, type LogFieldValue, type LogFilter, type LogHighlightPart, type LogSeverity, LogViewer, type LogViewerProps, LoremIpsumPost, MAXIMUM_NEUTRAL_CHROMA, MEDIA, MEDIA_DEFINITIONS, MINIMUM_RATIO, MailIcon, type MdxComponents, type Medium, type MediumDefinition, Menu, MenuItem, type MenuItemProps, type MenuProps, MenuRadioGroup, type MenuRadioGroupProps, MenuRadioItem, type MenuRadioItemProps, MenuSeparator, type MenuSeparatorProps, MetadataGrid, type MetadataGridCustomItem, type MetadataGridProps, type MetadataGridSeries, type Metric, MetricStrip, type MetricStripProps, type MetricTone, MobileNav, type MobileNavProps, Modal, type ModalProps, type Motion, NERD_GLYPHS, NerdIcon, type NerdIconAccent, type NerdIconName, type NerdIconProps, Node, type NodeProps, NotFoundPage, type NotFoundPageProps, NoteBlock, type NoteBlockProps, OBSERVABILITY_INCIDENT_WINDOW, ObservabilityConsole, type ObservabilityConsoleProps, Option, type OverlayAlign, type OverlaySide, PALETTE_HUES, PageHeader, type PageHeaderProps, PageTitle, type PageTitleProps, Pagination, type PaginationProps, Path, type Polarity, Popover, type PopoverProps, PricingGrid, type PricingGridProps, PricingTier, type PricingTierAccent, type PricingTierProps, Progress, type ProgressProps, Prose, type ProseProps, RECOMMENDED_COLOURS, RECOMMENDED_COLOUR_CLASSES, RECOMMENDED_COLOUR_NAMESPACES, RECOMMENDED_COLOUR_PROPERTIES, RECOMMENDED_COLOUR_ROLES, RECOMMENDED_COLOUR_VARS, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type RecommendedColourClass, type RecommendedColourNamespace, type RecommendedColourProperty, type RecommendedThemeColours, ReportDetails, type ReportDetailsProps, ReportDocument, type ReportDocumentProps, type ReportMetaItem, ReportSection, type ReportSectionProps, type Rgb, SEVERITY_ACCENTS, SLIDE_DECK_HOTKEYS, SLOTS, SYSTEM_LEVEL, SaasLandingPage, type SaasLandingPageProps, type SectionAlign, type SectionColumns, SectionContainer, type SectionContainerProps, Select, type SelectOption, type SelectProps, type SelectionDevice, type SelectionDeviceCheck, ServerErrorPage, type ServerErrorPageProps, type ServiceEdge, type ServiceGraph, type ServiceGraphLayout, type ServiceGraphLayoutEdge, type ServiceGraphLayoutNode, type ServiceGraphLayoutOptions, type ServiceGraphPoint, ServiceMap, type ServiceMapProps, type ServiceNode, type ServiceNodeKind, type Severity, SeverityBadge, type SeverityBadgeProps, SiteFooter, type SiteFooterProps, SiteHeader, type SiteHeaderCollapse, type SiteHeaderProps, SiteLink, type SiteLinkProps, SiteNav, type SiteNavGroupItemProps, SiteNavItem, type SiteNavItemProps, type SiteNavLinkItemProps, type SiteNavOrientation, type SiteNavProps, Skeleton, type SkeletonProps, Slide, SlideDeck, type SlideDeckHotkey, type SlideDeckProps, type SlideProps, Slope, type SlopeItem, Slugger, SocialIcon, type SocialIconName, type SocialIconProps, Sparkline, type SparklineProps, Spinner, type SpinnerProps, StatCard, type StatCardAccent, type StatCardProps, StatusPage, type StatusPageProps, Step, type StepProps, type StepState, Steps, type StepsProps, type Surface, Swatch, type SwatchColumn, SwatchCompare, type SwatchCompareProps, SwatchGroup, type SwatchGroupProps, type SwatchProps, type SwatchRow, Switch, type SwitchProps, THEME_ATTRIBUTE, THEME_LEVELS, THEME_STORAGE_KEY, TIME_RANGE_PRESETS, TIME_SERIES_VARIANTS, TLDR, type TLDRProps, TOKEN_RULES, Table, type TableAppearance, TableBody, TableCaption, TableCell, type TableDensity, TableFooter, TableHead, TableHeader, TableOfContents, type TableOfContentsProps, TableRow, Tabs, type TabsFont, TabsList, type TabsListProps, type TabsOrientation, TabsPanel, type TabsPanelProps, type TabsProps, TabsTab, type TabsTabProps, type TabsVariant, Tag, type TagProps, TelemetryGauge, type TelemetryGaugeProps, type TelemetryMachineState, Term, TermGrid, type TermGridProps, type TermItem, Terminal, type TerminalProps, TextArea, type TextAreaProps, type TextHierarchyStep, type TextTone, type ThemeContextValue, type ThemeLevel, ThemeProvider, type ThemeProviderProps, TickerTape, type TickerTapeProps, type TimeCursorState, type TimeRange, TimeRangePicker, type TimeRangePickerProps, type TimeRangePreset, TimeRangeProvider, type TimeRangeProviderProps, type TimeRangeState, type TimeSeries, type TimeSeriesAnnotation, TimeSeriesChart, type TimeSeriesChartProps, type TimeSeriesColorStrategy, type TimeSeriesCurve, type TimeSeriesDensity, type TimeSeriesGrid, type TimeSeriesLegend, type TimeSeriesPoint, type TimeSeriesPointMarkers, type TimeSeriesThreshold, type TimeSeriesVariant, type TimeSeriesYDomain, type TimeSeriesYScale, Timeline, type TimelineEvent, type TimelineProps, type TimelineState, type ToastActionOptions, type ToastApi, type ToastIntent, type ToastOptions, ToastProvider, type ToastProviderProps, type TocEntry, type TokenRow, type TokenRule, TokenTable, type TokenTableProps, Tooltip, type TooltipProps, type TraceAttributeValue, type TraceModel, type TraceReplay, type TraceSpan, type TraceSpanInput, type TraceSpanStatus, TraceViewer, type TraceViewerProps, TraceWaterfall, type TraceWaterfallProps, TrackCard, type TrackCardProps, type TrackItem, type TrackItemStatus, TreeDiagram, type TreeDiagramProps, type TreeNode, type TypeStep, type TypeStepName, type UptimeStatus, UptimeStrip, type UptimeStripProps, type UseActiveHeadingOptions, type UseCopyToClipboardResult, type UseTraceClockOptions, type UseTraceReplayOptions, type VerdictTone, WEB_FLOOR, XIcon, accentVar, ansiScheme, apcaContrast, assertNever, auditContrast, auditHueAgreement, auditSelectionDevices, auditTextHierarchy, borderVar, bucketIndex, bucketPercentile, bucketTimes, buildTrace, childrenToText, clampToRange, cn, collectHeadings, composite, contrastRatio, createAnchorHeading, describeFilter, describeLogEntry, describeTraceSpan, filterLogEntries, fontVar, formatAge, formatAlertDuration, formatClock, formatCount, formatDay, formatFilter, formatLatencyRange, formatRange, formatRangeDuration, formatRequests, formatServiceCount, formatServiceErrorRate, formatShare, formatTimeTick, formatTimestamp, formatTraceDuration, getRecommendedColours, getThemeInitScript, heatmapCells, highlightLogText, histogram, inLogRange, intensityLevel, intensityThresholds, isExternalHref, isMedium, isRecommendedColourClass, isThemeLevel, latencyBuckets, latencyExtent, latencyRowPosition, layoutServiceGraph, linearBuckets, logTicks, lookupField, matchFilters, matchLogEntry, matchTraceSpan, mdxComponents, nearestLogIndex, nextLevel, normaliseRange, parseColor, parseFilter, parseOtlpTrace, parseTraceDocument, percentile, percentiles, presetRange, relativeLuminance, replayTrace, sameFilter, scanRules, scanTokenRules, semanticTokens, serviceEdgeMidpoint, serviceEdgePath, serviceGraph, severityAccent, shareAbove, slugify, sortAlerts, sortLogEntries, summariseIncident, surfaceVar, textVar, timeTicks, truncateId, tryParseFilter, useActiveHeading, useCopyToClipboard, useDocsLinkComponent, useIsCurrentHref, useLinkComponent, useOptionalTheme, useOptionalToast, useTheme, useTimeCursor, useTimeRange, useToast, useTraceClock, useTraceReplay, visibleTraceSpans };
|
|
8253
|
+
export { ALERT_STATE_ORDER, ANSI_SLOTS, type AccentToken, type ActivityDay, ActivityGrid, type ActivityGridProps, type Alert, AlertDialog, type AlertDialogProps, AlertList, type AlertListProps, type AlertSeverity, type AlertState, AnchorHeading, type AnchorHeadingProps, type AnsiChrome, type AnsiHue, type AnsiScheme, type AnsiSlot, AppMain, type AppMainProps, type AppNavItem, AppShell, type AppShellProps, AppSidebar, AppSidebarNav, type AppSidebarNavProps, type AppSidebarProps, AppTopbar, type AppTopbarProps, AsciiDivider, type AsciiDividerProps, AsciiGauge, type AsciiGaugeProps, type AsciiGaugeVariant, Avatar, type AvatarProps, Badge, type BadgeProps, BarChart, type BarChartDatum, type BarChartProps, BeforeAfter, type BeforeAfterProps, type BlogAuthor, BlogPost, type BlogPostProps, BlueskyIcon, type BorderTone, BracketText, type BracketTextProps, Breadcrumbs, type BreadcrumbsProps, type BrutalistTheme, type BuildTraceOptions, BulletChart, type BulletChartProps, Button, type ButtonElementProps, type ButtonLinkProps, type ButtonProps, type ButtonVariant, CSS_MEDIUM, CTASection, type CTASectionAccent, type CTASectionProps, Card, type CardProps, type CardVariant, ChangeSummary, type ChangeSummaryProps, ChartTooltip, type ChartTooltipProps, Checkbox, type CheckboxProps, type ClassInput, CodeBlock, CodeBlockAttachment, type CodeBlockProps, CodeTab, type CodeTabProps, CodeTabs, type CodeTabsProps, type CodeTabsVariant, ColophonCard, type ColophonCardProps, type ColophonLink, type Column, type ContrastCheck, type ContrastFloor, type Crumb, DEFAULT_DEPLOY_LOG, DEFAULT_EXPERIMENTS, DEFAULT_LEVEL, DEFAULT_PRICING_TIERS, DIVIDER_PATTERNS, DataTable, type DataTableProps, type DataTableVirtualization, Decision, type DecisionOption, type DecisionProps, type Delta, type DeltaGround, DesignSandbox, type DiffLineProps, type DiffRow, type DiffSign, Divider, type DividerProps, type DividerVariant, DocPager, type DocPagerProps, type DocPagerTarget, DocsHeader, type DocsHeaderProps, DocsLayout, type DocsLayoutProps, DocsLink, type DocsLinkProps, DocsLinkProvider, type DocsLinkProviderProps, type DocsNavItem, type DocsNavNode, DocsSidebar, type DocsSidebarProps, Drawer, type DrawerPlacement, type DrawerProps, DrawingSheet, type DrawingSheetProps, type Emphasis, EmptyState, type EmptyStateProps, ErrorSummary, type ErrorSummaryError, type ErrorSummaryProps, Event, type ExperimentItem, ExperimentsView, type ExperimentsViewProps, FILTER_OPERATORS, FILTER_OPERATOR_LABELS, FIXED_COLOURS, FREE_TEXT_KEY, Feature, FeatureGrid, type FeatureGridProps, type FeatureProps, Fieldset, type FieldsetProps, FigureFrame, type FigureFrameProps, type FigureSurface, type FileChange, type FileChangeNode, FileChangeTree, type FileChangeTreeProps, type FileChangeView, type Filter, FilterBar, type FilterBarField, type FilterBarProps, type FilterOperator, type FilterParseResult, type Finding, type FixedColour, FlowDiagram, type FlowDiagramProps, type FlowNode, type FlowPathProps, type FlowRow, type FlowTone, type FormatBytesOptions, FreshnessIndicator, type FreshnessIndicatorProps, type FreshnessState, GanttChart, type GanttChartProps, type GanttItem, GitHubIcon, Glyph, type GlyphProps, HEADING_EMPHASIS, type HeadingLevel, Hero, type HeroProps, type Hue, type HueAgreementCheck, type HueRef, INK_WEIGHT, IdChip, type IdChipProps, type IncidentEvent, type IncidentEventKind, type IncidentSummary, IncidentTimeline, type IncidentTimelineProps, IndexedSection, type IndexedSectionProps, InlineAction, type InlineActionButtonProps, type InlineActionLinkProps, type InlineActionProps, type InlineActionTone, Input, type InputProps, type IntensityScale, type Intent, LATENCY_HEATMAP_VARIANTS, LATENCY_HISTOGRAM_VARIANTS, LEVELS, LOG_SEVERITIES, type LatencyBucket, type LatencyCell, type LatencyGrid, LatencyHeatmap, type LatencyHeatmapProps, LatencyHistogram, type LatencyHistogramProps, type LatencyPoint, type LatencySlo, Legend, type LegendProps, type LevelDefinition, Line, type LinkComponentProps, LinkProvider, type LinkProviderProps, LinkedInIcon, type LogEntry, type LogFieldValue, type LogFilter, type LogHighlightPart, type LogSeverity, LogViewer, type LogViewerProps, LoremIpsumPost, MAXIMUM_NEUTRAL_CHROMA, MEDIA, MEDIA_DEFINITIONS, MINIMUM_RATIO, MailIcon, type MdxComponents, type Medium, type MediumDefinition, Menu, MenuItem, type MenuItemProps, type MenuProps, MenuRadioGroup, type MenuRadioGroupProps, MenuRadioItem, type MenuRadioItemProps, MenuSeparator, type MenuSeparatorProps, MetadataGrid, type MetadataGridCustomItem, type MetadataGridProps, type MetadataGridSeries, type Metric, MetricStrip, type MetricStripProps, type MetricTone, MobileNav, type MobileNavProps, Modal, type ModalProps, type Motion, NERD_GLYPHS, NerdIcon, type NerdIconAccent, type NerdIconName, type NerdIconProps, Node, type NodeProps, NotFoundPage, type NotFoundPageProps, NoteBlock, type NoteBlockProps, OBSERVABILITY_INCIDENT_WINDOW, ObservabilityConsole, type ObservabilityConsoleProps, Option, type OverlayAlign, type OverlaySide, PALETTE_HUES, PageHeader, type PageHeaderProps, PageTitle, type PageTitleProps, Pagination, type PaginationProps, Path, type Polarity, Popover, type PopoverProps, PricingGrid, type PricingGridProps, PricingTier, type PricingTierAccent, type PricingTierProps, Progress, type ProgressProps, Prose, type ProseProps, RECOMMENDED_COLOURS, RECOMMENDED_COLOUR_CLASSES, RECOMMENDED_COLOUR_NAMESPACES, RECOMMENDED_COLOUR_PROPERTIES, RECOMMENDED_COLOUR_ROLES, RECOMMENDED_COLOUR_VARS, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type RecommendedColourClass, type RecommendedColourNamespace, type RecommendedColourProperty, type RecommendedThemeColours, ReportDetails, type ReportDetailsProps, ReportDocument, type ReportDocumentProps, type ReportMetaItem, ReportSection, type ReportSectionProps, ResourceState, type ResourceStateProps, type ResourceStateValue, type ResourceStatus, type Rgb, SEVERITY_ACCENTS, SLIDE_DECK_HOTKEYS, SLOTS, SYSTEM_LEVEL, SaasLandingPage, type SaasLandingPageProps, type SectionAlign, type SectionColumns, SectionContainer, type SectionContainerProps, Select, type SelectOption, type SelectProps, type SelectionDevice, type SelectionDeviceCheck, ServerErrorPage, type ServerErrorPageProps, type ServiceEdge, type ServiceGraph, type ServiceGraphLayout, type ServiceGraphLayoutEdge, type ServiceGraphLayoutNode, type ServiceGraphLayoutOptions, type ServiceGraphPoint, ServiceMap, type ServiceMapProps, type ServiceNode, type ServiceNodeKind, type Severity, SeverityBadge, type SeverityBadgeProps, SiteFooter, type SiteFooterProps, SiteHeader, type SiteHeaderCollapse, type SiteHeaderProps, SiteLink, type SiteLinkProps, SiteNav, type SiteNavGroupItemProps, SiteNavItem, type SiteNavItemProps, type SiteNavLinkItemProps, type SiteNavOrientation, type SiteNavProps, Skeleton, type SkeletonProps, Slide, SlideDeck, type SlideDeckHotkey, type SlideDeckProps, type SlideProps, Slope, type SlopeItem, Slugger, SocialIcon, type SocialIconName, type SocialIconProps, Sparkline, type SparklineProps, Spinner, type SpinnerProps, StatCard, type StatCardAccent, type StatCardProps, StatusPage, type StatusPageProps, Step, type StepProps, type StepState, Steps, type StepsProps, type Surface, Swatch, type SwatchColumn, SwatchCompare, type SwatchCompareProps, SwatchGroup, type SwatchGroupProps, type SwatchProps, type SwatchRow, Switch, type SwitchProps, THEME_ATTRIBUTE, THEME_LEVELS, THEME_STORAGE_KEY, TIME_RANGE_PRESETS, TIME_SERIES_VARIANTS, TLDR, type TLDRProps, TOKEN_RULES, Table, type TableAppearance, TableBody, TableCaption, TableCell, type TableDensity, TableFooter, TableHead, TableHeader, TableOfContents, type TableOfContentsProps, TableRow, Tabs, type TabsFont, TabsList, type TabsListProps, type TabsOrientation, TabsPanel, type TabsPanelProps, type TabsProps, TabsTab, type TabsTabProps, type TabsVariant, Tag, type TagProps, TelemetryGauge, type TelemetryGaugeProps, type TelemetryMachineState, Term, TermGrid, type TermGridProps, type TermItem, Terminal, type TerminalProps, TextArea, type TextAreaProps, type TextHierarchyStep, type TextTone, type ThemeContextValue, type ThemeLevel, ThemeProvider, type ThemeProviderProps, TickerTape, type TickerTapeProps, type TimeCursorState, type TimeRange, TimeRangePicker, type TimeRangePickerProps, type TimeRangePreset, TimeRangeProvider, type TimeRangeProviderProps, type TimeRangeState, type TimeSeries, type TimeSeriesAnnotation, TimeSeriesChart, type TimeSeriesChartProps, type TimeSeriesColorStrategy, type TimeSeriesCurve, type TimeSeriesDensity, type TimeSeriesGrid, type TimeSeriesLegend, type TimeSeriesPoint, type TimeSeriesPointMarkers, type TimeSeriesThreshold, type TimeSeriesVariant, type TimeSeriesYDomain, type TimeSeriesYScale, Timeline, type TimelineEvent, type TimelineProps, type TimelineState, type ToastActionOptions, type ToastApi, type ToastIntent, type ToastOptions, ToastProvider, type ToastProviderProps, type TocEntry, type TokenRow, type TokenRule, TokenTable, type TokenTableProps, Tooltip, type TooltipProps, type TraceAttributeValue, type TraceModel, type TraceReplay, type TraceSpan, type TraceSpanInput, type TraceSpanStatus, TraceViewer, type TraceViewerProps, TraceWaterfall, type TraceWaterfallProps, TrackCard, type TrackCardProps, type TrackItem, type TrackItemStatus, TreeDiagram, type TreeDiagramProps, type TreeNode, type TypeStep, type TypeStepName, type UptimeStatus, UptimeStrip, type UptimeStripProps, type UseActiveHeadingOptions, type UseCopyToClipboardResult, type UsePolledResourceOptions, type UsePolledResourceResult, type UseTraceClockOptions, type UseTraceReplayOptions, type VerdictTone, WEB_FLOOR, XIcon, accentVar, ansiScheme, apcaContrast, assertNever, auditContrast, auditHueAgreement, auditSelectionDevices, auditTextHierarchy, borderVar, bucketIndex, bucketPercentile, bucketTimes, buildTrace, childrenToText, clampToRange, cn, collectHeadings, composite, contrastRatio, createAnchorHeading, describeFilter, describeLogEntry, describeTraceSpan, filterLogEntries, fontVar, formatAge, formatAlertDuration, formatBytes, formatClock, formatCount, formatDay, formatFilter, formatLatencyRange, formatRange, formatRangeDuration, formatRequests, formatServiceCount, formatServiceErrorRate, formatShare, formatTimeTick, formatTimestamp, formatTraceDuration, getRecommendedColours, getThemeInitScript, heatmapCells, highlightLogText, histogram, inLogRange, intensityLevel, intensityThresholds, isExternalHref, isMedium, isRecommendedColourClass, isThemeLevel, latencyBuckets, latencyExtent, latencyRowPosition, layoutServiceGraph, linearBuckets, logTicks, lookupField, matchFilters, matchLogEntry, matchTraceSpan, mdxComponents, nearestLogIndex, nextLevel, normaliseRange, parseColor, parseFilter, parseOtlpTrace, parseTraceDocument, percentile, percentiles, presetRange, relativeLuminance, replayTrace, sameFilter, scanRules, scanTokenRules, semanticTokens, serviceEdgeMidpoint, serviceEdgePath, serviceGraph, severityAccent, shareAbove, slugify, sortAlerts, sortLogEntries, summariseIncident, surfaceVar, textVar, timeTicks, truncateId, tryParseFilter, useActiveHeading, useCopyToClipboard, useDocsLinkComponent, useIsCurrentHref, useLinkComponent, useOptionalTheme, useOptionalToast, usePolledResource, useTheme, useTimeCursor, useTimeRange, useToast, useTraceClock, useTraceReplay, visibleTraceSpans };
|
package/dist/index.js
CHANGED
|
@@ -13,11 +13,14 @@ export { HEADING_EMPHASIS, accentVar, borderVar, fontVar, semanticTokens, surfac
|
|
|
13
13
|
export { RECOMMENDED_COLOURS, RECOMMENDED_COLOUR_CLASSES, RECOMMENDED_COLOUR_NAMESPACES, RECOMMENDED_COLOUR_PROPERTIES, RECOMMENDED_COLOUR_ROLES, RECOMMENDED_COLOUR_VARS, getRecommendedColours, isRecommendedColourClass } from "./theme/recommended.js";
|
|
14
14
|
import { cn } from "./lib/recipe.js";
|
|
15
15
|
export { Slugger, childrenToText, slugify } from "./lib/slug.js";
|
|
16
|
+
export { formatBytes } from "./lib/units.js";
|
|
16
17
|
export { useCopyToClipboard } from "./hooks/useCopyToClipboard.js";
|
|
17
18
|
export { useActiveHeading } from "./hooks/useActiveHeading.js";
|
|
18
19
|
export { useTraceClock } from "./hooks/useTraceClock.js";
|
|
19
20
|
export { useTraceReplay } from "./hooks/useTraceReplay.js";
|
|
21
|
+
export { usePolledResource } from "./hooks/usePolledResource.js";
|
|
20
22
|
export { Button } from "./components/Button.js";
|
|
23
|
+
export { InlineAction } from "./components/InlineAction.js";
|
|
21
24
|
export { Card } from "./components/Card.js";
|
|
22
25
|
export { Badge } from "./components/Badge.js";
|
|
23
26
|
export { ReportDetails, ReportDocument, ReportSection } from "./components/ReportDocument.js";
|
|
@@ -105,6 +108,7 @@ export { ServiceMap } from "./components/ServiceMap.js";
|
|
|
105
108
|
export { ALERT_STATE_ORDER, AlertList, formatAlertDuration, sortAlerts } from "./components/AlertList.js";
|
|
106
109
|
export { IncidentTimeline, summariseIncident } from "./components/IncidentTimeline.js";
|
|
107
110
|
export { FreshnessIndicator, formatAge } from "./components/FreshnessIndicator.js";
|
|
111
|
+
export { ResourceState } from "./components/ResourceState.js";
|
|
108
112
|
export { truncateId } from "./lib/ids.js";
|
|
109
113
|
export { IdChip } from "./components/IdChip.js";
|
|
110
114
|
export { Slide } from "./components/slides/Slide.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// @rtkelly-labs/design-system main entrypoint\n\nexport * from './tokens';\n\n// The theme ladder — the single source for level names, level colours, and the\n// contrast arithmetic that gates them.\nexport * from './theme/levels';\nexport {\n MEDIA,\n CSS_MEDIUM,\n MEDIA_DEFINITIONS,\n isMedium,\n} from './theme/media';\nexport type {\n Medium,\n MediumDefinition,\n TypeStep,\n TypeStepName,\n Motion,\n} from './theme/media';\nexport * from './theme/contrast';\nexport { ANSI_SLOTS, SLOTS, ansiScheme } from './theme/ansi';\nexport type { AnsiSlot, AnsiScheme, AnsiChrome } from './theme/ansi';\n\n// Semantic theming — prefer these over the raw palette in `tokens`.\nexport * from './lib/theme';\nexport * from './theme/recommended';\n// Only `cn` is public. `recipe`'s type comes from the library that implements\n// it, so exporting it would put that library back into the published .d.ts and\n// make replacing it a breaking change. Components import it directly.\nexport { cn } from './lib/recipe';\nexport type { ClassInput } from './lib/recipe';\nexport * from './lib/slug';\n\n// Hooks\nexport * from './hooks/useCopyToClipboard';\nexport * from './hooks/useActiveHeading';\nexport * from './hooks/useTraceClock';\nexport * from './hooks/useTraceReplay';\n\n// Primitives & Callouts\nexport * from './components/Button';\nexport * from './components/Card';\nexport * from './components/Badge';\n// The report frame — the page a generated report is built in. Separate from\n// the docs components because a report is written by a tool and read once,\n// where a docs page is written by a person and read often: the frame owns the\n// measure, the header strip and the print behaviour, and everything inside it\n// is ordinary composition.\nexport * from './components/ReportDocument';\n\n// The colour-instead-of-role rules, and the scanner over them. Published\n// because a tool generating markup against this system should be able to hold\n// itself to the same rule the system holds itself to — the report generator\n// lints at budget zero with exactly these.\nexport { TOKEN_RULES, scanRules, scanTokenRules } from './lib/tokenRules';\nexport type { Finding, TokenRule } from './lib/tokenRules';\nexport * from './components/Avatar';\nexport * from './components/PageTitle';\nexport * from './components/PageHeader';\nexport * from './components/Tag';\nexport * from './components/Pagination';\n// The tablist. There is exactly one in this tree: `CodeTabs` renders through\n// it rather than hand-rolling a second keyboard model — see #240, and #163 for\n// why it is first-party rather than a wrapper over Base UI.\nexport * from './components/Tabs';\nexport * from './components/SectionContainer';\nexport * from './components/Divider';\nexport * from './components/AsciiDivider';\nexport * from './components/ThemeProvider';\n// Server-safe: a root layout calls `getThemeInitScript`, and that layout is a\n// server component under the Next App Router. See the module's header.\nexport * from './components/themeInitScript';\nexport * from './components/BracketText';\nexport * from './components/NoteBlock';\nexport * from './components/TLDR';\n// Named rather than `export *`: `Input.tsx` also exports the field recipe\n// `Select` draws its trigger with, and a recipe's type is `tailwind-variants`'.\nexport { Input, TextArea } from './components/Input';\nexport type { InputProps, TextAreaProps } from './components/Input';\n// One of a fixed set (#164): the same field as `Input`, with a listbox this\n// system paints instead of the operating system's, and `native` for the\n// platform picker when that is the better phone experience.\nexport * from './components/Select';\n// The booleans, added together: one capability in two presentations,\n// composing the same Field as the text controls above.\nexport * from './components/Checkbox';\nexport * from './components/Switch';\n// The groups (#239): `Fieldset` and `Legend` are the set's label, description\n// and error on the same Field contract, and `RadioGroup` / `Radio` are the\n// choose-one control built on that frame rather than beside it.\nexport * from './components/Fieldset';\nexport * from './components/RadioGroup';\n// The form-level half of validation (issue 50): the field errors above,\n// gathered at the top of the form as links that move focus to each field.\nexport * from './components/ErrorSummary';\nexport * from './components/Swatch';\nexport * from './components/StatCard';\nexport * from './components/Table';\nexport * from './components/DataTable';\nexport * from './components/Modal';\nexport * from './components/AlertDialog';\nexport * from './components/Drawer';\n\n// The application layout (#247): sidebar, topbar and main as five composable\n// pieces, with the sidebar off-canvas in a `Drawer` below desktop width.\nexport * from './components/AppShell';\n\n// System feedback — the three states an application has besides \"loaded\".\n// One vocabulary on purpose: the same motion tokens, the same reduced-motion\n// rule, the same muted surface, so a loading card and an empty table read as\n// the same system rather than as two consumers' guesses.\nexport * from './components/Spinner';\nexport * from './components/Skeleton';\nexport * from './components/Progress';\nexport * from './components/EmptyState';\n// The page-level states (#251) — 404, 500, maintenance, offline, unauthorized\n// — as `EmptyState` in a page frame, not a component family of their own.\nexport * from './components/StatusPage';\n\n// The floating set (#166): anchored to a trigger, positioned by the same\n// engine, dismissed by the same stack as the dialogs above. `Tooltip` labels,\n// `Popover` shows content, `Menu` offers actions.\nexport * from './components/Tooltip';\nexport * from './components/Popover';\nexport * from './components/Menu';\n\n// Site chrome (issue 246): the banner, the navigation in its two widths, and\n// the footer — layouts and landmarks that hold no items of their own. The\n// link adapter is the package's one, shared with the docs chrome: a router's\n// `Link` and its current-route test are injected once and reach both.\nexport {\n LinkProvider,\n SiteLink,\n isExternalHref,\n useIsCurrentHref,\n useLinkComponent,\n} from './components/LinkProvider';\nexport type {\n LinkComponentProps,\n LinkProviderProps,\n SiteLinkProps,\n} from './components/LinkProvider';\nexport * from './components/SiteHeader';\nexport * from './components/SiteNav';\nexport * from './components/MobileNav';\nexport * from './components/SiteFooter';\n\n// Marketing sections (issue 248): the parts a landing page is composed from.\n// Layouts that hold no copy — `SaasLandingPage` below is one composition of\n// them, and the `SaaS/LandingPage` stories build two more.\nexport * from './components/marketing/Hero';\nexport * from './components/marketing/FeatureGrid';\nexport * from './components/marketing/PricingGrid';\nexport * from './components/marketing/CTASection';\n\n// Transient notifications. Not an overlay: a toast shares neither the\n// positioning nor the dismissal model of Tooltip/Popover/Menu — it is a queue,\n// a live region and a lifetime (#243).\nexport * from './components/Toast';\n\nexport * from './components/NerdIcon';\nexport * from './components/SocialIcon';\nexport * from './components/Glyph';\n\n// Terminal & Monospace Telemetry Primitives\nexport * from './components/AsciiGauge';\nexport * from './components/TelemetryGauge';\nexport * from './components/TickerTape';\n\n// Chart Primitives & Trend Visualizers\nexport * from './components/BarChart';\nexport * from './components/Sparkline';\nexport * from './components/ChartTooltip';\nexport * from './components/BulletChart';\n// Traces: one React-free model (`lib/trace`) — layout, critical path, OTLP\n// parsing — drawn by the waterfall and the viewer around it.\nexport * from './lib/trace';\nexport * from './components/TraceWaterfall';\nexport * from './components/TraceViewer';\n// Observability (#407): one time window and hover cursor that every view on a\n// page shares, and the views that follow it. Each works standalone too.\nexport * from './lib/timeRange';\nexport * from './components/TimeRange';\nexport * from './lib/severity';\nexport * from './components/SeverityBadge';\nexport * from './components/TimeSeriesChart';\nexport * from './lib/latency';\nexport * from './components/LatencyHistogram';\nexport * from './components/LatencyHeatmap';\nexport * from './lib/logs';\nexport * from './components/LogViewer';\nexport * from './lib/filters';\nexport * from './components/FilterBar';\nexport * from './lib/serviceGraph';\nexport * from './components/ServiceMap';\nexport * from './components/AlertList';\nexport * from './components/IncidentTimeline';\nexport * from './components/FreshnessIndicator';\nexport * from './lib/ids';\nexport * from './components/IdChip';\n\n// Slides & Presentation Deck Engine\nexport * from './components/slides/Slide';\nexport * from './components/slides/SlideDeck';\n\n// Blog & Editorial Post Foundations\nexport * from './components/blog/BlogPost';\nexport * from './components/blog/LoremIpsumPost';\nexport * from './components/MetadataGrid';\nexport * from './components/TrackCard';\nexport * from './components/ColophonCard';\n\n// Experiments Page & Design System Sandbox\nexport * from './components/experiments/ExperimentsView';\nexport * from './components/experiments/DesignSandbox';\n\n// SaaS Landing Pages\nexport * from './components/saas/SaasLandingPage';\nexport * from './components/saas/ObservabilityConsole';\n\n// Documentation Portal Chrome & MDX Rendering\nexport * from './components/docs';\n"],"mappings":";AAEA,cAAc;AAId,cAAc;AACd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQP,cAAc;AACd,SAAS,YAAY,OAAO,kBAAkB;AAI9C,cAAc;AACd,cAAc;AAId,SAAS,UAAU;AAEnB,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AAMd,cAAc;AAMd,SAAS,aAAa,WAAW,sBAAsB;AAEvD,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAId,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,SAAS,OAAO,gBAAgB;AAKhC,cAAc;AAGd,cAAc;AACd,cAAc;AAId,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAId,cAAc;AAMd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AAKd,cAAc;AACd,cAAc;AACd,cAAc;AAMd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAMP,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAKd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAKd,cAAc;AAEd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AAGd,cAAc;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// @rtkelly-labs/design-system main entrypoint\n\nexport * from './tokens';\n\n// The theme ladder — the single source for level names, level colours, and the\n// contrast arithmetic that gates them.\nexport * from './theme/levels';\nexport {\n MEDIA,\n CSS_MEDIUM,\n MEDIA_DEFINITIONS,\n isMedium,\n} from './theme/media';\nexport type {\n Medium,\n MediumDefinition,\n TypeStep,\n TypeStepName,\n Motion,\n} from './theme/media';\nexport * from './theme/contrast';\nexport { ANSI_SLOTS, SLOTS, ansiScheme } from './theme/ansi';\nexport type { AnsiSlot, AnsiScheme, AnsiChrome } from './theme/ansi';\n\n// Semantic theming — prefer these over the raw palette in `tokens`.\nexport * from './lib/theme';\nexport * from './theme/recommended';\n// Only `cn` is public. `recipe`'s type comes from the library that implements\n// it, so exporting it would put that library back into the published .d.ts and\n// make replacing it a breaking change. Components import it directly.\nexport { cn } from './lib/recipe';\nexport type { ClassInput } from './lib/recipe';\nexport * from './lib/slug';\nexport * from './lib/units';\n\n// Hooks\nexport * from './hooks/useCopyToClipboard';\nexport * from './hooks/useActiveHeading';\nexport * from './hooks/useTraceClock';\nexport * from './hooks/useTraceReplay';\nexport * from './hooks/usePolledResource';\n\n// Primitives & Callouts\nexport * from './components/Button';\nexport * from './components/InlineAction';\nexport * from './components/Card';\nexport * from './components/Badge';\n// The report frame — the page a generated report is built in. Separate from\n// the docs components because a report is written by a tool and read once,\n// where a docs page is written by a person and read often: the frame owns the\n// measure, the header strip and the print behaviour, and everything inside it\n// is ordinary composition.\nexport * from './components/ReportDocument';\n\n// The colour-instead-of-role rules, and the scanner over them. Published\n// because a tool generating markup against this system should be able to hold\n// itself to the same rule the system holds itself to — the report generator\n// lints at budget zero with exactly these.\nexport { TOKEN_RULES, scanRules, scanTokenRules } from './lib/tokenRules';\nexport type { Finding, TokenRule } from './lib/tokenRules';\nexport * from './components/Avatar';\nexport * from './components/PageTitle';\nexport * from './components/PageHeader';\nexport * from './components/Tag';\nexport * from './components/Pagination';\n// The tablist. There is exactly one in this tree: `CodeTabs` renders through\n// it rather than hand-rolling a second keyboard model — see #240, and #163 for\n// why it is first-party rather than a wrapper over Base UI.\nexport * from './components/Tabs';\nexport * from './components/SectionContainer';\nexport * from './components/Divider';\nexport * from './components/AsciiDivider';\nexport * from './components/ThemeProvider';\n// Server-safe: a root layout calls `getThemeInitScript`, and that layout is a\n// server component under the Next App Router. See the module's header.\nexport * from './components/themeInitScript';\nexport * from './components/BracketText';\nexport * from './components/NoteBlock';\nexport * from './components/TLDR';\n// Named rather than `export *`: `Input.tsx` also exports the field recipe\n// `Select` draws its trigger with, and a recipe's type is `tailwind-variants`'.\nexport { Input, TextArea } from './components/Input';\nexport type { InputProps, TextAreaProps } from './components/Input';\n// One of a fixed set (#164): the same field as `Input`, with a listbox this\n// system paints instead of the operating system's, and `native` for the\n// platform picker when that is the better phone experience.\nexport * from './components/Select';\n// The booleans, added together: one capability in two presentations,\n// composing the same Field as the text controls above.\nexport * from './components/Checkbox';\nexport * from './components/Switch';\n// The groups (#239): `Fieldset` and `Legend` are the set's label, description\n// and error on the same Field contract, and `RadioGroup` / `Radio` are the\n// choose-one control built on that frame rather than beside it.\nexport * from './components/Fieldset';\nexport * from './components/RadioGroup';\n// The form-level half of validation (issue 50): the field errors above,\n// gathered at the top of the form as links that move focus to each field.\nexport * from './components/ErrorSummary';\nexport * from './components/Swatch';\nexport * from './components/StatCard';\nexport * from './components/Table';\nexport * from './components/DataTable';\nexport * from './components/Modal';\nexport * from './components/AlertDialog';\nexport * from './components/Drawer';\n\n// The application layout (#247): sidebar, topbar and main as five composable\n// pieces, with the sidebar off-canvas in a `Drawer` below desktop width.\nexport * from './components/AppShell';\n\n// System feedback — the three states an application has besides \"loaded\".\n// One vocabulary on purpose: the same motion tokens, the same reduced-motion\n// rule, the same muted surface, so a loading card and an empty table read as\n// the same system rather than as two consumers' guesses.\nexport * from './components/Spinner';\nexport * from './components/Skeleton';\nexport * from './components/Progress';\nexport * from './components/EmptyState';\n// The page-level states (#251) — 404, 500, maintenance, offline, unauthorized\n// — as `EmptyState` in a page frame, not a component family of their own.\nexport * from './components/StatusPage';\n\n// The floating set (#166): anchored to a trigger, positioned by the same\n// engine, dismissed by the same stack as the dialogs above. `Tooltip` labels,\n// `Popover` shows content, `Menu` offers actions.\nexport * from './components/Tooltip';\nexport * from './components/Popover';\nexport * from './components/Menu';\n\n// Site chrome (issue 246): the banner, the navigation in its two widths, and\n// the footer — layouts and landmarks that hold no items of their own. The\n// link adapter is the package's one, shared with the docs chrome: a router's\n// `Link` and its current-route test are injected once and reach both.\nexport {\n LinkProvider,\n SiteLink,\n isExternalHref,\n useIsCurrentHref,\n useLinkComponent,\n} from './components/LinkProvider';\nexport type {\n LinkComponentProps,\n LinkProviderProps,\n SiteLinkProps,\n} from './components/LinkProvider';\nexport * from './components/SiteHeader';\nexport * from './components/SiteNav';\nexport * from './components/MobileNav';\nexport * from './components/SiteFooter';\n\n// Marketing sections (issue 248): the parts a landing page is composed from.\n// Layouts that hold no copy — `SaasLandingPage` below is one composition of\n// them, and the `SaaS/LandingPage` stories build two more.\nexport * from './components/marketing/Hero';\nexport * from './components/marketing/FeatureGrid';\nexport * from './components/marketing/PricingGrid';\nexport * from './components/marketing/CTASection';\n\n// Transient notifications. Not an overlay: a toast shares neither the\n// positioning nor the dismissal model of Tooltip/Popover/Menu — it is a queue,\n// a live region and a lifetime (#243).\nexport * from './components/Toast';\n\nexport * from './components/NerdIcon';\nexport * from './components/SocialIcon';\nexport * from './components/Glyph';\n\n// Terminal & Monospace Telemetry Primitives\nexport * from './components/AsciiGauge';\nexport * from './components/TelemetryGauge';\nexport * from './components/TickerTape';\n\n// Chart Primitives & Trend Visualizers\nexport * from './components/BarChart';\nexport * from './components/Sparkline';\nexport * from './components/ChartTooltip';\nexport * from './components/BulletChart';\n// Traces: one React-free model (`lib/trace`) — layout, critical path, OTLP\n// parsing — drawn by the waterfall and the viewer around it.\nexport * from './lib/trace';\nexport * from './components/TraceWaterfall';\nexport * from './components/TraceViewer';\n// Observability (#407): one time window and hover cursor that every view on a\n// page shares, and the views that follow it. Each works standalone too.\nexport * from './lib/timeRange';\nexport * from './components/TimeRange';\nexport * from './lib/severity';\nexport * from './components/SeverityBadge';\nexport * from './components/TimeSeriesChart';\nexport * from './lib/latency';\nexport * from './components/LatencyHistogram';\nexport * from './components/LatencyHeatmap';\nexport * from './lib/logs';\nexport * from './components/LogViewer';\nexport * from './lib/filters';\nexport * from './components/FilterBar';\nexport * from './lib/serviceGraph';\nexport * from './components/ServiceMap';\nexport * from './components/AlertList';\nexport * from './components/IncidentTimeline';\nexport * from './components/FreshnessIndicator';\nexport * from './components/ResourceState';\nexport * from './lib/ids';\nexport * from './components/IdChip';\n\n// Slides & Presentation Deck Engine\nexport * from './components/slides/Slide';\nexport * from './components/slides/SlideDeck';\n\n// Blog & Editorial Post Foundations\nexport * from './components/blog/BlogPost';\nexport * from './components/blog/LoremIpsumPost';\nexport * from './components/MetadataGrid';\nexport * from './components/TrackCard';\nexport * from './components/ColophonCard';\n\n// Experiments Page & Design System Sandbox\nexport * from './components/experiments/ExperimentsView';\nexport * from './components/experiments/DesignSandbox';\n\n// SaaS Landing Pages\nexport * from './components/saas/SaasLandingPage';\nexport * from './components/saas/ObservabilityConsole';\n\n// Documentation Portal Chrome & MDX Rendering\nexport * from './components/docs';\n"],"mappings":";AAEA,cAAc;AAId,cAAc;AACd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQP,cAAc;AACd,SAAS,YAAY,OAAO,kBAAkB;AAI9C,cAAc;AACd,cAAc;AAId,SAAS,UAAU;AAEnB,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAMd,cAAc;AAMd,SAAS,aAAa,WAAW,sBAAsB;AAEvD,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAId,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,SAAS,OAAO,gBAAgB;AAKhC,cAAc;AAGd,cAAc;AACd,cAAc;AAId,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAId,cAAc;AAMd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AAKd,cAAc;AACd,cAAc;AACd,cAAc;AAMd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAMP,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAKd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAKd,cAAc;AAEd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AAGd,cAAc;","names":[]}
|
package/dist/lib/theme.js
CHANGED
|
@@ -11,6 +11,16 @@ var INTENT_VARS = {
|
|
|
11
11
|
warning: "var(--ds-intent-warning)",
|
|
12
12
|
danger: "var(--ds-intent-danger)"
|
|
13
13
|
};
|
|
14
|
+
var DELTA_VARS = {
|
|
15
|
+
added: "var(--ds-delta-added)",
|
|
16
|
+
removed: "var(--ds-delta-removed)",
|
|
17
|
+
moved: "var(--ds-delta-moved)"
|
|
18
|
+
};
|
|
19
|
+
var DELTA_GROUND_VARS = {
|
|
20
|
+
added: "var(--ds-delta-ground-added)",
|
|
21
|
+
removed: "var(--ds-delta-ground-removed)",
|
|
22
|
+
hunk: "var(--ds-delta-ground-hunk)"
|
|
23
|
+
};
|
|
14
24
|
var SURFACE_VARS = {
|
|
15
25
|
base: "var(--ds-surface-base)",
|
|
16
26
|
raised: "var(--ds-surface-raised)",
|
|
@@ -58,6 +68,8 @@ var HEADING_EMPHASIS = {
|
|
|
58
68
|
var semanticTokens = {
|
|
59
69
|
accent: EMPHASIS_VARS,
|
|
60
70
|
intent: INTENT_VARS,
|
|
71
|
+
delta: DELTA_VARS,
|
|
72
|
+
deltaGround: DELTA_GROUND_VARS,
|
|
61
73
|
surface: SURFACE_VARS,
|
|
62
74
|
text: TEXT_VARS,
|
|
63
75
|
border: BORDER_VARS,
|
package/dist/lib/theme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/theme.ts"],"sourcesContent":["/**\n * Semantic theming layer.\n *\n * Components should describe *what a thing is* — a primary accent, a danger\n * state, a raised surface — never which colour it happens to be. The brutalist\n * palette (cyan/pink/yellow/green) is one mapping of those roles; `.dim` and\n * `.sketch` are others, and a future mode is a third. Referencing\n * `var(--brutalist-cyan)` directly hard-codes today's mapping into every\n * component and makes retheming a find-and-replace across the package.\n *\n * The CSS variables below are declared in `theme.css` and resolve through the\n * raw palette, so they follow every mode swap automatically.\n */\n\n/**\n * Visual weight within a hierarchy. Use for decorative and navigational\n * emphasis — which of several things should draw the eye first — not for\n * meaning. `quiet` is the de-emphasised step, not a fifth colour.\n */\nexport type Emphasis = 'primary' | 'secondary' | 'tertiary' | 'quiet';\n\n/**\n * Communicated meaning. Use when the colour carries information the reader\n * must act on; these survive retheming because their semantics are fixed even\n * when their hues are not.\n */\nexport type Intent = 'info' | 'success' | 'warning' | 'danger';\n\n/**\n * Background elevation. `base` is the page, `raised` sits above it (cards,\n * header, drawers), `sunken` is inset (code wells), `overlay` is modal.\n */\nexport type Surface = 'base' | 'raised' | 'sunken' | 'overlay';\n\n/** Text prominence, coarsest to faintest. */\nexport type TextTone = 'primary' | 'secondary' | 'muted' | 'inverse';\n\n/** Rule weight. `strong` is the full-contrast brutalist border. */\nexport type BorderTone = 'strong' | 'default' | 'subtle';\n\n/**\n * Palette names accepted by components predating the semantic layer.\n *\n * @deprecated Pass an {@link Emphasis} or {@link Intent} instead. These remain\n * accepted so existing consumers keep compiling, and they resolve to the same\n * values, but they defeat the point of the abstraction.\n */\n/**\n * A colour's *appearance*, independent of any job — the vocabulary a Target\n * addresses when it has no notion of jobs. A terminal has sixteen positions\n * named by colour and no concept of a keyword.\n *\n * Declared below the Role vocabulary and referenced by it, never the reverse:\n * Hue -> Role is a declared lookup, Role -> Hue is a guess. See\n * `docs/adr/0001-hues-declared-below-roles.md`.\n *\n * **A Hue in component code is a defect.** Components address Roles only.\n * Ten is the ceiling rather than a comfortable middle — the tightest pair\n * already sits at deltaE 0.049. See `docs/palette-provenance.md`.\n */\nexport type Hue =\n | 'red'\n | 'orange'\n | 'yellow'\n | 'green'\n | 'teal'\n | 'cyan'\n | 'blue'\n | 'violet'\n | 'magenta'\n | 'pink';\n\n/**\n * The eight ANSI base slots a terminal needs, beyond which `bright` variants\n * fill the upper eight. `black` and `white` come from `FIXED_COLOURS`.\n */\nexport type AnsiHue = Extract<Hue, 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan'>;\n\n/**\n * What a Role points at in the Hue vocabulary.\n *\n * `'neutral'` is not a cop-out: some Roles genuinely are not hues.\n * `accent.quiet` is a warm or cool grey by design, and the palette has no\n * neutral ramp to point it at. Saying so explicitly keeps the map exhaustive —\n * a new Emphasis is still a compile error — while letting the gate distinguish\n * \"declared as not-a-hue\" from \"forgot to wire it up\", which a `Partial` could\n * not.\n */\nexport type HueRef = Hue | 'neutral';\n\n\n/** Anything a component's `accent`-style prop will take. */\nexport type AccentToken = Emphasis | Intent;\n\nconst EMPHASIS_VARS: Record<Emphasis, string> = {\n primary: 'var(--ds-accent-primary)',\n secondary: 'var(--ds-accent-secondary)',\n tertiary: 'var(--ds-accent-tertiary)',\n quiet: 'var(--ds-accent-quiet)',\n};\n\nconst INTENT_VARS: Record<Intent, string> = {\n info: 'var(--ds-intent-info)',\n success: 'var(--ds-intent-success)',\n warning: 'var(--ds-intent-warning)',\n danger: 'var(--ds-intent-danger)',\n};\n\nconst SURFACE_VARS: Record<Surface, string> = {\n base: 'var(--ds-surface-base)',\n raised: 'var(--ds-surface-raised)',\n sunken: 'var(--ds-surface-sunken)',\n overlay: 'var(--ds-surface-overlay)',\n};\n\nconst TEXT_VARS: Record<TextTone, string> = {\n primary: 'var(--ds-text-primary)',\n secondary: 'var(--ds-text-secondary)',\n muted: 'var(--ds-text-muted)',\n inverse: 'var(--ds-text-inverse)',\n};\n\nconst BORDER_VARS: Record<BorderTone, string> = {\n strong: 'var(--ds-border-strong)',\n default: 'var(--ds-border-default)',\n subtle: 'var(--ds-border-subtle)',\n};\n\n/**\n * Resolve any accent token to the CSS variable expression that renders it.\n *\n * Unknown values fall back to the primary accent rather than throwing —\n * a mistyped prop should degrade to something legible, not blank out a\n * component's colour and leave `color: undefined` on the element.\n */\nexport function accentVar(token: AccentToken | undefined, fallback: AccentToken = 'primary'): string {\n const resolved = token ?? fallback;\n return (\n EMPHASIS_VARS[resolved as Emphasis] ??\n INTENT_VARS[resolved as Intent] ??\n EMPHASIS_VARS.primary\n );\n}\n\nexport function surfaceVar(token: Surface = 'base'): string {\n return SURFACE_VARS[token] ?? SURFACE_VARS.base;\n}\n\nexport function textVar(token: TextTone = 'primary'): string {\n return TEXT_VARS[token] ?? TEXT_VARS.primary;\n}\n\nexport function borderVar(token: BorderTone = 'strong'): string {\n return BORDER_VARS[token] ?? BORDER_VARS.strong;\n}\n\n/** Semantic font roles. */\nexport const fontVar = {\n display: 'var(--ds-font-display)',\n body: 'var(--ds-font-body)',\n mono: 'var(--ds-font-mono)',\n pixel: 'var(--ds-font-pixel)',\n} as const;\n\n/**\n * Default emphasis per heading level, so a document's colour hierarchy follows\n * its structural hierarchy without every call site restating it.\n */\nexport const HEADING_EMPHASIS: Record<1 | 2 | 3 | 4 | 5 | 6, Emphasis> = {\n 1: 'primary',\n 2: 'primary',\n 3: 'secondary',\n 4: 'tertiary',\n 5: 'quiet',\n 6: 'quiet',\n};\n\n/**\n * The full semantic token surface, as CSS variable expressions. Useful for\n * inline styles and for consumers building their own components on the system.\n */\nexport const semanticTokens = {\n accent: EMPHASIS_VARS,\n intent: INTENT_VARS,\n surface: SURFACE_VARS,\n text: TEXT_VARS,\n border: BORDER_VARS,\n font: fontVar,\n shadowColor: 'var(--ds-shadow-color)',\n} as const;\n"],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../../src/lib/theme.ts"],"sourcesContent":["/**\n * Semantic theming layer.\n *\n * Components should describe *what a thing is* — a primary accent, a danger\n * state, a raised surface — never which colour it happens to be. The brutalist\n * palette (cyan/pink/yellow/green) is one mapping of those roles; `.dim` and\n * `.sketch` are others, and a future mode is a third. Referencing\n * `var(--brutalist-cyan)` directly hard-codes today's mapping into every\n * component and makes retheming a find-and-replace across the package.\n *\n * The CSS variables below are declared in `theme.css` and resolve through the\n * raw palette, so they follow every mode swap automatically.\n */\n\n/**\n * Visual weight within a hierarchy. Use for decorative and navigational\n * emphasis — which of several things should draw the eye first — not for\n * meaning. `quiet` is the de-emphasised step, not a fifth colour.\n */\nexport type Emphasis = 'primary' | 'secondary' | 'tertiary' | 'quiet';\n\n/**\n * Communicated meaning. Use when the colour carries information the reader\n * must act on; these survive retheming because their semantics are fixed even\n * when their hues are not.\n */\nexport type Intent = 'info' | 'success' | 'warning' | 'danger';\n\n/**\n * Change, as a comparison reports it. Use for diff signs, change counts and\n * change bars — never for whether the change is acceptable, which is an\n * {@link Intent}. Red text on a removed line says *removed*, not *wrong*.\n */\nexport type Delta = 'added' | 'removed' | 'moved';\n\n/** The grounds a diff paints behind its rows. `hunk` sits behind a hunk header. */\nexport type DeltaGround = 'added' | 'removed' | 'hunk';\n\n/**\n * Background elevation. `base` is the page, `raised` sits above it (cards,\n * header, drawers), `sunken` is inset (code wells), `overlay` is modal.\n */\nexport type Surface = 'base' | 'raised' | 'sunken' | 'overlay';\n\n/** Text prominence, coarsest to faintest. */\nexport type TextTone = 'primary' | 'secondary' | 'muted' | 'inverse';\n\n/** Rule weight. `strong` is the full-contrast brutalist border. */\nexport type BorderTone = 'strong' | 'default' | 'subtle';\n\n/**\n * Palette names accepted by components predating the semantic layer.\n *\n * @deprecated Pass an {@link Emphasis} or {@link Intent} instead. These remain\n * accepted so existing consumers keep compiling, and they resolve to the same\n * values, but they defeat the point of the abstraction.\n */\n/**\n * A colour's *appearance*, independent of any job — the vocabulary a Target\n * addresses when it has no notion of jobs. A terminal has sixteen positions\n * named by colour and no concept of a keyword.\n *\n * Declared below the Role vocabulary and referenced by it, never the reverse:\n * Hue -> Role is a declared lookup, Role -> Hue is a guess. See\n * `docs/adr/0001-hues-declared-below-roles.md`.\n *\n * **A Hue in component code is a defect.** Components address Roles only.\n * Ten is the ceiling rather than a comfortable middle — the tightest pair\n * already sits at deltaE 0.049. See `docs/palette-provenance.md`.\n */\nexport type Hue =\n | 'red'\n | 'orange'\n | 'yellow'\n | 'green'\n | 'teal'\n | 'cyan'\n | 'blue'\n | 'violet'\n | 'magenta'\n | 'pink';\n\n/**\n * The eight ANSI base slots a terminal needs, beyond which `bright` variants\n * fill the upper eight. `black` and `white` come from `FIXED_COLOURS`.\n */\nexport type AnsiHue = Extract<Hue, 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan'>;\n\n/**\n * What a Role points at in the Hue vocabulary.\n *\n * `'neutral'` is not a cop-out: some Roles genuinely are not hues.\n * `accent.quiet` is a warm or cool grey by design, and the palette has no\n * neutral ramp to point it at. Saying so explicitly keeps the map exhaustive —\n * a new Emphasis is still a compile error — while letting the gate distinguish\n * \"declared as not-a-hue\" from \"forgot to wire it up\", which a `Partial` could\n * not.\n */\nexport type HueRef = Hue | 'neutral';\n\n\n/** Anything a component's `accent`-style prop will take. */\nexport type AccentToken = Emphasis | Intent;\n\nconst EMPHASIS_VARS: Record<Emphasis, string> = {\n primary: 'var(--ds-accent-primary)',\n secondary: 'var(--ds-accent-secondary)',\n tertiary: 'var(--ds-accent-tertiary)',\n quiet: 'var(--ds-accent-quiet)',\n};\n\nconst INTENT_VARS: Record<Intent, string> = {\n info: 'var(--ds-intent-info)',\n success: 'var(--ds-intent-success)',\n warning: 'var(--ds-intent-warning)',\n danger: 'var(--ds-intent-danger)',\n};\n\nconst DELTA_VARS: Record<Delta, string> = {\n added: 'var(--ds-delta-added)',\n removed: 'var(--ds-delta-removed)',\n moved: 'var(--ds-delta-moved)',\n};\n\nconst DELTA_GROUND_VARS: Record<DeltaGround, string> = {\n added: 'var(--ds-delta-ground-added)',\n removed: 'var(--ds-delta-ground-removed)',\n hunk: 'var(--ds-delta-ground-hunk)',\n};\n\nconst SURFACE_VARS: Record<Surface, string> = {\n base: 'var(--ds-surface-base)',\n raised: 'var(--ds-surface-raised)',\n sunken: 'var(--ds-surface-sunken)',\n overlay: 'var(--ds-surface-overlay)',\n};\n\nconst TEXT_VARS: Record<TextTone, string> = {\n primary: 'var(--ds-text-primary)',\n secondary: 'var(--ds-text-secondary)',\n muted: 'var(--ds-text-muted)',\n inverse: 'var(--ds-text-inverse)',\n};\n\nconst BORDER_VARS: Record<BorderTone, string> = {\n strong: 'var(--ds-border-strong)',\n default: 'var(--ds-border-default)',\n subtle: 'var(--ds-border-subtle)',\n};\n\n/**\n * Resolve any accent token to the CSS variable expression that renders it.\n *\n * Unknown values fall back to the primary accent rather than throwing —\n * a mistyped prop should degrade to something legible, not blank out a\n * component's colour and leave `color: undefined` on the element.\n */\nexport function accentVar(token: AccentToken | undefined, fallback: AccentToken = 'primary'): string {\n const resolved = token ?? fallback;\n return (\n EMPHASIS_VARS[resolved as Emphasis] ??\n INTENT_VARS[resolved as Intent] ??\n EMPHASIS_VARS.primary\n );\n}\n\nexport function surfaceVar(token: Surface = 'base'): string {\n return SURFACE_VARS[token] ?? SURFACE_VARS.base;\n}\n\nexport function textVar(token: TextTone = 'primary'): string {\n return TEXT_VARS[token] ?? TEXT_VARS.primary;\n}\n\nexport function borderVar(token: BorderTone = 'strong'): string {\n return BORDER_VARS[token] ?? BORDER_VARS.strong;\n}\n\n/** Semantic font roles. */\nexport const fontVar = {\n display: 'var(--ds-font-display)',\n body: 'var(--ds-font-body)',\n mono: 'var(--ds-font-mono)',\n pixel: 'var(--ds-font-pixel)',\n} as const;\n\n/**\n * Default emphasis per heading level, so a document's colour hierarchy follows\n * its structural hierarchy without every call site restating it.\n */\nexport const HEADING_EMPHASIS: Record<1 | 2 | 3 | 4 | 5 | 6, Emphasis> = {\n 1: 'primary',\n 2: 'primary',\n 3: 'secondary',\n 4: 'tertiary',\n 5: 'quiet',\n 6: 'quiet',\n};\n\n/**\n * The full semantic token surface, as CSS variable expressions. Useful for\n * inline styles and for consumers building their own components on the system.\n */\nexport const semanticTokens = {\n accent: EMPHASIS_VARS,\n intent: INTENT_VARS,\n delta: DELTA_VARS,\n deltaGround: DELTA_GROUND_VARS,\n surface: SURFACE_VARS,\n text: TEXT_VARS,\n border: BORDER_VARS,\n font: fontVar,\n shadowColor: 'var(--ds-shadow-color)',\n} as const;\n"],"mappings":";AAwGA,IAAM,gBAA0C;AAAA,EAC9C,SAAS;AAAA,EACT,WAAW;AAAA,EACX,UAAU;AAAA,EACV,OAAO;AACT;AAEA,IAAM,cAAsC;AAAA,EAC1C,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AACV;AAEA,IAAM,aAAoC;AAAA,EACxC,OAAO;AAAA,EACP,SAAS;AAAA,EACT,OAAO;AACT;AAEA,IAAM,oBAAiD;AAAA,EACrD,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AACR;AAEA,IAAM,eAAwC;AAAA,EAC5C,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AACX;AAEA,IAAM,YAAsC;AAAA,EAC1C,SAAS;AAAA,EACT,WAAW;AAAA,EACX,OAAO;AAAA,EACP,SAAS;AACX;AAEA,IAAM,cAA0C;AAAA,EAC9C,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AACV;AASO,SAAS,UAAU,OAAgC,WAAwB,WAAmB;AACnG,QAAM,WAAW,SAAS;AAC1B,SACE,cAAc,QAAoB,KAClC,YAAY,QAAkB,KAC9B,cAAc;AAElB;AAEO,SAAS,WAAW,QAAiB,QAAgB;AAC1D,SAAO,aAAa,KAAK,KAAK,aAAa;AAC7C;AAEO,SAAS,QAAQ,QAAkB,WAAmB;AAC3D,SAAO,UAAU,KAAK,KAAK,UAAU;AACvC;AAEO,SAAS,UAAU,QAAoB,UAAkB;AAC9D,SAAO,YAAY,KAAK,KAAK,YAAY;AAC3C;AAGO,IAAM,UAAU;AAAA,EACrB,SAAS;AAAA,EACT,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AACT;AAMO,IAAM,mBAA4D;AAAA,EACvE,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAMO,IAAM,iBAAiB;AAAA,EAC5B,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,aAAa;AAAA,EACb,SAAS;AAAA,EACT,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,aAAa;AACf;","names":[]}
|