@coorpacademy/components 11.32.11 → 11.32.12-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/es/atom/button-link/style.css +1 -0
  2. package/es/atom/select/index.d.ts.map +1 -1
  3. package/es/atom/select/index.js +2 -1
  4. package/es/atom/select/index.js.map +1 -1
  5. package/es/atom/select/style.css +23 -0
  6. package/es/molecule/cm-popin/types.d.ts +3 -0
  7. package/es/molecule/cm-popin/types.d.ts.map +1 -1
  8. package/es/molecule/dashboard/cards-list/index.d.ts +4 -1
  9. package/es/molecule/dashboard/cards-list/index.d.ts.map +1 -1
  10. package/es/molecule/dashboard/cards-list/index.js +8 -3
  11. package/es/molecule/dashboard/cards-list/index.js.map +1 -1
  12. package/es/molecule/dashboard/cards-list/prop-types.d.ts +3 -1
  13. package/es/molecule/dashboard/cards-list/prop-types.d.ts.map +1 -1
  14. package/es/molecule/dashboard/cards-list/prop-types.js.map +1 -1
  15. package/es/molecule/dashboard/cards-list/style.css +4 -0
  16. package/es/organism/cards-grid/index.d.ts +3 -0
  17. package/es/organism/cards-grid/index.js +4 -1
  18. package/es/organism/cards-grid/index.js.map +1 -1
  19. package/es/organism/cards-grid/style.css +0 -1
  20. package/es/template/app-player/loading/index.d.ts +3 -0
  21. package/es/template/app-player/player/index.d.ts +6 -0
  22. package/es/template/app-player/player/slides/index.d.ts +3 -0
  23. package/es/template/app-player/player/slides/index.d.ts.map +1 -1
  24. package/es/template/app-player/popin-correction/index.d.ts +3 -0
  25. package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
  26. package/es/template/app-player/popin-end/index.d.ts +7 -1
  27. package/es/template/app-player/popin-end/summary.d.ts +4 -1
  28. package/es/template/app-review/index.d.ts +3 -0
  29. package/es/template/app-review/index.d.ts.map +1 -1
  30. package/es/template/app-review/player/prop-types.d.ts +3 -0
  31. package/es/template/app-review/player/prop-types.d.ts.map +1 -1
  32. package/es/template/app-review/prop-types.d.ts +3 -0
  33. package/es/template/app-review/prop-types.d.ts.map +1 -1
  34. package/es/template/back-office/brand-update/index.d.ts +3 -0
  35. package/es/template/common/authors/index.d.ts +3 -0
  36. package/es/template/common/authors/index.d.ts.map +1 -1
  37. package/es/template/common/dashboard/index.d.ts +6 -0
  38. package/es/template/common/search-page/index.d.ts +10 -1
  39. package/es/template/external-course/index.d.ts +3 -0
  40. package/es/template/my-learning/index.d.ts +3 -0
  41. package/es/template/my-learning/index.d.ts.map +1 -1
  42. package/es/template/my-learning/index.js +8 -3
  43. package/es/template/my-learning/index.js.map +1 -1
  44. package/es/template/skill-detail/all-courses.css +128 -0
  45. package/es/template/skill-detail/all-courses.d.ts +80 -0
  46. package/es/template/skill-detail/all-courses.d.ts.map +1 -0
  47. package/es/template/skill-detail/all-courses.js +195 -0
  48. package/es/template/skill-detail/all-courses.js.map +1 -0
  49. package/es/template/skill-detail/continue-learning.css +16 -0
  50. package/es/template/skill-detail/continue-learning.d.ts +39 -0
  51. package/es/template/skill-detail/continue-learning.d.ts.map +1 -0
  52. package/es/template/skill-detail/continue-learning.js +42 -0
  53. package/es/template/skill-detail/continue-learning.js.map +1 -0
  54. package/es/template/skill-detail/index.d.ts +101 -0
  55. package/es/template/skill-detail/index.d.ts.map +1 -0
  56. package/es/template/skill-detail/index.js +228 -0
  57. package/es/template/skill-detail/index.js.map +1 -0
  58. package/es/template/skill-detail/style.css +174 -0
  59. package/es/template/teams-dashboard/index.d.ts +4 -1
  60. package/lib/atom/button-link/style.css +1 -0
  61. package/lib/atom/select/index.d.ts.map +1 -1
  62. package/lib/atom/select/index.js +2 -1
  63. package/lib/atom/select/index.js.map +1 -1
  64. package/lib/atom/select/style.css +23 -0
  65. package/lib/molecule/cm-popin/types.d.ts +3 -0
  66. package/lib/molecule/cm-popin/types.d.ts.map +1 -1
  67. package/lib/molecule/dashboard/cards-list/index.d.ts +4 -1
  68. package/lib/molecule/dashboard/cards-list/index.d.ts.map +1 -1
  69. package/lib/molecule/dashboard/cards-list/index.js +8 -4
  70. package/lib/molecule/dashboard/cards-list/index.js.map +1 -1
  71. package/lib/molecule/dashboard/cards-list/prop-types.d.ts +3 -1
  72. package/lib/molecule/dashboard/cards-list/prop-types.d.ts.map +1 -1
  73. package/lib/molecule/dashboard/cards-list/prop-types.js.map +1 -1
  74. package/lib/molecule/dashboard/cards-list/style.css +4 -0
  75. package/lib/organism/cards-grid/index.d.ts +3 -0
  76. package/lib/organism/cards-grid/index.js +4 -1
  77. package/lib/organism/cards-grid/index.js.map +1 -1
  78. package/lib/organism/cards-grid/style.css +0 -1
  79. package/lib/template/app-player/loading/index.d.ts +3 -0
  80. package/lib/template/app-player/player/index.d.ts +6 -0
  81. package/lib/template/app-player/player/slides/index.d.ts +3 -0
  82. package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
  83. package/lib/template/app-player/popin-correction/index.d.ts +3 -0
  84. package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
  85. package/lib/template/app-player/popin-end/index.d.ts +7 -1
  86. package/lib/template/app-player/popin-end/summary.d.ts +4 -1
  87. package/lib/template/app-review/index.d.ts +3 -0
  88. package/lib/template/app-review/index.d.ts.map +1 -1
  89. package/lib/template/app-review/player/prop-types.d.ts +3 -0
  90. package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
  91. package/lib/template/app-review/prop-types.d.ts +3 -0
  92. package/lib/template/app-review/prop-types.d.ts.map +1 -1
  93. package/lib/template/back-office/brand-update/index.d.ts +3 -0
  94. package/lib/template/common/authors/index.d.ts +3 -0
  95. package/lib/template/common/authors/index.d.ts.map +1 -1
  96. package/lib/template/common/dashboard/index.d.ts +6 -0
  97. package/lib/template/common/search-page/index.d.ts +10 -1
  98. package/lib/template/external-course/index.d.ts +3 -0
  99. package/lib/template/my-learning/index.d.ts +3 -0
  100. package/lib/template/my-learning/index.d.ts.map +1 -1
  101. package/lib/template/my-learning/index.js +8 -3
  102. package/lib/template/my-learning/index.js.map +1 -1
  103. package/lib/template/skill-detail/all-courses.css +128 -0
  104. package/lib/template/skill-detail/all-courses.d.ts +80 -0
  105. package/lib/template/skill-detail/all-courses.d.ts.map +1 -0
  106. package/lib/template/skill-detail/all-courses.js +214 -0
  107. package/lib/template/skill-detail/all-courses.js.map +1 -0
  108. package/lib/template/skill-detail/continue-learning.css +16 -0
  109. package/lib/template/skill-detail/continue-learning.d.ts +39 -0
  110. package/lib/template/skill-detail/continue-learning.d.ts.map +1 -0
  111. package/lib/template/skill-detail/continue-learning.js +59 -0
  112. package/lib/template/skill-detail/continue-learning.js.map +1 -0
  113. package/lib/template/skill-detail/index.d.ts +101 -0
  114. package/lib/template/skill-detail/index.d.ts.map +1 -0
  115. package/lib/template/skill-detail/index.js +250 -0
  116. package/lib/template/skill-detail/index.js.map +1 -0
  117. package/lib/template/skill-detail/style.css +174 -0
  118. package/lib/template/teams-dashboard/index.d.ts +4 -1
  119. package/locales/en/global.json +8 -0
  120. package/package.json +2 -2
