@coorpacademy/components 11.7.3 → 11.7.4-alpha.26

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 (144) hide show
  1. package/README.md +3 -3
  2. package/es/atom/select/index.d.ts +18 -0
  3. package/es/atom/select/index.d.ts.map +1 -1
  4. package/es/atom/select/index.js +21 -4
  5. package/es/atom/select/index.js.map +1 -1
  6. package/es/molecule/answer/index.d.ts.map +1 -1
  7. package/es/molecule/answer/index.js +19 -6
  8. package/es/molecule/answer/index.js.map +1 -1
  9. package/es/molecule/brand-form-group/index.d.ts +18 -0
  10. package/es/molecule/filters/filters-wrapper.d.ts +1 -0
  11. package/es/molecule/filters/filters-wrapper.d.ts.map +1 -1
  12. package/es/molecule/filters/filters-wrapper.js +9 -5
  13. package/es/molecule/filters/filters-wrapper.js.map +1 -1
  14. package/es/molecule/filters/index.d.ts +10 -0
  15. package/es/molecule/filters/index.d.ts.map +1 -1
  16. package/es/molecule/filters/index.js +6 -3
  17. package/es/molecule/filters/index.js.map +1 -1
  18. package/es/molecule/questions/drop-down/index.d.ts +1 -0
  19. package/es/molecule/questions/drop-down/index.d.ts.map +1 -1
  20. package/es/molecule/questions/drop-down/index.js +9 -5
  21. package/es/molecule/questions/drop-down/index.js.map +1 -1
  22. package/es/molecule/questions/qcm/index.d.ts +1 -0
  23. package/es/molecule/questions/qcm/index.d.ts.map +1 -1
  24. package/es/molecule/questions/qcm/index.js +9 -5
  25. package/es/molecule/questions/qcm/index.js.map +1 -1
  26. package/es/molecule/questions/qcm-drag/index.d.ts +3 -1
  27. package/es/molecule/questions/qcm-drag/index.d.ts.map +1 -1
  28. package/es/molecule/questions/qcm-drag/index.js +9 -5
  29. package/es/molecule/questions/qcm-drag/index.js.map +1 -1
  30. package/es/molecule/questions/qcm-graphic/index.d.ts +1 -0
  31. package/es/molecule/questions/qcm-graphic/index.d.ts.map +1 -1
  32. package/es/molecule/questions/qcm-graphic/index.js +9 -5
  33. package/es/molecule/questions/qcm-graphic/index.js.map +1 -1
  34. package/es/molecule/questions/question-range/index.d.ts +1 -0
  35. package/es/molecule/questions/question-range/index.d.ts.map +1 -1
  36. package/es/molecule/questions/question-range/index.js +10 -6
  37. package/es/molecule/questions/question-range/index.js.map +1 -1
  38. package/es/molecule/questions/template/index.d.ts +6 -2
  39. package/es/molecule/questions/template/index.d.ts.map +1 -1
  40. package/es/molecule/questions/template/index.js +9 -5
  41. package/es/molecule/questions/template/index.js.map +1 -1
  42. package/es/molecule/setup-slide/index.d.ts +9 -0
  43. package/es/molecule/setup-slider/index.d.ts +9 -0
  44. package/es/organism/brand-form/index.d.ts +18 -0
  45. package/es/organism/mooc-header/index.d.ts +5 -0
  46. package/es/organism/mooc-header/index.d.ts.map +1 -1
  47. package/es/organism/mooc-header/index.js +61 -8
  48. package/es/organism/mooc-header/index.js.map +1 -1
  49. package/es/organism/mooc-header/style.css +46 -0
  50. package/es/organism/user-preferences/index.d.ts +1 -0
  51. package/es/organism/user-preferences/index.d.ts.map +1 -1
  52. package/es/organism/user-preferences/index.js +9 -5
  53. package/es/organism/user-preferences/index.js.map +1 -1
  54. package/es/organism/wizard-contents/index.d.ts +18 -0
  55. package/es/template/back-office/brand-update/index.d.ts +36 -0
  56. package/es/template/common/search-page/index.d.ts +11 -0
  57. package/es/template/common/search-page/index.d.ts.map +1 -1
  58. package/es/template/common/search-page/index.js +6 -3
  59. package/es/template/common/search-page/index.js.map +1 -1
  60. package/es/template/teams-dashboard/index.d.ts +1 -0
  61. package/lib/atom/select/index.d.ts +18 -0
  62. package/lib/atom/select/index.d.ts.map +1 -1
  63. package/lib/atom/select/index.js +26 -5
  64. package/lib/atom/select/index.js.map +1 -1
  65. package/lib/molecule/answer/index.d.ts.map +1 -1
  66. package/lib/molecule/answer/index.js +20 -6
  67. package/lib/molecule/answer/index.js.map +1 -1
  68. package/lib/molecule/brand-form-group/index.d.ts +18 -0
  69. package/lib/molecule/filters/filters-wrapper.d.ts +1 -0
  70. package/lib/molecule/filters/filters-wrapper.d.ts.map +1 -1
  71. package/lib/molecule/filters/filters-wrapper.js +9 -5
  72. package/lib/molecule/filters/filters-wrapper.js.map +1 -1
  73. package/lib/molecule/filters/index.d.ts +10 -0
  74. package/lib/molecule/filters/index.d.ts.map +1 -1
  75. package/lib/molecule/filters/index.js +6 -3
  76. package/lib/molecule/filters/index.js.map +1 -1
  77. package/lib/molecule/questions/drop-down/index.d.ts +1 -0
  78. package/lib/molecule/questions/drop-down/index.d.ts.map +1 -1
  79. package/lib/molecule/questions/drop-down/index.js +9 -5
  80. package/lib/molecule/questions/drop-down/index.js.map +1 -1
  81. package/lib/molecule/questions/qcm/index.d.ts +1 -0
  82. package/lib/molecule/questions/qcm/index.d.ts.map +1 -1
  83. package/lib/molecule/questions/qcm/index.js +9 -5
  84. package/lib/molecule/questions/qcm/index.js.map +1 -1
  85. package/lib/molecule/questions/qcm-drag/index.d.ts +3 -1
  86. package/lib/molecule/questions/qcm-drag/index.d.ts.map +1 -1
  87. package/lib/molecule/questions/qcm-drag/index.js +9 -5
  88. package/lib/molecule/questions/qcm-drag/index.js.map +1 -1
  89. package/lib/molecule/questions/qcm-graphic/index.d.ts +1 -0
  90. package/lib/molecule/questions/qcm-graphic/index.d.ts.map +1 -1
  91. package/lib/molecule/questions/qcm-graphic/index.js +9 -5
  92. package/lib/molecule/questions/qcm-graphic/index.js.map +1 -1
  93. package/lib/molecule/questions/question-range/index.d.ts +1 -0
  94. package/lib/molecule/questions/question-range/index.d.ts.map +1 -1
  95. package/lib/molecule/questions/question-range/index.js +10 -6
  96. package/lib/molecule/questions/question-range/index.js.map +1 -1
  97. package/lib/molecule/questions/template/index.d.ts +6 -2
  98. package/lib/molecule/questions/template/index.d.ts.map +1 -1
  99. package/lib/molecule/questions/template/index.js +9 -5
  100. package/lib/molecule/questions/template/index.js.map +1 -1
  101. package/lib/molecule/setup-slide/index.d.ts +9 -0
  102. package/lib/molecule/setup-slider/index.d.ts +9 -0
  103. package/lib/organism/brand-form/index.d.ts +18 -0
  104. package/lib/organism/mooc-header/index.d.ts +5 -0
  105. package/lib/organism/mooc-header/index.d.ts.map +1 -1
  106. package/lib/organism/mooc-header/index.js +60 -7
  107. package/lib/organism/mooc-header/index.js.map +1 -1
  108. package/lib/organism/mooc-header/style.css +46 -0
  109. package/lib/organism/user-preferences/index.d.ts +1 -0
  110. package/lib/organism/user-preferences/index.d.ts.map +1 -1
  111. package/lib/organism/user-preferences/index.js +9 -5
  112. package/lib/organism/user-preferences/index.js.map +1 -1
  113. package/lib/organism/wizard-contents/index.d.ts +18 -0
  114. package/lib/template/back-office/brand-update/index.d.ts +36 -0
  115. package/lib/template/common/search-page/index.d.ts +11 -0
  116. package/lib/template/common/search-page/index.d.ts.map +1 -1
  117. package/lib/template/common/search-page/index.js +6 -3
  118. package/lib/template/common/search-page/index.js.map +1 -1
  119. package/lib/template/teams-dashboard/index.d.ts +1 -0
  120. package/locales/cs/global.json +1 -0
  121. package/locales/de/global.json +1 -0
  122. package/locales/en/global.json +1 -0
  123. package/locales/es/global.json +1 -0
  124. package/locales/et/global.json +1 -0
  125. package/locales/fr/global.json +1 -0
  126. package/locales/hr/global.json +1 -0
  127. package/locales/hu/global.json +1 -0
  128. package/locales/it/global.json +1 -0
  129. package/locales/ja/global.json +1 -0
  130. package/locales/ko/global.json +1 -0
  131. package/locales/nl/global.json +1 -0
  132. package/locales/pl/global.json +1 -0
  133. package/locales/pt/global.json +1 -0
  134. package/locales/ro/global.json +1 -0
  135. package/locales/ru/global.json +1 -0
  136. package/locales/sk/global.json +1 -0
  137. package/locales/tl/global.json +1 -0
  138. package/locales/tr/global.json +1 -0
  139. package/locales/uk/global.json +1 -0
  140. package/locales/vi/global.json +1 -0
  141. package/locales/zh/global.json +1 -0
  142. package/locales/zh_TW/global.json +1 -0
  143. package/package.json +3 -3
  144. package/locales/.mtslconfig.json +0 -1
