@coorpacademy/components 10.21.4 → 10.22.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/README.md +1 -1
- package/es/atom/header-back-button/index.native.js +75 -0
- package/es/atom/header-back-button/index.native.js.map +1 -0
- package/es/atom/header-back-icon/index.native.js +27 -0
- package/es/atom/header-back-icon/index.native.js.map +1 -0
- package/es/atom/lottie-wrapper/index.js +2 -24
- package/es/atom/lottie-wrapper/index.js.map +1 -1
- package/es/atom/lottie-wrapper/prop-types.js +26 -0
- package/es/atom/lottie-wrapper/prop-types.js.map +1 -0
- package/es/atom/review-background/index.js +2 -4
- package/es/atom/review-background/index.js.map +1 -1
- package/es/atom/review-background/prop-types.js +5 -0
- package/es/atom/review-background/prop-types.js.map +1 -0
- package/es/atom/review-header-step-item/index.js +2 -6
- package/es/atom/review-header-step-item/index.js.map +1 -1
- package/es/atom/review-header-step-item/prop-types.js +7 -0
- package/es/atom/review-header-step-item/prop-types.js.map +1 -0
- package/es/atom/review-presentation/index.js +2 -15
- package/es/atom/review-presentation/index.js.map +1 -1
- package/es/atom/review-presentation/prop-types.js +18 -0
- package/es/atom/review-presentation/prop-types.js.map +1 -0
- package/es/atom/spinner/index.js +1 -0
- package/es/atom/spinner/index.js.map +1 -1
- package/es/atom/tab/index.js +1 -0
- package/es/atom/tab/index.js.map +1 -1
- package/es/hoc/touchable/index.native.js +69 -0
- package/es/hoc/touchable/index.native.js.map +1 -0
- package/es/molecule/answer/index.js +5 -26
- package/es/molecule/answer/index.js.map +1 -1
- package/es/molecule/answer/prop-types.js +32 -0
- package/es/molecule/answer/prop-types.js.map +1 -0
- package/es/molecule/dashboard/battle-request-list/index.js +3 -5
- package/es/molecule/dashboard/battle-request-list/index.js.map +1 -1
- package/es/molecule/dashboard/news-list/index.js +3 -5
- package/es/molecule/dashboard/news-list/index.js.map +1 -1
- package/es/molecule/dashboard/review-banner/index.js +3 -5
- package/es/molecule/dashboard/review-banner/index.js.map +1 -1
- package/es/molecule/dashboard/start-battle/index.js +3 -5
- package/es/molecule/dashboard/start-battle/index.js.map +1 -1
- package/es/molecule/external-content-viewer/index.js +2 -1
- package/es/molecule/external-content-viewer/index.js.map +1 -1
- package/es/molecule/questions/free-text/index.native.js +87 -0
- package/es/molecule/questions/free-text/index.native.js.map +1 -0
- package/es/molecule/questions/qcm/index.native.js +50 -0
- package/es/molecule/questions/qcm/index.native.js.map +1 -0
- package/es/molecule/review-card-congrats/index.js +2 -13
- package/es/molecule/review-card-congrats/index.js.map +1 -1
- package/es/molecule/review-card-congrats/prop-types.js +15 -0
- package/es/molecule/review-card-congrats/prop-types.js.map +1 -0
- package/es/molecule/review-correction-popin/index.js +2 -20
- package/es/molecule/review-correction-popin/index.js.map +1 -1
- package/es/molecule/review-correction-popin/prop-types.js +21 -0
- package/es/molecule/review-correction-popin/prop-types.js.map +1 -0
- package/es/molecule/review-header-steps/index.js +2 -4
- package/es/molecule/review-header-steps/index.js.map +1 -1
- package/es/molecule/review-header-steps/prop-types.js +6 -0
- package/es/molecule/review-header-steps/prop-types.js.map +1 -0
- package/es/molecule/skill-card/index.js +2 -12
- package/es/molecule/skill-card/index.js.map +1 -1
- package/es/molecule/skill-card/prop-types.js +13 -0
- package/es/molecule/skill-card/prop-types.js.map +1 -0
- package/es/molecule/video-player/index.js +2 -17
- package/es/molecule/video-player/index.js.map +1 -1
- package/es/molecule/video-player/jwplayer-prop-types.js +38 -0
- package/es/molecule/video-player/jwplayer-prop-types.js.map +1 -0
- package/es/molecule/video-player/jwplayer.js +2 -37
- package/es/molecule/video-player/jwplayer.js.map +1 -1
- package/es/molecule/video-player/prop-types.js +53 -0
- package/es/molecule/video-player/prop-types.js.map +1 -0
- package/es/organism/review-congrats/index.js +2 -19
- package/es/organism/review-congrats/index.js.map +1 -1
- package/es/organism/review-congrats/prop-types.js +22 -0
- package/es/organism/review-congrats/prop-types.js.map +1 -0
- package/es/organism/review-header/index.js +2 -10
- package/es/organism/review-header/index.js.map +1 -1
- package/es/organism/review-header/prop-types.js +12 -0
- package/es/organism/review-header/prop-types.js.map +1 -0
- package/es/organism/review-skills/index.js +4 -19
- package/es/organism/review-skills/index.js.map +1 -1
- package/es/organism/review-skills/prop-types.js +19 -0
- package/es/organism/review-skills/prop-types.js.map +1 -0
- package/es/template/app-player/loading/index.js +1 -0
- package/es/template/app-player/loading/index.js.map +1 -1
- package/es/template/app-review/demo-ts/index.js +2 -0
- package/es/template/app-review/demo-ts/index.js.map +1 -1
- package/es/template/app-review/demo-ts/index.native.js +9 -0
- package/es/template/app-review/demo-ts/index.native.js.map +1 -0
- package/es/template/app-review/demo-ts/typings.js +7 -0
- package/es/template/app-review/demo-ts/typings.js.map +1 -0
- package/es/template/app-review/index.js +4 -0
- package/es/template/app-review/index.js.map +1 -1
- package/es/template/app-review/index.native.js +24 -28
- package/es/template/app-review/index.native.js.map +1 -1
- package/es/template/app-review/onboarding/index.native.js +2 -2
- package/es/template/app-review/onboarding/index.native.js.map +1 -1
- package/es/template/app-review/skills/index.native.js +2 -2
- package/es/template/app-review/skills/index.native.js.map +1 -1
- package/es/template/app-review/slides/index.js +4 -5
- package/es/template/app-review/slides/index.js.map +1 -1
- package/es/template/app-review/slides/index.native.js +65 -25
- package/es/template/app-review/slides/index.native.js.map +1 -1
- package/es/template/app-review/slides/prop-types.js +15 -15
- package/es/template/app-review/slides/prop-types.js.map +1 -1
- package/es/template/app-review/template-context.js +36 -0
- package/es/template/app-review/template-context.js.map +1 -0
- package/es/variables/analytics.js +22 -0
- package/es/variables/analytics.js.map +1 -0
- package/es/variables/theme.native.js +65 -0
- package/es/variables/theme.native.js.map +1 -0
- package/es/variables/vibration.js +10 -0
- package/es/variables/vibration.js.map +1 -0
- package/lib/atom/header-back-button/index.native.js +96 -0
- package/lib/atom/header-back-button/index.native.js.map +1 -0
- package/lib/atom/header-back-icon/index.native.js +38 -0
- package/lib/atom/header-back-icon/index.native.js.map +1 -0
- package/lib/atom/lottie-wrapper/index.js +6 -30
- package/lib/atom/lottie-wrapper/index.js.map +1 -1
- package/lib/atom/lottie-wrapper/prop-types.js +37 -0
- package/lib/atom/lottie-wrapper/prop-types.js.map +1 -0
- package/lib/atom/review-background/index.js +3 -5
- package/lib/atom/review-background/index.js.map +1 -1
- package/lib/atom/review-background/prop-types.js +14 -0
- package/lib/atom/review-background/prop-types.js.map +1 -0
- package/lib/atom/review-header-step-item/index.js +3 -7
- package/lib/atom/review-header-step-item/index.js.map +1 -1
- package/lib/atom/review-header-step-item/prop-types.js +16 -0
- package/lib/atom/review-header-step-item/prop-types.js.map +1 -0
- package/lib/atom/review-presentation/index.js +3 -15
- package/lib/atom/review-presentation/index.js.map +1 -1
- package/lib/atom/review-presentation/prop-types.js +28 -0
- package/lib/atom/review-presentation/prop-types.js.map +1 -0
- package/lib/atom/spinner/index.js +1 -0
- package/lib/atom/spinner/index.js.map +1 -1
- package/lib/atom/tab/index.js +1 -0
- package/lib/atom/tab/index.js.map +1 -1
- package/lib/hoc/touchable/index.native.js +83 -0
- package/lib/hoc/touchable/index.native.js.map +1 -0
- package/lib/molecule/answer/index.js +14 -35
- package/lib/molecule/answer/index.js.map +1 -1
- package/lib/molecule/answer/prop-types.js +49 -0
- package/lib/molecule/answer/prop-types.js.map +1 -0
- package/lib/molecule/dashboard/battle-request-list/index.js +3 -5
- package/lib/molecule/dashboard/battle-request-list/index.js.map +1 -1
- package/lib/molecule/dashboard/news-list/index.js +3 -5
- package/lib/molecule/dashboard/news-list/index.js.map +1 -1
- package/lib/molecule/dashboard/review-banner/index.js +3 -5
- package/lib/molecule/dashboard/review-banner/index.js.map +1 -1
- package/lib/molecule/dashboard/start-battle/index.js +3 -5
- package/lib/molecule/dashboard/start-battle/index.js.map +1 -1
- package/lib/molecule/external-content-viewer/index.js +2 -1
- package/lib/molecule/external-content-viewer/index.js.map +1 -1
- package/lib/molecule/questions/free-text/index.native.js +100 -0
- package/lib/molecule/questions/free-text/index.native.js.map +1 -0
- package/lib/molecule/questions/qcm/index.native.js +62 -0
- package/lib/molecule/questions/qcm/index.native.js.map +1 -0
- package/lib/molecule/review-card-congrats/index.js +3 -14
- package/lib/molecule/review-card-congrats/index.js.map +1 -1
- package/lib/molecule/review-card-congrats/prop-types.js +25 -0
- package/lib/molecule/review-card-congrats/prop-types.js.map +1 -0
- package/lib/molecule/review-correction-popin/index.js +3 -21
- package/lib/molecule/review-correction-popin/index.js.map +1 -1
- package/lib/molecule/review-correction-popin/prop-types.js +30 -0
- package/lib/molecule/review-correction-popin/prop-types.js.map +1 -0
- package/lib/molecule/review-header-steps/index.js +3 -5
- package/lib/molecule/review-header-steps/index.js.map +1 -1
- package/lib/molecule/review-header-steps/prop-types.js +16 -0
- package/lib/molecule/review-header-steps/prop-types.js.map +1 -0
- package/lib/molecule/skill-card/index.js +3 -13
- package/lib/molecule/skill-card/index.js.map +1 -1
- package/lib/molecule/skill-card/prop-types.js +22 -0
- package/lib/molecule/skill-card/prop-types.js.map +1 -0
- package/lib/molecule/video-player/index.js +3 -19
- package/lib/molecule/video-player/index.js.map +1 -1
- package/lib/molecule/video-player/jwplayer-prop-types.js +48 -0
- package/lib/molecule/video-player/jwplayer-prop-types.js.map +1 -0
- package/lib/molecule/video-player/jwplayer.js +3 -39
- package/lib/molecule/video-player/jwplayer.js.map +1 -1
- package/lib/molecule/video-player/prop-types.js +64 -0
- package/lib/molecule/video-player/prop-types.js.map +1 -0
- package/lib/organism/review-congrats/index.js +3 -20
- package/lib/organism/review-congrats/index.js.map +1 -1
- package/lib/organism/review-congrats/prop-types.js +33 -0
- package/lib/organism/review-congrats/prop-types.js.map +1 -0
- package/lib/organism/review-header/index.js +3 -11
- package/lib/organism/review-header/index.js.map +1 -1
- package/lib/organism/review-header/prop-types.js +22 -0
- package/lib/organism/review-header/prop-types.js.map +1 -0
- package/lib/organism/review-skills/index.js +10 -23
- package/lib/organism/review-skills/index.js.map +1 -1
- package/lib/organism/review-skills/prop-types.js +33 -0
- package/lib/organism/review-skills/prop-types.js.map +1 -0
- package/lib/template/app-player/loading/index.js +1 -0
- package/lib/template/app-player/loading/index.js.map +1 -1
- package/lib/template/app-review/demo-ts/index.js +3 -0
- package/lib/template/app-review/demo-ts/index.js.map +1 -1
- package/lib/template/app-review/demo-ts/index.native.js +18 -0
- package/lib/template/app-review/demo-ts/index.native.js.map +1 -0
- package/lib/template/app-review/demo-ts/typings.js +16 -0
- package/lib/template/app-review/demo-ts/typings.js.map +1 -0
- package/lib/template/app-review/index.js +5 -0
- package/lib/template/app-review/index.js.map +1 -1
- package/lib/template/app-review/index.native.js +25 -26
- package/lib/template/app-review/index.native.js.map +1 -1
- package/lib/template/app-review/onboarding/index.native.js +2 -2
- package/lib/template/app-review/onboarding/index.native.js.map +1 -1
- package/lib/template/app-review/skills/index.native.js +4 -4
- package/lib/template/app-review/skills/index.native.js.map +1 -1
- package/lib/template/app-review/slides/index.js +4 -5
- package/lib/template/app-review/slides/index.js.map +1 -1
- package/lib/template/app-review/slides/index.native.js +76 -38
- package/lib/template/app-review/slides/index.native.js.map +1 -1
- package/lib/template/app-review/slides/prop-types.js +16 -16
- package/lib/template/app-review/slides/prop-types.js.map +1 -1
- package/lib/template/app-review/template-context.js +50 -0
- package/lib/template/app-review/template-context.js.map +1 -0
- package/lib/variables/analytics.js +27 -0
- package/lib/variables/analytics.js.map +1 -0
- package/lib/variables/theme.native.js +70 -0
- package/lib/variables/theme.native.js.map +1 -0
- package/lib/variables/vibration.js +15 -0
- package/lib/variables/vibration.js.map +1 -0
- package/package.json +6 -2
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _reactNative = require("react-native");
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _templateContext = require("../../../template/app-review/template-context");
|
|
11
|
+
|
|
12
|
+
var _analytics = require("../../../variables/analytics");
|
|
13
|
+
|
|
14
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
15
|
+
|
|
16
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
+
|
|
18
|
+
const createStyleSheet = (brandTheme, theme) => _reactNative.StyleSheet.create({
|
|
19
|
+
input: {
|
|
20
|
+
padding: theme.spacing.tiny,
|
|
21
|
+
borderWidth: 1,
|
|
22
|
+
borderColor: theme.colors.gray.lightMedium,
|
|
23
|
+
borderRadius: theme.radius.common,
|
|
24
|
+
backgroundColor: theme.colors.white,
|
|
25
|
+
minWidth: 175
|
|
26
|
+
},
|
|
27
|
+
text: {
|
|
28
|
+
borderColor: brandTheme?.colors.primary,
|
|
29
|
+
color: brandTheme?.colors.primary || theme.colors.gray.medium,
|
|
30
|
+
fontWeight: theme.fontWeight.bold,
|
|
31
|
+
fontSize: theme.fontSize.regular,
|
|
32
|
+
textAlign: 'center'
|
|
33
|
+
},
|
|
34
|
+
spaced: {
|
|
35
|
+
paddingVertical: theme.spacing.tiny
|
|
36
|
+
},
|
|
37
|
+
fullWitdh: {
|
|
38
|
+
width: '100%'
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const logEvent = (eventName, analytics, questionType) => {
|
|
43
|
+
analytics && analytics.logEvent(eventName, {
|
|
44
|
+
id: `question-input-text`,
|
|
45
|
+
questionType
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const FreeText = props => {
|
|
50
|
+
const templateContext = (0, _templateContext.useTemplateContext)();
|
|
51
|
+
const [styleSheet, setStylesheet] = (0, _react.useState)(null);
|
|
52
|
+
const {
|
|
53
|
+
brandTheme,
|
|
54
|
+
theme
|
|
55
|
+
} = templateContext;
|
|
56
|
+
const PLACEHOLDER_COLOR = theme.colors.gray.medium; // ------------------------------------
|
|
57
|
+
|
|
58
|
+
const {
|
|
59
|
+
analytics,
|
|
60
|
+
questionType,
|
|
61
|
+
fullWitdh,
|
|
62
|
+
testID,
|
|
63
|
+
onChange,
|
|
64
|
+
isDisabled,
|
|
65
|
+
value,
|
|
66
|
+
placeholder
|
|
67
|
+
} = props; // ------------------------------------
|
|
68
|
+
|
|
69
|
+
const handleFocus = (0, _react.useMemo)(() => analytics && logEvent(_analytics.ANALYTICS_EVENT_TYPE.INPUT_FOCUS, analytics, questionType), [analytics, questionType]);
|
|
70
|
+
const handleBlur = (0, _react.useMemo)(() => analytics && logEvent(_analytics.ANALYTICS_EVENT_TYPE.INPUT_BLUR, analytics, questionType), [analytics, questionType]); // ------------------------------------
|
|
71
|
+
|
|
72
|
+
(0, _react.useEffect)(() => {
|
|
73
|
+
const _stylesheet = createStyleSheet(brandTheme, theme);
|
|
74
|
+
|
|
75
|
+
setStylesheet(_stylesheet);
|
|
76
|
+
}, [brandTheme, theme]); // ------------------------------------
|
|
77
|
+
|
|
78
|
+
if (!styleSheet) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
83
|
+
style: [styleSheet.spaced, fullWitdh && styleSheet.fullWitdh]
|
|
84
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.TextInput, {
|
|
85
|
+
style: [styleSheet.input, styleSheet.text],
|
|
86
|
+
onFocus: handleFocus,
|
|
87
|
+
onBlur: handleBlur,
|
|
88
|
+
onChangeText: onChange,
|
|
89
|
+
placeholder: placeholder,
|
|
90
|
+
placeholderTextColor: PLACEHOLDER_COLOR,
|
|
91
|
+
value: value,
|
|
92
|
+
testID: testID,
|
|
93
|
+
editable: !isDisabled,
|
|
94
|
+
selectTextOnFocus: !isDisabled
|
|
95
|
+
}));
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
var _default = FreeText;
|
|
99
|
+
exports.default = _default;
|
|
100
|
+
//# sourceMappingURL=index.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/questions/free-text/index.native.tsx"],"names":["createStyleSheet","brandTheme","theme","StyleSheet","create","input","padding","spacing","tiny","borderWidth","borderColor","colors","gray","lightMedium","borderRadius","radius","common","backgroundColor","white","minWidth","text","primary","color","medium","fontWeight","bold","fontSize","regular","textAlign","spaced","paddingVertical","fullWitdh","width","logEvent","eventName","analytics","questionType","id","FreeText","props","templateContext","styleSheet","setStylesheet","PLACEHOLDER_COLOR","testID","onChange","isDisabled","value","placeholder","handleFocus","ANALYTICS_EVENT_TYPE","INPUT_FOCUS","handleBlur","INPUT_BLUR","_stylesheet"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;;;;;AAuCA,MAAMA,gBAAgB,GAAG,CAACC,UAAD,EAAaC,KAAb,KACvBC,wBAAWC,MAAX,CAAkB;AAChBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,OAAO,EAAEJ,KAAK,CAACK,OAAN,CAAcC,IADlB;AAELC,IAAAA,WAAW,EAAE,CAFR;AAGLC,IAAAA,WAAW,EAAER,KAAK,CAACS,MAAN,CAAaC,IAAb,CAAkBC,WAH1B;AAILC,IAAAA,YAAY,EAAEZ,KAAK,CAACa,MAAN,CAAaC,MAJtB;AAKLC,IAAAA,eAAe,EAAEf,KAAK,CAACS,MAAN,CAAaO,KALzB;AAMLC,IAAAA,QAAQ,EAAE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heet, TextInput} from 'react-native';\nimport React, {useState, useEffect, useMemo} from 'react';\nimport {useTemplateContext} from '../../../template/app-review/template-context';\nimport {ANALYTICS_EVENT_TYPE, Analytics} from '../../../variables/analytics';\n\ntype QuestionType = 'basic' | 'template';\n\ninterface Props {\n children: string;\n fullWitdh: boolean;\n testID: string;\n questionType: QuestionType;\n analytics?: Analytics;\n onChange: Function;\n isDisabled: boolean;\n value: string;\n placeholder: string;\n}\n\ntype StyleSheetType = {\n input: {\n padding: string;\n borderWidth: number;\n borderColor: string;\n borderRadius: number;\n backgroundColor: string;\n minWidth: number;\n };\n text: {\n color: string;\n fontWeight: number;\n fontSize: number;\n textAlign: string;\n };\n spaced: {\n paddingVertical: number;\n };\n fullWitdh: {\n width: string;\n };\n};\n\nconst createStyleSheet = (brandTheme, theme) =>\n StyleSheet.create({\n input: {\n padding: theme.spacing.tiny,\n borderWidth: 1,\n borderColor: theme.colors.gray.lightMedium,\n borderRadius: theme.radius.common,\n backgroundColor: theme.colors.white,\n minWidth: 175\n },\n text: {\n borderColor: brandTheme?.colors.primary,\n color: brandTheme?.colors.primary || theme.colors.gray.medium,\n fontWeight: theme.fontWeight.bold,\n fontSize: theme.fontSize.regular,\n textAlign: 'center'\n },\n spaced: {\n paddingVertical: theme.spacing.tiny\n },\n fullWitdh: {\n width: '100%'\n }\n });\n\nconst logEvent = (eventName: string, analytics: Analytics, questionType: QuestionType) => {\n analytics &&\n analytics.logEvent(eventName, {\n id: `question-input-text`,\n questionType\n });\n};\n\nconst FreeText = (props: Props) => {\n const templateContext = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const {brandTheme, theme} = templateContext;\n const PLACEHOLDER_COLOR = theme.colors.gray.medium;\n\n // ------------------------------------\n\n const {\n analytics,\n questionType,\n fullWitdh,\n testID,\n onChange,\n isDisabled,\n value,\n placeholder\n } = props;\n\n // ------------------------------------\n\n const handleFocus = useMemo(\n () => analytics && logEvent(ANALYTICS_EVENT_TYPE.INPUT_FOCUS, analytics, questionType),\n [analytics, questionType]\n );\n\n const handleBlur = useMemo(\n () => analytics && logEvent(ANALYTICS_EVENT_TYPE.INPUT_BLUR, analytics, questionType),\n [analytics, questionType]\n );\n\n // ------------------------------------\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(brandTheme, theme);\n setStylesheet(_stylesheet);\n }, [brandTheme, theme]);\n\n // ------------------------------------\n\n if (!styleSheet) {\n return null;\n }\n\n return (\n <View style={[styleSheet.spaced, fullWitdh && styleSheet.fullWitdh]}>\n <TextInput\n style={[styleSheet.input, styleSheet.text]}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onChangeText={onChange}\n placeholder={placeholder}\n placeholderTextColor={PLACEHOLDER_COLOR}\n value={value}\n testID={testID}\n editable={!isDisabled}\n selectTextOnFocus={!isDisabled}\n />\n </View>\n );\n};\n\nexport default FreeText;\n"],"file":"index.native.js"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _reactNative = require("react-native");
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _templateContext = require("../../../template/app-review/template-context");
|
|
11
|
+
|
|
12
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
13
|
+
|
|
14
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
+
|
|
16
|
+
const createStyleSheet = theme => _reactNative.StyleSheet.create({
|
|
17
|
+
boxShadow: {
|
|
18
|
+
shadowColor: '#000',
|
|
19
|
+
shadowOffset: {
|
|
20
|
+
width: 0,
|
|
21
|
+
height: 4
|
|
22
|
+
},
|
|
23
|
+
shadowOpacity: 0.12,
|
|
24
|
+
shadowRadius: 16,
|
|
25
|
+
elevation: 6
|
|
26
|
+
},
|
|
27
|
+
container: {
|
|
28
|
+
backgroundColor: theme.colors.white,
|
|
29
|
+
borderRadius: theme.radius.regular,
|
|
30
|
+
overflow: 'hidden',
|
|
31
|
+
flexDirection: 'row',
|
|
32
|
+
alignItems: 'stretch'
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const QuestionChoiceComponent = ({
|
|
37
|
+
children,
|
|
38
|
+
isSelected = false,
|
|
39
|
+
testID: prefixTestID
|
|
40
|
+
}) => {
|
|
41
|
+
const selectedSuffix = prefixTestID && isSelected ? '-selected' : '';
|
|
42
|
+
const [styleSheet, setStylesheet] = (0, _react.useState)(null);
|
|
43
|
+
const templateContext = (0, _templateContext.useTemplateContext)();
|
|
44
|
+
const {
|
|
45
|
+
theme
|
|
46
|
+
} = templateContext;
|
|
47
|
+
(0, _react.useEffect)(() => {
|
|
48
|
+
const _stylesheet = createStyleSheet(theme);
|
|
49
|
+
|
|
50
|
+
setStylesheet(_stylesheet);
|
|
51
|
+
}, [theme]);
|
|
52
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
53
|
+
style: [styleSheet && styleSheet.boxShadow]
|
|
54
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
55
|
+
style: [styleSheet && styleSheet.container],
|
|
56
|
+
testID: prefixTestID && `${prefixTestID}${selectedSuffix}`
|
|
57
|
+
}, children));
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
var _default = QuestionChoiceComponent;
|
|
61
|
+
exports.default = _default;
|
|
62
|
+
//# sourceMappingURL=index.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/questions/qcm/index.native.tsx"],"names":["createStyleSheet","theme","StyleSheet","create","boxShadow","shadowColor","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","container","backgroundColor","colors","white","borderRadius","radius","regular","overflow","flexDirection","alignItems","QuestionChoiceComponent","children","isSelected","testID","prefixTestID","selectedSuffix","styleSheet","setStylesheet","templateContext","_stylesheet"],"mappings":";;;;;AAAA;;AACA;;AACA;;;;;;AAmCA,MAAMA,gBAAgB,GAAIC,KAAD,IACvBC,wBAAWC,MAAX,CAAkB;AAChBC,EAAAA,SAAS,EAAE;AACTC,IAAAA,WAAW,EAAE,MADJ;AAETC,IAAAA,YAAY,EAAE;AAACC,MAAAA,KAAK,EAAE,CAAR;AAAWC,MAAAA,MAAM,EAAE;AAAnB,KAFL;AAGTC,IAAAA,aAAa,EAAE,IAHN;AAITC,IAAAA,YAAY,EAAE,EAJL;AAKTC,IAAAA,SAAS,EAAE;AALF,GADK;AAQhBC,EAAAA,SAAS,EAAE;AACTC,IAAAA,eAAe,EAAEZ,KAAK,CAACa,MAAN,CAAaC,KADrB;AAETC,IAAAA,YAAY,EAAEf,KAAK,CAACgB,MAAN,CAAaC,OAFlB;AAGTC,IAAAA,QAAQ,EAAE,QAHD;AAITC,IAAAA,aAAa,EAAE,KAJN;AAKTC,IAAAA,UAAU,EAAE;AALH;AARK,CAAlB,CADF;;AAkBA,MAAMC,uBAAuB,GAAG,CAAC;AAACC,EAAAA,QAAD;AAAWC,EAAAA,UAAU,GAAG,KAAxB;AAA+BC,EAAAA,MAAM,EAAEC;AAAvC,CAAD,KAAiE;AAC/F,QAAMC,cAAc,GAAGD,YAAY,IAAIF,UAAhB,GAA6B,WAA7B,GAA2C,EAAlE;AAEA,QAAM,CAACI,UAAD,EAAaC,aAAb,IAA8B,qBAA2B,IAA3B,CAApC;AAEA,QAAMC,eAAe,GAAG,0CAAxB;AACA,QAAM;AAAC7B,IAAAA;AAAD,MAAU6B,eAAhB;AAEA,wBAAU,MAAM;AACd,UAAMC,WAAW,GAAG/B,gBAAgB,CAACC,KAAD,CAApC;;AACA4B,IAAAA,aAAa,CAACE,WAAD,CAAb;AACD,GAHD,EAGG,CAAC9B,KAAD,CAHH;AAKA,sBACE,6BAAC,iBAAD;AAAM,IAAA,KAAK,EAAE,CAAC2B,UAAU,IAAIA,UAAU,CAACxB,SAA1B;AAAb,kBACE,6BAAC,iBAAD;AACE,IAAA,KAAK,EAAE,CAACwB,UAAU,IAAIA,UAAU,CAAChB,SAA1B,CADT;AAEE,IAAA,MAAM,EAAEc,YAAY,IAAK,GAAEA,YAAa,GAAEC,cAAe;AAF3D,KAIGJ,QAJH,CADF,CADF;AAUD,CAvBD;;eAyBeD,uB","sourcesContent":["import {View, StyleSheet, ViewStyle} from 'react-native';\nimport React, {useState, useEffect} from 'react';\nimport {useTemplateContext} from '../../../template/app-review/template-context';\n\ninterface Props {\n isSelected?: boolean;\n children: string;\n testID?: string;\n style?: ViewStyle;\n theme?: any;\n}\n\ntype StyleType = {\n boxShadow: {\n shadowColor: string;\n shadowOffset: {\n width: number;\n height: number;\n };\n shadowOpacity: number;\n shadowRadius: number;\n elevation: number;\n };\n container: {\n backgroundColor: string;\n borderRadius: number;\n shadowColor: string;\n shadowOffset: {width: number; height: number};\n shadowOpacity: number;\n shadowRadius: number;\n elevation: number;\n overflow: string;\n flexDirection: string;\n alignItems: string;\n };\n};\n\nconst createStyleSheet = (theme: any) =>\n StyleSheet.create({\n boxShadow: {\n shadowColor: '#000',\n shadowOffset: {width: 0, height: 4},\n shadowOpacity: 0.12,\n shadowRadius: 16,\n elevation: 6\n },\n container: {\n backgroundColor: theme.colors.white,\n borderRadius: theme.radius.regular,\n overflow: 'hidden',\n flexDirection: 'row',\n alignItems: 'stretch'\n }\n });\n\nconst QuestionChoiceComponent = ({children, isSelected = false, testID: prefixTestID}: Props) => {\n const selectedSuffix = prefixTestID && isSelected ? '-selected' : '';\n\n const [styleSheet, setStylesheet] = useState<StyleType | null>(null);\n\n const templateContext = useTemplateContext();\n const {theme} = templateContext;\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme);\n setStylesheet(_stylesheet);\n }, [theme]);\n\n return (\n <View style={[styleSheet && styleSheet.boxShadow]}>\n <View\n style={[styleSheet && styleSheet.container]}\n testID={prefixTestID && `${prefixTestID}${selectedSuffix}`}\n >\n {children}\n </View>\n </View>\n );\n};\n\nexport default QuestionChoiceComponent;\n"],"file":"index.native.js"}
|
|
@@ -13,8 +13,6 @@ var _pipe2 = _interopRequireDefault(require("lodash/fp/pipe"));
|
|
|
13
13
|
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
15
|
|
|
16
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
-
|
|
18
16
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
19
17
|
|
|
20
18
|
var _novaIcons = require("@coorpacademy/nova-icons");
|
|
@@ -27,6 +25,8 @@ var _animationScheduler = _interopRequireDefault(require("../../hoc/animation-sc
|
|
|
27
25
|
|
|
28
26
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
29
27
|
|
|
28
|
+
var _propTypes = _interopRequireDefault(require("./prop-types"));
|
|
29
|
+
|
|
30
30
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
31
31
|
|
|
32
32
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -107,18 +107,7 @@ const ReviewCardCongrats = props => {
|
|
|
107
107
|
}, rankSuffix)));
|
|
108
108
|
};
|
|
109
109
|
|
|
110
|
-
ReviewCardCongrats.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
111
|
-
'aria-label': _propTypes.default.string,
|
|
112
|
-
'data-name': _propTypes.default.string,
|
|
113
|
-
animationLottie: _propTypes.default.shape(_lottieWrapper.default.propTypes),
|
|
114
|
-
cardType: _propTypes.default.string,
|
|
115
|
-
iconAriaLabel: _propTypes.default.string,
|
|
116
|
-
className: _propTypes.default.string,
|
|
117
|
-
reviewCardTitle: _propTypes.default.string,
|
|
118
|
-
reviewCardValue: _propTypes.default.string,
|
|
119
|
-
rankSuffix: _propTypes.default.string,
|
|
120
|
-
timerAnimation: _propTypes.default.number
|
|
121
|
-
} : {};
|
|
110
|
+
ReviewCardCongrats.propTypes = process.env.NODE_ENV !== "production" ? _propTypes.default : {};
|
|
122
111
|
var _default = ReviewCardCongrats;
|
|
123
112
|
exports.default = _default;
|
|
124
113
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/review-card-congrats/index.js"],"names":["setAnimations","setIsAnimationVisible","setIsAnimated","ReviewCardCongrats","props","ariaLabel","dataName","animationLottie","cardType","iconAriaLabel","className","reviewCardTitle","reviewCardValue","rankSuffix","timerAnimation","isAnimationVisible","isAnimated","timer","setTimeout","clearTimeout","wrapperClassName","style","cardContainer","cardStar","cardRank","mainIcon","wrapperLottie","ie11Backup","title","textContainerStar","textContainerRank","iconRank","textStar","textRank","EASE_OUT_CUBIC","progress","iconStar","propTypes"
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/review-card-congrats/index.js"],"names":["setAnimations","setIsAnimationVisible","setIsAnimated","ReviewCardCongrats","props","ariaLabel","dataName","animationLottie","cardType","iconAriaLabel","className","reviewCardTitle","reviewCardValue","rankSuffix","timerAnimation","isAnimationVisible","isAnimated","timer","setTimeout","clearTimeout","wrapperClassName","style","cardContainer","cardStar","cardRank","mainIcon","wrapperLottie","ie11Backup","title","textContainerStar","textContainerRank","iconRank","textStar","textRank","EASE_OUT_CUBIC","progress","iconStar","propTypes"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AAIA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEO,MAAMA,aAAa,GAAG,CAACC,qBAAD,EAAwBC,aAAxB,KAA0C,MAAM;AAC3ED,EAAAA,qBAAqB,CAAC,MAAD,CAArB;AACAC,EAAAA,aAAa,CAAC,IAAD,CAAb;AACD,CAHM;;;;AAKP,MAAMC,kBAAkB,GAAGC,KAAK,IAAI;AAClC,QAAM;AACJ,kBAAcC,SADV;AAEJ,iBAAaC,QAFT;AAGJC,IAAAA,eAHI;AAIJC,IAAAA,QAJI;AAKJC,IAAAA,aALI;AAMJC,IAAAA,SANI;AAOJC,IAAAA,eAPI;AAQJC,IAAAA,eARI;AASJC,IAAAA,UATI;AAUJC,IAAAA;AAVI,MAWFV,KAXJ;AAaA,QAAM,CAACW,kBAAD,EAAqBd,qBAArB,IAA8C,qBAAS,SAAT,CAApD;AACA,QAAM,CAACe,UAAD,EAAad,aAAb,IAA8B,qBAAS,KAAT,CAApC;AAEA,wBAAU,MAAM;AACd,QAAIe,KAAJ,CADc,CAEd;;AACA,QAAI,CAACF,kBAAD,IAAuB,CAACC,UAA5B,EAAwC;AACtCC,MAAAA,KAAK,GAAGC,UAAU,CAAClB,aAAa,CAACC,qBAAD,EAAwBC,aAAxB,CAAd,EAAsDY,cAAtD,CAAlB;AACD;;AACD,WAAO,MAAMG,KAAK,IAAIE,YA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QAAQ,EAAE;AAA5D,KACGC,QAAQ,IAAI,oBAAK,wBAAU,EAAV,CAAL,EAAoB,wBAASA,QAAT,CAApB,mBAA+CvB,eAA/C,CADf,CADF,CADF,CADF,CAJF,EAaGJ,QAAQ,KAAK,WAAb,gBACC,6BAAC,0CAAD;AAAU,IAAA,SAAS,EAAEa,eAAMe,QAA3B;AAAqC,IAAA,KAAK,EAAE,EAA5C;AAAgD,IAAA,MAAM,EAAE,EAAxD;AAA4D,kBAAY3B;AAAxE,IADD,gBAGC;AAAK,IAAA,SAAS,EAAEY,eAAMR;AAAtB,KAAmCA,UAAnC,CAhBJ,CAbF,CADF;AAmCD,CAnED;;AAqEAV,kBAAkB,CAACkC,SAAnB,2CAA+BA,kBAA/B;eAEelC,kB","sourcesContent":["import React, {useEffect, useState} from 'react';\nimport classnames from 'classnames';\nimport {pipe, round, parseInt as _parseInt, multiply} from 'lodash/fp';\nimport {\n NovaCompositionCoorpacademyStar as StarIcon,\n NovaSolidVoteRewardsRewardsBadge5 as RankIcon\n} from '@coorpacademy/nova-icons';\nimport AtomLottieWrapper from '../../atom/lottie-wrapper';\nimport Animation, {EASE_OUT_CUBIC} from '../../hoc/animation';\nimport AnimationScheduler from '../../hoc/animation-scheduler';\nimport style from './style.css';\nimport propTypes from './prop-types';\n\nexport const setAnimations = (setIsAnimationVisible, setIsAnimated) => () => {\n setIsAnimationVisible('play');\n setIsAnimated(true);\n};\n\nconst ReviewCardCongrats = props => {\n const {\n 'aria-label': ariaLabel,\n 'data-name': dataName,\n animationLottie,\n cardType,\n iconAriaLabel,\n className,\n reviewCardTitle,\n reviewCardValue,\n rankSuffix,\n timerAnimation\n } = props;\n\n const [isAnimationVisible, setIsAnimationVisible] = useState('loading');\n const [isAnimated, setIsAnimated] = useState(false);\n\n useEffect(() => {\n let timer;\n // istanbul ignore else\n if (!isAnimationVisible || !isAnimated) {\n timer = setTimeout(setAnimations(setIsAnimationVisible, setIsAnimated), timerAnimation);\n }\n return () => timer && clearTimeout(timer);\n }, [timerAnimation, isAnimated, isAnimationVisible]);\n\n const wrapperClassName = classnames(\n className,\n style.cardContainer,\n cardType === 'card-star' ? style.cardStar : style.cardRank\n );\n\n return (\n <div className={wrapperClassName} aria-label={ariaLabel} data-name={dataName}>\n <div className={style.mainIcon}>\n <AtomLottieWrapper\n {...animationLottie}\n loop={false}\n animationControl={isAnimationVisible}\n autoplay={false}\n data-name=\"lottie-wrapper\"\n className={style.wrapperLottie}\n backupImageClassName={style.ie11Backup}\n />\n </div>\n <div className={style.title}>{reviewCardTitle}</div>\n <div className={cardType === 'card-star' ? style.textContainerStar : style.textContainerRank}>\n {cardType === 'card-rank' ? (\n <RankIcon className={style.iconRank} width={40} height={40} aria-label={iconAriaLabel} />\n ) : null}\n <AnimationScheduler animated={isAnimated}>\n <div>\n <span className={cardType === 'card-star' ? style.textStar : style.textRank}>\n <Animation name=\"counter\" bezier={EASE_OUT_CUBIC} duration={2000}>\n {progress => pipe(_parseInt(10), multiply(progress), round)(reviewCardValue)}\n </Animation>\n </span>\n </div>\n </AnimationScheduler>\n {cardType === 'card-star' ? (\n <StarIcon className={style.iconStar} width={53} height={53} aria-label={iconAriaLabel} />\n ) : (\n <div className={style.rankSuffix}>{rankSuffix}</div>\n )}\n </div>\n </div>\n );\n};\n\nReviewCardCongrats.propTypes = propTypes;\n\nexport default ReviewCardCongrats;\n"],"file":"index.js"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
7
|
+
|
|
8
|
+
var _propTypes2 = _interopRequireDefault(require("../../atom/lottie-wrapper/prop-types"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
var _default = {
|
|
13
|
+
'aria-label': _propTypes.default.string,
|
|
14
|
+
'data-name': _propTypes.default.string,
|
|
15
|
+
animationLottie: _propTypes.default.shape(_propTypes2.default),
|
|
16
|
+
cardType: _propTypes.default.string,
|
|
17
|
+
iconAriaLabel: _propTypes.default.string,
|
|
18
|
+
className: _propTypes.default.string,
|
|
19
|
+
reviewCardTitle: _propTypes.default.string,
|
|
20
|
+
reviewCardValue: _propTypes.default.string,
|
|
21
|
+
rankSuffix: _propTypes.default.string,
|
|
22
|
+
timerAnimation: _propTypes.default.number
|
|
23
|
+
};
|
|
24
|
+
exports.default = _default;
|
|
25
|
+
//# sourceMappingURL=prop-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/review-card-congrats/prop-types.js"],"names":["PropTypes","string","animationLottie","shape","AtomLottieWrapperPropTypes","cardType","iconAriaLabel","className","reviewCardTitle","reviewCardValue","rankSuffix","timerAnimation","number"],"mappings":";;;;;AAAA;;AACA;;;;eAEe;AACb,gBAAcA,mBAAUC,MADX;AAEb,eAAaD,mBAAUC,MAFV;AAGbC,EAAAA,eAAe,EAAEF,mBAAUG,KAAV,CAAgBC,mBAAhB,CAHJ;AAIbC,EAAAA,QAAQ,EAAEL,mBAAUC,MAJP;AAKbK,EAAAA,aAAa,EAAEN,mBAAUC,MALZ;AAMbM,EAAAA,SAAS,EAAEP,mBAAUC,MANR;AAObO,EAAAA,eAAe,EAAER,mBAAUC,MAPd;AAQbQ,EAAAA,eAAe,EAAET,mBAAUC,MARd;AASbS,EAAAA,UAAU,EAAEV,mBAAUC,MATT;AAUbU,EAAAA,cAAc,EAAEX,mBAAUY;AAVb,C","sourcesContent":["import PropTypes from 'prop-types';\nimport AtomLottieWrapperPropTypes from '../../atom/lottie-wrapper/prop-types';\n\nexport default {\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string,\n animationLottie: PropTypes.shape(AtomLottieWrapperPropTypes),\n cardType: PropTypes.string,\n iconAriaLabel: PropTypes.string,\n className: PropTypes.string,\n reviewCardTitle: PropTypes.string,\n reviewCardValue: PropTypes.string,\n rankSuffix: PropTypes.string,\n timerAnimation: PropTypes.number\n};\n"],"file":"prop-types.js"}
|
|
@@ -7,14 +7,14 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
7
7
|
|
|
8
8
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
9
|
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
10
|
var _novaIcons = require("@coorpacademy/nova-icons");
|
|
13
11
|
|
|
14
12
|
var _buttonLink = _interopRequireDefault(require("../../atom/button-link"));
|
|
15
13
|
|
|
16
14
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
17
15
|
|
|
16
|
+
var _propTypes = _interopRequireDefault(require("./prop-types"));
|
|
17
|
+
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
19
|
|
|
20
20
|
function _extends() { _extends = Object.assign || 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); }
|
|
@@ -97,25 +97,7 @@ const ReviewCorrectionPopin = props => {
|
|
|
97
97
|
}))))));
|
|
98
98
|
};
|
|
99
99
|
|
|
100
|
-
ReviewCorrectionPopin.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
101
|
-
type: _propTypes.default.oneOf(['right', 'wrong']),
|
|
102
|
-
resultLabel: _propTypes.default.string,
|
|
103
|
-
information: _propTypes.default.shape({
|
|
104
|
-
label: _propTypes.default.string,
|
|
105
|
-
message: _propTypes.default.string
|
|
106
|
-
}),
|
|
107
|
-
next: _propTypes.default.shape({
|
|
108
|
-
label: _propTypes.default.string,
|
|
109
|
-
onClick: _propTypes.default.func,
|
|
110
|
-
'data-name': _propTypes.default.string,
|
|
111
|
-
'aria-label': _propTypes.default.string
|
|
112
|
-
}),
|
|
113
|
-
klf: _propTypes.default.shape({
|
|
114
|
-
label: _propTypes.default.string,
|
|
115
|
-
onClick: _propTypes.default.func,
|
|
116
|
-
tooltip: _propTypes.default.string
|
|
117
|
-
})
|
|
118
|
-
} : {};
|
|
100
|
+
ReviewCorrectionPopin.propTypes = process.env.NODE_ENV !== "production" ? _propTypes.default : {};
|
|
119
101
|
var _default = ReviewCorrectionPopin;
|
|
120
102
|
exports.default = _default;
|
|
121
103
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/review-correction-popin/index.js"],"names":["buildKlfButton","klf","klfButtonProps","icon","position","type","style","klfContainer","klfButtonContainer","klfButton","toolTip","tooltipText","tooltip","ReviewCorrectionPopin","props","information","resultLabel","next","nextQuestionButtonProps","cta","ICONS","right","RightIcon","wrong","WrongIcon","Icon","wrapper","popin","correctionSection","iconCircle","iconRight","iconWrong","feedbackSection","labelContainer","label","message","actions","actionsWrong","nextQuestionContainer","nextQuestionButton","propTypes"
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/review-correction-popin/index.js"],"names":["buildKlfButton","klf","klfButtonProps","icon","position","type","style","klfContainer","klfButtonContainer","klfButton","toolTip","tooltipText","tooltip","ReviewCorrectionPopin","props","information","resultLabel","next","nextQuestionButtonProps","cta","ICONS","right","RightIcon","wrong","WrongIcon","Icon","wrapper","popin","correctionSection","iconCircle","iconRight","iconWrong","feedbackSection","labelContainer","label","message","actions","actionsWrong","nextQuestionContainer","nextQuestionButton","propTypes"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAIA;;AACA;;AACA;;;;;;AAEA,MAAMA,cAAc,GAAGC,GAAG,IAAI;AAC5B,QAAMC,cAAc,yBACfD,GADe;AAElBE,IAAAA,IAAI,EAAE;AACJC,MAAAA,QAAQ,EAAE,MADN;AAEJC,MAAAA,IAAI,EAAE;AAFF,KAFY;AAMlBA,IAAAA,IAAI,EAAE;AANY,IAApB;;AASA,sBACE;AAAK,IAAA,S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A,SAAS,EAAEzB,eAAMU,WAAtB;AAAmC,kBAAW;AAA9C,kBACE;AAAM,kBAAYA;AAAlB,KAAgCA,WAAhC,CADF,CAJF,CADF,eASE;AAAK,IAAA,SAAS,EAAEV,eAAM0B;AAAtB,kBACE;AAAK,IAAA,SAAS,EAAE1B,eAAMS,WAAtB;AAAmC,kBAAW;AAA9C,kBACE;AAAK,IAAA,SAAS,EAAET,eAAM2B;AAAtB,kBACE;AAAM,IAAA,SAAS,EAAE3B,eAAM4B,KAAvB;AAA8B,kBAAYnB,WAAW,CAACmB;AAAtD,KACGnB,WAAW,CAACmB,KADf,CADF,CADF,eAME;AAAM,IAAA,SAAS,EAAE5B,eAAM6B,OAAvB;AAAgC,kBAAYpB,WAAW,CAACoB;AAAxD,KACGpB,WAAW,CAACoB,OADf,CANF,CADF,CATF,eAqBE;AAAK,IAAA,SAAS,EAAE9B,IAAI,KAAK,OAAT,GAAmBC,eAAM8B,OAAzB,GAAmC9B,eAAM+B;AAAzD,KACGlB,GADH,eAEE;AAAK,IAAA,SAAS,EAAEb,eAAMgC;AAAtB,kBACE,6BAAC,mBAAD,eAAgBpB,uBAAhB;AAAyC,IAAA,SAAS,EAAEZ,eAAMiC;AAA1D,KADF,CAFF,CArBF,CADF,CADF;AAgCD,CAhDD;;AAkDA1B,qBAAqB,CAAC2B,SAAtB,2CAAkCA,kBAAlC;eAEe3B,qB","sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademyCheck as RightIcon,\n NovaSolidStatusClose as WrongIcon\n} from '@coorpacademy/nova-icons';\nimport ButtonLink from '../../atom/button-link';\nimport style from './style.css';\nimport propTypes from './prop-types';\n\nconst buildKlfButton = klf => {\n const klfButtonProps = {\n ...klf,\n icon: {\n position: 'left',\n type: 'key'\n },\n type: 'primary'\n };\n\n return (\n <div className={style.klfContainer}>\n <div className={style.klfButtonContainer}>\n <ButtonLink {...klfButtonProps} className={style.klfButton} />\n </div>\n <div className={style.toolTip}>\n <div className={style.tooltipText}>{klf.tooltip}</div>\n </div>\n </div>\n );\n};\n\nconst ReviewCorrectionPopin = props => {\n const {information, resultLabel, type, klf, next} = props;\n\n const nextQuestionButtonProps = {\n ...next,\n type: 'primary'\n };\n\n const cta = type === 'wrong' ? buildKlfButton(klf) : null;\n\n const ICONS = {\n right: RightIcon,\n wrong: WrongIcon\n };\n const Icon = ICONS[type];\n\n return (\n <div className={style.wrapper}>\n <div className={classnames(style.popin, type === 'right' ? style.right : style.wrong)}>\n <div className={style.correctionSection}>\n <div className={style.iconCircle}>\n <Icon className={type === 'right' ? style.iconRight : style.iconWrong} />\n </div>\n <div className={style.resultLabel} aria-label=\"result\">\n <span aria-label={resultLabel}>{resultLabel}</span>\n </div>\n </div>\n <div className={style.feedbackSection}>\n <div className={style.information} aria-label=\"answer-information\">\n <div className={style.labelContainer}>\n <span className={style.label} aria-label={information.label}>\n {information.label}\n </span>\n </div>\n <span className={style.message} aria-label={information.message}>\n {information.message}\n </span>\n </div>\n </div>\n <div className={type === 'right' ? style.actions : style.actionsWrong}>\n {cta}\n <div className={style.nextQuestionContainer}>\n <ButtonLink {...nextQuestionButtonProps} className={style.nextQuestionButton} />\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nReviewCorrectionPopin.propTypes = propTypes;\n\nexport default ReviewCorrectionPopin;\n"],"file":"index.js"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
7
|
+
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
|
|
10
|
+
var _default = {
|
|
11
|
+
type: _propTypes.default.oneOf(['right', 'wrong']),
|
|
12
|
+
resultLabel: _propTypes.default.string,
|
|
13
|
+
information: _propTypes.default.shape({
|
|
14
|
+
label: _propTypes.default.string,
|
|
15
|
+
message: _propTypes.default.string
|
|
16
|
+
}),
|
|
17
|
+
next: _propTypes.default.shape({
|
|
18
|
+
label: _propTypes.default.string,
|
|
19
|
+
onClick: _propTypes.default.func,
|
|
20
|
+
'data-name': _propTypes.default.string,
|
|
21
|
+
'aria-label': _propTypes.default.string
|
|
22
|
+
}),
|
|
23
|
+
klf: _propTypes.default.shape({
|
|
24
|
+
label: _propTypes.default.string,
|
|
25
|
+
onClick: _propTypes.default.func,
|
|
26
|
+
tooltip: _propTypes.default.string
|
|
27
|
+
})
|
|
28
|
+
};
|
|
29
|
+
exports.default = _default;
|
|
30
|
+
//# sourceMappingURL=prop-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/review-correction-popin/prop-types.js"],"names":["type","PropTypes","oneOf","resultLabel","string","information","shape","label","message","next","onClick","func","klf","tooltip"],"mappings":";;;;;AAAA;;;;eAEe;AACbA,EAAAA,IAAI,EAAEC,mBAAUC,KAAV,CAAgB,CAAC,OAAD,EAAU,OAAV,CAAhB,CADO;AAEbC,EAAAA,WAAW,EAAEF,mBAAUG,MAFV;AAGbC,EAAAA,WAAW,EAAEJ,mBAAUK,KAAV,CAAgB;AAC3BC,IAAAA,KAAK,EAAEN,mBAAUG,MADU;AAE3BI,IAAAA,OAAO,EAAEP,mBAAUG;AAFQ,GAAhB,CAHA;AAObK,EAAAA,IAAI,EAAER,mBAAUK,KAAV,CAAgB;AACpBC,IAAAA,KAAK,EAAEN,mBAAUG,MADG;AAEpBM,IAAAA,OAAO,EAAET,mBAAUU,IAFC;AAGpB,iBAAaV,mBAAUG,MAHH;AAIpB,kBAAcH,mBAAUG;AAJJ,GAAhB,CAPO;AAabQ,EAAAA,GAAG,EAAEX,mBAAUK,KAAV,CAAgB;AACnBC,IAAAA,KAAK,EAAEN,mBAAUG,MADE;AAEnBM,IAAAA,OAAO,EAAET,mBAAUU,IAFA;AAGnBE,IAAAA,OAAO,EAAEZ,mBAAUG;AAHA,GAAhB;AAbQ,C","sourcesContent":["import PropTypes from 'prop-types';\n\nexport default {\n type: PropTypes.oneOf(['right', 'wrong']),\n resultLabel: PropTypes.string,\n information: PropTypes.shape({\n label: PropTypes.string,\n message: PropTypes.string\n }),\n next: PropTypes.shape({\n label: PropTypes.string,\n onClick: PropTypes.func,\n 'data-name': PropTypes.string,\n 'aria-label': PropTypes.string\n }),\n klf: PropTypes.shape({\n label: PropTypes.string,\n onClick: PropTypes.func,\n tooltip: PropTypes.string\n })\n};\n"],"file":"prop-types.js"}
|
|
@@ -5,14 +5,14 @@ exports.default = void 0;
|
|
|
5
5
|
|
|
6
6
|
var _react = _interopRequireDefault(require("react"));
|
|
7
7
|
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
|
|
10
8
|
var _map = _interopRequireDefault(require("lodash/fp/map"));
|
|
11
9
|
|
|
12
10
|
var _reviewHeaderStepItem = _interopRequireDefault(require("../../atom/review-header-step-item"));
|
|
13
11
|
|
|
14
12
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
15
13
|
|
|
14
|
+
var _propTypes = _interopRequireDefault(require("./prop-types"));
|
|
15
|
+
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
|
|
18
18
|
function _extends() { _extends = Object.assign || 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); }
|
|
@@ -34,9 +34,7 @@ const ReviewHeaderSteps = props => {
|
|
|
34
34
|
}, items);
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
ReviewHeaderSteps.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
38
|
-
steps: _propTypes.default.arrayOf(_propTypes.default.shape(_reviewHeaderStepItem.default.props))
|
|
39
|
-
} : {};
|
|
37
|
+
ReviewHeaderSteps.propTypes = process.env.NODE_ENV !== "production" ? _propTypes.default : {};
|
|
40
38
|
var _default = ReviewHeaderSteps;
|
|
41
39
|
exports.default = _default;
|
|
42
40
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/review-header-steps/index.js"],"names":["ReviewHeaderSteps","props","steps","items","map","convert","cap","step","index","style","wrapper","propTypes"
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/review-header-steps/index.js"],"names":["ReviewHeaderSteps","props","steps","items","map","convert","cap","step","index","style","wrapper","propTypes"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,iBAAiB,GAAGC,KAAK,IAAI;AACjC,QAAM;AAACC,IAAAA;AAAD,MAAUD,KAAhB;;AAEA,QAAME,KAAK,GAAGC,aAAIC,OAAJ,CAAY;AAACC,IAAAA,GAAG,EAAE;AAAN,GAAZ,EACZ,CAACC,IAAD,EAAOC,KAAP,kBAAiB,6BAAC,6BAAD,eAA0BD,IAA1B;AAAgC,IAAA,GAAG,EAAEC;AAArC,KADL,EAEZN,KAFY,CAAd;;AAKA,sBACE;AAAK,IAAA,SAAS,EAAEO,eAAMC,OAAtB;AAA+B,iBAAU;AAAzC,KACGP,KADH,CADF;AAKD,CAbD;;AAeAH,iBAAiB,CAACW,SAAlB,2CAA8BA,kBAA9B;eAEeX,iB","sourcesContent":["import React from 'react';\nimport map from 'lodash/fp/map';\nimport ReviewHeaderStepItem from '../../atom/review-header-step-item';\nimport style from './style.css';\nimport propTypes from './prop-types';\n\nconst ReviewHeaderSteps = props => {\n const {steps} = props;\n\n const items = map.convert({cap: false})(\n (step, index) => <ReviewHeaderStepItem {...step} key={index} />,\n steps\n );\n\n return (\n <div className={style.wrapper} data-name=\"header-steps\">\n {items}\n </div>\n );\n};\n\nReviewHeaderSteps.propTypes = propTypes;\n\nexport default ReviewHeaderSteps;\n"],"file":"index.js"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
7
|
+
|
|
8
|
+
var _propTypes2 = _interopRequireDefault(require("../../atom/review-header-step-item/prop-types"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
var _default = {
|
|
13
|
+
steps: _propTypes.default.arrayOf(_propTypes.default.shape(_propTypes2.default))
|
|
14
|
+
};
|
|
15
|
+
exports.default = _default;
|
|
16
|
+
//# sourceMappingURL=prop-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/review-header-steps/prop-types.js"],"names":["steps","PropTypes","arrayOf","shape","ReviewHeaderStepItemPropTypes"],"mappings":";;;;;AAAA;;AAEA;;;;eAEe;AACbA,EAAAA,KAAK,EAAEC,mBAAUC,OAAV,CAAkBD,mBAAUE,KAAV,CAAgBC,mBAAhB,CAAlB;AADM,C","sourcesContent":["import PropTypes from 'prop-types';\n\nimport ReviewHeaderStepItemPropTypes from '../../atom/review-header-step-item/prop-types';\n\nexport default {\n steps: PropTypes.arrayOf(PropTypes.shape(ReviewHeaderStepItemPropTypes))\n};\n"],"file":"prop-types.js"}
|
|
@@ -7,8 +7,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
7
7
|
|
|
8
8
|
var _cssColorFunction = require("css-color-function");
|
|
9
9
|
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
10
|
var _novaIcons = require("@coorpacademy/nova-icons");
|
|
13
11
|
|
|
14
12
|
var _getOr = _interopRequireDefault(require("lodash/fp/getOr"));
|
|
@@ -17,6 +15,8 @@ var _buttonLink = _interopRequireDefault(require("../../atom/button-link"));
|
|
|
17
15
|
|
|
18
16
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
19
17
|
|
|
18
|
+
var _propTypes = _interopRequireDefault(require("./prop-types"));
|
|
19
|
+
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
21
|
|
|
22
22
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
@@ -89,17 +89,7 @@ const SkillCard = (props, context) => {
|
|
|
89
89
|
}, /*#__PURE__*/_react.default.createElement(_buttonLink.default, buttonProps))));
|
|
90
90
|
};
|
|
91
91
|
|
|
92
|
-
SkillCard.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
93
|
-
'aria-label': _propTypes.default.string.isRequired,
|
|
94
|
-
skillTitle: _propTypes.default.string,
|
|
95
|
-
skillAriaLabel: _propTypes.default.string,
|
|
96
|
-
buttonLabel: _propTypes.default.string,
|
|
97
|
-
buttonAriaLabel: _propTypes.default.string,
|
|
98
|
-
reviseLabel: _propTypes.default.string,
|
|
99
|
-
reviseAriaLabel: _propTypes.default.string,
|
|
100
|
-
isCustom: _propTypes.default.bool,
|
|
101
|
-
onClick: _propTypes.default.func
|
|
102
|
-
} : {};
|
|
92
|
+
SkillCard.propTypes = process.env.NODE_ENV !== "production" ? _propTypes.default : {};
|
|
103
93
|
var _default = SkillCard;
|
|
104
94
|
exports.default = _default;
|
|
105
95
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/skill-card/index.js"],"names":["getGradientBackground","baseColor","gradients","SkillCard","props","context","ariaLabel","skillTitle","skillAriaLabel","buttonLabel","buttonAriaLabel","reviseLabel","reviseAriaLabel","onClick","isCustom","skin","hovered","setHovered","primarySkinColor","handleMouseOver","handleMouseLeave","buttonProps","customStyle","backgroundColor","color","transition","label","titleBackgroundColor","titleBackground","style","skillCardWrapper","background","questionReviseText","questionReviseIcon","buttonWrapper","propTypes"
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/skill-card/index.js"],"names":["getGradientBackground","baseColor","gradients","SkillCard","props","context","ariaLabel","skillTitle","skillAriaLabel","buttonLabel","buttonAriaLabel","reviseLabel","reviseAriaLabel","onClick","isCustom","skin","hovered","setHovered","primarySkinColor","handleMouseOver","handleMouseLeave","buttonProps","customStyle","backgroundColor","color","transition","label","titleBackgroundColor","titleBackground","style","skillCardWrapper","background","questionReviseText","questionReviseIcon","buttonWrapper","propTypes"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,qBAAqB,GAAGC,SAAS,IAAI;AACzC,QAAMC,SAAS,GAAG,CAChB,+BAAS,SAAQD,SAAU,kBAA3B,CADgB,EAEhB,+BAAS,SAAQA,SAAU,kBAA3B,CAFgB,EAGhB,+BAAS,SAAQA,SAAU,kBAA3B,CAHgB,CAAlB;AAMA,SAAQ,+CAA8CC,SAAS,CAAC,CAAD,CAAI,QAAO,+BACvE,SAAQA,SAAS,CAAC,CAAD,CAAI,QADkD,CAExE,4DAA2DA,SAAS,CAAC,CAAD,CAAI,QAAO,+BAC9E,SAAQA,SAAS,CAAC,CAAD,CAAI,QADyD,CAE/E,2DAA0DA,SAAS,CAAC,CAAD,CAAI,QAAO,+BAC7E,SAAQA,SAAS,CAAC,CAAD,CAAI,QADwD,CAE9E,WAAUD,SAAU,EANtB;AAOD,CAdD;;AAgBA,MAAME,SAAS,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;AACpC,QAAM;AACJ,kBAAcC,SADV;AAEJC,IAAAA,UAFI;AAGJC,IAAAA,cAHI;AAIJC,IAAAA,WAJI;AAKJC,IAAAA,eALI;AAMJC,IAAAA,WANI;AAOJC,IAAAA,eAPI;AAQJC,IAAAA,OARI;AASJC,IAAAA,QAAQ,GAAG;AATP,MAUFV,KAVJ;AAWA,QAAM;AAACW,IAAAA;AAAD,MAASV,OAAf;AACA,QAAM,CAACW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SAAS,EAAEsB,eAAMG,kBADnB;AAEE,iBAAU,2BAFZ;AAGE,kBAAYpB,eAAe,IAAID;AAHjC,kBAKE,6BAAC,0DAAD;AAAc,IAAA,SAAS,EAAEkB,eAAMI,kBAA/B;AAAmD,IAAA,KAAK,EAAE,EAA1D;AAA8D,IAAA,MAAM,EAAE;AAAtE,IALF,EAMGtB,WANH,CADF,eASE;AACE,IAAA,SAAS,EAAEkB,eAAMK,aADnB;AAEE,IAAA,WAAW,EAAEf,eAFf;AAGE,IAAA,YAAY,EAAEC,gBAHhB;AAIE,iBAAU;AAJZ,kBAME,6BAAC,mBAAD,EAAgBC,WAAhB,CANF,CATF,CAXF,CADF;AAgCD,CAzED;;AA2EAlB,SAAS,CAACgC,SAAV,2CAAsBA,kBAAtB;eAEehC,S","sourcesContent":["import React, {useCallback, useState, useMemo} from 'react';\nimport {convert} from 'css-color-function';\nimport {NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionIcon} from '@coorpacademy/nova-icons';\nimport getOr from 'lodash/fp/getOr';\nimport ButtonLink from '../../atom/button-link';\nimport style from './style.css';\nimport propTypes from './prop-types';\n\nconst getGradientBackground = baseColor => {\n const gradients = [\n convert(`color(${baseColor} lightness(30%))`),\n convert(`color(${baseColor} lightness(47%))`),\n convert(`color(${baseColor} lightness(55%))`)\n ];\n\n return `radial-gradient(62.12% 56.45% at 0% 77.29%, ${gradients[0]} 0%, ${convert(\n `color(${gradients[0]} a(0))`\n )} 100%), radial-gradient(113.85% 103.46% at 93.27% 7.88%, ${gradients[1]} 0%, ${convert(\n `color(${gradients[1]} a(0))`\n )} 100%), radial-gradient(49.66% 49.63% at 78.65% 86.26%, ${gradients[2]} 0%, ${convert(\n `color(${gradients[2]} a(0))`\n )} 100%), ${baseColor}`;\n};\n\nconst SkillCard = (props, context) => {\n const {\n 'aria-label': ariaLabel,\n skillTitle,\n skillAriaLabel,\n buttonLabel,\n buttonAriaLabel,\n reviseLabel,\n reviseAriaLabel,\n onClick,\n isCustom = false\n } = props;\n const {skin} = context;\n const [hovered, setHovered] = useState(false);\n const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);\n\n const handleMouseOver = useCallback(() => setHovered(true), [setHovered]);\n\n const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);\n\n const buttonProps = {\n customStyle: {\n backgroundColor: hovered ? primarySkinColor : convert(`color(${primarySkinColor} a(0.07))`),\n color: hovered ? '#FFFFFF' : primarySkinColor,\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out'\n },\n onClick,\n 'aria-label': buttonAriaLabel,\n label: buttonLabel,\n 'data-name': 'skill-card-button'\n };\n\n const titleBackgroundColor = useMemo(() => (isCustom ? '#128C72' : primarySkinColor), [\n isCustom,\n primarySkinColor\n ]);\n\n const titleBackground = useMemo(() => getGradientBackground(titleBackgroundColor), [\n titleBackgroundColor\n ]);\n\n return (\n <div className={style.skillCardWrapper} data-name=\"skill-card-wrapper\" aria-label={ariaLabel}>\n <div\n data-name=\"skill-title\"\n className={style.skillTitle}\n aria-label={skillAriaLabel || skillTitle}\n style={{\n background: titleBackground\n }}\n >\n {skillTitle}\n </div>\n <div data-name=\"card-content-wrapper\">\n <div\n className={style.questionReviseText}\n data-name=\"questions-to-revise-label\"\n aria-label={reviseAriaLabel || reviseLabel}\n >\n <QuestionIcon className={style.questionReviseIcon} width={16} height={16} />\n {reviseLabel}\n </div>\n <div\n className={style.buttonWrapper}\n onMouseOver={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n data-name=\"button-wrapper\"\n >\n <ButtonLink {...buttonProps} />\n </div>\n </div>\n </div>\n );\n};\n\nSkillCard.propTypes = propTypes;\n\nexport default SkillCard;\n"],"file":"index.js"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
7
|
+
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
|
|
10
|
+
var _default = {
|
|
11
|
+
'aria-label': _propTypes.default.string,
|
|
12
|
+
skillTitle: _propTypes.default.string,
|
|
13
|
+
skillAriaLabel: _propTypes.default.string,
|
|
14
|
+
buttonLabel: _propTypes.default.string,
|
|
15
|
+
buttonAriaLabel: _propTypes.default.string,
|
|
16
|
+
reviseLabel: _propTypes.default.string,
|
|
17
|
+
reviseAriaLabel: _propTypes.default.string,
|
|
18
|
+
isCustom: _propTypes.default.bool,
|
|
19
|
+
onClick: _propTypes.default.func
|
|
20
|
+
};
|
|
21
|
+
exports.default = _default;
|
|
22
|
+
//# sourceMappingURL=prop-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/skill-card/prop-types.js"],"names":["PropTypes","string","skillTitle","skillAriaLabel","buttonLabel","buttonAriaLabel","reviseLabel","reviseAriaLabel","isCustom","bool","onClick","func"],"mappings":";;;;;AAAA;;;;eAEe;AACb,gBAAcA,mBAAUC,MADX;AAEbC,EAAAA,UAAU,EAAEF,mBAAUC,MAFT;AAGbE,EAAAA,cAAc,EAAEH,mBAAUC,MAHb;AAIbG,EAAAA,WAAW,EAAEJ,mBAAUC,MAJV;AAKbI,EAAAA,eAAe,EAAEL,mBAAUC,MALd;AAMbK,EAAAA,WAAW,EAAEN,mBAAUC,MANV;AAObM,EAAAA,eAAe,EAAEP,mBAAUC,MAPd;AAQbO,EAAAA,QAAQ,EAAER,mBAAUS,IARP;AASbC,EAAAA,OAAO,EAAEV,mBAAUW;AATN,C","sourcesContent":["import PropTypes from 'prop-types';\n\nexport default {\n 'aria-label': PropTypes.string,\n skillTitle: PropTypes.string,\n skillAriaLabel: PropTypes.string,\n buttonLabel: PropTypes.string,\n buttonAriaLabel: PropTypes.string,\n reviseLabel: PropTypes.string,\n reviseAriaLabel: PropTypes.string,\n isCustom: PropTypes.bool,\n onClick: PropTypes.func\n};\n"],"file":"prop-types.js"}
|
|
@@ -5,10 +5,6 @@ exports.default = void 0;
|
|
|
5
5
|
|
|
6
6
|
var _react = _interopRequireDefault(require("react"));
|
|
7
7
|
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
|
|
10
|
-
var _proptypes = require("../../util/proptypes");
|
|
11
|
-
|
|
12
8
|
var _videoIframe = _interopRequireDefault(require("../video-iframe"));
|
|
13
9
|
|
|
14
10
|
var _jwplayer = _interopRequireDefault(require("./jwplayer"));
|
|
@@ -17,6 +13,8 @@ var _vimeo = _interopRequireDefault(require("./vimeo"));
|
|
|
17
13
|
|
|
18
14
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
19
15
|
|
|
16
|
+
var _propTypes = _interopRequireDefault(require("./prop-types"));
|
|
17
|
+
|
|
20
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
19
|
|
|
22
20
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -135,21 +133,7 @@ class VideoPlayer extends _react.default.Component {
|
|
|
135
133
|
|
|
136
134
|
}
|
|
137
135
|
|
|
138
|
-
VideoPlayer.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
139
|
-
id: _propTypes.default.string,
|
|
140
|
-
width: _propTypes.default.string,
|
|
141
|
-
height: _propTypes.default.string,
|
|
142
|
-
url: _proptypes.SrcPropType,
|
|
143
|
-
onPlay: _propTypes.default.func,
|
|
144
|
-
onResume: _propTypes.default.func,
|
|
145
|
-
onPause: _propTypes.default.func,
|
|
146
|
-
onEnded: _propTypes.default.func,
|
|
147
|
-
onError: _propTypes.default.func,
|
|
148
|
-
autoplay: _propTypes.default.bool,
|
|
149
|
-
disableAutostart: _propTypes.default.bool,
|
|
150
|
-
jwpOptions: _jwplayer.default.propTypes.jwpOptions,
|
|
151
|
-
mimeType: _propTypes.default.oneOf(['application/kontiki', 'application/uptale', 'application/vimeo', 'application/youtube', 'application/jwplayer', 'application/omniPlayer', 'application/h5p', 'video/mp4']).isRequired
|
|
152
|
-
} : {};
|
|
136
|
+
VideoPlayer.propTypes = process.env.NODE_ENV !== "production" ? _propTypes.default : {};
|
|
153
137
|
var _default = VideoPlayer;
|
|
154
138
|
exports.default = _default;
|
|
155
139
|
//# sourceMappingURL=index.js.map
|