@coorpacademy/components 11.35.3-forcedeploy8.5 → 11.36.1
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.js +2 -2
- package/es/atom/button-link/index.js.map +1 -1
- package/es/atom/button-menu/index.d.ts +1 -1
- package/es/atom/button-menu/style.css +1 -1
- package/es/atom/button-menu/types.d.ts +2 -2
- package/es/atom/button-menu/types.js +1 -1
- package/es/atom/button-menu/types.js.map +1 -1
- package/es/atom/tag/style.css +1 -0
- package/es/molecule/brand-tabs/index.d.ts.map +1 -1
- package/es/molecule/brand-tabs/index.js +13 -6
- package/es/molecule/brand-tabs/index.js.map +1 -1
- package/es/molecule/brand-tabs/style.css +4 -5
- package/es/molecule/bullet-point-menu-button/index.d.ts +1 -1
- package/es/molecule/bullet-point-menu-button/types.d.ts +1 -1
- package/es/molecule/button-menu-action/index.d.ts +3 -1
- package/es/molecule/button-menu-action/index.d.ts.map +1 -1
- package/es/molecule/button-menu-action/index.js +34 -6
- package/es/molecule/button-menu-action/index.js.map +1 -1
- package/es/molecule/button-menu-action/style.css +36 -0
- package/es/molecule/button-menu-action/types.d.ts +6 -1
- package/es/molecule/button-menu-action/types.d.ts.map +1 -1
- package/es/molecule/button-menu-action/types.js +3 -1
- package/es/molecule/button-menu-action/types.js.map +1 -1
- package/es/molecule/cm-popin/types.d.ts +8 -4
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/dashboard/cards-list/index.d.ts.map +1 -1
- package/es/molecule/dashboard/cards-list/index.js +0 -2
- package/es/molecule/dashboard/cards-list/index.js.map +1 -1
- package/es/molecule/dashboard/cards-list/style.css +1 -0
- package/es/molecule/expandible-actionable-table/index.d.ts +2 -2
- package/es/molecule/expandible-actionable-table/types.d.ts +2 -2
- package/es/molecule/icon-preview/index.d.ts.map +1 -1
- package/es/molecule/icon-preview/index.js +2 -1
- package/es/molecule/icon-preview/index.js.map +1 -1
- package/es/organism/content-skill-modal/index.d.ts +8 -4
- package/es/organism/content-skill-modal/index.d.ts.map +1 -1
- package/es/organism/content-skill-modal/types.d.ts +8 -4
- package/es/organism/content-skill-modal/types.d.ts.map +1 -1
- package/es/organism/header-with-actions/index.d.ts +1 -1
- package/es/organism/header-with-actions/types.d.ts +1 -1
- package/es/organism/list-items/index.d.ts +8 -4
- package/es/organism/mooc-header/index.d.ts +1 -3
- package/es/organism/mooc-header/index.d.ts.map +1 -1
- package/es/organism/mooc-header/index.js +38 -39
- package/es/organism/mooc-header/index.js.map +1 -1
- package/es/organism/mooc-header/style.css +15 -23
- package/es/organism/wizard-contents/index.d.ts +2 -2
- package/es/template/app-player/loading/index.d.ts +8 -4
- package/es/template/app-player/player/index.d.ts +16 -8
- package/es/template/app-player/player/slides/index.d.ts +8 -4
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +8 -4
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +8 -4
- package/es/template/app-review/index.d.ts +8 -4
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +8 -4
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.d.ts +8 -4
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +27 -15
- package/es/template/common/dashboard/index.d.ts +16 -8
- package/es/template/common/search-page/index.d.ts +8 -4
- package/es/template/external-course/index.d.ts +8 -4
- package/es/template/skill-detail/all-courses.d.ts +0 -4
- package/es/template/skill-detail/all-courses.d.ts.map +1 -1
- package/es/template/skill-detail/all-courses.js.map +1 -1
- package/es/template/skill-detail/index.d.ts.map +1 -1
- package/es/template/skill-detail/index.js +1 -0
- package/es/template/skill-detail/index.js.map +1 -1
- package/es/template/skill-detail/style.css +42 -8
- package/lib/atom/button-link/index.js +2 -2
- package/lib/atom/button-link/index.js.map +1 -1
- package/lib/atom/button-menu/index.d.ts +1 -1
- package/lib/atom/button-menu/style.css +1 -1
- package/lib/atom/button-menu/types.d.ts +2 -2
- package/lib/atom/button-menu/types.js +1 -1
- package/lib/atom/button-menu/types.js.map +1 -1
- package/lib/atom/tag/style.css +1 -0
- package/lib/molecule/brand-tabs/index.d.ts.map +1 -1
- package/lib/molecule/brand-tabs/index.js +13 -6
- package/lib/molecule/brand-tabs/index.js.map +1 -1
- package/lib/molecule/brand-tabs/style.css +4 -5
- package/lib/molecule/bullet-point-menu-button/index.d.ts +1 -1
- package/lib/molecule/bullet-point-menu-button/types.d.ts +1 -1
- package/lib/molecule/button-menu-action/index.d.ts +3 -1
- package/lib/molecule/button-menu-action/index.d.ts.map +1 -1
- package/lib/molecule/button-menu-action/index.js +33 -5
- package/lib/molecule/button-menu-action/index.js.map +1 -1
- package/lib/molecule/button-menu-action/style.css +36 -0
- package/lib/molecule/button-menu-action/types.d.ts +6 -1
- package/lib/molecule/button-menu-action/types.d.ts.map +1 -1
- package/lib/molecule/button-menu-action/types.js +3 -1
- package/lib/molecule/button-menu-action/types.js.map +1 -1
- package/lib/molecule/cm-popin/types.d.ts +8 -4
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/dashboard/cards-list/index.d.ts.map +1 -1
- package/lib/molecule/dashboard/cards-list/index.js +0 -2
- package/lib/molecule/dashboard/cards-list/index.js.map +1 -1
- package/lib/molecule/dashboard/cards-list/style.css +1 -0
- package/lib/molecule/expandible-actionable-table/index.d.ts +2 -2
- package/lib/molecule/expandible-actionable-table/types.d.ts +2 -2
- package/lib/molecule/icon-preview/index.d.ts.map +1 -1
- package/lib/molecule/icon-preview/index.js +2 -1
- package/lib/molecule/icon-preview/index.js.map +1 -1
- package/lib/organism/content-skill-modal/index.d.ts +8 -4
- package/lib/organism/content-skill-modal/index.d.ts.map +1 -1
- package/lib/organism/content-skill-modal/types.d.ts +8 -4
- package/lib/organism/content-skill-modal/types.d.ts.map +1 -1
- package/lib/organism/header-with-actions/index.d.ts +1 -1
- package/lib/organism/header-with-actions/types.d.ts +1 -1
- package/lib/organism/list-items/index.d.ts +8 -4
- package/lib/organism/mooc-header/index.d.ts +1 -3
- package/lib/organism/mooc-header/index.d.ts.map +1 -1
- package/lib/organism/mooc-header/index.js +37 -38
- package/lib/organism/mooc-header/index.js.map +1 -1
- package/lib/organism/mooc-header/style.css +15 -23
- package/lib/organism/wizard-contents/index.d.ts +2 -2
- package/lib/template/app-player/loading/index.d.ts +8 -4
- package/lib/template/app-player/player/index.d.ts +16 -8
- package/lib/template/app-player/player/slides/index.d.ts +8 -4
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +8 -4
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +8 -4
- package/lib/template/app-review/index.d.ts +8 -4
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +8 -4
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.d.ts +8 -4
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +27 -15
- package/lib/template/common/dashboard/index.d.ts +16 -8
- package/lib/template/common/search-page/index.d.ts +8 -4
- package/lib/template/external-course/index.d.ts +8 -4
- package/lib/template/skill-detail/all-courses.d.ts +0 -4
- package/lib/template/skill-detail/all-courses.d.ts.map +1 -1
- package/lib/template/skill-detail/all-courses.js.map +1 -1
- package/lib/template/skill-detail/index.d.ts.map +1 -1
- package/lib/template/skill-detail/index.js +1 -0
- package/lib/template/skill-detail/index.js.map +1 -1
- package/lib/template/skill-detail/style.css +42 -8
- package/package.json +2 -2
|
@@ -575,7 +575,7 @@ declare namespace SearchPage {
|
|
|
575
575
|
'data-name': PropTypes.Requireable<string>;
|
|
576
576
|
disabled: PropTypes.Requireable<boolean>;
|
|
577
577
|
label: PropTypes.Validator<string>;
|
|
578
|
-
onClick: PropTypes.
|
|
578
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
579
579
|
type: PropTypes.Requireable<string>;
|
|
580
580
|
buttonLinkType: PropTypes.Requireable<string>;
|
|
581
581
|
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -605,6 +605,8 @@ declare namespace SearchPage {
|
|
|
605
605
|
[x: string]: NonNullable<string | number | object | null | undefined> | null | undefined;
|
|
606
606
|
}>;
|
|
607
607
|
}>>;
|
|
608
|
+
type: PropTypes.Requireable<string>;
|
|
609
|
+
primaryColor: PropTypes.Requireable<string>;
|
|
608
610
|
}> | null | undefined>>;
|
|
609
611
|
}>>;
|
|
610
612
|
}> | PropTypes.InferProps<{
|
|
@@ -631,7 +633,7 @@ declare namespace SearchPage {
|
|
|
631
633
|
'data-name': PropTypes.Requireable<string>;
|
|
632
634
|
disabled: PropTypes.Requireable<boolean>;
|
|
633
635
|
label: PropTypes.Validator<string>;
|
|
634
|
-
onClick: PropTypes.
|
|
636
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
635
637
|
type: PropTypes.Requireable<string>;
|
|
636
638
|
buttonLinkType: PropTypes.Requireable<string>;
|
|
637
639
|
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -708,7 +710,7 @@ declare namespace SearchPage {
|
|
|
708
710
|
'data-name': PropTypes.Requireable<string>;
|
|
709
711
|
disabled: PropTypes.Requireable<boolean>;
|
|
710
712
|
label: PropTypes.Validator<string>;
|
|
711
|
-
onClick: PropTypes.
|
|
713
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
712
714
|
type: PropTypes.Requireable<string>;
|
|
713
715
|
buttonLinkType: PropTypes.Requireable<string>;
|
|
714
716
|
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -910,7 +912,7 @@ declare namespace SearchPage {
|
|
|
910
912
|
'data-name': PropTypes.Requireable<string>;
|
|
911
913
|
disabled: PropTypes.Requireable<boolean>;
|
|
912
914
|
label: PropTypes.Validator<string>;
|
|
913
|
-
onClick: PropTypes.
|
|
915
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
914
916
|
type: PropTypes.Requireable<string>;
|
|
915
917
|
buttonLinkType: PropTypes.Requireable<string>;
|
|
916
918
|
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -940,6 +942,8 @@ declare namespace SearchPage {
|
|
|
940
942
|
[x: string]: NonNullable<string | number | object | null | undefined> | null | undefined;
|
|
941
943
|
}>;
|
|
942
944
|
}>>;
|
|
945
|
+
type: PropTypes.Requireable<string>;
|
|
946
|
+
primaryColor: PropTypes.Requireable<string>;
|
|
943
947
|
}>>;
|
|
944
948
|
}> | null | undefined>>;
|
|
945
949
|
}>>;
|
|
@@ -412,7 +412,7 @@ declare namespace ExternalCourse {
|
|
|
412
412
|
'data-name': PropTypes.Requireable<string>;
|
|
413
413
|
disabled: PropTypes.Requireable<boolean>;
|
|
414
414
|
label: PropTypes.Validator<string>;
|
|
415
|
-
onClick: PropTypes.
|
|
415
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
416
416
|
type: PropTypes.Requireable<string>;
|
|
417
417
|
buttonLinkType: PropTypes.Requireable<string>;
|
|
418
418
|
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -442,6 +442,8 @@ declare namespace ExternalCourse {
|
|
|
442
442
|
[x: string]: NonNullable<string | number | object | null | undefined> | null | undefined;
|
|
443
443
|
}>;
|
|
444
444
|
}>>;
|
|
445
|
+
type: PropTypes.Requireable<string>;
|
|
446
|
+
primaryColor: PropTypes.Requireable<string>;
|
|
445
447
|
}> | null | undefined>>;
|
|
446
448
|
}>>;
|
|
447
449
|
}> | PropTypes.InferProps<{
|
|
@@ -468,7 +470,7 @@ declare namespace ExternalCourse {
|
|
|
468
470
|
'data-name': PropTypes.Requireable<string>;
|
|
469
471
|
disabled: PropTypes.Requireable<boolean>;
|
|
470
472
|
label: PropTypes.Validator<string>;
|
|
471
|
-
onClick: PropTypes.
|
|
473
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
472
474
|
type: PropTypes.Requireable<string>;
|
|
473
475
|
buttonLinkType: PropTypes.Requireable<string>;
|
|
474
476
|
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -545,7 +547,7 @@ declare namespace ExternalCourse {
|
|
|
545
547
|
'data-name': PropTypes.Requireable<string>;
|
|
546
548
|
disabled: PropTypes.Requireable<boolean>;
|
|
547
549
|
label: PropTypes.Validator<string>;
|
|
548
|
-
onClick: PropTypes.
|
|
550
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
549
551
|
type: PropTypes.Requireable<string>;
|
|
550
552
|
buttonLinkType: PropTypes.Requireable<string>;
|
|
551
553
|
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -747,7 +749,7 @@ declare namespace ExternalCourse {
|
|
|
747
749
|
'data-name': PropTypes.Requireable<string>;
|
|
748
750
|
disabled: PropTypes.Requireable<boolean>;
|
|
749
751
|
label: PropTypes.Validator<string>;
|
|
750
|
-
onClick: PropTypes.
|
|
752
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
751
753
|
type: PropTypes.Requireable<string>;
|
|
752
754
|
buttonLinkType: PropTypes.Requireable<string>;
|
|
753
755
|
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -777,6 +779,8 @@ declare namespace ExternalCourse {
|
|
|
777
779
|
[x: string]: NonNullable<string | number | object | null | undefined> | null | undefined;
|
|
778
780
|
}>;
|
|
779
781
|
}>>;
|
|
782
|
+
type: PropTypes.Requireable<string>;
|
|
783
|
+
primaryColor: PropTypes.Requireable<string>;
|
|
780
784
|
}>>;
|
|
781
785
|
}> | null | undefined>>;
|
|
782
786
|
}>>;
|
|
@@ -12,10 +12,6 @@ interface ProviderContext {
|
|
|
12
12
|
}
|
|
13
13
|
declare const AllCourses: {
|
|
14
14
|
(props: {
|
|
15
|
-
dataName?: string | undefined;
|
|
16
|
-
ariaLabel?: string | undefined;
|
|
17
|
-
selected?: boolean | undefined;
|
|
18
|
-
label?: string | undefined;
|
|
19
15
|
content: {
|
|
20
16
|
list: CardsGridProps['list'];
|
|
21
17
|
loading?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"all-courses.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/all-courses.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAMnC,OAAkB,EAAC,cAAc,EAAC,MAAM,2BAA2B,CAAC;AAQpE,UAAU,eAAe;IACvB,IAAI,EAAE;QACJ,MAAM,EAAE;YACN,OAAO,EAAE,MAAM,CAAC;YAChB,SAAS,EAAE,MAAM,CAAC;SACnB,CAAC;KACH,CAAC;IACF,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,KAAK,MAAM,CAAC;CACnD;AAgDD,QAAA,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"all-courses.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/all-courses.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAMnC,OAAkB,EAAC,cAAc,EAAC,MAAM,2BAA2B,CAAC;AAQpE,UAAU,eAAe;IACvB,IAAI,EAAE;QACJ,MAAM,EAAE;YACN,OAAO,EAAE,MAAM,CAAC;YAChB,SAAS,EAAE,MAAM,CAAC;SACnB,CAAC;KACH,CAAC;IACF,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,KAAK,MAAM,CAAC;CACnD;AAgDD,QAAA,MAAM,UAAU;;iBAEH;YACP,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;YAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;SACnB;;;sBAGW,MAAM;8BACE,MAAM,KAAK,IAAI;;;kBAG3B,OAAO,GAAG,UAAU;oBAClB,MAAM,IAAI;4BACF,OAAO;;;gCAGJ,MAAM,KAAK,IAAI;;;gBAI7B,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkJzB,CAAC;AAyBF,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"all-courses.js","names":["React","useState","useCallback","useMemo","PropTypes","Provider","SelectOptionPropTypes","ButtonLink","SearchForm","CardsGrid","InputSwitch","Banner","COLORS","style","uncappedMap","_map","convert","cap","FilterButton","props","context","dataName","ariaLabel","selected","label","onClick","skin","primarySkinColor","_get","buttonProps","customStyle","backgroundColor","cm_grey_150","color","white","cm_grey_500","transition","width","createElement","contextTypes","childContextTypes","translate","propTypes","process","env","NODE_ENV","string","bool","func","AllCourses","content","filters","totalContents","bannerMicrolearning","undefined","search","oldValue","oldSearchValue","onChange","handleSearch","options","list","loading","bannerMessageType","type","bannerAction","action","oldSwitchValue","showCompleted","setShowCompleted","searchValue","setSearchValue","filteredContent","_filter","course","progress","debounceHandleSearch","_debounce","value","onSearchChange","handleSearchReset","handleShowCompletedToggle","prevShowCompleted","Fragment","className","continueLearningWrapper","continueLearningTitle","continueLearningNumber","_isNil","_size","searchAndSortSection","searchWrapper","placeholder","onReset","dataTestId","sortSection","id","name","title","theme","_isEmpty","bannerWrapper","message","cta","filterWrapper","filterProps","index","handleFilterChange","key","filterButtonWrapper","divider","justifyContent","emptySearchResultContainer","emptySearchResultTitle","emptySearchResultDescription","emptySearchResultClearSearch","shape","number","arrayOf","oneOf"],"sources":["../../../src/template/skill-detail/all-courses.tsx"],"sourcesContent":["import React, {useState, useCallback, useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {get, filter, map, size, isNil, isEmpty, debounce} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLink from '../../atom/button-link';\nimport SearchForm from '../../molecule/search-form';\nimport CardsGrid, {CardsGridProps} from '../../organism/cards-grid';\nimport InputSwitch from '../../atom/input-switch';\nimport Banner from '../../molecule/banner';\nimport {COLORS} from '../../variables/colors';\nimport style from './all-courses.css';\n\n// @ts-expect-error convert untypped\nconst uncappedMap = map.convert({cap: false});\ninterface ProviderContext {\n skin: {\n common: {\n primary: string;\n secondary: string;\n };\n };\n translate: (key: string, options?: any) => string;\n}\n\ninterface FilterOption {\n name: string;\n value: string;\n selected: boolean;\n}\n\ninterface FilterButtonProps {\n dataName?: string;\n ariaLabel?: string;\n selected?: boolean;\n label?: string;\n onClick?: () => void;\n}\nconst FilterButton = (props: FilterButtonProps, context: ProviderContext) => {\n const {dataName, ariaLabel, selected, label, onClick} = props;\n const {skin} = context;\n const primarySkinColor = get('common.primary', skin);\n\n const buttonProps = {\n customStyle: {\n backgroundColor: selected ? primarySkinColor : COLORS.cm_grey_150,\n color: selected ? COLORS.white : COLORS.cm_grey_500,\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out',\n width: 'fit-content'\n },\n label,\n onClick,\n 'data-name': dataName,\n 'aria-label': ariaLabel\n };\n\n return <ButtonLink {...buttonProps} />;\n};\n\nFilterButton.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\nFilterButton.propTypes = {\n dataName: PropTypes.string,\n ariaLabel: PropTypes.string,\n selected: PropTypes.bool,\n label: PropTypes.string,\n onClick: PropTypes.func\n};\n\nconst AllCourses = (\n props: {\n dataName?: string;\n ariaLabel?: string;\n selected?: boolean;\n label?: string;\n content: {\n list: CardsGridProps['list'];\n loading?: boolean;\n };\n totalContents?: number;\n search: {\n oldValue: string;\n onChange: (value: string) => void;\n };\n bannerMicrolearning?: {\n type: 'skill' | 'playlist';\n action: () => void;\n oldSwitchValue: boolean;\n };\n filters: {\n onChange?: (value: string) => void;\n options?: unknown[];\n };\n },\n context: ProviderContext\n) => {\n const {translate} = context;\n const {\n content,\n filters,\n totalContents,\n bannerMicrolearning = undefined,\n search: {oldValue: oldSearchValue, onChange: handleSearch}\n } = props;\n const {options, onChange} = filters;\n const {list, loading} = content;\n const bannerMessageType = bannerMicrolearning?.type;\n const bannerAction = bannerMicrolearning?.action;\n const oldSwitchValue = bannerMicrolearning?.oldSwitchValue;\n\n const [showCompleted, setShowCompleted] = useState(true);\n const [searchValue, setSearchValue] = useState(oldSearchValue || '');\n\n const filteredContent = useMemo(() => {\n return showCompleted ? list : filter(course => course.progress < 1, list);\n }, [list, showCompleted]);\n\n const debounceHandleSearch = useMemo(() => {\n return debounce(800, value => {\n handleSearch(value);\n });\n }, [handleSearch]);\n\n const onSearchChange = useCallback(\n value => {\n setSearchValue(value);\n debounceHandleSearch(value);\n },\n [debounceHandleSearch]\n );\n\n const handleSearchReset = useCallback(() => {\n setSearchValue('');\n debounceHandleSearch('');\n }, [debounceHandleSearch]);\n\n const handleShowCompletedToggle = useCallback(() => {\n setShowCompleted(prevShowCompleted => !prevShowCompleted);\n }, []);\n\n return (\n <>\n <div className={style.continueLearningWrapper}>\n <span className={style.continueLearningTitle}>{translate('all_content')}</span>\n <span className={style.continueLearningNumber}>\n {isNil(totalContents) ? size(filteredContent) : totalContents}\n </span>\n </div>\n <div className={style.searchAndSortSection}>\n <div className={style.searchWrapper}>\n <SearchForm\n search={{\n placeholder: translate('search_place_holder'),\n value: searchValue,\n onChange: onSearchChange\n }}\n onReset={handleSearchReset}\n dataTestId=\"all-courses-search-input\"\n />\n </div>\n <div className={style.sortSection}>\n <InputSwitch\n id={'show-completed-courses-switch'}\n name={translate('show_completed')}\n title={translate('show_completed')}\n theme=\"default\"\n aria-label={'Show completed courses aria label'}\n value={showCompleted}\n onChange={handleShowCompletedToggle}\n />\n </div>\n </div>\n {!isEmpty(bannerMicrolearning) ? (\n <div className={style.bannerWrapper}>\n <Banner\n type=\"info\"\n message={\n bannerMessageType === 'skill'\n ? translate('banner_microlearning_rule_message_skill')\n : translate('banner_microlearning_rule_message')\n }\n cta={[\n {\n type: 'switch',\n label: translate('banner_microlearning_rule_label'),\n action: bannerAction,\n oldSwitchValue\n }\n ]}\n />\n </div>\n ) : null}\n\n <div className={style.filterWrapper}>\n {size(options) > 2\n ? uncappedMap((filterProps: FilterOption, index: number) => {\n const {name, value, selected} = filterProps;\n\n function handleFilterChange() {\n onChange && onChange(value);\n }\n\n return (\n <div key={index} className={style.filterButtonWrapper}>\n <FilterButton\n dataName={`filter-button-${value}`}\n ariaLabel={`Filter by ${name}`}\n selected={selected}\n label={name}\n onClick={handleFilterChange}\n />\n {value === 'ALL' ? <div className={style.divider} /> : null}\n </div>\n );\n }, options)\n : null}\n </div>\n <div>\n {size(filteredContent) ? (\n <CardsGrid\n list={filteredContent}\n loading={loading}\n customStyle={{justifyContent: 'left'}}\n />\n ) : (\n <div className={style.emptySearchResultContainer}>\n <div className={style.emptySearchResultTitle}>\n {translate('empty_search_result_title', {searchValue})}\n </div>\n <div className={style.emptySearchResultDescription}>\n {translate('empty_search_result_description')}\n </div>\n <div className={style.emptySearchResultClearSearch} onClick={handleSearchReset}>\n {translate('empty_search_result_clear_search')}\n </div>\n </div>\n )}\n </div>\n </>\n );\n};\n\nAllCourses.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nAllCourses.propTypes = {\n content: PropTypes.shape(CardsGrid.propTypes),\n totalContents: PropTypes.number,\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n bannerMicrolearning: PropTypes.shape({\n type: PropTypes.oneOf(['skill', 'playlist']),\n action: PropTypes.func,\n oldSwitchValue: PropTypes.bool\n }),\n search: PropTypes.shape({\n oldValue: PropTypes.string,\n onChange: PropTypes.func\n })\n};\n\nexport default AllCourses;\n"],"mappings":";;;;;;;AAAA,OAAOA,KAAK,IAAGC,QAAQ,EAAEC,WAAW,EAAEC,OAAO,QAAO,OAAO;AAC3D,OAAOC,SAAS,MAAM,YAAY;AA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Provider","SelectOptionPropTypes","ButtonLink","SearchForm","CardsGrid","InputSwitch","Banner","COLORS","style","uncappedMap","_map","convert","cap","FilterButton","props","context","dataName","ariaLabel","selected","label","onClick","skin","primarySkinColor","_get","buttonProps","customStyle","backgroundColor","cm_grey_150","color","white","cm_grey_500","transition","width","createElement","contextTypes","childContextTypes","translate","propTypes","process","env","NODE_ENV","string","bool","func","AllCourses","content","filters","totalContents","bannerMicrolearning","undefined","search","oldValue","oldSearchValue","onChange","handleSearch","options","list","loading","bannerMessageType","type","bannerAction","action","oldSwitchValue","showCompleted","setShowCompleted","searchValue","setSearchValue","filteredContent","_filter","course","progress","debounceHandleSearch","_debounce","value","onSearchChange","handleSearchReset","handleShowCompletedToggle","prevShowCompleted","Fragment","className","continueLearningWrapper","continueLearningTitle","continueLearningNumber","_isNil","_size","searchAndSortSection","searchWrapper","placeholder","onReset","dataTestId","sortSection","id","name","title","theme","_isEmpty","bannerWrapper","message","cta","filterWrapper","filterProps","index","handleFilterChange","key","filterButtonWrapper","divider","justifyContent","emptySearchResultContainer","emptySearchResultTitle","emptySearchResultDescription","emptySearchResultClearSearch","shape","number","arrayOf","oneOf"],"sources":["../../../src/template/skill-detail/all-courses.tsx"],"sourcesContent":["import React, {useState, useCallback, useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {get, filter, map, size, isNil, isEmpty, debounce} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLink from '../../atom/button-link';\nimport SearchForm from '../../molecule/search-form';\nimport CardsGrid, {CardsGridProps} from '../../organism/cards-grid';\nimport InputSwitch from '../../atom/input-switch';\nimport Banner from '../../molecule/banner';\nimport {COLORS} from '../../variables/colors';\nimport style from './all-courses.css';\n\n// @ts-expect-error convert untypped\nconst uncappedMap = map.convert({cap: false});\ninterface ProviderContext {\n skin: {\n common: {\n primary: string;\n secondary: string;\n };\n };\n translate: (key: string, options?: any) => string;\n}\n\ninterface FilterOption {\n name: string;\n value: string;\n selected: boolean;\n}\n\ninterface FilterButtonProps {\n dataName?: string;\n ariaLabel?: string;\n selected?: boolean;\n label?: string;\n onClick?: () => void;\n}\nconst FilterButton = (props: FilterButtonProps, context: ProviderContext) => {\n const {dataName, ariaLabel, selected, label, onClick} = props;\n const {skin} = context;\n const primarySkinColor = get('common.primary', skin);\n\n const buttonProps = {\n customStyle: {\n backgroundColor: selected ? primarySkinColor : COLORS.cm_grey_150,\n color: selected ? COLORS.white : COLORS.cm_grey_500,\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out',\n width: 'fit-content'\n },\n label,\n onClick,\n 'data-name': dataName,\n 'aria-label': ariaLabel\n };\n\n return <ButtonLink {...buttonProps} />;\n};\n\nFilterButton.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\nFilterButton.propTypes = {\n dataName: PropTypes.string,\n ariaLabel: PropTypes.string,\n selected: PropTypes.bool,\n label: PropTypes.string,\n onClick: PropTypes.func\n};\n\nconst AllCourses = (\n props: {\n content: {\n list: CardsGridProps['list'];\n loading?: boolean;\n };\n totalContents?: number;\n search: {\n oldValue: string;\n onChange: (value: string) => void;\n };\n bannerMicrolearning?: {\n type: 'skill' | 'playlist';\n action: () => void;\n oldSwitchValue: boolean;\n };\n filters: {\n onChange?: (value: string) => void;\n options?: unknown[];\n };\n },\n context: ProviderContext\n) => {\n const {translate} = context;\n const {\n content,\n filters,\n totalContents,\n bannerMicrolearning = undefined,\n search: {oldValue: oldSearchValue, onChange: handleSearch}\n } = props;\n const {options, onChange} = filters;\n const {list, loading} = content;\n const bannerMessageType = bannerMicrolearning?.type;\n const bannerAction = bannerMicrolearning?.action;\n const oldSwitchValue = bannerMicrolearning?.oldSwitchValue;\n\n const [showCompleted, setShowCompleted] = useState(true);\n const [searchValue, setSearchValue] = useState(oldSearchValue || '');\n\n const filteredContent = useMemo(() => {\n return showCompleted ? list : filter(course => course.progress < 1, list);\n }, [list, showCompleted]);\n\n const debounceHandleSearch = useMemo(() => {\n return debounce(800, value => {\n handleSearch(value);\n });\n }, [handleSearch]);\n\n const onSearchChange = useCallback(\n value => {\n setSearchValue(value);\n debounceHandleSearch(value);\n },\n [debounceHandleSearch]\n );\n\n const handleSearchReset = useCallback(() => {\n setSearchValue('');\n debounceHandleSearch('');\n }, [debounceHandleSearch]);\n\n const handleShowCompletedToggle = useCallback(() => {\n setShowCompleted(prevShowCompleted => !prevShowCompleted);\n }, []);\n\n return (\n <>\n <div className={style.continueLearningWrapper}>\n <span className={style.continueLearningTitle}>{translate('all_content')}</span>\n <span className={style.continueLearningNumber}>\n {isNil(totalContents) ? size(filteredContent) : totalContents}\n </span>\n </div>\n <div className={style.searchAndSortSection}>\n <div className={style.searchWrapper}>\n <SearchForm\n search={{\n placeholder: translate('search_place_holder'),\n value: searchValue,\n onChange: onSearchChange\n }}\n onReset={handleSearchReset}\n dataTestId=\"all-courses-search-input\"\n />\n </div>\n <div className={style.sortSection}>\n <InputSwitch\n id={'show-completed-courses-switch'}\n name={translate('show_completed')}\n title={translate('show_completed')}\n theme=\"default\"\n aria-label={'Show completed courses aria label'}\n value={showCompleted}\n onChange={handleShowCompletedToggle}\n />\n </div>\n </div>\n {!isEmpty(bannerMicrolearning) ? (\n <div className={style.bannerWrapper}>\n <Banner\n type=\"info\"\n message={\n bannerMessageType === 'skill'\n ? translate('banner_microlearning_rule_message_skill')\n : translate('banner_microlearning_rule_message')\n }\n cta={[\n {\n type: 'switch',\n label: translate('banner_microlearning_rule_label'),\n action: bannerAction,\n oldSwitchValue\n }\n ]}\n />\n </div>\n ) : null}\n\n <div className={style.filterWrapper}>\n {size(options) > 2\n ? uncappedMap((filterProps: FilterOption, index: number) => {\n const {name, value, selected} = filterProps;\n\n function handleFilterChange() {\n onChange && onChange(value);\n }\n\n return (\n <div key={index} className={style.filterButtonWrapper}>\n <FilterButton\n dataName={`filter-button-${value}`}\n ariaLabel={`Filter by ${name}`}\n selected={selected}\n label={name}\n onClick={handleFilterChange}\n />\n {value === 'ALL' ? <div className={style.divider} /> : null}\n </div>\n );\n }, options)\n : null}\n </div>\n <div>\n {size(filteredContent) ? (\n <CardsGrid\n list={filteredContent}\n loading={loading}\n customStyle={{justifyContent: 'left'}}\n />\n ) : (\n <div className={style.emptySearchResultContainer}>\n <div className={style.emptySearchResultTitle}>\n {translate('empty_search_result_title', {searchValue})}\n </div>\n <div className={style.emptySearchResultDescription}>\n {translate('empty_search_result_description')}\n </div>\n <div className={style.emptySearchResultClearSearch} onClick={handleSearchReset}>\n {translate('empty_search_result_clear_search')}\n </div>\n </div>\n )}\n </div>\n </>\n );\n};\n\nAllCourses.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nAllCourses.propTypes = {\n content: PropTypes.shape(CardsGrid.propTypes),\n totalContents: PropTypes.number,\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n bannerMicrolearning: PropTypes.shape({\n type: PropTypes.oneOf(['skill', 'playlist']),\n action: PropTypes.func,\n oldSwitchValue: PropTypes.bool\n }),\n search: PropTypes.shape({\n oldValue: PropTypes.string,\n onChange: PropTypes.func\n })\n};\n\nexport default AllCourses;\n"],"mappings":";;;;;;;AAAA,OAAOA,KAAK,IAAGC,QAAQ,EAAEC,WAAW,EAAEC,OAAO,QAAO,OAAO;AAC3D,OAAOC,SAAS,MAAM,YAAY;AAElC,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,SAAQC,qBAAqB,QAAO,mBAAmB;AACvD,OAAOC,UAAU,MAAM,wBAAwB;AAC/C,OAAOC,UAAU,MAAM,4BAA4B;AACnD,OAAOC,SAAS,MAAwB,2BAA2B;AACnE,OAAOC,WAAW,MAAM,yBAAyB;AACjD,OAAOC,MAAM,MAAM,uBAAuB;AAC1C,SAAQC,MAAM,QAAO,wBAAwB;AAC7C,OAAOC,KAAK,MAAM,mBAAmB;;AAErC;AACA,MA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Q,CAACmC,iBAAiB,CAACC;AACxC,CAAC;AAEDQ,UAAU,CAACP,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EACrBK,OAAO,EAAE9C,SAAS,CAACgH,KAAK,CAAC3G,SAAS,CAACiC,SAAS,CAAC;EAC7CU,aAAa,EAAEhD,SAAS,CAACiH,MAAM;EAC/BlE,OAAO,EAAE/C,SAAS,CAACgH,KAAK,CAAC;IACvB1D,QAAQ,EAAEtD,SAAS,CAAC4C,IAAI;IACxBY,OAAO,EAAExD,SAAS,CAACkH,OAAO,CAAClH,SAAS,CAACgH,KAAK,CAAC9G,qBAAqB,CAAC;EACnE,CAAC,CAAC;EACF+C,mBAAmB,EAAEjD,SAAS,CAACgH,KAAK,CAAC;IACnCpD,IAAI,EAAE5D,SAAS,CAACmH,KAAK,CAAC,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IAC5CrD,MAAM,EAAE9D,SAAS,CAAC4C,IAAI;IACtBmB,cAAc,EAAE/D,SAAS,CAAC2C;EAC5B,CAAC,CAAC;EACFQ,MAAM,EAAEnD,SAAS,CAACgH,KAAK,CAAC;IACtB5D,QAAQ,EAAEpD,SAAS,CAAC0C,MAAM;IAC1BY,QAAQ,EAAEtD,SAAS,CAAC4C;EACtB,CAAC;AACH,CAAC;AAED,eAAeC,UAAU","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/index.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAUnC,OAAkB,EAAC,cAAc,EAAC,MAAM,2BAA2B,CAAC;AAMpE,UAAU,2BAA2B;IACnC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AACD,UAAU,eAAe;IACvB,IAAI,EAAE;QACJ,MAAM,EAAE;YACN,OAAO,EAAE,MAAM,CAAC;Y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CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,oBAAoB,EAAE,cAAc,CAAC;IACrC,OAAO,EAAE;QACP,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;QACtB,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;KACrB,CAAC;IACF,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,uBAAuB,CAAC,EAAE,MAAM,IAAI,CAAC;IACrC,MAAM,EAAE;QACN,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,IAAI,CAAC;KACtB,CAAC;IACF,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;CAC3C;AACD,QAAA,MAAM,WAAW;YAAW,gBAAgB,WAAW,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4MrE,CAAC;AAyCF,eAAe,WAAW,CAAC"}
|
|
@@ -102,6 +102,7 @@ const SkillDetail = (props, context) => {
|
|
|
102
102
|
const Description = useCallback(() => {
|
|
103
103
|
return /*#__PURE__*/React.createElement("div", {
|
|
104
104
|
ref: descriptionRef,
|
|
105
|
+
"data-testid": "skill-description",
|
|
105
106
|
className: classnames(style.description, !showMore && style.truncate)
|
|
106
107
|
}, description ? /*#__PURE__*/React.createElement(Markdown, null, description) : null);
|
|
107
108
|
}, [showMore, description]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","useState","useRef","useEffect","PropTypes","classnames","Markdown","convert","Provider","ButtonLinkIcon","Icon","IconPreview","ButtonLink","CardsGrid","COLORS","SelectOptionPropTypes","AllCourses","style","ContinueLearningButton","props","context","ongoingCoursesAvailable","onClick","skin","translate","primarySkinColor","_get","createElement","label","type","customStyle","width","borderRadius","backgroundColor","hoverBackgroundColor","hoverColor","white","icon","position","faIcon","name","color","size","contextTypes","childContextTypes","propTypes","process","env","NODE_ENV","bool","func","SkillDetail","title","iconColor","iconName","skillRef","description","metrics","focused","availableForReview","skillIncludedCourses","filters","onBackClick","onReviewClick","onContinueLearningClick","search","bannerMicrolearning","score","questionsToReview","totalContents","bannerMicrolearningAction","action","descriptionRef","isDescriptionTruncated","setIsDescriptionTruncated","showMore","setShowMore","handleShowMore","current","clientHeight","scrollHeight","Description","ref","className","truncate","ProgressBar","progressBarColor","cm_positive_500","inlineProgressStyle","progressBarRow","progressBarWrapper","progress","role","progressInformationNumber","toFixed","hasDescription","Boolean","trim","length","backgroundContainer","container","topSection","_isNil","backButton","tooltipPlacement","mainSection","leftSide","gap","padding","rightSide","skillFocusBadge","purple_100","faSize","wrapperSize","skillBadge","cm_grey_100","Fragment","showMoreWrapper","skillInformation","progressContainer","noDescriptionSpacing","ctaWrapper","disabled","cm_grey_700","content","oldSwitchValue","undefined","string","isRequired","shape","number","onChange","options","arrayOf","oldValue"],"sources":["../../../src/template/skill-detail/index.tsx"],"sourcesContent":["import React, {useCallback, useState, useRef, useEffect} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {get, isNil} from 'lodash/fp';\nimport Markdown from 'markdown-to-jsx';\nimport {convert} from 'css-color-function';\nimport Provider from '../../atom/provider';\nimport ButtonLinkIcon from '../../atom/button-link-icon';\nimport Icon from '../../atom/icon';\nimport IconPreview from '../../molecule/icon-preview';\nimport ButtonLink from '../../atom/button-link';\nimport CardsGrid, {CardsGridProps} from '../../organism/cards-grid';\nimport {COLORS} from '../../variables/colors';\nimport Select, {SelectOptionPropTypes} from '../../atom/select';\nimport AllCourses from './all-courses';\nimport style from './style.css';\n\ninterface ContinueLearningButtonProps {\n ongoingCoursesAvailable?: boolean;\n onClick?: () => void;\n}\ninterface ProviderContext {\n skin: {\n common: {\n primary: string;\n secondary: string;\n };\n };\n translate: (key: string) => string;\n}\n\nexport const ContinueLearningButton = (\n props: ContinueLearningButtonProps,\n context: ProviderContext\n) => {\n const {ongoingCoursesAvailable, onClick} = props;\n const {skin, translate} = context;\n const primarySkinColor = get('common.primary', skin);\n\n return (\n <ButtonLink\n label={ongoingCoursesAvailable ? translate('continue_learning') : translate('start_learning')}\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={COLORS.white}\n icon={{\n position: 'left',\n faIcon: {\n name: 'play',\n color: COLORS.white,\n size: 14\n }\n }}\n onClick={onClick}\n />\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\ninterface Metrics {\n score?: number;\n questionsToReview?: number;\n totalContents?: number;\n}\n\ntype BannerMicrolearning =\n | Record<string, never>\n | {\n action: () => void;\n oldSwitchValue: boolean;\n };\ninterface SkillDetailProps {\n title: string;\n icon: {name: string; color: string};\n skillRef: string;\n description?: string;\n metrics?: Metrics;\n focused?: boolean;\n availableForReview?: boolean;\n ongoingCoursesAvailable?: boolean;\n skillIncludedCourses: CardsGridProps;\n filters: {\n onChange?: () => void;\n options?: unknown[];\n };\n onBackClick?: () => void;\n onReviewClick?: () => void;\n onContinueLearningClick?: () => void;\n search: {\n oldValue: string;\n onChange: () => void;\n };\n bannerMicrolearning?: BannerMicrolearning;\n}\nconst SkillDetail = (props: SkillDetailProps, context: ProviderContext) => {\n const {\n title,\n icon: {color: iconColor, name: iconName},\n skillRef,\n description,\n metrics = {},\n focused,\n availableForReview,\n ongoingCoursesAvailable,\n skillIncludedCourses,\n filters,\n onBackClick,\n onReviewClick,\n onContinueLearningClick,\n search,\n bannerMicrolearning\n } = props;\n\n const {score = 0, questionsToReview = 0, totalContents = 0} = metrics;\n const {translate} = context;\n const bannerMicrolearningAction = bannerMicrolearning?.action;\n const descriptionRef = useRef(null);\n const [isDescriptionTruncated, setIsDescriptionTruncated] = useState(false);\n const [showMore, setShowMore] = useState(false);\n\n const handleShowMore = useCallback(() => {\n setShowMore(!showMore);\n }, [showMore]);\n\n useEffect(() => {\n if (descriptionRef.current) {\n const {clientHeight = 0, scrollHeight = 0} = descriptionRef.current;\n setIsDescriptionTruncated(scrollHeight > clientHeight);\n }\n }, [description]);\n\n const Description = useCallback(() => {\n return (\n <div\n ref={descriptionRef}\n className={classnames(style.description, !showMore && style.truncate)}\n >\n {description ? <Markdown>{description}</Markdown> : null}\n </div>\n );\n }, [showMore, description]);\n\n const ProgressBar = useCallback(() => {\n if (typeof score !== 'number') return null;\n\n const progressBarColor = COLORS.cm_positive_500;\n const inlineProgressStyle = {\n backgroundColor: progressBarColor,\n width: `${score}%`\n };\n\n return (\n <div className={style.progressBarRow}>\n <div className={style.progressBarWrapper}>\n <div\n data-name=\"progress\"\n className={style.progress}\n style={inlineProgressStyle}\n role=\"progressbar\"\n aria-valuenow={score}\n aria-valuemin={0}\n aria-valuemax={100}\n />\n </div>\n <span className={style.progressInformationNumber}>{score.toFixed(1)}%</span>\n </div>\n );\n }, [score]);\n const hasDescription = Boolean(description && description.trim().length > 0);\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={skillRef}>\n {/* Top section for the back arrow (optional) */}\n <div className={style.topSection}>\n {!isNil(onBackClick) ? (\n <ButtonLinkIcon\n faIcon=\"arrow-left\"\n data-name=\"back-button\"\n aria-label={translate('back')}\n onClick={onBackClick}\n className={style.backButton}\n tooltipPlacement=\"right\"\n />\n ) : null}\n </div>\n\n {/* Main section: icon on the left, skill info on the right */}\n <div className={style.mainSection}>\n <div className={style.leftSide}>\n <IconPreview\n icon={{\n name: iconName,\n color: iconColor\n }}\n title={title}\n customStyle={{gap: 24, padding: '50px 49px 50px 50px'}}\n />\n </div>\n <div className={style.rightSide}>\n {focused ? (\n <div className={style.skillFocusBadge}>\n <Icon\n iconName=\"bullseye-arrow\"\n backgroundColor={COLORS.purple_100}\n size={{faSize: 10, wrapperSize: 16}}\n />\n {translate('skill_focus')}\n </div>\n ) : (\n <div className={style.skillBadge}>\n <Icon\n iconName=\"shapes\"\n backgroundColor={COLORS.cm_grey_100}\n size={{faSize: 10, wrapperSize: 16}}\n />\n {translate('skill')}\n </div>\n )}\n\n <h2 className={style.title}>{title}</h2>\n\n {description && (\n <>\n <Description />\n {isDescriptionTruncated ? (\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={{faSize: 14, wrapperSize: 14}}\n customStyle={{padding: '8px'}}\n />\n </div>\n ) : null}\n </>\n )}\n\n {questionsToReview > 0 ? (\n <div className={style.skillInformation}>\n <span>{questionsToReview}</span>\n {translate('skill_chart_side_panel_questions_to_review')}\n </div>\n ) : null}\n\n <div\n className={classnames(\n style.progressContainer,\n !hasDescription && style.noDescriptionSpacing\n )}\n >\n <ProgressBar />\n </div>\n\n <div className={style.ctaWrapper}>\n <ContinueLearningButton\n ongoingCoursesAvailable={ongoingCoursesAvailable}\n onClick={onContinueLearningClick}\n />\n <ButtonLink\n type=\"secondary\"\n label={translate('review_this_skill')}\n disabled={!availableForReview}\n onClick={onReviewClick}\n icon={{\n position: 'left',\n faIcon: {\n name: 'rotate-right',\n color: COLORS.cm_grey_700,\n size: 14\n }\n }}\n customStyle={{borderRadius: '12px', width: 'fit-content'}}\n />\n </div>\n </div>\n </div>\n\n {/* Courses section below */}\n <AllCourses\n content={skillIncludedCourses}\n filters={filters}\n totalContents={totalContents}\n bannerMicrolearning={\n bannerMicrolearning && bannerMicrolearningAction\n ? {\n type: 'skill',\n action: bannerMicrolearningAction,\n oldSwitchValue: bannerMicrolearning.oldSwitchValue\n }\n : undefined\n }\n search={search}\n />\n </div>\n </div>\n );\n};\n\nSkillDetail.contextTypes = {\n translate: Provider.childContextTypes.translate,\n skin: Provider.childContextTypes.skin\n};\n\nSkillDetail.propTypes = {\n title: PropTypes.string.isRequired,\n icon: PropTypes.shape({\n name: PropTypes.string,\n color: PropTypes.string\n }).isRequired,\n skillRef: PropTypes.string.isRequired,\n description: PropTypes.string,\n metrics: PropTypes.shape({\n score: PropTypes.number,\n questionsToReview: PropTypes.number,\n totalContents: PropTypes.number\n }),\n focused: PropTypes.bool,\n availableForReview: PropTypes.bool,\n ongoingCoursesAvailable: PropTypes.bool,\n skillIncludedCourses: PropTypes.shape(CardsGrid.propTypes),\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n onBackClick: PropTypes.func,\n onReviewClick: PropTypes.func,\n onContinueLearningClick: PropTypes.func,\n search: PropTypes.shape({\n oldValue: PropTypes.string,\n onChange: PropTypes.func\n }),\n bannerMicrolearning: PropTypes.shape({\n action: PropTypes.func,\n oldSwitchValue: PropTypes.bool\n })\n};\n\nexport default SkillDetail;\n"],"mappings":";;AAAA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,SAAS,QAAO,OAAO;AACrE,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,OAAOC,QAAQ,MAAM,iBAAiB;AACtC,SAAQC,OAAO,QAAO,oBAAoB;AAC1C,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,OAAOC,cAAc,MAAM,6BAA6B;AACxD,OAAOC,IAAI,MAAM,iBAAiB;AAClC,OAAOC,WAAW,MAAM,6BAA6B;AACrD,OAAOC,UAAU,MAAM,wBAAwB;AAC/C,OAAOC,SAAS,MAAwB,2BAA2B;AACnE,SAAQC,MAAM,QAAO,wBAAwB;AAC7C,SAAgBC,qBAAqB,QA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AC8C,IAAI;EAC3Ba,aAAa,EAAE3D,SAAS,CAAC8C,IAAI;EAC7Bc,uBAAuB,EAAE5D,SAAS,CAAC8C,IAAI;EACvCe,MAAM,EAAE7D,SAAS,CAAC6H,KAAK,CAAC;IACtBK,QAAQ,EAAElI,SAAS,CAAC2H,MAAM;IAC1BI,QAAQ,EAAE/H,SAAS,CAAC8C;EACtB,CAAC,CAAC;EACFgB,mBAAmB,EAAE9D,SAAS,CAAC6H,KAAK,CAAC;IACnC1D,MAAM,EAAEnE,SAAS,CAAC8C,IAAI;IACtB2E,cAAc,EAAEzH,SAAS,CAAC6C;EAC5B,CAAC;AACH,CAAC;AAED,eAAeE,WAAW","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","useState","useRef","useEffect","PropTypes","classnames","Markdown","convert","Provider","ButtonLinkIcon","Icon","IconPreview","ButtonLink","CardsGrid","COLORS","SelectOptionPropTypes","AllCourses","style","ContinueLearningButton","props","context","ongoingCoursesAvailable","onClick","skin","translate","primarySkinColor","_get","createElement","label","type","customStyle","width","borderRadius","backgroundColor","hoverBackgroundColor","hoverColor","white","icon","position","faIcon","name","color","size","contextTypes","childContextTypes","propTypes","process","env","NODE_ENV","bool","func","SkillDetail","title","iconColor","iconName","skillRef","description","metrics","focused","availableForReview","skillIncludedCourses","filters","onBackClick","onReviewClick","onContinueLearningClick","search","bannerMicrolearning","score","questionsToReview","totalContents","bannerMicrolearningAction","action","descriptionRef","isDescriptionTruncated","setIsDescriptionTruncated","showMore","setShowMore","handleShowMore","current","clientHeight","scrollHeight","Description","ref","className","truncate","ProgressBar","progressBarColor","cm_positive_500","inlineProgressStyle","progressBarRow","progressBarWrapper","progress","role","progressInformationNumber","toFixed","hasDescription","Boolean","trim","length","backgroundContainer","container","topSection","_isNil","backButton","tooltipPlacement","mainSection","leftSide","gap","padding","rightSide","skillFocusBadge","purple_100","faSize","wrapperSize","skillBadge","cm_grey_100","Fragment","showMoreWrapper","skillInformation","progressContainer","noDescriptionSpacing","ctaWrapper","disabled","cm_grey_700","content","oldSwitchValue","undefined","string","isRequired","shape","number","onChange","options","arrayOf","oldValue"],"sources":["../../../src/template/skill-detail/index.tsx"],"sourcesContent":["import React, {useCallback, useState, useRef, useEffect} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {get, isNil} from 'lodash/fp';\nimport Markdown from 'markdown-to-jsx';\nimport {convert} from 'css-color-function';\nimport Provider from '../../atom/provider';\nimport ButtonLinkIcon from '../../atom/button-link-icon';\nimport Icon from '../../atom/icon';\nimport IconPreview from '../../molecule/icon-preview';\nimport ButtonLink from '../../atom/button-link';\nimport CardsGrid, {CardsGridProps} from '../../organism/cards-grid';\nimport {COLORS} from '../../variables/colors';\nimport {SelectOptionPropTypes} from '../../atom/select';\nimport AllCourses from './all-courses';\nimport style from './style.css';\n\ninterface ContinueLearningButtonProps {\n ongoingCoursesAvailable?: boolean;\n onClick?: () => void;\n}\ninterface ProviderContext {\n skin: {\n common: {\n primary: string;\n secondary: string;\n };\n };\n translate: (key: string) => string;\n}\n\nexport const ContinueLearningButton = (\n props: ContinueLearningButtonProps,\n context: ProviderContext\n) => {\n const {ongoingCoursesAvailable, onClick} = props;\n const {skin, translate} = context;\n const primarySkinColor = get('common.primary', skin);\n\n return (\n <ButtonLink\n label={ongoingCoursesAvailable ? translate('continue_learning') : translate('start_learning')}\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={COLORS.white}\n icon={{\n position: 'left',\n faIcon: {\n name: 'play',\n color: COLORS.white,\n size: 14\n }\n }}\n onClick={onClick}\n />\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\ninterface Metrics {\n score?: number;\n questionsToReview?: number;\n totalContents?: number;\n}\n\ntype BannerMicrolearning =\n | Record<string, never>\n | {\n action: () => void;\n oldSwitchValue: boolean;\n };\ninterface SkillDetailProps {\n title: string;\n icon: {name: string; color: string};\n skillRef: string;\n description?: string;\n metrics?: Metrics;\n focused?: boolean;\n availableForReview?: boolean;\n ongoingCoursesAvailable?: boolean;\n skillIncludedCourses: CardsGridProps;\n filters: {\n onChange?: () => void;\n options?: unknown[];\n };\n onBackClick?: () => void;\n onReviewClick?: () => void;\n onContinueLearningClick?: () => void;\n search: {\n oldValue: string;\n onChange: () => void;\n };\n bannerMicrolearning?: BannerMicrolearning;\n}\nconst SkillDetail = (props: SkillDetailProps, context: ProviderContext) => {\n const {\n title,\n icon: {color: iconColor, name: iconName},\n skillRef,\n description,\n metrics = {},\n focused,\n availableForReview,\n ongoingCoursesAvailable,\n skillIncludedCourses,\n filters,\n onBackClick,\n onReviewClick,\n onContinueLearningClick,\n search,\n bannerMicrolearning\n } = props;\n\n const {score = 0, questionsToReview = 0, totalContents = 0} = metrics;\n const {translate} = context;\n const bannerMicrolearningAction = bannerMicrolearning?.action;\n const descriptionRef = useRef(null);\n const [isDescriptionTruncated, setIsDescriptionTruncated] = useState(false);\n const [showMore, setShowMore] = useState(false);\n\n const handleShowMore = useCallback(() => {\n setShowMore(!showMore);\n }, [showMore]);\n\n useEffect(() => {\n if (descriptionRef.current) {\n const {clientHeight = 0, scrollHeight = 0} = descriptionRef.current;\n setIsDescriptionTruncated(scrollHeight > clientHeight);\n }\n }, [description]);\n\n const Description = useCallback(() => {\n return (\n <div\n ref={descriptionRef}\n data-testid=\"skill-description\"\n className={classnames(style.description, !showMore && style.truncate)}\n >\n {description ? <Markdown>{description}</Markdown> : null}\n </div>\n );\n }, [showMore, description]);\n\n const ProgressBar = useCallback(() => {\n if (typeof score !== 'number') return null;\n\n const progressBarColor = COLORS.cm_positive_500;\n const inlineProgressStyle = {\n backgroundColor: progressBarColor,\n width: `${score}%`\n };\n\n return (\n <div className={style.progressBarRow}>\n <div className={style.progressBarWrapper}>\n <div\n data-name=\"progress\"\n className={style.progress}\n style={inlineProgressStyle}\n role=\"progressbar\"\n aria-valuenow={score}\n aria-valuemin={0}\n aria-valuemax={100}\n />\n </div>\n <span className={style.progressInformationNumber}>{score.toFixed(1)}%</span>\n </div>\n );\n }, [score]);\n const hasDescription = Boolean(description && description.trim().length > 0);\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={skillRef}>\n {/* Top section for the back arrow (optional) */}\n <div className={style.topSection}>\n {!isNil(onBackClick) ? (\n <ButtonLinkIcon\n faIcon=\"arrow-left\"\n data-name=\"back-button\"\n aria-label={translate('back')}\n onClick={onBackClick}\n className={style.backButton}\n tooltipPlacement=\"right\"\n />\n ) : null}\n </div>\n\n {/* Main section: icon on the left, skill info on the right */}\n <div className={style.mainSection}>\n <div className={style.leftSide}>\n <IconPreview\n icon={{\n name: iconName,\n color: iconColor\n }}\n title={title}\n customStyle={{gap: 24, padding: '50px 49px 50px 50px'}}\n />\n </div>\n <div className={style.rightSide}>\n {focused ? (\n <div className={style.skillFocusBadge}>\n <Icon\n iconName=\"bullseye-arrow\"\n backgroundColor={COLORS.purple_100}\n size={{faSize: 10, wrapperSize: 16}}\n />\n {translate('skill_focus')}\n </div>\n ) : (\n <div className={style.skillBadge}>\n <Icon\n iconName=\"shapes\"\n backgroundColor={COLORS.cm_grey_100}\n size={{faSize: 10, wrapperSize: 16}}\n />\n {translate('skill')}\n </div>\n )}\n\n <h2 className={style.title}>{title}</h2>\n\n {description && (\n <>\n <Description />\n {isDescriptionTruncated ? (\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={{faSize: 14, wrapperSize: 14}}\n customStyle={{padding: '8px'}}\n />\n </div>\n ) : null}\n </>\n )}\n\n {questionsToReview > 0 ? (\n <div className={style.skillInformation}>\n <span>{questionsToReview}</span>\n {translate('skill_chart_side_panel_questions_to_review')}\n </div>\n ) : null}\n\n <div\n className={classnames(\n style.progressContainer,\n !hasDescription && style.noDescriptionSpacing\n )}\n >\n <ProgressBar />\n </div>\n\n <div className={style.ctaWrapper}>\n <ContinueLearningButton\n ongoingCoursesAvailable={ongoingCoursesAvailable}\n onClick={onContinueLearningClick}\n />\n <ButtonLink\n type=\"secondary\"\n label={translate('review_this_skill')}\n disabled={!availableForReview}\n onClick={onReviewClick}\n icon={{\n position: 'left',\n faIcon: {\n name: 'rotate-right',\n color: COLORS.cm_grey_700,\n size: 14\n }\n }}\n customStyle={{borderRadius: '12px', width: 'fit-content'}}\n />\n </div>\n </div>\n </div>\n\n {/* Courses section below */}\n <AllCourses\n content={skillIncludedCourses}\n filters={filters}\n totalContents={totalContents}\n bannerMicrolearning={\n bannerMicrolearning && bannerMicrolearningAction\n ? {\n type: 'skill',\n action: bannerMicrolearningAction,\n oldSwitchValue: bannerMicrolearning.oldSwitchValue\n }\n : undefined\n }\n search={search}\n />\n </div>\n </div>\n );\n};\n\nSkillDetail.contextTypes = {\n translate: Provider.childContextTypes.translate,\n skin: Provider.childContextTypes.skin\n};\n\nSkillDetail.propTypes = {\n title: PropTypes.string.isRequired,\n icon: PropTypes.shape({\n name: PropTypes.string,\n color: PropTypes.string\n }).isRequired,\n skillRef: PropTypes.string.isRequired,\n description: PropTypes.string,\n metrics: PropTypes.shape({\n score: PropTypes.number,\n questionsToReview: PropTypes.number,\n totalContents: PropTypes.number\n }),\n focused: PropTypes.bool,\n availableForReview: PropTypes.bool,\n ongoingCoursesAvailable: PropTypes.bool,\n skillIncludedCourses: PropTypes.shape(CardsGrid.propTypes),\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n onBackClick: PropTypes.func,\n onReviewClick: PropTypes.func,\n onContinueLearningClick: PropTypes.func,\n search: PropTypes.shape({\n oldValue: PropTypes.string,\n onChange: PropTypes.func\n }),\n bannerMicrolearning: PropTypes.shape({\n action: PropTypes.func,\n oldSwitchValue: PropTypes.bool\n })\n};\n\nexport default SkillDetail;\n"],"mappings":";;AAAA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,SAAS,QAAO,OAAO;AACrE,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,OAAOC,QAAQ,MAAM,iBAAiB;AACtC,SAAQC,OAAO,QAAO,oBAAoB;AAC1C,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,OAAOC,cAAc,MAAM,6BAA6B;AACxD,OAAOC,IAAI,MAAM,iBAAiB;AAClC,OAAOC,WAAW,MAAM,6BAA6B;AACrD,OAAOC,UAAU,MAAM,wBAAwB;AAC/C,OAAOC,SAAS,MAAwB,2BAA2B;AACnE,SAAQC,MAAM,QAAO,wBAAwB;AAC7C,SAAQC,qBAAqB,QAAO,mBAAmB;AACvD,OAAOC,UAAU,MAAM,eAAe;AACtC,OAAOC,KAAK,MAAM,aAAa;AAgB/B,OAAO,MAAMC,sBAAsB,GAAGA,CACpCC,KAAkC,EAClCC,OAAwB,KACrB;EACH,MAAM;IAACC,uBAAuB;IAAEC;EAAO,CAAC,GAAGH,KAAK;EAChD,MAAM;IAACI,IAAI;IAAEC;EAAS,CAAC,GAAGJ,OAAO;EACjC,MAAMK,gBAAgB,GAAGC,IAAA,CAAI,gBAAgB,EAAEH,IAAI,CAAC;EAEpD,oBACExB,KAAA,CAAA4B,aAAA,CAACf,UAAU;IACTgB,KAAK,EAAEP,uBAAuB,GAAGG,SAAS,CAAC,mBAAmB,CAAC,GAAGA,SAAS,CAAC,gBAAgB,CAAE;IAC9FK,IAAI,EAAC,SAAS;IACdC,WAAW,EAAE;MACXC,KAAK,EAAE,aAAa;MACpBC,YAAY,EAAE,MAAM;MACpBC,eAAe,EAAER;IACnB,CAAE;IACF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|
max-width: calc(1080px + 40px);
|
|
33
34
|
}
|
|
@@ -43,8 +44,10 @@
|
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
.leftSide {
|
|
46
|
-
width: 420px;
|
|
47
|
-
height: 280px;
|
|
47
|
+
max-width: 420px;
|
|
48
|
+
max-height: 280px;
|
|
49
|
+
height: 100%;
|
|
50
|
+
width: 100%;
|
|
48
51
|
display: flex;
|
|
49
52
|
flex-direction: column;
|
|
50
53
|
gap: 16px;
|
|
@@ -52,7 +55,6 @@
|
|
|
52
55
|
|
|
53
56
|
.rightSide {
|
|
54
57
|
max-width: 100%;
|
|
55
|
-
height: 280px;
|
|
56
58
|
display: flex;
|
|
57
59
|
gap: 8px;
|
|
58
60
|
flex-direction: column;
|
|
@@ -121,6 +123,9 @@
|
|
|
121
123
|
flex: 1 0 0;
|
|
122
124
|
align-self: stretch;
|
|
123
125
|
color: cm_grey_400;
|
|
126
|
+
display: block;
|
|
127
|
+
white-space: nowrap;
|
|
128
|
+
height: 100%;
|
|
124
129
|
}
|
|
125
130
|
|
|
126
131
|
.truncate {
|
|
@@ -129,6 +134,7 @@
|
|
|
129
134
|
-webkit-box-orient: vertical;
|
|
130
135
|
overflow: hidden;
|
|
131
136
|
text-overflow: ellipsis;
|
|
137
|
+
min-height: 40px;
|
|
132
138
|
}
|
|
133
139
|
|
|
134
140
|
.skillInformation {
|
|
@@ -183,6 +189,12 @@
|
|
|
183
189
|
}
|
|
184
190
|
|
|
185
191
|
@media tablet {
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
.container {
|
|
195
|
+
margin: 16px auto;
|
|
196
|
+
}
|
|
197
|
+
|
|
186
198
|
.topSection {
|
|
187
199
|
flex-direction: row;
|
|
188
200
|
align-items: flex-start;
|
|
@@ -201,13 +213,16 @@
|
|
|
201
213
|
.progressContainer {
|
|
202
214
|
width: 100%;
|
|
203
215
|
}
|
|
216
|
+
|
|
204
217
|
.progressBarRow {
|
|
205
218
|
width: 100%;
|
|
206
219
|
}
|
|
207
220
|
|
|
208
221
|
.leftSide {
|
|
209
|
-
width: 343px;
|
|
210
|
-
height: 228px;
|
|
222
|
+
max-width: 343px;
|
|
223
|
+
max-height: 228px;
|
|
224
|
+
height: 100%;
|
|
225
|
+
width: 100%;
|
|
211
226
|
display: flex;
|
|
212
227
|
flex-direction: column;
|
|
213
228
|
align-items: flex-start;
|
|
@@ -218,7 +233,6 @@
|
|
|
218
233
|
}
|
|
219
234
|
|
|
220
235
|
.rightSide {
|
|
221
|
-
max-width: 100%;
|
|
222
236
|
width: 100%;
|
|
223
237
|
height: auto;
|
|
224
238
|
display: flex;
|
|
@@ -240,11 +254,24 @@
|
|
|
240
254
|
font-size: 16px;
|
|
241
255
|
text-align: left;
|
|
242
256
|
/* margin-bottom: 12px; */
|
|
243
|
-
line-height: 20px;
|
|
257
|
+
/* line-height: 20px; */
|
|
244
258
|
max-width: 100%;
|
|
245
|
-
min-height: 40px;
|
|
246
259
|
}
|
|
247
260
|
|
|
261
|
+
|
|
262
|
+
/* .description {
|
|
263
|
+
max-width: 620px;
|
|
264
|
+
font-size: 14px;
|
|
265
|
+
font-weight: 500;
|
|
266
|
+
line-height: 20px;
|
|
267
|
+
flex: 1 0 0;
|
|
268
|
+
align-self: stretch;
|
|
269
|
+
color: cm_grey_400;
|
|
270
|
+
display: block;
|
|
271
|
+
white-space: nowrap;
|
|
272
|
+
height: 100%;
|
|
273
|
+
} */
|
|
274
|
+
|
|
248
275
|
.ctaWrapper {
|
|
249
276
|
flex-direction: row;
|
|
250
277
|
gap: 16px;
|
|
@@ -262,6 +289,11 @@
|
|
|
262
289
|
|
|
263
290
|
|
|
264
291
|
@media mobile {
|
|
292
|
+
|
|
293
|
+
.container {
|
|
294
|
+
margin: 16px auto;
|
|
295
|
+
}
|
|
296
|
+
|
|
265
297
|
.topSection {
|
|
266
298
|
flex-direction: row;
|
|
267
299
|
align-items: center;
|
|
@@ -271,6 +303,8 @@
|
|
|
271
303
|
.leftSide {
|
|
272
304
|
border-radius: 16px;
|
|
273
305
|
padding: 16px 32px 32px 0px;
|
|
306
|
+
height: 100%;
|
|
307
|
+
width: 100%;
|
|
274
308
|
}
|
|
275
309
|
|
|
276
310
|
.backButton {
|
|
@@ -74,7 +74,7 @@ const ButtonLink = props => {
|
|
|
74
74
|
customStyle,
|
|
75
75
|
useTitle = true
|
|
76
76
|
} = props;
|
|
77
|
-
const styleButton = (0, _classnames.default)(className, _style.default.button, !label && _style.default.iconButton, type === 'primary' && _style.default.primary, type === 'secondary' && _style.default.secondary, type === 'tertiary' && _style.default.tertiary, type === 'text' && _style.default.text, type === 'dangerous' && _style.default.dangerous,
|
|
77
|
+
const styleButton = (0, _classnames.default)(link && _style.default.link, className, _style.default.button, !label && _style.default.iconButton, type === 'primary' && _style.default.primary, type === 'secondary' && _style.default.secondary, type === 'tertiary' && _style.default.tertiary, type === 'text' && _style.default.text, type === 'dangerous' && _style.default.dangerous, disabled && _style.default.disabled);
|
|
78
78
|
const [hovered, setHovered] = (0, _react.useState)(false);
|
|
79
79
|
const handleOnClick = (0, _react.useCallback)(event => onClick(event), [onClick]);
|
|
80
80
|
const handleOnKeyDown = (0, _react.useCallback)(event => onKeyDown(event), [onKeyDown]);
|
|
@@ -110,8 +110,8 @@ const ButtonLink = props => {
|
|
|
110
110
|
return /*#__PURE__*/_react.default.createElement(_link.default, _extends({}, link, useTitle && {
|
|
111
111
|
title: ariaLabel || label
|
|
112
112
|
}, {
|
|
113
|
-
style: customStyle,
|
|
114
113
|
className: styleButton,
|
|
114
|
+
style: customStyle,
|
|
115
115
|
"data-name": dataName,
|
|
116
116
|
"data-testid": dataTestId,
|
|
117
117
|
"aria-label": ariaLabel || label,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_classnames","_interopRequireDefault","_link","_icon","_buttonIcons","_tooltip","_types","_style","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","getButtonContent","icon","content","hovered","hoverBackgroundColor","hoverColor","type","faIcon","position","Icon","ICONS","createElement","className","style","buttonContent","label","iconComponent","iconName","name","iconColor","color","DEFAULT_ICON_COLOR","backgroundColor","size","faSize","wrapperSize","customStyle","theme","ButtonLink","props","usage","disabled","dataName","dataTestId","ariaLabel","tooltipText","tooltipPlacement","link","onClick","_noop2","onKeyDown","useTitle","styleButton","classnames","button","iconButton","primary","secondary","tertiary","text","dangerous","setHovered","useState","handleOnClick","useCallback","event","handleOnKeyDown","handleMouseOver","handleMouseLeave","TooltipContent","tooltipContentWrapper","renderToolTip","closeToolTipInformationTextAriaLabel","fontSize","anchorId","toolTipIsVisible","placement","_customStyle","useMemo","title","onMouseEnter","onMouseLeave","onMouseOver","tabIndex","propTypes","process","env","NODE_ENV","_default","exports"],"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, {DEFAULT_ICON_COLOR, IconProps} from '../icon';\nimport {ICONS} from '../../util/button-icons';\nimport ToolTip from '../tooltip';\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\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: hovered && hoverColor ? hoverColor : faIcon.color ?? DEFAULT_ICON_COLOR,\n // eslint-disable-next-line no-nested-ternary\n backgroundColor: !faIcon?.backgroundColor\n ? null\n : hovered && hoverBackgroundColor\n ? hoverBackgroundColor\n : faIcon.backgroundColor,\n size: {\n faSize: faIcon.size,\n wrapperSize: faIcon.size\n },\n customStyle: faIcon.customStyle\n } as IconProps)}\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 tooltipText,\n tooltipPlacement = 'left',\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 !label && style.iconButton,\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(() => {\n setHovered(true);\n }, [setHovered]);\n\n const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);\n\n const TooltipContent = useCallback(\n () => <span className={style.tooltipContentWrapper}>{tooltipText || ariaLabel}</span>,\n [tooltipText, ariaLabel]\n );\n\n const renderToolTip = () => {\n const closeToolTipInformationTextAriaLabel = tooltipText || ariaLabel;\n if (!closeToolTipInformationTextAriaLabel) return null;\n return (\n <ToolTip\n fontSize={12}\n anchorId=\"button-icon\"\n toolTipIsVisible={hovered}\n placement={tooltipPlacement}\n TooltipContent={TooltipContent}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n />\n );\n };\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 hoverColor={hoverColor}\n hoverBackgroundColor={hoverBackgroundColor}\n onMouseEnter={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n >\n {getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor)}\n {renderToolTip()}\n </Link>\n );\n }\n\n return (\n <button\n {...(useTitle && {\n title: ariaLabel || label\n })}\n {...(ariaLabel && !label\n ? {\n 'data-for': 'button-icon',\n 'data-tip': hovered\n }\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 {renderToolTip()}\n </button>\n );\n};\n\nButtonLink.propTypes = propTypes;\n\nexport default ButtonLink;\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,KAAA,GAAAL,uBAAA,CAAAC,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,MAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,I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,EAAEC,oBAAoB,EAAEC,UAAU,CAAC,EACnFwD,aAAa,CAAC,CACX,CAAC;EAEX;EAEA,oBACElG,MAAA,CAAAiB,OAAA,CAAA+B,aAAA,WAAAjB,QAAA,KACO+C,QAAQ,IAAI;IACf4B,KAAK,EAAEnC,SAAS,IAAInB;EACtB,CAAC,EACImB,SAAS,IAAI,CAACnB,KAAK,GACpB;IACE,UAAU,EAAE,aAAa;IACzB,UAAU,EAAEZ;EACd,CAAC,GACD,CAAC,CAAC;IACN;IACAG,IAAI,EAAEwB,KAAM;IACZ,cAAYI,SAAS,IAAInB,KAAM;IAC/B,aAAWiB,QAAS;IACpB,eAAaC,UAAW;IACxBpB,KAAK,EAAEsD,YAAa;IACpBvD,SAAS,EAAE8B,WAAY;IACvBJ,OAAO,EAAEe,aAAc;IACvBb,SAAS,EAAEgB,eAAgB;IAC3BgB,WAAW,EAAEf,eAAgB;IAC7Bc,YAAY,EAAEb,gBAAiB;IAC/Be,QAAQ,EAAE,CAAE;IACZ1C,QAAQ,EAAEA;EAAS,IAElB/B,gBAAgB,CAACC,IAAI,EAAEC,OAAO,IAAIa,KAAK,EAAEZ,OAAO,EAAEC,oBAAoB,EAAEC,UAAU,CAAC,EACnFwD,aAAa,CAAC,CACT,CAAC;AAEb,CAAC;AAEDjC,UAAU,CAAC8C,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGH,cAAS;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAAnG,OAAA,GAElBgD,UAAU","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_classnames","_interopRequireDefault","_link","_icon","_buttonIcons","_tooltip","_types","_style","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","getButtonContent","icon","content","hovered","hoverBackgroundColor","hoverColor","type","faIcon","position","Icon","ICONS","createElement","className","style","buttonContent","label","iconComponent","iconName","name","iconColor","color","DEFAULT_ICON_COLOR","backgroundColor","size","faSize","wrapperSize","customStyle","theme","ButtonLink","props","usage","disabled","dataName","dataTestId","ariaLabel","tooltipText","tooltipPlacement","link","onClick","_noop2","onKeyDown","useTitle","styleButton","classnames","button","iconButton","primary","secondary","tertiary","text","dangerous","setHovered","useState","handleOnClick","useCallback","event","handleOnKeyDown","handleMouseOver","handleMouseLeave","TooltipContent","tooltipContentWrapper","renderToolTip","closeToolTipInformationTextAriaLabel","fontSize","anchorId","toolTipIsVisible","placement","_customStyle","useMemo","title","onMouseEnter","onMouseLeave","onMouseOver","tabIndex","propTypes","process","env","NODE_ENV","_default","exports"],"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, {DEFAULT_ICON_COLOR, IconProps} from '../icon';\nimport {ICONS} from '../../util/button-icons';\nimport ToolTip from '../tooltip';\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\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: hovered && hoverColor ? hoverColor : faIcon.color ?? DEFAULT_ICON_COLOR,\n // eslint-disable-next-line no-nested-ternary\n backgroundColor: !faIcon?.backgroundColor\n ? null\n : hovered && hoverBackgroundColor\n ? hoverBackgroundColor\n : faIcon.backgroundColor,\n size: {\n faSize: faIcon.size,\n wrapperSize: faIcon.size\n },\n customStyle: faIcon.customStyle\n } as IconProps)}\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 tooltipText,\n tooltipPlacement = 'left',\n link,\n onClick = noop,\n onKeyDown = noop,\n className,\n customStyle,\n useTitle = true\n } = props;\n const styleButton = classnames(\n link && style.link,\n className,\n style.button,\n !label && style.iconButton,\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 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(() => {\n setHovered(true);\n }, [setHovered]);\n\n const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);\n\n const TooltipContent = useCallback(\n () => <span className={style.tooltipContentWrapper}>{tooltipText || ariaLabel}</span>,\n [tooltipText, ariaLabel]\n );\n\n const renderToolTip = () => {\n const closeToolTipInformationTextAriaLabel = tooltipText || ariaLabel;\n if (!closeToolTipInformationTextAriaLabel) return null;\n return (\n <ToolTip\n fontSize={12}\n anchorId=\"button-icon\"\n toolTipIsVisible={hovered}\n placement={tooltipPlacement}\n TooltipContent={TooltipContent}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n />\n );\n };\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 className={styleButton}\n style={customStyle}\n data-name={dataName}\n data-testid={dataTestId}\n aria-label={ariaLabel || label}\n hoverColor={hoverColor}\n hoverBackgroundColor={hoverBackgroundColor}\n onMouseEnter={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n >\n {getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor)}\n {renderToolTip()}\n </Link>\n );\n }\n\n return (\n <button\n {...(useTitle && {\n title: ariaLabel || label\n })}\n {...(ariaLabel && !label\n ? {\n 'data-for': 'button-icon',\n 'data-tip': hovered\n }\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 {renderToolTip()}\n </button>\n );\n};\n\nButtonLink.propTypes = propTypes;\n\nexport default ButtonLink;\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,KAAA,GAAAL,uBAAA,CAAAC,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,MAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,MAAA,GAAAN,sBAAA,CAAAF,OAAA;AAAgC,SAAAS,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,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AA+B,aAAA,WAAAjB,QAAA,KACO+C,QAAQ,IAAI;IACf4B,KAAK,EAAEnC,SAAS,IAAInB;EACtB,CAAC,EACImB,SAAS,IAAI,CAACnB,KAAK,GACpB;IACE,UAAU,EAAE,aAAa;IACzB,UAAU,EAAEZ;EACd,CAAC,GACD,CAAC,CAAC;IACN;IACAG,IAAI,EAAEwB,KAAM;IACZ,cAAYI,SAAS,IAAInB,KAAM;IAC/B,aAAWiB,QAAS;IACpB,eAAaC,UAAW;IACxBpB,KAAK,EAAEsD,YAAa;IACpBvD,SAAS,EAAE8B,WAAY;IACvBJ,OAAO,EAAEe,aAAc;IACvBb,SAAS,EAAEgB,eAAgB;IAC3BgB,WAAW,EAAEf,eAAgB;IAC7Bc,YAAY,EAAEb,gBAAiB;IAC/Be,QAAQ,EAAE,CAAE;IACZ1C,QAAQ,EAAEA;EAAS,IAElB/B,gBAAgB,CAACC,IAAI,EAAEC,OAAO,IAAIa,KAAK,EAAEZ,OAAO,EAAEC,oBAAoB,EAAEC,UAAU,CAAC,EACnFwD,aAAa,CAAC,CACT,CAAC;AAEb,CAAC;AAEDjC,UAAU,CAAC8C,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGH,cAAS;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAAnG,OAAA,GAElBgD,UAAU","ignoreList":[]}
|
|
@@ -7,7 +7,7 @@ declare const ButtonMenu: {
|
|
|
7
7
|
'data-name': import("prop-types").Requireable<string>;
|
|
8
8
|
disabled: import("prop-types").Requireable<boolean>;
|
|
9
9
|
label: import("prop-types").Validator<string>;
|
|
10
|
-
onClick: import("prop-types").
|
|
10
|
+
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
11
11
|
type: import("prop-types").Requireable<string>;
|
|
12
12
|
buttonLinkType: import("prop-types").Requireable<string>;
|
|
13
13
|
icon: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
@@ -4,7 +4,7 @@ export declare const buttonPropTypes: {
|
|
|
4
4
|
'data-name': PropTypes.Requireable<string>;
|
|
5
5
|
disabled: PropTypes.Requireable<boolean>;
|
|
6
6
|
label: PropTypes.Validator<string>;
|
|
7
|
-
onClick: PropTypes.
|
|
7
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
8
8
|
type: PropTypes.Requireable<string>;
|
|
9
9
|
buttonLinkType: PropTypes.Requireable<string>;
|
|
10
10
|
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -30,7 +30,7 @@ declare const propTypes: {
|
|
|
30
30
|
'data-name': PropTypes.Requireable<string>;
|
|
31
31
|
disabled: PropTypes.Requireable<boolean>;
|
|
32
32
|
label: PropTypes.Validator<string>;
|
|
33
|
-
onClick: PropTypes.
|
|
33
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
34
34
|
type: PropTypes.Requireable<string>;
|
|
35
35
|
buttonLinkType: PropTypes.Requireable<string>;
|
|
36
36
|
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -9,7 +9,7 @@ const buttonPropTypes = exports.buttonPropTypes = {
|
|
|
9
9
|
'data-name': _propTypes.default.string,
|
|
10
10
|
disabled: _propTypes.default.bool,
|
|
11
11
|
label: _propTypes.default.string.isRequired,
|
|
12
|
-
onClick: _propTypes.default.func
|
|
12
|
+
onClick: _propTypes.default.func,
|
|
13
13
|
type: _propTypes.default.oneOf(['default', 'defaultLeft', 'dangerous', 'dangerousLeft']),
|
|
14
14
|
buttonLinkType: _propTypes.default.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),
|
|
15
15
|
icon: _propTypes.default.shape({
|