@openelement/ui 1.0.0-alpha.1 → 1.0.0-alpha.11

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 (47) hide show
  1. package/CUSTOMIZATION.md +272 -0
  2. package/README.md +59 -54
  3. package/package.json +19 -33
  4. package/src/component-recipes.js +39 -100
  5. package/src/control-recipe.css +21 -0
  6. package/src/generated-manifest.json +13 -160
  7. package/src/index.d.ts +10 -42
  8. package/src/index.js +10 -46
  9. package/src/instance-state.d.ts +16 -0
  10. package/src/instance-state.js +30 -24
  11. package/src/manifest.d.ts +5 -9
  12. package/src/manifest.js +6 -11
  13. package/src/open-button.css +120 -0
  14. package/src/open-button.d.ts +296 -898
  15. package/src/open-button.js +1130 -1436
  16. package/src/open-code-block.css +46 -0
  17. package/src/open-code-block.d.ts +158 -168
  18. package/src/open-code-block.js +224 -468
  19. package/src/open-dialog.css +137 -0
  20. package/src/open-dialog.d.ts +241 -424
  21. package/src/open-dialog.js +626 -903
  22. package/src/open-dropdown.css +28 -0
  23. package/src/open-dropdown.d.ts +195 -252
  24. package/src/open-dropdown.js +352 -494
  25. package/src/open-input.css +80 -0
  26. package/src/open-input.d.ts +404 -1420
  27. package/src/open-input.js +1789 -2170
  28. package/src/open-theme-toggle.css +53 -0
  29. package/src/open-theme-toggle.d.ts +171 -287
  30. package/src/open-theme-toggle.js +512 -801
  31. package/src/overlay-recipe.css +9 -0
  32. package/src/register.d.ts +4 -1
  33. package/src/register.js +19 -58
  34. package/src/surface-recipe.css +10 -0
  35. package/src/theme.css +206 -0
  36. package/THIRD_PARTY_NOTICES.md +0 -45
  37. package/src/open-badge.d.ts +0 -185
  38. package/src/open-badge.js +0 -296
  39. package/src/open-callout.d.ts +0 -402
  40. package/src/open-callout.js +0 -603
  41. package/src/open-card.d.ts +0 -168
  42. package/src/open-card.js +0 -310
  43. package/src/open-props-tokens.d.ts +0 -9
  44. package/src/open-props-tokens.js +0 -459
  45. package/src/open-tabs.d.ts +0 -218
  46. package/src/open-tabs.js +0 -401
  47. package/src/semantic-tokens.css +0 -413
