@coorpacademy/components 11.2.9 → 11.2.11
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/clue/index.d.ts +1 -1
- package/es/atom/lottie-wrapper/index.d.ts.map +1 -1
- package/es/atom/lottie-wrapper/index.js +9 -3
- package/es/atom/lottie-wrapper/index.js.map +1 -1
- package/es/atom/lottie-wrapper/prop-types.d.ts +2 -2
- package/es/atom/lottie-wrapper/prop-types.d.ts.map +1 -1
- package/es/atom/lottie-wrapper/prop-types.js +1 -1
- package/es/atom/lottie-wrapper/prop-types.js.map +1 -1
- package/es/atom/promo-code/index.d.ts +1 -1
- package/es/atom/provider/index.d.ts +1 -1
- package/es/atom/provider/index.js +1 -1
- package/es/atom/provider/index.js.map +1 -1
- package/es/atom/review-presentation/index.d.ts.map +1 -1
- package/es/atom/review-presentation/index.js +9 -5
- package/es/atom/review-presentation/index.js.map +1 -1
- package/es/atom/review-presentation/prop-types.d.ts +8 -0
- package/es/atom/review-presentation/prop-types.d.ts.map +1 -1
- package/es/atom/review-presentation/prop-types.js +2 -1
- package/es/atom/review-presentation/prop-types.js.map +1 -1
- package/es/atom/select/index.d.ts +16 -17
- package/es/atom/select/index.d.ts.map +1 -1
- package/es/atom/select/index.js +7 -6
- package/es/atom/select/index.js.map +1 -1
- package/es/atom/tab-content/index.d.ts +1 -1
- package/es/molecule/answer/index.d.ts.map +1 -1
- package/es/molecule/answer/index.js +9 -1
- package/es/molecule/answer/index.js.map +1 -1
- package/es/molecule/battle-request/index.d.ts +1 -1
- package/es/molecule/brand-create-form/index.d.ts +1 -1
- package/es/molecule/brand-form-group/index.d.ts +2 -2
- package/es/molecule/card-with-button/index.d.ts +1 -1
- package/es/molecule/cookie-banner/index.d.ts +1 -1
- package/es/molecule/dashboard/cards-list/index.d.ts +1 -1
- package/es/molecule/discipline-partners/index.d.ts +1 -1
- package/es/molecule/external-content-button/index.d.ts +1 -1
- package/es/molecule/filters/index.d.ts +1 -1
- package/es/molecule/forum/forum-comment/index.d.ts +1 -1
- package/es/molecule/forum/forum-post/index.d.ts +1 -1
- package/es/molecule/payment-form/index.d.ts +1 -1
- package/es/molecule/pdf/index.d.ts +1 -1
- package/es/molecule/product-card/index.d.ts +1 -1
- package/es/molecule/questions/drop-down/index.d.ts +6 -5
- package/es/molecule/questions/drop-down/index.js +5 -2
- package/es/molecule/questions/drop-down/index.js.map +1 -1
- package/es/molecule/questions/template/index.d.ts +3 -1
- package/es/molecule/review-card-congrats/prop-types.d.ts +1 -1
- package/es/molecule/scope-content/index.d.ts +1 -1
- package/es/molecule/setup-section/index.d.ts +1 -1
- package/es/molecule/setup-slide/index.d.ts +1 -1
- package/es/molecule/setup-slider/index.d.ts +1 -1
- package/es/molecule/subscription-freemium/index.d.ts +1 -1
- package/es/molecule/subscription-premium/index.d.ts +1 -1
- package/es/molecule/table/index.d.ts +1 -1
- package/es/molecule/unsubscribe/index.d.ts +1 -1
- package/es/organism/brand-analytics/index.d.ts +1 -1
- package/es/organism/brand-form/index.d.ts +2 -2
- package/es/organism/cart/index.d.ts +1 -1
- package/es/organism/mooc-header/index.d.ts +1 -1
- package/es/organism/mooc-header/index.js +1 -1
- package/es/organism/mooc-header/index.js.map +1 -1
- package/es/organism/review-congrats/index.d.ts.map +1 -1
- package/es/organism/review-congrats/index.js +8 -6
- package/es/organism/review-congrats/index.js.map +1 -1
- package/es/organism/review-congrats/prop-types.d.ts +3 -3
- package/es/organism/settings/index.d.ts +1 -1
- package/es/organism/user-preferences/index.d.ts +1 -0
- package/es/organism/user-preferences/index.d.ts.map +1 -1
- package/es/organism/user-preferences/index.js +11 -6
- package/es/organism/user-preferences/index.js.map +1 -1
- package/es/organism/wizard-contents/index.d.ts +2 -2
- package/es/template/activity/index.d.ts +2 -0
- package/es/template/activity/index.d.ts.map +1 -1
- package/es/template/activity/index.js +4 -1
- package/es/template/activity/index.js.map +1 -1
- package/es/template/activity/progression-item.d.ts +1 -0
- package/es/template/activity/progression-item.d.ts.map +1 -1
- package/es/template/activity/progression-item.js +5 -2
- package/es/template/activity/progression-item.js.map +1 -1
- package/es/template/app-player/player/slides/index.d.ts +2 -2
- package/es/template/app-player/player/slides/index.js +1 -1
- package/es/template/app-player/player/slides/index.js.map +1 -1
- package/es/template/app-review/index.d.ts +4 -47
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/index.js +0 -10
- package/es/template/app-review/index.js.map +1 -1
- package/es/template/app-review/index.native.d.ts.map +1 -1
- package/es/template/app-review/index.native.js +0 -8
- package/es/template/app-review/index.native.js.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +3 -3
- package/es/template/app-review/prop-types.d.ts +4 -51
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.js +1 -5
- package/es/template/app-review/prop-types.js.map +1 -1
- package/es/template/app-review/template-context.d.ts +1 -0
- package/es/template/app-review/template-context.d.ts.map +1 -1
- package/es/template/app-review/template-context.js +2 -1
- package/es/template/app-review/template-context.js.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +4 -4
- package/es/template/battle-requests/index.d.ts +1 -1
- package/es/template/common/authors/index.d.ts +1 -1
- package/es/template/common/search-page/index.d.ts +1 -1
- package/es/template/review-dashboard-skills/index.d.ts +4 -0
- package/es/util/render-with-context.d.ts +1 -4
- package/es/util/render-with-context.d.ts.map +1 -1
- package/es/util/render-with-context.js +6 -6
- package/es/util/render-with-context.js.map +1 -1
- package/lib/atom/clue/index.d.ts +1 -1
- package/lib/atom/lottie-wrapper/index.d.ts.map +1 -1
- package/lib/atom/lottie-wrapper/index.js +9 -3
- package/lib/atom/lottie-wrapper/index.js.map +1 -1
- package/lib/atom/lottie-wrapper/prop-types.d.ts +2 -2
- package/lib/atom/lottie-wrapper/prop-types.d.ts.map +1 -1
- package/lib/atom/lottie-wrapper/prop-types.js +1 -1
- package/lib/atom/lottie-wrapper/prop-types.js.map +1 -1
- package/lib/atom/promo-code/index.d.ts +1 -1
- package/lib/atom/provider/index.d.ts +1 -1
- package/lib/atom/provider/index.js +1 -1
- package/lib/atom/provider/index.js.map +1 -1
- package/lib/atom/review-presentation/index.d.ts.map +1 -1
- package/lib/atom/review-presentation/index.js +9 -5
- package/lib/atom/review-presentation/index.js.map +1 -1
- package/lib/atom/review-presentation/prop-types.d.ts +8 -0
- package/lib/atom/review-presentation/prop-types.d.ts.map +1 -1
- package/lib/atom/review-presentation/prop-types.js +2 -1
- package/lib/atom/review-presentation/prop-types.js.map +1 -1
- package/lib/atom/select/index.d.ts +16 -17
- package/lib/atom/select/index.d.ts.map +1 -1
- package/lib/atom/select/index.js +7 -6
- package/lib/atom/select/index.js.map +1 -1
- package/lib/atom/tab-content/index.d.ts +1 -1
- package/lib/molecule/answer/index.d.ts.map +1 -1
- package/lib/molecule/answer/index.js +10 -1
- package/lib/molecule/answer/index.js.map +1 -1
- package/lib/molecule/battle-request/index.d.ts +1 -1
- package/lib/molecule/brand-create-form/index.d.ts +1 -1
- package/lib/molecule/brand-form-group/index.d.ts +2 -2
- package/lib/molecule/card-with-button/index.d.ts +1 -1
- package/lib/molecule/cookie-banner/index.d.ts +1 -1
- package/lib/molecule/dashboard/cards-list/index.d.ts +1 -1
- package/lib/molecule/discipline-partners/index.d.ts +1 -1
- package/lib/molecule/external-content-button/index.d.ts +1 -1
- package/lib/molecule/filters/index.d.ts +1 -1
- package/lib/molecule/forum/forum-comment/index.d.ts +1 -1
- package/lib/molecule/forum/forum-post/index.d.ts +1 -1
- package/lib/molecule/payment-form/index.d.ts +1 -1
- package/lib/molecule/pdf/index.d.ts +1 -1
- package/lib/molecule/product-card/index.d.ts +1 -1
- package/lib/molecule/questions/drop-down/index.d.ts +6 -5
- package/lib/molecule/questions/drop-down/index.js +5 -2
- package/lib/molecule/questions/drop-down/index.js.map +1 -1
- package/lib/molecule/questions/template/index.d.ts +3 -1
- package/lib/molecule/review-card-congrats/prop-types.d.ts +1 -1
- package/lib/molecule/scope-content/index.d.ts +1 -1
- package/lib/molecule/setup-section/index.d.ts +1 -1
- package/lib/molecule/setup-slide/index.d.ts +1 -1
- package/lib/molecule/setup-slider/index.d.ts +1 -1
- package/lib/molecule/subscription-freemium/index.d.ts +1 -1
- package/lib/molecule/subscription-premium/index.d.ts +1 -1
- package/lib/molecule/table/index.d.ts +1 -1
- package/lib/molecule/unsubscribe/index.d.ts +1 -1
- package/lib/organism/brand-analytics/index.d.ts +1 -1
- package/lib/organism/brand-form/index.d.ts +2 -2
- package/lib/organism/cart/index.d.ts +1 -1
- package/lib/organism/mooc-header/index.d.ts +1 -1
- package/lib/organism/mooc-header/index.js +1 -1
- package/lib/organism/mooc-header/index.js.map +1 -1
- package/lib/organism/review-congrats/index.d.ts.map +1 -1
- package/lib/organism/review-congrats/index.js +3 -1
- package/lib/organism/review-congrats/index.js.map +1 -1
- package/lib/organism/review-congrats/prop-types.d.ts +3 -3
- package/lib/organism/settings/index.d.ts +1 -1
- package/lib/organism/user-preferences/index.d.ts +1 -0
- package/lib/organism/user-preferences/index.d.ts.map +1 -1
- package/lib/organism/user-preferences/index.js +11 -6
- package/lib/organism/user-preferences/index.js.map +1 -1
- package/lib/organism/wizard-contents/index.d.ts +2 -2
- package/lib/template/activity/index.d.ts +2 -0
- package/lib/template/activity/index.d.ts.map +1 -1
- package/lib/template/activity/index.js +4 -1
- package/lib/template/activity/index.js.map +1 -1
- package/lib/template/activity/progression-item.d.ts +1 -0
- package/lib/template/activity/progression-item.d.ts.map +1 -1
- package/lib/template/activity/progression-item.js +5 -2
- package/lib/template/activity/progression-item.js.map +1 -1
- package/lib/template/app-player/player/slides/index.d.ts +2 -2
- package/lib/template/app-player/player/slides/index.js +1 -1
- package/lib/template/app-player/player/slides/index.js.map +1 -1
- package/lib/template/app-review/index.d.ts +4 -47
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/index.js +0 -12
- package/lib/template/app-review/index.js.map +1 -1
- package/lib/template/app-review/index.native.d.ts.map +1 -1
- package/lib/template/app-review/index.native.js +0 -9
- package/lib/template/app-review/index.native.js.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +3 -3
- package/lib/template/app-review/prop-types.d.ts +4 -51
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.js +1 -7
- package/lib/template/app-review/prop-types.js.map +1 -1
- package/lib/template/app-review/template-context.d.ts +1 -0
- package/lib/template/app-review/template-context.d.ts.map +1 -1
- package/lib/template/app-review/template-context.js +2 -1
- package/lib/template/app-review/template-context.js.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +4 -4
- package/lib/template/battle-requests/index.d.ts +1 -1
- package/lib/template/common/authors/index.d.ts +1 -1
- package/lib/template/common/search-page/index.d.ts +1 -1
- package/lib/template/review-dashboard-skills/index.d.ts +4 -0
- package/lib/util/render-with-context.d.ts +1 -4
- package/lib/util/render-with-context.d.ts.map +1 -1
- package/lib/util/render-with-context.js +6 -6
- package/lib/util/render-with-context.js.map +1 -1
- package/locales/en/global.json +1 -0
- package/package.json +2 -2
- package/locales/.mtslconfig.json +0 -1
package/es/atom/clue/index.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ declare class Clue extends React.Component<any, any, any> {
|
|
|
27
27
|
[x: string]: any;
|
|
28
28
|
}>;
|
|
29
29
|
}>>;
|
|
30
|
-
translate: PropTypes.
|
|
30
|
+
translate: PropTypes.Requireable<(...args: any[]) => any>;
|
|
31
31
|
};
|
|
32
32
|
static getDerivedStateFromProps(props: any): {
|
|
33
33
|
isLoading: false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/lottie-wrapper/index.js"],"names":[],"mappings":"AAsBO,iMAmCN;;AAED,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/lottie-wrapper/index.js"],"names":[],"mappings":"AAsBO,iMAmCN;;AAED,wDA4HC"}
|
|
@@ -109,9 +109,15 @@ const LottieWrapper = props => {
|
|
|
109
109
|
/* istanbul ignore next */
|
|
110
110
|
lottie.destroy(animationItem.name);
|
|
111
111
|
}, [lottieAnimationClassName, containerRef, hideOnTransparent, loop, animationSrc, _isIE11, animationItem, autoplay]);
|
|
112
|
-
|
|
112
|
+
const accessibilityProps = ariaLabel ? {
|
|
113
|
+
'aria-label': ariaLabel,
|
|
114
|
+
role: 'img'
|
|
115
|
+
} : {
|
|
116
|
+
'aria-hidden': 'true',
|
|
117
|
+
role: 'presentation'
|
|
118
|
+
};
|
|
119
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, accessibilityProps, {
|
|
113
120
|
ref: containerRef,
|
|
114
|
-
"aria-label": ariaLabel,
|
|
115
121
|
"data-name": dataName,
|
|
116
122
|
className: wrapperClassName,
|
|
117
123
|
style: _extends({}, width && {
|
|
@@ -124,7 +130,7 @@ const LottieWrapper = props => {
|
|
|
124
130
|
opacity: isAnimationVisible ? 1 : 0,
|
|
125
131
|
transition: 'opacity 0.25s ease-in'
|
|
126
132
|
})
|
|
127
|
-
}, _isIE11 ? /*#__PURE__*/React.createElement("img", {
|
|
133
|
+
}), _isIE11 ? /*#__PURE__*/React.createElement("img", {
|
|
128
134
|
src: ie11ImageBackup,
|
|
129
135
|
className: ie11BackupImageClassName,
|
|
130
136
|
"data-name": "ie11-backup-image"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","useRef","useEffect","useState","classnames","lottie","get","has","includes","keys","omit","unfetch","style","propTypes","ANIMATION_CONTROL","isIE11","window","userAgent","hasMsCrypto","hasRevision","hasTrident","fetchAndLoadAnimation","_lottie","_fetch","animationSrc","containerRef","loop","animationClassnames","hideOnTransparent","autoplay","animationUrl","URL","toString","fetchResult","headers","animationData","json","animation","loadAnimation","container","current","renderer","rendererSettings","className","preserveAspectRatio","LottieWrapper","props","dataName","ariaLabel","width","height","ie11ImageBackup","backupImageClassName","animationControl","animationClassName","animationItem","setAnimationItem","isAnimationVisible","setIsAnimationVisible","_isIE11","wrapperClassName","lottieContainer","lottieAnimationClassName","ie11BackupImageClassName","backupImage","stop","destroy","name","maxWidth","maxHeight","opacity","transition"],"sources":["../../../src/atom/lottie-wrapper/index.js"],"sourcesContent":["import React, {useMemo, useRef, useEffect, useState} from 'react';\nimport classnames from 'classnames';\nimport lottie from 'lottie-web';\nimport get from 'lodash/fp/get';\nimport has from 'lodash/fp/has';\nimport includes from 'lodash/fp/includes';\nimport keys from 'lodash/fp/keys';\nimport omit from 'lodash/fp/omit';\nimport unfetch from 'isomorphic-unfetch';\nimport style from './style.css';\nimport propTypes, {ANIMATION_CONTROL} from './prop-types';\n\nconst isIE11 = () => {\n if (typeof window === 'undefined') return;\n const userAgent = get('navigator.userAgent', window);\n const hasMsCrypto = has('msCrypto', window);\n const hasRevision = includes('rv:', userAgent);\n const hasTrident = includes('Trident/', userAgent);\n\n return hasMsCrypto || (hasRevision && hasTrident);\n};\n\nexport const fetchAndLoadAnimation = async (\n _lottie,\n _fetch,\n animationSrc,\n containerRef,\n loop,\n animationClassnames,\n hideOnTransparent,\n autoplay\n) => {\n const animationUrl = new URL(animationSrc).toString();\n const fetchResult = await _fetch(animationUrl, {\n headers: {\n 'X-Requested-With': 'XMLHttpRequest',\n 'Content-Type': 'application/json'\n }\n });\n\n const animationData = await fetchResult.json();\n\n const animation =\n _lottie.loadAnimation &&\n _lottie.loadAnimation({\n container: containerRef.current, // the dom element that will contain the animation\n renderer: 'svg',\n autoplay,\n loop,\n animationData,\n rendererSettings: {\n className: animationClassnames,\n hideOnTransparent,\n preserveAspectRatio: 'xMidYMid meet' // same options as a preserveAspectRatio prop\n }\n });\n return animation;\n};\n\nconst LottieWrapper = props => {\n const {\n className,\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n animationSrc,\n loop = false,\n rendererSettings = {},\n width,\n height,\n ie11ImageBackup,\n backupImageClassName,\n autoplay = true,\n animationControl\n } = props;\n\n const {className: animationClassName, hideOnTransparent = true} = rendererSettings;\n\n const containerRef = useRef(null);\n\n // lottie's animation instance\n const [animationItem, setAnimationItem] = useState(null);\n\n const [isAnimationVisible, setIsAnimationVisible] = useState(autoplay);\n\n const _isIE11 = useMemo(() => isIE11(), []);\n\n const wrapperClassName = useMemo(() => classnames(className, style.lottieContainer), [className]);\n\n const lottieAnimationClassName = useMemo(\n () => classnames(animationClassName, style.animation),\n [animationClassName]\n );\n\n const ie11BackupImageClassName = useMemo(\n () => classnames(backupImageClassName, style.backupImage),\n [backupImageClassName]\n );\n\n useEffect(() => {\n // enzyme does not handle well the state update after an async useEffect in tests\n // to remove when the migration towards @testing-library/react is done\n /* istanbul ignore next */\n if (includes(animationControl, keys(omit('loading', ANIMATION_CONTROL))) && !autoplay) {\n setIsAnimationVisible(true);\n if (animationItem) animationItem[animationControl]();\n if (animationControl === ANIMATION_CONTROL.stop) setIsAnimationVisible(false);\n }\n }, [animationControl, animationItem, autoplay]);\n\n useEffect(() => {\n const loadAnimation = async () => {\n if (!_isIE11 && !animationItem) {\n /* istanbul ignore else */\n if (typeof window !== 'undefined') {\n window.lottie = lottie;\n }\n const animation = await fetchAndLoadAnimation(\n lottie,\n unfetch,\n animationSrc,\n containerRef,\n loop,\n lottieAnimationClassName,\n hideOnTransparent,\n autoplay\n );\n\n /* istanbul ignore next */\n setAnimationItem(animation);\n }\n };\n\n loadAnimation();\n return () => animationItem && /* istanbul ignore next */ lottie.destroy(animationItem.name);\n }, [\n lottieAnimationClassName,\n containerRef,\n hideOnTransparent,\n loop,\n animationSrc,\n _isIE11,\n animationItem,\n autoplay\n ]);\n\n return (\n <div\n ref={containerRef}\n aria-label={ariaLabel}\n data-name={dataName}\n className={wrapperClassName}\n style={{\n ...(width && {\n width: `${width}px`,\n maxWidth: `${width}px`\n }),\n ...(height && {\n height: `${height}px`,\n maxHeight: `${height}px`\n }),\n opacity: isAnimationVisible ? 1 : 0,\n transition: 'opacity 0.25s ease-in'\n }}\n >\n {_isIE11 ? (\n <img\n src={ie11ImageBackup}\n className={ie11BackupImageClassName}\n data-name=\"ie11-backup-image\"\n />\n ) : null}\n </div>\n );\n};\n\nLottieWrapper.propTypes = propTypes;\n\nexport default LottieWrapper;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,OAAf,EAAwBC,MAAxB,EAAgCC,SAAhC,EAA2CC,QAA3C,QAA0D,OAA1D;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,MAAP,MAAmB,YAAnB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,QAAP,MAAqB,oBAArB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,OAAP,MAAoB,oBAApB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AACA,OAAOC,SAAP,IAAmBC,iBAAnB,QAA2C,cAA3C;;AAEA,MAAMC,MAAM,GAAG,MAAM;EACnB,IAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;EACnC,MAAMC,SAAS,GAAGX,GAAG,CAAC,qBAAD,EAAwBU,MAAxB,CAArB;EACA,MAAME,WAAW,GAAGX,GAAG,CAAC,UAAD,EAAaS,MAAb,CAAvB;EACA,MAAMG,WAAW,GAAGX,QAAQ,CAAC,KAAD,EAAQS,SAAR,CAA5B;EACA,MAAMG,UAAU,GAAGZ,QAAQ,CAAC,UAAD,EAAaS,SAAb,CAA3B;EAEA,OAAOC,WAAW,IAAKC,WAAW,IAAIC,UAAtC;AACD,CARD;;AAUA,OAAO,MAAMC,qBAAqB,GAAG,OACnCC,OADmC,EAEnCC,MAFmC,EAGnCC,YAHmC,EAInCC,YAJmC,EAKnCC,IALmC,EAMnCC,mBANmC,EAOnCC,iBAPmC,EAQnCC,QARmC,KAShC;EACH,MAAMC,YAAY,GAAG,IAAIC,GAAJ,CAAQP,YAAR,EAAsBQ,QAAtB,EAArB;EACA,MAAMC,WAAW,GAAG,MAAMV,MAAM,CAACO,Y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gB,CAACnB,SAAD,CAAhB;MACD;IACF,CApBD;;IAsBAC,aAAa;IACb,OAAO,MAAMiB,aAAa;IAAI;IAA2BlD,MAAM,CAAC6D,OAAP,CAAeX,aAAa,CAACY,IAA7B,CAAzD;EACD,CAzBQ,EAyBN,CACDL,wBADC,EAEDrC,YAFC,EAGDG,iBAHC,EAIDF,IAJC,EAKDF,YALC,EAMDmC,OANC,EAODJ,aAPC,EAQD1B,QARC,CAzBM,CAAT;EAoCA,oBACE;IACE,GAAG,EAAEJ,YADP;IAEE,cAAYuB,SAFd;IAGE,aAAWD,QAHb;IAIE,SAAS,EAAEa,gBAJb;IAKE,KAAK,eACCX,KAAK,IAAI;MACXA,KAAK,EAAG,GAAEA,KAAM,IADL;MAEXmB,QAAQ,EAAG,GAAEnB,KAAM;IAFR,CADV,EAKCC,MAAM,IAAI;MACZA,MAAM,EAAG,GAAEA,MAAO,IADN;MAEZmB,SAAS,EAAG,GAAEnB,MAAO;IAFT,CALX;MASHoB,OAAO,EAAEb,kBAAkB,GAAG,CAAH,GAAO,CAT/B;MAUHc,UAAU,EAAE;IAVT;EALP,GAkBGZ,OAAO,gBACN;IACE,GAAG,EAAER,eADP;IAEE,SAAS,EAAEY,wBAFb;IAGE,aAAU;EAHZ,EADM,GAMJ,IAxBN,CADF;AA4BD,CAlHD;;AAoHAlB,aAAa,CAAChC,SAAd,2CAA0BA,SAA1B;AAEA,eAAegC,aAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","useRef","useEffect","useState","classnames","lottie","get","has","includes","keys","omit","unfetch","style","propTypes","ANIMATION_CONTROL","isIE11","window","userAgent","hasMsCrypto","hasRevision","hasTrident","fetchAndLoadAnimation","_lottie","_fetch","animationSrc","containerRef","loop","animationClassnames","hideOnTransparent","autoplay","animationUrl","URL","toString","fetchResult","headers","animationData","json","animation","loadAnimation","container","current","renderer","rendererSettings","className","preserveAspectRatio","LottieWrapper","props","dataName","ariaLabel","width","height","ie11ImageBackup","backupImageClassName","animationControl","animationClassName","animationItem","setAnimationItem","isAnimationVisible","setIsAnimationVisible","_isIE11","wrapperClassName","lottieContainer","lottieAnimationClassName","ie11BackupImageClassName","backupImage","stop","destroy","name","accessibilityProps","role","maxWidth","maxHeight","opacity","transition"],"sources":["../../../src/atom/lottie-wrapper/index.js"],"sourcesContent":["import React, {useMemo, useRef, useEffect, useState} from 'react';\nimport classnames from 'classnames';\nimport lottie from 'lottie-web';\nimport get from 'lodash/fp/get';\nimport has from 'lodash/fp/has';\nimport includes from 'lodash/fp/includes';\nimport keys from 'lodash/fp/keys';\nimport omit from 'lodash/fp/omit';\nimport unfetch from 'isomorphic-unfetch';\nimport style from './style.css';\nimport propTypes, {ANIMATION_CONTROL} from './prop-types';\n\nconst isIE11 = () => {\n if (typeof window === 'undefined') return;\n const userAgent = get('navigator.userAgent', window);\n const hasMsCrypto = has('msCrypto', window);\n const hasRevision = includes('rv:', userAgent);\n const hasTrident = includes('Trident/', userAgent);\n\n return hasMsCrypto || (hasRevision && hasTrident);\n};\n\nexport const fetchAndLoadAnimation = async (\n _lottie,\n _fetch,\n animationSrc,\n containerRef,\n loop,\n animationClassnames,\n hideOnTransparent,\n autoplay\n) => {\n const animationUrl = new URL(animationSrc).toString();\n const fetchResult = await _fetch(animationUrl, {\n headers: {\n 'X-Requested-With': 'XMLHttpRequest',\n 'Content-Type': 'application/json'\n }\n });\n\n const animationData = await fetchResult.json();\n\n const animation =\n _lottie.loadAnimation &&\n _lottie.loadAnimation({\n container: containerRef.current, // the dom element that will contain the animation\n renderer: 'svg',\n autoplay,\n loop,\n animationData,\n rendererSettings: {\n className: animationClassnames,\n hideOnTransparent,\n preserveAspectRatio: 'xMidYMid meet' // same options as a preserveAspectRatio prop\n }\n });\n return animation;\n};\n\nconst LottieWrapper = props => {\n const {\n className,\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n animationSrc,\n loop = false,\n rendererSettings = {},\n width,\n height,\n ie11ImageBackup,\n backupImageClassName,\n autoplay = true,\n animationControl\n } = props;\n\n const {className: animationClassName, hideOnTransparent = true} = rendererSettings;\n\n const containerRef = useRef(null);\n\n // lottie's animation instance\n const [animationItem, setAnimationItem] = useState(null);\n\n const [isAnimationVisible, setIsAnimationVisible] = useState(autoplay);\n\n const _isIE11 = useMemo(() => isIE11(), []);\n\n const wrapperClassName = useMemo(() => classnames(className, style.lottieContainer), [className]);\n\n const lottieAnimationClassName = useMemo(\n () => classnames(animationClassName, style.animation),\n [animationClassName]\n );\n\n const ie11BackupImageClassName = useMemo(\n () => classnames(backupImageClassName, style.backupImage),\n [backupImageClassName]\n );\n\n useEffect(() => {\n // enzyme does not handle well the state update after an async useEffect in tests\n // to remove when the migration towards @testing-library/react is done\n /* istanbul ignore next */\n if (includes(animationControl, keys(omit('loading', ANIMATION_CONTROL))) && !autoplay) {\n setIsAnimationVisible(true);\n if (animationItem) animationItem[animationControl]();\n if (animationControl === ANIMATION_CONTROL.stop) setIsAnimationVisible(false);\n }\n }, [animationControl, animationItem, autoplay]);\n\n useEffect(() => {\n const loadAnimation = async () => {\n if (!_isIE11 && !animationItem) {\n /* istanbul ignore else */\n if (typeof window !== 'undefined') {\n window.lottie = lottie;\n }\n const animation = await fetchAndLoadAnimation(\n lottie,\n unfetch,\n animationSrc,\n containerRef,\n loop,\n lottieAnimationClassName,\n hideOnTransparent,\n autoplay\n );\n\n /* istanbul ignore next */\n setAnimationItem(animation);\n }\n };\n\n loadAnimation();\n return () => animationItem && /* istanbul ignore next */ lottie.destroy(animationItem.name);\n }, [\n lottieAnimationClassName,\n containerRef,\n hideOnTransparent,\n loop,\n animationSrc,\n _isIE11,\n animationItem,\n autoplay\n ]);\n\n const accessibilityProps = ariaLabel\n ? {\n 'aria-label': ariaLabel,\n role: 'img'\n }\n : {\n 'aria-hidden': 'true',\n role: 'presentation'\n };\n\n return (\n <div\n {...accessibilityProps}\n ref={containerRef}\n data-name={dataName}\n className={wrapperClassName}\n style={{\n ...(width && {\n width: `${width}px`,\n maxWidth: `${width}px`\n }),\n ...(height && {\n height: `${height}px`,\n maxHeight: `${height}px`\n }),\n opacity: isAnimationVisible ? 1 : 0,\n transition: 'opacity 0.25s ease-in'\n }}\n >\n {_isIE11 ? (\n <img\n src={ie11ImageBackup}\n className={ie11BackupImageClassName}\n data-name=\"ie11-backup-image\"\n />\n ) : null}\n </div>\n );\n};\n\nLottieWrapper.propTypes = propTypes;\n\nexport default LottieWrapper;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,OAAf,EAAwBC,MAAxB,EAAgCC,SAAhC,EAA2CC,QAA3C,QAA0D,OAA1D;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,MAAP,MAAmB,YAAnB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,QAAP,MAAqB,oBAArB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,OAAP,MAAoB,oBAApB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AACA,OAAOC,SAAP,IAAmBC,iBAAnB,QAA2C,cAA3C;;AAEA,MAAMC,MAAM,GAAG,MAAM;EACnB,IAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;EACnC,MAAMC,SAAS,GAAGX,GAAG,CAAC,qBAAD,EAAwBU,MAAxB,CAArB;EACA,MAAME,WAAW,GAAGX,GAAG,CAAC,UAAD,EAAaS,MAAb,CAAvB;EACA,MAAMG,WAAW,GAAGX,QAAQ,CAAC,KAAD,EAAQS,SAAR,CAA5B;EACA,MAAMG,UAAU,GAAGZ,QAAQ,CAAC,UAAD,EAAaS,SAAb,CAA3B;EAEA,OAAOC,WAAW,IAAKC,WAAW,IAAIC,UAAtC;AACD,CARD;;AAUA,OAAO,MAAMC,qBAAqB,GAAG,OACnCC,OADmC,EAEnCC,MAFmC,EAGnCC,YAHmC,EAInCC,YAJmC,EAKnCC,IALmC,EAMnCC,mBANmC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ypes from 'prop-types';
|
|
2
2
|
export declare type LottieAnimationProps = {
|
|
3
|
-
'aria-label'
|
|
3
|
+
'aria-label'?: string;
|
|
4
4
|
'data-name'?: string;
|
|
5
5
|
animationSrc: string;
|
|
6
6
|
loop?: boolean;
|
|
@@ -23,7 +23,7 @@ export declare const ANIMATION_CONTROL: {
|
|
|
23
23
|
loading: string;
|
|
24
24
|
};
|
|
25
25
|
declare const propTypes: {
|
|
26
|
-
'aria-label': PropTypes.
|
|
26
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
27
27
|
'data-name': PropTypes.Requireable<string>;
|
|
28
28
|
animationSrc: PropTypes.Validator<string>;
|
|
29
29
|
loop: PropTypes.Requireable<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../../src/atom/lottie-wrapper/prop-types.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,oBAAY,oBAAoB,GAAG;IACjC,YAAY,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../../src/atom/lottie-wrapper/prop-types.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,oBAAY,oBAAoB,GAAG;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,gBAAgB,CAAC,EAAE;QACjB,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;CAK7B,CAAC;AAEF,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;CAgBd,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -7,7 +7,7 @@ export const ANIMATION_CONTROL = {
|
|
|
7
7
|
loading: 'loading'
|
|
8
8
|
};
|
|
9
9
|
const propTypes = {
|
|
10
|
-
'aria-label': PropTypes.string
|
|
10
|
+
'aria-label': PropTypes.string,
|
|
11
11
|
'data-name': PropTypes.string,
|
|
12
12
|
animationSrc: PropTypes.string.isRequired,
|
|
13
13
|
loop: PropTypes.bool,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-types.js","names":["keys","PropTypes","ANIMATION_CONTROL","play","pause","stop","loading","propTypes","string","
|
|
1
|
+
{"version":3,"file":"prop-types.js","names":["keys","PropTypes","ANIMATION_CONTROL","play","pause","stop","loading","propTypes","string","animationSrc","isRequired","loop","bool","rendererSettings","shape","hideOnTransparent","className","height","number","width","ie11ImageBackup","backupImageClassName","autoplay","animationControl","oneOf"],"sources":["../../../src/atom/lottie-wrapper/prop-types.ts"],"sourcesContent":["import keys from 'lodash/fp/keys';\nimport PropTypes from 'prop-types';\n\nexport type LottieAnimationProps = {\n 'aria-label'?: string;\n 'data-name'?: string;\n animationSrc: string;\n loop?: boolean;\n rendererSettings?: {\n hideOnTransparent?: boolean;\n className?: string;\n };\n height?: number;\n width?: number;\n className?: string;\n ie11ImageBackup: string;\n backupImageClassName?: string;\n autoplay?: boolean;\n animationControl?: 'play' | 'pause' | 'stop' | 'loading';\n};\n\nexport const ANIMATION_CONTROL = {\n play: 'play',\n pause: 'pause',\n stop: 'stop',\n loading: 'loading'\n};\n\nconst propTypes = {\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string,\n animationSrc: PropTypes.string.isRequired,\n loop: PropTypes.bool,\n rendererSettings: PropTypes.shape({\n hideOnTransparent: PropTypes.bool,\n className: PropTypes.string\n }),\n height: PropTypes.number,\n width: PropTypes.number,\n className: PropTypes.string,\n ie11ImageBackup: PropTypes.string.isRequired,\n backupImageClassName: PropTypes.string,\n autoplay: PropTypes.bool,\n animationControl: PropTypes.oneOf(keys(ANIMATION_CONTROL))\n};\n\nexport default propTypes;\n"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,gBAAjB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAoBA,OAAO,MAAMC,iBAAiB,GAAG;EAC/BC,IAAI,EAAE,MADyB;EAE/BC,KAAK,EAAE,OAFwB;EAG/BC,IAAI,EAAE,MAHyB;EAI/BC,OAAO,EAAE;AAJsB,CAA1B;AAOP,MAAMC,SAAS,GAAG;EAChB,cAAcN,SAAS,CAACO,MADR;EAEhB,aAAaP,SAAS,CAACO,MAFP;EAGhBC,YAAY,EAAER,SAAS,CAACO,MAAV,CAAiBE,UAHf;EAIhBC,IAAI,EAAEV,SAAS,CAACW,IAJA;EAKhBC,gBAAgB,EAAEZ,SAAS,CAACa,KAAV,CAAgB;IAChCC,iBAAiB,EAAEd,SAAS,CAACW,IADG;IAEhCI,SAAS,EAAEf,SAAS,CAACO;EAFW,CAAhB,CALF;EAShBS,MAAM,EAAEhB,SAAS,CAACiB,MATF;EAUhBC,KAAK,EAAElB,SAAS,CAACiB,MAVD;EAWhBF,SAAS,EAAEf,SAAS,CAACO,MAXL;EAYhBY,eAAe,EAAEnB,SAAS,CAACO,MAAV,CAAiBE,UAZlB;EAahBW,oBAAoB,EAAEpB,SAAS,CAACO,MAbhB;EAchBc,QAAQ,EAAErB,SAAS,CAACW,IAdJ;EAehBW,gBAAgB,EAAEtB,SAAS,CAACuB,KAAV,CAAgBxB,IAAI,CAACE,iBAAD,CAApB;AAfF,CAAlB;AAkBA,eAAeK,SAAf"}
|
|
@@ -2,7 +2,7 @@ export default PromoCode;
|
|
|
2
2
|
declare function PromoCode(props: any, context: any): JSX.Element;
|
|
3
3
|
declare namespace PromoCode {
|
|
4
4
|
namespace contextTypes {
|
|
5
|
-
const translate: PropTypes.
|
|
5
|
+
const translate: PropTypes.Requireable<(...args: any[]) => any>;
|
|
6
6
|
}
|
|
7
7
|
namespace propTypes {
|
|
8
8
|
const promoCodeDescription: PropTypes.Requireable<string>;
|
|
@@ -61,7 +61,7 @@ declare class Provider extends React.Component<any, any, any> {
|
|
|
61
61
|
[x: string]: any;
|
|
62
62
|
}>;
|
|
63
63
|
}>>;
|
|
64
|
-
translate: PropTypes.
|
|
64
|
+
translate: PropTypes.Requireable<(...args: any[]) => any>;
|
|
65
65
|
Vimeo: PropTypes.Requireable<object>;
|
|
66
66
|
};
|
|
67
67
|
static getDerivedStateFromProps(props: any): {
|
|
@@ -100,7 +100,7 @@ class Provider extends React.Component {
|
|
|
100
100
|
Provider.childContextTypes = {
|
|
101
101
|
history: historyShape,
|
|
102
102
|
skin: skinShape,
|
|
103
|
-
translate: translateShape
|
|
103
|
+
translate: translateShape,
|
|
104
104
|
Vimeo: PropTypes.object
|
|
105
105
|
};
|
|
106
106
|
Provider.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","SrcPropType","ColorPropType","HexPropType","WebContext","useWebContext","DEFAULT_SKIN","common","good","bad","primary","life","brand","primaryAdd1","primaryAdd2","primaryAdd3","primaryAdd4","xtraLightGrey","light","medium","dark","grey","orangeAdd","orange","positive","lightGreen","negative","battle","white","black","mergeSkin","skin","historyShape","shape","createHref","func","push","skinShape","objectOf","images","logo","login","icons","mod","courses","arrayOf","texts","translateShape","Provider","Component","getDerivedStateFromProps","props","history","translate","constructor","context","Vimeo","state","getChildContext","render","children","Children","only","childContextTypes","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","SrcPropType","ColorPropType","HexPropType","WebContext","useWebContext","DEFAULT_SKIN","common","good","bad","primary","life","brand","primaryAdd1","primaryAdd2","primaryAdd3","primaryAdd4","xtraLightGrey","light","medium","dark","grey","orangeAdd","orange","positive","lightGreen","negative","battle","white","black","mergeSkin","skin","historyShape","shape","createHref","func","push","skinShape","objectOf","images","logo","login","icons","mod","courses","arrayOf","texts","translateShape","Provider","Component","getDerivedStateFromProps","props","history","translate","constructor","context","Vimeo","state","getChildContext","render","children","Children","only","childContextTypes","object","propTypes","node","isRequired","GetSkinFromContext","legacyContext","legacySkin"],"sources":["../../../src/atom/provider/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {defaultsDeep, get, getOr} from 'lodash/fp';\nimport {SrcPropType, ColorPropType, HexPropType} from '../../util/proptypes';\nimport WebContext, {useWebContext} from './web-context';\n\nconst DEFAULT_SKIN = {\n common: {\n good: '#24b694',\n bad: '#ed1c24',\n primary: '#00B0FF',\n life: '#ed1c24',\n brand: '#00B0FF',\n primaryAdd1: '#B3E5FC',\n primaryAdd2: '#0091EA',\n primaryAdd3: '#0277BD',\n primaryAdd4: '#015798',\n xtraLightGrey: '#FAFAFA',\n light: '#ECEFF1',\n medium: '#90A4AE',\n dark: '#546E7A',\n grey: '#607D8B',\n orangeAdd: '#FF7043',\n orange: '#FFA000',\n positive: '#3EC483',\n lightGreen: '#66BB6A',\n negative: '#F73F52',\n battle: '#FFE100',\n white: '#FFFFFF',\n black: '#14171A'\n }\n};\n\nconst mergeSkin = (skin = {}) => defaultsDeep(DEFAULT_SKIN, skin);\n\nconst historyShape = PropTypes.shape({\n createHref: PropTypes.func,\n push: PropTypes.func\n});\n\nconst skinShape = PropTypes.shape({\n common: PropTypes.objectOf(ColorPropType),\n images: PropTypes.shape({\n 'logo-mobile': SrcPropType,\n logo: SrcPropType,\n 'logo-email': SrcPropType,\n login: SrcPropType\n }),\n icons: PropTypes.objectOf(HexPropType),\n mod: PropTypes.objectOf(ColorPropType),\n courses: PropTypes.arrayOf(ColorPropType),\n texts: PropTypes.objectOf(ColorPropType)\n});\n\nconst translateShape = PropTypes.func;\n\nclass Provider extends React.Component {\n static propTypes = {\n history: historyShape,\n skin: skinShape,\n translate: translateShape,\n children: PropTypes.node.isRequired,\n Vimeo: PropTypes.shape({\n common: PropTypes.func\n })\n };\n\n static childContextTypes = {\n history: historyShape,\n skin: skinShape,\n translate: translateShape,\n Vimeo: PropTypes.object\n };\n\n static getDerivedStateFromProps(props) {\n const {history, skin, translate} = props;\n\n return {\n history,\n skin: mergeSkin(skin),\n translate\n };\n }\n\n constructor(props, context) {\n super(props, context);\n const {history, skin, translate, Vimeo} = props;\n // eslint-disable-next-line react/no-unused-state\n this.state = {history, skin: mergeSkin(skin), translate, Vimeo};\n }\n\n getChildContext() {\n return this.state;\n }\n\n render() {\n const {children} = this.props;\n return React.Children.only(children);\n }\n}\n\nconst GetSkinFromContext = legacyContext => {\n const context = useWebContext();\n const legacySkin = get('skin', legacyContext);\n const skin = getOr(legacySkin, 'skin', context);\n\n return skin;\n};\n\nexport {WebContext, useWebContext, GetSkinFromContext};\nexport default Provider;\n"],"mappings":";;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SAAQC,WAAR,EAAqBC,aAArB,EAAoCC,WAApC,QAAsD,sBAAtD;AACA,OAAOC,UAAP,IAAoBC,aAApB,QAAwC,eAAxC;AAEA,MAAMC,YAAY,GAAG;EACnBC,MAAM,EAAE;IACNC,IAAI,EAAE,SADA;IAENC,GAAG,EAAE,SAFC;IAGNC,OAAO,EAAE,SAHH;IAINC,IAAI,EAAE,SAJA;IAKNC,KAAK,EAAE,SALD;IAMNC,WAAW,EAAE,SANP;IAONC,WAAW,EAAE,SAPP;IAQNC,WAAW,EAAE,SARP;IASNC,WAAW,EAAE,SATP;IAUNC,aAAa,EAAE,SAVT;IAWNC,KAAK,EAAE,SAXD;IAYNC,MAAM,EAAE,SAZF;IAaNC,IAAI,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YD,aAAZ,CAAnB;;EACA,MAAMtC,IAAI,GAAG,OAAMuC,UAAN,EAAkB,MAAlB,EAA0Bf,OAA1B,CAAb;;EAEA,OAAOxB,IAAP;AACD,CAND;;AAQA,SAAQ3B,UAAR,EAAoBC,aAApB,EAAmC+D,kBAAnC;AACA,eAAepB,QAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/review-presentation/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/review-presentation/index.js"],"names":[],"mappings":";AAiDA,6DA8BC"}
|
|
@@ -28,7 +28,8 @@ const getIcon = icon => {
|
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
const ToolTip = ({
|
|
31
|
-
tooltipText
|
|
31
|
+
tooltipText,
|
|
32
|
+
'aria-label': moreDetailsAriaLabel
|
|
32
33
|
}) => {
|
|
33
34
|
return /*#__PURE__*/React.createElement("div", {
|
|
34
35
|
className: style.tooltipContainer
|
|
@@ -37,10 +38,11 @@ const ToolTip = ({
|
|
|
37
38
|
}, /*#__PURE__*/React.createElement(InformationIcon, {
|
|
38
39
|
className: style.informationIcon,
|
|
39
40
|
width: 12,
|
|
40
|
-
height: 12
|
|
41
|
+
height: 12,
|
|
42
|
+
"aria-label": moreDetailsAriaLabel
|
|
41
43
|
})), /*#__PURE__*/React.createElement("div", {
|
|
42
44
|
className: style.toolTip
|
|
43
|
-
}, /*#__PURE__*/React.createElement("
|
|
45
|
+
}, /*#__PURE__*/React.createElement("p", {
|
|
44
46
|
className: style.tooltipText
|
|
45
47
|
}, tooltipText)));
|
|
46
48
|
};
|
|
@@ -82,13 +84,15 @@ const ReviewPresentation = props => {
|
|
|
82
84
|
}, /*#__PURE__*/React.createElement("div", {
|
|
83
85
|
className: style.reviewListText
|
|
84
86
|
}, getIcon(key), " ", label.text), /*#__PURE__*/React.createElement(ToolTip, {
|
|
85
|
-
tooltipText: label.tooltipText
|
|
87
|
+
tooltipText: label.tooltipText,
|
|
88
|
+
"aria-label": label.moreDetailsAriaLabel
|
|
86
89
|
})));
|
|
87
90
|
}, labelsList)));
|
|
88
91
|
};
|
|
89
92
|
|
|
90
93
|
ToolTip.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
91
|
-
tooltipText: PropTypes.string
|
|
94
|
+
tooltipText: PropTypes.string,
|
|
95
|
+
'aria-label': PropTypes.string
|
|
92
96
|
} : {};
|
|
93
97
|
ReviewPresentation.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
94
98
|
export default ReviewPresentation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","getOr","map","NovaSolidStatusCheckCircle2","CheckIcon","NovaSolidVoteRewardsVoteHeart","HeartIcon","NovaCompositionCoorpacademyInformationIcon","InformationIcon","NovaSolidInterfaceFeedbackInterfaceQuestionMark","QuestionIcon","NovaLineSelectionCursorsCursorArrowTarget","TargetIcon","style","propTypes","ICONS","skills","questions","lifes","allright","getIcon","icon","Icon","labelIcon","ToolTip","tooltipText","tooltipContainer","tooltipIconContainer","informationIcon","toolTip","ReviewPresentation","props","ariaLabel","reviewTitle","reviewText","labelsList","reviewWrapper","__html","reviewListWrapper","convert","cap","label","key","reviewList","reviewListItemWrapper","reviewListText","text","string"],"sources":["../../../src/atom/review-presentation/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport getOr from 'lodash/fp/getOr';\nimport map from 'lodash/fp/map';\nimport {\n NovaSolidStatusCheckCircle2 as CheckIcon,\n NovaSolidVoteRewardsVoteHeart as HeartIcon,\n NovaCompositionCoorpacademyInformationIcon as InformationIcon,\n NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionIcon,\n NovaLineSelectionCursorsCursorArrowTarget as TargetIcon\n} from '@coorpacademy/nova-icons';\nimport style from './style.css';\nimport propTypes from './prop-types';\n\nconst ICONS = {\n skills: TargetIcon,\n questions: QuestionIcon,\n lifes: HeartIcon,\n allright: CheckIcon\n};\n\nconst getIcon = icon => {\n const Icon = getOr(null, icon, ICONS);\n\n /* istanbul ignore next */\n if (!Icon) {\n return <div className={style.labelIcon} />;\n }\n return <Icon className={style.labelIcon} />;\n};\n\nconst ToolTip = ({tooltipText}) => {\n return (\n <div className={style.tooltipContainer}>\n <div className={style.tooltipIconContainer}>\n <InformationIcon
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","getOr","map","NovaSolidStatusCheckCircle2","CheckIcon","NovaSolidVoteRewardsVoteHeart","HeartIcon","NovaCompositionCoorpacademyInformationIcon","InformationIcon","NovaSolidInterfaceFeedbackInterfaceQuestionMark","QuestionIcon","NovaLineSelectionCursorsCursorArrowTarget","TargetIcon","style","propTypes","ICONS","skills","questions","lifes","allright","getIcon","icon","Icon","labelIcon","ToolTip","tooltipText","moreDetailsAriaLabel","tooltipContainer","tooltipIconContainer","informationIcon","toolTip","ReviewPresentation","props","ariaLabel","reviewTitle","reviewText","labelsList","reviewWrapper","__html","reviewListWrapper","convert","cap","label","key","reviewList","reviewListItemWrapper","reviewListText","text","string"],"sources":["../../../src/atom/review-presentation/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport getOr from 'lodash/fp/getOr';\nimport map from 'lodash/fp/map';\nimport {\n NovaSolidStatusCheckCircle2 as CheckIcon,\n NovaSolidVoteRewardsVoteHeart as HeartIcon,\n NovaCompositionCoorpacademyInformationIcon as InformationIcon,\n NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionIcon,\n NovaLineSelectionCursorsCursorArrowTarget as TargetIcon\n} from '@coorpacademy/nova-icons';\nimport style from './style.css';\nimport propTypes from './prop-types';\n\nconst ICONS = {\n skills: TargetIcon,\n questions: QuestionIcon,\n lifes: HeartIcon,\n allright: CheckIcon\n};\n\nconst getIcon = icon => {\n const Icon = getOr(null, icon, ICONS);\n\n /* istanbul ignore next */\n if (!Icon) {\n return <div className={style.labelIcon} />;\n }\n return <Icon className={style.labelIcon} />;\n};\n\nconst ToolTip = ({tooltipText, 'aria-label': moreDetailsAriaLabel}) => {\n return (\n <div className={style.tooltipContainer}>\n <div className={style.tooltipIconContainer}>\n <InformationIcon\n className={style.informationIcon}\n width={12}\n height={12}\n aria-label={moreDetailsAriaLabel}\n />\n </div>\n <div className={style.toolTip}>\n <p className={style.tooltipText}>{tooltipText}</p>\n </div>\n </div>\n );\n};\n\nconst ReviewPresentation = props => {\n const {'aria-label': ariaLabel, reviewTitle, reviewText, labelsList} = props;\n return (\n <div className={style.reviewWrapper} aria-label={ariaLabel}>\n <div\n className={style.reviewTitle}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: reviewTitle}}\n />\n <div\n className={style.reviewText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: reviewText}}\n />\n <ul className={style.reviewListWrapper}>\n {map.convert({cap: false})((label, key) => {\n return (\n <li key={`step-${key}`} className={style.reviewList}>\n <div className={style.reviewListItemWrapper} data-tip data-for=\"reviewListItem\">\n <div className={style.reviewListText}>\n {getIcon(key)} {label.text}\n </div>\n <ToolTip tooltipText={label.tooltipText} aria-label={label.moreDetailsAriaLabel} />\n </div>\n </li>\n );\n }, labelsList)}\n </ul>\n </div>\n );\n};\n\nToolTip.propTypes = {\n tooltipText: PropTypes.string,\n 'aria-label': PropTypes.string\n};\n\nReviewPresentation.propTypes = propTypes;\n\nexport default ReviewPresentation;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,SACEC,2BAA2B,IAAIC,SADjC,EAEEC,6BAA6B,IAAIC,SAFnC,EAGEC,0CAA0C,IAAIC,eAHhD,EAIEC,+CAA+C,IAAIC,YAJrD,EAKEC,yCAAyC,IAAIC,UAL/C,QAMO,0BAN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AE;MAACI,MAAM,EAAEJ;IAAT;EAH3B,EADF,eAME;IACE,SAAS,EAAErB,KAAK,CAACsB,UADnB,CAEE;IAFF;IAGE,uBAAuB,EAAE;MAACG,MAAM,EAAEH;IAAT;EAH3B,EANF,eAWE;IAAI,SAAS,EAAEtB,KAAK,CAAC0B;EAArB,GACGrC,GAAG,CAACsC,OAAJ,CAAY;IAACC,GAAG,EAAE;EAAN,CAAZ,EAA0B,CAACC,KAAD,EAAQC,GAAR,KAAgB;IACzC,oBACE;MAAI,GAAG,EAAG,QAAOA,GAAI,EAArB;MAAwB,SAAS,EAAE9B,KAAK,CAAC+B;IAAzC,gBACE;MAAK,SAAS,EAAE/B,KAAK,CAACgC,qBAAtB;MAA6C,gBAA7C;MAAsD,YAAS;IAA/D,gBACE;MAAK,SAAS,EAAEhC,KAAK,CAACiC;IAAtB,GACG1B,OAAO,CAACuB,GAAD,CADV,OACkBD,KAAK,CAACK,IADxB,CADF,eAIE,oBAAC,OAAD;MAAS,WAAW,EAAEL,KAAK,CAACjB,WAA5B;MAAyC,cAAYiB,KAAK,CAAChB;IAA3D,EAJF,CADF,CADF;EAUD,CAXA,EAWEU,UAXF,CADH,CAXF,CADF;AA4BD,CA9BD;;AAgCAZ,OAAO,CAACV,SAAR,2CAAoB;EAClBW,WAAW,EAAEzB,SAAS,CAACgD,MADL;EAElB,cAAchD,SAAS,CAACgD;AAFN,CAApB;AAKAjB,kBAAkB,CAACjB,SAAnB,2CAA+BA,SAA/B;AAEA,eAAeiB,kBAAf"}
|
|
@@ -9,18 +9,22 @@ declare const propTypes: {
|
|
|
9
9
|
skills: PropTypes.Requireable<PropTypes.InferProps<{
|
|
10
10
|
text: PropTypes.Requireable<string>;
|
|
11
11
|
tooltipText: PropTypes.Requireable<string>;
|
|
12
|
+
moreDetailsAreaLabel: PropTypes.Requireable<string>;
|
|
12
13
|
}>>;
|
|
13
14
|
questions: PropTypes.Requireable<PropTypes.InferProps<{
|
|
14
15
|
text: PropTypes.Requireable<string>;
|
|
15
16
|
tooltipText: PropTypes.Requireable<string>;
|
|
17
|
+
moreDetailsAreaLabel: PropTypes.Requireable<string>;
|
|
16
18
|
}>>;
|
|
17
19
|
lifes: PropTypes.Requireable<PropTypes.InferProps<{
|
|
18
20
|
text: PropTypes.Requireable<string>;
|
|
19
21
|
tooltipText: PropTypes.Requireable<string>;
|
|
22
|
+
moreDetailsAreaLabel: PropTypes.Requireable<string>;
|
|
20
23
|
}>>;
|
|
21
24
|
allright: PropTypes.Requireable<PropTypes.InferProps<{
|
|
22
25
|
text: PropTypes.Requireable<string>;
|
|
23
26
|
tooltipText: PropTypes.Requireable<string>;
|
|
27
|
+
moreDetailsAreaLabel: PropTypes.Requireable<string>;
|
|
24
28
|
}>>;
|
|
25
29
|
}>>;
|
|
26
30
|
};
|
|
@@ -40,18 +44,22 @@ export declare type OnboardingProps = {
|
|
|
40
44
|
skills?: {
|
|
41
45
|
text?: string | undefined;
|
|
42
46
|
tooltipText?: string | undefined;
|
|
47
|
+
'aria-label'?: string | undefined;
|
|
43
48
|
} | undefined;
|
|
44
49
|
questions?: {
|
|
45
50
|
text?: string | undefined;
|
|
46
51
|
tooltipText?: string | undefined;
|
|
52
|
+
'aria-label'?: string | undefined;
|
|
47
53
|
};
|
|
48
54
|
lifes?: {
|
|
49
55
|
text?: string | undefined;
|
|
50
56
|
tooltipText?: string | undefined;
|
|
57
|
+
'aria-label'?: string | undefined;
|
|
51
58
|
} | undefined;
|
|
52
59
|
allright?: {
|
|
53
60
|
text?: string | undefined;
|
|
54
61
|
tooltipText?: string | undefined;
|
|
62
|
+
'aria-label'?: string | undefined;
|
|
55
63
|
} | undefined;
|
|
56
64
|
};
|
|
57
65
|
onPress: (event: GestureResponderEvent) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../../src/atom/review-presentation/prop-types.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACn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AI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;YAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;YACjC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;SACnC,GACD,SAAS,CAAC;KACf,CAAC;IACF,OAAO,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;CACjD,CAAC;AAEF,oBAAY,QAAQ,GAAG;IACrB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,SAAS,CAAC;QAAC,KAAK,EAAE,UAAU,CAAA;KAAC,CAAC,CAAC;CACtF,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
const levelItem = PropTypes.shape({
|
|
3
3
|
text: PropTypes.string,
|
|
4
|
-
tooltipText: PropTypes.string
|
|
4
|
+
tooltipText: PropTypes.string,
|
|
5
|
+
moreDetailsAreaLabel: PropTypes.string
|
|
5
6
|
});
|
|
6
7
|
const propTypes = {
|
|
7
8
|
'aria-label': PropTypes.string,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-types.js","names":["PropTypes","levelItem","shape","text","string","tooltipText","propTypes","reviewTitle","reviewText","labelsList","skills","questions","lifes","allright","OnboardingPropsTypes","onPress","func","TipPropsTypes","Icon","any"],"sources":["../../../src/atom/review-presentation/prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport {ColorValue, GestureResponderEvent, ViewStyle} from 'react-native';\n\nconst levelItem = PropTypes.shape({\n text: PropTypes.string,\n tooltipText: PropTypes.string\n});\n\nconst propTypes = {\n 'aria-label': PropTypes.string,\n reviewTitle: PropTypes.string,\n reviewText: PropTypes.string,\n labelsList: PropTypes.shape({\n skills: levelItem,\n questions: levelItem,\n lifes: levelItem,\n allright: levelItem\n })\n};\n\nexport default propTypes;\n\nexport const OnboardingPropsTypes = {\n onPress: PropTypes.func\n};\n\nexport const TipPropsTypes = {\n text: PropTypes.string,\n Icon: PropTypes.any\n};\n\nexport type OnboardingProps = {\n 'aria-label'?: string | undefined;\n reviewTitle?: string | undefined;\n reviewText?: string | undefined;\n labelsList?: {\n skills?:\n | {\n text?: string | undefined;\n tooltipText?: string | undefined;\n }\n | undefined;\n questions?: {\n text?: string | undefined;\n tooltipText?: string | undefined;\n };\n lifes?:\n | {\n text?: string | undefined;\n tooltipText?: string | undefined;\n }\n | undefined;\n allright?:\n | {\n text?: string | undefined;\n tooltipText?: string | undefined;\n }\n | undefined;\n };\n onPress: (event: GestureResponderEvent) => void;\n};\n\nexport type TipProps = {\n text: string | undefined;\n Icon: React.FC<{height: number; width: number; style: ViewStyle; color: ColorValue}>;\n};\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AAGA,MAAMC,SAAS,GAAGD,SAAS,CAACE,KAAV,CAAgB;EAChCC,IAAI,EAAEH,SAAS,CAACI,MADgB;EAEhCC,WAAW,EAAEL,SAAS,CAACI;
|
|
1
|
+
{"version":3,"file":"prop-types.js","names":["PropTypes","levelItem","shape","text","string","tooltipText","moreDetailsAreaLabel","propTypes","reviewTitle","reviewText","labelsList","skills","questions","lifes","allright","OnboardingPropsTypes","onPress","func","TipPropsTypes","Icon","any"],"sources":["../../../src/atom/review-presentation/prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport {ColorValue, GestureResponderEvent, ViewStyle} from 'react-native';\n\nconst levelItem = PropTypes.shape({\n text: PropTypes.string,\n tooltipText: PropTypes.string,\n moreDetailsAreaLabel: PropTypes.string\n});\n\nconst propTypes = {\n 'aria-label': PropTypes.string,\n reviewTitle: PropTypes.string,\n reviewText: PropTypes.string,\n labelsList: PropTypes.shape({\n skills: levelItem,\n questions: levelItem,\n lifes: levelItem,\n allright: levelItem\n })\n};\n\nexport default propTypes;\n\nexport const OnboardingPropsTypes = {\n onPress: PropTypes.func\n};\n\nexport const TipPropsTypes = {\n text: PropTypes.string,\n Icon: PropTypes.any\n};\n\nexport type OnboardingProps = {\n 'aria-label'?: string | undefined;\n reviewTitle?: string | undefined;\n reviewText?: string | undefined;\n labelsList?: {\n skills?:\n | {\n text?: string | undefined;\n tooltipText?: string | undefined;\n 'aria-label'?: string | undefined;\n }\n | undefined;\n questions?: {\n text?: string | undefined;\n tooltipText?: string | undefined;\n 'aria-label'?: string | undefined;\n };\n lifes?:\n | {\n text?: string | undefined;\n tooltipText?: string | undefined;\n 'aria-label'?: string | undefined;\n }\n | undefined;\n allright?:\n | {\n text?: string | undefined;\n tooltipText?: string | undefined;\n 'aria-label'?: string | undefined;\n }\n | undefined;\n };\n onPress: (event: GestureResponderEvent) => void;\n};\n\nexport type TipProps = {\n text: string | undefined;\n Icon: React.FC<{height: number; width: number; style: ViewStyle; color: ColorValue}>;\n};\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AAGA,MAAMC,SAAS,GAAGD,SAAS,CAACE,KAAV,CAAgB;EAChCC,IAAI,EAAEH,SAAS,CAACI,MADgB;EAEhCC,WAAW,EAAEL,SAAS,CAACI,MAFS;EAGhCE,oBAAoB,EAAEN,SAAS,CAACI;AAHA,CAAhB,CAAlB;AAMA,MAAMG,SAAS,GAAG;EAChB,cAAcP,SAAS,CAACI,MADR;EAEhBI,WAAW,EAAER,SAAS,CAACI,MAFP;EAGhBK,UAAU,EAAET,SAAS,CAACI,MAHN;EAIhBM,UAAU,EAAEV,SAAS,CAACE,KAAV,CAAgB;IAC1BS,MAAM,EAAEV,SADkB;IAE1BW,SAAS,EAAEX,SAFe;IAG1BY,KAAK,EAAEZ,SAHmB;IAI1Ba,QAAQ,EAAEb;EAJgB,CAAhB;AAJI,CAAlB;AAYA,eAAeM,SAAf;AAEA,OAAO,MAAMQ,oBAAoB,GAAG;EAClCC,OAAO,EAAEhB,SAAS,CAACiB;AADe,CAA7B;AAIP,OAAO,MAAMC,aAAa,GAAG;EAC3Bf,IAAI,EAAEH,SAAS,CAACI,MADW;EAE3Be,IAAI,EAAEnB,SAAS,CAACoB;AAFW,CAAtB"}
|
|
@@ -31,27 +31,26 @@ declare namespace Select {
|
|
|
31
31
|
}>;
|
|
32
32
|
}>>;
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
export const theme: PropTypes.Requireable<string>;
|
|
47
|
-
export const options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
34
|
+
const propTypes: {
|
|
35
|
+
title: PropTypes.Requireable<string>;
|
|
36
|
+
name: PropTypes.Requireable<string>;
|
|
37
|
+
className: PropTypes.Requireable<string>;
|
|
38
|
+
borderClassName: PropTypes.Requireable<string>;
|
|
39
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
40
|
+
multiple: PropTypes.Requireable<boolean>;
|
|
41
|
+
description: PropTypes.Requireable<string>;
|
|
42
|
+
required: PropTypes.Requireable<boolean>;
|
|
43
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
44
|
+
theme: PropTypes.Requireable<string>;
|
|
45
|
+
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
48
46
|
name: PropTypes.Validator<string>;
|
|
49
47
|
value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
50
48
|
selected: PropTypes.Requireable<boolean>;
|
|
51
49
|
validOption: PropTypes.Requireable<boolean>;
|
|
52
50
|
}> | null | undefined)[]>;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
modified: PropTypes.Requireable<boolean>;
|
|
52
|
+
error: PropTypes.Requireable<boolean>;
|
|
53
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
54
|
+
};
|
|
56
55
|
}
|
|
57
56
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":";;;;;;;;AA6BA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":";;;;;;;;AA6BA,qEA6JC"}
|
package/es/atom/select/index.js
CHANGED
|
@@ -43,7 +43,7 @@ const Select = (props, legacyContext) => {
|
|
|
43
43
|
modified = false,
|
|
44
44
|
error = false,
|
|
45
45
|
title: propTitle,
|
|
46
|
-
|
|
46
|
+
'aria-label': ariaLabel
|
|
47
47
|
} = props;
|
|
48
48
|
const skin = GetSkinFromContext(legacyContext);
|
|
49
49
|
const title = useMemo(() => propTitle ? `${propTitle}${required ? '*' : ''}` : null, [propTitle, required]);
|
|
@@ -83,10 +83,11 @@ const Select = (props, legacyContext) => {
|
|
|
83
83
|
const arrowView = !multiple ? /*#__PURE__*/React.createElement(ArrowDown, {
|
|
84
84
|
color: includes(theme, ['question', 'template', 'player']) ? arrowColor : black,
|
|
85
85
|
className: shouldUseSkinFontColor ? style.selectedArrow : style.arrow,
|
|
86
|
-
"aria-label":
|
|
86
|
+
"aria-label": ariaLabel,
|
|
87
|
+
"data-testid": "select-arrow-down-icon"
|
|
87
88
|
}) : null;
|
|
88
|
-
const
|
|
89
|
-
const composedClassName = useMemo(() => classnames(theme && theme !== 'coorpmanager' ? themeStyle[theme] :
|
|
89
|
+
const behaviorClassName = useMemo(() => getClassState(style.default, style.modified, style.error, modified, error), [error, modified]);
|
|
90
|
+
const composedClassName = useMemo(() => classnames(theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviorClassName, selected ? style.selected : style.unselected, className), [behaviorClassName, className, selected, theme]);
|
|
90
91
|
const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);
|
|
91
92
|
const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);
|
|
92
93
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -128,7 +129,6 @@ Select.contextTypes = {
|
|
|
128
129
|
};
|
|
129
130
|
Select.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
130
131
|
title: PropTypes.string,
|
|
131
|
-
moreAriaLabel: PropTypes.string,
|
|
132
132
|
name: PropTypes.string,
|
|
133
133
|
className: PropTypes.string,
|
|
134
134
|
borderClassName: PropTypes.string,
|
|
@@ -140,7 +140,8 @@ Select.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
140
140
|
theme: PropTypes.oneOf(keys(themeStyle)),
|
|
141
141
|
options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),
|
|
142
142
|
modified: PropTypes.bool,
|
|
143
|
-
error: PropTypes.bool
|
|
143
|
+
error: PropTypes.bool,
|
|
144
|
+
'aria-label': PropTypes.string
|
|
144
145
|
} : {};
|
|
145
146
|
export default Select;
|
|
146
147
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","classnames","filter","find","get","getOr","includes","keys","map","size","NovaCompositionNavigationArrowDown","ArrowDown","Provider","GetSkinFromContext","getClassState","style","themeStyle","invalid","header","mooc","question","sort","thematiques","player","template","coorpmanager","Select","props","legacyContext","name","options","className","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","moreAriaLabel","skin","optionList","option","index","value","selectOption","titleView","selected","selectedLabel","isSelectedInValidOption","validOption","handleChange","e","target","selectedOptions","black","color","shouldUseSkinFontColor","arrowColor","undefined","arrowView","selectedArrow","arrow","behaviourClassName","default","composedClassName","unselected","labelSize","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectBox","SelectOptionPropTypes","string","isRequired","oneOfType","number","bool","contextTypes","childContextTypes","propTypes","func","oneOf","arrayOf","shape"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {NovaCompositionNavigationArrowDown as ArrowDown} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n filter: style.filter,\n invalid: style.invalid,\n header: style.header,\n mooc: style.mooc,\n question: style.question,\n sort: style.sort,\n thematiques: style.thematiques,\n player: style.player,\n template: style.template,\n coorpmanager: null\n};\n\nconst Select = (props, legacyContext) => {\n const {\n name,\n options = [],\n className,\n borderClassName,\n onChange,\n multiple = false,\n disabled,\n required,\n description,\n theme,\n modified = false,\n error = false,\n title: propTitle,\n moreAriaLabel\n } = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const title = useMemo(\n () => (propTitle ? `${propTitle}${required ? '*' : ''}` : null),\n [propTitle, required]\n );\n\n const optionList =\n options &&\n options.map((option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title} </span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, options)),\n [multiple, options]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, options)),\n [multiple, options]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const shouldUseSkinFontColor = useMemo(\n () =>\n !isSelectedInValidOption && selected && includes(theme, ['question', 'template', 'player']),\n [isSelectedInValidOption, selected, theme]\n );\n const arrowColor = selected ? color : undefined;\n\n const arrowView = !multiple ? (\n <ArrowDown\n color={includes(theme, ['question', 'template', 'player']) ? arrowColor : black}\n className={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n aria-label={moreAriaLabel}\n />\n ) : null;\n const behaviourClassName = useMemo(\n () => getClassState(style.default, style.modified, style.error, modified, error),\n [error, modified]\n );\n const composedClassName = useMemo(\n () =>\n classnames(\n theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviourClassName,\n selected ? style.selected : style.unselected,\n className\n ),\n [behaviourClassName, className, selected, theme]\n );\n\n const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);\n\n const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);\n\n return (\n <div\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <label\n data-name=\"select-wrapper\"\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template'])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n >\n {selectedLabel}\n </span>\n {arrowView}\n <select\n data-name=\"native-select\"\n className={style.selectBox}\n title={selectedLabel}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool,\n validOption: PropTypes.bool\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n moreAriaLabel: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool\n};\n\nexport default Select;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,MAAP,MAAmB,kBAAnB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,QAAP,MAAqB,oBAArB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,SAAQC,kCAAkC,IAAIC,SAA9C,QAA8D,0BAA9D;AACA,OAAOC,QAAP,IAAkBC,kBAAlB,QAA2C,aAA3C;AACA,OAAOC,aAAP,MAA0B,4BAA1B;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,UAAU,GAAG;EACjBd,MAAM,EAAEa,KAAK,CAACb,MADG;EAEjBe,OAAO,EAAEF,KAAK,CAACE,OAFE;EAGjBC,MAAM,EAAEH,KAAK,CAACG,MAHG;EAIjBC,IAAI,EAAEJ,KAAK,CAACI,IAJK;EAKjBC,QAAQ,EAAEL,KAAK,CAACK,QALC;EAMjBC,IAAI,EAAEN,KAAK,CAACM,IANK;EAOjBC,WAAW,EAAEP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F;AAdA,CAAnB;AAiBA,eAAezD,MAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","classnames","filter","find","get","getOr","includes","keys","map","size","NovaCompositionNavigationArrowDown","ArrowDown","Provider","GetSkinFromContext","getClassState","style","themeStyle","invalid","header","mooc","question","sort","thematiques","player","template","coorpmanager","Select","props","legacyContext","name","options","className","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","ariaLabel","skin","optionList","option","index","value","selectOption","titleView","selected","selectedLabel","isSelectedInValidOption","validOption","handleChange","e","target","selectedOptions","black","color","shouldUseSkinFontColor","arrowColor","undefined","arrowView","selectedArrow","arrow","behaviorClassName","default","composedClassName","unselected","labelSize","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectBox","SelectOptionPropTypes","string","isRequired","oneOfType","number","bool","contextTypes","childContextTypes","propTypes","func","oneOf","arrayOf","shape"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {NovaCompositionNavigationArrowDown as ArrowDown} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n filter: style.filter,\n invalid: style.invalid,\n header: style.header,\n mooc: style.mooc,\n question: style.question,\n sort: style.sort,\n thematiques: style.thematiques,\n player: style.player,\n template: style.template,\n coorpmanager: null\n};\n\nconst Select = (props, legacyContext) => {\n const {\n name,\n options = [],\n className,\n borderClassName,\n onChange,\n multiple = false,\n disabled,\n required,\n description,\n theme,\n modified = false,\n error = false,\n title: propTitle,\n 'aria-label': ariaLabel\n } = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const title = useMemo(\n () => (propTitle ? `${propTitle}${required ? '*' : ''}` : null),\n [propTitle, required]\n );\n\n const optionList =\n options &&\n options.map((option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title} </span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, options)),\n [multiple, options]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, options)),\n [multiple, options]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const shouldUseSkinFontColor = useMemo(\n () =>\n !isSelectedInValidOption && selected && includes(theme, ['question', 'template', 'player']),\n [isSelectedInValidOption, selected, theme]\n );\n const arrowColor = selected ? color : undefined;\n\n const arrowView = !multiple ? (\n <ArrowDown\n color={includes(theme, ['question', 'template', 'player']) ? arrowColor : black}\n className={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n aria-label={ariaLabel}\n data-testid=\"select-arrow-down-icon\"\n />\n ) : null;\n const behaviorClassName = useMemo(\n () => getClassState(style.default, style.modified, style.error, modified, error),\n [error, modified]\n );\n const composedClassName = useMemo(\n () =>\n classnames(\n theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviorClassName,\n selected ? style.selected : style.unselected,\n className\n ),\n [behaviorClassName, className, selected, theme]\n );\n\n const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);\n\n const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);\n\n return (\n <div\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <label\n data-name=\"select-wrapper\"\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template'])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n >\n {selectedLabel}\n </span>\n {arrowView}\n <select\n data-name=\"native-select\"\n className={style.selectBox}\n title={selectedLabel}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool,\n validOption: PropTypes.bool\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool,\n 'aria-label': PropTypes.string\n};\n\nexport default Select;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,MAAP,MAAmB,kBAAnB;AACA,OAAOC,IAAP,MA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EAAEzC,SAAS,CAAC+E,MADA;EAEjBlD,IAAI,EAAE7B,SAAS,CAAC+E,MAFC;EAGjBhD,SAAS,EAAE/B,SAAS,CAAC+E,MAHJ;EAIjB/C,eAAe,EAAEhC,SAAS,CAAC+E,MAJV;EAKjB5C,QAAQ,EAAEnC,SAAS,CAACmF,IALH;EAMjBjD,QAAQ,EAAElC,SAAS,CAACmF,IANH;EAOjB9C,WAAW,EAAErC,SAAS,CAAC+E,MAPN;EAQjB3C,QAAQ,EAAEpC,SAAS,CAACmF,IARH;EASjBlD,QAAQ,EAAEjC,SAAS,CAACuF,IATH;EAUjBjD,KAAK,EAAEtC,SAAS,CAACwF,KAAV,CAAgBjF,IAAI,CAACS,UAAD,CAApB,CAVU;EAWjBc,OAAO,EAAE9B,SAAS,CAACyF,OAAV,CAAkBzF,SAAS,CAAC0F,KAAV,CAAgBZ,qBAAhB,CAAlB,CAXQ;EAYjBvC,QAAQ,EAAEvC,SAAS,CAACmF,IAZH;EAajB3C,KAAK,EAAExC,SAAS,CAACmF,IAbA;EAcjB,cAAcnF,SAAS,CAAC+E;AAdP,CAAnB;AAiBA,eAAerD,MAAf"}
|
|
@@ -2,7 +2,7 @@ export default TabContent;
|
|
|
2
2
|
declare function TabContent(props: any): JSX.Element;
|
|
3
3
|
declare namespace TabContent {
|
|
4
4
|
namespace contextTypes {
|
|
5
|
-
const translate: PropTypes.
|
|
5
|
+
const translate: PropTypes.Requireable<(...args: any[]) => any>;
|
|
6
6
|
}
|
|
7
7
|
namespace propTypes {
|
|
8
8
|
const tabTitle: PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/answer/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/answer/index.js"],"names":[],"mappings":";AA4EA,iDASC"}
|
|
@@ -14,6 +14,7 @@ import Qcm from '../questions/qcm';
|
|
|
14
14
|
import QcmGraphic from '../questions/qcm-graphic';
|
|
15
15
|
import QuestionRange from '../questions/question-range';
|
|
16
16
|
import Template from '../questions/template';
|
|
17
|
+
import Provider from '../../atom/provider';
|
|
17
18
|
import Audio from '../audio';
|
|
18
19
|
import style from './style.css';
|
|
19
20
|
import propTypes, { MediaViewPropTypes, TYPE_AUDIO, TYPE_IMAGE, TYPE_VIDEO } from './prop-types';
|
|
@@ -63,6 +64,8 @@ MediaView.propTypes = process.env.NODE_ENV !== "production" ? MediaViewPropTypes
|
|
|
63
64
|
const Switch = ({
|
|
64
65
|
model,
|
|
65
66
|
help
|
|
67
|
+
}, {
|
|
68
|
+
translate
|
|
66
69
|
}) => {
|
|
67
70
|
const {
|
|
68
71
|
type
|
|
@@ -84,7 +87,9 @@ const Switch = ({
|
|
|
84
87
|
return /*#__PURE__*/React.createElement(FreeText, model);
|
|
85
88
|
|
|
86
89
|
case 'dropDown':
|
|
87
|
-
return /*#__PURE__*/React.createElement(DropDown, model
|
|
90
|
+
return /*#__PURE__*/React.createElement(DropDown, _extends({}, model, {
|
|
91
|
+
"aria-label": translate('drop_down_icon')
|
|
92
|
+
}));
|
|
88
93
|
|
|
89
94
|
case 'slider':
|
|
90
95
|
return /*#__PURE__*/React.createElement(QuestionRange, model);
|
|
@@ -98,6 +103,9 @@ Switch.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
98
103
|
model: propTypes.model,
|
|
99
104
|
help: propTypes.help
|
|
100
105
|
} : {};
|
|
106
|
+
Switch.contextTypes = {
|
|
107
|
+
translate: Provider.childContextTypes.translate
|
|
108
|
+
};
|
|
101
109
|
|
|
102
110
|
const Answer = props => {
|
|
103
111
|
const {
|