@zag-js/popover 1.35.2 → 1.36.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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/popover.connect.js +2 -1
- package/dist/popover.connect.mjs +2 -1
- package/dist/popover.machine.js +4 -0
- package/dist/popover.machine.mjs +4 -0
- package/dist/popover.props.js +2 -1
- package/dist/popover.props.mjs +2 -1
- package/dist/popover.types.d.mts +9 -2
- package/dist/popover.types.d.ts +9 -2
- package/package.json +11 -11
package/dist/index.d.mts
CHANGED
|
@@ -3,7 +3,7 @@ export { anatomy } from './popover.anatomy.mjs';
|
|
|
3
3
|
export { connect } from './popover.connect.mjs';
|
|
4
4
|
export { machine } from './popover.machine.mjs';
|
|
5
5
|
export { props, splitProps } from './popover.props.mjs';
|
|
6
|
-
export { PopoverApi as Api, ElementIds, PopoverMachine as Machine, OpenChangeDetails, PopoverProps as Props, PopoverService as Service } from './popover.types.mjs';
|
|
6
|
+
export { PopoverApi as Api, ElementIds, IntlTranslations, PopoverMachine as Machine, OpenChangeDetails, PopoverProps as Props, PopoverService as Service } from './popover.types.mjs';
|
|
7
7
|
export { Placement, PositioningOptions } from '@zag-js/popper';
|
|
8
8
|
import '@zag-js/anatomy';
|
|
9
9
|
import '@zag-js/types';
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { anatomy } from './popover.anatomy.js';
|
|
|
3
3
|
export { connect } from './popover.connect.js';
|
|
4
4
|
export { machine } from './popover.machine.js';
|
|
5
5
|
export { props, splitProps } from './popover.props.js';
|
|
6
|
-
export { PopoverApi as Api, ElementIds, PopoverMachine as Machine, OpenChangeDetails, PopoverProps as Props, PopoverService as Service } from './popover.types.js';
|
|
6
|
+
export { PopoverApi as Api, ElementIds, IntlTranslations, PopoverMachine as Machine, OpenChangeDetails, PopoverProps as Props, PopoverService as Service } from './popover.types.js';
|
|
7
7
|
export { Placement, PositioningOptions } from '@zag-js/popper';
|
|
8
8
|
import '@zag-js/anatomy';
|
|
9
9
|
import '@zag-js/types';
|
package/dist/popover.connect.js
CHANGED
|
@@ -39,6 +39,7 @@ var import_popover = require("./popover.anatomy.js");
|
|
|
39
39
|
var dom = __toESM(require("./popover.dom.js"));
|
|
40
40
|
function connect(service, normalize) {
|
|
41
41
|
const { state, context, send, computed, prop, scope } = service;
|
|
42
|
+
const translations = prop("translations");
|
|
42
43
|
const open = state.matches("open");
|
|
43
44
|
const currentPlacement = context.get("currentPlacement");
|
|
44
45
|
const portalled = computed("currentPortalled");
|
|
@@ -157,7 +158,7 @@ function connect(service, normalize) {
|
|
|
157
158
|
dir: prop("dir"),
|
|
158
159
|
id: dom.getCloseTriggerId(scope),
|
|
159
160
|
type: "button",
|
|
160
|
-
"aria-label":
|
|
161
|
+
"aria-label": translations.closeTriggerLabel,
|
|
161
162
|
onClick(event) {
|
|
162
163
|
if (event.defaultPrevented) return;
|
|
163
164
|
event.stopPropagation();
|
package/dist/popover.connect.mjs
CHANGED
|
@@ -5,6 +5,7 @@ import { parts } from "./popover.anatomy.mjs";
|
|
|
5
5
|
import * as dom from "./popover.dom.mjs";
|
|
6
6
|
function connect(service, normalize) {
|
|
7
7
|
const { state, context, send, computed, prop, scope } = service;
|
|
8
|
+
const translations = prop("translations");
|
|
8
9
|
const open = state.matches("open");
|
|
9
10
|
const currentPlacement = context.get("currentPlacement");
|
|
10
11
|
const portalled = computed("currentPortalled");
|
|
@@ -123,7 +124,7 @@ function connect(service, normalize) {
|
|
|
123
124
|
dir: prop("dir"),
|
|
124
125
|
id: dom.getCloseTriggerId(scope),
|
|
125
126
|
type: "button",
|
|
126
|
-
"aria-label":
|
|
127
|
+
"aria-label": translations.closeTriggerLabel,
|
|
127
128
|
onClick(event) {
|
|
128
129
|
if (event.defaultPrevented) return;
|
|
129
130
|
event.stopPropagation();
|
package/dist/popover.machine.js
CHANGED
package/dist/popover.machine.mjs
CHANGED
package/dist/popover.props.js
CHANGED
|
@@ -46,7 +46,8 @@ var props = (0, import_types.createProps)()([
|
|
|
46
46
|
"open",
|
|
47
47
|
"persistentElements",
|
|
48
48
|
"portalled",
|
|
49
|
-
"positioning"
|
|
49
|
+
"positioning",
|
|
50
|
+
"translations"
|
|
50
51
|
]);
|
|
51
52
|
var splitProps = (0, import_utils.createSplitProps)(props);
|
|
52
53
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/popover.props.mjs
CHANGED
package/dist/popover.types.d.mts
CHANGED
|
@@ -7,6 +7,9 @@ import { PropTypes, RequiredBy, CommonProperties, DirectionProperty } from '@zag
|
|
|
7
7
|
interface OpenChangeDetails {
|
|
8
8
|
open: boolean;
|
|
9
9
|
}
|
|
10
|
+
interface IntlTranslations {
|
|
11
|
+
closeTriggerLabel?: string | undefined;
|
|
12
|
+
}
|
|
10
13
|
type ElementIds = Partial<{
|
|
11
14
|
anchor: string;
|
|
12
15
|
trigger: string;
|
|
@@ -18,6 +21,10 @@ type ElementIds = Partial<{
|
|
|
18
21
|
arrow: string;
|
|
19
22
|
}>;
|
|
20
23
|
interface PopoverProps extends CommonProperties, DirectionProperty, DismissableElementHandlers, PersistentElementOptions {
|
|
24
|
+
/**
|
|
25
|
+
* Specifies the localized strings that identifies the accessibility elements and their states
|
|
26
|
+
*/
|
|
27
|
+
translations?: IntlTranslations | undefined;
|
|
21
28
|
/**
|
|
22
29
|
* The ids of the elements in the popover. Useful for composition.
|
|
23
30
|
*/
|
|
@@ -78,7 +85,7 @@ interface PopoverProps extends CommonProperties, DirectionProperty, DismissableE
|
|
|
78
85
|
*/
|
|
79
86
|
defaultOpen?: boolean | undefined;
|
|
80
87
|
}
|
|
81
|
-
type PropsWithDefault = "closeOnInteractOutside" | "closeOnEscape" | "modal" | "portalled" | "autoFocus" | "positioning";
|
|
88
|
+
type PropsWithDefault = "closeOnInteractOutside" | "closeOnEscape" | "modal" | "portalled" | "autoFocus" | "positioning" | "translations";
|
|
82
89
|
type ComputedContext = Readonly<{
|
|
83
90
|
/**
|
|
84
91
|
* The computed value of `portalled`
|
|
@@ -139,4 +146,4 @@ interface PopoverApi<T extends PropTypes = PropTypes> {
|
|
|
139
146
|
getCloseTriggerProps: () => T["button"];
|
|
140
147
|
}
|
|
141
148
|
|
|
142
|
-
export type { ElementIds, OpenChangeDetails, PopoverApi, PopoverMachine, PopoverProps, PopoverSchema, PopoverService };
|
|
149
|
+
export type { ElementIds, IntlTranslations, OpenChangeDetails, PopoverApi, PopoverMachine, PopoverProps, PopoverSchema, PopoverService };
|
package/dist/popover.types.d.ts
CHANGED
|
@@ -7,6 +7,9 @@ import { PropTypes, RequiredBy, CommonProperties, DirectionProperty } from '@zag
|
|
|
7
7
|
interface OpenChangeDetails {
|
|
8
8
|
open: boolean;
|
|
9
9
|
}
|
|
10
|
+
interface IntlTranslations {
|
|
11
|
+
closeTriggerLabel?: string | undefined;
|
|
12
|
+
}
|
|
10
13
|
type ElementIds = Partial<{
|
|
11
14
|
anchor: string;
|
|
12
15
|
trigger: string;
|
|
@@ -18,6 +21,10 @@ type ElementIds = Partial<{
|
|
|
18
21
|
arrow: string;
|
|
19
22
|
}>;
|
|
20
23
|
interface PopoverProps extends CommonProperties, DirectionProperty, DismissableElementHandlers, PersistentElementOptions {
|
|
24
|
+
/**
|
|
25
|
+
* Specifies the localized strings that identifies the accessibility elements and their states
|
|
26
|
+
*/
|
|
27
|
+
translations?: IntlTranslations | undefined;
|
|
21
28
|
/**
|
|
22
29
|
* The ids of the elements in the popover. Useful for composition.
|
|
23
30
|
*/
|
|
@@ -78,7 +85,7 @@ interface PopoverProps extends CommonProperties, DirectionProperty, DismissableE
|
|
|
78
85
|
*/
|
|
79
86
|
defaultOpen?: boolean | undefined;
|
|
80
87
|
}
|
|
81
|
-
type PropsWithDefault = "closeOnInteractOutside" | "closeOnEscape" | "modal" | "portalled" | "autoFocus" | "positioning";
|
|
88
|
+
type PropsWithDefault = "closeOnInteractOutside" | "closeOnEscape" | "modal" | "portalled" | "autoFocus" | "positioning" | "translations";
|
|
82
89
|
type ComputedContext = Readonly<{
|
|
83
90
|
/**
|
|
84
91
|
* The computed value of `portalled`
|
|
@@ -139,4 +146,4 @@ interface PopoverApi<T extends PropTypes = PropTypes> {
|
|
|
139
146
|
getCloseTriggerProps: () => T["button"];
|
|
140
147
|
}
|
|
141
148
|
|
|
142
|
-
export type { ElementIds, OpenChangeDetails, PopoverApi, PopoverMachine, PopoverProps, PopoverSchema, PopoverService };
|
|
149
|
+
export type { ElementIds, IntlTranslations, OpenChangeDetails, PopoverApi, PopoverMachine, PopoverProps, PopoverSchema, PopoverService };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/popover",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.36.0",
|
|
4
4
|
"description": "Core logic for the popover widget implemented as a state machine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -26,16 +26,16 @@
|
|
|
26
26
|
"url": "https://github.com/chakra-ui/zag/issues"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@zag-js/
|
|
30
|
-
"@zag-js/
|
|
31
|
-
"@zag-js/core": "1.
|
|
32
|
-
"@zag-js/dom-query": "1.
|
|
33
|
-
"@zag-js/utils": "1.
|
|
34
|
-
"@zag-js/dismissable": "1.
|
|
35
|
-
"@zag-js/
|
|
36
|
-
"@zag-js/
|
|
37
|
-
"@zag-js/
|
|
38
|
-
"@zag-js/
|
|
29
|
+
"@zag-js/anatomy": "1.36.0",
|
|
30
|
+
"@zag-js/aria-hidden": "1.36.0",
|
|
31
|
+
"@zag-js/core": "1.36.0",
|
|
32
|
+
"@zag-js/dom-query": "1.36.0",
|
|
33
|
+
"@zag-js/utils": "1.36.0",
|
|
34
|
+
"@zag-js/dismissable": "1.36.0",
|
|
35
|
+
"@zag-js/popper": "1.36.0",
|
|
36
|
+
"@zag-js/remove-scroll": "1.36.0",
|
|
37
|
+
"@zag-js/types": "1.36.0",
|
|
38
|
+
"@zag-js/focus-trap": "1.36.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"clean-package": "2.2.0"
|