@kitlangton/knobs 0.4.0-next.0 → 0.4.0-next.10
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/README.md +451 -54
- package/dist/dev/{chunk-7xgkerd2.js → chunk-3ygqgy1x.js} +23 -1
- package/dist/dev/{chunk-stbcgz1y.js → chunk-5pb7ymrd.js} +567 -471
- package/dist/dev/{chunk-t68smqkc.js → chunk-a7cjgy8x.js} +13 -11
- package/dist/dev/{chunk-pmkvb9ep.js → chunk-dyq4m24m.js} +2081 -507
- package/dist/dev/index.js +10 -5
- package/dist/index.js +25 -1
- package/dist/panel.js +3187 -1341
- package/dist/react.js +294 -6
- package/dist/review-react.js +18580 -0
- package/dist/review-solid.js +18482 -0
- package/dist/review.js +18488 -0
- package/dist/solid.js +292 -4
- package/dist/themes.js +1767 -7
- package/dist/types/core/adapter.d.ts +6 -2
- package/dist/types/core/appearance.d.ts +44 -0
- package/dist/types/core/glide.d.ts +7 -0
- package/dist/types/core/motion.d.ts +66 -0
- package/dist/types/core/root.d.ts +13 -0
- package/dist/types/core/store.d.ts +18 -5
- package/dist/types/core/theme.d.ts +10 -3
- package/dist/types/index.d.ts +2 -1
- package/dist/types/panel/gpu/color.d.ts +6 -0
- package/dist/types/panel/motion.d.ts +1 -1
- package/dist/types/panel/styles.d.ts +2 -3
- package/dist/types/review/font.d.ts +13 -0
- package/dist/types/review/foundations.d.ts +175 -0
- package/dist/types/review/index.d.ts +13 -0
- package/dist/types/review/react.d.ts +1 -0
- package/dist/types/review/solid.d.ts +1 -0
- package/dist/types/themes/define.d.ts +104 -0
- package/dist/types/themes/index.d.ts +16 -0
- package/dist/types/themes/knobs.d.ts +5 -0
- package/dist/types/themes/review.d.ts +8 -0
- package/dist/types/themes/void.d.ts +8 -0
- package/dist/types/tokens/color.d.ts +42 -0
- package/dist/types/tokens/css.d.ts +13 -0
- package/dist/types/tokens/evaluate.d.ts +8 -0
- package/dist/types/tokens/index.d.ts +4 -0
- package/dist/types/tokens/schema.d.ts +1280 -0
- package/dist/types/ui/bento-css.d.ts +1 -1
- package/dist/types/ui/compare-css.d.ts +1 -1
- package/dist/types/ui/compare-gpu.d.ts +6 -6
- package/dist/types/ui/compare-model.d.ts +85 -2
- package/dist/types/ui/compare.d.ts +18 -4
- package/dist/types/ui/diff.d.ts +4 -5
- package/dist/types/ui/history-css.d.ts +1 -0
- package/dist/types/ui/history-model.d.ts +249 -0
- package/dist/types/ui/history.d.ts +38 -0
- package/dist/types/ui/icons.d.ts +40 -0
- package/dist/types/ui/index.d.ts +9 -5
- package/dist/types/ui/look.d.ts +18 -13
- package/dist/types/ui/overlay-css.d.ts +1 -1
- package/dist/types/ui/player-css.d.ts +1 -0
- package/dist/types/ui/player.d.ts +51 -0
- package/dist/types/ui/readout-css.d.ts +1 -1
- package/dist/types/ui/readout-model.d.ts +5 -1
- package/dist/types/ui/review-look.d.ts +6 -0
- package/dist/types/ui/review-options.d.ts +28 -0
- package/dist/types/ui/rgba.d.ts +11 -0
- package/dist/types/ui/selection-pill-css.d.ts +1 -0
- package/dist/types/ui/selection-pill.d.ts +106 -0
- package/dist/types/ui/timeline-model.d.ts +27 -0
- package/dist/types/ui/timeline.d.ts +16 -1
- package/dist/types/ui/tree.d.ts +3 -2
- package/dist/types/ui/walkthrough-annotations.d.ts +42 -0
- package/dist/types/ui/walkthrough-blocks.d.ts +87 -0
- package/dist/types/ui/walkthrough-media.d.ts +30 -1
- package/dist/types/ui/walkthrough-model.d.ts +469 -5
- package/dist/types/ui/walkthrough.d.ts +27 -5
- package/dist/ui-react.js +8087 -2350
- package/dist/ui-solid.js +8100 -2363
- package/dist/ui.js +9751 -3963
- package/package.json +13 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ControlDescriptor } from "./remote.js";
|
|
2
2
|
import type { Choice, Schema, State } from "./schema.js";
|
|
3
|
-
import type { Controls, DensityMode, MountPanelOptions
|
|
3
|
+
import type { Controls, DensityMode, MountPanelOptions } from "./store.js";
|
|
4
|
+
import { type LookOptions } from "./appearance.js";
|
|
4
5
|
export type ChoiceKey<S extends Schema> = {
|
|
5
6
|
[K in keyof S]: S[K] extends Choice ? K : never;
|
|
6
7
|
}[keyof S] & string;
|
|
@@ -16,6 +17,9 @@ export type KnobsPanelProps<S extends Schema = Schema> = MountPanelOptions & {
|
|
|
16
17
|
/** While true, a different item is arriving: values land without springing or rolling. */
|
|
17
18
|
land?: boolean;
|
|
18
19
|
};
|
|
19
|
-
|
|
20
|
+
/** The look a panel takes: its props' over its store's. */
|
|
21
|
+
export declare const panelLook: <S extends Schema>(controls: Controls<S>, look?: LookOptions) => import("./appearance.js").Look;
|
|
22
|
+
/** Restyles the mounted panel in place (theme, appearance, preset, density), so its tokens glide. */
|
|
23
|
+
export declare function syncPanelLook<S extends Schema>(host: HTMLElement | null | undefined, controls: Controls<S>, look?: LookOptions, density?: DensityMode): void;
|
|
20
24
|
export declare function syncPanelValues<S extends Schema>(controls: Controls<S>, descriptors?: readonly ControlDescriptor[], values?: State, land?: boolean): void;
|
|
21
25
|
export declare function mountPanelAdapter<S extends Schema>(host: HTMLElement, controls: Controls<S>, getProps: () => KnobsPanelProps<S>): () => void;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Theme } from "../themes/define.js";
|
|
2
|
+
import { type TokenPreset } from "./theme.js";
|
|
3
|
+
/**
|
|
4
|
+
* Light or dark: `dark` and `light` fix it, `system` follows the OS, and `inherit` (the default)
|
|
5
|
+
* follows the page: a `color-scheme`, a `.dark`/`.light` class, `[data-theme]` or
|
|
6
|
+
* `[data-appearance]` on an ancestor, or an outer knobs element, else the OS.
|
|
7
|
+
*/
|
|
8
|
+
export type Appearance = "dark" | "light" | "system" | "inherit";
|
|
9
|
+
/** @deprecated The old name for an appearance: `auto` is `system`. Use `appearance`. */
|
|
10
|
+
export type ThemeMode = "dark" | "light" | "auto";
|
|
11
|
+
/** How a panel, chip or knobs/ui piece looks: its theme, its appearance (and an old preset). */
|
|
12
|
+
export interface LookOptions {
|
|
13
|
+
/**
|
|
14
|
+
* A theme from `defineTheme` (or `themes.knobs`, `themes.void`). Knobs' own when unset.
|
|
15
|
+
* `"dark" | "light" | "auto"` is the old spelling of `appearance` and still works.
|
|
16
|
+
*/
|
|
17
|
+
readonly theme?: Theme | ThemeMode;
|
|
18
|
+
readonly appearance?: Appearance;
|
|
19
|
+
/** @deprecated A `TokenPreset` (`labPreset`): its tokens over the theme's. */
|
|
20
|
+
readonly preset?: TokenPreset;
|
|
21
|
+
}
|
|
22
|
+
/** A look with every part decided. */
|
|
23
|
+
export interface Look {
|
|
24
|
+
readonly theme?: Theme;
|
|
25
|
+
readonly appearance: Appearance;
|
|
26
|
+
readonly preset?: TokenPreset;
|
|
27
|
+
}
|
|
28
|
+
/** `options` over `base`: a theme object, an appearance (or an old mode), a preset. */
|
|
29
|
+
export declare function resolveLook(options?: LookOptions, base?: Partial<Look>): Look;
|
|
30
|
+
/** The theme an element shows: the nearest themed knobs element's, else knobs' own (undefined). */
|
|
31
|
+
export declare function themeOf(el: Element): Theme | undefined;
|
|
32
|
+
/** The selector a theme's tokens sit under: any knobs element marked with its name. */
|
|
33
|
+
export declare const themeSelector: (name: string) => string;
|
|
34
|
+
/** Adds a theme's tokens once per document, under `[data-knobs-theme="<name>"]`. */
|
|
35
|
+
export declare function injectTheme(doc: Document, theme: Theme): void;
|
|
36
|
+
/** Adds a preset's tokens once per document, for any knobs element marked `data-preset`. */
|
|
37
|
+
export declare function injectPreset(doc: Document, preset: TokenPreset): void;
|
|
38
|
+
/** Marks `el` (a knobs root) with `look`: its theme's tokens, its appearance and its preset. */
|
|
39
|
+
export declare function applyLook(el: HTMLElement, look: Look): void;
|
|
40
|
+
/**
|
|
41
|
+
* The look `el` shows, fixed: its theme and preset, and the appearance it shows now. For something
|
|
42
|
+
* floated out of it (a drag ghost, a menu) to match it wherever it lands.
|
|
43
|
+
*/
|
|
44
|
+
export declare function lookAt(el: Element): Look;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** The transitions that glide every driver, for a root that also transitions its own properties. */
|
|
2
|
+
export declare const TOKEN_TRANSITIONS: string;
|
|
3
|
+
/** Elements whose tokens glide: each declares the drivers. */
|
|
4
|
+
export declare const GLIDING = ".knobs-panel,.knobs-chip,.knobs-notice,.knobs-ui";
|
|
5
|
+
export declare const DRIVERS: string;
|
|
6
|
+
/** Rules read the gliding aliases of what glides, and what the knobs root resolved otherwise. */
|
|
7
|
+
export declare const aliased: (css: string) => string;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type SpringValue } from "./spring.js";
|
|
2
|
+
/**
|
|
3
|
+
* The five named springs (SwiftUI duration and bounce), all without bounce. Every motion in knobs
|
|
4
|
+
* uses one of these unless it's tuned for one feature.
|
|
5
|
+
*/
|
|
6
|
+
export declare const SPRINGS: {
|
|
7
|
+
/** Press feedback, focus, selection, pointer-tied moves. */
|
|
8
|
+
readonly instant: {
|
|
9
|
+
readonly duration: 0.1;
|
|
10
|
+
readonly bounce: 0;
|
|
11
|
+
};
|
|
12
|
+
/** Value fills, thumbs, toggles, small controls, menus, exits. */
|
|
13
|
+
readonly snappy: {
|
|
14
|
+
readonly duration: 0.25;
|
|
15
|
+
readonly bounce: 0;
|
|
16
|
+
};
|
|
17
|
+
/** Most state changes: popovers, panel open and close, restyle glides (`--k-spring`). */
|
|
18
|
+
readonly default: {
|
|
19
|
+
readonly duration: 0.3;
|
|
20
|
+
readonly bounce: 0;
|
|
21
|
+
};
|
|
22
|
+
/** Layout reflow, split panes, list reorders. */
|
|
23
|
+
readonly calm: {
|
|
24
|
+
readonly duration: 0.4;
|
|
25
|
+
readonly bounce: 0;
|
|
26
|
+
};
|
|
27
|
+
/** Appearance and theme changes, drawers, page-scale moves. */
|
|
28
|
+
readonly smooth: {
|
|
29
|
+
readonly duration: 0.45;
|
|
30
|
+
readonly bounce: 0;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export type SpringName = keyof typeof SPRINGS;
|
|
34
|
+
/** A quick fade that isn't travel (and what any fade becomes under reduced motion). */
|
|
35
|
+
export declare const FADE: SpringValue;
|
|
36
|
+
/** A popover or menu closing: a little shorter than snappy. */
|
|
37
|
+
export declare const CLOSE: SpringValue;
|
|
38
|
+
/** The named springs as ω/ζ, for `new Spring(x, omega, zeta)`. */
|
|
39
|
+
export declare const MOTION: { readonly [K in SpringName]: {
|
|
40
|
+
readonly omega: number;
|
|
41
|
+
readonly zeta: number;
|
|
42
|
+
}; };
|
|
43
|
+
export declare const reducedMotion: (win: Window | null | undefined) => boolean;
|
|
44
|
+
/**
|
|
45
|
+
* The reduced-motion policy: movement doesn't travel (`null`: go straight to the end), and a fade
|
|
46
|
+
* keeps a short fade (at most `FADE`).
|
|
47
|
+
*/
|
|
48
|
+
export declare function reducedSpring(spring: SpringValue, kind: "move" | "fade", reduced: boolean): SpringValue | null;
|
|
49
|
+
/** A spring as a CSS `linear()` easing and its settle time (ms). */
|
|
50
|
+
export declare const springLinear: (spring: SpringValue) => {
|
|
51
|
+
easing: string;
|
|
52
|
+
ms: number;
|
|
53
|
+
};
|
|
54
|
+
/** `--k-spring`'s default: the default spring as "duration bounce". */
|
|
55
|
+
export declare const SPRING_TOKEN: string;
|
|
56
|
+
/** The default spring as CSS, for `--k-fill-ease` and `--k-fill-ms`. */
|
|
57
|
+
export declare const DEFAULT_LINEAR: {
|
|
58
|
+
easing: string;
|
|
59
|
+
ms: number;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Each named spring as CSS on :root: `--_k-motion-<name>` (a `linear()` easing) and
|
|
63
|
+
* `--_k-motion-<name>-ms` (its settle time, a number of ms). Under reduced motion they take 0 ms:
|
|
64
|
+
* movement doesn't travel.
|
|
65
|
+
*/
|
|
66
|
+
export declare const motionCss: string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The class every knobs top-level element carries: panels, chips, menus, the status notice, and
|
|
3
|
+
* every knobs/ui piece's root. Each resolves the design tokens for itself (see tokens/css.ts), so
|
|
4
|
+
* a theme, an appearance or a host's token on any ancestor reaches what's derived from it.
|
|
5
|
+
*/
|
|
6
|
+
export declare const ROOT_CLASS = "knobs-root";
|
|
7
|
+
/**
|
|
8
|
+
* The token sheet: the Knobs theme's defaults, every root's resolution and appearance, the
|
|
9
|
+
* drivers that make tokens glide, and the motion tokens.
|
|
10
|
+
*/
|
|
11
|
+
export declare const rootCss: string;
|
|
12
|
+
/** Adds the token sheet once per document. */
|
|
13
|
+
export declare function injectTokens(doc: Document): void;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { type CodeFormat } from "./code.js";
|
|
2
2
|
import type { TokenPreset } from "./theme.js";
|
|
3
|
+
import type { Appearance, ThemeMode } from "./appearance.js";
|
|
4
|
+
import type { Theme } from "../themes/define.js";
|
|
3
5
|
import { type ReadoutInput, type ReadoutKeys, type Schema, type State, type Values } from "./schema.js";
|
|
4
6
|
import { type StoragePort } from "./storage.js";
|
|
5
7
|
import { type Variants } from "./variants.js";
|
|
6
|
-
export type
|
|
8
|
+
export type { Appearance, ThemeMode } from "./appearance.js";
|
|
7
9
|
export type DensityMode = "compact" | "default" | "comfortable";
|
|
8
10
|
export type RendererMode = "gpu" | "dom" | "auto";
|
|
9
11
|
/** When a store's chip shows; see `ChipOptions.reveal`. */
|
|
@@ -157,7 +159,7 @@ export interface MountPanelOptions extends LabelOptions {
|
|
|
157
159
|
* (a prototype's settings), where "default" means nothing. The store's `marks` by default.
|
|
158
160
|
*/
|
|
159
161
|
readonly marks?: boolean;
|
|
160
|
-
/** Token values to style the panel with
|
|
162
|
+
/** @deprecated Token values to style the panel with (see `TokenPreset`); use `theme`. */
|
|
161
163
|
readonly preset?: TokenPreset;
|
|
162
164
|
/**
|
|
163
165
|
* `false` drops the header (title and buttons) for a host that draws its own. An object keeps
|
|
@@ -231,7 +233,13 @@ export interface MountPanelOptions extends LabelOptions {
|
|
|
231
233
|
readonly onReady?: (panel: PanelHandle) => void;
|
|
232
234
|
/** What Copy (and ⇧C) puts on the clipboard; `controls.code()` by default. */
|
|
233
235
|
readonly copy?: () => string;
|
|
234
|
-
|
|
236
|
+
/**
|
|
237
|
+
* A theme from `defineTheme` (`themes.knobs`, `themes.void`); the store's by default. The old
|
|
238
|
+
* `"dark" | "light" | "auto"` still sets the appearance.
|
|
239
|
+
*/
|
|
240
|
+
readonly theme?: Theme | ThemeMode;
|
|
241
|
+
/** dark | light | system | inherit (the default: follow the page, else the OS). */
|
|
242
|
+
readonly appearance?: Appearance;
|
|
235
243
|
readonly density?: DensityMode;
|
|
236
244
|
readonly renderer?: RendererMode;
|
|
237
245
|
readonly variants?: boolean;
|
|
@@ -347,7 +355,10 @@ export interface ControlsOptions<S extends Schema> extends LabelOptions {
|
|
|
347
355
|
*/
|
|
348
356
|
groupPresets?: Readonly<Record<string, readonly GroupPreset<Values<S>>[]>>;
|
|
349
357
|
actions?: readonly ControlAction<Values<S>>[];
|
|
350
|
-
theme
|
|
358
|
+
/** Its panels' theme (see `MountPanelOptions.theme`). */
|
|
359
|
+
theme?: Theme | ThemeMode;
|
|
360
|
+
/** Its panels' appearance (see `MountPanelOptions.appearance`). */
|
|
361
|
+
appearance?: Appearance;
|
|
351
362
|
density?: DensityMode;
|
|
352
363
|
renderer?: RendererMode;
|
|
353
364
|
/** Default key bindings for this store's panels (see `MountPanelOptions.keys`). */
|
|
@@ -385,7 +396,9 @@ export interface Controls<S extends Schema = Schema> {
|
|
|
385
396
|
readonly presets: Readonly<Record<string, Values<S>>>;
|
|
386
397
|
readonly variants: Variants<Values<S>>;
|
|
387
398
|
readonly actions: readonly ControlAction<Values<S>>[];
|
|
388
|
-
|
|
399
|
+
/** Its panels' theme, as given (see `ControlsOptions.theme`). */
|
|
400
|
+
readonly theme: Theme | ThemeMode | undefined;
|
|
401
|
+
readonly appearance: Appearance | undefined;
|
|
389
402
|
readonly density: DensityMode;
|
|
390
403
|
readonly renderer: RendererMode;
|
|
391
404
|
readonly keys: PanelKeys | undefined;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A named set of `--k-*` token values for dark and light, applied to
|
|
2
|
+
* A named set of `--k-*` token values for dark and light, applied to knobs elements mounted with
|
|
3
3
|
* `{ preset }` (or with `data-preset="<name>"` and `presetCss(preset)` in your own stylesheet).
|
|
4
|
-
* `css` adds rules for anything tokens don't cover; `&` stands for the
|
|
4
|
+
* `css` adds rules for anything tokens don't cover; `&` stands for the element.
|
|
5
|
+
*
|
|
6
|
+
* @deprecated Use `defineTheme` (from `knobs/themes`), which generates both appearances from a
|
|
7
|
+
* few dials. Presets keep working; their token names go through the deprecated aliases.
|
|
5
8
|
*/
|
|
6
9
|
export interface TokenPreset {
|
|
7
10
|
readonly name: string;
|
|
@@ -9,7 +12,11 @@ export interface TokenPreset {
|
|
|
9
12
|
readonly light?: Readonly<Record<string, string | number>>;
|
|
10
13
|
readonly css?: string;
|
|
11
14
|
}
|
|
12
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* The stylesheet for a preset. A token it gives for both appearances becomes `light-dark(light,
|
|
17
|
+
* dark)`, so it follows the element's appearance (its `color-scheme`) like the theme's colours
|
|
18
|
+
* do; anything else holds in both.
|
|
19
|
+
*/
|
|
13
20
|
export declare function presetCss(preset: TokenPreset): string;
|
|
14
21
|
/**
|
|
15
22
|
* A dense, square editor (Arcade's Lab): radius 0, compact 26 px rows, the flat frame (groups as
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export { knob, choice, toggle, spring, color, point, easing, action, flatSpring, vec2, vec3, range, angle, seed, keybind, gradient, curve, toolbar, toolbarShortcut, actionShortcut, watch, sparkline, graph, meter, table, log, hasValue, isReadout, wrapAngle, SPRING, type FieldMeta, type ActionField, type SpringPart, type ValueField, type Knob, type Choice, type Toggle, type SpringField, type ColorField, type PointField, type EasingField, type VecField, type Vec3, type RangeField, type AngleField, type SeedField, type KeybindField, type GradientField, type CurveField, type ToolbarField, type ToolbarItem, type ToolbarShortcut, type WatchField, type SparklineField, type GraphField, type GraphSeries, type GraphThreshold, type MeterField, type TableField, type LogField, type ReadoutField, type ReadoutKeys, type ReadoutInput, type Point, type Field, type Schema, type Values, type Value, type State, } from "./core/schema.js";
|
|
2
2
|
export { springCss, springMotion, type SpringValue } from "./core/spring.js";
|
|
3
|
+
export { reducedSpring, SPRINGS, type SpringName } from "./core/motion.js";
|
|
3
4
|
export { colorHex, parseColor, type Oklch } from "./core/color.js";
|
|
4
5
|
export { sampleGradient, sampleCurve, gradientCss, CURVE_SHAPES, type GradientStop, type GradientSpace, type CurvePoint, type CurveInterp, type SampleGradientOptions, type SampleCurveOptions, } from "./core/ramp.js";
|
|
5
6
|
export { bezierCss, bezierPoint, EASINGS, type Bezier, type EasingName } from "./core/easing.js";
|
|
6
7
|
export { AROUND } from "./core/random.js";
|
|
7
|
-
export { defineControls, type ChangeMeta, type GestureEvent, type ChangeSource, type ChipOptions, type ControlAction, type Controls, type ControlsOptions, type DensityMode, type GroupPreset, type GroupPresetDisplay, type PresetRef, type HeaderButton, type HeaderOptions, type HostHistory, type LabelOptions, type MountPanelOptions, type PanelCommand, type PanelHandle, type PanelModule, type PanelKeys, type PersistMode, type SearchChip, type SearchOptions, type SyncOptions, type RendererMode, type RevealMode, type SectionFolded, type SoundOptions, type SoundTheme, type ThemeMode, } from "./core/store.js";
|
|
8
|
+
export { defineControls, type ChangeMeta, type GestureEvent, type ChangeSource, type ChipOptions, type ControlAction, type Controls, type ControlsOptions, type DensityMode, type GroupPreset, type GroupPresetDisplay, type PresetRef, type HeaderButton, type HeaderOptions, type HostHistory, type LabelOptions, type MountPanelOptions, type PanelCommand, type PanelHandle, type PanelModule, type PanelKeys, type PersistMode, type SearchChip, type SearchOptions, type SyncOptions, type RendererMode, type RevealMode, type SectionFolded, type SoundOptions, type SoundTheme, type ThemeMode, type Appearance, } from "./core/store.js";
|
|
8
9
|
export { createRemoteControls, descriptorToField, formatSwift, fromDescriptors, fromSettings, type SettingsGroup, type SettingsItem, type ActionDescriptor, type ChoiceOption, type ControlDescriptor, type SpringBindingDescriptor, type ToolbarDescriptor, type ReadoutDescriptor, type ValueDescriptor, type RemoteControls, type RemoteControlsOptions, } from "./core/remote.js";
|
|
9
10
|
export type { LogEntry, LogLevel, TableRows, WatchValue } from "./core/readout.js";
|
|
10
11
|
export { memoryStorage, urlFlag, type StoragePort } from "./core/storage.js";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { mixRgba as mixColor, parseCssColor, type Rgba, withAlpha } from "../../ui/rgba.js";
|
|
2
|
+
import type { GpuColors, Theme } from "../../themes/define.js";
|
|
2
3
|
export { mixColor, parseCssColor, type Rgba, withAlpha };
|
|
3
4
|
/** CSS `color-mix(in srgb, a p, b)`, interpolated with premultiplied alpha like the browser. */
|
|
4
5
|
export declare function cssMix(a: Rgba, b: Rgba, p: number): Rgba;
|
|
@@ -126,3 +127,8 @@ export interface PanelThemeTokens {
|
|
|
126
127
|
readonly shadowStrength: number;
|
|
127
128
|
}
|
|
128
129
|
export declare function readPanelTokens(panel: HTMLElement, version?: number): PanelThemeTokens;
|
|
130
|
+
/**
|
|
131
|
+
* A theme's colours for one appearance, as the renderer draws them (sRGB, straight alpha): what
|
|
132
|
+
* the panel shows where no CSS (a host's override, a preset, a glide) says otherwise.
|
|
133
|
+
*/
|
|
134
|
+
export declare function gpuDefaults(theme: Theme | undefined, light: boolean): GpuColors;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Spring } from "../core/spring.js";
|
|
2
2
|
export { Spring, springEasing } from "../core/spring.js";
|
|
3
|
-
/** The slider fill, and its rubber band springing back from past an end. */
|
|
3
|
+
/** The slider fill (the default spring, as --k-spring), and its rubber band springing back from past an end. */
|
|
4
4
|
export declare const FILL: {
|
|
5
5
|
omega: number;
|
|
6
6
|
zeta: number;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { type TokenPreset } from "../core/theme.js";
|
|
2
1
|
/**
|
|
3
2
|
* What DELAY times: a row's turn in a preset's cascade is set on these (see `showValues` in
|
|
4
3
|
* panel.ts) rather than on the row, where the custom property would restyle all of the row.
|
|
5
4
|
*/
|
|
6
5
|
export declare const DELAYED = ".knobs-fill,.knobs-handle,.knobs-seg-pill,.knobs-toggle,.knobs-toggle i,.knobs-arm,.knobs-curve,.knobs-swatch,.knobs-strip-thumb,.knobs-pad>i,.knobs-ease-handle,.knobs-range-track,.knobs-range-fill,.knobs-range-thumb,.knobs-dial-hand,.knobs-grad,.knobs-grad-mini,.knobs-grad-mini>i,.knobs-grad-stop,.knobs-graph-pt";
|
|
7
|
-
/** Adds a token preset's stylesheet once per document. */
|
|
8
|
-
export declare function injectPreset(doc: Document, preset: TokenPreset): void;
|
|
9
6
|
/** The rules' `:has()` as the attributes has.ts keeps (see there for why). */
|
|
10
7
|
export declare const withoutHas: (css: string) => string;
|
|
8
|
+
/** The panel stylesheet, as `injectStyles` writes it (after the token sheet). */
|
|
9
|
+
export declare const panelCss: () => string;
|
|
11
10
|
export declare function injectStyles(doc: Document): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Theme } from "../themes/define.js";
|
|
2
|
+
export interface ReviewFontOptions {
|
|
3
|
+
/** A stylesheet that declares the face (Google Fonts, rsms.me/inter, your own). */
|
|
4
|
+
readonly href?: string;
|
|
5
|
+
/** The family, first in the stack: `"Inter"`, `"Geist"`. The platform's face follows it. */
|
|
6
|
+
readonly sans?: string;
|
|
7
|
+
readonly mono?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The review look in a webfont: loads `href` once per document and returns the review theme with
|
|
11
|
+
* `sans` (and `mono`) first in its stacks. Pass it as `theme`.
|
|
12
|
+
*/
|
|
13
|
+
export declare function reviewFont(doc: Document, options: ReviewFontOptions): Theme;
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/** The five sizes. Two weights: 400, and 500 for titles and emphasis. */
|
|
2
|
+
export declare const TYPE: readonly [{
|
|
3
|
+
readonly role: "heading";
|
|
4
|
+
readonly size: 20;
|
|
5
|
+
readonly leading: 28;
|
|
6
|
+
readonly weight: 500;
|
|
7
|
+
readonly use: "A page's title";
|
|
8
|
+
}, {
|
|
9
|
+
readonly role: "title";
|
|
10
|
+
readonly size: 16;
|
|
11
|
+
readonly leading: 24;
|
|
12
|
+
readonly weight: 500;
|
|
13
|
+
readonly use: "A section's title, under its kicker";
|
|
14
|
+
}, {
|
|
15
|
+
readonly role: "body";
|
|
16
|
+
readonly size: 13;
|
|
17
|
+
readonly leading: 20;
|
|
18
|
+
readonly weight: 400;
|
|
19
|
+
readonly use: "Prose, step and option titles (500), rows, values";
|
|
20
|
+
}, {
|
|
21
|
+
readonly role: "label";
|
|
22
|
+
readonly size: 12;
|
|
23
|
+
readonly leading: 16;
|
|
24
|
+
readonly weight: 400;
|
|
25
|
+
readonly use: "Mono inside body text: code, paths, evidence chips";
|
|
26
|
+
}, {
|
|
27
|
+
readonly role: "small";
|
|
28
|
+
readonly size: 11;
|
|
29
|
+
readonly leading: 16;
|
|
30
|
+
readonly weight: 400;
|
|
31
|
+
readonly use: "Meta, terms, kickers, controls, keys, times";
|
|
32
|
+
}];
|
|
33
|
+
export type TypeRole = (typeof TYPE)[number]["role"];
|
|
34
|
+
/**
|
|
35
|
+
* Tracking follows size, one rule for every element: (body − size) × 0.03, so 20 px closes up by
|
|
36
|
+
* 0.21 px, 16 px by 0.09, 13 px sits at 0 and 11 px opens by 0.06. Mono never tracks.
|
|
37
|
+
*/
|
|
38
|
+
export declare const TRACKING = 0.03;
|
|
39
|
+
export declare const trackingAt: (size: number, body?: number) => number;
|
|
40
|
+
/** Prose stops here: 45–75 characters, centred on 66. */
|
|
41
|
+
export declare const MEASURE = "66ch";
|
|
42
|
+
/**
|
|
43
|
+
* The type stack: the platform's own UI face (SF Pro with its optical sizes on Apple, Segoe UI
|
|
44
|
+
* Variable on Windows), so nothing downloads, nothing swaps in, and the pages read like the native
|
|
45
|
+
* apps beside them. A webfont goes in through `reviewFont`.
|
|
46
|
+
*/
|
|
47
|
+
export declare const FONT: {
|
|
48
|
+
readonly sans: "system-ui,-apple-system,BlinkMacSystemFont,\"Segoe UI Variable Text\",\"Segoe UI\",Roboto,\"Helvetica Neue\",Arial,sans-serif";
|
|
49
|
+
readonly mono: "ui-monospace,\"SF Mono\",SFMono-Regular,\"Cascadia Mono\",\"JetBrains Mono\",Menlo,Consolas,monospace";
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* OpenType: tabular figures everywhere (times and counts never jitter); in data, `ss01` too
|
|
53
|
+
* (straight-sided 6 and 9 in SF, open digits in Inter: figures that can't be misread); code with
|
|
54
|
+
* no ligatures (`=>` stays two characters).
|
|
55
|
+
*/
|
|
56
|
+
export declare const FEATURES: {
|
|
57
|
+
readonly figures: "tabular-nums";
|
|
58
|
+
readonly data: "\"tnum\" 1,\"ss01\" 1";
|
|
59
|
+
readonly code: "none";
|
|
60
|
+
};
|
|
61
|
+
/** The space roles (px, on the 4 px unit); each from `title` up at least doubles the one below. */
|
|
62
|
+
export declare const SPACE: readonly [{
|
|
63
|
+
readonly role: "inside";
|
|
64
|
+
readonly px: 4;
|
|
65
|
+
readonly use: "Parts of one thing: an icon and its label, a term and its value";
|
|
66
|
+
}, {
|
|
67
|
+
readonly role: "sibling";
|
|
68
|
+
readonly px: 8;
|
|
69
|
+
readonly use: "Siblings in a group: rows, buttons, a list's lines";
|
|
70
|
+
}, {
|
|
71
|
+
readonly role: "title";
|
|
72
|
+
readonly px: 12;
|
|
73
|
+
readonly use: "A heading and what it heads";
|
|
74
|
+
}, {
|
|
75
|
+
readonly role: "block";
|
|
76
|
+
readonly px: 24;
|
|
77
|
+
readonly use: "Blocks inside one piece: fact groups, columns, media and its caption";
|
|
78
|
+
}, {
|
|
79
|
+
readonly role: "group";
|
|
80
|
+
readonly px: 48;
|
|
81
|
+
readonly use: "Steps and options, a hairline in the middle";
|
|
82
|
+
}, {
|
|
83
|
+
readonly role: "section";
|
|
84
|
+
readonly px: 96;
|
|
85
|
+
readonly use: "Sections of a page, a hairline in the middle";
|
|
86
|
+
}];
|
|
87
|
+
/** Hairlines and fills: alpha of the text colour, held to an APCA target on the page. */
|
|
88
|
+
export declare const HAIRLINES: readonly [{
|
|
89
|
+
readonly token: "border-subtle";
|
|
90
|
+
readonly lc: 9;
|
|
91
|
+
readonly use: "Dividers between rows, steps and sections";
|
|
92
|
+
}, {
|
|
93
|
+
readonly token: "border";
|
|
94
|
+
readonly lc: 12;
|
|
95
|
+
readonly use: "Rings round frames and wells";
|
|
96
|
+
}, {
|
|
97
|
+
readonly token: "border-strong";
|
|
98
|
+
readonly lc: 17;
|
|
99
|
+
readonly use: "Interactive edges, a focus that isn't the accent";
|
|
100
|
+
}];
|
|
101
|
+
export declare const FILLS: readonly [{
|
|
102
|
+
readonly token: "fill";
|
|
103
|
+
readonly use: "A well at rest: code, a chip, a frame loading";
|
|
104
|
+
}, {
|
|
105
|
+
readonly token: "fill-hover";
|
|
106
|
+
readonly use: "Under the pointer, at once";
|
|
107
|
+
}, {
|
|
108
|
+
readonly token: "fill-selected";
|
|
109
|
+
readonly use: "The selection pill, a pressed toggle";
|
|
110
|
+
}];
|
|
111
|
+
/** Radii, concentric: what sits inside a frame takes the frame's radius less the gap between. */
|
|
112
|
+
export declare const RADII: readonly [{
|
|
113
|
+
readonly token: "radius";
|
|
114
|
+
readonly px: 8;
|
|
115
|
+
readonly use: "Controls and rows 28–32 px high";
|
|
116
|
+
}, {
|
|
117
|
+
readonly token: "radius-panel";
|
|
118
|
+
readonly px: 12;
|
|
119
|
+
readonly use: "Frames, wells, cards";
|
|
120
|
+
}, {
|
|
121
|
+
readonly token: "radius / 2";
|
|
122
|
+
readonly px: 4;
|
|
123
|
+
readonly use: "Inline code, chips, rows 20 px high";
|
|
124
|
+
}];
|
|
125
|
+
/**
|
|
126
|
+
* The motion set. Springs are a duration and no bounce; nothing moves on load; hovers land at once
|
|
127
|
+
* and ease out; a whole thing replaced in place fades with a 3 px blur.
|
|
128
|
+
*/
|
|
129
|
+
export declare const MOTION: readonly [{
|
|
130
|
+
readonly name: "hover";
|
|
131
|
+
readonly spring: null;
|
|
132
|
+
readonly ms: "0 in, 120 out";
|
|
133
|
+
readonly use: "A hover's fill: on at once, off softly";
|
|
134
|
+
}, {
|
|
135
|
+
readonly name: "quick";
|
|
136
|
+
readonly spring: import("../index.js").SpringValue;
|
|
137
|
+
readonly use: "Replacing a whole thing in place: fade, scale .98, blur 3 px";
|
|
138
|
+
}, {
|
|
139
|
+
readonly name: "close";
|
|
140
|
+
readonly spring: import("../index.js").SpringValue;
|
|
141
|
+
readonly use: "A popover closing";
|
|
142
|
+
}, {
|
|
143
|
+
readonly name: "snappy";
|
|
144
|
+
readonly spring: {
|
|
145
|
+
readonly duration: 0.25;
|
|
146
|
+
readonly bounce: 0;
|
|
147
|
+
};
|
|
148
|
+
readonly use: "Controls: a toggle, a pick, a chapter row";
|
|
149
|
+
}, {
|
|
150
|
+
readonly name: "state";
|
|
151
|
+
readonly spring: {
|
|
152
|
+
readonly duration: 0.3;
|
|
153
|
+
readonly bounce: 0;
|
|
154
|
+
};
|
|
155
|
+
readonly use: "The selection pill, a disclosure opening";
|
|
156
|
+
}, {
|
|
157
|
+
readonly name: "calm";
|
|
158
|
+
readonly spring: {
|
|
159
|
+
readonly duration: 0.4;
|
|
160
|
+
readonly bounce: 0;
|
|
161
|
+
};
|
|
162
|
+
readonly use: "Layout: a compare's height, the page scrolling to a step";
|
|
163
|
+
}, {
|
|
164
|
+
readonly name: "smooth";
|
|
165
|
+
readonly spring: {
|
|
166
|
+
readonly duration: 0.45;
|
|
167
|
+
readonly bounce: 0;
|
|
168
|
+
};
|
|
169
|
+
readonly use: "A step opening to the full window";
|
|
170
|
+
}];
|
|
171
|
+
/**
|
|
172
|
+
* The foundations as private tokens on every review root; the review stylesheet reads them.
|
|
173
|
+
* Tracking is a calc in em, so it resolves on each element at its own size.
|
|
174
|
+
*/
|
|
175
|
+
export declare const foundationCss: string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { FEATURES, FILLS, FONT, HAIRLINES, MEASURE, MOTION, RADII, SPACE, TRACKING, TYPE, trackingAt, type TypeRole, } from "./foundations.js";
|
|
2
|
+
export { reviewFont, type ReviewFontOptions } from "./font.js";
|
|
3
|
+
export { reviewTheme } from "../themes/review.js";
|
|
4
|
+
export { injectUiStyles, restyle, type RestyleLook, type UiLook } from "../ui/look.js";
|
|
5
|
+
export { tasteTest, walkthrough, type TasteTest, type TasteTestOptions, type Walkthrough, type WalkthroughOptions, } from "../ui/walkthrough.js";
|
|
6
|
+
export { decision, facts, mediaSlot, type DecisionOptions, type FactsOptions, type MediaSlot, type MediaSlotOptions, type StepLinks, } from "../ui/walkthrough-media.js";
|
|
7
|
+
export { compare, type Compare, type CompareLoop, type CompareMode, type CompareOptions, type CompareSource, type CompareView, type ZoomRegion, } from "../ui/compare.js";
|
|
8
|
+
export { compareStrip, type CompareStrip, type CompareStripOptions } from "../ui/compare-strip.js";
|
|
9
|
+
export { player, type Player, type PlayerChapter, type PlayerOptions } from "../ui/player.js";
|
|
10
|
+
export { codeDiff, diffReview, type CodeDiff, type CodeDiffOptions, type CodeDiffUpdate, type DiffLayout, type DiffReview, type DiffReviewOptions, } from "../ui/diff.js";
|
|
11
|
+
export type { DiffSource } from "../ui/diff-model.js";
|
|
12
|
+
export { history, type History, type HistoryBand, type HistoryData, type HistoryEvent, type HistoryEvidence, type HistoryGroup, type HistoryLane, type HistoryOptions, type HistoryProvenance, type HistorySpan, type HistoryState, type HistoryTone, } from "../ui/history.js";
|
|
13
|
+
export { collectFeedback, feedbackMarkdown, inlineMarkdown, normalizeWalkthrough, plainMarkdown, readState as readWalkthroughState, walkthroughProgress, type FeedbackItem, type FeedbackNote, type WalkPage, type WalkStep, type WalkthroughAnnotation, type WalkthroughChapter, type WalkthroughDecisionOption, type WalkthroughFact, type WalkthroughFactGroup, type WalkthroughFacts, type WalkthroughDoc, type WalkthroughEvidence, type WalkthroughFeedback, type WalkthroughHistoryEvent, type WalkthroughHistoryGroup, type WalkthroughMedia, type WalkthroughMeta, type WalkthroughOption, type WalkthroughPR, type WalkthroughQA, type WalkthroughSection, type WalkthroughSource, type WalkthroughStackItem, type WalkthroughState, type WalkthroughStatus, type WalkthroughStep, type WalkthroughTableCell, type WalkthroughTableColumn, type WalkthroughTableRow, type WalkthroughTone, type WalkthroughUpdate, } from "../ui/walkthrough-model.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CodeDiff, Compare, CompareStrip, DiffReview, MediaSlot, TasteTest, Walkthrough, type CodeDiffProps, type CompareProps, type CompareStripProps, type DiffReviewProps, type MediaSlotProps, type TasteTestProps, type WalkthroughDoc, type WalkthroughFeedback, type WalkthroughProps, } from "../ui/react.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CodeDiff, Compare, CompareStrip, DiffReview, MediaSlot, TasteTest, Walkthrough, type CodeDiffProps, type CompareProps, type CompareStripProps, type DiffReviewProps, type MediaSlotProps, type TasteTestProps, type WalkthroughDoc, type WalkthroughFeedback, type WalkthroughProps, } from "../ui/solid.js";
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { type Rgba } from "../tokens/color.js";
|
|
2
|
+
import { type ColorTokenName, type TokenName } from "../tokens/schema.js";
|
|
3
|
+
export type Appearance = "dark" | "light";
|
|
4
|
+
export type Density = "compact" | "default" | "comfortable";
|
|
5
|
+
export type Material = "glass" | "solid" | "flat";
|
|
6
|
+
export type TokenOverrides = Partial<Record<TokenName, string>>;
|
|
7
|
+
/** What `defineTheme` takes. Everything but `name` is optional and deep-merges over `extends`. */
|
|
8
|
+
export interface ThemeSpec {
|
|
9
|
+
readonly name: string;
|
|
10
|
+
readonly extends?: Theme;
|
|
11
|
+
/** Tint of the neutral ladder. Chroma 0–0.02; 0.004 reads as neutral with a hint of hue. */
|
|
12
|
+
readonly gray?: {
|
|
13
|
+
readonly hue?: number;
|
|
14
|
+
readonly chroma?: number;
|
|
15
|
+
};
|
|
16
|
+
/** The accent: one colour (its dark-appearance value; light is derived) or one per appearance. */
|
|
17
|
+
readonly accent?: string | {
|
|
18
|
+
readonly dark: string;
|
|
19
|
+
readonly light: string;
|
|
20
|
+
};
|
|
21
|
+
/** 0–100, 50 by default: spreads the surface ladder and text tiers, scales fills and borders. */
|
|
22
|
+
readonly contrast?: number;
|
|
23
|
+
/** Control radius in px. */
|
|
24
|
+
readonly radius?: number;
|
|
25
|
+
readonly density?: Density;
|
|
26
|
+
readonly material?: Material;
|
|
27
|
+
readonly font?: {
|
|
28
|
+
readonly sans?: string;
|
|
29
|
+
readonly mono?: string;
|
|
30
|
+
};
|
|
31
|
+
/** Escape hatch: any token's value, per appearance. Applied after generation. */
|
|
32
|
+
readonly tokens?: {
|
|
33
|
+
readonly dark?: TokenOverrides;
|
|
34
|
+
readonly light?: TokenOverrides;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/** A spec with every dial filled in. */
|
|
38
|
+
export interface ThemeInputs {
|
|
39
|
+
readonly gray: {
|
|
40
|
+
readonly hue: number;
|
|
41
|
+
readonly chroma: number;
|
|
42
|
+
};
|
|
43
|
+
readonly accent: string | {
|
|
44
|
+
readonly dark: string;
|
|
45
|
+
readonly light: string;
|
|
46
|
+
};
|
|
47
|
+
readonly contrast: number;
|
|
48
|
+
readonly radius: number;
|
|
49
|
+
readonly density: Density;
|
|
50
|
+
readonly material: Material;
|
|
51
|
+
readonly font: {
|
|
52
|
+
readonly sans: string;
|
|
53
|
+
readonly mono: string;
|
|
54
|
+
};
|
|
55
|
+
readonly tokens: {
|
|
56
|
+
readonly dark: TokenOverrides;
|
|
57
|
+
readonly light: TokenOverrides;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export type ResolvedTokens = Readonly<Record<TokenName, string>>;
|
|
61
|
+
export type GpuColors = Readonly<Record<ColorTokenName, Rgba>>;
|
|
62
|
+
export interface Theme {
|
|
63
|
+
readonly name: string;
|
|
64
|
+
readonly inputs: ThemeInputs;
|
|
65
|
+
/**
|
|
66
|
+
* Every token for each appearance. Colours are fully resolved hex (`#rrggbb` or `#rrggbbaa`);
|
|
67
|
+
* other tokens carry their CSS value or derivation.
|
|
68
|
+
*/
|
|
69
|
+
readonly dark: ResolvedTokens;
|
|
70
|
+
readonly light: ResolvedTokens;
|
|
71
|
+
/** What the theme itself declares (generated values plus overrides); the CSS is built from it. */
|
|
72
|
+
readonly declared: {
|
|
73
|
+
readonly dark: TokenOverrides;
|
|
74
|
+
readonly light: TokenOverrides;
|
|
75
|
+
};
|
|
76
|
+
/** Every colour token as linear-light sRGB floats `[r, g, b, a]` (straight alpha), for WebGPU. */
|
|
77
|
+
readonly gpu: {
|
|
78
|
+
readonly dark: GpuColors;
|
|
79
|
+
readonly light: GpuColors;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* The theme's CSS in `@layer knobs.tokens`. With no selector, the full default sheet (its values
|
|
83
|
+
* on `:root`, every token resolved on `.knobs-root`, appearance rules). With a selector, one
|
|
84
|
+
* block of what this theme declares, to scope it to part of a page.
|
|
85
|
+
*/
|
|
86
|
+
css(options?: {
|
|
87
|
+
readonly selector?: string;
|
|
88
|
+
}): string;
|
|
89
|
+
}
|
|
90
|
+
/** The APCA budget each ink must meet on `bg`. */
|
|
91
|
+
export declare const APCA_BUDGET: {
|
|
92
|
+
readonly fg: 90;
|
|
93
|
+
readonly "fg-2": 75;
|
|
94
|
+
readonly "fg-3": 45;
|
|
95
|
+
readonly "fg-4": 30;
|
|
96
|
+
readonly "accent-fg": 60;
|
|
97
|
+
readonly "border-strong": 15;
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Builds a theme from a few dials: a neutral ladder generated in OKLCH and checked against the
|
|
101
|
+
* APCA budget, an accent with its text and on-accent colours, a shared status palette, chart
|
|
102
|
+
* series and material values, resolved for both appearances.
|
|
103
|
+
*/
|
|
104
|
+
export declare function defineTheme(spec: ThemeSpec): Theme;
|
|
@@ -1 +1,17 @@
|
|
|
1
|
+
import { knobs } from "./knobs.js";
|
|
2
|
+
import { reviewTheme } from "./review.js";
|
|
3
|
+
import { voidTheme } from "./void.js";
|
|
4
|
+
export { APCA_BUDGET, type Appearance as ThemeAppearance, type Density, defineTheme, type GpuColors, type Material, type ResolvedTokens, type Theme, type ThemeInputs, type ThemeSpec, type TokenOverrides, } from "./define.js";
|
|
5
|
+
export { knobs, reviewTheme, voidTheme };
|
|
6
|
+
export type { Appearance } from "../core/appearance.js";
|
|
7
|
+
export type { PublicTokenName, TokenName, TokenProperty } from "../tokens/schema.js";
|
|
8
|
+
/**
|
|
9
|
+
* The shipped themes: Knobs (the default), Void (true black, flat, for OLED and video) and Review
|
|
10
|
+
* (the review pieces' own default: Void with hairlines you can see).
|
|
11
|
+
*/
|
|
12
|
+
export declare const themes: {
|
|
13
|
+
readonly knobs: import("./define.js").Theme;
|
|
14
|
+
readonly void: import("./define.js").Theme;
|
|
15
|
+
readonly review: import("./define.js").Theme;
|
|
16
|
+
};
|
|
1
17
|
export { labPreset, presetCss, problemsPreset, type TokenPreset } from "../core/theme.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The review pieces' own look (walkthrough, compare, player, diff, facts, decision): Void's true
|
|
3
|
+
* black, flat and neutral, with hairlines you can see. Borders are alpha of the text colour, set
|
|
4
|
+
* by APCA on the page: subtle ≈ Lc 9, default ≈ Lc 12, strong ≈ Lc 17, in both appearances
|
|
5
|
+
* (Void's composited 6% and 10% read Lc 0 on black). Fills step 6 / 10 / 14% so a hover's
|
|
6
|
+
* background is plain to see. Light is white, page and surface alike. The platform's own face.
|
|
7
|
+
*/
|
|
8
|
+
export declare const reviewTheme: import("./define.js").Theme;
|