@coorpacademy/components 11.2.9 → 11.2.10

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 (127) hide show
  1. package/es/atom/clue/index.d.ts +1 -1
  2. package/es/atom/promo-code/index.d.ts +1 -1
  3. package/es/atom/provider/index.d.ts +1 -1
  4. package/es/atom/provider/index.js +1 -1
  5. package/es/atom/provider/index.js.map +1 -1
  6. package/es/atom/select/index.d.ts +16 -17
  7. package/es/atom/select/index.d.ts.map +1 -1
  8. package/es/atom/select/index.js +7 -6
  9. package/es/atom/select/index.js.map +1 -1
  10. package/es/atom/tab-content/index.d.ts +1 -1
  11. package/es/molecule/answer/index.d.ts.map +1 -1
  12. package/es/molecule/answer/index.js +9 -1
  13. package/es/molecule/answer/index.js.map +1 -1
  14. package/es/molecule/battle-request/index.d.ts +1 -1
  15. package/es/molecule/brand-create-form/index.d.ts +1 -1
  16. package/es/molecule/brand-form-group/index.d.ts +2 -2
  17. package/es/molecule/card-with-button/index.d.ts +1 -1
  18. package/es/molecule/cookie-banner/index.d.ts +1 -1
  19. package/es/molecule/dashboard/cards-list/index.d.ts +1 -1
  20. package/es/molecule/discipline-partners/index.d.ts +1 -1
  21. package/es/molecule/external-content-button/index.d.ts +1 -1
  22. package/es/molecule/filters/index.d.ts +1 -1
  23. package/es/molecule/forum/forum-comment/index.d.ts +1 -1
  24. package/es/molecule/forum/forum-post/index.d.ts +1 -1
  25. package/es/molecule/payment-form/index.d.ts +1 -1
  26. package/es/molecule/pdf/index.d.ts +1 -1
  27. package/es/molecule/product-card/index.d.ts +1 -1
  28. package/es/molecule/questions/drop-down/index.d.ts +6 -5
  29. package/es/molecule/questions/drop-down/index.js +5 -2
  30. package/es/molecule/questions/drop-down/index.js.map +1 -1
  31. package/es/molecule/questions/template/index.d.ts +3 -1
  32. package/es/molecule/scope-content/index.d.ts +1 -1
  33. package/es/molecule/setup-section/index.d.ts +1 -1
  34. package/es/molecule/setup-slide/index.d.ts +1 -1
  35. package/es/molecule/setup-slider/index.d.ts +1 -1
  36. package/es/molecule/subscription-freemium/index.d.ts +1 -1
  37. package/es/molecule/subscription-premium/index.d.ts +1 -1
  38. package/es/molecule/table/index.d.ts +1 -1
  39. package/es/molecule/unsubscribe/index.d.ts +1 -1
  40. package/es/organism/brand-analytics/index.d.ts +1 -1
  41. package/es/organism/brand-form/index.d.ts +2 -2
  42. package/es/organism/cart/index.d.ts +1 -1
  43. package/es/organism/mooc-header/index.d.ts +1 -1
  44. package/es/organism/mooc-header/index.js +1 -1
  45. package/es/organism/mooc-header/index.js.map +1 -1
  46. package/es/organism/settings/index.d.ts +1 -1
  47. package/es/organism/wizard-contents/index.d.ts +2 -2
  48. package/es/template/app-player/player/slides/index.d.ts +2 -2
  49. package/es/template/app-player/player/slides/index.js +1 -1
  50. package/es/template/app-player/player/slides/index.js.map +1 -1
  51. package/es/template/app-review/template-context.d.ts +1 -0
  52. package/es/template/app-review/template-context.d.ts.map +1 -1
  53. package/es/template/app-review/template-context.js +2 -1
  54. package/es/template/app-review/template-context.js.map +1 -1
  55. package/es/template/back-office/brand-update/index.d.ts +4 -4
  56. package/es/template/battle-requests/index.d.ts +1 -1
  57. package/es/template/common/authors/index.d.ts +1 -1
  58. package/es/template/common/search-page/index.d.ts +1 -1
  59. package/es/util/render-with-context.d.ts +1 -4
  60. package/es/util/render-with-context.d.ts.map +1 -1
  61. package/es/util/render-with-context.js +6 -6
  62. package/es/util/render-with-context.js.map +1 -1
  63. package/lib/atom/clue/index.d.ts +1 -1
  64. package/lib/atom/promo-code/index.d.ts +1 -1
  65. package/lib/atom/provider/index.d.ts +1 -1
  66. package/lib/atom/provider/index.js +1 -1
  67. package/lib/atom/provider/index.js.map +1 -1
  68. package/lib/atom/select/index.d.ts +16 -17
  69. package/lib/atom/select/index.d.ts.map +1 -1
  70. package/lib/atom/select/index.js +7 -6
  71. package/lib/atom/select/index.js.map +1 -1
  72. package/lib/atom/tab-content/index.d.ts +1 -1
  73. package/lib/molecule/answer/index.d.ts.map +1 -1
  74. package/lib/molecule/answer/index.js +10 -1
  75. package/lib/molecule/answer/index.js.map +1 -1
  76. package/lib/molecule/battle-request/index.d.ts +1 -1
  77. package/lib/molecule/brand-create-form/index.d.ts +1 -1
  78. package/lib/molecule/brand-form-group/index.d.ts +2 -2
  79. package/lib/molecule/card-with-button/index.d.ts +1 -1
  80. package/lib/molecule/cookie-banner/index.d.ts +1 -1
  81. package/lib/molecule/dashboard/cards-list/index.d.ts +1 -1
  82. package/lib/molecule/discipline-partners/index.d.ts +1 -1
  83. package/lib/molecule/external-content-button/index.d.ts +1 -1
  84. package/lib/molecule/filters/index.d.ts +1 -1
  85. package/lib/molecule/forum/forum-comment/index.d.ts +1 -1
  86. package/lib/molecule/forum/forum-post/index.d.ts +1 -1
  87. package/lib/molecule/payment-form/index.d.ts +1 -1
  88. package/lib/molecule/pdf/index.d.ts +1 -1
  89. package/lib/molecule/product-card/index.d.ts +1 -1
  90. package/lib/molecule/questions/drop-down/index.d.ts +6 -5
  91. package/lib/molecule/questions/drop-down/index.js +5 -2
  92. package/lib/molecule/questions/drop-down/index.js.map +1 -1
  93. package/lib/molecule/questions/template/index.d.ts +3 -1
  94. package/lib/molecule/scope-content/index.d.ts +1 -1
  95. package/lib/molecule/setup-section/index.d.ts +1 -1
  96. package/lib/molecule/setup-slide/index.d.ts +1 -1
  97. package/lib/molecule/setup-slider/index.d.ts +1 -1
  98. package/lib/molecule/subscription-freemium/index.d.ts +1 -1
  99. package/lib/molecule/subscription-premium/index.d.ts +1 -1
  100. package/lib/molecule/table/index.d.ts +1 -1
  101. package/lib/molecule/unsubscribe/index.d.ts +1 -1
  102. package/lib/organism/brand-analytics/index.d.ts +1 -1
  103. package/lib/organism/brand-form/index.d.ts +2 -2
  104. package/lib/organism/cart/index.d.ts +1 -1
  105. package/lib/organism/mooc-header/index.d.ts +1 -1
  106. package/lib/organism/mooc-header/index.js +1 -1
  107. package/lib/organism/mooc-header/index.js.map +1 -1
  108. package/lib/organism/settings/index.d.ts +1 -1
  109. package/lib/organism/wizard-contents/index.d.ts +2 -2
  110. package/lib/template/app-player/player/slides/index.d.ts +2 -2
  111. package/lib/template/app-player/player/slides/index.js +1 -1
  112. package/lib/template/app-player/player/slides/index.js.map +1 -1
  113. package/lib/template/app-review/template-context.d.ts +1 -0
  114. package/lib/template/app-review/template-context.d.ts.map +1 -1
  115. package/lib/template/app-review/template-context.js +2 -1
  116. package/lib/template/app-review/template-context.js.map +1 -1
  117. package/lib/template/back-office/brand-update/index.d.ts +4 -4
  118. package/lib/template/battle-requests/index.d.ts +1 -1
  119. package/lib/template/common/authors/index.d.ts +1 -1
  120. package/lib/template/common/search-page/index.d.ts +1 -1
  121. package/lib/util/render-with-context.d.ts +1 -4
  122. package/lib/util/render-with-context.d.ts.map +1 -1
  123. package/lib/util/render-with-context.js +6 -6
  124. package/lib/util/render-with-context.js.map +1 -1
  125. package/locales/en/global.json +1 -0
  126. package/package.json +2 -2
  127. package/locales/.mtslconfig.json +0 -1
