@primer/behaviors 1.1.2 → 1.1.3-rc.163fb20

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/CHANGELOG.md ADDED
@@ -0,0 +1,45 @@
1
+ # @primer/behaviors
2
+
3
+ ## 1.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#93](https://github.com/primer/behaviors/pull/93) [`e5aaf68`](https://github.com/primer/behaviors/commit/e5aaf688b084bf6e425c6bdb0963aa50aacf8fa4) Thanks [@siddharthkp](https://github.com/siddharthkp)! - Anchored position: Add check for boundary collision on left side
8
+
9
+ ## 1.1.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [#78](https://github.com/primer/behaviors/pull/78) [`62e5459`](https://github.com/primer/behaviors/commit/62e545913dae8ca42f88fd6184f190cdf3df9c4c) Thanks [@siddharthkp](https://github.com/siddharthkp)! - Anchored Position: Add alternative alignments to flip to if there isn't enough space
14
+
15
+ ## 1.1.1
16
+
17
+ ### Patch Changes
18
+
19
+ - [#73](https://github.com/primer/behaviors/pull/73) [`a96d60f`](https://github.com/primer/behaviors/commit/a96d60fdb2a2ffdde71a22ea29fa2c788bf4c6aa) Thanks [@dgreif](https://github.com/dgreif)! - Add `import` conditional export type to the package for better NodeJS ESM compatibility
20
+
21
+ ## 1.1.0
22
+
23
+ ### Minor Changes
24
+
25
+ - [#52](https://github.com/primer/behaviors/pull/52) [`1aa3027`](https://github.com/primer/behaviors/commit/1aa302782e3c833f9d9c27f602a046e81f05c3e5) Thanks [@owenniblock](https://github.com/owenniblock)! - Update focusTrap to use new methodology after accessibility discussions
26
+
27
+ ## 1.0.3
28
+
29
+ ### Patch Changes
30
+
31
+ - [#42](https://github.com/primer/behaviors/pull/42) [`41945a3`](https://github.com/primer/behaviors/commit/41945a37ef07da82ce5a29feb03d7a7d96ec76ea) Thanks [@dgreif](https://github.com/dgreif)! - Build both esm and cjs output for the package
32
+
33
+ ## 1.0.2
34
+
35
+ ### Patch Changes
36
+
37
+ - [#17](https://github.com/primer/behaviors/pull/17) [`9194ba4`](https://github.com/primer/behaviors/commit/9194ba403502b4acba0be03bed1a765c1ba81340) Thanks [@dgreif](https://github.com/dgreif)! - Correct margin orientation for `scrollIntoView`
38
+
39
+ * [#18](https://github.com/primer/behaviors/pull/18) [`3b4dd41`](https://github.com/primer/behaviors/commit/3b4dd414175417f83bd144939fe74b2a01bc7136) Thanks [@dgreif](https://github.com/dgreif)! - Export utils as submodule
40
+
41
+ ## 1.0.1
42
+
43
+ ### Patch Changes
44
+
45
+ - [#10](https://github.com/primer/behaviors/pull/10) [`88b6f34`](https://github.com/primer/behaviors/commit/88b6f34bf4874f3c81473020a01a58b197dd6e16) Thanks [@dgreif](https://github.com/dgreif)! - Set up changesets
@@ -233,6 +233,7 @@ function shouldRecalculateAlignment(align, currentPos, containerDimensions, elem
233
233
  return currentPos.left < containerDimensions.left;
234
234
  }
235
235
  else if (align === 'start' || align === 'center') {
236
- return currentPos.left + elementDimensions.width > containerDimensions.left + containerDimensions.width;
236
+ return (currentPos.left + elementDimensions.width > containerDimensions.left + containerDimensions.width ||
237
+ currentPos.left < containerDimensions.left);
237
238
  }
238
239
  }
@@ -229,6 +229,7 @@ function shouldRecalculateAlignment(align, currentPos, containerDimensions, elem
229
229
  return currentPos.left < containerDimensions.left;
230
230
  }
231
231
  else if (align === 'start' || align === 'center') {
232
- return currentPos.left + elementDimensions.width > containerDimensions.left + containerDimensions.width;
232
+ return (currentPos.left + elementDimensions.width > containerDimensions.left + containerDimensions.width ||
233
+ currentPos.left < containerDimensions.left);
233
234
  }
234
235
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/behaviors",
3
- "version": "1.1.2",
3
+ "version": "1.1.3-rc.163fb20",
4
4
  "description": "Shared behaviors for JavaScript components",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",