@@ -24,26 +24,30 @@ const DropDown = props => {
24
24
  options,
25
25
  onChange,
26
26
  theme: propsTheme,
27
- 'aria-label': ariaLabel
27
+ 'aria-label': ariaLabel,
28
+ groupAriaLabel
28
29
  } = props;
29
30
  const currentSelection = (0, _find2.default)('selected', options);
30
31
  const defaultTheme = !currentSelection || currentSelection.validOption === false ? 'invalid' : 'question';
31
32
  const theme = propsTheme || defaultTheme;
32
- return /*#__PURE__*/_react.default.createElement("div", {
33
- className: _style.default.wrapper
33
+ return /*#__PURE__*/_react.default.createElement("form", null, /*#__PURE__*/_react.default.createElement("div", {
34
+ className: _style.default.wrapper,
35
+ role: "group",
36
+ "aria-label": groupAriaLabel
34
37
  }, /*#__PURE__*/_react.default.createElement(_select.default, {
35
38
  "aria-label": ariaLabel,
36
39
  theme: theme,
37
40
  options: options,
38
41
  onChange: onChange
39
- }));
42
+ })));
40
43
  };
41
44
 
42
45
  DropDown.propTypes = process.env.NODE_ENV !== "production" ? {
43
46
  onChange: _select.default.propTypes.onChange,
44
47
  options: _propTypes.default.arrayOf(_propTypes.default.shape(_select.SelectOptionPropTypes)),
45
48
  theme: _select.default.propTypes.theme,
46
- 'aria-label': _propTypes.default.string
49
+ 'aria-label': _propTypes.default.string,
50
+ groupAriaLabel: _propTypes.default.string
47
51
  } : {};
48
52
  var _default = DropDown;
49
53
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["DropDown","props","options","onChange","theme","propsTheme","ariaLabel","currentSelection","defaultTheme","validOption","style","wrapper","propTypes","Select","PropTypes","arrayOf","shape","SelectOptionPropTypes","string"],"sources":["../../../../src/molecule/questions/drop-down/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {find} from 'lodash/fp';\nimport Select, {SelectOptionPropTypes} from '../../../atom/select';\nimport style from './style.css';\n\nconst DropDown = props => {\n const {options, onChange, theme: propsTheme, 'aria-label': ariaLabel} = props;\n\n const currentSelection = find('selected', options);\n const defaultTheme =\n !currentSelection || currentSelection.validOption === false ? 'invalid' : 'question';\n\n const theme = propsTheme || defaultTheme;\n\n return (\n <div className={style.wrapper}>\n <Select aria-label={ariaLabel} theme={theme} options={options} onChange={onChange} />\n </div>\n );\n};\n\nDropDown.propTypes = {\n onChange: Select.propTypes.onChange,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n theme: Select.propTypes.theme,\n 'aria-label': PropTypes.string\n};\n\nexport default DropDown;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;;;AAEA,MAAMA,QAAQ,GAAGC,KAAK,IAAI;EACxB,MAAM;IAACC,OAAD;IAAUC,QAAV;IAAoBC,KAAK,EAAEC,UAA3B;IAAuC,cAAcC;EAArD,IAAkEL,KAAxE;EAEA,MAAMM,gBAAgB,GAAG,oBAAK,UAAL,EAAiBL,OAAjB,CAAzB;EACA,MAAMM,YAAY,GAChB,CAACD,gBAAD,IAAqBA,gBAAgB,CAACE,WAAjB,KAAiC,KAAtD,GAA8D,SAA9D,GAA0E,UAD5E;EAGA,MAAML,KAAK,GAAGC,UAAU,IAAIG,YAA5B;EAEA,oBACE;IAAK,SAAS,EAAEE,cAAA,CAAMC;EAAtB,gBACE,6BAAC,eAAD;IAAQ,cAAYL,SAApB;IAA+B,KAAK,EAAEF,KAAtC;IAA6C,OAAO,EAAEF,OAAtD;IAA+D,QAAQ,EAAEC;EAAzE,EADF,CADF;AAKD,CAdD;;AAgBAH,QAAQ,CAACY,SAAT,2CAAqB;EACnBT,QAAQ,EAAEU,eAAA,CAAOD,SAAP,CAAiBT,QADR;EAEnBD,OAAO,EAAEY,kBAAA,CAAUC,OAAV,CAAkBD,kBAAA,CAAUE,KAAV,CAAgBC,6BAAhB,CAAlB,CAFU;EAGnBb,KAAK,EAAES,eAAA,CAAOD,SAAP,CAAiBR,KAHL;EAInB,cAAcU,kBAAA,CAAUI;AAJL,CAArB;eAOelB,Q"}
1
+ {"version":3,"file":"index.js","names":["DropDown","props","options","onChange","theme","propsTheme","ariaLabel","groupAriaLabel","currentSelection","defaultTheme","validOption","style","wrapper","propTypes","Select","PropTypes","arrayOf","shape","SelectOptionPropTypes","string"],"sources":["../../../../src/molecule/questions/drop-down/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {find} from 'lodash/fp';\nimport Select, {SelectOptionPropTypes} from '../../../atom/select';\nimport style from './style.css';\n\nconst DropDown = props => {\n const {options, onChange, theme: propsTheme, 'aria-label': ariaLabel, groupAriaLabel} = props;\n\n const currentSelection = find('selected', options);\n const defaultTheme =\n !currentSelection || currentSelection.validOption === false ? 'invalid' : 'question';\n\n const theme = propsTheme || defaultTheme;\n\n return (\n <form>\n <div className={style.wrapper} role=\"group\" aria-label={groupAriaLabel}>\n <Select aria-label={ariaLabel} theme={theme} options={options} onChange={onChange} />\n </div>\n </form>\n );\n};\n\nDropDown.propTypes = {\n onChange: Select.propTypes.onChange,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n theme: Select.propTypes.theme,\n 'aria-label': PropTypes.string,\n groupAriaLabel: PropTypes.string\n};\n\nexport default DropDown;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;;;AAEA,MAAMA,QAAQ,GAAGC,KAAK,IAAI;EACxB,MAAM;IAACC,OAAD;IAAUC,QAAV;IAAoBC,KAAK,EAAEC,UAA3B;IAAuC,cAAcC,SAArD;IAAgEC;EAAhE,IAAkFN,KAAxF;EAEA,MAAMO,gBAAgB,GAAG,oBAAK,UAAL,EAAiBN,OAAjB,CAAzB;EACA,MAAMO,YAAY,GAChB,CAACD,gBAAD,IAAqBA,gBAAgB,CAACE,WAAjB,KAAiC,KAAtD,GAA8D,SAA9D,GAA0E,UAD5E;EAGA,MAAMN,KAAK,GAAGC,UAAU,IAAII,YAA5B;EAEA,oBACE,wDACE;IAAK,SAAS,EAAEE,cAAA,CAAMC,OAAtB;IAA+B,IAAI,EAAC,OAApC;IAA4C,cAAYL;EAAxD,gBACE,6BAAC,eAAD;IAAQ,cAAYD,SAApB;IAA+B,KAAK,EAAEF,KAAtC;IAA6C,OAAO,EAAEF,OAAtD;IAA+D,QAAQ,EAAEC;EAAzE,EADF,CADF,CADF;AAOD,CAhBD;;AAkBAH,QAAQ,CAACa,SAAT,2CAAqB;EACnBV,QAAQ,EAAEW,eAAA,CAAOD,SAAP,CAAiBV,QADR;EAEnBD,OAAO,EAAEa,kBAAA,CAAUC,OAAV,CAAkBD,kBAAA,CAAUE,KAAV,CAAgBC,6BAAhB,CAAlB,CAFU;EAGnBd,KAAK,EAAEU,eAAA,CAAOD,SAAP,CAAiBT,KAHL;EAInB,cAAcW,kBAAA,CAAUI,MAJL;EAKnBZ,cAAc,EAAEQ,kBAAA,CAAUI;AALP,CAArB;eAQenB,Q"}
@@ -31,6 +31,7 @@ declare namespace QCM {
31
31
  onClick: PropTypes.Requireable<(...args: any[]) => any>;
32
32
  'aria-label': PropTypes.Requireable<string>;
33
33
  }> | null | undefined)[]>;
34
+ const groupAriaLabel: PropTypes.Requireable<string>;
34
35
  }
35
36
  }
36
37
  import PropTypes from "prop-types";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/questions/qcm/index.js"],"names":[],"mappings":";AASA,kEAiDC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/questions/qcm/index.js"],"names":[],"mappings":";AASA,kEAmDC"}
@@ -29,7 +29,8 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
29
29
 