@@ -213,7 +213,6 @@ declare namespace BrandUpdate {
213
213
  type: PropTypes.Requireable<string>;
214
214
  size: PropTypes.Requireable<string>;
215
215
  title: PropTypes.Requireable<string>;
216
- moreAriaLabel: PropTypes.Requireable<string>;
217
216
  name: PropTypes.Requireable<string>;
218
217
  className: PropTypes.Requireable<string>;
219
218
  borderClassName: PropTypes.Requireable<string>;
@@ -231,6 +230,7 @@ declare namespace BrandUpdate {
231
230
  }> | null | undefined)[]>;
232
231
  modified: PropTypes.Requireable<boolean>;
233
232
  error: PropTypes.Requireable<boolean>;
233
+ 'aria-label': PropTypes.Requireable<string>;
234
234
  }> | PropTypes.InferProps<{
235
235
  type: PropTypes.Requireable<string>;
236
236
  title: PropTypes.Validator<string>;
@@ -317,7 +317,6 @@ declare namespace BrandUpdate {
317
317
  }> | PropTypes.InferProps<{
318
318
  type: PropTypes.Requireable<string>;
319
319
  title: PropTypes.Requireable<string>;
320
- moreAriaLabel: PropTypes.Requireable<string>;
321
320
  name: PropTypes.Requireable<string>;
322
321
  className: PropTypes.Requireable<string>;
323
322
  borderClassName: PropTypes.Requireable<string>;
@@ -335,6 +334,7 @@ declare namespace BrandUpdate {
335
334
  }> | null | undefined)[]>;
336
335
  modified: PropTypes.Requireable<boolean>;
337
336
  error: PropTypes.Requireable<boolean>;
337
+ 'aria-label': PropTypes.Requireable<string>;
338
338
  }> | PropTypes.InferProps<{
339
339
  type: PropTypes.Requireable<string>;
340
340
  title: PropTypes.Validator<string>;
@@ -836,7 +836,6 @@ declare namespace BrandUpdate {
836
836
  type: PropTypes.Requireable<string>;
837
837
  size: PropTypes.Requireable<string>;
838
838
  title: PropTypes.Requireable<string>;
839
- moreAriaLabel: PropTypes.Requireable<string>;
840
839
  name: PropTypes.Requireable<string>;
841
840
  className: PropTypes.Requireable<string>;
842
841
  borderClassName: PropTypes.Requireable<string>;
@@ -854,6 +853,7 @@ declare namespace BrandUpdate {
854
853
  }> | null | undefined)[]>;
855
854
  modified: PropTypes.Requireable<boolean>;
856
855
  error: PropTypes.Requireable<boolean>;
856
+ 'aria-label': PropTypes.Requireable<string>;
857
857
  }> | PropTypes.InferProps<{
858
858
  type: PropTypes.Requireable<string>;
859
859
  title: PropTypes.Validator<string>;
@@ -940,7 +940,6 @@ declare namespace BrandUpdate {
940
940
  }> | PropTypes.InferProps<{
941
941
  type: PropTypes.Requireable<string>;
942
942
  title: PropTypes.Requireable<string>;
943
- moreAriaLabel: PropTypes.Requireable<string>;
944
943
  name: PropTypes.Requireable<string>;
945
944
  className: PropTypes.Requireable<string>;
946
945
  borderClassName: PropTypes.Requireable<string>;
@@ -958,6 +957,7 @@ declare namespace BrandUpdate {
958
957
  }> | null | undefined)[]>;
959
958
  modified: PropTypes.Requireable<boolean>;
960
959
  error: PropTypes.Requireable<boolean>;
960
+ 'aria-label': PropTypes.Requireable<string>;
961
961
  }> | PropTypes.InferProps<{
962
962
  type: PropTypes.Requireable<string>;
963
963
  title: PropTypes.Validator<string>;
@@ -2,7 +2,7 @@ export default Battles;
2
2
  declare function Battles(props: any, context: any): JSX.Element;
3
3
  declare namespace Battles {
4
4
  namespace contextTypes {
5
- const translate: PropTypes.Validator<(...args: any[]) => any>;
5
+ const translate: PropTypes.Requireable<(...args: any[]) => any>;
6
6
  }
7
7
  namespace propTypes {
8
8
  const battles: PropTypes.Validator<(PropTypes.InferProps<{
@@ -19,7 +19,7 @@ declare class Authors extends React.Component<any, any, any> {
19
19
  }> | null | undefined)[]>;
20
20
  };
21
21
  static contextTypes: {
22
- translate: PropTypes.Validator<(...args: any[]) => any>;
22
+ translate: PropTypes.Requireable<(...args: any[]) => any>;
23
23
  skin: PropTypes.Requireable<PropTypes.InferProps<{
24
24
  common: PropTypes.Requireable<{
25
25
  [x: string]: any;
@@ -40,7 +40,6 @@ declare namespace SearchPage {
40
40
  }> | null | undefined)[]>;
41
41
  sorting: PropTypes.Requireable<PropTypes.InferProps<{
42
42
  title: PropTypes.Requireable<string>;
43
- moreAriaLabel: PropTypes.Requireable<string>;
44
43
  name: PropTypes.Requireable<string>;
45
44
  className: PropTypes.Requireable<string>;
46
45
  borderClassName: PropTypes.Requireable<string>;
@@ -58,6 +57,7 @@ declare namespace SearchPage {
58
57
  }> | null | undefined)[]>;
59
58
  modified: PropTypes.Requireable<boolean>;
60
59
  error: PropTypes.Requireable<boolean>;
60
+ 'aria-label': PropTypes.Requireable<string>;
61
61
  }>>;
62
62
  onSearch: PropTypes.Requireable<(...args: any[]) => any>;
63
63
  onToggleFilters: PropTypes.Requireable<(...args: any[]) => any>;
@@ -1,5 +1,2 @@
1
- export function renderWithContext(component: any, { context, ...renderOptions }: {
2
- [x: string]: any;
3
- context: any;
4
- }): import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
1
+ export function renderWithContext(component: any, options?: {}): import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
5
2
  //# sourceMappingURL=render-with-context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"render-with-context.d.ts","sourceRoot":"","sources":["../../src/util/render-with-context.js"],"names":[],"mappings":"AAMO;;;iIAkBN"}
1
+ {"version":3,"file":"render-with-context.d.ts","sourceRoot":"","sources":["../../src/util/render-with-context.js"],"names":[],"mappings":"AAMO,8LAmBN"}
@@ -10,13 +10,13 @@ import PropTypes from 'prop-types';
10
10
  import { render } from '@testing-library/react';
11
11
  import { mockTranslate } from '@coorpacademy/translate';
12
12
  import Provider from '../atom/provider';
13
- export const renderWithContext = (component, _ref) => {
14
- let {
15
- context
16
- } = _ref,
17
- renderOptions = _objectWithoutPropertiesLoose(_ref, _excluded);
13
+ export const renderWithContext = (component, options = {}) => {
14
+ const {
15
+ context = {}
16
+ } = options,
17
+ renderOptions = _objectWithoutPropertiesLoose(options, _excluded); // uses mockTranslate as a default translate function
18
+
18
19
 
19
- // uses mockTranslate as a default translate function
20
20
  const {
21
21
  translate = mockTranslate
22
22
  } = context,
@@ -1 +1 @@
1
- {"version":3,"file":"render-with-context.js","names":["React","PropTypes","render","mockTranslate","Provider","renderWithContext","component","context","renderOptions","translate","rest","wrapper","children","propTypes","node"],"sources":["../../src/util/render-with-context.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {render} from '@testing-library/react';\nimport {mockTranslate} from '@coorpacademy/translate';\nimport Provider from '../atom/provider';\n\nexport const renderWithContext = (component, {context, ...renderOptions}) => {\n // uses mockTranslate as a default translate function\n const {translate = mockTranslate, ...rest} = context;\n\n const wrapper = ({children}) => (\n <Provider {...rest} translate={translate}>\n {children}\n </Provider>\n );\n\n wrapper.propTypes = {\n children: PropTypes.node\n };\n\n return render(component, {\n ...renderOptions,\n wrapper\n });\n};\n"],"mappings":";;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAAQC,MAAR,QAAqB,wBAArB;AACA,SAAQC,aAAR,QAA4B,yBAA5B;AACA,OAAOC,QAAP,MAAqB,kBAArB;AAEA,OAAO,MAAMC,iBAAiB,GAAG,CAACC,SAAD,WAA4C;EAAA,IAAhC;IAACC;EAAD,CAAgC;EAAA,IAAnBC,aAAmB;;EAC3E;EACA,MAAM;IAACC,SAAS,GAAGN;EAAb,IAAuCI,OAA7C;EAAA,MAAqCG,IAArC,iCAA6CH,OAA7C;;EAEA,MAAMI,OAAO,GAAG,CAAC;IAACC;EAAD,CAAD,kBACd,oBAAC,QAAD,eAAcF,IAAd;IAAoB,SAAS,EAAED;EAA/B,IACGG,QADH,CADF;;EAMAD,OAAO,CAACE,SAAR,2CAAoB;IAClBD,QAAQ,EAAEX,SAAS,CAACa;EADF,CAApB;EAIA,OAAOZ,MAAM,CAACI,SAAD,eACRE,aADQ;IAEXG;EAFW,GAAb;AAID,CAlBM"}
1
+ {"version":3,"file":"render-with-context.js","names":["React","PropTypes","render","mockTranslate","Provider","renderWithContext","component","options","context","renderOptions","translate","rest","wrapper","children","propTypes","node"],"sources":["../../src/util/render-with-context.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {render} from '@testing-library/react';\nimport {mockTranslate} from '@coorpacademy/translate';\nimport Provider from '../atom/provider';\n\nexport const renderWithContext = (component, options = {}) => {\n const {context = {}, ...renderOptions} = options;\n // uses mockTranslate as a default translate function\n const {translate = mockTranslate, ...rest} = context;\n\n const wrapper = ({children}) => (\n <Provider {...rest} translate={translate}>\n {children}\n </Provider>\n );\n\n wrapper.propTypes = {\n children: PropTypes.node\n };\n\n return render(component, {\n ...renderOptions,\n wrapper\n });\n};\n"],"mappings":";;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAAQC,MAAR,QAAqB,wBAArB;AACA,SAAQC,aAAR,QAA4B,yBAA5B;AACA,OAAOC,QAAP,MAAqB,kBAArB;AAEA,OAAO,MAAMC,iBAAiB,GAAG,CAACC,SAAD,EAAYC,OAAO,GAAG,EAAtB,KAA6B;EAC5D,MAAM;IAACC,OAAO,GAAG;EAAX,IAAmCD,OAAzC;EAAA,MAAwBE,aAAxB,iCAAyCF,OAAzC,aAD4D,CAE5D;;;EACA,MAAM;IAACG,SAAS,GAAGP;EAAb,IAAuCK,OAA7C;EAAA,MAAqCG,IAArC,iCAA6CH,OAA7C;;EAEA,MAAMI,OAAO,GAAG,CAAC;IAACC;EAAD,CAAD,kBACd,oBAAC,QAAD,eAAcF,IAAd;IAAoB,SAAS,EAAED;EAA/B,IACGG,QADH,CADF;;EAMAD,OAAO,CAACE,SAAR,2CAAoB;IAClBD,QAAQ,EAAEZ,SAAS,CAACc;EADF,CAApB;EAIA,OAAOb,MAAM,CAACI,SAAD,eACRG,aADQ;IAEXG;EAFW,GAAb;AAID,CAnBM"}
@@ -27,7 +27,7 @@ declare class Clue extends React.Component<any, any, any> {
27
27
  [x: string]: any;
28
28
  }>;
29
29
  }>>;
30
- translate: PropTypes.Validator<(...args: any[]) => any>;
30
+ translate: PropTypes.Requireable<(...args: any[]) => any>;
31
31
  };
32
32
  static getDerivedStateFromProps(props: any): {
33
33
  isLoading: false;
@@ -2,7 +2,7 @@ export default PromoCode;
2
2
  declare function PromoCode(props: any, context: any): JSX.Element;
3
3
  declare namespace PromoCode {
4
4
  namespace contextTypes {
5
- const translate: PropTypes.Validator<(...args: any[]) => any>;
5
+ const translate: PropTypes.Requireable<(...args: any[]) => any>;
6
6
  }
7
7
  namespace propTypes {
8
8
  const promoCodeDescription: PropTypes.Requireable<string>;
@@ -61,7 +61,7 @@ declare class Provider extends React.Component<any, any, any> {
61
61
  [x: string]: any;
62
62
  }>;
63
63
  }>>;
64
- translate: PropTypes.Validator<(...args: any[]) => any>;
64
+ translate: PropTypes.Requireable<(...args: any[]) => any>;
65
65
  Vimeo: PropTypes.Requireable<object>;
66
66
  };
67
67
  static getDerivedStateFromProps(props: any): {
@@ -123,7 +123,7 @@ class Provider extends _react.default.Component {
123
123
  Provider.childContextTypes = {
124
124
  history: historyShape,
125
125
  skin: skinShape,
126
- translate: translateShape.isRequired,
126
+ translate: translateShape,
127
127
  Vimeo: _propTypes.default.object
128
128
  };
129
129
  Provider.propTypes = process.env.NODE_ENV !== "production" ? {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["DEFAULT_SKIN","common","good","bad","primary","life","brand","primaryAdd1","primaryAdd2","primaryAdd3","primaryAdd4","xtraLightGrey","light","medium","dark","grey","orangeAdd","orange","positive","lightGreen","negative","battle","white","black","mergeSkin","skin","historyShape","PropTypes","shape","createHref","func","push","skinShape","objectOf","ColorPropType","images","SrcPropType","logo","login","icons","HexPropType","mod","courses","arrayOf","texts","translateShape","Provider","React","Component","getDerivedStateFromProps","props","history","translate","constructor","context","Vimeo","state","getChildContext","render","children","Children","only","childContextTypes","isRequired","object","propTypes","node","GetSkinFromContext","legacyContext","useWebContext","legacySkin"],"sources":["../../../src/atom/provider/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {defaultsDeep, get, getOr} from 'lodash/fp';\nimport {SrcPropType, ColorPropType, HexPropType} from '../../util/proptypes';\nimport WebContext, {useWebContext} from './web-context';\n\nconst DEFAULT_SKIN = {\n common: {\n good: '#24b694',\n bad: '#ed1c24',\n primary: '#00B0FF',\n life: '#ed1c24',\n brand: '#00B0FF',\n primaryAdd1: '#B3E5FC',\n primaryAdd2: '#0091EA',\n primaryAdd3: '#0277BD',\n primaryAdd4: '#015798',\n xtraLightGrey: '#FAFAFA',\n light: '#ECEFF1',\n medium: '#90A4AE',\n dark: '#546E7A',\n grey: '#607D8B',\n orangeAdd: '#FF7043',\n orange: '#FFA000',\n positive: '#3EC483',\n lightGreen: '#66BB6A',\n negative: '#F73F52',\n battle: '#FFE100',\n white: '#FFFFFF',\n black: '#14171A'\n }\n};\n\nconst mergeSkin = (skin = {}) => defaultsDeep(DEFAULT_SKIN, skin);\n\nconst historyShape = PropTypes.shape({\n createHref: PropTypes.func,\n push: PropTypes.func\n});\n\nconst skinShape = PropTypes.shape({\n common: PropTypes.objectOf(ColorPropType),\n images: PropTypes.shape({\n 'logo-mobile': SrcPropType,\n logo: SrcPropType,\n 'logo-email': SrcPropType,\n login: SrcPropType\n }),\n icons: PropTypes.objectOf(HexPropType),\n mod: PropTypes.objectOf(ColorPropType),\n courses: PropTypes.arrayOf(ColorPropType),\n texts: PropTypes.objectOf(ColorPropType)\n});\n\nconst translateShape = PropTypes.func;\n\nclass Provider extends React.Component {\n static propTypes = {\n history: historyShape,\n skin: skinShape,\n translate: translateShape,\n children: PropTypes.node.isRequired,\n Vimeo: PropTypes.shape({\n common: PropTypes.func\n })\n };\n\n static childContextTypes = {\n history: historyShape,\n skin: skinShape,\n translate: translateShape.isRequired,\n Vimeo: PropTypes.object\n };\n\n static getDerivedStateFromProps(props) {\n const {history, skin, translate} = props;\n\n return {\n history,\n skin: mergeSkin(skin),\n translate\n };\n }\n\n constructor(props, context) {\n super(props, context);\n const {history, skin, translate, Vimeo} = props;\n // eslint-disable-next-line react/no-unused-state\n this.state = {history, skin: mergeSkin(skin), translate, Vimeo};\n }\n\n getChildContext() {\n return this.state;\n }\n\n render() {\n const {children} = this.props;\n return React.Children.only(children);\n }\n}\n\nconst GetSkinFromContext = legacyContext => {\n const context = useWebContext();\n const legacySkin = get('skin', legacyContext);\n const skin = getOr(legacySkin, 'skin', context);\n\n return skin;\n};\n\nexport {WebContext, useWebContext, GetSkinFromContext};\nexport default Provider;\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;;;;;;AAEA,MAAMA,YAAY,GAAG;EACnBC,MAAM,EAAE;IACNC,IAAI,EAAE,SADA;IAENC,GAAG,EAAE,SAFC;IAGNC,OAAO,EAAE,SAHH;IAINC,IAAI,EAAE,SAJA;IAKNC,KAAK,EAAE,SALD;IAMNC,WAAW,EAAE,SANP;IAONC,WAAW,EAAE,SAPP;IAQNC,WAAW,EAAE,SARP;IASNC,WAAW,EAAE,SATP;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qC,kBAAkB,GAAGC,aAAa,IAAI;EAC1C,MAAMd,OAAO,GAAG,IAAAe,yBAAA,GAAhB;EACA,MAAMC,UAAU,GAAG,mBAAI,MAAJ,EAAYF,aAAZ,CAAnB;EACA,MAAM3C,IAAI,GAAG,qBAAM6C,UAAN,EAAkB,MAAlB,EAA0BhB,OAA1B,CAAb;EAEA,OAAO7B,IAAP;AACD,CAND;;;eASeqB,Q"}
1
+ {"version":3,"file":"index.js","names":["DEFAULT_SKIN","common","good","bad","primary","life","brand","primaryAdd1","primaryAdd2","primaryAdd3","primaryAdd4","xtraLightGrey","light","medium","dark","grey","orangeAdd","orange","positive","lightGreen","negative","battle","white","black","mergeSkin","skin","historyShape","PropTypes","shape","createHref","func","push","skinShape","objectOf","ColorPropType","images","SrcPropType","logo","login","icons","HexPropType","mod","courses","arrayOf","texts","translateShape","Provider","React","Component","getDerivedStateFromProps","props","history","translate","constructor","context","Vimeo","state","getChildContext","render","children","Children","only","childContextTypes","object","propTypes","node","isRequired","GetSkinFromContext","legacyContext","useWebContext","legacySkin"],"sources":["../../../src/atom/provider/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {defaultsDeep, get, getOr} from 'lodash/fp';\nimport {SrcPropType, ColorPropType, HexPropType} from '../../util/proptypes';\nimport WebContext, {useWebContext} from './web-context';\n\nconst DEFAULT_SKIN = {\n common: {\n good: '#24b694',\n bad: '#ed1c24',\n primary: '#00B0FF',\n life: '#ed1c24',\n brand: '#00B0FF',\n primaryAdd1: '#B3E5FC',\n primaryAdd2: '#0091EA',\n primaryAdd3: '#0277BD',\n primaryAdd4: '#015798',\n xtraLightGrey: '#FAFAFA',\n light: '#ECEFF1',\n medium: '#90A4AE',\n dark: '#546E7A',\n grey: '#607D8B',\n orangeAdd: '#FF7043',\n orange: '#FFA000',\n positive: '#3EC483',\n lightGreen: '#66BB6A',\n negative: '#F73F52',\n battle: '#FFE100',\n white: '#FFFFFF',\n black: '#14171A'\n }\n};\n\nconst mergeSkin = (skin = {}) => defaultsDeep(DEFAULT_SKIN, skin);\n\nconst historyShape = PropTypes.shape({\n createHref: PropTypes.func,\n push: PropTypes.func\n});\n\nconst skinShape = PropTypes.shape({\n common: PropTypes.objectOf(ColorPropType),\n images: PropTypes.shape({\n 'logo-mobile': SrcPropType,\n logo: SrcPropType,\n 'logo-email': SrcPropType,\n login: SrcPropType\n }),\n icons: PropTypes.objectOf(HexPropType),\n mod: PropTypes.objectOf(ColorPropType),\n courses: PropTypes.arrayOf(ColorPropType),\n texts: PropTypes.objectOf(ColorPropType)\n});\n\nconst translateShape = PropTypes.func;\n\nclass Provider extends React.Component {\n static propTypes = {\n history: historyShape,\n skin: skinShape,\n translate: translateShape,\n children: PropTypes.node.isRequired,\n Vimeo: PropTypes.shape({\n common: PropTypes.func\n })\n };\n\n static childContextTypes = {\n history: historyShape,\n skin: skinShape,\n translate: translateShape,\n Vimeo: PropTypes.object\n };\n\n static getDerivedStateFromProps(props) {\n const {history, skin, translate} = props;\n\n return {\n history,\n skin: mergeSkin(skin),\n translate\n };\n }\n\n constructor(props, context) {\n super(props, context);\n const {history, skin, translate, Vimeo} = props;\n // eslint-disable-next-line react/no-unused-state\n this.state = {history, skin: mergeSkin(skin), translate, Vimeo};\n }\n\n getChildContext() {\n return this.state;\n }\n\n render() {\n const {children} = this.props;\n return React.Children.only(children);\n }\n}\n\nconst GetSkinFromContext = legacyContext => {\n const context = useWebContext();\n const legacySkin = get('skin', legacyContext);\n const skin = getOr(legacySkin, 'skin', context);\n\n return skin;\n};\n\nexport {WebContext, useWebContext, GetSkinFromContext};\nexport default Provider;\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;;;;;;AAEA,MAAMA,YAAY,GAAG;EACnBC,MAAM,EAAE;IACNC,IAAI,EAAE,SADA;IAENC,GAAG,EAAE,SAFC;IAGNC,OAAO,EAAE,SAHH;IAINC,IAAI,EAAE,SAJA;IAKNC,KAAK,EAAE,SALD;IAMNC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AgB;IACrB3B,MAAM,EAAE0B,kBAAA,CAAUG;EADG,CAAhB;AALU,C;;AA4CrB,MAAMqC,kBAAkB,GAAGC,aAAa,IAAI;EAC1C,MAAMd,OAAO,GAAG,IAAAe,yBAAA,GAAhB;EACA,MAAMC,UAAU,GAAG,mBAAI,MAAJ,EAAYF,aAAZ,CAAnB;EACA,MAAM3C,IAAI,GAAG,qBAAM6C,UAAN,EAAkB,MAAlB,EAA0BhB,OAA1B,CAAb;EAEA,OAAO7B,IAAP;AACD,CAND;;;eASeqB,Q"}
@@ -31,27 +31,26 @@ declare namespace Select {
31
31
  }>;
32
32
  }>>;
33
33
  }
34
- namespace propTypes {
35
- export const title: PropTypes.Requireable<string>;
36
- export const moreAriaLabel: PropTypes.Requireable<string>;
37
- const name_1: PropTypes.Requireable<string>;
38
- export { name_1 as name };
39
- export const className: PropTypes.Requireable<string>;
40
- export const borderClassName: PropTypes.Requireable<string>;
41
- export const disabled: PropTypes.Requireable<boolean>;
42
- export const multiple: PropTypes.Requireable<boolean>;
43
- export const description: PropTypes.Requireable<string>;
44
- export const required: PropTypes.Requireable<boolean>;
45
- export const onChange: PropTypes.Requireable<(...args: any[]) => any>;
46
- export const theme: PropTypes.Requireable<string>;
47
- export const options: PropTypes.Requireable<(PropTypes.InferProps<{
34
+ const propTypes: {
35
+ title: PropTypes.Requireable<string>;
36
+ name: PropTypes.Requireable<string>;
37
+ className: PropTypes.Requireable<string>;
38
+ borderClassName: PropTypes.Requireable<string>;
39
+ disabled: PropTypes.Requireable<boolean>;
40
+ multiple: PropTypes.Requireable<boolean>;
41
+ description: PropTypes.Requireable<string>;
42
+ required: PropTypes.Requireable<boolean>;
43
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
44
+ theme: PropTypes.Requireable<string>;
45
+ options: PropTypes.Requireable<(PropTypes.InferProps<{
48
46
  name: PropTypes.Validator<string>;
49
47
  value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
50
48
  selected: PropTypes.Requireable<boolean>;
51
49
  validOption: PropTypes.Requireable<boolean>;
52
50
  }> | null | undefined)[]>;
53
- export const modified: PropTypes.Requireable<boolean>;
54
- export const error: PropTypes.Requireable<boolean>;
55
- }
51
+ modified: PropTypes.Requireable<boolean>;
52
+ error: PropTypes.Requireable<boolean>;
53
+ 'aria-label': PropTypes.Requireable<string>;
54
+ };
56
55
  }
57
56
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":";;;;;;;;AA6BA,qEA4JC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":";;;;;;;;AA6BA,qEA6JC"}
@@ -69,7 +69,7 @@ const Select = (props, legacyContext) => {
69
69
  modified = false,
70
70
  error = false,
71
71
  title: propTitle,
72
- moreAriaLabel
72
+ 'aria-label': ariaLabel
73
73
  } = props;
74
74
  const skin = (0, _provider.GetSkinFromContext)(legacyContext);
75
75
  const title = (0, _react.useMemo)(() => propTitle ? `${propTitle}${required ? '*' : ''}` : null, [propTitle, required]);
@@ -109,10 +109,11 @@ const Select = (props, legacyContext) => {
109
109
  const arrowView = !multiple ? /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionNavigationArrowDown, {
110
110
  color: (0, _includes.default)(theme, ['question', 'template', 'player']) ? arrowColor : black,
111
111
  className: shouldUseSkinFontColor ? _style.default.selectedArrow : _style.default.arrow,
112
- "aria-label": moreAriaLabel
112
+ "aria-label": ariaLabel,
113
+ "data-testid": "select-arrow-down-icon"
113
114
  }) : null;
114
- const behaviourClassName = (0, _react.useMemo)(() => (0, _getClassState.default)(_style.default.default, _style.default.modified, _style.default.error, modified, error), [error, modified]);
115
- const composedClassName = (0, _react.useMemo)(() => (0, _classnames.default)(theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviourClassName, selected ? _style.default.selected : _style.default.unselected, className), [behaviourClassName, className, selected, theme]);
115
+ const behaviorClassName = (0, _react.useMemo)(() => (0, _getClassState.default)(_style.default.default, _style.default.modified, _style.default.error, modified, error), [error, modified]);
116
+ const composedClassName = (0, _react.useMemo)(() => (0, _classnames.default)(theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviorClassName, selected ? _style.default.selected : _style.default.unselected, className), [behaviorClassName, className, selected, theme]);
116
117
  const labelSize = (0, _react.useMemo)(() => (0, _size.default)(selectedLabel), [selectedLabel]);
117
118
  const isLongLabel = (0, _react.useMemo)(() => labelSize >= 65, [labelSize]);
118
119
  return /*#__PURE__*/_react.default.createElement("div", {
@@ -155,7 +156,6 @@ Select.contextTypes = {
155
156
  };
156
157
  Select.propTypes = process.env.NODE_ENV !== "production" ? {
157
158
  title: _propTypes.default.string,
158
- moreAriaLabel: _propTypes.default.string,
159
159
  name: _propTypes.default.string,
160
160
  className: _propTypes.default.string,
161
161
  borderClassName: _propTypes.default.string,
@@ -167,7 +167,8 @@ Select.propTypes = process.env.NODE_ENV !== "production" ? {
167
167
  theme: _propTypes.default.oneOf((0, _keys.default)(themeStyle)),
168
168
  options: _propTypes.default.arrayOf(_propTypes.default.shape(SelectOptionPropTypes)),
169
169
  modified: _propTypes.default.bool,
170
- error: _propTypes.default.bool
170
+ error: _propTypes.default.bool,
171
+ 'aria-label': _propTypes.default.string
171
172
  } : {};
172
173
  var _default = Select;
173
174
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["themeStyle","filter","style","invalid","header","mooc","question","sort","thematiques","player","template","coorpmanager","Select","props","legacyContext","name","options","className","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","moreAriaLabel","skin","GetSkinFromContext","useMemo","optionList","map","option","index","value","selectOption","titleView","selected","get","find","selectedLabel","isSelectedInValidOption","getOr","validOption","handleChange","e","target","selectedOptions","black","color","shouldUseSkinFontColor","includes","arrowColor","undefined","arrowView","selectedArrow","arrow","behaviourClassName","getClassState","default","composedClassName","classnames","unselected","labelSize","size","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectBox","SelectOptionPropTypes","PropTypes","string","isRequired","oneOfType","number","bool","contextTypes","Provider","childContextTypes","propTypes","func","oneOf","keys","arrayOf","shape"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {NovaCompositionNavigationArrowDown as ArrowDown} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n filter: style.filter,\n invalid: style.invalid,\n header: style.header,\n mooc: style.mooc,\n question: style.question,\n sort: style.sort,\n thematiques: style.thematiques,\n player: style.player,\n template: style.template,\n coorpmanager: null\n};\n\nconst Select = (props, legacyContext) => {\n const {\n name,\n options = [],\n className,\n borderClassName,\n onChange,\n multiple = false,\n disabled,\n required,\n description,\n theme,\n modified = false,\n error = false,\n title: propTitle,\n moreAriaLabel\n } = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const title = useMemo(\n () => (propTitle ? `${propTitle}${required ? '*' : ''}` : null),\n [propTitle, required]\n );\n\n const optionList =\n options &&\n options.map((option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title} </span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, options)),\n [multiple, options]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, options)),\n [multiple, options]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const shouldUseSkinFontColor = useMemo(\n () =>\n !isSelectedInValidOption && selected && includes(theme, ['question', 'template', 'player']),\n [isSelectedInValidOption, selected, theme]\n );\n const arrowColor = selected ? color : undefined;\n\n const arrowView = !multiple ? (\n <ArrowDown\n color={includes(theme, ['question', 'template', 'player']) ? arrowColor : black}\n className={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n aria-label={moreAriaLabel}\n />\n ) : null;\n const behaviourClassName = useMemo(\n () => getClassState(style.default, style.modified, style.error, modified, error),\n [error, modified]\n );\n const composedClassName = useMemo(\n () =>\n classnames(\n theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviourClassName,\n selected ? style.selected : style.unselected,\n className\n ),\n [behaviourClassName, className, selected, theme]\n );\n\n const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);\n\n const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);\n\n return (\n <div\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <label\n data-name=\"select-wrapper\"\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template'])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n >\n {selectedLabel}\n </span>\n {arrowView}\n <select\n data-name=\"native-select\"\n className={style.selectBox}\n title={selectedLabel}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool,\n validOption: PropTypes.bool\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n moreAriaLabel: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool\n};\n\nexport default Select;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,UAAU,GAAG;EACjBC,MAAM,EAAEC,cAAA,CAAMD,MADG;EAEjBE,OAAO,EAAED,cAAA,CAAMC,OAFE;EAGjBC,MAAM,EAAEF,cAAA,CAAME,MAHG;EAIjBC,IAAI,EAAEH,cAAA,CAAMG,IAJK;EAKjBC,QAAQ,EAAEJ,cAAA,CAAMI,QALC;EAMjBC,IAAI,EAAEL,cAAA,CAAMK,IANK;EAOjBC,WAAW,EAAEN,cAAA,CAAMM,WAPF;EAQjBC,MAAM,EAAEP,cAAA,CAAMO,MARG;EASjBC,QAAQ,EAAER,cAAA,CAAMQ,QATC;EAUjBC,YAAY,EAAE;AAVG,CAAnB;;AAaA,MAAMC,MAAM,GAAG,CAACC,KAAD,EAAQC,aAAR,KAA0B;EACvC,MAAM;IACJC,IADI;IAEJC,OAAO,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,kBAAA,CAAUK;AAdA,CAAnB;eAiBepE,M"}
1
+ {"version":3,"file":"index.js","names":["themeStyle","filter","style","invalid","header","mooc","question","sort","thematiques","player","template","coorpmanager","Select","props","legacyContext","name","options","className","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","ariaLabel","skin","GetSkinFromContext","useMemo","optionList","map","option","index","value","selectOption","titleView","selected","get","find","selectedLabel","isSelectedInValidOption","getOr","validOption","handleChange","e","target","selectedOptions","black","color","shouldUseSkinFontColor","includes","arrowColor","undefined","arrowView","selectedArrow","arrow","behaviorClassName","getClassState","default","composedClassName","classnames","unselected","labelSize","size","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectBox","SelectOptionPropTypes","PropTypes","string","isRequired","oneOfType","number","bool","contextTypes","Provider","childContextTypes","propTypes","func","oneOf","keys","arrayOf","shape"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {NovaCompositionNavigationArrowDown as ArrowDown} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n filter: style.filter,\n invalid: style.invalid,\n header: style.header,\n mooc: style.mooc,\n question: style.question,\n sort: style.sort,\n thematiques: style.thematiques,\n player: style.player,\n template: style.template,\n coorpmanager: null\n};\n\nconst Select = (props, legacyContext) => {\n const {\n name,\n options = [],\n className,\n borderClassName,\n onChange,\n multiple = false,\n disabled,\n required,\n description,\n theme,\n modified = false,\n error = false,\n title: propTitle,\n 'aria-label': ariaLabel\n } = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const title = useMemo(\n () => (propTitle ? `${propTitle}${required ? '*' : ''}` : null),\n [propTitle, required]\n );\n\n const optionList =\n options &&\n options.map((option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title} </span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, options)),\n [multiple, options]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, options)),\n [multiple, options]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const shouldUseSkinFontColor = useMemo(\n () =>\n !isSelectedInValidOption && selected && includes(theme, ['question', 'template', 'player']),\n [isSelectedInValidOption, selected, theme]\n );\n const arrowColor = selected ? color : undefined;\n\n const arrowView = !multiple ? (\n <ArrowDown\n color={includes(theme, ['question', 'template', 'player']) ? arrowColor : black}\n className={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n aria-label={ariaLabel}\n data-testid=\"select-arrow-down-icon\"\n />\n ) : null;\n const behaviorClassName = useMemo(\n () => getClassState(style.default, style.modified, style.error, modified, error),\n [error, modified]\n );\n const composedClassName = useMemo(\n () =>\n classnames(\n theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviorClassName,\n selected ? style.selected : style.unselected,\n className\n ),\n [behaviorClassName, className, selected, theme]\n );\n\n const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);\n\n const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);\n\n return (\n <div\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <label\n data-name=\"select-wrapper\"\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template'])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n >\n {selectedLabel}\n </span>\n {arrowView}\n <select\n data-name=\"native-select\"\n className={style.selectBox}\n title={selectedLabel}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool,\n validOption: PropTypes.bool\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool,\n 'aria-label': PropTypes.string\n};\n\nexport default Select;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,UAAU,GAAG;EACjBC,MAAM,EAAEC,cAAA,CAAMD,MADG;EAEjBE,OAAO,EAAED,cAAA,CAAMC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;EAOjBzD,WAAW,EAAEoD,kBAAA,CAAUC,MAPN;EAQjBtD,QAAQ,EAAEqD,kBAAA,CAAUK,IARH;EASjB7D,QAAQ,EAAEwD,kBAAA,CAAUU,IATH;EAUjB7D,KAAK,EAAEmD,kBAAA,CAAUW,KAAV,CAAgB,IAAAC,aAAA,EAAKvF,UAAL,CAAhB,CAVU;EAWjBgB,OAAO,EAAE2D,kBAAA,CAAUa,OAAV,CAAkBb,kBAAA,CAAUc,KAAV,CAAgBf,qBAAhB,CAAlB,CAXQ;EAYjBjD,QAAQ,EAAEkD,kBAAA,CAAUK,IAZH;EAajBtD,KAAK,EAAEiD,kBAAA,CAAUK,IAbA;EAcjB,cAAcL,kBAAA,CAAUC;AAdP,CAAnB;eAiBehE,M"}
@@ -2,7 +2,7 @@ export default TabContent;
2
2
  declare function TabContent(props: any): JSX.Element;
3
3
  declare namespace TabContent {
4
4
  namespace contextTypes {
5
- const translate: PropTypes.Validator<(...args: any[]) => any>;
5
+ const translate: PropTypes.Requireable<(...args: any[]) => any>;
6
6
  }
7
7
  namespace propTypes {
8
8
  const tabTitle: PropTypes.Requireable<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/answer/index.js"],"names":[],"mappings":";AAuEA,iDASC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/answer/index.js"],"names":[],"mappings":";AA4EA,iDASC"}
@@ -23,6 +23,8 @@ var _questionRange = _interopRequireDefault(require("../questions/question-range
23
23
 
24
24
  var _template = _interopRequireDefault(require("../questions/template"));
25
25
 
26
+ var _provider = _interopRequireDefault(require("../../atom/provider"));
27
+
26
28
  var _audio = _interopRequireDefault(require("../audio"));
27
29
 
28
30
  var _style = _interopRequireDefault(require("./style.css"));
@@ -86,6 +88,8 @@ MediaView.propTypes = process.env.NODE_ENV !== "production" ? _propTypes.MediaVi
86
88
  const Switch = ({
87
89
  model,
88
90
  help
91
+ }, {
92
+ translate
89
93
  }) => {
90
94
  const {
91
95
  type
@@ -107,7 +111,9 @@ const Switch = ({
107
111
  return /*#__PURE__*/_react.default.createElement(_freeText.default, model);
108
112
 
109
113
  case 'dropDown':
110
- return /*#__PURE__*/_react.default.createElement(_dropDown.default, model);
114
+ return /*#__PURE__*/_react.default.createElement(_dropDown.default, _extends({}, model, {
115
+ "aria-label": translate('drop_down_icon')
116
+ }));
111
117
 
112
118
  case 'slider':
113
119
  return /*#__PURE__*/_react.default.createElement(_questionRange.default, model);
@@ -121,6 +127,9 @@ Switch.propTypes = process.env.NODE_ENV !== "production" ? {
121
127
  model: _propTypes.default.model,
122
128
  help: _propTypes.default.help
123
129
  } : {};
130
+ Switch.contextTypes = {
131
+ translate: _provider.default.childContextTypes.translate
132
+ };
124
133
 
125
134
  const Answer = props => {
126
135
  const {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["MediaView","media","videoId","type","childProps","TYPE_IMAGE","style","backgroundImage","url","TYPE_VIDEO","video","TYPE_AUDIO","audio","propTypes","MediaViewPropTypes","Switch","model","help","Answer","props","wrapper"],"sources":["../../../src/molecule/answer/index.js"],"sourcesContent":["import React from 'react';\nimport {omit} from 'lodash/fp';\nimport VideoPlayer from '../video-player';\nimport DropDown from '../questions/drop-down';\nimport FreeText from '../questions/free-text';\nimport QcmDrag from '../questions/qcm-drag';\nimport Qcm from '../questions/qcm';\nimport QcmGraphic from '../questions/qcm-graphic';\nimport QuestionRange from '../questions/question-range';\nimport Template from '../questions/template';\nimport Audio from '../audio';\nimport style from './style.css';\nimport propTypes, {MediaViewPropTypes, TYPE_AUDIO, TYPE_IMAGE, TYPE_VIDEO} from './prop-types';\n\nconst MediaView = ({media}) => {\n const {videoId, type, ...childProps} = media;\n switch (type) {\n case TYPE_IMAGE:\n return (\n <div\n className={style.media}\n style={{\n backgroundImage: `url(${media.url})`\n }}\n />\n );\n case TYPE_VIDEO:\n return (\n <div className={style.video}>\n <VideoPlayer {...omit('id', childProps)} id={videoId} height=\"100%\" width=\"100%\" />\n </div>\n );\n case TYPE_AUDIO:\n return (\n <div className={style.audio}>\n <Audio {...omit('id', childProps)} height=\"100%\" width=\"100%\" />\n </div>\n );\n default:\n return null;\n }\n};\n\nMediaView.propTypes = MediaViewPropTypes;\n\nconst Switch = ({model, help}) => {\n const {type} = model;\n\n switch (type) {\n case 'qcmDrag':\n return <QcmDrag {...model} help={help} />;\n case 'qcm':\n return <Qcm {...model} />;\n case 'qcmGraphic':\n return <QcmGraphic {...model} />;\n case 'freeText':\n return <FreeText {...model} />;\n case 'dropDown':\n return <DropDown {...model} />;\n case 'slider':\n return <QuestionRange {...model} />;\n case 'template':\n return <Template {...model} />;\n }\n};\n\nSwitch.propTypes = {\n model: propTypes.model,\n help: propTypes.help\n};\n\nconst Answer = props => {\n const {model, media, help} = props;\n\n return (\n <div data-name=\"answer\" className={style.wrapper}>\n {media ? <MediaView media={media} /> : null}\n <Switch model={model} help={help} />\n </div>\n );\n};\n\nAnswer.propTypes = propTypes;\n\nexport default Answer;\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAEA,MAAMA,SAAS,GAAG,CAAC;EAACC;AAAD,CAAD,KAAa;EAC7B,MAAM;IAACC,OAAD;IAAUC;EAAV,IAAiCF,KAAvC;EAAA,MAAyBG,UAAzB,iCAAuCH,KAAvC;;EACA,QAAQE,IAAR;IACE,KAAKE,qBAAL;MACE,oBACE;QACE,SAAS,EAAEC,cAAA,CAAML,KADnB;QAEE,KAAK,EAAE;UACLM,eAAe,EAAG,OAAMN,KAAK,CAACO,GAAI;QAD7B;MAFT,EADF;;IAQF,KAAKC,qBAAL;MACE,oBACE;QAAK,SAAS,EAAEH,cAAA,CAAMI;MAAtB,gBACE,6BAAC,oBAAD,eAAiB,oBAAK,IAAL,EAAWN,UAAX,CAAjB;QAAyC,EAAE,EAAEF,OAA7C;QAAsD,MAAM,EA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,EAAEb,cAAA,CAAMc;EAAzC,GACGnB,KAAK,gBAAG,6BAAC,SAAD;IAAW,KAAK,EAAEA;EAAlB,EAAH,GAAiC,IADzC,eAEE,6BAAC,MAAD;IAAQ,KAAK,EAAEe,KAAf;IAAsB,IAAI,EAAEC;EAA5B,EAFF,CADF;AAMD,CATD;;AAWAC,MAAM,CAACL,SAAP,2CAAmBA,kBAAnB;eAEeK,M"}
1
+ {"version":3,"file":"index.js","names":["MediaView","media","videoId","type","childProps","TYPE_IMAGE","style","backgroundImage","url","TYPE_VIDEO","video","TYPE_AUDIO","audio","propTypes","MediaViewPropTypes","Switch","model","help","translate","contextTypes","Provider","childContextTypes","Answer","props","wrapper"],"sources":["../../../src/molecule/answer/index.js"],"sourcesContent":["import React from 'react';\nimport {omit} from 'lodash/fp';\nimport VideoPlayer from '../video-player';\nimport DropDown from '../questions/drop-down';\nimport FreeText from '../questions/free-text';\nimport QcmDrag from '../questions/qcm-drag';\nimport Qcm from '../questions/qcm';\nimport QcmGraphic from '../questions/qcm-graphic';\nimport QuestionRange from '../questions/question-range';\nimport Template from '../questions/template';\nimport Provider from '../../atom/provider';\nimport Audio from '../audio';\nimport style from './style.css';\nimport propTypes, {MediaViewPropTypes, TYPE_AUDIO, TYPE_IMAGE, TYPE_VIDEO} from './prop-types';\n\nconst MediaView = ({media}) => {\n const {videoId, type, ...childProps} = media;\n switch (type) {\n case TYPE_IMAGE:\n return (\n <div\n className={style.media}\n style={{\n backgroundImage: `url(${media.url})`\n }}\n />\n );\n case TYPE_VIDEO:\n return (\n <div className={style.video}>\n <VideoPlayer {...omit('id', childProps)} id={videoId} height=\"100%\" width=\"100%\" />\n </div>\n );\n case TYPE_AUDIO:\n return (\n <div className={style.audio}>\n <Audio {...omit('id', childProps)} height=\"100%\" width=\"100%\" />\n </div>\n );\n default:\n return null;\n }\n};\n\nMediaView.propTypes = MediaViewPropTypes;\n\nconst Switch = ({model, help}, {translate}) => {\n const {type} = model;\n\n switch (type) {\n case 'qcmDrag':\n return <QcmDrag {...model} help={help} />;\n case 'qcm':\n return <Qcm {...model} />;\n case 'qcmGraphic':\n return <QcmGraphic {...model} />;\n case 'freeText':\n return <FreeText {...model} />;\n case 'dropDown':\n return <DropDown {...model} aria-label={translate('drop_down_icon')} />;\n case 'slider':\n return <QuestionRange {...model} />;\n case 'template':\n return <Template {...model} />;\n }\n};\n\nSwitch.propTypes = {\n model: propTypes.model,\n help: propTypes.help\n};\n\nSwitch.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nconst Answer = props => {\n const {model, media, help} = props;\n\n return (\n <div data-name=\"answer\" className={style.wrapper}>\n {media ? <MediaView media={media} /> : null}\n <Switch model={model} help={help} />\n </div>\n );\n};\n\nAnswer.propTypes = propTypes;\n\nexport default Answer;\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAEA,MAAMA,SAAS,GAAG,CAAC;EAACC;AAAD,CAAD,KAAa;EAC7B,MAAM;IAACC,OAAD;IAAUC;EAAV,IAAiCF,KAAvC;EAAA,MAAyBG,UAAzB,iCAAuCH,KAAvC;;EACA,QAAQE,IAAR;IACE,KAAKE,qBAAL;MACE,oBACE;QACE,SAAS,EAAEC,cAAA,CAAML,KADnB;QAEE,KAAK,EAAE;UACLM,eAAe,EAAG,OAAMN,KAAK,CAACO,GAAI;QAD7B;MAFT,EADF;;IAQF,KAAKC,qBAAL;MACE,oBACE;QAAK,SAAS,EAAEH,cAAA,CAAMI;MAAtB,gBACE,6BAAC,oBAAD,eAAiB,oBAAK,IAAL,EAAWN,UAAX,CAAjB;QAAyC,EAAE,EAAEF,OAA7C;QAAsD,MAAM,EAAC,MAA7D;QAAoE,KAAK,EAAC;MAA1E,GADF,CADF;;IAKF,KAAKS,qBAAL;MACE,oBACE;QAAK,SAAS,EAAEL,cAAA,CAAMM;MAAtB,gBACE,6BAAC,cAAD,eAAW,oB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AAf;IAAwB,SAAS,EAAEjB,cAAA,CAAMkB;EAAzC,GACGvB,KAAK,gBAAG,6BAAC,SAAD;IAAW,KAAK,EAAEA;EAAlB,EAAH,GAAiC,IADzC,eAEE,6BAAC,MAAD;IAAQ,KAAK,EAAEe,KAAf;IAAsB,IAAI,EAAEC;EAA5B,EAFF,CADF;AAMD,CATD;;AAWAK,MAAM,CAACT,SAAP,2CAAmBA,kBAAnB;eAEeS,M"}
@@ -23,7 +23,7 @@ declare namespace BattleRequest {
23
23
  [x: string]: any;
24
24
  }>;
25
25
  }>>;
26
- const translate: PropTypes.Validator<(...args: any[]) => any>;
26
+ const translate: PropTypes.Requireable<(...args: any[]) => any>;
27
27
  }
28
28
  namespace propTypes {
29
29
  const username: PropTypes.Requireable<string>;
@@ -2,7 +2,7 @@ export default BrandCreateForm;
2
2
  declare function BrandCreateForm(props: any, context: any): JSX.Element;
3
3
  declare namespace BrandCreateForm {
4
4
  namespace contextTypes {
5
- const translate: PropTypes.Validator<(...args: any[]) => any>;
5
+ const translate: PropTypes.Requireable<(...args: any[]) => any>;
6
6
  }
7
7
  namespace propTypes {
8
8
  const title: PropTypes.Validator<string>;
@@ -81,7 +81,6 @@ declare namespace BrandFormGroup {
81
81
  type: PropTypes.Requireable<string>;
82
82
  size: PropTypes.Requireable<string>;
83
83
  title: PropTypes.Requireable<string>;
84
- moreAriaLabel: PropTypes.Requireable<string>;
85
84
  name: PropTypes.Requireable<string>;
86
85
  className: PropTypes.Requireable<string>;
87
86
  borderClassName: PropTypes.Requireable<string>;
@@ -99,6 +98,7 @@ declare namespace BrandFormGroup {
99
98
  }> | null | undefined)[]>;
100
99
  modified: PropTypes.Requireable<boolean>;
101
100
  error: PropTypes.Requireable<boolean>;
101
+ 'aria-label': PropTypes.Requireable<string>;
102
102
  }> | PropTypes.InferProps<{
103
103
  type: PropTypes.Requireable<string>;
104
104
  title: PropTypes.Validator<string>;
@@ -185,7 +185,6 @@ declare namespace BrandFormGroup {
185
185
  }> | PropTypes.InferProps<{
186
186
  type: PropTypes.Requireable<string>;
187
187
  title: PropTypes.Requireable<string>;
188
- moreAriaLabel: PropTypes.Requireable<string>;
189
188
  name: PropTypes.Requireable<string>;
190
189
  className: PropTypes.Requireable<string>;
191
190
  borderClassName: PropTypes.Requireable<string>;
@@ -203,6 +202,7 @@ declare namespace BrandFormGroup {
203
202
  }> | null | undefined)[]>;
204
203
  modified: PropTypes.Requireable<boolean>;
205
204
  error: PropTypes.Requireable<boolean>;
205
+ 'aria-label': PropTypes.Requireable<string>;
206
206
  }> | PropTypes.InferProps<{
207
207
  type: PropTypes.Requireable<string>;
208
208
  title: PropTypes.Validator<string>;
@@ -2,7 +2,7 @@ export default CardWithButton;
2
2
  declare function CardWithButton(props: any, context: any): JSX.Element;
3
3
  declare namespace CardWithButton {
4
4
  namespace contextTypes {
5
- const translate: PropTypes.Validator<(...args: any[]) => any>;
5
+ const translate: PropTypes.Requireable<(...args: any[]) => any>;
6
6
  const skin: PropTypes.Requireable<PropTypes.InferProps<{
7
7
  common: PropTypes.Requireable<{
8
8
  [x: string]: any;
@@ -26,7 +26,7 @@ declare namespace CookieBanner {
26
26
  [x: string]: any;
27
27
  }>;
28
28
  }>>;
29
- const translate: PropTypes.Validator<(...args: any[]) => any>;
29
+ const translate: PropTypes.Requireable<(...args: any[]) => any>;
30
30
  }
31
31
  namespace propTypes {
32
32
  const href: PropTypes.Requireable<string>;
@@ -35,7 +35,7 @@ declare class CardsList extends React.PureComponent<any, any, any> {
35
35
  [x: string]: any;
36
36
  }>;
37
37
  }>>;
38
- translate: PropTypes.Validator<(...args: any[]) => any>;
38
+ translate: PropTypes.Requireable<(...args: any[]) => any>;
39
39
  };
40
40
  constructor(props: any);
41
41
  state: {
@@ -2,7 +2,7 @@ export default DisciplinePartners;
2
2
  declare function DisciplinePartners(props: any, context: any): JSX.Element | null;
3
3
  declare namespace DisciplinePartners {
4
4
  namespace contextTypes {
5
- const translate: PropTypes.Validator<(...args: any[]) => any>;
5
+ const translate: PropTypes.Requireable<(...args: any[]) => any>;
6
6
  const skin: PropTypes.Requireable<PropTypes.InferProps<{
7
7
  common: PropTypes.Requireable<{
8
8
  [x: string]: any;
@@ -6,7 +6,7 @@ declare class ExternalContentButton extends React.Component<any, any, any> {
6
6
  onClick: PropTypes.Requireable<(...args: any[]) => any>;
7
7
  };
8
8
  static contextTypes: {
9
- translate: PropTypes.Validator<(...args: any[]) => any>;
9
+ translate: PropTypes.Requireable<(...args: any[]) => any>;
10
10
  };
11
11
  constructor(props: any, context: any);
12
12
  handleClick: (e: any) => void;
@@ -13,7 +13,6 @@ declare class Filters extends React.Component<any, any, any> {
13
13
  }> | null | undefined)[]>;
14
14
  sorting: PropTypes.Requireable<PropTypes.InferProps<{
15
15
  title: PropTypes.Requireable<string>;
16
- moreAriaLabel: PropTypes.Requireable<string>;
17
16
  name: PropTypes.Requireable<string>;
18
17
  className: PropTypes.Requireable<string>;
19
18
  borderClassName: PropTypes.Requireable<string>;
@@ -31,6 +30,7 @@ declare class Filters extends React.Component<any, any, any> {
31
30
  }> | null | undefined)[]>;
32
31
  modified: PropTypes.Requireable<boolean>;
33
32
  error: PropTypes.Requireable<boolean>;
33
+ 'aria-label': PropTypes.Requireable<string>;
34
34
  }>>;
35
35
  onSearch: PropTypes.Requireable<(...args: any[]) => any>;
36
36
  onToggleFilters: PropTypes.Requireable<(...args: any[]) => any>;
@@ -2,7 +2,7 @@ export default ForumComment;
2
2
  declare function ForumComment(props: any, context: any): JSX.Element;
3
3
  declare namespace ForumComment {
4
4
  namespace contextTypes {
5
- const translate: PropTypes.Validator<(...args: any[]) => any>;
5
+ const translate: PropTypes.Requireable<(...args: any[]) => any>;
6
6
  const skin: PropTypes.Requireable<PropTypes.InferProps<{
7
7
  common: PropTypes.Requireable<{
8
8
  [x: string]: any;
@@ -2,7 +2,7 @@ export default ForumPost;
2
2
  declare function ForumPost(props: any, context: any): JSX.Element;
3
3
  declare namespace ForumPost {
4
4
  namespace contextTypes {
5
- const translate: PropTypes.Validator<(...args: any[]) => any>;
5
+ const translate: PropTypes.Requireable<(...args: any[]) => any>;
6
6
  const skin: PropTypes.Requireable<PropTypes.InferProps<{
7
7
  common: PropTypes.Requireable<{
8
8
  [x: string]: any;