@coorpacademy/components 11.32.18 → 11.32.20-alpha.31
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/circular-progress-bar/index.d.ts +15 -0
- package/es/atom/circular-progress-bar/index.d.ts.map +1 -0
- package/es/atom/circular-progress-bar/index.js +86 -0
- package/es/atom/circular-progress-bar/index.js.map +1 -0
- package/es/atom/circular-progress-bar/style.css +51 -0
- package/es/atom/circular-progress-bar/types.d.ts +18 -0
- package/es/atom/circular-progress-bar/types.d.ts.map +1 -0
- package/es/atom/circular-progress-bar/types.js +10 -0
- package/es/atom/circular-progress-bar/types.js.map +1 -0
- package/es/atom/radio-with-title/index.d.ts +6 -0
- package/es/atom/radio-with-title/index.d.ts.map +1 -1
- package/es/atom/radio-with-title/types.d.ts +6 -0
- package/es/atom/radio-with-title/types.d.ts.map +1 -1
- package/es/atom/tag/index.d.ts +6 -1
- package/es/atom/tag/index.d.ts.map +1 -1
- package/es/atom/tag/index.js +16 -11
- package/es/atom/tag/index.js.map +1 -1
- package/es/atom/tag/style.css +39 -19
- package/es/atom/title/index.d.ts +6 -0
- package/es/atom/title/index.d.ts.map +1 -1
- package/es/atom/title/index.js +16 -4
- package/es/atom/title/index.js.map +1 -1
- package/es/atom/title/style.css +13 -0
- package/es/molecule/cm-popin/types.d.ts +6 -0
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/dashboard/cards-list/index.d.ts.map +1 -1
- package/es/molecule/dashboard/cards-list/index.js +22 -25
- package/es/molecule/dashboard/cards-list/index.js.map +1 -1
- package/es/molecule/dashboard/cards-list/style.css +12 -29
- package/es/molecule/learning-priority-card/index.d.ts +41 -0
- package/es/molecule/learning-priority-card/index.d.ts.map +1 -0
- package/es/molecule/learning-priority-card/index.js +80 -0
- package/es/molecule/learning-priority-card/index.js.map +1 -0
- package/es/molecule/learning-priority-card/style.css +36 -0
- package/es/molecule/learning-priority-card/types.d.ts +20 -0
- package/es/molecule/learning-priority-card/types.d.ts.map +1 -0
- package/es/molecule/learning-priority-card/types.js +11 -0
- package/es/molecule/learning-priority-card/types.js.map +1 -0
- package/es/molecule/title-and-checkbox-wrapper/index.d.ts +6 -0
- package/es/molecule/title-radio-wrapper/index.d.ts +6 -0
- package/es/molecule/title-radio-wrapper/index.d.ts.map +1 -1
- package/es/molecule/title-radio-wrapper/types.d.ts +6 -0
- package/es/molecule/title-radio-wrapper/types.d.ts.map +1 -1
- package/es/organism/rewards-form/index.d.ts +6 -0
- package/es/organism/select-opponents/index.d.ts +6 -0
- package/es/organism/select-opponents/index.d.ts.map +1 -1
- package/es/organism/select-opponents/types.d.ts +6 -0
- package/es/organism/select-opponents/types.d.ts.map +1 -1
- package/es/organism/title-and-input/index.d.ts +12 -0
- package/es/organism/title-and-input/index.d.ts.map +1 -1
- package/es/organism/title-and-input/types.d.ts +12 -0
- package/es/organism/title-and-input/types.d.ts.map +1 -1
- package/es/organism/wizard-contents/index.d.ts +6 -0
- package/es/template/app-player/loading/index.d.ts +6 -0
- package/es/template/app-player/player/index.d.ts +12 -0
- package/es/template/app-player/player/slides/index.d.ts +6 -0
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +6 -0
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +6 -0
- package/es/template/app-review/index.d.ts +6 -0
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +6 -0
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.d.ts +6 -0
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +6 -0
- package/es/template/common/dashboard/index.d.ts +12 -0
- package/es/template/common/search-page/index.d.ts +6 -0
- package/es/template/external-course/index.d.ts +6 -0
- package/es/template/my-learning/index.d.ts +68 -0
- package/es/template/my-learning/index.d.ts.map +1 -1
- package/es/template/my-learning/index.js +12 -2
- package/es/template/my-learning/index.js.map +1 -1
- package/es/template/my-learning/style.css +18 -3
- package/es/template/skill-detail/all-courses.css +6 -1
- package/es/template/skill-detail/continue-learning.d.ts.map +1 -1
- package/es/template/skill-detail/continue-learning.js +3 -1
- package/es/template/skill-detail/continue-learning.js.map +1 -1
- package/es/template/skill-detail/index.js +1 -1
- package/es/template/skill-detail/index.js.map +1 -1
- package/lib/atom/circular-progress-bar/index.d.ts +15 -0
- package/lib/atom/circular-progress-bar/index.d.ts.map +1 -0
- package/lib/atom/circular-progress-bar/index.js +101 -0
- package/lib/atom/circular-progress-bar/index.js.map +1 -0
- package/lib/atom/circular-progress-bar/style.css +51 -0
- package/lib/atom/circular-progress-bar/types.d.ts +18 -0
- package/lib/atom/circular-progress-bar/types.d.ts.map +1 -0
- package/lib/atom/circular-progress-bar/types.js +19 -0
- package/lib/atom/circular-progress-bar/types.js.map +1 -0
- package/lib/atom/radio-with-title/index.d.ts +6 -0
- package/lib/atom/radio-with-title/index.d.ts.map +1 -1
- package/lib/atom/radio-with-title/types.d.ts +6 -0
- package/lib/atom/radio-with-title/types.d.ts.map +1 -1
- package/lib/atom/tag/index.d.ts +6 -1
- package/lib/atom/tag/index.d.ts.map +1 -1
- package/lib/atom/tag/index.js +17 -11
- package/lib/atom/tag/index.js.map +1 -1
- package/lib/atom/tag/style.css +39 -19
- package/lib/atom/title/index.d.ts +6 -0
- package/lib/atom/title/index.d.ts.map +1 -1
- package/lib/atom/title/index.js +18 -4
- package/lib/atom/title/index.js.map +1 -1
- package/lib/atom/title/style.css +13 -0
- package/lib/molecule/cm-popin/types.d.ts +6 -0
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/dashboard/cards-list/index.d.ts.map +1 -1
- package/lib/molecule/dashboard/cards-list/index.js +23 -25
- package/lib/molecule/dashboard/cards-list/index.js.map +1 -1
- package/lib/molecule/dashboard/cards-list/style.css +12 -29
- package/lib/molecule/learning-priority-card/index.d.ts +41 -0
- package/lib/molecule/learning-priority-card/index.d.ts.map +1 -0
- package/lib/molecule/learning-priority-card/index.js +98 -0
- package/lib/molecule/learning-priority-card/index.js.map +1 -0
- package/lib/molecule/learning-priority-card/style.css +36 -0
- package/lib/molecule/learning-priority-card/types.d.ts +20 -0
- package/lib/molecule/learning-priority-card/types.d.ts.map +1 -0
- package/lib/molecule/learning-priority-card/types.js +20 -0
- package/lib/molecule/learning-priority-card/types.js.map +1 -0
- package/lib/molecule/title-and-checkbox-wrapper/index.d.ts +6 -0
- package/lib/molecule/title-radio-wrapper/index.d.ts +6 -0
- package/lib/molecule/title-radio-wrapper/index.d.ts.map +1 -1
- package/lib/molecule/title-radio-wrapper/types.d.ts +6 -0
- package/lib/molecule/title-radio-wrapper/types.d.ts.map +1 -1
- package/lib/organism/rewards-form/index.d.ts +6 -0
- package/lib/organism/select-opponents/index.d.ts +6 -0
- package/lib/organism/select-opponents/index.d.ts.map +1 -1
- package/lib/organism/select-opponents/types.d.ts +6 -0
- package/lib/organism/select-opponents/types.d.ts.map +1 -1
- package/lib/organism/title-and-input/index.d.ts +12 -0
- package/lib/organism/title-and-input/index.d.ts.map +1 -1
- package/lib/organism/title-and-input/types.d.ts +12 -0
- package/lib/organism/title-and-input/types.d.ts.map +1 -1
- package/lib/organism/wizard-contents/index.d.ts +6 -0
- package/lib/template/app-player/loading/index.d.ts +6 -0
- package/lib/template/app-player/player/index.d.ts +12 -0
- package/lib/template/app-player/player/slides/index.d.ts +6 -0
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +6 -0
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +6 -0
- package/lib/template/app-review/index.d.ts +6 -0
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +6 -0
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.d.ts +6 -0
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +6 -0
- package/lib/template/common/dashboard/index.d.ts +12 -0
- package/lib/template/common/search-page/index.d.ts +6 -0
- package/lib/template/external-course/index.d.ts +6 -0
- package/lib/template/my-learning/index.d.ts +68 -0
- package/lib/template/my-learning/index.d.ts.map +1 -1
- package/lib/template/my-learning/index.js +12 -2
- package/lib/template/my-learning/index.js.map +1 -1
- package/lib/template/my-learning/style.css +18 -3
- package/lib/template/skill-detail/all-courses.css +6 -1
- package/lib/template/skill-detail/continue-learning.d.ts.map +1 -1
- package/lib/template/skill-detail/continue-learning.js +7 -3
- package/lib/template/skill-detail/continue-learning.js.map +1 -1
- package/lib/template/skill-detail/index.js +1 -1
- package/lib/template/skill-detail/index.js.map +1 -1
- package/locales/bs/global.json +1 -0
- package/locales/cs/global.json +1 -0
- package/locales/de/global.json +1 -0
- package/locales/en/global.json +1 -0
- package/locales/es/global.json +1 -0
- package/locales/et/global.json +1 -0
- package/locales/fi/global.json +1 -0
- package/locales/fr/global.json +1 -0
- package/locales/hr/global.json +1 -0
- package/locales/hu/global.json +1 -0
- package/locales/hy/global.json +1 -0
- package/locales/it/global.json +1 -0
- package/locales/ja/global.json +1 -0
- package/locales/ko/global.json +1 -0
- package/locales/nl/global.json +1 -0
- package/locales/pl/global.json +1 -0
- package/locales/pt/global.json +1 -0
- package/locales/ro/global.json +1 -0
- package/locales/ru/global.json +1 -0
- package/locales/sk/global.json +1 -0
- package/locales/sl/global.json +1 -0
- package/locales/sv/global.json +1 -0
- package/locales/tl/global.json +1 -0
- package/locales/tr/global.json +1 -0
- package/locales/uk/global.json +1 -0
- package/locales/vi/global.json +1 -0
- package/locales/zh/global.json +1 -0
- package/locales/zh_TW/global.json +1 -0
- package/package.json +2 -2
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
@value tablet from breakpoints;
|
|
4
4
|
@value mobile from breakpoints;
|
|
5
5
|
@value white from colors;
|
|
6
|
+
@value cm_grey_50 from colors;
|
|
6
7
|
@value cm_grey_100 from colors;
|
|
7
8
|
@value cm_grey_500 from colors;
|
|
8
9
|
|
|
@@ -10,12 +11,11 @@
|
|
|
10
11
|
background-color: white;
|
|
11
12
|
min-height: 100%;
|
|
12
13
|
width: 100%;
|
|
14
|
+
font-family: "Gilroy";
|
|
15
|
+
font-style: normal;
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
.container {
|
|
16
|
-
background-color: white;
|
|
17
|
-
font-family: "Gilroy";
|
|
18
|
-
font-style: normal;
|
|
19
19
|
margin-top: 48px;
|
|
20
20
|
margin-bottom: 48px;
|
|
21
21
|
margin-left: auto;
|
|
@@ -28,10 +28,21 @@
|
|
|
28
28
|
max-width: calc(1080px + 32px);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
.cardsListContainer {
|
|
32
|
+
background-color: cm_grey_50;
|
|
33
|
+
padding: 48px 0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* to ecrase wrapper's style from CardsList component */
|
|
37
|
+
.cardsListContainer > :first-child {
|
|
38
|
+
padding: 0;
|
|
39
|
+
}
|
|
40
|
+
|
|
31
41
|
.skillFocusContainer {
|
|
32
42
|
border-radius: 16px;
|
|
33
43
|
border: 1px solid cm_grey_100;
|
|
34
44
|
overflow: hidden;
|
|
45
|
+
margin-top: 48px;
|
|
35
46
|
margin-bottom: 40px;
|
|
36
47
|
}
|
|
37
48
|
|
|
@@ -272,4 +283,8 @@
|
|
|
272
283
|
.skillFocusContent {
|
|
273
284
|
flex-direction: column;
|
|
274
285
|
}
|
|
286
|
+
|
|
287
|
+
.cardsListContainer {
|
|
288
|
+
padding: 24px 16px;
|
|
289
|
+
}
|
|
275
290
|
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
@value cm_grey_100 from colors;
|
|
7
7
|
@value cm_grey_200 from colors;
|
|
8
8
|
@value cm_grey_400 from colors;
|
|
9
|
+
@value cm_grey_500 from colors;
|
|
9
10
|
|
|
10
11
|
.continueLearningWrapper {
|
|
11
12
|
margin-top: 40px;
|
|
@@ -45,12 +46,16 @@
|
|
|
45
46
|
display: flex;
|
|
46
47
|
gap: 32px;
|
|
47
48
|
align-items: center;
|
|
49
|
+
font-size: 14px;
|
|
50
|
+
font-style: normal;
|
|
51
|
+
font-weight: 600;
|
|
48
52
|
}
|
|
49
53
|
|
|
50
54
|
.sortWrapper {
|
|
51
55
|
display: flex;
|
|
52
56
|
align-items: center;
|
|
53
57
|
gap: 12px;
|
|
58
|
+
color: cm_grey_500;
|
|
54
59
|
}
|
|
55
60
|
|
|
56
61
|
.filterWrapper {
|
|
@@ -104,7 +109,7 @@
|
|
|
104
109
|
text-decoration: underline;
|
|
105
110
|
}
|
|
106
111
|
|
|
107
|
-
@media (max-width:
|
|
112
|
+
@media (max-width: 940px) {
|
|
108
113
|
.searchAndSortSection {
|
|
109
114
|
flex-direction: column;
|
|
110
115
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"continue-learning.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/continue-learning.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"continue-learning.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/continue-learning.js"],"names":[],"mappings":";AAQA,gFAyBC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import _sortBy from "lodash/fp/sortBy";
|
|
2
|
+
import _getOr from "lodash/fp/getOr";
|
|
1
3
|
import React, { useCallback } from 'react';
|
|
2
4
|
import PropTypes from 'prop-types';
|
|
3
5
|
import Provider from '../../atom/provider';
|
|
@@ -23,7 +25,7 @@ const ContinueLearning = (props, context) => {
|
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
return /*#__PURE__*/React.createElement(CardsList, {
|
|
26
|
-
cards: ongoingCourses.list,
|
|
28
|
+
cards: _sortBy(course => -_getOr(0, ['progress'], course), ongoingCourses.list),
|
|
27
29
|
title: /*#__PURE__*/React.createElement(Title, null),
|
|
28
30
|
customStyle: {
|
|
29
31
|
padding: '16px 0px 8px'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"continue-learning.js","names":["React","useCallback","PropTypes","Provider","CardsGrid","CardsList","style","ContinueLearning","props","context","ongoingCourses","translate","Title","continueLearningTitle","continueLearningNumber","list","length","padding","contextTypes","skin","childContextTypes","propTypes","shape"],"sources":["../../../src/template/skill-detail/continue-learning.js"],"sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport Provider from '../../atom/provider';\nimport CardsGrid from '../../organism/cards-grid';\nimport CardsList from '../../molecule/dashboard/cards-list';\nimport style from './continue-learning.css';\n\nconst ContinueLearning = (props, context) => {\n const {ongoingCourses} = props;\n const {translate} = context;\n\n const Title = useCallback(\n () => (\n <>\n <span className={style.continueLearningTitle}>{translate('continue_learning')}</span>\n <span className={style.continueLearningNumber}>{ongoingCourses.list.length}</span>\n </>\n ),\n [ongoingCourses, translate]\n );\n\n if (ongoingCourses.list.length === 0) {\n return null;\n }\n\n return (\n <CardsList\n cards={ongoingCourses.list}\n title={<Title />}\n customStyle={{padding: '16px 0px 8px'}}\n />\n );\n};\n\nContinueLearning.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nContinueLearning.propTypes = {\n ongoingCourses: PropTypes.shape(CardsGrid.propTypes)\n};\n\nexport default ContinueLearning;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,WAAf,QAAiC,OAAjC;AACA,OAAOC,SAAP,MAAsB,YAAtB;
|
|
1
|
+
{"version":3,"file":"continue-learning.js","names":["React","useCallback","PropTypes","Provider","CardsGrid","CardsList","style","ContinueLearning","props","context","ongoingCourses","translate","Title","continueLearningTitle","continueLearningNumber","list","length","course","padding","contextTypes","skin","childContextTypes","propTypes","shape"],"sources":["../../../src/template/skill-detail/continue-learning.js"],"sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, sortBy} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport CardsGrid from '../../organism/cards-grid';\nimport CardsList from '../../molecule/dashboard/cards-list';\nimport style from './continue-learning.css';\n\nconst ContinueLearning = (props, context) => {\n const {ongoingCourses} = props;\n const {translate} = context;\n\n const Title = useCallback(\n () => (\n <>\n <span className={style.continueLearningTitle}>{translate('continue_learning')}</span>\n <span className={style.continueLearningNumber}>{ongoingCourses.list.length}</span>\n </>\n ),\n [ongoingCourses, translate]\n );\n\n if (ongoingCourses.list.length === 0) {\n return null;\n }\n\n return (\n <CardsList\n cards={sortBy(course => -getOr(0, ['progress'], course), ongoingCourses.list)}\n title={<Title />}\n customStyle={{padding: '16px 0px 8px'}}\n />\n );\n};\n\nContinueLearning.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nContinueLearning.propTypes = {\n ongoingCourses: PropTypes.shape(CardsGrid.propTypes)\n};\n\nexport default ContinueLearning;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,WAAf,QAAiC,OAAjC;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,SAAP,MAAsB,2BAAtB;AACA,OAAOC,SAAP,MAAsB,qCAAtB;AACA,OAAOC,KAAP,MAAkB,yBAAlB;;AAEA,MAAMC,gBAAgB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC3C,MAAM;IAACC;EAAD,IAAmBF,KAAzB;EACA,MAAM;IAACG;EAAD,IAAcF,OAApB;EAEA,MAAMG,KAAK,GAAGX,WAAW,CACvB,mBACE,uDACE;IAAM,SAAS,EAAEK,KAAK,CAACO;EAAvB,GAA+CF,SAAS,CAAC,mBAAD,CAAxD,CADF,eAEE;IAAM,SAAS,EAAEL,KAAK,CAACQ;EAAvB,GAAgDJ,cAAc,CAACK,IAAf,CAAoBC,MAApE,CAFF,CAFqB,EAOvB,CAACN,cAAD,EAAiBC,SAAjB,CAPuB,CAAzB;;EAUA,IAAID,cAAc,CAACK,IAAf,CAAoBC,MAApB,KAA+B,CAAnC,EAAsC;IACpC,OAAO,IAAP;EACD;;EAED,oBACE,oBAAC,SAAD;IACE,KAAK,EAAE,QAAOC,MAAM,IAAI,CAAC,OAAM,CAAN,EAAS,CAAC,UAAD,CAAT,EAAuBA,MAAvB,CAAlB,EAAkDP,cAAc,CAACK,IAAjE,CADT;IAEE,KAAK,eAAE,oBAAC,KAAD,OAFT;IAGE,WAAW,EAAE;MAACG,OAAO,EAAE;IAAV;EAHf,EADF;AAOD,CAzBD;;AA2BAX,gBAAgB,CAACY,YAAjB,GAAgC;EAC9BC,IAAI,EAAEjB,QAAQ,CAACkB,iBAAT,CAA2BD,IADH;EAE9BT,SAAS,EAAER,QAAQ,CAACkB,iBAAT,CAA2BV;AAFR,CAAhC;AAKAJ,gBAAgB,CAACe,SAAjB,2CAA6B;EAC3BZ,cAAc,EAAER,SAAS,CAACqB,KAAV,CAAgBnB,SAAS,CAACkB,SAA1B;AADW,CAA7B;AAIA,eAAef,gBAAf"}
|
|
@@ -186,7 +186,7 @@ const SkillDetail = (props, context) => {
|
|
|
186
186
|
"data-name": "completed-percentage"
|
|
187
187
|
}, /*#__PURE__*/React.createElement("span", {
|
|
188
188
|
className: style.progressInformationNumber
|
|
189
|
-
}, score, "%"))))) : null, /*#__PURE__*/React.createElement(ContinueLearning, {
|
|
189
|
+
}, score.toFixed(1), "%"))))) : null, /*#__PURE__*/React.createElement(ContinueLearning, {
|
|
190
190
|
ongoingCourses: ongoingCourses
|
|
191
191
|
}), /*#__PURE__*/React.createElement(AllCourses, {
|
|
192
192
|
skillIncludedCourses: skillIncludedCourses,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","useState","PropTypes","convert","classnames","Provider","Select","SelectOptionPropTypes","ButtonLink","Icon","CardsGrid","style","AllCourses","ContinueLearning","ContinueLearningButton","props","context","hovered","setHovered","ongoingCoursesAvailable","onClick","skin","translate","primarySkinColor","handleMouseOver","handleMouseLeave","width","borderRadius","backgroundColor","position","faIcon","name","color","size","contextTypes","childContextTypes","propTypes","bool","func","SkillDetail","title","skillRef","description","metrics","focused","availableForReview","ongoingCourses","skillIncludedCourses","totalCourses","filters","sorting","onBackClick","onReviewClick","onContinueLearningClick","score","content","questionsToReview","contentCompleted","showMore","setShowMore","handleShowMore","Description","truncate","ProgressBar","undefined","progressBarColor","inlineProgressValueStyle","progressBarWrapper","progress","backgroundContainer","container","backButtonWrapper","faSize","wrapperSize","ctaContainer","skillFocusBadge","length","showMoreWrapper","ctaWrapper","list","progressInformationsWrapper","progressTitle","skillCoursesAndQuestionsWrapper","skillInformation","skillInformationNumber","progressInformations","progressInformation","progressInformationNumber","string","isRequired","shape","number","onChange","options","arrayOf"],"sources":["../../../src/template/skill-detail/index.js"],"sourcesContent":["import React, {useCallback, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport {convert} from 'css-color-function';\nimport classnames from 'classnames';\nimport {get} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport Select, {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLink from '../../atom/button-link';\nimport Icon from '../../atom/icon';\nimport CardsGrid from '../../organism/cards-grid';\nimport style from './style.css';\nimport AllCourses from './all-courses';\nimport ContinueLearning from './continue-learning';\n\nconst ContinueLearningButton = (props, context) => {\n const [hovered, setHovered] = useState(false);\n const {ongoingCoursesAvailable, onClick} = props;\n const {skin, translate} = context;\n const primarySkinColor = get('common.primary', skin);\n\n const handleMouseOver = useCallback(() => setHovered(true), [setHovered]);\n\n const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);\n\n return (\n <div onMouseOver={handleMouseOver} onMouseLeave={handleMouseLeave}>\n <ButtonLink\n label={\n ongoingCoursesAvailable ? translate('continue_learning') : translate('start_learning')\n }\n type=\"primary\"\n customStyle={{\n width: 'fit-content',\n borderRadius: '12px',\n backgroundColor: hovered\n ? convert(`hsl(from ${primarySkinColor} h s calc(l*(1 - 0.08)))`)\n : primarySkinColor\n }}\n icon={{\n position: 'left',\n faIcon: {\n name: 'play',\n color: '#FFFFFF',\n size: 16\n }\n }}\n onClick={onClick}\n />\n </div>\n );\n};\n\nContinueLearningButton.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nContinueLearningButton.propTypes = {\n ongoingCoursesAvailable: PropTypes.bool,\n onClick: PropTypes.func\n};\n\nconst SkillDetail = (props, context) => {\n const {\n title,\n skillRef,\n description,\n metrics = {},\n focused,\n availableForReview,\n ongoingCourses,\n skillIncludedCourses,\n totalCourses,\n filters,\n sorting,\n onBackClick,\n onReviewClick,\n onContinueLearningClick\n } = props;\n const {score, content, questionsToReview, contentCompleted = 0} = metrics;\n const {translate} = context;\n\n const [showMore, setShowMore] = useState(false);\n\n const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);\n\n const Description = useCallback(() => {\n return (\n <div className={classnames(style.description, !showMore && style.truncate)}>\n {description}\n </div>\n );\n }, [showMore, description]);\n\n const ProgressBar = useCallback(() => {\n if (score === undefined) return null;\n const progressBarColor = '#3EC483';\n const inlineProgressValueStyle = {\n backgroundColor: progressBarColor,\n width: `${score}%`\n };\n\n return (\n <div className={style.progressBarWrapper}>\n <div\n data-name=\"progress\"\n className={style.progress}\n style={inlineProgressValueStyle}\n role=\"progressbar\"\n />\n </div>\n );\n }, [score]);\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={skillRef}>\n <div className={style.backButtonWrapper} onClick={onBackClick}>\n <Icon\n iconName=\"arrow-left\"\n size={{\n faSize: 14,\n wrapperSize: 14\n }}\n />\n </div>\n <div className={style.ctaContainer}>\n <div>\n {focused ? (\n <div className={style.skillFocusBadge}>\n <Icon\n iconName=\"bullseye-arrow\"\n backgroundColor=\"#DDD1FF\"\n size={{\n faSize: 10,\n wrapperSize: 16\n }}\n />\n {translate('skill_focus')}\n </div>\n ) : null}\n <div className={style.title}>{title}</div>\n {description ? (\n <>\n <Description />\n {description.length >= 226 ? (\n <div className={style.showMoreWrapper} onClick={handleShowMore}>\n {showMore ? translate('Show less') : translate('Show more')}\n <Icon\n iconName={showMore ? 'chevron-up' : 'chevron-down'}\n size={{\n faSize: 14,\n wrapperSize: 16\n }}\n />\n </div>\n ) : null}\n </>\n ) : null}\n </div>\n\n <div className={style.ctaWrapper}>\n <ButtonLink\n type=\"secondary\"\n onClick={onReviewClick}\n label={translate('review_this_skill')}\n disabled={!availableForReview}\n customStyle={{\n width: 'fit-content',\n borderRadius: '12px'\n }}\n />\n <ContinueLearningButton\n ongoingCoursesAvailable={!!ongoingCourses.list.length}\n onClick={onContinueLearningClick}\n />\n </div>\n </div>\n {score !== undefined ? (\n <div className={style.progressInformationsWrapper}>\n <div className={style.progressTitle}>{translate('your_progress')}</div>\n <div className={style.skillCoursesAndQuestionsWrapper}>\n {content ? (\n <div className={style.skillInformation} data-name=\"skill-courses\">\n <span className={style.skillInformationNumber}>{content}</span>{' '}\n {translate('courses')}\n </div>\n ) : null}\n {questionsToReview ? (\n <div className={style.skillInformation} data-name=\"skill-questions\">\n <span className={style.skillInformationNumber}>{questionsToReview}</span>\n {translate('questions')}\n </div>\n ) : null}\n </div>\n <ProgressBar />\n <div className={style.progressInformations}>\n {content && (\n <>\n <div className={style.progressInformation} data-name=\"skill-completed-courses\">\n <span className={style.progressInformationNumber}>{contentCompleted}</span>\n {` ${translate('courses_completed')}`}\n </div>\n <div className={style.progressInformation} data-name=\"completed-percentage\">\n <span className={style.progressInformationNumber}>{score}%</span>\n </div>\n </>\n )}\n </div>\n </div>\n ) : null}\n <ContinueLearning ongoingCourses={ongoingCourses} />\n <AllCourses\n skillIncludedCourses={skillIncludedCourses}\n totalCourses={totalCourses}\n filters={filters}\n sorting={sorting}\n />\n </div>\n </div>\n );\n};\n\nSkillDetail.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nSkillDetail.propTypes = {\n title: PropTypes.string.isRequired,\n skillRef: PropTypes.string.isRequired,\n description: PropTypes.string,\n metrics: PropTypes.shape({\n score: PropTypes.number,\n content: PropTypes.number,\n questionsToReview: PropTypes.number,\n contentCompleted: PropTypes.number\n }),\n focused: PropTypes.bool,\n availableForReview: PropTypes.bool,\n ongoingCourses: PropTypes.shape(CardsGrid.propTypes),\n skillIncludedCourses: PropTypes.shape(CardsGrid.propTypes),\n totalCourses: PropTypes.number,\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n sorting: PropTypes.shape(Select.propTypes),\n onBackClick: PropTypes.func,\n onReviewClick: PropTypes.func,\n onContinueLearningClick: PropTypes.func\n};\n\nexport default SkillDetail;\n"],"mappings":";AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,QAA5B,QAA2C,OAA3C;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAAQC,OAAR,QAAsB,oBAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,MAAP,IAAgBC,qBAAhB,QAA4C,mBAA5C;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,SAAP,MAAsB,2BAAtB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AACA,OAAOC,UAAP,MAAuB,eAAvB;AACA,OAAOC,gBAAP,MAA6B,qBAA7B;;AAEA,MAAMC,sBAAsB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACjD,MAAM,CAACC,OAAD,EAAUC,UAAV,IAAwBjB,QAAQ,CAAC,KAAD,CAAtC;EACA,MAAM;IAACkB,uBAAD;IAA0BC;EAA1B,IAAqCL,KAA3C;EACA,MAAM;IAACM,IAAD;IAAOC;EAAP,IAAoBN,OAA1B;;EACA,MAAMO,gBAAgB,GAAG,KAAI,gBAAJ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yF,MAdF;EAetB1C,OAAO,EAAE/C,SAAS,CAACwF,KAAV,CAAgB;IACvBE,QAAQ,EAAE1F,SAAS,CAACoC,IADG;IAEvBuD,OAAO,EAAE3F,SAAS,CAAC4F,OAAV,CAAkB5F,SAAS,CAACwF,KAAV,CAAgBnF,qBAAhB,CAAlB;EAFc,CAAhB,CAfa;EAmBtB2C,OAAO,EAAEhD,SAAS,CAACwF,KAAV,CAAgBpF,MAAM,CAAC8B,SAAvB,CAnBa;EAoBtBe,WAAW,EAAEjD,SAAS,CAACoC,IApBD;EAqBtBc,aAAa,EAAElD,SAAS,CAACoC,IArBH;EAsBtBe,uBAAuB,EAAEnD,SAAS,CAACoC;AAtBb,CAAxB;AAyBA,eAAeC,WAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","useState","PropTypes","convert","classnames","Provider","Select","SelectOptionPropTypes","ButtonLink","Icon","CardsGrid","style","AllCourses","ContinueLearning","ContinueLearningButton","props","context","hovered","setHovered","ongoingCoursesAvailable","onClick","skin","translate","primarySkinColor","handleMouseOver","handleMouseLeave","width","borderRadius","backgroundColor","position","faIcon","name","color","size","contextTypes","childContextTypes","propTypes","bool","func","SkillDetail","title","skillRef","description","metrics","focused","availableForReview","ongoingCourses","skillIncludedCourses","totalCourses","filters","sorting","onBackClick","onReviewClick","onContinueLearningClick","score","content","questionsToReview","contentCompleted","showMore","setShowMore","handleShowMore","Description","truncate","ProgressBar","undefined","progressBarColor","inlineProgressValueStyle","progressBarWrapper","progress","backgroundContainer","container","backButtonWrapper","faSize","wrapperSize","ctaContainer","skillFocusBadge","length","showMoreWrapper","ctaWrapper","list","progressInformationsWrapper","progressTitle","skillCoursesAndQuestionsWrapper","skillInformation","skillInformationNumber","progressInformations","progressInformation","progressInformationNumber","toFixed","string","isRequired","shape","number","onChange","options","arrayOf"],"sources":["../../../src/template/skill-detail/index.js"],"sourcesContent":["import React, {useCallback, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport {convert} from 'css-color-function';\nimport classnames from 'classnames';\nimport {get} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport Select, {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLink from '../../atom/button-link';\nimport Icon from '../../atom/icon';\nimport CardsGrid from '../../organism/cards-grid';\nimport style from './style.css';\nimport AllCourses from './all-courses';\nimport ContinueLearning from './continue-learning';\n\nconst ContinueLearningButton = (props, context) => {\n const [hovered, setHovered] = useState(false);\n const {ongoingCoursesAvailable, onClick} = props;\n const {skin, translate} = context;\n const primarySkinColor = get('common.primary', skin);\n\n const handleMouseOver = useCallback(() => setHovered(true), [setHovered]);\n\n const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);\n\n return (\n <div onMouseOver={handleMouseOver} onMouseLeave={handleMouseLeave}>\n <ButtonLink\n label={\n ongoingCoursesAvailable ? translate('continue_learning') : translate('start_learning')\n }\n type=\"primary\"\n customStyle={{\n width: 'fit-content',\n borderRadius: '12px',\n backgroundColor: hovered\n ? convert(`hsl(from ${primarySkinColor} h s calc(l*(1 - 0.08)))`)\n : primarySkinColor\n }}\n icon={{\n position: 'left',\n faIcon: {\n name: 'play',\n color: '#FFFFFF',\n size: 16\n }\n }}\n onClick={onClick}\n />\n </div>\n );\n};\n\nContinueLearningButton.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nContinueLearningButton.propTypes = {\n ongoingCoursesAvailable: PropTypes.bool,\n onClick: PropTypes.func\n};\n\nconst SkillDetail = (props, context) => {\n const {\n title,\n skillRef,\n description,\n metrics = {},\n focused,\n availableForReview,\n ongoingCourses,\n skillIncludedCourses,\n totalCourses,\n filters,\n sorting,\n onBackClick,\n onReviewClick,\n onContinueLearningClick\n } = props;\n const {score, content, questionsToReview, contentCompleted = 0} = metrics;\n const {translate} = context;\n\n const [showMore, setShowMore] = useState(false);\n\n const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);\n\n const Description = useCallback(() => {\n return (\n <div className={classnames(style.description, !showMore && style.truncate)}>\n {description}\n </div>\n );\n }, [showMore, description]);\n\n const ProgressBar = useCallback(() => {\n if (score === undefined) return null;\n const progressBarColor = '#3EC483';\n const inlineProgressValueStyle = {\n backgroundColor: progressBarColor,\n width: `${score}%`\n };\n\n return (\n <div className={style.progressBarWrapper}>\n <div\n data-name=\"progress\"\n className={style.progress}\n style={inlineProgressValueStyle}\n role=\"progressbar\"\n />\n </div>\n );\n }, [score]);\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={skillRef}>\n <div className={style.backButtonWrapper} onClick={onBackClick}>\n <Icon\n iconName=\"arrow-left\"\n size={{\n faSize: 14,\n wrapperSize: 14\n }}\n />\n </div>\n <div className={style.ctaContainer}>\n <div>\n {focused ? (\n <div className={style.skillFocusBadge}>\n <Icon\n iconName=\"bullseye-arrow\"\n backgroundColor=\"#DDD1FF\"\n size={{\n faSize: 10,\n wrapperSize: 16\n }}\n />\n {translate('skill_focus')}\n </div>\n ) : null}\n <div className={style.title}>{title}</div>\n {description ? (\n <>\n <Description />\n {description.length >= 226 ? (\n <div className={style.showMoreWrapper} onClick={handleShowMore}>\n {showMore ? translate('Show less') : translate('Show more')}\n <Icon\n iconName={showMore ? 'chevron-up' : 'chevron-down'}\n size={{\n faSize: 14,\n wrapperSize: 16\n }}\n />\n </div>\n ) : null}\n </>\n ) : null}\n </div>\n\n <div className={style.ctaWrapper}>\n <ButtonLink\n type=\"secondary\"\n onClick={onReviewClick}\n label={translate('review_this_skill')}\n disabled={!availableForReview}\n customStyle={{\n width: 'fit-content',\n borderRadius: '12px'\n }}\n />\n <ContinueLearningButton\n ongoingCoursesAvailable={!!ongoingCourses.list.length}\n onClick={onContinueLearningClick}\n />\n </div>\n </div>\n {score !== undefined ? (\n <div className={style.progressInformationsWrapper}>\n <div className={style.progressTitle}>{translate('your_progress')}</div>\n <div className={style.skillCoursesAndQuestionsWrapper}>\n {content ? (\n <div className={style.skillInformation} data-name=\"skill-courses\">\n <span className={style.skillInformationNumber}>{content}</span>{' '}\n {translate('courses')}\n </div>\n ) : null}\n {questionsToReview ? (\n <div className={style.skillInformation} data-name=\"skill-questions\">\n <span className={style.skillInformationNumber}>{questionsToReview}</span>\n {translate('questions')}\n </div>\n ) : null}\n </div>\n <ProgressBar />\n <div className={style.progressInformations}>\n {content && (\n <>\n <div className={style.progressInformation} data-name=\"skill-completed-courses\">\n <span className={style.progressInformationNumber}>{contentCompleted}</span>\n {` ${translate('courses_completed')}`}\n </div>\n <div className={style.progressInformation} data-name=\"completed-percentage\">\n <span className={style.progressInformationNumber}>{score.toFixed(1)}%</span>\n </div>\n </>\n )}\n </div>\n </div>\n ) : null}\n <ContinueLearning ongoingCourses={ongoingCourses} />\n <AllCourses\n skillIncludedCourses={skillIncludedCourses}\n totalCourses={totalCourses}\n filters={filters}\n sorting={sorting}\n />\n </div>\n </div>\n );\n};\n\nSkillDetail.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nSkillDetail.propTypes = {\n title: PropTypes.string.isRequired,\n skillRef: PropTypes.string.isRequired,\n description: PropTypes.string,\n metrics: PropTypes.shape({\n score: PropTypes.number,\n content: PropTypes.number,\n questionsToReview: PropTypes.number,\n contentCompleted: PropTypes.number\n }),\n focused: PropTypes.bool,\n availableForReview: PropTypes.bool,\n ongoingCourses: PropTypes.shape(CardsGrid.propTypes),\n skillIncludedCourses: PropTypes.shape(CardsGrid.propTypes),\n totalCourses: PropTypes.number,\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n sorting: PropTypes.shape(Select.propTypes),\n onBackClick: PropTypes.func,\n onReviewClick: PropTypes.func,\n onContinueLearningClick: PropTypes.func\n};\n\nexport default SkillDetail;\n"],"mappings":";AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,QAA5B,QAA2C,OAA3C;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAAQ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are const CircularProgressBar: {
|
|
4
|
+
({ label, progression, size, strokeWidth, "aria-label": ariaLabel, "data-name": dataName }: LearningPriorityCardPropTypes): JSX.Element;
|
|
5
|
+
propTypes: {
|
|
6
|
+
label: import("prop-types").Requireable<string>;
|
|
7
|
+
progression: import("prop-types").Validator<number>;
|
|
8
|
+
size: import("prop-types").Requireable<number>;
|
|
9
|
+
strokeWidth: import("prop-types").Requireable<number>;
|
|
10
|
+
'aria-label': import("prop-types").Requireable<string>;
|
|
11
|
+
'data-name': import("prop-types").Requireable<string>;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export default CircularProgressBar;
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/circular-progress-bar/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAC,6BAA6B,EAA+B,MAAM,SAAS,CAAC;AAmBpF,QAAA,MAAM,mBAAmB;gGAOtB,6BAA6B;;;;;;;;;CAgD/B,CAAC;AAIF,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _isNull2 = _interopRequireDefault(require("lodash/fp/isNull"));
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _types = require("./types");
|
|
11
|
+
|
|
12
|
+
var _style = _interopRequireDefault(require("./style.css"));
|
|
13
|
+
|
|
14
|
+
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); }
|
|
15
|
+
|
|
16
|
+
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; }
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
const ProgressionGradient = () => /*#__PURE__*/_react.default.createElement("defs", null, /*#__PURE__*/_react.default.createElement("linearGradient", {
|
|
21
|
+
id: "gradient-stroke-progression",
|
|
22
|
+
x1: "81",
|
|
23
|
+
y1: "0",
|
|
24
|
+
x2: "81",
|
|
25
|
+
y2: "162",
|
|
26
|
+
gradientUnits: "userSpaceOnUse"
|
|
27
|
+
}, /*#__PURE__*/_react.default.createElement("stop", {
|
|
28
|
+
stopColor: "#35CC7F"
|
|
29
|
+
}), /*#__PURE__*/_react.default.createElement("stop", {
|
|
30
|
+
offset: "1",
|
|
31
|
+
stopColor: "#55F2A7"
|
|
32
|
+
})));
|
|
33
|
+
|
|
34
|
+
const CircularProgressBar = ({
|
|
35
|
+
label,
|
|
36
|
+
progression,
|
|
37
|
+
size,
|
|
38
|
+
strokeWidth,
|
|
39
|
+
'aria-label': ariaLabel,
|
|
40
|
+
'data-name': dataName
|
|
41
|
+
}) => {
|
|
42
|
+
const [offset, setOffset] = (0, _react.useState)(null);
|
|
43
|
+
const {
|
|
44
|
+
center,
|
|
45
|
+
radius,
|
|
46
|
+
length
|
|
47
|
+
} = (0, _react.useMemo)(() => {
|
|
48
|
+
const center_ = size / 2;
|
|
49
|
+
const radius_ = center_ - strokeWidth;
|
|
50
|
+
const length_ = Math.ceil(2 * Math.PI * radius_);
|
|
51
|
+
return {
|
|
52
|
+
center: center_,
|
|
53
|
+
radius: radius_,
|
|
54
|
+
length: length_
|
|
55
|
+
};
|
|
56
|
+
}, [size, strokeWidth]);
|
|
57
|
+
(0, _react.useEffect)(() => setOffset(Math.ceil(length * ((100 - progression) / 100))), [length, progression]);
|
|
58
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
59
|
+
className: _style.default.container,
|
|
60
|
+
"aria-label": ariaLabel,
|
|
61
|
+
"data-name": dataName
|
|
62
|
+
}, /*#__PURE__*/_react.default.createElement("svg", {
|
|
63
|
+
className: _style.default.svg,
|
|
64
|
+
width: size,
|
|
65
|
+
height: size
|
|
66
|
+
}, /*#__PURE__*/_react.default.createElement(ProgressionGradient, null), /*#__PURE__*/_react.default.createElement("circle", {
|
|
67
|
+
className: _style.default.mainCircle,
|
|
68
|
+
cx: center,
|
|
69
|
+
cy: center,
|
|
70
|
+
r: radius,
|
|
71
|
+
strokeWidth: 3,
|
|
72
|
+
fill: "transparent"
|
|
73
|
+
}), /*#__PURE__*/_react.default.createElement("circle", {
|
|
74
|
+
cx: center,
|
|
75
|
+
cy: center,
|
|
76
|
+
r: radius - 10 / radius * 100,
|
|
77
|
+
fill: "#fafafa"
|
|
78
|
+
}), /*#__PURE__*/_react.default.createElement("circle", {
|
|
79
|
+
className: _style.default.progressionCircle,
|
|
80
|
+
cx: center,
|
|
81
|
+
cy: center,
|
|
82
|
+
r: radius,
|
|
83
|
+
stroke: `url(#gradient-stroke-progression)`,
|
|
84
|
+
strokeWidth: strokeWidth,
|
|
85
|
+
strokeDasharray: length,
|
|
86
|
+
strokeDashoffset: (0, _isNull2.default)(offset) ? length : offset,
|
|
87
|
+
fill: "transparent",
|
|
88
|
+
strokeLinecap: "round"
|
|
89
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
90
|
+
className: _style.default.infos
|
|
91
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
92
|
+
className: _style.default.progression
|
|
93
|
+
}, progression, "%"), /*#__PURE__*/_react.default.createElement("span", {
|
|
94
|
+
className: _style.default.label
|
|
95
|
+
}, label)));
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
CircularProgressBar.propTypes = process.env.NODE_ENV !== "production" ? _types.CircularProgressBarPropTypes : {};
|
|
99
|
+
var _default = CircularProgressBar;
|
|
100
|
+
exports.default = _default;
|
|
101
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["ProgressionGradient","CircularProgressBar","label","progression","size","strokeWidth","ariaLabel","dataName","offset","setOffset","useState","center","radius","length","useMemo","center_","radius_","length_","Math","ceil","PI","useEffect","style","container","svg","mainCircle","progressionCircle","infos","propTypes","CircularProgressBarPropTypes"],"sources":["../../../src/atom/circular-progress-bar/index.tsx"],"sourcesContent":["import React, {useMemo, useState, useEffect} from 'react';\nimport {isNull} from 'lodash/fp';\nimport {LearningPriorityCardPropTypes, CircularProgressBarPropTypes} from './types';\nimport style from './style.css';\n\nconst ProgressionGradient = () => (\n <defs>\n <linearGradient\n id=\"gradient-stroke-progression\"\n x1=\"81\"\n y1=\"0\"\n x2=\"81\"\n y2=\"162\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor=\"#35CC7F\" />\n <stop offset=\"1\" stopColor=\"#55F2A7\" />\n </linearGradient>\n </defs>\n);\n\nconst CircularProgressBar = ({\n label,\n progression,\n size,\n strokeWidth,\n 'aria-label': ariaLabel,\n 'data-name': dataName\n}: LearningPriorityCardPropTypes) => {\n const [offset, setOffset] = useState<null | number>(null);\n\n const {center, radius, length} = useMemo(() => {\n const center_ = size / 2;\n const radius_ = center_ - strokeWidth;\n const length_ = Math.ceil(2 * Math.PI * radius_);\n\n return {center: center_, radius: radius_, length: length_};\n }, [size, strokeWidth]);\n\n useEffect(\n () => setOffset(Math.ceil(length * ((100 - progression) / 100))),\n [length, progression]\n );\n\n return (\n <div className={style.container} aria-label={ariaLabel} data-name={dataName}>\n <svg className={style.svg} width={size} height={size}>\n <ProgressionGradient />\n <circle\n className={style.mainCircle}\n cx={center}\n cy={center}\n r={radius}\n strokeWidth={3}\n fill=\"transparent\"\n />\n <circle cx={center} cy={center} r={radius - (10 / radius) * 100} fill=\"#fafafa\" />\n <circle\n className={style.progressionCircle}\n cx={center}\n cy={center}\n r={radius}\n stroke={`url(#gradient-stroke-progression)`}\n strokeWidth={strokeWidth}\n strokeDasharray={length}\n strokeDashoffset={isNull(offset) ? length : offset}\n fill=\"transparent\"\n strokeLinecap=\"round\"\n />\n </svg>\n <div className={style.infos}>\n <span className={style.progression}>{progression}%</span>\n <span className={style.label}>{label}</span>\n </div>\n </div>\n );\n};\n\nCircularProgressBar.propTypes = CircularProgressBarPropTypes;\n\nexport default CircularProgressBar;\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;;;;;;;AAEA,MAAMA,mBAAmB,GAAG,mBAC1B,wDACE;EACE,EAAE,EAAC,6BADL;EAEE,EAAE,EAAC,IAFL;EAGE,EAAE,EAAC,GAHL;EAIE,EAAE,EAAC,IAJL;EAKE,EAAE,EAAC,KALL;EAME,aAAa,EAAC;AANhB,gBAQE;EAAM,SAAS,EAAC;AAAhB,EARF,eASE;EAAM,MAAM,EAAC,GAAb;EAAiB,SAAS,EAAC;AAA3B,EATF,CADF,CADF;;AAgBA,MAAMC,mBAAmB,GAAG,CAAC;EAC3BC,KAD2B;EAE3BC,WAF2B;EAG3BC,IAH2B;EAI3BC,WAJ2B;EAK3B,cAAcC,SALa;EAM3B,aAAaC;AANc,CAAD,KAOS;EACnC,MAAM,CAACC,MAAD,EAASC,SAAT,IAAsB,IAAAC,eAAA,EAAwB,IAAxB,CAA5B;EAEA,MAAM;IAACC,MAAD;IAASC,MAAT;IAAiBC;EAAjB,IAA2B,IAAAC,cA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ME,WAAW,EAAEP,WANf;IAOE,eAAe,EAAEQ,MAPnB;IAQE,gBAAgB,EAAE,sBAAOL,MAAP,IAAiBK,MAAjB,GAA0BL,MAR9C;IASE,IAAI,EAAC,aATP;IAUE,aAAa,EAAC;EAVhB,EAXF,CADF,eAyBE;IAAK,SAAS,EAAEc,cAAA,CAAMK;EAAtB,gBACE;IAAM,SAAS,EAAEL,cAAA,CAAMnB;EAAvB,GAAqCA,WAArC,MADF,eAEE;IAAM,SAAS,EAAEmB,cAAA,CAAMpB;EAAvB,GAA+BA,KAA/B,CAFF,CAzBF,CADF;AAgCD,CAvDD;;AAyDAD,mBAAmB,CAAC2B,SAApB,2CAAgCC,mCAAhC;eAEe5B,mB"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
@value colors: "../../variables/colors.css";
|
|
2
|
+
@value cm_grey_400 from colors;
|
|
3
|
+
@value cm_grey_50 from colors;
|
|
4
|
+
|
|
5
|
+
.container {
|
|
6
|
+
position: relative;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
align-items: center;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.svg {
|
|
14
|
+
transform: rotate(-90deg);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.mainCircle {
|
|
18
|
+
stroke: cm_grey_50;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.progressionCircle {
|
|
22
|
+
transition: stroke-dashoffset 1.5s ease-in-out;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.infos {
|
|
26
|
+
font-family: Gilroy;
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
align-items: center;
|
|
31
|
+
text-align: center;
|
|
32
|
+
position: absolute;
|
|
33
|
+
top: 50%;
|
|
34
|
+
left: 50%;
|
|
35
|
+
transform: translate(-50%, -50%);
|
|
36
|
+
text-align: center;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.label {
|
|
40
|
+
color: cm_grey_400;
|
|
41
|
+
font-size: 10px;
|
|
42
|
+
font-weight: 500;
|
|
43
|
+
line-height: 12px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.progression {
|
|
47
|
+
color: #2caf6c;
|
|
48
|
+
font-size: 24px;
|
|
49
|
+
font-weight: 700;
|
|
50
|
+
line-height: 32px;
|
|
51
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
export declare type LearningPriorityCardPropTypes = {
|
|
3
|
+
label: string;
|
|
4
|
+
progression: number;
|
|
5
|
+
size: number;
|
|
6
|
+
strokeWidth: number;
|
|
7
|
+
'aria-label': string;
|
|
8
|
+
'data-name': string;
|
|
9
|
+
};
|
|
10
|
+
export declare const CircularProgressBarPropTypes: {
|
|
11
|
+
label: PropTypes.Requireable<string>;
|
|
12
|
+
progression: PropTypes.Validator<number>;
|
|
13
|
+
size: PropTypes.Requireable<number>;
|
|
14
|
+
strokeWidth: PropTypes.Requireable<number>;
|
|
15
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
16
|
+
'data-name': PropTypes.Requireable<string>;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/atom/circular-progress-bar/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,oBAAY,6BAA6B,GAAG;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,4BAA4B;;;;;;;CAOxC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.CircularProgressBarPropTypes = void 0;
|
|
5
|
+
|
|
6
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
7
|
+
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
|
|
10
|
+
const CircularProgressBarPropTypes = {
|
|
11
|
+
label: _propTypes.default.string,
|
|
12
|
+
progression: _propTypes.default.number.isRequired,
|
|
13
|
+
size: _propTypes.default.number,
|
|
14
|
+
strokeWidth: _propTypes.default.number,
|
|
15
|
+
'aria-label': _propTypes.default.string,
|
|
16
|
+
'data-name': _propTypes.default.string
|
|
17
|
+
};
|
|
18
|
+
exports.CircularProgressBarPropTypes = CircularProgressBarPropTypes;
|
|
19
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":["CircularProgressBarPropTypes","label","PropTypes","string","progression","number","isRequired","size","strokeWidth"],"sources":["../../../src/atom/circular-progress-bar/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\n\nexport type LearningPriorityCardPropTypes = {\n label: string;\n progression: number;\n size: number;\n strokeWidth: number;\n 'aria-label': string;\n 'data-name': string;\n};\n\nexport const CircularProgressBarPropTypes = {\n label: PropTypes.string,\n progression: PropTypes.number.isRequired,\n size: PropTypes.number,\n strokeWidth: PropTypes.number,\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string\n};\n"],"mappings":";;;;;AAAA;;;;AAWO,MAAMA,4BAA4B,GAAG;EAC1CC,KAAK,EAAEC,kBAAA,CAAUC,MADyB;EAE1CC,WAAW,EAAEF,kBAAA,CAAUG,MAAV,CAAiBC,UAFY;EAG1CC,IAAI,EAAEL,kBAAA,CAAUG,MAH0B;EAI1CG,WAAW,EAAEN,kBAAA,CAAUG,MAJmB;EAK1C,cAAcH,kBAAA,CAAUC,MALkB;EAM1C,aAAaD,kBAAA,CAAUC;AANmB,CAArC"}
|
|
@@ -10,6 +10,12 @@ declare const RadioWithTitle: {
|
|
|
10
10
|
'data-name': import("prop-types").Requireable<string>;
|
|
11
11
|
titleSize: import("prop-types").Requireable<string>;
|
|
12
12
|
subtitleSize: import("prop-types").Requireable<string>;
|
|
13
|
+
icon: import("prop-types").Requireable<import("prop-types").InferProps<any>>;
|
|
14
|
+
tag: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
15
|
+
label: import("prop-types").Requireable<string>;
|
|
16
|
+
type: import("prop-types").Requireable<string>;
|
|
17
|
+
size: import("prop-types").Requireable<string>;
|
|
18
|
+
}>>;
|
|
13
19
|
}>>>;
|
|
14
20
|
name: import("prop-types").Requireable<string>;
|
|
15
21
|
checked: import("prop-types").Requireable<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/radio-with-title/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAY,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAEvD,QAAA,MAAM,cAAc;YAAW,mBAAmB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/radio-with-title/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAY,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAEvD,QAAA,MAAM,cAAc;YAAW,mBAAmB;;;;;;;;;;;;;;;;;;;;;;CAwBjD,CAAC;AAIF,eAAe,cAAc,CAAC"}
|
|
@@ -7,6 +7,12 @@ export declare const propTypes: {
|
|
|
7
7
|
'data-name': PropTypes.Requireable<string>;
|
|
8
8
|
titleSize: PropTypes.Requireable<string>;
|
|
9
9
|
subtitleSize: PropTypes.Requireable<string>;
|
|
10
|
+
icon: PropTypes.Requireable<PropTypes.InferProps<any>>;
|
|
11
|
+
tag: PropTypes.Requireable<PropTypes.InferProps<{
|
|
12
|
+
label: PropTypes.Requireable<string>;
|
|
13
|
+
type: PropTypes.Requireable<string>;
|
|
14
|
+
size: PropTypes.Requireable<string>;
|
|
15
|
+
}>>;
|
|
10
16
|
}>>>;
|
|
11
17
|
name: PropTypes.Requireable<string>;
|
|
12
18
|
checked: PropTypes.Requireable<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/atom/radio-with-title/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAGnC,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/atom/radio-with-title/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAGnC,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;CAOrB,CAAC;AAEF,oBAAY,mBAAmB,GAAG;IAChC,KAAK,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
package/lib/atom/tag/index.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
export default Tag;
|
|
2
|
-
declare function Tag(
|
|
2
|
+
declare function Tag({ label, type, size }: {
|
|
3
|
+
label: any;
|
|
4
|
+
type?: string | undefined;
|
|
5
|
+
size?: string | undefined;
|
|
6
|
+
}): JSX.Element;
|
|
3
7
|
declare namespace Tag {
|
|
4
8
|
namespace propTypes {
|
|
5
9
|
const label: PropTypes.Requireable<string>;
|
|
6
10
|
const type: PropTypes.Requireable<string>;
|
|
11
|
+
const size: PropTypes.Requireable<string>;
|
|
7
12
|
}
|
|
8
13
|
}
|
|
9
14
|
import PropTypes from "prop-types";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/tag/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/tag/index.js"],"names":[],"mappings":";AAoBA;;;;gBAIC"}
|
package/lib/atom/tag/index.js
CHANGED
|
@@ -9,6 +9,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
12
14
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
13
15
|
|
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -20,21 +22,25 @@ const TAG_STYLES = {
|
|
|
20
22
|
warning: _style.default.warning,
|
|
21
23
|
progress: _style.default.progress
|
|
22
24
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
type = 'default'
|
|
28
|
-
} = props;
|
|
29
|
-
return /*#__PURE__*/_react.default.createElement("span", {
|
|
30
|
-
className: TAG_STYLES[type],
|
|
31
|
-
"data-name": `content-tag-${label}`
|
|
32
|
-
}, label);
|
|
25
|
+
const TAG_SIZE = {
|
|
26
|
+
S: _style.default.small,
|
|
27
|
+
M: _style.default.medium,
|
|
28
|
+
L: _style.default.large
|
|
33
29
|
};
|
|
34
30
|
|
|
31
|
+
const Tag = ({
|
|
32
|
+
label,
|
|
33
|
+
type = 'default',
|
|
34
|
+
size = 'M'
|
|
35
|
+
}) => /*#__PURE__*/_react.default.createElement("span", {
|
|
36
|
+
className: (0, _classnames.default)(TAG_STYLES[type], TAG_SIZE[size]),
|
|
37
|
+
"data-name": `content-tag-${label}`
|
|
38
|
+
}, label);
|
|
39
|
+
|
|
35
40
|
Tag.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
36
41
|
label: _propTypes.default.string,
|
|
37
|
-
type: _propTypes.default.oneOf((0, _keys2.default)(TAG_STYLES))
|
|
42
|
+
type: _propTypes.default.oneOf((0, _keys2.default)(TAG_STYLES)),
|
|
43
|
+
size: _propTypes.default.oneOf(['S', 'M', 'L'])
|
|
38
44
|
} : {};
|
|
39
45
|
var _default = Tag;
|
|
40
46
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["TAG_STYLES","default","style","success","failure","warning","progress","
|
|
1
|
+
{"version":3,"file":"index.js","names":["TAG_STYLES","default","style","success","failure","warning","progress","TAG_SIZE","S","small","M","medium","L","large","Tag","label","type","size","classnames","propTypes","PropTypes","string","oneOf"],"sources":["../../../src/atom/tag/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {keys} from 'lodash/fp';\nimport style from './style.css';\n\nconst TAG_STYLES = {\n default: style.default,\n success: style.success,\n failure: style.failure,\n warning: style.warning,\n progress: style.progress\n};\n\nconst TAG_SIZE = {\n S: style.small,\n M: style.medium,\n L: style.large\n};\n\nconst Tag = ({label, type = 'default', size = 'M'}) => (\n <span className={classnames(TAG_STYLES[type], TAG_SIZE[size])} data-name={`content-tag-${label}`}>\n {label}\n </span>\n);\n\nTag.propTypes = {\n label: PropTypes.string,\n type: PropTypes.oneOf(keys(TAG_STYLES)),\n size: PropTypes.oneOf(['S', 'M', 'L'])\n};\n\nexport default Tag;\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;;;AAEA,MAAMA,UAAU,GAAG;EACjBC,OAAO,EAAEC,cAAA,CAAMD,OADE;EAEjBE,OAAO,EAAED,cAAA,CAAMC,OAFE;EAGjBC,OAAO,EAAEF,cAAA,CAAME,OAHE;EAIjBC,OAAO,EAAEH,cAAA,CAAMG,OAJE;EAKjBC,QAAQ,EAAEJ,cAAA,CAAMI;AALC,CAAnB;AAQA,MAAMC,QAAQ,GAAG;EACfC,CAAC,EAAEN,cAAA,CAAMO,KADM;EAEfC,CAAC,EAAER,cAAA,CAAMS,MAFM;EAGfC,CAAC,EAAEV,cAAA,CAAMW;AAHM,CAAjB;;AAMA,MAAMC,GAAG,GAAG,CAAC;EAACC,KAAD;EAAQC,IAAI,GAAG,SAAf;EAA0BC,IAAI,GAAG;AAAjC,CAAD,kBACV;EAAM,SAAS,EAAE,IAAAC,mBAAA,EAAWlB,UAAU,CAACgB,IAAD,CAArB,EAA6BT,QAAQ,CAACU,IAAD,CAArC,CAAjB;EAA+D,aAAY,eAAcF,KAAM;AAA/F,GACGA,KADH,CADF;;AAMAD,GAAG,CAACK,SAAJ,2CAAgB;EACdJ,KAAK,EAAEK,kBAAA,CAAUC,MADH;EAEdL,IAAI,EAAEI,kBAAA,CAAUE,KAAV,CAAgB,oBAAKtB,UAAL,CAAhB,CAFQ;EAGdiB,IAAI,EAAEG,kBAAA,CAAUE,KAAV,CAAgB,CAAC,GAAD,EAAM,GAAN,EAAW,GAAX,CAAhB;AAHQ,CAAhB;eAMeR,G"}
|