@@ -1,909 +1,632 @@
1
- // <auto-generated by open:compiled-element; v0.44.0-alpha.1 - do not edit>
2
- import { effect, OpenElement } from '@openelement/element';
3
- import { overlayRecipe, recipe } from './component-recipes.js';
4
- import { readInstanceState, writeInstanceState } from './instance-state.js';
1
+ import { readInstanceState, writeInstanceState } from "./instance-state.js";
2
+ import { OpenElement, effect } from "@openelement/element";
3
+ import overlayRecipe from "./overlay-recipe.css";
4
+ import openDialogStyles from "./open-dialog.css";
5
+ //#region src/open-dialog.tsx
5
6
  const __partProgram = {
6
- "version": 1,
7
- "tag": "open-dialog",
8
- "root": {
9
- "id": "root",
10
- "kind": "shadow-open",
11
- "nodes": [
12
- "e0"
13
- ]
14
- },
15
- "template": [
16
- {
17
- "k": "el",
18
- "id": "e0",
19
- "tag": "div",
20
- "attrs": [
21
- [
22
- "style",
23
- "display:contents"
24
- ]
25
- ],
26
- "children": [
27
- {
28
- "k": "el",
29
- "id": "e1",
30
- "tag": "slot",
31
- "attrs": [
32
- [
33
- "name",
34
- "trigger"
35
- ]
36
- ],
37
- "children": []
38
- },
39
- {
40
- "k": "el",
41
- "id": "e2",
42
- "tag": "dialog",
43
- "attrs": [
44
- [
45
- "part",
46
- "overlay"
47
- ]
48
- ],
49
- "children": [
50
- {
51
- "k": "el",
52
- "id": "e3",
53
- "tag": "div",
54
- "attrs": [
55
- [
56
- "class",
57
- "dialog-header"
58
- ],
59
- [
60
- "part",
61
- "header"
62
- ]
63
- ],
64
- "children": [
65
- {
66
- "k": "el",
67
- "id": "e4",
68
- "tag": "h2",
69
- "attrs": [
70
- [
71
- "class",
72
- "dialog-title"
73
- ]
74
- ],
75
- "children": [
76
- {
77
- "k": "part",
78
- "id": "p5",
79
- "index": 5
80
- }
81
- ]
82
- },
83
- {
84
- "k": "el",
85
- "id": "e5",
86
- "tag": "button",
87
- "attrs": [
88
- [
89
- "type",
90
- "button"
91
- ],
92
- [
93
- "class",
94
- "dialog-close"
95
- ],
96
- [
97
- "part",
98
- "close"
99
- ],
100
- [
101
- "aria-label",
102
- "Close"
103
- ]
104
- ],
105
- "children": [
106
- {
107
- "k": "text",
108
- "value": "× "
109
- }
110
- ]
111
- }
112
- ]
113
- },
114
- {
115
- "k": "el",
116
- "id": "e6",
117
- "tag": "div",
118
- "attrs": [
119
- [
120
- "class",
121
- "dialog-body"
122
- ],
123
- [
124
- "part",
125
- "body"
126
- ]
127
- ],
128
- "children": [
129
- {
130
- "k": "el",
131
- "id": "e7",
132
- "tag": "slot",
133
- "attrs": [],
134
- "children": []
135
- }
136
- ]
137
- },
138
- {
139
- "k": "el",
140
- "id": "e8",
141
- "tag": "div",
142
- "attrs": [
143
- [
144
- "class",
145
- "dialog-footer"
146
- ],
147
- [
148
- "part",
149
- "footer"
150
- ]
151
- ],
152
- "children": [
153
- {
154
- "k": "el",
155
- "id": "e9",
156
- "tag": "slot",
157
- "attrs": [
158
- [
159
- "name",
160
- "footer"
161
- ]
162
- ],
163
- "children": []
164
- }
165
- ]
166
- }
167
- ]
168
- }
169
- ]
170
- }
171
- ],
172
- "parts": [
173
- {
174
- "k": "event",
175
- "event": "click",
176
- "handler": "handleTrigger",
177
- "action": {
178
- "kind": "method",
179
- "name": "handleTrigger"
180
- },
181
- "path": [
182
- 0,
183
- 0
184
- ],
185
- "index": 0,
186
- "location": {
187
- "id": "p0",
188
- "kind": "sink",
189
- "path": [
190
- 0,
191
- 0
192
- ],
193
- "node": "e1"
194
- }
195
- },
196
- {
197
- "k": "bool",
198
- "signal": "open",
199
- "name": "open",
200
- "path": [
201
- 0,
202
- 1
203
- ],
204
- "index": 1,
205
- "location": {
206
- "id": "p1",
207
- "kind": "sink",
208
- "path": [
209
- 0,
210
- 1
211
- ],
212
- "node": "e2"
213
- }
214
- },
215
- {
216
- "k": "attr",
217
- "signal": "label",
218
- "name": "aria-label",
219
- "path": [
220
- 0,
221
- 1
222
- ],
223
- "index": 2,
224
- "location": {
225
- "id": "p2",
226
- "kind": "sink",
227
- "path": [
228
- 0,
229
- 1
230
- ],
231
- "node": "e2"
232
- }
233
- },
234
- {
235
- "k": "event",
236
- "event": "cancel",
237
- "handler": "handleCancel",
238
- "action": {
239
- "kind": "method",
240
- "name": "handleCancel"
241
- },
242
- "path": [
243
- 0,
244
- 1
245
- ],
246
- "index": 3,
247
- "location": {
248
- "id": "p3",
249
- "kind": "sink",
250
- "path": [
251
- 0,
252
- 1
253
- ],
254
- "node": "e2"
255
- }
256
- },
257
- {
258
- "k": "event",
259
- "event": "close",
260
- "handler": "handleNativeClose",
261
- "action": {
262
- "kind": "method",
263
- "name": "handleNativeClose"
264
- },
265
- "path": [
266
- 0,
267
- 1
268
- ],
269
- "index": 4,
270
- "location": {
271
- "id": "p4",
272
- "kind": "sink",
273
- "path": [
274
- 0,
275
- 1
276
- ],
277
- "node": "e2"
278
- }
279
- },
280
- {
281
- "k": "text",
282
- "signal": "label",
283
- "index": 5,
284
- "location": {
285
- "id": "p5",
286
- "kind": "anchor",
287
- "path": [
288
- 0,
289
- 1,
290
- 0,
291
- 0,
292
- 0
293
- ]
294
- }
295
- },
296
- {
297
- "k": "event",
298
- "event": "click",
299
- "handler": "handleClose",
300
- "action": {
301
- "kind": "method",
302
- "name": "handleClose"
303
- },
304
- "path": [
305
- 0,
306
- 1,
307
- 0,
308
- 1
309
- ],
310
- "index": 6,
311
- "location": {
312
- "id": "p6",
313
- "kind": "sink",
314
- "path": [
315
- 0,
316
- 1,
317
- 0,
318
- 1
319
- ],
320
- "node": "e5"
321
- }
322
- }
323
- ],
324
- "regions": [],
325
- "dependencies": [
326
- {
327
- "signal": "open",
328
- "owner": {
329
- "kind": "part",
330
- "index": 1
331
- },
332
- "location": "p1"
333
- },
334
- {
335
- "signal": "label",
336
- "owner": {
337
- "kind": "part",
338
- "index": 2
339
- },
340
- "location": "p2"
341
- },
342
- {
343
- "signal": "label",
344
- "owner": {
345
- "kind": "part",
346
- "index": 5
347
- },
348
- "location": "p5"
349
- }
350
- ],
351
- "locations": [
352
- {
353
- "id": "e0",
354
- "kind": "element",
355
- "tag": "div",
356
- "path": [
357
- 0
358
- ]
359
- },
360
- {
361
- "id": "e1",
362
- "kind": "element",
363
- "tag": "slot",
364
- "path": [
365
- 0,
366
- 0
367
- ]
368
- },
369
- {
370
- "id": "p0",
371
- "kind": "sink",
372
- "part": 0,
373
- "node": "e1",
374
- "path": [
375
- 0,
376
- 0
377
- ]
378
- },
379
- {
380
- "id": "e2",
381
- "kind": "element",
382
- "tag": "dialog",
383
- "path": [
384
- 0,
385
- 1
386
- ]
387
- },
388
- {
389
- "id": "p1",
390
- "kind": "sink",
391
- "part": 1,
392
- "node": "e2",
393
- "path": [
394
- 0,
395
- 1
396
- ]
397
- },
398
- {
399
- "id": "p2",
400
- "kind": "sink",
401
- "part": 2,
402
- "node": "e2",
403
- "path": [
404
- 0,
405
- 1
406
- ]
407
- },
408
- {
409
- "id": "p3",
410
- "kind": "sink",
411
- "part": 3,
412
- "node": "e2",
413
- "path": [
414
- 0,
415
- 1
416
- ]
417
- },
418
- {
419
- "id": "p4",
420
- "kind": "sink",
421
- "part": 4,
422
- "node": "e2",
423
- "path": [
424
- 0,
425
- 1
426
- ]
427
- },
428
- {
429
- "id": "e3",
430
- "kind": "element",
431
- "tag": "div",
432
- "path": [
433
- 0,
434
- 1,
435
- 0
436
- ]
437
- },
438
- {
439
- "id": "e4",
440
- "kind": "element",
441
- "tag": "h2",
442
- "path": [
443
- 0,
444
- 1,
445
- 0,
446
- 0
447
- ]
448
- },
449
- {
450
- "id": "p5",
451
- "kind": "anchor",
452
- "part": 5,
453
- "path": [
454
- 0,
455
- 1,
456
- 0,
457
- 0,
458
- 0
459
- ]
460
- },
461
- {
462
- "id": "e5",
463
- "kind": "element",
464
- "tag": "button",
465
- "path": [
466
- 0,
467
- 1,
468
- 0,
469
- 1
470
- ]
471
- },
472
- {
473
- "id": "p6",
474
- "kind": "sink",
475
- "part": 6,
476
- "node": "e5",
477
- "path": [
478
- 0,
479
- 1,
480
- 0,
481
- 1
482
- ]
483
- },
484
- {
485
- "id": "e6",
486
- "kind": "element",
487
- "tag": "div",
488
- "path": [
489
- 0,
490
- 1,
491
- 1
492
- ]
493
- },
494
- {
495
- "id": "e7",
496
- "kind": "element",
497
- "tag": "slot",
498
- "path": [
499
- 0,
500
- 1,
501
- 1,
502
- 0
503
- ]
504
- },
505
- {
506
- "id": "e8",
507
- "kind": "element",
508
- "tag": "div",
509
- "path": [
510
- 0,
511
- 1,
512
- 2
513
- ]
514
- },
515
- {
516
- "id": "e9",
517
- "kind": "element",
518
- "tag": "slot",
519
- "path": [
520
- 0,
521
- 1,
522
- 2,
523
- 0
524
- ]
525
- }
526
- ],
527
- "metadata": {
528
- "tag": "open-dialog",
529
- "className": "OpenDialog",
530
- "sourceFile": "open-dialog.tsx",
531
- "properties": [
532
- {
533
- "name": "open",
534
- "attribute": "open",
535
- "type": "boolean",
536
- "converter": "boolean",
537
- "reflect": true,
538
- "default": false
539
- },
540
- {
541
- "name": "label",
542
- "attribute": "label",
543
- "type": "string",
544
- "converter": "string",
545
- "reflect": false,
546
- "default": ""
547
- }
548
- ],
549
- "observedAttributes": [
550
- "open",
551
- "label"
552
- ],
553
- "cem": {
554
- "tagName": "open-dialog",
555
- "className": "OpenDialog",
556
- "declaration": {
557
- "name": "OpenDialog",
558
- "module": "open-dialog.tsx"
559
- },
560
- "attributes": [
561
- {
562
- "name": "open",
563
- "fieldName": "open",
564
- "type": "boolean",
565
- "reflect": true
566
- },
567
- {
568
- "name": "label",
569
- "fieldName": "label",
570
- "type": "string",
571
- "reflect": false
572
- }
573
- ],
574
- "members": [
575
- {
576
- "name": "open",
577
- "fieldName": "open",
578
- "type": "boolean",
579
- "attribute": "open",
580
- "reflect": true
581
- },
582
- {
583
- "name": "label",
584
- "fieldName": "label",
585
- "type": "string",
586
- "attribute": "label",
587
- "reflect": false
588
- }
589
- ]
590
- }
591
- }
7
+ "version": 1,
8
+ "tag": "open-dialog",
9
+ "root": {
10
+ "id": "root",
11
+ "kind": "shadow-open",
12
+ "nodes": ["e0"]
13
+ },
14
+ "template": [{
15
+ "k": "el",
16
+ "id": "e0",
17
+ "tag": "div",
18
+ "attrs": [["style", "display:contents"]],
19
+ "children": [{
20
+ "k": "el",
21
+ "id": "e1",
22
+ "tag": "slot",
23
+ "attrs": [["name", "trigger"]],
24
+ "children": []
25
+ }, {
26
+ "k": "el",
27
+ "id": "e2",
28
+ "tag": "dialog",
29
+ "attrs": [["part", "overlay"]],
30
+ "children": [
31
+ {
32
+ "k": "el",
33
+ "id": "e3",
34
+ "tag": "div",
35
+ "attrs": [["class", "dialog-header"], ["part", "header"]],
36
+ "children": [{
37
+ "k": "el",
38
+ "id": "e4",
39
+ "tag": "h2",
40
+ "attrs": [["class", "dialog-title"]],
41
+ "children": [{
42
+ "k": "part",
43
+ "id": "p5",
44
+ "index": 5
45
+ }]
46
+ }, {
47
+ "k": "el",
48
+ "id": "e5",
49
+ "tag": "button",
50
+ "attrs": [
51
+ ["type", "button"],
52
+ ["class", "dialog-close"],
53
+ ["part", "close"],
54
+ ["aria-label", "Close"]
55
+ ],
56
+ "children": [{
57
+ "k": "text",
58
+ "value": "×"
59
+ }]
60
+ }]
61
+ },
62
+ {
63
+ "k": "el",
64
+ "id": "e6",
65
+ "tag": "div",
66
+ "attrs": [["class", "dialog-body"], ["part", "body"]],
67
+ "children": [{
68
+ "k": "el",
69
+ "id": "e7",
70
+ "tag": "slot",
71
+ "attrs": [],
72
+ "children": []
73
+ }]
74
+ },
75
+ {
76
+ "k": "el",
77
+ "id": "e8",
78
+ "tag": "div",
79
+ "attrs": [["class", "dialog-footer"], ["part", "footer"]],
80
+ "children": [{
81
+ "k": "el",
82
+ "id": "e9",
83
+ "tag": "slot",
84
+ "attrs": [["name", "footer"]],
85
+ "children": []
86
+ }]
87
+ }
88
+ ]
89
+ }]
90
+ }],
91
+ "parts": [
92
+ {
93
+ "k": "event",
94
+ "event": "click",
95
+ "handler": "handleTrigger",
96
+ "action": {
97
+ "kind": "method",
98
+ "name": "handleTrigger"
99
+ },
100
+ "path": [0, 0],
101
+ "index": 0,
102
+ "location": {
103
+ "id": "p0",
104
+ "kind": "sink",
105
+ "path": [0, 0],
106
+ "node": "e1"
107
+ }
108
+ },
109
+ {
110
+ "k": "bool",
111
+ "signal": "open",
112
+ "name": "open",
113
+ "path": [0, 1],
114
+ "index": 1,
115
+ "location": {
116
+ "id": "p1",
117
+ "kind": "sink",
118
+ "path": [0, 1],
119
+ "node": "e2"
120
+ }
121
+ },
122
+ {
123
+ "k": "attr",
124
+ "signal": "label",
125
+ "name": "aria-label",
126
+ "path": [0, 1],
127
+ "index": 2,
128
+ "location": {
129
+ "id": "p2",
130
+ "kind": "sink",
131
+ "path": [0, 1],
132
+ "node": "e2"
133
+ }
134
+ },
135
+ {
136
+ "k": "event",
137
+ "event": "cancel",
138
+ "handler": "handleCancel",
139
+ "action": {
140
+ "kind": "method",
141
+ "name": "handleCancel"
142
+ },
143
+ "path": [0, 1],
144
+ "index": 3,
145
+ "location": {
146
+ "id": "p3",
147
+ "kind": "sink",
148
+ "path": [0, 1],
149
+ "node": "e2"
150
+ }
151
+ },
152
+ {
153
+ "k": "event",
154
+ "event": "close",
155
+ "handler": "handleNativeClose",
156
+ "action": {
157
+ "kind": "method",
158
+ "name": "handleNativeClose"
159
+ },
160
+ "path": [0, 1],
161
+ "index": 4,
162
+ "location": {
163
+ "id": "p4",
164
+ "kind": "sink",
165
+ "path": [0, 1],
166
+ "node": "e2"
167
+ }
168
+ },
169
+ {
170
+ "k": "text",
171
+ "signal": "label",
172
+ "index": 5,
173
+ "location": {
174
+ "id": "p5",
175
+ "kind": "anchor",
176
+ "path": [
177
+ 0,
178
+ 1,
179
+ 0,
180
+ 0,
181
+ 0
182
+ ]
183
+ }
184
+ },
185
+ {
186
+ "k": "event",
187
+ "event": "click",
188
+ "handler": "handleClose",
189
+ "action": {
190
+ "kind": "method",
191
+ "name": "handleClose"
192
+ },
193
+ "path": [
194
+ 0,
195
+ 1,
196
+ 0,
197
+ 1
198
+ ],
199
+ "index": 6,
200
+ "location": {
201
+ "id": "p6",
202
+ "kind": "sink",
203
+ "path": [
204
+ 0,
205
+ 1,
206
+ 0,
207
+ 1
208
+ ],
209
+ "node": "e5"
210
+ }
211
+ }
212
+ ],
213
+ "regions": [],
214
+ "dependencies": [
215
+ {
216
+ "signal": "open",
217
+ "owner": {
218
+ "kind": "part",
219
+ "index": 1
220
+ },
221
+ "location": "p1"
222
+ },
223
+ {
224
+ "signal": "label",
225
+ "owner": {
226
+ "kind": "part",
227
+ "index": 2
228
+ },
229
+ "location": "p2"
230
+ },
231
+ {
232
+ "signal": "label",
233
+ "owner": {
234
+ "kind": "part",
235
+ "index": 5
236
+ },
237
+ "location": "p5"
238
+ }
239
+ ],
240
+ "locations": [
241
+ {
242
+ "id": "e0",
243
+ "kind": "element",
244
+ "tag": "div",
245
+ "path": [0]
246
+ },
247
+ {
248
+ "id": "e1",
249
+ "kind": "element",
250
+ "tag": "slot",
251
+ "path": [0, 0]
252
+ },
253
+ {
254
+ "id": "p0",
255
+ "kind": "sink",
256
+ "part": 0,
257
+ "node": "e1",
258
+ "path": [0, 0]
259
+ },
260
+ {
261
+ "id": "e2",
262
+ "kind": "element",
263
+ "tag": "dialog",
264
+ "path": [0, 1]
265
+ },
266
+ {
267
+ "id": "p1",
268
+ "kind": "sink",
269
+ "part": 1,
270
+ "node": "e2",
271
+ "path": [0, 1]
272
+ },
273
+ {
274
+ "id": "p2",
275
+ "kind": "sink",
276
+ "part": 2,
277
+ "node": "e2",
278
+ "path": [0, 1]
279
+ },
280
+ {
281
+ "id": "p3",
282
+ "kind": "sink",
283
+ "part": 3,
284
+ "node": "e2",
285
+ "path": [0, 1]
286
+ },
287
+ {
288
+ "id": "p4",
289
+ "kind": "sink",
290
+ "part": 4,
291
+ "node": "e2",
292
+ "path": [0, 1]
293
+ },
294
+ {
295
+ "id": "e3",
296
+ "kind": "element",
297
+ "tag": "div",
298
+ "path": [
299
+ 0,
300
+ 1,
301
+ 0
302
+ ]
303
+ },
304
+ {
305
+ "id": "e4",
306
+ "kind": "element",
307
+ "tag": "h2",
308
+ "path": [
309
+ 0,
310
+ 1,
311
+ 0,
312
+ 0
313
+ ]
314
+ },
315
+ {
316
+ "id": "p5",
317
+ "kind": "anchor",
318
+ "part": 5,
319
+ "path": [
320
+ 0,
321
+ 1,
322
+ 0,
323
+ 0,
324
+ 0
325
+ ]
326
+ },
327
+ {
328
+ "id": "e5",
329
+ "kind": "element",
330
+ "tag": "button",
331
+ "path": [
332
+ 0,
333
+ 1,
334
+ 0,
335
+ 1
336
+ ]
337
+ },
338
+ {
339
+ "id": "p6",
340
+ "kind": "sink",
341
+ "part": 6,
342
+ "node": "e5",
343
+ "path": [
344
+ 0,
345
+ 1,
346
+ 0,
347
+ 1
348
+ ]
349
+ },
350
+ {
351
+ "id": "e6",
352
+ "kind": "element",
353
+ "tag": "div",
354
+ "path": [
355
+ 0,
356
+ 1,
357
+ 1
358
+ ]
359
+ },
360
+ {
361
+ "id": "e7",
362
+ "kind": "element",
363
+ "tag": "slot",
364
+ "path": [
365
+ 0,
366
+ 1,
367
+ 1,
368
+ 0
369
+ ]
370
+ },
371
+ {
372
+ "id": "e8",
373
+ "kind": "element",
374
+ "tag": "div",
375
+ "path": [
376
+ 0,
377
+ 1,
378
+ 2
379
+ ]
380
+ },
381
+ {
382
+ "id": "e9",
383
+ "kind": "element",
384
+ "tag": "slot",
385
+ "path": [
386
+ 0,
387
+ 1,
388
+ 2,
389
+ 0
390
+ ]
391
+ }
392
+ ],
393
+ "metadata": {
394
+ "tag": "open-dialog",
395
+ "className": "OpenDialog",
396
+ "sourceFile": "open-dialog.tsx",
397
+ "properties": [{
398
+ "name": "open",
399
+ "attribute": "open",
400
+ "type": "boolean",
401
+ "converter": "boolean",
402
+ "reflect": true,
403
+ "default": false
404
+ }, {
405
+ "name": "label",
406
+ "attribute": "label",
407
+ "type": "string",
408
+ "converter": "string",
409
+ "reflect": false,
410
+ "default": ""
411
+ }],
412
+ "observedAttributes": ["open", "label"],
413
+ "cem": {
414
+ "tagName": "open-dialog",
415
+ "className": "OpenDialog",
416
+ "declaration": {
417
+ "name": "OpenDialog",
418
+ "module": "open-dialog.tsx"
419
+ },
420
+ "attributes": [{
421
+ "name": "open",
422
+ "fieldName": "open",
423
+ "type": "boolean",
424
+ "reflect": true
425
+ }, {
426
+ "name": "label",
427
+ "fieldName": "label",
428
+ "type": "string",
429
+ "reflect": false
430
+ }],
431
+ "members": [{
432
+ "name": "open",
433
+ "fieldName": "open",
434
+ "type": "boolean",
435
+ "attribute": "open",
436
+ "reflect": true
437
+ }, {
438
+ "name": "label",
439
+ "fieldName": "label",
440
+ "type": "string",
441
+ "attribute": "label",
442
+ "reflect": false
443
+ }]
444
+ }
445
+ }
592
446
  };
