@coorpacademy/components 11.12.1-alpha.13 → 11.12.1

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 (109) hide show
  1. package/es/atom/drag-and-drop/index.d.ts +0 -2
  2. package/es/atom/drag-and-drop/index.d.ts.map +1 -1
  3. package/es/atom/drag-and-drop/index.js +2 -26
  4. package/es/atom/drag-and-drop/index.js.map +1 -1
  5. package/es/atom/drag-and-drop/style.css +5 -21
  6. package/es/atom/image-upload/index.d.ts +1 -5
  7. package/es/atom/image-upload/index.d.ts.map +1 -1
  8. package/es/atom/image-upload/index.js +10 -8
  9. package/es/atom/image-upload/index.js.map +1 -1
  10. package/es/atom/video-upload/index.d.ts +0 -2
  11. package/es/molecule/brand-form-group/index.d.ts +0 -4
  12. package/es/molecule/drag-and-drop-wrapper/index.d.ts +0 -2
  13. package/es/molecule/drag-and-drop-wrapper/style.css +1 -1
  14. package/es/molecule/review-correction-popin/index.native.d.ts.map +1 -1
  15. package/es/molecule/review-correction-popin/index.native.js +10 -1
  16. package/es/molecule/review-correction-popin/index.native.js.map +1 -1
  17. package/es/molecule/setup-slide/index.d.ts +0 -2
  18. package/es/molecule/setup-slider/index.d.ts +0 -2
  19. package/es/molecule/title-and-checkbox-wrapper/index.d.ts +0 -2
  20. package/es/organism/brand-form/index.d.ts +0 -4
  21. package/es/organism/list-item/index.d.ts +0 -1
  22. package/es/organism/list-item/index.d.ts.map +1 -1
  23. package/es/organism/list-item/index.js +3 -5
  24. package/es/organism/list-item/index.js.map +1 -1
  25. package/es/organism/list-items/index.d.ts +0 -1
  26. package/es/organism/review-skills/index.native.js +1 -1
  27. package/es/organism/review-skills/index.native.js.map +1 -1
  28. package/es/organism/review-slide/index.native.d.ts.map +1 -1
  29. package/es/organism/review-slide/index.native.js +3 -3
  30. package/es/organism/review-slide/index.native.js.map +1 -1
  31. package/es/organism/rewards-form/index.d.ts +0 -2
  32. package/es/organism/wizard-contents/index.d.ts +0 -6
  33. package/es/template/back-office/brand-update/index.d.ts +0 -11
  34. package/es/template/cockpit/jw-uploader/index.d.ts +0 -2
  35. package/es/util/button-icons.d.ts +0 -1
  36. package/es/util/button-icons.d.ts.map +1 -1
  37. package/es/util/button-icons.js +2 -3
  38. package/es/util/button-icons.js.map +1 -1
  39. package/es/util/proptypes.d.ts.map +1 -1
  40. package/es/util/proptypes.js +2 -2
  41. package/es/util/proptypes.js.map +1 -1
  42. package/lib/atom/drag-and-drop/index.d.ts +0 -2
  43. package/lib/atom/drag-and-drop/index.d.ts.map +1 -1
  44. package/lib/atom/drag-and-drop/index.js +2 -26
  45. package/lib/atom/drag-and-drop/index.js.map +1 -1
  46. package/lib/atom/drag-and-drop/style.css +5 -21
  47. package/lib/atom/image-upload/index.d.ts +1 -5
  48. package/lib/atom/image-upload/index.d.ts.map +1 -1
  49. package/lib/atom/image-upload/index.js +11 -8
  50. package/lib/atom/image-upload/index.js.map +1 -1
  51. package/lib/atom/video-upload/index.d.ts +0 -2
  52. package/lib/molecule/brand-form-group/index.d.ts +0 -4
  53. package/lib/molecule/drag-and-drop-wrapper/index.d.ts +0 -2
  54. package/lib/molecule/drag-and-drop-wrapper/style.css +1 -1
  55. package/lib/molecule/review-correction-popin/index.native.d.ts.map +1 -1
  56. package/lib/molecule/review-correction-popin/index.native.js +10 -1
  57. package/lib/molecule/review-correction-popin/index.native.js.map +1 -1
  58. package/lib/molecule/setup-slide/index.d.ts +0 -2
  59. package/lib/molecule/setup-slider/index.d.ts +0 -2
  60. package/lib/molecule/title-and-checkbox-wrapper/index.d.ts +0 -2
  61. package/lib/organism/brand-form/index.d.ts +0 -4
  62. package/lib/organism/list-item/index.d.ts +0 -1
  63. package/lib/organism/list-item/index.d.ts.map +1 -1
  64. package/lib/organism/list-item/index.js +3 -5
  65. package/lib/organism/list-item/index.js.map +1 -1
  66. package/lib/organism/list-items/index.d.ts +0 -1
  67. package/lib/organism/review-skills/index.native.js +1 -1
  68. package/lib/organism/review-skills/index.native.js.map +1 -1
  69. package/lib/organism/review-slide/index.native.d.ts.map +1 -1
  70. package/lib/organism/review-slide/index.native.js +3 -3
  71. package/lib/organism/review-slide/index.native.js.map +1 -1
  72. package/lib/organism/rewards-form/index.d.ts +0 -2
  73. package/lib/organism/wizard-contents/index.d.ts +0 -6
  74. package/lib/template/back-office/brand-update/index.d.ts +0 -11
  75. package/lib/template/cockpit/jw-uploader/index.d.ts +0 -2
  76. package/lib/util/button-icons.d.ts +0 -1
  77. package/lib/util/button-icons.d.ts.map +1 -1
  78. package/lib/util/button-icons.js +1 -2
  79. package/lib/util/button-icons.js.map +1 -1
  80. package/lib/util/proptypes.d.ts.map +1 -1
  81. package/lib/util/proptypes.js +2 -2
  82. package/lib/util/proptypes.js.map +1 -1
  83. package/locales/.mtslconfig.json +1 -0
  84. package/locales/bs/global.json +4 -1
  85. package/locales/cs/global.json +4 -1
  86. package/locales/de/global.json +4 -1
  87. package/locales/es/global.json +4 -1
  88. package/locales/et/global.json +4 -1
  89. package/locales/fr/global.json +4 -1
  90. package/locales/hr/global.json +4 -1
  91. package/locales/hu/global.json +4 -1
  92. package/locales/hy/global.json +4 -1
  93. package/locales/it/global.json +4 -1
  94. package/locales/ja/global.json +4 -1
  95. package/locales/ko/global.json +4 -1
  96. package/locales/nl/global.json +4 -1
  97. package/locales/pl/global.json +4 -1
  98. package/locales/pt/global.json +4 -1
  99. package/locales/ro/global.json +4 -1
  100. package/locales/ru/global.json +4 -1
  101. package/locales/sk/global.json +4 -1
  102. package/locales/th/global.json +4 -1
  103. package/locales/tl/global.json +4 -1
  104. package/locales/tr/global.json +4 -1
  105. package/locales/uk/global.json +4 -1
  106. package/locales/vi/global.json +4 -1
  107. package/locales/zh/global.json +4 -1
  108. package/locales/zh_TW/global.json +4 -1
  109. package/package.json +2 -2
@@ -18,8 +18,6 @@ declare class DragAndDrop extends React.Component<any, any, any> {
18
18
  error: PropTypes.Requireable<string>;
19
19
  buttonAriaLabel: PropTypes.Requireable<string>;
20
20
  errorButtonLabel: PropTypes.Requireable<string>;
21
- pdfButtonLabel: PropTypes.Requireable<string>;
22
- pdfButtonAriaLabel: PropTypes.Requireable<string>;
23
21
  };
24
22
  constructor(props: any);
25
23
  state: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/drag-and-drop/index.js"],"names":[],"mappings":";AAgBA;IACE;;;;;;;;;;;;;;;;;;;;MAoBE;IAEF,wBASC;IANC;;MAEC;IAMH,wBAIC;IAED,uBAIC;IAED,sBAsKC;CACF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/drag-and-drop/index.js"],"names":[],"mappings":";AAgBA;IACE;;;;;;;;;;;;;;;;;;MAkBE;IAEF,wBASC;IANC;;MAEC;IAMH,wBAIC;IAED,uBAIC;IAED,sBAmJC;CACF"}
@@ -53,9 +53,7 @@ class DragAndDrop extends React.Component {
53
53
  error = '',
54
54
  buttonAriaLabel = '',
55
55
  errorButtonLabel = '',
56
- disabled = false,
57
- pdfButtonLabel,
58
- pdfButtonAriaLabel
56
+ disabled = false
59
57
  } = this.props;
60
58
  const {
61
59
  dragging
@@ -76,26 +74,6 @@ class DragAndDrop extends React.Component {
76
74
  src: previewContent.src,
77
75
  type: "video/*"
78
76
  }));
