@promptctl/rich-js 0.2.0 → 0.3.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/README.md +29 -15
- package/dist/core/cells.d.ts +83 -3
- package/dist/core/cells.d.ts.map +1 -1
- package/dist/core/cells.js +113 -1
- package/dist/core/cells.js.map +1 -1
- package/dist/core/console.d.ts +0 -1
- package/dist/core/console.d.ts.map +1 -1
- package/dist/core/console.js +20 -16
- package/dist/core/console.js.map +1 -1
- package/dist/core/highlighter.d.ts.map +1 -1
- package/dist/core/highlighter.js.map +1 -1
- package/dist/core/oklch.d.ts +106 -0
- package/dist/core/oklch.d.ts.map +1 -0
- package/dist/core/oklch.js +221 -0
- package/dist/core/oklch.js.map +1 -0
- package/dist/core/render.d.ts +26 -7
- package/dist/core/render.d.ts.map +1 -1
- package/dist/core/render.js +83 -15
- package/dist/core/render.js.map +1 -1
- package/dist/core/segment.d.ts +14 -1
- package/dist/core/segment.d.ts.map +1 -1
- package/dist/core/segment.js +28 -3
- package/dist/core/segment.js.map +1 -1
- package/dist/core/style.d.ts +11 -2
- package/dist/core/style.d.ts.map +1 -1
- package/dist/core/style.js +31 -18
- package/dist/core/style.js.map +1 -1
- package/dist/core/text.d.ts +20 -0
- package/dist/core/text.d.ts.map +1 -1
- package/dist/core/text.js +31 -0
- package/dist/core/text.js.map +1 -1
- package/dist/index.d.ts +11 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -3
- package/dist/index.js.map +1 -1
- package/dist/renderables/columns.d.ts.map +1 -1
- package/dist/renderables/columns.js +15 -22
- package/dist/renderables/columns.js.map +1 -1
- package/dist/renderables/layout.d.ts.map +1 -1
- package/dist/renderables/layout.js +8 -29
- package/dist/renderables/layout.js.map +1 -1
- package/dist/renderables/live.d.ts.map +1 -1
- package/dist/renderables/live.js +8 -7
- package/dist/renderables/live.js.map +1 -1
- package/dist/renderables/panel.d.ts +34 -0
- package/dist/renderables/panel.d.ts.map +1 -1
- package/dist/renderables/panel.js +66 -23
- package/dist/renderables/panel.js.map +1 -1
- package/dist/template-bindings/index.d.ts +35 -0
- package/dist/template-bindings/index.d.ts.map +1 -1
- package/dist/template-bindings/index.js +61 -0
- package/dist/template-bindings/index.js.map +1 -1
- package/dist/template-bindings/style-funcs.d.ts.map +1 -1
- package/dist/template-bindings/style-funcs.js +32 -0
- package/dist/template-bindings/style-funcs.js.map +1 -1
- package/dist/themes/colorMath.d.ts +40 -0
- package/dist/themes/colorMath.d.ts.map +1 -1
- package/dist/themes/colorMath.js +82 -1
- package/dist/themes/colorMath.js.map +1 -1
- package/dist/themes/data/catppuccin-frappe.d.ts +4 -0
- package/dist/themes/data/catppuccin-frappe.d.ts.map +1 -0
- package/dist/themes/data/catppuccin-frappe.js +159 -0
- package/dist/themes/data/catppuccin-frappe.js.map +1 -0
- package/dist/themes/data/catppuccin-macchiato.d.ts +4 -0
- package/dist/themes/data/catppuccin-macchiato.d.ts.map +1 -0
- package/dist/themes/data/catppuccin-macchiato.js +159 -0
- package/dist/themes/data/catppuccin-macchiato.js.map +1 -0
- package/dist/themes/data/cyberpunk.d.ts +18 -0
- package/dist/themes/data/cyberpunk.d.ts.map +1 -0
- package/dist/themes/data/cyberpunk.js +192 -0
- package/dist/themes/data/cyberpunk.js.map +1 -0
- package/dist/themes/data/default.d.ts +4 -0
- package/dist/themes/data/default.d.ts.map +1 -0
- package/dist/themes/data/default.js +159 -0
- package/dist/themes/data/default.js.map +1 -0
- package/dist/themes/data/index.d.ts +10 -3
- package/dist/themes/data/index.d.ts.map +1 -1
- package/dist/themes/data/index.js +24 -7
- package/dist/themes/data/index.js.map +1 -1
- package/dist/themes/data/svg-export.d.ts +4 -0
- package/dist/themes/data/svg-export.d.ts.map +1 -0
- package/dist/themes/data/svg-export.js +159 -0
- package/dist/themes/data/svg-export.js.map +1 -0
- package/dist/themes/data/types.d.ts +4 -3
- package/dist/themes/data/types.d.ts.map +1 -1
- package/dist/themes/registry.d.ts +29 -2
- package/dist/themes/registry.d.ts.map +1 -1
- package/dist/themes/registry.js +62 -12
- package/dist/themes/registry.js.map +1 -1
- package/dist/themes/terminalThemes.d.ts +29 -20
- package/dist/themes/terminalThemes.d.ts.map +1 -1
- package/dist/themes/terminalThemes.js +50 -249
- package/dist/themes/terminalThemes.js.map +1 -1
- package/dist/themes/transpose.d.ts +88 -0
- package/dist/themes/transpose.d.ts.map +1 -0
- package/dist/themes/transpose.js +139 -0
- package/dist/themes/transpose.js.map +1 -0
- package/dist/widgets/button.d.ts +8 -5
- package/dist/widgets/button.d.ts.map +1 -1
- package/dist/widgets/button.js +36 -11
- package/dist/widgets/button.js.map +1 -1
- package/dist/widgets/checkbox.d.ts +1 -2
- package/dist/widgets/checkbox.d.ts.map +1 -1
- package/dist/widgets/checkbox.js +20 -7
- package/dist/widgets/checkbox.js.map +1 -1
- package/dist/widgets/dropdown.d.ts +4 -3
- package/dist/widgets/dropdown.d.ts.map +1 -1
- package/dist/widgets/dropdown.js +109 -27
- package/dist/widgets/dropdown.js.map +1 -1
- package/dist/widgets/event-router.d.ts +6 -3
- package/dist/widgets/event-router.d.ts.map +1 -1
- package/dist/widgets/event-router.js +179 -68
- package/dist/widgets/event-router.js.map +1 -1
- package/dist/widgets/focus-manager.d.ts +2 -1
- package/dist/widgets/focus-manager.d.ts.map +1 -1
- package/dist/widgets/focus-manager.js +28 -9
- package/dist/widgets/focus-manager.js.map +1 -1
- package/dist/widgets/index.d.ts +2 -2
- package/dist/widgets/index.d.ts.map +1 -1
- package/dist/widgets/index.js +1 -1
- package/dist/widgets/index.js.map +1 -1
- package/dist/widgets/screen.d.ts +2 -0
- package/dist/widgets/screen.d.ts.map +1 -1
- package/dist/widgets/screen.js +148 -45
- package/dist/widgets/screen.js.map +1 -1
- package/dist/widgets/slider.d.ts +6 -3
- package/dist/widgets/slider.d.ts.map +1 -1
- package/dist/widgets/slider.js +34 -10
- package/dist/widgets/slider.js.map +1 -1
- package/dist/widgets/static-item.d.ts +1 -1
- package/dist/widgets/static-item.d.ts.map +1 -1
- package/dist/widgets/static-item.js +12 -13
- package/dist/widgets/static-item.js.map +1 -1
- package/dist/widgets/text-input.d.ts +239 -13
- package/dist/widgets/text-input.d.ts.map +1 -1
- package/dist/widgets/text-input.js +1004 -74
- package/dist/widgets/text-input.js.map +1 -1
- package/dist/widgets/toggle.d.ts +1 -2
- package/dist/widgets/toggle.d.ts.map +1 -1
- package/dist/widgets/toggle.js +20 -8
- package/dist/widgets/toggle.js.map +1 -1
- package/dist/widgets/types.d.ts +21 -4
- package/dist/widgets/types.d.ts.map +1 -1
- package/dist/widgets/types.js +19 -0
- package/dist/widgets/types.js.map +1 -1
- package/dist/widgets/widget-base.d.ts +1 -0
- package/dist/widgets/widget-base.d.ts.map +1 -1
- package/dist/widgets/widget-base.js +24 -7
- package/dist/widgets/widget-base.js.map +1 -1
- package/package.json +5 -3
|
@@ -1,32 +1,38 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Pre-built `TerminalTheme` constants —
|
|
2
|
+
* Pre-built `TerminalTheme` constants — every theme in the registry has a
|
|
3
|
+
* matching `<NAME>` export here. There is no inline-only theme; the data
|
|
4
|
+
* file is the single source of truth for every theme's hex values.
|
|
3
5
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* Editing `data/<name>.ts` updates both the registry's full ~150-var
|
|
7
|
+
* palette (via `getThemePalette(name)`) AND the matching `TerminalTheme`
|
|
8
|
+
* constant exported below (via `getThemeBaseColors(name)`, which pulls
|
|
9
|
+
* just the 8 substrate keys). The two views never drift because both
|
|
10
|
+
* derive from the same authored data.
|
|
9
11
|
*
|
|
10
|
-
* [LAW:one-
|
|
11
|
-
*
|
|
12
|
-
*
|
|
12
|
+
* [LAW:one-source-of-truth] Hex values live in `data/<name>.ts`. This
|
|
13
|
+
* module is a derived view that builds a `TerminalTheme` from each
|
|
14
|
+
* theme's eight base colors via `buildPalette` for the substrate palette
|
|
15
|
+
* and `STANDARD_TABLE` for the ANSI substrate.
|
|
13
16
|
*
|
|
14
|
-
* [LAW:one-
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* could be edited independently.
|
|
17
|
+
* [LAW:one-type-per-behavior] Every theme has the same shape — name,
|
|
18
|
+
* `dark` flag, full Palette in the registry, `TerminalTheme` constant
|
|
19
|
+
* here. Consumers can pick any theme by name without branching on which
|
|
20
|
+
* APIs work for it.
|
|
19
21
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
22
|
+
* [LAW:one-way-deps] `core/color → themes/palette` remains the only edge
|
|
23
|
+
* into themes/. This file imports only sibling theme modules and core
|
|
24
|
+
* color primitives; nothing in `core/` imports back.
|
|
25
|
+
*
|
|
26
|
+
* Note on `ansiColors`: every preset theme uses `STANDARD_TABLE`. Theme
|
|
27
|
+
* identity lives in the semantic `palette`, not in the standard ANSI
|
|
28
|
+
* 16/256 LUT — `ColorSpec.parse("red")` is intentionally canonical across
|
|
29
|
+
* themes, matching Textual's model.
|
|
25
30
|
*/
|
|
26
|
-
import {
|
|
31
|
+
import { STANDARD_TABLE, TerminalTheme, } from "../core/color.js";
|
|
27
32
|
import { buildPalette } from "./buildPalette.js";
|
|
33
|
+
import { getThemeBaseColors } from "./registry.js";
|
|
28
34
|
function defineTheme(d) {
|
|
29
|
-
return new TerminalTheme(d.bg, d.fg, STANDARD_TABLE, buildPalette(d.name, d.
|
|
35
|
+
return new TerminalTheme(d.bg, d.fg, STANDARD_TABLE, buildPalette(d.name, d.dark, {
|
|
30
36
|
primary: d.primary,
|
|
31
37
|
secondary: d.secondary,
|
|
32
38
|
accent: d.accent,
|
|
@@ -37,232 +43,27 @@ function defineTheme(d) {
|
|
|
37
43
|
foreground: d.fg,
|
|
38
44
|
}));
|
|
39
45
|
}
|
|
40
|
-
export const DEFAULT_TERMINAL_THEME = defineTheme(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
export const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
});
|
|
64
|
-
export const SVG_EXPORT_THEME = defineTheme({
|
|
65
|
-
name: "svg-export",
|
|
66
|
-
isDark: true,
|
|
67
|
-
bg: new ColorRgba(41, 41, 41),
|
|
68
|
-
fg: new ColorRgba(197, 200, 198),
|
|
69
|
-
primary: new ColorRgba(97, 175, 239),
|
|
70
|
-
secondary: new ColorRgba(198, 120, 221),
|
|
71
|
-
accent: new ColorRgba(86, 182, 194),
|
|
72
|
-
success: new ColorRgba(152, 195, 121),
|
|
73
|
-
warning: new ColorRgba(229, 192, 123),
|
|
74
|
-
error: new ColorRgba(204, 85, 90),
|
|
75
|
-
});
|
|
76
|
-
export const NORD = defineTheme({
|
|
77
|
-
name: "nord",
|
|
78
|
-
isDark: true,
|
|
79
|
-
bg: new ColorRgba(46, 52, 64),
|
|
80
|
-
fg: new ColorRgba(216, 222, 233),
|
|
81
|
-
primary: new ColorRgba(136, 192, 208),
|
|
82
|
-
secondary: new ColorRgba(129, 161, 193),
|
|
83
|
-
accent: new ColorRgba(180, 142, 173),
|
|
84
|
-
success: new ColorRgba(163, 190, 140),
|
|
85
|
-
warning: new ColorRgba(235, 203, 139),
|
|
86
|
-
error: new ColorRgba(191, 97, 106),
|
|
87
|
-
});
|
|
88
|
-
export const GRUVBOX = defineTheme({
|
|
89
|
-
name: "gruvbox",
|
|
90
|
-
isDark: true,
|
|
91
|
-
bg: new ColorRgba(40, 40, 40),
|
|
92
|
-
fg: new ColorRgba(251, 241, 199),
|
|
93
|
-
primary: new ColorRgba(133, 165, 152),
|
|
94
|
-
secondary: new ColorRgba(168, 154, 133),
|
|
95
|
-
accent: new ColorRgba(250, 189, 47),
|
|
96
|
-
success: new ColorRgba(184, 187, 38),
|
|
97
|
-
warning: new ColorRgba(254, 128, 25),
|
|
98
|
-
error: new ColorRgba(251, 73, 52),
|
|
99
|
-
});
|
|
100
|
-
export const DRACULA = defineTheme({
|
|
101
|
-
name: "dracula",
|
|
102
|
-
isDark: true,
|
|
103
|
-
bg: new ColorRgba(40, 42, 54),
|
|
104
|
-
fg: new ColorRgba(248, 248, 242),
|
|
105
|
-
primary: new ColorRgba(189, 147, 249),
|
|
106
|
-
secondary: new ColorRgba(98, 114, 164),
|
|
107
|
-
accent: new ColorRgba(255, 121, 198),
|
|
108
|
-
success: new ColorRgba(80, 250, 123),
|
|
109
|
-
warning: new ColorRgba(255, 184, 108),
|
|
110
|
-
error: new ColorRgba(255, 85, 85),
|
|
111
|
-
});
|
|
112
|
-
export const TOKYO_NIGHT = defineTheme({
|
|
113
|
-
name: "tokyo-night",
|
|
114
|
-
isDark: true,
|
|
115
|
-
bg: new ColorRgba(26, 27, 38),
|
|
116
|
-
fg: new ColorRgba(169, 177, 214),
|
|
117
|
-
primary: new ColorRgba(187, 154, 247),
|
|
118
|
-
secondary: new ColorRgba(122, 162, 247),
|
|
119
|
-
accent: new ColorRgba(255, 158, 100),
|
|
120
|
-
success: new ColorRgba(158, 206, 106),
|
|
121
|
-
warning: new ColorRgba(224, 175, 104),
|
|
122
|
-
error: new ColorRgba(247, 118, 142),
|
|
123
|
-
});
|
|
124
|
-
export const FLEXOKI = defineTheme({
|
|
125
|
-
name: "flexoki",
|
|
126
|
-
isDark: true,
|
|
127
|
-
bg: new ColorRgba(16, 15, 15),
|
|
128
|
-
fg: new ColorRgba(255, 252, 240),
|
|
129
|
-
primary: new ColorRgba(32, 94, 166),
|
|
130
|
-
secondary: new ColorRgba(36, 131, 123),
|
|
131
|
-
accent: new ColorRgba(155, 118, 200),
|
|
132
|
-
success: new ColorRgba(102, 128, 11),
|
|
133
|
-
warning: new ColorRgba(173, 131, 1),
|
|
134
|
-
error: new ColorRgba(175, 48, 41),
|
|
135
|
-
});
|
|
136
|
-
export const CATPPUCCIN_MOCHA = defineTheme({
|
|
137
|
-
name: "catppuccin-mocha",
|
|
138
|
-
isDark: true,
|
|
139
|
-
bg: new ColorRgba(24, 24, 37),
|
|
140
|
-
fg: new ColorRgba(205, 214, 244),
|
|
141
|
-
primary: new ColorRgba(245, 194, 231),
|
|
142
|
-
secondary: new ColorRgba(203, 166, 247),
|
|
143
|
-
accent: new ColorRgba(250, 179, 135),
|
|
144
|
-
success: new ColorRgba(171, 233, 179),
|
|
145
|
-
warning: new ColorRgba(250, 227, 176),
|
|
146
|
-
error: new ColorRgba(242, 143, 173),
|
|
147
|
-
});
|
|
148
|
-
export const CATPPUCCIN_LATTE = defineTheme({
|
|
149
|
-
name: "catppuccin-latte",
|
|
150
|
-
isDark: false,
|
|
151
|
-
bg: new ColorRgba(239, 241, 245),
|
|
152
|
-
fg: new ColorRgba(76, 79, 105),
|
|
153
|
-
primary: new ColorRgba(136, 57, 239),
|
|
154
|
-
secondary: new ColorRgba(220, 138, 120),
|
|
155
|
-
accent: new ColorRgba(254, 100, 11),
|
|
156
|
-
success: new ColorRgba(64, 160, 43),
|
|
157
|
-
warning: new ColorRgba(223, 142, 29),
|
|
158
|
-
error: new ColorRgba(210, 15, 57),
|
|
159
|
-
});
|
|
160
|
-
export const CATPPUCCIN_FRAPPE = defineTheme({
|
|
161
|
-
name: "catppuccin-frappe",
|
|
162
|
-
isDark: true,
|
|
163
|
-
bg: new ColorRgba(48, 52, 70),
|
|
164
|
-
fg: new ColorRgba(198, 208, 245),
|
|
165
|
-
primary: new ColorRgba(202, 158, 230),
|
|
166
|
-
secondary: new ColorRgba(239, 159, 118),
|
|
167
|
-
accent: new ColorRgba(244, 184, 228),
|
|
168
|
-
success: new ColorRgba(166, 209, 137),
|
|
169
|
-
warning: new ColorRgba(229, 200, 144),
|
|
170
|
-
error: new ColorRgba(231, 130, 132),
|
|
171
|
-
});
|
|
172
|
-
export const CATPPUCCIN_MACCHIATO = defineTheme({
|
|
173
|
-
name: "catppuccin-macchiato",
|
|
174
|
-
isDark: true,
|
|
175
|
-
bg: new ColorRgba(36, 39, 58),
|
|
176
|
-
fg: new ColorRgba(202, 211, 245),
|
|
177
|
-
primary: new ColorRgba(198, 160, 246),
|
|
178
|
-
secondary: new ColorRgba(245, 169, 127),
|
|
179
|
-
accent: new ColorRgba(245, 189, 230),
|
|
180
|
-
success: new ColorRgba(166, 218, 149),
|
|
181
|
-
warning: new ColorRgba(238, 212, 159),
|
|
182
|
-
error: new ColorRgba(237, 135, 150),
|
|
183
|
-
});
|
|
184
|
-
export const SOLARIZED_DARK = defineTheme({
|
|
185
|
-
name: "solarized-dark",
|
|
186
|
-
isDark: true,
|
|
187
|
-
bg: new ColorRgba(0, 43, 54),
|
|
188
|
-
fg: new ColorRgba(131, 148, 150),
|
|
189
|
-
primary: new ColorRgba(38, 139, 210),
|
|
190
|
-
secondary: new ColorRgba(42, 161, 152),
|
|
191
|
-
accent: new ColorRgba(108, 113, 196),
|
|
192
|
-
success: new ColorRgba(133, 153, 0),
|
|
193
|
-
warning: new ColorRgba(203, 75, 22),
|
|
194
|
-
error: new ColorRgba(220, 50, 47),
|
|
195
|
-
});
|
|
196
|
-
export const SOLARIZED_LIGHT = defineTheme({
|
|
197
|
-
name: "solarized-light",
|
|
198
|
-
isDark: false,
|
|
199
|
-
bg: new ColorRgba(253, 246, 227),
|
|
200
|
-
fg: new ColorRgba(88, 110, 117),
|
|
201
|
-
primary: new ColorRgba(38, 139, 210),
|
|
202
|
-
secondary: new ColorRgba(42, 161, 152),
|
|
203
|
-
accent: new ColorRgba(108, 113, 196),
|
|
204
|
-
success: new ColorRgba(133, 153, 0),
|
|
205
|
-
warning: new ColorRgba(203, 75, 22),
|
|
206
|
-
error: new ColorRgba(220, 50, 47),
|
|
207
|
-
});
|
|
208
|
-
export const ROSE_PINE = defineTheme({
|
|
209
|
-
name: "rose-pine",
|
|
210
|
-
isDark: true,
|
|
211
|
-
bg: new ColorRgba(25, 23, 36),
|
|
212
|
-
fg: new ColorRgba(224, 222, 244),
|
|
213
|
-
primary: new ColorRgba(196, 167, 231),
|
|
214
|
-
secondary: new ColorRgba(49, 116, 143),
|
|
215
|
-
accent: new ColorRgba(235, 188, 186),
|
|
216
|
-
success: new ColorRgba(156, 207, 216),
|
|
217
|
-
warning: new ColorRgba(246, 193, 119),
|
|
218
|
-
error: new ColorRgba(235, 111, 146),
|
|
219
|
-
});
|
|
220
|
-
export const ROSE_PINE_MOON = defineTheme({
|
|
221
|
-
name: "rose-pine-moon",
|
|
222
|
-
isDark: true,
|
|
223
|
-
bg: new ColorRgba(35, 33, 54),
|
|
224
|
-
fg: new ColorRgba(224, 222, 244),
|
|
225
|
-
primary: new ColorRgba(196, 167, 231),
|
|
226
|
-
secondary: new ColorRgba(62, 143, 176),
|
|
227
|
-
accent: new ColorRgba(234, 154, 151),
|
|
228
|
-
success: new ColorRgba(156, 207, 216),
|
|
229
|
-
warning: new ColorRgba(246, 193, 119),
|
|
230
|
-
error: new ColorRgba(235, 111, 146),
|
|
231
|
-
});
|
|
232
|
-
export const ROSE_PINE_DAWN = defineTheme({
|
|
233
|
-
name: "rose-pine-dawn",
|
|
234
|
-
isDark: false,
|
|
235
|
-
bg: new ColorRgba(250, 244, 237),
|
|
236
|
-
fg: new ColorRgba(87, 82, 121),
|
|
237
|
-
primary: new ColorRgba(144, 122, 169),
|
|
238
|
-
secondary: new ColorRgba(40, 105, 131),
|
|
239
|
-
accent: new ColorRgba(215, 130, 126),
|
|
240
|
-
success: new ColorRgba(86, 148, 159),
|
|
241
|
-
warning: new ColorRgba(234, 157, 52),
|
|
242
|
-
error: new ColorRgba(180, 99, 122),
|
|
243
|
-
});
|
|
244
|
-
export const ATOM_ONE_DARK = defineTheme({
|
|
245
|
-
name: "atom-one-dark",
|
|
246
|
-
isDark: true,
|
|
247
|
-
bg: new ColorRgba(40, 44, 52),
|
|
248
|
-
fg: new ColorRgba(171, 178, 191),
|
|
249
|
-
primary: new ColorRgba(97, 175, 239),
|
|
250
|
-
secondary: new ColorRgba(198, 120, 221),
|
|
251
|
-
accent: new ColorRgba(163, 120, 194),
|
|
252
|
-
success: new ColorRgba(98, 240, 98),
|
|
253
|
-
warning: new ColorRgba(222, 178, 91),
|
|
254
|
-
error: new ColorRgba(240, 98, 98),
|
|
255
|
-
});
|
|
256
|
-
export const ATOM_ONE_LIGHT = defineTheme({
|
|
257
|
-
name: "atom-one-light",
|
|
258
|
-
isDark: false,
|
|
259
|
-
bg: new ColorRgba(250, 250, 250),
|
|
260
|
-
fg: new ColorRgba(56, 58, 66),
|
|
261
|
-
primary: new ColorRgba(64, 120, 242),
|
|
262
|
-
secondary: new ColorRgba(166, 38, 164),
|
|
263
|
-
accent: new ColorRgba(191, 146, 50),
|
|
264
|
-
success: new ColorRgba(108, 242, 63),
|
|
265
|
-
warning: new ColorRgba(216, 217, 56),
|
|
266
|
-
error: new ColorRgba(242, 63, 63),
|
|
267
|
-
});
|
|
46
|
+
export const DEFAULT_TERMINAL_THEME = defineTheme(getThemeBaseColors("default"));
|
|
47
|
+
export const SVG_EXPORT_THEME = defineTheme(getThemeBaseColors("svg-export"));
|
|
48
|
+
export const MONOKAI = defineTheme(getThemeBaseColors("monokai"));
|
|
49
|
+
export const NORD = defineTheme(getThemeBaseColors("nord"));
|
|
50
|
+
export const GRUVBOX = defineTheme(getThemeBaseColors("gruvbox"));
|
|
51
|
+
export const DRACULA = defineTheme(getThemeBaseColors("dracula"));
|
|
52
|
+
export const TOKYO_NIGHT = defineTheme(getThemeBaseColors("tokyo-night"));
|
|
53
|
+
export const FLEXOKI = defineTheme(getThemeBaseColors("flexoki"));
|
|
54
|
+
export const CYBERPUNK = defineTheme(getThemeBaseColors("cyberpunk"));
|
|
55
|
+
export const CATPPUCCIN_MOCHA = defineTheme(getThemeBaseColors("catppuccin-mocha"));
|
|
56
|
+
export const CATPPUCCIN_LATTE = defineTheme(getThemeBaseColors("catppuccin-latte"));
|
|
57
|
+
export const CATPPUCCIN_FRAPPE = defineTheme(getThemeBaseColors("catppuccin-frappe"));
|
|
58
|
+
export const CATPPUCCIN_MACCHIATO = defineTheme(getThemeBaseColors("catppuccin-macchiato"));
|
|
59
|
+
export const SOLARIZED_DARK = defineTheme(getThemeBaseColors("solarized-dark"));
|
|
60
|
+
export const SOLARIZED_LIGHT = defineTheme(getThemeBaseColors("solarized-light"));
|
|
61
|
+
export const ROSE_PINE = defineTheme(getThemeBaseColors("rose-pine"));
|
|
62
|
+
export const ROSE_PINE_MOON = defineTheme(getThemeBaseColors("rose-pine-moon"));
|
|
63
|
+
export const ROSE_PINE_DAWN = defineTheme(getThemeBaseColors("rose-pine-dawn"));
|
|
64
|
+
export const ATOM_ONE_DARK = defineTheme(getThemeBaseColors("atom-one-dark"));
|
|
65
|
+
export const ATOM_ONE_LIGHT = defineTheme(getThemeBaseColors("atom-one-light"));
|
|
66
|
+
export const TEXTUAL_DARK = defineTheme(getThemeBaseColors("textual-dark"));
|
|
67
|
+
export const TEXTUAL_LIGHT = defineTheme(getThemeBaseColors("textual-light"));
|
|
68
|
+
export const TEXTUAL_ANSI = defineTheme(getThemeBaseColors("textual-ansi"));
|
|
268
69
|
//# sourceMappingURL=terminalThemes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminalThemes.js","sourceRoot":"","sources":["../../src/themes/terminalThemes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EACL,SAAS,EACT,cAAc,EACd,aAAa,GACd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAejD,SAAS,WAAW,CAAC,CAAW;IAC9B,OAAO,IAAI,aAAa,CACtB,CAAC,CAAC,EAAE,EACJ,CAAC,CAAC,EAAE,EACJ,cAAc,EACd,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G,WAAW,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC,CAAC;AAC9E,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAC,CAAC;AAChF,MAAM,CAAC,MAAM,YAAY,GAAG,WAAW,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAC,CAAC;AAC5E,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC,CAAC;AAC9E,MAAM,CAAC,MAAM,YAAY,GAAG,WAAW,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transpose a Palette to a new "key" — analogous to transposing a melody.
|
|
3
|
+
*
|
|
4
|
+
* melody / chord progression :: Palette (relationships between colors)
|
|
5
|
+
* key (signature) :: ThemeKey (hue / chroma / lightness deltas)
|
|
6
|
+
* "in C major" / "in D…" :: the resulting transposed Palette
|
|
7
|
+
*
|
|
8
|
+
* Because OKLCH is perceptually uniform, "+30° hue" looks like a
|
|
9
|
+
* consistent jump everywhere on the color wheel — the way a perfect-fifth
|
|
10
|
+
* interval sounds the same in every musical key. Transposition is closed
|
|
11
|
+
* under composition: `transpose(transpose(p, k1), k2)` produces the same
|
|
12
|
+
* colors as a single transpose with the combined deltas, modulo round-trip
|
|
13
|
+
* quantization.
|
|
14
|
+
*
|
|
15
|
+
* [LAW:dataflow-not-control-flow] A single uniform per-color transform
|
|
16
|
+
* runs for every var in the palette. Anchor protection selects *which*
|
|
17
|
+
* `ThemeKey` to apply (data), not *whether* to apply one (branch).
|
|
18
|
+
*
|
|
19
|
+
* [LAW:one-source-of-truth] Anchor classification lives only in
|
|
20
|
+
* `ANCHORED_ROOTS` below. The buildPalette derivation guarantees every
|
|
21
|
+
* variant of a semantic root shares the root as its hyphen prefix
|
|
22
|
+
* (`error`, `error-darken-1`, `error-lighten-2`, ...), so one set covers
|
|
23
|
+
* the whole family.
|
|
24
|
+
*
|
|
25
|
+
* [LAW:one-way-deps] Imports flow `core/oklch → themes/transpose`;
|
|
26
|
+
* nothing in core/ depends back on this file.
|
|
27
|
+
*/
|
|
28
|
+
import { type ThemeKey } from "../core/oklch.js";
|
|
29
|
+
import { Palette } from "./palette.js";
|
|
30
|
+
/**
|
|
31
|
+
* Semantic roots whose hue is locked under transposition. `error` must
|
|
32
|
+
* look red-ish, `success` green-ish, `warning` amber-ish — rotating the
|
|
33
|
+
* hue would make the UI lie about meaning. Lightness and chroma *still*
|
|
34
|
+
* transform for these roles, so they invert correctly during dark↔light
|
|
35
|
+
* flips and respond to chroma scaling alongside everything else.
|
|
36
|
+
*/
|
|
37
|
+
export declare const ANCHORED_ROOTS: ReadonlySet<string>;
|
|
38
|
+
/**
|
|
39
|
+
* Whether a palette var's hue is locked under transposition. The single
|
|
40
|
+
* predicate used by `transposePalette`. Exported so callers building
|
|
41
|
+
* higher-level theme machinery can stay consistent with the locking rule.
|
|
42
|
+
*/
|
|
43
|
+
export declare function isAnchored(varName: string): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Return a new `Palette` whose colors are the transposition of `palette`'s
|
|
46
|
+
* colors by `key`. Pure. Identity (`IDENTITY`) returns a Palette with byte-exact
|
|
47
|
+
* colors — fast-pathed so identity does not pay the sRGB↔OKLCH round-trip
|
|
48
|
+
* quantization cost.
|
|
49
|
+
*
|
|
50
|
+
* The `dark` flag of the result is derived from the actual lightness of
|
|
51
|
+
* the resulting `background` var (`Oklch.fromRgba(bg).l < 0.5`) — *not*
|
|
52
|
+
* from the key's coefficients. The strongest theorem: "dark iff
|
|
53
|
+
* background is dark." This is honest under every transform — pure
|
|
54
|
+
* lightness shifts, mirror-inversions, hue rotations that don't touch L,
|
|
55
|
+
* and combinations of all three. [LAW:types-are-the-program]
|
|
56
|
+
*
|
|
57
|
+
* The transposing path throws if the palette has no `background` var (the
|
|
58
|
+
* `dark`-flag derivation has nothing to read). Failing loudly is preferred
|
|
59
|
+
* over a silent fallback because the alternative — trusting the source
|
|
60
|
+
* `palette.dark` after an arbitrary L-transform — produces flags that lie.
|
|
61
|
+
* The identity fast-path is exempt: it preserves the source `dark` flag
|
|
62
|
+
* verbatim (no derivation), so it needs no `background` and never throws.
|
|
63
|
+
*
|
|
64
|
+
* @param name Optional override for the resulting palette name. Defaults
|
|
65
|
+
* to the source palette's name. Callers building a family of transposed
|
|
66
|
+
* palettes (e.g. "gruvbox +60°") supply their own.
|
|
67
|
+
*/
|
|
68
|
+
export declare function transposePalette(palette: Palette, key: ThemeKey, name?: string): Palette;
|
|
69
|
+
/**
|
|
70
|
+
* Build the `ThemeKey` that rotates `palette` so its *tonic* var lands on
|
|
71
|
+
* `targetHueDeg`. The musical operation directly: a key is the set of
|
|
72
|
+
* intervals from the tonic, so "play this theme in the key of <hue>" means
|
|
73
|
+
* "shift every color by exactly the interval that carries the tonic's
|
|
74
|
+
* current hue to the target." Pick the tonic's pitch and the rest follows.
|
|
75
|
+
*
|
|
76
|
+
* Returns a hue-only key (chroma and lightness untouched). Callers that also
|
|
77
|
+
* want to scale chroma or shift lightness spread their own axes over the
|
|
78
|
+
* result — those are independent transposition dimensions, not part of
|
|
79
|
+
* choosing the key. [LAW:one-type-per-behavior] a degree-shift key and a
|
|
80
|
+
* root-note key are the *same* transform; this is just a second constructor
|
|
81
|
+
* for it, so `transposePalette` stays untouched.
|
|
82
|
+
*
|
|
83
|
+
* Throws if `tonicVar` is absent — the interval has no anchor to measure
|
|
84
|
+
* from, so there is no honest key to return. Failing loudly beats inventing
|
|
85
|
+
* a zero shift that would silently mean "no transposition."
|
|
86
|
+
*/
|
|
87
|
+
export declare function themeKeyForRoot(palette: Palette, tonicVar: string, targetHueDeg: number): ThemeKey;
|
|
88
|
+
//# sourceMappingURL=transpose.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transpose.d.ts","sourceRoot":"","sources":["../../src/themes/transpose.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,OAAO,EAAwB,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC;;;;;;GAMG;AAKH,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,CAI7C,CAAC;AAOH;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEnD;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,QAAQ,EACb,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAsBT;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,GACnB,QAAQ,CAoBV"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transpose a Palette to a new "key" — analogous to transposing a melody.
|
|
3
|
+
*
|
|
4
|
+
* melody / chord progression :: Palette (relationships between colors)
|
|
5
|
+
* key (signature) :: ThemeKey (hue / chroma / lightness deltas)
|
|
6
|
+
* "in C major" / "in D…" :: the resulting transposed Palette
|
|
7
|
+
*
|
|
8
|
+
* Because OKLCH is perceptually uniform, "+30° hue" looks like a
|
|
9
|
+
* consistent jump everywhere on the color wheel — the way a perfect-fifth
|
|
10
|
+
* interval sounds the same in every musical key. Transposition is closed
|
|
11
|
+
* under composition: `transpose(transpose(p, k1), k2)` produces the same
|
|
12
|
+
* colors as a single transpose with the combined deltas, modulo round-trip
|
|
13
|
+
* quantization.
|
|
14
|
+
*
|
|
15
|
+
* [LAW:dataflow-not-control-flow] A single uniform per-color transform
|
|
16
|
+
* runs for every var in the palette. Anchor protection selects *which*
|
|
17
|
+
* `ThemeKey` to apply (data), not *whether* to apply one (branch).
|
|
18
|
+
*
|
|
19
|
+
* [LAW:one-source-of-truth] Anchor classification lives only in
|
|
20
|
+
* `ANCHORED_ROOTS` below. The buildPalette derivation guarantees every
|
|
21
|
+
* variant of a semantic root shares the root as its hyphen prefix
|
|
22
|
+
* (`error`, `error-darken-1`, `error-lighten-2`, ...), so one set covers
|
|
23
|
+
* the whole family.
|
|
24
|
+
*
|
|
25
|
+
* [LAW:one-way-deps] Imports flow `core/oklch → themes/transpose`;
|
|
26
|
+
* nothing in core/ depends back on this file.
|
|
27
|
+
*/
|
|
28
|
+
import { Oklch, isIdentityKey } from "../core/oklch.js";
|
|
29
|
+
import { Palette } from "./palette.js";
|
|
30
|
+
/**
|
|
31
|
+
* Semantic roots whose hue is locked under transposition. `error` must
|
|
32
|
+
* look red-ish, `success` green-ish, `warning` amber-ish — rotating the
|
|
33
|
+
* hue would make the UI lie about meaning. Lightness and chroma *still*
|
|
34
|
+
* transform for these roles, so they invert correctly during dark↔light
|
|
35
|
+
* flips and respond to chroma scaling alongside everything else.
|
|
36
|
+
*/
|
|
37
|
+
// [LAW:types-are-the-program] The `ReadonlySet` type is the immutability
|
|
38
|
+
// enforcement — typed code cannot call `add`/`delete`. (`Object.freeze` is
|
|
39
|
+
// not used here because it is a no-op on Set membership; relying on it would
|
|
40
|
+
// imply a runtime guarantee it does not provide.)
|
|
41
|
+
export const ANCHORED_ROOTS = new Set([
|
|
42
|
+
"error",
|
|
43
|
+
"success",
|
|
44
|
+
"warning",
|
|
45
|
+
]);
|
|
46
|
+
function rootOf(varName) {
|
|
47
|
+
const dash = varName.indexOf("-");
|
|
48
|
+
return dash === -1 ? varName : varName.slice(0, dash);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Whether a palette var's hue is locked under transposition. The single
|
|
52
|
+
* predicate used by `transposePalette`. Exported so callers building
|
|
53
|
+
* higher-level theme machinery can stay consistent with the locking rule.
|
|
54
|
+
*/
|
|
55
|
+
export function isAnchored(varName) {
|
|
56
|
+
return ANCHORED_ROOTS.has(rootOf(varName));
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Return a new `Palette` whose colors are the transposition of `palette`'s
|
|
60
|
+
* colors by `key`. Pure. Identity (`IDENTITY`) returns a Palette with byte-exact
|
|
61
|
+
* colors — fast-pathed so identity does not pay the sRGB↔OKLCH round-trip
|
|
62
|
+
* quantization cost.
|
|
63
|
+
*
|
|
64
|
+
* The `dark` flag of the result is derived from the actual lightness of
|
|
65
|
+
* the resulting `background` var (`Oklch.fromRgba(bg).l < 0.5`) — *not*
|
|
66
|
+
* from the key's coefficients. The strongest theorem: "dark iff
|
|
67
|
+
* background is dark." This is honest under every transform — pure
|
|
68
|
+
* lightness shifts, mirror-inversions, hue rotations that don't touch L,
|
|
69
|
+
* and combinations of all three. [LAW:types-are-the-program]
|
|
70
|
+
*
|
|
71
|
+
* The transposing path throws if the palette has no `background` var (the
|
|
72
|
+
* `dark`-flag derivation has nothing to read). Failing loudly is preferred
|
|
73
|
+
* over a silent fallback because the alternative — trusting the source
|
|
74
|
+
* `palette.dark` after an arbitrary L-transform — produces flags that lie.
|
|
75
|
+
* The identity fast-path is exempt: it preserves the source `dark` flag
|
|
76
|
+
* verbatim (no derivation), so it needs no `background` and never throws.
|
|
77
|
+
*
|
|
78
|
+
* @param name Optional override for the resulting palette name. Defaults
|
|
79
|
+
* to the source palette's name. Callers building a family of transposed
|
|
80
|
+
* palettes (e.g. "gruvbox +60°") supply their own.
|
|
81
|
+
*/
|
|
82
|
+
export function transposePalette(palette, key, name) {
|
|
83
|
+
if (isIdentityKey(key)) {
|
|
84
|
+
return new Palette(name ?? palette.name, palette.dark, palette.vars);
|
|
85
|
+
}
|
|
86
|
+
// Anchors share *everything except* hue with the user's key. They still
|
|
87
|
+
// lightness-invert in a dark↔light flip; they still chroma-scale in a
|
|
88
|
+
// saturation sweep — only their hue is held.
|
|
89
|
+
const anchorKey = { ...key, hueShift: 0 };
|
|
90
|
+
const next = new Map();
|
|
91
|
+
for (const [varName, color] of palette.vars) {
|
|
92
|
+
const effective = isAnchored(varName) ? anchorKey : key;
|
|
93
|
+
next.set(varName, Oklch.fromRgba(color).applyKey(effective).toRgba());
|
|
94
|
+
}
|
|
95
|
+
const newBackground = next.get("background");
|
|
96
|
+
if (newBackground === undefined) {
|
|
97
|
+
throw new Error(`transposePalette: palette "${palette.name}" has no "background" ` +
|
|
98
|
+
`var; cannot derive the dark flag without a background color.`);
|
|
99
|
+
}
|
|
100
|
+
const newDark = Oklch.fromRgba(newBackground).l < 0.5;
|
|
101
|
+
return new Palette(name ?? palette.name, newDark, next);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Build the `ThemeKey` that rotates `palette` so its *tonic* var lands on
|
|
105
|
+
* `targetHueDeg`. The musical operation directly: a key is the set of
|
|
106
|
+
* intervals from the tonic, so "play this theme in the key of <hue>" means
|
|
107
|
+
* "shift every color by exactly the interval that carries the tonic's
|
|
108
|
+
* current hue to the target." Pick the tonic's pitch and the rest follows.
|
|
109
|
+
*
|
|
110
|
+
* Returns a hue-only key (chroma and lightness untouched). Callers that also
|
|
111
|
+
* want to scale chroma or shift lightness spread their own axes over the
|
|
112
|
+
* result — those are independent transposition dimensions, not part of
|
|
113
|
+
* choosing the key. [LAW:one-type-per-behavior] a degree-shift key and a
|
|
114
|
+
* root-note key are the *same* transform; this is just a second constructor
|
|
115
|
+
* for it, so `transposePalette` stays untouched.
|
|
116
|
+
*
|
|
117
|
+
* Throws if `tonicVar` is absent — the interval has no anchor to measure
|
|
118
|
+
* from, so there is no honest key to return. Failing loudly beats inventing
|
|
119
|
+
* a zero shift that would silently mean "no transposition."
|
|
120
|
+
*/
|
|
121
|
+
export function themeKeyForRoot(palette, tonicVar, targetHueDeg) {
|
|
122
|
+
// Validate the numeric input at the boundary: a non-finite target would
|
|
123
|
+
// propagate as NaN to Oklch's constructor several calls downstream, where
|
|
124
|
+
// the error is far less actionable.
|
|
125
|
+
if (!Number.isFinite(targetHueDeg)) {
|
|
126
|
+
throw new RangeError(`themeKeyForRoot: targetHueDeg must be a finite number; got ${targetHueDeg}`);
|
|
127
|
+
}
|
|
128
|
+
const tonic = palette.get(tonicVar);
|
|
129
|
+
if (tonic === undefined) {
|
|
130
|
+
throw new Error(`themeKeyForRoot: palette "${palette.name}" has no "${tonicVar}" var ` +
|
|
131
|
+
`to use as the tonic; cannot measure the transposition interval.`);
|
|
132
|
+
}
|
|
133
|
+
const tonicHue = Oklch.fromRgba(tonic).h;
|
|
134
|
+
let hueShift = (targetHueDeg - tonicHue) % 360;
|
|
135
|
+
if (hueShift < 0)
|
|
136
|
+
hueShift += 360;
|
|
137
|
+
return { hueShift, chromaScale: 1, lightnessScale: 1, lightnessShift: 0 };
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=transpose.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transpose.js","sourceRoot":"","sources":["../../src/themes/transpose.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,OAAO,EAAE,KAAK,EAAE,aAAa,EAAiB,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC;;;;;;GAMG;AACH,yEAAyE;AACzE,2EAA2E;AAC3E,6EAA6E;AAC7E,kDAAkD;AAClD,MAAM,CAAC,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAC;IACzD,OAAO;IACP,SAAS;IACT,SAAS;CACV,CAAC,CAAC;AAEH,SAAS,MAAM,CAAC,OAAe;IAC7B,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAClC,OAAO,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AACxD,CAAC;AAED;;;;GAIG;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I,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;AAC1D,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,eAAe,CAC7B,OAAgB,EAChB,QAAgB,EAChB,YAAoB;IAEpB,wEAAwE;IACxE,0EAA0E;IAC1E,oCAAoC;IACpC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,UAAU,CAClB,8DAA8D,YAAY,EAAE,CAC7E,CAAC;IACJ,CAAC;IACD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACpC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CACb,6BAA6B,OAAO,CAAC,IAAI,aAAa,QAAQ,QAAQ;YACpE,iEAAiE,CACpE,CAAC;IACJ,CAAC;IACD,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACzC,IAAI,QAAQ,GAAG,CAAC,YAAY,GAAG,QAAQ,CAAC,GAAG,GAAG,CAAC;IAC/C,IAAI,QAAQ,GAAG,CAAC;QAAE,QAAQ,IAAI,GAAG,CAAC;IAClC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,EAAE,cAAc,EAAE,CAAC,EAAE,cAAc,EAAE,CAAC,EAAE,CAAC;AAC5E,CAAC"}
|
package/dist/widgets/button.d.ts
CHANGED
|
@@ -5,11 +5,15 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Four visual states:
|
|
7
7
|
* normal — variant colors from theme semantic palette (muted)
|
|
8
|
-
* hover — full variant accent
|
|
8
|
+
* hover — full variant accent bg + on-accent fg (WCAG contrast)
|
|
9
9
|
* focus — brackets [ label ] surrounding the button
|
|
10
|
-
* active — color
|
|
10
|
+
* active — same color pair as hover, plus bold (pressed cue)
|
|
11
11
|
*
|
|
12
|
-
* States compose: active > focus > hover > normal.
|
|
12
|
+
* States compose: active > focus > hover > normal. Active and hover
|
|
13
|
+
* deliberately share colors — active differentiates via bold rather
|
|
14
|
+
* than fg/bg inversion, because inversion produces mostly-accent text
|
|
15
|
+
* on bg-tinted surface, which is unreadable for accents whose contrast
|
|
16
|
+
* partner depends on luminance.
|
|
13
17
|
*/
|
|
14
18
|
import { Segment } from "../core/segment.js";
|
|
15
19
|
import type { RenderOptions } from "../core/protocol.js";
|
|
@@ -29,12 +33,11 @@ export declare class Button extends WidgetBase {
|
|
|
29
33
|
readonly focusable = true;
|
|
30
34
|
accessor label: string;
|
|
31
35
|
accessor variant: ButtonVariant;
|
|
32
|
-
private _theme;
|
|
36
|
+
private accessor _theme;
|
|
33
37
|
constructor(options: ButtonOptions);
|
|
34
38
|
setTheme(theme: TerminalTheme): void;
|
|
35
39
|
handleKey(event: KeyEvent): void;
|
|
36
40
|
handleMouse(event: WidgetMouseEvent): void;
|
|
37
|
-
setHovered(value: boolean): void;
|
|
38
41
|
setActive(value: boolean): void;
|
|
39
42
|
render(_options: RenderOptions): Iterable<Segment>;
|
|
40
43
|
measure(_options: RenderOptions): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/widgets/button.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/widgets/button.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAK7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAA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