@kitlangton/knobs 0.4.0-next.8 → 0.4.0-next.9
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 +8 -4
- package/dist/review-react.js +18579 -0
- package/dist/review-solid.js +18481 -0
- package/dist/review.js +18487 -0
- package/dist/themes.js +121 -23
- 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/index.d.ts +7 -2
- package/dist/types/themes/review.d.ts +8 -0
- package/dist/types/ui/history-css.d.ts +1 -1
- package/dist/types/ui/index.d.ts +2 -2
- package/dist/types/ui/review-look.d.ts +6 -0
- package/dist/types/ui/review-options.d.ts +28 -0
- package/dist/types/ui/selection-pill.d.ts +3 -0
- package/dist/types/ui/walkthrough-media.d.ts +24 -1
- package/dist/types/ui/walkthrough-model.d.ts +87 -2
- package/dist/types/ui/walkthrough.d.ts +2 -2
- package/dist/ui-react.js +1924 -1568
- package/dist/ui-solid.js +1924 -1568
- package/dist/ui.js +590 -211
- package/package.json +13 -1
package/dist/themes.js
CHANGED
|
@@ -1603,28 +1603,6 @@ var knobs = defineTheme({
|
|
|
1603
1603
|
material: "glass"
|
|
1604
1604
|
});
|
|
1605
1605
|
|
|
1606
|
-
// src/themes/void.ts
|
|
1607
|
-
var voidTheme = defineTheme({
|
|
1608
|
-
name: "void",
|
|
1609
|
-
extends: knobs,
|
|
1610
|
-
gray: { hue: 0, chroma: 0 },
|
|
1611
|
-
accent: { dark: "#ffffff", light: "#1c1c1c" },
|
|
1612
|
-
material: "flat",
|
|
1613
|
-
tokens: {
|
|
1614
|
-
dark: {
|
|
1615
|
-
"bg-page": "#000000",
|
|
1616
|
-
"bg-inset": "#0a0a0a",
|
|
1617
|
-
bg: "#000000",
|
|
1618
|
-
"bg-raised": "#1c1c1e",
|
|
1619
|
-
"bg-overlay": "#2c2c2e",
|
|
1620
|
-
fg: "#ededed",
|
|
1621
|
-
"fg-2": "#cecece",
|
|
1622
|
-
"fg-3": "#989898",
|
|
1623
|
-
"fg-4": "#7a7a7a",
|
|
1624
|
-
"compare-stage": "#000000"
|
|
1625
|
-
}
|
|
1626
|
-
}
|
|
1627
|
-
});
|
|
1628
1606
|
// src/core/spring.ts
|
|
1629
1607
|
class Spring {
|
|
1630
1608
|
x;
|
|
@@ -1707,6 +1685,125 @@ function springCss(value) {
|
|
|
1707
1685
|
return { easing, duration: ms };
|
|
1708
1686
|
}
|
|
1709
1687
|
|
|
1688
|
+
// src/core/motion.ts
|
|
1689
|
+
var SPRINGS = {
|
|
1690
|
+
instant: { duration: 0.1, bounce: 0 },
|
|
1691
|
+
snappy: { duration: 0.25, bounce: 0 },
|
|
1692
|
+
default: { duration: 0.3, bounce: 0 },
|
|
1693
|
+
calm: { duration: 0.4, bounce: 0 },
|
|
1694
|
+
smooth: { duration: 0.45, bounce: 0 }
|
|
1695
|
+
};
|
|
1696
|
+
var FADE = { duration: 0.16, bounce: 0 };
|
|
1697
|
+
var CLOSE = { duration: 0.18, bounce: 0 };
|
|
1698
|
+
var MOTION = Object.fromEntries(Object.entries(SPRINGS).map(([name, spring]) => [name, springMotion(spring)]));
|
|
1699
|
+
var springLinear = (spring) => {
|
|
1700
|
+
const { omega, zeta } = springMotion(spring);
|
|
1701
|
+
return springEasing(omega, zeta);
|
|
1702
|
+
};
|
|
1703
|
+
var names = Object.keys(SPRINGS);
|
|
1704
|
+
var linear = Object.fromEntries(names.map((n) => [n, springLinear(SPRINGS[n])]));
|
|
1705
|
+
var SPRING_TOKEN = `${SPRINGS.default.duration} ${SPRINGS.default.bounce}`;
|
|
1706
|
+
var DEFAULT_LINEAR = linear.default;
|
|
1707
|
+
var motionCss = `:where(:root,:host){${names.map((n) => `--_k-motion-${n}:${linear[n].easing};--_k-motion-${n}-ms:${linear[n].ms}`).join(";")}}
|
|
1708
|
+
@media(prefers-reduced-motion:reduce){:where(:root,:host){${names.map((n) => `--_k-motion-${n}-ms:0`).join(";")}}}`;
|
|
1709
|
+
|
|
1710
|
+
// src/review/foundations.ts
|
|
1711
|
+
var TRACKING = 0.03;
|
|
1712
|
+
var MEASURE = "66ch";
|
|
1713
|
+
var FONT = {
|
|
1714
|
+
sans: 'system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI Variable Text","Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif',
|
|
1715
|
+
mono: 'ui-monospace,"SF Mono",SFMono-Regular,"Cascadia Mono","JetBrains Mono",Menlo,Consolas,monospace'
|
|
1716
|
+
};
|
|
1717
|
+
var FEATURES = {
|
|
1718
|
+
figures: "tabular-nums",
|
|
1719
|
+
data: '"tnum" 1,"ss01" 1',
|
|
1720
|
+
code: "none"
|
|
1721
|
+
};
|
|
1722
|
+
var MOTION2 = [
|
|
1723
|
+
{
|
|
1724
|
+
name: "hover",
|
|
1725
|
+
spring: null,
|
|
1726
|
+
ms: "0 in, 120 out",
|
|
1727
|
+
use: "A hover's fill: on at once, off softly"
|
|
1728
|
+
},
|
|
1729
|
+
{
|
|
1730
|
+
name: "quick",
|
|
1731
|
+
spring: FADE,
|
|
1732
|
+
use: "Replacing a whole thing in place: fade, scale .98, blur 3 px"
|
|
1733
|
+
},
|
|
1734
|
+
{ name: "close", spring: CLOSE, use: "A popover closing" },
|
|
1735
|
+
{ name: "snappy", spring: SPRINGS.snappy, use: "Controls: a toggle, a pick, a chapter row" },
|
|
1736
|
+
{ name: "state", spring: SPRINGS.default, use: "The selection pill, a disclosure opening" },
|
|
1737
|
+
{
|
|
1738
|
+
name: "calm",
|
|
1739
|
+
spring: SPRINGS.calm,
|
|
1740
|
+
use: "Layout: a compare's height, the page scrolling to a step"
|
|
1741
|
+
},
|
|
1742
|
+
{ name: "smooth", spring: SPRINGS.smooth, use: "A step opening to the full window" }
|
|
1743
|
+
];
|
|
1744
|
+
var foundationCss = `
|
|
1745
|
+
:where(.knobs-walkthrough,.knobs-wt-slot,.knobs-review){
|
|
1746
|
+
--_kr-track:calc((var(--_k-type-body) - 1em) * ${TRACKING});
|
|
1747
|
+
--_kr-measure:var(--k-walkthrough-measure,${MEASURE});
|
|
1748
|
+
--_kr-block:calc(var(--_k-space-title) * 2);
|
|
1749
|
+
--_kr-data:${FEATURES.data};
|
|
1750
|
+
letter-spacing:var(--_kr-track);font-variant-numeric:${FEATURES.figures};font-optical-sizing:auto;font-kerning:normal}
|
|
1751
|
+
:where(.knobs-walkthrough,.knobs-wt-slot,.knobs-review) :where(*){letter-spacing:var(--_kr-track)}
|
|
1752
|
+
:where(.knobs-walkthrough,.knobs-wt-slot,.knobs-review) :where(code,pre,kbd,samp,.knobs-wt-mono){letter-spacing:0;font-variant-ligatures:${FEATURES.code}}
|
|
1753
|
+
`;
|
|
1754
|
+
|
|
1755
|
+
// src/themes/void.ts
|
|
1756
|
+
var voidTheme = defineTheme({
|
|
1757
|
+
name: "void",
|
|
1758
|
+
extends: knobs,
|
|
1759
|
+
gray: { hue: 0, chroma: 0 },
|
|
1760
|
+
accent: { dark: "#ffffff", light: "#1c1c1c" },
|
|
1761
|
+
material: "flat",
|
|
1762
|
+
tokens: {
|
|
1763
|
+
dark: {
|
|
1764
|
+
"bg-page": "#000000",
|
|
1765
|
+
"bg-inset": "#0a0a0a",
|
|
1766
|
+
bg: "#000000",
|
|
1767
|
+
"bg-raised": "#1c1c1e",
|
|
1768
|
+
"bg-overlay": "#2c2c2e",
|
|
1769
|
+
fg: "#ededed",
|
|
1770
|
+
"fg-2": "#cecece",
|
|
1771
|
+
"fg-3": "#989898",
|
|
1772
|
+
"fg-4": "#7a7a7a",
|
|
1773
|
+
"compare-stage": "#000000"
|
|
1774
|
+
}
|
|
1775
|
+
}
|
|
1776
|
+
});
|
|
1777
|
+
|
|
1778
|
+
// src/themes/review.ts
|
|
1779
|
+
var reviewTheme = defineTheme({
|
|
1780
|
+
name: "review",
|
|
1781
|
+
extends: voidTheme,
|
|
1782
|
+
font: FONT,
|
|
1783
|
+
tokens: {
|
|
1784
|
+
dark: {
|
|
1785
|
+
fill: "#ededed0f",
|
|
1786
|
+
"fill-hover": "#ededed1a",
|
|
1787
|
+
"fill-selected": "#ededed24",
|
|
1788
|
+
"border-subtle": "#ededed47",
|
|
1789
|
+
border: "#ededed4f",
|
|
1790
|
+
"border-strong": "#585858"
|
|
1791
|
+
},
|
|
1792
|
+
light: {
|
|
1793
|
+
"bg-page": "#ffffff",
|
|
1794
|
+
"bg-inset": "#f7f7f7",
|
|
1795
|
+
bg: "#ffffff",
|
|
1796
|
+
"bg-raised": "#ffffff",
|
|
1797
|
+
"bg-overlay": "#ffffff",
|
|
1798
|
+
fill: "#1919190a",
|
|
1799
|
+
"fill-hover": "#19191912",
|
|
1800
|
+
"fill-selected": "#1919191c",
|
|
1801
|
+
"border-subtle": "#19191917",
|
|
1802
|
+
border: "#1919191d",
|
|
1803
|
+
"border-strong": "#dcdcdc"
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1806
|
+
});
|
|
1710
1807
|
// src/core/theme.ts
|
|
1711
1808
|
var property = (k) => k.startsWith("--") ? k : `--k-${k}`;
|
|
1712
1809
|
function presetCss(preset) {
|
|
@@ -1884,7 +1981,7 @@ var problemsPreset = {
|
|
|
1884
1981
|
}
|
|
1885
1982
|
};
|
|
1886
1983
|
// src/themes/index.ts
|
|
1887
|
-
var themes = { knobs, void: voidTheme };
|
|
1984
|
+
var themes = { knobs, void: voidTheme, review: reviewTheme };
|
|
1888
1985
|
export {
|
|
1889
1986
|
APCA_BUDGET,
|
|
1890
1987
|
defineTheme,
|
|
@@ -1892,6 +1989,7 @@ export {
|
|
|
1892
1989
|
labPreset,
|
|
1893
1990
|
presetCss,
|
|
1894
1991
|
problemsPreset,
|
|
1992
|
+
reviewTheme,
|
|
1895
1993
|
themes,
|
|
1896
1994
|
voidTheme
|
|
1897
1995
|
};
|
|
@@ -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";
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { knobs } from "./knobs.js";
|
|
2
|
+
import { reviewTheme } from "./review.js";
|
|
2
3
|
import { voidTheme } from "./void.js";
|
|
3
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";
|
|
4
|
-
export { knobs, voidTheme };
|
|
5
|
+
export { knobs, reviewTheme, voidTheme };
|
|
5
6
|
export type { Appearance } from "../core/appearance.js";
|
|
6
7
|
export type { PublicTokenName, TokenName, TokenProperty } from "../tokens/schema.js";
|
|
7
|
-
/**
|
|
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
|
+
*/
|
|
8
12
|
export declare const themes: {
|
|
9
13
|
readonly knobs: import("./define.js").Theme;
|
|
10
14
|
readonly void: import("./define.js").Theme;
|
|
15
|
+
readonly review: import("./define.js").Theme;
|
|
11
16
|
};
|
|
12
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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const historyCss = "\n:where(.knobs-history,.knobs-history *){box-sizing:border-box}\n.knobs-ui.knobs-history{--hy-gutter:128px;--hy-lane:24px;--hy-bar:16px;--hy-axis:20px;--hy-bandrow:0px;--hy-c:var(--_k-fg-3);\n --hy-fade:linear-gradient(to right,#000 calc(100% - 1.5em),transparent);\n position:relative;display:flex;flex-direction:column;width:100%;min-width:0;outline:none;color:var(--_k-fg);\n font:var(--_k-weight) var(--_k-type-body)/var(--_k-leading-body) var(--_k-font);font-variant-numeric:tabular-nums;font-feature-settings:\"tnum\";\n text-align:left;letter-spacing:normal;-webkit-font-smoothing:antialiased;user-select:none;-webkit-user-select:none}\n.knobs-history[data-bands]{--hy-bandrow:var(--_k-leading-small)}\n.knobs-history[data-narrow]{--hy-gutter:0px}\n.knobs-history [hidden]{display:none!important}\n:where(.knobs-ui) :is(.knobs-hy-ev,.knobs-hy-span,.knobs-hy-jump,.knobs-hy-more){all:revert;box-sizing:border-box;font:inherit;color:inherit;letter-spacing:inherit;\n background:transparent;border:0;border-radius:0;margin:0;padding:0;min-width:0;box-shadow:none;outline:none}\n.knobs-history [data-tone=\"good\"]{--hy-c:var(--_k-ok)}\n.knobs-history [data-tone=\"warn\"]{--hy-c:var(--_k-warn)}\n.knobs-history [data-tone=\"bad\"]{--hy-c:var(--_k-danger)}\n.knobs-history [data-tone=\"info\"]{--hy-c:var(--_k-info)}\n.knobs-history [data-tone=\"dim\"]{--hy-c:var(--_k-fg-3)}\n\n/* \u2014\u2014\u2014 the chart: lane labels beside the plot (above each lane where it's narrow) \u2014\u2014\u2014 */\n.knobs-hy-chart{position:relative;display:grid;grid-template-columns:var(--hy-gutter) minmax(0,1fr)}\n.knobs-hy-axis{position:relative;grid-column:2;grid-row:1;height:calc(var(--hy-bandrow) + var(--hy-axis))}\n:is(.knobs-hy-tick,.knobs-hy-now,.knobs-hy-blabel){position:absolute;white-space:nowrap;font-size:var(--_k-type-small);line-height:var(--_k-leading-small);color:var(--_k-fg-3)}\n.knobs-hy-tick{bottom:2px;padding-left:4px}\n.knobs-hy-now{bottom:2px;color:var(--_k-accent-fg);font-weight:var(--_k-weight-label)}\n.knobs-hy-blabel{top:0;padding-left:4px;overflow:hidden;color:var(--_k-fg-2)}\n.knobs-hy-label{grid-column:1;align-self:center;min-width:0;margin-right:var(--_k-space-title);overflow:hidden;white-space:nowrap;\n font-size:var(--_k-type-small);line-height:var(--_k-leading-small);color:var(--_k-fg-3)}\n.knobs-history[data-narrow] .knobs-hy-label{grid-column:2;align-self:end;margin:0}\n:is(.knobs-hy-label,.knobs-hy-blabel)[data-overflow]{-webkit-mask-image:var(--hy-fade);mask-image:var(--hy-fade)}\n.knobs-hy-track{position:relative;grid-column:2;height:var(--hy-lane)}\n.knobs-hy-layer{position:absolute;inset:0;grid-column:2;grid-row:1/-1;pointer-events:none}\n\n/* Bands and month lines behind the lanes; today, the selection and the pointer's line over them. */\n.knobs-hy-band{position:absolute;top:0;bottom:0;background:color-mix(in oklch,var(--_k-fg) 3.5%,transparent);box-shadow:inset 1px 0 0 var(--_k-border-subtle)}\n:is(.knobs-hy-grid,.knobs-hy-today,.knobs-hy-hover,.knobs-hy-sel){position:absolute;left:0;top:calc(var(--hy-bandrow) + var(--hy-axis));bottom:0;width:1px;margin-left:-.5px}\n.knobs-hy-grid{background:var(--_k-border-subtle)}\n.knobs-hy-today{top:calc(var(--hy-bandrow) + var(--hy-axis) - 4px);background:var(--_k-accent)}\n.knobs-hy-hover{background:color-mix(in oklch,var(--_k-fg) 32%,transparent);opacity:0;transition:opacity calc(var(--_k-hover-out) * 1ms)}\n.knobs-hy-hover[data-on]{opacity:1;transition-duration:calc(var(--_k-hover-in) * 1ms)}\n.knobs-hy-sel{background:var(--_k-fg-2);opacity:0}\n.knobs-hy-sel[data-on]{opacity:.6}\n\n/* Spans: a soft bar in their state's tone, inferred ones hatched; the tag at the end. */\n.knobs-hy-span{position:absolute;top:calc((var(--hy-lane) - var(--hy-bar)) / 2);height:var(--hy-bar);border-radius:var(--_k-radius-sm);cursor:pointer;\n background:color-mix(in oklch,var(--hy-c) 24%,transparent);transition:background calc(var(--_k-hover-out) * 1ms),box-shadow calc(var(--_k-hover-out) * 1ms)}\n.knobs-hy-span[data-inferred]{background:repeating-linear-gradient(135deg,color-mix(in oklch,var(--hy-c) 34%,transparent) 0 2px,color-mix(in oklch,var(--hy-c) 9%,transparent) 2px 6px)}\n.knobs-hy-span[data-hover]{background-color:color-mix(in oklch,var(--hy-c) 34%,transparent);transition-duration:calc(var(--_k-hover-in) * 1ms)}\n.knobs-hy-span[data-selected]{box-shadow:inset 0 0 0 1px var(--hy-c)}\n.knobs-hy-span[data-clip-start]{border-top-left-radius:0;border-bottom-left-radius:0;-webkit-mask-image:linear-gradient(to right,transparent,#000 16px);mask-image:linear-gradient(to right,transparent,#000 16px)}\n.knobs-hy-span[data-clip-end]{border-top-right-radius:0;border-bottom-right-radius:0;-webkit-mask-image:linear-gradient(to left,transparent,#000 16px);mask-image:linear-gradient(to left,transparent,#000 16px)}\n.knobs-hy-tag{position:absolute;top:0;right:6px;font-size:var(--_k-type-small);line-height:var(--hy-bar);white-space:nowrap;pointer-events:none;\n color:color-mix(in oklch,var(--hy-c) 55%,var(--_k-fg))}\n.knobs-hy-tag[data-place=\"after\"]{right:auto;left:calc(100% + 6px)}\n.knobs-hy-tag[data-place=\"none\"]{visibility:hidden}\n\n/* Event marks (their kind named in the tooltip): a dot for a commit, a diamond for a release, a cross for a deletion, a square for a\n channel's switch, a triangle for a finding; inferred ones hollow. */\n.knobs-hy-ev{position:absolute;top:0;width:16px;height:var(--hy-lane);margin-left:-8px;cursor:pointer;--hy-c:var(--_k-fg-2);--hy-s:9px}\n.knobs-hy-ev::before{content:\"\";position:absolute;left:50%;top:50%;width:var(--hy-s);height:var(--hy-s);margin:calc(var(--hy-s) / -2) 0 0 calc(var(--hy-s) / -2);\n border-radius:50%;background:var(--hy-c);transition:scale calc(var(--_k-motion-snappy-ms) * 1ms) var(--_k-motion-snappy)}\n.knobs-hy-ev[data-range]{width:calc(var(--hy-w) + 16px)}\n.knobs-hy-ev[data-range]::before{left:calc(8px - var(--hy-s) / 2);right:calc(8px - var(--hy-s) / 2);width:auto;margin-left:0;border-radius:var(--_k-round)}\n.knobs-hy-ev[data-type=\"release\"]{--hy-s:8px}\n.knobs-hy-ev[data-type=\"release\"]::before{border-radius:1.5px;rotate:45deg}\n.knobs-hy-ev[data-type=\"channel\"]{--hy-s:8px}\n.knobs-hy-ev[data-type=\"channel\"]::before{border-radius:2px}\n.knobs-hy-ev[data-type=\"audit\"]{--hy-s:10px}\n.knobs-hy-ev[data-type=\"audit\"]::before{border-radius:0;clip-path:polygon(50% 4%,100% 92%,0 92%)}\n.knobs-hy-ev[data-type=\"deletion\"]::before{border-radius:0;rotate:45deg;\n background:linear-gradient(var(--hy-c),var(--hy-c)) center/100% 1.75px no-repeat,linear-gradient(var(--hy-c),var(--hy-c)) center/1.75px 100% no-repeat}\n.knobs-hy-ev[data-inferred]:not([data-type=\"audit\"],[data-type=\"deletion\"])::before{background:transparent;box-shadow:inset 0 0 0 1.5px var(--hy-c)}\n.knobs-hy-ev[data-inferred]:is([data-type=\"audit\"],[data-type=\"deletion\"])::before{opacity:.5}\n/* Held-back marks (commits, by default) come up while the pointer is on their lane, and stay with\n \"Show commits\" or while selected. */\n.knobs-hy-ev[data-quiet]{opacity:0;transition:opacity calc(var(--_k-hover-out) * 1ms)}\n.knobs-hy-track:hover .knobs-hy-ev[data-quiet]{opacity:.6;transition-duration:calc(var(--_k-motion-snappy-ms) * 1ms)}\n:is(.knobs-history[data-all] .knobs-hy-ev[data-quiet],.knobs-hy-ev[data-quiet]:is([data-selected],[data-hover])){opacity:1}\n.knobs-hy-ev[data-hover]::before{scale:1.25}\n.knobs-hy-ev[data-selected]::before{scale:1.3}\n.knobs-hy-ev[data-selected]::after{content:\"\";position:absolute;left:50%;top:50%;width:calc(var(--hy-s) + 9px);height:calc(var(--hy-s) + 9px);\n margin:calc((var(--hy-s) + 9px) / -2) 0 0 calc((var(--hy-s) + 9px) / -2);border-radius:50%;box-shadow:0 0 0 1.5px var(--hy-c)}\n.knobs-hy-ev[data-range][data-selected]::after{left:3px;right:3px;width:auto;margin-left:0;border-radius:var(--_k-round)}\n.knobs-history:focus-visible .knobs-hy-ev[data-selected]::after{box-shadow:0 0 0 2px var(--_k-focus)}\n.knobs-history:focus-visible .knobs-hy-span[data-selected]{box-shadow:inset 0 0 0 2px var(--_k-focus)}\n\n/* \u2014\u2014\u2014 under the chart: \"Show commits\", and a legend only when inferred and verified both appear \u2014\u2014\u2014 */\n.knobs-hy-foot{display:flex;flex-wrap:wrap;align-items:center;gap:var(--_k-space-inside) var(--_k-space-title);margin-top:var(--_k-space-sibling);padding-left:var(--hy-gutter);\n font-size:var(--_k-type-small);line-height:var(--_k-leading-small);color:var(--_k-fg-3)}\n.knobs-hy-legend{display:flex;flex-wrap:wrap;gap:var(--_k-space-inside) var(--_k-space-title)}\n.knobs-ui .knobs-hy-more{height:20px;margin-left:-6px;padding:0 6px;border-radius:var(--_k-radius-sm);color:var(--_k-fg-3);cursor:pointer;\n transition:background calc(var(--_k-hover-out) * 1ms),color calc(var(--_k-hover-out) * 1ms)}\n.knobs-ui .knobs-hy-more:is(:hover,:focus-visible){background:var(--_k-fill);color:var(--_k-fg);transition-duration:calc(var(--_k-hover-in) * 1ms)}\n.knobs-hy-key{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}\n.knobs-hy-swatch{flex:none;width:14px;height:8px;border-radius:2px;background:color-mix(in oklch,var(--hy-c) 34%,transparent)}\n.knobs-hy-swatch[data-inferred]{background:repeating-linear-gradient(135deg,color-mix(in oklch,var(--hy-c) 60%,transparent) 0 1.5px,transparent 1.5px 4px)}\n\n/* \u2014\u2014\u2014 the detail: one area under the chart, its height on a spring \u2014\u2014\u2014 */\n.knobs-hy-detail{position:relative;overflow:hidden;user-select:text;-webkit-user-select:text}\n.knobs-hy-detail[data-moving]{-webkit-mask-image:linear-gradient(to bottom,#000 calc(100% - 16px),transparent);mask-image:linear-gradient(to bottom,#000 calc(100% - 16px),transparent)}\n.knobs-hy-dc{padding:var(--_k-space-title) 0 0 var(--hy-gutter);transition:opacity calc(var(--_k-motion-snappy-ms) * 1ms) var(--_k-motion-snappy)}\n.knobs-hy-dc:is([data-enter],[data-leave]){opacity:0}\n.knobs-hy-dc[data-leave]{position:absolute;left:0;right:0;top:0;transition-duration:calc(var(--_k-motion-snappy-ms) * .8ms)}\n.knobs-hy-dmeta{display:flex;flex-wrap:wrap;gap:0 var(--_k-space-sibling);font-size:var(--_k-type-small);line-height:var(--_k-leading-small);color:var(--_k-fg-3)}\n.knobs-hy-dmeta>[data-tone]{color:var(--hy-c)}\n.knobs-hy-dtitle{margin-top:var(--_k-space-inside);font-size:var(--_k-type-body);line-height:var(--_k-leading-body);font-weight:var(--_k-weight-title);color:var(--_k-fg);text-wrap:balance}\n.knobs-hy-dtext{margin:var(--_k-space-inside) 0 0;max-width:68ch;font-size:var(--_k-type-body);line-height:var(--_k-leading-body);color:var(--_k-fg-2);text-wrap:pretty}\n.knobs-hy-dtext code{font:calc(1em - 1px) var(--_k-mono);padding:1px 4px;border-radius:var(--_k-radius-sm);background:var(--_k-fill)}\n.knobs-hy-dfoot{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:var(--_k-space-sibling)}\n.knobs-hy-dfoot:empty{display:none}\n.knobs-hy-evidence{display:inline-flex;align-items:center;height:20px;padding:0 6px;border-radius:var(--_k-radius-sm);background:var(--_k-fill);color:var(--_k-fg-2);\n font:var(--_k-type-small)/1 var(--_k-mono);text-decoration:none;transition:background calc(var(--_k-hover-out) * 1ms),color calc(var(--_k-hover-out) * 1ms)}\na.knobs-hy-evidence:hover{background:var(--_k-fill-hover);color:var(--_k-fg);transition-duration:calc(var(--_k-hover-in) * 1ms)}\n.knobs-ui .knobs-hy-jump{display:inline-flex;align-items:center;gap:4px;height:20px;padding:0 6px 0 8px;border-radius:var(--_k-radius-sm);color:var(--_k-fg-2);cursor:pointer;\n font-size:var(--_k-type-small);transition:background calc(var(--_k-hover-out) * 1ms),color calc(var(--_k-hover-out) * 1ms)}\n.knobs-ui .knobs-hy-jump:is(:hover,:focus-visible){background:var(--_k-fill);color:var(--_k-fg);transition-duration:calc(var(--_k-hover-in) * 1ms)}\n.knobs-hy-jump svg{width:12px;height:12px}\n\n/* \u2014\u2014\u2014 the pointer's tooltip: title, date, one line \u2014\u2014\u2014 */\n.knobs-hy-tip{position:absolute;left:0;top:0;max-width:280px;padding:6px 8px;border-radius:var(--_k-radius-md);background:var(--_k-bg-overlay);\n box-shadow:var(--_k-shadow-overlay),0 0 0 1px var(--_k-border);pointer-events:none;opacity:0;transition:opacity calc(var(--_k-hover-out) * 1ms)}\n.knobs-hy-tip[data-on]{opacity:1;transition-duration:calc(var(--_k-hover-in) * 1ms)}\n.knobs-hy-tt{font-size:var(--_k-type-small);line-height:var(--_k-leading-small);font-weight:var(--_k-weight-label);color:var(--_k-fg);text-wrap:balance}\n:is(.knobs-hy-td,.knobs-hy-tl){font-size:var(--_k-type-small);line-height:var(--_k-leading-small);color:var(--_k-fg-3)}\n.knobs-hy-tl{margin-top:2px;color:var(--_k-fg-2);text-wrap:pretty}\n.knobs-hy-tl:empty{display:none}\n\n@media(prefers-reduced-motion:reduce){\n .knobs-history :where(*,::before,::after){transition-property:opacity,background,color,box-shadow!important}\n .knobs-hy-dc{transition-duration:calc(var(--_k-hover-out) * 1ms)!important}\n}\n";
|
|
1
|
+
export declare const historyCss = "\n:where(.knobs-history,.knobs-history *){box-sizing:border-box}\n.knobs-ui.knobs-history{--hy-gutter:128px;--hy-lane:24px;--hy-bar:16px;--hy-axis:20px;--hy-bandrow:0px;--hy-c:var(--_k-fg-3);\n --hy-fade:linear-gradient(to right,#000 calc(100% - 1.5em),transparent);\n position:relative;display:flex;flex-direction:column;width:100%;min-width:0;outline:none;color:var(--_k-fg);\n font:var(--_k-weight) var(--_k-type-body)/var(--_k-leading-body) var(--_k-font);font-variant-numeric:tabular-nums;font-feature-settings:\"tnum\";\n text-align:left;letter-spacing:normal;-webkit-font-smoothing:antialiased;user-select:none;-webkit-user-select:none}\n.knobs-history[data-bands]{--hy-bandrow:var(--_k-leading-small)}\n.knobs-history[data-narrow]{--hy-gutter:0px}\n.knobs-history [hidden]{display:none!important}\n:where(.knobs-ui) :is(.knobs-hy-ev,.knobs-hy-span,.knobs-hy-jump,.knobs-hy-more){all:revert;box-sizing:border-box;font:inherit;color:inherit;letter-spacing:inherit;\n background:transparent;border:0;border-radius:0;margin:0;padding:0;min-width:0;box-shadow:none;outline:none}\n.knobs-history [data-tone=\"good\"]{--hy-c:var(--_k-ok)}\n.knobs-history [data-tone=\"warn\"]{--hy-c:var(--_k-warn)}\n.knobs-history [data-tone=\"bad\"]{--hy-c:var(--_k-danger)}\n.knobs-history [data-tone=\"info\"]{--hy-c:var(--_k-info)}\n.knobs-history [data-tone=\"dim\"]{--hy-c:var(--_k-fg-3)}\n\n/* \u2014\u2014\u2014 the chart: lane labels beside the plot (above each lane where it's narrow) \u2014\u2014\u2014 */\n.knobs-hy-chart{position:relative;display:grid;grid-template-columns:var(--hy-gutter) minmax(0,1fr)}\n.knobs-hy-axis{position:relative;grid-column:2;grid-row:1;height:calc(var(--hy-bandrow) + var(--hy-axis))}\n:is(.knobs-hy-tick,.knobs-hy-now,.knobs-hy-blabel){position:absolute;white-space:nowrap;font-size:var(--_k-type-small);line-height:var(--_k-leading-small);color:var(--_k-fg-3)}\n.knobs-hy-tick{bottom:2px;padding-left:4px}\n.knobs-hy-now{bottom:2px;color:var(--_k-accent-fg);font-weight:var(--_k-weight-label)}\n.knobs-hy-blabel{top:0;padding-left:4px;overflow:hidden;color:var(--_k-fg-2)}\n.knobs-hy-label{grid-column:1;align-self:center;min-width:0;margin-right:var(--_k-space-title);overflow:hidden;white-space:nowrap;\n font-size:var(--_k-type-small);line-height:var(--_k-leading-small);color:var(--_k-fg-3)}\n.knobs-history[data-narrow] .knobs-hy-label{grid-column:2;align-self:end;margin:0}\n:is(.knobs-hy-label,.knobs-hy-blabel)[data-overflow]{-webkit-mask-image:var(--hy-fade);mask-image:var(--hy-fade)}\n.knobs-hy-track{position:relative;grid-column:2;height:var(--hy-lane)}\n.knobs-hy-layer{position:absolute;inset:0;grid-column:2;grid-row:1/-1;pointer-events:none}\n\n/* Bands and month lines behind the lanes; today, the selection and the pointer's line over them. */\n.knobs-hy-band{position:absolute;top:0;bottom:0;background:var(--_k-fill);box-shadow:inset 1px 0 0 var(--_k-border-subtle)}\n:is(.knobs-hy-grid,.knobs-hy-today,.knobs-hy-hover,.knobs-hy-sel){position:absolute;left:0;top:calc(var(--hy-bandrow) + var(--hy-axis));bottom:0;width:1px;margin-left:-.5px}\n.knobs-hy-grid{background:var(--_k-border-subtle)}\n.knobs-hy-today{top:calc(var(--hy-bandrow) + var(--hy-axis) - 4px);background:var(--_k-accent)}\n.knobs-hy-hover{background:color-mix(in oklch,var(--_k-fg) 32%,transparent);opacity:0;transition:opacity calc(var(--_k-hover-out) * 1ms)}\n.knobs-hy-hover[data-on]{opacity:1;transition-duration:calc(var(--_k-hover-in) * 1ms)}\n.knobs-hy-sel{background:var(--_k-fg-2);opacity:0}\n.knobs-hy-sel[data-on]{opacity:.6}\n\n/* Spans: a soft bar in their state's tone, inferred ones hatched; the tag at the end. */\n.knobs-hy-span{position:absolute;top:calc((var(--hy-lane) - var(--hy-bar)) / 2);height:var(--hy-bar);border-radius:var(--_k-radius-sm);cursor:pointer;\n background:color-mix(in oklch,var(--hy-c) 24%,transparent);transition:background calc(var(--_k-hover-out) * 1ms),box-shadow calc(var(--_k-hover-out) * 1ms)}\n.knobs-hy-span[data-inferred]{background:repeating-linear-gradient(135deg,color-mix(in oklch,var(--hy-c) 34%,transparent) 0 2px,color-mix(in oklch,var(--hy-c) 9%,transparent) 2px 6px)}\n.knobs-hy-span[data-hover]{background-color:color-mix(in oklch,var(--hy-c) 34%,transparent);transition-duration:calc(var(--_k-hover-in) * 1ms)}\n.knobs-hy-span[data-selected]{box-shadow:inset 0 0 0 1px var(--hy-c)}\n.knobs-hy-span[data-clip-start]{border-top-left-radius:0;border-bottom-left-radius:0;-webkit-mask-image:linear-gradient(to right,transparent,#000 16px);mask-image:linear-gradient(to right,transparent,#000 16px)}\n.knobs-hy-span[data-clip-end]{border-top-right-radius:0;border-bottom-right-radius:0;-webkit-mask-image:linear-gradient(to left,transparent,#000 16px);mask-image:linear-gradient(to left,transparent,#000 16px)}\n.knobs-hy-tag{position:absolute;top:0;right:6px;font-size:var(--_k-type-small);line-height:var(--hy-bar);white-space:nowrap;pointer-events:none;\n color:color-mix(in oklch,var(--hy-c) 55%,var(--_k-fg))}\n.knobs-hy-tag[data-place=\"after\"]{right:auto;left:calc(100% + 6px)}\n.knobs-hy-tag[data-place=\"none\"]{visibility:hidden}\n\n/* Event marks (their kind named in the tooltip): a dot for a commit, a diamond for a release, a cross for a deletion, a square for a\n channel's switch, a triangle for a finding; inferred ones hollow. */\n.knobs-hy-ev{position:absolute;top:0;width:16px;height:var(--hy-lane);margin-left:-8px;cursor:pointer;--hy-c:var(--_k-fg-2);--hy-s:9px}\n.knobs-hy-ev::before{content:\"\";position:absolute;left:50%;top:50%;width:var(--hy-s);height:var(--hy-s);margin:calc(var(--hy-s) / -2) 0 0 calc(var(--hy-s) / -2);\n border-radius:50%;background:var(--hy-c);transition:scale calc(var(--_k-motion-snappy-ms) * 1ms) var(--_k-motion-snappy)}\n.knobs-hy-ev[data-range]{width:calc(var(--hy-w) + 16px)}\n.knobs-hy-ev[data-range]::before{left:calc(8px - var(--hy-s) / 2);right:calc(8px - var(--hy-s) / 2);width:auto;margin-left:0;border-radius:var(--_k-round)}\n.knobs-hy-ev[data-type=\"release\"]{--hy-s:8px}\n.knobs-hy-ev[data-type=\"release\"]::before{border-radius:1.5px;rotate:45deg}\n.knobs-hy-ev[data-type=\"channel\"]{--hy-s:8px}\n.knobs-hy-ev[data-type=\"channel\"]::before{border-radius:2px}\n.knobs-hy-ev[data-type=\"audit\"]{--hy-s:10px}\n.knobs-hy-ev[data-type=\"audit\"]::before{border-radius:0;clip-path:polygon(50% 4%,100% 92%,0 92%)}\n.knobs-hy-ev[data-type=\"deletion\"]::before{border-radius:0;rotate:45deg;\n background:linear-gradient(var(--hy-c),var(--hy-c)) center/100% 1.75px no-repeat,linear-gradient(var(--hy-c),var(--hy-c)) center/1.75px 100% no-repeat}\n.knobs-hy-ev[data-inferred]:not([data-type=\"audit\"],[data-type=\"deletion\"])::before{background:transparent;box-shadow:inset 0 0 0 1.5px var(--hy-c)}\n.knobs-hy-ev[data-inferred]:is([data-type=\"audit\"],[data-type=\"deletion\"])::before{opacity:.5}\n/* Held-back marks (commits, by default) come up while the pointer is on their lane, and stay with\n \"Show commits\" or while selected. */\n.knobs-hy-ev[data-quiet]{opacity:0;transition:opacity calc(var(--_k-hover-out) * 1ms)}\n.knobs-hy-track:hover .knobs-hy-ev[data-quiet]{opacity:.6;transition-duration:calc(var(--_k-motion-snappy-ms) * 1ms)}\n:is(.knobs-history[data-all] .knobs-hy-ev[data-quiet],.knobs-hy-ev[data-quiet]:is([data-selected],[data-hover])){opacity:1}\n.knobs-hy-ev[data-hover]::before{scale:1.25}\n.knobs-hy-ev[data-selected]::before{scale:1.3}\n.knobs-hy-ev[data-selected]::after{content:\"\";position:absolute;left:50%;top:50%;width:calc(var(--hy-s) + 9px);height:calc(var(--hy-s) + 9px);\n margin:calc((var(--hy-s) + 9px) / -2) 0 0 calc((var(--hy-s) + 9px) / -2);border-radius:50%;box-shadow:0 0 0 1.5px var(--hy-c)}\n.knobs-hy-ev[data-range][data-selected]::after{left:3px;right:3px;width:auto;margin-left:0;border-radius:var(--_k-round)}\n.knobs-history:focus-visible .knobs-hy-ev[data-selected]::after{box-shadow:0 0 0 2px var(--_k-focus)}\n.knobs-history:focus-visible .knobs-hy-span[data-selected]{box-shadow:inset 0 0 0 2px var(--_k-focus)}\n\n/* \u2014\u2014\u2014 under the chart: \"Show commits\", and a legend only when inferred and verified both appear \u2014\u2014\u2014 */\n.knobs-hy-foot{display:flex;flex-wrap:wrap;align-items:center;gap:var(--_k-space-inside) var(--_k-space-title);margin-top:var(--_k-space-sibling);padding-left:var(--hy-gutter);\n font-size:var(--_k-type-small);line-height:var(--_k-leading-small);color:var(--_k-fg-3)}\n.knobs-hy-legend{display:flex;flex-wrap:wrap;gap:var(--_k-space-inside) var(--_k-space-title)}\n.knobs-ui .knobs-hy-more{height:20px;margin-left:-6px;padding:0 6px;border-radius:var(--_k-radius-sm);color:var(--_k-fg-3);cursor:pointer;\n transition:background calc(var(--_k-hover-out) * 1ms),color calc(var(--_k-hover-out) * 1ms)}\n.knobs-ui .knobs-hy-more:is(:hover,:focus-visible){background:var(--_k-fill);color:var(--_k-fg);transition-duration:calc(var(--_k-hover-in) * 1ms)}\n.knobs-hy-key{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}\n.knobs-hy-swatch{flex:none;width:14px;height:8px;border-radius:2px;background:color-mix(in oklch,var(--hy-c) 34%,transparent)}\n.knobs-hy-swatch[data-inferred]{background:repeating-linear-gradient(135deg,color-mix(in oklch,var(--hy-c) 60%,transparent) 0 1.5px,transparent 1.5px 4px)}\n\n/* \u2014\u2014\u2014 the detail: one area under the chart, its height on a spring \u2014\u2014\u2014 */\n.knobs-hy-detail{position:relative;overflow:hidden;user-select:text;-webkit-user-select:text}\n.knobs-hy-detail[data-moving]{-webkit-mask-image:linear-gradient(to bottom,#000 calc(100% - 16px),transparent);mask-image:linear-gradient(to bottom,#000 calc(100% - 16px),transparent)}\n.knobs-hy-dc{padding:var(--_k-space-title) 0 0 var(--hy-gutter);transition:opacity calc(var(--_k-motion-snappy-ms) * 1ms) var(--_k-motion-snappy)}\n.knobs-hy-dc:is([data-enter],[data-leave]){opacity:0}\n.knobs-hy-dc[data-leave]{position:absolute;left:0;right:0;top:0;transition-duration:calc(var(--_k-motion-snappy-ms) * .8ms)}\n.knobs-hy-dmeta{display:flex;flex-wrap:wrap;gap:0 var(--_k-space-sibling);font-size:var(--_k-type-small);line-height:var(--_k-leading-small);color:var(--_k-fg-3)}\n.knobs-hy-dmeta>[data-tone]{color:var(--hy-c)}\n.knobs-hy-dtitle{margin-top:var(--_k-space-inside);font-size:var(--_k-type-body);line-height:var(--_k-leading-body);font-weight:var(--_k-weight-title);color:var(--_k-fg);text-wrap:balance}\n.knobs-hy-dtext{margin:var(--_k-space-inside) 0 0;max-width:68ch;font-size:var(--_k-type-body);line-height:var(--_k-leading-body);color:var(--_k-fg-2);text-wrap:pretty}\n.knobs-hy-dtext code{font:calc(1em - 1px) var(--_k-mono);padding:1px 4px;border-radius:var(--_k-radius-sm);background:var(--_k-fill)}\n.knobs-hy-dfoot{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:var(--_k-space-sibling)}\n.knobs-hy-dfoot:empty{display:none}\n.knobs-hy-evidence{display:inline-flex;align-items:center;height:20px;padding:0 6px;border-radius:var(--_k-radius-sm);background:var(--_k-fill);color:var(--_k-fg-2);\n font:var(--_k-type-small)/1 var(--_k-mono);text-decoration:none;transition:background calc(var(--_k-hover-out) * 1ms),color calc(var(--_k-hover-out) * 1ms)}\na.knobs-hy-evidence:hover{background:var(--_k-fill-hover);color:var(--_k-fg);transition-duration:calc(var(--_k-hover-in) * 1ms)}\n.knobs-ui .knobs-hy-jump{display:inline-flex;align-items:center;gap:4px;height:20px;padding:0 6px 0 8px;border-radius:var(--_k-radius-sm);color:var(--_k-fg-2);cursor:pointer;\n font-size:var(--_k-type-small);transition:background calc(var(--_k-hover-out) * 1ms),color calc(var(--_k-hover-out) * 1ms)}\n.knobs-ui .knobs-hy-jump:is(:hover,:focus-visible){background:var(--_k-fill);color:var(--_k-fg);transition-duration:calc(var(--_k-hover-in) * 1ms)}\n.knobs-hy-jump svg{width:12px;height:12px}\n\n/* \u2014\u2014\u2014 the pointer's tooltip: title, date, one line \u2014\u2014\u2014 */\n.knobs-hy-tip{position:absolute;left:0;top:0;max-width:280px;padding:6px 8px;border-radius:var(--_k-radius-md);background:var(--_k-bg-overlay);\n box-shadow:var(--_k-shadow-overlay),0 0 0 1px var(--_k-border);pointer-events:none;opacity:0;transition:opacity calc(var(--_k-hover-out) * 1ms)}\n.knobs-hy-tip[data-on]{opacity:1;transition-duration:calc(var(--_k-hover-in) * 1ms)}\n.knobs-hy-tt{font-size:var(--_k-type-small);line-height:var(--_k-leading-small);font-weight:var(--_k-weight-label);color:var(--_k-fg);text-wrap:balance}\n:is(.knobs-hy-td,.knobs-hy-tl){font-size:var(--_k-type-small);line-height:var(--_k-leading-small);color:var(--_k-fg-3)}\n.knobs-hy-tl{margin-top:2px;color:var(--_k-fg-2);text-wrap:pretty}\n.knobs-hy-tl:empty{display:none}\n\n@media(prefers-reduced-motion:reduce){\n .knobs-history :where(*,::before,::after){transition-property:opacity,background,color,box-shadow!important}\n .knobs-hy-dc{transition-duration:calc(var(--_k-hover-out) * 1ms)!important}\n}\n";
|
package/dist/types/ui/index.d.ts
CHANGED
|
@@ -32,5 +32,5 @@ export { diffActivity, flattenActivity, formatDuration, indexActivity, keepSelec
|
|
|
32
32
|
export { optionPicker, type OptionPicker, type OptionPickerOptions, type PickerOption, } from "./picker.js";
|
|
33
33
|
export { claimsDigit, digitPick, keepPick, stepPick } from "./picker-model.js";
|
|
34
34
|
export { tasteTest, walkthrough, type TasteTest, type TasteTestOptions, type Walkthrough, type WalkthroughOptions, } from "./walkthrough.js";
|
|
35
|
-
export { mediaSlot, type MediaSlot, type MediaSlotOptions, type StepLinks, } from "./walkthrough-media.js";
|
|
36
|
-
export { collectFeedback, feedbackMarkdown, inlineMarkdown, plainMarkdown, normalizeWalkthrough, readState as readWalkthroughState, stackLayout, walkthroughProgress, type ContextEvent, type FeedbackItem, type FeedbackNote, type FeedItem, type MediaContext, type NoteContext, type StackLayout, type StackRow, type WalkInk, type WalkNote, type WalkVoice, type WalkthroughQA, type WalkthroughUpdate, type WalkPage, type WalkStep, type WalkthroughChapter, type WalkthroughDoc, type WalkthroughEvidence, type WalkthroughFeedback, type WalkthroughHistoryEvent, type WalkthroughHistoryGroup, type WalkthroughMedia, type WalkthroughMeta, type WalkthroughOption, type WalkthroughSection, type WalkthroughSource, type WalkthroughStackItem, type WalkthroughState, type WalkthroughStatus, type WalkthroughStep, type WalkthroughTableCell, type WalkthroughTableColumn, type WalkthroughTableRow, type WalkthroughTone, type WalkthroughPR, type WalkthroughAnnotation, } from "./walkthrough-model.js";
|
|
35
|
+
export { decision, facts, mediaSlot, type DecisionOptions, type FactsOptions, type MediaSlot, type MediaSlotOptions, type StepLinks, } from "./walkthrough-media.js";
|
|
36
|
+
export { collectFeedback, feedbackMarkdown, inlineMarkdown, plainMarkdown, normalizeWalkthrough, readState as readWalkthroughState, stackLayout, walkthroughProgress, type ContextEvent, type FeedbackItem, type FeedbackNote, type FeedItem, type MediaContext, type NoteContext, type StackLayout, type StackRow, type WalkInk, type WalkNote, type WalkVoice, type WalkthroughQA, type WalkthroughUpdate, type WalkPage, type WalkStep, 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 WalkthroughSection, type WalkthroughSource, type WalkthroughStackItem, type WalkthroughState, type WalkthroughStatus, type WalkthroughStep, type WalkthroughTableCell, type WalkthroughTableColumn, type WalkthroughTableRow, type WalkthroughTone, type WalkthroughPR, type WalkthroughAnnotation, } from "./walkthrough-model.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { UiLook } from "./look.js";
|
|
2
|
+
/**
|
|
3
|
+
* A review piece's look: the theme it's given, else the theme of the knobs element it sits in,
|
|
4
|
+
* else the review theme (quiet, true black, visible hairlines) rather than the panel's glass.
|
|
5
|
+
*/
|
|
6
|
+
export declare function reviewLook<T extends UiLook>(options: T, container?: Element): T;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type WalkFact, type WalkFactGroup } from "./walkthrough-model.js";
|
|
2
|
+
/** Facts as a `<dl>` per group under its heading: terms in a gutter, values beside them. */
|
|
3
|
+
export declare function renderFacts(doc: Document, groups: readonly WalkFactGroup[]): HTMLElement;
|
|
4
|
+
export interface OptionView {
|
|
5
|
+
/** "Option 1". */
|
|
6
|
+
readonly number: string;
|
|
7
|
+
readonly title: string;
|
|
8
|
+
readonly summary?: string;
|
|
9
|
+
readonly recommended: boolean;
|
|
10
|
+
readonly facts?: readonly WalkFact[];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* One option's column: its head (a `div`, or the `button` given for picking), its sentence, then
|
|
14
|
+
* `media(tile)` and its facts.
|
|
15
|
+
*/
|
|
16
|
+
export declare function optionTile(doc: Document, o: OptionView, options?: {
|
|
17
|
+
readonly head?: HTMLElement;
|
|
18
|
+
readonly media?: (tile: HTMLElement) => void;
|
|
19
|
+
}): {
|
|
20
|
+
readonly tile: HTMLElement;
|
|
21
|
+
readonly head: HTMLElement;
|
|
22
|
+
readonly kicker: HTMLElement;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Lays `tiles` out in `root` as columns that fill whole rows, marking each with its column and
|
|
26
|
+
* row for the hairlines, again whenever `root`'s width changes. Returns the cleanup.
|
|
27
|
+
*/
|
|
28
|
+
export declare function layoutOptions(root: HTMLElement, tiles: readonly HTMLElement[]): () => void;
|
|
@@ -23,6 +23,8 @@ export interface SelectionPillOptions {
|
|
|
23
23
|
* of their own keep them unless you restyle them under `.knobs-pick-copy`.
|
|
24
24
|
*/
|
|
25
25
|
color?: string;
|
|
26
|
+
/** The spring it travels on (`SPRINGS.default`, the state spring); 1.4× as long past 400 px. */
|
|
27
|
+
spring?: SpringValue;
|
|
26
28
|
}
|
|
27
29
|
export interface SelectionPill {
|
|
28
30
|
/** The fill. */
|
|
@@ -91,6 +93,7 @@ export declare function planPill(state: {
|
|
|
91
93
|
readonly first?: boolean;
|
|
92
94
|
readonly reduced?: boolean;
|
|
93
95
|
readonly snap?: boolean;
|
|
96
|
+
readonly spring?: SpringValue;
|
|
94
97
|
}): PillPlan;
|
|
95
98
|
/** Whether two boxes overlap. */
|
|
96
99
|
export declare const boxesMeet: (a: PillBox, b: PillBox) => boolean;
|
|
@@ -31,5 +31,28 @@ export interface MediaSlot {
|
|
|
31
31
|
}
|
|
32
32
|
/** Adds the walkthrough's stylesheet once per document. */
|
|
33
33
|
export declare function injectWalkthroughStyles(doc: Document): void;
|
|
34
|
-
export declare function mediaSlot(container: HTMLElement,
|
|
34
|
+
export declare function mediaSlot(container: HTMLElement, given: MediaSlotOptions): MediaSlot;
|
|
35
35
|
export declare const CHECK: string;
|
|
36
|
+
type FactsMedia = Extract<WalkthroughMedia, {
|
|
37
|
+
kind: "facts";
|
|
38
|
+
}>;
|
|
39
|
+
type DecisionMedia = Extract<WalkthroughMedia, {
|
|
40
|
+
kind: "decision";
|
|
41
|
+
}>;
|
|
42
|
+
export interface FactsOptions extends UiLook, Omit<FactsMedia, "kind"> {
|
|
43
|
+
}
|
|
44
|
+
export interface DecisionOptions extends UiLook, Omit<DecisionMedia, "kind">, Pick<MediaSlotOptions, "lazy" | "steps" | "onEvent"> {
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Term → value pairs in an aligned grid: terms small and faint in a fixed gutter, values beside
|
|
48
|
+
* them, code and evidence as small mono chips; groups under a heading, hairlines between. Each
|
|
49
|
+
* term sits over its value where it's narrow. Also a walkthrough's `{ kind: "facts" }`.
|
|
50
|
+
*/
|
|
51
|
+
export declare function facts(container: HTMLElement, options: FactsOptions): MediaSlot;
|
|
52
|
+
/**
|
|
53
|
+
* N ways to go, one recommended: each a title, a sentence, optional media and what changes as
|
|
54
|
+
* facts, side by side where there's room (whole rows only), hairlines between, the recommended one
|
|
55
|
+
* marked by a quiet word. Also a walkthrough's `{ kind: "decision" }`; a step's `options` (Kit
|
|
56
|
+
* picks) look the same.
|
|
57
|
+
*/
|
|
58
|
+
export declare function decision(container: HTMLElement, options: DecisionOptions): MediaSlot;
|