@coorpacademy/components 11.6.1 → 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 +55 -14
- package/es/atom/select/index.js.map +1 -1
- package/es/molecule/answer/index.d.ts.map +1 -1
- package/es/molecule/answer/index.js +1 -9
- package/es/molecule/answer/index.js.map +1 -1
- package/es/molecule/brand-form-group/index.d.ts +2 -0
- package/es/molecule/empty-state-dashboard/index.d.ts +23 -0
- package/es/molecule/empty-state-dashboard/index.d.ts.map +1 -0
- package/es/molecule/empty-state-dashboard/index.js +31 -0
- package/es/molecule/empty-state-dashboard/index.js.map +1 -0
- package/es/molecule/empty-state-dashboard/style.css +55 -0
- package/es/molecule/empty-state-dashboard/types.d.ts +19 -0
- package/es/molecule/empty-state-dashboard/types.d.ts.map +1 -0
- package/es/molecule/empty-state-dashboard/types.js +19 -0
- package/es/molecule/empty-state-dashboard/types.js.map +1 -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/list-item/index.d.ts +8 -6
- package/es/organism/list-item/index.d.ts.map +1 -1
- package/es/organism/list-item/index.js +16 -2
- package/es/organism/list-item/index.js.map +1 -1
- package/es/organism/list-item/style.css +18 -0
- package/es/organism/list-items/index.d.ts +2 -0
- package/es/organism/list-items/index.js +5 -1
- package/es/organism/list-items/index.js.map +1 -1
- package/es/organism/wizard-contents/index.d.ts +2 -0
- package/es/template/activity/index.d.ts +36 -40
- package/es/template/activity/index.d.ts.map +1 -1
- package/es/template/activity/index.js +89 -111
- package/es/template/activity/index.js.map +1 -1
- package/es/template/activity/stars-summary.d.ts +9 -18
- package/es/template/activity/stars-summary.d.ts.map +1 -1
- package/es/template/activity/stars-summary.js +94 -122
- package/es/template/activity/stars-summary.js.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +24 -0
- package/es/template/back-office/brand-update/index.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.js +12 -3
- package/es/template/back-office/brand-update/index.js.map +1 -1
- package/es/template/back-office/brand-update/style.css +5 -1
- package/es/template/common/search-page/index.d.ts +1 -0
- package/es/util/button-icons.d.ts +1 -0
- package/es/util/button-icons.d.ts.map +1 -1
- package/es/util/button-icons.js +3 -2
- package/es/util/button-icons.js.map +1 -1
- 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 +53 -12
- package/lib/atom/select/index.js.map +1 -1
- package/lib/molecule/answer/index.d.ts.map +1 -1
- package/lib/molecule/answer/index.js +1 -10
- package/lib/molecule/answer/index.js.map +1 -1
- package/lib/molecule/brand-form-group/index.d.ts +2 -0
- package/lib/molecule/empty-state-dashboard/index.d.ts +23 -0
- package/lib/molecule/empty-state-dashboard/index.d.ts.map +1 -0
- package/lib/molecule/empty-state-dashboard/index.js +42 -0
- package/lib/molecule/empty-state-dashboard/index.js.map +1 -0
- package/lib/molecule/empty-state-dashboard/style.css +55 -0
- package/lib/molecule/empty-state-dashboard/types.d.ts +19 -0
- package/lib/molecule/empty-state-dashboard/types.d.ts.map +1 -0
- package/lib/molecule/empty-state-dashboard/types.js +29 -0
- package/lib/molecule/empty-state-dashboard/types.js.map +1 -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/list-item/index.d.ts +8 -6
- package/lib/organism/list-item/index.d.ts.map +1 -1
- package/lib/organism/list-item/index.js +16 -2
- package/lib/organism/list-item/index.js.map +1 -1
- package/lib/organism/list-item/style.css +18 -0
- package/lib/organism/list-items/index.d.ts +2 -0
- package/lib/organism/list-items/index.js +5 -1
- package/lib/organism/list-items/index.js.map +1 -1
- package/lib/organism/wizard-contents/index.d.ts +2 -0
- package/lib/template/activity/index.d.ts +36 -40
- package/lib/template/activity/index.d.ts.map +1 -1
- package/lib/template/activity/index.js +95 -110
- package/lib/template/activity/index.js.map +1 -1
- package/lib/template/activity/stars-summary.d.ts +9 -18
- package/lib/template/activity/stars-summary.d.ts.map +1 -1
- package/lib/template/activity/stars-summary.js +90 -119
- package/lib/template/activity/stars-summary.js.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +24 -0
- package/lib/template/back-office/brand-update/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.js +13 -3
- package/lib/template/back-office/brand-update/index.js.map +1 -1
- package/lib/template/back-office/brand-update/style.css +5 -1
- package/lib/template/common/search-page/index.d.ts +1 -0
- package/lib/util/button-icons.d.ts +1 -0
- package/lib/util/button-icons.d.ts.map +1 -1
- package/lib/util/button-icons.js +2 -1
- package/lib/util/button-icons.js.map +1 -1
- package/locales/bs/global.json +8 -1
- package/locales/cs/global.json +8 -1
- package/locales/de/global.json +8 -1
- package/locales/en/global.json +0 -1
- package/locales/es/global.json +8 -1
- package/locales/et/global.json +8 -1
- package/locales/fr/global.json +0 -1
- package/locales/hr/global.json +8 -1
- package/locales/hu/global.json +8 -1
- package/locales/hy/global.json +0 -1
- package/locales/it/global.json +8 -1
- package/locales/ja/global.json +8 -1
- package/locales/ko/global.json +8 -1
- package/locales/nl/global.json +8 -1
- package/locales/pl/global.json +8 -1
- package/locales/pt/global.json +8 -1
- package/locales/ro/global.json +8 -1
- package/locales/ru/global.json +0 -1
- package/locales/sk/global.json +8 -1
- package/locales/tl/global.json +8 -1
- package/locales/tr/global.json +8 -1
- package/locales/uk/global.json +8 -1
- package/locales/vi/global.json +8 -1
- package/locales/zh/global.json +8 -1
- package/locales/zh_TW/global.json +8 -1
- package/package.json +2 -2
- package/locales/.mtslconfig.json +0 -1
package/es/util/button-icons.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NovaSolidRemoveAddAddCircle1 as AddIcon, NovaCompositionCoorpacademyAnalytics as AnalyticsIcon, NovaSolidContentEditionBin as BinIcon, NovaCompositionCoorpacademyBulletPoint as BulletPointIcon, NovaCompositionNavigationArrowLeft as ChevronLeftIcon, NovaCompositionNavigationArrowRight as ChevronRightIcon, NovaSolidStatusClose as CloseIcon, NovaSolidContentEditionPencilWrite as EditIcon, NovaCompositionCoorpacademyEye as EyeIcon, NovaSolidContentContentViewModule1 as ListIcon, NovaSolidLoginLogout1 as LogoutIcon, NovaSolidApplicationsWindowUpload3 as PublishIcon, NovaSolidComputersSdCard as SaveIcon, NovaLineLoginKey1 as KlfIcon, NovaSolidFilesFoldersFolders as FoldersIcon } from '@coorpacademy/nova-icons';
|
|
1
|
+
import { NovaSolidRemoveAddAddCircle1 as AddIcon, NovaCompositionCoorpacademyAnalytics as AnalyticsIcon, NovaSolidContentEditionBin as BinIcon, NovaCompositionCoorpacademyBulletPoint as BulletPointIcon, NovaCompositionNavigationArrowLeft as ChevronLeftIcon, NovaCompositionNavigationArrowRight as ChevronRightIcon, NovaSolidStatusClose as CloseIcon, NovaSolidContentEditionPencilWrite as EditIcon, NovaCompositionCoorpacademyEye as EyeIcon, NovaSolidContentContentViewModule1 as ListIcon, NovaSolidLoginLogout1 as LogoutIcon, NovaSolidApplicationsWindowUpload3 as PublishIcon, NovaSolidComputersSdCard as SaveIcon, NovaLineLoginKey1 as KlfIcon, NovaSolidFilesFoldersFolders as FoldersIcon, NovaSolidFilesBasicFileUpload2 as UploadIcon } from '@coorpacademy/nova-icons';
|
|
2
2
|
export const ICONS = {
|
|
3
3
|
add: AddIcon,
|
|
4
4
|
analytics: AnalyticsIcon,
|
|
@@ -14,6 +14,7 @@ export const ICONS = {
|
|
|
14
14
|
publish: PublishIcon,
|
|
15
15
|
save: SaveIcon,
|
|
16
16
|
see: EyeIcon,
|
|
17
|
-
folders: FoldersIcon
|
|
17
|
+
folders: FoldersIcon,
|
|
18
|
+
upload: UploadIcon
|
|
18
19
|
};
|
|
19
20
|
//# sourceMappingURL=button-icons.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-icons.js","names":["NovaSolidRemoveAddAddCircle1","AddIcon","NovaCompositionCoorpacademyAnalytics","AnalyticsIcon","NovaSolidContentEditionBin","BinIcon","NovaCompositionCoorpacademyBulletPoint","BulletPointIcon","NovaCompositionNavigationArrowLeft","ChevronLeftIcon","NovaCompositionNavigationArrowRight","ChevronRightIcon","NovaSolidStatusClose","CloseIcon","NovaSolidContentEditionPencilWrite","EditIcon","NovaCompositionCoorpacademyEye","EyeIcon","NovaSolidContentContentViewModule1","ListIcon","NovaSolidLoginLogout1","LogoutIcon","NovaSolidApplicationsWindowUpload3","PublishIcon","NovaSolidComputersSdCard","SaveIcon","NovaLineLoginKey1","KlfIcon","NovaSolidFilesFoldersFolders","FoldersIcon","ICONS","add","analytics","bin","close","edit","key","list","logout","publish","save","see","folders"],"sources":["../../src/util/button-icons.js"],"sourcesContent":["import {\n NovaSolidRemoveAddAddCircle1 as AddIcon,\n NovaCompositionCoorpacademyAnalytics as AnalyticsIcon,\n NovaSolidContentEditionBin as BinIcon,\n NovaCompositionCoorpacademyBulletPoint as BulletPointIcon,\n NovaCompositionNavigationArrowLeft as ChevronLeftIcon,\n NovaCompositionNavigationArrowRight as ChevronRightIcon,\n NovaSolidStatusClose as CloseIcon,\n NovaSolidContentEditionPencilWrite as EditIcon,\n NovaCompositionCoorpacademyEye as EyeIcon,\n NovaSolidContentContentViewModule1 as ListIcon,\n NovaSolidLoginLogout1 as LogoutIcon,\n NovaSolidApplicationsWindowUpload3 as PublishIcon,\n NovaSolidComputersSdCard as SaveIcon,\n NovaLineLoginKey1 as KlfIcon,\n NovaSolidFilesFoldersFolders as FoldersIcon\n} from '@coorpacademy/nova-icons';\n\nexport const ICONS = {\n add: AddIcon,\n analytics: AnalyticsIcon,\n bin: BinIcon,\n 'bullet-point': BulletPointIcon,\n 'chevron-left': ChevronLeftIcon,\n 'chevron-right': ChevronRightIcon,\n close: CloseIcon,\n edit: EditIcon,\n key: KlfIcon,\n list: ListIcon,\n logout: LogoutIcon,\n publish: PublishIcon,\n save: SaveIcon,\n see: EyeIcon,\n folders: FoldersIcon\n};\n"],"mappings":"AAAA,SACEA,4BAA4B,IAAIC,OADlC,EAEEC,oCAAoC,IAAIC,aAF1C,EAGEC,0BAA0B,IAAIC,OAHhC,EAIEC,sCAAsC,IAAIC,eAJ5C,EAKEC,kCAAkC,IAAIC,eALxC,EAMEC,mCAAmC,IAAIC,gBANzC,EAOEC,oBAAoB,IAAIC,SAP1B,EAQEC,kCAAkC,IAAIC,QARxC,EASEC,8BAA8B,IAAIC,OATpC,EAUEC,kCAAkC,IAAIC,QAVxC,EAWEC,qBAAqB,IAAIC,UAX3B,EAYEC,kCAAkC,IAAIC,WAZxC,EAaEC,wBAAwB,IAAIC,QAb9B,EAcEC,iBAAiB,IAAIC,OAdvB,EAeEC,4BAA4B,IAAIC,WAflC,
|
|
1
|
+
{"version":3,"file":"button-icons.js","names":["NovaSolidRemoveAddAddCircle1","AddIcon","NovaCompositionCoorpacademyAnalytics","AnalyticsIcon","NovaSolidContentEditionBin","BinIcon","NovaCompositionCoorpacademyBulletPoint","BulletPointIcon","NovaCompositionNavigationArrowLeft","ChevronLeftIcon","NovaCompositionNavigationArrowRight","ChevronRightIcon","NovaSolidStatusClose","CloseIcon","NovaSolidContentEditionPencilWrite","EditIcon","NovaCompositionCoorpacademyEye","EyeIcon","NovaSolidContentContentViewModule1","ListIcon","NovaSolidLoginLogout1","LogoutIcon","NovaSolidApplicationsWindowUpload3","PublishIcon","NovaSolidComputersSdCard","SaveIcon","NovaLineLoginKey1","KlfIcon","NovaSolidFilesFoldersFolders","FoldersIcon","NovaSolidFilesBasicFileUpload2","UploadIcon","ICONS","add","analytics","bin","close","edit","key","list","logout","publish","save","see","folders","upload"],"sources":["../../src/util/button-icons.js"],"sourcesContent":["import {\n NovaSolidRemoveAddAddCircle1 as AddIcon,\n NovaCompositionCoorpacademyAnalytics as AnalyticsIcon,\n NovaSolidContentEditionBin as BinIcon,\n NovaCompositionCoorpacademyBulletPoint as BulletPointIcon,\n NovaCompositionNavigationArrowLeft as ChevronLeftIcon,\n NovaCompositionNavigationArrowRight as ChevronRightIcon,\n NovaSolidStatusClose as CloseIcon,\n NovaSolidContentEditionPencilWrite as EditIcon,\n NovaCompositionCoorpacademyEye as EyeIcon,\n NovaSolidContentContentViewModule1 as ListIcon,\n NovaSolidLoginLogout1 as LogoutIcon,\n NovaSolidApplicationsWindowUpload3 as PublishIcon,\n NovaSolidComputersSdCard as SaveIcon,\n NovaLineLoginKey1 as KlfIcon,\n NovaSolidFilesFoldersFolders as FoldersIcon,\n NovaSolidFilesBasicFileUpload2 as UploadIcon\n} from '@coorpacademy/nova-icons';\n\nexport const ICONS = {\n add: AddIcon,\n analytics: AnalyticsIcon,\n bin: BinIcon,\n 'bullet-point': BulletPointIcon,\n 'chevron-left': ChevronLeftIcon,\n 'chevron-right': ChevronRightIcon,\n close: CloseIcon,\n edit: EditIcon,\n key: KlfIcon,\n list: ListIcon,\n logout: LogoutIcon,\n publish: PublishIcon,\n save: SaveIcon,\n see: EyeIcon,\n folders: FoldersIcon,\n upload: UploadIcon\n};\n"],"mappings":"AAAA,SACEA,4BAA4B,IAAIC,OADlC,EAEEC,oCAAoC,IAAIC,aAF1C,EAGEC,0BAA0B,IAAIC,OAHhC,EAIEC,sCAAsC,IAAIC,eAJ5C,EAKEC,kCAAkC,IAAIC,eALxC,EAMEC,mCAAmC,IAAIC,gBANzC,EAOEC,oBAAoB,IAAIC,SAP1B,EAQEC,kCAAkC,IAAIC,QARxC,EASEC,8BAA8B,IAAIC,OATpC,EAUEC,kCAAkC,IAAIC,QAVxC,EAWEC,qBAAqB,IAAIC,UAX3B,EAYEC,kCAAkC,IAAIC,WAZxC,EAaEC,wBAAwB,IAAIC,QAb9B,EAcEC,iBAAiB,IAAIC,OAdvB,EAeEC,4BAA4B,IAAIC,WAflC,EAgBEC,8BAA8B,IAAIC,UAhBpC,QAiBO,0BAjBP;AAmBA,OAAO,MAAMC,KAAK,GAAG;EACnBC,GAAG,EAAEhC,OADc;EAEnBiC,SAAS,EAAE/B,aAFQ;EAGnBgC,GAAG,EAAE9B,OAHc;EAInB,gBAAgBE,eAJG;EAKnB,gBAAgBE,eALG;EAMnB,iBAAiBE,gBANE;EAOnByB,KAAK,EAAEvB,SAPY;EAQnBwB,IAAI,EAAEtB,QARa;EASnBuB,GAAG,EAAEX,OATc;EAUnBY,IAAI,EAAEpB,QAVa;EAWnBqB,MAAM,EAAEnB,UAXW;EAYnBoB,OAAO,EAAElB,WAZU;EAanBmB,IAAI,EAAEjB,QAba;EAcnBkB,GAAG,EAAE1B,OAdc;EAenB2B,OAAO,EAAEf,WAfU;EAgBnBgB,MAAM,EAAEd;AAhBW,CAAd"}
|
|
@@ -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
|
@@ -54,6 +54,28 @@ const themeStyle = {
|
|
|
54
54
|
coorpmanager: null
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
+
const ArrowView = ({
|
|
58
|
+
shouldRender,
|
|
59
|
+
isArrowUp,
|
|
60
|
+
ariaLabel,
|
|
61
|
+
arrowClass,
|
|
62
|
+
arrowColor
|
|
63
|
+
}) => {
|
|
64
|
+
const props = (0, _react.useMemo)(() => _extends({}, arrowColor & {
|
|
65
|
+
color: arrowColor
|
|
66
|
+
}, {
|
|
67
|
+
className: arrowClass
|
|
68
|
+
}), [ariaLabel, arrowClass, arrowColor]);
|
|
69
|
+
|
|
70
|
+
if (shouldRender) {
|
|
71
|
+
return isArrowUp ? /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionNavigationArrowTop, _extends({}, props, {
|
|
72
|
+
"data-testid": "select-arrow-up-icon"
|
|
73
|
+
})) : /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionNavigationArrowDown, _extends({}, props, {
|
|
74
|
+
"data-testid": "select-arrow-down-icon"
|
|
75
|
+
}));
|
|
76
|
+
} else return null;
|
|
77
|
+
};
|
|
78
|
+
|
|
57
79
|
const Select = (props, legacyContext) => {
|
|
58
80
|
const {
|
|
59
81
|
name,
|
|
@@ -69,10 +91,14 @@ const Select = (props, legacyContext) => {
|
|
|
69
91
|
modified = false,
|
|
70
92
|
error = false,
|
|
71
93
|
title: propTitle,
|
|
72
|
-
'aria-label': ariaLabel
|
|
94
|
+
'aria-label': ariaLabel,
|
|
95
|
+
'aria-labelledby': ariaLabelledBy
|
|
73
96
|
} = props;
|
|
74
97
|
const skin = (0, _provider.GetSkinFromContext)(legacyContext);
|
|
75
98
|
const title = (0, _react.useMemo)(() => propTitle ? `${propTitle}${required ? '*' : ''}` : null, [propTitle, required]);
|
|
99
|
+
const [isArrowUp, setIsArrowUp] = (0, _react.useState)(false);
|
|
100
|
+
const handleSelectOnFocus = (0, _react.useCallback)(() => setIsArrowUp(true), []);
|
|
101
|
+
const handleSelectOnBlur = (0, _react.useCallback)(() => setIsArrowUp(false), []);
|
|
76
102
|
const optionList = options && options.map((option, index) => {
|
|
77
103
|
return /*#__PURE__*/_react.default.createElement("option", {
|
|
78
104
|
key: index,
|
|
@@ -98,20 +124,17 @@ const Select = (props, legacyContext) => {
|
|
|
98
124
|
selected: true
|
|
99
125
|
}, options)), [options, theme]);
|
|
100
126
|
const handleChange = (0, _react.useMemo)(() => multiple ? e => {
|
|
127
|
+
setIsArrowUp(false);
|
|
101
128
|
onChange((0, _map.default)((0, _get.default)('value'), e.target.selectedOptions));
|
|
102
129
|
} : e => {
|
|
130
|
+
setIsArrowUp(false);
|
|
103
131
|
onChange(e.target.value);
|
|
104
132
|
}, [onChange, multiple]);
|
|
105
133
|
const black = (0, _react.useMemo)(() => (0, _getOr.default)('#14171A', 'common.black', skin), [skin]);
|
|
106
134
|
const color = (0, _react.useMemo)(() => (0, _getOr.default)('#00B0FF', 'common.primary', skin), [skin]);
|
|
107
|
-
const
|
|
135
|
+
const isThemeOneOfQuestionTemplateOrPlayer = (0, _react.useMemo)(() => (0, _includes.default)(theme, ['question', 'template', 'player']), [theme]);
|
|
136
|
+
const shouldUseSkinFontColor = (0, _react.useMemo)(() => !isSelectedInValidOption && selected && isThemeOneOfQuestionTemplateOrPlayer, [isSelectedInValidOption, selected, isThemeOneOfQuestionTemplateOrPlayer]);
|
|
108
137
|
const arrowColor = selected ? color : undefined;
|
|
109
|
-
const arrowView = !multiple ? /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionNavigationArrowDown, {
|
|
110
|
-
color: (0, _includes.default)(theme, ['question', 'template', 'player']) ? arrowColor : black,
|
|
111
|
-
className: shouldUseSkinFontColor ? _style.default.selectedArrow : _style.default.arrow,
|
|
112
|
-
"aria-label": ariaLabel,
|
|
113
|
-
"data-testid": "select-arrow-down-icon"
|
|
114
|
-
}) : null;
|
|
115
138
|
const behaviorClassName = (0, _react.useMemo)(() => (0, _getClassState.default)(_style.default.default, _style.default.modified, _style.default.error, modified, error), [error, modified]);
|
|
116
139
|
const composedClassName = (0, _react.useMemo)(() => (0, _classnames.default)(theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviorClassName, selected ? _style.default.selected : _style.default.unselected, className), [behaviorClassName, className, selected, theme]);
|
|
117
140
|
const labelSize = (0, _react.useMemo)(() => (0, _size.default)(selectedLabel), [selectedLabel]);
|
|
@@ -130,7 +153,17 @@ const Select = (props, legacyContext) => {
|
|
|
130
153
|
style: _extends({}, shouldUseSkinFontColor && {
|
|
131
154
|
color
|
|
132
155
|
})
|
|
133
|
-
}, selectedLabel),
|
|
156
|
+
}, selectedLabel), /*#__PURE__*/_react.default.createElement(ArrowView, {
|
|
157
|
+
shouldRender: !multiple,
|
|
158
|
+
isArrowUp: isArrowUp,
|
|
159
|
+
ariaLabel: ariaLabel,
|
|
160
|
+
arrowClass: shouldUseSkinFontColor ? _style.default.selectedArrow : _style.default.arrow,
|
|
161
|
+
arrowColor: isThemeOneOfQuestionTemplateOrPlayer ? arrowColor : black
|
|
162
|
+
}), /*#__PURE__*/_react.default.createElement("select", _extends({}, ariaLabelledBy && !ariaLabel ? {
|
|
163
|
+
'aria-labelledby': ariaLabelledBy
|
|
164
|
+
} : {}, ariaLabel && !ariaLabelledBy ? {
|
|
165
|
+
'aria-label': ariaLabel
|
|
166
|
+
} : {}, {
|
|
134
167
|
"data-name": "native-select",
|
|
135
168
|
className: _style.default.selectBox,
|
|
136
169
|
title: selectedLabel,
|
|
@@ -138,8 +171,15 @@ const Select = (props, legacyContext) => {
|
|
|
138
171
|
onChange: handleChange,
|
|
139
172
|
value: selected,
|
|
140
173
|
multiple: multiple,
|
|
141
|
-
disabled: disabled
|
|
142
|
-
|
|
174
|
+
disabled: disabled,
|
|
175
|
+
onClick: handleSelectOnFocus,
|
|
176
|
+
onBlur: handleSelectOnBlur // onBlur does not handle completely an out of bounds click
|
|
177
|
+
// ex: select is Opened and a click is done outside, cancelling the select
|
|
178
|
+
// that doesn't count as a Blur, so an onMouseLeave is needed
|
|
179
|
+
,
|
|
180
|
+
onMouseLeave: handleSelectOnBlur,
|
|
181
|
+
"data-testid": "native-select"
|
|
182
|
+
}), optionList)), /*#__PURE__*/_react.default.createElement("div", {
|
|
143
183
|
className: _style.default.description
|
|
144
184
|
}, description));
|
|
145
185
|
};
|
|
@@ -168,7 +208,8 @@ Select.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
168
208
|
options: _propTypes.default.arrayOf(_propTypes.default.shape(SelectOptionPropTypes)),
|
|
169
209
|
modified: _propTypes.default.bool,
|
|
170
210
|
error: _propTypes.default.bool,
|
|
171
|
-
'aria-label': _propTypes.default.string
|
|
211
|
+
'aria-label': _propTypes.default.string,
|
|
212
|
+
'aria-labelledby': _propTypes.default.string
|
|
172
213
|
} : {};
|
|
173
214
|
var _default = Select;
|
|
174
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","Select","props","legacyContext","name","options","className","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","ariaLabel","skin","GetSkinFromContext","useMemo","optionList","map","option","index","value","selectOption","titleView","selected","get","find","selectedLabel","isSelectedInValidOption","getOr","validOption","handleChange","e","target","selectedOptions","black","color","shouldUseSkinFontColor","includes","arrowColor","undefined","arrowView","selectedArrow","arrow","behaviorClassName","getClassState","default","composedClassName","classnames","unselected","labelSize","size","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectBox","SelectOptionPropTypes","PropTypes","string","isRequired","oneOfType","number","bool","contextTypes","Provider","childContextTypes","propTypes","func","oneOf","keys","arrayOf","shape"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {NovaCompositionNavigationArrowDown as ArrowDown} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n filter: style.filter,\n invalid: style.invalid,\n header: style.header,\n mooc: style.mooc,\n question: style.question,\n sort: style.sort,\n thematiques: style.thematiques,\n player: style.player,\n template: style.template,\n coorpmanager: null\n};\n\nconst Select = (props, legacyContext) => {\n const {\n name,\n options = [],\n className,\n borderClassName,\n onChange,\n multiple = false,\n disabled,\n required,\n description,\n theme,\n modified = false,\n error = false,\n title: propTitle,\n 'aria-label': ariaLabel\n } = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const title = useMemo(\n () => (propTitle ? `${propTitle}${required ? '*' : ''}` : null),\n [propTitle, required]\n );\n\n const optionList =\n options &&\n options.map((option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title} </span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, options)),\n [multiple, options]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, options)),\n [multiple, options]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const shouldUseSkinFontColor = useMemo(\n () =>\n !isSelectedInValidOption && selected && includes(theme, ['question', 'template', 'player']),\n [isSelectedInValidOption, selected, theme]\n );\n const arrowColor = selected ? color : undefined;\n\n const arrowView = !multiple ? (\n <ArrowDown\n color={includes(theme, ['question', 'template', 'player']) ? arrowColor : black}\n className={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n aria-label={ariaLabel}\n data-testid=\"select-arrow-down-icon\"\n />\n ) : null;\n const behaviorClassName = useMemo(\n () => getClassState(style.default, style.modified, style.error, modified, error),\n [error, modified]\n );\n const composedClassName = useMemo(\n () =>\n classnames(\n theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviorClassName,\n selected ? style.selected : style.unselected,\n className\n ),\n [behaviorClassName, className, selected, theme]\n );\n\n const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);\n\n const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);\n\n return (\n <div\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <label\n data-name=\"select-wrapper\"\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template'])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n >\n {selectedLabel}\n </span>\n {arrowView}\n <select\n data-name=\"native-select\"\n className={style.selectBox}\n title={selectedLabel}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool,\n validOption: PropTypes.bool\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool,\n 'aria-label': PropTypes.string\n};\n\nexport default Select;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,UAAU,GAAG;EACjBC,MAAM,EAAEC,cAAA,CAAMD,MADG;EAEjBE,OAAO,EAAED,cAAA,CAAMC,OAFE;EAGjBC,MAAM,EAAEF,cAAA,CAAME,MAHG;EAIjBC,IAAI,EAAEH,cAAA,CAAMG,IAJK;EAKjBC,QAAQ,EAAEJ,cAAA,CAAMI,QALC;EAMjBC,IAAI,EAAEL,cAAA,CAAMK,IANK;EAOjBC,WAAW,EAAEN,cAAA,CAAMM,WAPF;EAQjBC,MAAM,EAAEP,cAAA,CAAMO,MARG;EASjBC,QAAQ,EAAER,cAAA,CAAMQ,QATC;EAUjBC,YAAY,EAAE;AAVG,CAAnB;;AAaA,MAAMC,MAAM,GAAG,CAACC,KAAD,EAAQC,aAAR,KAA0B;EACvC,MAAM;IACJC,IADI;IAEJC,OAAO,GAAG,EAFN;IAGJC,SAHI;IAIJC,eAJI;IAKJC,QALI;IAMJC,QAAQ,GAAG,KANP;IAOJC,QAPI;IAQJC,QARI;IASJC,WATI;IAUJC,KAVI;IAWJC,QAAQ,GAAG,KAXP;IAYJC,KAAK,GAAG,KAZJ;IAaJC,KAAK,EAAEC,SAbH;IAcJ,cAAcC;EAdV,IAeFhB,KAfJ;EAiBA,MAAMiB,IAAI,GAAG,IAAAC,4BAAA,EAAmBjB,aAAnB,CAAb;EACA,MAAMa,KAAK,GAAG,IAAAK,cAAA,EACZ,MAAOJ,SAAS,GAAI,GAAEA,SAAU,GAAE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AA,CAAUK;AAJY,CAA9B;;AAOPpE,MAAM,CAACqE,YAAP,GAAsB;EACpBnD,IAAI,EAAEoD,iBAAA,CAASC,iBAAT,CAA2BrD;AADb,CAAtB;AAIAlB,MAAM,CAACwE,SAAP,2CAAmB;EACjBzD,KAAK,EAAEgD,kBAAA,CAAUC,MADA;EAEjB7D,IAAI,EAAE4D,kBAAA,CAAUC,MAFC;EAGjB3D,SAAS,EAAE0D,kBAAA,CAAUC,MAHJ;EAIjB1D,eAAe,EAAEyD,kBAAA,CAAUC,MAJV;EAKjBvD,QAAQ,EAAEsD,kBAAA,CAAUK,IALH;EAMjB5D,QAAQ,EAAEuD,kBAAA,CAAUK,IANH;EAOjBzD,WAAW,EAAEoD,kBAAA,CAAUC,MAPN;EAQjBtD,QAAQ,EAAEqD,kBAAA,CAAUK,IARH;EASjB7D,QAAQ,EAAEwD,kBAAA,CAAUU,IATH;EAUjB7D,KAAK,EAAEmD,kBAAA,CAAUW,KAAV,CAAgB,IAAAC,aAAA,EAAKvF,UAAL,CAAhB,CAVU;EAWjBgB,OAAO,EAAE2D,kBAAA,CAAUa,OAAV,CAAkBb,kBAAA,CAAUc,KAAV,CAAgBf,qBAAhB,CAAlB,CAXQ;EAYjBjD,QAAQ,EAAEkD,kBAAA,CAAUK,IAZH;EAajBtD,KAAK,EAAEiD,kBAAA,CAAUK,IAbA;EAcjB,cAAcL,kBAAA,CAAUC;AAdP,CAAnB;eAiBehE,M"}
|
|
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,E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version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/answer/index.js"],"names":[],"mappings":";AAuEA,iDASC"}
|
|
@@ -23,8 +23,6 @@ var _questionRange = _interopRequireDefault(require("../questions/question-range
|
|
|
23
23
|
|
|
24
24
|
var _template = _interopRequireDefault(require("../questions/template"));
|
|
25
25
|
|
|
26
|
-
var _provider = _interopRequireDefault(require("../../atom/provider"));
|
|
27
|
-
|
|
28
26
|
var _audio = _interopRequireDefault(require("../audio"));
|
|
29
27
|
|
|
30
28
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
@@ -88,8 +86,6 @@ MediaView.propTypes = process.env.NODE_ENV !== "production" ? _propTypes.MediaVi
|
|
|
88
86
|
const Switch = ({
|
|
89
87
|
model,
|
|
90
88
|
help
|
|
91
|
-
}, {
|
|
92
|
-
translate
|
|
93
89
|
}) => {
|
|
94
90
|
const {
|
|
95
91
|
type
|
|
@@ -111,9 +107,7 @@ const Switch = ({
|
|
|
111
107
|
return /*#__PURE__*/_react.default.createElement(_freeText.default, model);
|
|
112
108
|
|
|
113
109
|
case 'dropDown':
|
|
114
|
-
return /*#__PURE__*/_react.default.createElement(_dropDown.default,
|
|
115
|
-
"aria-label": translate('drop_down_icon')
|
|
116
|
-
}));
|
|
110
|
+
return /*#__PURE__*/_react.default.createElement(_dropDown.default, model);
|
|
117
111
|
|
|
118
112
|
case 'slider':
|
|
119
113
|
return /*#__PURE__*/_react.default.createElement(_questionRange.default, model);
|
|
@@ -127,9 +121,6 @@ Switch.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
127
121
|
model: _propTypes.default.model,
|
|
128
122
|
help: _propTypes.default.help
|
|
129
123
|
} : {};
|
|
130
|
-
Switch.contextTypes = {
|
|
131
|
-
translate: _provider.default.childContextTypes.translate
|
|
132
|
-
};
|
|
133
124
|
|
|
134
125
|
const Answer = props => {
|
|
135
126
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["MediaView","media","videoId","type","childProps","TYPE_IMAGE","style","backgroundImage","url","TYPE_VIDEO","video","TYPE_AUDIO","audio","propTypes","MediaViewPropTypes","Switch","model","help","
|
|
1
|
+
{"version":3,"file":"index.js","names":["MediaView","media","videoId","type","childProps","TYPE_IMAGE","style","backgroundImage","url","TYPE_VIDEO","video","TYPE_AUDIO","audio","propTypes","MediaViewPropTypes","Switch","model","help","Answer","props","wrapper"],"sources":["../../../src/molecule/answer/index.js"],"sourcesContent":["import React from 'react';\nimport {omit} from 'lodash/fp';\nimport VideoPlayer from '../video-player';\nimport DropDown from '../questions/drop-down';\nimport FreeText from '../questions/free-text';\nimport QcmDrag from '../questions/qcm-drag';\nimport Qcm from '../questions/qcm';\nimport QcmGraphic from '../questions/qcm-graphic';\nimport QuestionRange from '../questions/question-range';\nimport Template from '../questions/template';\nimport Audio from '../audio';\nimport style from './style.css';\nimport propTypes, {MediaViewPropTypes, TYPE_AUDIO, TYPE_IMAGE, TYPE_VIDEO} from './prop-types';\n\nconst MediaView = ({media}) => {\n const {videoId, type, ...childProps} = media;\n switch (type) {\n case TYPE_IMAGE:\n return (\n <div\n className={style.media}\n style={{\n backgroundImage: `url(${media.url})`\n }}\n />\n );\n case TYPE_VIDEO:\n return (\n <div className={style.video}>\n <VideoPlayer {...omit('id', childProps)} id={videoId} height=\"100%\" width=\"100%\" />\n </div>\n );\n case TYPE_AUDIO:\n return (\n <div className={style.audio}>\n <Audio {...omit('id', childProps)} height=\"100%\" width=\"100%\" />\n </div>\n );\n default:\n return null;\n }\n};\n\nMediaView.propTypes = MediaViewPropTypes;\n\nconst Switch = ({model, help}) => {\n const {type} = model;\n\n switch (type) {\n case 'qcmDrag':\n return <QcmDrag {...model} help={help} />;\n case 'qcm':\n return <Qcm {...model} />;\n case 'qcmGraphic':\n return <QcmGraphic {...model} />;\n case 'freeText':\n return <FreeText {...model} />;\n case 'dropDown':\n return <DropDown {...model} />;\n case 'slider':\n return <QuestionRange {...model} />;\n case 'template':\n return <Template {...model} />;\n }\n};\n\nSwitch.propTypes = {\n model: propTypes.model,\n help: propTypes.help\n};\n\nconst Answer = props => {\n const {model, media, help} = props;\n\n return (\n <div data-name=\"answer\" className={style.wrapper}>\n {media ? <MediaView media={media} /> : null}\n <Switch model={model} help={help} />\n </div>\n );\n};\n\nAnswer.propTypes = propTypes;\n\nexport default Answer;\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAEA,MAAMA,SAAS,GAAG,CAAC;EAACC;AAAD,CAAD,KAAa;EAC7B,MAAM;IAACC,OAAD;IAAUC;EAAV,IAAiCF,KAAvC;EAAA,MAAyBG,UAAzB,iCAAuCH,KAAvC;;EACA,QAAQE,IAAR;IACE,KAAKE,qBAAL;MACE,oBACE;QACE,SAAS,EAAEC,cAAA,CAAML,KADnB;QAEE,KAAK,EAAE;UACLM,eAAe,EAAG,OAAMN,KAAK,CAACO,GAAI;QAD7B;MAFT,EADF;;IAQF,KAAKC,qBAAL;MACE,oBACE;QAAK,SAAS,EAAEH,cAAA,CAAMI;MAAtB,gBACE,6BAAC,oBAAD,eAAiB,oBAAK,IAAL,EAAWN,UAAX,CAAjB;QAAyC,EAAE,EAAEF,OAA7C;QAAsD,MAAM,EAAC,MAA7D;QAAoE,KAAK,EAAC;MAA1E,GADF,CADF;;IAKF,KAAKS,qBAAL;MACE,oBACE;QAAK,SAAS,EAAEL,cAAA,CAAMM;MAAtB,gBACE,6BAAC,cAAD,eAAW,oBAAK,IAAL,EAAWR,UAAX,CAAX;QAAmC,MAAM,EAAC,MAA1C;QAAiD,KAAK,EAAC;MAAvD,GADF,CADF;;IAKF;MACE,OAAO,IAAP;EAvBJ;AAyBD,CA3BD;;AA6BAJ,SAAS,CAACa,SAAV,2CAAsBC,6BAAtB;;AAEA,MAAMC,MAAM,GAAG,CAAC;EAACC,KAAD;EAAQC;AAAR,CAAD,KAAmB;EAChC,MAAM;IAACd;EAAD,IAASa,KAAf;;EAEA,QAAQb,IAAR;IACE,KAAK,SAAL;MACE,oBAAO,6BAAC,gBAAD,eAAaa,KAAb;QAAoB,IAAI,EAAEC;MAA1B,GAAP;;IACF,KAAK,KAAL;MACE,oBAAO,6BAAC,YAAD,EAASD,KAAT,CAAP;;IACF,KAAK,YAAL;MACE,oBAAO,6BAAC,mBAAD,EAAgBA,KAAhB,CAAP;;IACF,KAAK,UAAL;MACE,oBAAO,6BAAC,iBAAD,EAAcA,KAAd,CAAP;;IACF,KAAK,UAAL;MACE,oBAAO,6BAAC,iBAAD,EAAcA,KAAd,CAAP;;IACF,KAAK,QAAL;MACE,oBAAO,6BAAC,sBAAD,EAAmBA,KAAnB,CAAP;;IACF,KAAK,UAAL;MACE,oBAAO,6BAAC,iBAAD,EAAcA,KAAd,CAAP;EAdJ;AAgBD,CAnBD;;AAqBAD,MAAM,CAACF,SAAP,2CAAmB;EACjBG,KAAK,EAAEH,kBAAA,CAAUG,KADA;EAEjBC,IAAI,EAAEJ,kBAAA,CAAUI;AAFC,CAAnB;;AAKA,MAAMC,MAAM,GAAGC,KAAK,IAAI;EACtB,MAAM;IAACH,KAAD;IAAQf,KAAR;IAAegB;EAAf,IAAuBE,KAA7B;EAEA,oBACE;IAAK,aAAU,QAAf;IAAwB,SAAS,EAAEb,cAAA,CAAMc;EAAzC,GACGnB,KAAK,gBAAG,6BAAC,SAAD;IAAW,KAAK,EAAEA;EAAlB,EAAH,GAAiC,IADzC,eAEE,6BAAC,MAAD;IAAQ,KAAK,EAAEe,KAAf;IAAsB,IAAI,EAAEC;EAA5B,EAFF,CADF;AAMD,CATD;;AAWAC,MAAM,CAACL,SAAP,2CAAmBA,kBAAnB;eAEeK,M"}
|
|
@@ -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>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Props } from './types';
|
|
3
|
+
declare const EmptyStateDashboard: {
|
|
4
|
+
({ mainText, subText, imageUrl, buttonLink }: Props): JSX.Element;
|
|
5
|
+
propTypes: {
|
|
6
|
+
mainText: import("prop-types").Requireable<string>;
|
|
7
|
+
subText: import("prop-types").Requireable<string>;
|
|
8
|
+
imageUrl: import("prop-types").Requireable<any>;
|
|
9
|
+
buttonLink: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
10
|
+
type: import("prop-types").Requireable<string>;
|
|
11
|
+
label: import("prop-types").Requireable<string>;
|
|
12
|
+
ariaLabel: import("prop-types").Requireable<string>;
|
|
13
|
+
dataName: import("prop-types").Requireable<string>;
|
|
14
|
+
icon: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
15
|
+
position: import("prop-types").Requireable<string>;
|
|
16
|
+
type: import("prop-types").Requireable<string>;
|
|
17
|
+
}>>;
|
|
18
|
+
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
19
|
+
}>>;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export default EmptyStateDashboard;
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/empty-state-dashboard/index.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAC,KAAK,EAAY,MAAM,SAAS,CAAC;AAEzC,QAAA,MAAM,mBAAmB;kDAA+C,KAAK;;;;;;;;;;;;;;;;;CAW5E,CAAC;AAIF,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
|
+
|
|
8
|
+
var _buttonLink = _interopRequireDefault(require("../../atom/button-link"));
|
|
9
|
+
|
|
10
|
+
var _style = _interopRequireDefault(require("./style.css"));
|
|
11
|
+
|
|
12
|
+
var _types = require("./types");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
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); }
|
|
17
|
+
|
|
18
|
+
const EmptyStateDashboard = ({
|
|
19
|
+
mainText,
|
|
20
|
+
subText,
|
|
21
|
+
imageUrl,
|
|
22
|
+
buttonLink
|
|
23
|
+
}) => /*#__PURE__*/_react.default.createElement("div", {
|
|
24
|
+
className: _style.default.container
|
|
25
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("img", {
|
|
26
|
+
className: _style.default.img,
|
|
27
|
+
src: imageUrl,
|
|
28
|
+
"aria-hidden": "true"
|
|
29
|
+
})), /*#__PURE__*/_react.default.createElement("p", {
|
|
30
|
+
className: _style.default.mainText
|
|
31
|
+
}, mainText), /*#__PURE__*/_react.default.createElement("p", {
|
|
32
|
+
className: _style.default.subText
|
|
33
|
+
}, subText), /*#__PURE__*/_react.default.createElement("div", {
|
|
34
|
+
className: _style.default.buttonContainer
|
|
35
|
+
}, /*#__PURE__*/_react.default.createElement(_buttonLink.default, _extends({}, buttonLink, {
|
|
36
|
+
className: _style.default.button
|
|
37
|
+
}))));
|
|
38
|
+
|
|
39
|
+
EmptyStateDashboard.propTypes = process.env.NODE_ENV !== "production" ? _types.propTypes : {};
|
|
40
|
+
var _default = EmptyStateDashboard;
|
|
41
|
+
exports.default = _default;
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["EmptyStateDashboard","mainText","subText","imageUrl","buttonLink","style","container","img","buttonContainer","button","propTypes"],"sources":["../../../src/molecule/empty-state-dashboard/index.tsx"],"sourcesContent":["import React from 'react';\nimport ButtonLink from '../../atom/button-link';\nimport style from './style.css';\nimport {Props, propTypes} from './types';\n\nconst EmptyStateDashboard = ({mainText, subText, imageUrl, buttonLink}: Props) => (\n <div className={style.container}>\n <div>\n <img className={style.img} src={imageUrl} aria-hidden=\"true\" />\n </div>\n <p className={style.mainText}>{mainText}</p>\n <p className={style.subText}>{subText}</p>\n <div className={style.buttonContainer}>\n <ButtonLink {...buttonLink} className={style.button} />\n </div>\n </div>\n);\n\nEmptyStateDashboard.propTypes = propTypes;\n\nexport default EmptyStateDashboard;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,mBAAmB,GAAG,CAAC;EAACC,QAAD;EAAWC,OAAX;EAAoBC,QAApB;EAA8BC;AAA9B,CAAD,kBAC1B;EAAK,SAAS,EAAEC,cAAA,CAAMC;AAAtB,gBACE,uDACE;EAAK,SAAS,EAAED,cAAA,CAAME,GAAtB;EAA2B,GAAG,EAAEJ,QAAhC;EAA0C,eAAY;AAAtD,EADF,CADF,eAIE;EAAG,SAAS,EAAEE,cAAA,CAAMJ;AAApB,GAA+BA,QAA/B,CAJF,eAKE;EAAG,SAAS,EAAEI,cAAA,CAAMH;AAApB,GAA8BA,OAA9B,CALF,eAME;EAAK,SAAS,EAAEG,cAAA,CAAMG;AAAtB,gBACE,6BAAC,mBAAD,eAAgBJ,UAAhB;EAA4B,SAAS,EAAEC,cAAA,CAAMI;AAA7C,GADF,CANF,CADF;;AAaAT,mBAAmB,CAACU,SAApB,2CAAgCA,gBAAhC;eAEeV,mB"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
@value colors: "../../variables/colors.css";
|
|
2
|
+
@value cm_grey_500: from colors;
|
|
3
|
+
@value cm_grey_800: from colors;
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
.container {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
height: 100%;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
text-align: center;
|
|
13
|
+
width: 100%;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.img {
|
|
17
|
+
height: 170px;
|
|
18
|
+
width: 220px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.text {
|
|
22
|
+
font-family: 'Gilroy';
|
|
23
|
+
margin: 0 auto 0 auto;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.mainText {
|
|
27
|
+
composes: text;
|
|
28
|
+
color: cm_grey_800;
|
|
29
|
+
font-weight: 600;
|
|
30
|
+
font-size: 24px;
|
|
31
|
+
line-height: 32px;
|
|
32
|
+
padding-top: 36px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.subText {
|
|
36
|
+
composes: text;
|
|
37
|
+
color: cm_grey_500;
|
|
38
|
+
font-weight: 400;
|
|
39
|
+
font-size: 16px;
|
|
40
|
+
line-height: 24px;
|
|
41
|
+
padding-top: 4px;
|
|
42
|
+
;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.buttonContainer {
|
|
46
|
+
display: flex;
|
|
47
|
+
justify-content: center;
|
|
48
|
+
padding-top: 32px;
|
|
49
|
+
width: 100%;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.button {
|
|
53
|
+
width: 152px;
|
|
54
|
+
height: 44px;
|
|
55
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
export declare const propTypes: {
|
|
3
|
+
mainText: PropTypes.Requireable<string>;
|
|
4
|
+
subText: PropTypes.Requireable<string>;
|
|
5
|
+
imageUrl: PropTypes.Requireable<any>;
|
|
6
|
+
buttonLink: PropTypes.Requireable<PropTypes.InferProps<{
|
|
7
|
+
type: PropTypes.Requireable<string>;
|
|
8
|
+
label: PropTypes.Requireable<string>;
|
|
9
|
+
ariaLabel: PropTypes.Requireable<string>;
|
|
10
|
+
dataName: PropTypes.Requireable<string>;
|
|
11
|
+
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
12
|
+
position: PropTypes.Requireable<string>;
|
|
13
|
+
type: PropTypes.Requireable<string>;
|
|
14
|
+
}>>;
|
|
15
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
16
|
+
}>>;
|
|
17
|
+
};
|
|
18
|
+
export declare type Props = PropTypes.InferProps<typeof propTypes>;
|
|
19
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/empty-state-dashboard/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAGnC,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;CAerB,CAAC;AAEF,oBAAY,KAAK,GAAG,SAAS,CAAC,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.propTypes = void 0;
|
|
5
|
+
|
|
6
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
7
|
+
|
|
8
|
+
var _picture = _interopRequireDefault(require("../../atom/picture"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
const propTypes = {
|
|
13
|
+
mainText: _propTypes.default.string,
|
|
14
|
+
subText: _propTypes.default.string,
|
|
15
|
+
imageUrl: _picture.default.propTypes.src,
|
|
16
|
+
buttonLink: _propTypes.default.shape({
|
|
17
|
+
type: _propTypes.default.string,
|
|
18
|
+
label: _propTypes.default.string,
|
|
19
|
+
ariaLabel: _propTypes.default.string,
|
|
20
|
+
dataName: _propTypes.default.string,
|
|
21
|
+
icon: _propTypes.default.shape({
|
|
22
|
+
position: _propTypes.default.string,
|
|
23
|
+
type: _propTypes.default.string
|
|
24
|
+
}),
|
|
25
|
+
onClick: _propTypes.default.func
|
|
26
|
+
})
|
|
27
|
+
};
|
|
28
|
+
exports.propTypes = propTypes;
|
|
29
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":["propTypes","mainText","PropTypes","string","subText","imageUrl","Picture","src","buttonLink","shape","type","label","ariaLabel","dataName","icon","position","onClick","func"],"sources":["../../../src/molecule/empty-state-dashboard/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport Picture from '../../atom/picture';\n\nexport const propTypes = {\n mainText: PropTypes.string,\n subText: PropTypes.string,\n imageUrl: Picture.propTypes.src,\n buttonLink: PropTypes.shape({\n type: PropTypes.string,\n label: PropTypes.string,\n ariaLabel: PropTypes.string,\n dataName: PropTypes.string,\n icon: PropTypes.shape({\n position: PropTypes.string,\n type: PropTypes.string\n }),\n onClick: PropTypes.func\n })\n};\n\nexport type Props = PropTypes.InferProps<typeof propTypes>;\n"],"mappings":";;;;;AAAA;;AACA;;;;AAEO,MAAMA,SAAS,GAAG;EACvBC,QAAQ,EAAEC,kBAAA,CAAUC,MADG;EAEvBC,OAAO,EAAEF,kBAAA,CAAUC,MAFI;EAGvBE,QAAQ,EAAEC,gBAAA,CAAQN,SAAR,CAAkBO,GAHL;EAIvBC,UAAU,EAAEN,kBAAA,CAAUO,KAAV,CAAgB;IAC1BC,IAAI,EAAER,kBAAA,CAAUC,MADU;IAE1BQ,KAAK,EAAET,kBAAA,CAAUC,MAFS;IAG1BS,SAAS,EAAEV,kBAAA,CAAUC,MAHK;IAI1BU,QAAQ,EAAEX,kBAAA,CAAUC,MAJM;IAK1BW,IAAI,EAAEZ,kBAAA,CAAUO,KAAV,CAAgB;MACpBM,QAAQ,EAAEb,kBAAA,CAAUC,MADA;MAEpBO,IAAI,EAAER,kBAAA,CAAUC;IAFI,CAAhB,CALoB;IAS1Ba,OAAO,EAAEd,kBAAA,CAAUe;EATO,CAAhB;AAJW,CAAlB"}
|
|
@@ -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>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export default ListItem;
|
|
2
2
|
declare function ListItem(props: any): JSX.Element;
|
|
3
3
|
declare namespace ListItem {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const propTypes: {
|
|
5
|
+
bulletPointMenuButton: PropTypes.Requireable<PropTypes.InferProps<{
|
|
6
6
|
buttonAriaLabel: PropTypes.Requireable<string>;
|
|
7
7
|
menuAriaLabel: PropTypes.Requireable<string>;
|
|
8
8
|
buttons: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
@@ -13,7 +13,7 @@ declare namespace ListItem {
|
|
|
13
13
|
}> | null | undefined)[]>;
|
|
14
14
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
15
15
|
}>>;
|
|
16
|
-
|
|
16
|
+
buttonLink: PropTypes.Requireable<PropTypes.InferProps<{
|
|
17
17
|
type: PropTypes.Requireable<string>;
|
|
18
18
|
label: PropTypes.Requireable<string>;
|
|
19
19
|
ariaLabel: PropTypes.Requireable<string>;
|
|
@@ -24,12 +24,14 @@ declare namespace ListItem {
|
|
|
24
24
|
}>>;
|
|
25
25
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
26
26
|
}>>;
|
|
27
|
-
|
|
27
|
+
tags: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
28
28
|
label: PropTypes.Requireable<string>;
|
|
29
29
|
type: PropTypes.Requireable<string>;
|
|
30
30
|
}> | null | undefined)[]>;
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
title: PropTypes.Validator<string>;
|
|
32
|
+
order: PropTypes.Requireable<number>;
|
|
33
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
34
|
+
};
|
|
33
35
|
}
|
|
34
36
|
import PropTypes from "prop-types";
|
|
35
37
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/list-item/index.js"],"names":[],"mappings":";AAQA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/list-item/index.js"],"names":[],"mappings":";AAQA,mDAqCC"}
|