@zag-js/popover 0.10.5 → 0.11.1
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/{popover.types.d.ts → index.d.mts} +51 -10
- package/dist/index.d.ts +124 -4
- package/dist/index.js +410 -8
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +386 -3
- package/dist/index.mjs.map +1 -0
- package/package.json +13 -13
- package/dist/popover.anatomy.d.ts +0 -3
- package/dist/popover.anatomy.js +0 -21
- package/dist/popover.anatomy.mjs +0 -16
- package/dist/popover.connect.d.ts +0 -34
- package/dist/popover.connect.js +0 -110
- package/dist/popover.connect.mjs +0 -106
- package/dist/popover.dom.d.ts +0 -44
- package/dist/popover.dom.js +0 -41
- package/dist/popover.dom.mjs +0 -37
- package/dist/popover.machine.d.ts +0 -3
- package/dist/popover.machine.js +0 -231
- package/dist/popover.machine.mjs +0 -227
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import
|
|
1
|
+
import * as _zag_js_anatomy from '@zag-js/anatomy';
|
|
2
|
+
import { PositioningOptions } from '@zag-js/popper';
|
|
3
|
+
export { Placement, PositioningOptions } from '@zag-js/popper';
|
|
4
|
+
import { RequiredBy, CommonProperties, MaybeElement, Context, PropTypes, NormalizeProps } from '@zag-js/types';
|
|
5
|
+
import * as _zag_js_core from '@zag-js/core';
|
|
6
|
+
import { StateMachine } from '@zag-js/core';
|
|
7
|
+
import { DismissableElementHandlers } from '@zag-js/dismissable';
|
|
8
|
+
|
|
9
|
+
declare const anatomy: _zag_js_anatomy.AnatomyInstance<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "closeTrigger">;
|
|
10
|
+
|
|
5
11
|
type ElementIds = Partial<{
|
|
6
12
|
anchor: string;
|
|
7
13
|
trigger: string;
|
|
@@ -65,7 +71,7 @@ type PublicContext = DismissableElementHandlers & CommonProperties & {
|
|
|
65
71
|
*/
|
|
66
72
|
open?: boolean;
|
|
67
73
|
};
|
|
68
|
-
|
|
74
|
+
type UserDefinedContext = RequiredBy<PublicContext, "id">;
|
|
69
75
|
type ComputedContext = Readonly<{
|
|
70
76
|
/**
|
|
71
77
|
* @computed
|
|
@@ -74,10 +80,45 @@ type ComputedContext = Readonly<{
|
|
|
74
80
|
currentPortalled: boolean;
|
|
75
81
|
}>;
|
|
76
82
|
type PrivateContext = Context<{}>;
|
|
77
|
-
|
|
78
|
-
|
|
83
|
+
type MachineContext = PublicContext & ComputedContext & PrivateContext;
|
|
84
|
+
type MachineState = {
|
|
79
85
|
value: "open" | "closed";
|
|
80
86
|
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
87
|
+
type State = StateMachine.State<MachineContext, MachineState>;
|
|
88
|
+
type Send = StateMachine.Send<StateMachine.AnyEventObject>;
|
|
89
|
+
|
|
90
|
+
declare function connect<T extends PropTypes>(state: State, send: Send, normalize: NormalizeProps<T>): {
|
|
91
|
+
/**
|
|
92
|
+
* Whether the popover is portalled
|
|
93
|
+
*/
|
|
94
|
+
portalled: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Whether the popover is open
|
|
97
|
+
*/
|
|
98
|
+
isOpen: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Function to open the popover
|
|
101
|
+
*/
|
|
102
|
+
open(): void;
|
|
103
|
+
/**
|
|
104
|
+
* Function to close the popover
|
|
105
|
+
*/
|
|
106
|
+
close(): void;
|
|
107
|
+
/**
|
|
108
|
+
* Function to reposition the popover
|
|
109
|
+
*/
|
|
110
|
+
setPositioning(options?: Partial<PositioningOptions>): void;
|
|
111
|
+
arrowProps: T["element"];
|
|
112
|
+
arrowTipProps: T["element"];
|
|
113
|
+
anchorProps: T["element"];
|
|
114
|
+
triggerProps: T["button"];
|
|
115
|
+
positionerProps: T["element"];
|
|
116
|
+
contentProps: T["element"];
|
|
117
|
+
titleProps: T["element"];
|
|
118
|
+
descriptionProps: T["element"];
|
|
119
|
+
closeTriggerProps: T["button"];
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
declare function machine(userContext: UserDefinedContext): _zag_js_core.Machine<MachineContext, MachineState, _zag_js_core.StateMachine.AnyEventObject>;
|
|
123
|
+
|
|
124
|
+
export { UserDefinedContext as Context, anatomy, connect, machine };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,124 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
|
|
1
|
+
import * as _zag_js_anatomy from '@zag-js/anatomy';
|
|
2
|
+
import { PositioningOptions } from '@zag-js/popper';
|
|
3
|
+
export { Placement, PositioningOptions } from '@zag-js/popper';
|
|
4
|
+
import { RequiredBy, CommonProperties, MaybeElement, Context, PropTypes, NormalizeProps } from '@zag-js/types';
|
|
5
|
+
import * as _zag_js_core from '@zag-js/core';
|
|
6
|
+
import { StateMachine } from '@zag-js/core';
|
|
7
|
+
import { DismissableElementHandlers } from '@zag-js/dismissable';
|
|
8
|
+
|
|
9
|
+
declare const anatomy: _zag_js_anatomy.AnatomyInstance<"arrow" | "arrowTip" | "anchor" | "trigger" | "positioner" | "content" | "title" | "description" | "closeTrigger">;
|
|
10
|
+
|
|
11
|
+
type ElementIds = Partial<{
|
|
12
|
+
anchor: string;
|
|
13
|
+
trigger: string;
|
|
14
|
+
content: string;
|
|
15
|
+
title: string;
|
|
16
|
+
description: string;
|
|
17
|
+
closeTrigger: string;
|
|
18
|
+
positioner: string;
|
|
19
|
+
arrow: string;
|
|
20
|
+
}>;
|
|
21
|
+
type PublicContext = DismissableElementHandlers & CommonProperties & {
|
|
22
|
+
/**
|
|
23
|
+
* The ids of the elements in the popover. Useful for composition.
|
|
24
|
+
*/
|
|
25
|
+
ids?: ElementIds;
|
|
26
|
+
/**
|
|
27
|
+
* Whether the popover should be modal. When set to `true`:
|
|
28
|
+
* - interaction with outside elements will be disabled
|
|
29
|
+
* - only popover content will be visible to screen readers
|
|
30
|
+
* - scrolling is blocked
|
|
31
|
+
* - focus is trapped within the popover
|
|
32
|
+
*
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
modal?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the popover is rendered in a portal
|
|
38
|
+
*/
|
|
39
|
+
portalled?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Whether to automatically set focus on the first focusable
|
|
42
|
+
* content within the popover when opened.
|
|
43
|
+
*/
|
|
44
|
+
autoFocus?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* The element to focus on when the popover is opened.
|
|
47
|
+
*/
|
|
48
|
+
initialFocusEl?: MaybeElement | (() => MaybeElement);
|
|
49
|
+
/**
|
|
50
|
+
* Whether to close the popover when the user clicks outside of the popover.
|
|
51
|
+
*/
|
|
52
|
+
closeOnInteractOutside?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Whether to close the popover when the escape key is pressed.
|
|
55
|
+
*/
|
|
56
|
+
closeOnEsc?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Function invoked when the popover is closed
|
|
59
|
+
*/
|
|
60
|
+
onClose?: VoidFunction;
|
|
61
|
+
/**
|
|
62
|
+
* Function invoked when the popover is opened
|
|
63
|
+
*/
|
|
64
|
+
onOpen?: VoidFunction;
|
|
65
|
+
/**
|
|
66
|
+
* The user provided options used to position the popover content
|
|
67
|
+
*/
|
|
68
|
+
positioning: PositioningOptions;
|
|
69
|
+
/**
|
|
70
|
+
* Whether the popover is open
|
|
71
|
+
*/
|
|
72
|
+
open?: boolean;
|
|
73
|
+
};
|
|
74
|
+
type UserDefinedContext = RequiredBy<PublicContext, "id">;
|
|
75
|
+
type ComputedContext = Readonly<{
|
|
76
|
+
/**
|
|
77
|
+
* @computed
|
|
78
|
+
* The computed value of `portalled`
|
|
79
|
+
*/
|
|
80
|
+
currentPortalled: boolean;
|
|
81
|
+
}>;
|
|
82
|
+
type PrivateContext = Context<{}>;
|
|
83
|
+
type MachineContext = PublicContext & ComputedContext & PrivateContext;
|
|
84
|
+
type MachineState = {
|
|
85
|
+
value: "open" | "closed";
|
|
86
|
+
};
|
|
87
|
+
type State = StateMachine.State<MachineContext, MachineState>;
|
|
88
|
+
type Send = StateMachine.Send<StateMachine.AnyEventObject>;
|
|
89
|
+
|
|
90
|
+
declare function connect<T extends PropTypes>(state: State, send: Send, normalize: NormalizeProps<T>): {
|
|
91
|
+
/**
|
|
92
|
+
* Whether the popover is portalled
|
|
93
|
+
*/
|
|
94
|
+
portalled: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Whether the popover is open
|
|
97
|
+
*/
|
|
98
|
+
isOpen: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Function to open the popover
|
|
101
|
+
*/
|
|
102
|
+
open(): void;
|
|
103
|
+
/**
|
|
104
|
+
* Function to close the popover
|
|
105
|
+
*/
|
|
106
|
+
close(): void;
|
|
107
|
+
/**
|
|
108
|
+
* Function to reposition the popover
|
|
109
|
+
*/
|
|
110
|
+
setPositioning(options?: Partial<PositioningOptions>): void;
|
|
111
|
+
arrowProps: T["element"];
|
|
112
|
+
arrowTipProps: T["element"];
|
|
113
|
+
anchorProps: T["element"];
|
|
114
|
+
triggerProps: T["button"];
|
|
115
|
+
positionerProps: T["element"];
|
|
116
|
+
contentProps: T["element"];
|
|
117
|
+
titleProps: T["element"];
|
|
118
|
+
descriptionProps: T["element"];
|
|
119
|
+
closeTriggerProps: T["button"];
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
declare function machine(userContext: UserDefinedContext): _zag_js_core.Machine<MachineContext, MachineState, _zag_js_core.StateMachine.AnyEventObject>;
|
|
123
|
+
|
|
124
|
+
export { UserDefinedContext as Context, anatomy, connect, machine };
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,415 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
2
19
|
|
|
3
|
-
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
anatomy: () => anatomy,
|
|
24
|
+
connect: () => connect,
|
|
25
|
+
machine: () => machine
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(src_exports);
|
|
4
28
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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();
|
|
8
43
|
|
|
44
|
+
// src/popover.connect.ts
|
|
45
|
+
var import_dom_query2 = require("@zag-js/dom-query");
|
|
46
|
+
var import_popper = require("@zag-js/popper");
|
|
9
47
|
|
|
48
|
+
// src/popover.dom.ts
|
|
49
|
+
var import_dom_query = require("@zag-js/dom-query");
|
|
50
|
+
var import_tabbable = require("@zag-js/tabbable");
|
|
51
|
+
var import_utils = require("@zag-js/utils");
|
|
52
|
+
var dom = (0, import_dom_query.createScope)({
|
|
53
|
+
getActiveEl: (ctx) => dom.getDoc(ctx).activeElement,
|
|
54
|
+
getAnchorId: (ctx) => ctx.ids?.anchor ?? `popover:${ctx.id}:anchor`,
|
|
55
|
+
getTriggerId: (ctx) => ctx.ids?.trigger ?? `popover:${ctx.id}:trigger`,
|
|
56
|
+
getContentId: (ctx) => ctx.ids?.content ?? `popover:${ctx.id}:content`,
|
|
57
|
+
getPositionerId: (ctx) => ctx.ids?.positioner ?? `popover:${ctx.id}:popper`,
|
|
58
|
+
getArrowId: (ctx) => ctx.ids?.arrow ?? `popover:${ctx.id}:arrow`,
|
|
59
|
+
getTitleId: (ctx) => ctx.ids?.title ?? `popover:${ctx.id}:title`,
|
|
60
|
+
getDescriptionId: (ctx) => ctx.ids?.description ?? `popover:${ctx.id}:desc`,
|
|
61
|
+
getCloseTriggerId: (ctx) => ctx.ids?.closeTrigger ?? `popover:${ctx.id}:close`,
|
|
62
|
+
getAnchorEl: (ctx) => dom.getById(ctx, dom.getAnchorId(ctx)),
|
|
63
|
+
getTriggerEl: (ctx) => dom.getById(ctx, dom.getTriggerId(ctx)),
|
|
64
|
+
getContentEl: (ctx) => dom.getById(ctx, dom.getContentId(ctx)),
|
|
65
|
+
getPositionerEl: (ctx) => dom.getById(ctx, dom.getPositionerId(ctx)),
|
|
66
|
+
getTitleEl: (ctx) => dom.getById(ctx, dom.getTitleId(ctx)),
|
|
67
|
+
getDescriptionEl: (ctx) => dom.getById(ctx, dom.getDescriptionId(ctx)),
|
|
68
|
+
getFocusableEls: (ctx) => (0, import_tabbable.getFocusables)(dom.getContentEl(ctx)),
|
|
69
|
+
getFirstFocusableEl: (ctx) => dom.getFocusableEls(ctx)[0],
|
|
70
|
+
getDocTabbableEls: (ctx) => (0, import_tabbable.getTabbables)(dom.getDoc(ctx).body),
|
|
71
|
+
getTabbableEls: (ctx) => (0, import_tabbable.getTabbables)(dom.getContentEl(ctx), "if-empty"),
|
|
72
|
+
getFirstTabbableEl: (ctx) => (0, import_tabbable.getFirstTabbable)(dom.getContentEl(ctx), "if-empty"),
|
|
73
|
+
getLastTabbableEl: (ctx) => (0, import_tabbable.getLastTabbable)(dom.getContentEl(ctx), "if-empty"),
|
|
74
|
+
getInitialFocusEl: (ctx) => {
|
|
75
|
+
let el = (0, import_utils.runIfFn)(ctx.initialFocusEl);
|
|
76
|
+
if (!el && ctx.autoFocus)
|
|
77
|
+
el = dom.getFirstFocusableEl(ctx);
|
|
78
|
+
if (!el)
|
|
79
|
+
el = dom.getContentEl(ctx);
|
|
80
|
+
return el;
|
|
81
|
+
}
|
|
82
|
+
});
|
|
10
83
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
84
|
+
// src/popover.connect.ts
|
|
85
|
+
function connect(state, send, normalize) {
|
|
86
|
+
const isOpen = state.matches("open");
|
|
87
|
+
const currentPlacement = state.context.currentPlacement;
|
|
88
|
+
const portalled = state.context.currentPortalled;
|
|
89
|
+
const rendered = state.context.renderedElements;
|
|
90
|
+
const popperStyles = (0, import_popper.getPlacementStyles)({
|
|
91
|
+
placement: currentPlacement
|
|
92
|
+
});
|
|
93
|
+
return {
|
|
94
|
+
/**
|
|
95
|
+
* Whether the popover is portalled
|
|
96
|
+
*/
|
|
97
|
+
portalled,
|
|
98
|
+
/**
|
|
99
|
+
* Whether the popover is open
|
|
100
|
+
*/
|
|
101
|
+
isOpen,
|
|
102
|
+
/**
|
|
103
|
+
* Function to open the popover
|
|
104
|
+
*/
|
|
105
|
+
open() {
|
|
106
|
+
send("OPEN");
|
|
107
|
+
},
|
|
108
|
+
/**
|
|
109
|
+
* Function to close the popover
|
|
110
|
+
*/
|
|
111
|
+
close() {
|
|
112
|
+
send("CLOSE");
|
|
113
|
+
},
|
|
114
|
+
/**
|
|
115
|
+
* Function to reposition the popover
|
|
116
|
+
*/
|
|
117
|
+
setPositioning(options = {}) {
|
|
118
|
+
send({ type: "SET_POSITIONING", options });
|
|
119
|
+
},
|
|
120
|
+
arrowProps: normalize.element({
|
|
121
|
+
id: dom.getArrowId(state.context),
|
|
122
|
+
...parts.arrow.attrs,
|
|
123
|
+
style: popperStyles.arrow
|
|
124
|
+
}),
|
|
125
|
+
arrowTipProps: normalize.element({
|
|
126
|
+
...parts.arrowTip.attrs,
|
|
127
|
+
style: popperStyles.arrowTip
|
|
128
|
+
}),
|
|
129
|
+
anchorProps: normalize.element({
|
|
130
|
+
...parts.anchor.attrs,
|
|
131
|
+
id: dom.getAnchorId(state.context)
|
|
132
|
+
}),
|
|
133
|
+
triggerProps: normalize.button({
|
|
134
|
+
...parts.trigger.attrs,
|
|
135
|
+
type: "button",
|
|
136
|
+
"data-placement": currentPlacement,
|
|
137
|
+
id: dom.getTriggerId(state.context),
|
|
138
|
+
"aria-haspopup": "dialog",
|
|
139
|
+
"aria-expanded": isOpen,
|
|
140
|
+
"data-expanded": (0, import_dom_query2.dataAttr)(isOpen),
|
|
141
|
+
"aria-controls": dom.getContentId(state.context),
|
|
142
|
+
onClick() {
|
|
143
|
+
send("TOGGLE");
|
|
144
|
+
},
|
|
145
|
+
onBlur(event) {
|
|
146
|
+
send({ type: "TRIGGER_BLUR", target: event.relatedTarget });
|
|
147
|
+
}
|
|
148
|
+
}),
|
|
149
|
+
positionerProps: normalize.element({
|
|
150
|
+
id: dom.getPositionerId(state.context),
|
|
151
|
+
...parts.positioner.attrs,
|
|
152
|
+
style: popperStyles.floating
|
|
153
|
+
}),
|
|
154
|
+
contentProps: normalize.element({
|
|
155
|
+
...parts.content.attrs,
|
|
156
|
+
id: dom.getContentId(state.context),
|
|
157
|
+
tabIndex: -1,
|
|
158
|
+
role: "dialog",
|
|
159
|
+
hidden: !isOpen,
|
|
160
|
+
"data-expanded": (0, import_dom_query2.dataAttr)(isOpen),
|
|
161
|
+
"aria-labelledby": rendered.title ? dom.getTitleId(state.context) : void 0,
|
|
162
|
+
"aria-describedby": rendered.description ? dom.getDescriptionId(state.context) : void 0,
|
|
163
|
+
"data-placement": currentPlacement
|
|
164
|
+
}),
|
|
165
|
+
titleProps: normalize.element({
|
|
166
|
+
...parts.title.attrs,
|
|
167
|
+
id: dom.getTitleId(state.context)
|
|
168
|
+
}),
|
|
169
|
+
descriptionProps: normalize.element({
|
|
170
|
+
...parts.description.attrs,
|
|
171
|
+
id: dom.getDescriptionId(state.context)
|
|
172
|
+
}),
|
|
173
|
+
closeTriggerProps: normalize.button({
|
|
174
|
+
...parts.closeTrigger.attrs,
|
|
175
|
+
id: dom.getCloseTriggerId(state.context),
|
|
176
|
+
type: "button",
|
|
177
|
+
"aria-label": "close",
|
|
178
|
+
onClick() {
|
|
179
|
+
send("REQUEST_CLOSE");
|
|
180
|
+
}
|
|
181
|
+
})
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// src/popover.machine.ts
|
|
186
|
+
var import_aria_hidden = require("@zag-js/aria-hidden");
|
|
187
|
+
var import_core = require("@zag-js/core");
|
|
188
|
+
var import_dismissable = require("@zag-js/dismissable");
|
|
189
|
+
var import_dom_query3 = require("@zag-js/dom-query");
|
|
190
|
+
var import_popper2 = require("@zag-js/popper");
|
|
191
|
+
var import_remove_scroll = require("@zag-js/remove-scroll");
|
|
192
|
+
var import_tabbable2 = require("@zag-js/tabbable");
|
|
193
|
+
var import_utils2 = require("@zag-js/utils");
|
|
194
|
+
var import_focus_trap = require("focus-trap");
|
|
195
|
+
function machine(userContext) {
|
|
196
|
+
const ctx = (0, import_utils2.compact)(userContext);
|
|
197
|
+
return (0, import_core.createMachine)(
|
|
198
|
+
{
|
|
199
|
+
id: "popover",
|
|
200
|
+
initial: ctx.open ? "open" : "closed",
|
|
201
|
+
context: {
|
|
202
|
+
closeOnInteractOutside: true,
|
|
203
|
+
closeOnEsc: true,
|
|
204
|
+
autoFocus: true,
|
|
205
|
+
modal: false,
|
|
206
|
+
positioning: {
|
|
207
|
+
placement: "bottom",
|
|
208
|
+
...ctx.positioning
|
|
209
|
+
},
|
|
210
|
+
currentPlacement: void 0,
|
|
211
|
+
...ctx,
|
|
212
|
+
renderedElements: {
|
|
213
|
+
title: true,
|
|
214
|
+
description: true
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
computed: {
|
|
218
|
+
currentPortalled: (ctx2) => !!ctx2.modal || !!ctx2.portalled
|
|
219
|
+
},
|
|
220
|
+
watch: {
|
|
221
|
+
open: ["toggleVisibility"]
|
|
222
|
+
},
|
|
223
|
+
entry: ["checkRenderedElements"],
|
|
224
|
+
states: {
|
|
225
|
+
closed: {
|
|
226
|
+
on: {
|
|
227
|
+
TOGGLE: {
|
|
228
|
+
target: "open",
|
|
229
|
+
actions: ["invokeOnOpen"]
|
|
230
|
+
},
|
|
231
|
+
OPEN: {
|
|
232
|
+
target: "open",
|
|
233
|
+
actions: ["invokeOnOpen"]
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
open: {
|
|
238
|
+
activities: [
|
|
239
|
+
"trapFocus",
|
|
240
|
+
"preventScroll",
|
|
241
|
+
"hideContentBelow",
|
|
242
|
+
"trackPositioning",
|
|
243
|
+
"trackDismissableElement",
|
|
244
|
+
"proxyTabFocus"
|
|
245
|
+
],
|
|
246
|
+
entry: ["setInitialFocus"],
|
|
247
|
+
on: {
|
|
248
|
+
CLOSE: {
|
|
249
|
+
target: "closed",
|
|
250
|
+
actions: ["invokeOnClose"]
|
|
251
|
+
},
|
|
252
|
+
REQUEST_CLOSE: {
|
|
253
|
+
target: "closed",
|
|
254
|
+
actions: ["restoreFocusIfNeeded", "invokeOnClose"]
|
|
255
|
+
},
|
|
256
|
+
TOGGLE: {
|
|
257
|
+
target: "closed",
|
|
258
|
+
actions: ["invokeOnClose"]
|
|
259
|
+
},
|
|
260
|
+
SET_POSITIONING: {
|
|
261
|
+
actions: "setPositioning"
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
activities: {
|
|
269
|
+
trackPositioning(ctx2) {
|
|
270
|
+
ctx2.currentPlacement = ctx2.positioning.placement;
|
|
271
|
+
const anchorEl = dom.getAnchorEl(ctx2) ?? dom.getTriggerEl(ctx2);
|
|
272
|
+
const getPositionerEl = () => dom.getPositionerEl(ctx2);
|
|
273
|
+
return (0, import_popper2.getPlacement)(anchorEl, getPositionerEl, {
|
|
274
|
+
...ctx2.positioning,
|
|
275
|
+
defer: true,
|
|
276
|
+
onComplete(data) {
|
|
277
|
+
ctx2.currentPlacement = data.placement;
|
|
278
|
+
},
|
|
279
|
+
onCleanup() {
|
|
280
|
+
ctx2.currentPlacement = void 0;
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
},
|
|
284
|
+
trackDismissableElement(ctx2, _evt, { send }) {
|
|
285
|
+
const getContentEl = () => dom.getContentEl(ctx2);
|
|
286
|
+
let restoreFocus = true;
|
|
287
|
+
return (0, import_dismissable.trackDismissableElement)(getContentEl, {
|
|
288
|
+
pointerBlocking: ctx2.modal,
|
|
289
|
+
exclude: dom.getTriggerEl(ctx2),
|
|
290
|
+
defer: true,
|
|
291
|
+
onEscapeKeyDown(event) {
|
|
292
|
+
ctx2.onEscapeKeyDown?.(event);
|
|
293
|
+
if (ctx2.closeOnEsc)
|
|
294
|
+
return;
|
|
295
|
+
event.preventDefault();
|
|
296
|
+
},
|
|
297
|
+
onInteractOutside(event) {
|
|
298
|
+
ctx2.onInteractOutside?.(event);
|
|
299
|
+
if (event.defaultPrevented)
|
|
300
|
+
return;
|
|
301
|
+
restoreFocus = !(event.detail.focusable || event.detail.contextmenu);
|
|
302
|
+
if (!ctx2.closeOnInteractOutside) {
|
|
303
|
+
event.preventDefault();
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
onPointerDownOutside(event) {
|
|
307
|
+
ctx2.onPointerDownOutside?.(event);
|
|
308
|
+
},
|
|
309
|
+
onFocusOutside(event) {
|
|
310
|
+
ctx2.onFocusOutside?.(event);
|
|
311
|
+
},
|
|
312
|
+
onDismiss() {
|
|
313
|
+
send({ type: "REQUEST_CLOSE", src: "interact-outside", restoreFocus });
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
},
|
|
317
|
+
proxyTabFocus(ctx2) {
|
|
318
|
+
if (ctx2.modal || !ctx2.portalled)
|
|
319
|
+
return;
|
|
320
|
+
const getContentEl = () => dom.getContentEl(ctx2);
|
|
321
|
+
return (0, import_tabbable2.proxyTabFocus)(getContentEl, {
|
|
322
|
+
triggerElement: dom.getTriggerEl(ctx2),
|
|
323
|
+
defer: true,
|
|
324
|
+
onFocus(el) {
|
|
325
|
+
el.focus({ preventScroll: true });
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
},
|
|
329
|
+
hideContentBelow(ctx2) {
|
|
330
|
+
if (!ctx2.modal)
|
|
331
|
+
return;
|
|
332
|
+
const getElements = () => [dom.getContentEl(ctx2), dom.getTriggerEl(ctx2)];
|
|
333
|
+
return (0, import_aria_hidden.ariaHidden)(getElements, { defer: true });
|
|
334
|
+
},
|
|
335
|
+
preventScroll(ctx2) {
|
|
336
|
+
if (!ctx2.modal)
|
|
337
|
+
return;
|
|
338
|
+
return (0, import_remove_scroll.preventBodyScroll)(dom.getDoc(ctx2));
|
|
339
|
+
},
|
|
340
|
+
trapFocus(ctx2) {
|
|
341
|
+
if (!ctx2.modal)
|
|
342
|
+
return;
|
|
343
|
+
let trap;
|
|
344
|
+
(0, import_dom_query3.nextTick)(() => {
|
|
345
|
+
const el = dom.getContentEl(ctx2);
|
|
346
|
+
if (!el)
|
|
347
|
+
return;
|
|
348
|
+
trap = (0, import_focus_trap.createFocusTrap)(el, {
|
|
349
|
+
escapeDeactivates: false,
|
|
350
|
+
allowOutsideClick: true,
|
|
351
|
+
preventScroll: true,
|
|
352
|
+
returnFocusOnDeactivate: true,
|
|
353
|
+
document: dom.getDoc(ctx2),
|
|
354
|
+
fallbackFocus: el,
|
|
355
|
+
initialFocus: (0, import_utils2.runIfFn)(ctx2.initialFocusEl)
|
|
356
|
+
});
|
|
357
|
+
try {
|
|
358
|
+
trap.activate();
|
|
359
|
+
} catch {
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
return () => trap?.deactivate();
|
|
363
|
+
}
|
|
364
|
+
},
|
|
365
|
+
actions: {
|
|
366
|
+
setPositioning(ctx2, evt) {
|
|
367
|
+
const anchorEl = dom.getAnchorEl(ctx2) ?? dom.getTriggerEl(ctx2);
|
|
368
|
+
const getPositionerEl = () => dom.getPositionerEl(ctx2);
|
|
369
|
+
(0, import_popper2.getPlacement)(anchorEl, getPositionerEl, {
|
|
370
|
+
...ctx2.positioning,
|
|
371
|
+
...evt.options,
|
|
372
|
+
defer: true,
|
|
373
|
+
listeners: false
|
|
374
|
+
});
|
|
375
|
+
},
|
|
376
|
+
checkRenderedElements(ctx2) {
|
|
377
|
+
(0, import_dom_query3.raf)(() => {
|
|
378
|
+
Object.assign(ctx2.renderedElements, {
|
|
379
|
+
title: !!dom.getTitleEl(ctx2),
|
|
380
|
+
description: !!dom.getDescriptionEl(ctx2)
|
|
381
|
+
});
|
|
382
|
+
});
|
|
383
|
+
},
|
|
384
|
+
setInitialFocus(ctx2) {
|
|
385
|
+
(0, import_dom_query3.raf)(() => {
|
|
386
|
+
dom.getInitialFocusEl(ctx2)?.focus({ preventScroll: true });
|
|
387
|
+
});
|
|
388
|
+
},
|
|
389
|
+
restoreFocusIfNeeded(ctx2, evt) {
|
|
390
|
+
if (!evt.restoreFocus)
|
|
391
|
+
return;
|
|
392
|
+
(0, import_dom_query3.raf)(() => {
|
|
393
|
+
dom.getTriggerEl(ctx2)?.focus({ preventScroll: true });
|
|
394
|
+
});
|
|
395
|
+
},
|
|
396
|
+
invokeOnOpen(ctx2) {
|
|
397
|
+
ctx2.onOpen?.();
|
|
398
|
+
},
|
|
399
|
+
invokeOnClose(ctx2) {
|
|
400
|
+
ctx2.onClose?.();
|
|
401
|
+
},
|
|
402
|
+
toggleVisibility(ctx2, _evt, { send }) {
|
|
403
|
+
send({ type: ctx2.open ? "OPEN" : "CLOSE", src: "controlled" });
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
);
|
|
408
|
+
}
|
|
409
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
410
|
+
0 && (module.exports = {
|
|
411
|
+
anatomy,
|
|
412
|
+
connect,
|
|
413
|
+
machine
|
|
414
|
+
});
|
|
415
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/popover.anatomy.ts","../src/popover.connect.ts","../src/popover.dom.ts","../src/popover.machine.ts"],"sourcesContent":["export { anatomy } from \"./popover.anatomy\"\nexport { connect } from \"./popover.connect\"\nexport { machine } from \"./popover.machine\"\nexport type { UserDefinedContext as Context, Placement, PositioningOptions } from \"./popover.types\"\n","import { createAnatomy } from \"@zag-js/anatomy\"\n\nexport const anatomy = createAnatomy(\"popover\").parts(\n \"arrow\",\n \"arrowTip\",\n \"anchor\",\n \"trigger\",\n \"positioner\",\n \"content\",\n \"title\",\n \"description\",\n \"closeTrigger\",\n)\nexport const parts = anatomy.build()\n","import { dataAttr } from \"@zag-js/dom-query\"\nimport type { PositioningOptions } from \"@zag-js/popper\"\nimport { getPlacementStyles } from \"@zag-js/popper\"\nimport type { NormalizeProps, PropTypes } from \"@zag-js/types\"\nimport { parts } from \"./popover.anatomy\"\nimport { dom } from \"./popover.dom\"\nimport type { Send, State } from \"./popover.types\"\n\nexport function connect<T extends PropTypes>(state: State, send: Send, normalize: NormalizeProps<T>) {\n const isOpen = state.matches(\"open\")\n\n const currentPlacement = state.context.currentPlacement\n const portalled = state.context.currentPortalled\n const rendered = state.context.renderedElements\n\n const popperStyles = getPlacementStyles({\n placement: currentPlacement,\n })\n\n return {\n /**\n * Whether the popover is portalled\n */\n portalled,\n /**\n * Whether the popover is open\n */\n isOpen,\n /**\n * Function to open the popover\n */\n open() {\n send(\"OPEN\")\n },\n /**\n * Function to close the popover\n */\n close() {\n send(\"CLOSE\")\n },\n /**\n * Function to reposition the popover\n */\n setPositioning(options: Partial<PositioningOptions> = {}) {\n send({ type: \"SET_POSITIONING\", options })\n },\n\n arrowProps: normalize.element({\n id: dom.getArrowId(state.context),\n ...parts.arrow.attrs,\n style: popperStyles.arrow,\n }),\n\n arrowTipProps: normalize.element({\n ...parts.arrowTip.attrs,\n style: popperStyles.arrowTip,\n }),\n\n anchorProps: normalize.element({\n ...parts.anchor.attrs,\n id: dom.getAnchorId(state.context),\n }),\n\n triggerProps: normalize.button({\n ...parts.trigger.attrs,\n type: \"button\",\n \"data-placement\": currentPlacement,\n id: dom.getTriggerId(state.context),\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": isOpen,\n \"data-expanded\": dataAttr(isOpen),\n \"aria-controls\": dom.getContentId(state.context),\n onClick() {\n send(\"TOGGLE\")\n },\n onBlur(event) {\n send({ type: \"TRIGGER_BLUR\", target: event.relatedTarget })\n },\n }),\n\n positionerProps: normalize.element({\n id: dom.getPositionerId(state.context),\n ...parts.positioner.attrs,\n style: popperStyles.floating,\n }),\n\n contentProps: normalize.element({\n ...parts.content.attrs,\n id: dom.getContentId(state.context),\n tabIndex: -1,\n role: \"dialog\",\n hidden: !isOpen,\n \"data-expanded\": dataAttr(isOpen),\n \"aria-labelledby\": rendered.title ? dom.getTitleId(state.context) : undefined,\n \"aria-describedby\": rendered.description ? dom.getDescriptionId(state.context) : undefined,\n \"data-placement\": currentPlacement,\n }),\n\n titleProps: normalize.element({\n ...parts.title.attrs,\n id: dom.getTitleId(state.context),\n }),\n\n descriptionProps: normalize.element({\n ...parts.description.attrs,\n id: dom.getDescriptionId(state.context),\n }),\n\n closeTriggerProps: normalize.button({\n ...parts.closeTrigger.attrs,\n id: dom.getCloseTriggerId(state.context),\n type: \"button\",\n \"aria-label\": \"close\",\n onClick() {\n send(\"REQUEST_CLOSE\")\n },\n }),\n }\n}\n","import { createScope } from \"@zag-js/dom-query\"\nimport { getFirstTabbable, getFocusables, getLastTabbable, getTabbables } from \"@zag-js/tabbable\"\nimport { runIfFn } from \"@zag-js/utils\"\nimport type { MachineContext as Ctx } from \"./popover.types\"\n\nexport const dom = createScope({\n getActiveEl: (ctx: Ctx) => dom.getDoc(ctx).activeElement,\n\n getAnchorId: (ctx: Ctx) => ctx.ids?.anchor ?? `popover:${ctx.id}:anchor`,\n getTriggerId: (ctx: Ctx) => ctx.ids?.trigger ?? `popover:${ctx.id}:trigger`,\n getContentId: (ctx: Ctx) => ctx.ids?.content ?? `popover:${ctx.id}:content`,\n getPositionerId: (ctx: Ctx) => ctx.ids?.positioner ?? `popover:${ctx.id}:popper`,\n getArrowId: (ctx: Ctx) => ctx.ids?.arrow ?? `popover:${ctx.id}:arrow`,\n getTitleId: (ctx: Ctx) => ctx.ids?.title ?? `popover:${ctx.id}:title`,\n getDescriptionId: (ctx: Ctx) => ctx.ids?.description ?? `popover:${ctx.id}:desc`,\n getCloseTriggerId: (ctx: Ctx) => ctx.ids?.closeTrigger ?? `popover:${ctx.id}:close`,\n\n getAnchorEl: (ctx: Ctx) => dom.getById(ctx, dom.getAnchorId(ctx)),\n getTriggerEl: (ctx: Ctx) => dom.getById(ctx, dom.getTriggerId(ctx)),\n getContentEl: (ctx: Ctx) => dom.getById(ctx, dom.getContentId(ctx)),\n getPositionerEl: (ctx: Ctx) => dom.getById(ctx, dom.getPositionerId(ctx)),\n getTitleEl: (ctx: Ctx) => dom.getById(ctx, dom.getTitleId(ctx)),\n getDescriptionEl: (ctx: Ctx) => dom.getById(ctx, dom.getDescriptionId(ctx)),\n\n getFocusableEls: (ctx: Ctx) => getFocusables(dom.getContentEl(ctx)),\n getFirstFocusableEl: (ctx: Ctx) => dom.getFocusableEls(ctx)[0],\n\n getDocTabbableEls: (ctx: Ctx) => getTabbables(dom.getDoc(ctx).body),\n getTabbableEls: (ctx: Ctx) => getTabbables(dom.getContentEl(ctx), \"if-empty\"),\n getFirstTabbableEl: (ctx: Ctx) => getFirstTabbable(dom.getContentEl(ctx), \"if-empty\"),\n getLastTabbableEl: (ctx: Ctx) => getLastTabbable(dom.getContentEl(ctx), \"if-empty\"),\n\n getInitialFocusEl: (ctx: Ctx) => {\n let el: HTMLElement | null = runIfFn(ctx.initialFocusEl)\n if (!el && ctx.autoFocus) el = dom.getFirstFocusableEl(ctx)\n if (!el) el = dom.getContentEl(ctx)\n return el\n },\n})\n","import { ariaHidden } from \"@zag-js/aria-hidden\"\nimport { createMachine } from \"@zag-js/core\"\nimport { trackDismissableElement } from \"@zag-js/dismissable\"\nimport { nextTick, raf } from \"@zag-js/dom-query\"\nimport { getPlacement } from \"@zag-js/popper\"\nimport { preventBodyScroll } from \"@zag-js/remove-scroll\"\nimport { proxyTabFocus } from \"@zag-js/tabbable\"\nimport { compact, runIfFn } from \"@zag-js/utils\"\nimport { FocusTrap, createFocusTrap } from \"focus-trap\"\nimport { dom } from \"./popover.dom\"\nimport type { MachineContext, MachineState, UserDefinedContext } from \"./popover.types\"\n\nexport function machine(userContext: UserDefinedContext) {\n const ctx = compact(userContext)\n return createMachine<MachineContext, MachineState>(\n {\n id: \"popover\",\n initial: ctx.open ? \"open\" : \"closed\",\n context: {\n closeOnInteractOutside: true,\n closeOnEsc: true,\n autoFocus: true,\n modal: false,\n positioning: {\n placement: \"bottom\",\n ...ctx.positioning,\n },\n currentPlacement: undefined,\n ...ctx,\n renderedElements: {\n title: true,\n description: true,\n },\n },\n\n computed: {\n currentPortalled: (ctx) => !!ctx.modal || !!ctx.portalled,\n },\n\n watch: {\n open: [\"toggleVisibility\"],\n },\n\n entry: [\"checkRenderedElements\"],\n\n states: {\n closed: {\n on: {\n TOGGLE: {\n target: \"open\",\n actions: [\"invokeOnOpen\"],\n },\n OPEN: {\n target: \"open\",\n actions: [\"invokeOnOpen\"],\n },\n },\n },\n\n open: {\n activities: [\n \"trapFocus\",\n \"preventScroll\",\n \"hideContentBelow\",\n \"trackPositioning\",\n \"trackDismissableElement\",\n \"proxyTabFocus\",\n ],\n entry: [\"setInitialFocus\"],\n on: {\n CLOSE: {\n target: \"closed\",\n actions: [\"invokeOnClose\"],\n },\n REQUEST_CLOSE: {\n target: \"closed\",\n actions: [\"restoreFocusIfNeeded\", \"invokeOnClose\"],\n },\n TOGGLE: {\n target: \"closed\",\n actions: [\"invokeOnClose\"],\n },\n SET_POSITIONING: {\n actions: \"setPositioning\",\n },\n },\n },\n },\n },\n {\n activities: {\n trackPositioning(ctx) {\n ctx.currentPlacement = ctx.positioning.placement\n const anchorEl = dom.getAnchorEl(ctx) ?? dom.getTriggerEl(ctx)\n const getPositionerEl = () => dom.getPositionerEl(ctx)\n return getPlacement(anchorEl, getPositionerEl, {\n ...ctx.positioning,\n defer: true,\n onComplete(data) {\n ctx.currentPlacement = data.placement\n },\n onCleanup() {\n ctx.currentPlacement = undefined\n },\n })\n },\n trackDismissableElement(ctx, _evt, { send }) {\n const getContentEl = () => dom.getContentEl(ctx)\n let restoreFocus = true\n return trackDismissableElement(getContentEl, {\n pointerBlocking: ctx.modal,\n exclude: dom.getTriggerEl(ctx),\n defer: true,\n onEscapeKeyDown(event) {\n ctx.onEscapeKeyDown?.(event)\n if (ctx.closeOnEsc) return\n event.preventDefault()\n },\n onInteractOutside(event) {\n ctx.onInteractOutside?.(event)\n if (event.defaultPrevented) return\n restoreFocus = !(event.detail.focusable || event.detail.contextmenu)\n if (!ctx.closeOnInteractOutside) {\n event.preventDefault()\n }\n },\n onPointerDownOutside(event) {\n ctx.onPointerDownOutside?.(event)\n },\n onFocusOutside(event) {\n ctx.onFocusOutside?.(event)\n },\n onDismiss() {\n send({ type: \"REQUEST_CLOSE\", src: \"interact-outside\", restoreFocus })\n },\n })\n },\n proxyTabFocus(ctx) {\n if (ctx.modal || !ctx.portalled) return\n const getContentEl = () => dom.getContentEl(ctx)\n return proxyTabFocus(getContentEl, {\n triggerElement: dom.getTriggerEl(ctx),\n defer: true,\n onFocus(el) {\n el.focus({ preventScroll: true })\n },\n })\n },\n hideContentBelow(ctx) {\n if (!ctx.modal) return\n const getElements = () => [dom.getContentEl(ctx), dom.getTriggerEl(ctx)]\n return ariaHidden(getElements, { defer: true })\n },\n preventScroll(ctx) {\n if (!ctx.modal) return\n return preventBodyScroll(dom.getDoc(ctx))\n },\n trapFocus(ctx) {\n if (!ctx.modal) return\n let trap: FocusTrap | undefined\n nextTick(() => {\n const el = dom.getContentEl(ctx)\n if (!el) return\n trap = createFocusTrap(el, {\n escapeDeactivates: false,\n allowOutsideClick: true,\n preventScroll: true,\n returnFocusOnDeactivate: true,\n document: dom.getDoc(ctx),\n fallbackFocus: el,\n initialFocus: runIfFn(ctx.initialFocusEl),\n })\n try {\n trap.activate()\n } catch {}\n })\n return () => trap?.deactivate()\n },\n },\n actions: {\n setPositioning(ctx, evt) {\n const anchorEl = dom.getAnchorEl(ctx) ?? dom.getTriggerEl(ctx)\n const getPositionerEl = () => dom.getPositionerEl(ctx)\n getPlacement(anchorEl, getPositionerEl, {\n ...ctx.positioning,\n ...evt.options,\n defer: true,\n listeners: false,\n })\n },\n checkRenderedElements(ctx) {\n raf(() => {\n Object.assign(ctx.renderedElements, {\n title: !!dom.getTitleEl(ctx),\n description: !!dom.getDescriptionEl(ctx),\n })\n })\n },\n setInitialFocus(ctx) {\n raf(() => {\n dom.getInitialFocusEl(ctx)?.focus({ preventScroll: true })\n })\n },\n restoreFocusIfNeeded(ctx, evt) {\n if (!evt.restoreFocus) return\n raf(() => {\n dom.getTriggerEl(ctx)?.focus({ preventScroll: true })\n })\n },\n invokeOnOpen(ctx) {\n ctx.onOpen?.()\n },\n invokeOnClose(ctx) {\n ctx.onClose?.()\n },\n toggleVisibility(ctx, _evt, { send }) {\n send({ type: ctx.open ? \"OPEN\" : \"CLOSE\", src: \"controlled\" })\n },\n },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CAAC,CAAC,IAAI,WAAWA,IAAG;AAAA,cAC3B,aAAa,CAAC,CAAC,IAAI,iBAAiBA,IAAG;AAAA,YACzC,CAAC;AAAA,UACH,CAAC;AAAA,QACH;AAAA,QACA,gBAAgBA,MAAK;AACnB,qCAAI,MAAM;AACR,gBAAI,kBAAkBA,IAAG,GAAG,MAAM,EAAE,eAAe,KAAK,CAAC;AAAA,UAC3D,CAAC;AAAA,QACH;AAAA,QACA,qBAAqBA,MAAK,KAAK;AAC7B,cAAI,CAAC,IAAI;AAAc;AACvB,qCAAI,MAAM;AACR,gBAAI,aAAaA,IAAG,GAAG,MAAM,EAAE,eAAe,KAAK,CAAC;AAAA,UACtD,CAAC;AAAA,QACH;AAAA,QACA,aAAaA,MAAK;AAChB,UAAAA,KAAI,SAAS;AAAA,QACf;AAAA,QACA,cAAcA,MAAK;AACjB,UAAAA,KAAI,UAAU;AAAA,QAChB;AAAA,QACA,iBAAiBA,MAAK,MAAM,EAAE,KAAK,GAAG;AACpC,eAAK,EAAE,MAAMA,KAAI,OAAO,SAAS,SAAS,KAAK,aAAa,CAAC;AAAA,QAC/D;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;","names":["import_dom_query","import_dom_query","import_popper","import_tabbable","import_utils","ctx"]}
|