@longline/aqua-ui 1.0.38 → 1.0.40

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.
@@ -49,7 +49,7 @@ interface IProps {
49
49
  /**
50
50
  * Fired when the button is clicked.
51
51
  */
52
- onClick: () => void;
52
+ onClick: (e?: React.MouseEvent) => void;
53
53
  }
54
54
  /**
55
55
  * Floating action buttons (FABs) help people take primary ations and are used
@@ -28,11 +28,11 @@ import * as React from 'react';
28
28
  import styled, { css } from 'styled-components';
29
29
  import { Icon } from '../Icon';
30
30
  var FabBase = function (props) {
31
- var handleClick = function () {
31
+ var handleClick = function (e) {
32
32
  if (props.disabled)
33
33
  return;
34
34
  if (props.onClick)
35
- props.onClick();
35
+ props.onClick(e);
36
36
  };
37
37
  return (React.createElement("button", { tabIndex: props.disabled ? -1 : 0, className: props.className, onClick: handleClick, title: props.title },
38
38
  typeof props.icon == "string" && React.createElement(Icon, { url: props.icon }),
@@ -41,7 +41,7 @@ interface IProps {
41
41
  /**
42
42
  * Fired when the button is clicked.
43
43
  */
44
- onClick: () => void;
44
+ onClick: (e?: React.MouseEvent) => void;
45
45
  }
46
46
  /**
47
47
  * Primary buttons denote the primary action. They may have icons or not and
@@ -29,11 +29,11 @@ import styled, { css } from 'styled-components';
29
29
  import { darken } from '../../helper/darken';
30
30
  import { Icon } from '../Icon';
31
31
  var PrimaryButtonBase = function (props) {
32
- var handleClick = function () {
32
+ var handleClick = function (e) {
33
33
  if (props.disabled)
34
34
  return;
35
35
  if (props.onClick)
36
- props.onClick();
36
+ props.onClick(e);
37
37
  };
38
38
  return (React.createElement("button", { tabIndex: props.disabled ? -1 : 0, className: props.className, onClick: handleClick, title: props.title },
39
39
  props.icon && typeof props.icon == "string" && React.createElement(Icon, { url: props.icon }),
@@ -39,7 +39,7 @@ interface IProps {
39
39
  /**
40
40
  * Fired when the button is clicked.
41
41
  */
42
- onClick: () => void;
42
+ onClick: (e?: React.MouseEvent) => void;
43
43
  }
44
44
  /**
45
45
  * The `SecondaryButton` is a small button that holds only an icon. It has no
@@ -28,11 +28,11 @@ import * as React from 'react';
28
28
  import styled, { css } from 'styled-components';
29
29
  import { Icon } from '../Icon';
30
30
  var SecondaryButtonBase = function (props) {
31
- var handleClick = function () {
31
+ var handleClick = function (e) {
32
32
  if (props.disabled)
33
33
  return;
34
34
  if (props.onClick)
35
- props.onClick();
35
+ props.onClick(e);
36
36
  };
37
37
  return (React.createElement("button", { tabIndex: props.disabled ? -1 : 0, className: props.className, onClick: handleClick, title: props.title },
38
38
  typeof props.icon == "string" && React.createElement(Icon, { url: props.icon }),
@@ -12,7 +12,7 @@ interface IProps {
12
12
  /**
13
13
  * Fired when the button is clicked.
14
14
  */
15
- onClick: () => void;
15
+ onClick: (e?: React.MouseEvent) => void;
16
16
  }