593
- const __compiledProperties = [
594
- {
595
- "name": "open",
596
- "attribute": "open",
597
- "type": "boolean",
598
- "converter": "boolean",
599
- "reflect": true,
600
- "default": false
601
- },
602
- {
603
- "name": "label",
604
- "attribute": "label",
605
- "type": "string",
606
- "converter": "string",
607
- "reflect": false,
608
- "default": ""
609
- }
610
- ];
447
+ const __compiledProperties = [{
448
+ "name": "open",
449
+ "attribute": "open",
450
+ "type": "boolean",
451
+ "converter": "boolean",
452
+ "reflect": true,
453
+ "default": false
454
+ }, {
455
+ "name": "label",
456
+ "attribute": "label",
457
+ "type": "string",
458
+ "converter": "string",
459
+ "reflect": false,
460
+ "default": ""
461
+ }];
611
462
  const __elementMetadata = {
612
- "tag": "open-dialog",
613
- "className": "OpenDialog",
614
- "sourceFile": "open-dialog.tsx",
615
- "properties": [
616
- {
617
- "name": "open",
618
- "attribute": "open",
619
- "type": "boolean",
620
- "converter": "boolean",
621
- "reflect": true,
622
- "default": false
623
- },
624
- {
625
- "name": "label",
626
- "attribute": "label",
627
- "type": "string",
628
- "converter": "string",
629
- "reflect": false,
630
- "default": ""
631
- }
632
- ],
633
- "observedAttributes": [
634
- "open",
635
- "label"
636
- ],
637
- "cem": {
638
- "tagName": "open-dialog",
639
- "className": "OpenDialog",
640
- "declaration": {
641
- "name": "OpenDialog",
642
- "module": "open-dialog.tsx"
643
- },
644
- "attributes": [
645
- {
646
- "name": "open",
647
- "fieldName": "open",
648
- "type": "boolean",
649
- "reflect": true
650
- },
651
- {
652
- "name": "label",
653
- "fieldName": "label",
654
- "type": "string",
655
- "reflect": false
656
- }
657
- ],
658
- "members": [
659
- {
660
- "name": "open",
661
- "fieldName": "open",
662
- "type": "boolean",
663
- "attribute": "open",
664
- "reflect": true
665
- },
666
- {
667
- "name": "label",
668
- "fieldName": "label",
669
- "type": "string",
670
- "attribute": "label",
671
- "reflect": false
672
- }
673
- ]
674
- }
463
+ "tag": "open-dialog",
464
+ "className": "OpenDialog",
465
+ "sourceFile": "open-dialog.tsx",
466
+ "properties": [{
467
+ "name": "open",
468
+ "attribute": "open",
469
+ "type": "boolean",
470
+ "converter": "boolean",
471
+ "reflect": true,
472
+ "default": false
473
+ }, {
474
+ "name": "label",
475
+ "attribute": "label",
476
+ "type": "string",
477
+ "converter": "string",
478
+ "reflect": false,
479
+ "default": ""
480
+ }],
481
+ "observedAttributes": ["open", "label"],
482
+ "cem": {
483
+ "tagName": "open-dialog",
484
+ "className": "OpenDialog",
485
+ "declaration": {
486
+ "name": "OpenDialog",
487
+ "module": "open-dialog.tsx"
488
+ },
489
+ "attributes": [{
490
+ "name": "open",
491
+ "fieldName": "open",
492
+ "type": "boolean",
493
+ "reflect": true
494
+ }, {
495
+ "name": "label",
496
+ "fieldName": "label",
497
+ "type": "string",
498
+ "reflect": false
499
+ }],
500
+ "members": [{
501
+ "name": "open",
502
+ "fieldName": "open",
503
+ "type": "boolean",
504
+ "attribute": "open",
505
+ "reflect": true
506
+ }, {
507
+ "name": "label",
508
+ "fieldName": "label",
509
+ "type": "string",
510
+ "attribute": "label",
511
+ "reflect": false
512
+ }]
513
+ }
675
514
  };
