@zag-js/popover 0.2.2 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -4,15 +4,864 @@ import { StateMachine } from '@zag-js/core';
4
4
  import { DismissableElementHandlers } from '@zag-js/dismissable';
5
5
  import { PositioningOptions } from '@zag-js/popper';
6
6
 
7
- declare type ElementIds = Partial<{
7
+ declare const anatomy: Omit<{
8
+ parts: <U extends string>(...parts: U[]) => Omit<{
9
+ parts: any;
10
+ extendWith: <V extends string>(...parts: V[]) => Omit<{
11
+ parts: any;
12
+ extendWith: <V_1 extends string>(...parts: V_1[]) => Omit<{
13
+ parts: any;
14
+ extendWith: <V_2 extends string>(...parts: V_2[]) => Omit<{
15
+ parts: any;
16
+ extendWith: <V_3 extends string>(...parts: V_3[]) => Omit<{
17
+ parts: any;
18
+ extendWith: <V_4 extends string>(...parts: V_4[]) => Omit<{
19
+ parts: any;
20
+ extendWith: <V_5 extends string>(...parts: V_5[]) => Omit<{
21
+ parts: any;
22
+ extendWith: <V_6 extends string>(...parts: V_6[]) => Omit<{
23
+ parts: any;
24
+ extendWith: <V_7 extends string>(...parts: V_7[]) => Omit<{
25
+ parts: any;
26
+ extendWith: <V_8 extends string>(...parts: V_8[]) => Omit<{
27
+ parts: any;
28
+ extendWith: <V_9 extends string>(...parts: V_9[]) => Omit<any, "parts">;
29
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5 | V_6 | V_7 | V_8, {
30
+ selector: string;
31
+ attrs: Record<"data-scope" | "data-part", string>;
32
+ }>;
33
+ }, "parts">;
34
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5 | V_6 | V_7, {
35
+ selector: string;
36
+ attrs: Record<"data-scope" | "data-part", string>;
37
+ }>;
38
+ }, "parts">;
39
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5 | V_6, {
40
+ selector: string;
41
+ attrs: Record<"data-scope" | "data-part", string>;
42
+ }>;
43
+ }, "parts">;
44
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5, {
45
+ selector: string;
46
+ attrs: Record<"data-scope" | "data-part", string>;
47
+ }>;
48
+ }, "parts">;
49
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4, {
50
+ selector: string;
51
+ attrs: Record<"data-scope" | "data-part", string>;
52
+ }>;
53
+ }, "parts">;
54
+ build: () => Record<U | V | V_1 | V_2 | V_3, {
55
+ selector: string;
56
+ attrs: Record<"data-scope" | "data-part", string>;
57
+ }>;
58
+ }, "parts">;
59
+ build: () => Record<U | V | V_1 | V_2, {
60
+ selector: string;
61
+ attrs: Record<"data-scope" | "data-part", string>;
62
+ }>;
63
+ }, "parts">;
64
+ build: () => Record<U | V | V_1, {
65
+ selector: string;
66
+ attrs: Record<"data-scope" | "data-part", string>;
67
+ }>;
68
+ }, "parts">;
69
+ build: () => Record<U | V, {
70
+ selector: string;
71
+ attrs: Record<"data-scope" | "data-part", string>;
72
+ }>;
73
+ }, "parts">;
74
+ build: () => Record<U, {
75
+ selector: string;
76
+ attrs: Record<"data-scope" | "data-part", string>;
77
+ }>;
78
+ }, "parts">;
79
+ extendWith: <V_10 extends string>(...parts: V_10[]) => Omit<{
80
+ parts: <U extends string>(...parts: U[]) => Omit<{
81
+ parts: any;
82
+ extendWith: <V extends string>(...parts: V[]) => Omit<{
83
+ parts: any;
84
+ extendWith: <V_1 extends string>(...parts: V_1[]) => Omit<{
85
+ parts: any;
86
+ extendWith: <V_2 extends string>(...parts: V_2[]) => Omit<{
87
+ parts: any;
88
+ extendWith: <V_3 extends string>(...parts: V_3[]) => Omit<{
89
+ parts: any;
90
+ extendWith: <V_4 extends string>(...parts: V_4[]) => Omit<{
91
+ parts: any;
92
+ extendWith: <V_5 extends string>(...parts: V_5[]) => Omit<{
93
+ parts: any;
94
+ extendWith: <V_6 extends string>(...parts: V_6[]) => Omit<{
95
+ parts: any;
96
+ extendWith: <V_7 extends string>(...parts: V_7[]) => Omit<{
97
+ parts: any;
98
+ extendWith: <V_8 extends string>(...parts: V_8[]) => Omit<{
99
+ parts: any;
100
+ extendWith: <V_9 extends string>(...parts: V_9[]) => Omit<any, "parts">;
101
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5 | V_6 | V_7 | V_8, {
102
+ selector: string;
103
+ attrs: Record<"data-scope" | "data-part", string>;
104
+ }>;
105
+ }, "parts">;
106
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5 | V_6 | V_7, {
107
+ selector: string;
108
+ attrs: Record<"data-scope" | "data-part", string>;
109
+ }>;
110
+ }, "parts">;
111
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5 | V_6, {
112
+ selector: string;
113
+ attrs: Record<"data-scope" | "data-part", string>;
114
+ }>;
115
+ }, "parts">;
116
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5, {
117
+ selector: string;
118
+ attrs: Record<"data-scope" | "data-part", string>;
119
+ }>;
120
+ }, "parts">;
121
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4, {
122
+ selector: string;
123
+ attrs: Record<"data-scope" | "data-part", string>;
124
+ }>;
125
+ }, "parts">;
126
+ build: () => Record<U | V | V_1 | V_2 | V_3, {
127
+ selector: string;
128
+ attrs: Record<"data-scope" | "data-part", string>;
129
+ }>;
130
+ }, "parts">;
131
+ build: () => Record<U | V | V_1 | V_2, {
132
+ selector: string;
133
+ attrs: Record<"data-scope" | "data-part", string>;
134
+ }>;
135
+ }, "parts">;
136
+ build: () => Record<U | V | V_1, {
137
+ selector: string;
138
+ attrs: Record<"data-scope" | "data-part", string>;
139
+ }>;
140
+ }, "parts">;
141
+ build: () => Record<U | V, {
142
+ selector: string;
143
+ attrs: Record<"data-scope" | "data-part", string>;
144
+ }>;
145
+ }, "parts">;
146
+ build: () => Record<U, {
147
+ selector: string;
148
+ attrs: Record<"data-scope" | "data-part", string>;
149
+ }>;
150
+ }, "parts">;
151
+ extendWith: <V_11 extends string>(...parts: V_11[]) => Omit<{
152
+ parts: <U extends string>(...parts: U[]) => Omit<{
153
+ parts: any;
154
+ extendWith: <V extends string>(...parts: V[]) => Omit<{
155
+ parts: any;
156
+ extendWith: <V_1 extends string>(...parts: V_1[]) => Omit<{
157
+ parts: any;
158
+ extendWith: <V_2 extends string>(...parts: V_2[]) => Omit<{
159
+ parts: any;
160
+ extendWith: <V_3 extends string>(...parts: V_3[]) => Omit<{
161
+ parts: any;
162
+ extendWith: <V_4 extends string>(...parts: V_4[]) => Omit<{
163
+ parts: any;
164
+ extendWith: <V_5 extends string>(...parts: V_5[]) => Omit<{
165
+ parts: any;
166
+ extendWith: <V_6 extends string>(...parts: V_6[]) => Omit<{
167
+ parts: any;
168
+ extendWith: <V_7 extends string>(...parts: V_7[]) => Omit<{
169
+ parts: any;
170
+ extendWith: <V_8 extends string>(...parts: V_8[]) => Omit<{
171
+ parts: any;
172
+ extendWith: <V_9 extends string>(...parts: V_9[]) => Omit<any, "parts">;
173
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5 | V_6 | V_7 | V_8, {
174
+ selector: string;
175
+ attrs: Record<"data-scope" | "data-part", string>;
176
+ }>;
177
+ }, "parts">;
178
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5 | V_6 | V_7, {
179
+ selector: string;
180
+ attrs: Record<"data-scope" | "data-part", string>;
181
+ }>;
182
+ }, "parts">;
183
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5 | V_6, {
184
+ selector: string;
185
+ attrs: Record<"data-scope" | "data-part", string>;
186
+ }>;
187
+ }, "parts">;
188
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5, {
189
+ selector: string;
190
+ attrs: Record<"data-scope" | "data-part", string>;
191
+ }>;
192
+ }, "parts">;
193
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4, {
194
+ selector: string;
195
+ attrs: Record<"data-scope" | "data-part", string>;
196
+ }>;
197
+ }, "parts">;
198
+ build: () => Record<U | V | V_1 | V_2 | V_3, {
199
+ selector: string;
200
+ attrs: Record<"data-scope" | "data-part", string>;
201
+ }>;
202
+ }, "parts">;
203
+ build: () => Record<U | V | V_1 | V_2, {
204
+ selector: string;
205
+ attrs: Record<"data-scope" | "data-part", string>;
206
+ }>;
207
+ }, "parts">;
208
+ build: () => Record<U | V | V_1, {
209
+ selector: string;
210
+ attrs: Record<"data-scope" | "data-part", string>;
211
+ }>;
212
+ }, "parts">;
213
+ build: () => Record<U | V, {
214
+ selector: string;
215
+ attrs: Record<"data-scope" | "data-part", string>;
216
+ }>;
217
+ }, "parts">;
218
+ build: () => Record<U, {
219
+ selector: string;
220
+ attrs: Record<"data-scope" | "data-part", string>;
221
+ }>;
222
+ }, "parts">;
223
+ extendWith: <V_12 extends string>(...parts: V_12[]) => Omit<{
224
+ parts: <U extends string>(...parts: U[]) => Omit<{
225
+ parts: any;
226
+ extendWith: <V extends string>(...parts: V[]) => Omit<{
227
+ parts: any;
228
+ extendWith: <V_1 extends string>(...parts: V_1[]) => Omit<{
229
+ parts: any;
230
+ extendWith: <V_2 extends string>(...parts: V_2[]) => Omit<{
231
+ parts: any;
232
+ extendWith: <V_3 extends string>(...parts: V_3[]) => Omit<{
233
+ parts: any;
234
+ extendWith: <V_4 extends string>(...parts: V_4[]) => Omit<{
235
+ parts: any;
236
+ extendWith: <V_5 extends string>(...parts: V_5[]) => Omit<{
237
+ parts: any;
238
+ extendWith: <V_6 extends string>(...parts: V_6[]) => Omit<{
239
+ parts: any;
240
+ extendWith: <V_7 extends string>(...parts: V_7[]) => Omit<{
241
+ parts: any;
242
+ extendWith: <V_8 extends string>(...parts: V_8[]) => Omit<{
243
+ parts: any;
244
+ extendWith: <V_9 extends string>(...parts: V_9[]) => Omit<any, "parts">;
245
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5 | V_6 | V_7 | V_8, {
246
+ selector: string;
247
+ attrs: Record<"data-scope" | "data-part", string>;
248
+ }>;
249
+ }, "parts">;
250
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5 | V_6 | V_7, {
251
+ selector: string;
252
+ attrs: Record<"data-scope" | "data-part", string>;
253
+ }>;
254
+ }, "parts">;
255
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5 | V_6, {
256
+ selector: string;
257
+ attrs: Record<"data-scope" | "data-part", string>;
258
+ }>;
259
+ }, "parts">;
260
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5, {
261
+ selector: string;
262
+ attrs: Record<"data-scope" | "data-part", string>;
263
+ }>;
264
+ }, "parts">;
265
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4, {
266
+ selector: string;
267
+ attrs: Record<"data-scope" | "data-part", string>;
268
+ }>;
269
+ }, "parts">;
270
+ build: () => Record<U | V | V_1 | V_2 | V_3, {
271
+ selector: string;
272
+ attrs: Record<"data-scope" | "data-part", string>;
273
+ }>;
274
+ }, "parts">;
275
+ build: () => Record<U | V | V_1 | V_2, {
276
+ selector: string;
277
+ attrs: Record<"data-scope" | "data-part", string>;
278
+ }>;
279
+ }, "parts">;
280
+ build: () => Record<U | V | V_1, {
281
+ selector: string;
282
+ attrs: Record<"data-scope" | "data-part", string>;
283
+ }>;
284
+ }, "parts">;
285
+ build: () => Record<U | V, {
286
+ selector: string;
287
+ attrs: Record<"data-scope" | "data-part", string>;
288
+ }>;
289
+ }, "parts">;
290
+ build: () => Record<U, {
291
+ selector: string;
292
+ attrs: Record<"data-scope" | "data-part", string>;
293
+ }>;
294
+ }, "parts">;
295
+ extendWith: <V_13 extends string>(...parts: V_13[]) => Omit<{
296
+ parts: <U extends string>(...parts: U[]) => Omit<{
297
+ parts: any;
298
+ extendWith: <V extends string>(...parts: V[]) => Omit<{
299
+ parts: any;
300
+ extendWith: <V_1 extends string>(...parts: V_1[]) => Omit<{
301
+ parts: any;
302
+ extendWith: <V_2 extends string>(...parts: V_2[]) => Omit<{
303
+ parts: any;
304
+ extendWith: <V_3 extends string>(...parts: V_3[]) => Omit<{
305
+ parts: any;
306
+ extendWith: <V_4 extends string>(...parts: V_4[]) => Omit<{
307
+ parts: any;
308
+ extendWith: <V_5 extends string>(...parts: V_5[]) => Omit<{
309
+ parts: any;
310
+ extendWith: <V_6 extends string>(...parts: V_6[]) => Omit<{
311
+ parts: any;
312
+ extendWith: <V_7 extends string>(...parts: V_7[]) => Omit<{
313
+ parts: any;
314
+ extendWith: <V_8 extends string>(...parts: V_8[]) => Omit<{
315
+ parts: any;
316
+ extendWith: <V_9 extends string>(...parts: V_9[]) => Omit<any, "parts">;
317
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5 | V_6 | V_7 | V_8, {
318
+ selector: string;
319
+ attrs: Record<"data-scope" | "data-part", string>;
320
+ }>;
321
+ }, "parts">;
322
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5 | V_6 | V_7, {
323
+ selector: string;
324
+ attrs: Record<"data-scope" | "data-part", string>;
325
+ }>;
326
+ }, "parts">;
327
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5 | V_6, {
328
+ selector: string;
329
+ attrs: Record<"data-scope" | "data-part", string>;
330
+ }>;
331
+ }, "parts">;
332
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5, {
333
+ selector: string;
334
+ attrs: Record<"data-scope" | "data-part", string>;
335
+ }>;
336
+ }, "parts">;
337
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4, {
338
+ selector: string;
339
+ attrs: Record<"data-scope" | "data-part", string>;
340
+ }>;
341
+ }, "parts">;
342
+ build: () => Record<U | V | V_1 | V_2 | V_3, {
343
+ selector: string;
344
+ attrs: Record<"data-scope" | "data-part", string>;
345
+ }>;
346
+ }, "parts">;
347
+ build: () => Record<U | V | V_1 | V_2, {
348
+ selector: string;
349
+ attrs: Record<"data-scope" | "data-part", string>;
350
+ }>;
351
+ }, "parts">;
352
+ build: () => Record<U | V | V_1, {
353
+ selector: string;
354
+ attrs: Record<"data-scope" | "data-part", string>;
355
+ }>;
356
+ }, "parts">;
357
+ build: () => Record<U | V, {
358
+ selector: string;
359
+ attrs: Record<"data-scope" | "data-part", string>;
360
+ }>;
361
+ }, "parts">;
362
+ build: () => Record<U, {
363
+ selector: string;
364
+ attrs: Record<"data-scope" | "data-part", string>;
365
+ }>;
366
+ }, "parts">;
367
+ extendWith: <V_14 extends string>(...parts: V_14[]) => Omit<{
368
+ parts: <U extends string>(...parts: U[]) => Omit<{
369
+ parts: any;
370
+ extendWith: <V extends string>(...parts: V[]) => Omit<{
371
+ parts: any;
372
+ extendWith: <V_1 extends string>(...parts: V_1[]) => Omit<{
373
+ parts: any;
374
+ extendWith: <V_2 extends string>(...parts: V_2[]) => Omit<{
375
+ parts: any;
376
+ extendWith: <V_3 extends string>(...parts: V_3[]) => Omit<{
377
+ parts: any;
378
+ extendWith: <V_4 extends string>(...parts: V_4[]) => Omit<{
379
+ parts: any;
380
+ extendWith: <V_5 extends string>(...parts: V_5[]) => Omit<{
381
+ parts: any;
382
+ extendWith: <V_6 extends string>(...parts: V_6[]) => Omit<{
383
+ parts: any;
384
+ extendWith: <V_7 extends string>(...parts: V_7[]) => Omit<{
385
+ parts: any;
386
+ extendWith: <V_8 extends string>(...parts: V_8[]) => Omit<{
387
+ parts: any;
388
+ extendWith: <V_9 extends string>(...parts: V_9[]) => Omit<any, "parts">;
389
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5 | V_6 | V_7 | V_8, {
390
+ selector: string;
391
+ attrs: Record<"data-scope" | "data-part", string>;
392
+ }>;
393
+ }, "parts">;
394
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5 | V_6 | V_7, {
395
+ selector: string;
396
+ attrs: Record<"data-scope" | "data-part", string>;
397
+ }>;
398
+ }, "parts">;
399
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5 | V_6, {
400
+ selector: string;
401
+ attrs: Record<"data-scope" | "data-part", string>;
402
+ }>;
403
+ }, "parts">;
404
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5, {
405
+ selector: string;
406
+ attrs: Record<"data-scope" | "data-part", string>;
407
+ }>;
408
+ }, "parts">;
409
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4, {
410
+ selector: string;
411
+ attrs: Record<"data-scope" | "data-part", string>;
412
+ }>;
413
+ }, "parts">;
414
+ build: () => Record<U | V | V_1 | V_2 | V_3, {
415
+ selector: string;
416
+ attrs: Record<"data-scope" | "data-part", string>;
417
+ }>;
418
+ }, "parts">;
419
+ build: () => Record<U | V | V_1 | V_2, {
420
+ selector: string;
421
+ attrs: Record<"data-scope" | "data-part", string>;
422
+ }>;
423
+ }, "parts">;
424
+ build: () => Record<U | V | V_1, {
425
+ selector: string;
426
+ attrs: Record<"data-scope" | "data-part", string>;
427
+ }>;
428
+ }, "parts">;
429
+ build: () => Record<U | V, {
430
+ selector: string;
431
+ attrs: Record<"data-scope" | "data-part", string>;
432
+ }>;
433
+ }, "parts">;
434
+ build: () => Record<U, {
435
+ selector: string;
436
+ attrs: Record<"data-scope" | "data-part", string>;
437
+ }>;
438
+ }, "parts">;
439
+ extendWith: <V_15 extends string>(...parts: V_15[]) => Omit<{
440
+ parts: <U extends string>(...parts: U[]) => Omit<{
441
+ parts: any;
442
+ extendWith: <V extends string>(...parts: V[]) => Omit<{
443
+ parts: any;
444
+ extendWith: <V_1 extends string>(...parts: V_1[]) => Omit<{
445
+ parts: any;
446
+ extendWith: <V_2 extends string>(...parts: V_2[]) => Omit<{
447
+ parts: any;
448
+ extendWith: <V_3 extends string>(...parts: V_3[]) => Omit<{
449
+ parts: any;
450
+ extendWith: <V_4 extends string>(...parts: V_4[]) => Omit<{
451
+ parts: any;
452
+ extendWith: <V_5 extends string>(...parts: V_5[]) => Omit<{
453
+ parts: any;
454
+ extendWith: <V_6 extends string>(...parts: V_6[]) => Omit<{
455
+ parts: any;
456
+ extendWith: <V_7 extends string>(...parts: V_7[]) => Omit<{
457
+ parts: any;
458
+ extendWith: <V_8 extends string>(...parts: V_8[]) => Omit<{
459
+ parts: any;
460
+ extendWith: <V_9 extends string>(...parts: V_9[]) => Omit<any, "parts">;
461
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5 | V_6 | V_7 | V_8, {
462
+ selector: string;
463
+ attrs: Record<"data-scope" | "data-part", string>;
464
+ }>;
465
+ }, "parts">;
466
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5 | V_6 | V_7, {
467
+ selector: string;
468
+ attrs: Record<"data-scope" | "data-part", string>;
469
+ }>;
470
+ }, "parts">;
471
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5 | V_6, {
472
+ selector: string;
473
+ attrs: Record<"data-scope" | "data-part", string>;
474
+ }>;
475
+ }, "parts">;
476
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5, {
477
+ selector: string;
478
+ attrs: Record<"data-scope" | "data-part", string>;
479
+ }>;
480
+ }, "parts">;
481
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4, {
482
+ selector: string;
483
+ attrs: Record<"data-scope" | "data-part", string>;
484
+ }>;
485
+ }, "parts">;
486
+ build: () => Record<U | V | V_1 | V_2 | V_3, {
487
+ selector: string;
488
+ attrs: Record<"data-scope" | "data-part", string>;
489
+ }>;
490
+ }, "parts">;
491
+ build: () => Record<U | V | V_1 | V_2, {
492
+ selector: string;
493
+ attrs: Record<"data-scope" | "data-part", string>;
494
+ }>;
495
+ }, "parts">;
496
+ build: () => Record<U | V | V_1, {
497
+ selector: string;
498
+ attrs: Record<"data-scope" | "data-part", string>;
499
+ }>;
500
+ }, "parts">;
501
+ build: () => Record<U | V, {
502
+ selector: string;
503
+ attrs: Record<"data-scope" | "data-part", string>;
504
+ }>;
505
+ }, "parts">;
506
+ build: () => Record<U, {
507
+ selector: string;
508
+ attrs: Record<"data-scope" | "data-part", string>;
509
+ }>;
510
+ }, "parts">;
511
+ extendWith: <V_16 extends string>(...parts: V_16[]) => Omit<{
512
+ parts: <U extends string>(...parts: U[]) => Omit<{
513
+ parts: any;
514
+ extendWith: <V extends string>(...parts: V[]) => Omit<{
515
+ parts: any;
516
+ extendWith: <V_1 extends string>(...parts: V_1[]) => Omit<{
517
+ parts: any;
518
+ extendWith: <V_2 extends string>(...parts: V_2[]) => Omit<{
519
+ parts: any;
520
+ extendWith: <V_3 extends string>(...parts: V_3[]) => Omit<{
521
+ parts: any;
522
+ extendWith: <V_4 extends string>(...parts: V_4[]) => Omit<{
523
+ parts: any;
524
+ extendWith: <V_5 extends string>(...parts: V_5[]) => Omit<{
525
+ parts: any;
526
+ extendWith: <V_6 extends string>(...parts: V_6[]) => Omit<{
527
+ parts: any;
528
+ extendWith: <V_7 extends string>(...parts: V_7[]) => Omit<{
529
+ parts: any;
530
+ extendWith: <V_8 extends string>(...parts: V_8[]) => Omit<{
531
+ parts: any;
532
+ extendWith: <V_9 extends string>(...parts: V_9[]) => Omit<any, "parts">;
533
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5 | V_6 | V_7 | V_8, {
534
+ selector: string;
535
+ attrs: Record<"data-scope" | "data-part", string>;
536
+ }>;
537
+ }, "parts">;
538
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5 | V_6 | V_7, {
539
+ selector: string;
540
+ attrs: Record<"data-scope" | "data-part", string>;
541
+ }>;
542
+ }, "parts">;
543
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5 | V_6, {
544
+ selector: string;
545
+ attrs: Record<"data-scope" | "data-part", string>;
546
+ }>;
547
+ }, "parts">;
548
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5, {
549
+ selector: string;
550
+ attrs: Record<"data-scope" | "data-part", string>;
551
+ }>;
552
+ }, "parts">;
553
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4, {
554
+ selector: string;
555
+ attrs: Record<"data-scope" | "data-part", string>;
556
+ }>;
557
+ }, "parts">;
558
+ build: () => Record<U | V | V_1 | V_2 | V_3, {
559
+ selector: string;
560
+ attrs: Record<"data-scope" | "data-part", string>;
561
+ }>;
562
+ }, "parts">;
563
+ build: () => Record<U | V | V_1 | V_2, {
564
+ selector: string;
565
+ attrs: Record<"data-scope" | "data-part", string>;
566
+ }>;
567
+ }, "parts">;
568
+ build: () => Record<U | V | V_1, {
569
+ selector: string;
570
+ attrs: Record<"data-scope" | "data-part", string>;
571
+ }>;
572
+ }, "parts">;
573
+ build: () => Record<U | V, {
574
+ selector: string;
575
+ attrs: Record<"data-scope" | "data-part", string>;
576
+ }>;
577
+ }, "parts">;
578
+ build: () => Record<U, {
579
+ selector: string;
580
+ attrs: Record<"data-scope" | "data-part", string>;
581
+ }>;
582
+ }, "parts">;
583
+ extendWith: <V_17 extends string>(...parts: V_17[]) => Omit<{
584
+ parts: <U extends string>(...parts: U[]) => Omit<{
585
+ parts: any;
586
+ extendWith: <V extends string>(...parts: V[]) => Omit<{
587
+ parts: any;
588
+ extendWith: <V_1 extends string>(...parts: V_1[]) => Omit<{
589
+ parts: any;
590
+ extendWith: <V_2 extends string>(...parts: V_2[]) => Omit<{
591
+ parts: any;
592
+ extendWith: <V_3 extends string>(...parts: V_3[]) => Omit<{
593
+ parts: any;
594
+ extendWith: <V_4 extends string>(...parts: V_4[]) => Omit<{
595
+ parts: any;
596
+ extendWith: <V_5 extends string>(...parts: V_5[]) => Omit<{
597
+ parts: any;
598
+ extendWith: <V_6 extends string>(...parts: V_6[]) => Omit<{
599
+ parts: any;
600
+ extendWith: <V_7 extends string>(...parts: V_7[]) => Omit<{
601
+ parts: any;
602
+ extendWith: <V_8 extends string>(...parts: V_8[]) => Omit<{
603
+ parts: any;
604
+ extendWith: <V_9 extends string>(...parts: V_9[]) => Omit<any, "parts">;
605
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5 | V_6 | V_7 | V_8, {
606
+ selector: string;
607
+ attrs: Record<"data-scope" | "data-part", string>;
608
+ }>;
609
+ }, "parts">;
610
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5 | V_6 | V_7, {
611
+ selector: string;
612
+ attrs: Record<"data-scope" | "data-part", string>;
613
+ }>;
614
+ }, "parts">;
615
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5 | V_6, {
616
+ selector: string;
617
+ attrs: Record<"data-scope" | "data-part", string>;
618
+ }>;
619
+ }, "parts">;
620
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5, {
621
+ selector: string;
622
+ attrs: Record<"data-scope" | "data-part", string>;
623
+ }>;
624
+ }, "parts">;
625
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4, {
626
+ selector: string;
627
+ attrs: Record<"data-scope" | "data-part", string>;
628
+ }>;
629
+ }, "parts">;
630
+ build: () => Record<U | V | V_1 | V_2 | V_3, {
631
+ selector: string;
632
+ attrs: Record<"data-scope" | "data-part", string>;
633
+ }>;
634
+ }, "parts">;
635
+ build: () => Record<U | V | V_1 | V_2, {
636
+ selector: string;
637
+ attrs: Record<"data-scope" | "data-part", string>;
638
+ }>;
639
+ }, "parts">;
640
+ build: () => Record<U | V | V_1, {
641
+ selector: string;
642
+ attrs: Record<"data-scope" | "data-part", string>;
643
+ }>;
644
+ }, "parts">;
645
+ build: () => Record<U | V, {
646
+ selector: string;
647
+ attrs: Record<"data-scope" | "data-part", string>;
648
+ }>;
649
+ }, "parts">;
650
+ build: () => Record<U, {
651
+ selector: string;
652
+ attrs: Record<"data-scope" | "data-part", string>;
653
+ }>;
654
+ }, "parts">;
655
+ extendWith: <V_18 extends string>(...parts: V_18[]) => Omit<{
656
+ parts: <U extends string>(...parts: U[]) => Omit<{
657
+ parts: any;
658
+ extendWith: <V extends string>(...parts: V[]) => Omit<{
659
+ parts: any;
660
+ extendWith: <V_1 extends string>(...parts: V_1[]) => Omit<{
661
+ parts: any;
662
+ extendWith: <V_2 extends string>(...parts: V_2[]) => Omit<{
663
+ parts: any;
664
+ extendWith: <V_3 extends string>(...parts: V_3[]) => Omit<{
665
+ parts: any;
666
+ extendWith: <V_4 extends string>(...parts: V_4[]) => Omit<{
667
+ parts: any;
668
+ extendWith: <V_5 extends string>(...parts: V_5[]) => Omit<{
669
+ parts: any;
670
+ extendWith: <V_6 extends string>(...parts: V_6[]) => Omit<{
671
+ parts: any;
672
+ extendWith: <V_7 extends string>(...parts: V_7[]) => Omit<{
673
+ parts: any;
674
+ extendWith: <V_8 extends string>(...parts: V_8[]) => Omit<{
675
+ parts: any;
676
+ extendWith: <V_9 extends string>(...parts: V_9[]) => Omit<any, "parts">;
677
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5 | V_6 | V_7 | V_8, {
678
+ selector: string;
679
+ attrs: Record<"data-scope" | "data-part", string>;
680
+ }>;
681
+ }, "parts">;
682
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5 | V_6 | V_7, {
683
+ selector: string;
684
+ attrs: Record<"data-scope" | "data-part", string>;
685
+ }>;
686
+ }, "parts">;
687
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5 | V_6, {
688
+ selector: string;
689
+ attrs: Record<"data-scope" | "data-part", string>;
690
+ }>;
691
+ }, "parts">;
692
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5, {
693
+ selector: string;
694
+ attrs: Record<"data-scope" | "data-part", string>;
695
+ }>;
696
+ }, "parts">;
697
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4, {
698
+ selector: string;
699
+ attrs: Record<"data-scope" | "data-part", string>;
700
+ }>;
701
+ }, "parts">;
702
+ build: () => Record<U | V | V_1 | V_2 | V_3, {
703
+ selector: string;
704
+ attrs: Record<"data-scope" | "data-part", string>;
705
+ }>;
706
+ }, "parts">;
707
+ build: () => Record<U | V | V_1 | V_2, {
708
+ selector: string;
709
+ attrs: Record<"data-scope" | "data-part", string>;
710
+ }>;
711
+ }, "parts">;
712
+ build: () => Record<U | V | V_1, {
713
+ selector: string;
714
+ attrs: Record<"data-scope" | "data-part", string>;
715
+ }>;
716
+ }, "parts">;
717
+ build: () => Record<U | V, {
718
+ selector: string;
719
+ attrs: Record<"data-scope" | "data-part", string>;
720
+ }>;
721
+ }, "parts">;
722
+ build: () => Record<U, {
723
+ selector: string;
724
+ attrs: Record<"data-scope" | "data-part", string>;
725
+ }>;
726
+ }, "parts">;
727
+ extendWith: <V_19 extends string>(...parts: V_19[]) => Omit<{
728
+ parts: <U extends string>(...parts: U[]) => Omit<{
729
+ parts: any;
730
+ extendWith: <V extends string>(...parts: V[]) => Omit<{
731
+ parts: any;
732
+ extendWith: <V_1 extends string>(...parts: V_1[]) => Omit<{
733
+ parts: any;
734
+ extendWith: <V_2 extends string>(...parts: V_2[]) => Omit<{
735
+ parts: any;
736
+ extendWith: <V_3 extends string>(...parts: V_3[]) => Omit<{
737
+ parts: any;
738
+ extendWith: <V_4 extends string>(...parts: V_4[]) => Omit<{
739
+ parts: any;
740
+ extendWith: <V_5 extends string>(...parts: V_5[]) => Omit<{
741
+ parts: any;
742
+ extendWith: <V_6 extends string>(...parts: V_6[]) => Omit<{
743
+ parts: any;
744
+ extendWith: <V_7 extends string>(...parts: V_7[]) => Omit<{
745
+ parts: any;
746
+ extendWith: <V_8 extends string>(...parts: V_8[]) => Omit<{
747
+ parts: any;
748
+ extendWith: <V_9 extends string>(...parts: V_9[]) => Omit<any, "parts">;
749
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5 | V_6 | V_7 | V_8, {
750
+ selector: string;
751
+ attrs: Record<"data-scope" | "data-part", string>;
752
+ }>;
753
+ }, "parts">;
754
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5 | V_6 | V_7, {
755
+ selector: string;
756
+ attrs: Record<"data-scope" | "data-part", string>;
757
+ }>;
758
+ }, "parts">;
759
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5 | V_6, {
760
+ selector: string;
761
+ attrs: Record<"data-scope" | "data-part", string>;
762
+ }>;
763
+ }, "parts">;
764
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4 | V_5, {
765
+ selector: string;
766
+ attrs: Record<"data-scope" | "data-part", string>;
767
+ }>;
768
+ }, "parts">;
769
+ build: () => Record<U | V | V_1 | V_2 | V_3 | V_4, {
770
+ selector: string;
771
+ attrs: Record<"data-scope" | "data-part", string>;
772
+ }>;
773
+ }, "parts">;
774
+ build: () => Record<U | V | V_1 | V_2 | V_3, {
775
+ selector: string;
776
+ attrs: Record<"data-scope" | "data-part", string>;
777
+ }>;
778
+ }, "parts">;
779
+ build: () => Record<U | V | V_1 | V_2, {
780
+ selector: string;
781
+ attrs: Record<"data-scope" | "data-part", string>;
782
+ }>;
783
+ }, "parts">;
784
+ build: () => Record<U | V | V_1, {
785
+ selector: string;
786
+ attrs: Record<"data-scope" | "data-part", string>;
787
+ }>;
788
+ }, "parts">;
789
+ build: () => Record<U | V, {
790
+ selector: string;
791
+ attrs: Record<"data-scope" | "data-part", string>;
792
+ }>;
793
+ }, "parts">;
794
+ build: () => Record<U, {
795
+ selector: string;
796
+ attrs: Record<"data-scope" | "data-part", string>;
797
+ }>;
798
+ }, "parts">;
799
+ extendWith: <V_20 extends string>(...parts: V_20[]) => Omit<any, "parts">;
800
+ build: () => Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "closeTrigger" | V_10 | V_11 | V_12 | V_13 | V_14 | V_15 | V_16 | V_17 | V_18 | V_19, {
801
+ selector: string;
802
+ attrs: Record<"data-scope" | "data-part", string>;
803
+ }>;
804
+ }, "parts">;
805
+ build: () => Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "closeTrigger" | V_10 | V_11 | V_12 | V_13 | V_14 | V_15 | V_16 | V_17 | V_18, {
806
+ selector: string;
807
+ attrs: Record<"data-scope" | "data-part", string>;
808
+ }>;
809
+ }, "parts">;
810
+ build: () => Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "closeTrigger" | V_10 | V_11 | V_12 | V_13 | V_14 | V_15 | V_16 | V_17, {
811
+ selector: string;
812
+ attrs: Record<"data-scope" | "data-part", string>;
813
+ }>;
814
+ }, "parts">;
815
+ build: () => Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "closeTrigger" | V_10 | V_11 | V_12 | V_13 | V_14 | V_15 | V_16, {
816
+ selector: string;
817
+ attrs: Record<"data-scope" | "data-part", string>;
818
+ }>;
819
+ }, "parts">;
820
+ build: () => Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "closeTrigger" | V_10 | V_11 | V_12 | V_13 | V_14 | V_15, {
821
+ selector: string;
822
+ attrs: Record<"data-scope" | "data-part", string>;
823
+ }>;
824
+ }, "parts">;
825
+ build: () => Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "closeTrigger" | V_10 | V_11 | V_12 | V_13 | V_14, {
826
+ selector: string;
827
+ attrs: Record<"data-scope" | "data-part", string>;
828
+ }>;
829
+ }, "parts">;
830
+ build: () => Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "closeTrigger" | V_10 | V_11 | V_12 | V_13, {
831
+ selector: string;
832
+ attrs: Record<"data-scope" | "data-part", string>;
833
+ }>;
834
+ }, "parts">;
835
+ build: () => Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "closeTrigger" | V_10 | V_11 | V_12, {
836
+ selector: string;
837
+ attrs: Record<"data-scope" | "data-part", string>;
838
+ }>;
839
+ }, "parts">;
840
+ build: () => Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "closeTrigger" | V_10 | V_11, {
841
+ selector: string;
842
+ attrs: Record<"data-scope" | "data-part", string>;
843
+ }>;
844
+ }, "parts">;
845
+ build: () => Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "closeTrigger" | V_10, {
846
+ selector: string;
847
+ attrs: Record<"data-scope" | "data-part", string>;
848
+ }>;
849
+ }, "parts">;
850
+ build: () => Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "closeTrigger", {
851
+ selector: string;
852
+ attrs: Record<"data-scope" | "data-part", string>;
853
+ }>;
854
+ }, "parts">;
855
+
856
+ type ElementIds = Partial<{
8
857
  anchor: string;
9
858
  trigger: string;
10
859
  content: string;
11
860
  title: string;
12
861
  description: string;
13
- closeBtn: string;
862
+ closeTrigger: string;
14
863
  }>;
15
- declare type PublicContext = DismissableElementHandlers & CommonProperties & {
864
+ type PublicContext = DismissableElementHandlers & CommonProperties & {
16
865
  /**
17
866
  * The ids of the elements in the popover. Useful for composition.
18
867
  */
@@ -61,26 +910,26 @@ declare type PublicContext = DismissableElementHandlers & CommonProperties & {
61
910
  */
62
911
  defaultOpen?: boolean;
63
912
  };
64
- declare type UserDefinedContext = RequiredBy<PublicContext, "id">;
65
- declare type ComputedContext = Readonly<{
913
+ type UserDefinedContext = RequiredBy<PublicContext, "id">;
914
+ type ComputedContext = Readonly<{
66
915
  /**
67
916
  * @computed
68
917
  * The computed value of `portalled`
69
918
  */
70
919
  currentPortalled: boolean;
71
920
  }>;
72
- declare type PrivateContext = Context<{
921
+ type PrivateContext = Context<{
73
922
  /**
74
923
  * Whether to prevent returning focus to the trigger
75
924
  */
76
925
  focusTriggerOnClose?: boolean;
77
926
  }>;
78
- declare type MachineContext = PublicContext & ComputedContext & PrivateContext;
79
- declare type MachineState = {
927
+ type MachineContext = PublicContext & ComputedContext & PrivateContext;
928
+ type MachineState = {
80
929
  value: "unknown" | "open" | "closed";
81
930
  };
82
- declare type State = StateMachine.State<MachineContext, MachineState>;
83
- declare type Send = StateMachine.Send<StateMachine.AnyEventObject>;
931
+ type State = StateMachine.State<MachineContext, MachineState>;
932
+ type Send = StateMachine.Send<StateMachine.AnyEventObject>;
84
933
 
85
934
  declare function connect<T extends PropTypes>(state: State, send: Send, normalize: NormalizeProps<T>): {
86
935
  portalled: boolean;
@@ -88,16 +937,16 @@ declare function connect<T extends PropTypes>(state: State, send: Send, normaliz
88
937
  open(): void;
89
938
  close(): void;
90
939
  arrowProps: T["element"];
91
- innerArrowProps: T["element"];
940
+ arrowTipProps: T["element"];
92
941
  anchorProps: T["element"];
93
942
  triggerProps: T["button"];
94
943
  positionerProps: T["element"];
95
944
  contentProps: T["element"];
96
945
  titleProps: T["element"];
97
946
  descriptionProps: T["element"];
98
- closeButtonProps: T["button"];
947
+ closeTriggerProps: T["button"];
99
948
  };
100
949
 
101
950
  declare function machine(userContext: UserDefinedContext): _zag_js_core.Machine<MachineContext, MachineState, _zag_js_core.StateMachine.AnyEventObject>;
102
951
 
103
- export { UserDefinedContext as Context, connect, machine };
952
+ export { UserDefinedContext as Context, anatomy, connect, machine };
package/dist/index.js CHANGED
@@ -20,11 +20,27 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var src_exports = {};
22
22
  __export(src_exports, {
23
+ anatomy: () => anatomy,
23
24
  connect: () => connect,
24
25
  machine: () => machine
25
26
  });
26
27
  module.exports = __toCommonJS(src_exports);
27
28
 
29
+ // src/popover.anatomy.ts
30
+ var import_anatomy = require("@zag-js/anatomy");
31
+ var anatomy = (0, import_anatomy.createAnatomy)("popover").parts(
32
+ "arrow",
33
+ "arrowTip",
34
+ "anchor",
35
+ "trigger",
36
+ "positioner",
37
+ "content",
38
+ "title",
39
+ "description",
40
+ "closeTrigger"
41
+ );
42
+ var parts = anatomy.build();
43
+
28
44
  // ../../utilities/dom/dist/index.mjs
29
45
  var dataAttr = (guard) => {
30
46
  return guard ? "" : void 0;
@@ -247,9 +263,9 @@ var dom = defineDomHelpers({
247
263
  var _a, _b;
248
264
  return (_b = (_a = ctx.ids) == null ? void 0 : _a.description) != null ? _b : `popover:${ctx.id}:desc`;
249
265
  },
250
- getCloseButtonId: (ctx) => {
266
+ getCloseTriggerId: (ctx) => {
251
267
  var _a, _b;
252
- return (_b = (_a = ctx.ids) == null ? void 0 : _a.closeBtn) != null ? _b : `popover:${ctx.id}:close-button`;
268
+ return (_b = (_a = ctx.ids) == null ? void 0 : _a.closeTrigger) != null ? _b : `popover:${ctx.id}:close`;
253
269
  },
254
270
  getAnchorEl: (ctx) => dom.getById(ctx, dom.getAnchorId(ctx)),
255
271
  getTriggerEl: (ctx) => dom.getById(ctx, dom.getTriggerId(ctx)),
@@ -294,19 +310,19 @@ function connect(state, send, normalize) {
294
310
  },
295
311
  arrowProps: normalize.element({
296
312
  id: dom.getArrowId(state.context),
297
- "data-part": "arrow",
313
+ ...parts.arrow.attrs,
298
314
  style: popperStyles.arrow
299
315
  }),
300
- innerArrowProps: normalize.element({
301
- "data-part": "arrow-inner",
302
- style: popperStyles.innerArrow
316
+ arrowTipProps: normalize.element({
317
+ ...parts.arrowTip.attrs,
318
+ style: popperStyles.arrowTip
303
319
  }),
304
320
  anchorProps: normalize.element({
305
- "data-part": "anchor",
321
+ ...parts.anchor.attrs,
306
322
  id: dom.getAnchorId(state.context)
307
323
  }),
308
324
  triggerProps: normalize.button({
309
- "data-part": "trigger",
325
+ ...parts.trigger.attrs,
310
326
  type: "button",
311
327
  "data-placement": currentPlacement,
312
328
  id: dom.getTriggerId(state.context),
@@ -323,11 +339,11 @@ function connect(state, send, normalize) {
323
339
  }),
324
340
  positionerProps: normalize.element({
325
341
  id: dom.getPositionerId(state.context),
326
- "data-part": "positioner",
342
+ ...parts.positioner.attrs,
327
343
  style: popperStyles.floating
328
344
  }),
329
345
  contentProps: normalize.element({
330
- "data-part": "content",
346
+ ...parts.content.attrs,
331
347
  id: dom.getContentId(state.context),
332
348
  tabIndex: -1,
333
349
  role: "dialog",
@@ -338,16 +354,16 @@ function connect(state, send, normalize) {
338
354
  "data-placement": currentPlacement
339
355
  }),
340
356
  titleProps: normalize.element({
341
- "data-part": "title",
357
+ ...parts.title.attrs,
342
358
  id: dom.getTitleId(state.context)
343
359
  }),
344
360
  descriptionProps: normalize.element({
345
- "data-part": "description",
361
+ ...parts.description.attrs,
346
362
  id: dom.getDescriptionId(state.context)
347
363
  }),
348
- closeButtonProps: normalize.button({
349
- "data-part": "close-button",
350
- id: dom.getCloseButtonId(state.context),
364
+ closeTriggerProps: normalize.button({
365
+ ...parts.closeTrigger.attrs,
366
+ id: dom.getCloseTriggerId(state.context),
351
367
  type: "button",
352
368
  "aria-label": "close",
353
369
  onClick() {
@@ -634,6 +650,7 @@ function machine(userContext) {
634
650
  }
635
651
  // Annotate the CommonJS export names for ESM import in node:
636
652
  0 && (module.exports = {
653
+ anatomy,
637
654
  connect,
638
655
  machine
639
656
  });
package/dist/index.mjs CHANGED
@@ -1,3 +1,18 @@
1
+ // src/popover.anatomy.ts
2
+ import { createAnatomy } from "@zag-js/anatomy";
3
+ var anatomy = createAnatomy("popover").parts(
4
+ "arrow",
5
+ "arrowTip",
6
+ "anchor",
7
+ "trigger",
8
+ "positioner",
9
+ "content",
10
+ "title",
11
+ "description",
12
+ "closeTrigger"
13
+ );
14
+ var parts = anatomy.build();
15
+
1
16
  // ../../utilities/dom/dist/index.mjs
2
17
  var dataAttr = (guard) => {
3
18
  return guard ? "" : void 0;
@@ -220,9 +235,9 @@ var dom = defineDomHelpers({
220
235
  var _a, _b;
221
236
  return (_b = (_a = ctx.ids) == null ? void 0 : _a.description) != null ? _b : `popover:${ctx.id}:desc`;
222
237
  },
223
- getCloseButtonId: (ctx) => {
238
+ getCloseTriggerId: (ctx) => {
224
239
  var _a, _b;
225
- return (_b = (_a = ctx.ids) == null ? void 0 : _a.closeBtn) != null ? _b : `popover:${ctx.id}:close-button`;
240
+ return (_b = (_a = ctx.ids) == null ? void 0 : _a.closeTrigger) != null ? _b : `popover:${ctx.id}:close`;
226
241
  },
227
242
  getAnchorEl: (ctx) => dom.getById(ctx, dom.getAnchorId(ctx)),
228
243
  getTriggerEl: (ctx) => dom.getById(ctx, dom.getTriggerId(ctx)),
@@ -267,19 +282,19 @@ function connect(state, send, normalize) {
267
282
  },
268
283
  arrowProps: normalize.element({
269
284
  id: dom.getArrowId(state.context),
270
- "data-part": "arrow",
285
+ ...parts.arrow.attrs,
271
286
  style: popperStyles.arrow
272
287
  }),
273
- innerArrowProps: normalize.element({
274
- "data-part": "arrow-inner",
275
- style: popperStyles.innerArrow
288
+ arrowTipProps: normalize.element({
289
+ ...parts.arrowTip.attrs,
290
+ style: popperStyles.arrowTip
276
291
  }),
277
292
  anchorProps: normalize.element({
278
- "data-part": "anchor",
293
+ ...parts.anchor.attrs,
279
294
  id: dom.getAnchorId(state.context)
280
295
  }),
281
296
  triggerProps: normalize.button({
282
- "data-part": "trigger",
297
+ ...parts.trigger.attrs,
283
298
  type: "button",
284
299
  "data-placement": currentPlacement,
285
300
  id: dom.getTriggerId(state.context),
@@ -296,11 +311,11 @@ function connect(state, send, normalize) {
296
311
  }),
297
312
  positionerProps: normalize.element({
298
313
  id: dom.getPositionerId(state.context),
299
- "data-part": "positioner",
314
+ ...parts.positioner.attrs,
300
315
  style: popperStyles.floating
301
316
  }),
302
317
  contentProps: normalize.element({
303
- "data-part": "content",
318
+ ...parts.content.attrs,
304
319
  id: dom.getContentId(state.context),
305
320
  tabIndex: -1,
306
321
  role: "dialog",
@@ -311,16 +326,16 @@ function connect(state, send, normalize) {
311
326
  "data-placement": currentPlacement
312
327
  }),
313
328
  titleProps: normalize.element({
314
- "data-part": "title",
329
+ ...parts.title.attrs,
315
330
  id: dom.getTitleId(state.context)
316
331
  }),
317
332
  descriptionProps: normalize.element({
318
- "data-part": "description",
333
+ ...parts.description.attrs,
319
334
  id: dom.getDescriptionId(state.context)
320
335
  }),
321
- closeButtonProps: normalize.button({
322
- "data-part": "close-button",
323
- id: dom.getCloseButtonId(state.context),
336
+ closeTriggerProps: normalize.button({
337
+ ...parts.closeTrigger.attrs,
338
+ id: dom.getCloseTriggerId(state.context),
324
339
  type: "button",
325
340
  "aria-label": "close",
326
341
  onClick() {
@@ -606,6 +621,7 @@ function machine(userContext) {
606
621
  );
607
622
  }
608
623
  export {
624
+ anatomy,
609
625
  connect,
610
626
  machine
611
627
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/popover",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "Core logic for the popover widget implemented as a state machine",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -29,13 +29,14 @@
29
29
  "url": "https://github.com/chakra-ui/zag/issues"
30
30
  },
31
31
  "dependencies": {
32
+ "focus-trap": "7.2.0",
33
+ "@zag-js/anatomy": "0.1.1",
32
34
  "@zag-js/aria-hidden": "0.2.0",
33
- "@zag-js/core": "0.2.2",
35
+ "@zag-js/core": "0.2.3",
34
36
  "@zag-js/dismissable": "0.2.0",
35
- "@zag-js/popper": "0.2.0",
37
+ "@zag-js/popper": "0.2.1",
36
38
  "@zag-js/remove-scroll": "0.2.0",
37
- "@zag-js/types": "0.3.1",
38
- "focus-trap": "7.0.0"
39
+ "@zag-js/types": "0.3.1"
39
40
  },
40
41
  "devDependencies": {
41
42
  "@zag-js/dom-utils": "0.2.1",