@adea-ai/ui 0.128.2 → 0.128.4
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/components/theme/appearance-panel.js +1 -1
- package/dist/components/theme/index.js +1 -1
- package/dist/components/theme/lazy.d.ts +15 -0
- package/dist/components/theme/lazy.d.ts.map +1 -0
- package/dist/components/theme/lazy.js +9 -0
- package/dist/components/theme/theme-catalogue-source.d.ts +15 -0
- package/dist/components/theme/theme-catalogue-source.d.ts.map +1 -0
- package/dist/components/theme/theme-catalogue-source.js +51 -0
- package/dist/components/theme/theme-catalogue-source.js.map +1 -0
- package/dist/components/theme/theme-document-core.d.ts +123 -0
- package/dist/components/theme/theme-document-core.d.ts.map +1 -0
- package/dist/components/theme/{theme-document.js → theme-document-core.js} +12 -12
- package/dist/components/theme/theme-document-core.js.map +1 -0
- package/dist/components/theme/theme-document.d.ts +8 -107
- package/dist/components/theme/theme-document.d.ts.map +1 -1
- package/dist/components/theme/theme-persistence.d.ts +1 -1
- package/dist/components/theme/theme-persistence.d.ts.map +1 -1
- package/dist/components/theme/theme-persistence.js +9 -6
- package/dist/components/theme/theme-persistence.js.map +1 -1
- package/dist/components/theme/theme-provider-core.d.ts +19 -0
- package/dist/components/theme/theme-provider-core.d.ts.map +1 -0
- package/dist/components/theme/theme-provider-core.js +28 -0
- package/dist/components/theme/theme-provider-core.js.map +1 -0
- package/dist/components/theme/theme-provider-lazy.d.ts +28 -0
- package/dist/components/theme/theme-provider-lazy.d.ts.map +1 -0
- package/dist/components/theme/theme-provider-lazy.js +36 -0
- package/dist/components/theme/theme-provider-lazy.js.map +1 -0
- package/dist/components/theme/theme-provider-value.d.ts +175 -0
- package/dist/components/theme/theme-provider-value.d.ts.map +1 -0
- package/dist/components/theme/theme-provider-value.js +200 -0
- package/dist/components/theme/theme-provider-value.js.map +1 -0
- package/dist/components/theme/theme-provider.d.ts +11 -136
- package/dist/components/theme/theme-provider.d.ts.map +1 -1
- package/dist/components/theme/theme-provider.js +27 -149
- package/dist/components/theme/theme-provider.js.map +1 -1
- package/dist/components/theme/theme-script.js +4 -3
- package/dist/components/theme/theme-script.js.map +1 -1
- package/dist/components/theme/theme-state-core.d.ts +248 -0
- package/dist/components/theme/theme-state-core.d.ts.map +1 -0
- package/dist/components/theme/{theme-state.js → theme-state-core.js} +8 -7
- package/dist/components/theme/theme-state-core.js.map +1 -0
- package/dist/components/theme/theme-state.d.ts +8 -214
- package/dist/components/theme/theme-state.d.ts.map +1 -1
- package/dist/components/theme/theme-toggle.js.map +1 -1
- package/dist/index.js +8 -4
- package/dist/lib/accent-presets.d.ts +35 -0
- package/dist/lib/accent-presets.d.ts.map +1 -0
- package/dist/lib/accent-presets.js +20 -0
- package/dist/lib/accent-presets.js.map +1 -0
- package/dist/lib/theme-catalogue.d.ts +3 -0
- package/dist/lib/theme-catalogue.d.ts.map +1 -0
- package/dist/lib/theme-catalogue.js +22 -0
- package/dist/lib/theme-catalogue.js.map +1 -0
- package/dist/lib/theme-css.d.ts +43 -0
- package/dist/lib/theme-css.d.ts.map +1 -0
- package/dist/lib/theme-css.js +167 -0
- package/dist/lib/theme-css.js.map +1 -0
- package/dist/lib/theme-defaults.d.ts +46 -0
- package/dist/lib/theme-defaults.d.ts.map +1 -0
- package/dist/lib/theme-defaults.generated.d.ts +13 -0
- package/dist/lib/theme-defaults.generated.d.ts.map +1 -0
- package/dist/lib/theme-defaults.generated.js +318 -0
- package/dist/lib/theme-defaults.generated.js.map +1 -0
- package/dist/lib/theme-defaults.js +47 -0
- package/dist/lib/theme-defaults.js.map +1 -0
- package/dist/lib/theme-engine-light.d.ts +3 -0
- package/dist/lib/theme-engine-light.d.ts.map +1 -0
- package/dist/lib/theme-engine-light.js +75 -0
- package/dist/lib/theme-engine-light.js.map +1 -0
- package/dist/lib/theme-engine.d.ts +69 -0
- package/dist/lib/theme-engine.d.ts.map +1 -0
- package/dist/lib/theme-engine.js +33 -0
- package/dist/lib/theme-engine.js.map +1 -0
- package/dist/lib/theme-records.d.ts +39 -0
- package/dist/lib/theme-records.d.ts.map +1 -0
- package/dist/lib/theme-records.js +178 -0
- package/dist/lib/theme-records.js.map +1 -0
- package/dist/lib/themes.d.ts +16 -60
- package/dist/lib/themes.d.ts.map +1 -1
- package/dist/lib/themes.js +23 -322
- package/dist/lib/themes.js.map +1 -1
- package/dist/lib/tokens.d.ts +1 -25
- package/dist/lib/tokens.d.ts.map +1 -1
- package/dist/lib/tokens.js +1 -24
- package/dist/lib/tokens.js.map +1 -1
- package/dist/r/lib.json +40 -0
- package/dist/r/registry.json +75 -0
- package/dist/r/src/components/theme/lazy.ts +35 -0
- package/dist/r/src/components/theme/theme-catalogue-source.ts +59 -0
- package/dist/r/src/components/theme/theme-document-core.ts +262 -0
- package/dist/r/src/components/theme/theme-document.ts +23 -240
- package/dist/r/src/components/theme/theme-persistence.ts +14 -6
- package/dist/r/src/components/theme/theme-provider-core.tsx +40 -0
- package/dist/r/src/components/theme/theme-provider-lazy.tsx +34 -0
- package/dist/r/src/components/theme/theme-provider-value.ts +445 -0
- package/dist/r/src/components/theme/theme-provider.tsx +23 -346
- package/dist/r/src/components/theme/theme-script.ts +3 -3
- package/dist/r/src/components/theme/theme-state-core.ts +364 -0
- package/dist/r/src/components/theme/theme-state.ts +10 -329
- package/dist/r/src/components/theme/theme-toggle.tsx +1 -1
- package/dist/r/src/lib/accent-presets.ts +54 -0
- package/dist/r/src/lib/theme-catalogue.ts +26 -0
- package/dist/r/src/lib/theme-css.ts +201 -0
- package/dist/r/src/lib/theme-defaults.generated.ts +319 -0
- package/dist/r/src/lib/theme-defaults.ts +79 -0
- package/dist/r/src/lib/theme-engine-light.ts +117 -0
- package/dist/r/src/lib/theme-engine.ts +111 -0
- package/dist/r/src/lib/theme-records.ts +205 -0
- package/dist/r/src/lib/themes.ts +30 -375
- package/dist/r/src/lib/tokens.ts +1 -35
- package/dist/r/theming.json +35 -0
- package/package.json +10 -2
- package/registry.json +75 -0
- package/src/components/theme/lazy.ts +35 -0
- package/src/components/theme/theme-catalogue-source.ts +59 -0
- package/src/components/theme/theme-document-core.ts +262 -0
- package/src/components/theme/theme-document.ts +23 -240
- package/src/components/theme/theme-persistence.ts +14 -6
- package/src/components/theme/theme-provider-core.tsx +40 -0
- package/src/components/theme/theme-provider-lazy.tsx +34 -0
- package/src/components/theme/theme-provider-value.ts +445 -0
- package/src/components/theme/theme-provider.tsx +23 -346
- package/src/components/theme/theme-script.ts +3 -3
- package/src/components/theme/theme-state-core.ts +364 -0
- package/src/components/theme/theme-state.ts +10 -329
- package/src/components/theme/theme-toggle.tsx +1 -1
- package/src/lib/accent-presets.ts +54 -0
- package/src/lib/theme-catalogue.ts +26 -0
- package/src/lib/theme-css.ts +201 -0
- package/src/lib/theme-defaults.generated.ts +319 -0
- package/src/lib/theme-defaults.ts +79 -0
- package/src/lib/theme-engine-light.ts +117 -0
- package/src/lib/theme-engine.ts +111 -0
- package/src/lib/theme-records.ts +205 -0
- package/src/lib/themes.ts +30 -375
- package/src/lib/tokens.ts +1 -35
- package/dist/components/theme/theme-document.js.map +0 -1
- package/dist/components/theme/theme-state.js.map +0 -1
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
//#region src/lib/theme-defaults.generated.ts
|
|
2
|
+
/** Every catalogue theme id and its appearance, in catalogue order. */
|
|
3
|
+
var THEME_INDEX = [
|
|
4
|
+
["adea-dark", "dark"],
|
|
5
|
+
["adea-dark-colorblind", "dark"],
|
|
6
|
+
["adea-dark-high-contrast", "dark"],
|
|
7
|
+
["adea-light", "light"],
|
|
8
|
+
["adea-light-colorblind", "light"],
|
|
9
|
+
["adea-light-high-contrast", "light"],
|
|
10
|
+
["aardvark-blue", "dark"],
|
|
11
|
+
["aardvark-ink", "dark"],
|
|
12
|
+
["ayu", "dark"],
|
|
13
|
+
["ayu-light", "light"],
|
|
14
|
+
["ayu-mirage", "dark"],
|
|
15
|
+
["catppuccin-frappe", "dark"],
|
|
16
|
+
["catppuccin-latte", "light"],
|
|
17
|
+
["catppuccin-macchiato", "dark"],
|
|
18
|
+
["catppuccin-mocha", "dark"],
|
|
19
|
+
["dracula", "dark"],
|
|
20
|
+
["everforest-dark", "dark"],
|
|
21
|
+
["everforest-light", "light"],
|
|
22
|
+
["gruvbox-dark", "dark"],
|
|
23
|
+
["gruvbox-light", "light"],
|
|
24
|
+
["kanagawa", "dark"],
|
|
25
|
+
["monokai", "dark"],
|
|
26
|
+
["nord", "dark"],
|
|
27
|
+
["nord-light", "light"],
|
|
28
|
+
["one-dark", "dark"],
|
|
29
|
+
["rosepine", "dark"],
|
|
30
|
+
["rosepine-dawn", "light"],
|
|
31
|
+
["rosepine-moon", "dark"],
|
|
32
|
+
["solarized-dark", "dark"],
|
|
33
|
+
["solarized-light", "light"],
|
|
34
|
+
["tokyonight-day", "light"],
|
|
35
|
+
["tokyonight-night", "dark"],
|
|
36
|
+
["tokyonight-storm", "dark"],
|
|
37
|
+
["vesper", "dark"]
|
|
38
|
+
];
|
|
39
|
+
/** The default light and dark themes, complete. */
|
|
40
|
+
var DEFAULT_VARIANTS = {
|
|
41
|
+
"adea-light": {
|
|
42
|
+
id: "adea-light",
|
|
43
|
+
family: "adea",
|
|
44
|
+
familyLabel: "Adea",
|
|
45
|
+
label: "Light",
|
|
46
|
+
appearance: "light",
|
|
47
|
+
description: "The default light theme: GitHub's own white canvas carrying the dark theme's hues, transposed to survive on paper, with the family violet accent.",
|
|
48
|
+
colors: {
|
|
49
|
+
background: "oklch(1 0 0)",
|
|
50
|
+
foreground: "oklch(0.2542 0.0111 254.04)",
|
|
51
|
+
card: "oklch(0.965 0 0)",
|
|
52
|
+
cardForeground: "oklch(0.2542 0.0111 254.04)",
|
|
53
|
+
popover: "oklch(0.935 0 0)",
|
|
54
|
+
popoverForeground: "oklch(0.2542 0.0111 254.04)",
|
|
55
|
+
primary: "oklch(0.5143 0.1668 301.69)",
|
|
56
|
+
primaryForeground: "oklch(1 0 0)",
|
|
57
|
+
secondary: "oklch(0.965 0 0)",
|
|
58
|
+
secondaryForeground: "oklch(0.2542 0.0111 254.04)",
|
|
59
|
+
muted: "oklch(0.965 0 0)",
|
|
60
|
+
mutedForeground: "oklch(0.4929 0.0076 254.04)",
|
|
61
|
+
accent: "oklch(0.9 0 0)",
|
|
62
|
+
accentForeground: "oklch(0.2542 0.0111 254.04)",
|
|
63
|
+
destructive: "oklch(0.5165 0.1626 25.78)",
|
|
64
|
+
destructiveForeground: "oklch(1 0 0)",
|
|
65
|
+
destructiveSubtle: "oklch(0.9323 0.0228 25.78)",
|
|
66
|
+
destructiveAction: "oklch(0.5165 0.1626 25.78)",
|
|
67
|
+
destructiveActionForeground: "oklch(1 0 0)",
|
|
68
|
+
success: "oklch(0.4771 0.1809 145.62)",
|
|
69
|
+
successForeground: "oklch(1 0 0)",
|
|
70
|
+
successSubtle: "oklch(0.9268 0.0253 145.62)",
|
|
71
|
+
warning: "oklch(0.5016 0.1401 79.91)",
|
|
72
|
+
warningForeground: "oklch(1 0 0)",
|
|
73
|
+
warningSubtle: "oklch(0.9302 0.0196 79.91)",
|
|
74
|
+
info: "oklch(0.5375 0.1155 202.14)",
|
|
75
|
+
infoForeground: "oklch(1 0 0)",
|
|
76
|
+
infoSubtle: "oklch(0.9353 0.0162 202.14)",
|
|
77
|
+
border: "oklch(0.85 0 0)",
|
|
78
|
+
input: "oklch(0.85 0 0)",
|
|
79
|
+
ring: "oklch(0.5143 0.1668 301.69)",
|
|
80
|
+
sidebar: "oklch(0.965 0 0)",
|
|
81
|
+
sidebarForeground: "oklch(0.2542 0.0111 254.04)",
|
|
82
|
+
sidebarAccent: "oklch(0.9 0 0)",
|
|
83
|
+
sidebarBorder: "oklch(0.85 0 0)",
|
|
84
|
+
sidebarMutedForeground: "oklch(0.4929 0.0076 254.04)"
|
|
85
|
+
},
|
|
86
|
+
terminal: {
|
|
87
|
+
background: "oklch(1 0 0)",
|
|
88
|
+
foreground: "oklch(0.2542 0.0111 254.04)",
|
|
89
|
+
cursor: "oklch(0.5399 0.1906 257.48)",
|
|
90
|
+
selection: "oklch(0.2542 0.0111 254.04)",
|
|
91
|
+
black: "oklch(0.2785 0.0132 253.04)",
|
|
92
|
+
red: "oklch(0.5165 0.1626 25.78)",
|
|
93
|
+
green: "oklch(0.4771 0.1809 145.62)",
|
|
94
|
+
yellow: "oklch(0.5016 0.1401 79.91)",
|
|
95
|
+
blue: "oklch(0.4973 0.1518 253.31)",
|
|
96
|
+
magenta: "oklch(0.5143 0.1668 301.69)",
|
|
97
|
+
cyan: "oklch(0.5375 0.1155 202.14)",
|
|
98
|
+
white: "oklch(0.5651 0.0189 250.97)",
|
|
99
|
+
brightBlack: "oklch(0.4849 0.0196 251.02)",
|
|
100
|
+
brightRed: "oklch(0.5834 0.1134 25.81)",
|
|
101
|
+
brightGreen: "oklch(0.5537 0.188 145.48)",
|
|
102
|
+
brightYellow: "oklch(0.5724 0.1386 85.24)",
|
|
103
|
+
brightBlue: "oklch(0.5677 0.1153 246.66)",
|
|
104
|
+
brightMagenta: "oklch(0.5825 0.1275 305.86)",
|
|
105
|
+
brightCyan: "oklch(0.5856 0.1107 201.78)",
|
|
106
|
+
brightWhite: "oklch(0.6658 0.0181 250.92)"
|
|
107
|
+
},
|
|
108
|
+
editor: {
|
|
109
|
+
keyword: "oklch(0.5143 0.1668 301.69)",
|
|
110
|
+
string: "oklch(0.4771 0.1809 145.62)",
|
|
111
|
+
number: "oklch(0.5016 0.1401 79.91)",
|
|
112
|
+
comment: "oklch(0.4849 0.0196 251.02)",
|
|
113
|
+
function: "oklch(0.4973 0.1518 253.31)",
|
|
114
|
+
variable: "oklch(0.2785 0.0132 253.04)",
|
|
115
|
+
type: "oklch(0.5375 0.1155 202.14)",
|
|
116
|
+
tag: "oklch(0.5165 0.1626 25.78)",
|
|
117
|
+
attribute: "oklch(0.5016 0.1401 79.91)",
|
|
118
|
+
operator: "oklch(0.2785 0.0132 253.04)",
|
|
119
|
+
heading: "oklch(0.5143 0.1668 301.69)",
|
|
120
|
+
link: "oklch(0.4973 0.1518 253.31)",
|
|
121
|
+
diffAdd: "oklch(0.4771 0.1809 145.62)",
|
|
122
|
+
diffDelete: "oklch(0.5165 0.1626 25.78)",
|
|
123
|
+
diffHunk: "oklch(0.5375 0.1155 202.14)",
|
|
124
|
+
searchMatch: "oklch(0.5016 0.1401 79.91)"
|
|
125
|
+
},
|
|
126
|
+
chart: [
|
|
127
|
+
"oklch(0.4973 0.1518 253.31)",
|
|
128
|
+
"oklch(0.5143 0.1668 301.69)",
|
|
129
|
+
"oklch(0.5375 0.1155 202.14)",
|
|
130
|
+
"oklch(0.4771 0.1809 145.62)",
|
|
131
|
+
"oklch(0.5016 0.1401 79.91)",
|
|
132
|
+
"oklch(0.5165 0.1626 25.78)"
|
|
133
|
+
],
|
|
134
|
+
provenance: {
|
|
135
|
+
source: "Adea",
|
|
136
|
+
url: "https://github.com/adea-ai/themes",
|
|
137
|
+
license: "Apache-2.0"
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"adea-dark": {
|
|
141
|
+
id: "adea-dark",
|
|
142
|
+
family: "adea",
|
|
143
|
+
familyLabel: "Adea",
|
|
144
|
+
label: "Dark",
|
|
145
|
+
appearance: "dark",
|
|
146
|
+
description: "The default dark theme: GitHub Dark Default with the canvas re-greyed to a violet-leaning neutral and the family violet accent, kept as a composition so the default can diverge from it one slot at a time.",
|
|
147
|
+
colors: {
|
|
148
|
+
background: "oklch(0.1756 0.0063 300.91)",
|
|
149
|
+
foreground: "oklch(0.942 0.0054 297.72)",
|
|
150
|
+
card: "oklch(0.2106 0.0076 300.91)",
|
|
151
|
+
cardForeground: "oklch(0.942 0.0054 297.72)",
|
|
152
|
+
popover: "oklch(0.2406 0.0088 300.91)",
|
|
153
|
+
popoverForeground: "oklch(0.942 0.0054 297.72)",
|
|
154
|
+
primary: "oklch(0.7323 0.1668 301.69)",
|
|
155
|
+
primaryForeground: "oklch(0.1756 0.0063 300.91)",
|
|
156
|
+
secondary: "oklch(0.2106 0.0076 300.91)",
|
|
157
|
+
secondaryForeground: "oklch(0.942 0.0054 297.72)",
|
|
158
|
+
muted: "oklch(0.2106 0.0076 300.91)",
|
|
159
|
+
mutedForeground: "oklch(0.6967 0.0057 298.74)",
|
|
160
|
+
accent: "oklch(0.2756 0.0101 300.91)",
|
|
161
|
+
accentForeground: "oklch(0.942 0.0054 297.72)",
|
|
162
|
+
destructive: "oklch(0.7345 0.1626 25.78)",
|
|
163
|
+
destructiveForeground: "oklch(0.1756 0.0063 300.91)",
|
|
164
|
+
destructiveSubtle: "oklch(0.2538 0.0282 312.79)",
|
|
165
|
+
destructiveAction: "oklch(0.7345 0.1626 25.78)",
|
|
166
|
+
destructiveActionForeground: "oklch(0.1756 0.0063 300.91)",
|
|
167
|
+
success: "oklch(0.6951 0.1809 145.62)",
|
|
168
|
+
successForeground: "oklch(0.1756 0.0063 300.91)",
|
|
169
|
+
successSubtle: "oklch(0.2483 0.0307 279.17)",
|
|
170
|
+
warning: "oklch(0.7196 0.1401 79.91)",
|
|
171
|
+
warningForeground: "oklch(0.1756 0.0063 300.91)",
|
|
172
|
+
warningSubtle: "oklch(0.2518 0.025 320.37)",
|
|
173
|
+
info: "oklch(0.7555 0.1155 202.14)",
|
|
174
|
+
infoForeground: "oklch(0.1756 0.0063 300.91)",
|
|
175
|
+
infoSubtle: "oklch(0.2568 0.0216 287.08)",
|
|
176
|
+
border: "oklch(0.3256 0.0057 300.91)",
|
|
177
|
+
input: "oklch(0.3256 0.0057 300.91)",
|
|
178
|
+
ring: "oklch(0.7323 0.1668 301.69)",
|
|
179
|
+
sidebar: "oklch(0.2106 0.0076 300.91)",
|
|
180
|
+
sidebarForeground: "oklch(0.942 0.0054 297.72)",
|
|
181
|
+
sidebarAccent: "oklch(0.2756 0.0101 300.91)",
|
|
182
|
+
sidebarBorder: "oklch(0.3256 0.0057 300.91)",
|
|
183
|
+
sidebarMutedForeground: "oklch(0.6967 0.0057 298.74)"
|
|
184
|
+
},
|
|
185
|
+
terminal: {
|
|
186
|
+
background: "oklch(0.1756 0.0063 300.91)",
|
|
187
|
+
foreground: "oklch(0.942 0.0054 297.72)",
|
|
188
|
+
cursor: "oklch(0.6182 0.1935 258.33)",
|
|
189
|
+
selection: "oklch(0.9425 0.0111 243.66)",
|
|
190
|
+
black: "oklch(0.4243 0.0101 301.11)",
|
|
191
|
+
red: "oklch(0.7345 0.1626 25.78)",
|
|
192
|
+
green: "oklch(0.6951 0.1809 145.62)",
|
|
193
|
+
yellow: "oklch(0.7196 0.1401 79.91)",
|
|
194
|
+
blue: "oklch(0.7153 0.1518 253.31)",
|
|
195
|
+
magenta: "oklch(0.7323 0.1668 301.69)",
|
|
196
|
+
cyan: "oklch(0.7555 0.1155 202.14)",
|
|
197
|
+
white: "oklch(0.786 0.0087 301.32)",
|
|
198
|
+
brightBlack: "oklch(0.5627 0.0094 301.22)",
|
|
199
|
+
brightRed: "oklch(0.8014 0.1134 25.81)",
|
|
200
|
+
brightGreen: "oklch(0.7717 0.188 145.48)",
|
|
201
|
+
brightYellow: "oklch(0.7904 0.1386 85.24)",
|
|
202
|
+
brightBlue: "oklch(0.7857 0.1153 246.66)",
|
|
203
|
+
brightMagenta: "oklch(0.8005 0.1275 305.86)",
|
|
204
|
+
brightCyan: "oklch(0.8036 0.1107 201.78)",
|
|
205
|
+
brightWhite: "oklch(1 0 0)"
|
|
206
|
+
},
|
|
207
|
+
editor: {
|
|
208
|
+
keyword: "oklch(0.7323 0.1668 301.69)",
|
|
209
|
+
string: "oklch(0.6951 0.1809 145.62)",
|
|
210
|
+
number: "oklch(0.7196 0.1401 79.91)",
|
|
211
|
+
comment: "oklch(0.5627 0.0094 301.22)",
|
|
212
|
+
function: "oklch(0.7153 0.1518 253.31)",
|
|
213
|
+
variable: "oklch(0.786 0.0087 301.32)",
|
|
214
|
+
type: "oklch(0.7555 0.1155 202.14)",
|
|
215
|
+
tag: "oklch(0.7345 0.1626 25.78)",
|
|
216
|
+
attribute: "oklch(0.7196 0.1401 79.91)",
|
|
217
|
+
operator: "oklch(0.786 0.0087 301.32)",
|
|
218
|
+
heading: "oklch(0.7323 0.1668 301.69)",
|
|
219
|
+
link: "oklch(0.7153 0.1518 253.31)",
|
|
220
|
+
diffAdd: "oklch(0.6951 0.1809 145.62)",
|
|
221
|
+
diffDelete: "oklch(0.7345 0.1626 25.78)",
|
|
222
|
+
diffHunk: "oklch(0.7555 0.1155 202.14)",
|
|
223
|
+
searchMatch: "oklch(0.7196 0.1401 79.91)"
|
|
224
|
+
},
|
|
225
|
+
chart: [
|
|
226
|
+
"oklch(0.7153 0.1518 253.31)",
|
|
227
|
+
"oklch(0.7323 0.1668 301.69)",
|
|
228
|
+
"oklch(0.7555 0.1155 202.14)",
|
|
229
|
+
"oklch(0.6951 0.1809 145.62)",
|
|
230
|
+
"oklch(0.7196 0.1401 79.91)",
|
|
231
|
+
"oklch(0.7345 0.1626 25.78)"
|
|
232
|
+
],
|
|
233
|
+
provenance: {
|
|
234
|
+
source: "Adea",
|
|
235
|
+
url: "https://github.com/adea-ai/themes",
|
|
236
|
+
license: "Apache-2.0"
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
/** The accents the default light/dark pair offers beside the presets. */
|
|
241
|
+
var DEFAULT_THEME_ACCENTS = [
|
|
242
|
+
{
|
|
243
|
+
id: "ansi-blue",
|
|
244
|
+
label: "Blue",
|
|
245
|
+
description: "The theme's own blue colour.",
|
|
246
|
+
light: "oklch(0.4973 0.1518 253.31)",
|
|
247
|
+
dark: "oklch(0.7153 0.1518 253.31)"
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
id: "ansi-magenta",
|
|
251
|
+
label: "Magenta",
|
|
252
|
+
description: "The theme's own magenta colour.",
|
|
253
|
+
light: "oklch(0.5143 0.1668 301.69)",
|
|
254
|
+
dark: "oklch(0.7323 0.1668 301.69)"
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
id: "ansi-cyan",
|
|
258
|
+
label: "Cyan",
|
|
259
|
+
description: "The theme's own cyan colour.",
|
|
260
|
+
light: "oklch(0.5375 0.1155 202.14)",
|
|
261
|
+
dark: "oklch(0.7555 0.1155 202.14)"
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
id: "ansi-green",
|
|
265
|
+
label: "Green",
|
|
266
|
+
description: "The theme's own green colour.",
|
|
267
|
+
light: "oklch(0.4771 0.1809 145.62)",
|
|
268
|
+
dark: "oklch(0.6951 0.1809 145.62)"
|
|
269
|
+
}
|
|
270
|
+
];
|
|
271
|
+
/** Each default's measured `--primary-subtle` expression. */
|
|
272
|
+
var DEFAULT_PRIMARY_SUBTLE = {
|
|
273
|
+
"adea-light": "color-mix(in oklch, var(--primary) 10%, transparent)",
|
|
274
|
+
"adea-dark": "color-mix(in oklch, var(--primary) 16%, transparent)"
|
|
275
|
+
};
|
|
276
|
+
/** Each default's `--editor-*` ramp held to 4.5:1 on its canvas (`editorRoles: 'floor'`). */
|
|
277
|
+
var DEFAULT_FLOOR_EDITOR = {
|
|
278
|
+
"adea-light": {
|
|
279
|
+
keyword: "#7a49b5",
|
|
280
|
+
string: "#00711f",
|
|
281
|
+
number: "#825c00",
|
|
282
|
+
comment: "#57606a",
|
|
283
|
+
function: "#0662b5",
|
|
284
|
+
variable: "#24292f",
|
|
285
|
+
type: "#007d85",
|
|
286
|
+
tag: "#b23533",
|
|
287
|
+
attribute: "#825c00",
|
|
288
|
+
operator: "#24292f",
|
|
289
|
+
heading: "#7a49b5",
|
|
290
|
+
link: "#0662b5",
|
|
291
|
+
diffAdd: "#00711f",
|
|
292
|
+
diffDelete: "#b23533",
|
|
293
|
+
diffHunk: "#007d85",
|
|
294
|
+
searchMatch: "#825c00"
|
|
295
|
+
},
|
|
296
|
+
"adea-dark": {
|
|
297
|
+
keyword: "#bc8cff",
|
|
298
|
+
string: "#3fb950",
|
|
299
|
+
number: "#d29922",
|
|
300
|
+
comment: "#7d7b81",
|
|
301
|
+
function: "#58a6ff",
|
|
302
|
+
variable: "#bab8be",
|
|
303
|
+
type: "#39c5cf",
|
|
304
|
+
tag: "#ff7b72",
|
|
305
|
+
attribute: "#d29922",
|
|
306
|
+
operator: "#bab8be",
|
|
307
|
+
heading: "#bc8cff",
|
|
308
|
+
link: "#58a6ff",
|
|
309
|
+
diffAdd: "#3fb950",
|
|
310
|
+
diffDelete: "#ff7b72",
|
|
311
|
+
diffHunk: "#39c5cf",
|
|
312
|
+
searchMatch: "#d29922"
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
//#endregion
|
|
316
|
+
export { DEFAULT_FLOOR_EDITOR, DEFAULT_PRIMARY_SUBTLE, DEFAULT_THEME_ACCENTS, DEFAULT_VARIANTS, THEME_INDEX };
|
|
317
|
+
|
|
318
|
+
//# sourceMappingURL=theme-defaults.generated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-defaults.generated.js","names":[],"sources":["../../src/lib/theme-defaults.generated.ts"],"sourcesContent":["/*\n * GENERATED by scripts/build-theme-defaults.ts from @adea-ai/themes. Do not edit.\n * Run `bun run theme:defaults` after the catalogue changes;\n * tests/theme-defaults.test.ts fails when this file is stale.\n */\nimport type { AccentPreset } from '@adea-ai/themes'\nimport type { ThemeEditorPalette, ThemeVariant } from './themes'\n\n/** Every catalogue theme id and its appearance, in catalogue order. */\nexport const THEME_INDEX: readonly (readonly [id: string, appearance: 'light' | 'dark'])[] = [\n ['adea-dark', 'dark'],\n ['adea-dark-colorblind', 'dark'],\n ['adea-dark-high-contrast', 'dark'],\n ['adea-light', 'light'],\n ['adea-light-colorblind', 'light'],\n ['adea-light-high-contrast', 'light'],\n ['aardvark-blue', 'dark'],\n ['aardvark-ink', 'dark'],\n ['ayu', 'dark'],\n ['ayu-light', 'light'],\n ['ayu-mirage', 'dark'],\n ['catppuccin-frappe', 'dark'],\n ['catppuccin-latte', 'light'],\n ['catppuccin-macchiato', 'dark'],\n ['catppuccin-mocha', 'dark'],\n ['dracula', 'dark'],\n ['everforest-dark', 'dark'],\n ['everforest-light', 'light'],\n ['gruvbox-dark', 'dark'],\n ['gruvbox-light', 'light'],\n ['kanagawa', 'dark'],\n ['monokai', 'dark'],\n ['nord', 'dark'],\n ['nord-light', 'light'],\n ['one-dark', 'dark'],\n ['rosepine', 'dark'],\n ['rosepine-dawn', 'light'],\n ['rosepine-moon', 'dark'],\n ['solarized-dark', 'dark'],\n ['solarized-light', 'light'],\n ['tokyonight-day', 'light'],\n ['tokyonight-night', 'dark'],\n ['tokyonight-storm', 'dark'],\n ['vesper', 'dark'],\n]\n\n/** The default light and dark themes, complete. */\nexport const DEFAULT_VARIANTS: Readonly<Record<'adea-light' | 'adea-dark', ThemeVariant>> = {\n 'adea-light': {\n id: 'adea-light',\n family: 'adea',\n familyLabel: 'Adea',\n label: 'Light',\n appearance: 'light',\n description:\n \"The default light theme: GitHub's own white canvas carrying the dark theme's hues, transposed to survive on paper, with the family violet accent.\",\n colors: {\n background: 'oklch(1 0 0)',\n foreground: 'oklch(0.2542 0.0111 254.04)',\n card: 'oklch(0.965 0 0)',\n cardForeground: 'oklch(0.2542 0.0111 254.04)',\n popover: 'oklch(0.935 0 0)',\n popoverForeground: 'oklch(0.2542 0.0111 254.04)',\n primary: 'oklch(0.5143 0.1668 301.69)',\n primaryForeground: 'oklch(1 0 0)',\n secondary: 'oklch(0.965 0 0)',\n secondaryForeground: 'oklch(0.2542 0.0111 254.04)',\n muted: 'oklch(0.965 0 0)',\n mutedForeground: 'oklch(0.4929 0.0076 254.04)',\n accent: 'oklch(0.9 0 0)',\n accentForeground: 'oklch(0.2542 0.0111 254.04)',\n destructive: 'oklch(0.5165 0.1626 25.78)',\n destructiveForeground: 'oklch(1 0 0)',\n destructiveSubtle: 'oklch(0.9323 0.0228 25.78)',\n destructiveAction: 'oklch(0.5165 0.1626 25.78)',\n destructiveActionForeground: 'oklch(1 0 0)',\n success: 'oklch(0.4771 0.1809 145.62)',\n successForeground: 'oklch(1 0 0)',\n successSubtle: 'oklch(0.9268 0.0253 145.62)',\n warning: 'oklch(0.5016 0.1401 79.91)',\n warningForeground: 'oklch(1 0 0)',\n warningSubtle: 'oklch(0.9302 0.0196 79.91)',\n info: 'oklch(0.5375 0.1155 202.14)',\n infoForeground: 'oklch(1 0 0)',\n infoSubtle: 'oklch(0.9353 0.0162 202.14)',\n border: 'oklch(0.85 0 0)',\n input: 'oklch(0.85 0 0)',\n ring: 'oklch(0.5143 0.1668 301.69)',\n sidebar: 'oklch(0.965 0 0)',\n sidebarForeground: 'oklch(0.2542 0.0111 254.04)',\n sidebarAccent: 'oklch(0.9 0 0)',\n sidebarBorder: 'oklch(0.85 0 0)',\n sidebarMutedForeground: 'oklch(0.4929 0.0076 254.04)',\n },\n terminal: {\n background: 'oklch(1 0 0)',\n foreground: 'oklch(0.2542 0.0111 254.04)',\n cursor: 'oklch(0.5399 0.1906 257.48)',\n selection: 'oklch(0.2542 0.0111 254.04)',\n black: 'oklch(0.2785 0.0132 253.04)',\n red: 'oklch(0.5165 0.1626 25.78)',\n green: 'oklch(0.4771 0.1809 145.62)',\n yellow: 'oklch(0.5016 0.1401 79.91)',\n blue: 'oklch(0.4973 0.1518 253.31)',\n magenta: 'oklch(0.5143 0.1668 301.69)',\n cyan: 'oklch(0.5375 0.1155 202.14)',\n white: 'oklch(0.5651 0.0189 250.97)',\n brightBlack: 'oklch(0.4849 0.0196 251.02)',\n brightRed: 'oklch(0.5834 0.1134 25.81)',\n brightGreen: 'oklch(0.5537 0.188 145.48)',\n brightYellow: 'oklch(0.5724 0.1386 85.24)',\n brightBlue: 'oklch(0.5677 0.1153 246.66)',\n brightMagenta: 'oklch(0.5825 0.1275 305.86)',\n brightCyan: 'oklch(0.5856 0.1107 201.78)',\n brightWhite: 'oklch(0.6658 0.0181 250.92)',\n },\n editor: {\n keyword: 'oklch(0.5143 0.1668 301.69)',\n string: 'oklch(0.4771 0.1809 145.62)',\n number: 'oklch(0.5016 0.1401 79.91)',\n comment: 'oklch(0.4849 0.0196 251.02)',\n function: 'oklch(0.4973 0.1518 253.31)',\n variable: 'oklch(0.2785 0.0132 253.04)',\n type: 'oklch(0.5375 0.1155 202.14)',\n tag: 'oklch(0.5165 0.1626 25.78)',\n attribute: 'oklch(0.5016 0.1401 79.91)',\n operator: 'oklch(0.2785 0.0132 253.04)',\n heading: 'oklch(0.5143 0.1668 301.69)',\n link: 'oklch(0.4973 0.1518 253.31)',\n diffAdd: 'oklch(0.4771 0.1809 145.62)',\n diffDelete: 'oklch(0.5165 0.1626 25.78)',\n diffHunk: 'oklch(0.5375 0.1155 202.14)',\n searchMatch: 'oklch(0.5016 0.1401 79.91)',\n },\n chart: [\n 'oklch(0.4973 0.1518 253.31)',\n 'oklch(0.5143 0.1668 301.69)',\n 'oklch(0.5375 0.1155 202.14)',\n 'oklch(0.4771 0.1809 145.62)',\n 'oklch(0.5016 0.1401 79.91)',\n 'oklch(0.5165 0.1626 25.78)',\n ],\n provenance: { source: 'Adea', url: 'https://github.com/adea-ai/themes', license: 'Apache-2.0' },\n },\n 'adea-dark': {\n id: 'adea-dark',\n family: 'adea',\n familyLabel: 'Adea',\n label: 'Dark',\n appearance: 'dark',\n description:\n 'The default dark theme: GitHub Dark Default with the canvas re-greyed to a violet-leaning neutral and the family violet accent, kept as a composition so the default can diverge from it one slot at a time.',\n colors: {\n background: 'oklch(0.1756 0.0063 300.91)',\n foreground: 'oklch(0.942 0.0054 297.72)',\n card: 'oklch(0.2106 0.0076 300.91)',\n cardForeground: 'oklch(0.942 0.0054 297.72)',\n popover: 'oklch(0.2406 0.0088 300.91)',\n popoverForeground: 'oklch(0.942 0.0054 297.72)',\n primary: 'oklch(0.7323 0.1668 301.69)',\n primaryForeground: 'oklch(0.1756 0.0063 300.91)',\n secondary: 'oklch(0.2106 0.0076 300.91)',\n secondaryForeground: 'oklch(0.942 0.0054 297.72)',\n muted: 'oklch(0.2106 0.0076 300.91)',\n mutedForeground: 'oklch(0.6967 0.0057 298.74)',\n accent: 'oklch(0.2756 0.0101 300.91)',\n accentForeground: 'oklch(0.942 0.0054 297.72)',\n destructive: 'oklch(0.7345 0.1626 25.78)',\n destructiveForeground: 'oklch(0.1756 0.0063 300.91)',\n destructiveSubtle: 'oklch(0.2538 0.0282 312.79)',\n destructiveAction: 'oklch(0.7345 0.1626 25.78)',\n destructiveActionForeground: 'oklch(0.1756 0.0063 300.91)',\n success: 'oklch(0.6951 0.1809 145.62)',\n successForeground: 'oklch(0.1756 0.0063 300.91)',\n successSubtle: 'oklch(0.2483 0.0307 279.17)',\n warning: 'oklch(0.7196 0.1401 79.91)',\n warningForeground: 'oklch(0.1756 0.0063 300.91)',\n warningSubtle: 'oklch(0.2518 0.025 320.37)',\n info: 'oklch(0.7555 0.1155 202.14)',\n infoForeground: 'oklch(0.1756 0.0063 300.91)',\n infoSubtle: 'oklch(0.2568 0.0216 287.08)',\n border: 'oklch(0.3256 0.0057 300.91)',\n input: 'oklch(0.3256 0.0057 300.91)',\n ring: 'oklch(0.7323 0.1668 301.69)',\n sidebar: 'oklch(0.2106 0.0076 300.91)',\n sidebarForeground: 'oklch(0.942 0.0054 297.72)',\n sidebarAccent: 'oklch(0.2756 0.0101 300.91)',\n sidebarBorder: 'oklch(0.3256 0.0057 300.91)',\n sidebarMutedForeground: 'oklch(0.6967 0.0057 298.74)',\n },\n terminal: {\n background: 'oklch(0.1756 0.0063 300.91)',\n foreground: 'oklch(0.942 0.0054 297.72)',\n cursor: 'oklch(0.6182 0.1935 258.33)',\n selection: 'oklch(0.9425 0.0111 243.66)',\n black: 'oklch(0.4243 0.0101 301.11)',\n red: 'oklch(0.7345 0.1626 25.78)',\n green: 'oklch(0.6951 0.1809 145.62)',\n yellow: 'oklch(0.7196 0.1401 79.91)',\n blue: 'oklch(0.7153 0.1518 253.31)',\n magenta: 'oklch(0.7323 0.1668 301.69)',\n cyan: 'oklch(0.7555 0.1155 202.14)',\n white: 'oklch(0.786 0.0087 301.32)',\n brightBlack: 'oklch(0.5627 0.0094 301.22)',\n brightRed: 'oklch(0.8014 0.1134 25.81)',\n brightGreen: 'oklch(0.7717 0.188 145.48)',\n brightYellow: 'oklch(0.7904 0.1386 85.24)',\n brightBlue: 'oklch(0.7857 0.1153 246.66)',\n brightMagenta: 'oklch(0.8005 0.1275 305.86)',\n brightCyan: 'oklch(0.8036 0.1107 201.78)',\n brightWhite: 'oklch(1 0 0)',\n },\n editor: {\n keyword: 'oklch(0.7323 0.1668 301.69)',\n string: 'oklch(0.6951 0.1809 145.62)',\n number: 'oklch(0.7196 0.1401 79.91)',\n comment: 'oklch(0.5627 0.0094 301.22)',\n function: 'oklch(0.7153 0.1518 253.31)',\n variable: 'oklch(0.786 0.0087 301.32)',\n type: 'oklch(0.7555 0.1155 202.14)',\n tag: 'oklch(0.7345 0.1626 25.78)',\n attribute: 'oklch(0.7196 0.1401 79.91)',\n operator: 'oklch(0.786 0.0087 301.32)',\n heading: 'oklch(0.7323 0.1668 301.69)',\n link: 'oklch(0.7153 0.1518 253.31)',\n diffAdd: 'oklch(0.6951 0.1809 145.62)',\n diffDelete: 'oklch(0.7345 0.1626 25.78)',\n diffHunk: 'oklch(0.7555 0.1155 202.14)',\n searchMatch: 'oklch(0.7196 0.1401 79.91)',\n },\n chart: [\n 'oklch(0.7153 0.1518 253.31)',\n 'oklch(0.7323 0.1668 301.69)',\n 'oklch(0.7555 0.1155 202.14)',\n 'oklch(0.6951 0.1809 145.62)',\n 'oklch(0.7196 0.1401 79.91)',\n 'oklch(0.7345 0.1626 25.78)',\n ],\n provenance: { source: 'Adea', url: 'https://github.com/adea-ai/themes', license: 'Apache-2.0' },\n },\n}\n\n/** The accents the default light/dark pair offers beside the presets. */\nexport const DEFAULT_THEME_ACCENTS: readonly AccentPreset[] = [\n {\n id: 'ansi-blue',\n label: 'Blue',\n description: \"The theme's own blue colour.\",\n light: 'oklch(0.4973 0.1518 253.31)',\n dark: 'oklch(0.7153 0.1518 253.31)',\n },\n {\n id: 'ansi-magenta',\n label: 'Magenta',\n description: \"The theme's own magenta colour.\",\n light: 'oklch(0.5143 0.1668 301.69)',\n dark: 'oklch(0.7323 0.1668 301.69)',\n },\n {\n id: 'ansi-cyan',\n label: 'Cyan',\n description: \"The theme's own cyan colour.\",\n light: 'oklch(0.5375 0.1155 202.14)',\n dark: 'oklch(0.7555 0.1155 202.14)',\n },\n {\n id: 'ansi-green',\n label: 'Green',\n description: \"The theme's own green colour.\",\n light: 'oklch(0.4771 0.1809 145.62)',\n dark: 'oklch(0.6951 0.1809 145.62)',\n },\n]\n\n/** Each default's measured `--primary-subtle` expression. */\nexport const DEFAULT_PRIMARY_SUBTLE: Readonly<Record<string, string>> = {\n 'adea-light': 'color-mix(in oklch, var(--primary) 10%, transparent)',\n 'adea-dark': 'color-mix(in oklch, var(--primary) 16%, transparent)',\n}\n\n/** Each default's `--editor-*` ramp held to 4.5:1 on its canvas (`editorRoles: 'floor'`). */\nexport const DEFAULT_FLOOR_EDITOR: Readonly<Record<string, ThemeEditorPalette>> = {\n 'adea-light': {\n keyword: '#7a49b5',\n string: '#00711f',\n number: '#825c00',\n comment: '#57606a',\n function: '#0662b5',\n variable: '#24292f',\n type: '#007d85',\n tag: '#b23533',\n attribute: '#825c00',\n operator: '#24292f',\n heading: '#7a49b5',\n link: '#0662b5',\n diffAdd: '#00711f',\n diffDelete: '#b23533',\n diffHunk: '#007d85',\n searchMatch: '#825c00',\n },\n 'adea-dark': {\n keyword: '#bc8cff',\n string: '#3fb950',\n number: '#d29922',\n comment: '#7d7b81',\n function: '#58a6ff',\n variable: '#bab8be',\n type: '#39c5cf',\n tag: '#ff7b72',\n attribute: '#d29922',\n operator: '#bab8be',\n heading: '#bc8cff',\n link: '#58a6ff',\n diffAdd: '#3fb950',\n diffDelete: '#ff7b72',\n diffHunk: '#39c5cf',\n searchMatch: '#d29922',\n },\n}\n"],"mappings":";;AASA,IAAa,cAAgF;CAC3F,CAAC,aAAa,MAAM;CACpB,CAAC,wBAAwB,MAAM;CAC/B,CAAC,2BAA2B,MAAM;CAClC,CAAC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AAM;EACN,SAAS;EACT,YAAY;EACZ,UAAU;EACV,aAAa;CACf;AACF"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { DEFAULT_FLOOR_EDITOR, DEFAULT_PRIMARY_SUBTLE, DEFAULT_THEME_ACCENTS, DEFAULT_VARIANTS, THEME_INDEX } from "./theme-defaults.generated.js";
|
|
2
|
+
//#region src/lib/theme-defaults.ts
|
|
3
|
+
var defaultLightThemeId = "adea-light";
|
|
4
|
+
var defaultDarkThemeId = "adea-dark";
|
|
5
|
+
/** The appearance of a catalogue theme id, or `undefined` for an id the catalogue lacks. */
|
|
6
|
+
function catalogueThemeAppearance(id) {
|
|
7
|
+
return THEME_INDEX.find(([candidate]) => candidate === id)?.[1];
|
|
8
|
+
}
|
|
9
|
+
/** Whether the catalogue holds a theme with this id (loaded or not). */
|
|
10
|
+
function isCatalogueThemeId(id) {
|
|
11
|
+
return catalogueThemeAppearance(id) !== void 0;
|
|
12
|
+
}
|
|
13
|
+
/** Whether an id is one of the two default themes, whose data ships with the provider. */
|
|
14
|
+
function isDefaultThemeId(id) {
|
|
15
|
+
return id === "adea-light" || id === "adea-dark";
|
|
16
|
+
}
|
|
17
|
+
/** The default variant of an appearance. */
|
|
18
|
+
function defaultVariantFor(appearance) {
|
|
19
|
+
return DEFAULT_VARIANTS[appearance === "dark" ? defaultDarkThemeId : defaultLightThemeId];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The variant a stored id means, or the default of the same appearance.
|
|
23
|
+
*
|
|
24
|
+
* An id the registry does not hold — an imported theme that was deleted, a
|
|
25
|
+
* catalogue entry that was renamed — must still paint *something of the appearance
|
|
26
|
+
* being shown*. Falling back to whichever variant happens to be first in the
|
|
27
|
+
* registry painted a dark palette under a light `color-scheme` for a light id, so
|
|
28
|
+
* the fallback is the appearance's own default, then any variant of that
|
|
29
|
+
* appearance, then the registry's first entry only when it holds nothing else.
|
|
30
|
+
*
|
|
31
|
+
* `registry` is the builtin catalogue plus whatever extras the host supplies; the
|
|
32
|
+
* stored id is never rewritten, only resolved, so a host that keeps an unknown id
|
|
33
|
+
* keeps resolving it if the theme comes back.
|
|
34
|
+
*
|
|
35
|
+
* The fallback order is translated from Zeron's `ThemeRegistry::resolve` (MIT,
|
|
36
|
+
* Copyright (c) 2026 Wing); see NOTICE.
|
|
37
|
+
*/
|
|
38
|
+
function resolveVariant(registry, id, appearance) {
|
|
39
|
+
const found = registry.find((variant) => variant.id === id);
|
|
40
|
+
if (found) return found;
|
|
41
|
+
const defaultId = appearance === "dark" ? defaultDarkThemeId : defaultLightThemeId;
|
|
42
|
+
return registry.find((variant) => variant.id === defaultId) ?? registry.find((variant) => variant.appearance === appearance) ?? registry[0];
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { DEFAULT_FLOOR_EDITOR, DEFAULT_PRIMARY_SUBTLE, DEFAULT_THEME_ACCENTS, DEFAULT_VARIANTS, THEME_INDEX, catalogueThemeAppearance, defaultDarkThemeId, defaultLightThemeId, defaultVariantFor, isCatalogueThemeId, isDefaultThemeId, resolveVariant };
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=theme-defaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-defaults.js","names":[],"sources":["../../src/lib/theme-defaults.ts"],"sourcesContent":["/**\n * What a provider knows about the catalogue without loading it.\n *\n * The catalogue (`@adea-ai/themes`, 34 themes) is the heavy part of the theme\n * system. Most hosts start on the default pair, paint a catalogue theme from a\n * stylesheet, and open a picker rarely, so this module holds the few facts needed\n * to start without it: the default ids, every catalogue id with its appearance (to\n * recognise a stored preference), and the default pair as complete variants.\n *\n * It imports no catalogue code and no catalogue data. The facts themselves are in\n * `theme-defaults.generated.ts`, copied from the catalogue by\n * `scripts/build-theme-defaults.ts` and checked against it by\n * `tests/theme-defaults.test.ts`.\n */\nimport type { ThemeAppearance, ThemeVariant } from './themes'\nimport { DEFAULT_VARIANTS, THEME_INDEX } from './theme-defaults.generated'\n\nexport {\n DEFAULT_FLOOR_EDITOR,\n DEFAULT_PRIMARY_SUBTLE,\n DEFAULT_THEME_ACCENTS,\n DEFAULT_VARIANTS,\n THEME_INDEX,\n} from './theme-defaults.generated'\n\nexport const defaultLightThemeId = 'adea-light'\nexport const defaultDarkThemeId = 'adea-dark'\n\n/** The appearance of a catalogue theme id, or `undefined` for an id the catalogue lacks. */\nexport function catalogueThemeAppearance(id: string): ThemeAppearance | undefined {\n return THEME_INDEX.find(([candidate]) => candidate === id)?.[1]\n}\n\n/** Whether the catalogue holds a theme with this id (loaded or not). */\nexport function isCatalogueThemeId(id: string): boolean {\n return catalogueThemeAppearance(id) !== undefined\n}\n\n/** Whether an id is one of the two default themes, whose data ships with the provider. */\nexport function isDefaultThemeId(id: string): id is keyof typeof DEFAULT_VARIANTS {\n return id === defaultLightThemeId || id === defaultDarkThemeId\n}\n\n/** The default variant of an appearance. */\nexport function defaultVariantFor(appearance: ThemeAppearance): ThemeVariant {\n return DEFAULT_VARIANTS[appearance === 'dark' ? defaultDarkThemeId : defaultLightThemeId]\n}\n\n/**\n * The variant a stored id means, or the default of the same appearance.\n *\n * An id the registry does not hold — an imported theme that was deleted, a\n * catalogue entry that was renamed — must still paint *something of the appearance\n * being shown*. Falling back to whichever variant happens to be first in the\n * registry painted a dark palette under a light `color-scheme` for a light id, so\n * the fallback is the appearance's own default, then any variant of that\n * appearance, then the registry's first entry only when it holds nothing else.\n *\n * `registry` is the builtin catalogue plus whatever extras the host supplies; the\n * stored id is never rewritten, only resolved, so a host that keeps an unknown id\n * keeps resolving it if the theme comes back.\n *\n * The fallback order is translated from Zeron's `ThemeRegistry::resolve` (MIT,\n * Copyright (c) 2026 Wing); see NOTICE.\n */\nexport function resolveVariant(\n registry: readonly ThemeVariant[],\n id: string,\n appearance: ThemeAppearance\n): ThemeVariant {\n const found = registry.find((variant) => variant.id === id)\n if (found) return found\n const defaultId = appearance === 'dark' ? defaultDarkThemeId : defaultLightThemeId\n return (\n registry.find((variant) => variant.id === defaultId) ??\n registry.find((variant) => variant.appearance === appearance) ??\n registry[0]!\n )\n}\n"],"mappings":";;AAyBA,IAAa,sBAAsB;AACnC,IAAa,qBAAqB;;AAGlC,SAAgB,yBAAyB,IAAyC;CAChF,OAAO,YAAY,MAAM,CAAC,eAAe,cAAc,EAAE,CAAC,GAAG;AAC/D;;AAGA,SAAgB,mBAAmB,IAAqB;CACtD,OAAO,yBAAyB,EAAE,MAAM,KAAA;AAC1C;;AAGA,SAAgB,iBAAiB,IAAiD;CAChF,OAAO,OAAA,gBAA8B,OAAA;AACvC;;AAGA,SAAgB,kBAAkB,YAA2C;CAC3E,OAAO,iBAAiB,eAAe,SAAS,qBAAqB;AACvE;;;;;;;;;;;;;;;;;;AAmBA,SAAgB,eACd,UACA,IACA,YACc;CACd,MAAM,QAAQ,SAAS,MAAM,YAAY,QAAQ,OAAO,EAAE;CAC1D,IAAI,OAAO,OAAO;CAClB,MAAM,YAAY,eAAe,SAAS,qBAAqB;CAC/D,OACE,SAAS,MAAM,YAAY,QAAQ,OAAO,SAAS,KACnD,SAAS,MAAM,YAAY,QAAQ,eAAe,UAAU,KAC5D,SAAS;AAEb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-engine-light.d.ts","sourceRoot":"","sources":["../../src/lib/theme-engine-light.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAyC,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAiCxF,eAAO,MAAM,gBAAgB,EAAE,WAoC9B,CAAA"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { accentOverrideVariables, resolveAccentRoles } from "./accent-roles.js";
|
|
2
|
+
import { isThemeAccentId } from "./theme-accents.js";
|
|
3
|
+
import { themeCssVariablesWith } from "./theme-css.js";
|
|
4
|
+
import { DEFAULT_FLOOR_EDITOR, DEFAULT_PRIMARY_SUBTLE, DEFAULT_THEME_ACCENTS, DEFAULT_VARIANTS } from "./theme-defaults.generated.js";
|
|
5
|
+
import { defaultDarkThemeId, defaultLightThemeId, isCatalogueThemeId, isDefaultThemeId } from "./theme-defaults.js";
|
|
6
|
+
import { CatalogueRequired, needsData, pairIds } from "./theme-engine.js";
|
|
7
|
+
import { primarySubtleCss } from "@adea-ai/themes";
|
|
8
|
+
//#region src/lib/theme-engine-light.ts
|
|
9
|
+
var defaultVariantList = [DEFAULT_VARIANTS[defaultLightThemeId], DEFAULT_VARIANTS[defaultDarkThemeId]];
|
|
10
|
+
function lightEditor(theme, mode) {
|
|
11
|
+
if (mode !== "floor" || DEFAULT_VARIANTS[theme.id] !== theme) return theme.editor;
|
|
12
|
+
return DEFAULT_FLOOR_EDITOR[theme.id] ?? theme.editor;
|
|
13
|
+
}
|
|
14
|
+
function lightPrimarySubtle(theme) {
|
|
15
|
+
const measured = DEFAULT_PRIMARY_SUBTLE[theme.id];
|
|
16
|
+
if (measured) return measured;
|
|
17
|
+
if (isCatalogueThemeId(theme.id)) throw new CatalogueRequired(`the tint of ${theme.id}`);
|
|
18
|
+
return primarySubtleCss(theme.appearance);
|
|
19
|
+
}
|
|
20
|
+
function lightThemeAccentsFor(lightThemeId, darkThemeId) {
|
|
21
|
+
const [light, dark] = pairIds(lightThemeId, darkThemeId);
|
|
22
|
+
if (needsData(light) || needsData(dark)) throw new CatalogueRequired(`the accents of ${light}/${dark}`);
|
|
23
|
+
return DEFAULT_THEME_ACCENTS;
|
|
24
|
+
}
|
|
25
|
+
var lightThemeEngine = {
|
|
26
|
+
builtinThemes: defaultVariantList,
|
|
27
|
+
isCatalogueVariant: (variant) => isDefaultThemeId(variant.id) && DEFAULT_VARIANTS[variant.id] === variant,
|
|
28
|
+
themeCssVariables(variant, options = {}) {
|
|
29
|
+
if (needsData(variant.id)) throw new CatalogueRequired(`the roles of ${variant.id}`);
|
|
30
|
+
return themeCssVariablesWith({
|
|
31
|
+
primarySubtle: lightPrimarySubtle,
|
|
32
|
+
editor: lightEditor
|
|
33
|
+
}, variant, options);
|
|
34
|
+
},
|
|
35
|
+
themeAccentsFor: lightThemeAccentsFor,
|
|
36
|
+
accentVariables(accentId, appearance, pair, options = {}) {
|
|
37
|
+
const roles = lightAccentRoles(accentId, appearance, pair, options);
|
|
38
|
+
return roles ? accentOverrideVariables(roles) : void 0;
|
|
39
|
+
},
|
|
40
|
+
accentRolesForSelection(accentId, appearance, pair, options = {}) {
|
|
41
|
+
if (accentId === "theme") return void 0;
|
|
42
|
+
const variantId = options.variantId;
|
|
43
|
+
if (variantId !== void 0 && needsData(variantId)) throw new CatalogueRequired(`the accent roles over ${variantId}`);
|
|
44
|
+
const roles = lightAccentRoles(accentId, appearance, pair, options);
|
|
45
|
+
const measured = variantId === void 0 ? void 0 : DEFAULT_PRIMARY_SUBTLE[variantId];
|
|
46
|
+
if (!roles || measured === void 0) return roles;
|
|
47
|
+
if (lightAccentRoles(accentId, appearance, pair, {
|
|
48
|
+
...options,
|
|
49
|
+
floor: Number.NEGATIVE_INFINITY
|
|
50
|
+
})?.primary !== roles.primary) throw new CatalogueRequired(`the tint of a repaired accent over ${variantId}`);
|
|
51
|
+
return {
|
|
52
|
+
...roles,
|
|
53
|
+
primarySubtle: measured
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* The accent's roles with the appearance standing in for the theme record. The four
|
|
59
|
+
* document properties depend on the appearance alone; `primarySubtle` reads the record,
|
|
60
|
+
* so callers that return it must correct it.
|
|
61
|
+
*/
|
|
62
|
+
function lightAccentRoles(accentId, appearance, pair, options) {
|
|
63
|
+
if (accentId === "theme") return void 0;
|
|
64
|
+
const context = {
|
|
65
|
+
target: appearance,
|
|
66
|
+
background: options.background,
|
|
67
|
+
floor: options.floor,
|
|
68
|
+
themeAccents: isThemeAccentId(accentId) ? lightThemeAccentsFor(pair.lightThemeId, pair.darkThemeId) : void 0
|
|
69
|
+
};
|
|
70
|
+
return resolveAccentRoles(accentId, context);
|
|
71
|
+
}
|
|
72
|
+
//#endregion
|
|
73
|
+
export { lightThemeEngine };
|
|
74
|
+
|
|
75
|
+
//# sourceMappingURL=theme-engine-light.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-engine-light.js","names":[],"sources":["../../src/lib/theme-engine-light.ts"],"sourcesContent":["/**\n * The light theme engine: the catalogue questions answered from the data that ships\n * with the provider, with no catalogue code or data (see `lib/theme-engine`).\n */\nimport type { AccentPreset } from '@adea-ai/themes'\nimport { primarySubtleCss } from '@adea-ai/themes'\nimport {\n accentOverrideVariables,\n resolveAccentRoles,\n type AccentRoles,\n type AccentTarget,\n} from './accent-roles'\nimport { isThemeAccentId } from './theme-accents'\nimport { themeCssVariablesWith } from './theme-css'\nimport {\n DEFAULT_FLOOR_EDITOR,\n DEFAULT_PRIMARY_SUBTLE,\n DEFAULT_THEME_ACCENTS,\n DEFAULT_VARIANTS,\n defaultDarkThemeId,\n defaultLightThemeId,\n isCatalogueThemeId,\n isDefaultThemeId,\n} from './theme-defaults'\nimport { CatalogueRequired, needsData, pairIds, type ThemeEngine } from './theme-engine'\nimport type {\n AccentVariableOptions,\n EditorRolesMode,\n ThemeAppearance,\n ThemeVariant,\n} from './themes'\n\nconst defaultVariantList: readonly ThemeVariant[] = [\n DEFAULT_VARIANTS[defaultLightThemeId],\n DEFAULT_VARIANTS[defaultDarkThemeId],\n]\n\nfunction lightEditor(theme: ThemeVariant, mode: EditorRolesMode) {\n if (mode !== 'floor' || DEFAULT_VARIANTS[theme.id as keyof typeof DEFAULT_VARIANTS] !== theme)\n return theme.editor\n return DEFAULT_FLOOR_EDITOR[theme.id] ?? theme.editor\n}\n\nfunction lightPrimarySubtle(theme: Pick<ThemeVariant, 'id' | 'appearance'>): string {\n const measured = DEFAULT_PRIMARY_SUBTLE[theme.id]\n if (measured) return measured\n if (isCatalogueThemeId(theme.id)) throw new CatalogueRequired(`the tint of ${theme.id}`)\n return primarySubtleCss(theme.appearance)\n}\n\nfunction lightThemeAccentsFor(lightThemeId: string, darkThemeId: string): readonly AccentPreset[] {\n const [light, dark] = pairIds(lightThemeId, darkThemeId)\n if (needsData(light) || needsData(dark))\n throw new CatalogueRequired(`the accents of ${light}/${dark}`)\n return DEFAULT_THEME_ACCENTS\n}\n\nexport const lightThemeEngine: ThemeEngine = {\n builtinThemes: defaultVariantList,\n isCatalogueVariant: (variant) =>\n isDefaultThemeId(variant.id) && DEFAULT_VARIANTS[variant.id] === variant,\n themeCssVariables(variant, options = {}) {\n if (needsData(variant.id)) throw new CatalogueRequired(`the roles of ${variant.id}`)\n return themeCssVariablesWith(\n { primarySubtle: lightPrimarySubtle, editor: lightEditor },\n variant,\n options\n )\n },\n themeAccentsFor: lightThemeAccentsFor,\n accentVariables(accentId, appearance, pair, options = {}) {\n const roles = lightAccentRoles(accentId, appearance, pair, options)\n return roles ? accentOverrideVariables(roles) : undefined\n },\n accentRolesForSelection(accentId, appearance, pair, options = {}) {\n if (accentId === 'theme') return undefined\n const variantId = options.variantId\n if (variantId !== undefined && needsData(variantId))\n throw new CatalogueRequired(`the accent roles over ${variantId}`)\n const roles = lightAccentRoles(accentId, appearance, pair, options)\n const measured = variantId === undefined ? undefined : DEFAULT_PRIMARY_SUBTLE[variantId]\n if (!roles || measured === undefined) return roles\n // The theme's own tint strength is shipped for the defaults, and is the right one\n // whenever the accent was not repaired. A repaired accent's tint is measured against\n // the repaired primary, which only the catalogue can do.\n const ungated = lightAccentRoles(accentId, appearance, pair, {\n ...options,\n floor: Number.NEGATIVE_INFINITY,\n })\n if (ungated?.primary !== roles.primary)\n throw new CatalogueRequired(`the tint of a repaired accent over ${variantId}`)\n return { ...roles, primarySubtle: measured }\n },\n}\n\n/**\n * The accent's roles with the appearance standing in for the theme record. The four\n * document properties depend on the appearance alone; `primarySubtle` reads the record,\n * so callers that return it must correct it.\n */\nfunction lightAccentRoles(\n accentId: string,\n appearance: ThemeAppearance,\n pair: { lightThemeId: string; darkThemeId: string },\n options: AccentVariableOptions\n): AccentRoles | undefined {\n if (accentId === 'theme') return undefined\n const context: AccentTarget = {\n target: appearance,\n background: options.background,\n floor: options.floor,\n themeAccents: isThemeAccentId(accentId)\n ? lightThemeAccentsFor(pair.lightThemeId, pair.darkThemeId)\n : undefined,\n }\n return resolveAccentRoles(accentId, context)\n}\n"],"mappings":";;;;;;;;AAgCA,IAAM,qBAA8C,CAClD,iBAAiB,sBACjB,iBAAiB,mBACnB;AAEA,SAAS,YAAY,OAAqB,MAAuB;CAC/D,IAAI,SAAS,WAAW,iBAAiB,MAAM,QAAyC,OACtF,OAAO,MAAM;CACf,OAAO,qBAAqB,MAAM,OAAO,MAAM;AACjD;AAEA,SAAS,mBAAmB,OAAwD;CAClF,MAAM,WAAW,uBAAuB,MAAM;CAC9C,IAAI,UAAU,OAAO;CACrB,IAAI,mBAAmB,MAAM,EAAE,GAAG,MAAM,IAAI,kBAAkB,eAAe,MAAM,IAAI;CACvF,OAAO,iBAAiB,MAAM,UAAU;AAC1C;AAEA,SAAS,qBAAqB,cAAsB,aAA8C;CAChG,MAAM,CAAC,OAAO,QAAQ,QAAQ,cAAc,WAAW;CACvD,IAAI,UAAU,KAAK,KAAK,UAAU,IAAI,GACpC,MAAM,IAAI,kBAAkB,kBAAkB,MAAM,GAAG,MAAM;CAC/D,OAAO;AACT;AAEA,IAAa,mBAAgC;CAC3C,eAAe;CACf,qBAAqB,YACnB,iBAAiB,QAAQ,EAAE,KAAK,iBAAiB,QAAQ,QAAQ;CACnE,kBAAkB,SAAS,UAAU,CAAC,GAAG;EACvC,IAAI,UAAU,QAAQ,EAAE,GAAG,MAAM,IAAI,kBAAkB,gBAAgB,QAAQ,IAAI;EACnF,OAAO,sBACL;GAAE,eAAe;GAAoB,QAAQ;EAAY,GACzD,SACA,OACF;CACF;CACA,iBAAiB;CACjB,gBAAgB,UAAU,YAAY,MAAM,UAAU,CAAC,GAAG;EACxD,MAAM,QAAQ,iBAAiB,UAAU,YAAY,MAAM,OAAO;EAClE,OAAO,QAAQ,wBAAwB,KAAK,IAAI,KAAA;CAClD;CACA,wBAAwB,UAAU,YAAY,MAAM,UAAU,CAAC,GAAG;EAChE,IAAI,aAAa,SAAS,OAAO,KAAA;EACjC,MAAM,YAAY,QAAQ;EAC1B,IAAI,cAAc,KAAA,KAAa,UAAU,SAAS,GAChD,MAAM,IAAI,kBAAkB,yBAAyB,WAAW;EAClE,MAAM,QAAQ,iBAAiB,UAAU,YAAY,MAAM,OAAO;EAClE,MAAM,WAAW,cAAc,KAAA,IAAY,KAAA,IAAY,uBAAuB;EAC9E,IAAI,CAAC,SAAS,aAAa,KAAA,GAAW,OAAO;EAQ7C,IAJgB,iBAAiB,UAAU,YAAY,MAAM;GAC3D,GAAG;GACH,OAAO,OAAO;EAChB,CACI,CAAA,EAAS,YAAY,MAAM,SAC7B,MAAM,IAAI,kBAAkB,sCAAsC,WAAW;EAC/E,OAAO;GAAE,GAAG;GAAO,eAAe;EAAS;CAC7C;AACF;;;;;;AAOA,SAAS,iBACP,UACA,YACA,MACA,SACyB;CACzB,IAAI,aAAa,SAAS,OAAO,KAAA;CACjC,MAAM,UAAwB;EAC5B,QAAQ;EACR,YAAY,QAAQ;EACpB,OAAO,QAAQ;EACf,cAAc,gBAAgB,QAAQ,IAClC,qBAAqB,KAAK,cAAc,KAAK,WAAW,IACxD,KAAA;CACN;CACA,OAAO,mBAAmB,UAAU,OAAO;AAC7C"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The catalogue-dependent operations a provider performs, as one seam.
|
|
3
|
+
*
|
|
4
|
+
* `ThemeProvider` needs to ask a handful of questions that only the catalogue can
|
|
5
|
+
* answer in general: the built-in variants, a variant's custom properties, the roles
|
|
6
|
+
* an accent paints over it, the accents a theme pair offers. Two engines answer them.
|
|
7
|
+
*
|
|
8
|
+
* - {@link catalogueThemeEngine} (`lib/theme-catalogue`) is the full answer, backed by
|
|
9
|
+
* the whole catalogue. It is what `ThemeProvider` uses and what the lazy provider
|
|
10
|
+
* switches to once the catalogue has loaded.
|
|
11
|
+
* - {@link lightThemeEngine} (`lib/theme-engine-light`) answers from the data that ships with the
|
|
12
|
+
* provider (`theme-defaults`): the default light/dark pair, host variants that are
|
|
13
|
+
* not in the catalogue, and nothing else. It imports no catalogue data, which is
|
|
14
|
+
* the point: a host that keeps the default pair never pays for the other 32
|
|
15
|
+
* themes. A question outside that set throws {@link CatalogueRequired}; the lazy
|
|
16
|
+
* provider asks {@link needsCatalogue} first and loads the catalogue instead.
|
|
17
|
+
*
|
|
18
|
+
* `tests/theme-engine.test.ts` holds the two to the same answers wherever the light
|
|
19
|
+
* engine can answer.
|
|
20
|
+
*/
|
|
21
|
+
import type { AccentPreset } from '@adea-ai/themes';
|
|
22
|
+
import type { AccentRoles } from './accent-roles';
|
|
23
|
+
import type { AccentVariableOptions, ThemeAppearance, ThemeCssVariableOptions, ThemeVariant } from './themes';
|
|
24
|
+
export type ThemeEngine = {
|
|
25
|
+
/** The built-in variants. A plain array, in catalogue order. */
|
|
26
|
+
readonly builtinThemes: readonly ThemeVariant[];
|
|
27
|
+
/** True for the catalogue's own variant, not a host's copy that merely shares its id. */
|
|
28
|
+
isCatalogueVariant(variant: ThemeVariant): boolean;
|
|
29
|
+
/** The custom properties a variant sets. */
|
|
30
|
+
themeCssVariables(variant: ThemeVariant, options?: ThemeCssVariableOptions): Record<string, string>;
|
|
31
|
+
/**
|
|
32
|
+
* The custom properties an accent selection overrides on the document (`--primary`, its
|
|
33
|
+
* foreground, hover and ring), or `undefined` when it overrides nothing.
|
|
34
|
+
*/
|
|
35
|
+
accentVariables(accentId: string, appearance: ThemeAppearance, pair: {
|
|
36
|
+
lightThemeId: string;
|
|
37
|
+
darkThemeId: string;
|
|
38
|
+
}, options?: AccentVariableOptions): Record<string, string> | undefined;
|
|
39
|
+
/** An accent selection resolved to its full roles against a theme pair, or `undefined`. */
|
|
40
|
+
accentRolesForSelection(accentId: string, appearance: ThemeAppearance, pair: {
|
|
41
|
+
lightThemeId: string;
|
|
42
|
+
darkThemeId: string;
|
|
43
|
+
}, options?: AccentVariableOptions): AccentRoles | undefined;
|
|
44
|
+
/** The accents a light/dark pair offers beside the presets. */
|
|
45
|
+
themeAccentsFor(lightThemeId: string, darkThemeId: string): readonly AccentPreset[];
|
|
46
|
+
};
|
|
47
|
+
/** Thrown by the light engine for a question that needs the whole catalogue. */
|
|
48
|
+
export declare class CatalogueRequired extends Error {
|
|
49
|
+
constructor(what: string);
|
|
50
|
+
}
|
|
51
|
+
/** The ids an id resolves to when the catalogue lacks it, as `getTheme ?? default` does. */
|
|
52
|
+
export declare function pairIds(lightThemeId: string, darkThemeId: string): [string, string];
|
|
53
|
+
/** A catalogue id other than the two defaults: its data is not in the light engine. */
|
|
54
|
+
export declare const needsData: (id: string) => boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Whether answering for this selection needs the catalogue.
|
|
57
|
+
*
|
|
58
|
+
* True when the variant being shown, the pinned terminal theme, or (for a
|
|
59
|
+
* theme-derived `ansi-*` accent) either theme of the pair is a catalogue theme other
|
|
60
|
+
* than the two defaults. Everything else — the default pair, a host's own variants,
|
|
61
|
+
* every preset and custom accent — the light engine answers from shipped data.
|
|
62
|
+
*/
|
|
63
|
+
export declare function needsCatalogue(selection: {
|
|
64
|
+
lightThemeId: string;
|
|
65
|
+
darkThemeId: string;
|
|
66
|
+
accent: string;
|
|
67
|
+
terminalThemeId?: string;
|
|
68
|
+
}, appearance: ThemeAppearance): boolean;
|
|
69
|
+
//# sourceMappingURL=theme-engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-engine.d.ts","sourceRoot":"","sources":["../../src/lib/theme-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAQjD,OAAO,KAAK,EACV,qBAAqB,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AAoD,CAAA;AAExF;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE;IACT,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB,EACD,UAAU,EAAE,eAAe,GAC1B,OAAO,CAQT"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { isThemeAccentId } from "./theme-accents.js";
|
|
2
|
+
import { defaultDarkThemeId, defaultLightThemeId, isCatalogueThemeId, isDefaultThemeId } from "./theme-defaults.js";
|
|
3
|
+
//#region src/lib/theme-engine.ts
|
|
4
|
+
/** Thrown by the light engine for a question that needs the whole catalogue. */
|
|
5
|
+
var CatalogueRequired = class extends Error {
|
|
6
|
+
constructor(what) {
|
|
7
|
+
super(`${what} needs the theme catalogue, which has not been loaded`);
|
|
8
|
+
this.name = "CatalogueRequired";
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
/** The ids an id resolves to when the catalogue lacks it, as `getTheme ?? default` does. */
|
|
12
|
+
function pairIds(lightThemeId, darkThemeId) {
|
|
13
|
+
return [isCatalogueThemeId(lightThemeId) ? lightThemeId : defaultLightThemeId, isCatalogueThemeId(darkThemeId) ? darkThemeId : defaultDarkThemeId];
|
|
14
|
+
}
|
|
15
|
+
/** A catalogue id other than the two defaults: its data is not in the light engine. */
|
|
16
|
+
var needsData = (id) => isCatalogueThemeId(id) && !isDefaultThemeId(id);
|
|
17
|
+
/**
|
|
18
|
+
* Whether answering for this selection needs the catalogue.
|
|
19
|
+
*
|
|
20
|
+
* True when the variant being shown, the pinned terminal theme, or (for a
|
|
21
|
+
* theme-derived `ansi-*` accent) either theme of the pair is a catalogue theme other
|
|
22
|
+
* than the two defaults. Everything else — the default pair, a host's own variants,
|
|
23
|
+
* every preset and custom accent — the light engine answers from shipped data.
|
|
24
|
+
*/
|
|
25
|
+
function needsCatalogue(selection, appearance) {
|
|
26
|
+
if (needsData(appearance === "dark" ? selection.darkThemeId : selection.lightThemeId)) return true;
|
|
27
|
+
if (selection.terminalThemeId !== void 0 && needsData(selection.terminalThemeId)) return true;
|
|
28
|
+
return isThemeAccentId(selection.accent) && (needsData(selection.lightThemeId) || needsData(selection.darkThemeId));
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { CatalogueRequired, needsCatalogue, needsData, pairIds };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=theme-engine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-engine.js","names":[],"sources":["../../src/lib/theme-engine.ts"],"sourcesContent":["/**\n * The catalogue-dependent operations a provider performs, as one seam.\n *\n * `ThemeProvider` needs to ask a handful of questions that only the catalogue can\n * answer in general: the built-in variants, a variant's custom properties, the roles\n * an accent paints over it, the accents a theme pair offers. Two engines answer them.\n *\n * - {@link catalogueThemeEngine} (`lib/theme-catalogue`) is the full answer, backed by\n * the whole catalogue. It is what `ThemeProvider` uses and what the lazy provider\n * switches to once the catalogue has loaded.\n * - {@link lightThemeEngine} (`lib/theme-engine-light`) answers from the data that ships with the\n * provider (`theme-defaults`): the default light/dark pair, host variants that are\n * not in the catalogue, and nothing else. It imports no catalogue data, which is\n * the point: a host that keeps the default pair never pays for the other 32\n * themes. A question outside that set throws {@link CatalogueRequired}; the lazy\n * provider asks {@link needsCatalogue} first and loads the catalogue instead.\n *\n * `tests/theme-engine.test.ts` holds the two to the same answers wherever the light\n * engine can answer.\n */\nimport type { AccentPreset } from '@adea-ai/themes'\nimport type { AccentRoles } from './accent-roles'\nimport { isThemeAccentId } from './theme-accents'\nimport {\n defaultDarkThemeId,\n defaultLightThemeId,\n isCatalogueThemeId,\n isDefaultThemeId,\n} from './theme-defaults'\nimport type {\n AccentVariableOptions,\n ThemeAppearance,\n ThemeCssVariableOptions,\n ThemeVariant,\n} from './themes'\n\nexport type ThemeEngine = {\n /** The built-in variants. A plain array, in catalogue order. */\n readonly builtinThemes: readonly ThemeVariant[]\n /** True for the catalogue's own variant, not a host's copy that merely shares its id. */\n isCatalogueVariant(variant: ThemeVariant): boolean\n /** The custom properties a variant sets. */\n themeCssVariables(\n variant: ThemeVariant,\n options?: ThemeCssVariableOptions\n ): Record<string, string>\n /**\n * The custom properties an accent selection overrides on the document (`--primary`, its\n * foreground, hover and ring), or `undefined` when it overrides nothing.\n */\n accentVariables(\n accentId: string,\n appearance: ThemeAppearance,\n pair: { lightThemeId: string; darkThemeId: string },\n options?: AccentVariableOptions\n ): Record<string, string> | undefined\n /** An accent selection resolved to its full roles against a theme pair, or `undefined`. */\n accentRolesForSelection(\n accentId: string,\n appearance: ThemeAppearance,\n pair: { lightThemeId: string; darkThemeId: string },\n options?: AccentVariableOptions\n ): AccentRoles | undefined\n /** The accents a light/dark pair offers beside the presets. */\n themeAccentsFor(lightThemeId: string, darkThemeId: string): readonly AccentPreset[]\n}\n\n/** Thrown by the light engine for a question that needs the whole catalogue. */\nexport class CatalogueRequired extends Error {\n constructor(what: string) {\n super(`${what} needs the theme catalogue, which has not been loaded`)\n this.name = 'CatalogueRequired'\n }\n}\n\n/** The ids an id resolves to when the catalogue lacks it, as `getTheme ?? default` does. */\nexport function pairIds(lightThemeId: string, darkThemeId: string): [string, string] {\n return [\n isCatalogueThemeId(lightThemeId) ? lightThemeId : defaultLightThemeId,\n isCatalogueThemeId(darkThemeId) ? darkThemeId : defaultDarkThemeId,\n ]\n}\n\n/** A catalogue id other than the two defaults: its data is not in the light engine. */\nexport const needsData = (id: string) => isCatalogueThemeId(id) && !isDefaultThemeId(id)\n\n/**\n * Whether answering for this selection needs the catalogue.\n *\n * True when the variant being shown, the pinned terminal theme, or (for a\n * theme-derived `ansi-*` accent) either theme of the pair is a catalogue theme other\n * than the two defaults. Everything else — the default pair, a host's own variants,\n * every preset and custom accent — the light engine answers from shipped data.\n */\nexport function needsCatalogue(\n selection: {\n lightThemeId: string\n darkThemeId: string\n accent: string\n terminalThemeId?: string\n },\n appearance: ThemeAppearance\n): boolean {\n const shown = appearance === 'dark' ? selection.darkThemeId : selection.lightThemeId\n if (needsData(shown)) return true\n if (selection.terminalThemeId !== undefined && needsData(selection.terminalThemeId)) return true\n return (\n isThemeAccentId(selection.accent) &&\n (needsData(selection.lightThemeId) || needsData(selection.darkThemeId))\n )\n}\n"],"mappings":";;;;AAoEA,IAAa,oBAAb,cAAuC,MAAM;CAC3C,YAAY,MAAc;EACxB,MAAM,GAAG,KAAK,sDAAsD;EACpE,KAAK,OAAO;CACd;AACF;;AAGA,SAAgB,QAAQ,cAAsB,aAAuC;CACnF,OAAO,CACL,mBAAmB,YAAY,IAAI,eAAe,qBAClD,mBAAmB,WAAW,IAAI,cAAc,kBAClD;AACF;;AAGA,IAAa,aAAa,OAAe,mBAAmB,EAAE,KAAK,CAAC,iBAAiB,EAAE;;;;;;;;;AAUvF,SAAgB,eACd,WAMA,YACS;CAET,IAAI,UADU,eAAe,SAAS,UAAU,cAAc,UAAU,YACrD,GAAG,OAAO;CAC7B,IAAI,UAAU,oBAAoB,KAAA,KAAa,UAAU,UAAU,eAAe,GAAG,OAAO;CAC5F,OACE,gBAAgB,UAAU,MAAM,MAC/B,UAAU,UAAU,YAAY,KAAK,UAAU,UAAU,WAAW;AAEzE"}
|