@tap-payments/apple-pay-button 0.0.2-test → 0.0.3-staging

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.
Files changed (50) hide show
  1. package/README.md +204 -84
  2. package/build/@types/ApplePayButtonProps.d.ts +129 -0
  3. package/build/@types/ApplePayButtonProps.js +1 -0
  4. package/build/@types/charge.d.ts +57 -0
  5. package/build/@types/charge.js +1 -0
  6. package/build/@types/checkoutProfile.d.ts +216 -0
  7. package/build/@types/checkoutProfile.js +1 -0
  8. package/build/@types/enums.d.ts +65 -0
  9. package/build/@types/enums.js +76 -0
  10. package/build/@types/index.d.ts +6 -74
  11. package/build/@types/index.js +6 -1
  12. package/build/@types/tapLocalisation.d.ts +193 -0
  13. package/build/@types/tapLocalisation.js +1 -0
  14. package/build/@types/tapTheme.d.ts +842 -0
  15. package/build/@types/tapTheme.js +1 -0
  16. package/build/api.d.ts +29 -0
  17. package/build/api.js +244 -0
  18. package/build/constants/index.d.ts +2 -20
  19. package/build/constants/index.js +2 -20
  20. package/build/features/ApplePayButton/ApplePayButton.d.ts +4 -8
  21. package/build/features/ApplePayButton/ApplePayButton.js +30 -24
  22. package/build/features/ApplePayButton/index.d.ts +2 -2
  23. package/build/hooks/index.d.ts +1 -1
  24. package/build/hooks/index.js +1 -1
  25. package/build/hooks/useApplePay.d.ts +89 -5
  26. package/build/hooks/useApplePay.js +324 -82
  27. package/build/hooks/useMerchantApplePay.d.ts +20 -0
  28. package/build/hooks/useMerchantApplePay.js +188 -0
  29. package/build/index.d.ts +4 -4
  30. package/build/index.js +8 -5
  31. package/build/utils/config.d.ts +12 -6
  32. package/build/utils/config.js +49 -38
  33. package/build/utils/defaultValues.d.ts +2 -0
  34. package/build/utils/defaultValues.js +27 -0
  35. package/build/utils/html.d.ts +1 -3
  36. package/build/utils/html.js +4 -15
  37. package/build/utils/index.d.ts +3 -0
  38. package/build/utils/index.js +3 -0
  39. package/build/utils/theme.d.ts +12 -0
  40. package/build/utils/theme.js +61 -0
  41. package/package.json +109 -102
  42. package/build/api/app.service.d.ts +0 -11
  43. package/build/api/app.service.js +0 -217
  44. package/build/api/base.d.ts +0 -9
  45. package/build/api/base.js +0 -45
  46. package/build/api/httpClient.d.ts +0 -2
  47. package/build/api/httpClient.js +0 -16
  48. package/build/features/ApplePayButton/ApplePayButton.css +0 -51
  49. package/build/hooks/useScript.d.ts +0 -1
  50. package/build/hooks/useScript.js +0 -39
