@docentjs/dom 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/themes.js CHANGED
@@ -1,31 +1,35 @@
1
1
  //#region src/themes.ts
2
+ /** The default look, spelled out: ink on paper. */
2
3
  const light = {
3
- background: "#ffffff",
4
- foreground: "#111827",
5
- muted: "#6b7280",
6
- accent: "#2563eb",
7
- accentForeground: "#ffffff"
4
+ background: "oklch(99.4% 0.003 285)",
5
+ foreground: "oklch(23% 0.018 285)",
6
+ muted: "oklch(52% 0.014 285)",
7
+ accent: "oklch(26% 0.02 285)",
8
+ accentForeground: "oklch(98.5% 0.004 285)"
8
9
  };
10
+ /** Opt-in dark surface for dark products. The accent inverts to paper. */
9
11
  const dark = {
10
- background: "#1f2937",
11
- foreground: "#f9fafb",
12
- muted: "#9ca3af",
13
- accent: "#60a5fa",
14
- accentForeground: "#0b1220"
12
+ background: "oklch(24% 0.014 285)",
13
+ foreground: "oklch(95% 0.006 285)",
14
+ muted: "oklch(72% 0.012 285)",
15
+ accent: "oklch(95% 0.006 285)",
16
+ accentForeground: "oklch(22% 0.016 285)",
17
+ overlay: "oklch(12% 0.012 285)",
18
+ overlayOpacity: "0.62"
15
19
  };
16
- /** Flat, borderless, tighter radius. */
20
+ /** Flatter and tighter: smaller radius, lighter shadow, softer scrim. */
17
21
  const minimal = {
18
- radius: "6px",
19
- shadow: "0 1px 3px rgba(0, 0, 0, 0.2)",
20
- overlayOpacity: "0.35"
22
+ radius: "8px",
23
+ shadow: "0 1px 2px oklch(23% 0.02 285 / 0.08), 0 6px 16px -6px oklch(23% 0.02 285 / 0.14)",
24
+ overlayOpacity: "0.36"
21
25
  };
22
- /** Higher contrast for accessibility-first products. */
26
+ /** Maximum legibility for accessibility-first products. */
23
27
  const contrast = {
24
- background: "#000000",
25
- foreground: "#ffffff",
26
- muted: "#d1d5db",
27
- accent: "#ffd400",
28
- accentForeground: "#000000",
28
+ background: "oklch(13% 0.01 285)",
29
+ foreground: "oklch(99% 0.002 285)",
30
+ muted: "oklch(88% 0.008 285)",
31
+ accent: "oklch(90% 0.18 100)",
32
+ accentForeground: "oklch(13% 0.01 285)",
29
33
  overlayOpacity: "0.8"
30
34
  };
