@adea-ai/ui 0.157.0 → 0.159.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/composites/action-button/action-button.d.ts +6 -0
- package/dist/components/composites/action-button/action-button.d.ts.map +1 -1
- package/dist/components/composites/action-button/action-button.js +29 -2
- package/dist/components/composites/action-button/action-button.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-editor.d.ts +1 -1
- package/dist/components/composites/appearance-editor/appearance-editor.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-editor.js +305 -172
- package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-rows.d.ts +6 -0
- package/dist/components/composites/appearance-editor/appearance-rows.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-rows.js +2 -2
- package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-types.d.ts +26 -0
- package/dist/components/composites/appearance-editor/appearance-types.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-types.js +10 -0
- package/dist/components/composites/appearance-editor/appearance-types.js.map +1 -0
- package/dist/components/composites/appearance-editor/font-settings-group.d.ts +13 -1
- package/dist/components/composites/appearance-editor/font-settings-group.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/font-settings-group.js +51 -15
- package/dist/components/composites/appearance-editor/font-settings-group.js.map +1 -1
- package/dist/components/composites/appearance-editor/index.d.ts +2 -1
- package/dist/components/composites/appearance-editor/index.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/index.js +3 -2
- package/dist/components/composites/model-selector/index.d.ts +1 -1
- package/dist/components/composites/model-selector/index.d.ts.map +1 -1
- package/dist/components/composites/model-selector/model-selector.d.ts +22 -0
- package/dist/components/composites/model-selector/model-selector.d.ts.map +1 -1
- package/dist/components/composites/model-selector/model-selector.js +191 -46
- package/dist/components/composites/model-selector/model-selector.js.map +1 -1
- package/dist/components/ui/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip/tooltip.js +4 -18
- package/dist/components/ui/tooltip/tooltip.js.map +1 -1
- package/dist/index.js +5 -4
- package/dist/lib/appearance-font-settings.d.ts +18 -4
- package/dist/lib/appearance-font-settings.d.ts.map +1 -1
- package/dist/lib/appearance-font-settings.js +24 -6
- package/dist/lib/appearance-font-settings.js.map +1 -1
- package/dist/lib/font-catalog.d.ts +5 -0
- package/dist/lib/font-catalog.d.ts.map +1 -1
- package/dist/lib/font-catalog.js +10 -5
- package/dist/lib/font-catalog.js.map +1 -1
- package/dist/lib/font-zoom.d.ts +1 -1
- package/dist/lib/font-zoom.d.ts.map +1 -1
- package/dist/lib/font-zoom.js +5 -1
- package/dist/lib/font-zoom.js.map +1 -1
- package/dist/lib/tokens.d.ts.map +1 -1
- package/dist/lib/tokens.js +17 -2
- package/dist/lib/tokens.js.map +1 -1
- package/dist/r/action-button.json +1 -0
- package/dist/r/appearance-editor.json +1 -0
- package/dist/r/registry.json +2 -0
- package/dist/r/src/components/composites/action-button/action-button.tsx +17 -1
- package/dist/r/src/components/composites/appearance-editor/appearance-editor.tsx +202 -110
- package/dist/r/src/components/composites/appearance-editor/appearance-rows.tsx +11 -1
- package/dist/r/src/components/composites/appearance-editor/appearance-types.ts +27 -0
- package/dist/r/src/components/composites/appearance-editor/font-settings-group.tsx +50 -10
- package/dist/r/src/components/composites/appearance-editor/index.ts +3 -0
- package/dist/r/src/components/composites/model-selector/index.ts +1 -1
- package/dist/r/src/components/composites/model-selector/model-selector.tsx +155 -10
- package/dist/r/src/components/ui/tooltip/tooltip.tsx +9 -18
- package/dist/r/src/lib/appearance-font-settings.ts +43 -7
- package/dist/r/src/lib/font-catalog.ts +5 -0
- package/dist/r/src/lib/font-zoom.ts +3 -0
- package/dist/r/src/lib/tokens.ts +17 -2
- package/dist/r/src/styles/appearance-font-settings.css +2 -0
- package/package.json +1 -1
- package/registry.json +2 -0
- package/src/components/composites/action-button/action-button.tsx +17 -1
- package/src/components/composites/appearance-editor/appearance-editor.tsx +202 -110
- package/src/components/composites/appearance-editor/appearance-rows.tsx +11 -1
- package/src/components/composites/appearance-editor/appearance-types.ts +27 -0
- package/src/components/composites/appearance-editor/font-settings-group.tsx +50 -10
- package/src/components/composites/appearance-editor/index.ts +3 -0
- package/src/components/composites/model-selector/index.ts +1 -1
- package/src/components/composites/model-selector/model-selector.tsx +155 -10
- package/src/components/ui/tooltip/tooltip.tsx +9 -18
- package/src/lib/appearance-font-settings.ts +43 -7
- package/src/lib/font-catalog.ts +5 -0
- package/src/lib/font-zoom.ts +3 -0
- package/src/lib/tokens.ts +17 -2
- package/src/styles/appearance-font-settings.css +2 -0
|
@@ -7,12 +7,14 @@ import { DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS } from "../../../lib/appearance
|
|
|
7
7
|
import "../../../lib/theme-defaults.js";
|
|
8
8
|
import { Switch as Switch$1 } from "../../ui/switch/switch.js";
|
|
9
9
|
import { Sheet, SheetBody, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger } from "../../ui/sheet/sheet.js";
|
|
10
|
+
import { APPEARANCE_EDITOR_TABS } from "./appearance-types.js";
|
|
10
11
|
import { AccentChoices, GlassChoices, ModeChoices, isCustomAccent } from "./appearance-choices.js";
|
|
11
12
|
import { CodeRow, SettingsRow, TerminalRow, ThemeRow } from "./appearance-rows.js";
|
|
12
13
|
import { fastIcon } from "../../../lib/fast-icon.js";
|
|
14
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from "../../ui/tabs/tabs.js";
|
|
13
15
|
import { className, createComponent, effect, insert, memo, mergeProps, setAttribute, template } from "solid-js/web";
|
|
14
16
|
import { EyeOff, Palette, PanelsTopLeft, SlidersHorizontal } from "lucide-solid";
|
|
15
|
-
import { Show, createSignal, createUniqueId } from "solid-js";
|
|
17
|
+
import { For, Show, createSignal, createUniqueId } from "solid-js";
|
|
16
18
|
// src/components/composites/appearance-editor/appearance-editor.tsx
|
|
17
19
|
var _tmpl$ = /*#__PURE__*/ template(`<div class="px-4 py-3"><label class="mb-2 block text-xs font-medium">Custom accent`);
|
|
18
20
|
var _tmpl$2 = /*#__PURE__*/ template(`<p role=status class="px-4 py-2 text-xs text-muted-foreground">`);
|
|
@@ -22,6 +24,7 @@ var _tmpl$5 = /*#__PURE__*/ template(`<p role=status class="px-4 py-2 text-sm te
|
|
|
22
24
|
var _tmpl$6 = /*#__PURE__*/ template(`<p role=alert class="mt-1 text-xs text-foreground">`);
|
|
23
25
|
var _tmpl$7 = /*#__PURE__*/ template(`<div class="flex w-full flex-col gap-2"><div class="global-appearance-editor-actions flex flex-wrap items-center gap-2"><div class="ml-auto flex gap-2">`);
|
|
24
26
|
var _tmpl$8 = /*#__PURE__*/ template(`<p role=status class="text-xs text-muted-foreground">`);
|
|
27
|
+
var _tmpl$9 = /*#__PURE__*/ template(`<div class="shrink-0 border-b border-border px-4 py-2">`);
|
|
25
28
|
var EyeOff$1 = fastIcon(EyeOff);
|
|
26
29
|
var Palette$1 = fastIcon(Palette);
|
|
27
30
|
var PanelsTopLeft$1 = fastIcon(PanelsTopLeft);
|
|
@@ -46,6 +49,31 @@ function AppearanceEditor(props) {
|
|
|
46
49
|
return offered ? `Theme ${offered.label.toLowerCase()} · The theme’s own color.` : "Theme default · This theme has no such accent.";
|
|
47
50
|
};
|
|
48
51
|
const glassDescription = () => props.draft.surface === "opaque" ? "Solid surfaces for every theme." : props.draft.surface === "frosted" ? "Theme-colored glass where supported." : props.surfaceCapability.themeDefaultDescription ?? "Uses this theme's default surface.";
|
|
52
|
+
const shows = (section) => props.section === void 0 || props.section === section;
|
|
53
|
+
const sectionFonts = () => props.section === "global" ? ["ui", "content"] : props.section === "terminal" ? ["terminal"] : props.section === "code" ? ["code"] : [
|
|
54
|
+
"ui",
|
|
55
|
+
"content",
|
|
56
|
+
"code"
|
|
57
|
+
];
|
|
58
|
+
const fontRows = () => createComponent(AppearanceFontSettingsGroup, {
|
|
59
|
+
get settings() {
|
|
60
|
+
return props.draft.fonts ?? DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS;
|
|
61
|
+
},
|
|
62
|
+
get menuPortalMount() {
|
|
63
|
+
return props.menuPortalMount;
|
|
64
|
+
},
|
|
65
|
+
get disabled() {
|
|
66
|
+
return props.saving;
|
|
67
|
+
},
|
|
68
|
+
get axes() {
|
|
69
|
+
return sectionFonts();
|
|
70
|
+
},
|
|
71
|
+
get sectioned() {
|
|
72
|
+
return props.section === "terminal" || props.section === "code";
|
|
73
|
+
},
|
|
74
|
+
onChange: (fonts) => props.onChange({ fonts })
|
|
75
|
+
});
|
|
76
|
+
const previewTheme = () => props.resolvedAppearance === "dark" ? props.darkTheme : props.lightTheme;
|
|
49
77
|
return (() => {
|
|
50
78
|
var _el$ = _tmpl$4(), _el$2 = _el$.firstChild;
|
|
51
79
|
insert(_el$, createComponent(Show, {
|
|
@@ -58,50 +86,26 @@ function AppearanceEditor(props) {
|
|
|
58
86
|
return _el$7;
|
|
59
87
|
})()
|
|
60
88
|
}), _el$2);
|
|
61
|
-
insert(_el$, createComponent(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
get selectedId() {
|
|
65
|
-
return props.draft.lightThemeId;
|
|
66
|
-
},
|
|
67
|
-
get preview() {
|
|
68
|
-
return props.lightTheme;
|
|
69
|
-
},
|
|
70
|
-
get themes() {
|
|
71
|
-
return props.themes;
|
|
72
|
-
},
|
|
73
|
-
get disabled() {
|
|
74
|
-
return props.saving;
|
|
75
|
-
},
|
|
76
|
-
onSelect: (lightThemeId) => props.onChange({ lightThemeId })
|
|
77
|
-
}), null);
|
|
78
|
-
insert(_el$2, createComponent(ThemeRow, {
|
|
79
|
-
appearance: "dark",
|
|
80
|
-
get selectedId() {
|
|
81
|
-
return props.draft.darkThemeId;
|
|
82
|
-
},
|
|
83
|
-
get preview() {
|
|
84
|
-
return props.darkTheme;
|
|
85
|
-
},
|
|
86
|
-
get themes() {
|
|
87
|
-
return props.themes;
|
|
88
|
-
},
|
|
89
|
-
get disabled() {
|
|
90
|
-
return props.saving;
|
|
89
|
+
insert(_el$, createComponent(Show, {
|
|
90
|
+
get when() {
|
|
91
|
+
return shows("global");
|
|
91
92
|
},
|
|
92
|
-
|
|
93
|
-
|
|
93
|
+
get children() {
|
|
94
|
+
return createComponent(ModeChoices, props);
|
|
95
|
+
}
|
|
96
|
+
}), _el$2);
|
|
94
97
|
insert(_el$2, createComponent(Show, {
|
|
95
98
|
get when() {
|
|
96
|
-
return
|
|
99
|
+
return shows("global");
|
|
97
100
|
},
|
|
98
101
|
get children() {
|
|
99
|
-
return createComponent(
|
|
102
|
+
return [createComponent(ThemeRow, {
|
|
103
|
+
appearance: "light",
|
|
100
104
|
get selectedId() {
|
|
101
|
-
return props.draft.
|
|
105
|
+
return props.draft.lightThemeId;
|
|
102
106
|
},
|
|
103
107
|
get preview() {
|
|
104
|
-
return
|
|
108
|
+
return props.lightTheme;
|
|
105
109
|
},
|
|
106
110
|
get themes() {
|
|
107
111
|
return props.themes;
|
|
@@ -109,21 +113,14 @@ function AppearanceEditor(props) {
|
|
|
109
113
|
get disabled() {
|
|
110
114
|
return props.saving;
|
|
111
115
|
},
|
|
112
|
-
onSelect: (
|
|
113
|
-
})
|
|
114
|
-
|
|
115
|
-
}), null);
|
|
116
|
-
insert(_el$2, createComponent(Show, {
|
|
117
|
-
get when() {
|
|
118
|
-
return props.draft.codeThemeId !== void 0;
|
|
119
|
-
},
|
|
120
|
-
get children() {
|
|
121
|
-
return createComponent(CodeRow, {
|
|
116
|
+
onSelect: (lightThemeId) => props.onChange({ lightThemeId })
|
|
117
|
+
}), createComponent(ThemeRow, {
|
|
118
|
+
appearance: "dark",
|
|
122
119
|
get selectedId() {
|
|
123
|
-
return props.draft.
|
|
120
|
+
return props.draft.darkThemeId;
|
|
124
121
|
},
|
|
125
122
|
get preview() {
|
|
126
|
-
return
|
|
123
|
+
return props.darkTheme;
|
|
127
124
|
},
|
|
128
125
|
get themes() {
|
|
129
126
|
return props.themes;
|
|
@@ -131,160 +128,213 @@ function AppearanceEditor(props) {
|
|
|
131
128
|
get disabled() {
|
|
132
129
|
return props.saving;
|
|
133
130
|
},
|
|
134
|
-
onSelect: (
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
}), null);
|
|
138
|
-
insert(_el$2, createComponent(SettingsRow, {
|
|
139
|
-
title: "Accent",
|
|
140
|
-
get icon() {
|
|
141
|
-
return createComponent(SlidersHorizontal$1, {});
|
|
142
|
-
},
|
|
143
|
-
get description() {
|
|
144
|
-
return accentDescription();
|
|
145
|
-
},
|
|
146
|
-
get children() {
|
|
147
|
-
return createComponent(AccentChoices, props);
|
|
131
|
+
onSelect: (darkThemeId) => props.onChange({ darkThemeId })
|
|
132
|
+
})];
|
|
148
133
|
}
|
|
149
134
|
}), null);
|
|
150
135
|
insert(_el$2, createComponent(Show, {
|
|
151
136
|
get when() {
|
|
152
|
-
return
|
|
137
|
+
return memo(() => !!shows("terminal"))() && props.draft.terminalThemeId !== void 0;
|
|
153
138
|
},
|
|
154
139
|
get children() {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
id: `${errorId}-input`,
|
|
159
|
-
get value() {
|
|
160
|
-
return props.draft.accent;
|
|
161
|
-
},
|
|
162
|
-
get disabled() {
|
|
163
|
-
return props.saving;
|
|
164
|
-
},
|
|
165
|
-
get ["aria-invalid"]() {
|
|
166
|
-
return !!props.customAccentError;
|
|
167
|
-
},
|
|
168
|
-
get ["aria-describedby"]() {
|
|
169
|
-
return props.customAccentError ? errorId : void 0;
|
|
140
|
+
return createComponent(TerminalRow, {
|
|
141
|
+
get sectioned() {
|
|
142
|
+
return props.section !== void 0;
|
|
170
143
|
},
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
insert(_el$3, createComponent(Show, {
|
|
174
|
-
get when() {
|
|
175
|
-
return props.customAccentError;
|
|
144
|
+
get selectedId() {
|
|
145
|
+
return props.draft.terminalThemeId ?? "theme";
|
|
176
146
|
},
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
setAttribute(_el$8, "id", errorId);
|
|
180
|
-
insert(_el$8, customAccentErrorSlot);
|
|
181
|
-
return _el$8;
|
|
182
|
-
})()
|
|
183
|
-
}), null);
|
|
184
|
-
return _el$3;
|
|
185
|
-
}
|
|
186
|
-
}), null);
|
|
187
|
-
insert(_el$2, createComponent(Show, {
|
|
188
|
-
get when() {
|
|
189
|
-
return props.fontSettingsPlacement !== "end";
|
|
190
|
-
},
|
|
191
|
-
get children() {
|
|
192
|
-
return createComponent(AppearanceFontSettingsGroup, {
|
|
193
|
-
get settings() {
|
|
194
|
-
return props.draft.fonts ?? DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS;
|
|
147
|
+
get preview() {
|
|
148
|
+
return previewTheme();
|
|
195
149
|
},
|
|
196
|
-
get
|
|
197
|
-
return props.
|
|
150
|
+
get themes() {
|
|
151
|
+
return props.themes;
|
|
198
152
|
},
|
|
199
153
|
get disabled() {
|
|
200
154
|
return props.saving;
|
|
201
155
|
},
|
|
202
|
-
|
|
156
|
+
onSelect: (terminalThemeId) => props.onChange({ terminalThemeId })
|
|
203
157
|
});
|
|
204
158
|
}
|
|
205
159
|
}), null);
|
|
206
|
-
insert(_el$2, createComponent(SettingsRow, {
|
|
207
|
-
title: "Glass",
|
|
208
|
-
get icon() {
|
|
209
|
-
return createComponent(PanelsTopLeft$1, {});
|
|
210
|
-
},
|
|
211
|
-
get description() {
|
|
212
|
-
return glassDescription();
|
|
213
|
-
},
|
|
214
|
-
get children() {
|
|
215
|
-
return createComponent(GlassChoices, props);
|
|
216
|
-
}
|
|
217
|
-
}), null);
|
|
218
160
|
insert(_el$2, createComponent(Show, {
|
|
219
161
|
get when() {
|
|
220
|
-
return
|
|
162
|
+
return props.section === "terminal";
|
|
221
163
|
},
|
|
222
164
|
get children() {
|
|
223
|
-
|
|
224
|
-
insert(_el$5, () => props.surfaceCapability.reason);
|
|
225
|
-
return _el$5;
|
|
165
|
+
return [memo(() => fontRows()), memo(() => props.terminalRows)];
|
|
226
166
|
}
|
|
227
167
|
}), null);
|
|
228
|
-
insert(_el$2, createComponent(
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
return createComponent(EyeOff$1, {});
|
|
168
|
+
insert(_el$2, createComponent(Show, {
|
|
169
|
+
get when() {
|
|
170
|
+
return memo(() => !!shows("code"))() && props.draft.codeThemeId !== void 0;
|
|
232
171
|
},
|
|
233
|
-
description: "Prefer solid surfaces, including during live preview.",
|
|
234
172
|
get children() {
|
|
235
|
-
return createComponent(
|
|
236
|
-
get
|
|
237
|
-
return props.
|
|
173
|
+
return createComponent(CodeRow, {
|
|
174
|
+
get sectioned() {
|
|
175
|
+
return props.section !== void 0;
|
|
176
|
+
},
|
|
177
|
+
get selectedId() {
|
|
178
|
+
return props.draft.codeThemeId ?? "theme";
|
|
179
|
+
},
|
|
180
|
+
get preview() {
|
|
181
|
+
return previewTheme();
|
|
182
|
+
},
|
|
183
|
+
get themes() {
|
|
184
|
+
return props.themes;
|
|
238
185
|
},
|
|
239
186
|
get disabled() {
|
|
240
187
|
return props.saving;
|
|
241
188
|
},
|
|
242
|
-
|
|
243
|
-
"aria-label": "Reduce transparency"
|
|
189
|
+
onSelect: (codeThemeId) => props.onChange({ codeThemeId })
|
|
244
190
|
});
|
|
245
191
|
}
|
|
246
192
|
}), null);
|
|
247
|
-
insert(_el$2, createComponent(
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
return createComponent(Palette$1, {});
|
|
251
|
-
},
|
|
252
|
-
get description() {
|
|
253
|
-
return props.onManageThemes ? "Manage themes through the application." : "Theme import is unavailable.";
|
|
193
|
+
insert(_el$2, createComponent(Show, {
|
|
194
|
+
get when() {
|
|
195
|
+
return props.section === "code";
|
|
254
196
|
},
|
|
255
197
|
get children() {
|
|
256
|
-
return
|
|
257
|
-
type: "button",
|
|
258
|
-
size: "sm",
|
|
259
|
-
variant: "outline",
|
|
260
|
-
get disabled() {
|
|
261
|
-
return !props.onManageThemes || props.saving;
|
|
262
|
-
},
|
|
263
|
-
onClick: () => props.onManageThemes?.(),
|
|
264
|
-
children: "Manage themes"
|
|
265
|
-
});
|
|
198
|
+
return [memo(() => fontRows()), memo(() => props.codeRows)];
|
|
266
199
|
}
|
|
267
200
|
}), null);
|
|
268
201
|
insert(_el$2, createComponent(Show, {
|
|
269
202
|
get when() {
|
|
270
|
-
return
|
|
203
|
+
return shows("global");
|
|
271
204
|
},
|
|
272
205
|
get children() {
|
|
273
|
-
return
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
206
|
+
return [
|
|
207
|
+
createComponent(SettingsRow, {
|
|
208
|
+
title: "Accent",
|
|
209
|
+
get icon() {
|
|
210
|
+
return createComponent(SlidersHorizontal$1, {});
|
|
211
|
+
},
|
|
212
|
+
get description() {
|
|
213
|
+
return accentDescription();
|
|
214
|
+
},
|
|
215
|
+
get children() {
|
|
216
|
+
return createComponent(AccentChoices, props);
|
|
217
|
+
}
|
|
218
|
+
}),
|
|
219
|
+
createComponent(Show, {
|
|
220
|
+
get when() {
|
|
221
|
+
return custom();
|
|
222
|
+
},
|
|
223
|
+
get children() {
|
|
224
|
+
var _el$3 = _tmpl$(), _el$4 = _el$3.firstChild;
|
|
225
|
+
setAttribute(_el$4, "for", `${errorId}-input`);
|
|
226
|
+
insert(_el$3, createComponent(Input, {
|
|
227
|
+
id: `${errorId}-input`,
|
|
228
|
+
get value() {
|
|
229
|
+
return props.draft.accent;
|
|
230
|
+
},
|
|
231
|
+
get disabled() {
|
|
232
|
+
return props.saving;
|
|
233
|
+
},
|
|
234
|
+
get ["aria-invalid"]() {
|
|
235
|
+
return !!props.customAccentError;
|
|
236
|
+
},
|
|
237
|
+
get ["aria-describedby"]() {
|
|
238
|
+
return props.customAccentError ? errorId : void 0;
|
|
239
|
+
},
|
|
240
|
+
onInput: (event) => props.onChange({ accent: event.currentTarget.value })
|
|
241
|
+
}), null);
|
|
242
|
+
insert(_el$3, createComponent(Show, {
|
|
243
|
+
get when() {
|
|
244
|
+
return props.customAccentError;
|
|
245
|
+
},
|
|
246
|
+
children: (customAccentErrorSlot) => (() => {
|
|
247
|
+
var _el$8 = _tmpl$6();
|
|
248
|
+
setAttribute(_el$8, "id", errorId);
|
|
249
|
+
insert(_el$8, customAccentErrorSlot);
|
|
250
|
+
return _el$8;
|
|
251
|
+
})()
|
|
252
|
+
}), null);
|
|
253
|
+
return _el$3;
|
|
254
|
+
}
|
|
255
|
+
}),
|
|
256
|
+
createComponent(Show, {
|
|
257
|
+
get when() {
|
|
258
|
+
return props.fontSettingsPlacement !== "end";
|
|
259
|
+
},
|
|
260
|
+
get children() {
|
|
261
|
+
return fontRows();
|
|
262
|
+
}
|
|
263
|
+
}),
|
|
264
|
+
createComponent(SettingsRow, {
|
|
265
|
+
title: "Glass",
|
|
266
|
+
get icon() {
|
|
267
|
+
return createComponent(PanelsTopLeft$1, {});
|
|
268
|
+
},
|
|
269
|
+
get description() {
|
|
270
|
+
return glassDescription();
|
|
271
|
+
},
|
|
272
|
+
get children() {
|
|
273
|
+
return createComponent(GlassChoices, props);
|
|
274
|
+
}
|
|
275
|
+
}),
|
|
276
|
+
createComponent(Show, {
|
|
277
|
+
get when() {
|
|
278
|
+
return memo(() => !!!props.surfaceCapability.frosted)() && props.surfaceCapability.reason;
|
|
279
|
+
},
|
|
280
|
+
get children() {
|
|
281
|
+
var _el$5 = _tmpl$2();
|
|
282
|
+
insert(_el$5, () => props.surfaceCapability.reason);
|
|
283
|
+
return _el$5;
|
|
284
|
+
}
|
|
285
|
+
}),
|
|
286
|
+
createComponent(SettingsRow, {
|
|
287
|
+
title: "Reduce transparency",
|
|
288
|
+
get icon() {
|
|
289
|
+
return createComponent(EyeOff$1, {});
|
|
290
|
+
},
|
|
291
|
+
description: "Prefer solid surfaces, including during live preview.",
|
|
292
|
+
get children() {
|
|
293
|
+
return createComponent(Switch$1, {
|
|
294
|
+
get checked() {
|
|
295
|
+
return props.draft.reduceTransparency;
|
|
296
|
+
},
|
|
297
|
+
get disabled() {
|
|
298
|
+
return props.saving;
|
|
299
|
+
},
|
|
300
|
+
onChange: (reduceTransparency) => props.onChange({ reduceTransparency }),
|
|
301
|
+
"aria-label": "Reduce transparency"
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
}),
|
|
305
|
+
createComponent(SettingsRow, {
|
|
306
|
+
title: "Theme library",
|
|
307
|
+
get icon() {
|
|
308
|
+
return createComponent(Palette$1, {});
|
|
309
|
+
},
|
|
310
|
+
get description() {
|
|
311
|
+
return props.onManageThemes ? "Manage themes through the application." : "Theme import is unavailable.";
|
|
312
|
+
},
|
|
313
|
+
get children() {
|
|
314
|
+
return createComponent(Button, {
|
|
315
|
+
type: "button",
|
|
316
|
+
size: "sm",
|
|
317
|
+
variant: "outline",
|
|
318
|
+
get disabled() {
|
|
319
|
+
return !props.onManageThemes || props.saving;
|
|
320
|
+
},
|
|
321
|
+
onClick: () => props.onManageThemes?.(),
|
|
322
|
+
children: "Manage themes"
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
}),
|
|
326
|
+
createComponent(Show, {
|
|
327
|
+
get when() {
|
|
328
|
+
return props.fontSettingsPlacement === "end";
|
|
329
|
+
},
|
|
330
|
+
get children() {
|
|
331
|
+
return fontRows();
|
|
332
|
+
}
|
|
333
|
+
}),
|
|
334
|
+
memo(() => props.extraRows)
|
|
335
|
+
];
|
|
285
336
|
}
|
|
286
337
|
}), null);
|
|
287
|
-
insert(_el$2, () => props.extraRows, null);
|
|
288
338
|
insert(_el$, createComponent(Show, {
|
|
289
339
|
get when() {
|
|
290
340
|
return !props.hideActions;
|
|
@@ -295,7 +345,15 @@ function AppearanceEditor(props) {
|
|
|
295
345
|
return _el$6;
|
|
296
346
|
}
|
|
297
347
|
}), null);
|
|
298
|
-
effect(() =>
|
|
348
|
+
effect((_p$) => {
|
|
349
|
+
var _v$ = props.section, _v$2 = cn("min-w-0", props.class);
|
|
350
|
+
_v$ !== _p$.e && setAttribute(_el$, "data-appearance-section", _p$.e = _v$);
|
|
351
|
+
_v$2 !== _p$.t && className(_el$, _p$.t = _v$2);
|
|
352
|
+
return _p$;
|
|
353
|
+
}, {
|
|
354
|
+
e: void 0,
|
|
355
|
+
t: void 0
|
|
356
|
+
});
|
|
299
357
|
return _el$;
|
|
300
358
|
})();
|
|
301
359
|
}
|
|
@@ -359,11 +417,25 @@ function AppearanceEditorActions(props) {
|
|
|
359
417
|
return _el$9;
|
|
360
418
|
})();
|
|
361
419
|
}
|
|
420
|
+
var TAB_LABELS = {
|
|
421
|
+
global: "Global",
|
|
422
|
+
terminal: "Terminal",
|
|
423
|
+
code: "Code"
|
|
424
|
+
};
|
|
362
425
|
/** The editor in an inset Sheet docked beside the main view: the body scrolls and
|
|
363
426
|
* Reset/Cancel/Save sit in the panel's full-width footer, always reachable.
|
|
364
427
|
* Dismissal (Escape, the close button, an outside click) is `onDismiss`. */
|
|
365
428
|
function AppearancePopover(props) {
|
|
366
429
|
const [menuPortalMount, setMenuPortalMount] = createSignal();
|
|
430
|
+
const [ownTab, setOwnTab] = createSignal("global");
|
|
431
|
+
const tabbed = () => props.tabs === true || props.tab !== void 0;
|
|
432
|
+
const tab = () => props.tab ?? ownTab();
|
|
433
|
+
const selectTab = (value) => {
|
|
434
|
+
const next = APPEARANCE_EDITOR_TABS.find((candidate) => candidate === value);
|
|
435
|
+
if (!next) return;
|
|
436
|
+
setOwnTab(next);
|
|
437
|
+
props.onTabChange?.(next);
|
|
438
|
+
};
|
|
367
439
|
return createComponent(Sheet, {
|
|
368
440
|
get open() {
|
|
369
441
|
return props.open;
|
|
@@ -391,16 +463,77 @@ function AppearancePopover(props) {
|
|
|
391
463
|
get children() {
|
|
392
464
|
return [
|
|
393
465
|
createComponent(SheetHeader, { get children() {
|
|
394
|
-
return [createComponent(SheetTitle, { children: "Appearance" }), createComponent(SheetDescription, {
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
},
|
|
401
|
-
hideActions: true
|
|
402
|
-
}));
|
|
466
|
+
return [createComponent(SheetTitle, { children: "Appearance" }), createComponent(SheetDescription, {
|
|
467
|
+
"class": "truncate text-xs",
|
|
468
|
+
get children() {
|
|
469
|
+
return props.description ?? "Changes preview live. Save keeps them.";
|
|
470
|
+
}
|
|
471
|
+
})];
|
|
403
472
|
} }),
|
|
473
|
+
createComponent(Show, {
|
|
474
|
+
get when() {
|
|
475
|
+
return tabbed();
|
|
476
|
+
},
|
|
477
|
+
get fallback() {
|
|
478
|
+
return createComponent(SheetBody, { get children() {
|
|
479
|
+
return createComponent(AppearanceEditor, mergeProps(props, {
|
|
480
|
+
get menuPortalMount() {
|
|
481
|
+
return menuPortalMount();
|
|
482
|
+
},
|
|
483
|
+
hideActions: true
|
|
484
|
+
}));
|
|
485
|
+
} });
|
|
486
|
+
},
|
|
487
|
+
get children() {
|
|
488
|
+
return createComponent(Tabs, {
|
|
489
|
+
get value() {
|
|
490
|
+
return tab();
|
|
491
|
+
},
|
|
492
|
+
onChange: selectTab,
|
|
493
|
+
"class": "min-h-0 flex-1 gap-0",
|
|
494
|
+
get children() {
|
|
495
|
+
return [(() => {
|
|
496
|
+
var _el$11 = _tmpl$9();
|
|
497
|
+
insert(_el$11, createComponent(TabsList, {
|
|
498
|
+
appearance: "segmented",
|
|
499
|
+
fill: true,
|
|
500
|
+
"aria-label": "Appearance section",
|
|
501
|
+
get children() {
|
|
502
|
+
return createComponent(For, {
|
|
503
|
+
each: APPEARANCE_EDITOR_TABS,
|
|
504
|
+
children: (value) => createComponent(TabsTrigger, {
|
|
505
|
+
appearance: "segmented",
|
|
506
|
+
value,
|
|
507
|
+
"class": "flex-1",
|
|
508
|
+
get children() {
|
|
509
|
+
return TAB_LABELS[value];
|
|
510
|
+
}
|
|
511
|
+
})
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
}));
|
|
515
|
+
return _el$11;
|
|
516
|
+
})(), createComponent(SheetBody, { get children() {
|
|
517
|
+
return createComponent(For, {
|
|
518
|
+
each: APPEARANCE_EDITOR_TABS,
|
|
519
|
+
children: (value) => createComponent(TabsContent, {
|
|
520
|
+
value,
|
|
521
|
+
get children() {
|
|
522
|
+
return createComponent(AppearanceEditor, mergeProps(props, {
|
|
523
|
+
section: value,
|
|
524
|
+
get menuPortalMount() {
|
|
525
|
+
return menuPortalMount();
|
|
526
|
+
},
|
|
527
|
+
hideActions: true
|
|
528
|
+
}));
|
|
529
|
+
}
|
|
530
|
+
})
|
|
531
|
+
});
|
|
532
|
+
} })];
|
|
533
|
+
}
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
}),
|
|
404
537
|
createComponent(SheetFooter, { get children() {
|
|
405
538
|
return createComponent(AppearanceEditorActions, props);
|
|
406
539
|
} })
|