@coorpacademy/components 11.33.12 → 11.33.13-alpha.10
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-menu/index.d.ts +1 -0
- package/es/atom/button-menu/index.d.ts.map +1 -1
- package/es/atom/button-menu/index.js +32 -19
- package/es/atom/button-menu/index.js.map +1 -1
- package/es/atom/button-menu/style.css +0 -10
- package/es/atom/button-menu/types.d.ts +6 -1
- package/es/atom/button-menu/types.d.ts.map +1 -1
- package/es/atom/button-menu/types.js +4 -1
- package/es/atom/button-menu/types.js.map +1 -1
- package/es/atom/button-menu/utils.d.ts +23 -0
- package/es/atom/button-menu/utils.d.ts.map +1 -0
- package/es/atom/button-menu/utils.js +24 -0
- package/es/atom/button-menu/utils.js.map +1 -0
- package/es/atom/icon/index.d.ts +16 -0
- package/es/atom/icon/index.d.ts.map +1 -1
- package/es/atom/icon/index.js +3 -2
- package/es/atom/icon/index.js.map +1 -1
- package/es/molecule/bullet-point-menu-button/index.d.ts +1 -0
- package/es/molecule/bullet-point-menu-button/index.d.ts.map +1 -1
- package/es/molecule/bullet-point-menu-button/types.d.ts +1 -0
- package/es/molecule/bullet-point-menu-button/types.d.ts.map +1 -1
- package/es/molecule/cm-popin/index.d.ts.map +1 -1
- package/es/molecule/cm-popin/index.js +94 -76
- package/es/molecule/cm-popin/index.js.map +1 -1
- package/es/molecule/cm-popin/style.css +18 -23
- package/es/molecule/cm-popin/types.d.ts +19 -2
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/cm-popin/types.js +6 -5
- package/es/molecule/cm-popin/types.js.map +1 -1
- package/es/molecule/expandible-actionable-table/index.d.ts +2 -0
- package/es/molecule/expandible-actionable-table/index.d.ts.map +1 -1
- package/es/molecule/expandible-actionable-table/types.d.ts +2 -0
- package/es/molecule/expandible-actionable-table/types.d.ts.map +1 -1
- package/es/organism/header-with-actions/index.d.ts +1 -0
- package/es/organism/header-with-actions/index.d.ts.map +1 -1
- package/es/organism/header-with-actions/types.d.ts +1 -0
- package/es/organism/header-with-actions/types.d.ts.map +1 -1
- package/es/organism/list-items/index.d.ts +2 -0
- package/es/organism/wizard-contents/index.d.ts +2 -0
- package/es/template/app-player/loading/index.d.ts +17 -1
- package/es/template/app-player/player/index.d.ts +34 -2
- package/es/template/app-player/player/slides/index.d.ts +17 -1
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +17 -1
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +17 -1
- package/es/template/app-review/index.d.ts +17 -1
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +17 -1
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.d.ts +17 -1
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +22 -1
- package/es/template/back-office/brand-update/index.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.js +22 -3
- package/es/template/back-office/brand-update/index.js.map +1 -1
- package/es/template/back-office/brand-update/utils.d.ts +80 -0
- package/es/template/back-office/brand-update/utils.d.ts.map +1 -0
- package/es/template/back-office/brand-update/utils.js +60 -0
- package/es/template/back-office/brand-update/utils.js.map +1 -0
- package/es/template/common/dashboard/index.d.ts +34 -2
- package/es/template/common/search-page/index.d.ts +17 -1
- package/es/template/external-course/index.d.ts +17 -1
- package/es/variables/colors.css +6 -1
- package/es/variables/colors.d.ts +4 -0
- package/es/variables/colors.d.ts.map +1 -1
- package/es/variables/colors.js +5 -1
- package/es/variables/colors.js.map +1 -1
- package/lib/atom/button-menu/index.d.ts +1 -0
- package/lib/atom/button-menu/index.d.ts.map +1 -1
- package/lib/atom/button-menu/index.js +32 -19
- package/lib/atom/button-menu/index.js.map +1 -1
- package/lib/atom/button-menu/style.css +0 -10
- package/lib/atom/button-menu/types.d.ts +6 -1
- package/lib/atom/button-menu/types.d.ts.map +1 -1
- package/lib/atom/button-menu/types.js +4 -1
- package/lib/atom/button-menu/types.js.map +1 -1
- package/lib/atom/button-menu/utils.d.ts +23 -0
- package/lib/atom/button-menu/utils.d.ts.map +1 -0
- package/lib/atom/button-menu/utils.js +28 -0
- package/lib/atom/button-menu/utils.js.map +1 -0
- package/lib/atom/icon/index.d.ts +16 -0
- package/lib/atom/icon/index.d.ts.map +1 -1
- package/lib/atom/icon/index.js +4 -3
- package/lib/atom/icon/index.js.map +1 -1
- package/lib/molecule/bullet-point-menu-button/index.d.ts +1 -0
- package/lib/molecule/bullet-point-menu-button/index.d.ts.map +1 -1
- package/lib/molecule/bullet-point-menu-button/types.d.ts +1 -0
- package/lib/molecule/bullet-point-menu-button/types.d.ts.map +1 -1
- package/lib/molecule/cm-popin/index.d.ts.map +1 -1
- package/lib/molecule/cm-popin/index.js +92 -75
- package/lib/molecule/cm-popin/index.js.map +1 -1
- package/lib/molecule/cm-popin/style.css +18 -23
- package/lib/molecule/cm-popin/types.d.ts +19 -2
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/cm-popin/types.js +2 -1
- package/lib/molecule/cm-popin/types.js.map +1 -1
- package/lib/molecule/expandible-actionable-table/index.d.ts +2 -0
- package/lib/molecule/expandible-actionable-table/index.d.ts.map +1 -1
- package/lib/molecule/expandible-actionable-table/types.d.ts +2 -0
- package/lib/molecule/expandible-actionable-table/types.d.ts.map +1 -1
- package/lib/organism/header-with-actions/index.d.ts +1 -0
- package/lib/organism/header-with-actions/index.d.ts.map +1 -1
- package/lib/organism/header-with-actions/types.d.ts +1 -0
- package/lib/organism/header-with-actions/types.d.ts.map +1 -1
- package/lib/organism/list-items/index.d.ts +2 -0
- package/lib/organism/wizard-contents/index.d.ts +2 -0
- package/lib/template/app-player/loading/index.d.ts +17 -1
- package/lib/template/app-player/player/index.d.ts +34 -2
- package/lib/template/app-player/player/slides/index.d.ts +17 -1
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +17 -1
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +17 -1
- package/lib/template/app-review/index.d.ts +17 -1
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +17 -1
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.d.ts +17 -1
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +22 -1
- package/lib/template/back-office/brand-update/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.js +22 -3
- package/lib/template/back-office/brand-update/index.js.map +1 -1
- package/lib/template/back-office/brand-update/utils.d.ts +80 -0
- package/lib/template/back-office/brand-update/utils.d.ts.map +1 -0
- package/lib/template/back-office/brand-update/utils.js +64 -0
- package/lib/template/back-office/brand-update/utils.js.map +1 -0
- package/lib/template/common/dashboard/index.d.ts +34 -2
- package/lib/template/common/search-page/index.d.ts +17 -1
- package/lib/template/external-course/index.d.ts +17 -1
- package/lib/variables/colors.css +6 -1
- package/lib/variables/colors.d.ts +4 -0
- package/lib/variables/colors.d.ts.map +1 -1
- package/lib/variables/colors.js +5 -1
- package/lib/variables/colors.js.map +1 -1
- package/package.json +2 -2
|
@@ -11,6 +11,7 @@ declare const ButtonMenu: {
|
|
|
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<{
|
|
14
|
+
theme: import("prop-types").Requireable<string>;
|
|
14
15
|
position: import("prop-types").Requireable<string>;
|
|
15
16
|
type: import("prop-types").Requireable<string>;
|
|
16
17
|
faIcon: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-menu/index.tsx"],"names":[],"mappings":";AAKA,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":";AAKA,OAAkB,EAAC,eAAe,EAA+B,MAAM,SAAS,CAAC;AA8DjF,QAAA,MAAM,UAAU;YAAW,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiBzC,CAAC;AAIF,eAAe,UAAU,CAAC"}
|
|
@@ -5,6 +5,27 @@ import classnames from 'classnames';
|
|
|
5
5
|
import ButtonLink from '../button-link';
|
|
6
6
|
import style from './style.css';
|
|
7
7
|
import propTypes, { buttonPropTypes } from './types';
|
|
8
|
+
import { DEFAULT_ICON_STYLE, THEMES } from './utils';
|
|
9
|
+
const buildCustomIconByTheme = icon => {
|
|
10
|
+
if (!icon) return;
|
|
11
|
+
const {
|
|
12
|
+
theme,
|
|
13
|
+
...iconProps
|
|
14
|
+
} = icon;
|
|
15
|
+
const custom = theme && THEMES[theme];
|
|
16
|
+
if (!custom) return iconProps;
|
|
17
|
+
const customProps = custom ? {
|
|
18
|
+
...DEFAULT_ICON_STYLE,
|
|
19
|
+
faIcon: {
|
|
20
|
+
...DEFAULT_ICON_STYLE.faIcon,
|
|
21
|
+
...custom
|
|
22
|
+
}
|
|
23
|
+
} : null;
|
|
24
|
+
return {
|
|
25
|
+
...iconProps,
|
|
26
|
+
...customProps
|
|
27
|
+
};
|
|
28
|
+
};
|
|
8
29
|
const Button = props => {
|
|
9
30
|
const {
|
|
10
31
|
'data-name': dataName,
|
|
@@ -18,30 +39,22 @@ const Button = props => {
|
|
|
18
39
|
} = props;
|
|
19
40
|
const styleButton = classnames(style.button, type === 'default' && style.defaultStyle, type === 'defaultLeft' && style.defaultLeft, type === 'dangerous' && style.dangerous, type === 'dangerousLeft' && style.dangerousLeft, disabled && style.disabled);
|
|
20
41
|
const handleOnClick = useCallback(() => onClick(), [onClick]);
|
|
21
|
-
|
|
22
|
-
label: label,
|
|
42
|
+
const buttonLinkProps = {
|
|
43
|
+
'aria-label': label,
|
|
44
|
+
disabled,
|
|
45
|
+
label,
|
|
23
46
|
type: buttonLinkType,
|
|
24
|
-
disabled: disabled,
|
|
25
47
|
onClick: handleOnClick,
|
|
26
|
-
|
|
48
|
+
'data-name': dataName,
|
|
27
49
|
className: styleButton,
|
|
28
50
|
customStyle: {
|
|
29
51
|
...customStyle
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"data-name": dataName,
|
|
37
|
-
className: styleButton,
|
|
38
|
-
onClick: handleOnClick,
|
|
39
|
-
disabled: disabled
|
|
40
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
41
|
-
className: style.buttonContent
|
|
42
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
43
|
-
className: style.label
|
|
44
|
-
}, label)));
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const iconProps = buildCustomIconByTheme(icon);
|
|
55
|
+
return /*#__PURE__*/React.createElement(ButtonLink, _extends({}, buttonLinkProps, {
|
|
56
|
+
icon: iconProps
|
|
57
|
+
}));
|
|
45
58
|
};
|
|
46
59
|
Button.propTypes = process.env.NODE_ENV !== "production" ? buttonPropTypes : {};
|
|
47
60
|
const ButtonMenu = props => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","useCallback","map","classnames","ButtonLink","style","propTypes","buttonPropTypes","Button","props","dataName","disabled","label","onClick","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","disabled","label","onClick","type","buttonLinkType","customStyle","styleButton","button","defaultStyle","defaultLeft","dangerous","dangerousLeft","handleOnClick","buttonLinkProps","className","createElement","_extends","process","env","NODE_ENV","ButtonMenu","buttons","buildButton","index","key","buttonList","convert","cap","buttonMenuContainer"],"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 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 disabled,\n label,\n onClick,\n type = 'default',\n buttonLinkType,\n icon,\n customStyle = {}\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 'aria-label': label,\n disabled,\n label,\n type: buttonLinkType,\n onClick: handleOnClick,\n 'data-name': dataName,\n className: styleButton,\n customStyle: {...customStyle}\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} = 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 return (\n <div data-name={dataName} className={style.buttonMenuContainer}>\n {buttonList}\n </div>\n );\n};\n\nButtonMenu.propTypes = propTypes;\n\nexport default ButtonMenu;\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -33,16 +33,6 @@
|
|
|
33
33
|
pointer-events: none;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
.buttonContent {
|
|
37
|
-
display: flex;
|
|
38
|
-
justify-content: center;
|
|
39
|
-
align-items: center;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.label {
|
|
43
|
-
margin: 0 8px 0 8px;
|
|
44
|
-
display: block;
|
|
45
|
-
}
|
|
46
36
|
|
|
47
37
|
.defaultStyle {
|
|
48
38
|
background-color: transparent;
|
|
@@ -8,6 +8,7 @@ export declare const buttonPropTypes: {
|
|
|
8
8
|
type: PropTypes.Requireable<string>;
|
|
9
9
|
buttonLinkType: PropTypes.Requireable<string>;
|
|
10
10
|
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
11
|
+
theme: PropTypes.Requireable<string>;
|
|
11
12
|
position: PropTypes.Requireable<string>;
|
|
12
13
|
type: PropTypes.Requireable<string>;
|
|
13
14
|
faIcon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -33,6 +34,7 @@ declare const propTypes: {
|
|
|
33
34
|
type: PropTypes.Requireable<string>;
|
|
34
35
|
buttonLinkType: PropTypes.Requireable<string>;
|
|
35
36
|
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
37
|
+
theme: PropTypes.Requireable<string>;
|
|
36
38
|
position: PropTypes.Requireable<string>;
|
|
37
39
|
type: PropTypes.Requireable<string>;
|
|
38
40
|
faIcon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -53,6 +55,7 @@ declare const propTypes: {
|
|
|
53
55
|
'aria-label': PropTypes.Requireable<string>;
|
|
54
56
|
};
|
|
55
57
|
export default propTypes;
|
|
58
|
+
export declare type Theme = 'archive' | 'publish' | 'delete';
|
|
56
59
|
export declare type ButtonProps = {
|
|
57
60
|
'data-name'?: string;
|
|
58
61
|
disabled?: boolean;
|
|
@@ -60,7 +63,9 @@ export declare type ButtonProps = {
|
|
|
60
63
|
onClick: () => void;
|
|
61
64
|
type?: 'default' | 'defaultLeft' | 'dangerous' | 'dangerousLeft';
|
|
62
65
|
buttonLinkType?: ButtonLinkProps['type'];
|
|
63
|
-
icon?: IconType
|
|
66
|
+
icon?: IconType & {
|
|
67
|
+
theme?: Theme;
|
|
68
|
+
};
|
|
64
69
|
customStyle?: Record<string, string | number>;
|
|
65
70
|
};
|
|
66
71
|
export declare type ButtonMenuProps = {
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;CAY3B,CAAC;AAEF,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAId,CAAC;AAEF,eAAe,SAAS,CAAC;AAEzB,oBAAY,KAAK,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAErD,oBAAY,WAAW,GAAG;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,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,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;CAC/C,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,oBAAY,sBAAsB,GAAG;IAAC,KAAK,EAAE,eAAe,CAAA;CAAC,CAAC"}
|
|
@@ -7,7 +7,10 @@ export const buttonPropTypes = {
|
|
|
7
7
|
onClick: PropTypes.func.isRequired,
|
|
8
8
|
type: PropTypes.oneOf(['default', 'defaultLeft', 'dangerous', 'dangerousLeft']),
|
|
9
9
|
buttonLinkType: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),
|
|
10
|
-
icon: PropTypes.shape(
|
|
10
|
+
icon: PropTypes.shape({
|
|
11
|
+
...iconPropTypes,
|
|
12
|
+
theme: PropTypes.oneOf(['archive', 'publish', 'delete'])
|
|
13
|
+
}),
|
|
11
14
|
customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))
|
|
12
15
|
};
|
|
13
16
|
const propTypes = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["PropTypes","iconPropTypes","buttonPropTypes","string","disabled","bool","label","isRequired","onClick","func","type","oneOf","buttonLinkType","icon","shape","customStyle","objectOf","oneOfType","number","propTypes","buttons","arrayOf"],"sources":["../../../src/atom/button-menu/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport {ButtonLinkProps, IconType, iconPropTypes} from '../button-link/types';\n\nexport const buttonPropTypes = {\n 'data-name': PropTypes.string,\n disabled: PropTypes.bool,\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func.isRequired,\n type: PropTypes.oneOf(['default', 'defaultLeft', 'dangerous', 'dangerousLeft']),\n buttonLinkType: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),\n icon: PropTypes.shape(iconPropTypes),\n customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))\n};\n\nconst propTypes = {\n buttons: PropTypes.arrayOf(PropTypes.shape(buttonPropTypes)).isRequired,\n 'data-name': PropTypes.string,\n 'aria-label': PropTypes.string\n};\n\nexport default propTypes;\n\nexport type ButtonProps = {\n 'data-name'?: string;\n disabled?: boolean;\n label: string;\n onClick: () => void;\n type?: 'default' | 'defaultLeft' | 'dangerous' | 'dangerousLeft';\n buttonLinkType?: ButtonLinkProps['type'];\n icon?: IconType;\n customStyle?: Record<string, string | number>;\n};\n\nexport type ButtonMenuProps = {\n buttons: ButtonProps[];\n 'data-name'?: string;\n 'aria-label'?: string;\n};\n\nexport type ButtonMenuPropsFixture = {props: ButtonMenuProps};\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,YAAY;AAClC,SAAmCC,aAAa,QAAO,sBAAsB;AAE7E,OAAO,MAAMC,eAAe,GAAG;EAC7B,WAAW,EAAEF,SAAS,CAACG,MAAM;EAC7BC,QAAQ,EAAEJ,SAAS,CAACK,IAAI;EACxBC,KAAK,EAAEN,SAAS,CAACG,MAAM,CAACI,UAAU;EAClCC,OAAO,EAAER,SAAS,CAACS,IAAI,CAACF,UAAU;EAClCG,IAAI,EAAEV,SAAS,CAACW,KAAK,CAAC,CAAC,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC;EAC/EC,cAAc,EAAEZ,SAAS,CAACW,KAAK,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;EAC1FE,IAAI,EAAEb,SAAS,CAACc,KAAK,
|
|
1
|
+
{"version":3,"file":"types.js","names":["PropTypes","iconPropTypes","buttonPropTypes","string","disabled","bool","label","isRequired","onClick","func","type","oneOf","buttonLinkType","icon","shape","theme","customStyle","objectOf","oneOfType","number","propTypes","buttons","arrayOf"],"sources":["../../../src/atom/button-menu/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport {ButtonLinkProps, IconType, iconPropTypes} from '../button-link/types';\n\nexport const buttonPropTypes = {\n 'data-name': PropTypes.string,\n disabled: PropTypes.bool,\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func.isRequired,\n type: PropTypes.oneOf(['default', 'defaultLeft', 'dangerous', 'dangerousLeft']),\n buttonLinkType: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),\n icon: PropTypes.shape({\n ...iconPropTypes,\n theme: PropTypes.oneOf(['archive', 'publish', 'delete'])\n }),\n customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))\n};\n\nconst propTypes = {\n buttons: PropTypes.arrayOf(PropTypes.shape(buttonPropTypes)).isRequired,\n 'data-name': PropTypes.string,\n 'aria-label': PropTypes.string\n};\n\nexport default propTypes;\n\nexport type Theme = 'archive' | 'publish' | 'delete';\n\nexport type ButtonProps = {\n 'data-name'?: string;\n disabled?: boolean;\n label: string;\n onClick: () => void;\n type?: 'default' | 'defaultLeft' | 'dangerous' | 'dangerousLeft';\n buttonLinkType?: ButtonLinkProps['type'];\n icon?: IconType & {theme?: Theme};\n customStyle?: Record<string, string | number>;\n};\n\nexport type ButtonMenuProps = {\n buttons: ButtonProps[];\n 'data-name'?: string;\n 'aria-label'?: string;\n};\n\nexport type ButtonMenuPropsFixture = {props: ButtonMenuProps};\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,YAAY;AAClC,SAAmCC,aAAa,QAAO,sBAAsB;AAE7E,OAAO,MAAMC,eAAe,GAAG;EAC7B,WAAW,EAAEF,SAAS,CAACG,MAAM;EAC7BC,QAAQ,EAAEJ,SAAS,CAACK,IAAI;EACxBC,KAAK,EAAEN,SAAS,CAACG,MAAM,CAACI,UAAU;EAClCC,OAAO,EAAER,SAAS,CAACS,IAAI,CAACF,UAAU;EAClCG,IAAI,EAAEV,SAAS,CAACW,KAAK,CAAC,CAAC,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC;EAC/EC,cAAc,EAAEZ,SAAS,CAACW,KAAK,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;EAC1FE,IAAI,EAAEb,SAAS,CAACc,KAAK,CAAC;IACpB,GAAGb,aAAa;IAChBc,KAAK,EAAEf,SAAS,CAACW,KAAK,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC;EACzD,CAAC,CAAC;EACFK,WAAW,EAAEhB,SAAS,CAACiB,QAAQ,CAACjB,SAAS,CAACkB,SAAS,CAAC,CAAClB,SAAS,CAACG,MAAM,EAAEH,SAAS,CAACmB,MAAM,CAAC,CAAC;AAC3F,CAAC;AAED,MAAMC,SAAS,GAAG;EAChBC,OAAO,EAAErB,SAAS,CAACsB,OAAO,CAACtB,SAAS,CAACc,KAAK,CAACZ,eAAe,CAAC,CAAC,CAACK,UAAU;EACvE,WAAW,EAAEP,SAAS,CAACG,MAAM;EAC7B,YAAY,EAAEH,SAAS,CAACG;AAC1B,CAAC;AAED,eAAeiB,SAAS","ignoreList":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const DEFAULT_ICON_STYLE: {
|
|
2
|
+
position: "left";
|
|
3
|
+
faIcon: {
|
|
4
|
+
size: number;
|
|
5
|
+
color: "#515161";
|
|
6
|
+
customStyle: {
|
|
7
|
+
padding: number;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare const THEMES: {
|
|
12
|
+
publish: {
|
|
13
|
+
name: string;
|
|
14
|
+
};
|
|
15
|
+
archive: {
|
|
16
|
+
name: string;
|
|
17
|
+
};
|
|
18
|
+
delete: {
|
|
19
|
+
name: string;
|
|
20
|
+
color: "#B81400";
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/atom/button-menu/utils.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB;;;;;;;;;CAO9B,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;;;;;CAIlB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { COLORS } from '../../variables/colors';
|
|
2
|
+
export const DEFAULT_ICON_STYLE = {
|
|
3
|
+
position: 'left',
|
|
4
|
+
faIcon: {
|
|
5
|
+
size: 14,
|
|
6
|
+
color: COLORS.cm_grey_500,
|
|
7
|
+
customStyle: {
|
|
8
|
+
padding: 0
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
export const THEMES = {
|
|
13
|
+
publish: {
|
|
14
|
+
name: 'cloud-arrow-up'
|
|
15
|
+
},
|
|
16
|
+
archive: {
|
|
17
|
+
name: 'folder-open'
|
|
18
|
+
},
|
|
19
|
+
delete: {
|
|
20
|
+
name: 'trash',
|
|
21
|
+
color: COLORS.cm_negative_200
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","names":["COLORS","DEFAULT_ICON_STYLE","position","faIcon","size","color","cm_grey_500","customStyle","padding","THEMES","publish","name","archive","delete","cm_negative_200"],"sources":["../../../src/atom/button-menu/utils.ts"],"sourcesContent":["import {COLORS} from '../../variables/colors';\n\nexport const DEFAULT_ICON_STYLE = {\n position: 'left' as const,\n faIcon: {\n size: 14,\n color: COLORS.cm_grey_500,\n customStyle: {padding: 0}\n }\n};\n\nexport const THEMES = {\n publish: {name: 'cloud-arrow-up'},\n archive: {name: 'folder-open'},\n delete: {name: 'trash', color: COLORS.cm_negative_200}\n};\n"],"mappings":"AAAA,SAAQA,MAAM,QAAO,wBAAwB;AAE7C,OAAO,MAAMC,kBAAkB,GAAG;EAChCC,QAAQ,EAAE,MAAe;EACzBC,MAAM,EAAE;IACNC,IAAI,EAAE,EAAE;IACRC,KAAK,EAAEL,MAAM,CAACM,WAAW;IACzBC,WAAW,EAAE;MAACC,OAAO,EAAE;IAAC;EAC1B;AACF,CAAC;AAED,OAAO,MAAMC,MAAM,GAAG;EACpBC,OAAO,EAAE;IAACC,IAAI,EAAE;EAAgB,CAAC;EACjCC,OAAO,EAAE;IAACD,IAAI,EAAE;EAAa,CAAC;EAC9BE,MAAM,EAAE;IAACF,IAAI,EAAE,OAAO;IAAEN,KAAK,EAAEL,MAAM,CAACc;EAAe;AACvD,CAAC","ignoreList":[]}
|
package/es/atom/icon/index.d.ts
CHANGED
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
export const DEFAULT_ICON_COLOR: "hsl(0, 0%, 32%)";
|
|
2
2
|
export function createGradientBackground(baseColor: any): string;
|
|
3
3
|
export function getForegroundColor(backgroundColor: any): any;
|
|
4
|
+
export namespace iconPropTypes {
|
|
5
|
+
const iconName: PropTypes.Validator<string>;
|
|
6
|
+
const iconColor: PropTypes.Requireable<string>;
|
|
7
|
+
const backgroundColor: PropTypes.Requireable<string>;
|
|
8
|
+
const gradientBackground: PropTypes.Requireable<boolean>;
|
|
9
|
+
const borderRadius: PropTypes.Requireable<string>;
|
|
10
|
+
const preset: PropTypes.Requireable<string>;
|
|
11
|
+
const size: PropTypes.Requireable<PropTypes.InferProps<{
|
|
12
|
+
faSize: PropTypes.Requireable<number>;
|
|
13
|
+
wrapperSize: PropTypes.Requireable<number>;
|
|
14
|
+
}>>;
|
|
15
|
+
const customStyle: PropTypes.Requireable<{
|
|
16
|
+
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
}
|
|
4
19
|
export default Icon;
|
|
20
|
+
import PropTypes from "prop-types";
|
|
5
21
|
declare const Icon: React.NamedExoticComponent<object>;
|
|
6
22
|
import React from "react";
|
|
7
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/icon/index.js"],"names":[],"mappings":"AAiBA,mDAAoD;AAiB7C,iEAIN;AAEM,8DAC8D
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/icon/index.js"],"names":[],"mappings":"AAiBA,mDAAoD;AAiB7C,iEAIN;AAEM,8DAC8D;;;;;;;;;;;;;;;;;;AAGrE,uDAoCG"}
|
package/es/atom/icon/index.js
CHANGED
|
@@ -68,7 +68,7 @@ const Icon = /*#__PURE__*/React.memo(function Icon({
|
|
|
68
68
|
fontSize: effectiveSize.faSize
|
|
69
69
|
}));
|
|
70
70
|
});
|
|
71
|
-
|
|
71
|
+
export const iconPropTypes = {
|
|
72
72
|
iconName: PropTypes.string.isRequired,
|
|
73
73
|
iconColor: PropTypes.string,
|
|
74
74
|
backgroundColor: PropTypes.string,
|
|
@@ -80,6 +80,7 @@ Icon.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
80
80
|
wrapperSize: PropTypes.number
|
|
81
81
|
}),
|
|
82
82
|
customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))
|
|
83
|
-
}
|
|
83
|
+
};
|
|
84
|
+
Icon.propTypes = process.env.NODE_ENV !== "production" ? iconPropTypes : {};
|
|
84
85
|
export default Icon;
|
|
85
86
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","number","FontAwesomeIcon","fas","library","toLower","merge","getOr","convert","style","add","DEFAULT_PRESET","ICON_LUMINOSITY","DEFAULT_WRAPPER_SIZE","ICON_PADDING","DEFAULT_ICON_COLOR","SIZE_CONFIGS","s","faSize","wrapperSize","m","xl","createGradientBackground","baseColor","startColor","endColor","getForegroundColor","backgroundColor","Icon","memo","iconName","iconColor","gradientBackground","borderRadius","preset","size","customStyle","effectiveIconColor","effectiveSize","iconWrapperStyle","background","width","height","padding","createElement","className","iconWrapper","icon","color","fontSize","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","number","FontAwesomeIcon","fas","library","toLower","merge","getOr","convert","style","add","DEFAULT_PRESET","ICON_LUMINOSITY","DEFAULT_WRAPPER_SIZE","ICON_PADDING","DEFAULT_ICON_COLOR","SIZE_CONFIGS","s","faSize","wrapperSize","m","xl","createGradientBackground","baseColor","startColor","endColor","getForegroundColor","backgroundColor","Icon","memo","iconName","iconColor","gradientBackground","borderRadius","preset","size","customStyle","effectiveIconColor","effectiveSize","iconWrapperStyle","background","width","height","padding","createElement","className","iconWrapper","icon","color","fontSize","iconPropTypes","string","isRequired","bool","oneOf","shape","objectOf","oneOfType","propTypes","process","env","NODE_ENV"],"sources":["../../../src/atom/icon/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes, {number} from 'prop-types';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {fas} from '@fortawesome/pro-solid-svg-icons';\nimport {library} from '@fortawesome/fontawesome-svg-core';\nimport toLower from 'lodash/fp/toLower';\nimport merge from 'lodash/fp/merge';\nimport getOr from 'lodash/fp/getOr';\nimport {convert} from 'css-color-function';\nimport style from './style.css';\n\nlibrary.add(fas);\n\nconst DEFAULT_PRESET = 'm';\nconst ICON_LUMINOSITY = 32;\nconst DEFAULT_WRAPPER_SIZE = 40;\nconst ICON_PADDING = 8;\nexport const DEFAULT_ICON_COLOR = 'hsl(0, 0%, 32%)';\n\nconst SIZE_CONFIGS = {\n s: {\n faSize: 12,\n wrapperSize: 32\n },\n m: {\n faSize: 16,\n wrapperSize: DEFAULT_WRAPPER_SIZE\n },\n xl: {\n faSize: 20,\n wrapperSize: 48\n }\n};\n\nexport const createGradientBackground = baseColor => {\n const startColor = convert(`color(${baseColor} lightness(91%))`);\n const endColor = convert(`color(${baseColor} lightness(81%))`);\n return `linear-gradient(180deg, ${startColor} 0%, ${endColor} 100%)`;\n};\n\nexport const getForegroundColor = backgroundColor =>\n convert(`color(${backgroundColor} lightness(${ICON_LUMINOSITY}%))`);\n// set lightness to 32%\n\nconst Icon = React.memo(function Icon({\n iconName,\n iconColor,\n backgroundColor,\n gradientBackground,\n borderRadius,\n preset = DEFAULT_PRESET,\n size,\n customStyle\n}) {\n const effectiveIconColor =\n iconColor || (backgroundColor ? getForegroundColor(backgroundColor) : DEFAULT_ICON_COLOR);\n\n const effectiveSize = size\n ? merge(SIZE_CONFIGS[DEFAULT_PRESET], size)\n : getOr(SIZE_CONFIGS[DEFAULT_PRESET], toLower(preset), SIZE_CONFIGS);\n\n const wrapperSize = effectiveSize.wrapperSize - ICON_PADDING * 2;\n\n const iconWrapperStyle = {\n background: gradientBackground ? createGradientBackground(effectiveIconColor) : backgroundColor,\n borderRadius,\n width: wrapperSize,\n height: wrapperSize,\n padding: ICON_PADDING\n };\n\n return (\n <div className={style.iconWrapper} style={{...iconWrapperStyle, ...customStyle}}>\n <FontAwesomeIcon\n icon={`fa-${iconName}`}\n color={effectiveIconColor}\n fontSize={effectiveSize.faSize}\n />\n </div>\n );\n});\n\nexport const iconPropTypes = {\n iconName: PropTypes.string.isRequired,\n iconColor: PropTypes.string,\n backgroundColor: PropTypes.string,\n gradientBackground: PropTypes.bool,\n borderRadius: PropTypes.string,\n preset: PropTypes.oneOf(['s', 'm', 'xl']),\n size: PropTypes.shape({\n faSize: number,\n wrapperSize: PropTypes.number\n }),\n customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))\n};\n\nIcon.propTypes = iconPropTypes;\n\nexport default Icon;\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -14,6 +14,7 @@ declare const BulletPointMenuButton: {
|
|
|
14
14
|
type: import("prop-types").Requireable<string>;
|
|
15
15
|
buttonLinkType: import("prop-types").Requireable<string>;
|
|
16
16
|
icon: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
17
|
+
theme: import("prop-types").Requireable<string>;
|
|
17
18
|
position: import("prop-types").Requireable<string>;
|
|
18
19
|
type: import("prop-types").Requireable<string>;
|
|
19
20
|
faIcon: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/bullet-point-menu-button/index.tsx"],"names":[],"mappings":";AAKA,OAAkB,EAAC,0BAA0B,EAAC,MAAM,SAAS,CAAC;AAG9D,QAAA,MAAM,qBAAqB;YAAW,0BAA0B
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/bullet-point-menu-button/index.tsx"],"names":[],"mappings":";AAKA,OAAkB,EAAC,0BAA0B,EAAC,MAAM,SAAS,CAAC;AAG9D,QAAA,MAAM,qBAAqB;YAAW,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2D/D,CAAC;AAIF,eAAe,qBAAqB,CAAC"}
|
|
@@ -12,6 +12,7 @@ declare const propTypes: {
|
|
|
12
12
|
type: PropTypes.Requireable<string>;
|
|
13
13
|
buttonLinkType: PropTypes.Requireable<string>;
|
|
14
14
|
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
15
|
+
theme: PropTypes.Requireable<string>;
|
|
15
16
|
position: PropTypes.Requireable<string>;
|
|
16
17
|
type: PropTypes.Requireable<string>;
|
|
17
18
|
faIcon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/bullet-point-menu-button/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,QAAA,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/bullet-point-menu-button/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQd,CAAC;AAEF,eAAe,SAAS,CAAC;AAEzB,oBAAY,0BAA0B,GAAG;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,oBAAY,iCAAiC,GAAG;IAAC,KAAK,EAAE,0BAA0B,CAAA;CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/index.js"],"names":[],"mappings":";AA4CA,kDAqRC"}
|
|
@@ -1,18 +1,29 @@
|
|
|
1
|
+
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); }
|
|
1
2
|
import React, { useRef, useEffect, useMemo } from 'react';
|
|
2
3
|
import { NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond, NovaSolidApplicationsWindowUpload3 as WindowUpload, NovaLineSettingsCookie as Cookie, NovaSolidSpaceMoonRocket as MoonRocket, NovaCompositionCoorpacademyPadlock as LockIcon, NovaLineStatusCheckCircle1 as CheckCircle1, NovaSolidFilesBasicFileLines as FileLinesIcon, NovaSolidInterfaceFeedbackInterfaceAlertRounded as AlertIcon } from '@coorpacademy/nova-icons';
|
|
3
4
|
import map from 'lodash/fp/map';
|
|
4
5
|
import isEmpty from 'lodash/fp/isEmpty';
|
|
5
6
|
import classNames from 'classnames';
|
|
6
7
|
import Provider from '../../atom/provider';
|
|
7
|
-
import
|
|
8
|
+
import ButtonLink from '../../atom/button-link';
|
|
8
9
|
import ButtonLinkIcon from '../../atom/button-link-icon';
|
|
9
10
|
import InputSwitch from '../../atom/input-switch';
|
|
10
11
|
import Title from '../../atom/title';
|
|
11
12
|
import CardsGrid from '../../organism/cards-grid';
|
|
12
13
|
import ListItems from '../../organism/list-items';
|
|
13
14
|
import Link from '../../atom/link';
|
|
15
|
+
import Icon from '../../atom/icon';
|
|
14
16
|
import style from './style.css';
|
|
15
17
|
import propTypes from './types';
|
|
18
|
+
|
|
19
|
+
// DEPRECATED
|
|
20
|
+
const LOGO = {
|
|
21
|
+
AlertDiamond,
|
|
22
|
+
WindowUpload,
|
|
23
|
+
MoonRocket,
|
|
24
|
+
CheckCircle1,
|
|
25
|
+
AlertIcon
|
|
26
|
+
};
|
|
16
27
|
const IconType = {
|
|
17
28
|
lockedContent: /*#__PURE__*/React.createElement(LockIcon, {
|
|
18
29
|
className: style.lockIcon
|
|
@@ -41,14 +52,6 @@ const CMPopin = props => {
|
|
|
41
52
|
items,
|
|
42
53
|
link
|
|
43
54
|
} = props;
|
|
44
|
-
const logo = {
|
|
45
|
-
AlertDiamond,
|
|
46
|
-
WindowUpload,
|
|
47
|
-
MoonRocket,
|
|
48
|
-
CheckCircle1,
|
|
49
|
-
AlertIcon
|
|
50
|
-
};
|
|
51
|
-
const LogoComponent = logo[icon];
|
|
52
55
|
const backgroundImageStyle = backgroundImageUrl ? {
|
|
53
56
|
backgroundImage: `url(${backgroundImageUrl})`,
|
|
54
57
|
backgroundSize: 'cover'
|
|
@@ -77,7 +80,19 @@ const CMPopin = props => {
|
|
|
77
80
|
};
|
|
78
81
|
}
|
|
79
82
|
}, [handleCloseButton, mode, onClose]);
|
|
80
|
-
const
|
|
83
|
+
const wrapperPopinStyle = classNames(style.popin, mode === 'cookie' && style.popinCookie, mode === 'list' && style.popinFilesList, mode === 'items' && style.popinItems);
|
|
84
|
+
const buildIcon = () => {
|
|
85
|
+
if (typeof icon === 'string') {
|
|
86
|
+
const LogoComponent = LOGO[icon];
|
|
87
|
+
return LogoComponent ? /*#__PURE__*/React.createElement(LogoComponent, {
|
|
88
|
+
className: style.icon
|
|
89
|
+
}) : null;
|
|
90
|
+
}
|
|
91
|
+
return !isEmpty(icon) ? /*#__PURE__*/React.createElement(Icon, _extends({}, icon, {
|
|
92
|
+
className: style.icon
|
|
93
|
+
})) : null;
|
|
94
|
+
};
|
|
95
|
+
const buildHeader = () => {
|
|
81
96
|
if (header) {
|
|
82
97
|
const {
|
|
83
98
|
title,
|
|
@@ -101,7 +116,22 @@ const CMPopin = props => {
|
|
|
101
116
|
})), /*#__PURE__*/React.createElement("div", {
|
|
102
117
|
className: style.cookieTitle
|
|
103
118
|
}, cookieTitle));
|
|
104
|
-
|
|
119
|
+
};
|
|
120
|
+
const renderHeader = () => {
|
|
121
|
+
const headerContent = buildHeader();
|
|
122
|
+
const close = onClose ? /*#__PURE__*/React.createElement("div", {
|
|
123
|
+
className: style.onCloseButton
|
|
124
|
+
}, /*#__PURE__*/React.createElement(ButtonLinkIcon, {
|
|
125
|
+
onClick: handleCloseButton,
|
|
126
|
+
"data-name": 'close-icon',
|
|
127
|
+
"aria-label": 'close-icon',
|
|
128
|
+
size: "small",
|
|
129
|
+
icon: "close"
|
|
130
|
+
})) : null;
|
|
131
|
+
if (isEmpty(headerContent) && isEmpty(close)) return null;
|
|
132
|
+
return /*#__PURE__*/React.createElement("header", {
|
|
133
|
+
className: style.popinHeader
|
|
134
|
+
}, headerContent, close);
|
|
105
135
|
};
|
|
106
136
|
const getClassBtnSwitch = (index, btnList) => {
|
|
107
137
|
switch (index) {
|
|
@@ -149,11 +179,11 @@ const CMPopin = props => {
|
|
|
149
179
|
})(listBtnSwicth);
|
|
150
180
|
};
|
|
151
181
|
const renderItems = () => {
|
|
182
|
+
if (isEmpty(items)) return null;
|
|
152
183
|
const {
|
|
153
184
|
type,
|
|
154
185
|
list
|
|
155
186
|
} = items;
|
|
156
|
-
if (isEmpty(list)) return null;
|
|
157
187
|
if (type === 'content') return /*#__PURE__*/React.createElement("div", {
|
|
158
188
|
className: style.itemsContainer,
|
|
159
189
|
"data-name": 'cm-popin-cards'
|
|
@@ -163,7 +193,56 @@ const CMPopin = props => {
|
|
|
163
193
|
}, /*#__PURE__*/React.createElement(ListItems, list));
|
|
164
194
|
return null;
|
|
165
195
|
};
|
|
166
|
-
const
|
|
196
|
+
const renderContent = () => {
|
|
197
|
+
if (mode === 'items' || mode === 'list') return;
|
|
198
|
+
const isCookieOrInformations = mode === 'cookie' || mode === 'information';
|
|
199
|
+
const renderContentTitle = () => {
|
|
200
|
+
if (!content) return null;
|
|
201
|
+
if (isCookieOrInformations) return /*#__PURE__*/React.createElement("p", {
|
|
202
|
+
className: mode === 'alert' ? style.content : style.message,
|
|
203
|
+
"data-name": 'cm-popin-content'
|
|
204
|
+
// eslint-disable-next-line react/no-danger
|
|
205
|
+
,
|
|
206
|
+
dangerouslySetInnerHTML: {
|
|
207
|
+
__html: content
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
211
|
+
className: mode === 'alert' ? style.content : style.message
|
|
212
|
+
}, /*#__PURE__*/React.createElement(Title, {
|
|
213
|
+
title: content,
|
|
214
|
+
"data-name": 'cm-popin-content'
|
|
215
|
+
}));
|
|
216
|
+
};
|
|
217
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
218
|
+
className: isCookieOrInformations ? style.cookieTitleContainer : style.titleContainer
|
|
219
|
+
}, buildIcon(), /*#__PURE__*/React.createElement("div", {
|
|
220
|
+
className: style.contentSection
|
|
221
|
+
}, renderContentTitle(), descriptionText ? /*#__PURE__*/React.createElement("div", {
|
|
222
|
+
className: style.descriptionText
|
|
223
|
+
}, descriptionText) : null), link ? /*#__PURE__*/React.createElement(Link, link) : null);
|
|
224
|
+
};
|
|
225
|
+
const renderButtons = () => {
|
|
226
|
+
if (!firstButton && !secondButton && !thirdButton) return null;
|
|
227
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
228
|
+
className: style.buttonContainer
|
|
229
|
+
}, firstButton ? /*#__PURE__*/React.createElement("div", {
|
|
230
|
+
className: firstButton.largeButton ? style.largeButton : style.button
|
|
231
|
+
}, /*#__PURE__*/React.createElement(ButtonLink, _extends({}, firstButton, {
|
|
232
|
+
onClick: firstButton.handleOnclick,
|
|
233
|
+
"data-name": 'cm-popin-cta'
|
|
234
|
+
}))) : null, secondButton ? /*#__PURE__*/React.createElement("div", {
|
|
235
|
+
className: secondButton.largeButton ? style.largeButton : style.button
|
|
236
|
+
}, /*#__PURE__*/React.createElement(ButtonLink, _extends({}, secondButton, {
|
|
237
|
+
onClick: secondButton.handleOnclick,
|
|
238
|
+
"data-name": `cm-popin-cta-${secondButton.type}`
|
|
239
|
+
}))) : null, thirdButton ? /*#__PURE__*/React.createElement("div", {
|
|
240
|
+
className: thirdButton.largeButton ? style.largeButton : style.button
|
|
241
|
+
}, /*#__PURE__*/React.createElement(ButtonLink, _extends({}, thirdButton, {
|
|
242
|
+
onClick: thirdButton.handleOnclick,
|
|
243
|
+
"data-name": `cm-popin-cta-${thirdButton.type}`
|
|
244
|
+
}))) : null);
|
|
245
|
+
};
|
|
167
246
|
return /*#__PURE__*/React.createElement("div", {
|
|
168
247
|
className: mode !== 'cookie' ? style.background : null,
|
|
169
248
|
style: backgroundImageStyle,
|
|
@@ -171,70 +250,9 @@ const CMPopin = props => {
|
|
|
171
250
|
}, /*#__PURE__*/React.createElement("div", {
|
|
172
251
|
className: wrapperPopinStyle,
|
|
173
252
|
ref: nodeRef
|
|
174
|
-
}, /*#__PURE__*/React.createElement("
|
|
175
|
-
className: style.popinHeader
|
|
176
|
-
}, renderHeader(), onClose ? /*#__PURE__*/React.createElement("div", {
|
|
177
|
-
className: style.onCloseButton
|
|
178
|
-
}, /*#__PURE__*/React.createElement(ButtonLinkIcon, {
|
|
179
|
-
onClick: handleCloseButton,
|
|
180
|
-
"data-name": 'close-icon',
|
|
181
|
-
"aria-label": 'close-icon',
|
|
182
|
-
size: "small",
|
|
183
|
-
icon: "close"
|
|
184
|
-
})) : null), mode !== 'items' && mode !== 'list' ? /*#__PURE__*/React.createElement("div", {
|
|
185
|
-
className: mode === 'cookie' || mode === 'information' ? style.cookieTitleContainer : style.titleContainer
|
|
186
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
187
|
-
className: style.contentSection
|
|
188
|
-
}, LogoComponent ? /*#__PURE__*/React.createElement(LogoComponent, {
|
|
189
|
-
className: style.icon
|
|
190
|
-
}) : null, content ? /*#__PURE__*/React.createElement("p", {
|
|
191
|
-
className: mode === 'alert' ? style.content : style.message,
|
|
192
|
-
"data-name": 'cm-popin-content'
|
|
193
|
-
// eslint-disable-next-line react/no-danger
|
|
194
|
-
,
|
|
195
|
-
dangerouslySetInnerHTML: {
|
|
196
|
-
__html: content
|
|
197
|
-
}
|
|
198
|
-
}) : null), descriptionText ? /*#__PURE__*/React.createElement("p", {
|
|
199
|
-
className: style.descriptionText
|
|
200
|
-
// eslint-disable-next-line react/no-danger
|
|
201
|
-
,
|
|
202
|
-
dangerouslySetInnerHTML: {
|
|
203
|
-
__html: descriptionText
|
|
204
|
-
}
|
|
205
|
-
}) : null, link ? /*#__PURE__*/React.createElement(Link, link) : null) : null, descriptionBtnTxt ? /*#__PURE__*/React.createElement("div", {
|
|
253
|
+
}, renderHeader(), renderContent(), descriptionBtnTxt ? /*#__PURE__*/React.createElement("div", {
|
|
206
254
|
className: style.descriptionBtn
|
|
207
|
-
}, descriptionBtnTxt) : null,
|
|
208
|
-
className: style.buttonContainer
|
|
209
|
-
}, firstButton ? /*#__PURE__*/React.createElement("div", {
|
|
210
|
-
className: firstButton.largeButton ? style.largeButton : style.button
|
|
211
|
-
}, /*#__PURE__*/React.createElement(Cta, {
|
|
212
|
-
label: firstButton.label,
|
|
213
|
-
onClick: firstButton.handleOnclick,
|
|
214
|
-
"data-name": 'cm-popin-cta',
|
|
215
|
-
"aria-label": firstButton['aria-label'],
|
|
216
|
-
type: firstButton.type,
|
|
217
|
-
customStyle: firstButton.customStyle
|
|
218
|
-
})) : null, secondButton ? /*#__PURE__*/React.createElement("div", {
|
|
219
|
-
className: secondButton.largeButton ? style.largeButton : style.button
|
|
220
|
-
}, /*#__PURE__*/React.createElement(Cta, {
|
|
221
|
-
label: secondButton.label,
|
|
222
|
-
onClick: secondButton.handleOnclick,
|
|
223
|
-
"data-name": `cm-popin-cta-${secondButton.type}`,
|
|
224
|
-
"aria-label": secondButton['aria-label'],
|
|
225
|
-
type: secondButton.type,
|
|
226
|
-
customStyle: secondButton.customStyle,
|
|
227
|
-
icon: secondButton.icon
|
|
228
|
-
})) : null, thirdButton ? /*#__PURE__*/React.createElement("div", {
|
|
229
|
-
className: thirdButton.largeButton ? style.largeButton : style.button
|
|
230
|
-
}, /*#__PURE__*/React.createElement(Cta, {
|
|
231
|
-
label: thirdButton.label,
|
|
232
|
-
onClick: thirdButton.handleOnclick,
|
|
233
|
-
"data-name": `cm-popin-cta-${thirdButton.type}`,
|
|
234
|
-
"aria-label": thirdButton['aria-label'],
|
|
235
|
-
type: thirdButton.type,
|
|
236
|
-
customStyle: thirdButton.customStyle
|
|
237
|
-
})) : null) : null));
|
|
255
|
+
}, descriptionBtnTxt) : null, renderItems(), renderBtnSwitch(), renderButtons()));
|
|
238
256
|
};
|
|
239
257
|
CMPopin.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
240
258
|
CMPopin.contextTypes = {
|