@citygross/components 0.8.94 → 0.8.95

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.
@@ -1,7 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  declare type TSkipTo = {
3
+ elementClick?: boolean;
3
4
  selector: string;
4
5
  text: string;
5
6
  };
6
- export declare const SkipTo: ({ selector, text }: TSkipTo) => JSX.Element;
7
+ export declare const SkipTo: ({ elementClick, selector, text }: TSkipTo) => JSX.Element;
7
8
  export {};
@@ -10,13 +10,14 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
10
10
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
11
11
 
12
12
  var SkipTo = function (_a) {
13
- var selector = _a.selector, text = _a.text;
13
+ var _b = _a.elementClick, elementClick = _b === void 0 ? false : _b, selector = _a.selector, text = _a.text;
14
14
  var handleSkip = function (e) {
15
15
  e.preventDefault();
16
16
  var element = document.querySelector(selector);
17
17
  if (element) {
18
18
  element.focus();
19
19
  element.scrollIntoView({ behavior: 'smooth', block: 'start' });
20
+ elementClick && element.click();
20
21
  }
21
22
  };
22
23
  return (React__default["default"].createElement(SkipTo_styles.SkipLink, { href: "#", onClick: handleSkip }, text));
@@ -1 +1 @@
1
- {"version":3,"file":"SkipTo.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"SkipTo.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,13 +2,14 @@ import React from 'react';
2
2
  import { SkipLink } from './SkipTo.styles.js';
3
3
 
4
4
  var SkipTo = function (_a) {
5
- var selector = _a.selector, text = _a.text;
5
+ var _b = _a.elementClick, elementClick = _b === void 0 ? false : _b, selector = _a.selector, text = _a.text;
6
6
  var handleSkip = function (e) {
7
7
  e.preventDefault();
8
8
  var element = document.querySelector(selector);
9
9
  if (element) {
10
10
  element.focus();
11
11
  element.scrollIntoView({ behavior: 'smooth', block: 'start' });
12
+ elementClick && element.click();
12
13
  }
13
14
  };
14
15
  return (React.createElement(SkipLink, { href: "#", onClick: handleSkip }, text));
@@ -1 +1 @@
1
- {"version":3,"file":"SkipTo.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"SkipTo.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citygross/components",
3
- "version": "0.8.94",
3
+ "version": "0.8.95",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "./build/cjs/components/src/index.js",
@@ -76,5 +76,5 @@
76
76
  "react-slick": "^0.30.1",
77
77
  "slick-carousel": "^1.8.1"
78
78
  },
79
- "gitHead": "0b0bdd724b26d35317a6d16f8bb32fee0d01e803"
79
+ "gitHead": "26f256600a5527513aa54c1bee22e3226674668b"
80
80
  }