ouisys-component-library 0.0.1 → 0.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.
- package/README.md +5 -0
- package/build/Disclaimers/Disclaimers.stories.d.ts +37 -3
- package/build/Disclaimers/Disclaimers.test.d.ts +1 -0
- package/build/Disclaimers/Disclaimers.types.d.ts +11 -2
- package/build/index.es.js +2 -76
- package/build/index.es.js.map +1 -1
- package/build/index.js +2 -100
- package/build/index.js.map +1 -1
- package/build/utils/test/index.d.ts +7 -0
- package/package.json +9 -1
package/README.md
CHANGED
|
@@ -39,6 +39,11 @@ Alternatively you can add the `--watch` flag for continued refresh and testing,
|
|
|
39
39
|
|
|
40
40
|
## Usage
|
|
41
41
|
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
yarn add ouisys-component-library@latest
|
|
45
|
+
```
|
|
46
|
+
|
|
42
47
|
```typescript
|
|
43
48
|
import React from 'react';
|
|
44
49
|
import { Button, ButtonProps } from 'ouisys-component-library/Button';
|
|
@@ -1,7 +1,41 @@
|
|
|
1
|
-
|
|
1
|
+
import { Story } from '@storybook/react';
|
|
2
|
+
import { DisclaimersProps } from './Disclaimers.types';
|
|
2
3
|
declare const _default: {
|
|
3
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
|
+
};
|
|
4
39
|
};
|
|
5
40
|
export default _default;
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const Secondary: () => JSX.Element;
|
|
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,7 +18,8 @@ export interface ILegals {
|
|
|
10
18
|
disclaimer: string;
|
|
11
19
|
date_created: string;
|
|
12
20
|
extra_disclaimer: string;
|
|
13
|
-
|
|
21
|
+
operator_price_point: null;
|
|
22
|
+
flow: ILegalFlows;
|
|
14
23
|
}
|
|
15
24
|
export interface DisclaimersProps {
|
|
16
25
|
locale: string;
|
package/build/index.es.js
CHANGED
|
@@ -1,82 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
var styles = {"wrapper":"Disclaimers-module_wrapper__yyrGN"};
|
|
4
|
-
|
|
5
|
-
var classnames = {exports: {}};
|
|
6
|
-
|
|
1
|
+
import*as r from"react";var e,t="Disclaimers-module_wrapper__yyrGN",a={exports:{}};
|
|
7
2
|
/*!
|
|
8
3
|
Copyright (c) 2018 Jed Watson.
|
|
9
4
|
Licensed under the MIT License (MIT), see
|
|
10
5
|
http://jedwatson.github.io/classnames
|
|
11
6
|
*/
|
|
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 };
|
|
7
|
+
e=a,function(){var r={}.hasOwnProperty;function t(){for(var e=[],a=0;a<arguments.length;a++){var i=arguments[a];if(i){var n=typeof i;if("string"===n||"number"===n)e.push(i);else if(Array.isArray(i)){if(i.length){var o=t.apply(null,i);o&&e.push(o)}}else if("object"===n)if(i.toString===Object.prototype.toString)for(var l in i)r.call(i,l)&&i[l]&&e.push(l);else e.push(i.toString())}}return e.join(" ")}e.exports?(t.default=t,e.exports=t):window.classNames=t}();var i=a.exports,n=function(e){var a=e.locale,n=e.className,o=void 0===n?"":n,l=e.legals,s=e.flow,u=e.dataQaId,c=void 0===u?"disclaimers":u,f=l.filter((function(r){return r.flow===s})),p=((s?f:l).reduce((function(r,e){return r[e.language]=e,r}),{})[a]||"").disclaimer;return r.createElement("div",{"data-qa-id":c,className:i(o,t)},r.createElement("div",{dangerouslySetInnerHTML:{__html:p}}))};export{n as Disclaimers};
|
|
82
8
|
//# 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 Copyright (c) 2018 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\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) {\n\t\t\t\t\tfor (var key in arg) {\n\t\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tclasses.push(arg.toString());\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":[
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../node_modules/classnames/index.js"],"sourcesContent":["/*!\n Copyright (c) 2018 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\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) {\n\t\t\t\t\tfor (var key in arg) {\n\t\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tclasses.push(arg.toString());\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","key","call","join","module","exports","default","window"],"mappings":";;;;;;IAOC,WAGA,IAAIA,EAAS,GAAGC,eAEhB,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,SAGT,GAAgB,WAAZJ,EACV,GAAID,EAAIO,WAAaC,OAAOC,UAAUF,SACrC,IAAK,IAAIG,KAAOV,EACXP,EAAOkB,KAAKX,EAAKU,IAAQV,EAAIU,IAChCd,EAAQM,KAAKQ,QAIfd,EAAQM,KAAKF,EAAIO,aAKpB,OAAOX,EAAQgB,KAAK,KAGgBC,EAAOC,SAC3CnB,EAAWoB,QAAUpB,EACrBkB,UAAiBlB,GAOjBqB,OAAOrB,WAAaA,EAhDtB"}
|
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){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,a.get?a:{enumerable:!0,get:function(){return e[t]}})}})),r.default=e,Object.freeze(r)}Object.defineProperty(exports,"__esModule",{value:!0});var r,t=e(require("react")),a="Disclaimers-module_wrapper__yyrGN",n={exports:{}};
|
|
31
2
|
/*!
|
|
32
3
|
Copyright (c) 2018 Jed Watson.
|
|
33
4
|
Licensed under the MIT License (MIT), see
|
|
34
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=n,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)for(var l in n)e.call(n,l)&&n[l]&&r.push(l);else r.push(n.toString())}}return r.join(" ")}r.exports?(t.default=t,r.exports=t):window.classNames=t}();var i=n.exports;exports.Disclaimers=function(e){var r=e.locale,n=e.className,o=void 0===n?"":n,l=e.legals,s=e.flow,u=e.dataQaId,c=void 0===u?"disclaimers":u,f=l.filter((function(e){return e.flow===s})),p=((s?f:l).reduce((function(e,r){return e[r.language]=r,e}),{})[r]||"").disclaimer;return t.createElement("div",{"data-qa-id":c,className:i(o,a)},t.createElement("div",{dangerouslySetInnerHTML:{__html:p}}))};
|
|
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 Copyright (c) 2018 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\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) {\n\t\t\t\t\tfor (var key in arg) {\n\t\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tclasses.push(arg.toString());\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":[
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../node_modules/classnames/index.js"],"sourcesContent":["/*!\n Copyright (c) 2018 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\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) {\n\t\t\t\t\tfor (var key in arg) {\n\t\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tclasses.push(arg.toString());\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","key","call","join","module","exports","default","window"],"mappings":";;;;;;IAOC,WAGA,IAAIA,EAAS,GAAGC,eAEhB,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,SAGT,GAAgB,WAAZJ,EACV,GAAID,EAAIO,WAAaC,OAAOC,UAAUF,SACrC,IAAK,IAAIG,KAAOV,EACXP,EAAOkB,KAAKX,EAAKU,IAAQV,EAAIU,IAChCd,EAAQM,KAAKQ,QAIfd,EAAQM,KAAKF,EAAIO,aAKpB,OAAOX,EAAQgB,KAAK,KAGgBC,EAAOC,SAC3CnB,EAAWoB,QAAUpB,EACrBkB,UAAiBlB,GAOjBqB,OAAOrB,WAAaA,EAhDtB"}
|
|
@@ -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<typeof import("@testing-library/dom/types/queries"), HTMLElement>, "wrapper"> | undefined) => import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), 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.2",
|
|
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,15 +39,20 @@
|
|
|
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",
|
|
40
44
|
"node-sass": "^6",
|
|
45
|
+
"postcss": "8",
|
|
41
46
|
"prettier": "^2.2.1",
|
|
42
47
|
"prettier-plugin-organize-imports": "^1.1.1",
|
|
43
48
|
"react": "^17.0.2",
|
|
44
49
|
"react-dom": "^17.0.2",
|
|
50
|
+
"react-test-renderer": "^17.0.2",
|
|
45
51
|
"rollup": "^2.64.0",
|
|
52
|
+
"rollup-plugin-analyzer": "^4.0.0",
|
|
46
53
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
47
54
|
"rollup-plugin-postcss": "^4.0.2",
|
|
55
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
48
56
|
"rollup-plugin-typescript2": "^0.31.1",
|
|
49
57
|
"sass-loader": "^10",
|
|
50
58
|
"ts-jest": "^27.1.3",
|