@@ -0,0 +1,195 @@
1
+ import _get from "lodash/fp/get";
2
+
3
+ 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); }
4
+
5
+ import React, { useState, useCallback, useEffect } from 'react';
6
+ import PropTypes from 'prop-types';
7
+ import Provider from '../../atom/provider';
8
+ import Select, { SelectOptionPropTypes } from '../../atom/select';
9
+ import ButtonLink from '../../atom/button-link';
10
+ import SearchForm from '../../molecule/search-form';
11
+ import CardsGrid from '../../organism/cards-grid';
12
+ import searchValueIncluded from '../../util/search-value-included';
13
+ import InputSwitch from '../../atom/input-switch';
14
+ import style from './all-courses.css';
15
+
16
+ const FilterButton = (props, context) => {
17
+ const {
18
+ selected,
19
+ filter,
20
+ onClick
21
+ } = props;
22
+ const {
23
+ skin
24
+ } = context;
25
+
26
+ const primarySkinColor = _get('common.primary', skin);
27
+
28
+ const buttonProps = {
29
+ customStyle: {
30
+ backgroundColor: selected ? primarySkinColor : '#E1E1E3',
31
+ color: selected ? '#FFFFFF' : '#515161',
32
+ transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out',
33
+ width: 'fit-content'
34
+ },
35
+ label: filter,
36
+ onClick,
37
+ 'data-name': 'filter-type-course-button'
38
+ };
39
+ return /*#__PURE__*/React.createElement(ButtonLink, buttonProps);
40
+ };
41
+
42
+ FilterButton.contextTypes = {
43
+ skin: Provider.childContextTypes.skin,
44
+ translate: Provider.childContextTypes.translate
45
+ };
46
+ FilterButton.propTypes = process.env.NODE_ENV !== "production" ? {
47
+ selected: PropTypes.bool,
48
+ filter: PropTypes.string,
49
+ onClick: PropTypes.func
50
+ } : {};
51
+
52
+ const AllCourses = (props, context) => {
53
+ const {
54
+ skillIncludedCourses,
55
+ totalCourses,
56
+ filters,
57
+ sorting
58
+ } = props;
59
+ const {
60
+ options,
61
+ onChange
62
+ } = filters;
63
+ const {
64
+ list,
65
+ loading
66
+ } = skillIncludedCourses;
67
+ const {
68
+ translate
69
+ } = context;
70
+ const [showCompleted, setShowCompleted] = useState(true);
71
+ const [searchValue, setSearchValue] = useState('');
72
+ const [searchResults, setSearchResults] = useState(list.sort((a, b) => {
73
+ const progressA = a.progress ?? 0;
74
+ const progressB = b.progress ?? 0;
75
+ return progressB - progressA;
76
+ }));
77
+ const sortView = sorting !== undefined ? /*#__PURE__*/React.createElement("div", {
78
+ "data-name": "choice"
79
+ }, /*#__PURE__*/React.createElement(Select, _extends({}, sorting, {
80
+ "aria-label": "All courses sort"
81
+ }))) : null;
82
+ useEffect(() => {
83
+ setSearchResults(list.sort((a, b) => {
84
+ const progressA = a.progress ?? 0;
85
+ const progressB = b.progress ?? 0;
86
+ return progressB - progressA;
87
+ }));
88
+ }, [list]);
89
+ const handleSearch = useCallback(value => {
90
+ setSearchValue(value);
91
+ setSearchResults(list.filter(skill => searchValueIncluded(skill.title, value)));
92
+ }, [list, setSearchValue, setSearchResults]);
93
+ const handleSearchReset = useCallback(() => {
94
+ setSearchValue('');
95
+ setSearchResults(list);
96
+ }, [list, setSearchValue, setSearchResults]);
97
+ const handleShowCompletedToggle = useCallback(() => {
98
+ const tempShowCompleted = !showCompleted;
99
+ setShowCompleted(tempShowCompleted);
100
+
101
+ if (tempShowCompleted) {
102
+ setSearchResults(list);
103
+ handleSearchReset();
104
+ } else {
105
+ setSearchResults(searchResults.filter(skill => skill.progress === 0));
106
+ }
107
+ }, [searchResults, showCompleted, setShowCompleted]);
108
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
109
+ className: style.continueLearningWrapper
110
+ }, /*#__PURE__*/React.createElement("span", {
111
+ className: style.continueLearningTitle
112
+ }, translate('all_courses')), /*#__PURE__*/React.createElement("span", {
113
+ className: style.continueLearningNumber
114
+ }, totalCourses)), /*#__PURE__*/React.createElement("div", {
115
+ className: style.searchAndSortSection
116
+ }, /*#__PURE__*/React.createElement("div", {
117
+ className: style.searchWrapper
118
+ }, /*#__PURE__*/React.createElement(SearchForm, {
119
+ search: {
120
+ placeholder: translate('search_place_holder'),
121
+ value: searchValue,
122
+ onChange: handleSearch
123
+ },
124
+ onReset: handleSearchReset
125
+ })), /*#__PURE__*/React.createElement("div", {
126
+ className: style.sortSection
127
+ }, /*#__PURE__*/React.createElement(InputSwitch, {
128
+ id: 'show-completed-courses-switch',
129
+ type: "switch",
130
+ name: translate('show_completed'),
131
+ title: translate('show_completed'),
132
+ "aria-label": 'Show completed courses aria label',
133
+ value: showCompleted,
134
+ onChange: handleShowCompletedToggle
135
+ }), /*#__PURE__*/React.createElement("div", {
136
+ className: style.sortWrapper
137
+ }, translate('sort_by'), sortView))), /*#__PURE__*/React.createElement("div", {
138
+ className: style.filterWrapper
139
+ }, options.length > 2 && searchResults.length > 0 ? options.map((filter, index) => {
140
+ const {
141
+ name,
142
+ value,
143
+ selected
144
+ } = filter;
145
+
146
+ function handleChange() {
147
+ onChange(value);
148
+ handleSearchReset();
149
+ }
150
+
151
+ return /*#__PURE__*/React.createElement("div", {
152
+ key: index,
153
+ className: style.filterButtonWrapper
154
+ }, /*#__PURE__*/React.createElement(FilterButton, {
155
+ selected: selected,
156
+ filter: name,
157
+ onClick: handleChange
158
+ }), value === 'ALL' ? /*#__PURE__*/React.createElement("div", {
159
+ className: style.divider
160
+ }) : null);
161
+ }) : null), /*#__PURE__*/React.createElement("div", null, searchResults.length > 0 ? /*#__PURE__*/React.createElement(CardsGrid, {
162
+ list: searchResults,
163
+ loading: loading,
164
+ customStyle: {
165
+ justifyContent: 'left'
166
+ }
167
+ }) : /*#__PURE__*/React.createElement("div", {
168
+ className: style.emptySearchResultContainer
169
+ }, /*#__PURE__*/React.createElement("div", {
170
+ className: style.emptySearchResultTitle
171
+ }, translate('empty_search_result_title', {
172
+ searchValue
173
+ })), /*#__PURE__*/React.createElement("div", {
174
+ className: style.emptySearchResultDescription
175
+ }, translate('empty_search_result_description')), /*#__PURE__*/React.createElement("div", {
176
+ className: style.emptySearchResultClearSearch,
177
+ onClick: handleSearchReset
178
+ }, translate('empty_search_result_clear_search')))));
179
+ };
180
+
181
+ AllCourses.contextTypes = {
182
+ skin: Provider.childContextTypes.skin,
183
+ translate: Provider.childContextTypes.translate
184
+ };
185
+ AllCourses.propTypes = process.env.NODE_ENV !== "production" ? {
186
+ skillIncludedCourses: PropTypes.shape(CardsGrid.propTypes),
187
+ totalCourses: PropTypes.number,
188
+ filters: PropTypes.shape({
189
+ onChange: PropTypes.func,
190
+ options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))
191
+ }),
192
+ sorting: PropTypes.shape(Select.propTypes)
193
+ } : {};
194
+ export default AllCourses;
195
+ //# sourceMappingURL=all-courses.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"all-courses.js","names":["React","useState","useCallback","useEffect","PropTypes","Provider","Select","SelectOptionPropTypes","ButtonLink","SearchForm","CardsGrid","searchValueIncluded","InputSwitch","style","FilterButton","props","context","selected","filter","onClick","skin","primarySkinColor","buttonProps","customStyle","backgroundColor","color","transition","width","label","contextTypes","childContextTypes","translate","propTypes","bool","string","func","AllCourses","skillIncludedCourses","totalCourses","filters","sorting","options","onChange","list","loading","showCompleted","setShowCompleted","searchValue","setSearchValue","searchResults","setSearchResults","sort","a","b","progressA","progress","progressB","sortView","undefined","handleSearch","value","skill","title","handleSearchReset","handleShowCompletedToggle","tempShowCompleted","continueLearningWrapper","continueLearningTitle","continueLearningNumber","searchAndSortSection","searchWrapper","placeholder","sortSection","sortWrapper","filterWrapper","length","map","index","name","handleChange","filterButtonWrapper","divider","justifyContent","emptySearchResultContainer","emptySearchResultTitle","emptySearchResultDescription","emptySearchResultClearSearch","shape","number","arrayOf"],"sources":["../../../src/template/skill-detail/all-courses.js"],"sourcesContent":["import React, {useState, useCallback, useEffect} from 'react';\nimport PropTypes from 'prop-types';\nimport {get} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport Select, {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLink from '../../atom/button-link';\nimport SearchForm from '../../molecule/search-form';\nimport CardsGrid from '../../organism/cards-grid';\nimport searchValueIncluded from '../../util/search-value-included';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './all-courses.css';\n\nconst FilterButton = (props, context) => {\n const {selected, filter, onClick} = props;\n const {skin} = context;\n const primarySkinColor = get('common.primary', skin);\n\n const buttonProps = {\n customStyle: {\n backgroundColor: selected ? primarySkinColor : '#E1E1E3',\n color: selected ? '#FFFFFF' : '#515161',\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out',\n width: 'fit-content'\n },\n label: filter,\n onClick,\n 'data-name': 'filter-type-course-button'\n };\n\n return <ButtonLink {...buttonProps} />;\n};\n\nFilterButton.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nFilterButton.propTypes = {\n selected: PropTypes.bool,\n filter: PropTypes.string,\n onClick: PropTypes.func\n};\n\nconst AllCourses = (props, context) => {\n const {skillIncludedCourses, totalCourses, filters, sorting} = props;\n const {options, onChange} = filters;\n const {list, loading} = skillIncludedCourses;\n const {translate} = context;\n const [showCompleted, setShowCompleted] = useState(true);\n const [searchValue, setSearchValue] = useState('');\n const [searchResults, setSearchResults] = useState(\n list.sort((a, b) => {\n const progressA = a.progress ?? 0;\n const progressB = b.progress ?? 0;\n return progressB - progressA;\n })\n );\n\n const sortView =\n sorting !== undefined ? (\n <div data-name=\"choice\">\n <Select {...sorting} aria-label=\"All courses sort\" />\n </div>\n ) : null;\n\n useEffect(() => {\n setSearchResults(\n list.sort((a, b) => {\n const progressA = a.progress ?? 0;\n const progressB = b.progress ?? 0;\n return progressB - progressA;\n })\n );\n }, [list]);\n\n const handleSearch = useCallback(\n value => {\n setSearchValue(value);\n setSearchResults(list.filter(skill => searchValueIncluded(skill.title, value)));\n },\n [list, setSearchValue, setSearchResults]\n );\n\n const handleSearchReset = useCallback(() => {\n setSearchValue('');\n setSearchResults(list);\n }, [list, setSearchValue, setSearchResults]);\n\n const handleShowCompletedToggle = useCallback(() => {\n const tempShowCompleted = !showCompleted;\n setShowCompleted(tempShowCompleted);\n if (tempShowCompleted) {\n setSearchResults(list);\n handleSearchReset();\n } else {\n setSearchResults(searchResults.filter(skill => skill.progress === 0));\n }\n }, [searchResults, showCompleted, setShowCompleted]);\n\n return (\n <>\n <div className={style.continueLearningWrapper}>\n <span className={style.continueLearningTitle}>{translate('all_courses')}</span>\n <span className={style.continueLearningNumber}>{totalCourses}</span>\n </div>\n <div className={style.searchAndSortSection}>\n <div className={style.searchWrapper}>\n <SearchForm\n search={{\n placeholder: translate('search_place_holder'),\n value: searchValue,\n onChange: handleSearch\n }}\n onReset={handleSearchReset}\n />\n </div>\n <div className={style.sortSection}>\n <InputSwitch\n id={'show-completed-courses-switch'}\n type=\"switch\"\n name={translate('show_completed')}\n title={translate('show_completed')}\n aria-label={'Show completed courses aria label'}\n value={showCompleted}\n onChange={handleShowCompletedToggle}\n />\n <div className={style.sortWrapper}>\n {translate('sort_by')}\n {sortView}\n </div>\n </div>\n </div>\n <div className={style.filterWrapper}>\n {options.length > 2 && searchResults.length > 0\n ? options.map((filter, index) => {\n const {name, value, selected} = filter;\n\n function handleChange() {\n onChange(value);\n handleSearchReset();\n }\n return (\n <div key={index} className={style.filterButtonWrapper}>\n <FilterButton selected={selected} filter={name} onClick={handleChange} />\n {value === 'ALL' ? <div className={style.divider} /> : null}\n </div>\n );\n })\n : null}\n </div>\n <div>\n {searchResults.length > 0 ? (\n <CardsGrid\n list={searchResults}\n loading={loading}\n customStyle={{justifyContent: 'left'}}\n />\n ) : (\n <div className={style.emptySearchResultContainer}>\n <div className={style.emptySearchResultTitle}>\n {translate('empty_search_result_title', {searchValue})}\n </div>\n <div className={style.emptySearchResultDescription}>\n {translate('empty_search_result_description')}\n </div>\n <div className={style.emptySearchResultClearSearch} onClick={handleSearchReset}>\n {translate('empty_search_result_clear_search')}\n </div>\n </div>\n )}\n </div>\n </>\n );\n};\n\nAllCourses.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nAllCourses.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};\n\nexport default AllCourses;\n"],"mappings":";;;;AAAA,OAAOA,KAAP,IAAeC,QAAf,EAAyBC,WAAzB,EAAsCC,SAAtC,QAAsD,OAAtD;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,MAAP,IAAgBC,qBAAhB,QAA4C,mBAA5C;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,UAAP,MAAuB,4BAAvB;AACA,OAAOC,SAAP,MAAsB,2BAAtB;AACA,OAAOC,mBAAP,M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2BAAD,EAA8B;IAACgB;EAAD,CAA9B,CADZ,CADF,eAIE;IAAK,SAAS,EAAElC,KAAK,CAACwE;EAAtB,GACGtD,SAAS,CAAC,iCAAD,CADZ,CAJF,eAOE;IAAK,SAAS,EAAElB,KAAK,CAACyE,4BAAtB;IAAoD,OAAO,EAAEvB;EAA7D,GACGhC,SAAS,CAAC,kCAAD,CADZ,CAPF,CARJ,CAlDF,CADF;AA0ED,CAlID;;AAoIAK,UAAU,CAACP,YAAX,GAA0B;EACxBT,IAAI,EAAEf,QAAQ,CAACyB,iBAAT,CAA2BV,IADT;EAExBW,SAAS,EAAE1B,QAAQ,CAACyB,iBAAT,CAA2BC;AAFd,CAA1B;AAKAK,UAAU,CAACJ,SAAX,2CAAuB;EACrBK,oBAAoB,EAAEjC,SAAS,CAACmF,KAAV,CAAgB7E,SAAS,CAACsB,SAA1B,CADD;EAErBM,YAAY,EAAElC,SAAS,CAACoF,MAFH;EAGrBjD,OAAO,EAAEnC,SAAS,CAACmF,KAAV,CAAgB;IACvB7C,QAAQ,EAAEtC,SAAS,CAAC+B,IADG;IAEvBM,OAAO,EAAErC,SAAS,CAACqF,OAAV,CAAkBrF,SAAS,CAACmF,KAAV,CAAgBhF,qBAAhB,CAAlB;EAFc,CAAhB,CAHY;EAOrBiC,OAAO,EAAEpC,SAAS,CAACmF,KAAV,CAAgBjF,MAAM,CAAC0B,SAAvB;AAPY,CAAvB;AAUA,eAAeI,UAAf"}
@@ -0,0 +1,16 @@
1
+ .continueLearningTitle {
2
+ font-size: 16px;
3
+ font-weight: 600;
4
+ line-height: 22px;
5
+ }
6
+
7
+ .continueLearningNumber {
8
+ border-radius: 50%;
9
+ background-color: #EAEAEB;
10
+ color: #515161;
11
+ padding: 2px 4px;
12
+ margin-left: 8px;
13
+ font-size: 10px;
14
+ font-weight: 600;
15
+ line-height: 12px;
16
+ }
@@ -0,0 +1,39 @@
1
+ export default ContinueLearning;
2
+ declare function ContinueLearning(props: any, context: any): JSX.Element | null;
3
+ declare namespace ContinueLearning {
4
+ namespace contextTypes {
5
+ const skin: PropTypes.Requireable<PropTypes.InferProps<{
6
+ common: PropTypes.Requireable<{
7
+ [x: string]: any;
8
+ }>;
9
+ images: PropTypes.Requireable<PropTypes.InferProps<{
10
+ 'logo-mobile': PropTypes.Requireable<any>;
11
+ logo: PropTypes.Requireable<any>;
12
+ 'logo-email': PropTypes.Requireable<any>;
13
+ login: PropTypes.Requireable<any>;
14
+ }>>;
15
+ icons: PropTypes.Requireable<{
16
+ [x: string]: any;
17
+ }>;
18
+ mod: PropTypes.Requireable<{
19
+ [x: string]: any;
20
+ }>;
21
+ courses: PropTypes.Requireable<any[]>;
22
+ texts: PropTypes.Requireable<{
23
+ [x: string]: any;
24
+ }>;
25
+ }>>;
26
+ const translate: PropTypes.Requireable<(...args: any[]) => any>;
27
+ }
28
+ namespace propTypes {
29
+ const ongoingCourses: PropTypes.Requireable<PropTypes.InferProps<{
30
+ list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
31
+ customStyle: PropTypes.Requireable<{
32
+ [x: string]: string | null | undefined;
33
+ }>;
34
+ loading: PropTypes.Requireable<boolean>;
35
+ }>>;
36
+ }
37
+ }
38
+ import PropTypes from "prop-types";
39
+ //# sourceMappingURL=continue-learning.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"continue-learning.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/continue-learning.js"],"names":[],"mappings":";AAOA,gFAsBC"}
@@ -0,0 +1,42 @@
1
+ import React, { useCallback } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import Provider from '../../atom/provider';
4
+ import CardsGrid from '../../organism/cards-grid';
5
+ import CardsList from '../../molecule/dashboard/cards-list';
6
+ import style from './continue-learning.css';
7
+
8
+ const ContinueLearning = (props, context) => {
9
+ const {
10
+ ongoingCourses
11
+ } = props;
12
+ const {
13
+ translate
14
+ } = context;
15
+ const Title = useCallback(() => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
16
+ className: style.continueLearningTitle
17
+ }, translate('continue_learning')), /*#__PURE__*/React.createElement("span", {
18
+ className: style.continueLearningNumber
19
+ }, ongoingCourses.list.length)));
20
+
21
+ if (ongoingCourses.list.length === 0) {
22
+ return null;
23
+ }
24
+
25
+ return /*#__PURE__*/React.createElement(CardsList, {
26
+ cards: ongoingCourses.list,
27
+ title: /*#__PURE__*/React.createElement(Title, null),
28
+ customStyle: {
29
+ padding: '16px 0px 8px'
30
+ }
31
+ });
32
+ };
33
+
34
+ ContinueLearning.contextTypes = {
35
+ skin: Provider.childContextTypes.skin,
36
+ translate: Provider.childContextTypes.translate
37
+ };
38
+ ContinueLearning.propTypes = process.env.NODE_ENV !== "production" ? {
39
+ ongoingCourses: PropTypes.shape(CardsGrid.propTypes)
40
+ } : {};
41
+ export default ContinueLearning;
42
+ //# sourceMappingURL=continue-learning.js.map
@@ -0,0 +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 <span className={style.continueLearningTitle}>{translate('continue_learning')}</span>\n <span className={style.continueLearningNumber}>{ongoingCourses.list.length}</span>\n </>\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;AACA,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,CAAC,mBACxB,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,CADuB,CAAzB;;EAOA,IAAIN,cAAc,CAACK,IAAf,CAAoBC,MAApB,KAA+B,CAAnC,EAAsC;IACpC,OAAO,IAAP;EACD;;EAED,oBACE,oBAAC,SAAD;IACE,KAAK,EAAEN,cAAc,CAACK,IADxB;IAEE,KAAK,eAAE,oBAAC,KAAD,OAFT;IAGE,WAAW,EAAE;MAACE,OAAO,EAAE;IAAV;EAHf,EADF;AAOD,CAtBD;;AAwBAV,gBAAgB,CAACW,YAAjB,GAAgC;EAC9BC,IAAI,EAAEhB,QAAQ,CAACiB,iBAAT,CAA2BD,IADH;EAE9BR,SAAS,EAAER,QAAQ,CAACiB,iBAAT,CAA2BT;AAFR,CAAhC;AAKAJ,gBAAgB,CAACc,SAAjB,2CAA6B;EAC3BX,cAAc,EAAER,SAAS,CAACoB,KAAV,CAAgBlB,SAAS,CAACiB,SAA1B;AADW,CAA7B;AAIA,eAAed,gBAAf"}
@@ -0,0 +1,101 @@
1
+ export default SkillDetail;
2
+ declare function SkillDetail(props: any, context: any): JSX.Element;
3
+ declare namespace SkillDetail {
4
+ namespace contextTypes {
5
+ const skin: PropTypes.Requireable<PropTypes.InferProps<{
6
+ common: PropTypes.Requireable<{
7
+ [x: string]: any;
8
+ }>;
9
+ images: PropTypes.Requireable<PropTypes.InferProps<{
10
+ 'logo-mobile': PropTypes.Requireable<any>;
11
+ logo: PropTypes.Requireable<any>;
12
+ 'logo-email': PropTypes.Requireable<any>;
13
+ login: PropTypes.Requireable<any>;
14
+ }>>;
15
+ icons: PropTypes.Requireable<{
16
+ [x: string]: any;
17
+ }>;
18
+ mod: PropTypes.Requireable<{
19
+ [x: string]: any;
20
+ }>;
21
+ courses: PropTypes.Requireable<any[]>;
22
+ texts: PropTypes.Requireable<{
23
+ [x: string]: any;
24
+ }>;
25
+ }>>;
26
+ const translate: PropTypes.Requireable<(...args: any[]) => any>;
27
+ }
28
+ namespace propTypes {
29
+ const title: PropTypes.Validator<string>;
30
+ const ref: PropTypes.Validator<string>;
31
+ const description: PropTypes.Requireable<string>;
32
+ const metrics: PropTypes.Requireable<PropTypes.InferProps<{
33
+ score: PropTypes.Requireable<number>;
34
+ content: PropTypes.Requireable<number>;
35
+ questionsToReview: PropTypes.Requireable<number>;
36
+ contentCompleted: PropTypes.Requireable<number>;
37
+ }>>;
38
+ const focused: PropTypes.Requireable<boolean>;
39
+ const availableForReview: PropTypes.Requireable<boolean>;
40
+ const ongoingCourses: PropTypes.Requireable<PropTypes.InferProps<{
41
+ list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
42
+ customStyle: PropTypes.Requireable<{
43
+ [x: string]: string | null | undefined;
44
+ }>;
45
+ loading: PropTypes.Requireable<boolean>;
46
+ }>>;
47
+ const skillIncludedCourses: PropTypes.Requireable<PropTypes.InferProps<{
48
+ list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
49
+ customStyle: PropTypes.Requireable<{
50
+ [x: string]: string | null | undefined;
51
+ }>;
52
+ loading: PropTypes.Requireable<boolean>;
53
+ }>>;
54
+ const totalCourses: PropTypes.Requireable<number>;
55
+ const filters: PropTypes.Requireable<PropTypes.InferProps<{
56
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
57
+ options: PropTypes.Requireable<(PropTypes.InferProps<{
58
+ name: PropTypes.Validator<string>;
59
+ value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
60
+ selected: PropTypes.Requireable<boolean>;
61
+ validOption: PropTypes.Requireable<boolean>;
62
+ }> | null | undefined)[]>;
63
+ }>>;
64
+ const sorting: PropTypes.Requireable<PropTypes.InferProps<{
65
+ title: PropTypes.Requireable<string>;
66
+ name: PropTypes.Requireable<string>;
67
+ className: PropTypes.Requireable<string>;
68
+ borderClassName: PropTypes.Requireable<string>;
69
+ disabled: PropTypes.Requireable<boolean>;
70
+ multiple: PropTypes.Requireable<boolean>;
71
+ description: PropTypes.Requireable<string>;
72
+ required: PropTypes.Requireable<boolean>;
73
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
74
+ theme: PropTypes.Requireable<string>;
75
+ options: PropTypes.Requireable<(PropTypes.InferProps<{
76
+ name: PropTypes.Validator<string>;
77
+ value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
78
+ selected: PropTypes.Requireable<boolean>;
79
+ validOption: PropTypes.Requireable<boolean>;
80
+ }> | null | undefined)[]>;
81
+ optgroups: PropTypes.Requireable<(PropTypes.InferProps<{
82
+ label: PropTypes.Validator<string>;
83
+ options: PropTypes.Requireable<(PropTypes.InferProps<{
84
+ name: PropTypes.Validator<string>;
85
+ value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
86
+ selected: PropTypes.Requireable<boolean>;
87
+ validOption: PropTypes.Requireable<boolean>;
88
+ }> | null | undefined)[]>;
89
+ }> | null | undefined)[]>;
90
+ modified: PropTypes.Requireable<boolean>;
91
+ error: PropTypes.Requireable<boolean>;
92
+ 'aria-label': PropTypes.Requireable<string>;
93
+ 'aria-labelledby': PropTypes.Requireable<string>;
94
+ }>>;
95
+ const onBackClick: PropTypes.Requireable<(...args: any[]) => any>;
96
+ const onReviewClick: PropTypes.Requireable<(...args: any[]) => any>;
97
+ const onContinueLearningClick: PropTypes.Requireable<(...args: any[]) => any>;
98
+ }
99
+ }
100
+ import PropTypes from "prop-types";
101
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/index.js"],"names":[],"mappings":";AA8DA,oEA+JC"}
@@ -0,0 +1,228 @@
1
+ import _get from "lodash/fp/get";
2
+ import React, { useCallback, useState } from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import { convert } from 'css-color-function';
5
+ import classnames from 'classnames';
6
+ import Provider from '../../atom/provider';
7
+ import Select, { SelectOptionPropTypes } from '../../atom/select';
8
+ import ButtonLink from '../../atom/button-link';
9
+ import Icon from '../../atom/icon';
10
+ import CardsGrid from '../../organism/cards-grid';
11
+ import style from './style.css';
12
+ import AllCourses from './all-courses';
13
+ import ContinueLearning from './continue-learning';
14
+
15
+ const ContinueLearningButton = (props, context) => {
16
+ const [hovered, setHovered] = useState(false);
17
+ const {
18
+ ongoingCoursesAvailable,
19
+ onClick
20
+ } = props;
21
+ const {
22
+ skin,
23
+ translate
24
+ } = context;
25
+
26
+ const primarySkinColor = _get('common.primary', skin);
27
+
28
+ const handleMouseOver = useCallback(() => setHovered(true), [setHovered]);
29
+ const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);
30
+ return /*#__PURE__*/React.createElement("div", {
31
+ onMouseOver: handleMouseOver,
32
+ onMouseLeave: handleMouseLeave
33
+ }, /*#__PURE__*/React.createElement(ButtonLink, {
34
+ label: ongoingCoursesAvailable ? translate('continue_learning') : translate('start_learning'),
35
+ type: "primary",
36
+ customStyle: {
37
+ width: 'fit-content',
38
+ borderRadius: '12px',
39
+ backgroundColor: hovered ? convert(`hsl(from ${primarySkinColor} h s calc(l*(1 - 0.08)))`) : primarySkinColor
40
+ },
41
+ icon: {
42
+ position: 'left',
43
+ faIcon: {
44
+ name: 'play',
45
+ color: '#FFFFFF',
46
+ size: 16
47
+ }
48
+ },
49
+ onClick: onClick
50
+ }));
51
+ };
52
+
53
+ ContinueLearningButton.contextTypes = {
54
+ skin: Provider.childContextTypes.skin,
55
+ translate: Provider.childContextTypes.translate
56
+ };
57
+ ContinueLearningButton.propTypes = process.env.NODE_ENV !== "production" ? {
58
+ ongoingCoursesAvailable: PropTypes.bool,
59
+ onClick: PropTypes.func
60
+ } : {};
61
+
62
+ const SkillDetail = (props, context) => {
63
+ const {
64
+ title,
65
+ ref,
66
+ description,
67
+ metrics = {},
68
+ focused,
69
+ availableForReview,
70
+ ongoingCourses,
71
+ skillIncludedCourses,
72
+ totalCourses,
73
+ filters,
74
+ sorting,
75
+ onBackClick,
76
+ onReviewClick,
77
+ onContinueLearningClick
78
+ } = props;
79
+ const {
80
+ score,
81
+ content,
82
+ questionsToReview,
83
+ contentCompleted = 0
84
+ } = metrics;
85
+ const {
86
+ translate
87
+ } = context;
88
+ const [showMore, setShowMore] = useState(false);
89
+ const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);
90
+ const Description = useCallback(() => {
91
+ return /*#__PURE__*/React.createElement("div", {
92
+ className: classnames(style.description, !showMore && style.truncate)
93
+ }, description);
94
+ });
95
+ const ProgressBar = useCallback(() => {
96
+ if (score === undefined) return null;
97
+ const progressBarColor = '#3EC483';
98
+ const inlineProgressValueStyle = {
99
+ backgroundColor: progressBarColor,
100
+ width: `${score}%`
101
+ };
102
+ return /*#__PURE__*/React.createElement("div", {
103
+ className: style.progressBarWrapper
104
+ }, /*#__PURE__*/React.createElement("div", {
105
+ "data-name": "progress",
106
+ className: style.progress,
107
+ style: inlineProgressValueStyle,
108
+ role: "progressbar"
109
+ }));
110
+ }, [score]);
111
+ return /*#__PURE__*/React.createElement("div", {
112
+ className: style.backgroundContainer
113
+ }, /*#__PURE__*/React.createElement("div", {
114
+ className: style.container,
115
+ "data-name": ref
116
+ }, /*#__PURE__*/React.createElement("div", {
117
+ className: style.backButtonWrapper,
118
+ onClick: onBackClick
119
+ }, /*#__PURE__*/React.createElement(Icon, {
120
+ iconName: "arrow-left",
121
+ size: {
122
+ faSize: 14,
123
+ wrapperSize: 14
124
+ }
125
+ })), /*#__PURE__*/React.createElement("div", {
126
+ className: style.ctaContainer
127
+ }, /*#__PURE__*/React.createElement("div", null, focused ? /*#__PURE__*/React.createElement("div", {
128
+ className: style.skillFocusBadge
129
+ }, /*#__PURE__*/React.createElement(Icon, {
130
+ iconName: "bullseye-arrow",
131
+ backgroundColor: "#DDD1FF",
132
+ size: {
133
+ faSize: 10,
134
+ wrapperSize: 16
135
+ }
136
+ }), translate('skill_focus')) : null, /*#__PURE__*/React.createElement("div", {
137
+ className: style.title
138
+ }, title), description ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Description, null), description.length >= 226 ? /*#__PURE__*/React.createElement("div", {
139
+ className: style.showMoreWrapper,
140
+ onClick: handleShowMore
141
+ }, showMore ? translate('Show less') : translate('Show more'), /*#__PURE__*/React.createElement(Icon, {
142
+ iconName: showMore ? 'chevron-up' : 'chevron-down',
143
+ size: {
144
+ faSize: 14,
145
+ wrapperSize: 16
146
+ }
147
+ })) : null) : null), /*#__PURE__*/React.createElement("div", {
148
+ className: style.ctaWrapper
149
+ }, /*#__PURE__*/React.createElement(ButtonLink, {
150
+ type: "secondary",
151
+ onClick: onReviewClick,
152
+ label: translate('review_this_skill'),
153
+ disabled: !availableForReview,
154
+ customStyle: {
155
+ width: 'fit-content',
156
+ borderRadius: '12px'
157
+ }
158
+ }), /*#__PURE__*/React.createElement(ContinueLearningButton, {
159
+ ongoingCoursesAvailable: !!ongoingCourses.list.length,
160
+ onClick: onContinueLearningClick
161
+ }))), score !== undefined ? /*#__PURE__*/React.createElement("div", {
162
+ className: style.progressInformationsWrapper
163
+ }, /*#__PURE__*/React.createElement("div", {
164
+ className: style.progressTitle
165
+ }, translate('your_progress')), /*#__PURE__*/React.createElement("div", {
166
+ className: style.skillCoursesAndQuestionsWrapper
167
+ }, content ? /*#__PURE__*/React.createElement("div", {
168
+ className: style.skillInformation,
169
+ "data-name": "skill-courses"
170
+ }, /*#__PURE__*/React.createElement("span", {
171
+ className: style.skillInformationNumber
172
+ }, content), ' ', translate('courses')) : null, questionsToReview ? /*#__PURE__*/React.createElement("div", {
173
+ className: style.skillInformation,
174
+ "data-name": "skill-questions"
175
+ }, /*#__PURE__*/React.createElement("span", {
176
+ className: style.skillInformationNumber
177
+ }, questionsToReview), "\xA0", translate('questions')) : null), /*#__PURE__*/React.createElement(ProgressBar, null), /*#__PURE__*/React.createElement("div", {
178
+ className: style.progressInformations
179
+ }, content && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
180
+ className: style.progressInformation,
181
+ "data-name": "skill-completed-courses"
182
+ }, /*#__PURE__*/React.createElement("span", {
183
+ className: style.progressInformationNumber
184
+ }, contentCompleted), ` ${translate('courses_completed')}`), /*#__PURE__*/React.createElement("div", {
185
+ className: style.progressInformation,
186
+ "data-name": "completed-percentage"
187
+ }, /*#__PURE__*/React.createElement("span", {
188
+ className: style.progressInformationNumber
189
+ }, score, "%"))))) : null, /*#__PURE__*/React.createElement(ContinueLearning, {
190
+ ongoingCourses: ongoingCourses
191
+ }), /*#__PURE__*/React.createElement(AllCourses, {
192
+ skillIncludedCourses: skillIncludedCourses,
193
+ totalCourses: totalCourses,
194
+ filters: filters,
195
+ sorting: sorting
196
+ })));
197
+ };
198
+
199
+ SkillDetail.contextTypes = {
200
+ skin: Provider.childContextTypes.skin,
201
+ translate: Provider.childContextTypes.translate
202
+ };
203
+ SkillDetail.propTypes = process.env.NODE_ENV !== "production" ? {
204
+ title: PropTypes.string.isRequired,
205
+ ref: PropTypes.string.isRequired,
206
+ description: PropTypes.string,
207
+ metrics: PropTypes.shape({
208
+ score: PropTypes.number,
209
+ content: PropTypes.number,
210
+ questionsToReview: PropTypes.number,
211
+ contentCompleted: PropTypes.number
212
+ }),
213
+ focused: PropTypes.bool,
214
+ availableForReview: PropTypes.bool,
215
+ ongoingCourses: PropTypes.shape(CardsGrid.propTypes),
216
+ skillIncludedCourses: PropTypes.shape(CardsGrid.propTypes),
217
+ totalCourses: PropTypes.number,
218
+ filters: PropTypes.shape({
219
+ onChange: PropTypes.func,
220
+ options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))
221
+ }),
222
+ sorting: PropTypes.shape(Select.propTypes),
223
+ onBackClick: PropTypes.func,
224
+ onReviewClick: PropTypes.func,
225
+ onContinueLearningClick: PropTypes.func
226
+ } : {};
227
+ export default SkillDetail;
228
+ //# sourceMappingURL=index.js.map