30
30
  const QCM = (props, legacyContext) => {
31
31
  const {
32
- answers
32
+ answers,
33
+ groupAriaLabel
33
34
  } = props;
34
35
  const longestAnswer = (0, _maxBy.default)(({
35
36
  title
@@ -72,10 +73,12 @@ const QCM = (props, legacyContext) => {
72
73
  }
73
74
  }));
74
75
  }), [answers, longestAnswer, primarySkinColor]);
75
- return /*#__PURE__*/_react.default.createElement("div", {
76
+ return /*#__PURE__*/_react.default.createElement("form", null, /*#__PURE__*/_react.default.createElement("div", {
76
77
  "data-name": "qcm",
77
- className: _style.default.wrapper
78
- }, answersViews);
78
+ className: _style.default.wrapper,
79
+ role: "group",
80
+ "aria-label": groupAriaLabel
81
+ }, answersViews));
79
82
  };
80
83
 
81
84
  QCM.contextTypes = {
@@ -87,7 +90,8 @@ QCM.propTypes = process.env.NODE_ENV !== "production" ? {
87
90
  selected: _propTypes.default.bool,
88
91
  onClick: _propTypes.default.func,
89
92
  'aria-label': _propTypes.default.string
90
- }))
93
+ })),
94
+ groupAriaLabel: _propTypes.default.string
91
95
  } : {};
92
96
  var _default = QCM;
