ouisys-component-library 0.0.1 → 0.0.3
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/README.md +5 -2
- package/build/index.es.js +5 -80
- package/build/index.es.js.map +1 -1
- package/build/index.js +5 -103
- package/build/index.js.map +1 -1
- package/build/src/Disclaimers/Disclaimers.d.ts +3 -0
- package/build/src/Disclaimers/Disclaimers.stories.d.ts +41 -0
- package/build/src/Disclaimers/Disclaimers.test.d.ts +1 -0
- package/build/{Disclaimers → src/Disclaimers}/Disclaimers.types.d.ts +16 -1
- package/build/src/MOLink/MOLink.d.ts +4 -0
- package/build/src/MOLink/MOLink.stories.d.ts +32 -0
- package/build/src/MOLink/MOLink.test.d.ts +1 -0
- package/build/src/MOLink/MOLink.types.d.ts +10 -0
- package/build/src/PricePoint/PricePoint.d.ts +4 -0
- package/build/src/PricePoint/PricePoint.stories.d.ts +41 -0
- package/build/src/PricePoint/PricePoint.test.d.ts +1 -0
- package/build/src/index.d.ts +2 -0
- package/build/src/utils/test/index.d.ts +7 -0
- package/package.json +34 -8
- package/build/Disclaimers/Disclaimers.d.ts +0 -3
- package/build/Disclaimers/Disclaimers.stories.d.ts +0 -7
- package/build/index.d.ts +0 -2
package/README.md
CHANGED
|
@@ -6,11 +6,10 @@ The code contained in this repository is a Component Library.
|
|
|
6
6
|
|
|
7
7
|
- **You don't have to clone this repo** in order to use the library, and this Component Library.
|
|
8
8
|
|
|
9
|
-
|
|
10
9
|
## Install CLI
|
|
11
10
|
|
|
12
11
|
```bash
|
|
13
|
-
yarn
|
|
12
|
+
yarn
|
|
14
13
|
```
|
|
15
14
|
|
|
16
15
|
### Storybook local env.
|
|
@@ -39,6 +38,10 @@ Alternatively you can add the `--watch` flag for continued refresh and testing,
|
|
|
39
38
|
|
|
40
39
|
## Usage
|
|
41
40
|
|
|
41
|
+
```bash
|
|
42
|
+
yarn add ouisys-component-library@latest
|
|
43
|
+
```
|
|
44
|
+
|
|
42
45
|
```typescript
|
|
43
46
|
import React from 'react';
|
|
44
47
|
import { Button, ButtonProps } from 'ouisys-component-library/Button';
|
package/build/index.es.js
CHANGED
|
@@ -1,82 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
var styles = {"wrapper":"Disclaimers-module_wrapper__yyrGN"};
|
|
4
|
-
|
|
5
|
-
var classnames = {exports: {}};
|
|
6
|
-
|
|
1
|
+
import e from"react";var r,t={exports:{}};
|
|
7
2
|
/*!
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
(function (module) {
|
|
14
|
-
/* global define */
|
|
15
|
-
|
|
16
|
-
(function () {
|
|
17
|
-
|
|
18
|
-
var hasOwn = {}.hasOwnProperty;
|
|
19
|
-
|
|
20
|
-
function classNames() {
|
|
21
|
-
var classes = [];
|
|
22
|
-
|
|
23
|
-
for (var i = 0; i < arguments.length; i++) {
|
|
24
|
-
var arg = arguments[i];
|
|
25
|
-
if (!arg) continue;
|
|
26
|
-
|
|
27
|
-
var argType = typeof arg;
|
|
28
|
-
|
|
29
|
-
if (argType === 'string' || argType === 'number') {
|
|
30
|
-
classes.push(arg);
|
|
31
|
-
} else if (Array.isArray(arg)) {
|
|
32
|
-
if (arg.length) {
|
|
33
|
-
var inner = classNames.apply(null, arg);
|
|
34
|
-
if (inner) {
|
|
35
|
-
classes.push(inner);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
} else if (argType === 'object') {
|
|
39
|
-
if (arg.toString === Object.prototype.toString) {
|
|
40
|
-
for (var key in arg) {
|
|
41
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
42
|
-
classes.push(key);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
} else {
|
|
46
|
-
classes.push(arg.toString());
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return classes.join(' ');
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
if (module.exports) {
|
|
55
|
-
classNames.default = classNames;
|
|
56
|
-
module.exports = classNames;
|
|
57
|
-
} else {
|
|
58
|
-
window.classNames = classNames;
|
|
59
|
-
}
|
|
60
|
-
}());
|
|
61
|
-
}(classnames));
|
|
62
|
-
|
|
63
|
-
var cn = classnames.exports;
|
|
64
|
-
|
|
65
|
-
var Disclaimers = function (_a) {
|
|
66
|
-
var locale = _a.locale, _b = _a.className, className = _b === void 0 ? '' : _b, legals = _a.legals, flow = _a.flow, _c = _a.dataQaId, dataQaId = _c === void 0 ? 'disclaimers' : _c;
|
|
67
|
-
var filteredLegals = legals.filter(function (obj) { return obj.flow === flow; });
|
|
68
|
-
var legalsArr = flow ? filteredLegals : legals;
|
|
69
|
-
var arrayToObject = function (array) {
|
|
70
|
-
return array.reduce(function (obj, item) {
|
|
71
|
-
obj[item.language] = item;
|
|
72
|
-
return obj;
|
|
73
|
-
}, {});
|
|
74
|
-
};
|
|
75
|
-
var legalsObject = arrayToObject(legalsArr);
|
|
76
|
-
var disclaimer = (legalsObject[locale] || '').disclaimer;
|
|
77
|
-
return (React.createElement("div", { "data-qa-id": dataQaId, className: cn(className, styles.wrapper) },
|
|
78
|
-
React.createElement("div", { dangerouslySetInnerHTML: { __html: disclaimer } })));
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
export { Disclaimers };
|
|
3
|
+
Copyright (c) 2018 Jed Watson.
|
|
4
|
+
Licensed under the MIT License (MIT), see
|
|
5
|
+
http://jedwatson.github.io/classnames
|
|
6
|
+
*/r=t,function(){var e={}.hasOwnProperty;function t(){for(var r=[],a=0;a<arguments.length;a++){var n=arguments[a];if(n){var i=typeof n;if("string"===i||"number"===i)r.push(n);else if(Array.isArray(n)){if(n.length){var o=t.apply(null,n);o&&r.push(o)}}else if("object"===i){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){r.push(n.toString());continue}for(var l in n)e.call(n,l)&&n[l]&&r.push(l)}}}return r.join(" ")}r.exports?(t.default=t,r.exports=t):window.classNames=t}();var a=t.exports,n="Disclaimers-module_wrapper__yyrGN";function i(r){var t=r.locale,i=r.className,o=void 0===i?"":i,l=r.legals,s=r.flow,c=r.dataQaId,u=void 0===c?"disclaimers":c,d=r.mcc,f=void 0===d?"":d,m=l.filter((function(e){return e.flow===s})),p=(s?m:l).reduce((function(e,r){return e[r.language]=r,e}),{}),v=(p[t]||"").disclaimer,g=(p[t]||"").mcc_disclaimer;return e.createElement("div",{"data-qa-id":u,className:a(o,n)},g&&f&&e.createElement("div",{dangerouslySetInnerHTML:{__html:g[f.toLowerCase()]}})||e.createElement("div",{dangerouslySetInnerHTML:{__html:v}})," ")}export{i as Disclaimers};
|
|
82
7
|
//# sourceMappingURL=index.es.js.map
|
package/build/index.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../node_modules/classnames/index.js"],"sourcesContent":["/*!\n
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../node_modules/classnames/index.js"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\tvar nativeCodeString = '[native code]';\n\n\tfunction classNames() {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tif (arg.length) {\n\t\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\t\tif (inner) {\n\t\t\t\t\t\tclasses.push(inner);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\t\t\tclasses.push(arg.toString());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n"],"names":["hasOwn","hasOwnProperty","classNames","classes","i","arguments","length","arg","argType","push","Array","isArray","inner","apply","toString","Object","prototype","includes","key","call","join","module","exports","default","window"],"mappings":";;;;;MAOC,WAGA,IAAIA,EAAS,CAAE,EAACC,eAGhB,SAASC,IAGR,IAFA,IAAIC,EAAU,GAELC,EAAI,EAAGA,EAAIC,UAAUC,OAAQF,IAAK,CAC1C,IAAIG,EAAMF,UAAUD,GACpB,GAAKG,EAAL,CAEA,IAAIC,SAAiBD,EAErB,GAAgB,WAAZC,GAAoC,WAAZA,EAC3BL,EAAQM,KAAKF,QACP,GAAIG,MAAMC,QAAQJ,IACxB,GAAIA,EAAID,OAAQ,CACf,IAAIM,EAAQV,EAAWW,MAAM,KAAMN,GAC/BK,GACHT,EAAQM,KAAKG,EAEd,OACK,GAAgB,WAAZJ,EAAsB,CAChC,GAAID,EAAIO,WAAaC,OAAOC,UAAUF,WAAaP,EAAIO,SAASA,WAAWG,SAAS,iBAAkB,CACrGd,EAAQM,KAAKF,EAAIO,YACjB,QACA,CAED,IAAK,IAAII,KAAOX,EACXP,EAAOmB,KAAKZ,EAAKW,IAAQX,EAAIW,IAChCf,EAAQM,KAAKS,EAGf,CAxBkB,CAyBnB,CAED,OAAOf,EAAQiB,KAAK,IACpB,CAEoCC,EAAOC,SAC3CpB,EAAWqB,QAAUrB,EACrBmB,EAAAC,QAAiBpB,GAOjBsB,OAAOtB,WAAaA,CAEtB,CApDA"}
|
package/build/index.js
CHANGED
|
@@ -1,106 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var React = require('react');
|
|
6
|
-
|
|
7
|
-
function _interopNamespace(e) {
|
|
8
|
-
if (e && e.__esModule) return e;
|
|
9
|
-
var n = Object.create(null);
|
|
10
|
-
if (e) {
|
|
11
|
-
Object.keys(e).forEach(function (k) {
|
|
12
|
-
if (k !== 'default') {
|
|
13
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: function () { return e[k]; }
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
n["default"] = e;
|
|
22
|
-
return Object.freeze(n);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
26
|
-
|
|
27
|
-
var styles = {"wrapper":"Disclaimers-module_wrapper__yyrGN"};
|
|
28
|
-
|
|
29
|
-
var classnames = {exports: {}};
|
|
30
|
-
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0});var r,t=e(require("react")),a={exports:{}};
|
|
31
2
|
/*!
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
3
|
+
Copyright (c) 2018 Jed Watson.
|
|
4
|
+
Licensed under the MIT License (MIT), see
|
|
5
|
+
http://jedwatson.github.io/classnames
|
|
35
6
|
*/
|
|
36
|
-
|
|
37
|
-
(function (module) {
|
|
38
|
-
/* global define */
|
|
39
|
-
|
|
40
|
-
(function () {
|
|
41
|
-
|
|
42
|
-
var hasOwn = {}.hasOwnProperty;
|
|
43
|
-
|
|
44
|
-
function classNames() {
|
|
45
|
-
var classes = [];
|
|
46
|
-
|
|
47
|
-
for (var i = 0; i < arguments.length; i++) {
|
|
48
|
-
var arg = arguments[i];
|
|
49
|
-
if (!arg) continue;
|
|
50
|
-
|
|
51
|
-
var argType = typeof arg;
|
|
52
|
-
|
|
53
|
-
if (argType === 'string' || argType === 'number') {
|
|
54
|
-
classes.push(arg);
|
|
55
|
-
} else if (Array.isArray(arg)) {
|
|
56
|
-
if (arg.length) {
|
|
57
|
-
var inner = classNames.apply(null, arg);
|
|
58
|
-
if (inner) {
|
|
59
|
-
classes.push(inner);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
} else if (argType === 'object') {
|
|
63
|
-
if (arg.toString === Object.prototype.toString) {
|
|
64
|
-
for (var key in arg) {
|
|
65
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
66
|
-
classes.push(key);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
} else {
|
|
70
|
-
classes.push(arg.toString());
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return classes.join(' ');
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (module.exports) {
|
|
79
|
-
classNames.default = classNames;
|
|
80
|
-
module.exports = classNames;
|
|
81
|
-
} else {
|
|
82
|
-
window.classNames = classNames;
|
|
83
|
-
}
|
|
84
|
-
}());
|
|
85
|
-
}(classnames));
|
|
86
|
-
|
|
87
|
-
var cn = classnames.exports;
|
|
88
|
-
|
|
89
|
-
var Disclaimers = function (_a) {
|
|
90
|
-
var locale = _a.locale, _b = _a.className, className = _b === void 0 ? '' : _b, legals = _a.legals, flow = _a.flow, _c = _a.dataQaId, dataQaId = _c === void 0 ? 'disclaimers' : _c;
|
|
91
|
-
var filteredLegals = legals.filter(function (obj) { return obj.flow === flow; });
|
|
92
|
-
var legalsArr = flow ? filteredLegals : legals;
|
|
93
|
-
var arrayToObject = function (array) {
|
|
94
|
-
return array.reduce(function (obj, item) {
|
|
95
|
-
obj[item.language] = item;
|
|
96
|
-
return obj;
|
|
97
|
-
}, {});
|
|
98
|
-
};
|
|
99
|
-
var legalsObject = arrayToObject(legalsArr);
|
|
100
|
-
var disclaimer = (legalsObject[locale] || '').disclaimer;
|
|
101
|
-
return (React__namespace.createElement("div", { "data-qa-id": dataQaId, className: cn(className, styles.wrapper) },
|
|
102
|
-
React__namespace.createElement("div", { dangerouslySetInnerHTML: { __html: disclaimer } })));
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
exports.Disclaimers = Disclaimers;
|
|
7
|
+
r=a,function(){var e={}.hasOwnProperty;function t(){for(var r=[],a=0;a<arguments.length;a++){var i=arguments[a];if(i){var n=typeof i;if("string"===n||"number"===n)r.push(i);else if(Array.isArray(i)){if(i.length){var o=t.apply(null,i);o&&r.push(o)}}else if("object"===n){if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]")){r.push(i.toString());continue}for(var l in i)e.call(i,l)&&i[l]&&r.push(l)}}}return r.join(" ")}r.exports?(t.default=t,r.exports=t):window.classNames=t}();var i=a.exports,n="Disclaimers-module_wrapper__yyrGN";exports.Disclaimers=function(e){var r=e.locale,a=e.className,o=void 0===a?"":a,l=e.legals,s=e.flow,u=e.dataQaId,c=void 0===u?"disclaimers":u,d=e.mcc,f=void 0===d?"":d,p=l.filter((function(e){return e.flow===s})),m=(s?p:l).reduce((function(e,r){return e[r.language]=r,e}),{}),v=(m[r]||"").disclaimer,g=(m[r]||"").mcc_disclaimer;return t.default.createElement("div",{"data-qa-id":c,className:i(o,n)},g&&f&&t.default.createElement("div",{dangerouslySetInnerHTML:{__html:g[f.toLowerCase()]}})||t.default.createElement("div",{dangerouslySetInnerHTML:{__html:v}})," ")};
|
|
106
8
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../node_modules/classnames/index.js"],"sourcesContent":["/*!\n
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../node_modules/classnames/index.js"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\tvar nativeCodeString = '[native code]';\n\n\tfunction classNames() {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tif (arg.length) {\n\t\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\t\tif (inner) {\n\t\t\t\t\t\tclasses.push(inner);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\t\t\tclasses.push(arg.toString());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n"],"names":["hasOwn","hasOwnProperty","classNames","classes","i","arguments","length","arg","argType","push","Array","isArray","inner","apply","toString","Object","prototype","includes","key","call","join","module","exports","default","window"],"mappings":";;;;;;IAOC,WAGA,IAAIA,EAAS,CAAE,EAACC,eAGhB,SAASC,IAGR,IAFA,IAAIC,EAAU,GAELC,EAAI,EAAGA,EAAIC,UAAUC,OAAQF,IAAK,CAC1C,IAAIG,EAAMF,UAAUD,GACpB,GAAKG,EAAL,CAEA,IAAIC,SAAiBD,EAErB,GAAgB,WAAZC,GAAoC,WAAZA,EAC3BL,EAAQM,KAAKF,QACP,GAAIG,MAAMC,QAAQJ,IACxB,GAAIA,EAAID,OAAQ,CACf,IAAIM,EAAQV,EAAWW,MAAM,KAAMN,GAC/BK,GACHT,EAAQM,KAAKG,EAEd,OACK,GAAgB,WAAZJ,EAAsB,CAChC,GAAID,EAAIO,WAAaC,OAAOC,UAAUF,WAAaP,EAAIO,SAASA,WAAWG,SAAS,iBAAkB,CACrGd,EAAQM,KAAKF,EAAIO,YACjB,QACA,CAED,IAAK,IAAII,KAAOX,EACXP,EAAOmB,KAAKZ,EAAKW,IAAQX,EAAIW,IAChCf,EAAQM,KAAKS,EAGf,CAxBkB,CAyBnB,CAED,OAAOf,EAAQiB,KAAK,IACpB,CAEoCC,EAAOC,SAC3CpB,EAAWqB,QAAUrB,EACrBmB,EAAAC,QAAiBpB,GAOjBsB,OAAOtB,WAAaA,CAEtB,CApDA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Story } from '@storybook/react';
|
|
2
|
+
import { DisclaimersProps } from './Disclaimers.types';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: string;
|
|
6
|
+
parameters: {
|
|
7
|
+
importObject: string;
|
|
8
|
+
importPath: string;
|
|
9
|
+
};
|
|
10
|
+
argTypes: {
|
|
11
|
+
locale: {
|
|
12
|
+
control: {
|
|
13
|
+
type: string;
|
|
14
|
+
};
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
className: {
|
|
18
|
+
control: {
|
|
19
|
+
type: string;
|
|
20
|
+
};
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
legals: {
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
flow: {
|
|
27
|
+
control: {
|
|
28
|
+
type: string;
|
|
29
|
+
};
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
dataQaId: {
|
|
33
|
+
control: {
|
|
34
|
+
type: string;
|
|
35
|
+
};
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export default _default;
|
|
41
|
+
export declare const Main: Story<DisclaimersProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
export declare
|
|
1
|
+
export declare enum ILegalFlows {
|
|
2
|
+
PIN = "pin",
|
|
3
|
+
MO = "mo",
|
|
4
|
+
ONE_CLICK = "oneClick",
|
|
5
|
+
CLICK_2SMS = "click2sms",
|
|
6
|
+
MO_REDIR = "moRedir",
|
|
7
|
+
USSD = "ussd",
|
|
8
|
+
TPAY_HE = "tpayHe"
|
|
9
|
+
}
|
|
2
10
|
export interface ILegals {
|
|
3
11
|
id: number;
|
|
4
12
|
country: string;
|
|
@@ -10,6 +18,12 @@ export interface ILegals {
|
|
|
10
18
|
disclaimer: string;
|
|
11
19
|
date_created: string;
|
|
12
20
|
extra_disclaimer: string;
|
|
21
|
+
mcc_disclaimer: {
|
|
22
|
+
[key: string]: string;
|
|
23
|
+
} | null;
|
|
24
|
+
operator_price_point: {
|
|
25
|
+
[key: string]: string;
|
|
26
|
+
} | null;
|
|
13
27
|
flow?: ILegalFlows;
|
|
14
28
|
}
|
|
15
29
|
export interface DisclaimersProps {
|
|
@@ -17,5 +31,6 @@ export interface DisclaimersProps {
|
|
|
17
31
|
legals: Array<ILegals>;
|
|
18
32
|
className?: string;
|
|
19
33
|
flow?: ILegalFlows;
|
|
34
|
+
mcc?: string;
|
|
20
35
|
dataQaId?: string;
|
|
21
36
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IKeywordShortcode, MOLinkProps } from './MOLink.types';
|
|
3
|
+
export declare const formatSMSLink: (keywordAndShortcode: IKeywordShortcode, useOpenAddresses?: boolean) => string;
|
|
4
|
+
export declare const MOLink: React.ComponentType<MOLinkProps>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Story } from '@storybook/react';
|
|
2
|
+
import { MOLinkProps } from './MOLink.types';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: string;
|
|
6
|
+
parameters: {
|
|
7
|
+
importObject: string;
|
|
8
|
+
importPath: string;
|
|
9
|
+
};
|
|
10
|
+
argTypes: {
|
|
11
|
+
className: {
|
|
12
|
+
control: {
|
|
13
|
+
type: string;
|
|
14
|
+
};
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
dataQaId: {
|
|
18
|
+
control: {
|
|
19
|
+
type: string;
|
|
20
|
+
};
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
keywordAndShortcode: {
|
|
24
|
+
control: {
|
|
25
|
+
type: string;
|
|
26
|
+
};
|
|
27
|
+
description: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export default _default;
|
|
32
|
+
export declare const Main: Story<MOLinkProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface IKeywordShortcode {
|
|
3
|
+
keyword: string;
|
|
4
|
+
shortcode: string;
|
|
5
|
+
}
|
|
6
|
+
export declare type MOLinkProps = {
|
|
7
|
+
keywordAndShortcode: IKeywordShortcode;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
dataQaId?: string;
|
|
10
|
+
} & React.HTMLAttributes<HTMLAnchorElement>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Story } from '@storybook/react';
|
|
2
|
+
import { PricePointProps } from './PricePoint.types';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: string;
|
|
6
|
+
parameters: {
|
|
7
|
+
importObject: string;
|
|
8
|
+
importPath: string;
|
|
9
|
+
};
|
|
10
|
+
argTypes: {
|
|
11
|
+
locale: {
|
|
12
|
+
control: {
|
|
13
|
+
type: string;
|
|
14
|
+
};
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
className: {
|
|
18
|
+
control: {
|
|
19
|
+
type: string;
|
|
20
|
+
};
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
legals: {
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
flow: {
|
|
27
|
+
control: {
|
|
28
|
+
type: string;
|
|
29
|
+
};
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
dataQaId: {
|
|
33
|
+
control: {
|
|
34
|
+
type: string;
|
|
35
|
+
};
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export default _default;
|
|
41
|
+
export declare const Main: Story<PricePointProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RenderOptions } from '@testing-library/react';
|
|
2
|
+
import React, { ReactElement } from 'react';
|
|
3
|
+
import renderer from 'react-test-renderer';
|
|
4
|
+
declare const customRender: (ui: ReactElement, options?: Omit<RenderOptions, 'wrapper'>) => import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
|
|
5
|
+
declare const jsonRenderer: (ui: React.ReactNode) => renderer.ReactTestRendererJSON | renderer.ReactTestRendererJSON[] | null;
|
|
6
|
+
export * from '@testing-library/react';
|
|
7
|
+
export { customRender as render, jsonRenderer };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ouisys-component-library",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Ouisys Components",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"module": "build/index.es.js",
|
|
@@ -19,7 +19,10 @@
|
|
|
19
19
|
"@storybook/preset-scss": "^1.0.3",
|
|
20
20
|
"@storybook/react": "^6.4.13",
|
|
21
21
|
"@testing-library/jest-dom": "^5.16.1",
|
|
22
|
+
"@testing-library/react": "^12.1.2",
|
|
23
|
+
"@types/jest": "^27.4.0",
|
|
22
24
|
"@types/react": "^17.0.38",
|
|
25
|
+
"@types/react-test-renderer": "^17.0.1",
|
|
23
26
|
"@typescript-eslint/eslint-plugin": "^4.19.0",
|
|
24
27
|
"@typescript-eslint/parser": "^4.19.0",
|
|
25
28
|
"babel-loader": "^8.2.3",
|
|
@@ -36,18 +39,26 @@
|
|
|
36
39
|
"eslint-plugin-react": "^7.21.5",
|
|
37
40
|
"eslint-plugin-react-hooks": "^4.2.0",
|
|
38
41
|
"eslint-plugin-testing-library": "^3.10.1",
|
|
42
|
+
"identity-obj-proxy": "^3.0.0",
|
|
39
43
|
"jest": "^27.4.7",
|
|
44
|
+
"lint-staged": "^13.0.3",
|
|
40
45
|
"node-sass": "^6",
|
|
41
|
-
"
|
|
42
|
-
"prettier
|
|
46
|
+
"postcss": "8",
|
|
47
|
+
"prettier": "^2.7.1",
|
|
48
|
+
"prettier-config-ouisys": "0.0.2",
|
|
49
|
+
"prettier-plugin-organize-imports": "^3.0.0",
|
|
43
50
|
"react": "^17.0.2",
|
|
44
51
|
"react-dom": "^17.0.2",
|
|
52
|
+
"react-test-renderer": "^17.0.2",
|
|
45
53
|
"rollup": "^2.64.0",
|
|
54
|
+
"rollup-plugin-analyzer": "^4.0.0",
|
|
46
55
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
47
56
|
"rollup-plugin-postcss": "^4.0.2",
|
|
57
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
48
58
|
"rollup-plugin-typescript2": "^0.31.1",
|
|
49
59
|
"sass-loader": "^10",
|
|
50
60
|
"ts-jest": "^27.1.3",
|
|
61
|
+
"ts-node": "^10.9.1",
|
|
51
62
|
"typescript": "^4.5.4"
|
|
52
63
|
},
|
|
53
64
|
"dependencies": {},
|
|
@@ -56,14 +67,29 @@
|
|
|
56
67
|
"react-dom": ">=16.8.0"
|
|
57
68
|
},
|
|
58
69
|
"scripts": {
|
|
59
|
-
"build": "rollup -c",
|
|
70
|
+
"build": "rm -rf build && rollup -c",
|
|
60
71
|
"storybook": "start-storybook -p 6006",
|
|
61
72
|
"storybook:export": "build-storybook",
|
|
62
73
|
"build-storybook": "build-storybook",
|
|
63
74
|
"clean": "rm -rf ./dist && rm -rf ./build",
|
|
64
75
|
"watch": "tsc -b -w --preserveWatchOutput",
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
|
|
76
|
+
"lint": "eslint --fix 'src/**/*.{ts,tsx}'",
|
|
77
|
+
"format": "prettier --write .",
|
|
78
|
+
"test": "node --max_old_space_size=5096 node_modules/.bin/jest",
|
|
79
|
+
"test:local": "jest --runInBand",
|
|
80
|
+
"test:coverage": "yarn run test -- --watch --coverage --coverage-reporters=lcov --watchAll=false; echo \"\\033[32m>>> 🌹 Coverage report now in /coverage folder\"",
|
|
81
|
+
"test:coverageWatch": "yarn run test -- --watch --coverage --coverage-reporters=lcov --watchAll=true",
|
|
82
|
+
"test:watch": "yarn run test -- --watch --watchAll=true",
|
|
83
|
+
"test:debug": "node --inspect-brk node_modules/.bin/jest --watch --ci --runInBand"
|
|
84
|
+
},
|
|
85
|
+
"husky": {
|
|
86
|
+
"hooks": {
|
|
87
|
+
"pre-commit": "lint-staged"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"lint-staged": {
|
|
91
|
+
"*": "prettier --ignore-unknown --write",
|
|
92
|
+
"src/**/*.{ts,tsx}": "eslint --fix"
|
|
93
|
+
},
|
|
94
|
+
"prettier": "prettier-config-ouisys"
|
|
69
95
|
}
|
package/build/index.d.ts
DELETED