@coorpacademy/components 11.7.2 → 11.7.3-alpha.3
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.
- package/es/atom/select/index.d.ts +1 -0
- package/es/atom/select/index.d.ts.map +1 -1
- package/es/atom/select/index.js +11 -7
- package/es/atom/select/index.js.map +1 -1
- package/es/molecule/brand-form-group/index.d.ts +2 -0
- package/es/molecule/filters/index.d.ts +1 -0
- package/es/molecule/filters/index.d.ts.map +1 -1
- package/es/molecule/setup-slide/index.d.ts +1 -0
- package/es/molecule/setup-slider/index.d.ts +1 -0
- package/es/organism/brand-form/index.d.ts +2 -0
- package/es/organism/wizard-contents/index.d.ts +2 -0
- package/es/template/back-office/brand-update/index.d.ts +4 -0
- package/es/template/common/search-page/index.d.ts +1 -0
- package/lib/atom/select/index.d.ts +1 -0
- package/lib/atom/select/index.d.ts.map +1 -1
- package/lib/atom/select/index.js +11 -7
- package/lib/atom/select/index.js.map +1 -1
- package/lib/molecule/brand-form-group/index.d.ts +2 -0
- package/lib/molecule/filters/index.d.ts +1 -0
- package/lib/molecule/filters/index.d.ts.map +1 -1
- package/lib/molecule/setup-slide/index.d.ts +1 -0
- package/lib/molecule/setup-slider/index.d.ts +1 -0
- package/lib/organism/brand-form/index.d.ts +2 -0
- package/lib/organism/wizard-contents/index.d.ts +2 -0
- package/lib/template/back-office/brand-update/index.d.ts +4 -0
- package/lib/template/common/search-page/index.d.ts +1 -0
- package/package.json +2 -2
|
@@ -51,6 +51,7 @@ declare namespace Select {
|
|
|
51
51
|
modified: PropTypes.Requireable<boolean>;
|
|
52
52
|
error: PropTypes.Requireable<boolean>;
|
|
53
53
|
'aria-label': PropTypes.Requireable<string>;
|
|
54
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
54
55
|
};
|
|
55
56
|
}
|
|
56
57
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":";;;;;;;;AAoDA,qEA+KC"}
|
package/es/atom/select/index.js
CHANGED
|
@@ -35,9 +35,7 @@ const ArrowView = ({
|
|
|
35
35
|
arrowClass,
|
|
36
36
|
arrowColor
|
|
37
37
|
}) => {
|
|
38
|
-
const props = useMemo(() => _extends({},
|
|
39
|
-
'aria-label': ariaLabel
|
|
40
|
-
}, arrowColor & {
|
|
38
|
+
const props = useMemo(() => _extends({}, arrowColor & {
|
|
41
39
|
color: arrowColor
|
|
42
40
|
}, {
|
|
43
41
|
className: arrowClass
|
|
@@ -67,7 +65,8 @@ const Select = (props, legacyContext) => {
|
|
|
67
65
|
modified = false,
|
|
68
66
|
error = false,
|
|
69
67
|
title: propTitle,
|
|
70
|
-
'aria-label': ariaLabel
|
|
68
|
+
'aria-label': ariaLabel,
|
|
69
|
+
'aria-labelledby': ariaLabelledBy
|
|
71
70
|
} = props;
|
|
72
71
|
const skin = GetSkinFromContext(legacyContext);
|
|
73
72
|
const title = useMemo(() => propTitle ? `${propTitle}${required ? '*' : ''}` : null, [propTitle, required]);
|
|
@@ -134,7 +133,11 @@ const Select = (props, legacyContext) => {
|
|
|
134
133
|
ariaLabel: ariaLabel,
|
|
135
134
|
arrowClass: shouldUseSkinFontColor ? style.selectedArrow : style.arrow,
|
|
136
135
|
arrowColor: isThemeOneOfQuestionTemplateOrPlayer ? arrowColor : black
|
|
137
|
-
}), /*#__PURE__*/React.createElement("select", {
|
|
136
|
+
}), /*#__PURE__*/React.createElement("select", _extends({}, ariaLabelledBy && !ariaLabel ? {
|
|
137
|
+
'aria-labelledby': ariaLabelledBy
|
|
138
|
+
} : {}, ariaLabel && !ariaLabelledBy ? {
|
|
139
|
+
'aria-label': ariaLabel
|
|
140
|
+
} : {}, {
|
|
138
141
|
"data-name": "native-select",
|
|
139
142
|
className: style.selectBox,
|
|
140
143
|
title: selectedLabel,
|
|
@@ -150,7 +153,7 @@ const Select = (props, legacyContext) => {
|
|
|
150
153
|
,
|
|
151
154
|
onMouseLeave: handleSelectOnBlur,
|
|
152
155
|
"data-testid": "native-select"
|
|
153
|
-
}, optionList)), /*#__PURE__*/React.createElement("div", {
|
|
156
|
+
}), optionList)), /*#__PURE__*/React.createElement("div", {
|
|
154
157
|
className: style.description
|
|
155
158
|
}, description));
|
|
156
159
|
};
|
|
@@ -178,7 +181,8 @@ Select.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
178
181
|
options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),
|
|
179
182
|
modified: PropTypes.bool,
|
|
180
183
|
error: PropTypes.bool,
|
|
181
|
-
'aria-label': PropTypes.string
|
|
184
|
+
'aria-label': PropTypes.string,
|
|
185
|
+
'aria-labelledby': PropTypes.string
|
|
182
186
|
} : {};
|
|
183
187
|
export default Select;
|
|
184
188
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","useMemo","useState","PropTypes","classnames","filter","find","get","getOr","includes","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","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","skin","setIsArrowUp","handleSelectOnFocus","handleSelectOnBlur","optionList","option","index","value","selectOption","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","contextTypes","childContextTypes","propTypes","func","oneOf","arrayOf","shape"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {\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 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 optionList =\n options &&\n options.map((option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title} </span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, options)),\n [multiple, options]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, options)),\n [multiple, options]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n 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\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool,\n 'aria-label': PropTypes.string\n};\n\nexport default Select;\n"],"mappings":";;AAAA,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,IAAP,MAAiB,gBAAjB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,QAAP,MAAqB,oBAArB;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,IAAkBC,kBAAlB,QAA2C,aAA3C;AACA,OAAOC,aAAP,MAA0B,4BAA1B;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,UAAU,GAAG;EACjBhB,MAAM,EAAEe,KAAK,CAACf,MADG;EAEjBiB,OAAO,EAAEF,KAAK,CAACE,OAFE;EAGjBC,MAAM,EAAEH,KAAK,CAACG,MAHG;EAIjBC,IAAI,EAAEJ,KAAK,CAACI,IAJK;EAKjBC,QAAQ,EAAEL,KAAK,CAACK,QALC;EAMjBC,IAAI,EAAEN,KAAK,CAACM,IANK;EAOjBC,WAAW,EAAEP,KAAK,CAACO,WAPF;EAQjBC,MAAM,EAAER,KAAK,CAACQ,MARG;EASjBC,QAAQ,EAAET,KAAK,CAACS,QATC;EAUjBC,YAAY,EAAE;AAVG,CAAnB;;AAaA,MAAMC,SAAS,GAAG,CAAC;EAACC,YAAD;EAAeC,SAAf;EAA0BC,SAA1B;EAAqCC,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AACwD,YAAP,GAAsB;EACpBzC,IAAI,EAAEtC,QAAQ,CAACgF,iBAAT,CAA2B1C;AADb,CAAtB;AAIAf,MAAM,CAAC0D,SAAP,2CAAmB;EACjB7C,KAAK,EAAElD,SAAS,CAACwF,MADA;EAEjBjD,IAAI,EAAEvC,SAAS,CAACwF,MAFC;EAGjBpD,SAAS,EAAEpC,SAAS,CAACwF,MAHJ;EAIjB/C,eAAe,EAAEzC,SAAS,CAACwF,MAJV;EAKjB5C,QAAQ,EAAE5C,SAAS,CAAC4F,IALH;EAMjBjD,QAAQ,EAAE3C,SAAS,CAAC4F,IANH;EAOjB9C,WAAW,EAAE9C,SAAS,CAACwF,MAPN;EAQjB3C,QAAQ,EAAE7C,SAAS,CAAC4F,IARH;EASjBlD,QAAQ,EAAE1C,SAAS,CAACgG,IATH;EAUjBjD,KAAK,EAAE/C,SAAS,CAACiG,KAAV,CAAgB1F,IAAI,CAACW,UAAD,CAApB,CAVU;EAWjBsB,OAAO,EAAExC,SAAS,CAACkG,OAAV,CAAkBlG,SAAS,CAACmG,KAAV,CAAgBZ,qBAAhB,CAAlB,CAXQ;EAYjBvC,QAAQ,EAAEhD,SAAS,CAAC4F,IAZH;EAajB3C,KAAK,EAAEjD,SAAS,CAAC4F,IAbA;EAcjB,cAAc5F,SAAS,CAACwF;AAdP,CAAnB;AAiBA,eAAenD,MAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","useMemo","useState","PropTypes","classnames","filter","find","get","getOr","includes","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","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","ariaLabelledBy","skin","setIsArrowUp","handleSelectOnFocus","handleSelectOnBlur","optionList","option","index","value","selectOption","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","contextTypes","childContextTypes","propTypes","func","oneOf","arrayOf","shape"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {\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 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 optionList =\n options &&\n options.map((option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title} </span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, options)),\n [multiple, options]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, options)),\n [multiple, options]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n 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 && !ariaLabel ? {'aria-labelledby': ariaLabelledBy} : {})}\n {...(ariaLabel && !ariaLabelledBy ? {'aria-label': ariaLabel} : {})}\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\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool,\n 'aria-label': PropTypes.string,\n 'aria-labelledby': 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,IAAP,MAAiB,gBAAjB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,QAAP,MAAqB,oBAArB;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,IAAkBC,kBAAlB,QAA2C,aAA3C;AACA,OAAOC,aAAP,MAA0B,4BAA1B;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,UAAU,GAAG;EACjBhB,MAAM,EAAEe,KAAK,CAACf,MADG;EAEjBiB,OAAO,EAAEF,KAAK,CAACE,OAFE;EAGjBC,MAAM,EAAEH,KAAK,CAACG,MAHG;EAIjBC,IAAI,EAAEJ,KAAK,CAACI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,KAAK,EAAEjD,SAAS,CAAC6F,IAbA;EAcjB,cAAc7F,SAAS,CAACyF,MAdP;EAejB,mBAAmBzF,SAAS,CAACyF;AAfZ,CAAnB;AAkBA,eAAepD,MAAf"}
|
|
@@ -99,6 +99,7 @@ declare namespace BrandFormGroup {
|
|
|
99
99
|
modified: PropTypes.Requireable<boolean>;
|
|
100
100
|
error: PropTypes.Requireable<boolean>;
|
|
101
101
|
'aria-label': PropTypes.Requireable<string>;
|
|
102
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
102
103
|
}> | PropTypes.InferProps<{
|
|
103
104
|
type: PropTypes.Requireable<string>;
|
|
104
105
|
title: PropTypes.Validator<string>;
|
|
@@ -203,6 +204,7 @@ declare namespace BrandFormGroup {
|
|
|
203
204
|
modified: PropTypes.Requireable<boolean>;
|
|
204
205
|
error: PropTypes.Requireable<boolean>;
|
|
205
206
|
'aria-label': PropTypes.Requireable<string>;
|
|
207
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
206
208
|
}> | PropTypes.InferProps<{
|
|
207
209
|
type: PropTypes.Requireable<string>;
|
|
208
210
|
title: PropTypes.Validator<string>;
|
|
@@ -31,6 +31,7 @@ declare class Filters extends React.Component<any, any, any> {
|
|
|
31
31
|
modified: PropTypes.Requireable<boolean>;
|
|
32
32
|
error: PropTypes.Requireable<boolean>;
|
|
33
33
|
'aria-label': PropTypes.Requireable<string>;
|
|
34
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
34
35
|
}>>;
|
|
35
36
|
onSearch: PropTypes.Requireable<(...args: any[]) => any>;
|
|
36
37
|
onToggleFilters: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/filters/index.js"],"names":[],"mappings":";AASA;IACE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/filters/index.js"],"names":[],"mappings":";AASA;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAcE;IAEF;;;;;;;;;;;;;;;;;;;;;;MAEE;IAEF,wBASC;IAPC;;;MAGC;IAMH,yBAcC;IAED,uBAYC;IAED,qBAOC;IAED,sBAsFC;CACF"}
|
|
@@ -57,6 +57,7 @@ declare namespace SetupSlide {
|
|
|
57
57
|
modified: PropTypes.Requireable<boolean>;
|
|
58
58
|
error: PropTypes.Requireable<boolean>;
|
|
59
59
|
'aria-label': PropTypes.Requireable<string>;
|
|
60
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
60
61
|
}> | PropTypes.InferProps<{
|
|
61
62
|
type: PropTypes.Requireable<string>;
|
|
62
63
|
title: PropTypes.Validator<string>;
|
|
@@ -70,6 +70,7 @@ declare namespace SetupSlider {
|
|
|
70
70
|
modified: PropTypes.Requireable<boolean>;
|
|
71
71
|
error: PropTypes.Requireable<boolean>;
|
|
72
72
|
'aria-label': PropTypes.Requireable<string>;
|
|
73
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
73
74
|
}> | PropTypes.InferProps<{
|
|
74
75
|
type: PropTypes.Requireable<string>;
|
|
75
76
|
title: PropTypes.Validator<string>;
|
|
@@ -129,6 +129,7 @@ declare namespace BrandForm {
|
|
|
129
129
|
modified: PropTypes.Requireable<boolean>;
|
|
130
130
|
error: PropTypes.Requireable<boolean>;
|
|
131
131
|
'aria-label': PropTypes.Requireable<string>;
|
|
132
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
132
133
|
}> | PropTypes.InferProps<{
|
|
133
134
|
type: PropTypes.Requireable<string>;
|
|
134
135
|
title: PropTypes.Validator<string>;
|
|
@@ -233,6 +234,7 @@ declare namespace BrandForm {
|
|
|
233
234
|
modified: PropTypes.Requireable<boolean>;
|
|
234
235
|
error: PropTypes.Requireable<boolean>;
|
|
235
236
|
'aria-label': PropTypes.Requireable<string>;
|
|
237
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
236
238
|
}> | PropTypes.InferProps<{
|
|
237
239
|
type: PropTypes.Requireable<string>;
|
|
238
240
|
title: PropTypes.Validator<string>;
|
|
@@ -146,6 +146,7 @@ declare namespace WizardContents {
|
|
|
146
146
|
modified: PropTypes.Requireable<boolean>;
|
|
147
147
|
error: PropTypes.Requireable<boolean>;
|
|
148
148
|
'aria-label': PropTypes.Requireable<string>;
|
|
149
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
149
150
|
}> | PropTypes.InferProps<{
|
|
150
151
|
type: PropTypes.Requireable<string>;
|
|
151
152
|
title: PropTypes.Validator<string>;
|
|
@@ -250,6 +251,7 @@ declare namespace WizardContents {
|
|
|
250
251
|
modified: PropTypes.Requireable<boolean>;
|
|
251
252
|
error: PropTypes.Requireable<boolean>;
|
|
252
253
|
'aria-label': PropTypes.Requireable<string>;
|
|
254
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
253
255
|
}> | PropTypes.InferProps<{
|
|
254
256
|
type: PropTypes.Requireable<string>;
|
|
255
257
|
title: PropTypes.Validator<string>;
|
|
@@ -231,6 +231,7 @@ declare namespace BrandUpdate {
|
|
|
231
231
|
modified: PropTypes.Requireable<boolean>;
|
|
232
232
|
error: PropTypes.Requireable<boolean>;
|
|
233
233
|
'aria-label': PropTypes.Requireable<string>;
|
|
234
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
234
235
|
}> | PropTypes.InferProps<{
|
|
235
236
|
type: PropTypes.Requireable<string>;
|
|
236
237
|
title: PropTypes.Validator<string>;
|
|
@@ -335,6 +336,7 @@ declare namespace BrandUpdate {
|
|
|
335
336
|
modified: PropTypes.Requireable<boolean>;
|
|
336
337
|
error: PropTypes.Requireable<boolean>;
|
|
337
338
|
'aria-label': PropTypes.Requireable<string>;
|
|
339
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
338
340
|
}> | PropTypes.InferProps<{
|
|
339
341
|
type: PropTypes.Requireable<string>;
|
|
340
342
|
title: PropTypes.Validator<string>;
|
|
@@ -854,6 +856,7 @@ declare namespace BrandUpdate {
|
|
|
854
856
|
modified: PropTypes.Requireable<boolean>;
|
|
855
857
|
error: PropTypes.Requireable<boolean>;
|
|
856
858
|
'aria-label': PropTypes.Requireable<string>;
|
|
859
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
857
860
|
}> | PropTypes.InferProps<{
|
|
858
861
|
type: PropTypes.Requireable<string>;
|
|
859
862
|
title: PropTypes.Validator<string>;
|
|
@@ -958,6 +961,7 @@ declare namespace BrandUpdate {
|
|
|
958
961
|
modified: PropTypes.Requireable<boolean>;
|
|
959
962
|
error: PropTypes.Requireable<boolean>;
|
|
960
963
|
'aria-label': PropTypes.Requireable<string>;
|
|
964
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
961
965
|
}> | PropTypes.InferProps<{
|
|
962
966
|
type: PropTypes.Requireable<string>;
|
|
963
967
|
title: PropTypes.Validator<string>;
|
|
@@ -58,6 +58,7 @@ declare namespace SearchPage {
|
|
|
58
58
|
modified: PropTypes.Requireable<boolean>;
|
|
59
59
|
error: PropTypes.Requireable<boolean>;
|
|
60
60
|
'aria-label': PropTypes.Requireable<string>;
|
|
61
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
61
62
|
}>>;
|
|
62
63
|
onSearch: PropTypes.Requireable<(...args: any[]) => any>;
|
|
63
64
|
onToggleFilters: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -51,6 +51,7 @@ declare namespace Select {
|
|
|
51
51
|
modified: PropTypes.Requireable<boolean>;
|
|
52
52
|
error: PropTypes.Requireable<boolean>;
|
|
53
53
|
'aria-label': PropTypes.Requireable<string>;
|
|
54
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
54
55
|
};
|
|
55
56
|
}
|
|
56
57
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":";;;;;;;;AAoDA,qEA+KC"}
|
package/lib/atom/select/index.js
CHANGED
|
@@ -61,9 +61,7 @@ const ArrowView = ({
|
|
|
61
61
|
arrowClass,
|
|
62
62
|
arrowColor
|
|
63
63
|
}) => {
|
|
64
|
-
const props = (0, _react.useMemo)(() => _extends({},
|
|
65
|
-
'aria-label': ariaLabel
|
|
66
|
-
}, arrowColor & {
|
|
64
|
+
const props = (0, _react.useMemo)(() => _extends({}, arrowColor & {
|
|
67
65
|
color: arrowColor
|
|
68
66
|
}, {
|
|
69
67
|
className: arrowClass
|
|
@@ -93,7 +91,8 @@ const Select = (props, legacyContext) => {
|
|
|
93
91
|
modified = false,
|
|
94
92
|
error = false,
|
|
95
93
|
title: propTitle,
|
|
96
|
-
'aria-label': ariaLabel
|
|
94
|
+
'aria-label': ariaLabel,
|
|
95
|
+
'aria-labelledby': ariaLabelledBy
|
|
97
96
|
} = props;
|
|
98
97
|
const skin = (0, _provider.GetSkinFromContext)(legacyContext);
|
|
99
98
|
const title = (0, _react.useMemo)(() => propTitle ? `${propTitle}${required ? '*' : ''}` : null, [propTitle, required]);
|
|
@@ -160,7 +159,11 @@ const Select = (props, legacyContext) => {
|
|
|
160
159
|
ariaLabel: ariaLabel,
|
|
161
160
|
arrowClass: shouldUseSkinFontColor ? _style.default.selectedArrow : _style.default.arrow,
|
|
162
161
|
arrowColor: isThemeOneOfQuestionTemplateOrPlayer ? arrowColor : black
|
|
163
|
-
}), /*#__PURE__*/_react.default.createElement("select", {
|
|
162
|
+
}), /*#__PURE__*/_react.default.createElement("select", _extends({}, ariaLabelledBy && !ariaLabel ? {
|
|
163
|
+
'aria-labelledby': ariaLabelledBy
|
|
164
|
+
} : {}, ariaLabel && !ariaLabelledBy ? {
|
|
165
|
+
'aria-label': ariaLabel
|
|
166
|
+
} : {}, {
|
|
164
167
|
"data-name": "native-select",
|
|
165
168
|
className: _style.default.selectBox,
|
|
166
169
|
title: selectedLabel,
|
|
@@ -176,7 +179,7 @@ const Select = (props, legacyContext) => {
|
|
|
176
179
|
,
|
|
177
180
|
onMouseLeave: handleSelectOnBlur,
|
|
178
181
|
"data-testid": "native-select"
|
|
179
|
-
}, optionList)), /*#__PURE__*/_react.default.createElement("div", {
|
|
182
|
+
}), optionList)), /*#__PURE__*/_react.default.createElement("div", {
|
|
180
183
|
className: _style.default.description
|
|
181
184
|
}, description));
|
|
182
185
|
};
|
|
@@ -205,7 +208,8 @@ Select.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
205
208
|
options: _propTypes.default.arrayOf(_propTypes.default.shape(SelectOptionPropTypes)),
|
|
206
209
|
modified: _propTypes.default.bool,
|
|
207
210
|
error: _propTypes.default.bool,
|
|
208
|
-
'aria-label': _propTypes.default.string
|
|
211
|
+
'aria-label': _propTypes.default.string,
|
|
212
|
+
'aria-labelledby': _propTypes.default.string
|
|
209
213
|
} : {};
|
|
210
214
|
var _default = Select;
|
|
211
215
|
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","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","skin","GetSkinFromContext","setIsArrowUp","useState","handleSelectOnFocus","useCallback","handleSelectOnBlur","optionList","map","option","index","value","selectOption","titleView","selected","get","find","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","contextTypes","Provider","childContextTypes","propTypes","func","oneOf","keys","arrayOf","shape"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {\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 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 optionList =\n options &&\n options.map((option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title} </span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, options)),\n [multiple, options]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, options)),\n [multiple, options]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n 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\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool,\n 'aria-label': PropTypes.string\n};\n\nexport default Select;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;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,EAAEP,cAAA,CAAMO,MARG;EASjBC,QAAQ,EAAER,cAAA,CAAMQ,QATC;EAUjBC,YAAY,EAAE;AAVG,CAAnB;;AAaA,MAAMC,SAAS,GAAG,CAAC;EAACC,YAAD;EAAeC,SAAf;EAA0BC,SAA1B;EAAqCC,UAArC;EAAiDC;AAAjD,CAAD,KAAkE;EAClF,MAAMC,KAAK,GAAG,IAAAC,cAAA,EACZ,mBACMJ,SAAS,GACX;IACE,cAAcA;EADhB,CAFJ,EAKME,UAAU,GACZ;IACEG,KAAK,EAAEH;EADT,CANJ;IASEI,SAAS,EAAEL;EATb,EADY,EAYZ,CAACD,SAAD,EAAYC,UAAZ,EAAwBC,UAAxB,CAZY,CAAd;;EAcA,IAAIJ,YAAJ,EAAkB;IAChB,OAAOC,SAAS,gBACd,6BAAC,4CAAD,eAAaI,KAAb;MAAoB,eAAY;IAAhC,GADc,gBAGd,6BAAC,6CAAD,eAAeA,KAAf;MAAsB,eAAY;IAAlC,GAHF;EAKD,CAND,MAMO,OAAO,IAAP;AACR,CAtBD;;AAwBA,MAAMI,MAAM,GAAG,CAACJ,KAAD,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,EAAE0D,kBAAA,CAAUC,MAJV;EAKjBxD,QAAQ,EAAEuD,kBAAA,CAAUK,IALH;EAMjB7D,QAAQ,EAAEwD,kBAAA,CAAUK,IANH;EAOjB1D,WAAW,EAAEqD,kBAAA,CAAUC,MAPN;EAQjBvD,QAAQ,EAAEsD,kBAAA,CAAUK,IARH;EASjB9D,QAAQ,EAAEyD,kBAAA,CAAUU,IATH;EAUjB9D,KAAK,EAAEoD,kBAAA,CAAUW,KAAV,CAAgB,IAAAC,aAAA,EAAKhG,UAAL,CAAhB,CAVU;EAWjByB,OAAO,EAAE2D,kBAAA,CAAUa,OAAV,CAAkBb,kBAAA,CAAUc,KAAV,CAAgBf,qBAAhB,CAAlB,CAXQ;EAYjBlD,QAAQ,EAAEmD,kBAAA,CAAUK,IAZH;EAajBvD,KAAK,EAAEkD,kBAAA,CAAUK,IAbA;EAcjB,cAAcL,kBAAA,CAAUC;AAdP,CAAnB;eAiBe/D,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","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","ariaLabelledBy","skin","GetSkinFromContext","setIsArrowUp","useState","handleSelectOnFocus","useCallback","handleSelectOnBlur","optionList","map","option","index","value","selectOption","titleView","selected","get","find","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","contextTypes","Provider","childContextTypes","propTypes","func","oneOf","keys","arrayOf","shape"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {\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 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 optionList =\n options &&\n options.map((option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title} </span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, options)),\n [multiple, options]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, options)),\n [multiple, options]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n 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 && !ariaLabel ? {'aria-labelledby': ariaLabelledBy} : {})}\n {...(ariaLabel && !ariaLabelledBy ? {'aria-label': ariaLabel} : {})}\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\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool,\n 'aria-label': PropTypes.string,\n 'aria-labelledby': PropTypes.string\n};\n\nexport default Select;\n"],"mappings":";;;;;AAAA;;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,EAAEP,cAAA,CAAMO,MARG;EASjBC,QAAQ,EAAER,cAAA,CAAMQ,QATC;EAUjBC,YAAY,EAAE;AAVG,CAAnB;;AAaA,MAAMC,SAAS,GAAG,CAAC;EAACC,YAAD;EAAeC,SAAf;EAA0BC,SAA1B;EAAqCC,UAArC;EAAiDC;AAAjD,CAAD,KAAkE;EAClF,MAAMC,KAAK,GAAG,IAAAC,cAAA,EACZ,mBACMF,UAAU,GACZ;IACEG,KAAK,EAAEH;EADT,CAFJ;IAKEI,SAAS,EAAEL;EALb,EADY,EAQZ,CAACD,SAAD,EAAYC,UAAZ,EAAwBC,UAAxB,CARY,CAAd;;EAUA,IAAIJ,YAAJ,EAAkB;IAChB,OAAOC,SAAS,gBACd,6BAAC,4CAAD,eAAaI,KAAb;MAAoB,eAAY;IAAhC,GADc,gBAGd,6BAAC,6CAAD,eAAeA,KAAf;MAAsB,eAAY;IAAlC,GAHF;EAKD,CAND,MAMO,OAAO,IAAP;AACR,CAlBD;;AAoBA,MAAMI,MAAM,GAAG,CAACJ,KAAD,EAAQK,aAAR,KAA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,MAAM,CAACwE,SAAP,2CAAmB;EACjB3D,KAAK,EAAEkD,kBAAA,CAAUC,MADA;EAEjB9D,IAAI,EAAE6D,kBAAA,CAAUC,MAFC;EAGjBjE,SAAS,EAAEgE,kBAAA,CAAUC,MAHJ;EAIjB5D,eAAe,EAAE2D,kBAAA,CAAUC,MAJV;EAKjBzD,QAAQ,EAAEwD,kBAAA,CAAUK,IALH;EAMjB9D,QAAQ,EAAEyD,kBAAA,CAAUK,IANH;EAOjB3D,WAAW,EAAEsD,kBAAA,CAAUC,MAPN;EAQjBxD,QAAQ,EAAEuD,kBAAA,CAAUK,IARH;EASjB/D,QAAQ,EAAE0D,kBAAA,CAAUU,IATH;EAUjB/D,KAAK,EAAEqD,kBAAA,CAAUW,KAAV,CAAgB,IAAAC,aAAA,EAAKjG,UAAL,CAAhB,CAVU;EAWjByB,OAAO,EAAE4D,kBAAA,CAAUa,OAAV,CAAkBb,kBAAA,CAAUc,KAAV,CAAgBf,qBAAhB,CAAlB,CAXQ;EAYjBnD,QAAQ,EAAEoD,kBAAA,CAAUK,IAZH;EAajBxD,KAAK,EAAEmD,kBAAA,CAAUK,IAbA;EAcjB,cAAcL,kBAAA,CAAUC,MAdP;EAejB,mBAAmBD,kBAAA,CAAUC;AAfZ,CAAnB;eAkBehE,M"}
|
|
@@ -99,6 +99,7 @@ declare namespace BrandFormGroup {
|
|
|
99
99
|
modified: PropTypes.Requireable<boolean>;
|
|
100
100
|
error: PropTypes.Requireable<boolean>;
|
|
101
101
|
'aria-label': PropTypes.Requireable<string>;
|
|
102
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
102
103
|
}> | PropTypes.InferProps<{
|
|
103
104
|
type: PropTypes.Requireable<string>;
|
|
104
105
|
title: PropTypes.Validator<string>;
|
|
@@ -203,6 +204,7 @@ declare namespace BrandFormGroup {
|
|
|
203
204
|
modified: PropTypes.Requireable<boolean>;
|
|
204
205
|
error: PropTypes.Requireable<boolean>;
|
|
205
206
|
'aria-label': PropTypes.Requireable<string>;
|
|
207
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
206
208
|
}> | PropTypes.InferProps<{
|
|
207
209
|
type: PropTypes.Requireable<string>;
|
|
208
210
|
title: PropTypes.Validator<string>;
|
|
@@ -31,6 +31,7 @@ declare class Filters extends React.Component<any, any, any> {
|
|
|
31
31
|
modified: PropTypes.Requireable<boolean>;
|
|
32
32
|
error: PropTypes.Requireable<boolean>;
|
|
33
33
|
'aria-label': PropTypes.Requireable<string>;
|
|
34
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
34
35
|
}>>;
|
|
35
36
|
onSearch: PropTypes.Requireable<(...args: any[]) => any>;
|
|
36
37
|
onToggleFilters: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/filters/index.js"],"names":[],"mappings":";AASA;IACE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/filters/index.js"],"names":[],"mappings":";AASA;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAcE;IAEF;;;;;;;;;;;;;;;;;;;;;;MAEE;IAEF,wBASC;IAPC;;;MAGC;IAMH,yBAcC;IAED,uBAYC;IAED,qBAOC;IAED,sBAsFC;CACF"}
|
|
@@ -57,6 +57,7 @@ declare namespace SetupSlide {
|
|
|
57
57
|
modified: PropTypes.Requireable<boolean>;
|
|
58
58
|
error: PropTypes.Requireable<boolean>;
|
|
59
59
|
'aria-label': PropTypes.Requireable<string>;
|
|
60
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
60
61
|
}> | PropTypes.InferProps<{
|
|
61
62
|
type: PropTypes.Requireable<string>;
|
|
62
63
|
title: PropTypes.Validator<string>;
|
|
@@ -70,6 +70,7 @@ declare namespace SetupSlider {
|
|
|
70
70
|
modified: PropTypes.Requireable<boolean>;
|
|
71
71
|
error: PropTypes.Requireable<boolean>;
|
|
72
72
|
'aria-label': PropTypes.Requireable<string>;
|
|
73
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
73
74
|
}> | PropTypes.InferProps<{
|
|
74
75
|
type: PropTypes.Requireable<string>;
|
|
75
76
|
title: PropTypes.Validator<string>;
|
|
@@ -129,6 +129,7 @@ declare namespace BrandForm {
|
|
|
129
129
|
modified: PropTypes.Requireable<boolean>;
|
|
130
130
|
error: PropTypes.Requireable<boolean>;
|
|
131
131
|
'aria-label': PropTypes.Requireable<string>;
|
|
132
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
132
133
|
}> | PropTypes.InferProps<{
|
|
133
134
|
type: PropTypes.Requireable<string>;
|
|
134
135
|
title: PropTypes.Validator<string>;
|
|
@@ -233,6 +234,7 @@ declare namespace BrandForm {
|
|
|
233
234
|
modified: PropTypes.Requireable<boolean>;
|
|
234
235
|
error: PropTypes.Requireable<boolean>;
|
|
235
236
|
'aria-label': PropTypes.Requireable<string>;
|
|
237
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
236
238
|
}> | PropTypes.InferProps<{
|
|
237
239
|
type: PropTypes.Requireable<string>;
|
|
238
240
|
title: PropTypes.Validator<string>;
|
|
@@ -146,6 +146,7 @@ declare namespace WizardContents {
|
|
|
146
146
|
modified: PropTypes.Requireable<boolean>;
|
|
147
147
|
error: PropTypes.Requireable<boolean>;
|
|
148
148
|
'aria-label': PropTypes.Requireable<string>;
|
|
149
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
149
150
|
}> | PropTypes.InferProps<{
|
|
150
151
|
type: PropTypes.Requireable<string>;
|
|
151
152
|
title: PropTypes.Validator<string>;
|
|
@@ -250,6 +251,7 @@ declare namespace WizardContents {
|
|
|
250
251
|
modified: PropTypes.Requireable<boolean>;
|
|
251
252
|
error: PropTypes.Requireable<boolean>;
|
|
252
253
|
'aria-label': PropTypes.Requireable<string>;
|
|
254
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
253
255
|
}> | PropTypes.InferProps<{
|
|
254
256
|
type: PropTypes.Requireable<string>;
|
|
255
257
|
title: PropTypes.Validator<string>;
|
|
@@ -231,6 +231,7 @@ declare namespace BrandUpdate {
|
|
|
231
231
|
modified: PropTypes.Requireable<boolean>;
|
|
232
232
|
error: PropTypes.Requireable<boolean>;
|
|
233
233
|
'aria-label': PropTypes.Requireable<string>;
|
|
234
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
234
235
|
}> | PropTypes.InferProps<{
|
|
235
236
|
type: PropTypes.Requireable<string>;
|
|
236
237
|
title: PropTypes.Validator<string>;
|
|
@@ -335,6 +336,7 @@ declare namespace BrandUpdate {
|
|
|
335
336
|
modified: PropTypes.Requireable<boolean>;
|
|
336
337
|
error: PropTypes.Requireable<boolean>;
|
|
337
338
|
'aria-label': PropTypes.Requireable<string>;
|
|
339
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
338
340
|
}> | PropTypes.InferProps<{
|
|
339
341
|
type: PropTypes.Requireable<string>;
|
|
340
342
|
title: PropTypes.Validator<string>;
|
|
@@ -854,6 +856,7 @@ declare namespace BrandUpdate {
|
|
|
854
856
|
modified: PropTypes.Requireable<boolean>;
|
|
855
857
|
error: PropTypes.Requireable<boolean>;
|
|
856
858
|
'aria-label': PropTypes.Requireable<string>;
|
|
859
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
857
860
|
}> | PropTypes.InferProps<{
|
|
858
861
|
type: PropTypes.Requireable<string>;
|
|
859
862
|
title: PropTypes.Validator<string>;
|
|
@@ -958,6 +961,7 @@ declare namespace BrandUpdate {
|
|
|
958
961
|
modified: PropTypes.Requireable<boolean>;
|
|
959
962
|
error: PropTypes.Requireable<boolean>;
|
|
960
963
|
'aria-label': PropTypes.Requireable<string>;
|
|
964
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
961
965
|
}> | PropTypes.InferProps<{
|
|
962
966
|
type: PropTypes.Requireable<string>;
|
|
963
967
|
title: PropTypes.Validator<string>;
|
|
@@ -58,6 +58,7 @@ declare namespace SearchPage {
|
|
|
58
58
|
modified: PropTypes.Requireable<boolean>;
|
|
59
59
|
error: PropTypes.Requireable<boolean>;
|
|
60
60
|
'aria-label': PropTypes.Requireable<string>;
|
|
61
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
61
62
|
}>>;
|
|
62
63
|
onSearch: PropTypes.Requireable<(...args: any[]) => any>;
|
|
63
64
|
onToggleFilters: PropTypes.Requireable<(...args: any[]) => any>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/components",
|
|
3
|
-
"version": "11.7.
|
|
3
|
+
"version": "11.7.3-alpha.3+c58e63a2a",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -160,5 +160,5 @@
|
|
|
160
160
|
"last 2 versions",
|
|
161
161
|
"IE 11"
|
|
162
162
|
],
|
|
163
|
-
"gitHead": "
|
|
163
|
+
"gitHead": "c58e63a2afed8d3cd5185fd56702b6265354d1fb"
|
|
164
164
|
}
|