@zag-js/popper 0.0.0-dev-20221005155029 → 0.0.0-dev-20221018132023

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.ts CHANGED
@@ -51,7 +51,7 @@ declare type PositioningOptions = {
51
51
  /**
52
52
  * The overflow boundary of the reference element
53
53
  */
54
- boundary?: Boundary;
54
+ boundary?: Boundary | (() => Boundary);
55
55
  /**
56
56
  * Options to activate auto-update listeners
57
57
  */
package/dist/index.js CHANGED
@@ -208,10 +208,11 @@ function getPlacement(reference, floating, opts = {}) {
208
208
  const options = Object.assign({}, defaultOptions, opts);
209
209
  const arrowEl = floating.querySelector("[data-part=arrow]");
210
210
  const middleware = [];
211
+ const boundary = typeof options.boundary === "function" ? options.boundary() : options.boundary;
211
212
  if (options.flip) {
212
213
  middleware.push(
213
214
  (0, import_dom2.flip)({
214
- boundary: options.boundary,
215
+ boundary,
215
216
  padding: options.overflowPadding
216
217
  })
217
218
  );
@@ -225,7 +226,7 @@ function getPlacement(reference, floating, opts = {}) {
225
226
  }
226
227
  middleware.push(
227
228
  (0, import_dom2.shift)({
228
- boundary: options.boundary,
229
+ boundary,
229
230
  crossAxis: options.overlap,
230
231
  padding: options.overflowPadding
231
232
  })
package/dist/index.mjs CHANGED
@@ -180,10 +180,11 @@ function getPlacement(reference, floating, opts = {}) {
180
180
  const options = Object.assign({}, defaultOptions, opts);
181
181
  const arrowEl = floating.querySelector("[data-part=arrow]");
182
182
  const middleware = [];
183
+ const boundary = typeof options.boundary === "function" ? options.boundary() : options.boundary;
183
184
  if (options.flip) {
184
185
  middleware.push(
185
186
  flip({
186
- boundary: options.boundary,
187
+ boundary,
187
188
  padding: options.overflowPadding
188
189
  })
189
190
  );
@@ -197,7 +198,7 @@ function getPlacement(reference, floating, opts = {}) {
197
198
  }
198
199
  middleware.push(
199
200
  shift({
200
- boundary: options.boundary,
201
+ boundary,
201
202
  crossAxis: options.overlap,
202
203
  padding: options.overflowPadding
203
204
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/popper",
3
- "version": "0.0.0-dev-20221005155029",
3
+ "version": "0.0.0-dev-20221018132023",
4
4
  "description": "Dynamic positioning logic for ui machines",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -25,11 +25,11 @@
25
25
  "url": "https://github.com/chakra-ui/zag/issues"
26
26
  },
27
27
  "dependencies": {
28
- "@floating-ui/dom": "1.0.1"
28
+ "@floating-ui/dom": "1.0.2"
29
29
  },
30
30
  "devDependencies": {
31
- "@zag-js/dom-utils": "0.0.0-dev-20221005155029",
32
- "@zag-js/utils": "0.0.0-dev-20221005155029"
31
+ "@zag-js/dom-utils": "0.0.0-dev-20221018132023",
32
+ "@zag-js/utils": "0.1.6"
33
33
  },
34
34
  "scripts": {
35
35
  "build-fast": "tsup src/index.ts --format=esm,cjs",