@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.
Files changed (43) hide show
  1. package/CUSTOMIZATION.md +106 -112
  2. package/README.md +19 -39
  3. package/custom-elements.json +369 -0
  4. package/package.json +3 -2
  5. package/src/button-machine.js +54 -0
  6. package/src/component-config.js +7 -0
  7. package/src/component-recipes.js +2 -24
  8. package/src/copy-feedback.js +32 -0
  9. package/src/dialog-machine.js +104 -0
  10. package/src/dropdown-machine.js +253 -0
  11. package/src/generated-manifest.json +135 -87
  12. package/src/index.d.ts +7 -8
  13. package/src/index.js +7 -8
  14. package/src/input-machine.js +33 -0
  15. package/src/open-button.css +119 -108
  16. package/src/open-button.d.ts +34 -342
  17. package/src/open-button.generated.js +592 -0
  18. package/src/open-button.js +115 -1140
  19. package/src/open-code-block.css +24 -44
  20. package/src/open-code-block.d.ts +15 -175
  21. package/src/open-code-block.generated.js +293 -0
  22. package/src/open-code-block.js +112 -224
  23. package/src/open-dialog.css +114 -127
  24. package/src/open-dialog.d.ts +22 -261
  25. package/src/open-dialog.generated.js +501 -0
  26. package/src/open-dialog.js +137 -632
  27. package/src/open-dropdown.css +26 -26
  28. package/src/open-dropdown.d.ts +15 -218
  29. package/src/open-dropdown.generated.js +211 -0
  30. package/src/open-dropdown.js +74 -355
  31. package/src/open-input.css +69 -74
  32. package/src/open-input.d.ts +34 -461
  33. package/src/open-input.generated.js +685 -0
  34. package/src/open-input.js +161 -1802
  35. package/src/open-theme-toggle.css +37 -47
  36. package/src/open-theme-toggle.d.ts +19 -190
  37. package/src/open-theme-toggle.generated.js +564 -0
  38. package/src/open-theme-toggle.js +209 -509
  39. package/src/theme-contract.js +40 -0
  40. package/src/theme.css +26 -8
  41. package/src/control-recipe.css +0 -21
  42. package/src/register.d.ts +0 -4
  43. package/src/register.js +0 -22
