@coorpacademy/components 11.33.2 → 11.33.3-alpha.12
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 +1 -0
- package/es/atom/button-link/index.d.ts.map +1 -1
- package/es/atom/button-link/index.js +11 -7
- package/es/atom/button-link/index.js.map +1 -1
- package/es/atom/button-link/style.css +10 -0
- package/es/atom/button-link/types.d.ts +2 -0
- package/es/atom/button-link/types.d.ts.map +1 -1
- package/es/atom/button-link/types.js +2 -1
- 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 +15 -0
- package/es/atom/button-menu/index.d.ts.map +1 -1
- package/es/atom/button-menu/index.js +43 -5
- package/es/atom/button-menu/index.js.map +1 -1
- package/es/atom/button-menu/style.css +13 -0
- package/es/atom/button-menu/types.d.ts +40 -0
- package/es/atom/button-menu/types.d.ts.map +1 -1
- package/es/atom/button-menu/types.js +16 -1
- package/es/atom/button-menu/types.js.map +1 -1
- package/es/atom/tag/style.css +10 -6
- package/es/molecule/bullet-point-menu-button/index.d.ts +16 -0
- package/es/molecule/bullet-point-menu-button/index.d.ts.map +1 -1
- package/es/molecule/bullet-point-menu-button/index.js +5 -3
- package/es/molecule/bullet-point-menu-button/index.js.map +1 -1
- package/es/molecule/bullet-point-menu-button/style.css +26 -7
- package/es/molecule/bullet-point-menu-button/types.d.ts +17 -0
- package/es/molecule/bullet-point-menu-button/types.d.ts.map +1 -1
- package/es/molecule/bullet-point-menu-button/types.js +2 -1
- package/es/molecule/bullet-point-menu-button/types.js.map +1 -1
- package/es/molecule/cm-popin/types.d.ts +34 -0
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/expandible-actionable-table/index.d.ts +33 -0
- package/es/molecule/expandible-actionable-table/index.d.ts.map +1 -1
- package/es/molecule/expandible-actionable-table/types.d.ts +33 -0
- package/es/molecule/expandible-actionable-table/types.d.ts.map +1 -1
- package/es/organism/custom-skill-header/index.d.ts +5 -0
- package/es/organism/custom-skill-header/index.d.ts.map +1 -0
- package/es/organism/custom-skill-header/index.js +88 -0
- package/es/organism/custom-skill-header/index.js.map +1 -0
- package/es/organism/custom-skill-header/style.css +54 -0
- package/es/organism/custom-skill-header/types.d.ts +28 -0
- package/es/organism/custom-skill-header/types.d.ts.map +1 -0
- package/es/organism/custom-skill-header/types.js +2 -0
- package/es/organism/custom-skill-header/types.js.map +1 -0
- package/es/organism/list-items/index.d.ts +34 -0
- package/es/organism/setup-header/index.d.ts +4 -0
- package/es/organism/wizard-contents/index.d.ts +35 -0
- package/es/template/app-player/loading/index.d.ts +34 -0
- package/es/template/app-player/player/index.d.ts +68 -0
- package/es/template/app-player/player/slides/index.d.ts +34 -0
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +34 -0
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +34 -0
- package/es/template/app-review/index.d.ts +34 -0
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +34 -0
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.d.ts +34 -0
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/back-office/brand-create/index.d.ts +4 -0
- package/es/template/back-office/brand-create/index.d.ts.map +1 -1
- package/es/template/back-office/brand-list/index.d.ts +4 -0
- package/es/template/back-office/brand-list/index.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +107 -0
- package/es/template/back-office/dashboard-preview/index.d.ts +4 -0
- package/es/template/back-office/layout/index.d.ts +4 -0
- package/es/template/back-office/layout/index.d.ts.map +1 -1
- package/es/template/common/dashboard/index.d.ts +68 -0
- package/es/template/common/search-page/index.d.ts +34 -0
- package/es/template/external-course/index.d.ts +34 -0
- package/es/variables/colors.css +3 -0
- package/lib/atom/button-link/index.d.ts +1 -0
- package/lib/atom/button-link/index.d.ts.map +1 -1
- package/lib/atom/button-link/index.js +11 -7
- package/lib/atom/button-link/index.js.map +1 -1
- package/lib/atom/button-link/style.css +10 -0
- package/lib/atom/button-link/types.d.ts +2 -0
- package/lib/atom/button-link/types.d.ts.map +1 -1
- package/lib/atom/button-link/types.js +2 -1
- 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 +15 -0
- package/lib/atom/button-menu/index.d.ts.map +1 -1
- package/lib/atom/button-menu/index.js +43 -5
- package/lib/atom/button-menu/index.js.map +1 -1
- package/lib/atom/button-menu/style.css +13 -0
- package/lib/atom/button-menu/types.d.ts +40 -0
- package/lib/atom/button-menu/types.d.ts.map +1 -1
- package/lib/atom/button-menu/types.js +16 -1
- package/lib/atom/button-menu/types.js.map +1 -1
- package/lib/atom/tag/style.css +10 -6
- package/lib/molecule/bullet-point-menu-button/index.d.ts +16 -0
- package/lib/molecule/bullet-point-menu-button/index.d.ts.map +1 -1
- package/lib/molecule/bullet-point-menu-button/index.js +5 -3
- package/lib/molecule/bullet-point-menu-button/index.js.map +1 -1
- package/lib/molecule/bullet-point-menu-button/style.css +26 -7
- package/lib/molecule/bullet-point-menu-button/types.d.ts +17 -0
- package/lib/molecule/bullet-point-menu-button/types.d.ts.map +1 -1
- package/lib/molecule/bullet-point-menu-button/types.js +2 -1
- package/lib/molecule/bullet-point-menu-button/types.js.map +1 -1
- package/lib/molecule/cm-popin/types.d.ts +34 -0
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/expandible-actionable-table/index.d.ts +33 -0
- package/lib/molecule/expandible-actionable-table/index.d.ts.map +1 -1
- package/lib/molecule/expandible-actionable-table/types.d.ts +33 -0
- package/lib/molecule/expandible-actionable-table/types.d.ts.map +1 -1
- package/lib/organism/custom-skill-header/index.d.ts +5 -0
- package/lib/organism/custom-skill-header/index.d.ts.map +1 -0
- package/lib/organism/custom-skill-header/index.js +93 -0
- package/lib/organism/custom-skill-header/index.js.map +1 -0
- package/lib/organism/custom-skill-header/style.css +54 -0
- package/lib/organism/custom-skill-header/types.d.ts +28 -0
- package/lib/organism/custom-skill-header/types.d.ts.map +1 -0
- package/lib/organism/custom-skill-header/types.js +4 -0
- package/lib/organism/custom-skill-header/types.js.map +1 -0
- package/lib/organism/list-items/index.d.ts +34 -0
- package/lib/organism/setup-header/index.d.ts +4 -0
- package/lib/organism/wizard-contents/index.d.ts +35 -0
- package/lib/template/app-player/loading/index.d.ts +34 -0
- package/lib/template/app-player/player/index.d.ts +68 -0
- package/lib/template/app-player/player/slides/index.d.ts +34 -0
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +34 -0
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +34 -0
- package/lib/template/app-review/index.d.ts +34 -0
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +34 -0
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.d.ts +34 -0
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/back-office/brand-create/index.d.ts +4 -0
- package/lib/template/back-office/brand-create/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-list/index.d.ts +4 -0
- package/lib/template/back-office/brand-list/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +107 -0
- package/lib/template/back-office/dashboard-preview/index.d.ts +4 -0
- package/lib/template/back-office/layout/index.d.ts +4 -0
- package/lib/template/back-office/layout/index.d.ts.map +1 -1
- package/lib/template/common/dashboard/index.d.ts +68 -0
- package/lib/template/common/search-page/index.d.ts +34 -0
- package/lib/template/external-course/index.d.ts +34 -0
- package/lib/variables/colors.css +3 -0
- package/locales/.mtslconfig.json +1 -0
- package/package.json +2 -2
|
@@ -27,6 +27,7 @@ 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>;
|
|
30
31
|
};
|
|
31
32
|
};
|
|
32
33
|
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;AAyD7D,QAAA,MAAM,UAAU;YAAW,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmJzC,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, isCustomSkillMenu) => {
|
|
12
12
|
const {
|
|
13
13
|
type,
|
|
14
14
|
faIcon,
|
|
@@ -18,11 +18,14 @@ 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
|
+
});
|
|
21
24
|
if (!Icon && !faIcon) {
|
|
22
25
|
return /*#__PURE__*/React.createElement("div", {
|
|
23
26
|
className: style.buttonContent
|
|
24
27
|
}, /*#__PURE__*/React.createElement("span", {
|
|
25
|
-
className:
|
|
28
|
+
className: labelClassName
|
|
26
29
|
}, content));
|
|
27
30
|
}
|
|
28
31
|
const iconComponent = faIcon ? /*#__PURE__*/React.createElement(FaIcon, {
|
|
@@ -42,7 +45,7 @@ const getButtonContent = (icon, content, hovered, hoverBackgroundColor, hoverCol
|
|
|
42
45
|
return /*#__PURE__*/React.createElement("div", {
|
|
43
46
|
className: style.buttonContent
|
|
44
47
|
}, position === 'left' ? iconComponent : null, content ? /*#__PURE__*/React.createElement("span", {
|
|
45
|
-
className:
|
|
48
|
+
className: labelClassName
|
|
46
49
|
}, content) : null, position === 'right' ? iconComponent : null);
|
|
47
50
|
};
|
|
48
51
|
const ButtonLink = props => {
|
|
@@ -65,9 +68,10 @@ const ButtonLink = props => {
|
|
|
65
68
|
onKeyDown = _noop,
|
|
66
69
|
className,
|
|
67
70
|
customStyle,
|
|
68
|
-
useTitle = true
|
|
71
|
+
useTitle = true,
|
|
72
|
+
isCustomSkillMenu
|
|
69
73
|
} = props;
|
|
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);
|
|
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, isCustomSkillMenu && style.customSkillButton);
|
|
71
75
|
const [hovered, setHovered] = useState(false);
|
|
72
76
|
const handleOnClick = useCallback(event => onClick(event), [onClick]);
|
|
73
77
|
const handleOnKeyDown = useCallback(event => onKeyDown(event), [onKeyDown]);
|
|
@@ -112,7 +116,7 @@ const ButtonLink = props => {
|
|
|
112
116
|
hoverBackgroundColor: hoverBackgroundColor,
|
|
113
117
|
onMouseEnter: handleMouseOver,
|
|
114
118
|
onMouseLeave: handleMouseLeave
|
|
115
|
-
}), getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor), renderToolTip());
|
|
119
|
+
}), getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor, isCustomSkillMenu), renderToolTip());
|
|
116
120
|
}
|
|
117
121
|
return /*#__PURE__*/React.createElement("button", _extends({}, useTitle && {
|
|
118
122
|
title: ariaLabel || label
|
|
@@ -133,7 +137,7 @@ const ButtonLink = props => {
|
|
|
133
137
|
onMouseLeave: handleMouseLeave,
|
|
134
138
|
tabIndex: 0,
|
|
135
139
|
disabled: disabled
|
|
136
|
-
}), getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor), renderToolTip());
|
|
140
|
+
}), getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor, isCustomSkillMenu), renderToolTip());
|
|
137
141
|
};
|
|
138
142
|
ButtonLink.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
139
143
|
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","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;IAAEC;EAAQ,CAAC,GAAGP,IAAI,IAAI;IAACK,IAAI,EAAE,EAAE;IAAEE,QAAQ,EAAE;EAAE,CAAC;EACjE,MAAMC,IAAI,GAAGH,IAAI,IAAIV,KAAK,CAACU,IAAI,CAAC;EAEhC,IAAI,CAACG,IAAI,IAAI,CAACF,MAAM,EAAE;IACpB,oBACElB,KAAA,CAAAqB,aAAA;MAAKC,SAAS,EAAEZ,KAAK,CAACa;IAAc,gBAClCvB,KAAA,CAAAqB,aAAA;MAAMC,SAAS,EAAEZ,KAAK,CAACc;IAAM,GAAEX,OAAc,CAC1C,CAAC;EAEV;EAEA,MAAMY,aAAa,GAAGP,MAAM,gBAC1BlB,KAAA,CAAAqB,aAAA,CAACf,MAAM;IAEHoB,QAAQ,EAAER,MAAM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EAEX;EAEA,oBACElE,KAAA,CAAAqB,aAAA,WAAAoD,QAAA,KACOxB,QAAQ,IAAI;IACfyB,KAAK,EAAEhC,SAAS,IAAIlB;EACtB,CAAC,EACIkB,SAAS,IAAI,CAAClB,KAAK,GACpB;IACE,UAAU,EAAE,aAAa;IACzB,UAAU,EAAEV;EACd,CAAC,GACD,CAAC,CAAC;IACN;IACAG,IAAI,EAAEqB,KAAM;IACZ,cAAYI,SAAS,IAAIlB,KAAM;IAC/B,aAAWgB,QAAS;IACpB,eAAaC,UAAW;IACxB/B,KAAK,EAAE8D,YAAa;IACpBlD,SAAS,EAAE4B,WAAY;IACvBJ,OAAO,EAAEa,aAAc;IACvBX,SAAS,EAAEa,eAAgB;IAC3BgB,WAAW,EAAEf,eAAgB;IAC7Bc,YAAY,EAAEb,gBAAiB;IAC/Be,QAAQ,EAAE,CAAE;IACZvC,QAAQ,EAAEA;EAAS,IAElB5B,gBAAgB,CAACC,IAAI,EAAEC,OAAO,IAAIW,KAAK,EAAEV,OAAO,EAAEC,oBAAoB,EAAEC,UAAU,CAAC,EACnFkD,aAAa,CAAC,CACT,CAAC;AAEb,CAAC;AAED9B,UAAU,CAAC3B,SAAS,GAAAsE,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGxE,SAAS;AAEhC,eAAe2B,UAAU","ignoreList":[]}
|
|
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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,EACVC,iBACF,CAAC,EACAqD,aAAa,CAAC,CACT,CAAC;AAEb,CAAC;AAED/B,UAAU,CAAC9B,SAAS,GAAA0E,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG5E,SAAS;AAEhC,eAAe8B,UAAU","ignoreList":[]}
|
|
@@ -26,6 +26,7 @@ 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>;
|
|
29
30
|
};
|
|
30
31
|
export declare type FaIcontype = {
|
|
31
32
|
name: string;
|
|
@@ -63,6 +64,7 @@ export declare type ButtonLinkProps = {
|
|
|
63
64
|
className?: string;
|
|
64
65
|
customStyle?: Record<string, unknown>;
|
|
65
66
|
useTitle?: boolean;
|
|
67
|
+
isCustomSkillMenu?: boolean;
|
|
66
68
|
};
|
|
67
69
|
export declare type Fixture = {
|
|
68
70
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;CA0Bd,CAAC;AAEF,oBAAY,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC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,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,oBAAY,OAAO,GAAG;IAAC,KAAK,EAAE,eAAe,CAAA;CAAC,CAAC;AAE/C,eAAe,SAAS,CAAC"}
|
|
@@ -25,7 +25,8 @@ const propTypes = {
|
|
|
25
25
|
hoverColor: PropTypes.string,
|
|
26
26
|
disabled: PropTypes.bool,
|
|
27
27
|
className: PropTypes.string,
|
|
28
|
-
customStyle: PropTypes.shape({})
|
|
28
|
+
customStyle: PropTypes.shape({}),
|
|
29
|
+
isCustomSkillMenu: PropTypes.bool
|
|
29
30
|
};
|
|
30
31
|
export default propTypes;
|
|
31
32
|
//# 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"],"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;
|
|
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","isCustomSkillMenu"],"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 isCustomSkillMenu: PropTypes.bool\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 isCustomSkillMenu?: 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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EAC3BoB,WAAW,EAAE3B,SAAS,CAACa,KAAK,CAAC,CAAC,CAAC,CAAC;EAChCe,iBAAiB,EAAE5B,SAAS,CAACqB;AAC/B,CAAC;AA4CD,eAAenB,SAAS","ignoreList":[]}
|
|
@@ -46,14 +46,14 @@
|
|
|
46
46
|
composes: button;
|
|
47
47
|
width: 44px;
|
|
48
48
|
height: 44px;
|
|
49
|
-
border-radius:
|
|
49
|
+
border-radius: 12px;
|
|
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: 12px;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
.responsive .icon {
|
|
@@ -9,6 +9,21 @@ 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>;
|
|
12
27
|
}> | null | undefined)[]>;
|
|
13
28
|
'data-name': import("prop-types").Requireable<string>;
|
|
14
29
|
};
|
|
@@ -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":";AAMA,OAAkB,EAAC,eAAe,EAA+B,MAAM,SAAS,CAAC;AA8EjF,QAAA,MAAM,UAAU;YAAW,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;CAsBzC,CAAC;AAIF,eAAe,UAAU,CAAC"}
|
|
@@ -2,19 +2,53 @@ 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';
|
|
5
6
|
import style from './style.css';
|
|
6
7
|
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
|
+
};
|
|
7
22
|
const Button = props => {
|
|
8
23
|
const {
|
|
9
24
|
'data-name': dataName,
|
|
10
25
|
disabled,
|
|
11
26
|
label,
|
|
12
27
|
onClick,
|
|
13
|
-
type = 'default'
|
|
28
|
+
type = 'default',
|
|
29
|
+
linkType,
|
|
30
|
+
icon,
|
|
31
|
+
customStyle,
|
|
32
|
+
isCustomSkillMenu
|
|
14
33
|
} = props;
|
|
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);
|
|
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, isCustomSkillMenu && style.customSkillButton);
|
|
16
35
|
const handleOnClick = useCallback(() => onClick(), [onClick]);
|
|
17
|
-
|
|
36
|
+
const iconProps = useMemo(() => getIconProps(icon), [icon]);
|
|
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", {
|
|
18
52
|
type: "button",
|
|
19
53
|
"aria-label": label,
|
|
20
54
|
title: label,
|
|
@@ -32,7 +66,8 @@ Button.propTypes = process.env.NODE_ENV !== "production" ? buttonPropTypes : {};
|
|
|
32
66
|
const ButtonMenu = props => {
|
|
33
67
|
const {
|
|
34
68
|
buttons,
|
|
35
|
-
'data-name': dataName
|
|
69
|
+
'data-name': dataName,
|
|
70
|
+
isCustomSkillMenu
|
|
36
71
|
} = props;
|
|
37
72
|
const buildButton = useCallback((button, index) => {
|
|
38
73
|
return /*#__PURE__*/React.createElement(Button, _extends({}, button, {
|
|
@@ -45,7 +80,10 @@ const ButtonMenu = props => {
|
|
|
45
80
|
cap: false
|
|
46
81
|
})(buildButton, buttons), [buttons, buildButton]);
|
|
47
82
|
return /*#__PURE__*/React.createElement("div", {
|
|
48
|
-
"data-name": dataName
|
|
83
|
+
"data-name": dataName,
|
|
84
|
+
className: classnames({
|
|
85
|
+
[style.buttonMenuContainer]: isCustomSkillMenu
|
|
86
|
+
})
|
|
49
87
|
}, buttonList);
|
|
50
88
|
};
|
|
51
89
|
ButtonMenu.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","useCallback","map","classnames","style","propTypes","buttonPropTypes","Button","props","dataName","disabled","label","onClick","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","useCallback","map","classnames","ButtonLink","style","propTypes","buttonPropTypes","getIconProps","icon","undefined","faIcon","name","size","color","position","type","Button","props","dataName","disabled","label","onClick","linkType","customStyle","isCustomSkillMenu","styleButton","button","default","defaultLeft","dangerous","dangerousLeft","customSkillButton","handleOnClick","iconProps","createElement","className","hoverBackgroundColor","hoverColor","title","buttonContent","process","env","NODE_ENV","ButtonMenu","buttons","buildButton","index","_extends","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 {IconType} from '../button-link/types';\nimport style from './style.css';\nimport propTypes, {ButtonMenuProps, ButtonProps, buttonPropTypes} from './types';\n\nconst getIconProps = (icon: IconType | undefined) => {\n if (!icon) return undefined;\n return icon.faIcon\n ? {\n faIcon: {\n name: icon.faIcon.name,\n size: icon.faIcon.size,\n color: icon.faIcon.color\n },\n position: icon.position\n }\n : {\n type: icon.type,\n position: icon.position\n };\n};\n\nconst Button = (props: ButtonProps) => {\n const {\n 'data-name': dataName,\n disabled,\n label,\n onClick,\n type = 'default',\n linkType,\n icon,\n customStyle,\n isCustomSkillMenu\n } = 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 isCustomSkillMenu && style.customSkillButton\n );\n\n const handleOnClick = useCallback(() => onClick(), [onClick]);\n\n const iconProps = useMemo(() => getIconProps(icon), [icon]);\n\n return icon ? (\n <ButtonLink\n label={label}\n type={linkType}\n disabled={disabled}\n onClick={handleOnClick}\n data-name={dataName}\n className={styleButton}\n customStyle={{color: customStyle?.color}}\n hoverBackgroundColor={customStyle?.hoverBackgroundColor}\n hoverColor={customStyle?.color}\n icon={iconProps}\n isCustomSkillMenu={isCustomSkillMenu}\n />\n ) : (\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, isCustomSkillMenu} = 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\n data-name={dataName}\n className={classnames({\n [style.buttonMenuContainer]: isCustomSkillMenu\n })}\n >\n {buttonList}\n </div>\n );\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,UAAU,MAAM,gBAAgB;AAEvC,OAAOC,KAAK,MAAM,aAAa;AAC/B,OAAOC,SAAS,IAAiCC,eAAe,QAAO,SAAS;AAEhF,MAAMC,YAAY,GAAIC,IAA0B,IAAK;EACnD,IAAI,CAACA,IA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GlD,OAAO;EACxB;EACA,MAAME,GAAG,CAACiD,OAAO,CAAC;IAACC,GAAG,EAAE;EAAK,CAAC,CAAC,CAACN,WAAW,EAAED,OAAO,CAAC,EACrD,CAACA,OAAO,EAAEC,WAAW,CACvB,CAAC;EAED,oBACE/C,KAAA,CAAAoC,aAAA;IACE,aAAWhB,QAAS;IACpBiB,SAAS,EAAEjC,UAAU,CAAC;MACpB,CAACE,KAAK,CAACgD,mBAAmB,GAAG5B;IAC/B,CAAC;EAAE,GAEFyB,UACE,CAAC;AAEV,CAAC;AAEDN,UAAU,CAACtC,SAAS,GAAAmC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGrC,SAAS;AAEhC,eAAesC,UAAU","ignoreList":[]}
|
|
@@ -59,3 +59,16 @@
|
|
|
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,10 +1,26 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
+
import { ButtonLinkProps, IconType } from '../button-link/types';
|
|
2
3
|
export declare const buttonPropTypes: {
|
|
3
4
|
'data-name': PropTypes.Requireable<string>;
|
|
4
5
|
disabled: PropTypes.Requireable<boolean>;
|
|
5
6
|
label: PropTypes.Validator<string>;
|
|
6
7
|
onClick: PropTypes.Validator<(...args: any[]) => any>;
|
|
7
8
|
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>;
|
|
8
24
|
};
|
|
9
25
|
declare const propTypes: {
|
|
10
26
|
buttons: PropTypes.Validator<(PropTypes.InferProps<{
|
|
@@ -13,21 +29,45 @@ declare const propTypes: {
|
|
|
13
29
|
label: PropTypes.Validator<string>;
|
|
14
30
|
onClick: PropTypes.Validator<(...args: any[]) => any>;
|
|
15
31
|
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>;
|
|
16
47
|
}> | null | undefined)[]>;
|
|
17
48
|
'data-name': PropTypes.Requireable<string>;
|
|
18
49
|
};
|
|
19
50
|
export default propTypes;
|
|
51
|
+
declare type CustomStyleProps = {
|
|
52
|
+
color?: string;
|
|
53
|
+
hoverBackgroundColor?: string;
|
|
54
|
+
};
|
|
20
55
|
export declare type ButtonProps = {
|
|
21
56
|
'data-name'?: string;
|
|
22
57
|
disabled?: boolean;
|
|
23
58
|
label: string;
|
|
24
59
|
onClick: () => void;
|
|
25
60
|
type?: 'default' | 'defaultLeft' | 'dangerous' | 'dangerousLeft';
|
|
61
|
+
linkType?: ButtonLinkProps['type'];
|
|
62
|
+
icon?: IconType;
|
|
63
|
+
customStyle?: CustomStyleProps;
|
|
64
|
+
isCustomSkillMenu?: boolean;
|
|
26
65
|
};
|
|
27
66
|
export declare type ButtonMenuProps = {
|
|
28
67
|
buttons: ButtonProps[];
|
|
29
68
|
'data-name'?: string;
|
|
30
69
|
'aria-label'?: string;
|
|
70
|
+
isCustomSkillMenu?: boolean;
|
|
31
71
|
};
|
|
32
72
|
export declare type ButtonMenuPropsFixture = {
|
|
33
73
|
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;AACnC,OAAO,EAAC,eAAe,EAAE,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAE/D,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;CAqB3B,CAAC;AAEF,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;CAGd,CAAC;AAEF,eAAe,SAAS,CAAC;AAEzB,aAAK,gBAAgB,GAAG;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,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,QAAQ,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IACnC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,oBAAY,sBAAsB,GAAG;IAAC,KAAK,EAAE,eAAe,CAAA;CAAC,CAAC"}
|
|
@@ -4,7 +4,22 @@ 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'])
|
|
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
|
|
8
23
|
};
|
|
9
24
|
const propTypes = {
|
|
10
25
|
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","propTypes","buttons","arrayOf"
|
|
1
|
+
{"version":3,"file":"types.js","names":["PropTypes","buttonPropTypes","string","disabled","bool","label","isRequired","onClick","func","type","oneOf","linkType","icon","shape","position","faIcon","name","size","number","color","customStyle","hoverBackgroundColor","isCustomSkillMenu","propTypes","buttons","arrayOf"],"sources":["../../../src/atom/button-menu/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport {ButtonLinkProps, IconType} 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 linkType: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),\n icon: PropTypes.shape({\n position: PropTypes.oneOf(['right', 'left']).isRequired,\n type: PropTypes.string,\n faIcon: PropTypes.shape({\n name: PropTypes.string.isRequired,\n size: PropTypes.number,\n color: PropTypes.string\n })\n }),\n customStyle: PropTypes.shape({\n color: PropTypes.string,\n hoverBackgroundColor: PropTypes.string\n }),\n isCustomSkillMenu: PropTypes.bool\n};\n\nconst propTypes = {\n buttons: PropTypes.arrayOf(PropTypes.shape(buttonPropTypes)).isRequired,\n 'data-name': PropTypes.string\n};\n\nexport default propTypes;\n\ntype CustomStyleProps = {\n color?: string;\n hoverBackgroundColor?: string;\n};\n\nexport type ButtonProps = {\n 'data-name'?: string;\n disabled?: boolean;\n label: string;\n onClick: () => void;\n type?: 'default' | 'defaultLeft' | 'dangerous' | 'dangerousLeft';\n linkType?: ButtonLinkProps['type'];\n icon?: IconType;\n customStyle?: CustomStyleProps;\n isCustomSkillMenu?: boolean;\n};\n\nexport type ButtonMenuProps = {\n buttons: ButtonProps[];\n 'data-name'?: string;\n 'aria-label'?: string;\n isCustomSkillMenu?: boolean;\n};\n\nexport type ButtonMenuPropsFixture = {props: ButtonMenuProps};\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,YAAY;AAGlC,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,CAAC;EAC/EC,QAAQ,EAAEX,SAAS,CAACU,KAAK,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;EACpFE,IAAI,EAAEZ,SAAS,CAACa,KAAK,CAAC;IACpBC,QAAQ,EAAEd,SAAS,CAACU,KAAK,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAACJ,UAAU;IACvDG,IAAI,EAAET,SAAS,CAACE,MAAM;IACtBa,MAAM,EAAEf,SAAS,CAACa,KAAK,CAAC;MACtBG,IAAI,EAAEhB,SAAS,CAACE,MAAM,CAACI,UAAU;MACjCW,IAAI,EAAEjB,SAAS,CAACkB,MAAM;MACtBC,KAAK,EAAEnB,SAAS,CAACE;IACnB,CAAC;EACH,CAAC,CAAC;EACFkB,WAAW,EAAEpB,SAAS,CAACa,KAAK,CAAC;IAC3BM,KAAK,EAAEnB,SAAS,CAACE,MAAM;IACvBmB,oBAAoB,EAAErB,SAAS,CAACE;EAClC,CAAC,CAAC;EACFoB,iBAAiB,EAAEtB,SAAS,CAACI;AAC/B,CAAC;AAED,MAAMmB,SAAS,GAAG;EAChBC,OAAO,EAAExB,SAAS,CAACyB,OAAO,CAACzB,SAAS,CAACa,KAAK,CAACZ,eAAe,CAAC,CAAC,CAACK,UAAU;EACvE,WAAW,EAAEN,SAAS,CAACE;AACzB,CAAC;AAED,eAAeqB,SAAS","ignoreList":[]}
|
package/es/atom/tag/style.css
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
@value colors: "../../variables/colors.css";
|
|
2
2
|
@value white from colors;
|
|
3
|
+
@value cm_yellow_100 from colors;
|
|
3
4
|
@value cm_yellow_200 from colors;
|
|
5
|
+
@value cm_yellow_300 from colors;
|
|
4
6
|
@value cm_positive_100 from colors;
|
|
7
|
+
@value cm_positive_300 from colors;
|
|
5
8
|
@value cm_negative_100 from colors;
|
|
6
9
|
@value cm_orange_700 from colors;
|
|
10
|
+
@value cm_orange_800 from colors;
|
|
7
11
|
@value black from colors;
|
|
8
12
|
@value cm_grey_100 from colors;
|
|
9
13
|
@value cm_grey_500 from colors;
|
|
@@ -43,14 +47,14 @@
|
|
|
43
47
|
|
|
44
48
|
.progress {
|
|
45
49
|
composes: tag;
|
|
46
|
-
background-color: color(
|
|
47
|
-
color:
|
|
50
|
+
background-color: color(cm_yellow_100 a(25%));
|
|
51
|
+
color: cm_yellow_300;
|
|
48
52
|
}
|
|
49
53
|
|
|
50
54
|
.success {
|
|
51
55
|
composes: tag;
|
|
52
|
-
background-color: color(cm_positive_100 a(
|
|
53
|
-
color:
|
|
56
|
+
background-color: color(cm_positive_100 a(20%));
|
|
57
|
+
color: cm_positive_300;
|
|
54
58
|
}
|
|
55
59
|
|
|
56
60
|
.failure {
|
|
@@ -61,8 +65,8 @@
|
|
|
61
65
|
|
|
62
66
|
.warning {
|
|
63
67
|
composes: tag;
|
|
64
|
-
background-color: color(cm_orange_700 a(
|
|
65
|
-
color:
|
|
68
|
+
background-color: color(cm_orange_700 a(18%));
|
|
69
|
+
color: cm_orange_800;
|
|
66
70
|
}
|
|
67
71
|
|
|
68
72
|
.content {
|
|
@@ -12,10 +12,26 @@ 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>;
|
|
15
30
|
}> | null | undefined)[]>;
|
|
16
31
|
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
17
32
|
menuButtonClassName: import("prop-types").Requireable<string>;
|
|
18
33
|
isBulkMenu: import("prop-types").Requireable<boolean>;
|
|
34
|
+
isCustomSkillMenu: import("prop-types").Requireable<boolean>;
|
|
19
35
|
};
|
|
20
36
|
};
|
|
21
37
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8D/D,CAAC;AAIF,eAAe,qBAAqB,CAAC"}
|
|
@@ -13,7 +13,8 @@ const BulletPointMenuButton = props => {
|
|
|
13
13
|
onClick = _noop,
|
|
14
14
|
buttons,
|
|
15
15
|
menuButtonClassName,
|
|
16
|
-
isBulkMenu
|
|
16
|
+
isBulkMenu,
|
|
17
|
+
isCustomSkillMenu
|
|
17
18
|
} = props;
|
|
18
19
|
const [visible, setVisible] = useState(false);
|
|
19
20
|
const handleOnClick = useCallback(() => {
|
|
@@ -29,10 +30,11 @@ const BulletPointMenuButton = props => {
|
|
|
29
30
|
}, []);
|
|
30
31
|
const menuProps = {
|
|
31
32
|
'data-name': 'button-menu',
|
|
32
|
-
buttons
|
|
33
|
+
buttons,
|
|
34
|
+
isCustomSkillMenu
|
|
33
35
|
};
|
|
34
36
|
const menu = /*#__PURE__*/React.createElement("div", {
|
|
35
|
-
className: classnames(style.bulletPointMenu, isBulkMenu && style.bulkBulletPointMenu, visible && style.visible),
|
|
37
|
+
className: classnames(style.bulletPointMenu, isBulkMenu && style.bulkBulletPointMenu, visible && style.visible, isCustomSkillMenu && style.customSkillBulletPointMenu),
|
|
36
38
|
"data-name": "menu-wrapper",
|
|
37
39
|
"aria-label": menuAriaLabel
|
|
38
40
|
}, /*#__PURE__*/React.createElement(ButtonMenu, menuProps));
|