@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
@@ -1,28 +1,28 @@
1
- /* open-dropdown — authored component styles, ported verbatim from the pre-#1558
2
- * recipe() sheet (the alpha.9 design system). The #1558 migration had
3
- * replaced this with a placeholder shell under the false note that the
4
- * component "carried no authored styles"; it did — this is that sheet. */
5
- :host {
6
- display: inline-block;
7
- }
1
+ /* open-dropdown — the irreducible authored rules (alpha15 S lane).
2
+ *
3
+ * The trigger's `display: contents` and the content's min-width/padding/font
4
+ * are authored as Tailwind utilities in open-dropdown.tsx. What stays here is
5
+ * the coupled placement block: the CSS Anchor Positioning longhands plus the
6
+ * explicit inset fallback for engines without anchor support (Firefox only
7
+ * applies `anchor()` longhands on top of an explicit inset), and the gap that
8
+ * must ride on margin-top — `calc(anchor() + length)` resolves without the
9
+ * added length there. It is one ownership block, so no utility may set
10
+ * position/inset/margin on the same element. */
11
+ :host {
12
+ display: inline-block;
13
+ }
8
14
 
9
- .trigger {
10
- display: contents;
11
- }
15
+ .content {
16
+ position: absolute;
17
+ inset: 100% auto auto 0;
18
+ top: anchor(bottom);
19
+ left: anchor(left);
20
+ margin: calc(var(--spacing) * 2) 0 0;
21
+ /* The anchor identity is a CUSTOM PROPERTY the activation sets on the host,
22
+ never an inline declaration on this compiled leaf: a runtime inline style
23
+ on a compiled node is an extra static attribute at the reconnect claim
24
+ (OEIR_LEAF_CLAIM_MISMATCH), while a custom property on the host is
25
+ outside the seed surface and inherits into this block. */
26
+ position-anchor: var(--oe-dropdown-anchor, --oe-dropdown-unset);
27
+ }
12
28
 
13
- .content {
14
- /* The base inset is the placement fallback for engines without CSS Anchor
15
- Positioning; it must stay present because Firefox's anchor resolution
16
- only applies anchor() longhands on top of an explicit inset. */
17
- position: absolute;
18
- inset: 100% auto auto 0;
19
- top: anchor(bottom);
20
- left: anchor(left);
21
- min-width: 12rem;
22
- /* The gap rides on margin-top: calc(anchor() + length) resolves without
23
- the added length in Firefox. */
24
- margin: calc(var(--spacing) * 2) 0 0;
25
- padding: calc(var(--spacing) * 2);
26
- font-family: var(--font-sans);
27
- }
28
-
@@ -1,225 +1,22 @@
1
- import { OpenElement, ReadonlySignal, StyleSheetLike } from "@openelement/element";
2
1
  //#region src/open-dropdown.d.ts
