@placetopay/lightbox-sdk 2.0.1 → 2.0.2

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,6 @@ const unmountLightbox = (listener, origin) => {
49
49
  };
50
50
  const mountStyles = (styles) => {
51
51
  var _a;
52
- console.log('mountStyles', styles);
53
52
  setStyle(Styles.BACKDROP_COLOR, buildBackdrop(styles.backdropColor, styles.backdropOpacity));
54
53
  setStyle(Styles.ROUNDED, `${(_a = styles.rounded) !== null && _a !== void 0 ? _a : 0}px`);
55
54
  setStyle(Styles.MAX_HEIGHT, buildDimension('height', styles.height, styles.dimension));
@@ -62,7 +61,7 @@ const buildBackdrop = (color, opacity) => {
62
61
  return `rgba(${backdrop.join(', ')})`;
63
62
  };
64
63
  const buildDimension = (type, value = '', dimension) => {
65
- let result = value;
64
+ let result = value.toString();
66
65
  if (dimension)
67
66
  result = Dimensions[dimension.toUpperCase()][type];
68
67
  if (result.match(/^\d+%$/) || result.match(/^\d+px$/))
package/dist/types.d.ts CHANGED
@@ -6,8 +6,8 @@ export declare type LightboxStyles = {
6
6
  backdropColor?: string;
7
7
  backdropOpacity?: number;
8
8
  dimension?: 'sm' | 'md' | 'lg';
9
- height?: string;
10
- width?: string;
9
+ height?: string | number;
10
+ width?: string | number;
11
11
  rounded?: number;
12
12
  };
13
13
  export declare type InitOptions = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@placetopay/lightbox-sdk",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Small javascript library to encapsulate websites in a lightbox with configurable styles and behaviors",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",