@@ -0,0 +1,685 @@
1
+ import { assertElementInHtmlNamespace, assertSafeUrlAttribute, assertStaticAttributeSeed, assertTextSlotMarker, attributeValueOf, bindSignalWrites, createRecipe, displayValue, emitComment, escapeAttrValue, escapeText, leafClaimMismatch, leafRuntimeError, markerText, textSlotMarker } from "@openelement/element/internal/compiled/leaf-runtime";
2
+ import { syncInputDisabled } from "./input-machine.js";
3
+ import { syncInputValue } from "./input-machine.js";
4
+ function __oe_rootInstance(__oe_owner, __oe_host) {
5
+ const hostOf = ((event) => ((event.currentTarget).getRootNode()).host);
6
+ const lockedByFieldset = ((event) => hostOf(event).matches(':state(disabled)'));
7
+ const __oe_connectEnv = [];
8
+ __oe_connectEnv.push(((env) => {
9
+ syncInputValue(env.host);
10
+ }));
11
+ if (__oe_host.__oe_onPropertyChange !== undefined)
12
+ __oe_host.__oe_onPropertyChange(((event) => {
13
+ const host = event.host;
14
+ if (event.name === 'value') {
15
+ syncInputValue(host);
16
+ return;
17
+ }
18
+ if (event.name === 'disabled') {
19
+ syncInputDisabled(host);
20
+ }
21
+ }));
22
+ return { hostOf, lockedByFieldset, __oe_connectEnv };
23
+ }
24
+ function OpenInput__mount(__oe_scope, __oe_props, __oe_host) {
25
+ const props = __oe_props;
26
+ const __oe_lifecycleEnvHooks = __oe_host.bindings.__oe_connectEnv;
27
+ if (__oe_lifecycleEnvHooks !== undefined) {
28
+ for (const __oe_lifecycleEnvHook of __oe_lifecycleEnvHooks) {
29
+ const __oe_lifecycleEnvCleanup = __oe_lifecycleEnvHook({ host: __oe_host.__oe_hostElement, signal: __oe_scope.signal, states: __oe_host.__oe_states });
30
+ if (typeof __oe_lifecycleEnvCleanup === "function")
31
+ __oe_scope.add(__oe_lifecycleEnvCleanup);
32
+ }
33
+ }
34
+ const __oe_nodes = [];
35
+ const __oe_setup = __oe_host.bindings ?? {};
36
+ const __oe_requireRootSetup = (name) => { if (!Object.hasOwn(__oe_setup, name))
37
+ throw new Error("OEIR_LEAF_MISSING_VALUE: " + name); return __oe_setup[name]; };
38
+ const hostOf = __oe_requireRootSetup("hostOf");
39
+ const lockedByFieldset = __oe_requireRootSetup("lockedByFieldset");
40
+ const __oe_el0 = document.createElement("div");
41
+ __oe_el0.setAttribute("class", "flex flex-col gap-2");
42
+ __oe_el0.setAttribute("part", "wrapper");
43
+ const __oe_el1 = document.createElement("label");
44
+ __oe_el1.setAttribute("class", "text-sm font-medium text-muted-foreground tracking-normal");
45
+ __oe_el1.setAttribute("part", "label");
46
+ __oe_el1.setAttribute("for", "open-input-control");
47
+ function __oe_refresh2() {
48
+ __oe_el1.toggleAttribute("hidden", Boolean((props.label === '')));
49
+ }
50
+ __oe_refresh2();
51
+ for (const __oe_propDep of __oe_host.propDeps)
52
+ bindSignalWrites(__oe_scope, __oe_propDep, "props", __oe_refresh2);
53
+ const __oe_textStart3 = emitComment(textSlotMarker(0));
54
+ const __oe_text5 = document.createTextNode("");
55
+ const __oe_textEnd4 = emitComment(textSlotMarker(0, true));
56
+ function __oe_refresh6() {
57
+ __oe_text5.nodeValue = displayValue((props.label));
58
+ }
59
+ __oe_refresh6();
60
+ for (const __oe_propDep of __oe_host.propDeps)
61
+ bindSignalWrites(__oe_scope, __oe_propDep, "props", __oe_refresh6);
62
+ __oe_el1.appendChild(__oe_textStart3);
63
+ __oe_el1.appendChild(__oe_text5);
64
+ __oe_el1.appendChild(__oe_textEnd4);
65
+ const __oe_el7 = document.createElement("span");
66
+ __oe_el7.setAttribute("class", "required-mark");
67
+ __oe_el1.appendChild(__oe_el7);
68
+ __oe_el0.appendChild(__oe_el1);
69
+ const __oe_el8 = document.createElement("input");
70
+ __oe_el8.setAttribute("class", "control w-full px-3 py-2 font-sans text-base text-foreground rounded-md outline-none transition-[border-color,box-shadow] duration-200 ease-out placeholder:text-muted-foreground");
71
+ __oe_el8.setAttribute("part", "control");
72
+ __oe_el8.setAttribute("id", "open-input-control");
73
+ __oe_el8.setAttribute("data-form-validation", "email");
74
+ function __oe_refresh9() {
75
+ const __oe_value10 = attributeValueOf((props.type));
76
+ if (__oe_value10 === null)
77
+ __oe_el8.removeAttribute("type");
78
+ else {
79
+ assertSafeUrlAttribute("type", __oe_value10);
80
+ __oe_el8.setAttribute("type", __oe_value10);
81
+ }
82
+ }
83
+ __oe_refresh9();
84
+ for (const __oe_propDep of __oe_host.propDeps)
85
+ bindSignalWrites(__oe_scope, __oe_propDep, "props", __oe_refresh9);
86
+ function __oe_refresh11() {
87
+ const __oe_value12 = attributeValueOf((props.placeholder));
88
+ if (__oe_value12 === null)
89
+ __oe_el8.removeAttribute("placeholder");
90
+ else {
91
+ assertSafeUrlAttribute("placeholder", __oe_value12);
92
+ __oe_el8.setAttribute("placeholder", __oe_value12);
93
+ }
94
+ }
95
+ __oe_refresh11();
96
+ for (const __oe_propDep of __oe_host.propDeps)
97
+ bindSignalWrites(__oe_scope, __oe_propDep, "props", __oe_refresh11);
98
+ function __oe_refresh13() {
99
+ const __oe_value14 = attributeValueOf((props.name));
100
+ if (__oe_value14 === null)
101
+ __oe_el8.removeAttribute("name");
102
+ else {
103
+ assertSafeUrlAttribute("name", __oe_value14);
104
+ __oe_el8.setAttribute("name", __oe_value14);
105
+ }
106
+ }
107
+ __oe_refresh13();
108
+ for (const __oe_propDep of __oe_host.propDeps)
109
+ bindSignalWrites(__oe_scope, __oe_propDep, "props", __oe_refresh13);
110
+ function __oe_refresh15() {
111
+ __oe_el8.toggleAttribute("disabled", Boolean((props.disabled)));
112
+ }
113
+ __oe_refresh15();
114
+ for (const __oe_propDep of __oe_host.propDeps)
115
+ bindSignalWrites(__oe_scope, __oe_propDep, "props", __oe_refresh15);
116
+ function __oe_refresh16() {
117
+ __oe_el8.toggleAttribute("required", Boolean((props.required)));
118
+ }
119
+ __oe_refresh16();
120
+ for (const __oe_propDep of __oe_host.propDeps)
121
+ bindSignalWrites(__oe_scope, __oe_propDep, "props", __oe_refresh16);
122
+ function __oe_refresh17() {
123
+ const __oe_value18 = attributeValueOf((props.error === '' ? null : 'true'));
124
+ if (__oe_value18 === null)
125
+ __oe_el8.removeAttribute("aria-invalid");
126
+ else {
127
+ assertSafeUrlAttribute("aria-invalid", __oe_value18);
128
+ __oe_el8.setAttribute("aria-invalid", __oe_value18);
129
+ }
130
+ }
131
+ __oe_refresh17();
132
+ for (const __oe_propDep of __oe_host.propDeps)
133
+ bindSignalWrites(__oe_scope, __oe_propDep, "props", __oe_refresh17);
134
+ function __oe_refresh19() {
135
+ const __oe_value20 = attributeValueOf((props.error === '' ? null : 'open-input-error'));
136
+ if (__oe_value20 === null)
137
+ __oe_el8.removeAttribute("aria-describedby");
138
+ else {
139
+ assertSafeUrlAttribute("aria-describedby", __oe_value20);
140
+ __oe_el8.setAttribute("aria-describedby", __oe_value20);
141
+ }
142
+ }
143
+ __oe_refresh19();
144
+ for (const __oe_propDep of __oe_host.propDeps)
145
+ bindSignalWrites(__oe_scope, __oe_propDep, "props", __oe_refresh19);
146
+ function __oe_refresh21() {
147
+ const __oe_value22 = attributeValueOf((props.error === '' ? null : 'open-input-error'));
148
+ if (__oe_value22 === null)
149
+ __oe_el8.removeAttribute("aria-errormessage");
150
+ else {
151
+ assertSafeUrlAttribute("aria-errormessage", __oe_value22);
152
+ __oe_el8.setAttribute("aria-errormessage", __oe_value22);
153
+ }
154
+ }
155
+ __oe_refresh21();
156
+ for (const __oe_propDep of __oe_host.propDeps)
157
+ bindSignalWrites(__oe_scope, __oe_propDep, "props", __oe_refresh21);
158
+ const __oe_eventHandler23 = ((event) => {
159
+ const host = hostOf(event);
160
+ const control = event.target;
161
+ if (lockedByFieldset(event)) {
162
+ syncInputValue(host);
163
+ return;
164
+ }
165
+ host.value = control.value;
166
+ if (host.getAttribute('value') !== control.value) {
167
+ host.setAttribute('value', control.value);
168
+ }
169
+ host.dispatchEvent(new globalThis.CustomEvent('open-input', {
170
+ detail: { value: control.value },
171
+ bubbles: true,
172
+ composed: true,
173
+ }));
174
+ });
175
+ if (typeof __oe_eventHandler23 !== "function")
176
+ throw leafRuntimeError("OEIR_LEAF_EVENT_HANDLER_INVALID", "onInput handler is not callable", { file: "src/open-input.tsx", line: 147, column: 9 });
177
+ const __oe_eventListener24 = (event) => __oe_eventHandler23(event);
178
+ __oe_el8.addEventListener("input", __oe_eventListener24);
179
+ __oe_scope.add(() => __oe_el8.removeEventListener("input", __oe_eventListener24));
180
+ const __oe_eventHandler25 = ((event) => {
181
+ if (lockedByFieldset(event))
182
+ return;
183
+ const control = event.target;
184
+ hostOf(event).dispatchEvent(new globalThis.CustomEvent('open-change', {
185
+ detail: { value: control.value },
186
+ bubbles: true,
187
+ composed: true,
188
+ }));
189
+ });
190
+ if (typeof __oe_eventHandler25 !== "function")
191
+ throw leafRuntimeError("OEIR_LEAF_EVENT_HANDLER_INVALID", "onChange handler is not callable", { file: "src/open-input.tsx", line: 172, column: 9 });
192
+ const __oe_eventListener26 = (event) => __oe_eventHandler25(event);
193
+ __oe_el8.addEventListener("change", __oe_eventListener26);
194
+ __oe_scope.add(() => __oe_el8.removeEventListener("change", __oe_eventListener26));
195
+ const __oe_eventHandler27 = ((event) => {
196
+ hostOf(event).dispatchEvent(new globalThis.CustomEvent('open-focus', { bubbles: true, composed: true }));
197
+ });
198
+ if (typeof __oe_eventHandler27 !== "function")
199
+ throw leafRuntimeError("OEIR_LEAF_EVENT_HANDLER_INVALID", "onFocus handler is not callable", { file: "src/open-input.tsx", line: 183, column: 9 });
200
+ const __oe_eventListener28 = (event) => __oe_eventHandler27(event);
201
+ __oe_el8.addEventListener("focus", __oe_eventListener28);
202
+ __oe_scope.add(() => __oe_el8.removeEventListener("focus", __oe_eventListener28));
203
+ const __oe_eventHandler29 = ((event) => {
204
+ hostOf(event).dispatchEvent(new globalThis.CustomEvent('open-blur', { bubbles: true, composed: true }));
205
+ });
206
+ if (typeof __oe_eventHandler29 !== "function")
207
+ throw leafRuntimeError("OEIR_LEAF_EVENT_HANDLER_INVALID", "onBlur handler is not callable", { file: "src/open-input.tsx", line: 188, column: 9 });
208
+ const __oe_eventListener30 = (event) => __oe_eventHandler29(event);
209
+ __oe_el8.addEventListener("blur", __oe_eventListener30);
210
+ __oe_scope.add(() => __oe_el8.removeEventListener("blur", __oe_eventListener30));
211
+ __oe_el0.appendChild(__oe_el8);
212
+ const __oe_el31 = document.createElement("small");
213
+ __oe_el31.setAttribute("id", "open-input-error");
214
+ __oe_el31.setAttribute("role", "alert");
215
+ __oe_el31.setAttribute("class", "text-xs text-destructive");
216
+ __oe_el31.setAttribute("part", "error");
217
+ function __oe_refresh32() {
218
+ __oe_el31.toggleAttribute("hidden", Boolean((props.error === '')));
219
+ }
220
+ __oe_refresh32();
221
+ for (const __oe_propDep of __oe_host.propDeps)
222
+ bindSignalWrites(__oe_scope, __oe_propDep, "props", __oe_refresh32);
223
+ const __oe_textStart33 = emitComment(textSlotMarker(1));
224
+ const __oe_text35 = document.createTextNode("");
225
+ const __oe_textEnd34 = emitComment(textSlotMarker(1, true));
226
+ function __oe_refresh36() {
227
+ __oe_text35.nodeValue = displayValue((props.error));
228
+ }
229
+ __oe_refresh36();
230
+ for (const __oe_propDep of __oe_host.propDeps)
231
+ bindSignalWrites(__oe_scope, __oe_propDep, "props", __oe_refresh36);
232
+ __oe_el31.appendChild(__oe_textStart33);
233
+ __oe_el31.appendChild(__oe_text35);
234
+ __oe_el31.appendChild(__oe_textEnd34);
235
+ __oe_el0.appendChild(__oe_el31);
236
+ __oe_nodes.push(__oe_el0);
237
+ return __oe_nodes;
238
+ }
239
+ export function createOpenInputRecipe(__oe_owner, __oe_host) {
240
+ const __oe_propsChanged = __oe_host.propsChanged;
241
+ if (__oe_propsChanged === undefined)
242
+ throw new Error("OEIR_LEAF_MISSING_VALUE: propsChanged");
243
+ 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 };
244
+ return createRecipe({
245
+ definitionOwner: __oe_owner,
246
+ source: "src/open-input.tsx#OpenInput",
247
+ mount(__oe_scope) {
248
+ return OpenInput__mount(__oe_scope, __oe_host.props, __oe_mountHost);
249
+ },
250
+ claim(__oe_scope, __oe_props, __oe_parent) {
251
+ return OpenInput__claim(__oe_scope, __oe_host.props, __oe_mountHost, __oe_parent);
252
+ },
253
+ });
254
+ }
255
+ function OpenInput__claim(__oe_scope, __oe_props, __oe_host, __oe_parent) {
256
+ const props = __oe_props;
257
+ const __oe_lifecycleEnvHooks = __oe_host.bindings.__oe_connectEnv;
258
+ if (__oe_lifecycleEnvHooks !== undefined) {
259
+ for (const __oe_lifecycleEnvHook of __oe_lifecycleEnvHooks) {
260
+ const __oe_lifecycleEnvCleanup = __oe_lifecycleEnvHook({ host: __oe_host.__oe_hostElement, signal: __oe_scope.signal, states: __oe_host.__oe_states });
261
+ if (typeof __oe_lifecycleEnvCleanup === "function")
262
+ __oe_scope.add(__oe_lifecycleEnvCleanup);
263
+ }
264
+ }
265
+ const __oe_setup = __oe_host.bindings ?? {};
266
+ const __oe_requireRootSetup = (name) => { if (!Object.hasOwn(__oe_setup, name))
267
+ throw new Error("OEIR_LEAF_MISSING_VALUE: " + name); return __oe_setup[name]; };
268
+ const hostOf = __oe_requireRootSetup("hostOf");
269
+ const lockedByFieldset = __oe_requireRootSetup("lockedByFieldset");
270
+ const __oe_adopted0 = [];
271
+ assertElementInHtmlNamespace(__oe_parent, "/", { file: "src/open-input.tsx", line: 76, column: 1 });
272
+ let __oe_claimStart2 = __oe_parent.firstChild;
273
+ while (__oe_claimStart2 !== null && __oe_claimStart2.nodeType === 1 && __oe_claimStart2.nodeName === "LINK" && __oe_claimStart2.hasAttribute("data-oe-static-styles"))
274
+ __oe_claimStart2 = __oe_claimStart2.nextSibling;
275
+ const __oe_cursor1 = { node: __oe_claimStart2 };
276
+ const __oe_el3 = __oe_cursor1.node;
277
+ if (__oe_el3 == null)
278
+ throw leafClaimMismatch("missing node at /0", { file: "src/open-input.tsx", line: 124, column: 5 });
279
+ __oe_cursor1.node = __oe_el3.nextSibling;
280
+ if (__oe_el3.nodeType !== 1 || String(__oe_el3.localName || __oe_el3.tagName || "").toLowerCase() !== "div")
281
+ throw leafClaimMismatch("expected element 'div' at /0", { file: "src/open-input.tsx", line: 124, column: 5 });
282
+ assertElementInHtmlNamespace(__oe_el3, "/0", { file: "src/open-input.tsx", line: 124, column: 5 });
283
+ assertStaticAttributeSeed(__oe_el3, [{ name: "class", value: "flex flex-col gap-2" }, { name: "part", value: "wrapper" }], "/0", [], { file: "src/open-input.tsx", line: 124, column: 5 });
284
+ const __oe_cursor4 = { node: __oe_el3.firstChild };
285
+ const __oe_el5 = __oe_cursor4.node;
286
+ if (__oe_el5 == null)
287
+ throw leafClaimMismatch("missing node at /0/0", { file: "src/open-input.tsx", line: 125, column: 7 });
288
+ __oe_cursor4.node = __oe_el5.nextSibling;
289
+ if (__oe_el5.nodeType !== 1 || String(__oe_el5.localName || __oe_el5.tagName || "").toLowerCase() !== "label")
290
+ throw leafClaimMismatch("expected element 'label' at /0/0", { file: "src/open-input.tsx", line: 125, column: 7 });
291
+ assertElementInHtmlNamespace(__oe_el5, "/0/0", { file: "src/open-input.tsx", line: 125, column: 7 });
292
+ assertStaticAttributeSeed(__oe_el5, [{ name: "class", value: "text-sm font-medium text-muted-foreground tracking-normal" }, { name: "part", value: "label" }, { name: "for", value: "open-input-control" }], "/0/0", ["hidden"], { file: "src/open-input.tsx", line: 125, column: 7 });
293
+ const __oe_cursor6 = { node: __oe_el5.firstChild };
294
+ const __oe_textStart7 = __oe_cursor6.node;
295
+ if (__oe_textStart7 == null)
296
+ throw leafClaimMismatch("missing node at /0/0/0/text-start", { file: "src/open-input.tsx", line: 131, column: 10 });
297
+ __oe_cursor6.node = __oe_textStart7.nextSibling;
298
+ assertTextSlotMarker(__oe_textStart7, 0, false, "/0/0/0/text-start", { file: "src/open-input.tsx", line: 131, column: 10 });
299
+ let __oe_slotText8 = null;
300
+ const __oe_maybeText9 = __oe_cursor6.node;
301
+ if (__oe_maybeText9 !== null && __oe_maybeText9.nodeType === 3) {
302
+ __oe_slotText8 = __oe_maybeText9;
303
+ __oe_cursor6.node = __oe_maybeText9.nextSibling;
304
+ }
305
+ const __oe_textEnd10 = __oe_cursor6.node;
306
+ if (__oe_textEnd10 == null)
307
+ throw leafClaimMismatch("missing node at /0/0/0/text-end", { file: "src/open-input.tsx", line: 131, column: 10 });
308
+ __oe_cursor6.node = __oe_textEnd10.nextSibling;
309
+ assertTextSlotMarker(__oe_textEnd10, 0, true, "/0/0/0/text-end", { file: "src/open-input.tsx", line: 131, column: 10 });
310
+ const __oe_el11 = __oe_cursor6.node;
311
+ if (__oe_el11 == null)
312
+ throw leafClaimMismatch("missing node at /0/0/1", { file: "src/open-input.tsx", line: 132, column: 9 });
313
+ __oe_cursor6.node = __oe_el11.nextSibling;
314
+ if (__oe_el11.nodeType !== 1 || String(__oe_el11.localName || __oe_el11.tagName || "").toLowerCase() !== "span")
315
+ throw leafClaimMismatch("expected element 'span' at /0/0/1", { file: "src/open-input.tsx", line: 132, column: 9 });
316
+ assertElementInHtmlNamespace(__oe_el11, "/0/0/1", { file: "src/open-input.tsx", line: 132, column: 9 });
317
+ assertStaticAttributeSeed(__oe_el11, [{ name: "class", value: "required-mark" }], "/0/0/1", [], { file: "src/open-input.tsx", line: 132, column: 9 });
318
+ const __oe_cursor12 = { node: __oe_el11.firstChild };
319
+ if (__oe_cursor12.node !== null)
320
+ throw leafClaimMismatch("extra node at /0/0/1", { file: "src/open-input.tsx", line: 132, column: 9 });
321
+ if (__oe_cursor6.node !== null)
322
+ throw leafClaimMismatch("extra node at /0/0", { file: "src/open-input.tsx", line: 125, column: 7 });
323
+ const __oe_el13 = __oe_cursor4.node;
324
+ if (__oe_el13 == null)
325
+ throw leafClaimMismatch("missing node at /0/1", { file: "src/open-input.tsx", line: 134, column: 7 });
326
+ __oe_cursor4.node = __oe_el13.nextSibling;
327
+ if (__oe_el13.nodeType !== 1 || String(__oe_el13.localName || __oe_el13.tagName || "").toLowerCase() !== "input")
328
+ throw leafClaimMismatch("expected element 'input' at /0/1", { file: "src/open-input.tsx", line: 134, column: 7 });
329
+ assertElementInHtmlNamespace(__oe_el13, "/0/1", { file: "src/open-input.tsx", line: 134, column: 7 });
330
+ assertStaticAttributeSeed(__oe_el13, [{ name: "class", value: "control w-full px-3 py-2 font-sans text-base text-foreground rounded-md outline-none transition-[border-color,box-shadow] duration-200 ease-out placeholder:text-muted-foreground" }, { name: "part", value: "control" }, { name: "id", value: "open-input-control" }, { name: "data-form-validation", value: "email" }], "/0/1", ["type", "placeholder", "name", "disabled", "required", "aria-invalid", "aria-describedby", "aria-errormessage"], { file: "src/open-input.tsx", line: 134, column: 7 });
331
+ const __oe_cursor14 = { node: __oe_el13.firstChild };
332
+ if (__oe_cursor14.node !== null)
333
+ throw leafClaimMismatch("extra node at /0/1", { file: "src/open-input.tsx", line: 134, column: 7 });
334
+ const __oe_el15 = __oe_cursor4.node;
335
+ if (__oe_el15 == null)
336
+ throw leafClaimMismatch("missing node at /0/2", { file: "src/open-input.tsx", line: 194, column: 7 });
337
+ __oe_cursor4.node = __oe_el15.nextSibling;
338
+ if (__oe_el15.nodeType !== 1 || String(__oe_el15.localName || __oe_el15.tagName || "").toLowerCase() !== "small")
339
+ throw leafClaimMismatch("expected element 'small' at /0/2", { file: "src/open-input.tsx", line: 194, column: 7 });
340
+ assertElementInHtmlNamespace(__oe_el15, "/0/2", { file: "src/open-input.tsx", line: 194, column: 7 });
341
+ assertStaticAttributeSeed(__oe_el15, [{ name: "id", value: "open-input-error" }, { name: "role", value: "alert" }, { name: "class", value: "text-xs text-destructive" }, { name: "part", value: "error" }], "/0/2", ["hidden"], { file: "src/open-input.tsx", line: 194, column: 7 });
342
+ const __oe_cursor16 = { node: __oe_el15.firstChild };
343
+ const __oe_textStart17 = __oe_cursor16.node;
344
+ if (__oe_textStart17 == null)
345
+ throw leafClaimMismatch("missing node at /0/2/0/text-start", { file: "src/open-input.tsx", line: 201, column: 10 });
346
+ __oe_cursor16.node = __oe_textStart17.nextSibling;
347
+ assertTextSlotMarker(__oe_textStart17, 1, false, "/0/2/0/text-start", { file: "src/open-input.tsx", line: 201, column: 10 });
348
+ let __oe_slotText18 = null;
349
+ const __oe_maybeText19 = __oe_cursor16.node;
350
+ if (__oe_maybeText19 !== null && __oe_maybeText19.nodeType === 3) {
351
+ __oe_slotText18 = __oe_maybeText19;
352
+ __oe_cursor16.node = __oe_maybeText19.nextSibling;
353
+ }
354
+ const __oe_textEnd20 = __oe_cursor16.node;
355
+ if (__oe_textEnd20 == null)
356
+ throw leafClaimMismatch("missing node at /0/2/0/text-end", { file: "src/open-input.tsx", line: 201, column: 10 });
357
+ __oe_cursor16.node = __oe_textEnd20.nextSibling;
358
+ assertTextSlotMarker(__oe_textEnd20, 1, true, "/0/2/0/text-end", { file: "src/open-input.tsx", line: 201, column: 10 });
359
+ if (__oe_cursor16.node !== null)
360
+ throw leafClaimMismatch("extra node at /0/2", { file: "src/open-input.tsx", line: 194, column: 7 });
361
+ if (__oe_cursor4.node !== null)
362
+ throw leafClaimMismatch("extra node at /0", { file: "src/open-input.tsx", line: 124, column: 5 });
363
+ __oe_adopted0.push(__oe_el3);
364
+ if (__oe_cursor1.node !== null)
365
+ throw leafClaimMismatch("extra node at /", { file: "src/open-input.tsx", line: 76, column: 1 });
366
+ function __oe_refresh21() {
367
+ const __oe_value22 = Boolean((props.label === ''));
368
+ if (__oe_el5.hasAttribute("hidden") !== __oe_value22)
369
+ __oe_el5.toggleAttribute("hidden", __oe_value22);
370
+ }
371
+ __oe_refresh21();
372
+ for (const __oe_propDep of __oe_host.propDeps)
373
+ bindSignalWrites(__oe_scope, __oe_propDep, "props", __oe_refresh21);
374
+ function __oe_refresh23() {
375
+ const __oe_value24 = displayValue((props.label));
376
+ if (__oe_slotText8 === null) {
377
+ if (__oe_value24 !== "") {
378
+ const __oe_text25 = document.createTextNode(__oe_value24);
379
+ __oe_textEnd10.parentNode.insertBefore(__oe_text25, __oe_textEnd10);
380
+ __oe_scope.addRangeCleanup(() => __oe_text25.remove());
381
+ __oe_slotText8 = __oe_text25;
382
+ }
383
+ }
384
+ else if (__oe_slotText8.nodeValue !== __oe_value24) {
385
+ __oe_slotText8.nodeValue = __oe_value24;
386
+ }
387
+ }
388
+ __oe_refresh23();
389
+ for (const __oe_propDep of __oe_host.propDeps)
390
+ bindSignalWrites(__oe_scope, __oe_propDep, "props", __oe_refresh23);
391
+ function __oe_refresh26() {
392
+ const __oe_value27 = attributeValueOf((props.type));
393
+ if (__oe_value27 === null) {
394
+ if (__oe_el13.hasAttribute("type"))
395
+ __oe_el13.removeAttribute("type");
396
+ }
397
+ else if (__oe_el13.getAttribute("type") !== __oe_value27) {
398
+ assertSafeUrlAttribute("type", __oe_value27);
399
+ __oe_el13.setAttribute("type", __oe_value27);
400
+ }
401
+ }
402
+ __oe_refresh26();
403
+ for (const __oe_propDep of __oe_host.propDeps)
404
+ bindSignalWrites(__oe_scope, __oe_propDep, "props", __oe_refresh26);
405
+ function __oe_refresh28() {
406
+ const __oe_value29 = attributeValueOf((props.placeholder));
407
+ if (__oe_value29 === null) {
408
+ if (__oe_el13.hasAttribute("placeholder"))
409
+ __oe_el13.removeAttribute("placeholder");
410
+ }
411
+ else if (__oe_el13.getAttribute("placeholder") !== __oe_value29) {
412
+ assertSafeUrlAttribute("placeholder", __oe_value29);
413
+ __oe_el13.setAttribute("placeholder", __oe_value29);
414
+ }
415
+ }
416
+ __oe_refresh28();
417
+ for (const __oe_propDep of __oe_host.propDeps)
418
+ bindSignalWrites(__oe_scope, __oe_propDep, "props", __oe_refresh28);
419
+ function __oe_refresh30() {
420
+ const __oe_value31 = attributeValueOf((props.name));
421
+ if (__oe_value31 === null) {
422
+ if (__oe_el13.hasAttribute("name"))
423
+ __oe_el13.removeAttribute("name");
424
+ }
425
+ else if (__oe_el13.getAttribute("name") !== __oe_value31) {
426
+ assertSafeUrlAttribute("name", __oe_value31);
427
+ __oe_el13.setAttribute("name", __oe_value31);
428
+ }
429
+ }
430
+ __oe_refresh30();
431
+ for (const __oe_propDep of __oe_host.propDeps)
432
+ bindSignalWrites(__oe_scope, __oe_propDep, "props", __oe_refresh30);
433
+ function __oe_refresh32() {
434
+ const __oe_value33 = Boolean((props.disabled));
435
+ if (__oe_el13.hasAttribute("disabled") !== __oe_value33)
436
+ __oe_el13.toggleAttribute("disabled", __oe_value33);
437
+ }
438
+ __oe_refresh32();
439
+ for (const __oe_propDep of __oe_host.propDeps)
440
+ bindSignalWrites(__oe_scope, __oe_propDep, "props", __oe_refresh32);
441
+ function __oe_refresh34() {
442
+ const __oe_value35 = Boolean((props.required));
443
+ if (__oe_el13.hasAttribute("required") !== __oe_value35)
444
+ __oe_el13.toggleAttribute("required", __oe_value35);
445
+ }
446
+ __oe_refresh34();
447
+ for (const __oe_propDep of __oe_host.propDeps)
448
+ bindSignalWrites(__oe_scope, __oe_propDep, "props", __oe_refresh34);
449
+ function __oe_refresh36() {
450
+ const __oe_value37 = attributeValueOf((props.error === '' ? null : 'true'));
451
+ if (__oe_value37 === null) {
452
+ if (__oe_el13.hasAttribute("aria-invalid"))
453
+ __oe_el13.removeAttribute("aria-invalid");
454
+ }
455
+ else if (__oe_el13.getAttribute("aria-invalid") !== __oe_value37) {
456
+ assertSafeUrlAttribute("aria-invalid", __oe_value37);
457
+ __oe_el13.setAttribute("aria-invalid", __oe_value37);
458
+ }
459
+ }
460
+ __oe_refresh36();
461
+ for (const __oe_propDep of __oe_host.propDeps)
462
+ bindSignalWrites(__oe_scope, __oe_propDep, "props", __oe_refresh36);
463
+ function __oe_refresh38() {
464
+ const __oe_value39 = attributeValueOf((props.error === '' ? null : 'open-input-error'));
465
+ if (__oe_value39 === null) {
466
+ if (__oe_el13.hasAttribute("aria-describedby"))
467
+ __oe_el13.removeAttribute("aria-describedby");
468
+ }
469
+ else if (__oe_el13.getAttribute("aria-describedby") !== __oe_value39) {
470
+ assertSafeUrlAttribute("aria-describedby", __oe_value39);
471
+ __oe_el13.setAttribute("aria-describedby", __oe_value39);
472
+ }
473
+ }
474
+ __oe_refresh38();
475
+ for (const __oe_propDep of __oe_host.propDeps)
476
+ bindSignalWrites(__oe_scope, __oe_propDep, "props", __oe_refresh38);
477
+ function __oe_refresh40() {
478
+ const __oe_value41 = attributeValueOf((props.error === '' ? null : 'open-input-error'));
479
+ if (__oe_value41 === null) {
480
+ if (__oe_el13.hasAttribute("aria-errormessage"))
481
+ __oe_el13.removeAttribute("aria-errormessage");
482
+ }
483
+ else if (__oe_el13.getAttribute("aria-errormessage") !== __oe_value41) {
484
+ assertSafeUrlAttribute("aria-errormessage", __oe_value41);
485
+ __oe_el13.setAttribute("aria-errormessage", __oe_value41);
486
+ }
487
+ }
488
+ __oe_refresh40();
489
+ for (const __oe_propDep of __oe_host.propDeps)
490
+ bindSignalWrites(__oe_scope, __oe_propDep, "props", __oe_refresh40);
491
+ const __oe_eventHandler42 = ((event) => {
492
+ const host = hostOf(event);
493
+ const control = event.target;
494
+ if (lockedByFieldset(event)) {
495
+ syncInputValue(host);
496
+ return;
497
+ }
498
+ host.value = control.value;
499
+ if (host.getAttribute('value') !== control.value) {
500
+ host.setAttribute('value', control.value);
501
+ }
502
+ host.dispatchEvent(new globalThis.CustomEvent('open-input', {
503
+ detail: { value: control.value },
504
+ bubbles: true,
505
+ composed: true,
506
+ }));
507
+ });
508
+ if (typeof __oe_eventHandler42 !== "function")
509
+ throw leafRuntimeError("OEIR_LEAF_EVENT_HANDLER_INVALID", "onInput handler is not callable", { file: "src/open-input.tsx", line: 147, column: 9 });
510
+ const __oe_eventListener43 = (event) => __oe_eventHandler42(event);
511
+ __oe_el13.addEventListener("input", __oe_eventListener43);
512
+ __oe_scope.add(() => __oe_el13.removeEventListener("input", __oe_eventListener43));
513
+ const __oe_eventHandler44 = ((event) => {
514
+ if (lockedByFieldset(event))
515
+ return;
516
+ const control = event.target;
517
+ hostOf(event).dispatchEvent(new globalThis.CustomEvent('open-change', {
518
+ detail: { value: control.value },
519
+ bubbles: true,
520
+ composed: true,
521
+ }));
522
+ });
523
+ if (typeof __oe_eventHandler44 !== "function")
524
+ throw leafRuntimeError("OEIR_LEAF_EVENT_HANDLER_INVALID", "onChange handler is not callable", { file: "src/open-input.tsx", line: 172, column: 9 });
525
+ const __oe_eventListener45 = (event) => __oe_eventHandler44(event);
526
+ __oe_el13.addEventListener("change", __oe_eventListener45);
527
+ __oe_scope.add(() => __oe_el13.removeEventListener("change", __oe_eventListener45));
528
+ const __oe_eventHandler46 = ((event) => {
529
+ hostOf(event).dispatchEvent(new globalThis.CustomEvent('open-focus', { bubbles: true, composed: true }));
530
+ });
531
+ if (typeof __oe_eventHandler46 !== "function")
532
+ throw leafRuntimeError("OEIR_LEAF_EVENT_HANDLER_INVALID", "onFocus handler is not callable", { file: "src/open-input.tsx", line: 183, column: 9 });
533
+ const __oe_eventListener47 = (event) => __oe_eventHandler46(event);
534
+ __oe_el13.addEventListener("focus", __oe_eventListener47);
535
+ __oe_scope.add(() => __oe_el13.removeEventListener("focus", __oe_eventListener47));
536
+ const __oe_eventHandler48 = ((event) => {
537
+ hostOf(event).dispatchEvent(new globalThis.CustomEvent('open-blur', { bubbles: true, composed: true }));
538
+ });
539
+ if (typeof __oe_eventHandler48 !== "function")
540
+ throw leafRuntimeError("OEIR_LEAF_EVENT_HANDLER_INVALID", "onBlur handler is not callable", { file: "src/open-input.tsx", line: 188, column: 9 });
541
+ const __oe_eventListener49 = (event) => __oe_eventHandler48(event);
542
+ __oe_el13.addEventListener("blur", __oe_eventListener49);
543
+ __oe_scope.add(() => __oe_el13.removeEventListener("blur", __oe_eventListener49));
544
+ function __oe_refresh50() {
545
+ const __oe_value51 = Boolean((props.error === ''));
546
+ if (__oe_el15.hasAttribute("hidden") !== __oe_value51)
547
+ __oe_el15.toggleAttribute("hidden", __oe_value51);
548
+ }
549
+ __oe_refresh50();
550
+ for (const __oe_propDep of __oe_host.propDeps)
551
+ bindSignalWrites(__oe_scope, __oe_propDep, "props", __oe_refresh50);
552
+ function __oe_refresh52() {
553
+ const __oe_value53 = displayValue((props.error));
554
+ if (__oe_slotText18 === null) {
555
+ if (__oe_value53 !== "") {
556
+ const __oe_text54 = document.createTextNode(__oe_value53);
557
+ __oe_textEnd20.parentNode.insertBefore(__oe_text54, __oe_textEnd20);
558
+ __oe_scope.addRangeCleanup(() => __oe_text54.remove());
559
+ __oe_slotText18 = __oe_text54;
560
+ }
561
+ }
562
+ else if (__oe_slotText18.nodeValue !== __oe_value53) {
563
+ __oe_slotText18.nodeValue = __oe_value53;
564
+ }
565
+ }
566
+ __oe_refresh52();
567
+ for (const __oe_propDep of __oe_host.propDeps)
568
+ bindSignalWrites(__oe_scope, __oe_propDep, "props", __oe_refresh52);
569
+ return __oe_adopted0;
570
+ }
571
+ export function OpenInput__ssr(__oe_props, __oe_host) {
572
+ const props = __oe_props;
573
+ const __oe_out0 = [];
574
+ __oe_out0.push("<div");
575
+ __oe_out0.push(" class=\"", escapeAttrValue("flex flex-col gap-2"), "\"");
576
+ __oe_out0.push(" part=\"", escapeAttrValue("wrapper"), "\"");
577
+ __oe_out0.push(">");
578
+ __oe_out0.push("<label");
579
+ __oe_out0.push(" class=\"", escapeAttrValue("text-sm font-medium text-muted-foreground tracking-normal"), "\"");
580
+ __oe_out0.push(" part=\"", escapeAttrValue("label"), "\"");
581
+ __oe_out0.push(" for=\"", escapeAttrValue("open-input-control"), "\"");
582
+ if (Boolean((props.label === '')))
583
+ __oe_out0.push(" hidden=\"\"");
584
+ __oe_out0.push(">");
585
+ __oe_out0.push("<!--", markerText(textSlotMarker(0)), "-->");
586
+ __oe_out0.push(escapeText(displayValue((props.label))));
587
+ __oe_out0.push("<!--", markerText(textSlotMarker(0, true)), "-->");
588
+ __oe_out0.push("<span");
589
+ __oe_out0.push(" class=\"", escapeAttrValue("required-mark"), "\"");
590
+ __oe_out0.push(">");
591
+ __oe_out0.push("</span>");
592
+ __oe_out0.push("</label>");
593
+ __oe_out0.push("<input");
594
+ __oe_out0.push(" class=\"", escapeAttrValue("control w-full px-3 py-2 font-sans text-base text-foreground rounded-md outline-none transition-[border-color,box-shadow] duration-200 ease-out placeholder:text-muted-foreground"), "\"");
595
+ __oe_out0.push(" part=\"", escapeAttrValue("control"), "\"");
596
+ __oe_out0.push(" id=\"", escapeAttrValue("open-input-control"), "\"");
597
+ __oe_out0.push(" data-form-validation=\"", escapeAttrValue("email"), "\"");
598
+ const __oe_value1 = attributeValueOf((props.type));
599
+ if (__oe_value1 !== null) {
600
+ assertSafeUrlAttribute("type", __oe_value1);
601
+ __oe_out0.push(" type=\"", escapeAttrValue(__oe_value1), "\"");
602
+ }
603
+ const __oe_value2 = attributeValueOf((props.placeholder));
604
+ if (__oe_value2 !== null) {
605
+ assertSafeUrlAttribute("placeholder", __oe_value2);
606
+ __oe_out0.push(" placeholder=\"", escapeAttrValue(__oe_value2), "\"");
607
+ }
608
+ const __oe_value3 = attributeValueOf((props.name));
609
+ if (__oe_value3 !== null) {
610
+ assertSafeUrlAttribute("name", __oe_value3);
611
+ __oe_out0.push(" name=\"", escapeAttrValue(__oe_value3), "\"");
612
+ }
613
+ if (Boolean((props.disabled)))
614
+ __oe_out0.push(" disabled=\"\"");
615
+ if (Boolean((props.required)))
616
+ __oe_out0.push(" required=\"\"");
617
+ const __oe_value4 = attributeValueOf((props.error === '' ? null : 'true'));
618
+ if (__oe_value4 !== null) {
619
+ assertSafeUrlAttribute("aria-invalid", __oe_value4);
620
+ __oe_out0.push(" aria-invalid=\"", escapeAttrValue(__oe_value4), "\"");
621
+ }
622
+ const __oe_value5 = attributeValueOf((props.error === '' ? null : 'open-input-error'));
623
+ if (__oe_value5 !== null) {
624
+ assertSafeUrlAttribute("aria-describedby", __oe_value5);
625
+ __oe_out0.push(" aria-describedby=\"", escapeAttrValue(__oe_value5), "\"");
626
+ }
627
+ const __oe_value6 = attributeValueOf((props.error === '' ? null : 'open-input-error'));
628
+ if (__oe_value6 !== null) {
629
+ assertSafeUrlAttribute("aria-errormessage", __oe_value6);
630
+ __oe_out0.push(" aria-errormessage=\"", escapeAttrValue(__oe_value6), "\"");
631
+ }
632
+ __oe_out0.push(">");
633
+ __oe_out0.push("<small");
634
+ __oe_out0.push(" id=\"", escapeAttrValue("open-input-error"), "\"");
635
+ __oe_out0.push(" role=\"", escapeAttrValue("alert"), "\"");
636
+ __oe_out0.push(" class=\"", escapeAttrValue("text-xs text-destructive"), "\"");
637
+ __oe_out0.push(" part=\"", escapeAttrValue("error"), "\"");
638
+ if (Boolean((props.error === '')))
639
+ __oe_out0.push(" hidden=\"\"");
640
+ __oe_out0.push(">");
641
+ __oe_out0.push("<!--", markerText(textSlotMarker(1)), "-->");
642
+ __oe_out0.push(escapeText(displayValue((props.error))));
643
+ __oe_out0.push("<!--", markerText(textSlotMarker(1, true)), "-->");
644
+ __oe_out0.push("</small>");
645
+ __oe_out0.push("</div>");
646
+ return __oe_out0.join("");
647
+ }
648
+ import { createGeneratedElementClassWithFeatures as __oe_createElementClass, GeneratedElementForm as __oe_formFeature, generatedElementProperties as __oe_propertiesFeature, serializeGeneratedElementHtml, seedGeneratedElementHostProperties } from "@openelement/element/internal/compiled/generated-element/shell";
649
+ const __oeElementDescriptor = {
650
+ tag: "open-input",
651
+ root: "shadow-open",
652
+ delegatesFocus: true,
653
+ formAssociated: true,
654
+ properties: [
655
+ { name: "type", attribute: "type", type: "string", reflect: false, default: "text" },
656
+ { name: "placeholder", attribute: "placeholder", type: "string", reflect: false, default: "" },
657
+ { name: "label", attribute: "label", type: "string", reflect: false, default: "" },
658
+ { name: "name", attribute: "name", type: "string", reflect: false, default: "" },
659
+ { name: "value", attribute: "value", type: "string", reflect: false, default: "" },
660
+ { name: "disabled", attribute: "disabled", type: "boolean", reflect: false, default: false },
661
+ { name: "required", attribute: "required", type: "boolean", reflect: false, default: false },
662
+ { name: "error", attribute: "error", type: "string", reflect: false, default: "" },
663
+ ],
664
+ createRecipe: createOpenInputRecipe,
665
+ createInstance: __oe_rootInstance,
666
+ };
667
+ const __oeOpenInputElement = __oe_createElementClass(__oeElementDescriptor, { form: __oe_formFeature, properties: __oe_propertiesFeature });
668
+ export default __oeOpenInputElement;
669
+ export { __oeOpenInputElement as OpenInputElement };
670
+ export const __oeElementTag = "open-input";
671
+ export function OpenInput__ssrHost(props, lightChildren, attributes, styleLinks, nestedHost) {
672
+ if (!Array.isArray(styleLinks) || styleLinks.length === 0)
673
+ 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)");
674
+ const __oeHostProps = seedGeneratedElementHostProperties(__oeElementDescriptor.properties, props, attributes);
675
+ const __oeHostAttrs = __oeHostProps.__oeHostAttributes;
676
+ return serializeGeneratedElementHtml({
677
+ tag: "open-input",
678
+ root: "open",
679
+ dsd: { delegatesFocus: true },
680
+ content: OpenInput__ssr(__oeHostProps, nestedHost === undefined ? undefined : { "__oe_nestedHost": nestedHost }),
681
+ ...(lightChildren === undefined ? {} : { lightChildren }),
682
+ ...(attributes === undefined && __oeHostAttrs === undefined ? {} : { attributes: __oeHostAttrs === undefined ? attributes : __oeHostAttrs }),
683
+ ...(styleLinks === undefined ? {} : { styleLinks }),
684
+ });
685
+ }