@coorpacademy/components 11.32.10 → 11.32.12-alpha.0

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 (142) hide show
  1. package/es/atom/select/index.d.ts.map +1 -1
  2. package/es/atom/select/index.js +2 -1
  3. package/es/atom/select/index.js.map +1 -1
  4. package/es/atom/select/style.css +28 -0
  5. package/es/molecule/cm-popin/types.d.ts +1 -0
  6. package/es/molecule/cm-popin/types.d.ts.map +1 -1
  7. package/es/molecule/discipline-header/index.js +1 -1
  8. package/es/molecule/discipline-header/index.js.map +1 -1
  9. package/es/molecule/learner-skill-card/index.d.ts.map +1 -1
  10. package/es/molecule/learner-skill-card/index.js +2 -1
  11. package/es/molecule/learner-skill-card/index.js.map +1 -1
  12. package/es/molecule/learner-skill-card/style.css +1 -0
  13. package/es/organism/cards-grid/index.d.ts +1 -0
  14. package/es/organism/cards-grid/index.js +6 -1
  15. package/es/organism/cards-grid/index.js.map +1 -1
  16. package/es/organism/cards-grid/style.css +0 -1
  17. package/es/template/app-player/loading/index.d.ts +1 -0
  18. package/es/template/app-player/player/index.d.ts +2 -0
  19. package/es/template/app-player/player/slides/index.d.ts +1 -0
  20. package/es/template/app-player/player/slides/index.d.ts.map +1 -1
  21. package/es/template/app-player/popin-correction/index.d.ts +1 -0
  22. package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
  23. package/es/template/app-player/popin-end/index.d.ts +1 -0
  24. package/es/template/app-review/index.d.ts +1 -0
  25. package/es/template/app-review/index.d.ts.map +1 -1
  26. package/es/template/app-review/player/prop-types.d.ts +1 -0
  27. package/es/template/app-review/player/prop-types.d.ts.map +1 -1
  28. package/es/template/app-review/prop-types.d.ts +1 -0
  29. package/es/template/app-review/prop-types.d.ts.map +1 -1
  30. package/es/template/back-office/brand-update/index.d.ts +1 -0
  31. package/es/template/common/authors/index.d.ts +1 -0
  32. package/es/template/common/authors/index.d.ts.map +1 -1
  33. package/es/template/common/dashboard/index.d.ts +2 -0
  34. package/es/template/common/search-page/index.d.ts +2 -0
  35. package/es/template/external-course/index.d.ts +1 -0
  36. package/es/template/skill-detail/all-courses.css +89 -0
  37. package/es/template/skill-detail/all-courses.d.ts +77 -0
  38. package/es/template/skill-detail/all-courses.d.ts.map +1 -0
  39. package/es/template/skill-detail/all-courses.js +168 -0
  40. package/es/template/skill-detail/all-courses.js.map +1 -0
  41. package/es/template/skill-detail/continue-learning.css +21 -0
  42. package/es/template/skill-detail/continue-learning.d.ts +37 -0
  43. package/es/template/skill-detail/continue-learning.d.ts.map +1 -0
  44. package/es/template/skill-detail/continue-learning.js +40 -0
  45. package/es/template/skill-detail/continue-learning.js.map +1 -0
  46. package/es/template/skill-detail/index.d.ts +95 -0
  47. package/es/template/skill-detail/index.d.ts.map +1 -0
  48. package/es/template/skill-detail/index.js +219 -0
  49. package/es/template/skill-detail/index.js.map +1 -0
  50. package/es/template/skill-detail/style.css +163 -0
  51. package/lib/atom/select/index.d.ts.map +1 -1
  52. package/lib/atom/select/index.js +2 -1
  53. package/lib/atom/select/index.js.map +1 -1
  54. package/lib/atom/select/style.css +28 -0
  55. package/lib/molecule/cm-popin/types.d.ts +1 -0
  56. package/lib/molecule/cm-popin/types.d.ts.map +1 -1
  57. package/lib/molecule/discipline-header/index.js +1 -1
  58. package/lib/molecule/discipline-header/index.js.map +1 -1
  59. package/lib/molecule/learner-skill-card/index.d.ts.map +1 -1
  60. package/lib/molecule/learner-skill-card/index.js +2 -1
  61. package/lib/molecule/learner-skill-card/index.js.map +1 -1
  62. package/lib/molecule/learner-skill-card/style.css +1 -0
  63. package/lib/organism/cards-grid/index.d.ts +1 -0
  64. package/lib/organism/cards-grid/index.js +6 -1
  65. package/lib/organism/cards-grid/index.js.map +1 -1
  66. package/lib/organism/cards-grid/style.css +0 -1
  67. package/lib/template/app-player/loading/index.d.ts +1 -0
  68. package/lib/template/app-player/player/index.d.ts +2 -0
  69. package/lib/template/app-player/player/slides/index.d.ts +1 -0
  70. package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
  71. package/lib/template/app-player/popin-correction/index.d.ts +1 -0
  72. package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
  73. package/lib/template/app-player/popin-end/index.d.ts +1 -0
  74. package/lib/template/app-review/index.d.ts +1 -0
  75. package/lib/template/app-review/index.d.ts.map +1 -1
  76. package/lib/template/app-review/player/prop-types.d.ts +1 -0
  77. package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
  78. package/lib/template/app-review/prop-types.d.ts +1 -0
  79. package/lib/template/app-review/prop-types.d.ts.map +1 -1
  80. package/lib/template/back-office/brand-update/index.d.ts +1 -0
  81. package/lib/template/common/authors/index.d.ts +1 -0
  82. package/lib/template/common/authors/index.d.ts.map +1 -1
  83. package/lib/template/common/dashboard/index.d.ts +2 -0
  84. package/lib/template/common/search-page/index.d.ts +2 -0
  85. package/lib/template/external-course/index.d.ts +1 -0
  86. package/lib/template/skill-detail/all-courses.css +89 -0
  87. package/lib/template/skill-detail/all-courses.d.ts +77 -0
  88. package/lib/template/skill-detail/all-courses.d.ts.map +1 -0
  89. package/lib/template/skill-detail/all-courses.js +187 -0
  90. package/lib/template/skill-detail/all-courses.js.map +1 -0
  91. package/lib/template/skill-detail/continue-learning.css +21 -0
  92. package/lib/template/skill-detail/continue-learning.d.ts +37 -0
  93. package/lib/template/skill-detail/continue-learning.d.ts.map +1 -0
  94. package/lib/template/skill-detail/continue-learning.js +52 -0
  95. package/lib/template/skill-detail/continue-learning.js.map +1 -0
  96. package/lib/template/skill-detail/index.d.ts +95 -0
  97. package/lib/template/skill-detail/index.d.ts.map +1 -0
  98. package/lib/template/skill-detail/index.js +241 -0
  99. package/lib/template/skill-detail/index.js.map +1 -0
  100. package/lib/template/skill-detail/style.css +163 -0
  101. package/locales/en/global.json +7 -0
  102. package/package.json +3 -2
  103. package/es/stories/Configure.mdx +0 -364
  104. package/es/stories/assets/accessibility.png +0 -0
  105. package/es/stories/assets/accessibility.svg +0 -5
  106. package/es/stories/assets/addon-library.png +0 -0
  107. package/es/stories/assets/assets.png +0 -0
  108. package/es/stories/assets/avif-test-image.avif +0 -0
  109. package/es/stories/assets/context.png +0 -0
  110. package/es/stories/assets/discord.svg +0 -15
  111. package/es/stories/assets/docs.png +0 -0
  112. package/es/stories/assets/figma-plugin.png +0 -0
  113. package/es/stories/assets/github.svg +0 -3
  114. package/es/stories/assets/share.png +0 -0
  115. package/es/stories/assets/styling.png +0 -0
  116. package/es/stories/assets/testing.png +0 -0
  117. package/es/stories/assets/theming.png +0 -0
  118. package/es/stories/assets/tutorials.svg +0 -12
  119. package/es/stories/assets/youtube.svg +0 -4
  120. package/es/stories/button.css +0 -30
  121. package/es/stories/header.css +0 -32
  122. package/es/stories/page.css +0 -69
  123. package/lib/stories/Configure.mdx +0 -364
  124. package/lib/stories/assets/accessibility.png +0 -0
  125. package/lib/stories/assets/accessibility.svg +0 -5
  126. package/lib/stories/assets/addon-library.png +0 -0
  127. package/lib/stories/assets/assets.png +0 -0
  128. package/lib/stories/assets/avif-test-image.avif +0 -0
  129. package/lib/stories/assets/context.png +0 -0
  130. package/lib/stories/assets/discord.svg +0 -15
  131. package/lib/stories/assets/docs.png +0 -0
  132. package/lib/stories/assets/figma-plugin.png +0 -0
  133. package/lib/stories/assets/github.svg +0 -3
  134. package/lib/stories/assets/share.png +0 -0
  135. package/lib/stories/assets/styling.png +0 -0
  136. package/lib/stories/assets/testing.png +0 -0
  137. package/lib/stories/assets/theming.png +0 -0
  138. package/lib/stories/assets/tutorials.svg +0 -12
  139. package/lib/stories/assets/youtube.svg +0 -4
  140. package/lib/stories/button.css +0 -30
  141. package/lib/stories/header.css +0 -32
  142. package/lib/stories/page.css +0 -69
