@coorpacademy/components 10.13.5 → 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.
Files changed (89) hide show
  1. package/es/atom/button-link-icon-only/index.js +19 -4
  2. package/es/atom/button-link-icon-only/index.js.map +1 -1
  3. package/es/atom/button-link-icon-only/style.css +29 -0
  4. package/es/atom/button-link-icon-only/test/button-link-icon-only.js +15 -0
  5. package/es/atom/button-link-icon-only/test/button-link-icon-only.js.map +1 -1
  6. package/es/atom/button-link-icon-only/test/fixtures/review-header.js +10 -0
  7. package/es/atom/button-link-icon-only/test/fixtures/review-header.js.map +1 -0
  8. package/es/atom/button-link-icon-only/test/fixtures.js +2 -0
  9. package/es/atom/button-link-icon-only/test/fixtures.js.map +1 -1
  10. package/es/atom/review-header-step-item/index.js +3 -3
  11. package/es/atom/review-header-step-item/index.js.map +1 -1
  12. package/es/atom/review-header-step-item/style.css +4 -3
  13. package/es/atom/review-header-step-item/test/fixtures.js +19 -0
  14. package/es/atom/review-header-step-item/test/fixtures.js.map +1 -0
  15. package/es/molecule/drag-and-drop-wrapper/index.js +39 -0
  16. package/es/molecule/drag-and-drop-wrapper/index.js.map +1 -0
  17. package/es/molecule/drag-and-drop-wrapper/style.css +15 -0
  18. package/es/molecule/drag-and-drop-wrapper/test/fixtures/default.js +9 -0
  19. package/es/molecule/drag-and-drop-wrapper/test/fixtures/default.js.map +1 -0
  20. package/es/molecule/drag-and-drop-wrapper/test/fixtures/two-drag-and-drops.js +10 -0
  21. package/es/molecule/drag-and-drop-wrapper/test/fixtures/two-drag-and-drops.js.map +1 -0
  22. package/es/molecule/review-header-steps/test/fixtures.js +23 -0
  23. package/es/molecule/review-header-steps/test/fixtures.js.map +1 -0
  24. package/es/organism/review-header/index.js +68 -0
  25. package/es/organism/review-header/index.js.map +1 -0
  26. package/es/organism/review-header/style.css +138 -0
  27. package/es/organism/review-header/test/fixtures/all-questions-ok.js +16 -0
  28. package/es/organism/review-header/test/fixtures/all-questions-ok.js.map +1 -0
  29. package/es/organism/review-header/test/fixtures/current-question-no-answered.js +12 -0
  30. package/es/organism/review-header/test/fixtures/current-question-no-answered.js.map +1 -0
  31. package/es/organism/review-header/test/fixtures/current-question-wrong.js +10 -0
  32. package/es/organism/review-header/test/fixtures/current-question-wrong.js.map +1 -0
  33. package/es/organism/review-header/test/fixtures/first-question-current-right.js +10 -0
  34. package/es/organism/review-header/test/fixtures/first-question-current-right.js.map +1 -0
  35. package/es/organism/review-header/test/fixtures/no-answered-question.js +10 -0
  36. package/es/organism/review-header/test/fixtures/no-answered-question.js.map +1 -0
  37. package/es/organism/review-header/test/fixtures/question-to-repeat.js +10 -0
  38. package/es/organism/review-header/test/fixtures/question-to-repeat.js.map +1 -0
  39. package/es/organism/review-header/test/fixtures.js +23 -0
  40. package/es/organism/review-header/test/fixtures.js.map +1 -0
  41. package/es/organism/review-header/test/review-header.js +40 -0
  42. package/es/organism/review-header/test/review-header.js.map +1 -0
  43. package/lib/atom/button-link-icon-only/index.js +19 -4
  44. package/lib/atom/button-link-icon-only/index.js.map +1 -1
  45. package/lib/atom/button-link-icon-only/style.css +29 -0
  46. package/lib/atom/button-link-icon-only/test/button-link-icon-only.js +14 -0
  47. package/lib/atom/button-link-icon-only/test/button-link-icon-only.js.map +1 -1
  48. package/lib/atom/button-link-icon-only/test/fixtures/review-header.js +15 -0
  49. package/lib/atom/button-link-icon-only/test/fixtures/review-header.js.map +1 -0
  50. package/lib/atom/button-link-icon-only/test/fixtures.js +3 -0
  51. package/lib/atom/button-link-icon-only/test/fixtures.js.map +1 -1
  52. package/lib/atom/review-header-step-item/index.js +3 -3
  53. package/lib/atom/review-header-step-item/index.js.map +1 -1
  54. package/lib/atom/review-header-step-item/style.css +4 -3
  55. package/lib/atom/review-header-step-item/test/fixtures.js +31 -0
  56. package/lib/atom/review-header-step-item/test/fixtures.js.map +1 -0
  57. package/lib/molecule/drag-and-drop-wrapper/index.js +49 -0
  58. package/lib/molecule/drag-and-drop-wrapper/index.js.map +1 -0
  59. package/lib/molecule/drag-and-drop-wrapper/style.css +15 -0
  60. package/lib/molecule/drag-and-drop-wrapper/test/fixtures/default.js +19 -0
  61. package/lib/molecule/drag-and-drop-wrapper/test/fixtures/default.js.map +1 -0
  62. package/lib/molecule/drag-and-drop-wrapper/test/fixtures/two-drag-and-drops.js +21 -0
  63. package/lib/molecule/drag-and-drop-wrapper/test/fixtures/two-drag-and-drops.js.map +1 -0
  64. package/lib/molecule/review-header-steps/test/fixtures.js +37 -0
  65. package/lib/molecule/review-header-steps/test/fixtures.js.map +1 -0
  66. package/lib/organism/review-header/index.js +81 -0
  67. package/lib/organism/review-header/index.js.map +1 -0
  68. package/lib/organism/review-header/style.css +138 -0
  69. package/lib/organism/review-header/test/fixtures/all-questions-ok.js +26 -0
  70. package/lib/organism/review-header/test/fixtures/all-questions-ok.js.map +1 -0
  71. package/lib/organism/review-header/test/fixtures/current-question-no-answered.js +22 -0
  72. package/lib/organism/review-header/test/fixtures/current-question-no-answered.js.map +1 -0
  73. package/lib/organism/review-header/test/fixtures/current-question-wrong.js +20 -0
  74. package/lib/organism/review-header/test/fixtures/current-question-wrong.js.map +1 -0
  75. package/lib/organism/review-header/test/fixtures/first-question-current-right.js +20 -0
  76. package/lib/organism/review-header/test/fixtures/first-question-current-right.js.map +1 -0
  77. package/lib/organism/review-header/test/fixtures/no-answered-question.js +20 -0
  78. package/lib/organism/review-header/test/fixtures/no-answered-question.js.map +1 -0
  79. package/lib/organism/review-header/test/fixtures/question-to-repeat.js +20 -0
  80. package/lib/organism/review-header/test/fixtures/question-to-repeat.js.map +1 -0
  81. package/lib/organism/review-header/test/fixtures.js +37 -0
  82. package/lib/organism/review-header/test/fixtures.js.map +1 -0
  83. package/lib/organism/review-header/test/review-header.js +51 -0
  84. package/lib/organism/review-header/test/review-header.js.map +1 -0
  85. package/package.json +2 -2
  86. package/es/molecule/search/test/fixtures.js +0 -15
  87. package/es/molecule/search/test/fixtures.js.map +0 -1
  88. package/lib/molecule/search/test/fixtures.js +0 -25
  89. package/lib/molecule/search/test/fixtures.js.map +0 -1
