@coorpacademy/components 11.13.7-alpha.9 → 11.14.1-alpha.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.
Files changed (67) hide show
  1. package/es/atom/button/index.d.ts.map +1 -1
  2. package/es/atom/button/index.js +18 -13
  3. package/es/atom/button/index.js.map +1 -1
  4. package/es/molecule/cm-popin/index.d.ts.map +1 -1
  5. package/es/molecule/cm-popin/index.js +5 -4
  6. package/es/molecule/cm-popin/index.js.map +1 -1
  7. package/es/molecule/cm-popin/style.css +61 -40
  8. package/es/molecule/discipline-header/index.d.ts +1 -0
  9. package/es/molecule/discipline-header/index.d.ts.map +1 -1
  10. package/es/molecule/discipline-header/index.js +24 -9
  11. package/es/molecule/discipline-header/index.js.map +1 -1
  12. package/es/molecule/discipline-header/style.css +34 -7
  13. package/es/template/common/discipline/index.d.ts.map +1 -1
  14. package/es/template/common/discipline/index.js +4 -2
  15. package/es/template/common/discipline/index.js.map +1 -1
  16. package/es/template/external-course/index.d.ts +69 -21
  17. package/es/template/external-course/index.d.ts.map +1 -1
  18. package/es/template/external-course/index.js +73 -56
  19. package/es/template/external-course/index.js.map +1 -1
  20. package/es/template/external-course/style.css +1 -1
  21. package/es/template/mobile-login/welcome/index.native.d.ts +18 -0
  22. package/es/template/mobile-login/welcome/index.native.d.ts.map +1 -0
  23. package/es/template/mobile-login/welcome/index.native.js +195 -0
  24. package/es/template/mobile-login/welcome/index.native.js.map +1 -0
  25. package/lib/atom/button/index.d.ts.map +1 -1
  26. package/lib/atom/button/index.js +18 -13
  27. package/lib/atom/button/index.js.map +1 -1
  28. package/lib/molecule/cm-popin/index.d.ts.map +1 -1
  29. package/lib/molecule/cm-popin/index.js +4 -3
  30. package/lib/molecule/cm-popin/index.js.map +1 -1
  31. package/lib/molecule/cm-popin/style.css +61 -40
  32. package/lib/molecule/discipline-header/index.d.ts +1 -0
  33. package/lib/molecule/discipline-header/index.d.ts.map +1 -1
  34. package/lib/molecule/discipline-header/index.js +25 -9
  35. package/lib/molecule/discipline-header/index.js.map +1 -1
  36. package/lib/molecule/discipline-header/style.css +34 -7
  37. package/lib/template/common/discipline/index.d.ts.map +1 -1
  38. package/lib/template/common/discipline/index.js +4 -2
  39. package/lib/template/common/discipline/index.js.map +1 -1
  40. package/lib/template/external-course/index.d.ts +69 -21
  41. package/lib/template/external-course/index.d.ts.map +1 -1
  42. package/lib/template/external-course/index.js +76 -54
  43. package/lib/template/external-course/index.js.map +1 -1
  44. package/lib/template/external-course/style.css +1 -1
  45. package/lib/template/mobile-login/welcome/index.native.d.ts +18 -0
  46. package/lib/template/mobile-login/welcome/index.native.d.ts.map +1 -0
  47. package/lib/template/mobile-login/welcome/index.native.js +212 -0
  48. package/lib/template/mobile-login/welcome/index.native.js.map +1 -0
  49. package/package.json +3 -3
  50. package/es/atom/form-text-input/index.d.ts +0 -27
  51. package/es/atom/form-text-input/index.d.ts.map +0 -1
  52. package/es/atom/form-text-input/index.js +0 -96
  53. package/es/atom/form-text-input/index.js.map +0 -1
  54. package/es/atom/form-text-input/prop-types.d.ts +0 -56
  55. package/es/atom/form-text-input/prop-types.d.ts.map +0 -1
  56. package/es/atom/form-text-input/prop-types.js +0 -35
  57. package/es/atom/form-text-input/prop-types.js.map +0 -1
  58. package/es/atom/form-text-input/style.css +0 -53
  59. package/lib/atom/form-text-input/index.d.ts +0 -27
  60. package/lib/atom/form-text-input/index.d.ts.map +0 -1
  61. package/lib/atom/form-text-input/index.js +0 -114
  62. package/lib/atom/form-text-input/index.js.map +0 -1
  63. package/lib/atom/form-text-input/prop-types.d.ts +0 -56
  64. package/lib/atom/form-text-input/prop-types.d.ts.map +0 -1
  65. package/lib/atom/form-text-input/prop-types.js +0 -46
  66. package/lib/atom/form-text-input/prop-types.js.map +0 -1
  67. package/lib/atom/form-text-input/style.css +0 -53
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["defaultWrapperStyle","default","style","cockpit","defaultCockpit","mobile","ExternalCourse","React","Component","handleOnClick","field","e","stopPropagation","preventDefault","onClick","render","name","type","url","warning","complete","quit","loading","backgroundImageUrl","contentType","mode","props","skin","context","primary","IconType","EXTERNAL_CONTENT_ICONS","icon","IconColor","color","mainContentSlot","loader","completeButton","disabled","label","backgroundColor","convert","cursor","classnames","completeCta","warningButton","leftSection","iconLabel","link","iconQuestion","quitButton","quitCta","titleSection","title","oval","iconHeader","innerHTML","__html","header","rightSection","footer","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","oneOf","isRequired","shape","func","bool"],"sources":["../../../src/template/external-course/index.js"],"sourcesContent":["import React from 'react';\nimport {NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionIcon} from '@coorpacademy/nova-icons';\nimport {convert} from 'css-color-function';\nimport classnames from 'classnames';\nimport {get, getOr, keys, identity, isNil, isEmpty} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport {EXTERNAL_CONTENT_ICONS} from '../../util/external-content';\nimport Provider from '../../atom/provider';\nimport Loader from '../../atom/loader';\nimport Button from '../../atom/button';\nimport ExternalContentViewer from '../../molecule/external-content-viewer';\nimport style from './style.css';\n\nconst defaultWrapperStyle = {\n default: style.default,\n cockpit: style.defaultCockpit,\n mobile: style.default\n};\n\nclass ExternalCourse extends React.Component {\n static propTypes = {\n name: PropTypes.string,\n type: PropTypes.oneOf(keys(EXTERNAL_CONTENT_ICONS)),\n url: PropTypes.string.isRequired,\n quit: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func\n }),\n complete: PropTypes.shape({\n label: PropTypes.string.isRequired,\n disabled: PropTypes.bool,\n onClick: PropTypes.func\n }),\n warning: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func\n }),\n loading: PropTypes.bool,\n backgroundImageUrl: PropTypes.string,\n contentType: PropTypes.string,\n mode: PropTypes.string\n };\n\n static contextTypes = {\n skin: Provider.childContextTypes.skin\n };\n\n handleOnClick = field => e => {\n e.stopPropagation();\n e.preventDefault();\n const onClick = get('onClick', field);\n return onClick && onClick(e);\n };\n\n render() {\n const {\n name,\n type,\n url,\n warning,\n complete,\n quit,\n loading,\n backgroundImageUrl,\n contentType,\n mode = 'default'\n } = this.props;\n const {skin} = this.context;\n const primary = getOr('#00B0FF', 'common.primary', skin);\n const IconType = EXTERNAL_CONTENT_ICONS[type].icon;\n const IconColor = EXTERNAL_CONTENT_ICONS[type].color;\n\n const mainContentSlot = loading ? (\n <div className={style.loader}>\n <Loader />\n </div>\n ) : (\n <ExternalContentViewer\n url={url}\n mode={mode}\n backgroundImageUrl={backgroundImageUrl}\n contentType={contentType}\n />\n );\n\n const completeButton = !isNil(complete) ? (\n <Button\n type=\"button\"\n disabled={loading ? true : complete.disabled}\n onClick={loading ? identity : this.handleOnClick(complete)}\n submitValue={complete.label}\n style={{\n backgroundColor:\n complete.disabled || loading ? convert(`color(${primary} a(-50%))`) : primary,\n cursor: loading ? 'progress' : 'pointer'\n }}\n className={classnames(\n style.completeCta,\n complete.disabled || loading ? style.disabled : null,\n loading ? style.loading : null\n )}\n />\n ) : null;\n\n const warningButton = !isNil(warning) ? (\n <div className={style.leftSection}>\n <div\n onClick={this.handleOnClick(warning)}\n className={classnames(style.iconLabel, style.link)}\n >\n <QuestionIcon className={style.iconQuestion} width={24} height={24} />\n <span>{warning.label}</span>\n </div>\n </div>\n ) : null;\n\n const quitButton = !isNil(quit) ? (\n <div className={style.leftSection}>\n <span\n className={classnames(style.quitCta, loading ? style.loading : null)}\n onClick={loading ? identity : this.handleOnClick(quit)}\n >\n {quit.label}\n </span>\n </div>\n ) : null;\n\n const titleSection = !isNil(name) ? (\n <div className={classnames(style.iconLabel, style.title)}>\n <div className={style.oval} style={{backgroundColor: IconColor}}>\n <IconType className={style.iconHeader} />\n </div>\n <span\n className={style.innerHTML}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: name}}\n />\n </div>\n ) : null;\n\n const header =\n !isNil(quit) || !isEmpty(name) ? (\n <div className={style.header}>\n {quitButton}\n {titleSection}\n {isNil(quit) ? null : <div className={style.rightSection} />}\n </div>\n ) : null;\n\n const footer =\n !isNil(warning) || !isNil(complete) ? (\n <div className={style.footer}>\n {warningButton}\n {completeButton}\n {isNil(warning) ? null : <div className={style.rightSection} />}\n </div>\n ) : null;\n\n return (\n <div className={defaultWrapperStyle[mode]}>\n {header}\n {mainContentSlot}\n {footer}\n </div>\n );\n }\n}\n\nexport default ExternalCourse;\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,mBAAmB,GAAG;EAC1BC,OAAO,EAAEC,cAAA,CAAMD,OADW;EAE1BE,OAAO,EAAED,cAAA,CAAME,cAFW;EAG1BC,MAAM,EAAEH,cAAA,CAAMD;AAHY,CAA5B;;AAMA,MAAMK,cAAN,SAA6BC,cAAA,CAAMC,SAAnC,CAA6C;EAAA;IAAA;;IAAA,KA4B3CC,aA5B2C,GA4B3BC,KAAK,IAAIC,CAAC,IAAI;MAC5BA,CAAC,CAACC,eAAF;MACAD,CAAC,CAACE,cAAF;MACA,MAAMC,OAAO,GAAG,mBAAI,SAAJ,EAAeJ,KAAf,CAAhB;MACA,OAAOI,OAAO,IAAIA,OAAO,CAACH,CAAD,CAAzB;IACD,CAjC0C;EAAA;;EAmC3CI,MAAM,GAAG;IACP,MAAM;MACJC,IADI;MAEJC,IAFI;MAGJC,GAHI;MAIJC,OAJI;MAKJC,QALI;MAMJC,IANI;MAOJC,OAPI;MAQJC,kBARI;MASJC,WATI;MAUJC,IAAI,GAAG;IAVH,IAWF,KAAKC,KAXT;IAYA,MAAM;MAACC;IAAD,IAAS,KAAKC,OAApB;IACA,MAAMC,OAAO,GAAG,qBAAM,SAAN,EAAiB,gBAAjB,EAAmCF,IAAnC,CAAhB;IACA,MAAMG,QAAQ,GAAGC,uCAAA,CAAuBd,IAAvB,EAA6Be,IAA9C;IACA,MAAMC,SAA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,CAAUC,MAAV,CAAiBE,UADD;IAEvBtD,OAAO,EAAEmD,kBAAA,CAAUK;EAFI,CAAhB,CAbQ;EAiBjBhD,OAAO,EAAE2C,kBAAA,CAAUM,IAjBF;EAkBjBhD,kBAAkB,EAAE0C,kBAAA,CAAUC,MAlBb;EAmBjB1C,WAAW,EAAEyC,kBAAA,CAAUC,MAnBN;EAoBjBzC,IAAI,EAAEwC,kBAAA,CAAUC;AApBC,C;eAoJN5D,c"}
1
+ {"version":3,"file":"index.js","names":["defaultWrapperStyle","default","style","cockpit","defaultCockpit","mobile","ExternalCourse","props","context","name","type","url","quit","complete","warning","loading","backgroundImageUrl","contentType","mode","closePopin","skin","primary","IconType","EXTERNAL_CONTENT_ICONS","icon","IconColor","color","mainContentSlot","useMemo","loader","handleOnClick","useCallback","field","onClick","e","stopPropagation","preventDefault","completeButton","disabled","label","backgroundColor","convert","cursor","classnames","completeCta","warningButton","leftSection","iconLabel","link","iconQuestion","quitButton","quitCta","titleSection","title","oval","iconHeader","innerHTML","__html","header","rightSection","footer","popin","propTypes","PropTypes","string","oneOf","isRequired","shape","func","bool","CmPopin","contextTypes","Provider","childContextTypes"],"sources":["../../../src/template/external-course/index.js"],"sourcesContent":["import React, {useCallback, useMemo} from 'react';\nimport {NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionIcon} from '@coorpacademy/nova-icons';\nimport {convert} from 'css-color-function';\nimport classnames from 'classnames';\nimport {noop, getOr, keys, identity, isNil, isEmpty} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport {EXTERNAL_CONTENT_ICONS} from '../../util/external-content';\nimport Provider from '../../atom/provider';\nimport Loader from '../../atom/loader';\nimport Button from '../../atom/button';\nimport ExternalContentViewer from '../../molecule/external-content-viewer';\nimport CmPopin from '../../molecule/cm-popin';\nimport style from './style.css';\n\nconst defaultWrapperStyle = {\n default: style.default,\n cockpit: style.defaultCockpit,\n mobile: style.default\n};\n\nconst ExternalCourse = (props, context) => {\n const {\n name,\n type,\n url,\n quit,\n complete,\n warning,\n loading,\n backgroundImageUrl,\n contentType,\n mode = 'default',\n closePopin\n } = props;\n const {skin} = context;\n const primary = getOr('#00B0FF', 'common.primary', skin);\n const IconType = EXTERNAL_CONTENT_ICONS[type].icon;\n const IconColor = EXTERNAL_CONTENT_ICONS[type].color;\n\n const mainContentSlot = useMemo(() => {\n return loading ? (\n <div className={style.loader}>\n <Loader />\n </div>\n ) : (\n <ExternalContentViewer\n url={url}\n mode={mode}\n backgroundImageUrl={backgroundImageUrl}\n contentType={contentType}\n />\n );\n }, [loading, url, mode, contentType, backgroundImageUrl]);\n\n const handleOnClick = useCallback(field => {\n const onClick = getOr(noop, ['onClick'], field);\n return e => {\n e.stopPropagation();\n e.preventDefault();\n return onClick(e);\n };\n }, []);\n\n const completeButton = useMemo(() => {\n return !isNil(complete) ? (\n <Button\n type=\"button\"\n disabled={loading ? true : complete.disabled}\n onClick={loading ? identity : handleOnClick(complete)}\n submitValue={complete.label}\n style={{\n backgroundColor:\n complete.disabled || loading ? convert(`color(${primary} a(-50%))`) : primary,\n cursor: loading ? 'progress' : 'pointer'\n }}\n className={classnames(\n style.completeCta,\n complete.disabled || loading ? style.disabled : null,\n loading ? style.loading : null\n )}\n data-testid=\"complete-button\"\n />\n ) : null;\n }, [complete, loading, primary, handleOnClick]);\n\n const warningButton = useMemo(() => {\n return !isNil(warning) ? (\n <div className={style.leftSection}>\n <div onClick={handleOnClick(warning)} className={classnames(style.iconLabel, style.link)}>\n <QuestionIcon className={style.iconQuestion} width={24} height={24} />\n <span>{warning.label}</span>\n </div>\n </div>\n ) : null;\n }, [handleOnClick, warning]);\n\n const quitButton = useMemo(() => {\n return !isNil(quit) ? (\n <div className={style.leftSection}>\n <span\n className={classnames(style.quitCta, loading ? style.loading : null)}\n onClick={loading ? identity : handleOnClick(quit)}\n >\n {quit.label}\n </span>\n </div>\n ) : null;\n }, [quit, loading, handleOnClick]);\n\n const titleSection = useMemo(() => {\n return !isNil(name) ? (\n <div className={classnames(style.iconLabel, style.title)}>\n <div className={style.oval} style={{backgroundColor: IconColor}}>\n <IconType className={style.iconHeader} />\n </div>\n <span\n className={style.innerHTML}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: name}}\n />\n </div>\n ) : null;\n }, [name, IconColor]);\n\n const header = useMemo(() => {\n return !isNil(quit) || !isEmpty(name) ? (\n <div className={style.header}>\n {quitButton}\n {titleSection}\n {isNil(quit) ? null : <div className={style.rightSection} />}\n </div>\n ) : null;\n }, [name, titleSection, quit, quitButton]);\n\n const footer = useMemo(() => {\n return !isNil(warning) || !isNil(complete) ? (\n <div className={style.footer}>\n {warningButton}\n {completeButton}\n {isNil(warning) ? null : <div className={style.rightSection} />}\n </div>\n ) : null;\n }, [warning, warningButton, complete, completeButton]);\n\n const popin = useMemo(() => {\n return !isNil(closePopin) ? <CmPopin {...closePopin} /> : null;\n }, [closePopin]);\n\n return (\n <div className={defaultWrapperStyle[mode]}>\n {header}\n {popin}\n {mainContentSlot}\n {footer}\n </div>\n );\n};\n\nExternalCourse.propTypes = {\n name: PropTypes.string,\n type: PropTypes.oneOf(keys(EXTERNAL_CONTENT_ICONS)),\n url: PropTypes.string.isRequired,\n quit: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func\n }),\n complete: PropTypes.shape({\n label: PropTypes.string.isRequired,\n disabled: PropTypes.bool,\n onClick: PropTypes.func\n }),\n warning: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func\n }),\n loading: PropTypes.bool,\n backgroundImageUrl: PropTypes.string,\n contentType: PropTypes.string,\n mode: PropTypes.string,\n closePopin: PropTypes.shape({...CmPopin.propTypes})\n};\n\nExternalCourse.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nexport default ExternalCourse;\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAE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EAAEqD,kBAAA,CAAUE,KAAV,CAAgB,oBAAK1C,uCAAL,CAAhB,CAFmB;EAGzBZ,GAAG,EAAEoD,kBAAA,CAAUC,MAAV,CAAiBE,UAHG;EAIzBtD,IAAI,EAAEmD,kBAAA,CAAUI,KAAV,CAAgB;IACpB5B,KAAK,EAAEwB,kBAAA,CAAUC,MAAV,CAAiBE,UADJ;IAEpBjC,OAAO,EAAE8B,kBAAA,CAAUK;EAFC,CAAhB,CAJmB;EAQzBvD,QAAQ,EAAEkD,kBAAA,CAAUI,KAAV,CAAgB;IACxB5B,KAAK,EAAEwB,kBAAA,CAAUC,MAAV,CAAiBE,UADA;IAExB5B,QAAQ,EAAEyB,kBAAA,CAAUM,IAFI;IAGxBpC,OAAO,EAAE8B,kBAAA,CAAUK;EAHK,CAAhB,CARe;EAazBtD,OAAO,EAAEiD,kBAAA,CAAUI,KAAV,CAAgB;IACvB5B,KAAK,EAAEwB,kBAAA,CAAUC,MAAV,CAAiBE,UADD;IAEvBjC,OAAO,EAAE8B,kBAAA,CAAUK;EAFI,CAAhB,CAbgB;EAiBzBrD,OAAO,EAAEgD,kBAAA,CAAUM,IAjBM;EAkBzBrD,kBAAkB,EAAE+C,kBAAA,CAAUC,MAlBL;EAmBzB/C,WAAW,EAAE8C,kBAAA,CAAUC,MAnBE;EAoBzB9C,IAAI,EAAE6C,kBAAA,CAAUC,MApBS;EAqBzB7C,UAAU,EAAE4C,kBAAA,CAAUI,KAAV,cAAoBG,gBAAA,CAAQR,SAA5B;AArBa,CAA3B;AAwBAxD,cAAc,CAACiE,YAAf,GAA8B;EAC5BnD,IAAI,EAAEoD,iBAAA,CAASC,iBAAT,CAA2BrD;AADL,CAA9B;eAIed,c"}
@@ -24,7 +24,7 @@
24
24
  }
