@coorpacademy/components 11.19.2-alpha.14 → 11.19.2-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/title/style.css +1 -1
- package/es/molecule/card/index.d.ts.map +1 -1
- package/es/molecule/card/index.js +2 -6
- package/es/molecule/card/index.js.map +1 -1
- package/es/molecule/card/style.css +2 -2
- package/es/molecule/cm-popin/index.d.ts.map +1 -1
- package/es/molecule/cm-popin/index.js +3 -20
- package/es/molecule/cm-popin/index.js.map +1 -1
- package/es/molecule/cm-popin/style.css +0 -26
- package/es/molecule/title-and-checkbox-wrapper/index.d.ts +46 -0
- package/es/molecule/title-and-checkbox-wrapper/index.d.ts.map +1 -1
- package/es/molecule/title-and-checkbox-wrapper/index.js +15 -3
- package/es/molecule/title-and-checkbox-wrapper/index.js.map +1 -1
- package/es/organism/rewards-form/index.d.ts +46 -0
- package/es/organism/select-opponents/index.d.ts +82 -26
- package/es/organism/select-opponents/index.d.ts.map +1 -1
- package/es/organism/select-opponents/index.js +3 -3
- package/es/organism/select-opponents/index.js.map +1 -1
- package/es/organism/select-opponents/style.css +6 -0
- package/es/organism/select-opponents/types.d.ts +90 -28
- package/es/organism/select-opponents/types.d.ts.map +1 -1
- package/es/organism/select-opponents/types.js +2 -2
- package/es/organism/select-opponents/types.js.map +1 -1
- package/es/organism/title-and-input/index.d.ts +82 -26
- package/es/organism/title-and-input/index.d.ts.map +1 -1
- package/es/organism/title-and-input/types.d.ts +82 -26
- package/es/organism/title-and-input/types.d.ts.map +1 -1
- package/es/organism/wizard-contents/index.d.ts +46 -0
- package/es/template/common/dashboard/index.d.ts.map +1 -1
- package/es/template/common/dashboard/index.js.map +1 -1
- package/es/template/common/dashboard/style.css +0 -4
- package/es/template/common/search-page/index.d.ts.map +1 -1
- package/es/template/common/search-page/index.js +2 -4
- package/es/template/common/search-page/index.js.map +1 -1
- package/es/template/common/search-page/style.css +0 -4
- package/lib/atom/title/style.css +1 -1
- package/lib/molecule/card/index.d.ts.map +1 -1
- package/lib/molecule/card/index.js +2 -6
- package/lib/molecule/card/index.js.map +1 -1
- package/lib/molecule/card/style.css +2 -2
- package/lib/molecule/cm-popin/index.d.ts.map +1 -1
- package/lib/molecule/cm-popin/index.js +3 -24
- package/lib/molecule/cm-popin/index.js.map +1 -1
- package/lib/molecule/cm-popin/style.css +0 -26
- package/lib/molecule/title-and-checkbox-wrapper/index.d.ts +46 -0
- package/lib/molecule/title-and-checkbox-wrapper/index.d.ts.map +1 -1
- package/lib/molecule/title-and-checkbox-wrapper/index.js +17 -3
- package/lib/molecule/title-and-checkbox-wrapper/index.js.map +1 -1
- package/lib/organism/rewards-form/index.d.ts +46 -0
- package/lib/organism/select-opponents/index.d.ts +82 -26
- package/lib/organism/select-opponents/index.d.ts.map +1 -1
- package/lib/organism/select-opponents/index.js +3 -3
- package/lib/organism/select-opponents/index.js.map +1 -1
- package/lib/organism/select-opponents/style.css +6 -0
- package/lib/organism/select-opponents/types.d.ts +90 -28
- package/lib/organism/select-opponents/types.d.ts.map +1 -1
- package/lib/organism/select-opponents/types.js +2 -2
- package/lib/organism/select-opponents/types.js.map +1 -1
- package/lib/organism/title-and-input/index.d.ts +82 -26
- package/lib/organism/title-and-input/index.d.ts.map +1 -1
- package/lib/organism/title-and-input/types.d.ts +82 -26
- package/lib/organism/title-and-input/types.d.ts.map +1 -1
- package/lib/organism/wizard-contents/index.d.ts +46 -0
- package/lib/template/common/dashboard/index.d.ts.map +1 -1
- package/lib/template/common/dashboard/index.js.map +1 -1
- package/lib/template/common/dashboard/style.css +0 -4
- package/lib/template/common/search-page/index.d.ts.map +1 -1
- package/lib/template/common/search-page/index.js +2 -8
- package/lib/template/common/search-page/index.js.map +1 -1
- package/lib/template/common/search-page/style.css +0 -4
- package/locales/.mtslconfig.json +1 -0
- package/package.json +2 -2
|
@@ -50,39 +50,78 @@ declare const propTypes: {
|
|
|
50
50
|
onSuggestionSelected: PropTypes.Requireable<(...args: any[]) => any>;
|
|
51
51
|
}> | PropTypes.InferProps<{
|
|
52
52
|
items: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
53
|
-
|
|
54
|
-
title: PropTypes.
|
|
55
|
-
title: PropTypes.Requireable<string>;
|
|
56
|
-
subtitle: PropTypes.Requireable<string>;
|
|
57
|
-
type: PropTypes.Requireable<string>;
|
|
58
|
-
'data-name': PropTypes.Requireable<string>;
|
|
59
|
-
titleSize: PropTypes.Requireable<string>;
|
|
60
|
-
subtitleSize: PropTypes.Requireable<string>;
|
|
61
|
-
}>>>;
|
|
53
|
+
checkboxWithTitle: PropTypes.Requireable<PropTypes.InferProps<{
|
|
54
|
+
title: PropTypes.Requireable<string>;
|
|
62
55
|
name: PropTypes.Requireable<string>;
|
|
63
56
|
checked: PropTypes.Requireable<boolean>;
|
|
64
|
-
onChange: PropTypes.
|
|
57
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
65
58
|
'aria-label': PropTypes.Requireable<string>;
|
|
66
59
|
'data-name': PropTypes.Requireable<string>;
|
|
67
60
|
}>>;
|
|
68
|
-
|
|
61
|
+
sectionTitle: PropTypes.Requireable<PropTypes.InferProps<{
|
|
62
|
+
removeMargin: PropTypes.Requireable<boolean>;
|
|
69
63
|
title: PropTypes.Requireable<string>;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
64
|
+
subtitle: PropTypes.Requireable<string>;
|
|
65
|
+
type: PropTypes.Requireable<string>;
|
|
66
|
+
'data-name': PropTypes.Requireable<string>;
|
|
67
|
+
titleSize: PropTypes.Requireable<string>;
|
|
68
|
+
subtitleSize: PropTypes.Requireable<string>;
|
|
69
|
+
}>>;
|
|
70
|
+
child: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
|
|
71
|
+
childType: PropTypes.Requireable<string>;
|
|
72
|
+
inputText: PropTypes.Requireable<PropTypes.InferProps<{
|
|
73
|
+
theme: PropTypes.Requireable<string>;
|
|
74
|
+
size: PropTypes.Requireable<string>;
|
|
75
|
+
autoFocus: PropTypes.Requireable<boolean>;
|
|
76
|
+
title: PropTypes.Requireable<string>;
|
|
77
|
+
placeholder: PropTypes.Requireable<string>;
|
|
78
|
+
defaultValue: PropTypes.Requireable<string>;
|
|
79
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
76
80
|
value: PropTypes.Requireable<string>;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
hint: PropTypes.Requireable<string>;
|
|
82
|
+
error: PropTypes.Requireable<string>;
|
|
83
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
84
|
+
description: PropTypes.Requireable<string>;
|
|
85
|
+
modified: PropTypes.Requireable<boolean>;
|
|
86
|
+
valid: PropTypes.Requireable<boolean>;
|
|
87
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
88
|
+
'data-name': PropTypes.Requireable<string>;
|
|
89
|
+
}>>;
|
|
90
|
+
title: PropTypes.Requireable<string>;
|
|
91
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
92
|
+
'data-name': PropTypes.Requireable<string>;
|
|
93
|
+
}> | PropTypes.InferProps<{
|
|
94
|
+
childType: PropTypes.Requireable<string>;
|
|
95
|
+
list: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
96
|
+
name: PropTypes.Requireable<string>;
|
|
97
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
98
|
+
onReset: PropTypes.Requireable<(...args: any[]) => any>;
|
|
99
|
+
filesTypes: (props: any, propName: any, componentName: any) => Error | null;
|
|
100
|
+
error: PropTypes.Requireable<string>;
|
|
101
|
+
buttonAriaLabel: PropTypes.Requireable<string>;
|
|
102
|
+
errorButtonLabel: PropTypes.Requireable<string>;
|
|
103
|
+
labelLink: PropTypes.Requireable<string>;
|
|
104
|
+
hrefLink: PropTypes.Requireable<string>;
|
|
105
|
+
title: PropTypes.Requireable<string>;
|
|
106
|
+
description: PropTypes.Requireable<string>;
|
|
107
|
+
uploadLabel: PropTypes.Requireable<string>;
|
|
108
|
+
previewLabel: PropTypes.Requireable<string>;
|
|
109
|
+
previewContent: PropTypes.Requireable<PropTypes.InferProps<{
|
|
110
|
+
type: PropTypes.Requireable<string>;
|
|
111
|
+
src: PropTypes.Requireable<string>;
|
|
112
|
+
label: PropTypes.Requireable<string>;
|
|
113
|
+
}>>;
|
|
114
|
+
loading: PropTypes.Requireable<boolean>;
|
|
115
|
+
modified: PropTypes.Requireable<boolean>;
|
|
116
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
117
|
+
children: PropTypes.Requireable<(...args: any[]) => any>;
|
|
118
|
+
pdfButtonLabel: PropTypes.Requireable<string>;
|
|
119
|
+
pdfButtonAriaLabel: PropTypes.Requireable<string>;
|
|
120
|
+
multiple: PropTypes.Requireable<boolean>;
|
|
121
|
+
}> | null | undefined)[]>;
|
|
122
|
+
'data-name': PropTypes.Requireable<string>;
|
|
85
123
|
}> | PropTypes.InferProps<{
|
|
124
|
+
childType: PropTypes.Requireable<string>;
|
|
86
125
|
name: PropTypes.Requireable<string>;
|
|
87
126
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
88
127
|
onReset: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -108,8 +147,25 @@ declare const propTypes: {
|
|
|
108
147
|
pdfButtonLabel: PropTypes.Requireable<string>;
|
|
109
148
|
pdfButtonAriaLabel: PropTypes.Requireable<string>;
|
|
110
149
|
multiple: PropTypes.Requireable<boolean>;
|
|
150
|
+
}> | PropTypes.InferProps<{
|
|
151
|
+
childType: PropTypes.Requireable<string>;
|
|
152
|
+
title: PropTypes.Requireable<string>;
|
|
153
|
+
placeholder: PropTypes.Requireable<string>;
|
|
154
|
+
description: PropTypes.Requireable<string>;
|
|
155
|
+
hint: PropTypes.Requireable<string>;
|
|
156
|
+
options: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
|
|
157
|
+
selected: PropTypes.Validator<boolean>;
|
|
158
|
+
name: PropTypes.Validator<string>;
|
|
159
|
+
value: PropTypes.Requireable<string>;
|
|
160
|
+
}>>[]>;
|
|
161
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
162
|
+
onError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
163
|
+
multiple: PropTypes.Requireable<boolean>;
|
|
164
|
+
modified: PropTypes.Requireable<boolean>;
|
|
165
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
166
|
+
error: PropTypes.Requireable<string>;
|
|
167
|
+
theme: PropTypes.Requireable<string>;
|
|
111
168
|
}> | null | undefined>>;
|
|
112
|
-
childType: PropTypes.Requireable<string>;
|
|
113
169
|
}> | null | undefined)[]>;
|
|
114
170
|
}> | null | undefined>>;
|
|
115
171
|
childType: PropTypes.Validator<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/organism/title-and-input/types.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,YAAY,MAAM,yBAAyB,CAAC;AAEnD,OAAO,cAAc,MAAM,gCAAgC,CAAC;AAE5D,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAE/D,QAAA,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/organism/title-and-input/types.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,YAAY,MAAM,yBAAyB,CAAC;AAEnD,OAAO,cAAc,MAAM,gCAAgC,CAAC;AAE5D,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAE/D,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQd,CAAC;AACF,oBAAY,kBAAkB,GAAG;IAC/B,KAAK,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,KAAK,EACD,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,GAC3C,KAAK,CAAC,cAAc,CAAC,OAAO,YAAY,CAAC,GACzC,oBAAoB,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -275,6 +275,7 @@ declare namespace WizardContents {
|
|
|
275
275
|
'data-name': PropTypes.Requireable<string>;
|
|
276
276
|
}>>;
|
|
277
277
|
sectionTitle: PropTypes.Requireable<PropTypes.InferProps<{
|
|
278
|
+
removeMargin: PropTypes.Requireable<boolean>;
|
|
278
279
|
title: PropTypes.Requireable<string>;
|
|
279
280
|
subtitle: PropTypes.Requireable<string>;
|
|
280
281
|
type: PropTypes.Requireable<string>;
|
|
@@ -335,6 +336,51 @@ declare namespace WizardContents {
|
|
|
335
336
|
multiple: PropTypes.Requireable<boolean>;
|
|
336
337
|
}> | null | undefined)[]>;
|
|
337
338
|
'data-name': PropTypes.Requireable<string>;
|
|
339
|
+
}> | PropTypes.InferProps<{
|
|
340
|
+
childType: PropTypes.Requireable<string>;
|
|
341
|
+
name: PropTypes.Requireable<string>;
|
|
342
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
343
|
+
onReset: PropTypes.Requireable<(...args: any[]) => any>;
|
|
344
|
+
filesTypes: (props: any, propName: any, componentName: any) => Error | null;
|
|
345
|
+
error: PropTypes.Requireable<string>;
|
|
346
|
+
buttonAriaLabel: PropTypes.Requireable<string>;
|
|
347
|
+
errorButtonLabel: PropTypes.Requireable<string>;
|
|
348
|
+
labelLink: PropTypes.Requireable<string>;
|
|
349
|
+
hrefLink: PropTypes.Requireable<string>;
|
|
350
|
+
title: PropTypes.Requireable<string>;
|
|
351
|
+
description: PropTypes.Requireable<string>;
|
|
352
|
+
uploadLabel: PropTypes.Requireable<string>;
|
|
353
|
+
previewLabel: PropTypes.Requireable<string>;
|
|
354
|
+
previewContent: PropTypes.Requireable<PropTypes.InferProps<{
|
|
355
|
+
type: PropTypes.Requireable<string>;
|
|
356
|
+
src: PropTypes.Requireable<string>;
|
|
357
|
+
label: PropTypes.Requireable<string>;
|
|
358
|
+
}>>;
|
|
359
|
+
loading: PropTypes.Requireable<boolean>;
|
|
360
|
+
modified: PropTypes.Requireable<boolean>;
|
|
361
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
362
|
+
children: PropTypes.Requireable<(...args: any[]) => any>;
|
|
363
|
+
pdfButtonLabel: PropTypes.Requireable<string>;
|
|
364
|
+
pdfButtonAriaLabel: PropTypes.Requireable<string>;
|
|
365
|
+
multiple: PropTypes.Requireable<boolean>;
|
|
366
|
+
}> | PropTypes.InferProps<{
|
|
367
|
+
childType: PropTypes.Requireable<string>;
|
|
368
|
+
title: PropTypes.Requireable<string>;
|
|
369
|
+
placeholder: PropTypes.Requireable<string>;
|
|
370
|
+
description: PropTypes.Requireable<string>;
|
|
371
|
+
hint: PropTypes.Requireable<string>;
|
|
372
|
+
options: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
|
|
373
|
+
selected: PropTypes.Validator<boolean>;
|
|
374
|
+
name: PropTypes.Validator<string>;
|
|
375
|
+
value: PropTypes.Requireable<string>;
|
|
376
|
+
}>>[]>;
|
|
377
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
378
|
+
onError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
379
|
+
multiple: PropTypes.Requireable<boolean>;
|
|
380
|
+
modified: PropTypes.Requireable<boolean>;
|
|
381
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
382
|
+
error: PropTypes.Requireable<string>;
|
|
383
|
+
theme: PropTypes.Requireable<string>;
|
|
338
384
|
}> | null | undefined>>;
|
|
339
385
|
}> | null | undefined)[]>;
|
|
340
386
|
}> | PropTypes.InferProps<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/dashboard/index.js"],"names":[],"mappings":";AAqBA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/dashboard/index.js"],"names":[],"mappings":";AAqBA,oDAkDC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","Slide","HeroCard","BattleRequestList","CardsList","NewsList","StartBattle","CMPopin","ReviewBanner","style","Hero","memo","hero","welcome","propTypes","shape","Dashboard","props","sections","cookie","popinWithCards","showMoreOnLeftOrRightAriaLabel","buildSectionComponent","section","type","buildSection","index","sectionView","sectionsList","key","map","wrapper","arrayOf","oneOfType"],"sources":["../../../../src/template/common/dashboard/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Slide from '../../../atom/slide';\nimport HeroCard from '../../../molecule/hero';\nimport BattleRequestList from '../../../molecule/dashboard/battle-request-list';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport NewsList from '../../../molecule/dashboard/news-list';\nimport StartBattle from '../../../molecule/dashboard/start-battle';\nimport CMPopin from '../../../molecule/cm-popin';\nimport ReviewBanner from '../../../molecule/dashboard/review-banner';\nimport style from './style.css';\n\nconst Hero = React.memo(function Hero({hero, welcome}) {\n return <div className={style.hero}>{hero ? <HeroCard {...hero} /> : <Slide {...welcome} />}</div>;\n});\n\nHero.propTypes = {\n hero: PropTypes.shape(HeroCard.propTypes),\n welcome: PropTypes.shape(Slide.propTypes)\n};\n\nconst Dashboard = props => {\n const {\n sections = [],\n hero,\n welcome,\n cookie,\n popinWithCards,\n 'arrows-aria-label': showMoreOnLeftOrRightAriaLabel\n } = props;\n const buildSectionComponent = section => {\n const {type} = section;\n switch (type) {\n case 'hero':\n return <Hero hero={hero} welcome={welcome} />;\n case 'battleRequests':\n return <BattleRequestList {...section} />;\n case 'cards':\n return <CardsList {...section} arrows-aria-label={showMoreOnLeftOrRightAriaLabel} />;\n case 'news':\n return <NewsList {...section} />;\n case 'battle':\n return <StartBattle {...section} />;\n case 'review':\n return <ReviewBanner {...section} />;\n default:\n return null;\n }\n };\n\n const buildSection = (section, index) => {\n const sectionView = buildSectionComponent(section);\n\n return <div key={index}>{sectionView}</div>;\n };\n\n const sectionsList = [{type: 'hero', key: 'hero'}, ...sections].map(section => (\n <div key={section.key}>{buildSection(section)}</div>\n ));\n return (\n <div className={style.wrapper} data-name=\"dashboard\">\n {sectionsList}\n {cookie ? <CMPopin {...cookie} /> : null}\n {popinWithCards ? (\n <div className={style.popinWithCards}>\n <CMPopin {...popinWithCards} />\n </div>\n ) : null}\n </div>\n );\n};\n\nDashboard.propTypes = {\n hero: Hero.propTypes.hero,\n welcome: Hero.propTypes.welcome,\n sections: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape(BattleRequestList.propTypes),\n PropTypes.shape(CardsList.propTypes),\n PropTypes.shape(NewsList.propTypes),\n PropTypes.shape(StartBattle.propTypes),\n PropTypes.shape(ReviewBanner.propTypes)\n ])\n ),\n cookie: PropTypes.shape(CMPopin.propTypes),\n 'arrows-aria-label': CardsList.propTypes['arrows-aria-label'],\n popinWithCards: PropTypes.shape(CMPopin.propTypes)\n};\nexport default Dashboard;\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,KAAP,MAAkB,qBAAlB;AACA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,iBAAP,MAA8B,iDAA9B;AACA,OAAOC,SAAP,MAAsB,wCAAtB;AACA,OAAOC,QAAP,MAAqB,uCAArB;AACA,OAAOC,WAAP,MAAwB,0CAAxB;AACA,OAAOC,OAAP,MAAoB,4BAApB;AACA,OAAOC,YAAP,MAAyB,2CAAzB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,IAAI,gBAAGX,KAAK,CAACY,IAAN,CAAW,SAASD,IAAT,CAAc;EAACE,IAAD;EAAOC;AAAP,CAAd,EAA+B;EACrD,oBAAO;IAAK,SAAS,EAAEJ,KAAK,CAACG;EAAtB,GAA6BA,IAAI,gBAAG,oBAAC,QAAD,EAAcA,IAAd,CAAH,gBAA4B,oBAAC,KAAD,EAAWC,OAAX,CAA7D,CAAP;AACD,CAFY,CAAb;AAIAH,IAAI,CAACI,SAAL,2CAAiB;EACfF,IAAI,EAAEZ,SAAS,CAACe,KAAV,CAAgBb,QAAQ,CAACY,SAAzB,CADS;EAEfD,OAAO,EAAEb,SAAS,CAACe,KAAV,CAAgBd,KAAK,CAACa,SAAtB;AAFM,CAAjB;;AAKA,MAAME,SAAS,GAAGC,KAAK,IAAI;EACzB,MAAM;IACJC,QAAQ,GAAG,EADP;IAEJN,IAFI;IAGJC,OAHI;IAIJM,MAJI;IAKJC,cALI;IAMJ,qBAAqBC;EANjB,IAOFJ,KAPJ;;
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","Slide","HeroCard","BattleRequestList","CardsList","NewsList","StartBattle","CMPopin","ReviewBanner","style","Hero","memo","hero","welcome","propTypes","shape","Dashboard","props","sections","cookie","popinWithCards","showMoreOnLeftOrRightAriaLabel","buildSectionComponent","section","type","buildSection","index","sectionView","sectionsList","key","map","wrapper","arrayOf","oneOfType"],"sources":["../../../../src/template/common/dashboard/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Slide from '../../../atom/slide';\nimport HeroCard from '../../../molecule/hero';\nimport BattleRequestList from '../../../molecule/dashboard/battle-request-list';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport NewsList from '../../../molecule/dashboard/news-list';\nimport StartBattle from '../../../molecule/dashboard/start-battle';\nimport CMPopin from '../../../molecule/cm-popin';\nimport ReviewBanner from '../../../molecule/dashboard/review-banner';\nimport style from './style.css';\n\nconst Hero = React.memo(function Hero({hero, welcome}) {\n return <div className={style.hero}>{hero ? <HeroCard {...hero} /> : <Slide {...welcome} />}</div>;\n});\n\nHero.propTypes = {\n hero: PropTypes.shape(HeroCard.propTypes),\n welcome: PropTypes.shape(Slide.propTypes)\n};\n\nconst Dashboard = props => {\n const {\n sections = [],\n hero,\n welcome,\n cookie,\n popinWithCards,\n 'arrows-aria-label': showMoreOnLeftOrRightAriaLabel\n } = props;\n\n const buildSectionComponent = section => {\n const {type} = section;\n switch (type) {\n case 'hero':\n return <Hero hero={hero} welcome={welcome} />;\n case 'battleRequests':\n return <BattleRequestList {...section} />;\n case 'cards':\n return <CardsList {...section} arrows-aria-label={showMoreOnLeftOrRightAriaLabel} />;\n case 'news':\n return <NewsList {...section} />;\n case 'battle':\n return <StartBattle {...section} />;\n case 'review':\n return <ReviewBanner {...section} />;\n default:\n return null;\n }\n };\n\n const buildSection = (section, index) => {\n const sectionView = buildSectionComponent(section);\n\n return <div key={index}>{sectionView}</div>;\n };\n\n const sectionsList = [{type: 'hero', key: 'hero'}, ...sections].map(section => (\n <div key={section.key}>{buildSection(section)}</div>\n ));\n return (\n <div className={style.wrapper} data-name=\"dashboard\">\n {sectionsList}\n {cookie ? <CMPopin {...cookie} /> : null}\n {popinWithCards ? (\n <div className={style.popinWithCards}>\n <CMPopin {...popinWithCards} />\n </div>\n ) : null}\n </div>\n );\n};\n\nDashboard.propTypes = {\n hero: Hero.propTypes.hero,\n welcome: Hero.propTypes.welcome,\n sections: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape(BattleRequestList.propTypes),\n PropTypes.shape(CardsList.propTypes),\n PropTypes.shape(NewsList.propTypes),\n PropTypes.shape(StartBattle.propTypes),\n PropTypes.shape(ReviewBanner.propTypes)\n ])\n ),\n cookie: PropTypes.shape(CMPopin.propTypes),\n 'arrows-aria-label': CardsList.propTypes['arrows-aria-label'],\n popinWithCards: PropTypes.shape(CMPopin.propTypes)\n};\nexport default Dashboard;\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,KAAP,MAAkB,qBAAlB;AACA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,iBAAP,MAA8B,iDAA9B;AACA,OAAOC,SAAP,MAAsB,wCAAtB;AACA,OAAOC,QAAP,MAAqB,uCAArB;AACA,OAAOC,WAAP,MAAwB,0CAAxB;AACA,OAAOC,OAAP,MAAoB,4BAApB;AACA,OAAOC,YAAP,MAAyB,2CAAzB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,IAAI,gBAAGX,KAAK,CAACY,IAAN,CAAW,SAASD,IAAT,CAAc;EAACE,IAAD;EAAOC;AAAP,CAAd,EAA+B;EACrD,oBAAO;IAAK,SAAS,EAAEJ,KAAK,CAACG;EAAtB,GAA6BA,IAAI,gBAAG,oBAAC,QAAD,EAAcA,IAAd,CAAH,gBAA4B,oBAAC,KAAD,EAAWC,OAAX,CAA7D,CAAP;AACD,CAFY,CAAb;AAIAH,IAAI,CAACI,SAAL,2CAAiB;EACfF,IAAI,EAAEZ,SAAS,CAACe,KAAV,CAAgBb,QAAQ,CAACY,SAAzB,CADS;EAEfD,OAAO,EAAEb,SAAS,CAACe,KAAV,CAAgBd,KAAK,CAACa,SAAtB;AAFM,CAAjB;;AAKA,MAAME,SAAS,GAAGC,KAAK,IAAI;EACzB,MAAM;IACJC,QAAQ,GAAG,EADP;IAEJN,IAFI;IAGJC,OAHI;IAIJM,MAJI;IAKJC,cALI;IAMJ,qBAAqBC;EANjB,IAOFJ,KAPJ;;EASA,MAAMK,qBAAqB,GAAGC,OAAO,IAAI;IACvC,MAAM;MAACC;IAAD,IAASD,OAAf;;IACA,QAAQC,IAAR;MACE,KAAK,M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AEF,IAAI,CAACI,SAAL,CAAeF,IADD;EAEpBC,OAAO,EAAEH,IAAI,CAACI,SAAL,CAAeD,OAFJ;EAGpBK,QAAQ,EAAElB,SAAS,CAACgC,OAAV,CACRhC,SAAS,CAACiC,SAAV,CAAoB,CAClBjC,SAAS,CAACe,KAAV,CAAgBZ,iBAAiB,CAACW,SAAlC,CADkB,EAElBd,SAAS,CAACe,KAAV,CAAgBX,SAAS,CAACU,SAA1B,CAFkB,EAGlBd,SAAS,CAACe,KAAV,CAAgBV,QAAQ,CAACS,SAAzB,CAHkB,EAIlBd,SAAS,CAACe,KAAV,CAAgBT,WAAW,CAACQ,SAA5B,CAJkB,EAKlBd,SAAS,CAACe,KAAV,CAAgBP,YAAY,CAACM,SAA7B,CALkB,CAApB,CADQ,CAHU;EAYpBK,MAAM,EAAEnB,SAAS,CAACe,KAAV,CAAgBR,OAAO,CAACO,SAAxB,CAZY;EAapB,qBAAqBV,SAAS,CAACU,SAAV,CAAoB,mBAApB,CAbD;EAcpBM,cAAc,EAAEpB,SAAS,CAACe,KAAV,CAAgBR,OAAO,CAACO,SAAxB;AAdI,CAAtB;AAgBA,eAAeE,SAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/search-page/index.js"],"names":[],"mappings":";AAWA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/search-page/index.js"],"names":[],"mappings":";AAWA,mEA4DC"}
|
|
@@ -3,7 +3,7 @@ import _getOr from "lodash/fp/getOr";
|
|
|
3
3
|
|
|
4
4
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
5
|
|
|
6
|
-
import React
|
|
6
|
+
import React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import Provider from '../../../atom/provider';
|
|
9
9
|
import Button from '../../../atom/button';
|
|
@@ -33,7 +33,6 @@ const SearchPage = (props, context) => {
|
|
|
33
33
|
|
|
34
34
|
const defaultColor = _getOr('#00B0FF', 'common.primary', skin);
|
|
35
35
|
|
|
36
|
-
const nodeRef = useRef(null);
|
|
37
36
|
const recommendationsView = _isEmpty(recommendations) ? null : /*#__PURE__*/React.createElement(CardsList, recommendations);
|
|
38
37
|
const cardsView = _isEmpty(cards.list) ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
39
38
|
className: style.noresults
|
|
@@ -59,8 +58,7 @@ const SearchPage = (props, context) => {
|
|
|
59
58
|
className: style.title,
|
|
60
59
|
role: "status"
|
|
61
60
|
}, title), cardsView), popinWithCards ? /*#__PURE__*/React.createElement("div", {
|
|
62
|
-
className: style.popinWithCards
|
|
63
|
-
ref: nodeRef
|
|
61
|
+
className: style.popinWithCards
|
|
64
62
|
}, /*#__PURE__*/React.createElement(CMPopin, popinWithCards)) : null);
|
|
65
63
|
};
|
|
66
64
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","Provider","Button","Filters","CardsGrid","CardsList","CMPopin","style","SearchPage","props","context","title","searchFilters","cards","noresultsfound","clearFilters","recommendations","moreSortAriaLabel","moreFilterAriaLabel","filterGroupAriaLabel","sortAriaLabel","popinWithCards","skin","defaultColor","recommendationsView","cardsView","list","noresults","noresultstxt","clear","background","cardsWrapper","contextTypes","childContextTypes","propTypes","string","shape"],"sources":["../../../../src/template/common/search-page/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, isEmpty} from 'lodash/fp';\nimport Provider from '../../../atom/provider';\nimport Button from '../../../atom/button';\nimport Filters from '../../../molecule/filters';\nimport CardsGrid from '../../../organism/cards-grid';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport CMPopin from '../../../molecule/cm-popin';\nimport style from './style.css';\n\nconst SearchPage = (props, context) => {\n const {\n title,\n searchFilters,\n cards,\n noresultsfound,\n clearFilters,\n recommendations,\n moreSortAriaLabel,\n moreFilterAriaLabel,\n filterGroupAriaLabel,\n sortAriaLabel,\n popinWithCards\n } = props;\n\n const {skin} = context;\n const defaultColor = getOr('#00B0FF', 'common.primary', skin);\n\n const recommendationsView = isEmpty(recommendations) ? null : <CardsList {...recommendations} />;\n\n const cardsView = isEmpty(cards.list) ? (\n <div>\n <div className={style.noresults}>\n <div className={style.noresultstxt}>{noresultsfound}</div>\n <Button\n {...clearFilters}\n data-name=\"searchPageClear\"\n className={style.clear}\n style={{background: defaultColor}}\n type=\"link\"\n />\n </div>\n {recommendationsView}\n </div>\n ) : (\n <CardsGrid {...cards} />\n );\n\n return (\n <div>\n <Filters\n {...searchFilters}\n moreSortAriaLabel={moreSortAriaLabel}\n moreFilterAriaLabel={moreFilterAriaLabel}\n filterGroupAriaLabel={filterGroupAriaLabel}\n sortAriaLabel={sortAriaLabel}\n />\n <div data-name=\"searchResult\" className={style.cardsWrapper}>\n <div className={style.title} role=\"status\">\n {title}\n </div>\n {cardsView}\n </div>\n {popinWithCards ? (\n <div className={style.popinWithCards}>\n <CMPopin {...popinWithCards} />\n </div>\n ) : null}\n </div>\n );\n};\n\nSearchPage.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSearchPage.propTypes = {\n noresultsfound: PropTypes.string,\n title: PropTypes.string,\n searchFilters: PropTypes.shape(Filters.propTypes),\n cards: PropTypes.shape(CardsGrid.propTypes),\n clearFilters: PropTypes.shape(Button.propTypes),\n recommendations: PropTypes.shape(CardsList.propTypes),\n moreSortAriaLabel: PropTypes.string,\n moreFilterAriaLabel: PropTypes.string,\n filterGroupAriaLabel: PropTypes.string,\n sortAriaLabel: PropTypes.string,\n popinWithCards: PropTypes.shape(CMPopin.propTypes)\n};\n\nexport default SearchPage;\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|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/card/index.js"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/card/index.js"],"names":[],"mappings":";;;;;AAuPA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BE;;;AA9JF,uDA0HG"}
|
|
@@ -182,12 +182,8 @@ const Card = /*#__PURE__*/(0, _react.memo)(function Card(props, context) {
|
|
|
182
182
|
className: _style.default.lockIcon,
|
|
183
183
|
height: 48
|
|
184
184
|
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
185
|
-
"aria-label": disabledArialabel
|
|
186
|
-
|
|
187
|
-
dangerouslySetInnerHTML: {
|
|
188
|
-
__html: disabledContent
|
|
189
|
-
}
|
|
190
|
-
})) : null;
|
|
185
|
+
"aria-label": disabledArialabel
|
|
186
|
+
}, disabledContent)) : null;
|
|
191
187
|
const inlineBadgeStyle = {
|
|
192
188
|
color: primaryColor
|
|
193
189
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["THEMES","default","coorpmanager","style","CardBackground","type","image","empty","ariaLabel","skin","externalContent","isExternalContent","primaryColor","whiteColor","EXTERNAL_CONTENT_ICONS","IconType","icon","iconColor","color","backgroundIcon","externalIconCircleWrapper","externalIcon","_backgroundIcon","classnames","externalIconCircleWithImageWrapper","backgroundColor","externalIconWithImage","imageWrapper","backgroundImage","externalContentHeader","externalBackground","emptyIcon","chapterImageWrapper","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","bool","Card","memo","props","context","badge","adaptiv","disabled","hidden","title","author","customer","certifiedAuthor","progress","favorite","addFavoriteToolTip","removeFavoriteToolTip","onClick","onFavoriteClick","isSelected","notification","badgeCategory","badgeLabel","theme","disabledContent","cardArialabel","backgroundAriaLabel","favoriteAriaLabel","selectableAriaLabel","customerAriaLabel","badgeAriaLabel","disabledArialabel","cardContentLabelAriaLabel","cardStyle","chapter","course","lazy","grid","handleClick","useMemo","e","lock","lockContent","lockIcon","__html","inlineBadgeStyle","getType","contentType","MODES","CARD","lockWrapper","cardPropTypes","shape","Customer","number","func","Notification","CardContentInfo","oneOf","Favorite","Selectable"],"sources":["../../../src/molecule/card/index.js"],"sourcesContent":["import React, {useMemo, memo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {get, isEmpty, isUndefined, pick, keys} from 'lodash/fp';\nimport {\n NovaCompositionCoorpacademyPadlock as LockIcon,\n NovaCompositionCoorpacademyPictures as PicturesIcon\n} from '@coorpacademy/nova-icons';\nimport {isExternalContent, EXTERNAL_CONTENT_ICONS} from '../../util/external-content';\nimport Provider from '../../atom/provider';\nimport CardContentInfo, {MODES} from '../card-content';\nimport Customer from './customer';\nimport Favorite from './favorite';\nimport Selectable from './selectable';\nimport Notification from './notification';\nimport style from './style.css';\n\nexport const THEMES = {\n default: null,\n coorpmanager: style.coorpmanager\n};\n\nconst CardBackground = ({type, image, empty, 'aria-label': ariaLabel}, {skin}) => {\n const externalContent = isExternalContent(type);\n const primaryColor = get('common.primary', skin);\n const whiteColor = get('common.white', skin);\n\n if (externalContent && EXTERNAL_CONTENT_ICONS[type]) {\n const IconType = EXTERNAL_CONTENT_ICONS[type].icon;\n const iconColor = EXTERNAL_CONTENT_ICONS[type].color;\n const backgroundIcon = (\n <div className={style.externalIconCircleWrapper}>\n <IconType className={style.externalIcon} />\n </div>\n );\n\n if (image) {\n const _backgroundIcon = (\n <div\n className={classnames(\n style.externalIconCircleWrapper,\n style.externalIconCircleWithImageWrapper\n )}\n style={{\n backgroundColor: iconColor\n }}\n >\n <IconType className={style.externalIconWithImage} />\n </div>\n );\n\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n style={{\n backgroundColor: iconColor,\n backgroundImage: `url('${image}')`\n }}\n className={classnames(style.externalContentHeader, style.externalBackground)}\n >\n {_backgroundIcon}\n </div>\n </div>\n );\n }\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n style={{\n backgroundColor: iconColor\n }}\n className={style.externalContentHeader}\n >\n {backgroundIcon}\n </div>\n </div>\n );\n }\n\n const emptyIcon = empty ? (\n <PicturesIcon className={style.emptyIcon} style={{color: whiteColor}} />\n ) : null;\n return (\n <div\n className={classnames(\n style.imageWrapper,\n type === 'chapter' ? style.chapterImageWrapper : null\n )}\n >\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n className={style.image}\n style={{\n backgroundColor: primaryColor,\n backgroundImage: image ? `url('${image}')` : 'none'\n }}\n >\n {emptyIcon}\n </div>\n </div>\n );\n};\n\nCardBackground.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nCardBackground.propTypes = {\n type: PropTypes.string,\n image: PropTypes.string,\n empty: PropTypes.bool,\n 'aria-label': PropTypes.string\n};\n\nconst Card = memo(function Card(props, context) {\n const {skin} = context;\n const {\n image,\n badge,\n adaptiv,\n disabled: hidden = false,\n type = 'course',\n title,\n author,\n customer,\n certifiedAuthor,\n progress,\n favorite,\n addFavoriteToolTip,\n removeFavoriteToolTip,\n onClick,\n onFavoriteClick,\n isSelected,\n notification,\n badgeCategory,\n badgeLabel,\n theme = 'default',\n disabledContent,\n 'aria-label': cardArialabel,\n 'background-aria-label': backgroundAriaLabel,\n 'favorite-aria-label': favoriteAriaLabel,\n 'selectable-aria-label': selectableAriaLabel,\n 'customer-aria-label': customerAriaLabel,\n 'badge-aria-label': badgeAriaLabel,\n 'disabled-aria-label': disabledArialabel,\n 'card-content-aria-label': cardContentLabelAriaLabel\n } = props;\n const empty = isEmpty(pick(['title', 'type', 'author', 'image'], props));\n const primaryColor = get('common.primary', skin);\n const cardStyle = classnames(\n THEMES[theme],\n type === 'chapter' ? style.chapter : style.course,\n title ? null : style.lazy,\n style.grid,\n empty ? style.empty : null\n );\n const disabled = hidden && (!isSelected || isUndefined(isSelected));\n const handleClick = useMemo(() => e => onClick(e), [onClick]);\n const lock = disabled ? (\n <div className={style.lockContent}>\n <LockIcon className={style.lockIcon} height={48} />\n <span\n aria-label={disabledArialabel}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: disabledContent}}\n />\n </div>\n ) : null;\n const inlineBadgeStyle = {color: primaryColor};\n const getType = contentType => {\n switch (contentType) {\n case 'chapter':\n return 'microlearning';\n case 'course':\n return 'learner';\n default:\n return contentType;\n }\n };\n\n return (\n <div\n className={cardStyle}\n data-name=\"card\"\n data-lock={disabled}\n data-type={getType(type)}\n disabled={disabled}\n onClick={handleClick}\n aria-label={cardArialabel}\n >\n <CardBackground type={type} image={image} empty={empty} aria-label={backgroundAriaLabel} />\n {isUndefined(isSelected) && !isUndefined(favorite) ? (\n <Favorite\n className={style.favorite}\n favorite={favorite}\n disabled={disabled}\n onFavoriteClick={onFavoriteClick}\n addFavoriteToolTip={addFavoriteToolTip}\n removeFavoriteToolTip={removeFavoriteToolTip}\n aria-label={favoriteAriaLabel}\n />\n ) : null}\n <Selectable isSelected={isSelected} hidden={hidden} aria-label={selectableAriaLabel} />\n {notification ? <Notification {...notification} /> : null}\n {customer ? (\n <Customer\n {...customer}\n theme={theme}\n type={type}\n disabled={disabled}\n aria-label={customerAriaLabel}\n />\n ) : null}\n <CardContentInfo\n mode={MODES.CARD}\n adaptiv={adaptiv}\n author={author}\n certifiedAuthor={certifiedAuthor}\n disabled={disabled}\n empty={empty}\n progress={progress}\n title={title}\n type={type}\n badgeCategory={badgeCategory}\n badgeLabel={badgeLabel}\n theme={theme}\n aria-label={cardContentLabelAriaLabel}\n />\n {badge ? (\n <div className={style.badge} style={inlineBadgeStyle} aria-label={badgeAriaLabel}>\n {badge}\n </div>\n ) : null}\n {disabled ? (\n <div className={style.lockWrapper} aria-label={disabledArialabel}>\n {lock}\n </div>\n ) : null}\n </div>\n );\n});\n\nCard.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nexport const cardPropTypes = {\n badge: PropTypes.string,\n image: PropTypes.string,\n disabled: PropTypes.bool,\n adaptiv: PropTypes.bool,\n type: PropTypes.string,\n title: PropTypes.string,\n author: PropTypes.string,\n certifiedAuthor: PropTypes.bool,\n customer: PropTypes.shape(Customer.propTypes),\n progress: PropTypes.number,\n favorite: PropTypes.bool,\n addFavoriteToolTip: PropTypes.string,\n removeFavoriteToolTip: PropTypes.string,\n onClick: PropTypes.func,\n onFavoriteClick: PropTypes.func,\n isSelected: PropTypes.bool,\n notification: PropTypes.shape(Notification.propTypes),\n badgeCategory: CardContentInfo.propTypes.badgeCategory,\n badgeLabel: CardContentInfo.propTypes.badgeLabel,\n theme: PropTypes.oneOf(keys(THEMES)),\n disabledContent: PropTypes.string,\n 'aria-label': PropTypes.string,\n 'background-aria-label': PropTypes.string,\n 'favorite-aria-label': Favorite.propTypes['aria-label'],\n 'selectable-aria-label': Selectable.propTypes['aria-label'],\n 'customer-aria-label': Customer.propTypes['aria-label'],\n 'badge-aria-label': PropTypes.string,\n 'disabled-aria-label': PropTypes.string,\n 'card-content-aria-label': CardContentInfo.propTypes['aria-label']\n};\n\nCard.propTypes = cardPropTypes;\n\nexport default Card;\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEO,MAAMA,MAAM,GAAG;EACpBC,OAAO,EAAE,IADW;EAEpBC,YAAY,EAAEC,cAAA,CAAMD;AAFA,CAAf;;;AAKP,MAAME,cAAc,GAAG,CAAC;EAACC,IAAD;EAAOC,KAAP;EAAcC,KAAd;EAAqB,cAAcC;AAAnC,CAAD,EAAgD;EAACC;AAAD,CAAhD,KAA2D;EAChF,MAAMC,eAAe,GAAG,IAAAC,kCAAA,EAAkBN,IAAlB,CAAxB;EACA,MAAMO,YAAY,GAAG,mBAAI,gBAAJ,EAAsBH,IAAtB,CAArB;EACA,M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alContent","isExternalContent","primaryColor","whiteColor","EXTERNAL_CONTENT_ICONS","IconType","icon","iconColor","color","backgroundIcon","externalIconCircleWrapper","externalIcon","_backgroundIcon","classnames","externalIconCircleWithImageWrapper","backgroundColor","externalIconWithImage","imageWrapper","backgroundImage","externalContentHeader","externalBackground","emptyIcon","chapterImageWrapper","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","bool","Card","memo","props","context","badge","adaptiv","disabled","hidden","title","author","customer","certifiedAuthor","progress","favorite","addFavoriteToolTip","removeFavoriteToolTip","onClick","onFavoriteClick","isSelected","notification","badgeCategory","badgeLabel","theme","disabledContent","cardArialabel","backgroundAriaLabel","favoriteAriaLabel","selectableAriaLabel","customerAriaLabel","badgeAriaLabel","disabledArialabel","cardContentLabelAriaLabel","cardStyle","chapter","course","lazy","grid","handleClick","useMemo","e","lock","lockContent","lockIcon","inlineBadgeStyle","getType","contentType","MODES","CARD","lockWrapper","cardPropTypes","shape","Customer","number","func","Notification","CardContentInfo","oneOf","Favorite","Selectable"],"sources":["../../../src/molecule/card/index.js"],"sourcesContent":["import React, {useMemo, memo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {get, isEmpty, isUndefined, pick, keys} from 'lodash/fp';\nimport {\n NovaCompositionCoorpacademyPadlock as LockIcon,\n NovaCompositionCoorpacademyPictures as PicturesIcon\n} from '@coorpacademy/nova-icons';\nimport {isExternalContent, EXTERNAL_CONTENT_ICONS} from '../../util/external-content';\nimport Provider from '../../atom/provider';\nimport CardContentInfo, {MODES} from '../card-content';\nimport Customer from './customer';\nimport Favorite from './favorite';\nimport Selectable from './selectable';\nimport Notification from './notification';\nimport style from './style.css';\n\nexport const THEMES = {\n default: null,\n coorpmanager: style.coorpmanager\n};\n\nconst CardBackground = ({type, image, empty, 'aria-label': ariaLabel}, {skin}) => {\n const externalContent = isExternalContent(type);\n const primaryColor = get('common.primary', skin);\n const whiteColor = get('common.white', skin);\n\n if (externalContent && EXTERNAL_CONTENT_ICONS[type]) {\n const IconType = EXTERNAL_CONTENT_ICONS[type].icon;\n const iconColor = EXTERNAL_CONTENT_ICONS[type].color;\n const backgroundIcon = (\n <div className={style.externalIconCircleWrapper}>\n <IconType className={style.externalIcon} />\n </div>\n );\n\n if (image) {\n const _backgroundIcon = (\n <div\n className={classnames(\n style.externalIconCircleWrapper,\n style.externalIconCircleWithImageWrapper\n )}\n style={{\n backgroundColor: iconColor\n }}\n >\n <IconType className={style.externalIconWithImage} />\n </div>\n );\n\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n style={{\n backgroundColor: iconColor,\n backgroundImage: `url('${image}')`\n }}\n className={classnames(style.externalContentHeader, style.externalBackground)}\n >\n {_backgroundIcon}\n </div>\n </div>\n );\n }\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n style={{\n backgroundColor: iconColor\n }}\n className={style.externalContentHeader}\n >\n {backgroundIcon}\n </div>\n </div>\n );\n }\n\n const emptyIcon = empty ? (\n <PicturesIcon className={style.emptyIcon} style={{color: whiteColor}} />\n ) : null;\n return (\n <div\n className={classnames(\n style.imageWrapper,\n type === 'chapter' ? style.chapterImageWrapper : null\n )}\n >\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n className={style.image}\n style={{\n backgroundColor: primaryColor,\n backgroundImage: image ? `url('${image}')` : 'none'\n }}\n >\n {emptyIcon}\n </div>\n </div>\n );\n};\n\nCardBackground.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nCardBackground.propTypes = {\n type: PropTypes.string,\n image: PropTypes.string,\n empty: PropTypes.bool,\n 'aria-label': PropTypes.string\n};\n\nconst Card = memo(function Card(props, context) {\n const {skin} = context;\n const {\n image,\n badge,\n adaptiv,\n disabled: hidden = false,\n type = 'course',\n title,\n author,\n customer,\n certifiedAuthor,\n progress,\n favorite,\n addFavoriteToolTip,\n removeFavoriteToolTip,\n onClick,\n onFavoriteClick,\n isSelected,\n notification,\n badgeCategory,\n badgeLabel,\n theme = 'default',\n disabledContent,\n 'aria-label': cardArialabel,\n 'background-aria-label': backgroundAriaLabel,\n 'favorite-aria-label': favoriteAriaLabel,\n 'selectable-aria-label': selectableAriaLabel,\n 'customer-aria-label': customerAriaLabel,\n 'badge-aria-label': badgeAriaLabel,\n 'disabled-aria-label': disabledArialabel,\n 'card-content-aria-label': cardContentLabelAriaLabel\n } = props;\n const empty = isEmpty(pick(['title', 'type', 'author', 'image'], props));\n const primaryColor = get('common.primary', skin);\n const cardStyle = classnames(\n THEMES[theme],\n type === 'chapter' ? style.chapter : style.course,\n title ? null : style.lazy,\n style.grid,\n empty ? style.empty : null\n );\n const disabled = hidden && (!isSelected || isUndefined(isSelected));\n const handleClick = useMemo(() => e => onClick(e), [onClick]);\n const lock = disabled ? (\n <div className={style.lockContent}>\n <LockIcon className={style.lockIcon} height={48} />\n <span aria-label={disabledArialabel}>{disabledContent}</span>\n </div>\n ) : null;\n const inlineBadgeStyle = {color: primaryColor};\n const getType = contentType => {\n switch (contentType) {\n case 'chapter':\n return 'microlearning';\n case 'course':\n return 'learner';\n default:\n return contentType;\n }\n };\n\n return (\n <div\n className={cardStyle}\n data-name=\"card\"\n data-lock={disabled}\n data-type={getType(type)}\n disabled={disabled}\n onClick={handleClick}\n aria-label={cardArialabel}\n >\n <CardBackground type={type} image={image} empty={empty} aria-label={backgroundAriaLabel} />\n {isUndefined(isSelected) && !isUndefined(favorite) ? (\n <Favorite\n className={style.favorite}\n favorite={favorite}\n disabled={disabled}\n onFavoriteClick={onFavoriteClick}\n addFavoriteToolTip={addFavoriteToolTip}\n removeFavoriteToolTip={removeFavoriteToolTip}\n aria-label={favoriteAriaLabel}\n />\n ) : null}\n <Selectable isSelected={isSelected} hidden={hidden} aria-label={selectableAriaLabel} />\n {notification ? <Notification {...notification} /> : null}\n {customer ? (\n <Customer\n {...customer}\n theme={theme}\n type={type}\n disabled={disabled}\n aria-label={customerAriaLabel}\n />\n ) : null}\n <CardContentInfo\n mode={MODES.CARD}\n adaptiv={adaptiv}\n author={author}\n certifiedAuthor={certifiedAuthor}\n disabled={disabled}\n empty={empty}\n progress={progress}\n title={title}\n type={type}\n badgeCategory={badgeCategory}\n badgeLabel={badgeLabel}\n theme={theme}\n aria-label={cardContentLabelAriaLabel}\n />\n {badge ? (\n <div className={style.badge} style={inlineBadgeStyle} aria-label={badgeAriaLabel}>\n {badge}\n </div>\n ) : null}\n {disabled ? (\n <div className={style.lockWrapper} aria-label={disabledArialabel}>\n {lock}\n </div>\n ) : null}\n </div>\n );\n});\n\nCard.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nexport const cardPropTypes = {\n badge: PropTypes.string,\n image: PropTypes.string,\n disabled: PropTypes.bool,\n adaptiv: PropTypes.bool,\n type: PropTypes.string,\n title: PropTypes.string,\n author: PropTypes.string,\n certifiedAuthor: PropTypes.bool,\n customer: PropTypes.shape(Customer.propTypes),\n progress: PropTypes.number,\n favorite: PropTypes.bool,\n addFavoriteToolTip: PropTypes.string,\n removeFavoriteToolTip: PropTypes.string,\n onClick: PropTypes.func,\n onFavoriteClick: PropTypes.func,\n isSelected: PropTypes.bool,\n notification: PropTypes.shape(Notification.propTypes),\n badgeCategory: CardContentInfo.propTypes.badgeCategory,\n badgeLabel: CardContentInfo.propTypes.badgeLabel,\n theme: PropTypes.oneOf(keys(THEMES)),\n disabledContent: PropTypes.string,\n 'aria-label': PropTypes.string,\n 'background-aria-label': PropTypes.string,\n 'favorite-aria-label': Favorite.propTypes['aria-label'],\n 'selectable-aria-label': Selectable.propTypes['aria-label'],\n 'customer-aria-label': Customer.propTypes['aria-label'],\n 'badge-aria-label': PropTypes.string,\n 'disabled-aria-label': PropTypes.string,\n 'card-content-aria-label': CardContentInfo.propTypes['aria-label']\n};\n\nCard.propTypes = cardPropTypes;\n\nexport default Card;\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAIA;;AACA;;AACA;;AACA;;AACA;;A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uBuD,iBAAA,CAASvD,SAAT,CAAmB,YAAnB,CA1BI;EA2B3B,oBAAoBC,kBAAA,CAAUC,MA3BH;EA4B3B,uBAAuBD,kBAAA,CAAUC,MA5BN;EA6B3B,2BAA2ByD,oBAAA,CAAgB3D,SAAhB,CAA0B,YAA1B;AA7BA,CAAtB;;AAgCPI,IAAI,CAACJ,SAAL,2CAAiBqD,aAAjB;eAEejD,I"}
|
|
@@ -206,7 +206,7 @@
|
|
|
206
206
|
|
|
207
207
|
.lockWrapper:hover span {
|
|
208
208
|
font-weight: 600;
|
|
209
|
-
width:
|
|
209
|
+
width: 150px;
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
.lockContent {
|
|
@@ -217,7 +217,7 @@
|
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
.lockContent span {
|
|
220
|
-
width:
|
|
220
|
+
width: 134px;
|
|
221
221
|
height: 40px;
|
|
222
222
|
color: white;
|
|
223
223
|
text-align: center;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/index.js"],"names":[],"mappings":";AA+BA,kDAwOC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.default = void 0;
|
|
5
5
|
|
|
6
|
-
var _react =
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
7
|
|
|
8
8
|
var _novaIcons = require("@coorpacademy/nova-icons");
|
|
9
9
|
|
|
@@ -31,11 +31,6 @@ var _types = _interopRequireDefault(require("./types"));
|
|
|
31
31
|
|
|
32
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
33
|
|
|
34
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
35
|
-
|
|
36
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
37
|
-
|
|
38
|
-
// import React from 'react';
|
|
39
34
|
const IconType = {
|
|
40
35
|
lockedContent: /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademyPadlock, {
|
|
41
36
|
className: _style.default.lockIcon
|
|
@@ -75,21 +70,6 @@ const CMPopin = props => {
|
|
|
75
70
|
backgroundImage: `url(${backgroundImageUrl})`,
|
|
76
71
|
backgroundSize: 'cover'
|
|
77
72
|
} : null;
|
|
78
|
-
const nodeRef = (0, _react.useRef)(null);
|
|
79
|
-
(0, _react.useEffect)(() => {
|
|
80
|
-
if (mode === 'items') {
|
|
81
|
-
const closePopin = e => {
|
|
82
|
-
if (nodeRef && nodeRef.current && !nodeRef.current.contains(e.target)) {
|
|
83
|
-
onClose();
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
document.addEventListener('click', closePopin);
|
|
88
|
-
return () => {
|
|
89
|
-
document.removeEventListener('click', closePopin);
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
}, [mode, onClose]);
|
|
93
73
|
|
|
94
74
|
const renderHeader = () => {
|
|
95
75
|
if (header) {
|
|
@@ -184,14 +164,13 @@ const CMPopin = props => {
|
|
|
184
164
|
return null;
|
|
185
165
|
};
|
|
186
166
|
|
|
187
|
-
const wrapperPopinStyle = (0, _classnames.default)(mode === 'cookie' && _style.default.popinCookie, mode === 'list' && _style.default.popinFilesList,
|
|
167
|
+
const wrapperPopinStyle = (0, _classnames.default)(mode === 'cookie' && _style.default.popinCookie, mode === 'list' && _style.default.popinFilesList, _style.default.popin);
|
|
188
168
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
189
169
|
className: mode !== 'cookie' ? _style.default.background : null,
|
|
190
170
|
style: backgroundImageStyle,
|
|
191
171
|
"data-name": 'cm-popin-container'
|
|
192
172
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
193
|
-
className: wrapperPopinStyle
|
|
194
|
-
ref: nodeRef
|
|
173
|
+
className: wrapperPopinStyle
|
|
195
174
|
}, /*#__PURE__*/_react.default.createElement("header", {
|
|
196
175
|
className: _style.default.popinHeader
|
|
197
176
|
}, renderHeader(), onClose ? /*#__PURE__*/_react.default.createElement(_buttonLinkIconOnly.default, {
|