@@ -0,0 +1,219 @@
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
+ onClick
19
+ } = props;
20
+ const {
21
+ skin,
22
+ translate
23
+ } = context;
24
+
25
+ const primarySkinColor = _get('common.primary', skin);
26
+
27
+ const handleMouseOver = useCallback(() => setHovered(true), [setHovered]);
28
+ const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);
29
+ return /*#__PURE__*/React.createElement("div", {
30
+ onMouseOver: handleMouseOver,
31
+ onMouseLeave: handleMouseLeave
32
+ }, /*#__PURE__*/React.createElement(ButtonLink, {
33
+ label: translate('continue_learning'),
34
+ type: "primary",
35
+ customStyle: {
36
+ width: 'fit-content',
37
+ borderRadius: '12px',
38
+ backgroundColor: hovered ? convert(`hsl(from ${primarySkinColor} h s calc(l*(1 - 0.08)))`) : primarySkinColor
39
+ },
40
+ icon: {
41
+ position: 'left',
42
+ faIcon: {
43
+ name: 'play',
44
+ color: '#FFFFFF',
45
+ size: 16
46
+ }
47
+ },
48
+ onClick: onClick
49
+ }));
50
+ };
51
+
52
+ ContinueLearningButton.contextTypes = {
53
+ skin: Provider.childContextTypes.skin,
54
+ translate: Provider.childContextTypes.translate
55
+ };
56
+ ContinueLearningButton.propTypes = process.env.NODE_ENV !== "production" ? {
57
+ onClick: PropTypes.func
58
+ } : {};
59
+
60
+ const SkillDetail = (props, context) => {
61
+ const {
62
+ title,
63
+ description,
64
+ metrics,
65
+ focused,
66
+ availableForReview,
67
+ ongoingCourses,
68
+ skillIncludedCourses,
69
+ filters,
70
+ sorting,
71
+ onBackClick,
72
+ onReviewClick,
73
+ onContinueLearningClick
74
+ } = props;
75
+ const {
76
+ score,
77
+ content,
78
+ questionsToReview,
79
+ contentCompleted = 0
80
+ } = metrics;
81
+ const {
82
+ translate
83
+ } = context;
84
+ const [showMore, setShowMore] = useState(false);
85
+ const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);
86
+ const Description = useCallback(() => {
87
+ return /*#__PURE__*/React.createElement("div", {
88
+ className: classnames(style.description, !showMore && style.truncate)
89
+ }, description);
90
+ });
91
+ const ProgressBar = useCallback(() => {
92
+ if (score === undefined) return null;
93
+ const progressBarColor = '#3EC483';
94
+ const inlineProgressValueStyle = {
95
+ backgroundColor: progressBarColor,
96
+ width: `${score}%`
97
+ };
98
+ return /*#__PURE__*/React.createElement("div", {
99
+ className: style.progressBarWrapper
100
+ }, /*#__PURE__*/React.createElement("div", {
101
+ "data-name": "progress",
102
+ className: style.progress,
103
+ style: inlineProgressValueStyle,
104
+ role: "progressbar"
105
+ }));
106
+ }, [score]);
107
+ return /*#__PURE__*/React.createElement("div", {
108
+ className: style.backgroundContainer
109
+ }, /*#__PURE__*/React.createElement("div", {
110
+ className: style.container
111
+ }, /*#__PURE__*/React.createElement("div", {
112
+ className: style.backButtonWrapper,
113
+ onClick: onBackClick
114
+ }, /*#__PURE__*/React.createElement(Icon, {
115
+ iconName: "arrow-left",
116
+ size: {
117
+ faSize: 14,
118
+ wrapperSize: 14
119
+ }
120
+ })), /*#__PURE__*/React.createElement("div", {
121
+ className: style.ctaContainer
122
+ }, /*#__PURE__*/React.createElement("div", null, focused ? /*#__PURE__*/React.createElement("div", {
123
+ className: style.skillFocusBadge
124
+ }, /*#__PURE__*/React.createElement(Icon, {
125
+ iconName: "bullseye-arrow",
126
+ backgroundColor: "#DDD1FF",
127
+ size: {
128
+ faSize: 10,
129
+ wrapperSize: 16
130
+ }
131
+ }), translate('skill_focus')) : null, /*#__PURE__*/React.createElement("div", {
132
+ className: style.title
133
+ }, title), description ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Description, null), description.length >= 226 ? /*#__PURE__*/React.createElement("div", {
134
+ className: style.showMoreWrapper,
135
+ onClick: handleShowMore
136
+ }, showMore ? translate('Show less') : translate('Show more'), /*#__PURE__*/React.createElement(Icon, {
137
+ iconName: showMore ? 'chevron-up' : 'chevron-down',
138
+ size: {
139
+ faSize: 14,
140
+ wrapperSize: 16
141
+ }
142
+ })) : null) : null), /*#__PURE__*/React.createElement("div", {
143
+ className: style.ctaWrapper
144
+ }, /*#__PURE__*/React.createElement(ButtonLink, {
145
+ type: "secondary",
146
+ onClick: onReviewClick,
147
+ label: translate('review_this_skill'),
148
+ disabled: !availableForReview,
149
+ customStyle: {
150
+ width: 'fit-content',
151
+ borderRadius: '12px'
152
+ }
153
+ }), /*#__PURE__*/React.createElement(ContinueLearningButton, {
154
+ onClick: onContinueLearningClick
155
+ }))), /*#__PURE__*/React.createElement("div", {
156
+ className: style.progressInformationsWrapper
157
+ }, /*#__PURE__*/React.createElement("div", {
158
+ className: style.progressTitle
159
+ }, translate('your_progress')), /*#__PURE__*/React.createElement("div", {
160
+ className: style.skillCoursesAndQuestionsWrapper
161
+ }, content ? /*#__PURE__*/React.createElement("div", {
162
+ className: style.skillInformation,
163
+ "data-name": "skill-courses"
164
+ }, /*#__PURE__*/React.createElement("span", {
165
+ className: style.skillInformationNumber
166
+ }, content), ' ', translate('courses')) : null, questionsToReview ? /*#__PURE__*/React.createElement("div", {
167
+ className: style.skillInformation,
168
+ "data-name": "skill-questions"
169
+ }, /*#__PURE__*/React.createElement("span", {
170
+ className: style.skillInformationNumber
171
+ }, questionsToReview), "\xA0", translate('questions')) : null), /*#__PURE__*/React.createElement(ProgressBar, null), /*#__PURE__*/React.createElement("div", {
172
+ className: style.progressInformations
173
+ }, content && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
174
+ className: style.progressInformation,
175
+ "data-name": "skill-completed-courses"
176
+ }, /*#__PURE__*/React.createElement("span", {
177
+ className: style.progressInformationNumber
178
+ }, contentCompleted), ` ${translate('courses_completed')}`), /*#__PURE__*/React.createElement("div", {
179
+ className: style.progressInformation,
180
+ "data-name": "completed-percentage"
181
+ }, /*#__PURE__*/React.createElement("span", {
182
+ className: style.progressInformationNumber
183
+ }, score, "%"))))), /*#__PURE__*/React.createElement(ContinueLearning, {
184
+ ongoingCourses: ongoingCourses
185
+ }), /*#__PURE__*/React.createElement(AllCourses, {
186
+ skillIncludedCourses: skillIncludedCourses,
187
+ filters: filters,
188
+ sorting: sorting
189
+ })));
190
+ };
191
+
192
+ SkillDetail.contextTypes = {
193
+ skin: Provider.childContextTypes.skin,
194
+ translate: Provider.childContextTypes.translate
195
+ };
196
+ SkillDetail.propTypes = process.env.NODE_ENV !== "production" ? {
197
+ title: PropTypes.string.isRequired,
198
+ description: PropTypes.string,
199
+ metrics: PropTypes.shape({
200
+ score: PropTypes.number,
201
+ content: PropTypes.number,
202
+ questionsToReview: PropTypes.number,
203
+ contentCompleted: PropTypes.number
204
+ }),
205
+ focused: PropTypes.bool,
206
+ availableForReview: PropTypes.bool,
207
+ ongoingCourses: PropTypes.shape(CardsGrid.propTypes),
208
+ skillIncludedCourses: PropTypes.shape(CardsGrid.propTypes),
209
+ filters: PropTypes.shape({
210
+ onChange: PropTypes.func,
211
+ options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))
212
+ }),
213
+ sorting: PropTypes.shape(Select.propTypes),
214
+ onBackClick: PropTypes.func,
215
+ onReviewClick: PropTypes.func,
216
+ onContinueLearningClick: PropTypes.func
217
+ } : {};
218
+ export default SkillDetail;
219
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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","onClick","skin","translate","primarySkinColor","handleMouseOver","handleMouseLeave","width","borderRadius","backgroundColor","position","faIcon","name","color","size","contextTypes","childContextTypes","propTypes","func","SkillDetail","title","description","metrics","focused","availableForReview","ongoingCourses","skillIncludedCourses","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","progressInformationsWrapper","progressTitle","skillCoursesAndQuestionsWrapper","skillInformation","skillInformationNumber","progressInformations","progressInformation","progressInformationNumber","string","isRequired","shape","number","bool","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 {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={translate('continue_learning')}\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 onClick: PropTypes.func\n};\n\nconst SkillDetail = (props, context) => {\n const {\n title,\n description,\n metrics,\n focused,\n availableForReview,\n ongoingCourses,\n skillIncludedCourses,\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 });\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}>\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 onClick={onContinueLearningClick} />\n </div>\n </div>\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 &nbsp;{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 <ContinueLearning ongoingCourses={ongoingCourses} />\n <AllCourses\n skillIncludedCourses={skillIncludedCourses}\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 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 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;EAAD,IAAYJ,KAAlB;EACA,MAAM;IAACK,IAAD;IAAOC;EAAP,IAAoBL,OAA1B;;EACA,MAAMM,gBAAgB,GAAG,KAAI,gBAAJ,EAAsBF,IAAtB,CAAzB;;EAEA,MAAMG,eAAe,GAAGvB,WAAW,CAAC,MAAMkB,UAAU,CAAC,IAAD,CAAjB,EAAyB,CAACA,UAAD,CAAzB,CAAnC;EAEA,MAAMM,gBAAgB,GAAGxB,WAAW,CAAC,MAAMkB,UAAU,CAAC,KAAD,CAAjB,EAA0B,CAACA,UAAD,CAA1B,CAApC;EAEA,oBACE;IAAK,WAAW,EAAEK,eAAlB;IAAmC,YAAY,EAAEC;EAAjD,gBACE,oBAAC,UAAD;IACE,KAAK,EAAEH,SAAS,CAAC,mBAAD,CADlB;IAEE,IAAI,EAAC,SAFP;IAGE,WAAW,EA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ACoF,MADM;IAEvBnC,OAAO,EAAEjD,SAAS,CAACoF,MAFI;IAGvBlC,iBAAiB,EAAElD,SAAS,CAACoF,MAHN;IAIvBjC,gBAAgB,EAAEnD,SAAS,CAACoF;EAJL,CAAhB,CAHa;EAStB7C,OAAO,EAAEvC,SAAS,CAACqF,IATG;EAUtB7C,kBAAkB,EAAExC,SAAS,CAACqF,IAVR;EAWtB5C,cAAc,EAAEzC,SAAS,CAACmF,KAAV,CAAgB3E,SAAS,CAACyB,SAA1B,CAXM;EAYtBS,oBAAoB,EAAE1C,SAAS,CAACmF,KAAV,CAAgB3E,SAAS,CAACyB,SAA1B,CAZA;EAatBU,OAAO,EAAE3C,SAAS,CAACmF,KAAV,CAAgB;IACvBG,QAAQ,EAAEtF,SAAS,CAACkC,IADG;IAEvBqD,OAAO,EAAEvF,SAAS,CAACwF,OAAV,CAAkBxF,SAAS,CAACmF,KAAV,CAAgB9E,qBAAhB,CAAlB;EAFc,CAAhB,CAba;EAiBtBuC,OAAO,EAAE5C,SAAS,CAACmF,KAAV,CAAgB/E,MAAM,CAAC6B,SAAvB,CAjBa;EAkBtBY,WAAW,EAAE7C,SAAS,CAACkC,IAlBD;EAmBtBY,aAAa,EAAE9C,SAAS,CAACkC,IAnBH;EAoBtBa,uBAAuB,EAAE/C,SAAS,CAACkC;AApBb,CAAxB;AAuBA,eAAeC,WAAf"}
@@ -0,0 +1,163 @@
1
+ @value colors: "../../variables/colors.css";
2
+ @value breakpoints: "../../variables/breakpoints.css";
3
+ @value tablet from breakpoints;
4
+ @value xtraLightGrey from colors;
5
+ @value cm_grey_100 from colors;
6
+ @value cm_grey_200 from colors;
7
+ @value cm_grey_400 from colors;
8
+
9
+ .textBase {
10
+ font-family: "Gilroy";
11
+ font-style: normal;
12
+ }
13
+
14
+ .backgroundContainer {
15
+ background-color: white;
16
+ min-height: 100%;
17
+ width: 100%;
18
+ }
19
+
20
+ .container {
21
+ composes: textBase;
22
+ background-color: white;
23
+ font-family: "Gilroy";
24
+ font-style: normal;
25
+ margin-top: 48px;
26
+ margin-bottom: 48px;
27
+ margin-left: auto;
28
+ margin-right: auto;
29
+ padding: 0 16px;
30
+ position: relative;
31
+ box-sizing: border-box;
32
+ min-height: 100%;
33
+ width: 100%;
34
+ max-width: calc(1080px + 40px);
35
+ }
36
+
37
+ .backButtonWrapper {
38
+ margin-bottom: 16px;
39
+ background-color: cm_grey_100;
40
+ border-radius: 8px;
41
+ width: fit-content;
42
+ padding: 8px;
43
+ cursor: pointer;
44
+ }
45
+
46
+ .ctaContainer {
47
+ display: flex;
48
+ width: 100%;
49
+ justify-content: space-between;
50
+ }
51
+
52
+ .skillFocusBadge {
53
+ display: flex;
54
+ height: 12px;
55
+ width: fit-content;
56
+ align-items: center;
57
+ background-color: #DDD1FF;
58
+ border-radius: 24px;
59
+ padding: 4px 8px;
60
+ font-size: 12px;
61
+ line-height: 16px;
62
+ font-weight: 600;
63
+ color: #3900D6;
64
+ margin-bottom: 16px;
65
+ }
66
+
67
+ .ctaWrapper,
68
+ .showMoreWrapper {
69
+ display: flex;
70
+ gap: 8px;
71
+ }
72
+
73
+ .showMoreWrapper {
74
+ align-items: center;
75
+ margin-top: 8px;
76
+ font-weight: 600;
77
+ cursor: pointer;
78
+ }
79
+
80
+ .title {
81
+ font-size: 24px;
82
+ font-weight: 700;
83
+ line-height: 32px;
84
+ }
85
+
86
+ .description {
87
+ margin-top: 8px;
88
+ max-width: 734px;
89
+ font-size: 14px;
90
+ font-weight: 500;
91
+ line-height: 20px;
92
+ color: cm_grey_400;
93
+ }
94
+
95
+ .truncate {
96
+ display: -webkit-box;
97
+ -webkit-line-clamp: 2;
98
+ -webkit-box-orient: vertical;
99
+ overflow: hidden;
100
+ text-overflow: ellipsis;
101
+ }
102
+
103
+ .progressInformationsWrapper {
104
+ margin-top: 40px;
105
+ background-color: xtraLightGrey;
106
+ border-radius: 16px;
107
+ padding: 24px;
108
+ }
109
+
110
+ .progressTitle {
111
+ font-size: 16px;
112
+ font-weight: 600;
113
+ line-height: 22px;
114
+ margin-bottom: 16px;
115
+ }
116
+
117
+ .skillCoursesAndQuestionsWrapper,
118
+ .progressInformations {
119
+ display: flex;
120
+ justify-content: space-between;
121
+ margin-bottom: 8px;
122
+ }
123
+
124
+ .skillInformation,
125
+ .progressInformation {
126
+ composes: textBase;
127
+ font-weight: 600;
128
+ font-size: 14px;
129
+ line-height: 20px;
130
+ color: cm_grey_400;
131
+ }
132
+
133
+ .skillInformationNumber,
134
+ .progressInformationNumber {
135
+ color: #000;
136
+ }
137
+
138
+ .progressBarWrapper {
139
+ position: relative;
140
+ left: 0;
141
+ width: 100%;
142
+ height: 4px;
143
+ border-radius: 2px;
144
+ overflow: hidden;
145
+ background-color: cm_grey_100;
146
+ margin: 16px 0;
147
+ }
148
+
149
+ .progress {
150
+ display: block;
151
+ height: 8px;
152
+ animation: progressbar 2s ease-in-out;
153
+ }
154
+
155
+ @media tablet {
156
+ .ctaContainer {
157
+ flex-direction: column;
158
+ }
159
+
160
+ .ctaWrapper {
161
+ margin-top: 32px;
162
+ }
163
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAuDA,qEA2LC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAwDA,qEAkMC"}
@@ -57,6 +57,7 @@ const themeStyle = {
57
57
  thematiques: _style.default.thematiques,
58
58
  player: _style.default.player,
59
59
  template: _style.default.template,
60
+ skillDetail: _style.default.skillDetail,
60
61
  coorpmanager: null
61
62
  };
62
63
 
@@ -167,7 +168,7 @@ const Select = (props, legacyContext) => {
167
168
  }, titleView, /*#__PURE__*/_react.default.createElement("span", {
168
169
  "data-testid": "select-span",
169
170
  "data-name": "select-span",
170
- className: (0, _classnames.default)(_style.default.selectSpan, (0, _includes.default)(theme, ['player', 'invalid', 'question', 'thematiques', 'template']) ? _style.default.noLabelCommon : null, borderClassName, isLongLabel ? _style.default.longLabel : null),
171
+ className: (0, _classnames.default)(_style.default.selectSpan, (0, _includes.default)(theme, ['player', 'invalid', 'question', 'thematiques', 'template', 'skillDetail']) ? _style.default.noLabelCommon : null, borderClassName, isLongLabel ? _style.default.longLabel : null),
171
172
  style: _extends({}, shouldUseSkinFontColor && {
172
173
  color
173
174
  })
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["themeStyle","filter","style","invalid","header","mooc","question","sort","thematiques","player","template","coorpmanager","ArrowView","shouldRender","isArrowUp","ariaLabel","arrowClass","arrowColor","props","useMemo","color","className","Select","legacyContext","name","options","optgroups","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","ariaLabelledBy","skin","GetSkinFromContext","setIsArrowUp","useState","handleSelectOnFocus","useCallback","handleSelectOnBlur","selectOption","option","index","value","optionList","isEmpty","map","optgroup","label","i","titleView","selected","get","find","concat","flatMapDeep","selectedLabel","isSelectedInValidOption","getOr","validOption","handleChange","e","target","selectedOptions","black","isThemeOneOfQuestionTemplateOrPlayer","includes","shouldUseSkinFontColor","undefined","behaviorClassName","getClassState","default","composedClassName","classnames","unselected","labelSize","size","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectedArrow","arrow","selectBox","SelectOptionPropTypes","PropTypes","string","isRequired","oneOfType","number","bool","SelectOptionGroupPropTypes","arrayOf","shape","contextTypes","Provider","childContextTypes","propTypes","func","oneOf","keys"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport concat from 'lodash/fp/concat';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport flatMapDeep from 'lodash/fp/flatMapDeep';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {\n NovaCompositionNavigationArrowDown as ArrowDown,\n NovaCompositionNavigationArrowTop as ArrowUp\n} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n filter: style.filter,\n invalid: style.invalid,\n header: style.header,\n mooc: style.mooc,\n question: style.question,\n sort: style.sort,\n thematiques: style.thematiques,\n player: style.player,\n template: style.template,\n coorpmanager: null\n};\n\nconst ArrowView = ({shouldRender, isArrowUp, ariaLabel, arrowClass, arrowColor}) => {\n const props = useMemo(\n () => ({\n ...(arrowColor &\n {\n color: arrowColor\n }),\n className: arrowClass\n }),\n [ariaLabel, arrowClass, arrowColor]\n );\n if (shouldRender) {\n return isArrowUp ? (\n <ArrowUp {...props} data-testid=\"select-arrow-up-icon\" />\n ) : (\n <ArrowDown {...props} data-testid=\"select-arrow-down-icon\" />\n );\n } else return null;\n};\n\nconst Select = (props, legacyContext) => {\n const {\n name,\n options = [],\n optgroups = [],\n className,\n borderClassName,\n onChange,\n multiple = false,\n disabled,\n required,\n description,\n theme,\n modified = false,\n error = false,\n title: propTitle,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy\n } = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const title = useMemo(\n () => (propTitle ? `${propTitle}${required ? '*' : ''}` : null),\n [propTitle, required]\n );\n\n const [isArrowUp, setIsArrowUp] = useState(false);\n\n const handleSelectOnFocus = useCallback(() => setIsArrowUp(true), []);\n const handleSelectOnBlur = useCallback(() => setIsArrowUp(false), []);\n\n const selectOption = (option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n };\n\n const optionList = !isEmpty(options)\n ? options.map((option, index) => selectOption(option, index))\n : optgroups.map((optgroup, index) => {\n return (\n <optgroup key={index} label={optgroup.label}>\n {optgroup.options && optgroup.options.map((option, i) => selectOption(option, i))}\n </optgroup>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title}</span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, concat(options, flatMapDeep('options', optgroups)))),\n [multiple, options, optgroups]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, concat(options, flatMapDeep('options', optgroups)))),\n [multiple, options, optgroups]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n setIsArrowUp(false);\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n setIsArrowUp(false);\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const isThemeOneOfQuestionTemplateOrPlayer = useMemo(\n () => includes(theme, ['question', 'template', 'player']),\n [theme]\n );\n const shouldUseSkinFontColor = useMemo(\n () => !isSelectedInValidOption && selected && isThemeOneOfQuestionTemplateOrPlayer,\n [isSelectedInValidOption, selected, isThemeOneOfQuestionTemplateOrPlayer]\n );\n const arrowColor = selected ? color : undefined;\n\n const behaviorClassName = useMemo(\n () => getClassState(style.default, style.modified, style.error, modified, error),\n [error, modified]\n );\n const composedClassName = useMemo(\n () =>\n classnames(\n theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviorClassName,\n selected ? style.selected : style.unselected,\n className\n ),\n [behaviorClassName, className, selected, theme]\n );\n\n const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);\n\n const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);\n\n return (\n <div\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <label\n data-testid=\"select-wrapper\"\n data-name=\"select-wrapper\"\n title={title}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-testid=\"select-span\"\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template'])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n >\n {selectedLabel}\n </span>\n <ArrowView\n shouldRender={!multiple}\n isArrowUp={isArrowUp}\n ariaLabel={ariaLabel}\n arrowClass={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n arrowColor={isThemeOneOfQuestionTemplateOrPlayer ? arrowColor : black}\n />\n <select\n {...(ariaLabelledBy ? {'aria-labelledby': ariaLabelledBy} : {})}\n {...(ariaLabel && !ariaLabelledBy ? {'aria-label': ariaLabel} : {})}\n {...(ariaLabel ? {title: ariaLabel} : {})}\n data-name=\"native-select\"\n className={style.selectBox}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n onClick={handleSelectOnFocus}\n onBlur={handleSelectOnBlur}\n // onBlur does not handle completely an out of bounds click\n // ex: select is Opened and a click is done outside, cancelling the select\n // that doesn't count as a Blur, so an onMouseLeave is needed\n onMouseLeave={handleSelectOnBlur}\n data-testid=\"native-select\"\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool,\n validOption: PropTypes.bool\n};\n\nexport const SelectOptionGroupPropTypes = {\n label: PropTypes.string.isRequired,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n optgroups: PropTypes.arrayOf(PropTypes.shape(SelectOptionGroupPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool,\n 'aria-label': PropTypes.string,\n 'aria-labelledby': PropTypes.string\n};\n\nexport default Select;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,UAAU,GAAG;EACjBC,MAAM,EAAEC,cAAA,CAAMD,MADG;EAEjBE,OAAO,EAAED,cAAA,CAAMC,OAFE;EAGjBC,MAAM,EAAEF,cAAA,CAAME,MAHG;EAIjBC,IAAI,EAAEH,cAAA,CAAMG,IAJK;EAKjBC,QAAQ,EAAEJ,cAAA,CAAMI,QALC;EAMjBC,IAAI,EAAEL,cAAA,CAAMK,IANK;EAOjBC,WAAW,EAAEN,cAAA,CAAMM,WAPF;EAQjBC,MAAM,EAAEP,cAAA,CAAMO,MARG;EASjBC,QAAQ,EAAER,cAAA,CAAMQ,QATC;EAUjBC,YAAY,EAAE;AAVG,CAAnB;;AAaA,MAAMC,SAAS,GAAG,CAAC;EAACC,YAAD;EAAeC,SAAf;EAA0BC,SAA1B;EAAqCC,UAArC;EAAiDC;AAAjD,CAAD,KAAkE;EAClF,MAAMC,KAAK,GAAG,IAAAC,cAAA,EACZ,mBACMF,UAAU,GACZ;IACEG,KAAK,EAAEH;EADT,CAFJ;IAKEI,SAAS,EAAEL;EALb,EADY,EAQZ,CAACD,SAAD,EAAYC,UAAZ,EAAwBC,UAAxB,CARY,CAAd;;EAUA,IAAI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AM,CAACkF,SAAP,2CAAmB;EACjBpE,KAAK,EAAEwD,kBAAA,CAAUC,MADA;EAEjBrE,IAAI,EAAEoE,kBAAA,CAAUC,MAFC;EAGjBxE,SAAS,EAAEuE,kBAAA,CAAUC,MAHJ;EAIjBlE,eAAe,EAAEiE,kBAAA,CAAUC,MAJV;EAKjB/D,QAAQ,EAAE8D,kBAAA,CAAUK,IALH;EAMjBpE,QAAQ,EAAE+D,kBAAA,CAAUK,IANH;EAOjBjE,WAAW,EAAE4D,kBAAA,CAAUC,MAPN;EAQjB9D,QAAQ,EAAE6D,kBAAA,CAAUK,IARH;EASjBrE,QAAQ,EAAEgE,kBAAA,CAAUa,IATH;EAUjBxE,KAAK,EAAE2D,kBAAA,CAAUc,KAAV,CAAgB,IAAAC,aAAA,EAAK3G,UAAL,CAAhB,CAVU;EAWjByB,OAAO,EAAEmE,kBAAA,CAAUO,OAAV,CAAkBP,kBAAA,CAAUQ,KAAV,CAAgBT,qBAAhB,CAAlB,CAXQ;EAYjBjE,SAAS,EAAEkE,kBAAA,CAAUO,OAAV,CAAkBP,kBAAA,CAAUQ,KAAV,CAAgBF,0BAAhB,CAAlB,CAZM;EAajBhE,QAAQ,EAAE0D,kBAAA,CAAUK,IAbH;EAcjB9D,KAAK,EAAEyD,kBAAA,CAAUK,IAdA;EAejB,cAAcL,kBAAA,CAAUC,MAfP;EAgBjB,mBAAmBD,kBAAA,CAAUC;AAhBZ,CAAnB;eAmBevE,M"}
1
+ {"version":3,"file":"index.js","names":["themeStyle","filter","style","invalid","header","mooc","question","sort","thematiques","player","template","skillDetail","coorpmanager","ArrowView","shouldRender","isArrowUp","ariaLabel","arrowClass","arrowColor","props","useMemo","color","className","Select","legacyContext","name","options","optgroups","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","ariaLabelledBy","skin","GetSkinFromContext","setIsArrowUp","useState","handleSelectOnFocus","useCallback","handleSelectOnBlur","selectOption","option","index","value","optionList","isEmpty","map","optgroup","label","i","titleView","selected","get","find","concat","flatMapDeep","selectedLabel","isSelectedInValidOption","getOr","validOption","handleChange","e","target","selectedOptions","black","isThemeOneOfQuestionTemplateOrPlayer","includes","shouldUseSkinFontColor","undefined","behaviorClassName","getClassState","default","composedClassName","classnames","unselected","labelSize","size","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectedArrow","arrow","selectBox","SelectOptionPropTypes","PropTypes","string","isRequired","oneOfType","number","bool","SelectOptionGroupPropTypes","arrayOf","shape","contextTypes","Provider","childContextTypes","propTypes","func","oneOf","keys"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport concat from 'lodash/fp/concat';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport flatMapDeep from 'lodash/fp/flatMapDeep';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {\n NovaCompositionNavigationArrowDown as ArrowDown,\n NovaCompositionNavigationArrowTop as ArrowUp\n} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n filter: style.filter,\n invalid: style.invalid,\n header: style.header,\n mooc: style.mooc,\n question: style.question,\n sort: style.sort,\n thematiques: style.thematiques,\n player: style.player,\n template: style.template,\n skillDetail: style.skillDetail,\n coorpmanager: null\n};\n\nconst ArrowView = ({shouldRender, isArrowUp, ariaLabel, arrowClass, arrowColor}) => {\n const props = useMemo(\n () => ({\n ...(arrowColor &\n {\n color: arrowColor\n }),\n className: arrowClass\n }),\n [ariaLabel, arrowClass, arrowColor]\n );\n if (shouldRender) {\n return isArrowUp ? (\n <ArrowUp {...props} data-testid=\"select-arrow-up-icon\" />\n ) : (\n <ArrowDown {...props} data-testid=\"select-arrow-down-icon\" />\n );\n } else return null;\n};\n\nconst Select = (props, legacyContext) => {\n const {\n name,\n options = [],\n optgroups = [],\n className,\n borderClassName,\n onChange,\n multiple = false,\n disabled,\n required,\n description,\n theme,\n modified = false,\n error = false,\n title: propTitle,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy\n } = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const title = useMemo(\n () => (propTitle ? `${propTitle}${required ? '*' : ''}` : null),\n [propTitle, required]\n );\n\n const [isArrowUp, setIsArrowUp] = useState(false);\n\n const handleSelectOnFocus = useCallback(() => setIsArrowUp(true), []);\n const handleSelectOnBlur = useCallback(() => setIsArrowUp(false), []);\n\n const selectOption = (option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n };\n\n const optionList = !isEmpty(options)\n ? options.map((option, index) => selectOption(option, index))\n : optgroups.map((optgroup, index) => {\n return (\n <optgroup key={index} label={optgroup.label}>\n {optgroup.options && optgroup.options.map((option, i) => selectOption(option, i))}\n </optgroup>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title}</span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, concat(options, flatMapDeep('options', optgroups)))),\n [multiple, options, optgroups]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, concat(options, flatMapDeep('options', optgroups)))),\n [multiple, options, optgroups]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n setIsArrowUp(false);\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n setIsArrowUp(false);\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const isThemeOneOfQuestionTemplateOrPlayer = useMemo(\n () => includes(theme, ['question', 'template', 'player']),\n [theme]\n );\n const shouldUseSkinFontColor = useMemo(\n () => !isSelectedInValidOption && selected && isThemeOneOfQuestionTemplateOrPlayer,\n [isSelectedInValidOption, selected, isThemeOneOfQuestionTemplateOrPlayer]\n );\n const arrowColor = selected ? color : undefined;\n\n const behaviorClassName = useMemo(\n () => getClassState(style.default, style.modified, style.error, modified, error),\n [error, modified]\n );\n const composedClassName = useMemo(\n () =>\n classnames(\n theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviorClassName,\n selected ? style.selected : style.unselected,\n className\n ),\n [behaviorClassName, className, selected, theme]\n );\n\n const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);\n\n const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);\n\n return (\n <div\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <label\n data-testid=\"select-wrapper\"\n data-name=\"select-wrapper\"\n title={title}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-testid=\"select-span\"\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, [\n 'player',\n 'invalid',\n 'question',\n 'thematiques',\n 'template',\n 'skillDetail'\n ])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n >\n {selectedLabel}\n </span>\n <ArrowView\n shouldRender={!multiple}\n isArrowUp={isArrowUp}\n ariaLabel={ariaLabel}\n arrowClass={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n arrowColor={isThemeOneOfQuestionTemplateOrPlayer ? arrowColor : black}\n />\n <select\n {...(ariaLabelledBy ? {'aria-labelledby': ariaLabelledBy} : {})}\n {...(ariaLabel && !ariaLabelledBy ? {'aria-label': ariaLabel} : {})}\n {...(ariaLabel ? {title: ariaLabel} : {})}\n data-name=\"native-select\"\n className={style.selectBox}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n onClick={handleSelectOnFocus}\n onBlur={handleSelectOnBlur}\n // onBlur does not handle completely an out of bounds click\n // ex: select is Opened and a click is done outside, cancelling the select\n // that doesn't count as a Blur, so an onMouseLeave is needed\n onMouseLeave={handleSelectOnBlur}\n data-testid=\"native-select\"\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool,\n validOption: PropTypes.bool\n};\n\nexport const SelectOptionGroupPropTypes = {\n label: PropTypes.string.isRequired,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n optgroups: PropTypes.arrayOf(PropTypes.shape(SelectOptionGroupPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool,\n 'aria-label': PropTypes.string,\n 'aria-labelledby': PropTypes.string\n};\n\nexport default Select;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,UAAU,GAAG;EACjBC,MAAM,EAAEC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UAAL,CAAhB,CAVU;EAWjB0B,OAAO,EAAEmE,kBAAA,CAAUO,OAAV,CAAkBP,kBAAA,CAAUQ,KAAV,CAAgBT,qBAAhB,CAAlB,CAXQ;EAYjBjE,SAAS,EAAEkE,kBAAA,CAAUO,OAAV,CAAkBP,kBAAA,CAAUQ,KAAV,CAAgBF,0BAAhB,CAAlB,CAZM;EAajBhE,QAAQ,EAAE0D,kBAAA,CAAUK,IAbH;EAcjB9D,KAAK,EAAEyD,kBAAA,CAAUK,IAdA;EAejB,cAAcL,kBAAA,CAAUC,MAfP;EAgBjB,mBAAmBD,kBAAA,CAAUC;AAhBZ,CAAnB;eAmBevE,M"}
@@ -13,6 +13,7 @@
13
13
  @value transparent from colors;
14
14
  @value box_shadow_light_dark from colors;
15
15
  @value box_shadow_medium_dark from colors;
16
+ @value cm_grey_100 from colors;
16
17
  @value cm_blue_900 from colors;
17
18
  @value cm_grey_450 from colors;
18
19
 
@@ -634,3 +635,30 @@ div.player:hover span.selectSpan {
634
635
  height: 54px;
635
636
  max-width: 100%;
636
637
  }
638
+
639
+ /*
640
+ skillDetail
641
+ */
642
+
643
+ .skillDetail {
644
+ composes: no-label;
645
+ }
646
+
647
+ .skillDetail .selectWrapper {
648
+ height: 44px;
649
+ min-height: unset;
650
+ }
651
+
652
+ .skillDetail .selectSpan {
653
+ font-size: 15px;
654
+ height: 44px;
655
+ line-height: 44px;
656
+ padding: 0 40px 0 10px;
657
+ border-radius: 12px !important;
658
+ background-color: cm_grey_100 !important;
659
+ }
660
+
661
+ .skillDetail select {
662
+ border: none !important;
663
+ height: 44px !important;
664
+ }
@@ -74,6 +74,7 @@ declare const propTypes: {
74
74
  type: PropTypes.Requireable<string>;
75
75
  list: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
76
76
  list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
77
+ justifyContent: PropTypes.Requireable<string>;
77
78
  loading: PropTypes.Requireable<boolean>;
78
79
  }> | PropTypes.InferProps<{
79
80
  'aria-label': PropTypes.Requireable<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAKnC,OAAO,IAAI,MAAM,iBAAiB,CAAC;AACnC,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAClD,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAClD,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAGlD,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoDd,CAAC;AAEF,aAAK,gBAAgB,GAAG;IACtB,KAAK,EAAE,UAAU,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE;QACZ,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAEF,oBAAY,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,GAAG,aAAa,GAAG,QAAQ,G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,EAAE,UAAU,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE;QACZ,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAEF,oBAAY,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,GAAG,aAAa,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;IAC5D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;QACzB,IAAI,EACA,SAAS,CAAC,UAAU,CAAC,OAAO,SAAS,CAAC,SAAS,CAAC,GAChD,SAAS,CAAC,UAAU,CAAC,OAAO,SAAS,CAAC,SAAS,CAAC,CAAC;KACtD,CAAC;IACF,IAAI,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC;CACpD,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -91,7 +91,7 @@ class DisciplineHeader extends _react.default.Component {
91
91
  const {
92
92
  translate
93
93
  } = this.context;
94
- const maxHeightCourseInfos = 215;
94
+ const maxHeightCourseInfos = 210;
95
95
  const hasMediaContent = image || video;
96
96
  const toggleLabel = fullDisplay ? translate('See less') : translate('Show more');
97
97
  const shortCourseText = scrollHeightShowMore <= maxHeightCourseInfos;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Preview","image","video","mimeType","get","id","jwpOptions","style","propTypes","Picture","src","PropTypes","shape","VideoPlayer","DisciplineHeader","React","Component","constructor","props","state","fullDisplay","scrollHeightShowMore","handleToggleDisplay","bind","setHandle","setState","prevState","el","getOr","render","title","description","lastUpdated","translate","context","maxHeightCourseInfos","hasMediaContent","toggleLabel","shortCourseText","courseSeeMoreButtonStyle","showMoreHidden","showMore","wrapper","imgWrapper","courseWrapper","courseTextWrapperFull","courseTextWrapperShort","classnames","innerHTML","__html","lastUpdatedWrapper","lastUpdatedWrapperShort","syncIcon","lastUpdatedText","contextTypes","func","string"],"sources":["../../../src/molecule/discipline-header/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport classnames from 'classnames';\nimport {NovaSolidSynchronizeSynchronize3 as SyncIcon} from '@coorpacademy/nova-icons';\nimport VideoPlayer from '../video-player';\nimport Picture from '../../atom/picture';\nimport style from './style.css';\n\nconst Preview = ({image, video}) => {\n const mimeType = get('mimeType', video);\n const id = get('id', video);\n const jwpOptions = get('jwpOptions', video);\n if (id) {\n return <VideoPlayer mimeType={mimeType} id={id} width=\"380px\" height=\"250px\" />;\n } else if (jwpOptions) {\n return <VideoPlayer {...video} />;\n } else {\n return <Picture className={style.image} src={image} />;\n }\n};\n\nPreview.propTypes = {\n image: Picture.propTypes.src,\n video: PropTypes.shape(VideoPlayer.propTypes)\n};\n\nclass DisciplineHeader extends React.Component {\n static propTypes = {\n title: PropTypes.string,\n description: PropTypes.string,\n image: Preview.propTypes.image,\n video: Preview.propTypes.video,\n lastUpdated: PropTypes.string\n };\n\n static contextTypes = {\n translate: PropTypes.func\n };\n\n constructor(props) {\n super(props);\n this.state = {\n fullDisplay: false,\n scrollHeightShowMore: 0\n };\n this.handleToggleDisplay = this.handleToggleDisplay.bind(this);\n this.setHandle = this.setHandle.bind(this);\n }\n\n handleToggleDisplay() {\n this.setState(prevState => ({\n fullDisplay: !prevState.fullDisplay\n }));\n }\n\n setHandle(el) {\n this.setState({scrollHeightShowMore: getOr(0, 'scrollHeight', el)});\n }\n\n render() {\n const {image, title, description, video, lastUpdated} = this.props;\n const {fullDisplay, scrollHeightShowMore} = this.state;\n const {translate} = this.context;\n const maxHeightCourseInfos = 215;\n const hasMediaContent = image || video;\n const toggleLabel = fullDisplay ? translate('See less') : translate('Show more');\n const shortCourseText = scrollHeightShowMore <= maxHeightCourseInfos;\n const courseSeeMoreButtonStyle = shortCourseText ? style.showMoreHidden : style.showMore;\n\n return (\n <div data-name=\"disciplineHeader\" className={style.wrapper}>\n {hasMediaContent ? (\n <div className={style.imgWrapper}>\n <Preview image={image} video={video} />\n </div>\n ) : null}\n <div className={style.courseWrapper}>\n <div\n className={fullDisplay ? style.courseTextWrapperFull : style.courseTextWrapperShort}\n ref={this.setHandle}\n >\n <div\n data-name=\"title\"\n className={classnames(style.title, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n <div\n className={style.innerHTML}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: description}}\n />\n </div>\n <div className={courseSeeMoreButtonStyle} onClick={this.handleToggleDisplay}>\n {toggleLabel}\n </div>\n {lastUpdated ? (\n <div\n className={classnames(\n style.lastUpdatedWrapper,\n shortCourseText ? style.lastUpdatedWrapperShort : null\n )}\n >\n <SyncIcon className={style.syncIcon} />\n <div\n className={classnames(style.lastUpdatedText, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: lastUpdated}}\n />\n </div>\n ) : null}\n </div>\n </div>\n );\n }\n}\n\nexport default DisciplineHeader;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA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B,mBAAA,EAAWxC,cAAA,CAAMuB,KAAjB,EAAwBvB,cAAA,CAAMyC,SAA9B,CAFb,CAGE;MAHF;MAIE,uBAAuB,EAAE;QAACC,MAAM,EAAEnB;MAAT;IAJ3B,EAJF,eAUE;MACE,SAAS,EAAEvB,cAAA,CAAMyC,SADnB,CAEE;MAFF;MAGE,uBAAuB,EAAE;QAACC,MAAM,EAAElB;MAAT;IAH3B,EAVF,CADF,eAiBE;MAAK,SAAS,EAAEQ,wBAAhB;MAA0C,OAAO,EAAE,KAAKjB;IAAxD,GACGe,WADH,CAjBF,EAoBGL,WAAW,gBACV;MACE,SAAS,EAAE,IAAAe,mBAAA,EACTxC,cAAA,CAAM2C,kBADG,EAETZ,eAAe,GAAG/B,cAAA,CAAM4C,uBAAT,GAAmC,IAFzC;IADb,gBAME,6BAAC,2CAAD;MAAU,SAAS,EAAE5C,cAAA,CAAM6C;IAA3B,EANF,eAOE;MACE,SAAS,EAAE,IAAAL,mBAAA,EAAWxC,cAAA,CAAM8C,eAAjB,EAAkC9C,cAAA,CAAMyC,SAAxC,CADb,CAEE;MAFF;MAGE,uBAAuB,EAAE;QAACC,MAAM,EAAEjB;MAAT;IAH3B,EAPF,CADU,GAcR,IAlCN,CANF,CADF;EA6CD;;AAxF4C;;AAAzClB,gB,CASGwC,Y,GAAe;EACpBrB,SAAS,EAAEtB,kBAAA,CAAU4C;AADD,C;AATlBzC,gB,CACGN,S,2CAAY;EACjBsB,KAAK,EAAEnB,kBAAA,CAAU6C,MADA;EAEjBzB,WAAW,EAAEpB,kBAAA,CAAU6C,MAFN;EAGjBvD,KAAK,EAAED,OAAO,CAACQ,SAAR,CAAkBP,KAHR;EAIjBC,KAAK,EAAEF,OAAO,CAACQ,SAAR,CAAkBN,KAJR;EAKjB8B,WAAW,EAAErB,kBAAA,CAAU6C;AALN,C;eA0FN1C,gB"}
1
+ {"version":3,"file":"index.js","names":["Preview","image","video","mimeType","get","id","jwpOptions","style","propTypes","Picture","src","PropTypes","shape","VideoPlayer","DisciplineHeader","React","Component","constructor","props","state","fullDisplay","scrollHeightShowMore","handleToggleDisplay","bind","setHandle","setState","prevState","el","getOr","render","title","description","lastUpdated","translate","context","maxHeightCourseInfos","hasMediaContent","toggleLabel","shortCourseText","courseSeeMoreButtonStyle","showMoreHidden","showMore","wrapper","imgWrapper","courseWrapper","courseTextWrapperFull","courseTextWrapperShort","classnames","innerHTML","__html","lastUpdatedWrapper","lastUpdatedWrapperShort","syncIcon","lastUpdatedText","contextTypes","func","string"],"sources":["../../../src/molecule/discipline-header/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport classnames from 'classnames';\nimport {NovaSolidSynchronizeSynchronize3 as SyncIcon} from '@coorpacademy/nova-icons';\nimport VideoPlayer from '../video-player';\nimport Picture from '../../atom/picture';\nimport style from './style.css';\n\nconst Preview = ({image, video}) => {\n const mimeType = get('mimeType', video);\n const id = get('id', video);\n const jwpOptions = get('jwpOptions', video);\n if (id) {\n return <VideoPlayer mimeType={mimeType} id={id} width=\"380px\" height=\"250px\" />;\n } else if (jwpOptions) {\n return <VideoPlayer {...video} />;\n } else {\n return <Picture className={style.image} src={image} />;\n }\n};\n\nPreview.propTypes = {\n image: Picture.propTypes.src,\n video: PropTypes.shape(VideoPlayer.propTypes)\n};\n\nclass DisciplineHeader extends React.Component {\n static propTypes = {\n title: PropTypes.string,\n description: PropTypes.string,\n image: Preview.propTypes.image,\n video: Preview.propTypes.video,\n lastUpdated: PropTypes.string\n };\n\n static contextTypes = {\n translate: PropTypes.func\n };\n\n constructor(props) {\n super(props);\n this.state = {\n fullDisplay: false,\n scrollHeightShowMore: 0\n };\n this.handleToggleDisplay = this.handleToggleDisplay.bind(this);\n this.setHandle = this.setHandle.bind(this);\n }\n\n handleToggleDisplay() {\n this.setState(prevState => ({\n fullDisplay: !prevState.fullDisplay\n }));\n }\n\n setHandle(el) {\n this.setState({scrollHeightShowMore: getOr(0, 'scrollHeight', el)});\n }\n\n render() {\n const {image, title, description, video, lastUpdated} = this.props;\n const {fullDisplay, scrollHeightShowMore} = this.state;\n const {translate} = this.context;\n const maxHeightCourseInfos = 210;\n const hasMediaContent = image || video;\n const toggleLabel = fullDisplay ? translate('See less') : translate('Show more');\n const shortCourseText = scrollHeightShowMore <= maxHeightCourseInfos;\n const courseSeeMoreButtonStyle = shortCourseText ? style.showMoreHidden : style.showMore;\n\n return (\n <div data-name=\"disciplineHeader\" className={style.wrapper}>\n {hasMediaContent ? (\n <div className={style.imgWrapper}>\n <Preview image={image} video={video} />\n </div>\n ) : null}\n <div className={style.courseWrapper}>\n <div\n className={fullDisplay ? style.courseTextWrapperFull : style.courseTextWrapperShort}\n ref={this.setHandle}\n >\n <div\n data-name=\"title\"\n className={classnames(style.title, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n <div\n className={style.innerHTML}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: description}}\n />\n </div>\n <div className={courseSeeMoreButtonStyle} onClick={this.handleToggleDisplay}>\n {toggleLabel}\n </div>\n {lastUpdated ? (\n <div\n className={classnames(\n style.lastUpdatedWrapper,\n shortCourseText ? style.lastUpdatedWrapperShort : null\n )}\n >\n <SyncIcon className={style.syncIcon} />\n <div\n className={classnames(style.lastUpdatedText, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: lastUpdated}}\n />\n </div>\n ) : null}\n </div>\n </div>\n );\n }\n}\n\nexport default DisciplineHeader;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,OAAO,GAAG,CAAC;EAACC,KAAD;EAAQC;AAAR,CAAD,KAAoB;EAClC,MAAMC,QAAQ,GAAG,IAAAC,YAAA,EAAI,UAAJ,EAAgBF,KAAhB,CAAjB;EACA,MAAMG,EAAE,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AUE;MACE,SAAS,EAAEvB,cAAA,CAAMyC,SADnB,CAEE;MAFF;MAGE,uBAAuB,EAAE;QAACC,MAAM,EAAElB;MAAT;IAH3B,EAVF,CADF,eAiBE;MAAK,SAAS,EAAEQ,wBAAhB;MAA0C,OAAO,EAAE,KAAKjB;IAAxD,GACGe,WADH,CAjBF,EAoBGL,WAAW,gBACV;MACE,SAAS,EAAE,IAAAe,mBAAA,EACTxC,cAAA,CAAM2C,kBADG,EAETZ,eAAe,GAAG/B,cAAA,CAAM4C,uBAAT,GAAmC,IAFzC;IADb,gBAME,6BAAC,2CAAD;MAAU,SAAS,EAAE5C,cAAA,CAAM6C;IAA3B,EANF,eAOE;MACE,SAAS,EAAE,IAAAL,mBAAA,EAAWxC,cAAA,CAAM8C,eAAjB,EAAkC9C,cAAA,CAAMyC,SAAxC,CADb,CAEE;MAFF;MAGE,uBAAuB,EAAE;QAACC,MAAM,EAAEjB;MAAT;IAH3B,EAPF,CADU,GAcR,IAlCN,CANF,CADF;EA6CD;;AAxF4C;;AAAzClB,gB,CASGwC,Y,GAAe;EACpBrB,SAAS,EAAEtB,kBAAA,CAAU4C;AADD,C;AATlBzC,gB,CACGN,S,2CAAY;EACjBsB,KAAK,EAAEnB,kBAAA,CAAU6C,MADA;EAEjBzB,WAAW,EAAEpB,kBAAA,CAAU6C,MAFN;EAGjBvD,KAAK,EAAED,OAAO,CAACQ,SAAR,CAAkBP,KAHR;EAIjBC,KAAK,EAAEF,OAAO,CAACQ,SAAR,CAAkBN,KAJR;EAKjB8B,WAAW,EAAErB,kBAAA,CAAU6C;AALN,C;eA0FN1C,gB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/learner-skill-card/index.js"],"names":[],"mappings":";AASA,yEAwJC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/learner-skill-card/index.js"],"names":[],"mappings":";AASA,yEAyJC"}