93
97
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["QCM","props","legacyContext","answers","longestAnswer","maxBy","title","length","skin","GetSkinFromContext","primarySkinColor","getOr","answersViews","useMemo","map","answer","key","onClick","selected","ariaLabel","longAnswerClass","style","selectedAnswerClass","selectedAnswer","unselectedAnswer","classnames","innerHTML","boxShadow","getShadowBoxColorFromPrimary","backgroundColor","background","answerText","__html","wrapper","contextTypes","Provider","childContextTypes","propTypes","PropTypes","arrayOf","shape","string","bool","func"],"sources":["../../../../src/molecule/questions/qcm/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport classnames from 'classnames';\nimport PropTypes from 'prop-types';\nimport getOr from 'lodash/fp/getOr';\nimport maxBy from 'lodash/fp/maxBy';\nimport Provider, {GetSkinFromContext} from '../../../atom/provider';\nimport {getShadowBoxColorFromPrimary} from '../../../util/get-shadow-box-color-from-primary';\nimport style from './style.css';\n\nconst QCM = (props, legacyContext) => {\n const {answers} = props;\n const longestAnswer = maxBy(({title}) => title.length, answers);\n const skin = GetSkinFromContext(legacyContext);\n const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);\n\n const answersViews = useMemo(\n () =>\n answers.map((answer, key) => {\n const {onClick, title, selected, 'aria-label': ariaLabel} = answer;\n const longAnswerClass = longestAnswer.title === title ? style.longestAnswer : style.answer;\n const selectedAnswerClass = selected ? style.selectedAnswer : style.unselectedAnswer;\n\n return (\n <div\n data-name=\"answer\"\n aria-label={ariaLabel || title}\n className={classnames(longAnswerClass, style.innerHTML, selectedAnswerClass)}\n onClick={onClick}\n style={{\n ...(selected && {\n boxShadow: `0 4px 16px ${getShadowBoxColorFromPrimary(primarySkinColor)}`\n })\n }}\n data-selected={selected}\n key={key}\n >\n <div\n data-name=\"answer-background\"\n style={{backgroundColor: selected ? primarySkinColor : '#F4F4F5' /* cm_grey_75 */}}\n className={style.background}\n />\n <span\n data-name=\"answer-label\"\n className={style.answerText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n </div>\n );\n }),\n [answers, longestAnswer, primarySkinColor]\n );\n\n return (\n <div data-name=\"qcm\" className={style.wrapper}>\n {answersViews}\n </div>\n );\n};\n\nQCM.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nQCM.propTypes = {\n answers: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string,\n selected: PropTypes.bool,\n onClick: PropTypes.func,\n 'aria-label': PropTypes.string\n })\n )\n};\n\nexport default QCM;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,GAAG,GAAG,CAACC,KAAD,EAAQC,aAAR,KAA0B;EACpC,MAAM;IAACC;EAAD,IAAYF,KAAlB;EACA,MAAMG,aAAa,GAAG,IAAAC,cAAA,EAAM,CAAC;IAACC;EAAD,CAAD,KAAaA,KAAK,CAACC,MAAzB,EAAiCJ,OAAjC,CAAtB;EACA,MAAMK,IAAI,GAAG,IAAAC,4BAAA,EAAmBP,aAAnB,CAAb;EACA,MAAMQ,gBAAgB,GAAG,IAAAC,cAAA,EAAM,SAAN,EAAiB,gBAAjB,EAAmCH,IAAnC,CAAzB;EAEA,MAAMI,YAAY,GAAG,IAAAC,cAAA,EACnB,MACEV,OAAO,CAACW,GAAR,CAAY,CAACC,MAAD,EAASC,GAAT,KAAiB;IAC3B,MAAM;MAACC,OAAD;MAAUX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SAAJ,2CAAgB;EACdlC,OAAO,EAAEmC,kBAAA,CAAUC,OAAV,CACPD,kBAAA,CAAUE,KAAV,CAAgB;IACdlC,KAAK,EAAEgC,kBAAA,CAAUG,MADH;IAEdvB,QAAQ,EAAEoB,kBAAA,CAAUI,IAFN;IAGdzB,OAAO,EAAEqB,kBAAA,CAAUK,IAHL;IAId,cAAcL,kBAAA,CAAUG;EAJV,CAAhB,CADO;AADK,CAAhB;eAWezC,G"}
1
+ {"version":3,"file":"index.js","names":["QCM","props","legacyContext","answers","groupAriaLabel","longestAnswer","maxBy","title","length","skin","GetSkinFromContext","primarySkinColor","getOr","answersViews","useMemo","map","answer","key","onClick","selected","ariaLabel","longAnswerClass","style","selectedAnswerClass","selectedAnswer","unselectedAnswer","classnames","innerHTML","boxShadow","getShadowBoxColorFromPrimary","backgroundColor","background","answerText","__html","wrapper","contextTypes","Provider","childContextTypes","propTypes","PropTypes","arrayOf","shape","string","bool","func"],"sources":["../../../../src/molecule/questions/qcm/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport classnames from 'classnames';\nimport PropTypes from 'prop-types';\nimport getOr from 'lodash/fp/getOr';\nimport maxBy from 'lodash/fp/maxBy';\nimport Provider, {GetSkinFromContext} from '../../../atom/provider';\nimport {getShadowBoxColorFromPrimary} from '../../../util/get-shadow-box-color-from-primary';\nimport style from './style.css';\n\nconst QCM = (props, legacyContext) => {\n const {answers, groupAriaLabel} = props;\n const longestAnswer = maxBy(({title}) => title.length, answers);\n const skin = GetSkinFromContext(legacyContext);\n const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);\n\n const answersViews = useMemo(\n () =>\n answers.map((answer, key) => {\n const {onClick, title, selected, 'aria-label': ariaLabel} = answer;\n const longAnswerClass = longestAnswer.title === title ? style.longestAnswer : style.answer;\n const selectedAnswerClass = selected ? style.selectedAnswer : style.unselectedAnswer;\n\n return (\n <div\n data-name=\"answer\"\n aria-label={ariaLabel || title}\n className={classnames(longAnswerClass, style.innerHTML, selectedAnswerClass)}\n onClick={onClick}\n style={{\n ...(selected && {\n boxShadow: `0 4px 16px ${getShadowBoxColorFromPrimary(primarySkinColor)}`\n })\n }}\n data-selected={selected}\n key={key}\n >\n <div\n data-name=\"answer-background\"\n style={{backgroundColor: selected ? primarySkinColor : '#F4F4F5' /* cm_grey_75 */}}\n className={style.background}\n />\n <span\n data-name=\"answer-label\"\n className={style.answerText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n </div>\n );\n }),\n [answers, longestAnswer, primarySkinColor]\n );\n\n return (\n <form>\n <div data-name=\"qcm\" className={style.wrapper} role=\"group\" aria-label={groupAriaLabel}>\n {answersViews}\n </div>\n </form>\n );\n};\n\nQCM.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nQCM.propTypes = {\n answers: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string,\n selected: PropTypes.bool,\n onClick: PropTypes.func,\n 'aria-label': PropTypes.string\n })\n ),\n groupAriaLabel: PropTypes.string\n};\n\nexport default QCM;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,GAAG,GAAG,CAACC,KAAD,EAAQC,aAAR,KAA0B;EACpC,MAAM;IAACC,OAAD;IAAUC;EAAV,IAA4BH,KAAlC;EACA,MAAMI,aAAa,GAAG,IAAAC,cAAA,EAAM,CAAC;IAACC;EAAD,CAAD,KAAaA,KAAK,CAACC,MAAzB,EAAiCL,OAAjC,CAAtB;EACA,MAAMM,IAAI,GAAG,IAAAC,4BAAA,EAAmBR,aAAnB,CAAb;EACA,MAAMS,gBAAgB,GAAG,IAAAC,cAAA,EAAM,SAAN,EAAiB,gBAAjB,EAAmCH,IAAnC,CAAzB;EAEA,MAAMI,YAAY,GAAG,IAAAC,cAAA,EACnB,MACEX,OAAO,CAACY,GAAR,CAAY,CAACC,MAAD,EAASC,GAAT,KAAiB;IAC3B,MAAM;MAACC,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AE2B,iBAAA,CAASC,iBAAT,CAA2B5B;AADhB,CAAnB;AAIAT,GAAG,CAACsC,SAAJ,2CAAgB;EACdnC,OAAO,EAAEoC,kBAAA,CAAUC,OAAV,CACPD,kBAAA,CAAUE,KAAV,CAAgB;IACdlC,KAAK,EAAEgC,kBAAA,CAAUG,MADH;IAEdvB,QAAQ,EAAEoB,kBAAA,CAAUI,IAFN;IAGdzB,OAAO,EAAEqB,kBAAA,CAAUK,IAHL;IAId,cAAcL,kBAAA,CAAUG;EAJV,CAAhB,CADO,CADK;EASdtC,cAAc,EAAEmC,kBAAA,CAAUG;AATZ,CAAhB;eAYe1C,G"}
@@ -1,13 +1,15 @@
1
1
  export default QcmDrag;
2
- declare function QcmDrag({ answers, help }: {
2
+ declare function QcmDrag({ answers, help, groupAriaLabel }: {
3
3
  answers: any;
4
4
  help: any;
5
+ groupAriaLabel: any;
5
6
  }, legacyContext: any): JSX.Element;
6
7
  declare namespace QcmDrag {
7
8
  namespace propTypes {
8
9
  export { AnswersPropTypes as answers };
9
10
  import help = help;
10
11
  export { help };
12
+ export const groupAriaLabel: PropTypes.Requireable<string>;
11
13
  }
12
14
  namespace contextTypes {
13
15
  const skin: PropTypes.Requireable<PropTypes.InferProps<{
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/questions/qcm-drag/index.js"],"names":[],"mappings":";AAkGA;;;oCAYC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAtGD;;;;;;0BAQE;AA8BF;;;;gBA4CC;;;;;;;;;;;AAxED;;gBAA6E"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/questions/qcm-drag/index.js"],"names":[],"mappings":";AAkGA;;;;oCAcC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAxGD;;;;;;0BAQE;AA8BF;;;;gBA4CC;;;;;;;;;;;AAxED;;gBAA6E"}
@@ -136,12 +136,15 @@ SelectedAnswerSections.propTypes = process.env.NODE_ENV !== "production" ? {
136
136
 
137
137
  const QcmDrag = ({
138
138
  answers,
139
- help
139
+ help,
140
+ groupAriaLabel
140
141
  }, legacyContext) => {
141
142
  const skin = (0, _provider.GetSkinFromContext)(legacyContext);
142
143
  const primarySkinColor = (0, _getOr2.default)('#00B0FF', 'common.primary', skin);
143
- return /*#__PURE__*/_react.default.createElement("div", {
144
- className: _style.default.wrapper
144
+ return /*#__PURE__*/_react.default.createElement("form", null, /*#__PURE__*/_react.default.createElement("div", {
145
+ className: _style.default.wrapper,
146
+ role: "group",
147
+ "aria-label": groupAriaLabel
145
148
  }, /*#__PURE__*/_react.default.createElement(SelectedAnswerSections, {
146
149
  answers: answers,
147
150
  help: help,
@@ -151,12 +154,13 @@ const QcmDrag = ({
151
154
  className: _style.default.answers
152
155
  }, /*#__PURE__*/_react.default.createElement(Choices, {
153
156
  answers: answers
154
- })));
157
+ }))));
155
158
  };
156
159
 
157
160
  QcmDrag.propTypes = process.env.NODE_ENV !== "production" ? {
158
161
  answers: AnswersPropTypes,
159
- help: SelectedAnswerSections.propTypes.help
162
+ help: SelectedAnswerSections.propTypes.help,
163
+ groupAriaLabel: _propTypes.default.string
160
164
  } : {};
161
165
  QcmDrag.contextTypes = {
162
166
  skin: _provider.default.childContextTypes.skin
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["AnswersPropTypes","PropTypes","arrayOf","shape","onClick","func","order","number","selected","bool","title","string","help","EmptyView","style","emptySpan","propTypes","Choices","answers","answersViews","map","answer","key","classnames","invisibleAnswer","unselected","innerHTML","__html","choices","SelectedAnswerSections","backgroundColor","selectedAnswers","selectedAnswersViews","boxShadow","getShadowBoxColorFromPrimary","background","content","selectedAnswerText","length","emptyAnswers","QcmDrag","legacyContext","skin","GetSkinFromContext","primarySkinColor","wrapper","contextTypes","Provider","childContextTypes"],"sources":["../../../../src/molecule/questions/qcm-drag/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {pipe, filter, orderBy, getOr} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Provider, {GetSkinFromContext} from '../../../atom/provider';\nimport {getShadowBoxColorFromPrimary} from '../../../util/get-shadow-box-color-from-primary';\nimport style from './style.css';\n\nconst AnswersPropTypes = PropTypes.arrayOf(\n PropTypes.shape({\n onClick: PropTypes.func,\n order: PropTypes.number,\n selected: PropTypes.bool,\n title: PropTypes.string,\n help: PropTypes.string\n })\n);\n\nconst EmptyView = ({help}) => <span className={style.emptySpan}>{help}</span>;\n\nEmptyView.propTypes = {\n help: PropTypes.string\n};\n\nconst Choices = ({answers}) => {\n const answersViews = answers.map((answer, key) => {\n const {onClick, title, selected} = answer;\n return (\n <div\n className={classnames(selected ? style.invisibleAnswer : style.unselected, style.innerHTML)}\n data-name=\"answer\"\n onClick={onClick}\n key={key}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n );\n });\n\n return <div className={style.choices}>{answersViews}</div>;\n};\n\nChoices.propTypes = {\n answers: AnswersPropTypes\n};\n\nconst SelectedAnswerSections = ({answers, help, backgroundColor}) => {\n const selectedAnswers = pipe(filter('selected'), orderBy('order', 'asc'))(answers);\n const selectedAnswersViews = selectedAnswers.map((answer, key) => {\n const {onClick, title} = answer;\n return (\n <div\n data-selected=\"true\"\n onClick={onClick}\n key={key}\n data-name=\"selectedAnswer\"\n className={style.selected}\n style={{\n boxShadow: `0px 4px 16px ${getShadowBoxColorFromPrimary(backgroundColor)}`\n }}\n >\n <div\n data-name=\"answerBackground\"\n style={{\n backgroundColor\n }}\n className={style.background}\n />\n <div className={style.content}>\n <span\n data-name=\"answerContent\"\n className={classnames(style.selectedAnswerText, style.innerHTML)}\n title={title}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n </div>\n </div>\n );\n });\n\n if (selectedAnswersViews.length > 0) {\n return <div className={style.selectedAnswers}>{selectedAnswersViews}</div>;\n } else {\n return (\n <div className={style.emptyAnswers}>\n <EmptyView help={help} />\n </div>\n );\n }\n};\n\nSelectedAnswerSections.propTypes = {\n answers: AnswersPropTypes,\n help: EmptyView.propTypes.help,\n backgroundColor: PropTypes.string\n};\n\nconst QcmDrag = ({answers, help}, legacyContext) => {\n const skin = GetSkinFromContext(legacyContext);\n const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);\n\n return (\n <div className={style.wrapper}>\n <SelectedAnswerSections answers={answers} help={help} backgroundColor={primarySkinColor} />\n <div data-name=\"qcm-drag-answers\" className={style.answers}>\n <Choices answers={answers} />\n </div>\n </div>\n );\n};\n\nQcmDrag.propTypes = {\n answers: AnswersPropTypes,\n help: SelectedAnswerSections.propTypes.help\n};\n\nQcmDrag.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nexport default QcmDrag;\n"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,gBAAN,2CAAyBC,kBAAA,CAAUC,OAAV,CACvBD,kBAAA,CAAUE,KAAV,CAAgB;EACdC,OAAO,EAAEH,kBAAA,CAAUI,IADL;EAEdC,KAAK,EAAEL,kBAAA,CAAUM,MAFH;EAGdC,QAAQ,EAAEP,kBAAA,CAAUQ,IAHN;EAIdC,KAAK,EAAET,kBAAA,CAAUU,MAJH;EAKdC,IAAI,EAAEX,kBAAA,CAAUU;AALF,CAAhB,CADuB,CAAzB;;AAUA,MAAME,SAAS,GAAG,CAAC;EAACD;AAAD,CAAD,kBAAY;EAAM,SAAS,EAAEE,cAAA,CAAMC;AAAvB,GAAmCH,IAAnC,CAA9B;;AAEAC,SAAS,CAACG,SAAV,2CAAsB;EACpBJ,IAAI,EAAEX,kBAAA,CAAUU;AADI,CAAtB;;AAIA,MAAMM,OAAO,GAAG,CAAC;EAACC;AAAD,CAAD,KAAe;EAC7B,MAAMC,YAAY,GAAGD,OAAO,CAACE,GAAR,CAAY,CAACC,MAAD,EAASC,GAAT,KAAiB;IAChD,MAAM;MAAClB,OAAD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CAFF,CADF;AAQD,CAZD;;AAcAsB,OAAO,CAACxB,SAAR,2CAAoB;EAClBE,OAAO,EAAElB,gBADS;EAElBY,IAAI,EAAEiB,sBAAsB,CAACb,SAAvB,CAAiCJ;AAFrB,CAApB;AAKA4B,OAAO,CAACM,YAAR,GAAuB;EACrBJ,IAAI,EAAEK,iBAAA,CAASC,iBAAT,CAA2BN;AADZ,CAAvB;eAIeF,O"}
1
+ {"version":3,"file":"index.js","names":["AnswersPropTypes","PropTypes","arrayOf","shape","onClick","func","order","number","selected","bool","title","string","help","EmptyView","style","emptySpan","propTypes","Choices","answers","answersViews","map","answer","key","classnames","invisibleAnswer","unselected","innerHTML","__html","choices","SelectedAnswerSections","backgroundColor","selectedAnswers","selectedAnswersViews","boxShadow","getShadowBoxColorFromPrimary","background","content","selectedAnswerText","length","emptyAnswers","QcmDrag","groupAriaLabel","legacyContext","skin","GetSkinFromContext","primarySkinColor","wrapper","contextTypes","Provider","childContextTypes"],"sources":["../../../../src/molecule/questions/qcm-drag/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {pipe, filter, orderBy, getOr} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Provider, {GetSkinFromContext} from '../../../atom/provider';\nimport {getShadowBoxColorFromPrimary} from '../../../util/get-shadow-box-color-from-primary';\nimport style from './style.css';\n\nconst AnswersPropTypes = PropTypes.arrayOf(\n PropTypes.shape({\n onClick: PropTypes.func,\n order: PropTypes.number,\n selected: PropTypes.bool,\n title: PropTypes.string,\n help: PropTypes.string\n })\n);\n\nconst EmptyView = ({help}) => <span className={style.emptySpan}>{help}</span>;\n\nEmptyView.propTypes = {\n help: PropTypes.string\n};\n\nconst Choices = ({answers}) => {\n const answersViews = answers.map((answer, key) => {\n const {onClick, title, selected} = answer;\n return (\n <div\n className={classnames(selected ? style.invisibleAnswer : style.unselected, style.innerHTML)}\n data-name=\"answer\"\n onClick={onClick}\n key={key}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n );\n });\n\n return <div className={style.choices}>{answersViews}</div>;\n};\n\nChoices.propTypes = {\n answers: AnswersPropTypes\n};\n\nconst SelectedAnswerSections = ({answers, help, backgroundColor}) => {\n const selectedAnswers = pipe(filter('selected'), orderBy('order', 'asc'))(answers);\n const selectedAnswersViews = selectedAnswers.map((answer, key) => {\n const {onClick, title} = answer;\n return (\n <div\n data-selected=\"true\"\n onClick={onClick}\n key={key}\n data-name=\"selectedAnswer\"\n className={style.selected}\n style={{\n boxShadow: `0px 4px 16px ${getShadowBoxColorFromPrimary(backgroundColor)}`\n }}\n >\n <div\n data-name=\"answerBackground\"\n style={{\n backgroundColor\n }}\n className={style.background}\n />\n <div className={style.content}>\n <span\n data-name=\"answerContent\"\n className={classnames(style.selectedAnswerText, style.innerHTML)}\n title={title}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n </div>\n </div>\n );\n });\n\n if (selectedAnswersViews.length > 0) {\n return <div className={style.selectedAnswers}>{selectedAnswersViews}</div>;\n } else {\n return (\n <div className={style.emptyAnswers}>\n <EmptyView help={help} />\n </div>\n );\n }\n};\n\nSelectedAnswerSections.propTypes = {\n answers: AnswersPropTypes,\n help: EmptyView.propTypes.help,\n backgroundColor: PropTypes.string\n};\n\nconst QcmDrag = ({answers, help, groupAriaLabel}, legacyContext) => {\n const skin = GetSkinFromContext(legacyContext);\n const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);\n\n return (\n <form>\n <div className={style.wrapper} role=\"group\" aria-label={groupAriaLabel}>\n <SelectedAnswerSections answers={answers} help={help} backgroundColor={primarySkinColor} />\n <div data-name=\"qcm-drag-answers\" className={style.answers}>\n <Choices answers={answers} />\n </div>\n </div>\n </form>\n );\n};\n\nQcmDrag.propTypes = {\n answers: AnswersPropTypes,\n help: SelectedAnswerSections.propTypes.help,\n groupAriaLabel: PropTypes.string\n};\n\nQcmDrag.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\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;
34
34
  }> | null | undefined)[]>;
35
+ const groupAriaLabel: PropTypes.Requireable<string>;
35
36
  }
36
37
  }
37
38
  import PropTypes from "prop-types";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/questions/qcm-graphic/index.js"],"names":[],"mappings":";AAQA,uEAuDC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/questions/qcm-graphic/index.js"],"names":[],"mappings":";AAQA,uEA8DC"}
@@ -27,7 +27,8 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
27
27
 
28
28
  const QCMImage = (props, legacyContext) => {
29
29
  const {
30
- answers
30
+ answers,
31
+ groupAriaLabel
31
32
  } = props;
32
33
  const skin = (0, _provider.GetSkinFromContext)(legacyContext);
33
34
  const primarySkinColor = (0, _getOr2.default)('#00B0FF', 'common.primary', skin);
@@ -76,10 +77,12 @@ const QCMImage = (props, legacyContext) => {
76
77
  }
77
78
  }))));
78
79
  });
