@coorpacademy/components 11.11.1-alpha.0 → 11.11.2

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 (158) 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/molecule/video-player-mobile/index.native.d.ts +1 -1
  35. package/es/molecule/video-player-mobile/index.native.d.ts.map +1 -1
  36. package/es/molecule/video-player-mobile/index.native.js +26 -9
  37. package/es/molecule/video-player-mobile/index.native.js.map +1 -1
  38. package/es/organism/brand-form/index.d.ts +8 -0
  39. package/es/organism/mooc-header/index.d.ts.map +1 -1
  40. package/es/organism/mooc-header/index.js +4 -1
  41. package/es/organism/mooc-header/index.js.map +1 -1
  42. package/es/organism/review-slide/index.native.d.ts.map +1 -1
  43. package/es/organism/review-slide/index.native.js +32 -15
  44. package/es/organism/review-slide/index.native.js.map +1 -1
  45. package/es/organism/user-preferences/index.d.ts +2 -0
  46. package/es/organism/wizard-contents/index.d.ts +8 -0
  47. package/es/template/activity/index.d.ts +12 -11
  48. package/es/template/activity/index.d.ts.map +1 -1
  49. package/es/template/activity/index.js +6 -3
  50. package/es/template/activity/index.js.map +1 -1
  51. package/es/template/app-player/loading/index.d.ts +2 -0
  52. package/es/template/app-player/player/index.d.ts +4 -0
  53. package/es/template/app-player/player/slides/index.d.ts +2 -0
  54. package/es/template/app-player/player/slides/index.d.ts.map +1 -1
  55. package/es/template/app-player/popin-correction/index.d.ts +2 -0
  56. package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
  57. package/es/template/app-player/popin-end/index.d.ts +2 -0
  58. package/es/template/app-review/index.d.ts +2 -0
  59. package/es/template/app-review/index.d.ts.map +1 -1
  60. package/es/template/app-review/player/prop-types.d.ts +2 -0
  61. package/es/template/app-review/player/prop-types.d.ts.map +1 -1
  62. package/es/template/app-review/prop-types.d.ts +2 -0
  63. package/es/template/app-review/prop-types.d.ts.map +1 -1
  64. package/es/template/back-office/brand-update/index.d.ts +18 -0
  65. package/es/template/common/dashboard/index.d.ts +2 -0
  66. package/es/template/common/search-page/index.d.ts +3 -0
  67. package/es/template/common/search-page/index.d.ts.map +1 -1
  68. package/es/template/common/search-page/index.js +6 -3
  69. package/es/template/common/search-page/index.js.map +1 -1
  70. package/lib/atom/input-search/index.d.ts.map +1 -1
  71. package/lib/atom/input-search/index.js +1 -0
  72. package/lib/atom/input-search/index.js.map +1 -1
  73. package/lib/atom/input-switch/index.d.ts +2 -0
  74. package/lib/atom/input-switch/index.d.ts.map +1 -1
  75. package/lib/atom/input-switch/index.js +22 -11
  76. package/lib/atom/input-switch/index.js.map +1 -1
  77. package/lib/atom/select/index.d.ts +1 -0
  78. package/lib/atom/select/index.d.ts.map +1 -1
  79. package/lib/atom/select/index.js +13 -8
  80. package/lib/atom/select/index.js.map +1 -1
  81. package/lib/atom/tooltip/index.d.ts +1 -3
  82. package/lib/atom/tooltip/index.d.ts.map +1 -1
  83. package/lib/atom/tooltip/index.js +7 -18
  84. package/lib/atom/tooltip/index.js.map +1 -1
  85. package/lib/atom/tooltip/style.css +2 -10
  86. package/lib/globals.d.js.map +1 -1
  87. package/lib/molecule/brand-form-group/index.d.ts +8 -0
  88. package/lib/molecule/cm-popin/types.d.ts +2 -0
  89. package/lib/molecule/cm-popin/types.d.ts.map +1 -1
  90. package/lib/molecule/draggable-list/index.d.ts +2 -0
  91. package/lib/molecule/filters/filters-wrapper.d.ts.map +1 -1
  92. package/lib/molecule/filters/filters-wrapper.js +4 -1
  93. package/lib/molecule/filters/filters-wrapper.js.map +1 -1
  94. package/lib/molecule/filters/index.d.ts +2 -0
  95. package/lib/molecule/filters/index.d.ts.map +1 -1
  96. package/lib/molecule/filters/index.js +9 -3
  97. package/lib/molecule/filters/index.js.map +1 -1
  98. package/lib/molecule/setup-section/index.d.ts +2 -0
  99. package/lib/molecule/setup-section/index.d.ts.map +1 -1
  100. package/lib/molecule/setup-sections/index.d.ts +2 -0
  101. package/lib/molecule/setup-slide/index.d.ts +3 -0
  102. package/lib/molecule/setup-slider/index.d.ts +3 -0
  103. package/lib/molecule/video-player-mobile/index.native.d.ts +1 -1
  104. package/lib/molecule/video-player-mobile/index.native.d.ts.map +1 -1
  105. package/lib/molecule/video-player-mobile/index.native.js +29 -9
  106. package/lib/molecule/video-player-mobile/index.native.js.map +1 -1
  107. package/lib/organism/brand-form/index.d.ts +8 -0
  108. package/lib/organism/mooc-header/index.d.ts.map +1 -1
  109. package/lib/organism/mooc-header/index.js +4 -1
  110. package/lib/organism/mooc-header/index.js.map +1 -1
  111. package/lib/organism/review-slide/index.native.d.ts.map +1 -1
  112. package/lib/organism/review-slide/index.native.js +31 -13
  113. package/lib/organism/review-slide/index.native.js.map +1 -1
  114. package/lib/organism/user-preferences/index.d.ts +2 -0
  115. package/lib/organism/wizard-contents/index.d.ts +8 -0
  116. package/lib/template/activity/index.d.ts +12 -11
  117. package/lib/template/activity/index.d.ts.map +1 -1
  118. package/lib/template/activity/index.js +6 -3
  119. package/lib/template/activity/index.js.map +1 -1
  120. package/lib/template/app-player/loading/index.d.ts +2 -0
  121. package/lib/template/app-player/player/index.d.ts +4 -0
  122. package/lib/template/app-player/player/slides/index.d.ts +2 -0
  123. package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
  124. package/lib/template/app-player/popin-correction/index.d.ts +2 -0
  125. package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
  126. package/lib/template/app-player/popin-end/index.d.ts +2 -0
  127. package/lib/template/app-review/index.d.ts +2 -0
  128. package/lib/template/app-review/index.d.ts.map +1 -1
  129. package/lib/template/app-review/player/prop-types.d.ts +2 -0
  130. package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
  131. package/lib/template/app-review/prop-types.d.ts +2 -0
  132. package/lib/template/app-review/prop-types.d.ts.map +1 -1
  133. package/lib/template/back-office/brand-update/index.d.ts +18 -0
  134. package/lib/template/common/dashboard/index.d.ts +2 -0
  135. package/lib/template/common/search-page/index.d.ts +3 -0
  136. package/lib/template/common/search-page/index.d.ts.map +1 -1
  137. package/lib/template/common/search-page/index.js +6 -3
  138. package/lib/template/common/search-page/index.js.map +1 -1
  139. package/locales/.mtslconfig.json +1 -0
  140. package/package.json +4 -2
  141. package/es/atom/battle-opponent/index.d.ts +0 -19
  142. package/es/atom/battle-opponent/index.d.ts.map +0 -1
  143. package/es/atom/battle-opponent/index.js +0 -52
  144. package/es/atom/battle-opponent/index.js.map +0 -1
  145. package/es/atom/battle-opponent/prop-types.d.ts +0 -19
  146. package/es/atom/battle-opponent/prop-types.d.ts.map +0 -1
  147. package/es/atom/battle-opponent/prop-types.js +0 -11
  148. package/es/atom/battle-opponent/prop-types.js.map +0 -1
  149. package/es/atom/battle-opponent/style.css +0 -126
  150. package/lib/atom/battle-opponent/index.d.ts +0 -19
  151. package/lib/atom/battle-opponent/index.d.ts.map +0 -1
  152. package/lib/atom/battle-opponent/index.js +0 -70
  153. package/lib/atom/battle-opponent/index.js.map +0 -1
  154. package/lib/atom/battle-opponent/prop-types.d.ts +0 -19
  155. package/lib/atom/battle-opponent/prop-types.d.ts.map +0 -1
  156. package/lib/atom/battle-opponent/prop-types.js +0 -20
  157. package/lib/atom/battle-opponent/prop-types.js.map +0 -1
  158. package/lib/atom/battle-opponent/style.css +0 -126
