@coorpacademy/components 11.12.1-alpha.2 → 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.
- package/es/atom/drag-and-drop/index.d.ts +0 -2
- package/es/atom/drag-and-drop/index.d.ts.map +1 -1
- package/es/atom/drag-and-drop/index.js +2 -26
- package/es/atom/drag-and-drop/index.js.map +1 -1
- package/es/atom/drag-and-drop/style.css +5 -21
- package/es/atom/image-upload/index.d.ts +1 -5
- package/es/atom/image-upload/index.d.ts.map +1 -1
- package/es/atom/image-upload/index.js +10 -8
- package/es/atom/image-upload/index.js.map +1 -1
- package/es/atom/video-upload/index.d.ts +0 -2
- package/es/molecule/brand-form-group/index.d.ts +0 -4
- package/es/molecule/drag-and-drop-wrapper/index.d.ts +0 -2
- package/es/molecule/drag-and-drop-wrapper/style.css +1 -1
- package/es/molecule/review-correction-popin/index.native.d.ts.map +1 -1
- package/es/molecule/review-correction-popin/index.native.js +10 -1
- package/es/molecule/review-correction-popin/index.native.js.map +1 -1
- package/es/molecule/setup-slide/index.d.ts +0 -2
- package/es/molecule/setup-slider/index.d.ts +0 -2
- package/es/molecule/title-and-checkbox-wrapper/index.d.ts +0 -2
- package/es/organism/brand-form/index.d.ts +0 -4
- package/es/organism/list-item/index.d.ts +0 -1
- package/es/organism/list-item/index.d.ts.map +1 -1
- package/es/organism/list-item/index.js +3 -5
- package/es/organism/list-item/index.js.map +1 -1
- package/es/organism/list-items/index.d.ts +1 -4
- package/es/organism/list-items/index.d.ts.map +1 -1
- package/es/organism/list-items/index.js +3 -6
- package/es/organism/list-items/index.js.map +1 -1
- package/es/organism/review-skills/index.native.js +1 -1
- package/es/organism/review-skills/index.native.js.map +1 -1
- package/es/organism/review-slide/index.native.d.ts.map +1 -1
- package/es/organism/review-slide/index.native.js +3 -3
- package/es/organism/review-slide/index.native.js.map +1 -1
- package/es/organism/rewards-form/index.d.ts +0 -2
- package/es/organism/wizard-contents/index.d.ts +0 -6
- package/es/template/back-office/brand-update/index.d.ts +0 -12
- package/es/template/back-office/brand-update/index.js +1 -2
- package/es/template/back-office/brand-update/index.js.map +1 -1
- package/es/template/cockpit/jw-uploader/index.d.ts +0 -2
- package/es/util/button-icons.d.ts +0 -1
- package/es/util/button-icons.d.ts.map +1 -1
- package/es/util/button-icons.js +2 -3
- package/es/util/button-icons.js.map +1 -1
- package/es/util/proptypes.d.ts.map +1 -1
- package/es/util/proptypes.js +2 -2
- package/es/util/proptypes.js.map +1 -1
- package/lib/atom/drag-and-drop/index.d.ts +0 -2
- package/lib/atom/drag-and-drop/index.d.ts.map +1 -1
- package/lib/atom/drag-and-drop/index.js +2 -26
- package/lib/atom/drag-and-drop/index.js.map +1 -1
- package/lib/atom/drag-and-drop/style.css +5 -21
- package/lib/atom/image-upload/index.d.ts +1 -5
- package/lib/atom/image-upload/index.d.ts.map +1 -1
- package/lib/atom/image-upload/index.js +11 -8
- package/lib/atom/image-upload/index.js.map +1 -1
- package/lib/atom/video-upload/index.d.ts +0 -2
- package/lib/molecule/brand-form-group/index.d.ts +0 -4
- package/lib/molecule/drag-and-drop-wrapper/index.d.ts +0 -2
- package/lib/molecule/drag-and-drop-wrapper/style.css +1 -1
- package/lib/molecule/review-correction-popin/index.native.d.ts.map +1 -1
- package/lib/molecule/review-correction-popin/index.native.js +10 -1
- package/lib/molecule/review-correction-popin/index.native.js.map +1 -1
- package/lib/molecule/setup-slide/index.d.ts +0 -2
- package/lib/molecule/setup-slider/index.d.ts +0 -2
- package/lib/molecule/title-and-checkbox-wrapper/index.d.ts +0 -2
- package/lib/organism/brand-form/index.d.ts +0 -4
- package/lib/organism/list-item/index.d.ts +0 -1
- package/lib/organism/list-item/index.d.ts.map +1 -1
- package/lib/organism/list-item/index.js +3 -5
- package/lib/organism/list-item/index.js.map +1 -1
- package/lib/organism/list-items/index.d.ts +1 -4
- package/lib/organism/list-items/index.d.ts.map +1 -1
- package/lib/organism/list-items/index.js +3 -6
- package/lib/organism/list-items/index.js.map +1 -1
- package/lib/organism/review-skills/index.native.js +1 -1
- package/lib/organism/review-skills/index.native.js.map +1 -1
- package/lib/organism/review-slide/index.native.d.ts.map +1 -1
- package/lib/organism/review-slide/index.native.js +3 -3
- package/lib/organism/review-slide/index.native.js.map +1 -1
- package/lib/organism/rewards-form/index.d.ts +0 -2
- package/lib/organism/wizard-contents/index.d.ts +0 -6
- package/lib/template/back-office/brand-update/index.d.ts +0 -12
- package/lib/template/back-office/brand-update/index.js +1 -2
- package/lib/template/back-office/brand-update/index.js.map +1 -1
- package/lib/template/cockpit/jw-uploader/index.d.ts +0 -2
- package/lib/util/button-icons.d.ts +0 -1
- package/lib/util/button-icons.d.ts.map +1 -1
- package/lib/util/button-icons.js +1 -2
- package/lib/util/button-icons.js.map +1 -1
- package/lib/util/proptypes.d.ts.map +1 -1
- package/lib/util/proptypes.js +2 -2
- package/lib/util/proptypes.js.map +1 -1
- package/locales/.mtslconfig.json +1 -0
- package/locales/bs/global.json +4 -1
- package/locales/cs/global.json +4 -1
- package/locales/de/global.json +4 -1
- package/locales/es/global.json +4 -1
- package/locales/et/global.json +4 -1
- package/locales/fr/global.json +4 -1
- package/locales/hr/global.json +4 -1
- package/locales/hu/global.json +4 -1
- package/locales/hy/global.json +4 -1
- package/locales/it/global.json +4 -1
- package/locales/ja/global.json +4 -1
- package/locales/ko/global.json +4 -1
- package/locales/nl/global.json +4 -1
- package/locales/pl/global.json +4 -1
- package/locales/pt/global.json +4 -1
- package/locales/ro/global.json +4 -1
- package/locales/ru/global.json +4 -1
- package/locales/sk/global.json +4 -1
- package/locales/th/global.json +4 -1
- package/locales/tl/global.json +4 -1
- package/locales/tr/global.json +4 -1
- package/locales/uk/global.json +4 -1
- package/locales/vi/global.json +4 -1
- package/locales/zh/global.json +4 -1
- package/locales/zh_TW/global.json +4 -1
- package/package.json +2 -2
|
@@ -68,9 +68,7 @@ class DragAndDrop extends _react.default.Component {
|
|
|
68
68
|
error = '',
|
|
69
69
|
buttonAriaLabel = '',
|
|
70
70
|
errorButtonLabel = '',
|
|
71
|
-
disabled = false
|
|
72
|
-
pdfButtonLabel,
|
|
73
|
-
pdfButtonAriaLabel
|
|
71
|
+
disabled = false
|
|
74
72
|
} = this.props;
|
|
75
73
|
const {
|
|
76
74
|
dragging
|
|
@@ -91,26 +89,6 @@ class DragAndDrop extends _react.default.Component {
|
|
|
91
89
|
src: previewContent.src,
|
|
92
90
|
type: "video/*"
|
|
93
91
|
}));
|
|
94
|
-
} else if (previewContent && previewContent.type === 'pdf') {
|
|
95
|
-
previewView = /*#__PURE__*/_react.default.createElement("div", {
|
|
96
|
-
className: _style.default.previewPdf
|
|
97
|
-
}, /*#__PURE__*/_react.default.createElement("p", {
|
|
98
|
-
className: _style.default.previewLabelPdf
|
|
99
|
-
}, previewLabel), /*#__PURE__*/_react.default.createElement(_buttonLink.default, {
|
|
100
|
-
type: "secondary",
|
|
101
|
-
link: {
|
|
102
|
-
href: previewContent.src,
|
|
103
|
-
target: '_blank',
|
|
104
|
-
download: false
|
|
105
|
-
},
|
|
106
|
-
label: pdfButtonLabel,
|
|
107
|
-
"aria-label": pdfButtonAriaLabel,
|
|
108
|
-
"data-name": "default-button-pdf",
|
|
109
|
-
icon: {
|
|
110
|
-
position: 'left',
|
|
111
|
-
type: 'pdf'
|
|
112
|
-
}
|
|
113
|
-
}));
|
|
114
92
|
} else if (loading) {
|
|
115
93
|
previewView = /*#__PURE__*/_react.default.createElement("div", {
|
|
116
94
|
className: _style.default.loaderWrapper
|
|
@@ -216,9 +194,7 @@ DragAndDrop.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
216
194
|
onReset: _propTypes.default.func,
|
|
217
195
|
error: _propTypes.default.string,
|
|
218
196
|
buttonAriaLabel: _propTypes.default.string,
|
|
219
|
-
errorButtonLabel: _propTypes.default.string
|
|
220
|
-
pdfButtonLabel: _propTypes.default.string,
|
|
221
|
-
pdfButtonAriaLabel: _propTypes.default.string
|
|
197
|
+
errorButtonLabel: _propTypes.default.string
|
|
222
198
|
} : {};
|
|
223
199
|
var _default = DragAndDrop;
|
|
224
200
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["constantNull","DragAndDrop","React","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","style","preview","src","previewPdf","previewLabelPdf","href","target","download","position","loaderWrapper","loadingCancel","closeIcon","loader","loaderText","resetContent","classnames","resetUploadWrapper","resetSrcLabel","label","buildButton","defaultButtonProps","icon","button","previewContainer","getClassState","modifiedPreviewContainer","inputWrapper","modifiedInputWrapper","errorInputWrapper","wrapper","infosContainer","iconError","dragAndDropLabel","errorMessage","propTypes","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;;AACA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,YAAY,GAAG,wBAAS,IAAT,CAArB;;AAEA,MAAMC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IK,cAAA,CAAML,QAAjD;IAAjB,GACGH,KADH,CADI,GAKJsB,YAjCJ,CADF;EAsCD;;AApNuC;;AAApC5C,W,CACGgE,S,2CAAY;EACjBlD,KAAK,EAAEmD,kBAAA,CAAUC,MADA;EAEjBnD,WAAW,EAAEkD,kBAAA,CAAUC,MAFN;EAGjBlD,WAAW,EAAEiD,kBAAA,CAAUC,MAHN;EAIjBjD,YAAY,EAAEgD,kBAAA,CAAUC,MAJP;EAKjBhD,cAAc,EAAE+C,kBAAA,CAAUE,KAAV,CAAgB;IAC9BtC,IAAI,EAAEoC,kBAAA,CAAUC,MADc;IAE9BlC,GAAG,EAAEiC,kBAAA,CAAUC,MAFe;IAG9BlB,KAAK,EAAEiB,kBAAA,CAAUC;EAHa,CAAhB,CALC;EAUjB/C,OAAO,EAAE8C,kBAAA,CAAUG,IAVF;EAWjBhD,QAAQ,EAAE6C,kBAAA,CAAUG,IAXH;EAYjB3C,QAAQ,EAAEwC,kBAAA,CAAUG,IAZH;EAajBvD,QAAQ,EAAEoD,kBAAA,CAAUI,IAbH;EAcjBhD,OAAO,EAAE4C,kBAAA,CAAUI,IAdF;EAejB/C,KAAK,EAAE2C,kBAAA,CAAUC,MAfA;EAgBjB3C,eAAe,EAAE0C,kBAAA,CAAUC,MAhBV;EAiBjB1C,gBAAgB,EAAEyC,kBAAA,CAAUC,MAjBX;EAkBjBxC,cAAc,EAAEuC,kBAAA,CAAUC,MAlBT;EAmBjBvC,kBAAkB,EAAEsC,kBAAA,CAAUC;AAnBb,C;eAsNNlE,W"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["constantNull","DragAndDrop","React","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","style","preview","src","loaderWrapper","loadingCancel","closeIcon","loader","loaderText","resetContent","classnames","resetUploadWrapper","resetSrcLabel","label","buildButton","defaultButtonProps","icon","position","button","previewContainer","getClassState","modifiedPreviewContainer","inputWrapper","modifiedInputWrapper","errorInputWrapper","wrapper","infosContainer","iconError","dragAndDropLabel","errorMessage","propTypes","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;;AACA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,YAAY,GAAG,wBAAS,IAAT,CAArB;;AAEA,MAAMC,WAAN,SAA0BC,cAAA,CAAMC,SAAhC,CAA0C;EAqBxCC,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,wBAAS,WAAT,CAAd;IACA,MAAM;MACJC,QAAQ,GAAGd,YADP;MAEJe,KAFI;MAGJC,WAHI;MAIJC,WAJI;MAKJC,YAAY,GAAG,EALX;MAMJC,cANI;MAOJC,OAAO,GAAG,KAPN;MAQJC,QAAQ,GAAG,KARP;MASJC,OAAO,GAAG,IATN;MAUJC,KAAK,GAAG,EAVJ;MAWJ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AA/LuC;;AAApCpC,W,CACGyD,S,2CAAY;EACjB3C,KAAK,EAAE4C,kBAAA,CAAUC,MADA;EAEjB5C,WAAW,EAAE2C,kBAAA,CAAUC,MAFN;EAGjB3C,WAAW,EAAE0C,kBAAA,CAAUC,MAHN;EAIjB1C,YAAY,EAAEyC,kBAAA,CAAUC,MAJP;EAKjBzC,cAAc,EAAEwC,kBAAA,CAAUE,KAAV,CAAgB;IAC9BjC,IAAI,EAAE+B,kBAAA,CAAUC,MADc;IAE9B7B,GAAG,EAAE4B,kBAAA,CAAUC,MAFe;IAG9BnB,KAAK,EAAEkB,kBAAA,CAAUC;EAHa,CAAhB,CALC;EAUjBxC,OAAO,EAAEuC,kBAAA,CAAUG,IAVF;EAWjBzC,QAAQ,EAAEsC,kBAAA,CAAUG,IAXH;EAYjBpC,QAAQ,EAAEiC,kBAAA,CAAUG,IAZH;EAajBhD,QAAQ,EAAE6C,kBAAA,CAAUI,IAbH;EAcjBzC,OAAO,EAAEqC,kBAAA,CAAUI,IAdF;EAejBxC,KAAK,EAAEoC,kBAAA,CAAUC,MAfA;EAgBjBpC,eAAe,EAAEmC,kBAAA,CAAUC,MAhBV;EAiBjBnC,gBAAgB,EAAEkC,kBAAA,CAAUC;AAjBX,C;eAiMN3D,W"}
|
|
@@ -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:
|
|
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
|
|
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
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/image-upload/index.js"],"names":[],"mappings":";AAQA;;;;;;;;;;;;;;;;;;;gBAmFC"}
|
|
@@ -5,6 +5,12 @@ exports.default = void 0;
|
|
|
5
5
|
|
|
6
6
|
var _isNil2 = _interopRequireDefault(require("lodash/fp/isNil"));
|
|
7
7
|
|
|
8
|
+
var _pipe2 = _interopRequireDefault(require("lodash/fp/pipe"));
|
|
9
|
+
|
|
10
|
+
var _map2 = _interopRequireDefault(require("lodash/fp/map"));
|
|
11
|
+
|
|
12
|
+
var _join2 = _interopRequireDefault(require("lodash/fp/join"));
|
|
13
|
+
|
|
8
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
15
|
|
|
10
16
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -37,22 +43,21 @@ const ImageUpload = ({
|
|
|
37
43
|
onChange,
|
|
38
44
|
onReset = null,
|
|
39
45
|
name,
|
|
46
|
+
// See ImagePropType for accepted values
|
|
40
47
|
labelLink,
|
|
41
48
|
labelButtonLink,
|
|
42
49
|
hrefLink,
|
|
43
|
-
// See ImagePropType for accepted values
|
|
44
50
|
imageTypes = ['*'],
|
|
45
51
|
error = '',
|
|
46
52
|
buttonAriaLabel,
|
|
47
|
-
errorButtonLabel
|
|
48
|
-
pdfButtonLabel,
|
|
49
|
-
pdfButtonAriaLabel
|
|
53
|
+
errorButtonLabel
|
|
50
54
|
}) => {
|
|
51
55
|
const handleReset = (0, _react.useCallback)(e => {
|
|
52
56
|
if ((0, _isNil2.default)(onReset)) return;
|
|
53
57
|
e.preventDefault();
|
|
54
58
|
return onReset(e);
|
|
55
59
|
}, [onReset]);
|
|
60
|
+
const acceptedImages = (0, _pipe2.default)((0, _map2.default)(t => `image/${t}`), (0, _join2.default)(','))(imageTypes);
|
|
56
61
|
const linkCustomStyle = {
|
|
57
62
|
width: '40px',
|
|
58
63
|
color: 'red'
|
|
@@ -69,13 +74,11 @@ const ImageUpload = ({
|
|
|
69
74
|
error: error,
|
|
70
75
|
disabled: disabled,
|
|
71
76
|
buttonAriaLabel: buttonAriaLabel,
|
|
72
|
-
errorButtonLabel: errorButtonLabel
|
|
73
|
-
pdfButtonLabel: pdfButtonLabel,
|
|
74
|
-
pdfButtonAriaLabel: pdfButtonAriaLabel
|
|
77
|
+
errorButtonLabel: errorButtonLabel
|
|
75
78
|
}, (onDragStart, onDragStop) => /*#__PURE__*/_react.default.createElement("input", {
|
|
76
79
|
type: "file",
|
|
77
80
|
name: name,
|
|
78
|
-
accept:
|
|
81
|
+
accept: acceptedImages,
|
|
79
82
|
disabled: loading || disabled,
|
|
80
83
|
className: _style.default.input,
|
|
81
84
|
onChange: onChange,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ImageUpload","title","description","previewLabel","previewContent","uploadLabel","loading","modified","disabled","onChange","onReset","name","labelLink","labelButtonLink","hrefLink","imageTypes","error","buttonAriaLabel","errorButtonLabel","
|
|
1
|
+
{"version":3,"file":"index.js","names":["ImageUpload","title","description","previewLabel","previewContent","uploadLabel","loading","modified","disabled","onChange","onReset","name","labelLink","labelButtonLink","hrefLink","imageTypes","error","buttonAriaLabel","errorButtonLabel","handleReset","useCallback","e","preventDefault","acceptedImages","t","linkCustomStyle","width","color","onDragStart","onDragStop","style","input","templateLink","href","download","propTypes","DragAndDrop","PropTypes","string","func","arrayOf","ImagePropType"],"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;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,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,GAAG,IAAAC,kBAAA,EAClBC,CAAC,IAAI;IACH,IAAI,qBAAMX,OAAN,CAAJ,EAAoB;IACpBW,CAAC,CAACC,cAAF;IACA,OAAOZ,OAAO,CAACW,CAAD,CAAd;EACD,CALiB,EAMlB,CAACX,OAAD,CANkB,CAApB;EASA,MAAMa,cAAc,GAAG,oBACrB,mBAAIC,CAAC,IAAK,SAAQA,CAAE,EAApB,CADqB,EAErB,oBAAK,GAAL,CAFqB,EAGrBT,UAHqB,CAAvB;EAKA,MAAMU,eAAe,GAAG;IACtBC,KAAK,EAAE,MADe;IAEtBC,KAAK,EAAE;EAFe,CAAxB;EAKA,oBACE,uDACE,6BAAC,oBAAD;IACE,KAAK,EAAE1B,KADT;IAEE,WAAW,EAAEC,WAFf;IAGE,YAAY,EAAEC,YAHhB;IAIE,cAA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EyB,kBAAA,CAAUC,MATvB;EAUExB,QAAQ,EAAEuB,kBAAA,CAAUC;AAVtB;eAaetC,W"}
|
|
@@ -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
|
};
|
|
@@ -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;
|
|
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"}
|
|
@@ -153,6 +153,7 @@ const createStyleSheet = (theme, type) => _reactNative.StyleSheet.create({
|
|
|
153
153
|
shadowRadius: 8
|
|
154
154
|
},
|
|
155
155
|
buttonTooltip: {
|
|
156
|
+
zIndex: 20,
|
|
156
157
|
flexDirection: 'column',
|
|
157
158
|
justifyContent: 'center',
|
|
158
159
|
backgroundColor: theme.colors.white,
|
|
@@ -162,7 +163,14 @@ const createStyleSheet = (theme, type) => _reactNative.StyleSheet.create({
|
|
|
162
163
|
position: 'absolute',
|
|
163
164
|
bottom: 4,
|
|
164
165
|
right: -15,
|
|
165
|
-
|
|
166
|
+
shadowColor: theme.colors.black,
|
|
167
|
+
shadowOpacity: 0.3,
|
|
168
|
+
shadowOffset: {
|
|
169
|
+
width: 0,
|
|
170
|
+
height: 0
|
|
171
|
+
},
|
|
172
|
+
shadowRadius: 8,
|
|
173
|
+
elevation: 6
|
|
166
174
|
},
|
|
167
175
|
htmlTooltipText: {
|
|
168
176
|
color: theme.colors.text.primary,
|
|
@@ -172,6 +180,7 @@ const createStyleSheet = (theme, type) => _reactNative.StyleSheet.create({
|
|
|
172
180
|
textAlign: 'center'
|
|
173
181
|
},
|
|
174
182
|
triangleTooltip: {
|
|
183
|
+
zIndex: 31,
|
|
175
184
|
width: 0,
|
|
176
185
|
height: 0,
|
|
177
186
|
backgroundColor: 'transparent',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["createStyleSheet","theme","type","StyleSheet","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","useState","fadeIn","useAnimateProp","property","fromValue","toValue","easing","Easing","bezier","handlePressKey","useCallback","start","revert","tooltip","animatedStyle","ICONS","RightIcon","wrong","WrongIcon","ReviewCorrectionPopin","information","next","templateContext","useTemplateContext","setStylesheet","handlePressNext","onClick","Icon","useEffect","_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;;AACA;;AACA;;AAKA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;;;AA2BA,MAAMA,gBAAgB,GAAG,CAACC,KAAD,EAAeC,IAAf,KACvBC,uBAAA,CAAWC,MAAX,CAAkB;EAChBC,OAAO,EAAE;IACPC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C,eAAD;IAAM,KAAK,EAAEsE,UAAU,CAAC1D;EAAxB,GAAsCA,WAAtC,CAPF,CADF,eAUE,6BAAC,iBAAD;IAAM,KAAK,EAAE0D,UAAU,CAACnD,eAAxB;IAAyC,kBAAkB,EAAC;EAA5D,gBACE,6BAAC,iBAAD;IAAM,KAAK,EAAEmD,UAAU,CAACjD,cAAxB;IAAwC,8BAA8B;EAAtE,gBACE,6BAAC,eAAD;IAAM,kBAAkB,EAAEwE,WAAW,CAACjE,KAAtC;IAA6C,KAAK,EAAE0C,UAAU,CAAC1C;EAA/D,GACGiE,WAAW,CAACjE,KADf,CADF,CADF,eAME,6BAAC,cAAD;IAAM,KAAK,EAAE0C,UAAU,CAACxC;EAAxB,GAA0C+D,WAAW,CAACU,OAAtD,CANF,CAVF,EAkBGlC,GAAG,IAAItF,IAAI,KAAK,OAAhB,gBAA0B,6BAAC,SAAD;IAAW,UAAU,EAAEuF,UAAvB;IAAmC,GAAG,EAAED;EAAxC,EAA1B,GAA4E,IAlB/E,eAmBE,6BAAC,eAAD;IACE,KAAK,EAAEC,UAAU,CAACvC,MADpB;IAEE,OAAO,EAAEmE,eAFX;IAGE,kBAAkB,EAAEJ,IAAI,CAAC,YAAD,CAH1B;IAIE,MAAM,EAAEA,IAAI,CAAC,WAAD;EAJd,gBAME,6BAAC,eAAD;IAAM,KAAK,EAAExB,UAAU,CAACpC;EAAxB,GAAqC4D,IAAI,CAAClE,KAA1C,CANF,CAnBF,CADF,CADF;AAgCD,CAvDD;;eAyDegE,qB"}
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["createStyleSheet","theme","type","StyleSheet","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","useState","fadeIn","useAnimateProp","property","fromValue","toValue","easing","Easing","bezier","handlePressKey","useCallback","start","revert","tooltip","animatedStyle","ICONS","RightIcon","wrong","WrongIcon","ReviewCorrectionPopin","information","next","templateContext","useTemplateContext","setStylesheet","handlePressNext","onClick","Icon","useEffect","_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;;AACA;;AACA;;AAKA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;;;AA2BA,MAAMA,gBAAgB,GAAG,CAACC,KAAD,EAAeC,IAAf,KACvBC,uBAAA,CAAWC,MAAX,CAAkB;EAChBC,OAAO,EAAE;IACPC,eAAe,EAAE,WADV;IAEPC,MAAM,EAAE,IAFD;IAGPC,OAAO,EAAE,MAHF;IAIPC,cAAc,EAAE;EAJT,CADO;EAOhBC,KAAK,EAAE;IACLC,OAAO,EAAEV,KAAK,CAACW,OAAN,CAAcC,MADlB;IAELC,YAAY,EAAE,EAFT;IAGLN,OAAO,EAAE,MAHJ;IAILO,aAAa,EAAE,QAJV;IAKLC,UAAU,EAAE,YALP;IAMLV,eAAe,EAAEJ,IAAI,KAAK,OAAT,GAAmBD,KAAK,CAACgB,MAAN,CAAaC,QAAhC,GAA2CjB,KAAK,CAACgB,MAAN,CAAaE,QANpE;IAOLC,WAAW,EAA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BACE,6BAAC,iBAAD;IAAM,KAAK,EAAEmD,UAAU,CAACjD,cAAxB;IAAwC,8BAA8B;EAAtE,gBACE,6BAAC,eAAD;IAAM,kBAAkB,EAAEwE,WAAW,CAACjE,KAAtC;IAA6C,KAAK,EAAE0C,UAAU,CAAC1C;EAA/D,GACGiE,WAAW,CAACjE,KADf,CADF,CADF,eAME,6BAAC,cAAD;IAAM,KAAK,EAAE0C,UAAU,CAACxC;EAAxB,GAA0C+D,WAAW,CAACU,OAAtD,CANF,CAVF,EAkBGlC,GAAG,IAAItF,IAAI,KAAK,OAAhB,gBAA0B,6BAAC,SAAD;IAAW,UAAU,EAAEuF,UAAvB;IAAmC,GAAG,EAAED;EAAxC,EAA1B,GAA4E,IAlB/E,eAmBE,6BAAC,eAAD;IACE,KAAK,EAAEC,UAAU,CAACvC,MADpB;IAEE,OAAO,EAAEmE,eAFX;IAGE,kBAAkB,EAAEJ,IAAI,CAAC,YAAD,CAH1B;IAIE,MAAM,EAAEA,IAAI,CAAC,WAAD;EAJd,gBAME,6BAAC,eAAD;IAAM,KAAK,EAAExB,UAAU,CAACpC;EAAxB,GAAqC4D,IAAI,CAAClE,KAA1C,CANF,CAnBF,CADF,CADF;AAgCD,CAvDD;;eAyDegE,qB"}
|
|
@@ -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>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/list-item/index.js"],"names":[],"mappings":";AAQA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/list-item/index.js"],"names":[],"mappings":";AAQA,mDAqCC"}
|
|
@@ -27,8 +27,7 @@ const ListItem = props => {
|
|
|
27
27
|
tags,
|
|
28
28
|
title,
|
|
29
29
|
order,
|
|
30
|
-
'aria-label': ariaLabel
|
|
31
|
-
contentType
|
|
30
|
+
'aria-label': ariaLabel
|
|
32
31
|
} = props;
|
|
33
32
|
|
|
34
33
|
const tagsView = _map2.default.convert({
|
|
@@ -43,7 +42,7 @@ const ListItem = props => {
|
|
|
43
42
|
|
|
44
43
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
45
44
|
className: _style.default.wrapper
|
|
46
|
-
}, isPublished
|
|
45
|
+
}, isPublished ? /*#__PURE__*/_react.default.createElement("div", {
|
|
47
46
|
className: _style.default.orderWrapper
|
|
48
47
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
49
48
|
className: _style.default.order,
|
|
@@ -90,8 +89,7 @@ ListItem.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
90
89
|
})),
|
|
91
90
|
title: _propTypes.default.string.isRequired,
|
|
92
91
|
order: _propTypes.default.number,
|
|
93
|
-
'aria-label': _propTypes.default.string
|
|
94
|
-
contentType: _propTypes.default.string
|
|
92
|
+
'aria-label': _propTypes.default.string
|
|
95
93
|
} : {};
|
|
96
94
|
var _default = ListItem;
|
|
97
95
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ListItem","props","isPublished","bulletPointMenuButton","buttonLink","tags","title","order","ariaLabel","
|
|
1
|
+
{"version":3,"file":"index.js","names":["ListItem","props","isPublished","bulletPointMenuButton","buttonLink","tags","title","order","ariaLabel","tagsView","convert","cap","tag","index","type","style","wrapper","orderWrapper","settings","edit","propTypes","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;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,QAAQ,GAAGC,KAAK,IAAI;EACxB,IAAIC,WAAW,GAAG,KAAlB;EACA,MAAM;IAACC,qBAAD;IAAwBC,UAAxB;IAAoCC,IAApC;IAA0CC,KAA1C;IAAiDC,KAAjD;IAAwD,cAAcC;EAAtE,IAAmFP,KAAzF;;EAEA,MAAMQ,QAAQ,GAAG,cAAIC,OAAJ,CAAY;IAACC,GAAG,EAAE;EAAN,CAAZ,EAA0B,CAACC,GAAD,EAAMC,KAAN,KAAgB;IACzDX,WAAW,GAAGU,GAAG,CAACE,IAAJ,KAAa,WAA3B;IACA,oBACE;MAAK,GAAG,EAAED,KAAV;MAAiB,SAAS,EAAEE,cAAA,CAAMH;IAAlC,gBACE,6BAAC,YAAD,EAASA,GAAT,CADF,CADF;EAKD,CAPgB,EAOdP,IAPc,CAAjB;;EAQA,oBACE;IAAK,SAAS,EAAEU,cAAA,CAAMC;EAAtB,GACGd,WAAW,gBACV;IAAK,SAAS,EAAEa,cAAA,CAAME;EAAtB,gBACE;IAAK,SAAS,EAAEF,cAAA,CAAMR,KAAtB;IAA6B,cAAYC;EAAzC,GACGD,KAAK,GAAG,CADX,CADF,eAIE;IAAK,SAAS,EAAEQ,cAAA,CAAMT,KAAtB;IAA6B,KAAK,EAAEA;EAApC,GACGA,KADH,CAJF,CADU,gBAUV;IAAK,SAAS,EAAES,cAAA,CAAMT,KAAtB;IAA6B,KAAK,EAAEA;EAApC,GACGA,KADH,CAXJ,eAeE;IAAK,SAAS,EAAES,cAAA,CAAMG;EAAtB,GACGT,QADH,eAEE;IAAK,SAAS,EAAEM,cAAA,CAAMI;EAAtB,gBACE,6BAAC,mBAAD,EAAgB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,CAAhB,CADI,CAzBa;EA+BnB5B,KAAK,EAAEe,kBAAA,CAAUG,MAAV,CAAiBW,UA/BL;EAgCnB5B,KAAK,EAAEc,kBAAA,CAAUe,MAhCE;EAiCnB,cAAcf,kBAAA,CAAUG;AAjCL,CAArB;eAoCexB,Q"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
export default ListItems;
|
|
2
|
-
declare function ListItems({ title, buttonLink, items, "aria-label": ariaLabel
|
|
2
|
+
declare function ListItems({ title, buttonLink, items, "aria-label": ariaLabel }: {
|
|
3
3
|
title: any;
|
|
4
4
|
buttonLink: any;
|
|
5
5
|
items: any;
|
|
6
6
|
"aria-label": any;
|
|
7
|
-
contentType: any;
|
|
8
7
|
}): JSX.Element;
|
|
9
8
|
declare namespace ListItems {
|
|
10
9
|
const propTypes: {
|
|
@@ -59,10 +58,8 @@ declare namespace ListItems {
|
|
|
59
58
|
title: PropTypes.Validator<string>;
|
|
60
59
|
order: PropTypes.Requireable<number>;
|
|
61
60
|
'aria-label': PropTypes.Requireable<string>;
|
|
62
|
-
contentType: PropTypes.Requireable<string>;
|
|
63
61
|
}> | null | undefined)[]>;
|
|
64
62
|
title: PropTypes.Requireable<string>;
|
|
65
|
-
contentType: PropTypes.Requireable<string>;
|
|
66
63
|
};
|
|
67
64
|
}
|
|
68
65
|
import PropTypes from "prop-types";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/list-items/index.js"],"names":[],"mappings":";AAOA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/list-items/index.js"],"names":[],"mappings":";AAOA;;;;;gBAsBC"}
|