@coorpacademy/components 11.11.1-alpha.0 → 11.11.1

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 (143) hide show
  1. package/es/atom/input-search/index.d.ts.map +1 -1
  2. package/es/atom/input-search/index.js +1 -0
  3. package/es/atom/input-search/index.js.map +1 -1
  4. package/es/atom/input-switch/index.d.ts +2 -0
  5. package/es/atom/input-switch/index.d.ts.map +1 -1
  6. package/es/atom/input-switch/index.js +23 -11
  7. package/es/atom/input-switch/index.js.map +1 -1
  8. package/es/atom/select/index.d.ts +1 -0
  9. package/es/atom/select/index.d.ts.map +1 -1
  10. package/es/atom/select/index.js +13 -8
  11. package/es/atom/select/index.js.map +1 -1
  12. package/es/atom/tooltip/index.d.ts +1 -3
  13. package/es/atom/tooltip/index.d.ts.map +1 -1
  14. package/es/atom/tooltip/index.js +7 -17
  15. package/es/atom/tooltip/index.js.map +1 -1
  16. package/es/atom/tooltip/style.css +2 -10
  17. package/es/globals.d.js.map +1 -1
  18. package/es/molecule/brand-form-group/index.d.ts +8 -0
  19. package/es/molecule/cm-popin/types.d.ts +2 -0
  20. package/es/molecule/cm-popin/types.d.ts.map +1 -1
  21. package/es/molecule/draggable-list/index.d.ts +2 -0
  22. package/es/molecule/filters/filters-wrapper.d.ts.map +1 -1
  23. package/es/molecule/filters/filters-wrapper.js +4 -1
  24. package/es/molecule/filters/filters-wrapper.js.map +1 -1
  25. package/es/molecule/filters/index.d.ts +2 -0
  26. package/es/molecule/filters/index.d.ts.map +1 -1
  27. package/es/molecule/filters/index.js +10 -3
  28. package/es/molecule/filters/index.js.map +1 -1
  29. package/es/molecule/setup-section/index.d.ts +2 -0
  30. package/es/molecule/setup-section/index.d.ts.map +1 -1
  31. package/es/molecule/setup-sections/index.d.ts +2 -0
  32. package/es/molecule/setup-slide/index.d.ts +3 -0
  33. package/es/molecule/setup-slider/index.d.ts +3 -0
  34. package/es/organism/brand-form/index.d.ts +8 -0
  35. package/es/organism/mooc-header/index.d.ts.map +1 -1
  36. package/es/organism/mooc-header/index.js +4 -1
  37. package/es/organism/mooc-header/index.js.map +1 -1
  38. package/es/organism/user-preferences/index.d.ts +2 -0
  39. package/es/organism/wizard-contents/index.d.ts +8 -0
  40. package/es/template/activity/index.d.ts +12 -11
  41. package/es/template/activity/index.d.ts.map +1 -1
  42. package/es/template/activity/index.js +6 -3
  43. package/es/template/activity/index.js.map +1 -1
  44. package/es/template/app-player/loading/index.d.ts +2 -0
  45. package/es/template/app-player/player/index.d.ts +4 -0
  46. package/es/template/app-player/player/slides/index.d.ts +2 -0
  47. package/es/template/app-player/player/slides/index.d.ts.map +1 -1
  48. package/es/template/app-player/popin-correction/index.d.ts +2 -0
  49. package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
  50. package/es/template/app-player/popin-end/index.d.ts +2 -0
  51. package/es/template/app-review/index.d.ts +2 -0
  52. package/es/template/app-review/index.d.ts.map +1 -1
  53. package/es/template/app-review/player/prop-types.d.ts +2 -0
  54. package/es/template/app-review/player/prop-types.d.ts.map +1 -1
  55. package/es/template/app-review/prop-types.d.ts +2 -0
  56. package/es/template/app-review/prop-types.d.ts.map +1 -1
  57. package/es/template/back-office/brand-update/index.d.ts +18 -0
  58. package/es/template/common/dashboard/index.d.ts +2 -0
  59. package/es/template/common/search-page/index.d.ts +3 -0
  60. package/es/template/common/search-page/index.d.ts.map +1 -1
  61. package/es/template/common/search-page/index.js +6 -3
  62. package/es/template/common/search-page/index.js.map +1 -1
  63. package/lib/atom/input-search/index.d.ts.map +1 -1
  64. package/lib/atom/input-search/index.js +1 -0
  65. package/lib/atom/input-search/index.js.map +1 -1
  66. package/lib/atom/input-switch/index.d.ts +2 -0
  67. package/lib/atom/input-switch/index.d.ts.map +1 -1
  68. package/lib/atom/input-switch/index.js +22 -11
  69. package/lib/atom/input-switch/index.js.map +1 -1
  70. package/lib/atom/select/index.d.ts +1 -0
  71. package/lib/atom/select/index.d.ts.map +1 -1
  72. package/lib/atom/select/index.js +13 -8
  73. package/lib/atom/select/index.js.map +1 -1
  74. package/lib/atom/tooltip/index.d.ts +1 -3
  75. package/lib/atom/tooltip/index.d.ts.map +1 -1
  76. package/lib/atom/tooltip/index.js +7 -18
  77. package/lib/atom/tooltip/index.js.map +1 -1
  78. package/lib/atom/tooltip/style.css +2 -10
  79. package/lib/globals.d.js.map +1 -1
  80. package/lib/molecule/brand-form-group/index.d.ts +8 -0
  81. package/lib/molecule/cm-popin/types.d.ts +2 -0
  82. package/lib/molecule/cm-popin/types.d.ts.map +1 -1
  83. package/lib/molecule/draggable-list/index.d.ts +2 -0
  84. package/lib/molecule/filters/filters-wrapper.d.ts.map +1 -1
  85. package/lib/molecule/filters/filters-wrapper.js +4 -1
  86. package/lib/molecule/filters/filters-wrapper.js.map +1 -1
  87. package/lib/molecule/filters/index.d.ts +2 -0
  88. package/lib/molecule/filters/index.d.ts.map +1 -1
  89. package/lib/molecule/filters/index.js +9 -3
  90. package/lib/molecule/filters/index.js.map +1 -1
  91. package/lib/molecule/setup-section/index.d.ts +2 -0
  92. package/lib/molecule/setup-section/index.d.ts.map +1 -1
  93. package/lib/molecule/setup-sections/index.d.ts +2 -0
  94. package/lib/molecule/setup-slide/index.d.ts +3 -0
  95. package/lib/molecule/setup-slider/index.d.ts +3 -0
  96. package/lib/organism/brand-form/index.d.ts +8 -0
  97. package/lib/organism/mooc-header/index.d.ts.map +1 -1
  98. package/lib/organism/mooc-header/index.js +4 -1
  99. package/lib/organism/mooc-header/index.js.map +1 -1
  100. package/lib/organism/user-preferences/index.d.ts +2 -0
  101. package/lib/organism/wizard-contents/index.d.ts +8 -0
  102. package/lib/template/activity/index.d.ts +12 -11
  103. package/lib/template/activity/index.d.ts.map +1 -1
  104. package/lib/template/activity/index.js +6 -3
  105. package/lib/template/activity/index.js.map +1 -1
  106. package/lib/template/app-player/loading/index.d.ts +2 -0
  107. package/lib/template/app-player/player/index.d.ts +4 -0
  108. package/lib/template/app-player/player/slides/index.d.ts +2 -0
  109. package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
  110. package/lib/template/app-player/popin-correction/index.d.ts +2 -0
  111. package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
  112. package/lib/template/app-player/popin-end/index.d.ts +2 -0
  113. package/lib/template/app-review/index.d.ts +2 -0
  114. package/lib/template/app-review/index.d.ts.map +1 -1
  115. package/lib/template/app-review/player/prop-types.d.ts +2 -0
  116. package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
  117. package/lib/template/app-review/prop-types.d.ts +2 -0
  118. package/lib/template/app-review/prop-types.d.ts.map +1 -1
  119. package/lib/template/back-office/brand-update/index.d.ts +18 -0
  120. package/lib/template/common/dashboard/index.d.ts +2 -0
  121. package/lib/template/common/search-page/index.d.ts +3 -0
  122. package/lib/template/common/search-page/index.d.ts.map +1 -1
  123. package/lib/template/common/search-page/index.js +6 -3
  124. package/lib/template/common/search-page/index.js.map +1 -1
  125. package/package.json +2 -2
  126. package/es/atom/battle-opponent/index.d.ts +0 -19
  127. package/es/atom/battle-opponent/index.d.ts.map +0 -1
  128. package/es/atom/battle-opponent/index.js +0 -52
  129. package/es/atom/battle-opponent/index.js.map +0 -1
  130. package/es/atom/battle-opponent/prop-types.d.ts +0 -19
  131. package/es/atom/battle-opponent/prop-types.d.ts.map +0 -1
  132. package/es/atom/battle-opponent/prop-types.js +0 -11
  133. package/es/atom/battle-opponent/prop-types.js.map +0 -1
  134. package/es/atom/battle-opponent/style.css +0 -126
  135. package/lib/atom/battle-opponent/index.d.ts +0 -19
  136. package/lib/atom/battle-opponent/index.d.ts.map +0 -1
  137. package/lib/atom/battle-opponent/index.js +0 -70
  138. package/lib/atom/battle-opponent/index.js.map +0 -1
  139. package/lib/atom/battle-opponent/prop-types.d.ts +0 -19
  140. package/lib/atom/battle-opponent/prop-types.d.ts.map +0 -1
  141. package/lib/atom/battle-opponent/prop-types.js +0 -20
  142. package/lib/atom/battle-opponent/prop-types.js.map +0 -1
  143. package/lib/atom/battle-opponent/style.css +0 -126
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/input-search/index.js"],"names":[],"mappings":";AAYA,iDA+CC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/input-search/index.js"],"names":[],"mappings":";AAYA,iDAgDC"}
@@ -39,6 +39,7 @@ const Search = props => {
39
39
  name: "search",
40
40
  id: "search",
41
41
  placeholder: placeholder,
42
+ title: placeholder,
42
43
  value: value,
43
44
  onInput: handleChange,
44
45
  onFocus: onFocus,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useMemo","PropTypes","classnames","NovaCompositionCoorpacademySearchThin","CMSearchIcon","NovaCompositionCoorpacademySearch","SearchIcon","NovaSolidStatusClose","CloseIcon","Provider","style","Search","props","value","placeholder","onChange","onClear","onFocus","onBlur","theme","handleChange","e","target","cmStyle","coorpmanager","isDefaultTheme","wrapperSearch","searchIcon","title","noValue","search","clearIcon","contextTypes","skin","childContextTypes","propTypes","string","isRequired","func","oneOf"],"sources":["../../../src/atom/input-search/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademySearchThin as CMSearchIcon,\n NovaCompositionCoorpacademySearch as SearchIcon,\n NovaSolidStatusClose as CloseIcon\n} from '@coorpacademy/nova-icons';\nimport {noop, isEmpty} from 'lodash/fp';\nimport Provider from '../provider';\nimport style from './style.css';\n\nconst Search = props => {\n const {\n value,\n placeholder,\n onChange = noop,\n onClear = noop,\n onFocus,\n onBlur,\n theme = 'default'\n } = props;\n const handleChange = useMemo(() => e => onChange(e.target.value), [onChange]);\n const cmStyle = classnames(style.coorpmanager);\n const isDefaultTheme = theme === 'default';\n\n return (\n <div className={isDefaultTheme ? style.wrapperSearch : cmStyle}>\n <label htmlFor=\"search\" title={placeholder}>\n {!isDefaultTheme ? (\n <CMSearchIcon className={style.searchIcon} />\n ) : (\n <SearchIcon className={style.searchIcon} />\n )}\n {!isDefaultTheme ? (\n <span className={classnames(style.title, isEmpty(value) && style.noValue)}>\n {placeholder}\n </span>\n ) : null}\n </label>\n <input\n data-name=\"search-input\"\n className={style.search}\n aria-label={placeholder}\n type=\"text\"\n name=\"search\"\n id=\"search\"\n placeholder={placeholder}\n value={value}\n onInput={handleChange}\n onFocus={onFocus}\n onChange={noop}\n onBlur={onBlur}\n />\n {value && !isDefaultTheme ? (\n <CloseIcon onClick={onClear} className={style.clearIcon} />\n ) : null}\n </div>\n );\n};\n\nSearch.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSearch.propTypes = {\n value: PropTypes.string,\n placeholder: PropTypes.string.isRequired,\n onChange: PropTypes.func,\n onClear: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n theme: PropTypes.oneOf(['default', 'coorpmanager'])\n};\n\nexport default Search;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SACEC,qCAAqC,IAAIC,YAD3C,EAEEC,iCAAiC,IAAIC,UAFvC,EAGEC,oBAAoB,IAAIC,SAH1B,QAIO,0BAJP;AAMA,OAAOC,QAAP,MAAqB,aAArB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,MAAM,GAAGC,KAAK,IAAI;EACtB,MAAM;IACJC,KADI;IAEJC,WAFI;IAGJC,QAAQ,QAHJ;IAIJC,OAAO,QAJH;IAKJC,OALI;IAMJC,MANI;IAOJC,KAAK,GAAG;EAPJ,IAQFP,KARJ;EASA,MAAMQ,YAAY,GAAGpB,OAAO,CAAC,MAAMqB,CAAC,IAAIN,QAAQ,CAACM,CAAC,CAACC,MAAF,CAAST,KAAV,CAApB,EAAsC,CAACE,QAAD,CAAtC,CAA5B;EACA,MAAMQ,OAAO,GAAGrB,UAAU,CAACQ,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S,CAACqC,IAHH;EAIjBtB,OAAO,EAAEf,SAAS,CAACqC,IAJF;EAKjBrB,OAAO,EAAEhB,SAAS,CAACqC,IALF;EAMjBpB,MAAM,EAAEjB,SAAS,CAACqC,IAND;EAOjBnB,KAAK,EAAElB,SAAS,CAACsC,KAAV,CAAgB,CAAC,SAAD,EAAY,cAAZ,CAAhB;AAPU,CAAnB;AAUA,eAAe5B,MAAf"}
1
+ {"version":3,"file":"index.js","names":["React","useMemo","PropTypes","classnames","NovaCompositionCoorpacademySearchThin","CMSearchIcon","NovaCompositionCoorpacademySearch","SearchIcon","NovaSolidStatusClose","CloseIcon","Provider","style","Search","props","value","placeholder","onChange","onClear","onFocus","onBlur","theme","handleChange","e","target","cmStyle","coorpmanager","isDefaultTheme","wrapperSearch","searchIcon","title","noValue","search","clearIcon","contextTypes","skin","childContextTypes","propTypes","string","isRequired","func","oneOf"],"sources":["../../../src/atom/input-search/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademySearchThin as CMSearchIcon,\n NovaCompositionCoorpacademySearch as SearchIcon,\n NovaSolidStatusClose as CloseIcon\n} from '@coorpacademy/nova-icons';\nimport {noop, isEmpty} from 'lodash/fp';\nimport Provider from '../provider';\nimport style from './style.css';\n\nconst Search = props => {\n const {\n value,\n placeholder,\n onChange = noop,\n onClear = noop,\n onFocus,\n onBlur,\n theme = 'default'\n } = props;\n const handleChange = useMemo(() => e => onChange(e.target.value), [onChange]);\n const cmStyle = classnames(style.coorpmanager);\n const isDefaultTheme = theme === 'default';\n\n return (\n <div className={isDefaultTheme ? style.wrapperSearch : cmStyle}>\n <label htmlFor=\"search\" title={placeholder}>\n {!isDefaultTheme ? (\n <CMSearchIcon className={style.searchIcon} />\n ) : (\n <SearchIcon className={style.searchIcon} />\n )}\n {!isDefaultTheme ? (\n <span className={classnames(style.title, isEmpty(value) && style.noValue)}>\n {placeholder}\n </span>\n ) : null}\n </label>\n <input\n data-name=\"search-input\"\n className={style.search}\n aria-label={placeholder}\n type=\"text\"\n name=\"search\"\n id=\"search\"\n placeholder={placeholder}\n title={placeholder}\n value={value}\n onInput={handleChange}\n onFocus={onFocus}\n onChange={noop}\n onBlur={onBlur}\n />\n {value && !isDefaultTheme ? (\n <CloseIcon onClick={onClear} className={style.clearIcon} />\n ) : null}\n </div>\n );\n};\n\nSearch.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSearch.propTypes = {\n value: PropTypes.string,\n placeholder: PropTypes.string.isRequired,\n onChange: PropTypes.func,\n onClear: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n theme: PropTypes.oneOf(['default', 'coorpmanager'])\n};\n\nexport default Search;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SACEC,qCAAqC,IAAIC,YAD3C,EAEEC,iCAAiC,IAAIC,UAFvC,EAGEC,oBAAoB,IAAIC,SAH1B,QAIO,0BAJP;AAMA,OAAOC,QAAP,MAAqB,aAArB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,MAAM,GAAGC,KAAK,IAAI;EACtB,MAAM;IACJC,KADI;IAEJC,WAFI;IAGJC,QAAQ,QAHJ;IAIJC,OAAO,QAJH;IAKJC,OALI;IAMJC,MANI;IAOJC,KAAK,GAAG;EAPJ,IAQFP,KARJ;EASA,MAAMQ,YAAY,GAAGpB,OAAO,CAAC,MAAMqB,CAAC,IAAIN,QAAQ,CAACM,CAAC,CAACC,MAAF,CAAST,KAAV,CAApB,EAAsC,CAACE,QAAD,CAAtC,CAA5B;EACA,MAAMQ,OAAO,GAAGrB,UAAU,CAACQ,KAAK,CAACc,YAAP,CAA1B;EACA,MAAMC,cAAc,GAAGN,KAAK,KAAK,SAAjC;EAEA,oBACE;IAAK,SAAS,EAAEM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AAEhB,SAAS,CAACqC,IALF;EAMjBpB,MAAM,EAAEjB,SAAS,CAACqC,IAND;EAOjBnB,KAAK,EAAElB,SAAS,CAACsC,KAAV,CAAgB,CAAC,SAAD,EAAY,cAAZ,CAAhB;AAPU,CAAnB;AAUA,eAAe5B,MAAf"}
@@ -9,6 +9,8 @@ declare namespace InputSwitch {
9
9
  disabled: PropTypes.Requireable<boolean>;
10
10
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
11
11
  description: PropTypes.Requireable<string>;
12
+ 'aria-labelledby': PropTypes.Requireable<string>;
13
+ 'aria-label': PropTypes.Requireable<string>;
12
14
  modified: PropTypes.Requireable<boolean>;
13
15
  titlePosition: PropTypes.Requireable<string>;
14
16
  theme: PropTypes.Requireable<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/input-switch/index.js"],"names":[],"mappings":";AAMA,sDAuEC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/input-switch/index.js"],"names":[],"mappings":";AAMA,sDAgFC"}
@@ -1,5 +1,8 @@
1
1
  import _uniqueId from "lodash/fp/uniqueId";
2
2
  import _noop from "lodash/fp/noop";
3
+
4
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
5
+
3
6
  import React, { useMemo } from 'react';
4
7
  import PropTypes from 'prop-types';
5
8
  import getClassState from '../../util/get-class-state';
@@ -19,7 +22,9 @@ const InputSwitch = props => {
19
22
  titlePosition = 'left',
20
23
  details = '',
21
24
  requiredSelection = false,
22
- 'data-name': dataName
25
+ 'data-name': dataName,
26
+ 'aria-labelledby': ariaLabelledBy,
27
+ 'aria-label': ariaLabel
23
28
  } = props;
24
29
 
25
30
  const idSwitch = id || _uniqueId('input-switch-');
@@ -27,8 +32,9 @@ const InputSwitch = props => {
27
32
  const isDisabled = disabled ? 'disabled' : '';
28
33
  const handleChange = useMemo(() => e => onChange(e.target.checked), [onChange]);
29
34
  const titleView = title ? /*#__PURE__*/React.createElement("span", {
35
+ id: `title-view-${dataName}`,
30
36
  className: style.title
31
- }, `${title} `) : null;
37
+ }, `${title} `, ' ') : null;
32
38
  const descriptionView = description ? /*#__PURE__*/React.createElement("div", {
33
39
  className: style.description
34
40
  }, description) : null;
@@ -63,13 +69,17 @@ const InputSwitch = props => {
63
69
  return /*#__PURE__*/React.createElement("div", {
64
70
  className: className,
65
71
  "data-name": `switch-input-${theme}${dataName}`
66
- }, titlePosition === 'left' ? /*#__PURE__*/React.createElement("div", {
67
- id: `title-view-${dataName}`
68
- }, titleView, " ") : null, /*#__PURE__*/React.createElement("div", {
72
+ }, titlePosition === 'left' ? titleView : null, /*#__PURE__*/React.createElement("div", {
69
73
  className: requiredSelection ? style.requiredSelection : null
70
74
  }, /*#__PURE__*/React.createElement("div", {
71
75
  className: style.btnSwitchContainer
72
- }, /*#__PURE__*/React.createElement("input", {
76
+ }, /*#__PURE__*/React.createElement("input", _extends({}, ariaLabelledBy ? {
77
+ 'aria-labelledby': ariaLabelledBy
78
+ } : {}, title ? {
79
+ 'aria-labelledby': `title-view-${dataName}`
80
+ } : {}, ariaLabel && !ariaLabelledBy && !title ? {
81
+ 'aria-label': ariaLabel
82
+ } : {}, {
73
83
  type: "checkbox",
74
84
  id: idSwitch,
75
85
  name: name,
@@ -77,16 +87,16 @@ const InputSwitch = props => {
77
87
  checked: value,
78
88
  disabled: isDisabled,
79
89
  className: style.checkbox,
80
- "aria-labelledby": `title-view-${dataName}`
81
- }), /*#__PURE__*/React.createElement("label", {
90
+ "aria-labelledby": ariaLabelledBy
91
+ })), /*#__PURE__*/React.createElement("label", {
82
92
  htmlFor: idSwitch,
83
93
  "data-name": "input-switch-label",
84
94
  tabIndex: 0
85
95
  }))), /*#__PURE__*/React.createElement("div", {
86
96
  className: !details ? style.alignedTextContainer : null
87
- }, titlePosition === 'right' ? /*#__PURE__*/React.createElement("div", {
88
- id: `title-view-${dataName}`
89
- }, titleView, " ") : null, details ? /*#__PURE__*/React.createElement("div", {
97
+ }, titlePosition === 'right' ? {
98
+ titleView
99
+ } : null, details ? /*#__PURE__*/React.createElement("div", {
90
100
  className: style.detailsTxt
91
101
  }, details) : null), descriptionView);
92
102
  };
@@ -99,6 +109,8 @@ InputSwitch.propTypes = process.env.NODE_ENV !== "production" ? {
99
109
  disabled: PropTypes.bool,
100
110
  onChange: PropTypes.func,
101
111
  description: PropTypes.string,
112
+ 'aria-labelledby': PropTypes.string,
113
+ 'aria-label': PropTypes.string,
102
114
  modified: PropTypes.bool,
103
115
  titlePosition: PropTypes.oneOf(['right', 'left']),
104
116
  theme: PropTypes.oneOf(['default', 'coorpmanager', 'mooc']),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useMemo","PropTypes","getClassState","style","InputSwitch","props","title","name","id","value","disabled","onChange","description","modified","theme","titlePosition","details","requiredSelection","dataName","idSwitch","isDisabled","handleChange","e","target","checked","titleView","descriptionView","getClass","defaultClass","coorpmanager","modifiedClass","coorpmanagerModified","partielUncheck","default","className","btnSwitchContainer","checkbox","alignedTextContainer","detailsTxt","propTypes","string","bool","func","oneOf"],"sources":["../../../src/atom/input-switch/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {noop, uniqueId} from 'lodash/fp';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst InputSwitch = props => {\n const {\n title,\n name,\n id,\n value,\n disabled,\n onChange = noop,\n description,\n modified = false,\n theme = 'default',\n titlePosition = 'left',\n details = '',\n requiredSelection = false,\n 'data-name': dataName\n } = props;\n\n const idSwitch = id || uniqueId('input-switch-');\n const isDisabled = disabled ? 'disabled' : '';\n const handleChange = useMemo(() => e => onChange(e.target.checked), [onChange]);\n\n const titleView = title ? <span className={style.title}>{`${title} `}</span> : null;\n\n const descriptionView = description ? (\n <div className={style.description}>{description}</div>\n ) : null;\n\n const getClass = () => {\n switch (theme) {\n case 'coorpmanager':\n return {\n defaultClass: style.coorpmanager,\n modifiedClass: style.coorpmanagerModified\n };\n case 'mooc':\n return {\n defaultClass: style.partielUncheck,\n modifiedClass: style.coorpmanagerModified\n };\n default:\n return {defaultClass: style.default, modifiedClass: style.modified};\n }\n };\n const {defaultClass, modifiedClass} = getClass();\n const className = getClassState(defaultClass, modifiedClass, null, modified);\n\n return (\n <div className={className} data-name={`switch-input-${theme}${dataName}`}>\n {titlePosition === 'left' ? <div id={`title-view-${dataName}`}>{titleView} </div> : null}\n <div className={requiredSelection ? style.requiredSelection : null}>\n <div className={style.btnSwitchContainer}>\n <input\n type=\"checkbox\"\n id={idSwitch}\n name={name}\n onChange={handleChange}\n checked={value}\n disabled={isDisabled}\n className={style.checkbox}\n aria-labelledby={`title-view-${dataName}`}\n />\n <label htmlFor={idSwitch} data-name=\"input-switch-label\" tabIndex={0} />\n </div>\n </div>\n <div className={!details ? style.alignedTextContainer : null}>\n {titlePosition === 'right' ? <div id={`title-view-${dataName}`}>{titleView} </div> : null}\n {details ? <div className={style.detailsTxt}>{details}</div> : null}\n </div>\n {descriptionView}\n </div>\n );\n};\n\nInputSwitch.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n id: PropTypes.string,\n value: PropTypes.bool,\n disabled: PropTypes.bool,\n onChange: PropTypes.func,\n description: PropTypes.string,\n modified: PropTypes.bool,\n titlePosition: PropTypes.oneOf(['right', 'left']),\n theme: PropTypes.oneOf(['default', 'coorpmanager', 'mooc']),\n details: PropTypes.string,\n 'data-name': PropTypes.string,\n requiredSelection: PropTypes.bool\n};\nexport default InputSwitch;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,aAAP,MAA0B,4BAA1B;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AA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EN,SAAS,CAACuC,MAFM;EAGtBhC,EAAE,EAAEP,SAAS,CAACuC,MAHQ;EAItB/B,KAAK,EAAER,SAAS,CAACwC,IAJK;EAKtB/B,QAAQ,EAAET,SAAS,CAACwC,IALE;EAMtB9B,QAAQ,EAAEV,SAAS,CAACyC,IANE;EAOtB9B,WAAW,EAAEX,SAAS,CAACuC,MAPD;EAQtB3B,QAAQ,EAAEZ,SAAS,CAACwC,IARE;EAStB1B,aAAa,EAAEd,SAAS,CAAC0C,KAAV,CAAgB,CAAC,OAAD,EAAU,MAAV,CAAhB,CATO;EAUtB7B,KAAK,EAAEb,SAAS,CAAC0C,KAAV,CAAgB,CAAC,SAAD,EAAY,cAAZ,EAA4B,MAA5B,CAAhB,CAVe;EAWtB3B,OAAO,EAAEf,SAAS,CAACuC,MAXG;EAYtB,aAAavC,SAAS,CAACuC,MAZD;EAatBvB,iBAAiB,EAAEhB,SAAS,CAACwC;AAbP,CAAxB;AAeA,eAAerC,WAAf"}
1
+ {"version":3,"file":"index.js","names":["React","useMemo","PropTypes","getClassState","style","InputSwitch","props","title","name","id","value","disabled","onChange","description","modified","theme","titlePosition","details","requiredSelection","dataName","ariaLabelledBy","ariaLabel","idSwitch","isDisabled","handleChange","e","target","checked","titleView","descriptionView","getClass","defaultClass","coorpmanager","modifiedClass","coorpmanagerModified","partielUncheck","default","className","btnSwitchContainer","checkbox","alignedTextContainer","detailsTxt","propTypes","string","bool","func","oneOf"],"sources":["../../../src/atom/input-switch/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {noop, uniqueId} from 'lodash/fp';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst InputSwitch = props => {\n const {\n title,\n name,\n id,\n value,\n disabled,\n onChange = noop,\n description,\n modified = false,\n theme = 'default',\n titlePosition = 'left',\n details = '',\n requiredSelection = false,\n 'data-name': dataName,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-label': ariaLabel\n } = props;\n\n const idSwitch = id || uniqueId('input-switch-');\n const isDisabled = disabled ? 'disabled' : '';\n const handleChange = useMemo(() => e => onChange(e.target.checked), [onChange]);\n\n const titleView = title ? (\n <span id={`title-view-${dataName}`} className={style.title}>\n {`${title} `}{' '}\n </span>\n ) : null;\n\n const descriptionView = description ? (\n <div className={style.description}>{description}</div>\n ) : null;\n\n const getClass = () => {\n switch (theme) {\n case 'coorpmanager':\n return {\n defaultClass: style.coorpmanager,\n modifiedClass: style.coorpmanagerModified\n };\n case 'mooc':\n return {\n defaultClass: style.partielUncheck,\n modifiedClass: style.coorpmanagerModified\n };\n default:\n return {defaultClass: style.default, modifiedClass: style.modified};\n }\n };\n const {defaultClass, modifiedClass} = getClass();\n const className = getClassState(defaultClass, modifiedClass, null, modified);\n\n return (\n <div className={className} data-name={`switch-input-${theme}${dataName}`}>\n {titlePosition === 'left' ? titleView : null}\n <div className={requiredSelection ? style.requiredSelection : null}>\n <div className={style.btnSwitchContainer}>\n <input\n {...(ariaLabelledBy ? {'aria-labelledby': ariaLabelledBy} : {})}\n {...(title ? {'aria-labelledby': `title-view-${dataName}`} : {})}\n {...(ariaLabel && !ariaLabelledBy && !title ? {'aria-label': ariaLabel} : {})}\n type=\"checkbox\"\n id={idSwitch}\n name={name}\n onChange={handleChange}\n checked={value}\n disabled={isDisabled}\n className={style.checkbox}\n aria-labelledby={ariaLabelledBy}\n />\n <label htmlFor={idSwitch} data-name=\"input-switch-label\" tabIndex={0} />\n </div>\n </div>\n <div className={!details ? style.alignedTextContainer : null}>\n {titlePosition === 'right' ? {titleView} : null}\n {details ? <div className={style.detailsTxt}>{details}</div> : null}\n </div>\n {descriptionView}\n </div>\n );\n};\n\nInputSwitch.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n id: PropTypes.string,\n value: PropTypes.bool,\n disabled: PropTypes.bool,\n onChange: PropTypes.func,\n description: PropTypes.string,\n 'aria-labelledby': PropTypes.string,\n 'aria-label': PropTypes.string,\n modified: PropTypes.bool,\n titlePosition: PropTypes.oneOf(['right', 'left']),\n theme: PropTypes.oneOf(['default', 'coorpmanager', 'mooc']),\n details: PropTypes.string,\n 'data-name': PropTypes.string,\n requiredSelection: PropTypes.bool\n};\nexport default InputSwitch;\n"],"mappings":";;;;;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,aAAP,MAA0B,4BAA1B;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,WAAW,GAAGC,KAAK,IAAI;EAC3B,MAAM;IACJC,KADI;IAEJC,IAFI;IAGJC,EAHI;IAIJC,KAJI;IAKJC,QALI;IAMJC,QAAQ,QANJ;IAOJC,WAPI;IAQJC,QAAQ,GAAG,KARP;IASJC,KAAK,GAAG,SATJ;IAUJC,aAAa,GAAG,MAVZ;IAWJC,OAAO,GAAG,EAXN;IAYJC,iBAAiB,GAAG,KAZhB;IAaJ,aAAaC,QAbT;IAcJ,mBAAmBC,cAdf;IAeJ,cAAcC;EAfV,IAgBFf,KAhBJ;;EAkBA,MAAMgB,QAAQ,GAAGb,EAAE,IAAI,UAAS,eAAT,CAAvB;;EACA,MAAMc,UAAU,GAAGZ,QAAQ,GAAG,UAAH,GAAgB,EAA3C;EACA,MAAMa,YAAY,GAAGvB,OAAO,CAAC,MAAMwB,CAAC,IAAIb,QAAQ,CAACa,CAAC,CAACC,MAAF,CAASC,OAAV,CAApB,EAAwC,CAACf,QAAD,CAAxC,CAA5B;EAEA,MAAMgB,SAAS,GAAGrB,KAAK,gBACrB;IAAM,EAAE,EAAG,cAAaY,QAAS,EAAjC;IAAoC,SAAS,EAAEf,KAAK,CAACG;EAArD,GACI,GAAEA,KAAM,GADZ,EACgB,GADhB,CADqB,GAInB,IAJJ;EAMA,MAAMsB,eAAe,GAAGhB,WAAW,gBACjC;IAAK,SAAS,EAAET,KAAK,CAACS;EAAtB,GAAoCA,WAApC,CADiC,GAE/B,IAFJ;;EAIA,MA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-69,6 +69,7 @@ declare namespace Select {
69
69
  modified: PropTypes.Requireable<boolean>;
70
70
  error: PropTypes.Requireable<boolean>;
71
71
  'aria-label': PropTypes.Requireable<string>;
72
+ 'aria-labelledby': PropTypes.Requireable<string>;
72
73
  };
73
74
  }
74
75
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AA2DA,qEAqLC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAuDA,qEAwLC"}
@@ -38,9 +38,7 @@ const ArrowView = ({
38
38
  arrowClass,
39
39
  arrowColor
40
40
  }) => {
41
- const props = useMemo(() => _extends({}, ariaLabel & {
42
- 'aria-label': ariaLabel
43
- }, arrowColor & {
41
+ const props = useMemo(() => _extends({}, arrowColor & {
44
42
  color: arrowColor
45
43
  }, {
46
44
  className: arrowClass
@@ -71,7 +69,8 @@ const Select = (props, legacyContext) => {
71
69
  modified = false,
72
70
  error = false,
73
71
  title: propTitle,
74
- 'aria-label': ariaLabel
72
+ 'aria-label': ariaLabel,
73
+ 'aria-labelledby': ariaLabelledBy
75
74
  } = props;
76
75
  const skin = GetSkinFromContext(legacyContext);
77
76
  const title = useMemo(() => propTitle ? `${propTitle}${required ? '*' : ''}` : null, [propTitle, required]);
@@ -146,10 +145,15 @@ const Select = (props, legacyContext) => {
146
145
  ariaLabel: ariaLabel,
147
146
  arrowClass: shouldUseSkinFontColor ? style.selectedArrow : style.arrow,
148
147
  arrowColor: isThemeOneOfQuestionTemplateOrPlayer ? arrowColor : black
149
- }), /*#__PURE__*/React.createElement("select", {
148
+ }), /*#__PURE__*/React.createElement("select", _extends({}, ariaLabelledBy ? {
149
+ 'aria-labelledby': ariaLabelledBy
150
+ } : {}, ariaLabel && !ariaLabelledBy ? {
151
+ 'aria-label': ariaLabel
152
+ } : {}, ariaLabel ? {
153
+ title: ariaLabel
154
+ } : {}, {
150
155
  "data-name": "native-select",
151
156
  className: style.selectBox,
152
- title: selectedLabel,
153
157
  name: name,
154
158
  onChange: handleChange,
155
159
  value: selected,
@@ -162,7 +166,7 @@ const Select = (props, legacyContext) => {
162
166
  ,
163
167
  onMouseLeave: handleSelectOnBlur,
164
168
  "data-testid": "native-select"
165
- }, optionList)), /*#__PURE__*/React.createElement("div", {
169
+ }), optionList)), /*#__PURE__*/React.createElement("div", {
166
170
  className: style.description
167
171
  }, description));
168
172
  };
@@ -195,7 +199,8 @@ Select.propTypes = process.env.NODE_ENV !== "production" ? {
195
199
  optgroups: PropTypes.arrayOf(PropTypes.shape(SelectOptionGroupPropTypes)),
196
200
  modified: PropTypes.bool,
197
201
  error: PropTypes.bool,
198
- 'aria-label': PropTypes.string
202
+ 'aria-label': PropTypes.string,
203
+ 'aria-labelledby': PropTypes.string
199
204
  } : {};
200
205
  export default Select;
201
206
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useCallback","useMemo","useState","PropTypes","classnames","concat","filter","find","flatMapDeep","get","getOr","includes","isEmpty","keys","map","size","NovaCompositionNavigationArrowDown","ArrowDown","NovaCompositionNavigationArrowTop","ArrowUp","Provider","GetSkinFromContext","getClassState","style","themeStyle","invalid","header","mooc","question","sort","thematiques","player","template","coorpmanager","ArrowView","shouldRender","isArrowUp","ariaLabel","arrowClass","arrowColor","props","color","className","Select","legacyContext","name","options","optgroups","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","skin","setIsArrowUp","handleSelectOnFocus","handleSelectOnBlur","selectOption","option","index","value","optionList","optgroup","label","i","titleView","selected","selectedLabel","isSelectedInValidOption","validOption","handleChange","e","target","selectedOptions","black","isThemeOneOfQuestionTemplateOrPlayer","shouldUseSkinFontColor","undefined","behaviorClassName","default","composedClassName","unselected","labelSize","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectedArrow","arrow","selectBox","SelectOptionPropTypes","string","isRequired","oneOfType","number","bool","SelectOptionGroupPropTypes","arrayOf","shape","contextTypes","childContextTypes","propTypes","func","oneOf"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport concat from 'lodash/fp/concat';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport flatMapDeep from 'lodash/fp/flatMapDeep';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {\n NovaCompositionNavigationArrowDown as ArrowDown,\n NovaCompositionNavigationArrowTop as ArrowUp\n} 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 ArrowView = ({shouldRender, isArrowUp, ariaLabel, arrowClass, arrowColor}) => {\n const props = useMemo(\n () => ({\n ...(ariaLabel &\n {\n 'aria-label': ariaLabel\n }),\n ...(arrowColor &\n {\n color: arrowColor\n }),\n className: arrowClass\n }),\n [ariaLabel, arrowClass, arrowColor]\n );\n if (shouldRender) {\n return isArrowUp ? (\n <ArrowUp {...props} data-testid=\"select-arrow-up-icon\" />\n ) : (\n <ArrowDown {...props} data-testid=\"select-arrow-down-icon\" />\n );\n } else return null;\n};\n\nconst Select = (props, legacyContext) => {\n const {\n name,\n options = [],\n optgroups = [],\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 [isArrowUp, setIsArrowUp] = useState(false);\n\n const handleSelectOnFocus = useCallback(() => setIsArrowUp(true), []);\n const handleSelectOnBlur = useCallback(() => setIsArrowUp(false), []);\n\n const selectOption = (option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n };\n\n const optionList = !isEmpty(options)\n ? options.map((option, index) => selectOption(option, index))\n : optgroups.map((optgroup, index) => {\n return (\n <optgroup key={index} label={optgroup.label}>\n {optgroup.options && optgroup.options.map((option, i) => selectOption(option, i))}\n </optgroup>\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}, concat(options, flatMapDeep('options', optgroups)))),\n [multiple, options, optgroups]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, concat(options, flatMapDeep('options', optgroups)))),\n [multiple, options, optgroups]\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 setIsArrowUp(false);\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n setIsArrowUp(false);\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 isThemeOneOfQuestionTemplateOrPlayer = useMemo(\n () => includes(theme, ['question', 'template', 'player']),\n [theme]\n );\n const shouldUseSkinFontColor = useMemo(\n () => !isSelectedInValidOption && selected && isThemeOneOfQuestionTemplateOrPlayer,\n [isSelectedInValidOption, selected, isThemeOneOfQuestionTemplateOrPlayer]\n );\n const arrowColor = selected ? color : undefined;\n\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 shouldRender={!multiple}\n isArrowUp={isArrowUp}\n ariaLabel={ariaLabel}\n arrowClass={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n arrowColor={isThemeOneOfQuestionTemplateOrPlayer ? arrowColor : black}\n />\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 onClick={handleSelectOnFocus}\n onBlur={handleSelectOnBlur}\n // onBlur does not handle completely an out of bounds click\n // ex: select is Opened and a click is done outside, cancelling the select\n // that doesn't count as a Blur, so an onMouseLeave is needed\n onMouseLeave={handleSelectOnBlur}\n data-testid=\"native-select\"\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\nexport const SelectOptionGroupPropTypes = {\n label: PropTypes.string.isRequired,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\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 optgroups: PropTypes.arrayOf(PropTypes.shape(SelectOptionGroupPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool,\n 'aria-label': PropTypes.string\n};\n\nexport default Select;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,OAA5B,EAAqCC,QAArC,QAAoD,OAApD;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,MAAP,MAAmB,kBAAnB;AACA,OAAOC,MAAP,MAAmB,kBAAnB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,WAAP,MAAwB,uBAAxB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,QAAP,MAAqB,oBAArB;AACA,OAAOC,OAAP,MAAoB,mBAApB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,SACEC,kCAAkC,IAAIC,SADxC,EAEEC,iCAAiC,IAAIC,OAFvC,QAGO,0BAHP;AAIA,OAAOC,QAAP,IAAkB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ACxClC,KAAK,EAAElE,SAAS,CAAC+F,MAAV,CAAiBC,UADgB;EAExCrD,OAAO,EAAE3C,SAAS,CAACqG,OAAV,CAAkBrG,SAAS,CAACsG,KAAV,CAAgBR,qBAAhB,CAAlB;AAF+B,CAAnC;AAKPtD,MAAM,CAAC+D,YAAP,GAAsB;EACpB/C,IAAI,EAAEvC,QAAQ,CAACuF,iBAAT,CAA2BhD;AADb,CAAtB;AAIAhB,MAAM,CAACiE,SAAP,2CAAmB;EACjBnD,KAAK,EAAEtD,SAAS,CAAC+F,MADA;EAEjBrD,IAAI,EAAE1C,SAAS,CAAC+F,MAFC;EAGjBxD,SAAS,EAAEvC,SAAS,CAAC+F,MAHJ;EAIjBlD,eAAe,EAAE7C,SAAS,CAAC+F,MAJV;EAKjB/C,QAAQ,EAAEhD,SAAS,CAACmG,IALH;EAMjBpD,QAAQ,EAAE/C,SAAS,CAACmG,IANH;EAOjBjD,WAAW,EAAElD,SAAS,CAAC+F,MAPN;EAQjB9C,QAAQ,EAAEjD,SAAS,CAACmG,IARH;EASjBrD,QAAQ,EAAE9C,SAAS,CAAC0G,IATH;EAUjBvD,KAAK,EAAEnD,SAAS,CAAC2G,KAAV,CAAgBjG,IAAI,CAACW,UAAD,CAApB,CAVU;EAWjBsB,OAAO,EAAE3C,SAAS,CAACqG,OAAV,CAAkBrG,SAAS,CAACsG,KAAV,CAAgBR,qBAAhB,CAAlB,CAXQ;EAYjBlD,SAAS,EAAE5C,SAAS,CAACqG,OAAV,CAAkBrG,SAAS,CAACsG,KAAV,CAAgBF,0BAAhB,CAAlB,CAZM;EAajBhD,QAAQ,EAAEpD,SAAS,CAACmG,IAbH;EAcjB9C,KAAK,EAAErD,SAAS,CAACmG,IAdA;EAejB,cAAcnG,SAAS,CAAC+F;AAfP,CAAnB;AAkBA,eAAevD,MAAf"}
1
+ {"version":3,"file":"index.js","names":["React","useCallback","useMemo","useState","PropTypes","classnames","concat","filter","find","flatMapDeep","get","getOr","includes","isEmpty","keys","map","size","NovaCompositionNavigationArrowDown","ArrowDown","NovaCompositionNavigationArrowTop","ArrowUp","Provider","GetSkinFromContext","getClassState","style","themeStyle","invalid","header","mooc","question","sort","thematiques","player","template","coorpmanager","ArrowView","shouldRender","isArrowUp","ariaLabel","arrowClass","arrowColor","props","color","className","Select","legacyContext","name","options","optgroups","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","ariaLabelledBy","skin","setIsArrowUp","handleSelectOnFocus","handleSelectOnBlur","selectOption","option","index","value","optionList","optgroup","label","i","titleView","selected","selectedLabel","isSelectedInValidOption","validOption","handleChange","e","target","selectedOptions","black","isThemeOneOfQuestionTemplateOrPlayer","shouldUseSkinFontColor","undefined","behaviorClassName","default","composedClassName","unselected","labelSize","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectedArrow","arrow","selectBox","SelectOptionPropTypes","string","isRequired","oneOfType","number","bool","SelectOptionGroupPropTypes","arrayOf","shape","contextTypes","childContextTypes","propTypes","func","oneOf"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport concat from 'lodash/fp/concat';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport flatMapDeep from 'lodash/fp/flatMapDeep';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {\n NovaCompositionNavigationArrowDown as ArrowDown,\n NovaCompositionNavigationArrowTop as ArrowUp\n} 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 ArrowView = ({shouldRender, isArrowUp, ariaLabel, arrowClass, arrowColor}) => {\n const props = useMemo(\n () => ({\n ...(arrowColor &\n {\n color: arrowColor\n }),\n className: arrowClass\n }),\n [ariaLabel, arrowClass, arrowColor]\n );\n if (shouldRender) {\n return isArrowUp ? (\n <ArrowUp {...props} data-testid=\"select-arrow-up-icon\" />\n ) : (\n <ArrowDown {...props} data-testid=\"select-arrow-down-icon\" />\n );\n } else return null;\n};\n\nconst Select = (props, legacyContext) => {\n const {\n name,\n options = [],\n optgroups = [],\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 'aria-labelledby': ariaLabelledBy\n } = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const title = useMemo(\n () => (propTitle ? `${propTitle}${required ? '*' : ''}` : null),\n [propTitle, required]\n );\n\n const [isArrowUp, setIsArrowUp] = useState(false);\n\n const handleSelectOnFocus = useCallback(() => setIsArrowUp(true), []);\n const handleSelectOnBlur = useCallback(() => setIsArrowUp(false), []);\n\n const selectOption = (option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n };\n\n const optionList = !isEmpty(options)\n ? options.map((option, index) => selectOption(option, index))\n : optgroups.map((optgroup, index) => {\n return (\n <optgroup key={index} label={optgroup.label}>\n {optgroup.options && optgroup.options.map((option, i) => selectOption(option, i))}\n </optgroup>\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}, concat(options, flatMapDeep('options', optgroups)))),\n [multiple, options, optgroups]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, concat(options, flatMapDeep('options', optgroups)))),\n [multiple, options, optgroups]\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 setIsArrowUp(false);\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n setIsArrowUp(false);\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 isThemeOneOfQuestionTemplateOrPlayer = useMemo(\n () => includes(theme, ['question', 'template', 'player']),\n [theme]\n );\n const shouldUseSkinFontColor = useMemo(\n () => !isSelectedInValidOption && selected && isThemeOneOfQuestionTemplateOrPlayer,\n [isSelectedInValidOption, selected, isThemeOneOfQuestionTemplateOrPlayer]\n );\n const arrowColor = selected ? color : undefined;\n\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 shouldRender={!multiple}\n isArrowUp={isArrowUp}\n ariaLabel={ariaLabel}\n arrowClass={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n arrowColor={isThemeOneOfQuestionTemplateOrPlayer ? arrowColor : black}\n />\n <select\n {...(ariaLabelledBy ? {'aria-labelledby': ariaLabelledBy} : {})}\n {...(ariaLabel && !ariaLabelledBy ? {'aria-label': ariaLabel} : {})}\n {...(ariaLabel ? {title: ariaLabel} : {})}\n data-name=\"native-select\"\n className={style.selectBox}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n onClick={handleSelectOnFocus}\n onBlur={handleSelectOnBlur}\n // onBlur does not handle completely an out of bounds click\n // ex: select is Opened and a click is done outside, cancelling the select\n // that doesn't count as a Blur, so an onMouseLeave is needed\n onMouseLeave={handleSelectOnBlur}\n data-testid=\"native-select\"\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\nexport const SelectOptionGroupPropTypes = {\n label: PropTypes.string.isRequired,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\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 optgroups: PropTypes.arrayOf(PropTypes.shape(SelectOptionGroupPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool,\n 'aria-label': PropTypes.string,\n 'aria-labelledby': PropTypes.string\n};\n\nexport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,MAHJ;EAIjBnD,eAAe,EAAE7C,SAAS,CAACgG,MAJV;EAKjBhD,QAAQ,EAAEhD,SAAS,CAACoG,IALH;EAMjBrD,QAAQ,EAAE/C,SAAS,CAACoG,IANH;EAOjBlD,WAAW,EAAElD,SAAS,CAACgG,MAPN;EAQjB/C,QAAQ,EAAEjD,SAAS,CAACoG,IARH;EASjBtD,QAAQ,EAAE9C,SAAS,CAAC2G,IATH;EAUjBxD,KAAK,EAAEnD,SAAS,CAAC4G,KAAV,CAAgBlG,IAAI,CAACW,UAAD,CAApB,CAVU;EAWjBsB,OAAO,EAAE3C,SAAS,CAACsG,OAAV,CAAkBtG,SAAS,CAACuG,KAAV,CAAgBR,qBAAhB,CAAlB,CAXQ;EAYjBnD,SAAS,EAAE5C,SAAS,CAACsG,OAAV,CAAkBtG,SAAS,CAACuG,KAAV,CAAgBF,0BAAhB,CAAlB,CAZM;EAajBjD,QAAQ,EAAEpD,SAAS,CAACoG,IAbH;EAcjB/C,KAAK,EAAErD,SAAS,CAACoG,IAdA;EAejB,cAAcpG,SAAS,CAACgG,MAfP;EAgBjB,mBAAmBhG,SAAS,CAACgG;AAhBZ,CAAnB;AAmBA,eAAexD,MAAf"}
@@ -1,6 +1,6 @@
1
1
  export function toggleStateOnKeyPress(state: any, setState: any, ref: any): (event: any) => void;
2
2
  export default ToolTip;
3
- declare function ToolTip({ anchorId, TooltipContent, "aria-label": ariaLabel, "data-testid": dataTestId, closeToolTipInformationTextAriaLabel, toolTipIsVisible: _toolTipIsVisible, iconContainerClassName, delayHide, fontSize, iconSize }: {
3
+ declare function ToolTip({ anchorId, TooltipContent, "aria-label": ariaLabel, "data-testid": dataTestId, closeToolTipInformationTextAriaLabel, toolTipIsVisible: _toolTipIsVisible, iconContainerClassName, delayHide, fontSize }: {
4
4
  anchorId: any;
5
5
  TooltipContent: any;
6
6
  "aria-label": any;
@@ -10,7 +10,6 @@ declare function ToolTip({ anchorId, TooltipContent, "aria-label": ariaLabel, "d
10
10
  iconContainerClassName: any;
11
11
  delayHide?: number | undefined;
12
12
  fontSize?: number | undefined;
13
- iconSize?: string | undefined;
14
13
  }): JSX.Element;
15
14
  declare namespace ToolTip {
16
15
  const propTypes: {
@@ -21,7 +20,6 @@ declare namespace ToolTip {
21
20
  iconContainerClassName: PropTypes.Requireable<string>;
22
21
  delayHide: PropTypes.Requireable<number>;
23
22
  fontSize: PropTypes.Requireable<number>;
24
- iconSize: PropTypes.Requireable<string>;
25
23
  anchorId: PropTypes.Requireable<string>;
26
24
  toolTipIsVisible: PropTypes.Requireable<boolean>;
27
25
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/tooltip/index.js"],"names":[],"mappings":"AAmEO,iGASN;;AAED;;;;;;;;;;;gBA0FC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/tooltip/index.js"],"names":[],"mappings":"AAwDO,iGASN;;AAED;;;;;;;;;;gBAwFC"}
@@ -3,25 +3,19 @@ import classnames from 'classnames';
3
3
  import PropTypes from 'prop-types';
4
4
  import ReactTooltip from 'react-tooltip';
5
5
  import isString from 'lodash/fp/isString';
6
- import keys from 'lodash/fp/keys';
7
6
  import { NovaCompositionCoorpacademyInformationIcon as InformationIcon } from '@coorpacademy/nova-icons';
8
7
  import style from './style.css';
9
8
  const FontSizes = {
10
9
  12: style.tooltipContentFontSize12,
11
10
  14: style.tooltipContentFontSize14
12
11
  };
13
- const IconSizes = {
14
- small: 12,
15
- big: 20
16
- };
17
12
 
18
13
  const ToolTipWrapper = ({
19
14
  toolTipIsVisible,
20
15
  anchorId,
21
16
  closeToolTipInformationTextAriaLabel,
22
17
  content,
23
- handleContentMouseOver,
24
- iconSize
18
+ handleContentMouseOver
25
19
  }) => {
26
20
  if (!toolTipIsVisible) return null;
27
21
 
@@ -36,7 +30,7 @@ const ToolTipWrapper = ({
36
30
  }, content);
37
31
  } else {
38
32
  return /*#__PURE__*/React.createElement("div", {
39
- className: classnames(style.toolTip, iconSize === 'big' ? style.bigIconToolTip : style.smallIconToolTip),
33
+ className: style.toolTip,
40
34
  "data-testid": "tooltip",
41
35
  "aria-label": closeToolTipInformationTextAriaLabel,
42
36
  onMouseOver: handleContentMouseOver
@@ -49,8 +43,7 @@ ToolTipWrapper.propTypes = process.env.NODE_ENV !== "production" ? {
49
43
  anchorId: PropTypes.string,
50
44
  closeToolTipInformationTextAriaLabel: PropTypes.string.isRequired,
51
45
  content: PropTypes.node,
52
- handleContentMouseOver: PropTypes.func,
53
- iconSize: PropTypes.oneOf(keys(IconSizes))
46
+ handleContentMouseOver: PropTypes.func
54
47
  } : {};
55
48
  export const toggleStateOnKeyPress = (state, setState, ref) => event => {
56
49
  if (event.key === 'Enter') {
@@ -72,8 +65,7 @@ const ToolTip = ({
72
65
  toolTipIsVisible: _toolTipIsVisible,
73
66
  iconContainerClassName,
74
67
  delayHide = 250,
75
- fontSize = 14,
76
- iconSize = 'small'
68
+ fontSize = 14
77
69
  }) => {
78
70
  const isComponent = useMemo(() => !isString(TooltipContent) && /*#__PURE__*/isValidElement(TooltipContent()), [TooltipContent]);
79
71
  const [toolTipIsVisible, setToolTipIsVisible] = useState(false);
@@ -118,8 +110,8 @@ const ToolTip = ({
118
110
  tabIndex: 0
119
111
  }, /*#__PURE__*/React.createElement(InformationIcon, {
120
112
  className: style.informationIcon,
121
- width: IconSizes[iconSize],
122
- height: IconSizes[iconSize],
113
+ width: 12,
114
+ height: 12,
123
115
  "aria-label": ariaLabel
124
116
  })), /*#__PURE__*/React.createElement(ToolTipWrapper, {
125
117
  toolTipIsVisible: toolTipIsVisible,
@@ -127,8 +119,7 @@ const ToolTip = ({
127
119
  closeToolTipInformationTextAriaLabel: closeToolTipInformationTextAriaLabel,
128
120
  content: content,
129
121
  handleContentMouseOver: handleContentMouseOver,
130
- fontSize: fontSize,
131
- iconSize: iconSize
122
+ fontSize: fontSize
132
123
  }));
133
124
  };
134
125
 
@@ -141,7 +132,6 @@ ToolTip.propTypes = process.env.NODE_ENV !== "production" ? {
141
132
  iconContainerClassName: PropTypes.string,
142
133
  delayHide: PropTypes.number,
143
134
  fontSize: PropTypes.oneOf([12, 14]),
144
- iconSize: PropTypes.oneOf(keys(IconSizes)),
145
135
  // ---------- React Tooltip exclusive --------------
146
136
  // externalHandling: if passed down, React Tooltip is used instead, due to limitations on
147
137
  // parents overflow hidden controls
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","isValidElement","useState","useCallback","useMemo","classnames","PropTypes","ReactTooltip","isString","keys","NovaCompositionCoorpacademyInformationIcon","InformationIcon","style","FontSizes","tooltipContentFontSize12","tooltipContentFontSize14","IconSizes","small","big","ToolTipWrapper","toolTipIsVisible","anchorId","closeToolTipInformationTextAriaLabel","content","handleContentMouseOver","iconSize","toolTipReact","toolTip","bigIconToolTip","smallIconToolTip","propTypes","bool","string","isRequired","node","func","oneOf","toggleStateOnKeyPress","state","setState","ref","event","key","current","focus","stopPropagation","preventDefault","ToolTip","TooltipContent","ariaLabel","dataTestId","_toolTipIsVisible","iconContainerClassName","delayHide","fontSize","isComponent","setToolTipIsVisible","mouseLeaveTimer","setMouseLeaveTimer","undefined","handleKeyPress","clearTimeout","handleMouseOver","handleMouseLeave","setTimeout","tooltipContent","tooltipContainer","tooltipIconContainer","informationIcon","oneOfType","number"],"sources":["../../../src/atom/tooltip/index.js"],"sourcesContent":["import React, {isValidElement, useState, useCallback, useMemo} from 'react';\nimport classnames from 'classnames';\nimport PropTypes from 'prop-types';\nimport ReactTooltip from 'react-tooltip';\nimport isString from 'lodash/fp/isString';\nimport keys from 'lodash/fp/keys';\nimport {NovaCompositionCoorpacademyInformationIcon as InformationIcon} from '@coorpacademy/nova-icons';\nimport style from './style.css';\n\nconst FontSizes = {\n 12: style.tooltipContentFontSize12,\n 14: style.tooltipContentFontSize14\n};\n\nconst IconSizes = {\n small: 12,\n big: 20\n};\n\nconst ToolTipWrapper = ({\n toolTipIsVisible,\n anchorId,\n closeToolTipInformationTextAriaLabel,\n content,\n handleContentMouseOver,\n iconSize\n}) => {\n if (!toolTipIsVisible) return null;\n if (anchorId) {\n return (\n <ReactTooltip\n id={anchorId}\n className={style.toolTipReact}\n data-event-off=\"click\"\n place=\"left\"\n effect=\"solid\"\n aria-label={closeToolTipInformationTextAriaLabel}\n >\n {content}\n </ReactTooltip>\n );\n } else {\n return (\n <div\n className={classnames(\n style.toolTip,\n iconSize === 'big' ? style.bigIconToolTip : style.smallIconToolTip\n )}\n data-testid=\"tooltip\"\n aria-label={closeToolTipInformationTextAriaLabel}\n onMouseOver={handleContentMouseOver}\n >\n {content}\n </div>\n );\n }\n};\n\nToolTipWrapper.propTypes = {\n toolTipIsVisible: PropTypes.bool,\n anchorId: PropTypes.string,\n closeToolTipInformationTextAriaLabel: PropTypes.string.isRequired,\n content: PropTypes.node,\n handleContentMouseOver: PropTypes.func,\n iconSize: PropTypes.oneOf(keys(IconSizes))\n};\n\nexport const toggleStateOnKeyPress = (state, setState, ref) => event => {\n if (event.key === 'Enter') {\n if (ref) ref.current.focus();\n event.stopPropagation();\n event.preventDefault();\n setState(!state);\n } else if (event.key === 'Tab' || event.key === 'Escape') {\n setState(false);\n }\n};\n\nconst ToolTip = ({\n anchorId,\n TooltipContent,\n 'aria-label': ariaLabel,\n 'data-testid': dataTestId,\n closeToolTipInformationTextAriaLabel,\n toolTipIsVisible: _toolTipIsVisible,\n iconContainerClassName,\n delayHide = 250,\n fontSize = 14,\n iconSize = 'small'\n}) => {\n const isComponent = useMemo(\n () => !isString(TooltipContent) && isValidElement(TooltipContent()),\n [TooltipContent]\n );\n\n const [toolTipIsVisible, setToolTipIsVisible] = useState(false);\n\n const [mouseLeaveTimer, setMouseLeaveTimer] = useState(undefined);\n\n const handleKeyPress = useCallback(\n event => {\n toggleStateOnKeyPress(toolTipIsVisible, setToolTipIsVisible)(event);\n },\n [toolTipIsVisible]\n );\n\n const handleContentMouseOver = useCallback(() => {\n mouseLeaveTimer && /* istanbul ignore next */ clearTimeout(mouseLeaveTimer);\n }, [mouseLeaveTimer]);\n\n const handleMouseOver = useCallback(() => {\n mouseLeaveTimer && clearTimeout(mouseLeaveTimer);\n setToolTipIsVisible(true);\n }, [mouseLeaveTimer]);\n\n const handleMouseLeave = useCallback(() => {\n setMouseLeaveTimer(setTimeout(() => setToolTipIsVisible(false), delayHide));\n }, [delayHide]);\n\n const content = useMemo(() => {\n return isComponent ? (\n <TooltipContent />\n ) : (\n <p className={classnames([style.tooltipContent, FontSizes[fontSize]])}>{TooltipContent}</p>\n );\n }, [TooltipContent, fontSize, isComponent]);\n\n return anchorId ? (\n <ToolTipWrapper\n toolTipIsVisible={_toolTipIsVisible}\n anchorId={anchorId}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n content={content}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n fontSize={fontSize}\n />\n ) : (\n <div\n className={style.tooltipContainer}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n >\n <button\n type=\"button\"\n className={classnames([style.tooltipIconContainer, iconContainerClassName])}\n data-testid={dataTestId}\n onKeyDown={handleKeyPress}\n tabIndex={0}\n >\n <InformationIcon\n className={style.informationIcon}\n width={IconSizes[iconSize]}\n height={IconSizes[iconSize]}\n aria-label={ariaLabel}\n />\n </button>\n <ToolTipWrapper\n toolTipIsVisible={toolTipIsVisible}\n anchorId={anchorId}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n content={content}\n handleContentMouseOver={handleContentMouseOver}\n fontSize={fontSize}\n iconSize={iconSize}\n />\n </div>\n );\n};\n\nToolTip.propTypes = {\n TooltipContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node, PropTypes.string]),\n 'data-testid': PropTypes.string,\n 'aria-label': PropTypes.string,\n closeToolTipInformationTextAriaLabel: PropTypes.string.isRequired,\n // ---------- Regular Tooltip exclusive --------------\n iconContainerClassName: PropTypes.string,\n delayHide: PropTypes.number,\n fontSize: PropTypes.oneOf([12, 14]),\n iconSize: PropTypes.oneOf(keys(IconSizes)),\n // ---------- React Tooltip exclusive --------------\n // externalHandling: if passed down, React Tooltip is used instead, due to limitations on\n // parents overflow hidden controls\n anchorId: PropTypes.string,\n toolTipIsVisible: PropTypes.bool\n};\n\nexport default ToolTip;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,cAAf,EAA+BC,QAA/B,EAAyCC,WAAzC,EAAsDC,OAAtD,QAAoE,OAApE;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,YAAP,MAAyB,eAAzB;AACA,OAAOC,QAAP,MAAqB,oBAArB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,SAAQC,0CAA0C,IAAIC,eAAtD,QAA4E,0BAA5E;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,SAAS,GAAG;EAChB,IAAID,KAAK,CAACE,wBADM;EAEhB,IAAIF,KAAK,CAACG;AAFM,CAAlB;AAKA,MAAMC,SAAS,GAAG;EAChBC,KAAK,EAAE,EADS;EAEhBC,GAAG,EAAE;AAFW,CAAlB;;AAKA,MAAMC,cAAc,GAAG,CAAC;EACtBC,gBADsB;EAEtBC,QAFsB;EAGtBC,oCAHsB;EAItBC,OAJsB;EAKtBC,sBALsB;EAMtBC;AANsB,CAAD,KAOjB;EACJ,IAAI,CAACL,gBAAL,EAAuB,OAAO,IAAP;;EACvB,IAAIC,QAAJ,EAAc;IACZ,oBACE,oBAAC,YAAD;MACE,EAAE,EAAEA,QADN;MAEE,SAAS,EAAET,KAAK,CAACc,YAFnB;MAGE,kBAAe,OAHjB;MAIE,KAAK,EAAC,MAJR;MAKE,MAAM,EAAC,OALT;MAME,cAAYJ;IANd,GAQGC,OARH,CADF;EAYD,CAbD,MAaO;IACL,oBACE;MACE,SAAS,EAAElB,UAAU,CACnBO,KAAK,CAACe,OADa,EAEnBF,QAAQ,KAAK,KAAb,GAAqBb,KAAK,CA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C0B,MAHN;EAIlBV,oCAAoC,EAAEhB,SAAS,CAAC0B,MAAV,CAAiBC,UAJrC;EAKlB;EACAmB,sBAAsB,EAAE9C,SAAS,CAAC0B,MANhB;EAOlBqB,SAAS,EAAE/C,SAAS,CAACgE,MAPH;EAQlBhB,QAAQ,EAAEhD,SAAS,CAAC8B,KAAV,CAAgB,CAAC,EAAD,EAAK,EAAL,CAAhB,CARQ;EASlBX,QAAQ,EAAEnB,SAAS,CAAC8B,KAAV,CAAgB3B,IAAI,CAACO,SAAD,CAApB,CATQ;EAUlB;EACA;EACA;EACAK,QAAQ,EAAEf,SAAS,CAAC0B,MAbF;EAclBZ,gBAAgB,EAAEd,SAAS,CAACyB;AAdV,CAApB;AAiBA,eAAegB,OAAf"}
1
+ {"version":3,"file":"index.js","names":["React","isValidElement","useState","useCallback","useMemo","classnames","PropTypes","ReactTooltip","isString","NovaCompositionCoorpacademyInformationIcon","InformationIcon","style","FontSizes","tooltipContentFontSize12","tooltipContentFontSize14","ToolTipWrapper","toolTipIsVisible","anchorId","closeToolTipInformationTextAriaLabel","content","handleContentMouseOver","toolTipReact","toolTip","propTypes","bool","string","isRequired","node","func","toggleStateOnKeyPress","state","setState","ref","event","key","current","focus","stopPropagation","preventDefault","ToolTip","TooltipContent","ariaLabel","dataTestId","_toolTipIsVisible","iconContainerClassName","delayHide","fontSize","isComponent","setToolTipIsVisible","mouseLeaveTimer","setMouseLeaveTimer","undefined","handleKeyPress","clearTimeout","handleMouseOver","handleMouseLeave","setTimeout","tooltipContent","tooltipContainer","tooltipIconContainer","informationIcon","oneOfType","number","oneOf"],"sources":["../../../src/atom/tooltip/index.js"],"sourcesContent":["import React, {isValidElement, useState, useCallback, useMemo} from 'react';\nimport classnames from 'classnames';\nimport PropTypes from 'prop-types';\nimport ReactTooltip from 'react-tooltip';\nimport isString from 'lodash/fp/isString';\nimport {NovaCompositionCoorpacademyInformationIcon as InformationIcon} from '@coorpacademy/nova-icons';\nimport style from './style.css';\n\nconst FontSizes = {\n 12: style.tooltipContentFontSize12,\n 14: style.tooltipContentFontSize14\n};\n\nconst ToolTipWrapper = ({\n toolTipIsVisible,\n anchorId,\n closeToolTipInformationTextAriaLabel,\n content,\n handleContentMouseOver\n}) => {\n if (!toolTipIsVisible) return null;\n if (anchorId) {\n return (\n <ReactTooltip\n id={anchorId}\n className={style.toolTipReact}\n data-event-off=\"click\"\n place=\"left\"\n effect=\"solid\"\n aria-label={closeToolTipInformationTextAriaLabel}\n >\n {content}\n </ReactTooltip>\n );\n } else {\n return (\n <div\n className={style.toolTip}\n data-testid=\"tooltip\"\n aria-label={closeToolTipInformationTextAriaLabel}\n onMouseOver={handleContentMouseOver}\n >\n {content}\n </div>\n );\n }\n};\n\nToolTipWrapper.propTypes = {\n toolTipIsVisible: PropTypes.bool,\n anchorId: PropTypes.string,\n closeToolTipInformationTextAriaLabel: PropTypes.string.isRequired,\n content: PropTypes.node,\n handleContentMouseOver: PropTypes.func\n};\n\nexport const toggleStateOnKeyPress = (state, setState, ref) => event => {\n if (event.key === 'Enter') {\n if (ref) ref.current.focus();\n event.stopPropagation();\n event.preventDefault();\n setState(!state);\n } else if (event.key === 'Tab' || event.key === 'Escape') {\n setState(false);\n }\n};\n\nconst ToolTip = ({\n anchorId,\n TooltipContent,\n 'aria-label': ariaLabel,\n 'data-testid': dataTestId,\n closeToolTipInformationTextAriaLabel,\n toolTipIsVisible: _toolTipIsVisible,\n iconContainerClassName,\n delayHide = 250,\n fontSize = 14\n}) => {\n const isComponent = useMemo(\n () => !isString(TooltipContent) && isValidElement(TooltipContent()),\n [TooltipContent]\n );\n\n const [toolTipIsVisible, setToolTipIsVisible] = useState(false);\n\n const [mouseLeaveTimer, setMouseLeaveTimer] = useState(undefined);\n\n const handleKeyPress = useCallback(\n event => {\n toggleStateOnKeyPress(toolTipIsVisible, setToolTipIsVisible)(event);\n },\n [toolTipIsVisible]\n );\n\n const handleContentMouseOver = useCallback(() => {\n mouseLeaveTimer && /* istanbul ignore next */ clearTimeout(mouseLeaveTimer);\n }, [mouseLeaveTimer]);\n\n const handleMouseOver = useCallback(() => {\n mouseLeaveTimer && clearTimeout(mouseLeaveTimer);\n setToolTipIsVisible(true);\n }, [mouseLeaveTimer]);\n\n const handleMouseLeave = useCallback(() => {\n setMouseLeaveTimer(setTimeout(() => setToolTipIsVisible(false), delayHide));\n }, [delayHide]);\n\n const content = useMemo(() => {\n return isComponent ? (\n <TooltipContent />\n ) : (\n <p className={classnames([style.tooltipContent, FontSizes[fontSize]])}>{TooltipContent}</p>\n );\n }, [TooltipContent, fontSize, isComponent]);\n\n return anchorId ? (\n <ToolTipWrapper\n toolTipIsVisible={_toolTipIsVisible}\n anchorId={anchorId}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n content={content}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n fontSize={fontSize}\n />\n ) : (\n <div\n className={style.tooltipContainer}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n >\n <button\n type=\"button\"\n className={classnames([style.tooltipIconContainer, iconContainerClassName])}\n data-testid={dataTestId}\n onKeyDown={handleKeyPress}\n tabIndex={0}\n >\n <InformationIcon\n className={style.informationIcon}\n width={12}\n height={12}\n aria-label={ariaLabel}\n />\n </button>\n <ToolTipWrapper\n toolTipIsVisible={toolTipIsVisible}\n anchorId={anchorId}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n content={content}\n handleContentMouseOver={handleContentMouseOver}\n fontSize={fontSize}\n />\n </div>\n );\n};\n\nToolTip.propTypes = {\n TooltipContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node, PropTypes.string]),\n 'data-testid': PropTypes.string,\n 'aria-label': PropTypes.string,\n closeToolTipInformationTextAriaLabel: PropTypes.string.isRequired,\n // ---------- Regular Tooltip exclusive --------------\n iconContainerClassName: PropTypes.string,\n delayHide: PropTypes.number,\n fontSize: PropTypes.oneOf([12, 14]),\n // ---------- React Tooltip exclusive --------------\n // externalHandling: if passed down, React Tooltip is used instead, due to limitations on\n // parents overflow hidden controls\n anchorId: PropTypes.string,\n toolTipIsVisible: PropTypes.bool\n};\n\nexport default ToolTip;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,cAAf,EAA+BC,QAA/B,EAAyCC,WAAzC,EAAsDC,OAAtD,QAAoE,OAApE;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,YAAP,MAAyB,eAAzB;AACA,OAAOC,QAAP,MAAqB,oBAArB;AACA,SAAQC,0CAA0C,IAAIC,eAAtD,QAA4E,0BAA5E;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,SAAS,GAAG;EAChB,IAAID,KAAK,CAACE,wBADM;EAEhB,IAAIF,KAAK,CAACG;AAFM,CAAlB;;AAKA,MAAMC,cAAc,GAAG,CAAC;EACtBC,gBADsB;EAEtBC,QAFsB;EAGtBC,oCAHsB;EAItBC,OAJsB;EAKtBC;AALsB,CAAD,KAMjB;EACJ,IAAI,CAACJ,gBAAL,EAAuB,OAAO,IAAP;;EACvB,IAAIC,QAAJ,EAAc;IACZ,oBACE,oBAAC,YAAD;MACE,EAAE,EAAEA,QADN;MAEE,SAAS,EAAEN,KAAK,CAACU,YAFnB;MAGE,kBAAe,OAHjB;MAIE,KAAK,EAAC,MAJR;MAKE,MAAM,EAAC,OALT;MAME,cAAYH;IANd,GAQGC,OARH,CADF;EAYD,CAbD,MAaO;IACL,oBACE;MACE,SAAS,EAAER,KAAK,CAACW,OADnB;MAEE,eAAY,SAFd;MAGE,cAAYJ,oCAHd;MAIE,WAAW,EAAEE;IAJf,GAMGD,OANH,CADF;EAUD;AACF,CAjCD;;AAmCAJ,cAAc,CAACQ,SAAf,2CAA2B;EACzBP,gBAAgB,EAAEV,SAAS,CAACkB,IADH;EAEzBP,QAAQ,EAAEX,SAAS,CAACmB,MAFK;EAGzBP,oCAAoC,EAAEZ,SAAS,CAACm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AU,CAAC,CAACM,KAAK,CAACgD,oBAAP,EAA6Bf,sBAA7B,CAAD,CAFvB;IAGE,eAAaF,UAHf;IAIE,SAAS,EAAEU,cAJb;IAKE,QAAQ,EAAE;EALZ,gBAOE,oBAAC,eAAD;IACE,SAAS,EAAEzC,KAAK,CAACiD,eADnB;IAEE,KAAK,EAAE,EAFT;IAGE,MAAM,EAAE,EAHV;IAIE,cAAYnB;EAJd,EAPF,CALF,eAmBE,oBAAC,cAAD;IACE,gBAAgB,EAAEzB,gBADpB;IAEE,QAAQ,EAAEC,QAFZ;IAGE,oCAAoC,EAAEC,oCAHxC;IAIE,OAAO,EAAEC,OAJX;IAKE,sBAAsB,EAAEC,sBAL1B;IAME,QAAQ,EAAE0B;EANZ,EAnBF,CAXF;AAwCD,CAxFD;;AA0FAP,OAAO,CAAChB,SAAR,2CAAoB;EAClBiB,cAAc,EAAElC,SAAS,CAACuD,SAAV,CAAoB,CAACvD,SAAS,CAACsB,IAAX,EAAiBtB,SAAS,CAACqB,IAA3B,EAAiCrB,SAAS,CAACmB,MAA3C,CAApB,CADE;EAElB,eAAenB,SAAS,CAACmB,MAFP;EAGlB,cAAcnB,SAAS,CAACmB,MAHN;EAIlBP,oCAAoC,EAAEZ,SAAS,CAACmB,MAAV,CAAiBC,UAJrC;EAKlB;EACAkB,sBAAsB,EAAEtC,SAAS,CAACmB,MANhB;EAOlBoB,SAAS,EAAEvC,SAAS,CAACwD,MAPH;EAQlBhB,QAAQ,EAAExC,SAAS,CAACyD,KAAV,CAAgB,CAAC,EAAD,EAAK,EAAL,CAAhB,CARQ;EASlB;EACA;EACA;EACA9C,QAAQ,EAAEX,SAAS,CAACmB,MAZF;EAalBT,gBAAgB,EAAEV,SAAS,CAACkB;AAbV,CAApB;AAgBA,eAAee,OAAf"}
@@ -34,18 +34,10 @@
34
34
  position: absolute;
35
35
  border-radius: 7px;
36
36
  background-color: cm_grey_700;
37
- height: auto;
38
- width: 200px;
39
- }
40
-
41
- .bigIconToolTip {
42
- right: -71px;
43
- bottom: 31px;
44
- }
45
-
46
- .smallIconToolTip {
47
37
  right: -75px;
48
38
  bottom: 32px;
39
+ height: auto;
40
+ width: 200px;
49
41
  }
50
42
 
51
43
  .toolTip::before {
@@ -1 +1 @@
1
- {"version":3,"file":"globals.d.js","names":[],"sources":["../src/globals.d.ts"],"sourcesContent":["declare module '@coorpacademy/nova-icons';\ndeclare module '@coorpacademy/react-native-slider';\ndeclare module '@react-native-community/blur';\ndeclare module '@coorpacademy/translate';\ndeclare module 'browser-env';\ndeclare module 'react-native/*';\ndeclare module 'color';\ndeclare module 'classnames';\ndeclare module '*.css';\n"],"mappings":""}
1
+ {"version":3,"file":"globals.d.js","names":[],"sources":["../src/globals.d.ts"],"sourcesContent":["declare module '@coorpacademy/nova-icons';\ndeclare module '@coorpacademy/react-native-slider';\ndeclare module '@react-native-community/blur';\ndeclare module '@coorpacademy/translate';\ndeclare module 'react-native/*';\ndeclare module 'color';\ndeclare module 'classnames';\ndeclare module '*.css';\n"],"mappings":""}
@@ -56,6 +56,8 @@ declare namespace BrandFormGroup {
56
56
  disabled: PropTypes.Requireable<boolean>;
57
57
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
58
58
  description: PropTypes.Requireable<string>;
59
+ 'aria-labelledby': PropTypes.Requireable<string>;
60
+ 'aria-label': PropTypes.Requireable<string>;
59
61
  modified: PropTypes.Requireable<boolean>;
60
62
  titlePosition: PropTypes.Requireable<string>;
61
63
  theme: PropTypes.Requireable<string>;
@@ -109,6 +111,7 @@ declare namespace BrandFormGroup {
109
111
  modified: PropTypes.Requireable<boolean>;
110
112
  error: PropTypes.Requireable<boolean>;
111
113
  'aria-label': PropTypes.Requireable<string>;
114
+ 'aria-labelledby': PropTypes.Requireable<string>;
112
115
  }> | PropTypes.InferProps<{
113
116
  type: PropTypes.Requireable<string>;
114
117
  title: PropTypes.Validator<string>;
@@ -188,6 +191,8 @@ declare namespace BrandFormGroup {
188
191
  disabled: PropTypes.Requireable<boolean>;
189
192
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
190
193
  description: PropTypes.Requireable<string>;
194
+ 'aria-labelledby': PropTypes.Requireable<string>;
195
+ 'aria-label': PropTypes.Requireable<string>;
191
196
  modified: PropTypes.Requireable<boolean>;
192
197
  titlePosition: PropTypes.Requireable<string>;
193
198
  theme: PropTypes.Requireable<string>;
@@ -224,6 +229,7 @@ declare namespace BrandFormGroup {
224
229
  modified: PropTypes.Requireable<boolean>;
225
230
  error: PropTypes.Requireable<boolean>;
226
231
  'aria-label': PropTypes.Requireable<string>;
232
+ 'aria-labelledby': PropTypes.Requireable<string>;
227
233
  }> | PropTypes.InferProps<{
228
234
  type: PropTypes.Requireable<string>;
229
235
  title: PropTypes.Validator<string>;
@@ -328,6 +334,8 @@ declare namespace BrandFormGroup {
328
334
  disabled: PropTypes.Requireable<boolean>;
329
335
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
330
336
  description: PropTypes.Requireable<string>;
337
+ 'aria-labelledby': PropTypes.Requireable<string>;
338
+ 'aria-label': PropTypes.Requireable<string>;
331
339
  modified: PropTypes.Requireable<boolean>;
332
340
  titlePosition: PropTypes.Requireable<string>;
333
341
  theme: PropTypes.Requireable<string>;
@@ -41,6 +41,8 @@ declare const propTypes: {
41
41
  disabled: PropTypes.Requireable<boolean>;
42
42
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
43
43
  description: PropTypes.Requireable<string>;
44
+ 'aria-labelledby': PropTypes.Requireable<string>;
45
+ 'aria-label': PropTypes.Requireable<string>;
44
46
  modified: PropTypes.Requireable<boolean>;
45
47
  titlePosition: PropTypes.Requireable<string>;
46
48
  theme: PropTypes.Requireable<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAInC,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AC9B,YAAY,CAAC,EAAE,eAAe,CAAC;CAChC,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -18,6 +18,8 @@ declare namespace DraggableList {
18
18
  disabled: PropTypes.Requireable<boolean>;
19
19
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
20
20
  description: PropTypes.Requireable<string>;
21
+ 'aria-labelledby': PropTypes.Requireable<string>;
22
+ 'aria-label': PropTypes.Requireable<string>;
21
23
  modified: PropTypes.Requireable<boolean>;
22
24
  titlePosition: PropTypes.Requireable<string>;
23
25
  theme: PropTypes.Requireable<string>;