79
- } else if (previewContent && previewContent.type === 'pdf') {
80
- previewView = /*#__PURE__*/React.createElement("div", {
81
- className: style.previewPdf
82
- }, /*#__PURE__*/React.createElement("p", {
83
- className: style.previewLabelPdf
84
- }, previewLabel), /*#__PURE__*/React.createElement(Button, {
85
- type: "secondary",
86
- link: {
87
- href: previewContent.src,
88
- target: '_blank',
89
- download: false
90
- },
91
- label: pdfButtonLabel,
92
- "aria-label": pdfButtonAriaLabel,
93
- "data-name": "default-button-pdf",
94
- icon: {
95
- position: 'left',
96
- type: 'pdf'
97
- }
98
- }));
99
77
  } else if (loading) {
100
78
  previewView = /*#__PURE__*/React.createElement("div", {
101
79
  className: style.loaderWrapper
@@ -201,9 +179,7 @@ DragAndDrop.propTypes = process.env.NODE_ENV !== "production" ? {
201
179
  onReset: PropTypes.func,
202
180
  error: PropTypes.string,
203
181
  buttonAriaLabel: PropTypes.string,
204
- errorButtonLabel: PropTypes.string,
205
- pdfButtonLabel: PropTypes.string,
206
- pdfButtonAriaLabel: PropTypes.string
182
+ errorButtonLabel: PropTypes.string
207
183
  } : {};
208
184
  export default DragAndDrop;
209
185
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","PropTypes","NovaSolidStatusClose","Close","NovaSolidFilesBasicFileUpload2","FileUploadIcon","NovaSolidFilesBasicFileBlock2","FileUploadBlockedIcon","classnames","Loader","Button","getClassState","style","constantNull","DragAndDrop","Component","constructor","props","state","dragging","handleDragStart","bind","handleDragStop","setState","render","idBox","children","title","description","uploadLabel","previewLabel","previewContent","loading","modified","onReset","error","buttonAriaLabel","errorButtonLabel","disabled","pdfButtonLabel","pdfButtonAriaLabel","previewView","type","preview","src","previewPdf","previewLabelPdf","href","target","download","position","loaderWrapper","loadingCancel","closeIcon","loader","loaderText","resetContent","resetUploadWrapper","resetSrcLabel","label","buildButton","defaultButtonProps","icon","button","previewContainer","modifiedPreviewContainer","inputWrapper","modifiedInputWrapper","errorInputWrapper","wrapper","infosContainer","iconError","dragAndDropLabel","errorMessage","propTypes","string","shape","bool","func"],"sources":["../../../src/atom/drag-and-drop/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {uniqueId, constant, isEmpty} from 'lodash/fp';\nimport {\n NovaSolidStatusClose as Close,\n NovaSolidFilesBasicFileUpload2 as FileUploadIcon,\n NovaSolidFilesBasicFileBlock2 as FileUploadBlockedIcon\n} from '@coorpacademy/nova-icons';\nimport classnames from 'classnames';\nimport Loader from '../loader';\nimport Button from '../button-link';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst constantNull = constant(null);\n\nclass DragAndDrop extends React.Component {\n static propTypes = {\n title: PropTypes.string,\n description: PropTypes.string,\n uploadLabel: PropTypes.string,\n previewLabel: PropTypes.string,\n previewContent: PropTypes.shape({\n type: PropTypes.string,\n src: PropTypes.string,\n label: PropTypes.string\n }),\n loading: PropTypes.bool,\n modified: PropTypes.bool,\n disabled: PropTypes.bool,\n children: PropTypes.func,\n onReset: PropTypes.func,\n error: PropTypes.string,\n buttonAriaLabel: PropTypes.string,\n errorButtonLabel: PropTypes.string,\n pdfButtonLabel: PropTypes.string,\n pdfButtonAriaLabel: PropTypes.string\n };\n\n constructor(props) {\n super(props);\n\n this.state = {\n dragging: false\n };\n\n this.handleDragStart = this.handleDragStart.bind(this);\n this.handleDragStop = this.handleDragStop.bind(this);\n }\n\n handleDragStart() {\n this.setState({\n dragging: true\n });\n }\n\n handleDragStop() {\n this.setState({\n dragging: false\n });\n }\n\n render() {\n const idBox = uniqueId('drop-box-');\n const {\n children = constantNull,\n title,\n description,\n uploadLabel,\n previewLabel = '',\n previewContent,\n loading = false,\n modified = false,\n onReset = null,\n error = '',\n buttonAriaLabel = '',\n errorButtonLabel = '',\n disabled = false,\n pdfButtonLabel,\n pdfButtonAriaLabel\n } = this.props;\n const {dragging} = this.state;\n\n let previewView = null;\n\n if (previewContent && previewContent.type === 'image') {\n previewView = (\n <div className={style.preview}>\n <img src={previewContent.src} />\n </div>\n );\n } else if (previewContent && previewContent.type === 'video') {\n previewView = (\n <div className={style.preview}>\n <video controls src={previewContent.src} type=\"video/*\" />\n </div>\n );\n } else if (previewContent && previewContent.type === 'pdf') {\n previewView = (\n <div className={style.previewPdf}>\n <p className={style.previewLabelPdf}>{previewLabel}</p>\n <Button\n type=\"secondary\"\n link={{href: previewContent.src, target: '_blank', download: false}}\n label={pdfButtonLabel}\n aria-label={pdfButtonAriaLabel}\n data-name=\"default-button-pdf\"\n icon={{\n position: 'left',\n type: 'pdf'\n }}\n />\n </div>\n );\n } else if (loading) {\n previewView = (\n <div className={style.loaderWrapper}>\n <div className={style.loadingCancel}>\n <Close\n data-name=\"reset-content-icon\"\n height={12}\n width={12}\n className={style.closeIcon}\n onClick={onReset}\n />\n </div>\n <div className={style.loader}>\n <Loader theme=\"coorpmanager\" />\n </div>\n <span className={style.loaderText}>Uploading</span>\n </div>\n );\n } else {\n previewView = <span>{previewLabel}</span>;\n }\n\n const resetContent =\n previewContent && previewContent.src ? (\n <div className={classnames(style.resetUploadWrapper, disabled && style.disabled)}>\n <div className={style.resetSrcLabel}>\n {previewContent.label ? previewContent.label : previewContent.src}\n </div>\n {onReset ? (\n <Close\n data-name=\"reset-content-icon\"\n height={12}\n width={12}\n className={style.closeIcon}\n onClick={onReset}\n />\n ) : null}\n </div>\n ) : null;\n\n const buildButton = () => {\n const defaultButtonProps = {\n label: uploadLabel,\n 'aria-label': buttonAriaLabel,\n 'data-name': 'default-button',\n icon: {\n position: 'left',\n type: 'folders'\n }\n };\n if (dragging) {\n return null;\n } else if (error) {\n return <Button {...defaultButtonProps} label={errorButtonLabel} icon={{}} />;\n } else {\n return <Button {...defaultButtonProps} />;\n }\n };\n\n const button = buildButton(dragging, error);\n\n const previewContainer = getClassState(\n style.previewContainer,\n style.modifiedPreviewContainer,\n null,\n modified,\n error\n );\n const inputWrapper = getClassState(\n style.inputWrapper,\n style.modifiedInputWrapper,\n style.errorInputWrapper,\n modified,\n error\n );\n\n return (\n <div className={style.wrapper} data-name=\"drag-and-drop-wrapper\">\n <div className={style.title}>{title}</div>\n {!isEmpty(previewContent) || loading ? (\n <div className={classnames(previewContainer, disabled && style.disabled)}>\n {previewView}\n </div>\n ) : (\n <div\n className={classnames(\n dragging ? style.dragging : inputWrapper,\n disabled && style.disabled\n )}\n id={idBox}\n data-name=\"drag-and-drop-box\"\n >\n <div className={style.infosContainer}>\n {error ? (\n <FileUploadBlockedIcon className={style.iconError} />\n ) : (\n <FileUploadIcon className={style.icon} />\n )}\n {description ? <div className={style.description}>{description}</div> : null}\n {error ? null : <div className={style.dragAndDropLabel}>{'Drag & Drop here'}</div>}\n </div>\n {button}\n <div>{children(this.handleDragStart, this.handleDragStop)}</div>\n </div>\n )}\n {error ? (\n <span className={classnames(style.errorMessage, disabled && style.disabled)}>\n {error}\n </span>\n ) : (\n resetContent\n )}\n </div>\n );\n }\n}\n\nexport default DragAndDrop;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SACEC,oBAAoB,IAAIC,KAD1B,EAEEC,8BAA8B,IAAIC,cAFpC,EAGEC,6BAA6B,IAAIC,qBAHnC,QAIO,0BAJP;AAKA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,MAAP,MAAmB,WAAnB;AACA,OAAOC,MAAP,MAAmB,gBAAnB;AACA,OAAOC,aAAP,MAA0B,4BAA1B;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,YAAY,GAAG,UAAS,IAAT,CAArB;;AAEA,MAAMC,WAAN,SAA0Bd,KAAK,CAACe,SAAhC,CAA0C;EAuBxCC,WAAW,CAACC,KAAD,EAAQ;IACjB,MAAMA,KAAN;IAEA,KAAKC,KAAL,GAAa;MACXC,QAAQ,EAAE;IADC,CAAb;IAIA,KAAKC,eAAL,GAAuB,KAAKA,eAAL,CAAqBC,IAArB,CAA0B,IAA1B,CAAvB;IACA,KAAKC,cAAL,GAAsB,KAAKA,cAAL,CAAoBD,IAApB,CAAyB,IAAzB,CAAtB;EACD;;EAEDD,eAAe,GAAG;IAChB,KAAKG,QAAL,CAAc;MACZJ,QAAQ,EAAE;IADE,CAAd;EAGD;;EAEDG,cAAc,GAAG;IACf,KAAKC,QAAL,CAAc;MACZJ,QAAQ,EAAE;IADE,CAAd;EAGD;;EAEDK,MAAM,GAAG;IACP,MAAMC,KAAK,GAAG,UAAS,WAAT,CAAd;;IACA,MAAM;MACJC,QAAQ,GAAGb,YADP;MAEJc,KAFI;MAGJC,WAHI;MAIJC,WAJI;MAKJC,YAAY,GAAG,EALX;MAMJC,cANI;MAOJC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EjC,SAAS,CAAC6E,IAdF;EAejB3C,KAAK,EAAElC,SAAS,CAAC0E,MAfA;EAgBjBvC,eAAe,EAAEnC,SAAS,CAAC0E,MAhBV;EAiBjBtC,gBAAgB,EAAEpC,SAAS,CAAC0E,MAjBX;EAkBjBpC,cAAc,EAAEtC,SAAS,CAAC0E,MAlBT;EAmBjBnC,kBAAkB,EAAEvC,SAAS,CAAC0E;AAnBb,C;AAsNrB,eAAe7D,WAAf"}
1
+ {"version":3,"file":"index.js","names":["React","PropTypes","NovaSolidStatusClose","Close","NovaSolidFilesBasicFileUpload2","FileUploadIcon","NovaSolidFilesBasicFileBlock2","FileUploadBlockedIcon","classnames","Loader","Button","getClassState","style","constantNull","DragAndDrop","Component","constructor","props","state","dragging","handleDragStart","bind","handleDragStop","setState","render","idBox","children","title","description","uploadLabel","previewLabel","previewContent","loading","modified","onReset","error","buttonAriaLabel","errorButtonLabel","disabled","previewView","type","preview","src","loaderWrapper","loadingCancel","closeIcon","loader","loaderText","resetContent","resetUploadWrapper","resetSrcLabel","label","buildButton","defaultButtonProps","icon","position","button","previewContainer","modifiedPreviewContainer","inputWrapper","modifiedInputWrapper","errorInputWrapper","wrapper","infosContainer","iconError","dragAndDropLabel","errorMessage","propTypes","string","shape","bool","func"],"sources":["../../../src/atom/drag-and-drop/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {uniqueId, constant, isEmpty} from 'lodash/fp';\nimport {\n NovaSolidStatusClose as Close,\n NovaSolidFilesBasicFileUpload2 as FileUploadIcon,\n NovaSolidFilesBasicFileBlock2 as FileUploadBlockedIcon\n} from '@coorpacademy/nova-icons';\nimport classnames from 'classnames';\nimport Loader from '../loader';\nimport Button from '../button-link';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst constantNull = constant(null);\n\nclass DragAndDrop extends React.Component {\n static propTypes = {\n title: PropTypes.string,\n description: PropTypes.string,\n uploadLabel: PropTypes.string,\n previewLabel: PropTypes.string,\n previewContent: PropTypes.shape({\n type: PropTypes.string,\n src: PropTypes.string,\n label: PropTypes.string\n }),\n loading: PropTypes.bool,\n modified: PropTypes.bool,\n disabled: PropTypes.bool,\n children: PropTypes.func,\n onReset: PropTypes.func,\n error: PropTypes.string,\n buttonAriaLabel: PropTypes.string,\n errorButtonLabel: PropTypes.string\n };\n\n constructor(props) {\n super(props);\n\n this.state = {\n dragging: false\n };\n\n this.handleDragStart = this.handleDragStart.bind(this);\n this.handleDragStop = this.handleDragStop.bind(this);\n }\n\n handleDragStart() {\n this.setState({\n dragging: true\n });\n }\n\n handleDragStop() {\n this.setState({\n dragging: false\n });\n }\n\n render() {\n const idBox = uniqueId('drop-box-');\n const {\n children = constantNull,\n title,\n description,\n uploadLabel,\n previewLabel = '',\n previewContent,\n loading = false,\n modified = false,\n onReset = null,\n error = '',\n buttonAriaLabel = '',\n errorButtonLabel = '',\n disabled = false\n } = this.props;\n const {dragging} = this.state;\n\n let previewView = null;\n\n if (previewContent && previewContent.type === 'image') {\n previewView = (\n <div className={style.preview}>\n <img src={previewContent.src} />\n </div>\n );\n } else if (previewContent && previewContent.type === 'video') {\n previewView = (\n <div className={style.preview}>\n <video controls src={previewContent.src} type=\"video/*\" />\n </div>\n );\n } else if (loading) {\n previewView = (\n <div className={style.loaderWrapper}>\n <div className={style.loadingCancel}>\n <Close\n data-name=\"reset-content-icon\"\n height={12}\n width={12}\n className={style.closeIcon}\n onClick={onReset}\n />\n </div>\n <div className={style.loader}>\n <Loader theme=\"coorpmanager\" />\n </div>\n <span className={style.loaderText}>Uploading</span>\n </div>\n );\n } else {\n previewView = <span>{previewLabel}</span>;\n }\n\n const resetContent =\n previewContent && previewContent.src ? (\n <div className={classnames(style.resetUploadWrapper, disabled && style.disabled)}>\n <div className={style.resetSrcLabel}>\n {previewContent.label ? previewContent.label : previewContent.src}\n </div>\n {onReset ? (\n <Close\n data-name=\"reset-content-icon\"\n height={12}\n width={12}\n className={style.closeIcon}\n onClick={onReset}\n />\n ) : null}\n </div>\n ) : null;\n\n const buildButton = () => {\n const defaultButtonProps = {\n label: uploadLabel,\n 'aria-label': buttonAriaLabel,\n 'data-name': 'default-button',\n icon: {\n position: 'left',\n type: 'folders'\n }\n };\n if (dragging) {\n return null;\n } else if (error) {\n return <Button {...defaultButtonProps} label={errorButtonLabel} icon={{}} />;\n } else {\n return <Button {...defaultButtonProps} />;\n }\n };\n\n const button = buildButton(dragging, error);\n\n const previewContainer = getClassState(\n style.previewContainer,\n style.modifiedPreviewContainer,\n null,\n modified,\n error\n );\n const inputWrapper = getClassState(\n style.inputWrapper,\n style.modifiedInputWrapper,\n style.errorInputWrapper,\n modified,\n error\n );\n\n return (\n <div className={style.wrapper} data-name=\"drag-and-drop-wrapper\">\n <div className={style.title}>{title}</div>\n {!isEmpty(previewContent) || loading ? (\n <div className={classnames(previewContainer, disabled && style.disabled)}>\n {previewView}\n </div>\n ) : (\n <div\n className={classnames(\n dragging ? style.dragging : inputWrapper,\n disabled && style.disabled\n )}\n id={idBox}\n data-name=\"drag-and-drop-box\"\n >\n <div className={style.infosContainer}>\n {error ? (\n <FileUploadBlockedIcon className={style.iconError} />\n ) : (\n <FileUploadIcon className={style.icon} />\n )}\n {description ? <div className={style.description}>{description}</div> : null}\n {error ? null : <div className={style.dragAndDropLabel}>{'Drag & Drop here'}</div>}\n </div>\n {button}\n <div>{children(this.handleDragStart, this.handleDragStop)}</div>\n </div>\n )}\n {error ? (\n <span className={classnames(style.errorMessage, disabled && style.disabled)}>\n {error}\n </span>\n ) : (\n resetContent\n )}\n </div>\n );\n }\n}\n\nexport default DragAndDrop;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SACEC,oBAAoB,IAAIC,KAD1B,EAEEC,8BAA8B,IAAIC,cAFpC,EAGEC,6BAA6B,IAAIC,qBAHnC,QAIO,0BAJP;AAKA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,MA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AFe;IAG9BjB,KAAK,EAAElD,SAAS,CAACmE;EAHa,CAAhB,CALC;EAUjBpC,OAAO,EAAE/B,SAAS,CAACqE,IAVF;EAWjBrC,QAAQ,EAAEhC,SAAS,CAACqE,IAXH;EAYjBhC,QAAQ,EAAErC,SAAS,CAACqE,IAZH;EAajB5C,QAAQ,EAAEzB,SAAS,CAACsE,IAbH;EAcjBrC,OAAO,EAAEjC,SAAS,CAACsE,IAdF;EAejBpC,KAAK,EAAElC,SAAS,CAACmE,MAfA;EAgBjBhC,eAAe,EAAEnC,SAAS,CAACmE,MAhBV;EAiBjB/B,gBAAgB,EAAEpC,SAAS,CAACmE;AAjBX,C;AAiMrB,eAAetD,WAAf"}
@@ -78,31 +78,12 @@
78
78
  background-color: white;
79
79
  }
80
80
 
81
- .preview img,
82
- video {
81
+ .preview img, video {
83
82
  max-width: 100%;
84
83
  max-height: 100%;
85
84
  margin: auto;
86
85
  }
87
86
 
88
- .previewPdf {
89
- composes: preview;
90
- min-height: 150px;
91
- display: flex;
92
- flex-direction: column;
93
- justify-content: space-evenly;
94
- }
95
-
96
- .previewLabelPdf {
97
- text-align: center;
98
- font-family: "Gilroy";
99
- color: cm_grey_300;
100
- padding: 0px 4px;
101
- overflow: hidden;
102
- text-overflow: ellipsis;
103
- max-width: 90%;
104
- white-space: nowrap;
105
- }
106
87
  .infosContainer {
107
88
  width: 100%;
108
89
  height: 100%;
@@ -171,7 +152,7 @@ video {
171
152
  align-items: center;
172
153
  justify-content: space-between;
173
154
  margin-top: 16px;
174
- padding: 8px 14px 8px 1px;
155
+ padding: 4px 8px;
175
156
  font-size: 12px;
176
157
  font-weight: 400;
177
158
  position: relative;
@@ -183,6 +164,9 @@ video {
183
164
  text-overflow: ellipsis;
184
165
  white-space: nowrap;
185
166
  flex-wrap: nowrap;
167
+ position: absolute;
168
+ left: 0;
169
+ right: 15px;
186
170
  }
187
171
 
188
172
  .closeIcon {
@@ -1,5 +1,5 @@
1
1
  export default ImageUpload;
2
- declare function ImageUpload({ title, description, previewLabel, previewContent, uploadLabel, loading, modified, disabled, onChange, onReset, name, labelLink, labelButtonLink, hrefLink, imageTypes, error, buttonAriaLabel, errorButtonLabel, pdfButtonLabel, pdfButtonAriaLabel }: {
2
+ declare function ImageUpload({ title, description, previewLabel, previewContent, uploadLabel, loading, modified, disabled, onChange, onReset, name, labelLink, labelButtonLink, hrefLink, imageTypes, error, buttonAriaLabel, errorButtonLabel }: {
3
3
  title: any;
4
4
  description: any;
5
5
  previewLabel: any;
@@ -18,8 +18,6 @@ declare function ImageUpload({ title, description, previewLabel, previewContent,
18
18
  error?: string | undefined;
19
19
  buttonAriaLabel: any;
20
20
  errorButtonLabel: any;
21
- pdfButtonLabel: any;
22
- pdfButtonAriaLabel: any;
23
21
  }): JSX.Element;
24
22
  declare namespace ImageUpload {
25
23
  const propTypes: {
@@ -45,8 +43,6 @@ declare namespace ImageUpload {
45
43
  modified: PropTypes.Requireable<boolean>;
46
44
  disabled: PropTypes.Requireable<boolean>;
47
45
  children: PropTypes.Requireable<(...args: any[]) => any>;
48
- pdfButtonLabel: PropTypes.Requireable<string>;
49
- pdfButtonAriaLabel: PropTypes.Requireable<string>;
50
46
  };
51
47
  }
52
48
  import PropTypes from "prop-types";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/image-upload/index.js"],"names":[],"mappings":";AAQA;;;;;;;;;;;;;;;;;;;;;gBAkFC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/image-upload/index.js"],"names":[],"mappings":";AAQA;;;;;;;;;;;;;;;;;;;gBAmFC"}
@@ -1,4 +1,7 @@
1
1
  import _isNil from "lodash/fp/isNil";
2
+ import _pipe from "lodash/fp/pipe";
3
+ import _map from "lodash/fp/map";
4
+ import _join from "lodash/fp/join";
2
5
 
3
6
  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); }
4
7
 
@@ -21,22 +24,23 @@ const ImageUpload = ({
21
24
  onChange,
22
25
  onReset = null,
23
26
  name,
27
+ // See ImagePropType for accepted values
24
28
  labelLink,
25
29
  labelButtonLink,
26
30
  hrefLink,
27
- // See ImagePropType for accepted values
28
31
  imageTypes = ['*'],
29
32
  error = '',
30
33
  buttonAriaLabel,
31
- errorButtonLabel,
32
- pdfButtonLabel,
33
- pdfButtonAriaLabel
34
+ errorButtonLabel
34
35
  }) => {
35
36
  const handleReset = useCallback(e => {
36
37
  if (_isNil(onReset)) return;
37
38
  e.preventDefault();
38
39
  return onReset(e);
39
40
  }, [onReset]);
41
+
42
+ const acceptedImages = _pipe(_map(t => `image/${t}`), _join(','))(imageTypes);
43
+
40
44
  const linkCustomStyle = {
41
45
  width: '40px',
42
46
  color: 'red'
@@ -53,13 +57,11 @@ const ImageUpload = ({
53
57
  error: error,
54
58
  disabled: disabled,
55
59
  buttonAriaLabel: buttonAriaLabel,
56
- errorButtonLabel: errorButtonLabel,
57
- pdfButtonLabel: pdfButtonLabel,
58
- pdfButtonAriaLabel: pdfButtonAriaLabel
60
+ errorButtonLabel: errorButtonLabel
59
61
  }, (onDragStart, onDragStop) => /*#__PURE__*/React.createElement("input", {
60
62
  type: "file",
61
63
  name: name,
62
- accept: imageTypes,
64
+ accept: acceptedImages,
63
65
  disabled: loading || disabled,
64
66
  className: style.input,
65
67
  onChange: onChange,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useCallback","PropTypes","DragAndDrop","ImagePropType","Link","style","ImageUpload","title","description","previewLabel","previewContent","uploadLabel","loading","modified","disabled","onChange","onReset","name","labelLink","labelButtonLink","hrefLink","imageTypes","error","buttonAriaLabel","errorButtonLabel","pdfButtonLabel","pdfButtonAriaLabel","handleReset","e","preventDefault","linkCustomStyle","width","color","onDragStart","onDragStop","input","templateLink","href","download","propTypes","string","func","arrayOf"],"sources":["../../../src/atom/image-upload/index.js"],"sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport {isNil} from 'lodash/fp';\nimport DragAndDrop from '../drag-and-drop';\nimport {ImagePropType} from '../../util/proptypes';\nimport Link from '../button-link';\nimport style from './style.css';\n\nconst ImageUpload = ({\n title,\n description,\n previewLabel,\n previewContent,\n uploadLabel,\n loading,\n modified,\n disabled = false,\n onChange,\n onReset = null,\n name,\n labelLink,\n labelButtonLink,\n hrefLink,\n // See ImagePropType for accepted values\n imageTypes = ['*'],\n error = '',\n buttonAriaLabel,\n errorButtonLabel,\n pdfButtonLabel,\n pdfButtonAriaLabel\n}) => {\n const handleReset = useCallback(\n e => {\n if (isNil(onReset)) return;\n e.preventDefault();\n return onReset(e);\n },\n [onReset]\n );\n\n const linkCustomStyle = {\n width: '40px',\n color: 'red'\n };\n\n return (\n <div>\n <DragAndDrop\n title={title}\n description={description}\n previewLabel={previewLabel}\n previewContent={previewContent}\n uploadLabel={uploadLabel}\n loading={loading}\n modified={modified}\n onReset={handleReset}\n error={error}\n disabled={disabled}\n buttonAriaLabel={buttonAriaLabel}\n errorButtonLabel={errorButtonLabel}\n pdfButtonLabel={pdfButtonLabel}\n pdfButtonAriaLabel={pdfButtonAriaLabel}\n >\n {(onDragStart, onDragStop) => (\n <input\n type=\"file\"\n name={name}\n accept={imageTypes}\n disabled={loading || disabled}\n className={style.input}\n onChange={onChange}\n onDragEnter={onDragStart}\n onDrop={onDragStop}\n onDragLeave={onDragStop}\n />\n )}\n </DragAndDrop>\n {labelLink && hrefLink ? (\n <div className={style.templateLink}>\n {labelLink}\n <Link\n type=\"text\"\n customStyle={linkCustomStyle}\n link={{href: hrefLink, download: true}}\n label={labelButtonLink}\n />\n </div>\n ) : null}\n </div>\n );\n};\n\nImageUpload.propTypes = {\n ...DragAndDrop.propTypes,\n name: PropTypes.string,\n onChange: PropTypes.func,\n onReset: PropTypes.func,\n imageTypes: PropTypes.arrayOf(ImagePropType),\n error: PropTypes.string,\n buttonAriaLabel: PropTypes.string,\n errorButtonLabel: PropTypes.string,\n labelLink: PropTypes.string,\n hrefLink: PropTypes.string\n};\n\nexport default ImageUpload;\n"],"mappings":";;;;AAAA,OAAOA,KAAP,IAAeC,WAAf,QAAiC,OAAjC;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,WAAP,MAAwB,kBAAxB;AACA,SAAQC,aAAR,QAA4B,sBAA5B;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,WAAW,GAAG,CAAC;EACnBC,KADmB;EAEnBC,WAFmB;EAGnBC,YAHmB;EAInBC,cAJmB;EAKnBC,WALmB;EAMnBC,OANmB;EAOnBC,QAPmB;EAQnBC,QAAQ,GAAG,KARQ;EASnBC,QATmB;EAUnBC,OAAO,GAAG,IAVS;EAWnBC,IAXmB;EAYnBC,SAZmB;EAanBC,eAbmB;EAcnBC,QAdmB;EAenB;EACAC,UAAU,GAAG,CAAC,GAAD,CAhBM;EAiBnBC,KAAK,GAAG,EAjBW;EAkBnBC,eAlBmB;EAmBnBC,gBAnBmB;EAoBnBC,cApBmB;EAqBnBC;AArBmB,CAAD,KAsBd;EACJ,MAAMC,WAAW,GAAG3B,WAAW,CAC7B4B,CAAC,IAAI;IACH,IAAI,OAAMZ,OAAN,CAAJ,EAAoB;IACpBY,CAAC,CAACC,cAAF;IACA,OAAOb,OAAO,CAACY,CAAD,CAAd;EACD,CAL4B,EAM7B,CAACZ,OAAD,CAN6B,CAA/B;EASA,MAAMc,eAAe,GAAG;IACtBC,KAAK,EAAE,MADe;IAEtBC,KAAK,EAAE;EAFe,CAAxB;EAKA,oBACE,8CACE,oBAAC,WAAD;IACE,KAAK,EAAEzB,KADT;IAEE,WAAW,EAAEC,WAFf;IAGE,YAAY,EAAEC,YAHhB;IAIE,cAAc,EAAEC,cAJlB;IAKE,WAAW,EAAEC,WALf;IAME,OAAO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,SAAS,CAACuC,MATvB;EAUEpB,QAAQ,EAAEnB,SAAS,CAACuC;AAVtB;AAaA,eAAelC,WAAf"}
1
+ {"version":3,"file":"index.js","names":["React","useCallback","PropTypes","DragAndDrop","ImagePropType","Link","style","ImageUpload","title","description","previewLabel","previewContent","uploadLabel","loading","modified","disabled","onChange","onReset","name","labelLink","labelButtonLink","hrefLink","imageTypes","error","buttonAriaLabel","errorButtonLabel","handleReset","e","preventDefault","acceptedImages","t","linkCustomStyle","width","color","onDragStart","onDragStop","input","templateLink","href","download","propTypes","string","func","arrayOf"],"sources":["../../../src/atom/image-upload/index.js"],"sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport {join, map, pipe, isNil} from 'lodash/fp';\nimport DragAndDrop from '../drag-and-drop';\nimport {ImagePropType} from '../../util/proptypes';\nimport Link from '../button-link';\nimport style from './style.css';\n\nconst ImageUpload = ({\n title,\n description,\n previewLabel,\n previewContent,\n uploadLabel,\n loading,\n modified,\n disabled = false,\n onChange,\n onReset = null,\n name,\n // See ImagePropType for accepted values\n labelLink,\n labelButtonLink,\n hrefLink,\n imageTypes = ['*'],\n error = '',\n buttonAriaLabel,\n errorButtonLabel\n}) => {\n const handleReset = useCallback(\n e => {\n if (isNil(onReset)) return;\n e.preventDefault();\n return onReset(e);\n },\n [onReset]\n );\n\n const acceptedImages = pipe(\n map(t => `image/${t}`),\n join(',')\n )(imageTypes);\n\n const linkCustomStyle = {\n width: '40px',\n color: 'red'\n };\n\n return (\n <div>\n <DragAndDrop\n title={title}\n description={description}\n previewLabel={previewLabel}\n previewContent={previewContent}\n uploadLabel={uploadLabel}\n loading={loading}\n modified={modified}\n onReset={handleReset}\n error={error}\n disabled={disabled}\n buttonAriaLabel={buttonAriaLabel}\n errorButtonLabel={errorButtonLabel}\n >\n {(onDragStart, onDragStop) => (\n <input\n type=\"file\"\n name={name}\n accept={acceptedImages}\n disabled={loading || disabled}\n className={style.input}\n onChange={onChange}\n onDragEnter={onDragStart}\n onDrop={onDragStop}\n onDragLeave={onDragStop}\n />\n )}\n </DragAndDrop>\n {labelLink && hrefLink ? (\n <div className={style.templateLink}>\n {labelLink}\n <Link\n type=\"text\"\n customStyle={linkCustomStyle}\n link={{href: hrefLink, download: true}}\n label={labelButtonLink}\n />\n </div>\n ) : null}\n </div>\n );\n};\n\nImageUpload.propTypes = {\n ...DragAndDrop.propTypes,\n name: PropTypes.string,\n onChange: PropTypes.func,\n onReset: PropTypes.func,\n imageTypes: PropTypes.arrayOf(ImagePropType),\n error: PropTypes.string,\n buttonAriaLabel: PropTypes.string,\n errorButtonLabel: PropTypes.string,\n labelLink: PropTypes.string,\n hrefLink: PropTypes.string\n};\n\nexport default ImageUpload;\n"],"mappings":";;;;;;;AAAA,OAAOA,KAAP,IAAeC,WAAf,QAAiC,OAAjC;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,WAAP,MAAwB,kBAAxB;AACA,SAAQC,aAAR,QAA4B,sBAA5B;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,WAAW,GAAG,CAAC;EACnBC,KADmB;EAEnBC,WAFmB;EAGnBC,YAHmB;EAInBC,cAJmB;EAKnBC,WALmB;EAMnBC,OANmB;EAOnBC,QAPmB;EAQnBC,QAAQ,GAAG,KARQ;EASnBC,QATmB;EAUnBC,OAAO,GAAG,IAVS;EAWnBC,IAXmB;EAYnB;EACAC,SAbmB;EAcnBC,eAdmB;EAenBC,QAfmB;EAgBnBC,UAAU,GAAG,CAAC,GAAD,CAhBM;EAiBnBC,KAAK,GAAG,EAjBW;EAkBnBC,eAlBmB;EAmBnBC;AAnBmB,CAAD,KAoBd;EACJ,MAAMC,WAAW,GAAGzB,WAAW,CAC7B0B,CAAC,IAAI;IACH,IAAI,OAAMV,OAAN,CAAJ,EAAoB;IACpBU,CAAC,CAACC,cAAF;IACA,OAAOX,OAAO,CAACU,CAAD,CAAd;EACD,CAL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,CAACqC,SADjB;EAEEtB,IAAI,EAAEhB,SAAS,CAACuC,MAFlB;EAGEzB,QAAQ,EAAEd,SAAS,CAACwC,IAHtB;EAIEzB,OAAO,EAAEf,SAAS,CAACwC,IAJrB;EAKEpB,UAAU,EAAEpB,SAAS,CAACyC,OAAV,CAAkBvC,aAAlB,CALd;EAMEmB,KAAK,EAAErB,SAAS,CAACuC,MANnB;EAOEjB,eAAe,EAAEtB,SAAS,CAACuC,MAP7B;EAQEhB,gBAAgB,EAAEvB,SAAS,CAACuC,MAR9B;EASEtB,SAAS,EAAEjB,SAAS,CAACuC,MATvB;EAUEpB,QAAQ,EAAEnB,SAAS,CAACuC;AAVtB;AAaA,eAAelC,WAAf"}
@@ -31,8 +31,6 @@ declare namespace VideoUpload {
31
31
  error: PropTypes.Requireable<string>;
32
32
  buttonAriaLabel: PropTypes.Requireable<string>;
33
33
  errorButtonLabel: PropTypes.Requireable<string>;
34
- pdfButtonLabel: PropTypes.Requireable<string>;
35
- pdfButtonAriaLabel: PropTypes.Requireable<string>;
36
34
  };
37
35
  }
38
36
  import PropTypes from "prop-types";
@@ -148,8 +148,6 @@ declare namespace BrandFormGroup {
148
148
  modified: PropTypes.Requireable<boolean>;
149
149
  disabled: PropTypes.Requireable<boolean>;
150
150
  children: PropTypes.Requireable<(...args: any[]) => any>;
151
- pdfButtonLabel: PropTypes.Requireable<string>;
152
- pdfButtonAriaLabel: PropTypes.Requireable<string>;
153
151
  }> | PropTypes.InferProps<{
154
152
  type: PropTypes.Requireable<string>;
155
153
  tabProps: PropTypes.Requireable<(PropTypes.InferProps<{
@@ -268,8 +266,6 @@ declare namespace BrandFormGroup {
268
266
  modified: PropTypes.Requireable<boolean>;
269
267
  disabled: PropTypes.Requireable<boolean>;
270
268
  children: PropTypes.Requireable<(...args: any[]) => any>;
271
- pdfButtonLabel: PropTypes.Requireable<string>;
272
- pdfButtonAriaLabel: PropTypes.Requireable<string>;
273
269
  }> | PropTypes.InferProps<{
274
270
  type: PropTypes.Requireable<string>;
275
271
  title: PropTypes.Validator<string>;
@@ -25,8 +25,6 @@ declare namespace DragAndDropWrapper {
25
25
  modified: PropTypes.Requireable<boolean>;
26
26
  disabled: PropTypes.Requireable<boolean>;
27
27
  children: PropTypes.Requireable<(...args: any[]) => any>;
28
- pdfButtonLabel: PropTypes.Requireable<string>;
29
- pdfButtonAriaLabel: PropTypes.Requireable<string>;
30
28
  }> | null | undefined)[]>;
31
29
  'data-name': PropTypes.Requireable<string>;
32
30
  };
@@ -10,5 +10,5 @@
10
10
  .dragAndDrop {
11
11
  margin-right: 16px;
12
12
  width: 202px;
13
- min-height: 183px;
13
+ height: 183px;
14
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/molecule/review-correction-popin/index.native.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAgC,0BAA0B,EAAC,MAAM,cAAc,CAAC;AA6PvF,QAAA,MAAM,qBAAqB,kDAMxB,0BAA0B,uBAiD5B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/molecule/review-correction-popin/index.native.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAgC,0BAA0B,EAAC,MAAM,cAAc,CAAC;AAmQvF,QAAA,MAAM,qBAAqB,kDAMxB,0BAA0B,uBAiD5B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -135,6 +135,7 @@ const createStyleSheet = (theme, type) => StyleSheet.create({
135
135
  shadowRadius: 8
136
136
  },
137
137
  buttonTooltip: {
138
+ zIndex: 20,
138
139
  flexDirection: 'column',
139
140
  justifyContent: 'center',
140
141
  backgroundColor: theme.colors.white,
@@ -144,7 +145,14 @@ const createStyleSheet = (theme, type) => StyleSheet.create({
144
145
  position: 'absolute',
145
146
  bottom: 4,
146
147
  right: -15,
147
- zIndex: 20
148
+ shadowColor: theme.colors.black,
149
+ shadowOpacity: 0.3,
150
+ shadowOffset: {
151
+ width: 0,
152
+ height: 0
153
+ },
154
+ shadowRadius: 8,
155
+ elevation: 6
148
156
  },
149
157
  htmlTooltipText: {
150
158
  color: theme.colors.text.primary,
@@ -154,6 +162,7 @@ const createStyleSheet = (theme, type) => StyleSheet.create({
154
162
  textAlign: 'center'
155
163
  },
156
164
  triangleTooltip: {
165
+ zIndex: 31,
157
166
  width: 0,
158
167
  height: 0,
159
168
  backgroundColor: 'transparent',
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.js","names":["React","useCallback","useEffect","useState","Animated","Easing","StyleSheet","View","NovaCompositionCoorpacademyCheck","RightIcon","NovaSolidStatusClose","WrongIcon","NovaLineLoginKey1","KlfIcon","useAnimateProp","Html","Text","Touchable","useTemplateContext","createStyleSheet","theme","type","create","wrapper","backgroundColor","height","display","justifyContent","popin","padding","spacing","medium","borderRadius","flexDirection","alignItems","colors","negative","positive","shadowColor","shadowOpacity","shadowOffset","width","shadowRadius","elevation","correctionSection","iconCircle","white","opacity","icon","resultLabel","color","fontSize","fontWeight","lineHeight","marginLeft","textTransform","feedbackSection","marginVertical","labelContainer","alignSelf","paddingHorizontal","tiny","paddingVertical","micro","marginBottom","label","extraBold","htmlInfoMessage","button","base","small","buttonText","cta","bold","textAlign","containerButtonKlf","buttonKlf","buttonKlfActive","buttonKlfText","iconKey","marginRight","containerTooltip","zIndex","position","black","buttonTooltip","bottom","right","htmlTooltipText","text","primary","triangleTooltip","borderStyle","borderLeftWidth","borderRightWidth","borderBottomWidth","borderTopWidth","borderLeftColor","borderTopColor","borderRightColor","borderBottomColor","transform","rotate","left","top","KlfButton","klf","styleSheet","displayTooltip","setDisplayTooltip","fadeIn","property","fromValue","toValue","easing","bezier","handlePressKey","start","revert","tooltip","animatedStyle","ICONS","wrong","ReviewCorrectionPopin","information","next","templateContext","setStylesheet","handlePressNext","onClick","Icon","_stylesheet","message"],"sources":["../../../src/molecule/review-correction-popin/index.native.tsx"],"sourcesContent":["import React, {useCallback, useEffect, useState} from 'react';\nimport {Animated, Easing, TextStyle, StyleSheet, View, ViewStyle} from 'react-native';\nimport {\n NovaCompositionCoorpacademyCheck as RightIcon,\n NovaSolidStatusClose as WrongIcon,\n NovaLineLoginKey1 as KlfIcon\n} from '@coorpacademy/nova-icons';\nimport {useAnimateProp} from '@coorpacademy/react-native-animation';\nimport Html from '../../atom/html/index.native';\nimport {Theme} from '../../variables/theme.native';\nimport Text from '../../atom/text/index.native';\nimport Touchable from '../../hoc/touchable/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {ReviewCorrectionPopinKLFProps, ReviewCorrectionPopinProps} from './prop-types';\n\ninterface StyleSheetType {\n wrapper: ViewStyle;\n popin: ViewStyle;\n correctionSection: ViewStyle;\n iconCircle: ViewStyle;\n icon: ViewStyle;\n resultLabel: TextStyle;\n feedbackSection: ViewStyle;\n labelContainer: ViewStyle;\n label: TextStyle;\n htmlInfoMessage: TextStyle;\n button: ViewStyle;\n buttonText: TextStyle;\n buttonKlf: ViewStyle;\n buttonKlfActive: TextStyle;\n buttonKlfText: TextStyle;\n iconKey: ViewStyle;\n containerTooltip: ViewStyle;\n buttonTooltip: ViewStyle;\n containerButtonKlf: ViewStyle;\n triangleTooltip: ViewStyle;\n htmlTooltipText: TextStyle;\n}\n\nconst createStyleSheet = (theme: Theme, type: string): StyleSheetType =>\n StyleSheet.create({\n wrapper: {\n backgroundColor: '#00000000',\n height: 2000,\n display: 'flex',\n justifyContent: 'flex-end'\n },\n popin: {\n padding: theme.spacing.medium,\n borderRadius: 16,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'flex-start',\n backgroundColor: type === 'wrong' ? theme.colors.negative : theme.colors.positive,\n shadowColor: type === 'wrong' ? theme.colors.negative : theme.colors.positive,\n shadowOpacity: 0.5,\n shadowOffset: {width: 0, height: 0},\n shadowRadius: 15,\n elevation: 4\n },\n correctionSection: {\n flexDirection: 'row',\n alignItems: 'center',\n width: '80%'\n },\n iconCircle: {\n width: 60,\n height: 60,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: theme.colors.white,\n opacity: 0.7,\n borderRadius: 50\n },\n icon: {\n height: 30,\n width: 30\n },\n resultLabel: {\n color: theme.colors.white,\n fontSize: 24,\n fontWeight: '600',\n lineHeight: 24,\n marginLeft: 12,\n textTransform: 'uppercase'\n },\n feedbackSection: {\n marginVertical: theme.spacing.medium\n },\n labelContainer: {\n alignSelf: 'flex-start',\n backgroundColor: 'rgba(255, 255, 255, 0.3)',\n borderRadius: 56,\n paddingHorizontal: theme.spacing.tiny,\n paddingVertical: theme.spacing.micro,\n marginBottom: 8\n },\n label: {\n color: theme.colors.white,\n fontSize: 14,\n fontWeight: theme.fontWeight.extraBold,\n lineHeight: 17\n },\n htmlInfoMessage: {\n color: theme.colors.white,\n fontSize: 16,\n fontWeight: '600',\n lineHeight: 19\n },\n button: {\n alignSelf: 'stretch',\n backgroundColor: theme.colors.white,\n borderRadius: 7,\n paddingHorizontal: theme.spacing.base,\n paddingVertical: theme.spacing.small\n },\n buttonText: {\n color: theme.colors.cta,\n fontSize: 14,\n fontWeight: theme.fontWeight.bold,\n lineHeight: 20,\n textAlign: 'center'\n },\n containerButtonKlf: {\n width: '100%'\n },\n buttonKlf: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: 'rgba(255, 255, 255, 0.1)',\n borderRadius: 7,\n paddingHorizontal: theme.spacing.base,\n paddingVertical: theme.spacing.small,\n marginBottom: theme.spacing.tiny\n },\n buttonKlfActive: {\n backgroundColor:\n 'linear-gradient(0deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.25)), rgba(255, 255, 255, 0.1)'\n },\n buttonKlfText: {\n color: 'white',\n fontSize: 14,\n fontWeight: theme.fontWeight.bold,\n lineHeight: 20,\n textAlign: 'center'\n },\n iconKey: {\n width: 12,\n height: 12,\n marginRight: theme.spacing.tiny\n },\n containerTooltip: {\n zIndex: 30,\n position: 'relative',\n shadowColor: theme.colors.black,\n shadowOpacity: 0.3,\n shadowOffset: {width: 0, height: 0},\n shadowRadius: 8\n },\n buttonTooltip: {\n flexDirection: 'column',\n justifyContent: 'center',\n backgroundColor: theme.colors.white,\n borderRadius: 15,\n padding: theme.spacing.small,\n width: '112%',\n position: 'absolute',\n bottom: 4,\n right: -15,\n zIndex: 20\n },\n htmlTooltipText: {\n color: theme.colors.text.primary,\n fontSize: 16,\n fontWeight: '600',\n lineHeight: 22,\n textAlign: 'center'\n },\n triangleTooltip: {\n width: 0,\n height: 0,\n backgroundColor: 'transparent',\n borderStyle: 'solid',\n borderLeftWidth: 13,\n borderRightWidth: 13,\n borderBottomWidth: 13,\n borderTopWidth: 13,\n borderLeftColor: 'transparent',\n borderTopColor: 'transparent',\n borderRightColor: theme.colors.white,\n borderBottomColor: theme.colors.white,\n transform: [{rotate: '45deg'}],\n position: 'absolute',\n left: 110,\n top: -20,\n borderRadius: 4\n }\n });\n\nconst KlfButton = ({\n klf,\n styleSheet\n}: {\n klf: ReviewCorrectionPopinKLFProps;\n styleSheet: StyleSheetType;\n}) => {\n const [displayTooltip, setDisplayTooltip] = useState(false);\n const fadeIn = useAnimateProp({\n property: 'opacity',\n fromValue: 0,\n toValue: 1,\n easing: Easing.bezier(0.25, 1, 0.5, 1)\n });\n\n const handlePressKey = useCallback(() => {\n setDisplayTooltip(!displayTooltip);\n !displayTooltip ? fadeIn.start() : fadeIn.revert();\n }, [displayTooltip, fadeIn]);\n\n const {\n buttonKlf,\n buttonKlfActive,\n buttonKlfText,\n containerButtonKlf,\n containerTooltip,\n buttonTooltip,\n htmlTooltipText,\n iconKey,\n triangleTooltip\n } = styleSheet;\n\n const {label, tooltip} = klf;\n\n return (\n <View style={containerButtonKlf}>\n <Animated.View style={[containerTooltip, fadeIn.animatedStyle]}>\n <Touchable\n style={buttonTooltip}\n accessibilityLabel={`aria-label-tooltip`}\n isHighlight\n onPress={handlePressKey}\n testID=\"button-tooltip\"\n >\n <Html style={htmlTooltipText}>{tooltip}</Html>\n </Touchable>\n <View style={triangleTooltip} />\n </Animated.View>\n <Touchable\n style={displayTooltip ? {...buttonKlf, ...buttonKlfActive} : buttonKlf}\n accessibilityLabel={`aria-label-${label}`}\n onPress={handlePressKey}\n testID=\"button-klf\"\n >\n <KlfIcon style={iconKey} color=\"white\" />\n <Text style={buttonKlfText}>{label}</Text>\n </Touchable>\n </View>\n );\n};\n\nconst ICONS = {\n right: RightIcon,\n wrong: WrongIcon\n};\n\nconst ReviewCorrectionPopin = ({\n information,\n klf,\n next,\n type,\n resultLabel\n}: ReviewCorrectionPopinProps) => {\n const templateContext = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const {theme} = templateContext;\n const handlePressNext = next.onClick;\n\n const Icon = ICONS[type];\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme, type);\n setStylesheet(_stylesheet);\n }, [theme, type]);\n\n if (!styleSheet) {\n return null;\n }\n\n return (\n <View style={styleSheet.wrapper}>\n <View style={styleSheet.popin}>\n <View style={styleSheet.correctionSection}>\n <View style={styleSheet.iconCircle}>\n <Icon\n style={styleSheet.icon}\n color={type === 'wrong' ? theme.colors.negative : theme.colors.positive}\n />\n </View>\n <Text style={styleSheet.resultLabel}>{resultLabel}</Text>\n </View>\n <View style={styleSheet.feedbackSection} accessibilityLabel=\"answer-information\">\n <View style={styleSheet.labelContainer} needsOffscreenAlphaCompositing>\n <Text accessibilityLabel={information.label} style={styleSheet.label}>\n {information.label}\n </Text>\n </View>\n <Html style={styleSheet.htmlInfoMessage}>{information.message}</Html>\n </View>\n {klf && type === 'wrong' ? <KlfButton styleSheet={styleSheet} klf={klf} /> : null}\n <Touchable\n style={styleSheet.button}\n onPress={handlePressNext}\n accessibilityLabel={next['aria-label']}\n testID={next['data-name']}\n >\n <Text style={styleSheet.buttonText}>{next.label}</Text>\n </Touchable>\n </View>\n </View>\n );\n};\n\nexport default ReviewCorrectionPopin;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,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EA,IAAI,CAAC,WAAD;EAJd,gBAME,oBAAC,IAAD;IAAM,KAAK,EAAElB,UAAU,CAACpC;EAAxB,GAAqCsD,IAAI,CAAC5D,KAA1C,CANF,CAnBF,CADF,CADF;AAgCD,CAvDD;;AAyDA,eAAe0D,qBAAf"}
1
+ {"version":3,"file":"index.native.js","names":["React","useCallback","useEffect","useState","Animated","Easing","StyleSheet","View","NovaCompositionCoorpacademyCheck","RightIcon","NovaSolidStatusClose","WrongIcon","NovaLineLoginKey1","KlfIcon","useAnimateProp","Html","Text","Touchable","useTemplateContext","createStyleSheet","theme","type","create","wrapper","backgroundColor","height","display","justifyContent","popin","padding","spacing","medium","borderRadius","flexDirection","alignItems","colors","negative","positive","shadowColor","shadowOpacity","shadowOffset","width","shadowRadius","elevation","correctionSection","iconCircle","white","opacity","icon","resultLabel","color","fontSize","fontWeight","lineHeight","marginLeft","textTransform","feedbackSection","marginVertical","labelContainer","alignSelf","paddingHorizontal","tiny","paddingVertical","micro","marginBottom","label","extraBold","htmlInfoMessage","button","base","small","buttonText","cta","bold","textAlign","containerButtonKlf","buttonKlf","buttonKlfActive","buttonKlfText","iconKey","marginRight","containerTooltip","zIndex","position","black","buttonTooltip","bottom","right","htmlTooltipText","text","primary","triangleTooltip","borderStyle","borderLeftWidth","borderRightWidth","borderBottomWidth","borderTopWidth","borderLeftColor","borderTopColor","borderRightColor","borderBottomColor","transform","rotate","left","top","KlfButton","klf","styleSheet","displayTooltip","setDisplayTooltip","fadeIn","property","fromValue","toValue","easing","bezier","handlePressKey","start","revert","tooltip","animatedStyle","ICONS","wrong","ReviewCorrectionPopin","information","next","templateContext","setStylesheet","handlePressNext","onClick","Icon","_stylesheet","message"],"sources":["../../../src/molecule/review-correction-popin/index.native.tsx"],"sourcesContent":["import React, {useCallback, useEffect, useState} from 'react';\nimport {Animated, Easing, TextStyle, StyleSheet, View, ViewStyle} from 'react-native';\nimport {\n NovaCompositionCoorpacademyCheck as RightIcon,\n NovaSolidStatusClose as WrongIcon,\n NovaLineLoginKey1 as KlfIcon\n} from '@coorpacademy/nova-icons';\nimport {useAnimateProp} from '@coorpacademy/react-native-animation';\nimport Html from '../../atom/html/index.native';\nimport {Theme} from '../../variables/theme.native';\nimport Text from '../../atom/text/index.native';\nimport Touchable from '../../hoc/touchable/index.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {ReviewCorrectionPopinKLFProps, ReviewCorrectionPopinProps} from './prop-types';\n\ninterface StyleSheetType {\n wrapper: ViewStyle;\n popin: ViewStyle;\n correctionSection: ViewStyle;\n iconCircle: ViewStyle;\n icon: ViewStyle;\n resultLabel: TextStyle;\n feedbackSection: ViewStyle;\n labelContainer: ViewStyle;\n label: TextStyle;\n htmlInfoMessage: TextStyle;\n button: ViewStyle;\n buttonText: TextStyle;\n buttonKlf: ViewStyle;\n buttonKlfActive: TextStyle;\n buttonKlfText: TextStyle;\n iconKey: ViewStyle;\n containerTooltip: ViewStyle;\n buttonTooltip: ViewStyle;\n containerButtonKlf: ViewStyle;\n triangleTooltip: ViewStyle;\n htmlTooltipText: TextStyle;\n}\n\nconst createStyleSheet = (theme: Theme, type: string): StyleSheetType =>\n StyleSheet.create({\n wrapper: {\n backgroundColor: '#00000000',\n height: 2000,\n display: 'flex',\n justifyContent: 'flex-end'\n },\n popin: {\n padding: theme.spacing.medium,\n borderRadius: 16,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'flex-start',\n backgroundColor: type === 'wrong' ? theme.colors.negative : theme.colors.positive,\n shadowColor: type === 'wrong' ? theme.colors.negative : theme.colors.positive,\n shadowOpacity: 0.5,\n shadowOffset: {width: 0, height: 0},\n shadowRadius: 15,\n elevation: 4\n },\n correctionSection: {\n flexDirection: 'row',\n alignItems: 'center',\n width: '80%'\n },\n iconCircle: {\n width: 60,\n height: 60,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: theme.colors.white,\n opacity: 0.7,\n borderRadius: 50\n },\n icon: {\n height: 30,\n width: 30\n },\n resultLabel: {\n color: theme.colors.white,\n fontSize: 24,\n fontWeight: '600',\n lineHeight: 24,\n marginLeft: 12,\n textTransform: 'uppercase'\n },\n feedbackSection: {\n marginVertical: theme.spacing.medium\n },\n labelContainer: {\n alignSelf: 'flex-start',\n backgroundColor: 'rgba(255, 255, 255, 0.3)',\n borderRadius: 56,\n paddingHorizontal: theme.spacing.tiny,\n paddingVertical: theme.spacing.micro,\n marginBottom: 8\n },\n label: {\n color: theme.colors.white,\n fontSize: 14,\n fontWeight: theme.fontWeight.extraBold,\n lineHeight: 17\n },\n htmlInfoMessage: {\n color: theme.colors.white,\n fontSize: 16,\n fontWeight: '600',\n lineHeight: 19\n },\n button: {\n alignSelf: 'stretch',\n backgroundColor: theme.colors.white,\n borderRadius: 7,\n paddingHorizontal: theme.spacing.base,\n paddingVertical: theme.spacing.small\n },\n buttonText: {\n color: theme.colors.cta,\n fontSize: 14,\n fontWeight: theme.fontWeight.bold,\n lineHeight: 20,\n textAlign: 'center'\n },\n containerButtonKlf: {\n width: '100%'\n },\n buttonKlf: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: 'rgba(255, 255, 255, 0.1)',\n borderRadius: 7,\n paddingHorizontal: theme.spacing.base,\n paddingVertical: theme.spacing.small,\n marginBottom: theme.spacing.tiny\n },\n buttonKlfActive: {\n backgroundColor:\n 'linear-gradient(0deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.25)), rgba(255, 255, 255, 0.1)'\n },\n buttonKlfText: {\n color: 'white',\n fontSize: 14,\n fontWeight: theme.fontWeight.bold,\n lineHeight: 20,\n textAlign: 'center'\n },\n iconKey: {\n width: 12,\n height: 12,\n marginRight: theme.spacing.tiny\n },\n containerTooltip: {\n zIndex: 30,\n position: 'relative',\n shadowColor: theme.colors.black,\n shadowOpacity: 0.3,\n shadowOffset: {width: 0, height: 0},\n shadowRadius: 8\n },\n buttonTooltip: {\n zIndex: 20,\n flexDirection: 'column',\n justifyContent: 'center',\n backgroundColor: theme.colors.white,\n borderRadius: 15,\n padding: theme.spacing.small,\n width: '112%',\n position: 'absolute',\n bottom: 4,\n right: -15,\n shadowColor: theme.colors.black,\n shadowOpacity: 0.3,\n shadowOffset: {width: 0, height: 0},\n shadowRadius: 8,\n elevation: 6\n },\n htmlTooltipText: {\n color: theme.colors.text.primary,\n fontSize: 16,\n fontWeight: '600',\n lineHeight: 22,\n textAlign: 'center'\n },\n triangleTooltip: {\n zIndex: 31,\n width: 0,\n height: 0,\n backgroundColor: 'transparent',\n borderStyle: 'solid',\n borderLeftWidth: 13,\n borderRightWidth: 13,\n borderBottomWidth: 13,\n borderTopWidth: 13,\n borderLeftColor: 'transparent',\n borderTopColor: 'transparent',\n borderRightColor: theme.colors.white,\n borderBottomColor: theme.colors.white,\n transform: [{rotate: '45deg'}],\n position: 'absolute',\n left: 110,\n top: -20,\n borderRadius: 4\n }\n });\n\nconst KlfButton = ({\n klf,\n styleSheet\n}: {\n klf: ReviewCorrectionPopinKLFProps;\n styleSheet: StyleSheetType;\n}) => {\n const [displayTooltip, setDisplayTooltip] = useState(false);\n const fadeIn = useAnimateProp({\n property: 'opacity',\n fromValue: 0,\n toValue: 1,\n easing: Easing.bezier(0.25, 1, 0.5, 1)\n });\n\n const handlePressKey = useCallback(() => {\n setDisplayTooltip(!displayTooltip);\n !displayTooltip ? fadeIn.start() : fadeIn.revert();\n }, [displayTooltip, fadeIn]);\n\n const {\n buttonKlf,\n buttonKlfActive,\n buttonKlfText,\n containerButtonKlf,\n containerTooltip,\n buttonTooltip,\n htmlTooltipText,\n iconKey,\n triangleTooltip\n } = styleSheet;\n\n const {label, tooltip} = klf;\n\n return (\n <View style={containerButtonKlf}>\n <Animated.View style={[containerTooltip, fadeIn.animatedStyle]}>\n <Touchable\n style={buttonTooltip}\n accessibilityLabel={`aria-label-tooltip`}\n isHighlight\n onPress={handlePressKey}\n testID=\"button-tooltip\"\n >\n <Html style={htmlTooltipText}>{tooltip}</Html>\n </Touchable>\n <View style={triangleTooltip} />\n </Animated.View>\n <Touchable\n style={displayTooltip ? {...buttonKlf, ...buttonKlfActive} : buttonKlf}\n accessibilityLabel={`aria-label-${label}`}\n onPress={handlePressKey}\n testID=\"button-klf\"\n >\n <KlfIcon style={iconKey} color=\"white\" />\n <Text style={buttonKlfText}>{label}</Text>\n </Touchable>\n </View>\n );\n};\n\nconst ICONS = {\n right: RightIcon,\n wrong: WrongIcon\n};\n\nconst ReviewCorrectionPopin = ({\n information,\n klf,\n next,\n type,\n resultLabel\n}: ReviewCorrectionPopinProps) => {\n const templateContext = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const {theme} = templateContext;\n const handlePressNext = next.onClick;\n\n const Icon = ICONS[type];\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme, type);\n setStylesheet(_stylesheet);\n }, [theme, type]);\n\n if (!styleSheet) {\n return null;\n }\n\n return (\n <View style={styleSheet.wrapper}>\n <View style={styleSheet.popin}>\n <View style={styleSheet.correctionSection}>\n <View style={styleSheet.iconCircle}>\n <Icon\n style={styleSheet.icon}\n color={type === 'wrong' ? theme.colors.negative : theme.colors.positive}\n />\n </View>\n <Text style={styleSheet.resultLabel}>{resultLabel}</Text>\n </View>\n <View style={styleSheet.feedbackSection} accessibilityLabel=\"answer-information\">\n <View style={styleSheet.labelContainer} needsOffscreenAlphaCompositing>\n <Text accessibilityLabel={information.label} style={styleSheet.label}>\n {information.label}\n </Text>\n </View>\n <Html style={styleSheet.htmlInfoMessage}>{information.message}</Html>\n </View>\n {klf && type === 'wrong' ? <KlfButton styleSheet={styleSheet} klf={klf} /> : null}\n <Touchable\n style={styleSheet.button}\n onPress={handlePressNext}\n accessibilityLabel={next['aria-label']}\n testID={next['data-name']}\n >\n <Text style={styleSheet.buttonText}>{next.label}</Text>\n </Touchable>\n </View>\n </View>\n );\n};\n\nexport default ReviewCorrectionPopin;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,SAA5B,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,SAAD;IAAW,UAAU,EAAEsF,UAAvB;IAAmC,GAAG,EAAED;EAAxC,EAA1B,GAA4E,IAlB/E,eAmBE,oBAAC,SAAD;IACE,KAAK,EAAEC,UAAU,CAACvC,MADpB;IAEE,OAAO,EAAE4D,eAFX;IAGE,kBAAkB,EAAEH,IAAI,CAAC,YAAD,CAH1B;IAIE,MAAM,EAAEA,IAAI,CAAC,WAAD;EAJd,gBAME,oBAAC,IAAD;IAAM,KAAK,EAAElB,UAAU,CAACpC;EAAxB,GAAqCsD,IAAI,CAAC5D,KAA1C,CANF,CAnBF,CADF,CADF;AAgCD,CAvDD;;AAyDA,eAAe0D,qBAAf"}
@@ -105,8 +105,6 @@ declare namespace SetupSlide {
105
105
  modified: PropTypes.Requireable<boolean>;
106
106
  disabled: PropTypes.Requireable<boolean>;
107
107
  children: PropTypes.Requireable<(...args: any[]) => any>;
108
- pdfButtonLabel: PropTypes.Requireable<string>;
109
- pdfButtonAriaLabel: PropTypes.Requireable<string>;
110
108
  }> | PropTypes.InferProps<{
111
109
  type: PropTypes.Requireable<string>;
112
110
  title: PropTypes.Validator<string>;
@@ -118,8 +118,6 @@ declare namespace SetupSlider {
118
118
  modified: PropTypes.Requireable<boolean>;
119
119
  disabled: PropTypes.Requireable<boolean>;
120
120
  children: PropTypes.Requireable<(...args: any[]) => any>;
121
- pdfButtonLabel: PropTypes.Requireable<string>;
122
- pdfButtonAriaLabel: PropTypes.Requireable<string>;
123
121
  }> | PropTypes.InferProps<{
124
122
  type: PropTypes.Requireable<string>;
125
123
  title: PropTypes.Validator<string>;
@@ -65,8 +65,6 @@ declare namespace TitleAndCheckBoxWrapper {
65
65
  modified: PropTypes.Requireable<boolean>;
66
66
  disabled: PropTypes.Requireable<boolean>;
67
67
  children: PropTypes.Requireable<(...args: any[]) => any>;
68
- pdfButtonLabel: PropTypes.Requireable<string>;
69
- pdfButtonAriaLabel: PropTypes.Requireable<string>;
70
68
  }> | null | undefined)[]>;
71
69
  'data-name': PropTypes.Requireable<string>;
72
70
  }> | null | undefined>>;
@@ -178,8 +178,6 @@ declare namespace BrandForm {
178
178
  modified: PropTypes.Requireable<boolean>;
179
179
  disabled: PropTypes.Requireable<boolean>;
180
180
  children: PropTypes.Requireable<(...args: any[]) => any>;
181
- pdfButtonLabel: PropTypes.Requireable<string>;
182
- pdfButtonAriaLabel: PropTypes.Requireable<string>;
183
181
  }> | PropTypes.InferProps<{
184
182
  type: PropTypes.Requireable<string>;
185
183
  tabProps: PropTypes.Requireable<(PropTypes.InferProps<{
@@ -298,8 +296,6 @@ declare namespace BrandForm {
298
296
  modified: PropTypes.Requireable<boolean>;
299
297
  disabled: PropTypes.Requireable<boolean>;
300
298
  children: PropTypes.Requireable<(...args: any[]) => any>;
301
- pdfButtonLabel: PropTypes.Requireable<string>;
302
- pdfButtonAriaLabel: PropTypes.Requireable<string>;
303
299
  }> | PropTypes.InferProps<{
304
300
  type: PropTypes.Requireable<string>;
305
301
  title: PropTypes.Validator<string>;
@@ -31,7 +31,6 @@ declare namespace ListItem {
31
31
  title: PropTypes.Validator<string>;
32
32
  order: PropTypes.Requireable<number>;
33
33
  'aria-label': PropTypes.Requireable<string>;
34
- contentType: PropTypes.Requireable<string>;
35
34
  };
36
35
  }
37
36
  import PropTypes from "prop-types";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/list-item/index.js"],"names":[],"mappings":";AAQA,mDA4CC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/list-item/index.js"],"names":[],"mappings":";AAQA,mDAqCC"}
@@ -14,8 +14,7 @@ const ListItem = props => {
14
14
  tags,
15
15
  title,
16
16
  order,
17
- 'aria-label': ariaLabel,
18
- contentType
17
+ 'aria-label': ariaLabel
19
18
  } = props;
20
19
 
21
20
  const tagsView = _map.convert({
@@ -30,7 +29,7 @@ const ListItem = props => {
30
29
 
31
30
  return /*#__PURE__*/React.createElement("div", {
32
31
  className: style.wrapper
33
- }, isPublished && contentType === 'certification' ? /*#__PURE__*/React.createElement("div", {
32
+ }, isPublished ? /*#__PURE__*/React.createElement("div", {
34
33
  className: style.orderWrapper
35
34
  }, /*#__PURE__*/React.createElement("div", {
36
35
  className: style.order,
@@ -77,8 +76,7 @@ ListItem.propTypes = process.env.NODE_ENV !== "production" ? {
77
76
  })),
78
77
  title: PropTypes.string.isRequired,
79
78
  order: PropTypes.number,
80
- 'aria-label': PropTypes.string,
81
- contentType: PropTypes.string
79
+ 'aria-label': PropTypes.string
82
80
  } : {};
83
81
  export default ListItem;
84
82
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","PropTypes","Tag","ButtonLink","BulletPointMenuButton","style","ListItem","props","isPublished","bulletPointMenuButton","buttonLink","tags","title","order","ariaLabel","contentType","tagsView","convert","cap","tag","index","type","wrapper","orderWrapper","settings","edit","propTypes","shape","buttonAriaLabel","string","menuAriaLabel","buttons","arrayOf","label","onClick","func","dataName","icon","position","oneOf","isRequired","number"],"sources":["../../../src/organism/list-item/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {map} from 'lodash/fp';\nimport Tag from '../../atom/tag';\nimport ButtonLink from '../../atom/button-link';\nimport BulletPointMenuButton from '../../molecule/bullet-point-menu-button';\nimport style from './style.css';\n\nconst ListItem = props => {\n let isPublished = false;\n const {\n bulletPointMenuButton,\n buttonLink,\n tags,\n title,\n order,\n 'aria-label': ariaLabel,\n contentType\n } = props;\n const tagsView = map.convert({cap: false})((tag, index) => {\n isPublished = tag.type === 'published';\n return (\n <div key={index} className={style.tag}>\n <Tag {...tag} />\n </div>\n );\n })(tags);\n return (\n <div className={style.wrapper}>\n {isPublished && contentType === 'certification' ? (\n <div className={style.orderWrapper}>\n <div className={style.order} aria-label={ariaLabel}>\n {order + 1}\n </div>\n <div className={style.title} title={title}>\n {title}\n </div>\n </div>\n ) : (\n <div className={style.title} title={title}>\n {title}\n </div>\n )}\n <div className={style.settings}>\n {tagsView}\n <div className={style.edit}>\n <ButtonLink {...buttonLink} />\n </div>\n <BulletPointMenuButton {...bulletPointMenuButton} />\n </div>\n </div>\n );\n};\n\nListItem.propTypes = {\n bulletPointMenuButton: PropTypes.shape({\n buttonAriaLabel: PropTypes.string,\n menuAriaLabel: PropTypes.string,\n buttons: PropTypes.arrayOf(\n PropTypes.shape({\n 'data-name': PropTypes.string,\n label: PropTypes.string,\n type: PropTypes.string,\n onClick: PropTypes.func\n })\n ),\n onClick: PropTypes.func\n }),\n buttonLink: PropTypes.shape({\n type: PropTypes.string,\n label: PropTypes.string,\n ariaLabel: PropTypes.string,\n dataName: PropTypes.string,\n icon: PropTypes.shape({\n position: PropTypes.string,\n type: PropTypes.string\n }),\n onClick: PropTypes.func\n }),\n tags: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n type: PropTypes.oneOf(['published', 'draft', 'archived', 'revised', 'default'])\n })\n ),\n title: PropTypes.string.isRequired,\n order: PropTypes.number,\n 'aria-label': PropTypes.string,\n contentType: PropTypes.string\n};\n\nexport default ListItem;\n"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,GAAP,MAAgB,gBAAhB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,qBAAP,MAAkC,yCAAlC;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,QAAQ,GAAGC,KAAK,IAAI;EACxB,IAAIC,WAAW,GAAG,KAAlB;EACA,MAAM;IACJC,qBADI;IAEJC,UAFI;IAGJC,IAHI;IAIJC,KAJI;IAKJC,KALI;IAMJ,cAAcC,SANV;IAOJC;EAPI,IAQFR,KARJ;;EASA,MAAMS,QAAQ,GAAG,KAAIC,OAAJ,CAAY;IAACC,GAAG,EAAE;EAAN,CAAZ,EAA0B,CAACC,GAAD,EAAMC,KAAN,KAAgB;IACzDZ,WAAW,GAAGW,GAAG,CAACE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CD,OAAO,EAAEjC,SAAS,CAACkC;EAXkB,CAAhB,CADJ;EAcnBzB,UAAU,EAAET,SAAS,CAAC0B,KAAV,CAAgB;IAC1BN,IAAI,EAAEpB,SAAS,CAAC4B,MADU;IAE1BI,KAAK,EAAEhC,SAAS,CAAC4B,MAFS;IAG1Bf,SAAS,EAAEb,SAAS,CAAC4B,MAHK;IAI1BO,QAAQ,EAAEnC,SAAS,CAAC4B,MAJM;IAK1BQ,IAAI,EAAEpC,SAAS,CAAC0B,KAAV,CAAgB;MACpBW,QAAQ,EAAErC,SAAS,CAAC4B,MADA;MAEpBR,IAAI,EAAEpB,SAAS,CAAC4B;IAFI,CAAhB,CALoB;IAS1BK,OAAO,EAAEjC,SAAS,CAACkC;EATO,CAAhB,CAdO;EAyBnBxB,IAAI,EAAEV,SAAS,CAAC+B,OAAV,CACJ/B,SAAS,CAAC0B,KAAV,CAAgB;IACdM,KAAK,EAAEhC,SAAS,CAAC4B,MADH;IAEdR,IAAI,EAAEpB,SAAS,CAACsC,KAAV,CAAgB,CAAC,WAAD,EAAc,OAAd,EAAuB,UAAvB,EAAmC,SAAnC,EAA8C,SAA9C,CAAhB;EAFQ,CAAhB,CADI,CAzBa;EA+BnB3B,KAAK,EAAEX,SAAS,CAAC4B,MAAV,CAAiBW,UA/BL;EAgCnB3B,KAAK,EAAEZ,SAAS,CAACwC,MAhCE;EAiCnB,cAAcxC,SAAS,CAAC4B,MAjCL;EAkCnBd,WAAW,EAAEd,SAAS,CAAC4B;AAlCJ,CAArB;AAqCA,eAAevB,QAAf"}
1
+ {"version":3,"file":"index.js","names":["React","PropTypes","Tag","ButtonLink","BulletPointMenuButton","style","ListItem","props","isPublished","bulletPointMenuButton","buttonLink","tags","title","order","ariaLabel","tagsView","convert","cap","tag","index","type","wrapper","orderWrapper","settings","edit","propTypes","shape","buttonAriaLabel","string","menuAriaLabel","buttons","arrayOf","label","onClick","func","dataName","icon","position","oneOf","isRequired","number"],"sources":["../../../src/organism/list-item/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {map} from 'lodash/fp';\nimport Tag from '../../atom/tag';\nimport ButtonLink from '../../atom/button-link';\nimport BulletPointMenuButton from '../../molecule/bullet-point-menu-button';\nimport style from './style.css';\n\nconst ListItem = props => {\n let isPublished = false;\n const {bulletPointMenuButton, buttonLink, tags, title, order, 'aria-label': ariaLabel} = props;\n\n const tagsView = map.convert({cap: false})((tag, index) => {\n isPublished = tag.type === 'published';\n return (\n <div key={index} className={style.tag}>\n <Tag {...tag} />\n </div>\n );\n })(tags);\n return (\n <div className={style.wrapper}>\n {isPublished ? (\n <div className={style.orderWrapper}>\n <div className={style.order} aria-label={ariaLabel}>\n {order + 1}\n </div>\n <div className={style.title} title={title}>\n {title}\n </div>\n </div>\n ) : (\n <div className={style.title} title={title}>\n {title}\n </div>\n )}\n <div className={style.settings}>\n {tagsView}\n <div className={style.edit}>\n <ButtonLink {...buttonLink} />\n </div>\n <BulletPointMenuButton {...bulletPointMenuButton} />\n </div>\n </div>\n );\n};\n\nListItem.propTypes = {\n bulletPointMenuButton: PropTypes.shape({\n buttonAriaLabel: PropTypes.string,\n menuAriaLabel: PropTypes.string,\n buttons: PropTypes.arrayOf(\n PropTypes.shape({\n 'data-name': PropTypes.string,\n label: PropTypes.string,\n type: PropTypes.string,\n onClick: PropTypes.func\n })\n ),\n onClick: PropTypes.func\n }),\n buttonLink: PropTypes.shape({\n type: PropTypes.string,\n label: PropTypes.string,\n ariaLabel: PropTypes.string,\n dataName: PropTypes.string,\n icon: PropTypes.shape({\n position: PropTypes.string,\n type: PropTypes.string\n }),\n onClick: PropTypes.func\n }),\n tags: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n type: PropTypes.oneOf(['published', 'draft', 'archived', 'revised', 'default'])\n })\n ),\n title: PropTypes.string.isRequired,\n order: PropTypes.number,\n 'aria-label': PropTypes.string\n};\n\nexport default ListItem;\n"],"mappings":";AAAA,OAAOA,KAAP,MAAkB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AzBa;EA+BnB1B,KAAK,EAAEX,SAAS,CAAC2B,MAAV,CAAiBW,UA/BL;EAgCnB1B,KAAK,EAAEZ,SAAS,CAACuC,MAhCE;EAiCnB,cAAcvC,SAAS,CAAC2B;AAjCL,CAArB;AAoCA,eAAetB,QAAf"}
@@ -58,7 +58,6 @@ declare namespace ListItems {
58
58
  title: PropTypes.Validator<string>;
59
59
  order: PropTypes.Requireable<number>;
60
60
  'aria-label': PropTypes.Requireable<string>;
61
- contentType: PropTypes.Requireable<string>;
62
61
  }> | null | undefined)[]>;
63
62
  title: PropTypes.Requireable<string>;
64
63
  };