@seamlessdocs/payment-modals 1.0.48 → 1.0.50

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/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@seamlessdocs/payment-modals",
3
- "version": "1.0.48",
4
- "description": "",
3
+ "version": "1.0.50",
4
+ "description": "Payment modals for SeamlessDocs",
5
5
  "main": "build/payment-modals.js",
6
+ "repository": {
7
+ "url": "https://github.com/SeamlessDocsDev/PaymentModals"
8
+ },
6
9
  "scripts": {
7
10
  "start": "webpack-dev-server --mode development",
8
11
  "dev": "webpack --mode development ./src/index.jsx --output ./build/payment-modals.js",
@@ -53,6 +56,6 @@
53
56
  "react-dom": "^16.10.1",
54
57
  "react-inlinesvg": "^1.1.7",
55
58
  "react-select": "^3.1.0",
56
- "react-tooltip": "^4.2.9"
59
+ "react-tippy": "^1.4.0"
57
60
  }
58
61
  }
@@ -21,20 +21,11 @@
21
21
  line-height: 13px;
22
22
  }
23
23
 
24
- .validationIcon {
25
- position: absolute;
26
- top: 0;
27
- right: 0;
28
-
29
- margin: 8px;
30
- }
31
-
32
24
  .invalidField {
33
25
  background: #fbf3f2;
34
26
  }
35
27
 