17
17
  /**
18
18
  * The `TertiaryButton` is connected to a specific area or component such as
@@ -27,11 +27,11 @@ var __rest = (this && this.__rest) || function (s, e) {
27
27
  import * as React from 'react';
28
28
  import styled, { css } from 'styled-components';
29
29
  var TertiaryButtonBase = function (props) {
30
- var handleClick = function () {
30
+ var handleClick = function (e) {
31
31
  if (props.disabled)
32
32
  return;
33
33
  if (props.onClick)
34
- props.onClick();
34
+ props.onClick(e);
35
35
  };
36
36
  return (React.createElement("button", { className: props.className, onClick: handleClick }, props.children));
37
37
  };
package/map/Map/Map.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { Map as OriginalMap } from 'mapbox-gl';
3
3
  import { ViewState } from 'react-map-gl';
4
+ import { MapLayerMouseEvent } from 'mapbox-gl';
4
5
  interface IProps {
5
6
  /** @ignore */
6
7
  children?: React.ReactNode;
@@ -61,6 +62,10 @@ interface IProps {
61
62
  * Fired when map is loaded.
62
63
  */
63
64
  onLoad?: (map: OriginalMap) => void;
65
+ /**
66
+ * Fired when map is clicked.
67
+ */
68
+ onClick?: (e: MapLayerMouseEvent) => void;
64
69
  }
65
70
  declare const useViewState: () => ViewState;
66
71
  declare const Map: ({ longitude, latitude, zoom, pitch, bearing, clipped, logoPosition, minZoom, maxZoom, ...props }: IProps) => React.JSX.Element;
package/map/Map/Map.js CHANGED
@@ -207,7 +207,7 @@ var MapBase = function (props) {
207
207
  var handleMove = function (e) {
208
208
  setViewState(e.viewState);
209
209
  };
210
- return (React.createElement(GLMap, __assign({}, viewState, { mapboxAccessToken: props.token, style: { width: '100%', height: '100%', minHeight: '300px', font: theme.font.bodyMedium }, logoPosition: props.logoPosition, mapStyle: props.style, minZoom: 1, maxZoom: 20, doubleClickZoom: true, onMove: handleMove, onLoad: handleLoad }),
210
+ return (React.createElement(GLMap, __assign({}, viewState, { mapboxAccessToken: props.token, style: { width: '100%', height: '100%', minHeight: '300px', font: theme.font.bodyMedium }, logoPosition: props.logoPosition, mapStyle: props.style, minZoom: props.minZoom, maxZoom: props.maxZoom, doubleClickZoom: true, onMove: handleMove, onLoad: handleLoad, onClick: props.onClick }),
211
211
  props.clipped && React.createElement(React.Fragment, null,
212
212
  React.createElement(Source, { type: "raster", tiles: ["https://api.mapbox.com/raster/v1/mapbox.mapbox-terrain-dem-v1/{z}/{x}/{y}.webp?access_token=".concat(props.token)] },
213
213
  React.createElement(Layer, { id: "overlay", type: "raster" })),
@@ -33,7 +33,7 @@ interface IProps {
33
33
  /**
34
34
  * Fired when the map button is clicked.
35
35
  */
36
- onClick: () => void;
36
+ onClick: (e?: React.MouseEvent) => void;
37
37
  }
38
38
  /**
39
39
  * A `MapButton` is a square button to be used on a Mapbox map. It must
@@ -29,11 +29,11 @@ import styled, { css } from 'styled-components';
29
29
  import { Hint } from './Hint';
30
30
  import { MapControl } from '../MapControl';
31
31
  var MapButtonBase = function (props) {
32
- var handleClick = function () {
32
+ var handleClick = function (e) {
33
33
  if (props.disabled)
34
34
  return;
35
35
  if (props.onClick)
36
- props.onClick();
36
+ props.onClick(e);
37
37
  };
38
38
  var renderButton = function () {
39
39
  return React.createElement("div", { className: props.className, tabIndex: props.disabled ? -1 : 0, onClick: handleClick },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longline/aqua-ui",
3
- "version": "1.0.38",
3
+ "version": "1.0.40",
4
4
  "description": "AquaUI",
5
5
  "author": "Alexander van Oostenrijk / Longline Environment",
6
6
  "license": "Commercial",