@zag-js/popover 1.46.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 CHANGED
@@ -1,10 +1,7 @@
1
- export { FocusOutsideEvent, InteractOutsideEvent, PointerDownOutsideEvent } from '@zag-js/dismissable';
2
- export { anatomy } from './popover.anatomy.mjs';
3
- export { connect } from './popover.connect.mjs';
4
- export { machine } from './popover.machine.mjs';
5
- export { props, splitProps } from './popover.props.mjs';
6
- export { PopoverApi as Api, ElementIds, IntlTranslations, PopoverMachine as Machine, OpenChangeDetails, PopoverProps as Props, PopoverService as Service, TriggerProps, TriggerValueChangeDetails } from './popover.types.mjs';
7
- export { Placement, PositioningOptions } from '@zag-js/popper';
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
- export { FocusOutsideEvent, InteractOutsideEvent, PointerDownOutsideEvent } from '@zag-js/dismissable';
2
- export { anatomy } from './popover.anatomy.js';
3
- export { connect } from './popover.connect.js';
4
- export { machine } from './popover.machine.js';
5
- export { props, splitProps } from './popover.props.js';
6
- export { PopoverApi as Api, ElementIds, IntlTranslations, PopoverMachine as Machine, OpenChangeDetails, PopoverProps as Props, PopoverService as Service, TriggerProps, TriggerValueChangeDetails } from './popover.types.js';
7
- export { Placement, PositioningOptions } from '@zag-js/popper';
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
- "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 __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
- export * from "./popover.props.mjs";
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
- import * as _zag_js_anatomy from '@zag-js/anatomy';
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
- import * as _zag_js_anatomy from '@zag-js/anatomy';
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,45 +1,9 @@
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);
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;
@@ -1,19 +1,5 @@
1
- // src/popover.anatomy.ts
2
1
  import { createAnatomy } from "@zag-js/anatomy";