31
35
  const presets = {
@@ -1 +1 @@
1
- {"version":3,"file":"themes.js","names":[],"sources":["../src/themes.ts"],"sourcesContent":["/**\n * Built-in theme presets. Import from `@docentjs/dom/themes` so they only\n * ship when used.\n */\n\nimport type { Theme } from '@docentjs/core'\n\nexport const light: Theme = {\n background: '#ffffff',\n foreground: '#111827',\n muted: '#6b7280',\n accent: '#2563eb',\n accentForeground: '#ffffff',\n}\n\nexport const dark: Theme = {\n background: '#1f2937',\n foreground: '#f9fafb',\n muted: '#9ca3af',\n accent: '#60a5fa',\n accentForeground: '#0b1220',\n}\n\n/** Flat, borderless, tighter radius. */\nexport const minimal: Theme = {\n radius: '6px',\n shadow: '0 1px 3px rgba(0, 0, 0, 0.2)',\n overlayOpacity: '0.35',\n}\n\n/** Higher contrast for accessibility-first products. */\nexport const contrast: Theme = {\n background: '#000000',\n foreground: '#ffffff',\n muted: '#d1d5db',\n accent: '#ffd400',\n accentForeground: '#000000',\n overlayOpacity: '0.8',\n}\n\nexport const presets: Record<string, Theme> = { light, dark, minimal, contrast }\n"],"mappings":";AAOA,MAAa,QAAe;CAC1B,YAAY;CACZ,YAAY;CACZ,OAAO;CACP,QAAQ;CACR,kBAAkB;AACpB;AAEA,MAAa,OAAc;CACzB,YAAY;CACZ,YAAY;CACZ,OAAO;CACP,QAAQ;CACR,kBAAkB;AACpB;;AAGA,MAAa,UAAiB;CAC5B,QAAQ;CACR,QAAQ;CACR,gBAAgB;AAClB;;AAGA,MAAa,WAAkB;CAC7B,YAAY;CACZ,YAAY;CACZ,OAAO;CACP,QAAQ;CACR,kBAAkB;CAClB,gBAAgB;AAClB;AAEA,MAAa,UAAiC;CAAE;CAAO;CAAM;CAAS;AAAS"}
1
+ {"version":3,"file":"themes.js","names":[],"sources":["../src/themes.ts"],"sourcesContent":["/**\n * Built-in theme presets. Import from `@docentjs/dom/themes` so they only\n * ship when used. Colors are OKLCH, tinted toward the Docent hue (285).\n */\n\nimport type { Theme } from '@docentjs/core'\n\n/** The default look, spelled out: ink on paper. */\nexport const light: Theme = {\n background: 'oklch(99.4% 0.003 285)',\n foreground: 'oklch(23% 0.018 285)',\n muted: 'oklch(52% 0.014 285)',\n accent: 'oklch(26% 0.02 285)',\n accentForeground: 'oklch(98.5% 0.004 285)',\n}\n\n/** Opt-in dark surface for dark products. The accent inverts to paper. */\nexport const dark: Theme = {\n background: 'oklch(24% 0.014 285)',\n foreground: 'oklch(95% 0.006 285)',\n muted: 'oklch(72% 0.012 285)',\n accent: 'oklch(95% 0.006 285)',\n accentForeground: 'oklch(22% 0.016 285)',\n overlay: 'oklch(12% 0.012 285)',\n overlayOpacity: '0.62',\n}\n\n/** Flatter and tighter: smaller radius, lighter shadow, softer scrim. */\nexport const minimal: Theme = {\n radius: '8px',\n shadow: '0 1px 2px oklch(23% 0.02 285 / 0.08), 0 6px 16px -6px oklch(23% 0.02 285 / 0.14)',\n overlayOpacity: '0.36',\n}\n\n/** Maximum legibility for accessibility-first products. */\nexport const contrast: Theme = {\n background: 'oklch(13% 0.01 285)',\n foreground: 'oklch(99% 0.002 285)',\n muted: 'oklch(88% 0.008 285)',\n accent: 'oklch(90% 0.18 100)',\n accentForeground: 'oklch(13% 0.01 285)',\n overlayOpacity: '0.8',\n}\n\nexport const presets: Record<string, Theme> = { light, dark, minimal, contrast }\n"],"mappings":";;AAQA,MAAa,QAAe;CAC1B,YAAY;CACZ,YAAY;CACZ,OAAO;CACP,QAAQ;CACR,kBAAkB;AACpB;;AAGA,MAAa,OAAc;CACzB,YAAY;CACZ,YAAY;CACZ,OAAO;CACP,QAAQ;CACR,kBAAkB;CAClB,SAAS;CACT,gBAAgB;AAClB;;AAGA,MAAa,UAAiB;CAC5B,QAAQ;CACR,QAAQ;CACR,gBAAgB;AAClB;;AAGA,MAAa,WAAkB;CAC7B,YAAY;CACZ,YAAY;CACZ,OAAO;CACP,QAAQ;CACR,kBAAkB;CAClB,gBAAgB;AAClB;AAEA,MAAa,UAAiC;CAAE;CAAO;CAAM;CAAS;AAAS"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docentjs/dom",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "Web renderer for Docent: overlay, spotlight, popover, positioning.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -56,7 +56,7 @@
56
56
  "access": "public"
57
57
  },
58
58
  "dependencies": {
59
- "@docentjs/core": "^0.3.1"
59
+ "@docentjs/core": "^0.4.0"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@types/jsdom": "^30.0.0",