@observablehq/notebook-kit 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/LICENSE +13 -0
  2. package/README.md +7 -0
  3. package/dist/bin/build.d.ts +2 -0
  4. package/dist/bin/build.js +63 -0
  5. package/dist/bin/download.d.ts +2 -0
  6. package/dist/bin/download.js +49 -0
  7. package/dist/bin/notebooks.d.ts +2 -0
  8. package/dist/bin/notebooks.js +33 -0
  9. package/dist/bin/preview.d.ts +2 -0
  10. package/dist/bin/preview.js +48 -0
  11. package/dist/package.json +73 -0
  12. package/dist/src/index.d.ts +5 -0
  13. package/dist/src/index.js +5 -0
  14. package/dist/src/javascript/assignments.d.ts +2 -0
  15. package/dist/src/javascript/assignments.js +37 -0
  16. package/dist/src/javascript/assignments.test.d.ts +1 -0
  17. package/dist/src/javascript/assignments.test.js +33 -0
  18. package/dist/src/javascript/awaits.d.ts +2 -0
  19. package/dist/src/javascript/awaits.js +23 -0
  20. package/dist/src/javascript/awaits.test.d.ts +1 -0
  21. package/dist/src/javascript/awaits.test.js +22 -0
  22. package/dist/src/javascript/declarations.d.ts +2 -0
  23. package/dist/src/javascript/declarations.js +45 -0
  24. package/dist/src/javascript/files.d.ts +3 -0
  25. package/dist/src/javascript/files.js +18 -0
  26. package/dist/src/javascript/globals.d.ts +1 -0
  27. package/dist/src/javascript/globals.js +86 -0
  28. package/dist/src/javascript/imports/jsr.d.ts +2 -0
  29. package/dist/src/javascript/imports/jsr.js +6 -0
  30. package/dist/src/javascript/imports/npm.d.ts +2 -0
  31. package/dist/src/javascript/imports/npm.js +47 -0
  32. package/dist/src/javascript/imports/npm.test.d.ts +1 -0
  33. package/dist/src/javascript/imports/npm.test.js +32 -0
  34. package/dist/src/javascript/imports/observable.d.ts +8 -0
  35. package/dist/src/javascript/imports/observable.js +64 -0
  36. package/dist/src/javascript/imports/observable.test.d.ts +1 -0
  37. package/dist/src/javascript/imports/observable.test.js +13 -0
  38. package/dist/src/javascript/imports.d.ts +21 -0
  39. package/dist/src/javascript/imports.js +146 -0
  40. package/dist/src/javascript/observable.d.ts +2 -0
  41. package/dist/src/javascript/observable.js +72 -0
  42. package/dist/src/javascript/parse.d.ts +11 -0
  43. package/dist/src/javascript/parse.js +53 -0
  44. package/dist/src/javascript/references.d.ts +8 -0
  45. package/dist/src/javascript/references.js +129 -0
  46. package/dist/src/javascript/references.test.d.ts +1 -0
  47. package/dist/src/javascript/references.test.js +38 -0
  48. package/dist/src/javascript/sourcemap.d.ts +21 -0
  49. package/dist/src/javascript/sourcemap.js +143 -0
  50. package/dist/src/javascript/sourcemap.test.d.ts +1 -0
  51. package/dist/src/javascript/sourcemap.test.js +88 -0
  52. package/dist/src/javascript/strings.d.ts +8 -0
  53. package/dist/src/javascript/strings.js +42 -0
  54. package/dist/src/javascript/strings.test.d.ts +1 -0
  55. package/dist/src/javascript/strings.test.js +31 -0
  56. package/dist/src/javascript/syntaxError.d.ts +2 -0
  57. package/dist/src/javascript/syntaxError.js +5 -0
  58. package/dist/src/javascript/template.d.ts +3 -0
  59. package/dist/src/javascript/template.js +141 -0
  60. package/dist/src/javascript/template.test.d.ts +1 -0
  61. package/dist/src/javascript/template.test.js +32 -0
  62. package/dist/src/javascript/transpile.d.ts +25 -0
  63. package/dist/src/javascript/transpile.js +42 -0
  64. package/dist/src/javascript/transpile.test.d.ts +1 -0
  65. package/dist/src/javascript/transpile.test.js +29 -0
  66. package/dist/src/javascript/walk.d.ts +5 -0
  67. package/dist/src/javascript/walk.js +13 -0
  68. package/dist/src/lib/notebook.d.ts +35 -0
  69. package/dist/src/lib/notebook.js +19 -0
  70. package/dist/src/lib/notebook.test.d.ts +1 -0
  71. package/dist/src/lib/notebook.test.js +26 -0
  72. package/dist/src/lib/serialize.d.ts +5 -0
  73. package/dist/src/lib/serialize.js +97 -0
  74. package/dist/src/lib/serialize.test.d.ts +1 -0
  75. package/dist/src/lib/serialize.test.js +125 -0
  76. package/dist/src/lib/text.d.ts +1 -0
  77. package/dist/src/lib/text.js +3 -0
  78. package/dist/src/runtime/define.d.ts +28 -0
  79. package/dist/src/runtime/define.js +62 -0
  80. package/dist/src/runtime/display.d.ts +16 -0
  81. package/dist/src/runtime/display.js +60 -0
  82. package/dist/src/runtime/index.d.ts +11 -0
  83. package/dist/src/runtime/index.js +14 -0
  84. package/dist/src/runtime/inspect.d.ts +3 -0
  85. package/dist/src/runtime/inspect.js +43 -0
  86. package/dist/src/runtime/stdlib/assets.d.ts +4 -0
  87. package/dist/src/runtime/stdlib/assets.js +110 -0
  88. package/dist/src/runtime/stdlib/assets.test.d.ts +1 -0
  89. package/dist/src/runtime/stdlib/assets.test.js +78 -0
  90. package/dist/src/runtime/stdlib/dom/canvas.d.ts +1 -0
  91. package/dist/src/runtime/stdlib/dom/canvas.js +6 -0
  92. package/dist/src/runtime/stdlib/dom/context2d.d.ts +1 -0
  93. package/dist/src/runtime/stdlib/dom/context2d.js +9 -0
  94. package/dist/src/runtime/stdlib/dom/index.d.ts +5 -0
  95. package/dist/src/runtime/stdlib/dom/index.js +5 -0
  96. package/dist/src/runtime/stdlib/dom/svg.d.ts +1 -0
  97. package/dist/src/runtime/stdlib/dom/svg.js +7 -0
  98. package/dist/src/runtime/stdlib/dom/text.d.ts +1 -0
  99. package/dist/src/runtime/stdlib/dom/text.js +3 -0
  100. package/dist/src/runtime/stdlib/dom/uid.d.ts +8 -0
  101. package/dist/src/runtime/stdlib/dom/uid.js +25 -0
  102. package/dist/src/runtime/stdlib/dot.d.ts +2 -0
  103. package/dist/src/runtime/stdlib/dot.js +34 -0
  104. package/dist/src/runtime/stdlib/duckdb.d.ts +24 -0
  105. package/dist/src/runtime/stdlib/duckdb.js +379 -0
  106. package/dist/src/runtime/stdlib/fileAttachment.d.ts +71 -0
  107. package/dist/src/runtime/stdlib/fileAttachment.js +199 -0
  108. package/dist/src/runtime/stdlib/generators/index.d.ts +5 -0
  109. package/dist/src/runtime/stdlib/generators/index.js +5 -0
  110. package/dist/src/runtime/stdlib/generators/input.d.ts +1 -0
  111. package/dist/src/runtime/stdlib/generators/input.js +45 -0
  112. package/dist/src/runtime/stdlib/generators/now.d.ts +1 -0
  113. package/dist/src/runtime/stdlib/generators/now.js +5 -0
  114. package/dist/src/runtime/stdlib/generators/observe.d.ts +1 -0
  115. package/dist/src/runtime/stdlib/generators/observe.js +31 -0
  116. package/dist/src/runtime/stdlib/generators/queue.d.ts +1 -0
  117. package/dist/src/runtime/stdlib/generators/queue.js +27 -0
  118. package/dist/src/runtime/stdlib/generators/width.d.ts +1 -0
  119. package/dist/src/runtime/stdlib/generators/width.js +13 -0
  120. package/dist/src/runtime/stdlib/highlight.d.ts +2 -0
  121. package/dist/src/runtime/stdlib/highlight.js +76 -0
  122. package/dist/src/runtime/stdlib/index.d.ts +56 -0
  123. package/dist/src/runtime/stdlib/index.js +23 -0
  124. package/dist/src/runtime/stdlib/inputs.css +15 -0
  125. package/dist/src/runtime/stdlib/inputs.d.ts +2 -0
  126. package/dist/src/runtime/stdlib/inputs.js +2 -0
  127. package/dist/src/runtime/stdlib/leaflet.d.ts +1 -0
  128. package/dist/src/runtime/stdlib/leaflet.js +7 -0
  129. package/dist/src/runtime/stdlib/mapboxgl.d.ts +1 -0
  130. package/dist/src/runtime/stdlib/mapboxgl.js +5 -0
  131. package/dist/src/runtime/stdlib/md.d.ts +5 -0
  132. package/dist/src/runtime/stdlib/md.js +72 -0
  133. package/dist/src/runtime/stdlib/mermaid.d.ts +2 -0
  134. package/dist/src/runtime/stdlib/mermaid.js +11 -0
  135. package/dist/src/runtime/stdlib/mutable.d.ts +8 -0
  136. package/dist/src/runtime/stdlib/mutable.js +30 -0
  137. package/dist/src/runtime/stdlib/observer.d.ts +16 -0
  138. package/dist/src/runtime/stdlib/observer.js +42 -0
  139. package/dist/src/runtime/stdlib/recommendedLibraries.d.ts +25 -0
  140. package/dist/src/runtime/stdlib/recommendedLibraries.js +26 -0
  141. package/dist/src/runtime/stdlib/require.d.ts +4 -0
  142. package/dist/src/runtime/stdlib/require.js +40 -0
  143. package/dist/src/runtime/stdlib/sampleDatasets.d.ts +12 -0
  144. package/dist/src/runtime/stdlib/sampleDatasets.js +31 -0
  145. package/dist/src/runtime/stdlib/sql.d.ts +5 -0
  146. package/dist/src/runtime/stdlib/sql.js +5 -0
  147. package/dist/src/runtime/stdlib/template.d.ts +7 -0
  148. package/dist/src/runtime/stdlib/template.js +2 -0
  149. package/dist/src/runtime/stdlib/tex.d.ts +7 -0
  150. package/dist/src/runtime/stdlib/tex.js +18 -0
  151. package/dist/src/runtime/stdlib/vega-lite.d.ts +1 -0
  152. package/dist/src/runtime/stdlib/vega-lite.js +4 -0
  153. package/dist/src/styles/abstract-dark.css +14 -0
  154. package/dist/src/styles/abstract-light.css +14 -0
  155. package/dist/src/styles/global.css +266 -0
  156. package/dist/src/styles/highlight.css +47 -0
  157. package/dist/src/styles/index.css +14 -0
  158. package/dist/src/styles/inspector.css +89 -0
  159. package/dist/src/styles/plot.css +7 -0
  160. package/dist/src/styles/syntax-dark.css +12 -0
  161. package/dist/src/styles/syntax-light.css +12 -0
  162. package/dist/src/styles/theme-air.css +7 -0
  163. package/dist/src/styles/theme-coffee.css +7 -0
  164. package/dist/src/styles/theme-cotton.css +7 -0
  165. package/dist/src/styles/theme-deep-space.css +16 -0
  166. package/dist/src/styles/theme-glacier.css +7 -0
  167. package/dist/src/styles/theme-ink.css +7 -0
  168. package/dist/src/styles/theme-midnight.css +7 -0
  169. package/dist/src/styles/theme-near-midnight.css +7 -0
  170. package/dist/src/styles/theme-ocean-floor.css +7 -0
  171. package/dist/src/styles/theme-parchment.css +7 -0
  172. package/dist/src/styles/theme-slate.css +7 -0
  173. package/dist/src/styles/theme-stark.css +16 -0
  174. package/dist/src/styles/theme-sun-faded.css +7 -0
  175. package/dist/src/templates/default.html +31 -0
  176. package/dist/src/vite/config.d.ts +2 -0
  177. package/dist/src/vite/config.js +30 -0
  178. package/dist/src/vite/index.d.ts +2 -0
  179. package/dist/src/vite/index.js +2 -0
  180. package/dist/src/vite/observable.d.ts +12 -0
  181. package/dist/src/vite/observable.js +176 -0
  182. package/package.json +73 -0