package/package.json CHANGED
@@ -1,102 +1,109 @@
1
- {
2
- "name": "@tap-payments/apple-pay-button",
3
- "version": "0.0.2-test",
4
- "description": "Apple Pay Button React Component",
5
- "main": "build/index.js",
6
- "module": "build/index.js",
7
- "types": "build/index.d.ts",
8
- "files": [
9
- "build",
10
- "README.md"
11
- ],
12
- "scripts": {
13
- "prepare": "npx husky install",
14
- "prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\" *.json *.js",
15
- "prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\" *.json *.js",
16
- "lint": "eslint src --color --ext .js,.jsx,.ts,.tsx,.json",
17
- "lint:fix": "eslint src --ext .js,.jsx,.ts,.tsx --fix",
18
- "start": "cross-env NODE_ENV=development webpack serve",
19
- "build": "cross-env NODE_ENV=production webpack",
20
- "copy:files": "copyfiles -u 1 src/**/*.css build/",
21
- "tsc:alias": "tsc-alias -p tsconfig.json",
22
- "ts:build": "rm -rf build && tsc && yarn tsc:alias && yarn copy:files",
23
- "push": "npm publish --access public"
24
- },
25
- "keywords": [],
26
- "author": {
27
- "name": "Ahmed Elsharkawy",
28
- "email": "a.elsharkawy@tap.company"
29
- },
30
- "license": "ISC",
31
- "devDependencies": {
32
- "@babel/core": "^7.18.6",
33
- "@babel/preset-env": "^7.18.6",
34
- "@babel/preset-react": "^7.18.6",
35
- "@babel/preset-typescript": "^7.18.6",
36
- "@types/crypto-js": "^4.1.1",
37
- "@types/react": "^18.0.15",
38
- "@types/react-dom": "^18.0.6",
39
- "@typescript-eslint/eslint-plugin": "^5.30.5",
40
- "@typescript-eslint/parser": "^5.30.5",
41
- "babel-loader": "^8.2.5",
42
- "copyfiles": "^2.4.1",
43
- "cross-env": "^7.0.3",
44
- "css-loader": "^6.7.1",
45
- "css-minimizer-webpack-plugin": "^4.0.0",
46
- "eslint": "^8.19.0",
47
- "eslint-config-airbnb": "^19.0.4",
48
- "eslint-config-prettier": "^8.5.0",
49
- "eslint-plugin-import": "^2.26.0",
50
- "eslint-plugin-jsx-a11y": "^6.6.0",
51
- "eslint-plugin-node": "^11.1.0",
52
- "eslint-plugin-prettier": "^4.2.1",
53
- "eslint-plugin-react": "^7.30.1",
54
- "eslint-plugin-react-hooks": "^4.6.0",
55
- "file-loader": "^6.2.0",
56
- "fork-ts-checker-webpack-plugin": "^7.2.12",
57
- "html-loader": "^3.1.2",
58
- "html-webpack-plugin": "^5.5.0",
59
- "husky": "^8.0.1",
60
- "lint-staged": "^13.0.3",
61
- "mini-css-extract-plugin": "^2.6.1",
62
- "prettier": "^2.7.1",
63
- "sass": "^1.53.0",
64
- "sass-loader": "^13.0.2",
65
- "style-loader": "^3.3.1",
66
- "terser-webpack-plugin": "^5.3.3",
67
- "tsc-alias": "^1.6.11",
68
- "typescript": "^4.7.4",
69
- "webpack": "^5.73.0",
70
- "webpack-cli": "^4.10.0",
71
- "webpack-dev-server": "^4.9.3",
72
- "webpack-merge": "^5.8.0"
73
- },
74
- "dependencies": {
75
- "axios": "^1.2.2",
76
- "react": ">=17.0.2",
77
- "react-dom": ">=17.0.2"
78
- },
79
- "peerDependencies": {
80
- "react": ">=17.0.2",
81
- "react-dom": ">=17.0.2"
82
- },
83
- "lint-staged": {
84
- "src/**/*.{ts,tsx,json,js,jsx}": [
85
- "yarn run prettier:fix",
86
- "yarn run lint",
87
- "git add ."
88
- ]
89
- },
90
- "browserslist": {
91
- "production": [
92
- ">0.2%",
93
- "not dead",
94
- "not op_mini all"
95
- ],
96
- "development": [
97
- "last 1 chrome version",
98
- "last 1 firefox version",
99
- "last 1 safari version"
100
- ]
101
- }
102
- }
1
+ {
2
+ "name": "@tap-payments/apple-pay-button",
3
+ "version": "0.0.3-staging",
4
+ "description": "Apple Pay Button React Component",
5
+ "main": "build/index.js",
6
+ "module": "build/index.js",
7
+ "types": "build/index.d.ts",
8
+ "files": [
9
+ "build",
10
+ "README.md"
11
+ ],
12
+ "scripts": {
13
+ "start": "cross-env NODE_ENV=staging webpack serve",
14
+ "prepare": "npx husky install",
15
+ "prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\" *.json *.js",
16
+ "prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\" *.json *.js",
17
+ "lint": "eslint src --color --ext .js,.jsx,.ts,.tsx,.json",
18
+ "lint:fix": "eslint src --ext .js,.jsx,.ts,.tsx --fix",
19
+ "build": "cross-env NODE_ENV=production webpack",
20
+ "copy:files": "copyfiles -u 1 src/**/*.gif build/ && copyfiles -u 1 src/**/*.css build/",
21
+ "tsc:alias": "tsc-alias -p tsconfig.json",
22
+ "ts:build": "rm -rf build && tsc && yarn tsc:alias && yarn copy:files",
23
+ "push": "npm publish --access public --tag staging"
24
+ },
25
+ "keywords": [],
26
+ "author": {
27
+ "name": "Ahmed Elsharkawy",
28
+ "email": "a.elsharkawy@tap.company"
29
+ },
30
+ "license": "ISC",
31
+ "dependencies": {
32
+ "@tap-payments/acceptance-sdk": "^0.0.46",
33
+ "@tap-payments/browser-info": "^1.0.2",
34
+ "@tap-payments/web-error-handing": "^1.0.1",
35
+ "axios": "^1.2.2",
36
+ "framer-motion": "^10.16.5",
37
+ "jsencrypt": "^3.3.2",
38
+ "lottie-react": "^2.4.0",
39
+ "react": "^18.2.0",
40
+ "react-dom": "^18.2.0"
41
+ },
42
+ "devDependencies": {
43
+ "@babel/core": "^7.18.6",
44
+ "@babel/preset-env": "^7.18.6",
45
+ "@babel/preset-react": "^7.18.6",
46
+ "@babel/preset-typescript": "^7.18.6",
47
+ "@types/applepayjs": "^14.0.3",
48
+ "@types/crypto-js": "^4.1.1",
49
+ "@types/react": "^18.0.15",
50
+ "@types/react-dom": "^18.0.6",
51
+ "@typescript-eslint/eslint-plugin": "^5.30.5",
52
+ "@typescript-eslint/parser": "^5.30.5",
53
+ "babel-loader": "^8.2.5",
54
+ "copyfiles": "^2.4.1",
55
+ "cross-env": "^7.0.3",
56
+ "css-loader": "^6.7.1",
57
+ "css-minimizer-webpack-plugin": "^4.0.0",
58
+ "eslint": "^8.19.0",
59
+ "eslint-config-airbnb": "^19.0.4",
60
+ "eslint-config-prettier": "^8.5.0",
61
+ "eslint-plugin-import": "^2.26.0",
62
+ "eslint-plugin-jsx-a11y": "^6.6.0",
63
+ "eslint-plugin-node": "^11.1.0",
64
+ "eslint-plugin-prettier": "^4.2.1",
65
+ "eslint-plugin-react": "^7.30.1",
66
+ "eslint-plugin-react-hooks": "^4.6.0",
67
+ "file-loader": "^6.2.0",
68
+ "fork-ts-checker-webpack-plugin": "^7.2.12",
69
+ "html-loader": "^3.1.2",
70
+ "html-webpack-plugin": "^5.5.0",
71
+ "husky": "^8.0.1",
72
+ "lint-staged": "^13.0.3",
73
+ "mini-css-extract-plugin": "^2.6.1",
74
+ "prettier": "^2.7.1",
75
+ "sass": "^1.53.0",
76
+ "sass-loader": "^13.0.2",
77
+ "style-loader": "^3.3.1",
78
+ "terser-webpack-plugin": "^5.3.3",
79
+ "tsc-alias": "^1.6.11",
80
+ "typescript": "^4.7.4",
81
+ "webpack": "^5.73.0",
82
+ "webpack-cli": "^4.10.0",
83
+ "webpack-dev-server": "^4.9.3",
84
+ "webpack-merge": "^5.8.0"
85
+ },
86
+ "peerDependencies": {
87
+ "react": ">=17.0.2",
88
+ "react-dom": ">=17.0.2"
89
+ },
90
+ "lint-staged": {
91
+ "src/**/*.{ts,tsx,json,js,jsx}": [
92
+ "yarn run prettier:fix",
93
+ "yarn run lint",
94
+ "git add ."
95
+ ]
96
+ },
97
+ "browserslist": {
98
+ "production": [
99
+ ">0.2%",
100
+ "not dead",
101
+ "not op_mini all"
102
+ ],
103
+ "development": [
104
+ "last 1 chrome version",
105
+ "last 1 firefox version",
106
+ "last 1 safari version"
107
+ ]
108
+ }
109
+ }
@@ -1,11 +0,0 @@
1
- import { MerchantResponse, ApplePayRequestData, ProfileResponse } from '../@types';
2
- import BaseService from './base';
3
- declare class APPService extends BaseService {
4
- constructor();
5
- init(publicKey: string, merchantId?: string): Promise<ProfileResponse>;
6
- appleSession(merchant: MerchantResponse, validationURL: string, merchantRegisteredDomain: string): Promise<any>;
7
- tapTokenization(applePaymentData: Record<string, string>, merchant: MerchantResponse): Promise<any>;
8
- createCharge(publicKey: string, merchant: MerchantResponse, request: ApplePayRequestData, cardToken: string): Promise<import("axios").AxiosResponse<any, any>>;
9
- }
10
- declare const appService: APPService;
11
- export default appService;
@@ -1,217 +0,0 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- if (typeof b !== "function" && b !== null)
10
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
- extendStatics(d, b);
12
- function __() { this.constructor = d; }
13
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
- };
15
- })();
16
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
17
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
18
- return new (P || (P = Promise))(function (resolve, reject) {
19
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
20
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
21
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
22
- step((generator = generator.apply(thisArg, _arguments || [])).next());
23
- });
24
- };
25
- var __generator = (this && this.__generator) || function (thisArg, body) {
26
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
27
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
28
- function verb(n) { return function (v) { return step([n, v]); }; }
29
- function step(op) {
30
- if (f) throw new TypeError("Generator is already executing.");
31
- while (_) try {
32
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
33
- if (y = 0, t) op = [op[0] & 2, t.value];
34
- switch (op[0]) {
35
- case 0: case 1: t = op; break;
36
- case 4: _.label++; return { value: op[1], done: false };
37
- case 5: _.label++; y = op[1]; op = [0]; continue;
38
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
39
- default:
40
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
41
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
42
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
43
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
44
- if (t[2]) _.ops.pop();
45
- _.trys.pop(); continue;
46
- }
47
- op = body.call(thisArg, _);
48
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
49
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
50
- }
51
- };
52
- import BaseService from './base';
53
- import httpClient from './httpClient';
54
- var APPService = (function (_super) {
55
- __extends(APPService, _super);
56
- function APPService() {
57
- return _super.call(this, httpClient) || this;
58
- }
59
- Object.defineProperty(APPService.prototype, "init", {
60
- enumerable: false,
61
- configurable: true,
62
- writable: true,
63
- value: function (publicKey, merchantId) {
64
- return __awaiter(this, void 0, void 0, function () {
65
- var body, data;
66
- return __generator(this, function (_a) {
67
- switch (_a.label) {
68
- case 0:
69
- body = {
70
- headers: { authorization: "Bearer ".concat(publicKey) },
71
- reqBody: { public_key: publicKey, merchant_id: merchantId }
72
- };
73
- return [4, this.post('/init', body)];
74
- case 1:
75
- data = (_a.sent()).data;
76
- if (data.errors)
77
- throw data;
78
- return [2, {
79
- merchant: data.merchant,
80
- payment_options: data.payment_options
81
- }];
82
- }
83
- });
84
- });
85
- }
86
- });
87
- Object.defineProperty(APPService.prototype, "appleSession", {
88
- enumerable: false,
89
- configurable: true,
90
- writable: true,
91
- value: function (merchant, validationURL, merchantRegisteredDomain) {
92
- return __awaiter(this, void 0, void 0, function () {
93
- var body, data;
94
- return __generator(this, function (_a) {
95
- switch (_a.label) {
96
- case 0:
97
- body = {
98
- validationUrl: validationURL,
99
- origin: merchantRegisteredDomain,
100
- merchantIdentifier: 'merchant.tap.gosell',
101
- merchantId: merchant.id,
102
- merchantName: merchant.name,
103
- session_token: merchant.session_token
104
- };
105
- return [4, this.post('/session', body)];
106
- case 1:
107
- data = (_a.sent()).data;
108
- if (data.errors)
109
- throw data;
110
- return [2, data];
111
- }
112
- });
113
- });
114
- }
115
- });
116
- Object.defineProperty(APPService.prototype, "tapTokenization", {
117
- enumerable: false,
118
- configurable: true,
119
- writable: true,
120
- value: function (applePaymentData, merchant) {
121
- return __awaiter(this, void 0, void 0, function () {
122
- var body, data;
123
- return __generator(this, function (_a) {
124
- switch (_a.label) {
125
- case 0:
126
- body = {
127
- method: 'POST',
128
- path: '/v2/token',
129
- headers: {
130
- session_token: merchant.session_token
131
- },
132
- reqBody: {
133
- type: 'applepay',
134
- token_data: applePaymentData
135
- }
136
- };
137
- return [4, this.post('/api', body)];
138
- case 1:
139
- data = (_a.sent()).data;
140
- if (data.errors)
141
- throw data;
142
- return [2, data];
143
- }
144
- });
145
- });
146
- }
147
- });
148
- Object.defineProperty(APPService.prototype, "createCharge", {
149
- enumerable: false,
150
- configurable: true,
151
- writable: true,
152
- value: function (publicKey, merchant, request, cardToken) {
153
- var body = {
154
- method: 'POST',
155
- path: '/v2/charge',
156
- headers: {
157
- session_token: merchant.session_token
158
- },
159
- reqBody: {
160
- id: null,
161
- amount: request.total.amount,
162
- currency: request.currencyCode,
163
- public_key: publicKey,
164
- product: 'GOSELL',
165
- threeDSecure: true,
166
- save_card: false,
167
- fee: 0,
168
- statement_descriptor: 'Sample',
169
- description: 'Test Description',
170
- metadata: {},
171
- reference: {
172
- transaction: 'txn_0001',
173
- order: 'ord_0001'
174
- },
175
- receipt: {
176
- email: false,
177
- sms: true
178
- },
179
- customer: {
180
- id: null,
181
- first_name: 'Hala',
182
- middle_name: null,
183
- last_name: 'Q.',
184
- email: 'email@email.com',
185
- phone: {
186
- country_code: '965',
187
- number: '00000000'
188
- }
189
- },
190
- source: {
191
- id: cardToken
192
- },
193
- hashstring: null,
194
- post: {
195
- url: null
196
- },
197
- redirect: {
198
- url: 'https://jslib.gosell.io/demo?token=63cce645332aa501e6cf768f&mode=popup'
199
- },
200
- ipaddress: null,
201
- selected_currency: request.currencyCode,
202
- selected_amount: request.total.amount,
203
- merchant: {
204
- id: merchant.id
205
- },
206
- order: {
207
- id: 'ord_06CO2023731xt7V22SC0X487'
208
- }
209
- }
210
- };
211
- return this.post('/api', body);
212
- }
213
- });
214
- return APPService;
215
- }(BaseService));
216
- var appService = new APPService();
217
- export default appService;
@@ -1,9 +0,0 @@
1
- import { AxiosInstance, AxiosRequestConfig } from 'axios';
2
- export default class BaseService {
3
- httpClient: AxiosInstance;
4
- constructor(httpClient: AxiosInstance);
5
- get(url: string, config?: AxiosRequestConfig<any>): Promise<import("axios").AxiosResponse<any, any>>;
6
- post(url: string, data?: any, config?: AxiosRequestConfig<any>): Promise<import("axios").AxiosResponse<any, any>>;
7
- put(url: string, data?: any, config?: AxiosRequestConfig<any>): Promise<import("axios").AxiosResponse<any, any>>;
8
- delete(url: string, config?: AxiosRequestConfig<any>): Promise<import("axios").AxiosResponse<any, any>>;
9
- }
package/build/api/base.js DELETED
@@ -1,45 +0,0 @@
1
- var BaseService = (function () {
2
- function BaseService(httpClient) {
3
- Object.defineProperty(this, "httpClient", {
4
- enumerable: true,
5
- configurable: true,
6
- writable: true,
7
- value: void 0
8
- });
9
- this.httpClient = httpClient;
10
- }
11
- Object.defineProperty(BaseService.prototype, "get", {
12
- enumerable: false,
13
- configurable: true,
14
- writable: true,
15
- value: function (url, config) {
16
- return this.httpClient.get(url, config);
17
- }
18
- });
19
- Object.defineProperty(BaseService.prototype, "post", {
20
- enumerable: false,
21
- configurable: true,
22
- writable: true,
23
- value: function (url, data, config) {
24
- return this.httpClient.post(url, data, config);
25
- }
26
- });
27
- Object.defineProperty(BaseService.prototype, "put", {
28
- enumerable: false,
29
- configurable: true,
30
- writable: true,
31
- value: function (url, data, config) {
32
- return this.httpClient.put(url, data, config);
33
- }
34
- });
35
- Object.defineProperty(BaseService.prototype, "delete", {
36
- enumerable: false,
37
- configurable: true,
38
- writable: true,
39
- value: function (url, config) {
40
- return this.httpClient.delete(url, config);
41
- }
42
- });
43
- return BaseService;
44
- }());
45
- export default BaseService;
@@ -1,2 +0,0 @@
1
- declare const httpClient: import("axios").AxiosInstance;
2
- export default httpClient;
@@ -1,16 +0,0 @@
1
- import axios from 'axios';
2
- var MW_BASE_URL = 'https://checkout.payments.tap.company/api';
3
- var httpClient = axios.create({
4
- baseURL: MW_BASE_URL,
5
- headers: {
6
- 'Content-Type': 'application/json',
7
- Accept: 'application/json'
8
- }
9
- });
10
- httpClient.interceptors.request.use(function (config) {
11
- return config;
12
- });
13
- httpClient.interceptors.response.use(function (response) {
14
- return response;
15
- });
16
- export default httpClient;
@@ -1,51 +0,0 @@
1
- .button-applepay-tap {
2
- appearance: none;
3
- border: none;
4
- cursor: pointer;
5
- -webkit-user-select: none;
6
- user-select: none;
7
- display: flex;
8
- position: relative;
9
- -webkit-box-pack: center;
10
- -ms-flex-pack: center;
11
- -webkit-justify-content: center;
12
- justify-content: center;
13
- -webkit-align-items: center;
14
- -webkit-box-align: center;
15
- -ms-flex-align: center;
16
- align-items: center;
17
- -webkit-margin-end: 8px;
18
- margin-inline-end: 8px;
19
- min-width: 96px;
20
- max-width: 300px;
21
- min-height: 40px;
22
- border-radius: 9px;
23
- background-color: white;
24
- width: 100%;
25
- }
26
-
27
- .button-applepay-tap:disabled {
28
- cursor: default;
29
- }
30
-
31
- .img-container {
32
- height: 24px;
33
- max-width: 80px;
34
- }
35
-
36
- .img-container img {
37
- height: 100%;
38
- width: 100%;
39
- transform: scale(1.5);
40
- filter: invert(0);
41
- }
42
-
43
- .whiteOutline {
44
- border: solid 1px gray;
45
- }
46
- .dark {
47
- background-color: black;
48
- }
49
- .dark .img-container img {
50
- filter: invert(1);
51
- }
@@ -1 +0,0 @@
1
- export declare function useScript(src: string, async?: boolean): "loading" | "ready" | "idle" | "error";
@@ -1,39 +0,0 @@
1
- import { useEffect, useState } from 'react';
2
- export function useScript(src, async) {
3
- if (async === void 0) { async = true; }
4
- var _a = useState(src ? 'loading' : 'idle'), status = _a[0], setStatus = _a[1];
5
- useEffect(function () {
6
- if (!src) {
7
- setStatus('idle');
8
- return;
9
- }
10
- var script = document.querySelector("script[src=\"".concat(src, "\"]"));
11
- if (!script) {
12
- script = document.createElement('script');
13
- script.src = src;
14
- script.async = async;
15
- script.setAttribute('data-status', 'loading');
16
- document.body.appendChild(script);
17
- var setAttributeFromEvent = function (event) {
18
- script.setAttribute('data-status', event.type === 'load' ? 'ready' : 'error');
19
- };
20
- script.addEventListener('load', setAttributeFromEvent);
21
- script.addEventListener('error', setAttributeFromEvent);
22
- }
23
- else {
24
- setStatus(script.getAttribute('data-status'));
25
- }
26
- var setStateFromEvent = function (event) {
27
- setStatus(event.type === 'load' ? 'ready' : 'error');
28
- };
29
- script.addEventListener('load', setStateFromEvent);
30
- script.addEventListener('error', setStateFromEvent);
31
- return function () {
32
- if (script) {
33
- script.removeEventListener('load', setStateFromEvent);
34
- script.removeEventListener('error', setStateFromEvent);
35
- }
36
- };
37
- }, [src]);
38
- return status;
39
- }