@coorpacademy/components 11.32.31 → 11.32.33-alpha.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/index.d.ts.map +1 -1
- package/es/atom/button-link/index.js +2 -1
- package/es/atom/button-link/index.js.map +1 -1
- package/es/atom/button-link/types.d.ts +1 -0
- package/es/atom/button-link/types.d.ts.map +1 -1
- package/es/atom/button-link/types.js.map +1 -1
- package/es/atom/icon/index.d.ts.map +1 -1
- package/es/atom/icon/index.js +7 -3
- package/es/atom/icon/index.js.map +1 -1
- package/es/atom/radio-with-title/index.d.ts +2 -1
- package/es/atom/radio-with-title/index.d.ts.map +1 -1
- package/es/atom/radio-with-title/types.d.ts +2 -1
- package/es/atom/radio-with-title/types.d.ts.map +1 -1
- package/es/atom/tag/index.d.ts +4 -2
- package/es/atom/tag/index.d.ts.map +1 -1
- package/es/atom/tag/index.js +27 -7
- package/es/atom/tag/index.js.map +1 -1
- package/es/atom/tag/style.css +7 -0
- package/es/atom/title/index.d.ts +2 -1
- package/es/molecule/bulk-progress-bar/index.d.ts.map +1 -1
- package/es/molecule/bulk-progress-bar/index.js +2 -1
- package/es/molecule/bulk-progress-bar/index.js.map +1 -1
- package/es/molecule/bulk-progress-bar/style.css +0 -4
- package/es/molecule/bullet-point-menu-button/index.d.ts.map +1 -1
- package/es/molecule/bullet-point-menu-button/index.js +2 -1
- package/es/molecule/bullet-point-menu-button/index.js.map +1 -1
- package/es/molecule/cm-popin/types.d.ts +2 -1
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/progress-bar/index.d.ts +1 -0
- package/es/molecule/progress-bar/index.d.ts.map +1 -1
- package/es/molecule/progress-bar/index.js +6 -4
- package/es/molecule/progress-bar/index.js.map +1 -1
- package/es/molecule/progress-wrapper/index.d.ts +29 -0
- package/es/molecule/progress-wrapper/index.d.ts.map +1 -0
- package/es/molecule/progress-wrapper/index.js +200 -0
- package/es/molecule/progress-wrapper/index.js.map +1 -0
- package/es/molecule/progress-wrapper/style.css +185 -0
- package/es/molecule/title-and-checkbox-wrapper/index.d.ts +2 -1
- package/es/molecule/title-radio-wrapper/index.d.ts +2 -1
- package/es/molecule/title-radio-wrapper/index.d.ts.map +1 -1
- package/es/molecule/title-radio-wrapper/types.d.ts +2 -1
- package/es/molecule/title-radio-wrapper/types.d.ts.map +1 -1
- package/es/organism/rewards-form/index.d.ts +2 -1
- package/es/organism/select-opponents/index.d.ts +2 -1
- package/es/organism/select-opponents/index.d.ts.map +1 -1
- package/es/organism/select-opponents/types.d.ts +2 -1
- package/es/organism/select-opponents/types.d.ts.map +1 -1
- package/es/organism/title-and-input/index.d.ts +4 -2
- package/es/organism/title-and-input/index.d.ts.map +1 -1
- package/es/organism/title-and-input/types.d.ts +4 -2
- package/es/organism/title-and-input/types.d.ts.map +1 -1
- package/es/organism/wizard-contents/index.d.ts +2 -1
- package/es/template/activity/progression-item.css +0 -4
- package/es/template/activity/progression-item.d.ts.map +1 -1
- package/es/template/activity/progression-item.js +2 -1
- package/es/template/activity/progression-item.js.map +1 -1
- package/es/template/app-player/loading/index.d.ts +2 -1
- package/es/template/app-player/player/index.d.ts +4 -2
- package/es/template/app-player/player/slides/index.d.ts +2 -1
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +2 -1
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +2 -1
- package/es/template/app-review/index.d.ts +2 -1
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +2 -1
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.d.ts +2 -1
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +2 -1
- package/es/template/certification-detail/index.d.ts +105 -0
- package/es/template/certification-detail/index.d.ts.map +1 -0
- package/es/template/certification-detail/index.js +158 -0
- package/es/template/certification-detail/index.js.map +1 -0
- package/es/template/certification-detail/style.css +130 -0
- package/es/template/common/dashboard/index.d.ts +4 -2
- package/es/template/common/search-page/index.d.ts +2 -1
- package/es/template/external-course/index.d.ts +2 -1
- package/es/template/playlist-detail/index.d.ts.map +1 -1
- package/es/template/playlist-detail/index.js +4 -2
- package/es/template/playlist-detail/index.js.map +1 -1
- package/es/template/playlist-detail/style.css +5 -0
- package/es/template/skill-detail/all-courses.css +6 -6
- package/es/template/skill-detail/continue-learning.d.ts.map +1 -1
- package/es/template/skill-detail/continue-learning.js +3 -2
- package/es/template/skill-detail/continue-learning.js.map +1 -1
- package/lib/atom/button-link/index.d.ts.map +1 -1
- package/lib/atom/button-link/index.js +2 -1
- package/lib/atom/button-link/index.js.map +1 -1
- package/lib/atom/button-link/types.d.ts +1 -0
- package/lib/atom/button-link/types.d.ts.map +1 -1
- package/lib/atom/button-link/types.js.map +1 -1
- package/lib/atom/icon/index.d.ts.map +1 -1
- package/lib/atom/icon/index.js +7 -3
- package/lib/atom/icon/index.js.map +1 -1
- package/lib/atom/radio-with-title/index.d.ts +2 -1
- package/lib/atom/radio-with-title/index.d.ts.map +1 -1
- package/lib/atom/radio-with-title/types.d.ts +2 -1
- package/lib/atom/radio-with-title/types.d.ts.map +1 -1
- package/lib/atom/tag/index.d.ts +4 -2
- package/lib/atom/tag/index.d.ts.map +1 -1
- package/lib/atom/tag/index.js +28 -7
- package/lib/atom/tag/index.js.map +1 -1
- package/lib/atom/tag/style.css +7 -0
- package/lib/atom/title/index.d.ts +2 -1
- package/lib/molecule/bulk-progress-bar/index.d.ts.map +1 -1
- package/lib/molecule/bulk-progress-bar/index.js +2 -1
- package/lib/molecule/bulk-progress-bar/index.js.map +1 -1
- package/lib/molecule/bulk-progress-bar/style.css +0 -4
- package/lib/molecule/bullet-point-menu-button/index.d.ts.map +1 -1
- package/lib/molecule/bullet-point-menu-button/index.js +5 -3
- package/lib/molecule/bullet-point-menu-button/index.js.map +1 -1
- package/lib/molecule/cm-popin/types.d.ts +2 -1
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/progress-bar/index.d.ts +1 -0
- package/lib/molecule/progress-bar/index.d.ts.map +1 -1
- package/lib/molecule/progress-bar/index.js +6 -4
- package/lib/molecule/progress-bar/index.js.map +1 -1
- package/lib/molecule/progress-wrapper/index.d.ts +29 -0
- package/lib/molecule/progress-wrapper/index.d.ts.map +1 -0
- package/lib/molecule/progress-wrapper/index.js +221 -0
- package/lib/molecule/progress-wrapper/index.js.map +1 -0
- package/lib/molecule/progress-wrapper/style.css +185 -0
- package/lib/molecule/title-and-checkbox-wrapper/index.d.ts +2 -1
- package/lib/molecule/title-radio-wrapper/index.d.ts +2 -1
- package/lib/molecule/title-radio-wrapper/index.d.ts.map +1 -1
- package/lib/molecule/title-radio-wrapper/types.d.ts +2 -1
- package/lib/molecule/title-radio-wrapper/types.d.ts.map +1 -1
- package/lib/organism/rewards-form/index.d.ts +2 -1
- package/lib/organism/select-opponents/index.d.ts +2 -1
- package/lib/organism/select-opponents/index.d.ts.map +1 -1
- package/lib/organism/select-opponents/types.d.ts +2 -1
- package/lib/organism/select-opponents/types.d.ts.map +1 -1
- package/lib/organism/title-and-input/index.d.ts +4 -2
- package/lib/organism/title-and-input/index.d.ts.map +1 -1
- package/lib/organism/title-and-input/types.d.ts +4 -2
- package/lib/organism/title-and-input/types.d.ts.map +1 -1
- package/lib/organism/wizard-contents/index.d.ts +2 -1
- package/lib/template/activity/progression-item.css +0 -4
- package/lib/template/activity/progression-item.d.ts.map +1 -1
- package/lib/template/activity/progression-item.js +2 -1
- package/lib/template/activity/progression-item.js.map +1 -1
- package/lib/template/app-player/loading/index.d.ts +2 -1
- package/lib/template/app-player/player/index.d.ts +4 -2
- package/lib/template/app-player/player/slides/index.d.ts +2 -1
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +2 -1
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +2 -1
- package/lib/template/app-review/index.d.ts +2 -1
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +2 -1
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.d.ts +2 -1
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +2 -1
- package/lib/template/certification-detail/index.d.ts +105 -0
- package/lib/template/certification-detail/index.d.ts.map +1 -0
- package/lib/template/certification-detail/index.js +186 -0
- package/lib/template/certification-detail/index.js.map +1 -0
- package/lib/template/certification-detail/style.css +130 -0
- package/lib/template/common/dashboard/index.d.ts +4 -2
- package/lib/template/common/search-page/index.d.ts +2 -1
- package/lib/template/external-course/index.d.ts +2 -1
- package/lib/template/playlist-detail/index.d.ts.map +1 -1
- package/lib/template/playlist-detail/index.js +4 -2
- package/lib/template/playlist-detail/index.js.map +1 -1
- package/lib/template/playlist-detail/style.css +5 -0
- package/lib/template/skill-detail/all-courses.css +6 -6
- package/lib/template/skill-detail/continue-learning.d.ts.map +1 -1
- package/lib/template/skill-detail/continue-learning.js +3 -2
- package/lib/template/skill-detail/continue-learning.js.map +1 -1
- package/locales/bs/global.json +8 -0
- package/locales/cs/global.json +8 -0
- package/locales/de/global.json +8 -0
- package/locales/en/global.json +8 -0
- package/locales/es/global.json +8 -0
- package/locales/et/global.json +8 -0
- package/locales/fi/global.json +8 -0
- package/locales/fr/global.json +8 -0
- package/locales/hr/global.json +8 -0
- package/locales/hu/global.json +8 -0
- package/locales/hy/global.json +8 -0
- package/locales/it/global.json +8 -0
- package/locales/ja/global.json +8 -0
- package/locales/ko/global.json +8 -0
- package/locales/nl/global.json +8 -0
- package/locales/pl/global.json +8 -0
- package/locales/pt/global.json +8 -0
- package/locales/ro/global.json +8 -0
- package/locales/ru/global.json +8 -0
- package/locales/sk/global.json +8 -0
- package/locales/sl/global.json +8 -0
- package/locales/sv/global.json +8 -0
- package/locales/tl/global.json +8 -0
- package/locales/tr/global.json +8 -0
- package/locales/uk/global.json +8 -0
- package/locales/vi/global.json +8 -0
- package/locales/zh/global.json +8 -0
- package/locales/zh_TW/global.json +8 -0
- package/package.json +3 -3
|
@@ -25,8 +25,9 @@ declare namespace Dashboard {
|
|
|
25
25
|
type: PropTypes.Requireable<string>;
|
|
26
26
|
size: PropTypes.Requireable<string>;
|
|
27
27
|
customStyle: PropTypes.Requireable<{
|
|
28
|
-
[x: string]: string | null | undefined;
|
|
28
|
+
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
29
29
|
}>;
|
|
30
|
+
icon: PropTypes.Requireable<PropTypes.InferProps<any>>;
|
|
30
31
|
}>>;
|
|
31
32
|
}>>;
|
|
32
33
|
headerIcon: PropTypes.Requireable<string>;
|
|
@@ -321,8 +322,9 @@ declare namespace Dashboard {
|
|
|
321
322
|
type: PropTypes.Requireable<string>;
|
|
322
323
|
size: PropTypes.Requireable<string>;
|
|
323
324
|
customStyle: PropTypes.Requireable<{
|
|
324
|
-
[x: string]: string | null | undefined;
|
|
325
|
+
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
325
326
|
}>;
|
|
327
|
+
icon: PropTypes.Requireable<PropTypes.InferProps<any>>;
|
|
326
328
|
}>>;
|
|
327
329
|
}>>;
|
|
328
330
|
headerIcon: PropTypes.Requireable<string>;
|
|
@@ -206,8 +206,9 @@ declare namespace SearchPage {
|
|
|
206
206
|
type: PropTypes.Requireable<string>;
|
|
207
207
|
size: PropTypes.Requireable<string>;
|
|
208
208
|
customStyle: PropTypes.Requireable<{
|
|
209
|
-
[x: string]: string | null | undefined;
|
|
209
|
+
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
210
210
|
}>;
|
|
211
|
+
icon: PropTypes.Requireable<PropTypes.InferProps<any>>;
|
|
211
212
|
}>>;
|
|
212
213
|
}>>;
|
|
213
214
|
headerIcon: PropTypes.Requireable<string>;
|
|
@@ -43,8 +43,9 @@ declare namespace ExternalCourse {
|
|
|
43
43
|
type: PropTypes.Requireable<string>;
|
|
44
44
|
size: PropTypes.Requireable<string>;
|
|
45
45
|
customStyle: PropTypes.Requireable<{
|
|
46
|
-
[x: string]: string | null | undefined;
|
|
46
|
+
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
47
47
|
}>;
|
|
48
|
+
icon: PropTypes.Requireable<PropTypes.InferProps<any>>;
|
|
48
49
|
}>>;
|
|
49
50
|
}>>;
|
|
50
51
|
headerIcon: PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/playlist-detail/index.js"],"names":[],"mappings":";AAiBA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/playlist-detail/index.js"],"names":[],"mappings":";AAiBA,uEAgFC"}
|
|
@@ -74,9 +74,11 @@ const PlaylistDetail = (props, context) => {
|
|
|
74
74
|
}, /*#__PURE__*/React.createElement(ContinueLearningButton, {
|
|
75
75
|
ongoingCoursesAvailable: !!ongoingCourses.list.length,
|
|
76
76
|
onClick: onContinueLearningClick
|
|
77
|
-
})))), /*#__PURE__*/React.createElement(
|
|
77
|
+
})))), /*#__PURE__*/React.createElement("div", {
|
|
78
|
+
className: style.continueLearningSection
|
|
79
|
+
}, /*#__PURE__*/React.createElement(ContinueLearning, {
|
|
78
80
|
ongoingCourses: ongoingCourses
|
|
79
|
-
}), /*#__PURE__*/React.createElement(AllCourses, {
|
|
81
|
+
})), /*#__PURE__*/React.createElement(AllCourses, {
|
|
80
82
|
courses: playlistCourses,
|
|
81
83
|
totalCourses: totalCourses,
|
|
82
84
|
filters: filters,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","useState","PropTypes","classnames","Provider","Tag","Select","SelectOptionPropTypes","ButtonLinkIcon","Icon","CardsGrid","AllCourses","ContinueLearning","PlaylistDetailCover","ContinueLearningButton","style","DESCRIPTION_BREAKPOINT","PlaylistDetail","props","context","title","coverImages","playlistRef","description","ongoingCourses","playlistCourses","totalCourses","filters","sorting","onBackClick","onContinueLearningClick","translate","showMore","setShowMore","handleShowMore","Description","truncate","backgroundContainer","container","backButton","ctaContainer","coverWrapper","length","showMoreWrapper","faSize","wrapperSize","continueLearningButton","list","contextTypes","skin","childContextTypes","propTypes","string","isRequired","images","shape","number","onChange","func","options","arrayOf"],"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,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,QAA5B,QAA2C,OAA3C;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,GAAP,MAAgB,gBAAhB;AACA,OAAOC,MAAP,I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AHb;IAIE,OAAO,EAAEO,WAJX;IAKE,SAAS,EAAEd,KAAK,CAACwB,UALnB;IAME,gBAAgB,EAAC;EANnB,EADF,eASE;IAAK,SAAS,EAAExB,KAAK,CAACyB;EAAtB,gBACE;IAAK,SAAS,EAAEzB,KAAK,CAAC0B;EAAtB,gBACE,oBAAC,mBAAD;IAAqB,MAAM,EAAEpB;EAA7B,EADF,CADF,eAIE,8CACE,oBAAC,GAAD;IAAK,KAAK,EAAEU,SAAS,CAAC,UAAD;EAArB,EADF,eAEE;IAAK,SAAS,EAAEhB,KAAK,CAACK;EAAtB,GAA8BA,KAA9B,CAFF,EAGGG,WAAW,gBACV,uDACE,oBAAC,WAAD,OADF,EAEGA,WAAW,CAACmB,MAAZ,IAAsB1B,sBAAtB,gBACC;IAAK,SAAS,EAAED,KAAK,CAAC4B,eAAtB;IAAuC,OAAO,EAAET;EAAhD,GACGH,SAAS,CAACC,QAAQ,GAAG,WAAH,GAAiB,WAA1B,CADZ,eAEE,oBAAC,IAAD;IACE,QAAQ,EAAEA,QAAQ,GAAG,YAAH,GAAkB,cADtC;IAEE,IAAI,EAAE;MAACY,MAAM,EAAE,EAAT;MAAaC,WAAW,EAAE;IAA1B;EAFR,EAFF,CADD,GAQG,IAVN,CADU,GAaR,IAhBN,eAiBE;IAAK,SAAS,EAAE9B,KAAK,CAAC+B;EAAtB,gBACE,oBAAC,sBAAD;IACE,uBAAuB,EAAE,CAAC,CAACtB,cAAc,CAACuB,IAAf,CAAoBL,MADjD;IAEE,OAAO,EAAEZ;EAFX,EADF,CAjBF,CAJF,CATF,eAsCE,oBAAC,gBAAD;IAAkB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","useState","PropTypes","classnames","Provider","Tag","Select","SelectOptionPropTypes","ButtonLinkIcon","Icon","CardsGrid","AllCourses","ContinueLearning","PlaylistDetailCover","ContinueLearningButton","style","DESCRIPTION_BREAKPOINT","PlaylistDetail","props","context","title","coverImages","playlistRef","description","ongoingCourses","playlistCourses","totalCourses","filters","sorting","onBackClick","onContinueLearningClick","translate","showMore","setShowMore","handleShowMore","Description","truncate","backgroundContainer","container","backButton","ctaContainer","coverWrapper","length","showMoreWrapper","faSize","wrapperSize","continueLearningButton","list","continueLearningSection","contextTypes","skin","childContextTypes","propTypes","string","isRequired","images","shape","number","onChange","func","options","arrayOf"],"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 <div className={style.continueLearningSection}>\n <ContinueLearning ongoingCourses={ongoingCourses} />\n </div>\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,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,QAA5B,QAA2C,OAA3C;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,GAAP,MAAgB,gBAAhB;AACA,OAAOC,MAAP,IAAgBC,qBAAhB,QAA4C,mBAA5C;AACA,OAAOC,cAAP,MAA2B,6BAA3B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9C,QAAQ,CAAC+C,iBAAT,CAA2BD,IADL;EAE5BnB,SAAS,EAAE3B,QAAQ,CAAC+C,iBAAT,CAA2BpB;AAFV,CAA9B;AAKAd,cAAc,CAACmC,SAAf,2CAA2B;EACzBhC,KAAK,EAAElB,SAAS,CAACmD,MAAV,CAAiBC,UADC;EAEzBjC,WAAW,EAAER,mBAAmB,CAACuC,SAApB,CAA8BG,MAFlB;EAGzBjC,WAAW,EAAEpB,SAAS,CAACmD,MAAV,CAAiBC,UAHL;EAIzB/B,WAAW,EAAErB,SAAS,CAACmD,MAJE;EAKzB7B,cAAc,EAAEtB,SAAS,CAACsD,KAAV,CAAgB9C,SAAS,CAAC0C,SAA1B,CALS;EAMzB3B,eAAe,EAAEvB,SAAS,CAACsD,KAAV,CAAgB9C,SAAS,CAAC0C,SAA1B,CANQ;EAOzB1B,YAAY,EAAExB,SAAS,CAACuD,MAPC;EAQzB9B,OAAO,EAAEzB,SAAS,CAACsD,KAAV,CAAgB;IACvBE,QAAQ,EAAExD,SAAS,CAACyD,IADG;IAEvBC,OAAO,EAAE1D,SAAS,CAAC2D,OAAV,CAAkB3D,SAAS,CAACsD,KAAV,CAAgBjD,qBAAhB,CAAlB;EAFc,CAAhB,CARgB;EAYzBqB,OAAO,EAAE1B,SAAS,CAACsD,KAAV,CAAgBlD,MAAM,CAAC8C,SAAvB,CAZgB;EAazBvB,WAAW,EAAE3B,SAAS,CAACyD,IAbE;EAczB7B,uBAAuB,EAAE5B,SAAS,CAACyD;AAdV,CAA3B;AAiBA,eAAe1C,cAAf"}
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
text-decoration: underline;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
@media
|
|
112
|
+
@media tablet {
|
|
113
113
|
.searchAndSortSection {
|
|
114
114
|
flex-direction: column;
|
|
115
115
|
}
|
|
@@ -117,6 +117,10 @@
|
|
|
117
117
|
.sortSection {
|
|
118
118
|
margin-top: 16px;
|
|
119
119
|
}
|
|
120
|
+
|
|
121
|
+
.filterWrapper {
|
|
122
|
+
overflow-x: scroll;
|
|
123
|
+
}
|
|
120
124
|
}
|
|
121
125
|
|
|
122
126
|
@media mobile {
|
|
@@ -126,8 +130,4 @@
|
|
|
126
130
|
align-items: flex-start;
|
|
127
131
|
margin-top: 16px;
|
|
128
132
|
}
|
|
129
|
-
|
|
130
|
-
.filterWrapper {
|
|
131
|
-
overflow-x: scroll;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
133
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"continue-learning.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/continue-learning.js"],"names":[],"mappings":";AAQA,
|
|
1
|
+
{"version":3,"file":"continue-learning.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/continue-learning.js"],"names":[],"mappings":";AAQA,gFA0BC"}
|
|
@@ -26,9 +26,10 @@ const ContinueLearning = (props, context) => {
|
|
|
26
26
|
|
|
27
27
|
return /*#__PURE__*/React.createElement(CardsList, {
|
|
28
28
|
cards: _sortBy(course => -_getOr(0, ['progress'], course), ongoingCourses.list),
|
|
29
|
-
title: /*#__PURE__*/React.createElement(Title, null)
|
|
29
|
+
title: /*#__PURE__*/React.createElement(Title, null) // to override CardList wrapper padding
|
|
30
|
+
,
|
|
30
31
|
customStyle: {
|
|
31
|
-
padding: '
|
|
32
|
+
padding: '0px'
|
|
32
33
|
}
|
|
33
34
|
});
|
|
34
35
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"continue-learning.js","names":["React","useCallback","PropTypes","Provider","CardsGrid","CardsList","style","ContinueLearning","props","context","ongoingCourses","translate","Title","continueLearningTitle","continueLearningNumber","list","length","course","padding","contextTypes","skin","childContextTypes","propTypes","shape"],"sources":["../../../src/template/skill-detail/continue-learning.js"],"sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, sortBy} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport CardsGrid from '../../organism/cards-grid';\nimport CardsList from '../../molecule/dashboard/cards-list';\nimport style from './continue-learning.css';\n\nconst ContinueLearning = (props, context) => {\n const {ongoingCourses} = props;\n const {translate} = context;\n\n const Title = useCallback(\n () => (\n <>\n <span className={style.continueLearningTitle}>{translate('continue_learning')}</span>\n <span className={style.continueLearningNumber}>{ongoingCourses.list.length}</span>\n </>\n ),\n [ongoingCourses, translate]\n );\n\n if (ongoingCourses.list.length === 0) {\n return null;\n }\n\n return (\n <CardsList\n cards={sortBy(course => -getOr(0, ['progress'], course), ongoingCourses.list)}\n title={<Title />}\n customStyle={{padding: '
|
|
1
|
+
{"version":3,"file":"continue-learning.js","names":["React","useCallback","PropTypes","Provider","CardsGrid","CardsList","style","ContinueLearning","props","context","ongoingCourses","translate","Title","continueLearningTitle","continueLearningNumber","list","length","course","padding","contextTypes","skin","childContextTypes","propTypes","shape"],"sources":["../../../src/template/skill-detail/continue-learning.js"],"sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, sortBy} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport CardsGrid from '../../organism/cards-grid';\nimport CardsList from '../../molecule/dashboard/cards-list';\nimport style from './continue-learning.css';\n\nconst ContinueLearning = (props, context) => {\n const {ongoingCourses} = props;\n const {translate} = context;\n\n const Title = useCallback(\n () => (\n <>\n <span className={style.continueLearningTitle}>{translate('continue_learning')}</span>\n <span className={style.continueLearningNumber}>{ongoingCourses.list.length}</span>\n </>\n ),\n [ongoingCourses, translate]\n );\n\n if (ongoingCourses.list.length === 0) {\n return null;\n }\n\n return (\n <CardsList\n cards={sortBy(course => -getOr(0, ['progress'], course), ongoingCourses.list)}\n title={<Title />}\n // to override CardList wrapper padding\n customStyle={{padding: '0px'}}\n />\n );\n};\n\nContinueLearning.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nContinueLearning.propTypes = {\n ongoingCourses: PropTypes.shape(Cards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2CAA6B;EAC3BZ,cAAc,EAAER,SAAS,CAACqB,KAAV,CAAgBnB,SAAS,CAACkB,SAA1B;AADW,CAA7B;AAIA,eAAef,gBAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-link/index.tsx"],"names":[],"mappings":";AAMA,OAAkB,EAAC,eAAe,EAAW,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-link/index.tsx"],"names":[],"mappings":";AAMA,OAAkB,EAAC,eAAe,EAAW,MAAM,SAAS,CAAC;AAgD7D,QAAA,MAAM,UAAU;YAAW,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;CA8FzC,CAAC;AAIF,eAAe,UAAU,CAAC"}
|
|
@@ -54,7 +54,8 @@ const getButtonContent = (icon, content, hovered, hoverBackgroundColor, hoverCol
|
|
|
54
54
|
size: {
|
|
55
55
|
faSize: faIcon.size,
|
|
56
56
|
wrapperSize: faIcon.size
|
|
57
|
-
}
|
|
57
|
+
},
|
|
58
|
+
customStyle: faIcon.customStyle
|
|
58
59
|
}) : /*#__PURE__*/_react.default.createElement(Icon, {
|
|
59
60
|
className: _style.default.icon,
|
|
60
61
|
theme: "coorpmanager"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["getButtonContent","icon","content","hovered","hoverBackgroundColor","hoverColor","type","faIcon","position","Icon","ICONS","isApplyHover","style","buttonContent","label","iconComponent","iconName","name","iconColor","color","backgroundColor","size","faSize","wrapperSize","ButtonLink","props","usage","disabled","dataName","dataTestId","ariaLabel","link","onClick","onKeyDown","className","
|
|
1
|
+
{"version":3,"file":"index.js","names":["getButtonContent","icon","content","hovered","hoverBackgroundColor","hoverColor","type","faIcon","position","Icon","ICONS","isApplyHover","style","buttonContent","label","iconComponent","iconName","name","iconColor","color","backgroundColor","size","faSize","wrapperSize","customStyle","ButtonLink","props","usage","disabled","dataName","dataTestId","ariaLabel","link","onClick","onKeyDown","className","useTitle","styleButton","classnames","button","primary","secondary","tertiary","text","dangerous","setHovered","useState","handleOnClick","useCallback","event","handleOnKeyDown","handleMouseOver","handleMouseLeave","_customStyle","useMemo","title","propTypes"],"sources":["../../../src/atom/button-link/index.tsx"],"sourcesContent":["import React, {useCallback, useState, useMemo} from 'react';\nimport {noop} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Link from '../link';\nimport FaIcon from '../icon';\nimport {ICONS} from '../../util/button-icons';\nimport propTypes, {ButtonLinkProps, IconType} from './types';\nimport style from './style.css';\n\nconst getButtonContent = (\n icon?: IconType,\n content?: string | React.ReactNode,\n hovered?: boolean,\n hoverBackgroundColor?: string,\n hoverColor?: string\n) => {\n const {type, faIcon, position} = icon || {type: '', position: ''};\n const Icon = type && ICONS[type];\n const isApplyHover = hovered && hoverBackgroundColor && hoverColor;\n\n if (!Icon && !faIcon) {\n return (\n <div className={style.buttonContent}>\n <span className={style.label}>{content}</span>\n </div>\n );\n }\n\n const iconComponent = faIcon ? (\n <FaIcon\n {...{\n iconName: faIcon.name,\n iconColor: isApplyHover ? hoverColor : faIcon.color,\n backgroundColor: isApplyHover ? hoverBackgroundColor : faIcon.backgroundColor,\n size: {\n faSize: faIcon.size,\n wrapperSize: faIcon.size\n },\n customStyle: faIcon.customStyle\n }}\n />\n ) : (\n <Icon className={style.icon} theme=\"coorpmanager\" />\n );\n\n return (\n <div className={style.buttonContent}>\n {position === 'left' ? iconComponent : null}\n {content ? <span className={style.label}>{content}</span> : null}\n {position === 'right' ? iconComponent : null}\n </div>\n );\n};\n\nconst ButtonLink = (props: ButtonLinkProps) => {\n const {\n type,\n usage = 'button',\n label,\n content,\n hoverBackgroundColor,\n hoverColor,\n disabled = false,\n icon,\n 'data-name': dataName,\n 'data-testid': dataTestId = 'button-link',\n 'aria-label': ariaLabel,\n link,\n onClick = noop,\n onKeyDown = noop,\n className,\n customStyle,\n useTitle = true\n } = props;\n const styleButton = classnames(\n className,\n style.button,\n type === 'primary' && style.primary,\n type === 'secondary' && style.secondary,\n type === 'tertiary' && style.tertiary,\n type === 'text' && style.text,\n type === 'dangerous' && style.dangerous,\n link && style.link,\n disabled && style.disabled\n );\n\n const [hovered, setHovered] = useState(false);\n\n const handleOnClick = useCallback(event => onClick(event), [onClick]);\n\n const handleOnKeyDown = useCallback(event => onKeyDown(event), [onKeyDown]);\n\n const handleMouseOver = useCallback(() => setHovered(true), [setHovered]);\n\n const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);\n\n const _customStyle = useMemo(() => {\n return {\n ...customStyle,\n ...((hoverBackgroundColor || hoverColor) && hovered\n ? {\n backgroundColor: hoverBackgroundColor,\n color: hoverColor\n }\n : null)\n };\n }, [hoverBackgroundColor, hoverColor, hovered, customStyle]);\n\n if (link) {\n return (\n <Link\n {...link}\n {...(useTitle && {\n title: ariaLabel || label\n })}\n style={customStyle}\n className={styleButton}\n data-name={dataName}\n data-testid={dataTestId}\n aria-label={ariaLabel || label}\n >\n {getButtonContent(icon, content ?? label)}\n </Link>\n );\n }\n\n return (\n <button\n {...(useTitle && {\n title: ariaLabel || label\n })}\n // eslint-disable-next-line react/button-has-type\n type={usage}\n aria-label={ariaLabel || label}\n data-name={dataName}\n data-testid={dataTestId}\n style={_customStyle}\n className={styleButton}\n onClick={handleOnClick}\n onKeyDown={handleOnKeyDown}\n onMouseOver={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n tabIndex={0}\n disabled={disabled}\n >\n {getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor)}\n </button>\n );\n};\n\nButtonLink.propTypes = propTypes;\n\nexport default ButtonLink;\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,gBAAgB,GAAG,CACvBC,IADuB,EAEvBC,OAFuB,EAGvBC,OAHuB,EAIvBC,oBAJuB,EAKvBC,UALuB,KAMpB;EACH,MAAM;IA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sBD,CA9FD;;AAgGAoB,UAAU,CAAC+B,SAAX,2CAAuBA,cAAvB;eAEe/B,U"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/atom/button-link/types.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAC,KAAK,EAAC,MAAM,yBAAyB,CAAC;AAE9C,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;CAuBd,CAAC;AAEF,oBAAY,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/atom/button-link/types.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAC,KAAK,EAAC,MAAM,yBAAyB,CAAC;AAE9C,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;CAuBd,CAAC;AAEF,oBAAY,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACvC,CAAC;AAEF,oBAAY,QAAQ,GAAG;IACrB,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,OAAO,KAAK,CAAC;IAC1B,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB,CAAC;AACF,oBAAY,eAAe,GAAG;IAC5B,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,MAAM,GAAG,WAAW,CAAC;IACnE,KAAK,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,IAAI,CAAC,EAAE;QACL,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;KAClD,CAAC;IACF,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,oBAAY,OAAO,GAAG;IAAC,KAAK,EAAE,eAAe,CAAA;CAAC,CAAC;AAE/C,eAAe,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["propTypes","type","PropTypes","oneOf","usage","label","string","content","node","icon","shape","position","ICONS","onClick","func","link","href","download","bool","target","hoverBackgroundColor","hoverColor","disabled","className","customStyle"],"sources":["../../../src/atom/button-link/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport {keys} from 'lodash/fp';\nimport {ICONS} from '../../util/button-icons';\n\nconst propTypes = {\n type: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),\n usage: PropTypes.oneOf(['button', 'submit', 'reset']),\n label: PropTypes.string,\n content: PropTypes.node,\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string,\n 'data-testid': PropTypes.string,\n icon: PropTypes.shape({\n position: PropTypes.oneOf(['right', 'left']),\n type: PropTypes.oneOf(keys(ICONS))\n }),\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 hoverBackgroundColor: PropTypes.string,\n hoverColor: PropTypes.string,\n disabled: PropTypes.bool,\n className: PropTypes.string,\n customStyle: PropTypes.shape({})\n};\n\nexport type FaIcontype = {\n name: string;\n color?: string;\n backgroundColor?: string;\n size?: number;\n};\n\nexport type IconType = {\n position: 'right' | 'left';\n type?: keyof typeof ICONS;\n faIcon?: FaIcontype;\n};\nexport type ButtonLinkProps = {\n type?: 'primary' | 'secondary' | 'tertiary' | 'text' | 'dangerous';\n usage?: 'button' | 'submit' | 'reset';\n label?: string;\n content?: React.ReactNode;\n 'aria-label'?: string;\n 'data-name'?: string;\n 'data-testid'?: string;\n icon?: IconType;\n onClick?: () => void;\n onKeyDown?: () => void;\n link?: {\n href?: string;\n download?: boolean;\n target?: '_self' | '_blank' | '_parent' | '_top';\n };\n hoverBackgroundColor?: string;\n hoverColor?: string;\n disabled?: boolean;\n className?: string;\n customStyle?: Record<string, unknown>;\n useTitle?: boolean;\n};\n\nexport type Fixture = {props: ButtonLinkProps};\n\nexport default propTypes;\n"],"mappings":";;;;;;;AAAA;;AAEA;;;;AAEA,MAAMA,SAAS,GAAG;EAChBC,IAAI,EAAEC,kBAAA,CAAUC,KAAV,CAAgB,CAAC,SAAD,EAAY,WAAZ,EAAyB,UAAzB,EAAqC,MAArC,EAA6C,WAA7C,CAAhB,CADU;EAEhBC,KAAK,EAAEF,kBAAA,CAAUC,KAAV,CAAgB,CAAC,QAAD,EAAW,QAAX,EAAqB,OAArB,CAAhB,CAFS;EAGhBE,KAAK,EAAEH,kBAAA,CAAUI,MAHD;EAIhBC,OAAO,EAAEL,kBAAA,CAAUM,IAJH;EAKhB,cAAcN,kBAAA,CAAUI,MALR;EAMhB,aAAaJ,kBAAA,CAAUI,MANP;EAOhB,eAAeJ,kBAAA,CAAUI,MAPT;EAQhBG,IAAI,EAAEP,kBAAA,CAAUQ,KAAV,CAAgB;IACpBC,QAAQ,EAAET,kBAAA,CAAUC,KAAV,CAAgB,CAAC,OAAD,EAAU,MAAV,CAAhB,CADU;IAEpBF,IAAI,EAAEC,kBAAA,CAAUC,KAAV,CAAgB,oBAAKS,kBAAL,CAAhB;EAFc,CAAhB,CARU;EAYhBC,OAAO,EAAEX,kBAAA,CAAUY,IAZH;EAahBC,IAAI,EAAEb,kBAAA,CAAUQ,KAAV,CAAgB;IACpBM,IAAI,EAAEd,kBAAA,CAAUI,MADI;IAEpBW,QAAQ,EAAEf,kBAAA,CAAUgB,IAFA;IAGpBC,MAAM,EAAEjB,kBAAA,CAAUC,KAAV,CAAgB,CAAC,OAAD,EAAU,QAAV,EAAoB,SAApB,EAA+B,MAA/B,CAAhB;EAHY,CAAhB,CAbU;EAkBhBiB,oBAAoB,EAAElB,kBAAA,CAAUI,MAlBhB;EAmBhBe,UAAU,EAAEnB,kBAAA,CAAUI,MAnBN;EAoBhBgB,QAAQ,EAAEpB,kBAAA,CAAUgB,IApBJ;EAqBhBK,SAAS,EAAErB,kBAAA,CAAUI,MArBL;EAsBhBkB,WAAW,EAAEtB,kBAAA,CAAUQ,KAAV,CAAgB,EAAhB;AAtBG,CAAlB;
|
|
1
|
+
{"version":3,"file":"types.js","names":["propTypes","type","PropTypes","oneOf","usage","label","string","content","node","icon","shape","position","ICONS","onClick","func","link","href","download","bool","target","hoverBackgroundColor","hoverColor","disabled","className","customStyle"],"sources":["../../../src/atom/button-link/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport {keys} from 'lodash/fp';\nimport {ICONS} from '../../util/button-icons';\n\nconst propTypes = {\n type: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),\n usage: PropTypes.oneOf(['button', 'submit', 'reset']),\n label: PropTypes.string,\n content: PropTypes.node,\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string,\n 'data-testid': PropTypes.string,\n icon: PropTypes.shape({\n position: PropTypes.oneOf(['right', 'left']),\n type: PropTypes.oneOf(keys(ICONS))\n }),\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 hoverBackgroundColor: PropTypes.string,\n hoverColor: PropTypes.string,\n disabled: PropTypes.bool,\n className: PropTypes.string,\n customStyle: PropTypes.shape({})\n};\n\nexport type FaIcontype = {\n name: string;\n color?: string;\n backgroundColor?: string;\n size?: number;\n customStyle?: Record<string, unknown>;\n};\n\nexport type IconType = {\n position: 'right' | 'left';\n type?: keyof typeof ICONS;\n faIcon?: FaIcontype;\n};\nexport type ButtonLinkProps = {\n type?: 'primary' | 'secondary' | 'tertiary' | 'text' | 'dangerous';\n usage?: 'button' | 'submit' | 'reset';\n label?: string;\n content?: React.ReactNode;\n 'aria-label'?: string;\n 'data-name'?: string;\n 'data-testid'?: string;\n icon?: IconType;\n onClick?: () => void;\n onKeyDown?: () => void;\n link?: {\n href?: string;\n download?: boolean;\n target?: '_self' | '_blank' | '_parent' | '_top';\n };\n hoverBackgroundColor?: string;\n hoverColor?: string;\n disabled?: boolean;\n className?: string;\n customStyle?: Record<string, unknown>;\n useTitle?: boolean;\n};\n\nexport type Fixture = {props: ButtonLinkProps};\n\nexport default propTypes;\n"],"mappings":";;;;;;;AAAA;;AAEA;;;;AAEA,MAAMA,SAAS,GAAG;EAChBC,IAAI,EAAEC,kBAAA,CAAUC,KAAV,CAAgB,CAAC,SAAD,EAAY,WAAZ,EAAyB,UAAzB,EAAqC,MAArC,EAA6C,WAA7C,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,8DAC8D;;AAGrE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/icon/index.js"],"names":[],"mappings":"AAiBA,mDAAoD;AAiB7C,8DAC8D;;AAGrE,uDAmCG"}
|
package/lib/atom/icon/index.js
CHANGED
|
@@ -29,6 +29,8 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
29
29
|
|
|
30
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
31
|
|
|
32
|
+
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); }
|
|
33
|
+
|
|
32
34
|
_fontawesomeSvgCore.library.add(_proSolidSvgIcons.fas);
|
|
33
35
|
|
|
34
36
|
const DEFAULT_PRESET = 'm';
|
|
@@ -63,7 +65,8 @@ const Icon = /*#__PURE__*/_react.default.memo(function Icon({
|
|
|
63
65
|
backgroundColor,
|
|
64
66
|
borderRadius,
|
|
65
67
|
preset = DEFAULT_PRESET,
|
|
66
|
-
size
|
|
68
|
+
size,
|
|
69
|
+
customStyle
|
|
67
70
|
}) {
|
|
68
71
|
const effectiveIconColor = iconColor || (backgroundColor ? getForegroundColor(backgroundColor) : DEFAULT_ICON_COLOR);
|
|
69
72
|
const effectiveSize = size ? (0, _merge.default)(SIZE_CONFIGS[DEFAULT_PRESET], size) : (0, _getOr.default)(SIZE_CONFIGS[DEFAULT_PRESET], (0, _toLower.default)(preset), SIZE_CONFIGS);
|
|
@@ -77,7 +80,7 @@ const Icon = /*#__PURE__*/_react.default.memo(function Icon({
|
|
|
77
80
|
};
|
|
78
81
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
79
82
|
className: _style.default.iconWrapper,
|
|
80
|
-
style: iconWrapperStyle
|
|
83
|
+
style: _extends({}, iconWrapperStyle, customStyle)
|
|
81
84
|
}, /*#__PURE__*/_react.default.createElement(_reactFontawesome.FontAwesomeIcon, {
|
|
82
85
|
icon: `fa-${iconName}`,
|
|
83
86
|
color: effectiveIconColor,
|
|
@@ -94,7 +97,8 @@ Icon.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
94
97
|
size: _propTypes.default.shape({
|
|
95
98
|
faSize: _propTypes.number,
|
|
96
99
|
wrapperSize: _propTypes.default.number
|
|
97
|
-
})
|
|
100
|
+
}),
|
|
101
|
+
customStyle: _propTypes.default.objectOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]))
|
|
98
102
|
} : {};
|
|
99
103
|
var _default = Icon;
|
|
100
104
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["library","add","fas","DEFAULT_PRESET","ICON_LUMINOSITY","DEFAULT_WRAPPER_SIZE","ICON_PADDING","DEFAULT_ICON_COLOR","SIZE_CONFIGS","s","faSize","wrapperSize","m","xl","getForegroundColor","backgroundColor","convert","Icon","React","memo","iconName","iconColor","borderRadius","preset","size","effectiveIconColor","effectiveSize","merge","getOr","toLower","iconWrapperStyle","width","height","padding","style","iconWrapper","propTypes","PropTypes","string","isRequired","oneOf","shape","number"],"sources":["../../../src/atom/icon/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes, {number} from 'prop-types';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {fas} from '@fortawesome/pro-solid-svg-icons';\nimport {library} from '@fortawesome/fontawesome-svg-core';\nimport toLower from 'lodash/fp/toLower';\nimport merge from 'lodash/fp/merge';\nimport getOr from 'lodash/fp/getOr';\nimport {convert} from 'css-color-function';\nimport style from './style.css';\n\nlibrary.add(fas);\n\nconst DEFAULT_PRESET = 'm';\nconst ICON_LUMINOSITY = 32;\nconst DEFAULT_WRAPPER_SIZE = 40;\nconst ICON_PADDING = 8;\nexport const DEFAULT_ICON_COLOR = 'hsl(0, 0%, 32%)';\n\nconst SIZE_CONFIGS = {\n s: {\n faSize: 12,\n wrapperSize: 32\n },\n m: {\n faSize: 16,\n wrapperSize: DEFAULT_WRAPPER_SIZE\n },\n xl: {\n faSize: 20,\n wrapperSize: 48\n }\n};\n\nexport const getForegroundColor = backgroundColor =>\n convert(`color(${backgroundColor} lightness(${ICON_LUMINOSITY}%))`);\n// set lightness to 32%\n\nconst Icon = React.memo(function Icon({\n iconName,\n iconColor,\n backgroundColor,\n borderRadius,\n preset = DEFAULT_PRESET,\n size\n}) {\n const effectiveIconColor =\n iconColor || (backgroundColor ? getForegroundColor(backgroundColor) : DEFAULT_ICON_COLOR);\n\n const effectiveSize = size\n ? merge(SIZE_CONFIGS[DEFAULT_PRESET], size)\n : getOr(SIZE_CONFIGS[DEFAULT_PRESET], toLower(preset), SIZE_CONFIGS);\n\n const wrapperSize = effectiveSize.wrapperSize - ICON_PADDING * 2;\n\n const iconWrapperStyle = {\n backgroundColor,\n borderRadius,\n width: wrapperSize,\n height: wrapperSize,\n padding: ICON_PADDING\n };\n\n return (\n <div className={style.iconWrapper} style={iconWrapperStyle}>\n <FontAwesomeIcon\n icon={`fa-${iconName}`}\n color={effectiveIconColor}\n fontSize={effectiveSize.faSize}\n />\n </div>\n );\n});\n\nIcon.propTypes = {\n iconName: PropTypes.string.isRequired,\n iconColor: PropTypes.string,\n backgroundColor: PropTypes.string,\n borderRadius: PropTypes.string,\n preset: PropTypes.oneOf(['s', 'm', 'xl']),\n size: PropTypes.shape({\n faSize: number,\n wrapperSize: PropTypes.number\n })\n};\n\nexport default Icon;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA
|
|
1
|
+
{"version":3,"file":"index.js","names":["library","add","fas","DEFAULT_PRESET","ICON_LUMINOSITY","DEFAULT_WRAPPER_SIZE","ICON_PADDING","DEFAULT_ICON_COLOR","SIZE_CONFIGS","s","faSize","wrapperSize","m","xl","getForegroundColor","backgroundColor","convert","Icon","React","memo","iconName","iconColor","borderRadius","preset","size","customStyle","effectiveIconColor","effectiveSize","merge","getOr","toLower","iconWrapperStyle","width","height","padding","style","iconWrapper","propTypes","PropTypes","string","isRequired","oneOf","shape","number","objectOf","oneOfType"],"sources":["../../../src/atom/icon/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes, {number} from 'prop-types';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {fas} from '@fortawesome/pro-solid-svg-icons';\nimport {library} from '@fortawesome/fontawesome-svg-core';\nimport toLower from 'lodash/fp/toLower';\nimport merge from 'lodash/fp/merge';\nimport getOr from 'lodash/fp/getOr';\nimport {convert} from 'css-color-function';\nimport style from './style.css';\n\nlibrary.add(fas);\n\nconst DEFAULT_PRESET = 'm';\nconst ICON_LUMINOSITY = 32;\nconst DEFAULT_WRAPPER_SIZE = 40;\nconst ICON_PADDING = 8;\nexport const DEFAULT_ICON_COLOR = 'hsl(0, 0%, 32%)';\n\nconst SIZE_CONFIGS = {\n s: {\n faSize: 12,\n wrapperSize: 32\n },\n m: {\n faSize: 16,\n wrapperSize: DEFAULT_WRAPPER_SIZE\n },\n xl: {\n faSize: 20,\n wrapperSize: 48\n }\n};\n\nexport const getForegroundColor = backgroundColor =>\n convert(`color(${backgroundColor} lightness(${ICON_LUMINOSITY}%))`);\n// set lightness to 32%\n\nconst Icon = React.memo(function Icon({\n iconName,\n iconColor,\n backgroundColor,\n borderRadius,\n preset = DEFAULT_PRESET,\n size,\n customStyle\n}) {\n const effectiveIconColor =\n iconColor || (backgroundColor ? getForegroundColor(backgroundColor) : DEFAULT_ICON_COLOR);\n\n const effectiveSize = size\n ? merge(SIZE_CONFIGS[DEFAULT_PRESET], size)\n : getOr(SIZE_CONFIGS[DEFAULT_PRESET], toLower(preset), SIZE_CONFIGS);\n\n const wrapperSize = effectiveSize.wrapperSize - ICON_PADDING * 2;\n\n const iconWrapperStyle = {\n backgroundColor,\n borderRadius,\n width: wrapperSize,\n height: wrapperSize,\n padding: ICON_PADDING\n };\n\n return (\n <div className={style.iconWrapper} style={{...iconWrapperStyle, ...customStyle}}>\n <FontAwesomeIcon\n icon={`fa-${iconName}`}\n color={effectiveIconColor}\n fontSize={effectiveSize.faSize}\n />\n </div>\n );\n});\n\nIcon.propTypes = {\n iconName: PropTypes.string.isRequired,\n iconColor: PropTypes.string,\n backgroundColor: PropTypes.string,\n borderRadius: PropTypes.string,\n preset: PropTypes.oneOf(['s', 'm', 'xl']),\n size: PropTypes.shape({\n faSize: number,\n wrapperSize: PropTypes.number\n }),\n customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))\n};\n\nexport default Icon;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEAA,2BAAA,CAAQC,GAAR,CAAYC,qBAAZ;;AAEA,MAAMC,cAAc,GAAG,GAAvB;AACA,MAAMC,eAAe,GAAG,EAAxB;AACA,MAAMC,oBAAoB,GAAG,EAA7B;AACA,MAAMC,YAAY,GAAG,CAArB;AACO,MAAMC,kBAAkB,GAAG,iBAA3B;;AAEP,MAAMC,YAAY,GAAG;EACnBC,CAAC,EAAE;IACDC,MAAM,EAAE,EADP;IAEDC,WAAW,EAAE;EAFZ,CADgB;EAKnBC,CAAC,EAAE;IACDF,MAAM,EAAE,EADP;IAEDC,WAAW,EAAEN;EAFZ,CALgB;EASnBQ,EAAE,EAAE;IACFH,MAAM,EAAE,EADN;IAEFC,WAAW,EAAE;EAFX;AATe,CAArB;;AAeO,MAAMG,kBAAkB,GAAGC,eAAe,IAC/C,IAAAC,yBAAA,EAAS,SAAQD,eAAgB,cAAaX,eAAgB,KAA9D,CADK,C,CAEP;;;;;AAEA,MAAMa,IAAI,gBAAGC,cAAA,CAAMC,IAAN,CAAW,SAASF,IAAT,CAAc;EACpCG,QADoC;EAEpCC,SAFoC;EAGpCN,eAHoC;EAIpCO,YAJoC;EAK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A,CAAUI,KAAV,CAAgB;IACpBhC,MAAM,EAAEiC,iBADY;IAEpBhC,WAAW,EAAE2B,kBAAA,CAAUK;EAFH,CAAhB,CANS;EAUflB,WAAW,EAAEa,kBAAA,CAAUM,QAAV,CAAmBN,kBAAA,CAAUO,SAAV,CAAoB,CAACP,kBAAA,CAAUC,MAAX,EAAmBD,kBAAA,CAAUK,MAA7B,CAApB,CAAnB;AAVE,CAAjB;eAae1B,I"}
|
|
@@ -16,8 +16,9 @@ declare const RadioWithTitle: {
|
|
|
16
16
|
type: import("prop-types").Requireable<string>;
|
|
17
17
|
size: import("prop-types").Requireable<string>;
|
|
18
18
|
customStyle: import("prop-types").Requireable<{
|
|
19
|
-
[x: string]: string | null | undefined;
|
|
19
|
+
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
20
20
|
}>;
|
|
21
|
+
icon: import("prop-types").Requireable<import("prop-types").InferProps<any>>;
|
|
21
22
|
}>>;
|
|
22
23
|
}>>>;
|
|
23
24
|
name: import("prop-types").Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/radio-with-title/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAY,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAEvD,QAAA,MAAM,cAAc;YAAW,mBAAmB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/radio-with-title/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAY,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAEvD,QAAA,MAAM,cAAc;YAAW,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;CAwBjD,CAAC;AAIF,eAAe,cAAc,CAAC"}
|
|
@@ -13,8 +13,9 @@ export declare const propTypes: {
|
|
|
13
13
|
type: PropTypes.Requireable<string>;
|
|
14
14
|
size: PropTypes.Requireable<string>;
|
|
15
15
|
customStyle: PropTypes.Requireable<{
|
|
16
|
-
[x: string]: string | null | undefined;
|
|
16
|
+
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
17
17
|
}>;
|
|
18
|
+
icon: PropTypes.Requireable<PropTypes.InferProps<any>>;
|
|
18
19
|
}>>;
|
|
19
20
|
}>>>;
|
|
20
21
|
name: PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/atom/radio-with-title/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAGnC,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/atom/radio-with-title/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAGnC,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;CAOrB,CAAC;AAEF,oBAAY,mBAAmB,GAAG;IAChC,KAAK,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
package/lib/atom/tag/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export default Tag;
|
|
2
|
-
declare function Tag({ label, type, size, customStyle }: {
|
|
2
|
+
declare function Tag({ label, type, size, customStyle, icon }: {
|
|
3
3
|
label: any;
|
|
4
4
|
type?: string | undefined;
|
|
5
5
|
size?: string | undefined;
|
|
6
6
|
customStyle?: {} | undefined;
|
|
7
|
+
icon?: {} | undefined;
|
|
7
8
|
}): JSX.Element;
|
|
8
9
|
declare namespace Tag {
|
|
9
10
|
namespace propTypes {
|
|
@@ -11,8 +12,9 @@ declare namespace Tag {
|
|
|
11
12
|
const type: PropTypes.Requireable<string>;
|
|
12
13
|
const size: PropTypes.Requireable<string>;
|
|
13
14
|
const customStyle: PropTypes.Requireable<{
|
|
14
|
-
[x: string]: string | null | undefined;
|
|
15
|
+
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
15
16
|
}>;
|
|
17
|
+
const icon: PropTypes.Requireable<PropTypes.InferProps<any>>;
|
|
16
18
|
}
|
|
17
19
|
}
|
|
18
20
|
import PropTypes from "prop-types";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/tag/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/tag/index.js"],"names":[],"mappings":";AAqBA;;;;;;gBAgBC"}
|
package/lib/atom/tag/index.js
CHANGED
|
@@ -11,10 +11,18 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
11
11
|
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
|
|
14
|
+
var _icon = _interopRequireDefault(require("../icon"));
|
|
15
|
+
|
|
14
16
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
15
17
|
|
|
18
|
+
const _excluded = ["position"];
|
|
19
|
+
|
|
16
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
21
|
|
|
22
|
+
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); }
|
|
23
|
+
|
|
24
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
25
|
+
|
|
18
26
|
const TAG_STYLES = {
|
|
19
27
|
default: _style.default.default,
|
|
20
28
|
success: _style.default.success,
|
|
@@ -32,18 +40,31 @@ const Tag = ({
|
|
|
32
40
|
label,
|
|
33
41
|
type = 'default',
|
|
34
42
|
size = 'M',
|
|
35
|
-
customStyle = {}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
},
|
|
43
|
+
customStyle = {},
|
|
44
|
+
icon = {}
|
|
45
|
+
}) => {
|
|
46
|
+
const {
|
|
47
|
+
position
|
|
48
|
+
} = icon,
|
|
49
|
+
iconProps = _objectWithoutPropertiesLoose(icon, _excluded);
|
|
50
|
+
|
|
51
|
+
return /*#__PURE__*/_react.default.createElement("span", {
|
|
52
|
+
className: (0, _classnames.default)(TAG_STYLES[type], TAG_SIZE[size]),
|
|
53
|
+
"data-name": `content-tag-${label}`,
|
|
54
|
+
style: customStyle
|
|
55
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
56
|
+
className: _style.default.content
|
|
57
|
+
}, position === 'left' ? /*#__PURE__*/_react.default.createElement(_icon.default, iconProps) : null, /*#__PURE__*/_react.default.createElement("div", null, label), position === 'right' ? /*#__PURE__*/_react.default.createElement(_icon.default, iconProps) : null));
|
|
58
|
+
};
|
|
41
59
|
|
|
42
60
|
Tag.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
43
61
|
label: _propTypes.default.string,
|
|
44
62
|
type: _propTypes.default.oneOf((0, _keys2.default)(TAG_STYLES)),
|
|
45
63
|
size: _propTypes.default.oneOf(['S', 'M', 'L']),
|
|
46
|
-
customStyle: _propTypes.default.objectOf(_propTypes.default.string)
|
|
64
|
+
customStyle: _propTypes.default.objectOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number])),
|
|
65
|
+
icon: _propTypes.default.shape(_extends({}, _icon.default.propTypes, {
|
|
66
|
+
position: _propTypes.default.oneOf(['left', 'right'])
|
|
67
|
+
}))
|
|
47
68
|
} : {};
|
|
48
69
|
var _default = Tag;
|
|
49
70
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["TAG_STYLES","default","style","success","failure","warning","progress","TAG_SIZE","S","small","M","medium","L","large","Tag","label","type","size","customStyle","classnames","propTypes","PropTypes","string","oneOf","objectOf"],"sources":["../../../src/atom/tag/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {keys} from 'lodash/fp';\nimport style from './style.css';\n\nconst TAG_STYLES = {\n default: style.default,\n success: style.success,\n failure: style.failure,\n warning: style.warning,\n progress: style.progress\n};\n\nconst TAG_SIZE = {\n S: style.small,\n M: style.medium,\n L: style.large\n};\n\nconst Tag = ({label, type = 'default', size = 'M', customStyle = {}}) => (\n
|
|
1
|
+
{"version":3,"file":"index.js","names":["TAG_STYLES","default","style","success","failure","warning","progress","TAG_SIZE","S","small","M","medium","L","large","Tag","label","type","size","customStyle","icon","position","iconProps","classnames","content","propTypes","PropTypes","string","oneOf","objectOf","oneOfType","number","shape","Icon"],"sources":["../../../src/atom/tag/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {keys} from 'lodash/fp';\nimport Icon from '../icon';\nimport style from './style.css';\n\nconst TAG_STYLES = {\n default: style.default,\n success: style.success,\n failure: style.failure,\n warning: style.warning,\n progress: style.progress\n};\n\nconst TAG_SIZE = {\n S: style.small,\n M: style.medium,\n L: style.large\n};\n\nconst Tag = ({label, type = 'default', size = 'M', customStyle = {}, icon = {}}) => {\n const {position, ...iconProps} = icon;\n\n return (\n <span\n className={classnames(TAG_STYLES[type], TAG_SIZE[size])}\n data-name={`content-tag-${label}`}\n style={customStyle}\n >\n <div className={style.content}>\n {position === 'left' ? <Icon {...iconProps} /> : null}\n <div>{label}</div>\n {position === 'right' ? <Icon {...iconProps} /> : null}\n </div>\n </span>\n );\n};\n\nTag.propTypes = {\n label: PropTypes.string,\n type: PropTypes.oneOf(keys(TAG_STYLES)),\n size: PropTypes.oneOf(['S', 'M', 'L']),\n customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),\n icon: PropTypes.shape({...Icon.propTypes, position: PropTypes.oneOf(['left', 'right'])})\n};\n\nexport default Tag;\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;;;;;;;;;AAEA,MAAMA,UAAU,GAAG;EACjBC,OAAO,EAAEC,cAAA,CAAMD,OADE;EAEjBE,OAAO,EAAED,cAAA,CAAMC,OAFE;EAGjBC,OAAO,EAAEF,cAAA,CAAME,OAHE;EAIjBC,OAAO,EAAEH,cAAA,CAAMG,OAJE;EAKjBC,QAAQ,EAAEJ,cAAA,CAAMI;AALC,CAAnB;AAQA,MAAMC,QAAQ,GAAG;EACfC,CAAC,EAAEN,cAAA,CAAMO,KADM;EAEfC,CAAC,EAAER,cAAA,CAAMS,MAFM;EAGfC,CAAC,EAAEV,cAAA,CAAMW;AAHM,CAAjB;;AAMA,MAAMC,GAAG,GAAG,CAAC;EAACC,KAAD;EAAQC,IAAI,GAAG,SAAf;EAA0BC,IAAI,GAAG,GAAjC;EAAsCC,WAAW,GAAG,EAApD;EAAwDC,IAAI,GAAG;AAA/D,CAAD,KAAwE;EAClF,MAAM;IAACC;EAAD,IAA2BD,IAAjC;EAAA,MAAoBE,SAApB,iCAAiCF,IAAjC;;EAEA,oBACE;IACE,SAAS,EAAE,IAAAG,mBAAA,EAAWtB,UAAU,CAACgB,IAAD,CAArB,EAA6BT,QAAQ,CAACU,IAAD,CAArC,CADb;IAEE,aAAY,eAAcF,KAAM,EAFlC;IAGE,KAAK,EAAEG;EAHT,gBAKE;IAAK,SAAS,EAAEhB,cAAA,CAAMqB;EAAtB,GACGH,QAAQ,KAAK,MAAb,gBAAsB,6BAAC,aAAD,EAAUC,SAAV,CAAtB,GAAgD,IADnD,eAEE,0CAAMN,KAAN,CAFF,EAGGK,QAAQ,KAAK,OAAb,gBAAuB,6BAAC,aAAD,EAAUC,SAAV,CAAvB,GAAiD,IAHpD,CALF,CADF;AAaD,CAhBD;;AAkBAP,GAAG,CAACU,SAAJ,2CAAgB;EACdT,KAAK,EAAEU,kBAAA,CAAUC,MADH;EAEdV,IAAI,EAAES,kBAAA,CAAUE,KAAV,CAAgB,oBAAK3B,UAAL,CAAhB,CAFQ;EAGdiB,IAAI,EAAEQ,kBAAA,CAAUE,KAAV,CAAgB,CAAC,GAAD,EAAM,GAAN,EAAW,GAAX,CAAhB,CAHQ;EAIdT,WAAW,EAAEO,kBAAA,CAAUG,QAAV,CAAmBH,kBAAA,CAAUI,SAAV,CAAoB,CAACJ,kBAAA,CAAUC,MAAX,EAAmBD,kBAAA,CAAUK,MAA7B,CAApB,CAAnB,CAJC;EAKdX,IAAI,EAAEM,kBAAA,CAAUM,KAAV,cAAoBC,aAAA,CAAKR,SAAzB;IAAoCJ,QAAQ,EAAEK,kBAAA,CAAUE,KAAV,CAAgB,CAAC,MAAD,EAAS,OAAT,CAAhB;EAA9C;AALQ,CAAhB;eAQeb,G"}
|
package/lib/atom/tag/style.css
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
font-weight: 600;
|
|
15
15
|
text-align: center;
|
|
16
16
|
line-height: normal;
|
|
17
|
+
display: inline-block;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
.small {
|
|
@@ -63,3 +64,9 @@
|
|
|
63
64
|
background-color: color(cm_orange_700 a(15%));
|
|
64
65
|
color: cm_orange_700;
|
|
65
66
|
}
|
|
67
|
+
|
|
68
|
+
.content {
|
|
69
|
+
display: flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
gap: 4px;
|
|
72
|
+
}
|
|
@@ -14,8 +14,9 @@ declare namespace Title {
|
|
|
14
14
|
type: PropTypes.Requireable<string>;
|
|
15
15
|
size: PropTypes.Requireable<string>;
|
|
16
16
|
customStyle: PropTypes.Requireable<{
|
|
17
|
-
[x: string]: string | null | undefined;
|
|
17
|
+
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
18
18
|
}>;
|
|
19
|
+
icon: PropTypes.Requireable<PropTypes.InferProps<any>>;
|
|
19
20
|
}>>;
|
|
20
21
|
};
|
|
21
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/bulk-progress-bar/index.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAC,KAAK,EAAoB,MAAM,SAAS,CAAC;AA8BjD,QAAA,MAAM,eAAe;YAAW,KAAK;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/bulk-progress-bar/index.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAC,KAAK,EAAoB,MAAM,SAAS,CAAC;AA8BjD,QAAA,MAAM,eAAe;YAAW,KAAK;;;;;;CAgBpC,CAAC;AAIF,eAAe,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["negative","cm_negative_100","cm_primary_blue","positive","cm_positive_100","COLORS","STATUS","inProgress","fail","renderStatusIcon","status","progress","style","progressText","statusItemWrapper","resolveProgressBarColor","BulkProgressBar","props","dataName","container","progressBar","backgroundColor","borderRadius","propTypes"],"sources":["../../../src/molecule/bulk-progress-bar/index.tsx"],"sourcesContent":["import React from 'react';\nimport ProgressBar from '../progress-bar';\nimport StatusItem from '../../atom/status-item';\nimport {COLORS} from '../../variables/colors';\nimport style from './style.css';\nimport {Props, propTypes, Status} from './types';\n\nconst {negative: cm_negative_100, cm_primary_blue, positive: cm_positive_100} = COLORS;\n\nconst STATUS = {\n inProgress: 'inProgress',\n fail: 'fail'\n};\n\nconst renderStatusIcon = (status: Status, progress: number) => {\n if (status === STATUS.inProgress)\n return <div role=\"status\" className={style.progressText}>{`${progress} %`}</div>;\n return (\n <div className={style.statusItemWrapper}>\n <StatusItem icon={status === STATUS.fail ? 'invalid' : 'valid'} />\n </div>\n );\n};\n\nconst resolveProgressBarColor = (status: Status) => {\n switch (status) {\n case STATUS.fail:\n return cm_negative_100;\n case STATUS.inProgress:\n return cm_primary_blue;\n default:\n return cm_positive_100;\n }\n};\n\nconst BulkProgressBar = (props: Props) => {\n const {'data-name': dataName, status, progress} = props;\n\n return (\n <div className={style.container} data-name={dataName}>\n <ProgressBar\n className={style.progressBar}\n value={progress}\n max={100}\n steps={0}\n style={{backgroundColor: resolveProgressBarColor(status), borderRadius: '10px'}}\n />\n {renderStatusIcon(status, progress)}\n </div>\n );\n};\n\nBulkProgressBar.propTypes = propTypes;\n\nexport default BulkProgressBar;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAM;EAACA,QAAQ,EAAEC,eAAX;EAA4BC,eAA5B;EAA6CC,QAAQ,EAAEC;AAAvD,IAA0EC,cAAhF;AAEA,MAAMC,MAAM,GAAG;EACbC,UAAU,EAAE,YADC;EAEbC,IAAI,EAAE;AAFO,CAAf;;AAKA,MAAMC,gBAAgB,GAAG,CAACC,MAAD,EAAiBC,QAAjB,KAAsC;EAC7D,IAAID,MAAM,KAAKJ,MAAM,CAACC,UAAtB,EACE,oBAAO;IAAK,IAAI,EAAC,QAAV;IAAmB,SAAS,EAAEK,cAAA,CAAMC;EAApC,GAAoD,GAAEF,QAAS,IAA/D,CAAP;EACF,oBACE;IAAK,SAAS,EAAEC,cAAA,CAAME;EAAtB,gBACE,6BAAC,mBAAD;IAAY,IAAI,EAAEJ,MAAM,KAAKJ,MAAM,CAACE,IAAlB,GAAyB,SAAzB,GAAqC;EAAvD,EADF,CADF;AAKD,CARD;;AAUA,MAAMO,uBAAuB,GAAIL,MAAD,IAAoB;EAClD,QAAQA,MAAR;IACE,KAAKJ,MAAM,CAACE,IAAZ;MACE,OAAOP,eAAP;;IACF,KAAKK,MAAM,CAACC,UAAZ;MACE,OAAOL,eAAP;;IACF;MACE,OAAOE,eAAP;EANJ;AAQD,CATD;;AAWA,MAAMY,eAAe,GAAIC,KAAD,IAAkB;EACxC,MAAM;IAAC,aAAaC,QAAd;IAAwBR,MAAxB;IAAgCC;EAAhC,IAA4CM,KAAlD;EAEA,oBACE;IAAK,SAAS,EAAEL,cAAA,CAAMO,SAAtB;IAAiC,aAAWD;EAA5C,gBACE,6BAAC,oBAAD;IACE,SAAS,EAAEN,cAAA,CAAMQ,WADnB;IAEE,KAAK,EAAET,QAFT;IAGE,GAAG,EAAE,GAHP;IAIE,KAAK,EAAE,CAJT;IAKE,KAAK,EAAE;MAACU,eAAe,EAAEN,uBAAuB,CAACL,MAAD,CAAzC;MAAmDY,YAAY,EAAE;IAAjE;
|
|
1
|
+
{"version":3,"file":"index.js","names":["negative","cm_negative_100","cm_primary_blue","positive","cm_positive_100","COLORS","STATUS","inProgress","fail","renderStatusIcon","status","progress","style","progressText","statusItemWrapper","resolveProgressBarColor","BulkProgressBar","props","dataName","container","progressBar","backgroundColor","borderRadius","propTypes"],"sources":["../../../src/molecule/bulk-progress-bar/index.tsx"],"sourcesContent":["import React from 'react';\nimport ProgressBar from '../progress-bar';\nimport StatusItem from '../../atom/status-item';\nimport {COLORS} from '../../variables/colors';\nimport style from './style.css';\nimport {Props, propTypes, Status} from './types';\n\nconst {negative: cm_negative_100, cm_primary_blue, positive: cm_positive_100} = COLORS;\n\nconst STATUS = {\n inProgress: 'inProgress',\n fail: 'fail'\n};\n\nconst renderStatusIcon = (status: Status, progress: number) => {\n if (status === STATUS.inProgress)\n return <div role=\"status\" className={style.progressText}>{`${progress} %`}</div>;\n return (\n <div className={style.statusItemWrapper}>\n <StatusItem icon={status === STATUS.fail ? 'invalid' : 'valid'} />\n </div>\n );\n};\n\nconst resolveProgressBarColor = (status: Status) => {\n switch (status) {\n case STATUS.fail:\n return cm_negative_100;\n case STATUS.inProgress:\n return cm_primary_blue;\n default:\n return cm_positive_100;\n }\n};\n\nconst BulkProgressBar = (props: Props) => {\n const {'data-name': dataName, status, progress} = props;\n\n return (\n <div className={style.container} data-name={dataName}>\n <ProgressBar\n className={style.progressBar}\n value={progress}\n max={100}\n steps={0}\n style={{backgroundColor: resolveProgressBarColor(status), borderRadius: '10px'}}\n displayInfo={false}\n />\n {renderStatusIcon(status, progress)}\n </div>\n );\n};\n\nBulkProgressBar.propTypes = propTypes;\n\nexport default BulkProgressBar;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAM;EAACA,QAAQ,EAAEC,eAAX;EAA4BC,eAA5B;EAA6CC,QAAQ,EAAEC;AAAvD,IAA0EC,cAAhF;AAEA,MAAMC,MAAM,GAAG;EACbC,UAAU,EAAE,YADC;EAEbC,IAAI,EAAE;AAFO,CAAf;;AAKA,MAAMC,gBAAgB,GAAG,CAACC,MAAD,EAAiBC,QAAjB,KAAsC;EAC7D,IAAID,MAAM,KAAKJ,MAAM,CAACC,UAAtB,EACE,oBAAO;IAAK,IAAI,EAAC,QAAV;IAAmB,SAAS,EAAEK,cAAA,CAAMC;EAApC,GAAoD,GAAEF,QAAS,IAA/D,CAAP;EACF,oBACE;IAAK,SAAS,EAAEC,cAAA,CAAME;EAAtB,gBACE,6BAAC,mBAAD;IAAY,IAAI,EAAEJ,MAAM,KAAKJ,MAAM,CAACE,IAAlB,GAAyB,SAAzB,GAAqC;EAAvD,EADF,CADF;AAKD,CARD;;AAUA,MAAMO,uBAAuB,GAAIL,MAAD,IAAoB;EAClD,QAAQA,MAAR;IACE,KAAKJ,MAAM,CAACE,IAAZ;MACE,OAAOP,eAAP;;IACF,KAAKK,MAAM,CAACC,UAAZ;MACE,OAAOL,eAAP;;IACF;MACE,OAAOE,eAAP;EANJ;AAQD,CATD;;AAWA,MAAMY,eAAe,GAAIC,KAAD,IAAkB;EACx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