3
- var anatomy = createAnatomy("popover").parts(
4
- "arrow",
5
- "arrowTip",
6
- "anchor",
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 { PropTypes, NormalizeProps } from '@zag-js/types';
2
- import { PopoverService, PopoverApi } from './popover.types.mjs';
3
- import '@zag-js/core';
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 { PropTypes, NormalizeProps } from '@zag-js/types';
2
- import { PopoverService, PopoverApi } from './popover.types.js';
3
- import '@zag-js/core';
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>;
@@ -1,190 +1,167 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
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
- module.exports = __toCommonJS(popover_connect_exports);
36
- var import_dom_query = require("@zag-js/dom-query");
37
- var import_popper = require("@zag-js/popper");
38
- var import_utils = require("@zag-js/utils");
39
- var import_popover = require("./popover.anatomy.js");
40
- var dom = __toESM(require("./popover.dom.js"));
41
- var defaultTranslations = {
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
- const { state, context, send, computed, prop, scope } = service;
46
- const translations = (0, import_utils.mergeWithDefault)(defaultTranslations, prop("translations"));
47
- const open = state.matches("open");
48
- const currentPlacement = context.get("currentPlacement");
49
- const currentPlacementSide = currentPlacement ? (0, import_popper.getPlacementSide)(currentPlacement) : void 0;
50
- const portalled = computed("currentPortalled");
51
- const rendered = context.get("renderedElements");
52
- const triggerValue = context.get("triggerValue");
53
- const popperStyles = (0, import_popper.getPlacementStyles)({
54
- ...prop("positioning"),
55
- placement: currentPlacement
56
- });
57
- return {
58
- portalled,
59
- open,
60
- setOpen(nextOpen) {
61
- send({ type: nextOpen ? "OPEN" : "CLOSE", replaces: "open" });
62
- },
63
- triggerValue,
64
- setTriggerValue(value) {
65
- send({ type: "TRIGGER_VALUE.SET", value });
66
- },
67
- reposition(options = {}) {
68
- send({ type: "POSITIONING.SET", options });
69
- },
70
- getArrowProps() {
71
- return normalize.element({
72
- id: dom.getArrowId(scope),
73
- ...import_popover.parts.arrow.attrs,
74
- dir: prop("dir"),
75
- style: popperStyles.arrow
76
- });
77
- },
78
- getArrowTipProps() {
79
- return normalize.element({
80
- ...import_popover.parts.arrowTip.attrs,
81
- dir: prop("dir"),
82
- style: popperStyles.arrowTip
83
- });
84
- },
85
- getAnchorProps() {
86
- return normalize.element({
87
- ...import_popover.parts.anchor.attrs,
88
- dir: prop("dir"),
89
- id: dom.getAnchorId(scope)
90
- });
91
- },
92
- getTriggerProps(props = {}) {
93
- const { value } = props;
94
- const current = value == null ? false : triggerValue === value;
95
- return normalize.button({
96
- ...import_popover.parts.trigger.attrs,
97
- dir: prop("dir"),
98
- type: "button",
99
- "data-placement": currentPlacement,
100
- "data-side": currentPlacementSide,
101
- id: dom.getTriggerId(scope, value),
102
- "data-ownedby": scope.id,
103
- "data-value": value,
104
- "data-current": (0, import_dom_query.dataAttr)(current),
105
- "aria-haspopup": "dialog",
106
- "aria-expanded": value == null ? open : open && current,
107
- "data-state": open ? "open" : "closed",
108
- "aria-controls": dom.getContentId(scope),
109
- onPointerDown(event) {
110
- if (!(0, import_dom_query.isLeftClick)(event)) return;
111
- if ((0, import_dom_query.isSafari)()) {
112
- event.currentTarget.focus();
113
- }
114
- },
115
- onClick(event) {
116
- if (event.defaultPrevented) return;
117
- const shouldSwitch = open && value != null && !current;
118
- send({ type: shouldSwitch ? "TRIGGER_VALUE.SET" : "TOGGLE", value });
119
- },
120
- onBlur(event) {
121
- send({ type: "TRIGGER_BLUR", target: event.relatedTarget });
122
- }
123
- });
124
- },
125
- getIndicatorProps() {
126
- return normalize.element({
127
- ...import_popover.parts.indicator.attrs,
128
- dir: prop("dir"),
129
- "data-state": open ? "open" : "closed"
130
- });
131
- },
132
- getPositionerProps() {
133
- return normalize.element({
134
- id: dom.getPositionerId(scope),
135
- ...import_popover.parts.positioner.attrs,
136
- dir: prop("dir"),
137
- style: popperStyles.floating
138
- });
139
- },
140
- getContentProps() {
141
- return normalize.element({
142
- ...import_popover.parts.content.attrs,
143
- dir: prop("dir"),
144
- id: dom.getContentId(scope),
145
- tabIndex: -1,
146
- role: "dialog",
147
- "aria-modal": (0, import_dom_query.ariaAttr)(prop("modal")),
148
- hidden: !open,
149
- "data-state": open ? "open" : "closed",
150
- "data-expanded": (0, import_dom_query.dataAttr)(open),
151
- "aria-labelledby": rendered.title ? dom.getTitleId(scope) : void 0,
152
- "aria-describedby": rendered.description ? dom.getDescriptionId(scope) : void 0,
153
- "data-placement": currentPlacement,
154
- "data-side": currentPlacementSide
155
- });
156
- },
157
- getTitleProps() {
158
- return normalize.element({
159
- ...import_popover.parts.title.attrs,
160
- id: dom.getTitleId(scope),
161
- dir: prop("dir")
162
- });
163
- },
164
- getDescriptionProps() {
165
- return normalize.element({
166
- ...import_popover.parts.description.attrs,
167
- id: dom.getDescriptionId(scope),
168
- dir: prop("dir")
169
- });
170
- },
171
- getCloseTriggerProps() {
172
- return normalize.button({
173
- ...import_popover.parts.closeTrigger.attrs,
174
- dir: prop("dir"),
175
- id: dom.getCloseTriggerId(scope),
176
- type: "button",
177
- "aria-label": translations.closeTriggerLabel,
178
- onClick(event) {
179
- if (event.defaultPrevented) return;
180
- event.stopPropagation();
181
- send({ type: "CLOSE" });
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
- // Annotate the CommonJS export names for ESM import in node:
188
- 0 && (module.exports = {
189
- connect
190
- });
167
+ exports.connect = connect;