@coorpacademy/components 11.32.26 → 11.32.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/atom/{button-link-icon-only → button-link-icon}/index.d.ts +5 -3
- package/es/atom/button-link-icon/index.d.ts.map +1 -0
- package/es/atom/button-link-icon/index.js +131 -0
- package/es/atom/button-link-icon/index.js.map +1 -0
- package/es/atom/{button-link-icon-only → button-link-icon}/style.css +9 -0
- package/es/atom/tooltip/index.d.ts +3 -1
- package/es/atom/tooltip/index.d.ts.map +1 -1
- package/es/atom/tooltip/index.js +9 -5
- package/es/atom/tooltip/index.js.map +1 -1
- package/es/atom/tooltip/style.css +2 -2
- package/es/molecule/bullet-point-menu-button/index.js +2 -2
- package/es/molecule/bullet-point-menu-button/index.js.map +1 -1
- package/es/molecule/cm-popin/index.js +2 -2
- package/es/molecule/cm-popin/index.js.map +1 -1
- package/es/molecule/expandible-actionable-table/index.js +2 -2
- package/es/molecule/expandible-actionable-table/index.js.map +1 -1
- package/es/molecule/playlist-detail-cover/index.js +1 -1
- package/es/molecule/playlist-detail-cover/index.js.map +1 -1
- package/es/organism/review-header/index.js +2 -2
- package/es/organism/review-header/index.js.map +1 -1
- package/es/organism/setup-header/index.js +1 -1
- package/es/organism/setup-header/index.js.map +1 -1
- package/es/organism/wizard-contents/index.js +2 -2
- package/es/organism/wizard-contents/index.js.map +1 -1
- package/es/template/back-office/brand-update/index.js +2 -2
- package/es/template/back-office/brand-update/index.js.map +1 -1
- package/es/template/common/faq-article-page/index.js +3 -3
- package/es/template/common/faq-article-page/index.js.map +1 -1
- package/es/template/playlist-detail/index.d.ts.map +1 -1
- package/es/template/playlist-detail/index.js +9 -10
- package/es/template/playlist-detail/index.js.map +1 -1
- package/es/template/playlist-detail/style.css +1 -6
- package/es/template/skill-detail/index.d.ts.map +1 -1
- package/es/template/skill-detail/index.js +9 -10
- package/es/template/skill-detail/index.js.map +1 -1
- package/es/template/skill-detail/style.css +1 -6
- package/lib/atom/{button-link-icon-only → button-link-icon}/index.d.ts +5 -3
- package/lib/atom/button-link-icon/index.d.ts.map +1 -0
- package/lib/atom/{button-link-icon-only → button-link-icon}/index.js +61 -22
- package/lib/atom/button-link-icon/index.js.map +1 -0
- package/lib/atom/{button-link-icon-only → button-link-icon}/style.css +9 -0
- package/lib/atom/tooltip/index.d.ts +3 -1
- package/lib/atom/tooltip/index.d.ts.map +1 -1
- package/lib/atom/tooltip/index.js +9 -5
- package/lib/atom/tooltip/index.js.map +1 -1
- package/lib/atom/tooltip/style.css +2 -2
- package/lib/molecule/bullet-point-menu-button/index.js +2 -2
- package/lib/molecule/bullet-point-menu-button/index.js.map +1 -1
- package/lib/molecule/cm-popin/index.js +2 -2
- package/lib/molecule/cm-popin/index.js.map +1 -1
- package/lib/molecule/expandible-actionable-table/index.js +2 -2
- package/lib/molecule/expandible-actionable-table/index.js.map +1 -1
- package/lib/molecule/playlist-detail-cover/index.js +1 -1
- package/lib/molecule/playlist-detail-cover/index.js.map +1 -1
- package/lib/organism/review-header/index.js +2 -2
- package/lib/organism/review-header/index.js.map +1 -1
- package/lib/organism/setup-header/index.js +2 -2
- package/lib/organism/setup-header/index.js.map +1 -1
- package/lib/organism/wizard-contents/index.js +2 -2
- package/lib/organism/wizard-contents/index.js.map +1 -1
- package/lib/template/back-office/brand-update/index.js +2 -2
- package/lib/template/back-office/brand-update/index.js.map +1 -1
- package/lib/template/common/faq-article-page/index.js +3 -3
- package/lib/template/common/faq-article-page/index.js.map +1 -1
- package/lib/template/playlist-detail/index.d.ts.map +1 -1
- package/lib/template/playlist-detail/index.js +10 -10
- package/lib/template/playlist-detail/index.js.map +1 -1
- package/lib/template/playlist-detail/style.css +1 -6
- package/lib/template/skill-detail/index.d.ts.map +1 -1
- package/lib/template/skill-detail/index.js +10 -10
- package/lib/template/skill-detail/index.js.map +1 -1
- package/lib/template/skill-detail/style.css +1 -6
- package/package.json +2 -2
- package/es/atom/button-link-icon-only/index.d.ts.map +0 -1
- package/es/atom/button-link-icon-only/index.js +0 -94
- package/es/atom/button-link-icon-only/index.js.map +0 -1
- package/lib/atom/button-link-icon-only/index.d.ts.map +0 -1
- package/lib/atom/button-link-icon-only/index.js.map +0 -1
|
@@ -7,7 +7,7 @@ var _map2 = _interopRequireDefault(require("lodash/fp/map"));
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _buttonLinkIcon = _interopRequireDefault(require("../../../atom/button-link-icon"));
|
|
11
11
|
|
|
12
12
|
var _privacyPolicyContact = _interopRequireDefault(require("../../../molecule/privacy-policy-contact"));
|
|
13
13
|
|
|
@@ -37,7 +37,7 @@ const FAQArticlePage = ({
|
|
|
37
37
|
className: _style.default.container
|
|
38
38
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
39
39
|
className: _style.default.backContainer
|
|
40
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
40
|
+
}, /*#__PURE__*/_react.default.createElement(_buttonLinkIcon.default, backButton), /*#__PURE__*/_react.default.createElement("span", null, backButtonText)), /*#__PURE__*/_react.default.createElement("h1", {
|
|
41
41
|
className: _style.default.title
|
|
42
42
|
}, title), mapWithIndex((item, index) => {
|
|
43
43
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -58,7 +58,7 @@ const FAQArticlePage = ({
|
|
|
58
58
|
}));
|
|
59
59
|
}, subArticles), /*#__PURE__*/_react.default.createElement("div", {
|
|
60
60
|
className: _style.default.backContainerMobile
|
|
61
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
61
|
+
}, /*#__PURE__*/_react.default.createElement(_buttonLinkIcon.default, backButton), /*#__PURE__*/_react.default.createElement("span", null, backButtonText)))), /*#__PURE__*/_react.default.createElement("div", {
|
|
62
62
|
className: _style.default.privacyPolicyContact
|
|
63
63
|
}, /*#__PURE__*/_react.default.createElement(_privacyPolicyContact.default, privacyPolicyContact)));
|
|
64
64
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["mapWithIndex","convert","cap","FAQArticlePage","title","backButton","backButtonText","subArticles","privacyPolicyContact","styles","wrapper","page","container","backContainer","item","index","article","text","subTitle","__html","img","image","backContainerMobile","propTypes"],"sources":["../../../../src/template/common/faq-article-page/index.tsx"],"sourcesContent":["import React from 'react';\nimport {map} from 'lodash/fp';\nimport
|
|
1
|
+
{"version":3,"file":"index.js","names":["mapWithIndex","convert","cap","FAQArticlePage","title","backButton","backButtonText","subArticles","privacyPolicyContact","styles","wrapper","page","container","backContainer","item","index","article","text","subTitle","__html","img","image","backContainerMobile","propTypes"],"sources":["../../../../src/template/common/faq-article-page/index.tsx"],"sourcesContent":["import React from 'react';\nimport {map} from 'lodash/fp';\nimport ButtonLinkIcon from '../../../atom/button-link-icon';\nimport PrivacyPolicyContact from '../../../molecule/privacy-policy-contact';\nimport {propTypes, Props, SubArticle} from './types';\nimport styles from './style.css';\n\n// @ts-expect-error (need to get the index)\nconst mapWithIndex = map.convert({cap: false});\n\nconst FAQArticlePage = ({\n title,\n backButton,\n backButtonText,\n subArticles,\n privacyPolicyContact\n}: Props) => {\n return (\n <div className={styles.wrapper}>\n <div className={styles.page}>\n <div className={styles.container}>\n <div className={styles.backContainer}>\n <ButtonLinkIcon {...backButton} />\n <span>{backButtonText}</span>\n </div>\n <h1 className={styles.title}>{title}</h1>\n {mapWithIndex((item: SubArticle, index: number) => {\n return (\n <div className={styles.article} key={`${item.text}${index}`}>\n <h3 className={styles.subTitle}>{item.subTitle}</h3>\n <div\n className={styles.text}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: item.text}}\n />\n <img className={styles.img} src={item.image} alt=\"\" />\n </div>\n );\n }, subArticles)}\n <div className={styles.backContainerMobile}>\n <ButtonLinkIcon {...backButton} />\n <span>{backButtonText}</span>\n </div>\n </div>\n </div>\n <div className={styles.privacyPolicyContact}>\n <PrivacyPolicyContact {...privacyPolicyContact}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,6BAAC,uBAAD,EAAoBjB,UAApB,CADF,eAEE,2CAAOC,cAAP,CAFF,CAnBF,CADF,CADF,eA2BE;IAAK,SAAS,EAAEG,cAAA,CAAOD;EAAvB,gBACE,6BAAC,6BAAD,EAA0BA,oBAA1B,CADF,CA3BF,CADF;AAiCD,CAxCD;;AA0CAL,cAAc,CAACoB,SAAf,2CAA2BA,gBAA3B;eAEepB,c"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/playlist-detail/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/playlist-detail/index.js"],"names":[],"mappings":";AAiBA,uEA8EC"}
|
|
@@ -15,6 +15,8 @@ var _tag = _interopRequireDefault(require("../../atom/tag"));
|
|
|
15
15
|
|
|
16
16
|
var _select = _interopRequireWildcard(require("../../atom/select"));
|
|
17
17
|
|
|
18
|
+
var _buttonLinkIcon = _interopRequireDefault(require("../../atom/button-link-icon"));
|
|
19
|
+
|
|
18
20
|
var _icon = _interopRequireDefault(require("../../atom/icon"));
|
|
19
21
|
|
|
20
22
|
var _cardsGrid = _interopRequireDefault(require("../../organism/cards-grid"));
|
|
@@ -66,16 +68,14 @@ const PlaylistDetail = (props, context) => {
|
|
|
66
68
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
67
69
|
className: _style.default.container,
|
|
68
70
|
"data-name": playlistRef
|
|
69
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
71
|
+
}, /*#__PURE__*/_react.default.createElement(_buttonLinkIcon.default, {
|
|
72
|
+
faIcon: "arrow-left",
|
|
73
|
+
"data-name": "back-button",
|
|
74
|
+
"aria-label": "Back",
|
|
75
|
+
onClick: onBackClick,
|
|
76
|
+
className: _style.default.backButton,
|
|
77
|
+
tooltipPlacement: "right"
|
|
78
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
79
79
|
className: _style.default.ctaContainer
|
|
80
80
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
81
81
|
className: _style.default.coverWrapper
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["DESCRIPTION_BREAKPOINT","PlaylistDetail","props","context","title","coverImages","playlistRef","description","ongoingCourses","playlistCourses","totalCourses","filters","sorting","onBackClick","onContinueLearningClick","translate","showMore","setShowMore","useState","handleShowMore","useCallback","Description","classnames","style","truncate","backgroundContainer","container","
|
|
1
|
+
{"version":3,"file":"index.js","names":["DESCRIPTION_BREAKPOINT","PlaylistDetail","props","context","title","coverImages","playlistRef","description","ongoingCourses","playlistCourses","totalCourses","filters","sorting","onBackClick","onContinueLearningClick","translate","showMore","setShowMore","useState","handleShowMore","useCallback","Description","classnames","style","truncate","backgroundContainer","container","backButton","ctaContainer","coverWrapper","length","showMoreWrapper","faSize","wrapperSize","continueLearningButton","list","contextTypes","skin","Provider","childContextTypes","propTypes","PropTypes","string","isRequired","PlaylistDetailCover","images","shape","CardsGrid","number","onChange","func","options","arrayOf","SelectOptionPropTypes","Select"],"sources":["../../../src/template/playlist-detail/index.js"],"sourcesContent":["import React, {useCallback, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport Provider from '../../atom/provider';\nimport Tag from '../../atom/tag';\nimport Select, {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLinkIcon from '../../atom/button-link-icon';\nimport Icon from '../../atom/icon';\nimport CardsGrid from '../../organism/cards-grid';\nimport AllCourses from '../skill-detail/all-courses';\nimport ContinueLearning from '../skill-detail/continue-learning';\nimport PlaylistDetailCover from '../../molecule/playlist-detail-cover';\nimport {ContinueLearningButton} from '../skill-detail';\nimport style from './style.css';\n\nconst DESCRIPTION_BREAKPOINT = 382;\n\nconst PlaylistDetail = (props, context) => {\n const {\n title,\n coverImages,\n playlistRef,\n description,\n ongoingCourses,\n playlistCourses,\n totalCourses,\n filters,\n sorting,\n onBackClick,\n onContinueLearningClick\n } = props;\n const {translate} = context;\n\n const [showMore, setShowMore] = useState(false);\n\n const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);\n\n const Description = useCallback(() => {\n return (\n <div className={classnames(style.description, !showMore && style.truncate)}>\n {description}\n </div>\n );\n }, [showMore, description]);\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={playlistRef}>\n <ButtonLinkIcon\n faIcon=\"arrow-left\"\n data-name=\"back-button\"\n aria-label=\"Back\"\n onClick={onBackClick}\n className={style.backButton}\n tooltipPlacement=\"right\"\n />\n <div className={style.ctaContainer}>\n <div className={style.coverWrapper}>\n <PlaylistDetailCover images={coverImages} />\n </div>\n <div>\n <Tag label={translate('playlist')} />\n <div className={style.title}>{title}</div>\n {description ? (\n <>\n <Description />\n {description.length >= DESCRIPTION_BREAKPOINT ? (\n <div className={style.showMoreWrapper} onClick={handleShowMore}>\n {translate(showMore ? 'Show less' : 'Show more')}\n <Icon\n iconName={showMore ? 'chevron-up' : 'chevron-down'}\n size={{faSize: 14, wrapperSize: 16}}\n />\n </div>\n ) : null}\n </>\n ) : null}\n <div className={style.continueLearningButton}>\n <ContinueLearningButton\n ongoingCoursesAvailable={!!ongoingCourses.list.length}\n onClick={onContinueLearningClick}\n />\n </div>\n </div>\n </div>\n <ContinueLearning ongoingCourses={ongoingCourses} />\n <AllCourses\n courses={playlistCourses}\n totalCourses={totalCourses}\n filters={filters}\n sorting={sorting}\n />\n </div>\n </div>\n );\n};\n\nPlaylistDetail.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nPlaylistDetail.propTypes = {\n title: PropTypes.string.isRequired,\n coverImages: PlaylistDetailCover.propTypes.images,\n playlistRef: PropTypes.string.isRequired,\n description: PropTypes.string,\n ongoingCourses: PropTypes.shape(CardsGrid.propTypes),\n playlistCourses: PropTypes.shape(CardsGrid.propTypes),\n totalCourses: PropTypes.number,\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n sorting: PropTypes.shape(Select.propTypes),\n onBackClick: PropTypes.func,\n onContinueLearningClick: PropTypes.func\n};\n\nexport default PlaylistDetail;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,sBAAsB,GAAG,GAA/B;;AAEA,MAAMC,cAAc,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACzC,MAAM;IACJC,KADI;IAEJC,WAFI;IAGJC,WAHI;IAIJC,WAJI;IAKJC,cALI;IAMJC,eANI;IAOJC,YAPI;IAQJC,OARI;IASJC,OATI;IAUJC,WAVI;IAWJC;EAXI,IAYFZ,KAZJ;EAaA,MAAM;IAACa;EAAD,IAAcZ,OAApB;EAEA,MAAM,CAACa,QAAD,EAAWC,WAAX,IAA0B,IAAAC,eAAA,EAAS,KAAT,CAAhC;EAEA,MAAMC,cAAc,GAAG,IAAAC,kBAAA,EAAY,MAAMH,WAAW,CAAC,CAACD,QAAF,CAA7B,EAA0C,CAACC,WAAD,EAAcD,QAAd,CAA1C,CAAvB;EAEA,MAAMK,WAAW,GAAG,IAAAD,kBAAA,EAAY,MAAM;IACpC,oBACE;MAAK,SAAS,EAAE,IAAAE,mBAAA,EAAWC,cAAA,CAAMhB,WAAjB,EAA8B,CAACS,QAAD,IAAaO,cAAA,CAAMC,QAAjD;IAAhB,GACGjB,WADH,CADF;EAKD,CANmB,EAMjB,CAACS,QAAD,EAAWT,WAAX,CANiB,CAApB;EAQA,oBACE;IAAK,SAAS,EAAEgB,cAAA,CAAME;EAAtB,gBACE;IAAK,SAAS,EAAEF,cAAA,CAAMG,SAA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|
40
|
-
background-color: cm_grey_100;
|
|
41
|
-
border-radius: 8px;
|
|
42
|
-
width: fit-content;
|
|
43
|
-
padding: 8px;
|
|
44
|
-
cursor: pointer;
|
|
45
40
|
}
|
|
46
41
|
|
|
47
42
|
.ctaContainer {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/index.js"],"names":[],"mappings":"AAeO,8EA+BN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYD,oEA8JC"}
|
|
@@ -19,6 +19,8 @@ var _select = _interopRequireWildcard(require("../../atom/select"));
|
|
|
19
19
|
|
|
20
20
|
var _buttonLink = _interopRequireDefault(require("../../atom/button-link"));
|
|
21
21
|
|
|
22
|
+
var _buttonLinkIcon = _interopRequireDefault(require("../../atom/button-link-icon"));
|
|
23
|
+
|
|
22
24
|
var _icon = _interopRequireDefault(require("../../atom/icon"));
|
|
23
25
|
|
|
24
26
|
var _cardsGrid = _interopRequireDefault(require("../../organism/cards-grid"));
|
|
@@ -131,16 +133,14 @@ const SkillDetail = (props, context) => {
|
|
|
131
133
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
132
134
|
className: _style.default.container,
|
|
133
135
|
"data-name": skillRef
|
|
134
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}
|
|
143
|
-
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
136
|
+
}, /*#__PURE__*/_react.default.createElement(_buttonLinkIcon.default, {
|
|
137
|
+
faIcon: "arrow-left",
|
|
138
|
+
"data-name": "back-button",
|
|
139
|
+
"aria-label": "Back",
|
|
140
|
+
onClick: onBackClick,
|
|
141
|
+
className: _style.default.backButton,
|
|
142
|
+
tooltipPlacement: "right"
|
|
143
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
144
144
|
className: _style.default.ctaContainer
|
|
145
145
|
}, /*#__PURE__*/_react.default.createElement("div", null, focused ? /*#__PURE__*/_react.default.createElement("div", {
|
|
146
146
|
className: _style.default.skillFocusBadge
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ContinueLearningButton","props","context","ongoingCoursesAvailable","onClick","skin","translate","primarySkinColor","width","borderRadius","backgroundColor","convert","position","faIcon","name","color","size","contextTypes","Provider","childContextTypes","propTypes","PropTypes","bool","func","SkillDetail","title","skillRef","description","metrics","focused","availableForReview","ongoingCourses","skillIncludedCourses","totalCourses","filters","sorting","onBackClick","onReviewClick","onContinueLearningClick","score","content","questionsToReview","contentCompleted","showMore","setShowMore","useState","handleShowMore","useCallback","Description","classnames","style","truncate","ProgressBar","undefined","progressBarColor","inlineProgressValueStyle","progressBarWrapper","progress","backgroundContainer","container","backButtonWrapper","faSize","wrapperSize","ctaContainer","skillFocusBadge","length","showMoreWrapper","ctaWrapper","list","progressInformationsWrapper","progressTitle","skillCoursesAndQuestionsWrapper","skillInformation","skillInformationNumber","progressInformations","progressInformation","progressInformationNumber","toFixed","string","isRequired","shape","number","CardsGrid","onChange","options","arrayOf","SelectOptionPropTypes","Select"],"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\nexport const ContinueLearningButton = (props, context) => {\n const {ongoingCoursesAvailable, onClick} = props;\n const {skin, translate} = context;\n const primarySkinColor = get('common.primary', skin);\n\n return (\n <div>\n <ButtonLink\n label={\n ongoingCoursesAvailable ? translate('continue_learning') : translate('start_learning')\n }\n type=\"primary\"\n customStyle={{\n width: 'fit-content',\n borderRadius: '12px',\n backgroundColor: primarySkinColor\n }}\n hoverBackgroundColor={convert(`hsl(from ${primarySkinColor} h s calc(l*(1 - 0.08)))`)}\n hoverColor=\"#FFFFFF\"\n icon={{\n position: 'left',\n faIcon: {\n name: 'play',\n color: '#FFFFFF',\n size: 16\n }\n }}\n onClick={onClick}\n />\n </div>\n );\n};\n\nContinueLearningButton.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nContinueLearningButton.propTypes = {\n ongoingCoursesAvailable: PropTypes.bool,\n onClick: PropTypes.func\n};\n\nconst SkillDetail = (props, context) => {\n const {\n title,\n skillRef,\n description,\n metrics = {},\n focused,\n availableForReview,\n ongoingCourses,\n skillIncludedCourses,\n totalCourses,\n filters,\n sorting,\n onBackClick,\n onReviewClick,\n onContinueLearningClick\n } = props;\n const {score, content, questionsToReview, contentCompleted = 0} = metrics;\n const {translate} = context;\n\n const [showMore, setShowMore] = useState(false);\n\n const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);\n\n const Description = useCallback(() => {\n return (\n <div className={classnames(style.description, !showMore && style.truncate)}>\n {description}\n </div>\n );\n }, [showMore, description]);\n\n const ProgressBar = useCallback(() => {\n if (score === undefined) return null;\n const progressBarColor = '#3EC483';\n const inlineProgressValueStyle = {\n backgroundColor: progressBarColor,\n width: `${score}%`\n };\n\n return (\n <div className={style.progressBarWrapper}>\n <div\n data-name=\"progress\"\n className={style.progress}\n style={inlineProgressValueStyle}\n role=\"progressbar\"\n />\n </div>\n );\n }, [score]);\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={skillRef}>\n <div className={style.backButtonWrapper} onClick={onBackClick}>\n <Icon\n iconName=\"arrow-left\"\n size={{\n faSize: 14,\n wrapperSize: 14\n }}\n />\n </div>\n <div className={style.ctaContainer}>\n <div>\n {focused ? (\n <div className={style.skillFocusBadge}>\n <Icon\n iconName=\"bullseye-arrow\"\n backgroundColor=\"#DDD1FF\"\n size={{\n faSize: 10,\n wrapperSize: 16\n }}\n />\n {translate('skill_focus')}\n </div>\n ) : null}\n <div className={style.title}>{title}</div>\n {description ? (\n <>\n <Description />\n {description.length >= 226 ? (\n <div className={style.showMoreWrapper} onClick={handleShowMore}>\n {showMore ? translate('Show less') : translate('Show more')}\n <Icon\n iconName={showMore ? 'chevron-up' : 'chevron-down'}\n size={{\n faSize: 14,\n wrapperSize: 16\n }}\n />\n </div>\n ) : null}\n </>\n ) : null}\n </div>\n\n <div className={style.ctaWrapper}>\n <ButtonLink\n type=\"secondary\"\n onClick={onReviewClick}\n label={translate('review_this_skill')}\n disabled={!availableForReview}\n customStyle={{\n width: 'fit-content',\n borderRadius: '12px'\n }}\n />\n <ContinueLearningButton\n ongoingCoursesAvailable={!!ongoingCourses.list.length}\n onClick={onContinueLearningClick}\n />\n </div>\n </div>\n {score !== undefined ? (\n <div className={style.progressInformationsWrapper}>\n <div className={style.progressTitle}>{translate('your_progress')}</div>\n <div className={style.skillCoursesAndQuestionsWrapper}>\n {content ? (\n <div className={style.skillInformation} data-name=\"skill-courses\">\n <span className={style.skillInformationNumber}>{content}</span>{' '}\n {translate('courses')}\n </div>\n ) : null}\n {questionsToReview ? (\n <div className={style.skillInformation} data-name=\"skill-questions\">\n <span className={style.skillInformationNumber}>{questionsToReview}</span>\n {translate('questions')}\n </div>\n ) : null}\n </div>\n <ProgressBar />\n <div className={style.progressInformations}>\n {content && (\n <>\n <div className={style.progressInformation} data-name=\"skill-completed-courses\">\n <span className={style.progressInformationNumber}>{contentCompleted}</span>\n {` ${translate('courses_completed')}`}\n </div>\n <div className={style.progressInformation} data-name=\"completed-percentage\">\n <span className={style.progressInformationNumber}>{score.toFixed(1)}%</span>\n </div>\n </>\n )}\n </div>\n </div>\n ) : null}\n <ContinueLearning ongoingCourses={ongoingCourses} />\n <AllCourses\n courses={skillIncludedCourses}\n totalCourses={totalCourses}\n filters={filters}\n sorting={sorting}\n />\n </div>\n </div>\n );\n};\n\nSkillDetail.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nSkillDetail.propTypes = {\n title: PropTypes.string.isRequired,\n skillRef: PropTypes.string.isRequired,\n description: PropTypes.string,\n metrics: PropTypes.shape({\n score: PropTypes.number,\n content: PropTypes.number,\n questionsToReview: PropTypes.number,\n contentCompleted: PropTypes.number\n }),\n focused: PropTypes.bool,\n availableForReview: PropTypes.bool,\n ongoingCourses: PropTypes.shape(CardsGrid.propTypes),\n skillIncludedCourses: PropTypes.shape(CardsGrid.propTypes),\n totalCourses: PropTypes.number,\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n sorting: PropTypes.shape(Select.propTypes),\n onBackClick: PropTypes.func,\n onReviewClick: PropTypes.func,\n onContinueLearningClick: PropTypes.func\n};\n\nexport default SkillDetail;\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEO,MAAMA,sBAAsB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACxD,MAAM;IAACC,uBAAD;IAA0BC;EAA1B,IAAqCH,KAA3C;EACA,MAAM;IAACI,IAAD;IAAOC;EAAP,IAAoBJ,OAA1B;EACA,MAAMK,gBAAgB,GAAG,mBAAI,gBAAJ,EAAsBF,IAAtB,CAAzB;EAEA,oBACE,uDACE,6BAAC,mBAAD;IACE,KAAK,EACHF,uBAAuB,GAAGG,SAAS,CAAC,mBAAD,CAAZ,GAAoCA,SAAS,CAAC,gBAAD,CAFxE;IAIE,IAAI,EAAC,SAJP;IAKE,WAAW,EAAE;MACXE,KAAK,EAAE,aADI;MAEXC,YAAY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BH;EAsBtBe,uBAAuB,EAAEjB,kBAAA,CAAUE;AAtBb,CAAxB;eAyBeC,W"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["ContinueLearningButton","props","context","ongoingCoursesAvailable","onClick","skin","translate","primarySkinColor","width","borderRadius","backgroundColor","convert","position","faIcon","name","color","size","contextTypes","Provider","childContextTypes","propTypes","PropTypes","bool","func","SkillDetail","title","skillRef","description","metrics","focused","availableForReview","ongoingCourses","skillIncludedCourses","totalCourses","filters","sorting","onBackClick","onReviewClick","onContinueLearningClick","score","content","questionsToReview","contentCompleted","showMore","setShowMore","useState","handleShowMore","useCallback","Description","classnames","style","truncate","ProgressBar","undefined","progressBarColor","inlineProgressValueStyle","progressBarWrapper","progress","backgroundContainer","container","backButton","ctaContainer","skillFocusBadge","faSize","wrapperSize","length","showMoreWrapper","ctaWrapper","list","progressInformationsWrapper","progressTitle","skillCoursesAndQuestionsWrapper","skillInformation","skillInformationNumber","progressInformations","progressInformation","progressInformationNumber","toFixed","string","isRequired","shape","number","CardsGrid","onChange","options","arrayOf","SelectOptionPropTypes","Select"],"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 ButtonLinkIcon from '../../atom/button-link-icon';\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\nexport const ContinueLearningButton = (props, context) => {\n const {ongoingCoursesAvailable, onClick} = props;\n const {skin, translate} = context;\n const primarySkinColor = get('common.primary', skin);\n\n return (\n <div>\n <ButtonLink\n label={\n ongoingCoursesAvailable ? translate('continue_learning') : translate('start_learning')\n }\n type=\"primary\"\n customStyle={{\n width: 'fit-content',\n borderRadius: '12px',\n backgroundColor: primarySkinColor\n }}\n hoverBackgroundColor={convert(`hsl(from ${primarySkinColor} h s calc(l*(1 - 0.08)))`)}\n hoverColor=\"#FFFFFF\"\n icon={{\n position: 'left',\n faIcon: {\n name: 'play',\n color: '#FFFFFF',\n size: 16\n }\n }}\n onClick={onClick}\n />\n </div>\n );\n};\n\nContinueLearningButton.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nContinueLearningButton.propTypes = {\n ongoingCoursesAvailable: PropTypes.bool,\n onClick: PropTypes.func\n};\n\nconst SkillDetail = (props, context) => {\n const {\n title,\n skillRef,\n description,\n metrics = {},\n focused,\n availableForReview,\n ongoingCourses,\n skillIncludedCourses,\n totalCourses,\n filters,\n sorting,\n onBackClick,\n onReviewClick,\n onContinueLearningClick\n } = props;\n const {score, content, questionsToReview, contentCompleted = 0} = metrics;\n const {translate} = context;\n\n const [showMore, setShowMore] = useState(false);\n\n const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);\n\n const Description = useCallback(() => {\n return (\n <div className={classnames(style.description, !showMore && style.truncate)}>\n {description}\n </div>\n );\n }, [showMore, description]);\n\n const ProgressBar = useCallback(() => {\n if (score === undefined) return null;\n const progressBarColor = '#3EC483';\n const inlineProgressValueStyle = {\n backgroundColor: progressBarColor,\n width: `${score}%`\n };\n\n return (\n <div className={style.progressBarWrapper}>\n <div\n data-name=\"progress\"\n className={style.progress}\n style={inlineProgressValueStyle}\n role=\"progressbar\"\n />\n </div>\n );\n }, [score]);\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={skillRef}>\n <ButtonLinkIcon\n faIcon=\"arrow-left\"\n data-name=\"back-button\"\n aria-label=\"Back\"\n onClick={onBackClick}\n className={style.backButton}\n tooltipPlacement=\"right\"\n />\n <div className={style.ctaContainer}>\n <div>\n {focused ? (\n <div className={style.skillFocusBadge}>\n <Icon\n iconName=\"bullseye-arrow\"\n backgroundColor=\"#DDD1FF\"\n size={{\n faSize: 10,\n wrapperSize: 16\n }}\n />\n {translate('skill_focus')}\n </div>\n ) : null}\n <div className={style.title}>{title}</div>\n {description ? (\n <>\n <Description />\n {description.length >= 226 ? (\n <div className={style.showMoreWrapper} onClick={handleShowMore}>\n {showMore ? translate('Show less') : translate('Show more')}\n <Icon\n iconName={showMore ? 'chevron-up' : 'chevron-down'}\n size={{\n faSize: 14,\n wrapperSize: 16\n }}\n />\n </div>\n ) : null}\n </>\n ) : null}\n </div>\n\n <div className={style.ctaWrapper}>\n <ButtonLink\n type=\"secondary\"\n onClick={onReviewClick}\n label={translate('review_this_skill')}\n disabled={!availableForReview}\n customStyle={{\n width: 'fit-content',\n borderRadius: '12px'\n }}\n />\n <ContinueLearningButton\n ongoingCoursesAvailable={!!ongoingCourses.list.length}\n onClick={onContinueLearningClick}\n />\n </div>\n </div>\n {score !== undefined ? (\n <div className={style.progressInformationsWrapper}>\n <div className={style.progressTitle}>{translate('your_progress')}</div>\n <div className={style.skillCoursesAndQuestionsWrapper}>\n {content ? (\n <div className={style.skillInformation} data-name=\"skill-courses\">\n <span className={style.skillInformationNumber}>{content}</span>{' '}\n {translate('courses')}\n </div>\n ) : null}\n {questionsToReview ? (\n <div className={style.skillInformation} data-name=\"skill-questions\">\n <span className={style.skillInformationNumber}>{questionsToReview}</span>\n {translate('questions')}\n </div>\n ) : null}\n </div>\n <ProgressBar />\n <div className={style.progressInformations}>\n {content && (\n <>\n <div className={style.progressInformation} data-name=\"skill-completed-courses\">\n <span className={style.progressInformationNumber}>{contentCompleted}</span>\n {` ${translate('courses_completed')}`}\n </div>\n <div className={style.progressInformation} data-name=\"completed-percentage\">\n <span className={style.progressInformationNumber}>{score.toFixed(1)}%</span>\n </div>\n </>\n )}\n </div>\n </div>\n ) : null}\n <ContinueLearning ongoingCourses={ongoingCourses} />\n <AllCourses\n courses={skillIncludedCourses}\n totalCourses={totalCourses}\n filters={filters}\n sorting={sorting}\n />\n </div>\n </div>\n );\n};\n\nSkillDetail.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nSkillDetail.propTypes = {\n title: PropTypes.string.isRequired,\n skillRef: PropTypes.string.isRequired,\n description: PropTypes.string,\n metrics: PropTypes.shape({\n score: PropTypes.number,\n content: PropTypes.number,\n questionsToReview: PropTypes.number,\n contentCompleted: PropTypes.number\n }),\n focused: PropTypes.bool,\n availableForReview: PropTypes.bool,\n ongoingCourses: PropTypes.shape(CardsGrid.propTypes),\n skillIncludedCourses: PropTypes.shape(CardsGrid.propTypes),\n totalCourses: PropTypes.number,\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n sorting: PropTypes.shape(Select.propTypes),\n onBackClick: PropTypes.func,\n onReviewClick: PropTypes.func,\n onContinueLearningClick: PropTypes.func\n};\n\nexport default SkillDetail;\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEO,MAAMA,sBAAsB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACxD,MAAM;IAACC,uBAAD;IAA0BC;EAA1B,IAAqCH,KAA3C;EACA,MAAM;IAACI,IAAD;IAAOC;EAAP,IAAoBJ,OAA1B;EACA,MAAMK,gBAAgB,GAAG,mBAAI,gBAAJ,EAAsBF,IAAtB,CAAzB;EAEA,oBACE,uDACE,6BAAC,mBAAD;IACE,KAAK,EACHF,uBAAuB,GAAGG,SAAS,CAAC,mBAAD,CAAZ,GAAoCA,SAAS,CAAC,gBAAD,CAFxE;IAIE,IAAI,EAAC,SAJP;IAKE,WAAW,EAAE;MACXE,KAAK,EAAE,aADI;MAEXC,YAAY,EAAE,MAFH;MAGXC,eAAe,EAAEH;IAHN,CALf;IAUE,oBAAoB,EAAE,IAAAI,yBAAA,EAAS,YAAWJ,gBAAiB,0BAArC,C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|
|
37
37
|
|
|
38
|
-
.
|
|
38
|
+
.backButton {
|
|
39
39
|
margin-bottom: 16px;
|
|
40
|
-
background-color: cm_grey_100;
|
|
41
|
-
border-radius: 8px;
|
|
42
|
-
width: fit-content;
|
|
43
|
-
padding: 8px;
|
|
44
|
-
cursor: pointer;
|
|
45
40
|
}
|
|
46
41
|
|
|
47
42
|
.ctaContainer {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/components",
|
|
3
|
-
"version": "11.32.
|
|
3
|
+
"version": "11.32.27",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -177,5 +177,5 @@
|
|
|
177
177
|
"last 2 versions",
|
|
178
178
|
"IE 11"
|
|
179
179
|
],
|
|
180
|
-
"gitHead": "
|
|
180
|
+
"gitHead": "6d822555cf25665641a17e381be1c284e49cd74b"
|
|
181
181
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-link-icon-only/index.js"],"names":[],"mappings":";AAkCA,6DAiDC"}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import _keys from "lodash/fp/keys";
|
|
2
|
-
import _getOr from "lodash/fp/getOr";
|
|
3
|
-
|
|
4
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
|
-
|
|
6
|
-
import React, { useMemo } from 'react';
|
|
7
|
-
import PropTypes from 'prop-types';
|
|
8
|
-
import classnames from 'classnames';
|
|
9
|
-
import { ICONS } from '../../util/button-icons';
|
|
10
|
-
import Link from '../link'; // eslint-disable-next-line css-modules/no-unused-class
|
|
11
|
-
|
|
12
|
-
import style from './style.css';
|
|
13
|
-
|
|
14
|
-
const getButtonContent = icon => {
|
|
15
|
-
const Icon = _getOr(null, icon, ICONS);
|
|
16
|
-
|
|
17
|
-
if (!Icon) {
|
|
18
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
19
|
-
className: style.buttonContent
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
24
|
-
className: style.buttonContent
|
|
25
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
26
|
-
className: style.icon
|
|
27
|
-
}));
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const getSizeStyle = size => {
|
|
31
|
-
switch (size) {
|
|
32
|
-
case 'small':
|
|
33
|
-
return style.small;
|
|
34
|
-
|
|
35
|
-
case 'responsive':
|
|
36
|
-
return style.responsive;
|
|
37
|
-
|
|
38
|
-
default:
|
|
39
|
-
return style.default;
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const ButtonLinkIconOnly = props => {
|
|
44
|
-
const {
|
|
45
|
-
size = 'default',
|
|
46
|
-
disabled,
|
|
47
|
-
icon,
|
|
48
|
-
'data-name': dataName,
|
|
49
|
-
'aria-label': ariaLabel,
|
|
50
|
-
link,
|
|
51
|
-
onClick,
|
|
52
|
-
className
|
|
53
|
-
} = props;
|
|
54
|
-
const contentView = getButtonContent(icon);
|
|
55
|
-
const styleButton = classnames(getSizeStyle(size), link && style.link, disabled && style.disabled, style[className]);
|
|
56
|
-
const handleOnClick = useMemo(() => () => onClick(), [onClick]);
|
|
57
|
-
|
|
58
|
-
if (link) {
|
|
59
|
-
return /*#__PURE__*/React.createElement(Link, _extends({}, link, {
|
|
60
|
-
className: styleButton,
|
|
61
|
-
"data-name": dataName,
|
|
62
|
-
"aria-label": ariaLabel,
|
|
63
|
-
title: ariaLabel
|
|
64
|
-
}), contentView);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return /*#__PURE__*/React.createElement("button", {
|
|
68
|
-
type: "button",
|
|
69
|
-
"aria-label": ariaLabel,
|
|
70
|
-
"data-name": dataName,
|
|
71
|
-
"data-testid": `button-${dataName}-${className}`,
|
|
72
|
-
title: ariaLabel,
|
|
73
|
-
className: styleButton,
|
|
74
|
-
onClick: handleOnClick,
|
|
75
|
-
disabled: disabled
|
|
76
|
-
}, contentView);
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
ButtonLinkIconOnly.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
80
|
-
size: PropTypes.oneOf(['default', 'small', 'responsive']),
|
|
81
|
-
'aria-label': PropTypes.string,
|
|
82
|
-
'data-name': PropTypes.string,
|
|
83
|
-
icon: PropTypes.oneOf(_keys(ICONS)),
|
|
84
|
-
onClick: PropTypes.func,
|
|
85
|
-
link: PropTypes.shape({
|
|
86
|
-
href: PropTypes.string,
|
|
87
|
-
download: PropTypes.bool,
|
|
88
|
-
target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top'])
|
|
89
|
-
}),
|
|
90
|
-
disabled: PropTypes.bool,
|
|
91
|
-
className: PropTypes.string
|
|
92
|
-
} : {};
|
|
93
|
-
export default ButtonLinkIconOnly;
|
|
94
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","classnames","ICONS","Link","style","getButtonContent","icon","Icon","buttonContent","getSizeStyle","size","small","responsive","default","ButtonLinkIconOnly","props","disabled","dataName","ariaLabel","link","onClick","className","contentView","styleButton","handleOnClick","propTypes","oneOf","string","func","shape","href","download","bool","target"],"sources":["../../../src/atom/button-link-icon-only/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, keys} from 'lodash/fp';\nimport classnames from 'classnames';\nimport {ICONS} from '../../util/button-icons';\nimport Link from '../link';\n// eslint-disable-next-line css-modules/no-unused-class\nimport style from './style.css';\n\nconst getButtonContent = icon => {\n const Icon = getOr(null, icon, ICONS);\n\n if (!Icon) {\n return <div className={style.buttonContent} />;\n }\n\n return (\n <div className={style.buttonContent}>\n <Icon className={style.icon} />\n </div>\n );\n};\n\nconst getSizeStyle = size => {\n switch (size) {\n case 'small':\n return style.small;\n case 'responsive':\n return style.responsive;\n default:\n return style.default;\n }\n};\n\nconst ButtonLinkIconOnly = props => {\n const {\n size = 'default',\n disabled,\n icon,\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n link,\n onClick,\n className\n } = props;\n const contentView = getButtonContent(icon);\n const styleButton = classnames(\n getSizeStyle(size),\n link && style.link,\n disabled && style.disabled,\n style[className]\n );\n\n const handleOnClick = useMemo(() => () => onClick(), [onClick]);\n\n if (link) {\n return (\n <Link\n {...link}\n className={styleButton}\n data-name={dataName}\n aria-label={ariaLabel}\n title={ariaLabel}\n >\n {contentView}\n </Link>\n );\n }\n\n return (\n <button\n type=\"button\"\n aria-label={ariaLabel}\n data-name={dataName}\n data-testid={`button-${dataName}-${className}`}\n title={ariaLabel}\n className={styleButton}\n onClick={handleOnClick}\n disabled={disabled}\n >\n {contentView}\n </button>\n );\n};\n\nButtonLinkIconOnly.propTypes = {\n size: PropTypes.oneOf(['default', 'small', 'responsive']),\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string,\n icon: PropTypes.oneOf(keys(ICONS)),\n onClick: PropTypes.func,\n link: PropTypes.shape({\n href: PropTypes.string,\n download: PropTypes.bool,\n target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top'])\n }),\n disabled: PropTypes.bool,\n className: PropTypes.string\n};\n\nexport default ButtonLinkIconOnly;\n"],"mappings":";;;;;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SAAQC,KAAR,QAAoB,yBAApB;AACA,OAAOC,IAAP,MAAiB,SAAjB,C,CACA;;AACA,OAAOC,KAAP,MAAkB,aAAl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AEA;IALT,IAOGI,WAPH,CADF;EAWD;;EAED,oBACE;IACE,IAAI,EAAC,QADP;IAEE,cAAYJ,SAFd;IAGE,aAAWD,QAHb;IAIE,eAAc,UAASA,QAAS,IAAGI,SAAU,EAJ/C;IAKE,KAAK,EAAEH,SALT;IAME,SAAS,EAAEK,WANb;IAOE,OAAO,EAAEC,aAPX;IAQE,QAAQ,EAAER;EARZ,GAUGM,WAVH,CADF;AAcD,CAjDD;;AAmDAR,kBAAkB,CAACW,SAAnB,2CAA+B;EAC7Bf,IAAI,EAAEV,SAAS,CAAC0B,KAAV,CAAgB,CAAC,SAAD,EAAY,OAAZ,EAAqB,YAArB,CAAhB,CADuB;EAE7B,cAAc1B,SAAS,CAAC2B,MAFK;EAG7B,aAAa3B,SAAS,CAAC2B,MAHM;EAI7BrB,IAAI,EAAEN,SAAS,CAAC0B,KAAV,CAAgB,MAAKxB,KAAL,CAAhB,CAJuB;EAK7BkB,OAAO,EAAEpB,SAAS,CAAC4B,IALU;EAM7BT,IAAI,EAAEnB,SAAS,CAAC6B,KAAV,CAAgB;IACpBC,IAAI,EAAE9B,SAAS,CAAC2B,MADI;IAEpBI,QAAQ,EAAE/B,SAAS,CAACgC,IAFA;IAGpBC,MAAM,EAAEjC,SAAS,CAAC0B,KAAV,CAAgB,CAAC,OAAD,EAAU,QAAV,EAAoB,SAApB,EAA+B,MAA/B,CAAhB;EAHY,CAAhB,CANuB;EAW7BV,QAAQ,EAAEhB,SAAS,CAACgC,IAXS;EAY7BX,SAAS,EAAErB,SAAS,CAAC2B;AAZQ,CAA/B;AAeA,eAAeb,kBAAf"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-link-icon-only/index.js"],"names":[],"mappings":";AAkCA,6DAiDC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["getButtonContent","icon","Icon","ICONS","style","buttonContent","getSizeStyle","size","small","responsive","default","ButtonLinkIconOnly","props","disabled","dataName","ariaLabel","link","onClick","className","contentView","styleButton","classnames","handleOnClick","useMemo","propTypes","PropTypes","oneOf","string","func","shape","href","download","bool","target"],"sources":["../../../src/atom/button-link-icon-only/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, keys} from 'lodash/fp';\nimport classnames from 'classnames';\nimport {ICONS} from '../../util/button-icons';\nimport Link from '../link';\n// eslint-disable-next-line css-modules/no-unused-class\nimport style from './style.css';\n\nconst getButtonContent = icon => {\n const Icon = getOr(null, icon, ICONS);\n\n if (!Icon) {\n return <div className={style.buttonContent} />;\n }\n\n return (\n <div className={style.buttonContent}>\n <Icon className={style.icon} />\n </div>\n );\n};\n\nconst getSizeStyle = size => {\n switch (size) {\n case 'small':\n return style.small;\n case 'responsive':\n return style.responsive;\n default:\n return style.default;\n }\n};\n\nconst ButtonLinkIconOnly = props => {\n const {\n size = 'default',\n disabled,\n icon,\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n link,\n onClick,\n className\n } = props;\n const contentView = getButtonContent(icon);\n const styleButton = classnames(\n getSizeStyle(size),\n link && style.link,\n disabled && style.disabled,\n style[className]\n );\n\n const handleOnClick = useMemo(() => () => onClick(), [onClick]);\n\n if (link) {\n return (\n <Link\n {...link}\n className={styleButton}\n data-name={dataName}\n aria-label={ariaLabel}\n title={ariaLabel}\n >\n {contentView}\n </Link>\n );\n }\n\n return (\n <button\n type=\"button\"\n aria-label={ariaLabel}\n data-name={dataName}\n data-testid={`button-${dataName}-${className}`}\n title={ariaLabel}\n className={styleButton}\n onClick={handleOnClick}\n disabled={disabled}\n >\n {contentView}\n </button>\n );\n};\n\nButtonLinkIconOnly.propTypes = {\n size: PropTypes.oneOf(['default', 'small', 'responsive']),\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string,\n icon: PropTypes.oneOf(keys(ICONS)),\n onClick: PropTypes.func,\n link: PropTypes.shape({\n href: PropTypes.string,\n download: PropTypes.bool,\n target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top'])\n }),\n disabled: PropTypes.bool,\n className: PropTypes.string\n};\n\nexport default ButtonLinkIconOnly;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AAEA;;;;;;;;;;AAEA,MAAMA,gBAAgB,GAAGC,IAAI,IAAI;EAC/B,MAAMC,IAAI,GAAG,qBAAM,IAAN,EAAYD,IAAZ,EAAkBE,kBAAlB,CAAb;;EAEA,IAAI,CAACD,IAAL,EAAW;IACT,oBAAO;MAAK,SAAS,EAAEE,cAAA,CAAMC;IAAtB,EAAP;EACD;;EAED,oBACE;IAAK,SAAS,EAAED,cAAA,CAAMC;EAAtB,gBACE,6BAAC,IAAD;IAAM,SAAS,EAAED,cAAA,CAAMH;EAAvB,EADF,CADF;AAKD,CAZD;;AAcA,MAAMK,YAAY,GAAGC,IAAI,IAAI;EAC3B,QAAQA,IAAR;IACE,KAAK,OAAL;MACE,OAAOH,cAAA,CAAMI,KAAb;;IACF,KAAK,YAAL;MACE,OAAOJ,cAAA,CAAMK,UAAb;;IACF;MACE,OAAOL,cAAA,CAAMM,OAAb;EANJ;AAQD,CATD;;AAWA,MAAMC,kBAAkB,GAAGC,KAAK,IAAI;EAClC,MAAM;IACJL,IAAI,GAAG,SADH;IAEJM,QAFI;IAGJZ,IAHI;IAIJ,aAAaa,QAJT;IAKJ,cAAcC,SALV;IAMJC,IANI;IAOJC,OAPI;IAQJC;EARI,IASFN,KATJ;EAUA,MAAMO,WAAW,GAAGnB,gBAAgB,CAACC,IAAD,CAApC;EACA,MAAMmB,WAAW,GAAG,IAAAC,mBAAA,EAClBf,YAAY,CAACC,IAAD,CADM,EAElBS,IAAI,IAAIZ,cAAA,CAAMY,IAFI,EAGlBH,QAAQ,IAAIT,cAAA,CAAMS,QAHA,EAIlBT,cAAA,CAAMc,SAAN,CAJkB,CAApB;EAOA,MAAMI,aAAa,GAAG,IAAAC,cAAA,EAAQ,M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