@coorpacademy/components 10.13.3 → 10.13.6
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/button-link-icon-only/index.js +19 -4
- package/es/atom/button-link-icon-only/index.js.map +1 -1
- package/es/atom/button-link-icon-only/style.css +29 -0
- package/es/atom/button-link-icon-only/test/button-link-icon-only.js +15 -0
- package/es/atom/button-link-icon-only/test/button-link-icon-only.js.map +1 -1
- package/es/atom/button-link-icon-only/test/fixtures/review-header.js +10 -0
- package/es/atom/button-link-icon-only/test/fixtures/review-header.js.map +1 -0
- package/es/atom/button-link-icon-only/test/fixtures.js +2 -0
- package/es/atom/button-link-icon-only/test/fixtures.js.map +1 -1
- package/es/atom/checkbox-with-title/test/fixtures.js +15 -0
- package/es/atom/checkbox-with-title/test/fixtures.js.map +1 -0
- package/es/atom/input-text/style.css +1 -1
- package/es/atom/input-text-with-title/index.js +4 -2
- package/es/atom/input-text-with-title/index.js.map +1 -1
- package/es/atom/input-text-with-title/style.css +6 -2
- package/es/atom/input-text-with-title/test/fixtures/error.js +3 -1
- package/es/atom/input-text-with-title/test/fixtures/error.js.map +1 -1
- package/es/atom/input-text-with-title/test/fixtures.js +15 -0
- package/es/atom/input-text-with-title/test/fixtures.js.map +1 -0
- package/es/atom/review-header-step-item/index.js +3 -3
- package/es/atom/review-header-step-item/index.js.map +1 -1
- package/es/atom/review-header-step-item/style.css +4 -3
- package/es/atom/review-header-step-item/test/fixtures.js +19 -0
- package/es/atom/review-header-step-item/test/fixtures.js.map +1 -0
- package/es/molecule/course-sections/style.css +1 -1
- package/es/molecule/course-sections/test/fixtures.js +2 -0
- package/es/molecule/course-sections/test/fixtures.js.map +1 -1
- package/es/molecule/dashboard/review-banner/test/fixtures.js +13 -0
- package/es/molecule/dashboard/review-banner/test/fixtures.js.map +1 -0
- package/es/molecule/drag-and-drop-wrapper/index.js +39 -0
- package/es/molecule/drag-and-drop-wrapper/index.js.map +1 -0
- package/es/molecule/drag-and-drop-wrapper/style.css +15 -0
- package/es/molecule/drag-and-drop-wrapper/test/fixtures/default.js +9 -0
- package/es/molecule/drag-and-drop-wrapper/test/fixtures/default.js.map +1 -0
- package/es/molecule/drag-and-drop-wrapper/test/fixtures/two-drag-and-drops.js +10 -0
- package/es/molecule/drag-and-drop-wrapper/test/fixtures/two-drag-and-drops.js.map +1 -0
- package/es/molecule/input-text-with-titeled-checkbox/test/fixtures.js +15 -0
- package/es/molecule/input-text-with-titeled-checkbox/test/fixtures.js.map +1 -0
- package/es/molecule/review-correction-popin/test/fixtures.js +15 -0
- package/es/molecule/review-correction-popin/test/fixtures.js.map +1 -0
- package/es/molecule/review-header-steps/test/fixtures.js +23 -0
- package/es/molecule/review-header-steps/test/fixtures.js.map +1 -0
- package/es/organism/review-header/index.js +68 -0
- package/es/organism/review-header/index.js.map +1 -0
- package/es/organism/review-header/style.css +138 -0
- package/es/organism/review-header/test/fixtures/all-questions-ok.js +16 -0
- package/es/organism/review-header/test/fixtures/all-questions-ok.js.map +1 -0
- package/es/organism/review-header/test/fixtures/current-question-no-answered.js +12 -0
- package/es/organism/review-header/test/fixtures/current-question-no-answered.js.map +1 -0
- package/es/organism/review-header/test/fixtures/current-question-wrong.js +10 -0
- package/es/organism/review-header/test/fixtures/current-question-wrong.js.map +1 -0
- package/es/organism/review-header/test/fixtures/first-question-current-right.js +10 -0
- package/es/organism/review-header/test/fixtures/first-question-current-right.js.map +1 -0
- package/es/organism/review-header/test/fixtures/no-answered-question.js +10 -0
- package/es/organism/review-header/test/fixtures/no-answered-question.js.map +1 -0
- package/es/organism/review-header/test/fixtures/question-to-repeat.js +10 -0
- package/es/organism/review-header/test/fixtures/question-to-repeat.js.map +1 -0
- package/es/organism/review-header/test/fixtures.js +23 -0
- package/es/organism/review-header/test/fixtures.js.map +1 -0
- package/es/organism/review-header/test/review-header.js +40 -0
- package/es/organism/review-header/test/review-header.js.map +1 -0
- package/lib/atom/button-link-icon-only/index.js +19 -4
- package/lib/atom/button-link-icon-only/index.js.map +1 -1
- package/lib/atom/button-link-icon-only/style.css +29 -0
- package/lib/atom/button-link-icon-only/test/button-link-icon-only.js +14 -0
- package/lib/atom/button-link-icon-only/test/button-link-icon-only.js.map +1 -1
- package/lib/atom/button-link-icon-only/test/fixtures/review-header.js +15 -0
- package/lib/atom/button-link-icon-only/test/fixtures/review-header.js.map +1 -0
- package/lib/atom/button-link-icon-only/test/fixtures.js +3 -0
- package/lib/atom/button-link-icon-only/test/fixtures.js.map +1 -1
- package/lib/atom/checkbox-with-title/test/fixtures.js +25 -0
- package/lib/atom/checkbox-with-title/test/fixtures.js.map +1 -0
- package/lib/atom/input-text/style.css +1 -1
- package/lib/atom/input-text-with-title/index.js +4 -2
- package/lib/atom/input-text-with-title/index.js.map +1 -1
- package/lib/atom/input-text-with-title/style.css +6 -2
- package/lib/atom/input-text-with-title/test/fixtures/error.js +3 -1
- package/lib/atom/input-text-with-title/test/fixtures/error.js.map +1 -1
- package/lib/atom/input-text-with-title/test/fixtures.js +25 -0
- package/lib/atom/input-text-with-title/test/fixtures.js.map +1 -0
- package/lib/atom/review-header-step-item/index.js +3 -3
- package/lib/atom/review-header-step-item/index.js.map +1 -1
- package/lib/atom/review-header-step-item/style.css +4 -3
- package/lib/atom/review-header-step-item/test/fixtures.js +31 -0
- package/lib/atom/review-header-step-item/test/fixtures.js.map +1 -0
- package/lib/molecule/course-sections/style.css +1 -1
- package/lib/molecule/course-sections/test/fixtures.js +3 -0
- package/lib/molecule/course-sections/test/fixtures.js.map +1 -1
- package/lib/molecule/dashboard/review-banner/test/fixtures.js +22 -0
- package/lib/molecule/dashboard/review-banner/test/fixtures.js.map +1 -0
- package/lib/molecule/drag-and-drop-wrapper/index.js +49 -0
- package/lib/molecule/drag-and-drop-wrapper/index.js.map +1 -0
- package/lib/molecule/drag-and-drop-wrapper/style.css +15 -0
- package/lib/molecule/drag-and-drop-wrapper/test/fixtures/default.js +19 -0
- package/lib/molecule/drag-and-drop-wrapper/test/fixtures/default.js.map +1 -0
- package/lib/molecule/drag-and-drop-wrapper/test/fixtures/two-drag-and-drops.js +21 -0
- package/lib/molecule/drag-and-drop-wrapper/test/fixtures/two-drag-and-drops.js.map +1 -0
- package/lib/molecule/input-text-with-titeled-checkbox/test/fixtures.js +25 -0
- package/lib/molecule/input-text-with-titeled-checkbox/test/fixtures.js.map +1 -0
- package/lib/molecule/review-correction-popin/test/fixtures.js +25 -0
- package/lib/molecule/review-correction-popin/test/fixtures.js.map +1 -0
- package/lib/molecule/review-header-steps/test/fixtures.js +37 -0
- package/lib/molecule/review-header-steps/test/fixtures.js.map +1 -0
- package/lib/organism/review-header/index.js +81 -0
- package/lib/organism/review-header/index.js.map +1 -0
- package/lib/organism/review-header/style.css +138 -0
- package/lib/organism/review-header/test/fixtures/all-questions-ok.js +26 -0
- package/lib/organism/review-header/test/fixtures/all-questions-ok.js.map +1 -0
- package/lib/organism/review-header/test/fixtures/current-question-no-answered.js +22 -0
- package/lib/organism/review-header/test/fixtures/current-question-no-answered.js.map +1 -0
- package/lib/organism/review-header/test/fixtures/current-question-wrong.js +20 -0
- package/lib/organism/review-header/test/fixtures/current-question-wrong.js.map +1 -0
- package/lib/organism/review-header/test/fixtures/first-question-current-right.js +20 -0
- package/lib/organism/review-header/test/fixtures/first-question-current-right.js.map +1 -0
- package/lib/organism/review-header/test/fixtures/no-answered-question.js +20 -0
- package/lib/organism/review-header/test/fixtures/no-answered-question.js.map +1 -0
- package/lib/organism/review-header/test/fixtures/question-to-repeat.js +20 -0
- package/lib/organism/review-header/test/fixtures/question-to-repeat.js.map +1 -0
- package/lib/organism/review-header/test/fixtures.js +37 -0
- package/lib/organism/review-header/test/fixtures.js.map +1 -0
- package/lib/organism/review-header/test/review-header.js +51 -0
- package/lib/organism/review-header/test/review-header.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import firstdDragAndDrop from '../../../../atom/drag-and-drop/test/fixtures/default';
|
|
2
|
+
import secondDragAndDrop from '../../../../atom/drag-and-drop/test/fixtures/with-children';
|
|
3
|
+
import checkBoxTitle from '../../../../atom/checkbox-with-title/test/fixtures/checked';
|
|
4
|
+
export default {
|
|
5
|
+
props: {
|
|
6
|
+
checkBoxTitle: checkBoxTitle.props,
|
|
7
|
+
list: [firstdDragAndDrop.props, secondDragAndDrop.props]
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=two-drag-and-drops.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/drag-and-drop-wrapper/test/fixtures/two-drag-and-drops.js"],"names":["firstdDragAndDrop","secondDragAndDrop","checkBoxTitle","props","list"],"mappings":"AAAA,OAAOA,iBAAP,MAA8B,sDAA9B;AACA,OAAOC,iBAAP,MAA8B,4DAA9B;AACA,OAAOC,aAAP,MAA0B,4DAA1B;AAEA,eAAe;AACbC,EAAAA,KAAK,EAAE;AACLD,IAAAA,aAAa,EAAEA,aAAa,CAACC,KADxB;AAELC,IAAAA,IAAI,EAAE,CAACJ,iBAAiB,CAACG,KAAnB,EAA0BF,iBAAiB,CAACE,KAA5C;AAFD;AADM,CAAf","sourcesContent":["import firstdDragAndDrop from '../../../../atom/drag-and-drop/test/fixtures/default';\nimport secondDragAndDrop from '../../../../atom/drag-and-drop/test/fixtures/with-children';\nimport checkBoxTitle from '../../../../atom/checkbox-with-title/test/fixtures/checked';\n\nexport default {\n props: {\n checkBoxTitle: checkBoxTitle.props,\n list: [firstdDragAndDrop.props, secondDragAndDrop.props]\n }\n};\n"],"file":"two-drag-and-drops.js"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import forEach from 'lodash/forEach';
|
|
3
|
+
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
|
+
import MoleculeInputTextWithTiteledCheckbox from '..';
|
|
5
|
+
import fixtureChecked from './fixtures/checked';
|
|
6
|
+
import fixtureUnchecked from './fixtures/unchecked';
|
|
7
|
+
test('Molecule › MoleculeInputTextWithTiteledCheckbox > should have valid propTypes', t => {
|
|
8
|
+
t.pass();
|
|
9
|
+
forEach(MoleculeInputTextWithTiteledCheckbox.propTypes, (value, key) => {
|
|
10
|
+
t.not(value, undefined, `PropType for "Molecule.MoleculeInputTextWithTiteledCheckbox.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
test('Molecule › MoleculeInputTextWithTiteledCheckbox › Checked › should be rendered', renderComponentMacro, MoleculeInputTextWithTiteledCheckbox, fixtureChecked);
|
|
14
|
+
test('Molecule › MoleculeInputTextWithTiteledCheckbox › Unchecked › should be rendered', renderComponentMacro, MoleculeInputTextWithTiteledCheckbox, fixtureUnchecked);
|
|
15
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/input-text-with-titeled-checkbox/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeInputTextWithTiteledCheckbox","fixtureChecked","fixtureUnchecked","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,oCAAP,MAAiD,IAAjD;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,gBAAP,MAA6B,sBAA7B;AAEAL,IAAI,CAAC,+EAAD,EAAkFM,CAAC,IAAI;AACzFA,EAAAA,CAAC,CAACC,IAAF;AACAN,EAAAA,OAAO,CAACE,oCAAoC,CAACK,SAAtC,EAAiD,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACtEJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,yEAAwEF,GAAI,mEAArG;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAV,IAAI,CAAC,gFAAD,EAAmFE,oBAAnF,EAAyGC,oCAAzG,EAA+IC,cAA/I,CAAJ;AACAJ,IAAI,CAAC,kFAAD,EAAqFE,oBAArF,EAA2GC,oCAA3G,EAAiJE,gBAAjJ,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeInputTextWithTiteledCheckbox from '..';\nimport fixtureChecked from './fixtures/checked';\nimport fixtureUnchecked from './fixtures/unchecked';\n\ntest('Molecule › MoleculeInputTextWithTiteledCheckbox > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeInputTextWithTiteledCheckbox.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeInputTextWithTiteledCheckbox.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeInputTextWithTiteledCheckbox › Checked › should be rendered', renderComponentMacro, MoleculeInputTextWithTiteledCheckbox, fixtureChecked);\ntest('Molecule › MoleculeInputTextWithTiteledCheckbox › Unchecked › should be rendered', renderComponentMacro, MoleculeInputTextWithTiteledCheckbox, fixtureUnchecked);\n"],"file":"fixtures.js"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import forEach from 'lodash/forEach';
|
|
3
|
+
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
|
+
import MoleculeReviewCorrectionPopin from '..';
|
|
5
|
+
import fixtureRight from './fixtures/right';
|
|
6
|
+
import fixtureWrong from './fixtures/wrong';
|
|
7
|
+
test('Molecule › MoleculeReviewCorrectionPopin > should have valid propTypes', t => {
|
|
8
|
+
t.pass();
|
|
9
|
+
forEach(MoleculeReviewCorrectionPopin.propTypes, (value, key) => {
|
|
10
|
+
t.not(value, undefined, `PropType for "Molecule.MoleculeReviewCorrectionPopin.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
test('Molecule › MoleculeReviewCorrectionPopin › Right › should be rendered', renderComponentMacro, MoleculeReviewCorrectionPopin, fixtureRight);
|
|
14
|
+
test('Molecule › MoleculeReviewCorrectionPopin › Wrong › should be rendered', renderComponentMacro, MoleculeReviewCorrectionPopin, fixtureWrong);
|
|
15
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/review-correction-popin/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeReviewCorrectionPopin","fixtureRight","fixtureWrong","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,6BAAP,MAA0C,IAA1C;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AAEAL,IAAI,CAAC,wEAAD,EAA2EM,CAAC,IAAI;AAClFA,EAAAA,CAAC,CAACC,IAAF;AACAN,EAAAA,OAAO,CAACE,6BAA6B,CAACK,SAA/B,EAA0C,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAC/DJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,kEAAiEF,GAAI,mEAA9F;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAV,IAAI,CAAC,uEAAD,EAA0EE,oBAA1E,EAAgGC,6BAAhG,EAA+HC,YAA/H,CAAJ;AACAJ,IAAI,CAAC,uEAAD,EAA0EE,oBAA1E,EAAgGC,6BAAhG,EAA+HE,YAA/H,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeReviewCorrectionPopin from '..';\nimport fixtureRight from './fixtures/right';\nimport fixtureWrong from './fixtures/wrong';\n\ntest('Molecule › MoleculeReviewCorrectionPopin > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeReviewCorrectionPopin.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeReviewCorrectionPopin.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeReviewCorrectionPopin › Right › should be rendered', renderComponentMacro, MoleculeReviewCorrectionPopin, fixtureRight);\ntest('Molecule › MoleculeReviewCorrectionPopin › Wrong › should be rendered', renderComponentMacro, MoleculeReviewCorrectionPopin, fixtureWrong);\n"],"file":"fixtures.js"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import forEach from 'lodash/forEach';
|
|
3
|
+
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
|
+
import MoleculeReviewHeaderSteps from '..';
|
|
5
|
+
import fixtureAllQuestionsOk from './fixtures/all-questions-ok';
|
|
6
|
+
import fixtureCurrentQuestionNoAswered from './fixtures/current-question-no-aswered';
|
|
7
|
+
import fixtureCurrentQuestionWrong from './fixtures/current-question-wrong';
|
|
8
|
+
import fixtureFirstQuestionCurrentRight from './fixtures/first-question-current-right';
|
|
9
|
+
import fixtureNoAnsweredQuestion from './fixtures/no-answered-question';
|
|
10
|
+
import fixtureQuestionToRepeat from './fixtures/question-to-repeat';
|
|
11
|
+
test('Molecule › MoleculeReviewHeaderSteps > should have valid propTypes', t => {
|
|
12
|
+
t.pass();
|
|
13
|
+
forEach(MoleculeReviewHeaderSteps.propTypes, (value, key) => {
|
|
14
|
+
t.not(value, undefined, `PropType for "Molecule.MoleculeReviewHeaderSteps.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
test('Molecule › MoleculeReviewHeaderSteps › AllQuestionsOk › should be rendered', renderComponentMacro, MoleculeReviewHeaderSteps, fixtureAllQuestionsOk);
|
|
18
|
+
test('Molecule › MoleculeReviewHeaderSteps › CurrentQuestionNoAswered › should be rendered', renderComponentMacro, MoleculeReviewHeaderSteps, fixtureCurrentQuestionNoAswered);
|
|
19
|
+
test('Molecule › MoleculeReviewHeaderSteps › CurrentQuestionWrong › should be rendered', renderComponentMacro, MoleculeReviewHeaderSteps, fixtureCurrentQuestionWrong);
|
|
20
|
+
test('Molecule › MoleculeReviewHeaderSteps › FirstQuestionCurrentRight › should be rendered', renderComponentMacro, MoleculeReviewHeaderSteps, fixtureFirstQuestionCurrentRight);
|
|
21
|
+
test('Molecule › MoleculeReviewHeaderSteps › NoAnsweredQuestion › should be rendered', renderComponentMacro, MoleculeReviewHeaderSteps, fixtureNoAnsweredQuestion);
|
|
22
|
+
test('Molecule › MoleculeReviewHeaderSteps › QuestionToRepeat › should be rendered', renderComponentMacro, MoleculeReviewHeaderSteps, fixtureQuestionToRepeat);
|
|
23
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/review-header-steps/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeReviewHeaderSteps","fixtureAllQuestionsOk","fixtureCurrentQuestionNoAswered","fixtureCurrentQuestionWrong","fixtureFirstQuestionCurrentRight","fixtureNoAnsweredQuestion","fixtureQuestionToRepeat","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,yBAAP,MAAsC,IAAtC;AACA,OAAOC,qBAAP,MAAkC,6BAAlC;AACA,OAAOC,+BAAP,MAA4C,wCAA5C;AACA,OAAOC,2BAAP,MAAwC,mCAAxC;AACA,OAAOC,gCAAP,MAA6C,yCAA7C;AACA,OAAOC,yBAAP,MAAsC,iCAAtC;AACA,OAAOC,uBAAP,MAAoC,+BAApC;AAEAT,IAAI,CAAC,oEAAD,EAAuEU,CAAC,IAAI;AAC9EA,EAAAA,CAAC,CAACC,IAAF;AACAV,EAAAA,OAAO,CAACE,yBAAyB,CAACS,SAA3B,EAAsC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAC3DJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,8DAA6DF,GAAI,mEAA1F;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAd,IAAI,CAAC,4EAAD,EAA+EE,oBAA/E,EAAqGC,yBAArG,EAAgIC,qBAAhI,CAAJ;AACAJ,IAAI,CAAC,sFAAD,EAAyFE,oBAAzF,EAA+GC,yBAA/G,EAA0IE,+BAA1I,CAAJ;AACAL,IAAI,CAAC,kFAAD,EAAqFE,oBAArF,EAA2GC,yBAA3G,EAAsIG,2BAAtI,CAAJ;AACAN,IAAI,CAAC,uFAAD,EAA0FE,oBAA1F,EAAgHC,yBAAhH,EAA2II,gCAA3I,CAAJ;AACAP,IAAI,CAAC,gFAAD,EAAmFE,oBAAnF,EAAyGC,yBAAzG,EAAoIK,yBAApI,CAAJ;AACAR,IAAI,CAAC,8EAAD,EAAiFE,oBAAjF,EAAuGC,yBAAvG,EAAkIM,uBAAlI,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeReviewHeaderSteps from '..';\nimport fixtureAllQuestionsOk from './fixtures/all-questions-ok';\nimport fixtureCurrentQuestionNoAswered from './fixtures/current-question-no-aswered';\nimport fixtureCurrentQuestionWrong from './fixtures/current-question-wrong';\nimport fixtureFirstQuestionCurrentRight from './fixtures/first-question-current-right';\nimport fixtureNoAnsweredQuestion from './fixtures/no-answered-question';\nimport fixtureQuestionToRepeat from './fixtures/question-to-repeat';\n\ntest('Molecule › MoleculeReviewHeaderSteps > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeReviewHeaderSteps.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeReviewHeaderSteps.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeReviewHeaderSteps › AllQuestionsOk › should be rendered', renderComponentMacro, MoleculeReviewHeaderSteps, fixtureAllQuestionsOk);\ntest('Molecule › MoleculeReviewHeaderSteps › CurrentQuestionNoAswered › should be rendered', renderComponentMacro, MoleculeReviewHeaderSteps, fixtureCurrentQuestionNoAswered);\ntest('Molecule › MoleculeReviewHeaderSteps › CurrentQuestionWrong › should be rendered', renderComponentMacro, MoleculeReviewHeaderSteps, fixtureCurrentQuestionWrong);\ntest('Molecule › MoleculeReviewHeaderSteps › FirstQuestionCurrentRight › should be rendered', renderComponentMacro, MoleculeReviewHeaderSteps, fixtureFirstQuestionCurrentRight);\ntest('Molecule › MoleculeReviewHeaderSteps › NoAnsweredQuestion › should be rendered', renderComponentMacro, MoleculeReviewHeaderSteps, fixtureNoAnsweredQuestion);\ntest('Molecule › MoleculeReviewHeaderSteps › QuestionToRepeat › should be rendered', renderComponentMacro, MoleculeReviewHeaderSteps, fixtureQuestionToRepeat);\n"],"file":"fixtures.js"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import getOr from 'lodash/fp/getOr';
|
|
4
|
+
import ButtonLinkIconOnly from '../../atom/button-link-icon-only';
|
|
5
|
+
import ReviewHeaderStep from '../../molecule/review-header-steps';
|
|
6
|
+
import style from './style.css';
|
|
7
|
+
|
|
8
|
+
const ReviewHeader = (props, context) => {
|
|
9
|
+
const {
|
|
10
|
+
steps,
|
|
11
|
+
mode,
|
|
12
|
+
skillName,
|
|
13
|
+
'aria-label': ariaLabel,
|
|
14
|
+
closeButtonAriaLabel,
|
|
15
|
+
onQuitClick
|
|
16
|
+
} = props;
|
|
17
|
+
const {
|
|
18
|
+
skin
|
|
19
|
+
} = context;
|
|
20
|
+
const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);
|
|
21
|
+
const buttonProps = {
|
|
22
|
+
icon: 'close',
|
|
23
|
+
'data-name': 'review-header-close-button',
|
|
24
|
+
'aria-label': closeButtonAriaLabel,
|
|
25
|
+
onClick: onQuitClick,
|
|
26
|
+
size: 'responsive',
|
|
27
|
+
className: style.review
|
|
28
|
+
};
|
|
29
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
30
|
+
className: style.headerWrapper,
|
|
31
|
+
"data-name": "review-header",
|
|
32
|
+
"aria-label": ariaLabel
|
|
33
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
34
|
+
className: style.titlesWrapper
|
|
35
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
className: style.title,
|
|
37
|
+
title: mode,
|
|
38
|
+
"aria-label": mode,
|
|
39
|
+
"data-name": "review-header-mode"
|
|
40
|
+
}, mode), /*#__PURE__*/React.createElement("div", {
|
|
41
|
+
className: style.skillName,
|
|
42
|
+
style: {
|
|
43
|
+
color: primarySkinColor
|
|
44
|
+
},
|
|
45
|
+
title: skillName,
|
|
46
|
+
"aria-label": skillName,
|
|
47
|
+
"data-name": "review-header-skill-name"
|
|
48
|
+
}, skillName)), /*#__PURE__*/React.createElement("div", {
|
|
49
|
+
className: style.stepsWrapper
|
|
50
|
+
}, /*#__PURE__*/React.createElement(ReviewHeaderStep, {
|
|
51
|
+
steps: steps,
|
|
52
|
+
key: 'review-header-steps'
|
|
53
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
54
|
+
className: style.iconButtonWrapper,
|
|
55
|
+
"data-name": "review-header-close-button-wrapper"
|
|
56
|
+
}, /*#__PURE__*/React.createElement(ButtonLinkIconOnly, buttonProps)));
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
ReviewHeader.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
60
|
+
steps: ReviewHeaderStep.propTypes.steps,
|
|
61
|
+
mode: PropTypes.string.isRequired,
|
|
62
|
+
skillName: PropTypes.string.isRequired,
|
|
63
|
+
'aria-label': PropTypes.string,
|
|
64
|
+
closeButtonAriaLabel: PropTypes.string,
|
|
65
|
+
onQuitClick: PropTypes.func
|
|
66
|
+
} : {};
|
|
67
|
+
export default ReviewHeader;
|
|
68
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/organism/review-header/index.js"],"names":["React","PropTypes","getOr","ButtonLinkIconOnly","ReviewHeaderStep","style","ReviewHeader","props","context","steps","mode","skillName","ariaLabel","closeButtonAriaLabel","onQuitClick","skin","primarySkinColor","buttonProps","icon","onClick","size","className","review","headerWrapper","titlesWrapper","title","color","stepsWrapper","iconButtonWrapper","propTypes","string","isRequired","func"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,kBAAP,MAA+B,kCAA/B;AACA,OAAOC,gBAAP,MAA6B,oCAA7B;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,YAAY,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;AACvC,QAAM;AACJC,IAAAA,KADI;AAEJC,IAAAA,IAFI;AAGJC,IAAAA,SAHI;AAIJ,kBAAcC,SAJV;AAKJC,IAAAA,oBALI;AAMJC,IAAAA;AANI,MAOFP,KAPJ;AAQA,QAAM;AAACQ,IAAAA;AAAD,MAASP,OAAf;AACA,QAAMQ,gBAAgB,GAAGd,KAAK,CAAC,SAAD,EAAY,gBAAZ,EAA8Ba,IAA9B,CAA9B;AAEA,QAAME,WAAW,GAAG;AAClBC,IAAAA,IAAI,EAAE,OADY;AAElB,iBAAa,4BAFK;AAGlB,kBAAcL,oBAHI;AAIlBM,IAAAA,OAAO,EAAEL,WAJS;AAKlBM,IAAAA,IAAI,EAAE,YALY;AAMlBC,IAAAA,SAAS,EAAEhB,KAAK,CAACiB;AANC,GAApB;AASA,sBACE;AAAK,IAAA,SAAS,EAAEjB,KAAK,CAACkB,aAAtB;AAAqC,iBAAU,eAA/C;AAA+D,kBAAYX;AAA3E,kBACE;AAAK,IAAA,SAAS,EAAEP,KAAK,CAACmB;AAAtB,kBACE;AAAK,IAAA,SAAS,EAAEnB,KAAK,CAACoB,KAAtB;AAA6B,IAAA,KAAK,EAAEf,IAApC;AAA0C,kBAAYA,IAAtD;AAA4D,iBAAU;AAAtE,KACGA,IADH,CADF,eAIE;AACE,IAAA,SAAS,EAAEL,KAAK,CAACM,SADnB;AAEE,IAAA,KAAK,EAAE;AACLe,MAAAA,KAAK,EAAEV;AADF,KAFT;AAKE,IAAA,KAAK,EAAEL,SALT;AAME,kBAAYA,SANd;AAOE,iBAAU;AAPZ,KASGA,SATH,CAJF,CADF,eAkBE;AAAK,IAAA,SAAS,EAAEN,KAAK,CAACsB;AAAtB,kBACE,oBAAC,gBAAD;AAAkB,IAAA,KAAK,EAAElB,KAAzB;AAAgC,IAAA,GAAG,EAAE;AAArC,IADF,CAlBF,eAsBE;AAAK,IAAA,SAAS,EAAEJ,KAAK,CAACuB,iBAAtB;AAAyC,iBAAU;AAAnD,kBACE,oBAAC,kBAAD,EAAwBX,WAAxB,CADF,CAtBF,CADF;AA4BD,CAjDD;;AAmDAX,YAAY,CAACuB,SAAb,2CAAyB;AACvBpB,EAAAA,KAAK,EAAEL,gBAAgB,CAACyB,SAAjB,CAA2BpB,KADX;AAEvBC,EAAAA,IAAI,EAAET,SAAS,CAAC6B,MAAV,CAAiBC,UAFA;AAGvBpB,EAAAA,SAAS,EAAEV,SAAS,CAAC6B,MAAV,CAAiBC,UAHL;AAIvB,gBAAc9B,SAAS,CAAC6B,MAJD;AAKvBjB,EAAAA,oBAAoB,EAAEZ,SAAS,CAAC6B,MALT;AAMvBhB,EAAAA,WAAW,EAAEb,SAAS,CAAC+B;AANA,CAAzB;AASA,eAAe1B,YAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport getOr from 'lodash/fp/getOr';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport ReviewHeaderStep from '../../molecule/review-header-steps';\nimport style from './style.css';\n\nconst ReviewHeader = (props, context) => {\n const {\n steps,\n mode,\n skillName,\n 'aria-label': ariaLabel,\n closeButtonAriaLabel,\n onQuitClick\n } = props;\n const {skin} = context;\n const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);\n\n const buttonProps = {\n icon: 'close',\n 'data-name': 'review-header-close-button',\n 'aria-label': closeButtonAriaLabel,\n onClick: onQuitClick,\n size: 'responsive',\n className: style.review\n };\n\n return (\n <div className={style.headerWrapper} data-name=\"review-header\" aria-label={ariaLabel}>\n <div className={style.titlesWrapper}>\n <div className={style.title} title={mode} aria-label={mode} data-name=\"review-header-mode\">\n {mode}\n </div>\n <div\n className={style.skillName}\n style={{\n color: primarySkinColor\n }}\n title={skillName}\n aria-label={skillName}\n data-name=\"review-header-skill-name\"\n >\n {skillName}\n </div>\n </div>\n\n <div className={style.stepsWrapper}>\n <ReviewHeaderStep steps={steps} key={'review-header-steps'} />\n </div>\n\n <div className={style.iconButtonWrapper} data-name=\"review-header-close-button-wrapper\">\n <ButtonLinkIconOnly {...buttonProps} />\n </div>\n </div>\n );\n};\n\nReviewHeader.propTypes = {\n steps: ReviewHeaderStep.propTypes.steps,\n mode: PropTypes.string.isRequired,\n skillName: PropTypes.string.isRequired,\n 'aria-label': PropTypes.string,\n closeButtonAriaLabel: PropTypes.string,\n onQuitClick: PropTypes.func\n};\n\nexport default ReviewHeader;\n"],"file":"index.js"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
@value breakpoints: "../../variables/breakpoints.css";
|
|
2
|
+
@value mobile from breakpoints;
|
|
3
|
+
@value tablet from breakpoints;
|
|
4
|
+
@value colors: "../../variables/colors.css";
|
|
5
|
+
@value cm_blue_900 from colors;
|
|
6
|
+
@value box_shadow_light_dark from colors;
|
|
7
|
+
|
|
8
|
+
.headerWrapper {
|
|
9
|
+
position: relative;
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: space-between;
|
|
13
|
+
height: 98px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.titlesWrapper {
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
margin-left: 64px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.fontDefault {
|
|
23
|
+
font-family: 'Gilroy';
|
|
24
|
+
font-weight: 700;
|
|
25
|
+
display: flex;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.title {
|
|
29
|
+
composes: fontDefault;
|
|
30
|
+
color: cm_blue_900;
|
|
31
|
+
font-size: 20px;
|
|
32
|
+
line-height: 28px;
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.skillName {
|
|
37
|
+
composes: fontDefault;
|
|
38
|
+
font-size: 16px;
|
|
39
|
+
line-height: 22px;
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.stepsWrapper {
|
|
44
|
+
position: absolute;
|
|
45
|
+
left: 50%;
|
|
46
|
+
transform: translate(-50%, 0);
|
|
47
|
+
display: flex;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.iconButtonWrapper {
|
|
51
|
+
margin-top: 0;
|
|
52
|
+
margin-right: 64px;
|
|
53
|
+
position: relative;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.review {
|
|
57
|
+
background-color: white;
|
|
58
|
+
box-shadow: 0px 4px 16px box_shadow_light_dark;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/*
|
|
62
|
+
parenthesis doesn't work with @values &&
|
|
63
|
+
not using them gives lparentexpected lint error
|
|
64
|
+
*/
|
|
65
|
+
@media tablet and (min-width: 641px) {
|
|
66
|
+
.titlesWrapper {
|
|
67
|
+
margin-left: 32px;
|
|
68
|
+
width: 100%;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.fontDefault {
|
|
72
|
+
font-family: 'Gilroy';
|
|
73
|
+
font-weight: 700;
|
|
74
|
+
display: flex;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.title {
|
|
78
|
+
font-size: 18px;
|
|
79
|
+
line-height: 24px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.skillName {
|
|
83
|
+
font-size: 14px;
|
|
84
|
+
line-height: 20px;
|
|
85
|
+
max-width: 28%;
|
|
86
|
+
display:inline-block;
|
|
87
|
+
overflow: hidden;
|
|
88
|
+
white-space: nowrap;
|
|
89
|
+
text-overflow: ellipsis;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.iconButtonWrapper {
|
|
93
|
+
margin-right: 33px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@media mobile {
|
|
99
|
+
.headerWrapper {
|
|
100
|
+
height: 126px;
|
|
101
|
+
align-items: start;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.stepsWrapper {
|
|
105
|
+
position: absolute;
|
|
106
|
+
left: 50%;
|
|
107
|
+
transform: translate(-50%, 0);
|
|
108
|
+
bottom: 20px;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.titlesWrapper {
|
|
112
|
+
margin-top: 16px;
|
|
113
|
+
margin-left: 20px;
|
|
114
|
+
margin-right: 10px;
|
|
115
|
+
width: 100%;
|
|
116
|
+
overflow: hidden;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.iconButtonWrapper {
|
|
120
|
+
margin-top: 20px;
|
|
121
|
+
margin-right: 20px;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.title {
|
|
125
|
+
font-size: 16px;
|
|
126
|
+
line-height: 22px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.skillName {
|
|
130
|
+
font-size: 14px;
|
|
131
|
+
line-height: 20px;
|
|
132
|
+
text-overflow: ellipsis;
|
|
133
|
+
white-space: nowrap;
|
|
134
|
+
overflow: hidden;
|
|
135
|
+
width: inherit;
|
|
136
|
+
display: block;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
|
|
3
|
+
import stepsProps from '../../../../molecule/review-header-steps/test/fixtures/all-questions-ok';
|
|
4
|
+
export const defaultHeaderProps = {
|
|
5
|
+
mode: 'Revision mode',
|
|
6
|
+
skillName: 'Agility',
|
|
7
|
+
onQuitClick: () => {},
|
|
8
|
+
'aria-label': 'aria-header-wrapper',
|
|
9
|
+
closeButtonAriaLabel: 'aria-close-button'
|
|
10
|
+
};
|
|
11
|
+
export default {
|
|
12
|
+
props: _extends(_extends({}, defaultHeaderProps), {}, {
|
|
13
|
+
steps: stepsProps.props.steps
|
|
14
|
+
})
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=all-questions-ok.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/organism/review-header/test/fixtures/all-questions-ok.js"],"names":["stepsProps","defaultHeaderProps","mode","skillName","onQuitClick","closeButtonAriaLabel","props","steps"],"mappings":";;AAAA,OAAOA,UAAP,MAAuB,yEAAvB;AAEA,OAAO,MAAMC,kBAAkB,GAAG;AAChCC,EAAAA,IAAI,EAAE,eAD0B;AAEhCC,EAAAA,SAAS,EAAE,SAFqB;AAGhCC,EAAAA,WAAW,EAAE,MAAM,CAAE,CAHW;AAIhC,gBAAc,qBAJkB;AAKhCC,EAAAA,oBAAoB,EAAE;AALU,CAA3B;AAQP,eAAe;AACbC,EAAAA,KAAK,wBACAL,kBADA;AAEHM,IAAAA,KAAK,EAAEP,UAAU,CAACM,KAAX,CAAiBC;AAFrB;AADQ,CAAf","sourcesContent":["import stepsProps from '../../../../molecule/review-header-steps/test/fixtures/all-questions-ok';\n\nexport const defaultHeaderProps = {\n mode: 'Revision mode',\n skillName: 'Agility',\n onQuitClick: () => {},\n 'aria-label': 'aria-header-wrapper',\n closeButtonAriaLabel: 'aria-close-button'\n};\n\nexport default {\n props: {\n ...defaultHeaderProps,\n steps: stepsProps.props.steps\n }\n};\n"],"file":"all-questions-ok.js"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
|
|
3
|
+
import stepsProps from '../../../../molecule/review-header-steps/test/fixtures/current-question-no-aswered';
|
|
4
|
+
import { defaultHeaderProps } from './all-questions-ok';
|
|
5
|
+
export default {
|
|
6
|
+
props: _extends(_extends({}, defaultHeaderProps), {}, {
|
|
7
|
+
steps: stepsProps.props.steps,
|
|
8
|
+
mode: 'Another mode',
|
|
9
|
+
skillName: 'This client usually uses long skill titles'
|
|
10
|
+
})
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=current-question-no-answered.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/organism/review-header/test/fixtures/current-question-no-answered.js"],"names":["stepsProps","defaultHeaderProps","props","steps","mode","skillName"],"mappings":";;AAAA,OAAOA,UAAP,MAAuB,oFAAvB;AACA,SAAQC,kBAAR,QAAiC,oBAAjC;AAEA,eAAe;AACbC,EAAAA,KAAK,wBACAD,kBADA;AAEHE,IAAAA,KAAK,EAAEH,UAAU,CAACE,KAAX,CAAiBC,KAFrB;AAGHC,IAAAA,IAAI,EAAE,cAHH;AAIHC,IAAAA,SAAS,EAAE;AAJR;AADQ,CAAf","sourcesContent":["import stepsProps from '../../../../molecule/review-header-steps/test/fixtures/current-question-no-aswered';\nimport {defaultHeaderProps} from './all-questions-ok';\n\nexport default {\n props: {\n ...defaultHeaderProps,\n steps: stepsProps.props.steps,\n mode: 'Another mode',\n skillName: 'This client usually uses long skill titles'\n }\n};\n"],"file":"current-question-no-answered.js"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
|
|
3
|
+
import stepsProps from '../../../../molecule/review-header-steps/test/fixtures/current-question-wrong';
|
|
4
|
+
import { defaultHeaderProps } from './all-questions-ok';
|
|
5
|
+
export default {
|
|
6
|
+
props: _extends(_extends({}, defaultHeaderProps), {}, {
|
|
7
|
+
steps: stepsProps.props.steps
|
|
8
|
+
})
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=current-question-wrong.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/organism/review-header/test/fixtures/current-question-wrong.js"],"names":["stepsProps","defaultHeaderProps","props","steps"],"mappings":";;AAAA,OAAOA,UAAP,MAAuB,+EAAvB;AACA,SAAQC,kBAAR,QAAiC,oBAAjC;AAEA,eAAe;AACbC,EAAAA,KAAK,wBACAD,kBADA;AAEHE,IAAAA,KAAK,EAAEH,UAAU,CAACE,KAAX,CAAiBC;AAFrB;AADQ,CAAf","sourcesContent":["import stepsProps from '../../../../molecule/review-header-steps/test/fixtures/current-question-wrong';\nimport {defaultHeaderProps} from './all-questions-ok';\n\nexport default {\n props: {\n ...defaultHeaderProps,\n steps: stepsProps.props.steps\n }\n};\n"],"file":"current-question-wrong.js"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
|
|
3
|
+
import stepsProps from '../../../../molecule/review-header-steps/test/fixtures/first-question-current-right';
|
|
4
|
+
import { defaultHeaderProps } from './all-questions-ok';
|
|
5
|
+
export default {
|
|
6
|
+
props: _extends(_extends({}, defaultHeaderProps), {}, {
|
|
7
|
+
steps: stepsProps.props.steps
|
|
8
|
+
})
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=first-question-current-right.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/organism/review-header/test/fixtures/first-question-current-right.js"],"names":["stepsProps","defaultHeaderProps","props","steps"],"mappings":";;AAAA,OAAOA,UAAP,MAAuB,qFAAvB;AACA,SAAQC,kBAAR,QAAiC,oBAAjC;AAEA,eAAe;AACbC,EAAAA,KAAK,wBACAD,kBADA;AAEHE,IAAAA,KAAK,EAAEH,UAAU,CAACE,KAAX,CAAiBC;AAFrB;AADQ,CAAf","sourcesContent":["import stepsProps from '../../../../molecule/review-header-steps/test/fixtures/first-question-current-right';\nimport {defaultHeaderProps} from './all-questions-ok';\n\nexport default {\n props: {\n ...defaultHeaderProps,\n steps: stepsProps.props.steps\n }\n};\n"],"file":"first-question-current-right.js"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
|
|
3
|
+
import stepsProps from '../../../../molecule/review-header-steps/test/fixtures/no-answered-question';
|
|
4
|
+
import { defaultHeaderProps } from './all-questions-ok';
|
|
5
|
+
export default {
|
|
6
|
+
props: _extends(_extends({}, defaultHeaderProps), {}, {
|
|
7
|
+
steps: stepsProps.props.steps
|
|
8
|
+
})
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=no-answered-question.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/organism/review-header/test/fixtures/no-answered-question.js"],"names":["stepsProps","defaultHeaderProps","props","steps"],"mappings":";;AAAA,OAAOA,UAAP,MAAuB,6EAAvB;AACA,SAAQC,kBAAR,QAAiC,oBAAjC;AAEA,eAAe;AACbC,EAAAA,KAAK,wBACAD,kBADA;AAEHE,IAAAA,KAAK,EAAEH,UAAU,CAACE,KAAX,CAAiBC;AAFrB;AADQ,CAAf","sourcesContent":["import stepsProps from '../../../../molecule/review-header-steps/test/fixtures/no-answered-question';\nimport {defaultHeaderProps} from './all-questions-ok';\n\nexport default {\n props: {\n ...defaultHeaderProps,\n steps: stepsProps.props.steps\n }\n};\n"],"file":"no-answered-question.js"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
|
|
3
|
+
import stepsProps from '../../../../molecule/review-header-steps/test/fixtures/question-to-repeat';
|
|
4
|
+
import { defaultHeaderProps } from './all-questions-ok';
|
|
5
|
+
export default {
|
|
6
|
+
props: _extends(_extends({}, defaultHeaderProps), {}, {
|
|
7
|
+
steps: stepsProps.props.steps
|
|
8
|
+
})
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=question-to-repeat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/organism/review-header/test/fixtures/question-to-repeat.js"],"names":["stepsProps","defaultHeaderProps","props","steps"],"mappings":";;AAAA,OAAOA,UAAP,MAAuB,2EAAvB;AACA,SAAQC,kBAAR,QAAiC,oBAAjC;AAEA,eAAe;AACbC,EAAAA,KAAK,wBACAD,kBADA;AAEHE,IAAAA,KAAK,EAAEH,UAAU,CAACE,KAAX,CAAiBC;AAFrB;AADQ,CAAf","sourcesContent":["import stepsProps from '../../../../molecule/review-header-steps/test/fixtures/question-to-repeat';\nimport {defaultHeaderProps} from './all-questions-ok';\n\nexport default {\n props: {\n ...defaultHeaderProps,\n steps: stepsProps.props.steps\n }\n};\n"],"file":"question-to-repeat.js"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import forEach from 'lodash/forEach';
|
|
3
|
+
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
|
+
import OrganismReviewHeader from '..';
|
|
5
|
+
import fixtureAllQuestionsOk from './fixtures/all-questions-ok';
|
|
6
|
+
import fixtureCurrentQuestionNoAnswered from './fixtures/current-question-no-answered';
|
|
7
|
+
import fixtureCurrentQuestionWrong from './fixtures/current-question-wrong';
|
|
8
|
+
import fixtureFirstQuestionCurrentRight from './fixtures/first-question-current-right';
|
|
9
|
+
import fixtureNoAnsweredQuestion from './fixtures/no-answered-question';
|
|
10
|
+
import fixtureQuestionToRepeat from './fixtures/question-to-repeat';
|
|
11
|
+
test('Organism › OrganismReviewHeader > should have valid propTypes', t => {
|
|
12
|
+
t.pass();
|
|
13
|
+
forEach(OrganismReviewHeader.propTypes, (value, key) => {
|
|
14
|
+
t.not(value, undefined, `PropType for "Organism.OrganismReviewHeader.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
test('Organism › OrganismReviewHeader › AllQuestionsOk › should be rendered', renderComponentMacro, OrganismReviewHeader, fixtureAllQuestionsOk);
|
|
18
|
+
test('Organism › OrganismReviewHeader › CurrentQuestionNoAnswered › should be rendered', renderComponentMacro, OrganismReviewHeader, fixtureCurrentQuestionNoAnswered);
|
|
19
|
+
test('Organism › OrganismReviewHeader › CurrentQuestionWrong › should be rendered', renderComponentMacro, OrganismReviewHeader, fixtureCurrentQuestionWrong);
|
|
20
|
+
test('Organism › OrganismReviewHeader › FirstQuestionCurrentRight › should be rendered', renderComponentMacro, OrganismReviewHeader, fixtureFirstQuestionCurrentRight);
|
|
21
|
+
test('Organism › OrganismReviewHeader › NoAnsweredQuestion › should be rendered', renderComponentMacro, OrganismReviewHeader, fixtureNoAnsweredQuestion);
|
|
22
|
+
test('Organism › OrganismReviewHeader › QuestionToRepeat › should be rendered', renderComponentMacro, OrganismReviewHeader, fixtureQuestionToRepeat);
|
|
23
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/organism/review-header/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","OrganismReviewHeader","fixtureAllQuestionsOk","fixtureCurrentQuestionNoAnswered","fixtureCurrentQuestionWrong","fixtureFirstQuestionCurrentRight","fixtureNoAnsweredQuestion","fixtureQuestionToRepeat","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,oBAAP,MAAiC,IAAjC;AACA,OAAOC,qBAAP,MAAkC,6BAAlC;AACA,OAAOC,gCAAP,MAA6C,yCAA7C;AACA,OAAOC,2BAAP,MAAwC,mCAAxC;AACA,OAAOC,gCAAP,MAA6C,yCAA7C;AACA,OAAOC,yBAAP,MAAsC,iCAAtC;AACA,OAAOC,uBAAP,MAAoC,+BAApC;AAEAT,IAAI,CAAC,+DAAD,EAAkEU,CAAC,IAAI;AACzEA,EAAAA,CAAC,CAACC,IAAF;AACAV,EAAAA,OAAO,CAACE,oBAAoB,CAACS,SAAtB,EAAiC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACtDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,yDAAwDF,GAAI,mEAArF;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAd,IAAI,CAAC,uEAAD,EAA0EE,oBAA1E,EAAgGC,oBAAhG,EAAsHC,qBAAtH,CAAJ;AACAJ,IAAI,CAAC,kFAAD,EAAqFE,oBAArF,EAA2GC,oBAA3G,EAAiIE,gCAAjI,CAAJ;AACAL,IAAI,CAAC,6EAAD,EAAgFE,oBAAhF,EAAsGC,oBAAtG,EAA4HG,2BAA5H,CAAJ;AACAN,IAAI,CAAC,kFAAD,EAAqFE,oBAArF,EAA2GC,oBAA3G,EAAiII,gCAAjI,CAAJ;AACAP,IAAI,CAAC,2EAAD,EAA8EE,oBAA9E,EAAoGC,oBAApG,EAA0HK,yBAA1H,CAAJ;AACAR,IAAI,CAAC,yEAAD,EAA4EE,oBAA5E,EAAkGC,oBAAlG,EAAwHM,uBAAxH,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport OrganismReviewHeader from '..';\nimport fixtureAllQuestionsOk from './fixtures/all-questions-ok';\nimport fixtureCurrentQuestionNoAnswered from './fixtures/current-question-no-answered';\nimport fixtureCurrentQuestionWrong from './fixtures/current-question-wrong';\nimport fixtureFirstQuestionCurrentRight from './fixtures/first-question-current-right';\nimport fixtureNoAnsweredQuestion from './fixtures/no-answered-question';\nimport fixtureQuestionToRepeat from './fixtures/question-to-repeat';\n\ntest('Organism › OrganismReviewHeader > should have valid propTypes', t => {\n t.pass();\n forEach(OrganismReviewHeader.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Organism.OrganismReviewHeader.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Organism › OrganismReviewHeader › AllQuestionsOk › should be rendered', renderComponentMacro, OrganismReviewHeader, fixtureAllQuestionsOk);\ntest('Organism › OrganismReviewHeader › CurrentQuestionNoAnswered › should be rendered', renderComponentMacro, OrganismReviewHeader, fixtureCurrentQuestionNoAnswered);\ntest('Organism › OrganismReviewHeader › CurrentQuestionWrong › should be rendered', renderComponentMacro, OrganismReviewHeader, fixtureCurrentQuestionWrong);\ntest('Organism › OrganismReviewHeader › FirstQuestionCurrentRight › should be rendered', renderComponentMacro, OrganismReviewHeader, fixtureFirstQuestionCurrentRight);\ntest('Organism › OrganismReviewHeader › NoAnsweredQuestion › should be rendered', renderComponentMacro, OrganismReviewHeader, fixtureNoAnsweredQuestion);\ntest('Organism › OrganismReviewHeader › QuestionToRepeat › should be rendered', renderComponentMacro, OrganismReviewHeader, fixtureQuestionToRepeat);\n"],"file":"fixtures.js"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
|
|
3
|
+
import browserEnv from 'browser-env';
|
|
4
|
+
import test from 'ava';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { mount, configure } from 'enzyme';
|
|
7
|
+
import Adapter from 'enzyme-adapter-react-16';
|
|
8
|
+
import ReviewHeader from '..';
|
|
9
|
+
import defaultFixture from './fixtures/all-questions-ok';
|
|
10
|
+
browserEnv();
|
|
11
|
+
configure({
|
|
12
|
+
adapter: new Adapter()
|
|
13
|
+
});
|
|
14
|
+
test('onQuitClick (close button onClick) should be reachable, should match given aria-label', t => {
|
|
15
|
+
let closeButtonWasClicked = false;
|
|
16
|
+
defaultFixture.props = _extends(_extends({}, defaultFixture.props), {}, {
|
|
17
|
+
onQuitClick: () => {
|
|
18
|
+
closeButtonWasClicked = true;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
const wrapper = mount( /*#__PURE__*/React.createElement(ReviewHeader, defaultFixture.props));
|
|
22
|
+
const headerWrapper = wrapper.find('[data-name="review-header"]');
|
|
23
|
+
t.true(headerWrapper.at(0).exists());
|
|
24
|
+
t.is(headerWrapper.at(0).props()['aria-label'], 'aria-header-wrapper');
|
|
25
|
+
const modeTitle = headerWrapper.find('[data-name="review-header-mode"]');
|
|
26
|
+
t.true(modeTitle.at(0).exists());
|
|
27
|
+
t.is(modeTitle.at(0).props()['aria-label'], 'Revision mode');
|
|
28
|
+
const skillName = headerWrapper.find('[data-name="review-header-skill-name"]');
|
|
29
|
+
t.true(skillName.at(0).exists());
|
|
30
|
+
t.is(skillName.at(0).props()['aria-label'], 'Agility');
|
|
31
|
+
const closeButtonWrapper = headerWrapper.find('[data-name="review-header-close-button-wrapper"]');
|
|
32
|
+
t.true(closeButtonWrapper.at(0).exists());
|
|
33
|
+
const closeButton = headerWrapper.find('[data-name="review-header-close-button"]');
|
|
34
|
+
t.true(closeButton.at(0).exists());
|
|
35
|
+
t.is(closeButton.at(0).props()['aria-label'], 'aria-close-button');
|
|
36
|
+
closeButton.at(0).simulate('click', {});
|
|
37
|
+
t.true(closeButtonWasClicked);
|
|
38
|
+
t.pass();
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=review-header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/organism/review-header/test/review-header.js"],"names":["browserEnv","test","React","mount","configure","Adapter","ReviewHeader","defaultFixture","adapter","t","closeButtonWasClicked","props","onQuitClick","wrapper","headerWrapper","find","true","at","exists","is","modeTitle","skillName","closeButtonWrapper","closeButton","simulate","pass"],"mappings":";;AAAA,OAAOA,UAAP,MAAuB,aAAvB;AACA,OAAOC,IAAP,MAAiB,KAAjB;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,SAAQC,KAAR,EAAeC,SAAf,QAA+B,QAA/B;AACA,OAAOC,OAAP,MAAoB,yBAApB;AACA,OAAOC,YAAP,MAAyB,IAAzB;AACA,OAAOC,cAAP,MAA2B,6BAA3B;AAEAP,UAAU;AACVI,SAAS,CAAC;AAACI,EAAAA,OAAO,EAAE,IAAIH,OAAJ;AAAV,CAAD,CAAT;AAEAJ,IAAI,CAAC,uFAAD,EAA0FQ,CAAC,IAAI;AACjG,MAAIC,qBAAqB,GAAG,KAA5B;AACAH,EAAAA,cAAc,CAACI,KAAf,yBACKJ,cAAc,CAACI,KADpB;AAEEC,IAAAA,WAAW,EAAE,MAAM;AACjBF,MAAAA,qBAAqB,GAAG,IAAxB;AACD;AAJH;AAMA,QAAMG,OAAO,GAAGV,KAAK,eAAC,oBAAC,YAAD,EAAkBI,cAAc,CAACI,KAAjC,CAAD,CAArB;AACA,QAAMG,aAAa,GAAGD,OAAO,CAACE,IAAR,CAAa,6BAAb,CAAtB;AACAN,EAAAA,CAAC,CAACO,IAAF,CAAOF,aAAa,CAACG,EAAd,CAAiB,CAAjB,EAAoBC,MAApB,EAAP;AACAT,EAAAA,CAAC,CAACU,EAAF,CAAKL,aAAa,CAACG,EAAd,CAAiB,CAAjB,EAAoBN,KAApB,GAA4B,YAA5B,CAAL,EAAgD,qBAAhD;AACA,QAAMS,SAAS,GAAGN,aAAa,CAACC,IAAd,CAAmB,kCAAnB,CAAlB;AACAN,EAAAA,CAAC,CAACO,IAAF,CAAOI,SAAS,CAACH,EAAV,CAAa,CAAb,EAAgBC,MAAhB,EAAP;AACAT,EAAAA,CAAC,CAACU,EAAF,CAAKC,SAAS,CAACH,EAAV,CAAa,CAAb,EAAgBN,KAAhB,GAAwB,YAAxB,CAAL,EAA4C,eAA5C;AACA,QAAMU,SAAS,GAAGP,aAAa,CAACC,IAAd,CAAmB,wCAAnB,CAAlB;AACAN,EAAAA,CAAC,CAACO,IAAF,CAAOK,SAAS,CAACJ,EAAV,CAAa,CAAb,EAAgBC,MAAhB,EAAP;AACAT,EAAAA,CAAC,CAACU,EAAF,CAAKE,SAAS,CAACJ,EAAV,CAAa,CAAb,EAAgBN,KAAhB,GAAwB,YAAxB,CAAL,EAA4C,SAA5C;AACA,QAAMW,kBAAkB,GAAGR,aAAa,CAACC,IAAd,CAAmB,kDAAnB,CAA3B;AACAN,EAAAA,CAAC,CAACO,IAAF,CAAOM,kBAAkB,CAACL,EAAnB,CAAsB,CAAtB,EAAyBC,MAAzB,EAAP;AACA,QAAMK,WAAW,GAAGT,aAAa,CAACC,IAAd,CAAmB,0CAAnB,CAApB;AACAN,EAAAA,CAAC,CAACO,IAAF,CAAOO,WAAW,CAACN,EAAZ,CAAe,CAAf,EAAkBC,MAAlB,EAAP;AACAT,EAAAA,CAAC,CAACU,EAAF,CAAKI,WAAW,CAACN,EAAZ,CAAe,CAAf,EAAkBN,KAAlB,GAA0B,YAA1B,CAAL,EAA8C,mBAA9C;AACAY,EAAAA,WAAW,CAACN,EAAZ,CAAe,CAAf,EAAkBO,QAAlB,CAA2B,OAA3B,EAAoC,EAApC;AACAf,EAAAA,CAAC,CAACO,IAAF,CAAON,qBAAP;AACAD,EAAAA,CAAC,CAACgB,IAAF;AACD,CA1BG,CAAJ","sourcesContent":["import browserEnv from 'browser-env';\nimport test from 'ava';\nimport React from 'react';\nimport {mount, configure} from 'enzyme';\nimport Adapter from 'enzyme-adapter-react-16';\nimport ReviewHeader from '..';\nimport defaultFixture from './fixtures/all-questions-ok';\n\nbrowserEnv();\nconfigure({adapter: new Adapter()});\n\ntest('onQuitClick (close button onClick) should be reachable, should match given aria-label', t => {\n let closeButtonWasClicked = false;\n defaultFixture.props = {\n ...defaultFixture.props,\n onQuitClick: () => {\n closeButtonWasClicked = true;\n }\n };\n const wrapper = mount(<ReviewHeader {...defaultFixture.props} />);\n const headerWrapper = wrapper.find('[data-name=\"review-header\"]');\n t.true(headerWrapper.at(0).exists());\n t.is(headerWrapper.at(0).props()['aria-label'], 'aria-header-wrapper');\n const modeTitle = headerWrapper.find('[data-name=\"review-header-mode\"]');\n t.true(modeTitle.at(0).exists());\n t.is(modeTitle.at(0).props()['aria-label'], 'Revision mode');\n const skillName = headerWrapper.find('[data-name=\"review-header-skill-name\"]');\n t.true(skillName.at(0).exists());\n t.is(skillName.at(0).props()['aria-label'], 'Agility');\n const closeButtonWrapper = headerWrapper.find('[data-name=\"review-header-close-button-wrapper\"]');\n t.true(closeButtonWrapper.at(0).exists());\n const closeButton = headerWrapper.find('[data-name=\"review-header-close-button\"]');\n t.true(closeButton.at(0).exists());\n t.is(closeButton.at(0).props()['aria-label'], 'aria-close-button');\n closeButton.at(0).simulate('click', {});\n t.true(closeButtonWasClicked);\n t.pass();\n});\n"],"file":"review-header.js"}
|
|
@@ -43,6 +43,19 @@ const getButtonContent = icon => {
|
|
|
43
43
|
}));
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
+
const getSizeStyle = size => {
|
|
47
|
+
switch (size) {
|
|
48
|
+
case 'small':
|
|
49
|
+
return _style.default.small;
|
|
50
|
+
|
|
51
|
+
case 'responsive':
|
|
52
|
+
return _style.default.responsive;
|
|
53
|
+
|
|
54
|
+
default:
|
|
55
|
+
return _style.default.default;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
46
59
|
const ButtonLinkIconOnly = props => {
|
|
47
60
|
const {
|
|
48
61
|
size = 'default',
|
|
@@ -51,10 +64,11 @@ const ButtonLinkIconOnly = props => {
|
|
|
51
64
|
'data-name': dataName,
|
|
52
65
|
'aria-label': ariaLabel,
|
|
53
66
|
link,
|
|
54
|
-
onClick
|
|
67
|
+
onClick,
|
|
68
|
+
className
|
|
55
69
|
} = props;
|
|
56
70
|
const contentView = getButtonContent(icon);
|
|
57
|
-
const styleButton = (0, _classnames.default)(size
|
|
71
|
+
const styleButton = (0, _classnames.default)(getSizeStyle(size), link && _style.default.link, disabled && _style.default.disabled, className);
|
|
58
72
|
const handleOnClick = (0, _react.useMemo)(() => () => onClick(), [onClick]);
|
|
59
73
|
|
|
60
74
|
if (link) {
|
|
@@ -77,7 +91,7 @@ const ButtonLinkIconOnly = props => {
|
|
|
77
91
|
};
|
|
78
92
|
|
|
79
93
|
ButtonLinkIconOnly.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
80
|
-
size: _propTypes.default.oneOf(['default', 'small']),
|
|
94
|
+
size: _propTypes.default.oneOf(['default', 'small', 'responsive']),
|
|
81
95
|
'aria-label': _propTypes.default.string,
|
|
82
96
|
'data-name': _propTypes.default.string,
|
|
83
97
|
icon: _propTypes.default.oneOf((0, _keys2.default)(_buttonIcons.ICONS)),
|
|
@@ -87,7 +101,8 @@ ButtonLinkIconOnly.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
87
101
|
download: _propTypes.default.bool,
|
|
88
102
|
target: _propTypes.default.oneOf(['_self', '_blank', '_parent', '_top'])
|
|
89
103
|
}),
|
|
90
|
-
disabled: _propTypes.default.bool
|
|
104
|
+
disabled: _propTypes.default.bool,
|
|
105
|
+
className: _propTypes.default.string
|
|
91
106
|
} : {};
|
|
92
107
|
var _default = ButtonLinkIconOnly;
|
|
93
108
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/atom/button-link-icon-only/index.js"],"names":["getButtonContent","icon","Icon","ICONS","style","buttonContent","
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/button-link-icon-only/index.js"],"names":["getButtonContent","icon","Icon","ICONS","style","buttonContent","getSizeStyle","size","small","responsive","default","ButtonLinkIconOnly","props","disabled","dataName","ariaLabel","link","onClick","className","contentView","styleButton","handleOnClick","propTypes","PropTypes","oneOf","string","func","shape","href","download","bool","target"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,gBAAgB,GAAGC,IAAI,IAAI;AAC/B,QAAMC,IAAI,GAAG,qBAAM,IAAN,EAAYD,IAAZ,EAAkBE,kBAAlB,CAAb;;AAEA,MAAI,CAACD,IAAL,EAAW;AACT,wBAAO;AAAK,MAAA,SAAS,EAAEE,eAAMC;AAAtB,MAAP;AACD;;AAED,sBACE;AAAK,IAAA,SAAS,EAAED,eAAMC;AAAtB,kBACE,6BAAC,IAAD;AAAM,IAAA,SAAS,EAAED,eAAMH;AAAvB,IADF,CADF;AAKD,CAZD;;AAcA,MAAMK,YAAY,GAAGC,IAAI,IAAI;AAC3B,UAAQA,IAAR;AACE,SAAK,OAAL;AACE,aAAOH,eAAMI,KAAb;;AACF,SAAK,YAAL;AACE,aAAOJ,eAAMK,UAAb;;AACF;AACE,aAAOL,eAAMM,OAAb;AANJ;AAQD,CATD;;AAWA,MAAMC,kBAAkB,GAAGC,KAAK,IAAI;AAClC,QAAM;AACJL,IAAAA,IAAI,GAAG,SADH;AAEJM,IAAAA,QAFI;AAGJZ,IAAAA,IAHI;AAIJ,iBAAaa,QAJT;AAKJ,kBAAcC,SALV;AAMJC,IAAAA,IANI;AAOJC,IAAAA,OAPI;AAQJC,IAAAA;AARI,MASFN,KATJ;AAUA,QAAMO,WAAW,GAAGnB,gBAAgB,CAACC,IAAD,CAApC;AACA,QAAMmB,WAAW,GAAG,yBAClBd,YAAY,CAACC,IAAD,CADM,EAElBS,IAAI,IAAIZ,eAAMY,IAFI,EAGlBH,QAAQ,IAAIT,eAAMS,QAHA,EAIlBK,SAJkB,CAApB;AAOA,QAAMG,aAAa,GAAG,oBAAQ,MAAM,MAAMJ,OAAO,EAA3B,EAA+B,CAACA,OAAD,CAA/B,CAAtB;;AAEA,MAAID,IAAJ,EAAU;AACR,wBACE,6BAAC,aAAD,eACMA,IADN;AAEE,MAAA,SAAS,EAAEI,WAFb;AAGE,mBAAWN,QAHb;AAIE,oBAAYC,SAJd;AAKE,MAAA,KAAK,EAAEA;AALT,QAOGI,WAPH,CADF;AAWD;;AAED,sBACE;AACE,IAAA,IAAI,EAAC,QADP;AAEE,kBAAYJ,SAFd;AAGE,iBAAWD,QAHb;AAIE,IAAA,KAAK,EAAEC,SAJT;AAKE,IAAA,SAAS,EAAEK,WALb;AAME,IAAA,OAAO,EAAEC;AANX,KAQGF,WARH,CADF;AAYD,CA/CD;;AAiDAR,kBAAkB,CAACW,SAAnB,2CAA+B;AAC7Bf,EAAAA,IAAI,EAAEgB,mBAAUC,KAAV,CAAgB,CAAC,SAAD,EAAY,OAAZ,EAAqB,YAArB,CAAhB,CADuB;AAE7B,gBAAcD,mBAAUE,MAFK;AAG7B,eAAaF,mBAAUE,MAHM;AAI7BxB,EAAAA,IAAI,EAAEsB,mBAAUC,KAAV,CAAgB,oBAAKrB,kBAAL,CAAhB,CAJuB;AAK7Bc,EAAAA,OAAO,EAAEM,mBAAUG,IALU;AAM7BV,EAAAA,IAAI,EAAEO,mBAAUI,KAAV,CAAgB;AACpBC,IAAAA,IAAI,EAAEL,mBAAUE,MADI;AAEpBI,IAAAA,QAAQ,EAAEN,mBAAUO,IAFA;AAGpBC,IAAAA,MAAM,EAAER,mBAAUC,KAAV,CAAgB,CAAC,OAAD,EAAU,QAAV,EAAoB,SAApB,EAA+B,MAA/B,CAAhB;AAHY,GAAhB,CANuB;AAW7BX,EAAAA,QAAQ,EAAEU,mBAAUO,IAXS;AAY7BZ,EAAAA,SAAS,EAAEK,mBAAUE;AAZQ,CAA/B;eAeed,kB","sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, keys} from 'lodash/fp';\nimport classnames from 'classnames';\nimport {ICONS} from '../../util/button-icons';\nimport Link from '../link';\nimport style from './style.css';\n\nconst getButtonContent = icon => {\n const Icon = getOr(null, icon, ICONS);\n\n if (!Icon) {\n return <div className={style.buttonContent} />;\n }\n\n return (\n <div className={style.buttonContent}>\n <Icon className={style.icon} />\n </div>\n );\n};\n\nconst getSizeStyle = size => {\n switch (size) {\n case 'small':\n return style.small;\n case 'responsive':\n return style.responsive;\n default:\n return style.default;\n }\n};\n\nconst ButtonLinkIconOnly = props => {\n const {\n size = 'default',\n disabled,\n icon,\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n link,\n onClick,\n className\n } = props;\n const contentView = getButtonContent(icon);\n const styleButton = classnames(\n getSizeStyle(size),\n link && style.link,\n disabled && style.disabled,\n className\n );\n\n const handleOnClick = useMemo(() => () => onClick(), [onClick]);\n\n if (link) {\n return (\n <Link\n {...link}\n className={styleButton}\n data-name={dataName}\n aria-label={ariaLabel}\n title={ariaLabel}\n >\n {contentView}\n </Link>\n );\n }\n\n return (\n <button\n type=\"button\"\n aria-label={ariaLabel}\n data-name={dataName}\n title={ariaLabel}\n className={styleButton}\n onClick={handleOnClick}\n >\n {contentView}\n </button>\n );\n};\n\nButtonLinkIconOnly.propTypes = {\n size: PropTypes.oneOf(['default', 'small', 'responsive']),\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string,\n icon: PropTypes.oneOf(keys(ICONS)),\n onClick: PropTypes.func,\n link: PropTypes.shape({\n href: PropTypes.string,\n download: PropTypes.bool,\n target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top'])\n }),\n disabled: PropTypes.bool,\n className: PropTypes.string\n};\n\nexport default ButtonLinkIconOnly;\n"],"file":"index.js"}
|