@coorpacademy/components 11.40.4 → 11.40.6-alpha.5
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 +15 -8
- package/es/atom/button-link/index.d.ts.map +1 -1
- package/es/atom/button-link/index.js +75 -37
- package/es/atom/button-link/index.js.map +1 -1
- package/es/atom/button-link/types.d.ts +20 -14
- package/es/atom/button-link/types.d.ts.map +1 -1
- package/es/atom/button-link/types.js +4 -3
- package/es/atom/button-link/types.js.map +1 -1
- package/es/atom/button-menu/index.d.ts +1 -3
- package/es/atom/button-menu/index.d.ts.map +1 -1
- package/es/atom/button-menu/index.js +1 -7
- package/es/atom/button-menu/index.js.map +1 -1
- package/es/atom/button-menu/types.d.ts +2 -6
- package/es/atom/button-menu/types.d.ts.map +1 -1
- package/es/atom/chip/index.d.ts +4 -0
- package/es/atom/chip/index.d.ts.map +1 -1
- package/es/atom/chip/index.js +12 -6
- package/es/atom/chip/index.js.map +1 -1
- package/es/atom/input-switch/index.d.ts.map +1 -1
- package/es/atom/input-switch/index.js +2 -1
- package/es/atom/input-switch/index.js.map +1 -1
- package/es/atom/input-switch/style.css +4 -1
- package/es/atom/radio-with-title/index.d.ts +16 -8
- package/es/atom/radio-with-title/index.d.ts.map +1 -1
- package/es/atom/radio-with-title/types.d.ts +16 -8
- package/es/atom/radio-with-title/types.d.ts.map +1 -1
- package/es/atom/title/index.d.ts +16 -8
- package/es/atom/title/index.d.ts.map +1 -1
- package/es/atom/title/index.js +5 -2
- package/es/atom/title/index.js.map +1 -1
- package/es/molecule/base-modal/index.d.ts +1 -0
- package/es/molecule/base-modal/index.d.ts.map +1 -1
- package/es/molecule/base-modal/index.js +6 -2
- package/es/molecule/base-modal/index.js.map +1 -1
- package/es/molecule/base-modal/style.css +5 -0
- package/es/molecule/bullet-point-menu-button/index.d.ts +1 -3
- package/es/molecule/bullet-point-menu-button/index.d.ts.map +1 -1
- package/es/molecule/bullet-point-menu-button/types.d.ts +1 -3
- package/es/molecule/bullet-point-menu-button/types.d.ts.map +1 -1
- package/es/molecule/button-menu-action/index.d.ts +19 -11
- package/es/molecule/button-menu-action/index.d.ts.map +1 -1
- package/es/molecule/button-menu-action/index.js +27 -3
- package/es/molecule/button-menu-action/index.js.map +1 -1
- package/es/molecule/button-menu-action/types.d.ts +22 -12
- package/es/molecule/button-menu-action/types.d.ts.map +1 -1
- package/es/molecule/button-menu-action/types.js +7 -2
- package/es/molecule/button-menu-action/types.js.map +1 -1
- package/es/molecule/cm-popin/types.d.ts +135 -85
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/expandible-actionable-table/index.d.ts +17 -14
- package/es/molecule/expandible-actionable-table/index.d.ts.map +1 -1
- package/es/molecule/expandible-actionable-table/types.d.ts +17 -14
- package/es/molecule/expandible-actionable-table/types.d.ts.map +1 -1
- package/es/molecule/icon-picker-modal/index.d.ts +1 -2
- package/es/molecule/icon-picker-modal/index.d.ts.map +1 -1
- package/es/molecule/icon-picker-modal/index.js +16 -43
- package/es/molecule/icon-picker-modal/index.js.map +1 -1
- package/es/molecule/multi-filter-panel/index.d.ts +19 -0
- package/es/molecule/multi-filter-panel/index.d.ts.map +1 -1
- package/es/molecule/multi-filter-panel/index.js +39 -10
- package/es/molecule/multi-filter-panel/index.js.map +1 -1
- package/es/molecule/multi-filter-panel/prop-types.d.ts +26 -1
- package/es/molecule/multi-filter-panel/prop-types.d.ts.map +1 -1
- package/es/molecule/multi-filter-panel/prop-types.js +5 -0
- package/es/molecule/multi-filter-panel/prop-types.js.map +1 -1
- package/es/molecule/multi-filter-panel/style.css +8 -0
- package/es/molecule/quick-filters/index.d.ts +15 -8
- package/es/molecule/quick-filters/index.d.ts.map +1 -1
- package/es/molecule/quick-filters/types.d.ts +15 -8
- package/es/molecule/quick-filters/types.d.ts.map +1 -1
- package/es/molecule/title-and-checkbox-wrapper/index.d.ts +16 -8
- package/es/molecule/title-radio-wrapper/index.d.ts +16 -8
- package/es/molecule/title-radio-wrapper/index.d.ts.map +1 -1
- package/es/molecule/title-radio-wrapper/types.d.ts +16 -8
- package/es/molecule/title-radio-wrapper/types.d.ts.map +1 -1
- package/es/organism/content-skill-modal/index.d.ts +135 -68
- package/es/organism/content-skill-modal/index.d.ts.map +1 -1
- package/es/organism/content-skill-modal/types.d.ts +135 -68
- package/es/organism/content-skill-modal/types.d.ts.map +1 -1
- package/es/organism/filter-checkbox-and-search/index.d.ts +1 -0
- package/es/organism/filter-checkbox-and-search/index.d.ts.map +1 -1
- package/es/organism/filter-checkbox-and-search/index.js +5 -2
- package/es/organism/filter-checkbox-and-search/index.js.map +1 -1
- package/es/organism/filter-checkbox-and-search/props-types.d.ts +2 -0
- package/es/organism/filter-checkbox-and-search/props-types.d.ts.map +1 -1
- package/es/organism/filter-checkbox-and-search/props-types.js +1 -0
- package/es/organism/filter-checkbox-and-search/props-types.js.map +1 -1
- package/es/organism/filter-checkbox-and-search/style.css +2 -0
- package/es/organism/filter-chip/index.d.ts +3 -0
- package/es/organism/filter-chip/index.d.ts.map +1 -1
- package/es/organism/filter-chip/index.js +12 -4
- package/es/organism/filter-chip/index.js.map +1 -1
- package/es/organism/filter-chip/prop-types.d.ts +14 -7
- package/es/organism/filter-chip/prop-types.d.ts.map +1 -1
- package/es/organism/filter-chip/prop-types.js +3 -0
- package/es/organism/filter-chip/prop-types.js.map +1 -1
- package/es/organism/filter-switch/index.d.ts +23 -0
- package/es/organism/filter-switch/index.d.ts.map +1 -0
- package/es/organism/filter-switch/index.js +76 -0
- package/es/organism/filter-switch/index.js.map +1 -0
- package/es/organism/filter-switch/prop-types.d.ts +28 -0
- package/es/organism/filter-switch/prop-types.d.ts.map +1 -0
- package/es/organism/filter-switch/prop-types.js +15 -0
- package/es/organism/filter-switch/prop-types.js.map +1 -0
- package/es/organism/filter-switch/style.css +46 -0
- package/es/organism/icon-editor/index.d.ts +15 -8
- package/es/organism/icon-editor/index.d.ts.map +1 -1
- package/es/organism/icon-editor/types.d.ts +15 -8
- package/es/organism/icon-editor/types.d.ts.map +1 -1
- package/es/organism/list-items/index.d.ts +116 -68
- package/es/organism/rewards-form/index.d.ts +16 -8
- package/es/organism/select-opponents/index.d.ts +16 -8
- package/es/organism/select-opponents/index.d.ts.map +1 -1
- package/es/organism/select-opponents/types.d.ts +16 -8
- package/es/organism/select-opponents/types.d.ts.map +1 -1
- package/es/organism/setup-header/index.d.ts +60 -32
- package/es/organism/title-and-input/index.d.ts +47 -24
- package/es/organism/title-and-input/index.d.ts.map +1 -1
- package/es/organism/title-and-input/types.d.ts +47 -24
- package/es/organism/title-and-input/types.d.ts.map +1 -1
- package/es/organism/wizard-contents/index.d.ts +63 -38
- package/es/template/app-player/loading/index.d.ts +135 -85
- package/es/template/app-player/player/index.d.ts +278 -170
- package/es/template/app-player/player/slides/header/index.d.ts +8 -0
- package/es/template/app-player/player/slides/header/index.d.ts.map +1 -1
- package/es/template/app-player/player/slides/header/index.js +89 -3
- package/es/template/app-player/player/slides/header/index.js.map +1 -1
- package/es/template/app-player/player/slides/header/style.css +1 -1
- package/es/template/app-player/player/slides/index.d.ts +143 -85
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +135 -85
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +143 -85
- package/es/template/app-review/index.d.ts +135 -85
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +135 -85
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.d.ts +135 -85
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/back-office/brand-create/index.d.ts +60 -32
- package/es/template/back-office/brand-create/index.d.ts.map +1 -1
- package/es/template/back-office/brand-list/index.d.ts +60 -32
- package/es/template/back-office/brand-list/index.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +599 -298
- package/es/template/back-office/dashboard-preview/index.d.ts +60 -32
- package/es/template/back-office/layout/index.d.ts +60 -32
- package/es/template/back-office/layout/index.d.ts.map +1 -1
- package/es/template/common/dashboard/index.d.ts +270 -170
- package/es/template/common/search-page/index.d.ts +135 -85
- package/es/template/external-course/index.d.ts +135 -85
- package/es/variables/colors.d.ts +1 -0
- package/es/variables/colors.d.ts.map +1 -1
- package/es/variables/colors.js +1 -0
- package/es/variables/colors.js.map +1 -1
- package/lib/atom/button-link/index.d.ts +15 -8
- package/lib/atom/button-link/index.d.ts.map +1 -1
- package/lib/atom/button-link/index.js +75 -37
- package/lib/atom/button-link/index.js.map +1 -1
- package/lib/atom/button-link/types.d.ts +20 -14
- package/lib/atom/button-link/types.d.ts.map +1 -1
- package/lib/atom/button-link/types.js +4 -3
- package/lib/atom/button-link/types.js.map +1 -1
- package/lib/atom/button-menu/index.d.ts +1 -3
- package/lib/atom/button-menu/index.d.ts.map +1 -1
- package/lib/atom/button-menu/index.js +1 -7
- package/lib/atom/button-menu/index.js.map +1 -1
- package/lib/atom/button-menu/types.d.ts +2 -6
- package/lib/atom/button-menu/types.d.ts.map +1 -1
- package/lib/atom/chip/index.d.ts +4 -0
- package/lib/atom/chip/index.d.ts.map +1 -1
- package/lib/atom/chip/index.js +12 -6
- package/lib/atom/chip/index.js.map +1 -1
- package/lib/atom/input-switch/index.d.ts.map +1 -1
- package/lib/atom/input-switch/index.js +2 -1
- package/lib/atom/input-switch/index.js.map +1 -1
- package/lib/atom/input-switch/style.css +4 -1
- package/lib/atom/radio-with-title/index.d.ts +16 -8
- package/lib/atom/radio-with-title/index.d.ts.map +1 -1
- package/lib/atom/radio-with-title/types.d.ts +16 -8
- package/lib/atom/radio-with-title/types.d.ts.map +1 -1
- package/lib/atom/title/index.d.ts +16 -8
- package/lib/atom/title/index.d.ts.map +1 -1
- package/lib/atom/title/index.js +5 -2
- package/lib/atom/title/index.js.map +1 -1
- package/lib/molecule/base-modal/index.d.ts +1 -0
- package/lib/molecule/base-modal/index.d.ts.map +1 -1
- package/lib/molecule/base-modal/index.js +6 -2
- package/lib/molecule/base-modal/index.js.map +1 -1
- package/lib/molecule/base-modal/style.css +5 -0
- package/lib/molecule/bullet-point-menu-button/index.d.ts +1 -3
- package/lib/molecule/bullet-point-menu-button/index.d.ts.map +1 -1
- package/lib/molecule/bullet-point-menu-button/types.d.ts +1 -3
- package/lib/molecule/bullet-point-menu-button/types.d.ts.map +1 -1
- package/lib/molecule/button-menu-action/index.d.ts +19 -11
- package/lib/molecule/button-menu-action/index.d.ts.map +1 -1
- package/lib/molecule/button-menu-action/index.js +26 -2
- package/lib/molecule/button-menu-action/index.js.map +1 -1
- package/lib/molecule/button-menu-action/types.d.ts +22 -12
- package/lib/molecule/button-menu-action/types.d.ts.map +1 -1
- package/lib/molecule/button-menu-action/types.js +7 -2
- package/lib/molecule/button-menu-action/types.js.map +1 -1
- package/lib/molecule/cm-popin/types.d.ts +135 -85
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/expandible-actionable-table/index.d.ts +17 -14
- package/lib/molecule/expandible-actionable-table/index.d.ts.map +1 -1
- package/lib/molecule/expandible-actionable-table/types.d.ts +17 -14
- package/lib/molecule/expandible-actionable-table/types.d.ts.map +1 -1
- package/lib/molecule/icon-picker-modal/index.d.ts +1 -2
- package/lib/molecule/icon-picker-modal/index.d.ts.map +1 -1
- package/lib/molecule/icon-picker-modal/index.js +16 -43
- package/lib/molecule/icon-picker-modal/index.js.map +1 -1
- package/lib/molecule/multi-filter-panel/index.d.ts +19 -0
- package/lib/molecule/multi-filter-panel/index.d.ts.map +1 -1
- package/lib/molecule/multi-filter-panel/index.js +39 -9
- package/lib/molecule/multi-filter-panel/index.js.map +1 -1
- package/lib/molecule/multi-filter-panel/prop-types.d.ts +26 -1
- package/lib/molecule/multi-filter-panel/prop-types.d.ts.map +1 -1
- package/lib/molecule/multi-filter-panel/prop-types.js +5 -0
- package/lib/molecule/multi-filter-panel/prop-types.js.map +1 -1
- package/lib/molecule/multi-filter-panel/style.css +8 -0
- package/lib/molecule/quick-filters/index.d.ts +15 -8
- package/lib/molecule/quick-filters/index.d.ts.map +1 -1
- package/lib/molecule/quick-filters/types.d.ts +15 -8
- package/lib/molecule/quick-filters/types.d.ts.map +1 -1
- package/lib/molecule/title-and-checkbox-wrapper/index.d.ts +16 -8
- package/lib/molecule/title-radio-wrapper/index.d.ts +16 -8
- package/lib/molecule/title-radio-wrapper/index.d.ts.map +1 -1
- package/lib/molecule/title-radio-wrapper/types.d.ts +16 -8
- package/lib/molecule/title-radio-wrapper/types.d.ts.map +1 -1
- package/lib/organism/content-skill-modal/index.d.ts +135 -68
- package/lib/organism/content-skill-modal/index.d.ts.map +1 -1
- package/lib/organism/content-skill-modal/types.d.ts +135 -68
- package/lib/organism/content-skill-modal/types.d.ts.map +1 -1
- package/lib/organism/filter-checkbox-and-search/index.d.ts +1 -0
- package/lib/organism/filter-checkbox-and-search/index.d.ts.map +1 -1
- package/lib/organism/filter-checkbox-and-search/index.js +5 -2
- package/lib/organism/filter-checkbox-and-search/index.js.map +1 -1
- package/lib/organism/filter-checkbox-and-search/props-types.d.ts +2 -0
- package/lib/organism/filter-checkbox-and-search/props-types.d.ts.map +1 -1
- package/lib/organism/filter-checkbox-and-search/props-types.js +1 -0
- package/lib/organism/filter-checkbox-and-search/props-types.js.map +1 -1
- package/lib/organism/filter-checkbox-and-search/style.css +2 -0
- package/lib/organism/filter-chip/index.d.ts +3 -0
- package/lib/organism/filter-chip/index.d.ts.map +1 -1
- package/lib/organism/filter-chip/index.js +12 -4
- package/lib/organism/filter-chip/index.js.map +1 -1
- package/lib/organism/filter-chip/prop-types.d.ts +14 -7
- package/lib/organism/filter-chip/prop-types.d.ts.map +1 -1
- package/lib/organism/filter-chip/prop-types.js +3 -0
- package/lib/organism/filter-chip/prop-types.js.map +1 -1
- package/lib/organism/filter-switch/index.d.ts +23 -0
- package/lib/organism/filter-switch/index.d.ts.map +1 -0
- package/lib/organism/filter-switch/index.js +83 -0
- package/lib/organism/filter-switch/index.js.map +1 -0
- package/lib/organism/filter-switch/prop-types.d.ts +28 -0
- package/lib/organism/filter-switch/prop-types.d.ts.map +1 -0
- package/lib/organism/filter-switch/prop-types.js +20 -0
- package/lib/organism/filter-switch/prop-types.js.map +1 -0
- package/lib/organism/filter-switch/style.css +46 -0
- package/lib/organism/icon-editor/index.d.ts +15 -8
- package/lib/organism/icon-editor/index.d.ts.map +1 -1
- package/lib/organism/icon-editor/types.d.ts +15 -8
- package/lib/organism/icon-editor/types.d.ts.map +1 -1
- package/lib/organism/list-items/index.d.ts +116 -68
- package/lib/organism/rewards-form/index.d.ts +16 -8
- package/lib/organism/select-opponents/index.d.ts +16 -8
- package/lib/organism/select-opponents/index.d.ts.map +1 -1
- package/lib/organism/select-opponents/types.d.ts +16 -8
- package/lib/organism/select-opponents/types.d.ts.map +1 -1
- package/lib/organism/setup-header/index.d.ts +60 -32
- package/lib/organism/title-and-input/index.d.ts +47 -24
- package/lib/organism/title-and-input/index.d.ts.map +1 -1
- package/lib/organism/title-and-input/types.d.ts +47 -24
- package/lib/organism/title-and-input/types.d.ts.map +1 -1
- package/lib/organism/wizard-contents/index.d.ts +63 -38
- package/lib/template/app-player/loading/index.d.ts +135 -85
- package/lib/template/app-player/player/index.d.ts +278 -170
- package/lib/template/app-player/player/slides/header/index.d.ts +8 -0
- package/lib/template/app-player/player/slides/header/index.d.ts.map +1 -1
- package/lib/template/app-player/player/slides/header/index.js +89 -3
- package/lib/template/app-player/player/slides/header/index.js.map +1 -1
- package/lib/template/app-player/player/slides/header/style.css +1 -1
- package/lib/template/app-player/player/slides/index.d.ts +143 -85
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +135 -85
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +143 -85
- package/lib/template/app-review/index.d.ts +135 -85
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +135 -85
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.d.ts +135 -85
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/back-office/brand-create/index.d.ts +60 -32
- package/lib/template/back-office/brand-create/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-list/index.d.ts +60 -32
- package/lib/template/back-office/brand-list/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +599 -298
- package/lib/template/back-office/dashboard-preview/index.d.ts +60 -32
- package/lib/template/back-office/layout/index.d.ts +60 -32
- package/lib/template/back-office/layout/index.d.ts.map +1 -1
- package/lib/template/common/dashboard/index.d.ts +270 -170
- package/lib/template/common/search-page/index.d.ts +135 -85
- package/lib/template/external-course/index.d.ts +135 -85
- package/lib/variables/colors.d.ts +1 -0
- package/lib/variables/colors.d.ts.map +1 -1
- package/lib/variables/colors.js +1 -0
- package/lib/variables/colors.js.map +1 -1
- package/package.json +2 -2
|
@@ -12,7 +12,7 @@ declare const ButtonLink: {
|
|
|
12
12
|
tooltipPlacement: import("prop-types").Requireable<string>;
|
|
13
13
|
'data-name': import("prop-types").Requireable<string>;
|
|
14
14
|
'data-testid': import("prop-types").Requireable<string>;
|
|
15
|
-
icon: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
15
|
+
icon: import("prop-types").Requireable<NonNullable<import("prop-types").InferProps<{
|
|
16
16
|
position: import("prop-types").Requireable<string>;
|
|
17
17
|
type: import("prop-types").Requireable<string>;
|
|
18
18
|
faIcon: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
@@ -20,11 +20,19 @@ declare const ButtonLink: {
|
|
|
20
20
|
color: import("prop-types").Requireable<string>;
|
|
21
21
|
backgroundColor: import("prop-types").Requireable<string>;
|
|
22
22
|
size: import("prop-types").Requireable<number>;
|
|
23
|
-
customStyle: import("prop-types").Requireable<
|
|
24
|
-
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
25
|
-
}>;
|
|
23
|
+
customStyle: import("prop-types").Requireable<object>;
|
|
26
24
|
}>>;
|
|
27
|
-
}
|
|
25
|
+
}> | (import("prop-types").InferProps<{
|
|
26
|
+
position: import("prop-types").Requireable<string>;
|
|
27
|
+
type: import("prop-types").Requireable<string>;
|
|
28
|
+
faIcon: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
29
|
+
name: import("prop-types").Validator<string>;
|
|
30
|
+
color: import("prop-types").Requireable<string>;
|
|
31
|
+
backgroundColor: import("prop-types").Requireable<string>;
|
|
32
|
+
size: import("prop-types").Requireable<number>;
|
|
33
|
+
customStyle: import("prop-types").Requireable<object>;
|
|
34
|
+
}>>;
|
|
35
|
+
}> | null | undefined)[] | null | undefined>>;
|
|
28
36
|
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
29
37
|
link: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
30
38
|
href: import("prop-types").Requireable<string>;
|
|
@@ -35,9 +43,8 @@ declare const ButtonLink: {
|
|
|
35
43
|
hoverColor: import("prop-types").Requireable<string>;
|
|
36
44
|
disabled: import("prop-types").Requireable<boolean>;
|
|
37
45
|
className: import("prop-types").Requireable<string>;
|
|
38
|
-
customStyle: import("prop-types").Requireable<
|
|
39
|
-
|
|
40
|
-
}>;
|
|
46
|
+
customStyle: import("prop-types").Requireable<object>;
|
|
47
|
+
contentCustomStyle: import("prop-types").Requireable<object>;
|
|
41
48
|
useTitle: import("prop-types").Requireable<boolean>;
|
|
42
49
|
customLabelClassName: import("prop-types").Requireable<string>;
|
|
43
50
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-link/index.tsx"],"names":[],"mappings":";AAQA,OAAkB,EAAC,eAAe,EAAW,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-link/index.tsx"],"names":[],"mappings":";AAQA,OAAkB,EAAC,eAAe,EAAW,MAAM,SAAS,CAAC;AAuG7D,QAAA,MAAM,UAAU;YAAW,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwJzC,CAAC;AAIF,eAAe,UAAU,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _noop from "lodash/fp/noop";
|
|
2
|
+
import _isEmpty from "lodash/fp/isEmpty";
|
|
2
3
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
4
|
import React, { useCallback, useState, useMemo } from 'react';
|
|
4
5
|
import classnames from 'classnames';
|
|
@@ -9,49 +10,85 @@ import ToolTip from '../tooltip';
|
|
|
9
10
|
import Tag from '../tag';
|
|
10
11
|
import propTypes from './types';
|
|
11
12
|
import style from './style.css';
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
21
|
-
const Icon = type && ICONS[type];
|
|
22
|
-
if (!Icon && !faIcon) {
|
|
23
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
24
|
-
className: (style.buttonContent, customLabelClassName)
|
|
25
|
-
}, typeof content === 'string' ? /*#__PURE__*/React.createElement("span", {
|
|
26
|
-
className: (style.label, customLabelClassName)
|
|
27
|
-
// eslint-disable-next-line react/no-danger
|
|
28
|
-
,
|
|
29
|
-
dangerouslySetInnerHTML: {
|
|
30
|
-
__html: content
|
|
31
|
-
}
|
|
32
|
-
}) : /*#__PURE__*/React.createElement("span", {
|
|
33
|
-
className: (style.label, customLabelClassName)
|
|
34
|
-
}, content));
|
|
13
|
+
const renderNoIcons = (content, customClass) => /*#__PURE__*/React.createElement("div", {
|
|
14
|
+
className: classnames(style.buttonContent, customClass)
|
|
15
|
+
}, typeof content === 'string' ? /*#__PURE__*/React.createElement("span", {
|
|
16
|
+
className: classnames(style.label, customClass)
|
|
17
|
+
// eslint-disable-next-line react/no-danger
|
|
18
|
+
,
|
|
19
|
+
dangerouslySetInnerHTML: {
|
|
20
|
+
__html: content
|
|
35
21
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
22
|
+
}) : /*#__PURE__*/React.createElement("span", {
|
|
23
|
+
className: classnames(style.label, customClass)
|
|
24
|
+
}, content));
|
|
25
|
+
const buildFaIcon = (faIcon, hoverOptions) => {
|
|
26
|
+
if (_isEmpty(faIcon)) return null;
|
|
27
|
+
const {
|
|
28
|
+
name,
|
|
29
|
+
size,
|
|
30
|
+
backgroundColor,
|
|
31
|
+
customStyle,
|
|
32
|
+
color
|
|
33
|
+
} = faIcon;
|
|
34
|
+
const {
|
|
35
|
+
hovered,
|
|
36
|
+
hoverBackgroundColor,
|
|
37
|
+
hoverColor
|
|
38
|
+
} = hoverOptions;
|
|
39
|
+
return /*#__PURE__*/React.createElement(FaIcon, {
|
|
40
|
+
iconName: name,
|
|
41
|
+
iconColor: hovered && hoverColor ? hoverColor : color ?? DEFAULT_ICON_COLOR,
|
|
39
42
|
// eslint-disable-next-line no-nested-ternary
|
|
40
|
-
backgroundColor: !
|
|
43
|
+
backgroundColor: !backgroundColor ? null : hovered && hoverBackgroundColor ? hoverBackgroundColor : backgroundColor,
|
|
41
44
|
size: {
|
|
42
|
-
faSize:
|
|
43
|
-
wrapperSize:
|
|
45
|
+
faSize: size,
|
|
46
|
+
wrapperSize: size
|
|
44
47
|
},
|
|
45
|
-
customStyle
|
|
46
|
-
})
|
|
48
|
+
customStyle
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
const renderIcon = (icon, options) => {
|
|
52
|
+
if (_isEmpty(icon)) return null;
|
|
53
|
+
const {
|
|
54
|
+
type,
|
|
55
|
+
faIcon
|
|
56
|
+
} = icon;
|
|
57
|
+
const Icon = type && ICONS[type];
|
|
58
|
+
if (faIcon) return buildFaIcon(faIcon, options);
|
|
59
|
+
if (Icon) return /*#__PURE__*/React.createElement(Icon, {
|
|
47
60
|
className: style.icon,
|
|
48
61
|
theme: "coorpmanager"
|
|
49
62
|
});
|
|
63
|
+
return null;
|
|
64
|
+
};
|
|
65
|
+
const getButtonContent = (icon, content, hovered, hoverBackgroundColor, hoverColor, customLabelClassName, tag, contentCustomStyle) => {
|
|
66
|
+
// eslint-disable-next-line no-nested-ternary
|
|
67
|
+
const iconArr = !_isEmpty(icon) ? Array.isArray(icon) ? icon : [icon] : [];
|
|
68
|
+
const leftIcon = iconArr.find(({
|
|
69
|
+
position
|
|
70
|
+
}) => position === 'left');
|
|
71
|
+
const rightIcon = iconArr.find(({
|
|
72
|
+
position
|
|
73
|
+
}) => position === 'right');
|
|
74
|
+
|
|
75
|
+
// no fa icons
|
|
76
|
+
// nor ICONS
|
|
77
|
+
if (!leftIcon?.faIcon && !(leftIcon?.type && ICONS[leftIcon.type]) && !rightIcon?.faIcon && !(rightIcon?.type && ICONS[rightIcon.type])) return renderNoIcons(content, customLabelClassName);
|
|
50
78
|
return /*#__PURE__*/React.createElement("div", {
|
|
51
|
-
className: style.buttonContent
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
79
|
+
className: style.buttonContent,
|
|
80
|
+
style: contentCustomStyle
|
|
81
|
+
}, renderIcon(leftIcon, {
|
|
82
|
+
hovered,
|
|
83
|
+
hoverBackgroundColor,
|
|
84
|
+
hoverColor
|
|
85
|
+
}), content ? /*#__PURE__*/React.createElement("span", {
|
|
86
|
+
className: classnames(style.label, customLabelClassName)
|
|
87
|
+
}, content) : null, tag ? /*#__PURE__*/React.createElement(Tag, tag) : null, renderIcon(rightIcon, {
|
|
88
|
+
hovered,
|
|
89
|
+
hoverBackgroundColor,
|
|
90
|
+
hoverColor
|
|
91
|
+
}));
|
|
55
92
|
};
|
|
56
93
|
const ButtonLink = props => {
|
|
57
94
|
const {
|
|
@@ -73,6 +110,7 @@ const ButtonLink = props => {
|
|
|
73
110
|
onKeyDown = _noop,
|
|
74
111
|
className,
|
|
75
112
|
customStyle,
|
|
113
|
+
contentCustomStyle,
|
|
76
114
|
useTitle = true,
|
|
77
115
|
customLabelClassName,
|
|
78
116
|
tag
|
|
@@ -123,7 +161,7 @@ const ButtonLink = props => {
|
|
|
123
161
|
hoverBackgroundColor: hoverBackgroundColor,
|
|
124
162
|
onMouseEnter: handleMouseOver,
|
|
125
163
|
onMouseLeave: handleMouseLeave
|
|
126
|
-
}), getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor, customLabelClassName, tag), renderToolTip());
|
|
164
|
+
}), getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor, customLabelClassName, tag, contentCustomStyle), renderToolTip());
|
|
127
165
|
}
|
|
128
166
|
return /*#__PURE__*/React.createElement("button", _extends({}, useTitle && {
|
|
129
167
|
title: ariaLabel || label
|
|
@@ -144,7 +182,7 @@ const ButtonLink = props => {
|
|
|
144
182
|
onMouseLeave: handleMouseLeave,
|
|
145
183
|
tabIndex: 0,
|
|
146
184
|
disabled: disabled
|
|
147
|
-
}), getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor, customLabelClassName, tag), renderToolTip());
|
|
185
|
+
}), getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor, customLabelClassName, tag, contentCustomStyle), renderToolTip());
|
|
148
186
|
};
|
|
149
187
|
ButtonLink.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
150
188
|
export default ButtonLink;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","useState","useMemo","classnames","Link","FaIcon","DEFAULT_ICON_COLOR","ICONS","ToolTip","Tag","propTypes","style","getButtonContent","icon","content","hovered","hoverBackgroundColor","hoverColor","customLabelClassName","tag","type","faIcon","position","Icon","createElement","className","buttonContent","label","dangerouslySetInnerHTML","__html","iconComponent","iconName","name","iconColor","color","backgroundColor","size","faSize","wrapperSize","customStyle","theme","ButtonLink","props","usage","disabled","dataName","dataTestId","ariaLabel","tooltipText","tooltipPlacement","link","onClick","_noop","onKeyDown","useTitle","styleButton","button","iconButton","primary","secondary","tertiary","text","dangerous","setHovered","handleOnClick","event","handleOnKeyDown","handleMouseOver","handleMouseLeave","TooltipContent","tooltipContentWrapper","renderToolTip","closeToolTipInformationTextAriaLabel","fontSize","anchorId","toolTipIsVisible","placement","_customStyle","_extends","title","onMouseEnter","onMouseLeave","onMouseOver","tabIndex","process","env","NODE_ENV"],"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 Tag from '../tag';\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 customLabelClassName?: string,\n tag?: React.ComponentProps<typeof Tag>\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, customLabelClassName)}>\n {typeof content === 'string' ? (\n <span\n className={(style.label, customLabelClassName)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: content}}\n />\n ) : (\n <span className={(style.label, customLabelClassName)}>{content}</span>\n )}\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 return (\n <div className={style.buttonContent}>\n {position === 'left' ? iconComponent : null}\n {content ? <span className={style.label}>{content}</span> : null}\n {tag ? <Tag {...tag} /> : 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 customLabelClassName,\n tag\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 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 onClick={handleOnClick}\n aria-label={ariaLabel || label}\n hoverColor={hoverColor}\n hoverBackgroundColor={hoverBackgroundColor}\n onMouseEnter={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n >\n {getButtonContent(\n icon,\n content ?? label,\n hovered,\n hoverBackgroundColor,\n hoverColor,\n customLabelClassName,\n tag\n )}\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(\n icon,\n content ?? label,\n hovered,\n hoverBackgroundColor,\n hoverColor,\n customLabelClassName,\n tag\n )}\n {renderToolTip()}\n </button>\n );\n};\n\nButtonLink.propTypes = propTypes;\n\nexport default ButtonLink;\n"],"mappings":";;AAAA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,QAAQ,EAAEC,OAAO,QAAO,OAAO;AAE3D,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,IAAI,MAAM,SAAS;AAC1B,OAAOC,MAAM,IAAGC,kBAAkB,QAAkB,SAAS;AAC7D,SAAQC,KAAK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,CAAC;EAEX;EAEA,oBACExE,KAAA,CAAAyB,aAAA,WAAAsD,QAAA,KACOxB,QAAQ,IAAI;IACfyB,KAAK,EAAEhC,SAAS,IAAIpB;EACtB,CAAC,EACIoB,SAAS,IAAI,CAACpB,KAAK,GACpB;IACE,UAAU,EAAE,aAAa;IACzB,UAAU,EAAEZ;EACd,CAAC,GACD,CAAC,CAAC;IACN;IACAK,IAAI,EAAEuB,KAAM;IACZ,cAAYI,SAAS,IAAIpB,KAAM;IAC/B,aAAWkB,QAAS;IACpB,eAAaC,UAAW;IACxBnC,KAAK,EAAEkE,YAAa;IACpBpD,SAAS,EAAE8B,WAAY;IACvBJ,OAAO,EAAEa,aAAc;IACvBX,SAAS,EAAEa,eAAgB;IAC3BgB,WAAW,EAAEf,eAAgB;IAC7Bc,YAAY,EAAEb,gBAAiB;IAC/Be,QAAQ,EAAE,CAAE;IACZvC,QAAQ,EAAEA;EAAS,IAElBhC,gBAAgB,CACfC,IAAI,EACJC,OAAO,IAAIa,KAAK,EAChBZ,OAAO,EACPC,oBAAoB,EACpBC,UAAU,EACVC,oBAAoB,EACpBC,GACF,CAAC,EACAoD,aAAa,CAAC,CACT,CAAC;AAEb,CAAC;AAED9B,UAAU,CAAC/B,SAAS,GAAA0E,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG5E,SAAS;AAEhC,eAAe+B,UAAU","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","useState","useMemo","classnames","Link","FaIcon","DEFAULT_ICON_COLOR","ICONS","ToolTip","Tag","propTypes","style","renderNoIcons","content","customClass","createElement","className","buttonContent","label","dangerouslySetInnerHTML","__html","buildFaIcon","faIcon","hoverOptions","_isEmpty","name","size","backgroundColor","customStyle","color","hovered","hoverBackgroundColor","hoverColor","iconName","iconColor","faSize","wrapperSize","renderIcon","icon","options","type","Icon","theme","getButtonContent","customLabelClassName","tag","contentCustomStyle","iconArr","Array","isArray","leftIcon","find","position","rightIcon","ButtonLink","props","usage","disabled","dataName","dataTestId","ariaLabel","tooltipText","tooltipPlacement","link","onClick","_noop","onKeyDown","useTitle","styleButton","button","iconButton","primary","secondary","tertiary","text","dangerous","setHovered","handleOnClick","event","handleOnKeyDown","handleMouseOver","handleMouseLeave","TooltipContent","tooltipContentWrapper","renderToolTip","closeToolTipInformationTextAriaLabel","fontSize","anchorId","toolTipIsVisible","placement","_customStyle","_extends","title","onMouseEnter","onMouseLeave","onMouseOver","tabIndex","process","env","NODE_ENV"],"sources":["../../../src/atom/button-link/index.tsx"],"sourcesContent":["import React, {useCallback, useState, useMemo} from 'react';\nimport {isEmpty, 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 Tag from '../tag';\nimport propTypes, {ButtonLinkProps, IconType} from './types';\nimport style from './style.css';\n\nconst renderNoIcons = (\n content: string | React.ReactNode | undefined,\n customClass: string | undefined\n) => (\n <div className={classnames(style.buttonContent, customClass)}>\n {typeof content === 'string' ? (\n <span\n className={classnames(style.label, customClass)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: content}}\n />\n ) : (\n <span className={classnames(style.label, customClass)}>{content}</span>\n )}\n </div>\n);\n\nconst buildFaIcon = (\n faIcon: IconType['faIcon'],\n hoverOptions: {hovered?: boolean; hoverBackgroundColor?: string; hoverColor?: string}\n) => {\n if (isEmpty(faIcon)) return null;\n\n const {name, size, backgroundColor, customStyle, color} = faIcon;\n const {hovered, hoverBackgroundColor, hoverColor} = hoverOptions;\n\n return (\n <FaIcon\n {...({\n iconName: name,\n iconColor: hovered && hoverColor ? hoverColor : color ?? DEFAULT_ICON_COLOR,\n // eslint-disable-next-line no-nested-ternary\n backgroundColor: !backgroundColor\n ? null\n : hovered && hoverBackgroundColor\n ? hoverBackgroundColor\n : backgroundColor,\n size: {\n faSize: size,\n wrapperSize: size\n },\n customStyle\n } as IconProps)}\n />\n );\n};\n\nconst renderIcon = (\n icon: IconType | undefined,\n options: {hovered?: boolean; hoverBackgroundColor?: string; hoverColor?: string}\n) => {\n if (isEmpty(icon)) return null;\n\n const {type, faIcon} = icon;\n const Icon = type && ICONS[type];\n\n if (faIcon) return buildFaIcon(faIcon, options);\n if (Icon) return <Icon className={style.icon} theme=\"coorpmanager\" />;\n\n return null;\n};\n\nconst getButtonContent = (\n icon?: IconType | IconType[],\n content?: string | React.ReactNode,\n hovered?: boolean,\n hoverBackgroundColor?: string,\n hoverColor?: string,\n customLabelClassName?: string,\n tag?: React.ComponentProps<typeof Tag>,\n contentCustomStyle?: React.CSSProperties\n) => {\n // eslint-disable-next-line no-nested-ternary\n const iconArr = !isEmpty(icon) ? (Array.isArray(icon) ? icon : [icon]) : [];\n\n const leftIcon = iconArr.find(({position}) => position === 'left');\n const rightIcon = iconArr.find(({position}) => position === 'right');\n\n // no fa icons\n // nor ICONS\n if (\n !leftIcon?.faIcon &&\n !(leftIcon?.type && ICONS[leftIcon.type]) &&\n !rightIcon?.faIcon &&\n !(rightIcon?.type && ICONS[rightIcon.type])\n )\n return renderNoIcons(content, customLabelClassName);\n\n return (\n <div className={style.buttonContent} style={contentCustomStyle}>\n {renderIcon(leftIcon, {hovered, hoverBackgroundColor, hoverColor})}\n {content ? (\n <span className={classnames(style.label, customLabelClassName)}>{content}</span>\n ) : null}\n {tag ? <Tag {...tag} /> : null}\n {renderIcon(rightIcon, {hovered, hoverBackgroundColor, hoverColor})}\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 contentCustomStyle,\n useTitle = true,\n customLabelClassName,\n tag\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 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 onClick={handleOnClick}\n aria-label={ariaLabel || label}\n hoverColor={hoverColor}\n hoverBackgroundColor={hoverBackgroundColor}\n onMouseEnter={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n >\n {getButtonContent(\n icon,\n content ?? label,\n hovered,\n hoverBackgroundColor,\n hoverColor,\n customLabelClassName,\n tag,\n contentCustomStyle\n )}\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(\n icon,\n content ?? label,\n hovered,\n hoverBackgroundColor,\n hoverColor,\n customLabelClassName,\n tag,\n contentCustomStyle\n )}\n {renderToolTip()}\n </button>\n );\n};\n\nButtonLink.propTypes = propTypes;\n\nexport default ButtonLink;\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,QAAQ,EAAEC,OAAO,QAAO,OAAO;AAE3D,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,IAAI,MAAM,SAAS;AAC1B,OAAOC,MAAM,IAAGC,kBAAkB,QAAkB,SAAS;AAC7D,SAAQC,KAAK,QAAO,yBAAyB;AAC7C,OAAOC,OAAO,MAAM,YAAY;AAChC,OAAOC,GAAG,MAAM,QAAQ;AACxB,OAAOC,SAAS,MAAmC,SAAS;AAC5D,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,aAAa,GAAGA,CACpBC,OAA6C,EAC7CC,WAA+B,kBAE/Bf,KAAA,CAAAgB,aAAA;EAAKC,SAAS,EAAEb,UAAU,CAACQ,KAAK,CAACM,aAAa,EAAEH,WAAW;AAAE,GAC1D,OAAOD,OAAO,KAAK,QAAQ,gBAC1Bd,KAAA,CAAAgB,aAAA;EACEC,SAAS,EAAEb,UAAU,CAACQ,KAAK,CAACO,KAAK,EAAEJ,WAAW;EAC9C;EAAA;EACAK,uBAAuB,EAAE;IAACC,MAAM,EAAEP;EAAO;AAAE,CAC5C,CAAC,gBAEF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AAEb,gBAAiB;IAC/Be,QAAQ,EAAE,CAAE;IACZvC,QAAQ,EAAEA;EAAS,IAElBd,gBAAgB,CACfL,IAAI,EACJzB,OAAO,IAAIK,KAAK,EAChBY,OAAO,EACPC,oBAAoB,EACpBC,UAAU,EACVY,oBAAoB,EACpBC,GAAG,EACHC,kBACF,CAAC,EACAsC,aAAa,CAAC,CACT,CAAC;AAEb,CAAC;AAED9B,UAAU,CAAC5C,SAAS,GAAAuF,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGzF,SAAS;AAEhC,eAAe4C,UAAU","ignoreList":[]}
|
|
@@ -10,9 +10,7 @@ export declare const iconPropTypes: {
|
|
|
10
10
|
color: PropTypes.Requireable<string>;
|
|
11
11
|
backgroundColor: PropTypes.Requireable<string>;
|
|
12
12
|
size: PropTypes.Requireable<number>;
|
|
13
|
-
customStyle: PropTypes.Requireable<
|
|
14
|
-
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
15
|
-
}>;
|
|
13
|
+
customStyle: PropTypes.Requireable<object>;
|
|
16
14
|
}>>;
|
|
17
15
|
};
|
|
18
16
|
declare const propTypes: {
|
|
@@ -25,7 +23,7 @@ declare const propTypes: {
|
|
|
25
23
|
tooltipPlacement: PropTypes.Requireable<string>;
|
|
26
24
|
'data-name': PropTypes.Requireable<string>;
|
|
27
25
|
'data-testid': PropTypes.Requireable<string>;
|
|
28
|
-
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
26
|
+
icon: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
|
|
29
27
|
position: PropTypes.Requireable<string>;
|
|
30
28
|
type: PropTypes.Requireable<string>;
|
|
31
29
|
faIcon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -33,11 +31,19 @@ declare const propTypes: {
|
|
|
33
31
|
color: PropTypes.Requireable<string>;
|
|
34
32
|
backgroundColor: PropTypes.Requireable<string>;
|
|
35
33
|
size: PropTypes.Requireable<number>;
|
|
36
|
-
customStyle: PropTypes.Requireable<
|
|
37
|
-
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
38
|
-
}>;
|
|
34
|
+
customStyle: PropTypes.Requireable<object>;
|
|
39
35
|
}>>;
|
|
40
|
-
}
|
|
36
|
+
}> | (PropTypes.InferProps<{
|
|
37
|
+
position: PropTypes.Requireable<string>;
|
|
38
|
+
type: PropTypes.Requireable<string>;
|
|
39
|
+
faIcon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
40
|
+
name: PropTypes.Validator<string>;
|
|
41
|
+
color: PropTypes.Requireable<string>;
|
|
42
|
+
backgroundColor: PropTypes.Requireable<string>;
|
|
43
|
+
size: PropTypes.Requireable<number>;
|
|
44
|
+
customStyle: PropTypes.Requireable<object>;
|
|
45
|
+
}>>;
|
|
46
|
+
}> | null | undefined)[] | null | undefined>>;
|
|
41
47
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
42
48
|
link: PropTypes.Requireable<PropTypes.InferProps<{
|
|
43
49
|
href: PropTypes.Requireable<string>;
|
|
@@ -48,9 +54,8 @@ declare const propTypes: {
|
|
|
48
54
|
hoverColor: PropTypes.Requireable<string>;
|
|
49
55
|
disabled: PropTypes.Requireable<boolean>;
|
|
50
56
|
className: PropTypes.Requireable<string>;
|
|
51
|
-
customStyle: PropTypes.Requireable<
|
|
52
|
-
|
|
53
|
-
}>;
|
|
57
|
+
customStyle: PropTypes.Requireable<object>;
|
|
58
|
+
contentCustomStyle: PropTypes.Requireable<object>;
|
|
54
59
|
useTitle: PropTypes.Requireable<boolean>;
|
|
55
60
|
customLabelClassName: PropTypes.Requireable<string>;
|
|
56
61
|
};
|
|
@@ -59,7 +64,7 @@ export declare type FaIconType = {
|
|
|
59
64
|
color?: string;
|
|
60
65
|
backgroundColor?: string;
|
|
61
66
|
size?: number;
|
|
62
|
-
customStyle?:
|
|
67
|
+
customStyle?: React.CSSProperties;
|
|
63
68
|
};
|
|
64
69
|
export declare type IconType = {
|
|
65
70
|
position: 'right' | 'left';
|
|
@@ -76,7 +81,7 @@ export declare type ButtonLinkProps = {
|
|
|
76
81
|
tooltipPlacement?: 'left' | 'right' | 'top' | 'bottom';
|
|
77
82
|
'data-name'?: string;
|
|
78
83
|
'data-testid'?: string;
|
|
79
|
-
icon?: IconType;
|
|
84
|
+
icon?: IconType | IconType[];
|
|
80
85
|
onClick?: () => void;
|
|
81
86
|
onKeyDown?: () => void;
|
|
82
87
|
link?: {
|
|
@@ -88,7 +93,8 @@ export declare type ButtonLinkProps = {
|
|
|
88
93
|
hoverColor?: string;
|
|
89
94
|
disabled?: boolean;
|
|
90
95
|
className?: string;
|
|
91
|
-
customStyle?:
|
|
96
|
+
customStyle?: React.CSSProperties;
|
|
97
|
+
contentCustomStyle?: React.CSSProperties;
|
|
92
98
|
useTitle?: boolean;
|
|
93
99
|
customLabelClassName?: string;
|
|
94
100
|
tag?: React.ComponentProps<typeof Tag>;
|
|
@@ -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;AAC9C,OAAO,GAAG,MAAM,QAAQ,CAAC;AAUzB,eAAO,MAAM,aAAa
|
|
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;AAC9C,OAAO,GAAG,MAAM,QAAQ,CAAC;AAUzB,eAAO,MAAM,aAAa;;;;;;;;;;CAIzB,CAAC;AAEF,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4Bd,CAAC;AAEF,oBAAY,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK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C;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAClC,kBAAkB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,GAAG,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,CAAC;CACxC,CAAC;AAEF,oBAAY,OAAO,GAAG;IAAC,KAAK,EAAE,eAAe,CAAA;CAAC,CAAC;AAE/C,eAAe,SAAS,CAAC"}
|
|
@@ -6,7 +6,7 @@ const faIconPropTypes = {
|
|
|
6
6
|
color: PropTypes.string,
|
|
7
7
|
backgroundColor: PropTypes.string,
|
|
8
8
|
size: PropTypes.number,
|
|
9
|
-
customStyle: PropTypes.
|
|
9
|
+
customStyle: PropTypes.object
|
|
10
10
|
};
|
|
11
11
|
export const iconPropTypes = {
|
|
12
12
|
position: PropTypes.oneOf(['right', 'left']),
|
|
@@ -23,7 +23,7 @@ const propTypes = {
|
|
|
23
23
|
tooltipPlacement: PropTypes.oneOf(['left', 'right', 'top', 'bottom']),
|
|
24
24
|
'data-name': PropTypes.string,
|
|
25
25
|
'data-testid': PropTypes.string,
|
|
26
|
-
icon: PropTypes.shape(iconPropTypes),
|
|
26
|
+
icon: PropTypes.oneOfType([PropTypes.shape(iconPropTypes), PropTypes.arrayOf(PropTypes.shape(iconPropTypes))]),
|
|
27
27
|
onClick: PropTypes.func,
|
|
28
28
|
link: PropTypes.shape({
|
|
29
29
|
href: PropTypes.string,
|
|
@@ -34,7 +34,8 @@ const propTypes = {
|
|
|
34
34
|
hoverColor: PropTypes.string,
|
|
35
35
|
disabled: PropTypes.bool,
|
|
36
36
|
className: PropTypes.string,
|
|
37
|
-
customStyle: PropTypes.
|
|
37
|
+
customStyle: PropTypes.object,
|
|
38
|
+
contentCustomStyle: PropTypes.object,
|
|
38
39
|
useTitle: PropTypes.bool,
|
|
39
40
|
customLabelClassName: PropTypes.string
|
|
40
41
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["PropTypes","ICONS","faIconPropTypes","name","string","isRequired","color","backgroundColor","size","number","customStyle","
|
|
1
|
+
{"version":3,"file":"types.js","names":["PropTypes","ICONS","faIconPropTypes","name","string","isRequired","color","backgroundColor","size","number","customStyle","object","iconPropTypes","position","oneOf","type","_keys","faIcon","shape","propTypes","usage","label","content","node","tooltipText","tooltipPlacement","icon","oneOfType","arrayOf","onClick","func","link","href","download","bool","target","hoverBackgroundColor","hoverColor","disabled","className","contentCustomStyle","useTitle","customLabelClassName"],"sources":["../../../src/atom/button-link/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport {keys} from 'lodash/fp';\nimport {ICONS} from '../../util/button-icons';\nimport Tag from '../tag';\n\nconst faIconPropTypes = {\n name: PropTypes.string.isRequired,\n color: PropTypes.string,\n backgroundColor: PropTypes.string,\n size: PropTypes.number,\n customStyle: PropTypes.object\n};\n\nexport const iconPropTypes = {\n position: PropTypes.oneOf(['right', 'left']),\n type: PropTypes.oneOf(keys(ICONS)),\n faIcon: PropTypes.shape(faIconPropTypes)\n};\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 tooltipText: PropTypes.string,\n tooltipPlacement: PropTypes.oneOf(['left', 'right', 'top', 'bottom']),\n 'data-name': PropTypes.string,\n 'data-testid': PropTypes.string,\n icon: PropTypes.oneOfType([\n PropTypes.shape(iconPropTypes),\n PropTypes.arrayOf(PropTypes.shape(iconPropTypes))\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.object,\n contentCustomStyle: PropTypes.object,\n useTitle: PropTypes.bool,\n customLabelClassName: PropTypes.string\n};\n\nexport type FaIconType = {\n name: string;\n color?: string;\n backgroundColor?: string;\n size?: number;\n customStyle?: React.CSSProperties;\n};\n\nexport type IconType = {\n position: 'right' | 'left';\n type?: keyof typeof ICONS;\n faIcon?: FaIconType;\n};\n\nexport type ButtonLinkProps = {\n type?: 'primary' | 'secondary' | 'tertiary' | 'text' | 'dangerous';\n usage?: 'button' | 'submit' | 'reset';\n label?: string;\n content?: PropTypes.ReactNodeLike;\n 'aria-label'?: string;\n tooltipText?: string;\n tooltipPlacement?: 'left' | 'right' | 'top' | 'bottom';\n 'data-name'?: string;\n 'data-testid'?: string;\n icon?: IconType | 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?: React.CSSProperties;\n contentCustomStyle?: React.CSSProperties;\n useTitle?: boolean;\n customLabelClassName?: string;\n tag?: React.ComponentProps<typeof Tag>;\n};\n\nexport type Fixture = {props: ButtonLinkProps};\n\nexport default propTypes;\n"],"mappings":";AAAA,OAAOA,SAAS,MAAM,YAAY;AAElC,SAAQC,KAAK,QAAO,yBAAyB;AAG7C,MAAMC,eAAe,GAAG;EACtBC,IAAI,EAAEH,SAAS,CAACI,MAAM,CAACC,UAAU;EACjCC,KAAK,EAAEN,SAAS,CAACI,MAAM;EACvBG,eAAe,EAAEP,SAAS,CAACI,MAAM;EACjCI,IAAI,EAAER,SAAS,CAACS,MAAM;EACtBC,WAAW,EAAEV,SAAS,CAACW;AACzB,CAAC;AAED,OAAO,MAAMC,aAAa,GAAG;EAC3BC,QAAQ,EAAEb,SAAS,CAACc,KAAK,CAAC,CA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ChE,CAAC,CAAC;EACFsB,oBAAoB,EAAEpC,SAAS,CAACI,MAAM;EACtCiC,UAAU,EAAErC,SAAS,CAACI,MAAM;EAC5BkC,QAAQ,EAAEtC,SAAS,CAACkC,IAAI;EACxBK,SAAS,EAAEvC,SAAS,CAACI,MAAM;EAC3BM,WAAW,EAAEV,SAAS,CAACW,MAAM;EAC7B6B,kBAAkB,EAAExC,SAAS,CAACW,MAAM;EACpC8B,QAAQ,EAAEzC,SAAS,CAACkC,IAAI;EACxBQ,oBAAoB,EAAE1C,SAAS,CAACI;AAClC,CAAC;AA+CD,eAAee,SAAS","ignoreList":[]}
|
|
@@ -19,9 +19,7 @@ declare const ButtonMenu: {
|
|
|
19
19
|
color: import("prop-types").Requireable<string>;
|
|
20
20
|
backgroundColor: import("prop-types").Requireable<string>;
|
|
21
21
|
size: import("prop-types").Requireable<number>;
|
|
22
|
-
customStyle: import("prop-types").Requireable<
|
|
23
|
-
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
24
|
-
}>;
|
|
22
|
+
customStyle: import("prop-types").Requireable<object>;
|
|
25
23
|
}>>;
|
|
26
24
|
}>>;
|
|
27
25
|
customStyle: import("prop-types").Requireable<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-menu/index.tsx"],"names":[],"mappings":";AAMA,OAAkB,EAAC,eAAe,EAA+B,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-menu/index.tsx"],"names":[],"mappings":";AAMA,OAAkB,EAAC,eAAe,EAA+B,MAAM,SAAS,CAAC;AA+DjF,QAAA,MAAM,UAAU;YAAW,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqBzC,CAAC;AAIF,eAAe,UAAU,CAAC"}
|
|
@@ -37,8 +37,6 @@ const Button = props => {
|
|
|
37
37
|
type = 'default',
|
|
38
38
|
buttonLinkType,
|
|
39
39
|
icon,
|
|
40
|
-
customStyle = {},
|
|
41
|
-
customLabelClassName,
|
|
42
40
|
...rest
|
|
43
41
|
} = props;
|
|
44
42
|
const styleButton = classnames(style.button, type === 'default' && style.defaultStyle, type === 'defaultLeft' && style.defaultLeft, type === 'dangerous' && style.dangerous, type === 'dangerousLeft' && style.dangerousLeft, disabled && style.disabled);
|
|
@@ -51,11 +49,7 @@ const Button = props => {
|
|
|
51
49
|
type: buttonLinkType,
|
|
52
50
|
onClick: handleOnClick,
|
|
53
51
|
'data-name': dataName,
|
|
54
|
-
className: styleButton
|
|
55
|
-
customStyle: {
|
|
56
|
-
...customStyle
|
|
57
|
-
},
|
|
58
|
-
customLabelClassName
|
|
52
|
+
className: styleButton
|
|
59
53
|
};
|
|
60
54
|
const iconProps = buildCustomIconByTheme(icon);
|
|
61
55
|
return /*#__PURE__*/React.createElement(ButtonLink, _extends({}, buttonLinkProps, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","useCallback","map","classnames","ButtonLink","style","propTypes","buttonPropTypes","DEFAULT_ICON_STYLE","THEMES","buildCustomIconByTheme","icon","theme","iconProps","custom","customProps","faIcon","Button","props","dataName","ariaLabel","disabled","label","onClick","_noop","type","buttonLinkType","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","useCallback","map","classnames","ButtonLink","style","propTypes","buttonPropTypes","DEFAULT_ICON_STYLE","THEMES","buildCustomIconByTheme","icon","theme","iconProps","custom","customProps","faIcon","Button","props","dataName","ariaLabel","disabled","label","onClick","_noop","type","buttonLinkType","rest","styleButton","button","defaultStyle","defaultLeft","dangerous","dangerousLeft","handleOnClick","buttonLinkProps","className","createElement","_extends","process","env","NODE_ENV","ButtonMenu","buttons","enableScroll","buildButton","index","key","buttonList","convert","cap","containerStyle","buttonMenuContainer","scrollable"],"sources":["../../../src/atom/button-menu/index.tsx"],"sourcesContent":["import React, {useMemo, useCallback} from 'react';\nimport map from 'lodash/fp/map';\nimport classnames from 'classnames';\nimport {noop} from 'lodash/fp';\nimport ButtonLink from '../button-link';\nimport style from './style.css';\nimport propTypes, {ButtonMenuProps, ButtonProps, buttonPropTypes} from './types';\nimport {DEFAULT_ICON_STYLE, THEMES} from './utils';\n\nconst buildCustomIconByTheme = (icon: ButtonProps['icon']) => {\n if (!icon) return;\n\n const {theme, ...iconProps} = icon;\n const custom = theme && THEMES[theme];\n if (!custom) return iconProps;\n\n const customProps = custom\n ? {\n ...DEFAULT_ICON_STYLE,\n faIcon: {...DEFAULT_ICON_STYLE.faIcon, ...custom}\n }\n : null;\n\n return {\n ...iconProps,\n ...customProps\n };\n};\n\nconst Button = (props: ButtonProps) => {\n const {\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n disabled,\n label,\n onClick = noop,\n type = 'default',\n buttonLinkType,\n icon,\n ...rest\n } = props;\n const styleButton = classnames(\n style.button,\n type === 'default' && style.defaultStyle,\n type === 'defaultLeft' && style.defaultLeft,\n type === 'dangerous' && style.dangerous,\n type === 'dangerousLeft' && style.dangerousLeft,\n disabled && style.disabled\n );\n const handleOnClick = useCallback(() => onClick(), [onClick]);\n\n const buttonLinkProps = {\n ...rest,\n 'aria-label': ariaLabel || label,\n disabled,\n label,\n type: buttonLinkType,\n onClick: handleOnClick,\n 'data-name': dataName,\n className: styleButton\n };\n\n const iconProps = buildCustomIconByTheme(icon);\n\n return <ButtonLink {...buttonLinkProps} icon={iconProps} />;\n};\n\nButton.propTypes = buttonPropTypes;\n\nconst ButtonMenu = (props: ButtonMenuProps) => {\n const {buttons, 'data-name': dataName, enableScroll = false} = props;\n const buildButton = useCallback((button: ButtonProps, index) => {\n return <Button {...button} key={button.label + index} />;\n }, []);\n\n const buttonList = useMemo(\n // @ts-expect-error (to avoid using map as any)\n () => map.convert({cap: false})(buildButton, buttons),\n [buttons, buildButton]\n );\n\n const containerStyle = classnames(style.buttonMenuContainer, {\n [style.scrollable]: enableScroll\n });\n\n return (\n <div data-name={dataName} className={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E;EAAK,CAAC,CAAC,CAACL,WAAW,EAAEF,OAAO,CAAC,EACrD,CAACA,OAAO,EAAEE,WAAW,CACvB,CAAC;EAED,MAAMM,cAAc,GAAGhD,UAAU,CAACE,KAAK,CAAC+C,mBAAmB,EAAE;IAC3D,CAAC/C,KAAK,CAACgD,UAAU,GAAGT;EACtB,CAAC,CAAC;EAEF,oBACE7C,KAAA,CAAAsC,aAAA;IAAK,aAAWlB,QAAS;IAACiB,SAAS,EAAEe;EAAe,GACjDH,UACE,CAAC;AAEV,CAAC;AAEDN,UAAU,CAACpC,SAAS,GAAAiC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGnC,SAAS;AAEhC,eAAeoC,UAAU","ignoreList":[]}
|
|
@@ -16,9 +16,7 @@ export declare const buttonPropTypes: {
|
|
|
16
16
|
color: PropTypes.Requireable<string>;
|
|
17
17
|
backgroundColor: PropTypes.Requireable<string>;
|
|
18
18
|
size: PropTypes.Requireable<number>;
|
|
19
|
-
customStyle: PropTypes.Requireable<
|
|
20
|
-
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
21
|
-
}>;
|
|
19
|
+
customStyle: PropTypes.Requireable<object>;
|
|
22
20
|
}>>;
|
|
23
21
|
}>>;
|
|
24
22
|
customStyle: PropTypes.Requireable<{
|
|
@@ -43,9 +41,7 @@ declare const propTypes: {
|
|
|
43
41
|
color: PropTypes.Requireable<string>;
|
|
44
42
|
backgroundColor: PropTypes.Requireable<string>;
|
|
45
43
|
size: PropTypes.Requireable<number>;
|
|
46
|
-
customStyle: PropTypes.Requireable<
|
|
47
|
-
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
48
|
-
}>;
|
|
44
|
+
customStyle: PropTypes.Requireable<object>;
|
|
49
45
|
}>>;
|
|
50
46
|
}>>;
|
|
51
47
|
customStyle: PropTypes.Requireable<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/atom/button-menu/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAC,eAAe,EAAE,QAAQ,EAAgB,MAAM,sBAAsB,CAAC;AAE9E,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/atom/button-menu/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAC,eAAe,EAAE,QAAQ,EAAgB,MAAM,sBAAsB,CAAC;AAE9E,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;CAa3B,CAAC;AAEF,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKd,CAAC;AAEF,eAAe,SAAS,CAAC;AAEzB,oBAAY,KAAK,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,CAAC;AAEzD,oBAAY,WAAW,GAAG,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG;IACjE,IAAI,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,WAAW,GAAG,eAAe,CAAC;IACjE,cAAc,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IACzC,IAAI,CAAC,EAAE,QAAQ,GAAG;QAAC,KAAK,CAAC,EAAE,KAAK,CAAA;KAAC,CAAC;IAClC,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,oBAAY,sBAAsB,GAAG;IAAC,KAAK,EAAE,eAAe,CAAA;CAAC,CAAC"}
|
package/es/atom/chip/index.d.ts
CHANGED
|
@@ -28,11 +28,15 @@ declare namespace Chip {
|
|
|
28
28
|
namespace propTypes {
|
|
29
29
|
const text: PropTypes.Requireable<string>;
|
|
30
30
|
const subText: PropTypes.Requireable<string>;
|
|
31
|
+
const textColor: PropTypes.Requireable<string>;
|
|
31
32
|
const selected: PropTypes.Requireable<boolean>;
|
|
32
33
|
const customIcon: PropTypes.Requireable<string>;
|
|
33
34
|
const backgroundColor: PropTypes.Requireable<string>;
|
|
34
35
|
const onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
35
36
|
const leftIcon: PropTypes.Requireable<string>;
|
|
37
|
+
const customStyle: PropTypes.Requireable<{
|
|
38
|
+
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
39
|
+
}>;
|
|
36
40
|
}
|
|
37
41
|
}
|
|
38
42
|
import PropTypes from "prop-types";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/chip/index.js"],"names":[],"mappings":"AAmBO,qGAG0E;;AAGjF,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/chip/index.js"],"names":[],"mappings":"AAmBO,qGAG0E;;AAGjF,6DAuEC"}
|
package/es/atom/chip/index.js
CHANGED
|
@@ -22,11 +22,13 @@ const Chip = (props, context) => {
|
|
|
22
22
|
const {
|
|
23
23
|
text,
|
|
24
24
|
subText,
|
|
25
|
+
textColor = COLORS.cm_grey_700,
|
|
25
26
|
selected = false,
|
|
26
27
|
customIcon,
|
|
27
28
|
onClick,
|
|
28
29
|
leftIcon,
|
|
29
|
-
backgroundColor = DEFAULT_BACKGROUND_COLOR
|
|
30
|
+
backgroundColor = DEFAULT_BACKGROUND_COLOR,
|
|
31
|
+
customStyle
|
|
30
32
|
} = props;
|
|
31
33
|
const {
|
|
32
34
|
skin
|
|
@@ -46,14 +48,16 @@ const Chip = (props, context) => {
|
|
|
46
48
|
backgroundColor: hoveredSelectedBgColor
|
|
47
49
|
} : {};
|
|
48
50
|
const defaultIcon = selected ? 'fa-check' : 'fa-plus';
|
|
49
|
-
const
|
|
51
|
+
const showIcon = customIcon !== 'none';
|
|
52
|
+
const color = selected ? COLORS.white : textColor;
|
|
50
53
|
return /*#__PURE__*/React.createElement("div", {
|
|
51
54
|
className: classnames(style.container, !selected && style.unselected),
|
|
52
55
|
style: {
|
|
53
56
|
...(selected && selectedBgColor ? {
|
|
54
57
|
backgroundColor: selectedBgColor
|
|
55
58
|
} : {}),
|
|
56
|
-
...(selected && hoverStyle)
|
|
59
|
+
...(selected && hoverStyle),
|
|
60
|
+
...customStyle
|
|
57
61
|
},
|
|
58
62
|
onClick: handleClick,
|
|
59
63
|
onMouseEnter: handleMouseEnter,
|
|
@@ -80,13 +84,13 @@ const Chip = (props, context) => {
|
|
|
80
84
|
style: {
|
|
81
85
|
color
|
|
82
86
|
}
|
|
83
|
-
}, subText) : null)), /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
87
|
+
}, subText) : null)), showIcon ? /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
84
88
|
style: {
|
|
85
89
|
color
|
|
86
90
|
},
|
|
87
91
|
icon: customIcon ? `fa-${customIcon}` : defaultIcon,
|
|
88
92
|
fontSize: ICON_SIZE
|
|
89
|
-
}));
|
|
93
|
+
}) : null);
|
|
90
94
|
};
|
|
91
95
|
Chip.contextTypes = {
|
|
92
96
|
skin: Provider.childContextTypes.skin
|
|
@@ -94,11 +98,13 @@ Chip.contextTypes = {
|
|
|
94
98
|
Chip.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
95
99
|
text: PropTypes.string,
|
|
96
100
|
subText: PropTypes.string,
|
|
101
|
+
textColor: PropTypes.string,
|
|
97
102
|
selected: PropTypes.bool,
|
|
98
103
|
customIcon: PropTypes.string,
|
|
99
104
|
backgroundColor: PropTypes.string,
|
|
100
105
|
onClick: PropTypes.func,
|
|
101
|
-
leftIcon: PropTypes.string
|
|
106
|
+
leftIcon: PropTypes.string,
|
|
107
|
+
customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))
|
|
102
108
|
} : {};
|
|
103
109
|
export default Chip;
|
|
104
110
|
//# sourceMappingURL=index.js.map
|