@@ -67,9 +67,7 @@ const ArrowView = ({
67
67
  arrowClass,
68
68
  arrowColor
69
69
  }) => {
70
- const props = (0, _react.useMemo)(() => _extends({}, ariaLabel & {
71
- 'aria-label': ariaLabel
72
- }, arrowColor & {
70
+ const props = (0, _react.useMemo)(() => _extends({}, arrowColor & {
73
71
  color: arrowColor
74
72
  }, {
75
73
  className: arrowClass
@@ -100,7 +98,8 @@ const Select = (props, legacyContext) => {
100
98
  modified = false,
101
99
  error = false,
102
100
  title: propTitle,
103
- 'aria-label': ariaLabel
101
+ 'aria-label': ariaLabel,
102
+ 'aria-labelledby': ariaLabelledBy
104
103
  } = props;
105
104
  const skin = (0, _provider.GetSkinFromContext)(legacyContext);
106
105
  const title = (0, _react.useMemo)(() => propTitle ? `${propTitle}${required ? '*' : ''}` : null, [propTitle, required]);
@@ -175,10 +174,15 @@ const Select = (props, legacyContext) => {
175
174
  ariaLabel: ariaLabel,
176
175
  arrowClass: shouldUseSkinFontColor ? _style.default.selectedArrow : _style.default.arrow,
177
176
  arrowColor: isThemeOneOfQuestionTemplateOrPlayer ? arrowColor : black
178
- }), /*#__PURE__*/_react.default.createElement("select", {
177
+ }), /*#__PURE__*/_react.default.createElement("select", _extends({}, ariaLabelledBy ? {
178
+ 'aria-labelledby': ariaLabelledBy
179
+ } : {}, ariaLabel && !ariaLabelledBy ? {
180
+ 'aria-label': ariaLabel
181
+ } : {}, ariaLabel ? {
182
+ title: ariaLabel
183
+ } : {}, {
179
184
  "data-name": "native-select",
180
185
  className: _style.default.selectBox,
181
- title: selectedLabel,
182
186
  name: name,
183
187
  onChange: handleChange,
184
188
  value: selected,
@@ -191,7 +195,7 @@ const Select = (props, legacyContext) => {
191
195
  ,
192
196
  onMouseLeave: handleSelectOnBlur,
193
197
  "data-testid": "native-select"
194
- }, optionList)), /*#__PURE__*/_react.default.createElement("div", {
198
+ }), optionList)), /*#__PURE__*/_react.default.createElement("div", {
195
199
  className: _style.default.description
196
200
  }, description));
197
201
  };
@@ -226,7 +230,8 @@ Select.propTypes = process.env.NODE_ENV !== "production" ? {
226
230
  optgroups: _propTypes.default.arrayOf(_propTypes.default.shape(SelectOptionGroupPropTypes)),
227
231
  modified: _propTypes.default.bool,
228
232
  error: _propTypes.default.bool,
229
- 'aria-label': _propTypes.default.string
233
+ 'aria-label': _propTypes.default.string,
234
+ 'aria-labelledby': _propTypes.default.string
230
235
  } : {};
231
236
  var _default = Select;
232
237
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["themeStyle","filter","style","invalid","header","mooc","question","sort","thematiques","player","template","coorpmanager","ArrowView","shouldRender","isArrowUp","ariaLabel","arrowClass","arrowColor","props","useMemo","color","className","Select","legacyContext","name","options","optgroups","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","skin","GetSkinFromContext","setIsArrowUp","useState","handleSelectOnFocus","useCallback","handleSelectOnBlur","selectOption","option","index","value","optionList","isEmpty","map","optgroup","label","i","titleView","selected","get","find","concat","flatMapDeep","selectedLabel","isSelectedInValidOption","getOr","validOption","handleChange","e","target","selectedOptions","black","isThemeOneOfQuestionTemplateOrPlayer","includes","shouldUseSkinFontColor","undefined","behaviorClassName","getClassState","default","composedClassName","classnames","unselected","labelSize","size","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectedArrow","arrow","selectBox","SelectOptionPropTypes","PropTypes","string","isRequired","oneOfType","number","bool","SelectOptionGroupPropTypes","arrayOf","shape","contextTypes","Provider","childContextTypes","propTypes","func","oneOf","keys"],"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;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAIA;;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,EAA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CAAUQ,KAAV,CAAgBT,qBAAhB,CAAlB;AAF+B,CAAnC;;AAKPpE,MAAM,CAAC8E,YAAP,GAAsB;EACpB9D,IAAI,EAAE+D,iBAAA,CAASC,iBAAT,CAA2BhE;AADb,CAAtB;AAIAhB,MAAM,CAACiF,SAAP,2CAAmB;EACjBnE,KAAK,EAAEuD,kBAAA,CAAUC,MADA;EAEjBpE,IAAI,EAAEmE,kBAAA,CAAUC,MAFC;EAGjBvE,SAAS,EAAEsE,kBAAA,CAAUC,MAHJ;EAIjBjE,eAAe,EAAEgE,kBAAA,CAAUC,MAJV;EAKjB9D,QAAQ,EAAE6D,kBAAA,CAAUK,IALH;EAMjBnE,QAAQ,EAAE8D,kBAAA,CAAUK,IANH;EAOjBhE,WAAW,EAAE2D,kBAAA,CAAUC,MAPN;EAQjB7D,QAAQ,EAAE4D,kBAAA,CAAUK,IARH;EASjBpE,QAAQ,EAAE+D,kBAAA,CAAUa,IATH;EAUjBvE,KAAK,EAAE0D,kBAAA,CAAUc,KAAV,CAAgB,IAAAC,aAAA,EAAK1G,UAAL,CAAhB,CAVU;EAWjByB,OAAO,EAAEkE,kBAAA,CAAUO,OAAV,CAAkBP,kBAAA,CAAUQ,KAAV,CAAgBT,qBAAhB,CAAlB,CAXQ;EAYjBhE,SAAS,EAAEiE,kBAAA,CAAUO,OAAV,CAAkBP,kBAAA,CAAUQ,KAAV,CAAgBF,0BAAhB,CAAlB,CAZM;EAajB/D,QAAQ,EAAEyD,kBAAA,CAAUK,IAbH;EAcjB7D,KAAK,EAAEwD,kBAAA,CAAUK,IAdA;EAejB,cAAcL,kBAAA,CAAUC;AAfP,CAAnB;eAkBetE,M"}
1
+ {"version":3,"file":"index.js","names":["themeStyle","filter","style","invalid","header","mooc","question","sort","thematiques","player","template","coorpmanager","ArrowView","shouldRender","isArrowUp","ariaLabel","arrowClass","arrowColor","props","useMemo","color","className","Select","legacyContext","name","options","optgroups","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","ariaLabelledBy","skin","GetSkinFromContext","setIsArrowUp","useState","handleSelectOnFocus","useCallback","handleSelectOnBlur","selectOption","option","index","value","optionList","isEmpty","map","optgroup","label","i","titleView","selected","get","find","concat","flatMapDeep","selectedLabel","isSelectedInValidOption","getOr","validOption","handleChange","e","target","selectedOptions","black","isThemeOneOfQuestionTemplateOrPlayer","includes","shouldUseSkinFontColor","undefined","behaviorClassName","getClassState","default","composedClassName","classnames","unselected","labelSize","size","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectedArrow","arrow","selectBox","SelectOptionPropTypes","PropTypes","string","isRequired","oneOfType","number","bool","SelectOptionGroupPropTypes","arrayOf","shape","contextTypes","Provider","childContextTypes","propTypes","func","oneOf","keys"],"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 default Select;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,UAAU,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,KAAV,CAAgBT,qBAAhB,CAAlB,CAXQ;EAYjBjE,SAAS,EAAEkE,kBAAA,CAAUO,OAAV,CAAkBP,kBAAA,CAAUQ,KAAV,CAAgBF,0BAAhB,CAAlB,CAZM;EAajBhE,QAAQ,EAAE0D,kBAAA,CAAUK,IAbH;EAcjB9D,KAAK,EAAEyD,kBAAA,CAAUK,IAdA;EAejB,cAAcL,kBAAA,CAAUC,MAfP;EAgBjB,mBAAmBD,kBAAA,CAAUC;AAhBZ,CAAnB;eAmBevE,M"}
@@ -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"}
@@ -13,8 +13,6 @@ var _reactTooltip = _interopRequireDefault(require("react-tooltip"));
13
13
 
14
14
  var _isString = _interopRequireDefault(require("lodash/fp/isString"));
15
15
 
16
- var _keys = _interopRequireDefault(require("lodash/fp/keys"));
17
-
18
16
  var _novaIcons = require("@coorpacademy/nova-icons");
19
17
 
20
18
  var _style = _interopRequireDefault(require("./style.css"));
@@ -29,18 +27,13 @@ const FontSizes = {
29
27
  12: _style.default.tooltipContentFontSize12,
30
28
  14: _style.default.tooltipContentFontSize14
31
29
  };
32
- const IconSizes = {
33
- small: 12,
34
- big: 20
35
- };
36
30
 
37
31
  const ToolTipWrapper = ({
38
32
  toolTipIsVisible,
39
33
  anchorId,
40
34
  closeToolTipInformationTextAriaLabel,
41
35
  content,
42
- handleContentMouseOver,
43
- iconSize
36
+ handleContentMouseOver
44
37
  }) => {
45
38
  if (!toolTipIsVisible) return null;
46
39
 
@@ -55,7 +48,7 @@ const ToolTipWrapper = ({
55
48
  }, content);
56
49
  } else {
57
50
  return /*#__PURE__*/_react.default.createElement("div", {
58
- className: (0, _classnames.default)(_style.default.toolTip, iconSize === 'big' ? _style.default.bigIconToolTip : _style.default.smallIconToolTip),
51
+ className: _style.default.toolTip,
59
52
  "data-testid": "tooltip",
60
53
  "aria-label": closeToolTipInformationTextAriaLabel,
61
54
  onMouseOver: handleContentMouseOver
@@ -68,8 +61,7 @@ ToolTipWrapper.propTypes = process.env.NODE_ENV !== "production" ? {
68
61
  anchorId: _propTypes.default.string,
69
62
  closeToolTipInformationTextAriaLabel: _propTypes.default.string.isRequired,
70
63
  content: _propTypes.default.node,
71
- handleContentMouseOver: _propTypes.default.func,
72
- iconSize: _propTypes.default.oneOf((0, _keys.default)(IconSizes))
64
+ handleContentMouseOver: _propTypes.default.func
73
65
  } : {};
74
66
 
75
67
  const toggleStateOnKeyPress = (state, setState, ref) => event => {
@@ -94,8 +86,7 @@ const ToolTip = ({
94
86
  toolTipIsVisible: _toolTipIsVisible,
95
87
  iconContainerClassName,
96
88
  delayHide = 250,
97
- fontSize = 14,
98
- iconSize = 'small'
89
+ fontSize = 14
99
90
  }) => {
100
91
  const isComponent = (0, _react.useMemo)(() => !(0, _isString.default)(TooltipContent) && /*#__PURE__*/(0, _react.isValidElement)(TooltipContent()), [TooltipContent]);
101
92
  const [toolTipIsVisible, setToolTipIsVisible] = (0, _react.useState)(false);
@@ -140,8 +131,8 @@ const ToolTip = ({
140
131
  tabIndex: 0
141
132
  }, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademyInformationIcon, {
142
133
  className: _style.default.informationIcon,
143
- width: IconSizes[iconSize],
144
- height: IconSizes[iconSize],
134
+ width: 12,
135
+ height: 12,
145
136
  "aria-label": ariaLabel
146
137
  })), /*#__PURE__*/_react.default.createElement(ToolTipWrapper, {
147
138
  toolTipIsVisible: toolTipIsVisible,
@@ -149,8 +140,7 @@ const ToolTip = ({
149
140
  closeToolTipInformationTextAriaLabel: closeToolTipInformationTextAriaLabel,
150
141
  content: content,
151
142
  handleContentMouseOver: handleContentMouseOver,
152
- fontSize: fontSize,
153
- iconSize: iconSize
143
+ fontSize: fontSize
154
144
  }));
155
145
  };
156
146
 
@@ -163,7 +153,6 @@ ToolTip.propTypes = process.env.NODE_ENV !== "production" ? {
163
153
  iconContainerClassName: _propTypes.default.string,
164
154
  delayHide: _propTypes.default.number,
165
155
  fontSize: _propTypes.default.oneOf([12, 14]),
166
- iconSize: _propTypes.default.oneOf((0, _keys.default)(IconSizes)),
167
156
  // ---------- React Tooltip exclusive --------------
168
157
  // externalHandling: if passed down, React Tooltip is used instead, due to limitations on
169
158
  // parents overflow hidden controls
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["FontSizes","style","tooltipContentFontSize12","tooltipContentFontSize14","IconSizes","small","big","ToolTipWrapper","toolTipIsVisible","anchorId","closeToolTipInformationTextAriaLabel","content","handleContentMouseOver","iconSize","toolTipReact","classnames","toolTip","bigIconToolTip","smallIconToolTip","propTypes","PropTypes","bool","string","isRequired","node","func","oneOf","keys","toggleStateOnKeyPress","state","setState","ref","event","key","current","focus","stopPropagation","preventDefault","ToolTip","TooltipContent","ariaLabel","dataTestId","_toolTipIsVisible","iconContainerClassName","delayHide","fontSize","isComponent","useMemo","isString","isValidElement","setToolTipIsVisible","useState","mouseLeaveTimer","setMouseLeaveTimer","undefined","handleKeyPress","useCallback","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;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,SAAS,GAAG;EAChB,IAAIC,cAAA,CAAMC,wB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style","tooltipContentFontSize12","tooltipContentFontSize14","ToolTipWrapper","toolTipIsVisible","anchorId","closeToolTipInformationTextAriaLabel","content","handleContentMouseOver","toolTipReact","toolTip","propTypes","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","useMemo","isString","isValidElement","setToolTipIsVisible","useState","mouseLeaveTimer","setMouseLeaveTimer","undefined","handleKeyPress","useCallback","clearTimeout","handleMouseOver","handleMouseLeave","setTimeout","classnames","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;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,SAAS,GAAG;EAChB,IAAIC,cAAA,CAAMC,wBADM;EAEhB,IAAID,cAAA,CAAME;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,6BAAC,qBAAD;MACE,EAAE,EAAEA,QADN;MAEE,SAAS,EAAEL,cAAA,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B,cAAcF,kBAAA,CAAUE,MAHN;EAIlBR,oCAAoC,EAAEM,kBAAA,CAAUE,MAAV,CAAiBC,UAJrC;EAKlB;EACAkB,sBAAsB,EAAErB,kBAAA,CAAUE,MANhB;EAOlBoB,SAAS,EAAEtB,kBAAA,CAAU6C,MAPH;EAQlBtB,QAAQ,EAAEvB,kBAAA,CAAU8C,KAAV,CAAgB,CAAC,EAAD,EAAK,EAAL,CAAhB,CARQ;EASlB;EACA;EACA;EACArD,QAAQ,EAAEO,kBAAA,CAAUE,MAZF;EAalBV,gBAAgB,EAAEQ,kBAAA,CAAUC;AAbV,CAApB;eAgBee,O"}
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCd,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE;QACZ,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAEF,oBAAY,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,YAAY,CAAC,EAAE,eAAe,CAAC;CAChC,CAAC;AAEF,eAAe,SAAS,CAAC"}
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCd,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE;QACZ,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAEF,oBAAY,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,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>;
@@ -1 +1 @@
1
- {"version":3,"file":"filters-wrapper.d.ts","sourceRoot":"","sources":["../../../src/molecule/filters/filters-wrapper.js"],"names":[],"mappings":";AAUA,sEA6DC"}
1
+ {"version":3,"file":"filters-wrapper.d.ts","sourceRoot":"","sources":["../../../src/molecule/filters/filters-wrapper.js"],"names":[],"mappings":";AAUA,sEA+DC"}
@@ -80,10 +80,13 @@ const FiltersWapper = (props, context) => {
80
80
  className: _filtersWapper.default.choice,
81
81
  key: idx
82
82
  }, /*#__PURE__*/_react.default.createElement("p", {
83
+ id: `title-id-${idx}`,
83
84
  className: _filtersWapper.default.title
84
85
  }, filter.title), /*#__PURE__*/_react.default.createElement("div", {
85
86
  className: _filtersWapper.default.toggle
86
- }, /*#__PURE__*/_react.default.createElement(_inputSwitch.default, filter.display)));
87
+ }, /*#__PURE__*/_react.default.createElement(_inputSwitch.default, _extends({}, filter.display, {
88
+ "aria-labelledby": `title-id-${idx}`
89
+ }))));
87
90
 
88
91
  default:
89
92
  return null;
@@ -1 +1 @@
1
- {"version":3,"file":"filters-wrapper.js","names":["FiltersWapper","props","context","filters","className","filterGroupAriaLabel","buildFilter","filter","idx","type","fieldName","style","choice","title","radioGroup","timerWrapper","timerSubtitle","subtitle","toggle","display","filtersList","convert","cap","emptyFilters","classnames","wrapperNone","wrapper","propTypes","PropTypes","string","arrayOf","shape","oneOf","isRequired"],"sources":["../../../src/molecule/filters/filters-wrapper.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty, map} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Select from '../../atom/select';\nimport InputSwitch from '../../atom/input-switch';\nimport RadioGroup from '../../atom/radio-group';\nimport RangeSlider from '../../atom/range';\nimport style from './filters-wapper.css';\n\nconst FiltersWapper = (props, context) => {\n const {filters, className, filterGroupAriaLabel} = props;\n\n const buildFilter = (filter, idx) => {\n const {type, fieldName} = filter;\n switch (type) {\n case 'select':\n return (\n <div data-name=\"choice\" data-filter-type={fieldName} className={style.choice} key={idx}>\n <Select {...filter} />\n </div>\n );\n case 'radio':\n return (\n <div data-name=\"choice\" data-filter-type={fieldName} className={style.choice} key={idx}>\n <p className={style.title}>{filter.title}</p>\n <RadioGroup {...filter} className={style.radioGroup} />\n </div>\n );\n case 'range':\n return (\n <div\n data-name=\"choice\"\n data-filter-type={fieldName}\n className={style.timerWrapper}\n key={idx}\n >\n <label>\n <span className={style.title}>{filter.title}</span>\n <p className={style.timerSubtitle}>{filter.subtitle}</p>\n <RangeSlider {...filter} />\n </label>\n </div>\n );\n case 'switch':\n return (\n <div data-name=\"choice\" data-filter-type={fieldName} className={style.choice} key={idx}>\n <p className={style.title}>{filter.title}</p>\n <div className={style.toggle}>\n <InputSwitch {...filter.display} />\n </div>\n </div>\n );\n default:\n return null;\n }\n };\n\n const filtersList = map.convert({cap: false})(buildFilter, filters);\n const emptyFilters = isEmpty(filters);\n return (\n <form>\n <div\n className={classnames(className, emptyFilters ? style.wrapperNone : style.wrapper)}\n role=\"group\"\n aria-label={filterGroupAriaLabel}\n >\n {filtersList}\n </div>\n </form>\n );\n};\n\nFiltersWapper.propTypes = {\n className: PropTypes.string,\n filters: PropTypes.arrayOf(\n PropTypes.shape({\n type: PropTypes.oneOf(['select', 'range', 'radio', 'switch']).isRequired,\n fieldName: PropTypes.string.isRequired\n })\n ),\n filterGroupAriaLabel: PropTypes.string\n};\nexport default FiltersWapper;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,aAAa,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACxC,MAAM;IAACC,OAAD;IAAUC,SAAV;IAAqBC;EAArB,IAA6CJ,KAAnD;;EAEA,MAAMK,WAAW,GAAG,CAACC,MAAD,EAASC,GAAT,KAAiB;IACnC,MAAM;MAACC,IAAD;MAAOC;IAAP,IAAoBH,MAA1B;;IACA,QAAQE,IAAR;MACE,KAAK,QAAL;QACE,oBACE;UAAK,aAAU,QAAf;UAAwB,oBAAkBC,SAA1C;UAAqD,SAAS,EAAEC,sBAAA,CAAMC,MAAtE;UAA8E,GAAG,EAAEJ;QAAnF,gBACE,6BAAC,eAAD,EAAYD,MAAZ,CADF,CADF;;MAKF,KAAK,OAAL;QACE,oBACE;UAAK,aAAU,QAAf;UAAwB,oBAAkBG,SAA1C;UAAqD,SAAS,EAAEC,sBAAA,CAAMC,MAAtE;UAA8E,GAAG,EAAEJ;QAAnF,gBACE;UAAG,SAAS,EAAEG,sBAAA,CAAME;QAApB,GAA4BN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;AA+DApB,aAAa,CAAC2B,SAAd,2CAA0B;EACxBvB,SAAS,EAAEwB,kBAAA,CAAUC,MADG;EAExB1B,OAAO,EAAEyB,kBAAA,CAAUE,OAAV,CACPF,kBAAA,CAAUG,KAAV,CAAgB;IACdtB,IAAI,EAAEmB,kBAAA,CAAUI,KAAV,CAAgB,CAAC,QAAD,EAAW,OAAX,EAAoB,OAApB,EAA6B,QAA7B,CAAhB,EAAwDC,UADhD;IAEdvB,SAAS,EAAEkB,kBAAA,CAAUC,MAAV,CAAiBI;EAFd,CAAhB,CADO,CAFe;EAQxB5B,oBAAoB,EAAEuB,kBAAA,CAAUC;AARR,CAA1B;eAUe7B,a"}
1
+ {"version":3,"file":"filters-wrapper.js","names":["FiltersWapper","props","context","filters","className","filterGroupAriaLabel","buildFilter","filter","idx","type","fieldName","style","choice","title","radioGroup","timerWrapper","timerSubtitle","subtitle","toggle","display","filtersList","convert","cap","emptyFilters","classnames","wrapperNone","wrapper","propTypes","PropTypes","string","arrayOf","shape","oneOf","isRequired"],"sources":["../../../src/molecule/filters/filters-wrapper.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty, map} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Select from '../../atom/select';\nimport InputSwitch from '../../atom/input-switch';\nimport RadioGroup from '../../atom/radio-group';\nimport RangeSlider from '../../atom/range';\nimport style from './filters-wapper.css';\n\nconst FiltersWapper = (props, context) => {\n const {filters, className, filterGroupAriaLabel} = props;\n\n const buildFilter = (filter, idx) => {\n const {type, fieldName} = filter;\n switch (type) {\n case 'select':\n return (\n <div data-name=\"choice\" data-filter-type={fieldName} className={style.choice} key={idx}>\n <Select {...filter} />\n </div>\n );\n case 'radio':\n return (\n <div data-name=\"choice\" data-filter-type={fieldName} className={style.choice} key={idx}>\n <p className={style.title}>{filter.title}</p>\n <RadioGroup {...filter} className={style.radioGroup} />\n </div>\n );\n case 'range':\n return (\n <div\n data-name=\"choice\"\n data-filter-type={fieldName}\n className={style.timerWrapper}\n key={idx}\n >\n <label>\n <span className={style.title}>{filter.title}</span>\n <p className={style.timerSubtitle}>{filter.subtitle}</p>\n <RangeSlider {...filter} />\n </label>\n </div>\n );\n case 'switch':\n return (\n <div data-name=\"choice\" data-filter-type={fieldName} className={style.choice} key={idx}>\n <p id={`title-id-${idx}`} className={style.title}>\n {filter.title}\n </p>\n <div className={style.toggle}>\n <InputSwitch {...filter.display} aria-labelledby={`title-id-${idx}`} />\n </div>\n </div>\n );\n default:\n return null;\n }\n };\n\n const filtersList = map.convert({cap: false})(buildFilter, filters);\n const emptyFilters = isEmpty(filters);\n return (\n <form>\n <div\n className={classnames(className, emptyFilters ? style.wrapperNone : style.wrapper)}\n role=\"group\"\n aria-label={filterGroupAriaLabel}\n >\n {filtersList}\n </div>\n </form>\n );\n};\n\nFiltersWapper.propTypes = {\n className: PropTypes.string,\n filters: PropTypes.arrayOf(\n PropTypes.shape({\n type: PropTypes.oneOf(['select', 'range', 'radio', 'switch']).isRequired,\n fieldName: PropTypes.string.isRequired\n })\n ),\n filterGroupAriaLabel: PropTypes.string\n};\nexport default FiltersWapper;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,aAAa,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACxC,MAAM;IAACC,OAAD;IAAUC,SAAV;IAAqBC;EAArB,IAA6CJ,KAAnD;;EAEA,MAAMK,WAAW,GAAG,CAACC,MAAD,EAASC,GAAT,KAAiB;IACnC,MAAM;MAACC,IAAD;MAAOC;IAAP,IAAoBH,MAA1B;;IACA,QAAQE,IAAR;MACE,KAAK,QAAL;QACE,oBACE;UAAK,aAAU,QAAf;UAAwB,oBAAkBC,SAA1C;UAAqD,SAAS,EAAEC,sBAAA,CAAMC,MAAtE;UAA8E,GAAG,EAAEJ;QAAnF,gBACE,6BAAC,eAAD,EAAYD,MAAZ,CADF,CADF;;MAKF,KAAK,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AY,GAAG,uBAAQpB,OAAR,CAArB;EACA,oBACE,wDACE;IACE,SAAS,EAAE,IAAAqB,mBAAA,EAAWpB,SAAX,EAAsBmB,YAAY,GAAGZ,sBAAA,CAAMc,WAAT,GAAuBd,sBAAA,CAAMe,OAA/D,CADb;IAEE,IAAI,EAAC,OAFP;IAGE,cAAYrB;EAHd,GAKGe,WALH,CADF,CADF;AAWD,CA/DD;;AAiEApB,aAAa,CAAC2B,SAAd,2CAA0B;EACxBvB,SAAS,EAAEwB,kBAAA,CAAUC,MADG;EAExB1B,OAAO,EAAEyB,kBAAA,CAAUE,OAAV,CACPF,kBAAA,CAAUG,KAAV,CAAgB;IACdtB,IAAI,EAAEmB,kBAAA,CAAUI,KAAV,CAAgB,CAAC,QAAD,EAAW,OAAX,EAAoB,OAApB,EAA6B,QAA7B,CAAhB,EAAwDC,UADhD;IAEdvB,SAAS,EAAEkB,kBAAA,CAAUC,MAAV,CAAiBI;EAFd,CAAhB,CADO,CAFe;EAQxB5B,oBAAoB,EAAEuB,kBAAA,CAAUC;AARR,CAA1B;eAUe7B,a"}
@@ -40,6 +40,7 @@ declare class Filters extends React.Component<any, any, any> {
40
40
  modified: PropTypes.Requireable<boolean>;
41
41
  error: PropTypes.Requireable<boolean>;
42
42
  'aria-label': PropTypes.Requireable<string>;
43
+ 'aria-labelledby': PropTypes.Requireable<string>;
43
44
  }>>;
44
45
  onSearch: PropTypes.Requireable<(...args: any[]) => any>;
45
46
  onToggleFilters: PropTypes.Requireable<(...args: any[]) => any>;
@@ -47,6 +48,7 @@ declare class Filters extends React.Component<any, any, any> {
47
48
  moreSortAriaLabel: PropTypes.Requireable<string>;
48
49
  moreFilterAriaLabel: PropTypes.Requireable<string>;
49
50
  filterGroupAriaLabel: PropTypes.Requireable<string>;
51
+ sortAriaLabel: PropTypes.Requireable<string>;
50
52
  };
51
53
  static contextTypes: {
52
54
  skin: PropTypes.Requireable<PropTypes.InferProps<{
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/filters/index.js"],"names":[],"mappings":";AASA;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAeE;IAEF;;;;;;;;;;;;;;;;;;;;;;MAEE;IAEF,wBASC;IAPC;;;MAGC;IAMH,yBAcC;IAED,uBAYC;IAED,qBAOC;IAED,sBA2FC;CACF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/filters/index.js"],"names":[],"mappings":";AASA;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgBE;IAEF;;;;;;;;;;;;;;;;;;;;;;MAEE;IAEF,wBASC;IAPC;;;MAGC;IAMH,yBAcC;IAED,uBAYC;IAED,qBAOC;IAED,sBA4FC;CACF"}
@@ -21,6 +21,8 @@ var _filtersWrapper = _interopRequireDefault(require("./filters-wrapper"));
21
21
 
22
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
23
 
24
+ 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); }
25
+
24
26
  class Filters extends _react.default.Component {
25
27
  constructor(props) {
26
28
  super(props);
@@ -87,7 +89,8 @@ class Filters extends _react.default.Component {
87
89
  filters,
88
90
  moreFilterAriaLabel,
89
91
  moreSortAriaLabel,
90
- filterGroupAriaLabel
92
+ filterGroupAriaLabel,
93
+ sortAriaLabel
91
94
  } = this.props;
92
95
  const {
93
96
  filter,
@@ -103,7 +106,9 @@ class Filters extends _react.default.Component {
103
106
  const sortView = sorting !== undefined ? /*#__PURE__*/_react.default.createElement("div", {
104
107
  "data-name": "choice",
105
108
  className: _style.default.select
106
- }, /*#__PURE__*/_react.default.createElement(_select.default, sorting)) : null;
109
+ }, /*#__PURE__*/_react.default.createElement(_select.default, _extends({}, sorting, {
110
+ "aria-label": sortAriaLabel
111
+ }))) : null;
107
112
  return /*#__PURE__*/_react.default.createElement("div", {
108
113
  "data-name": "search",
109
114
  className: _style.default.search
@@ -185,7 +190,8 @@ Filters.propTypes = process.env.NODE_ENV !== "production" ? {
185
190
  onToggleSorts: _propTypes.default.func,
186
191
  moreSortAriaLabel: _propTypes.default.string,
187
192
  moreFilterAriaLabel: _propTypes.default.string,
188
- filterGroupAriaLabel: _propTypes.default.string
193
+ filterGroupAriaLabel: _propTypes.default.string,
194
+ sortAriaLabel: _propTypes.default.string
189
195
  } : {};
190
196
  var _default = Filters;
191
197
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Filters","React","Component","constructor","props","state","filter","openFilters","sorted","openSorts","handleOpenFilter","bind","handleOpenSort","handleSearch","onToggleFilters","newValue","setState","onToggleSorts","onSearch","render","sorting","filterCTALabel","filterTabLabel","sortCTALabel","sortTabLabel","filters","moreFilterAriaLabel","moreSortAriaLabel","filterGroupAriaLabel","skin","context","defaultColor","darkColor","filtersActive","sortingActive","sortView","undefined","style","select","search","activeDefault","default","title","arrow","color","activeWrapperSortBy","wrapperSortBy","activeWrapperFilters","wrapperFilters","wrapper","CTAfilter","backgroundColor","activeSorting","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","bool","FiltersWrapper","shape","Select","func"],"sources":["../../../src/molecule/filters/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {get} from 'lodash/fp';\nimport {NovaCompositionNavigationArrowDown as ArrowDown} from '@coorpacademy/nova-icons';\nimport Select from '../../atom/select';\nimport Provider from '../../atom/provider';\nimport style from './style.css';\nimport FiltersWrapper from './filters-wrapper';\n\nclass Filters extends React.Component {\n static propTypes = {\n filterCTALabel: PropTypes.string,\n filterTabLabel: PropTypes.string,\n sortCTALabel: PropTypes.string,\n sortTabLabel: PropTypes.string,\n openFilters: PropTypes.bool,\n openSorts: PropTypes.bool,\n filters: FiltersWrapper.propTypes.filters,\n sorting: PropTypes.shape(Select.propTypes),\n onSearch: PropTypes.func,\n onToggleFilters: PropTypes.func,\n onToggleSorts: PropTypes.func,\n moreSortAriaLabel: PropTypes.string,\n moreFilterAriaLabel: PropTypes.string,\n filterGroupAriaLabel: PropTypes.string\n };\n\n static contextTypes = {\n skin: Provider.childContextTypes.skin\n };\n\n constructor(props) {\n super(props);\n this.state = {\n filter: !!props.openFilters,\n sorted: !!props.openSorts\n };\n this.handleOpenFilter = this.handleOpenFilter.bind(this);\n this.handleOpenSort = this.handleOpenSort.bind(this);\n this.handleSearch = this.handleSearch.bind(this);\n }\n\n handleOpenFilter() {\n const {filter} = this.state;\n const {onToggleFilters} = this.props;\n\n const newValue = !filter;\n\n this.setState({\n filter: newValue,\n sorted: false\n });\n\n if (onToggleFilters) {\n onToggleFilters(newValue);\n }\n }\n\n handleOpenSort() {\n const {sorted} = this.state;\n const {onToggleSorts} = this.props;\n\n const newValue = !sorted;\n\n this.setState({\n sorted: newValue,\n filter: false\n });\n\n if (onToggleSorts) onToggleSorts(newValue);\n }\n\n handleSearch() {\n const {onSearch} = this.props;\n this.setState({\n sorted: false,\n filter: false\n });\n if (onSearch) onSearch();\n }\n\n render() {\n const {\n sorting,\n filterCTALabel,\n filterTabLabel,\n sortCTALabel,\n sortTabLabel,\n filters,\n moreFilterAriaLabel,\n moreSortAriaLabel,\n filterGroupAriaLabel\n } = this.props;\n const {filter, sorted} = this.state;\n const {skin} = this.context;\n\n const defaultColor = get('common.primary', skin);\n const darkColor = get('common.dark', skin);\n const filtersActive = filter === true;\n const sortingActive = sorted === true;\n\n const sortView =\n sorting !== undefined ? (\n <div data-name=\"choice\" className={style.select}>\n <Select {...sorting} />\n </div>\n ) : null;\n\n return (\n <div data-name=\"search\" className={style.search}>\n <div\n data-name=\"filter\"\n data-open={filtersActive}\n className={filtersActive ? style.activeDefault : style.default}\n >\n <div className={style.title} data-name=\"filterButton\" onClick={this.handleOpenFilter}>\n {filterTabLabel}\n <div className={style.arrow}>\n <ArrowDown style={{color: darkColor}} height={14} aria-label={moreFilterAriaLabel} />\n </div>\n </div>\n </div>\n <div\n data-name=\"sortBy\"\n data-open={sortingActive}\n className={sortingActive ? style.activeWrapperSortBy : style.wrapperSortBy}\n >\n <div className={style.title} data-name=\"sortButton\" onClick={this.handleOpenSort}>\n {sortTabLabel}\n <div className={style.arrow}>\n <ArrowDown style={{color: darkColor}} height={14} aria-label={moreSortAriaLabel} />\n </div>\n </div>\n </div>\n <div\n data-name=\"filterWrapper\"\n className={filtersActive ? style.activeWrapperFilters : style.wrapperFilters}\n >\n <FiltersWrapper\n className={style.wrapper}\n filters={filters}\n filterGroupAriaLabel={filterGroupAriaLabel}\n />\n <div\n data-name=\"cta\"\n className={style.CTAfilter}\n style={{\n backgroundColor: defaultColor\n }}\n onClick={this.handleSearch}\n >\n {filterCTALabel}\n </div>\n </div>\n <div\n data-name=\"sortWrapper\"\n className={sortingActive ? style.activeSorting : style.sorting}\n >\n {sortView}\n <div\n data-name=\"cta\"\n className={style.CTAfilter}\n style={{\n backgroundColor: defaultColor\n }}\n onClick={this.handleSearch}\n >\n {sortCTALabel}\n </div>\n </div>\n </div>\n );\n }\n}\n\nexport default Filters;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,OAAN,SAAsBC,cAAA,CAAMC,SAA5B,CAAsC;EAsBpCC,WAAW,CAACC,KAAD,EAAQ;IACjB,MAAMA,KAAN;IACA,KAAKC,KAAL,GAAa;MACXC,MAAM,EAAE,CAAC,CAACF,KAAK,CAACG,WADL;MAEXC,MAAM,EAAE,CAAC,CAACJ,KAAK,CAACK;IAFL,CAAb;IAIA,KAAKC,gBAAL,GAAwB,KAAKA,gBAAL,CAAsBC,IAAtB,CAA2B,IAA3B,CAAxB;IACA,KAAKC,cAAL,GAAsB,KAAKA,cAAL,CAAoBD,IAApB,CAAyB,IAAzB,CAAtB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AUjBjD,eAAe,EAAE2C,kBAAA,CAAUM,IAVV;EAWjB9C,aAAa,EAAEwC,kBAAA,CAAUM,IAXR;EAYjBpC,iBAAiB,EAAE8B,kBAAA,CAAUC,MAZZ;EAajBhC,mBAAmB,EAAE+B,kBAAA,CAAUC,MAbd;EAcjB9B,oBAAoB,EAAE6B,kBAAA,CAAUC;AAdf,C;eAqKN1D,O"}
1
+ {"version":3,"file":"index.js","names":["Filters","React","Component","constructor","props","state","filter","openFilters","sorted","openSorts","handleOpenFilter","bind","handleOpenSort","handleSearch","onToggleFilters","newValue","setState","onToggleSorts","onSearch","render","sorting","filterCTALabel","filterTabLabel","sortCTALabel","sortTabLabel","filters","moreFilterAriaLabel","moreSortAriaLabel","filterGroupAriaLabel","sortAriaLabel","skin","context","defaultColor","darkColor","filtersActive","sortingActive","sortView","undefined","style","select","search","activeDefault","default","title","arrow","color","activeWrapperSortBy","wrapperSortBy","activeWrapperFilters","wrapperFilters","wrapper","CTAfilter","backgroundColor","activeSorting","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","bool","FiltersWrapper","shape","Select","func"],"sources":["../../../src/molecule/filters/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {get} from 'lodash/fp';\nimport {NovaCompositionNavigationArrowDown as ArrowDown} from '@coorpacademy/nova-icons';\nimport Select from '../../atom/select';\nimport Provider from '../../atom/provider';\nimport style from './style.css';\nimport FiltersWrapper from './filters-wrapper';\n\nclass Filters extends React.Component {\n static propTypes = {\n filterCTALabel: PropTypes.string,\n filterTabLabel: PropTypes.string,\n sortCTALabel: PropTypes.string,\n sortTabLabel: PropTypes.string,\n openFilters: PropTypes.bool,\n openSorts: PropTypes.bool,\n filters: FiltersWrapper.propTypes.filters,\n sorting: PropTypes.shape(Select.propTypes),\n onSearch: PropTypes.func,\n onToggleFilters: PropTypes.func,\n onToggleSorts: PropTypes.func,\n moreSortAriaLabel: PropTypes.string,\n moreFilterAriaLabel: PropTypes.string,\n filterGroupAriaLabel: PropTypes.string,\n sortAriaLabel: PropTypes.string\n };\n\n static contextTypes = {\n skin: Provider.childContextTypes.skin\n };\n\n constructor(props) {\n super(props);\n this.state = {\n filter: !!props.openFilters,\n sorted: !!props.openSorts\n };\n this.handleOpenFilter = this.handleOpenFilter.bind(this);\n this.handleOpenSort = this.handleOpenSort.bind(this);\n this.handleSearch = this.handleSearch.bind(this);\n }\n\n handleOpenFilter() {\n const {filter} = this.state;\n const {onToggleFilters} = this.props;\n\n const newValue = !filter;\n\n this.setState({\n filter: newValue,\n sorted: false\n });\n\n if (onToggleFilters) {\n onToggleFilters(newValue);\n }\n }\n\n handleOpenSort() {\n const {sorted} = this.state;\n const {onToggleSorts} = this.props;\n\n const newValue = !sorted;\n\n this.setState({\n sorted: newValue,\n filter: false\n });\n\n if (onToggleSorts) onToggleSorts(newValue);\n }\n\n handleSearch() {\n const {onSearch} = this.props;\n this.setState({\n sorted: false,\n filter: false\n });\n if (onSearch) onSearch();\n }\n\n render() {\n const {\n sorting,\n filterCTALabel,\n filterTabLabel,\n sortCTALabel,\n sortTabLabel,\n filters,\n moreFilterAriaLabel,\n moreSortAriaLabel,\n filterGroupAriaLabel,\n sortAriaLabel\n } = this.props;\n const {filter, sorted} = this.state;\n const {skin} = this.context;\n\n const defaultColor = get('common.primary', skin);\n const darkColor = get('common.dark', skin);\n const filtersActive = filter === true;\n const sortingActive = sorted === true;\n\n const sortView =\n sorting !== undefined ? (\n <div data-name=\"choice\" className={style.select}>\n <Select {...sorting} aria-label={sortAriaLabel} />\n </div>\n ) : null;\n\n return (\n <div data-name=\"search\" className={style.search}>\n <div\n data-name=\"filter\"\n data-open={filtersActive}\n className={filtersActive ? style.activeDefault : style.default}\n >\n <div className={style.title} data-name=\"filterButton\" onClick={this.handleOpenFilter}>\n {filterTabLabel}\n <div className={style.arrow}>\n <ArrowDown style={{color: darkColor}} height={14} aria-label={moreFilterAriaLabel} />\n </div>\n </div>\n </div>\n <div\n data-name=\"sortBy\"\n data-open={sortingActive}\n className={sortingActive ? style.activeWrapperSortBy : style.wrapperSortBy}\n >\n <div className={style.title} data-name=\"sortButton\" onClick={this.handleOpenSort}>\n {sortTabLabel}\n <div className={style.arrow}>\n <ArrowDown style={{color: darkColor}} height={14} aria-label={moreSortAriaLabel} />\n </div>\n </div>\n </div>\n <div\n data-name=\"filterWrapper\"\n className={filtersActive ? style.activeWrapperFilters : style.wrapperFilters}\n >\n <FiltersWrapper\n className={style.wrapper}\n filters={filters}\n filterGroupAriaLabel={filterGroupAriaLabel}\n />\n <div\n data-name=\"cta\"\n className={style.CTAfilter}\n style={{\n backgroundColor: defaultColor\n }}\n onClick={this.handleSearch}\n >\n {filterCTALabel}\n </div>\n </div>\n <div\n data-name=\"sortWrapper\"\n className={sortingActive ? style.activeSorting : style.sorting}\n >\n {sortView}\n <div\n data-name=\"cta\"\n className={style.CTAfilter}\n style={{\n backgroundColor: defaultColor\n }}\n onClick={this.handleSearch}\n >\n {sortCTALabel}\n </div>\n </div>\n </div>\n );\n }\n}\n\nexport default Filters;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,OAAN,SAAsBC,cAAA,CAAMC,SAA5B,CAAsC;EAuBpCC,WAAW,CAACC,KAAD,EAAQ;IACjB,MAAMA,KAAN;IACA,KAAKC,KAAL,GAAa;MACXC,MAAM,EAAE,CAAC,CAACF,KAAK,CAACG,WADL;MAEXC,MAAM,EAAE,CAAC,CAACJ,KAAK,CAACK;IAFL,CAAb;IAIA,KAAKC,gBAAL,GAAwB,KAAKA,gBAAL,CAAsBC,IAAtB,CAA2B,IAA3B,CAAxB;IACA,KAAKC,cAAL,GAAsB,KAAKA,cAAL,CAAoBD,IAApB,CAAyB,IAAzB,CAAtB;IACA,KAAKE,YAAL,GAAoB,KAAKA,YAAL,CAAkBF,IAAlB,CAAuB,IAAvB,CAApB;EACD;;EAEDD,gBAAgB,GAAG;IACjB,MAAM;MAACJ;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R;EAYjBrC,iBAAiB,EAAE+B,kBAAA,CAAUC,MAZZ;EAajBjC,mBAAmB,EAAEgC,kBAAA,CAAUC,MAbd;EAcjB/B,oBAAoB,EAAE8B,kBAAA,CAAUC,MAdf;EAejB9B,aAAa,EAAE6B,kBAAA,CAAUC;AAfR,C;eAuKN3D,O"}
@@ -37,6 +37,8 @@ declare namespace SetupSection {
37
37
  disabled: PropTypes.Requireable<boolean>;
38
38
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
39
39
  description: PropTypes.Requireable<string>;
40
+ 'aria-labelledby': PropTypes.Requireable<string>;
41
+ 'aria-label': PropTypes.Requireable<string>;
40
42
  modified: PropTypes.Requireable<boolean>;
41
43
  titlePosition: PropTypes.Requireable<string>;
42
44
  theme: PropTypes.Requireable<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/setup-section/index.js"],"names":[],"mappings":";AAsCA,qEAeC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA7CD,mFAiBC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/setup-section/index.js"],"names":[],"mappings":";AAsCA,qEAeC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA7CD,mFAiBC"}
@@ -18,6 +18,8 @@ declare namespace SetupSections {
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>;