@openelement/ui 1.0.0-alpha.14 → 1.0.0-alpha.16
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/CUSTOMIZATION.md +106 -112
- package/README.md +19 -39
- package/custom-elements.json +369 -0
- package/package.json +3 -2
- package/src/button-machine.js +54 -0
- package/src/component-config.js +7 -0
- package/src/component-recipes.js +2 -24
- package/src/copy-feedback.js +32 -0
- package/src/dialog-machine.js +104 -0
- package/src/dropdown-machine.js +253 -0
- package/src/generated-manifest.json +135 -87
- package/src/index.d.ts +7 -8
- package/src/index.js +7 -8
- package/src/input-machine.js +33 -0
- package/src/open-button.css +119 -108
- package/src/open-button.d.ts +34 -342
- package/src/open-button.generated.js +592 -0
- package/src/open-button.js +115 -1140
- package/src/open-code-block.css +24 -44
- package/src/open-code-block.d.ts +15 -175
- package/src/open-code-block.generated.js +293 -0
- package/src/open-code-block.js +112 -224
- package/src/open-dialog.css +114 -127
- package/src/open-dialog.d.ts +22 -261
- package/src/open-dialog.generated.js +501 -0
- package/src/open-dialog.js +137 -632
- package/src/open-dropdown.css +26 -26
- package/src/open-dropdown.d.ts +15 -218
- package/src/open-dropdown.generated.js +211 -0
- package/src/open-dropdown.js +74 -355
- package/src/open-input.css +69 -74
- package/src/open-input.d.ts +34 -461
- package/src/open-input.generated.js +685 -0
- package/src/open-input.js +161 -1802
- package/src/open-theme-toggle.css +37 -47
- package/src/open-theme-toggle.d.ts +19 -190
- package/src/open-theme-toggle.generated.js +564 -0
- package/src/open-theme-toggle.js +209 -509
- package/src/theme-contract.js +40 -0
- package/src/theme.css +26 -8
- package/src/control-recipe.css +0 -21
- package/src/register.d.ts +0 -4
- package/src/register.js +0 -22
|
@@ -0,0 +1,564 @@
|
|
|
1
|
+
import { assertElementInHtmlNamespace, assertElementInNamespace, assertSafeUrlAttribute, assertStaticAttributeSeed, attributeValueOf, bindSignalWrites, createRecipe, escapeAttrValue, leafClaimMismatch, leafRuntimeError } from "@openelement/element/internal/compiled/leaf-runtime";
|
|
2
|
+
import { log } from "./component-recipes.js";
|
|
3
|
+
import { readInstanceState } from "./instance-state.js";
|
|
4
|
+
import { writeInstanceState } from "./instance-state.js";
|
|
5
|
+
import { THEME_STORAGE_KEY } from "./theme-contract.js";
|
|
6
|
+
import { applyDocumentTheme } from "./theme-contract.js";
|
|
7
|
+
import { isSiteTheme } from "./theme-contract.js";
|
|
8
|
+
import { resolveSiteTheme } from "./theme-contract.js";
|
|
9
|
+
function __oe_rootInstance(__oe_owner, __oe_host) {
|
|
10
|
+
const readSavedTheme = (() => {
|
|
11
|
+
try {
|
|
12
|
+
return globalThis.localStorage.getItem(THEME_STORAGE_KEY);
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
log.debug('localStorage read unavailable:', error);
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const prefersLight = (() => {
|
|
20
|
+
try {
|
|
21
|
+
if (typeof globalThis.matchMedia !== 'function')
|
|
22
|
+
return false;
|
|
23
|
+
return globalThis.matchMedia('(prefers-color-scheme: light)').matches === true;
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
log.debug('matchMedia unavailable:', error);
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
const dispatchThemeChange = ((theme) => {
|
|
31
|
+
try {
|
|
32
|
+
if (typeof globalThis.CustomEvent !== 'undefined') {
|
|
33
|
+
globalThis.dispatchEvent(new globalThis.CustomEvent('open:theme-change', { detail: { theme } }));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
log.debug('theme event dispatch unavailable:', error);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
const applyTheme = ((host, theme) => {
|
|
41
|
+
const last = readInstanceState(host, 'lastPropagated', () => undefined);
|
|
42
|
+
if (last === theme)
|
|
43
|
+
return;
|
|
44
|
+
writeInstanceState(host, 'lastPropagated', theme);
|
|
45
|
+
host.setAttribute('theme', theme);
|
|
46
|
+
host.setAttribute('data-theme', theme);
|
|
47
|
+
applyDocumentTheme(host.ownerDocument.documentElement, theme);
|
|
48
|
+
try {
|
|
49
|
+
const root = host.getRootNode();
|
|
50
|
+
if (root instanceof globalThis.ShadowRoot && root.host) {
|
|
51
|
+
root.host.setAttribute('data-theme', theme);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
log.debug('root theme propagation unavailable:', error);
|
|
56
|
+
}
|
|
57
|
+
dispatchThemeChange(theme);
|
|
58
|
+
});
|
|
59
|
+
const initTheme = ((host) => {
|
|
60
|
+
if (readInstanceState(host, 'initDone', () => false))
|
|
61
|
+
return;
|
|
62
|
+
writeInstanceState(host, 'initDone', true);
|
|
63
|
+
const themeAttr = host.getAttribute('theme');
|
|
64
|
+
if (isSiteTheme(themeAttr)) {
|
|
65
|
+
applyTheme(host, themeAttr);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const docTheme = host.ownerDocument.documentElement?.dataset?.theme;
|
|
69
|
+
if (isSiteTheme(docTheme)) {
|
|
70
|
+
applyTheme(host, docTheme);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
applyTheme(host, resolveSiteTheme(readSavedTheme(), prefersLight()));
|
|
74
|
+
});
|
|
75
|
+
const toggle = ((host) => {
|
|
76
|
+
const theme = host.getAttribute('theme') === 'light' ? 'dark' : 'light';
|
|
77
|
+
host.setAttribute('theme', theme);
|
|
78
|
+
try {
|
|
79
|
+
globalThis.localStorage.setItem(THEME_STORAGE_KEY, theme);
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
log.debug('theme persistence unavailable:', error);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
const __oe_connectEnv = [];
|
|
86
|
+
__oe_connectEnv.push(((env) => {
|
|
87
|
+
globalThis.requestAnimationFrame(() => initTheme(env.host));
|
|
88
|
+
}));
|
|
89
|
+
if (__oe_host.__oe_onPropertyChange !== undefined)
|
|
90
|
+
__oe_host.__oe_onPropertyChange(((event) => {
|
|
91
|
+
if (event.name !== 'theme')
|
|
92
|
+
return;
|
|
93
|
+
applyTheme(event.host, event.value === 'light' ? 'light' : 'dark');
|
|
94
|
+
}));
|
|
95
|
+
return { readSavedTheme, prefersLight, dispatchThemeChange, applyTheme, initTheme, toggle, __oe_connectEnv };
|
|
96
|
+
}
|
|
97
|
+
function OpenThemeToggle__mount(__oe_scope, __oe_props, __oe_host) {
|
|
98
|
+
const props = __oe_props;
|
|
99
|
+
const __oe_lifecycleEnvHooks = __oe_host.bindings.__oe_connectEnv;
|
|
100
|
+
if (__oe_lifecycleEnvHooks !== undefined) {
|
|
101
|
+
for (const __oe_lifecycleEnvHook of __oe_lifecycleEnvHooks) {
|
|
102
|
+
const __oe_lifecycleEnvCleanup = __oe_lifecycleEnvHook({ host: __oe_host.__oe_hostElement, signal: __oe_scope.signal, states: __oe_host.__oe_states });
|
|
103
|
+
if (typeof __oe_lifecycleEnvCleanup === "function")
|
|
104
|
+
__oe_scope.add(__oe_lifecycleEnvCleanup);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
const __oe_nodes = [];
|
|
108
|
+
const __oe_setup = __oe_host.bindings ?? {};
|
|
109
|
+
const __oe_requireRootSetup = (name) => { if (!Object.hasOwn(__oe_setup, name))
|
|
110
|
+
throw new Error("OEIR_LEAF_MISSING_VALUE: " + name); return __oe_setup[name]; };
|
|
111
|
+
const readSavedTheme = __oe_requireRootSetup("readSavedTheme");
|
|
112
|
+
const prefersLight = __oe_requireRootSetup("prefersLight");
|
|
113
|
+
const dispatchThemeChange = __oe_requireRootSetup("dispatchThemeChange");
|
|
114
|
+
const applyTheme = __oe_requireRootSetup("applyTheme");
|
|
115
|
+
const initTheme = __oe_requireRootSetup("initTheme");
|
|
116
|
+
const toggle = __oe_requireRootSetup("toggle");
|
|
117
|
+
const __oe_el0 = document.createElement("button");
|
|
118
|
+
__oe_el0.setAttribute("type", "button");
|
|
119
|
+
__oe_el0.setAttribute("class", "theme-toggle inline-flex size-[38px] cursor-pointer items-center justify-center rounded-full p-0 text-muted-foreground transition-all duration-150 ease-in-out hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-[3px] focus-visible:outline-ring");
|
|
120
|
+
__oe_el0.setAttribute("part", "toggle");
|
|
121
|
+
function __oe_refresh1() {
|
|
122
|
+
const __oe_value2 = attributeValueOf((props.theme));
|
|
123
|
+
if (__oe_value2 === null)
|
|
124
|
+
__oe_el0.removeAttribute("data-theme");
|
|
125
|
+
else {
|
|
126
|
+
assertSafeUrlAttribute("data-theme", __oe_value2);
|
|
127
|
+
__oe_el0.setAttribute("data-theme", __oe_value2);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
__oe_refresh1();
|
|
131
|
+
for (const __oe_propDep of __oe_host.propDeps)
|
|
132
|
+
bindSignalWrites(__oe_scope, __oe_propDep, "props", __oe_refresh1);
|
|
133
|
+
__oe_el0.setAttribute("aria-label", "Toggle theme");
|
|
134
|
+
const __oe_eventHandler3 = ((event) => {
|
|
135
|
+
const target = event.currentTarget;
|
|
136
|
+
toggle((target.getRootNode()).host);
|
|
137
|
+
});
|
|
138
|
+
if (typeof __oe_eventHandler3 !== "function")
|
|
139
|
+
throw leafRuntimeError("OEIR_LEAF_EVENT_HANDLER_INVALID", "onClick handler is not callable", { file: "src/open-theme-toggle.tsx", line: 165, column: 7 });
|
|
140
|
+
const __oe_eventListener4 = (event) => __oe_eventHandler3(event);
|
|
141
|
+
__oe_el0.addEventListener("click", __oe_eventListener4);
|
|
142
|
+
__oe_scope.add(() => __oe_el0.removeEventListener("click", __oe_eventListener4));
|
|
143
|
+
const __oe_el5 = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
144
|
+
__oe_el5.setAttribute("class", "icon-sun size-4");
|
|
145
|
+
__oe_el5.setAttribute("part", "icon-sun");
|
|
146
|
+
__oe_el5.setAttribute("viewBox", "0 0 16 16");
|
|
147
|
+
__oe_el5.setAttribute("fill", "none");
|
|
148
|
+
__oe_el5.setAttribute("stroke", "currentColor");
|
|
149
|
+
__oe_el5.setAttribute("stroke-width", "1.2");
|
|
150
|
+
__oe_el5.setAttribute("stroke-linecap", "round");
|
|
151
|
+
const __oe_el6 = document.createElementNS("http://www.w3.org/2000/svg", "circle");
|
|
152
|
+
__oe_el6.setAttribute("cx", "8");
|
|
153
|
+
__oe_el6.setAttribute("cy", "8");
|
|
154
|
+
__oe_el6.setAttribute("r", "3");
|
|
155
|
+
__oe_el5.appendChild(__oe_el6);
|
|
156
|
+
const __oe_el7 = document.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
157
|
+
__oe_el7.setAttribute("x1", "8");
|
|
158
|
+
__oe_el7.setAttribute("y1", "1");
|
|
159
|
+
__oe_el7.setAttribute("x2", "8");
|
|
160
|
+
__oe_el7.setAttribute("y2", "3");
|
|
161
|
+
__oe_el5.appendChild(__oe_el7);
|
|
162
|
+
const __oe_el8 = document.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
163
|
+
__oe_el8.setAttribute("x1", "8");
|
|
164
|
+
__oe_el8.setAttribute("y1", "13");
|
|
165
|
+
__oe_el8.setAttribute("x2", "8");
|
|
166
|
+
__oe_el8.setAttribute("y2", "15");
|
|
167
|
+
__oe_el5.appendChild(__oe_el8);
|
|
168
|
+
const __oe_el9 = document.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
169
|
+
__oe_el9.setAttribute("x1", "1");
|
|
170
|
+
__oe_el9.setAttribute("y1", "8");
|
|
171
|
+
__oe_el9.setAttribute("x2", "3");
|
|
172
|
+
__oe_el9.setAttribute("y2", "8");
|
|
173
|
+
__oe_el5.appendChild(__oe_el9);
|
|
174
|
+
const __oe_el10 = document.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
175
|
+
__oe_el10.setAttribute("x1", "13");
|
|
176
|
+
__oe_el10.setAttribute("y1", "8");
|
|
177
|
+
__oe_el10.setAttribute("x2", "15");
|
|
178
|
+
__oe_el10.setAttribute("y2", "8");
|
|
179
|
+
__oe_el5.appendChild(__oe_el10);
|
|
180
|
+
const __oe_el11 = document.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
181
|
+
__oe_el11.setAttribute("x1", "3.05");
|
|
182
|
+
__oe_el11.setAttribute("y1", "3.05");
|
|
183
|
+
__oe_el11.setAttribute("x2", "4.46");
|
|
184
|
+
__oe_el11.setAttribute("y2", "4.46");
|
|
185
|
+
__oe_el5.appendChild(__oe_el11);
|
|
186
|
+
const __oe_el12 = document.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
187
|
+
__oe_el12.setAttribute("x1", "11.54");
|
|
188
|
+
__oe_el12.setAttribute("y1", "11.54");
|
|
189
|
+
__oe_el12.setAttribute("x2", "12.95");
|
|
190
|
+
__oe_el12.setAttribute("y2", "12.95");
|
|
191
|
+
__oe_el5.appendChild(__oe_el12);
|
|
192
|
+
const __oe_el13 = document.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
193
|
+
__oe_el13.setAttribute("x1", "3.05");
|
|
194
|
+
__oe_el13.setAttribute("y1", "12.95");
|
|
195
|
+
__oe_el13.setAttribute("x2", "4.46");
|
|
196
|
+
__oe_el13.setAttribute("y2", "11.54");
|
|
197
|
+
__oe_el5.appendChild(__oe_el13);
|
|
198
|
+
const __oe_el14 = document.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
199
|
+
__oe_el14.setAttribute("x1", "11.54");
|
|
200
|
+
__oe_el14.setAttribute("y1", "4.46");
|
|
201
|
+
__oe_el14.setAttribute("x2", "12.95");
|
|
202
|
+
__oe_el14.setAttribute("y2", "3.05");
|
|
203
|
+
__oe_el5.appendChild(__oe_el14);
|
|
204
|
+
__oe_el0.appendChild(__oe_el5);
|
|
205
|
+
const __oe_el15 = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
206
|
+
__oe_el15.setAttribute("class", "icon-moon size-4");
|
|
207
|
+
__oe_el15.setAttribute("part", "icon-moon");
|
|
208
|
+
__oe_el15.setAttribute("viewBox", "0 0 16 16");
|
|
209
|
+
__oe_el15.setAttribute("fill", "none");
|
|
210
|
+
__oe_el15.setAttribute("stroke", "currentColor");
|
|
211
|
+
__oe_el15.setAttribute("stroke-width", "1.2");
|
|
212
|
+
__oe_el15.setAttribute("stroke-linecap", "round");
|
|
213
|
+
const __oe_el16 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
214
|
+
__oe_el16.setAttribute("d", "M13.5 9.14A5.5 5.5 0 0 1 6.86 2.5 5.5 5.5 0 1 0 13.5 9.14Z");
|
|
215
|
+
__oe_el15.appendChild(__oe_el16);
|
|
216
|
+
__oe_el0.appendChild(__oe_el15);
|
|
217
|
+
__oe_nodes.push(__oe_el0);
|
|
218
|
+
return __oe_nodes;
|
|
219
|
+
}
|
|
220
|
+
export function createOpenThemeToggleRecipe(__oe_owner, __oe_host) {
|
|
221
|
+
const __oe_propsChanged = __oe_host.propsChanged;
|
|
222
|
+
if (__oe_propsChanged === undefined)
|
|
223
|
+
throw new Error("OEIR_LEAF_MISSING_VALUE: propsChanged");
|
|
224
|
+
const __oe_mountHost = { bindings: __oe_host.bindings, propDeps: [__oe_propsChanged], __oe_hostElement: __oe_host.__oe_hostElement, __oe_states: __oe_host.__oe_states, __oe_onPropertyChange: __oe_host.__oe_onPropertyChange };
|
|
225
|
+
return createRecipe({
|
|
226
|
+
definitionOwner: __oe_owner,
|
|
227
|
+
source: "src/open-theme-toggle.tsx#OpenThemeToggle",
|
|
228
|
+
mount(__oe_scope) {
|
|
229
|
+
return OpenThemeToggle__mount(__oe_scope, __oe_host.props, __oe_mountHost);
|
|
230
|
+
},
|
|
231
|
+
claim(__oe_scope, __oe_props, __oe_parent) {
|
|
232
|
+
return OpenThemeToggle__claim(__oe_scope, __oe_host.props, __oe_mountHost, __oe_parent);
|
|
233
|
+
},
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
function OpenThemeToggle__claim(__oe_scope, __oe_props, __oe_host, __oe_parent) {
|
|
237
|
+
const props = __oe_props;
|
|
238
|
+
const __oe_lifecycleEnvHooks = __oe_host.bindings.__oe_connectEnv;
|
|
239
|
+
if (__oe_lifecycleEnvHooks !== undefined) {
|
|
240
|
+
for (const __oe_lifecycleEnvHook of __oe_lifecycleEnvHooks) {
|
|
241
|
+
const __oe_lifecycleEnvCleanup = __oe_lifecycleEnvHook({ host: __oe_host.__oe_hostElement, signal: __oe_scope.signal, states: __oe_host.__oe_states });
|
|
242
|
+
if (typeof __oe_lifecycleEnvCleanup === "function")
|
|
243
|
+
__oe_scope.add(__oe_lifecycleEnvCleanup);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
const __oe_setup = __oe_host.bindings ?? {};
|
|
247
|
+
const __oe_requireRootSetup = (name) => { if (!Object.hasOwn(__oe_setup, name))
|
|
248
|
+
throw new Error("OEIR_LEAF_MISSING_VALUE: " + name); return __oe_setup[name]; };
|
|
249
|
+
const readSavedTheme = __oe_requireRootSetup("readSavedTheme");
|
|
250
|
+
const prefersLight = __oe_requireRootSetup("prefersLight");
|
|
251
|
+
const dispatchThemeChange = __oe_requireRootSetup("dispatchThemeChange");
|
|
252
|
+
const applyTheme = __oe_requireRootSetup("applyTheme");
|
|
253
|
+
const initTheme = __oe_requireRootSetup("initTheme");
|
|
254
|
+
const toggle = __oe_requireRootSetup("toggle");
|
|
255
|
+
const __oe_adopted0 = [];
|
|
256
|
+
assertElementInHtmlNamespace(__oe_parent, "/", { file: "src/open-theme-toggle.tsx", line: 56, column: 1 });
|
|
257
|
+
let __oe_claimStart2 = __oe_parent.firstChild;
|
|
258
|
+
while (__oe_claimStart2 !== null && __oe_claimStart2.nodeType === 1 && __oe_claimStart2.nodeName === "LINK" && __oe_claimStart2.hasAttribute("data-oe-static-styles"))
|
|
259
|
+
__oe_claimStart2 = __oe_claimStart2.nextSibling;
|
|
260
|
+
const __oe_cursor1 = { node: __oe_claimStart2 };
|
|
261
|
+
const __oe_el3 = __oe_cursor1.node;
|
|
262
|
+
if (__oe_el3 == null)
|
|
263
|
+
throw leafClaimMismatch("missing node at /0", { file: "src/open-theme-toggle.tsx", line: 159, column: 5 });
|
|
264
|
+
__oe_cursor1.node = __oe_el3.nextSibling;
|
|
265
|
+
if (__oe_el3.nodeType !== 1 || String(__oe_el3.localName || __oe_el3.tagName || "").toLowerCase() !== "button")
|
|
266
|
+
throw leafClaimMismatch("expected element 'button' at /0", { file: "src/open-theme-toggle.tsx", line: 159, column: 5 });
|
|
267
|
+
assertElementInHtmlNamespace(__oe_el3, "/0", { file: "src/open-theme-toggle.tsx", line: 159, column: 5 });
|
|
268
|
+
assertStaticAttributeSeed(__oe_el3, [{ name: "type", value: "button" }, { name: "class", value: "theme-toggle inline-flex size-[38px] cursor-pointer items-center justify-center rounded-full p-0 text-muted-foreground transition-all duration-150 ease-in-out hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-[3px] focus-visible:outline-ring" }, { name: "part", value: "toggle" }, { name: "aria-label", value: "Toggle theme" }], "/0", ["data-theme"], { file: "src/open-theme-toggle.tsx", line: 159, column: 5 });
|
|
269
|
+
const __oe_cursor4 = { node: __oe_el3.firstChild };
|
|
270
|
+
const __oe_el5 = __oe_cursor4.node;
|
|
271
|
+
if (__oe_el5 == null)
|
|
272
|
+
throw leafClaimMismatch("missing node at /0/0", { file: "src/open-theme-toggle.tsx", line: 170, column: 7 });
|
|
273
|
+
__oe_cursor4.node = __oe_el5.nextSibling;
|
|
274
|
+
if (__oe_el5.nodeType !== 1 || String(__oe_el5.localName || __oe_el5.tagName || "").toLowerCase() !== "svg")
|
|
275
|
+
throw leafClaimMismatch("expected element 'svg' at /0/0", { file: "src/open-theme-toggle.tsx", line: 170, column: 7 });
|
|
276
|
+
assertElementInNamespace(__oe_el5, "http://www.w3.org/2000/svg", "/0/0", { file: "src/open-theme-toggle.tsx", line: 170, column: 7 });
|
|
277
|
+
assertStaticAttributeSeed(__oe_el5, [{ name: "class", value: "icon-sun size-4" }, { name: "part", value: "icon-sun" }, { name: "viewBox", value: "0 0 16 16" }, { name: "fill", value: "none" }, { name: "stroke", value: "currentColor" }, { name: "stroke-width", value: "1.2" }, { name: "stroke-linecap", value: "round" }], "/0/0", [], { file: "src/open-theme-toggle.tsx", line: 170, column: 7 });
|
|
278
|
+
const __oe_cursor6 = { node: __oe_el5.firstChild };
|
|
279
|
+
const __oe_el7 = __oe_cursor6.node;
|
|
280
|
+
if (__oe_el7 == null)
|
|
281
|
+
throw leafClaimMismatch("missing node at /0/0/0", { file: "src/open-theme-toggle.tsx", line: 179, column: 9 });
|
|
282
|
+
__oe_cursor6.node = __oe_el7.nextSibling;
|
|
283
|
+
if (__oe_el7.nodeType !== 1 || String(__oe_el7.localName || __oe_el7.tagName || "").toLowerCase() !== "circle")
|
|
284
|
+
throw leafClaimMismatch("expected element 'circle' at /0/0/0", { file: "src/open-theme-toggle.tsx", line: 179, column: 9 });
|
|
285
|
+
assertElementInNamespace(__oe_el7, "http://www.w3.org/2000/svg", "/0/0/0", { file: "src/open-theme-toggle.tsx", line: 179, column: 9 });
|
|
286
|
+
assertStaticAttributeSeed(__oe_el7, [{ name: "cx", value: "8" }, { name: "cy", value: "8" }, { name: "r", value: "3" }], "/0/0/0", [], { file: "src/open-theme-toggle.tsx", line: 179, column: 9 });
|
|
287
|
+
const __oe_cursor8 = { node: __oe_el7.firstChild };
|
|
288
|
+
if (__oe_cursor8.node !== null)
|
|
289
|
+
throw leafClaimMismatch("extra node at /0/0/0", { file: "src/open-theme-toggle.tsx", line: 179, column: 9 });
|
|
290
|
+
const __oe_el9 = __oe_cursor6.node;
|
|
291
|
+
if (__oe_el9 == null)
|
|
292
|
+
throw leafClaimMismatch("missing node at /0/0/1", { file: "src/open-theme-toggle.tsx", line: 180, column: 9 });
|
|
293
|
+
__oe_cursor6.node = __oe_el9.nextSibling;
|
|
294
|
+
if (__oe_el9.nodeType !== 1 || String(__oe_el9.localName || __oe_el9.tagName || "").toLowerCase() !== "line")
|
|
295
|
+
throw leafClaimMismatch("expected element 'line' at /0/0/1", { file: "src/open-theme-toggle.tsx", line: 180, column: 9 });
|
|
296
|
+
assertElementInNamespace(__oe_el9, "http://www.w3.org/2000/svg", "/0/0/1", { file: "src/open-theme-toggle.tsx", line: 180, column: 9 });
|
|
297
|
+
assertStaticAttributeSeed(__oe_el9, [{ name: "x1", value: "8" }, { name: "y1", value: "1" }, { name: "x2", value: "8" }, { name: "y2", value: "3" }], "/0/0/1", [], { file: "src/open-theme-toggle.tsx", line: 180, column: 9 });
|
|
298
|
+
const __oe_cursor10 = { node: __oe_el9.firstChild };
|
|
299
|
+
if (__oe_cursor10.node !== null)
|
|
300
|
+
throw leafClaimMismatch("extra node at /0/0/1", { file: "src/open-theme-toggle.tsx", line: 180, column: 9 });
|
|
301
|
+
const __oe_el11 = __oe_cursor6.node;
|
|
302
|
+
if (__oe_el11 == null)
|
|
303
|
+
throw leafClaimMismatch("missing node at /0/0/2", { file: "src/open-theme-toggle.tsx", line: 181, column: 9 });
|
|
304
|
+
__oe_cursor6.node = __oe_el11.nextSibling;
|
|
305
|
+
if (__oe_el11.nodeType !== 1 || String(__oe_el11.localName || __oe_el11.tagName || "").toLowerCase() !== "line")
|
|
306
|
+
throw leafClaimMismatch("expected element 'line' at /0/0/2", { file: "src/open-theme-toggle.tsx", line: 181, column: 9 });
|
|
307
|
+
assertElementInNamespace(__oe_el11, "http://www.w3.org/2000/svg", "/0/0/2", { file: "src/open-theme-toggle.tsx", line: 181, column: 9 });
|
|
308
|
+
assertStaticAttributeSeed(__oe_el11, [{ name: "x1", value: "8" }, { name: "y1", value: "13" }, { name: "x2", value: "8" }, { name: "y2", value: "15" }], "/0/0/2", [], { file: "src/open-theme-toggle.tsx", line: 181, column: 9 });
|
|
309
|
+
const __oe_cursor12 = { node: __oe_el11.firstChild };
|
|
310
|
+
if (__oe_cursor12.node !== null)
|
|
311
|
+
throw leafClaimMismatch("extra node at /0/0/2", { file: "src/open-theme-toggle.tsx", line: 181, column: 9 });
|
|
312
|
+
const __oe_el13 = __oe_cursor6.node;
|
|
313
|
+
if (__oe_el13 == null)
|
|
314
|
+
throw leafClaimMismatch("missing node at /0/0/3", { file: "src/open-theme-toggle.tsx", line: 182, column: 9 });
|
|
315
|
+
__oe_cursor6.node = __oe_el13.nextSibling;
|
|
316
|
+
if (__oe_el13.nodeType !== 1 || String(__oe_el13.localName || __oe_el13.tagName || "").toLowerCase() !== "line")
|
|
317
|
+
throw leafClaimMismatch("expected element 'line' at /0/0/3", { file: "src/open-theme-toggle.tsx", line: 182, column: 9 });
|
|
318
|
+
assertElementInNamespace(__oe_el13, "http://www.w3.org/2000/svg", "/0/0/3", { file: "src/open-theme-toggle.tsx", line: 182, column: 9 });
|
|
319
|
+
assertStaticAttributeSeed(__oe_el13, [{ name: "x1", value: "1" }, { name: "y1", value: "8" }, { name: "x2", value: "3" }, { name: "y2", value: "8" }], "/0/0/3", [], { file: "src/open-theme-toggle.tsx", line: 182, column: 9 });
|
|
320
|
+
const __oe_cursor14 = { node: __oe_el13.firstChild };
|
|
321
|
+
if (__oe_cursor14.node !== null)
|
|
322
|
+
throw leafClaimMismatch("extra node at /0/0/3", { file: "src/open-theme-toggle.tsx", line: 182, column: 9 });
|
|
323
|
+
const __oe_el15 = __oe_cursor6.node;
|
|
324
|
+
if (__oe_el15 == null)
|
|
325
|
+
throw leafClaimMismatch("missing node at /0/0/4", { file: "src/open-theme-toggle.tsx", line: 183, column: 9 });
|
|
326
|
+
__oe_cursor6.node = __oe_el15.nextSibling;
|
|
327
|
+
if (__oe_el15.nodeType !== 1 || String(__oe_el15.localName || __oe_el15.tagName || "").toLowerCase() !== "line")
|
|
328
|
+
throw leafClaimMismatch("expected element 'line' at /0/0/4", { file: "src/open-theme-toggle.tsx", line: 183, column: 9 });
|
|
329
|
+
assertElementInNamespace(__oe_el15, "http://www.w3.org/2000/svg", "/0/0/4", { file: "src/open-theme-toggle.tsx", line: 183, column: 9 });
|
|
330
|
+
assertStaticAttributeSeed(__oe_el15, [{ name: "x1", value: "13" }, { name: "y1", value: "8" }, { name: "x2", value: "15" }, { name: "y2", value: "8" }], "/0/0/4", [], { file: "src/open-theme-toggle.tsx", line: 183, column: 9 });
|
|
331
|
+
const __oe_cursor16 = { node: __oe_el15.firstChild };
|
|
332
|
+
if (__oe_cursor16.node !== null)
|
|
333
|
+
throw leafClaimMismatch("extra node at /0/0/4", { file: "src/open-theme-toggle.tsx", line: 183, column: 9 });
|
|
334
|
+
const __oe_el17 = __oe_cursor6.node;
|
|
335
|
+
if (__oe_el17 == null)
|
|
336
|
+
throw leafClaimMismatch("missing node at /0/0/5", { file: "src/open-theme-toggle.tsx", line: 184, column: 9 });
|
|
337
|
+
__oe_cursor6.node = __oe_el17.nextSibling;
|
|
338
|
+
if (__oe_el17.nodeType !== 1 || String(__oe_el17.localName || __oe_el17.tagName || "").toLowerCase() !== "line")
|
|
339
|
+
throw leafClaimMismatch("expected element 'line' at /0/0/5", { file: "src/open-theme-toggle.tsx", line: 184, column: 9 });
|
|
340
|
+
assertElementInNamespace(__oe_el17, "http://www.w3.org/2000/svg", "/0/0/5", { file: "src/open-theme-toggle.tsx", line: 184, column: 9 });
|
|
341
|
+
assertStaticAttributeSeed(__oe_el17, [{ name: "x1", value: "3.05" }, { name: "y1", value: "3.05" }, { name: "x2", value: "4.46" }, { name: "y2", value: "4.46" }], "/0/0/5", [], { file: "src/open-theme-toggle.tsx", line: 184, column: 9 });
|
|
342
|
+
const __oe_cursor18 = { node: __oe_el17.firstChild };
|
|
343
|
+
if (__oe_cursor18.node !== null)
|
|
344
|
+
throw leafClaimMismatch("extra node at /0/0/5", { file: "src/open-theme-toggle.tsx", line: 184, column: 9 });
|
|
345
|
+
const __oe_el19 = __oe_cursor6.node;
|
|
346
|
+
if (__oe_el19 == null)
|
|
347
|
+
throw leafClaimMismatch("missing node at /0/0/6", { file: "src/open-theme-toggle.tsx", line: 185, column: 9 });
|
|
348
|
+
__oe_cursor6.node = __oe_el19.nextSibling;
|
|
349
|
+
if (__oe_el19.nodeType !== 1 || String(__oe_el19.localName || __oe_el19.tagName || "").toLowerCase() !== "line")
|
|
350
|
+
throw leafClaimMismatch("expected element 'line' at /0/0/6", { file: "src/open-theme-toggle.tsx", line: 185, column: 9 });
|
|
351
|
+
assertElementInNamespace(__oe_el19, "http://www.w3.org/2000/svg", "/0/0/6", { file: "src/open-theme-toggle.tsx", line: 185, column: 9 });
|
|
352
|
+
assertStaticAttributeSeed(__oe_el19, [{ name: "x1", value: "11.54" }, { name: "y1", value: "11.54" }, { name: "x2", value: "12.95" }, { name: "y2", value: "12.95" }], "/0/0/6", [], { file: "src/open-theme-toggle.tsx", line: 185, column: 9 });
|
|
353
|
+
const __oe_cursor20 = { node: __oe_el19.firstChild };
|
|
354
|
+
if (__oe_cursor20.node !== null)
|
|
355
|
+
throw leafClaimMismatch("extra node at /0/0/6", { file: "src/open-theme-toggle.tsx", line: 185, column: 9 });
|
|
356
|
+
const __oe_el21 = __oe_cursor6.node;
|
|
357
|
+
if (__oe_el21 == null)
|
|
358
|
+
throw leafClaimMismatch("missing node at /0/0/7", { file: "src/open-theme-toggle.tsx", line: 186, column: 9 });
|
|
359
|
+
__oe_cursor6.node = __oe_el21.nextSibling;
|
|
360
|
+
if (__oe_el21.nodeType !== 1 || String(__oe_el21.localName || __oe_el21.tagName || "").toLowerCase() !== "line")
|
|
361
|
+
throw leafClaimMismatch("expected element 'line' at /0/0/7", { file: "src/open-theme-toggle.tsx", line: 186, column: 9 });
|
|
362
|
+
assertElementInNamespace(__oe_el21, "http://www.w3.org/2000/svg", "/0/0/7", { file: "src/open-theme-toggle.tsx", line: 186, column: 9 });
|
|
363
|
+
assertStaticAttributeSeed(__oe_el21, [{ name: "x1", value: "3.05" }, { name: "y1", value: "12.95" }, { name: "x2", value: "4.46" }, { name: "y2", value: "11.54" }], "/0/0/7", [], { file: "src/open-theme-toggle.tsx", line: 186, column: 9 });
|
|
364
|
+
const __oe_cursor22 = { node: __oe_el21.firstChild };
|
|
365
|
+
if (__oe_cursor22.node !== null)
|
|
366
|
+
throw leafClaimMismatch("extra node at /0/0/7", { file: "src/open-theme-toggle.tsx", line: 186, column: 9 });
|
|
367
|
+
const __oe_el23 = __oe_cursor6.node;
|
|
368
|
+
if (__oe_el23 == null)
|
|
369
|
+
throw leafClaimMismatch("missing node at /0/0/8", { file: "src/open-theme-toggle.tsx", line: 187, column: 9 });
|
|
370
|
+
__oe_cursor6.node = __oe_el23.nextSibling;
|
|
371
|
+
if (__oe_el23.nodeType !== 1 || String(__oe_el23.localName || __oe_el23.tagName || "").toLowerCase() !== "line")
|
|
372
|
+
throw leafClaimMismatch("expected element 'line' at /0/0/8", { file: "src/open-theme-toggle.tsx", line: 187, column: 9 });
|
|
373
|
+
assertElementInNamespace(__oe_el23, "http://www.w3.org/2000/svg", "/0/0/8", { file: "src/open-theme-toggle.tsx", line: 187, column: 9 });
|
|
374
|
+
assertStaticAttributeSeed(__oe_el23, [{ name: "x1", value: "11.54" }, { name: "y1", value: "4.46" }, { name: "x2", value: "12.95" }, { name: "y2", value: "3.05" }], "/0/0/8", [], { file: "src/open-theme-toggle.tsx", line: 187, column: 9 });
|
|
375
|
+
const __oe_cursor24 = { node: __oe_el23.firstChild };
|
|
376
|
+
if (__oe_cursor24.node !== null)
|
|
377
|
+
throw leafClaimMismatch("extra node at /0/0/8", { file: "src/open-theme-toggle.tsx", line: 187, column: 9 });
|
|
378
|
+
if (__oe_cursor6.node !== null)
|
|
379
|
+
throw leafClaimMismatch("extra node at /0/0", { file: "src/open-theme-toggle.tsx", line: 170, column: 7 });
|
|
380
|
+
const __oe_el25 = __oe_cursor4.node;
|
|
381
|
+
if (__oe_el25 == null)
|
|
382
|
+
throw leafClaimMismatch("missing node at /0/1", { file: "src/open-theme-toggle.tsx", line: 189, column: 7 });
|
|
383
|
+
__oe_cursor4.node = __oe_el25.nextSibling;
|
|
384
|
+
if (__oe_el25.nodeType !== 1 || String(__oe_el25.localName || __oe_el25.tagName || "").toLowerCase() !== "svg")
|
|
385
|
+
throw leafClaimMismatch("expected element 'svg' at /0/1", { file: "src/open-theme-toggle.tsx", line: 189, column: 7 });
|
|
386
|
+
assertElementInNamespace(__oe_el25, "http://www.w3.org/2000/svg", "/0/1", { file: "src/open-theme-toggle.tsx", line: 189, column: 7 });
|
|
387
|
+
assertStaticAttributeSeed(__oe_el25, [{ name: "class", value: "icon-moon size-4" }, { name: "part", value: "icon-moon" }, { name: "viewBox", value: "0 0 16 16" }, { name: "fill", value: "none" }, { name: "stroke", value: "currentColor" }, { name: "stroke-width", value: "1.2" }, { name: "stroke-linecap", value: "round" }], "/0/1", [], { file: "src/open-theme-toggle.tsx", line: 189, column: 7 });
|
|
388
|
+
const __oe_cursor26 = { node: __oe_el25.firstChild };
|
|
389
|
+
const __oe_el27 = __oe_cursor26.node;
|
|
390
|
+
if (__oe_el27 == null)
|
|
391
|
+
throw leafClaimMismatch("missing node at /0/1/0", { file: "src/open-theme-toggle.tsx", line: 198, column: 9 });
|
|
392
|
+
__oe_cursor26.node = __oe_el27.nextSibling;
|
|
393
|
+
if (__oe_el27.nodeType !== 1 || String(__oe_el27.localName || __oe_el27.tagName || "").toLowerCase() !== "path")
|
|
394
|
+
throw leafClaimMismatch("expected element 'path' at /0/1/0", { file: "src/open-theme-toggle.tsx", line: 198, column: 9 });
|
|
395
|
+
assertElementInNamespace(__oe_el27, "http://www.w3.org/2000/svg", "/0/1/0", { file: "src/open-theme-toggle.tsx", line: 198, column: 9 });
|
|
396
|
+
assertStaticAttributeSeed(__oe_el27, [{ name: "d", value: "M13.5 9.14A5.5 5.5 0 0 1 6.86 2.5 5.5 5.5 0 1 0 13.5 9.14Z" }], "/0/1/0", [], { file: "src/open-theme-toggle.tsx", line: 198, column: 9 });
|
|
397
|
+
const __oe_cursor28 = { node: __oe_el27.firstChild };
|
|
398
|
+
if (__oe_cursor28.node !== null)
|
|
399
|
+
throw leafClaimMismatch("extra node at /0/1/0", { file: "src/open-theme-toggle.tsx", line: 198, column: 9 });
|
|
400
|
+
if (__oe_cursor26.node !== null)
|
|
401
|
+
throw leafClaimMismatch("extra node at /0/1", { file: "src/open-theme-toggle.tsx", line: 189, column: 7 });
|
|
402
|
+
if (__oe_cursor4.node !== null)
|
|
403
|
+
throw leafClaimMismatch("extra node at /0", { file: "src/open-theme-toggle.tsx", line: 159, column: 5 });
|
|
404
|
+
__oe_adopted0.push(__oe_el3);
|
|
405
|
+
if (__oe_cursor1.node !== null)
|
|
406
|
+
throw leafClaimMismatch("extra node at /", { file: "src/open-theme-toggle.tsx", line: 56, column: 1 });
|
|
407
|
+
function __oe_refresh29() {
|
|
408
|
+
const __oe_value30 = attributeValueOf((props.theme));
|
|
409
|
+
if (__oe_value30 === null) {
|
|
410
|
+
if (__oe_el3.hasAttribute("data-theme"))
|
|
411
|
+
__oe_el3.removeAttribute("data-theme");
|
|
412
|
+
}
|
|
413
|
+
else if (__oe_el3.getAttribute("data-theme") !== __oe_value30) {
|
|
414
|
+
assertSafeUrlAttribute("data-theme", __oe_value30);
|
|
415
|
+
__oe_el3.setAttribute("data-theme", __oe_value30);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
__oe_refresh29();
|
|
419
|
+
for (const __oe_propDep of __oe_host.propDeps)
|
|
420
|
+
bindSignalWrites(__oe_scope, __oe_propDep, "props", __oe_refresh29);
|
|
421
|
+
const __oe_eventHandler31 = ((event) => {
|
|
422
|
+
const target = event.currentTarget;
|
|
423
|
+
toggle((target.getRootNode()).host);
|
|
424
|
+
});
|
|
425
|
+
if (typeof __oe_eventHandler31 !== "function")
|
|
426
|
+
throw leafRuntimeError("OEIR_LEAF_EVENT_HANDLER_INVALID", "onClick handler is not callable", { file: "src/open-theme-toggle.tsx", line: 165, column: 7 });
|
|
427
|
+
const __oe_eventListener32 = (event) => __oe_eventHandler31(event);
|
|
428
|
+
__oe_el3.addEventListener("click", __oe_eventListener32);
|
|
429
|
+
__oe_scope.add(() => __oe_el3.removeEventListener("click", __oe_eventListener32));
|
|
430
|
+
return __oe_adopted0;
|
|
431
|
+
}
|
|
432
|
+
export function OpenThemeToggle__ssr(__oe_props, __oe_host) {
|
|
433
|
+
const props = __oe_props;
|
|
434
|
+
const __oe_out0 = [];
|
|
435
|
+
__oe_out0.push("<button");
|
|
436
|
+
__oe_out0.push(" type=\"", escapeAttrValue("button"), "\"");
|
|
437
|
+
__oe_out0.push(" class=\"", escapeAttrValue("theme-toggle inline-flex size-[38px] cursor-pointer items-center justify-center rounded-full p-0 text-muted-foreground transition-all duration-150 ease-in-out hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-[3px] focus-visible:outline-ring"), "\"");
|
|
438
|
+
__oe_out0.push(" part=\"", escapeAttrValue("toggle"), "\"");
|
|
439
|
+
const __oe_value1 = attributeValueOf((props.theme));
|
|
440
|
+
if (__oe_value1 !== null) {
|
|
441
|
+
assertSafeUrlAttribute("data-theme", __oe_value1);
|
|
442
|
+
__oe_out0.push(" data-theme=\"", escapeAttrValue(__oe_value1), "\"");
|
|
443
|
+
}
|
|
444
|
+
__oe_out0.push(" aria-label=\"", escapeAttrValue("Toggle theme"), "\"");
|
|
445
|
+
__oe_out0.push(">");
|
|
446
|
+
__oe_out0.push("<svg");
|
|
447
|
+
__oe_out0.push(" class=\"", escapeAttrValue("icon-sun size-4"), "\"");
|
|
448
|
+
__oe_out0.push(" part=\"", escapeAttrValue("icon-sun"), "\"");
|
|
449
|
+
__oe_out0.push(" viewBox=\"", escapeAttrValue("0 0 16 16"), "\"");
|
|
450
|
+
__oe_out0.push(" fill=\"", escapeAttrValue("none"), "\"");
|
|
451
|
+
__oe_out0.push(" stroke=\"", escapeAttrValue("currentColor"), "\"");
|
|
452
|
+
__oe_out0.push(" stroke-width=\"", escapeAttrValue("1.2"), "\"");
|
|
453
|
+
__oe_out0.push(" stroke-linecap=\"", escapeAttrValue("round"), "\"");
|
|
454
|
+
__oe_out0.push(">");
|
|
455
|
+
__oe_out0.push("<circle");
|
|
456
|
+
__oe_out0.push(" cx=\"", escapeAttrValue("8"), "\"");
|
|
457
|
+
__oe_out0.push(" cy=\"", escapeAttrValue("8"), "\"");
|
|
458
|
+
__oe_out0.push(" r=\"", escapeAttrValue("3"), "\"");
|
|
459
|
+
__oe_out0.push(">");
|
|
460
|
+
__oe_out0.push("</circle>");
|
|
461
|
+
__oe_out0.push("<line");
|
|
462
|
+
__oe_out0.push(" x1=\"", escapeAttrValue("8"), "\"");
|
|
463
|
+
__oe_out0.push(" y1=\"", escapeAttrValue("1"), "\"");
|
|
464
|
+
__oe_out0.push(" x2=\"", escapeAttrValue("8"), "\"");
|
|
465
|
+
__oe_out0.push(" y2=\"", escapeAttrValue("3"), "\"");
|
|
466
|
+
__oe_out0.push(">");
|
|
467
|
+
__oe_out0.push("</line>");
|
|
468
|
+
__oe_out0.push("<line");
|
|
469
|
+
__oe_out0.push(" x1=\"", escapeAttrValue("8"), "\"");
|
|
470
|
+
__oe_out0.push(" y1=\"", escapeAttrValue("13"), "\"");
|
|
471
|
+
__oe_out0.push(" x2=\"", escapeAttrValue("8"), "\"");
|
|
472
|
+
__oe_out0.push(" y2=\"", escapeAttrValue("15"), "\"");
|
|
473
|
+
__oe_out0.push(">");
|
|
474
|
+
__oe_out0.push("</line>");
|
|
475
|
+
__oe_out0.push("<line");
|
|
476
|
+
__oe_out0.push(" x1=\"", escapeAttrValue("1"), "\"");
|
|
477
|
+
__oe_out0.push(" y1=\"", escapeAttrValue("8"), "\"");
|
|
478
|
+
__oe_out0.push(" x2=\"", escapeAttrValue("3"), "\"");
|
|
479
|
+
__oe_out0.push(" y2=\"", escapeAttrValue("8"), "\"");
|
|
480
|
+
__oe_out0.push(">");
|
|
481
|
+
__oe_out0.push("</line>");
|
|
482
|
+
__oe_out0.push("<line");
|
|
483
|
+
__oe_out0.push(" x1=\"", escapeAttrValue("13"), "\"");
|
|
484
|
+
__oe_out0.push(" y1=\"", escapeAttrValue("8"), "\"");
|
|
485
|
+
__oe_out0.push(" x2=\"", escapeAttrValue("15"), "\"");
|
|
486
|
+
__oe_out0.push(" y2=\"", escapeAttrValue("8"), "\"");
|
|
487
|
+
__oe_out0.push(">");
|
|
488
|
+
__oe_out0.push("</line>");
|
|
489
|
+
__oe_out0.push("<line");
|
|
490
|
+
__oe_out0.push(" x1=\"", escapeAttrValue("3.05"), "\"");
|
|
491
|
+
__oe_out0.push(" y1=\"", escapeAttrValue("3.05"), "\"");
|
|
492
|
+
__oe_out0.push(" x2=\"", escapeAttrValue("4.46"), "\"");
|
|
493
|
+
__oe_out0.push(" y2=\"", escapeAttrValue("4.46"), "\"");
|
|
494
|
+
__oe_out0.push(">");
|
|
495
|
+
__oe_out0.push("</line>");
|
|
496
|
+
__oe_out0.push("<line");
|
|
497
|
+
__oe_out0.push(" x1=\"", escapeAttrValue("11.54"), "\"");
|
|
498
|
+
__oe_out0.push(" y1=\"", escapeAttrValue("11.54"), "\"");
|
|
499
|
+
__oe_out0.push(" x2=\"", escapeAttrValue("12.95"), "\"");
|
|
500
|
+
__oe_out0.push(" y2=\"", escapeAttrValue("12.95"), "\"");
|
|
501
|
+
__oe_out0.push(">");
|
|
502
|
+
__oe_out0.push("</line>");
|
|
503
|
+
__oe_out0.push("<line");
|
|
504
|
+
__oe_out0.push(" x1=\"", escapeAttrValue("3.05"), "\"");
|
|
505
|
+
__oe_out0.push(" y1=\"", escapeAttrValue("12.95"), "\"");
|
|
506
|
+
__oe_out0.push(" x2=\"", escapeAttrValue("4.46"), "\"");
|
|
507
|
+
__oe_out0.push(" y2=\"", escapeAttrValue("11.54"), "\"");
|
|
508
|
+
__oe_out0.push(">");
|
|
509
|
+
__oe_out0.push("</line>");
|
|
510
|
+
__oe_out0.push("<line");
|
|
511
|
+
__oe_out0.push(" x1=\"", escapeAttrValue("11.54"), "\"");
|
|
512
|
+
__oe_out0.push(" y1=\"", escapeAttrValue("4.46"), "\"");
|
|
513
|
+
__oe_out0.push(" x2=\"", escapeAttrValue("12.95"), "\"");
|
|
514
|
+
__oe_out0.push(" y2=\"", escapeAttrValue("3.05"), "\"");
|
|
515
|
+
__oe_out0.push(">");
|
|
516
|
+
__oe_out0.push("</line>");
|
|
517
|
+
__oe_out0.push("</svg>");
|
|
518
|
+
__oe_out0.push("<svg");
|
|
519
|
+
__oe_out0.push(" class=\"", escapeAttrValue("icon-moon size-4"), "\"");
|
|
520
|
+
__oe_out0.push(" part=\"", escapeAttrValue("icon-moon"), "\"");
|
|
521
|
+
__oe_out0.push(" viewBox=\"", escapeAttrValue("0 0 16 16"), "\"");
|
|
522
|
+
__oe_out0.push(" fill=\"", escapeAttrValue("none"), "\"");
|
|
523
|
+
__oe_out0.push(" stroke=\"", escapeAttrValue("currentColor"), "\"");
|
|
524
|
+
__oe_out0.push(" stroke-width=\"", escapeAttrValue("1.2"), "\"");
|
|
525
|
+
__oe_out0.push(" stroke-linecap=\"", escapeAttrValue("round"), "\"");
|
|
526
|
+
__oe_out0.push(">");
|
|
527
|
+
__oe_out0.push("<path");
|
|
528
|
+
__oe_out0.push(" d=\"", escapeAttrValue("M13.5 9.14A5.5 5.5 0 0 1 6.86 2.5 5.5 5.5 0 1 0 13.5 9.14Z"), "\"");
|
|
529
|
+
__oe_out0.push(">");
|
|
530
|
+
__oe_out0.push("</path>");
|
|
531
|
+
__oe_out0.push("</svg>");
|
|
532
|
+
__oe_out0.push("</button>");
|
|
533
|
+
return __oe_out0.join("");
|
|
534
|
+
}
|
|
535
|
+
import { createGeneratedElementClassWithFeatures as __oe_createElementClass, generatedElementProperties as __oe_propertiesFeature, serializeGeneratedElementHtml, seedGeneratedElementHostProperties } from "@openelement/element/internal/compiled/generated-element/shell";
|
|
536
|
+
const __oeElementDescriptor = {
|
|
537
|
+
tag: "open-theme-toggle",
|
|
538
|
+
root: "shadow-open",
|
|
539
|
+
delegatesFocus: true,
|
|
540
|
+
properties: [
|
|
541
|
+
{ name: "theme", attribute: "theme", type: "string", reflect: false, default: "dark" },
|
|
542
|
+
],
|
|
543
|
+
createRecipe: createOpenThemeToggleRecipe,
|
|
544
|
+
createInstance: __oe_rootInstance,
|
|
545
|
+
};
|
|
546
|
+
const __oeOpenThemeToggleElement = __oe_createElementClass(__oeElementDescriptor, { properties: __oe_propertiesFeature });
|
|
547
|
+
export default __oeOpenThemeToggleElement;
|
|
548
|
+
export { __oeOpenThemeToggleElement as OpenThemeToggleElement };
|
|
549
|
+
export const __oeElementTag = "open-theme-toggle";
|
|
550
|
+
export function OpenThemeToggle__ssrHost(props, lightChildren, attributes, styleLinks, nestedHost) {
|
|
551
|
+
if (!Array.isArray(styleLinks) || styleLinks.length === 0)
|
|
552
|
+
throw new Error("OEIR_LEAF_MISSING_VALUE: styleLinks (the styled generated element received no declared stylesheet URLs; mixed generated-element/entry artifacts or a missing style-link carrier)");
|
|
553
|
+
const __oeHostProps = seedGeneratedElementHostProperties(__oeElementDescriptor.properties, props, attributes);
|
|
554
|
+
const __oeHostAttrs = __oeHostProps.__oeHostAttributes;
|
|
555
|
+
return serializeGeneratedElementHtml({
|
|
556
|
+
tag: "open-theme-toggle",
|
|
557
|
+
root: "open",
|
|
558
|
+
dsd: { delegatesFocus: true },
|
|
559
|
+
content: OpenThemeToggle__ssr(__oeHostProps, nestedHost === undefined ? undefined : { "__oe_nestedHost": nestedHost }),
|
|
560
|
+
...(lightChildren === undefined ? {} : { lightChildren }),
|
|
561
|
+
...(attributes === undefined && __oeHostAttrs === undefined ? {} : { attributes: __oeHostAttrs === undefined ? attributes : __oeHostAttrs }),
|
|
562
|
+
...(styleLinks === undefined ? {} : { styleLinks }),
|
|
563
|
+
});
|
|
564
|
+
}
|