ouisys-component-library 0.0.3 → 0.0.5

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/build/index.css CHANGED
@@ -1,2 +1,2 @@
1
- .Disclaimers-module_wrapper__yyrGN{background-color:red}
1
+ .Disclaimers-module_wrapper__yyrGN{background-color:red}.Input-module_wrapper__bzo7K input,.Input-module_wrapper__bzo7K select{border:1px solid #ccc;border-radius:4px;box-sizing:border-box;display:inline-block;margin:8px 0;padding:12px 20px;width:100%}.Input-module_wrapper__bzo7K input[type=submit]{background-color:#4caf50;border:none;border-radius:4px;color:#fff;cursor:pointer;margin:8px 0;padding:14px 20px;width:100%}.Input-module_wrapper__bzo7K input[type=submit]:hover{background-color:#45a049}.Input-module_wrapper__bzo7K .Input-module_error__rkwNz{color:red}
2
2
  /*# sourceMappingURL=index.css.map */
@@ -1 +1 @@
1
- {"version":3,"sources":["Disclaimers.module.scss"],"names":[],"mappings":"AAAA,mCACE,oBAAuB","file":"index.css","sourcesContent":[".wrapper {\n background-color: red; }\n"]}
1
+ {"version":3,"sources":["Disclaimers.module.scss","Input.module.scss"],"names":[],"mappings":"AAAA,mCACE,oBAAuB,CCDzB,uEAME,qBAAsB,CACtB,iBAAkB,CAClB,qBAAsB,CAHtB,oBAAqB,CADrB,YAAa,CADb,iBAAkB,CADlB,UAMwB,CAE1B,gDAEE,wBAAyB,CAIzB,WAAY,CACZ,iBAAkB,CAJlB,UAAY,CAKZ,cAAe,CAHf,YAAa,CADb,iBAAkB,CAHlB,UAOiB,CAEnB,sDACE,wBAA2B,CAE7B,wDACE,SAAY","file":"index.css","sourcesContent":[".wrapper {\n background-color: red; }\n",".wrapper input,\n.wrapper select {\n width: 100%;\n padding: 12px 20px;\n margin: 8px 0;\n display: inline-block;\n border: 1px solid #ccc;\n border-radius: 4px;\n box-sizing: border-box; }\n\n.wrapper input[type='submit'] {\n width: 100%;\n background-color: #4caf50;\n color: white;\n padding: 14px 20px;\n margin: 8px 0;\n border: none;\n border-radius: 4px;\n cursor: pointer; }\n\n.wrapper input[type='submit']:hover {\n background-color: #45a049; }\n\n.wrapper .error {\n color: red; }\n"]}
@@ -0,0 +1,124 @@
1
+ import * as React$1 from 'react';
2
+
3
+ declare enum ILegalFlows {
4
+ PIN = "pin",
5
+ MO = "mo",
6
+ ONE_CLICK = "oneClick",
7
+ CLICK_2SMS = "click2sms",
8
+ MO_REDIR = "moRedir",
9
+ USSD = "ussd",
10
+ TPAY_HE = "tpayHe"
11
+ }
12
+ interface ILegals {
13
+ id: number;
14
+ country: string;
15
+ service: string;
16
+ scenario: string;
17
+ language: string;
18
+ top_legal: string;
19
+ price_point: string;
20
+ disclaimer: string;
21
+ date_created: string;
22
+ extra_disclaimer: string;
23
+ mcc_disclaimer: {
24
+ [key: string]: string;
25
+ } | null;
26
+ operator_price_point: {
27
+ [key: string]: string;
28
+ } | null;
29
+ flow?: ILegalFlows;
30
+ }
31
+ interface DisclaimersProps {
32
+ locale: string;
33
+ legals: Array<ILegals>;
34
+ className?: string;
35
+ flow?: ILegalFlows;
36
+ mcc?: string;
37
+ dataQaId?: string;
38
+ }
39
+
40
+ declare function Disclaimers({ locale, className, legals, flow, dataQaId, mcc }: DisclaimersProps): JSX.Element;
41
+
42
+ interface ExtraDisclaimersProps {
43
+ locale: string;
44
+ legals: Array<ILegals>;
45
+ className?: string;
46
+ flow?: ILegalFlows;
47
+ dataQaId?: string;
48
+ }
49
+
50
+ declare function ExtraDisclaimers({ locale, className, legals, flow, dataQaId }: ExtraDisclaimersProps): JSX.Element;
51
+
52
+ interface InputProps extends React.HTMLAttributes<HTMLInputElement> {
53
+ value: string;
54
+ label?: string;
55
+ onChange: React.FocusEventHandler<HTMLInputElement> | undefined;
56
+ type: InputType;
57
+ placeholder?: string;
58
+ error?: string;
59
+ dataQaId?: string;
60
+ disabled?: boolean;
61
+ readOnly?: boolean;
62
+ required?: boolean;
63
+ maxLength?: number;
64
+ minLength?: number;
65
+ wrapperClassName?: string;
66
+ onBlur?: React.FocusEventHandler<HTMLInputElement> | undefined;
67
+ }
68
+ declare enum InputType {
69
+ Text = "text",
70
+ Number = "number",
71
+ Email = "email",
72
+ Password = "password",
73
+ Search = "search",
74
+ Telephone = "tel",
75
+ URL = "url"
76
+ }
77
+
78
+ declare function Input({ wrapperClassName, dataQaId, id, value, placeholder, disabled, readOnly, error, type, onChange, ...props }: InputProps): JSX.Element;
79
+
80
+ interface IHash {
81
+ [key: string]: string;
82
+ }
83
+ declare function IntlProvider({ locale, messages, children }: {
84
+ locale: string;
85
+ messages: IHash;
86
+ children: React$1.ReactChild | JSX.Element[] | JSX.Element;
87
+ }): JSX.Element;
88
+ declare function injectIntl(Child: React$1.ComponentType<any>): (props: any) => JSX.Element;
89
+ declare function defineMessages(messageDescriptors: any): any;
90
+
91
+ declare type IKeywordShortcode = {
92
+ keyword: string;
93
+ shortcode: string;
94
+ };
95
+ declare type MOLinkProps = {
96
+ keywordAndShortcode: IKeywordShortcode;
97
+ children: React.ReactNode;
98
+ dataQaId?: string;
99
+ } & React.HTMLAttributes<HTMLAnchorElement>;
100
+
101
+ declare const MOLink: React$1.ComponentType<MOLinkProps>;
102
+
103
+ interface PricePointProps {
104
+ locale: string;
105
+ legals: Array<ILegals>;
106
+ operator?: string;
107
+ className?: string;
108
+ flow?: ILegalFlows;
109
+ dataQaId?: string;
110
+ }
111
+
112
+ declare function PricePoint({ locale, className, legals, flow, dataQaId, operator }: PricePointProps): JSX.Element;
113
+
114
+ interface TopLegalsProps {
115
+ locale: string;
116
+ legals: Array<ILegals>;
117
+ className?: string;
118
+ flow?: ILegalFlows;
119
+ dataQaId?: string;
120
+ }
121
+
122
+ declare function TopLegals({ locale, className, legals, flow, dataQaId }: TopLegalsProps): JSX.Element;
123
+
124
+ export { Disclaimers, ExtraDisclaimers, IKeywordShortcode, Input, InputType, IntlProvider, MOLink, PricePoint, TopLegals, defineMessages, injectIntl };
package/build/index.js CHANGED
@@ -1,8 +1,2 @@
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:{}};
2
- /*!
3
- Copyright (c) 2018 Jed Watson.
4
- Licensed under the MIT License (MIT), see
5
- http://jedwatson.github.io/classnames
6
- */
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}})," ")};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("classnames"),t=require("react"),a=require("tslib");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:function(){return e[a]}})}})),t.default=e,Object.freeze(t)}var o=r(e),i=r(t),c=n(t),s="Disclaimers-module_wrapper__yyrGN";var l,d,u,m,f="Input-module_wrapper__bzo7K",p="Input-module_error__rkwNz";exports.InputType=void 0,(l=exports.InputType||(exports.InputType={})).Text="text",l.Number="number",l.Email="email",l.Password="password",l.Search="search",l.Telephone="tel",l.URL="url",function(e){e.Medium="Medium",e.Large="Large"}(d||(d={})),function(e){e.Left="Left",e.Right="Right"}(u||(u={})),function(e){e.Telephone="telephone",e.CreditCard="credit_card"}(m||(m={}));var v=c.createContext({locale:"en",messages:{},intl:{formatMessage:function(e,t){return e.id,e.defaultMessage,""}}});function g(e){return e}exports.defineMessages=g;var _=function(e,t){return"undefined"!=typeof navigator&&(/iPhone/i.test(navigator.userAgent)||/Mac OS/i.test(navigator.userAgent))?t?"sms:/open?addresses=".concat(e.shortcode,"&body=").concat(e.keyword):"sms:".concat(e.shortcode,"&body=").concat(e.keyword):["com.facebook.orca","com.facebook.katana","com.instagram.android"].some((function(e){return new RegExp(e,"ig").test(window.pac_analytics.visitor["x-requested-with"])}))?"/mo-redirect-util/".concat(e.shortcode,"/").concat(e.keyword):window.pac_analytics.visitor["x-requested-with"]&&null!==window.pac_analytics.visitor["x-requested-with"]&&-1!==window.pac_analytics.visitor["x-requested-with"].indexOf("com.facebook")?"sms://".concat(e.shortcode,"?body=").concat(e.keyword):"sms:".concat(e.shortcode,"?body=").concat(e.keyword)};exports.Disclaimers=function(e){var t=e.locale,a=e.className,r=void 0===a?"":a,n=e.legals,c=e.flow,l=e.dataQaId,d=void 0===l?"disclaimers":l,u=e.mcc,m=void 0===u?"":u,f=n.filter((function(e){return e.flow===c})),p=(c?f:n).reduce((function(e,t){return e[t.language]=t,e}),{}),v=(p[t]||"").disclaimer,g=(p[t]||"").mcc_disclaimer;return i.default.createElement("div",{"data-qa-id":d,className:o.default(s,r)},g&&m&&i.default.createElement("div",{dangerouslySetInnerHTML:{__html:g[m.toLowerCase()]}})||i.default.createElement("div",{dangerouslySetInnerHTML:{__html:v}})," ")},exports.ExtraDisclaimers=function(e){var t=e.locale,a=e.className,r=e.legals,n=e.flow,o=e.dataQaId,i=void 0===o?"extra-disclaimers-":o,s=r.filter((function(e){return e.flow===n})),l=((n&&!process.env.scenario?s:r).reduce((function(e,t){return e[t.language]=t,e}),{})[t]||"").extra_disclaimer;return c.createElement("div",{"data-qa-id":i,className:a},c.createElement("div",{dangerouslySetInnerHTML:{__html:l}}))},exports.Input=function(e){var t=e.wrapperClassName,r=void 0===t?"":t,n=e.dataQaId,i=void 0===n?"input-":n,s=e.id,l=e.value,d=e.placeholder,u=e.disabled,m=e.readOnly,v=e.error,g=e.type,_=e.onChange,y=a.__rest(e,["wrapperClassName","dataQaId","id","value","placeholder","disabled","readOnly","error","type","onChange"]);return c.createElement("div",{className:o.default(f,r)},c.createElement("input",a.__assign({"data-testid":i,name:s,id:s,value:l,placeholder:d,disabled:u,readOnly:m,onChange:_,type:g},y)),v&&c.createElement("div",{className:p},v))},exports.IntlProvider=function(e){var t=e.locale,a=e.messages,r=e.children;return c.createElement(v.Provider,{value:{locale:t,messages:a,intl:{formatMessage:function(e,t){var r=e.id,n=e.defaultMessage,o=a&&a[r]?a[r]:n||"";if(t){var i=Object.keys(t);Array.isArray(i)&&i.map((function(e){var a=o.replace("{".concat(e,"}"),t[e]);o=a}))}return o}}}},r)},exports.MOLink=function(e){var t=e.keywordAndShortcode,r=e.className,n=e.dataQaId,o=void 0===n?"mo-link":n,i=e.children,s=a.__rest(e,["keywordAndShortcode","className","dataQaId","children"]);return c.createElement("a",a.__assign({href:_(t),className:r,"data-qa-id":o},s),i)},exports.PricePoint=function(e){var t=e.locale,a=e.className,r=void 0===a?"":a,n=e.legals,o=e.flow,i=e.dataQaId,s=void 0===i?"price-point":i,l=e.operator,d=n.filter((function(e){return e.flow===o})),u=(o?d:n).reduce((function(e,t){return e[t.language]=t,e}),{}),m=(u[t]||"").price_point,f=(u[t]||"").operator_price_point;return c.createElement("div",{"data-qa-id":s,className:r||""},f&&l&&c.createElement("div",{dangerouslySetInnerHTML:{__html:f[l.toUpperCase()]}})||c.createElement("div",{dangerouslySetInnerHTML:{__html:m}}))},exports.TopLegals=function(e){var t=e.locale,a=e.className,r=void 0===a?"":a,n=e.legals,o=e.flow,i=e.dataQaId,s=void 0===i?"top-legals-":i,l=n.filter((function(e){return e.flow===o})),d=((o?l:n).reduce((function(e,t){return e[t.language]=t,e}),{})[t]||"").top_legal;return c.createElement("div",{"data-qa-id":s,className:r},c.createElement("div",{dangerouslySetInnerHTML:{__html:d}}))},exports.defineMessages=g,exports.injectIntl=function(e){return function(t){return c.createElement(v.Consumer,null,(function(r){var n=r.intl;return c.createElement(e,a.__assign({},t,{intl:n}))}))}};
8
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import e from"classnames";import*as a from"react";import t from"react";import{__rest as r,__assign as n}from"tslib";var o="Disclaimers-module_wrapper__yyrGN";function i(a){var r=a.locale,n=a.className,i=void 0===n?"":n,c=a.legals,l=a.flow,d=a.dataQaId,s=void 0===d?"disclaimers":d,u=a.mcc,m=void 0===u?"":u,f=c.filter((function(e){return e.flow===l})),v=(l?f:c).reduce((function(e,a){return e[a.language]=a,e}),{}),p=(v[r]||"").disclaimer,g=(v[r]||"").mcc_disclaimer;return t.createElement("div",{"data-qa-id":s,className:e(o,i)},g&&m&&t.createElement("div",{dangerouslySetInnerHTML:{__html:g[m.toLowerCase()]}})||t.createElement("div",{dangerouslySetInnerHTML:{__html:p}})," ")}function c(e){var t=e.locale,r=e.className,n=e.legals,o=e.flow,i=e.dataQaId,c=void 0===i?"extra-disclaimers-":i,l=n.filter((function(e){return e.flow===o})),d=o&&!process.env.scenario?l:n,s=(d.reduce((function(e,a){return e[a.language]=a,e}),{})[t]||"").extra_disclaimer;return a.createElement("div",{"data-qa-id":c,className:r},a.createElement("div",{dangerouslySetInnerHTML:{__html:s}}))}var l,d,s,u,m="Input-module_wrapper__bzo7K",f="Input-module_error__rkwNz";function v(t){var o=t.wrapperClassName,i=void 0===o?"":o,c=t.dataQaId,l=void 0===c?"input-":c,d=t.id,s=t.value,u=t.placeholder,v=t.disabled,p=t.readOnly,g=t.error,w=t.type,h=t.onChange,y=r(t,["wrapperClassName","dataQaId","id","value","placeholder","disabled","readOnly","error","type","onChange"]);return a.createElement("div",{className:e(m,i)},a.createElement("input",n({"data-testid":l,name:d,id:d,value:s,placeholder:u,disabled:v,readOnly:p,onChange:h,type:w},y)),g&&a.createElement("div",{className:f},g))}!function(e){e.Text="text",e.Number="number",e.Email="email",e.Password="password",e.Search="search",e.Telephone="tel",e.URL="url"}(l||(l={})),function(e){e.Medium="Medium",e.Large="Large"}(d||(d={})),function(e){e.Left="Left",e.Right="Right"}(s||(s={})),function(e){e.Telephone="telephone",e.CreditCard="credit_card"}(u||(u={}));var p=a.createContext({locale:"en",messages:{},intl:{formatMessage:function(e,a){return e.id,e.defaultMessage,""}}});function g(e){var t=e.locale,r=e.messages,n=e.children;return a.createElement(p.Provider,{value:{locale:t,messages:r,intl:{formatMessage:function(e,a){var t=e.id,n=e.defaultMessage,o=r&&r[t]?r[t]:n||"";if(a){var i=Object.keys(a);Array.isArray(i)&&i.map((function(e){var t=o.replace("{".concat(e,"}"),a[e]);o=t}))}return o}}}},n)}function w(e){return function(t){return a.createElement(p.Consumer,null,(function(r){var o=r.intl;return a.createElement(e,n({},t,{intl:o}))}))}}function h(e){return e}exports.defineMessages=h;var y=function(e,a){return"undefined"!=typeof navigator&&(/iPhone/i.test(navigator.userAgent)||/Mac OS/i.test(navigator.userAgent))?a?"sms:/open?addresses=".concat(e.shortcode,"&body=").concat(e.keyword):"sms:".concat(e.shortcode,"&body=").concat(e.keyword):["com.facebook.orca","com.facebook.katana","com.instagram.android"].some((function(e){return new RegExp(e,"ig").test(window.pac_analytics.visitor["x-requested-with"])}))?"/mo-redirect-util/".concat(e.shortcode,"/").concat(e.keyword):window.pac_analytics.visitor["x-requested-with"]&&null!==window.pac_analytics.visitor["x-requested-with"]&&-1!==window.pac_analytics.visitor["x-requested-with"].indexOf("com.facebook")?"sms://".concat(e.shortcode,"?body=").concat(e.keyword):"sms:".concat(e.shortcode,"?body=").concat(e.keyword)},_=function(e){var t=e.keywordAndShortcode,o=e.className,i=e.dataQaId,c=void 0===i?"mo-link":i,l=e.children,d=r(e,["keywordAndShortcode","className","dataQaId","children"]);return a.createElement("a",n({href:y(t),className:o,"data-qa-id":c},d),l)};function E(e){var t=e.locale,r=e.className,n=void 0===r?"":r,o=e.legals,i=e.flow,c=e.dataQaId,l=void 0===c?"price-point":c,d=e.operator,s=o.filter((function(e){return e.flow===i})),u=(i?s:o).reduce((function(e,a){return e[a.language]=a,e}),{}),m=(u[t]||"").price_point,f=(u[t]||"").operator_price_point;return a.createElement("div",{"data-qa-id":l,className:n||""},f&&d&&a.createElement("div",{dangerouslySetInnerHTML:{__html:f[d.toUpperCase()]}})||a.createElement("div",{dangerouslySetInnerHTML:{__html:m}}))}function N(e){var t=e.locale,r=e.className,n=void 0===r?"":r,o=e.legals,i=e.flow,c=e.dataQaId,l=void 0===c?"top-legals-":c,d=o.filter((function(e){return e.flow===i})),s=((i?d:o).reduce((function(e,a){return e[a.language]=a,e}),{})[t]||"").top_legal;return a.createElement("div",{"data-qa-id":l,className:n},a.createElement("div",{dangerouslySetInnerHTML:{__html:s}}))}export{i as Disclaimers,c as ExtraDisclaimers,v as Input,l as InputType,g as IntlProvider,_ as MOLink,E as PricePoint,N as TopLegals,h as defineMessages,w as injectIntl};
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { ExtraDisclaimersProps } from './ExtraDisclaimers.types';
3
+ export declare function ExtraDisclaimers({ locale, className, legals, flow, dataQaId }: ExtraDisclaimersProps): JSX.Element;
@@ -0,0 +1,41 @@
1
+ import { Story } from '@storybook/react';
2
+ import { ExtraDisclaimersProps } from './ExtraDisclaimers.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<ExtraDisclaimersProps>;
@@ -0,0 +1,8 @@
1
+ import { ILegalFlows, ILegals } from '../Disclaimers/Disclaimers.types';
2
+ export interface ExtraDisclaimersProps {
3
+ locale: string;
4
+ legals: Array<ILegals>;
5
+ className?: string;
6
+ flow?: ILegalFlows;
7
+ dataQaId?: string;
8
+ }
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { InputProps } from './Input.types';
3
+ export declare function Input({ wrapperClassName, dataQaId, id, value, placeholder, disabled, readOnly, error, type, onChange, ...props }: InputProps): JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { Meta, Story } from '@storybook/react';
2
+ import { InputProps } from './Input.types';
3
+ declare const _default: Meta<import("@storybook/react").Args>;
4
+ export default _default;
5
+ export declare const Input: Story<InputProps>;
@@ -0,0 +1,38 @@
1
+ /// <reference types="react" />
2
+ export interface InputProps extends React.HTMLAttributes<HTMLInputElement> {
3
+ value: string;
4
+ label?: string;
5
+ onChange: React.FocusEventHandler<HTMLInputElement> | undefined;
6
+ type: InputType;
7
+ placeholder?: string;
8
+ error?: string;
9
+ dataQaId?: string;
10
+ disabled?: boolean;
11
+ readOnly?: boolean;
12
+ required?: boolean;
13
+ maxLength?: number;
14
+ minLength?: number;
15
+ wrapperClassName?: string;
16
+ onBlur?: React.FocusEventHandler<HTMLInputElement> | undefined;
17
+ }
18
+ export declare enum InputType {
19
+ Text = "text",
20
+ Number = "number",
21
+ Email = "email",
22
+ Password = "password",
23
+ Search = "search",
24
+ Telephone = "tel",
25
+ URL = "url"
26
+ }
27
+ export declare enum InputSize {
28
+ Medium = "Medium",
29
+ Large = "Large"
30
+ }
31
+ export declare enum InputIconPosition {
32
+ Left = "Left",
33
+ Right = "Right"
34
+ }
35
+ export declare enum InputMaskTypes {
36
+ Telephone = "telephone",
37
+ CreditCard = "credit_card"
38
+ }
@@ -0,0 +1,18 @@
1
+ import * as React from 'react';
2
+ export interface IHash {
3
+ [key: string]: string;
4
+ }
5
+ export declare function IntlProvider({ locale, messages, children }: {
6
+ locale: string;
7
+ messages: IHash;
8
+ children: React.ReactChild | JSX.Element[] | JSX.Element;
9
+ }): JSX.Element;
10
+ export declare function Translate({ id, values, defaultMessage }: {
11
+ id: string;
12
+ values?: {
13
+ [key: string]: string;
14
+ };
15
+ defaultMessage?: string;
16
+ }): string;
17
+ export declare function injectIntl(Child: React.ComponentType<any>): (props: any) => JSX.Element;
18
+ export declare function defineMessages(messageDescriptors: any): any;
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
- export interface IKeywordShortcode {
2
+ export declare type IKeywordShortcode = {
3
3
  keyword: string;
4
4
  shortcode: string;
5
- }
5
+ };
6
6
  export declare type MOLinkProps = {
7
7
  keywordAndShortcode: IKeywordShortcode;
8
8
  children: React.ReactNode;
@@ -1,4 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  import { PricePointProps } from './PricePoint.types';
3
- declare const _default: ({ locale, className, legals, flow, dataQaId, operator }: PricePointProps) => JSX.Element;
4
- export default _default;
3
+ export declare function PricePoint({ locale, className, legals, flow, dataQaId, operator }: PricePointProps): JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { ILegalFlows, ILegals } from '../Disclaimers/Disclaimers.types';
2
+ export interface PricePointProps {
3
+ locale: string;
4
+ legals: Array<ILegals>;
5
+ operator?: string;
6
+ className?: string;
7
+ flow?: ILegalFlows;
8
+ dataQaId?: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { TopLegalsProps } from './TopLegals.types';
3
+ export declare function TopLegals({ locale, className, legals, flow, dataQaId }: TopLegalsProps): JSX.Element;
@@ -0,0 +1,41 @@
1
+ import { Story } from '@storybook/react';
2
+ import { TopLegalsProps } from './TopLegals.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<TopLegalsProps>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import { ILegalFlows, ILegals } from '../Disclaimers/Disclaimers.types';
2
+ export interface TopLegalsProps {
3
+ locale: string;
4
+ legals: Array<ILegals>;
5
+ className?: string;
6
+ flow?: ILegalFlows;
7
+ dataQaId?: string;
8
+ }
@@ -1,2 +1,11 @@
1
1
  import { Disclaimers } from './Disclaimers/Disclaimers';
2
- export { Disclaimers };
2
+ import { ExtraDisclaimers } from './ExtraDisclaimers/ExtraDisclaimers';
3
+ import { Input } from './Input/Input';
4
+ import { InputType } from './Input/Input.types';
5
+ import { defineMessages, injectIntl, IntlProvider } from './Intl/Intl';
6
+ import { MOLink } from './MOLink/MOLink';
7
+ import { IKeywordShortcode } from './MOLink/MOLink.types';
8
+ import { PricePoint } from './PricePoint/PricePoint';
9
+ import { TopLegals } from './TopLegals/TopLegals';
10
+ export { Disclaimers, PricePoint, TopLegals, ExtraDisclaimers, MOLink, Input, InputType, injectIntl, IntlProvider, defineMessages };
11
+ export type { IKeywordShortcode };
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "ouisys-component-library",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "Ouisys Components",
5
5
  "main": "build/index.js",
6
6
  "module": "build/index.es.js",
7
+ "typings": "build/index.d.ts",
7
8
  "files": [
8
9
  "build"
9
10
  ],
@@ -28,6 +29,7 @@
28
29
  "babel-loader": "^8.2.3",
29
30
  "babel-preset-react-app": "^10.0.1",
30
31
  "classnames": "^2.3.1",
32
+ "esbuild": "^0.15.10",
31
33
  "eslint": "^7.16.0",
32
34
  "eslint-config-airbnb": "^18.2.1",
33
35
  "eslint-config-ouisys": "0.0.1",
@@ -52,6 +54,8 @@
52
54
  "react-test-renderer": "^17.0.2",
53
55
  "rollup": "^2.64.0",
54
56
  "rollup-plugin-analyzer": "^4.0.0",
57
+ "rollup-plugin-dts": "^4.2.3",
58
+ "rollup-plugin-esbuild": "^4.10.1",
55
59
  "rollup-plugin-peer-deps-external": "^2.2.4",
56
60
  "rollup-plugin-postcss": "^4.0.2",
57
61
  "rollup-plugin-terser": "^7.0.2",
@@ -1,2 +0,0 @@
1
- .Disclaimers-module_wrapper__yyrGN{background-color:red}
2
- /*# sourceMappingURL=index.es.css.map */
@@ -1 +0,0 @@
1
- {"version":3,"sources":["Disclaimers.module.scss"],"names":[],"mappings":"AAAA,mCACE,oBAAuB","file":"index.es.css","sourcesContent":[".wrapper {\n background-color: red; }\n"]}
package/build/index.es.js DELETED
@@ -1,7 +0,0 @@
1
- import e from"react";var r,t={exports:{}};
2
- /*!
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};
7
- //# sourceMappingURL=index.es.js.map
@@ -1 +0,0 @@
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"}