@coorpacademy/components 10.22.4 → 10.22.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.
Files changed (63) hide show
  1. package/es/atom/html/index.native.js +9 -16
  2. package/es/atom/html/index.native.js.map +1 -1
  3. package/es/atom/input-switch/index.js +43 -6
  4. package/es/atom/input-switch/index.js.map +1 -1
  5. package/es/atom/input-switch/style.css +56 -6
  6. package/es/atom/select-modal/index.native.js +6 -6
  7. package/es/atom/select-modal/index.native.js.map +1 -1
  8. package/es/atom/text/index.native.js +3 -1
  9. package/es/atom/text/index.native.js.map +1 -1
  10. package/es/hoc/modal/select/index.native.js +4 -3
  11. package/es/hoc/modal/select/index.native.js.map +1 -1
  12. package/es/molecule/answer/index.js +39 -32
  13. package/es/molecule/answer/index.js.map +1 -1
  14. package/es/molecule/cm-popin/index.js +101 -14
  15. package/es/molecule/cm-popin/index.js.map +1 -1
  16. package/es/molecule/cm-popin/style.css +153 -9
  17. package/es/molecule/questions/free-text/index.native.js +8 -8
  18. package/es/molecule/questions/free-text/index.native.js.map +1 -1
  19. package/es/molecule/questions/mobile/template/index.native.js +222 -0
  20. package/es/molecule/questions/mobile/template/index.native.js.map +1 -0
  21. package/es/template/app-review/template-context.js +1 -0
  22. package/es/template/app-review/template-context.js.map +1 -1
  23. package/es/template/common/dashboard/index.js +6 -3
  24. package/es/template/common/dashboard/index.js.map +1 -1
  25. package/es/types/app-review.d.js +2 -0
  26. package/es/types/app-review.d.js.map +1 -0
  27. package/es/types/translations.js +2 -0
  28. package/es/types/translations.js.map +1 -0
  29. package/es/util/parse-template-string.js +4 -2
  30. package/es/util/parse-template-string.js.map +1 -1
  31. package/es/variables/colors.css +1 -0
  32. package/lib/atom/html/index.native.js +8 -15
  33. package/lib/atom/html/index.native.js.map +1 -1
  34. package/lib/atom/input-switch/index.js +43 -6
  35. package/lib/atom/input-switch/index.js.map +1 -1
  36. package/lib/atom/input-switch/style.css +56 -6
  37. package/lib/atom/select-modal/index.native.js +5 -5
  38. package/lib/atom/select-modal/index.native.js.map +1 -1
  39. package/lib/atom/text/index.native.js +3 -1
  40. package/lib/atom/text/index.native.js.map +1 -1
  41. package/lib/hoc/modal/select/index.native.js +7 -5
  42. package/lib/hoc/modal/select/index.native.js.map +1 -1
  43. package/lib/molecule/answer/index.js +39 -32
  44. package/lib/molecule/answer/index.js.map +1 -1
  45. package/lib/molecule/cm-popin/index.js +102 -13
  46. package/lib/molecule/cm-popin/index.js.map +1 -1
  47. package/lib/molecule/cm-popin/style.css +153 -9
  48. package/lib/molecule/questions/free-text/index.native.js +7 -7
  49. package/lib/molecule/questions/free-text/index.native.js.map +1 -1
  50. package/lib/molecule/questions/mobile/template/index.native.js +243 -0
  51. package/lib/molecule/questions/mobile/template/index.native.js.map +1 -0
  52. package/lib/template/app-review/template-context.js +1 -0
  53. package/lib/template/app-review/template-context.js.map +1 -1
  54. package/lib/template/common/dashboard/index.js +7 -3
  55. package/lib/template/common/dashboard/index.js.map +1 -1
  56. package/lib/types/app-review.d.js +2 -0
  57. package/lib/types/app-review.d.js.map +1 -0
  58. package/lib/types/translations.js +2 -0
  59. package/lib/types/translations.js.map +1 -0
  60. package/lib/util/parse-template-string.js +4 -2
  61. package/lib/util/parse-template-string.js.map +1 -1
  62. package/lib/variables/colors.css +1 -0
  63. package/package.json +2 -2
@@ -1,8 +1,10 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond, NovaSolidApplicationsWindowUpload3 as WindowUpload } from '@coorpacademy/nova-icons';
3
+ import { NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond, NovaSolidApplicationsWindowUpload3 as WindowUpload, NovaLineSettingsCookie as Cookie } from '@coorpacademy/nova-icons';
4
+ import map from 'lodash/fp/map';
4
5
  import Cta from '../../atom/button-link';
5
6
  import ButtonLinkIconOnly from '../../atom/button-link-icon-only';
7
+ import InputSwitch from '../../atom/input-switch';
6
8
  import style from './style.css';
7
9
 