676
- const __observedAttributes = [
677
- "open",
678
- "label"
679
- ];
515
+ const __observedAttributes = ["open", "label"];
680
516
  const __compiledProps = {
681
- open: {
682
- type: Boolean,
683
- default: false,
684
- reflect: true,
685
- attribute: "open"
686
- },
687
- label: {
688
- type: String,
689
- default: '',
690
- reflect: false,
691
- attribute: "label"
692
- }
517
+ open: {
518
+ type: Boolean,
519
+ default: false,
520
+ reflect: true,
521
+ attribute: "open"
522
+ },
523
+ label: {
524
+ type: String,
525
+ default: "",
526
+ reflect: false,
527
+ attribute: "label"
528
+ }
693
529
  };
694
- export class OpenDialog extends OpenElement {
695
- static __partProgram = __partProgram;
696
- static __compiledProperties = __compiledProperties;
697
- static __elementMetadata = __elementMetadata;
698
- static props = __compiledProps;
699
- static observedAttributes = __observedAttributes;
700
- static delegatesFocus = true;
701
- static styles = [
702
- overlayRecipe,
703
- recipe(`
704
- :host {
705
- display: inline-block;
706
- }
707
-
708
- ::slotted([slot='trigger']) {
709
- cursor: pointer;
710
- }
711
-
712
- dialog {
713
- border: var(--border-size-1) solid var(--surface-border-strong);
714
- border-radius: var(--overlay-radius);
715
- background: var(--surface-overlay);
716
- color: var(--text-primary);
717
- padding: var(--size-6);
718
- max-width: min(90vw, 480px);
719
- box-shadow: var(--surface-highlight), var(--overlay-shadow);
720
- font-family: var(--font-sans);
721
- }
722
-
723
- dialog::backdrop {
724
- background: color-mix(in srgb, var(--gray-12) 68%, transparent);
725
- backdrop-filter: blur(8px);
726
- }
727
-
728
- dialog[open] {
729
- animation: dialogFadeIn 0.2s ease-out;
730
- }
731
-
732
- @keyframes dialogFadeIn {
733
- from { opacity: 0; transform: translateY(-8px); }
734
- to { opacity: 1; transform: translateY(0); }
735
- }
736
-
737
- .dialog-header {
738
- display: flex;
739
- justify-content: space-between;
740
- align-items: center;
741
- margin-bottom: var(--size-4);
742
- }
743
-
744
- .dialog-title {
745
- font-size: var(--font-size-2);
746
- font-weight: var(--font-weight-6);
747
- color: var(--text-primary);
748
- margin: 0;
749
- }
750
-
751
- .dialog-close {
752
- background: none;
753
- border: none;
754
- cursor: pointer;
755
- color: var(--text-muted);
756
- font-size: var(--font-size-2);
757
- line-height: var(--font-lineheight-1);
758
- padding: var(--size-1);
759
- border-radius: var(--radius-1);
760
- transition: color 0.15s ease;
761
- }
762
-
763
- .dialog-close:hover {
764
- color: var(--text-primary);
765
- background: var(--brand-subtle);
766
- }
767
-
768
- .dialog-body {
769
- font-size: var(--font-size-1);
770
- color: var(--text-secondary);
771
- line-height: var(--font-lineheight-3);
772
- }
773
-
774
- .dialog-footer {
775
- margin-top: var(--size-5);
776
- display: flex;
777
- justify-content: flex-end;
778
- gap: var(--size-2);
779
- }
780
-
781
- :host(:state(open)) dialog {
782
- display: block;
783
- }
784
- `)
785
- ];
786
- open = false;
787
- label = '';
788
- onCsrRendered() {
789
- this.syncOpenState();
790
- }
791
- onDsdHydrated() {
792
- this.syncOpenState();
793
- }
794
- disconnectedCallback() {
795
- readInstanceState(this, 'openEffect', ()=>undefined)?.();
796
- writeInstanceState(this, 'openEffect', undefined);
797
- super.disconnectedCallback();
798
- }
799
- syncOpenState() {
800
- this.updateStates();
801
- this.syncDialogElement();
802
- const off = effect(()=>{
803
- // Reading the property tracks the signal; the bodies stay idempotent.
804
- void this.open;
805
- this.updateStates();
806
- this.syncDialogElement();
807
- });
808
- writeInstanceState(this, 'openEffect', off);
809
- }
810
- updateStates() {
811
- const states = this.stateSet();
812
- if (!states) return;
813
- if (this.open) {
814
- states.add('open');
815
- states.delete('closed');
816
- } else {
817
- states.delete('open');
818
- states.add('closed');
819
- }
820
- }
821
- stateSet() {
822
- if (this._internals?.states) return this._internals.states;
823
- let internals = readInstanceState(this, 'internals', ()=>undefined);
824
- if (!internals) {
825
- if (typeof this.attachInternals !== 'function') return undefined;
826
- internals = this.attachInternals();
827
- writeInstanceState(this, 'internals', internals);
828
- }
829
- return internals.states;
830
- }
831
- show() {
832
- this.open = true;
833
- }
834
- close() {
835
- this.open = false;
836
- }
837
- toggle() {
838
- this.open = !this.open;
839
- }
840
- syncDialogElement() {
841
- const dialog = this.shadowRoot?.querySelector('dialog');
842
- if (!dialog) return;
843
- // True once showModal() has run for the current open session (#1030).
844
- const modalActive = readInstanceState(this, 'modalActive', ()=>false);
845
- if (this.open) {
846
- if ((this.getAttribute('mode') || 'modal') === 'modal') {
847
- // Modal: showModal() puts the rest of the page on the inert top layer
848
- // natively — focus, hit-testing, and the accessibility tree are all
849
- // covered by the platform, so no hand-rolled sibling inert is needed.
850
- if (modalActive) return;
851
- // #1030: the compiled bool sink writes `open` onto the inner <dialog>
852
- // (SSR DSD / CSR first render), so dialog.open may already be true
853
- // without showModal() having run — that state presents as NON-modal
854
- // (no top layer, no ::backdrop, no focus containment). Close the
855
- // attribute-driven open first, then enter the top layer; showModal()
856
- // on an already-open dialog throws InvalidStateError.
857
- if (dialog.open) dialog.close();
858
- dialog.showModal();
859
- writeInstanceState(this, 'modalActive', true);
860
- } else if (!dialog.open) {
861
- // Non-modal: show() leaves the page interactive by design.
862
- dialog.show();
863
- }
864
- } else {
865
- // A modal session only exits the top layer while the inner `open`
866
- // attribute is still present. The compiled bool sink subscribes to the
867
- // same signal and may have already removed it — removing the attribute
868
- // leaves the dialog :modal and close() is then a spec no-op, so the
869
- // attribute must be restored before close() (#1226).
870
- if (modalActive && !dialog.open) dialog.setAttribute('open', '');
871
- if (dialog.open) dialog.close();
872
- writeInstanceState(this, 'modalActive', false);
873
- }
874
- }
875
- handleNativeClose() {
876
- // The attribute→modal transition above close()es the attribute-opened
877
- // dialog and immediately re-opens it via showModal(); if the resulting
878
- // close event is dispatched asynchronously it arrives after the re-open
879
- // (dialog.open true, host attribute still present) and must be ignored.
880
- const dialog = this.shadowRoot?.querySelector('dialog');
881
- if (dialog?.open && this.open) return;
882
- // A close() driven by handleClose (property already cleared) is the same
883
- // closing session — its open-dialog-close event already fired (#1226).
884
- if (!this.open) return;
885
- // A genuine native close (e.g. form method="dialog") finds the platform
886
- // has already cleared dialog.open.
887
- this.handleClose();
888
- }
889
- handleClose() {
890
- // Clearing the property updates the compiled signal; the open effect runs
891
- // updateStates() + syncDialogElement() — no duplicate sync here.
892
- this.open = false;
893
- this.dispatchEvent(new CustomEvent('open-dialog-close', {
894
- bubbles: true,
895
- composed: true
896
- }));
897
- }
898
- handleCancel(e) {
899
- e.preventDefault();
900
- this.handleClose();
901
- }
902
- handleTrigger() {
903
- this.toggle();
904
- }
905
- render() {
906
- throw new Error('[open:compiled-element] open-dialog is compiled to a Part Program; the runtime JSX render path is not available in 0.44.');
907
- }
908
- }
909
- export { __partProgram, __elementMetadata };
530
+ var OpenDialog = class extends OpenElement {
531
+ static __partProgram = __partProgram;
532
+ static __compiledProperties = __compiledProperties;
533
+ static __elementMetadata = __elementMetadata;
534
+ static props = __compiledProps;
535
+ static observedAttributes = __observedAttributes;
536
+ static delegatesFocus = true;
537
+ static styles = [overlayRecipe, openDialogStyles];
538
+ open = false;
539
+ label = "";
540
+ onCsrRendered() {
541
+ this.syncOpenState();
542
+ }
543
+ onDsdHydrated() {
544
+ this.syncOpenState();
545
+ }
546
+ disconnectedCallback() {
547
+ readInstanceState(this, "openEffect", () => void 0)?.();
548
+ writeInstanceState(this, "openEffect", void 0);
549
+ super.disconnectedCallback();
550
+ }
551
+ syncOpenState() {
552
+ this.updateStates();
553
+ this.syncDialogElement();
554
+ const off = effect(() => {
555
+ this.open;
556
+ this.updateStates();
557
+ this.syncDialogElement();
558
+ });
559
+ writeInstanceState(this, "openEffect", off);
560
+ }
561
+ updateStates() {
562
+ const states = this.stateSet();
563
+ if (!states) return;
564
+ if (this.open) {
565
+ states.add("open");
566
+ states.delete("closed");
567
+ } else {
568
+ states.delete("open");
569
+ states.add("closed");
570
+ }
571
+ }
572
+ stateSet() {
573
+ if (this._internals?.states) return this._internals.states;
574
+ let internals = readInstanceState(this, "internals", () => void 0);
575
+ if (!internals) {
576
+ if (typeof this.attachInternals !== "function") return void 0;
577
+ internals = this.attachInternals();
578
+ writeInstanceState(this, "internals", internals);
579
+ }
580
+ return internals.states;
581
+ }
582
+ show() {
583
+ this.open = true;
584
+ }
585
+ close() {
586
+ this.open = false;
587
+ }
588
+ toggle() {
589
+ this.open = !this.open;
590
+ }
591
+ syncDialogElement() {
592
+ const dialog = this.shadowRoot?.querySelector("dialog");
593
+ if (!dialog) return;
594
+ const modalActive = readInstanceState(this, "modalActive", () => false);
595
+ if (this.open) {
596
+ if ((this.getAttribute("mode") || "modal") === "modal") {
597
+ if (modalActive) return;
598
+ if (dialog.open) dialog.close();
599
+ dialog.showModal();
600
+ writeInstanceState(this, "modalActive", true);
601
+ } else if (!dialog.open) dialog.show();
602
+ } else {
603
+ if (modalActive && !dialog.open) dialog.setAttribute("open", "");
604
+ if (dialog.open) dialog.close();
605
+ writeInstanceState(this, "modalActive", false);
606
+ }
607
+ }
608
+ handleNativeClose() {
609
+ if ((this.shadowRoot?.querySelector("dialog"))?.open && this.open) return;
610
+ if (!this.open) return;
611
+ this.handleClose();
612
+ }
613
+ handleClose() {
614
+ this.open = false;
615
+ this.dispatchEvent(new CustomEvent("open-dialog-close", {
616
+ bubbles: true,
617
+ composed: true
618
+ }));
619
+ }
620
+ handleCancel(e) {
621
+ e.preventDefault();
622
+ this.handleClose();
623
+ }
624
+ handleTrigger() {
625
+ this.toggle();
626
+ }
627
+ render() {
628
+ throw new Error("[open:compiled-element] open-dialog is compiled to a Part Program; the runtime JSX render path is not available.");
629
+ }
630
+ };
631
+ //#endregion
632
+ export { OpenDialog, __elementMetadata, __partProgram };