79
- return /*#__PURE__*/_react.default.createElement("div", {
80
+ return /*#__PURE__*/_react.default.createElement("form", null, /*#__PURE__*/_react.default.createElement("div", {
80
81
  "data-name": "qcm-graphic-wrapper",
81
- className: _style.default.wrapper
82
- }, answersViews);
82
+ className: _style.default.wrapper,
83
+ role: "group",
84
+ "aria-label": groupAriaLabel
85
+ }, answersViews));
83
86
  };
84
87
 
85
88
  QCMImage.contextTypes = {
@@ -92,7 +95,8 @@ QCMImage.propTypes = process.env.NODE_ENV !== "production" ? {
92
95
  onClick: _propTypes.default.func,
93
96
  image: _propTypes.default.string,
94
97
  ariaLabel: _propTypes.default.string
95
- }))
98
+ })),
99
+ groupAriaLabel: _propTypes.default.string
96
100
  } : {};
97
101
  var _default = QCMImage;
98
102
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["QCMImage","props","legacyContext","answers","skin","GetSkinFromContext","primarySkinColor","answersViews","map","answer","key","onClick","title","selected","image","ariaLabel","boxShadow","getShadowBoxColorFromPrimary","style","backgroundColor","background","content","imageWrapper","backgroundImage","titleWrapper","classnames","innerHTML","__html","wrapper","contextTypes","Provider","childContextTypes","propTypes","PropTypes","arrayOf","shape","string","bool","func"],"sources":["../../../../src/molecule/questions/qcm-graphic/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Provider, {GetSkinFromContext} from '../../../atom/provider';\nimport {getShadowBoxColorFromPrimary} from '../../../util/get-shadow-box-color-from-primary';\nimport style from './style.css';\n\nconst QCMImage = (props, legacyContext) => {\n const {answers} = props;\n const skin = GetSkinFromContext(legacyContext);\n const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);\n\n const answersViews = answers.map((answer, key) => {\n const {onClick, title, selected, image, ariaLabel} = answer;\n\n return (\n <div\n onClick={onClick}\n data-selected={selected}\n data-name=\"answerGraphic\"\n style={{\n ...(selected && {\n boxShadow: `0 4px 16px ${getShadowBoxColorFromPrimary(primarySkinColor)}`\n })\n }}\n className={selected ? style.selected : style.answer}\n key={key}\n >\n <div\n data-name=\"answerBackground\"\n style={{\n backgroundColor: selected ? primarySkinColor : '#F4F4F5'\n }}\n className={style.background}\n />\n <div data-name=\"answerContent\" className={style.content}>\n <div\n className={style.imageWrapper}\n data-name=\"answerImage\"\n aria-label={ariaLabel || title}\n style={{\n backgroundImage: `url(${image})`\n }}\n />\n <div data-name=\"answerText\" className={style.titleWrapper}>\n <div\n title={title}\n className={classnames(style.title, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n </div>\n </div>\n </div>\n );\n });\n\n return (\n <div data-name=\"qcm-graphic-wrapper\" className={style.wrapper}>\n {answersViews}\n </div>\n );\n};\n\nQCMImage.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nQCMImage.propTypes = {\n answers: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string,\n selected: PropTyp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EADF,eASE;MAAK,aAAU,YAAf;MAA4B,SAAS,EAAEI,cAAA,CAAMM;IAA7C,gBACE;MACE,KAAK,EAAEZ,KADT;MAEE,SAAS,EAAE,IAAAa,mBAAA,EAAWP,cAAA,CAAMN,KAAjB,EAAwBM,cAAA,CAAMQ,SAA9B,CAFb,CAGE;MAHF;MAIE,uBAAuB,EAAE;QAACC,MAAM,EAAEf;MAAT;IAJ3B,EADF,CATF,CAnBF,CADF;EAwCD,CA3CoB,CAArB;EA6CA,oBACE;IAAK,aAAU,qBAAf;IAAqC,SAAS,EAAEM,cAAA,CAAMU;EAAtD,GACGrB,YADH,CADF;AAKD,CAvDD;;AAyDAP,QAAQ,CAAC6B,YAAT,GAAwB;EACtBzB,IAAI,EAAE0B,iBAAA,CAASC,iBAAT,CAA2B3B;AADX,CAAxB;AAIAJ,QAAQ,CAACgC,SAAT,2CAAqB;EACnB7B,OAAO,EAAE8B,kBAAA,CAAUC,OAAV,CACPD,kBAAA,CAAUE,KAAV,CAAgB;IACdvB,KAAK,EAAEqB,kBAAA,CAAUG,MADH;IAEdvB,QAAQ,EAAEoB,kBAAA,CAAUI,IAFN;IAGd1B,OAAO,EAAEsB,kBAAA,CAAUK,IAHL;IAIdxB,KAAK,EAAEmB,kBAAA,CAAUG,MAJH;IAKdrB,SAAS,EAAEkB,kBAAA,CAAUG;EALP,CAAhB,CADO;AADU,CAArB;eAYepC,Q"}
1
+ {"version":3,"file":"index.js","names":["QCMImage","props","legacyContext","answers","groupAriaLabel","skin","GetSkinFromContext","primarySkinColor","answersViews","map","answer","key","onClick","title","selected","image","ariaLabel","boxShadow","getShadowBoxColorFromPrimary","style","backgroundColor","background","content","imageWrapper","backgroundImage","titleWrapper","classnames","innerHTML","__html","wrapper","contextTypes","Provider","childContextTypes","propTypes","PropTypes","arrayOf","shape","string","bool","func"],"sources":["../../../../src/molecule/questions/qcm-graphic/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Provider, {GetSkinFromContext} from '../../../atom/provider';\nimport {getShadowBoxColorFromPrimary} from '../../../util/get-shadow-box-color-from-primary';\nimport style from './style.css';\n\nconst QCMImage = (props, legacyContext) => {\n const {answers, groupAriaLabel} = props;\n const skin = GetSkinFromContext(legacyContext);\n const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);\n\n const answersViews = answers.map((answer, key) => {\n const {onClick, title, selected, image, ariaLabel} = answer;\n\n return (\n <div\n onClick={onClick}\n data-selected={selected}\n data-name=\"answerGraphic\"\n style={{\n ...(selected && {\n boxShadow: `0 4px 16px ${getShadowBoxColorFromPrimary(primarySkinColor)}`\n })\n }}\n className={selected ? style.selected : style.answer}\n key={key}\n >\n <div\n data-name=\"answerBackground\"\n style={{\n backgroundColor: selected ? primarySkinColor : '#F4F4F5'\n }}\n className={style.background}\n />\n <div data-name=\"answerContent\" className={style.content}>\n <div\n className={style.imageWrapper}\n data-name=\"answerImage\"\n aria-label={ariaLabel || title}\n style={{\n backgroundImage: `url(${image})`\n }}\n />\n <div data-name=\"answerText\" className={style.titleWrapper}>\n <div\n title={title}\n className={classnames(style.title, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n </div>\n </div>\n </div>\n );\n });\n\n return (\n <form>\n <div\n data-name=\"qcm-graphic-wrapper\"\n className={style.wrapper}\n role=\"group\"\n aria-label={groupAriaLabel}\n >\n {answersViews}\n </div>\n </form>\n );\n};\n\nQCMImage.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nQCMImage.propTypes = {\n answers: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string,\n selected: PropTypes.bool,\n onClick: PropTypes.func,\n image: PropTypes.string,\n ariaLabel: PropTypes.string\n })\n ),\n groupAriaLabel: PropTypes.string\n};\n\nexport default QCMImage;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;;AA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cAAA,CAAMN,KAAjB,EAAwBM,cAAA,CAAMQ,SAA9B,CAFb,CAGE;MAHF;MAIE,uBAAuB,EAAE;QAACC,MAAM,EAAEf;MAAT;IAJ3B,EADF,CATF,CAnBF,CADF;EAwCD,CA3CoB,CAArB;EA6CA,oBACE,wDACE;IACE,aAAU,qBADZ;IAEE,SAAS,EAAEM,cAAA,CAAMU,OAFnB;IAGE,IAAI,EAAC,OAHP;IAIE,cAAYzB;EAJd,GAMGI,YANH,CADF,CADF;AAYD,CA9DD;;AAgEAR,QAAQ,CAAC8B,YAAT,GAAwB;EACtBzB,IAAI,EAAE0B,iBAAA,CAASC,iBAAT,CAA2B3B;AADX,CAAxB;AAIAL,QAAQ,CAACiC,SAAT,2CAAqB;EACnB9B,OAAO,EAAE+B,kBAAA,CAAUC,OAAV,CACPD,kBAAA,CAAUE,KAAV,CAAgB;IACdvB,KAAK,EAAEqB,kBAAA,CAAUG,MADH;IAEdvB,QAAQ,EAAEoB,kBAAA,CAAUI,IAFN;IAGd1B,OAAO,EAAEsB,kBAAA,CAAUK,IAHL;IAIdxB,KAAK,EAAEmB,kBAAA,CAAUG,MAJH;IAKdrB,SAAS,EAAEkB,kBAAA,CAAUG;EALP,CAAhB,CADO,CADU;EAUnBjC,cAAc,EAAE8B,kBAAA,CAAUG;AAVP,CAArB;eAaerC,Q"}
@@ -28,6 +28,7 @@ declare namespace QuestionRange {
28
28
  title: PropTypes.Requireable<string>;
29
29
  minLabel: PropTypes.Requireable<string>;
30
30
  maxLabel: PropTypes.Requireable<string>;
31
+ groupAriaLabel: PropTypes.Requireable<string>;
31
32
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
32
33
  onChangeEnd: PropTypes.Requireable<(...args: any[]) => any>;
33
34
  multi: PropTypes.Requireable<boolean>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/questions/question-range/index.js"],"names":[],"mappings":";AAQA,4EAiCC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/questions/question-range/index.js"],"names":[],"mappings":";AAQA,4EAmCC"}
@@ -17,7 +17,7 @@ var _range = _interopRequireDefault(require("../../../atom/range"));
17
17
 
18
18
  var _style = _interopRequireDefault(require("./style.css"));
19
19
 
20
- const _excluded = ["title", "minLabel", "maxLabel"];
20
+ const _excluded = ["title", "minLabel", "maxLabel", "groupAriaLabel"];
21
21
 
22
22
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
23
 
@@ -33,7 +33,8 @@ const QuestionRange = (props, legacyContext) => {
33
33
  const {
34
34
  title,
35
35
  minLabel,
36
- maxLabel
36
+ maxLabel,
37
+ groupAriaLabel
37
38
  } = props,
38
39
  rangeProps = _objectWithoutPropertiesLoose(props, _excluded);
39
40
 
@@ -42,8 +43,10 @@ const QuestionRange = (props, legacyContext) => {
42
43
  const titleStyle = {
43
44
  color: defaultColor
44
45
  };
45
- return /*#__PURE__*/_react.default.createElement("div", {
46
- className: _style.default.wrapper
46
+ return /*#__PURE__*/_react.default.createElement("form", null, /*#__PURE__*/_react.default.createElement("div", {
47
+ className: _style.default.wrapper,
48
+ role: "group",
49
+ "aria-label": groupAriaLabel
47
50
  }, /*#__PURE__*/_react.default.createElement("span", {
48
51
  style: titleStyle,
49
52
  className: (0, _classnames.default)(_style.default.title, _style.default.innerHTML) // eslint-disable-next-line react/no-danger
@@ -65,7 +68,7 @@ const QuestionRange = (props, legacyContext) => {
65
68
  dangerouslySetInnerHTML: {
66
69
  __html: maxLabel
67
70
  }
68
- })));
71
+ }))));
69
72
  };
70
73
 
71
74
  QuestionRange.contextTypes = {
@@ -74,7 +77,8 @@ QuestionRange.contextTypes = {
74
77
  QuestionRange.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, _range.default.propTypes, {
75
78
  title: _propTypes.default.string,
76
79
  minLabel: _propTypes.default.string,
77
- maxLabel: _propTypes.default.string
80
+ maxLabel: _propTypes.default.string,
81
+ groupAriaLabel: _propTypes.default.string
78
82
  }) : {};
79
83
  var _default = QuestionRange;
80
84
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["QuestionRange","props","legacyContext","title","minLabel","maxLabel","rangeProps","skin","GetSkinFromContext","defaultColor","titleStyle","color","style","wrapper","classnames","innerHTML","__html","labelWrapper","label","contextTypes","Provider","childContextTypes","propTypes","Range","PropTypes","string"],"sources":["../../../../src/molecule/questions/question-range/index.js"],"sourcesContent":["import React from 'react';\nimport {getOr} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport Provider, {GetSkinFromContext} from '../../../atom/provider';\nimport Range from '../../../atom/range';\nimport style from './style.css';\n\nconst QuestionRange = (props, legacyContext) => {\n const {title, minLabel, maxLabel, ...rangeProps} = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const defaultColor = getOr('#00B0FF', 'common.primary', skin);\n\n const titleStyle = {\n color: defaultColor\n };\n\n return (\n <div className={style.wrapper}>\n <span\n style={titleStyle}\n className={classnames(style.title, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n <Range {...rangeProps} />\n <div className={style.labelWrapper}>\n <span\n className={classnames(style.label, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: minLabel}}\n />\n <span\n className={classnames(style.label, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: maxLabel}}\n />\n </div>\n </div>\n );\n};\n\nQuestionRange.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nQuestionRange.propTypes = {\n ...Range.propTypes,\n title: PropTypes.string,\n minLabel: PropTypes.string,\n maxLabel: PropTypes.string\n};\n\nexport default QuestionRange;\n"],"mappings":";;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,SAAd,wDACKC,cAAA,CAAMD,SADX;EAEEnB,KAAK,EAAEqB,kBAAA,CAAUC,MAFnB;EAGErB,QAAQ,EAAEoB,kBAAA,CAAUC,MAHtB;EAIEpB,QAAQ,EAAEmB,kBAAA,CAAUC;AAJtB;eAOezB,a"}
1
+ {"version":3,"file":"index.js","names":["QuestionRange","props","legacyContext","title","minLabel","maxLabel","groupAriaLabel","rangeProps","skin","GetSkinFromContext","defaultColor","titleStyle","color","style","wrapper","classnames","innerHTML","__html","labelWrapper","label","contextTypes","Provider","childContextTypes","propTypes","Range","PropTypes","string"],"sources":["../../../../src/molecule/questions/question-range/index.js"],"sourcesContent":["import React from 'react';\nimport {getOr} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport Provider, {GetSkinFromContext} from '../../../atom/provider';\nimport Range from '../../../atom/range';\nimport style from './style.css';\n\nconst QuestionRange = (props, legacyContext) => {\n const {title, minLabel, maxLabel, groupAriaLabel, ...rangeProps} = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const defaultColor = getOr('#00B0FF', 'common.primary', skin);\n\n const titleStyle = {\n color: defaultColor\n };\n\n return (\n <form>\n <div className={style.wrapper} role=\"group\" aria-label={groupAriaLabel}>\n <span\n style={titleStyle}\n className={classnames(style.title, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n <Range {...rangeProps} />\n <div className={style.labelWrapper}>\n <span\n className={classnames(style.label, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: minLabel}}\n />\n <span\n className={classnames(style.label, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: maxLabel}}\n />\n </div>\n </div>\n </form>\n );\n};\n\nQuestionRange.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nQuestionRange.propTypes = {\n ...Range.propTypes,\n title: PropTypes.string,\n minLabel: PropTypes.string,\n maxLabel: PropTypes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yBD,CAnCD;;AAqCAL,aAAa,CAACoB,YAAd,GAA6B;EAC3BZ,IAAI,EAAEa,iBAAA,CAASC,iBAAT,CAA2Bd;AADN,CAA7B;AAIAR,aAAa,CAACuB,SAAd,wDACKC,cAAA,CAAMD,SADX;EAEEpB,KAAK,EAAEsB,kBAAA,CAAUC,MAFnB;EAGEtB,QAAQ,EAAEqB,kBAAA,CAAUC,MAHtB;EAIErB,QAAQ,EAAEoB,kBAAA,CAAUC,MAJtB;EAKEpB,cAAc,EAAEmB,kBAAA,CAAUC;AAL5B;eAQe1B,a"}
@@ -1,7 +1,8 @@
1
1
  export default Template;
2
- declare function Template({ template, answers }: {
2
+ declare function Template({ template, answers, groupAriaLabel }: {
3
3
  template: any;
4
4
  answers: any;
5
+ groupAriaLabel: any;
5
6
  }): JSX.Element;
6
7
  declare namespace Template {
7
8
  namespace propTypes {
@@ -16,6 +17,7 @@ declare namespace Template {
16
17
  }> | null | undefined)[]>;
17
18
  theme: PropTypes.Requireable<string>;
18
19
  'aria-label': PropTypes.Requireable<string>;
20
+ groupAriaLabel: PropTypes.Requireable<string>;
19
21
  }, never>> & Partial<PropTypes.InferPropsInner<Pick<{
20
22
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
21
23
  options: PropTypes.Requireable<(PropTypes.InferProps<{
@@ -26,7 +28,9 @@ declare namespace Template {
26
28
  }> | null | undefined)[]>;
27
29
  theme: PropTypes.Requireable<string>;
28
30
  'aria-label': PropTypes.Requireable<string>;
29
- }, "aria-label" | "onChange" | "theme" | "options">>>) | null | undefined)[]>;
31
+ groupAriaLabel: PropTypes.Requireable<string>;
32
+ }, "aria-label" | "onChange" | "theme" | "options" | "groupAriaLabel">>>) | null | undefined)[]>;
33
+ const groupAriaLabel: PropTypes.Requireable<string>;
30
34
  }
