@primer/behaviors 0.0.0-2021113211757 → 0.0.0-2021113224447

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.
@@ -4,4 +4,4 @@ export interface ScrollIntoViewOptions {
4
4
  endMargin?: number;
5
5
  behavior?: ScrollBehavior;
6
6
  }
7
- export declare const scrollIntoView: (child: HTMLElement, viewingArea: HTMLElement, { direction, startMargin, endMargin, behavior }?: ScrollIntoViewOptions) => void;
7
+ export declare function scrollIntoView(child: HTMLElement, viewingArea: HTMLElement, { direction, startMargin, endMargin, behavior }?: ScrollIntoViewOptions): void;
@@ -1,4 +1,4 @@
1
- export const scrollIntoView = (child, viewingArea, { direction = 'vertical', startMargin = 8, endMargin = 0, behavior = 'smooth' } = {}) => {
1
+ export function scrollIntoView(child, viewingArea, { direction = 'vertical', startMargin = 8, endMargin = 0, behavior = 'smooth' } = {}) {
2
2
  const startSide = direction === 'vertical' ? 'top' : 'left';
3
3
  const endSide = direction === 'vertical' ? 'bottom' : 'right';
4
4
  const scrollSide = direction === 'vertical' ? 'scrollTop' : 'scrollLeft';
@@ -14,4 +14,4 @@ export const scrollIntoView = (child, viewingArea, { direction = 'vertical', sta
14
14
  const scrollHeightToChildBottom = childEnd - viewingAreaEnd + viewingArea[scrollSide];
15
15
  viewingArea.scrollTo({ behavior, [startSide]: scrollHeightToChildBottom + startMargin });
16
16
  }
17
- };
17
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/behaviors",
3
- "version": "0.0.0-2021113211757",
3
+ "version": "0.0.0-2021113224447",
4
4
  "description": "Shared behaviors for JavaScript components",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",