@zag-js/popper 1.41.1 → 2.0.0-next.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/get-styles.d.mts +4 -1
- package/dist/get-styles.d.ts +4 -1
- package/dist/get-styles.js +2 -1
- package/dist/get-styles.mjs +2 -1
- package/package.json +3 -3
package/dist/get-styles.d.mts
CHANGED
|
@@ -5,7 +5,9 @@ import { PositioningOptions } from './types.mjs';
|
|
|
5
5
|
interface GetPlacementStylesOptions {
|
|
6
6
|
placement?: Placement | undefined;
|
|
7
7
|
}
|
|
8
|
-
declare function getPlacementStyles(options?: Pick<PositioningOptions, "placement" | "sameWidth" | "fitViewport" | "strategy">
|
|
8
|
+
declare function getPlacementStyles(options?: Pick<PositioningOptions, "placement" | "sameWidth" | "fitViewport" | "strategy"> & {
|
|
9
|
+
positioned?: boolean | undefined;
|
|
10
|
+
}): {
|
|
9
11
|
arrow: {
|
|
10
12
|
readonly [cssVars.arrowSizeHalf.variable]: `calc(${string} / 2)`;
|
|
11
13
|
readonly [cssVars.arrowOffset.variable]: `calc(${string} * -1)`;
|
|
@@ -34,6 +36,7 @@ declare function getPlacementStyles(options?: Pick<PositioningOptions, "placemen
|
|
|
34
36
|
readonly top: "0px";
|
|
35
37
|
readonly left: "0px";
|
|
36
38
|
readonly transform: "translate3d(var(--x), var(--y), 0)" | "translate3d(0, -100vh, 0)";
|
|
39
|
+
readonly opacity: "0" | undefined;
|
|
37
40
|
readonly zIndex: "var(--z-index)";
|
|
38
41
|
};
|
|
39
42
|
};
|
package/dist/get-styles.d.ts
CHANGED
|
@@ -5,7 +5,9 @@ import { PositioningOptions } from './types.js';
|
|
|
5
5
|
interface GetPlacementStylesOptions {
|
|
6
6
|
placement?: Placement | undefined;
|
|
7
7
|
}
|
|
8
|
-
declare function getPlacementStyles(options?: Pick<PositioningOptions, "placement" | "sameWidth" | "fitViewport" | "strategy">
|
|
8
|
+
declare function getPlacementStyles(options?: Pick<PositioningOptions, "placement" | "sameWidth" | "fitViewport" | "strategy"> & {
|
|
9
|
+
positioned?: boolean | undefined;
|
|
10
|
+
}): {
|
|
9
11
|
arrow: {
|
|
10
12
|
readonly [cssVars.arrowSizeHalf.variable]: `calc(${string} / 2)`;
|
|
11
13
|
readonly [cssVars.arrowOffset.variable]: `calc(${string} * -1)`;
|
|
@@ -34,6 +36,7 @@ declare function getPlacementStyles(options?: Pick<PositioningOptions, "placemen
|
|
|
34
36
|
readonly top: "0px";
|
|
35
37
|
readonly left: "0px";
|
|
36
38
|
readonly transform: "translate3d(var(--x), var(--y), 0)" | "translate3d(0, -100vh, 0)";
|
|
39
|
+
readonly opacity: "0" | undefined;
|
|
37
40
|
readonly zIndex: "var(--z-index)";
|
|
38
41
|
};
|
|
39
42
|
};
|
package/dist/get-styles.js
CHANGED
|
@@ -31,7 +31,7 @@ var ARROW_FLOATING_STYLE = {
|
|
|
31
31
|
right: "rotate(315deg)"
|
|
32
32
|
};
|
|
33
33
|
function getPlacementStyles(options = {}) {
|
|
34
|
-
const { placement, sameWidth, fitViewport, strategy = "absolute" } = options;
|
|
34
|
+
const { placement, sameWidth, fitViewport, strategy = "absolute", positioned = true } = options;
|
|
35
35
|
return {
|
|
36
36
|
arrow: {
|
|
37
37
|
position: "absolute",
|
|
@@ -63,6 +63,7 @@ function getPlacementStyles(options = {}) {
|
|
|
63
63
|
left: "0px",
|
|
64
64
|
// move off-screen if placement is not defined
|
|
65
65
|
transform: placement ? "translate3d(var(--x), var(--y), 0)" : "translate3d(0, -100vh, 0)",
|
|
66
|
+
opacity: !positioned ? "0" : void 0,
|
|
66
67
|
zIndex: "var(--z-index)"
|
|
67
68
|
}
|
|
68
69
|
};
|
package/dist/get-styles.mjs
CHANGED
|
@@ -7,7 +7,7 @@ var ARROW_FLOATING_STYLE = {
|
|
|
7
7
|
right: "rotate(315deg)"
|
|
8
8
|
};
|
|
9
9
|
function getPlacementStyles(options = {}) {
|
|
10
|
-
const { placement, sameWidth, fitViewport, strategy = "absolute" } = options;
|
|
10
|
+
const { placement, sameWidth, fitViewport, strategy = "absolute", positioned = true } = options;
|
|
11
11
|
return {
|
|
12
12
|
arrow: {
|
|
13
13
|
position: "absolute",
|
|
@@ -39,6 +39,7 @@ function getPlacementStyles(options = {}) {
|
|
|
39
39
|
left: "0px",
|
|
40
40
|
// move off-screen if placement is not defined
|
|
41
41
|
transform: placement ? "translate3d(var(--x), var(--y), 0)" : "translate3d(0, -100vh, 0)",
|
|
42
|
+
opacity: !positioned ? "0" : void 0,
|
|
42
43
|
zIndex: "var(--z-index)"
|
|
43
44
|
}
|
|
44
45
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/popper",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-next.0",
|
|
4
4
|
"description": "Dynamic positioning logic for ui machines",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@floating-ui/dom": "^1.7.6",
|
|
26
|
-
"@zag-js/dom-query": "
|
|
27
|
-
"@zag-js/utils": "
|
|
26
|
+
"@zag-js/dom-query": "2.0.0-next.0",
|
|
27
|
+
"@zag-js/utils": "2.0.0-next.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"clean-package": "2.2.0"
|