36
- .tooltip{
37
- padding: 8px;
38
-
39
- text-align: center;
28
+ .fieldHeader {
29
+ display: flex;
30
+ justify-content: space-between;
40
31
  }
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import classNames from 'classnames';
3
3
  import PropTypes from 'prop-types';
4
- import ReactTooltip from 'react-tooltip';
4
+ import { Tooltip } from 'react-tippy';
5
5
 
6
6
  import { Field } from 'formik';
7
7
 
@@ -10,6 +10,8 @@ import validIcon from '../../../../assets/img/valid-icon.svg';
10
10
 
11
11
  import styles from './FieldContainer.module.css';
12
12
 
13
+ import 'react-tippy/dist/tippy.css';
14
+
13
15
  const FieldContainer = ({ name, label, children }) => {
14
16
  return (
15
17
  <Field name={name}>
@@ -19,30 +21,17 @@ const FieldContainer = ({ name, label, children }) => {
19
21
  [styles.invalidField]: meta.touched && meta.error
20
22
  })}
21
23
  >
22
- <div className={styles.fieldName}>{label}</div>
23
- {meta.touched && meta.error && (
24
- <>
25
- <img
26
- data-tip
27
- data-for={name}
28
- className={styles.validationIcon}
29
- src={errorIcon}
30
- alt="error"
31
- />
32
- <ReactTooltip
33
- className={styles.tooltip}
34
- id={name}
35
- place="top"
36
- type="dark"
37
- effect="solid"
38
- >
39
- <span>{meta.error}</span>
40
- </ReactTooltip>
41
- </>
42
- )}
43
- {meta.touched && !meta.error && (
44
- <img className={styles.validationIcon} src={validIcon} alt="valid" />
45
- )}
24
+ <div className={styles.fieldHeader}>
25
+ <div className={styles.fieldName}>{label}</div>
26
+ {meta.touched && meta.error && (
27
+ <Tooltip title={meta.error} arrow>
28
+ <img src={errorIcon} alt="error" />
29
+ </Tooltip>
30
+ )}
31
+ {meta.touched && !meta.error && (
32
+ <img className={styles.validationIcon} src={validIcon} alt="valid" />
33
+ )}
34
+ </div>
46
35
 
47
36
  {children(field)}
48
37
  </div>
package/webpack.config.js CHANGED
@@ -1,78 +1,81 @@
1
1
  const path = require('path');
2
2
 
3
- module.exports = {
4
- entry: {
5
- main: './src/index.jsx'
6
- },
7
- output: {
8
- filename: 'payment-modals.js',
9
- path: '/build',
10
- library: 'payment-modals',
11
- libraryTarget: 'umd',
12
- umdNamedDefine: true
13
- },
14
- module: {
15
- rules: [
16
- {
17
- test: /\.(js|jsx)$/,
18
- exclude: /node_modules/,
19
- use: {
20
- loader: 'babel-loader'
21
- }
22
- },
23
- {
24
- test: /\.css$/,
25
- use: [
26
- 'style-loader',
27
- {
28
- loader: 'css-loader',
3
+ module.exports = (_env, argv) => {
4
+ const isProduction = argv.mode === 'production';
5
+ return {
6
+ entry: {
7
+ main: './src/index.jsx'
8
+ },
9
+ output: {
10
+ filename: 'payment-modals.js',
11
+ path: '/build',
12
+ library: 'payment-modals',
13
+ libraryTarget: 'umd',
14
+ umdNamedDefine: true
15
+ },
16
+ module: {
17
+ rules: [
18
+ {
19
+ test: /\.(js|jsx)$/,
20
+ exclude: /node_modules/,
21
+ use: {
22
+ loader: 'babel-loader'
23
+ }
24
+ },
25
+ {
26
+ test: /\.css$/,
27
+ use: [
28
+ 'style-loader',
29
+ {
30
+ loader: 'css-loader',
31
+ options: {
32
+ importLoaders: 1,
33
+ modules: true
34
+ }
35
+ }
36
+ ],
37
+ include: /\.module\.css$/
38
+ },
39
+ {
40
+ test: /\.css$/,
41
+ use: ['style-loader', 'css-loader'],
42
+ exclude: /\.module\.css$/
43
+ },
44
+ {
45
+ test: /\.(svg|png|jpg|jpeg|gif)$/,
46
+ use: {
47
+ loader: 'url-loader',
29
48
  options: {
30
- importLoaders: 1,
31
- modules: true
49
+ name: '[path][name].[ext]'
32
50
  }
33
51
  }
34
- ],
35
- include: /\.module\.css$/
36
- },
37
- {
38
- test: /\.css$/,
39
- use: ['style-loader', 'css-loader'],
40
- exclude: /\.module\.css$/
41
- },
42
- {
43
- test: /\.(svg|png|jpg|jpeg|gif)$/,
44
- use: {
45
- loader: 'url-loader',
46
- options: {
47
- name: '[path][name].[ext]'
48
- }
49
- }
50
- },
51
- {
52
- test: /\.(html)$/,
53
- use: {
54
- loader: 'html-loader',
55
- options: {
56
- attrs: ['img:src', 'link:href']
52
+ },
53
+ {
54
+ test: /\.(html)$/,
55
+ use: {
56
+ loader: 'html-loader',
57
+ options: {
58
+ attrs: ['img:src', 'link:href']
59
+ }
57
60
  }
58
61
  }
62
+ ]
63
+ },
64
+ devServer: {
65
+ port: 9000,
66
+ compress: true,
67
+ open: true,
68
+ publicPath: '/build/',
69
+ contentBase: path.join(__dirname, 'build'),
70
+ historyApiFallback: true
71
+ },
72
+ devtool: isProduction ? false : 'inline-source-map',
73
+ resolve: {
74
+ modules: [path.join(__dirname, 'src'), 'node_modules'],
75
+ extensions: ['.js', '.jsx', '.scss'],
76
+ alias: {
77
+ 'react-virtualized/List': 'react-virtualized/dist/es/List'
59
78
  }
60
- ]
61
- },
62
- devServer: {
63
- port: 9000,
64
- compress: true,
65
- open: true,
66
- publicPath: '/build/',
67
- contentBase: path.join(__dirname, 'build'),
68
- historyApiFallback: true
69
- },
70
- devtool: 'inline-source-map',
71
- resolve: {
72
- modules: [path.join(__dirname, 'src'), 'node_modules'],
73
- extensions: ['.js', '.jsx', '.scss'],
74
- alias: {
75
- 'react-virtualized/List': 'react-virtualized/dist/es/List'
76
79
  }
77
- }
80
+ };
78
81
  };