25
25
 
26
26
  .defaultCockpit{
27
- composes:default;
27
+ composes: default;
28
28
  height: 100%;
29
29
  }
30
30
 
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ export declare type Props = {
3
+ onDemoPress: () => void;
4
+ onDesktopButtonPress: () => void;
5
+ onHelpPress: () => void;
6
+ onMobileButtonPress: () => void;
7
+ locales: {
8
+ title: string;
9
+ description: string;
10
+ ctaQRCode: string;
11
+ ctaReceiveMail: string;
12
+ titleHelp: string;
13
+ ctaHelp: string;
14
+ };
15
+ };
16
+ declare const Welcome: (props: Props) => JSX.Element | null;
17
+ export default Welcome;
18
+ //# sourceMappingURL=index.native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../../src/template/mobile-login/welcome/index.native.tsx"],"names":[],"mappings":";AA+IA,oBAAY,KAAK,GAAG;IAClB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,oBAAoB,EAAE,MAAM,IAAI,CAAC;IACjC,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,OAAO,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,cAAc,EAAE,MAAM,CAAC;QACvB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH,CAAC;AAEF,QAAA,MAAM,OAAO,UAAW,KAAK,uBA0D5B,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,212 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _react = _interopRequireWildcard(require("react"));
7
+
8
+ var _reactNative = require("react-native");
9
+
10
+ var _reactNativeLinearGradient = _interopRequireDefault(require("react-native-linear-gradient"));
11
+
12
+ var _novaIcons = require("@coorpacademy/nova-icons");
13
+
14
+ var _index = _interopRequireDefault(require("../../../hoc/touchable/index.native"));
15
+
16
+ var _templateContext = require("../../app-review/template-context");
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
20
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
+
22
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
+
24
+ const createStyleSheet = theme => _reactNative.StyleSheet.create({
25
+ wrapper: {
26
+ top: 0,
27
+ bottom: 0,
28
+ left: 0,
29
+ right: 0,
30
+ flex: 1,
31
+ justifyContent: 'space-around',
32
+ alignItems: 'center',
33
+ paddingHorizontal: 24
34
+ },
35
+ content: {
36
+ width: '100%',
37
+ alignItems: 'flex-start'
38
+ },
39
+ gradient: {
40
+ position: 'absolute',
41
+ top: -100,
42
+ bottom: 0,
43
+ left: -180,
44
+ right: 0,
45
+ opacity: 1,
46
+ transform: [{
47
+ rotate: '35deg'
48
+ }]
49
+ },
50
+ gradient2: {
51
+ position: 'absolute',
52
+ top: -80,
53
+ bottom: 0,
54
+ left: 0,
55
+ right: -200,
56
+ opacity: 0.5,
57
+ transform: [{
58
+ rotate: '-35deg'
59
+ }]
60
+ },
61
+ logo: {
62
+ padding: 100
63
+ },
64
+ title: {
65
+ fontWeight: '600',
66
+ fontSize: 28,
67
+ lineHeight: 36,
68
+ paddingVertical: 8
69
+ },
70
+ description: {
71
+ fontSize: 18,
72
+ lineHeight: 24,
73
+ paddingVertical: 8
74
+ },
75
+ actions: {
76
+ width: '100%'
77
+ },
78
+ buttons: {
79
+ paddingVertical: 20,
80
+ alignItems: 'center'
81
+ },
82
+ button: {
83
+ paddingVertical: 12,
84
+ marginVertical: 4,
85
+ width: '100%',
86
+ flexDirection: 'row',
87
+ justifyContent: 'center',
88
+ borderRadius: 12,
89
+ alignItems: 'center',
90
+ overflow: 'hidden'
91
+ },
92
+ ctaQRCode: {
93
+ backgroundColor: theme.colors.cta
94
+ },
95
+ ctaQRCodeText: {
96
+ marginLeft: 8,
97
+ color: '#fff',
98
+ fontWeight: '700',
99
+ fontSize: 14,
100
+ lineHeight: 24
101
+ },
102
+ qrCodeIcon: {
103
+ fill: '#fff',
104
+ height: 14,
105
+ width: 14
106
+ },
107
+ ctaReceiveMail: {
108
+ backgroundColor: '#eaeaeb'
109
+ },
110
+ ctaReceiveMailText: {
111
+ marginLeft: 8,
112
+ color: '#1D1D2B',
113
+ fontWeight: '700',
114
+ fontSize: 14,
115
+ lineHeight: 24
116
+ },
117
+ mailIcon: {
118
+ fill: '#1D1D2B',
119
+ height: 12,
120
+ width: 16
121
+ },
122
+ help: {
123
+ flexDirection: 'row',
124
+ justifyContent: 'center'
125
+ },
126
+ titleHelp: {
127
+ color: '#9999A8'
128
+ },
129
+ ctaHelp: {
130
+ marginLeft: 5,
131
+ textDecorationLine: 'underline',
132
+ color: '#9999A8'
133
+ }
134
+ });
135
+
136
+ const Welcome = props => {
137
+ const {
138
+ locales,
139
+ onDemoPress,
140
+ onDesktopButtonPress,
141
+ onHelpPress,
142
+ onMobileButtonPress
143
+ } = props;
144
+ const {
145
+ theme
146
+ } = (0, _templateContext.useTemplateContext)();
147
+ const [styleSheet, setStylesheet] = (0, _react.useState)(null);
148
+ (0, _react.useEffect)(() => {
149
+ const _stylesheet = createStyleSheet(theme);
150
+
151
+ setStylesheet(_stylesheet);
152
+ }, [theme]);
153
+
154
+ if (!styleSheet) {
155
+ return null;
156
+ }
157
+
158
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
159
+ style: styleSheet.wrapper,
160
+ testID: "welcome"
161
+ }, /*#__PURE__*/_react.default.createElement(_reactNativeLinearGradient.default, {
162
+ colors: ['#0061FF', '#fff'],
163
+ locations: [0, 0.3],
164
+ style: styleSheet.gradient
165
+ }), /*#__PURE__*/_react.default.createElement(_reactNativeLinearGradient.default, {
166
+ colors: ['#2199AB', '#fff'],
167
+ locations: [0, 0.3],
168
+ style: styleSheet.gradient2
169
+ }), /*#__PURE__*/_react.default.createElement(_index.default, {
170
+ onLongPress: onDemoPress,
171
+ style: styleSheet.logo
172
+ }, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademyLogoCoorp, {
173
+ fill: theme.colors.cta,
174
+ width: 77,
175
+ height: 75
176
+ })), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
177
+ style: styleSheet.content
178
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
179
+ style: styleSheet.title
180
+ }, locales.title), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
181
+ style: styleSheet.description
182
+ }, locales.description), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
183
+ style: styleSheet.actions
184
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
185
+ style: styleSheet.buttons
186
+ }, /*#__PURE__*/_react.default.createElement(_index.default, {
187
+ style: [styleSheet.button, styleSheet.ctaQRCode],
188
+ onPress: onDesktopButtonPress
189
+ }, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademyQrCode, {
190
+ style: styleSheet.qrCodeIcon
191
+ }), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
192
+ style: styleSheet.ctaQRCodeText
193
+ }, locales.ctaQRCode)), /*#__PURE__*/_react.default.createElement(_index.default, {
194
+ style: [styleSheet.button, styleSheet.ctaReceiveMail],
195
+ onPress: onMobileButtonPress
196
+ }, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademyEmail, {
197
+ style: styleSheet.mailIcon
198
+ }), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
199
+ style: styleSheet.ctaReceiveMailText
200
+ }, locales.ctaReceiveMail))), /*#__PURE__*/_react.default.createElement(_index.default, {
201
+ onPress: onHelpPress,
202
+ style: styleSheet.help
203
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
204
+ style: styleSheet.titleHelp
205
+ }, locales.titleHelp), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
206
+ style: styleSheet.ctaHelp
207
+ }, locales.ctaHelp)))));
208
+ };
209
+
210
+ var _default = Welcome;
211
+ exports.default = _default;
212
+ //# sourceMappingURL=index.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.native.js","names":["createStyleSheet","theme","StyleSheet","create","wrapper","top","bottom","left","right","flex","justifyContent","alignItems","paddingHorizontal","content","width","gradient","position","opacity","transform","rotate","gradient2","logo","padding","title","fontWeight","fontSize","lineHeight","paddingVertical","description","actions","buttons","button","marginVertical","flexDirection","borderRadius","overflow","ctaQRCode","backgroundColor","colors","cta","ctaQRCodeText","marginLeft","color","qrCodeIcon","fill","height","ctaReceiveMail","ctaReceiveMailText","mailIcon","help","titleHelp","ctaHelp","textDecorationLine","Welcome","props","locales","onDemoPress","onDesktopButtonPress","onHelpPress","onMobileButtonPress","useTemplateContext","styleSheet","setStylesheet","useState","useEffect","_stylesheet"],"sources":["../../../../src/template/mobile-login/welcome/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {StyleSheet, Text, TextStyle, View, ViewStyle} from 'react-native';\nimport LinearGradient from 'react-native-linear-gradient';\nimport {\n NovaCompositionCoorpacademyLogoCoorp as LogoCoorp,\n NovaCompositionCoorpacademyQrCode as QrCodeIcon,\n NovaCompositionCoorpacademyEmail as MailIcon\n} from '@coorpacademy/nova-icons';\nimport Touchable from '../../../hoc/touchable/index.native';\nimport {useTemplateContext} from '../../app-review/template-context';\nimport {Theme} from '../../../variables/theme.native';\n\ntype StyleSheetType = {\n wrapper: ViewStyle;\n logo: ViewStyle;\n content: ViewStyle;\n gradient: ViewStyle;\n gradient2: ViewStyle;\n title: TextStyle;\n description: TextStyle;\n actions: ViewStyle;\n buttons: ViewStyle;\n button: ViewStyle;\n qrCodeIcon: ViewStyle;\n mailIcon: ViewStyle;\n ctaQRCode: ViewStyle;\n ctaQRCodeText: TextStyle;\n ctaReceiveMail: ViewStyle;\n ctaReceiveMailText: TextStyle;\n help: ViewStyle;\n titleHelp: TextStyle;\n ctaHelp: ViewStyle;\n};\n\nconst createStyleSheet = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n wrapper: {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n flex: 1,\n justifyContent: 'space-around',\n alignItems: 'center',\n paddingHorizontal: 24\n },\n content: {\n width: '100%',\n alignItems: 'flex-start'\n },\n gradient: {\n position: 'absolute',\n top: -100,\n bottom: 0,\n left: -180,\n right: 0,\n opacity: 1,\n transform: [{rotate: '35deg'}]\n },\n gradient2: {\n position: 'absolute',\n top: -80,\n bottom: 0,\n left: 0,\n right: -200,\n opacity: 0.5,\n transform: [{rotate: '-35deg'}]\n },\n logo: {\n padding: 100\n },\n title: {\n fontWeight: '600',\n fontSize: 28,\n lineHeight: 36,\n paddingVertical: 8\n },\n description: {\n fontSize: 18,\n lineHeight: 24,\n paddingVertical: 8\n },\n actions: {\n width: '100%'\n },\n buttons: {\n paddingVertical: 20,\n alignItems: 'center'\n },\n button: {\n paddingVertical: 12,\n marginVertical: 4,\n width: '100%',\n flexDirection: 'row',\n justifyContent: 'center',\n borderRadius: 12,\n alignItems: 'center',\n overflow: 'hidden'\n },\n ctaQRCode: {\n backgroundColor: theme.colors.cta\n },\n ctaQRCodeText: {\n marginLeft: 8,\n color: '#fff',\n fontWeight: '700',\n fontSize: 14,\n lineHeight: 24\n },\n qrCodeIcon: {\n fill: '#fff',\n height: 14,\n width: 14\n },\n ctaReceiveMail: {\n backgroundColor: '#eaeaeb'\n },\n ctaReceiveMailText: {\n marginLeft: 8,\n color: '#1D1D2B',\n fontWeight: '700',\n fontSize: 14,\n lineHeight: 24\n },\n mailIcon: {\n fill: '#1D1D2B',\n height: 12,\n width: 16\n },\n help: {\n flexDirection: 'row',\n justifyContent: 'center'\n },\n titleHelp: {\n color: '#9999A8'\n },\n ctaHelp: {\n marginLeft: 5,\n textDecorationLine: 'underline',\n color: '#9999A8'\n }\n });\n\nexport type Props = {\n onDemoPress: () => void;\n onDesktopButtonPress: () => void;\n onHelpPress: () => void;\n onMobileButtonPress: () => void;\n locales: {\n title: string;\n description: string;\n ctaQRCode: string;\n ctaReceiveMail: string;\n titleHelp: string;\n ctaHelp: string;\n };\n};\n\nconst Welcome = (props: Props) => {\n const {locales, onDemoPress, onDesktopButtonPress, onHelpPress, onMobileButtonPress} = props;\n const {theme} = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme);\n setStylesheet(_stylesheet);\n }, [theme]);\n\n if (!styleSheet) {\n return null;\n }\n\n return (\n <View style={styleSheet.wrapper} testID=\"welcome\">\n <LinearGradient\n colors={['#0061FF', '#fff']}\n locations={[0, 0.3]}\n style={styleSheet.gradient}\n />\n <LinearGradient\n colors={['#2199AB', '#fff']}\n locations={[0, 0.3]}\n style={styleSheet.gradient2}\n />\n <Touchable onLongPress={onDemoPress} style={styleSheet.logo}>\n <LogoCoorp fill={theme.colors.cta} width={77} height={75} />\n </Touchable>\n <View style={styleSheet.content}>\n <Text style={styleSheet.title}>{locales.title}</Text>\n <Text style={styleSheet.description}>{locales.description}</Text>\n\n <View style={styleSheet.actions}>\n <View style={styleSheet.buttons}>\n <Touchable\n style={[styleSheet.button, styleSheet.ctaQRCode]}\n onPress={onDesktopButtonPress}\n >\n <QrCodeIcon style={styleSheet.qrCodeIcon} />\n <Text style={styleSheet.ctaQRCodeText}>{locales.ctaQRCode}</Text>\n </Touchable>\n <Touchable\n style={[styleSheet.button, styleSheet.ctaReceiveMail]}\n onPress={onMobileButtonPress}\n >\n <MailIcon style={styleSheet.mailIcon} />\n <Text style={styleSheet.ctaReceiveMailText}>{locales.ctaReceiveMail}</Text>\n </Touchable>\n </View>\n <Touchable onPress={onHelpPress} style={styleSheet.help}>\n <Text style={styleSheet.titleHelp}>{locales.titleHelp}</Text>\n <Text style={styleSheet.ctaHelp}>{locales.ctaHelp}</Text>\n </Touchable>\n </View>\n </View>\n </View>\n );\n};\n\nexport default Welcome;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AAKA;;AACA;;;;;;;;AAyBA,MAAMA,gBAAgB,GAAIC,KAAD,IACvBC,uBAAA,CAAWC,MAAX,CAAkB;EAChBC,OAAO,EAAE;IACPC,GAAG,EAAE,CADE;IAEPC,MAAM,EAAE,CAFD;IAGPC,IAAI,EAAE,CAHC;IAIPC,KAAK,EAAE,CAJA;IAKPC,IAAI,EAAE,CALC;IAMPC,cAAc,EAAE,cANT;IAOPC,UAAU,EAAE,QAPL;IAQPC,iBAAiB,EAAE;EARZ,CADO;EAWhBC,OAAO,EAAE;IACPC,KAAK,EAAE,MADA;IAEPH,UAAU,EAAE;EAFL,CAXO;EAehBI,QAAQ,EAAE;IACRC,QAAQ,EAAE,UADF;IAERX,GAAG,EAAE,CAAC,GAFE;IAGRC,MAAM,EAAE,CAHA;IAIRC,IAAI,EAAE,CAAC,GAJC;IAKRC,KAAK,EAAE,CALC;IAMRS,OAAO,EAAE,CAND;IAORC,SAAS,EAAE,CAAC;MAACC,MAAM,EAAE;IAAT,CAAD;EAPH,CAfM;EAwBhBC,SAAS,EAAE;IACTJ,QAAQ,EAAE,UADD;IAETX,GAAG,EAAE,CAAC,EAFG;IAGTC,MAAM,EAAE,CAHC;IAITC,IAAI,EAAE,CAJG;IAKTC,KAAK,EAAE,CAAC,GALC;IAMTS,OAAO,EAAE,GANA;IAOTC,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,CALF,CARF,CADF,eAiBE,6BAAC,cAAD;IAAW,OAAO,EAAEY,WAApB;IAAiC,KAAK,EAAEG,UAAU,CAACZ;EAAnD,gBACE,6BAAC,iBAAD;IAAM,KAAK,EAAEY,UAAU,CAACX;EAAxB,GAAoCK,OAAO,CAACL,SAA5C,CADF,eAEE,6BAAC,iBAAD;IAAM,KAAK,EAAEW,UAAU,CAACV;EAAxB,GAAkCI,OAAO,CAACJ,OAA1C,CAFF,CAjBF,CAJF,CAdF,CADF;AA4CD,CA1DD;;eA4DeE,O"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coorpacademy/components",
3
- "version": "11.13.7-alpha.9+06a232bd0",
3
+ "version": "11.14.1-alpha.2+48fcaab8c6",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -56,7 +56,7 @@
56
56
  "Soualmi Djamel <djamel.soualmi@coorpacademy.com>"
