@zag-js/popover 1.47.0 → 1.48.0
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.mts +7 -10
- package/dist/index.d.ts +7 -10
- package/dist/index.js +12 -38
- package/dist/index.mjs +2 -7
- package/dist/popover.anatomy.d.mts +2 -6
- package/dist/popover.anatomy.d.ts +2 -6
- package/dist/popover.anatomy.js +8 -44
- package/dist/popover.anatomy.mjs +4 -18
- package/dist/popover.connect.d.mts +3 -9
- package/dist/popover.connect.d.ts +3 -9
- package/dist/popover.connect.js +164 -187
- package/dist/popover.connect.mjs +158 -150
- package/dist/popover.dom.d.mts +19 -22
- package/dist/popover.dom.d.ts +19 -22
- package/dist/popover.dom.js +47 -89
- package/dist/popover.dom.mjs +25 -46
- package/dist/popover.machine.d.mts +2 -9
- package/dist/popover.machine.d.ts +2 -9
- package/dist/popover.machine.js +297 -339
- package/dist/popover.machine.mjs +289 -300
- package/dist/popover.props.d.mts +3 -10
- package/dist/popover.props.d.ts +3 -10
- package/dist/popover.props.js +35 -60
- package/dist/popover.props.mjs +31 -34
- package/dist/popover.types.d.mts +185 -188
- package/dist/popover.types.d.ts +185 -188
- package/dist/popover.types.js +4 -18
- package/dist/popover.types.mjs +1 -0
- package/package.json +13 -13
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export { Placement, PositioningOptions
|
|
8
|
-
import '@zag-js/anatomy';
|
|
9
|
-
import '@zag-js/types';
|
|
10
|
-
import '@zag-js/core';
|
|
1
|
+
import { anatomy } from "./popover.anatomy.mjs";
|
|
2
|
+
import { connect } from "./popover.connect.mjs";
|
|
3
|
+
import { machine } from "./popover.machine.mjs";
|
|
4
|
+
import { props, splitProps } from "./popover.props.mjs";
|
|
5
|
+
import { ElementIds, IntlTranslations, OpenChangeDetails, Placement, PopoverApi, PopoverMachine, PopoverProps, PopoverService, PositioningOptions, TriggerProps, TriggerValueChangeDetails } from "./popover.types.mjs";
|
|
6
|
+
import { FocusOutsideEvent, InteractOutsideEvent, PointerDownOutsideEvent } from "@zag-js/dismissable";
|
|
7
|
+
export { type PopoverApi as Api, type ElementIds, type FocusOutsideEvent, type InteractOutsideEvent, type IntlTranslations, type PopoverMachine as Machine, type OpenChangeDetails, type Placement, type PointerDownOutsideEvent, type PositioningOptions, type PopoverProps as Props, type PopoverService as Service, type TriggerProps, type TriggerValueChangeDetails, anatomy, connect, machine, props, splitProps };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export { Placement, PositioningOptions
|
|
8
|
-
import '@zag-js/anatomy';
|
|
9
|
-
import '@zag-js/types';
|
|
10
|
-
import '@zag-js/core';
|
|
1
|
+
import { anatomy } from "./popover.anatomy.js";
|
|
2
|
+
import { connect } from "./popover.connect.js";
|
|
3
|
+
import { machine } from "./popover.machine.js";
|
|
4
|
+
import { props, splitProps } from "./popover.props.js";
|
|
5
|
+
import { ElementIds, IntlTranslations, OpenChangeDetails, Placement, PopoverApi, PopoverMachine, PopoverProps, PopoverService, PositioningOptions, TriggerProps, TriggerValueChangeDetails } from "./popover.types.js";
|
|
6
|
+
import { FocusOutsideEvent, InteractOutsideEvent, PointerDownOutsideEvent } from "@zag-js/dismissable";
|
|
7
|
+
export { type PopoverApi as Api, type ElementIds, type FocusOutsideEvent, type InteractOutsideEvent, type IntlTranslations, type PopoverMachine as Machine, type OpenChangeDetails, type Placement, type PointerDownOutsideEvent, type PositioningOptions, type PopoverProps as Props, type PopoverService as Service, type TriggerProps, type TriggerValueChangeDetails, anatomy, connect, machine, props, splitProps };
|
package/dist/index.js
CHANGED
|
@@ -1,39 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
|
|
21
|
-
// src/index.ts
|
|
22
|
-
var index_exports = {};
|
|
23
|
-
__export(index_exports, {
|
|
24
|
-
anatomy: () => import_popover.anatomy,
|
|
25
|
-
connect: () => import_popover2.connect,
|
|
26
|
-
machine: () => import_popover3.machine
|
|
27
|
-
});
|
|
28
|
-
module.exports = __toCommonJS(index_exports);
|
|
29
|
-
var import_popover = require("./popover.anatomy.js");
|
|
30
|
-
var import_popover2 = require("./popover.connect.js");
|
|
31
|
-
var import_popover3 = require("./popover.machine.js");
|
|
32
|
-
__reExport(index_exports, require("./popover.props.js"), module.exports);
|
|
33
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
-
0 && (module.exports = {
|
|
35
|
-
anatomy,
|
|
36
|
-
connect,
|
|
37
|
-
machine,
|
|
38
|
-
...require("./popover.props.js")
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
39
4
|
});
|
|
5
|
+
const require_popover_anatomy = require("./popover.anatomy.js");
|
|
6
|
+
const require_popover_connect = require("./popover.connect.js");
|
|
7
|
+
const require_popover_machine = require("./popover.machine.js");
|
|
8
|
+
const require_popover_props = require("./popover.props.js");
|
|
9
|
+
exports.anatomy = require_popover_anatomy.anatomy;
|
|
10
|
+
exports.connect = require_popover_connect.connect;
|
|
11
|
+
exports.machine = require_popover_machine.machine;
|
|
12
|
+
exports.props = require_popover_props.props;
|
|
13
|
+
exports.splitProps = require_popover_props.splitProps;
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
// src/index.ts
|
|
2
1
|
import { anatomy } from "./popover.anatomy.mjs";
|
|
3
2
|
import { connect } from "./popover.connect.mjs";
|
|
4
3
|
import { machine } from "./popover.machine.mjs";
|
|
5
|
-
|
|
6
|
-
export {
|
|
7
|
-
anatomy,
|
|
8
|
-
connect,
|
|
9
|
-
machine
|
|
10
|
-
};
|
|
4
|
+
import { props, splitProps } from "./popover.props.mjs";
|
|
5
|
+
export { anatomy, connect, machine, props, splitProps };
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare const anatomy: _zag_js_anatomy.AnatomyInstance<"content" | "title" | "anchor" | "arrow" | "arrowTip" | "trigger" | "indicator" | "positioner" | "description" | "closeTrigger">;
|
|
4
|
-
declare const parts: Record<"content" | "title" | "anchor" | "arrow" | "arrowTip" | "trigger" | "indicator" | "positioner" | "description" | "closeTrigger", _zag_js_anatomy.AnatomyPart>;
|
|
5
|
-
|
|
6
|
-
export { anatomy, parts };
|
|
1
|
+
export declare const anatomy: import("@zag-js/anatomy").AnatomyInstance<"anchor" | "arrow" | "arrowTip" | "closeTrigger" | "content" | "description" | "indicator" | "positioner" | "title" | "trigger">;
|
|
2
|
+
export declare const parts: Record<"anchor" | "arrow" | "arrowTip" | "closeTrigger" | "content" | "description" | "indicator" | "positioner" | "title" | "trigger", import("@zag-js/anatomy").AnatomyPart>;
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare const anatomy: _zag_js_anatomy.AnatomyInstance<"content" | "title" | "anchor" | "arrow" | "arrowTip" | "trigger" | "indicator" | "positioner" | "description" | "closeTrigger">;
|
|
4
|
-
declare const parts: Record<"content" | "title" | "anchor" | "arrow" | "arrowTip" | "trigger" | "indicator" | "positioner" | "description" | "closeTrigger", _zag_js_anatomy.AnatomyPart>;
|
|
5
|
-
|
|
6
|
-
export { anatomy, parts };
|
|
1
|
+
export declare const anatomy: import("@zag-js/anatomy").AnatomyInstance<"anchor" | "arrow" | "arrowTip" | "closeTrigger" | "content" | "description" | "indicator" | "positioner" | "title" | "trigger">;
|
|
2
|
+
export declare const parts: Record<"anchor" | "arrow" | "arrowTip" | "closeTrigger" | "content" | "description" | "indicator" | "positioner" | "title" | "trigger", import("@zag-js/anatomy").AnatomyPart>;
|
package/dist/popover.anatomy.js
CHANGED
|
@@ -1,45 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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);
|
|
19
|
-
|
|
20
|
-
// src/popover.anatomy.ts
|
|
21
|
-
var popover_anatomy_exports = {};
|
|
22
|
-
__export(popover_anatomy_exports, {
|
|
23
|
-
anatomy: () => anatomy,
|
|
24
|
-
parts: () => parts
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(popover_anatomy_exports);
|
|
27
|
-
var import_anatomy = require("@zag-js/anatomy");
|
|
28
|
-
var anatomy = (0, import_anatomy.createAnatomy)("popover").parts(
|
|
29
|
-
"arrow",
|
|
30
|
-
"arrowTip",
|
|
31
|
-
"anchor",
|
|
32
|
-
"trigger",
|
|
33
|
-
"indicator",
|
|
34
|
-
"positioner",
|
|
35
|
-
"content",
|
|
36
|
-
"title",
|
|
37
|
-
"description",
|
|
38
|
-
"closeTrigger"
|
|
39
|
-
);
|
|
40
|
-
var parts = anatomy.build();
|
|
41
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
-
0 && (module.exports = {
|
|
43
|
-
anatomy,
|
|
44
|
-
parts
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
45
4
|
});
|
|
5
|
+
// src/popover.anatomy.ts
|
|
6
|
+
const anatomy = (0, require("@zag-js/anatomy").createAnatomy)("popover").parts("arrow", "arrowTip", "anchor", "trigger", "indicator", "positioner", "content", "title", "description", "closeTrigger");
|
|
7
|
+
const parts = anatomy.build();
|
|
8
|
+
exports.anatomy = anatomy;
|
|
9
|
+
exports.parts = parts;
|
package/dist/popover.anatomy.mjs
CHANGED
|
@@ -1,19 +1,5 @@
|
|
|
1
|
-
// src/popover.anatomy.ts
|
|
2
1
|
import { createAnatomy } from "@zag-js/anatomy";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"trigger",
|
|
8
|
-
"indicator",
|
|
9
|
-
"positioner",
|
|
10
|
-
"content",
|
|
11
|
-
"title",
|
|
12
|
-
"description",
|
|
13
|
-
"closeTrigger"
|
|
14
|
-
);
|
|
15
|
-
var parts = anatomy.build();
|
|
16
|
-
export {
|
|
17
|
-
anatomy,
|
|
18
|
-
parts
|
|
19
|
-
};
|
|
2
|
+
// src/popover.anatomy.ts
|
|
3
|
+
const anatomy = createAnatomy("popover").parts("arrow", "arrowTip", "anchor", "trigger", "indicator", "positioner", "content", "title", "description", "closeTrigger");
|
|
4
|
+
const parts = anatomy.build();
|
|
5
|
+
export { anatomy, parts };
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import '@zag-js/dismissable';
|
|
5
|
-
import '@zag-js/popper';
|
|
6
|
-
|
|
7
|
-
declare function connect<T extends PropTypes>(service: PopoverService, normalize: NormalizeProps<T>): PopoverApi<T>;
|
|
8
|
-
|
|
9
|
-
export { connect };
|
|
1
|
+
import { PopoverApi, PopoverService } from "./popover.types.mjs";
|
|
2
|
+
import { NormalizeProps, PropTypes } from "@zag-js/types";
|
|
3
|
+
export declare function connect<T extends PropTypes>(service: PopoverService, normalize: NormalizeProps<T>): PopoverApi<T>;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import '@zag-js/dismissable';
|
|
5
|
-
import '@zag-js/popper';
|
|
6
|
-
|
|
7
|
-
declare function connect<T extends PropTypes>(service: PopoverService, normalize: NormalizeProps<T>): PopoverApi<T>;
|
|
8
|
-
|
|
9
|
-
export { connect };
|
|
1
|
+
import { PopoverApi, PopoverService } from "./popover.types.js";
|
|
2
|
+
import { NormalizeProps, PropTypes } from "@zag-js/types";
|
|
3
|
+
export declare function connect<T extends PropTypes>(service: PopoverService, normalize: NormalizeProps<T>): PopoverApi<T>;
|
package/dist/popover.connect.js
CHANGED
|
@@ -1,190 +1,167 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/popover.connect.ts
|
|
31
|
-
var popover_connect_exports = {};
|
|
32
|
-
__export(popover_connect_exports, {
|
|
33
|
-
connect: () => connect
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
34
4
|
});
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
closeTriggerLabel: "close"
|
|
43
|
-
};
|
|
5
|
+
const require_popover_anatomy = require("./popover.anatomy.js");
|
|
6
|
+
const require_popover_dom = require("./popover.dom.js");
|
|
7
|
+
let _zag_js_dom_query = require("@zag-js/dom-query");
|
|
8
|
+
let _zag_js_popper = require("@zag-js/popper");
|
|
9
|
+
let _zag_js_utils = require("@zag-js/utils");
|
|
10
|
+
// src/popover.connect.ts
|
|
11
|
+
const defaultTranslations = { closeTriggerLabel: "close" };
|
|
44
12
|
function connect(service, normalize) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
13
|
+
const { state, context, send, computed, prop, scope } = service;
|
|
14
|
+
const translations = (0, _zag_js_utils.mergeWithDefault)(defaultTranslations, prop("translations"));
|
|
15
|
+
const open = state.matches("open");
|
|
16
|
+
const currentPlacement = context.get("currentPlacement");
|
|
17
|
+
const currentPlacementSide = currentPlacement ? (0, _zag_js_popper.getPlacementSide)(currentPlacement) : void 0;
|
|
18
|
+
const portalled = computed("currentPortalled");
|
|
19
|
+
const rendered = context.get("renderedElements");
|
|
20
|
+
const triggerValue = context.get("triggerValue");
|
|
21
|
+
const popperStyles = (0, _zag_js_popper.getPlacementStyles)({
|
|
22
|
+
...prop("positioning"),
|
|
23
|
+
placement: currentPlacement
|
|
24
|
+
});
|
|
25
|
+
return {
|
|
26
|
+
portalled,
|
|
27
|
+
open,
|
|
28
|
+
setOpen(nextOpen) {
|
|
29
|
+
send({
|
|
30
|
+
type: nextOpen ? "OPEN" : "CLOSE",
|
|
31
|
+
replaces: "open"
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
triggerValue,
|
|
35
|
+
setTriggerValue(value) {
|
|
36
|
+
send({
|
|
37
|
+
type: "TRIGGER_VALUE.SET",
|
|
38
|
+
value
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
reposition(options = {}) {
|
|
42
|
+
send({
|
|
43
|
+
type: "POSITIONING.SET",
|
|
44
|
+
options
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
getArrowProps() {
|
|
48
|
+
return normalize.element({
|
|
49
|
+
id: require_popover_dom.getArrowId(scope),
|
|
50
|
+
...require_popover_anatomy.parts.arrow.attrs,
|
|
51
|
+
dir: prop("dir"),
|
|
52
|
+
style: popperStyles.arrow
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
getArrowTipProps() {
|
|
56
|
+
return normalize.element({
|
|
57
|
+
...require_popover_anatomy.parts.arrowTip.attrs,
|
|
58
|
+
dir: prop("dir"),
|
|
59
|
+
style: popperStyles.arrowTip
|
|
60
|
+
});
|
|
61
|
+
},
|
|
62
|
+
getAnchorProps() {
|
|
63
|
+
return normalize.element({
|
|
64
|
+
...require_popover_anatomy.parts.anchor.attrs,
|
|
65
|
+
dir: prop("dir"),
|
|
66
|
+
id: require_popover_dom.getAnchorId(scope)
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
getTriggerProps(props = {}) {
|
|
70
|
+
const { value } = props;
|
|
71
|
+
const current = value == null ? false : triggerValue === value;
|
|
72
|
+
return normalize.button({
|
|
73
|
+
...require_popover_anatomy.parts.trigger.attrs,
|
|
74
|
+
dir: prop("dir"),
|
|
75
|
+
type: "button",
|
|
76
|
+
"data-placement": currentPlacement,
|
|
77
|
+
"data-side": currentPlacementSide,
|
|
78
|
+
id: require_popover_dom.getTriggerId(scope, value),
|
|
79
|
+
"data-ownedby": scope.id,
|
|
80
|
+
"data-value": value,
|
|
81
|
+
"data-current": (0, _zag_js_dom_query.dataAttr)(current),
|
|
82
|
+
"aria-haspopup": "dialog",
|
|
83
|
+
"aria-expanded": value == null ? open : open && current,
|
|
84
|
+
"data-state": open ? "open" : "closed",
|
|
85
|
+
"aria-controls": require_popover_dom.getContentId(scope),
|
|
86
|
+
onPointerDown(event) {
|
|
87
|
+
if (!(0, _zag_js_dom_query.isLeftClick)(event)) return;
|
|
88
|
+
if ((0, _zag_js_dom_query.isSafari)()) event.currentTarget.focus();
|
|
89
|
+
},
|
|
90
|
+
onClick(event) {
|
|
91
|
+
if (event.defaultPrevented) return;
|
|
92
|
+
send({
|
|
93
|
+
type: open && value != null && !current ? "TRIGGER_VALUE.SET" : "TOGGLE",
|
|
94
|
+
value
|
|
95
|
+
});
|
|
96
|
+
},
|
|
97
|
+
onBlur(event) {
|
|
98
|
+
send({
|
|
99
|
+
type: "TRIGGER_BLUR",
|
|
100
|
+
target: event.relatedTarget
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
},
|
|
105
|
+
getIndicatorProps() {
|
|
106
|
+
return normalize.element({
|
|
107
|
+
...require_popover_anatomy.parts.indicator.attrs,
|
|
108
|
+
dir: prop("dir"),
|
|
109
|
+
"data-state": open ? "open" : "closed"
|
|
110
|
+
});
|
|
111
|
+
},
|
|
112
|
+
getPositionerProps() {
|
|
113
|
+
return normalize.element({
|
|
114
|
+
id: require_popover_dom.getPositionerId(scope),
|
|
115
|
+
...require_popover_anatomy.parts.positioner.attrs,
|
|
116
|
+
dir: prop("dir"),
|
|
117
|
+
style: popperStyles.floating
|
|
118
|
+
});
|
|
119
|
+
},
|
|
120
|
+
getContentProps() {
|
|
121
|
+
return normalize.element({
|
|
122
|
+
...require_popover_anatomy.parts.content.attrs,
|
|
123
|
+
dir: prop("dir"),
|
|
124
|
+
id: require_popover_dom.getContentId(scope),
|
|
125
|
+
tabIndex: -1,
|
|
126
|
+
role: "dialog",
|
|
127
|
+
"aria-modal": (0, _zag_js_dom_query.ariaAttr)(prop("modal")),
|
|
128
|
+
hidden: !open,
|
|
129
|
+
"data-state": open ? "open" : "closed",
|
|
130
|
+
"data-expanded": (0, _zag_js_dom_query.dataAttr)(open),
|
|
131
|
+
"aria-labelledby": rendered.title ? require_popover_dom.getTitleId(scope) : void 0,
|
|
132
|
+
"aria-describedby": rendered.description ? require_popover_dom.getDescriptionId(scope) : void 0,
|
|
133
|
+
"data-placement": currentPlacement,
|
|
134
|
+
"data-side": currentPlacementSide
|
|
135
|
+
});
|
|
136
|
+
},
|
|
137
|
+
getTitleProps() {
|
|
138
|
+
return normalize.element({
|
|
139
|
+
...require_popover_anatomy.parts.title.attrs,
|
|
140
|
+
id: require_popover_dom.getTitleId(scope),
|
|
141
|
+
dir: prop("dir")
|
|
142
|
+
});
|
|
143
|
+
},
|
|
144
|
+
getDescriptionProps() {
|
|
145
|
+
return normalize.element({
|
|
146
|
+
...require_popover_anatomy.parts.description.attrs,
|
|
147
|
+
id: require_popover_dom.getDescriptionId(scope),
|
|
148
|
+
dir: prop("dir")
|
|
149
|
+
});
|
|
150
|
+
},
|
|
151
|
+
getCloseTriggerProps() {
|
|
152
|
+
return normalize.button({
|
|
153
|
+
...require_popover_anatomy.parts.closeTrigger.attrs,
|
|
154
|
+
dir: prop("dir"),
|
|
155
|
+
id: require_popover_dom.getCloseTriggerId(scope),
|
|
156
|
+
type: "button",
|
|
157
|
+
"aria-label": translations.closeTriggerLabel,
|
|
158
|
+
onClick(event) {
|
|
159
|
+
if (event.defaultPrevented) return;
|
|
160
|
+
event.stopPropagation();
|
|
161
|
+
send({ type: "CLOSE" });
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
};
|
|
186
166
|
}
|
|
187
|
-
|
|
188
|
-
0 && (module.exports = {
|
|
189
|
-
connect
|
|
190
|
-
});
|
|
167
|
+
exports.connect = connect;
|