31
35
  }
32
36
  import PropTypes from "prop-types";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/questions/template/index.js"],"names":[],"mappings":";AAQA;;;gBAsCC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/questions/template/index.js"],"names":[],"mappings":";AAQA;;;;gBA6CC"}
@@ -29,7 +29,8 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
29
29
 
30
30
  const Template = ({
31
31
  template,
32
- answers
32
+ answers,
33
+ groupAriaLabel
33
34
  }) => {
34
35
  const totalTemplate = (0, _parseTemplateString.default)(template);
35
36
 
@@ -72,10 +73,12 @@ const Template = ({
72
73
  }
73
74
  }, totalTemplate);
74
75
 
75
- return /*#__PURE__*/_react.default.createElement("div", {
76
+ return /*#__PURE__*/_react.default.createElement("form", null, /*#__PURE__*/_react.default.createElement("div", {
76
77
  "data-name": "template-wrapper",
77
- className: _style.default.wrapper
78
- }, templateCompose);
78
+ className: _style.default.wrapper,
79
+ role: "group",
80
+ "aria-label": groupAriaLabel
81
+ }, templateCompose));
79
82
  };
80
83
 
81
84
  const TextPropTypes = process.env.NODE_ENV !== "production" ? _extends({}, _dropDown.default.propTypes, {
@@ -83,7 +86,8 @@ const TextPropTypes = process.env.NODE_ENV !== "production" ? _extends({}, _drop
83
86
  }) : {};
84
87
  Template.propTypes = process.env.NODE_ENV !== "production" ? {
85
88
  template: _propTypes.default.string,
86
- answers: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.shape(_dropDown.default.propTypes), _propTypes.default.shape(TextPropTypes)]))
89
+ answers: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.shape(_dropDown.default.propTypes), _propTypes.default.shape(TextPropTypes)])),
90
+ groupAriaLabel: _propTypes.default.string
87
91
  } : {};