@@ -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 === 'default' ? _style.default.default : _style.default.small, link && _style.default.link, disabled && _style.default.disabled);
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","ButtonLinkIconOnly","props","size","disabled","dataName","ariaLabel","link","onClick","contentView","styleButton","default","small","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,kBAAkB,GAAGC,KAAK,IAAI;AAClC,QAAM;AACJC,IAAAA,IAAI,GAAG,SADH;AAEJC,IAAAA,QAFI;AAGJR,IAAAA,IAHI;AAIJ,iBAAaS,QAJT;AAKJ,kBAAcC,SALV;AAMJC,IAAAA,IANI;AAOJC,IAAAA;AAPI,MAQFN,KARJ;AASA,QAAMO,WAAW,GAAGd,gBAAgB,CAACC,IAAD,CAApC;AACA,QAAMc,WAAW,GAAG,yBAClBP,IAAI,KAAK,SAAT,GAAqBJ,eAAMY,OAA3B,GAAqCZ,eAAMa,KADzB,EAElBL,IAAI,IAAIR,eAAMQ,IAFI,EAGlBH,QAAQ,IAAIL,eAAMK,QAHA,CAApB;AAMA,QAAMS,aAAa,GAAG,oBAAQ,MAAM,MAAML,OAAO,EAA3B,EAA+B,CAACA,OAAD,CAA/B,CAAtB;;AAEA,MAAID,IAAJ,EAAU;AACR,wBACE,6BAAC,aAAD,eACMA,IADN;AAEE,MAAA,SAAS,EAAEG,WAFb;AAGE,mBAAWL,QAHb;AAIE,oBAAYC,SAJd;AAKE,MAAA,KAAK,EAAEA;AALT,QAOGG,WAPH,CADF;AAWD;;AAED,sBACE;AACE,IAAA,IAAI,EAAC,QADP;AAEE,kBAAYH,SAFd;AAGE,iBAAWD,QAHb;AAIE,IAAA,KAAK,EAAEC,SAJT;AAKE,IAAA,SAAS,EAAEI,WALb;AAME,IAAA,OAAO,EAAEG;AANX,KAQGJ,WARH,CADF;AAYD,CA7CD;;AA+CAR,kBAAkB,CAACa,SAAnB,2CAA+B;AAC7BX,EAAAA,IAAI,EAAEY,mBAAUC,KAAV,CAAgB,CAAC,SAAD,EAAY,OAAZ,CAAhB,CADuB;AAE7B,gBAAcD,mBAAUE,MAFK;AAG7B,eAAaF,mBAAUE,MAHM;AAI7BrB,EAAAA,IAAI,EAAEmB,mBAAUC,KAAV,CAAgB,oBAAKlB,kBAAL,CAAhB,CAJuB;AAK7BU,EAAAA,OAAO,EAAEO,mBAAUG,IALU;AAM7BX,EAAAA,IAAI,EAAEQ,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;AAW7BZ,EAAAA,QAAQ,EAAEW,mBAAUO;AAXS,CAA/B;eAcerB,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 ButtonLinkIconOnly = props => {\n const {\n size = 'default',\n disabled,\n icon,\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n link,\n onClick\n } = props;\n const contentView = getButtonContent(icon);\n const styleButton = classnames(\n size === 'default' ? style.default : style.small,\n link && style.link,\n disabled && style.disabled\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']),\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};\n\nexport default ButtonLinkIconOnly;\n"],"file":"index.js"}
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"}
@@ -1,6 +1,9 @@
1
+ @value breakpoints: "../../variables/breakpoints.css";
2
+ @value tablet from breakpoints;
1
3
  @value colors: "../../variables/colors.css";
2
4
  @value cm_grey_100 from colors;
3
5
  @value cm_grey_200 from colors;
6
+ @value white from colors;
4
7
 
5
8
  .button {
6
9
  font-family: Gilroy;
@@ -46,6 +49,18 @@
46
49
  border-radius: 7px;
47
50
  }
48
51
 
52
+ .responsive {
53
+ composes: button;
54
+ width: 44px;
55
+ height: 44px;
56
+ border-radius: 7px;
57
+ }
58
+
59
+ .responsive .icon {
60
+ width: 14px;
61
+ height: 14px;
62
+ }
63
+
49
64
  .small {
50
65
  composes: button;
51
66
  width: 32px;
@@ -53,6 +68,20 @@
53
68
  border-radius: 5px;
54
69
  }
55
70
 
71
+ @media tablet {
72
+ .responsive {
73
+ composes: button;
74
+ width: 32px;
75
+ height: 32px;
76
+ border-radius: 5px;
77
+ }
78
+
79
+ .responsive .icon {
80
+ width: 12px;
81
+ height: 12px;
82
+ }
83
+ }
84
+
56
85
  .default .icon {
57
86
  width: 14px;
58
87
  height: 14px;
@@ -18,6 +18,8 @@ var _buttonIconBullet = _interopRequireDefault(require("./fixtures/button-icon-b
18
18
 
19
19
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20
20
 
21
+ 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); }
22
+
21
23
  (0, _browserEnv.default)();
22
24
  (0, _enzyme.configure)({
23
25
  adapter: new _enzymeAdapterReact.default()
@@ -34,4 +36,16 @@ const translate = _identity2.default;
34
36
  button.first().simulate('click', {});
35
37
  t.pass();
36
38
  });
39
+ (0, _ava.default)('should mount ButtonLinkIconOnly even if the className does not exist', t => {
40
+ const wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_.default, _extends({}, _buttonIconBullet.default.props, {
41
+ className: 'noClass'
42
+ })), {
43
+ context: {
44
+ translate
45
+ }
46
+ });
47
+ const button = wrapper.find('[data-name="bullet-button"]');
48
+ t.true(button.exists());
49
+ t.pass();
50
+ });
37
51
  //# sourceMappingURL=button-link-icon-only.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/atom/button-link-icon-only/test/button-link-icon-only.js"],"names":["adapter","Adapter","translate","t","wrapper","defaultFixture","props","context","button","find","true","exists","first","simulate","pass"],"mappings":";;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;;;AAEA;AACA,uBAAU;AAACA,EAAAA,OAAO,EAAE,IAAIC,2BAAJ;AAAV,CAAV;AACA,MAAMC,SAAS,qBAAf;AAEA,kBAAK,6DAAL,EAAoEC,CAAC,IAAI;AACvE,QAAMC,OAAO,GAAG,mCAAQ,6BAAC,SAAD,EAAwBC,0BAAeC,KAAvC,CAAR,EAA0D;AACxEC,IAAAA,OAAO,EAAE;AAACL,MAAAA;AAAD;AAD+D,GAA1D,CAAhB;AAGA,QAAMM,MAAM,GAAGJ,OAAO,CAACK,IAAR,CAAa,6BAAb,CAAf;AACAN,EAAAA,CAAC,CAACO,IAAF,CAAOF,MAAM,CAACG,MAAP,EAAP;AACAH,EAAAA,MAAM,CAACI,KAAP,GAAeC,QAAf,CAAwB,OAAxB,EAAiC,EAAjC;AACAV,EAAAA,CAAC,CAACW,IAAF;AACD,CARD","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 ButtonLinkIconOnly from '..';\nimport defaultFixture from './fixtures/button-icon-bullet';\n\nbrowserEnv();\nconfigure({adapter: new Adapter()});\nconst translate = identity;\n\ntest('should launch onClick on click event for ButtonLinkIconOnly', t => {\n const wrapper = shallow(<ButtonLinkIconOnly {...defaultFixture.props} />, {\n context: {translate}\n });\n const button = wrapper.find('[data-name=\"bullet-button\"]');\n t.true(button.exists());\n button.first().simulate('click', {});\n t.pass();\n});\n"],"file":"button-link-icon-only.js"}
1
+ {"version":3,"sources":["../../../../src/atom/button-link-icon-only/test/button-link-icon-only.js"],"names":["adapter","Adapter","translate","t","wrapper","defaultFixture","props","context","button","find","true","exists","first","simulate","pass"],"mappings":";;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;;;;;AAEA;AACA,uBAAU;AAACA,EAAAA,OAAO,EAAE,IAAIC,2BAAJ;AAAV,CAAV;AACA,MAAMC,SAAS,qBAAf;AAEA,kBAAK,6DAAL,EAAoEC,CAAC,IAAI;AACvE,QAAMC,OAAO,GAAG,mCAAQ,6BAAC,SAAD,EAAwBC,0BAAeC,KAAvC,CAAR,EAA0D;AACxEC,IAAAA,OAAO,EAAE;AAACL,MAAAA;AAAD;AAD+D,GAA1D,CAAhB;AAGA,QAAMM,MAAM,GAAGJ,OAAO,CAACK,IAAR,CAAa,6BAAb,CAAf;AACAN,EAAAA,CAAC,CAACO,IAAF,CAAOF,MAAM,CAACG,MAAP,EAAP;AACAH,EAAAA,MAAM,CAACI,KAAP,GAAeC,QAAf,CAAwB,OAAxB,EAAiC,EAAjC;AACAV,EAAAA,CAAC,CAACW,IAAF;AACD,CARD;AAUA,kBAAK,sEAAL,EAA6EX,CAAC,IAAI;AAChF,QAAMC,OAAO,GAAG,mCAAQ,6BAAC,SAAD,eAAwBC,0BAAeC,KAAvC;AAA8C,IAAA,SAAS,EAAE;AAAzD,KAAR,EAAgF;AAC9FC,IAAAA,OAAO,EAAE;AAACL,MAAAA;AAAD;AADqF,GAAhF,CAAhB;AAGA,QAAMM,MAAM,GAAGJ,OAAO,CAACK,IAAR,CAAa,6BAAb,CAAf;AACAN,EAAAA,CAAC,CAACO,IAAF,CAAOF,MAAM,CAACG,MAAP,EAAP;AACAR,EAAAA,CAAC,CAACW,IAAF;AACD,CAPD","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 ButtonLinkIconOnly from '..';\nimport defaultFixture from './fixtures/button-icon-bullet';\n\nbrowserEnv();\nconfigure({adapter: new Adapter()});\nconst translate = identity;\n\ntest('should launch onClick on click event for ButtonLinkIconOnly', t => {\n const wrapper = shallow(<ButtonLinkIconOnly {...defaultFixture.props} />, {\n context: {translate}\n });\n const button = wrapper.find('[data-name=\"bullet-button\"]');\n t.true(button.exists());\n button.first().simulate('click', {});\n t.pass();\n});\n\ntest('should mount ButtonLinkIconOnly even if the className does not exist', t => {\n const wrapper = shallow(<ButtonLinkIconOnly {...defaultFixture.props} className={'noClass'} />, {\n context: {translate}\n });\n const button = wrapper.find('[data-name=\"bullet-button\"]');\n t.true(button.exists());\n t.pass();\n});\n"],"file":"button-link-icon-only.js"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+ var _default = {
6
+ props: {
7
+ size: 'responsive',
8
+ 'data-name': 'default-button',
9
+ 'aria-label': 'aria button',
10
+ icon: 'close',
11
+ onClick: () => console.log('click')
12
+ }
13
+ };
14
+ exports.default = _default;
15
+ //# sourceMappingURL=review-header.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/atom/button-link-icon-only/test/fixtures/review-header.js"],"names":["props","size","icon","onClick","console","log"],"mappings":";;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,YADD;AAEL,iBAAa,gBAFR;AAGL,kBAAc,aAHT;AAILC,IAAAA,IAAI,EAAE,OAJD;AAKLC,IAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,OAAZ;AALV;AADM,C","sourcesContent":["export default {\n props: {\n size: 'responsive',\n 'data-name': 'default-button',\n 'aria-label': 'aria button',\n icon: 'close',\n onClick: () => console.log('click')\n }\n};\n"],"file":"review-header.js"}
@@ -14,6 +14,8 @@ var _default = _interopRequireDefault(require("./fixtures/default"));
14
14
 
15
15
  var _noIcon = _interopRequireDefault(require("./fixtures/no-icon"));
16
16
 
17
+ var _reviewHeader = _interopRequireDefault(require("./fixtures/review-header"));
18
+
17
19
  var _smallButtonDisabled = _interopRequireDefault(require("./fixtures/small-button-disabled"));
18
20
 
19
21
  var _smallLinkDownload = _interopRequireDefault(require("./fixtures/small-link-download"));
@@ -29,6 +31,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
29
31
  (0, _ava.default)('Atom › AtomButtonLinkIconOnly › ButtonIconBullet › should be rendered', _renderComponent.default, _.default, _buttonIconBullet.default);
30
32
  (0, _ava.default)('Atom › AtomButtonLinkIconOnly › Default › should be rendered', _renderComponent.default, _.default, _default.default);
31
33
  (0, _ava.default)('Atom › AtomButtonLinkIconOnly › NoIcon › should be rendered', _renderComponent.default, _.default, _noIcon.default);
34
+ (0, _ava.default)('Atom › AtomButtonLinkIconOnly › ReviewHeader › should be rendered', _renderComponent.default, _.default, _reviewHeader.default);
32
35
  (0, _ava.default)('Atom › AtomButtonLinkIconOnly › SmallButtonDisabled › should be rendered', _renderComponent.default, _.default, _smallButtonDisabled.default);
33
36
  (0, _ava.default)('Atom › AtomButtonLinkIconOnly › SmallLinkDownload › should be rendered', _renderComponent.default, _.default, _smallLinkDownload.default);
34
37
  //# sourceMappingURL=fixtures.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/atom/button-link-icon-only/test/fixtures.js"],"names":["t","pass","AtomButtonLinkIconOnly","propTypes","value","key","not","undefined","renderComponentMacro","fixtureButtonIconBullet","fixtureDefault","fixtureNoIcon","fixtureSmallButtonDisabled","fixtureSmallLinkDownload"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,6DAAL,EAAoEA,CAAC,IAAI;AACvEA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAuBC,SAA/B,EAA0C,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACxDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,uDAAsDF,GAAI,mEAAnF;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,uEAAL,EAA8EG,wBAA9E,EAAoGN,SAApG,EAA4HO,yBAA5H;AACA,kBAAK,8DAAL,EAAqED,wBAArE,EAA2FN,SAA3F,EAAmHQ,gBAAnH;AACA,kBAAK,6DAAL,EAAoEF,wBAApE,EAA0FN,SAA1F,EAAkHS,eAAlH;AACA,kBAAK,0EAAL,EAAiFH,wBAAjF,EAAuGN,SAAvG,EAA+HU,4BAA/H;AACA,kBAAK,wEAAL,EAA+EJ,wBAA/E,EAAqGN,SAArG,EAA6HW,0BAA7H","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomButtonLinkIconOnly from '..';\nimport fixtureButtonIconBullet from './fixtures/button-icon-bullet';\nimport fixtureDefault from './fixtures/default';\nimport fixtureNoIcon from './fixtures/no-icon';\nimport fixtureSmallButtonDisabled from './fixtures/small-button-disabled';\nimport fixtureSmallLinkDownload from './fixtures/small-link-download';\n\ntest('Atom › AtomButtonLinkIconOnly > should have valid propTypes', t => {\n t.pass();\n forEach(AtomButtonLinkIconOnly.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomButtonLinkIconOnly.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomButtonLinkIconOnly › ButtonIconBullet › should be rendered', renderComponentMacro, AtomButtonLinkIconOnly, fixtureButtonIconBullet);\ntest('Atom › AtomButtonLinkIconOnly › Default › should be rendered', renderComponentMacro, AtomButtonLinkIconOnly, fixtureDefault);\ntest('Atom › AtomButtonLinkIconOnly › NoIcon › should be rendered', renderComponentMacro, AtomButtonLinkIconOnly, fixtureNoIcon);\ntest('Atom › AtomButtonLinkIconOnly › SmallButtonDisabled › should be rendered', renderComponentMacro, AtomButtonLinkIconOnly, fixtureSmallButtonDisabled);\ntest('Atom › AtomButtonLinkIconOnly › SmallLinkDownload › should be rendered', renderComponentMacro, AtomButtonLinkIconOnly, fixtureSmallLinkDownload);\n"],"file":"fixtures.js"}
1
+ {"version":3,"sources":["../../../../src/atom/button-link-icon-only/test/fixtures.js"],"names":["t","pass","AtomButtonLinkIconOnly","propTypes","value","key","not","undefined","renderComponentMacro","fixtureButtonIconBullet","fixtureDefault","fixtureNoIcon","fixtureReviewHeader","fixtureSmallButtonDisabled","fixtureSmallLinkDownload"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,6DAAL,EAAoEA,CAAC,IAAI;AACvEA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAuBC,SAA/B,EAA0C,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACxDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,uDAAsDF,GAAI,mEAAnF;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,uEAAL,EAA8EG,wBAA9E,EAAoGN,SAApG,EAA4HO,yBAA5H;AACA,kBAAK,8DAAL,EAAqED,wBAArE,EAA2FN,SAA3F,EAAmHQ,gBAAnH;AACA,kBAAK,6DAAL,EAAoEF,wBAApE,EAA0FN,SAA1F,EAAkHS,eAAlH;AACA,kBAAK,mEAAL,EAA0EH,wBAA1E,EAAgGN,SAAhG,EAAwHU,qBAAxH;AACA,kBAAK,0EAAL,EAAiFJ,wBAAjF,EAAuGN,SAAvG,EAA+HW,4BAA/H;AACA,kBAAK,wEAAL,EAA+EL,wBAA/E,EAAqGN,SAArG,EAA6HY,0BAA7H","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomButtonLinkIconOnly from '..';\nimport fixtureButtonIconBullet from './fixtures/button-icon-bullet';\nimport fixtureDefault from './fixtures/default';\nimport fixtureNoIcon from './fixtures/no-icon';\nimport fixtureReviewHeader from './fixtures/review-header';\nimport fixtureSmallButtonDisabled from './fixtures/small-button-disabled';\nimport fixtureSmallLinkDownload from './fixtures/small-link-download';\n\ntest('Atom › AtomButtonLinkIconOnly > should have valid propTypes', t => {\n t.pass();\n forEach(AtomButtonLinkIconOnly.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomButtonLinkIconOnly.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomButtonLinkIconOnly › ButtonIconBullet › should be rendered', renderComponentMacro, AtomButtonLinkIconOnly, fixtureButtonIconBullet);\ntest('Atom › AtomButtonLinkIconOnly › Default › should be rendered', renderComponentMacro, AtomButtonLinkIconOnly, fixtureDefault);\ntest('Atom › AtomButtonLinkIconOnly › NoIcon › should be rendered', renderComponentMacro, AtomButtonLinkIconOnly, fixtureNoIcon);\ntest('Atom › AtomButtonLinkIconOnly › ReviewHeader › should be rendered', renderComponentMacro, AtomButtonLinkIconOnly, fixtureReviewHeader);\ntest('Atom › AtomButtonLinkIconOnly › SmallButtonDisabled › should be rendered', renderComponentMacro, AtomButtonLinkIconOnly, fixtureSmallButtonDisabled);\ntest('Atom › AtomButtonLinkIconOnly › SmallLinkDownload › should be rendered', renderComponentMacro, AtomButtonLinkIconOnly, fixtureSmallLinkDownload);\n"],"file":"fixtures.js"}
@@ -32,7 +32,7 @@ const Content = ({
32
32
  className: _style.default.value,
33
33
  "aria-label": `step ${value}`
34
34
  }, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademyCheck, {
35
- className: current ? _style.default.currentRightIcon : _style.default.rightIcon
35
+ className: (0, _classnames.default)(_style.default.rightIcon, current && _style.default.currentRightIcon)
36
36
  }));
37
37
  }
38
38
 
@@ -41,7 +41,7 @@ const Content = ({
41
41
  className: _style.default.value,
42
42
  "aria-label": `step ${value}`
43
43
  }, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaSolidStatusClose, {
44
- className: current ? _style.default.currentWrongIcon : _style.default.wrongIcon
44
+ className: (0, _classnames.default)(_style.default.wrongIcon, current && _style.default.currentWrongIcon)
45
45
  }));
46
46
  }
47
47
  };
@@ -52,7 +52,7 @@ const ReviewHeaderStepItem = props => {
52
52
  current
53
53
  } = props;
54
54
  return /*#__PURE__*/_react.default.createElement("div", {
55
- className: (0, _classnames.default)(icon === 'right' ? _style.default.right : null, icon === 'wrong' ? _style.default.wrong : null, current ? _style.default.current : _style.default.default),
55
+ className: (0, _classnames.default)(_style.default.default, icon === 'right' && _style.default.right, icon === 'wrong' && _style.default.wrong, current && _style.default.current),
56
56
  "data-name": "header-step-item"
57
57
  }, /*#__PURE__*/_react.default.createElement(Content, props));
58
58
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/atom/review-header-step-item/index.js"],"names":["Content","icon","current","value","style","currentRightIcon","rightIcon","currentWrongIcon","wrongIcon","ReviewHeaderStepItem","props","right","wrong","default","propTypes","PropTypes","string","bool"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AAIA;;;;AAEA,MAAMA,OAAO,GAAG,CAAC;AAACC,EAAAA,IAAD;AAAOC,EAAAA,OAAP;AAAgBC,EAAAA;AAAhB,CAAD,KAA4B;AAC1C,MAAI,CAACF,IAAL,EAAW;AACT,wBACE;AAAM,MAAA,SAAS,EAAEG,eAAMD,KAAvB;AAA8B,oBAAa,QAAOA,KAAM;AAAxD,OACGA,KADH,CADF;AAKD;;AAED,MAAIF,IAAI,KAAK,OAAb,EAAsB;AACpB,wBACE;AAAM,MAAA,SAAS,EAAEG,eAAMD,KAAvB;AAA8B,oBAAa,QAAOA,KAAM;AAAxD,oBACE,6BAAC,2CAAD;AAAW,MAAA,SAAS,EAAED,OAAO,GAAGE,eAAMC,gBAAT,GAA4BD,eAAME;AAA/D,MADF,CADF;AAKD;;AAED,MAAIL,IAAI,KAAK,OAAb,EAAsB;AACpB,wBACE;AAAM,MAAA,SAAS,EAAEG,eAAMD,KAAvB;AAA8B,oBAAa,QAAOA,KAAM;AAAxD,oBACE,6BAAC,+BAAD;AAAW,MAAA,SAAS,EAAED,OAAO,GAAGE,eAAMG,gBAAT,GAA4BH,eAAMI;AAA/D,MADF,CADF;AAKD;AACF,CAxBD;;AA0BA,MAAMC,oBAAoB,GAAGC,KAAK,IAAI;AACpC,QAAM;AAACT,IAAAA,IAAD;AAAOC,IAAAA;AAAP,MAAkBQ,KAAxB;AACA,sBACE;AACE,IAAA,SAAS,EAAE,yBACTT,IAAI,KAAK,OAAT,GAAmBG,eAAMO,KAAzB,GAAiC,IADxB,EAETV,IAAI,KAAK,OAAT,GAAmBG,eAAMQ,KAAzB,GAAiC,IAFxB,EAGTV,OAAO,GAAGE,eAAMF,OAAT,GAAmBE,eAAMS,OAHvB,CADb;AAME,iBAAU;AANZ,kBAQE,6BAAC,OAAD,EAAaH,KAAb,CARF,CADF;AAYD,CAdD;;AAgBAD,oBAAoB,CAACK,SAArB,2CAAiC;AAC/Bb,EAAAA,IAAI,EAAEc,mBAAUC,MADe;AAE/Bd,EAAAA,OAAO,EAAEa,mBAAUE,IAFY;AAG/Bd,EAAAA,KAAK,EAAEY,mBAAUC;AAHc,CAAjC;eAMeP,oB","sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport PropTypes from 'prop-types';\nimport {\n NovaCompositionCoorpacademyCheck as RightIcon,\n NovaSolidStatusClose as WrongIcon\n} from '@coorpacademy/nova-icons';\nimport style from './style.css';\n\nconst Content = ({icon, current, value}) => {\n if (!icon) {\n return (\n <span className={style.value} aria-label={`step ${value}`}>\n {value}\n </span>\n );\n }\n\n if (icon === 'right') {\n return (\n <span className={style.value} aria-label={`step ${value}`}>\n <RightIcon className={current ? style.currentRightIcon : style.rightIcon} />\n </span>\n );\n }\n\n if (icon === 'wrong') {\n return (\n <span className={style.value} aria-label={`step ${value}`}>\n <WrongIcon className={current ? style.currentWrongIcon : style.wrongIcon} />\n </span>\n );\n }\n};\n\nconst ReviewHeaderStepItem = props => {\n const {icon, current} = props;\n return (\n <div\n className={classnames(\n icon === 'right' ? style.right : null,\n icon === 'wrong' ? style.wrong : null,\n current ? style.current : style.default\n )}\n data-name=\"header-step-item\"\n >\n <Content {...props} />\n </div>\n );\n};\n\nReviewHeaderStepItem.propTypes = {\n icon: PropTypes.string,\n current: PropTypes.bool,\n value: PropTypes.string\n};\n\nexport default ReviewHeaderStepItem;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../src/atom/review-header-step-item/index.js"],"names":["Content","icon","current","value","style","rightIcon","currentRightIcon","wrongIcon","currentWrongIcon","ReviewHeaderStepItem","props","default","right","wrong","propTypes","PropTypes","string","bool"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AAIA;;;;AAEA,MAAMA,OAAO,GAAG,CAAC;AAACC,EAAAA,IAAD;AAAOC,EAAAA,OAAP;AAAgBC,EAAAA;AAAhB,CAAD,KAA4B;AAC1C,MAAI,CAACF,IAAL,EAAW;AACT,wBACE;AAAM,MAAA,SAAS,EAAEG,eAAMD,KAAvB;AAA8B,oBAAa,QAAOA,KAAM;AAAxD,OACGA,KADH,CADF;AAKD;;AAED,MAAIF,IAAI,KAAK,OAAb,EAAsB;AACpB,wBACE;AAAM,MAAA,SAAS,EAAEG,eAAMD,KAAvB;AAA8B,oBAAa,QAAOA,KAAM;AAAxD,oBACE,6BAAC,2CAAD;AAAW,MAAA,SAAS,EAAE,yBAAWC,eAAMC,SAAjB,EAA4BH,OAAO,IAAIE,eAAME,gBAA7C;AAAtB,MADF,CADF;AAKD;;AAED,MAAIL,IAAI,KAAK,OAAb,EAAsB;AACpB,wBACE;AAAM,MAAA,SAAS,EAAEG,eAAMD,KAAvB;AAA8B,oBAAa,QAAOA,KAAM;AAAxD,oBACE,6BAAC,+BAAD;AAAW,MAAA,SAAS,EAAE,yBAAWC,eAAMG,SAAjB,EAA4BL,OAAO,IAAIE,eAAMI,gBAA7C;AAAtB,MADF,CADF;AAKD;AACF,CAxBD;;AA0BA,MAAMC,oBAAoB,GAAGC,KAAK,IAAI;AACpC,QAAM;AAACT,IAAAA,IAAD;AAAOC,IAAAA;AAAP,MAAkBQ,KAAxB;AACA,sBACE;AACE,IAAA,SAAS,EAAE,yBACTN,eAAMO,OADG,EAETV,IAAI,KAAK,OAAT,IAAoBG,eAAMQ,KAFjB,EAGTX,IAAI,KAAK,OAAT,IAAoBG,eAAMS,KAHjB,EAITX,OAAO,IAAIE,eAAMF,OAJR,CADb;AAOE,iBAAU;AAPZ,kBASE,6BAAC,OAAD,EAAaQ,KAAb,CATF,CADF;AAaD,CAfD;;AAiBAD,oBAAoB,CAACK,SAArB,2CAAiC;AAC/Bb,EAAAA,IAAI,EAAEc,mBAAUC,MADe;AAE/Bd,EAAAA,OAAO,EAAEa,mBAAUE,IAFY;AAG/Bd,EAAAA,KAAK,EAAEY,mBAAUC;AAHc,CAAjC;eAMeP,oB","sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport PropTypes from 'prop-types';\nimport {\n NovaCompositionCoorpacademyCheck as RightIcon,\n NovaSolidStatusClose as WrongIcon\n} from '@coorpacademy/nova-icons';\nimport style from './style.css';\n\nconst Content = ({icon, current, value}) => {\n if (!icon) {\n return (\n <span className={style.value} aria-label={`step ${value}`}>\n {value}\n </span>\n );\n }\n\n if (icon === 'right') {\n return (\n <span className={style.value} aria-label={`step ${value}`}>\n <RightIcon className={classnames(style.rightIcon, current && style.currentRightIcon)} />\n </span>\n );\n }\n\n if (icon === 'wrong') {\n return (\n <span className={style.value} aria-label={`step ${value}`}>\n <WrongIcon className={classnames(style.wrongIcon, current && style.currentWrongIcon)} />\n </span>\n );\n }\n};\n\nconst ReviewHeaderStepItem = props => {\n const {icon, current} = props;\n return (\n <div\n className={classnames(\n style.default,\n icon === 'right' && style.right,\n icon === 'wrong' && style.wrong,\n current && style.current\n )}\n data-name=\"header-step-item\"\n >\n <Content {...props} />\n </div>\n );\n};\n\nReviewHeaderStepItem.propTypes = {\n icon: PropTypes.string,\n current: PropTypes.bool,\n value: PropTypes.string\n};\n\nexport default ReviewHeaderStepItem;\n"],"file":"index.js"}