@coorpacademy/components 10.5.6 → 10.5.7-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/molecule/questions/qcm/index.js +40 -25
- package/es/molecule/questions/qcm/index.js.map +1 -1
- package/es/molecule/questions/qcm/style.css +39 -15
- 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 +105 -0
- package/es/molecule/questions/qcm/test/qcm.js.map +1 -0
- package/es/molecule/questions/qcm-graphic/index.js +38 -17
- package/es/molecule/questions/qcm-graphic/index.js.map +1 -1
- package/es/molecule/questions/qcm-graphic/style.css +60 -15
- 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/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/molecule/questions/qcm/index.js +47 -23
- package/lib/molecule/questions/qcm/index.js.map +1 -1
- package/lib/molecule/questions/qcm/style.css +39 -15
- 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 +117 -0
- package/lib/molecule/questions/qcm/test/qcm.js.map +1 -0
- package/lib/molecule/questions/qcm-graphic/index.js +36 -15
- package/lib/molecule/questions/qcm-graphic/index.js.map +1 -1
- package/lib/molecule/questions/qcm-graphic/style.css +60 -15
- 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/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/search/test/fixtures.js +0 -15
- package/es/molecule/search/test/fixtures.js.map +0 -1
- package/lib/molecule/search/test/fixtures.js +0 -25
- package/lib/molecule/search/test/fixtures.js.map +0 -1
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
@value mobile from breakpoints;
|
|
3
3
|
@value colors: "../../../variables/colors.css";
|
|
4
4
|
@value white from colors;
|
|
5
|
-
@value
|
|
6
|
-
@value
|
|
7
|
-
@value
|
|
5
|
+
@value cm_grey_75 from colors;
|
|
6
|
+
@value cm_primary_blue from colors;
|
|
7
|
+
@value cm_blue_900 from colors;
|
|
8
8
|
|
|
9
9
|
.wrapper {
|
|
10
10
|
display: flex;
|
|
@@ -15,16 +15,33 @@
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
.answer {
|
|
18
|
-
|
|
18
|
+
position: relative;
|
|
19
|
+
color: cm_blue_900;
|
|
19
20
|
background-color: white;
|
|
20
|
-
border: 1px solid color(black lightness(85%));
|
|
21
|
-
border-radius: 3px;
|
|
22
21
|
box-sizing: border-box;
|
|
23
22
|
cursor: pointer;
|
|
24
23
|
padding: 8px;
|
|
25
24
|
width: 200px;
|
|
26
25
|
min-height: 245px;
|
|
27
26
|
margin: 0 4px 8px;
|
|
27
|
+
box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.12);
|
|
28
|
+
border-radius: 16px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.background {
|
|
32
|
+
top: 0;
|
|
33
|
+
left: 0;
|
|
34
|
+
position: absolute;
|
|
35
|
+
border-radius: 16px;
|
|
36
|
+
height: 100%;
|
|
37
|
+
width: 100%;
|
|
38
|
+
transition: opacity 0.25s linear, background-color 0.25s linear;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.content {
|
|
42
|
+
height: 100%;
|
|
43
|
+
width: 100%;
|
|
44
|
+
position: relative;
|
|
28
45
|
}
|
|
29
46
|
|
|
30
47
|
.imageWrapper {
|
|
@@ -33,12 +50,21 @@
|
|
|
33
50
|
align-items: center;
|
|
34
51
|
height: 110px;
|
|
35
52
|
margin-bottom: 16px;
|
|
36
|
-
background-size:
|
|
53
|
+
background-size: cover;
|
|
37
54
|
background-repeat: no-repeat;
|
|
38
55
|
background-position: center center;
|
|
56
|
+
border-radius: 12px;
|
|
39
57
|
}
|
|
40
58
|
|
|
41
59
|
.titleWrapper {
|
|
60
|
+
display: flex;
|
|
61
|
+
height: calc(100% - 126px);
|
|
62
|
+
width: 100%;
|
|
63
|
+
align-items: center;
|
|
64
|
+
justify-content: center;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.title {
|
|
42
68
|
font-family: 'Gilroy';
|
|
43
69
|
font-size: 17px;
|
|
44
70
|
line-height: 20px;
|
|
@@ -49,18 +75,36 @@
|
|
|
49
75
|
}
|
|
50
76
|
|
|
51
77
|
.answer:hover {
|
|
52
|
-
background
|
|
78
|
+
background: cm_grey_75;
|
|
79
|
+
box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.12);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.answer .background{
|
|
83
|
+
opacity: 0;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.answer:hover .background{
|
|
87
|
+
opacity: 1;
|
|
53
88
|
}
|
|
54
89
|
|
|
55
90
|
.selected {
|
|
56
91
|
composes: answer;
|
|
57
|
-
color:
|
|
92
|
+
color: cm_primary_blue;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.selected .background{
|
|
96
|
+
opacity: 0.05;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.selected:hover .background{
|
|
100
|
+
opacity: 0.1;
|
|
58
101
|
}
|
|
59
102
|
|
|
60
103
|
@media mobile {
|
|
61
104
|
.wrapper {
|
|
62
105
|
flex-direction: column;
|
|
63
|
-
|
|
106
|
+
display: flex;
|
|
107
|
+
align-items: center;
|
|
64
108
|
width: 100%;
|
|
65
109
|
padding-bottom: 0;
|
|
66
110
|
}
|
|
@@ -69,17 +113,18 @@
|
|
|
69
113
|
display: flex;
|
|
70
114
|
align-items: center;
|
|
71
115
|
flex-flow: row nowrap;
|
|
72
|
-
width: 100
|
|
116
|
+
width: calc(100% - 45px);
|
|
73
117
|
min-height: 82px;
|
|
74
118
|
height: inherit;
|
|
75
119
|
margin: 0 0 8px;
|
|
76
120
|
overflow: hidden;
|
|
77
121
|
}
|
|
78
122
|
|
|
79
|
-
.
|
|
80
|
-
|
|
123
|
+
.content {
|
|
124
|
+
display: flex;
|
|
125
|
+
align-items: center;
|
|
81
126
|
}
|
|
82
|
-
|
|
127
|
+
|
|
83
128
|
.answer:last-child {
|
|
84
129
|
margin-bottom: 0;
|
|
85
130
|
}
|
|
@@ -96,7 +141,7 @@
|
|
|
96
141
|
white-space: wrap;
|
|
97
142
|
overflow: hidden;
|
|
98
143
|
padding: 0;
|
|
99
|
-
|
|
144
|
+
justify-content: left;
|
|
100
145
|
font-size: 15px;
|
|
101
146
|
}
|
|
102
147
|
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import _identity from "lodash/fp/identity";
|
|
2
|
+
|
|
3
|
+
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); }
|
|
4
|
+
|
|
5
|
+
import browserEnv from 'browser-env';
|
|
6
|
+
import test from 'ava';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { shallow, configure } from 'enzyme';
|
|
9
|
+
import Adapter from 'enzyme-adapter-react-16';
|
|
10
|
+
import QCMImage from '..';
|
|
11
|
+
import defaultFixture from './fixtures/default';
|
|
12
|
+
browserEnv();
|
|
13
|
+
configure({
|
|
14
|
+
adapter: new Adapter()
|
|
15
|
+
});
|
|
16
|
+
const translate = _identity;
|
|
17
|
+
test('onClick should be reachable, should match given aria-label', t => {
|
|
18
|
+
let answerWasClicked = false;
|
|
19
|
+
defaultFixture.props.answers[1] = _extends(_extends({}, defaultFixture.props.answers[1]), {}, {
|
|
20
|
+
onClick: () => {
|
|
21
|
+
answerWasClicked = true;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
const wrapper = shallow( /*#__PURE__*/React.createElement(QCMImage, defaultFixture.props), {
|
|
25
|
+
context: {
|
|
26
|
+
translate
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
const answersImages = wrapper.find('[data-name="answerImage"]');
|
|
30
|
+
t.true(answersImages.at(1).exists());
|
|
31
|
+
t.is(answersImages.at(1).props()['aria-label'], 'Lorem ipsum');
|
|
32
|
+
const answers = wrapper.find('[data-name="answerGraphic"]');
|
|
33
|
+
answers.at(1).simulate('click');
|
|
34
|
+
t.true(answerWasClicked);
|
|
35
|
+
t.pass();
|
|
36
|
+
});
|
|
37
|
+
test("should set: selected's background to Primary w/ alpha 5% && color to primary, unselected's no background && color to a nuance of primary", t => {
|
|
38
|
+
const wrapper = shallow( /*#__PURE__*/React.createElement(QCMImage, defaultFixture.props), {
|
|
39
|
+
context: {
|
|
40
|
+
translate
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
const answers = wrapper.find('[data-name="answerGraphic"]');
|
|
44
|
+
const firstAnswer = answers.at(0);
|
|
45
|
+
t.true(firstAnswer.exists());
|
|
46
|
+
t.deepEqual(firstAnswer.props().style, {});
|
|
47
|
+
const unselectedBackgroundAnswer = firstAnswer.children().at(0);
|
|
48
|
+
t.true(unselectedBackgroundAnswer.exists());
|
|
49
|
+
t.deepEqual(unselectedBackgroundAnswer.props().style, {
|
|
50
|
+
backgroundColor: '#F4F4F5'
|
|
51
|
+
});
|
|
52
|
+
const firstAnswerText = firstAnswer.children().at(1).children().at(1).children().at(0);
|
|
53
|
+
t.true(firstAnswerText.exists());
|
|
54
|
+
const thirdAnswer = answers.at(2);
|
|
55
|
+
t.true(thirdAnswer.exists());
|
|
56
|
+
t.deepEqual(thirdAnswer.props().style, {
|
|
57
|
+
boxShadow: '0 4px 16px rgba(0, 122, 179, 0.25)'
|
|
58
|
+
});
|
|
59
|
+
const selectedBackgroundAnswer = thirdAnswer.children().at(0);
|
|
60
|
+
t.true(selectedBackgroundAnswer.exists());
|
|
61
|
+
t.deepEqual(selectedBackgroundAnswer.props().style, {
|
|
62
|
+
backgroundColor: '#00B0FF'
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
//# sourceMappingURL=qcm-graphic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/questions/qcm-graphic/test/qcm-graphic.js"],"names":["browserEnv","test","React","shallow","configure","Adapter","QCMImage","defaultFixture","adapter","translate","t","answerWasClicked","props","answers","onClick","wrapper","context","answersImages","find","true","at","exists","is","simulate","pass","firstAnswer","deepEqual","style","unselectedBackgroundAnswer","children","backgroundColor","firstAnswerText","thirdAnswer","boxShadow","selectedBackgroundAnswer"],"mappings":"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","sourcesContent":["import browserEnv from 'browser-env';\nimport test from 'ava';\nimport React from 'react';\nimport {shallow, configure} from 'enzyme';\nimport {identity} from 'lodash/fp';\nimport Adapter from 'enzyme-adapter-react-16';\nimport QCMImage from '..';\nimport defaultFixture from './fixtures/default';\n\nbrowserEnv();\nconfigure({adapter: new Adapter()});\nconst translate = identity;\n\ntest('onClick should be reachable, should match given aria-label', t => {\n let answerWasClicked = false;\n defaultFixture.props.answers[1] = {\n ...defaultFixture.props.answers[1],\n onClick: () => {\n answerWasClicked = true;\n }\n };\n\n const wrapper = shallow(<QCMImage {...defaultFixture.props} />, {\n context: {translate}\n });\n\n const answersImages = wrapper.find('[data-name=\"answerImage\"]');\n t.true(answersImages.at(1).exists());\n t.is(answersImages.at(1).props()['aria-label'], 'Lorem ipsum');\n\n const answers = wrapper.find('[data-name=\"answerGraphic\"]');\n answers.at(1).simulate('click');\n t.true(answerWasClicked);\n t.pass();\n});\n\ntest(\"should set: selected's background to Primary w/ alpha 5% && color to primary, unselected's no background && color to a nuance of primary\", t => {\n const wrapper = shallow(<QCMImage {...defaultFixture.props} />, {\n context: {translate}\n });\n const answers = wrapper.find('[data-name=\"answerGraphic\"]');\n\n const firstAnswer = answers.at(0);\n t.true(firstAnswer.exists());\n t.deepEqual(firstAnswer.props().style, {});\n const unselectedBackgroundAnswer = firstAnswer.children().at(0);\n t.true(unselectedBackgroundAnswer.exists());\n t.deepEqual(unselectedBackgroundAnswer.props().style, {backgroundColor: '#F4F4F5'});\n const firstAnswerText = firstAnswer.children().at(1).children().at(1).children().at(0);\n t.true(firstAnswerText.exists());\n\n const thirdAnswer = answers.at(2);\n t.true(thirdAnswer.exists());\n t.deepEqual(thirdAnswer.props().style, {boxShadow: '0 4px 16px rgba(0, 122, 179, 0.25)'});\n const selectedBackgroundAnswer = thirdAnswer.children().at(0);\n t.true(selectedBackgroundAnswer.exists());\n t.deepEqual(selectedBackgroundAnswer.props().style, {backgroundColor: '#00B0FF'});\n});\n"],"file":"qcm-graphic.js"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { convert } from 'css-color-function'; // darken the color down to 35% && apply alpha of 25%
|
|
2
|
+
|
|
3
|
+
export const getShadowBoxColorFromPrimary = primaryColor => convert(`color(${primaryColor} lightness(35%) a(25%))`);
|
|
4
|
+
//# sourceMappingURL=get-shadow-box-color-from-primary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/util/get-shadow-box-color-from-primary.js"],"names":["convert","getShadowBoxColorFromPrimary","primaryColor"],"mappings":"AAAA,SAAQA,OAAR,QAAsB,oBAAtB,C,CAEA;;AACA,OAAO,MAAMC,4BAA4B,GAAGC,YAAY,IACtDF,OAAO,CAAE,SAAQE,YAAa,yBAAvB,CADF","sourcesContent":["import {convert} from 'css-color-function';\n\n// darken the color down to 35% && apply alpha of 25%\nexport const getShadowBoxColorFromPrimary = primaryColor =>\n convert(`color(${primaryColor} lightness(35%) a(25%))`);\n"],"file":"get-shadow-box-color-from-primary.js"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import forEach from 'lodash/fp/forEach';
|
|
3
|
+
import { getShadowBoxColorFromPrimary } from '../get-shadow-box-color-from-primary';
|
|
4
|
+
test('should return transformed colors', t => {
|
|
5
|
+
t.plan(13);
|
|
6
|
+
const expectedOrange = 'rgba(179, 42, 0, 0.25)';
|
|
7
|
+
const expectedRed = 'rgba(179, 0, 0, 0.25)';
|
|
8
|
+
const expectedYellow = 'rgba(179, 140, 0, 0.25)';
|
|
9
|
+
const expectedBlue = 'rgba(0, 68, 179, 0.25)'; // a set of possible primary/brand colors
|
|
10
|
+
|
|
11
|
+
const primaryColors = {
|
|
12
|
+
orange: ['#ff6f43', expectedOrange],
|
|
13
|
+
// original, expected
|
|
14
|
+
orangeRGB: ['rgb(255, 111, 67)', expectedOrange],
|
|
15
|
+
orangeRGBA: ['rgba(255, 111, 67, 0)', expectedOrange],
|
|
16
|
+
red: ['#FF0A0A', expectedRed],
|
|
17
|
+
redRGB: ['rgb(255, 10, 10)', expectedRed],
|
|
18
|
+
redRGBA: ['rgba(255, 10, 10, 0)', expectedRed],
|
|
19
|
+
yellow: ['#ffca0a', expectedYellow],
|
|
20
|
+
yellowRGB: ['rgb(255, 202, 10)', expectedYellow],
|
|
21
|
+
yellowRGBA: ['rgba(255, 202, 10, 0)', expectedYellow],
|
|
22
|
+
blue: ['#0061FF', expectedBlue],
|
|
23
|
+
blueRGB: ['rgb(0, 97, 255)', expectedBlue],
|
|
24
|
+
blueRGBA: ['rgba(0, 97, 255, 1)', expectedBlue]
|
|
25
|
+
};
|
|
26
|
+
forEach(color => {
|
|
27
|
+
const [original, expected] = color;
|
|
28
|
+
const boxShadowColor = getShadowBoxColorFromPrimary(original);
|
|
29
|
+
t.is(boxShadowColor, expected);
|
|
30
|
+
}, primaryColors);
|
|
31
|
+
t.pass();
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=get-shadow-box-color-from-primary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/util/test/get-shadow-box-color-from-primary.js"],"names":["test","forEach","getShadowBoxColorFromPrimary","t","plan","expectedOrange","expectedRed","expectedYellow","expectedBlue","primaryColors","orange","orangeRGB","orangeRGBA","red","redRGB","redRGBA","yellow","yellowRGB","yellowRGBA","blue","blueRGB","blueRGBA","color","original","expected","boxShadowColor","is","pass"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,mBAApB;AAEA,SAAQC,4BAAR,QAA2C,sCAA3C;AAEAF,IAAI,CAAC,kCAAD,EAAqCG,CAAC,IAAI;AAC5CA,EAAAA,CAAC,CAACC,IAAF,CAAO,EAAP;AACA,QAAMC,cAAc,GAAG,wBAAvB;AACA,QAAMC,WAAW,GAAG,uBAApB;AACA,QAAMC,cAAc,GAAG,yBAAvB;AACA,QAAMC,YAAY,GAAG,wBAArB,CAL4C,CAM5C;;AACA,QAAMC,aAAa,GAAG;AACpBC,IAAAA,MAAM,EAAE,CAAC,SAAD,EAAYL,cAAZ,CADY;AACiB;AACrCM,IAAAA,SAAS,EAAE,CAAC,mBAAD,EAAsBN,cAAtB,CAFS;AAGpBO,IAAAA,UAAU,EAAE,CAAC,uBAAD,EAA0BP,cAA1B,CAHQ;AAIpBQ,IAAAA,GAAG,EAAE,CAAC,SAAD,EAAYP,WAAZ,CAJe;AAKpBQ,IAAAA,MAAM,EAAE,CAAC,kBAAD,EAAqBR,WAArB,CALY;AAMpBS,IAAAA,OAAO,EAAE,CAAC,sBAAD,EAAyBT,WAAzB,CANW;AAOpBU,IAAAA,MAAM,EAAE,CAAC,SAAD,EAAYT,cAAZ,CAPY;AAQpBU,IAAAA,SAAS,EAAE,CAAC,mBAAD,EAAsBV,cAAtB,CARS;AASpBW,IAAAA,UAAU,EAAE,CAAC,uBAAD,EAA0BX,cAA1B,CATQ;AAUpBY,IAAAA,IAAI,EAAE,CAAC,SAAD,EAAYX,YAAZ,CAVc;AAWpBY,IAAAA,OAAO,EAAE,CAAC,iBAAD,EAAoBZ,YAApB,CAXW;AAYpBa,IAAAA,QAAQ,EAAE,CAAC,qBAAD,EAAwBb,YAAxB;AAZU,GAAtB;AAeAP,EAAAA,OAAO,CAACqB,KAAK,IAAI;AACf,UAAM,CAACC,QAAD,EAAWC,QAAX,IAAuBF,KAA7B;AACA,UAAMG,cAAc,GAAGvB,4BAA4B,CAACqB,QAAD,CAAnD;AACApB,IAAAA,CAAC,CAACuB,EAAF,CAAKD,cAAL,EAAqBD,QAArB;AACD,GAJM,EAIJf,aAJI,CAAP;AAMAN,EAAAA,CAAC,CAACwB,IAAF;AACD,CA7BG,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/fp/forEach';\n\nimport {getShadowBoxColorFromPrimary} from '../get-shadow-box-color-from-primary';\n\ntest('should return transformed colors', t => {\n t.plan(13);\n const expectedOrange = 'rgba(179, 42, 0, 0.25)';\n const expectedRed = 'rgba(179, 0, 0, 0.25)';\n const expectedYellow = 'rgba(179, 140, 0, 0.25)';\n const expectedBlue = 'rgba(0, 68, 179, 0.25)';\n // a set of possible primary/brand colors\n const primaryColors = {\n orange: ['#ff6f43', expectedOrange], // original, expected\n orangeRGB: ['rgb(255, 111, 67)', expectedOrange],\n orangeRGBA: ['rgba(255, 111, 67, 0)', expectedOrange],\n red: ['#FF0A0A', expectedRed],\n redRGB: ['rgb(255, 10, 10)', expectedRed],\n redRGBA: ['rgba(255, 10, 10, 0)', expectedRed],\n yellow: ['#ffca0a', expectedYellow],\n yellowRGB: ['rgb(255, 202, 10)', expectedYellow],\n yellowRGBA: ['rgba(255, 202, 10, 0)', expectedYellow],\n blue: ['#0061FF', expectedBlue],\n blueRGB: ['rgb(0, 97, 255)', expectedBlue],\n blueRGBA: ['rgba(0, 97, 255, 1)', expectedBlue]\n };\n\n forEach(color => {\n const [original, expected] = color;\n const boxShadowColor = getShadowBoxColorFromPrimary(original);\n t.is(boxShadowColor, expected);\n }, primaryColors);\n\n t.pass();\n});\n"],"file":"get-shadow-box-color-from-primary.js"}
|
package/es/variables/colors.css
CHANGED
|
@@ -30,8 +30,10 @@
|
|
|
30
30
|
@value cm_blue_50: #f1f6fe;
|
|
31
31
|
@value cm_blue_200: #74A5F6;
|
|
32
32
|
@value cm_blue_600: #0051d6;
|
|
33
|
+
@value cm_blue_900: #06265B;
|
|
33
34
|
@value cm_bleu_article: #365FCD;
|
|
34
35
|
@value cm_grey_50: #FAFAFA;
|
|
36
|
+
@value cm_grey_75: #F4F4F5;
|
|
35
37
|
@value cm_grey_100: #EAEAEB;
|
|
36
38
|
@value cm_grey_150: #E1E1E3;
|
|
37
39
|
@value cm_grey_200: #d7d7da;
|
|
@@ -59,3 +61,4 @@
|
|
|
59
61
|
@value cm_red_video: #E8335E;
|
|
60
62
|
@value cm_violet_podcast: #432ba7;
|
|
61
63
|
@value cm_warning_50: rgba(255, 192, 67, 0.13);
|
|
64
|
+
@value box_shadow_light_dark: rgba(0, 0, 0, 0.12);
|
|
@@ -3,59 +3,82 @@
|
|
|
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,
|
|
73
|
+
style: _extends({}, selected && {
|
|
74
|
+
color: primarySkinColor
|
|
75
|
+
}) // eslint-disable-next-line react/no-danger
|
|
53
76
|
,
|
|
54
77
|
dangerouslySetInnerHTML: {
|
|
55
78
|
__html: title
|
|
56
79
|
}
|
|
57
|
-
});
|
|
58
|
-
});
|
|
80
|
+
}));
|
|
81
|
+
}), [answers, longestAnswer, primarySkinColor]);
|
|
59
82
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
60
83
|
"data-name": "qcm",
|
|
61
84
|
className: _style2.default.wrapper
|
|
@@ -69,7 +92,8 @@ QCM.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
69
92
|
answers: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
70
93
|
title: _propTypes.default.string,
|
|
71
94
|
selected: _propTypes.default.bool,
|
|
72
|
-
onClick: _propTypes.default.func
|
|
95
|
+
onClick: _propTypes.default.func,
|
|
96
|
+
'aria-label': _propTypes.default.string
|
|
73
97
|
}))
|
|
74
98
|
} : {};
|
|
75
99
|
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","color","__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,KAAiB;AAC3B,UAAM;AAACC,MAAAA,OAAD;AAAUR,MAAAA,KAAV;AAAiBS,MAAAA,QAAjB;AAA2B,oBAAcC;AAAzC,QAAsDJ,MAA5D;AACA,UAAMK,eAAe,GAAGZ,aAAa,CAACC,KAAd,KAAwBA,KAAxB,GAAgCY,gBAAMb,aAAtC,GAAsDa,gBAAMN,MAApF;AACA,UAAMO,mBAAmB,GAAGJ,QAAQ,GAAGG,gBAAME,cAAT,GAA0BF,gBAAMG,gBAApE;AAEA,wBACE;AACE,mBAAU,QADZ;AAEE,oBAAYL,SAAS,IAAIV,KAF3B;AAGE,MAAA,SAAS,EAAE,yBAAWW,eAAX,EAA4BK,gBAA5B,EAAuCH,mBAAvC,CAHb;AAIE,MAAA,OAAO,EAAEL,OAJX;AAKE,MAAA,KAAK,eACCC,QAAQ,IAAI;AACdQ,QAAAA,SAAS,EAAG,cAAa,gEAA6Bd,gBAA7B,CAA+C;AAD1D,OADb,CALP;AAUE,uBAAeM,QAVjB;AAWE,MAAA,GAAG,EAAEF;AAXP,oBAaE;AACE,mBAAU,mBADZ;AAEE,MAAA,KAAK,EAAE;AAACW,QAAAA,eAAe,EAAET,QAAQ,GAAGN,gBAAH,GAAsB;AAAU;;AAA1D,OAFT;AAGE,MAAA,SAAS,EAAES,gBAAMO;AAHnB,MAbF,eAkBE;AACE,mBAAU,cADZ;AAEE,MAAA,SAAS,EAAEP,gBAAMQ,UAFnB;AAGE,MAAA,KAAK,eACCX,QAAQ,IAAI;AAACY,QAAAA,KAAK,EAAElB;AAAR,OADb,CAHP,CAME;AANF;AAOE,MAAA,uBAAuB,EAAE;AAACmB,QAAAA,MAAM,EAAEtB;AAAT;AAP3B,MAlBF,CADF;AA8BD,GAnCD,CAFiB,EAsCnB,CAACF,OAAD,EAAUC,aAAV,EAAyBI,gBAAzB,CAtCmB,CAArB;AAyCA,sBACE;AAAK,iBAAU,KAAf;AAAqB,IAAA,SAAS,EAAES,gBAAMW;AAAtC,KACGnB,YADH,CADF;AAKD,CApDD;;AAsDAT,GAAG,CAAC6B,YAAJ,GAAmB;AACjBtB,EAAAA,IAAI,EAAEuB,kBAASC,iBAAT,CAA2BxB;AADhB,CAAnB;AAIAP,GAAG,CAACgC,SAAJ,2CAAgB;AACd7B,EAAAA,OAAO,EAAE8B,mBAAUC,OAAV,CACPD,mBAAUE,KAAV,CAAgB;AACd9B,IAAAA,KAAK,EAAE4B,mBAAUG,MADH;AAEdtB,IAAAA,QAAQ,EAAEmB,mBAAUI,IAFN;AAGdxB,IAAAA,OAAO,EAAEoB,mBAAUK,IAHL;AAId,kBAAcL,mBAAUG;AAJV,GAAhB,CADO;AADK,CAAhB;eAWepC,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 style={{\n ...(selected && {color: primarySkinColor})\n }}\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"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
@value mobile from breakpoints;
|
|
3
3
|
@value colors: "../../../variables/colors.css";
|
|
4
4
|
@value white from colors;
|
|
5
|
-
@value
|
|
6
|
-
@value
|
|
5
|
+
@value box_shadow_light_dark from colors;
|
|
6
|
+
@value cm_blue_900 from colors;
|
|
7
7
|
|
|
8
8
|
.wrapper {
|
|
9
9
|
text-align: center;
|
|
@@ -18,14 +18,15 @@
|
|
|
18
18
|
font-size: 15px;
|
|
19
19
|
font-weight: 600;
|
|
20
20
|
background-color: white;
|
|
21
|
-
border:
|
|
22
|
-
border-radius: 3px;
|
|
21
|
+
border-radius: 8px;
|
|
23
22
|
box-sizing: border-box;
|
|
24
23
|
margin-bottom: 8px;
|
|
25
24
|
cursor: pointer;
|
|
26
25
|
padding: 11px 24px;
|
|
27
26
|
line-height: 24px;
|
|
28
27
|
white-space: normal;
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
transition: all 0.25s linear;
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
.longestAnswer {
|
|
@@ -33,20 +34,47 @@
|
|
|
33
34
|
width: auto;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
|
|
38
|
+
.background {
|
|
39
|
+
position: absolute;
|
|
40
|
+
width: 100%;
|
|
41
|
+
height: 100%;
|
|
42
|
+
top: 0;
|
|
43
|
+
left: 0;
|
|
44
|
+
transition: opacity 0.25s linear, background-color 0.25s linear;
|
|
38
45
|
}
|
|
39
46
|
|
|
40
|
-
.
|
|
41
|
-
|
|
47
|
+
.answerText {
|
|
48
|
+
position: relative;
|
|
49
|
+
color: cm_blue_900;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.selectedAnswer:hover .background{
|
|
53
|
+
opacity: 0.1;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.selectedAnswer .background{
|
|
57
|
+
opacity: 0.05;
|
|
58
|
+
}
|
|
59
|
+
.selectedAnswer,
|
|
60
|
+
.unselectedAnswer {
|
|
61
|
+
position: relative;
|
|
42
62
|
}
|
|
43
63
|
|
|
44
64
|
.unselectedAnswer {
|
|
45
|
-
|
|
65
|
+
box-shadow: 0px 4px 16px box_shadow_light_dark;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.unselectedAnswer .background {
|
|
69
|
+
opacity: 0;
|
|
46
70
|
}
|
|
47
71
|
|
|
48
|
-
.
|
|
49
|
-
|
|
72
|
+
.unselectedAnswer:hover .background{
|
|
73
|
+
opacity: 1;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.answer:last-child {
|
|
77
|
+
margin-bottom: 0;
|
|
50
78
|
}
|
|
51
79
|
|
|
52
80
|
@media mobile {
|
|
@@ -59,10 +87,6 @@
|
|
|
59
87
|
width: 100%;
|
|
60
88
|
}
|
|
61
89
|
|
|
62
|
-
.answer:hover {
|
|
63
|
-
background-color: white;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
90
|
.answer {
|
|
67
91
|
padding: 8px 24px;
|
|
68
92
|
}
|
|
@@ -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"}
|