88
92
  var _default = Template;
89
93
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Template","template","answers","totalTemplate","parseTemplateString","templateCompose","convert","cap","part","key","type","style","textPart","__html","value","field","name","fieldType","fieldProps","fieldView","text","answerType","wrapper","TextPropTypes","DropDown","propTypes","PropTypes","string","arrayOf","oneOfType","shape"],"sources":["../../../../src/molecule/questions/template/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {map, find} from 'lodash/fp';\nimport parseTemplateString from '../../../util/parse-template-string';\nimport DropDown from '../drop-down';\nimport FreeText from '../free-text';\nimport style from './style.css';\n\nconst Template = ({template, answers}) => {\n const totalTemplate = parseTemplateString(template);\n const templateCompose = map.convert({cap: false})((part, key) => {\n const type = part.type;\n if (type === 'string') {\n return (\n <span\n key={key}\n className={style.textPart}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: part.value}}\n />\n );\n }\n if (type === 'answerField') {\n const field = find({name: part.value}, answers);\n if (!field) return null;\n const {type: fieldType, ...fieldProps} = field;\n const fieldView =\n fieldType === 'text' ? (\n <FreeText {...fieldProps} className={style.text} />\n ) : (\n <DropDown {...fieldProps} theme=\"player\" />\n );\n\n return (\n <div className={style.answerType} key={part.value}>\n {fieldView}\n </div>\n );\n }\n }, totalTemplate);\n\n return (\n <div data-name=\"template-wrapper\" className={style.wrapper}>\n {templateCompose}\n </div>\n );\n};\n\nconst TextPropTypes = {\n ...DropDown.propTypes,\n type: PropTypes.string\n};\n\nTemplate.propTypes = {\n template: PropTypes.string,\n answers: PropTypes.arrayOf(\n PropTypes.oneOfType([PropTypes.shape(DropDown.propTypes), PropTypes.shape(TextPropTypes)])\n )\n};\n\nexport default Template;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,QAAQ,GAAG,CAAC;EAACC,QAAD;EAAWC;AAAX,CAAD,KAAyB;EACxC,MAAMC,aAAa,GAAG,IAAAC,4BAAA,EAAoBH,QAApB,CAAtB;;EACA,MAAMI,eAAe,GAAG,cAAIC,OAAJ,CAAY;IAACC,GAAG,EAAE;EAAN,CAAZ,EAA0B,CAACC,IAAD,EAAOC,GAAP,KAAe;IAC/D,MAAMC,IAAI,GAAGF,IAAI,CAACE,IAAl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CAAD,EAAsCC,kBAAA,CAAUI,KAAV,CAAgBP,aAAhB,CAAtC,CAApB,CADO;AAFU,CAArB;eAOevB,Q"}
1
+ {"version":3,"file":"index.js","names":["Template","template","answers","groupAriaLabel","totalTemplate","parseTemplateString","templateCompose","convert","cap","part","key","type","style","textPart","__html","value","field","name","fieldType","fieldProps","fieldView","text","answerType","wrapper","TextPropTypes","DropDown","propTypes","PropTypes","string","arrayOf","oneOfType","shape"],"sources":["../../../../src/molecule/questions/template/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {map, find} from 'lodash/fp';\nimport parseTemplateString from '../../../util/parse-template-string';\nimport DropDown from '../drop-down';\nimport FreeText from '../free-text';\nimport style from './style.css';\n\nconst Template = ({template, answers, groupAriaLabel}) => {\n const totalTemplate = parseTemplateString(template);\n const templateCompose = map.convert({cap: false})((part, key) => {\n const type = part.type;\n if (type === 'string') {\n return (\n <span\n key={key}\n className={style.textPart}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: part.value}}\n />\n );\n }\n if (type === 'answerField') {\n const field = find({name: part.value}, answers);\n if (!field) return null;\n const {type: fieldType, ...fieldProps} = field;\n const fieldView =\n fieldType === 'text' ? (\n <FreeText {...fieldProps} className={style.text} />\n ) : (\n <DropDown {...fieldProps} theme=\"player\" />\n );\n\n return (\n <div className={style.answerType} key={part.value}>\n {fieldView}\n </div>\n );\n }\n }, totalTemplate);\n\n return (\n <form>\n <div\n data-name=\"template-wrapper\"\n className={style.wrapper}\n role=\"group\"\n aria-label={groupAriaLabel}\n >\n {templateCompose}\n </div>\n </form>\n );\n};\n\nconst TextPropTypes = {\n ...DropDown.propTypes,\n type: PropTypes.string\n};\n\nTemplate.propTypes = {\n template: PropTypes.string,\n answers: PropTypes.arrayOf(\n PropTypes.oneOfType([PropTypes.shape(DropDown.propTypes), PropTypes.shape(TextPropTypes)])\n ),\n groupAriaLabel: PropTypes.string\n};\n\nexport default Template;\n"],"mappings":";;;;;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AAEQ,cAAA,CAAMW,OAFnB;IAGE,IAAI,EAAC,OAHP;IAIE,cAAYpB;EAJd,GAMGG,eANH,CADF,CADF;AAYD,CA7CD;;AA+CA,MAAMkB,aAAN,wDACKC,iBAAA,CAASC,SADd;EAEEf,IAAI,EAAEgB,kBAAA,CAAUC;AAFlB;AAKA5B,QAAQ,CAAC0B,SAAT,2CAAqB;EACnBzB,QAAQ,EAAE0B,kBAAA,CAAUC,MADD;EAEnB1B,OAAO,EAAEyB,kBAAA,CAAUE,OAAV,CACPF,kBAAA,CAAUG,SAAV,CAAoB,CAACH,kBAAA,CAAUI,KAAV,CAAgBN,iBAAA,CAASC,SAAzB,CAAD,EAAsCC,kBAAA,CAAUI,KAAV,CAAgBP,aAAhB,CAAtC,CAApB,CADO,CAFU;EAKnBrB,cAAc,EAAEwB,kBAAA,CAAUC;AALP,CAArB;eAQe5B,Q"}
@@ -54,6 +54,15 @@ declare namespace SetupSlide {
54
54
  selected: PropTypes.Requireable<boolean>;
55
55
  validOption: PropTypes.Requireable<boolean>;
56
56
  }> | null | undefined)[]>;
57
+ optgroups: PropTypes.Requireable<(PropTypes.InferProps<{
58
+ label: PropTypes.Validator<string>;
59
+ options: PropTypes.Requireable<(PropTypes.InferProps<{
60
+ name: PropTypes.Validator<string>;
61
+ value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
62
+ selected: PropTypes.Requireable<boolean>;
63
+ validOption: PropTypes.Requireable<boolean>;
64
+ }> | null | undefined)[]>;
65
+ }> | null | undefined)[]>;
57
66
  modified: PropTypes.Requireable<boolean>;
58
67
  error: PropTypes.Requireable<boolean>;
59
68
  'aria-label': PropTypes.Requireable<string>;
@@ -67,6 +67,15 @@ declare namespace SetupSlider {
67
67
  selected: PropTypes.Requireable<boolean>;
68
68
  validOption: PropTypes.Requireable<boolean>;
69
69
  }> | null | undefined)[]>;