8
10
  const CMPopin = props => {
@@ -15,7 +17,11 @@ const CMPopin = props => {
15
17
  header,
16
18
  icon,
17
19
  backgroundImageUrl,
18
- descriptionText
20
+ descriptionText,
21
+ thirdButton,
22
+ cookieTitle,
23
+ descriptionBtnTxt,
24
+ listBtnSwicth
19
25
  } = props;
20
26
  const logo = {
21
27
  AlertDiamond,
@@ -26,18 +32,78 @@ const CMPopin = props => {
26
32
  backgroundImage: `url(${backgroundImageUrl})`,
27
33
  backgroundSize: 'cover'
28
34
  } : null;
35
+
36
+ const renderHeader = () => {
37
+ if (header) return /*#__PURE__*/React.createElement("img", {
38
+ className: style.headerBackground,
39
+ src: header
40
+ });
41
+ if (mode === 'cookie') return /*#__PURE__*/React.createElement("div", {
42
+ className: style.cookieHeader
43
+ }, /*#__PURE__*/React.createElement("div", {
44
+ className: style.cookieIconContainer
45
+ }, /*#__PURE__*/React.createElement(Cookie, {
46
+ className: style.cookieIcon
47
+ })), /*#__PURE__*/React.createElement("div", {
48
+ className: style.cookieTitle
49
+ }, cookieTitle));
50
+ return null;
51
+ };
52
+
53
+ const getClassBtnSwitch = (index, btnList) => {
54
+ switch (index) {
55
+ case 0:
56
+ return style.firstBtnSwitchContainer;
57
+
58
+ case btnList.length - 1:
59
+ return style.lastBtnSwitchContainer;
60
+
61
+ default:
62
+ return style.singleSwitchContainer;
63
+ }
64
+ };
65
+
66
+ const renderBtnSwitch = () => {
67
+ return map.convert({
68
+ cap: false
69
+ })((el, index) => {
70
+ const {
71
+ type,
72
+ title,
73
+ value,
74
+ onChange,
75
+ titlePosition,
76
+ theme,
77
+ details,
78
+ requiredSelection,
79
+ disabled
80
+ } = el;
81
+ return /*#__PURE__*/React.createElement("div", {
82
+ key: index,
83
+ className: getClassBtnSwitch(index, listBtnSwicth)
84
+ }, /*#__PURE__*/React.createElement(InputSwitch, {
85
+ type,
86
+ title,
87
+ value,
88
+ onChange,
89
+ titlePosition,
90
+ theme,
91
+ details,
92
+ requiredSelection,
93
+ disabled
94
+ }));
95
+ })(listBtnSwicth);
96
+ };
97
+
29
98
  return /*#__PURE__*/React.createElement("div", {
30
- className: style.background,
99
+ className: mode !== 'cookie' ? style.background : null,
31
100
  style: backgroundImageStyle,
32
101
  "data-name": 'cm-popin-container'
33
102
  }, /*#__PURE__*/React.createElement("div", {
34
- className: style.popin
103
+ className: mode === 'cookie' ? style.popinCookie : style.popin
35
104
  }, /*#__PURE__*/React.createElement("header", {
36
105
  className: style.popinHeader
37
- }, header ? /*#__PURE__*/React.createElement("img", {
38
- className: style.headerBackground,
39
- src: header
40
- }) : null, onClose ? /*#__PURE__*/React.createElement(ButtonLinkIconOnly, {
106
+ }, renderHeader(), onClose ? /*#__PURE__*/React.createElement(ButtonLinkIconOnly, {
41
107
  onClick: onClose,
42
108
  "data-name": 'close-icon',
43
109
  "aria-label": 'close-icon',
@@ -62,10 +128,12 @@ const CMPopin = props => {
62
128
  dangerouslySetInnerHTML: {
63
129
  __html: descriptionText
64
130
  }
65
- }) : null), /*#__PURE__*/React.createElement("div", {
131
+ }) : null), descriptionBtnTxt ? /*#__PURE__*/React.createElement("div", {
132
+ className: style.descriptionBtn
133
+ }, descriptionBtnTxt) : null, renderBtnSwitch(), /*#__PURE__*/React.createElement("div", {
66
134
  className: style.buttonContainer
67
135
  }, firstButton ? /*#__PURE__*/React.createElement("div", {
68
- className: style.button
136
+ className: firstButton.largeButton ? style.largeButton : style.button
69
137
  }, /*#__PURE__*/React.createElement(Cta, {
70
138
  label: firstButton.label,
71
139
  onClick: firstButton.handleOnclick,
@@ -80,30 +148,49 @@ const CMPopin = props => {
80
148
  "data-name": `cm-popin-cta-${secondButton.type}`,
81
149
  "aria-label": secondButton['aria-label'],
82
150
  type: secondButton.type
151
+ })) : null, thirdButton ? /*#__PURE__*/React.createElement("div", {
152
+ className: thirdButton.largeButton ? style.largeButton : style.button
153
+ }, /*#__PURE__*/React.createElement(Cta, {
154
+ label: thirdButton.label,
155
+ onClick: thirdButton.handleOnclick,
156
+ "data-name": `cm-popin-cta-${thirdButton.type}`,
157
+ "aria-label": thirdButton['aria-label'],
158
+ type: thirdButton.type
83
159
  })) : null)));
84
160
  };
85
161
 
86
162
  CMPopin.propTypes = process.env.NODE_ENV !== "production" ? {
87
163
  content: PropTypes.string,
88
- mode: PropTypes.oneOf(['alert', 'information']),
164
+ mode: PropTypes.oneOf(['alert', 'information', 'cookie']),
89
165
  header: PropTypes.string,
90
166
  firstButton: PropTypes.shape({
91
167
  label: PropTypes.string,
92
168
  handleOnclick: PropTypes.func,
93
169
  'aria-label': PropTypes.string,
94
- type: PropTypes.string
170
+ largeButton: PropTypes.bool,
171
+ type: PropTypes.oneOf(['dangerous', 'primary', 'secondary'])
95
172
  }),
96
173
  secondButton: PropTypes.shape({
97
174
  label: PropTypes.string,
98
175
  handleOnclick: PropTypes.func,
99
- type: PropTypes.oneOf(['dangerous', 'primary']),
176
+ type: PropTypes.oneOf(['dangerous', 'primary', 'secondary']),
177
+ 'aria-label': PropTypes.string,
178
+ largeButton: PropTypes.boolean
179
+ }),
180
+ thirdButton: PropTypes.shape({
181
+ label: PropTypes.string,
182
+ handleOnclick: PropTypes.func,
183
+ type: PropTypes.oneOf(['dangerous', 'primary', 'secondary']),
100
184
  'aria-label': PropTypes.string,
101
185
  largeButton: PropTypes.boolean
102
186
  }),
103
187
  onClose: PropTypes.func,
104
188
  icon: PropTypes.string,
105
189
  backgroundImageUrl: PropTypes.string,
106
- descriptionText: PropTypes.string
190
+ descriptionText: PropTypes.string,
191
+ cookieTitle: PropTypes.string,
192
+ descriptionBtnTxt: PropTypes.string,
193
+ listBtnSwicth: PropTypes.arrayOf(PropTypes.shape(InputSwitch.propTypes))
107
194
  } : {};
108
195
  export default CMPopin;
109
196
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/molecule/cm-popin/index.js"],"names":["React","PropTypes","NovaSolidInterfaceFeedbackInterfaceAlertDiamond","AlertDiamond","NovaSolidApplicationsWindowUpload3","WindowUpload","Cta","ButtonLinkIconOnly","style","CMPopin","props","content","mode","firstButton","secondButton","onClose","header","icon","backgroundImageUrl","descriptionText","logo","LogoComponent","backgroundImageStyle","backgroundImage","backgroundSize","background","popin","popinHeader","headerBackground","titleContainer","contentSection","message","__html","buttonContainer","button","label","handleOnclick","type","largeButton","propTypes","string","oneOf","shape","func","boolean"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SACEC,+CAA+C,IAAIC,YADrD,EAEEC,kCAAkC,IAAIC,YAFxC,QAGO,0BAHP;AAIA,OAAOC,GAAP,MAAgB,wBAAhB;AACA,OAAOC,kBAAP,MAA+B,kCAA/B;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,OAAO,GAAGC,KAAK,IAAI;AACvB,QAAM;AACJC,IAAAA,OADI;AAEJC,IAAAA,IAAI,GAAG,OAFH;AAGJC,IAAAA,WAHI;AAIJC,IAAAA,YAJI;AAKJC,IAAAA,OALI;AAMJC,IAAAA,MANI;AAOJC,IAAAA,IAPI;AAQJC,IAAAA,kBARI;AASJC,IAAAA;AATI,MAUFT,KAVJ;AAYA,QAAMU,IAAI,GAAG;AACXjB,IAAAA,YADW;AAEXE,IAAAA;AAFW,GAAb;AAIA,QAAMgB,aAAa,GAAGD,IAAI,CAACH,IAAD,CAA1B;AAEA,QAAMK,oBAAoB,GAAGJ,kBAAkB,GAC3C;AACEK,IAAAA,eAAe,EAAG,OAAML,kBAAmB,GAD7C;AAEEM,IAAAA,cAAc,EAAE;AAFlB,GAD2C,GAK3C,IALJ;AAOA,sBACE;AAAK,IAAA,SAAS,EAAEhB,KAAK,CAACiB,UAAtB;AAAkC,IAAA,KAAK,EAAEH,oBAAzC;AAA+D,iBAAW;AAA1E,kBACE;AAAK,IAAA,SAAS,EAAEd,KAAK,CAACkB;AAAtB,kBACE;AAAQ,IAAA,SAAS,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C,SAAS,CAACuC,MAJI;AAK5BF,IAAAA,WAAW,EAAErC,SAAS,CAAC2C;AALK,GAAhB,CAVI;AAiBlB7B,EAAAA,OAAO,EAAEd,SAAS,CAAC0C,IAjBD;AAkBlB1B,EAAAA,IAAI,EAAEhB,SAAS,CAACuC,MAlBE;AAmBlBtB,EAAAA,kBAAkB,EAAEjB,SAAS,CAACuC,MAnBZ;AAoBlBrB,EAAAA,eAAe,EAAElB,SAAS,CAACuC;AApBT,CAApB;AAuBA,eAAe/B,OAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {\n NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond,\n NovaSolidApplicationsWindowUpload3 as WindowUpload\n} from '@coorpacademy/nova-icons';\nimport Cta from '../../atom/button-link';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport style from './style.css';\n\nconst CMPopin = props => {\n const {\n content,\n mode = 'alert',\n firstButton,\n secondButton,\n onClose,\n header,\n icon,\n backgroundImageUrl,\n descriptionText\n } = props;\n\n const logo = {\n AlertDiamond,\n WindowUpload\n };\n const LogoComponent = logo[icon];\n\n const backgroundImageStyle = backgroundImageUrl\n ? {\n backgroundImage: `url(${backgroundImageUrl})`,\n backgroundSize: 'cover'\n }\n : null;\n\n return (\n <div className={style.background} style={backgroundImageStyle} data-name={'cm-popin-container'}>\n <div className={style.popin}>\n <header className={style.popinHeader}>\n {header ? <img className={style.headerBackground} src={header} /> : null}\n {onClose ? (\n <ButtonLinkIconOnly\n onClick={onClose}\n data-name={'close-icon'}\n aria-label={'close-icon'}\n size=\"small\"\n icon=\"close\"\n />\n ) : null}\n </header>\n <div className={style.titleContainer}>\n <div className={style.contentSection}>\n {LogoComponent ? <LogoComponent className={style.icon} /> : null}\n {content ? (\n <p\n className={mode === 'alert' ? style.content : style.message}\n data-name={'cm-popin-content'}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: content}}\n />\n ) : null}\n </div>\n {descriptionText ? (\n <p\n className={style.descriptionText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: descriptionText}}\n />\n ) : null}\n </div>\n <div className={style.buttonContainer}>\n {firstButton ? (\n <div className={style.button}>\n <Cta\n label={firstButton.label}\n onClick={firstButton.handleOnclick}\n data-name={'cm-popin-cta'}\n aria-label={firstButton['aria-label']}\n type={firstButton.type}\n />\n </div>\n ) : null}\n {secondButton ? (\n <div className={secondButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={secondButton.label}\n onClick={secondButton.handleOnclick}\n data-name={`cm-popin-cta-${secondButton.type}`}\n aria-label={secondButton['aria-label']}\n type={secondButton.type}\n />\n </div>\n ) : null}\n </div>\n </div>\n </div>\n );\n};\n\nCMPopin.propTypes = {\n content: PropTypes.string,\n mode: PropTypes.oneOf(['alert', 'information']),\n header: PropTypes.string,\n firstButton: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n 'aria-label': PropTypes.string,\n type: PropTypes.string\n }),\n secondButton: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n type: PropTypes.oneOf(['dangerous', 'primary']),\n 'aria-label': PropTypes.string,\n largeButton: PropTypes.boolean\n }),\n onClose: PropTypes.func,\n icon: PropTypes.string,\n backgroundImageUrl: PropTypes.string,\n descriptionText: PropTypes.string\n};\n\nexport default CMPopin;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../src/molecule/cm-popin/index.js"],"names":["React","PropTypes","NovaSolidInterfaceFeedbackInterfaceAlertDiamond","AlertDiamond","NovaSolidApplicationsWindowUpload3","WindowUpload","NovaLineSettingsCookie","Cookie","map","Cta","ButtonLinkIconOnly","InputSwitch","style","CMPopin","props","content","mode","firstButton","secondButton","onClose","header","icon","backgroundImageUrl","descriptionText","thirdButton","cookieTitle","descriptionBtnTxt","listBtnSwicth","logo","LogoComponent","backgroundImageStyle","backgroundImage","backgroundSize","renderHeader","headerBackground","cookieHeader","cookieIconContainer","cookieIcon","getClassBtnSwitch","index","btnList","firstBtnSwitchContainer","length","lastBtnSwitchContainer","singleSwitchContainer","renderBtnSwitch","convert","cap","el","type","title","value","onChange","titlePosition","theme","details","requiredSelection","disabled","background","popinCookie","popin","popinHeader","titleContainer","contentSection","message","__html","descriptionBtn","buttonContainer","largeButton","button","label","handleOnclick","propTypes","string","oneOf","shape","func","bool","boolean","arrayOf"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SACEC,+CAA+C,IAAIC,YADrD,EAEEC,kCAAkC,IAAIC,YAFxC,EAGEC,sBAAsB,IAAIC,MAH5B,QAIO,0BAJP;AAKA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,GAAP,MAAgB,wBAAhB;AACA,OAAOC,kBAAP,MAA+B,kCAA/B;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,OAAO,GAAGC,KAAK,IAAI;AACvB,QAAM;AACJC,IAAAA,OADI;AAEJC,IAAAA,IAAI,GAAG,OAFH;AAGJC,IAAAA,WAHI;AAIJC,IAAAA,YAJI;AAKJC,IAAAA,OALI;AAMJC,IAAAA,MANI;AAOJC,IAAAA,IAPI;AAQJC,IAAAA,kBARI;AASJC,IAAAA,eATI;AAUJC,IAAAA,WAVI;AAWJC,IAAAA,WAXI;AAYJC,IAAAA,iBAZI;AAaJC,IAAAA;AAbI,MAcFb,KAdJ;AAgBA,QAAMc,IAAI,GAAG;AACXzB,IAAAA,YADW;AAEXE,IAAAA;AAFW,GAAb;AAIA,QAAMwB,aAAa,GAAGD,IAAI,CAACP,IAAD,CAA1B;AAEA,QAAMS,oBAAoB,GAAGR,kBAAkB,GAC3C;AACES,IAAAA,eAAe,EAAG,OAAMT,kBAAmB,GAD7C;AAEEU,IAAAA,cAAc,EAAE;AAFlB,GAD2C,GAK3C,IALJ;;AAMA,QAAMC,YAAY,GAAG,M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XI;AAkBlBtD,EAAAA,WAAW,EAAEvB,SAAS,CAAC0E,KAAV,CAAgB;AAC3BL,IAAAA,KAAK,EAAErE,SAAS,CAACwE,MADU;AAE3BF,IAAAA,aAAa,EAAEtE,SAAS,CAAC2E,IAFE;AAG3B3B,IAAAA,IAAI,EAAEhD,SAAS,CAACyE,KAAV,CAAgB,CAAC,WAAD,EAAc,SAAd,EAAyB,WAAzB,CAAhB,CAHqB;AAI3B,kBAAczE,SAAS,CAACwE,MAJG;AAK3BL,IAAAA,WAAW,EAAEnE,SAAS,CAAC6E;AALI,GAAhB,CAlBK;AAyBlB3D,EAAAA,OAAO,EAAElB,SAAS,CAAC2E,IAzBD;AA0BlBvD,EAAAA,IAAI,EAAEpB,SAAS,CAACwE,MA1BE;AA2BlBnD,EAAAA,kBAAkB,EAAErB,SAAS,CAACwE,MA3BZ;AA4BlBlD,EAAAA,eAAe,EAAEtB,SAAS,CAACwE,MA5BT;AA6BlBhD,EAAAA,WAAW,EAAExB,SAAS,CAACwE,MA7BL;AA8BlB/C,EAAAA,iBAAiB,EAAEzB,SAAS,CAACwE,MA9BX;AA+BlB9C,EAAAA,aAAa,EAAE1B,SAAS,CAAC8E,OAAV,CAAkB9E,SAAS,CAAC0E,KAAV,CAAgBhE,WAAW,CAAC6D,SAA5B,CAAlB;AA/BG,CAApB;AAkCA,eAAe3D,OAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {\n NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond,\n NovaSolidApplicationsWindowUpload3 as WindowUpload,\n NovaLineSettingsCookie as Cookie\n} from '@coorpacademy/nova-icons';\nimport map from 'lodash/fp/map';\nimport Cta from '../../atom/button-link';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './style.css';\n\nconst CMPopin = props => {\n const {\n content,\n mode = 'alert',\n firstButton,\n secondButton,\n onClose,\n header,\n icon,\n backgroundImageUrl,\n descriptionText,\n thirdButton,\n cookieTitle,\n descriptionBtnTxt,\n listBtnSwicth\n } = props;\n\n const logo = {\n AlertDiamond,\n WindowUpload\n };\n const LogoComponent = logo[icon];\n\n const backgroundImageStyle = backgroundImageUrl\n ? {\n backgroundImage: `url(${backgroundImageUrl})`,\n backgroundSize: 'cover'\n }\n : null;\n const renderHeader = () => {\n if (header) return <img className={style.headerBackground} src={header} />;\n if (mode === 'cookie')\n return (\n <div className={style.cookieHeader}>\n <div className={style.cookieIconContainer}>\n <Cookie className={style.cookieIcon} />\n </div>\n <div className={style.cookieTitle}>{cookieTitle}</div>\n </div>\n );\n return null;\n };\n const getClassBtnSwitch = (index, btnList) => {\n switch (index) {\n case 0:\n return style.firstBtnSwitchContainer;\n case btnList.length - 1:\n return style.lastBtnSwitchContainer;\n default:\n return style.singleSwitchContainer;\n }\n };\n const renderBtnSwitch = () => {\n return map.convert({cap: false})((el, index) => {\n const {\n type,\n title,\n value,\n onChange,\n titlePosition,\n theme,\n details,\n requiredSelection,\n disabled\n } = el;\n return (\n <div key={index} className={getClassBtnSwitch(index, listBtnSwicth)}>\n <InputSwitch\n {...{\n type,\n title,\n value,\n onChange,\n titlePosition,\n theme,\n details,\n requiredSelection,\n disabled\n }}\n />\n </div>\n );\n })(listBtnSwicth);\n };\n return (\n <div\n className={mode !== 'cookie' ? style.background : null}\n style={backgroundImageStyle}\n data-name={'cm-popin-container'}\n >\n <div className={mode === 'cookie' ? style.popinCookie : style.popin}>\n <header className={style.popinHeader}>\n {renderHeader()}\n {onClose ? (\n <ButtonLinkIconOnly\n onClick={onClose}\n data-name={'close-icon'}\n aria-label={'close-icon'}\n size=\"small\"\n icon=\"close\"\n />\n ) : null}\n </header>\n <div className={style.titleContainer}>\n <div className={style.contentSection}>\n {LogoComponent ? <LogoComponent className={style.icon} /> : null}\n {content ? (\n <p\n className={mode === 'alert' ? style.content : style.message}\n data-name={'cm-popin-content'}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: content}}\n />\n ) : null}\n </div>\n {descriptionText ? (\n <p\n className={style.descriptionText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: descriptionText}}\n />\n ) : null}\n </div>\n {descriptionBtnTxt ? <div className={style.descriptionBtn}>{descriptionBtnTxt}</div> : null}\n {renderBtnSwitch()}\n <div className={style.buttonContainer}>\n {firstButton ? (\n <div className={firstButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={firstButton.label}\n onClick={firstButton.handleOnclick}\n data-name={'cm-popin-cta'}\n aria-label={firstButton['aria-label']}\n type={firstButton.type}\n />\n </div>\n ) : null}\n {secondButton ? (\n <div className={secondButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={secondButton.label}\n onClick={secondButton.handleOnclick}\n data-name={`cm-popin-cta-${secondButton.type}`}\n aria-label={secondButton['aria-label']}\n type={secondButton.type}\n />\n </div>\n ) : null}\n {thirdButton ? (\n <div className={thirdButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={thirdButton.label}\n onClick={thirdButton.handleOnclick}\n data-name={`cm-popin-cta-${thirdButton.type}`}\n aria-label={thirdButton['aria-label']}\n type={thirdButton.type}\n />\n </div>\n ) : null}\n </div>\n </div>\n </div>\n );\n};\n\nCMPopin.propTypes = {\n content: PropTypes.string,\n mode: PropTypes.oneOf(['alert', 'information', 'cookie']),\n header: PropTypes.string,\n firstButton: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n 'aria-label': PropTypes.string,\n largeButton: PropTypes.bool,\n type: PropTypes.oneOf(['dangerous', 'primary', 'secondary'])\n }),\n secondButton: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n type: PropTypes.oneOf(['dangerous', 'primary', 'secondary']),\n 'aria-label': PropTypes.string,\n largeButton: PropTypes.boolean\n }),\n thirdButton: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n type: PropTypes.oneOf(['dangerous', 'primary', 'secondary']),\n 'aria-label': PropTypes.string,\n largeButton: PropTypes.boolean\n }),\n onClose: PropTypes.func,\n icon: PropTypes.string,\n backgroundImageUrl: PropTypes.string,\n descriptionText: PropTypes.string,\n cookieTitle: PropTypes.string,\n descriptionBtnTxt: PropTypes.string,\n listBtnSwicth: PropTypes.arrayOf(PropTypes.shape(InputSwitch.propTypes))\n};\n\nexport default CMPopin;\n"],"file":"index.js"}
@@ -15,6 +15,13 @@
15
15
  @value cm_grey_200 from colors;
16
16
  @value cm_blue_600 from colors;
17
17
  @value cm_grey_500 from colors;
18
+ @value cm_grey_700 from colors;
19
+ @value white from colors;
20
+ @value cm_blue_50 from colors;
21
+ @value breakpoints: '../../variables/breakpoints.css';
22
+ @value mobile from breakpoints;
23
+ @value tablet from breakpoints;
24
+ @value cm_grey_75 from colors;
18
25
 
19
26
  .background {
20
27
  top: 0px;
@@ -28,7 +35,7 @@
28
35
  box-sizing: border-box;
29
36
  overflow: hidden;
30
37
  display: flex;
31
- position:fixed;
38
+ position: fixed;
32
39
  z-index: 3;
33
40
  }
34
41
 
@@ -60,7 +67,6 @@
60
67
  justify-content: center;
61
68
  align-items: center;
62
69
  padding: 40px 40px 0px;
63
- position: absolute;
64
70
  background: xtraLightGrey;
65
71
  font-family: 'Gilroy';
66
72
  font-weight: 500;
@@ -72,10 +78,10 @@
72
78
  margin: 10px 0px;
73
79
  }
74
80
  @keyframes popup {
75
- 0%{
81
+ 0% {
76
82
  transform: scale(0);
77
83
  }
78
- 100%{
84
+ 100% {
79
85
  transform: scale(1);
80
86
  }
81
87
  }
@@ -85,7 +91,6 @@
85
91
  flex-direction: column;
86
92
  align-items: center;
87
93
  justify-content: center;
88
- width: 65%;
89
94
  }
90
95
 
91
96
  .content {
@@ -101,9 +106,9 @@
101
106
  }
102
107
 
103
108
  .buttonContainer {
104
- width: 100%;
105
- height: 80px;
109
+ min-height: 80px;
106
110
  display: flex;
111
+ width: 100%;
107
112
  align-items: center;
108
113
  justify-content: center;
109
114
  }
@@ -114,7 +119,7 @@
114
119
  }
115
120
 
116
121
  .largeButton {
117
- width: 338px;
122
+ width: 100%;
118
123
  padding: 8px;
119
124
  }
120
125
 
@@ -149,4 +154,143 @@
149
154
  display: flex;
150
155
  flex-direction: column;
151
156
  width: 100%;
152
- }
157
+ }
158
+
159
+ .cookieHeader {
160
+ width: 100%;
161
+ background-color: cm_grey_700;
162
+ padding: 16px 24px;
163
+ border-radius: 10px 10px 0px 0px;
164
+ display: flex;
165
+ align-items: center;
166
+ }
167
+
168
+ .popinCookie {
169
+ max-width: 550px;
170
+ flex-grow: 0;
171
+ margin: 16px;
172
+ border-radius: 10px;
173
+ background-color: cm_grey_50;
174
+ animation: popup 0.7s;
175
+ position: fixed;
176
+ bottom: 32px;
177
+ left: 32px;
178
+ z-index: 2;
179
+ }
180
+ .cookieTitle {
181
+ font-family: "Gilroy";
182
+ font-style: normal;
183
+ font-weight: 700;
184
+ font-size: 24px;
185
+ line-height: 32px;
186
+ color: white;
187
+ padding-left: 16px;
188
+ width: 60%;
189
+ }
190
+ .cookieIcon {
191
+ height: 20px;
192
+ width: 20px;
193
+ }
194
+ .cookieIconContainer {
195
+ width: 39px;
196
+ height: 39px;
197
+ border-radius: 8px;
198
+ background-color: cm_blue_50;
199
+ display: flex;
200
+ justify-content: center;
201
+ align-items: center;
202
+ }
203
+ .popinCookie .button {
204
+ width: 100%;
205
+ padding: 0px 8px 0px 0px
206
+ }
207
+ .popinCookie .button span {
208
+ margin: 0
209
+ }
210
+
211
+ .popinCookie .message {
212
+ padding: 24px 24px 40px 24px
213
+ }
214
+
215
+ .descriptionBtn {
216
+ font-family: "Gilroy";
217
+ font-weight: 500;
218
+ font-size: 16px;
219
+ line-height: 22px;
220
+ color: cm_grey_500;
221
+ font-style: normal;
222
+ white-space: pre-line;
223
+ margin-top: 24px;
224
+ width: calc(100% - 24px);
225
+ padding-left: 24px;
226
+ margin-bottom: 24px;
227
+ }
228
+
229
+
230
+ .firstBtnSwitchContainer {
231
+ height: 56px;
232
+ background-color: cm_grey_75;
233
+ width: 100%;
234
+ display: flex;
235
+ align-items: center;
236
+ }
237
+ .firstBtnSwitchContainer div:first-child {
238
+ margin-left: 9px;
239
+ }
240
+ .singleSwitchContainer div:first-child {
241
+ margin-left: 9px;
242
+ }
243
+
244
+ .lastBtnSwitchContainer {
245
+ composes: singleSwitchContainer;
246
+ margin-bottom: 28px;
247
+ }
248
+
249
+ .singleSwitchContainer {
250
+ width: 100%;
251
+ display: flex;
252
+ align-items: center;
253
+ width: 100%;
254
+ margin-top: 24px;
255
+ }
256
+ a {
257
+ color: cm_primary_blue;
258
+ text-decoration: none;
259
+ }
260
+
261
+ .popinCookie .buttonContainer {
262
+ min-height: 44px;
263
+ padding-bottom: 16px;
264
+ width: auto;
265
+ padding-left: 24px;
266
+ padding-right: 16px;
267
+ }
268
+ .popinCookie .largeButton {
269
+ padding: 0px 8px 0px 0px
270
+ }
271
+ @media tablet {
272
+ .popinCookie {
273
+ position: fixed;
274
+ bottom: 10px;
275
+ left: unset;
276
+ align-self: center;
277
+ max-height: calc(100vh - 50px);
278
+ overflow-x: hidden;
279
+ overflow-y: auto;
280
+ }
281
+ .popinCookie .button{
282
+ width: 100%;
283
+ padding: 0px 0px 8px 0px
284
+ }
285
+ .buttonContainer {
286
+ flex-wrap: wrap;
287
+ margin-top: 40px;
288
+ }
289
+ .popinCookie .largeButton {
290
+ padding: 8px 0px 0px 0px
291
+ }
292
+ .popinCookie .message {
293
+ padding: 24px 24px 0px 24px
294
+ }
295
+
296
+ }
@@ -1,5 +1,5 @@
1
1
  import { View, StyleSheet, TextInput } from 'react-native';
2
- import React, { useState, useEffect, useMemo } from 'react';
2
+ import React, { useState, useEffect, useCallback } from 'react';
3
3
  import { useTemplateContext } from '../../../template/app-review/template-context';
4
4
  import { ANALYTICS_EVENT_TYPE } from '../../../variables/analytics';
5
5
 
@@ -39,23 +39,23 @@ const FreeText = props => {
39
39
  const [styleSheet, setStylesheet] = useState(null);
40
40
  const {
41
41
  brandTheme,
42
- theme
42
+ theme,
43
+ translations
43
44
  } = templateContext;
44
45
  const PLACEHOLDER_COLOR = theme.colors.gray.medium; // ------------------------------------
45
46
 
46
47
  const {
47
48
  analytics,
48
49
  questionType,
49
- fullWitdh,
50
+ fullWitdh = false,
50
51
  testID,
51
52
  onChange,
52
53
  isDisabled,
53
- value,
54
- placeholder
54
+ value
55
55
  } = props; // ------------------------------------
56
56
 
57
- const handleFocus = useMemo(() => analytics && logEvent(ANALYTICS_EVENT_TYPE.INPUT_FOCUS, analytics, questionType), [analytics, questionType]);
58
- const handleBlur = useMemo(() => analytics && logEvent(ANALYTICS_EVENT_TYPE.INPUT_BLUR, analytics, questionType), [analytics, questionType]); // ------------------------------------
57
+ const handleFocus = useCallback(() => analytics && logEvent(ANALYTICS_EVENT_TYPE.INPUT_FOCUS, analytics, questionType), [analytics, questionType]);
58
+ const handleBlur = useCallback(() => analytics && logEvent(ANALYTICS_EVENT_TYPE.INPUT_BLUR, analytics, questionType), [analytics, questionType]); // ------------------------------------
59
59
 
60
60
  useEffect(() => {
61
61
  const _stylesheet = createStyleSheet(brandTheme, theme);
@@ -74,7 +74,7 @@ const FreeText = props => {
74
74
  onFocus: handleFocus,
75
75
  onBlur: handleBlur,
76
76
  onChangeText: onChange,
77
- placeholder: placeholder,
77
+ placeholder: translations.typeHere,
78
78
  placeholderTextColor: PLACEHOLDER_COLOR,
79
79
  value: value,
80
80
  testID: testID,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/molecule/questions/free-text/index.native.tsx"],"names":["View","StyleSheet","TextInput","React","useState","useEffect","useMemo","useTemplateContext","ANALYTICS_EVENT_TYPE","createStyleSheet","brandTheme","theme","create","input","padding","spacing","tiny","borderWidth","borderColor","colors","gray","lightMedium","borderRadius","radius","common","backgroundColor","white","minWidth","text","primary","color","medium","fontWeight","bold","fontSize","regular","textAlign","spaced","paddingVertical","fullWitdh","width","logEvent","eventName","analytics","questionType","id","FreeText","props","templateContext","styleSheet","setStylesheet","PL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AW,GAAGpD,gBAAgB,CAACC,UAAD,EAAaC,KAAb,CAApC;;AACAuC,IAAAA,aAAa,CAACW,WAAD,CAAb;AACD,GAHQ,EAGN,CAACnD,UAAD,EAAaC,KAAb,CAHM,CAAT,CAjCiC,CAsCjC;;AAEA,MAAI,CAACsC,UAAL,EAAiB;AACf,WAAO,IAAP;AACD;;AAED,sBACE,oBAAC,IAAD;AAAM,IAAA,KAAK,EAAE,CAACA,UAAU,CAACZ,MAAZ,EAAoBE,SAAS,IAAIU,UAAU,CAACV,SAA5C;AAAb,kBACE,oBAAC,SAAD;AACE,IAAA,KAAK,EAAE,CAACU,UAAU,CAACpC,KAAZ,EAAmBoC,UAAU,CAACrB,IAA9B,CADT;AAEE,IAAA,OAAO,EAAE6B,WAFX;AAGE,IAAA,MAAM,EAAEE,UAHV;AAIE,IAAA,YAAY,EAAEN,QAJhB;AAKE,IAAA,WAAW,EAAEG,WALf;AAME,IAAA,oBAAoB,EAAEL,iBANxB;AAOE,IAAA,KAAK,EAAEI,KAPT;AAQE,IAAA,MAAM,EAAEH,MARV;AASE,IAAA,QAAQ,EAAE,CAACE,UATb;AAUE,IAAA,iBAAiB,EAAE,CAACA;AAVtB,IADF,CADF;AAgBD,CA5DD;;AA8DA,eAAeR,QAAf","sourcesContent":["import {View, StyleSheet, TextInput} from 'react-native';\nimport React, {useState, useEffect, useMemo} from 'react';\nimport {useTemplateContext} from '../../../template/app-review/template-context';\nimport {ANALYTICS_EVENT_TYPE, Analytics} from '../../../variables/analytics';\n\ntype QuestionType = 'basic' | 'template';\n\ninterface Props {\n children: string;\n fullWitdh: boolean;\n testID: string;\n questionType: QuestionType;\n analytics?: Analytics;\n onChange: Function;\n isDisabled: boolean;\n value: string;\n placeholder: string;\n}\n\ntype StyleSheetType = {\n input: {\n padding: string;\n borderWidth: number;\n borderColor: string;\n borderRadius: number;\n backgroundColor: string;\n minWidth: number;\n };\n text: {\n color: string;\n fontWeight: number;\n fontSize: number;\n textAlign: string;\n };\n spaced: {\n paddingVertical: number;\n };\n fullWitdh: {\n width: string;\n };\n};\n\nconst createStyleSheet = (brandTheme, theme) =>\n StyleSheet.create({\n input: {\n padding: theme.spacing.tiny,\n borderWidth: 1,\n borderColor: theme.colors.gray.lightMedium,\n borderRadius: theme.radius.common,\n backgroundColor: theme.colors.white,\n minWidth: 175\n },\n text: {\n borderColor: brandTheme?.colors.primary,\n color: brandTheme?.colors.primary || theme.colors.gray.medium,\n fontWeight: theme.fontWeight.bold,\n fontSize: theme.fontSize.regular,\n textAlign: 'center'\n },\n spaced: {\n paddingVertical: theme.spacing.tiny\n },\n fullWitdh: {\n width: '100%'\n }\n });\n\nconst logEvent = (eventName: string, analytics: Analytics, questionType: QuestionType) => {\n analytics &&\n analytics.logEvent(eventName, {\n id: `question-input-text`,\n questionType\n });\n};\n\nconst FreeText = (props: Props) => {\n const templateContext = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const {brandTheme, theme} = templateContext;\n const PLACEHOLDER_COLOR = theme.colors.gray.medium;\n\n // ------------------------------------\n\n const {\n analytics,\n questionType,\n fullWitdh,\n testID,\n onChange,\n isDisabled,\n value,\n placeholder\n } = props;\n\n // ------------------------------------\n\n const handleFocus = useMemo(\n () => analytics && logEvent(ANALYTICS_EVENT_TYPE.INPUT_FOCUS, analytics, questionType),\n [analytics, questionType]\n );\n\n const handleBlur = useMemo(\n () => analytics && logEvent(ANALYTICS_EVENT_TYPE.INPUT_BLUR, analytics, questionType),\n [analytics, questionType]\n );\n\n // ------------------------------------\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(brandTheme, theme);\n setStylesheet(_stylesheet);\n }, [brandTheme, theme]);\n\n // ------------------------------------\n\n if (!styleSheet) {\n return null;\n }\n\n return (\n <View style={[styleSheet.spaced, fullWitdh && styleSheet.fullWitdh]}>\n <TextInput\n style={[styleSheet.input, styleSheet.text]}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onChangeText={onChange}\n placeholder={placeholder}\n placeholderTextColor={PLACEHOLDER_COLOR}\n value={value}\n testID={testID}\n editable={!isDisabled}\n selectTextOnFocus={!isDisabled}\n />\n </View>\n );\n};\n\nexport default FreeText;\n"],"file":"index.native.js"}
1
+ {"version":3,"sources":["../../../../src/molecule/questions/free-text/index.native.tsx"],"names":["View","StyleSheet","TextInput","React","useState","useEffect","useCallback","useTemplateContext","ANALYTICS_EVENT_TYPE","createStyleSheet","brandTheme","theme","create","input","padding","spacing","tiny","borderWidth","borderColor","colors","gray","lightMedium","borderRadius","radius","common","backgroundColor","white","minWidth","text","primary","color","medium","fontWeight","bold","fontSize","regular","textAlign","spaced","paddingVertical","fullWitdh","width","logEvent","eventName","analytics","questionType","id","FreeText","props","templateContext","styleSheet","setStylesheet","translations","PLACEHOLDER_COLOR","testID","onChange","isDisabled","value","handleFocus","INPUT_FOCUS","handleBlur","INPUT_BLUR","_stylesheet","typeHere"],"mappings":"AAAA,SAAQA,IAAR,EAAcC,UAAd,EAA0BC,SAA1B,QAA0C,cAA1C;AACA,OAAOC,KAAP,IAAeC,QAAf,EAAyBC,SAAzB,EAAoCC,WAApC,QAAsD,OAAtD;AACA,SAAQC,kBAAR,QAAiC,+CAAjC;AACA,SAAQC,oBAAR,QAA8C,8BAA9C;;AAiDA,MAAMC,gBAAgB,GAAG,CAACC,UAAD,EAAaC,KAAb,KACvBV,UAAU,CAACW,MAAX,CAAkB;AAChBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,OAAO,EAAEH,KAAK,CAACI,OAAN,CAAcC,IADlB;AAELC,IAAAA,WAAW,EAAE,CAFR;AAGLC,IAAAA,WAAW,EAAEP,KAAK,CAACQ,MAAN,CAAaC,IAAb,CAAkBC,WAH1B;AAILC,IAAAA,YAAY,EAAEX,KAAK,CAACY,MAAN,CAAaC,MAJtB;AAKLC,IAAAA,eAAe,EAAEd,KAAK,CAACQ,MAAN,CAAaO,KALzB;AAMLC,IAAAA,QAAQ,EAAE;AANL,GADS;AAShBC,EAAAA,IAAI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,IAAA,iBAAiB,EAAE,CAACA;AAVtB,IADF,CADF;AAgBD,CAnDD;;AAqDA,eAAeT,QAAf","sourcesContent":["import {View, StyleSheet, TextInput} from 'react-native';\nimport React, {useState, useEffect, useCallback} from 'react';\nimport {useTemplateContext} from '../../../template/app-review/template-context';\nimport {ANALYTICS_EVENT_TYPE, Analytics} from '../../../variables/analytics';\n\ntype QuestionType = 'basic' | 'template';\n\ninterface Props {\n fullWitdh?: boolean;\n testID: string;\n questionType: QuestionType;\n analytics?: Analytics;\n onChange: (text: string) => void;\n isDisabled: boolean;\n value: string;\n}\n\ntype StyleSheetType = {\n input: {\n padding: string;\n borderWidth: number;\n borderColor: string;\n borderRadius: number;\n backgroundColor: string;\n minWidth: number;\n };\n text: {\n color: string;\n fontWeight:\n | 'normal'\n | 'bold'\n | '100'\n | '200'\n | '300'\n | '400'\n | '500'\n | '600'\n | '700'\n | '800'\n | '900'\n | undefined;\n fontSize: number;\n textAlign: 'auto' | 'left' | 'right' | 'center' | 'justify' | undefined;\n };\n spaced: {\n paddingVertical: number;\n };\n fullWitdh: {\n width: string;\n };\n};\n\nconst createStyleSheet = (brandTheme, theme) =>\n StyleSheet.create({\n input: {\n padding: theme.spacing.tiny,\n borderWidth: 1,\n borderColor: theme.colors.gray.lightMedium,\n borderRadius: theme.radius.common,\n backgroundColor: theme.colors.white,\n minWidth: 175\n },\n text: {\n borderColor: brandTheme?.colors.primary,\n color: brandTheme?.colors.primary || theme.colors.gray.medium,\n fontWeight: theme.fontWeight.bold,\n fontSize: theme.fontSize.regular,\n textAlign: 'center'\n },\n spaced: {\n paddingVertical: theme.spacing.tiny\n },\n fullWitdh: {\n width: '100%'\n }\n });\n\nconst logEvent = (eventName: string, analytics: Analytics, questionType: QuestionType) => {\n analytics &&\n analytics.logEvent(eventName, {\n id: `question-input-text`,\n questionType\n });\n};\n\nconst FreeText = (props: Props) => {\n const templateContext = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const {brandTheme, theme, translations} = templateContext;\n const PLACEHOLDER_COLOR = theme.colors.gray.medium;\n\n // ------------------------------------\n\n const {analytics, questionType, fullWitdh = false, testID, onChange, isDisabled, value} = props;\n\n // ------------------------------------\n\n const handleFocus = useCallback(\n () => analytics && logEvent(ANALYTICS_EVENT_TYPE.INPUT_FOCUS, analytics, questionType),\n [analytics, questionType]\n );\n\n const handleBlur = useCallback(\n () => analytics && logEvent(ANALYTICS_EVENT_TYPE.INPUT_BLUR, analytics, questionType),\n [analytics, questionType]\n );\n\n // ------------------------------------\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(brandTheme, theme);\n setStylesheet(_stylesheet);\n }, [brandTheme, theme]);\n\n // ------------------------------------\n\n if (!styleSheet) {\n return null;\n }\n\n return (\n <View style={[styleSheet.spaced, fullWitdh && styleSheet.fullWitdh]}>\n <TextInput\n style={[styleSheet.input, styleSheet.text]}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onChangeText={onChange}\n placeholder={translations.typeHere}\n placeholderTextColor={PLACEHOLDER_COLOR}\n value={value}\n testID={testID}\n editable={!isDisabled}\n selectTextOnFocus={!isDisabled}\n />\n </View>\n );\n};\n\nexport default FreeText;\n"],"file":"index.native.js"}