@zag-js/popper 1.2.0 → 1.3.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,4 +1,4 @@
1
- import { Placement, Boundary, AutoUpdateOptions, ComputePositionReturn, VirtualElement } from '@floating-ui/dom';
1
+ import { VirtualElement, Placement, Boundary, AutoUpdateOptions, ComputePositionReturn } from '@floating-ui/dom';
2
2
  export { AutoUpdateOptions, Boundary, ComputePositionReturn, Placement } from '@floating-ui/dom';
3
3
 
4
4
  type MaybeRectElement = HTMLElement | VirtualElement | null;
@@ -105,12 +105,36 @@ declare function getPlacement(referenceOrFn: MaybeFn<MaybeRectElement>, floating
105
105
  defer?: boolean;
106
106
  }): () => void;
107
107
 
108
+ declare const cssVars: {
109
+ arrowSize: {
110
+ variable: string;
111
+ reference: string;
112
+ };
113
+ arrowSizeHalf: {
114
+ variable: string;
115
+ reference: string;
116
+ };
117
+ arrowBg: {
118
+ variable: string;
119
+ reference: string;
120
+ };
121
+ transformOrigin: {
122
+ variable: string;
123
+ reference: string;
124
+ };
125
+ arrowOffset: {
126
+ variable: string;
127
+ reference: string;
128
+ };
129
+ };
130
+
108
131
  interface GetPlacementStylesOptions {
109
132
  placement?: Placement | undefined;
110
133
  }
111
134
  declare function getPlacementStyles(options?: Pick<PositioningOptions, "placement" | "sameWidth" | "fitViewport" | "strategy">): {
112
135
  arrow: {
113
- readonly [x: string]: string;
136
+ readonly [cssVars.arrowSizeHalf.variable]: `calc(${string} / 2)`;
137
+ readonly [cssVars.arrowOffset.variable]: `calc(${string} * -1)`;
114
138
  readonly position: "absolute";
115
139
  readonly width: string;
116
140
  readonly height: string;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Placement, Boundary, AutoUpdateOptions, ComputePositionReturn, VirtualElement } from '@floating-ui/dom';
1
+ import { VirtualElement, Placement, Boundary, AutoUpdateOptions, ComputePositionReturn } from '@floating-ui/dom';
2
2
  export { AutoUpdateOptions, Boundary, ComputePositionReturn, Placement } from '@floating-ui/dom';
3
3
 
4
4
  type MaybeRectElement = HTMLElement | VirtualElement | null;
@@ -105,12 +105,36 @@ declare function getPlacement(referenceOrFn: MaybeFn<MaybeRectElement>, floating
105
105
  defer?: boolean;
106
106
  }): () => void;
107
107
 
108
+ declare const cssVars: {
109
+ arrowSize: {
110
+ variable: string;
111
+ reference: string;
112
+ };
113
+ arrowSizeHalf: {
114
+ variable: string;
115
+ reference: string;
116
+ };
117
+ arrowBg: {
118
+ variable: string;
119
+ reference: string;
120
+ };
121
+ transformOrigin: {
122
+ variable: string;
123
+ reference: string;
124
+ };
125
+ arrowOffset: {
126
+ variable: string;
127
+ reference: string;
128
+ };
129
+ };
130
+
108
131
  interface GetPlacementStylesOptions {
109
132
  placement?: Placement | undefined;
110
133
  }
111
134
  declare function getPlacementStyles(options?: Pick<PositioningOptions, "placement" | "sameWidth" | "fitViewport" | "strategy">): {
112
135
  arrow: {
113
- readonly [x: string]: string;
136
+ readonly [cssVars.arrowSizeHalf.variable]: `calc(${string} / 2)`;
137
+ readonly [cssVars.arrowOffset.variable]: `calc(${string} * -1)`;
114
138
  readonly position: "absolute";
115
139
  readonly width: string;
116
140
  readonly height: string;
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { autoUpdate, arrow, offset, flip, shift, limitShift, size, hide, computePosition } from '@floating-ui/dom';
1
+ import { autoUpdate, offset, flip, shift, limitShift, arrow, size, hide, computePosition } from '@floating-ui/dom';
2
2
  import { raf, isHTMLElement, getWindow, getComputedStyle } from '@zag-js/dom-query';
3
3
  import { noop, isNull, compact, runIfFn } from '@zag-js/utils';
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/popper",
3
- "version": "1.2.0",
3
+ "version": "1.3.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.6.13",
26
- "@zag-js/utils": "1.2.0",
27
- "@zag-js/dom-query": "1.2.0"
26
+ "@zag-js/dom-query": "1.3.0",
27
+ "@zag-js/utils": "1.3.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "clean-package": "2.2.0"