57
57
  ],
58
58
  "dependencies": {
59
- "@coorpacademy/nova-icons": "4.1.6",
59
+ "@coorpacademy/nova-icons": "4.2.0",
60
60
  "@coorpacademy/react-native-animation": "1.0.3",
61
61
  "@jwplayer/jwplayer-react": "^1.1.0",
62
62
  "@types/react": "^17.0.50",
@@ -166,5 +166,5 @@
166
166
  "last 2 versions",
167
167
  "IE 11"
168
168
  ],
169
- "gitHead": "06a232bd0ef92ade0d9c2936b1ec878bfb5c1fbb"
169
+ "gitHead": "48fcaab8c639941f7e8693ef20905550ff72724a"
170
170
  }
@@ -1,27 +0,0 @@
1
- /// <reference types="react" />
2
- import { FormTextInputProps } from './prop-types';
3
- declare const FormTextInput: {
4
- ({ "aria-label": ariaLabel, autocomplete, "data-testid": dataTestid, disabled, hint, inputClassName, isRequired, isValid, label, maxlength, name, onChange, passwordValidator, placeholder, type, value, equals, wrapperClassName }: FormTextInputProps): JSX.Element;
5
- propTypes: {
6
- 'aria-label': import("prop-types").Requireable<string>;
7
- autocomplete: import("prop-types").Requireable<string>;
8
- 'data-testid': import("prop-types").Requireable<string>;
9
- disabled: import("prop-types").Requireable<boolean>;
10
- equals: import("prop-types").Requireable<NonNullable<string | number | null | undefined>>;
11
- hint: import("prop-types").Requireable<string>;
12
- inputClassName: import("prop-types").Requireable<string>;
13
- isRequired: import("prop-types").Requireable<boolean>;
14
- isValid: import("prop-types").Requireable<boolean>;
15
- label: import("prop-types").Requireable<string>;
16
- maxlength: import("prop-types").Requireable<number>;
17
- name: import("prop-types").Requireable<string>;
18
- onChange: import("prop-types").Requireable<(...args: any[]) => any>;
19
- passwordValidator: import("prop-types").Requireable<(...args: any[]) => any>;
20
- placeholder: import("prop-types").Requireable<string>;
21
- type: import("prop-types").Requireable<string>;
22
- value: import("prop-types").Requireable<NonNullable<string | number | null | undefined>>;
23
- wrapperClassName: import("prop-types").Requireable<string>;
24
- };
25
- };
26
- export default FormTextInput;
27
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/form-text-input/index.tsx"],"names":[],"mappings":";AAKA,OAAkB,EAAa,kBAAkB,EAAY,MAAM,cAAc,CAAC;AAkBlF,QAAA,MAAM,aAAa;yOAmBhB,kBAAkB;;;;;;;;;;;;;;;;;;;;;CA4DpB,CAAC;AAIF,eAAe,aAAa,CAAC"}
@@ -1,96 +0,0 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
- import React, { useCallback, useMemo } from 'react';
4
- import classnames from 'classnames';
5
- import isEmpty from 'lodash/fp/isEmpty';
6
- import isEqual from 'lodash/fp/isEqual';
7
- import noop from 'lodash/fp/noop';
8
- import propTypes, { TextInput } from './prop-types';
9
- import style from './style.css';
10
-
11
- const validate = (fieldValue, fieldEqualsValue) => {
12
- return isEqual(fieldValue, fieldEqualsValue);
13
- };
14
-
15
- const VALID_EMAIL_PATTERN = /[a-z0-9!#$%&'*+=?^_`{|}~-]+(?:.[a-z0-9!#$%&'*+=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/;
16
-
17
- const validatePattern = (fieldValue, pattern) => {
18
- return pattern.test(fieldValue);
19
- };
20
-
21
- const DEFAULT_MAX_LENGTH = 150;
22
-
23
- const isEqualsDefined = equals => !isEmpty(equals);
24
-
25
- const FormTextInput = ({
26
- 'aria-label': ariaLabel,
27
- autocomplete,
28
- 'data-testid': dataTestid = 'form-text-input',
29
- disabled,
30
- hint,
31
- inputClassName,
32
- isRequired,
33
- isValid,
34
- label,
35
- maxlength = DEFAULT_MAX_LENGTH,
36
- name,
37
- onChange = noop,
38
- passwordValidator = () => false,
39
- placeholder,
40
- type = 'default',
41
- value,
42
- equals,
43
- wrapperClassName
44
- }) => {
45
- const isDefaultType = useMemo(() => !type || type === TextInput.default, [type]);
46
- const isPasswordInput = useMemo(() => type === TextInput.password || type === TextInput.passwordConfirmation, [type]);
47
- const isEmailInput = useMemo(() => type === TextInput.email, [type]);
48
- const handleInputChange = useCallback(event => {
49
- const newInput = event.target.value;
50
- const isNewValueValid = !isEqualsDefined(equals) || validate(newInput, equals);
51
- const validPattern = !isEmailInput || validatePattern(newInput, VALID_EMAIL_PATTERN);
52
- const isPasswordCompliant = !isPasswordInput || passwordValidator(newInput);
53
- const checkResult = isPasswordCompliant && isNewValueValid && validPattern;
54
- onChange(newInput, checkResult);
55
- }, [equals, isEmailInput, isPasswordInput, onChange, passwordValidator]);
56
- const fieldLabel = useMemo(() => `${label} ${isRequired ? '*' : ''}`, [isRequired, label]);
57
- const errorStyle = useMemo(() => isValid ? undefined : {
58
- border: '2px solid rgb(247, 63, 82)'
59
- }, [isValid]);
60
- return /*#__PURE__*/React.createElement("div", {
61
- className: classnames(style.wrapper, wrapperClassName)
62
- }, /*#__PURE__*/React.createElement("label", {
63
- className: style.formLabel,
64
- htmlFor: name
65
- }, fieldLabel), /*#__PURE__*/React.createElement("input", _extends({}, !isPasswordInput && !isEmailInput && {
66
- maxLength: maxlength
67
- }, isEmailInput && {
68
- autoCapitalize: 'none'
69
- }, isRequired && {
70
- required: true
71
- }, !isValid && {
72
- 'aria-invalid': true
73
- }, {
74
- type: isDefaultType ? 'text' : type,
75
- "aria-label": ariaLabel,
76
- autoComplete: isDefaultType ? 'on' : autocomplete,
77
- autoCorrect: 'off',
78
- className: classnames(style.textInput, inputClassName),
79
- "data-testid": dataTestid,
80
- disabled: disabled,
81
- id: name,
82
- name: name,
83
- onInput: handleInputChange,
84
- placeholder: placeholder,
85
- value: value,
86
- style: errorStyle
87
- })), /*#__PURE__*/React.createElement("div", {
88
- className: style.hintWrapper
89
- }, /*#__PURE__*/React.createElement("span", {
90
- className: style.hint
91
- }, hint)));
92
- };
93
-
94
- FormTextInput.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
95
- export default FormTextInput;
96
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["React","useCallback","useMemo","classnames","isEmpty","isEqual","noop","propTypes","TextInput","style","validate","fieldValue","fieldEqualsValue","VALID_EMAIL_PATTERN","validatePattern","pattern","test","DEFAULT_MAX_LENGTH","isEqualsDefined","equals","FormTextInput","ariaLabel","autocomplete","dataTestid","disabled","hint","inputClassName","isRequired","isValid","label","maxlength","name","onChange","passwordValidator","placeholder","type","value","wrapperClassName","isDefaultType","default","isPasswordInput","password","passwordConfirmation","isEmailInput","email","handleInputChange","event","newInput","target","isNewValueValid","validPattern","isPasswordCompliant","checkResult","fieldLabel","errorStyle","undefined","border","wrapper","formLabel","maxLength","autoCapitalize","required","textInput","hintWrapper"],"sources":["../../../src/atom/form-text-input/index.tsx"],"sourcesContent":["import React, {useCallback, useMemo, FormEvent} from 'react';\nimport classnames from 'classnames';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport isEqual from 'lodash/fp/isEqual';\nimport noop from 'lodash/fp/noop';\nimport propTypes, {FieldValue, FormTextInputProps, TextInput} from './prop-types';\nimport style from './style.css';\n\nconst validate = (fieldValue: FieldValue, fieldEqualsValue: FieldValue) => {\n return isEqual(fieldValue, fieldEqualsValue);\n};\n\nconst VALID_EMAIL_PATTERN =\n /[a-z0-9!#$%&'*+=?^_`{|}~-]+(?:.[a-z0-9!#$%&'*+=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/;\n\nconst validatePattern = (fieldValue: string, pattern: RegExp) => {\n return pattern.test(fieldValue);\n};\n\nconst DEFAULT_MAX_LENGTH = 150;\n\nconst isEqualsDefined = (equals: FieldValue | undefined): equals is FieldValue => !isEmpty(equals);\n\nconst FormTextInput = ({\n 'aria-label': ariaLabel,\n autocomplete,\n 'data-testid': dataTestid = 'form-text-input',\n disabled,\n hint,\n inputClassName,\n isRequired,\n isValid,\n label,\n maxlength = DEFAULT_MAX_LENGTH,\n name,\n onChange = noop,\n passwordValidator = () => false,\n placeholder,\n type = 'default',\n value,\n equals,\n wrapperClassName\n}: FormTextInputProps) => {\n const isDefaultType = useMemo(() => !type || type === TextInput.default, [type]);\n\n const isPasswordInput = useMemo(\n () => type === TextInput.password || type === TextInput.passwordConfirmation,\n [type]\n );\n\n const isEmailInput = useMemo(() => type === TextInput.email, [type]);\n\n const handleInputChange = useCallback(\n (event: FormEvent<HTMLInputElement>) => {\n const newInput: FieldValue = (event.target as HTMLInputElement).value;\n const isNewValueValid = !isEqualsDefined(equals) || validate(newInput, equals);\n const validPattern = !isEmailInput || validatePattern(newInput, VALID_EMAIL_PATTERN);\n const isPasswordCompliant = !isPasswordInput || passwordValidator(newInput);\n\n const checkResult = isPasswordCompliant && isNewValueValid && validPattern;\n\n onChange(newInput, checkResult);\n },\n [equals, isEmailInput, isPasswordInput, onChange, passwordValidator]\n );\n\n const fieldLabel = useMemo(() => `${label} ${isRequired ? '*' : ''}`, [isRequired, label]);\n\n const errorStyle = useMemo(\n () => (isValid ? undefined : {border: '2px solid rgb(247, 63, 82)'}),\n [isValid]\n );\n\n return (\n <div className={classnames(style.wrapper, wrapperClassName)}>\n <label className={style.formLabel} htmlFor={name}>\n {fieldLabel}\n </label>\n <input\n {...(!isPasswordInput && !isEmailInput && {maxLength: maxlength})}\n {...(isEmailInput && {autoCapitalize: 'none'})}\n {...(isRequired && {required: true})}\n {...(!isValid && {'aria-invalid': true})}\n type={isDefaultType ? 'text' : type}\n aria-label={ariaLabel}\n autoComplete={isDefaultType ? 'on' : autocomplete}\n autoCorrect={'off'}\n className={classnames(style.textInput, inputClassName)}\n data-testid={dataTestid}\n disabled={disabled}\n id={name}\n name={name}\n onInput={handleInputChange}\n placeholder={placeholder}\n value={value}\n style={errorStyle}\n />\n <div className={style.hintWrapper}>\n <span className={style.hint}>{hint}</span>\n </div>\n </div>\n );\n};\n\nFormTextInput.propTypes = propTypes;\n\nexport default FormTextInput;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,OAA5B,QAAqD,OAArD;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,OAAP,MAAoB,mBAApB;AACA,OAAOC,OAAP,MAAoB,mBAApB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,SAAP,IAAmDC,SAAnD,QAAmE,cAAnE;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,QAAQ,GAAG,CAACC,UAAD,EAAyBC,gBAAzB,KAA0D;EACzE,OAAOP,OAAO,CAACM,UAAD,EAAaC,gBAAb,CAAd;AACD,CAFD;;AAIA,MAAMC,mBAAmB,GACvB,mIADF;;AAGA,MAAMC,eAAe,GAAG,CAACH,UAAD,EAAqBI,OAArB,KAAyC;EAC/D,OAAOA,OAAO,CAACC,IAAR,CAAaL,UAAb,CAAP;AACD,CAFD;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pC,cAAlB,CATvB;IAUE,eAAaH,UAVf;IAWE,QAAQ,EAAEC,QAXZ;IAYE,EAAE,EAAEO,IAZN;IAaE,IAAI,EAAEA,IAbR;IAcE,OAAO,EAAEc,iBAdX;IAeE,WAAW,EAAEX,WAff;IAgBE,KAAK,EAAEE,KAhBT;IAiBE,KAAK,EAAEkB;EAjBT,GAJF,eAuBE;IAAK,SAAS,EAAE7C,KAAK,CAACsD;EAAtB,gBACE;IAAM,SAAS,EAAEtD,KAAK,CAACgB;EAAvB,GAA8BA,IAA9B,CADF,CAvBF,CADF;AA6BD,CA/ED;;AAiFAL,aAAa,CAACb,SAAd,2CAA0BA,SAA1B;AAEA,eAAea,aAAf"}
@@ -1,56 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- export declare const TextInput: {
3
- readonly country: "country";
4
- readonly email: "email";
5
- readonly firstName: "firstName";
6
- readonly lastName: "lastName";
7
- readonly language: "language";
8
- readonly login: "login";
9
- readonly password: "password";
10
- readonly passwordConfirmation: "passwordConfirmation";
11
- readonly default: "default";
12
- };
13
- declare const propTypes: {
14
- 'aria-label': PropTypes.Requireable<string>;
15
- autocomplete: PropTypes.Requireable<string>;
16
- 'data-testid': PropTypes.Requireable<string>;
17
- disabled: PropTypes.Requireable<boolean>;
18
- equals: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
19
- hint: PropTypes.Requireable<string>;
20
- inputClassName: PropTypes.Requireable<string>;
21
- isRequired: PropTypes.Requireable<boolean>;
22
- isValid: PropTypes.Requireable<boolean>;
23
- label: PropTypes.Requireable<string>;
24
- maxlength: PropTypes.Requireable<number>;
25
- name: PropTypes.Requireable<string>;
26
- onChange: PropTypes.Requireable<(...args: any[]) => any>;
27
- passwordValidator: PropTypes.Requireable<(...args: any[]) => any>;
28
- placeholder: PropTypes.Requireable<string>;
29
- type: PropTypes.Requireable<string>;
30
- value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
31
- wrapperClassName: PropTypes.Requireable<string>;
32
- };
33
- declare type TextInputType = keyof typeof TextInput;
34
- export declare type FieldValue = string | number;
35
- export declare type FormTextInputProps = {
36
- 'aria-label'?: string;
37
- autocomplete?: string;
38
- 'data-testid'?: string;
39
- disabled?: boolean;
40
- equals?: FieldValue;
41
- hint?: string;
42
- inputClassName?: string | null;
43
- isRequired?: boolean;
44
- isValid?: boolean;
45
- label: string;
46
- maxlength?: number;
47
- name: string;
48
- onChange?: (value: FieldValue, isValid?: boolean) => void;
49
- passwordValidator?: (password: string) => boolean;
50
- placeholder?: string;
51
- type?: TextInputType;
52
- value: FieldValue;
53
- wrapperClassName?: string | null;
54
- };
55
- export default propTypes;
56
- //# sourceMappingURL=prop-types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../../src/atom/form-text-input/prop-types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAGnC,eAAO,MAAM,SAAS;;;;;;;;;;CAUZ,CAAC;AAEX,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;CAmBd,CAAC;AAEF,aAAK,aAAa,GAAG,MAAM,OAAO,SAAS,CAAC;AAE5C,oBAAY,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;AAEzC,oBAAY,kBAAkB,GAAG;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1D,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,KAAK,EAAE,UAAU,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -1,35 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import keys from 'lodash/fp/keys';
3
- export const TextInput = {
4
- country: 'country',
5
- email: 'email',
6
- firstName: 'firstName',
7
- lastName: 'lastName',
8
- language: 'language',
9
- login: 'login',
10
- password: 'password',
11
- passwordConfirmation: 'passwordConfirmation',
12
- default: 'default'
13
- };
14
- const propTypes = {
15
- 'aria-label': PropTypes.string,
16
- autocomplete: PropTypes.string,
17
- 'data-testid': PropTypes.string,
18
- disabled: PropTypes.bool,
19
- equals: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
20
- hint: PropTypes.string,
21
- inputClassName: PropTypes.string,
22
- isRequired: PropTypes.bool,
23
- isValid: PropTypes.bool,
24
- label: PropTypes.string,
25
- maxlength: PropTypes.number,
26
- name: PropTypes.string,
27
- onChange: PropTypes.func,
28
- passwordValidator: PropTypes.func,
29
- placeholder: PropTypes.string,
30
- type: PropTypes.oneOf(keys(TextInput)),
31
- value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
32
- wrapperClassName: PropTypes.string
33
- };
34
- export default propTypes;
35
- //# sourceMappingURL=prop-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prop-types.js","names":["PropTypes","keys","TextInput","country","email","firstName","lastName","language","login","password","passwordConfirmation","default","propTypes","string","autocomplete","disabled","bool","equals","oneOfType","number","hint","inputClassName","isRequired","isValid","label","maxlength","name","onChange","func","passwordValidator","placeholder","type","oneOf","value","wrapperClassName"],"sources":["../../../src/atom/form-text-input/prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport keys from 'lodash/fp/keys';\n\nexport const TextInput = {\n country: 'country',\n email: 'email',\n firstName: 'firstName',\n lastName: 'lastName',\n language: 'language',\n login: 'login',\n password: 'password',\n passwordConfirmation: 'passwordConfirmation',\n default: 'default'\n} as const;\n\nconst propTypes = {\n 'aria-label': PropTypes.string,\n autocomplete: PropTypes.string,\n 'data-testid': PropTypes.string,\n disabled: PropTypes.bool,\n equals: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n hint: PropTypes.string,\n inputClassName: PropTypes.string,\n isRequired: PropTypes.bool,\n isValid: PropTypes.bool,\n label: PropTypes.string,\n maxlength: PropTypes.number,\n name: PropTypes.string,\n onChange: PropTypes.func,\n passwordValidator: PropTypes.func,\n placeholder: PropTypes.string,\n type: PropTypes.oneOf(keys(TextInput)),\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n wrapperClassName: PropTypes.string\n};\n\ntype TextInputType = keyof typeof TextInput;\n\nexport type FieldValue = string | number;\n\nexport type FormTextInputProps = {\n 'aria-label'?: string;\n autocomplete?: string;\n 'data-testid'?: string;\n disabled?: boolean;\n equals?: FieldValue;\n hint?: string;\n inputClassName?: string | null;\n isRequired?: boolean;\n isValid?: boolean;\n label: string;\n maxlength?: number;\n name: string;\n onChange?: (value: FieldValue, isValid?: boolean) => void;\n passwordValidator?: (password: string) => boolean;\n placeholder?: string;\n type?: TextInputType;\n value: FieldValue;\n wrapperClassName?: string | null;\n};\n\nexport default propTypes;\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AAEA,OAAO,MAAMC,SAAS,GAAG;EACvBC,OAAO,EAAE,SADc;EAEvBC,KAAK,EAAE,OAFgB;EAGvBC,SAAS,EAAE,WAHY;EAIvBC,QAAQ,EAAE,UAJ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