70
+ optgroups: PropTypes.Requireable<(PropTypes.InferProps<{
71
+ label: PropTypes.Validator<string>;
72
+ options: PropTypes.Requireable<(PropTypes.InferProps<{
73
+ name: PropTypes.Validator<string>;
74
+ value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
75
+ selected: PropTypes.Requireable<boolean>;
76
+ validOption: PropTypes.Requireable<boolean>;
77
+ }> | null | undefined)[]>;
78
+ }> | null | undefined)[]>;
70
79
  modified: PropTypes.Requireable<boolean>;
71
80
  error: PropTypes.Requireable<boolean>;
72
81
  'aria-label': PropTypes.Requireable<string>;
@@ -126,6 +126,15 @@ declare namespace BrandForm {
126
126
  selected: PropTypes.Requireable<boolean>;
127
127
  validOption: PropTypes.Requireable<boolean>;
128
128
  }> | null | undefined)[]>;
129
+ optgroups: PropTypes.Requireable<(PropTypes.InferProps<{
130
+ label: PropTypes.Validator<string>;
131
+ options: PropTypes.Requireable<(PropTypes.InferProps<{
132
+ name: PropTypes.Validator<string>;
133
+ value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
134
+ selected: PropTypes.Requireable<boolean>;
135
+ validOption: PropTypes.Requireable<boolean>;
136
+ }> | null | undefined)[]>;
137
+ }> | null | undefined)[]>;
129
138
  modified: PropTypes.Requireable<boolean>;
130
139
  error: PropTypes.Requireable<boolean>;
131
140
  'aria-label': PropTypes.Requireable<string>;
@@ -230,6 +239,15 @@ declare namespace BrandForm {
230
239
  selected: PropTypes.Requireable<boolean>;
231
240
  validOption: PropTypes.Requireable<boolean>;
232
241
  }> | null | undefined)[]>;
242
+ optgroups: PropTypes.Requireable<(PropTypes.InferProps<{
243
+ label: PropTypes.Validator<string>;
244
+ options: PropTypes.Requireable<(PropTypes.InferProps<{
245
+ name: PropTypes.Validator<string>;
246
+ value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
247
+ selected: PropTypes.Requireable<boolean>;
248
+ validOption: PropTypes.Requireable<boolean>;
249
+ }> | null | undefined)[]>;
250
+ }> | null | undefined)[]>;
233
251
  modified: PropTypes.Requireable<boolean>;
234
252
  error: PropTypes.Requireable<boolean>;
235
253
  'aria-label': PropTypes.Requireable<string>;
@@ -7,6 +7,7 @@ declare class MoocHeader extends React.Component<any, any, any> {
7
7
  href: PropTypes.Requireable<string>;
8
8
  'aria-label': PropTypes.Requireable<string>;
9
9
  'button-aria-label': PropTypes.Requireable<string>;
10
+ toolTipText: PropTypes.Requireable<string>;
10
11
  }>>;
11
12
  search: PropTypes.Requireable<PropTypes.InferProps<{
12
13
  value: PropTypes.Requireable<string>;
@@ -136,6 +137,7 @@ declare class MoocHeader extends React.Component<any, any, any> {
136
137
  isSettingsOpen: boolean;
137
138
  isMenuOpen: boolean;
138
139
  isFocus: boolean;
140
+ isToolTipOpen: boolean;
139
141
  };
140
142
  handleSettingsToggle(): void;
141
143
  handleMenuToggle(): void;
@@ -148,6 +150,9 @@ declare class MoocHeader extends React.Component<any, any, any> {
148
150
  handleOnBlur(): void;
149
151
  handleOnMenuOpen(): void;
150
152
  handleOnMenuClose(): void;
153
+ handleOnMouseOver(): void;
154
+ handleOnMouseLeave(): void;
155
+ handleKeyPress(event: any): void;
151
156
  componentDidUpdate(prevProps: any, prevState: any, prevContext: any): void;
152
157
  menuSettings: any;
153
158
  render(): JSX.Element | null;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/mooc-header/index.js"],"names":[],"mappings":";AAwBA;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA2FE;IAEF;;;;;;;;;;;;;;;;;;;;;;;MAGE;IAEF,wBAmBC;IAjBC;;;;MAIC;IA6CH,6BAIC;IAED,yBAGC;IAxBD,qCAQC;IAED,wBAGC;IAjBD,+BAEC;IA4BD,2BAKC;IAED,0BAKC;IAED,sBAIC;IAED,qBAIC;IAED,yBAQC;IAED,0BAQC;IArFD,2EASC;IAGC,kBAAsB;IA2ExB,6BAmYC;CACF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/mooc-header/index.js"],"names":[],"mappings":";AAyBA;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA4FE;IAEF;;;;;;;;;;;;;;;;;;;;;;;MAGE;IAEF,wBAuBC;IArBC;;;;;MAKC;IAgDH,6BAIC;IAED,yBAGC;IAxBD,qCAQC;IAED,wBAGC;IAjBD,+BAEC;IA4BD,2BAKC;IAED,0BAKC;IAED,sBAIC;IAED,qBAIC;IAED,yBAQC;IAED,0BAQC;IAED,0BAIC;IAED,2BAIC;IAED,iCAUC;IA7GD,2EASC;IAGC,kBAAsB;IAmGxB,6BAwZC;CACF"}