@coorpacademy/components 11.2.7 → 11.2.8-alpha.3
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/html/index.native.d.ts.map +1 -1
- package/es/atom/html/index.native.js +3 -3
- package/es/atom/html/index.native.js.map +1 -1
- package/es/atom/review-presentation/index.native.js.map +1 -1
- package/es/atom/review-presentation/prop-types.d.ts +9 -3
- package/es/atom/review-presentation/prop-types.d.ts.map +1 -1
- package/es/atom/review-presentation/prop-types.js.map +1 -1
- package/es/atom/select-modal/index.native.d.ts +1 -1
- package/es/atom/select-modal/index.native.d.ts.map +1 -1
- package/es/atom/select-modal/index.native.js +5 -2
- package/es/atom/select-modal/index.native.js.map +1 -1
- package/es/molecule/questions/mobile/template/index.native.d.ts.map +1 -1
- package/es/molecule/questions/mobile/template/index.native.js +0 -13
- package/es/molecule/questions/mobile/template/index.native.js.map +1 -1
- package/es/molecule/review-correction-popin/index.native.d.ts.map +1 -1
- package/es/molecule/review-correction-popin/index.native.js +4 -3
- package/es/molecule/review-correction-popin/index.native.js.map +1 -1
- package/es/organism/review-congrats/index.native.js +1 -1
- package/es/organism/review-congrats/index.native.js.map +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/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/lib/atom/html/index.native.d.ts.map +1 -1
- package/lib/atom/html/index.native.js +2 -2
- package/lib/atom/html/index.native.js.map +1 -1
- package/lib/atom/review-presentation/index.native.js.map +1 -1
- package/lib/atom/review-presentation/prop-types.d.ts +9 -3
- package/lib/atom/review-presentation/prop-types.d.ts.map +1 -1
- package/lib/atom/review-presentation/prop-types.js.map +1 -1
- package/lib/atom/select-modal/index.native.d.ts +1 -1
- package/lib/atom/select-modal/index.native.d.ts.map +1 -1
- package/lib/atom/select-modal/index.native.js +5 -2
- package/lib/atom/select-modal/index.native.js.map +1 -1
- package/lib/molecule/questions/mobile/template/index.native.d.ts.map +1 -1
- package/lib/molecule/questions/mobile/template/index.native.js +0 -13
- package/lib/molecule/questions/mobile/template/index.native.js.map +1 -1
- package/lib/molecule/review-correction-popin/index.native.d.ts.map +1 -1
- package/lib/molecule/review-correction-popin/index.native.js +4 -3
- package/lib/molecule/review-correction-popin/index.native.js.map +1 -1
- package/lib/organism/review-congrats/index.native.js +1 -1
- package/lib/organism/review-congrats/index.native.js.map +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/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/package.json +2 -2
- package/locales/.mtslconfig.json +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["React","useEffect","useRef","useState","Animated","ScrollView","StyleSheet","Text","LottieView","NovaCompositionCoorpacademyStar","StarIcon","NovaSolidVoteRewardsRewardsBadge5","RankIcon","sequence","parallel","useAnimateProp","useTranslateY","useTranslateX","useTemplateContext","Button","BOX_STYLE","CardCongrats","createStyleSheet","theme","create","congrats","position","width","height","flexDirection","alignItems","paddingVertical","flex","buttons","paddingHorizontal","justifyContent","title","fontWeight","fontSize","lineHeight","marginVertical","color","colors","text","primary","confettis","flexGrow","pointerEvents","scrollView","scrollViewContent","fadeIn","property","fromValue","toValue","duration","translateHorizontally","ReviewCongrats","props","ariaLabel","animationLottie","cardCongratsStar","cardCongratsRank","buttonRevising","buttonRevisingSkill","styleSheet","setStylesheet","isCongratsTranslationDone","setCongratsTranslationDone","isRankShown","setRankShown","scrollViewRef","showCongrats","onComplete","translateCongrats","showConfettis","fadeInRank","translateRank","setTimeout","current","scrollToEnd","animatedRank","animatedStyle","fadeInStars","delay","translateStars","showButton1","showButton2","congratsSequence","start","_stylesheet","handleContinueRevisingPress","onClick","handleReviseAnotherSkillPress","showStarLottieAnimation","animationSrc","reviewCardTitle","reviewCardValue","rankSuffix","positive","battle","label","backgroundColor","uri"],"sources":["../../../src/organism/review-congrats/index.native.tsx"],"sourcesContent":["import React, {useEffect, useRef, useState} from 'react';\nimport {Animated, ScrollView, StyleSheet, Text, TextStyle, ViewStyle} from 'react-native';\nimport LottieView from 'lottie-react-native';\nimport {noop} from 'lodash/fp';\nimport {\n NovaCompositionCoorpacademyStar as StarIcon,\n NovaSolidVoteRewardsRewardsBadge5 as RankIcon\n} from '@coorpacademy/nova-icons';\nimport {\n sequence,\n parallel,\n useAnimateProp,\n useTranslateY,\n useTranslateX\n} from '@coorpacademy/react-native-animation';\nimport type {AnimatePropParams} from '@coorpacademy/react-native-animation/es/use-animate-prop';\n\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Button from '../../atom/button/index.native';\nimport {BOX_STYLE} from '../../variables/shadow';\nimport CardCongrats from '../../molecule/card-congrats/index.native';\nimport {ReviewCongratsProps} from './prop-types';\n\ntype StyleSheetType = {\n buttons: ViewStyle;\n congrats: ViewStyle;\n confettis: ViewStyle;\n scrollView: ViewStyle;\n scrollViewContent: ViewStyle;\n title: TextStyle;\n};\n\nconst createStyleSheet = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n congrats: {\n position: 'absolute',\n width: '100%',\n height: '100%',\n flexDirection: 'column',\n alignItems: 'center',\n paddingVertical: 90,\n flex: 1\n },\n buttons: {\n width: '100%',\n paddingHorizontal: 20,\n flexDirection: 'column',\n justifyContent: 'space-between',\n flex: 1\n },\n title: {\n fontWeight: '400',\n fontSize: 32,\n lineHeight: 40,\n marginVertical: 20,\n color: theme.colors.text.primary\n },\n confettis: {\n flexGrow: 1,\n position: 'absolute',\n width: '100%',\n height: '100%',\n pointerEvents: 'box-none'\n },\n scrollView: {\n height: 300\n },\n scrollViewContent: {\n alignItems: 'center',\n paddingHorizontal: 40\n }\n });\n\nconst fadeIn: AnimatePropParams = {\n property: 'opacity',\n fromValue: 0,\n toValue: 1,\n duration: 350\n};\n\nconst translateHorizontally = {\n property: 'translateX',\n fromValue: 180,\n toValue: 0,\n duration: 800\n};\n\nconst ReviewCongrats = (props: ReviewCongratsProps) => {\n const {\n 'aria-label': ariaLabel,\n animationLottie,\n title,\n cardCongratsStar,\n cardCongratsRank,\n buttonRevising,\n buttonRevisingSkill\n } = props;\n\n const {theme} = useTemplateContext();\n\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const [isCongratsTranslationDone, setCongratsTranslationDone] = useState<boolean>(false);\n const [isRankShown, setRankShown] = useState<boolean>(false);\n\n const scrollViewRef = useRef<ScrollView>(null);\n\n const showCongrats = useAnimateProp({\n property: 'opacity',\n fromValue: 0,\n toValue: 1,\n duration: 950,\n onComplete: () => {\n setCongratsTranslationDone(true);\n }\n });\n\n const translateCongrats = useTranslateY({\n fromValue: 100,\n toValue: 0,\n duration: 550\n });\n\n const showConfettis = useAnimateProp(fadeIn);\n const fadeInRank = useAnimateProp(fadeIn);\n const translateRank = useTranslateX({\n ...translateHorizontally,\n onComplete: () => {\n setRankShown(true);\n setTimeout(() => {\n scrollViewRef?.current?.scrollToEnd();\n }, 700);\n }\n });\n\n const animatedRank = [fadeInRank.animatedStyle, translateRank.animatedStyle];\n\n const fadeInStars = useAnimateProp({\n ...fadeIn,\n delay: cardCongratsRank ? 1000 : 0\n });\n\n const translateStars = useTranslateX({\n ...translateHorizontally,\n delay: cardCongratsRank ? 1000 : 0\n });\n\n const showButton1 = useAnimateProp(fadeIn);\n const showButton2 = useAnimateProp(fadeIn);\n\n const congratsSequence = sequence([\n parallel([showCongrats, translateCongrats]),\n parallel([\n showConfettis,\n cardCongratsRank\n ? sequence([parallel([fadeInRank, translateRank]), parallel([fadeInStars, translateStars])])\n : parallel([fadeInStars, translateStars])\n ]),\n sequence([showButton1, showButton2])\n ]);\n\n useEffect(() => {\n congratsSequence.start();\n // (required only once on mount)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme);\n setStylesheet(_stylesheet);\n }, [theme]);\n\n if (!styleSheet) {\n return null;\n }\n\n const handleContinueRevisingPress = buttonRevising?.onClick || noop;\n const handleReviseAnotherSkillPress = buttonRevisingSkill?.onClick || noop;\n const showStarLottieAnimation = !cardCongratsRank || isRankShown;\n\n return (\n <Animated.View\n style={[styleSheet.congrats, translateCongrats.animatedStyle, showCongrats.animatedStyle]}\n accessibilityLabel={ariaLabel}\n >\n <Text style={styleSheet.title}>{title}</Text>\n <ScrollView\n ref={scrollViewRef}\n horizontal\n showsHorizontalScrollIndicator={false}\n style={styleSheet.scrollView}\n contentContainerStyle={styleSheet.scrollViewContent}\n >\n {cardCongratsRank ? (\n <Animated.View style={animatedRank}>\n <CardCongrats\n animationUri={cardCongratsRank.animationLottie.animationSrc}\n text={cardCongratsRank.reviewCardTitle}\n value={`${cardCongratsRank.reviewCardValue} ${cardCongratsRank.rankSuffix}`}\n Icon={RankIcon}\n iconColor={theme.colors.positive}\n textColor={theme.colors.text.primary}\n direction=\"row-reverse\"\n />\n </Animated.View>\n ) : null}\n <Animated.View style={[fadeInStars.animatedStyle, translateStars.animatedStyle]}>\n <CardCongrats\n animationUri={\n showStarLottieAnimation ? cardCongratsStar.animationLottie.animationSrc : null\n }\n Icon={StarIcon}\n text={cardCongratsStar.reviewCardTitle}\n value={cardCongratsStar.reviewCardValue}\n iconColor={theme.colors.battle}\n textColor={theme.colors.battle}\n direction=\"row\"\n />\n </Animated.View>\n </ScrollView>\n\n <Animated.View style={styleSheet.buttons}>\n {buttonRevisingSkill ? (\n <Animated.View style={showButton1.animatedStyle}>\n <Button\n onPress={handleReviseAnotherSkillPress}\n accessibilityLabel={buttonRevisingSkill['aria-label']}\n submitValue={buttonRevisingSkill.label}\n style={{...BOX_STYLE, backgroundColor: '#fff'}}\n textStyle={{color: '#123'}}\n />\n </Animated.View>\n ) : null}\n {buttonRevising ? (\n <Animated.View style={showButton2.animatedStyle}>\n <Button\n onPress={handleContinueRevisingPress}\n accessibilityLabel={buttonRevising['aria-label']}\n submitValue={buttonRevising.label}\n />\n </Animated.View>\n ) : null}\n </Animated.View>\n\n {isCongratsTranslationDone ? (\n <Animated.View\n pointerEvents=\"none\"\n style={[styleSheet.confettis, showConfettis.animatedStyle]}\n >\n <LottieView source={{uri: animationLottie.animationSrc}} autoPlay loop={false} />\n </Animated.View>\n ) : null}\n </Animated.View>\n );\n};\n\nexport default ReviewCongrats;\n"],"mappings":";;;;AAAA,OAAOA,KAAP,IAAeC,SAAf,EAA0BC,MAA1B,EAAkCC,QAAlC,QAAiD,OAAjD;AACA,SAAQC,QAAR,EAAkBC,UAAlB,EAA8BC,UAA9B,EAA0CC,IAA1C,QAA2E,cAA3E;AACA,OAAOC,UAAP,MAAuB,qBAAvB;AAEA,SACEC,+BAA+B,IAAIC,QADrC,EAEEC,iCAAiC,IAAIC,QAFvC,QAGO,0BAHP;AAIA,SACEC,QADF,EAEEC,QAFF,EAGEC,cAHF,EAIEC,aAJF,EAKEC,aALF,QAMO,sCANP;AASA,SAAQC,kBAAR,QAAiC,4CAAjC;AAEA,OAAOC,MAAP,MAAmB,gCAAnB;AACA,SAAQC,SAAR,QAAwB,wBAAxB;AACA,OAAOC,YAAP,MAAyB,2CAAzB;;A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;AA0ED,CAtKD;;AAwKA,eAAetC,cAAf"}
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["React","useEffect","useRef","useState","Animated","ScrollView","StyleSheet","Text","LottieView","NovaCompositionCoorpacademyStar","StarIcon","NovaSolidVoteRewardsRewardsBadge5","RankIcon","sequence","parallel","useAnimateProp","useTranslateY","useTranslateX","useTemplateContext","Button","BOX_STYLE","CardCongrats","createStyleSheet","theme","create","congrats","position","width","height","flexDirection","alignItems","paddingVertical","flex","buttons","paddingHorizontal","justifyContent","title","fontWeight","fontSize","lineHeight","marginVertical","color","colors","text","primary","confettis","flexGrow","pointerEvents","scrollView","scrollViewContent","fadeIn","property","fromValue","toValue","duration","translateHorizontally","ReviewCongrats","props","ariaLabel","animationLottie","cardCongratsStar","cardCongratsRank","buttonRevising","buttonRevisingSkill","styleSheet","setStylesheet","isCongratsTranslationDone","setCongratsTranslationDone","isRankShown","setRankShown","scrollViewRef","showCongrats","onComplete","translateCongrats","showConfettis","fadeInRank","translateRank","setTimeout","current","scrollToEnd","animatedRank","animatedStyle","fadeInStars","delay","translateStars","showButton1","showButton2","congratsSequence","start","_stylesheet","handleContinueRevisingPress","onClick","handleReviseAnotherSkillPress","showStarLottieAnimation","animationSrc","reviewCardTitle","reviewCardValue","rankSuffix","positive","battle","label","backgroundColor","uri"],"sources":["../../../src/organism/review-congrats/index.native.tsx"],"sourcesContent":["import React, {useEffect, useRef, useState} from 'react';\nimport {Animated, ScrollView, StyleSheet, Text, TextStyle, ViewStyle} from 'react-native';\nimport LottieView from 'lottie-react-native';\nimport {noop} from 'lodash/fp';\nimport {\n NovaCompositionCoorpacademyStar as StarIcon,\n NovaSolidVoteRewardsRewardsBadge5 as RankIcon\n} from '@coorpacademy/nova-icons';\nimport {\n sequence,\n parallel,\n useAnimateProp,\n useTranslateY,\n useTranslateX\n} from '@coorpacademy/react-native-animation';\nimport type {AnimatePropParams} from '@coorpacademy/react-native-animation/es/use-animate-prop';\n\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Button from '../../atom/button/index.native';\nimport {BOX_STYLE} from '../../variables/shadow';\nimport CardCongrats from '../../molecule/card-congrats/index.native';\nimport {ReviewCongratsProps} from './prop-types';\n\ntype StyleSheetType = {\n buttons: ViewStyle;\n congrats: ViewStyle;\n confettis: ViewStyle;\n scrollView: ViewStyle;\n scrollViewContent: ViewStyle;\n title: TextStyle;\n};\n\nconst createStyleSheet = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n congrats: {\n position: 'absolute',\n width: '100%',\n height: '100%',\n flexDirection: 'column',\n alignItems: 'center',\n paddingVertical: 90,\n flex: 1\n },\n buttons: {\n width: '100%',\n paddingHorizontal: 20,\n flexDirection: 'column',\n justifyContent: 'space-between',\n height: 114\n },\n title: {\n fontWeight: '400',\n fontSize: 32,\n lineHeight: 40,\n marginVertical: 20,\n color: theme.colors.text.primary\n },\n confettis: {\n flexGrow: 1,\n position: 'absolute',\n width: '100%',\n height: '100%',\n pointerEvents: 'box-none'\n },\n scrollView: {\n height: 300\n },\n scrollViewContent: {\n alignItems: 'center',\n paddingHorizontal: 40\n }\n });\n\nconst fadeIn: AnimatePropParams = {\n property: 'opacity',\n fromValue: 0,\n toValue: 1,\n duration: 350\n};\n\nconst translateHorizontally = {\n property: 'translateX',\n fromValue: 180,\n toValue: 0,\n duration: 800\n};\n\nconst ReviewCongrats = (props: ReviewCongratsProps) => {\n const {\n 'aria-label': ariaLabel,\n animationLottie,\n title,\n cardCongratsStar,\n cardCongratsRank,\n buttonRevising,\n buttonRevisingSkill\n } = props;\n\n const {theme} = useTemplateContext();\n\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const [isCongratsTranslationDone, setCongratsTranslationDone] = useState<boolean>(false);\n const [isRankShown, setRankShown] = useState<boolean>(false);\n\n const scrollViewRef = useRef<ScrollView>(null);\n\n const showCongrats = useAnimateProp({\n property: 'opacity',\n fromValue: 0,\n toValue: 1,\n duration: 950,\n onComplete: () => {\n setCongratsTranslationDone(true);\n }\n });\n\n const translateCongrats = useTranslateY({\n fromValue: 100,\n toValue: 0,\n duration: 550\n });\n\n const showConfettis = useAnimateProp(fadeIn);\n const fadeInRank = useAnimateProp(fadeIn);\n const translateRank = useTranslateX({\n ...translateHorizontally,\n onComplete: () => {\n setRankShown(true);\n setTimeout(() => {\n scrollViewRef?.current?.scrollToEnd();\n }, 700);\n }\n });\n\n const animatedRank = [fadeInRank.animatedStyle, translateRank.animatedStyle];\n\n const fadeInStars = useAnimateProp({\n ...fadeIn,\n delay: cardCongratsRank ? 1000 : 0\n });\n\n const translateStars = useTranslateX({\n ...translateHorizontally,\n delay: cardCongratsRank ? 1000 : 0\n });\n\n const showButton1 = useAnimateProp(fadeIn);\n const showButton2 = useAnimateProp(fadeIn);\n\n const congratsSequence = sequence([\n parallel([showCongrats, translateCongrats]),\n parallel([\n showConfettis,\n cardCongratsRank\n ? sequence([parallel([fadeInRank, translateRank]), parallel([fadeInStars, translateStars])])\n : parallel([fadeInStars, translateStars])\n ]),\n sequence([showButton1, showButton2])\n ]);\n\n useEffect(() => {\n congratsSequence.start();\n // (required only once on mount)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme);\n setStylesheet(_stylesheet);\n }, [theme]);\n\n if (!styleSheet) {\n return null;\n }\n\n const handleContinueRevisingPress = buttonRevising?.onClick || noop;\n const handleReviseAnotherSkillPress = buttonRevisingSkill?.onClick || noop;\n const showStarLottieAnimation = !cardCongratsRank || isRankShown;\n\n return (\n <Animated.View\n style={[styleSheet.congrats, translateCongrats.animatedStyle, showCongrats.animatedStyle]}\n accessibilityLabel={ariaLabel}\n >\n <Text style={styleSheet.title}>{title}</Text>\n <ScrollView\n ref={scrollViewRef}\n horizontal\n showsHorizontalScrollIndicator={false}\n style={styleSheet.scrollView}\n contentContainerStyle={styleSheet.scrollViewContent}\n >\n {cardCongratsRank ? (\n <Animated.View style={animatedRank}>\n <CardCongrats\n animationUri={cardCongratsRank.animationLottie.animationSrc}\n text={cardCongratsRank.reviewCardTitle}\n value={`${cardCongratsRank.reviewCardValue} ${cardCongratsRank.rankSuffix}`}\n Icon={RankIcon}\n iconColor={theme.colors.positive}\n textColor={theme.colors.text.primary}\n direction=\"row-reverse\"\n />\n </Animated.View>\n ) : null}\n <Animated.View style={[fadeInStars.animatedStyle, translateStars.animatedStyle]}>\n <CardCongrats\n animationUri={\n showStarLottieAnimation ? cardCongratsStar.animationLottie.animationSrc : null\n }\n Icon={StarIcon}\n text={cardCongratsStar.reviewCardTitle}\n value={cardCongratsStar.reviewCardValue}\n iconColor={theme.colors.battle}\n textColor={theme.colors.battle}\n direction=\"row\"\n />\n </Animated.View>\n </ScrollView>\n\n <Animated.View style={styleSheet.buttons}>\n {buttonRevisingSkill ? (\n <Animated.View style={showButton1.animatedStyle}>\n <Button\n onPress={handleReviseAnotherSkillPress}\n accessibilityLabel={buttonRevisingSkill['aria-label']}\n submitValue={buttonRevisingSkill.label}\n style={{...BOX_STYLE, backgroundColor: '#fff'}}\n textStyle={{color: '#123'}}\n />\n </Animated.View>\n ) : null}\n {buttonRevising ? (\n <Animated.View style={showButton2.animatedStyle}>\n <Button\n onPress={handleContinueRevisingPress}\n accessibilityLabel={buttonRevising['aria-label']}\n submitValue={buttonRevising.label}\n />\n </Animated.View>\n ) : null}\n </Animated.View>\n\n {isCongratsTranslationDone ? (\n <Animated.View\n pointerEvents=\"none\"\n style={[styleSheet.confettis, showConfettis.animatedStyle]}\n >\n <LottieView source={{uri: animationLottie.animationSrc}} autoPlay loop={false} />\n </Animated.View>\n ) : null}\n </Animated.View>\n );\n};\n\nexport default ReviewCongrats;\n"],"mappings":";;;;AAAA,OAAOA,KAAP,IAAeC,SAAf,EAA0BC,MAA1B,EAAkCC,QAAlC,QAAiD,OAAjD;AACA,SAAQC,QAAR,EAAkBC,UAAlB,EAA8BC,UAA9B,EAA0CC,IAA1C,QAA2E,cAA3E;AAC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IApBN,CAxCF,EA+DGlC,yBAAyB,gBACxB,oBAAC,QAAD,CAAU,IAAV;IACE,aAAa,EAAC,MADhB;IAEE,KAAK,EAAE,CAACF,UAAU,CAACnB,SAAZ,EAAuB6B,aAAa,CAACO,aAArC;EAFT,gBAIE,oBAAC,UAAD;IAAY,MAAM,EAAE;MAACqB,GAAG,EAAE3C,eAAe,CAACmC;IAAtB,CAApB;IAAyD,QAAQ,MAAjE;IAAkE,IAAI,EAAE;EAAxE,EAJF,CADwB,GAOtB,IAtEN,CADF;AA0ED,CAtKD;;AAwKA,eAAetC,cAAf"}
|
|
@@ -18,6 +18,7 @@ declare namespace UserPreferences {
|
|
|
18
18
|
'data-name': PropTypes.Requireable<string>;
|
|
19
19
|
requiredSelection: PropTypes.Requireable<boolean>;
|
|
20
20
|
}> | null | undefined)[]>;
|
|
21
|
+
const moreInfoAriaLabel: PropTypes.Requireable<string>;
|
|
21
22
|
}
|
|
22
23
|
}
|
|
23
24
|
import PropTypes from "prop-types";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/user-preferences/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/user-preferences/index.js"],"names":[],"mappings":";AAoCA,0DAaC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _isEmpty from "lodash/fp/isEmpty";
|
|
2
2
|
import _map from "lodash/fp/map";
|
|
3
|
-
const _excluded = ["label", "description"];
|
|
3
|
+
const _excluded = ["label", "description", "moreInfoAriaLabel"];
|
|
4
4
|
|
|
5
5
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
6
6
|
|
|
@@ -15,7 +15,8 @@ import style from './style.css';
|
|
|
15
15
|
const Settings = props => {
|
|
16
16
|
const {
|
|
17
17
|
label,
|
|
18
|
-
description
|
|
18
|
+
description,
|
|
19
|
+
moreInfoAriaLabel
|
|
19
20
|
} = props,
|
|
20
21
|
settings = _objectWithoutPropertiesLoose(props, _excluded);
|
|
21
22
|
|
|
@@ -28,7 +29,8 @@ const Settings = props => {
|
|
|
28
29
|
}, /*#__PURE__*/React.createElement(InfoIcon, {
|
|
29
30
|
height: 16,
|
|
30
31
|
width: 16,
|
|
31
|
-
className: style.infoIcon
|
|
32
|
+
className: style.infoIcon,
|
|
33
|
+
"aria-label": moreInfoAriaLabel
|
|
32
34
|
}), /*#__PURE__*/React.createElement("div", {
|
|
33
35
|
className: style.showToolTip
|
|
34
36
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -43,17 +45,20 @@ Settings.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, InputS
|
|
|
43
45
|
|
|
44
46
|
const UserPreferences = props => {
|
|
45
47
|
const {
|
|
46
|
-
preferences = []
|
|
48
|
+
preferences = [],
|
|
49
|
+
moreInfoAriaLabel
|
|
47
50
|
} = props;
|
|
48
51
|
return /*#__PURE__*/React.createElement("div", {
|
|
49
52
|
className: style.preferences
|
|
50
53
|
}, _map(settings => /*#__PURE__*/React.createElement(Settings, _extends({}, settings, {
|
|
51
|
-
key: settings.label
|
|
54
|
+
key: settings.label,
|
|
55
|
+
moreInfoAriaLabel: moreInfoAriaLabel
|
|
52
56
|
})), preferences));
|
|
53
57
|
};
|
|
54
58
|
|
|
55
59
|
UserPreferences.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
56
|
-
preferences: PropTypes.arrayOf(PropTypes.shape(Settings.propTypes))
|
|
60
|
+
preferences: PropTypes.arrayOf(PropTypes.shape(Settings.propTypes)),
|
|
61
|
+
moreInfoAriaLabel: PropTypes.string
|
|
57
62
|
} : {};
|
|
58
63
|
export default UserPreferences;
|
|
59
64
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","NovaCompositionCoorpacademyInformationIcon","InfoIcon","InputSwitch","style","Settings","props","label","description","settings","infoIconWrapper","infoIcon","showToolTip","descriptionLabel","propTypes","string","isRequired","UserPreferences","preferences","arrayOf","shape"],"sources":["../../../src/organism/user-preferences/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {map, isEmpty} from 'lodash/fp';\nimport {NovaCompositionCoorpacademyInformationIcon as InfoIcon} from '@coorpacademy/nova-icons';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './style.css';\n\nconst Settings = props => {\n const {label, description, ...settings} = props;\n return (\n <div className={style.settings}>\n <InputSwitch {...settings} />\n <span className={style.label}>{label}</span>\n {isEmpty(description) ? null : (\n <div className={style.infoIconWrapper}>\n <InfoIcon
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","NovaCompositionCoorpacademyInformationIcon","InfoIcon","InputSwitch","style","Settings","props","label","description","moreInfoAriaLabel","settings","infoIconWrapper","infoIcon","showToolTip","descriptionLabel","propTypes","string","isRequired","UserPreferences","preferences","arrayOf","shape"],"sources":["../../../src/organism/user-preferences/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {map, isEmpty} from 'lodash/fp';\nimport {NovaCompositionCoorpacademyInformationIcon as InfoIcon} from '@coorpacademy/nova-icons';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './style.css';\n\nconst Settings = props => {\n const {label, description, moreInfoAriaLabel, ...settings} = props;\n return (\n <div className={style.settings}>\n <InputSwitch {...settings} />\n <span className={style.label}>{label}</span>\n {isEmpty(description) ? null : (\n <div className={style.infoIconWrapper}>\n <InfoIcon\n height={16}\n width={16}\n className={style.infoIcon}\n aria-label={moreInfoAriaLabel}\n />\n <div className={style.showToolTip}>\n <div className={style.descriptionLabel}>{description}</div>\n </div>\n </div>\n )}\n </div>\n );\n};\n\nSettings.propTypes = {\n ...InputSwitch.propTypes,\n label: PropTypes.string.isRequired,\n description: PropTypes.string\n};\n\nconst UserPreferences = props => {\n const {preferences = [], moreInfoAriaLabel} = props;\n\n return (\n <div className={style.preferences}>\n {map(\n settings => (\n <Settings {...settings} key={settings.label} moreInfoAriaLabel={moreInfoAriaLabel} />\n ),\n preferences\n )}\n </div>\n );\n};\n\nUserPreferences.propTypes = {\n preferences: PropTypes.arrayOf(PropTypes.shape(Settings.propTypes)),\n moreInfoAriaLabel: PropTypes.string\n};\n\nexport default UserPreferences;\n"],"mappings":";;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SAAQC,0CAA0C,IAAIC,QAAtD,QAAqE,0BAArE;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,QAAQ,GAAGC,KAAK,IAAI;EACxB,MAAM;IAACC,KAAD;IAAQC,WAAR;IAAqBC;EAArB,IAAuDH,KAA7D;EAAA,MAAiDI,QAAjD,iCAA6DJ,KAA7D;;EACA,oBACE;IAAK,SAAS,EAAEF,KAAK,CAACM;EAAtB,gBACE,oBAAC,WAAD,EAAiBA,QAAjB,CADF,eAEE;IAAM,SAAS,EAAEN,KAAK,CAACG;EAAvB,GAA+BA,KAA/B,CAFF,EAGG,SAAQC,WAAR,IAAuB,IAAvB,gBACC;IAAK,SAAS,EAAEJ,KAAK,CAACO;EAAtB,gBACE,oBAAC,QAAD;IACE,MAAM,EAAE,EADV;IAEE,KAAK,EAAE,EAFT;IAGE,SAAS,EAAEP,KAAK,CAACQ,QAHnB;IAIE,cAAYH;EAJd,EADF,eAOE;IAAK,SAAS,EAAEL,KAAK,CAACS;EAAtB,gBACE;IAAK,SAAS,EAAET,KAAK,CAACU;EAAtB,GAAyCN,WAAzC,CADF,CAPF,CAJJ,CADF;AAmBD,CArBD;;AAuBAH,QAAQ,CAACU,SAAT,wDACKZ,WAAW,CAACY,SADjB;EAEER,KAAK,EAAEP,SAAS,CAACgB,MAAV,CAAiBC,UAF1B;EAGET,WAAW,EAAER,SAAS,CAACgB;AAHzB;;AAMA,MAAME,eAAe,GAAGZ,KAAK,IAAI;EAC/B,MAAM;IAACa,WAAW,GAAG,EAAf;IAAmBV;EAAnB,IAAwCH,KAA9C;EAEA,oBACE;IAAK,SAAS,EAAEF,KAAK,CAACe;EAAtB,GACG,KACCT,QAAQ,iBACN,oBAAC,QAAD,eAAcA,QAAd;IAAwB,GAAG,EAAEA,QAAQ,CAACH,KAAtC;IAA6C,iBAAiB,EAAEE;EAAhE,GAFH,EAICU,WAJD,CADH,CADF;AAUD,CAbD;;AAeAD,eAAe,CAACH,SAAhB,2CAA4B;EAC1BI,WAAW,EAAEnB,SAAS,CAACoB,OAAV,CAAkBpB,SAAS,CAACqB,KAAV,CAAgBhB,QAAQ,CAACU,SAAzB,CAAlB,CADa;EAE1BN,iBAAiB,EAAET,SAAS,CAACgB;AAFH,CAA5B;AAKA,eAAeE,eAAf"}
|
|
@@ -3,6 +3,7 @@ declare class Progression extends React.Component<any, any, any> {
|
|
|
3
3
|
static propTypes: {
|
|
4
4
|
mainTitle: PropTypes.Validator<string>;
|
|
5
5
|
mainSubtitle: PropTypes.Validator<string>;
|
|
6
|
+
adaptiveAriaLabel: PropTypes.Requireable<string>;
|
|
6
7
|
total: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
7
8
|
label: PropTypes.Validator<string>;
|
|
8
9
|
stars: PropTypes.Validator<number>;
|
|
@@ -32,6 +33,7 @@ declare class Progression extends React.Component<any, any, any> {
|
|
|
32
33
|
label: PropTypes.Validator<string>;
|
|
33
34
|
level: PropTypes.Validator<string>;
|
|
34
35
|
state: PropTypes.Validator<string>;
|
|
36
|
+
adaptiveAriaLabel: PropTypes.Requireable<string>;
|
|
35
37
|
type: PropTypes.Validator<string>;
|
|
36
38
|
adaptive: PropTypes.Validator<boolean>;
|
|
37
39
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/activity/index.js"],"names":[],"mappings":";AAaA;IACE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/activity/index.js"],"names":[],"mappings":";AAaA;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAwBE;IAEF;;;;;;;;;;;;;;;;;;;;;;MAEE;IAEF,sCAIC;IAED,8BAME;IAEF,oCAKE;IAEF,sBAoFC;CACF"}
|
|
@@ -51,6 +51,7 @@ class Progression extends React.Component {
|
|
|
51
51
|
mainSubtitle,
|
|
52
52
|
recommendation = {},
|
|
53
53
|
progressions = [],
|
|
54
|
+
adaptiveAriaLabel,
|
|
54
55
|
total,
|
|
55
56
|
engines = [],
|
|
56
57
|
themeFilter = {},
|
|
@@ -66,7 +67,8 @@ class Progression extends React.Component {
|
|
|
66
67
|
className: style.loader
|
|
67
68
|
}, /*#__PURE__*/React.createElement(Loader, null)) : null;
|
|
68
69
|
const allProgressions = progressions.map(progression => /*#__PURE__*/React.createElement(ProgressionItem, _extends({}, _omit(['ref'], progression), {
|
|
69
|
-
key: progression.ref
|
|
70
|
+
key: progression.ref,
|
|
71
|
+
adaptiveAriaLabel: adaptiveAriaLabel
|
|
70
72
|
})));
|
|
71
73
|
const coreProgression = /*#__PURE__*/React.createElement("div", {
|
|
72
74
|
"data-name": "activityCore",
|
|
@@ -127,6 +129,7 @@ Progression.contextTypes = {
|
|
|
127
129
|
Progression.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
128
130
|
mainTitle: PropTypes.string.isRequired,
|
|
129
131
|
mainSubtitle: PropTypes.string.isRequired,
|
|
132
|
+
adaptiveAriaLabel: PropTypes.string,
|
|
130
133
|
total: PropTypes.shape({
|
|
131
134
|
label: PropTypes.string.isRequired,
|
|
132
135
|
stars: PropTypes.number.isRequired
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","classnames","Provider","Button","Select","Loader","ProgressionItem","EngineStars","StarsSummary","style","Progression","Component","constructor","props","context","handleClick","e","recommendation","stopPropagation","preventDefault","onClick","handleSelectTheme","themeFilter","onChange","bind","render","mainTitle","mainSubtitle","progressions","total","engines","loading","skin","primary","loader","allProgressions","map","progression","ref","coreProgression","core","themeSelect","options","selectBorder","select","recommendationSection","recommendationWrapper","title","subtitle","course","innerHTML","__html","courseTitle","cta","backgroundColor","default","headerProgression","wrapperCta","wrapperProgression","contextTypes","childContextTypes","propTypes","string","isRequired","shape","label","stars","number","arrayOf","bool","func"],"sources":["../../../src/template/activity/index.js"],"sourcesContent":["import React from 'react';\nimport {get, omit, isEmpty} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport Provider from '../../atom/provider';\nimport Button from '../../atom/button';\nimport Select from '../../atom/select';\nimport Loader from '../../atom/loader';\nimport ProgressionItem from './progression-item';\nimport EngineStars from './engine-stars';\nimport StarsSummary from './stars-summary';\nimport style from './style.css';\n\nclass Progression extends React.Component {\n static propTypes = {\n mainTitle: PropTypes.string.isRequired,\n mainSubtitle: PropTypes.string.isRequired,\n total: PropTypes.shape({\n label: PropTypes.string.isRequired,\n stars: PropTypes.number.isRequired\n }).isRequired,\n engines: PropTypes.arrayOf(PropTypes.shape(EngineStars.propTypes)),\n loading: PropTypes.bool.isRequired,\n progressions: PropTypes.arrayOf(\n PropTypes.shape({...ProgressionItem.propTypes, ref: PropTypes.string.isRequired})\n ),\n themeFilter: PropTypes.shape({\n options: Select.propTypes.options.isRequired,\n onChange: Select.propTypes.onChange\n }),\n recommendation: PropTypes.shape({\n cta: PropTypes.string.isRequired,\n title: PropTypes.string.isRequired,\n subtitle: PropTypes.string.isRequired,\n courseTitle: PropTypes.string.isRequired,\n onClick: PropTypes.func\n })\n };\n\n static contextTypes = {\n skin: Provider.childContextTypes.skin\n };\n\n constructor(props, context) {\n super(props, context);\n this.handleClick = this.handleClick.bind(this);\n this.handleSelectTheme = this.handleSelectTheme.bind(this);\n }\n\n handleClick = e => {\n const {recommendation} = this.props;\n e.stopPropagation();\n e.preventDefault();\n const {onClick} = recommendation;\n onClick && onClick(e);\n };\n\n handleSelectTheme = e => {\n const {\n themeFilter: {onChange}\n } = this.props;\n onChange && onChange(e);\n };\n\n render() {\n const {\n mainTitle,\n mainSubtitle,\n recommendation = {},\n progressions = [],\n total,\n engines = [],\n themeFilter = {},\n loading\n } = this.props;\n const {skin} = this.context;\n\n const primary = get('common.primary', skin);\n const loader = loading ? (\n <div className={style.loader}>\n <Loader />\n </div>\n ) : null;\n const allProgressions = progressions.map(progression => (\n <ProgressionItem
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","classnames","Provider","Button","Select","Loader","ProgressionItem","EngineStars","StarsSummary","style","Progression","Component","constructor","props","context","handleClick","e","recommendation","stopPropagation","preventDefault","onClick","handleSelectTheme","themeFilter","onChange","bind","render","mainTitle","mainSubtitle","progressions","adaptiveAriaLabel","total","engines","loading","skin","primary","loader","allProgressions","map","progression","ref","coreProgression","core","themeSelect","options","selectBorder","select","recommendationSection","recommendationWrapper","title","subtitle","course","innerHTML","__html","courseTitle","cta","backgroundColor","default","headerProgression","wrapperCta","wrapperProgression","contextTypes","childContextTypes","propTypes","string","isRequired","shape","label","stars","number","arrayOf","bool","func"],"sources":["../../../src/template/activity/index.js"],"sourcesContent":["import React from 'react';\nimport {get, omit, isEmpty} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport Provider from '../../atom/provider';\nimport Button from '../../atom/button';\nimport Select from '../../atom/select';\nimport Loader from '../../atom/loader';\nimport ProgressionItem from './progression-item';\nimport EngineStars from './engine-stars';\nimport StarsSummary from './stars-summary';\nimport style from './style.css';\n\nclass Progression extends React.Component {\n static propTypes = {\n mainTitle: PropTypes.string.isRequired,\n mainSubtitle: PropTypes.string.isRequired,\n adaptiveAriaLabel: PropTypes.string,\n total: PropTypes.shape({\n label: PropTypes.string.isRequired,\n stars: PropTypes.number.isRequired\n }).isRequired,\n engines: PropTypes.arrayOf(PropTypes.shape(EngineStars.propTypes)),\n loading: PropTypes.bool.isRequired,\n progressions: PropTypes.arrayOf(\n PropTypes.shape({...ProgressionItem.propTypes, ref: PropTypes.string.isRequired})\n ),\n themeFilter: PropTypes.shape({\n options: Select.propTypes.options.isRequired,\n onChange: Select.propTypes.onChange\n }),\n recommendation: PropTypes.shape({\n cta: PropTypes.string.isRequired,\n title: PropTypes.string.isRequired,\n subtitle: PropTypes.string.isRequired,\n courseTitle: PropTypes.string.isRequired,\n onClick: PropTypes.func\n })\n };\n\n static contextTypes = {\n skin: Provider.childContextTypes.skin\n };\n\n constructor(props, context) {\n super(props, context);\n this.handleClick = this.handleClick.bind(this);\n this.handleSelectTheme = this.handleSelectTheme.bind(this);\n }\n\n handleClick = e => {\n const {recommendation} = this.props;\n e.stopPropagation();\n e.preventDefault();\n const {onClick} = recommendation;\n onClick && onClick(e);\n };\n\n handleSelectTheme = e => {\n const {\n themeFilter: {onChange}\n } = this.props;\n onChange && onChange(e);\n };\n\n render() {\n const {\n mainTitle,\n mainSubtitle,\n recommendation = {},\n progressions = [],\n adaptiveAriaLabel,\n total,\n engines = [],\n themeFilter = {},\n loading\n } = this.props;\n const {skin} = this.context;\n\n const primary = get('common.primary', skin);\n const loader = loading ? (\n <div className={style.loader}>\n <Loader />\n </div>\n ) : null;\n const allProgressions = progressions.map(progression => (\n <ProgressionItem\n {...omit(['ref'], progression)}\n key={progression.ref}\n adaptiveAriaLabel={adaptiveAriaLabel}\n />\n ));\n\n const coreProgression = (\n <div data-name=\"activityCore\" className={style.core}>\n {allProgressions}\n </div>\n );\n const themeSelect = !isEmpty(themeFilter.options) ? (\n <Select\n borderClassName={style.selectBorder}\n className={style.select}\n theme=\"thematiques\"\n options={themeFilter.options}\n onChange={this.handleSelectTheme}\n />\n ) : null;\n const recommendationSection = !isEmpty(recommendation) ? (\n <div className={style.recommendationWrapper}>\n <p className={style.recommendationSection}>{recommendation.title} </p>\n <p className={style.recommendationSection}>\n <span>{recommendation.subtitle} </span>\n <span\n className={classnames(style.course, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: recommendation.courseTitle}}\n />\n </p>\n <Button\n type=\"link\"\n onClick={this.handleClick}\n submitValue={recommendation.cta}\n style={{\n backgroundColor: primary\n }}\n className={style.cta}\n />\n </div>\n ) : null;\n return (\n <div className={style.default}>\n <div data-name=\"activity-header\">\n <div className={style.mainTitle}>\n <span>{mainTitle}</span> {mainSubtitle}\n </div>\n <div className={style.headerProgression}>\n <div className={style.wrapperCta}>\n {themeSelect}\n {recommendationSection}\n </div>\n <StarsSummary engines={engines} total={total} />\n </div>\n </div>\n <div className={style.wrapperProgression} data-name=\"activityList\">\n {coreProgression}\n {loader}\n </div>\n </div>\n );\n }\n}\n\nexport default Progression;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,eAAP,MAA4B,oBAA5B;AACA,OAAOC,WAAP,MAAwB,gBAAxB;AACA,OAAOC,YAAP,MAAyB,iBAAzB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,WAAN,SAA0BX,KAAK,CAACY,SAAhC,CAA0C;EA+BxCC,WAAW,CAACC,KAAD,EAAQC,OAAR,EAAiB;IAC1B,MAAMD,KAAN,EAAaC,OAAb;;IAD0B,KAM5BC,WAN4B,GAMdC,CAAC,IAAI;MACjB,MAAM;QAACC;MAAD,IAAmB,KAAKJ,KAA9B;MACAG,CAAC,CAACE,eAAF;MACA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,cAAc,EAAEjB,SAAS,CAACiE,KAAV,CAAgB;IAC9BX,GAAG,EAAEtD,SAAS,CAAC+D,MAAV,CAAiBC,UADQ;IAE9BhB,KAAK,EAAEhD,SAAS,CAAC+D,MAAV,CAAiBC,UAFM;IAG9Bf,QAAQ,EAAEjD,SAAS,CAAC+D,MAAV,CAAiBC,UAHG;IAI9BX,WAAW,EAAErD,SAAS,CAAC+D,MAAV,CAAiBC,UAJA;IAK9B5C,OAAO,EAAEpB,SAAS,CAACuE;EALW,CAAhB;AAjBC,C;AA0IrB,eAAe7D,WAAf"}
|
|
@@ -10,6 +10,7 @@ declare namespace ProgressionItem {
|
|
|
10
10
|
const label: PropTypes.Validator<string>;
|
|
11
11
|
const level: PropTypes.Validator<string>;
|
|
12
12
|
const state: PropTypes.Validator<string>;
|
|
13
|
+
const adaptiveAriaLabel: PropTypes.Requireable<string>;
|
|
13
14
|
const type: PropTypes.Validator<string>;
|
|
14
15
|
const adaptive: PropTypes.Validator<boolean>;
|
|
15
16
|
const onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progression-item.d.ts","sourceRoot":"","sources":["../../../src/template/activity/progression-item.js"],"names":[],"mappings":";AAmCA,
|
|
1
|
+
{"version":3,"file":"progression-item.d.ts","sourceRoot":"","sources":["../../../src/template/activity/progression-item.js"],"names":[],"mappings":";AAmCA,wEAyFC"}
|
|
@@ -35,7 +35,8 @@ const ProgressionItem = (props, context) => {
|
|
|
35
35
|
maxStars,
|
|
36
36
|
state,
|
|
37
37
|
type,
|
|
38
|
-
steps = 0
|
|
38
|
+
steps = 0,
|
|
39
|
+
adaptiveAriaLabel
|
|
39
40
|
} = props;
|
|
40
41
|
|
|
41
42
|
const dark = _get('common.dark', skin);
|
|
@@ -52,7 +53,8 @@ const ProgressionItem = (props, context) => {
|
|
|
52
53
|
}
|
|
53
54
|
}, /*#__PURE__*/React.createElement(AdaptiveIcon, {
|
|
54
55
|
color: white,
|
|
55
|
-
height: 14
|
|
56
|
+
height: 14,
|
|
57
|
+
"aria-label": adaptiveAriaLabel
|
|
56
58
|
})) : null;
|
|
57
59
|
const handleCTAClick = useMemo(() => e => {
|
|
58
60
|
e.stopPropagation();
|
|
@@ -125,6 +127,7 @@ ProgressionItem.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
125
127
|
label: PropTypes.string.isRequired,
|
|
126
128
|
level: PropTypes.string.isRequired,
|
|
127
129
|
state: PropTypes.string.isRequired,
|
|
130
|
+
adaptiveAriaLabel: PropTypes.string,
|
|
128
131
|
type: PropTypes.string.isRequired,
|
|
129
132
|
adaptive: PropTypes.bool.isRequired,
|
|
130
133
|
onClick: PropTypes.func
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progression-item.js","names":["React","useMemo","PropTypes","classnames","NovaCompositionNavigationArrowRight","ArrowRightIcon","NovaCompositionCoorpacademyStar","StarIcon","NovaCompositionCoorpacademyTimer","TimerIcon","NovaCompositionCoorpacademyBolt","BoltIcon","NovaSolidSchoolScienceGraduationHat","CertificationIcon","NovaCompositionCoorpacademyAdaptive","AdaptiveIcon","NovaSolidContentContentBook1","LearnerIcon","NovaCompositionCoorpacademyScorm","ScormIcon","NovaCompositionCoorpacademyArticle","ArticleIcon","NovaCompositionCoorpacademyVideo","VideoIcon","NovaCompositionCoorpacademyMicrophone","PodcastIcon","NovaCompositionCoorpacademyRevision","RevisionIcon","Provider","ProgressBar","Link","style","ICONS","chapter","course","battle","certification","article","scorm","video","podcast","review","ProgressionItem","props","context","skin","disabled","adaptive","completion","label","level","onClick","stars","maxStars","state","type","steps","dark","primary","white","IconType","adaptiveIcon","backgroundColor","handleCTAClick","e","stopPropagation","preventDefault","link","color","cta","progressionItem","wrapperTitle","iconType","innerHTML","__html","smallStars","iconStar","borderRadius","propTypes","number","isRequired","bool","string","func","contextTypes","childContextTypes"],"sources":["../../../src/template/activity/progression-item.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {get, noop} from 'lodash/fp';\nimport {\n NovaCompositionNavigationArrowRight as ArrowRightIcon,\n NovaCompositionCoorpacademyStar as StarIcon,\n NovaCompositionCoorpacademyTimer as TimerIcon,\n NovaCompositionCoorpacademyBolt as BoltIcon,\n NovaSolidSchoolScienceGraduationHat as CertificationIcon,\n NovaCompositionCoorpacademyAdaptive as AdaptiveIcon,\n NovaSolidContentContentBook1 as LearnerIcon,\n NovaCompositionCoorpacademyScorm as ScormIcon,\n NovaCompositionCoorpacademyArticle as ArticleIcon,\n NovaCompositionCoorpacademyVideo as VideoIcon,\n NovaCompositionCoorpacademyMicrophone as PodcastIcon,\n NovaCompositionCoorpacademyRevision as RevisionIcon\n} from '@coorpacademy/nova-icons';\nimport Provider from '../../atom/provider';\nimport ProgressBar from '../../molecule/progress-bar';\nimport Link from '../../atom/link';\nimport style from './progression-item.css';\n\nconst ICONS = {\n chapter: TimerIcon,\n course: LearnerIcon,\n battle: BoltIcon,\n certification: CertificationIcon,\n article: ArticleIcon,\n scorm: ScormIcon,\n video: VideoIcon,\n podcast: PodcastIcon,\n review: RevisionIcon\n};\n\nconst ProgressionItem = (props, context) => {\n const {skin} = context;\n const {\n disabled = false,\n adaptive,\n completion,\n label,\n level,\n onClick = noop,\n stars,\n maxStars,\n state,\n type,\n steps = 0\n } = props;\n\n const dark = get('common.dark', skin);\n const primary = get('common.primary', skin);\n const white = get('common.white', skin);\n const IconType = ICONS[type];\n\n const adaptiveIcon = adaptive ? (\n <div\n className={style.adaptiveIcon}\n style={{\n backgroundColor: primary\n }}\n >\n <AdaptiveIcon color={white} height={14} />\n </div>\n ) : null;\n\n const handleCTAClick = useMemo(\n () => e => {\n e.stopPropagation();\n e.preventDefault();\n onClick && onClick(e);\n },\n [onClick]\n );\n\n const link = disabled ? null : (\n <Link style={{color: primary}} onClick={handleCTAClick} data-progression-state={state}>\n <span className={style.cta}>\n {state} <ArrowRightIcon color={primary} height={12} width={20} />\n </span>\n </Link>\n );\n\n return (\n <div className={classnames(style.progressionItem, disabled ? style.disabled : '')}>\n <div className={style.wrapperTitle}>\n <IconType className={style.iconType} color={dark} />\n <div data-name=\"activityLabel\" className={style.label} title={label}>\n <div\n className={style.innerHTML}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: label}}\n />\n {adaptiveIcon}\n </div>\n\n <div\n data-name=\"activityStars\"\n className={style.stars}\n style={{\n color: primary\n }}\n >\n {stars}\n {maxStars ? ' /' : null}\n {maxStars ? <span className={style.smallStars}>{maxStars}</span> : null}{' '}\n <StarIcon className={style.iconStar} color={primary} />\n </div>\n </div>\n <ProgressBar\n className={style.completion}\n value={completion * 100}\n max={100}\n steps={steps}\n style={{backgroundColor: primary, borderRadius: 0}}\n />\n <div className={style.state}>\n {link}\n <span className={style.level}>{level}</span>\n </div>\n </div>\n );\n};\n\nProgressionItem.propTypes = {\n completion: PropTypes.number.isRequired,\n stars: PropTypes.number.isRequired,\n maxStars: PropTypes.number,\n steps: PropTypes.number,\n disabled: PropTypes.bool,\n label: PropTypes.string.isRequired,\n level: PropTypes.string.isRequired,\n state: PropTypes.string.isRequired,\n type: PropTypes.string.isRequired,\n adaptive: PropTypes.bool.isRequired,\n onClick: PropTypes.func\n};\n\nProgressionItem.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nexport default ProgressionItem;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,SACEC,mCAAmC,IAAIC,cADzC,EAEEC,+BAA+B,IAAIC,QAFrC,EAGEC,gCAAgC,IAAIC,SAHtC,EAIEC,+BAA+B,IAAIC,QAJrC,EAKEC,mCAAmC,IAAIC,iBALzC,EAMEC,mCAAmC,IAAIC,YANzC,EAOEC,4BAA4B,IAAIC,WAPlC,EAQEC,gCAAgC,IAAIC,SARtC,EASEC,kCAAkC,IAAIC,WATxC,EAUEC,gCAAgC,IAAIC,SAVtC,EAWEC,qCAAqC,IAAIC,WAX3C,EAYEC,mCAAmC,IAAIC,YAZzC,QAaO,0BAbP;AAcA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,WAAP,MAAwB,6BAAxB;AACA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,KAAP,MAAkB,wBAAlB;AAEA,MAAMC,KAAK,GAAG;EACZC,OAAO,EAAExB,SADG;EAEZyB,MAAM,EAAEjB,WAFI;EAGZkB,MAAM,EAAExB,QAHI;EAIZyB,aAAa,EAAEvB,iBAJH;EAKZwB,OAAO,EAAEhB,WALG;EAMZiB,KAAK,EAAEnB,SANK;EAOZoB,KAAK,EAAEhB,SAPK;EAQZiB,OAAO,EAAEf,WARG;EASZgB,MAAM,EAAEd;AATI,CAAd;;AAYA,MAAMe,eAAe,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC1C,MAAM;IAACC;EAAD,IAASD,OAAf;EACA,MAAM;IACJE,QAAQ,GAAG,KADP;IAEJC,QAFI;IAGJC,UAHI;IAIJC,KAJI;IAKJC,KALI;IAMJC,OAAO,QANH;IAOJC,KAPI;IAQJC,QARI;IASJC,KATI;IAUJC,IAVI;IAWJC,KAAK,GAAG;
|
|
1
|
+
{"version":3,"file":"progression-item.js","names":["React","useMemo","PropTypes","classnames","NovaCompositionNavigationArrowRight","ArrowRightIcon","NovaCompositionCoorpacademyStar","StarIcon","NovaCompositionCoorpacademyTimer","TimerIcon","NovaCompositionCoorpacademyBolt","BoltIcon","NovaSolidSchoolScienceGraduationHat","CertificationIcon","NovaCompositionCoorpacademyAdaptive","AdaptiveIcon","NovaSolidContentContentBook1","LearnerIcon","NovaCompositionCoorpacademyScorm","ScormIcon","NovaCompositionCoorpacademyArticle","ArticleIcon","NovaCompositionCoorpacademyVideo","VideoIcon","NovaCompositionCoorpacademyMicrophone","PodcastIcon","NovaCompositionCoorpacademyRevision","RevisionIcon","Provider","ProgressBar","Link","style","ICONS","chapter","course","battle","certification","article","scorm","video","podcast","review","ProgressionItem","props","context","skin","disabled","adaptive","completion","label","level","onClick","stars","maxStars","state","type","steps","adaptiveAriaLabel","dark","primary","white","IconType","adaptiveIcon","backgroundColor","handleCTAClick","e","stopPropagation","preventDefault","link","color","cta","progressionItem","wrapperTitle","iconType","innerHTML","__html","smallStars","iconStar","borderRadius","propTypes","number","isRequired","bool","string","func","contextTypes","childContextTypes"],"sources":["../../../src/template/activity/progression-item.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {get, noop} from 'lodash/fp';\nimport {\n NovaCompositionNavigationArrowRight as ArrowRightIcon,\n NovaCompositionCoorpacademyStar as StarIcon,\n NovaCompositionCoorpacademyTimer as TimerIcon,\n NovaCompositionCoorpacademyBolt as BoltIcon,\n NovaSolidSchoolScienceGraduationHat as CertificationIcon,\n NovaCompositionCoorpacademyAdaptive as AdaptiveIcon,\n NovaSolidContentContentBook1 as LearnerIcon,\n NovaCompositionCoorpacademyScorm as ScormIcon,\n NovaCompositionCoorpacademyArticle as ArticleIcon,\n NovaCompositionCoorpacademyVideo as VideoIcon,\n NovaCompositionCoorpacademyMicrophone as PodcastIcon,\n NovaCompositionCoorpacademyRevision as RevisionIcon\n} from '@coorpacademy/nova-icons';\nimport Provider from '../../atom/provider';\nimport ProgressBar from '../../molecule/progress-bar';\nimport Link from '../../atom/link';\nimport style from './progression-item.css';\n\nconst ICONS = {\n chapter: TimerIcon,\n course: LearnerIcon,\n battle: BoltIcon,\n certification: CertificationIcon,\n article: ArticleIcon,\n scorm: ScormIcon,\n video: VideoIcon,\n podcast: PodcastIcon,\n review: RevisionIcon\n};\n\nconst ProgressionItem = (props, context) => {\n const {skin} = context;\n const {\n disabled = false,\n adaptive,\n completion,\n label,\n level,\n onClick = noop,\n stars,\n maxStars,\n state,\n type,\n steps = 0,\n adaptiveAriaLabel\n } = props;\n\n const dark = get('common.dark', skin);\n const primary = get('common.primary', skin);\n const white = get('common.white', skin);\n const IconType = ICONS[type];\n\n const adaptiveIcon = adaptive ? (\n <div\n className={style.adaptiveIcon}\n style={{\n backgroundColor: primary\n }}\n >\n <AdaptiveIcon color={white} height={14} aria-label={adaptiveAriaLabel} />\n </div>\n ) : null;\n\n const handleCTAClick = useMemo(\n () => e => {\n e.stopPropagation();\n e.preventDefault();\n onClick && onClick(e);\n },\n [onClick]\n );\n\n const link = disabled ? null : (\n <Link style={{color: primary}} onClick={handleCTAClick} data-progression-state={state}>\n <span className={style.cta}>\n {state} <ArrowRightIcon color={primary} height={12} width={20} />\n </span>\n </Link>\n );\n\n return (\n <div className={classnames(style.progressionItem, disabled ? style.disabled : '')}>\n <div className={style.wrapperTitle}>\n <IconType className={style.iconType} color={dark} />\n <div data-name=\"activityLabel\" className={style.label} title={label}>\n <div\n className={style.innerHTML}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: label}}\n />\n {adaptiveIcon}\n </div>\n\n <div\n data-name=\"activityStars\"\n className={style.stars}\n style={{\n color: primary\n }}\n >\n {stars}\n {maxStars ? ' /' : null}\n {maxStars ? <span className={style.smallStars}>{maxStars}</span> : null}{' '}\n <StarIcon className={style.iconStar} color={primary} />\n </div>\n </div>\n <ProgressBar\n className={style.completion}\n value={completion * 100}\n max={100}\n steps={steps}\n style={{backgroundColor: primary, borderRadius: 0}}\n />\n <div className={style.state}>\n {link}\n <span className={style.level}>{level}</span>\n </div>\n </div>\n );\n};\n\nProgressionItem.propTypes = {\n completion: PropTypes.number.isRequired,\n stars: PropTypes.number.isRequired,\n maxStars: PropTypes.number,\n steps: PropTypes.number,\n disabled: PropTypes.bool,\n label: PropTypes.string.isRequired,\n level: PropTypes.string.isRequired,\n state: PropTypes.string.isRequired,\n adaptiveAriaLabel: PropTypes.string,\n type: PropTypes.string.isRequired,\n adaptive: PropTypes.bool.isRequired,\n onClick: PropTypes.func\n};\n\nProgressionItem.context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CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAqBF,QAAA,MAAM,IAAI,UAAW,KAAK,
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/atom/html/index.native.tsx"],"names":[],"mappings":";AACA,OAAO,EAAO,SAAS,EAAE,UAAU,EAAE,SAAS,EAAC,MAAM,cAAc,CAAC;AAqBpE,oBAAY,KAAK,GAAG;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAqBF,QAAA,MAAM,IAAI,UAAW,KAAK,gBA0IzB,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -89,10 +89,10 @@ const Html = props => {
|
|
|
89
89
|
img: imageStyle || {}
|
|
90
90
|
});
|
|
91
91
|
|
|
92
|
-
let baseFontStyle = _extends({}, _index.DEFAULT_STYLE, {
|
|
92
|
+
let baseFontStyle = (0, _react.useMemo)(() => _extends({}, _index.DEFAULT_STYLE, {
|
|
93
93
|
fontSize,
|
|
94
94
|
color: theme.colors.black
|
|
95
|
-
});
|
|
95
|
+
}), [fontSize, theme]);
|
|
96
96
|
|
|
97
97
|
if (style) {
|
|
98
98
|
if (Array.isArray(style)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["HtmlBase","props","Html","templateContext","useTemplateContext","isDisabledBaseFontStyleColor","disableBaseFontStyleColor","useState","theme","children","fontSize","containerStyle","imageStyle","style","testID","anchorTextColor","HTML_ANCHOR_TEXT_COLOR","isTextCentered","numberOfLines","styles","p","marginVertical","textAlign","u","textDecorationLine","i","fontStyle","b","fontWeight","bold","s","tagsStyles","h1","h2","h3","h4","h5","h6","a","color","img","baseFontStyle","DEFAULT_TEXT_STYLE","colors","black","Array","isArray","styleObject","reduce","result","child","SpanRenderer","useCallback","htmlAttribs","_children","FontRenderer","replace","renderers","font","span","html","undefined"],"sources":["../../../src/atom/html/index.native.tsx"],"sourcesContent":["import React, {useCallback, useState} from 'react';\nimport {View, ViewStyle, ImageStyle, TextStyle} from 'react-native';\nimport RenderHTML, {\n CustomRendererProps,\n MixedStyleRecord,\n RenderHTMLProps,\n TBlock\n} from 'react-native-render-html';\n\nimport {HTML_ANCHOR_TEXT_COLOR} from '../../variables/theme.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport Text, {DEFAULT_STYLE as DEFAULT_TEXT_STYLE} from '../text/index.native';\n\ninterface CustomRenderHTMLProps extends RenderHTMLProps {\n baseFontStyle?: TextStyle;\n testID?: string;\n}\n\nconst HtmlBase = (props: CustomRenderHTMLProps) => {\n return <RenderHTML {...props} />;\n};\n\nexport type Props = {\n children: string;\n fontSize?: TextStyle['fontSize'];\n numberOfLines?: number;\n onLinkPress?: (url: string) => void;\n containerStyle?: ViewStyle;\n anchorTextColor?: string;\n imageStyle?: ImageStyle;\n style?: ViewStyle | ViewStyle[];\n testID?: string;\n isTextCentered?: boolean;\n};\n\ntype Styles = {\n p: {\n marginVertical: ViewStyle['marginVertical'];\n textAlign: TextStyle['textAlign'];\n };\n u: {\n textDecorationLine: TextStyle['textDecorationLine'];\n };\n i: {\n fontStyle: TextStyle['fontStyle'];\n };\n b: {\n fontWeight: TextStyle['fontWeight'];\n };\n s: {\n textDecorationLine: TextStyle['textDecorationLine'];\n };\n};\n\nconst Html = (props: Props) => {\n const templateContext = useTemplateContext();\n const [isDisabledBaseFontStyleColor, disableBaseFontStyleColor] = useState<boolean>(false);\n const {theme} = templateContext;\n const {\n children,\n fontSize,\n containerStyle,\n imageStyle,\n style,\n testID,\n anchorTextColor = HTML_ANCHOR_TEXT_COLOR,\n isTextCentered,\n numberOfLines\n } = props;\n\n // Don't use StyleSheet there, it's not a react style\n const styles: Styles = {\n p: {\n marginVertical: 0,\n textAlign: 'center'\n },\n u: {\n textDecorationLine: 'underline'\n },\n i: {\n fontStyle: 'italic'\n },\n b: {\n fontWeight: theme.fontWeight.bold\n },\n s: {\n textDecorationLine: 'line-through'\n }\n };\n\n const tagsStyles: MixedStyleRecord = {\n ...styles,\n h1: {fontSize},\n h2: {fontSize},\n h3: {fontSize},\n h4: {fontSize},\n h5: {fontSize},\n h6: {fontSize},\n a: {color: anchorTextColor},\n img: imageStyle || {}\n };\n\n let baseFontStyle: TextStyle = {...DEFAULT_TEXT_STYLE, fontSize, color: theme.colors.black};\n if (style) {\n if (Array.isArray(style)) {\n const styleObject = style.reduce((result, child) => ({\n ...result,\n ...child\n }));\n baseFontStyle = {\n ...baseFontStyle,\n ...styleObject\n };\n } else {\n baseFontStyle = {\n ...baseFontStyle,\n ...style\n };\n }\n }\n\n const SpanRenderer = useCallback(\n (htmlAttribs: CustomRendererProps<TBlock>, _children: string) => (\n <Text numberOfLines={numberOfLines}>{_children}</Text>\n ),\n [numberOfLines]\n );\n\n interface HtmlAttrib extends CustomRendererProps<TBlock> {\n color?: string;\n }\n\n const FontRenderer = useCallback(\n (htmlAttribs: HtmlAttrib, _children: string) => {\n if (htmlAttribs.color) {\n disableBaseFontStyleColor(true);\n }\n\n return (\n <Text\n key={1}\n style={{\n ...baseFontStyle,\n color: htmlAttribs.color?.replace(/ /g, '')\n }}\n >\n {_children}\n </Text>\n );\n },\n [baseFontStyle]\n );\n\n const renderers = {\n font: FontRenderer,\n span: SpanRenderer\n };\n\n return (\n <View testID={testID} style={containerStyle}>\n <HtmlBase\n // to text-align center on android\n // we have to encapsulate between <p> tag\n // and use custom style define on <p>\n // definition in component style doesn't work\n source={{\n // eslint-disable-next-line no-nested-ternary\n html: isTextCentered\n ? `<p>${children}</p>`\n : numberOfLines\n ? `<span>${children}</span>`\n : `${children}`\n }}\n tagsStyles={tagsStyles}\n baseFontStyle={{\n ...baseFontStyle,\n color: isDisabledBaseFontStyleColor ? undefined : baseFontStyle.color\n }}\n renderers={renderers}\n // this is exceptionally for the onboarding course\n // is the only course that has a gif in the context but the img tag\n // comes with width & height attr and these makes this lib do not render the gif\n // so to avoid it, we decided to ignore these attr\n ignoredStyles={['width', 'height']}\n testID=\"html-base\"\n />\n </View>\n );\n};\n\nexport default Html;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAOA;;AACA;;AACA;;;;;;;;;;AAOA,MAAMA,QAAQ,GAAIC,KAAD,IAAkC;EACjD,oBAAO,6BAAC,8BAAD,EAAgBA,KAAhB,CAAP;AACD,CAFD;;AAoCA,MAAMC,IAAI,GAAID,KAAD,IAAkB;EAC7B,MAAME,eAAe,GAAG,IAAAC,mCAAA,GAAxB;EACA,MAAM,CAACC,4BAAD,EAA+BC,yBAA/B,IAA4D,IAAAC,eAAA,EAAkB,KAAlB,CAAlE;EACA,MAAM;IAACC;EAAD,IAAUL,eAAhB;EACA,MAAM;IACJM,QADI;IAEJC,QAFI;IAGJC,cAHI;IAIJC,UAJI;IAKJC,KALI;IAMJC,MANI;IAOJC,eAAe,GAAGC,6BAPd;IAQJC,cARI;IASJC;EATI,IAUFjB,KAVJ,CAJ6B,CAgB7B;;EACA,MAAMkB,MAAc,GAAG;IACrBC,CAAC,EAAE;MACDC,cAAc,EAAE,CADf;MAEDC,SAAS,EAAE;IAFV,CADkB;IAKrBC,CAAC,EAAE;MACDC,kBAAkB,EAAE;IADnB,CALkB;IAQrBC,CAAC,EAAE;MACDC,SAAS,EAAE;IADV,CARkB;IAWrBC,CAAC,EAAE;MACDC,UAAU,EAAEpB,KAAK,CAACoB,UAAN,CAAiBC;IAD5B,CAXkB;IAcrBC,CAAC,EAAE;MACDN,kBAAkB,EAAE;IADnB;EAdkB,CAAvB;;EAmBA,MAAMO,UAA4B,gBAC7BZ,MAD6B;IAEhCa,EAAE,EAAE;MAACtB;IAAD,CAF4B;IAGhCuB,EAAE,EAAE;MAACvB;IAAD,CAH4B;IAIhCwB,EAAE,EAAE;MAACxB;IAAD,CAJ4B;IAKhCyB,EAAE,EAAE;MAACzB;IAAD,CAL4B;IAMhC0B,EAAE,EAAE;MAAC1B;IAAD,CAN4B;IAOhC2B,EAAE,EAAE;MAAC3B;IAAD,CAP4B;IAQhC4B,CAAC,EAAE;MAACC,KAAK,EAAExB;IAAR,CAR6B;IAShCyB,GAAG,EAAE5B,UAAU,IAAI;EATa,EAAlC;;EAYA,IAAI6B,aAAwB,
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["HtmlBase","props","Html","templateContext","useTemplateContext","isDisabledBaseFontStyleColor","disableBaseFontStyleColor","useState","theme","children","fontSize","containerStyle","imageStyle","style","testID","anchorTextColor","HTML_ANCHOR_TEXT_COLOR","isTextCentered","numberOfLines","styles","p","marginVertical","textAlign","u","textDecorationLine","i","fontStyle","b","fontWeight","bold","s","tagsStyles","h1","h2","h3","h4","h5","h6","a","color","img","baseFontStyle","useMemo","DEFAULT_TEXT_STYLE","colors","black","Array","isArray","styleObject","reduce","result","child","SpanRenderer","useCallback","htmlAttribs","_children","FontRenderer","replace","renderers","font","span","html","undefined"],"sources":["../../../src/atom/html/index.native.tsx"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport {View, ViewStyle, ImageStyle, TextStyle} from 'react-native';\nimport RenderHTML, {\n CustomRendererProps,\n MixedStyleRecord,\n RenderHTMLProps,\n TBlock\n} from 'react-native-render-html';\n\nimport {HTML_ANCHOR_TEXT_COLOR} from '../../variables/theme.native';\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport Text, {DEFAULT_STYLE as DEFAULT_TEXT_STYLE} from '../text/index.native';\n\ninterface CustomRenderHTMLProps extends RenderHTMLProps {\n baseFontStyle?: TextStyle;\n testID?: string;\n}\n\nconst HtmlBase = (props: CustomRenderHTMLProps) => {\n return <RenderHTML {...props} />;\n};\n\nexport type Props = {\n children: string;\n fontSize?: TextStyle['fontSize'];\n numberOfLines?: number;\n onLinkPress?: (url: string) => void;\n containerStyle?: ViewStyle;\n anchorTextColor?: string;\n imageStyle?: ImageStyle;\n style?: ViewStyle | ViewStyle[];\n testID?: string;\n isTextCentered?: boolean;\n};\n\ntype Styles = {\n p: {\n marginVertical: ViewStyle['marginVertical'];\n textAlign: TextStyle['textAlign'];\n };\n u: {\n textDecorationLine: TextStyle['textDecorationLine'];\n };\n i: {\n fontStyle: TextStyle['fontStyle'];\n };\n b: {\n fontWeight: TextStyle['fontWeight'];\n };\n s: {\n textDecorationLine: TextStyle['textDecorationLine'];\n };\n};\n\nconst Html = (props: Props) => {\n const templateContext = useTemplateContext();\n const [isDisabledBaseFontStyleColor, disableBaseFontStyleColor] = useState<boolean>(false);\n const {theme} = templateContext;\n const {\n children,\n fontSize,\n containerStyle,\n imageStyle,\n style,\n testID,\n anchorTextColor = HTML_ANCHOR_TEXT_COLOR,\n isTextCentered,\n numberOfLines\n } = props;\n\n // Don't use StyleSheet there, it's not a react style\n const styles: Styles = {\n p: {\n marginVertical: 0,\n textAlign: 'center'\n },\n u: {\n textDecorationLine: 'underline'\n },\n i: {\n fontStyle: 'italic'\n },\n b: {\n fontWeight: theme.fontWeight.bold\n },\n s: {\n textDecorationLine: 'line-through'\n }\n };\n\n const tagsStyles: MixedStyleRecord = {\n ...styles,\n h1: {fontSize},\n h2: {fontSize},\n h3: {fontSize},\n h4: {fontSize},\n h5: {fontSize},\n h6: {fontSize},\n a: {color: anchorTextColor},\n img: imageStyle || {}\n };\n\n let baseFontStyle: TextStyle = useMemo(\n () => ({...DEFAULT_TEXT_STYLE, fontSize, color: theme.colors.black}),\n [fontSize, theme]\n );\n\n if (style) {\n if (Array.isArray(style)) {\n const styleObject = style.reduce((result, child) => ({\n ...result,\n ...child\n }));\n baseFontStyle = {\n ...baseFontStyle,\n ...styleObject\n };\n } else {\n baseFontStyle = {\n ...baseFontStyle,\n ...style\n };\n }\n }\n\n const SpanRenderer = useCallback(\n (htmlAttribs: CustomRendererProps<TBlock>, _children: string) => (\n <Text numberOfLines={numberOfLines}>{_children}</Text>\n ),\n [numberOfLines]\n );\n\n interface HtmlAttrib extends CustomRendererProps<TBlock> {\n color?: string;\n }\n\n const FontRenderer = useCallback(\n (htmlAttribs: HtmlAttrib, _children: string) => {\n if (htmlAttribs.color) {\n disableBaseFontStyleColor(true);\n }\n\n return (\n <Text\n key={1}\n style={{\n ...baseFontStyle,\n color: htmlAttribs.color?.replace(/ /g, '')\n }}\n >\n {_children}\n </Text>\n );\n },\n [baseFontStyle]\n );\n\n const renderers = {\n font: FontRenderer,\n span: SpanRenderer\n };\n\n return (\n <View testID={testID} style={containerStyle}>\n <HtmlBase\n // to text-align center on android\n // we have to encapsulate between <p> tag\n // and use custom style define on <p>\n // definition in component style doesn't work\n source={{\n // eslint-disable-next-line no-nested-ternary\n html: isTextCentered\n ? `<p>${children}</p>`\n : numberOfLines\n ? `<span>${children}</span>`\n : `${children}`\n }}\n tagsStyles={tagsStyles}\n baseFontStyle={{\n ...baseFontStyle,\n color: isDisabledBaseFontStyleColor ? undefined : baseFontStyle.color\n }}\n renderers={renderers}\n // this is exceptionally for the onboarding course\n // is the only course that has a gif in the context but the img tag\n // comes with width & height attr and these makes this lib do not render the gif\n // so to avoid it, we decided to ignore these attr\n ignoredStyles={['width', 'height']}\n testID=\"html-base\"\n />\n </View>\n );\n};\n\nexport default Html;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAOA;;AACA;;AACA;;;;;;;;;;AAOA,MAAMA,QAAQ,GAAIC,KAAD,IAAkC;EACjD,oBAAO,6BAAC,8BAAD,EAAgBA,KAAhB,CAAP;AACD,CAFD;;AAoCA,MA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,GACf,MAAKR,QAAS,MADC,GAEhBS,aAAa,GACZ,SAAQT,QAAS,SADL,GAEZ,GAAEA,QAAS;IANV,CALV;IAaE,UAAU,EAAEsB,UAbd;IAcE,aAAa,eACRU,aADQ;MAEXF,KAAK,EAAElC,4BAA4B,GAAGyD,SAAH,GAAerB,aAAa,CAACF;IAFrD,EAdf;IAkBE,SAAS,EAAEmB,SAlBb,CAmBE;IACA;IACA;IACA;IAtBF;IAuBE,aAAa,EAAE,CAAC,OAAD,EAAU,QAAV,CAvBjB;IAwBE,MAAM,EAAC;EAxBT,EADF,CADF;AA8BD,CA1ID;;eA4IexD,I"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["createStyleSheet","brandTheme","theme","StyleSheet","create","container","backgroundColor","colors","white","justifyContent","flex","padding","paddingTop","HEADER_HEIGHT","title","height","width","fontSize","xxlarge","fontWeight","bold","lineHeight","color","text","primary","marginBottom","spacing","small","large","opacity","tip","flexDirection","overflow","alignItems","borderRadius","gray","extra","marginTop","micro","tipText","icon","margin","button","cta","buttonText","alignSelf","Tip","props","templateContext","useTemplateContext","styleSheet","setStylesheet","useState","Icon","useEffect","_stylesheet","Onboarding","translations","onPress","appReview","presentation","TargetIcon","labelList","skills","QuestionMarkIcon","questions","HeartIcon","lifes","CheckCircle2Icon","allright","ok"],"sources":["../../../src/atom/review-presentation/index.native.tsx"],"sourcesContent":["import React, {useState, useEffect} from 'react';\nimport {View, StyleSheet, Text, ViewStyle, TextStyle} from 'react-native';\nimport {\n NovaLineSelectionCursorsCursorArrowTarget as TargetIcon,\n NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionMarkIcon,\n NovaSolidStatusCheckCircle2 as CheckCircle2Icon,\n NovaCompositionCoorpacademyVoteHeartOutline as HeartIcon\n} from '@coorpacademy/nova-icons';\n\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport {HEADER_HEIGHT} from '../../organism/header-v2/index.native';\nimport Touchable from '../../hoc/touchable/index.native';\nimport Html from '../html/index.native';\nimport {Brand} from '../../variables/brand.native';\nimport {OnboardingProps, TipProps} from './prop-types';\n\ntype StyleSheetType = {\n container: ViewStyle;\n title: TextStyle;\n text: TextStyle;\n tip: ViewStyle;\n tipText: TextStyle;\n icon: ViewStyle;\n button: ViewStyle;\n buttonText: TextStyle;\n};\n\nconst createStyleSheet = (brandTheme: Brand, theme: Theme): StyleSheetType =>\n StyleSheet.create({\n container: {\n backgroundColor: theme.colors.white,\n justifyContent: 'space-between',\n flex: 1,\n padding: 20,\n paddingTop: HEADER_HEIGHT + 20\n },\n title: {\n height: 72,\n width: 268,\n fontSize: theme.fontSize.xxlarge,\n fontWeight: theme.fontWeight.bold,\n lineHeight: 36,\n color: theme.colors.text.primary,\n marginBottom: theme.spacing.small\n },\n text: {\n fontSize: theme.fontSize.large,\n color: theme.colors.text.primary,\n opacity: 0.7,\n marginBottom: theme.spacing.small\n },\n tip: {\n flexDirection: 'row',\n overflow: 'hidden',\n alignItems: 'center',\n height: 54,\n borderRadius: 8,\n backgroundColor: theme.colors.gray.extra,\n marginTop: theme.spacing.micro,\n marginBottom: theme.spacing.micro\n },\n tipText: {\n fontSize: 16,\n lineHeight: 22,\n color: theme.colors.text.primary\n },\n icon: {\n margin: 10\n },\n button: {\n height: 52,\n borderRadius: 7,\n marginBottom: theme.spacing.large,\n marginTop: theme.spacing.large,\n backgroundColor: brandTheme?.colors?.primary || theme.colors.cta,\n justifyContent: 'center'\n },\n buttonText: {\n alignSelf: 'center',\n fontWeight: theme.fontWeight.bold,\n fontSize: theme.fontSize.large,\n color: '#fff'\n }\n });\n\nconst Tip = (props: TipProps) => {\n const templateContext = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const {brandTheme, theme} = templateContext;\n const {Icon, text} = props;\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(brandTheme, theme);\n setStylesheet(_stylesheet);\n }, [brandTheme, theme]);\n\n if (!styleSheet) {\n return null;\n }\n\n return (\n <View style={styleSheet.tip}>\n
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["createStyleSheet","brandTheme","theme","StyleSheet","create","container","backgroundColor","colors","white","justifyContent","flex","padding","paddingTop","HEADER_HEIGHT","title","height","width","fontSize","xxlarge","fontWeight","bold","lineHeight","color","text","primary","marginBottom","spacing","small","large","opacity","tip","flexDirection","overflow","alignItems","borderRadius","gray","extra","marginTop","micro","tipText","icon","margin","button","cta","buttonText","alignSelf","Tip","props","templateContext","useTemplateContext","styleSheet","setStylesheet","useState","Icon","useEffect","_stylesheet","Onboarding","translations","onPress","appReview","presentation","TargetIcon","labelList","skills","QuestionMarkIcon","questions","HeartIcon","lifes","CheckCircle2Icon","allright","ok"],"sources":["../../../src/atom/review-presentation/index.native.tsx"],"sourcesContent":["import React, {useState, useEffect} from 'react';\nimport {View, StyleSheet, Text, ViewStyle, TextStyle} from 'react-native';\nimport {\n NovaLineSelectionCursorsCursorArrowTarget as TargetIcon,\n NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionMarkIcon,\n NovaSolidStatusCheckCircle2 as CheckCircle2Icon,\n NovaCompositionCoorpacademyVoteHeartOutline as HeartIcon\n} from '@coorpacademy/nova-icons';\n\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport {HEADER_HEIGHT} from '../../organism/header-v2/index.native';\nimport Touchable from '../../hoc/touchable/index.native';\nimport Html from '../html/index.native';\nimport {Brand} from '../../variables/brand.native';\nimport {OnboardingProps, TipProps} from './prop-types';\n\ntype StyleSheetType = {\n container: ViewStyle;\n title: TextStyle;\n text: TextStyle;\n tip: ViewStyle;\n tipText: TextStyle;\n icon: ViewStyle;\n button: ViewStyle;\n buttonText: TextStyle;\n};\n\nconst createStyleSheet = (brandTheme: Brand, theme: Theme): StyleSheetType =>\n StyleSheet.create({\n container: {\n backgroundColor: theme.colors.white,\n justifyContent: 'space-between',\n flex: 1,\n padding: 20,\n paddingTop: HEADER_HEIGHT + 20\n },\n title: {\n height: 72,\n width: 268,\n fontSize: theme.fontSize.xxlarge,\n fontWeight: theme.fontWeight.bold,\n lineHeight: 36,\n color: theme.colors.text.primary,\n marginBottom: theme.spacing.small\n },\n text: {\n fontSize: theme.fontSize.large,\n color: theme.colors.text.primary,\n opacity: 0.7,\n marginBottom: theme.spacing.small\n },\n tip: {\n flexDirection: 'row',\n overflow: 'hidden',\n alignItems: 'center',\n height: 54,\n borderRadius: 8,\n backgroundColor: theme.colors.gray.extra,\n marginTop: theme.spacing.micro,\n marginBottom: theme.spacing.micro\n },\n tipText: {\n fontSize: 16,\n lineHeight: 22,\n color: theme.colors.text.primary\n },\n icon: {\n margin: 10\n },\n button: {\n height: 52,\n borderRadius: 7,\n marginBottom: theme.spacing.large,\n marginTop: theme.spacing.large,\n backgroundColor: brandTheme?.colors?.primary || theme.colors.cta,\n justifyContent: 'center'\n },\n buttonText: {\n alignSelf: 'center',\n fontWeight: theme.fontWeight.bold,\n fontSize: theme.fontSize.large,\n color: '#fff'\n }\n });\n\nconst Tip = (props: TipProps) => {\n const templateContext = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const {brandTheme, theme} = templateContext;\n const {Icon, text} = props;\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(brandTheme, theme);\n setStylesheet(_stylesheet);\n }, [brandTheme, theme]);\n\n if (!styleSheet) {\n return null;\n }\n\n return (\n <View style={styleSheet.tip}>\n <Icon height={16} width={16} style={styleSheet.icon} color={theme.colors.text.primary} />\n <Text style={styleSheet.tipText}>{text}</Text>\n </View>\n );\n};\n\nconst Onboarding = (props: OnboardingProps) => {\n const templateContext = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const {brandTheme, theme, translations} = templateContext;\n const {onPress} = props;\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(brandTheme, theme);\n setStylesheet(_stylesheet);\n }, [brandTheme, theme]);\n\n // ------------------------------------\n\n if (!styleSheet) {\n return null;\n }\n\n return (\n <View style={styleSheet.container}>\n <Html style={styleSheet.title}>{translations.appReview.presentation.title}</Html>\n <Html style={styleSheet.text}>{translations.appReview.presentation.text}</Html>\n\n <Tip Icon={TargetIcon} text={translations.appReview.presentation.labelList.skills.text} />\n <Tip\n Icon={QuestionMarkIcon}\n text={translations.appReview.presentation.labelList.questions.text}\n />\n <Tip Icon={HeartIcon} text={translations.appReview.presentation.labelList.lifes.text} />\n <Tip\n Icon={CheckCircle2Icon}\n text={translations.appReview.presentation.labelList.allright.text}\n />\n <Touchable\n testID=\"button-quit-revision-onboarding\"\n onPress={onPress}\n analyticsID=\"button-start\"\n style={styleSheet.button}\n >\n <Text style={styleSheet.buttonText}>{translations.ok}</Text>\n </Touchable>\n </View>\n );\n};\n\nexport default Onboarding;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAOA;;AAEA;;AACA;;AACA;;;;;;;;AAeA,MAAMA,gBAAgB,GAAG,CAACC,UAAD,EAAoBC,KAApB,KACvBC,uBAAA,CAAWC,MAAX,CAAkB;EAChBC,SAAS,EAAE;IACTC,eAAe,EAAEJ,KAAK,CAACK,MAAN,CAAaC,KADrB;IAETC,cAAc,EAAE,eAFP;IAGTC,IAAI,EAAE,CAHG;IAITC,OAAO,EAAE,EAJA;IAKTC,UAAU,EAAEC,oBAAA,GAAgB;EALnB,CADK;EAQhBC,KAAK,EAAE;IACLC,MAAM,EAAE,EADH;IAELC,KAAK,EAAE,GAFF;IAGLC,QAAQ,EAAEf,KAAK,CAACe,QAAN,CAAeC,OAHpB;IAILC,UAAU,EAAEjB,KAAK,CAACiB,UAAN,CAAiBC,IAJxB;IAKLC,UAAU,EAAE,EALP;IAMLC,KAAK,EAAEpB,KAAK,CAACK,MAAN,CAAagB,IAAb,CAAkBC,OANpB;IAOLC,YAAY,EAAEvB,KAAK,CAACwB,OAAN,CAAcC;EAPvB,CARS;EAiBhBJ,IAAI,EAAE;IACJN,QA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AC,iBAAD;IAAM,KAAK,EAAEQ,UAAU,CAACN;EAAxB,GAAqCa,YAAY,CAACa,EAAlD,CANF,CAdF,CADF;AAyBD,CA1CD;;eA4Ced,U"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import PropTypes from 'prop-types';
|
|
2
|
-
import { GestureResponderEvent } from 'react-native';
|
|
3
|
+
import { ColorValue, GestureResponderEvent, ViewStyle } from 'react-native';
|
|
3
4
|
declare const propTypes: {
|
|
4
5
|
'aria-label': PropTypes.Requireable<string>;
|
|
5
6
|
reviewTitle: PropTypes.Requireable<string>;
|
|
@@ -53,10 +54,15 @@ export declare type OnboardingProps = {
|
|
|
53
54
|
tooltipText?: string | undefined;
|
|
54
55
|
} | undefined;
|
|
55
56
|
};
|
|
56
|
-
onPress: (event: GestureResponderEvent) =>
|
|
57
|
+
onPress: (event: GestureResponderEvent) => void;
|
|
57
58
|
};
|
|
58
59
|
export declare type TipProps = {
|
|
59
60
|
text: string | undefined;
|
|
60
|
-
Icon:
|
|
61
|
+
Icon: React.FC<{
|
|
62
|
+
height: number;
|
|
63
|
+
width: number;
|
|
64
|
+
style: ViewStyle;
|
|
65
|
+
color: ColorValue;
|
|
66
|
+
}>;
|
|
61
67
|
};
|
|
62
68
|
//# sourceMappingURL=prop-types.d.ts.map
|
|
@@ -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;AACnC,OAAO,EAAC,qBAAqB,EAAC,MAAM,cAAc,CAAC;
|
|
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;AACnC,OAAO,EAAC,UAAU,EAAE,qBAAqB,EAAE,SAAS,EAAC,MAAM,cAAc,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,CAAA;KAAC,CAAC,CAAC;CACtF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-types.js","names":["levelItem","PropTypes","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 {GestureResponderEvent} 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) =>
|
|
1
|
+
{"version":3,"file":"prop-types.js","names":["levelItem","PropTypes","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;;;;AAGA,MAAMA,SAAS,GAAGC,kBAAA,CAAUC,KAAV,CAAgB;EAChCC,IAAI,EAAEF,kBAAA,CAAUG,MADgB;EAEhCC,WAAW,EAAEJ,kBAAA,CAAUG;AAFS,CAAhB,CAAlB;;AAKA,MAAME,SAAS,GAAG;EAChB,cAAcL,kBAAA,CAAUG,MADR;EAEhBG,WAAW,EAAEN,kBAAA,CAAUG,MAFP;EAGhBI,UAAU,EAAEP,kBAAA,CAAUG,MAHN;EAIhBK,UAAU,EAAER,kBAAA,CAAUC,KAAV,CAAgB;IAC1BQ,MAAM,EAAEV,SADkB;IAE1BW,SAAS,EAAEX,SAFe;IAG1BY,KAAK,EAAEZ,SAHmB;IAI1Ba,QAAQ,EAAEb;EAJgB,CAAhB;AAJI,CAAlB;eAYeM,S;;AAER,MAAMQ,oBAAoB,GAAG;EAClCC,OAAO,EAAEd,kBAAA,CAAUe;AADe,CAA7B;;AAIA,MAAMC,aAAa,GAAG;EAC3Bd,IAAI,EAAEF,kBAAA,CAAUG,MADW;EAE3Bc,IAAI,EAAEjB,kBAAA,CAAUkB;AAFW,CAAtB"}
|
|
@@ -6,6 +6,7 @@ export declare type ChoiceItem = {
|
|
|
6
6
|
text: string;
|
|
7
7
|
selected: boolean;
|
|
8
8
|
_id: string;
|
|
9
|
+
value: string;
|
|
9
10
|
};
|
|
10
11
|
export declare type Props = {
|
|
11
12
|
analyticsID: string;
|
|
@@ -15,7 +16,6 @@ export declare type Props = {
|
|
|
15
16
|
values: Array<ChoiceItem>;
|
|
16
17
|
value?: string;
|
|
17
18
|
placeholder?: string;
|
|
18
|
-
color?: string;
|
|
19
19
|
onChange: OnChangeFunction;
|
|
20
20
|
onFocus: () => void;
|
|
21
21
|
onBlur: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/atom/select-modal/index.native.tsx"],"names":[],"mappings":";AACA,OAAO,EAAmB,SAAS,EAAY,MAAM,cAAc,CAAC;AAIpE,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,gCAAgC,CAAC;AAMjE,OAAoB,EAAC,gBAAgB,EAAC,MAAM,qCAAqC,CAAC;AAGlF,oBAAY,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/atom/select-modal/index.native.tsx"],"names":[],"mappings":";AACA,OAAO,EAAmB,SAAS,EAAY,MAAM,cAAc,CAAC;AAIpE,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,gCAAgC,CAAC;AAMjE,OAAoB,EAAC,gBAAgB,EAAC,MAAM,qCAAqC,CAAC;AAGlF,oBAAY,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,oBAAY,KAAK,GAAG;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,YAAY,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAmCF,QAAA,MAAM,MAAM,UAAW,KAAK,uBAoG3B,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -53,6 +53,7 @@ const logEvent = (eventName, analyticsID, analytics, questionType) => {
|
|
|
53
53
|
const Select = props => {
|
|
54
54
|
const templateContext = (0, _templateContext.useTemplateContext)();
|
|
55
55
|
const {
|
|
56
|
+
brandTheme,
|
|
56
57
|
theme,
|
|
57
58
|
analytics
|
|
58
59
|
} = templateContext;
|
|
@@ -72,7 +73,6 @@ const Select = props => {
|
|
|
72
73
|
value,
|
|
73
74
|
style,
|
|
74
75
|
textStyle,
|
|
75
|
-
color,
|
|
76
76
|
questionType,
|
|
77
77
|
isFocused = false,
|
|
78
78
|
isDisabled = false,
|
|
@@ -105,7 +105,10 @@ const Select = props => {
|
|
|
105
105
|
textStyles = [styleSheet.text, ...textStyle];
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
let color;
|
|
109
|
+
|
|
110
|
+
if ((selectedItem?.value?.length || 0) > 0) {
|
|
111
|
+
color = brandTheme?.colors?.primary;
|
|
109
112
|
textStyles.push({
|
|
110
113
|
color
|
|
111
114
|
});
|