@coorpacademy/components 10.5.5 → 10.5.7-alpha.12
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/range/handle.css +18 -2
- package/es/atom/range/handle.js +7 -3
- package/es/atom/range/handle.js.map +1 -1
- package/es/atom/range/style.css +2 -2
- package/es/atom/select/index.js +38 -20
- package/es/atom/select/index.js.map +1 -1
- package/es/atom/select/style.css +129 -40
- package/es/atom/select/test/fixtures/player.js +11 -0
- package/es/atom/select/test/fixtures/player.js.map +1 -0
- package/es/atom/select/test/fixtures.js +2 -0
- package/es/atom/select/test/fixtures.js.map +1 -1
- package/es/atom/select/test/select.js +49 -0
- package/es/atom/select/test/select.js.map +1 -0
- package/es/molecule/course-section/index.js +5 -3
- package/es/molecule/course-section/index.js.map +1 -1
- package/es/molecule/course-section/style.css +2 -1
- package/es/molecule/course-section/test/fixtures/chapter.js +2 -1
- package/es/molecule/course-section/test/fixtures/chapter.js.map +1 -1
- package/es/molecule/course-section/test/fixtures/course.js +2 -1
- package/es/molecule/course-section/test/fixtures/course.js.map +1 -1
- package/es/molecule/course-sections/index.js +40 -0
- package/es/molecule/course-sections/index.js.map +1 -0
- package/es/molecule/course-sections/style.css +3 -0
- package/es/molecule/course-sections/test/fixtures/default.js +149 -0
- package/es/molecule/course-sections/test/fixtures/default.js.map +1 -0
- package/es/molecule/course-sections/test/fixtures/loading.js +9 -0
- package/es/molecule/course-sections/test/fixtures/loading.js.map +1 -0
- package/es/molecule/course-sections/test/fixtures.js +15 -0
- package/es/molecule/course-sections/test/fixtures.js.map +1 -0
- package/es/molecule/draggable/index.js +1 -1
- package/es/molecule/draggable/index.js.map +1 -1
- package/es/molecule/draggable/style.css +1 -5
- package/es/molecule/draggable-list/index.js +6 -4
- package/es/molecule/draggable-list/index.js.map +1 -1
- package/es/molecule/draggable-list/test/fixtures/course-sections.js +20 -0
- package/es/molecule/draggable-list/test/fixtures/course-sections.js.map +1 -0
- package/es/molecule/draggable-list/test/fixtures.js +2 -0
- package/es/molecule/draggable-list/test/fixtures.js.map +1 -1
- package/es/molecule/draggable-list/test/on-drop.js +13 -13
- package/es/molecule/draggable-list/test/on-drop.js.map +1 -1
- package/es/molecule/questions/drop-down/index.js +1 -6
- package/es/molecule/questions/drop-down/index.js.map +1 -1
- package/es/molecule/questions/free-text/index.js +35 -15
- package/es/molecule/questions/free-text/index.js.map +1 -1
- package/es/molecule/questions/free-text/style.css +39 -15
- package/es/molecule/questions/free-text/test/fixtures/default.js +1 -1
- package/es/molecule/questions/free-text/test/fixtures/default.js.map +1 -1
- package/es/molecule/questions/free-text/test/fixtures/with-value-on-change.js +9 -0
- package/es/molecule/questions/free-text/test/fixtures/with-value-on-change.js.map +1 -0
- package/es/molecule/questions/free-text/test/fixtures/{with-default-value.js → with-value.js} +2 -2
- package/es/molecule/questions/free-text/test/fixtures/with-value.js.map +1 -0
- package/es/molecule/questions/free-text/test/fixtures.js +4 -2
- package/es/molecule/questions/free-text/test/fixtures.js.map +1 -1
- package/es/molecule/questions/free-text/test/free-text.js +106 -0
- package/es/molecule/questions/free-text/test/free-text.js.map +1 -0
- package/es/molecule/questions/qcm/index.js +37 -25
- package/es/molecule/questions/qcm/index.js.map +1 -1
- package/es/molecule/questions/qcm/style.css +48 -14
- package/es/molecule/questions/qcm/test/fixtures/default.js +8 -0
- package/es/molecule/questions/qcm/test/fixtures/default.js.map +1 -1
- package/es/molecule/questions/qcm/test/qcm.js +103 -0
- package/es/molecule/questions/qcm/test/qcm.js.map +1 -0
- package/es/molecule/questions/qcm-graphic/index.js +35 -17
- package/es/molecule/questions/qcm-graphic/index.js.map +1 -1
- package/es/molecule/questions/qcm-graphic/style.css +64 -13
- package/es/molecule/questions/qcm-graphic/test/qcm-graphic.js +65 -0
- package/es/molecule/questions/qcm-graphic/test/qcm-graphic.js.map +1 -0
- package/es/molecule/questions/question-range/style.css +9 -8
- package/es/molecule/questions/template/index.js +13 -10
- package/es/molecule/questions/template/index.js.map +1 -1
- package/es/molecule/setup-section/style.css +1 -0
- package/es/molecule/wizard-summary/test/fixtures/organize-courses.js +106 -0
- package/es/molecule/wizard-summary/test/fixtures/organize-courses.js.map +1 -0
- package/es/molecule/wizard-summary/test/fixtures.js +2 -0
- package/es/molecule/wizard-summary/test/fixtures.js.map +1 -1
- package/es/organism/wizard-contents/index.js +6 -0
- package/es/organism/wizard-contents/index.js.map +1 -1
- package/es/organism/wizard-contents/test/fixtures/playlist-organize-courses.js +45 -0
- package/es/organism/wizard-contents/test/fixtures/playlist-organize-courses.js.map +1 -0
- package/es/organism/wizard-contents/test/fixtures.js +2 -0
- package/es/organism/wizard-contents/test/fixtures.js.map +1 -1
- package/es/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js +22 -0
- package/es/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js.map +1 -0
- package/es/template/back-office/brand-update/test/fixtures.js +2 -0
- package/es/template/back-office/brand-update/test/fixtures.js.map +1 -1
- package/es/util/get-shadow-box-color-from-primary.js +4 -0
- package/es/util/get-shadow-box-color-from-primary.js.map +1 -0
- package/es/util/test/get-shadow-box-color-from-primary.js +33 -0
- package/es/util/test/get-shadow-box-color-from-primary.js.map +1 -0
- package/es/variables/colors.css +3 -0
- package/lib/atom/range/handle.css +18 -2
- package/lib/atom/range/handle.js +8 -3
- package/lib/atom/range/handle.js.map +1 -1
- package/lib/atom/range/style.css +2 -2
- package/lib/atom/select/index.js +40 -17
- package/lib/atom/select/index.js.map +1 -1
- package/lib/atom/select/style.css +129 -40
- package/lib/atom/select/test/fixtures/player.js +21 -0
- package/lib/atom/select/test/fixtures/player.js.map +1 -0
- package/lib/atom/select/test/fixtures.js +3 -0
- package/lib/atom/select/test/fixtures.js.map +1 -1
- package/lib/atom/select/test/select.js +62 -0
- package/lib/atom/select/test/select.js.map +1 -0
- package/lib/molecule/course-section/index.js +5 -3
- package/lib/molecule/course-section/index.js.map +1 -1
- package/lib/molecule/course-section/style.css +2 -1
- package/lib/molecule/course-section/test/fixtures/chapter.js +2 -1
- package/lib/molecule/course-section/test/fixtures/chapter.js.map +1 -1
- package/lib/molecule/course-section/test/fixtures/course.js +2 -1
- package/lib/molecule/course-section/test/fixtures/course.js.map +1 -1
- package/lib/molecule/course-sections/index.js +54 -0
- package/lib/molecule/course-sections/index.js.map +1 -0
- package/lib/molecule/course-sections/style.css +3 -0
- package/lib/molecule/course-sections/test/fixtures/default.js +154 -0
- package/lib/molecule/course-sections/test/fixtures/default.js.map +1 -0
- package/lib/molecule/course-sections/test/fixtures/loading.js +14 -0
- package/lib/molecule/course-sections/test/fixtures/loading.js.map +1 -0
- package/lib/molecule/course-sections/test/fixtures.js +25 -0
- package/lib/molecule/course-sections/test/fixtures.js.map +1 -0
- package/lib/molecule/draggable/index.js +1 -1
- package/lib/molecule/draggable/index.js.map +1 -1
- package/lib/molecule/draggable/style.css +1 -5
- package/lib/molecule/draggable-list/index.js +7 -4
- package/lib/molecule/draggable-list/index.js.map +1 -1
- package/lib/molecule/draggable-list/test/fixtures/course-sections.js +29 -0
- package/lib/molecule/draggable-list/test/fixtures/course-sections.js.map +1 -0
- package/lib/molecule/draggable-list/test/fixtures.js +3 -0
- package/lib/molecule/draggable-list/test/fixtures.js.map +1 -1
- package/lib/molecule/draggable-list/test/on-drop.js +13 -13
- package/lib/molecule/draggable-list/test/on-drop.js.map +1 -1
- package/lib/molecule/questions/drop-down/index.js +1 -5
- package/lib/molecule/questions/drop-down/index.js.map +1 -1
- package/lib/molecule/questions/free-text/index.js +32 -14
- package/lib/molecule/questions/free-text/index.js.map +1 -1
- package/lib/molecule/questions/free-text/style.css +39 -15
- package/lib/molecule/questions/free-text/test/fixtures/default.js +1 -1
- package/lib/molecule/questions/free-text/test/fixtures/default.js.map +1 -1
- package/lib/molecule/questions/free-text/test/fixtures/with-value-on-change.js +14 -0
- package/lib/molecule/questions/free-text/test/fixtures/with-value-on-change.js.map +1 -0
- package/lib/molecule/questions/free-text/test/fixtures/{with-default-value.js → with-value.js} +2 -2
- package/lib/molecule/questions/free-text/test/fixtures/with-value.js.map +1 -0
- package/lib/molecule/questions/free-text/test/fixtures.js +5 -2
- package/lib/molecule/questions/free-text/test/fixtures.js.map +1 -1
- package/lib/molecule/questions/free-text/test/free-text.js +119 -0
- package/lib/molecule/questions/free-text/test/free-text.js.map +1 -0
- package/lib/molecule/questions/qcm/index.js +44 -23
- package/lib/molecule/questions/qcm/index.js.map +1 -1
- package/lib/molecule/questions/qcm/style.css +48 -14
- package/lib/molecule/questions/qcm/test/fixtures/default.js +8 -0
- package/lib/molecule/questions/qcm/test/fixtures/default.js.map +1 -1
- package/lib/molecule/questions/qcm/test/qcm.js +115 -0
- package/lib/molecule/questions/qcm/test/qcm.js.map +1 -0
- package/lib/molecule/questions/qcm-graphic/index.js +33 -15
- package/lib/molecule/questions/qcm-graphic/index.js.map +1 -1
- package/lib/molecule/questions/qcm-graphic/style.css +64 -13
- package/lib/molecule/questions/qcm-graphic/test/qcm-graphic.js +76 -0
- package/lib/molecule/questions/qcm-graphic/test/qcm-graphic.js.map +1 -0
- package/lib/molecule/questions/question-range/style.css +9 -8
- package/lib/molecule/questions/template/index.js +13 -10
- package/lib/molecule/questions/template/index.js.map +1 -1
- package/lib/molecule/setup-section/style.css +1 -0
- package/lib/molecule/wizard-summary/test/fixtures/organize-courses.js +111 -0
- package/lib/molecule/wizard-summary/test/fixtures/organize-courses.js.map +1 -0
- package/lib/molecule/wizard-summary/test/fixtures.js +3 -0
- package/lib/molecule/wizard-summary/test/fixtures.js.map +1 -1
- package/lib/organism/wizard-contents/index.js +7 -0
- package/lib/organism/wizard-contents/index.js.map +1 -1
- package/lib/organism/wizard-contents/test/fixtures/playlist-organize-courses.js +54 -0
- package/lib/organism/wizard-contents/test/fixtures/playlist-organize-courses.js.map +1 -0
- package/lib/organism/wizard-contents/test/fixtures.js +3 -0
- package/lib/organism/wizard-contents/test/fixtures.js.map +1 -1
- package/lib/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js +32 -0
- package/lib/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js.map +1 -0
- package/lib/template/back-office/brand-update/test/fixtures.js +3 -0
- package/lib/template/back-office/brand-update/test/fixtures.js.map +1 -1
- package/lib/util/get-shadow-box-color-from-primary.js +12 -0
- package/lib/util/get-shadow-box-color-from-primary.js.map +1 -0
- package/lib/util/test/get-shadow-box-color-from-primary.js +40 -0
- package/lib/util/test/get-shadow-box-color-from-primary.js.map +1 -0
- package/lib/variables/colors.css +3 -0
- package/package.json +2 -2
- package/es/molecule/questions/free-text/test/fixtures/with-default-value.js.map +0 -1
- package/es/molecule/search/test/fixtures.js +0 -15
- package/es/molecule/search/test/fixtures.js.map +0 -1
- package/lib/molecule/questions/free-text/test/fixtures/with-default-value.js.map +0 -1
- package/lib/molecule/search/test/fixtures.js +0 -25
- package/lib/molecule/search/test/fixtures.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/questions/free-text/index.js"],"names":["FreeText","props","
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/questions/free-text/index.js"],"names":["FreeText","props","context","placeholder","value","onChange","ariaLabel","hovered","setHovered","handleChange","e","target","primarySkinColor","handleMouseOver","handleMouseLeave","shadowBoxPrimaryColor","style","wrapper","boxShadow","freeText","color","contextTypes","skin","Provider","childContextTypes","propTypes","PropTypes","string","func"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,QAAQ,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;AACnC,QAAM;AAACC,IAAAA,WAAW,GAAG,EAAf;AAAmBC,IAAAA,KAAK,GAAG,EAA3B;AAA+BC,IAAAA,QAAQ,iBAAvC;AAAgD,kBAAcC;AAA9D,MAA2EL,KAAjF;AACA,QAAM,CAACM,OAAD,EAAUC,UAAV,IAAwB,qBAAS,KAAT,CAA9B;AAEA,QAAMC,YAAY,GAAG,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J;AATP,IAXF,CADF;AAiCD,CAhDD;;AAkDAZ,QAAQ,CAACqB,YAAT,GAAwB;AACtBC,EAAAA,IAAI,EAAEC,kBAASC,iBAAT,CAA2BF;AADX,CAAxB;AAIAtB,QAAQ,CAACyB,SAAT,2CAAqB;AACnBtB,EAAAA,WAAW,EAAEuB,mBAAUC,MADJ;AAEnBvB,EAAAA,KAAK,EAAEsB,mBAAUC,MAFE;AAGnBtB,EAAAA,QAAQ,EAAEqB,mBAAUE,IAHD;AAInB,gBAAcF,mBAAUC;AAJL,CAArB;eAOe3B,Q","sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport {noop, getOr} from 'lodash/fp';\nimport {convert} from 'css-color-function';\nimport Provider from '../../../atom/provider';\nimport style from './style.css';\n\nconst FreeText = (props, context) => {\n const {placeholder = '', value = '', onChange = noop, 'aria-label': ariaLabel} = props;\n const [hovered, setHovered] = useState(false);\n\n const handleChange = useCallback(e => onChange(e.target.value), [onChange]);\n const primarySkinColor = getOr('#00B0FF', 'skin.common.primary', context);\n\n const handleMouseOver = useCallback(() => setHovered(true), [setHovered]);\n\n const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);\n\n const shadowBoxPrimaryColor = useMemo(() => convert(`color(${primarySkinColor} a(12%))`), [\n primarySkinColor\n ]);\n\n return (\n <div\n data-name=\"freeText\"\n className={style.wrapper}\n onMouseOver={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n style={{\n ...(value && {\n boxShadow: hovered ? 'none' : `0 4px 16px ${shadowBoxPrimaryColor}`\n })\n }}\n >\n <input\n data-name=\"free-text-input\"\n type=\"text\"\n aria-label={ariaLabel || value || placeholder}\n className={style.freeText}\n placeholder={placeholder}\n value={value}\n onInput={handleChange}\n onChange={noop}\n style={{\n boxShadow: `0 4px 16px ${shadowBoxPrimaryColor}`,\n ...(value && {\n boxShadow: `0 4px 16px ${\n hovered ? convert(`color(${primarySkinColor} a(20%))`) : shadowBoxPrimaryColor\n }`\n }),\n color: primarySkinColor\n }}\n />\n </div>\n );\n};\n\nFreeText.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nFreeText.propTypes = {\n placeholder: PropTypes.string,\n value: PropTypes.string,\n onChange: PropTypes.func,\n 'aria-label': PropTypes.string\n};\n\nexport default FreeText;\n"],"file":"index.js"}
|
|
@@ -1,41 +1,65 @@
|
|
|
1
1
|
@value breakpoints: "../../../variables/breakpoints.css";
|
|
2
2
|
@value mobile from breakpoints;
|
|
3
3
|
@value colors: "../../../variables/colors.css";
|
|
4
|
-
@value
|
|
5
|
-
@value
|
|
4
|
+
@value box_shadow_light_dark from colors;
|
|
5
|
+
@value cm_blue_900 from colors;
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
.freeText {
|
|
9
|
+
border: unset;
|
|
10
|
+
border-width: 0;
|
|
8
11
|
font-family: "Gilroy";
|
|
9
12
|
font-weight: 700;
|
|
10
13
|
text-transform: none;
|
|
11
|
-
padding: 0 15px;
|
|
12
|
-
border: solid 1px;
|
|
13
|
-
border-color: color(black lightness(85%));
|
|
14
14
|
height: 50px;
|
|
15
|
-
border-radius:
|
|
15
|
+
border-radius: 8px;
|
|
16
16
|
font-size: 14px;
|
|
17
|
-
width:
|
|
17
|
+
max-width: calc(100% - 24px);
|
|
18
|
+
width: 100%;
|
|
18
19
|
outline: none;
|
|
20
|
+
padding-left: 12px;
|
|
21
|
+
padding-right: 12px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.freeText::placeholder {
|
|
25
|
+
color: color(cm_blue_900 a(0.3));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.freeText:-ms-input-placeholder {
|
|
29
|
+
color: color(cm_blue_900 a(0.3))!important;
|
|
19
30
|
}
|
|
20
31
|
|
|
21
|
-
.
|
|
22
|
-
|
|
32
|
+
.freeText:focus {
|
|
33
|
+
outline: none;
|
|
23
34
|
}
|
|
24
35
|
|
|
25
|
-
.
|
|
36
|
+
.freeText:hover {
|
|
26
37
|
outline: none;
|
|
27
38
|
}
|
|
28
39
|
|
|
40
|
+
.wrapper {
|
|
41
|
+
border-radius: 8px;
|
|
42
|
+
box-shadow: 0px 4px 16px box_shadow_light_dark;
|
|
43
|
+
margin: 0 15px;
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
width: 230px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.wrapper:hover {
|
|
49
|
+
box-shadow: none;
|
|
50
|
+
overflow: visible;
|
|
51
|
+
}
|
|
52
|
+
|
|
29
53
|
@media mobile {
|
|
30
54
|
.wrapper {
|
|
31
|
-
width:
|
|
55
|
+
max-width: calc(100% - 30px);
|
|
56
|
+
width: auto;
|
|
32
57
|
box-sizing: border-box;
|
|
33
|
-
max-width: 100%;
|
|
34
58
|
}
|
|
35
59
|
|
|
36
|
-
.
|
|
60
|
+
.freeText {
|
|
61
|
+
min-width: fit-content;
|
|
37
62
|
width: 100%;
|
|
38
|
-
margin: 0;
|
|
39
63
|
box-sizing: border-box;
|
|
40
64
|
}
|
|
41
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/molecule/questions/free-text/test/fixtures/default.js"],"names":["props","placeholder","
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/molecule/questions/free-text/test/fixtures/default.js"],"names":["props","placeholder","value","undefined"],"mappings":";;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,WAAW,EAAE,uBADR;AAELC,IAAAA,KAAK,EAAEC;AAFF;AADM,C","sourcesContent":["export default {\n props: {\n placeholder: 'Type your answer here',\n value: undefined\n }\n};\n"],"file":"default.js"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
var _default = {
|
|
6
|
+
props: {
|
|
7
|
+
placeholder: 'Type your answer here',
|
|
8
|
+
value: 'plop!',
|
|
9
|
+
onChange: () => {},
|
|
10
|
+
'aria-label': 'aria input'
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
exports.default = _default;
|
|
14
|
+
//# sourceMappingURL=with-value-on-change.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/molecule/questions/free-text/test/fixtures/with-value-on-change.js"],"names":["props","placeholder","value","onChange"],"mappings":";;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,WAAW,EAAE,uBADR;AAELC,IAAAA,KAAK,EAAE,OAFF;AAGLC,IAAAA,QAAQ,EAAE,MAAM,CAAE,CAHb;AAIL,kBAAc;AAJT;AADM,C","sourcesContent":["export default {\n props: {\n placeholder: 'Type your answer here',\n value: 'plop!',\n onChange: () => {},\n 'aria-label': 'aria input'\n }\n};\n"],"file":"with-value-on-change.js"}
|
package/lib/molecule/questions/free-text/test/fixtures/{with-default-value.js → with-value.js}
RENAMED
|
@@ -5,8 +5,8 @@ exports.default = void 0;
|
|
|
5
5
|
var _default = {
|
|
6
6
|
props: {
|
|
7
7
|
placeholder: 'Type your answer here',
|
|
8
|
-
|
|
8
|
+
value: 'plop!'
|
|
9
9
|
}
|
|
10
10
|
};
|
|
11
11
|
exports.default = _default;
|
|
12
|
-
//# sourceMappingURL=with-
|
|
12
|
+
//# sourceMappingURL=with-value.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/molecule/questions/free-text/test/fixtures/with-value.js"],"names":["props","placeholder","value"],"mappings":";;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,WAAW,EAAE,uBADR;AAELC,IAAAA,KAAK,EAAE;AAFF;AADM,C","sourcesContent":["export default {\n props: {\n placeholder: 'Type your answer here',\n value: 'plop!'\n }\n};\n"],"file":"with-value.js"}
|
|
@@ -10,7 +10,9 @@ var _ = _interopRequireDefault(require(".."));
|
|
|
10
10
|
|
|
11
11
|
var _default = _interopRequireDefault(require("./fixtures/default"));
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _withValueOnChange = _interopRequireDefault(require("./fixtures/with-value-on-change"));
|
|
14
|
+
|
|
15
|
+
var _withValue = _interopRequireDefault(require("./fixtures/with-value"));
|
|
14
16
|
|
|
15
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
18
|
|
|
@@ -21,5 +23,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
21
23
|
});
|
|
22
24
|
});
|
|
23
25
|
(0, _ava.default)('MoleculeQuestions › MoleculeQuestionsFreeText › Default › should be rendered', _renderComponent.default, _.default, _default.default);
|
|
24
|
-
(0, _ava.default)('MoleculeQuestions › MoleculeQuestionsFreeText ›
|
|
26
|
+
(0, _ava.default)('MoleculeQuestions › MoleculeQuestionsFreeText › WithValueOnChange › should be rendered', _renderComponent.default, _.default, _withValueOnChange.default);
|
|
27
|
+
(0, _ava.default)('MoleculeQuestions › MoleculeQuestionsFreeText › WithValue › should be rendered', _renderComponent.default, _.default, _withValue.default);
|
|
25
28
|
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/molecule/questions/free-text/test/fixtures.js"],"names":["t","pass","MoleculeQuestionsFreeText","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDefault","
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/questions/free-text/test/fixtures.js"],"names":["t","pass","MoleculeQuestionsFreeText","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDefault","fixtureWithValueOnChange","fixtureWithValue"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,6EAAL,EAAoFA,CAAC,IAAI;AACvFA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAA0BC,SAAlC,EAA6C,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAC3DL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,uEAAsEF,GAAI,mEAAnG;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,8EAAL,EAAqFG,wBAArF,EAA2GN,SAA3G,EAAsIO,gBAAtI;AACA,kBAAK,wFAAL,EAA+FD,wBAA/F,EAAqHN,SAArH,EAAgJQ,0BAAhJ;AACA,kBAAK,gFAAL,EAAuFF,wBAAvF,EAA6GN,SAA7G,EAAwIS,kBAAxI","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../../test/helpers/render-component';\nimport MoleculeQuestionsFreeText from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureWithValueOnChange from './fixtures/with-value-on-change';\nimport fixtureWithValue from './fixtures/with-value';\n\ntest('MoleculeQuestions › MoleculeQuestionsFreeText > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeQuestionsFreeText.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"MoleculeQuestions.MoleculeQuestionsFreeText.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('MoleculeQuestions › MoleculeQuestionsFreeText › Default › should be rendered', renderComponentMacro, MoleculeQuestionsFreeText, fixtureDefault);\ntest('MoleculeQuestions › MoleculeQuestionsFreeText › WithValueOnChange › should be rendered', renderComponentMacro, MoleculeQuestionsFreeText, fixtureWithValueOnChange);\ntest('MoleculeQuestions › MoleculeQuestionsFreeText › WithValue › should be rendered', renderComponentMacro, MoleculeQuestionsFreeText, fixtureWithValue);\n"],"file":"fixtures.js"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _identity2 = _interopRequireDefault(require("lodash/fp/identity"));
|
|
4
|
+
|
|
5
|
+
var _browserEnv = _interopRequireDefault(require("browser-env"));
|
|
6
|
+
|
|
7
|
+
var _ava = _interopRequireDefault(require("ava"));
|
|
8
|
+
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
|
|
11
|
+
var _enzyme = require("enzyme");
|
|
12
|
+
|
|
13
|
+
var _enzymeAdapterReact = _interopRequireDefault(require("enzyme-adapter-react-16"));
|
|
14
|
+
|
|
15
|
+
var _ = _interopRequireDefault(require(".."));
|
|
16
|
+
|
|
17
|
+
var _default = _interopRequireDefault(require("./fixtures/default"));
|
|
18
|
+
|
|
19
|
+
var _withValue = _interopRequireDefault(require("./fixtures/with-value"));
|
|
20
|
+
|
|
21
|
+
var _withValueOnChange = _interopRequireDefault(require("./fixtures/with-value-on-change"));
|
|
22
|
+
|
|
23
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
|
+
|
|
25
|
+
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); }
|
|
26
|
+
|
|
27
|
+
(0, _browserEnv.default)();
|
|
28
|
+
(0, _enzyme.configure)({
|
|
29
|
+
adapter: new _enzymeAdapterReact.default()
|
|
30
|
+
});
|
|
31
|
+
const translate = _identity2.default;
|
|
32
|
+
(0, _ava.default)('onInput should be reachable and replace onChange, onChange should not trigger value changes, should use aria-label', t => {
|
|
33
|
+
t.plan(7);
|
|
34
|
+
let onInputWasTriggered = false;
|
|
35
|
+
|
|
36
|
+
const props = _extends(_extends({}, _withValueOnChange.default.props), {}, {
|
|
37
|
+
onChange: value => {
|
|
38
|
+
onInputWasTriggered = true;
|
|
39
|
+
t.is(value, 'new value');
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_.default, props), {
|
|
44
|
+
context: {
|
|
45
|
+
translate
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
let freeText = wrapper.find('[data-name="free-text-input"]');
|
|
49
|
+
t.true(freeText.at(0).exists());
|
|
50
|
+
t.is(freeText.at(0).props()['aria-label'], 'aria input');
|
|
51
|
+
t.is(freeText.at(0).props().value, 'plop!'); // should not trigger a value change with onChange
|
|
52
|
+
|
|
53
|
+
freeText.at(0).simulate('change', {
|
|
54
|
+
target: {
|
|
55
|
+
value: 'new value'
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
wrapper.update(); // should not update the trigger flag with onChange
|
|
59
|
+
|
|
60
|
+
t.false(onInputWasTriggered);
|
|
61
|
+
freeText.at(0).simulate('input', {
|
|
62
|
+
target: {
|
|
63
|
+
value: 'new value'
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
wrapper.update();
|
|
67
|
+
freeText = wrapper.find('[data-name="free-text-input"]');
|
|
68
|
+
t.true(onInputWasTriggered);
|
|
69
|
+
t.pass();
|
|
70
|
+
});
|
|
71
|
+
(0, _ava.default)('should set: boxShadow (hover & not hovered variants) && color for the input if a value is provided', t => {
|
|
72
|
+
const wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react.default.createElement(_.default, _withValue.default.props));
|
|
73
|
+
let freeTextWrapper = wrapper.find('[data-name="freeText"]');
|
|
74
|
+
t.true(freeTextWrapper.at(0).exists());
|
|
75
|
+
t.deepEqual(freeTextWrapper.at(0).props().style, {
|
|
76
|
+
boxShadow: '0 4px 16px rgba(0, 176, 255, 0.12)'
|
|
77
|
+
});
|
|
78
|
+
let freeText = wrapper.find('[data-name="free-text-input"]');
|
|
79
|
+
t.true(freeText.at(0).exists());
|
|
80
|
+
t.is(freeText.at(0).props().value, 'plop!');
|
|
81
|
+
t.deepEqual(freeTextWrapper.at(0).props().style, {
|
|
82
|
+
boxShadow: '0 4px 16px rgba(0, 176, 255, 0.12)'
|
|
83
|
+
});
|
|
84
|
+
freeTextWrapper.simulate('mouseover');
|
|
85
|
+
wrapper.update();
|
|
86
|
+
freeText = wrapper.find('[data-name="free-text-input"]');
|
|
87
|
+
freeTextWrapper = wrapper.find('[data-name="freeText"]'); // hovered
|
|
88
|
+
|
|
89
|
+
t.deepEqual(freeText.at(0).props().style, {
|
|
90
|
+
boxShadow: '0 4px 16px rgba(0, 176, 255, 0.2)',
|
|
91
|
+
color: '#00B0FF'
|
|
92
|
+
});
|
|
93
|
+
t.deepEqual(freeTextWrapper.at(0).props().style, {
|
|
94
|
+
boxShadow: 'none'
|
|
95
|
+
});
|
|
96
|
+
freeTextWrapper.simulate('mouseleave');
|
|
97
|
+
wrapper.update();
|
|
98
|
+
freeText = wrapper.find('[data-name="free-text-input"]');
|
|
99
|
+
t.deepEqual(freeText.at(0).props().style, {
|
|
100
|
+
boxShadow: '0 4px 16px rgba(0, 176, 255, 0.12)',
|
|
101
|
+
color: '#00B0FF'
|
|
102
|
+
});
|
|
103
|
+
t.pass();
|
|
104
|
+
});
|
|
105
|
+
(0, _ava.default)('should use value as default aria-label if no aria-label is provided', t => {
|
|
106
|
+
const wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react.default.createElement(_.default, _withValue.default.props));
|
|
107
|
+
const freeText = wrapper.find('[data-name="free-text-input"]');
|
|
108
|
+
t.true(freeText.at(0).exists());
|
|
109
|
+
t.is(freeText.at(0).props()['aria-label'], 'plop!');
|
|
110
|
+
t.pass();
|
|
111
|
+
});
|
|
112
|
+
(0, _ava.default)('should use placeholder as default aria-label if no aria-label is provided and no value is present', t => {
|
|
113
|
+
const wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react.default.createElement(_.default, _default.default.props));
|
|
114
|
+
const freeText = wrapper.find('[data-name="free-text-input"]');
|
|
115
|
+
t.true(freeText.at(0).exists());
|
|
116
|
+
t.is(freeText.at(0).props()['aria-label'], 'Type your answer here');
|
|
117
|
+
t.pass();
|
|
118
|
+
});
|
|
119
|
+
//# sourceMappingURL=free-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/questions/free-text/test/free-text.js"],"names":["adapter","Adapter","translate","t","plan","onInputWasTriggered","props","withValueOnChangeFixture","onChange","value","is","wrapper","context","freeText","find","true","at","exists","simulate","target","update","false","pass","withValueFixture","freeTextWrapper","deepEqual","style","boxShadow","color","defaultFixture"],"mappings":";;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA;AACA,uBAAU;AAACA,EAAAA,OAAO,EAAE,IAAIC,2BAAJ;AAAV,CAAV;AACA,MAAMC,SAAS,qBAAf;AAEA,kBAAK,oHAAL,EAA2HC,CAAC,IAAI;AAC9HA,EAAAA,CAAC,CAACC,IAAF,CAAO,CAAP;AACA,MAAIC,mBAAmB,GAAG,KAA1B;;AACA,QAAMC,KAAK,yBACNC,2BAAyBD,KADnB;AAETE,IAAAA,QAAQ,EAAEC,KAAK,IAAI;AACjBJ,MAAAA,mBAAmB,GAAG,IAAtB;AACAF,MAAAA,CAAC,CAACO,EAAF,CAAKD,KAAL,EAAY,WAAZ;AACD;AALQ,IAAX;;AAOA,QAAME,OAAO,GAAG,mCAAQ,6BAAC,SAAD,EAAcL,KAAd,CAAR,EAAiC;AAC/CM,IAAAA,OAAO,EAAE;AAACV,MAAAA;AAAD;AADsC,GAAjC,CAAhB;AAGA,MAAIW,QAAQ,GAAGF,OAAO,CAACG,IAAR,CAAa,+BAAb,CAAf;AACAX,EAAAA,CAAC,CAACY,IAAF,CAAOF,QAAQ,CAACG,EAAT,CAAY,CAAZ,EAAeC,MAAf,EAAP;AACAd,EAAAA,CAAC,CAACO,EAAF,CAAKG,QAAQ,CAACG,EAAT,CAAY,CAAZ,EAAeV,KAAf,GAAuB,YAAvB,CAAL,EAA2C,YAA3C;AACAH,EAAAA,CAAC,CAACO,EAAF,CAAKG,QAAQ,CAACG,EAAT,CAAY,CAAZ,EAAeV,KAAf,GAAuBG,KAA5B,EAAmC,OAAnC,EAhB8H,CAiB9H;;AACAI,EAAAA,QAAQ,CAACG,EAAT,CAAY,CAAZ,EAAeE,QAAf,CAAwB,QAAx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QAAMO,QAAQ,GAAGF,OAAO,CAACG,IAAR,CAAa,+BAAb,CAAjB;AACAX,EAAAA,CAAC,CAACY,IAAF,CAAOF,QAAQ,CAACG,EAAT,CAAY,CAAZ,EAAeC,MAAf,EAAP;AACAd,EAAAA,CAAC,CAACO,EAAF,CAAKG,QAAQ,CAACG,EAAT,CAAY,CAAZ,EAAeV,KAAf,GAAuB,YAAvB,CAAL,EAA2C,OAA3C;AACAH,EAAAA,CAAC,CAACmB,IAAF;AACD,CAND;AAQA,kBAAK,mGAAL,EAA0GnB,CAAC,IAAI;AAC7G,QAAMQ,OAAO,GAAG,iCAAM,6BAAC,SAAD,EAAckB,iBAAevB,KAA7B,CAAN,CAAhB;AACA,QAAMO,QAAQ,GAAGF,OAAO,CAACG,IAAR,CAAa,+BAAb,CAAjB;AACAX,EAAAA,CAAC,CAACY,IAAF,CAAOF,QAAQ,CAACG,EAAT,CAAY,CAAZ,EAAeC,MAAf,EAAP;AACAd,EAAAA,CAAC,CAACO,EAAF,CAAKG,QAAQ,CAACG,EAAT,CAAY,CAAZ,EAAeV,KAAf,GAAuB,YAAvB,CAAL,EAA2C,uBAA3C;AACAH,EAAAA,CAAC,CAACmB,IAAF;AACD,CAND","sourcesContent":["import browserEnv from 'browser-env';\nimport test from 'ava';\nimport React from 'react';\nimport {shallow, mount, configure} from 'enzyme';\nimport {identity} from 'lodash/fp';\nimport Adapter from 'enzyme-adapter-react-16';\nimport FreeText from '..';\nimport defaultFixture from './fixtures/default';\nimport withValueFixture from './fixtures/with-value';\nimport withValueOnChangeFixture from './fixtures/with-value-on-change';\n\nbrowserEnv();\nconfigure({adapter: new Adapter()});\nconst translate = identity;\n\ntest('onInput should be reachable and replace onChange, onChange should not trigger value changes, should use aria-label', t => {\n t.plan(7);\n let onInputWasTriggered = false;\n const props = {\n ...withValueOnChangeFixture.props,\n onChange: value => {\n onInputWasTriggered = true;\n t.is(value, 'new value');\n }\n };\n const wrapper = shallow(<FreeText {...props} />, {\n context: {translate}\n });\n let freeText = wrapper.find('[data-name=\"free-text-input\"]');\n t.true(freeText.at(0).exists());\n t.is(freeText.at(0).props()['aria-label'], 'aria input');\n t.is(freeText.at(0).props().value, 'plop!');\n // should not trigger a value change with onChange\n freeText.at(0).simulate('change', {target: {value: 'new value'}});\n wrapper.update();\n // should not update the trigger flag with onChange\n t.false(onInputWasTriggered);\n freeText.at(0).simulate('input', {target: {value: 'new value'}});\n wrapper.update();\n freeText = wrapper.find('[data-name=\"free-text-input\"]');\n t.true(onInputWasTriggered);\n t.pass();\n});\n\ntest('should set: boxShadow (hover & not hovered variants) && color for the input if a value is provided', t => {\n const wrapper = mount(<FreeText {...withValueFixture.props} />);\n let freeTextWrapper = wrapper.find('[data-name=\"freeText\"]');\n t.true(freeTextWrapper.at(0).exists());\n t.deepEqual(freeTextWrapper.at(0).props().style, {\n boxShadow: '0 4px 16px rgba(0, 176, 255, 0.12)'\n });\n\n let freeText = wrapper.find('[data-name=\"free-text-input\"]');\n t.true(freeText.at(0).exists());\n t.is(freeText.at(0).props().value, 'plop!');\n t.deepEqual(freeTextWrapper.at(0).props().style, {\n boxShadow: '0 4px 16px rgba(0, 176, 255, 0.12)'\n });\n freeTextWrapper.simulate('mouseover');\n wrapper.update();\n\n freeText = wrapper.find('[data-name=\"free-text-input\"]');\n freeTextWrapper = wrapper.find('[data-name=\"freeText\"]');\n // hovered\n t.deepEqual(freeText.at(0).props().style, {\n boxShadow: '0 4px 16px rgba(0, 176, 255, 0.2)',\n color: '#00B0FF'\n });\n t.deepEqual(freeTextWrapper.at(0).props().style, {\n boxShadow: 'none'\n });\n\n freeTextWrapper.simulate('mouseleave');\n wrapper.update();\n freeText = wrapper.find('[data-name=\"free-text-input\"]');\n t.deepEqual(freeText.at(0).props().style, {\n boxShadow: '0 4px 16px rgba(0, 176, 255, 0.12)',\n color: '#00B0FF'\n });\n\n t.pass();\n});\n\ntest('should use value as default aria-label if no aria-label is provided', t => {\n const wrapper = mount(<FreeText {...withValueFixture.props} />);\n const freeText = wrapper.find('[data-name=\"free-text-input\"]');\n t.true(freeText.at(0).exists());\n t.is(freeText.at(0).props()['aria-label'], 'plop!');\n t.pass();\n});\n\ntest('should use placeholder as default aria-label if no aria-label is provided and no value is present', t => {\n const wrapper = mount(<FreeText {...defaultFixture.props} />);\n const freeText = wrapper.find('[data-name=\"free-text-input\"]');\n t.true(freeText.at(0).exists());\n t.is(freeText.at(0).props()['aria-label'], 'Type your answer here');\n t.pass();\n});\n"],"file":"free-text.js"}
|
|
@@ -3,59 +3,79 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.default = void 0;
|
|
5
5
|
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
var _getOr2 = _interopRequireDefault(require("lodash/fp/getOr"));
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
6
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
7
|
|
|
12
8
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
9
|
|
|
14
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
11
|
|
|
12
|
+
var _getOr = _interopRequireDefault(require("lodash/fp/getOr"));
|
|
13
|
+
|
|
14
|
+
var _maxBy = _interopRequireDefault(require("lodash/fp/maxBy"));
|
|
15
|
+
|
|
16
16
|
var _provider = _interopRequireDefault(require("../../../atom/provider"));
|
|
17
17
|
|
|
18
18
|
var _style = require("../../../atom/label/style.css");
|
|
19
19
|
|
|
20
|
+
var _getShadowBoxColorFromPrimary = require("../../../util/get-shadow-box-color-from-primary");
|
|
21
|
+
|
|
20
22
|
var _style2 = _interopRequireDefault(require("./style.css"));
|
|
21
23
|
|
|
22
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
25
|
|
|
26
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
30
|
+
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); }
|
|
31
|
+
|
|
24
32
|
const QCM = (props, context) => {
|
|
25
33
|
const {
|
|
26
34
|
answers
|
|
27
35
|
} = props;
|
|
28
|
-
const longestAnswer = (0,
|
|
36
|
+
const longestAnswer = (0, _maxBy.default)(({
|
|
29
37
|
title
|
|
30
38
|
}) => title.length, answers);
|
|
31
|
-
const
|
|
39
|
+
const {
|
|
40
|
+
skin
|
|
41
|
+
} = context;
|
|
42
|
+
const primarySkinColor = (0, _getOr.default)('#00B0FF', 'common.primary', skin);
|
|
43
|
+
const answersViews = (0, _react.useMemo)(() => answers.map((answer, key) => {
|
|
32
44
|
const {
|
|
33
45
|
onClick,
|
|
34
46
|
title,
|
|
35
|
-
selected
|
|
47
|
+
selected,
|
|
48
|
+
'aria-label': ariaLabel
|
|
36
49
|
} = answer;
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
} = context;
|
|
40
|
-
const primarySkinColor = (0, _getOr2.default)('#00B0FF', 'common.primary', skin);
|
|
41
|
-
const selectedStyle = selected ? {
|
|
42
|
-
backgroundColor: primarySkinColor,
|
|
43
|
-
borderColor: primarySkinColor
|
|
44
|
-
} : null;
|
|
45
|
-
const className = (0, _classnames.default)(longestAnswer === answer ? _style2.default.longestAnswer : _style2.default.answer, selected ? _style2.default.selectedAnswer : _style2.default.unselectedAnswer);
|
|
50
|
+
const longAnswerClass = longestAnswer.title === title ? _style2.default.longestAnswer : _style2.default.answer;
|
|
51
|
+
const selectedAnswerClass = selected ? _style2.default.selectedAnswer : _style2.default.unselectedAnswer;
|
|
46
52
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
47
53
|
"data-name": "answer",
|
|
48
|
-
|
|
54
|
+
"aria-label": ariaLabel || title,
|
|
55
|
+
className: (0, _classnames.default)(longAnswerClass, _style.innerHTML, selectedAnswerClass),
|
|
49
56
|
onClick: onClick,
|
|
50
|
-
style:
|
|
57
|
+
style: _extends({}, selected && {
|
|
58
|
+
boxShadow: `0 4px 16px ${(0, _getShadowBoxColorFromPrimary.getShadowBoxColorFromPrimary)(primarySkinColor)}`
|
|
59
|
+
}),
|
|
51
60
|
"data-selected": selected,
|
|
52
|
-
key: key
|
|
61
|
+
key: key
|
|
62
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
63
|
+
"data-name": "answer-background",
|
|
64
|
+
style: {
|
|
65
|
+
backgroundColor: selected ? primarySkinColor : '#F4F4F5'
|
|
66
|
+
/* cm_grey_75 */
|
|
67
|
+
|
|
68
|
+
},
|
|
69
|
+
className: _style2.default.background
|
|
70
|
+
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
71
|
+
"data-name": "answer-label",
|
|
72
|
+
className: _style2.default.answerText // eslint-disable-next-line react/no-danger
|
|
53
73
|
,
|
|
54
74
|
dangerouslySetInnerHTML: {
|
|
55
75
|
__html: title
|
|
56
76
|
}
|
|
57
|
-
});
|
|
58
|
-
});
|
|
77
|
+
}));
|
|
78
|
+
}), [answers, longestAnswer, primarySkinColor]);
|
|
59
79
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
60
80
|
"data-name": "qcm",
|
|
61
81
|
className: _style2.default.wrapper
|
|
@@ -69,7 +89,8 @@ QCM.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
69
89
|
answers: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
70
90
|
title: _propTypes.default.string,
|
|
71
91
|
selected: _propTypes.default.bool,
|
|
72
|
-
onClick: _propTypes.default.func
|
|
92
|
+
onClick: _propTypes.default.func,
|
|
93
|
+
'aria-label': _propTypes.default.string
|
|
73
94
|
}))
|
|
74
95
|
} : {};
|
|
75
96
|
var _default = QCM;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/questions/qcm/index.js"],"names":["QCM","props","context","answers","longestAnswer","title","length","answersViews","map","answer","key","onClick","selected","
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/questions/qcm/index.js"],"names":["QCM","props","context","answers","longestAnswer","title","length","skin","primarySkinColor","answersViews","map","answer","key","onClick","selected","ariaLabel","longAnswerClass","style","selectedAnswerClass","selectedAnswer","unselectedAnswer","innerHTML","boxShadow","backgroundColor","background","answerText","__html","wrapper","contextTypes","Provider","childContextTypes","propTypes","PropTypes","arrayOf","shape","string","bool","func"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,GAAG,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;AAC9B,QAAM;AAACC,IAAAA;AAAD,MAAYF,KAAlB;AACA,QAAMG,aAAa,GAAG,oBAAM,CAAC;AAACC,IAAAA;AAAD,GAAD,KAAaA,KAAK,CAACC,MAAzB,EAAiCH,OAAjC,CAAtB;AACA,QAAM;AAACI,IAAAA;AAAD,MAASL,OAAf;AACA,QAAMM,gBAAgB,GAAG,oBAAM,SAAN,EAAiB,gBAAjB,EAAmCD,IAAnC,CAAzB;AAEA,QAAME,YAAY,GAAG,oBACnB,MACEN,OAAO,CAACO,GAAR,CAAY,CAACC,MAAD,EAASC,GAAT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EAAEsB,kBAASC,iBAAT,CAA2BvB;AADhB,CAAnB;AAIAP,GAAG,CAAC+B,SAAJ,2CAAgB;AACd5B,EAAAA,OAAO,EAAE6B,mBAAUC,OAAV,CACPD,mBAAUE,KAAV,CAAgB;AACd7B,IAAAA,KAAK,EAAE2B,mBAAUG,MADH;AAEdrB,IAAAA,QAAQ,EAAEkB,mBAAUI,IAFN;AAGdvB,IAAAA,OAAO,EAAEmB,mBAAUK,IAHL;AAId,kBAAcL,mBAAUG;AAJV,GAAhB,CADO;AADK,CAAhB;eAWenC,G","sourcesContent":["import React, {useMemo} from 'react';\nimport classnames from 'classnames';\nimport PropTypes from 'prop-types';\nimport getOr from 'lodash/fp/getOr';\nimport maxBy from 'lodash/fp/maxBy';\nimport Provider from '../../../atom/provider';\nimport {innerHTML} from '../../../atom/label/style.css';\nimport {getShadowBoxColorFromPrimary} from '../../../util/get-shadow-box-color-from-primary';\nimport style from './style.css';\n\nconst QCM = (props, context) => {\n const {answers} = props;\n const longestAnswer = maxBy(({title}) => title.length, answers);\n const {skin} = context;\n const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);\n\n const answersViews = useMemo(\n () =>\n answers.map((answer, key) => {\n const {onClick, title, selected, 'aria-label': ariaLabel} = answer;\n const longAnswerClass = longestAnswer.title === title ? style.longestAnswer : style.answer;\n const selectedAnswerClass = selected ? style.selectedAnswer : style.unselectedAnswer;\n\n return (\n <div\n data-name=\"answer\"\n aria-label={ariaLabel || title}\n className={classnames(longAnswerClass, innerHTML, selectedAnswerClass)}\n onClick={onClick}\n style={{\n ...(selected && {\n boxShadow: `0 4px 16px ${getShadowBoxColorFromPrimary(primarySkinColor)}`\n })\n }}\n data-selected={selected}\n key={key}\n >\n <div\n data-name=\"answer-background\"\n style={{backgroundColor: selected ? primarySkinColor : '#F4F4F5' /* cm_grey_75 */}}\n className={style.background}\n />\n <span\n data-name=\"answer-label\"\n className={style.answerText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n </div>\n );\n }),\n [answers, longestAnswer, primarySkinColor]\n );\n\n return (\n <div data-name=\"qcm\" className={style.wrapper}>\n {answersViews}\n </div>\n );\n};\n\nQCM.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nQCM.propTypes = {\n answers: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string,\n selected: PropTypes.bool,\n onClick: PropTypes.func,\n 'aria-label': PropTypes.string\n })\n )\n};\n\nexport default QCM;\n"],"file":"index.js"}
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
@value colors: "../../../variables/colors.css";
|
|
4
4
|
@value white from colors;
|
|
5
5
|
@value black from colors;
|
|
6
|
-
@value
|
|
6
|
+
@value box_shadow_light_dark from colors;
|
|
7
|
+
@value cm_blue_900 from colors;
|
|
7
8
|
|
|
8
9
|
.wrapper {
|
|
9
10
|
text-align: center;
|
|
@@ -18,14 +19,15 @@
|
|
|
18
19
|
font-size: 15px;
|
|
19
20
|
font-weight: 600;
|
|
20
21
|
background-color: white;
|
|
21
|
-
border:
|
|
22
|
-
border-radius: 3px;
|
|
22
|
+
border-radius: 8px;
|
|
23
23
|
box-sizing: border-box;
|
|
24
24
|
margin-bottom: 8px;
|
|
25
25
|
cursor: pointer;
|
|
26
26
|
padding: 11px 24px;
|
|
27
27
|
line-height: 24px;
|
|
28
28
|
white-space: normal;
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
transition: all 0.25s linear;
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
.longestAnswer {
|
|
@@ -33,20 +35,56 @@
|
|
|
33
35
|
width: auto;
|
|
34
36
|
}
|
|
35
37
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
|
|
39
|
+
.background {
|
|
40
|
+
position: absolute;
|
|
41
|
+
width: 100%;
|
|
42
|
+
height: 100%;
|
|
43
|
+
top: 0;
|
|
44
|
+
left: 0;
|
|
45
|
+
transition: opacity 0.25s linear, background-color 0.25s linear;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.answerText {
|
|
49
|
+
position: relative;
|
|
50
|
+
color: cm_blue_900;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.selectedAnswer .answerText {
|
|
54
|
+
color: white;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.selectedAnswer:hover .background{
|
|
58
|
+
opacity: 0.8;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.selectedAnswer.answer:hover {
|
|
62
|
+
background-color: black;
|
|
38
63
|
}
|
|
39
64
|
|
|
40
|
-
.
|
|
41
|
-
|
|
65
|
+
.selectedAnswer .background{
|
|
66
|
+
opacity: 1;
|
|
42
67
|
}
|
|
43
68
|
|
|
69
|
+
.selectedAnswer,
|
|
44
70
|
.unselectedAnswer {
|
|
45
|
-
|
|
71
|
+
position: relative;
|
|
46
72
|
}
|
|
47
73
|
|
|
48
|
-
.
|
|
49
|
-
|
|
74
|
+
.unselectedAnswer {
|
|
75
|
+
box-shadow: 0px 4px 16px box_shadow_light_dark;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.unselectedAnswer .background {
|
|
79
|
+
opacity: 0;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.unselectedAnswer:hover .background{
|
|
83
|
+
opacity: 1;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.answer:last-child {
|
|
87
|
+
margin-bottom: 0;
|
|
50
88
|
}
|
|
51
89
|
|
|
52
90
|
@media mobile {
|
|
@@ -59,10 +97,6 @@
|
|
|
59
97
|
width: 100%;
|
|
60
98
|
}
|
|
61
99
|
|
|
62
|
-
.answer:hover {
|
|
63
|
-
background-color: white;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
100
|
.answer {
|
|
67
101
|
padding: 8px 24px;
|
|
68
102
|
}
|
|
@@ -6,34 +6,42 @@ var _default = {
|
|
|
6
6
|
props: {
|
|
7
7
|
answers: [{
|
|
8
8
|
title: 'There is no need for a password for this, you only need your ID to connect',
|
|
9
|
+
'aria-label': 'aria Answer',
|
|
9
10
|
onClick: () => {},
|
|
10
11
|
selected: false
|
|
11
12
|
}, {
|
|
12
13
|
title: 'Lorem ipsum',
|
|
14
|
+
'aria-label': 'aria Answer',
|
|
13
15
|
onClick: () => {},
|
|
14
16
|
selected: false
|
|
15
17
|
}, {
|
|
16
18
|
title: 'Lorem',
|
|
19
|
+
'aria-label': 'aria Answer',
|
|
17
20
|
onClick: () => {},
|
|
18
21
|
selected: true
|
|
19
22
|
}, {
|
|
20
23
|
title: 'You need to have a password',
|
|
24
|
+
'aria-label': 'aria Answer',
|
|
21
25
|
onClick: () => {},
|
|
22
26
|
selected: false
|
|
23
27
|
}, {
|
|
24
28
|
title: 'Pouet',
|
|
29
|
+
'aria-label': 'aria Answer',
|
|
25
30
|
onClick: () => {},
|
|
26
31
|
selected: true
|
|
27
32
|
}, {
|
|
28
33
|
title: 'Alios autem dicere aiunt multo etiam inhumanius (quem locum breviter paulo ante perstrinxi) praesidii adiumentique causa, non benevolentiae neque caritatis, amicitias esse expetendas; itaque, ut quisque minimum firmitatis haberet minimumque virium',
|
|
34
|
+
'aria-label': 'aria Answer',
|
|
29
35
|
onClick: () => {},
|
|
30
36
|
selected: false
|
|
31
37
|
}, {
|
|
32
38
|
title: 'Lorem ipsum dolor',
|
|
39
|
+
'aria-label': 'aria Answer',
|
|
33
40
|
onClick: () => {},
|
|
34
41
|
selected: false
|
|
35
42
|
}, {
|
|
36
43
|
title: 'all your base are belong to us',
|
|
44
|
+
'aria-label': 'aria Answer',
|
|
37
45
|
onClick: () => {},
|
|
38
46
|
selected: false
|
|
39
47
|
}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/molecule/questions/qcm/test/fixtures/default.js"],"names":["props","answers","title","onClick","selected"],"mappings":";;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,OAAO,EAAE,CACP;AACEC,MAAAA,KAAK,EAAE,4EADT;
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/molecule/questions/qcm/test/fixtures/default.js"],"names":["props","answers","title","onClick","selected"],"mappings":";;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,OAAO,EAAE,CACP;AACEC,MAAAA,KAAK,EAAE,4EADT;AAEE,oBAAc,aAFhB;AAGEC,MAAAA,OAAO,EAAE,MAAM,CAAE,CAHnB;AAIEC,MAAAA,QAAQ,EAAE;AAJZ,KADO,EAOP;AACEF,MAAAA,KAAK,EAAE,aADT;AAEE,oBAAc,aAFhB;AAGEC,MAAAA,OAAO,EAAE,MAAM,CAAE,CAHnB;AAIEC,MAAAA,QAAQ,EAAE;AAJZ,KAPO,EAaP;AACEF,MAAAA,KAAK,EAAE,OADT;AAEE,oBAAc,aAFhB;AAGEC,MAAAA,OAAO,EAAE,MAAM,CAAE,CAHnB;AAIEC,MAAAA,QAAQ,EAAE;AAJZ,KAbO,EAmBP;AACEF,MAAAA,KAAK,EAAE,6BADT;AAEE,oBAAc,aAFhB;AAGEC,MAAAA,OAAO,EAAE,MAAM,CAAE,CAHnB;AAIEC,MAAAA,QAAQ,EAAE;AAJZ,KAnBO,EAyBP;AACEF,MAAAA,KAAK,EAAE,OADT;AAEE,oBAAc,aAFhB;AAGEC,MAAAA,OAAO,EAAE,MAAM,CAAE,CAHnB;AAIEC,MAAAA,QAAQ,EAAE;AAJZ,KAzBO,EA+BP;AACEF,MAAAA,KAAK,EACH,yPAFJ;AAGE,oBAAc,aAHhB;AAIEC,MAAAA,OAAO,EAAE,MAAM,CAAE,CAJnB;AAKEC,MAAAA,QAAQ,EAAE;AALZ,KA/BO,EAsCP;AACEF,MAAAA,KAAK,EAAE,mBADT;AAEE,oBAAc,aAFhB;AAGEC,MAAAA,OAAO,EAAE,MAAM,CAAE,CAHnB;AAIEC,MAAAA,QAAQ,EAAE;AAJZ,KAtCO,EA4CP;AACEF,MAAAA,KAAK,EAAE,gCADT;AAEE,oBAAc,aAFhB;AAGEC,MAAAA,OAAO,EAAE,MAAM,CAAE,CAHnB;AAIEC,MAAAA,QAAQ,EAAE;AAJZ,KA5CO;AADJ;AADM,C","sourcesContent":["export default {\n props: {\n answers: [\n {\n title: 'There is no need for a password for this, you only need your ID to connect',\n 'aria-label': 'aria Answer',\n onClick: () => {},\n selected: false\n },\n {\n title: 'Lorem ipsum',\n 'aria-label': 'aria Answer',\n onClick: () => {},\n selected: false\n },\n {\n title: 'Lorem',\n 'aria-label': 'aria Answer',\n onClick: () => {},\n selected: true\n },\n {\n title: 'You need to have a password',\n 'aria-label': 'aria Answer',\n onClick: () => {},\n selected: false\n },\n {\n title: 'Pouet',\n 'aria-label': 'aria Answer',\n onClick: () => {},\n selected: true\n },\n {\n title:\n 'Alios autem dicere aiunt multo etiam inhumanius (quem locum breviter paulo ante perstrinxi) praesidii adiumentique causa, non benevolentiae neque caritatis, amicitias esse expetendas; itaque, ut quisque minimum firmitatis haberet minimumque virium',\n 'aria-label': 'aria Answer',\n onClick: () => {},\n selected: false\n },\n {\n title: 'Lorem ipsum dolor',\n 'aria-label': 'aria Answer',\n onClick: () => {},\n selected: false\n },\n {\n title: 'all your base are belong to us',\n 'aria-label': 'aria Answer',\n onClick: () => {},\n selected: false\n }\n ]\n }\n};\n"],"file":"default.js"}
|