@@ -0,0 +1,12 @@
1
+ export declare const aapl: () => Promise<any>;
2
+ export declare const alphabet: () => Promise<any>;
3
+ export declare const cars: () => Promise<any>;
4
+ export declare const citywages: () => Promise<any>;
5
+ export declare const diamonds: () => Promise<any>;
6
+ export declare const flare: () => Promise<any>;
7
+ export declare const industries: () => Promise<any>;
8
+ export declare const miserables: () => Promise<any>;
9
+ export declare const olympians: () => Promise<any>;
10
+ export declare const penguins: () => Promise<any>;
11
+ export declare const pizza: () => Promise<any>;
12
+ export declare const weather: () => Promise<any>;
@@ -0,0 +1,31 @@
1
+ export const aapl = () => csv(dataset("aapl.csv"), true);
2
+ export const alphabet = () => csv(dataset("alphabet.csv"), true);
3
+ export const cars = () => csv(dataset("cars.csv"), true);
4
+ export const citywages = () => csv(dataset("citywages.csv"), true);
5
+ export const diamonds = () => csv(dataset("diamonds.csv"), true);
6
+ export const flare = () => csv(dataset("flare.csv"), true);
7
+ export const industries = () => csv(dataset("industries.csv"), true);
8
+ export const miserables = () => json(dataset("miserables.json"));
9
+ export const olympians = () => csv(dataset("olympians.csv"), true);
10
+ export const penguins = () => csv(dataset("penguins.csv"), true);
11
+ export const pizza = () => csv(dataset("pizza.csv"), true);
12
+ export const weather = () => csv(dataset("weather.csv"), true);
13
+ function dataset(name) {
14
+ return `https://cdn.jsdelivr.net/npm/@observablehq/sample-datasets/${name}`;
15
+ }
16
+ async function json(url) {
17
+ const response = await fetch(url);
18
+ if (!response.ok)
19
+ throw new Error(`unable to fetch ${url}: status ${response.status}`);
20
+ return response.json();
21
+ }
22
+ async function text(url) {
23
+ const response = await fetch(url);
24
+ if (!response.ok)
25
+ throw new Error(`unable to fetch ${url}: status ${response.status}`);
26
+ return response.text();
27
+ }
28
+ async function csv(url, typed) {
29
+ const [contents, d3] = await Promise.all([text(url), import("npm:d3-dsv")]);
30
+ return d3.csvParse(contents, typed && d3.autoType);
31
+ }
@@ -0,0 +1,5 @@
1
+ type Template = (template: TemplateStringsArray, ...values: unknown[]) => Promise<unknown>;
2
+ export declare function __sql(db: {
3
+ sql: Template;
4
+ }, render: (data: unknown) => unknown): Template;
5
+ export {};
@@ -0,0 +1,5 @@
1
+ export function __sql(db, render) {
2
+ return (template, ...values) => {
3
+ return db.sql.call(db, template, ...values).then(render);
4
+ };
5
+ }
@@ -0,0 +1,7 @@
1
+ export type TemplateRenderer<T = Node> = (template: readonly string[], ...values: any[]) => T;
2
+ export type RawTemplateRenderer<T = Node> = (template: {
3
+ raw: readonly string[];
4
+ }, ...values: any[]) => T;
5
+ export type AsyncRawTemplateRenderer<T = Node> = (template: {
6
+ raw: readonly string[];
7
+ }, ...values: any[]) => Promise<T>;
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { RawTemplateRenderer } from "./template.js";
2
+ export declare const tex: RawTemplateRenderer & {
3
+ options: typeof renderer;
4
+ block: RawTemplateRenderer;
5
+ };
6
+ declare function renderer(options?: any): RawTemplateRenderer;
7
+ export {};
@@ -0,0 +1,18 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import katex from "npm:katex";
3
+ const link = document.createElement("link");
4
+ link.href = "https://cdn.jsdelivr.net/npm/katex/dist/katex.min.css";
5
+ link.rel = "stylesheet";
6
+ document.head.appendChild(link);
7
+ export const tex = Object.assign(renderer(), {
8
+ options: renderer,
9
+ block: renderer({ displayMode: true })
10
+ });
11
+ function renderer(options) {
12
+ return function (template, ...values) {
13
+ const source = String.raw.call(String, template, ...values);
14
+ const root = document.createElement("div");
15
+ katex.render(source, root, { ...options, output: "html" });
16
+ return root.removeChild(root.firstChild);
17
+ };
18
+ }
@@ -0,0 +1 @@
1
+ export declare const vl: any;
@@ -0,0 +1,4 @@
1
+ import * as vega from "npm:vega";
2
+ import * as vegaLite from "npm:vega-lite";
3
+ import * as vegaLiteApi from "npm:vega-lite-api";
4
+ export const vl = vegaLiteApi.register(vega, vegaLite);
@@ -0,0 +1,14 @@
1
+ @import url("./syntax-dark.css");
2
+
3
+ :root {
4
+ --theme-background-a: color-mix(in srgb, var(--theme-foreground) 4%, var(--theme-background-b));
5
+ --theme-background: var(--theme-background-a);
6
+ --theme-background-alt: var(--theme-background-b);
7
+ --theme-foreground-alt: color-mix(in srgb, var(--theme-foreground) 90%, var(--theme-background-b));
8
+ --theme-foreground-muted: color-mix(in srgb, var(--theme-foreground) 60%, var(--theme-background-b));
9
+ --theme-foreground-faint: color-mix(in srgb, var(--theme-foreground) 50%, var(--theme-background-b));
10
+ --theme-foreground-fainter: color-mix(in srgb, var(--theme-foreground) 30%, var(--theme-background-b));
11
+ --theme-foreground-faintest: color-mix(in srgb, var(--theme-foreground) 14%, var(--theme-background-b));
12
+ --theme-error: #e7040f;
13
+ color-scheme: dark;
14
+ }
@@ -0,0 +1,14 @@
1
+ @import url("./syntax-light.css");
2
+
3
+ :root {
4
+ --theme-background-b: color-mix(in srgb, var(--theme-foreground) 4%, var(--theme-background-a));
5
+ --theme-background: var(--theme-background-a);
6
+ --theme-background-alt: var(--theme-background-b);
7
+ --theme-foreground-alt: color-mix(in srgb, var(--theme-foreground) 90%, var(--theme-background-a));
8
+ --theme-foreground-muted: color-mix(in srgb, var(--theme-foreground) 60%, var(--theme-background-a));
9
+ --theme-foreground-faint: color-mix(in srgb, var(--theme-foreground) 50%, var(--theme-background-a));
10
+ --theme-foreground-fainter: color-mix(in srgb, var(--theme-foreground) 30%, var(--theme-background-a));
11
+ --theme-foreground-faintest: color-mix(in srgb, var(--theme-foreground) 14%, var(--theme-background-a));
12
+ --theme-error: #e7040f;
13
+ color-scheme: light;
14
+ }
@@ -0,0 +1,266 @@
1
+ :root {
2
+ --serif:
3
+ "Source Serif 4", "Iowan Old Style", "Apple Garamond", "Palatino Linotype", "Times New Roman",
4
+ "Droid Serif", Times, serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
5
+ --sans-serif:
6
+ "Inter", -apple-system, BlinkMacSystemFont, "avenir next", avenir, helvetica, "helvetica neue",
7
+ ubuntu, roboto, noto, "segoe ui", arial, sans-serif;
8
+ --monospace: "Spline Sans Mono", Menlo, Consolas, monospace;
9
+ --monospace-font: 14px/1.5 var(--monospace);
10
+ --max-width: calc(1024px - 4 * 16px); /* max-w-5xl p-4 */
11
+ }
12
+
13
+ html {
14
+ font: 17px/1.5 var(--serif);
15
+ -webkit-text-size-adjust: 100%;
16
+ -webkit-font-smoothing: antialiased;
17
+ -moz-osx-font-smoothing: grayscale;
18
+ background: var(--theme-background);
19
+ color: var(--theme-foreground);
20
+ margin-top: 16px;
21
+ padding: 16px 24px;
22
+ }
23
+
24
+ body {
25
+ margin: auto;
26
+ max-width: var(--max-width);
27
+ }
28
+
29
+ h1,
30
+ h2,
31
+ h3,
32
+ h4,
33
+ h5,
34
+ h6 {
35
+ color: var(--theme-foreground-alt);
36
+ font-weight: 700;
37
+ line-height: 1.15;
38
+ margin-top: 0;
39
+ margin-bottom: 0.25rem;
40
+ text-wrap: balance;
41
+ }
42
+
43
+ h2 + p,
44
+ h3 + p,
45
+ h4 + p,
46
+ h2 + table,
47
+ h3 + table,
48
+ h4 + table {
49
+ margin-top: 0;
50
+ }
51
+
52
+ .observablehq:first-of-type h1 + h2 {
53
+ color: var(--theme-foreground);
54
+ font-size: 20px;
55
+ font-style: italic;
56
+ font-weight: normal;
57
+ margin-bottom: 1rem; /* see h2 ~ p */
58
+ }
59
+
60
+ a[href] {
61
+ color: var(--theme-foreground-focus);
62
+ text-decoration: none;
63
+ }
64
+
65
+ a[href]:hover,
66
+ a[href]:focus {
67
+ text-decoration: underline;
68
+ }
69
+
70
+ pre,
71
+ code,
72
+ tt {
73
+ font-family: var(--monospace);
74
+ font-size: 82.35294117%; /* from 17px to 14px */
75
+ }
76
+
77
+ pre code,
78
+ figcaption code {
79
+ font-size: inherit;
80
+ }
81
+
82
+ pre[data-language] {
83
+ position: relative;
84
+ }
85
+
86
+ pre[data-language]::before {
87
+ content: attr(data-language);
88
+ float: right;
89
+ margin: -4px -8px -4px -4px;
90
+ padding: 4px;
91
+ font-size: 12px;
92
+ line-height: 21px;
93
+ color: var(--theme-foreground-muted);
94
+ }
95
+
96
+ h1 code,
97
+ h2 code,
98
+ h3 code,
99
+ h4 code,
100
+ h5 code,
101
+ h6 code {
102
+ font-size: 88.235294117%; /* from 17px to 15px */
103
+ }
104
+
105
+ h2[id] a[href],
106
+ h3[id] a[href] {
107
+ color: inherit;
108
+ }
109
+
110
+ pre {
111
+ line-height: 1.5;
112
+ }
113
+
114
+ img {
115
+ max-width: 100%;
116
+ }
117
+
118
+ p,
119
+ table,
120
+ figure,
121
+ figcaption,
122
+ h1,
123
+ h2,
124
+ h3,
125
+ h4,
126
+ h5,
127
+ h6,
128
+ .katex-display {
129
+ max-width: 640px;
130
+ }
131
+
132
+ blockquote,
133
+ ol,
134
+ ul {
135
+ max-width: 600px;
136
+ }
137
+
138
+ blockquote {
139
+ margin: 1rem 1.5rem;
140
+ }
141
+
142
+ ul,
143
+ ol {
144
+ padding-left: 28px;
145
+ }
146
+
147
+ hr {
148
+ height: 1px;
149
+ margin: 1rem 0;
150
+ padding: 1rem 0;
151
+ border: none;
152
+ background: no-repeat center/100% 1px
153
+ linear-gradient(to right, var(--theme-foreground-faintest), var(--theme-foreground-faintest));
154
+ }
155
+
156
+ pre {
157
+ background-color: var(--theme-background-alt);
158
+ border-radius: 4px;
159
+ margin: 1rem -1rem;
160
+ /* max-width: 960px; */
161
+ min-height: 1.5em;
162
+ padding: 4px 1rem;
163
+ overflow-x: auto;
164
+ box-sizing: border-box;
165
+ white-space: pre-wrap;
166
+ }
167
+
168
+ input:not([type]),
169
+ input[type="email"],
170
+ input[type="number"],
171
+ input[type="password"],
172
+ input[type="range"],
173
+ input[type="search"],
174
+ input[type="tel"],
175
+ input[type="text"],
176
+ input[type="url"] {
177
+ width: 240px;
178
+ }
179
+
180
+ input,
181
+ canvas,
182
+ button {
183
+ vertical-align: middle;
184
+ }
185
+
186
+ button,
187
+ input,
188
+ textarea {
189
+ accent-color: var(--theme-foreground-focus);
190
+ }
191
+
192
+ table {
193
+ width: 100%;
194
+ border-collapse: collapse;
195
+ font: 13px/1.2 var(--sans-serif);
196
+ }
197
+
198
+ table pre,
199
+ table code,
200
+ table tt {
201
+ font-size: inherit;
202
+ line-height: inherit;
203
+ }
204
+
205
+ th > pre:only-child,
206
+ td > pre:only-child {
207
+ margin: 0;
208
+ padding: 0;
209
+ }
210
+
211
+ th {
212
+ color: var(--theme-foreground);
213
+ text-align: left;
214
+ vertical-align: bottom;
215
+ }
216
+
217
+ td {
218
+ color: var(--theme-foreground-alt);
219
+ vertical-align: top;
220
+ }
221
+
222
+ th,
223
+ td {
224
+ padding: 3px 6.5px 3px 0;
225
+ }
226
+
227
+ th:last-child,
228
+ td:last-child {
229
+ padding-right: 0;
230
+ }
231
+
232
+ tr:not(:last-child) {
233
+ border-bottom: solid 1px var(--theme-foreground-faintest);
234
+ }
235
+
236
+ thead tr {
237
+ border-bottom: solid 1px var(--theme-foreground-fainter);
238
+ }
239
+
240
+ figure,
241
+ table {
242
+ margin: 1rem 0;
243
+ }
244
+
245
+ figure img {
246
+ max-width: 100%;
247
+ }
248
+
249
+ figure > h2,
250
+ figure > h3 {
251
+ font-family: var(--sans-serif);
252
+ }
253
+
254
+ figure > h2 {
255
+ font-size: 20px;
256
+ }
257
+
258
+ figure > h3 {
259
+ font-size: 16px;
260
+ font-weight: normal;
261
+ }
262
+
263
+ figcaption {
264
+ font: small var(--sans-serif);
265
+ color: var(--theme-foreground-muted);
266
+ }
@@ -0,0 +1,47 @@
1
+ .tok-link {
2
+ color: var(--syntax-link);
3
+ }
4
+
5
+ .tok-strong {
6
+ font-weight: 600;
7
+ }
8
+
9
+ .tok-emphasis {
10
+ font-style: italic;
11
+ }
12
+
13
+ .tok-keyword {
14
+ color: var(--syntax-keyword);
15
+ }
16
+
17
+ .tok-atom {
18
+ color: var(--syntax-atom);
19
+ }
20
+
21
+ .tok-literal {
22
+ color: var(--syntax-literal);
23
+ }
24
+
25
+ .tok-string {
26
+ color: var(--syntax-string);
27
+ }
28
+
29
+ .tok-comment {
30
+ color: var(--syntax-comment);
31
+ }
32
+
33
+ .tok-invalid {
34
+ color: var(--syntax-invalid);
35
+ }
36
+
37
+ .tok-variable {
38
+ color: var(--syntax-variable);
39
+ }
40
+
41
+ .tok-definition {
42
+ color: var(--syntax-definition);
43
+ }
44
+
45
+ .tok-meta {
46
+ color: var(--syntax-meta);
47
+ }
@@ -0,0 +1,14 @@
1
+ /* Copyright 2025 Observable, Inc. */
2
+
3
+ @import url("./global.css");
4
+ @import url("./inspector.css");
5
+ @import url("./highlight.css");
6
+ @import url("./plot.css");
7
+
8
+ .observablehq--cell:empty {
9
+ min-height: 0;
10
+ }
11
+
12
+ .observablehq--cell:not(:empty) + pre {
13
+ margin-top: -11px;
14
+ }
@@ -0,0 +1,89 @@
1
+ .observablehq--collapsed,
2
+ .observablehq--expanded.observablehq--inspect a {
3
+ cursor: pointer;
4
+ }
5
+
6
+ .observablehq--caret {
7
+ margin-right: 4px;
8
+ vertical-align: baseline;
9
+ }
10
+
11
+ .observablehq--field {
12
+ text-indent: -1rem;
13
+ margin-left: 1rem;
14
+ }
15
+
16
+ .observablehq--inspect {
17
+ font: var(--monospace-font);
18
+ overflow-x: auto;
19
+ white-space: pre;
20
+ display: block;
21
+ padding: 2px 0;
22
+ }
23
+
24
+ .observablehq--inspect.observablehq--import {
25
+ white-space: normal;
26
+ }
27
+
28
+ .observablehq--inspect::-webkit-scrollbar {
29
+ display: none;
30
+ }
31
+
32
+ .observablehq--error .observablehq--inspect {
33
+ word-break: break-all;
34
+ white-space: pre-wrap;
35
+ }
36
+
37
+ .observablehq--string-expand {
38
+ margin-left: 6px;
39
+ padding: 2px 6px;
40
+ border-radius: 2px;
41
+ font-size: 80%;
42
+ background: var(--theme-background-alt);
43
+ cursor: pointer;
44
+ vertical-align: middle;
45
+ }
46
+
47
+ .observablehq--keyword {
48
+ color: var(--syntax-keyword);
49
+ }
50
+
51
+ .observablehq--index,
52
+ .observablehq--key {
53
+ color: var(--syntax-definition);
54
+ }
55
+
56
+ .observablehq--symbol,
57
+ .observablehq--regexp,
58
+ .observablehq--string {
59
+ color: var(--syntax-string);
60
+ }
61
+
62
+ .observablehq--null {
63
+ color: var(--syntax-keyword);
64
+ }
65
+
66
+ .observablehq--undefined {
67
+ color: var(--syntax-variable);
68
+ }
69
+
70
+ .observablehq--prototype-key {
71
+ color: var(--syntax-comment);
72
+ }
73
+
74
+ .observablehq--bigint,
75
+ .observablehq--boolean,
76
+ .observablehq--date,
77
+ .observablehq--forbidden,
78
+ .observablehq--number {
79
+ color: var(--syntax-literal);
80
+ }
81
+
82
+ .observablehq--error {
83
+ color: var(--theme-error);
84
+ }
85
+
86
+ .observablehq--cell {
87
+ margin: 17px 0;
88
+ min-height: 1px; /* prevent margin collapse when empty */
89
+ }
@@ -0,0 +1,7 @@
1
+ .plot-d6a7b5 {
2
+ --plot-background: var(--theme-background);
3
+ }
4
+
5
+ p .plot-d6a7b5 {
6
+ display: inline-block;
7
+ }
@@ -0,0 +1,12 @@
1
+ :root {
2
+ --syntax-link: var(--theme-foreground-focus);
3
+ --syntax-keyword: #ffa657;
4
+ --syntax-atom: #a5d6ff;
5
+ --syntax-literal: #d2a8ff;
6
+ --syntax-string: #7ee787;
7
+ --syntax-comment: var(--theme-foreground-muted);
8
+ --syntax-invalid: var(--theme-error);
9
+ --syntax-definition: #79c0ff;
10
+ --syntax-variable: var(--theme-foreground-alt);
11
+ --syntax-meta: #ff7b72;
12
+ }
@@ -0,0 +1,12 @@
1
+ :root {
2
+ --syntax-link: var(--theme-foreground-focus);
3
+ --syntax-keyword: #e36209;
4
+ --syntax-atom: #032f62;
5
+ --syntax-literal: #6f42c1;
6
+ --syntax-string: #22863a;
7
+ --syntax-comment: var(--theme-foreground-muted);
8
+ --syntax-invalid: var(--theme-error);
9
+ --syntax-definition: #005cc5;
10
+ --syntax-variable: var(--theme-foreground-alt);
11
+ --syntax-meta: #d73a49;
12
+ }
@@ -0,0 +1,7 @@
1
+ @import url("./abstract-light.css");
2
+
3
+ :root {
4
+ --theme-foreground: #1b1e23;
5
+ --theme-foreground-focus: #3b5fc0;
6
+ --theme-background-a: #ffffff;
7
+ }
@@ -0,0 +1,7 @@
1
+ @import url("./abstract-dark.css");
2
+
3
+ :root {
4
+ --theme-foreground: #dcd2ca;
5
+ --theme-foreground-focus: #ffc4a3;
6
+ --theme-background-b: #140f0c;
7
+ }
@@ -0,0 +1,7 @@
1
+ @import url("./abstract-light.css");
2
+
3
+ :root {
4
+ --theme-foreground: #473d3a;
5
+ --theme-foreground-focus: #5028c1;
6
+ --theme-background-a: #efeee9;
7
+ }
@@ -0,0 +1,16 @@
1
+ @import url("./syntax-dark.css");
2
+
3
+ :root {
4
+ --theme-foreground: #e6e6e6;
5
+ --theme-foreground-focus: #bd89ff;
6
+ --theme-background-a: #000000;
7
+ --theme-background-b: color-mix(in srgb, var(--theme-foreground) 6%, var(--theme-background-a));
8
+ --theme-background: var(--theme-background-a);
9
+ --theme-background-alt: var(--theme-background-b);
10
+ --theme-foreground-alt: color-mix(in srgb, var(--theme-foreground) 90%, var(--theme-background-a));
11
+ --theme-foreground-muted: color-mix(in srgb, var(--theme-foreground) 60%, var(--theme-background-a));
12
+ --theme-foreground-faint: color-mix(in srgb, var(--theme-foreground) 50%, var(--theme-background-a));
13
+ --theme-foreground-fainter: color-mix(in srgb, var(--theme-foreground) 30%, var(--theme-background-a));
14
+ --theme-foreground-faintest: color-mix(in srgb, var(--theme-foreground) 14%, var(--theme-background-a));
15
+ color-scheme: dark;
16
+ }
@@ -0,0 +1,7 @@
1
+ @import url("./abstract-light.css");
2
+
3
+ :root {
4
+ --theme-foreground: #1c3957;
5
+ --theme-foreground-focus: #d75c48;
6
+ --theme-background-a: #f4faff;
7
+ }
@@ -0,0 +1,7 @@
1
+ @import url("./abstract-dark.css");
2
+
3
+ :root {
4
+ --theme-foreground: #ebebeb;
5
+ --theme-foreground-focus: oklch(0.712564 0.257662 265.758);
6
+ --theme-background-b: #212121;
7
+ }
@@ -0,0 +1,7 @@
1
+ @import url("./abstract-dark.css");
2
+
3
+ :root {
4
+ --theme-foreground: #ebebeb;
5
+ --theme-foreground-focus: oklch(0.712564 0.257662 265.758);
6
+ --theme-background-b: #0d0d0d;
7
+ }
@@ -0,0 +1,7 @@
1
+ @import url("./abstract-dark.css");
2
+
3
+ :root {
4
+ --theme-foreground: #dfdfd6;
5
+ --theme-foreground-focus: oklch(0.712564 0.257662 265.758);
6
+ --theme-background-b: #161616;
7
+ }
@@ -0,0 +1,7 @@
1
+ @import url("./abstract-dark.css");
2
+
3
+ :root {
4
+ --theme-foreground: #dcdcee;
5
+ --theme-foreground-focus: #81a9f6;
6
+ --theme-background-b: #0b0b16;
7
+ }
@@ -0,0 +1,7 @@
1
+ @import url("./abstract-light.css");
2
+
3
+ :root {
4
+ --theme-foreground: #4a413a;
5
+ --theme-foreground-focus: #ad521f;
6
+ --theme-background-a: #f9f0ea;
7
+ }