@coorpacademy/components 11.33.3-alpha.12 → 11.33.3
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 +0 -1
- package/es/atom/button-link/index.d.ts.map +1 -1
- package/es/atom/button-link/index.js +7 -11
- package/es/atom/button-link/index.js.map +1 -1
- package/es/atom/button-link/style.css +0 -10
- package/es/atom/button-link/types.d.ts +0 -2
- package/es/atom/button-link/types.d.ts.map +1 -1
- package/es/atom/button-link/types.js +1 -2
- package/es/atom/button-link/types.js.map +1 -1
- package/es/atom/button-link-icon/style.css +2 -2
- package/es/atom/button-menu/index.d.ts +0 -15
- package/es/atom/button-menu/index.d.ts.map +1 -1
- package/es/atom/button-menu/index.js +5 -43
- package/es/atom/button-menu/index.js.map +1 -1
- package/es/atom/button-menu/style.css +0 -13
- package/es/atom/button-menu/types.d.ts +0 -40
- package/es/atom/button-menu/types.d.ts.map +1 -1
- package/es/atom/button-menu/types.js +1 -16
- package/es/atom/button-menu/types.js.map +1 -1
- package/es/atom/tag/style.css +6 -10
- package/es/molecule/bullet-point-menu-button/index.d.ts +0 -16
- package/es/molecule/bullet-point-menu-button/index.d.ts.map +1 -1
- package/es/molecule/bullet-point-menu-button/index.js +3 -5
- package/es/molecule/bullet-point-menu-button/index.js.map +1 -1
- package/es/molecule/bullet-point-menu-button/style.css +7 -26
- package/es/molecule/bullet-point-menu-button/types.d.ts +0 -17
- package/es/molecule/bullet-point-menu-button/types.d.ts.map +1 -1
- package/es/molecule/bullet-point-menu-button/types.js +1 -2
- package/es/molecule/bullet-point-menu-button/types.js.map +1 -1
- package/es/molecule/cm-popin/types.d.ts +0 -34
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/expandible-actionable-table/index.d.ts +0 -33
- package/es/molecule/expandible-actionable-table/index.d.ts.map +1 -1
- package/es/molecule/expandible-actionable-table/types.d.ts +0 -33
- package/es/molecule/expandible-actionable-table/types.d.ts.map +1 -1
- package/es/organism/list-items/index.d.ts +0 -34
- package/es/organism/setup-header/index.d.ts +0 -4
- package/es/organism/wizard-contents/index.d.ts +0 -35
- package/es/template/app-player/loading/index.d.ts +0 -34
- package/es/template/app-player/player/index.d.ts +0 -68
- package/es/template/app-player/player/slides/index.d.ts +0 -34
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +0 -34
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +0 -34
- package/es/template/app-review/index.d.ts +0 -34
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +0 -34
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.d.ts +0 -34
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/back-office/brand-create/index.d.ts +0 -4
- package/es/template/back-office/brand-create/index.d.ts.map +1 -1
- package/es/template/back-office/brand-list/index.d.ts +0 -4
- package/es/template/back-office/brand-list/index.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +0 -107
- package/es/template/back-office/dashboard-preview/index.d.ts +0 -4
- package/es/template/back-office/layout/index.d.ts +0 -4
- package/es/template/back-office/layout/index.d.ts.map +1 -1
- package/es/template/common/dashboard/index.d.ts +0 -68
- package/es/template/common/search-page/index.d.ts +0 -34
- package/es/template/external-course/index.d.ts +0 -34
- package/es/variables/colors.css +0 -3
- package/lib/atom/button-link/index.d.ts +0 -1
- package/lib/atom/button-link/index.d.ts.map +1 -1
- package/lib/atom/button-link/index.js +7 -11
- package/lib/atom/button-link/index.js.map +1 -1
- package/lib/atom/button-link/style.css +0 -10
- package/lib/atom/button-link/types.d.ts +0 -2
- package/lib/atom/button-link/types.d.ts.map +1 -1
- package/lib/atom/button-link/types.js +1 -2
- package/lib/atom/button-link/types.js.map +1 -1
- package/lib/atom/button-link-icon/style.css +2 -2
- package/lib/atom/button-menu/index.d.ts +0 -15
- package/lib/atom/button-menu/index.d.ts.map +1 -1
- package/lib/atom/button-menu/index.js +5 -43
- package/lib/atom/button-menu/index.js.map +1 -1
- package/lib/atom/button-menu/style.css +0 -13
- package/lib/atom/button-menu/types.d.ts +0 -40
- package/lib/atom/button-menu/types.d.ts.map +1 -1
- package/lib/atom/button-menu/types.js +1 -16
- package/lib/atom/button-menu/types.js.map +1 -1
- package/lib/atom/tag/style.css +6 -10
- package/lib/molecule/bullet-point-menu-button/index.d.ts +0 -16
- package/lib/molecule/bullet-point-menu-button/index.d.ts.map +1 -1
- package/lib/molecule/bullet-point-menu-button/index.js +3 -5
- package/lib/molecule/bullet-point-menu-button/index.js.map +1 -1
- package/lib/molecule/bullet-point-menu-button/style.css +7 -26
- package/lib/molecule/bullet-point-menu-button/types.d.ts +0 -17
- package/lib/molecule/bullet-point-menu-button/types.d.ts.map +1 -1
- package/lib/molecule/bullet-point-menu-button/types.js +1 -2
- package/lib/molecule/bullet-point-menu-button/types.js.map +1 -1
- package/lib/molecule/cm-popin/types.d.ts +0 -34
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/expandible-actionable-table/index.d.ts +0 -33
- package/lib/molecule/expandible-actionable-table/index.d.ts.map +1 -1
- package/lib/molecule/expandible-actionable-table/types.d.ts +0 -33
- package/lib/molecule/expandible-actionable-table/types.d.ts.map +1 -1
- package/lib/organism/list-items/index.d.ts +0 -34
- package/lib/organism/setup-header/index.d.ts +0 -4
- package/lib/organism/wizard-contents/index.d.ts +0 -35
- package/lib/template/app-player/loading/index.d.ts +0 -34
- package/lib/template/app-player/player/index.d.ts +0 -68
- package/lib/template/app-player/player/slides/index.d.ts +0 -34
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +0 -34
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +0 -34
- package/lib/template/app-review/index.d.ts +0 -34
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +0 -34
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.d.ts +0 -34
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/back-office/brand-create/index.d.ts +0 -4
- package/lib/template/back-office/brand-create/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-list/index.d.ts +0 -4
- package/lib/template/back-office/brand-list/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +0 -107
- package/lib/template/back-office/dashboard-preview/index.d.ts +0 -4
- package/lib/template/back-office/layout/index.d.ts +0 -4
- package/lib/template/back-office/layout/index.d.ts.map +1 -1
- package/lib/template/common/dashboard/index.d.ts +0 -68
- package/lib/template/common/search-page/index.d.ts +0 -34
- package/lib/template/external-course/index.d.ts +0 -34
- package/lib/variables/colors.css +0 -3
- package/package.json +3 -3
- package/es/organism/custom-skill-header/index.d.ts +0 -5
- package/es/organism/custom-skill-header/index.d.ts.map +0 -1
- package/es/organism/custom-skill-header/index.js +0 -88
- package/es/organism/custom-skill-header/index.js.map +0 -1
- package/es/organism/custom-skill-header/style.css +0 -54
- package/es/organism/custom-skill-header/types.d.ts +0 -28
- package/es/organism/custom-skill-header/types.d.ts.map +0 -1
- package/es/organism/custom-skill-header/types.js +0 -2
- package/es/organism/custom-skill-header/types.js.map +0 -1
- package/lib/organism/custom-skill-header/index.d.ts +0 -5
- package/lib/organism/custom-skill-header/index.d.ts.map +0 -1
- package/lib/organism/custom-skill-header/index.js +0 -93
- package/lib/organism/custom-skill-header/index.js.map +0 -1
- package/lib/organism/custom-skill-header/style.css +0 -54
- package/lib/organism/custom-skill-header/types.d.ts +0 -28
- package/lib/organism/custom-skill-header/types.d.ts.map +0 -1
- package/lib/organism/custom-skill-header/types.js +0 -4
- package/lib/organism/custom-skill-header/types.js.map +0 -1
- package/locales/.mtslconfig.json +0 -1
|
@@ -27,7 +27,6 @@ declare const ButtonLink: {
|
|
|
27
27
|
disabled: import("prop-types").Requireable<boolean>;
|
|
28
28
|
className: import("prop-types").Requireable<string>;
|
|
29
29
|
customStyle: import("prop-types").Requireable<import("prop-types").InferProps<{}>>;
|
|
30
|
-
isCustomSkillMenu: import("prop-types").Requireable<boolean>;
|
|
31
30
|
};
|
|
32
31
|
};
|
|
33
32
|
export default ButtonLink;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-link/index.tsx"],"names":[],"mappings":";AAOA,OAAkB,EAAC,eAAe,EAAW,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-link/index.tsx"],"names":[],"mappings":";AAOA,OAAkB,EAAC,eAAe,EAAW,MAAM,SAAS,CAAC;AAoD7D,QAAA,MAAM,UAAU;YAAW,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmIzC,CAAC;AAIF,eAAe,UAAU,CAAC"}
|
|
@@ -8,7 +8,7 @@ import { ICONS } from '../../util/button-icons';
|
|
|
8
8
|
import ToolTip from '../tooltip';
|
|
9
9
|
import propTypes from './types';
|
|
10
10
|
import style from './style.css';
|
|
11
|
-
const getButtonContent = (icon, content, hovered, hoverBackgroundColor, hoverColor
|
|
11
|
+
const getButtonContent = (icon, content, hovered, hoverBackgroundColor, hoverColor) => {
|
|
12
12
|
const {
|
|
13
13
|
type,
|
|
14
14
|
faIcon,
|
|
@@ -18,14 +18,11 @@ const getButtonContent = (icon, content, hovered, hoverBackgroundColor, hoverCol
|
|
|
18
18
|
position: ''
|
|
19
19
|
};
|
|
20
20
|
const Icon = type && ICONS[type];
|
|
21
|
-
const labelClassName = classnames(style.label, {
|
|
22
|
-
[style.customSkillLabel]: isCustomSkillMenu && faIcon
|
|
23
|
-
});
|
|
24
21
|
if (!Icon && !faIcon) {
|
|
25
22
|
return /*#__PURE__*/React.createElement("div", {
|
|
26
23
|
className: style.buttonContent
|
|
27
24
|
}, /*#__PURE__*/React.createElement("span", {
|
|
28
|
-
className:
|
|
25
|
+
className: style.label
|
|
29
26
|
}, content));
|
|
30
27
|
}
|
|
31
28
|
const iconComponent = faIcon ? /*#__PURE__*/React.createElement(FaIcon, {
|
|
@@ -45,7 +42,7 @@ const getButtonContent = (icon, content, hovered, hoverBackgroundColor, hoverCol
|
|
|
45
42
|
return /*#__PURE__*/React.createElement("div", {
|
|
46
43
|
className: style.buttonContent
|
|
47
44
|
}, position === 'left' ? iconComponent : null, content ? /*#__PURE__*/React.createElement("span", {
|
|
48
|
-
className:
|
|
45
|
+
className: style.label
|
|
49
46
|
}, content) : null, position === 'right' ? iconComponent : null);
|
|
50
47
|
};
|
|
51
48
|
const ButtonLink = props => {
|
|
@@ -68,10 +65,9 @@ const ButtonLink = props => {
|
|
|
68
65
|
onKeyDown = _noop,
|
|
69
66
|
className,
|
|
70
67
|
customStyle,
|
|
71
|
-
useTitle = true
|
|
72
|
-
isCustomSkillMenu
|
|
68
|
+
useTitle = true
|
|
73
69
|
} = props;
|
|
74
|
-
const styleButton = classnames(className, style.button, !label && style.iconButton, type === 'primary' && style.primary, type === 'secondary' && style.secondary, type === 'tertiary' && style.tertiary, type === 'text' && style.text, type === 'dangerous' && style.dangerous, link && style.link, disabled && style.disabled
|
|
70
|
+
const styleButton = classnames(className, style.button, !label && style.iconButton, type === 'primary' && style.primary, type === 'secondary' && style.secondary, type === 'tertiary' && style.tertiary, type === 'text' && style.text, type === 'dangerous' && style.dangerous, link && style.link, disabled && style.disabled);
|
|
75
71
|
const [hovered, setHovered] = useState(false);
|
|
76
72
|
const handleOnClick = useCallback(event => onClick(event), [onClick]);
|
|
77
73
|
const handleOnKeyDown = useCallback(event => onKeyDown(event), [onKeyDown]);
|
|
@@ -116,7 +112,7 @@ const ButtonLink = props => {
|
|
|
116
112
|
hoverBackgroundColor: hoverBackgroundColor,
|
|
117
113
|
onMouseEnter: handleMouseOver,
|
|
118
114
|
onMouseLeave: handleMouseLeave
|
|
119
|
-
}), getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor
|
|
115
|
+
}), getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor), renderToolTip());
|
|
120
116
|
}
|
|
121
117
|
return /*#__PURE__*/React.createElement("button", _extends({}, useTitle && {
|
|
122
118
|
title: ariaLabel || label
|
|
@@ -137,7 +133,7 @@ const ButtonLink = props => {
|
|
|
137
133
|
onMouseLeave: handleMouseLeave,
|
|
138
134
|
tabIndex: 0,
|
|
139
135
|
disabled: disabled
|
|
140
|
-
}), getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor
|
|
136
|
+
}), getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor), renderToolTip());
|
|
141
137
|
};
|
|
142
138
|
ButtonLink.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
143
139
|
export default ButtonLink;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","useState","useMemo","classnames","Link","FaIcon","ICONS","ToolTip","propTypes","style","getButtonContent","icon","content","hovered","hoverBackgroundColor","hoverColor","isCustomSkillMenu","type","faIcon","position","Icon","labelClassName","label","customSkillLabel","createElement","className","buttonContent","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","customSkillButton","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 from '../icon';\nimport {ICONS} from '../../util/button-icons';\nimport ToolTip from '../tooltip';\nimport propTypes, {ButtonLinkProps, IconType} from './types';\nimport style from './style.css';\n\nconst getButtonContent = (\n icon?: IconType,\n content?: string | React.ReactNode,\n hovered?: boolean,\n hoverBackgroundColor?: string,\n hoverColor?: string,\n isCustomSkillMenu?: boolean\n) => {\n const {type, faIcon, position} = icon || {type: '', position: ''};\n const Icon = type && ICONS[type];\n\n const labelClassName = classnames(style.label, {\n [style.customSkillLabel]: isCustomSkillMenu && faIcon\n });\n\n if (!Icon && !faIcon) {\n return (\n <div className={style.buttonContent}>\n <span className={labelClassName}>{content}</span>\n </div>\n );\n }\n\n const iconComponent = faIcon ? (\n <FaIcon\n {...{\n iconName: faIcon.name,\n iconColor: hovered && hoverColor ? hoverColor : faIcon.color,\n // eslint-disable-next-line no-nested-ternary\n backgroundColor: !faIcon?.backgroundColor\n ? 'transparent'\n : hovered && hoverBackgroundColor\n ? hoverBackgroundColor\n : faIcon.backgroundColor,\n size: {\n faSize: faIcon.size,\n wrapperSize: faIcon.size\n },\n customStyle: faIcon.customStyle\n }}\n />\n ) : (\n <Icon className={style.icon} theme=\"coorpmanager\" />\n );\n\n return (\n <div className={style.buttonContent}>\n {position === 'left' ? iconComponent : null}\n {content ? <span className={labelClassName}>{content}</span> : null}\n {position === 'right' ? iconComponent : null}\n </div>\n );\n};\n\nconst ButtonLink = (props: ButtonLinkProps) => {\n const {\n type,\n usage = 'button',\n label,\n content,\n hoverBackgroundColor,\n hoverColor,\n disabled = false,\n icon,\n 'data-name': dataName,\n 'data-testid': dataTestId = 'button-link',\n 'aria-label': ariaLabel,\n tooltipText,\n tooltipPlacement = 'left',\n link,\n onClick = noop,\n onKeyDown = noop,\n className,\n customStyle,\n useTitle = true,\n isCustomSkillMenu\n } = props;\n const styleButton = classnames(\n className,\n style.button,\n !label && style.iconButton,\n type === 'primary' && style.primary,\n type === 'secondary' && style.secondary,\n type === 'tertiary' && style.tertiary,\n type === 'text' && style.text,\n type === 'dangerous' && style.dangerous,\n link && style.link,\n disabled && style.disabled,\n isCustomSkillMenu && style.customSkillButton\n );\n\n const [hovered, setHovered] = useState(false);\n\n const handleOnClick = useCallback(event => onClick(event), [onClick]);\n\n const handleOnKeyDown = useCallback(event => onKeyDown(event), [onKeyDown]);\n\n const handleMouseOver = useCallback(() => {\n setHovered(true);\n }, [setHovered]);\n\n const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);\n\n const TooltipContent = useCallback(\n () => <span className={style.tooltipContentWrapper}>{tooltipText || ariaLabel}</span>,\n [tooltipText, ariaLabel]\n );\n\n const renderToolTip = () => {\n const closeToolTipInformationTextAriaLabel = tooltipText || ariaLabel;\n if (!closeToolTipInformationTextAriaLabel) return null;\n return (\n <ToolTip\n fontSize={12}\n anchorId=\"button-icon\"\n toolTipIsVisible={hovered}\n placement={tooltipPlacement}\n TooltipContent={TooltipContent}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n />\n );\n };\n\n const _customStyle = useMemo(() => {\n return {\n ...customStyle,\n ...((hoverBackgroundColor || hoverColor) && hovered\n ? {\n backgroundColor: hoverBackgroundColor,\n color: hoverColor\n }\n : null)\n };\n }, [hoverBackgroundColor, hoverColor, hovered, customStyle]);\n\n if (link) {\n return (\n <Link\n {...link}\n {...(useTitle && {\n title: ariaLabel || label\n })}\n style={customStyle}\n className={styleButton}\n data-name={dataName}\n data-testid={dataTestId}\n aria-label={ariaLabel || label}\n hoverColor={hoverColor}\n hoverBackgroundColor={hoverBackgroundColor}\n onMouseEnter={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n >\n {getButtonContent(\n icon,\n content ?? label,\n hovered,\n hoverBackgroundColor,\n hoverColor,\n isCustomSkillMenu\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 isCustomSkillMenu\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,MAAM,SAAS;AAC5B,SAAQC,KAAK,QAAO,yBAAyB;AAC7C,OAAOC,OAAO,MAAM,YAAY;AAChC,OAAOC,SAAS,MAAmC,SAAS;AAC5D,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,gBAAgB,GAAGA,CACvBC,IAAe,EACfC,OAAkC,EAClCC,OAAiB,EACjBC,oBAA6B,EAC7BC,UAAmB,EACnBC,iBAA2B,KACxB;EACH,MAAM;IAACC,IAAI;IAAEC,MAAM;IAAEC;EAAQ,CAAC,GAAGR,IAAI,IAAI;IAACM,IAAI,EAAE,EAAE;IAAEE,QAAQ,EAAE;EAAE,CAAC;EACjE,MAAMC,IAAI,GAAGH,IAAI,IAAIX,KAAK,CAACW,IAAI,CAAC;EAEhC,MAAMI,cAAc,GAAGlB,UAAU,CAACM,KAAK,CAACa,KAAK,EAAE;IAC7C,CAACb,KAAK,CAACc,gBAAgB,GAAGP,iBAAiB,IAAIE;EACjD,CAAC,CAAC;EAEF,IAAI,CAACE,IAAI,IAAI,CAACF,M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","classnames","Link","FaIcon","ICONS","ToolTip","propTypes","style","getButtonContent","icon","content","hovered","hoverBackgroundColor","hoverColor","type","faIcon","position","Icon","createElement","className","buttonContent","label","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 from '../icon';\nimport {ICONS} from '../../util/button-icons';\nimport ToolTip from '../tooltip';\nimport propTypes, {ButtonLinkProps, IconType} from './types';\nimport style from './style.css';\n\nconst getButtonContent = (\n icon?: IconType,\n content?: string | React.ReactNode,\n hovered?: boolean,\n hoverBackgroundColor?: string,\n hoverColor?: string\n) => {\n const {type, faIcon, position} = icon || {type: '', position: ''};\n const Icon = type && ICONS[type];\n\n if (!Icon && !faIcon) {\n return (\n <div className={style.buttonContent}>\n <span className={style.label}>{content}</span>\n </div>\n );\n }\n\n const iconComponent = faIcon ? (\n <FaIcon\n {...{\n iconName: faIcon.name,\n iconColor: hovered && hoverColor ? hoverColor : faIcon.color,\n // eslint-disable-next-line no-nested-ternary\n backgroundColor: !faIcon?.backgroundColor\n ? 'transparent'\n : hovered && hoverBackgroundColor\n ? hoverBackgroundColor\n : faIcon.backgroundColor,\n size: {\n faSize: faIcon.size,\n wrapperSize: faIcon.size\n },\n customStyle: faIcon.customStyle\n }}\n />\n ) : (\n <Icon className={style.icon} theme=\"coorpmanager\" />\n );\n\n return (\n <div className={style.buttonContent}>\n {position === 'left' ? iconComponent : null}\n {content ? <span className={style.label}>{content}</span> : null}\n {position === 'right' ? iconComponent : null}\n </div>\n );\n};\n\nconst ButtonLink = (props: ButtonLinkProps) => {\n const {\n type,\n usage = 'button',\n label,\n content,\n hoverBackgroundColor,\n hoverColor,\n disabled = false,\n icon,\n 'data-name': dataName,\n 'data-testid': dataTestId = 'button-link',\n 'aria-label': ariaLabel,\n tooltipText,\n tooltipPlacement = 'left',\n link,\n onClick = noop,\n onKeyDown = noop,\n className,\n customStyle,\n useTitle = true\n } = props;\n const styleButton = classnames(\n className,\n style.button,\n !label && style.iconButton,\n type === 'primary' && style.primary,\n type === 'secondary' && style.secondary,\n type === 'tertiary' && style.tertiary,\n type === 'text' && style.text,\n type === 'dangerous' && style.dangerous,\n link && style.link,\n disabled && style.disabled\n );\n\n const [hovered, setHovered] = useState(false);\n\n const handleOnClick = useCallback(event => onClick(event), [onClick]);\n\n const handleOnKeyDown = useCallback(event => onKeyDown(event), [onKeyDown]);\n\n const handleMouseOver = useCallback(() => {\n setHovered(true);\n }, [setHovered]);\n\n const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);\n\n const TooltipContent = useCallback(\n () => <span className={style.tooltipContentWrapper}>{tooltipText || ariaLabel}</span>,\n [tooltipText, ariaLabel]\n );\n\n const renderToolTip = () => {\n const closeToolTipInformationTextAriaLabel = tooltipText || ariaLabel;\n if (!closeToolTipInformationTextAriaLabel) return null;\n return (\n <ToolTip\n fontSize={12}\n anchorId=\"button-icon\"\n toolTipIsVisible={hovered}\n placement={tooltipPlacement}\n TooltipContent={TooltipContent}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n />\n );\n };\n\n const _customStyle = useMemo(() => {\n return {\n ...customStyle,\n ...((hoverBackgroundColor || hoverColor) && hovered\n ? {\n backgroundColor: hoverBackgroundColor,\n color: hoverColor\n }\n : null)\n };\n }, [hoverBackgroundColor, hoverColor, hovered, customStyle]);\n\n if (link) {\n return (\n <Link\n {...link}\n {...(useTitle && {\n title: ariaLabel || label\n })}\n style={customStyle}\n className={styleButton}\n data-name={dataName}\n data-testid={dataTestId}\n aria-label={ariaLabel || label}\n hoverColor={hoverColor}\n hoverBackgroundColor={hoverBackgroundColor}\n onMouseEnter={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n >\n {getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor)}\n {renderToolTip()}\n </Link>\n );\n }\n\n return (\n <button\n {...(useTitle && {\n title: ariaLabel || label\n })}\n {...(ariaLabel && !label\n ? {\n 'data-for': 'button-icon',\n 'data-tip': hovered\n }\n : {})}\n // eslint-disable-next-line react/button-has-type\n type={usage}\n aria-label={ariaLabel || label}\n data-name={dataName}\n data-testid={dataTestId}\n style={_customStyle}\n className={styleButton}\n onClick={handleOnClick}\n onKeyDown={handleOnKeyDown}\n onMouseOver={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n tabIndex={0}\n disabled={disabled}\n >\n {getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor)}\n {renderToolTip()}\n </button>\n );\n};\n\nButtonLink.propTypes = propTypes;\n\nexport default ButtonLink;\n"],"mappings":";;AAAA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,QAAQ,EAAEC,OAAO,QAAO,OAAO;AAE3D,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,IAAI,MAAM,SAAS;AAC1B,OAAOC,MAAM,MAAM,SAAS;AAC5B,SAAQC,KAAK,QAAO,yBAAyB;AAC7C,OAAOC,OAAO,MAAM,YAAY;AAChC,OAAOC,SAAS,MAAmC,SAAS;AAC5D,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,gBAAgB,GAAGA,CACvBC,IAAe,EACfC,OAAkC,EAClCC,OAAiB,EACjBC,oBAA6B,EAC7BC,UAAmB,KAChB;EACH,MAAM;IAACC,IAAI;IAAEC,MAAM;IA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E,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGxE,SAAS;AAEhC,eAAe2B,UAAU","ignoreList":[]}
|
|
@@ -26,7 +26,6 @@ declare const propTypes: {
|
|
|
26
26
|
disabled: PropTypes.Requireable<boolean>;
|
|
27
27
|
className: PropTypes.Requireable<string>;
|
|
28
28
|
customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
29
|
-
isCustomSkillMenu: PropTypes.Requireable<boolean>;
|
|
30
29
|
};
|
|
31
30
|
export declare type FaIcontype = {
|
|
32
31
|
name: string;
|
|
@@ -64,7 +63,6 @@ export declare type ButtonLinkProps = {
|
|
|
64
63
|
className?: string;
|
|
65
64
|
customStyle?: Record<string, unknown>;
|
|
66
65
|
useTitle?: boolean;
|
|
67
|
-
isCustomSkillMenu?: boolean;
|
|
68
66
|
};
|
|
69
67
|
export declare type Fixture = {
|
|
70
68
|
props: ButtonLinkProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/atom/button-link/types.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAC,KAAK,EAAC,MAAM,yBAAyB,CAAC;AAE9C,QAAA,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/atom/button-link/types.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAC,KAAK,EAAC,MAAM,yBAAyB,CAAC;AAE9C,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;CAyBd,CAAC;AAEF,oBAAY,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,E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;CACpB,CAAC;AAEF,oBAAY,OAAO,GAAG;IAAC,KAAK,EAAE,eAAe,CAAA;CAAC,CAAC;AAE/C,eAAe,SAAS,CAAC"}
|
|
@@ -25,8 +25,7 @@ const propTypes = {
|
|
|
25
25
|
hoverColor: PropTypes.string,
|
|
26
26
|
disabled: PropTypes.bool,
|
|
27
27
|
className: PropTypes.string,
|
|
28
|
-
customStyle: PropTypes.shape({})
|
|
29
|
-
isCustomSkillMenu: PropTypes.bool
|
|
28
|
+
customStyle: PropTypes.shape({})
|
|
30
29
|
};
|
|
31
30
|
export default propTypes;
|
|
32
31
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["PropTypes","ICONS","propTypes","type","oneOf","usage","label","string","content","node","tooltipText","tooltipPlacement","icon","shape","position","_keys","onClick","func","link","href","download","bool","target","hoverBackgroundColor","hoverColor","disabled","className","customStyle"
|
|
1
|
+
{"version":3,"file":"types.js","names":["PropTypes","ICONS","propTypes","type","oneOf","usage","label","string","content","node","tooltipText","tooltipPlacement","icon","shape","position","_keys","onClick","func","link","href","download","bool","target","hoverBackgroundColor","hoverColor","disabled","className","customStyle"],"sources":["../../../src/atom/button-link/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport {keys} from 'lodash/fp';\nimport {ICONS} from '../../util/button-icons';\n\nconst propTypes = {\n type: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),\n usage: PropTypes.oneOf(['button', 'submit', 'reset']),\n label: PropTypes.string,\n content: PropTypes.node,\n 'aria-label': PropTypes.string,\n tooltipText: PropTypes.string,\n tooltipPlacement: PropTypes.oneOf(['left', 'right', 'top', 'bottom']),\n 'data-name': PropTypes.string,\n 'data-testid': PropTypes.string,\n icon: PropTypes.shape({\n position: PropTypes.oneOf(['right', 'left']),\n type: PropTypes.oneOf(keys(ICONS))\n }),\n onClick: PropTypes.func,\n link: PropTypes.shape({\n href: PropTypes.string,\n download: PropTypes.bool,\n target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top'])\n }),\n hoverBackgroundColor: PropTypes.string,\n hoverColor: PropTypes.string,\n disabled: PropTypes.bool,\n className: PropTypes.string,\n customStyle: PropTypes.shape({})\n};\n\nexport type FaIcontype = {\n name: string;\n color?: string;\n backgroundColor?: string;\n size?: number;\n customStyle?: Record<string, unknown>;\n};\n\nexport type IconType = {\n position: 'right' | 'left';\n type?: keyof typeof ICONS;\n faIcon?: FaIcontype;\n};\nexport type ButtonLinkProps = {\n type?: 'primary' | 'secondary' | 'tertiary' | 'text' | 'dangerous';\n usage?: 'button' | 'submit' | 'reset';\n label?: string;\n content?: React.ReactNode;\n 'aria-label'?: string;\n tooltipText?: string;\n tooltipPlacement?: 'left' | 'right' | 'top' | 'bottom';\n 'data-name'?: string;\n 'data-testid'?: string;\n icon?: IconType;\n onClick?: () => void;\n onKeyDown?: () => void;\n link?: {\n href?: string;\n download?: boolean;\n target?: '_self' | '_blank' | '_parent' | '_top';\n };\n hoverBackgroundColor?: string;\n hoverColor?: string;\n disabled?: boolean;\n className?: string;\n customStyle?: Record<string, unknown>;\n useTitle?: boolean;\n};\n\nexport type Fixture = {props: ButtonLinkProps};\n\nexport default propTypes;\n"],"mappings":";AAAA,OAAOA,SAAS,MAAM,YAAY;AAElC,SAAQC,KAAK,QAAO,yBAAyB;AAE7C,MAAMC,SAAS,GAAG;EAChBC,IAAI,EAAEH,SAAS,CAACI,KAAK,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;EAChFC,KAAK,EAAEL,SAAS,CAACI,KAAK,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;EACrDE,KAAK,EAAEN,SAAS,CAACO,MAAM;EACvBC,OAAO,EAAER,SAAS,CAACS,IAAI;EACvB,YAAY,EAAET,SAAS,CAACO,MAAM;EAC9BG,WAAW,EAAEV,SAAS,CAACO,MAAM;EAC7BI,gBAAgB,EAAEX,SAAS,CAACI,KAAK,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;EACrE,WAAW,EAAEJ,SAAS,CAACO,MAAM;EAC7B,aAAa,EAAEP,SAAS,CAACO,MAAM;EAC/BK,IAAI,EAAEZ,SAAS,CAACa,KAAK,CAAC;IACpBC,QAAQ,EAAEd,SAAS,CAACI,KAAK,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC5CD,IAAI,EAAEH,SAAS,CAACI,KAAK,CAACW,KAAA,CAAKd,KAAK,CAAC;EACnC,CAAC,CAAC;EACFe,OAAO,EAAEhB,SAAS,CAACiB,IAAI;EACvBC,IAAI,EAAElB,SAAS,CAACa,KAAK,CAAC;IACpBM,IAAI,EAAEnB,SAAS,CAACO,MAAM;IACtBa,QAAQ,EAAEpB,SAAS,CAACqB,IAAI;IACxBC,MAAM,EAAEtB,SAAS,CAACI,KAAK,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC;EAChE,CAAC,CAAC;EACFmB,oBAAoB,EAAEvB,SAAS,CAACO,MAAM;EACtCiB,UAAU,EAAExB,SAAS,CAACO,MAAM;EAC5BkB,QAAQ,EAAEzB,SAAS,CAACqB,IAAI;EACxBK,SAAS,EAAE1B,SAAS,CAACO,MAAM;EAC3BoB,WAAW,EAAE3B,SAAS,CAACa,KAAK,CAAC,CAAC,CAAC;AACjC,CAAC;AA2CD,eAAeX,SAAS","ignoreList":[]}
|
|
@@ -46,14 +46,14 @@
|
|
|
46
46
|
composes: button;
|
|
47
47
|
width: 44px;
|
|
48
48
|
height: 44px;
|
|
49
|
-
border-radius:
|
|
49
|
+
border-radius: 7px;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
.responsive {
|
|
53
53
|
composes: button;
|
|
54
54
|
width: 44px;
|
|
55
55
|
height: 44px;
|
|
56
|
-
border-radius:
|
|
56
|
+
border-radius: 7px;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
.responsive .icon {
|
|
@@ -9,21 +9,6 @@ declare const ButtonMenu: {
|
|
|
9
9
|
label: import("prop-types").Validator<string>;
|
|
10
10
|
onClick: import("prop-types").Validator<(...args: any[]) => any>;
|
|
11
11
|
type: import("prop-types").Requireable<string>;
|
|
12
|
-
linkType: import("prop-types").Requireable<string>;
|
|
13
|
-
icon: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
14
|
-
position: import("prop-types").Validator<string>;
|
|
15
|
-
type: import("prop-types").Requireable<string>;
|
|
16
|
-
faIcon: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
17
|
-
name: import("prop-types").Validator<string>;
|
|
18
|
-
size: import("prop-types").Requireable<number>;
|
|
19
|
-
color: import("prop-types").Requireable<string>;
|
|
20
|
-
}>>;
|
|
21
|
-
}>>;
|
|
22
|
-
customStyle: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
23
|
-
color: import("prop-types").Requireable<string>;
|
|
24
|
-
hoverBackgroundColor: import("prop-types").Requireable<string>;
|
|
25
|
-
}>>;
|
|
26
|
-
isCustomSkillMenu: import("prop-types").Requireable<boolean>;
|
|
27
12
|
}> | null | undefined)[]>;
|
|
28
13
|
'data-name': import("prop-types").Requireable<string>;
|
|
29
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-menu/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-menu/index.tsx"],"names":[],"mappings":";AAIA,OAAkB,EAAC,eAAe,EAA+B,MAAM,SAAS,CAAC;AAiCjF,QAAA,MAAM,UAAU;YAAW,eAAe;;;;;;;;;;;CAazC,CAAC;AAIF,eAAe,UAAU,CAAC"}
|
|
@@ -2,53 +2,19 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
2
2
|
import React, { useMemo, useCallback } from 'react';
|
|
3
3
|
import map from 'lodash/fp/map';
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
-
import ButtonLink from '../button-link';
|
|
6
5
|
import style from './style.css';
|
|
7
6
|
import propTypes, { buttonPropTypes } from './types';
|
|
8
|
-
const getIconProps = icon => {
|
|
9
|
-
if (!icon) return undefined;
|
|
10
|
-
return icon.faIcon ? {
|
|
11
|
-
faIcon: {
|
|
12
|
-
name: icon.faIcon.name,
|
|
13
|
-
size: icon.faIcon.size,
|
|
14
|
-
color: icon.faIcon.color
|
|
15
|
-
},
|
|
16
|
-
position: icon.position
|
|
17
|
-
} : {
|
|
18
|
-
type: icon.type,
|
|
19
|
-
position: icon.position
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
7
|
const Button = props => {
|
|
23
8
|
const {
|
|
24
9
|
'data-name': dataName,
|
|
25
10
|
disabled,
|
|
26
11
|
label,
|
|
27
12
|
onClick,
|
|
28
|
-
type = 'default'
|
|
29
|
-
linkType,
|
|
30
|
-
icon,
|
|
31
|
-
customStyle,
|
|
32
|
-
isCustomSkillMenu
|
|
13
|
+
type = 'default'
|
|
33
14
|
} = props;
|
|
34
|
-
const styleButton = classnames(style.button, type === 'default' && style.default, type === 'defaultLeft' && style.defaultLeft, type === 'dangerous' && style.dangerous, type === 'dangerousLeft' && style.dangerousLeft, disabled && style.disabled
|
|
15
|
+
const styleButton = classnames(style.button, type === 'default' && style.default, type === 'defaultLeft' && style.defaultLeft, type === 'dangerous' && style.dangerous, type === 'dangerousLeft' && style.dangerousLeft, disabled && style.disabled);
|
|
35
16
|
const handleOnClick = useCallback(() => onClick(), [onClick]);
|
|
36
|
-
|
|
37
|
-
return icon ? /*#__PURE__*/React.createElement(ButtonLink, {
|
|
38
|
-
label: label,
|
|
39
|
-
type: linkType,
|
|
40
|
-
disabled: disabled,
|
|
41
|
-
onClick: handleOnClick,
|
|
42
|
-
"data-name": dataName,
|
|
43
|
-
className: styleButton,
|
|
44
|
-
customStyle: {
|
|
45
|
-
color: customStyle?.color
|
|
46
|
-
},
|
|
47
|
-
hoverBackgroundColor: customStyle?.hoverBackgroundColor,
|
|
48
|
-
hoverColor: customStyle?.color,
|
|
49
|
-
icon: iconProps,
|
|
50
|
-
isCustomSkillMenu: isCustomSkillMenu
|
|
51
|
-
}) : /*#__PURE__*/React.createElement("button", {
|
|
17
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
52
18
|
type: "button",
|
|
53
19
|
"aria-label": label,
|
|
54
20
|
title: label,
|
|
@@ -66,8 +32,7 @@ Button.propTypes = process.env.NODE_ENV !== "production" ? buttonPropTypes : {};
|
|
|
66
32
|
const ButtonMenu = props => {
|
|
67
33
|
const {
|
|
68
34
|
buttons,
|
|
69
|
-
'data-name': dataName
|
|
70
|
-
isCustomSkillMenu
|
|
35
|
+
'data-name': dataName
|
|
71
36
|
} = props;
|
|
72
37
|
const buildButton = useCallback((button, index) => {
|
|
73
38
|
return /*#__PURE__*/React.createElement(Button, _extends({}, button, {
|
|
@@ -80,10 +45,7 @@ const ButtonMenu = props => {
|
|
|
80
45
|
cap: false
|
|
81
46
|
})(buildButton, buttons), [buttons, buildButton]);
|
|
82
47
|
return /*#__PURE__*/React.createElement("div", {
|
|
83
|
-
"data-name": dataName
|
|
84
|
-
className: classnames({
|
|
85
|
-
[style.buttonMenuContainer]: isCustomSkillMenu
|
|
86
|
-
})
|
|
48
|
+
"data-name": dataName
|
|
87
49
|
}, buttonList);
|
|
88
50
|
};
|
|
89
51
|
ButtonMenu.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","useCallback","map","classnames","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","useCallback","map","classnames","style","propTypes","buttonPropTypes","Button","props","dataName","disabled","label","onClick","type","styleButton","button","default","defaultLeft","dangerous","dangerousLeft","handleOnClick","createElement","title","className","buttonContent","process","env","NODE_ENV","ButtonMenu","buttons","buildButton","index","_extends","key","buttonList","convert","cap"],"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 style from './style.css';\nimport propTypes, {ButtonMenuProps, ButtonProps, buttonPropTypes} from './types';\n\nconst Button = (props: ButtonProps) => {\n const {'data-name': dataName, disabled, label, onClick, type = 'default'} = props;\n const styleButton = classnames(\n style.button,\n type === 'default' && style.default,\n type === 'defaultLeft' && style.defaultLeft,\n type === 'dangerous' && style.dangerous,\n type === 'dangerousLeft' && style.dangerousLeft,\n disabled && style.disabled\n );\n\n const handleOnClick = useCallback(() => onClick(), [onClick]);\n return (\n <button\n type=\"button\"\n aria-label={label}\n title={label}\n data-name={dataName}\n className={styleButton}\n onClick={handleOnClick}\n disabled={disabled}\n >\n <div className={style.buttonContent}>\n <span className={style.label}>{label}</span>\n </div>\n </button>\n );\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 <div data-name={dataName}>{buttonList}</div>;\n};\n\nButtonMenu.propTypes = propTypes;\n\nexport default ButtonMenu;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAGC,OAAO,EAAEC,WAAW,QAAO,OAAO;AACjD,OAAOC,GAAG,MAAM,eAAe;AAC/B,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,aAAa;AAC/B,OAAOC,SAAS,IAAiCC,eAAe,QAAO,SAAS;AAEhF,MAAMC,MAAM,GAAIC,KAAkB,IAAK;EACrC,MAAM;IAAC,WAAW,EAAEC,QAAQ;IAAEC,QAAQ;IAAEC,KAAK;IAAEC,O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AGoB;IAAM,EAAE,CAAC;EAC1D,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMG,UAAU,GAAGlC,OAAO;EACxB;EACA,MAAME,GAAG,CAACiC,OAAO,CAAC;IAACC,GAAG,EAAE;EAAK,CAAC,CAAC,CAACN,WAAW,EAAED,OAAO,CAAC,EACrD,CAACA,OAAO,EAAEC,WAAW,CACvB,CAAC;EAED,oBAAO/B,KAAA,CAAAsB,aAAA;IAAK,aAAWZ;EAAS,GAAEyB,UAAgB,CAAC;AACrD,CAAC;AAEDN,UAAU,CAACvB,SAAS,GAAAoB,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGtB,SAAS;AAEhC,eAAeuB,UAAU","ignoreList":[]}
|
|
@@ -59,16 +59,3 @@
|
|
|
59
59
|
composes: dangerous;
|
|
60
60
|
justify-content: flex-start;
|
|
61
61
|
}
|
|
62
|
-
|
|
63
|
-
.customSkillButton {
|
|
64
|
-
background-color: transparent;
|
|
65
|
-
font-weight: 600;
|
|
66
|
-
width: 201px;
|
|
67
|
-
justify-content: flex-start;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.buttonMenuContainer {
|
|
71
|
-
display: flex;
|
|
72
|
-
flex-direction: column;
|
|
73
|
-
gap: 8px;
|
|
74
|
-
}
|
|
@@ -1,26 +1,10 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
import { ButtonLinkProps, IconType } from '../button-link/types';
|
|
3
2
|
export declare const buttonPropTypes: {
|
|
4
3
|
'data-name': PropTypes.Requireable<string>;
|
|
5
4
|
disabled: PropTypes.Requireable<boolean>;
|
|
6
5
|
label: PropTypes.Validator<string>;
|
|
7
6
|
onClick: PropTypes.Validator<(...args: any[]) => any>;
|
|
8
7
|
type: PropTypes.Requireable<string>;
|
|
9
|
-
linkType: PropTypes.Requireable<string>;
|
|
10
|
-
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
11
|
-
position: PropTypes.Validator<string>;
|
|
12
|
-
type: PropTypes.Requireable<string>;
|
|
13
|
-
faIcon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
14
|
-
name: PropTypes.Validator<string>;
|
|
15
|
-
size: PropTypes.Requireable<number>;
|
|
16
|
-
color: PropTypes.Requireable<string>;
|
|
17
|
-
}>>;
|
|
18
|
-
}>>;
|
|
19
|
-
customStyle: PropTypes.Requireable<PropTypes.InferProps<{
|
|
20
|
-
color: PropTypes.Requireable<string>;
|
|
21
|
-
hoverBackgroundColor: PropTypes.Requireable<string>;
|
|
22
|
-
}>>;
|
|
23
|
-
isCustomSkillMenu: PropTypes.Requireable<boolean>;
|
|
24
8
|
};
|
|
25
9
|
declare const propTypes: {
|
|
26
10
|
buttons: PropTypes.Validator<(PropTypes.InferProps<{
|
|
@@ -29,45 +13,21 @@ declare const propTypes: {
|
|
|
29
13
|
label: PropTypes.Validator<string>;
|
|
30
14
|
onClick: PropTypes.Validator<(...args: any[]) => any>;
|
|
31
15
|
type: PropTypes.Requireable<string>;
|
|
32
|
-
linkType: PropTypes.Requireable<string>;
|
|
33
|
-
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
34
|
-
position: PropTypes.Validator<string>;
|
|
35
|
-
type: PropTypes.Requireable<string>;
|
|
36
|
-
faIcon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
37
|
-
name: PropTypes.Validator<string>;
|
|
38
|
-
size: PropTypes.Requireable<number>;
|
|
39
|
-
color: PropTypes.Requireable<string>;
|
|
40
|
-
}>>;
|
|
41
|
-
}>>;
|
|
42
|
-
customStyle: PropTypes.Requireable<PropTypes.InferProps<{
|
|
43
|
-
color: PropTypes.Requireable<string>;
|
|
44
|
-
hoverBackgroundColor: PropTypes.Requireable<string>;
|
|
45
|
-
}>>;
|
|
46
|
-
isCustomSkillMenu: PropTypes.Requireable<boolean>;
|
|
47
16
|
}> | null | undefined)[]>;
|
|
48
17
|
'data-name': PropTypes.Requireable<string>;
|
|
49
18
|
};
|
|
50
19
|
export default propTypes;
|
|
51
|
-
declare type CustomStyleProps = {
|
|
52
|
-
color?: string;
|
|
53
|
-
hoverBackgroundColor?: string;
|
|
54
|
-
};
|
|
55
20
|
export declare type ButtonProps = {
|
|
56
21
|
'data-name'?: string;
|
|
57
22
|
disabled?: boolean;
|
|
58
23
|
label: string;
|
|
59
24
|
onClick: () => void;
|
|
60
25
|
type?: 'default' | 'defaultLeft' | 'dangerous' | 'dangerousLeft';
|
|
61
|
-
linkType?: ButtonLinkProps['type'];
|
|
62
|
-
icon?: IconType;
|
|
63
|
-
customStyle?: CustomStyleProps;
|
|
64
|
-
isCustomSkillMenu?: boolean;
|
|
65
26
|
};
|
|
66
27
|
export declare type ButtonMenuProps = {
|
|
67
28
|
buttons: ButtonProps[];
|
|
68
29
|
'data-name'?: string;
|
|
69
30
|
'aria-label'?: string;
|
|
70
|
-
isCustomSkillMenu?: boolean;
|
|
71
31
|
};
|
|
72
32
|
export declare type ButtonMenuPropsFixture = {
|
|
73
33
|
props: 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;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/atom/button-menu/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,eAAO,MAAM,eAAe;;;;;;CAM3B,CAAC;AAEF,QAAA,MAAM,SAAS;;;;;;;;;CAGd,CAAC;AAEF,eAAe,SAAS,CAAC;AAEzB,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;CAClE,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"}
|
|
@@ -4,22 +4,7 @@ export const buttonPropTypes = {
|
|
|
4
4
|
disabled: PropTypes.bool,
|
|
5
5
|
label: PropTypes.string.isRequired,
|
|
6
6
|
onClick: PropTypes.func.isRequired,
|
|
7
|
-
type: PropTypes.oneOf(['default', 'defaultLeft', 'dangerous', 'dangerousLeft'])
|
|
8
|
-
linkType: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),
|
|
9
|
-
icon: PropTypes.shape({
|
|
10
|
-
position: PropTypes.oneOf(['right', 'left']).isRequired,
|
|
11
|
-
type: PropTypes.string,
|
|
12
|
-
faIcon: PropTypes.shape({
|
|
13
|
-
name: PropTypes.string.isRequired,
|
|
14
|
-
size: PropTypes.number,
|
|
15
|
-
color: PropTypes.string
|
|
16
|
-
})
|
|
17
|
-
}),
|
|
18
|
-
customStyle: PropTypes.shape({
|
|
19
|
-
color: PropTypes.string,
|
|
20
|
-
hoverBackgroundColor: PropTypes.string
|
|
21
|
-
}),
|
|
22
|
-
isCustomSkillMenu: PropTypes.bool
|
|
7
|
+
type: PropTypes.oneOf(['default', 'defaultLeft', 'dangerous', 'dangerousLeft'])
|
|
23
8
|
};
|
|
24
9
|
const propTypes = {
|
|
25
10
|
buttons: PropTypes.arrayOf(PropTypes.shape(buttonPropTypes)).isRequired,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["PropTypes","buttonPropTypes","string","disabled","bool","label","isRequired","onClick","func","type","oneOf","
|
|
1
|
+
{"version":3,"file":"types.js","names":["PropTypes","buttonPropTypes","string","disabled","bool","label","isRequired","onClick","func","type","oneOf","propTypes","buttons","arrayOf","shape"],"sources":["../../../src/atom/button-menu/types.ts"],"sourcesContent":["import PropTypes from 'prop-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};\n\nconst propTypes = {\n buttons: PropTypes.arrayOf(PropTypes.shape(buttonPropTypes)).isRequired,\n 'data-name': 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};\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;AAElC,OAAO,MAAMC,eAAe,GAAG;EAC7B,WAAW,EAAED,SAAS,CAACE,MAAM;EAC7BC,QAAQ,EAAEH,SAAS,CAACI,IAAI;EACxBC,KAAK,EAAEL,SAAS,CAACE,MAAM,CAACI,UAAU;EAClCC,OAAO,EAAEP,SAAS,CAACQ,IAAI,CAACF,UAAU;EAClCG,IAAI,EAAET,SAAS,CAACU,KAAK,CAAC,CAAC,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,eAAe,CAAC;AAChF,CAAC;AAED,MAAMC,SAAS,GAAG;EAChBC,OAAO,EAAEZ,SAAS,CAACa,OAAO,CAACb,SAAS,CAACc,KAAK,CAACb,eAAe,CAAC,CAAC,CAACK,UAAU;EACvE,WAAW,EAAEN,SAAS,CAACE;AACzB,CAAC;AAED,eAAeS,SAAS","ignoreList":[]}
|
package/es/atom/tag/style.css
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
@value colors: "../../variables/colors.css";
|
|
2
2
|
@value white from colors;
|
|
3
|
-
@value cm_yellow_100 from colors;
|
|
4
3
|
@value cm_yellow_200 from colors;
|
|
5
|
-
@value cm_yellow_300 from colors;
|
|
6
4
|
@value cm_positive_100 from colors;
|
|
7
|
-
@value cm_positive_300 from colors;
|
|
8
5
|
@value cm_negative_100 from colors;
|
|
9
6
|
@value cm_orange_700 from colors;
|
|
10
|
-
@value cm_orange_800 from colors;
|
|
11
7
|
@value black from colors;
|
|
12
8
|
@value cm_grey_100 from colors;
|
|
13
9
|
@value cm_grey_500 from colors;
|
|
@@ -47,14 +43,14 @@
|
|
|
47
43
|
|
|
48
44
|
.progress {
|
|
49
45
|
composes: tag;
|
|
50
|
-
background-color: color(
|
|
51
|
-
color:
|
|
46
|
+
background-color: color(cm_yellow_200 a(15%));
|
|
47
|
+
color: cm_yellow_200;
|
|
52
48
|
}
|
|
53
49
|
|
|
54
50
|
.success {
|
|
55
51
|
composes: tag;
|
|
56
|
-
background-color: color(cm_positive_100 a(
|
|
57
|
-
color:
|
|
52
|
+
background-color: color(cm_positive_100 a(15%));
|
|
53
|
+
color: cm_positive_100;
|
|
58
54
|
}
|
|
59
55
|
|
|
60
56
|
.failure {
|
|
@@ -65,8 +61,8 @@
|
|
|
65
61
|
|
|
66
62
|
.warning {
|
|
67
63
|
composes: tag;
|
|
68
|
-
background-color: color(cm_orange_700 a(
|
|
69
|
-
color:
|
|
64
|
+
background-color: color(cm_orange_700 a(15%));
|
|
65
|
+
color: cm_orange_700;
|
|
70
66
|
}
|
|
71
67
|
|
|
72
68
|
.content {
|
|
@@ -12,26 +12,10 @@ declare const BulletPointMenuButton: {
|
|
|
12
12
|
label: import("prop-types").Validator<string>;
|
|
13
13
|
onClick: import("prop-types").Validator<(...args: any[]) => any>;
|
|
14
14
|
type: import("prop-types").Requireable<string>;
|
|
15
|
-
linkType: import("prop-types").Requireable<string>;
|
|
16
|
-
icon: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
17
|
-
position: import("prop-types").Validator<string>;
|
|
18
|
-
type: import("prop-types").Requireable<string>;
|
|
19
|
-
faIcon: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
20
|
-
name: import("prop-types").Validator<string>;
|
|
21
|
-
size: import("prop-types").Requireable<number>;
|
|
22
|
-
color: import("prop-types").Requireable<string>;
|
|
23
|
-
}>>;
|
|
24
|
-
}>>;
|
|
25
|
-
customStyle: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
26
|
-
color: import("prop-types").Requireable<string>;
|
|
27
|
-
hoverBackgroundColor: import("prop-types").Requireable<string>;
|
|
28
|
-
}>>;
|
|
29
|
-
isCustomSkillMenu: import("prop-types").Requireable<boolean>;
|
|
30
15
|
}> | null | undefined)[]>;
|
|
31
16
|
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
32
17
|
menuButtonClassName: import("prop-types").Requireable<string>;
|
|
33
18
|
isBulkMenu: import("prop-types").Requireable<boolean>;
|
|
34
|
-
isCustomSkillMenu: import("prop-types").Requireable<boolean>;
|
|
35
19
|
};
|
|
36
20
|
};
|
|
37
21
|
export default BulletPointMenuButton;
|
|
@@ -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"}
|
|
@@ -13,8 +13,7 @@ const BulletPointMenuButton = props => {
|
|
|
13
13
|
onClick = _noop,
|
|
14
14
|
buttons,
|
|
15
15
|
menuButtonClassName,
|
|
16
|
-
isBulkMenu
|
|
17
|
-
isCustomSkillMenu
|
|
16
|
+
isBulkMenu
|
|
18
17
|
} = props;
|
|
19
18
|
const [visible, setVisible] = useState(false);
|
|
20
19
|
const handleOnClick = useCallback(() => {
|
|
@@ -30,11 +29,10 @@ const BulletPointMenuButton = props => {
|
|
|
30
29
|
}, []);
|
|
31
30
|
const menuProps = {
|
|
32
31
|
'data-name': 'button-menu',
|
|
33
|
-
buttons
|
|
34
|
-
isCustomSkillMenu
|
|
32
|
+
buttons
|
|
35
33
|
};
|
|
36
34
|
const menu = /*#__PURE__*/React.createElement("div", {
|
|
37
|
-
className: classnames(style.bulletPointMenu, isBulkMenu && style.bulkBulletPointMenu, visible && style.visible
|
|
35
|
+
className: classnames(style.bulletPointMenu, isBulkMenu && style.bulkBulletPointMenu, visible && style.visible),
|
|
38
36
|
"data-name": "menu-wrapper",
|
|
39
37
|
"aria-label": menuAriaLabel
|
|
40
38
|
}, /*#__PURE__*/React.createElement(ButtonMenu, menuProps));
|