@zag-js/popover 1.43.1 → 1.43.3
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.connect.js +5 -1
- package/dist/popover.connect.mjs +5 -1
- package/dist/popover.machine.js +0 -4
- package/dist/popover.machine.mjs +0 -4
- package/dist/popover.types.d.mts +12 -12
- package/dist/popover.types.d.ts +12 -12
- package/package.json +11 -11
package/dist/popover.connect.js
CHANGED
|
@@ -35,11 +35,15 @@ __export(popover_connect_exports, {
|
|
|
35
35
|
module.exports = __toCommonJS(popover_connect_exports);
|
|
36
36
|
var import_dom_query = require("@zag-js/dom-query");
|
|
37
37
|
var import_popper = require("@zag-js/popper");
|
|
38
|
+
var import_utils = require("@zag-js/utils");
|
|
38
39
|
var import_popover = require("./popover.anatomy.js");
|
|
39
40
|
var dom = __toESM(require("./popover.dom.js"));
|
|
41
|
+
var defaultTranslations = {
|
|
42
|
+
closeTriggerLabel: "close"
|
|
43
|
+
};
|
|
40
44
|
function connect(service, normalize) {
|
|
41
45
|
const { state, context, send, computed, prop, scope } = service;
|
|
42
|
-
const translations = prop("translations");
|
|
46
|
+
const translations = (0, import_utils.mergeWithDefault)(defaultTranslations, prop("translations"));
|
|
43
47
|
const open = state.matches("open");
|
|
44
48
|
const currentPlacement = context.get("currentPlacement");
|
|
45
49
|
const currentPlacementSide = currentPlacement ? (0, import_popper.getPlacementSide)(currentPlacement) : void 0;
|
package/dist/popover.connect.mjs
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
// src/popover.connect.ts
|
|
2
2
|
import { ariaAttr, dataAttr, isLeftClick, isSafari } from "@zag-js/dom-query";
|
|
3
3
|
import { getPlacementSide, getPlacementStyles } from "@zag-js/popper";
|
|
4
|
+
import { mergeWithDefault } from "@zag-js/utils";
|
|
4
5
|
import { parts } from "./popover.anatomy.mjs";
|
|
5
6
|
import * as dom from "./popover.dom.mjs";
|
|
7
|
+
var defaultTranslations = {
|
|
8
|
+
closeTriggerLabel: "close"
|
|
9
|
+
};
|
|
6
10
|
function connect(service, normalize) {
|
|
7
11
|
const { state, context, send, computed, prop, scope } = service;
|
|
8
|
-
const translations = prop("translations");
|
|
12
|
+
const translations = mergeWithDefault(defaultTranslations, prop("translations"));
|
|
9
13
|
const open = state.matches("open");
|
|
10
14
|
const currentPlacement = context.get("currentPlacement");
|
|
11
15
|
const currentPlacementSide = currentPlacement ? getPlacementSide(currentPlacement) : void 0;
|
package/dist/popover.machine.js
CHANGED
package/dist/popover.machine.mjs
CHANGED
package/dist/popover.types.d.mts
CHANGED
|
@@ -20,16 +20,16 @@ interface TriggerValueChangeDetails {
|
|
|
20
20
|
interface IntlTranslations {
|
|
21
21
|
closeTriggerLabel?: string | undefined;
|
|
22
22
|
}
|
|
23
|
-
|
|
24
|
-
anchor
|
|
25
|
-
trigger
|
|
26
|
-
content
|
|
27
|
-
title
|
|
28
|
-
description
|
|
29
|
-
closeTrigger
|
|
30
|
-
positioner
|
|
31
|
-
arrow
|
|
32
|
-
}
|
|
23
|
+
interface ElementIds {
|
|
24
|
+
anchor?: string | undefined;
|
|
25
|
+
trigger?: (string | ((value?: string) => string)) | undefined;
|
|
26
|
+
content?: string | undefined;
|
|
27
|
+
title?: string | undefined;
|
|
28
|
+
description?: string | undefined;
|
|
29
|
+
closeTrigger?: string | undefined;
|
|
30
|
+
positioner?: string | undefined;
|
|
31
|
+
arrow?: string | undefined;
|
|
32
|
+
}
|
|
33
33
|
interface PopoverProps extends CommonProperties, DirectionProperty, DismissableElementHandlers, PersistentElementOptions {
|
|
34
34
|
/**
|
|
35
35
|
* Specifies the localized strings that identifies the accessibility elements and their states
|
|
@@ -118,7 +118,7 @@ interface PopoverProps extends CommonProperties, DirectionProperty, DismissableE
|
|
|
118
118
|
*/
|
|
119
119
|
onTriggerValueChange?: ((details: TriggerValueChangeDetails) => void) | undefined;
|
|
120
120
|
}
|
|
121
|
-
type PropsWithDefault = "closeOnInteractOutside" | "closeOnEscape" | "modal" | "portalled" | "autoFocus" | "restoreFocus" | "positioning"
|
|
121
|
+
type PropsWithDefault = "closeOnInteractOutside" | "closeOnEscape" | "modal" | "portalled" | "autoFocus" | "restoreFocus" | "positioning";
|
|
122
122
|
type ComputedContext = Readonly<{
|
|
123
123
|
/**
|
|
124
124
|
* The computed value of `portalled`
|
|
@@ -158,7 +158,7 @@ interface TriggerProps {
|
|
|
158
158
|
/**
|
|
159
159
|
* The value that identifies this specific trigger
|
|
160
160
|
*/
|
|
161
|
-
value?: string;
|
|
161
|
+
value?: string | undefined;
|
|
162
162
|
}
|
|
163
163
|
interface PopoverApi<T extends PropTypes = PropTypes> {
|
|
164
164
|
/**
|
package/dist/popover.types.d.ts
CHANGED
|
@@ -20,16 +20,16 @@ interface TriggerValueChangeDetails {
|
|
|
20
20
|
interface IntlTranslations {
|
|
21
21
|
closeTriggerLabel?: string | undefined;
|
|
22
22
|
}
|
|
23
|
-
|
|
24
|
-
anchor
|
|
25
|
-
trigger
|
|
26
|
-
content
|
|
27
|
-
title
|
|
28
|
-
description
|
|
29
|
-
closeTrigger
|
|
30
|
-
positioner
|
|
31
|
-
arrow
|
|
32
|
-
}
|
|
23
|
+
interface ElementIds {
|
|
24
|
+
anchor?: string | undefined;
|
|
25
|
+
trigger?: (string | ((value?: string) => string)) | undefined;
|
|
26
|
+
content?: string | undefined;
|
|
27
|
+
title?: string | undefined;
|
|
28
|
+
description?: string | undefined;
|
|
29
|
+
closeTrigger?: string | undefined;
|
|
30
|
+
positioner?: string | undefined;
|
|
31
|
+
arrow?: string | undefined;
|
|
32
|
+
}
|
|
33
33
|
interface PopoverProps extends CommonProperties, DirectionProperty, DismissableElementHandlers, PersistentElementOptions {
|
|
34
34
|
/**
|
|
35
35
|
* Specifies the localized strings that identifies the accessibility elements and their states
|
|
@@ -118,7 +118,7 @@ interface PopoverProps extends CommonProperties, DirectionProperty, DismissableE
|
|
|
118
118
|
*/
|
|
119
119
|
onTriggerValueChange?: ((details: TriggerValueChangeDetails) => void) | undefined;
|
|
120
120
|
}
|
|
121
|
-
type PropsWithDefault = "closeOnInteractOutside" | "closeOnEscape" | "modal" | "portalled" | "autoFocus" | "restoreFocus" | "positioning"
|
|
121
|
+
type PropsWithDefault = "closeOnInteractOutside" | "closeOnEscape" | "modal" | "portalled" | "autoFocus" | "restoreFocus" | "positioning";
|
|
122
122
|
type ComputedContext = Readonly<{
|
|
123
123
|
/**
|
|
124
124
|
* The computed value of `portalled`
|
|
@@ -158,7 +158,7 @@ interface TriggerProps {
|
|
|
158
158
|
/**
|
|
159
159
|
* The value that identifies this specific trigger
|
|
160
160
|
*/
|
|
161
|
-
value?: string;
|
|
161
|
+
value?: string | undefined;
|
|
162
162
|
}
|
|
163
163
|
interface PopoverApi<T extends PropTypes = PropTypes> {
|
|
164
164
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/popover",
|
|
3
|
-
"version": "1.43.
|
|
3
|
+
"version": "1.43.3",
|
|
4
4
|
"description": "Core logic for the popover widget implemented as a state machine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
"url": "https://github.com/chakra-ui/zag/issues"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@zag-js/anatomy": "1.43.
|
|
33
|
-
"@zag-js/aria-hidden": "1.43.
|
|
34
|
-
"@zag-js/core": "1.43.
|
|
35
|
-
"@zag-js/dom-query": "1.43.
|
|
36
|
-
"@zag-js/utils": "1.43.
|
|
37
|
-
"@zag-js/dismissable": "1.43.
|
|
38
|
-
"@zag-js/popper": "1.43.
|
|
39
|
-
"@zag-js/remove-scroll": "1.43.
|
|
40
|
-
"@zag-js/types": "1.43.
|
|
41
|
-
"@zag-js/focus-trap": "1.43.
|
|
32
|
+
"@zag-js/anatomy": "1.43.3",
|
|
33
|
+
"@zag-js/aria-hidden": "1.43.3",
|
|
34
|
+
"@zag-js/core": "1.43.3",
|
|
35
|
+
"@zag-js/dom-query": "1.43.3",
|
|
36
|
+
"@zag-js/utils": "1.43.3",
|
|
37
|
+
"@zag-js/dismissable": "1.43.3",
|
|
38
|
+
"@zag-js/popper": "1.43.3",
|
|
39
|
+
"@zag-js/remove-scroll": "1.43.3",
|
|
40
|
+
"@zag-js/types": "1.43.3",
|
|
41
|
+
"@zag-js/focus-trap": "1.43.3"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"clean-package": "2.2.0"
|