3
- declare const __partProgram: {
4
- version: number;
5
- tag: string;
6
- root: {
7
- id: string;
8
- kind: string;
9
- nodes: string[];
10
- };
11
- template: {
12
- k: string;
13
- id: string;
14
- tag: string;
15
- attrs: never[];
16
- children: {
17
- k: string;
18
- id: string;
19
- tag: string;
20
- attrs: string[][];
21
- children: {
22
- k: string;
23
- id: string;
24
- tag: string;
25
- attrs: string[][];
26
- children: never[];
27
- }[];
28
- }[];
29
- }[];
30
- parts: ({
31
- k: string;
32
- event: string;
33
- handler: string;
34
- action: {
35
- kind: string;
36
- name: string;
37
- };
38
- path: number[];
39
- index: number;
40
- location: {
41
- id: string;
42
- kind: string;
43
- path: number[];
44
- node: string;
45
- };
46
- signal?: undefined;
47
- } | {
48
- k: string;
49
- signal: string;
50
- path: number[];
51
- index: number;
52
- location: {
53
- id: string;
54
- kind: string;
55
- path: number[];
56
- node: string;
57
- };
58
- event?: undefined;
59
- handler?: undefined;
60
- action?: undefined;
61
- })[];
62
- regions: never[];
63
- dependencies: {
64
- signal: string;
65
- owner: {
66
- kind: string;
67
- index: number;
68
- };
69
- location: string;
70
- }[];
71
- locations: ({
72
- id: string;
73
- kind: string;
74
- tag: string;
75
- path: number[];
76
- part?: undefined;
77
- node?: undefined;
78
- } | {
79
- id: string;
80
- kind: string;
81
- part: number;
82
- node: string;
83
- path: number[];
84
- tag?: undefined;
85
- })[];
86
- metadata: {
87
- tag: string;
88
- className: string;
89
- sourceFile: string;
90
- properties: ({
91
- name: string;
92
- attribute: null;
93
- type: string;
94
- converter: string;
95
- reflect: boolean;
2
+ /**
3
+ * Platform facts for the generated element: shadow root, the authored
4
+ * package stylesheets, and the property-only `anchorName` row (the anchor
5
+ * identity is assigned at activation, never spelled as an attribute).
6
+ */
7
+ export declare const openElement: {
8
+ root: "shadow";
9
+ styles: string[];
10
+ properties: {
11
+ anchorName: {
96
12
  default: string;
97
- computed?: undefined;
98
- deps?: undefined;
99
- } | {
100
- name: string;
101
- attribute: null;
102
- type: string;
103
- converter: string;
104
- reflect: boolean;
105
- default: null;
106
- computed: boolean;
107
- deps: string[];
108
- })[];
109
- observedAttributes: never[];
110
- cem: {
111
- tagName: string;
112
- className: string;
113
- declaration: {
114
- name: string;
115
- module: string;
116
- };
117
- attributes: never[];
118
- members: {
119
- name: string;
120
- fieldName: string;
121
- type: string;
122
- attribute: null;
123
- reflect: boolean;
124
- }[];
125
- };
126
- };
127
- };
128
- declare const __compiledProperties: ({
129
- name: string;
130
- attribute: null;
131
- type: string;
132
- converter: string;
133
- reflect: boolean;
134
- default: string;
135
- computed?: undefined;
136
- deps?: undefined;
137
- } | {
138
- name: string;
139
- attribute: null;
140
- type: string;
141
- converter: string;
142
- reflect: boolean;
143
- default: null;
144
- computed: boolean;
145
- deps: string[];
146
- })[];
147
- declare const __elementMetadata: {
148
- tag: string;
149
- className: string;
150
- sourceFile: string;
151
- properties: ({
152
- name: string;
153
- attribute: null;
154
- type: string;
155
- converter: string;
156
- reflect: boolean;
157
- default: string;
158
- computed?: undefined;
159
- deps?: undefined;
160
- } | {
161
- name: string;
162
- attribute: null;
163
- type: string;
164
- converter: string;
165
- reflect: boolean;
166
- default: null;
167
- computed: boolean;
168
- deps: string[];
169
- })[];
170
- observedAttributes: never[];
171
- cem: {
172
- tagName: string;
173
- className: string;
174
- declaration: {
175
- name: string;
176
- module: string;
13
+ attribute: false;
177
14
  };
178
- attributes: never[];
179
- members: {
180
- name: string;
181
- fieldName: string;
182
- type: string;
183
- attribute: null;
184
- reflect: boolean;
185
- }[];
186
- };
187
- };
188
- declare const __observedAttributes: string[];
189
- declare const __compiledProps: {
190
- anchorName: {
191
- type: StringConstructor;
192
- default: string;
193
- reflect: boolean;
194
- attribute: boolean;
195
- };
196
- anchorStyle: {
197
- type: ObjectConstructor;
198
- default: undefined;
199
- reflect: boolean;
200
- attribute: boolean;
201
15
  };
202
16
  };
203
- export declare class OpenDropdown extends OpenElement {
204
- static __partProgram: typeof __partProgram;
205
- static __compiledProperties: typeof __compiledProperties;
206
- static __elementMetadata: typeof __elementMetadata;
207
- static props: typeof __compiledProps;
208
- static observedAttributes: typeof __observedAttributes;
209
- static __computedFields: {
210
- anchorStyle: (__s: {
211
- anchorName: ReadonlySignal<string>;
212
- }) => ReadonlySignal<string>;
213
- };
214
- static styles: StyleSheetLike[];
17
+ /** Popover-API dropdown with CSS Anchor Positioning placement. */
18
+ declare function OpenDropdown(props: {
215
19
  anchorName: string;
216
- onDsdHydrated(): void;
217
- onCsrRendered(): void;
218
- private watchFocusReturn;
219
- private syncAnchorName;
220
- private onTriggerPointerDown;
221
- private toggle;
222
- render(): never;
223
- }
20
+ }): any;
224
21
  //#endregion
225
- export { __elementMetadata, __partProgram };
22
+ export { OpenDropdown as default };
@@ -0,0 +1,211 @@
1
+ import { assertElementInHtmlNamespace, assertStaticAttributeSeed, createRecipe, escapeAttrValue, leafClaimMismatch, leafRuntimeError } from "@openelement/element/internal/compiled/leaf-runtime";
2
+ import { activateDropdown } from "./dropdown-machine.js";
3
+ import { clearDropdownPositionAnchor } from "./dropdown-machine.js";
4
+ import { clearDropdownTriggerAria } from "./dropdown-machine.js";
5
+ import { disposeDropdownFocusWiring } from "./dropdown-machine.js";
6
+ import { recordDropdownPointerDown } from "./dropdown-machine.js";
7
+ import { syncDropdownAnchor } from "./dropdown-machine.js";
8
+ import { toggleDropdown } from "./dropdown-machine.js";
9
+ function __oe_rootInstance(__oe_owner, __oe_host) {
10
+ const hostOf = ((event) => ((event.currentTarget).getRootNode()).host);
11
+ const __oe_connectEnv = [];
12
+ __oe_connectEnv.push(((env) => {
13
+ const host = env.host;
14
+ activateDropdown(host);
15
+ return () => clearDropdownTriggerAria(host);
16
+ }));
17
+ const __oe_teardownSignal = __oe_owner.signal;
18
+ __oe_owner.add(() => ((env) => {
19
+ const host = env.host;
20
+ clearDropdownPositionAnchor(host);
21
+ disposeDropdownFocusWiring(host);
22
+ })({ host: __oe_host.__oe_hostElement, signal: __oe_teardownSignal, states: __oe_host.__oe_states }));
23
+ if (__oe_host.__oe_onPropertyChange !== undefined)
24
+ __oe_host.__oe_onPropertyChange(((event) => {
25
+ if (event.name !== 'anchorName')
26
+ return;
27
+ syncDropdownAnchor(event.host);
28
+ }));
29
+ return { hostOf, __oe_connectEnv };
30
+ }
31
+ function OpenDropdown__mount(__oe_scope, __oe_props, __oe_host) {
32
+ const props = __oe_props;
33
+ const __oe_lifecycleEnvHooks = __oe_host.bindings.__oe_connectEnv;
34
+ if (__oe_lifecycleEnvHooks !== undefined) {
35
+ for (const __oe_lifecycleEnvHook of __oe_lifecycleEnvHooks) {
36
+ const __oe_lifecycleEnvCleanup = __oe_lifecycleEnvHook({ host: __oe_host.__oe_hostElement, signal: __oe_scope.signal, states: __oe_host.__oe_states });
37
+ if (typeof __oe_lifecycleEnvCleanup === "function")
38
+ __oe_scope.add(__oe_lifecycleEnvCleanup);
39
+ }
40
+ }
41
+ const __oe_nodes = [];
42
+ const __oe_setup = __oe_host.bindings ?? {};
43
+ const __oe_requireRootSetup = (name) => { if (!Object.hasOwn(__oe_setup, name))
44
+ throw new Error("OEIR_LEAF_MISSING_VALUE: " + name); return __oe_setup[name]; };
45
+ const hostOf = __oe_requireRootSetup("hostOf");
46
+ const __oe_el0 = document.createElement("div");
47
+ const __oe_el1 = document.createElement("span");
48
+ __oe_el1.setAttribute("class", "trigger contents");
49
+ __oe_el1.setAttribute("part", "trigger");
50
+ const __oe_eventHandler2 = ((event) => recordDropdownPointerDown(hostOf(event)));
51
+ if (typeof __oe_eventHandler2 !== "function")
52
+ throw leafRuntimeError("OEIR_LEAF_EVENT_HANDLER_INVALID", "onPointerDown handler is not callable", { file: "src/open-dropdown.tsx", line: 100, column: 9 });
53
+ const __oe_eventListener3 = (event) => __oe_eventHandler2(event);
54
+ __oe_el1.addEventListener("pointerdown", __oe_eventListener3);
55
+ __oe_scope.add(() => __oe_el1.removeEventListener("pointerdown", __oe_eventListener3));
56
+ const __oe_eventHandler4 = ((event) => toggleDropdown(hostOf(event)));
57
+ if (typeof __oe_eventHandler4 !== "function")
58
+ throw leafRuntimeError("OEIR_LEAF_EVENT_HANDLER_INVALID", "onClick handler is not callable", { file: "src/open-dropdown.tsx", line: 101, column: 9 });
59
+ const __oe_eventListener5 = (event) => __oe_eventHandler4(event);
60
+ __oe_el1.addEventListener("click", __oe_eventListener5);
61
+ __oe_scope.add(() => __oe_el1.removeEventListener("click", __oe_eventListener5));
62
+ const __oe_el6 = document.createElement("slot");
63
+ __oe_el6.setAttribute("name", "trigger");
64
+ __oe_el1.appendChild(__oe_el6);
65
+ __oe_el0.appendChild(__oe_el1);
66
+ const __oe_el7 = document.createElement("div");
67
+ __oe_el7.setAttribute("class", "overlay content min-w-48 p-2 font-sans");
68
+ __oe_el7.setAttribute("part", "content");
69
+ __oe_el7.setAttribute("popover", "auto");
70
+ const __oe_el8 = document.createElement("slot");
71
+ __oe_el7.appendChild(__oe_el8);
72
+ __oe_el0.appendChild(__oe_el7);
73
+ __oe_nodes.push(__oe_el0);
74
+ return __oe_nodes;
75
+ }
76
+ export function createOpenDropdownRecipe(__oe_owner, __oe_host) {
77
+ const __oe_mountHost = { bindings: __oe_host.bindings, propDeps: [], __oe_hostElement: __oe_host.__oe_hostElement, __oe_states: __oe_host.__oe_states, __oe_onPropertyChange: __oe_host.__oe_onPropertyChange };
78
+ return createRecipe({
79
+ definitionOwner: __oe_owner,
80
+ source: "src/open-dropdown.tsx#OpenDropdown",
81
+ mount(__oe_scope) {
82
+ return OpenDropdown__mount(__oe_scope, __oe_host.props, __oe_mountHost);
83
+ },
84
+ claim(__oe_scope, __oe_props, __oe_parent) {
85
+ return OpenDropdown__claim(__oe_scope, __oe_host.props, __oe_mountHost, __oe_parent);
86
+ },
87
+ });
88
+ }
89
+ function OpenDropdown__claim(__oe_scope, __oe_props, __oe_host, __oe_parent) {
90
+ const props = __oe_props;
91
+ const __oe_lifecycleEnvHooks = __oe_host.bindings.__oe_connectEnv;
92
+ if (__oe_lifecycleEnvHooks !== undefined) {
93
+ for (const __oe_lifecycleEnvHook of __oe_lifecycleEnvHooks) {
94
+ const __oe_lifecycleEnvCleanup = __oe_lifecycleEnvHook({ host: __oe_host.__oe_hostElement, signal: __oe_scope.signal, states: __oe_host.__oe_states });
95
+ if (typeof __oe_lifecycleEnvCleanup === "function")
96
+ __oe_scope.add(__oe_lifecycleEnvCleanup);
97
+ }
98
+ }
99
+ const __oe_setup = __oe_host.bindings ?? {};
100
+ const __oe_requireRootSetup = (name) => { if (!Object.hasOwn(__oe_setup, name))
101
+ throw new Error("OEIR_LEAF_MISSING_VALUE: " + name); return __oe_setup[name]; };
102
+ const hostOf = __oe_requireRootSetup("hostOf");
103
+ const __oe_adopted0 = [];
104
+ assertElementInHtmlNamespace(__oe_parent, "/", { file: "src/open-dropdown.tsx", line: 54, column: 1 });
105
+ let __oe_claimStart2 = __oe_parent.firstChild;
106
+ while (__oe_claimStart2 !== null && __oe_claimStart2.nodeType === 1 && __oe_claimStart2.nodeName === "LINK" && __oe_claimStart2.hasAttribute("data-oe-static-styles"))
107
+ __oe_claimStart2 = __oe_claimStart2.nextSibling;
108
+ const __oe_cursor1 = { node: __oe_claimStart2 };
109
+ const __oe_el3 = __oe_cursor1.node;
110
+ if (__oe_el3 == null)
111
+ throw leafClaimMismatch("missing node at /0", { file: "src/open-dropdown.tsx", line: 91, column: 5 });
112
+ __oe_cursor1.node = __oe_el3.nextSibling;
113
+ if (__oe_el3.nodeType !== 1 || String(__oe_el3.localName || __oe_el3.tagName || "").toLowerCase() !== "div")
114
+ throw leafClaimMismatch("expected element 'div' at /0", { file: "src/open-dropdown.tsx", line: 91, column: 5 });
115
+ assertElementInHtmlNamespace(__oe_el3, "/0", { file: "src/open-dropdown.tsx", line: 91, column: 5 });
116
+ assertStaticAttributeSeed(__oe_el3, [], "/0", [], { file: "src/open-dropdown.tsx", line: 91, column: 5 });
117
+ const __oe_cursor4 = { node: __oe_el3.firstChild };
118
+ const __oe_el5 = __oe_cursor4.node;
119
+ if (__oe_el5 == null)
120
+ throw leafClaimMismatch("missing node at /0/0", { file: "src/open-dropdown.tsx", line: 97, column: 7 });
121
+ __oe_cursor4.node = __oe_el5.nextSibling;
122
+ if (__oe_el5.nodeType !== 1 || String(__oe_el5.localName || __oe_el5.tagName || "").toLowerCase() !== "span")
123
+ throw leafClaimMismatch("expected element 'span' at /0/0", { file: "src/open-dropdown.tsx", line: 97, column: 7 });
124
+ assertElementInHtmlNamespace(__oe_el5, "/0/0", { file: "src/open-dropdown.tsx", line: 97, column: 7 });
125
+ assertStaticAttributeSeed(__oe_el5, [{ name: "class", value: "trigger contents" }, { name: "part", value: "trigger" }], "/0/0", [], { file: "src/open-dropdown.tsx", line: 97, column: 7 });
126
+ const __oe_cursor6 = { node: __oe_el5.firstChild };
127
+ const __oe_el7 = __oe_cursor6.node;
128
+ if (__oe_el7 == null)
129
+ throw leafClaimMismatch("missing node at /0/0/0", { file: "src/open-dropdown.tsx", line: 103, column: 9 });
130
+ __oe_cursor6.node = __oe_el7.nextSibling;
131
+ if (__oe_el7.nodeType !== 1 || String(__oe_el7.localName || __oe_el7.tagName || "").toLowerCase() !== "slot")
132
+ throw leafClaimMismatch("expected element 'slot' at /0/0/0", { file: "src/open-dropdown.tsx", line: 103, column: 9 });
133
+ assertElementInHtmlNamespace(__oe_el7, "/0/0/0", { file: "src/open-dropdown.tsx", line: 103, column: 9 });
134
+ assertStaticAttributeSeed(__oe_el7, [{ name: "name", value: "trigger" }], "/0/0/0", [], { file: "src/open-dropdown.tsx", line: 103, column: 9 });
135
+ const __oe_cursor8 = { node: __oe_el7.firstChild };
136
+ if (__oe_cursor8.node !== null)
137
+ throw leafClaimMismatch("extra node at /0/0/0", { file: "src/open-dropdown.tsx", line: 103, column: 9 });
138
+ if (__oe_cursor6.node !== null)
139
+ throw leafClaimMismatch("extra node at /0/0", { file: "src/open-dropdown.tsx", line: 97, column: 7 });
140
+ const __oe_el9 = __oe_cursor4.node;
141
+ if (__oe_el9 == null)
142
+ throw leafClaimMismatch("missing node at /0/1", { file: "src/open-dropdown.tsx", line: 105, column: 7 });
143
+ __oe_cursor4.node = __oe_el9.nextSibling;
144
+ if (__oe_el9.nodeType !== 1 || String(__oe_el9.localName || __oe_el9.tagName || "").toLowerCase() !== "div")
145
+ throw leafClaimMismatch("expected element 'div' at /0/1", { file: "src/open-dropdown.tsx", line: 105, column: 7 });
146
+ assertElementInHtmlNamespace(__oe_el9, "/0/1", { file: "src/open-dropdown.tsx", line: 105, column: 7 });
147
+ assertStaticAttributeSeed(__oe_el9, [{ name: "class", value: "overlay content min-w-48 p-2 font-sans" }, { name: "part", value: "content" }, { name: "popover", value: "auto" }], "/0/1", [], { file: "src/open-dropdown.tsx", line: 105, column: 7 });
148
+ const __oe_cursor10 = { node: __oe_el9.firstChild };
149
+ const __oe_el11 = __oe_cursor10.node;
150
+ if (__oe_el11 == null)
151
+ throw leafClaimMismatch("missing node at /0/1/0", { file: "src/open-dropdown.tsx", line: 106, column: 9 });
152
+ __oe_cursor10.node = __oe_el11.nextSibling;
153
+ if (__oe_el11.nodeType !== 1 || String(__oe_el11.localName || __oe_el11.tagName || "").toLowerCase() !== "slot")
154
+ throw leafClaimMismatch("expected element 'slot' at /0/1/0", { file: "src/open-dropdown.tsx", line: 106, column: 9 });
155
+ assertElementInHtmlNamespace(__oe_el11, "/0/1/0", { file: "src/open-dropdown.tsx", line: 106, column: 9 });
156
+ assertStaticAttributeSeed(__oe_el11, [], "/0/1/0", [], { file: "src/open-dropdown.tsx", line: 106, column: 9 });
157
+ const __oe_cursor12 = { node: __oe_el11.firstChild };
158
+ if (__oe_cursor12.node !== null)
159
+ throw leafClaimMismatch("extra node at /0/1/0", { file: "src/open-dropdown.tsx", line: 106, column: 9 });
160
+ if (__oe_cursor10.node !== null)
161
+ throw leafClaimMismatch("extra node at /0/1", { file: "src/open-dropdown.tsx", line: 105, column: 7 });
162
+ if (__oe_cursor4.node !== null)
163
+ throw leafClaimMismatch("extra node at /0", { file: "src/open-dropdown.tsx", line: 91, column: 5 });
164
+ __oe_adopted0.push(__oe_el3);
165
+ if (__oe_cursor1.node !== null)
166
+ throw leafClaimMismatch("extra node at /", { file: "src/open-dropdown.tsx", line: 54, column: 1 });
167
+ const __oe_eventHandler13 = ((event) => recordDropdownPointerDown(hostOf(event)));
168
+ if (typeof __oe_eventHandler13 !== "function")
169
+ throw leafRuntimeError("OEIR_LEAF_EVENT_HANDLER_INVALID", "onPointerDown handler is not callable", { file: "src/open-dropdown.tsx", line: 100, column: 9 });
170
+ const __oe_eventListener14 = (event) => __oe_eventHandler13(event);
171
+ __oe_el5.addEventListener("pointerdown", __oe_eventListener14);
172
+ __oe_scope.add(() => __oe_el5.removeEventListener("pointerdown", __oe_eventListener14));
173
+ const __oe_eventHandler15 = ((event) => toggleDropdown(hostOf(event)));
174
+ if (typeof __oe_eventHandler15 !== "function")
175
+ throw leafRuntimeError("OEIR_LEAF_EVENT_HANDLER_INVALID", "onClick handler is not callable", { file: "src/open-dropdown.tsx", line: 101, column: 9 });
176
+ const __oe_eventListener16 = (event) => __oe_eventHandler15(event);
177
+ __oe_el5.addEventListener("click", __oe_eventListener16);
178
+ __oe_scope.add(() => __oe_el5.removeEventListener("click", __oe_eventListener16));
179
+ return __oe_adopted0;
180
+ }
181
+ export function OpenDropdown__ssr() {
182
+ return "<div" + ">" + "<span" + " " + "class=\"" + escapeAttrValue("trigger contents") + "\"" + " " + "part=\"" + escapeAttrValue("trigger") + "\"" + ">" + "<slot" + " " + "name=\"" + escapeAttrValue("trigger") + "\"" + ">" + "" + "</slot>" + "</span>" + "<div" + " " + "class=\"" + escapeAttrValue("overlay content min-w-48 p-2 font-sans") + "\"" + " " + "part=\"" + escapeAttrValue("content") + "\"" + " " + "popover=\"" + escapeAttrValue("auto") + "\"" + ">" + "<slot" + ">" + "" + "</slot>" + "</div>" + "</div>";
183
+ }
184
+ import { createGeneratedElementClassWithFeatures as __oe_createElementClass, generatedElementProperties as __oe_propertiesFeature, serializeGeneratedElementHtml, seedGeneratedElementHostProperties } from "@openelement/element/internal/compiled/generated-element/shell";
185
+ const __oeElementDescriptor = {
186
+ tag: "open-dropdown",
187
+ root: "shadow-open",
188
+ properties: [
189
+ { name: "anchorName", attribute: null, type: "string", reflect: false, default: "" },
190
+ ],
191
+ createRecipe: createOpenDropdownRecipe,
192
+ createInstance: __oe_rootInstance,
193
+ };
194
+ const __oeOpenDropdownElement = __oe_createElementClass(__oeElementDescriptor, { properties: __oe_propertiesFeature });
195
+ export default __oeOpenDropdownElement;
196
+ export { __oeOpenDropdownElement as OpenDropdownElement };
197
+ export const __oeElementTag = "open-dropdown";
198
+ export function OpenDropdown__ssrHost(props, lightChildren, attributes, styleLinks, nestedHost) {
199
+ if (!Array.isArray(styleLinks) || styleLinks.length === 0)
200
+ 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)");
201
+ const __oeHostProps = seedGeneratedElementHostProperties(__oeElementDescriptor.properties, props, attributes);
202
+ const __oeHostAttrs = __oeHostProps.__oeHostAttributes;
203
+ return serializeGeneratedElementHtml({
204
+ tag: "open-dropdown",
205
+ root: "open",
206
+ content: OpenDropdown__ssr(__oeHostProps, nestedHost === undefined ? undefined : { "__oe_nestedHost": nestedHost }),
207
+ ...(lightChildren === undefined ? {} : { lightChildren }),
208
+ ...(attributes === undefined && __oeHostAttrs === undefined ? {} : { attributes: __oeHostAttrs === undefined ? attributes : __oeHostAttrs }),
209
+ ...(styleLinks === undefined ? {} : { styleLinks }),
210
+ });
211
+ }